From: Andrea Bianco Date: Fri, 10 Jan 2020 22:53:48 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.2 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=92114fd971ee800d82065074c32173f877e83d6c;p=motion2.git Built motion from commit (unavailable).|2.4.2 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index aacd888..96efbc0 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-01-10T22:36:22.224Z", + "time": "2020-01-10T22:47:52.189Z", "url": "http://apidocjs.com", "version": "0.19.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index b49e24c..3e096e2 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-01-10T22:36:22.224Z", + "time": "2020-01-10T22:47:52.189Z", "url": "http://apidocjs.com", "version": "0.19.1" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 6f5ae96..a83ffea 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 _0x9957=['integration','jscripty','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)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'action':{'type':Sequelize[_0x7995('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7995('0x5'),_0x7995('0x6'),'motionbar',_0x7995('0x7'),_0x7995('0x8'),_0x7995('0x9'),_0x7995('0xa'),_0x7995('0xb')]],'msg':_0x7995('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7995('0xe')},'data3':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xf')},'data4':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data5':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data6':{'type':Sequelize[_0x7995('0x4')]},'data7':{'type':Sequelize[_0x7995('0x10')]}}; \ No newline at end of file +var _0x9957=['integration','jscripty','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)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'action':{'type':Sequelize[_0x7995('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7995('0x5'),_0x7995('0x6'),'motionbar',_0x7995('0x7'),_0x7995('0x8'),_0x7995('0x9'),_0x7995('0xa'),_0x7995('0xb')]],'msg':_0x7995('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7995('0xe')},'data3':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xf')},'data4':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data5':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data6':{'type':Sequelize[_0x7995('0x4')]},'data7':{'type':Sequelize[_0x7995('0x10')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 02cb568..1d45ed0 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 _0x927c=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','body','find','params','catch','Action'];(function(_0x3a17b7,_0x55bf1f){var _0x162c9e=function(_0x11ddad){while(--_0x11ddad){_0x3a17b7['push'](_0x3a17b7['shift']());}};_0x162c9e(++_0x55bf1f);}(_0x927c,0xc8));var _0xc927=function(_0x5d0e9b,_0x6a794b){_0x5d0e9b=_0x5d0e9b-0x0;var _0xaf3e8=_0x927c[_0x5d0e9b];return _0xaf3e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc927('0x0'));var rimraf=require(_0xc927('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc927('0x2'));var rp=require(_0xc927('0x3'));var moment=require(_0xc927('0x4'));var BPromise=require(_0xc927('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc927('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc927('0x7'));var squel=require(_0xc927('0x8'));var crypto=require(_0xc927('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc927('0xa'));var toCsv=require(_0xc927('0x6'));var querystring=require(_0xc927('0xb'));var Papa=require(_0xc927('0xc'));var Redis=require(_0xc927('0xd'));var authService=require(_0xc927('0xe'));var qs=require(_0xc927('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc927('0x10'));var utils=require(_0xc927('0x11'));var config=require(_0xc927('0x12'));var db=require(_0xc927('0x13'))['db'];function respondWithStatusCode(_0x4dd743,_0x43693c){_0x43693c=_0x43693c||0xcc;return function(_0x43176e){if(_0x43176e){return _0x4dd743[_0xc927('0x14')](_0x43693c);}return _0x4dd743[_0xc927('0x15')](_0x43693c)[_0xc927('0x16')]();};}function respondWithResult(_0x434cce,_0x47996a){_0x47996a=_0x47996a||0xc8;return function(_0x286ad0){if(_0x286ad0){return _0x434cce[_0xc927('0x15')](_0x47996a)[_0xc927('0x17')](_0x286ad0);}};}function respondWithFilteredResult(_0x489f80,_0x2466f5){return function(_0x38fc07){if(_0x38fc07){var _0x34db9e=_0x38fc07[_0xc927('0x18')],_0x49e43b=_0x2466f5['offset'],_0xf9ed98=_0x2466f5[_0xc927('0x19')]+_0x2466f5['limit'],_0x40517b;if(_0xf9ed98>=_0x34db9e){_0xf9ed98=_0x34db9e;_0x40517b=0xc8;}else{_0x40517b=0xce;}_0x489f80[_0xc927('0x15')](_0x40517b);return _0x489f80[_0xc927('0x1a')](_0xc927('0x1b'),_0x49e43b+'-'+_0xf9ed98+'/'+_0x34db9e)[_0xc927('0x17')](_0x38fc07);}return null;};}function patchUpdates(_0x14f5d6){return function(_0x1f251c){try{jsonpatch[_0xc927('0x1c')](_0x1f251c,_0x14f5d6,!![]);}catch(_0x16e6d9){return BPromise['reject'](_0x16e6d9);}return _0x1f251c[_0xc927('0x1d')]();};}function saveUpdates(_0xd37d2c,_0x357712){return function(_0x307bc7){if(_0x307bc7){return _0x307bc7['update'](_0xd37d2c)[_0xc927('0x1e')](function(_0x4a3135){return _0x4a3135;});}return null;};}function removeEntity(_0x4d2e82,_0x27a6f2){return function(_0x398995){if(_0x398995){return _0x398995[_0xc927('0x1f')]()[_0xc927('0x1e')](function(){_0x4d2e82[_0xc927('0x15')](0xcc)[_0xc927('0x16')]();});}};}function handleEntityNotFound(_0x346cf2,_0x36da21){return function(_0xac784){if(!_0xac784){_0x346cf2[_0xc927('0x14')](0x194);}return _0xac784;};}function handleError(_0x37c81e,_0x2b35a0){_0x2b35a0=_0x2b35a0||0x1f4;return function(_0x8654c1){logger[_0xc927('0x20')](_0x8654c1['stack']);if(_0x8654c1[_0xc927('0x21')]){delete _0x8654c1['name'];}_0x37c81e[_0xc927('0x15')](_0x2b35a0)[_0xc927('0x22')](_0x8654c1);};}exports['update']=function(_0x3ea795,_0xc1e737){if(_0x3ea795['body']['id']){delete _0x3ea795[_0xc927('0x23')]['id'];}return db['Action'][_0xc927('0x24')]({'where':{'id':_0x3ea795[_0xc927('0x25')]['id']}})[_0xc927('0x1e')](handleEntityNotFound(_0xc1e737,null))[_0xc927('0x1e')](saveUpdates(_0x3ea795['body'],null))[_0xc927('0x1e')](respondWithResult(_0xc1e737,null))[_0xc927('0x26')](handleError(_0xc1e737,null));};exports[_0xc927('0x1f')]=function(_0x4abbe9,_0x2f5e86){return db[_0xc927('0x27')][_0xc927('0x24')]({'where':{'id':_0x4abbe9[_0xc927('0x25')]['id']}})['then'](handleEntityNotFound(_0x2f5e86,null))[_0xc927('0x1e')](removeEntity(_0x2f5e86,null))[_0xc927('0x26')](handleError(_0x2f5e86,null));}; \ No newline at end of file +var _0x99d4=['Content-Range','apply','reject','save','update','then','error','stack','name','send','body','find','params','catch','Action','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','count','offset','limit'];(function(_0x54027d,_0xf52108){var _0x5c9649=function(_0x521618){while(--_0x521618){_0x54027d['push'](_0x54027d['shift']());}};_0x5c9649(++_0xf52108);}(_0x99d4,0x189));var _0x499d=function(_0x25421,_0x11a659){_0x25421=_0x25421-0x0;var _0xfd3891=_0x99d4[_0x25421];return _0xfd3891;};'use strict';var pdf=require(_0x499d('0x0'));var emlformat=require(_0x499d('0x1'));var rimraf=require(_0x499d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x499d('0x3'));var rp=require('request-promise');var moment=require(_0x499d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x499d('0x5'));var path=require('path');var sox=require(_0x499d('0x6'));var csv=require('to-csv');var ejs=require(_0x499d('0x7'));var fs=require('fs');var _=require(_0x499d('0x8'));var squel=require(_0x499d('0x9'));var crypto=require(_0x499d('0xa'));var jsforce=require(_0x499d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x499d('0xc'));var querystring=require(_0x499d('0xd'));var Papa=require(_0x499d('0xe'));var Redis=require(_0x499d('0xf'));var authService=require(_0x499d('0x10'));var qs=require(_0x499d('0x11'));var hardwareService=require(_0x499d('0x12'));var logger=require(_0x499d('0x13'))('api');var utils=require(_0x499d('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58824d,_0x3b7ec2){_0x3b7ec2=_0x3b7ec2||0xcc;return function(_0x59c332){if(_0x59c332){return _0x58824d[_0x499d('0x15')](_0x3b7ec2);}return _0x58824d[_0x499d('0x16')](_0x3b7ec2)['end']();};}function respondWithResult(_0x305d87,_0x35004f){_0x35004f=_0x35004f||0xc8;return function(_0xe54630){if(_0xe54630){return _0x305d87[_0x499d('0x16')](_0x35004f)[_0x499d('0x17')](_0xe54630);}};}function respondWithFilteredResult(_0x33c4f7,_0x1e803a){return function(_0x2ce7b1){if(_0x2ce7b1){var _0x1404ba=_0x2ce7b1[_0x499d('0x18')],_0x5d4311=_0x1e803a['offset'],_0x328c7c=_0x1e803a[_0x499d('0x19')]+_0x1e803a[_0x499d('0x1a')],_0x4ff2ee;if(_0x328c7c>=_0x1404ba){_0x328c7c=_0x1404ba;_0x4ff2ee=0xc8;}else{_0x4ff2ee=0xce;}_0x33c4f7[_0x499d('0x16')](_0x4ff2ee);return _0x33c4f7['set'](_0x499d('0x1b'),_0x5d4311+'-'+_0x328c7c+'/'+_0x1404ba)[_0x499d('0x17')](_0x2ce7b1);}return null;};}function patchUpdates(_0x329b01){return function(_0x19fef8){try{jsonpatch[_0x499d('0x1c')](_0x19fef8,_0x329b01,!![]);}catch(_0x1d439a){return BPromise[_0x499d('0x1d')](_0x1d439a);}return _0x19fef8[_0x499d('0x1e')]();};}function saveUpdates(_0x5667dd,_0x3dd292){return function(_0xc7a9fd){if(_0xc7a9fd){return _0xc7a9fd[_0x499d('0x1f')](_0x5667dd)[_0x499d('0x20')](function(_0x3a40c6){return _0x3a40c6;});}return null;};}function removeEntity(_0x46434a,_0x224e12){return function(_0x5beb4e){if(_0x5beb4e){return _0x5beb4e['destroy']()[_0x499d('0x20')](function(){_0x46434a[_0x499d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc3d0c7,_0x15d5d1){return function(_0x2744b7){if(!_0x2744b7){_0xc3d0c7[_0x499d('0x15')](0x194);}return _0x2744b7;};}function handleError(_0x230e8e,_0xfd7745){_0xfd7745=_0xfd7745||0x1f4;return function(_0x54d1de){logger[_0x499d('0x21')](_0x54d1de[_0x499d('0x22')]);if(_0x54d1de['name']){delete _0x54d1de[_0x499d('0x23')];}_0x230e8e[_0x499d('0x16')](_0xfd7745)[_0x499d('0x24')](_0x54d1de);};}exports[_0x499d('0x1f')]=function(_0x2196ee,_0x48c3fb){if(_0x2196ee[_0x499d('0x25')]['id']){delete _0x2196ee[_0x499d('0x25')]['id'];}return db['Action'][_0x499d('0x26')]({'where':{'id':_0x2196ee[_0x499d('0x27')]['id']}})[_0x499d('0x20')](handleEntityNotFound(_0x48c3fb,null))[_0x499d('0x20')](saveUpdates(_0x2196ee[_0x499d('0x25')],null))[_0x499d('0x20')](respondWithResult(_0x48c3fb,null))[_0x499d('0x28')](handleError(_0x48c3fb,null));};exports['destroy']=function(_0x51096b,_0x5c6619){return db[_0x499d('0x29')][_0x499d('0x26')]({'where':{'id':_0x51096b[_0x499d('0x27')]['id']}})[_0x499d('0x20')](handleEntityNotFound(_0x5c6619,null))[_0x499d('0x20')](removeEntity(_0x5c6619,null))[_0x499d('0x28')](handleError(_0x5c6619,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index cdb0189..4f9c6b2 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 _0xae30=['api','moment','request-promise','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x539ec6,_0x1af59f){var _0x1b0055=function(_0x369008){while(--_0x369008){_0x539ec6['push'](_0x539ec6['shift']());}};_0x1b0055(++_0x1af59f);}(_0xae30,0x17d));var _0x0ae3=function(_0x47a204,_0x24b906){_0x47a204=_0x47a204-0x0;var _0x5623fc=_0xae30[_0x47a204];return _0x5623fc;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var logger=require(_0x0ae3('0x2'))(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ae3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0ae3('0x6'));var attributes=require(_0x0ae3('0x7'));module[_0x0ae3('0x8')]=function(_0x468413,_0x621ffa){return _0x468413[_0x0ae3('0x9')](_0x0ae3('0xa'),attributes,{'tableName':_0x0ae3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f83=['rimraf','../../config/environment','./action.attributes','Action','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4ff708,_0x43aea3){var _0xb4bfcc=function(_0x3543a4){while(--_0x3543a4){_0x4ff708['push'](_0x4ff708['shift']());}};_0xb4bfcc(++_0x43aea3);}(_0x4f83,0x1c7));var _0x34f8=function(_0x26909c,_0x409e12){_0x26909c=_0x26909c-0x0;var _0x381cb3=_0x4f83[_0x26909c];return _0x381cb3;};'use strict';var _=require(_0x34f8('0x0'));var util=require('util');var logger=require(_0x34f8('0x1'))(_0x34f8('0x2'));var moment=require(_0x34f8('0x3'));var BPromise=require(_0x34f8('0x4'));var rp=require(_0x34f8('0x5'));var fs=require('fs');var path=require(_0x34f8('0x6'));var rimraf=require(_0x34f8('0x7'));var config=require(_0x34f8('0x8'));var attributes=require(_0x34f8('0x9'));module['exports']=function(_0xfa87da,_0x5350f5){return _0xfa87da['define'](_0x34f8('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index feb6244..a66cab3 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 _0x0c02=['Action,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2d6750,_0x497792){var _0x5970b1=function(_0x52551c){while(--_0x52551c){_0x2d6750['push'](_0x2d6750['shift']());}};_0x5970b1(++_0x497792);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var moment=require(_0x20c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x20c0('0x2'));var fs=require('fs');var Redis=require(_0x20c0('0x3'));var db=require(_0x20c0('0x4'))['db'];var utils=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var jayson=require(_0x20c0('0x9'));var client=jayson[_0x20c0('0xa')][_0x20c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6408,_0x4e1dac,_0x5da127){return new BPromise(function(_0x4db532,_0x1e35e2){return client[_0x20c0('0xc')](_0x5d6408,_0x5da127)[_0x20c0('0xd')](function(_0x41a4af){logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');logger['debug']('Action,\x20%s,\x20%s,\x20%s',_0x4e1dac,'request\x20sent',JSON['stringify'](_0x41a4af));if(_0x41a4af[_0x20c0('0x10')]){if(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x11')]===0x1f4){logger[_0x20c0('0x10')]('Action,\x20%s,\x20%s',_0x4e1dac,_0x41a4af[_0x20c0('0x10')]['message']);return _0x1e35e2(_0x41a4af['error'][_0x20c0('0x12')]);}logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);return _0x4db532(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);}else{logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');_0x4db532(_0x41a4af[_0x20c0('0x13')][_0x20c0('0x12')]);}})[_0x20c0('0x14')](function(_0x46b9e5){logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x46b9e5);_0x1e35e2(_0x46b9e5);});});} \ No newline at end of file +var _0x202c=['message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b8050,_0x4d12c6){var _0x1ec2b1=function(_0x4c150a){while(--_0x4c150a){_0x1b8050['push'](_0x1b8050['shift']());}};_0x1ec2b1(++_0x4d12c6);}(_0x202c,0x178));var _0xc202=function(_0x234107,_0x581bec){_0x234107=_0x234107-0x0;var _0xf59f50=_0x202c[_0x234107];return _0xf59f50;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Action,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d50a3b3..5493c39 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 _0xefe2=['destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xefe2,0xd9));var _0x2efe=function(_0x23fd48,_0xc6fa3d){_0x23fd48=_0x23fd48-0x0;var _0x2d296e=_0xefe2[_0x23fd48];return _0x2d296e;};'use strict';var multer=require(_0x2efe('0x0'));var util=require(_0x2efe('0x1'));var path=require('path');var timeout=require(_0x2efe('0x2'));var express=require(_0x2efe('0x3'));var router=express['Router']();var auth=require(_0x2efe('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2efe('0x5'));var controller=require(_0x2efe('0x6'));router[_0x2efe('0x7')](_0x2efe('0x8'),auth[_0x2efe('0x9')](),controller['update']);router[_0x2efe('0xa')](_0x2efe('0x8'),auth[_0x2efe('0x9')](),controller[_0x2efe('0xb')]);module['exports']=router; \ No newline at end of file +var _0x6b72=['Router','../../components/auth/service','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x399c45,_0x74910f){var _0x1fc882=function(_0xe7c487){while(--_0xe7c487){_0x399c45['push'](_0x399c45['shift']());}};_0x1fc882(++_0x74910f);}(_0x6b72,0x19d));var _0x26b7=function(_0x5ae36f,_0x43703a){_0x5ae36f=_0x5ae36f-0x0;var _0x2931ae=_0x6b72[_0x5ae36f];return _0x2931ae;};'use strict';var multer=require(_0x26b7('0x0'));var util=require('util');var path=require(_0x26b7('0x1'));var timeout=require(_0x26b7('0x2'));var express=require('express');var router=express[_0x26b7('0x3')]();var auth=require(_0x26b7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26b7('0x5'));router[_0x26b7('0x6')](_0x26b7('0x7'),auth[_0x26b7('0x8')](),controller[_0x26b7('0x9')]);router[_0x26b7('0xa')](_0x26b7('0x7'),auth[_0x26b7('0x8')](),controller[_0x26b7('0xb')]);module[_0x26b7('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 9d25d2f..d9a0d33 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 _0xfbc8=['exports','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbc8,0x73));var _0x8fbc=function(_0x3015f9,_0x6eeb0d){_0x3015f9=_0x3015f9-0x0;var _0x3390b6=_0xfbc8[_0x3015f9];return _0x3390b6;};'use strict';var Sequelize=require(_0x8fbc('0x0'));module[_0x8fbc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8fbc('0x2')]},'parent':{'type':Sequelize[_0x8fbc('0x2')]},'table':{'type':Sequelize[_0x8fbc('0x2')]},'conditions':{'type':Sequelize[_0x8fbc('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe69c=['TEXT','exports','STRING'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xe69c,0x1d2));var _0xce69=function(_0x1302e6,_0x41dcb9){_0x1302e6=_0x1302e6-0x0;var _0x17a8b9=_0xe69c[_0x1302e6];return _0x17a8b9;};'use strict';var Sequelize=require('sequelize');module[_0xce69('0x0')]={'name':{'type':Sequelize[_0xce69('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xce69('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xce69('0x1')]},'conditions':{'type':Sequelize[_0xce69('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 1f5fc28..1704dae 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 _0xc991=['operator','group','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','value','ValidationErrorItem','MetricId','%s.%s\x20=\x20%s.%s','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','groupBy','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticCustomReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','findAll','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','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'];(function(_0x2abff5,_0x1c5a97){var _0x72b404=function(_0x4ec1ff){while(--_0x4ec1ff){_0x2abff5['push'](_0x2abff5['shift']());}};_0x72b404(++_0x1c5a97);}(_0xc991,0xdd));var _0x1c99=function(_0x1aeebf,_0x443383){_0x1aeebf=_0x1aeebf-0x0;var _0x312222=_0xc991[_0x1aeebf];return _0x312222;};'use strict';var pdf=require(_0x1c99('0x0'));var emlformat=require(_0x1c99('0x1'));var rimraf=require(_0x1c99('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c99('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c99('0x4'));var util=require(_0x1c99('0x5'));var path=require(_0x1c99('0x6'));var sox=require(_0x1c99('0x7'));var csv=require(_0x1c99('0x8'));var ejs=require(_0x1c99('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1c99('0xa'));var crypto=require(_0x1c99('0xb'));var jsforce=require(_0x1c99('0xc'));var deskjs=require(_0x1c99('0xd'));var toCsv=require(_0x1c99('0x8'));var querystring=require('querystring');var Papa=require(_0x1c99('0xe'));var Redis=require(_0x1c99('0xf'));var authService=require(_0x1c99('0x10'));var qs=require(_0x1c99('0x11'));var hardwareService=require(_0x1c99('0x12'));var logger=require('../../config/logger')(_0x1c99('0x13'));var utils=require(_0x1c99('0x14'));var config=require(_0x1c99('0x15'));var db=require(_0x1c99('0x16'))['db'];function respondWithStatusCode(_0x37a48a,_0x3572a4){_0x3572a4=_0x3572a4||0xcc;return function(_0x2d8546){if(_0x2d8546){return _0x37a48a[_0x1c99('0x17')](_0x3572a4);}return _0x37a48a[_0x1c99('0x18')](_0x3572a4)['end']();};}function respondWithResult(_0x477c74,_0x3f29c2){_0x3f29c2=_0x3f29c2||0xc8;return function(_0x5ddb74){if(_0x5ddb74){return _0x477c74[_0x1c99('0x18')](_0x3f29c2)[_0x1c99('0x19')](_0x5ddb74);}};}function respondWithFilteredResult(_0x40fe40,_0x5d5766){return function(_0x7f89bb){if(_0x7f89bb){var _0x366baf=_0x7f89bb[_0x1c99('0x1a')],_0x5d5423=_0x5d5766[_0x1c99('0x1b')],_0x3f14bd=_0x5d5766[_0x1c99('0x1b')]+_0x5d5766[_0x1c99('0x1c')],_0x4acf49;if(_0x3f14bd>=_0x366baf){_0x3f14bd=_0x366baf;_0x4acf49=0xc8;}else{_0x4acf49=0xce;}_0x40fe40[_0x1c99('0x18')](_0x4acf49);return _0x40fe40[_0x1c99('0x1d')]('Content-Range',_0x5d5423+'-'+_0x3f14bd+'/'+_0x366baf)[_0x1c99('0x19')](_0x7f89bb);}return null;};}function patchUpdates(_0x61b460){return function(_0x5b6bf6){try{jsonpatch[_0x1c99('0x1e')](_0x5b6bf6,_0x61b460,!![]);}catch(_0xf3dbf6){return BPromise[_0x1c99('0x1f')](_0xf3dbf6);}return _0x5b6bf6[_0x1c99('0x20')]();};}function saveUpdates(_0x4e3fe9,_0x1cb9b6){return function(_0x3faa0d){if(_0x3faa0d){return _0x3faa0d['update'](_0x4e3fe9)[_0x1c99('0x21')](function(_0x22911c){return _0x22911c;});}return null;};}function removeEntity(_0x2a0579,_0x32b2b0){return function(_0x5839c6){if(_0x5839c6){return _0x5839c6['destroy']()[_0x1c99('0x21')](function(){var _0x1618a0=_0x5839c6[_0x1c99('0x22')]({'plain':!![]});var _0x38e1ae='CustomReports';return db[_0x1c99('0x23')][_0x1c99('0x24')]({'where':{'type':_0x38e1ae,'resourceId':_0x1618a0['id']}})[_0x1c99('0x21')](function(){return _0x5839c6;});})[_0x1c99('0x21')](function(){_0x2a0579[_0x1c99('0x18')](0xcc)[_0x1c99('0x25')]();});}};}function handleEntityNotFound(_0x1dd4cf,_0x2ada15){return function(_0x2d060f){if(!_0x2d060f){_0x1dd4cf[_0x1c99('0x17')](0x194);}return _0x2d060f;};}function handleError(_0x7df77f,_0x5278c8){_0x5278c8=_0x5278c8||0x1f4;return function(_0x23781a){logger[_0x1c99('0x26')](_0x23781a[_0x1c99('0x27')]);if(_0x23781a[_0x1c99('0x28')]){delete _0x23781a[_0x1c99('0x28')];}_0x7df77f[_0x1c99('0x18')](_0x5278c8)[_0x1c99('0x29')](_0x23781a);};}exports[_0x1c99('0x2a')]=function(_0x4eeecc,_0x4caead){var _0x1bdfa9={},_0x946999={},_0xb2080a={'count':0x0,'rows':[]};var _0x147ee4=db[_0x1c99('0x2b')]['rawAttributes'];_0x946999[_0x1c99('0x2c')]=_[_0x1c99('0x2d')](_0x147ee4);_0x946999[_0x1c99('0x2e')]=_[_0x1c99('0x2d')](_0x4eeecc[_0x1c99('0x2e')]);_0x946999[_0x1c99('0x2f')]=_[_0x1c99('0x30')](_0x946999[_0x1c99('0x2c')],_0x946999['query']);_0x1bdfa9['attributes']=_[_0x1c99('0x30')](_0x946999[_0x1c99('0x2c')],qs[_0x1c99('0x31')](_0x4eeecc['query'][_0x1c99('0x31')]));_0x1bdfa9[_0x1c99('0x32')]=_0x1bdfa9[_0x1c99('0x32')][_0x1c99('0x33')]?_0x1bdfa9['attributes']:_0x946999[_0x1c99('0x2c')];if(!_0x4eeecc[_0x1c99('0x2e')][_0x1c99('0x34')](_0x1c99('0x35'))){_0x1bdfa9[_0x1c99('0x1c')]=qs['limit'](_0x4eeecc['query'][_0x1c99('0x1c')]);_0x1bdfa9['offset']=qs[_0x1c99('0x1b')](_0x4eeecc['query'][_0x1c99('0x1b')]);}_0x1bdfa9[_0x1c99('0x36')]=qs[_0x1c99('0x37')](_0x4eeecc[_0x1c99('0x2e')][_0x1c99('0x37')]);_0x1bdfa9[_0x1c99('0x38')]=qs[_0x1c99('0x2f')](_[_0x1c99('0x39')](_0x4eeecc[_0x1c99('0x2e')],_0x946999['filters']));if(_0x4eeecc[_0x1c99('0x2e')][_0x1c99('0x3a')]){_0x1bdfa9[_0x1c99('0x38')]=_[_0x1c99('0x3b')](_0x1bdfa9[_0x1c99('0x38')],{'$or':_[_0x1c99('0x3c')](_0x147ee4,function(_0x10c189){if(_0x10c189[_0x1c99('0x3d')][_0x1c99('0x3e')]!==_0x1c99('0x3f')){var _0x5a2ef7={};_0x5a2ef7[_0x10c189[_0x1c99('0x40')]]={'$like':'%'+_0x4eeecc[_0x1c99('0x2e')][_0x1c99('0x3a')]+'%'};return _0x5a2ef7;}})});}_0x1bdfa9=_[_0x1c99('0x3b')]({},_0x1bdfa9,_0x4eeecc[_0x1c99('0x41')]);var _0x25b39e={'where':_0x1bdfa9[_0x1c99('0x38')]};return db[_0x1c99('0x2b')]['count'](_0x25b39e)[_0x1c99('0x21')](function(_0x3c11f2){_0xb2080a[_0x1c99('0x1a')]=_0x3c11f2;if(_0x4eeecc[_0x1c99('0x2e')]['includeAll']){_0x1bdfa9['include']=[{'all':!![]}];}return db[_0x1c99('0x2b')][_0x1c99('0x42')](_0x1bdfa9);})[_0x1c99('0x21')](function(_0x543bee){_0xb2080a['rows']=_0x543bee;return _0xb2080a;})['then'](respondWithFilteredResult(_0x4caead,_0x1bdfa9))[_0x1c99('0x43')](handleError(_0x4caead,null));};exports[_0x1c99('0x44')]=function(_0x47abea,_0x11e952){var _0x2851dc={'raw':![],'where':{'id':_0x47abea[_0x1c99('0x45')]['id']}},_0x79e5b2={};_0x79e5b2['model']=_['keys'](db[_0x1c99('0x2b')][_0x1c99('0x46')]);_0x79e5b2[_0x1c99('0x2e')]=_[_0x1c99('0x2d')](_0x47abea['query']);_0x79e5b2[_0x1c99('0x2f')]=_[_0x1c99('0x30')](_0x79e5b2[_0x1c99('0x2c')],_0x79e5b2['query']);_0x2851dc[_0x1c99('0x32')]=_[_0x1c99('0x30')](_0x79e5b2['model'],qs['fields'](_0x47abea[_0x1c99('0x2e')]['fields']));_0x2851dc['attributes']=_0x2851dc[_0x1c99('0x32')][_0x1c99('0x33')]?_0x2851dc['attributes']:_0x79e5b2['model'];if(_0x47abea[_0x1c99('0x2e')][_0x1c99('0x47')]){_0x2851dc[_0x1c99('0x48')]=[{'all':!![]}];}_0x2851dc=_[_0x1c99('0x3b')]({},_0x2851dc,_0x47abea[_0x1c99('0x41')]);return db['AnalyticCustomReport'][_0x1c99('0x49')](_0x2851dc)[_0x1c99('0x21')](handleEntityNotFound(_0x11e952,null))['then'](respondWithResult(_0x11e952,null))['catch'](handleError(_0x11e952,null));};exports[_0x1c99('0x4a')]=function(_0x2be486,_0x9cba64){return db[_0x1c99('0x2b')][_0x1c99('0x4a')](_0x2be486[_0x1c99('0x4b')],{})['then'](function(_0x551ef0){var _0x396a69=_0x2be486[_0x1c99('0x4c')][_0x1c99('0x22')]({'plain':!![]});if(!_0x396a69)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x396a69[_0x1c99('0x4d')]===_0x1c99('0x4c')){var _0x4d8ba1=_0x551ef0[_0x1c99('0x22')]({'plain':!![]});var _0x38d63e=_0x1c99('0x4e');return db[_0x1c99('0x4f')][_0x1c99('0x49')]({'where':{'name':_0x38d63e,'userProfileId':_0x396a69[_0x1c99('0x50')]},'raw':!![]})[_0x1c99('0x21')](function(_0x349cf6){if(_0x349cf6&&_0x349cf6[_0x1c99('0x51')]===0x0){return db['UserProfileResource'][_0x1c99('0x4a')]({'name':_0x4d8ba1['name'],'resourceId':_0x4d8ba1['id'],'type':'CustomReports','sectionId':_0x349cf6['id']},{})[_0x1c99('0x21')](function(){return _0x551ef0;});}else{return _0x551ef0;}})[_0x1c99('0x43')](function(_0x5f42bd){logger['error'](_0x1c99('0x52'),_0x5f42bd);throw _0x5f42bd;});}return _0x551ef0;})['then'](respondWithResult(_0x9cba64,0xc9))['catch'](handleError(_0x9cba64,null));};exports['update']=function(_0x224c7f,_0x3eec92){if(_0x224c7f[_0x1c99('0x4b')]['id']){delete _0x224c7f[_0x1c99('0x4b')]['id'];}return db[_0x1c99('0x2b')]['find']({'where':{'id':_0x224c7f[_0x1c99('0x45')]['id']}})['then'](handleEntityNotFound(_0x3eec92,null))[_0x1c99('0x21')](saveUpdates(_0x224c7f[_0x1c99('0x4b')],null))[_0x1c99('0x21')](respondWithResult(_0x3eec92,null))[_0x1c99('0x43')](handleError(_0x3eec92,null));};exports[_0x1c99('0x24')]=function(_0x1d6c0a,_0x4e6c4a){return db['AnalyticCustomReport'][_0x1c99('0x49')]({'where':{'id':_0x1d6c0a[_0x1c99('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e6c4a,null))['then'](removeEntity(_0x4e6c4a,null))[_0x1c99('0x43')](handleError(_0x4e6c4a,null));};exports['preview']=function(_0x18cb3b,_0x33f8f6){var _0xffc7e4=0xa;var _0x55ac88=[_0x1c99('0x53'),_0x1c99('0x54'),_0x1c99('0x55'),_0x1c99('0x56')];var _0x14354a={'SUM':_0x1c99('0x57'),'COUNT':_0x1c99('0x58'),'COUNT DISTINCT':_0x1c99('0x59'),'MAX':_0x1c99('0x5a'),'MIN':_0x1c99('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1c99('0x5c'),'GROUP_CONCAT ASC':_0x1c99('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x38e747={'SEC_TO_TIME':_0x1c99('0x5e'),'DATE':_0x1c99('0x5f'),'HOUR':_0x1c99('0x60'),'ROUND':_0x1c99('0x61'),'UNIX_TIMESTAMP':_0x1c99('0x62')};var _0x476c12=function(_0x6c6a6e){return!_[_0x1c99('0x63')]([_0x1c99('0x64'),_0x1c99('0x65'),_0x1c99('0x66'),_0x1c99('0x67')],_0x6c6a6e);};var _0x245857=function(_0x288d96){if(!_0x288d96||!_0x288d96[_0x1c99('0x68')][_0x1c99('0x33')]){return'';}for(var _0x2b12e1='(',_0x5d92a2=0x0;_0x5d92a2<_0x288d96[_0x1c99('0x68')][_0x1c99('0x33')];_0x5d92a2+=0x1){_0x5d92a2>0x0&&(_0x2b12e1+='\x20'+_0x288d96[_0x1c99('0x69')]+'\x20');_0x2b12e1+=_0x288d96[_0x1c99('0x68')][_0x5d92a2][_0x1c99('0x6a')]?_0x245857(_0x288d96[_0x1c99('0x68')][_0x5d92a2][_0x1c99('0x6a')]):_0x288d96[_0x1c99('0x68')][_0x5d92a2][_0x1c99('0x40')]+'\x20'+_0x288d96['rules'][_0x5d92a2][_0x1c99('0x6b')]+(_0x476c12(_0x288d96['rules'][_0x5d92a2]['condition'])?'\x20'+_0x288d96[_0x1c99('0x68')][_0x5d92a2]['value']:'');}return _0x2b12e1+')';};var _0x3afdd6={'where':{'id':_0x18cb3b[_0x1c99('0x45')]['id']}},_0x483f92,_0x6efa58,_0xacbcb8,_0x1bf42e,_0x32ec43;_0x3afdd6=_[_0x1c99('0x3b')]({},_0x3afdd6,_0x18cb3b[_0x1c99('0x41')]);return db[_0x1c99('0x2b')]['find'](_0x3afdd6)[_0x1c99('0x21')](function(_0x470607){if(_0x470607){_0x483f92=_0x470607;return _0x470607[_0x1c99('0x6c')]();}return null;})[_0x1c99('0x21')](function(_0x1aa8df){if(_0x1aa8df){if(!_0x1aa8df['length']){throw new db[(_0x1c99('0x6d'))]['ValidationErrorItem'](_0x1c99('0x6e'),0x193);}_0x6efa58=_0x1aa8df;return db[_0x1c99('0x6f')][_0x1c99('0x42')]({'raw':!![]});}return null;})[_0x1c99('0x21')](function(_0x33958b){if(_0x33958b){_0xacbcb8=_[_0x1c99('0x70')](_0x33958b,'id');var _0x3c5695;var _0x1cb358=squel[_0x1c99('0x71')]();_0x1cb358[_0x1c99('0x72')](_0x483f92[_0x1c99('0x73')]);for(var _0x518b65=0x0;_0x518b65<_0x6efa58[_0x1c99('0x33')];_0x518b65+=0x1){_0x3c5695=_0x6efa58[_0x518b65]['MetricId']?_0xacbcb8[_0x6efa58[_0x518b65]['MetricId']][_0x1c99('0x74')]:_0x6efa58[_0x518b65][_0x1c99('0x40')];_0x3c5695=_0x6efa58[_0x518b65][_0x1c99('0x75')]?_[_0x1c99('0x76')](_0x14354a[_0x6efa58[_0x518b65]['function']],'%s',_0x3c5695):_0x3c5695;_0x3c5695=_0x6efa58[_0x518b65][_0x1c99('0x77')]?_['replace'](_0x38e747[_0x6efa58[_0x518b65][_0x1c99('0x77')]],'%s',_0x3c5695):_0x3c5695;if(_0x6efa58[_0x518b65]['groupBy']){_0x1cb358[_0x1c99('0x6a')](_0x3c5695);}_0x6efa58[_0x518b65][_0x1c99('0x78')]&&_0x1cb358['order'](_0x3c5695,_0x6efa58[_0x518b65][_0x1c99('0x78')]===_0x1c99('0x79')?![]:!![]);_0x1cb358[_0x1c99('0x40')](_0x3c5695,_0x6efa58[_0x518b65][_0x1c99('0x7a')]||_0x3c5695);}if(_0x483f92[_0x1c99('0x7b')]){_0x483f92[_0x1c99('0x7b')]=JSON[_0x1c99('0x7c')](_0x483f92['joins']);for(var _0x37cf96=0x0;_0x37cf96<_0x483f92[_0x1c99('0x7b')]['length'];_0x37cf96+=0x1){if(_0x483f92[_0x1c99('0x7b')][_0x37cf96][_0x1c99('0x3d')]&&_[_0x1c99('0x63')](_0x55ac88,_0x483f92[_0x1c99('0x7b')][_0x37cf96][_0x1c99('0x3d')])&&_0x483f92[_0x1c99('0x7b')][_0x37cf96][_0x1c99('0x7d')]&&_0x483f92['joins'][_0x37cf96]['foreignTable']&&_0x483f92[_0x1c99('0x7b')][_0x37cf96][_0x1c99('0x7e')]){_0x1cb358[_0x483f92[_0x1c99('0x7b')][_0x37cf96]['type']](_0x483f92[_0x1c99('0x7b')][_0x37cf96][_0x1c99('0x7f')],null,util[_0x1c99('0x77')]('%s.%s\x20=\x20%s.%s',_0x483f92[_0x1c99('0x73')],_0x483f92['joins'][_0x37cf96][_0x1c99('0x7d')],_0x483f92[_0x1c99('0x7b')][_0x37cf96][_0x1c99('0x7f')],_0x483f92[_0x1c99('0x7b')][_0x37cf96][_0x1c99('0x7e')]));}}}if(_0x483f92[_0x1c99('0x80')]){_0x483f92['conditions']=JSON['parse'](_0x483f92[_0x1c99('0x80')]);_0x1cb358['where'](_0x245857(_0x483f92[_0x1c99('0x80')]['group']));}_0x32ec43=_0x1cb358[_0x1c99('0x81')]();_0x1cb358[_0x1c99('0x1c')](_0xffc7e4);_0x1cb358[_0x1c99('0x1b')](0x0);logger[_0x1c99('0x82')](_0x1c99('0x83'),_0x1cb358[_0x1c99('0x84')]());return db[_0x1c99('0x85')][_0x1c99('0x2e')](_0x1cb358['toString'](),{'type':db[_0x1c99('0x85')][_0x1c99('0x86')][_0x1c99('0x87')]});}})['then'](respondWithResult(_0x33f8f6,null))[_0x1c99('0x43')](handleError(_0x33f8f6,null));};function runReport(_0x4befb4,_0x412edd,_0x1f34e0){var _0x3bf583=_0x412edd[_0x1c99('0x28')];var _0x3408a7=0xa;var _0x470ab9=[_0x1c99('0x53'),'left_join',_0x1c99('0x55'),_0x1c99('0x56')];var _0x179dd8={'SUM':_0x1c99('0x57'),'COUNT':_0x1c99('0x58'),'COUNT DISTINCT':_0x1c99('0x59'),'MAX':_0x1c99('0x5a'),'MIN':'MIN(%s)','AVG':_0x1c99('0x88'),'GROUP_CONCAT':_0x1c99('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1c99('0x89')};var _0x233752={'SEC_TO_TIME':_0x1c99('0x5e'),'DATE':_0x1c99('0x5f'),'HOUR':_0x1c99('0x60'),'ROUND':_0x1c99('0x61'),'UNIX_TIMESTAMP':_0x1c99('0x62')};var _0x112ffd=function(_0x54cf41){return!_['includes']([_0x1c99('0x64'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x1c99('0x67')],_0x54cf41);};var _0x2b904e=function(_0x174c3c){if(!_0x174c3c||!_0x174c3c['rules']['length']){return'';}for(var _0x4b3933='(',_0x3375be=0x0;_0x3375be<_0x174c3c[_0x1c99('0x68')]['length'];_0x3375be+=0x1){_0x3375be>0x0&&(_0x4b3933+='\x20'+_0x174c3c[_0x1c99('0x69')]+'\x20');_0x4b3933+=_0x174c3c[_0x1c99('0x68')][_0x3375be][_0x1c99('0x6a')]?_0x2b904e(_0x174c3c['rules'][_0x3375be][_0x1c99('0x6a')]):_0x174c3c['rules'][_0x3375be][_0x1c99('0x40')]+'\x20'+_0x174c3c['rules'][_0x3375be][_0x1c99('0x6b')]+(_0x112ffd(_0x174c3c[_0x1c99('0x68')][_0x3375be][_0x1c99('0x6b')])?'\x20'+_0x174c3c[_0x1c99('0x68')][_0x3375be][_0x1c99('0x8a')]:'');}return _0x4b3933+')';};var _0x21e8ee={'where':{'id':_0x4befb4['id']}},_0x37a7f4,_0x369220,_0x522305,_0x475212,_0x1881e3;_0x21e8ee=_['merge']({},_0x21e8ee,_0x1f34e0);return db[_0x1c99('0x2b')][_0x1c99('0x49')](_0x21e8ee)[_0x1c99('0x21')](function(_0x4cb22f){if(_0x4cb22f){_0x37a7f4=_0x4cb22f;return _0x4cb22f[_0x1c99('0x6c')]();}return null;})['then'](function(_0x322a31){if(_0x322a31){if(!_0x322a31[_0x1c99('0x33')]){throw new db[(_0x1c99('0x6d'))][(_0x1c99('0x8b'))](_0x1c99('0x6e'),0x193);}_0x369220=_0x322a31;return db[_0x1c99('0x6f')][_0x1c99('0x42')]({'raw':!![]});}return null;})[_0x1c99('0x21')](function(_0x30cb68){if(_0x30cb68){_0x522305=_['keyBy'](_0x30cb68,'id');var _0x14df1d;var _0x534ba2=squel[_0x1c99('0x71')]();_0x534ba2[_0x1c99('0x72')](_0x37a7f4[_0x1c99('0x73')]);for(var _0x259113=0x0;_0x259113<_0x369220[_0x1c99('0x33')];_0x259113+=0x1){_0x14df1d=_0x369220[_0x259113][_0x1c99('0x8c')]?_0x522305[_0x369220[_0x259113][_0x1c99('0x8c')]][_0x1c99('0x74')]:_0x369220[_0x259113][_0x1c99('0x40')];_0x14df1d=_0x369220[_0x259113]['function']?_[_0x1c99('0x76')](_0x179dd8[_0x369220[_0x259113][_0x1c99('0x75')]],'%s',_0x14df1d):_0x14df1d;_0x14df1d=_0x369220[_0x259113][_0x1c99('0x77')]?_[_0x1c99('0x76')](_0x233752[_0x369220[_0x259113]['format']],'%s',_0x14df1d):_0x14df1d;if(_0x369220[_0x259113]['groupBy']){_0x534ba2['group'](_0x14df1d);}_0x369220[_0x259113]['orderBy']&&_0x534ba2[_0x1c99('0x36')](_0x14df1d,_0x369220[_0x259113][_0x1c99('0x78')]==='DESC'?![]:!![]);_0x534ba2[_0x1c99('0x40')](_0x14df1d,_0x369220[_0x259113][_0x1c99('0x7a')]||_0x14df1d);}if(_0x37a7f4['joins']){_0x37a7f4[_0x1c99('0x7b')]=JSON[_0x1c99('0x7c')](_0x37a7f4['joins']);for(var _0x1db64f=0x0;_0x1db64f<_0x37a7f4[_0x1c99('0x7b')][_0x1c99('0x33')];_0x1db64f+=0x1){if(_0x37a7f4[_0x1c99('0x7b')][_0x1db64f][_0x1c99('0x3d')]&&_[_0x1c99('0x63')](_0x470ab9,_0x37a7f4[_0x1c99('0x7b')][_0x1db64f][_0x1c99('0x3d')])&&_0x37a7f4[_0x1c99('0x7b')][_0x1db64f]['parentKey']&&_0x37a7f4['joins'][_0x1db64f]['foreignTable']&&_0x37a7f4[_0x1c99('0x7b')][_0x1db64f][_0x1c99('0x7e')]){_0x534ba2[_0x37a7f4[_0x1c99('0x7b')][_0x1db64f][_0x1c99('0x3d')]](_0x37a7f4[_0x1c99('0x7b')][_0x1db64f]['foreignTable'],null,util['format'](_0x1c99('0x8d'),_0x37a7f4[_0x1c99('0x73')],_0x37a7f4[_0x1c99('0x7b')][_0x1db64f][_0x1c99('0x7d')],_0x37a7f4[_0x1c99('0x7b')][_0x1db64f][_0x1c99('0x7f')],_0x37a7f4[_0x1c99('0x7b')][_0x1db64f][_0x1c99('0x7e')]));}}}if(_0x37a7f4[_0x1c99('0x80')]){_0x37a7f4[_0x1c99('0x80')]=JSON['parse'](_0x37a7f4[_0x1c99('0x80')]);_0x534ba2[_0x1c99('0x38')](_0x2b904e(_0x37a7f4[_0x1c99('0x80')]['group']));}_0x1881e3=_0x534ba2[_0x1c99('0x81')]();_0x534ba2[_0x1c99('0x1c')](_0x3408a7);_0x534ba2[_0x1c99('0x1b')](0x0);logger[_0x1c99('0x82')]('Limited\x20Query:',_0x534ba2[_0x1c99('0x84')]());return db[_0x1c99('0x85')][_0x1c99('0x2e')](_0x534ba2[_0x1c99('0x84')](),{'type':db[_0x1c99('0x85')][_0x1c99('0x86')][_0x1c99('0x87')]});}})['then'](function(_0x1d08b4){if(!_0x1d08b4['length']){throw new db[(_0x1c99('0x6d'))][(_0x1c99('0x8b'))](_0x1c99('0x8e'),0xcc);}if(_0x412edd[_0x1c99('0x8f')]===_0x1c99('0x90')){return null;}var _0x97187f=_[_0x1c99('0x3b')](_0x412edd,{'name':_0x412edd[_0x1c99('0x91')]||_0x412edd[_0x1c99('0x28')]||_0x37a7f4['name'],'basename':_0x3bf583,'savename':util[_0x1c99('0x77')](_0x1c99('0x92'),_0x412edd[_0x1c99('0x28')]||_0x37a7f4[_0x1c99('0x28')],require(_0x1c99('0x93'))[_0x1c99('0x94')](0x4),_0x412edd['output']||_0x1c99('0x95')),'reportId':_0x37a7f4['id'],'reportType':_0x1c99('0x96')});return db['AnalyticExtractedReport'][_0x1c99('0x4a')](_0x97187f,{'raw':!![]});})['then'](function(_0x1c8fa8){if(_0x37a7f4[_0x1c99('0x73')]===_0x1c99('0x97')){_0x1881e3['where'](_0x37a7f4[_0x1c99('0x73')]+_0x1c99('0x98'),_0x412edd[_0x1c99('0x99')],_0x412edd[_0x1c99('0x9a')]);}else{_0x1881e3[_0x1c99('0x38')](_0x37a7f4[_0x1c99('0x73')]+_0x1c99('0x9b'),_0x412edd['startDate'],_0x412edd[_0x1c99('0x9a')]);}if(_0x1c8fa8){logger[_0x1c99('0x9c')](_0x1c99('0x9d'),_0x1881e3['toString']());require(_0x1c99('0x9e'))['fork'](path[_0x1c99('0x53')](__dirname,_0x1c99('0x9f'),_0x1c8fa8['output']),[_0x1c8fa8['id'],_0x1881e3[_0x1c99('0x84')](),path[_0x1c99('0x53')](__dirname,'../../files/reports',_0x1c8fa8[_0x1c99('0xa0')]),_0x3bf583]);return _0x1c8fa8;}else{var _0x25feab=squel[_0x1c99('0x71')]();_0x25feab['from']('('+_0x1881e3['toString']()+')',_0x1c99('0xa1'));_0x25feab[_0x1c99('0x40')]('COUNT(*)','count');_0x1881e3[_0x1c99('0x1c')](_0x412edd[_0x1c99('0x1c')]||_0x3408a7);_0x1881e3[_0x1c99('0x1b')](_0x412edd[_0x1c99('0x1b')]||0x0);return db[_0x1c99('0x85')][_0x1c99('0x2e')](_0x25feab['toString'](),{'type':db['sequelize'][_0x1c99('0x86')][_0x1c99('0x87')]})[_0x1c99('0x21')](function(_0x26f4a3){if(!_0x26f4a3['length']){_0x475212=0x0;}else{_0x475212=_0x26f4a3[0x0][_0x1c99('0x1a')]||0x0;}return db['sequelize'][_0x1c99('0x2e')](_0x1881e3[_0x1c99('0x84')](),{'type':db[_0x1c99('0x85')][_0x1c99('0x86')]['SELECT']});})[_0x1c99('0x21')](function(_0x5015df){return{'rows':_0x5015df||[],'count':_0x475212};});}});}exports['run']=function(_0x3622d5,_0xe459e9){return runReport(_0x3622d5[_0x1c99('0x45')],_0x3622d5[_0x1c99('0x2e')],_0x3622d5[_0x1c99('0x41')])[_0x1c99('0x21')](respondWithResult(_0xe459e9,null))[_0x1c99('0x43')](handleError(_0xe459e9,null));};exports['runReport']=runReport;exports[_0x1c99('0x2e')]=function(_0x1a8909,_0x1746c7){var _0x48d8e8=0xa;var _0x5a2dc6=[_0x1c99('0x53'),'left_join',_0x1c99('0x55'),_0x1c99('0x56')];var _0x156a44={'SUM':_0x1c99('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1c99('0x59'),'MAX':_0x1c99('0x5a'),'MIN':_0x1c99('0x5b'),'AVG':_0x1c99('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1c99('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x12ffa9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1c99('0x5f'),'HOUR':_0x1c99('0x60'),'ROUND':_0x1c99('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1626cd=function(_0x1da48b){return!_[_0x1c99('0x63')]([_0x1c99('0x64'),_0x1c99('0x65'),_0x1c99('0x66'),_0x1c99('0x67')],_0x1da48b);};var _0x3374bd=function(_0xba5736){if(!_0xba5736||!_0xba5736['rules'][_0x1c99('0x33')]){return'';}for(var _0x297c4f='(',_0x3a473a=0x0;_0x3a473a<_0xba5736['rules']['length'];_0x3a473a+=0x1){_0x3a473a>0x0&&(_0x297c4f+='\x20'+_0xba5736['operator']+'\x20');_0x297c4f+=_0xba5736[_0x1c99('0x68')][_0x3a473a][_0x1c99('0x6a')]?_0x3374bd(_0xba5736[_0x1c99('0x68')][_0x3a473a][_0x1c99('0x6a')]):_0xba5736['rules'][_0x3a473a]['field']+'\x20'+_0xba5736[_0x1c99('0x68')][_0x3a473a][_0x1c99('0x6b')]+(_0x1626cd(_0xba5736[_0x1c99('0x68')][_0x3a473a]['condition'])?'\x20'+_0xba5736['rules'][_0x3a473a][_0x1c99('0x8a')]:'');}return _0x297c4f+')';};var _0x4bc703={'where':{'id':_0x1a8909[_0x1c99('0x45')]['id']}},_0x4f00a3,_0x331104,_0x10dd4e,_0x16dd5a,_0x2140bc;_0x4bc703=_[_0x1c99('0x3b')]({},_0x4bc703,_0x1a8909['options']);return db[_0x1c99('0x2b')]['find'](_0x4bc703)['then'](function(_0x1879ef){if(_0x1879ef){_0x4f00a3=_0x1879ef;return _0x1879ef[_0x1c99('0x6c')]();}return null;})[_0x1c99('0x21')](function(_0x1415e0){if(_0x1415e0){if(!_0x1415e0[_0x1c99('0x33')]){throw new db[(_0x1c99('0x6d'))][(_0x1c99('0x8b'))](_0x1c99('0x6e'),0x193);}_0x331104=_0x1415e0;return db['AnalyticMetric'][_0x1c99('0x42')]({'raw':!![]});}return null;})[_0x1c99('0x21')](function(_0x6b5a27){if(_0x6b5a27){_0x10dd4e=_[_0x1c99('0x70')](_0x6b5a27,'id');var _0x48305b;var _0x47f1dd=squel[_0x1c99('0x71')]();_0x47f1dd[_0x1c99('0x72')](_0x4f00a3[_0x1c99('0x73')]);for(var _0x5a38df=0x0;_0x5a38df<_0x331104[_0x1c99('0x33')];_0x5a38df+=0x1){_0x48305b=_0x331104[_0x5a38df]['MetricId']?_0x10dd4e[_0x331104[_0x5a38df][_0x1c99('0x8c')]][_0x1c99('0x74')]:_0x331104[_0x5a38df]['field'];_0x48305b=_0x331104[_0x5a38df][_0x1c99('0x75')]?_['replace'](_0x156a44[_0x331104[_0x5a38df][_0x1c99('0x75')]],'%s',_0x48305b):_0x48305b;_0x48305b=_0x331104[_0x5a38df][_0x1c99('0x77')]?_[_0x1c99('0x76')](_0x12ffa9[_0x331104[_0x5a38df][_0x1c99('0x77')]],'%s',_0x48305b):_0x48305b;if(_0x331104[_0x5a38df][_0x1c99('0xa2')]){_0x47f1dd['group'](_0x48305b);}_0x331104[_0x5a38df][_0x1c99('0x78')]&&_0x47f1dd[_0x1c99('0x36')](_0x48305b,_0x331104[_0x5a38df]['orderBy']===_0x1c99('0x79')?![]:!![]);_0x47f1dd[_0x1c99('0x40')](_0x48305b,_0x331104[_0x5a38df]['alias']||_0x48305b);}if(_0x4f00a3[_0x1c99('0x7b')]){_0x4f00a3['joins']=JSON['parse'](_0x4f00a3[_0x1c99('0x7b')]);for(var _0x5f0169=0x0;_0x5f0169<_0x4f00a3[_0x1c99('0x7b')][_0x1c99('0x33')];_0x5f0169+=0x1){if(_0x4f00a3[_0x1c99('0x7b')][_0x5f0169][_0x1c99('0x3d')]&&_[_0x1c99('0x63')](_0x5a2dc6,_0x4f00a3[_0x1c99('0x7b')][_0x5f0169][_0x1c99('0x3d')])&&_0x4f00a3[_0x1c99('0x7b')][_0x5f0169][_0x1c99('0x7d')]&&_0x4f00a3[_0x1c99('0x7b')][_0x5f0169]['foreignTable']&&_0x4f00a3[_0x1c99('0x7b')][_0x5f0169][_0x1c99('0x7e')]){_0x47f1dd[_0x4f00a3['joins'][_0x5f0169][_0x1c99('0x3d')]](_0x4f00a3[_0x1c99('0x7b')][_0x5f0169][_0x1c99('0x7f')],null,util[_0x1c99('0x77')](_0x1c99('0x8d'),_0x4f00a3[_0x1c99('0x73')],_0x4f00a3[_0x1c99('0x7b')][_0x5f0169][_0x1c99('0x7d')],_0x4f00a3[_0x1c99('0x7b')][_0x5f0169]['foreignTable'],_0x4f00a3['joins'][_0x5f0169][_0x1c99('0x7e')]));}}}if(_0x4f00a3[_0x1c99('0x80')]){_0x4f00a3[_0x1c99('0x80')]=JSON[_0x1c99('0x7c')](_0x4f00a3[_0x1c99('0x80')]);_0x47f1dd[_0x1c99('0x38')](_0x3374bd(_0x4f00a3['conditions']['group']));}_0x2140bc=_0x47f1dd[_0x1c99('0x81')]();_0x47f1dd[_0x1c99('0x1c')](_0x48d8e8);_0x47f1dd[_0x1c99('0x1b')](0x0);logger['debug'](_0x1c99('0x83'),_0x47f1dd[_0x1c99('0x84')]());return db[_0x1c99('0x85')][_0x1c99('0x2e')](_0x47f1dd[_0x1c99('0x84')](),{'type':db[_0x1c99('0x85')][_0x1c99('0x86')][_0x1c99('0x87')]});}})[_0x1c99('0x21')](function(){return{'sql':_0x2140bc['toString']()};})[_0x1c99('0x21')](respondWithResult(_0x1746c7,null))['catch'](handleError(_0x1746c7,null));}; \ No newline at end of file +var _0x3a5c=['parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','Sequelize','orderBy','DESC','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','run','runReport','groupBy','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','type','field','options','include','findAll','rows','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','create','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%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\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s'];(function(_0x3c712e,_0x4cd877){var _0x53e313=function(_0x439be0){while(--_0x439be0){_0x3c712e['push'](_0x3c712e['shift']());}};_0x53e313(++_0x4cd877);}(_0x3a5c,0x166));var _0xc3a5=function(_0x2d171e,_0x1b4555){_0x2d171e=_0x2d171e-0x0;var _0x5896f7=_0x3a5c[_0x2d171e];return _0x5896f7;};'use strict';var pdf=require(_0xc3a5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc3a5('0x1'));var rp=require(_0xc3a5('0x2'));var moment=require(_0xc3a5('0x3'));var BPromise=require(_0xc3a5('0x4'));var Mustache=require('mustache');var util=require(_0xc3a5('0x5'));var path=require('path');var sox=require(_0xc3a5('0x6'));var csv=require(_0xc3a5('0x7'));var ejs=require(_0xc3a5('0x8'));var fs=require('fs');var _=require(_0xc3a5('0x9'));var squel=require(_0xc3a5('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc3a5('0xb'));var toCsv=require(_0xc3a5('0x7'));var querystring=require(_0xc3a5('0xc'));var Papa=require(_0xc3a5('0xd'));var Redis=require(_0xc3a5('0xe'));var authService=require(_0xc3a5('0xf'));var qs=require(_0xc3a5('0x10'));var hardwareService=require(_0xc3a5('0x11'));var logger=require('../../config/logger')(_0xc3a5('0x12'));var utils=require(_0xc3a5('0x13'));var config=require('../../config/environment');var db=require(_0xc3a5('0x14'))['db'];function respondWithStatusCode(_0x19f026,_0x49347d){_0x49347d=_0x49347d||0xcc;return function(_0x34b635){if(_0x34b635){return _0x19f026[_0xc3a5('0x15')](_0x49347d);}return _0x19f026[_0xc3a5('0x16')](_0x49347d)[_0xc3a5('0x17')]();};}function respondWithResult(_0x3b6aed,_0x1e4dba){_0x1e4dba=_0x1e4dba||0xc8;return function(_0x2a6308){if(_0x2a6308){return _0x3b6aed['status'](_0x1e4dba)[_0xc3a5('0x18')](_0x2a6308);}};}function respondWithFilteredResult(_0x31dcb8,_0x2df0b1){return function(_0x18e736){if(_0x18e736){var _0x25b1e=_0x18e736[_0xc3a5('0x19')],_0x4128cd=_0x2df0b1[_0xc3a5('0x1a')],_0x1d99e0=_0x2df0b1['offset']+_0x2df0b1[_0xc3a5('0x1b')],_0x4f96c5;if(_0x1d99e0>=_0x25b1e){_0x1d99e0=_0x25b1e;_0x4f96c5=0xc8;}else{_0x4f96c5=0xce;}_0x31dcb8['status'](_0x4f96c5);return _0x31dcb8[_0xc3a5('0x1c')](_0xc3a5('0x1d'),_0x4128cd+'-'+_0x1d99e0+'/'+_0x25b1e)[_0xc3a5('0x18')](_0x18e736);}return null;};}function patchUpdates(_0x345876){return function(_0x30f8b0){try{jsonpatch[_0xc3a5('0x1e')](_0x30f8b0,_0x345876,!![]);}catch(_0x13e3bc){return BPromise['reject'](_0x13e3bc);}return _0x30f8b0['save']();};}function saveUpdates(_0x54d33d,_0x318f27){return function(_0x431455){if(_0x431455){return _0x431455[_0xc3a5('0x1f')](_0x54d33d)[_0xc3a5('0x20')](function(_0x2fef42){return _0x2fef42;});}return null;};}function removeEntity(_0x18fc4d,_0x1f87a4){return function(_0x332523){if(_0x332523){return _0x332523['destroy']()[_0xc3a5('0x20')](function(){var _0xd6cddc=_0x332523[_0xc3a5('0x21')]({'plain':!![]});var _0x36b273='CustomReports';return db[_0xc3a5('0x22')][_0xc3a5('0x23')]({'where':{'type':_0x36b273,'resourceId':_0xd6cddc['id']}})[_0xc3a5('0x20')](function(){return _0x332523;});})[_0xc3a5('0x20')](function(){_0x18fc4d[_0xc3a5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35f049,_0x4428b2){return function(_0x4c544b){if(!_0x4c544b){_0x35f049['sendStatus'](0x194);}return _0x4c544b;};}function handleError(_0x40f713,_0x3171d6){_0x3171d6=_0x3171d6||0x1f4;return function(_0x139b51){logger[_0xc3a5('0x24')](_0x139b51[_0xc3a5('0x25')]);if(_0x139b51[_0xc3a5('0x26')]){delete _0x139b51[_0xc3a5('0x26')];}_0x40f713[_0xc3a5('0x16')](_0x3171d6)[_0xc3a5('0x27')](_0x139b51);};}exports[_0xc3a5('0x28')]=function(_0x20befa,_0x176c4a){var _0x4f3ad7={},_0x15fc36={},_0x38681a={'count':0x0,'rows':[]};var _0x1f488c=db[_0xc3a5('0x29')][_0xc3a5('0x2a')];_0x15fc36[_0xc3a5('0x2b')]=_[_0xc3a5('0x2c')](_0x1f488c);_0x15fc36[_0xc3a5('0x2d')]=_['keys'](_0x20befa[_0xc3a5('0x2d')]);_0x15fc36['filters']=_[_0xc3a5('0x2e')](_0x15fc36['model'],_0x15fc36[_0xc3a5('0x2d')]);_0x4f3ad7['attributes']=_[_0xc3a5('0x2e')](_0x15fc36[_0xc3a5('0x2b')],qs['fields'](_0x20befa[_0xc3a5('0x2d')][_0xc3a5('0x2f')]));_0x4f3ad7['attributes']=_0x4f3ad7[_0xc3a5('0x30')][_0xc3a5('0x31')]?_0x4f3ad7[_0xc3a5('0x30')]:_0x15fc36['model'];if(!_0x20befa[_0xc3a5('0x2d')][_0xc3a5('0x32')](_0xc3a5('0x33'))){_0x4f3ad7[_0xc3a5('0x1b')]=qs[_0xc3a5('0x1b')](_0x20befa[_0xc3a5('0x2d')][_0xc3a5('0x1b')]);_0x4f3ad7[_0xc3a5('0x1a')]=qs[_0xc3a5('0x1a')](_0x20befa[_0xc3a5('0x2d')][_0xc3a5('0x1a')]);}_0x4f3ad7[_0xc3a5('0x34')]=qs['sort'](_0x20befa['query'][_0xc3a5('0x35')]);_0x4f3ad7['where']=qs[_0xc3a5('0x36')](_['pick'](_0x20befa[_0xc3a5('0x2d')],_0x15fc36['filters']));if(_0x20befa[_0xc3a5('0x2d')][_0xc3a5('0x37')]){_0x4f3ad7[_0xc3a5('0x38')]=_[_0xc3a5('0x39')](_0x4f3ad7[_0xc3a5('0x38')],{'$or':_[_0xc3a5('0x3a')](_0x1f488c,function(_0x354cf1){if(_0x354cf1[_0xc3a5('0x3b')]['key']!=='VIRTUAL'){var _0x3cc792={};_0x3cc792[_0x354cf1[_0xc3a5('0x3c')]]={'$like':'%'+_0x20befa[_0xc3a5('0x2d')]['filter']+'%'};return _0x3cc792;}})});}_0x4f3ad7=_[_0xc3a5('0x39')]({},_0x4f3ad7,_0x20befa[_0xc3a5('0x3d')]);var _0x30e5dd={'where':_0x4f3ad7['where']};return db['AnalyticCustomReport'][_0xc3a5('0x19')](_0x30e5dd)[_0xc3a5('0x20')](function(_0x201a18){_0x38681a[_0xc3a5('0x19')]=_0x201a18;if(_0x20befa[_0xc3a5('0x2d')]['includeAll']){_0x4f3ad7[_0xc3a5('0x3e')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xc3a5('0x3f')](_0x4f3ad7);})['then'](function(_0x472af5){_0x38681a[_0xc3a5('0x40')]=_0x472af5;return _0x38681a;})[_0xc3a5('0x20')](respondWithFilteredResult(_0x176c4a,_0x4f3ad7))[_0xc3a5('0x41')](handleError(_0x176c4a,null));};exports['show']=function(_0x2a2a60,_0x21d31a){var _0x55a7d0={'raw':![],'where':{'id':_0x2a2a60[_0xc3a5('0x42')]['id']}},_0x19c010={};_0x19c010[_0xc3a5('0x2b')]=_[_0xc3a5('0x2c')](db['AnalyticCustomReport'][_0xc3a5('0x2a')]);_0x19c010[_0xc3a5('0x2d')]=_['keys'](_0x2a2a60[_0xc3a5('0x2d')]);_0x19c010[_0xc3a5('0x36')]=_[_0xc3a5('0x2e')](_0x19c010[_0xc3a5('0x2b')],_0x19c010[_0xc3a5('0x2d')]);_0x55a7d0[_0xc3a5('0x30')]=_[_0xc3a5('0x2e')](_0x19c010['model'],qs[_0xc3a5('0x2f')](_0x2a2a60[_0xc3a5('0x2d')][_0xc3a5('0x2f')]));_0x55a7d0['attributes']=_0x55a7d0[_0xc3a5('0x30')][_0xc3a5('0x31')]?_0x55a7d0['attributes']:_0x19c010[_0xc3a5('0x2b')];if(_0x2a2a60['query']['includeAll']){_0x55a7d0[_0xc3a5('0x3e')]=[{'all':!![]}];}_0x55a7d0=_[_0xc3a5('0x39')]({},_0x55a7d0,_0x2a2a60[_0xc3a5('0x3d')]);return db['AnalyticCustomReport'][_0xc3a5('0x43')](_0x55a7d0)['then'](handleEntityNotFound(_0x21d31a,null))[_0xc3a5('0x20')](respondWithResult(_0x21d31a,null))[_0xc3a5('0x41')](handleError(_0x21d31a,null));};exports['create']=function(_0x25bdce,_0x4bd93a){return db[_0xc3a5('0x29')]['create'](_0x25bdce[_0xc3a5('0x44')],{})[_0xc3a5('0x20')](function(_0xb78a8c){var _0x5dfdab=_0x25bdce[_0xc3a5('0x45')][_0xc3a5('0x21')]({'plain':!![]});if(!_0x5dfdab)throw new Error(_0xc3a5('0x46'));if(_0x5dfdab[_0xc3a5('0x47')]===_0xc3a5('0x45')){var _0x152f31=_0xb78a8c[_0xc3a5('0x21')]({'plain':!![]});var _0x367fe9=_0xc3a5('0x48');return db[_0xc3a5('0x49')][_0xc3a5('0x43')]({'where':{'name':_0x367fe9,'userProfileId':_0x5dfdab[_0xc3a5('0x4a')]},'raw':!![]})[_0xc3a5('0x20')](function(_0x1d352d){if(_0x1d352d&&_0x1d352d['autoAssociation']===0x0){return db[_0xc3a5('0x22')][_0xc3a5('0x4b')]({'name':_0x152f31[_0xc3a5('0x26')],'resourceId':_0x152f31['id'],'type':_0xc3a5('0x4c'),'sectionId':_0x1d352d['id']},{})[_0xc3a5('0x20')](function(){return _0xb78a8c;});}else{return _0xb78a8c;}})['catch'](function(_0x49f025){logger['error'](_0xc3a5('0x4d'),_0x49f025);throw _0x49f025;});}return _0xb78a8c;})[_0xc3a5('0x20')](respondWithResult(_0x4bd93a,0xc9))[_0xc3a5('0x41')](handleError(_0x4bd93a,null));};exports[_0xc3a5('0x1f')]=function(_0x4de9b8,_0x1f27c7){if(_0x4de9b8[_0xc3a5('0x44')]['id']){delete _0x4de9b8[_0xc3a5('0x44')]['id'];}return db[_0xc3a5('0x29')][_0xc3a5('0x43')]({'where':{'id':_0x4de9b8[_0xc3a5('0x42')]['id']}})[_0xc3a5('0x20')](handleEntityNotFound(_0x1f27c7,null))['then'](saveUpdates(_0x4de9b8[_0xc3a5('0x44')],null))[_0xc3a5('0x20')](respondWithResult(_0x1f27c7,null))['catch'](handleError(_0x1f27c7,null));};exports['destroy']=function(_0x1f082d,_0x36ffae){return db[_0xc3a5('0x29')][_0xc3a5('0x43')]({'where':{'id':_0x1f082d[_0xc3a5('0x42')]['id']}})[_0xc3a5('0x20')](handleEntityNotFound(_0x36ffae,null))[_0xc3a5('0x20')](removeEntity(_0x36ffae,null))[_0xc3a5('0x41')](handleError(_0x36ffae,null));};exports[_0xc3a5('0x4e')]=function(_0x13b21e,_0x199cd9){var _0x262d0e=0xa;var _0xe7b7f6=[_0xc3a5('0x4f'),_0xc3a5('0x50'),_0xc3a5('0x51'),_0xc3a5('0x52')];var _0x28af3f={'SUM':'SUM(%s)','COUNT':_0xc3a5('0x53'),'COUNT DISTINCT':_0xc3a5('0x54'),'MAX':'MAX(%s)','MIN':_0xc3a5('0x55'),'AVG':_0xc3a5('0x56'),'GROUP_CONCAT':_0xc3a5('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc3a5('0x58')};var _0x9837b1={'SEC_TO_TIME':_0xc3a5('0x59'),'DATE':_0xc3a5('0x5a'),'HOUR':_0xc3a5('0x5b'),'ROUND':_0xc3a5('0x5c'),'UNIX_TIMESTAMP':_0xc3a5('0x5d')};var _0x1966ba=function(_0xd0cc4f){return!_[_0xc3a5('0x5e')]([_0xc3a5('0x5f'),_0xc3a5('0x60'),'IS\x20EMPTY',_0xc3a5('0x61')],_0xd0cc4f);};var _0x4e4291=function(_0x108b19){if(!_0x108b19||!_0x108b19['rules'][_0xc3a5('0x31')]){return'';}for(var _0x41b19b='(',_0x2e1652=0x0;_0x2e1652<_0x108b19[_0xc3a5('0x62')][_0xc3a5('0x31')];_0x2e1652+=0x1){_0x2e1652>0x0&&(_0x41b19b+='\x20'+_0x108b19[_0xc3a5('0x63')]+'\x20');_0x41b19b+=_0x108b19[_0xc3a5('0x62')][_0x2e1652][_0xc3a5('0x64')]?_0x4e4291(_0x108b19[_0xc3a5('0x62')][_0x2e1652][_0xc3a5('0x64')]):_0x108b19[_0xc3a5('0x62')][_0x2e1652][_0xc3a5('0x3c')]+'\x20'+_0x108b19[_0xc3a5('0x62')][_0x2e1652][_0xc3a5('0x65')]+(_0x1966ba(_0x108b19[_0xc3a5('0x62')][_0x2e1652]['condition'])?'\x20'+_0x108b19[_0xc3a5('0x62')][_0x2e1652][_0xc3a5('0x66')]:'');}return _0x41b19b+')';};var _0x39cd76={'where':{'id':_0x13b21e[_0xc3a5('0x42')]['id']}},_0x3006e9,_0x10e4a7,_0x1fd188,_0x53bed1,_0x1cbc5c;_0x39cd76=_['merge']({},_0x39cd76,_0x13b21e[_0xc3a5('0x3d')]);return db['AnalyticCustomReport'][_0xc3a5('0x43')](_0x39cd76)['then'](function(_0x142a89){if(_0x142a89){_0x3006e9=_0x142a89;return _0x142a89[_0xc3a5('0x67')]();}return null;})[_0xc3a5('0x20')](function(_0x54dbf0){if(_0x54dbf0){if(!_0x54dbf0['length']){throw new db['Sequelize'][(_0xc3a5('0x68'))](_0xc3a5('0x69'),0x193);}_0x10e4a7=_0x54dbf0;return db[_0xc3a5('0x6a')][_0xc3a5('0x3f')]({'raw':!![]});}return null;})[_0xc3a5('0x20')](function(_0x4f9c04){if(_0x4f9c04){_0x1fd188=_[_0xc3a5('0x6b')](_0x4f9c04,'id');var _0x880a0a;var _0x4c1d8e=squel[_0xc3a5('0x6c')]();_0x4c1d8e[_0xc3a5('0x6d')](_0x3006e9[_0xc3a5('0x6e')]);for(var _0x2f61b6=0x0;_0x2f61b6<_0x10e4a7['length'];_0x2f61b6+=0x1){_0x880a0a=_0x10e4a7[_0x2f61b6][_0xc3a5('0x6f')]?_0x1fd188[_0x10e4a7[_0x2f61b6][_0xc3a5('0x6f')]][_0xc3a5('0x70')]:_0x10e4a7[_0x2f61b6][_0xc3a5('0x3c')];_0x880a0a=_0x10e4a7[_0x2f61b6][_0xc3a5('0x71')]?_['replace'](_0x28af3f[_0x10e4a7[_0x2f61b6][_0xc3a5('0x71')]],'%s',_0x880a0a):_0x880a0a;_0x880a0a=_0x10e4a7[_0x2f61b6][_0xc3a5('0x72')]?_[_0xc3a5('0x73')](_0x9837b1[_0x10e4a7[_0x2f61b6][_0xc3a5('0x72')]],'%s',_0x880a0a):_0x880a0a;if(_0x10e4a7[_0x2f61b6]['groupBy']){_0x4c1d8e['group'](_0x880a0a);}_0x10e4a7[_0x2f61b6]['orderBy']&&_0x4c1d8e['order'](_0x880a0a,_0x10e4a7[_0x2f61b6]['orderBy']==='DESC'?![]:!![]);_0x4c1d8e[_0xc3a5('0x3c')](_0x880a0a,_0x10e4a7[_0x2f61b6][_0xc3a5('0x74')]||_0x880a0a);}if(_0x3006e9[_0xc3a5('0x75')]){_0x3006e9[_0xc3a5('0x75')]=JSON[_0xc3a5('0x76')](_0x3006e9[_0xc3a5('0x75')]);for(var _0x52886c=0x0;_0x52886c<_0x3006e9[_0xc3a5('0x75')][_0xc3a5('0x31')];_0x52886c+=0x1){if(_0x3006e9['joins'][_0x52886c][_0xc3a5('0x3b')]&&_[_0xc3a5('0x5e')](_0xe7b7f6,_0x3006e9[_0xc3a5('0x75')][_0x52886c][_0xc3a5('0x3b')])&&_0x3006e9[_0xc3a5('0x75')][_0x52886c]['parentKey']&&_0x3006e9[_0xc3a5('0x75')][_0x52886c]['foreignTable']&&_0x3006e9[_0xc3a5('0x75')][_0x52886c][_0xc3a5('0x77')]){_0x4c1d8e[_0x3006e9[_0xc3a5('0x75')][_0x52886c][_0xc3a5('0x3b')]](_0x3006e9[_0xc3a5('0x75')][_0x52886c][_0xc3a5('0x78')],null,util[_0xc3a5('0x72')](_0xc3a5('0x79'),_0x3006e9['table'],_0x3006e9['joins'][_0x52886c][_0xc3a5('0x7a')],_0x3006e9['joins'][_0x52886c][_0xc3a5('0x78')],_0x3006e9[_0xc3a5('0x75')][_0x52886c][_0xc3a5('0x77')]));}}}if(_0x3006e9[_0xc3a5('0x7b')]){_0x3006e9['conditions']=JSON[_0xc3a5('0x76')](_0x3006e9['conditions']);_0x4c1d8e[_0xc3a5('0x38')](_0x4e4291(_0x3006e9['conditions'][_0xc3a5('0x64')]));}_0x1cbc5c=_0x4c1d8e[_0xc3a5('0x7c')]();_0x4c1d8e[_0xc3a5('0x1b')](_0x262d0e);_0x4c1d8e[_0xc3a5('0x1a')](0x0);logger[_0xc3a5('0x7d')](_0xc3a5('0x7e'),_0x4c1d8e[_0xc3a5('0x7f')]());return db[_0xc3a5('0x80')][_0xc3a5('0x2d')](_0x4c1d8e[_0xc3a5('0x7f')](),{'type':db['sequelize'][_0xc3a5('0x81')][_0xc3a5('0x82')]});}})[_0xc3a5('0x20')](respondWithResult(_0x199cd9,null))['catch'](handleError(_0x199cd9,null));};function runReport(_0x327816,_0x13b29b,_0x34efd6){var _0x3115fd=_0x13b29b[_0xc3a5('0x26')];var _0x10b68b=0xa;var _0x420c8f=['join',_0xc3a5('0x50'),_0xc3a5('0x51'),'cross_join'];var _0xee9f18={'SUM':_0xc3a5('0x83'),'COUNT':_0xc3a5('0x53'),'COUNT DISTINCT':_0xc3a5('0x54'),'MAX':_0xc3a5('0x84'),'MIN':_0xc3a5('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc3a5('0x57'),'GROUP_CONCAT ASC':_0xc3a5('0x85'),'GROUP_CONCAT DESC':_0xc3a5('0x58')};var _0x27e0ff={'SEC_TO_TIME':_0xc3a5('0x59'),'DATE':_0xc3a5('0x5a'),'HOUR':_0xc3a5('0x5b'),'ROUND':_0xc3a5('0x5c'),'UNIX_TIMESTAMP':_0xc3a5('0x5d')};var _0xb9d5d1=function(_0x546c8d){return!_[_0xc3a5('0x5e')]([_0xc3a5('0x5f'),'IS\x20NOT\x20NULL',_0xc3a5('0x86'),_0xc3a5('0x61')],_0x546c8d);};var _0x3ef565=function(_0xfbb011){if(!_0xfbb011||!_0xfbb011[_0xc3a5('0x62')][_0xc3a5('0x31')]){return'';}for(var _0x149862='(',_0x557253=0x0;_0x557253<_0xfbb011[_0xc3a5('0x62')][_0xc3a5('0x31')];_0x557253+=0x1){_0x557253>0x0&&(_0x149862+='\x20'+_0xfbb011['operator']+'\x20');_0x149862+=_0xfbb011[_0xc3a5('0x62')][_0x557253][_0xc3a5('0x64')]?_0x3ef565(_0xfbb011[_0xc3a5('0x62')][_0x557253][_0xc3a5('0x64')]):_0xfbb011[_0xc3a5('0x62')][_0x557253]['field']+'\x20'+_0xfbb011[_0xc3a5('0x62')][_0x557253][_0xc3a5('0x65')]+(_0xb9d5d1(_0xfbb011[_0xc3a5('0x62')][_0x557253][_0xc3a5('0x65')])?'\x20'+_0xfbb011[_0xc3a5('0x62')][_0x557253][_0xc3a5('0x66')]:'');}return _0x149862+')';};var _0x31a0ea={'where':{'id':_0x327816['id']}},_0x24313c,_0x381b0d,_0x4ac277,_0x282ee2,_0x39edfb;_0x31a0ea=_[_0xc3a5('0x39')]({},_0x31a0ea,_0x34efd6);return db[_0xc3a5('0x29')]['find'](_0x31a0ea)[_0xc3a5('0x20')](function(_0x265c6c){if(_0x265c6c){_0x24313c=_0x265c6c;return _0x265c6c[_0xc3a5('0x67')]();}return null;})[_0xc3a5('0x20')](function(_0x2569eb){if(_0x2569eb){if(!_0x2569eb[_0xc3a5('0x31')]){throw new db[(_0xc3a5('0x87'))][(_0xc3a5('0x68'))](_0xc3a5('0x69'),0x193);}_0x381b0d=_0x2569eb;return db[_0xc3a5('0x6a')][_0xc3a5('0x3f')]({'raw':!![]});}return null;})[_0xc3a5('0x20')](function(_0x4c16f3){if(_0x4c16f3){_0x4ac277=_['keyBy'](_0x4c16f3,'id');var _0x293e5c;var _0x12e368=squel[_0xc3a5('0x6c')]();_0x12e368[_0xc3a5('0x6d')](_0x24313c['table']);for(var _0x422e7c=0x0;_0x422e7c<_0x381b0d[_0xc3a5('0x31')];_0x422e7c+=0x1){_0x293e5c=_0x381b0d[_0x422e7c]['MetricId']?_0x4ac277[_0x381b0d[_0x422e7c]['MetricId']]['metric']:_0x381b0d[_0x422e7c][_0xc3a5('0x3c')];_0x293e5c=_0x381b0d[_0x422e7c][_0xc3a5('0x71')]?_[_0xc3a5('0x73')](_0xee9f18[_0x381b0d[_0x422e7c]['function']],'%s',_0x293e5c):_0x293e5c;_0x293e5c=_0x381b0d[_0x422e7c][_0xc3a5('0x72')]?_[_0xc3a5('0x73')](_0x27e0ff[_0x381b0d[_0x422e7c][_0xc3a5('0x72')]],'%s',_0x293e5c):_0x293e5c;if(_0x381b0d[_0x422e7c]['groupBy']){_0x12e368[_0xc3a5('0x64')](_0x293e5c);}_0x381b0d[_0x422e7c]['orderBy']&&_0x12e368[_0xc3a5('0x34')](_0x293e5c,_0x381b0d[_0x422e7c][_0xc3a5('0x88')]===_0xc3a5('0x89')?![]:!![]);_0x12e368[_0xc3a5('0x3c')](_0x293e5c,_0x381b0d[_0x422e7c][_0xc3a5('0x74')]||_0x293e5c);}if(_0x24313c[_0xc3a5('0x75')]){_0x24313c[_0xc3a5('0x75')]=JSON[_0xc3a5('0x76')](_0x24313c[_0xc3a5('0x75')]);for(var _0x188970=0x0;_0x188970<_0x24313c[_0xc3a5('0x75')][_0xc3a5('0x31')];_0x188970+=0x1){if(_0x24313c[_0xc3a5('0x75')][_0x188970][_0xc3a5('0x3b')]&&_['includes'](_0x420c8f,_0x24313c['joins'][_0x188970][_0xc3a5('0x3b')])&&_0x24313c[_0xc3a5('0x75')][_0x188970]['parentKey']&&_0x24313c[_0xc3a5('0x75')][_0x188970][_0xc3a5('0x78')]&&_0x24313c[_0xc3a5('0x75')][_0x188970][_0xc3a5('0x77')]){_0x12e368[_0x24313c['joins'][_0x188970][_0xc3a5('0x3b')]](_0x24313c[_0xc3a5('0x75')][_0x188970][_0xc3a5('0x78')],null,util['format'](_0xc3a5('0x79'),_0x24313c[_0xc3a5('0x6e')],_0x24313c[_0xc3a5('0x75')][_0x188970]['parentKey'],_0x24313c[_0xc3a5('0x75')][_0x188970][_0xc3a5('0x78')],_0x24313c[_0xc3a5('0x75')][_0x188970][_0xc3a5('0x77')]));}}}if(_0x24313c[_0xc3a5('0x7b')]){_0x24313c[_0xc3a5('0x7b')]=JSON[_0xc3a5('0x76')](_0x24313c[_0xc3a5('0x7b')]);_0x12e368[_0xc3a5('0x38')](_0x3ef565(_0x24313c[_0xc3a5('0x7b')][_0xc3a5('0x64')]));}_0x39edfb=_0x12e368[_0xc3a5('0x7c')]();_0x12e368['limit'](_0x10b68b);_0x12e368[_0xc3a5('0x1a')](0x0);logger[_0xc3a5('0x7d')]('Limited\x20Query:',_0x12e368[_0xc3a5('0x7f')]());return db[_0xc3a5('0x80')]['query'](_0x12e368['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0xc3a5('0x20')](function(_0x312243){if(!_0x312243['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xc3a5('0x8a'),0xcc);}if(_0x13b29b[_0xc3a5('0x8b')]===_0xc3a5('0x8c')){return null;}var _0x279699=_[_0xc3a5('0x39')](_0x13b29b,{'name':_0x13b29b[_0xc3a5('0x8d')]||_0x13b29b[_0xc3a5('0x26')]||_0x24313c[_0xc3a5('0x26')],'basename':_0x3115fd,'savename':util[_0xc3a5('0x72')]('%s-%s.%s',_0x13b29b[_0xc3a5('0x26')]||_0x24313c[_0xc3a5('0x26')],require(_0xc3a5('0x8e'))[_0xc3a5('0x8f')](0x4),_0x13b29b['output']||_0xc3a5('0x90')),'reportId':_0x24313c['id'],'reportType':_0xc3a5('0x91')});return db[_0xc3a5('0x92')][_0xc3a5('0x4b')](_0x279699,{'raw':!![]});})[_0xc3a5('0x20')](function(_0xcd80e4){if(_0x24313c[_0xc3a5('0x6e')]===_0xc3a5('0x93')){_0x39edfb['where'](_0x24313c[_0xc3a5('0x6e')]+_0xc3a5('0x94'),_0x13b29b[_0xc3a5('0x95')],_0x13b29b[_0xc3a5('0x96')]);}else{_0x39edfb[_0xc3a5('0x38')](_0x24313c[_0xc3a5('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x13b29b['startDate'],_0x13b29b[_0xc3a5('0x96')]);}if(_0xcd80e4){logger[_0xc3a5('0x97')](_0xc3a5('0x98'),_0x39edfb[_0xc3a5('0x7f')]());require(_0xc3a5('0x99'))[_0xc3a5('0x9a')](path[_0xc3a5('0x4f')](__dirname,'../../components/export/',_0xcd80e4['output']),[_0xcd80e4['id'],_0x39edfb['toString'](),path[_0xc3a5('0x4f')](__dirname,_0xc3a5('0x9b'),_0xcd80e4[_0xc3a5('0x9c')]),_0x3115fd]);return _0xcd80e4;}else{var _0x124956=squel[_0xc3a5('0x6c')]();_0x124956[_0xc3a5('0x6d')]('('+_0x39edfb[_0xc3a5('0x7f')]()+')','countTable');_0x124956[_0xc3a5('0x3c')]('COUNT(*)',_0xc3a5('0x19'));_0x39edfb['limit'](_0x13b29b[_0xc3a5('0x1b')]||_0x10b68b);_0x39edfb[_0xc3a5('0x1a')](_0x13b29b[_0xc3a5('0x1a')]||0x0);return db['sequelize'][_0xc3a5('0x2d')](_0x124956[_0xc3a5('0x7f')](),{'type':db[_0xc3a5('0x80')][_0xc3a5('0x81')][_0xc3a5('0x82')]})['then'](function(_0x1a070b){if(!_0x1a070b[_0xc3a5('0x31')]){_0x282ee2=0x0;}else{_0x282ee2=_0x1a070b[0x0][_0xc3a5('0x19')]||0x0;}return db[_0xc3a5('0x80')]['query'](_0x39edfb[_0xc3a5('0x7f')](),{'type':db[_0xc3a5('0x80')]['QueryTypes'][_0xc3a5('0x82')]});})[_0xc3a5('0x20')](function(_0x1eb516){return{'rows':_0x1eb516||[],'count':_0x282ee2};});}});}exports[_0xc3a5('0x9d')]=function(_0x267e4b,_0x494313){return runReport(_0x267e4b['params'],_0x267e4b[_0xc3a5('0x2d')],_0x267e4b[_0xc3a5('0x3d')])[_0xc3a5('0x20')](respondWithResult(_0x494313,null))['catch'](handleError(_0x494313,null));};exports[_0xc3a5('0x9e')]=runReport;exports[_0xc3a5('0x2d')]=function(_0x117031,_0x1ca4e5){var _0x42899c=0xa;var _0x762f62=[_0xc3a5('0x4f'),_0xc3a5('0x50'),_0xc3a5('0x51'),'cross_join'];var _0xe409b8={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc3a5('0x54'),'MAX':_0xc3a5('0x84'),'MIN':_0xc3a5('0x55'),'AVG':_0xc3a5('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc3a5('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x50e568={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xc3a5('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5e4f28=function(_0x38cb40){return!_[_0xc3a5('0x5e')]([_0xc3a5('0x5f'),_0xc3a5('0x60'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x38cb40);};var _0x42a101=function(_0x4cbdc5){if(!_0x4cbdc5||!_0x4cbdc5[_0xc3a5('0x62')]['length']){return'';}for(var _0x5a7393='(',_0x13b029=0x0;_0x13b029<_0x4cbdc5[_0xc3a5('0x62')][_0xc3a5('0x31')];_0x13b029+=0x1){_0x13b029>0x0&&(_0x5a7393+='\x20'+_0x4cbdc5[_0xc3a5('0x63')]+'\x20');_0x5a7393+=_0x4cbdc5[_0xc3a5('0x62')][_0x13b029]['group']?_0x42a101(_0x4cbdc5[_0xc3a5('0x62')][_0x13b029][_0xc3a5('0x64')]):_0x4cbdc5[_0xc3a5('0x62')][_0x13b029][_0xc3a5('0x3c')]+'\x20'+_0x4cbdc5[_0xc3a5('0x62')][_0x13b029][_0xc3a5('0x65')]+(_0x5e4f28(_0x4cbdc5['rules'][_0x13b029][_0xc3a5('0x65')])?'\x20'+_0x4cbdc5[_0xc3a5('0x62')][_0x13b029][_0xc3a5('0x66')]:'');}return _0x5a7393+')';};var _0x31b88d={'where':{'id':_0x117031['params']['id']}},_0x38e028,_0xe6f98e,_0x4dc47c,_0x4d9700,_0x2832b9;_0x31b88d=_[_0xc3a5('0x39')]({},_0x31b88d,_0x117031[_0xc3a5('0x3d')]);return db[_0xc3a5('0x29')][_0xc3a5('0x43')](_0x31b88d)[_0xc3a5('0x20')](function(_0x5d50ce){if(_0x5d50ce){_0x38e028=_0x5d50ce;return _0x5d50ce['getFields']();}return null;})[_0xc3a5('0x20')](function(_0xcb998a){if(_0xcb998a){if(!_0xcb998a[_0xc3a5('0x31')]){throw new db[(_0xc3a5('0x87'))]['ValidationErrorItem'](_0xc3a5('0x69'),0x193);}_0xe6f98e=_0xcb998a;return db[_0xc3a5('0x6a')][_0xc3a5('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x549653){if(_0x549653){_0x4dc47c=_[_0xc3a5('0x6b')](_0x549653,'id');var _0x1a977d;var _0x192751=squel[_0xc3a5('0x6c')]();_0x192751['from'](_0x38e028[_0xc3a5('0x6e')]);for(var _0x208f54=0x0;_0x208f54<_0xe6f98e[_0xc3a5('0x31')];_0x208f54+=0x1){_0x1a977d=_0xe6f98e[_0x208f54]['MetricId']?_0x4dc47c[_0xe6f98e[_0x208f54][_0xc3a5('0x6f')]]['metric']:_0xe6f98e[_0x208f54][_0xc3a5('0x3c')];_0x1a977d=_0xe6f98e[_0x208f54]['function']?_[_0xc3a5('0x73')](_0xe409b8[_0xe6f98e[_0x208f54][_0xc3a5('0x71')]],'%s',_0x1a977d):_0x1a977d;_0x1a977d=_0xe6f98e[_0x208f54][_0xc3a5('0x72')]?_['replace'](_0x50e568[_0xe6f98e[_0x208f54][_0xc3a5('0x72')]],'%s',_0x1a977d):_0x1a977d;if(_0xe6f98e[_0x208f54][_0xc3a5('0x9f')]){_0x192751['group'](_0x1a977d);}_0xe6f98e[_0x208f54][_0xc3a5('0x88')]&&_0x192751[_0xc3a5('0x34')](_0x1a977d,_0xe6f98e[_0x208f54][_0xc3a5('0x88')]===_0xc3a5('0x89')?![]:!![]);_0x192751['field'](_0x1a977d,_0xe6f98e[_0x208f54][_0xc3a5('0x74')]||_0x1a977d);}if(_0x38e028[_0xc3a5('0x75')]){_0x38e028[_0xc3a5('0x75')]=JSON['parse'](_0x38e028[_0xc3a5('0x75')]);for(var _0x11ae0d=0x0;_0x11ae0d<_0x38e028[_0xc3a5('0x75')][_0xc3a5('0x31')];_0x11ae0d+=0x1){if(_0x38e028[_0xc3a5('0x75')][_0x11ae0d][_0xc3a5('0x3b')]&&_[_0xc3a5('0x5e')](_0x762f62,_0x38e028[_0xc3a5('0x75')][_0x11ae0d][_0xc3a5('0x3b')])&&_0x38e028[_0xc3a5('0x75')][_0x11ae0d][_0xc3a5('0x7a')]&&_0x38e028[_0xc3a5('0x75')][_0x11ae0d][_0xc3a5('0x78')]&&_0x38e028['joins'][_0x11ae0d][_0xc3a5('0x77')]){_0x192751[_0x38e028['joins'][_0x11ae0d]['type']](_0x38e028[_0xc3a5('0x75')][_0x11ae0d][_0xc3a5('0x78')],null,util[_0xc3a5('0x72')](_0xc3a5('0x79'),_0x38e028['table'],_0x38e028[_0xc3a5('0x75')][_0x11ae0d][_0xc3a5('0x7a')],_0x38e028[_0xc3a5('0x75')][_0x11ae0d][_0xc3a5('0x78')],_0x38e028['joins'][_0x11ae0d]['foreignKey']));}}}if(_0x38e028['conditions']){_0x38e028[_0xc3a5('0x7b')]=JSON['parse'](_0x38e028['conditions']);_0x192751[_0xc3a5('0x38')](_0x42a101(_0x38e028['conditions'][_0xc3a5('0x64')]));}_0x2832b9=_0x192751[_0xc3a5('0x7c')]();_0x192751[_0xc3a5('0x1b')](_0x42899c);_0x192751['offset'](0x0);logger[_0xc3a5('0x7d')](_0xc3a5('0x7e'),_0x192751[_0xc3a5('0x7f')]());return db[_0xc3a5('0x80')][_0xc3a5('0x2d')](_0x192751[_0xc3a5('0x7f')](),{'type':db['sequelize'][_0xc3a5('0x81')][_0xc3a5('0x82')]});}})[_0xc3a5('0x20')](function(){return{'sql':_0x2832b9[_0xc3a5('0x7f')]()};})['then'](respondWithResult(_0x1ca4e5,null))[_0xc3a5('0x41')](handleError(_0x1ca4e5,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 24b5b78..1e2c5aa 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 _0xaa8c=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x3d61d7,_0x1262ef){var _0x26d678=function(_0x24b212){while(--_0x24b212){_0x3d61d7['push'](_0x3d61d7['shift']());}};_0x26d678(++_0x1262ef);}(_0xaa8c,0x1de));var _0xcaa8=function(_0x27bcb2,_0x412da4){_0x27bcb2=_0x27bcb2-0x0;var _0xef0f33=_0xaa8c[_0x27bcb2];return _0xef0f33;};'use strict';var _=require(_0xcaa8('0x0'));var util=require(_0xcaa8('0x1'));var logger=require(_0xcaa8('0x2'))(_0xcaa8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcaa8('0x4'));var fs=require('fs');var path=require(_0xcaa8('0x5'));var rimraf=require(_0xcaa8('0x6'));var config=require(_0xcaa8('0x7'));var attributes=require(_0xcaa8('0x8'));module[_0xcaa8('0x9')]=function(_0xad81ed,_0x25e835){return _0xad81ed['define'](_0xcaa8('0xa'),attributes,{'tableName':_0xcaa8('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f2b=['api','request-promise','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x54009b,_0x3678c5){var _0x8dc54=function(_0x6ed6a0){while(--_0x6ed6a0){_0x54009b['push'](_0x54009b['shift']());}};_0x8dc54(++_0x3678c5);}(_0x7f2b,0x133));var _0xb7f2=function(_0x34da63,_0x34a5d0){_0x34da63=_0x34da63-0x0;var _0x35d06f=_0x7f2b[_0x34da63];return _0x35d06f;};'use strict';var _=require(_0xb7f2('0x0'));var util=require(_0xb7f2('0x1'));var logger=require(_0xb7f2('0x2'))(_0xb7f2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb7f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7f2('0x5'));var attributes=require(_0xb7f2('0x6'));module[_0xb7f2('0x7')]=function(_0x249dc2,_0x51d47a){return _0x249dc2[_0xb7f2('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xb7f2('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 8aef83a..27d4f3b 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3342e4,_0x11d629){var _0x409cdd=function(_0x59f6e6){while(--_0x59f6e6){_0x3342e4['push'](_0x3342e4['shift']());}};_0x409cdd(++_0x11d629);}(_0xb10b,0x12a));var _0xbb10=function(_0x15c056,_0x5bf32d){_0x15c056=_0x15c056-0x0;var _0x3838c3=_0xb10b[_0x15c056];return _0x3838c3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\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(_0x4e6353,_0x18bca0){var _0x5c25ec=function(_0x30191a){while(--_0x30191a){_0x4e6353['push'](_0x4e6353['shift']());}};_0x5c25ec(++_0x18bca0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f9188ab..ea0dbef 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 _0x66fa=['preview','/:id/run','/:id/query','post','create','update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview'];(function(_0x552bc2,_0x15cc86){var _0x594d4d=function(_0x4b10cf){while(--_0x4b10cf){_0x552bc2['push'](_0x552bc2['shift']());}};_0x594d4d(++_0x15cc86);}(_0x66fa,0x117));var _0xa66f=function(_0x309cf9,_0x5905f6){_0x309cf9=_0x309cf9-0x0;var _0x313156=_0x66fa[_0x309cf9];return _0x313156;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var auth=require(_0xa66f('0x5'));var interaction=require(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var controller=require(_0xa66f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa66f('0x9')]);router[_0xa66f('0xa')](_0xa66f('0xb'),auth[_0xa66f('0xc')](),controller[_0xa66f('0xd')]);router['get'](_0xa66f('0xe'),auth['isAuthenticated'](),controller[_0xa66f('0xf')]);router['get'](_0xa66f('0x10'),auth['isAuthenticated'](),controller['run']);router['get'](_0xa66f('0x11'),auth[_0xa66f('0xc')](),controller['query']);router[_0xa66f('0x12')]('/',auth['isAuthenticated'](),controller[_0xa66f('0x13')]);router['put'](_0xa66f('0xb'),auth[_0xa66f('0xc')](),controller[_0xa66f('0x14')]);router['delete']('/:id',auth[_0xa66f('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd943=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','show','get','preview','/:id/run','run','/:id/query','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xd943,0x15d));var _0x3d94=function(_0x3e761e,_0x30ad7a){_0x3e761e=_0x3e761e-0x0;var _0x3d32c8=_0xd943[_0x3e761e];return _0x3d32c8;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var auth=require(_0x3d94('0x5'));var interaction=require(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var controller=require(_0x3d94('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d94('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3d94('0xa')]);router[_0x3d94('0xb')]('/:id/preview',auth['isAuthenticated'](),controller[_0x3d94('0xc')]);router[_0x3d94('0xb')](_0x3d94('0xd'),auth['isAuthenticated'](),controller[_0x3d94('0xe')]);router['get'](_0x3d94('0xf'),auth[_0x3d94('0x10')](),controller['query']);router[_0x3d94('0x11')]('/',auth[_0x3d94('0x10')](),controller[_0x3d94('0x12')]);router[_0x3d94('0x13')](_0x3d94('0x14'),auth['isAuthenticated'](),controller[_0x3d94('0x15')]);router[_0x3d94('0x16')](_0x3d94('0x14'),auth['isAuthenticated'](),controller[_0x3d94('0x17')]);module[_0x3d94('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7deb049..52f689c 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 _0x521e=['exports','STRING','TEXT'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x521e,0xc9));var _0xe521=function(_0x4dd6cd,_0x123854){_0x4dd6cd=_0x4dd6cd-0x0;var _0xf24db0=_0x521e[_0x4dd6cd];return _0xf24db0;};'use strict';var Sequelize=require('sequelize');module[_0xe521('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe521('0x1')]},'parent':{'type':Sequelize[_0xe521('0x1')]},'table':{'type':Sequelize[_0xe521('0x1')]},'conditions':{'type':Sequelize[_0xe521('0x2')]},'joins':{'type':Sequelize[_0xe521('0x2')]}}; \ No newline at end of file +var _0xbb42=['TEXT','sequelize','exports','STRING'];(function(_0x560625,_0x21566a){var _0x3ba933=function(_0x538519){while(--_0x538519){_0x560625['push'](_0x560625['shift']());}};_0x3ba933(++_0x21566a);}(_0xbb42,0xc5));var _0x2bb4=function(_0x24d5b5,_0x2f7e99){_0x24d5b5=_0x24d5b5-0x0;var _0x4225b3=_0xbb42[_0x24d5b5];return _0x4225b3;};'use strict';var Sequelize=require(_0x2bb4('0x0'));module[_0x2bb4('0x1')]={'name':{'type':Sequelize[_0x2bb4('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x2bb4('0x2')]},'table':{'type':Sequelize[_0x2bb4('0x2')]},'conditions':{'type':Sequelize[_0x2bb4('0x3')]},'joins':{'type':Sequelize[_0x2bb4('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 3d28af0..566bea9 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 _0xc240=['default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','../../components/export/','../../files/reports','COUNT(*)','run','cross_join','SEC_TO_TIME(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','stack','name','send','index','AnalyticDefaultReport','rawAttributes','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','field','includeAll','include','findAll','rows','show','keys','fields','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','preview','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','select','groupBy','No\x20available\x20data','output','web','fullPath','generate','csv'];(function(_0x49202a,_0x59d007){var _0x23f7ef=function(_0x13a833){while(--_0x13a833){_0x49202a['push'](_0x49202a['shift']());}};_0x23f7ef(++_0x59d007);}(_0xc240,0x14d));var _0x0c24=function(_0x45b900,_0x2d7019){_0x45b900=_0x45b900-0x0;var _0x40233d=_0xc240[_0x45b900];return _0x40233d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0c24('0x0'));var rimraf=require(_0x0c24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c24('0x2'));var rp=require(_0x0c24('0x3'));var moment=require(_0x0c24('0x4'));var BPromise=require(_0x0c24('0x5'));var Mustache=require(_0x0c24('0x6'));var util=require(_0x0c24('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0c24('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0c24('0x9'));var crypto=require('crypto');var jsforce=require(_0x0c24('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0c24('0x8'));var querystring=require(_0x0c24('0xb'));var Papa=require(_0x0c24('0xc'));var Redis=require(_0x0c24('0xd'));var authService=require(_0x0c24('0xe'));var qs=require(_0x0c24('0xf'));var hardwareService=require(_0x0c24('0x10'));var logger=require(_0x0c24('0x11'))(_0x0c24('0x12'));var utils=require('../../config/utils');var config=require(_0x0c24('0x13'));var db=require(_0x0c24('0x14'))['db'];function respondWithStatusCode(_0x4544e2,_0x10c3aa){_0x10c3aa=_0x10c3aa||0xcc;return function(_0x3f3a88){if(_0x3f3a88){return _0x4544e2[_0x0c24('0x15')](_0x10c3aa);}return _0x4544e2[_0x0c24('0x16')](_0x10c3aa)[_0x0c24('0x17')]();};}function respondWithResult(_0x316bf5,_0x707c22){_0x707c22=_0x707c22||0xc8;return function(_0x4fdfd7){if(_0x4fdfd7){return _0x316bf5['status'](_0x707c22)[_0x0c24('0x18')](_0x4fdfd7);}};}function respondWithFilteredResult(_0x49e606,_0x36b065){return function(_0x2981c8){if(_0x2981c8){var _0x28d7b1=_0x2981c8[_0x0c24('0x19')],_0x135f44=_0x36b065[_0x0c24('0x1a')],_0x2d4694=_0x36b065[_0x0c24('0x1a')]+_0x36b065['limit'],_0x27d8bf;if(_0x2d4694>=_0x28d7b1){_0x2d4694=_0x28d7b1;_0x27d8bf=0xc8;}else{_0x27d8bf=0xce;}_0x49e606[_0x0c24('0x16')](_0x27d8bf);return _0x49e606[_0x0c24('0x1b')]('Content-Range',_0x135f44+'-'+_0x2d4694+'/'+_0x28d7b1)[_0x0c24('0x18')](_0x2981c8);}return null;};}function patchUpdates(_0x3f97d5){return function(_0xeefb54){try{jsonpatch[_0x0c24('0x1c')](_0xeefb54,_0x3f97d5,!![]);}catch(_0x502cf1){return BPromise[_0x0c24('0x1d')](_0x502cf1);}return _0xeefb54['save']();};}function saveUpdates(_0x34904e,_0x1ed659){return function(_0x4fa7c0){if(_0x4fa7c0){return _0x4fa7c0[_0x0c24('0x1e')](_0x34904e)[_0x0c24('0x1f')](function(_0x122c6c){return _0x122c6c;});}return null;};}function removeEntity(_0x4264f8,_0x271597){return function(_0x1822e9){if(_0x1822e9){return _0x1822e9[_0x0c24('0x20')]()[_0x0c24('0x1f')](function(){var _0x175d85=_0x1822e9[_0x0c24('0x21')]({'plain':!![]});var _0x10a463=_0x0c24('0x22');return db[_0x0c24('0x23')]['destroy']({'where':{'type':_0x10a463,'resourceId':_0x175d85['id']}})['then'](function(){return _0x1822e9;});})[_0x0c24('0x1f')](function(){_0x4264f8[_0x0c24('0x16')](0xcc)[_0x0c24('0x17')]();});}};}function handleEntityNotFound(_0x2ee5ba,_0x500907){return function(_0xb76e6a){if(!_0xb76e6a){_0x2ee5ba[_0x0c24('0x15')](0x194);}return _0xb76e6a;};}function handleError(_0x8a6751,_0x3c3d89){_0x3c3d89=_0x3c3d89||0x1f4;return function(_0x54377d){logger['error'](_0x54377d[_0x0c24('0x24')]);if(_0x54377d[_0x0c24('0x25')]){delete _0x54377d[_0x0c24('0x25')];}_0x8a6751[_0x0c24('0x16')](_0x3c3d89)[_0x0c24('0x26')](_0x54377d);};}exports[_0x0c24('0x27')]=function(_0x582ebc,_0x35c810){var _0x4b2507={},_0x477136={},_0x4d375a={'count':0x0,'rows':[]};var _0xbbe2a=db[_0x0c24('0x28')][_0x0c24('0x29')];_0x477136[_0x0c24('0x2a')]=_['keys'](_0xbbe2a);_0x477136[_0x0c24('0x2b')]=_['keys'](_0x582ebc[_0x0c24('0x2b')]);_0x477136['filters']=_['intersection'](_0x477136[_0x0c24('0x2a')],_0x477136[_0x0c24('0x2b')]);_0x4b2507['attributes']=_[_0x0c24('0x2c')](_0x477136[_0x0c24('0x2a')],qs['fields'](_0x582ebc['query']['fields']));_0x4b2507[_0x0c24('0x2d')]=_0x4b2507[_0x0c24('0x2d')][_0x0c24('0x2e')]?_0x4b2507[_0x0c24('0x2d')]:_0x477136[_0x0c24('0x2a')];if(!_0x582ebc['query'][_0x0c24('0x2f')](_0x0c24('0x30'))){_0x4b2507['limit']=qs[_0x0c24('0x31')](_0x582ebc[_0x0c24('0x2b')]['limit']);_0x4b2507[_0x0c24('0x1a')]=qs[_0x0c24('0x1a')](_0x582ebc['query'][_0x0c24('0x1a')]);}_0x4b2507['order']=qs[_0x0c24('0x32')](_0x582ebc[_0x0c24('0x2b')][_0x0c24('0x32')]);_0x4b2507[_0x0c24('0x33')]=qs[_0x0c24('0x34')](_[_0x0c24('0x35')](_0x582ebc[_0x0c24('0x2b')],_0x477136[_0x0c24('0x34')]));if(_0x582ebc[_0x0c24('0x2b')][_0x0c24('0x36')]){_0x4b2507['where']=_[_0x0c24('0x37')](_0x4b2507[_0x0c24('0x33')],{'$or':_[_0x0c24('0x38')](_0xbbe2a,function(_0x255603){if(_0x255603[_0x0c24('0x39')][_0x0c24('0x3a')]!=='VIRTUAL'){var _0x566652={};_0x566652[_0x255603[_0x0c24('0x3b')]]={'$like':'%'+_0x582ebc['query'][_0x0c24('0x36')]+'%'};return _0x566652;}})});}_0x4b2507=_['merge']({},_0x4b2507,_0x582ebc['options']);var _0x51ff40={'where':_0x4b2507[_0x0c24('0x33')]};return db[_0x0c24('0x28')][_0x0c24('0x19')](_0x51ff40)[_0x0c24('0x1f')](function(_0x36767c){_0x4d375a['count']=_0x36767c;if(_0x582ebc[_0x0c24('0x2b')][_0x0c24('0x3c')]){_0x4b2507[_0x0c24('0x3d')]=[{'all':!![]}];}return db[_0x0c24('0x28')][_0x0c24('0x3e')](_0x4b2507);})[_0x0c24('0x1f')](function(_0x26b9b8){_0x4d375a[_0x0c24('0x3f')]=_0x26b9b8;return _0x4d375a;})['then'](respondWithFilteredResult(_0x35c810,_0x4b2507))['catch'](handleError(_0x35c810,null));};exports[_0x0c24('0x40')]=function(_0x51c2c2,_0xc64afd){var _0x202c63={'raw':!![],'where':{'id':_0x51c2c2['params']['id']}},_0x251f58={};_0x251f58[_0x0c24('0x2a')]=_[_0x0c24('0x41')](db[_0x0c24('0x28')][_0x0c24('0x29')]);_0x251f58[_0x0c24('0x2b')]=_[_0x0c24('0x41')](_0x51c2c2['query']);_0x251f58[_0x0c24('0x34')]=_[_0x0c24('0x2c')](_0x251f58[_0x0c24('0x2a')],_0x251f58[_0x0c24('0x2b')]);_0x202c63['attributes']=_['intersection'](_0x251f58['model'],qs[_0x0c24('0x42')](_0x51c2c2['query'][_0x0c24('0x42')]));_0x202c63[_0x0c24('0x2d')]=_0x202c63[_0x0c24('0x2d')][_0x0c24('0x2e')]?_0x202c63[_0x0c24('0x2d')]:_0x251f58[_0x0c24('0x2a')];if(_0x51c2c2[_0x0c24('0x2b')]['includeAll']){_0x202c63[_0x0c24('0x3d')]=[{'all':!![]}];}_0x202c63=_[_0x0c24('0x37')]({},_0x202c63,_0x51c2c2[_0x0c24('0x43')]);return db[_0x0c24('0x28')]['find'](_0x202c63)[_0x0c24('0x1f')](handleEntityNotFound(_0xc64afd,null))[_0x0c24('0x1f')](respondWithResult(_0xc64afd,null))[_0x0c24('0x44')](handleError(_0xc64afd,null));};exports[_0x0c24('0x45')]=function(_0x1aef2e,_0x13bc17){return db['AnalyticDefaultReport']['create'](_0x1aef2e[_0x0c24('0x46')],{})[_0x0c24('0x1f')](function(_0x550f16){var _0x2c0fd1=_0x1aef2e[_0x0c24('0x47')][_0x0c24('0x21')]({'plain':!![]});if(!_0x2c0fd1)throw new Error(_0x0c24('0x48'));if(_0x2c0fd1[_0x0c24('0x49')]===_0x0c24('0x47')){var _0x260143=_0x550f16[_0x0c24('0x21')]({'plain':!![]});var _0x6922ef=_0x0c24('0x4a');return db[_0x0c24('0x4b')]['find']({'where':{'name':_0x6922ef,'userProfileId':_0x2c0fd1[_0x0c24('0x4c')]},'raw':!![]})[_0x0c24('0x1f')](function(_0x5db03f){if(_0x5db03f&&_0x5db03f['autoAssociation']===0x0){return db[_0x0c24('0x23')][_0x0c24('0x45')]({'name':_0x260143[_0x0c24('0x25')],'resourceId':_0x260143['id'],'type':_0x0c24('0x22'),'sectionId':_0x5db03f['id']},{})[_0x0c24('0x1f')](function(){return _0x550f16;});}else{return _0x550f16;}})[_0x0c24('0x44')](function(_0x33fdd9){logger[_0x0c24('0x4d')](_0x0c24('0x4e'),_0x33fdd9);throw _0x33fdd9;});}return _0x550f16;})[_0x0c24('0x1f')](respondWithResult(_0x13bc17,0xc9))[_0x0c24('0x44')](handleError(_0x13bc17,null));};exports[_0x0c24('0x1e')]=function(_0x306732,_0x28126b){if(_0x306732['body']['id']){delete _0x306732[_0x0c24('0x46')]['id'];}return db[_0x0c24('0x28')][_0x0c24('0x4f')]({'where':{'id':_0x306732[_0x0c24('0x50')]['id']}})[_0x0c24('0x1f')](handleEntityNotFound(_0x28126b,null))[_0x0c24('0x1f')](saveUpdates(_0x306732[_0x0c24('0x46')],null))['then'](respondWithResult(_0x28126b,null))[_0x0c24('0x44')](handleError(_0x28126b,null));};exports['destroy']=function(_0xcfc0e9,_0x55e97f){return db[_0x0c24('0x28')][_0x0c24('0x4f')]({'where':{'id':_0xcfc0e9[_0x0c24('0x50')]['id']}})['then'](handleEntityNotFound(_0x55e97f,null))[_0x0c24('0x1f')](removeEntity(_0x55e97f,null))[_0x0c24('0x44')](handleError(_0x55e97f,null));};exports[_0x0c24('0x51')]=function(_0x4324f2,_0x402790){var _0x2617a1=0xa;var _0x525b33=[_0x0c24('0x52'),_0x0c24('0x53'),_0x0c24('0x54'),'cross_join'];var _0x306318={'SUM':_0x0c24('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0c24('0x56'),'MAX':_0x0c24('0x57'),'MIN':_0x0c24('0x58'),'AVG':_0x0c24('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0c24('0x5a')};var _0x1440ba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0c24('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0c24('0x5c')};var _0x217106=function(_0x296bd1){return!_[_0x0c24('0x5d')]([_0x0c24('0x5e'),_0x0c24('0x5f'),_0x0c24('0x60'),_0x0c24('0x61')],_0x296bd1);};var _0x1fe170=function(_0x5776db){if(!_0x5776db||!_0x5776db[_0x0c24('0x62')][_0x0c24('0x2e')]){return'';}for(var _0x12be94='(',_0x1cfe9d=0x0;_0x1cfe9d<_0x5776db[_0x0c24('0x62')][_0x0c24('0x2e')];_0x1cfe9d+=0x1){_0x1cfe9d>0x0&&(_0x12be94+='\x20'+_0x5776db[_0x0c24('0x63')]+'\x20');_0x12be94+=_0x5776db[_0x0c24('0x62')][_0x1cfe9d][_0x0c24('0x64')]?_0x1fe170(_0x5776db[_0x0c24('0x62')][_0x1cfe9d][_0x0c24('0x64')]):_0x5776db[_0x0c24('0x62')][_0x1cfe9d][_0x0c24('0x3b')]+'\x20'+_0x5776db[_0x0c24('0x62')][_0x1cfe9d][_0x0c24('0x65')]+(_0x217106(_0x5776db['rules'][_0x1cfe9d][_0x0c24('0x65')])?'\x20'+_0x5776db['rules'][_0x1cfe9d][_0x0c24('0x66')]:'');}return _0x12be94+')';};var _0x1123ad={'where':{'id':_0x4324f2[_0x0c24('0x50')]['id']}},_0x2a1d17,_0x4b0eb8,_0xc7b3a6,_0x21d70b,_0x4db1b3;_0x1123ad=_[_0x0c24('0x37')]({},_0x1123ad,_0x4324f2[_0x0c24('0x43')]);return db[_0x0c24('0x28')][_0x0c24('0x4f')](_0x1123ad)['then'](function(_0x5d769c){if(_0x5d769c){_0x2a1d17=_0x5d769c;return _0x5d769c[_0x0c24('0x67')]();}return null;})['then'](function(_0x5ef529){if(_0x5ef529){if(!_0x5ef529[_0x0c24('0x2e')]){throw new db[(_0x0c24('0x68'))][(_0x0c24('0x69'))](_0x0c24('0x6a'),0x193);}_0x4b0eb8=_0x5ef529;return db[_0x0c24('0x6b')][_0x0c24('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x323569){if(_0x323569){_0xc7b3a6=_[_0x0c24('0x6c')](_0x323569,'id');var _0x24745f;var _0x81fc75=squel['select']();_0x81fc75[_0x0c24('0x6d')](_0x2a1d17[_0x0c24('0x6e')]);for(var _0x19ae9a=0x0;_0x19ae9a<_0x4b0eb8[_0x0c24('0x2e')];_0x19ae9a+=0x1){_0x24745f=_0x4b0eb8[_0x19ae9a][_0x0c24('0x6f')]?_0xc7b3a6[_0x4b0eb8[_0x19ae9a][_0x0c24('0x6f')]][_0x0c24('0x70')]:_0x4b0eb8[_0x19ae9a]['field'];_0x24745f=_0x4b0eb8[_0x19ae9a][_0x0c24('0x71')]?_[_0x0c24('0x72')](_0x306318[_0x4b0eb8[_0x19ae9a][_0x0c24('0x71')]],'%s',_0x24745f):_0x24745f;_0x24745f=_0x4b0eb8[_0x19ae9a][_0x0c24('0x73')]?_[_0x0c24('0x72')](_0x1440ba[_0x4b0eb8[_0x19ae9a][_0x0c24('0x73')]],'%s',_0x24745f):_0x24745f;if(_0x4b0eb8[_0x19ae9a]['groupBy']){_0x81fc75[_0x0c24('0x64')](_0x24745f);}_0x4b0eb8[_0x19ae9a][_0x0c24('0x74')]&&_0x81fc75[_0x0c24('0x75')](_0x24745f,_0x4b0eb8[_0x19ae9a][_0x0c24('0x74')]===_0x0c24('0x76')?![]:!![]);_0x81fc75['field'](_0x24745f,_0x4b0eb8[_0x19ae9a][_0x0c24('0x77')]||_0x24745f);}if(_0x2a1d17[_0x0c24('0x78')]){_0x2a1d17[_0x0c24('0x78')]=JSON[_0x0c24('0x79')](_0x2a1d17[_0x0c24('0x78')]);for(var _0x2e0e26=0x0;_0x2e0e26<_0x2a1d17[_0x0c24('0x78')][_0x0c24('0x2e')];_0x2e0e26+=0x1){if(_0x2a1d17['joins'][_0x2e0e26][_0x0c24('0x39')]&&_[_0x0c24('0x5d')](_0x525b33,_0x2a1d17[_0x0c24('0x78')][_0x2e0e26][_0x0c24('0x39')])&&_0x2a1d17['joins'][_0x2e0e26]['parentKey']&&_0x2a1d17[_0x0c24('0x78')][_0x2e0e26][_0x0c24('0x7a')]&&_0x2a1d17['joins'][_0x2e0e26][_0x0c24('0x7b')]){_0x81fc75[_0x2a1d17['joins'][_0x2e0e26][_0x0c24('0x39')]](_0x2a1d17['joins'][_0x2e0e26]['foreignTable'],null,util[_0x0c24('0x73')](_0x0c24('0x7c'),_0x2a1d17[_0x0c24('0x6e')],_0x2a1d17[_0x0c24('0x78')][_0x2e0e26][_0x0c24('0x7d')],_0x2a1d17[_0x0c24('0x78')][_0x2e0e26]['foreignTable'],_0x2a1d17[_0x0c24('0x78')][_0x2e0e26][_0x0c24('0x7b')]));}}}if(_0x2a1d17[_0x0c24('0x7e')]){_0x2a1d17[_0x0c24('0x7e')]=JSON[_0x0c24('0x79')](_0x2a1d17['conditions']);_0x81fc75[_0x0c24('0x33')](_0x1fe170(_0x2a1d17[_0x0c24('0x7e')][_0x0c24('0x64')]));}_0x4db1b3=_0x81fc75[_0x0c24('0x7f')]();_0x81fc75[_0x0c24('0x31')](_0x2617a1);_0x81fc75['offset'](0x0);logger[_0x0c24('0x80')](_0x0c24('0x81'),_0x81fc75[_0x0c24('0x82')]());return db[_0x0c24('0x83')][_0x0c24('0x2b')](_0x81fc75[_0x0c24('0x82')](),{'type':db[_0x0c24('0x83')][_0x0c24('0x84')][_0x0c24('0x85')]});}})['then'](respondWithResult(_0x402790,null))[_0x0c24('0x44')](handleError(_0x402790,null));};function runReport(_0x244174,_0x465a18,_0x45bc32){var _0x10d86d=_0x465a18['name'];var _0x52dd93=0xa;var _0x164e43=[_0x0c24('0x52'),'left_join',_0x0c24('0x54'),'cross_join'];var _0x791ab5={'SUM':_0x0c24('0x55'),'COUNT':_0x0c24('0x86'),'COUNT DISTINCT':_0x0c24('0x56'),'MAX':'MAX(%s)','MIN':_0x0c24('0x58'),'AVG':_0x0c24('0x59'),'GROUP_CONCAT':_0x0c24('0x87'),'GROUP_CONCAT ASC':_0x0c24('0x88'),'GROUP_CONCAT DESC':_0x0c24('0x5a')};var _0x1f6409={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0c24('0x5b'),'HOUR':_0x0c24('0x89'),'ROUND':_0x0c24('0x8a'),'UNIX_TIMESTAMP':_0x0c24('0x5c')};var _0x37f0b6=function(_0x3f087d){return!_['includes'](['IS\x20NULL',_0x0c24('0x5f'),_0x0c24('0x60'),_0x0c24('0x61')],_0x3f087d);};var _0x4febd8=function(_0x4eaf95){if(!_0x4eaf95||!_0x4eaf95['rules']['length']){return'';}for(var _0x3d8df7='(',_0x70254c=0x0;_0x70254c<_0x4eaf95['rules']['length'];_0x70254c+=0x1){_0x70254c>0x0&&(_0x3d8df7+='\x20'+_0x4eaf95[_0x0c24('0x63')]+'\x20');_0x3d8df7+=_0x4eaf95[_0x0c24('0x62')][_0x70254c]['group']?_0x4febd8(_0x4eaf95[_0x0c24('0x62')][_0x70254c][_0x0c24('0x64')]):_0x4eaf95[_0x0c24('0x62')][_0x70254c][_0x0c24('0x3b')]+'\x20'+_0x4eaf95[_0x0c24('0x62')][_0x70254c][_0x0c24('0x65')]+(_0x37f0b6(_0x4eaf95[_0x0c24('0x62')][_0x70254c][_0x0c24('0x65')])?'\x20'+_0x4eaf95[_0x0c24('0x62')][_0x70254c]['value']:'');}return _0x3d8df7+')';};var _0x4bdce6={'where':{'id':_0x244174['id']}},_0x500e0f,_0x3e19dd,_0x2a727d,_0x4173e3,_0x5c3cff;_0x4bdce6=_[_0x0c24('0x37')]({},_0x4bdce6,_0x45bc32);return db['AnalyticDefaultReport'][_0x0c24('0x4f')](_0x4bdce6)[_0x0c24('0x1f')](function(_0x4a4e48){if(_0x4a4e48){_0x500e0f=_0x4a4e48;return _0x4a4e48[_0x0c24('0x67')]();}return null;})[_0x0c24('0x1f')](function(_0x50664c){if(_0x50664c){if(!_0x50664c[_0x0c24('0x2e')]){throw new db[(_0x0c24('0x68'))][(_0x0c24('0x69'))](_0x0c24('0x6a'),0x193);}_0x3e19dd=_0x50664c;return db[_0x0c24('0x6b')][_0x0c24('0x3e')]({'raw':!![]});}return null;})[_0x0c24('0x1f')](function(_0x2ad0ff){if(_0x2ad0ff){_0x2a727d=_[_0x0c24('0x6c')](_0x2ad0ff,'id');var _0x49ce08;var _0x1e1318=squel[_0x0c24('0x8b')]();_0x1e1318[_0x0c24('0x6d')](_0x500e0f['table']);for(var _0x40f2a6=0x0;_0x40f2a6<_0x3e19dd[_0x0c24('0x2e')];_0x40f2a6+=0x1){_0x49ce08=_0x3e19dd[_0x40f2a6][_0x0c24('0x6f')]?_0x2a727d[_0x3e19dd[_0x40f2a6]['MetricId']][_0x0c24('0x70')]:_0x3e19dd[_0x40f2a6]['field'];_0x49ce08=_0x3e19dd[_0x40f2a6][_0x0c24('0x71')]?_[_0x0c24('0x72')](_0x791ab5[_0x3e19dd[_0x40f2a6][_0x0c24('0x71')]],'%s',_0x49ce08):_0x49ce08;_0x49ce08=_0x3e19dd[_0x40f2a6][_0x0c24('0x73')]?_[_0x0c24('0x72')](_0x1f6409[_0x3e19dd[_0x40f2a6][_0x0c24('0x73')]],'%s',_0x49ce08):_0x49ce08;if(_0x3e19dd[_0x40f2a6][_0x0c24('0x8c')]){_0x1e1318[_0x0c24('0x64')](_0x49ce08);}_0x3e19dd[_0x40f2a6][_0x0c24('0x74')]&&_0x1e1318[_0x0c24('0x75')](_0x49ce08,_0x3e19dd[_0x40f2a6][_0x0c24('0x74')]==='DESC'?![]:!![]);_0x1e1318[_0x0c24('0x3b')](_0x49ce08,_0x3e19dd[_0x40f2a6][_0x0c24('0x77')]||_0x49ce08);}if(_0x500e0f[_0x0c24('0x78')]){_0x500e0f['joins']=JSON[_0x0c24('0x79')](_0x500e0f[_0x0c24('0x78')]);for(var _0x11efd3=0x0;_0x11efd3<_0x500e0f[_0x0c24('0x78')][_0x0c24('0x2e')];_0x11efd3+=0x1){if(_0x500e0f[_0x0c24('0x78')][_0x11efd3]['type']&&_[_0x0c24('0x5d')](_0x164e43,_0x500e0f[_0x0c24('0x78')][_0x11efd3]['type'])&&_0x500e0f[_0x0c24('0x78')][_0x11efd3][_0x0c24('0x7d')]&&_0x500e0f[_0x0c24('0x78')][_0x11efd3]['foreignTable']&&_0x500e0f[_0x0c24('0x78')][_0x11efd3][_0x0c24('0x7b')]){_0x1e1318[_0x500e0f[_0x0c24('0x78')][_0x11efd3][_0x0c24('0x39')]](_0x500e0f['joins'][_0x11efd3][_0x0c24('0x7a')],null,util[_0x0c24('0x73')](_0x0c24('0x7c'),_0x500e0f[_0x0c24('0x6e')],_0x500e0f[_0x0c24('0x78')][_0x11efd3]['parentKey'],_0x500e0f[_0x0c24('0x78')][_0x11efd3][_0x0c24('0x7a')],_0x500e0f[_0x0c24('0x78')][_0x11efd3][_0x0c24('0x7b')]));}}}if(_0x500e0f[_0x0c24('0x7e')]){_0x500e0f[_0x0c24('0x7e')]=JSON['parse'](_0x500e0f['conditions']);_0x1e1318[_0x0c24('0x33')](_0x4febd8(_0x500e0f[_0x0c24('0x7e')]['group']));}_0x5c3cff=_0x1e1318[_0x0c24('0x7f')]();_0x1e1318[_0x0c24('0x31')](_0x52dd93);_0x1e1318[_0x0c24('0x1a')](0x0);logger[_0x0c24('0x80')](_0x0c24('0x81'),_0x1e1318[_0x0c24('0x82')]());return db[_0x0c24('0x83')][_0x0c24('0x2b')](_0x1e1318['toString'](),{'type':db['sequelize'][_0x0c24('0x84')][_0x0c24('0x85')]});}})['then'](function(_0x448222){if(!_0x448222[_0x0c24('0x2e')]){throw new db[(_0x0c24('0x68'))]['ValidationErrorItem'](_0x0c24('0x8d'),0xcc);}if(_0x465a18[_0x0c24('0x8e')]===_0x0c24('0x8f')){return null;}var _0x58141a=_[_0x0c24('0x37')](_0x465a18,{'name':_0x465a18[_0x0c24('0x90')]||_0x465a18[_0x0c24('0x25')]||_0x500e0f[_0x0c24('0x25')],'basename':_0x10d86d,'savename':util[_0x0c24('0x73')]('%s-%s.%s',_0x465a18[_0x0c24('0x25')]||_0x500e0f['name'],require('randomstring')[_0x0c24('0x91')](0x4),_0x465a18[_0x0c24('0x8e')]||_0x0c24('0x92')),'reportId':_0x500e0f['id'],'reportType':_0x0c24('0x93')});return db[_0x0c24('0x94')][_0x0c24('0x45')](_0x58141a,{'raw':!![]});})[_0x0c24('0x1f')](function(_0x58d915){if(_0x500e0f[_0x0c24('0x6e')]===_0x0c24('0x95')){_0x5c3cff['where'](_0x500e0f['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x465a18['startDate'],_0x465a18[_0x0c24('0x96')]);}else{_0x5c3cff[_0x0c24('0x33')](_0x500e0f[_0x0c24('0x6e')]+_0x0c24('0x97'),_0x465a18[_0x0c24('0x98')],_0x465a18[_0x0c24('0x96')]);}if(_0x58d915){logger['info'](_0x0c24('0x99'),_0x5c3cff[_0x0c24('0x82')]());require('child_process')['fork'](path[_0x0c24('0x52')](__dirname,_0x0c24('0x9a'),_0x58d915['output']),[_0x58d915['id'],_0x5c3cff[_0x0c24('0x82')](),path[_0x0c24('0x52')](__dirname,_0x0c24('0x9b'),_0x58d915['savename']),_0x10d86d]);return _0x58d915;}else{var _0x193409=squel[_0x0c24('0x8b')]();_0x193409[_0x0c24('0x6d')]('('+_0x5c3cff['toString']()+')','countTable');_0x193409[_0x0c24('0x3b')](_0x0c24('0x9c'),_0x0c24('0x19'));_0x5c3cff[_0x0c24('0x31')](_0x465a18[_0x0c24('0x31')]||_0x52dd93);_0x5c3cff['offset'](_0x465a18[_0x0c24('0x1a')]||0x0);return db[_0x0c24('0x83')]['query'](_0x193409[_0x0c24('0x82')](),{'type':db[_0x0c24('0x83')]['QueryTypes'][_0x0c24('0x85')]})[_0x0c24('0x1f')](function(_0x2e7ec5){if(!_0x2e7ec5['length']){_0x4173e3=0x0;}else{_0x4173e3=_0x2e7ec5[0x0][_0x0c24('0x19')]||0x0;}return db[_0x0c24('0x83')][_0x0c24('0x2b')](_0x5c3cff[_0x0c24('0x82')](),{'type':db[_0x0c24('0x83')][_0x0c24('0x84')][_0x0c24('0x85')]});})[_0x0c24('0x1f')](function(_0x55a3ca){return{'rows':_0x55a3ca||[],'count':_0x4173e3};});}});}exports[_0x0c24('0x9d')]=function(_0x5dd01d,_0x53576e){return runReport(_0x5dd01d[_0x0c24('0x50')],_0x5dd01d['query'],_0x5dd01d[_0x0c24('0x43')])[_0x0c24('0x1f')](respondWithResult(_0x53576e,null))[_0x0c24('0x44')](handleError(_0x53576e,null));};exports['runReport']=runReport;exports[_0x0c24('0x2b')]=function(_0x186b6c,_0x14e823){var _0x280e54=0xa;var _0x26388a=['join',_0x0c24('0x53'),_0x0c24('0x54'),_0x0c24('0x9e')];var _0x46fd84={'SUM':'SUM(%s)','COUNT':_0x0c24('0x86'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0c24('0x57'),'MIN':_0x0c24('0x58'),'AVG':_0x0c24('0x59'),'GROUP_CONCAT':_0x0c24('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0c24('0x5a')};var _0x2a8657={'SEC_TO_TIME':_0x0c24('0x9f'),'DATE':_0x0c24('0x5b'),'HOUR':_0x0c24('0x89'),'ROUND':_0x0c24('0x8a'),'UNIX_TIMESTAMP':_0x0c24('0x5c')};var _0x3c3272=function(_0x3fb595){return!_[_0x0c24('0x5d')](['IS\x20NULL',_0x0c24('0x5f'),_0x0c24('0x60'),'IS\x20NOT\x20EMPTY'],_0x3fb595);};var _0x1bad05=function(_0x5d4c3d){if(!_0x5d4c3d||!_0x5d4c3d[_0x0c24('0x62')][_0x0c24('0x2e')]){return'';}for(var _0x9370e7='(',_0x271a7e=0x0;_0x271a7e<_0x5d4c3d[_0x0c24('0x62')][_0x0c24('0x2e')];_0x271a7e+=0x1){_0x271a7e>0x0&&(_0x9370e7+='\x20'+_0x5d4c3d[_0x0c24('0x63')]+'\x20');_0x9370e7+=_0x5d4c3d[_0x0c24('0x62')][_0x271a7e]['group']?_0x1bad05(_0x5d4c3d[_0x0c24('0x62')][_0x271a7e]['group']):_0x5d4c3d[_0x0c24('0x62')][_0x271a7e][_0x0c24('0x3b')]+'\x20'+_0x5d4c3d[_0x0c24('0x62')][_0x271a7e]['condition']+(_0x3c3272(_0x5d4c3d[_0x0c24('0x62')][_0x271a7e][_0x0c24('0x65')])?'\x20'+_0x5d4c3d[_0x0c24('0x62')][_0x271a7e][_0x0c24('0x66')]:'');}return _0x9370e7+')';};var _0x9c732c={'where':{'id':_0x186b6c[_0x0c24('0x50')]['id']}},_0xf549a4,_0x4a9ad6,_0x4b7016,_0x8c3f42,_0x71e9a4;_0x9c732c=_[_0x0c24('0x37')]({},_0x9c732c,_0x186b6c['options']);return db[_0x0c24('0x28')][_0x0c24('0x4f')](_0x9c732c)['then'](function(_0x4c2f90){if(_0x4c2f90){_0xf549a4=_0x4c2f90;return _0x4c2f90[_0x0c24('0x67')]();}return null;})[_0x0c24('0x1f')](function(_0x2916db){if(_0x2916db){if(!_0x2916db[_0x0c24('0x2e')]){throw new db[(_0x0c24('0x68'))]['ValidationErrorItem'](_0x0c24('0x6a'),0x193);}_0x4a9ad6=_0x2916db;return db[_0x0c24('0x6b')][_0x0c24('0x3e')]({'raw':!![]});}return null;})[_0x0c24('0x1f')](function(_0x394547){if(_0x394547){_0x4b7016=_[_0x0c24('0x6c')](_0x394547,'id');var _0x11c7cf;var _0x19cf0d=squel[_0x0c24('0x8b')]();_0x19cf0d[_0x0c24('0x6d')](_0xf549a4[_0x0c24('0x6e')]);for(var _0x32726c=0x0;_0x32726c<_0x4a9ad6[_0x0c24('0x2e')];_0x32726c+=0x1){_0x11c7cf=_0x4a9ad6[_0x32726c]['MetricId']?_0x4b7016[_0x4a9ad6[_0x32726c][_0x0c24('0x6f')]][_0x0c24('0x70')]:_0x4a9ad6[_0x32726c][_0x0c24('0x3b')];_0x11c7cf=_0x4a9ad6[_0x32726c]['function']?_[_0x0c24('0x72')](_0x46fd84[_0x4a9ad6[_0x32726c][_0x0c24('0x71')]],'%s',_0x11c7cf):_0x11c7cf;_0x11c7cf=_0x4a9ad6[_0x32726c]['format']?_[_0x0c24('0x72')](_0x2a8657[_0x4a9ad6[_0x32726c][_0x0c24('0x73')]],'%s',_0x11c7cf):_0x11c7cf;if(_0x4a9ad6[_0x32726c][_0x0c24('0x8c')]){_0x19cf0d[_0x0c24('0x64')](_0x11c7cf);}_0x4a9ad6[_0x32726c][_0x0c24('0x74')]&&_0x19cf0d['order'](_0x11c7cf,_0x4a9ad6[_0x32726c]['orderBy']===_0x0c24('0x76')?![]:!![]);_0x19cf0d[_0x0c24('0x3b')](_0x11c7cf,_0x4a9ad6[_0x32726c][_0x0c24('0x77')]||_0x11c7cf);}if(_0xf549a4['joins']){_0xf549a4[_0x0c24('0x78')]=JSON[_0x0c24('0x79')](_0xf549a4[_0x0c24('0x78')]);for(var _0x35ab97=0x0;_0x35ab97<_0xf549a4[_0x0c24('0x78')][_0x0c24('0x2e')];_0x35ab97+=0x1){if(_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x39')]&&_[_0x0c24('0x5d')](_0x26388a,_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x39')])&&_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x7d')]&&_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x7a')]&&_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x7b')]){_0x19cf0d[_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x39')]](_0xf549a4['joins'][_0x35ab97]['foreignTable'],null,util[_0x0c24('0x73')](_0x0c24('0x7c'),_0xf549a4[_0x0c24('0x6e')],_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x7d')],_0xf549a4[_0x0c24('0x78')][_0x35ab97][_0x0c24('0x7a')],_0xf549a4['joins'][_0x35ab97][_0x0c24('0x7b')]));}}}if(_0xf549a4[_0x0c24('0x7e')]){_0xf549a4[_0x0c24('0x7e')]=JSON[_0x0c24('0x79')](_0xf549a4[_0x0c24('0x7e')]);_0x19cf0d[_0x0c24('0x33')](_0x1bad05(_0xf549a4[_0x0c24('0x7e')][_0x0c24('0x64')]));}_0x71e9a4=_0x19cf0d[_0x0c24('0x7f')]();_0x19cf0d['limit'](_0x280e54);_0x19cf0d['offset'](0x0);logger[_0x0c24('0x80')](_0x0c24('0x81'),_0x19cf0d[_0x0c24('0x82')]());return db[_0x0c24('0x83')][_0x0c24('0x2b')](_0x19cf0d[_0x0c24('0x82')](),{'type':db[_0x0c24('0x83')][_0x0c24('0x84')][_0x0c24('0x85')]});}})['then'](function(){return{'sql':_0x71e9a4[_0x0c24('0x82')]()};})['then'](respondWithResult(_0x14e823,null))[_0x0c24('0x44')](handleError(_0x14e823,null));}; \ No newline at end of file +var _0xf7b5=['reject','save','update','DefaultReports','destroy','then','error','stack','name','send','AnalyticDefaultReport','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','clone','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','Please\x20insert\x20at\x20least\x20one\x20field','from','parse','conditions','debug','QueryTypes','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','create','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','runReport','COUNT(%s)','IS\x20NOT\x20NULL','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply'];(function(_0x370b93,_0x25ee06){var _0x2900d5=function(_0x365cf6){while(--_0x365cf6){_0x370b93['push'](_0x370b93['shift']());}};_0x2900d5(++_0x25ee06);}(_0xf7b5,0x1d5));var _0x5f7b=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xf7b5[_0x26b8b5];return _0x2150a9;};'use strict';var pdf=require(_0x5f7b('0x0'));var emlformat=require(_0x5f7b('0x1'));var rimraf=require(_0x5f7b('0x2'));var zipdir=require(_0x5f7b('0x3'));var jsonpatch=require(_0x5f7b('0x4'));var rp=require(_0x5f7b('0x5'));var moment=require('moment');var BPromise=require(_0x5f7b('0x6'));var Mustache=require(_0x5f7b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5f7b('0x8'));var csv=require(_0x5f7b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5f7b('0xa'));var squel=require('squel');var crypto=require(_0x5f7b('0xb'));var jsforce=require(_0x5f7b('0xc'));var deskjs=require(_0x5f7b('0xd'));var toCsv=require(_0x5f7b('0x9'));var querystring=require('querystring');var Papa=require(_0x5f7b('0xe'));var Redis=require(_0x5f7b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5f7b('0x10'));var hardwareService=require(_0x5f7b('0x11'));var logger=require(_0x5f7b('0x12'))(_0x5f7b('0x13'));var utils=require(_0x5f7b('0x14'));var config=require(_0x5f7b('0x15'));var db=require(_0x5f7b('0x16'))['db'];function respondWithStatusCode(_0x14b2dd,_0x26b41f){_0x26b41f=_0x26b41f||0xcc;return function(_0x351dac){if(_0x351dac){return _0x14b2dd[_0x5f7b('0x17')](_0x26b41f);}return _0x14b2dd[_0x5f7b('0x18')](_0x26b41f)[_0x5f7b('0x19')]();};}function respondWithResult(_0x2edb22,_0x2d9757){_0x2d9757=_0x2d9757||0xc8;return function(_0x5a914f){if(_0x5a914f){return _0x2edb22[_0x5f7b('0x18')](_0x2d9757)['json'](_0x5a914f);}};}function respondWithFilteredResult(_0x4a32ba,_0x3b1929){return function(_0x3e9bbe){if(_0x3e9bbe){var _0x2472e0=_0x3e9bbe[_0x5f7b('0x1a')],_0x165000=_0x3b1929[_0x5f7b('0x1b')],_0x200787=_0x3b1929['offset']+_0x3b1929[_0x5f7b('0x1c')],_0x2d9a08;if(_0x200787>=_0x2472e0){_0x200787=_0x2472e0;_0x2d9a08=0xc8;}else{_0x2d9a08=0xce;}_0x4a32ba[_0x5f7b('0x18')](_0x2d9a08);return _0x4a32ba['set'](_0x5f7b('0x1d'),_0x165000+'-'+_0x200787+'/'+_0x2472e0)[_0x5f7b('0x1e')](_0x3e9bbe);}return null;};}function patchUpdates(_0x1a06de){return function(_0x1fbced){try{jsonpatch[_0x5f7b('0x1f')](_0x1fbced,_0x1a06de,!![]);}catch(_0x48808e){return BPromise[_0x5f7b('0x20')](_0x48808e);}return _0x1fbced[_0x5f7b('0x21')]();};}function saveUpdates(_0x16179b,_0xad7a35){return function(_0x15d0fa){if(_0x15d0fa){return _0x15d0fa[_0x5f7b('0x22')](_0x16179b)['then'](function(_0x312bfa){return _0x312bfa;});}return null;};}function removeEntity(_0x23fb36,_0x1e3af0){return function(_0x2f16f5){if(_0x2f16f5){return _0x2f16f5['destroy']()['then'](function(){var _0xc65095=_0x2f16f5['get']({'plain':!![]});var _0x42b89a=_0x5f7b('0x23');return db['UserProfileResource'][_0x5f7b('0x24')]({'where':{'type':_0x42b89a,'resourceId':_0xc65095['id']}})[_0x5f7b('0x25')](function(){return _0x2f16f5;});})['then'](function(){_0x23fb36[_0x5f7b('0x18')](0xcc)[_0x5f7b('0x19')]();});}};}function handleEntityNotFound(_0x430ef2,_0x1c86c4){return function(_0x38b4e2){if(!_0x38b4e2){_0x430ef2[_0x5f7b('0x17')](0x194);}return _0x38b4e2;};}function handleError(_0x5dda84,_0x2e02b8){_0x2e02b8=_0x2e02b8||0x1f4;return function(_0x1cf687){logger[_0x5f7b('0x26')](_0x1cf687[_0x5f7b('0x27')]);if(_0x1cf687[_0x5f7b('0x28')]){delete _0x1cf687[_0x5f7b('0x28')];}_0x5dda84[_0x5f7b('0x18')](_0x2e02b8)[_0x5f7b('0x29')](_0x1cf687);};}exports['index']=function(_0x686e45,_0x449116){var _0x405639={},_0x3b41e8={},_0x3d9807={'count':0x0,'rows':[]};var _0xb555d1=db[_0x5f7b('0x2a')][_0x5f7b('0x2b')];_0x3b41e8[_0x5f7b('0x2c')]=_[_0x5f7b('0x2d')](_0xb555d1);_0x3b41e8[_0x5f7b('0x2e')]=_[_0x5f7b('0x2d')](_0x686e45[_0x5f7b('0x2e')]);_0x3b41e8['filters']=_[_0x5f7b('0x2f')](_0x3b41e8[_0x5f7b('0x2c')],_0x3b41e8[_0x5f7b('0x2e')]);_0x405639[_0x5f7b('0x30')]=_[_0x5f7b('0x2f')](_0x3b41e8[_0x5f7b('0x2c')],qs[_0x5f7b('0x31')](_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x31')]));_0x405639[_0x5f7b('0x30')]=_0x405639[_0x5f7b('0x30')]['length']?_0x405639['attributes']:_0x3b41e8[_0x5f7b('0x2c')];if(!_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x32')](_0x5f7b('0x33'))){_0x405639[_0x5f7b('0x1c')]=qs[_0x5f7b('0x1c')](_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x1c')]);_0x405639[_0x5f7b('0x1b')]=qs[_0x5f7b('0x1b')](_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x1b')]);}_0x405639[_0x5f7b('0x34')]=qs[_0x5f7b('0x35')](_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x35')]);_0x405639['where']=qs[_0x5f7b('0x36')](_[_0x5f7b('0x37')](_0x686e45[_0x5f7b('0x2e')],_0x3b41e8[_0x5f7b('0x36')]));if(_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x38')]){_0x405639[_0x5f7b('0x39')]=_['merge'](_0x405639[_0x5f7b('0x39')],{'$or':_[_0x5f7b('0x3a')](_0xb555d1,function(_0x2a87ce){if(_0x2a87ce[_0x5f7b('0x3b')]['key']!==_0x5f7b('0x3c')){var _0x4a9c98={};_0x4a9c98[_0x2a87ce[_0x5f7b('0x3d')]]={'$like':'%'+_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x38')]+'%'};return _0x4a9c98;}})});}_0x405639=_[_0x5f7b('0x3e')]({},_0x405639,_0x686e45[_0x5f7b('0x3f')]);var _0xa95a6a={'where':_0x405639[_0x5f7b('0x39')]};return db[_0x5f7b('0x2a')][_0x5f7b('0x1a')](_0xa95a6a)['then'](function(_0x5494ee){_0x3d9807['count']=_0x5494ee;if(_0x686e45[_0x5f7b('0x2e')][_0x5f7b('0x40')]){_0x405639[_0x5f7b('0x41')]=[{'all':!![]}];}return db[_0x5f7b('0x2a')][_0x5f7b('0x42')](_0x405639);})[_0x5f7b('0x25')](function(_0x33dc3d){_0x3d9807[_0x5f7b('0x43')]=_0x33dc3d;return _0x3d9807;})['then'](respondWithFilteredResult(_0x449116,_0x405639))[_0x5f7b('0x44')](handleError(_0x449116,null));};exports[_0x5f7b('0x45')]=function(_0x148250,_0x5af913){var _0x4a2eda={'raw':!![],'where':{'id':_0x148250[_0x5f7b('0x46')]['id']}},_0x3bbac0={};_0x3bbac0[_0x5f7b('0x2c')]=_[_0x5f7b('0x2d')](db[_0x5f7b('0x2a')][_0x5f7b('0x2b')]);_0x3bbac0[_0x5f7b('0x2e')]=_[_0x5f7b('0x2d')](_0x148250['query']);_0x3bbac0[_0x5f7b('0x36')]=_['intersection'](_0x3bbac0[_0x5f7b('0x2c')],_0x3bbac0[_0x5f7b('0x2e')]);_0x4a2eda[_0x5f7b('0x30')]=_[_0x5f7b('0x2f')](_0x3bbac0['model'],qs[_0x5f7b('0x31')](_0x148250[_0x5f7b('0x2e')]['fields']));_0x4a2eda[_0x5f7b('0x30')]=_0x4a2eda[_0x5f7b('0x30')]['length']?_0x4a2eda[_0x5f7b('0x30')]:_0x3bbac0[_0x5f7b('0x2c')];if(_0x148250[_0x5f7b('0x2e')]['includeAll']){_0x4a2eda[_0x5f7b('0x41')]=[{'all':!![]}];}_0x4a2eda=_[_0x5f7b('0x3e')]({},_0x4a2eda,_0x148250['options']);return db[_0x5f7b('0x2a')][_0x5f7b('0x47')](_0x4a2eda)[_0x5f7b('0x25')](handleEntityNotFound(_0x5af913,null))[_0x5f7b('0x25')](respondWithResult(_0x5af913,null))[_0x5f7b('0x44')](handleError(_0x5af913,null));};exports['create']=function(_0x583c4c,_0x417a0a){return db[_0x5f7b('0x2a')]['create'](_0x583c4c[_0x5f7b('0x48')],{})[_0x5f7b('0x25')](function(_0xe572f){var _0x1c6e59=_0x583c4c['user'][_0x5f7b('0x49')]({'plain':!![]});if(!_0x1c6e59)throw new Error(_0x5f7b('0x4a'));if(_0x1c6e59[_0x5f7b('0x4b')]===_0x5f7b('0x4c')){var _0x128301=_0xe572f[_0x5f7b('0x49')]({'plain':!![]});var _0x545857=_0x5f7b('0x4d');return db[_0x5f7b('0x4e')]['find']({'where':{'name':_0x545857,'userProfileId':_0x1c6e59[_0x5f7b('0x4f')]},'raw':!![]})['then'](function(_0x4aa8fb){if(_0x4aa8fb&&_0x4aa8fb[_0x5f7b('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x128301[_0x5f7b('0x28')],'resourceId':_0x128301['id'],'type':_0x5f7b('0x23'),'sectionId':_0x4aa8fb['id']},{})['then'](function(){return _0xe572f;});}else{return _0xe572f;}})[_0x5f7b('0x44')](function(_0x3743b6){logger['error'](_0x5f7b('0x51'),_0x3743b6);throw _0x3743b6;});}return _0xe572f;})['then'](respondWithResult(_0x417a0a,0xc9))[_0x5f7b('0x44')](handleError(_0x417a0a,null));};exports[_0x5f7b('0x22')]=function(_0x28c6b7,_0x492941){if(_0x28c6b7[_0x5f7b('0x48')]['id']){delete _0x28c6b7[_0x5f7b('0x48')]['id'];}return db[_0x5f7b('0x2a')][_0x5f7b('0x47')]({'where':{'id':_0x28c6b7[_0x5f7b('0x46')]['id']}})[_0x5f7b('0x25')](handleEntityNotFound(_0x492941,null))['then'](saveUpdates(_0x28c6b7[_0x5f7b('0x48')],null))[_0x5f7b('0x25')](respondWithResult(_0x492941,null))['catch'](handleError(_0x492941,null));};exports[_0x5f7b('0x24')]=function(_0x41a362,_0x17cb9a){return db[_0x5f7b('0x2a')][_0x5f7b('0x47')]({'where':{'id':_0x41a362[_0x5f7b('0x46')]['id']}})[_0x5f7b('0x25')](handleEntityNotFound(_0x17cb9a,null))[_0x5f7b('0x25')](removeEntity(_0x17cb9a,null))[_0x5f7b('0x44')](handleError(_0x17cb9a,null));};exports[_0x5f7b('0x52')]=function(_0x22bb69,_0x4d225c){var _0x23cc77=0xa;var _0x70c944=[_0x5f7b('0x53'),_0x5f7b('0x54'),_0x5f7b('0x55'),_0x5f7b('0x56')];var _0xe7c0fc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5f7b('0x57'),'MAX':_0x5f7b('0x58'),'MIN':_0x5f7b('0x59'),'AVG':_0x5f7b('0x5a'),'GROUP_CONCAT':_0x5f7b('0x5b'),'GROUP_CONCAT ASC':_0x5f7b('0x5c'),'GROUP_CONCAT DESC':_0x5f7b('0x5d')};var _0x2ac63c={'SEC_TO_TIME':_0x5f7b('0x5e'),'DATE':_0x5f7b('0x5f'),'HOUR':_0x5f7b('0x60'),'ROUND':_0x5f7b('0x61'),'UNIX_TIMESTAMP':_0x5f7b('0x62')};var _0x2677ea=function(_0x38f3fe){return!_[_0x5f7b('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x38f3fe);};var _0x1a5f92=function(_0x4297ef){if(!_0x4297ef||!_0x4297ef[_0x5f7b('0x64')][_0x5f7b('0x65')]){return'';}for(var _0x4de67a='(',_0x26ff72=0x0;_0x26ff72<_0x4297ef['rules'][_0x5f7b('0x65')];_0x26ff72+=0x1){_0x26ff72>0x0&&(_0x4de67a+='\x20'+_0x4297ef['operator']+'\x20');_0x4de67a+=_0x4297ef[_0x5f7b('0x64')][_0x26ff72][_0x5f7b('0x66')]?_0x1a5f92(_0x4297ef[_0x5f7b('0x64')][_0x26ff72][_0x5f7b('0x66')]):_0x4297ef[_0x5f7b('0x64')][_0x26ff72]['field']+'\x20'+_0x4297ef[_0x5f7b('0x64')][_0x26ff72][_0x5f7b('0x67')]+(_0x2677ea(_0x4297ef[_0x5f7b('0x64')][_0x26ff72][_0x5f7b('0x67')])?'\x20'+_0x4297ef['rules'][_0x26ff72][_0x5f7b('0x68')]:'');}return _0x4de67a+')';};var _0x33ef01={'where':{'id':_0x22bb69[_0x5f7b('0x46')]['id']}},_0x21a999,_0x261cba,_0x2458f8,_0x2df771,_0x8b5de6;_0x33ef01=_['merge']({},_0x33ef01,_0x22bb69[_0x5f7b('0x3f')]);return db[_0x5f7b('0x2a')][_0x5f7b('0x47')](_0x33ef01)['then'](function(_0x4523d9){if(_0x4523d9){_0x21a999=_0x4523d9;return _0x4523d9[_0x5f7b('0x69')]();}return null;})[_0x5f7b('0x25')](function(_0x3894eb){if(_0x3894eb){if(!_0x3894eb['length']){throw new db[(_0x5f7b('0x6a'))][(_0x5f7b('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x261cba=_0x3894eb;return db[_0x5f7b('0x6c')][_0x5f7b('0x42')]({'raw':!![]});}return null;})['then'](function(_0x195448){if(_0x195448){_0x2458f8=_[_0x5f7b('0x6d')](_0x195448,'id');var _0x3c2f0e;var _0xde4d5d=squel[_0x5f7b('0x6e')]();_0xde4d5d['from'](_0x21a999[_0x5f7b('0x6f')]);for(var _0x30b75b=0x0;_0x30b75b<_0x261cba[_0x5f7b('0x65')];_0x30b75b+=0x1){_0x3c2f0e=_0x261cba[_0x30b75b][_0x5f7b('0x70')]?_0x2458f8[_0x261cba[_0x30b75b]['MetricId']][_0x5f7b('0x71')]:_0x261cba[_0x30b75b]['field'];_0x3c2f0e=_0x261cba[_0x30b75b][_0x5f7b('0x72')]?_['replace'](_0xe7c0fc[_0x261cba[_0x30b75b][_0x5f7b('0x72')]],'%s',_0x3c2f0e):_0x3c2f0e;_0x3c2f0e=_0x261cba[_0x30b75b][_0x5f7b('0x73')]?_[_0x5f7b('0x74')](_0x2ac63c[_0x261cba[_0x30b75b][_0x5f7b('0x73')]],'%s',_0x3c2f0e):_0x3c2f0e;if(_0x261cba[_0x30b75b][_0x5f7b('0x75')]){_0xde4d5d['group'](_0x3c2f0e);}_0x261cba[_0x30b75b][_0x5f7b('0x76')]&&_0xde4d5d[_0x5f7b('0x34')](_0x3c2f0e,_0x261cba[_0x30b75b][_0x5f7b('0x76')]===_0x5f7b('0x77')?![]:!![]);_0xde4d5d[_0x5f7b('0x3d')](_0x3c2f0e,_0x261cba[_0x30b75b][_0x5f7b('0x78')]||_0x3c2f0e);}if(_0x21a999[_0x5f7b('0x79')]){_0x21a999['joins']=JSON['parse'](_0x21a999[_0x5f7b('0x79')]);for(var _0x8f874b=0x0;_0x8f874b<_0x21a999[_0x5f7b('0x79')]['length'];_0x8f874b+=0x1){if(_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x3b')]&&_[_0x5f7b('0x63')](_0x70c944,_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x3b')])&&_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x7a')]&&_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x7b')]&&_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x7c')]){_0xde4d5d[_0x21a999[_0x5f7b('0x79')][_0x8f874b]['type']](_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x7b')],null,util[_0x5f7b('0x73')](_0x5f7b('0x7d'),_0x21a999[_0x5f7b('0x6f')],_0x21a999['joins'][_0x8f874b][_0x5f7b('0x7a')],_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x7b')],_0x21a999[_0x5f7b('0x79')][_0x8f874b][_0x5f7b('0x7c')]));}}}if(_0x21a999['conditions']){_0x21a999['conditions']=JSON['parse'](_0x21a999['conditions']);_0xde4d5d[_0x5f7b('0x39')](_0x1a5f92(_0x21a999['conditions'][_0x5f7b('0x66')]));}_0x8b5de6=_0xde4d5d[_0x5f7b('0x7e')]();_0xde4d5d[_0x5f7b('0x1c')](_0x23cc77);_0xde4d5d[_0x5f7b('0x1b')](0x0);logger['debug'](_0x5f7b('0x7f'),_0xde4d5d[_0x5f7b('0x80')]());return db[_0x5f7b('0x81')][_0x5f7b('0x2e')](_0xde4d5d[_0x5f7b('0x80')](),{'type':db[_0x5f7b('0x81')]['QueryTypes'][_0x5f7b('0x82')]});}})[_0x5f7b('0x25')](respondWithResult(_0x4d225c,null))[_0x5f7b('0x44')](handleError(_0x4d225c,null));};function runReport(_0x5a80cd,_0x2b1a68,_0x59508b){var _0x4613fc=_0x2b1a68[_0x5f7b('0x28')];var _0x3c0a33=0xa;var _0x36fc46=['join','left_join',_0x5f7b('0x55'),'cross_join'];var _0x1efe15={'SUM':_0x5f7b('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5f7b('0x57'),'MAX':_0x5f7b('0x58'),'MIN':_0x5f7b('0x59'),'AVG':_0x5f7b('0x5a'),'GROUP_CONCAT':_0x5f7b('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x251811={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x5f7b('0x60'),'ROUND':_0x5f7b('0x61'),'UNIX_TIMESTAMP':_0x5f7b('0x62')};var _0x2a37b2=function(_0x53ca4f){return!_['includes']([_0x5f7b('0x84'),'IS\x20NOT\x20NULL',_0x5f7b('0x85'),_0x5f7b('0x86')],_0x53ca4f);};var _0x1c91e8=function(_0x392a32){if(!_0x392a32||!_0x392a32[_0x5f7b('0x64')][_0x5f7b('0x65')]){return'';}for(var _0x44e44e='(',_0x4bf06d=0x0;_0x4bf06d<_0x392a32['rules'][_0x5f7b('0x65')];_0x4bf06d+=0x1){_0x4bf06d>0x0&&(_0x44e44e+='\x20'+_0x392a32[_0x5f7b('0x87')]+'\x20');_0x44e44e+=_0x392a32[_0x5f7b('0x64')][_0x4bf06d]['group']?_0x1c91e8(_0x392a32['rules'][_0x4bf06d][_0x5f7b('0x66')]):_0x392a32[_0x5f7b('0x64')][_0x4bf06d][_0x5f7b('0x3d')]+'\x20'+_0x392a32[_0x5f7b('0x64')][_0x4bf06d]['condition']+(_0x2a37b2(_0x392a32[_0x5f7b('0x64')][_0x4bf06d][_0x5f7b('0x67')])?'\x20'+_0x392a32['rules'][_0x4bf06d][_0x5f7b('0x68')]:'');}return _0x44e44e+')';};var _0x24010d={'where':{'id':_0x5a80cd['id']}},_0x30de1f,_0x257c19,_0x1246cc,_0x5b8e99,_0x2bba65;_0x24010d=_[_0x5f7b('0x3e')]({},_0x24010d,_0x59508b);return db['AnalyticDefaultReport'][_0x5f7b('0x47')](_0x24010d)['then'](function(_0x49438b){if(_0x49438b){_0x30de1f=_0x49438b;return _0x49438b[_0x5f7b('0x69')]();}return null;})[_0x5f7b('0x25')](function(_0x41156f){if(_0x41156f){if(!_0x41156f[_0x5f7b('0x65')]){throw new db[(_0x5f7b('0x6a'))][(_0x5f7b('0x6b'))](_0x5f7b('0x88'),0x193);}_0x257c19=_0x41156f;return db[_0x5f7b('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x5f7b('0x25')](function(_0x15f809){if(_0x15f809){_0x1246cc=_[_0x5f7b('0x6d')](_0x15f809,'id');var _0x13f22f;var _0xd0987d=squel[_0x5f7b('0x6e')]();_0xd0987d[_0x5f7b('0x89')](_0x30de1f['table']);for(var _0x171826=0x0;_0x171826<_0x257c19[_0x5f7b('0x65')];_0x171826+=0x1){_0x13f22f=_0x257c19[_0x171826][_0x5f7b('0x70')]?_0x1246cc[_0x257c19[_0x171826]['MetricId']][_0x5f7b('0x71')]:_0x257c19[_0x171826][_0x5f7b('0x3d')];_0x13f22f=_0x257c19[_0x171826][_0x5f7b('0x72')]?_[_0x5f7b('0x74')](_0x1efe15[_0x257c19[_0x171826][_0x5f7b('0x72')]],'%s',_0x13f22f):_0x13f22f;_0x13f22f=_0x257c19[_0x171826][_0x5f7b('0x73')]?_[_0x5f7b('0x74')](_0x251811[_0x257c19[_0x171826][_0x5f7b('0x73')]],'%s',_0x13f22f):_0x13f22f;if(_0x257c19[_0x171826][_0x5f7b('0x75')]){_0xd0987d[_0x5f7b('0x66')](_0x13f22f);}_0x257c19[_0x171826][_0x5f7b('0x76')]&&_0xd0987d[_0x5f7b('0x34')](_0x13f22f,_0x257c19[_0x171826]['orderBy']===_0x5f7b('0x77')?![]:!![]);_0xd0987d[_0x5f7b('0x3d')](_0x13f22f,_0x257c19[_0x171826][_0x5f7b('0x78')]||_0x13f22f);}if(_0x30de1f[_0x5f7b('0x79')]){_0x30de1f[_0x5f7b('0x79')]=JSON[_0x5f7b('0x8a')](_0x30de1f[_0x5f7b('0x79')]);for(var _0x4cae92=0x0;_0x4cae92<_0x30de1f['joins'][_0x5f7b('0x65')];_0x4cae92+=0x1){if(_0x30de1f[_0x5f7b('0x79')][_0x4cae92][_0x5f7b('0x3b')]&&_['includes'](_0x36fc46,_0x30de1f[_0x5f7b('0x79')][_0x4cae92]['type'])&&_0x30de1f[_0x5f7b('0x79')][_0x4cae92][_0x5f7b('0x7a')]&&_0x30de1f[_0x5f7b('0x79')][_0x4cae92][_0x5f7b('0x7b')]&&_0x30de1f['joins'][_0x4cae92][_0x5f7b('0x7c')]){_0xd0987d[_0x30de1f['joins'][_0x4cae92][_0x5f7b('0x3b')]](_0x30de1f[_0x5f7b('0x79')][_0x4cae92]['foreignTable'],null,util[_0x5f7b('0x73')](_0x5f7b('0x7d'),_0x30de1f['table'],_0x30de1f[_0x5f7b('0x79')][_0x4cae92]['parentKey'],_0x30de1f['joins'][_0x4cae92][_0x5f7b('0x7b')],_0x30de1f[_0x5f7b('0x79')][_0x4cae92][_0x5f7b('0x7c')]));}}}if(_0x30de1f['conditions']){_0x30de1f['conditions']=JSON[_0x5f7b('0x8a')](_0x30de1f[_0x5f7b('0x8b')]);_0xd0987d[_0x5f7b('0x39')](_0x1c91e8(_0x30de1f[_0x5f7b('0x8b')][_0x5f7b('0x66')]));}_0x2bba65=_0xd0987d[_0x5f7b('0x7e')]();_0xd0987d['limit'](_0x3c0a33);_0xd0987d['offset'](0x0);logger[_0x5f7b('0x8c')]('Limited\x20Query:',_0xd0987d[_0x5f7b('0x80')]());return db['sequelize'][_0x5f7b('0x2e')](_0xd0987d[_0x5f7b('0x80')](),{'type':db['sequelize'][_0x5f7b('0x8d')][_0x5f7b('0x82')]});}})[_0x5f7b('0x25')](function(_0x446f89){if(!_0x446f89[_0x5f7b('0x65')]){throw new db[(_0x5f7b('0x6a'))][(_0x5f7b('0x6b'))](_0x5f7b('0x8e'),0xcc);}if(_0x2b1a68[_0x5f7b('0x8f')]===_0x5f7b('0x90')){return null;}var _0x565200=_[_0x5f7b('0x3e')](_0x2b1a68,{'name':_0x2b1a68[_0x5f7b('0x91')]||_0x2b1a68[_0x5f7b('0x28')]||_0x30de1f[_0x5f7b('0x28')],'basename':_0x4613fc,'savename':util[_0x5f7b('0x73')]('%s-%s.%s',_0x2b1a68[_0x5f7b('0x28')]||_0x30de1f[_0x5f7b('0x28')],require(_0x5f7b('0x92'))[_0x5f7b('0x93')](0x4),_0x2b1a68[_0x5f7b('0x8f')]||_0x5f7b('0x94')),'reportId':_0x30de1f['id'],'reportType':_0x5f7b('0x95')});return db[_0x5f7b('0x96')][_0x5f7b('0x97')](_0x565200,{'raw':!![]});})['then'](function(_0x214776){if(_0x30de1f[_0x5f7b('0x6f')]===_0x5f7b('0x98')){_0x2bba65['where'](_0x30de1f['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2b1a68[_0x5f7b('0x99')],_0x2b1a68['endDate']);}else{_0x2bba65['where'](_0x30de1f[_0x5f7b('0x6f')]+_0x5f7b('0x9a'),_0x2b1a68[_0x5f7b('0x99')],_0x2b1a68[_0x5f7b('0x9b')]);}if(_0x214776){logger[_0x5f7b('0x9c')](_0x5f7b('0x9d'),_0x2bba65[_0x5f7b('0x80')]());require(_0x5f7b('0x9e'))[_0x5f7b('0x9f')](path[_0x5f7b('0x53')](__dirname,_0x5f7b('0xa0'),_0x214776[_0x5f7b('0x8f')]),[_0x214776['id'],_0x2bba65[_0x5f7b('0x80')](),path[_0x5f7b('0x53')](__dirname,'../../files/reports',_0x214776[_0x5f7b('0xa1')]),_0x4613fc]);return _0x214776;}else{var _0x1ac3fb=squel[_0x5f7b('0x6e')]();_0x1ac3fb[_0x5f7b('0x89')]('('+_0x2bba65[_0x5f7b('0x80')]()+')',_0x5f7b('0xa2'));_0x1ac3fb[_0x5f7b('0x3d')]('COUNT(*)',_0x5f7b('0x1a'));_0x2bba65['limit'](_0x2b1a68[_0x5f7b('0x1c')]||_0x3c0a33);_0x2bba65[_0x5f7b('0x1b')](_0x2b1a68[_0x5f7b('0x1b')]||0x0);return db[_0x5f7b('0x81')][_0x5f7b('0x2e')](_0x1ac3fb[_0x5f7b('0x80')](),{'type':db['sequelize'][_0x5f7b('0x8d')][_0x5f7b('0x82')]})['then'](function(_0x1ff79b){if(!_0x1ff79b[_0x5f7b('0x65')]){_0x5b8e99=0x0;}else{_0x5b8e99=_0x1ff79b[0x0][_0x5f7b('0x1a')]||0x0;}return db['sequelize'][_0x5f7b('0x2e')](_0x2bba65[_0x5f7b('0x80')](),{'type':db[_0x5f7b('0x81')][_0x5f7b('0x8d')][_0x5f7b('0x82')]});})['then'](function(_0x44435c){return{'rows':_0x44435c||[],'count':_0x5b8e99};});}});}exports[_0x5f7b('0xa3')]=function(_0x68f369,_0x1052cb){return runReport(_0x68f369[_0x5f7b('0x46')],_0x68f369[_0x5f7b('0x2e')],_0x68f369[_0x5f7b('0x3f')])[_0x5f7b('0x25')](respondWithResult(_0x1052cb,null))[_0x5f7b('0x44')](handleError(_0x1052cb,null));};exports[_0x5f7b('0xa4')]=runReport;exports[_0x5f7b('0x2e')]=function(_0x470e9a,_0x1b6607){var _0x253807=0xa;var _0x4622ad=['join','left_join','right_join',_0x5f7b('0x56')];var _0x28c05f={'SUM':_0x5f7b('0x83'),'COUNT':_0x5f7b('0xa5'),'COUNT DISTINCT':_0x5f7b('0x57'),'MAX':'MAX(%s)','MIN':_0x5f7b('0x59'),'AVG':_0x5f7b('0x5a'),'GROUP_CONCAT':_0x5f7b('0x5b'),'GROUP_CONCAT ASC':_0x5f7b('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48e711={'SEC_TO_TIME':_0x5f7b('0x5e'),'DATE':_0x5f7b('0x5f'),'HOUR':_0x5f7b('0x60'),'ROUND':_0x5f7b('0x61'),'UNIX_TIMESTAMP':_0x5f7b('0x62')};var _0x5fd353=function(_0x23e663){return!_['includes'](['IS\x20NULL',_0x5f7b('0xa6'),_0x5f7b('0x85'),_0x5f7b('0x86')],_0x23e663);};var _0x277bf9=function(_0x4cf281){if(!_0x4cf281||!_0x4cf281[_0x5f7b('0x64')][_0x5f7b('0x65')]){return'';}for(var _0x371345='(',_0x2c3896=0x0;_0x2c3896<_0x4cf281[_0x5f7b('0x64')]['length'];_0x2c3896+=0x1){_0x2c3896>0x0&&(_0x371345+='\x20'+_0x4cf281[_0x5f7b('0x87')]+'\x20');_0x371345+=_0x4cf281['rules'][_0x2c3896][_0x5f7b('0x66')]?_0x277bf9(_0x4cf281['rules'][_0x2c3896][_0x5f7b('0x66')]):_0x4cf281['rules'][_0x2c3896]['field']+'\x20'+_0x4cf281[_0x5f7b('0x64')][_0x2c3896]['condition']+(_0x5fd353(_0x4cf281[_0x5f7b('0x64')][_0x2c3896]['condition'])?'\x20'+_0x4cf281[_0x5f7b('0x64')][_0x2c3896][_0x5f7b('0x68')]:'');}return _0x371345+')';};var _0x5bf74a={'where':{'id':_0x470e9a[_0x5f7b('0x46')]['id']}},_0x4b3066,_0x2d748e,_0x3d39a0,_0x137781,_0x3f073f;_0x5bf74a=_[_0x5f7b('0x3e')]({},_0x5bf74a,_0x470e9a['options']);return db[_0x5f7b('0x2a')][_0x5f7b('0x47')](_0x5bf74a)[_0x5f7b('0x25')](function(_0x39238a){if(_0x39238a){_0x4b3066=_0x39238a;return _0x39238a[_0x5f7b('0x69')]();}return null;})[_0x5f7b('0x25')](function(_0x383b4b){if(_0x383b4b){if(!_0x383b4b['length']){throw new db[(_0x5f7b('0x6a'))][(_0x5f7b('0x6b'))](_0x5f7b('0x88'),0x193);}_0x2d748e=_0x383b4b;return db[_0x5f7b('0x6c')][_0x5f7b('0x42')]({'raw':!![]});}return null;})[_0x5f7b('0x25')](function(_0x97f3b0){if(_0x97f3b0){_0x3d39a0=_['keyBy'](_0x97f3b0,'id');var _0x26ce97;var _0x459151=squel[_0x5f7b('0x6e')]();_0x459151[_0x5f7b('0x89')](_0x4b3066[_0x5f7b('0x6f')]);for(var _0x36cf79=0x0;_0x36cf79<_0x2d748e[_0x5f7b('0x65')];_0x36cf79+=0x1){_0x26ce97=_0x2d748e[_0x36cf79][_0x5f7b('0x70')]?_0x3d39a0[_0x2d748e[_0x36cf79][_0x5f7b('0x70')]][_0x5f7b('0x71')]:_0x2d748e[_0x36cf79][_0x5f7b('0x3d')];_0x26ce97=_0x2d748e[_0x36cf79]['function']?_[_0x5f7b('0x74')](_0x28c05f[_0x2d748e[_0x36cf79][_0x5f7b('0x72')]],'%s',_0x26ce97):_0x26ce97;_0x26ce97=_0x2d748e[_0x36cf79][_0x5f7b('0x73')]?_['replace'](_0x48e711[_0x2d748e[_0x36cf79][_0x5f7b('0x73')]],'%s',_0x26ce97):_0x26ce97;if(_0x2d748e[_0x36cf79]['groupBy']){_0x459151[_0x5f7b('0x66')](_0x26ce97);}_0x2d748e[_0x36cf79][_0x5f7b('0x76')]&&_0x459151['order'](_0x26ce97,_0x2d748e[_0x36cf79]['orderBy']===_0x5f7b('0x77')?![]:!![]);_0x459151[_0x5f7b('0x3d')](_0x26ce97,_0x2d748e[_0x36cf79]['alias']||_0x26ce97);}if(_0x4b3066['joins']){_0x4b3066[_0x5f7b('0x79')]=JSON[_0x5f7b('0x8a')](_0x4b3066['joins']);for(var _0x372cb0=0x0;_0x372cb0<_0x4b3066['joins'][_0x5f7b('0x65')];_0x372cb0+=0x1){if(_0x4b3066['joins'][_0x372cb0][_0x5f7b('0x3b')]&&_[_0x5f7b('0x63')](_0x4622ad,_0x4b3066['joins'][_0x372cb0][_0x5f7b('0x3b')])&&_0x4b3066['joins'][_0x372cb0]['parentKey']&&_0x4b3066['joins'][_0x372cb0][_0x5f7b('0x7b')]&&_0x4b3066[_0x5f7b('0x79')][_0x372cb0][_0x5f7b('0x7c')]){_0x459151[_0x4b3066[_0x5f7b('0x79')][_0x372cb0][_0x5f7b('0x3b')]](_0x4b3066['joins'][_0x372cb0]['foreignTable'],null,util[_0x5f7b('0x73')]('%s.%s\x20=\x20%s.%s',_0x4b3066[_0x5f7b('0x6f')],_0x4b3066[_0x5f7b('0x79')][_0x372cb0][_0x5f7b('0x7a')],_0x4b3066[_0x5f7b('0x79')][_0x372cb0][_0x5f7b('0x7b')],_0x4b3066['joins'][_0x372cb0][_0x5f7b('0x7c')]));}}}if(_0x4b3066[_0x5f7b('0x8b')]){_0x4b3066[_0x5f7b('0x8b')]=JSON[_0x5f7b('0x8a')](_0x4b3066[_0x5f7b('0x8b')]);_0x459151['where'](_0x277bf9(_0x4b3066[_0x5f7b('0x8b')][_0x5f7b('0x66')]));}_0x3f073f=_0x459151['clone']();_0x459151[_0x5f7b('0x1c')](_0x253807);_0x459151[_0x5f7b('0x1b')](0x0);logger['debug'](_0x5f7b('0x7f'),_0x459151[_0x5f7b('0x80')]());return db['sequelize'][_0x5f7b('0x2e')](_0x459151['toString'](),{'type':db['sequelize'][_0x5f7b('0x8d')][_0x5f7b('0x82')]});}})[_0x5f7b('0x25')](function(){return{'sql':_0x3f073f[_0x5f7b('0x80')]()};})[_0x5f7b('0x25')](respondWithResult(_0x1b6607,null))[_0x5f7b('0x44')](handleError(_0x1b6607,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index d1eba21..77cc50b 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 _0xa273=['bluebird','request-promise','path','rimraf','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment'];(function(_0x3213b3,_0x34669e){var _0x209fa0=function(_0x5d1dd5){while(--_0x5d1dd5){_0x3213b3['push'](_0x3213b3['shift']());}};_0x209fa0(++_0x34669e);}(_0xa273,0x172));var _0x3a27=function(_0x3efc95,_0x25bff4){_0x3efc95=_0x3efc95-0x0;var _0x402bf7=_0xa273[_0x3efc95];return _0x402bf7;};'use strict';var _=require(_0x3a27('0x0'));var util=require(_0x3a27('0x1'));var logger=require('../../config/logger')(_0x3a27('0x2'));var moment=require(_0x3a27('0x3'));var BPromise=require(_0x3a27('0x4'));var rp=require(_0x3a27('0x5'));var fs=require('fs');var path=require(_0x3a27('0x6'));var rimraf=require(_0x3a27('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x3a27('0x8')]=function(_0x568a3c,_0x34a6db){return _0x568a3c['define'](_0x3a27('0x9'),attributes,{'tableName':_0x3a27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11fa=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x11fa,0x1c4));var _0xa11f=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x11fa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xa11f('0x0'));var util=require('util');var logger=require(_0xa11f('0x1'))(_0xa11f('0x2'));var moment=require(_0xa11f('0x3'));var BPromise=require(_0xa11f('0x4'));var rp=require(_0xa11f('0x5'));var fs=require('fs');var path=require(_0xa11f('0x6'));var rimraf=require(_0xa11f('0x7'));var config=require(_0xa11f('0x8'));var attributes=require(_0xa11f('0x9'));module[_0xa11f('0xa')]=function(_0x53b775,_0x3cefd0){return _0x53b775['define'](_0xa11f('0xb'),attributes,{'tableName':_0xa11f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 9e19271..e54f330 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 _0xbdb7=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x16c493,_0x504324){_0x16c493=_0x16c493-0x0;var _0x4d814b=_0xbdb7[_0x16c493];return _0x4d814b;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\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(_0x299f03,_0x234288){var _0x1522dc=function(_0x423d45){while(--_0x423d45){_0x299f03['push'](_0x299f03['shift']());}};_0x1522dc(++_0x234288);}(_0xe706,0xa3));var _0x6e70=function(_0xa20086,_0x3978a9){_0xa20086=_0xa20086-0x0;var _0x121c6e=_0xe706[_0xa20086];return _0x121c6e;};'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']('AnalyticDefaultReport,\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']('AnalyticDefaultReport,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3935b54..9a95736 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 _0x165f=['destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','query','post','create','put','update','delete'];(function(_0x9e7aa1,_0x394612){var _0x2f5175=function(_0x2ff465){while(--_0x2ff465){_0x9e7aa1['push'](_0x9e7aa1['shift']());}};_0x2f5175(++_0x394612);}(_0x165f,0x74));var _0xf165=function(_0x31eec7,_0x130aa6){_0x31eec7=_0x31eec7-0x0;var _0x51a61f=_0x165f[_0x31eec7];return _0x51a61f;};'use strict';var multer=require(_0xf165('0x0'));var util=require(_0xf165('0x1'));var path=require('path');var timeout=require(_0xf165('0x2'));var express=require('express');var router=express[_0xf165('0x3')]();var auth=require(_0xf165('0x4'));var interaction=require(_0xf165('0x5'));var config=require(_0xf165('0x6'));var controller=require(_0xf165('0x7'));router[_0xf165('0x8')]('/',auth[_0xf165('0x9')](),controller[_0xf165('0xa')]);router[_0xf165('0x8')](_0xf165('0xb'),auth[_0xf165('0x9')](),controller[_0xf165('0xc')]);router['get']('/:id/preview',auth[_0xf165('0x9')](),controller[_0xf165('0xd')]);router[_0xf165('0x8')](_0xf165('0xe'),auth[_0xf165('0x9')](),controller[_0xf165('0xf')]);router[_0xf165('0x8')]('/:id/query',auth[_0xf165('0x9')](),controller[_0xf165('0x10')]);router[_0xf165('0x11')]('/',auth[_0xf165('0x9')](),controller[_0xf165('0x12')]);router[_0xf165('0x13')](_0xf165('0xb'),auth[_0xf165('0x9')](),controller[_0xf165('0x14')]);router[_0xf165('0x15')](_0xf165('0xb'),auth['isAuthenticated'](),controller[_0xf165('0x16')]);module['exports']=router; \ No newline at end of file +var _0x2f88=['/:id','show','/:id/preview','preview','run','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get'];(function(_0x2a3b70,_0x137f86){var _0x376380=function(_0x46ac67){while(--_0x46ac67){_0x2a3b70['push'](_0x2a3b70['shift']());}};_0x376380(++_0x137f86);}(_0x2f88,0x1c3));var _0x82f8=function(_0x4b99df,_0xcd7a8f){_0x4b99df=_0x4b99df-0x0;var _0x43d0d6=_0x2f88[_0x4b99df];return _0x43d0d6;};'use strict';var multer=require('multer');var util=require(_0x82f8('0x0'));var path=require(_0x82f8('0x1'));var timeout=require(_0x82f8('0x2'));var express=require(_0x82f8('0x3'));var router=express[_0x82f8('0x4')]();var auth=require(_0x82f8('0x5'));var interaction=require(_0x82f8('0x6'));var config=require('../../config/environment');var controller=require(_0x82f8('0x7'));router['get']('/',auth[_0x82f8('0x8')](),controller[_0x82f8('0x9')]);router[_0x82f8('0xa')](_0x82f8('0xb'),auth['isAuthenticated'](),controller[_0x82f8('0xc')]);router['get'](_0x82f8('0xd'),auth[_0x82f8('0x8')](),controller[_0x82f8('0xe')]);router[_0x82f8('0xa')]('/:id/run',auth[_0x82f8('0x8')](),controller[_0x82f8('0xf')]);router[_0x82f8('0xa')]('/:id/query',auth[_0x82f8('0x8')](),controller['query']);router['post']('/',auth[_0x82f8('0x8')](),controller[_0x82f8('0x10')]);router[_0x82f8('0x11')](_0x82f8('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x82f8('0x12')](_0x82f8('0xb'),auth[_0x82f8('0x8')](),controller[_0x82f8('0x13')]);module[_0x82f8('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 151e3ba..ca251f5 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 _0x0ed9=['manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','Loading'];(function(_0x12009f,_0x70d95){var _0xc6ea8=function(_0x570303){while(--_0x570303){_0x12009f['push'](_0x12009f['shift']());}};_0xc6ea8(++_0x70d95);}(_0x0ed9,0x16b));var _0x90ed=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x0ed9[_0x59e862];return _0x1a25ee;};'use strict';var Sequelize=require(_0x90ed('0x0'));var moment=require(_0x90ed('0x1'));module[_0x90ed('0x2')]={'name':{'type':Sequelize[_0x90ed('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x90ed('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x90ed('0x4')](_0x90ed('0x5'),'pdf',_0x90ed('0x6')),'allowNull':![],'defaultValue':_0x90ed('0x5')},'savename':{'type':Sequelize[_0x90ed('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x90ed('0x7')]},'endDate':{'type':Sequelize[_0x90ed('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x90ed('0x8')},'type':{'type':Sequelize[_0x90ed('0x4')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x90ed('0x9')},'reportId':{'type':Sequelize[_0x90ed('0xa')](0xb)[_0x90ed('0xb')]},'reportType':{'type':Sequelize[_0x90ed('0x3')]}}; \ No newline at end of file +var _0x2ff2=['DATE','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x301f89,_0x37a162){var _0x1032df=function(_0xc17fab){while(--_0xc17fab){_0x301f89['push'](_0x301f89['shift']());}};_0x1032df(++_0x37a162);}(_0x2ff2,0x72));var _0x22ff=function(_0x3c3fc9,_0x19452a){_0x3c3fc9=_0x3c3fc9-0x0;var _0x34debd=_0x2ff2[_0x3c3fc9];return _0x34debd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x22ff('0x0'));module[_0x22ff('0x1')]={'name':{'type':Sequelize[_0x22ff('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x22ff('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x22ff('0x3')](_0x22ff('0x4'),_0x22ff('0x5'),_0x22ff('0x6')),'allowNull':![],'defaultValue':_0x22ff('0x4')},'savename':{'type':Sequelize[_0x22ff('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x22ff('0x7')]},'endDate':{'type':Sequelize[_0x22ff('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0x22ff('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x22ff('0x9')](0xb)[_0x22ff('0xa')]},'reportType':{'type':Sequelize[_0x22ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index d0a100a..3cde9a8 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 _0x81fa=['map','type','VIRTUAL','field','filter','options','AnalyticExtractedReport','count','includeAll','include','findAll','rows','catch','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','exists','format','%s.%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','status','end','json','offset','limit','Content-Range','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge'];(function(_0x1ff1f2,_0x14a124){var _0x30e639=function(_0x2cc44e){while(--_0x2cc44e){_0x1ff1f2['push'](_0x1ff1f2['shift']());}};_0x30e639(++_0x14a124);}(_0x81fa,0xdd));var _0xa81f=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x81fa[_0x334651];return _0x29657c;};'use strict';var pdf=require(_0xa81f('0x0'));var emlformat=require(_0xa81f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa81f('0x2'));var jsonpatch=require(_0xa81f('0x3'));var rp=require(_0xa81f('0x4'));var moment=require(_0xa81f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa81f('0x6'));var util=require(_0xa81f('0x7'));var path=require(_0xa81f('0x8'));var sox=require(_0xa81f('0x9'));var csv=require(_0xa81f('0xa'));var ejs=require(_0xa81f('0xb'));var fs=require('fs');var _=require(_0xa81f('0xc'));var squel=require(_0xa81f('0xd'));var crypto=require(_0xa81f('0xe'));var jsforce=require(_0xa81f('0xf'));var deskjs=require(_0xa81f('0x10'));var toCsv=require(_0xa81f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa81f('0x11'));var authService=require(_0xa81f('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa81f('0x13'));var logger=require('../../config/logger')(_0xa81f('0x14'));var utils=require('../../config/utils');var config=require(_0xa81f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e178b,_0x4e7eb8){_0x4e7eb8=_0x4e7eb8||0xcc;return function(_0x1aeead){if(_0x1aeead){return _0x3e178b['sendStatus'](_0x4e7eb8);}return _0x3e178b[_0xa81f('0x16')](_0x4e7eb8)[_0xa81f('0x17')]();};}function respondWithResult(_0x315558,_0x32c3aa){_0x32c3aa=_0x32c3aa||0xc8;return function(_0x5777c3){if(_0x5777c3){return _0x315558[_0xa81f('0x16')](_0x32c3aa)[_0xa81f('0x18')](_0x5777c3);}};}function respondWithFilteredResult(_0x3ed3d9,_0x328105){return function(_0x1a558f){if(_0x1a558f){var _0x273b83=_0x1a558f['count'],_0x4122c7=_0x328105[_0xa81f('0x19')],_0x4e41ba=_0x328105[_0xa81f('0x19')]+_0x328105[_0xa81f('0x1a')],_0x33dd9e;if(_0x4e41ba>=_0x273b83){_0x4e41ba=_0x273b83;_0x33dd9e=0xc8;}else{_0x33dd9e=0xce;}_0x3ed3d9[_0xa81f('0x16')](_0x33dd9e);return _0x3ed3d9['set'](_0xa81f('0x1b'),_0x4122c7+'-'+_0x4e41ba+'/'+_0x273b83)[_0xa81f('0x18')](_0x1a558f);}return null;};}function patchUpdates(_0x572fb5){return function(_0x588d80){try{jsonpatch['apply'](_0x588d80,_0x572fb5,!![]);}catch(_0x2983c4){return BPromise['reject'](_0x2983c4);}return _0x588d80[_0xa81f('0x1c')]();};}function saveUpdates(_0x45380f,_0x61797e){return function(_0x1ac5b1){if(_0x1ac5b1){return _0x1ac5b1[_0xa81f('0x1d')](_0x45380f)[_0xa81f('0x1e')](function(_0x4237f2){return _0x4237f2;});}return null;};}function removeEntity(_0x5e21ad,_0x4fa4dd){return function(_0x4fa8ad){if(_0x4fa8ad){return _0x4fa8ad[_0xa81f('0x1f')]()[_0xa81f('0x1e')](function(){var _0x47db1e=_0x4fa8ad[_0xa81f('0x20')]({'plain':!![]});var _0x3a50c3='ExtractedReports';return db['UserProfileResource'][_0xa81f('0x1f')]({'where':{'type':_0x3a50c3,'resourceId':_0x47db1e['id']}})[_0xa81f('0x1e')](function(){return _0x4fa8ad;});})[_0xa81f('0x1e')](function(){_0x5e21ad[_0xa81f('0x16')](0xcc)[_0xa81f('0x17')]();});}};}function handleEntityNotFound(_0x512a8a,_0x12e401){return function(_0x292f28){if(!_0x292f28){_0x512a8a[_0xa81f('0x21')](0x194);}return _0x292f28;};}function handleError(_0x121b46,_0x3a0cb7){_0x3a0cb7=_0x3a0cb7||0x1f4;return function(_0x69309d){logger[_0xa81f('0x22')](_0x69309d[_0xa81f('0x23')]);if(_0x69309d[_0xa81f('0x24')]){delete _0x69309d['name'];}_0x121b46['status'](_0x3a0cb7)[_0xa81f('0x25')](_0x69309d);};}exports[_0xa81f('0x26')]=function(_0x49bb33,_0x4fd979){var _0x206c5c={},_0x1dc15f={},_0x26dc51={'count':0x0,'rows':[]};var _0x5778ed=db['AnalyticExtractedReport']['rawAttributes'];_0x1dc15f[_0xa81f('0x27')]=_['keys'](_0x5778ed);_0x1dc15f[_0xa81f('0x28')]=_[_0xa81f('0x29')](_0x49bb33[_0xa81f('0x28')]);_0x1dc15f[_0xa81f('0x2a')]=_[_0xa81f('0x2b')](_0x1dc15f[_0xa81f('0x27')],_0x1dc15f['query']);_0x206c5c['attributes']=_[_0xa81f('0x2b')](_0x1dc15f[_0xa81f('0x27')],qs['fields'](_0x49bb33[_0xa81f('0x28')]['fields']));_0x206c5c[_0xa81f('0x2c')]=_0x206c5c[_0xa81f('0x2c')][_0xa81f('0x2d')]?_0x206c5c[_0xa81f('0x2c')]:_0x1dc15f[_0xa81f('0x27')];if(!_0x49bb33[_0xa81f('0x28')][_0xa81f('0x2e')](_0xa81f('0x2f'))){_0x206c5c[_0xa81f('0x1a')]=qs[_0xa81f('0x1a')](_0x49bb33['query'][_0xa81f('0x1a')]);_0x206c5c[_0xa81f('0x19')]=qs[_0xa81f('0x19')](_0x49bb33[_0xa81f('0x28')][_0xa81f('0x19')]);}_0x206c5c['order']=qs[_0xa81f('0x30')](_0x49bb33[_0xa81f('0x28')][_0xa81f('0x30')]);_0x206c5c[_0xa81f('0x31')]=qs['filters'](_[_0xa81f('0x32')](_0x49bb33[_0xa81f('0x28')],_0x1dc15f[_0xa81f('0x2a')]));if(_0x49bb33[_0xa81f('0x28')]['filter']){_0x206c5c[_0xa81f('0x31')]=_[_0xa81f('0x33')](_0x206c5c[_0xa81f('0x31')],{'$or':_[_0xa81f('0x34')](_0x5778ed,function(_0x5332ca){if(_0x5332ca[_0xa81f('0x35')]['key']!==_0xa81f('0x36')){var _0x548a1d={};_0x548a1d[_0x5332ca[_0xa81f('0x37')]]={'$like':'%'+_0x49bb33[_0xa81f('0x28')][_0xa81f('0x38')]+'%'};return _0x548a1d;}})});}_0x206c5c=_['merge']({},_0x206c5c,_0x49bb33[_0xa81f('0x39')]);var _0x59b0a0={'where':_0x206c5c[_0xa81f('0x31')]};return db[_0xa81f('0x3a')]['count'](_0x59b0a0)[_0xa81f('0x1e')](function(_0x299b41){_0x26dc51[_0xa81f('0x3b')]=_0x299b41;if(_0x49bb33[_0xa81f('0x28')][_0xa81f('0x3c')]){_0x206c5c[_0xa81f('0x3d')]=[{'all':!![]}];}return db[_0xa81f('0x3a')][_0xa81f('0x3e')](_0x206c5c);})[_0xa81f('0x1e')](function(_0x31b59d){_0x26dc51[_0xa81f('0x3f')]=_0x31b59d;return _0x26dc51;})[_0xa81f('0x1e')](respondWithFilteredResult(_0x4fd979,_0x206c5c))[_0xa81f('0x40')](handleError(_0x4fd979,null));};exports['show']=function(_0x35c232,_0x3ee06d){var _0x253c21={'raw':!![],'where':{'id':_0x35c232['params']['id']}},_0x2450d9={};_0x2450d9[_0xa81f('0x27')]=_[_0xa81f('0x29')](db[_0xa81f('0x3a')][_0xa81f('0x41')]);_0x2450d9[_0xa81f('0x28')]=_['keys'](_0x35c232[_0xa81f('0x28')]);_0x2450d9['filters']=_[_0xa81f('0x2b')](_0x2450d9['model'],_0x2450d9['query']);_0x253c21[_0xa81f('0x2c')]=_['intersection'](_0x2450d9[_0xa81f('0x27')],qs[_0xa81f('0x42')](_0x35c232[_0xa81f('0x28')][_0xa81f('0x42')]));_0x253c21[_0xa81f('0x2c')]=_0x253c21[_0xa81f('0x2c')][_0xa81f('0x2d')]?_0x253c21[_0xa81f('0x2c')]:_0x2450d9[_0xa81f('0x27')];if(_0x35c232['query'][_0xa81f('0x3c')]){_0x253c21[_0xa81f('0x3d')]=[{'all':!![]}];}_0x253c21=_[_0xa81f('0x33')]({},_0x253c21,_0x35c232['options']);return db[_0xa81f('0x3a')][_0xa81f('0x43')](_0x253c21)[_0xa81f('0x1e')](handleEntityNotFound(_0x3ee06d,null))[_0xa81f('0x1e')](respondWithResult(_0x3ee06d,null))[_0xa81f('0x40')](handleError(_0x3ee06d,null));};exports[_0xa81f('0x44')]=function(_0x9ab65c,_0xe46b2a){return db[_0xa81f('0x3a')][_0xa81f('0x44')](_0x9ab65c[_0xa81f('0x45')],{})[_0xa81f('0x1e')](function(_0x419a7b){var _0x37ad38=_0x9ab65c[_0xa81f('0x46')][_0xa81f('0x20')]({'plain':!![]});if(!_0x37ad38)throw new Error(_0xa81f('0x47'));if(_0x37ad38[_0xa81f('0x48')]===_0xa81f('0x46')){var _0x3f9182=_0x419a7b['get']({'plain':!![]});var _0xa30eb5=_0xa81f('0x49');return db['UserProfileSection']['find']({'where':{'name':_0xa30eb5,'userProfileId':_0x37ad38[_0xa81f('0x4a')]},'raw':!![]})[_0xa81f('0x1e')](function(_0x19443c){if(_0x19443c&&_0x19443c[_0xa81f('0x4b')]===0x0){return db[_0xa81f('0x4c')][_0xa81f('0x44')]({'name':_0x3f9182[_0xa81f('0x24')],'resourceId':_0x3f9182['id'],'type':_0x19443c[_0xa81f('0x24')],'sectionId':_0x19443c['id']},{})['then'](function(){return _0x419a7b;});}else{return _0x419a7b;}})[_0xa81f('0x40')](function(_0x2d852e){logger['error'](_0xa81f('0x4d'),_0x2d852e);throw _0x2d852e;});}return _0x419a7b;})['then'](respondWithResult(_0xe46b2a,0xc9))[_0xa81f('0x40')](handleError(_0xe46b2a,null));};exports[_0xa81f('0x1d')]=function(_0x42376e,_0x5d81b2){if(_0x42376e[_0xa81f('0x45')]['id']){delete _0x42376e[_0xa81f('0x45')]['id'];}return db['AnalyticExtractedReport'][_0xa81f('0x43')]({'where':{'id':_0x42376e[_0xa81f('0x4e')]['id']}})[_0xa81f('0x1e')](handleEntityNotFound(_0x5d81b2,null))[_0xa81f('0x1e')](saveUpdates(_0x42376e['body'],null))[_0xa81f('0x1e')](respondWithResult(_0x5d81b2,null))[_0xa81f('0x40')](handleError(_0x5d81b2,null));};exports[_0xa81f('0x1f')]=function(_0x169002,_0x14057e){return db[_0xa81f('0x3a')][_0xa81f('0x43')]({'where':{'id':_0x169002[_0xa81f('0x4e')]['id']}})[_0xa81f('0x1e')](handleEntityNotFound(_0x14057e,null))[_0xa81f('0x1e')](removeEntity(_0x14057e,null))['catch'](handleError(_0x14057e,null));};exports[_0xa81f('0x4f')]=function(_0x234a35,_0x1d50be,_0xf86ad8){return db['AnalyticExtractedReport'][_0xa81f('0x43')]({'where':{'id':_0x234a35[_0xa81f('0x4e')]['id']},'attributes':['name',_0xa81f('0x50'),_0xa81f('0x51'),_0xa81f('0x52')],'raw':!![]})[_0xa81f('0x1e')](handleEntityNotFound(_0x1d50be,null))[_0xa81f('0x1e')](function(_0x1c6a67){if(_0x1c6a67){if(!fs[_0xa81f('0x53')](path[_0xa81f('0x54')](config[_0xa81f('0x55')],_0xa81f('0x56'),_0x1c6a67[_0xa81f('0x51')]))){throw new db[(_0xa81f('0x57'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x234a35[_0xa81f('0x28')][_0xa81f('0x58')]){return _0x1d50be[_0xa81f('0x21')](0xc8);}return _0x1d50be[_0xa81f('0x4f')](path[_0xa81f('0x54')](config[_0xa81f('0x55')],_0xa81f('0x56'),_0x1c6a67[_0xa81f('0x51')]),util[_0xa81f('0x59')](_0xa81f('0x5a'),_0x1c6a67['basename']||_0x1c6a67['name'],_0x1c6a67[_0xa81f('0x52')]['toLowerCase']()));}})[_0xa81f('0x40')](handleError(_0x1d50be,null));}; \ No newline at end of file +var _0xbca8=['sort','filters','filter','where','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','role','userProfileId','UserProfileResource','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','offset','limit','update','then','destroy','get','ExtractedReports','error','stack','name','index','AnalyticExtractedReport','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbca8,0xcc));var _0x8bca=function(_0x643c53,_0x259b1d){_0x643c53=_0x643c53-0x0;var _0x500861=_0xbca8[_0x643c53];return _0x500861;};'use strict';var pdf=require(_0x8bca('0x0'));var emlformat=require(_0x8bca('0x1'));var rimraf=require(_0x8bca('0x2'));var zipdir=require(_0x8bca('0x3'));var jsonpatch=require(_0x8bca('0x4'));var rp=require('request-promise');var moment=require(_0x8bca('0x5'));var BPromise=require(_0x8bca('0x6'));var Mustache=require(_0x8bca('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8bca('0x8'));var csv=require(_0x8bca('0x9'));var ejs=require(_0x8bca('0xa'));var fs=require('fs');var _=require(_0x8bca('0xb'));var squel=require('squel');var crypto=require(_0x8bca('0xc'));var jsforce=require(_0x8bca('0xd'));var deskjs=require(_0x8bca('0xe'));var toCsv=require(_0x8bca('0x9'));var querystring=require(_0x8bca('0xf'));var Papa=require(_0x8bca('0x10'));var Redis=require(_0x8bca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8bca('0x12'));var logger=require(_0x8bca('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8bca('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10da2e,_0x376d41){_0x376d41=_0x376d41||0xcc;return function(_0x5eec01){if(_0x5eec01){return _0x10da2e[_0x8bca('0x15')](_0x376d41);}return _0x10da2e[_0x8bca('0x16')](_0x376d41)[_0x8bca('0x17')]();};}function respondWithResult(_0x1e92bb,_0x5d32dc){_0x5d32dc=_0x5d32dc||0xc8;return function(_0x4bbf5c){if(_0x4bbf5c){return _0x1e92bb[_0x8bca('0x16')](_0x5d32dc)['json'](_0x4bbf5c);}};}function respondWithFilteredResult(_0x25691b,_0x69d64){return function(_0x145cfd){if(_0x145cfd){var _0x2e3633=_0x145cfd['count'],_0x1c3590=_0x69d64[_0x8bca('0x18')],_0x1c78d5=_0x69d64['offset']+_0x69d64[_0x8bca('0x19')],_0x487305;if(_0x1c78d5>=_0x2e3633){_0x1c78d5=_0x2e3633;_0x487305=0xc8;}else{_0x487305=0xce;}_0x25691b[_0x8bca('0x16')](_0x487305);return _0x25691b['set']('Content-Range',_0x1c3590+'-'+_0x1c78d5+'/'+_0x2e3633)['json'](_0x145cfd);}return null;};}function patchUpdates(_0x1963c0){return function(_0xcc6ee5){try{jsonpatch['apply'](_0xcc6ee5,_0x1963c0,!![]);}catch(_0x1a834c){return BPromise['reject'](_0x1a834c);}return _0xcc6ee5['save']();};}function saveUpdates(_0x5e95e4,_0x423db3){return function(_0x17046f){if(_0x17046f){return _0x17046f[_0x8bca('0x1a')](_0x5e95e4)[_0x8bca('0x1b')](function(_0x2d64cd){return _0x2d64cd;});}return null;};}function removeEntity(_0x3b73e5,_0x5716d9){return function(_0x315a59){if(_0x315a59){return _0x315a59[_0x8bca('0x1c')]()[_0x8bca('0x1b')](function(){var _0x50d5a3=_0x315a59[_0x8bca('0x1d')]({'plain':!![]});var _0x5ac207=_0x8bca('0x1e');return db['UserProfileResource'][_0x8bca('0x1c')]({'where':{'type':_0x5ac207,'resourceId':_0x50d5a3['id']}})[_0x8bca('0x1b')](function(){return _0x315a59;});})[_0x8bca('0x1b')](function(){_0x3b73e5[_0x8bca('0x16')](0xcc)[_0x8bca('0x17')]();});}};}function handleEntityNotFound(_0x3a7498,_0x2dc5c8){return function(_0x5f056b){if(!_0x5f056b){_0x3a7498['sendStatus'](0x194);}return _0x5f056b;};}function handleError(_0x1e911a,_0x1feba3){_0x1feba3=_0x1feba3||0x1f4;return function(_0x4c10db){logger[_0x8bca('0x1f')](_0x4c10db[_0x8bca('0x20')]);if(_0x4c10db[_0x8bca('0x21')]){delete _0x4c10db[_0x8bca('0x21')];}_0x1e911a[_0x8bca('0x16')](_0x1feba3)['send'](_0x4c10db);};}exports[_0x8bca('0x22')]=function(_0x58bfda,_0x18c7f2){var _0x4e8525={},_0x18ff94={},_0x134f1d={'count':0x0,'rows':[]};var _0x1405a2=db[_0x8bca('0x23')]['rawAttributes'];_0x18ff94[_0x8bca('0x24')]=_[_0x8bca('0x25')](_0x1405a2);_0x18ff94[_0x8bca('0x26')]=_['keys'](_0x58bfda['query']);_0x18ff94['filters']=_[_0x8bca('0x27')](_0x18ff94[_0x8bca('0x24')],_0x18ff94[_0x8bca('0x26')]);_0x4e8525['attributes']=_[_0x8bca('0x27')](_0x18ff94[_0x8bca('0x24')],qs['fields'](_0x58bfda[_0x8bca('0x26')][_0x8bca('0x28')]));_0x4e8525[_0x8bca('0x29')]=_0x4e8525[_0x8bca('0x29')][_0x8bca('0x2a')]?_0x4e8525['attributes']:_0x18ff94[_0x8bca('0x24')];if(!_0x58bfda[_0x8bca('0x26')][_0x8bca('0x2b')](_0x8bca('0x2c'))){_0x4e8525[_0x8bca('0x19')]=qs['limit'](_0x58bfda[_0x8bca('0x26')]['limit']);_0x4e8525['offset']=qs[_0x8bca('0x18')](_0x58bfda[_0x8bca('0x26')]['offset']);}_0x4e8525['order']=qs[_0x8bca('0x2d')](_0x58bfda[_0x8bca('0x26')][_0x8bca('0x2d')]);_0x4e8525['where']=qs[_0x8bca('0x2e')](_['pick'](_0x58bfda[_0x8bca('0x26')],_0x18ff94[_0x8bca('0x2e')]));if(_0x58bfda['query'][_0x8bca('0x2f')]){_0x4e8525[_0x8bca('0x30')]=_[_0x8bca('0x31')](_0x4e8525['where'],{'$or':_[_0x8bca('0x32')](_0x1405a2,function(_0x2bbc9a){if(_0x2bbc9a['type']['key']!==_0x8bca('0x33')){var _0x1eb3ac={};_0x1eb3ac[_0x2bbc9a['field']]={'$like':'%'+_0x58bfda['query'][_0x8bca('0x2f')]+'%'};return _0x1eb3ac;}})});}_0x4e8525=_[_0x8bca('0x31')]({},_0x4e8525,_0x58bfda[_0x8bca('0x34')]);var _0x35a97c={'where':_0x4e8525[_0x8bca('0x30')]};return db[_0x8bca('0x23')]['count'](_0x35a97c)[_0x8bca('0x1b')](function(_0x1eabe2){_0x134f1d[_0x8bca('0x35')]=_0x1eabe2;if(_0x58bfda[_0x8bca('0x26')][_0x8bca('0x36')]){_0x4e8525[_0x8bca('0x37')]=[{'all':!![]}];}return db[_0x8bca('0x23')][_0x8bca('0x38')](_0x4e8525);})['then'](function(_0x4c01f7){_0x134f1d[_0x8bca('0x39')]=_0x4c01f7;return _0x134f1d;})[_0x8bca('0x1b')](respondWithFilteredResult(_0x18c7f2,_0x4e8525))['catch'](handleError(_0x18c7f2,null));};exports[_0x8bca('0x3a')]=function(_0x2bc3ff,_0x1e1c64){var _0x342561={'raw':!![],'where':{'id':_0x2bc3ff[_0x8bca('0x3b')]['id']}},_0x476521={};_0x476521[_0x8bca('0x24')]=_[_0x8bca('0x25')](db[_0x8bca('0x23')]['rawAttributes']);_0x476521[_0x8bca('0x26')]=_['keys'](_0x2bc3ff[_0x8bca('0x26')]);_0x476521[_0x8bca('0x2e')]=_[_0x8bca('0x27')](_0x476521[_0x8bca('0x24')],_0x476521[_0x8bca('0x26')]);_0x342561[_0x8bca('0x29')]=_['intersection'](_0x476521[_0x8bca('0x24')],qs[_0x8bca('0x28')](_0x2bc3ff['query'][_0x8bca('0x28')]));_0x342561['attributes']=_0x342561['attributes']['length']?_0x342561['attributes']:_0x476521[_0x8bca('0x24')];if(_0x2bc3ff[_0x8bca('0x26')][_0x8bca('0x36')]){_0x342561[_0x8bca('0x37')]=[{'all':!![]}];}_0x342561=_['merge']({},_0x342561,_0x2bc3ff[_0x8bca('0x34')]);return db[_0x8bca('0x23')][_0x8bca('0x3c')](_0x342561)[_0x8bca('0x1b')](handleEntityNotFound(_0x1e1c64,null))['then'](respondWithResult(_0x1e1c64,null))[_0x8bca('0x3d')](handleError(_0x1e1c64,null));};exports[_0x8bca('0x3e')]=function(_0x39835e,_0xaf6fd4){return db[_0x8bca('0x23')][_0x8bca('0x3e')](_0x39835e[_0x8bca('0x3f')],{})[_0x8bca('0x1b')](function(_0x4b8ce1){var _0x2be34e=_0x39835e[_0x8bca('0x40')]['get']({'plain':!![]});if(!_0x2be34e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2be34e[_0x8bca('0x41')]===_0x8bca('0x40')){var _0x41379f=_0x4b8ce1['get']({'plain':!![]});var _0x2e8a80=_0x8bca('0x1e');return db['UserProfileSection'][_0x8bca('0x3c')]({'where':{'name':_0x2e8a80,'userProfileId':_0x2be34e[_0x8bca('0x42')]},'raw':!![]})[_0x8bca('0x1b')](function(_0xb53841){if(_0xb53841&&_0xb53841['autoAssociation']===0x0){return db[_0x8bca('0x43')][_0x8bca('0x3e')]({'name':_0x41379f['name'],'resourceId':_0x41379f['id'],'type':_0xb53841[_0x8bca('0x21')],'sectionId':_0xb53841['id']},{})[_0x8bca('0x1b')](function(){return _0x4b8ce1;});}else{return _0x4b8ce1;}})[_0x8bca('0x3d')](function(_0x544aa1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x544aa1);throw _0x544aa1;});}return _0x4b8ce1;})[_0x8bca('0x1b')](respondWithResult(_0xaf6fd4,0xc9))['catch'](handleError(_0xaf6fd4,null));};exports[_0x8bca('0x1a')]=function(_0x3927db,_0x598708){if(_0x3927db[_0x8bca('0x3f')]['id']){delete _0x3927db[_0x8bca('0x3f')]['id'];}return db['AnalyticExtractedReport'][_0x8bca('0x3c')]({'where':{'id':_0x3927db[_0x8bca('0x3b')]['id']}})['then'](handleEntityNotFound(_0x598708,null))['then'](saveUpdates(_0x3927db['body'],null))[_0x8bca('0x1b')](respondWithResult(_0x598708,null))[_0x8bca('0x3d')](handleError(_0x598708,null));};exports[_0x8bca('0x1c')]=function(_0x134d07,_0x5c14dd){return db[_0x8bca('0x23')][_0x8bca('0x3c')]({'where':{'id':_0x134d07[_0x8bca('0x3b')]['id']}})[_0x8bca('0x1b')](handleEntityNotFound(_0x5c14dd,null))[_0x8bca('0x1b')](removeEntity(_0x5c14dd,null))[_0x8bca('0x3d')](handleError(_0x5c14dd,null));};exports[_0x8bca('0x44')]=function(_0xfed222,_0x47427f,_0x29d1fa){return db[_0x8bca('0x23')][_0x8bca('0x3c')]({'where':{'id':_0xfed222[_0x8bca('0x3b')]['id']},'attributes':[_0x8bca('0x21'),_0x8bca('0x45'),'savename',_0x8bca('0x46')],'raw':!![]})[_0x8bca('0x1b')](handleEntityNotFound(_0x47427f,null))['then'](function(_0x182570){if(_0x182570){if(!fs[_0x8bca('0x47')](path[_0x8bca('0x48')](config[_0x8bca('0x49')],_0x8bca('0x4a'),_0x182570[_0x8bca('0x4b')]))){throw new db[(_0x8bca('0x4c'))][(_0x8bca('0x4d'))](_0x8bca('0x4e'));}if(_0xfed222[_0x8bca('0x26')][_0x8bca('0x4f')]){return _0x47427f['sendStatus'](0xc8);}return _0x47427f[_0x8bca('0x44')](path[_0x8bca('0x48')](config[_0x8bca('0x49')],_0x8bca('0x4a'),_0x182570['savename']),util[_0x8bca('0x50')](_0x8bca('0x51'),_0x182570[_0x8bca('0x45')]||_0x182570[_0x8bca('0x21')],_0x182570['output'][_0x8bca('0x52')]()));}})[_0x8bca('0x3d')](handleError(_0x47427f,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 38fd138..b920a46 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 _0xe14b=['bluebird','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment'];(function(_0x3201c2,_0x3950a2){var _0x52c417=function(_0x3d3b8e){while(--_0x3d3b8e){_0x3201c2['push'](_0x3201c2['shift']());}};_0x52c417(++_0x3950a2);}(_0xe14b,0x93));var _0xbe14=function(_0x28deac,_0x1618bb){_0x28deac=_0x28deac-0x0;var _0x231106=_0xe14b[_0x28deac];return _0x231106;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','./analyticExtractedReport.attributes'];(function(_0x275865,_0x2e9e0d){var _0x4df05c=function(_0x1c1202){while(--_0x1c1202){_0x275865['push'](_0x275865['shift']());}};_0x4df05c(++_0x2e9e0d);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x330743,_0x41aa98){_0x330743=_0x330743-0x0;var _0x18fa93=_0xbd51[_0x330743];return _0x18fa93;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('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 e4a9a00..3b41243 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 _0x4405=['rpc','../../config/environment','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x127ed7,_0x18c2c5){var _0x17c7bb=function(_0x212045){while(--_0x212045){_0x127ed7['push'](_0x127ed7['shift']());}};_0x17c7bb(++_0x18c2c5);}(_0x4405,0x93));var _0x5440=function(_0x486528,_0x833064){_0x486528=_0x486528-0x0;var _0x1aaf74=_0x4405[_0x486528];return _0x1aaf74;};'use strict';var _=require('lodash');var util=require(_0x5440('0x0'));var moment=require(_0x5440('0x1'));var BPromise=require(_0x5440('0x2'));var rs=require(_0x5440('0x3'));var fs=require('fs');var Redis=require(_0x5440('0x4'));var db=require(_0x5440('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5440('0x6'))(_0x5440('0x7'));var config=require(_0x5440('0x8'));var jayson=require(_0x5440('0x9'));var client=jayson[_0x5440('0xa')][_0x5440('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5207f2,_0x75b25a,_0x5779aa){return new BPromise(function(_0x2a9415,_0x297794){return client[_0x5440('0xc')](_0x5207f2,_0x5779aa)['then'](function(_0x3e6329){logger['info'](_0x5440('0xd'),_0x75b25a,_0x5440('0xe'));logger[_0x5440('0xf')](_0x5440('0x10'),_0x75b25a,_0x5440('0xe'),JSON[_0x5440('0x11')](_0x3e6329));if(_0x3e6329['error']){if(_0x3e6329[_0x5440('0x12')]['code']===0x1f4){logger['error'](_0x5440('0xd'),_0x75b25a,_0x3e6329[_0x5440('0x12')]['message']);return _0x297794(_0x3e6329[_0x5440('0x12')][_0x5440('0x13')]);}logger[_0x5440('0x12')](_0x5440('0xd'),_0x75b25a,_0x3e6329[_0x5440('0x12')][_0x5440('0x13')]);return _0x2a9415(_0x3e6329[_0x5440('0x12')][_0x5440('0x13')]);}else{logger[_0x5440('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x75b25a,'request\x20sent');_0x2a9415(_0x3e6329['result'][_0x5440('0x13')]);}})[_0x5440('0x15')](function(_0x3fa0aa){logger['error'](_0x5440('0xd'),_0x75b25a,_0x3fa0aa);_0x297794(_0x3fa0aa);});});} \ No newline at end of file +var _0x3784=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4fd5a2,_0x110eae){var _0x265d19=function(_0x396771){while(--_0x396771){_0x4fd5a2['push'](_0x4fd5a2['shift']());}};_0x265d19(++_0x110eae);}(_0x3784,0xb1));var _0x4378=function(_0x2f3880,_0x28c427){_0x2f3880=_0x2f3880-0x0;var _0x1d63a0=_0x3784[_0x2f3880];return _0x1d63a0;};'use strict';var _=require(_0x4378('0x0'));var util=require(_0x4378('0x1'));var moment=require('moment');var BPromise=require(_0x4378('0x2'));var rs=require(_0x4378('0x3'));var fs=require('fs');var Redis=require(_0x4378('0x4'));var db=require(_0x4378('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4378('0x6'))(_0x4378('0x7'));var config=require('../../config/environment');var jayson=require(_0x4378('0x8'));var client=jayson['client'][_0x4378('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35e030,_0x49e557,_0x80af){return new BPromise(function(_0x58938e,_0x55fc01){return client[_0x4378('0xa')](_0x35e030,_0x80af)[_0x4378('0xb')](function(_0x56a563){logger[_0x4378('0xc')](_0x4378('0xd'),_0x49e557,_0x4378('0xe'));logger[_0x4378('0xf')](_0x4378('0x10'),_0x49e557,_0x4378('0xe'),JSON[_0x4378('0x11')](_0x56a563));if(_0x56a563[_0x4378('0x12')]){if(_0x56a563[_0x4378('0x12')][_0x4378('0x13')]===0x1f4){logger[_0x4378('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x49e557,_0x56a563['error'][_0x4378('0x14')]);return _0x55fc01(_0x56a563[_0x4378('0x12')][_0x4378('0x14')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x49e557,_0x56a563[_0x4378('0x12')][_0x4378('0x14')]);return _0x58938e(_0x56a563[_0x4378('0x12')][_0x4378('0x14')]);}else{logger[_0x4378('0xc')](_0x4378('0xd'),_0x49e557,'request\x20sent');_0x58938e(_0x56a563['result'][_0x4378('0x14')]);}})[_0x4378('0x15')](function(_0x35a903){logger[_0x4378('0x12')](_0x4378('0xd'),_0x49e557,_0x35a903);_0x55fc01(_0x35a903);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b7acd15..6f4b52f 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 _0xe422=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create'];(function(_0x4f4785,_0x3598d4){var _0x28e55d=function(_0x862d7d){while(--_0x862d7d){_0x4f4785['push'](_0x4f4785['shift']());}};_0x28e55d(++_0x3598d4);}(_0xe422,0xdd));var _0x2e42=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe422[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2e42('0x0'));var util=require(_0x2e42('0x1'));var path=require(_0x2e42('0x2'));var timeout=require(_0x2e42('0x3'));var express=require(_0x2e42('0x4'));var router=express[_0x2e42('0x5')]();var auth=require(_0x2e42('0x6'));var interaction=require(_0x2e42('0x7'));var config=require(_0x2e42('0x8'));var controller=require(_0x2e42('0x9'));router[_0x2e42('0xa')]('/',auth['isAuthenticated'](),controller[_0x2e42('0xb')]);router[_0x2e42('0xa')](_0x2e42('0xc'),auth[_0x2e42('0xd')](),controller[_0x2e42('0xe')]);router['get'](_0x2e42('0xf'),auth['isAuthenticated'](),controller[_0x2e42('0x10')]);router[_0x2e42('0x11')]('/',auth[_0x2e42('0xd')](),controller[_0x2e42('0x12')]);router[_0x2e42('0x13')](_0x2e42('0xc'),auth['isAuthenticated'](),controller[_0x2e42('0x14')]);router[_0x2e42('0x15')](_0x2e42('0xc'),auth[_0x2e42('0xd')](),controller[_0x2e42('0x16')]);module[_0x2e42('0x17')]=router; \ No newline at end of file +var _0xcb6e=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x158f7f,_0x2a9c27){var _0x1274a4=function(_0x53a411){while(--_0x53a411){_0x158f7f['push'](_0x158f7f['shift']());}};_0x1274a4(++_0x2a9c27);}(_0xcb6e,0x102));var _0xecb6=function(_0x45d866,_0x19e07a){_0x45d866=_0x45d866-0x0;var _0x5a33bd=_0xcb6e[_0x45d866];return _0x5a33bd;};'use strict';var multer=require(_0xecb6('0x0'));var util=require(_0xecb6('0x1'));var path=require(_0xecb6('0x2'));var timeout=require(_0xecb6('0x3'));var express=require('express');var router=express[_0xecb6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xecb6('0x5'));var config=require(_0xecb6('0x6'));var controller=require(_0xecb6('0x7'));router['get']('/',auth[_0xecb6('0x8')](),controller[_0xecb6('0x9')]);router[_0xecb6('0xa')](_0xecb6('0xb'),auth[_0xecb6('0x8')](),controller[_0xecb6('0xc')]);router[_0xecb6('0xa')]('/:id/download',auth[_0xecb6('0x8')](),controller['download']);router[_0xecb6('0xd')]('/',auth[_0xecb6('0x8')](),controller[_0xecb6('0xe')]);router[_0xecb6('0xf')](_0xecb6('0xb'),auth[_0xecb6('0x8')](),controller[_0xecb6('0x10')]);router[_0xecb6('0x11')](_0xecb6('0xb'),auth[_0xecb6('0x8')](),controller[_0xecb6('0x12')]);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 8392ce3..4051d39 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 _0xa7f6=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x25ad66,_0x46e4dc){var _0x141bc4=function(_0x3a7f8e){while(--_0x3a7f8e){_0x25ad66['push'](_0x25ad66['shift']());}};_0x141bc4(++_0x46e4dc);}(_0xa7f6,0x17d));var _0x6a7f=function(_0xfda072,_0xec0ba){_0xfda072=_0xfda072-0x0;var _0x396d52=_0xa7f6[_0xfda072];return _0x396d52;};'use strict';var Sequelize=require(_0x6a7f('0x0'));module[_0x6a7f('0x1')]={'field':{'type':Sequelize[_0x6a7f('0x2')]},'alias':{'type':Sequelize[_0x6a7f('0x3')]},'function':{'type':Sequelize[_0x6a7f('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x6a7f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb30=['BOOLEAN','exports','TEXT','STRING'];(function(_0x339482,_0x501230){var _0x58f353=function(_0x5e90e0){while(--_0x5e90e0){_0x339482['push'](_0x339482['shift']());}};_0x58f353(++_0x501230);}(_0xdb30,0x18d));var _0x0db3=function(_0x3c574d,_0x11e6e2){_0x3c574d=_0x3c574d-0x0;var _0x3bfb0f=_0xdb30[_0x3c574d];return _0x3bfb0f;};'use strict';var Sequelize=require('sequelize');module[_0x0db3('0x0')]={'field':{'type':Sequelize[_0x0db3('0x1')]},'alias':{'type':Sequelize[_0x0db3('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0db3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0db3('0x2')]},'custom':{'type':Sequelize[_0x0db3('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 8997ce7..67b3a23 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 _0xd1bd=['desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','AnalyticFieldReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','include','catch','show','params','includeAll','create','body','bulkCreate','find','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','lodash','squel'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd1bd,0x8a));var _0xdd1b=function(_0x268d75,_0x4ea6c2){_0x268d75=_0x268d75-0x0;var _0x2d302c=_0xd1bd[_0x268d75];return _0x2d302c;};'use strict';var pdf=require(_0xdd1b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd1b('0x1'));var zipdir=require(_0xdd1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd1b('0x3'));var moment=require(_0xdd1b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd1b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdd1b('0x6'));var csv=require('to-csv');var ejs=require(_0xdd1b('0x7'));var fs=require('fs');var _=require(_0xdd1b('0x8'));var squel=require(_0xdd1b('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdd1b('0xa'));var toCsv=require(_0xdd1b('0xb'));var querystring=require('querystring');var Papa=require(_0xdd1b('0xc'));var Redis=require('ioredis');var authService=require(_0xdd1b('0xd'));var qs=require(_0xdd1b('0xe'));var hardwareService=require(_0xdd1b('0xf'));var logger=require('../../config/logger')(_0xdd1b('0x10'));var utils=require(_0xdd1b('0x11'));var config=require(_0xdd1b('0x12'));var db=require(_0xdd1b('0x13'))['db'];function respondWithStatusCode(_0x124593,_0x5d26e0){_0x5d26e0=_0x5d26e0||0xcc;return function(_0x49fcec){if(_0x49fcec){return _0x124593[_0xdd1b('0x14')](_0x5d26e0);}return _0x124593[_0xdd1b('0x15')](_0x5d26e0)[_0xdd1b('0x16')]();};}function respondWithResult(_0x289d72,_0x3c7873){_0x3c7873=_0x3c7873||0xc8;return function(_0x4da9d4){if(_0x4da9d4){return _0x289d72[_0xdd1b('0x15')](_0x3c7873)[_0xdd1b('0x17')](_0x4da9d4);}};}function respondWithFilteredResult(_0x47b7b7,_0x4c1224){return function(_0x6223){if(_0x6223){var _0x9b5057=_0x6223['count'],_0x1ed551=_0x4c1224[_0xdd1b('0x18')],_0x3f847f=_0x4c1224[_0xdd1b('0x18')]+_0x4c1224[_0xdd1b('0x19')],_0x58f97b;if(_0x3f847f>=_0x9b5057){_0x3f847f=_0x9b5057;_0x58f97b=0xc8;}else{_0x58f97b=0xce;}_0x47b7b7[_0xdd1b('0x15')](_0x58f97b);return _0x47b7b7[_0xdd1b('0x1a')](_0xdd1b('0x1b'),_0x1ed551+'-'+_0x3f847f+'/'+_0x9b5057)[_0xdd1b('0x17')](_0x6223);}return null;};}function patchUpdates(_0x47d5c2){return function(_0x21429b){try{jsonpatch[_0xdd1b('0x1c')](_0x21429b,_0x47d5c2,!![]);}catch(_0x4c7e48){return BPromise['reject'](_0x4c7e48);}return _0x21429b[_0xdd1b('0x1d')]();};}function saveUpdates(_0x2745bf,_0x5b3408){return function(_0x9f6113){if(_0x9f6113){return _0x9f6113[_0xdd1b('0x1e')](_0x2745bf)[_0xdd1b('0x1f')](function(_0x1c2e1e){return _0x1c2e1e;});}return null;};}function removeEntity(_0x18fabf,_0x1b8c53){return function(_0xd5d950){if(_0xd5d950){return _0xd5d950[_0xdd1b('0x20')]()['then'](function(){_0x18fabf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8a2675,_0x5d32bf){return function(_0x3dfc6e){if(!_0x3dfc6e){_0x8a2675[_0xdd1b('0x14')](0x194);}return _0x3dfc6e;};}function handleError(_0x4f8e06,_0x1c45a4){_0x1c45a4=_0x1c45a4||0x1f4;return function(_0x45ad93){logger['error'](_0x45ad93[_0xdd1b('0x21')]);if(_0x45ad93[_0xdd1b('0x22')]){delete _0x45ad93[_0xdd1b('0x22')];}_0x4f8e06[_0xdd1b('0x15')](_0x1c45a4)[_0xdd1b('0x23')](_0x45ad93);};}exports['index']=function(_0x26df6f,_0xc113f7){var _0xc0f49c={},_0x2ea17c={},_0x1bd13f={'count':0x0,'rows':[]};var _0x4d8e3d=db[_0xdd1b('0x24')][_0xdd1b('0x25')];_0x2ea17c[_0xdd1b('0x26')]=_[_0xdd1b('0x27')](_0x4d8e3d);_0x2ea17c[_0xdd1b('0x28')]=_['keys'](_0x26df6f[_0xdd1b('0x28')]);_0x2ea17c[_0xdd1b('0x29')]=_[_0xdd1b('0x2a')](_0x2ea17c['model'],_0x2ea17c[_0xdd1b('0x28')]);_0xc0f49c['attributes']=_['intersection'](_0x2ea17c[_0xdd1b('0x26')],qs[_0xdd1b('0x2b')](_0x26df6f[_0xdd1b('0x28')][_0xdd1b('0x2b')]));_0xc0f49c[_0xdd1b('0x2c')]=_0xc0f49c[_0xdd1b('0x2c')][_0xdd1b('0x2d')]?_0xc0f49c[_0xdd1b('0x2c')]:_0x2ea17c[_0xdd1b('0x26')];if(!_0x26df6f[_0xdd1b('0x28')]['hasOwnProperty']('nolimit')){_0xc0f49c['limit']=qs[_0xdd1b('0x19')](_0x26df6f['query'][_0xdd1b('0x19')]);_0xc0f49c[_0xdd1b('0x18')]=qs['offset'](_0x26df6f['query']['offset']);}_0xc0f49c[_0xdd1b('0x2e')]=qs[_0xdd1b('0x2f')](_0x26df6f[_0xdd1b('0x28')][_0xdd1b('0x2f')]);_0xc0f49c[_0xdd1b('0x30')]=qs[_0xdd1b('0x29')](_['pick'](_0x26df6f['query'],_0x2ea17c[_0xdd1b('0x29')]));if(_0x26df6f[_0xdd1b('0x28')][_0xdd1b('0x31')]){_0xc0f49c[_0xdd1b('0x30')]=_[_0xdd1b('0x32')](_0xc0f49c['where'],{'$or':_[_0xdd1b('0x33')](_0x4d8e3d,function(_0x57f052){if(_0x57f052[_0xdd1b('0x34')][_0xdd1b('0x35')]!==_0xdd1b('0x36')){var _0x1f7e95={};_0x1f7e95[_0x57f052[_0xdd1b('0x37')]]={'$like':'%'+_0x26df6f['query'][_0xdd1b('0x31')]+'%'};return _0x1f7e95;}})});}_0xc0f49c=_[_0xdd1b('0x32')]({},_0xc0f49c,_0x26df6f[_0xdd1b('0x38')]);var _0x4a5b1f={'where':_0xc0f49c[_0xdd1b('0x30')]};return db[_0xdd1b('0x24')][_0xdd1b('0x39')](_0x4a5b1f)[_0xdd1b('0x1f')](function(_0x35641e){_0x1bd13f['count']=_0x35641e;if(_0x26df6f[_0xdd1b('0x28')]['includeAll']){_0xc0f49c[_0xdd1b('0x3a')]=[{'all':!![]}];}return db[_0xdd1b('0x24')]['findAll'](_0xc0f49c);})[_0xdd1b('0x1f')](function(_0x29db55){_0x1bd13f['rows']=_0x29db55;return _0x1bd13f;})[_0xdd1b('0x1f')](respondWithFilteredResult(_0xc113f7,_0xc0f49c))[_0xdd1b('0x3b')](handleError(_0xc113f7,null));};exports[_0xdd1b('0x3c')]=function(_0x3d4e04,_0x39c5f4){var _0x16b53c={'raw':![],'where':{'id':_0x3d4e04[_0xdd1b('0x3d')]['id']}},_0x6f257b={};_0x6f257b[_0xdd1b('0x26')]=_[_0xdd1b('0x27')](db['AnalyticFieldReport'][_0xdd1b('0x25')]);_0x6f257b[_0xdd1b('0x28')]=_['keys'](_0x3d4e04[_0xdd1b('0x28')]);_0x6f257b['filters']=_[_0xdd1b('0x2a')](_0x6f257b['model'],_0x6f257b[_0xdd1b('0x28')]);_0x16b53c['attributes']=_[_0xdd1b('0x2a')](_0x6f257b['model'],qs['fields'](_0x3d4e04[_0xdd1b('0x28')]['fields']));_0x16b53c[_0xdd1b('0x2c')]=_0x16b53c[_0xdd1b('0x2c')]['length']?_0x16b53c[_0xdd1b('0x2c')]:_0x6f257b[_0xdd1b('0x26')];if(_0x3d4e04[_0xdd1b('0x28')][_0xdd1b('0x3e')]){_0x16b53c[_0xdd1b('0x3a')]=[{'all':!![]}];}_0x16b53c=_[_0xdd1b('0x32')]({},_0x16b53c,_0x3d4e04[_0xdd1b('0x38')]);return db[_0xdd1b('0x24')]['find'](_0x16b53c)[_0xdd1b('0x1f')](handleEntityNotFound(_0x39c5f4,null))[_0xdd1b('0x1f')](respondWithResult(_0x39c5f4,null))[_0xdd1b('0x3b')](handleError(_0x39c5f4,null));};exports['create']=function(_0x407c30,_0x173ced){return db['AnalyticFieldReport'][_0xdd1b('0x3f')](_0x407c30[_0xdd1b('0x40')],{})[_0xdd1b('0x1f')](respondWithResult(_0x173ced,0xc9))[_0xdd1b('0x3b')](handleError(_0x173ced,null));};exports[_0xdd1b('0x41')]=function(_0x213d57,_0x3b859e){return db[_0xdd1b('0x24')][_0xdd1b('0x41')](_0x213d57[_0xdd1b('0x40')],{'raw':![],'individualHooks':!![]})[_0xdd1b('0x1f')](respondWithResult(_0x3b859e,0xc9))[_0xdd1b('0x3b')](handleError(_0x3b859e,null));};exports[_0xdd1b('0x1e')]=function(_0x4fff58,_0xf56512){if(_0x4fff58[_0xdd1b('0x40')]['id']){delete _0x4fff58[_0xdd1b('0x40')]['id'];}return db[_0xdd1b('0x24')][_0xdd1b('0x42')]({'where':{'id':_0x4fff58[_0xdd1b('0x3d')]['id']}})['then'](handleEntityNotFound(_0xf56512,null))[_0xdd1b('0x1f')](saveUpdates(_0x4fff58['body'],null))[_0xdd1b('0x1f')](respondWithResult(_0xf56512,null))[_0xdd1b('0x3b')](handleError(_0xf56512,null));};exports[_0xdd1b('0x20')]=function(_0x288bfc,_0x319fb3){return db[_0xdd1b('0x24')]['find']({'where':{'id':_0x288bfc[_0xdd1b('0x3d')]['id']}})[_0xdd1b('0x1f')](handleEntityNotFound(_0x319fb3,null))['then'](removeEntity(_0x319fb3,null))[_0xdd1b('0x3b')](handleError(_0x319fb3,null));};exports[_0xdd1b('0x43')]=function(_0x400ee5,_0x34da0e){return db['AnalyticFieldReport'][_0xdd1b('0x20')]({'where':{'id':_0x400ee5[_0xdd1b('0x28')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xdd1b('0x1f')](respondWithResult(_0x34da0e,0xcc))[_0xdd1b('0x3b')](handleError(_0x34da0e,null));};exports[_0xdd1b('0x44')]=function(_0x3d0378,_0x35e97f,_0x320495){return db[_0xdd1b('0x45')]['findOne']({'where':{'id':_0x3d0378[_0xdd1b('0x3d')]['id']}})[_0xdd1b('0x1f')](handleEntityNotFound(_0x35e97f,null))[_0xdd1b('0x1f')](function(_0x1c03d6){if(_0x1c03d6){return db[_0xdd1b('0x46')][_0xdd1b('0x47')](function(_0x3177ed){return db[_0xdd1b('0x24')][_0xdd1b('0x20')]({'where':{'CustomReportId':_0x3d0378[_0xdd1b('0x3d')]['id']},'transaction':_0x3177ed})[_0xdd1b('0x1f')](function(_0x11125c){var _0x487904=_['map'](_0x3d0378['body'],function(_0x555655){delete _0x555655['id'];_0x555655[_0xdd1b('0x48')]=_0x3d0378[_0xdd1b('0x3d')]['id'];return _0x555655;});return db['AnalyticFieldReport'][_0xdd1b('0x41')](_0x487904,{'transaction':_0x3177ed});});})['then'](function(){return db[_0xdd1b('0x24')][_0xdd1b('0x49')]({'where':{'CustomReportId':_0x3d0378[_0xdd1b('0x3d')]['id']}});});}})['then'](respondWithResult(_0x35e97f,null))[_0xdd1b('0x3b')](handleError(_0x35e97f,null));}; \ No newline at end of file +var _0x273b=['params','intersection','length','find','create','bulkCreate','update','body','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','keys','query','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch'];(function(_0x55c138,_0x1ad75d){var _0xa6d51d=function(_0x334850){while(--_0x334850){_0x55c138['push'](_0x55c138['shift']());}};_0xa6d51d(++_0x1ad75d);}(_0x273b,0xb9));var _0xb273=function(_0x3545b8,_0x27f7a5){_0x3545b8=_0x3545b8-0x0;var _0xfaa062=_0x273b[_0x3545b8];return _0xfaa062;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb273('0x0'));var rimraf=require(_0xb273('0x1'));var zipdir=require(_0xb273('0x2'));var jsonpatch=require(_0xb273('0x3'));var rp=require(_0xb273('0x4'));var moment=require(_0xb273('0x5'));var BPromise=require(_0xb273('0x6'));var Mustache=require(_0xb273('0x7'));var util=require(_0xb273('0x8'));var path=require(_0xb273('0x9'));var sox=require(_0xb273('0xa'));var csv=require(_0xb273('0xb'));var ejs=require(_0xb273('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb273('0xd'));var crypto=require(_0xb273('0xe'));var jsforce=require(_0xb273('0xf'));var deskjs=require(_0xb273('0x10'));var toCsv=require(_0xb273('0xb'));var querystring=require(_0xb273('0x11'));var Papa=require(_0xb273('0x12'));var Redis=require(_0xb273('0x13'));var authService=require(_0xb273('0x14'));var qs=require(_0xb273('0x15'));var hardwareService=require(_0xb273('0x16'));var logger=require(_0xb273('0x17'))(_0xb273('0x18'));var utils=require(_0xb273('0x19'));var config=require('../../config/environment');var db=require(_0xb273('0x1a'))['db'];function respondWithStatusCode(_0x1ea3bf,_0x4f81ff){_0x4f81ff=_0x4f81ff||0xcc;return function(_0xbce436){if(_0xbce436){return _0x1ea3bf[_0xb273('0x1b')](_0x4f81ff);}return _0x1ea3bf[_0xb273('0x1c')](_0x4f81ff)[_0xb273('0x1d')]();};}function respondWithResult(_0x3b2e53,_0x55c88d){_0x55c88d=_0x55c88d||0xc8;return function(_0x402633){if(_0x402633){return _0x3b2e53[_0xb273('0x1c')](_0x55c88d)[_0xb273('0x1e')](_0x402633);}};}function respondWithFilteredResult(_0x2228ae,_0x42f2eb){return function(_0x24d577){if(_0x24d577){var _0x246b8e=_0x24d577[_0xb273('0x1f')],_0x47c690=_0x42f2eb[_0xb273('0x20')],_0x4c52e2=_0x42f2eb[_0xb273('0x20')]+_0x42f2eb['limit'],_0x56c3a8;if(_0x4c52e2>=_0x246b8e){_0x4c52e2=_0x246b8e;_0x56c3a8=0xc8;}else{_0x56c3a8=0xce;}_0x2228ae[_0xb273('0x1c')](_0x56c3a8);return _0x2228ae['set'](_0xb273('0x21'),_0x47c690+'-'+_0x4c52e2+'/'+_0x246b8e)[_0xb273('0x1e')](_0x24d577);}return null;};}function patchUpdates(_0x16144b){return function(_0x239ad3){try{jsonpatch['apply'](_0x239ad3,_0x16144b,!![]);}catch(_0x2f2b89){return BPromise[_0xb273('0x22')](_0x2f2b89);}return _0x239ad3[_0xb273('0x23')]();};}function saveUpdates(_0x5b74bb,_0x391a2b){return function(_0x1963e8){if(_0x1963e8){return _0x1963e8['update'](_0x5b74bb)[_0xb273('0x24')](function(_0x222148){return _0x222148;});}return null;};}function removeEntity(_0x575a54,_0x13e7d7){return function(_0x55dd34){if(_0x55dd34){return _0x55dd34[_0xb273('0x25')]()[_0xb273('0x24')](function(){_0x575a54['status'](0xcc)[_0xb273('0x1d')]();});}};}function handleEntityNotFound(_0x3c0471,_0x371ae0){return function(_0x28ac9a){if(!_0x28ac9a){_0x3c0471[_0xb273('0x1b')](0x194);}return _0x28ac9a;};}function handleError(_0x841f0b,_0x4a07ba){_0x4a07ba=_0x4a07ba||0x1f4;return function(_0x49a065){logger[_0xb273('0x26')](_0x49a065[_0xb273('0x27')]);if(_0x49a065['name']){delete _0x49a065[_0xb273('0x28')];}_0x841f0b[_0xb273('0x1c')](_0x4a07ba)[_0xb273('0x29')](_0x49a065);};}exports[_0xb273('0x2a')]=function(_0x5f0698,_0x2c11d7){var _0x3fdd3c={},_0x5994e5={},_0x53a59b={'count':0x0,'rows':[]};var _0x4f9334=db[_0xb273('0x2b')][_0xb273('0x2c')];_0x5994e5['model']=_[_0xb273('0x2d')](_0x4f9334);_0x5994e5[_0xb273('0x2e')]=_[_0xb273('0x2d')](_0x5f0698[_0xb273('0x2e')]);_0x5994e5['filters']=_['intersection'](_0x5994e5[_0xb273('0x2f')],_0x5994e5[_0xb273('0x2e')]);_0x3fdd3c[_0xb273('0x30')]=_['intersection'](_0x5994e5['model'],qs['fields'](_0x5f0698['query'][_0xb273('0x31')]));_0x3fdd3c['attributes']=_0x3fdd3c[_0xb273('0x30')]['length']?_0x3fdd3c['attributes']:_0x5994e5[_0xb273('0x2f')];if(!_0x5f0698[_0xb273('0x2e')][_0xb273('0x32')](_0xb273('0x33'))){_0x3fdd3c[_0xb273('0x34')]=qs['limit'](_0x5f0698[_0xb273('0x2e')][_0xb273('0x34')]);_0x3fdd3c[_0xb273('0x20')]=qs[_0xb273('0x20')](_0x5f0698[_0xb273('0x2e')][_0xb273('0x20')]);}_0x3fdd3c[_0xb273('0x35')]=qs[_0xb273('0x36')](_0x5f0698[_0xb273('0x2e')]['sort']);_0x3fdd3c[_0xb273('0x37')]=qs[_0xb273('0x38')](_[_0xb273('0x39')](_0x5f0698['query'],_0x5994e5['filters']));if(_0x5f0698[_0xb273('0x2e')][_0xb273('0x3a')]){_0x3fdd3c[_0xb273('0x37')]=_[_0xb273('0x3b')](_0x3fdd3c[_0xb273('0x37')],{'$or':_[_0xb273('0x3c')](_0x4f9334,function(_0x4a4c32){if(_0x4a4c32['type'][_0xb273('0x3d')]!==_0xb273('0x3e')){var _0x5c5ee2={};_0x5c5ee2[_0x4a4c32[_0xb273('0x3f')]]={'$like':'%'+_0x5f0698[_0xb273('0x2e')][_0xb273('0x3a')]+'%'};return _0x5c5ee2;}})});}_0x3fdd3c=_['merge']({},_0x3fdd3c,_0x5f0698[_0xb273('0x40')]);var _0x52ea2a={'where':_0x3fdd3c[_0xb273('0x37')]};return db[_0xb273('0x2b')]['count'](_0x52ea2a)[_0xb273('0x24')](function(_0x454536){_0x53a59b['count']=_0x454536;if(_0x5f0698[_0xb273('0x2e')][_0xb273('0x41')]){_0x3fdd3c[_0xb273('0x42')]=[{'all':!![]}];}return db[_0xb273('0x2b')][_0xb273('0x43')](_0x3fdd3c);})[_0xb273('0x24')](function(_0x3d8063){_0x53a59b[_0xb273('0x44')]=_0x3d8063;return _0x53a59b;})[_0xb273('0x24')](respondWithFilteredResult(_0x2c11d7,_0x3fdd3c))[_0xb273('0x45')](handleError(_0x2c11d7,null));};exports['show']=function(_0x58704f,_0x3d2140){var _0x2d549c={'raw':![],'where':{'id':_0x58704f[_0xb273('0x46')]['id']}},_0x17b134={};_0x17b134[_0xb273('0x2f')]=_[_0xb273('0x2d')](db[_0xb273('0x2b')][_0xb273('0x2c')]);_0x17b134[_0xb273('0x2e')]=_[_0xb273('0x2d')](_0x58704f[_0xb273('0x2e')]);_0x17b134['filters']=_['intersection'](_0x17b134[_0xb273('0x2f')],_0x17b134[_0xb273('0x2e')]);_0x2d549c[_0xb273('0x30')]=_[_0xb273('0x47')](_0x17b134[_0xb273('0x2f')],qs[_0xb273('0x31')](_0x58704f[_0xb273('0x2e')]['fields']));_0x2d549c['attributes']=_0x2d549c['attributes'][_0xb273('0x48')]?_0x2d549c['attributes']:_0x17b134[_0xb273('0x2f')];if(_0x58704f['query'][_0xb273('0x41')]){_0x2d549c['include']=[{'all':!![]}];}_0x2d549c=_[_0xb273('0x3b')]({},_0x2d549c,_0x58704f[_0xb273('0x40')]);return db[_0xb273('0x2b')][_0xb273('0x49')](_0x2d549c)['then'](handleEntityNotFound(_0x3d2140,null))['then'](respondWithResult(_0x3d2140,null))['catch'](handleError(_0x3d2140,null));};exports[_0xb273('0x4a')]=function(_0x16662f,_0x3f8d43){return db[_0xb273('0x2b')][_0xb273('0x4a')](_0x16662f['body'],{})[_0xb273('0x24')](respondWithResult(_0x3f8d43,0xc9))['catch'](handleError(_0x3f8d43,null));};exports['bulkCreate']=function(_0x2370a2,_0x1e7ff4){return db[_0xb273('0x2b')][_0xb273('0x4b')](_0x2370a2['body'],{'raw':![],'individualHooks':!![]})[_0xb273('0x24')](respondWithResult(_0x1e7ff4,0xc9))[_0xb273('0x45')](handleError(_0x1e7ff4,null));};exports[_0xb273('0x4c')]=function(_0x1938a4,_0x9b2ebb){if(_0x1938a4[_0xb273('0x4d')]['id']){delete _0x1938a4[_0xb273('0x4d')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x1938a4[_0xb273('0x46')]['id']}})[_0xb273('0x24')](handleEntityNotFound(_0x9b2ebb,null))['then'](saveUpdates(_0x1938a4[_0xb273('0x4d')],null))[_0xb273('0x24')](respondWithResult(_0x9b2ebb,null))[_0xb273('0x45')](handleError(_0x9b2ebb,null));};exports[_0xb273('0x25')]=function(_0x5ee450,_0x396a47){return db['AnalyticFieldReport'][_0xb273('0x49')]({'where':{'id':_0x5ee450['params']['id']}})[_0xb273('0x24')](handleEntityNotFound(_0x396a47,null))[_0xb273('0x24')](removeEntity(_0x396a47,null))[_0xb273('0x45')](handleError(_0x396a47,null));};exports[_0xb273('0x4e')]=function(_0x1cc810,_0xa7bd5d){return db[_0xb273('0x2b')][_0xb273('0x25')]({'where':{'id':_0x1cc810['query'][_0xb273('0x4f')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xa7bd5d,0xcc))['catch'](handleError(_0xa7bd5d,null));};exports[_0xb273('0x50')]=function(_0x1fe73d,_0x58025b,_0x25728a){return db[_0xb273('0x51')]['findOne']({'where':{'id':_0x1fe73d['params']['id']}})[_0xb273('0x24')](handleEntityNotFound(_0x58025b,null))[_0xb273('0x24')](function(_0x42a4cf){if(_0x42a4cf){return db[_0xb273('0x52')][_0xb273('0x53')](function(_0x1333c4){return db[_0xb273('0x2b')][_0xb273('0x25')]({'where':{'CustomReportId':_0x1fe73d[_0xb273('0x46')]['id']},'transaction':_0x1333c4})[_0xb273('0x24')](function(_0x1e1767){var _0x491bcc=_[_0xb273('0x3c')](_0x1fe73d[_0xb273('0x4d')],function(_0x5cc0e4){delete _0x5cc0e4['id'];_0x5cc0e4[_0xb273('0x54')]=_0x1fe73d[_0xb273('0x46')]['id'];return _0x5cc0e4;});return db['AnalyticFieldReport'][_0xb273('0x4b')](_0x491bcc,{'transaction':_0x1333c4});});})[_0xb273('0x24')](function(){return db[_0xb273('0x2b')][_0xb273('0x43')]({'where':{'CustomReportId':_0x1fe73d[_0xb273('0x46')]['id']}});});}})['then'](respondWithResult(_0x58025b,null))['catch'](handleError(_0x58025b,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3ea8676..a8d06c1 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 _0x2255=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x5c543c,_0x1368b6){var _0x74c152=function(_0x20d712){while(--_0x20d712){_0x5c543c['push'](_0x5c543c['shift']());}};_0x74c152(++_0x1368b6);}(_0x2255,0x6c));var _0x5225=function(_0x4c6725,_0xe97550){_0x4c6725=_0x4c6725-0x0;var _0x508d7d=_0x2255[_0x4c6725];return _0x508d7d;};'use strict';var _=require(_0x5225('0x0'));var util=require(_0x5225('0x1'));var logger=require('../../config/logger')(_0x5225('0x2'));var moment=require(_0x5225('0x3'));var BPromise=require(_0x5225('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5225('0x5'));var rimraf=require(_0x5225('0x6'));var config=require(_0x5225('0x7'));var attributes=require(_0x5225('0x8'));module[_0x5225('0x9')]=function(_0x4646e5,_0x5781c2){return _0x4646e5[_0x5225('0xa')](_0x5225('0xb'),attributes,{'tableName':_0x5225('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4197=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','request-promise'];(function(_0x2797d7,_0x1c62df){var _0x1fc0bb=function(_0x18ba08){while(--_0x18ba08){_0x2797d7['push'](_0x2797d7['shift']());}};_0x1fc0bb(++_0x1c62df);}(_0x4197,0x80));var _0x7419=function(_0x2f7f91,_0x2defb4){_0x2f7f91=_0x2f7f91-0x0;var _0x301ec7=_0x4197[_0x2f7f91];return _0x301ec7;};'use strict';var _=require(_0x7419('0x0'));var util=require(_0x7419('0x1'));var logger=require('../../config/logger')(_0x7419('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7419('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7419('0x4'));var config=require(_0x7419('0x5'));var attributes=require(_0x7419('0x6'));module[_0x7419('0x7')]=function(_0x4a9cbd,_0x5f6690){return _0x4a9cbd[_0x7419('0x8')](_0x7419('0x9'),attributes,{'tableName':_0x7419('0xa'),'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 75cb76d..a875632 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 _0x49df=['../../config/environment','jayson/promise','client','http','request','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','AnalyticFieldReport,\x20%s,\x20%s','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4e77c1,_0x1eaf61){var _0x2e2d3c=function(_0x58677c){while(--_0x58677c){_0x4e77c1['push'](_0x4e77c1['shift']());}};_0x2e2d3c(++_0x1eaf61);}(_0x49df,0xad));var _0xf49d=function(_0x514614,_0x54c16d){_0x514614=_0x514614-0x0;var _0x334409=_0x49df[_0x514614];return _0x334409;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf49d('0x0'));var BPromise=require(_0xf49d('0x1'));var rs=require(_0xf49d('0x2'));var fs=require('fs');var Redis=require(_0xf49d('0x3'));var db=require(_0xf49d('0x4'))['db'];var utils=require(_0xf49d('0x5'));var logger=require(_0xf49d('0x6'))('rpc');var config=require(_0xf49d('0x7'));var jayson=require(_0xf49d('0x8'));var client=jayson[_0xf49d('0x9')][_0xf49d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aaf37,_0x29b82e,_0x4e8b5e){return new BPromise(function(_0xadfde5,_0x36ed1d){return client[_0xf49d('0xb')](_0x1aaf37,_0x4e8b5e)['then'](function(_0x5aca77){logger[_0xf49d('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x29b82e,'request\x20sent');logger[_0xf49d('0xd')](_0xf49d('0xe'),_0x29b82e,_0xf49d('0xf'),JSON['stringify'](_0x5aca77));if(_0x5aca77[_0xf49d('0x10')]){if(_0x5aca77[_0xf49d('0x10')]['code']===0x1f4){logger[_0xf49d('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x29b82e,_0x5aca77['error'][_0xf49d('0x11')]);return _0x36ed1d(_0x5aca77['error'][_0xf49d('0x11')]);}logger[_0xf49d('0x10')](_0xf49d('0x12'),_0x29b82e,_0x5aca77['error'][_0xf49d('0x11')]);return _0xadfde5(_0x5aca77[_0xf49d('0x10')][_0xf49d('0x11')]);}else{logger['info'](_0xf49d('0x12'),_0x29b82e,_0xf49d('0xf'));_0xadfde5(_0x5aca77[_0xf49d('0x13')][_0xf49d('0x11')]);}})['catch'](function(_0x2927b9){logger[_0xf49d('0x10')](_0xf49d('0x12'),_0x29b82e,_0x2927b9);_0x36ed1d(_0x2927b9);});});} \ No newline at end of file +var _0xa566=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','info'];(function(_0x368e3a,_0x35ed36){var _0x448ac8=function(_0x16720f){while(--_0x16720f){_0x368e3a['push'](_0x368e3a['shift']());}};_0x448ac8(++_0x35ed36);}(_0xa566,0x1c1));var _0x6a56=function(_0x175e4a,_0x36f10d){_0x175e4a=_0x175e4a-0x0;var _0x2d5504=_0xa566[_0x175e4a];return _0x2d5504;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var moment=require(_0x6a56('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a56('0x3'));var fs=require('fs');var Redis=require(_0x6a56('0x4'));var db=require(_0x6a56('0x5'))['db'];var utils=require(_0x6a56('0x6'));var logger=require('../../config/logger')(_0x6a56('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3712ee,_0x50ae34,_0x472c60){return new BPromise(function(_0x4947a9,_0x33240c){return client[_0x6a56('0x8')](_0x3712ee,_0x472c60)['then'](function(_0x2f49ab){logger[_0x6a56('0x9')](_0x6a56('0xa'),_0x50ae34,_0x6a56('0xb'));logger['debug'](_0x6a56('0xc'),_0x50ae34,_0x6a56('0xb'),JSON['stringify'](_0x2f49ab));if(_0x2f49ab['error']){if(_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xe')]===0x1f4){logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xf')]);return _0x33240c(_0x2f49ab[_0x6a56('0xd')]['message']);}logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x2f49ab[_0x6a56('0xd')][_0x6a56('0xf')]);return _0x4947a9(_0x2f49ab[_0x6a56('0xd')]['message']);}else{logger[_0x6a56('0x9')](_0x6a56('0xa'),_0x50ae34,_0x6a56('0xb'));_0x4947a9(_0x2f49ab[_0x6a56('0x10')][_0x6a56('0xf')]);}})['catch'](function(_0x5e9895){logger[_0x6a56('0xd')](_0x6a56('0xa'),_0x50ae34,_0x5e9895);_0x33240c(_0x5e9895);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index f45cdcb..bdd6b59 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 _0x4ded=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','/:id','show','post','/:id/create_many','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10f8f2,_0x5a260b){var _0x2ca83a=function(_0x16c115){while(--_0x16c115){_0x10f8f2['push'](_0x10f8f2['shift']());}};_0x2ca83a(++_0x5a260b);}(_0x4ded,0x116));var _0xd4de=function(_0x1c2bbc,_0x2ceff6){_0x1c2bbc=_0x1c2bbc-0x0;var _0x1d6bfe=_0x4ded[_0x1c2bbc];return _0x1d6bfe;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var auth=require(_0xd4de('0x6'));var interaction=require(_0xd4de('0x7'));var config=require(_0xd4de('0x8'));var controller=require(_0xd4de('0x9'));router[_0xd4de('0xa')]('/',auth[_0xd4de('0xb')](),controller['index']);router[_0xd4de('0xa')](_0xd4de('0xc'),auth[_0xd4de('0xb')](),controller[_0xd4de('0xd')]);router[_0xd4de('0xe')]('/',auth[_0xd4de('0xb')](),controller['create']);router[_0xd4de('0xe')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0xd4de('0xe')](_0xd4de('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put'](_0xd4de('0xc'),auth['isAuthenticated'](),controller[_0xd4de('0x10')]);router[_0xd4de('0x11')](_0xd4de('0x12'),auth[_0xd4de('0xb')](),controller[_0xd4de('0x13')]);router[_0xd4de('0x11')](_0xd4de('0xc'),auth[_0xd4de('0xb')](),controller[_0xd4de('0x14')]);module[_0xd4de('0x15')]=router; \ No newline at end of file +var _0xf45e=['/:id','show','post','create','/create_many','/:id/create_many','addFields','put','update','delete','/destroy_many','bulkDestroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index'];(function(_0x3eca44,_0x445ba4){var _0x22f0df=function(_0x5c1251){while(--_0x5c1251){_0x3eca44['push'](_0x3eca44['shift']());}};_0x22f0df(++_0x445ba4);}(_0xf45e,0x115));var _0xef45=function(_0x1e5194,_0x306782){_0x1e5194=_0x1e5194-0x0;var _0x4be98e=_0xf45e[_0x1e5194];return _0x4be98e;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var auth=require(_0xef45('0x4'));var interaction=require(_0xef45('0x5'));var config=require(_0xef45('0x6'));var controller=require(_0xef45('0x7'));router[_0xef45('0x8')]('/',auth[_0xef45('0x9')](),controller[_0xef45('0xa')]);router[_0xef45('0x8')](_0xef45('0xb'),auth[_0xef45('0x9')](),controller[_0xef45('0xc')]);router[_0xef45('0xd')]('/',auth[_0xef45('0x9')](),controller[_0xef45('0xe')]);router[_0xef45('0xd')](_0xef45('0xf'),auth[_0xef45('0x9')](),controller['bulkCreate']);router[_0xef45('0xd')](_0xef45('0x10'),auth[_0xef45('0x9')](),controller[_0xef45('0x11')]);router[_0xef45('0x12')](_0xef45('0xb'),auth['isAuthenticated'](),controller[_0xef45('0x13')]);router[_0xef45('0x14')](_0xef45('0x15'),auth[_0xef45('0x9')](),controller[_0xef45('0x16')]);router['delete']('/:id',auth[_0xef45('0x9')](),controller['destroy']);module[_0xef45('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 29d61f6..cdc95f4 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 _0xa359=['STRING','name','TEXT','sequelize','exports'];(function(_0x47ffea,_0x4fa9ce){var _0x4e3968=function(_0x481775){while(--_0x481775){_0x47ffea['push'](_0x47ffea['shift']());}};_0x4e3968(++_0x4fa9ce);}(_0xa359,0x1e3));var _0x9a35=function(_0x4bb8de,_0x4bf334){_0x4bb8de=_0x4bb8de-0x0;var _0x508f1e=_0xa359[_0x4bb8de];return _0x508f1e;};'use strict';var Sequelize=require(_0x9a35('0x0'));module[_0x9a35('0x1')]={'name':{'type':Sequelize[_0x9a35('0x2')],'allowNull':![],'unique':_0x9a35('0x3')},'table':{'type':Sequelize[_0x9a35('0x2')]},'metric':{'type':Sequelize[_0x9a35('0x4')]},'description':{'type':Sequelize[_0x9a35('0x2')]}}; \ No newline at end of file +var _0x512e=['name','STRING','exports'];(function(_0x597106,_0x4a4eba){var _0x51af2d=function(_0x450d45){while(--_0x450d45){_0x597106['push'](_0x597106['shift']());}};_0x51af2d(++_0x4a4eba);}(_0x512e,0x1a9));var _0xe512=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x512e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xe512('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe512('0x1')},'table':{'type':Sequelize[_0xe512('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xe512('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 38bb192..2bcf42b 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 _0xe993=['catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','count','offset','limit','status','set','Content-Range','json','reject','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','stack','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x5e655c,_0x279d84){var _0x39b158=function(_0x5e65bf){while(--_0x5e65bf){_0x5e655c['push'](_0x5e655c['shift']());}};_0x39b158(++_0x279d84);}(_0xe993,0x19b));var _0x3e99=function(_0x15afbf,_0x49f079){_0x15afbf=_0x15afbf-0x0;var _0x146671=_0xe993[_0x15afbf];return _0x146671;};'use strict';var pdf=require(_0x3e99('0x0'));var emlformat=require(_0x3e99('0x1'));var rimraf=require(_0x3e99('0x2'));var zipdir=require(_0x3e99('0x3'));var jsonpatch=require(_0x3e99('0x4'));var rp=require(_0x3e99('0x5'));var moment=require(_0x3e99('0x6'));var BPromise=require(_0x3e99('0x7'));var Mustache=require(_0x3e99('0x8'));var util=require(_0x3e99('0x9'));var path=require('path');var sox=require(_0x3e99('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3e99('0xb'));var crypto=require(_0x3e99('0xc'));var jsforce=require(_0x3e99('0xd'));var deskjs=require(_0x3e99('0xe'));var toCsv=require(_0x3e99('0xf'));var querystring=require(_0x3e99('0x10'));var Papa=require(_0x3e99('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e99('0x12'))('api');var utils=require(_0x3e99('0x13'));var config=require(_0x3e99('0x14'));var db=require(_0x3e99('0x15'))['db'];function respondWithStatusCode(_0x202ebc,_0x42dfda){_0x42dfda=_0x42dfda||0xcc;return function(_0x181132){if(_0x181132){return _0x202ebc[_0x3e99('0x16')](_0x42dfda);}return _0x202ebc['status'](_0x42dfda)['end']();};}function respondWithResult(_0x278f9e,_0x14667b){_0x14667b=_0x14667b||0xc8;return function(_0x49ea36){if(_0x49ea36){return _0x278f9e['status'](_0x14667b)['json'](_0x49ea36);}};}function respondWithFilteredResult(_0x158543,_0x2581ef){return function(_0x5b10c2){if(_0x5b10c2){var _0x31c424=_0x5b10c2[_0x3e99('0x17')],_0x3c1499=_0x2581ef['offset'],_0x47bd7a=_0x2581ef[_0x3e99('0x18')]+_0x2581ef[_0x3e99('0x19')],_0x4f02d4;if(_0x47bd7a>=_0x31c424){_0x47bd7a=_0x31c424;_0x4f02d4=0xc8;}else{_0x4f02d4=0xce;}_0x158543[_0x3e99('0x1a')](_0x4f02d4);return _0x158543[_0x3e99('0x1b')](_0x3e99('0x1c'),_0x3c1499+'-'+_0x47bd7a+'/'+_0x31c424)[_0x3e99('0x1d')](_0x5b10c2);}return null;};}function patchUpdates(_0x56eba7){return function(_0x96ad9f){try{jsonpatch['apply'](_0x96ad9f,_0x56eba7,!![]);}catch(_0x1032f4){return BPromise[_0x3e99('0x1e')](_0x1032f4);}return _0x96ad9f[_0x3e99('0x1f')]();};}function saveUpdates(_0x11ea48,_0x528001){return function(_0x15d38d){if(_0x15d38d){return _0x15d38d[_0x3e99('0x20')](_0x11ea48)[_0x3e99('0x21')](function(_0x1a332f){return _0x1a332f;});}return null;};}function removeEntity(_0x1729f4,_0x12be27){return function(_0x50de3c){if(_0x50de3c){return _0x50de3c[_0x3e99('0x22')]()[_0x3e99('0x21')](function(){var _0x55aaa1=_0x50de3c[_0x3e99('0x23')]({'plain':!![]});var _0x32efe3=_0x3e99('0x24');return db[_0x3e99('0x25')][_0x3e99('0x22')]({'where':{'type':_0x32efe3,'resourceId':_0x55aaa1['id']}})[_0x3e99('0x21')](function(){return _0x50de3c;});})[_0x3e99('0x21')](function(){_0x1729f4[_0x3e99('0x1a')](0xcc)[_0x3e99('0x26')]();});}};}function handleEntityNotFound(_0x4dd0f1,_0x5c0e25){return function(_0x47ce1c){if(!_0x47ce1c){_0x4dd0f1['sendStatus'](0x194);}return _0x47ce1c;};}function handleError(_0xc2aa81,_0x37dbc3){_0x37dbc3=_0x37dbc3||0x1f4;return function(_0x500996){logger[_0x3e99('0x27')](_0x500996[_0x3e99('0x28')]);if(_0x500996[_0x3e99('0x29')]){delete _0x500996['name'];}_0xc2aa81[_0x3e99('0x1a')](_0x37dbc3)[_0x3e99('0x2a')](_0x500996);};}exports[_0x3e99('0x2b')]=function(_0x47be62,_0x2a1177){var _0x46cae0={},_0x32a33b={},_0x1df31d={'count':0x0,'rows':[]};var _0x131997=db[_0x3e99('0x2c')][_0x3e99('0x2d')];_0x32a33b[_0x3e99('0x2e')]=_[_0x3e99('0x2f')](_0x131997);_0x32a33b[_0x3e99('0x30')]=_[_0x3e99('0x2f')](_0x47be62[_0x3e99('0x30')]);_0x32a33b[_0x3e99('0x31')]=_[_0x3e99('0x32')](_0x32a33b[_0x3e99('0x2e')],_0x32a33b['query']);_0x46cae0[_0x3e99('0x33')]=_['intersection'](_0x32a33b[_0x3e99('0x2e')],qs['fields'](_0x47be62[_0x3e99('0x30')][_0x3e99('0x34')]));_0x46cae0['attributes']=_0x46cae0['attributes'][_0x3e99('0x35')]?_0x46cae0['attributes']:_0x32a33b[_0x3e99('0x2e')];if(!_0x47be62[_0x3e99('0x30')][_0x3e99('0x36')](_0x3e99('0x37'))){_0x46cae0[_0x3e99('0x19')]=qs[_0x3e99('0x19')](_0x47be62['query']['limit']);_0x46cae0[_0x3e99('0x18')]=qs['offset'](_0x47be62[_0x3e99('0x30')][_0x3e99('0x18')]);}_0x46cae0['order']=qs[_0x3e99('0x38')](_0x47be62[_0x3e99('0x30')][_0x3e99('0x38')]);_0x46cae0['where']=qs[_0x3e99('0x31')](_['pick'](_0x47be62[_0x3e99('0x30')],_0x32a33b['filters']));if(_0x47be62[_0x3e99('0x30')]['filter']){_0x46cae0[_0x3e99('0x39')]=_['merge'](_0x46cae0[_0x3e99('0x39')],{'$or':_['map'](_0x131997,function(_0x4769dd){if(_0x4769dd[_0x3e99('0x3a')][_0x3e99('0x3b')]!==_0x3e99('0x3c')){var _0x4a536b={};_0x4a536b[_0x4769dd[_0x3e99('0x3d')]]={'$like':'%'+_0x47be62[_0x3e99('0x30')][_0x3e99('0x3e')]+'%'};return _0x4a536b;}})});}_0x46cae0=_[_0x3e99('0x3f')]({},_0x46cae0,_0x47be62[_0x3e99('0x40')]);var _0x2663ac={'where':_0x46cae0[_0x3e99('0x39')]};return db[_0x3e99('0x2c')][_0x3e99('0x17')](_0x2663ac)['then'](function(_0x3a0a04){_0x1df31d[_0x3e99('0x17')]=_0x3a0a04;if(_0x47be62[_0x3e99('0x30')][_0x3e99('0x41')]){_0x46cae0[_0x3e99('0x42')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x3e99('0x43')](_0x46cae0);})[_0x3e99('0x21')](function(_0x1aee1b){_0x1df31d[_0x3e99('0x44')]=_0x1aee1b;return _0x1df31d;})['then'](respondWithFilteredResult(_0x2a1177,_0x46cae0))[_0x3e99('0x45')](handleError(_0x2a1177,null));};exports[_0x3e99('0x46')]=function(_0x313570,_0x881997){var _0x424947={'raw':!![],'where':{'id':_0x313570[_0x3e99('0x47')]['id']}},_0x578c6e={};_0x578c6e[_0x3e99('0x2e')]=_[_0x3e99('0x2f')](db[_0x3e99('0x2c')][_0x3e99('0x2d')]);_0x578c6e['query']=_[_0x3e99('0x2f')](_0x313570[_0x3e99('0x30')]);_0x578c6e[_0x3e99('0x31')]=_[_0x3e99('0x32')](_0x578c6e[_0x3e99('0x2e')],_0x578c6e[_0x3e99('0x30')]);_0x424947['attributes']=_[_0x3e99('0x32')](_0x578c6e[_0x3e99('0x2e')],qs['fields'](_0x313570[_0x3e99('0x30')][_0x3e99('0x34')]));_0x424947[_0x3e99('0x33')]=_0x424947[_0x3e99('0x33')][_0x3e99('0x35')]?_0x424947[_0x3e99('0x33')]:_0x578c6e[_0x3e99('0x2e')];if(_0x313570[_0x3e99('0x30')]['includeAll']){_0x424947[_0x3e99('0x42')]=[{'all':!![]}];}_0x424947=_['merge']({},_0x424947,_0x313570['options']);return db[_0x3e99('0x2c')][_0x3e99('0x48')](_0x424947)['then'](handleEntityNotFound(_0x881997,null))[_0x3e99('0x21')](respondWithResult(_0x881997,null))['catch'](handleError(_0x881997,null));};exports[_0x3e99('0x49')]=function(_0x1f88b6,_0xe6904f){return db[_0x3e99('0x2c')][_0x3e99('0x49')](_0x1f88b6[_0x3e99('0x4a')],{})[_0x3e99('0x21')](function(_0x1f86e0){var _0x352f6c=_0x1f88b6['user']['get']({'plain':!![]});if(!_0x352f6c)throw new Error(_0x3e99('0x4b'));if(_0x352f6c['role']===_0x3e99('0x4c')){var _0x27d9cc=_0x1f86e0['get']({'plain':!![]});var _0xa06921=_0x3e99('0x24');return db[_0x3e99('0x4d')][_0x3e99('0x48')]({'where':{'name':_0xa06921,'userProfileId':_0x352f6c[_0x3e99('0x4e')]},'raw':!![]})[_0x3e99('0x21')](function(_0x2b2564){if(_0x2b2564&&_0x2b2564[_0x3e99('0x4f')]===0x0){return db[_0x3e99('0x25')]['create']({'name':_0x27d9cc['name'],'resourceId':_0x27d9cc['id'],'type':_0x2b2564[_0x3e99('0x29')],'sectionId':_0x2b2564['id']},{})[_0x3e99('0x21')](function(){return _0x1f86e0;});}else{return _0x1f86e0;}})[_0x3e99('0x45')](function(_0x4aa72c){logger[_0x3e99('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4aa72c);throw _0x4aa72c;});}return _0x1f86e0;})[_0x3e99('0x21')](respondWithResult(_0xe6904f,0xc9))['catch'](handleError(_0xe6904f,null));};exports[_0x3e99('0x20')]=function(_0x2bf070,_0x564163){if(_0x2bf070[_0x3e99('0x4a')]['id']){delete _0x2bf070[_0x3e99('0x4a')]['id'];}return db[_0x3e99('0x2c')][_0x3e99('0x48')]({'where':{'id':_0x2bf070[_0x3e99('0x47')]['id']}})[_0x3e99('0x21')](handleEntityNotFound(_0x564163,null))['then'](saveUpdates(_0x2bf070['body'],null))[_0x3e99('0x21')](respondWithResult(_0x564163,null))['catch'](handleError(_0x564163,null));};exports[_0x3e99('0x22')]=function(_0x34a45a,_0x26add7){return db[_0x3e99('0x2c')]['find']({'where':{'id':_0x34a45a[_0x3e99('0x47')]['id']}})[_0x3e99('0x21')](handleEntityNotFound(_0x26add7,null))['then'](removeEntity(_0x26add7,null))[_0x3e99('0x45')](handleError(_0x26add7,null));}; \ No newline at end of file +var _0x1992=['show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','AnalyticMetric','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x1992,0x1a1));var _0x2199=function(_0x2c415d,_0x59f86e){_0x2c415d=_0x2c415d-0x0;var _0x389ce1=_0x1992[_0x2c415d];return _0x389ce1;};'use strict';var pdf=require(_0x2199('0x0'));var emlformat=require(_0x2199('0x1'));var rimraf=require(_0x2199('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2199('0x3'));var rp=require(_0x2199('0x4'));var moment=require('moment');var BPromise=require(_0x2199('0x5'));var Mustache=require(_0x2199('0x6'));var util=require(_0x2199('0x7'));var path=require(_0x2199('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2199('0x9'));var fs=require('fs');var _=require(_0x2199('0xa'));var squel=require(_0x2199('0xb'));var crypto=require(_0x2199('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2199('0xd'));var toCsv=require(_0x2199('0xe'));var querystring=require(_0x2199('0xf'));var Papa=require(_0x2199('0x10'));var Redis=require(_0x2199('0x11'));var authService=require(_0x2199('0x12'));var qs=require(_0x2199('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2199('0x14'))(_0x2199('0x15'));var utils=require(_0x2199('0x16'));var config=require(_0x2199('0x17'));var db=require(_0x2199('0x18'))['db'];function respondWithStatusCode(_0x44ad1d,_0x27756a){_0x27756a=_0x27756a||0xcc;return function(_0x3fc8f0){if(_0x3fc8f0){return _0x44ad1d[_0x2199('0x19')](_0x27756a);}return _0x44ad1d[_0x2199('0x1a')](_0x27756a)[_0x2199('0x1b')]();};}function respondWithResult(_0xf7d4e7,_0x304202){_0x304202=_0x304202||0xc8;return function(_0x140e64){if(_0x140e64){return _0xf7d4e7[_0x2199('0x1a')](_0x304202)['json'](_0x140e64);}};}function respondWithFilteredResult(_0x24ef9,_0x7ba03d){return function(_0x181559){if(_0x181559){var _0x4c9769=_0x181559[_0x2199('0x1c')],_0x5ee14b=_0x7ba03d[_0x2199('0x1d')],_0x39d3f1=_0x7ba03d['offset']+_0x7ba03d[_0x2199('0x1e')],_0x44a31f;if(_0x39d3f1>=_0x4c9769){_0x39d3f1=_0x4c9769;_0x44a31f=0xc8;}else{_0x44a31f=0xce;}_0x24ef9[_0x2199('0x1a')](_0x44a31f);return _0x24ef9['set']('Content-Range',_0x5ee14b+'-'+_0x39d3f1+'/'+_0x4c9769)[_0x2199('0x1f')](_0x181559);}return null;};}function patchUpdates(_0x14a349){return function(_0x3f59b4){try{jsonpatch[_0x2199('0x20')](_0x3f59b4,_0x14a349,!![]);}catch(_0x997a39){return BPromise[_0x2199('0x21')](_0x997a39);}return _0x3f59b4[_0x2199('0x22')]();};}function saveUpdates(_0x315231,_0x31443a){return function(_0x2af7f5){if(_0x2af7f5){return _0x2af7f5[_0x2199('0x23')](_0x315231)['then'](function(_0x4a1951){return _0x4a1951;});}return null;};}function removeEntity(_0x475841,_0x37357b){return function(_0x19c30d){if(_0x19c30d){return _0x19c30d[_0x2199('0x24')]()[_0x2199('0x25')](function(){var _0x20f469=_0x19c30d[_0x2199('0x26')]({'plain':!![]});var _0x57a6a3='Metrics';return db[_0x2199('0x27')]['destroy']({'where':{'type':_0x57a6a3,'resourceId':_0x20f469['id']}})[_0x2199('0x25')](function(){return _0x19c30d;});})[_0x2199('0x25')](function(){_0x475841[_0x2199('0x1a')](0xcc)[_0x2199('0x1b')]();});}};}function handleEntityNotFound(_0x263a7e,_0x572ede){return function(_0x1e7bcd){if(!_0x1e7bcd){_0x263a7e[_0x2199('0x19')](0x194);}return _0x1e7bcd;};}function handleError(_0x1666fa,_0x141439){_0x141439=_0x141439||0x1f4;return function(_0x17bfc1){logger[_0x2199('0x28')](_0x17bfc1[_0x2199('0x29')]);if(_0x17bfc1['name']){delete _0x17bfc1[_0x2199('0x2a')];}_0x1666fa[_0x2199('0x1a')](_0x141439)['send'](_0x17bfc1);};}exports['index']=function(_0x15ceeb,_0x4e5ea0){var _0x1b3617={},_0x2c75d7={},_0x327295={'count':0x0,'rows':[]};var _0x48b80d=db[_0x2199('0x2b')]['rawAttributes'];_0x2c75d7[_0x2199('0x2c')]=_[_0x2199('0x2d')](_0x48b80d);_0x2c75d7[_0x2199('0x2e')]=_[_0x2199('0x2d')](_0x15ceeb[_0x2199('0x2e')]);_0x2c75d7['filters']=_[_0x2199('0x2f')](_0x2c75d7[_0x2199('0x2c')],_0x2c75d7[_0x2199('0x2e')]);_0x1b3617['attributes']=_[_0x2199('0x2f')](_0x2c75d7[_0x2199('0x2c')],qs[_0x2199('0x30')](_0x15ceeb[_0x2199('0x2e')][_0x2199('0x30')]));_0x1b3617[_0x2199('0x31')]=_0x1b3617[_0x2199('0x31')][_0x2199('0x32')]?_0x1b3617[_0x2199('0x31')]:_0x2c75d7['model'];if(!_0x15ceeb['query']['hasOwnProperty'](_0x2199('0x33'))){_0x1b3617[_0x2199('0x1e')]=qs[_0x2199('0x1e')](_0x15ceeb['query'][_0x2199('0x1e')]);_0x1b3617[_0x2199('0x1d')]=qs['offset'](_0x15ceeb['query']['offset']);}_0x1b3617[_0x2199('0x34')]=qs[_0x2199('0x35')](_0x15ceeb[_0x2199('0x2e')]['sort']);_0x1b3617[_0x2199('0x36')]=qs[_0x2199('0x37')](_[_0x2199('0x38')](_0x15ceeb[_0x2199('0x2e')],_0x2c75d7['filters']));if(_0x15ceeb[_0x2199('0x2e')]['filter']){_0x1b3617['where']=_[_0x2199('0x39')](_0x1b3617['where'],{'$or':_[_0x2199('0x3a')](_0x48b80d,function(_0x5582fa){if(_0x5582fa[_0x2199('0x3b')][_0x2199('0x3c')]!==_0x2199('0x3d')){var _0x27a82d={};_0x27a82d[_0x5582fa[_0x2199('0x3e')]]={'$like':'%'+_0x15ceeb[_0x2199('0x2e')]['filter']+'%'};return _0x27a82d;}})});}_0x1b3617=_['merge']({},_0x1b3617,_0x15ceeb[_0x2199('0x3f')]);var _0x54258c={'where':_0x1b3617[_0x2199('0x36')]};return db[_0x2199('0x2b')][_0x2199('0x1c')](_0x54258c)['then'](function(_0x425e99){_0x327295[_0x2199('0x1c')]=_0x425e99;if(_0x15ceeb[_0x2199('0x2e')][_0x2199('0x40')]){_0x1b3617[_0x2199('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x2199('0x42')](_0x1b3617);})[_0x2199('0x25')](function(_0x2aa8a4){_0x327295[_0x2199('0x43')]=_0x2aa8a4;return _0x327295;})[_0x2199('0x25')](respondWithFilteredResult(_0x4e5ea0,_0x1b3617))[_0x2199('0x44')](handleError(_0x4e5ea0,null));};exports[_0x2199('0x45')]=function(_0x35cbea,_0x4e7c14){var _0x1cb7a2={'raw':!![],'where':{'id':_0x35cbea['params']['id']}},_0x48457f={};_0x48457f['model']=_[_0x2199('0x2d')](db[_0x2199('0x2b')][_0x2199('0x46')]);_0x48457f[_0x2199('0x2e')]=_[_0x2199('0x2d')](_0x35cbea[_0x2199('0x2e')]);_0x48457f['filters']=_[_0x2199('0x2f')](_0x48457f[_0x2199('0x2c')],_0x48457f[_0x2199('0x2e')]);_0x1cb7a2[_0x2199('0x31')]=_[_0x2199('0x2f')](_0x48457f[_0x2199('0x2c')],qs['fields'](_0x35cbea[_0x2199('0x2e')]['fields']));_0x1cb7a2[_0x2199('0x31')]=_0x1cb7a2[_0x2199('0x31')]['length']?_0x1cb7a2[_0x2199('0x31')]:_0x48457f['model'];if(_0x35cbea[_0x2199('0x2e')]['includeAll']){_0x1cb7a2[_0x2199('0x41')]=[{'all':!![]}];}_0x1cb7a2=_[_0x2199('0x39')]({},_0x1cb7a2,_0x35cbea[_0x2199('0x3f')]);return db[_0x2199('0x2b')][_0x2199('0x47')](_0x1cb7a2)[_0x2199('0x25')](handleEntityNotFound(_0x4e7c14,null))[_0x2199('0x25')](respondWithResult(_0x4e7c14,null))[_0x2199('0x44')](handleError(_0x4e7c14,null));};exports[_0x2199('0x48')]=function(_0x2d48e4,_0x23b6fc){return db[_0x2199('0x2b')][_0x2199('0x48')](_0x2d48e4['body'],{})[_0x2199('0x25')](function(_0x4ad600){var _0xdad575=_0x2d48e4[_0x2199('0x49')][_0x2199('0x26')]({'plain':!![]});if(!_0xdad575)throw new Error(_0x2199('0x4a'));if(_0xdad575[_0x2199('0x4b')]===_0x2199('0x49')){var _0x45f9ac=_0x4ad600[_0x2199('0x26')]({'plain':!![]});var _0x428679=_0x2199('0x4c');return db[_0x2199('0x4d')][_0x2199('0x47')]({'where':{'name':_0x428679,'userProfileId':_0xdad575['userProfileId']},'raw':!![]})[_0x2199('0x25')](function(_0x1dd758){if(_0x1dd758&&_0x1dd758['autoAssociation']===0x0){return db['UserProfileResource'][_0x2199('0x48')]({'name':_0x45f9ac[_0x2199('0x2a')],'resourceId':_0x45f9ac['id'],'type':_0x1dd758[_0x2199('0x2a')],'sectionId':_0x1dd758['id']},{})[_0x2199('0x25')](function(){return _0x4ad600;});}else{return _0x4ad600;}})[_0x2199('0x44')](function(_0xca151e){logger[_0x2199('0x28')](_0x2199('0x4e'),_0xca151e);throw _0xca151e;});}return _0x4ad600;})['then'](respondWithResult(_0x23b6fc,0xc9))[_0x2199('0x44')](handleError(_0x23b6fc,null));};exports['update']=function(_0x79857e,_0x3d7623){if(_0x79857e[_0x2199('0x4f')]['id']){delete _0x79857e[_0x2199('0x4f')]['id'];}return db[_0x2199('0x2b')][_0x2199('0x47')]({'where':{'id':_0x79857e[_0x2199('0x50')]['id']}})[_0x2199('0x25')](handleEntityNotFound(_0x3d7623,null))[_0x2199('0x25')](saveUpdates(_0x79857e[_0x2199('0x4f')],null))[_0x2199('0x25')](respondWithResult(_0x3d7623,null))['catch'](handleError(_0x3d7623,null));};exports[_0x2199('0x24')]=function(_0x334c17,_0x521e83){return db['AnalyticMetric'][_0x2199('0x47')]({'where':{'id':_0x334c17[_0x2199('0x50')]['id']}})[_0x2199('0x25')](handleEntityNotFound(_0x521e83,null))['then'](removeEntity(_0x521e83,null))['catch'](handleError(_0x521e83,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 8e29a1c..ed333f2 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 _0x10b3=['AnalyticMetric','analytics_metrics','../../config/logger','api','moment','path','rimraf','./analyticMetric.attributes','exports'];(function(_0x1792aa,_0x296e8f){var _0x217c51=function(_0x1ad423){while(--_0x1ad423){_0x1792aa['push'](_0x1792aa['shift']());}};_0x217c51(++_0x296e8f);}(_0x10b3,0x185));var _0x310b=function(_0x354d2f,_0x43c151){_0x354d2f=_0x354d2f-0x0;var _0x5682b3=_0x10b3[_0x354d2f];return _0x5682b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x310b('0x0'))(_0x310b('0x1'));var moment=require(_0x310b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x310b('0x3'));var rimraf=require(_0x310b('0x4'));var config=require('../../config/environment');var attributes=require(_0x310b('0x5'));module[_0x310b('0x6')]=function(_0x5c7e4c,_0x127f6c){return _0x5c7e4c['define'](_0x310b('0x7'),attributes,{'tableName':_0x310b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d01=['api','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger'];(function(_0x575ce6,_0x55b5f1){var _0x3850f3=function(_0x3551cd){while(--_0x3551cd){_0x575ce6['push'](_0x575ce6['shift']());}};_0x3850f3(++_0x55b5f1);}(_0x9d01,0x76));var _0x19d0=function(_0x24a5db,_0x59f9a0){_0x24a5db=_0x24a5db-0x0;var _0x5ef1e4=_0x9d01[_0x24a5db];return _0x5ef1e4;};'use strict';var _=require('lodash');var util=require(_0x19d0('0x0'));var logger=require(_0x19d0('0x1'))(_0x19d0('0x2'));var moment=require('moment');var BPromise=require(_0x19d0('0x3'));var rp=require(_0x19d0('0x4'));var fs=require('fs');var path=require(_0x19d0('0x5'));var rimraf=require('rimraf');var config=require(_0x19d0('0x6'));var attributes=require(_0x19d0('0x7'));module[_0x19d0('0x8')]=function(_0x41ed04,_0x4b9784){return _0x41ed04[_0x19d0('0x9')](_0x19d0('0xa'),attributes,{'tableName':_0x19d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index adc71fb..7502372 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 _0xc2cc=['util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3bd1b6,_0x30a223){var _0xfd386e=function(_0x1b7cf1){while(--_0x1b7cf1){_0x3bd1b6['push'](_0x3bd1b6['shift']());}};_0xfd386e(++_0x30a223);}(_0xc2cc,0x70));var _0xcc2c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc2cc[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xcc2c('0x0'));var moment=require(_0xcc2c('0x1'));var BPromise=require(_0xcc2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc2c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc2c('0x4'));var logger=require('../../config/logger')(_0xcc2c('0x5'));var config=require('../../config/environment');var jayson=require(_0xcc2c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x475a85,_0x4ab837,_0x144b90){return new BPromise(function(_0x5a276f,_0x1d311f){return client['request'](_0x475a85,_0x144b90)['then'](function(_0x2bde97){logger[_0xcc2c('0x7')](_0xcc2c('0x8'),_0x4ab837,_0xcc2c('0x9'));logger[_0xcc2c('0xa')](_0xcc2c('0xb'),_0x4ab837,_0xcc2c('0x9'),JSON[_0xcc2c('0xc')](_0x2bde97));if(_0x2bde97['error']){if(_0x2bde97[_0xcc2c('0xd')]['code']===0x1f4){logger[_0xcc2c('0xd')](_0xcc2c('0x8'),_0x4ab837,_0x2bde97[_0xcc2c('0xd')][_0xcc2c('0xe')]);return _0x1d311f(_0x2bde97['error']['message']);}logger['error'](_0xcc2c('0x8'),_0x4ab837,_0x2bde97[_0xcc2c('0xd')]['message']);return _0x5a276f(_0x2bde97['error'][_0xcc2c('0xe')]);}else{logger['info'](_0xcc2c('0x8'),_0x4ab837,_0xcc2c('0x9'));_0x5a276f(_0x2bde97[_0xcc2c('0xf')][_0xcc2c('0xe')]);}})['catch'](function(_0x5d6189){logger[_0xcc2c('0xd')](_0xcc2c('0x8'),_0x4ab837,_0x5d6189);_0x1d311f(_0x5d6189);});});} \ No newline at end of file +var _0x5447=['then','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0x5447,0xf1));var _0x7544=function(_0x6f758,_0x1c34f5){_0x6f758=_0x6f758-0x0;var _0x26ca8b=_0x5447[_0x6f758];return _0x26ca8b;};'use strict';var _=require(_0x7544('0x0'));var util=require('util');var moment=require(_0x7544('0x1'));var BPromise=require(_0x7544('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7544('0x4'));var logger=require(_0x7544('0x5'))(_0x7544('0x6'));var config=require(_0x7544('0x7'));var jayson=require(_0x7544('0x8'));var client=jayson[_0x7544('0x9')][_0x7544('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22d5e4,_0x77d91e,_0x1201c8){return new BPromise(function(_0x2137ab,_0x546d79){return client[_0x7544('0xb')](_0x22d5e4,_0x1201c8)[_0x7544('0xc')](function(_0x1126cb){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x77d91e,'request\x20sent');logger[_0x7544('0xd')](_0x7544('0xe'),_0x77d91e,_0x7544('0xf'),JSON[_0x7544('0x10')](_0x1126cb));if(_0x1126cb[_0x7544('0x11')]){if(_0x1126cb[_0x7544('0x11')][_0x7544('0x12')]===0x1f4){logger[_0x7544('0x11')](_0x7544('0x13'),_0x77d91e,_0x1126cb[_0x7544('0x11')]['message']);return _0x546d79(_0x1126cb[_0x7544('0x11')]['message']);}logger[_0x7544('0x11')](_0x7544('0x13'),_0x77d91e,_0x1126cb['error'][_0x7544('0x14')]);return _0x2137ab(_0x1126cb[_0x7544('0x11')][_0x7544('0x14')]);}else{logger[_0x7544('0x15')](_0x7544('0x13'),_0x77d91e,_0x7544('0xf'));_0x2137ab(_0x1126cb[_0x7544('0x16')][_0x7544('0x14')]);}})['catch'](function(_0x1e60d2){logger[_0x7544('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x77d91e,_0x1e60d2);_0x546d79(_0x1e60d2);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 52296d4..48114df 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 _0x236c=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','put','update','delete','/:id'];(function(_0x1b2a2,_0x2ad8b4){var _0x5beebb=function(_0x15296a){while(--_0x15296a){_0x1b2a2['push'](_0x1b2a2['shift']());}};_0x5beebb(++_0x2ad8b4);}(_0x236c,0x155));var _0xc236=function(_0x1589d9,_0x456896){_0x1589d9=_0x1589d9-0x0;var _0x4e15e9=_0x236c[_0x1589d9];return _0x4e15e9;};'use strict';var multer=require(_0xc236('0x0'));var util=require('util');var path=require(_0xc236('0x1'));var timeout=require(_0xc236('0x2'));var express=require(_0xc236('0x3'));var router=express[_0xc236('0x4')]();var auth=require(_0xc236('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc236('0x6'));var controller=require(_0xc236('0x7'));router[_0xc236('0x8')]('/',auth[_0xc236('0x9')](),controller[_0xc236('0xa')]);router[_0xc236('0x8')]('/:id',auth[_0xc236('0x9')](),controller[_0xc236('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc236('0xc')]('/:id',auth[_0xc236('0x9')](),controller[_0xc236('0xd')]);router[_0xc236('0xe')](_0xc236('0xf'),auth[_0xc236('0x9')](),controller['destroy']);module[_0xc236('0x10')]=router; \ No newline at end of file +var _0x1189=['post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show'];(function(_0x34b8b4,_0x2bfb01){var _0x3a3623=function(_0x901470){while(--_0x901470){_0x34b8b4['push'](_0x34b8b4['shift']());}};_0x3a3623(++_0x2bfb01);}(_0x1189,0x17f));var _0x9118=function(_0xbc9d65,_0x212f3a){_0xbc9d65=_0xbc9d65-0x0;var _0x567123=_0x1189[_0xbc9d65];return _0x567123;};'use strict';var multer=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var path=require(_0x9118('0x2'));var timeout=require(_0x9118('0x3'));var express=require('express');var router=express[_0x9118('0x4')]();var auth=require(_0x9118('0x5'));var interaction=require(_0x9118('0x6'));var config=require(_0x9118('0x7'));var controller=require(_0x9118('0x8'));router[_0x9118('0x9')]('/',auth[_0x9118('0xa')](),controller['index']);router[_0x9118('0x9')](_0x9118('0xb'),auth[_0x9118('0xa')](),controller[_0x9118('0xc')]);router[_0x9118('0xd')]('/',auth[_0x9118('0xa')](),controller['create']);router[_0x9118('0xe')](_0x9118('0xb'),auth[_0x9118('0xa')](),controller[_0x9118('0xf')]);router[_0x9118('0x10')](_0x9118('0xb'),auth[_0x9118('0xa')](),controller['destroy']);module[_0x9118('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 a0c5121..6c7c741 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 _0xd79c=['exports','sequelize'];(function(_0x452142,_0x4f5719){var _0x1e91da=function(_0x2dd237){while(--_0x2dd237){_0x452142['push'](_0x452142['shift']());}};_0x1e91da(++_0x4f5719);}(_0xd79c,0xa1));var _0xcd79=function(_0xae76aa,_0x2b38dd){_0xae76aa=_0xae76aa-0x0;var _0x267cf3=_0xd79c[_0xae76aa];return _0x267cf3;};'use strict';var Sequelize=require(_0xcd79('0x0'));module[_0xcd79('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x6cc7=['TEXT'];(function(_0x540c8e,_0xb00bdb){var _0x33b7f3=function(_0x5881ef){while(--_0x5881ef){_0x540c8e['push'](_0x540c8e['shift']());}};_0x33b7f3(++_0xb00bdb);}(_0x6cc7,0x1f3));var _0x76cc=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x6cc7[_0x4226d6];return _0x19655b;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x76cc('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 375aff0..3e0e1dd 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 _0x0c1e=['sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','field','filter','options','includeAll','include','findAll','catch','show','params','find','create','update','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x5ca234,_0x956d01){var _0x49f1a7=function(_0x944a21){while(--_0x944a21){_0x5ca234['push'](_0x5ca234['shift']());}};_0x49f1a7(++_0x956d01);}(_0x0c1e,0x1e8));var _0xe0c1=function(_0x2281fc,_0x1f3a0d){_0x2281fc=_0x2281fc-0x0;var _0x1cd1b9=_0x0c1e[_0x2281fc];return _0x1cd1b9;};'use strict';var pdf=require(_0xe0c1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0c1('0x1'));var zipdir=require(_0xe0c1('0x2'));var jsonpatch=require(_0xe0c1('0x3'));var rp=require(_0xe0c1('0x4'));var moment=require(_0xe0c1('0x5'));var BPromise=require(_0xe0c1('0x6'));var Mustache=require('mustache');var util=require(_0xe0c1('0x7'));var path=require(_0xe0c1('0x8'));var sox=require(_0xe0c1('0x9'));var csv=require(_0xe0c1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe0c1('0xb'));var squel=require(_0xe0c1('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0c1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe0c1('0xa'));var querystring=require(_0xe0c1('0xe'));var Papa=require(_0xe0c1('0xf'));var Redis=require('ioredis');var authService=require(_0xe0c1('0x10'));var qs=require(_0xe0c1('0x11'));var hardwareService=require(_0xe0c1('0x12'));var logger=require(_0xe0c1('0x13'))(_0xe0c1('0x14'));var utils=require('../../config/utils');var config=require(_0xe0c1('0x15'));var db=require(_0xe0c1('0x16'))['db'];function respondWithStatusCode(_0x13ed5f,_0x4493ba){_0x4493ba=_0x4493ba||0xcc;return function(_0x5af456){if(_0x5af456){return _0x13ed5f[_0xe0c1('0x17')](_0x4493ba);}return _0x13ed5f[_0xe0c1('0x18')](_0x4493ba)[_0xe0c1('0x19')]();};}function respondWithResult(_0x14d0de,_0x398667){_0x398667=_0x398667||0xc8;return function(_0x1a7dc0){if(_0x1a7dc0){return _0x14d0de[_0xe0c1('0x18')](_0x398667)[_0xe0c1('0x1a')](_0x1a7dc0);}};}function respondWithFilteredResult(_0x396863,_0xf73464){return function(_0x2b2fbb){if(_0x2b2fbb){var _0x205eba=_0x2b2fbb[_0xe0c1('0x1b')],_0x3c7e65=_0xf73464[_0xe0c1('0x1c')],_0x3dcc93=_0xf73464['offset']+_0xf73464[_0xe0c1('0x1d')],_0x638585;if(_0x3dcc93>=_0x205eba){_0x3dcc93=_0x205eba;_0x638585=0xc8;}else{_0x638585=0xce;}_0x396863[_0xe0c1('0x18')](_0x638585);return _0x396863[_0xe0c1('0x1e')]('Content-Range',_0x3c7e65+'-'+_0x3dcc93+'/'+_0x205eba)[_0xe0c1('0x1a')](_0x2b2fbb);}return null;};}function patchUpdates(_0x2dc277){return function(_0x50ca42){try{jsonpatch[_0xe0c1('0x1f')](_0x50ca42,_0x2dc277,!![]);}catch(_0x58d373){return BPromise[_0xe0c1('0x20')](_0x58d373);}return _0x50ca42[_0xe0c1('0x21')]();};}function saveUpdates(_0x44b9f6,_0x23fa04){return function(_0x23a0f4){if(_0x23a0f4){return _0x23a0f4['update'](_0x44b9f6)[_0xe0c1('0x22')](function(_0x38fe52){return _0x38fe52;});}return null;};}function removeEntity(_0x1c920a,_0x19cc01){return function(_0x59ad98){if(_0x59ad98){return _0x59ad98['destroy']()[_0xe0c1('0x22')](function(){_0x1c920a[_0xe0c1('0x18')](0xcc)[_0xe0c1('0x19')]();});}};}function handleEntityNotFound(_0x3ed511,_0x4770f6){return function(_0x19a516){if(!_0x19a516){_0x3ed511['sendStatus'](0x194);}return _0x19a516;};}function handleError(_0x17d170,_0x2cf213){_0x2cf213=_0x2cf213||0x1f4;return function(_0x48be5e){logger[_0xe0c1('0x23')](_0x48be5e[_0xe0c1('0x24')]);if(_0x48be5e[_0xe0c1('0x25')]){delete _0x48be5e[_0xe0c1('0x25')];}_0x17d170[_0xe0c1('0x18')](_0x2cf213)[_0xe0c1('0x26')](_0x48be5e);};}exports[_0xe0c1('0x27')]=function(_0x321639,_0x2830d3){var _0x4a5d0a={},_0x348fd2={},_0x4435f1={'count':0x0,'rows':[]};var _0x12fd8f=db[_0xe0c1('0x28')][_0xe0c1('0x29')];_0x348fd2[_0xe0c1('0x2a')]=_[_0xe0c1('0x2b')](_0x12fd8f);_0x348fd2['query']=_[_0xe0c1('0x2b')](_0x321639[_0xe0c1('0x2c')]);_0x348fd2[_0xe0c1('0x2d')]=_[_0xe0c1('0x2e')](_0x348fd2[_0xe0c1('0x2a')],_0x348fd2[_0xe0c1('0x2c')]);_0x4a5d0a[_0xe0c1('0x2f')]=_[_0xe0c1('0x2e')](_0x348fd2[_0xe0c1('0x2a')],qs[_0xe0c1('0x30')](_0x321639[_0xe0c1('0x2c')]['fields']));_0x4a5d0a[_0xe0c1('0x2f')]=_0x4a5d0a[_0xe0c1('0x2f')][_0xe0c1('0x31')]?_0x4a5d0a[_0xe0c1('0x2f')]:_0x348fd2[_0xe0c1('0x2a')];if(!_0x321639[_0xe0c1('0x2c')][_0xe0c1('0x32')](_0xe0c1('0x33'))){_0x4a5d0a[_0xe0c1('0x1d')]=qs[_0xe0c1('0x1d')](_0x321639[_0xe0c1('0x2c')][_0xe0c1('0x1d')]);_0x4a5d0a[_0xe0c1('0x1c')]=qs[_0xe0c1('0x1c')](_0x321639[_0xe0c1('0x2c')][_0xe0c1('0x1c')]);}_0x4a5d0a[_0xe0c1('0x34')]=qs[_0xe0c1('0x35')](_0x321639[_0xe0c1('0x2c')][_0xe0c1('0x35')]);_0x4a5d0a[_0xe0c1('0x36')]=qs[_0xe0c1('0x2d')](_[_0xe0c1('0x37')](_0x321639['query'],_0x348fd2[_0xe0c1('0x2d')]));if(_0x321639[_0xe0c1('0x2c')]['filter']){_0x4a5d0a['where']=_[_0xe0c1('0x38')](_0x4a5d0a[_0xe0c1('0x36')],{'$or':_[_0xe0c1('0x39')](_0x12fd8f,function(_0x882951){if(_0x882951[_0xe0c1('0x3a')][_0xe0c1('0x3b')]!=='VIRTUAL'){var _0x1250c2={};_0x1250c2[_0x882951[_0xe0c1('0x3c')]]={'$like':'%'+_0x321639[_0xe0c1('0x2c')][_0xe0c1('0x3d')]+'%'};return _0x1250c2;}})});}_0x4a5d0a=_[_0xe0c1('0x38')]({},_0x4a5d0a,_0x321639[_0xe0c1('0x3e')]);var _0x48e1c7={'where':_0x4a5d0a[_0xe0c1('0x36')]};return db[_0xe0c1('0x28')][_0xe0c1('0x1b')](_0x48e1c7)[_0xe0c1('0x22')](function(_0x1838ae){_0x4435f1[_0xe0c1('0x1b')]=_0x1838ae;if(_0x321639[_0xe0c1('0x2c')][_0xe0c1('0x3f')]){_0x4a5d0a[_0xe0c1('0x40')]=[{'all':!![]}];}return db[_0xe0c1('0x28')][_0xe0c1('0x41')](_0x4a5d0a);})[_0xe0c1('0x22')](function(_0x238ee9){_0x4435f1['rows']=_0x238ee9;return _0x4435f1;})[_0xe0c1('0x22')](respondWithFilteredResult(_0x2830d3,_0x4a5d0a))[_0xe0c1('0x42')](handleError(_0x2830d3,null));};exports[_0xe0c1('0x43')]=function(_0x539d85,_0x5c3711){var _0x12b01b={'raw':!![],'where':{'id':_0x539d85[_0xe0c1('0x44')]['id']}},_0x6b4fa5={};_0x6b4fa5[_0xe0c1('0x2a')]=_[_0xe0c1('0x2b')](db[_0xe0c1('0x28')][_0xe0c1('0x29')]);_0x6b4fa5['query']=_[_0xe0c1('0x2b')](_0x539d85[_0xe0c1('0x2c')]);_0x6b4fa5[_0xe0c1('0x2d')]=_['intersection'](_0x6b4fa5[_0xe0c1('0x2a')],_0x6b4fa5[_0xe0c1('0x2c')]);_0x12b01b['attributes']=_[_0xe0c1('0x2e')](_0x6b4fa5[_0xe0c1('0x2a')],qs[_0xe0c1('0x30')](_0x539d85['query'][_0xe0c1('0x30')]));_0x12b01b[_0xe0c1('0x2f')]=_0x12b01b[_0xe0c1('0x2f')]['length']?_0x12b01b[_0xe0c1('0x2f')]:_0x6b4fa5['model'];if(_0x539d85[_0xe0c1('0x2c')][_0xe0c1('0x3f')]){_0x12b01b['include']=[{'all':!![]}];}_0x12b01b=_[_0xe0c1('0x38')]({},_0x12b01b,_0x539d85[_0xe0c1('0x3e')]);return db['AnalyticTreeReport'][_0xe0c1('0x45')](_0x12b01b)[_0xe0c1('0x22')](handleEntityNotFound(_0x5c3711,null))[_0xe0c1('0x22')](respondWithResult(_0x5c3711,null))[_0xe0c1('0x42')](handleError(_0x5c3711,null));};exports[_0xe0c1('0x46')]=function(_0x68ece5,_0x5e0877){return db['AnalyticTreeReport'][_0xe0c1('0x46')](_0x68ece5['body'],{})[_0xe0c1('0x22')](respondWithResult(_0x5e0877,0xc9))[_0xe0c1('0x42')](handleError(_0x5e0877,null));};exports[_0xe0c1('0x47')]=function(_0x25db52,_0x280c75){if(_0x25db52[_0xe0c1('0x48')]['id']){delete _0x25db52['body']['id'];}return db[_0xe0c1('0x28')]['find']({'where':{'id':_0x25db52['params']['id']}})[_0xe0c1('0x22')](handleEntityNotFound(_0x280c75,null))[_0xe0c1('0x22')](saveUpdates(_0x25db52[_0xe0c1('0x48')],null))['then'](respondWithResult(_0x280c75,null))[_0xe0c1('0x42')](handleError(_0x280c75,null));};exports['destroy']=function(_0x6f21c9,_0x489d13){return db[_0xe0c1('0x28')]['find']({'where':{'id':_0x6f21c9[_0xe0c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x489d13,null))[_0xe0c1('0x22')](removeEntity(_0x489d13,null))[_0xe0c1('0x42')](handleError(_0x489d13,null));}; \ No newline at end of file +var _0x0fd5=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','then','error','stack','name','send','AnalyticTreeReport','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','type','key','VIRTUAL','options','include','findAll','catch','params','intersection','length','includeAll','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel'];(function(_0xb57075,_0x540322){var _0x2fb26f=function(_0x2cdd52){while(--_0x2cdd52){_0xb57075['push'](_0xb57075['shift']());}};_0x2fb26f(++_0x540322);}(_0x0fd5,0x7b));var _0x50fd=function(_0x53045d,_0xb3467c){_0x53045d=_0x53045d-0x0;var _0x20baea=_0x0fd5[_0x53045d];return _0x20baea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x50fd('0x0'));var rimraf=require(_0x50fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50fd('0x2'));var rp=require(_0x50fd('0x3'));var moment=require(_0x50fd('0x4'));var BPromise=require(_0x50fd('0x5'));var Mustache=require(_0x50fd('0x6'));var util=require(_0x50fd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x50fd('0x8'));var ejs=require(_0x50fd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x50fd('0xa'));var crypto=require(_0x50fd('0xb'));var jsforce=require(_0x50fd('0xc'));var deskjs=require(_0x50fd('0xd'));var toCsv=require(_0x50fd('0x8'));var querystring=require('querystring');var Papa=require(_0x50fd('0xe'));var Redis=require(_0x50fd('0xf'));var authService=require(_0x50fd('0x10'));var qs=require(_0x50fd('0x11'));var hardwareService=require(_0x50fd('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x50fd('0x13'));var config=require(_0x50fd('0x14'));var db=require(_0x50fd('0x15'))['db'];function respondWithStatusCode(_0x3a8a3d,_0x65f140){_0x65f140=_0x65f140||0xcc;return function(_0x4e6917){if(_0x4e6917){return _0x3a8a3d[_0x50fd('0x16')](_0x65f140);}return _0x3a8a3d[_0x50fd('0x17')](_0x65f140)[_0x50fd('0x18')]();};}function respondWithResult(_0x32bafc,_0x494de1){_0x494de1=_0x494de1||0xc8;return function(_0x25a792){if(_0x25a792){return _0x32bafc[_0x50fd('0x17')](_0x494de1)[_0x50fd('0x19')](_0x25a792);}};}function respondWithFilteredResult(_0x3c1926,_0x19fe82){return function(_0x29a7df){if(_0x29a7df){var _0x4c795e=_0x29a7df[_0x50fd('0x1a')],_0x4449b4=_0x19fe82[_0x50fd('0x1b')],_0x5d24a2=_0x19fe82[_0x50fd('0x1b')]+_0x19fe82['limit'],_0x5b1146;if(_0x5d24a2>=_0x4c795e){_0x5d24a2=_0x4c795e;_0x5b1146=0xc8;}else{_0x5b1146=0xce;}_0x3c1926[_0x50fd('0x17')](_0x5b1146);return _0x3c1926['set']('Content-Range',_0x4449b4+'-'+_0x5d24a2+'/'+_0x4c795e)[_0x50fd('0x19')](_0x29a7df);}return null;};}function patchUpdates(_0x2c8c37){return function(_0x19df75){try{jsonpatch[_0x50fd('0x1c')](_0x19df75,_0x2c8c37,!![]);}catch(_0x2f4eb7){return BPromise[_0x50fd('0x1d')](_0x2f4eb7);}return _0x19df75[_0x50fd('0x1e')]();};}function saveUpdates(_0xba2af9,_0x636f7f){return function(_0x4a6037){if(_0x4a6037){return _0x4a6037['update'](_0xba2af9)[_0x50fd('0x1f')](function(_0x30c48f){return _0x30c48f;});}return null;};}function removeEntity(_0x1cc78b,_0x1b9a1d){return function(_0x1edc64){if(_0x1edc64){return _0x1edc64['destroy']()['then'](function(){_0x1cc78b[_0x50fd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d3b65,_0x24995b){return function(_0x5d25b9){if(!_0x5d25b9){_0x3d3b65[_0x50fd('0x16')](0x194);}return _0x5d25b9;};}function handleError(_0x317093,_0x2e68ca){_0x2e68ca=_0x2e68ca||0x1f4;return function(_0x532ffe){logger[_0x50fd('0x20')](_0x532ffe[_0x50fd('0x21')]);if(_0x532ffe[_0x50fd('0x22')]){delete _0x532ffe[_0x50fd('0x22')];}_0x317093[_0x50fd('0x17')](_0x2e68ca)[_0x50fd('0x23')](_0x532ffe);};}exports['index']=function(_0x16d62b,_0x4794b4){var _0xa2943c={},_0x46b992={},_0x5bc8a6={'count':0x0,'rows':[]};var _0x5f1a94=db[_0x50fd('0x24')][_0x50fd('0x25')];_0x46b992[_0x50fd('0x26')]=_[_0x50fd('0x27')](_0x5f1a94);_0x46b992[_0x50fd('0x28')]=_[_0x50fd('0x27')](_0x16d62b['query']);_0x46b992[_0x50fd('0x29')]=_['intersection'](_0x46b992[_0x50fd('0x26')],_0x46b992[_0x50fd('0x28')]);_0xa2943c[_0x50fd('0x2a')]=_['intersection'](_0x46b992[_0x50fd('0x26')],qs[_0x50fd('0x2b')](_0x16d62b[_0x50fd('0x28')][_0x50fd('0x2b')]));_0xa2943c[_0x50fd('0x2a')]=_0xa2943c[_0x50fd('0x2a')]['length']?_0xa2943c[_0x50fd('0x2a')]:_0x46b992['model'];if(!_0x16d62b[_0x50fd('0x28')][_0x50fd('0x2c')](_0x50fd('0x2d'))){_0xa2943c[_0x50fd('0x2e')]=qs[_0x50fd('0x2e')](_0x16d62b[_0x50fd('0x28')]['limit']);_0xa2943c['offset']=qs[_0x50fd('0x1b')](_0x16d62b[_0x50fd('0x28')][_0x50fd('0x1b')]);}_0xa2943c[_0x50fd('0x2f')]=qs['sort'](_0x16d62b[_0x50fd('0x28')]['sort']);_0xa2943c[_0x50fd('0x30')]=qs[_0x50fd('0x29')](_[_0x50fd('0x31')](_0x16d62b[_0x50fd('0x28')],_0x46b992['filters']));if(_0x16d62b[_0x50fd('0x28')][_0x50fd('0x32')]){_0xa2943c[_0x50fd('0x30')]=_[_0x50fd('0x33')](_0xa2943c[_0x50fd('0x30')],{'$or':_['map'](_0x5f1a94,function(_0x5cecbb){if(_0x5cecbb[_0x50fd('0x34')][_0x50fd('0x35')]!==_0x50fd('0x36')){var _0x30e788={};_0x30e788[_0x5cecbb['field']]={'$like':'%'+_0x16d62b[_0x50fd('0x28')][_0x50fd('0x32')]+'%'};return _0x30e788;}})});}_0xa2943c=_[_0x50fd('0x33')]({},_0xa2943c,_0x16d62b[_0x50fd('0x37')]);var _0x1552d4={'where':_0xa2943c[_0x50fd('0x30')]};return db[_0x50fd('0x24')]['count'](_0x1552d4)[_0x50fd('0x1f')](function(_0x213415){_0x5bc8a6[_0x50fd('0x1a')]=_0x213415;if(_0x16d62b[_0x50fd('0x28')]['includeAll']){_0xa2943c[_0x50fd('0x38')]=[{'all':!![]}];}return db[_0x50fd('0x24')][_0x50fd('0x39')](_0xa2943c);})[_0x50fd('0x1f')](function(_0x20e8d5){_0x5bc8a6['rows']=_0x20e8d5;return _0x5bc8a6;})[_0x50fd('0x1f')](respondWithFilteredResult(_0x4794b4,_0xa2943c))[_0x50fd('0x3a')](handleError(_0x4794b4,null));};exports['show']=function(_0x3bb12e,_0x3249bd){var _0x421e94={'raw':!![],'where':{'id':_0x3bb12e[_0x50fd('0x3b')]['id']}},_0x405bd5={};_0x405bd5[_0x50fd('0x26')]=_['keys'](db[_0x50fd('0x24')][_0x50fd('0x25')]);_0x405bd5[_0x50fd('0x28')]=_[_0x50fd('0x27')](_0x3bb12e[_0x50fd('0x28')]);_0x405bd5[_0x50fd('0x29')]=_[_0x50fd('0x3c')](_0x405bd5['model'],_0x405bd5[_0x50fd('0x28')]);_0x421e94[_0x50fd('0x2a')]=_[_0x50fd('0x3c')](_0x405bd5['model'],qs[_0x50fd('0x2b')](_0x3bb12e[_0x50fd('0x28')][_0x50fd('0x2b')]));_0x421e94[_0x50fd('0x2a')]=_0x421e94[_0x50fd('0x2a')][_0x50fd('0x3d')]?_0x421e94[_0x50fd('0x2a')]:_0x405bd5[_0x50fd('0x26')];if(_0x3bb12e[_0x50fd('0x28')][_0x50fd('0x3e')]){_0x421e94['include']=[{'all':!![]}];}_0x421e94=_[_0x50fd('0x33')]({},_0x421e94,_0x3bb12e[_0x50fd('0x37')]);return db[_0x50fd('0x24')]['find'](_0x421e94)[_0x50fd('0x1f')](handleEntityNotFound(_0x3249bd,null))['then'](respondWithResult(_0x3249bd,null))['catch'](handleError(_0x3249bd,null));};exports['create']=function(_0x1b645d,_0x2b6212){return db[_0x50fd('0x24')][_0x50fd('0x3f')](_0x1b645d[_0x50fd('0x40')],{})['then'](respondWithResult(_0x2b6212,0xc9))[_0x50fd('0x3a')](handleError(_0x2b6212,null));};exports[_0x50fd('0x41')]=function(_0xeac03e,_0xff269b){if(_0xeac03e[_0x50fd('0x40')]['id']){delete _0xeac03e[_0x50fd('0x40')]['id'];}return db[_0x50fd('0x24')][_0x50fd('0x42')]({'where':{'id':_0xeac03e[_0x50fd('0x3b')]['id']}})[_0x50fd('0x1f')](handleEntityNotFound(_0xff269b,null))[_0x50fd('0x1f')](saveUpdates(_0xeac03e[_0x50fd('0x40')],null))[_0x50fd('0x1f')](respondWithResult(_0xff269b,null))[_0x50fd('0x3a')](handleError(_0xff269b,null));};exports['destroy']=function(_0x42662c,_0x2ddd25){return db[_0x50fd('0x24')][_0x50fd('0x42')]({'where':{'id':_0x42662c['params']['id']}})['then'](handleEntityNotFound(_0x2ddd25,null))[_0x50fd('0x1f')](removeEntity(_0x2ddd25,null))[_0x50fd('0x3a')](handleError(_0x2ddd25,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 102a42c..aa2f41b 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 _0x7e53=['analytics_report_trees','util','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x175d1b,_0x27db49){var _0xf23e62=function(_0x31b334){while(--_0x31b334){_0x175d1b['push'](_0x175d1b['shift']());}};_0xf23e62(++_0x27db49);}(_0x7e53,0x8d));var _0x37e5=function(_0x439270,_0x6bf2aa){_0x439270=_0x439270-0x0;var _0x43062c=_0x7e53[_0x439270];return _0x43062c;};'use strict';var _=require('lodash');var util=require(_0x37e5('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x37e5('0x1'));var rp=require(_0x37e5('0x2'));var fs=require('fs');var path=require(_0x37e5('0x3'));var rimraf=require('rimraf');var config=require(_0x37e5('0x4'));var attributes=require(_0x37e5('0x5'));module[_0x37e5('0x6')]=function(_0xc53cc2,_0x1b39fe){return _0xc53cc2[_0x37e5('0x7')](_0x37e5('0x8'),attributes,{'tableName':_0x37e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd50a=['../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','util','api','moment','bluebird','path','rimraf'];(function(_0x2c020f,_0x1c0195){var _0x10f960=function(_0x4a843f){while(--_0x4a843f){_0x2c020f['push'](_0x2c020f['shift']());}};_0x10f960(++_0x1c0195);}(_0xd50a,0x18a));var _0xad50=function(_0x24e8bb,_0x56bc48){_0x24e8bb=_0x24e8bb-0x0;var _0x5b15be=_0xd50a[_0x24e8bb];return _0x5b15be;};'use strict';var _=require('lodash');var util=require(_0xad50('0x0'));var logger=require('../../config/logger')(_0xad50('0x1'));var moment=require(_0xad50('0x2'));var BPromise=require(_0xad50('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad50('0x4'));var rimraf=require(_0xad50('0x5'));var config=require(_0xad50('0x6'));var attributes=require(_0xad50('0x7'));module['exports']=function(_0x3730b2,_0x45a31f){return _0x3730b2['define'](_0xad50('0x8'),attributes,{'tableName':_0xad50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 87a88a1..60c639f 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 _0xd5b0=['../../config/logger','rpc','jayson/promise','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x21139b,_0x43f239){var _0x680d6=function(_0x58092d){while(--_0x58092d){_0x21139b['push'](_0x21139b['shift']());}};_0x680d6(++_0x43f239);}(_0xd5b0,0x12e));var _0x0d5b=function(_0x21c617,_0x24a5e5){_0x21c617=_0x21c617-0x0;var _0x26e39e=_0xd5b0[_0x21c617];return _0x26e39e;};'use strict';var _=require(_0x0d5b('0x0'));var util=require(_0x0d5b('0x1'));var moment=require(_0x0d5b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d5b('0x3'));var db=require(_0x0d5b('0x4'))['db'];var utils=require(_0x0d5b('0x5'));var logger=require(_0x0d5b('0x6'))(_0x0d5b('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d5b('0x8'));var client=jayson['client'][_0x0d5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a8742,_0x293364,_0x6e359d){return new BPromise(function(_0x6f2fc0,_0x5a794f){return client[_0x0d5b('0xa')](_0x2a8742,_0x6e359d)[_0x0d5b('0xb')](function(_0x395dd4){logger['info'](_0x0d5b('0xc'),_0x293364,'request\x20sent');logger[_0x0d5b('0xd')](_0x0d5b('0xe'),_0x293364,'request\x20sent',JSON[_0x0d5b('0xf')](_0x395dd4));if(_0x395dd4[_0x0d5b('0x10')]){if(_0x395dd4[_0x0d5b('0x10')][_0x0d5b('0x11')]===0x1f4){logger[_0x0d5b('0x10')](_0x0d5b('0xc'),_0x293364,_0x395dd4[_0x0d5b('0x10')][_0x0d5b('0x12')]);return _0x5a794f(_0x395dd4['error']['message']);}logger[_0x0d5b('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x293364,_0x395dd4[_0x0d5b('0x10')][_0x0d5b('0x12')]);return _0x6f2fc0(_0x395dd4[_0x0d5b('0x10')][_0x0d5b('0x12')]);}else{logger[_0x0d5b('0x13')](_0x0d5b('0xc'),_0x293364,_0x0d5b('0x14'));_0x6f2fc0(_0x395dd4['result'][_0x0d5b('0x12')]);}})[_0x0d5b('0x15')](function(_0x184f9f){logger[_0x0d5b('0x10')](_0x0d5b('0xc'),_0x293364,_0x184f9f);_0x5a794f(_0x184f9f);});});} \ No newline at end of file +var _0xfe26=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash'];(function(_0xcfc18e,_0x1f47c1){var _0x49dd7d=function(_0x3c4860){while(--_0x3c4860){_0xcfc18e['push'](_0xcfc18e['shift']());}};_0x49dd7d(++_0x1f47c1);}(_0xfe26,0x137));var _0x6fe2=function(_0x327057,_0x21d264){_0x327057=_0x327057-0x0;var _0x23345b=_0xfe26[_0x327057];return _0x23345b;};'use strict';var _=require(_0x6fe2('0x0'));var util=require(_0x6fe2('0x1'));var moment=require(_0x6fe2('0x2'));var BPromise=require(_0x6fe2('0x3'));var rs=require(_0x6fe2('0x4'));var fs=require('fs');var Redis=require(_0x6fe2('0x5'));var db=require(_0x6fe2('0x6'))['db'];var utils=require(_0x6fe2('0x7'));var logger=require(_0x6fe2('0x8'))(_0x6fe2('0x9'));var config=require(_0x6fe2('0xa'));var jayson=require(_0x6fe2('0xb'));var client=jayson[_0x6fe2('0xc')][_0x6fe2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5323db,_0xfb19b8,_0xea00ef){return new BPromise(function(_0x1d0ee7,_0x286574){return client['request'](_0x5323db,_0xea00ef)[_0x6fe2('0xe')](function(_0x243a8c){logger[_0x6fe2('0xf')](_0x6fe2('0x10'),_0xfb19b8,'request\x20sent');logger[_0x6fe2('0x11')](_0x6fe2('0x12'),_0xfb19b8,'request\x20sent',JSON[_0x6fe2('0x13')](_0x243a8c));if(_0x243a8c['error']){if(_0x243a8c[_0x6fe2('0x14')]['code']===0x1f4){logger['error'](_0x6fe2('0x10'),_0xfb19b8,_0x243a8c[_0x6fe2('0x14')]['message']);return _0x286574(_0x243a8c[_0x6fe2('0x14')][_0x6fe2('0x15')]);}logger[_0x6fe2('0x14')](_0x6fe2('0x10'),_0xfb19b8,_0x243a8c[_0x6fe2('0x14')][_0x6fe2('0x15')]);return _0x1d0ee7(_0x243a8c[_0x6fe2('0x14')][_0x6fe2('0x15')]);}else{logger[_0x6fe2('0xf')](_0x6fe2('0x10'),_0xfb19b8,_0x6fe2('0x16'));_0x1d0ee7(_0x243a8c['result'][_0x6fe2('0x15')]);}})[_0x6fe2('0x17')](function(_0x3c6f12){logger[_0x6fe2('0x14')](_0x6fe2('0x10'),_0xfb19b8,_0x3c6f12);_0x286574(_0x3c6f12);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 67dd794..c710891 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 _0xb981=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xb981,0x154));var _0x1b98=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0xb981[_0x5ff517];return _0x19a245;};'use strict';var multer=require(_0x1b98('0x0'));var util=require(_0x1b98('0x1'));var path=require(_0x1b98('0x2'));var timeout=require(_0x1b98('0x3'));var express=require(_0x1b98('0x4'));var router=express['Router']();var auth=require(_0x1b98('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1b98('0x6'));var controller=require(_0x1b98('0x7'));router[_0x1b98('0x8')]('/',auth[_0x1b98('0x9')](),controller[_0x1b98('0xa')]);router[_0x1b98('0x8')]('/:id',auth[_0x1b98('0x9')](),controller[_0x1b98('0xb')]);router[_0x1b98('0xc')]('/',auth[_0x1b98('0x9')](),controller[_0x1b98('0xd')]);router[_0x1b98('0xe')](_0x1b98('0xf'),auth[_0x1b98('0x9')](),controller['update']);router[_0x1b98('0x10')](_0x1b98('0xf'),auth[_0x1b98('0x9')](),controller[_0x1b98('0x11')]);module[_0x1b98('0x12')]=router; \ No newline at end of file +var _0x0ff0=['connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x0ff0,0x8d));var _0x00ff=function(_0x328dd5,_0x3cc528){_0x328dd5=_0x328dd5-0x0;var _0x256966=_0x0ff0[_0x328dd5];return _0x256966;};'use strict';var multer=require(_0x00ff('0x0'));var util=require(_0x00ff('0x1'));var path=require(_0x00ff('0x2'));var timeout=require(_0x00ff('0x3'));var express=require(_0x00ff('0x4'));var router=express['Router']();var auth=require(_0x00ff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x00ff('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x00ff('0x7')]('/',auth['isAuthenticated'](),controller[_0x00ff('0x8')]);router[_0x00ff('0x7')](_0x00ff('0x9'),auth[_0x00ff('0xa')](),controller['show']);router[_0x00ff('0xb')]('/',auth[_0x00ff('0xa')](),controller[_0x00ff('0xc')]);router[_0x00ff('0xd')](_0x00ff('0x9'),auth[_0x00ff('0xa')](),controller[_0x00ff('0xe')]);router[_0x00ff('0xf')](_0x00ff('0x9'),auth[_0x00ff('0xa')](),controller[_0x00ff('0x10')]);module[_0x00ff('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b52f924..04c47d8 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 _0x6426=['exports','STRING','sequelize'];(function(_0x3cb3ee,_0x250ba2){var _0x4780b9=function(_0x518b32){while(--_0x518b32){_0x3cb3ee['push'](_0x3cb3ee['shift']());}};_0x4780b9(++_0x250ba2);}(_0x6426,0x17f));var _0x6642=function(_0x5e5e52,_0x4bfc77){_0x5e5e52=_0x5e5e52-0x0;var _0x5b744c=_0x6426[_0x5e5e52];return _0x5b744c;};'use strict';var Sequelize=require(_0x6642('0x0'));module[_0x6642('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x6642('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0467=['STRING','sequelize','exports'];(function(_0x2b0956,_0x11fbfb){var _0x113f95=function(_0x895649){while(--_0x895649){_0x2b0956['push'](_0x2b0956['shift']());}};_0x113f95(++_0x11fbfb);}(_0x0467,0x1e4));var _0x7046=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0467[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7046('0x0'));module[_0x7046('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x7046('0x2')]},'type':{'type':Sequelize[_0x7046('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 7ca231d..b177c18 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 _0xb8df=['path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','field','merge','options','then','include','rows','catch','show','params','intersection','includeAll','body','find','create','originalname','file','filename','type','mimetype','download','join','root','server/files/attachments/','basename','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xb8df,0x1d1));var _0xfb8d=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xb8df[_0x18fb16];return _0x147b0d;};'use strict';var pdf=require(_0xfb8d('0x0'));var emlformat=require(_0xfb8d('0x1'));var rimraf=require(_0xfb8d('0x2'));var zipdir=require(_0xfb8d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb8d('0x4'));var moment=require(_0xfb8d('0x5'));var BPromise=require(_0xfb8d('0x6'));var Mustache=require(_0xfb8d('0x7'));var util=require(_0xfb8d('0x8'));var path=require(_0xfb8d('0x9'));var sox=require('sox');var csv=require(_0xfb8d('0xa'));var ejs=require(_0xfb8d('0xb'));var fs=require('fs');var _=require(_0xfb8d('0xc'));var squel=require('squel');var crypto=require(_0xfb8d('0xd'));var jsforce=require(_0xfb8d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfb8d('0xf'));var Papa=require('papaparse');var Redis=require(_0xfb8d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfb8d('0x11'));var hardwareService=require(_0xfb8d('0x12'));var logger=require(_0xfb8d('0x13'))(_0xfb8d('0x14'));var utils=require(_0xfb8d('0x15'));var config=require(_0xfb8d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122447,_0x553668){_0x553668=_0x553668||0xcc;return function(_0x1bb43a){if(_0x1bb43a){return _0x122447['sendStatus'](_0x553668);}return _0x122447[_0xfb8d('0x17')](_0x553668)[_0xfb8d('0x18')]();};}function respondWithResult(_0x41397a,_0x478f47){_0x478f47=_0x478f47||0xc8;return function(_0x57df83){if(_0x57df83){return _0x41397a['status'](_0x478f47)['json'](_0x57df83);}};}function respondWithFilteredResult(_0x546b16,_0x552b9a){return function(_0x1dd49e){if(_0x1dd49e){var _0x21ac25=_0x1dd49e[_0xfb8d('0x19')],_0x534277=_0x552b9a[_0xfb8d('0x1a')],_0x1c5cb2=_0x552b9a[_0xfb8d('0x1a')]+_0x552b9a[_0xfb8d('0x1b')],_0x4c2a81;if(_0x1c5cb2>=_0x21ac25){_0x1c5cb2=_0x21ac25;_0x4c2a81=0xc8;}else{_0x4c2a81=0xce;}_0x546b16[_0xfb8d('0x17')](_0x4c2a81);return _0x546b16[_0xfb8d('0x1c')](_0xfb8d('0x1d'),_0x534277+'-'+_0x1c5cb2+'/'+_0x21ac25)[_0xfb8d('0x1e')](_0x1dd49e);}return null;};}function patchUpdates(_0x494dbb){return function(_0x2ca9c7){try{jsonpatch['apply'](_0x2ca9c7,_0x494dbb,!![]);}catch(_0x5a74ca){return BPromise[_0xfb8d('0x1f')](_0x5a74ca);}return _0x2ca9c7[_0xfb8d('0x20')]();};}function saveUpdates(_0x54816b,_0x779670){return function(_0x5c4393){if(_0x5c4393){return _0x5c4393['update'](_0x54816b)['then'](function(_0x151ce0){return _0x151ce0;});}return null;};}function removeEntity(_0x1807a7,_0x28d9da){return function(_0x1c18c4){if(_0x1c18c4){return _0x1c18c4[_0xfb8d('0x21')]()['then'](function(){_0x1807a7[_0xfb8d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x234663,_0x446d2c){return function(_0x47d810){if(!_0x47d810){_0x234663[_0xfb8d('0x22')](0x194);}return _0x47d810;};}function handleError(_0x7d22f3,_0x3eb614){_0x3eb614=_0x3eb614||0x1f4;return function(_0x1be817){logger[_0xfb8d('0x23')](_0x1be817[_0xfb8d('0x24')]);if(_0x1be817[_0xfb8d('0x25')]){delete _0x1be817[_0xfb8d('0x25')];}_0x7d22f3[_0xfb8d('0x17')](_0x3eb614)[_0xfb8d('0x26')](_0x1be817);};}exports[_0xfb8d('0x27')]=function(_0x22eba0,_0x49bc20){var _0x2fe5f8={},_0x178aab={},_0x3cec55={'count':0x0,'rows':[]};var _0x270b26=db[_0xfb8d('0x28')][_0xfb8d('0x29')];_0x178aab[_0xfb8d('0x2a')]=_[_0xfb8d('0x2b')](_0x270b26);_0x178aab[_0xfb8d('0x2c')]=_[_0xfb8d('0x2b')](_0x22eba0['query']);_0x178aab[_0xfb8d('0x2d')]=_['intersection'](_0x178aab[_0xfb8d('0x2a')],_0x178aab[_0xfb8d('0x2c')]);_0x2fe5f8[_0xfb8d('0x2e')]=_['intersection'](_0x178aab[_0xfb8d('0x2a')],qs[_0xfb8d('0x2f')](_0x22eba0['query'][_0xfb8d('0x2f')]));_0x2fe5f8[_0xfb8d('0x2e')]=_0x2fe5f8[_0xfb8d('0x2e')][_0xfb8d('0x30')]?_0x2fe5f8[_0xfb8d('0x2e')]:_0x178aab[_0xfb8d('0x2a')];if(!_0x22eba0[_0xfb8d('0x2c')][_0xfb8d('0x31')]('nolimit')){_0x2fe5f8[_0xfb8d('0x1b')]=qs[_0xfb8d('0x1b')](_0x22eba0[_0xfb8d('0x2c')]['limit']);_0x2fe5f8[_0xfb8d('0x1a')]=qs[_0xfb8d('0x1a')](_0x22eba0['query']['offset']);}_0x2fe5f8['order']=qs[_0xfb8d('0x32')](_0x22eba0[_0xfb8d('0x2c')][_0xfb8d('0x32')]);_0x2fe5f8[_0xfb8d('0x33')]=qs[_0xfb8d('0x2d')](_[_0xfb8d('0x34')](_0x22eba0['query'],_0x178aab[_0xfb8d('0x2d')]));if(_0x22eba0[_0xfb8d('0x2c')][_0xfb8d('0x35')]){_0x2fe5f8['where']=_['merge'](_0x2fe5f8['where'],{'$or':_[_0xfb8d('0x36')](_0x270b26,function(_0x22b84d){if(_0x22b84d['type']['key']!=='VIRTUAL'){var _0x4e4f74={};_0x4e4f74[_0x22b84d[_0xfb8d('0x37')]]={'$like':'%'+_0x22eba0['query'][_0xfb8d('0x35')]+'%'};return _0x4e4f74;}})});}_0x2fe5f8=_[_0xfb8d('0x38')]({},_0x2fe5f8,_0x22eba0[_0xfb8d('0x39')]);var _0x325b2c={'where':_0x2fe5f8[_0xfb8d('0x33')]};return db['Attachment'][_0xfb8d('0x19')](_0x325b2c)[_0xfb8d('0x3a')](function(_0x4b92a3){_0x3cec55['count']=_0x4b92a3;if(_0x22eba0[_0xfb8d('0x2c')]['includeAll']){_0x2fe5f8[_0xfb8d('0x3b')]=[{'all':!![]}];}return db[_0xfb8d('0x28')]['findAll'](_0x2fe5f8);})['then'](function(_0x59005e){_0x3cec55[_0xfb8d('0x3c')]=_0x59005e;return _0x3cec55;})[_0xfb8d('0x3a')](respondWithFilteredResult(_0x49bc20,_0x2fe5f8))[_0xfb8d('0x3d')](handleError(_0x49bc20,null));};exports[_0xfb8d('0x3e')]=function(_0x34fcf1,_0x5d5ffe){var _0x5178e9={'raw':!![],'where':{'id':_0x34fcf1[_0xfb8d('0x3f')]['id']}},_0x3f36f6={};_0x3f36f6['model']=_['keys'](db['Attachment']['rawAttributes']);_0x3f36f6[_0xfb8d('0x2c')]=_[_0xfb8d('0x2b')](_0x34fcf1['query']);_0x3f36f6[_0xfb8d('0x2d')]=_['intersection'](_0x3f36f6[_0xfb8d('0x2a')],_0x3f36f6[_0xfb8d('0x2c')]);_0x5178e9[_0xfb8d('0x2e')]=_[_0xfb8d('0x40')](_0x3f36f6['model'],qs[_0xfb8d('0x2f')](_0x34fcf1['query']['fields']));_0x5178e9['attributes']=_0x5178e9[_0xfb8d('0x2e')][_0xfb8d('0x30')]?_0x5178e9[_0xfb8d('0x2e')]:_0x3f36f6[_0xfb8d('0x2a')];if(_0x34fcf1[_0xfb8d('0x2c')][_0xfb8d('0x41')]){_0x5178e9['include']=[{'all':!![]}];}_0x5178e9=_['merge']({},_0x5178e9,_0x34fcf1[_0xfb8d('0x39')]);return db[_0xfb8d('0x28')]['find'](_0x5178e9)['then'](handleEntityNotFound(_0x5d5ffe,null))[_0xfb8d('0x3a')](respondWithResult(_0x5d5ffe,null))[_0xfb8d('0x3d')](handleError(_0x5d5ffe,null));};exports['update']=function(_0x517df0,_0xd9998e){if(_0x517df0[_0xfb8d('0x42')]['id']){delete _0x517df0['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x517df0[_0xfb8d('0x3f')]['id']}})[_0xfb8d('0x3a')](handleEntityNotFound(_0xd9998e,null))['then'](saveUpdates(_0x517df0['body'],null))[_0xfb8d('0x3a')](respondWithResult(_0xd9998e,null))[_0xfb8d('0x3d')](handleError(_0xd9998e,null));};exports['destroy']=function(_0x596599,_0x2b0150){return db[_0xfb8d('0x28')][_0xfb8d('0x43')]({'where':{'id':_0x596599[_0xfb8d('0x3f')]['id']}})[_0xfb8d('0x3a')](handleEntityNotFound(_0x2b0150,null))['then'](removeEntity(_0x2b0150,null))['catch'](handleError(_0x2b0150,null));};exports[_0xfb8d('0x44')]=function(_0x5ad781,_0x32bc8d,_0x42ec07){_0x5ad781[_0xfb8d('0x42')]['name']=_0x5ad781['file'][_0xfb8d('0x45')];_0x5ad781[_0xfb8d('0x42')]['basename']=_0x5ad781[_0xfb8d('0x46')][_0xfb8d('0x47')];_0x5ad781[_0xfb8d('0x42')][_0xfb8d('0x48')]=_0x5ad781[_0xfb8d('0x46')][_0xfb8d('0x49')];return db[_0xfb8d('0x28')][_0xfb8d('0x44')](_0x5ad781['body'])['then'](respondWithResult(_0x32bc8d,0xc9))[_0xfb8d('0x3d')](handleError(_0x32bc8d,null));};exports[_0xfb8d('0x4a')]=function(_0x31c0b9,_0x4b1ccc,_0x1a2a53){return db[_0xfb8d('0x28')]['findOne']({'where':{'id':_0x31c0b9[_0xfb8d('0x3f')]['id']},'raw':!![]})[_0xfb8d('0x3a')](handleEntityNotFound(_0x4b1ccc,null))[_0xfb8d('0x3a')](function(_0xae3d1a){if(_0xae3d1a){return _0x4b1ccc['download'](path[_0xfb8d('0x4b')](config[_0xfb8d('0x4c')],_0xfb8d('0x4d'),_0xae3d1a[_0xfb8d('0x4e')]));}})[_0xfb8d('0x3d')](handleError(_0x4b1ccc,null));}; \ No newline at end of file +var _0xd6e4=['send','index','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','length','options','body','find','file','originalname','basename','filename','mimetype','create','findOne','download','server/files/attachments/','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name'];(function(_0x5f1ff3,_0x177bea){var _0x5c7da5=function(_0x18cdea){while(--_0x18cdea){_0x5f1ff3['push'](_0x5f1ff3['shift']());}};_0x5c7da5(++_0x177bea);}(_0xd6e4,0xcc));var _0x4d6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6e4[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4d6e('0x0'));var rimraf=require(_0x4d6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d6e('0x2'));var rp=require('request-promise');var moment=require(_0x4d6e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4d6e('0x4'));var util=require('util');var path=require(_0x4d6e('0x5'));var sox=require(_0x4d6e('0x6'));var csv=require(_0x4d6e('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d6e('0x8'));var squel=require('squel');var crypto=require(_0x4d6e('0x9'));var jsforce=require(_0x4d6e('0xa'));var deskjs=require(_0x4d6e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4d6e('0xc'));var Redis=require(_0x4d6e('0xd'));var authService=require(_0x4d6e('0xe'));var qs=require(_0x4d6e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d6e('0x10'))(_0x4d6e('0x11'));var utils=require(_0x4d6e('0x12'));var config=require(_0x4d6e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f5ba1,_0x251c00){_0x251c00=_0x251c00||0xcc;return function(_0x5a2976){if(_0x5a2976){return _0x5f5ba1[_0x4d6e('0x14')](_0x251c00);}return _0x5f5ba1[_0x4d6e('0x15')](_0x251c00)['end']();};}function respondWithResult(_0x25fc11,_0x10c116){_0x10c116=_0x10c116||0xc8;return function(_0x4dafbf){if(_0x4dafbf){return _0x25fc11[_0x4d6e('0x15')](_0x10c116)[_0x4d6e('0x16')](_0x4dafbf);}};}function respondWithFilteredResult(_0x716f06,_0x556595){return function(_0x362460){if(_0x362460){var _0x541759=_0x362460[_0x4d6e('0x17')],_0x57ee5e=_0x556595[_0x4d6e('0x18')],_0x5531f5=_0x556595[_0x4d6e('0x18')]+_0x556595['limit'],_0x3fe43e;if(_0x5531f5>=_0x541759){_0x5531f5=_0x541759;_0x3fe43e=0xc8;}else{_0x3fe43e=0xce;}_0x716f06[_0x4d6e('0x15')](_0x3fe43e);return _0x716f06[_0x4d6e('0x19')](_0x4d6e('0x1a'),_0x57ee5e+'-'+_0x5531f5+'/'+_0x541759)[_0x4d6e('0x16')](_0x362460);}return null;};}function patchUpdates(_0x1ac38c){return function(_0x150e8a){try{jsonpatch['apply'](_0x150e8a,_0x1ac38c,!![]);}catch(_0x2dbc22){return BPromise[_0x4d6e('0x1b')](_0x2dbc22);}return _0x150e8a[_0x4d6e('0x1c')]();};}function saveUpdates(_0x16627d,_0x1b1f78){return function(_0x5e2a51){if(_0x5e2a51){return _0x5e2a51[_0x4d6e('0x1d')](_0x16627d)['then'](function(_0x54290e){return _0x54290e;});}return null;};}function removeEntity(_0x31f1db,_0x267c44){return function(_0x30f34d){if(_0x30f34d){return _0x30f34d[_0x4d6e('0x1e')]()[_0x4d6e('0x1f')](function(){_0x31f1db[_0x4d6e('0x15')](0xcc)[_0x4d6e('0x20')]();});}};}function handleEntityNotFound(_0xfdb098,_0x3f7fc0){return function(_0x24f78b){if(!_0x24f78b){_0xfdb098[_0x4d6e('0x14')](0x194);}return _0x24f78b;};}function handleError(_0x17fb25,_0x1100cf){_0x1100cf=_0x1100cf||0x1f4;return function(_0x31ebe5){logger[_0x4d6e('0x21')](_0x31ebe5[_0x4d6e('0x22')]);if(_0x31ebe5[_0x4d6e('0x23')]){delete _0x31ebe5['name'];}_0x17fb25['status'](_0x1100cf)[_0x4d6e('0x24')](_0x31ebe5);};}exports[_0x4d6e('0x25')]=function(_0x59180b,_0x55190a){var _0x183a0b={},_0x3d87f6={},_0x1691ce={'count':0x0,'rows':[]};var _0xe57d6f=db[_0x4d6e('0x26')][_0x4d6e('0x27')];_0x3d87f6[_0x4d6e('0x28')]=_[_0x4d6e('0x29')](_0xe57d6f);_0x3d87f6[_0x4d6e('0x2a')]=_[_0x4d6e('0x29')](_0x59180b['query']);_0x3d87f6[_0x4d6e('0x2b')]=_[_0x4d6e('0x2c')](_0x3d87f6[_0x4d6e('0x28')],_0x3d87f6[_0x4d6e('0x2a')]);_0x183a0b[_0x4d6e('0x2d')]=_[_0x4d6e('0x2c')](_0x3d87f6['model'],qs[_0x4d6e('0x2e')](_0x59180b[_0x4d6e('0x2a')][_0x4d6e('0x2e')]));_0x183a0b[_0x4d6e('0x2d')]=_0x183a0b[_0x4d6e('0x2d')]['length']?_0x183a0b[_0x4d6e('0x2d')]:_0x3d87f6[_0x4d6e('0x28')];if(!_0x59180b[_0x4d6e('0x2a')][_0x4d6e('0x2f')](_0x4d6e('0x30'))){_0x183a0b[_0x4d6e('0x31')]=qs[_0x4d6e('0x31')](_0x59180b[_0x4d6e('0x2a')]['limit']);_0x183a0b[_0x4d6e('0x18')]=qs[_0x4d6e('0x18')](_0x59180b[_0x4d6e('0x2a')][_0x4d6e('0x18')]);}_0x183a0b[_0x4d6e('0x32')]=qs['sort'](_0x59180b[_0x4d6e('0x2a')][_0x4d6e('0x33')]);_0x183a0b[_0x4d6e('0x34')]=qs[_0x4d6e('0x2b')](_[_0x4d6e('0x35')](_0x59180b[_0x4d6e('0x2a')],_0x3d87f6['filters']));if(_0x59180b[_0x4d6e('0x2a')][_0x4d6e('0x36')]){_0x183a0b[_0x4d6e('0x34')]=_[_0x4d6e('0x37')](_0x183a0b[_0x4d6e('0x34')],{'$or':_[_0x4d6e('0x38')](_0xe57d6f,function(_0x406aea){if(_0x406aea[_0x4d6e('0x39')][_0x4d6e('0x3a')]!==_0x4d6e('0x3b')){var _0x340e69={};_0x340e69[_0x406aea[_0x4d6e('0x3c')]]={'$like':'%'+_0x59180b[_0x4d6e('0x2a')][_0x4d6e('0x36')]+'%'};return _0x340e69;}})});}_0x183a0b=_['merge']({},_0x183a0b,_0x59180b['options']);var _0x18e0d9={'where':_0x183a0b[_0x4d6e('0x34')]};return db[_0x4d6e('0x26')][_0x4d6e('0x17')](_0x18e0d9)[_0x4d6e('0x1f')](function(_0x44b5fb){_0x1691ce['count']=_0x44b5fb;if(_0x59180b[_0x4d6e('0x2a')][_0x4d6e('0x3d')]){_0x183a0b[_0x4d6e('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0x4d6e('0x3f')](_0x183a0b);})['then'](function(_0x541da8){_0x1691ce[_0x4d6e('0x40')]=_0x541da8;return _0x1691ce;})[_0x4d6e('0x1f')](respondWithFilteredResult(_0x55190a,_0x183a0b))[_0x4d6e('0x41')](handleError(_0x55190a,null));};exports[_0x4d6e('0x42')]=function(_0x49cdae,_0x1522fd){var _0x2b7e2d={'raw':!![],'where':{'id':_0x49cdae['params']['id']}},_0x573d0e={};_0x573d0e[_0x4d6e('0x28')]=_[_0x4d6e('0x29')](db[_0x4d6e('0x26')][_0x4d6e('0x27')]);_0x573d0e[_0x4d6e('0x2a')]=_[_0x4d6e('0x29')](_0x49cdae['query']);_0x573d0e[_0x4d6e('0x2b')]=_[_0x4d6e('0x2c')](_0x573d0e['model'],_0x573d0e['query']);_0x2b7e2d[_0x4d6e('0x2d')]=_[_0x4d6e('0x2c')](_0x573d0e['model'],qs[_0x4d6e('0x2e')](_0x49cdae[_0x4d6e('0x2a')][_0x4d6e('0x2e')]));_0x2b7e2d[_0x4d6e('0x2d')]=_0x2b7e2d[_0x4d6e('0x2d')][_0x4d6e('0x43')]?_0x2b7e2d[_0x4d6e('0x2d')]:_0x573d0e[_0x4d6e('0x28')];if(_0x49cdae[_0x4d6e('0x2a')]['includeAll']){_0x2b7e2d[_0x4d6e('0x3e')]=[{'all':!![]}];}_0x2b7e2d=_['merge']({},_0x2b7e2d,_0x49cdae[_0x4d6e('0x44')]);return db[_0x4d6e('0x26')]['find'](_0x2b7e2d)[_0x4d6e('0x1f')](handleEntityNotFound(_0x1522fd,null))['then'](respondWithResult(_0x1522fd,null))[_0x4d6e('0x41')](handleError(_0x1522fd,null));};exports[_0x4d6e('0x1d')]=function(_0x245c79,_0x4dbc39){if(_0x245c79[_0x4d6e('0x45')]['id']){delete _0x245c79[_0x4d6e('0x45')]['id'];}return db[_0x4d6e('0x26')][_0x4d6e('0x46')]({'where':{'id':_0x245c79['params']['id']}})[_0x4d6e('0x1f')](handleEntityNotFound(_0x4dbc39,null))[_0x4d6e('0x1f')](saveUpdates(_0x245c79[_0x4d6e('0x45')],null))[_0x4d6e('0x1f')](respondWithResult(_0x4dbc39,null))[_0x4d6e('0x41')](handleError(_0x4dbc39,null));};exports[_0x4d6e('0x1e')]=function(_0x359d85,_0x217296){return db[_0x4d6e('0x26')][_0x4d6e('0x46')]({'where':{'id':_0x359d85['params']['id']}})[_0x4d6e('0x1f')](handleEntityNotFound(_0x217296,null))[_0x4d6e('0x1f')](removeEntity(_0x217296,null))[_0x4d6e('0x41')](handleError(_0x217296,null));};exports['create']=function(_0x1a02e4,_0x152c3e,_0x467a09){_0x1a02e4['body'][_0x4d6e('0x23')]=_0x1a02e4[_0x4d6e('0x47')][_0x4d6e('0x48')];_0x1a02e4[_0x4d6e('0x45')][_0x4d6e('0x49')]=_0x1a02e4[_0x4d6e('0x47')][_0x4d6e('0x4a')];_0x1a02e4['body'][_0x4d6e('0x39')]=_0x1a02e4[_0x4d6e('0x47')][_0x4d6e('0x4b')];return db[_0x4d6e('0x26')][_0x4d6e('0x4c')](_0x1a02e4[_0x4d6e('0x45')])['then'](respondWithResult(_0x152c3e,0xc9))['catch'](handleError(_0x152c3e,null));};exports['download']=function(_0x416b99,_0x5daa2f,_0x23cc03){return db[_0x4d6e('0x26')][_0x4d6e('0x4d')]({'where':{'id':_0x416b99['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5daa2f,null))[_0x4d6e('0x1f')](function(_0x5f0aa3){if(_0x5f0aa3){return _0x5daa2f[_0x4d6e('0x4e')](path['join'](config['root'],_0x4d6e('0x4f'),_0x5f0aa3[_0x4d6e('0x49')]));}})[_0x4d6e('0x41')](handleError(_0x5daa2f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6a74553..dbb2d07 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 _0x9224=['define','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','./attachment.attributes'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0x9224,0xa3));var _0x4922=function(_0x7214f,_0x32c61a){_0x7214f=_0x7214f-0x0;var _0x2d3dde=_0x9224[_0x7214f];return _0x2d3dde;};'use strict';var _=require('lodash');var util=require(_0x4922('0x0'));var logger=require(_0x4922('0x1'))(_0x4922('0x2'));var moment=require(_0x4922('0x3'));var BPromise=require(_0x4922('0x4'));var rp=require(_0x4922('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4922('0x6'));module['exports']=function(_0x12601a,_0x1b7fc7){return _0x12601a[_0x4922('0x7')](_0x4922('0x8'),attributes,{'tableName':_0x4922('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19da=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','Attachment','attachments','util'];(function(_0x13be43,_0x1261e8){var _0x2b5d2f=function(_0x4a979f){while(--_0x4a979f){_0x13be43['push'](_0x13be43['shift']());}};_0x2b5d2f(++_0x1261e8);}(_0x19da,0x9f));var _0xa19d=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x19da[_0x4da356];return _0x321b07;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var logger=require('../../config/logger')(_0xa19d('0x1'));var moment=require('moment');var BPromise=require(_0xa19d('0x2'));var rp=require(_0xa19d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa19d('0x4'));var config=require(_0xa19d('0x5'));var attributes=require('./attachment.attributes');module[_0xa19d('0x6')]=function(_0x330adb,_0x1f6e10){return _0x330adb[_0xa19d('0x7')](_0xa19d('0x8'),attributes,{'tableName':_0xa19d('0x9'),'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 1d8087d..4fe83f3 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 _0xc90a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateAttachment','Attachment','body','options','raw','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc90a,0x102));var _0xac90=function(_0x56acd3,_0x1bc664){_0x56acd3=_0x56acd3-0x0;var _0x1dbf9d=_0xc90a[_0x56acd3];return _0x1dbf9d;};'use strict';var _=require(_0xac90('0x0'));var util=require(_0xac90('0x1'));var moment=require(_0xac90('0x2'));var BPromise=require(_0xac90('0x3'));var rs=require(_0xac90('0x4'));var fs=require('fs');var Redis=require(_0xac90('0x5'));var db=require(_0xac90('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xac90('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac90('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e1a04,_0x198e8f,_0x1d2640){return new BPromise(function(_0x4b4361,_0x26958d){return client[_0xac90('0x9')](_0x4e1a04,_0x1d2640)[_0xac90('0xa')](function(_0x1a1c38){logger[_0xac90('0xb')](_0xac90('0xc'),_0x198e8f,_0xac90('0xd'));logger[_0xac90('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x198e8f,_0xac90('0xd'),JSON[_0xac90('0xf')](_0x1a1c38));if(_0x1a1c38[_0xac90('0x10')]){if(_0x1a1c38['error'][_0xac90('0x11')]===0x1f4){logger[_0xac90('0x10')](_0xac90('0xc'),_0x198e8f,_0x1a1c38[_0xac90('0x10')][_0xac90('0x12')]);return _0x26958d(_0x1a1c38['error'][_0xac90('0x12')]);}logger['error'](_0xac90('0xc'),_0x198e8f,_0x1a1c38[_0xac90('0x10')][_0xac90('0x12')]);return _0x4b4361(_0x1a1c38[_0xac90('0x10')][_0xac90('0x12')]);}else{logger[_0xac90('0xb')]('Attachment,\x20%s,\x20%s',_0x198e8f,'request\x20sent');_0x4b4361(_0x1a1c38[_0xac90('0x13')][_0xac90('0x12')]);}})['catch'](function(_0x17f1fa){logger[_0xac90('0x10')](_0xac90('0xc'),_0x198e8f,_0x17f1fa);_0x26958d(_0x17f1fa);});});}exports[_0xac90('0x14')]=function(_0x57626d){var _0x30f267=this;return new Promise(function(_0x3d3952,_0x33df2e){return db[_0xac90('0x15')]['create'](_0x57626d[_0xac90('0x16')],{'raw':_0x57626d['options']?_0x57626d[_0xac90('0x17')][_0xac90('0x18')]===undefined?!![]:![]:!![]})[_0xac90('0xa')](function(_0x45785b){logger[_0xac90('0xb')]('CreateAttachment',_0x57626d);logger[_0xac90('0xe')](_0xac90('0x14'),_0x57626d,JSON[_0xac90('0xf')](_0x45785b));_0x3d3952(_0x45785b);})[_0xac90('0x19')](function(_0x169908){logger[_0xac90('0x10')]('CreateAttachment',_0x169908[_0xac90('0x12')],_0x57626d);_0x33df2e(_0x30f267[_0xac90('0x10')](0x1f4,_0x169908[_0xac90('0x12')]));});});}; \ No newline at end of file +var _0x70de=['message','info','request\x20sent','result','catch','CreateAttachment','Attachment','create','options','debug','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x2ea3e9,_0x22424e){var _0x1ddb16=function(_0x57c2fa){while(--_0x57c2fa){_0x2ea3e9['push'](_0x2ea3e9['shift']());}};_0x1ddb16(++_0x22424e);}(_0x70de,0xb3));var _0xe70d=function(_0x2498b5,_0x514ddb){_0x2498b5=_0x2498b5-0x0;var _0x5c48d8=_0x70de[_0x2498b5];return _0x5c48d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe70d('0x0'));var BPromise=require('bluebird');var rs=require(_0xe70d('0x1'));var fs=require('fs');var Redis=require(_0xe70d('0x2'));var db=require(_0xe70d('0x3'))['db'];var utils=require(_0xe70d('0x4'));var logger=require('../../config/logger')(_0xe70d('0x5'));var config=require(_0xe70d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe70d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4110d0,_0x4e87de,_0x2f8642){return new BPromise(function(_0x35c75c,_0x28e73c){return client[_0xe70d('0x8')](_0x4110d0,_0x2f8642)[_0xe70d('0x9')](function(_0x446f6a){logger['info'](_0xe70d('0xa'),_0x4e87de,'request\x20sent');logger['debug'](_0xe70d('0xb'),_0x4e87de,'request\x20sent',JSON['stringify'](_0x446f6a));if(_0x446f6a[_0xe70d('0xc')]){if(_0x446f6a[_0xe70d('0xc')]['code']===0x1f4){logger[_0xe70d('0xc')](_0xe70d('0xa'),_0x4e87de,_0x446f6a[_0xe70d('0xc')][_0xe70d('0xd')]);return _0x28e73c(_0x446f6a[_0xe70d('0xc')][_0xe70d('0xd')]);}logger[_0xe70d('0xc')](_0xe70d('0xa'),_0x4e87de,_0x446f6a[_0xe70d('0xc')][_0xe70d('0xd')]);return _0x35c75c(_0x446f6a['error'][_0xe70d('0xd')]);}else{logger[_0xe70d('0xe')](_0xe70d('0xa'),_0x4e87de,_0xe70d('0xf'));_0x35c75c(_0x446f6a[_0xe70d('0x10')][_0xe70d('0xd')]);}})[_0xe70d('0x11')](function(_0x2b21a9){logger['error'](_0xe70d('0xa'),_0x4e87de,_0x2b21a9);_0x28e73c(_0x2b21a9);});});}exports[_0xe70d('0x12')]=function(_0x225ac9){var _0x1a3b43=this;return new Promise(function(_0x19dece,_0x43c7f8){return db[_0xe70d('0x13')][_0xe70d('0x14')](_0x225ac9['body'],{'raw':_0x225ac9['options']?_0x225ac9[_0xe70d('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53548c){logger[_0xe70d('0xe')](_0xe70d('0x12'),_0x225ac9);logger[_0xe70d('0x16')](_0xe70d('0x12'),_0x225ac9,JSON[_0xe70d('0x17')](_0x53548c));_0x19dece(_0x53548c);})[_0xe70d('0x11')](function(_0x38b7a2){logger[_0xe70d('0xc')](_0xe70d('0x12'),_0x38b7a2['message'],_0x225ac9);_0x43c7f8(_0x1a3b43['error'](0x1f4,_0x38b7a2[_0xe70d('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 7405a04..d4121d5 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 _0xe600=['now','replace','post','single','file','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','root','server/files/attachments/','format','%s-%s'];(function(_0x1c4516,_0x5c48d5){var _0x2f992f=function(_0x5a56e9){while(--_0x5a56e9){_0x1c4516['push'](_0x1c4516['shift']());}};_0x2f992f(++_0x5c48d5);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x0e60('0x0'));var path=require('path');var timeout=require(_0x0e60('0x1'));var express=require(_0x0e60('0x2'));var router=express[_0x0e60('0x3')]();var auth=require(_0x0e60('0x4'));var interaction=require(_0x0e60('0x5'));var config=require(_0x0e60('0x6'));var controller=require(_0x0e60('0x7'));router[_0x0e60('0x8')]('/',auth[_0x0e60('0x9')](),controller[_0x0e60('0xa')]);router['get'](_0x0e60('0xb'),auth[_0x0e60('0x9')](),controller[_0x0e60('0xc')]);router[_0x0e60('0x8')]('/:id/download',auth[_0x0e60('0x9')](),controller[_0x0e60('0xd')]);var upload=multer({'storage':multer[_0x0e60('0xe')]({'destination':function(_0x420063,_0x300dfb,_0x1659e4){_0x1659e4(null,path['join'](config[_0x0e60('0xf')],_0x0e60('0x10')));},'filename':function(_0x32274f,_0x402907,_0x2b3676){_0x2b3676(null,util[_0x0e60('0x11')](_0x0e60('0x12'),Date[_0x0e60('0x13')](),_0x402907['originalname'][_0x0e60('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0e60('0x15')]('/',upload[_0x0e60('0x16')](_0x0e60('0x17')),controller[_0x0e60('0x18')]);router[_0x0e60('0x19')]('/:id',auth[_0x0e60('0x9')](),controller['update']);router[_0x0e60('0x1a')](_0x0e60('0xb'),auth[_0x0e60('0x9')](),controller['destroy']);module[_0x0e60('0x1b')]=router; \ No newline at end of file +var _0x1491=['download','diskStorage','join','%s-%s','originalname','replace','post','single','file','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x5b47a8,_0x3909ac){var _0x36326f=function(_0x398ec1){while(--_0x398ec1){_0x5b47a8['push'](_0x5b47a8['shift']());}};_0x36326f(++_0x3909ac);}(_0x1491,0x1b1));var _0x1149=function(_0x43d025,_0x14c205){_0x43d025=_0x43d025-0x0;var _0x165dd7=_0x1491[_0x43d025];return _0x165dd7;};'use strict';var multer=require(_0x1149('0x0'));var util=require(_0x1149('0x1'));var path=require(_0x1149('0x2'));var timeout=require(_0x1149('0x3'));var express=require('express');var router=express[_0x1149('0x4')]();var auth=require(_0x1149('0x5'));var interaction=require(_0x1149('0x6'));var config=require(_0x1149('0x7'));var controller=require(_0x1149('0x8'));router[_0x1149('0x9')]('/',auth[_0x1149('0xa')](),controller[_0x1149('0xb')]);router[_0x1149('0x9')](_0x1149('0xc'),auth[_0x1149('0xa')](),controller[_0x1149('0xd')]);router[_0x1149('0x9')](_0x1149('0xe'),auth[_0x1149('0xa')](),controller[_0x1149('0xf')]);var upload=multer({'storage':multer[_0x1149('0x10')]({'destination':function(_0x449487,_0x82dd3f,_0x4f0bb6){_0x4f0bb6(null,path[_0x1149('0x11')](config['root'],'server/files/attachments/'));},'filename':function(_0x575008,_0x45e302,_0x494aec){_0x494aec(null,util['format'](_0x1149('0x12'),Date['now'](),_0x45e302[_0x1149('0x13')][_0x1149('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1149('0x15')]('/',upload[_0x1149('0x16')](_0x1149('0x17')),controller[_0x1149('0x18')]);router['put'](_0x1149('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1149('0x19')](_0x1149('0xc'),auth['isAuthenticated'](),controller[_0x1149('0x1a')]);module[_0x1149('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 248b263..9e31ea0 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 _0xce22=['minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../config/environment','signToken','../../config/utils','login','authenticate','google','/login','profile','callback','use','clientID','clientSecret','secret','callbackURL','findOne','then','User','find','map','emails','value','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt'];(function(_0x363032,_0x476a36){var _0x1f4e6f=function(_0x1c1c48){while(--_0x1c1c48){_0x363032['push'](_0x363032['shift']());}};_0x1f4e6f(++_0x476a36);}(_0xce22,0xea));var _0x2ce2=function(_0x1a84ad,_0x5780d3){_0x1a84ad=_0x1a84ad-0x0;var _0x3b3d1d=_0xce22[_0x1a84ad];return _0x3b3d1d;};'use strict';var _=require(_0x2ce2('0x0'));var passport=require(_0x2ce2('0x1'));var GoogleStrategy=require(_0x2ce2('0x2'))[_0x2ce2('0x3')];var moment=require(_0x2ce2('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0x2ce2('0x5'));var signToken=require('../../components/auth/service')[_0x2ce2('0x6')];var utils=require(_0x2ce2('0x7'));exports[_0x2ce2('0x8')]=passport[_0x2ce2('0x9')](_0x2ce2('0xa'),{'failureRedirect':_0x2ce2('0xb'),'scope':[_0x2ce2('0xc'),'email'],'session':![]});exports[_0x2ce2('0xd')]=passport[_0x2ce2('0x9')](_0x2ce2('0xa'),{'failureRedirect':_0x2ce2('0xb'),'session':![]});passport[_0x2ce2('0xe')](new GoogleStrategy({'clientID':config[_0x2ce2('0xa')]?config['google'][_0x2ce2('0xf')]:'id','clientSecret':config[_0x2ce2('0xa')]?config['google'][_0x2ce2('0x10')]:_0x2ce2('0x11'),'callbackURL':config['google']?config[_0x2ce2('0xa')][_0x2ce2('0x12')]:''},function(_0x420f96,_0x3dbbbe,_0x4b2407,_0x1b4a4f){var _0x112244,_0x2b7e86;return db['Setting'][_0x2ce2('0x13')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x2ce2('0x14')](function(_0x1a759e){_0x112244=_0x1a759e;return db[_0x2ce2('0x15')][_0x2ce2('0x16')]({'where':{'email':_[_0x2ce2('0x17')](_0x4b2407[_0x2ce2('0x18')],_0x2ce2('0x19')),'role':{'$or':['admin','user','agent']}}});})[_0x2ce2('0x14')](function(_0xa229b7){_0x2b7e86=_0xa229b7;if(_0x2b7e86){if(_0x2b7e86[_0x2ce2('0x1a')]){return _0x1b4a4f(_0x2ce2('0x1b'));}else if(_0x112244[_0x2ce2('0x1c')]>0x0){if(_0x2b7e86['blocked']){if(moment(_0x2b7e86[_0x2ce2('0x1d')])['add'](_0x112244[_0x2ce2('0x1c')],_0x2ce2('0x1e'))>moment()){return _0x1b4a4f(_0x2ce2('0x1b'));}else{return utils[_0x2ce2('0x1f')](_0x2b7e86,0x0,![],null)[_0x2ce2('0x14')](function(){return utils[_0x2ce2('0x20')](_0x2b7e86);})['then'](function(){return _0x1b4a4f(null,_0x2b7e86);});}}else{return utils['getLicense'](_0x2b7e86)[_0x2ce2('0x14')](function(){return _0x1b4a4f(null,_0x2b7e86);});}}else{return utils[_0x2ce2('0x20')](_0x2b7e86)[_0x2ce2('0x14')](function(){return _0x1b4a4f(null,_0x2b7e86);});}}return _0x1b4a4f(_0x2ce2('0x1b'));})['catch'](function(_0x5b2b79){_0x1b4a4f(_0x5b2b79);});})); \ No newline at end of file +var _0xf006=['login','authenticate','google','profile','callback','/login','use','clientID','clientSecret','secret','callbackURL','findOne','blockDuration','then','User','find','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service'];(function(_0x225941,_0x15f095){var _0x3cde51=function(_0x9b785d){while(--_0x9b785d){_0x225941['push'](_0x225941['shift']());}};_0x3cde51(++_0x15f095);}(_0xf006,0x146));var _0x6f00=function(_0x3bd031,_0x418f77){_0x3bd031=_0x3bd031-0x0;var _0xc918aa=_0xf006[_0x3bd031];return _0xc918aa;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x6f00('0x0'))[_0x6f00('0x1')];var moment=require('moment');var db=require(_0x6f00('0x2'))['db'];var config=require('../../config/environment');var signToken=require(_0x6f00('0x3'))['signToken'];var utils=require('../../config/utils');exports[_0x6f00('0x4')]=passport[_0x6f00('0x5')](_0x6f00('0x6'),{'failureRedirect':'/login','scope':[_0x6f00('0x7'),'email'],'session':![]});exports[_0x6f00('0x8')]=passport[_0x6f00('0x5')](_0x6f00('0x6'),{'failureRedirect':_0x6f00('0x9'),'session':![]});passport[_0x6f00('0xa')](new GoogleStrategy({'clientID':config[_0x6f00('0x6')]?config[_0x6f00('0x6')][_0x6f00('0xb')]:'id','clientSecret':config[_0x6f00('0x6')]?config[_0x6f00('0x6')][_0x6f00('0xc')]:_0x6f00('0xd'),'callbackURL':config[_0x6f00('0x6')]?config['google'][_0x6f00('0xe')]:''},function(_0x3537d5,_0x158817,_0x36a2ec,_0x289fe9){var _0x5e3264,_0x322116;return db['Setting'][_0x6f00('0xf')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6f00('0x10')],'raw':!![]})[_0x6f00('0x11')](function(_0x327e10){_0x5e3264=_0x327e10;return db[_0x6f00('0x12')][_0x6f00('0x13')]({'where':{'email':_[_0x6f00('0x14')](_0x36a2ec[_0x6f00('0x15')],_0x6f00('0x16')),'role':{'$or':[_0x6f00('0x17'),'user',_0x6f00('0x18')]}}});})['then'](function(_0x534275){_0x322116=_0x534275;if(_0x322116){if(_0x322116[_0x6f00('0x19')]){return _0x289fe9(_0x6f00('0x1a'));}else if(_0x5e3264[_0x6f00('0x10')]>0x0){if(_0x322116[_0x6f00('0x1b')]){if(moment(_0x322116[_0x6f00('0x1c')])[_0x6f00('0x1d')](_0x5e3264[_0x6f00('0x10')],_0x6f00('0x1e'))>moment()){return _0x289fe9(_0x6f00('0x1a'));}else{return utils[_0x6f00('0x1f')](_0x322116,0x0,![],null)[_0x6f00('0x11')](function(){return utils[_0x6f00('0x20')](_0x322116);})['then'](function(){return _0x289fe9(null,_0x322116);});}}else{return utils['getLicense'](_0x322116)['then'](function(){return _0x289fe9(null,_0x322116);});}}else{return utils[_0x6f00('0x20')](_0x322116)[_0x6f00('0x11')](function(){return _0x289fe9(null,_0x322116);});}}return _0x289fe9(_0x6f00('0x1a'));})['catch'](function(_0xe301e5){_0x289fe9(_0xe301e5);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 20053f1..220860f 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 _0x843b=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x503a0c,_0xbc78c5){var _0x3b2e83=function(_0x159994){while(--_0x159994){_0x503a0c['push'](_0x503a0c['shift']());}};_0x3b2e83(++_0xbc78c5);}(_0x843b,0xc5));var _0xb843=function(_0x3800b0,_0x323293){_0x3800b0=_0x3800b0-0x0;var _0x103556=_0x843b[_0x3800b0];return _0x103556;};'use strict';var express=require(_0xb843('0x0'));var passport=require(_0xb843('0x1'));var router=express[_0xb843('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xb843('0x3'));var authService=require(_0xb843('0x4'));router[_0xb843('0x5')]('/',controller[_0xb843('0x6')]);router[_0xb843('0x5')](_0xb843('0x7'),controller[_0xb843('0x8')],authService[_0xb843('0x9')],userController[_0xb843('0x6')],authService[_0xb843('0xa')]);module[_0xb843('0xb')]=router; \ No newline at end of file +var _0x789b=['../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','passport','./authGoogle.controller'];(function(_0x5323db,_0x32e34c){var _0x3a7a6f=function(_0x2ae797){while(--_0x2ae797){_0x5323db['push'](_0x5323db['shift']());}};_0x3a7a6f(++_0x32e34c);}(_0x789b,0x189));var _0xb789=function(_0x32540d,_0xe81a5){_0x32540d=_0x32540d-0x0;var _0x11182b=_0x789b[_0x32540d];return _0x11182b;};'use strict';var express=require(_0xb789('0x0'));var passport=require(_0xb789('0x1'));var router=express['Router']();var controller=require(_0xb789('0x2'));var userController=require(_0xb789('0x3'));var authService=require(_0xb789('0x4'));router[_0xb789('0x5')]('/',controller[_0xb789('0x6')]);router['get'](_0xb789('0x7'),controller[_0xb789('0x8')],authService[_0xb789('0x9')],userController[_0xb789('0x6')],authService[_0xb789('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 b99c1d5..d7bdebd 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 _0x5dd6=['role','blocked','blockedAt','loginAttempts','admin','user','agent','name','authenticate','disabled','allowedLoginAttempts','add','minutes','clearBlockUser','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','getLicense','catch','MailAccount','find','email','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','message','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','resetPasswordExpires','Password\x20reset!','use','User','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','signToken','../../config/utils','client','Setting','findOne','blockDuration','then','salt'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0x5dd6,0xed));var _0x65dd=function(_0x360c92,_0x5ed443){_0x360c92=_0x360c92-0x0;var _0x429495=_0x5dd6[_0x360c92];return _0x429495;};'use strict';var util=require('util');var passport=require(_0x65dd('0x0'));var LocalStrategy=require('passport-local')[_0x65dd('0x1')];var jayson=require(_0x65dd('0x2'));var _=require(_0x65dd('0x3'));var rs=require(_0x65dd('0x4'));var moment=require(_0x65dd('0x5'));var db=require('../../mysqldb')['db'];var signToken=require(_0x65dd('0x6'))[_0x65dd('0x7')];var utils=require(_0x65dd('0x8'));var client=jayson[_0x65dd('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x215c68,_0x33fbab,_0x5910bc,_0x4c75d6){var _0x38078c,_0x455638;return db[_0x65dd('0xa')][_0x65dd('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x65dd('0xc')],'raw':!![]})[_0x65dd('0xd')](function(_0x2aeea5){_0x38078c=_0x2aeea5;return _0x215c68['findOne']({'attributes':['id','name','password',_0x65dd('0xe'),_0x65dd('0xf'),'disabled',_0x65dd('0x10'),_0x65dd('0x11'),_0x65dd('0x12')],'where':{'name':_0x33fbab,'role':{'$or':[_0x65dd('0x13'),_0x65dd('0x14'),_0x65dd('0x15')]}}});})[_0x65dd('0xd')](function(_0x3a6088){if(!_0x3a6088||_0x3a6088&&_0x3a6088[_0x65dd('0x16')]!==_0x33fbab){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x455638=_0x3a6088;return _0x455638;}})[_0x65dd('0xd')](function(){_0x455638[_0x65dd('0x17')](_0x5910bc,function(_0xf269d9,_0x2851ba){var _0x2d00ac=_0x455638[_0x65dd('0x12')]+0x1;if(_0xf269d9){return _0x4c75d6(_0xf269d9);}else if(!_0x2851ba){if(_0x455638[_0x65dd('0x18')]){return _0x4c75d6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x38078c[_0x65dd('0x19')]>0x0){if(_0x455638[_0x65dd('0x10')]){if(_0x38078c[_0x65dd('0xc')]>0x0){if(moment(_0x455638[_0x65dd('0x11')])[_0x65dd('0x1a')](_0x38078c[_0x65dd('0xc')],_0x65dd('0x1b'))>moment()){return _0x4c75d6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x65dd('0x1c')](_0x455638,_0x2d00ac,![],null)['then'](function(){return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});});}}else{return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});}}else{if(_0x2d00ac>=_0x38078c['allowedLoginAttempts']){return utils[_0x65dd('0x1c')](_0x455638,0x0,!![],moment())[_0x65dd('0xd')](function(){return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});});}else{return utils[_0x65dd('0x1c')](_0x455638,_0x2d00ac,![],null)[_0x65dd('0xd')](function(){return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});});}}}else{return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});}}else{if(_0x455638[_0x65dd('0x18')]){return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});}else if(_0x38078c['allowedLoginAttempts']>0x0){if(_0x455638[_0x65dd('0x10')]){if(_0x38078c[_0x65dd('0xc')]>0x0){if(moment(_0x455638[_0x65dd('0x11')])[_0x65dd('0x1a')](_0x38078c[_0x65dd('0xc')],_0x65dd('0x1b'))>moment()){return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});}else{return utils[_0x65dd('0x1c')](_0x455638,0x0,![],null)[_0x65dd('0xd')](function(){return utils[_0x65dd('0x1e')](_0x455638);})[_0x65dd('0xd')](function(){return _0x4c75d6(null,_0x455638);});}}else{return _0x4c75d6(null,![],{'message':_0x65dd('0x1d')});}}else{return utils[_0x65dd('0x1c')](_0x455638,0x0,![],null)[_0x65dd('0xd')](function(){return utils['getLicense'](_0x455638);})[_0x65dd('0xd')](function(){return _0x4c75d6(null,_0x455638);})[_0x65dd('0x1f')](function(_0x572840){return _0x4c75d6(null,![],_0x572840);});}}else{if(_0x455638['blocked']){return _0x4c75d6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x65dd('0x1e')](_0x455638)[_0x65dd('0xd')](function(){return _0x4c75d6(null,_0x455638);});}}}});})['catch'](function(_0x27a68c){return _0x4c75d6(null,![],_0x27a68c);});}function sendServiceMail(_0x590849){return db[_0x65dd('0x20')][_0x65dd('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x65dd('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x65dd('0x23')}]})[_0x65dd('0xd')](function(_0xefef8e){if(!_0xefef8e){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x152e2d={'tls':{'rejectUnauthorized':![]}};if(_0xefef8e['Smtp'][_0x65dd('0x24')]){_0x152e2d[_0x65dd('0x24')]=_0xefef8e['Smtp'][_0x65dd('0x24')];}else{_0x152e2d['host']=_0xefef8e[_0x65dd('0x23')][_0x65dd('0x25')];_0x152e2d['port']=_0xefef8e['Smtp'][_0x65dd('0x26')];_0x152e2d['secure']=_0xefef8e[_0x65dd('0x23')][_0x65dd('0x27')];}if(_0xefef8e[_0x65dd('0x23')][_0x65dd('0x28')]){_0x152e2d[_0x65dd('0x29')]={'user':_0xefef8e['Smtp'][_0x65dd('0x14')],'pass':_0xefef8e[_0x65dd('0x23')][_0x65dd('0x2a')]};}var _0x16491f={'account':_0x152e2d,'message':_[_0x65dd('0x2b')]({'from':util[_0x65dd('0x2c')](_0x65dd('0x2d'),_0xefef8e[_0x65dd('0x16')],_0xefef8e[_0x65dd('0x22')]||_0xefef8e[_0x65dd('0x23')][_0x65dd('0x14')])},_0x590849)};return client[_0x65dd('0x2e')](_0x65dd('0x2f'),_0x16491f);})['then'](function(_0xdd030e){if(_0xdd030e[_0x65dd('0x30')]){throw new Error(util[_0x65dd('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xdd030e['error']['message']||JSON[_0x65dd('0x31')](_0xdd030e[_0x65dd('0x30')])));}return!![];});}function handleError(_0x4eea43,_0x833af2,_0xe3fbb8){return _0x4eea43[_0x65dd('0x32')](_0x833af2||0x1f4)[_0x65dd('0x33')]({'message':_0xe3fbb8?_0xe3fbb8[_0x65dd('0x34')]||_0xe3fbb8:''});}function checkPasswordPattern(_0x1f50a7,_0x4dd084,_0x248a07){if(_0x248a07){var _0x52a67a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x52a67a[_0x65dd('0x35')](_0x4dd084)){return _0x1f50a7;}else{throw new Error(_0x65dd('0x36'));}}else{return _0x1f50a7;}}exports[_0x65dd('0x37')]=function(_0x3da946,_0x3ea9a5,_0x2763d7){passport['authenticate'](_0x65dd('0x38'),function(_0x5a20b9,_0x4d57d1,_0x28c602){var _0x7c296d=_0x5a20b9||_0x28c602;if(_0x7c296d){return handleError(_0x3ea9a5,0x191,_0x7c296d);}if(!_0x4d57d1){return handleError(_0x3ea9a5,0x194,{'message':_0x65dd('0x39')});}else{var _0x2cf10a=signToken(_0x4d57d1['id'],_0x4d57d1['role']);_0x3ea9a5[_0x65dd('0x3a')]({'id':_0x4d57d1['id'],'token':_0x2cf10a,'statusCall':'','isAlreadyLogged':_0x4d57d1[_0x65dd('0x3b')]});}})(_0x3da946,_0x3ea9a5,_0x2763d7);};exports['forgot']=function(_0x4f78c7,_0x2ae5d6,_0x3eeac9){if(!_0x4f78c7[_0x65dd('0x3c')][_0x65dd('0x22')]){return handleError(_0x2ae5d6,0x1f4,{'message':_0x65dd('0x3d')});}var _0x4f181f=rs[_0x65dd('0x3e')]();_0x4f78c7['body'][_0x65dd('0x22')]=_0x4f78c7['body'][_0x65dd('0x22')][_0x65dd('0x3f')]()[_0x65dd('0x40')]();var _0x53d3b8;return db[_0x65dd('0xa')][_0x65dd('0xb')]({'where':{'id':0x1},'attributes':[_0x65dd('0x19'),_0x65dd('0xc')],'raw':!![]})[_0x65dd('0xd')](function(_0x27f967){_0x53d3b8=_0x27f967;return db['User'][_0x65dd('0x21')]({'where':{'email':_0x4f78c7['body'][_0x65dd('0x22')]}});})[_0x65dd('0xd')](function(_0x1c9e61){if(!_0x1c9e61){throw new Error(_0x65dd('0x41'));}if(_0x1c9e61[_0x65dd('0x18')]){throw new Error(_0x65dd('0x42'));}if(_0x1c9e61['blocked']){if(moment(_0x1c9e61[_0x65dd('0x11')])[_0x65dd('0x1a')](_0x53d3b8[_0x65dd('0xc')],_0x65dd('0x1b'))>moment()){throw new Error(_0x65dd('0x43'));}else{_0x1c9e61[_0x65dd('0x10')]=![];_0x1c9e61[_0x65dd('0x11')]=null;}}_0x1c9e61[_0x65dd('0x44')]=_0x4f181f;_0x1c9e61['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x1c9e61[_0x65dd('0x45')]();})[_0x65dd('0xd')](function(){return sendServiceMail({'to':_0x4f78c7[_0x65dd('0x3c')][_0x65dd('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x65dd('0x46')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'http://'+_0x4f78c7[_0x65dd('0x47')][_0x65dd('0x25')]+'/reset/'+_0x4f181f+'\x0a\x0a'+_0x65dd('0x48')});})[_0x65dd('0xd')](function(){_0x2ae5d6['status'](0xc8)[_0x65dd('0x33')]({'message':_0x65dd('0x49')});})['catch'](function(_0x46713d){return handleError(_0x2ae5d6,0x1f4,_0x46713d);});};exports['reset']=function(_0x1947a8,_0xf47bb0,_0xcea607){var _0x3d7dde;return db['User']['find']({'where':{'resetPasswordToken':_0x1947a8[_0x65dd('0x4a')][_0x65dd('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x65dd('0x4c')]()}}})[_0x65dd('0xd')](function(_0x35ebb0){_0x3d7dde=_0x35ebb0;if(!_0x3d7dde){throw new Error(_0x65dd('0x4d'));}return db[_0x65dd('0xa')][_0x65dd('0xb')]({'attributes':['id',_0x65dd('0x4e')]});})[_0x65dd('0xd')](function(_0x55311d){return checkPasswordPattern(_0x55311d,_0x1947a8['body']['password'],_0x55311d[_0x65dd('0x4e')]);})[_0x65dd('0xd')](function(){_0x3d7dde[_0x65dd('0x4f')]=_0x1947a8[_0x65dd('0x3c')]['password'];_0x3d7dde[_0x65dd('0x44')]=null;_0x3d7dde[_0x65dd('0x50')]=null;return _0x3d7dde[_0x65dd('0x45')]();})[_0x65dd('0xd')](function(){_0xf47bb0['status'](0xc8)[_0x65dd('0x33')]({'message':_0x65dd('0x51')});})[_0x65dd('0x1f')](function(_0x22fbe9){return handleError(_0xf47bb0,0x1f4,_0x22fbe9);});};passport[_0x65dd('0x52')](new LocalStrategy({'usernameField':'name','passwordField':_0x65dd('0x4f')},function(_0x26eec1,_0x1be98c,_0x7160f7){return localAuthenticate(db[_0x65dd('0x53')],_0x26eec1,_0x1be98c,_0x7160f7);})); \ No newline at end of file +var _0x8755=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','signToken','../../config/utils','Setting','findOne','allowedLoginAttempts','name','password','salt','disabled','blocked','blockedAt','user','agent','then','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','minutes','clearBlockUser','add','catch','getLicense','MailAccount','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','role','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x1074ac,_0x4b13d1){var _0x10f789=function(_0x28469a){while(--_0x28469a){_0x1074ac['push'](_0x1074ac['shift']());}};_0x10f789(++_0x4b13d1);}(_0x8755,0x1f2));var _0x5875=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8755[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x5875('0x0'));var passport=require(_0x5875('0x1'));var LocalStrategy=require('passport-local')[_0x5875('0x2')];var jayson=require(_0x5875('0x3'));var _=require(_0x5875('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x5875('0x5'))['db'];var signToken=require(_0x5875('0x6'))[_0x5875('0x7')];var utils=require(_0x5875('0x8'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x5bcbd0,_0x27daac,_0x5f2cd1,_0x2f1f53){var _0x35f289,_0x4dc2c1;return db[_0x5875('0x9')][_0x5875('0xa')]({'where':{'id':0x1},'attributes':[_0x5875('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x3765cb){_0x35f289=_0x3765cb;return _0x5bcbd0[_0x5875('0xa')]({'attributes':['id',_0x5875('0xc'),_0x5875('0xd'),_0x5875('0xe'),'role',_0x5875('0xf'),_0x5875('0x10'),_0x5875('0x11'),'loginAttempts'],'where':{'name':_0x27daac,'role':{'$or':['admin',_0x5875('0x12'),_0x5875('0x13')]}}});})[_0x5875('0x14')](function(_0x3bbdac){if(!_0x3bbdac||_0x3bbdac&&_0x3bbdac[_0x5875('0xc')]!==_0x27daac){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4dc2c1=_0x3bbdac;return _0x4dc2c1;}})[_0x5875('0x14')](function(){_0x4dc2c1[_0x5875('0x15')](_0x5f2cd1,function(_0x479ffd,_0x596d68){var _0x245fa9=_0x4dc2c1[_0x5875('0x16')]+0x1;if(_0x479ffd){return _0x2f1f53(_0x479ffd);}else if(!_0x596d68){if(_0x4dc2c1['disabled']){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});}else if(_0x35f289[_0x5875('0xb')]>0x0){if(_0x4dc2c1['blocked']){if(_0x35f289[_0x5875('0x18')]>0x0){if(moment(_0x4dc2c1[_0x5875('0x11')])['add'](_0x35f289['blockDuration'],_0x5875('0x19'))>moment()){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});}else{return utils[_0x5875('0x1a')](_0x4dc2c1,_0x245fa9,![],null)[_0x5875('0x14')](function(){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});});}}else{return _0x2f1f53(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x245fa9>=_0x35f289[_0x5875('0xb')]){return utils[_0x5875('0x1a')](_0x4dc2c1,0x0,!![],moment())[_0x5875('0x14')](function(){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});});}else{return utils[_0x5875('0x1a')](_0x4dc2c1,_0x245fa9,![],null)[_0x5875('0x14')](function(){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});});}}}else{return _0x2f1f53(null,![],{'message':_0x5875('0x17')});}}else{if(_0x4dc2c1[_0x5875('0xf')]){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});}else if(_0x35f289[_0x5875('0xb')]>0x0){if(_0x4dc2c1[_0x5875('0x10')]){if(_0x35f289[_0x5875('0x18')]>0x0){if(moment(_0x4dc2c1['blockedAt'])[_0x5875('0x1b')](_0x35f289[_0x5875('0x18')],'minutes')>moment()){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});}else{return utils[_0x5875('0x1a')](_0x4dc2c1,0x0,![],null)[_0x5875('0x14')](function(){return utils['getLicense'](_0x4dc2c1);})['then'](function(){return _0x2f1f53(null,_0x4dc2c1);});}}else{return _0x2f1f53(null,![],{'message':_0x5875('0x17')});}}else{return utils[_0x5875('0x1a')](_0x4dc2c1,0x0,![],null)[_0x5875('0x14')](function(){return utils['getLicense'](_0x4dc2c1);})[_0x5875('0x14')](function(){return _0x2f1f53(null,_0x4dc2c1);})[_0x5875('0x1c')](function(_0x4b61ea){return _0x2f1f53(null,![],_0x4b61ea);});}}else{if(_0x4dc2c1[_0x5875('0x10')]){return _0x2f1f53(null,![],{'message':_0x5875('0x17')});}else{return utils[_0x5875('0x1d')](_0x4dc2c1)['then'](function(){return _0x2f1f53(null,_0x4dc2c1);});}}}});})['catch'](function(_0x176753){return _0x2f1f53(null,![],_0x176753);});}function sendServiceMail(_0x5b607a){return db[_0x5875('0x1e')][_0x5875('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x5875('0xc'),_0x5875('0x20')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x5875('0x14')](function(_0x15994e){if(!_0x15994e){throw new Error(_0x5875('0x21'));}var _0x18d297={'tls':{'rejectUnauthorized':![]}};if(_0x15994e['Smtp']['service']){_0x18d297[_0x5875('0x22')]=_0x15994e[_0x5875('0x23')]['service'];}else{_0x18d297['host']=_0x15994e[_0x5875('0x23')][_0x5875('0x24')];_0x18d297['port']=_0x15994e[_0x5875('0x23')][_0x5875('0x25')];_0x18d297[_0x5875('0x26')]=_0x15994e['Smtp'][_0x5875('0x26')];}if(_0x15994e[_0x5875('0x23')][_0x5875('0x27')]){_0x18d297[_0x5875('0x28')]={'user':_0x15994e['Smtp'][_0x5875('0x12')],'pass':_0x15994e[_0x5875('0x23')][_0x5875('0x29')]};}var _0x991d18={'account':_0x18d297,'message':_[_0x5875('0x2a')]({'from':util[_0x5875('0x2b')]('\x22%s\x22\x20<%s>',_0x15994e[_0x5875('0xc')],_0x15994e[_0x5875('0x20')]||_0x15994e['Smtp'][_0x5875('0x12')])},_0x5b607a)};return client[_0x5875('0x2c')](_0x5875('0x2d'),_0x991d18);})['then'](function(_0x4a9c8a){if(_0x4a9c8a[_0x5875('0x2e')]){throw new Error(util[_0x5875('0x2b')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4a9c8a['error'][_0x5875('0x2f')]||JSON[_0x5875('0x30')](_0x4a9c8a[_0x5875('0x2e')])));}return!![];});}function handleError(_0x1e0c36,_0xec2513,_0x1df461){return _0x1e0c36[_0x5875('0x31')](_0xec2513||0x1f4)[_0x5875('0x32')]({'message':_0x1df461?_0x1df461[_0x5875('0x2f')]||_0x1df461:''});}function checkPasswordPattern(_0x4d0851,_0x4bb37e,_0x35ffb0){if(_0x35ffb0){var _0x1899f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1899f2[_0x5875('0x33')](_0x4bb37e)){return _0x4d0851;}else{throw new Error(_0x5875('0x34'));}}else{return _0x4d0851;}}exports[_0x5875('0x35')]=function(_0x3ed634,_0x1b0d11,_0x2833ff){passport['authenticate']('local',function(_0x3d317e,_0x39ae91,_0x2ee95b){var _0x40fe7e=_0x3d317e||_0x2ee95b;if(_0x40fe7e){return handleError(_0x1b0d11,0x191,_0x40fe7e);}if(!_0x39ae91){return handleError(_0x1b0d11,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5f41cd=signToken(_0x39ae91['id'],_0x39ae91[_0x5875('0x36')]);_0x1b0d11[_0x5875('0x37')]({'id':_0x39ae91['id'],'token':_0x5f41cd,'statusCall':'','isAlreadyLogged':_0x39ae91[_0x5875('0x38')]});}})(_0x3ed634,_0x1b0d11,_0x2833ff);};exports[_0x5875('0x39')]=function(_0xb66852,_0x1991a0,_0x2a7c8d){if(!_0xb66852[_0x5875('0x3a')][_0x5875('0x20')]){return handleError(_0x1991a0,0x1f4,{'message':_0x5875('0x3b')});}var _0x4a74ea=rs[_0x5875('0x3c')]();_0xb66852[_0x5875('0x3a')][_0x5875('0x20')]=_0xb66852[_0x5875('0x3a')][_0x5875('0x20')][_0x5875('0x3d')]()[_0x5875('0x3e')]();var _0x1c8ad0;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5875('0x18')],'raw':!![]})['then'](function(_0x319c0e){_0x1c8ad0=_0x319c0e;return db['User'][_0x5875('0x1f')]({'where':{'email':_0xb66852[_0x5875('0x3a')][_0x5875('0x20')]}});})[_0x5875('0x14')](function(_0x12fff5){if(!_0x12fff5){throw new Error(_0x5875('0x3f'));}if(_0x12fff5[_0x5875('0xf')]){throw new Error(_0x5875('0x40'));}if(_0x12fff5[_0x5875('0x10')]){if(moment(_0x12fff5['blockedAt'])[_0x5875('0x1b')](_0x1c8ad0[_0x5875('0x18')],_0x5875('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x12fff5[_0x5875('0x10')]=![];_0x12fff5['blockedAt']=null;}}_0x12fff5[_0x5875('0x41')]=_0x4a74ea;_0x12fff5[_0x5875('0x42')]=Date['now']()+0x36ee80;return _0x12fff5[_0x5875('0x43')]();})[_0x5875('0x14')](function(){return sendServiceMail({'to':_0xb66852['body'][_0x5875('0x20')],'subject':_0x5875('0x44'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5875('0x45')+_0x5875('0x46')+_0xb66852[_0x5875('0x47')]['host']+'/reset/'+_0x4a74ea+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5875('0x14')](function(){_0x1991a0['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x5875('0x1c')](function(_0x5d866e){return handleError(_0x1991a0,0x1f4,_0x5d866e);});};exports[_0x5875('0x48')]=function(_0x4179b3,_0x21cc9e,_0x3e9e0f){var _0x2f56c2;return db[_0x5875('0x49')][_0x5875('0x1f')]({'where':{'resetPasswordToken':_0x4179b3[_0x5875('0x4a')][_0x5875('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x5875('0x4c')]()}}})['then'](function(_0x2a72c1){_0x2f56c2=_0x2a72c1;if(!_0x2f56c2){throw new Error(_0x5875('0x4d'));}return db[_0x5875('0x9')][_0x5875('0xa')]({'attributes':['id',_0x5875('0x4e')]});})[_0x5875('0x14')](function(_0x55fb2c){return checkPasswordPattern(_0x55fb2c,_0x4179b3[_0x5875('0x3a')][_0x5875('0xd')],_0x55fb2c[_0x5875('0x4e')]);})[_0x5875('0x14')](function(){_0x2f56c2['password']=_0x4179b3['body'][_0x5875('0xd')];_0x2f56c2[_0x5875('0x41')]=null;_0x2f56c2[_0x5875('0x42')]=null;return _0x2f56c2['save']();})[_0x5875('0x14')](function(){_0x21cc9e['status'](0xc8)[_0x5875('0x32')]({'message':_0x5875('0x4f')});})['catch'](function(_0xc61a4c){return handleError(_0x21cc9e,0x1f4,_0xc61a4c);});};passport[_0x5875('0x50')](new LocalStrategy({'usernameField':'name','passwordField':_0x5875('0xd')},function(_0x47ef90,_0x146985,_0x1430b1){return localAuthenticate(db['User'],_0x47ef90,_0x146985,_0x1430b1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 336d681..2abb65a 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 _0x4e5c=['express','Router','./authLocal.controller','post','login','/forgot','reset','exports'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x4e5c,0x158));var _0xc4e5=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x4e5c[_0x1b2ff7];return _0x31656a;};'use strict';var express=require(_0xc4e5('0x0'));var router=express[_0xc4e5('0x1')]();var controller=require(_0xc4e5('0x2'));router[_0xc4e5('0x3')]('/',controller[_0xc4e5('0x4')]);router[_0xc4e5('0x3')](_0xc4e5('0x5'),controller['forgot']);router['post']('/reset/:token',controller[_0xc4e5('0x6')]);module[_0xc4e5('0x7')]=router; \ No newline at end of file +var _0x86f6=['/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','post'];(function(_0x19c967,_0x4d538e){var _0x386e76=function(_0x5678e8){while(--_0x5678e8){_0x19c967['push'](_0x19c967['shift']());}};_0x386e76(++_0x4d538e);}(_0x86f6,0x184));var _0x686f=function(_0xa6d03f,_0xf2d260){_0xa6d03f=_0xa6d03f-0x0;var _0x2ba64f=_0x86f6[_0xa6d03f];return _0x2ba64f;};'use strict';var express=require(_0x686f('0x0'));var router=express[_0x686f('0x1')]();var controller=require(_0x686f('0x2'));router['post']('/',controller['login']);router[_0x686f('0x3')](_0x686f('0x4'),controller[_0x686f('0x5')]);router[_0x686f('0x3')](_0x686f('0x6'),controller['reset']);module[_0x686f('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 483a202..754f26e 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 _0x3cd0=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x369900,_0x400ff5){var _0x2e93a1=function(_0x1a472b){while(--_0x1a472b){_0x369900['push'](_0x369900['shift']());}};_0x2e93a1(++_0x400ff5);}(_0x3cd0,0x8a));var _0x03cd=function(_0x2aa48b,_0x5a4446){_0x2aa48b=_0x2aa48b-0x0;var _0x48caf8=_0x3cd0[_0x2aa48b];return _0x48caf8;};'use strict';var Sequelize=require(_0x03cd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x03cd('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x03cd('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x03cd('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xdb2b=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x4043f0,_0x3fb17b){var _0x3f0048=function(_0x4bc19c){while(--_0x4bc19c){_0x4043f0['push'](_0x4043f0['shift']());}};_0x3f0048(++_0x3fb17b);}(_0xdb2b,0xa2));var _0xbdb2=function(_0x2d6df9,_0x45da50){_0x2d6df9=_0x2d6df9-0x0;var _0x429b18=_0xdb2b[_0x2d6df9];return _0x429b18;};'use strict';var Sequelize=require(_0xbdb2('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdb2('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xbdb2('0x1')]},'description':{'type':Sequelize[_0xbdb2('0x1')]},'status':{'type':Sequelize[_0xbdb2('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbdb2('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 530aefd..b079a1b 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 _0x1cab=['params','addConditions','Condition','ids','findOne','getConditions','addActions','Action','omit','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','index','rawAttributes','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','type','key','field','filter','options','includeAll','include','findAll','catch','show','Automation','find','create','body','update'];(function(_0x822e1,_0x4dcc11){var _0x2da176=function(_0xf7e7ff){while(--_0xf7e7ff){_0x822e1['push'](_0x822e1['shift']());}};_0x2da176(++_0x4dcc11);}(_0x1cab,0xb2));var _0xb1ca=function(_0x2d12e6,_0x57f08a){_0x2d12e6=_0x2d12e6-0x0;var _0x258aa2=_0x1cab[_0x2d12e6];return _0x258aa2;};'use strict';var pdf=require(_0xb1ca('0x0'));var emlformat=require(_0xb1ca('0x1'));var rimraf=require(_0xb1ca('0x2'));var zipdir=require(_0xb1ca('0x3'));var jsonpatch=require(_0xb1ca('0x4'));var rp=require(_0xb1ca('0x5'));var moment=require('moment');var BPromise=require(_0xb1ca('0x6'));var Mustache=require(_0xb1ca('0x7'));var util=require(_0xb1ca('0x8'));var path=require(_0xb1ca('0x9'));var sox=require(_0xb1ca('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb1ca('0xb'));var squel=require(_0xb1ca('0xc'));var crypto=require(_0xb1ca('0xd'));var jsforce=require(_0xb1ca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb1ca('0xf'));var querystring=require(_0xb1ca('0x10'));var Papa=require(_0xb1ca('0x11'));var Redis=require('ioredis');var authService=require(_0xb1ca('0x12'));var qs=require(_0xb1ca('0x13'));var hardwareService=require(_0xb1ca('0x14'));var logger=require(_0xb1ca('0x15'))(_0xb1ca('0x16'));var utils=require(_0xb1ca('0x17'));var config=require(_0xb1ca('0x18'));var db=require(_0xb1ca('0x19'))['db'];function respondWithStatusCode(_0x5bf548,_0x2b1c9d){_0x2b1c9d=_0x2b1c9d||0xcc;return function(_0x53ddc5){if(_0x53ddc5){return _0x5bf548['sendStatus'](_0x2b1c9d);}return _0x5bf548[_0xb1ca('0x1a')](_0x2b1c9d)[_0xb1ca('0x1b')]();};}function respondWithResult(_0xf3e3f5,_0x1a88e4){_0x1a88e4=_0x1a88e4||0xc8;return function(_0x280667){if(_0x280667){return _0xf3e3f5['status'](_0x1a88e4)[_0xb1ca('0x1c')](_0x280667);}};}function respondWithFilteredResult(_0x4f8c66,_0x1ee355){return function(_0x4cb60c){if(_0x4cb60c){var _0x4b6a3d=_0x4cb60c[_0xb1ca('0x1d')],_0x334c30=_0x1ee355[_0xb1ca('0x1e')],_0x49ce09=_0x1ee355[_0xb1ca('0x1e')]+_0x1ee355[_0xb1ca('0x1f')],_0x3333c7;if(_0x49ce09>=_0x4b6a3d){_0x49ce09=_0x4b6a3d;_0x3333c7=0xc8;}else{_0x3333c7=0xce;}_0x4f8c66[_0xb1ca('0x1a')](_0x3333c7);return _0x4f8c66['set'](_0xb1ca('0x20'),_0x334c30+'-'+_0x49ce09+'/'+_0x4b6a3d)['json'](_0x4cb60c);}return null;};}function patchUpdates(_0x5813ab){return function(_0x2244dc){try{jsonpatch[_0xb1ca('0x21')](_0x2244dc,_0x5813ab,!![]);}catch(_0x5be16c){return BPromise[_0xb1ca('0x22')](_0x5be16c);}return _0x2244dc[_0xb1ca('0x23')]();};}function saveUpdates(_0x324359,_0x25b5ca){return function(_0x5cee4f){if(_0x5cee4f){return _0x5cee4f['update'](_0x324359)['then'](function(_0x3cbc81){return _0x3cbc81;});}return null;};}function removeEntity(_0xb3f909,_0x59f484){return function(_0x1ec5c5){if(_0x1ec5c5){return _0x1ec5c5[_0xb1ca('0x24')]()[_0xb1ca('0x25')](function(){_0xb3f909['status'](0xcc)[_0xb1ca('0x1b')]();});}};}function handleEntityNotFound(_0x2c8341,_0x259d77){return function(_0x30caab){if(!_0x30caab){_0x2c8341[_0xb1ca('0x26')](0x194);}return _0x30caab;};}function handleError(_0x544842,_0x1049f2){_0x1049f2=_0x1049f2||0x1f4;return function(_0x16ac2b){logger[_0xb1ca('0x27')](_0x16ac2b['stack']);if(_0x16ac2b[_0xb1ca('0x28')]){delete _0x16ac2b[_0xb1ca('0x28')];}_0x544842[_0xb1ca('0x1a')](_0x1049f2)['send'](_0x16ac2b);};}exports[_0xb1ca('0x29')]=function(_0x189d65,_0x4bc0a2){var _0x11f60f={},_0x53ad01={},_0x45d020={'count':0x0,'rows':[]};var _0x482408=db['Automation'][_0xb1ca('0x2a')];_0x53ad01['model']=_[_0xb1ca('0x2b')](_0x482408);_0x53ad01[_0xb1ca('0x2c')]=_[_0xb1ca('0x2b')](_0x189d65['query']);_0x53ad01['filters']=_[_0xb1ca('0x2d')](_0x53ad01['model'],_0x53ad01[_0xb1ca('0x2c')]);_0x11f60f[_0xb1ca('0x2e')]=_[_0xb1ca('0x2d')](_0x53ad01[_0xb1ca('0x2f')],qs['fields'](_0x189d65[_0xb1ca('0x2c')][_0xb1ca('0x30')]));_0x11f60f[_0xb1ca('0x2e')]=_0x11f60f[_0xb1ca('0x2e')][_0xb1ca('0x31')]?_0x11f60f[_0xb1ca('0x2e')]:_0x53ad01[_0xb1ca('0x2f')];if(!_0x189d65['query'][_0xb1ca('0x32')](_0xb1ca('0x33'))){_0x11f60f[_0xb1ca('0x1f')]=qs[_0xb1ca('0x1f')](_0x189d65[_0xb1ca('0x2c')][_0xb1ca('0x1f')]);_0x11f60f[_0xb1ca('0x1e')]=qs[_0xb1ca('0x1e')](_0x189d65[_0xb1ca('0x2c')]['offset']);}_0x11f60f[_0xb1ca('0x34')]=qs[_0xb1ca('0x35')](_0x189d65['query']['sort']);_0x11f60f['where']=qs[_0xb1ca('0x36')](_[_0xb1ca('0x37')](_0x189d65[_0xb1ca('0x2c')],_0x53ad01[_0xb1ca('0x36')]));if(_0x189d65[_0xb1ca('0x2c')]['filter']){_0x11f60f[_0xb1ca('0x38')]=_[_0xb1ca('0x39')](_0x11f60f[_0xb1ca('0x38')],{'$or':_[_0xb1ca('0x3a')](_0x482408,function(_0x4b97ba){if(_0x4b97ba[_0xb1ca('0x3b')][_0xb1ca('0x3c')]!=='VIRTUAL'){var _0x36f647={};_0x36f647[_0x4b97ba[_0xb1ca('0x3d')]]={'$like':'%'+_0x189d65[_0xb1ca('0x2c')][_0xb1ca('0x3e')]+'%'};return _0x36f647;}})});}_0x11f60f=_[_0xb1ca('0x39')]({},_0x11f60f,_0x189d65[_0xb1ca('0x3f')]);var _0x3ba140={'where':_0x11f60f[_0xb1ca('0x38')]};return db['Automation']['count'](_0x3ba140)[_0xb1ca('0x25')](function(_0x55b9a4){_0x45d020[_0xb1ca('0x1d')]=_0x55b9a4;if(_0x189d65[_0xb1ca('0x2c')][_0xb1ca('0x40')]){_0x11f60f[_0xb1ca('0x41')]=[{'all':!![]}];}return db['Automation'][_0xb1ca('0x42')](_0x11f60f);})[_0xb1ca('0x25')](function(_0x4f5ea7){_0x45d020['rows']=_0x4f5ea7;return _0x45d020;})['then'](respondWithFilteredResult(_0x4bc0a2,_0x11f60f))[_0xb1ca('0x43')](handleError(_0x4bc0a2,null));};exports[_0xb1ca('0x44')]=function(_0x2ecc37,_0x86c230){var _0x218f9c={'raw':![],'where':{'id':_0x2ecc37['params']['id']}},_0x2178d4={};_0x2178d4[_0xb1ca('0x2f')]=_[_0xb1ca('0x2b')](db[_0xb1ca('0x45')]['rawAttributes']);_0x2178d4[_0xb1ca('0x2c')]=_['keys'](_0x2ecc37['query']);_0x2178d4[_0xb1ca('0x36')]=_[_0xb1ca('0x2d')](_0x2178d4['model'],_0x2178d4[_0xb1ca('0x2c')]);_0x218f9c[_0xb1ca('0x2e')]=_[_0xb1ca('0x2d')](_0x2178d4[_0xb1ca('0x2f')],qs['fields'](_0x2ecc37[_0xb1ca('0x2c')][_0xb1ca('0x30')]));_0x218f9c['attributes']=_0x218f9c[_0xb1ca('0x2e')]['length']?_0x218f9c[_0xb1ca('0x2e')]:_0x2178d4[_0xb1ca('0x2f')];if(_0x2ecc37[_0xb1ca('0x2c')]['includeAll']){_0x218f9c[_0xb1ca('0x41')]=[{'all':!![]}];}_0x218f9c=_[_0xb1ca('0x39')]({},_0x218f9c,_0x2ecc37['options']);return db[_0xb1ca('0x45')][_0xb1ca('0x46')](_0x218f9c)['then'](handleEntityNotFound(_0x86c230,null))[_0xb1ca('0x25')](respondWithResult(_0x86c230,null))[_0xb1ca('0x43')](handleError(_0x86c230,null));};exports['create']=function(_0x797f51,_0x13f13b){return db[_0xb1ca('0x45')][_0xb1ca('0x47')](_0x797f51[_0xb1ca('0x48')],{})[_0xb1ca('0x25')](respondWithResult(_0x13f13b,0xc9))['catch'](handleError(_0x13f13b,null));};exports[_0xb1ca('0x49')]=function(_0x3bf547,_0x32f634){if(_0x3bf547[_0xb1ca('0x48')]['id']){delete _0x3bf547[_0xb1ca('0x48')]['id'];}return db[_0xb1ca('0x45')][_0xb1ca('0x46')]({'where':{'id':_0x3bf547[_0xb1ca('0x4a')]['id']}})[_0xb1ca('0x25')](handleEntityNotFound(_0x32f634,null))['then'](saveUpdates(_0x3bf547[_0xb1ca('0x48')],null))[_0xb1ca('0x25')](respondWithResult(_0x32f634,null))['catch'](handleError(_0x32f634,null));};exports['destroy']=function(_0x182210,_0x5a7153){return db['Automation'][_0xb1ca('0x46')]({'where':{'id':_0x182210[_0xb1ca('0x4a')]['id']}})[_0xb1ca('0x25')](handleEntityNotFound(_0x5a7153,null))[_0xb1ca('0x25')](removeEntity(_0x5a7153,null))[_0xb1ca('0x43')](handleError(_0x5a7153,null));};exports[_0xb1ca('0x4b')]=function(_0x4e9d88,_0x14aef6,_0x48705f){return db[_0xb1ca('0x4c')][_0xb1ca('0x46')]({'where':{'id':_0x4e9d88['params']['id']}})[_0xb1ca('0x25')](handleEntityNotFound(_0x14aef6,null))[_0xb1ca('0x25')](function(_0x4f43fb){if(_0x4f43fb){return _0x4f43fb[_0xb1ca('0x4b')](_0x4e9d88['body'][_0xb1ca('0x4d')],_['omit'](_0x4e9d88[_0xb1ca('0x48')],[_0xb1ca('0x4d'),'id'])||{});}})[_0xb1ca('0x25')](respondWithResult(_0x14aef6,null))[_0xb1ca('0x43')](handleError(_0x14aef6,null));};exports['getConditions']=function(_0x2cfb2e,_0x1c6ab9,_0x1c9d52){var _0x5750a4={};var _0x20bed7={};var _0x371551;var _0x1338e9;return db[_0xb1ca('0x45')][_0xb1ca('0x4e')]({'where':{'id':_0x2cfb2e[_0xb1ca('0x4a')]['id']}})[_0xb1ca('0x25')](handleEntityNotFound(_0x1c6ab9,null))[_0xb1ca('0x25')](function(_0x1ba2a0){if(_0x1ba2a0){_0x371551=_0x1ba2a0;_0x20bed7['model']=_[_0xb1ca('0x2b')](db['Condition'][_0xb1ca('0x2a')]);_0x20bed7[_0xb1ca('0x2c')]=_[_0xb1ca('0x2b')](_0x2cfb2e['query']);_0x20bed7[_0xb1ca('0x36')]=_['intersection'](_0x20bed7[_0xb1ca('0x2f')],_0x20bed7[_0xb1ca('0x2c')]);_0x5750a4[_0xb1ca('0x2e')]=_[_0xb1ca('0x2d')](_0x20bed7[_0xb1ca('0x2f')],qs[_0xb1ca('0x30')](_0x2cfb2e[_0xb1ca('0x2c')][_0xb1ca('0x30')]));_0x5750a4[_0xb1ca('0x2e')]=_0x5750a4[_0xb1ca('0x2e')][_0xb1ca('0x31')]?_0x5750a4[_0xb1ca('0x2e')]:_0x20bed7['model'];_0x5750a4[_0xb1ca('0x34')]=qs['sort'](_0x2cfb2e[_0xb1ca('0x2c')][_0xb1ca('0x35')]);_0x5750a4[_0xb1ca('0x38')]=qs[_0xb1ca('0x36')](_[_0xb1ca('0x37')](_0x2cfb2e['query'],_0x20bed7[_0xb1ca('0x36')]));if(_0x2cfb2e[_0xb1ca('0x2c')][_0xb1ca('0x3e')]){_0x5750a4[_0xb1ca('0x38')]=_[_0xb1ca('0x39')](_0x5750a4[_0xb1ca('0x38')],{'$or':_[_0xb1ca('0x3a')](_0x5750a4[_0xb1ca('0x2e')],function(_0x39157a){var _0xfb881={};_0xfb881[_0x39157a]={'$like':'%'+_0x2cfb2e['query']['filter']+'%'};return _0xfb881;})});}_0x5750a4=_[_0xb1ca('0x39')]({},_0x5750a4,_0x2cfb2e[_0xb1ca('0x3f')]);return _0x371551['getConditions'](_0x5750a4);}})['then'](function(_0x25dcd6){if(_0x25dcd6){_0x1338e9=_0x25dcd6[_0xb1ca('0x31')];if(!_0x2cfb2e[_0xb1ca('0x2c')][_0xb1ca('0x32')](_0xb1ca('0x33'))){_0x5750a4[_0xb1ca('0x1f')]=qs[_0xb1ca('0x1f')](_0x2cfb2e[_0xb1ca('0x2c')][_0xb1ca('0x1f')]);_0x5750a4[_0xb1ca('0x1e')]=qs[_0xb1ca('0x1e')](_0x2cfb2e[_0xb1ca('0x2c')][_0xb1ca('0x1e')]);}return _0x371551[_0xb1ca('0x4f')](_0x5750a4);}})[_0xb1ca('0x25')](function(_0x2d5400){if(_0x2d5400){return _0x2d5400?{'count':_0x1338e9,'rows':_0x2d5400}:null;}})['then'](respondWithResult(_0x1c6ab9,null))[_0xb1ca('0x43')](handleError(_0x1c6ab9,null));};exports[_0xb1ca('0x50')]=function(_0x19d7e0,_0x4f4a81,_0x2ca818){return db[_0xb1ca('0x51')][_0xb1ca('0x46')]({'where':{'id':_0x19d7e0[_0xb1ca('0x4a')]['id']}})[_0xb1ca('0x25')](handleEntityNotFound(_0x4f4a81,null))[_0xb1ca('0x25')](function(_0xd952c3){if(_0xd952c3){return _0xd952c3['addActions'](_0x19d7e0['body']['ids'],_[_0xb1ca('0x52')](_0x19d7e0[_0xb1ca('0x48')],[_0xb1ca('0x4d'),'id'])||{});}})[_0xb1ca('0x25')](respondWithResult(_0x4f4a81,null))[_0xb1ca('0x43')](handleError(_0x4f4a81,null));};exports['getActions']=function(_0x1054b4,_0x3f184b,_0x181c4f){var _0x5a180f={};var _0x445281={};var _0x4a684f;var _0x42231f;return db['Automation'][_0xb1ca('0x4e')]({'where':{'id':_0x1054b4[_0xb1ca('0x4a')]['id']}})[_0xb1ca('0x25')](handleEntityNotFound(_0x3f184b,null))[_0xb1ca('0x25')](function(_0x553065){if(_0x553065){_0x4a684f=_0x553065;_0x445281[_0xb1ca('0x2f')]=_['keys'](db[_0xb1ca('0x51')]['rawAttributes']);_0x445281['query']=_[_0xb1ca('0x2b')](_0x1054b4[_0xb1ca('0x2c')]);_0x445281[_0xb1ca('0x36')]=_[_0xb1ca('0x2d')](_0x445281[_0xb1ca('0x2f')],_0x445281[_0xb1ca('0x2c')]);_0x5a180f[_0xb1ca('0x2e')]=_[_0xb1ca('0x2d')](_0x445281['model'],qs[_0xb1ca('0x30')](_0x1054b4[_0xb1ca('0x2c')][_0xb1ca('0x30')]));_0x5a180f[_0xb1ca('0x2e')]=_0x5a180f['attributes'][_0xb1ca('0x31')]?_0x5a180f[_0xb1ca('0x2e')]:_0x445281[_0xb1ca('0x2f')];_0x5a180f['order']=qs['sort'](_0x1054b4[_0xb1ca('0x2c')]['sort']);_0x5a180f['where']=qs[_0xb1ca('0x36')](_[_0xb1ca('0x37')](_0x1054b4[_0xb1ca('0x2c')],_0x445281[_0xb1ca('0x36')]));if(_0x1054b4[_0xb1ca('0x2c')][_0xb1ca('0x3e')]){_0x5a180f['where']=_[_0xb1ca('0x39')](_0x5a180f[_0xb1ca('0x38')],{'$or':_[_0xb1ca('0x3a')](_0x5a180f[_0xb1ca('0x2e')],function(_0xf72c2d){var _0x470b32={};_0x470b32[_0xf72c2d]={'$like':'%'+_0x1054b4[_0xb1ca('0x2c')]['filter']+'%'};return _0x470b32;})});}_0x5a180f=_['merge']({},_0x5a180f,_0x1054b4['options']);return _0x4a684f[_0xb1ca('0x53')](_0x5a180f);}})[_0xb1ca('0x25')](function(_0x33423d){if(_0x33423d){_0x42231f=_0x33423d[_0xb1ca('0x31')];if(!_0x1054b4[_0xb1ca('0x2c')][_0xb1ca('0x32')](_0xb1ca('0x33'))){_0x5a180f[_0xb1ca('0x1f')]=qs[_0xb1ca('0x1f')](_0x1054b4['query']['limit']);_0x5a180f['offset']=qs['offset'](_0x1054b4[_0xb1ca('0x2c')][_0xb1ca('0x1e')]);}return _0x4a684f[_0xb1ca('0x53')](_0x5a180f);}})[_0xb1ca('0x25')](function(_0x3e0be7){if(_0x3e0be7){return _0x3e0be7?{'count':_0x42231f,'rows':_0x3e0be7}:null;}})[_0xb1ca('0x25')](respondWithResult(_0x3f184b,null))['catch'](handleError(_0x3f184b,null));}; \ No newline at end of file +var _0xa9b8=['crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','send','index','Automation','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','params','keys','find','create','body','update','addConditions','Condition','omit','ids','getConditions','findOne','pick','merge','addActions','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x55f9ec,_0x34cbfd){var _0x3a4615=function(_0x3e6262){while(--_0x3e6262){_0x55f9ec['push'](_0x55f9ec['shift']());}};_0x3a4615(++_0x34cbfd);}(_0xa9b8,0x94));var _0x8a9b=function(_0xe8488a,_0x17e498){_0xe8488a=_0xe8488a-0x0;var _0x31af4e=_0xa9b8[_0xe8488a];return _0x31af4e;};'use strict';var pdf=require(_0x8a9b('0x0'));var emlformat=require(_0x8a9b('0x1'));var rimraf=require(_0x8a9b('0x2'));var zipdir=require(_0x8a9b('0x3'));var jsonpatch=require(_0x8a9b('0x4'));var rp=require(_0x8a9b('0x5'));var moment=require(_0x8a9b('0x6'));var BPromise=require(_0x8a9b('0x7'));var Mustache=require(_0x8a9b('0x8'));var util=require('util');var path=require(_0x8a9b('0x9'));var sox=require(_0x8a9b('0xa'));var csv=require('to-csv');var ejs=require(_0x8a9b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a9b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a9b('0xd'));var toCsv=require(_0x8a9b('0xe'));var querystring=require('querystring');var Papa=require(_0x8a9b('0xf'));var Redis=require('ioredis');var authService=require(_0x8a9b('0x10'));var qs=require(_0x8a9b('0x11'));var hardwareService=require(_0x8a9b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8a9b('0x13'));var config=require('../../config/environment');var db=require(_0x8a9b('0x14'))['db'];function respondWithStatusCode(_0x3bafb1,_0x355959){_0x355959=_0x355959||0xcc;return function(_0x17ad58){if(_0x17ad58){return _0x3bafb1[_0x8a9b('0x15')](_0x355959);}return _0x3bafb1[_0x8a9b('0x16')](_0x355959)[_0x8a9b('0x17')]();};}function respondWithResult(_0x60b771,_0xf4bac7){_0xf4bac7=_0xf4bac7||0xc8;return function(_0x12d856){if(_0x12d856){return _0x60b771['status'](_0xf4bac7)[_0x8a9b('0x18')](_0x12d856);}};}function respondWithFilteredResult(_0x4cd520,_0x58f067){return function(_0x296250){if(_0x296250){var _0x559ad9=_0x296250[_0x8a9b('0x19')],_0x5e7cad=_0x58f067[_0x8a9b('0x1a')],_0x25d43e=_0x58f067[_0x8a9b('0x1a')]+_0x58f067[_0x8a9b('0x1b')],_0x5794d0;if(_0x25d43e>=_0x559ad9){_0x25d43e=_0x559ad9;_0x5794d0=0xc8;}else{_0x5794d0=0xce;}_0x4cd520[_0x8a9b('0x16')](_0x5794d0);return _0x4cd520[_0x8a9b('0x1c')](_0x8a9b('0x1d'),_0x5e7cad+'-'+_0x25d43e+'/'+_0x559ad9)['json'](_0x296250);}return null;};}function patchUpdates(_0xe8bbad){return function(_0x595cb8){try{jsonpatch[_0x8a9b('0x1e')](_0x595cb8,_0xe8bbad,!![]);}catch(_0x48c7aa){return BPromise[_0x8a9b('0x1f')](_0x48c7aa);}return _0x595cb8[_0x8a9b('0x20')]();};}function saveUpdates(_0x1bae5e,_0x1f90d9){return function(_0x5f2ef7){if(_0x5f2ef7){return _0x5f2ef7['update'](_0x1bae5e)[_0x8a9b('0x21')](function(_0xb5aac9){return _0xb5aac9;});}return null;};}function removeEntity(_0x51d789,_0x12b5fb){return function(_0x30bfde){if(_0x30bfde){return _0x30bfde[_0x8a9b('0x22')]()[_0x8a9b('0x21')](function(){_0x51d789['status'](0xcc)[_0x8a9b('0x17')]();});}};}function handleEntityNotFound(_0x38d6fa,_0x3a194f){return function(_0x4a31eb){if(!_0x4a31eb){_0x38d6fa['sendStatus'](0x194);}return _0x4a31eb;};}function handleError(_0x829837,_0xed44b2){_0xed44b2=_0xed44b2||0x1f4;return function(_0x3580a9){logger[_0x8a9b('0x23')](_0x3580a9['stack']);if(_0x3580a9['name']){delete _0x3580a9['name'];}_0x829837[_0x8a9b('0x16')](_0xed44b2)[_0x8a9b('0x24')](_0x3580a9);};}exports[_0x8a9b('0x25')]=function(_0x40863b,_0x5d8fe1){var _0x55cf9a={},_0x402a8d={},_0x1cd2e0={'count':0x0,'rows':[]};var _0x3b64d3=db[_0x8a9b('0x26')][_0x8a9b('0x27')];_0x402a8d[_0x8a9b('0x28')]=_['keys'](_0x3b64d3);_0x402a8d[_0x8a9b('0x29')]=_['keys'](_0x40863b[_0x8a9b('0x29')]);_0x402a8d[_0x8a9b('0x2a')]=_[_0x8a9b('0x2b')](_0x402a8d[_0x8a9b('0x28')],_0x402a8d[_0x8a9b('0x29')]);_0x55cf9a[_0x8a9b('0x2c')]=_[_0x8a9b('0x2b')](_0x402a8d['model'],qs[_0x8a9b('0x2d')](_0x40863b[_0x8a9b('0x29')][_0x8a9b('0x2d')]));_0x55cf9a[_0x8a9b('0x2c')]=_0x55cf9a[_0x8a9b('0x2c')][_0x8a9b('0x2e')]?_0x55cf9a[_0x8a9b('0x2c')]:_0x402a8d[_0x8a9b('0x28')];if(!_0x40863b[_0x8a9b('0x29')][_0x8a9b('0x2f')](_0x8a9b('0x30'))){_0x55cf9a[_0x8a9b('0x1b')]=qs['limit'](_0x40863b[_0x8a9b('0x29')][_0x8a9b('0x1b')]);_0x55cf9a[_0x8a9b('0x1a')]=qs['offset'](_0x40863b[_0x8a9b('0x29')][_0x8a9b('0x1a')]);}_0x55cf9a[_0x8a9b('0x31')]=qs['sort'](_0x40863b[_0x8a9b('0x29')][_0x8a9b('0x32')]);_0x55cf9a[_0x8a9b('0x33')]=qs[_0x8a9b('0x2a')](_['pick'](_0x40863b[_0x8a9b('0x29')],_0x402a8d[_0x8a9b('0x2a')]));if(_0x40863b[_0x8a9b('0x29')]['filter']){_0x55cf9a['where']=_['merge'](_0x55cf9a['where'],{'$or':_[_0x8a9b('0x34')](_0x3b64d3,function(_0x34a338){if(_0x34a338[_0x8a9b('0x35')][_0x8a9b('0x36')]!==_0x8a9b('0x37')){var _0x330383={};_0x330383[_0x34a338[_0x8a9b('0x38')]]={'$like':'%'+_0x40863b[_0x8a9b('0x29')][_0x8a9b('0x39')]+'%'};return _0x330383;}})});}_0x55cf9a=_['merge']({},_0x55cf9a,_0x40863b[_0x8a9b('0x3a')]);var _0x33d2ef={'where':_0x55cf9a[_0x8a9b('0x33')]};return db['Automation'][_0x8a9b('0x19')](_0x33d2ef)[_0x8a9b('0x21')](function(_0x4d23b5){_0x1cd2e0['count']=_0x4d23b5;if(_0x40863b[_0x8a9b('0x29')][_0x8a9b('0x3b')]){_0x55cf9a[_0x8a9b('0x3c')]=[{'all':!![]}];}return db[_0x8a9b('0x26')]['findAll'](_0x55cf9a);})[_0x8a9b('0x21')](function(_0x941a93){_0x1cd2e0[_0x8a9b('0x3d')]=_0x941a93;return _0x1cd2e0;})[_0x8a9b('0x21')](respondWithFilteredResult(_0x5d8fe1,_0x55cf9a))[_0x8a9b('0x3e')](handleError(_0x5d8fe1,null));};exports['show']=function(_0x891cc7,_0x1cdf30){var _0x2d8ba9={'raw':![],'where':{'id':_0x891cc7[_0x8a9b('0x3f')]['id']}},_0x4b2c28={};_0x4b2c28['model']=_[_0x8a9b('0x40')](db['Automation'][_0x8a9b('0x27')]);_0x4b2c28[_0x8a9b('0x29')]=_['keys'](_0x891cc7[_0x8a9b('0x29')]);_0x4b2c28[_0x8a9b('0x2a')]=_[_0x8a9b('0x2b')](_0x4b2c28[_0x8a9b('0x28')],_0x4b2c28[_0x8a9b('0x29')]);_0x2d8ba9[_0x8a9b('0x2c')]=_['intersection'](_0x4b2c28['model'],qs[_0x8a9b('0x2d')](_0x891cc7['query'][_0x8a9b('0x2d')]));_0x2d8ba9['attributes']=_0x2d8ba9['attributes']['length']?_0x2d8ba9[_0x8a9b('0x2c')]:_0x4b2c28[_0x8a9b('0x28')];if(_0x891cc7[_0x8a9b('0x29')][_0x8a9b('0x3b')]){_0x2d8ba9[_0x8a9b('0x3c')]=[{'all':!![]}];}_0x2d8ba9=_['merge']({},_0x2d8ba9,_0x891cc7['options']);return db[_0x8a9b('0x26')][_0x8a9b('0x41')](_0x2d8ba9)['then'](handleEntityNotFound(_0x1cdf30,null))[_0x8a9b('0x21')](respondWithResult(_0x1cdf30,null))[_0x8a9b('0x3e')](handleError(_0x1cdf30,null));};exports['create']=function(_0xf04e6e,_0x3385e0){return db['Automation'][_0x8a9b('0x42')](_0xf04e6e[_0x8a9b('0x43')],{})[_0x8a9b('0x21')](respondWithResult(_0x3385e0,0xc9))['catch'](handleError(_0x3385e0,null));};exports[_0x8a9b('0x44')]=function(_0x562e4f,_0x45eb54){if(_0x562e4f['body']['id']){delete _0x562e4f['body']['id'];}return db[_0x8a9b('0x26')][_0x8a9b('0x41')]({'where':{'id':_0x562e4f[_0x8a9b('0x3f')]['id']}})[_0x8a9b('0x21')](handleEntityNotFound(_0x45eb54,null))[_0x8a9b('0x21')](saveUpdates(_0x562e4f[_0x8a9b('0x43')],null))[_0x8a9b('0x21')](respondWithResult(_0x45eb54,null))['catch'](handleError(_0x45eb54,null));};exports['destroy']=function(_0x20d6ec,_0xfd8cc1){return db[_0x8a9b('0x26')][_0x8a9b('0x41')]({'where':{'id':_0x20d6ec[_0x8a9b('0x3f')]['id']}})[_0x8a9b('0x21')](handleEntityNotFound(_0xfd8cc1,null))['then'](removeEntity(_0xfd8cc1,null))[_0x8a9b('0x3e')](handleError(_0xfd8cc1,null));};exports[_0x8a9b('0x45')]=function(_0x5b565a,_0x286efb,_0x4f66f4){return db[_0x8a9b('0x46')][_0x8a9b('0x41')]({'where':{'id':_0x5b565a[_0x8a9b('0x3f')]['id']}})[_0x8a9b('0x21')](handleEntityNotFound(_0x286efb,null))[_0x8a9b('0x21')](function(_0x1b6f3d){if(_0x1b6f3d){return _0x1b6f3d['addConditions'](_0x5b565a['body']['ids'],_[_0x8a9b('0x47')](_0x5b565a[_0x8a9b('0x43')],[_0x8a9b('0x48'),'id'])||{});}})[_0x8a9b('0x21')](respondWithResult(_0x286efb,null))[_0x8a9b('0x3e')](handleError(_0x286efb,null));};exports[_0x8a9b('0x49')]=function(_0x154fcd,_0x37661d,_0x5ddbe9){var _0x10c744={};var _0x2475d3={};var _0x4d11ae;var _0x4b880c;return db['Automation'][_0x8a9b('0x4a')]({'where':{'id':_0x154fcd[_0x8a9b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x37661d,null))[_0x8a9b('0x21')](function(_0x4e2b0e){if(_0x4e2b0e){_0x4d11ae=_0x4e2b0e;_0x2475d3['model']=_['keys'](db[_0x8a9b('0x46')][_0x8a9b('0x27')]);_0x2475d3[_0x8a9b('0x29')]=_[_0x8a9b('0x40')](_0x154fcd['query']);_0x2475d3['filters']=_[_0x8a9b('0x2b')](_0x2475d3[_0x8a9b('0x28')],_0x2475d3[_0x8a9b('0x29')]);_0x10c744['attributes']=_['intersection'](_0x2475d3['model'],qs[_0x8a9b('0x2d')](_0x154fcd[_0x8a9b('0x29')][_0x8a9b('0x2d')]));_0x10c744['attributes']=_0x10c744['attributes']['length']?_0x10c744[_0x8a9b('0x2c')]:_0x2475d3[_0x8a9b('0x28')];_0x10c744[_0x8a9b('0x31')]=qs[_0x8a9b('0x32')](_0x154fcd[_0x8a9b('0x29')][_0x8a9b('0x32')]);_0x10c744[_0x8a9b('0x33')]=qs[_0x8a9b('0x2a')](_[_0x8a9b('0x4b')](_0x154fcd['query'],_0x2475d3[_0x8a9b('0x2a')]));if(_0x154fcd[_0x8a9b('0x29')][_0x8a9b('0x39')]){_0x10c744[_0x8a9b('0x33')]=_[_0x8a9b('0x4c')](_0x10c744[_0x8a9b('0x33')],{'$or':_[_0x8a9b('0x34')](_0x10c744[_0x8a9b('0x2c')],function(_0x17ea41){var _0x1756e5={};_0x1756e5[_0x17ea41]={'$like':'%'+_0x154fcd[_0x8a9b('0x29')]['filter']+'%'};return _0x1756e5;})});}_0x10c744=_[_0x8a9b('0x4c')]({},_0x10c744,_0x154fcd[_0x8a9b('0x3a')]);return _0x4d11ae[_0x8a9b('0x49')](_0x10c744);}})[_0x8a9b('0x21')](function(_0x4b786a){if(_0x4b786a){_0x4b880c=_0x4b786a[_0x8a9b('0x2e')];if(!_0x154fcd['query'][_0x8a9b('0x2f')](_0x8a9b('0x30'))){_0x10c744[_0x8a9b('0x1b')]=qs[_0x8a9b('0x1b')](_0x154fcd[_0x8a9b('0x29')]['limit']);_0x10c744[_0x8a9b('0x1a')]=qs[_0x8a9b('0x1a')](_0x154fcd[_0x8a9b('0x29')]['offset']);}return _0x4d11ae[_0x8a9b('0x49')](_0x10c744);}})[_0x8a9b('0x21')](function(_0x574531){if(_0x574531){return _0x574531?{'count':_0x4b880c,'rows':_0x574531}:null;}})[_0x8a9b('0x21')](respondWithResult(_0x37661d,null))[_0x8a9b('0x3e')](handleError(_0x37661d,null));};exports[_0x8a9b('0x4d')]=function(_0x4f88d1,_0x2e297b,_0x2239a2){return db[_0x8a9b('0x4e')][_0x8a9b('0x41')]({'where':{'id':_0x4f88d1['params']['id']}})['then'](handleEntityNotFound(_0x2e297b,null))[_0x8a9b('0x21')](function(_0x2ca62c){if(_0x2ca62c){return _0x2ca62c['addActions'](_0x4f88d1[_0x8a9b('0x43')][_0x8a9b('0x48')],_[_0x8a9b('0x47')](_0x4f88d1[_0x8a9b('0x43')],[_0x8a9b('0x48'),'id'])||{});}})['then'](respondWithResult(_0x2e297b,null))[_0x8a9b('0x3e')](handleError(_0x2e297b,null));};exports[_0x8a9b('0x4f')]=function(_0x321f2f,_0x56dc19,_0x4091af){var _0xd0aa59={};var _0x5bbf3a={};var _0x1b99b0;var _0x2754c5;return db[_0x8a9b('0x26')]['findOne']({'where':{'id':_0x321f2f[_0x8a9b('0x3f')]['id']}})[_0x8a9b('0x21')](handleEntityNotFound(_0x56dc19,null))[_0x8a9b('0x21')](function(_0x33f718){if(_0x33f718){_0x1b99b0=_0x33f718;_0x5bbf3a[_0x8a9b('0x28')]=_[_0x8a9b('0x40')](db[_0x8a9b('0x4e')][_0x8a9b('0x27')]);_0x5bbf3a['query']=_[_0x8a9b('0x40')](_0x321f2f[_0x8a9b('0x29')]);_0x5bbf3a[_0x8a9b('0x2a')]=_[_0x8a9b('0x2b')](_0x5bbf3a[_0x8a9b('0x28')],_0x5bbf3a[_0x8a9b('0x29')]);_0xd0aa59[_0x8a9b('0x2c')]=_[_0x8a9b('0x2b')](_0x5bbf3a['model'],qs['fields'](_0x321f2f['query'][_0x8a9b('0x2d')]));_0xd0aa59[_0x8a9b('0x2c')]=_0xd0aa59['attributes'][_0x8a9b('0x2e')]?_0xd0aa59['attributes']:_0x5bbf3a['model'];_0xd0aa59[_0x8a9b('0x31')]=qs['sort'](_0x321f2f[_0x8a9b('0x29')][_0x8a9b('0x32')]);_0xd0aa59[_0x8a9b('0x33')]=qs[_0x8a9b('0x2a')](_[_0x8a9b('0x4b')](_0x321f2f[_0x8a9b('0x29')],_0x5bbf3a['filters']));if(_0x321f2f[_0x8a9b('0x29')][_0x8a9b('0x39')]){_0xd0aa59[_0x8a9b('0x33')]=_[_0x8a9b('0x4c')](_0xd0aa59['where'],{'$or':_['map'](_0xd0aa59['attributes'],function(_0x572863){var _0x118f68={};_0x118f68[_0x572863]={'$like':'%'+_0x321f2f[_0x8a9b('0x29')][_0x8a9b('0x39')]+'%'};return _0x118f68;})});}_0xd0aa59=_['merge']({},_0xd0aa59,_0x321f2f[_0x8a9b('0x3a')]);return _0x1b99b0[_0x8a9b('0x4f')](_0xd0aa59);}})[_0x8a9b('0x21')](function(_0x22be47){if(_0x22be47){_0x2754c5=_0x22be47['length'];if(!_0x321f2f['query']['hasOwnProperty']('nolimit')){_0xd0aa59['limit']=qs[_0x8a9b('0x1b')](_0x321f2f['query'][_0x8a9b('0x1b')]);_0xd0aa59[_0x8a9b('0x1a')]=qs['offset'](_0x321f2f[_0x8a9b('0x29')]['offset']);}return _0x1b99b0[_0x8a9b('0x4f')](_0xd0aa59);}})['then'](function(_0x3c178d){if(_0x3c178d){return _0x3c178d?{'count':_0x2754c5,'rows':_0x3c178d}:null;}})[_0x8a9b('0x21')](respondWithResult(_0x56dc19,null))[_0x8a9b('0x3e')](handleError(_0x56dc19,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c3de716..79d65ab 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 _0x60d6=['Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define'];(function(_0x549490,_0xea5dd0){var _0x3a8791=function(_0x4930d4){while(--_0x4930d4){_0x549490['push'](_0x549490['shift']());}};_0x3a8791(++_0xea5dd0);}(_0x60d6,0x1af));var _0x660d=function(_0x53da86,_0x369aec){_0x53da86=_0x53da86-0x0;var _0x50809d=_0x60d6[_0x53da86];return _0x50809d;};'use strict';var _=require(_0x660d('0x0'));var util=require(_0x660d('0x1'));var logger=require(_0x660d('0x2'))(_0x660d('0x3'));var moment=require(_0x660d('0x4'));var BPromise=require(_0x660d('0x5'));var rp=require(_0x660d('0x6'));var fs=require('fs');var path=require(_0x660d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x660d('0x8'));module[_0x660d('0x9')]=function(_0x12d857,_0x255c4d){return _0x12d857[_0x660d('0xa')](_0x660d('0xb'),attributes,{'tableName':_0x660d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','moment','path','rimraf'];(function(_0x5767c1,_0x4ccc0a){var _0x334b13=function(_0x398522){while(--_0x398522){_0x5767c1['push'](_0x5767c1['shift']());}};_0x334b13(++_0x4ccc0a);}(_0xf4eb,0x102));var _0xbf4e=function(_0x51faaa,_0x28f40e){_0x51faaa=_0x51faaa-0x0;var _0x4745a2=_0xf4eb[_0x51faaa];return _0x4745a2;};'use strict';var _=require(_0xbf4e('0x0'));var util=require(_0xbf4e('0x1'));var logger=require('../../config/logger')(_0xbf4e('0x2'));var moment=require(_0xbf4e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf4e('0x4'));var rimraf=require(_0xbf4e('0x5'));var config=require(_0xbf4e('0x6'));var attributes=require(_0xbf4e('0x7'));module[_0xbf4e('0x8')]=function(_0x177fb6,_0x321585){return _0x177fb6[_0xbf4e('0x9')](_0xbf4e('0xa'),attributes,{'tableName':_0xbf4e('0xb'),'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 e162947..46be0cd 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 _0xf61e=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2db93e,_0x5b3aea){var _0x98c3bf=function(_0x1de57a){while(--_0x1de57a){_0x2db93e['push'](_0x2db93e['shift']());}};_0x98c3bf(++_0x5b3aea);}(_0xf61e,0x191));var _0xef61=function(_0x130bf9,_0x2da6a4){_0x130bf9=_0x130bf9-0x0;var _0x5ab764=_0xf61e[_0x130bf9];return _0x5ab764;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file +var _0x9cb4=['Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x1d6c45,_0x57485d){var _0x1964e6=function(_0x34e848){while(--_0x34e848){_0x1d6c45['push'](_0x1d6c45['shift']());}};_0x1964e6(++_0x57485d);}(_0x9cb4,0x12d));var _0x49cb=function(_0x406ea8,_0x1c159d){_0x406ea8=_0x406ea8-0x0;var _0x14f4bc=_0x9cb4[_0x406ea8];return _0x14f4bc;};'use strict';var _=require(_0x49cb('0x0'));var util=require(_0x49cb('0x1'));var moment=require(_0x49cb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x49cb('0x3'));var logger=require(_0x49cb('0x4'))(_0x49cb('0x5'));var config=require('../../config/environment');var jayson=require(_0x49cb('0x6'));var client=jayson[_0x49cb('0x7')][_0x49cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x90eecc,_0x51ad1a,_0x4a0ab1){return new BPromise(function(_0x2c73c8,_0x4770c6){return client[_0x49cb('0x9')](_0x90eecc,_0x4a0ab1)[_0x49cb('0xa')](function(_0xa96ef8){logger[_0x49cb('0xb')](_0x49cb('0xc'),_0x51ad1a,_0x49cb('0xd'));logger['debug'](_0x49cb('0xe'),_0x51ad1a,'request\x20sent',JSON[_0x49cb('0xf')](_0xa96ef8));if(_0xa96ef8['error']){if(_0xa96ef8['error'][_0x49cb('0x10')]===0x1f4){logger['error'](_0x49cb('0xc'),_0x51ad1a,_0xa96ef8[_0x49cb('0x11')][_0x49cb('0x12')]);return _0x4770c6(_0xa96ef8['error'][_0x49cb('0x12')]);}logger[_0x49cb('0x11')](_0x49cb('0xc'),_0x51ad1a,_0xa96ef8['error'][_0x49cb('0x12')]);return _0x2c73c8(_0xa96ef8[_0x49cb('0x11')]['message']);}else{logger['info'](_0x49cb('0xc'),_0x51ad1a,_0x49cb('0xd'));_0x2c73c8(_0xa96ef8[_0x49cb('0x13')][_0x49cb('0x12')]);}})[_0x49cb('0x14')](function(_0x3d058e){logger[_0x49cb('0x11')](_0x49cb('0xc'),_0x51ad1a,_0x3d058e);_0x4770c6(_0x3d058e);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 4924cd0..bb634ab 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 _0x552c=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put'];(function(_0x2e38e0,_0x5841ba){var _0x173804=function(_0x1350cc){while(--_0x1350cc){_0x2e38e0['push'](_0x2e38e0['shift']());}};_0x173804(++_0x5841ba);}(_0x552c,0x1e5));var _0xc552=function(_0x1531a9,_0x30bd51){_0x1531a9=_0x1531a9-0x0;var _0x11b216=_0x552c[_0x1531a9];return _0x11b216;};'use strict';var multer=require(_0xc552('0x0'));var util=require('util');var path=require(_0xc552('0x1'));var timeout=require(_0xc552('0x2'));var express=require(_0xc552('0x3'));var router=express['Router']();var auth=require(_0xc552('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc552('0x5'));var controller=require('./automation.controller');router[_0xc552('0x6')]('/',auth['isAuthenticated'](),controller[_0xc552('0x7')]);router[_0xc552('0x6')]('/:id',auth[_0xc552('0x8')](),controller[_0xc552('0x9')]);router[_0xc552('0x6')](_0xc552('0xa'),auth[_0xc552('0x8')](),controller[_0xc552('0xb')]);router[_0xc552('0x6')](_0xc552('0xc'),auth['isAuthenticated'](),controller[_0xc552('0xd')]);router['post']('/',auth[_0xc552('0x8')](),controller[_0xc552('0xe')]);router[_0xc552('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xc552('0x10')]);router[_0xc552('0xf')](_0xc552('0xc'),auth['isAuthenticated'](),controller[_0xc552('0x11')]);router[_0xc552('0x12')](_0xc552('0x13'),auth[_0xc552('0x8')](),controller[_0xc552('0x14')]);router[_0xc552('0x15')](_0xc552('0x13'),auth[_0xc552('0x8')](),controller[_0xc552('0x16')]);module[_0xc552('0x17')]=router; \ No newline at end of file +var _0x0370=['/:id/conditions','getConditions','/:id/actions','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id'];(function(_0x20637e,_0xb5c26e){var _0xb3ec3f=function(_0x5aca9e){while(--_0x5aca9e){_0x20637e['push'](_0x20637e['shift']());}};_0xb3ec3f(++_0xb5c26e);}(_0x0370,0x10d));var _0x0037=function(_0x22473c,_0x3d7d30){_0x22473c=_0x22473c-0x0;var _0x239ec8=_0x0370[_0x22473c];return _0x239ec8;};'use strict';var multer=require(_0x0037('0x0'));var util=require(_0x0037('0x1'));var path=require('path');var timeout=require(_0x0037('0x2'));var express=require(_0x0037('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0037('0x4'));var config=require(_0x0037('0x5'));var controller=require(_0x0037('0x6'));router['get']('/',auth[_0x0037('0x7')](),controller[_0x0037('0x8')]);router[_0x0037('0x9')](_0x0037('0xa'),auth[_0x0037('0x7')](),controller['show']);router[_0x0037('0x9')](_0x0037('0xb'),auth[_0x0037('0x7')](),controller[_0x0037('0xc')]);router[_0x0037('0x9')](_0x0037('0xd'),auth[_0x0037('0x7')](),controller['getActions']);router[_0x0037('0xe')]('/',auth[_0x0037('0x7')](),controller['create']);router[_0x0037('0xe')](_0x0037('0xb'),auth[_0x0037('0x7')](),controller['addConditions']);router[_0x0037('0xe')](_0x0037('0xd'),auth[_0x0037('0x7')](),controller['addActions']);router[_0x0037('0xf')]('/:id',auth[_0x0037('0x7')](),controller[_0x0037('0x10')]);router[_0x0037('0x11')](_0x0037('0xa'),auth[_0x0037('0x7')](),controller[_0x0037('0x12')]);module[_0x0037('0x13')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 965a8fb..a4176e7 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 _0x8b03=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','ivr'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8b03,0x10a));var _0x38b0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b03[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x38b0('0x0'));module[_0x38b0('0x1')]={'name':{'type':Sequelize[_0x38b0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x38b0('0x3')),'allowNull':![],'defaultValue':_0x38b0('0x3')},'description':{'type':Sequelize[_0x38b0('0x2')]},'active':{'type':Sequelize[_0x38b0('0x4')],'defaultValue':0x0,'comment':_0x38b0('0x5')},'limitCalls':{'type':Sequelize[_0x38b0('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x38b0('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x38b0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x38b0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x38b0('0x6')](0x3)[_0x38b0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x38b0('0x6')](0x3)[_0x38b0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38b0('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x38b0('0x6')](0x5)[_0x38b0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38b0('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x38b0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x38b0('0x6')](0x5)[_0x38b0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38b0('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x38b0('0x6')](0x3)[_0x38b0('0x8')],'defaultValue':0x3,'comment':_0x38b0('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x38b0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38b0('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x38b0('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x38b0('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x38b0('0x2')],'defaultValue':_0x38b0('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x38b0('0x10')]('always',_0x38b0('0x11'),_0x38b0('0x12')),'defaultValue':_0x38b0('0x13')},'dialAMDActive':{'type':Sequelize[_0x38b0('0x4')],'defaultValue':0x0,'comment':_0x38b0('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x38b0('0x6')](0x9)[_0x38b0('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x38b0('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x38b0('0x6')](0x9)[_0x38b0('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x38b0('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x38b0('0x6')](0x9)[_0x38b0('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x38b0('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x38b0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x38b0('0x18')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x38b0('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x38b0('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x38b0('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x38b0('0x6')](0x9)[_0x38b0('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x38b0('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x38b0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x38b0('0x10')]('DESC',_0x38b0('0x1a')),'defaultValue':_0x38b0('0x1b')},'dialPrefix':{'type':Sequelize[_0x38b0('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x38b0('0x6')](0x3)[_0x38b0('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x38b0('0x1c')},'dialCutDigit':{'type':Sequelize[_0x38b0('0x6')](0x3)[_0x38b0('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x38b0('0x1d')}}; \ No newline at end of file +var _0x7d06=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','never','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d06,0x1ec));var _0x67d0=function(_0x53f345,_0x4a4735){_0x53f345=_0x53f345-0x0;var _0x3b5cf1=_0x7d06[_0x53f345];return _0x3b5cf1;};'use strict';var Sequelize=require(_0x67d0('0x0'));module[_0x67d0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x67d0('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x67d0('0x3')),'allowNull':![],'defaultValue':_0x67d0('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x67d0('0x4')],'defaultValue':0x0,'comment':_0x67d0('0x5')},'limitCalls':{'type':Sequelize[_0x67d0('0x6')](0x4)[_0x67d0('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x67d0('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x67d0('0x9')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x67d0('0x9')]},'dialOriginateTimeout':{'type':Sequelize[_0x67d0('0x6')](0x3)[_0x67d0('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x67d0('0x6')](0x3)[_0x67d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x67d0('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x67d0('0x6')](0x5)[_0x67d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x67d0('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x67d0('0x6')](0x3)[_0x67d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x67d0('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x67d0('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x67d0('0x6')](0x3)[_0x67d0('0x7')],'defaultValue':0x3,'comment':_0x67d0('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x67d0('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x67d0('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x67d0('0x6')](0x3)[_0x67d0('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x67d0('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x67d0('0x9')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x67d0('0x11')]('always',_0x67d0('0x12'),_0x67d0('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x67d0('0x4')],'defaultValue':0x0,'comment':_0x67d0('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x67d0('0x6')](0x9)[_0x67d0('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x67d0('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x67d0('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x67d0('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x67d0('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x67d0('0x6')](0x9)[_0x67d0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x67d0('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x67d0('0x6')](0x9)[_0x67d0('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x67d0('0x6')](0x9)[_0x67d0('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x67d0('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x67d0('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x67d0('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x67d0('0x6')](0x5)[_0x67d0('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x67d0('0x6')](0x9)[_0x67d0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x67d0('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x67d0('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x67d0('0x1a')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index fc962cf..80d843c 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 _0xe331=['spread','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','error','name','send','index','Campaign','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','VIRTUAL','options','includeAll','include','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','getHoppers','findOne','CmHopper','rows','CmHopperHistory','pick','CampaignId','findAll','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','push','sequelize','all','removeLists','addBlackLists'];(function(_0xe12e94,_0xada491){var _0x2e4e10=function(_0x44694a){while(--_0x44694a){_0xe12e94['push'](_0xe12e94['shift']());}};_0x2e4e10(++_0xada491);}(_0xe331,0x88));var _0x1e33=function(_0x1e573c,_0xb46490){_0x1e573c=_0x1e573c-0x0;var _0x20f904=_0xe331[_0x1e573c];return _0x20f904;};'use strict';var pdf=require(_0x1e33('0x0'));var emlformat=require(_0x1e33('0x1'));var rimraf=require(_0x1e33('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1e33('0x3'));var moment=require(_0x1e33('0x4'));var BPromise=require(_0x1e33('0x5'));var Mustache=require('mustache');var util=require(_0x1e33('0x6'));var path=require('path');var sox=require(_0x1e33('0x7'));var csv=require(_0x1e33('0x8'));var ejs=require(_0x1e33('0x9'));var fs=require('fs');var _=require(_0x1e33('0xa'));var squel=require(_0x1e33('0xb'));var crypto=require(_0x1e33('0xc'));var jsforce=require(_0x1e33('0xd'));var deskjs=require(_0x1e33('0xe'));var toCsv=require(_0x1e33('0x8'));var querystring=require('querystring');var Papa=require(_0x1e33('0xf'));var Redis=require(_0x1e33('0x10'));var authService=require(_0x1e33('0x11'));var qs=require(_0x1e33('0x12'));var hardwareService=require(_0x1e33('0x13'));var logger=require(_0x1e33('0x14'))(_0x1e33('0x15'));var utils=require('../../config/utils');var config=require(_0x1e33('0x16'));var db=require(_0x1e33('0x17'))['db'];function respondWithStatusCode(_0x7f3304,_0x2c91df){_0x2c91df=_0x2c91df||0xcc;return function(_0x39959e){if(_0x39959e){return _0x7f3304[_0x1e33('0x18')](_0x2c91df);}return _0x7f3304['status'](_0x2c91df)[_0x1e33('0x19')]();};}function respondWithResult(_0x21e66c,_0x4a073){_0x4a073=_0x4a073||0xc8;return function(_0x39af9a){if(_0x39af9a){return _0x21e66c[_0x1e33('0x1a')](_0x4a073)[_0x1e33('0x1b')](_0x39af9a);}};}function respondWithFilteredResult(_0x4aec3a,_0x5dfed9){return function(_0x499ae3){if(_0x499ae3){var _0x28b210=_0x499ae3[_0x1e33('0x1c')],_0x3318a1=_0x5dfed9[_0x1e33('0x1d')],_0x465640=_0x5dfed9[_0x1e33('0x1d')]+_0x5dfed9['limit'],_0x5e0837;if(_0x465640>=_0x28b210){_0x465640=_0x28b210;_0x5e0837=0xc8;}else{_0x5e0837=0xce;}_0x4aec3a[_0x1e33('0x1a')](_0x5e0837);return _0x4aec3a[_0x1e33('0x1e')](_0x1e33('0x1f'),_0x3318a1+'-'+_0x465640+'/'+_0x28b210)[_0x1e33('0x1b')](_0x499ae3);}return null;};}function patchUpdates(_0x216d35){return function(_0x27631e){try{jsonpatch[_0x1e33('0x20')](_0x27631e,_0x216d35,!![]);}catch(_0x1dd7c9){return BPromise[_0x1e33('0x21')](_0x1dd7c9);}return _0x27631e[_0x1e33('0x22')]();};}function saveUpdates(_0x1a37b3,_0x2e8846){return function(_0x443b60){if(_0x443b60){return _0x443b60['update'](_0x1a37b3)[_0x1e33('0x23')](function(_0x5684ac){return _0x5684ac;});}return null;};}function removeEntity(_0x38a1e0,_0xba3cb9){return function(_0x41def4){if(_0x41def4){return _0x41def4[_0x1e33('0x24')]()[_0x1e33('0x23')](function(){var _0x4d48d5=_0x41def4[_0x1e33('0x25')]({'plain':!![]});var _0x292ba4=_0x1e33('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x292ba4,'resourceId':_0x4d48d5['id']}})['then'](function(){return _0x41def4;});})['then'](function(){_0x38a1e0['status'](0xcc)[_0x1e33('0x19')]();});}};}function handleEntityNotFound(_0x577a25,_0xd891b0){return function(_0xab5e2){if(!_0xab5e2){_0x577a25[_0x1e33('0x18')](0x194);}return _0xab5e2;};}function handleError(_0x26b9e6,_0x72054b){_0x72054b=_0x72054b||0x1f4;return function(_0x386b1f){logger[_0x1e33('0x27')](_0x386b1f['stack']);if(_0x386b1f[_0x1e33('0x28')]){delete _0x386b1f[_0x1e33('0x28')];}_0x26b9e6[_0x1e33('0x1a')](_0x72054b)[_0x1e33('0x29')](_0x386b1f);};}exports[_0x1e33('0x2a')]=function(_0x19e7cc,_0x3ac8f9){var _0x3a5b37={},_0x55f3cf={},_0x382444={'count':0x0,'rows':[]};var _0x500536=db[_0x1e33('0x2b')][_0x1e33('0x2c')];_0x55f3cf['model']=_[_0x1e33('0x2d')](_0x500536);_0x55f3cf[_0x1e33('0x2e')]=_['keys'](_0x19e7cc[_0x1e33('0x2e')]);_0x55f3cf[_0x1e33('0x2f')]=_[_0x1e33('0x30')](_0x55f3cf['model'],_0x55f3cf[_0x1e33('0x2e')]);_0x3a5b37[_0x1e33('0x31')]=_[_0x1e33('0x30')](_0x55f3cf[_0x1e33('0x32')],qs[_0x1e33('0x33')](_0x19e7cc[_0x1e33('0x2e')][_0x1e33('0x33')]));_0x3a5b37[_0x1e33('0x31')]=_0x3a5b37['attributes'][_0x1e33('0x34')]?_0x3a5b37[_0x1e33('0x31')]:_0x55f3cf[_0x1e33('0x32')];if(!_0x19e7cc[_0x1e33('0x2e')][_0x1e33('0x35')](_0x1e33('0x36'))){_0x3a5b37[_0x1e33('0x37')]=qs[_0x1e33('0x37')](_0x19e7cc[_0x1e33('0x2e')][_0x1e33('0x37')]);_0x3a5b37[_0x1e33('0x1d')]=qs[_0x1e33('0x1d')](_0x19e7cc[_0x1e33('0x2e')][_0x1e33('0x1d')]);}_0x3a5b37[_0x1e33('0x38')]=qs[_0x1e33('0x39')](_0x19e7cc['query']['sort']);_0x3a5b37[_0x1e33('0x3a')]=qs[_0x1e33('0x2f')](_['pick'](_0x19e7cc['query'],_0x55f3cf[_0x1e33('0x2f')]));if(_0x19e7cc[_0x1e33('0x2e')][_0x1e33('0x3b')]){_0x3a5b37[_0x1e33('0x3a')]=_[_0x1e33('0x3c')](_0x3a5b37['where'],{'$or':_[_0x1e33('0x3d')](_0x500536,function(_0x1115cd){if(_0x1115cd[_0x1e33('0x3e')]['key']!==_0x1e33('0x3f')){var _0x3533f6={};_0x3533f6[_0x1115cd['field']]={'$like':'%'+_0x19e7cc[_0x1e33('0x2e')][_0x1e33('0x3b')]+'%'};return _0x3533f6;}})});}_0x3a5b37=_[_0x1e33('0x3c')]({},_0x3a5b37,_0x19e7cc[_0x1e33('0x40')]);var _0x3506c8={'where':_0x3a5b37[_0x1e33('0x3a')]};return db[_0x1e33('0x2b')]['count'](_0x3506c8)['then'](function(_0x1f1f22){_0x382444[_0x1e33('0x1c')]=_0x1f1f22;if(_0x19e7cc[_0x1e33('0x2e')][_0x1e33('0x41')]){_0x3a5b37[_0x1e33('0x42')]=[{'all':!![]}];}return db[_0x1e33('0x2b')]['findAll'](_0x3a5b37);})[_0x1e33('0x23')](function(_0x582b42){_0x382444['rows']=_0x582b42;return _0x382444;})[_0x1e33('0x23')](respondWithFilteredResult(_0x3ac8f9,_0x3a5b37))[_0x1e33('0x43')](handleError(_0x3ac8f9,null));};exports['show']=function(_0x5a4f2d,_0x13ba03){var _0x188840={'raw':![],'where':{'id':_0x5a4f2d[_0x1e33('0x44')]['id']}},_0x45e1fd={};_0x45e1fd[_0x1e33('0x32')]=_[_0x1e33('0x2d')](db[_0x1e33('0x2b')][_0x1e33('0x2c')]);_0x45e1fd[_0x1e33('0x2e')]=_['keys'](_0x5a4f2d['query']);_0x45e1fd[_0x1e33('0x2f')]=_['intersection'](_0x45e1fd[_0x1e33('0x32')],_0x45e1fd[_0x1e33('0x2e')]);_0x188840[_0x1e33('0x31')]=_['intersection'](_0x45e1fd[_0x1e33('0x32')],qs[_0x1e33('0x33')](_0x5a4f2d[_0x1e33('0x2e')][_0x1e33('0x33')]));_0x188840[_0x1e33('0x31')]=_0x188840['attributes'][_0x1e33('0x34')]?_0x188840[_0x1e33('0x31')]:_0x45e1fd['model'];if(_0x5a4f2d[_0x1e33('0x2e')][_0x1e33('0x41')]){_0x188840[_0x1e33('0x42')]=[{'all':!![]}];}_0x188840=_[_0x1e33('0x3c')]({},_0x188840,_0x5a4f2d['options']);return db['Campaign'][_0x1e33('0x45')](_0x188840)[_0x1e33('0x23')](handleEntityNotFound(_0x13ba03,null))[_0x1e33('0x23')](respondWithResult(_0x13ba03,null))['catch'](handleError(_0x13ba03,null));};exports['create']=function(_0x3094ab,_0x424315){return db[_0x1e33('0x2b')]['create'](_0x3094ab[_0x1e33('0x46')],{})[_0x1e33('0x23')](function(_0x298bdd){var _0x1457b3=_0x3094ab[_0x1e33('0x47')][_0x1e33('0x25')]({'plain':!![]});if(!_0x1457b3)throw new Error(_0x1e33('0x48'));if(_0x1457b3[_0x1e33('0x49')]===_0x1e33('0x47')){var _0x2bc6a8=_0x298bdd[_0x1e33('0x25')]({'plain':!![]});var _0xcdf208='IvrCampaigns';return db[_0x1e33('0x4a')]['find']({'where':{'name':_0xcdf208,'userProfileId':_0x1457b3[_0x1e33('0x4b')]},'raw':!![]})[_0x1e33('0x23')](function(_0x5947a7){if(_0x5947a7&&_0x5947a7[_0x1e33('0x4c')]===0x0){return db[_0x1e33('0x4d')][_0x1e33('0x4e')]({'name':_0x2bc6a8[_0x1e33('0x28')],'resourceId':_0x2bc6a8['id'],'type':_0x5947a7[_0x1e33('0x28')],'sectionId':_0x5947a7['id']},{})[_0x1e33('0x23')](function(){return _0x298bdd;});}else{return _0x298bdd;}})[_0x1e33('0x43')](function(_0x56dbb3){logger[_0x1e33('0x27')](_0x1e33('0x4f'),_0x56dbb3);throw _0x56dbb3;});}return _0x298bdd;})['then'](respondWithResult(_0x424315,0xc9))[_0x1e33('0x43')](handleError(_0x424315,null));};exports[_0x1e33('0x50')]=function(_0x5cf9a1,_0x1172d6){var _0x16887d={'raw':![],'where':{'id':_0x5cf9a1[_0x1e33('0x44')]['id']}},_0x5bd8dc={};_0x5bd8dc[_0x1e33('0x32')]=_['keys'](db[_0x1e33('0x2b')][_0x1e33('0x2c')]);_0x16887d[_0x1e33('0x31')]=_[_0x1e33('0x30')](_0x5bd8dc[_0x1e33('0x32')],qs[_0x1e33('0x33')](_0x5cf9a1[_0x1e33('0x2e')][_0x1e33('0x33')]));_0x16887d[_0x1e33('0x31')]=_0x16887d[_0x1e33('0x31')][_0x1e33('0x34')]?_0x16887d[_0x1e33('0x31')]:_0x5bd8dc[_0x1e33('0x32')];if(_0x5cf9a1[_0x1e33('0x2e')][_0x1e33('0x41')]){_0x16887d['include']=[{'all':!![]}];}_0x16887d=_[_0x1e33('0x3c')]({},_0x16887d,_0x5cf9a1[_0x1e33('0x40')]);return db[_0x1e33('0x2b')][_0x1e33('0x45')](_0x16887d)[_0x1e33('0x23')](handleEntityNotFound(_0x1172d6,null))[_0x1e33('0x23')](function(_0x1661e4){if(_0x1661e4){var _0x44ba57=_0x1661e4['get']({'plain':!![]});_0x44ba57=qs[_0x1e33('0x51')](_0x44ba57,['id',_0x1e33('0x52'),_0x1e33('0x53')]);_0x5cf9a1[_0x1e33('0x46')]=_[_0x1e33('0x51')](_0x5cf9a1[_0x1e33('0x46')],['id',_0x1e33('0x52'),_0x1e33('0x53')]);return db[_0x1e33('0x2b')][_0x1e33('0x4e')](_[_0x1e33('0x3c')](_0x44ba57,_0x5cf9a1[_0x1e33('0x46')]),{'include':_0x5cf9a1[_0x1e33('0x2e')][_0x1e33('0x41')]?[{'all':!![]}]:undefined})[_0x1e33('0x23')](function(_0x91d18d){var _0x20c3f1=_0x5cf9a1[_0x1e33('0x47')]['get']({'plain':!![]});if(!_0x20c3f1)throw new Error(_0x1e33('0x48'));if(_0x20c3f1['role']===_0x1e33('0x47')){var _0x58c960=_0x91d18d[_0x1e33('0x25')]({'plain':!![]});var _0x51df79=_0x1e33('0x26');return db[_0x1e33('0x4a')][_0x1e33('0x45')]({'where':{'name':_0x51df79,'userProfileId':_0x20c3f1[_0x1e33('0x4b')]},'raw':!![]})[_0x1e33('0x23')](function(_0x31c430){if(_0x31c430&&_0x31c430[_0x1e33('0x4c')]===0x0){return db[_0x1e33('0x4d')][_0x1e33('0x4e')]({'name':_0x58c960[_0x1e33('0x28')],'resourceId':_0x58c960['id'],'type':_0x31c430['name'],'sectionId':_0x31c430['id']},{})[_0x1e33('0x23')](function(){return _0x91d18d;});}else{return _0x91d18d;}})[_0x1e33('0x43')](function(_0x2fba33){logger['error'](_0x1e33('0x4f'),_0x2fba33);throw _0x2fba33;});}return _0x91d18d;});}})[_0x1e33('0x23')](respondWithResult(_0x1172d6,0xc9))['catch'](handleError(_0x1172d6,null));};exports[_0x1e33('0x54')]=function(_0x144e3,_0x4d10ea){if(_0x144e3[_0x1e33('0x46')]['id']){delete _0x144e3[_0x1e33('0x46')]['id'];}return db['Campaign'][_0x1e33('0x45')]({'where':{'id':_0x144e3[_0x1e33('0x44')]['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x4d10ea,null))[_0x1e33('0x23')](saveUpdates(_0x144e3[_0x1e33('0x46')],null))[_0x1e33('0x23')](respondWithResult(_0x4d10ea,null))[_0x1e33('0x43')](handleError(_0x4d10ea,null));};exports[_0x1e33('0x24')]=function(_0x4b3f96,_0x395584){return db[_0x1e33('0x2b')][_0x1e33('0x45')]({'where':{'id':_0x4b3f96[_0x1e33('0x44')]['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x395584,null))[_0x1e33('0x23')](removeEntity(_0x395584,null))[_0x1e33('0x43')](handleError(_0x395584,null));};exports[_0x1e33('0x55')]=function(_0x3ed87e,_0x716611,_0x5a585f){var _0x5e75c8={'raw':!![],'where':{}};var _0x247fc6={};var _0x388b9d={'count':0x0,'rows':[]};return db['Campaign'][_0x1e33('0x56')]({'where':{'id':_0x3ed87e['params']['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x716611,null))['then'](function(_0x445b43){if(_0x445b43){_0x247fc6[_0x1e33('0x32')]=_[_0x1e33('0x2d')](db[_0x1e33('0x57')][_0x1e33('0x2c')]);_0x247fc6[_0x1e33('0x2e')]=_[_0x1e33('0x2d')](_0x3ed87e[_0x1e33('0x2e')]);_0x247fc6[_0x1e33('0x2f')]=_[_0x1e33('0x30')](_0x247fc6['model'],_0x247fc6[_0x1e33('0x2e')]);_0x5e75c8[_0x1e33('0x31')]=_[_0x1e33('0x30')](_0x247fc6['model'],qs[_0x1e33('0x33')](_0x3ed87e[_0x1e33('0x2e')]['fields']));_0x5e75c8[_0x1e33('0x31')]=_0x5e75c8['attributes'][_0x1e33('0x34')]?_0x5e75c8[_0x1e33('0x31')]:_0x247fc6[_0x1e33('0x32')];if(!_0x3ed87e[_0x1e33('0x2e')][_0x1e33('0x35')](_0x1e33('0x36'))){_0x5e75c8['limit']=qs['limit'](_0x3ed87e[_0x1e33('0x2e')][_0x1e33('0x37')]);_0x5e75c8['offset']=qs[_0x1e33('0x1d')](_0x3ed87e['query'][_0x1e33('0x1d')]);}_0x5e75c8['order']=qs[_0x1e33('0x39')](_0x3ed87e[_0x1e33('0x2e')][_0x1e33('0x39')]);_0x5e75c8[_0x1e33('0x3a')]=qs[_0x1e33('0x2f')](_['pick'](_0x3ed87e[_0x1e33('0x2e')],_0x247fc6[_0x1e33('0x2f')]));_0x5e75c8[_0x1e33('0x3a')]['CampaignId']=_0x445b43['id'];if(_0x3ed87e[_0x1e33('0x2e')][_0x1e33('0x3b')]){_0x5e75c8[_0x1e33('0x3a')]=_[_0x1e33('0x3c')](_0x5e75c8[_0x1e33('0x3a')],{'$or':_['map'](_0x5e75c8[_0x1e33('0x31')],function(_0x58cc47){var _0x2370d4={};_0x2370d4[_0x58cc47]={'$like':'%'+_0x3ed87e[_0x1e33('0x2e')][_0x1e33('0x3b')]+'%'};return _0x2370d4;})});}_0x5e75c8=_[_0x1e33('0x3c')]({},_0x5e75c8,_0x3ed87e[_0x1e33('0x40')]);return db[_0x1e33('0x57')][_0x1e33('0x1c')]({'where':_0x5e75c8[_0x1e33('0x3a')]})[_0x1e33('0x23')](function(_0x363ffe){_0x388b9d['count']=_0x363ffe;if(_0x3ed87e[_0x1e33('0x2e')][_0x1e33('0x41')]){_0x5e75c8[_0x1e33('0x42')]=[{'all':!![]}];}return db[_0x1e33('0x57')]['findAll'](_0x5e75c8);})['then'](function(_0x1c9d06){_0x388b9d[_0x1e33('0x58')]=_0x1c9d06;return _0x388b9d;});}})[_0x1e33('0x23')](respondWithFilteredResult(_0x716611,_0x5e75c8))['catch'](handleError(_0x716611,null));};exports['getHopperHistories']=function(_0x2907ab,_0x27a654,_0x584bb9){var _0x1a3247={'raw':!![],'where':{}};var _0x235819={};var _0x56da83={'count':0x0,'rows':[]};return db[_0x1e33('0x2b')][_0x1e33('0x56')]({'where':{'id':_0x2907ab['params']['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x27a654,null))[_0x1e33('0x23')](function(_0x30d9f8){if(_0x30d9f8){_0x235819[_0x1e33('0x32')]=_['keys'](db[_0x1e33('0x59')]['rawAttributes']);_0x235819[_0x1e33('0x2e')]=_['keys'](_0x2907ab[_0x1e33('0x2e')]);_0x235819[_0x1e33('0x2f')]=_[_0x1e33('0x30')](_0x235819[_0x1e33('0x32')],_0x235819['query']);_0x1a3247[_0x1e33('0x31')]=_[_0x1e33('0x30')](_0x235819[_0x1e33('0x32')],qs['fields'](_0x2907ab['query'][_0x1e33('0x33')]));_0x1a3247[_0x1e33('0x31')]=_0x1a3247[_0x1e33('0x31')][_0x1e33('0x34')]?_0x1a3247[_0x1e33('0x31')]:_0x235819[_0x1e33('0x32')];if(!_0x2907ab['query']['hasOwnProperty'](_0x1e33('0x36'))){_0x1a3247[_0x1e33('0x37')]=qs['limit'](_0x2907ab[_0x1e33('0x2e')]['limit']);_0x1a3247[_0x1e33('0x1d')]=qs[_0x1e33('0x1d')](_0x2907ab[_0x1e33('0x2e')][_0x1e33('0x1d')]);}_0x1a3247[_0x1e33('0x38')]=qs[_0x1e33('0x39')](_0x2907ab[_0x1e33('0x2e')][_0x1e33('0x39')]);_0x1a3247[_0x1e33('0x3a')]=qs[_0x1e33('0x2f')](_[_0x1e33('0x5a')](_0x2907ab[_0x1e33('0x2e')],_0x235819[_0x1e33('0x2f')]));_0x1a3247[_0x1e33('0x3a')][_0x1e33('0x5b')]=_0x30d9f8['id'];if(_0x2907ab[_0x1e33('0x2e')][_0x1e33('0x3b')]){_0x1a3247['where']=_[_0x1e33('0x3c')](_0x1a3247[_0x1e33('0x3a')],{'$or':_[_0x1e33('0x3d')](_0x1a3247[_0x1e33('0x31')],function(_0x3c8c55){var _0x2a2546={};_0x2a2546[_0x3c8c55]={'$like':'%'+_0x2907ab[_0x1e33('0x2e')][_0x1e33('0x3b')]+'%'};return _0x2a2546;})});}_0x1a3247=_['merge']({},_0x1a3247,_0x2907ab[_0x1e33('0x40')]);return db[_0x1e33('0x59')][_0x1e33('0x1c')]({'where':_0x1a3247['where']})[_0x1e33('0x23')](function(_0xe76392){_0x56da83['count']=_0xe76392;if(_0x2907ab[_0x1e33('0x2e')][_0x1e33('0x41')]){_0x1a3247[_0x1e33('0x42')]=[{'all':!![]}];}return db[_0x1e33('0x59')][_0x1e33('0x5c')](_0x1a3247);})[_0x1e33('0x23')](function(_0x31f4d1){_0x56da83['rows']=_0x31f4d1;return _0x56da83;});}})[_0x1e33('0x23')](respondWithFilteredResult(_0x27a654,_0x1a3247))[_0x1e33('0x43')](handleError(_0x27a654,null));};exports['getHopperFinals']=function(_0x4fe906,_0xc8d7ec,_0xfbc8ad){var _0x537434={'raw':!![],'where':{}};var _0x269aee={};var _0x54ab33={'count':0x0,'rows':[]};return db[_0x1e33('0x2b')][_0x1e33('0x56')]({'where':{'id':_0x4fe906[_0x1e33('0x44')]['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0xc8d7ec,null))[_0x1e33('0x23')](function(_0x5f6d0d){if(_0x5f6d0d){_0x269aee[_0x1e33('0x32')]=_[_0x1e33('0x2d')](db[_0x1e33('0x5d')][_0x1e33('0x2c')]);_0x269aee[_0x1e33('0x2e')]=_[_0x1e33('0x2d')](_0x4fe906[_0x1e33('0x2e')]);_0x269aee[_0x1e33('0x2f')]=_[_0x1e33('0x30')](_0x269aee[_0x1e33('0x32')],_0x269aee['query']);_0x537434[_0x1e33('0x31')]=_['intersection'](_0x269aee[_0x1e33('0x32')],qs[_0x1e33('0x33')](_0x4fe906[_0x1e33('0x2e')][_0x1e33('0x33')]));_0x537434[_0x1e33('0x31')]=_0x537434['attributes'][_0x1e33('0x34')]?_0x537434[_0x1e33('0x31')]:_0x269aee[_0x1e33('0x32')];if(!_0x4fe906[_0x1e33('0x2e')]['hasOwnProperty'](_0x1e33('0x36'))){_0x537434[_0x1e33('0x37')]=qs[_0x1e33('0x37')](_0x4fe906[_0x1e33('0x2e')][_0x1e33('0x37')]);_0x537434[_0x1e33('0x1d')]=qs[_0x1e33('0x1d')](_0x4fe906[_0x1e33('0x2e')][_0x1e33('0x1d')]);}_0x537434[_0x1e33('0x38')]=qs[_0x1e33('0x39')](_0x4fe906[_0x1e33('0x2e')][_0x1e33('0x39')]);_0x537434['where']=qs[_0x1e33('0x2f')](_[_0x1e33('0x5a')](_0x4fe906[_0x1e33('0x2e')],_0x269aee[_0x1e33('0x2f')]));_0x537434[_0x1e33('0x3a')][_0x1e33('0x5b')]=_0x5f6d0d['id'];if(_0x4fe906['query']['filter']){_0x537434[_0x1e33('0x3a')]=_[_0x1e33('0x3c')](_0x537434[_0x1e33('0x3a')],{'$or':_[_0x1e33('0x3d')](_0x537434['attributes'],function(_0x20c30d){var _0x3d3100={};_0x3d3100[_0x20c30d]={'$like':'%'+_0x4fe906[_0x1e33('0x2e')][_0x1e33('0x3b')]+'%'};return _0x3d3100;})});}_0x537434=_['merge']({},_0x537434,_0x4fe906[_0x1e33('0x40')]);return db[_0x1e33('0x5d')][_0x1e33('0x1c')]({'where':_0x537434[_0x1e33('0x3a')]})['then'](function(_0x2c145a){_0x54ab33['count']=_0x2c145a;if(_0x4fe906[_0x1e33('0x2e')][_0x1e33('0x41')]){_0x537434[_0x1e33('0x42')]=[{'all':!![]}];}return db[_0x1e33('0x5d')]['findAll'](_0x537434);})[_0x1e33('0x23')](function(_0x1b0ad1){_0x54ab33[_0x1e33('0x58')]=_0x1b0ad1;return _0x54ab33;});}})[_0x1e33('0x23')](respondWithFilteredResult(_0xc8d7ec,_0x537434))['catch'](handleError(_0xc8d7ec,null));};exports['getHopperBlacks']=function(_0x3459e0,_0x1692a2,_0x34a43c){var _0x261b34={'raw':!![],'where':{}};var _0x594446={};var _0x2040b5={'count':0x0,'rows':[]};return db['Campaign'][_0x1e33('0x56')]({'where':{'id':_0x3459e0[_0x1e33('0x44')]['id']}})['then'](handleEntityNotFound(_0x1692a2,null))['then'](function(_0x21cb6d){if(_0x21cb6d){_0x594446[_0x1e33('0x32')]=_[_0x1e33('0x2d')](db[_0x1e33('0x5e')]['rawAttributes']);_0x594446[_0x1e33('0x2e')]=_[_0x1e33('0x2d')](_0x3459e0[_0x1e33('0x2e')]);_0x594446[_0x1e33('0x2f')]=_[_0x1e33('0x30')](_0x594446['model'],_0x594446['query']);_0x261b34[_0x1e33('0x31')]=_[_0x1e33('0x30')](_0x594446[_0x1e33('0x32')],qs[_0x1e33('0x33')](_0x3459e0[_0x1e33('0x2e')]['fields']));_0x261b34[_0x1e33('0x31')]=_0x261b34[_0x1e33('0x31')][_0x1e33('0x34')]?_0x261b34[_0x1e33('0x31')]:_0x594446['model'];if(!_0x3459e0[_0x1e33('0x2e')][_0x1e33('0x35')](_0x1e33('0x36'))){_0x261b34[_0x1e33('0x37')]=qs[_0x1e33('0x37')](_0x3459e0[_0x1e33('0x2e')][_0x1e33('0x37')]);_0x261b34['offset']=qs['offset'](_0x3459e0[_0x1e33('0x2e')][_0x1e33('0x1d')]);}_0x261b34[_0x1e33('0x38')]=qs[_0x1e33('0x39')](_0x3459e0['query'][_0x1e33('0x39')]);_0x261b34[_0x1e33('0x3a')]=qs[_0x1e33('0x2f')](_[_0x1e33('0x5a')](_0x3459e0[_0x1e33('0x2e')],_0x594446[_0x1e33('0x2f')]));_0x261b34['where'][_0x1e33('0x5b')]=_0x21cb6d['id'];if(_0x3459e0[_0x1e33('0x2e')]['filter']){_0x261b34['where']=_[_0x1e33('0x3c')](_0x261b34[_0x1e33('0x3a')],{'$or':_['map'](_0x261b34[_0x1e33('0x31')],function(_0x3d8da3){var _0x941a35={};_0x941a35[_0x3d8da3]={'$like':'%'+_0x3459e0['query']['filter']+'%'};return _0x941a35;})});}_0x261b34=_[_0x1e33('0x3c')]({},_0x261b34,_0x3459e0[_0x1e33('0x40')]);return db[_0x1e33('0x5e')][_0x1e33('0x1c')]({'where':_0x261b34[_0x1e33('0x3a')]})[_0x1e33('0x23')](function(_0x4f1382){_0x2040b5[_0x1e33('0x1c')]=_0x4f1382;if(_0x3459e0[_0x1e33('0x2e')]['includeAll']){_0x261b34['include']=[{'all':!![]}];}return db[_0x1e33('0x5e')][_0x1e33('0x5c')](_0x261b34);})['then'](function(_0x43286f){_0x2040b5[_0x1e33('0x58')]=_0x43286f;return _0x2040b5;});}})['then'](respondWithFilteredResult(_0x1692a2,_0x261b34))[_0x1e33('0x43')](handleError(_0x1692a2,null));};exports[_0x1e33('0x5f')]=function(_0x4f6fba,_0xf373b7,_0x49ec60){var _0x348853={};var _0xc663f7={};var _0x132c17;var _0x2511c0;return db[_0x1e33('0x2b')][_0x1e33('0x56')]({'where':{'id':_0x4f6fba[_0x1e33('0x44')]['id']}})['then'](handleEntityNotFound(_0xf373b7,null))[_0x1e33('0x23')](function(_0x4017d1){if(_0x4017d1){_0x132c17=_0x4017d1;_0xc663f7[_0x1e33('0x32')]=_[_0x1e33('0x2d')](db[_0x1e33('0x60')][_0x1e33('0x2c')]);_0xc663f7[_0x1e33('0x2e')]=_[_0x1e33('0x2d')](_0x4f6fba[_0x1e33('0x2e')]);_0xc663f7[_0x1e33('0x2f')]=_[_0x1e33('0x30')](_0xc663f7[_0x1e33('0x32')],_0xc663f7[_0x1e33('0x2e')]);_0x348853[_0x1e33('0x31')]=_[_0x1e33('0x30')](_0xc663f7[_0x1e33('0x32')],qs['fields'](_0x4f6fba[_0x1e33('0x2e')]['fields']));_0x348853[_0x1e33('0x31')]=_0x348853[_0x1e33('0x31')][_0x1e33('0x34')]?_0x348853[_0x1e33('0x31')]:_0xc663f7['model'];_0x348853[_0x1e33('0x38')]=qs['sort'](_0x4f6fba[_0x1e33('0x2e')]['sort']);_0x348853['where']=qs[_0x1e33('0x2f')](_['pick'](_0x4f6fba['query'],_0xc663f7[_0x1e33('0x2f')]));if(_0x4f6fba[_0x1e33('0x2e')]['filter']){_0x348853[_0x1e33('0x3a')]=_['merge'](_0x348853[_0x1e33('0x3a')],{'$or':_[_0x1e33('0x3d')](_0x348853[_0x1e33('0x31')],function(_0xd7daf0){var _0x341cb8={};_0x341cb8[_0xd7daf0]={'$like':'%'+_0x4f6fba[_0x1e33('0x2e')]['filter']+'%'};return _0x341cb8;})});}_0x348853=_[_0x1e33('0x3c')]({},_0x348853,_0x4f6fba[_0x1e33('0x40')]);return _0x132c17[_0x1e33('0x5f')](_0x348853);}})['then'](function(_0x598b43){if(_0x598b43){_0x2511c0=_0x598b43[_0x1e33('0x34')];if(!_0x4f6fba[_0x1e33('0x2e')]['hasOwnProperty'](_0x1e33('0x36'))){_0x348853[_0x1e33('0x37')]=qs[_0x1e33('0x37')](_0x4f6fba[_0x1e33('0x2e')][_0x1e33('0x37')]);_0x348853[_0x1e33('0x1d')]=qs[_0x1e33('0x1d')](_0x4f6fba[_0x1e33('0x2e')][_0x1e33('0x1d')]);}return _0x132c17[_0x1e33('0x5f')](_0x348853);}})[_0x1e33('0x23')](function(_0x290570){if(_0x290570){return _0x290570?{'count':_0x2511c0,'rows':_0x290570}:null;}})[_0x1e33('0x23')](respondWithResult(_0xf373b7,null))[_0x1e33('0x43')](handleError(_0xf373b7,null));};exports[_0x1e33('0x61')]=function(_0x577893,_0x4e0110,_0x24b673){var _0x239662,_0x11954c;return db[_0x1e33('0x2b')]['find']({'where':{'id':_0x577893[_0x1e33('0x44')]['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x4e0110,null))[_0x1e33('0x23')](function(_0x53d96e){if(_0x53d96e){_0x11954c=_0x53d96e;return _0x53d96e['addLists'](_0x577893[_0x1e33('0x46')][_0x1e33('0x62')],_[_0x1e33('0x51')](_0x577893['body'],[_0x1e33('0x62'),'id'])||{});}return null;})['spread'](function(_0x241b8f){var _0x401c03;_0x239662=_0x241b8f||[];var _0x9017e7=[];if(_0x241b8f){for(var _0x57994a=0x0;_0x57994a<_0x241b8f['length'];_0x57994a+=0x1){var _0x53e7be=_0x241b8f[_0x57994a][_0x1e33('0x25')]({'plain':!![]});_0x11954c[_0x1e33('0x63')]=_0x577893[_0x1e33('0x46')][_0x1e33('0x63')]?_0x577893[_0x1e33('0x46')][_0x1e33('0x63')]:_0x11954c[_0x1e33('0x63')];switch(_0x11954c[_0x1e33('0x63')]){case _0x1e33('0x64'):_0x401c03=squel[_0x1e33('0x65')]()[_0x1e33('0x66')](_0x1e33('0x67'))[_0x1e33('0x68')]([_0x1e33('0x69'),'scheduledAt',_0x1e33('0x6a'),_0x1e33('0x6b'),_0x1e33('0x5b'),_0x1e33('0x52'),_0x1e33('0x53')],squel[_0x1e33('0x6c')]()[_0x1e33('0x6d')](_0x1e33('0x69'),_0x1e33('0x69'))[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x6f'))['field']('id','ContactId')['field'](_0x53e7be[_0x1e33('0x70')][_0x1e33('0x71')](),_0x1e33('0x6b'))[_0x1e33('0x6d')](_0x577893[_0x1e33('0x44')]['id'][_0x1e33('0x71')](),'CampaignId')[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x52'))[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x53'))[_0x1e33('0x72')](_0x1e33('0x73'))[_0x1e33('0x3a')](_0x1e33('0x74'))[_0x1e33('0x3a')]('ListId\x20=\x20?',_0x53e7be[_0x1e33('0x70')][_0x1e33('0x71')]())[_0x1e33('0x3a')](_0x1e33('0x75'))['where'](_0x1e33('0x76'),squel[_0x1e33('0x6c')]()[_0x1e33('0x6d')](_0x1e33('0x77'))[_0x1e33('0x72')](_0x1e33('0x78'))['where']('CampaignId\x20=\x20?',_0x577893[_0x1e33('0x44')]['id']['toString']()))[_0x1e33('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1e33('0x6c')]()[_0x1e33('0x6d')](_0x1e33('0x79'))['from'](_0x1e33('0x67'))['where'](_0x1e33('0x7a'),_0x577893[_0x1e33('0x44')]['id'][_0x1e33('0x71')]())))[_0x1e33('0x71')]();break;case _0x1e33('0x7b'):_0x401c03=squel[_0x1e33('0x65')]()[_0x1e33('0x66')]('cm_hopper')[_0x1e33('0x68')](['phone','scheduledAt','ContactId','ListId',_0x1e33('0x5b'),_0x1e33('0x52'),_0x1e33('0x53')],squel['select']()[_0x1e33('0x6d')]('phone','phone')[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x6f'))[_0x1e33('0x6d')]('id','ContactId')[_0x1e33('0x6d')](_0x53e7be[_0x1e33('0x70')][_0x1e33('0x71')](),_0x1e33('0x6b'))[_0x1e33('0x6d')](_0x577893[_0x1e33('0x44')]['id'][_0x1e33('0x71')](),'CampaignId')['field'](_0x1e33('0x6e'),'createdAt')[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x53'))['from']('cm_contacts')['where'](_0x1e33('0x74'))[_0x1e33('0x3a')](_0x1e33('0x7c'),_0x53e7be[_0x1e33('0x70')]['toString']())['where'](_0x1e33('0x75'))[_0x1e33('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1e33('0x6c')]()[_0x1e33('0x6d')](_0x1e33('0x79'))['from'](_0x1e33('0x67'))[_0x1e33('0x3a')](_0x1e33('0x7a'),_0x577893[_0x1e33('0x44')]['id'][_0x1e33('0x71')]())))['toString']();break;default:_0x401c03=squel['insert']()[_0x1e33('0x66')](_0x1e33('0x67'))[_0x1e33('0x68')]([_0x1e33('0x69'),'scheduledAt',_0x1e33('0x6a'),_0x1e33('0x6b'),_0x1e33('0x5b'),'createdAt','updatedAt'],squel['select']()['field'](_0x1e33('0x69'),_0x1e33('0x69'))[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x6f'))[_0x1e33('0x6d')]('id','ContactId')['field'](_0x53e7be[_0x1e33('0x70')][_0x1e33('0x71')](),_0x1e33('0x6b'))[_0x1e33('0x6d')](_0x577893[_0x1e33('0x44')]['id'][_0x1e33('0x71')](),_0x1e33('0x5b'))['field']('NOW()',_0x1e33('0x52'))[_0x1e33('0x6d')]('NOW()','updatedAt')[_0x1e33('0x72')](_0x1e33('0x73'))[_0x1e33('0x3a')](_0x1e33('0x74'))[_0x1e33('0x3a')](_0x1e33('0x7c'),_0x53e7be[_0x1e33('0x70')][_0x1e33('0x71')]())[_0x1e33('0x3a')](_0x1e33('0x75')))[_0x1e33('0x71')]();}_0x9017e7[_0x1e33('0x7d')](db[_0x1e33('0x7e')][_0x1e33('0x2e')](_0x401c03));}return BPromise[_0x1e33('0x7f')](_0x9017e7);}})[_0x1e33('0x23')](function(){return _0x239662;})[_0x1e33('0x23')](respondWithResult(_0x4e0110,null))[_0x1e33('0x43')](handleError(_0x4e0110,null));};exports[_0x1e33('0x80')]=function(_0x5533a9,_0x39409e,_0x1d824b){return db[_0x1e33('0x2b')][_0x1e33('0x45')]({'where':{'id':_0x5533a9['params']['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x39409e,null))[_0x1e33('0x23')](function(_0x5a5731){if(_0x5a5731){return _0x5a5731[_0x1e33('0x80')](_0x5533a9['query'][_0x1e33('0x62')]);}})[_0x1e33('0x23')](function(_0x81ac47){if(_0x81ac47){return db[_0x1e33('0x57')]['destroy']({'where':{'ListId':_0x5533a9[_0x1e33('0x2e')][_0x1e33('0x62')],'CampaignId':_0x5533a9[_0x1e33('0x44')]['id']}})['then'](function(){return _0x81ac47;});}})[_0x1e33('0x23')](respondWithStatusCode(_0x39409e,null))[_0x1e33('0x43')](handleError(_0x39409e,null));};exports['getBlackLists']=function(_0x5a54a2,_0x4676ef,_0x24920e){var _0x290302={'raw':!![],'where':{}};var _0x11974c={};var _0xb06e6c={'count':0x0,'rows':[]};return db[_0x1e33('0x2b')][_0x1e33('0x56')]({'where':{'id':_0x5a54a2[_0x1e33('0x44')]['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x4676ef,null))[_0x1e33('0x23')](function(_0x3a1ff2){if(_0x3a1ff2){_0x11974c['model']=_[_0x1e33('0x2d')](db[_0x1e33('0x60')][_0x1e33('0x2c')]);_0x11974c[_0x1e33('0x2e')]=_[_0x1e33('0x2d')](_0x5a54a2[_0x1e33('0x2e')]);_0x11974c[_0x1e33('0x2f')]=_['intersection'](_0x11974c[_0x1e33('0x32')],_0x11974c[_0x1e33('0x2e')]);_0x290302[_0x1e33('0x31')]=_[_0x1e33('0x30')](_0x11974c['model'],qs['fields'](_0x5a54a2[_0x1e33('0x2e')][_0x1e33('0x33')]));_0x290302[_0x1e33('0x31')]=_0x290302[_0x1e33('0x31')][_0x1e33('0x34')]?_0x290302[_0x1e33('0x31')]:_0x11974c[_0x1e33('0x32')];if(!_0x5a54a2[_0x1e33('0x2e')]['hasOwnProperty'](_0x1e33('0x36'))){_0x290302['limit']=qs[_0x1e33('0x37')](_0x5a54a2[_0x1e33('0x2e')][_0x1e33('0x37')]);_0x290302[_0x1e33('0x1d')]=qs[_0x1e33('0x1d')](_0x5a54a2['query'][_0x1e33('0x1d')]);}_0x290302[_0x1e33('0x38')]=qs[_0x1e33('0x39')](_0x5a54a2[_0x1e33('0x2e')]['sort']);_0x290302[_0x1e33('0x3a')]=qs['filters'](_[_0x1e33('0x5a')](_0x5a54a2[_0x1e33('0x2e')],_0x11974c[_0x1e33('0x2f')]));_0x290302[_0x1e33('0x3a')][_0x1e33('0x5b')]=_0x3a1ff2['id'];if(_0x5a54a2[_0x1e33('0x2e')][_0x1e33('0x3b')]){_0x290302['where']=_[_0x1e33('0x3c')](_0x290302[_0x1e33('0x3a')],{'$or':_[_0x1e33('0x3d')](_0x290302[_0x1e33('0x31')],function(_0xdb94ba){var _0x4e63e3={};_0x4e63e3[_0xdb94ba]={'$like':'%'+_0x5a54a2[_0x1e33('0x2e')][_0x1e33('0x3b')]+'%'};return _0x4e63e3;})});}_0x290302=_[_0x1e33('0x3c')]({},_0x290302,_0x5a54a2[_0x1e33('0x40')]);return db['CmList']['count']({'where':_0x290302['where']})[_0x1e33('0x23')](function(_0x40ee84){_0xb06e6c['count']=_0x40ee84;if(_0x5a54a2[_0x1e33('0x2e')][_0x1e33('0x41')]){_0x290302[_0x1e33('0x42')]=[{'all':!![]}];}return db[_0x1e33('0x60')][_0x1e33('0x5c')](_0x290302);})[_0x1e33('0x23')](function(_0x1cef28){_0xb06e6c[_0x1e33('0x58')]=_0x1cef28;return _0xb06e6c;});}})[_0x1e33('0x23')](respondWithFilteredResult(_0x4676ef,_0x290302))[_0x1e33('0x43')](handleError(_0x4676ef,null));};exports[_0x1e33('0x81')]=function(_0x5048d6,_0x357926,_0x42a5ad){var _0xa0f750,_0x57d117;return db['Campaign'][_0x1e33('0x45')]({'where':{'id':_0x5048d6[_0x1e33('0x44')]['id']}})[_0x1e33('0x23')](handleEntityNotFound(_0x357926,null))[_0x1e33('0x23')](function(_0x4d3ff7){if(_0x4d3ff7){_0x57d117=_0x4d3ff7;return _0x4d3ff7['addBlackLists'](_0x5048d6[_0x1e33('0x46')][_0x1e33('0x62')],_['omit'](_0x5048d6['body'],[_0x1e33('0x62'),'id'])||{});}return null;})[_0x1e33('0x82')](function(_0x1721db){var _0x37575e;_0xa0f750=_0x1721db||[];var _0x4a8f9e=[];if(_0x1721db){for(var _0x5c91f2=0x0;_0x5c91f2<_0x1721db['length'];_0x5c91f2+=0x1){var _0x38af6c=_0x1721db[_0x5c91f2][_0x1e33('0x25')]({'plain':!![]});_0x37575e=squel[_0x1e33('0x65')]()['into'](_0x1e33('0x83'))[_0x1e33('0x68')]([_0x1e33('0x69'),_0x1e33('0x6a'),_0x1e33('0x6b'),_0x1e33('0x5b'),_0x1e33('0x52'),_0x1e33('0x53')],squel[_0x1e33('0x6c')]()['field'](_0x1e33('0x69'),_0x1e33('0x69'))[_0x1e33('0x6d')]('id',_0x1e33('0x6a'))[_0x1e33('0x6d')](_0x38af6c['CmListId'][_0x1e33('0x71')](),_0x1e33('0x6b'))[_0x1e33('0x6d')](_0x5048d6[_0x1e33('0x44')]['id'][_0x1e33('0x71')](),_0x1e33('0x5b'))[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x52'))[_0x1e33('0x6d')](_0x1e33('0x6e'),_0x1e33('0x53'))[_0x1e33('0x72')](_0x1e33('0x73'))[_0x1e33('0x3a')](_0x1e33('0x74'))[_0x1e33('0x3a')](_0x1e33('0x7c'),_0x38af6c[_0x1e33('0x70')]['toString']())['where'](_0x1e33('0x75')))[_0x1e33('0x71')]();_0x4a8f9e[_0x1e33('0x7d')](db[_0x1e33('0x7e')][_0x1e33('0x2e')](_0x37575e));}return BPromise[_0x1e33('0x7f')](_0x4a8f9e);}})[_0x1e33('0x23')](function(){return _0xa0f750;})['then'](respondWithResult(_0x357926,null))[_0x1e33('0x43')](handleError(_0x357926,null));};exports[_0x1e33('0x84')]=function(_0x1a8cd5,_0x597fca,_0xcc2e7d){return db['Campaign'][_0x1e33('0x45')]({'where':{'id':_0x1a8cd5[_0x1e33('0x44')]['id']}})['then'](handleEntityNotFound(_0x597fca,null))[_0x1e33('0x23')](function(_0x2d9906){if(_0x2d9906){return _0x2d9906[_0x1e33('0x84')](_0x1a8cd5[_0x1e33('0x2e')][_0x1e33('0x62')]);}})['then'](function(_0x1b9ede){if(_0x1b9ede){return db[_0x1e33('0x5e')][_0x1e33('0x24')]({'where':{'ListId':_0x1a8cd5['query'][_0x1e33('0x62')],'CampaignId':_0x1a8cd5[_0x1e33('0x44')]['id']}})[_0x1e33('0x23')](function(){return _0x1b9ede;});}})[_0x1e33('0x23')](respondWithStatusCode(_0x597fca,null))[_0x1e33('0x43')](handleError(_0x597fca,null));}; \ No newline at end of file +var _0xceee=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','IvrCampaigns','getHoppers','findOne','CampaignId','filter','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','ListId','createdAt','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId\x20=\x20?','cm_hopper','push','sequelize','all','removeLists','CmHopper','getBlackLists','addBlackLists','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','name','send','index','Campaign','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','role'];(function(_0x3c963f,_0x5d4799){var _0x261d53=function(_0x454e4c){while(--_0x454e4c){_0x3c963f['push'](_0x3c963f['shift']());}};_0x261d53(++_0x5d4799);}(_0xceee,0xbe));var _0xecee=function(_0x22e753,_0x1d2372){_0x22e753=_0x22e753-0x0;var _0x5eb9e7=_0xceee[_0x22e753];return _0x5eb9e7;};'use strict';var pdf=require(_0xecee('0x0'));var emlformat=require(_0xecee('0x1'));var rimraf=require(_0xecee('0x2'));var zipdir=require(_0xecee('0x3'));var jsonpatch=require(_0xecee('0x4'));var rp=require(_0xecee('0x5'));var moment=require('moment');var BPromise=require(_0xecee('0x6'));var Mustache=require('mustache');var util=require(_0xecee('0x7'));var path=require(_0xecee('0x8'));var sox=require('sox');var csv=require(_0xecee('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xecee('0xa'));var squel=require(_0xecee('0xb'));var crypto=require(_0xecee('0xc'));var jsforce=require(_0xecee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xecee('0x9'));var querystring=require(_0xecee('0xe'));var Papa=require(_0xecee('0xf'));var Redis=require('ioredis');var authService=require(_0xecee('0x10'));var qs=require(_0xecee('0x11'));var hardwareService=require(_0xecee('0x12'));var logger=require(_0xecee('0x13'))(_0xecee('0x14'));var utils=require(_0xecee('0x15'));var config=require(_0xecee('0x16'));var db=require(_0xecee('0x17'))['db'];function respondWithStatusCode(_0x4d790f,_0x852f14){_0x852f14=_0x852f14||0xcc;return function(_0x4c5ffb){if(_0x4c5ffb){return _0x4d790f['sendStatus'](_0x852f14);}return _0x4d790f[_0xecee('0x18')](_0x852f14)[_0xecee('0x19')]();};}function respondWithResult(_0x21ea25,_0xce6181){_0xce6181=_0xce6181||0xc8;return function(_0x130ef6){if(_0x130ef6){return _0x21ea25[_0xecee('0x18')](_0xce6181)[_0xecee('0x1a')](_0x130ef6);}};}function respondWithFilteredResult(_0x357c3d,_0x24c97f){return function(_0x9d4338){if(_0x9d4338){var _0x4447a3=_0x9d4338[_0xecee('0x1b')],_0x2a2d85=_0x24c97f[_0xecee('0x1c')],_0x401233=_0x24c97f[_0xecee('0x1c')]+_0x24c97f['limit'],_0x56b189;if(_0x401233>=_0x4447a3){_0x401233=_0x4447a3;_0x56b189=0xc8;}else{_0x56b189=0xce;}_0x357c3d[_0xecee('0x18')](_0x56b189);return _0x357c3d[_0xecee('0x1d')]('Content-Range',_0x2a2d85+'-'+_0x401233+'/'+_0x4447a3)[_0xecee('0x1a')](_0x9d4338);}return null;};}function patchUpdates(_0x56b578){return function(_0x3c492a){try{jsonpatch[_0xecee('0x1e')](_0x3c492a,_0x56b578,!![]);}catch(_0x3925d3){return BPromise[_0xecee('0x1f')](_0x3925d3);}return _0x3c492a[_0xecee('0x20')]();};}function saveUpdates(_0x4a621f,_0x29916a){return function(_0xf0900b){if(_0xf0900b){return _0xf0900b[_0xecee('0x21')](_0x4a621f)[_0xecee('0x22')](function(_0x73ead7){return _0x73ead7;});}return null;};}function removeEntity(_0x3e6751,_0x30976f){return function(_0xdc5ce7){if(_0xdc5ce7){return _0xdc5ce7['destroy']()[_0xecee('0x22')](function(){var _0x30ed39=_0xdc5ce7['get']({'plain':!![]});var _0x418638='IvrCampaigns';return db[_0xecee('0x23')][_0xecee('0x24')]({'where':{'type':_0x418638,'resourceId':_0x30ed39['id']}})[_0xecee('0x22')](function(){return _0xdc5ce7;});})[_0xecee('0x22')](function(){_0x3e6751[_0xecee('0x18')](0xcc)[_0xecee('0x19')]();});}};}function handleEntityNotFound(_0x568781,_0x1feb62){return function(_0x488b47){if(!_0x488b47){_0x568781[_0xecee('0x25')](0x194);}return _0x488b47;};}function handleError(_0x228614,_0x5d1cd9){_0x5d1cd9=_0x5d1cd9||0x1f4;return function(_0x506200){logger['error'](_0x506200['stack']);if(_0x506200['name']){delete _0x506200[_0xecee('0x26')];}_0x228614[_0xecee('0x18')](_0x5d1cd9)[_0xecee('0x27')](_0x506200);};}exports[_0xecee('0x28')]=function(_0x537073,_0xfae884){var _0x94413a={},_0x44761f={},_0x23f1b1={'count':0x0,'rows':[]};var _0x2aca67=db[_0xecee('0x29')][_0xecee('0x2a')];_0x44761f[_0xecee('0x2b')]=_[_0xecee('0x2c')](_0x2aca67);_0x44761f[_0xecee('0x2d')]=_['keys'](_0x537073[_0xecee('0x2d')]);_0x44761f[_0xecee('0x2e')]=_[_0xecee('0x2f')](_0x44761f[_0xecee('0x2b')],_0x44761f[_0xecee('0x2d')]);_0x94413a['attributes']=_[_0xecee('0x2f')](_0x44761f[_0xecee('0x2b')],qs['fields'](_0x537073[_0xecee('0x2d')][_0xecee('0x30')]));_0x94413a['attributes']=_0x94413a[_0xecee('0x31')][_0xecee('0x32')]?_0x94413a['attributes']:_0x44761f[_0xecee('0x2b')];if(!_0x537073[_0xecee('0x2d')][_0xecee('0x33')](_0xecee('0x34'))){_0x94413a[_0xecee('0x35')]=qs[_0xecee('0x35')](_0x537073[_0xecee('0x2d')]['limit']);_0x94413a[_0xecee('0x1c')]=qs[_0xecee('0x1c')](_0x537073[_0xecee('0x2d')][_0xecee('0x1c')]);}_0x94413a[_0xecee('0x36')]=qs[_0xecee('0x37')](_0x537073[_0xecee('0x2d')][_0xecee('0x37')]);_0x94413a[_0xecee('0x38')]=qs[_0xecee('0x2e')](_[_0xecee('0x39')](_0x537073[_0xecee('0x2d')],_0x44761f[_0xecee('0x2e')]));if(_0x537073['query']['filter']){_0x94413a['where']=_['merge'](_0x94413a[_0xecee('0x38')],{'$or':_[_0xecee('0x3a')](_0x2aca67,function(_0x1022bd){if(_0x1022bd['type'][_0xecee('0x3b')]!==_0xecee('0x3c')){var _0x5e86e1={};_0x5e86e1[_0x1022bd[_0xecee('0x3d')]]={'$like':'%'+_0x537073[_0xecee('0x2d')]['filter']+'%'};return _0x5e86e1;}})});}_0x94413a=_[_0xecee('0x3e')]({},_0x94413a,_0x537073[_0xecee('0x3f')]);var _0x171ee={'where':_0x94413a['where']};return db[_0xecee('0x29')][_0xecee('0x1b')](_0x171ee)[_0xecee('0x22')](function(_0x261891){_0x23f1b1[_0xecee('0x1b')]=_0x261891;if(_0x537073[_0xecee('0x2d')][_0xecee('0x40')]){_0x94413a[_0xecee('0x41')]=[{'all':!![]}];}return db[_0xecee('0x29')][_0xecee('0x42')](_0x94413a);})[_0xecee('0x22')](function(_0x5b97ef){_0x23f1b1['rows']=_0x5b97ef;return _0x23f1b1;})[_0xecee('0x22')](respondWithFilteredResult(_0xfae884,_0x94413a))[_0xecee('0x43')](handleError(_0xfae884,null));};exports[_0xecee('0x44')]=function(_0x2b2070,_0x199a73){var _0x314410={'raw':![],'where':{'id':_0x2b2070[_0xecee('0x45')]['id']}},_0x45eec7={};_0x45eec7['model']=_[_0xecee('0x2c')](db[_0xecee('0x29')]['rawAttributes']);_0x45eec7[_0xecee('0x2d')]=_[_0xecee('0x2c')](_0x2b2070[_0xecee('0x2d')]);_0x45eec7[_0xecee('0x2e')]=_[_0xecee('0x2f')](_0x45eec7[_0xecee('0x2b')],_0x45eec7[_0xecee('0x2d')]);_0x314410[_0xecee('0x31')]=_[_0xecee('0x2f')](_0x45eec7[_0xecee('0x2b')],qs[_0xecee('0x30')](_0x2b2070[_0xecee('0x2d')][_0xecee('0x30')]));_0x314410[_0xecee('0x31')]=_0x314410['attributes'][_0xecee('0x32')]?_0x314410[_0xecee('0x31')]:_0x45eec7[_0xecee('0x2b')];if(_0x2b2070[_0xecee('0x2d')][_0xecee('0x40')]){_0x314410[_0xecee('0x41')]=[{'all':!![]}];}_0x314410=_['merge']({},_0x314410,_0x2b2070[_0xecee('0x3f')]);return db[_0xecee('0x29')][_0xecee('0x46')](_0x314410)['then'](handleEntityNotFound(_0x199a73,null))['then'](respondWithResult(_0x199a73,null))[_0xecee('0x43')](handleError(_0x199a73,null));};exports[_0xecee('0x47')]=function(_0x5e7f1b,_0x29b970){return db[_0xecee('0x29')][_0xecee('0x47')](_0x5e7f1b[_0xecee('0x48')],{})['then'](function(_0x39fb30){var _0x16255e=_0x5e7f1b[_0xecee('0x49')][_0xecee('0x4a')]({'plain':!![]});if(!_0x16255e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16255e[_0xecee('0x4b')]===_0xecee('0x49')){var _0x3d2f4e=_0x39fb30[_0xecee('0x4a')]({'plain':!![]});var _0x43d1ed='IvrCampaigns';return db[_0xecee('0x4c')][_0xecee('0x46')]({'where':{'name':_0x43d1ed,'userProfileId':_0x16255e[_0xecee('0x4d')]},'raw':!![]})[_0xecee('0x22')](function(_0x34b2f7){if(_0x34b2f7&&_0x34b2f7[_0xecee('0x4e')]===0x0){return db[_0xecee('0x23')]['create']({'name':_0x3d2f4e[_0xecee('0x26')],'resourceId':_0x3d2f4e['id'],'type':_0x34b2f7[_0xecee('0x26')],'sectionId':_0x34b2f7['id']},{})[_0xecee('0x22')](function(){return _0x39fb30;});}else{return _0x39fb30;}})['catch'](function(_0x4562f5){logger['error'](_0xecee('0x4f'),_0x4562f5);throw _0x4562f5;});}return _0x39fb30;})[_0xecee('0x22')](respondWithResult(_0x29b970,0xc9))[_0xecee('0x43')](handleError(_0x29b970,null));};exports[_0xecee('0x50')]=function(_0x1a01b6,_0x5d42a4){var _0x3b8f58={'raw':![],'where':{'id':_0x1a01b6[_0xecee('0x45')]['id']}},_0x57b2e4={};_0x57b2e4[_0xecee('0x2b')]=_[_0xecee('0x2c')](db[_0xecee('0x29')][_0xecee('0x2a')]);_0x3b8f58[_0xecee('0x31')]=_[_0xecee('0x2f')](_0x57b2e4[_0xecee('0x2b')],qs[_0xecee('0x30')](_0x1a01b6[_0xecee('0x2d')]['fields']));_0x3b8f58['attributes']=_0x3b8f58[_0xecee('0x31')][_0xecee('0x32')]?_0x3b8f58[_0xecee('0x31')]:_0x57b2e4[_0xecee('0x2b')];if(_0x1a01b6[_0xecee('0x2d')][_0xecee('0x40')]){_0x3b8f58[_0xecee('0x41')]=[{'all':!![]}];}_0x3b8f58=_['merge']({},_0x3b8f58,_0x1a01b6[_0xecee('0x3f')]);return db[_0xecee('0x29')][_0xecee('0x46')](_0x3b8f58)[_0xecee('0x22')](handleEntityNotFound(_0x5d42a4,null))[_0xecee('0x22')](function(_0x1deb42){if(_0x1deb42){var _0x394cdd=_0x1deb42['get']({'plain':!![]});_0x394cdd=qs[_0xecee('0x51')](_0x394cdd,['id','createdAt','updatedAt']);_0x1a01b6[_0xecee('0x48')]=_['omit'](_0x1a01b6[_0xecee('0x48')],['id','createdAt',_0xecee('0x52')]);return db[_0xecee('0x29')][_0xecee('0x47')](_[_0xecee('0x3e')](_0x394cdd,_0x1a01b6['body']),{'include':_0x1a01b6[_0xecee('0x2d')][_0xecee('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x38a823){var _0x4edbcd=_0x1a01b6[_0xecee('0x49')][_0xecee('0x4a')]({'plain':!![]});if(!_0x4edbcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4edbcd[_0xecee('0x4b')]===_0xecee('0x49')){var _0x37af04=_0x38a823[_0xecee('0x4a')]({'plain':!![]});var _0xf3ffff=_0xecee('0x53');return db[_0xecee('0x4c')][_0xecee('0x46')]({'where':{'name':_0xf3ffff,'userProfileId':_0x4edbcd[_0xecee('0x4d')]},'raw':!![]})[_0xecee('0x22')](function(_0x20d809){if(_0x20d809&&_0x20d809[_0xecee('0x4e')]===0x0){return db['UserProfileResource'][_0xecee('0x47')]({'name':_0x37af04[_0xecee('0x26')],'resourceId':_0x37af04['id'],'type':_0x20d809[_0xecee('0x26')],'sectionId':_0x20d809['id']},{})[_0xecee('0x22')](function(){return _0x38a823;});}else{return _0x38a823;}})[_0xecee('0x43')](function(_0x3d0a2b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d0a2b);throw _0x3d0a2b;});}return _0x38a823;});}})['then'](respondWithResult(_0x5d42a4,0xc9))[_0xecee('0x43')](handleError(_0x5d42a4,null));};exports['update']=function(_0x4b196b,_0x2244ec){if(_0x4b196b[_0xecee('0x48')]['id']){delete _0x4b196b[_0xecee('0x48')]['id'];}return db[_0xecee('0x29')]['find']({'where':{'id':_0x4b196b[_0xecee('0x45')]['id']}})['then'](handleEntityNotFound(_0x2244ec,null))[_0xecee('0x22')](saveUpdates(_0x4b196b['body'],null))[_0xecee('0x22')](respondWithResult(_0x2244ec,null))['catch'](handleError(_0x2244ec,null));};exports[_0xecee('0x24')]=function(_0x532cbf,_0x49f305){return db[_0xecee('0x29')][_0xecee('0x46')]({'where':{'id':_0x532cbf[_0xecee('0x45')]['id']}})['then'](handleEntityNotFound(_0x49f305,null))[_0xecee('0x22')](removeEntity(_0x49f305,null))['catch'](handleError(_0x49f305,null));};exports[_0xecee('0x54')]=function(_0x3c067b,_0x31e994,_0x171d21){var _0x1e42c7={'raw':!![],'where':{}};var _0x368efc={};var _0x3a8461={'count':0x0,'rows':[]};return db[_0xecee('0x29')][_0xecee('0x55')]({'where':{'id':_0x3c067b['params']['id']}})['then'](handleEntityNotFound(_0x31e994,null))[_0xecee('0x22')](function(_0x283fe8){if(_0x283fe8){_0x368efc['model']=_[_0xecee('0x2c')](db['CmHopper']['rawAttributes']);_0x368efc[_0xecee('0x2d')]=_[_0xecee('0x2c')](_0x3c067b[_0xecee('0x2d')]);_0x368efc[_0xecee('0x2e')]=_[_0xecee('0x2f')](_0x368efc[_0xecee('0x2b')],_0x368efc['query']);_0x1e42c7[_0xecee('0x31')]=_[_0xecee('0x2f')](_0x368efc[_0xecee('0x2b')],qs['fields'](_0x3c067b[_0xecee('0x2d')][_0xecee('0x30')]));_0x1e42c7[_0xecee('0x31')]=_0x1e42c7['attributes']['length']?_0x1e42c7['attributes']:_0x368efc[_0xecee('0x2b')];if(!_0x3c067b['query'][_0xecee('0x33')](_0xecee('0x34'))){_0x1e42c7[_0xecee('0x35')]=qs[_0xecee('0x35')](_0x3c067b[_0xecee('0x2d')][_0xecee('0x35')]);_0x1e42c7['offset']=qs[_0xecee('0x1c')](_0x3c067b[_0xecee('0x2d')]['offset']);}_0x1e42c7['order']=qs[_0xecee('0x37')](_0x3c067b['query'][_0xecee('0x37')]);_0x1e42c7[_0xecee('0x38')]=qs[_0xecee('0x2e')](_['pick'](_0x3c067b['query'],_0x368efc[_0xecee('0x2e')]));_0x1e42c7[_0xecee('0x38')][_0xecee('0x56')]=_0x283fe8['id'];if(_0x3c067b[_0xecee('0x2d')][_0xecee('0x57')]){_0x1e42c7[_0xecee('0x38')]=_[_0xecee('0x3e')](_0x1e42c7[_0xecee('0x38')],{'$or':_['map'](_0x1e42c7[_0xecee('0x31')],function(_0x54721c){var _0xe61386={};_0xe61386[_0x54721c]={'$like':'%'+_0x3c067b['query'][_0xecee('0x57')]+'%'};return _0xe61386;})});}_0x1e42c7=_['merge']({},_0x1e42c7,_0x3c067b['options']);return db['CmHopper'][_0xecee('0x1b')]({'where':_0x1e42c7['where']})[_0xecee('0x22')](function(_0x3e0c69){_0x3a8461[_0xecee('0x1b')]=_0x3e0c69;if(_0x3c067b[_0xecee('0x2d')]['includeAll']){_0x1e42c7[_0xecee('0x41')]=[{'all':!![]}];}return db['CmHopper'][_0xecee('0x42')](_0x1e42c7);})[_0xecee('0x22')](function(_0x4cce9f){_0x3a8461[_0xecee('0x58')]=_0x4cce9f;return _0x3a8461;});}})[_0xecee('0x22')](respondWithFilteredResult(_0x31e994,_0x1e42c7))[_0xecee('0x43')](handleError(_0x31e994,null));};exports['getHopperHistories']=function(_0x4afef8,_0x259c7e,_0x2b224b){var _0x14655={'raw':!![],'where':{}};var _0x18438a={};var _0x43209e={'count':0x0,'rows':[]};return db[_0xecee('0x29')][_0xecee('0x55')]({'where':{'id':_0x4afef8[_0xecee('0x45')]['id']}})['then'](handleEntityNotFound(_0x259c7e,null))[_0xecee('0x22')](function(_0x25aa9e){if(_0x25aa9e){_0x18438a[_0xecee('0x2b')]=_['keys'](db[_0xecee('0x59')][_0xecee('0x2a')]);_0x18438a[_0xecee('0x2d')]=_[_0xecee('0x2c')](_0x4afef8[_0xecee('0x2d')]);_0x18438a[_0xecee('0x2e')]=_['intersection'](_0x18438a[_0xecee('0x2b')],_0x18438a[_0xecee('0x2d')]);_0x14655[_0xecee('0x31')]=_[_0xecee('0x2f')](_0x18438a[_0xecee('0x2b')],qs[_0xecee('0x30')](_0x4afef8[_0xecee('0x2d')][_0xecee('0x30')]));_0x14655[_0xecee('0x31')]=_0x14655[_0xecee('0x31')][_0xecee('0x32')]?_0x14655['attributes']:_0x18438a[_0xecee('0x2b')];if(!_0x4afef8[_0xecee('0x2d')]['hasOwnProperty'](_0xecee('0x34'))){_0x14655['limit']=qs[_0xecee('0x35')](_0x4afef8[_0xecee('0x2d')][_0xecee('0x35')]);_0x14655[_0xecee('0x1c')]=qs['offset'](_0x4afef8['query']['offset']);}_0x14655[_0xecee('0x36')]=qs[_0xecee('0x37')](_0x4afef8[_0xecee('0x2d')][_0xecee('0x37')]);_0x14655[_0xecee('0x38')]=qs[_0xecee('0x2e')](_[_0xecee('0x39')](_0x4afef8[_0xecee('0x2d')],_0x18438a[_0xecee('0x2e')]));_0x14655[_0xecee('0x38')][_0xecee('0x56')]=_0x25aa9e['id'];if(_0x4afef8['query'][_0xecee('0x57')]){_0x14655['where']=_[_0xecee('0x3e')](_0x14655[_0xecee('0x38')],{'$or':_[_0xecee('0x3a')](_0x14655[_0xecee('0x31')],function(_0x109378){var _0x4cb3dd={};_0x4cb3dd[_0x109378]={'$like':'%'+_0x4afef8[_0xecee('0x2d')][_0xecee('0x57')]+'%'};return _0x4cb3dd;})});}_0x14655=_[_0xecee('0x3e')]({},_0x14655,_0x4afef8[_0xecee('0x3f')]);return db[_0xecee('0x59')][_0xecee('0x1b')]({'where':_0x14655[_0xecee('0x38')]})[_0xecee('0x22')](function(_0x540d38){_0x43209e[_0xecee('0x1b')]=_0x540d38;if(_0x4afef8[_0xecee('0x2d')]['includeAll']){_0x14655['include']=[{'all':!![]}];}return db[_0xecee('0x59')]['findAll'](_0x14655);})[_0xecee('0x22')](function(_0x60e469){_0x43209e[_0xecee('0x58')]=_0x60e469;return _0x43209e;});}})[_0xecee('0x22')](respondWithFilteredResult(_0x259c7e,_0x14655))[_0xecee('0x43')](handleError(_0x259c7e,null));};exports[_0xecee('0x5a')]=function(_0x274dcc,_0x3d5a71,_0xc798eb){var _0x83467f={'raw':!![],'where':{}};var _0x3796ea={};var _0xd81ff8={'count':0x0,'rows':[]};return db[_0xecee('0x29')][_0xecee('0x55')]({'where':{'id':_0x274dcc[_0xecee('0x45')]['id']}})[_0xecee('0x22')](handleEntityNotFound(_0x3d5a71,null))[_0xecee('0x22')](function(_0x5913af){if(_0x5913af){_0x3796ea[_0xecee('0x2b')]=_['keys'](db[_0xecee('0x5b')][_0xecee('0x2a')]);_0x3796ea[_0xecee('0x2d')]=_[_0xecee('0x2c')](_0x274dcc[_0xecee('0x2d')]);_0x3796ea[_0xecee('0x2e')]=_['intersection'](_0x3796ea['model'],_0x3796ea[_0xecee('0x2d')]);_0x83467f[_0xecee('0x31')]=_['intersection'](_0x3796ea[_0xecee('0x2b')],qs[_0xecee('0x30')](_0x274dcc[_0xecee('0x2d')]['fields']));_0x83467f[_0xecee('0x31')]=_0x83467f[_0xecee('0x31')][_0xecee('0x32')]?_0x83467f['attributes']:_0x3796ea[_0xecee('0x2b')];if(!_0x274dcc[_0xecee('0x2d')]['hasOwnProperty'](_0xecee('0x34'))){_0x83467f[_0xecee('0x35')]=qs[_0xecee('0x35')](_0x274dcc[_0xecee('0x2d')]['limit']);_0x83467f[_0xecee('0x1c')]=qs[_0xecee('0x1c')](_0x274dcc[_0xecee('0x2d')][_0xecee('0x1c')]);}_0x83467f['order']=qs[_0xecee('0x37')](_0x274dcc[_0xecee('0x2d')][_0xecee('0x37')]);_0x83467f[_0xecee('0x38')]=qs[_0xecee('0x2e')](_[_0xecee('0x39')](_0x274dcc['query'],_0x3796ea[_0xecee('0x2e')]));_0x83467f[_0xecee('0x38')][_0xecee('0x56')]=_0x5913af['id'];if(_0x274dcc[_0xecee('0x2d')][_0xecee('0x57')]){_0x83467f[_0xecee('0x38')]=_['merge'](_0x83467f[_0xecee('0x38')],{'$or':_[_0xecee('0x3a')](_0x83467f[_0xecee('0x31')],function(_0x8df0d4){var _0x1fc3a8={};_0x1fc3a8[_0x8df0d4]={'$like':'%'+_0x274dcc[_0xecee('0x2d')][_0xecee('0x57')]+'%'};return _0x1fc3a8;})});}_0x83467f=_[_0xecee('0x3e')]({},_0x83467f,_0x274dcc[_0xecee('0x3f')]);return db[_0xecee('0x5b')]['count']({'where':_0x83467f['where']})[_0xecee('0x22')](function(_0x20634c){_0xd81ff8[_0xecee('0x1b')]=_0x20634c;if(_0x274dcc['query'][_0xecee('0x40')]){_0x83467f[_0xecee('0x41')]=[{'all':!![]}];}return db[_0xecee('0x5b')][_0xecee('0x42')](_0x83467f);})['then'](function(_0x41674a){_0xd81ff8['rows']=_0x41674a;return _0xd81ff8;});}})[_0xecee('0x22')](respondWithFilteredResult(_0x3d5a71,_0x83467f))['catch'](handleError(_0x3d5a71,null));};exports[_0xecee('0x5c')]=function(_0x43e67e,_0x4846d2,_0x56d519){var _0x1a4ec5={'raw':!![],'where':{}};var _0x385940={};var _0x26e04b={'count':0x0,'rows':[]};return db[_0xecee('0x29')][_0xecee('0x55')]({'where':{'id':_0x43e67e[_0xecee('0x45')]['id']}})['then'](handleEntityNotFound(_0x4846d2,null))[_0xecee('0x22')](function(_0x48feb8){if(_0x48feb8){_0x385940[_0xecee('0x2b')]=_[_0xecee('0x2c')](db[_0xecee('0x5d')][_0xecee('0x2a')]);_0x385940['query']=_[_0xecee('0x2c')](_0x43e67e[_0xecee('0x2d')]);_0x385940['filters']=_[_0xecee('0x2f')](_0x385940[_0xecee('0x2b')],_0x385940[_0xecee('0x2d')]);_0x1a4ec5[_0xecee('0x31')]=_['intersection'](_0x385940[_0xecee('0x2b')],qs[_0xecee('0x30')](_0x43e67e[_0xecee('0x2d')][_0xecee('0x30')]));_0x1a4ec5[_0xecee('0x31')]=_0x1a4ec5[_0xecee('0x31')][_0xecee('0x32')]?_0x1a4ec5[_0xecee('0x31')]:_0x385940[_0xecee('0x2b')];if(!_0x43e67e[_0xecee('0x2d')]['hasOwnProperty']('nolimit')){_0x1a4ec5['limit']=qs[_0xecee('0x35')](_0x43e67e[_0xecee('0x2d')][_0xecee('0x35')]);_0x1a4ec5[_0xecee('0x1c')]=qs[_0xecee('0x1c')](_0x43e67e['query'][_0xecee('0x1c')]);}_0x1a4ec5['order']=qs[_0xecee('0x37')](_0x43e67e[_0xecee('0x2d')]['sort']);_0x1a4ec5['where']=qs[_0xecee('0x2e')](_['pick'](_0x43e67e['query'],_0x385940['filters']));_0x1a4ec5[_0xecee('0x38')]['CampaignId']=_0x48feb8['id'];if(_0x43e67e[_0xecee('0x2d')][_0xecee('0x57')]){_0x1a4ec5[_0xecee('0x38')]=_['merge'](_0x1a4ec5[_0xecee('0x38')],{'$or':_[_0xecee('0x3a')](_0x1a4ec5[_0xecee('0x31')],function(_0x3d79d3){var _0x361005={};_0x361005[_0x3d79d3]={'$like':'%'+_0x43e67e[_0xecee('0x2d')][_0xecee('0x57')]+'%'};return _0x361005;})});}_0x1a4ec5=_[_0xecee('0x3e')]({},_0x1a4ec5,_0x43e67e[_0xecee('0x3f')]);return db[_0xecee('0x5d')][_0xecee('0x1b')]({'where':_0x1a4ec5['where']})['then'](function(_0x1f3f04){_0x26e04b[_0xecee('0x1b')]=_0x1f3f04;if(_0x43e67e[_0xecee('0x2d')][_0xecee('0x40')]){_0x1a4ec5['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xecee('0x42')](_0x1a4ec5);})['then'](function(_0x3e15c6){_0x26e04b[_0xecee('0x58')]=_0x3e15c6;return _0x26e04b;});}})['then'](respondWithFilteredResult(_0x4846d2,_0x1a4ec5))[_0xecee('0x43')](handleError(_0x4846d2,null));};exports[_0xecee('0x5e')]=function(_0x59a659,_0xe90892,_0x4cd3fe){var _0x4c47dd={};var _0x1d0e1d={};var _0x495b36;var _0x4e86d5;return db[_0xecee('0x29')][_0xecee('0x55')]({'where':{'id':_0x59a659[_0xecee('0x45')]['id']}})[_0xecee('0x22')](handleEntityNotFound(_0xe90892,null))[_0xecee('0x22')](function(_0x4176d3){if(_0x4176d3){_0x495b36=_0x4176d3;_0x1d0e1d[_0xecee('0x2b')]=_[_0xecee('0x2c')](db[_0xecee('0x5f')][_0xecee('0x2a')]);_0x1d0e1d[_0xecee('0x2d')]=_['keys'](_0x59a659[_0xecee('0x2d')]);_0x1d0e1d['filters']=_[_0xecee('0x2f')](_0x1d0e1d[_0xecee('0x2b')],_0x1d0e1d[_0xecee('0x2d')]);_0x4c47dd['attributes']=_[_0xecee('0x2f')](_0x1d0e1d['model'],qs[_0xecee('0x30')](_0x59a659[_0xecee('0x2d')][_0xecee('0x30')]));_0x4c47dd[_0xecee('0x31')]=_0x4c47dd[_0xecee('0x31')][_0xecee('0x32')]?_0x4c47dd[_0xecee('0x31')]:_0x1d0e1d[_0xecee('0x2b')];_0x4c47dd[_0xecee('0x36')]=qs[_0xecee('0x37')](_0x59a659[_0xecee('0x2d')]['sort']);_0x4c47dd[_0xecee('0x38')]=qs[_0xecee('0x2e')](_['pick'](_0x59a659[_0xecee('0x2d')],_0x1d0e1d[_0xecee('0x2e')]));if(_0x59a659[_0xecee('0x2d')][_0xecee('0x57')]){_0x4c47dd['where']=_[_0xecee('0x3e')](_0x4c47dd[_0xecee('0x38')],{'$or':_['map'](_0x4c47dd[_0xecee('0x31')],function(_0x2431cd){var _0x31f5aa={};_0x31f5aa[_0x2431cd]={'$like':'%'+_0x59a659['query'][_0xecee('0x57')]+'%'};return _0x31f5aa;})});}_0x4c47dd=_[_0xecee('0x3e')]({},_0x4c47dd,_0x59a659[_0xecee('0x3f')]);return _0x495b36[_0xecee('0x5e')](_0x4c47dd);}})[_0xecee('0x22')](function(_0x49befd){if(_0x49befd){_0x4e86d5=_0x49befd[_0xecee('0x32')];if(!_0x59a659[_0xecee('0x2d')][_0xecee('0x33')](_0xecee('0x34'))){_0x4c47dd[_0xecee('0x35')]=qs[_0xecee('0x35')](_0x59a659[_0xecee('0x2d')][_0xecee('0x35')]);_0x4c47dd[_0xecee('0x1c')]=qs[_0xecee('0x1c')](_0x59a659[_0xecee('0x2d')][_0xecee('0x1c')]);}return _0x495b36[_0xecee('0x5e')](_0x4c47dd);}})['then'](function(_0x7a7a85){if(_0x7a7a85){return _0x7a7a85?{'count':_0x4e86d5,'rows':_0x7a7a85}:null;}})[_0xecee('0x22')](respondWithResult(_0xe90892,null))[_0xecee('0x43')](handleError(_0xe90892,null));};exports['addLists']=function(_0x2c652e,_0x1ca37e,_0x42db51){var _0x45ff12,_0x18223f;return db['Campaign'][_0xecee('0x46')]({'where':{'id':_0x2c652e[_0xecee('0x45')]['id']}})[_0xecee('0x22')](handleEntityNotFound(_0x1ca37e,null))['then'](function(_0x320aa2){if(_0x320aa2){_0x18223f=_0x320aa2;return _0x320aa2[_0xecee('0x60')](_0x2c652e['body'][_0xecee('0x61')],_['omit'](_0x2c652e[_0xecee('0x48')],[_0xecee('0x61'),'id'])||{});}return null;})[_0xecee('0x62')](function(_0x1bdbcb){var _0xa98958;_0x45ff12=_0x1bdbcb||[];var _0x2b39e6=[];if(_0x1bdbcb){for(var _0x4ac0b5=0x0;_0x4ac0b5<_0x1bdbcb[_0xecee('0x32')];_0x4ac0b5+=0x1){var _0x29e5c2=_0x1bdbcb[_0x4ac0b5]['get']({'plain':!![]});_0x18223f[_0xecee('0x63')]=_0x2c652e['body'][_0xecee('0x63')]?_0x2c652e['body']['dialCheckDuplicateType']:_0x18223f[_0xecee('0x63')];switch(_0x18223f[_0xecee('0x63')]){case _0xecee('0x64'):_0xa98958=squel['insert']()[_0xecee('0x65')]('cm_hopper')[_0xecee('0x66')]([_0xecee('0x67'),'scheduledAt',_0xecee('0x68'),_0xecee('0x69'),_0xecee('0x56'),_0xecee('0x6a'),_0xecee('0x52')],squel['select']()[_0xecee('0x3d')](_0xecee('0x67'),_0xecee('0x67'))[_0xecee('0x3d')](_0xecee('0x6b'),_0xecee('0x6c'))['field']('id',_0xecee('0x68'))[_0xecee('0x3d')](_0x29e5c2[_0xecee('0x6d')][_0xecee('0x6e')](),_0xecee('0x69'))[_0xecee('0x3d')](_0x2c652e[_0xecee('0x45')]['id']['toString'](),_0xecee('0x56'))[_0xecee('0x3d')](_0xecee('0x6b'),_0xecee('0x6a'))[_0xecee('0x3d')](_0xecee('0x6b'),_0xecee('0x52'))[_0xecee('0x6f')](_0xecee('0x70'))['where'](_0xecee('0x71'))['where']('ListId\x20=\x20?',_0x29e5c2[_0xecee('0x6d')][_0xecee('0x6e')]())[_0xecee('0x38')](_0xecee('0x72'))[_0xecee('0x38')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xecee('0x3d')](_0xecee('0x73'))['from'](_0xecee('0x74'))[_0xecee('0x38')](_0xecee('0x75'),_0x2c652e[_0xecee('0x45')]['id'][_0xecee('0x6e')]()))[_0xecee('0x38')](_0xecee('0x76'),squel[_0xecee('0x77')]()[_0xecee('0x3d')](_0xecee('0x78'))[_0xecee('0x6f')]('cm_hopper')[_0xecee('0x38')](_0xecee('0x75'),_0x2c652e['params']['id']['toString']())))[_0xecee('0x6e')]();break;case _0xecee('0x79'):_0xa98958=squel[_0xecee('0x7a')]()['into']('cm_hopper')[_0xecee('0x66')](['phone',_0xecee('0x6c'),_0xecee('0x68'),'ListId',_0xecee('0x56'),_0xecee('0x6a'),_0xecee('0x52')],squel[_0xecee('0x77')]()[_0xecee('0x3d')](_0xecee('0x67'),_0xecee('0x67'))[_0xecee('0x3d')](_0xecee('0x6b'),_0xecee('0x6c'))[_0xecee('0x3d')]('id','ContactId')[_0xecee('0x3d')](_0x29e5c2['CmListId'][_0xecee('0x6e')](),_0xecee('0x69'))[_0xecee('0x3d')](_0x2c652e[_0xecee('0x45')]['id'][_0xecee('0x6e')](),'CampaignId')[_0xecee('0x3d')]('NOW()',_0xecee('0x6a'))['field']('NOW()',_0xecee('0x52'))[_0xecee('0x6f')](_0xecee('0x70'))[_0xecee('0x38')]('deletedAt\x20IS\x20NULL')[_0xecee('0x38')](_0xecee('0x7b'),_0x29e5c2[_0xecee('0x6d')][_0xecee('0x6e')]())[_0xecee('0x38')](_0xecee('0x72'))['where'](_0xecee('0x76'),squel[_0xecee('0x77')]()['field']('COALESCE(phone,\x27\x27)')[_0xecee('0x6f')](_0xecee('0x7c'))[_0xecee('0x38')](_0xecee('0x75'),_0x2c652e[_0xecee('0x45')]['id'][_0xecee('0x6e')]())))[_0xecee('0x6e')]();break;default:_0xa98958=squel[_0xecee('0x7a')]()[_0xecee('0x65')]('cm_hopper')['fromQuery']([_0xecee('0x67'),'scheduledAt',_0xecee('0x68'),'ListId',_0xecee('0x56'),_0xecee('0x6a'),_0xecee('0x52')],squel[_0xecee('0x77')]()[_0xecee('0x3d')](_0xecee('0x67'),_0xecee('0x67'))[_0xecee('0x3d')](_0xecee('0x6b'),_0xecee('0x6c'))[_0xecee('0x3d')]('id',_0xecee('0x68'))['field'](_0x29e5c2[_0xecee('0x6d')]['toString'](),'ListId')['field'](_0x2c652e[_0xecee('0x45')]['id']['toString'](),_0xecee('0x56'))[_0xecee('0x3d')]('NOW()',_0xecee('0x6a'))['field'](_0xecee('0x6b'),'updatedAt')['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xecee('0x38')](_0xecee('0x7b'),_0x29e5c2[_0xecee('0x6d')][_0xecee('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xecee('0x6e')]();}_0x2b39e6[_0xecee('0x7d')](db[_0xecee('0x7e')][_0xecee('0x2d')](_0xa98958));}return BPromise[_0xecee('0x7f')](_0x2b39e6);}})['then'](function(){return _0x45ff12;})[_0xecee('0x22')](respondWithResult(_0x1ca37e,null))[_0xecee('0x43')](handleError(_0x1ca37e,null));};exports[_0xecee('0x80')]=function(_0x32e0cb,_0x4a6b45,_0xcc24a9){return db[_0xecee('0x29')][_0xecee('0x46')]({'where':{'id':_0x32e0cb[_0xecee('0x45')]['id']}})[_0xecee('0x22')](handleEntityNotFound(_0x4a6b45,null))[_0xecee('0x22')](function(_0x2709dd){if(_0x2709dd){return _0x2709dd[_0xecee('0x80')](_0x32e0cb[_0xecee('0x2d')][_0xecee('0x61')]);}})[_0xecee('0x22')](function(_0x160059){if(_0x160059){return db[_0xecee('0x81')]['destroy']({'where':{'ListId':_0x32e0cb[_0xecee('0x2d')][_0xecee('0x61')],'CampaignId':_0x32e0cb[_0xecee('0x45')]['id']}})['then'](function(){return _0x160059;});}})['then'](respondWithStatusCode(_0x4a6b45,null))[_0xecee('0x43')](handleError(_0x4a6b45,null));};exports[_0xecee('0x82')]=function(_0x5b5fd1,_0x2b7079,_0x15e0f0){var _0x385fce={'raw':!![],'where':{}};var _0x41cbf3={};var _0x1fec8a={'count':0x0,'rows':[]};return db['Campaign'][_0xecee('0x55')]({'where':{'id':_0x5b5fd1['params']['id']}})[_0xecee('0x22')](handleEntityNotFound(_0x2b7079,null))[_0xecee('0x22')](function(_0x612cd4){if(_0x612cd4){_0x41cbf3[_0xecee('0x2b')]=_[_0xecee('0x2c')](db['CmList'][_0xecee('0x2a')]);_0x41cbf3['query']=_[_0xecee('0x2c')](_0x5b5fd1[_0xecee('0x2d')]);_0x41cbf3[_0xecee('0x2e')]=_['intersection'](_0x41cbf3[_0xecee('0x2b')],_0x41cbf3[_0xecee('0x2d')]);_0x385fce[_0xecee('0x31')]=_['intersection'](_0x41cbf3[_0xecee('0x2b')],qs[_0xecee('0x30')](_0x5b5fd1[_0xecee('0x2d')]['fields']));_0x385fce[_0xecee('0x31')]=_0x385fce[_0xecee('0x31')][_0xecee('0x32')]?_0x385fce[_0xecee('0x31')]:_0x41cbf3[_0xecee('0x2b')];if(!_0x5b5fd1[_0xecee('0x2d')]['hasOwnProperty'](_0xecee('0x34'))){_0x385fce[_0xecee('0x35')]=qs['limit'](_0x5b5fd1['query'][_0xecee('0x35')]);_0x385fce[_0xecee('0x1c')]=qs[_0xecee('0x1c')](_0x5b5fd1['query'][_0xecee('0x1c')]);}_0x385fce[_0xecee('0x36')]=qs[_0xecee('0x37')](_0x5b5fd1[_0xecee('0x2d')]['sort']);_0x385fce[_0xecee('0x38')]=qs[_0xecee('0x2e')](_[_0xecee('0x39')](_0x5b5fd1[_0xecee('0x2d')],_0x41cbf3['filters']));_0x385fce['where']['CampaignId']=_0x612cd4['id'];if(_0x5b5fd1[_0xecee('0x2d')][_0xecee('0x57')]){_0x385fce[_0xecee('0x38')]=_[_0xecee('0x3e')](_0x385fce[_0xecee('0x38')],{'$or':_[_0xecee('0x3a')](_0x385fce[_0xecee('0x31')],function(_0x5bf3da){var _0x2cdb6a={};_0x2cdb6a[_0x5bf3da]={'$like':'%'+_0x5b5fd1[_0xecee('0x2d')]['filter']+'%'};return _0x2cdb6a;})});}_0x385fce=_['merge']({},_0x385fce,_0x5b5fd1['options']);return db[_0xecee('0x5f')]['count']({'where':_0x385fce['where']})[_0xecee('0x22')](function(_0x8720fb){_0x1fec8a['count']=_0x8720fb;if(_0x5b5fd1['query']['includeAll']){_0x385fce[_0xecee('0x41')]=[{'all':!![]}];}return db[_0xecee('0x5f')][_0xecee('0x42')](_0x385fce);})['then'](function(_0x53511f){_0x1fec8a['rows']=_0x53511f;return _0x1fec8a;});}})[_0xecee('0x22')](respondWithFilteredResult(_0x2b7079,_0x385fce))[_0xecee('0x43')](handleError(_0x2b7079,null));};exports[_0xecee('0x83')]=function(_0x4e9b59,_0x2ee995,_0x62e7b){var _0x1eff1f,_0x1d2768;return db[_0xecee('0x29')]['find']({'where':{'id':_0x4e9b59[_0xecee('0x45')]['id']}})[_0xecee('0x22')](handleEntityNotFound(_0x2ee995,null))[_0xecee('0x22')](function(_0x50ee89){if(_0x50ee89){_0x1d2768=_0x50ee89;return _0x50ee89[_0xecee('0x83')](_0x4e9b59['body'][_0xecee('0x61')],_['omit'](_0x4e9b59['body'],[_0xecee('0x61'),'id'])||{});}return null;})['spread'](function(_0x329d86){var _0x2b9218;_0x1eff1f=_0x329d86||[];var _0x55c52c=[];if(_0x329d86){for(var _0x1361cf=0x0;_0x1361cf<_0x329d86['length'];_0x1361cf+=0x1){var _0x2e0f9e=_0x329d86[_0x1361cf][_0xecee('0x4a')]({'plain':!![]});_0x2b9218=squel[_0xecee('0x7a')]()[_0xecee('0x65')]('cm_hopper_black')[_0xecee('0x66')](['phone','ContactId',_0xecee('0x69'),_0xecee('0x56'),_0xecee('0x6a'),_0xecee('0x52')],squel[_0xecee('0x77')]()[_0xecee('0x3d')](_0xecee('0x67'),'phone')['field']('id',_0xecee('0x68'))['field'](_0x2e0f9e[_0xecee('0x6d')][_0xecee('0x6e')](),_0xecee('0x69'))[_0xecee('0x3d')](_0x4e9b59[_0xecee('0x45')]['id'][_0xecee('0x6e')](),_0xecee('0x56'))[_0xecee('0x3d')]('NOW()','createdAt')['field'](_0xecee('0x6b'),'updatedAt')['from']('cm_contacts')[_0xecee('0x38')](_0xecee('0x71'))['where'](_0xecee('0x7b'),_0x2e0f9e[_0xecee('0x6d')]['toString']())[_0xecee('0x38')](_0xecee('0x72')))['toString']();_0x55c52c['push'](db[_0xecee('0x7e')]['query'](_0x2b9218));}return BPromise['all'](_0x55c52c);}})[_0xecee('0x22')](function(){return _0x1eff1f;})[_0xecee('0x22')](respondWithResult(_0x2ee995,null))[_0xecee('0x43')](handleError(_0x2ee995,null));};exports[_0xecee('0x84')]=function(_0x4a60c6,_0x47e24b,_0x372e6b){return db[_0xecee('0x29')][_0xecee('0x46')]({'where':{'id':_0x4a60c6[_0xecee('0x45')]['id']}})[_0xecee('0x22')](handleEntityNotFound(_0x47e24b,null))[_0xecee('0x22')](function(_0x1a327a){if(_0x1a327a){return _0x1a327a[_0xecee('0x84')](_0x4a60c6[_0xecee('0x2d')][_0xecee('0x61')]);}})[_0xecee('0x22')](function(_0x3851aa){if(_0x3851aa){return db['CmHopperBlack'][_0xecee('0x24')]({'where':{'ListId':_0x4a60c6[_0xecee('0x2d')][_0xecee('0x61')],'CampaignId':_0x4a60c6[_0xecee('0x45')]['id']}})[_0xecee('0x22')](function(){return _0x3851aa;});}})[_0xecee('0x22')](respondWithStatusCode(_0x47e24b,null))[_0xecee('0x43')](handleError(_0x47e24b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 935358b..ebe3400 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 _0x8890=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','Campaign','campaigns'];(function(_0x544c46,_0x4e65f5){var _0x305d56=function(_0x3f0542){while(--_0x3f0542){_0x544c46['push'](_0x544c46['shift']());}};_0x305d56(++_0x4e65f5);}(_0x8890,0x181));var _0x0889=function(_0x1c0ca7,_0x3b5cc9){_0x1c0ca7=_0x1c0ca7-0x0;var _0x3d93ca=_0x8890[_0x1c0ca7];return _0x3d93ca;};'use strict';var _=require(_0x0889('0x0'));var util=require(_0x0889('0x1'));var logger=require(_0x0889('0x2'))(_0x0889('0x3'));var moment=require(_0x0889('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0889('0x5'));var rimraf=require(_0x0889('0x6'));var config=require(_0x0889('0x7'));var attributes=require('./campaign.attributes');module[_0x0889('0x8')]=function(_0x56cc6b,_0x50f5bf){return _0x56cc6b['define'](_0x0889('0x9'),attributes,{'tableName':_0x0889('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x966f=['api','request-promise','path','../../config/environment','exports','define','Campaign','campaigns','../../config/logger'];(function(_0x4d427a,_0x24c23f){var _0x380dec=function(_0x6477be){while(--_0x6477be){_0x4d427a['push'](_0x4d427a['shift']());}};_0x380dec(++_0x24c23f);}(_0x966f,0x13a));var _0xf966=function(_0x596350,_0x85c6bd){_0x596350=_0x596350-0x0;var _0x1f3460=_0x966f[_0x596350];return _0x1f3460;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf966('0x0'))(_0xf966('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf966('0x2'));var fs=require('fs');var path=require(_0xf966('0x3'));var rimraf=require('rimraf');var config=require(_0xf966('0x4'));var attributes=require('./campaign.attributes');module[_0xf966('0x5')]=function(_0x2b084e,_0x330a14){return _0x2b084e[_0xf966('0x6')](_0xf966('0x7'),attributes,{'tableName':_0xf966('0x8'),'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 8a93e1c..c1b142e 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 _0x69bc=['catch','Campaign','findAll','options','attributes','limit','include','map','model','then','GetCampaign','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','Campaign,\x20%s,\x20%s','message'];(function(_0x51e136,_0x4eecfd){var _0x52b4f3=function(_0x2d0029){while(--_0x2d0029){_0x51e136['push'](_0x51e136['shift']());}};_0x52b4f3(++_0x4eecfd);}(_0x69bc,0x142));var _0xc69b=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x69bc[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xc69b('0x0'));var util=require(_0xc69b('0x1'));var moment=require('moment');var BPromise=require(_0xc69b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc69b('0x3'));var db=require(_0xc69b('0x4'))['db'];var utils=require(_0xc69b('0x5'));var logger=require(_0xc69b('0x6'))('rpc');var config=require(_0xc69b('0x7'));var jayson=require(_0xc69b('0x8'));var client=jayson[_0xc69b('0x9')][_0xc69b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x428274,_0xebcf0e,_0x5dd2dd){return new BPromise(function(_0x23ed99,_0x349bdf){return client[_0xc69b('0xb')](_0x428274,_0x5dd2dd)['then'](function(_0x380ac8){logger[_0xc69b('0xc')]('Campaign,\x20%s,\x20%s',_0xebcf0e,'request\x20sent');logger[_0xc69b('0xd')](_0xc69b('0xe'),_0xebcf0e,_0xc69b('0xf'),JSON['stringify'](_0x380ac8));if(_0x380ac8[_0xc69b('0x10')]){if(_0x380ac8[_0xc69b('0x10')]['code']===0x1f4){logger[_0xc69b('0x10')](_0xc69b('0x11'),_0xebcf0e,_0x380ac8[_0xc69b('0x10')][_0xc69b('0x12')]);return _0x349bdf(_0x380ac8['error'][_0xc69b('0x12')]);}logger[_0xc69b('0x10')](_0xc69b('0x11'),_0xebcf0e,_0x380ac8[_0xc69b('0x10')][_0xc69b('0x12')]);return _0x23ed99(_0x380ac8['error'][_0xc69b('0x12')]);}else{logger[_0xc69b('0xc')](_0xc69b('0x11'),_0xebcf0e,_0xc69b('0xf'));_0x23ed99(_0x380ac8['result'][_0xc69b('0x12')]);}})[_0xc69b('0x13')](function(_0x791091){logger[_0xc69b('0x10')](_0xc69b('0x11'),_0xebcf0e,_0x791091);_0x349bdf(_0x791091);});});}exports['GetCampaign']=function(_0x3021c9){var _0x4602f7=this;return new Promise(function(_0x2b73b5,_0x4f41c9){return db[_0xc69b('0x14')][_0xc69b('0x15')]({'raw':_0x3021c9[_0xc69b('0x16')]?_0x3021c9[_0xc69b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3021c9[_0xc69b('0x16')]?_0x3021c9[_0xc69b('0x16')]['where']||null:null,'attributes':_0x3021c9[_0xc69b('0x16')]?_0x3021c9[_0xc69b('0x16')][_0xc69b('0x17')]||null:null,'limit':_0x3021c9[_0xc69b('0x16')]?_0x3021c9[_0xc69b('0x16')][_0xc69b('0x18')]||null:null,'include':_0x3021c9[_0xc69b('0x16')]?_0x3021c9[_0xc69b('0x16')][_0xc69b('0x19')]?_[_0xc69b('0x1a')](_0x3021c9['options']['include'],function(_0x4f3eac){return{'model':db[_0x4f3eac[_0xc69b('0x1b')]],'as':_0x4f3eac['as'],'attributes':_0x4f3eac[_0xc69b('0x17')],'include':_0x4f3eac[_0xc69b('0x19')]?_[_0xc69b('0x1a')](_0x4f3eac[_0xc69b('0x19')],function(_0x5e390d){return{'model':db[_0x5e390d['model']],'as':_0x5e390d['as'],'attributes':_0x5e390d[_0xc69b('0x17')],'include':_0x5e390d[_0xc69b('0x19')]?_[_0xc69b('0x1a')](_0x5e390d[_0xc69b('0x19')],function(_0xdd597){return{'model':db[_0xdd597[_0xc69b('0x1b')]],'as':_0xdd597['as'],'attributes':_0xdd597[_0xc69b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc69b('0x1c')](function(_0x50faf2){logger[_0xc69b('0xc')](_0xc69b('0x1d'),_0x3021c9);logger[_0xc69b('0xd')](_0xc69b('0x1d'),_0x3021c9,JSON[_0xc69b('0x1e')](_0x50faf2));_0x2b73b5(_0x50faf2);})[_0xc69b('0x13')](function(_0x109838){logger[_0xc69b('0x10')](_0xc69b('0x1d'),_0x109838[_0xc69b('0x12')],_0x3021c9);_0x4f41c9(_0x4602f7['error'](0x1f4,_0x109838[_0xc69b('0x12')]));});});}; \ No newline at end of file +var _0x8427=['request','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCampaign','options','raw','where','attributes','limit','map','include','model','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x13a277,_0x4dba00){var _0x1b6b31=function(_0xc9f9c8){while(--_0xc9f9c8){_0x13a277['push'](_0x13a277['shift']());}};_0x1b6b31(++_0x4dba00);}(_0x8427,0x95));var _0x7842=function(_0x5bee13,_0x246e9e){_0x5bee13=_0x5bee13-0x0;var _0x4c8683=_0x8427[_0x5bee13];return _0x4c8683;};'use strict';var _=require(_0x7842('0x0'));var util=require(_0x7842('0x1'));var moment=require(_0x7842('0x2'));var BPromise=require(_0x7842('0x3'));var rs=require(_0x7842('0x4'));var fs=require('fs');var Redis=require(_0x7842('0x5'));var db=require(_0x7842('0x6'))['db'];var utils=require(_0x7842('0x7'));var logger=require(_0x7842('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7842('0x9'));var client=jayson[_0x7842('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x244ea0,_0x7a3ed6,_0x2ffd37){return new BPromise(function(_0x2befae,_0x8abef2){return client[_0x7842('0xb')](_0x244ea0,_0x2ffd37)['then'](function(_0x2b487e){logger[_0x7842('0xc')](_0x7842('0xd'),_0x7a3ed6,_0x7842('0xe'));logger['debug'](_0x7842('0xf'),_0x7a3ed6,'request\x20sent',JSON[_0x7842('0x10')](_0x2b487e));if(_0x2b487e['error']){if(_0x2b487e[_0x7842('0x11')]['code']===0x1f4){logger['error'](_0x7842('0xd'),_0x7a3ed6,_0x2b487e[_0x7842('0x11')][_0x7842('0x12')]);return _0x8abef2(_0x2b487e[_0x7842('0x11')]['message']);}logger[_0x7842('0x11')]('Campaign,\x20%s,\x20%s',_0x7a3ed6,_0x2b487e[_0x7842('0x11')][_0x7842('0x12')]);return _0x2befae(_0x2b487e['error'][_0x7842('0x12')]);}else{logger[_0x7842('0xc')](_0x7842('0xd'),_0x7a3ed6,_0x7842('0xe'));_0x2befae(_0x2b487e[_0x7842('0x13')][_0x7842('0x12')]);}})['catch'](function(_0x41d874){logger[_0x7842('0x11')]('Campaign,\x20%s,\x20%s',_0x7a3ed6,_0x41d874);_0x8abef2(_0x41d874);});});}exports[_0x7842('0x14')]=function(_0x5d8148){var _0x3c9773=this;return new Promise(function(_0x4e4381,_0x59060b){return db['Campaign']['findAll']({'raw':_0x5d8148[_0x7842('0x15')]?_0x5d8148[_0x7842('0x15')][_0x7842('0x16')]===undefined?!![]:![]:!![],'where':_0x5d8148[_0x7842('0x15')]?_0x5d8148[_0x7842('0x15')][_0x7842('0x17')]||null:null,'attributes':_0x5d8148[_0x7842('0x15')]?_0x5d8148['options'][_0x7842('0x18')]||null:null,'limit':_0x5d8148[_0x7842('0x15')]?_0x5d8148[_0x7842('0x15')][_0x7842('0x19')]||null:null,'include':_0x5d8148[_0x7842('0x15')]?_0x5d8148[_0x7842('0x15')]['include']?_[_0x7842('0x1a')](_0x5d8148[_0x7842('0x15')][_0x7842('0x1b')],function(_0x1c6349){return{'model':db[_0x1c6349[_0x7842('0x1c')]],'as':_0x1c6349['as'],'attributes':_0x1c6349['attributes'],'include':_0x1c6349['include']?_['map'](_0x1c6349[_0x7842('0x1b')],function(_0x41b9c4){return{'model':db[_0x41b9c4['model']],'as':_0x41b9c4['as'],'attributes':_0x41b9c4[_0x7842('0x18')],'include':_0x41b9c4['include']?_[_0x7842('0x1a')](_0x41b9c4['include'],function(_0x2e0aea){return{'model':db[_0x2e0aea['model']],'as':_0x2e0aea['as'],'attributes':_0x2e0aea[_0x7842('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7842('0x1d')](function(_0x410242){logger['info'](_0x7842('0x14'),_0x5d8148);logger[_0x7842('0x1e')](_0x7842('0x14'),_0x5d8148,JSON[_0x7842('0x10')](_0x410242));_0x4e4381(_0x410242);})[_0x7842('0x1f')](function(_0x2f22c1){logger[_0x7842('0x11')]('GetCampaign',_0x2f22c1[_0x7842('0x12')],_0x5d8148);_0x59060b(_0x3c9773['error'](0x1f4,_0x2f22c1[_0x7842('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index bea7392..2eb1a76 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 _0x8868=['/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','/:id','destroy','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0xd003b9,_0x5ad409){var _0x4e5e84=function(_0x5da89b){while(--_0x5da89b){_0xd003b9['push'](_0xd003b9['shift']());}};_0x4e5e84(++_0x5ad409);}(_0x8868,0x1ed));var _0x8886=function(_0x221da7,_0x15bda0){_0x221da7=_0x221da7-0x0;var _0x238231=_0x8868[_0x221da7];return _0x238231;};'use strict';var multer=require(_0x8886('0x0'));var util=require('util');var path=require(_0x8886('0x1'));var timeout=require(_0x8886('0x2'));var express=require(_0x8886('0x3'));var router=express[_0x8886('0x4')]();var auth=require(_0x8886('0x5'));var interaction=require(_0x8886('0x6'));var config=require(_0x8886('0x7'));var controller=require(_0x8886('0x8'));router[_0x8886('0x9')]('/',auth[_0x8886('0xa')](),controller[_0x8886('0xb')]);router[_0x8886('0x9')]('/:id',auth[_0x8886('0xa')](),controller[_0x8886('0xc')]);router[_0x8886('0x9')]('/:id/hoppers',auth[_0x8886('0xa')](),controller[_0x8886('0xd')]);router[_0x8886('0x9')](_0x8886('0xe'),auth['isAuthenticated'](),controller[_0x8886('0xf')]);router[_0x8886('0x9')](_0x8886('0x10'),auth[_0x8886('0xa')](),controller[_0x8886('0x11')]);router[_0x8886('0x9')](_0x8886('0x12'),auth['isAuthenticated'](),controller[_0x8886('0x13')]);router[_0x8886('0x9')]('/:id/lists',auth[_0x8886('0xa')](),controller[_0x8886('0x14')]);router[_0x8886('0x9')](_0x8886('0x15'),auth[_0x8886('0xa')](),controller[_0x8886('0x16')]);router[_0x8886('0x17')]('/',auth[_0x8886('0xa')](),controller[_0x8886('0x18')]);router[_0x8886('0x17')](_0x8886('0x19'),auth[_0x8886('0xa')](),controller[_0x8886('0x1a')]);router['post'](_0x8886('0x1b'),auth[_0x8886('0xa')](),controller[_0x8886('0x1c')]);router['post'](_0x8886('0x15'),auth[_0x8886('0xa')](),controller[_0x8886('0x1d')]);router[_0x8886('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x8886('0x1f')]);router[_0x8886('0x20')](_0x8886('0x21'),auth[_0x8886('0xa')](),controller[_0x8886('0x22')]);router[_0x8886('0x20')](_0x8886('0x1b'),auth[_0x8886('0xa')](),controller['removeLists']);router[_0x8886('0x20')](_0x8886('0x15'),auth[_0x8886('0xa')](),controller[_0x8886('0x23')]);module[_0x8886('0x24')]=router; \ No newline at end of file +var _0x8952=['getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','/:id/clone','addLists','addBlackLists','/:id','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show'];(function(_0x8e335d,_0x2973b4){var _0x342ae8=function(_0x278155){while(--_0x278155){_0x8e335d['push'](_0x8e335d['shift']());}};_0x342ae8(++_0x2973b4);}(_0x8952,0xf9));var _0x2895=function(_0x42d4df,_0x1f04b9){_0x42d4df=_0x42d4df-0x0;var _0x7cfda0=_0x8952[_0x42d4df];return _0x7cfda0;};'use strict';var multer=require(_0x2895('0x0'));var util=require(_0x2895('0x1'));var path=require(_0x2895('0x2'));var timeout=require('connect-timeout');var express=require(_0x2895('0x3'));var router=express[_0x2895('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2895('0x5'));var config=require(_0x2895('0x6'));var controller=require(_0x2895('0x7'));router['get']('/',auth[_0x2895('0x8')](),controller[_0x2895('0x9')]);router[_0x2895('0xa')]('/:id',auth[_0x2895('0x8')](),controller[_0x2895('0xb')]);router['get']('/:id/hoppers',auth[_0x2895('0x8')](),controller[_0x2895('0xc')]);router[_0x2895('0xa')](_0x2895('0xd'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x2895('0xa')](_0x2895('0xe'),auth[_0x2895('0x8')](),controller['getHopperFinals']);router['get'](_0x2895('0xf'),auth[_0x2895('0x8')](),controller[_0x2895('0x10')]);router[_0x2895('0xa')](_0x2895('0x11'),auth[_0x2895('0x8')](),controller['getLists']);router[_0x2895('0xa')](_0x2895('0x12'),auth[_0x2895('0x8')](),controller['getBlackLists']);router[_0x2895('0x13')]('/',auth[_0x2895('0x8')](),controller['create']);router[_0x2895('0x13')](_0x2895('0x14'),auth[_0x2895('0x8')](),controller['clone']);router[_0x2895('0x13')](_0x2895('0x11'),auth[_0x2895('0x8')](),controller[_0x2895('0x15')]);router[_0x2895('0x13')]('/:id/blacklists',auth[_0x2895('0x8')](),controller[_0x2895('0x16')]);router['put'](_0x2895('0x17'),auth[_0x2895('0x8')](),controller['update']);router[_0x2895('0x18')](_0x2895('0x17'),auth[_0x2895('0x8')](),controller[_0x2895('0x19')]);router[_0x2895('0x18')](_0x2895('0x11'),auth[_0x2895('0x8')](),controller[_0x2895('0x1a')]);router[_0x2895('0x18')](_0x2895('0x12'),auth[_0x2895('0x8')](),controller[_0x2895('0x1b')]);module[_0x2895('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 3a9b2ad..0111e62 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 _0x063a=['sequelize','TEXT','VIRTUAL','getDataValue','key'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x063a,0x1e0));var _0xa063=function(_0x5425ae,_0xc6ef68){_0x5425ae=_0x5425ae-0x0;var _0x1ca806=_0x063a[_0x5425ae];return _0x1ca806;};'use strict';var Sequelize=require(_0xa063('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xa063('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa063('0x2')],'get':function(){return this[_0xa063('0x3')](_0xa063('0x4'));}}}; \ No newline at end of file +var _0x8b51=['exports','STRING','TEXT','VIRTUAL','getDataValue','sequelize'];(function(_0x371a7a,_0x26c864){var _0x5f2ba9=function(_0x3d9976){while(--_0x3d9976){_0x371a7a['push'](_0x371a7a['shift']());}};_0x5f2ba9(++_0x26c864);}(_0x8b51,0xef));var _0x18b5=function(_0x21ba11,_0xf04db3){_0x21ba11=_0x21ba11-0x0;var _0x198367=_0x8b51[_0x21ba11];return _0x198367;};'use strict';var Sequelize=require(_0x18b5('0x0'));module[_0x18b5('0x1')]={'key':{'type':Sequelize[_0x18b5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x18b5('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x18b5('0x2')]},'name':{'type':Sequelize[_0x18b5('0x4')],'get':function(){return this[_0x18b5('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 7550797..fa934e8 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 _0x3e71=['ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','params','body','find','create','MailAccountId','SmsAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x59cec1,_0x385c63){var _0x362231=function(_0x5b7d84){while(--_0x5b7d84){_0x59cec1['push'](_0x59cec1['shift']());}};_0x362231(++_0x385c63);}(_0x3e71,0x95));var _0x13e7=function(_0x503467,_0x164683){_0x503467=_0x503467-0x0;var _0x18f76c=_0x3e71[_0x503467];return _0x18f76c;};'use strict';var pdf=require(_0x13e7('0x0'));var emlformat=require(_0x13e7('0x1'));var rimraf=require(_0x13e7('0x2'));var zipdir=require(_0x13e7('0x3'));var jsonpatch=require(_0x13e7('0x4'));var rp=require(_0x13e7('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13e7('0x6'));var path=require(_0x13e7('0x7'));var sox=require('sox');var csv=require(_0x13e7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x13e7('0x9'));var squel=require(_0x13e7('0xa'));var crypto=require('crypto');var jsforce=require(_0x13e7('0xb'));var deskjs=require(_0x13e7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x13e7('0xd'));var Papa=require(_0x13e7('0xe'));var Redis=require(_0x13e7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x13e7('0x10'))(_0x13e7('0x11'));var utils=require(_0x13e7('0x12'));var config=require('../../config/environment');var db=require(_0x13e7('0x13'))['db'];function respondWithStatusCode(_0xbd9db8,_0x18cb2e){_0x18cb2e=_0x18cb2e||0xcc;return function(_0x42c2e1){if(_0x42c2e1){return _0xbd9db8[_0x13e7('0x14')](_0x18cb2e);}return _0xbd9db8['status'](_0x18cb2e)['end']();};}function respondWithResult(_0x46095d,_0x1e99ca){_0x1e99ca=_0x1e99ca||0xc8;return function(_0x1051d7){if(_0x1051d7){return _0x46095d['status'](_0x1e99ca)[_0x13e7('0x15')](_0x1051d7);}};}function respondWithFilteredResult(_0x3c3606,_0x252c27){return function(_0x3e5f8b){if(_0x3e5f8b){var _0x1b0930=_0x3e5f8b[_0x13e7('0x16')],_0x5e8306=_0x252c27['offset'],_0x47a062=_0x252c27[_0x13e7('0x17')]+_0x252c27[_0x13e7('0x18')],_0x2055b7;if(_0x47a062>=_0x1b0930){_0x47a062=_0x1b0930;_0x2055b7=0xc8;}else{_0x2055b7=0xce;}_0x3c3606[_0x13e7('0x19')](_0x2055b7);return _0x3c3606[_0x13e7('0x1a')](_0x13e7('0x1b'),_0x5e8306+'-'+_0x47a062+'/'+_0x1b0930)[_0x13e7('0x15')](_0x3e5f8b);}return null;};}function patchUpdates(_0x3f05aa){return function(_0x3036b8){try{jsonpatch[_0x13e7('0x1c')](_0x3036b8,_0x3f05aa,!![]);}catch(_0x504b22){return BPromise[_0x13e7('0x1d')](_0x504b22);}return _0x3036b8[_0x13e7('0x1e')]();};}function saveUpdates(_0x9d3ca6,_0x474da9){return function(_0x2adb9d){if(_0x2adb9d){return _0x2adb9d[_0x13e7('0x1f')](_0x9d3ca6)[_0x13e7('0x20')](function(_0x4493a7){return _0x4493a7;});}return null;};}function removeEntity(_0x59d6e1,_0x1203ba){return function(_0x407651){if(_0x407651){return _0x407651['destroy']()[_0x13e7('0x20')](function(){var _0x1fa14e=_0x407651['get']({'plain':!![]});var _0x41159d='CannedAnswers';return db[_0x13e7('0x21')][_0x13e7('0x22')]({'where':{'type':_0x41159d,'resourceId':_0x1fa14e['id']}})['then'](function(){return _0x407651;});})[_0x13e7('0x20')](function(){_0x59d6e1[_0x13e7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4bb9,_0x1bc662){return function(_0x2630d5){if(!_0x2630d5){_0x4a4bb9[_0x13e7('0x14')](0x194);}return _0x2630d5;};}function handleError(_0x180cec,_0xd32c18){_0xd32c18=_0xd32c18||0x1f4;return function(_0x135064){logger[_0x13e7('0x23')](_0x135064[_0x13e7('0x24')]);if(_0x135064[_0x13e7('0x25')]){delete _0x135064['name'];}_0x180cec[_0x13e7('0x19')](_0xd32c18)[_0x13e7('0x26')](_0x135064);};}exports['index']=function(_0x4767ee,_0x3b240a){var _0x6f8058={},_0x321e1a={},_0xdf20c8={'count':0x0,'rows':[]};var _0x580943=db['CannedAnswer'][_0x13e7('0x27')];_0x321e1a[_0x13e7('0x28')]=_[_0x13e7('0x29')](_0x580943);_0x321e1a[_0x13e7('0x2a')]=_[_0x13e7('0x29')](_0x4767ee['query']);_0x321e1a['filters']=_[_0x13e7('0x2b')](_0x321e1a[_0x13e7('0x28')],_0x321e1a['query']);_0x6f8058[_0x13e7('0x2c')]=_[_0x13e7('0x2b')](_0x321e1a[_0x13e7('0x28')],qs[_0x13e7('0x2d')](_0x4767ee['query'][_0x13e7('0x2d')]));_0x6f8058[_0x13e7('0x2c')]=_0x6f8058[_0x13e7('0x2c')]['length']?_0x6f8058[_0x13e7('0x2c')]:_0x321e1a[_0x13e7('0x28')];if(!_0x4767ee[_0x13e7('0x2a')][_0x13e7('0x2e')](_0x13e7('0x2f'))){_0x6f8058[_0x13e7('0x18')]=qs[_0x13e7('0x18')](_0x4767ee[_0x13e7('0x2a')][_0x13e7('0x18')]);_0x6f8058[_0x13e7('0x17')]=qs[_0x13e7('0x17')](_0x4767ee[_0x13e7('0x2a')][_0x13e7('0x17')]);}_0x6f8058[_0x13e7('0x30')]=qs[_0x13e7('0x31')](_0x4767ee[_0x13e7('0x2a')]['sort']);_0x6f8058[_0x13e7('0x32')]=qs[_0x13e7('0x33')](_[_0x13e7('0x34')](_0x4767ee['query'],_0x321e1a['filters']));if(_0x4767ee[_0x13e7('0x2a')][_0x13e7('0x35')]){_0x6f8058[_0x13e7('0x32')]=_['merge'](_0x6f8058[_0x13e7('0x32')],{'$or':_[_0x13e7('0x36')](_0x580943,function(_0x526e53){if(_0x526e53[_0x13e7('0x37')][_0x13e7('0x38')]!==_0x13e7('0x39')){var _0x3f41d5={};_0x3f41d5[_0x526e53[_0x13e7('0x3a')]]={'$like':'%'+_0x4767ee['query'][_0x13e7('0x35')]+'%'};return _0x3f41d5;}})});}_0x6f8058=_[_0x13e7('0x3b')]({},_0x6f8058,_0x4767ee[_0x13e7('0x3c')]);var _0x24d851={'where':_0x6f8058[_0x13e7('0x32')]};return db[_0x13e7('0x3d')][_0x13e7('0x16')](_0x24d851)[_0x13e7('0x20')](function(_0x3c709d){_0xdf20c8[_0x13e7('0x16')]=_0x3c709d;if(_0x4767ee[_0x13e7('0x2a')][_0x13e7('0x3e')]){_0x6f8058[_0x13e7('0x3f')]=[{'all':!![]}];}return db[_0x13e7('0x3d')][_0x13e7('0x40')](_0x6f8058);})[_0x13e7('0x20')](function(_0x258a04){_0xdf20c8[_0x13e7('0x41')]=_0x258a04;return _0xdf20c8;})[_0x13e7('0x20')](respondWithFilteredResult(_0x3b240a,_0x6f8058))[_0x13e7('0x42')](handleError(_0x3b240a,null));};exports['show']=function(_0x3147d8,_0x436283){var _0x584352={'raw':!![],'where':{'id':_0x3147d8[_0x13e7('0x43')]['id']}},_0x5303ed={};_0x5303ed[_0x13e7('0x28')]=_['keys'](db[_0x13e7('0x3d')]['rawAttributes']);_0x5303ed['query']=_[_0x13e7('0x29')](_0x3147d8[_0x13e7('0x2a')]);_0x5303ed[_0x13e7('0x33')]=_[_0x13e7('0x2b')](_0x5303ed[_0x13e7('0x28')],_0x5303ed['query']);_0x584352['attributes']=_[_0x13e7('0x2b')](_0x5303ed['model'],qs[_0x13e7('0x2d')](_0x3147d8[_0x13e7('0x2a')][_0x13e7('0x2d')]));_0x584352[_0x13e7('0x2c')]=_0x584352[_0x13e7('0x2c')]['length']?_0x584352[_0x13e7('0x2c')]:_0x5303ed['model'];if(_0x3147d8[_0x13e7('0x2a')][_0x13e7('0x3e')]){_0x584352[_0x13e7('0x3f')]=[{'all':!![]}];}_0x584352=_['merge']({},_0x584352,_0x3147d8['options']);return db[_0x13e7('0x3d')]['find'](_0x584352)[_0x13e7('0x20')](handleEntityNotFound(_0x436283,null))[_0x13e7('0x20')](respondWithResult(_0x436283,null))[_0x13e7('0x42')](handleError(_0x436283,null));};exports['update']=function(_0x2d6e5a,_0x181e8d){if(_0x2d6e5a[_0x13e7('0x44')]['id']){delete _0x2d6e5a['body']['id'];}return db[_0x13e7('0x3d')][_0x13e7('0x45')]({'where':{'id':_0x2d6e5a['params']['id']}})['then'](handleEntityNotFound(_0x181e8d,null))['then'](saveUpdates(_0x2d6e5a[_0x13e7('0x44')],null))['then'](respondWithResult(_0x181e8d,null))['catch'](handleError(_0x181e8d,null));};exports[_0x13e7('0x22')]=function(_0x714bef,_0x3935aa){return db[_0x13e7('0x3d')][_0x13e7('0x45')]({'where':{'id':_0x714bef['params']['id']}})[_0x13e7('0x20')](handleEntityNotFound(_0x3935aa,null))['then'](removeEntity(_0x3935aa,null))[_0x13e7('0x42')](handleError(_0x3935aa,null));};exports[_0x13e7('0x46')]=function(_0x59e84f,_0x4d0e45){var _0x5a4b09={'key':_0x59e84f['body'][_0x13e7('0x38')]};if(_0x59e84f[_0x13e7('0x44')][_0x13e7('0x47')]){_0x5a4b09[_0x13e7('0x47')]=_0x59e84f[_0x13e7('0x44')]['MailAccountId'];}else if(_0x59e84f['body'][_0x13e7('0x48')]){_0x5a4b09[_0x13e7('0x48')]=_0x59e84f[_0x13e7('0x44')][_0x13e7('0x48')];}else if(_0x59e84f[_0x13e7('0x44')]['OpenchannelAccountId']){_0x5a4b09['OpenchannelAccountId']=_0x59e84f[_0x13e7('0x44')]['OpenchannelAccountId'];}else if(_0x59e84f[_0x13e7('0x44')][_0x13e7('0x49')]){_0x5a4b09[_0x13e7('0x49')]=_0x59e84f[_0x13e7('0x44')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x13e7('0x45')]({'where':_0x5a4b09})[_0x13e7('0x20')](function(_0x2c9e73){if(_0x2c9e73){throw new db['Sequelize'][(_0x13e7('0x4a'))](_0x13e7('0x4b'));}return db['CannedAnswer'][_0x13e7('0x46')](_0x59e84f[_0x13e7('0x44')]);})['then'](function(_0x21cc4c){var _0x163c94=_0x59e84f[_0x13e7('0x4c')][_0x13e7('0x4d')]({'plain':!![]});if(!_0x163c94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x163c94['role']===_0x13e7('0x4c')){var _0x29da32=_0x21cc4c[_0x13e7('0x4d')]({'plain':!![]});return db[_0x13e7('0x4e')][_0x13e7('0x45')]({'where':{'name':_0x13e7('0x4f'),'userProfileId':_0x163c94[_0x13e7('0x50')]},'raw':!![]})[_0x13e7('0x20')](function(_0x382cec){if(_0x382cec&&_0x382cec[_0x13e7('0x51')]===0x0){return db[_0x13e7('0x21')][_0x13e7('0x46')]({'name':_0x29da32[_0x13e7('0x25')],'resourceId':_0x29da32['id'],'type':_0x382cec[_0x13e7('0x25')],'sectionId':_0x382cec['id']},{})[_0x13e7('0x20')](function(){return _0x21cc4c;});}else{return _0x21cc4c;}})[_0x13e7('0x42')](function(_0x4603c6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4603c6);throw _0x4603c6;});}return _0x21cc4c;})['then'](respondWithResult(_0x4d0e45,0xc9))[_0x13e7('0x42')](handleError(_0x4d0e45,null));}; \ No newline at end of file +var _0xc6cb=['The\x20inserted\x20key\x20already\x20exists.','user','role','CannedAnswers','userProfileId','create','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','CannedAnswer','includeAll','include','rows','catch','show','params','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError'];(function(_0x37b624,_0x28c3aa){var _0x44abd9=function(_0x40c152){while(--_0x40c152){_0x37b624['push'](_0x37b624['shift']());}};_0x44abd9(++_0x28c3aa);}(_0xc6cb,0x1af));var _0xbc6c=function(_0x1e5ee3,_0x1837b0){_0x1e5ee3=_0x1e5ee3-0x0;var _0x499c8e=_0xc6cb[_0x1e5ee3];return _0x499c8e;};'use strict';var pdf=require(_0xbc6c('0x0'));var emlformat=require(_0xbc6c('0x1'));var rimraf=require(_0xbc6c('0x2'));var zipdir=require(_0xbc6c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbc6c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc6c('0x5'));var util=require('util');var path=require(_0xbc6c('0x6'));var sox=require(_0xbc6c('0x7'));var csv=require(_0xbc6c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbc6c('0x9'));var squel=require(_0xbc6c('0xa'));var crypto=require(_0xbc6c('0xb'));var jsforce=require(_0xbc6c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbc6c('0x8'));var querystring=require(_0xbc6c('0xd'));var Papa=require(_0xbc6c('0xe'));var Redis=require('ioredis');var authService=require(_0xbc6c('0xf'));var qs=require(_0xbc6c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc6c('0x11'))(_0xbc6c('0x12'));var utils=require('../../config/utils');var config=require(_0xbc6c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b3f0a,_0x5d4c89){_0x5d4c89=_0x5d4c89||0xcc;return function(_0x2af1f1){if(_0x2af1f1){return _0x4b3f0a['sendStatus'](_0x5d4c89);}return _0x4b3f0a[_0xbc6c('0x14')](_0x5d4c89)[_0xbc6c('0x15')]();};}function respondWithResult(_0x39fcd5,_0x2a8308){_0x2a8308=_0x2a8308||0xc8;return function(_0x248cd6){if(_0x248cd6){return _0x39fcd5[_0xbc6c('0x14')](_0x2a8308)[_0xbc6c('0x16')](_0x248cd6);}};}function respondWithFilteredResult(_0x15c8c9,_0x137f2f){return function(_0x1c5cba){if(_0x1c5cba){var _0x5b3644=_0x1c5cba[_0xbc6c('0x17')],_0x1c694d=_0x137f2f[_0xbc6c('0x18')],_0x1e4760=_0x137f2f['offset']+_0x137f2f[_0xbc6c('0x19')],_0x4c5f40;if(_0x1e4760>=_0x5b3644){_0x1e4760=_0x5b3644;_0x4c5f40=0xc8;}else{_0x4c5f40=0xce;}_0x15c8c9['status'](_0x4c5f40);return _0x15c8c9[_0xbc6c('0x1a')](_0xbc6c('0x1b'),_0x1c694d+'-'+_0x1e4760+'/'+_0x5b3644)['json'](_0x1c5cba);}return null;};}function patchUpdates(_0x2f4dec){return function(_0x113a67){try{jsonpatch[_0xbc6c('0x1c')](_0x113a67,_0x2f4dec,!![]);}catch(_0x242d77){return BPromise[_0xbc6c('0x1d')](_0x242d77);}return _0x113a67[_0xbc6c('0x1e')]();};}function saveUpdates(_0x2544d3,_0x83f06){return function(_0x2aa367){if(_0x2aa367){return _0x2aa367[_0xbc6c('0x1f')](_0x2544d3)[_0xbc6c('0x20')](function(_0x34e92f){return _0x34e92f;});}return null;};}function removeEntity(_0x3f5af3,_0x1ded7c){return function(_0x2da19c){if(_0x2da19c){return _0x2da19c[_0xbc6c('0x21')]()[_0xbc6c('0x20')](function(){var _0x377b03=_0x2da19c['get']({'plain':!![]});var _0xf93182='CannedAnswers';return db[_0xbc6c('0x22')][_0xbc6c('0x21')]({'where':{'type':_0xf93182,'resourceId':_0x377b03['id']}})[_0xbc6c('0x20')](function(){return _0x2da19c;});})[_0xbc6c('0x20')](function(){_0x3f5af3[_0xbc6c('0x14')](0xcc)[_0xbc6c('0x15')]();});}};}function handleEntityNotFound(_0x43a2bf,_0x2dd3e1){return function(_0x1ed002){if(!_0x1ed002){_0x43a2bf[_0xbc6c('0x23')](0x194);}return _0x1ed002;};}function handleError(_0x37b97d,_0xa2c386){_0xa2c386=_0xa2c386||0x1f4;return function(_0x50e567){logger[_0xbc6c('0x24')](_0x50e567[_0xbc6c('0x25')]);if(_0x50e567[_0xbc6c('0x26')]){delete _0x50e567[_0xbc6c('0x26')];}_0x37b97d['status'](_0xa2c386)[_0xbc6c('0x27')](_0x50e567);};}exports[_0xbc6c('0x28')]=function(_0x43fca8,_0x4b5f13){var _0x3fbe8a={},_0x165342={},_0x17015a={'count':0x0,'rows':[]};var _0x40547a=db['CannedAnswer'][_0xbc6c('0x29')];_0x165342[_0xbc6c('0x2a')]=_[_0xbc6c('0x2b')](_0x40547a);_0x165342['query']=_[_0xbc6c('0x2b')](_0x43fca8[_0xbc6c('0x2c')]);_0x165342[_0xbc6c('0x2d')]=_['intersection'](_0x165342[_0xbc6c('0x2a')],_0x165342['query']);_0x3fbe8a[_0xbc6c('0x2e')]=_[_0xbc6c('0x2f')](_0x165342[_0xbc6c('0x2a')],qs[_0xbc6c('0x30')](_0x43fca8[_0xbc6c('0x2c')][_0xbc6c('0x30')]));_0x3fbe8a[_0xbc6c('0x2e')]=_0x3fbe8a['attributes'][_0xbc6c('0x31')]?_0x3fbe8a[_0xbc6c('0x2e')]:_0x165342['model'];if(!_0x43fca8['query'][_0xbc6c('0x32')](_0xbc6c('0x33'))){_0x3fbe8a[_0xbc6c('0x19')]=qs[_0xbc6c('0x19')](_0x43fca8['query'][_0xbc6c('0x19')]);_0x3fbe8a[_0xbc6c('0x18')]=qs[_0xbc6c('0x18')](_0x43fca8[_0xbc6c('0x2c')][_0xbc6c('0x18')]);}_0x3fbe8a[_0xbc6c('0x34')]=qs['sort'](_0x43fca8[_0xbc6c('0x2c')][_0xbc6c('0x35')]);_0x3fbe8a[_0xbc6c('0x36')]=qs[_0xbc6c('0x2d')](_[_0xbc6c('0x37')](_0x43fca8[_0xbc6c('0x2c')],_0x165342[_0xbc6c('0x2d')]));if(_0x43fca8['query'][_0xbc6c('0x38')]){_0x3fbe8a['where']=_[_0xbc6c('0x39')](_0x3fbe8a[_0xbc6c('0x36')],{'$or':_[_0xbc6c('0x3a')](_0x40547a,function(_0x1ae1cf){if(_0x1ae1cf[_0xbc6c('0x3b')][_0xbc6c('0x3c')]!==_0xbc6c('0x3d')){var _0x2e204b={};_0x2e204b[_0x1ae1cf[_0xbc6c('0x3e')]]={'$like':'%'+_0x43fca8[_0xbc6c('0x2c')]['filter']+'%'};return _0x2e204b;}})});}_0x3fbe8a=_[_0xbc6c('0x39')]({},_0x3fbe8a,_0x43fca8[_0xbc6c('0x3f')]);var _0x4b66bf={'where':_0x3fbe8a[_0xbc6c('0x36')]};return db[_0xbc6c('0x40')][_0xbc6c('0x17')](_0x4b66bf)[_0xbc6c('0x20')](function(_0x1c43db){_0x17015a[_0xbc6c('0x17')]=_0x1c43db;if(_0x43fca8[_0xbc6c('0x2c')][_0xbc6c('0x41')]){_0x3fbe8a[_0xbc6c('0x42')]=[{'all':!![]}];}return db[_0xbc6c('0x40')]['findAll'](_0x3fbe8a);})['then'](function(_0x594835){_0x17015a[_0xbc6c('0x43')]=_0x594835;return _0x17015a;})['then'](respondWithFilteredResult(_0x4b5f13,_0x3fbe8a))[_0xbc6c('0x44')](handleError(_0x4b5f13,null));};exports[_0xbc6c('0x45')]=function(_0x215d46,_0x2aecb2){var _0x3d82b9={'raw':!![],'where':{'id':_0x215d46[_0xbc6c('0x46')]['id']}},_0x519a9a={};_0x519a9a[_0xbc6c('0x2a')]=_[_0xbc6c('0x2b')](db[_0xbc6c('0x40')][_0xbc6c('0x29')]);_0x519a9a[_0xbc6c('0x2c')]=_[_0xbc6c('0x2b')](_0x215d46[_0xbc6c('0x2c')]);_0x519a9a[_0xbc6c('0x2d')]=_[_0xbc6c('0x2f')](_0x519a9a[_0xbc6c('0x2a')],_0x519a9a[_0xbc6c('0x2c')]);_0x3d82b9[_0xbc6c('0x2e')]=_[_0xbc6c('0x2f')](_0x519a9a[_0xbc6c('0x2a')],qs['fields'](_0x215d46[_0xbc6c('0x2c')]['fields']));_0x3d82b9[_0xbc6c('0x2e')]=_0x3d82b9[_0xbc6c('0x2e')][_0xbc6c('0x31')]?_0x3d82b9[_0xbc6c('0x2e')]:_0x519a9a[_0xbc6c('0x2a')];if(_0x215d46['query'][_0xbc6c('0x41')]){_0x3d82b9['include']=[{'all':!![]}];}_0x3d82b9=_[_0xbc6c('0x39')]({},_0x3d82b9,_0x215d46[_0xbc6c('0x3f')]);return db['CannedAnswer']['find'](_0x3d82b9)['then'](handleEntityNotFound(_0x2aecb2,null))[_0xbc6c('0x20')](respondWithResult(_0x2aecb2,null))[_0xbc6c('0x44')](handleError(_0x2aecb2,null));};exports[_0xbc6c('0x1f')]=function(_0x46e651,_0x36b4c5){if(_0x46e651['body']['id']){delete _0x46e651[_0xbc6c('0x47')]['id'];}return db[_0xbc6c('0x40')][_0xbc6c('0x48')]({'where':{'id':_0x46e651[_0xbc6c('0x46')]['id']}})['then'](handleEntityNotFound(_0x36b4c5,null))['then'](saveUpdates(_0x46e651[_0xbc6c('0x47')],null))['then'](respondWithResult(_0x36b4c5,null))[_0xbc6c('0x44')](handleError(_0x36b4c5,null));};exports[_0xbc6c('0x21')]=function(_0x1b07a9,_0x13ef0c){return db['CannedAnswer']['find']({'where':{'id':_0x1b07a9[_0xbc6c('0x46')]['id']}})[_0xbc6c('0x20')](handleEntityNotFound(_0x13ef0c,null))['then'](removeEntity(_0x13ef0c,null))[_0xbc6c('0x44')](handleError(_0x13ef0c,null));};exports['create']=function(_0x467ca9,_0x303be3){var _0x123407={'key':_0x467ca9[_0xbc6c('0x47')][_0xbc6c('0x3c')]};if(_0x467ca9['body'][_0xbc6c('0x49')]){_0x123407[_0xbc6c('0x49')]=_0x467ca9[_0xbc6c('0x47')][_0xbc6c('0x49')];}else if(_0x467ca9[_0xbc6c('0x47')][_0xbc6c('0x4a')]){_0x123407[_0xbc6c('0x4a')]=_0x467ca9['body'][_0xbc6c('0x4a')];}else if(_0x467ca9[_0xbc6c('0x47')][_0xbc6c('0x4b')]){_0x123407['OpenchannelAccountId']=_0x467ca9[_0xbc6c('0x47')][_0xbc6c('0x4b')];}else if(_0x467ca9[_0xbc6c('0x47')][_0xbc6c('0x4c')]){_0x123407[_0xbc6c('0x4c')]=_0x467ca9['body'][_0xbc6c('0x4c')];}return db[_0xbc6c('0x40')][_0xbc6c('0x48')]({'where':_0x123407})['then'](function(_0x446a9d){if(_0x446a9d){throw new db[(_0xbc6c('0x4d'))][(_0xbc6c('0x4e'))](_0xbc6c('0x4f'));}return db['CannedAnswer']['create'](_0x467ca9[_0xbc6c('0x47')]);})[_0xbc6c('0x20')](function(_0x517f0d){var _0x1884ee=_0x467ca9[_0xbc6c('0x50')]['get']({'plain':!![]});if(!_0x1884ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1884ee[_0xbc6c('0x51')]===_0xbc6c('0x50')){var _0x21abee=_0x517f0d['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xbc6c('0x52'),'userProfileId':_0x1884ee[_0xbc6c('0x53')]},'raw':!![]})[_0xbc6c('0x20')](function(_0x2527fd){if(_0x2527fd&&_0x2527fd['autoAssociation']===0x0){return db[_0xbc6c('0x22')][_0xbc6c('0x54')]({'name':_0x21abee['name'],'resourceId':_0x21abee['id'],'type':_0x2527fd['name'],'sectionId':_0x2527fd['id']},{})[_0xbc6c('0x20')](function(){return _0x517f0d;});}else{return _0x517f0d;}})[_0xbc6c('0x44')](function(_0x4a5cce){logger[_0xbc6c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a5cce);throw _0x4a5cce;});}return _0x517f0d;})[_0xbc6c('0x20')](respondWithResult(_0x303be3,0xc9))[_0xbc6c('0x44')](handleError(_0x303be3,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 1c539fc..c23fa01 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 _0x190f=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash'];(function(_0x3a9fdb,_0x205d53){var _0x18fc17=function(_0x489f1d){while(--_0x489f1d){_0x3a9fdb['push'](_0x3a9fdb['shift']());}};_0x18fc17(++_0x205d53);}(_0x190f,0x11d));var _0xf190=function(_0x38347b,_0x49707a){_0x38347b=_0x38347b-0x0;var _0x28b376=_0x190f[_0x38347b];return _0x28b376;};'use strict';var _=require(_0xf190('0x0'));var util=require(_0xf190('0x1'));var logger=require(_0xf190('0x2'))('api');var moment=require(_0xf190('0x3'));var BPromise=require(_0xf190('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf190('0x5'));var rimraf=require(_0xf190('0x6'));var config=require(_0xf190('0x7'));var attributes=require(_0xf190('0x8'));module['exports']=function(_0x5b10f7,_0x530f58){return _0x5b10f7[_0xf190('0x9')](_0xf190('0xa'),attributes,{'tableName':_0xf190('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf190('0xc')});}; \ No newline at end of file +var _0x80a3=['bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','util','api','moment'];(function(_0x22eaa3,_0x248c1f){var _0x1f1128=function(_0x5cc142){while(--_0x5cc142){_0x22eaa3['push'](_0x22eaa3['shift']());}};_0x1f1128(++_0x248c1f);}(_0x80a3,0x159));var _0x380a=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x80a3[_0x28d18d];return _0x470640;};'use strict';var _=require('lodash');var util=require(_0x380a('0x0'));var logger=require('../../config/logger')(_0x380a('0x1'));var moment=require(_0x380a('0x2'));var BPromise=require(_0x380a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x380a('0x4'));var rimraf=require(_0x380a('0x5'));var config=require(_0x380a('0x6'));var attributes=require(_0x380a('0x7'));module['exports']=function(_0x2ed352,_0x4ccda1){return _0x2ed352[_0x380a('0x8')](_0x380a('0x9'),attributes,{'tableName':_0x380a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x380a('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 55186d2..4d64200 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 _0x06d7=['request','then','info','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x06d7,0x14d));var _0x706d=function(_0x1d0fa7,_0x1ad70f){_0x1d0fa7=_0x1d0fa7-0x0;var _0x5b2d91=_0x06d7[_0x1d0fa7];return _0x5b2d91;};'use strict';var _=require('lodash');var util=require(_0x706d('0x0'));var moment=require(_0x706d('0x1'));var BPromise=require(_0x706d('0x2'));var rs=require(_0x706d('0x3'));var fs=require('fs');var Redis=require(_0x706d('0x4'));var db=require(_0x706d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x706d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x420f0f,_0x67169f,_0x379093){return new BPromise(function(_0xc8c8c5,_0x1e2d58){return client[_0x706d('0x7')](_0x420f0f,_0x379093)[_0x706d('0x8')](function(_0x55130f){logger[_0x706d('0x9')](_0x706d('0xa'),_0x67169f,'request\x20sent');logger[_0x706d('0xb')](_0x706d('0xc'),_0x67169f,_0x706d('0xd'),JSON[_0x706d('0xe')](_0x55130f));if(_0x55130f['error']){if(_0x55130f[_0x706d('0xf')][_0x706d('0x10')]===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x67169f,_0x55130f['error']['message']);return _0x1e2d58(_0x55130f['error'][_0x706d('0x11')]);}logger[_0x706d('0xf')](_0x706d('0xa'),_0x67169f,_0x55130f[_0x706d('0xf')][_0x706d('0x11')]);return _0xc8c8c5(_0x55130f[_0x706d('0xf')][_0x706d('0x11')]);}else{logger['info'](_0x706d('0xa'),_0x67169f,_0x706d('0xd'));_0xc8c8c5(_0x55130f[_0x706d('0x12')]['message']);}})[_0x706d('0x13')](function(_0xc5fb17){logger[_0x706d('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x67169f,_0xc5fb17);_0x1e2d58(_0xc5fb17);});});} \ No newline at end of file +var _0x5bf8=['debug','request\x20sent','error','CannedAnswer,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x5bf8,0x118));var _0x85bf=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x5bf8[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x85bf('0x0'));var util=require(_0x85bf('0x1'));var moment=require(_0x85bf('0x2'));var BPromise=require(_0x85bf('0x3'));var rs=require(_0x85bf('0x4'));var fs=require('fs');var Redis=require(_0x85bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x85bf('0x6'));var logger=require('../../config/logger')(_0x85bf('0x7'));var config=require(_0x85bf('0x8'));var jayson=require(_0x85bf('0x9'));var client=jayson[_0x85bf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f7dd3,_0x25d6df,_0x535cca){return new BPromise(function(_0x2c2012,_0x5cca60){return client[_0x85bf('0xb')](_0x4f7dd3,_0x535cca)[_0x85bf('0xc')](function(_0x430f05){logger[_0x85bf('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x25d6df,'request\x20sent');logger[_0x85bf('0xe')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x25d6df,_0x85bf('0xf'),JSON['stringify'](_0x430f05));if(_0x430f05[_0x85bf('0x10')]){if(_0x430f05[_0x85bf('0x10')]['code']===0x1f4){logger['error'](_0x85bf('0x11'),_0x25d6df,_0x430f05['error'][_0x85bf('0x12')]);return _0x5cca60(_0x430f05[_0x85bf('0x10')][_0x85bf('0x12')]);}logger[_0x85bf('0x10')](_0x85bf('0x11'),_0x25d6df,_0x430f05[_0x85bf('0x10')][_0x85bf('0x12')]);return _0x2c2012(_0x430f05['error'][_0x85bf('0x12')]);}else{logger[_0x85bf('0xd')](_0x85bf('0x11'),_0x25d6df,_0x85bf('0xf'));_0x2c2012(_0x430f05[_0x85bf('0x13')][_0x85bf('0x12')]);}})[_0x85bf('0x14')](function(_0x22c20a){logger[_0x85bf('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x25d6df,_0x22c20a);_0x5cca60(_0x22c20a);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 30616c2..72f60fb 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 _0xe804=['post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','get','/:id'];(function(_0x48b8ad,_0xe28403){var _0x4d1bae=function(_0x5d13b2){while(--_0x5d13b2){_0x48b8ad['push'](_0x48b8ad['shift']());}};_0x4d1bae(++_0xe28403);}(_0xe804,0x6c));var _0x4e80=function(_0x3c21a7,_0x4e8273){_0x3c21a7=_0x3c21a7-0x0;var _0x1e2713=_0xe804[_0x3c21a7];return _0x1e2713;};'use strict';var multer=require(_0x4e80('0x0'));var util=require('util');var path=require(_0x4e80('0x1'));var timeout=require(_0x4e80('0x2'));var express=require(_0x4e80('0x3'));var router=express[_0x4e80('0x4')]();var auth=require(_0x4e80('0x5'));var interaction=require(_0x4e80('0x6'));var config=require('../../config/environment');var controller=require(_0x4e80('0x7'));router['get']('/',auth[_0x4e80('0x8')](),controller['index']);router[_0x4e80('0x9')](_0x4e80('0xa'),auth[_0x4e80('0x8')](),controller['show']);router[_0x4e80('0xb')]('/',auth[_0x4e80('0x8')](),controller[_0x4e80('0xc')]);router[_0x4e80('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4e80('0xe')]);router[_0x4e80('0xf')]('/:id',auth[_0x4e80('0x8')](),controller['destroy']);module[_0x4e80('0x10')]=router; \ No newline at end of file +var _0xcd27=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','/:id','isAuthenticated','post','create','put','delete','exports'];(function(_0x128b07,_0x1d258c){var _0x620694=function(_0x1f6657){while(--_0x1f6657){_0x128b07['push'](_0x128b07['shift']());}};_0x620694(++_0x1d258c);}(_0xcd27,0x70));var _0x7cd2=function(_0xca7374,_0x1fd995){_0xca7374=_0xca7374-0x0;var _0x10735f=_0xcd27[_0xca7374];return _0x10735f;};'use strict';var multer=require(_0x7cd2('0x0'));var util=require(_0x7cd2('0x1'));var path=require(_0x7cd2('0x2'));var timeout=require(_0x7cd2('0x3'));var express=require('express');var router=express[_0x7cd2('0x4')]();var auth=require(_0x7cd2('0x5'));var interaction=require(_0x7cd2('0x6'));var config=require('../../config/environment');var controller=require(_0x7cd2('0x7'));router[_0x7cd2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7cd2('0x8')](_0x7cd2('0x9'),auth[_0x7cd2('0xa')](),controller['show']);router[_0x7cd2('0xb')]('/',auth['isAuthenticated'](),controller[_0x7cd2('0xc')]);router[_0x7cd2('0xd')]('/:id',auth[_0x7cd2('0xa')](),controller['update']);router[_0x7cd2('0xe')]('/:id',auth[_0x7cd2('0xa')](),controller['destroy']);module[_0x7cd2('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index ec1ce54..2fe3cda 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 _0xb989=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x1cbc4d,_0x6bc2fe){var _0x28be46=function(_0x2fe6fc){while(--_0x2fe6fc){_0x1cbc4d['push'](_0x1cbc4d['shift']());}};_0x28be46(++_0x6bc2fe);}(_0xb989,0x199));var _0x9b98=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xb989[_0x34c063];return _0x2c63a3;};'use strict';var Sequelize=require(_0x9b98('0x0'));module[_0x9b98('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x9b98('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x9b98('0x3')]},'dcontext':{'type':Sequelize[_0x9b98('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x9b98('0x3')]},'lastapp':{'type':Sequelize[_0x9b98('0x3')]},'lastdata':{'type':Sequelize[_0x9b98('0x3')]},'duration':{'type':Sequelize[_0x9b98('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9b98('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9b98('0x3')]},'uniqueid':{'type':Sequelize[_0x9b98('0x3')]},'linkedid':{'type':Sequelize[_0x9b98('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x9b98('0x3')]},'type':{'type':Sequelize[_0x9b98('0x3')]},'tag':{'type':Sequelize[_0x9b98('0x3')]}}; \ No newline at end of file +var _0xfcbf=['INTEGER','sequelize','exports','STRING'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0xfcbf,0x199));var _0xffcb=function(_0x2ef4e3,_0x1ef578){_0x2ef4e3=_0x2ef4e3-0x0;var _0x4339f1=_0xfcbf[_0x2ef4e3];return _0x4339f1;};'use strict';var Sequelize=require(_0xffcb('0x0'));module[_0xffcb('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xffcb('0x2')]},'src':{'type':Sequelize[_0xffcb('0x2')]},'dst':{'type':Sequelize[_0xffcb('0x2')]},'dcontext':{'type':Sequelize[_0xffcb('0x2')]},'channel':{'type':Sequelize[_0xffcb('0x2')]},'dstchannel':{'type':Sequelize[_0xffcb('0x2')]},'lastapp':{'type':Sequelize[_0xffcb('0x2')]},'lastdata':{'type':Sequelize[_0xffcb('0x2')]},'duration':{'type':Sequelize[_0xffcb('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xffcb('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xffcb('0x2')]},'amaflags':{'type':Sequelize[_0xffcb('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xffcb('0x2')]},'userfield':{'type':Sequelize[_0xffcb('0x2')]},'uniqueid':{'type':Sequelize[_0xffcb('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xffcb('0x2')]},'tag':{'type':Sequelize[_0xffcb('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index cce988c..76f5a28 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 _0xce56=['Cdr','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','pick','filters','filter','where','map','type','VIRTUAL','field','merge','options','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x8da90b,_0x5e0d04){var _0x30e6db=function(_0x30610a){while(--_0x30610a){_0x8da90b['push'](_0x8da90b['shift']());}};_0x30e6db(++_0x5e0d04);}(_0xce56,0xa9));var _0x6ce5=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xce56[_0x298ed3];return _0x5aad28;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6ce5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ce5('0x1'));var jsonpatch=require(_0x6ce5('0x2'));var rp=require(_0x6ce5('0x3'));var moment=require(_0x6ce5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6ce5('0x5'));var util=require('util');var path=require(_0x6ce5('0x6'));var sox=require(_0x6ce5('0x7'));var csv=require('to-csv');var ejs=require(_0x6ce5('0x8'));var fs=require('fs');var _=require(_0x6ce5('0x9'));var squel=require(_0x6ce5('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6ce5('0xb'));var Papa=require(_0x6ce5('0xc'));var Redis=require(_0x6ce5('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6ce5('0xe'));var hardwareService=require(_0x6ce5('0xf'));var logger=require('../../config/logger')(_0x6ce5('0x10'));var utils=require(_0x6ce5('0x11'));var config=require(_0x6ce5('0x12'));var db=require(_0x6ce5('0x13'))['db'];function respondWithStatusCode(_0x2838e0,_0x222999){_0x222999=_0x222999||0xcc;return function(_0x49df30){if(_0x49df30){return _0x2838e0[_0x6ce5('0x14')](_0x222999);}return _0x2838e0[_0x6ce5('0x15')](_0x222999)[_0x6ce5('0x16')]();};}function respondWithResult(_0x1dccfb,_0x265b40){_0x265b40=_0x265b40||0xc8;return function(_0x370afa){if(_0x370afa){return _0x1dccfb[_0x6ce5('0x15')](_0x265b40)[_0x6ce5('0x17')](_0x370afa);}};}function respondWithFilteredResult(_0xa01f93,_0x2949e6){return function(_0x175a52){if(_0x175a52){var _0x150acc=_0x175a52[_0x6ce5('0x18')],_0x55d840=_0x2949e6[_0x6ce5('0x19')],_0x5026df=_0x2949e6[_0x6ce5('0x19')]+_0x2949e6[_0x6ce5('0x1a')],_0x5cc837;if(_0x5026df>=_0x150acc){_0x5026df=_0x150acc;_0x5cc837=0xc8;}else{_0x5cc837=0xce;}_0xa01f93[_0x6ce5('0x15')](_0x5cc837);return _0xa01f93['set'](_0x6ce5('0x1b'),_0x55d840+'-'+_0x5026df+'/'+_0x150acc)['json'](_0x175a52);}return null;};}function patchUpdates(_0x36a9f4){return function(_0x238185){try{jsonpatch[_0x6ce5('0x1c')](_0x238185,_0x36a9f4,!![]);}catch(_0x1309ca){return BPromise[_0x6ce5('0x1d')](_0x1309ca);}return _0x238185[_0x6ce5('0x1e')]();};}function saveUpdates(_0x251579,_0x1a4aa5){return function(_0xc15a75){if(_0xc15a75){return _0xc15a75[_0x6ce5('0x1f')](_0x251579)[_0x6ce5('0x20')](function(_0x807867){return _0x807867;});}return null;};}function removeEntity(_0x5b3f85,_0x18f7b9){return function(_0x5a4d8d){if(_0x5a4d8d){return _0x5a4d8d['destroy']()[_0x6ce5('0x20')](function(){_0x5b3f85[_0x6ce5('0x15')](0xcc)[_0x6ce5('0x16')]();});}};}function handleEntityNotFound(_0x2f15b7,_0x285db4){return function(_0xae44c9){if(!_0xae44c9){_0x2f15b7[_0x6ce5('0x14')](0x194);}return _0xae44c9;};}function handleError(_0x2d3506,_0xc5d93a){_0xc5d93a=_0xc5d93a||0x1f4;return function(_0x4f4f94){logger[_0x6ce5('0x21')](_0x4f4f94[_0x6ce5('0x22')]);if(_0x4f4f94['name']){delete _0x4f4f94[_0x6ce5('0x23')];}_0x2d3506[_0x6ce5('0x15')](_0xc5d93a)[_0x6ce5('0x24')](_0x4f4f94);};}exports[_0x6ce5('0x25')]=function(_0x2b493b,_0x4c9b8d){var _0x187bb9={},_0x459dac={},_0x2f866e={'count':0x0,'rows':[]};var _0x4a096a=db[_0x6ce5('0x26')][_0x6ce5('0x27')];_0x459dac[_0x6ce5('0x28')]=_[_0x6ce5('0x29')](_0x4a096a);_0x459dac[_0x6ce5('0x2a')]=_[_0x6ce5('0x29')](_0x2b493b['query']);_0x459dac['filters']=_[_0x6ce5('0x2b')](_0x459dac[_0x6ce5('0x28')],_0x459dac[_0x6ce5('0x2a')]);_0x187bb9[_0x6ce5('0x2c')]=_[_0x6ce5('0x2b')](_0x459dac[_0x6ce5('0x28')],qs[_0x6ce5('0x2d')](_0x2b493b[_0x6ce5('0x2a')][_0x6ce5('0x2d')]));_0x187bb9[_0x6ce5('0x2c')]=_0x187bb9[_0x6ce5('0x2c')][_0x6ce5('0x2e')]?_0x187bb9[_0x6ce5('0x2c')]:_0x459dac[_0x6ce5('0x28')];if(!_0x2b493b[_0x6ce5('0x2a')][_0x6ce5('0x2f')]('nolimit')){_0x187bb9[_0x6ce5('0x1a')]=qs[_0x6ce5('0x1a')](_0x2b493b['query']['limit']);_0x187bb9[_0x6ce5('0x19')]=qs[_0x6ce5('0x19')](_0x2b493b['query']['offset']);}_0x187bb9[_0x6ce5('0x30')]=qs['sort'](_0x2b493b[_0x6ce5('0x2a')]['sort']);_0x187bb9['where']=qs['filters'](_[_0x6ce5('0x31')](_0x2b493b[_0x6ce5('0x2a')],_0x459dac[_0x6ce5('0x32')]));if(_0x2b493b[_0x6ce5('0x2a')][_0x6ce5('0x33')]){_0x187bb9[_0x6ce5('0x34')]=_['merge'](_0x187bb9[_0x6ce5('0x34')],{'$or':_[_0x6ce5('0x35')](_0x4a096a,function(_0x5acbcc){if(_0x5acbcc[_0x6ce5('0x36')]['key']!==_0x6ce5('0x37')){var _0x3c29cc={};_0x3c29cc[_0x5acbcc[_0x6ce5('0x38')]]={'$like':'%'+_0x2b493b['query'][_0x6ce5('0x33')]+'%'};return _0x3c29cc;}})});}_0x187bb9=_[_0x6ce5('0x39')]({},_0x187bb9,_0x2b493b[_0x6ce5('0x3a')]);var _0x2b8509={'where':_0x187bb9[_0x6ce5('0x34')]};return db[_0x6ce5('0x26')]['count'](_0x2b8509)[_0x6ce5('0x20')](function(_0x30d406){_0x2f866e[_0x6ce5('0x18')]=_0x30d406;if(_0x2b493b[_0x6ce5('0x2a')][_0x6ce5('0x3b')]){_0x187bb9[_0x6ce5('0x3c')]=[{'all':!![]}];}return db[_0x6ce5('0x26')]['findAll'](_0x187bb9);})[_0x6ce5('0x20')](function(_0x5bccf4){_0x2f866e[_0x6ce5('0x3d')]=_0x5bccf4;return _0x2f866e;})[_0x6ce5('0x20')](respondWithFilteredResult(_0x4c9b8d,_0x187bb9))['catch'](handleError(_0x4c9b8d,null));};exports[_0x6ce5('0x3e')]=function(_0x2e404d,_0x58eae1){var _0x476c5a={'raw':!![],'where':{'id':_0x2e404d[_0x6ce5('0x3f')]['id']}},_0xd45c2={};_0xd45c2[_0x6ce5('0x28')]=_[_0x6ce5('0x29')](db['Cdr'][_0x6ce5('0x27')]);_0xd45c2[_0x6ce5('0x2a')]=_[_0x6ce5('0x29')](_0x2e404d[_0x6ce5('0x2a')]);_0xd45c2[_0x6ce5('0x32')]=_[_0x6ce5('0x2b')](_0xd45c2[_0x6ce5('0x28')],_0xd45c2['query']);_0x476c5a[_0x6ce5('0x2c')]=_['intersection'](_0xd45c2['model'],qs[_0x6ce5('0x2d')](_0x2e404d[_0x6ce5('0x2a')][_0x6ce5('0x2d')]));_0x476c5a[_0x6ce5('0x2c')]=_0x476c5a[_0x6ce5('0x2c')]['length']?_0x476c5a[_0x6ce5('0x2c')]:_0xd45c2[_0x6ce5('0x28')];if(_0x2e404d['query'][_0x6ce5('0x3b')]){_0x476c5a[_0x6ce5('0x3c')]=[{'all':!![]}];}_0x476c5a=_[_0x6ce5('0x39')]({},_0x476c5a,_0x2e404d[_0x6ce5('0x3a')]);return db[_0x6ce5('0x26')][_0x6ce5('0x40')](_0x476c5a)['then'](handleEntityNotFound(_0x58eae1,null))['then'](respondWithResult(_0x58eae1,null))[_0x6ce5('0x41')](handleError(_0x58eae1,null));};exports[_0x6ce5('0x42')]=function(_0x2e79f9,_0x186ab0){return db[_0x6ce5('0x26')][_0x6ce5('0x42')](_0x2e79f9[_0x6ce5('0x43')],{})[_0x6ce5('0x20')](respondWithResult(_0x186ab0,0xc9))['catch'](handleError(_0x186ab0,null));};exports[_0x6ce5('0x1f')]=function(_0x5d66e3,_0x5ea7d4){if(_0x5d66e3[_0x6ce5('0x43')]['id']){delete _0x5d66e3[_0x6ce5('0x43')]['id'];}return db[_0x6ce5('0x26')][_0x6ce5('0x40')]({'where':{'id':_0x5d66e3['params']['id']}})['then'](handleEntityNotFound(_0x5ea7d4,null))[_0x6ce5('0x20')](saveUpdates(_0x5d66e3[_0x6ce5('0x43')],null))[_0x6ce5('0x20')](respondWithResult(_0x5ea7d4,null))[_0x6ce5('0x41')](handleError(_0x5ea7d4,null));};exports['destroy']=function(_0x382895,_0x230f2b){return db[_0x6ce5('0x26')][_0x6ce5('0x40')]({'where':{'id':_0x382895[_0x6ce5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x230f2b,null))[_0x6ce5('0x20')](removeEntity(_0x230f2b,null))[_0x6ce5('0x41')](handleError(_0x230f2b,null));};exports['describe']=function(_0x19c441,_0x5de6ed){return db[_0x6ce5('0x26')][_0x6ce5('0x44')]()[_0x6ce5('0x20')](respondWithResult(_0x5de6ed,null))[_0x6ce5('0x41')](handleError(_0x5de6ed,null));}; \ No newline at end of file +var _0xb4c5=['Cdr','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','sort','where','filter','merge','map','key','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','length','body','find','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index'];(function(_0x1ed768,_0x45bde8){var _0x2b823b=function(_0x4d75df){while(--_0x4d75df){_0x1ed768['push'](_0x1ed768['shift']());}};_0x2b823b(++_0x45bde8);}(_0xb4c5,0x64));var _0x5b4c=function(_0x1f608c,_0x3b0194){_0x1f608c=_0x1f608c-0x0;var _0x319fd2=_0xb4c5[_0x1f608c];return _0x319fd2;};'use strict';var pdf=require(_0x5b4c('0x0'));var emlformat=require(_0x5b4c('0x1'));var rimraf=require(_0x5b4c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b4c('0x3'));var rp=require(_0x5b4c('0x4'));var moment=require(_0x5b4c('0x5'));var BPromise=require(_0x5b4c('0x6'));var Mustache=require('mustache');var util=require(_0x5b4c('0x7'));var path=require(_0x5b4c('0x8'));var sox=require(_0x5b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x5b4c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5b4c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5b4c('0xc'));var toCsv=require(_0x5b4c('0xd'));var querystring=require(_0x5b4c('0xe'));var Papa=require(_0x5b4c('0xf'));var Redis=require(_0x5b4c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5b4c('0x11'));var logger=require(_0x5b4c('0x12'))(_0x5b4c('0x13'));var utils=require(_0x5b4c('0x14'));var config=require(_0x5b4c('0x15'));var db=require(_0x5b4c('0x16'))['db'];function respondWithStatusCode(_0x136d45,_0x555f64){_0x555f64=_0x555f64||0xcc;return function(_0x1627f0){if(_0x1627f0){return _0x136d45[_0x5b4c('0x17')](_0x555f64);}return _0x136d45[_0x5b4c('0x18')](_0x555f64)['end']();};}function respondWithResult(_0x4f62bb,_0x392107){_0x392107=_0x392107||0xc8;return function(_0x4995ef){if(_0x4995ef){return _0x4f62bb[_0x5b4c('0x18')](_0x392107)[_0x5b4c('0x19')](_0x4995ef);}};}function respondWithFilteredResult(_0x34ec8b,_0x42c90a){return function(_0x4dd6be){if(_0x4dd6be){var _0x3ac67e=_0x4dd6be['count'],_0x53ac28=_0x42c90a[_0x5b4c('0x1a')],_0x481bec=_0x42c90a[_0x5b4c('0x1a')]+_0x42c90a[_0x5b4c('0x1b')],_0x53b349;if(_0x481bec>=_0x3ac67e){_0x481bec=_0x3ac67e;_0x53b349=0xc8;}else{_0x53b349=0xce;}_0x34ec8b['status'](_0x53b349);return _0x34ec8b[_0x5b4c('0x1c')](_0x5b4c('0x1d'),_0x53ac28+'-'+_0x481bec+'/'+_0x3ac67e)[_0x5b4c('0x19')](_0x4dd6be);}return null;};}function patchUpdates(_0x28d5bd){return function(_0x271258){try{jsonpatch[_0x5b4c('0x1e')](_0x271258,_0x28d5bd,!![]);}catch(_0x31997b){return BPromise['reject'](_0x31997b);}return _0x271258[_0x5b4c('0x1f')]();};}function saveUpdates(_0x3f3447,_0x2e8bbb){return function(_0x5979fc){if(_0x5979fc){return _0x5979fc[_0x5b4c('0x20')](_0x3f3447)['then'](function(_0x4f2113){return _0x4f2113;});}return null;};}function removeEntity(_0x5ae837,_0x3f5a54){return function(_0x13774b){if(_0x13774b){return _0x13774b['destroy']()[_0x5b4c('0x21')](function(){_0x5ae837[_0x5b4c('0x18')](0xcc)[_0x5b4c('0x22')]();});}};}function handleEntityNotFound(_0x2a26f9,_0x1c3c9f){return function(_0x38183d){if(!_0x38183d){_0x2a26f9[_0x5b4c('0x17')](0x194);}return _0x38183d;};}function handleError(_0x3975e9,_0x2d06c9){_0x2d06c9=_0x2d06c9||0x1f4;return function(_0x3ec487){logger[_0x5b4c('0x23')](_0x3ec487[_0x5b4c('0x24')]);if(_0x3ec487['name']){delete _0x3ec487[_0x5b4c('0x25')];}_0x3975e9[_0x5b4c('0x18')](_0x2d06c9)[_0x5b4c('0x26')](_0x3ec487);};}exports[_0x5b4c('0x27')]=function(_0x3783d2,_0xe27f32){var _0x3623ee={},_0x56a18e={},_0x36a6a5={'count':0x0,'rows':[]};var _0x5887ee=db[_0x5b4c('0x28')][_0x5b4c('0x29')];_0x56a18e[_0x5b4c('0x2a')]=_[_0x5b4c('0x2b')](_0x5887ee);_0x56a18e[_0x5b4c('0x2c')]=_['keys'](_0x3783d2['query']);_0x56a18e[_0x5b4c('0x2d')]=_['intersection'](_0x56a18e[_0x5b4c('0x2a')],_0x56a18e['query']);_0x3623ee[_0x5b4c('0x2e')]=_[_0x5b4c('0x2f')](_0x56a18e['model'],qs[_0x5b4c('0x30')](_0x3783d2[_0x5b4c('0x2c')][_0x5b4c('0x30')]));_0x3623ee[_0x5b4c('0x2e')]=_0x3623ee['attributes']['length']?_0x3623ee[_0x5b4c('0x2e')]:_0x56a18e[_0x5b4c('0x2a')];if(!_0x3783d2[_0x5b4c('0x2c')]['hasOwnProperty'](_0x5b4c('0x31'))){_0x3623ee[_0x5b4c('0x1b')]=qs['limit'](_0x3783d2[_0x5b4c('0x2c')][_0x5b4c('0x1b')]);_0x3623ee[_0x5b4c('0x1a')]=qs[_0x5b4c('0x1a')](_0x3783d2[_0x5b4c('0x2c')][_0x5b4c('0x1a')]);}_0x3623ee['order']=qs[_0x5b4c('0x32')](_0x3783d2[_0x5b4c('0x2c')][_0x5b4c('0x32')]);_0x3623ee[_0x5b4c('0x33')]=qs[_0x5b4c('0x2d')](_['pick'](_0x3783d2[_0x5b4c('0x2c')],_0x56a18e['filters']));if(_0x3783d2[_0x5b4c('0x2c')][_0x5b4c('0x34')]){_0x3623ee[_0x5b4c('0x33')]=_[_0x5b4c('0x35')](_0x3623ee['where'],{'$or':_[_0x5b4c('0x36')](_0x5887ee,function(_0x24edd5){if(_0x24edd5['type'][_0x5b4c('0x37')]!==_0x5b4c('0x38')){var _0x44ce4c={};_0x44ce4c[_0x24edd5['field']]={'$like':'%'+_0x3783d2[_0x5b4c('0x2c')][_0x5b4c('0x34')]+'%'};return _0x44ce4c;}})});}_0x3623ee=_['merge']({},_0x3623ee,_0x3783d2[_0x5b4c('0x39')]);var _0x44b32a={'where':_0x3623ee['where']};return db['Cdr']['count'](_0x44b32a)['then'](function(_0x1c4f25){_0x36a6a5[_0x5b4c('0x3a')]=_0x1c4f25;if(_0x3783d2[_0x5b4c('0x2c')][_0x5b4c('0x3b')]){_0x3623ee[_0x5b4c('0x3c')]=[{'all':!![]}];}return db[_0x5b4c('0x28')]['findAll'](_0x3623ee);})[_0x5b4c('0x21')](function(_0x9407b2){_0x36a6a5[_0x5b4c('0x3d')]=_0x9407b2;return _0x36a6a5;})[_0x5b4c('0x21')](respondWithFilteredResult(_0xe27f32,_0x3623ee))[_0x5b4c('0x3e')](handleError(_0xe27f32,null));};exports[_0x5b4c('0x3f')]=function(_0x380bd5,_0x5c4b20){var _0x21b589={'raw':!![],'where':{'id':_0x380bd5[_0x5b4c('0x40')]['id']}},_0x21d585={};_0x21d585['model']=_['keys'](db[_0x5b4c('0x28')][_0x5b4c('0x29')]);_0x21d585['query']=_[_0x5b4c('0x2b')](_0x380bd5[_0x5b4c('0x2c')]);_0x21d585[_0x5b4c('0x2d')]=_['intersection'](_0x21d585['model'],_0x21d585[_0x5b4c('0x2c')]);_0x21b589[_0x5b4c('0x2e')]=_['intersection'](_0x21d585[_0x5b4c('0x2a')],qs[_0x5b4c('0x30')](_0x380bd5[_0x5b4c('0x2c')]['fields']));_0x21b589[_0x5b4c('0x2e')]=_0x21b589[_0x5b4c('0x2e')][_0x5b4c('0x41')]?_0x21b589['attributes']:_0x21d585[_0x5b4c('0x2a')];if(_0x380bd5['query']['includeAll']){_0x21b589[_0x5b4c('0x3c')]=[{'all':!![]}];}_0x21b589=_['merge']({},_0x21b589,_0x380bd5[_0x5b4c('0x39')]);return db[_0x5b4c('0x28')]['find'](_0x21b589)[_0x5b4c('0x21')](handleEntityNotFound(_0x5c4b20,null))[_0x5b4c('0x21')](respondWithResult(_0x5c4b20,null))[_0x5b4c('0x3e')](handleError(_0x5c4b20,null));};exports['create']=function(_0x2feec2,_0x5cbe24){return db[_0x5b4c('0x28')]['create'](_0x2feec2['body'],{})[_0x5b4c('0x21')](respondWithResult(_0x5cbe24,0xc9))[_0x5b4c('0x3e')](handleError(_0x5cbe24,null));};exports[_0x5b4c('0x20')]=function(_0x2a5b4f,_0x322faf){if(_0x2a5b4f[_0x5b4c('0x42')]['id']){delete _0x2a5b4f[_0x5b4c('0x42')]['id'];}return db[_0x5b4c('0x28')][_0x5b4c('0x43')]({'where':{'id':_0x2a5b4f['params']['id']}})[_0x5b4c('0x21')](handleEntityNotFound(_0x322faf,null))['then'](saveUpdates(_0x2a5b4f[_0x5b4c('0x42')],null))[_0x5b4c('0x21')](respondWithResult(_0x322faf,null))[_0x5b4c('0x3e')](handleError(_0x322faf,null));};exports[_0x5b4c('0x44')]=function(_0x537511,_0x5500ad){return db[_0x5b4c('0x28')][_0x5b4c('0x43')]({'where':{'id':_0x537511[_0x5b4c('0x40')]['id']}})[_0x5b4c('0x21')](handleEntityNotFound(_0x5500ad,null))[_0x5b4c('0x21')](removeEntity(_0x5500ad,null))[_0x5b4c('0x3e')](handleError(_0x5500ad,null));};exports[_0x5b4c('0x45')]=function(_0x268c38,_0x1192f5){return db[_0x5b4c('0x28')][_0x5b4c('0x45')]()[_0x5b4c('0x21')](respondWithResult(_0x1192f5,null))[_0x5b4c('0x3e')](handleError(_0x1192f5,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 403deea..d63750c 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 _0x9ad0=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','accountcode','calldate','disposition','dst','src'];(function(_0x307746,_0x3c5f24){var _0x2cdccb=function(_0x47ceb1){while(--_0x47ceb1){_0x307746['push'](_0x307746['shift']());}};_0x2cdccb(++_0x3c5f24);}(_0x9ad0,0x78));var _0x09ad=function(_0x19635f,_0x564859){_0x19635f=_0x19635f-0x0;var _0x482132=_0x9ad0[_0x19635f];return _0x482132;};'use strict';var _=require(_0x09ad('0x0'));var util=require('util');var logger=require(_0x09ad('0x1'))(_0x09ad('0x2'));var moment=require(_0x09ad('0x3'));var BPromise=require(_0x09ad('0x4'));var rp=require(_0x09ad('0x5'));var fs=require('fs');var path=require(_0x09ad('0x6'));var rimraf=require(_0x09ad('0x7'));var config=require('../../config/environment');var attributes=require(_0x09ad('0x8'));module[_0x09ad('0x9')]=function(_0x24a201,_0x3ceea4){return _0x24a201[_0x09ad('0xa')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x09ad('0xb'),'fields':[_0x09ad('0xb')]},{'name':_0x09ad('0xc'),'fields':[_0x09ad('0xc')]},{'name':_0x09ad('0xd'),'fields':[_0x09ad('0xd')]},{'name':_0x09ad('0xe'),'fields':['dst']},{'name':_0x09ad('0xf'),'fields':[_0x09ad('0xf')]},{'name':'uniqueid','fields':[_0x09ad('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7f53=['request-promise','path','../../config/environment','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','../../config/logger','bluebird'];(function(_0x2ae280,_0x2a6ad1){var _0x12ac8a=function(_0x34dc63){while(--_0x34dc63){_0x2ae280['push'](_0x2ae280['shift']());}};_0x12ac8a(++_0x2a6ad1);}(_0x7f53,0x1dd));var _0x37f5=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x7f53[_0x2e986d];return _0x351c79;};'use strict';var _=require(_0x37f5('0x0'));var util=require('util');var logger=require(_0x37f5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x37f5('0x2'));var rp=require(_0x37f5('0x3'));var fs=require('fs');var path=require(_0x37f5('0x4'));var rimraf=require('rimraf');var config=require(_0x37f5('0x5'));var attributes=require('./cdr.attributes');module[_0x37f5('0x6')]=function(_0x33565d,_0x7f9def){return _0x33565d[_0x37f5('0x7')](_0x37f5('0x8'),attributes,{'tableName':_0x37f5('0x9'),'paranoid':![],'indexes':[{'name':_0x37f5('0xa'),'fields':[_0x37f5('0xa')]},{'name':'calldate','fields':[_0x37f5('0xb')]},{'name':'disposition','fields':[_0x37f5('0xc')]},{'name':_0x37f5('0xd'),'fields':[_0x37f5('0xd')]},{'name':'src','fields':[_0x37f5('0xe')]},{'name':_0x37f5('0xf'),'fields':[_0x37f5('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 9758ae5..666b397 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 _0x5fd2=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5fd2,0xe1));var _0x25fd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5fd2[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x25fd('0x0'));var util=require(_0x25fd('0x1'));var moment=require(_0x25fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x25fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25fd('0x4'))['db'];var utils=require(_0x25fd('0x5'));var logger=require(_0x25fd('0x6'))('rpc');var config=require(_0x25fd('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x25fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12c1af,_0x545a15,_0x4f6b17){return new BPromise(function(_0x1db41e,_0x28a144){return client[_0x25fd('0x9')](_0x12c1af,_0x4f6b17)[_0x25fd('0xa')](function(_0x5a126a){logger['info'](_0x25fd('0xb'),_0x545a15,'request\x20sent');logger['debug'](_0x25fd('0xc'),_0x545a15,'request\x20sent',JSON[_0x25fd('0xd')](_0x5a126a));if(_0x5a126a['error']){if(_0x5a126a[_0x25fd('0xe')][_0x25fd('0xf')]===0x1f4){logger[_0x25fd('0xe')](_0x25fd('0xb'),_0x545a15,_0x5a126a[_0x25fd('0xe')][_0x25fd('0x10')]);return _0x28a144(_0x5a126a[_0x25fd('0xe')][_0x25fd('0x10')]);}logger['error'](_0x25fd('0xb'),_0x545a15,_0x5a126a[_0x25fd('0xe')][_0x25fd('0x10')]);return _0x1db41e(_0x5a126a[_0x25fd('0xe')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x545a15,'request\x20sent');_0x1db41e(_0x5a126a[_0x25fd('0x11')][_0x25fd('0x10')]);}})[_0x25fd('0x12')](function(_0x5e678c){logger[_0x25fd('0xe')](_0x25fd('0xb'),_0x545a15,_0x5e678c);_0x28a144(_0x5e678c);});});} \ No newline at end of file +var _0x9898=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x3642e7,_0x16878f){var _0x39a68b=function(_0x42785a){while(--_0x42785a){_0x3642e7['push'](_0x3642e7['shift']());}};_0x39a68b(++_0x16878f);}(_0x9898,0x13c));var _0x8989=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x9898[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0x8989('0x0'));var util=require(_0x8989('0x1'));var moment=require(_0x8989('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8989('0x3'));var db=require(_0x8989('0x4'))['db'];var utils=require(_0x8989('0x5'));var logger=require(_0x8989('0x6'))(_0x8989('0x7'));var config=require(_0x8989('0x8'));var jayson=require(_0x8989('0x9'));var client=jayson[_0x8989('0xa')][_0x8989('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x295cee,_0x2a4b7e,_0x44c6d6){return new BPromise(function(_0x582000,_0x208e37){return client[_0x8989('0xc')](_0x295cee,_0x44c6d6)[_0x8989('0xd')](function(_0x13b7f4){logger[_0x8989('0xe')](_0x8989('0xf'),_0x2a4b7e,_0x8989('0x10'));logger['debug'](_0x8989('0x11'),_0x2a4b7e,'request\x20sent',JSON[_0x8989('0x12')](_0x13b7f4));if(_0x13b7f4[_0x8989('0x13')]){if(_0x13b7f4['error'][_0x8989('0x14')]===0x1f4){logger['error'](_0x8989('0xf'),_0x2a4b7e,_0x13b7f4[_0x8989('0x13')][_0x8989('0x15')]);return _0x208e37(_0x13b7f4[_0x8989('0x13')]['message']);}logger[_0x8989('0x13')]('Cdr,\x20%s,\x20%s',_0x2a4b7e,_0x13b7f4['error'][_0x8989('0x15')]);return _0x582000(_0x13b7f4['error'][_0x8989('0x15')]);}else{logger[_0x8989('0xe')](_0x8989('0xf'),_0x2a4b7e,_0x8989('0x10'));_0x582000(_0x13b7f4[_0x8989('0x16')][_0x8989('0x15')]);}})['catch'](function(_0x34d06c){logger[_0x8989('0x13')](_0x8989('0xf'),_0x2a4b7e,_0x34d06c);_0x208e37(_0x34d06c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 11296a4..412c831 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 _0x8ae5=['./cdr.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5130c1,_0x28c7ec){var _0x559148=function(_0x22bf1d){while(--_0x22bf1d){_0x5130c1['push'](_0x5130c1['shift']());}};_0x559148(++_0x28c7ec);}(_0x8ae5,0x1dd));var _0x58ae=function(_0x44ac0e,_0x30b3b8){_0x44ac0e=_0x44ac0e-0x0;var _0x101ac3=_0x8ae5[_0x44ac0e];return _0x101ac3;};'use strict';var multer=require(_0x58ae('0x0'));var util=require(_0x58ae('0x1'));var path=require(_0x58ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x58ae('0x3'));var router=express[_0x58ae('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x58ae('0x5'));var config=require(_0x58ae('0x6'));var controller=require(_0x58ae('0x7'));router['get']('/',auth[_0x58ae('0x8')](),controller[_0x58ae('0x9')]);router[_0x58ae('0xa')](_0x58ae('0xb'),auth[_0x58ae('0x8')](),controller[_0x58ae('0xc')]);router[_0x58ae('0xa')](_0x58ae('0xd'),auth[_0x58ae('0x8')](),controller[_0x58ae('0xe')]);router[_0x58ae('0xf')]('/',auth[_0x58ae('0x8')](),controller[_0x58ae('0x10')]);router[_0x58ae('0x11')](_0x58ae('0xd'),auth[_0x58ae('0x8')](),controller[_0x58ae('0x12')]);router[_0x58ae('0x13')](_0x58ae('0xd'),auth[_0x58ae('0x8')](),controller[_0x58ae('0x14')]);module[_0x58ae('0x15')]=router; \ No newline at end of file +var _0x446c=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cdr.controller','index','get','describe','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x554398,_0x397c92){var _0x4acb21=function(_0x3c9527){while(--_0x3c9527){_0x554398['push'](_0x554398['shift']());}};_0x4acb21(++_0x397c92);}(_0x446c,0x156));var _0xc446=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x446c[_0x59e862];return _0x1a25ee;};'use strict';var multer=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var path=require(_0xc446('0x2'));var timeout=require(_0xc446('0x3'));var express=require('express');var router=express[_0xc446('0x4')]();var auth=require(_0xc446('0x5'));var interaction=require(_0xc446('0x6'));var config=require('../../config/environment');var controller=require(_0xc446('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc446('0x8')]);router[_0xc446('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc446('0xa')]);router[_0xc446('0x9')](_0xc446('0xb'),auth[_0xc446('0xc')](),controller[_0xc446('0xd')]);router['post']('/',auth[_0xc446('0xc')](),controller[_0xc446('0xe')]);router[_0xc446('0xf')](_0xc446('0xb'),auth['isAuthenticated'](),controller[_0xc446('0x10')]);router[_0xc446('0x11')](_0xc446('0xb'),auth[_0xc446('0xc')](),controller[_0xc446('0x12')]);module[_0xc446('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 012c4a3..42c58c6 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 _0xdc6f=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x994dbd,_0x3e810c){var _0x49472f=function(_0x7335ba){while(--_0x7335ba){_0x994dbd['push'](_0x994dbd['shift']());}};_0x49472f(++_0x3e810c);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xdc6f[_0x80f51a];return _0x327148;};'use strict';var Sequelize=require(_0xfdc6('0x0'));module[_0xfdc6('0x1')]={'priority':{'type':Sequelize[_0xfdc6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfdc6('0x3')],'allowNull':![],'defaultValue':_0xfdc6('0x4')},'appdata':{'type':Sequelize[_0xfdc6('0x5')]()},'description':{'type':Sequelize[_0xfdc6('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x47cb=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x39eff6,_0x47ccb1){var _0x23d4ce=function(_0x2bf126){while(--_0x2bf126){_0x39eff6['push'](_0x39eff6['shift']());}};_0x23d4ce(++_0x47ccb1);}(_0x47cb,0x74));var _0xb47c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x47cb[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb47c('0x0'));module[_0xb47c('0x1')]={'priority':{'type':Sequelize[_0xb47c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb47c('0x3')],'allowNull':![],'defaultValue':_0xb47c('0x4')},'appdata':{'type':Sequelize[_0xb47c('0x5')]()},'description':{'type':Sequelize[_0xb47c('0x3')]},'interval':{'type':Sequelize[_0xb47c('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 8948d86..57c33bd 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 _0xa423=['ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','length','includeAll','merge','options','find','body','catch','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x30a592,_0x404d40){var _0x50f31b=function(_0xec951b){while(--_0xec951b){_0x30a592['push'](_0x30a592['shift']());}};_0x50f31b(++_0x404d40);}(_0xa423,0xf7));var _0x3a42=function(_0x40b09f,_0x161f4f){_0x40b09f=_0x40b09f-0x0;var _0x3dbee2=_0xa423[_0x40b09f];return _0x3dbee2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3a42('0x0'));var jsonpatch=require(_0x3a42('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a42('0x2'));var Mustache=require(_0x3a42('0x3'));var util=require(_0x3a42('0x4'));var path=require(_0x3a42('0x5'));var sox=require(_0x3a42('0x6'));var csv=require(_0x3a42('0x7'));var ejs=require(_0x3a42('0x8'));var fs=require('fs');var _=require(_0x3a42('0x9'));var squel=require(_0x3a42('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3a42('0x7'));var querystring=require(_0x3a42('0xb'));var Papa=require(_0x3a42('0xc'));var Redis=require(_0x3a42('0xd'));var authService=require(_0x3a42('0xe'));var qs=require(_0x3a42('0xf'));var hardwareService=require(_0x3a42('0x10'));var logger=require(_0x3a42('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e165d,_0x4a0a56){_0x4a0a56=_0x4a0a56||0xcc;return function(_0x49a590){if(_0x49a590){return _0x4e165d[_0x3a42('0x12')](_0x4a0a56);}return _0x4e165d[_0x3a42('0x13')](_0x4a0a56)[_0x3a42('0x14')]();};}function respondWithResult(_0x4512f4,_0x54573f){_0x54573f=_0x54573f||0xc8;return function(_0x98c8fa){if(_0x98c8fa){return _0x4512f4[_0x3a42('0x13')](_0x54573f)[_0x3a42('0x15')](_0x98c8fa);}};}function respondWithFilteredResult(_0x490563,_0x3c2e9d){return function(_0x4372ca){if(_0x4372ca){var _0x4e9861=_0x4372ca[_0x3a42('0x16')],_0x321e9f=_0x3c2e9d[_0x3a42('0x17')],_0x4485fa=_0x3c2e9d[_0x3a42('0x17')]+_0x3c2e9d['limit'],_0x1e1989;if(_0x4485fa>=_0x4e9861){_0x4485fa=_0x4e9861;_0x1e1989=0xc8;}else{_0x1e1989=0xce;}_0x490563[_0x3a42('0x13')](_0x1e1989);return _0x490563[_0x3a42('0x18')](_0x3a42('0x19'),_0x321e9f+'-'+_0x4485fa+'/'+_0x4e9861)[_0x3a42('0x15')](_0x4372ca);}return null;};}function patchUpdates(_0x56ed99){return function(_0x368116){try{jsonpatch[_0x3a42('0x1a')](_0x368116,_0x56ed99,!![]);}catch(_0x380549){return BPromise[_0x3a42('0x1b')](_0x380549);}return _0x368116[_0x3a42('0x1c')]();};}function saveUpdates(_0x279cbf,_0xfd483b){return function(_0xd5b2d9){if(_0xd5b2d9){return _0xd5b2d9[_0x3a42('0x1d')](_0x279cbf)[_0x3a42('0x1e')](function(_0x5e3bca){return _0x5e3bca;});}return null;};}function removeEntity(_0x222815,_0x166f9d){return function(_0x1c70b8){if(_0x1c70b8){return _0x1c70b8[_0x3a42('0x1f')]()['then'](function(){_0x222815[_0x3a42('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b035,_0x1a6fc1){return function(_0x5f2e4a){if(!_0x5f2e4a){_0x35b035[_0x3a42('0x12')](0x194);}return _0x5f2e4a;};}function handleError(_0x3f2403,_0x323669){_0x323669=_0x323669||0x1f4;return function(_0x2d068d){logger[_0x3a42('0x20')](_0x2d068d[_0x3a42('0x21')]);if(_0x2d068d[_0x3a42('0x22')]){delete _0x2d068d[_0x3a42('0x22')];}_0x3f2403[_0x3a42('0x13')](_0x323669)['send'](_0x2d068d);};}exports['show']=function(_0x451576,_0x31fbfe){var _0xa96c59={'raw':!![],'where':{'id':_0x451576[_0x3a42('0x23')]['id']}},_0x5cdd8d={};_0x5cdd8d['model']=_[_0x3a42('0x24')](db[_0x3a42('0x25')][_0x3a42('0x26')]);_0x5cdd8d[_0x3a42('0x27')]=_[_0x3a42('0x24')](_0x451576[_0x3a42('0x27')]);_0x5cdd8d[_0x3a42('0x28')]=_[_0x3a42('0x29')](_0x5cdd8d[_0x3a42('0x2a')],_0x5cdd8d[_0x3a42('0x27')]);_0xa96c59['attributes']=_[_0x3a42('0x29')](_0x5cdd8d[_0x3a42('0x2a')],qs['fields'](_0x451576['query']['fields']));_0xa96c59[_0x3a42('0x2b')]=_0xa96c59[_0x3a42('0x2b')][_0x3a42('0x2c')]?_0xa96c59[_0x3a42('0x2b')]:_0x5cdd8d[_0x3a42('0x2a')];if(_0x451576[_0x3a42('0x27')][_0x3a42('0x2d')]){_0xa96c59['include']=[{'all':!![]}];}_0xa96c59=_[_0x3a42('0x2e')]({},_0xa96c59,_0x451576[_0x3a42('0x2f')]);return db[_0x3a42('0x25')][_0x3a42('0x30')](_0xa96c59)[_0x3a42('0x1e')](handleEntityNotFound(_0x31fbfe,null))[_0x3a42('0x1e')](respondWithResult(_0x31fbfe,null))['catch'](handleError(_0x31fbfe,null));};exports[_0x3a42('0x1d')]=function(_0x5e8f29,_0x3cbcc8){if(_0x5e8f29[_0x3a42('0x31')]['id']){delete _0x5e8f29[_0x3a42('0x31')]['id'];}return db[_0x3a42('0x25')][_0x3a42('0x30')]({'where':{'id':_0x5e8f29[_0x3a42('0x23')]['id']}})[_0x3a42('0x1e')](handleEntityNotFound(_0x3cbcc8,null))[_0x3a42('0x1e')](saveUpdates(_0x5e8f29[_0x3a42('0x31')],null))[_0x3a42('0x1e')](respondWithResult(_0x3cbcc8,null))['catch'](handleError(_0x3cbcc8,null));};exports[_0x3a42('0x1f')]=function(_0x4450c9,_0x1742d7){return db[_0x3a42('0x25')][_0x3a42('0x30')]({'where':{'id':_0x4450c9[_0x3a42('0x23')]['id']}})[_0x3a42('0x1e')](handleEntityNotFound(_0x1742d7,null))[_0x3a42('0x1e')](removeEntity(_0x1742d7,null))[_0x3a42('0x32')](handleError(_0x1742d7,null));}; \ No newline at end of file +var _0x8da8=['include','options','ChatApplication','find','then','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','error','stack','name','show','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll'];(function(_0x4b50d3,_0x38ad37){var _0x2ee311=function(_0x57d46c){while(--_0x57d46c){_0x4b50d3['push'](_0x4b50d3['shift']());}};_0x2ee311(++_0x38ad37);}(_0x8da8,0xb0));var _0x88da=function(_0x35ace6,_0x56bde1){_0x35ace6=_0x35ace6-0x0;var _0x494243=_0x8da8[_0x35ace6];return _0x494243;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x88da('0x0'));var rimraf=require(_0x88da('0x1'));var zipdir=require(_0x88da('0x2'));var jsonpatch=require(_0x88da('0x3'));var rp=require(_0x88da('0x4'));var moment=require(_0x88da('0x5'));var BPromise=require(_0x88da('0x6'));var Mustache=require(_0x88da('0x7'));var util=require('util');var path=require(_0x88da('0x8'));var sox=require(_0x88da('0x9'));var csv=require('to-csv');var ejs=require(_0x88da('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x88da('0xb'));var crypto=require(_0x88da('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x88da('0xd'));var toCsv=require(_0x88da('0xe'));var querystring=require(_0x88da('0xf'));var Papa=require(_0x88da('0x10'));var Redis=require(_0x88da('0x11'));var authService=require(_0x88da('0x12'));var qs=require(_0x88da('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88da('0x14'))(_0x88da('0x15'));var utils=require('../../config/utils');var config=require(_0x88da('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1519cd,_0x4484e6){_0x4484e6=_0x4484e6||0xcc;return function(_0x5d8185){if(_0x5d8185){return _0x1519cd['sendStatus'](_0x4484e6);}return _0x1519cd['status'](_0x4484e6)[_0x88da('0x17')]();};}function respondWithResult(_0x15da16,_0x1acc7b){_0x1acc7b=_0x1acc7b||0xc8;return function(_0x110b0d){if(_0x110b0d){return _0x15da16[_0x88da('0x18')](_0x1acc7b)[_0x88da('0x19')](_0x110b0d);}};}function respondWithFilteredResult(_0x5d1e4f,_0x54fec5){return function(_0x3ee517){if(_0x3ee517){var _0x3109fd=_0x3ee517[_0x88da('0x1a')],_0x3b5e2f=_0x54fec5[_0x88da('0x1b')],_0x42ddfd=_0x54fec5['offset']+_0x54fec5[_0x88da('0x1c')],_0x475113;if(_0x42ddfd>=_0x3109fd){_0x42ddfd=_0x3109fd;_0x475113=0xc8;}else{_0x475113=0xce;}_0x5d1e4f[_0x88da('0x18')](_0x475113);return _0x5d1e4f[_0x88da('0x1d')](_0x88da('0x1e'),_0x3b5e2f+'-'+_0x42ddfd+'/'+_0x3109fd)[_0x88da('0x19')](_0x3ee517);}return null;};}function patchUpdates(_0x537b7b){return function(_0x52b23f){try{jsonpatch['apply'](_0x52b23f,_0x537b7b,!![]);}catch(_0x246a9d){return BPromise[_0x88da('0x1f')](_0x246a9d);}return _0x52b23f[_0x88da('0x20')]();};}function saveUpdates(_0x16d951,_0x45c43d){return function(_0x13ffe6){if(_0x13ffe6){return _0x13ffe6[_0x88da('0x21')](_0x16d951)['then'](function(_0x3d13ff){return _0x3d13ff;});}return null;};}function removeEntity(_0x10c9ab,_0x552ca4){return function(_0x5f80cf){if(_0x5f80cf){return _0x5f80cf['destroy']()['then'](function(){_0x10c9ab[_0x88da('0x18')](0xcc)[_0x88da('0x17')]();});}};}function handleEntityNotFound(_0x23b05a,_0xa4a009){return function(_0x2c03c6){if(!_0x2c03c6){_0x23b05a['sendStatus'](0x194);}return _0x2c03c6;};}function handleError(_0x5db60c,_0x3d3f5c){_0x3d3f5c=_0x3d3f5c||0x1f4;return function(_0x2a911e){logger[_0x88da('0x22')](_0x2a911e[_0x88da('0x23')]);if(_0x2a911e[_0x88da('0x24')]){delete _0x2a911e[_0x88da('0x24')];}_0x5db60c[_0x88da('0x18')](_0x3d3f5c)['send'](_0x2a911e);};}exports[_0x88da('0x25')]=function(_0x59cdaa,_0x374611){var _0x12113a={'raw':!![],'where':{'id':_0x59cdaa['params']['id']}},_0x1933ac={};_0x1933ac[_0x88da('0x26')]=_[_0x88da('0x27')](db['ChatApplication'][_0x88da('0x28')]);_0x1933ac[_0x88da('0x29')]=_['keys'](_0x59cdaa[_0x88da('0x29')]);_0x1933ac[_0x88da('0x2a')]=_[_0x88da('0x2b')](_0x1933ac[_0x88da('0x26')],_0x1933ac['query']);_0x12113a['attributes']=_[_0x88da('0x2b')](_0x1933ac[_0x88da('0x26')],qs[_0x88da('0x2c')](_0x59cdaa[_0x88da('0x29')]['fields']));_0x12113a[_0x88da('0x2d')]=_0x12113a[_0x88da('0x2d')][_0x88da('0x2e')]?_0x12113a[_0x88da('0x2d')]:_0x1933ac[_0x88da('0x26')];if(_0x59cdaa[_0x88da('0x29')][_0x88da('0x2f')]){_0x12113a[_0x88da('0x30')]=[{'all':!![]}];}_0x12113a=_['merge']({},_0x12113a,_0x59cdaa[_0x88da('0x31')]);return db[_0x88da('0x32')][_0x88da('0x33')](_0x12113a)[_0x88da('0x34')](handleEntityNotFound(_0x374611,null))[_0x88da('0x34')](respondWithResult(_0x374611,null))[_0x88da('0x35')](handleError(_0x374611,null));};exports[_0x88da('0x21')]=function(_0xbe2646,_0x44ba5b){if(_0xbe2646['body']['id']){delete _0xbe2646[_0x88da('0x36')]['id'];}return db[_0x88da('0x32')]['find']({'where':{'id':_0xbe2646['params']['id']}})[_0x88da('0x34')](handleEntityNotFound(_0x44ba5b,null))[_0x88da('0x34')](saveUpdates(_0xbe2646['body'],null))['then'](respondWithResult(_0x44ba5b,null))[_0x88da('0x35')](handleError(_0x44ba5b,null));};exports[_0x88da('0x37')]=function(_0x53b47e,_0x3dad96){return db[_0x88da('0x32')][_0x88da('0x33')]({'where':{'id':_0x53b47e['params']['id']}})[_0x88da('0x34')](handleEntityNotFound(_0x3dad96,null))[_0x88da('0x34')](removeEntity(_0x3dad96,null))['catch'](handleError(_0x3dad96,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9706414..07a1692 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 _0xc32f=['exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0xc32f,0x1ef));var _0xfc32=function(_0x5d606c,_0x3dacb4){_0x5d606c=_0x5d606c-0x0;var _0x1ae7ed=_0xc32f[_0x5d606c];return _0x1ae7ed;};'use strict';var _=require(_0xfc32('0x0'));var util=require('util');var logger=require(_0xfc32('0x1'))(_0xfc32('0x2'));var moment=require(_0xfc32('0x3'));var BPromise=require(_0xfc32('0x4'));var rp=require(_0xfc32('0x5'));var fs=require('fs');var path=require(_0xfc32('0x6'));var rimraf=require(_0xfc32('0x7'));var config=require('../../config/environment');var attributes=require(_0xfc32('0x8'));module[_0xfc32('0x9')]=function(_0x4a7d82,_0x251a03){return _0x4a7d82[_0xfc32('0xa')]('ChatApplication',attributes,{'tableName':_0xfc32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc32('0xc'),'collate':_0xfc32('0xd')});}; \ No newline at end of file +var _0xb042=['../../config/environment','./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1c5f73,_0x596cdf){var _0xfd7895=function(_0x4a5f3a){while(--_0x4a5f3a){_0x1c5f73['push'](_0x1c5f73['shift']());}};_0xfd7895(++_0x596cdf);}(_0xb042,0x9f));var _0x2b04=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xb042[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x2b04('0x0'));var util=require('util');var logger=require(_0x2b04('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2b04('0x2'));var rp=require(_0x2b04('0x3'));var fs=require('fs');var path=require(_0x2b04('0x4'));var rimraf=require(_0x2b04('0x5'));var config=require(_0x2b04('0x6'));var attributes=require(_0x2b04('0x7'));module['exports']=function(_0xbdd9fa,_0x43478d){return _0xbdd9fa['define'](_0x2b04('0x8'),attributes,{'tableName':_0x2b04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b04('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index c2467ee..ab0fad1 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 _0x4442=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2fd873,_0x51262f){var _0x23e544=function(_0x107c74){while(--_0x107c74){_0x2fd873['push'](_0x2fd873['shift']());}};_0x23e544(++_0x51262f);}(_0x4442,0x1a6));var _0x2444=function(_0x164b60,_0x4af99c){_0x164b60=_0x164b60-0x0;var _0x4b4251=_0x4442[_0x164b60];return _0x4b4251;};'use strict';var _=require('lodash');var util=require(_0x2444('0x0'));var moment=require(_0x2444('0x1'));var BPromise=require(_0x2444('0x2'));var rs=require(_0x2444('0x3'));var fs=require('fs');var Redis=require(_0x2444('0x4'));var db=require(_0x2444('0x5'))['db'];var utils=require(_0x2444('0x6'));var logger=require(_0x2444('0x7'))(_0x2444('0x8'));var config=require('../../config/environment');var jayson=require(_0x2444('0x9'));var client=jayson[_0x2444('0xa')][_0x2444('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f16bd,_0x11aa55,_0x52c50d){return new BPromise(function(_0x1bbce8,_0x35255d){return client[_0x2444('0xc')](_0x1f16bd,_0x52c50d)['then'](function(_0x4656d9){logger['info'](_0x2444('0xd'),_0x11aa55,_0x2444('0xe'));logger[_0x2444('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x11aa55,_0x2444('0xe'),JSON[_0x2444('0x10')](_0x4656d9));if(_0x4656d9[_0x2444('0x11')]){if(_0x4656d9[_0x2444('0x11')][_0x2444('0x12')]===0x1f4){logger[_0x2444('0x11')]('ChatApplication,\x20%s,\x20%s',_0x11aa55,_0x4656d9['error']['message']);return _0x35255d(_0x4656d9[_0x2444('0x11')][_0x2444('0x13')]);}logger[_0x2444('0x11')]('ChatApplication,\x20%s,\x20%s',_0x11aa55,_0x4656d9[_0x2444('0x11')]['message']);return _0x1bbce8(_0x4656d9[_0x2444('0x11')][_0x2444('0x13')]);}else{logger['info'](_0x2444('0xd'),_0x11aa55,'request\x20sent');_0x1bbce8(_0x4656d9[_0x2444('0x14')][_0x2444('0x13')]);}})['catch'](function(_0x44dec6){logger['error'](_0x2444('0xd'),_0x11aa55,_0x44dec6);_0x35255d(_0x44dec6);});});} \ No newline at end of file +var _0x4917=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x55d3cf,_0x2404f5){var _0x383517=function(_0x278a4e){while(--_0x278a4e){_0x55d3cf['push'](_0x55d3cf['shift']());}};_0x383517(++_0x2404f5);}(_0x4917,0x11f));var _0x7491=function(_0x411dc3,_0x447538){_0x411dc3=_0x411dc3-0x0;var _0x3265f2=_0x4917[_0x411dc3];return _0x3265f2;};'use strict';var _=require(_0x7491('0x0'));var util=require(_0x7491('0x1'));var moment=require(_0x7491('0x2'));var BPromise=require(_0x7491('0x3'));var rs=require(_0x7491('0x4'));var fs=require('fs');var Redis=require(_0x7491('0x5'));var db=require(_0x7491('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7491('0x7'));var config=require('../../config/environment');var jayson=require(_0x7491('0x8'));var client=jayson[_0x7491('0x9')][_0x7491('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5849b5,_0x545449,_0x550110){return new BPromise(function(_0x11dee3,_0x4a1509){return client['request'](_0x5849b5,_0x550110)[_0x7491('0xb')](function(_0x2db204){logger[_0x7491('0xc')](_0x7491('0xd'),_0x545449,'request\x20sent');logger[_0x7491('0xe')](_0x7491('0xf'),_0x545449,_0x7491('0x10'),JSON[_0x7491('0x11')](_0x2db204));if(_0x2db204['error']){if(_0x2db204[_0x7491('0x12')][_0x7491('0x13')]===0x1f4){logger[_0x7491('0x12')](_0x7491('0xd'),_0x545449,_0x2db204[_0x7491('0x12')][_0x7491('0x14')]);return _0x4a1509(_0x2db204[_0x7491('0x12')][_0x7491('0x14')]);}logger[_0x7491('0x12')](_0x7491('0xd'),_0x545449,_0x2db204[_0x7491('0x12')]['message']);return _0x11dee3(_0x2db204[_0x7491('0x12')][_0x7491('0x14')]);}else{logger[_0x7491('0xc')](_0x7491('0xd'),_0x545449,_0x7491('0x10'));_0x11dee3(_0x2db204[_0x7491('0x15')]['message']);}})['catch'](function(_0x4c5afc){logger[_0x7491('0x12')](_0x7491('0xd'),_0x545449,_0x4c5afc);_0x4a1509(_0x4c5afc);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 520b827..771863e 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 _0x4ca8=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2c7a25,_0x554a02){var _0xf4d214=function(_0x8e6a7f){while(--_0x8e6a7f){_0x2c7a25['push'](_0x2c7a25['shift']());}};_0xf4d214(++_0x554a02);}(_0x4ca8,0x19a));var _0x84ca=function(_0x3f9364,_0x4c4040){_0x3f9364=_0x3f9364-0x0;var _0x5a315d=_0x4ca8[_0x3f9364];return _0x5a315d;};'use strict';var multer=require(_0x84ca('0x0'));var util=require('util');var path=require(_0x84ca('0x1'));var timeout=require(_0x84ca('0x2'));var express=require(_0x84ca('0x3'));var router=express[_0x84ca('0x4')]();var auth=require(_0x84ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x84ca('0x6'));var controller=require(_0x84ca('0x7'));router[_0x84ca('0x8')](_0x84ca('0x9'),auth[_0x84ca('0xa')](),controller[_0x84ca('0xb')]);router[_0x84ca('0xc')](_0x84ca('0x9'),auth[_0x84ca('0xa')](),controller[_0x84ca('0xd')]);router['delete'](_0x84ca('0x9'),auth['isAuthenticated'](),controller[_0x84ca('0xe')]);module[_0x84ca('0xf')]=router; \ No newline at end of file +var _0xbbad=['put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x352691,_0x16c7c7){var _0x45129b=function(_0x35c9cc){while(--_0x35c9cc){_0x352691['push'](_0x352691['shift']());}};_0x45129b(++_0x16c7c7);}(_0xbbad,0x124));var _0xdbba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbad[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xdbba('0x0'));var path=require(_0xdbba('0x1'));var timeout=require(_0xdbba('0x2'));var express=require(_0xdbba('0x3'));var router=express[_0xdbba('0x4')]();var auth=require(_0xdbba('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdbba('0x6'));var controller=require(_0xdbba('0x7'));router[_0xdbba('0x8')](_0xdbba('0x9'),auth[_0xdbba('0xa')](),controller[_0xdbba('0xb')]);router[_0xdbba('0xc')]('/:id',auth[_0xdbba('0xa')](),controller['update']);router[_0xdbba('0xd')](_0xdbba('0x9'),auth[_0xdbba('0xa')](),controller[_0xdbba('0xe')]);module[_0xdbba('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 323f7c4..13c4dde 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 _0xa7bd=['BOOLEAN','sequelize','STRING'];(function(_0xc4ca37,_0x2eff7f){var _0x5db11f=function(_0x377f2a){while(--_0x377f2a){_0xc4ca37['push'](_0xc4ca37['shift']());}};_0x5db11f(++_0x2eff7f);}(_0xa7bd,0xf7));var _0xda7b=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0xa7bd[_0x541260];return _0x1dd2b5;};'use strict';var Sequelize=require(_0xda7b('0x0'));module['exports']={'name':{'type':Sequelize[_0xda7b('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xda7b('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xff2d=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff2d,0x1d7));var _0xdff2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xff2d[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xdff2('0x0'));module[_0xdff2('0x1')]={'name':{'type':Sequelize[_0xdff2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdff2('0x2')]},'write':{'type':Sequelize[_0xdff2('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 f1121c5..fbaa305 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 _0xff62=['find','create','body','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','pick','nolimit','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','limit','Content-Range','reject','save','destroy','stack','name','send','ChatGroup','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','count','include','findAll','rows','catch','show','params','includeAll'];(function(_0x476392,_0x43d678){var _0x25d9f4=function(_0x4a0426){while(--_0x4a0426){_0x476392['push'](_0x476392['shift']());}};_0x25d9f4(++_0x43d678);}(_0xff62,0xe4));var _0x2ff6=function(_0x4227a7,_0x25f238){_0x4227a7=_0x4227a7-0x0;var _0x53e4fa=_0xff62[_0x4227a7];return _0x53e4fa;};'use strict';var pdf=require(_0x2ff6('0x0'));var emlformat=require(_0x2ff6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2ff6('0x2'));var jsonpatch=require(_0x2ff6('0x3'));var rp=require(_0x2ff6('0x4'));var moment=require('moment');var BPromise=require(_0x2ff6('0x5'));var Mustache=require(_0x2ff6('0x6'));var util=require(_0x2ff6('0x7'));var path=require('path');var sox=require(_0x2ff6('0x8'));var csv=require('to-csv');var ejs=require(_0x2ff6('0x9'));var fs=require('fs');var _=require(_0x2ff6('0xa'));var squel=require(_0x2ff6('0xb'));var crypto=require('crypto');var jsforce=require(_0x2ff6('0xc'));var deskjs=require(_0x2ff6('0xd'));var toCsv=require(_0x2ff6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2ff6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2ff6('0x10'));var hardwareService=require(_0x2ff6('0x11'));var logger=require('../../config/logger')(_0x2ff6('0x12'));var utils=require('../../config/utils');var config=require(_0x2ff6('0x13'));var db=require(_0x2ff6('0x14'))['db'];config[_0x2ff6('0x15')]=_[_0x2ff6('0x16')](config[_0x2ff6('0x15')],{'host':_0x2ff6('0x17'),'port':0x18eb});var socket=require(_0x2ff6('0x18'))(new Redis(config[_0x2ff6('0x15')]));require(_0x2ff6('0x19'))['register'](socket);var jayson=require(_0x2ff6('0x1a'));var client=jayson['client'][_0x2ff6('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xfb483f,_0x1f1105,_0x23560f){if(_0x23560f){var _0x23d46f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23d46f[_0x2ff6('0x1c')](_0x1f1105)){return _0xfb483f;}else{throw new Error(_0x2ff6('0x1d'));}}else{return _0xfb483f;}}function respondWithRpcPromise(_0x49c222,_0x49ea7c,_0x297032,_0x4c4e72){return new BPromise(function(_0x524a7c,_0x255c01){var _0x18d5c9=_0x4c4e72||client;return _0x18d5c9[_0x2ff6('0x1e')](_0x49c222,_0x297032)[_0x2ff6('0x1f')](function(_0x2fe325){logger[_0x2ff6('0x20')](_0x2ff6('0x21'),_0x49ea7c,_0x2ff6('0x22'));logger[_0x2ff6('0x23')](_0x2ff6('0x24'),_0x49ea7c,_0x2ff6('0x22'),JSON[_0x2ff6('0x25')](_0x2fe325));if(_0x2fe325[_0x2ff6('0x26')]){if(_0x2fe325[_0x2ff6('0x26')][_0x2ff6('0x27')]===0x1f4){logger[_0x2ff6('0x26')](_0x2ff6('0x21'),_0x49ea7c,_0x2fe325[_0x2ff6('0x26')][_0x2ff6('0x28')]);return _0x255c01(_0x2fe325[_0x2ff6('0x26')][_0x2ff6('0x28')]);}logger[_0x2ff6('0x26')]('ChatGroup,\x20%s,\x20%s',_0x49ea7c,_0x2fe325['error'][_0x2ff6('0x28')]);return _0x524a7c(_0x2fe325[_0x2ff6('0x26')][_0x2ff6('0x28')]);}else{logger[_0x2ff6('0x20')]('ChatGroup,\x20%s,\x20%s',_0x49ea7c,_0x2ff6('0x22'));_0x524a7c(_0x2fe325[_0x2ff6('0x29')][_0x2ff6('0x28')]);}})['catch'](function(_0x28a4ae){logger[_0x2ff6('0x26')](_0x2ff6('0x21'),_0x49ea7c,_0x28a4ae);_0x255c01(_0x28a4ae);});});}function respondWithStatusCode(_0x4bdadb,_0x4edb68){_0x4edb68=_0x4edb68||0xcc;return function(_0x5ad8e2){if(_0x5ad8e2){return _0x4bdadb[_0x2ff6('0x2a')](_0x4edb68);}return _0x4bdadb['status'](_0x4edb68)['end']();};}function respondWithResult(_0xd0d348,_0x1f7b7b){_0x1f7b7b=_0x1f7b7b||0xc8;return function(_0x5560f0){if(_0x5560f0){return _0xd0d348[_0x2ff6('0x2b')](_0x1f7b7b)[_0x2ff6('0x2c')](_0x5560f0);}};}function respondWithFilteredResult(_0x44af72,_0x1cd837){return function(_0x571f6f){if(_0x571f6f){var _0x455f05=_0x571f6f['count'],_0x93c194=_0x1cd837[_0x2ff6('0x2d')],_0x98a7a4=_0x1cd837[_0x2ff6('0x2d')]+_0x1cd837[_0x2ff6('0x2e')],_0x55586e;if(_0x98a7a4>=_0x455f05){_0x98a7a4=_0x455f05;_0x55586e=0xc8;}else{_0x55586e=0xce;}_0x44af72[_0x2ff6('0x2b')](_0x55586e);return _0x44af72['set'](_0x2ff6('0x2f'),_0x93c194+'-'+_0x98a7a4+'/'+_0x455f05)[_0x2ff6('0x2c')](_0x571f6f);}return null;};}function patchUpdates(_0x12542d){return function(_0x4b42a5){try{jsonpatch['apply'](_0x4b42a5,_0x12542d,!![]);}catch(_0x508dd1){return BPromise[_0x2ff6('0x30')](_0x508dd1);}return _0x4b42a5[_0x2ff6('0x31')]();};}function saveUpdates(_0x55dccc,_0x45a5b7){return function(_0x43e117){if(_0x43e117){return _0x43e117['update'](_0x55dccc)[_0x2ff6('0x1f')](function(_0x3c31af){return _0x3c31af;});}return null;};}function removeEntity(_0x5dcdbc,_0x5da6e0){return function(_0x14aba4){if(_0x14aba4){return _0x14aba4[_0x2ff6('0x32')]()['then'](function(){_0x5dcdbc[_0x2ff6('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cb2eb,_0x1ae902){return function(_0xa64697){if(!_0xa64697){_0x3cb2eb[_0x2ff6('0x2a')](0x194);}return _0xa64697;};}function handleError(_0x455416,_0x2b3428){_0x2b3428=_0x2b3428||0x1f4;return function(_0x405357){logger[_0x2ff6('0x26')](_0x405357[_0x2ff6('0x33')]);if(_0x405357[_0x2ff6('0x34')]){delete _0x405357[_0x2ff6('0x34')];}_0x455416[_0x2ff6('0x2b')](_0x2b3428)[_0x2ff6('0x35')](_0x405357);};}exports['index']=function(_0x30dd0f,_0x229fa2){var _0x5246c7={},_0x2ed415={},_0x38b279={'count':0x0,'rows':[]};var _0x17618f=db[_0x2ff6('0x36')][_0x2ff6('0x37')];_0x2ed415[_0x2ff6('0x38')]=_[_0x2ff6('0x39')](_0x17618f);_0x2ed415[_0x2ff6('0x3a')]=_['keys'](_0x30dd0f['query']);_0x2ed415[_0x2ff6('0x3b')]=_[_0x2ff6('0x3c')](_0x2ed415[_0x2ff6('0x38')],_0x2ed415[_0x2ff6('0x3a')]);_0x5246c7[_0x2ff6('0x3d')]=_[_0x2ff6('0x3c')](_0x2ed415['model'],qs[_0x2ff6('0x3e')](_0x30dd0f[_0x2ff6('0x3a')][_0x2ff6('0x3e')]));_0x5246c7[_0x2ff6('0x3d')]=_0x5246c7['attributes'][_0x2ff6('0x3f')]?_0x5246c7['attributes']:_0x2ed415['model'];if(!_0x30dd0f[_0x2ff6('0x3a')][_0x2ff6('0x40')]('nolimit')){_0x5246c7[_0x2ff6('0x2e')]=qs['limit'](_0x30dd0f['query'][_0x2ff6('0x2e')]);_0x5246c7[_0x2ff6('0x2d')]=qs['offset'](_0x30dd0f[_0x2ff6('0x3a')][_0x2ff6('0x2d')]);}_0x5246c7[_0x2ff6('0x41')]=qs[_0x2ff6('0x42')](_0x30dd0f[_0x2ff6('0x3a')][_0x2ff6('0x42')]);_0x5246c7[_0x2ff6('0x43')]=qs[_0x2ff6('0x3b')](_['pick'](_0x30dd0f[_0x2ff6('0x3a')],_0x2ed415['filters']));if(_0x30dd0f[_0x2ff6('0x3a')][_0x2ff6('0x44')]){_0x5246c7['where']=_['merge'](_0x5246c7['where'],{'$or':_[_0x2ff6('0x45')](_0x17618f,function(_0x5f2a71){if(_0x5f2a71[_0x2ff6('0x46')][_0x2ff6('0x47')]!==_0x2ff6('0x48')){var _0x236e32={};_0x236e32[_0x5f2a71[_0x2ff6('0x49')]]={'$like':'%'+_0x30dd0f[_0x2ff6('0x3a')][_0x2ff6('0x44')]+'%'};return _0x236e32;}})});}_0x5246c7=_[_0x2ff6('0x4a')]({},_0x5246c7,_0x30dd0f[_0x2ff6('0x4b')]);var _0x4d959d={'where':_0x5246c7[_0x2ff6('0x43')]};return db[_0x2ff6('0x36')][_0x2ff6('0x4c')](_0x4d959d)[_0x2ff6('0x1f')](function(_0x2d639c){_0x38b279['count']=_0x2d639c;if(_0x30dd0f[_0x2ff6('0x3a')]['includeAll']){_0x5246c7[_0x2ff6('0x4d')]=[{'all':!![]}];}return db['ChatGroup'][_0x2ff6('0x4e')](_0x5246c7);})[_0x2ff6('0x1f')](function(_0xe7ed73){_0x38b279[_0x2ff6('0x4f')]=_0xe7ed73;return _0x38b279;})[_0x2ff6('0x1f')](respondWithFilteredResult(_0x229fa2,_0x5246c7))[_0x2ff6('0x50')](handleError(_0x229fa2,null));};exports[_0x2ff6('0x51')]=function(_0xca7cd4,_0x3b359d){var _0x3b443b={'raw':!![],'where':{'id':_0xca7cd4[_0x2ff6('0x52')]['id']}},_0x59d0b6={};_0x59d0b6[_0x2ff6('0x38')]=_[_0x2ff6('0x39')](db['ChatGroup'][_0x2ff6('0x37')]);_0x59d0b6[_0x2ff6('0x3a')]=_[_0x2ff6('0x39')](_0xca7cd4[_0x2ff6('0x3a')]);_0x59d0b6[_0x2ff6('0x3b')]=_[_0x2ff6('0x3c')](_0x59d0b6[_0x2ff6('0x38')],_0x59d0b6['query']);_0x3b443b['attributes']=_[_0x2ff6('0x3c')](_0x59d0b6[_0x2ff6('0x38')],qs[_0x2ff6('0x3e')](_0xca7cd4[_0x2ff6('0x3a')][_0x2ff6('0x3e')]));_0x3b443b[_0x2ff6('0x3d')]=_0x3b443b[_0x2ff6('0x3d')][_0x2ff6('0x3f')]?_0x3b443b[_0x2ff6('0x3d')]:_0x59d0b6['model'];if(_0xca7cd4[_0x2ff6('0x3a')][_0x2ff6('0x53')]){_0x3b443b[_0x2ff6('0x4d')]=[{'all':!![]}];}_0x3b443b=_[_0x2ff6('0x4a')]({},_0x3b443b,_0xca7cd4['options']);return db[_0x2ff6('0x36')][_0x2ff6('0x54')](_0x3b443b)['then'](handleEntityNotFound(_0x3b359d,null))[_0x2ff6('0x1f')](respondWithResult(_0x3b359d,null))[_0x2ff6('0x50')](handleError(_0x3b359d,null));};exports['create']=function(_0x530fd3,_0x28c41c){return db[_0x2ff6('0x36')][_0x2ff6('0x55')](_0x530fd3[_0x2ff6('0x56')],{})[_0x2ff6('0x1f')](respondWithResult(_0x28c41c,0xc9))['catch'](handleError(_0x28c41c,null));};exports['update']=function(_0x818554,_0x5e1a34){if(_0x818554[_0x2ff6('0x56')]['id']){delete _0x818554[_0x2ff6('0x56')]['id'];}return db[_0x2ff6('0x36')][_0x2ff6('0x54')]({'where':{'id':_0x818554['params']['id']}})[_0x2ff6('0x1f')](handleEntityNotFound(_0x5e1a34,null))[_0x2ff6('0x1f')](saveUpdates(_0x818554[_0x2ff6('0x56')],null))[_0x2ff6('0x1f')](respondWithResult(_0x5e1a34,null))[_0x2ff6('0x50')](handleError(_0x5e1a34,null));};exports['destroy']=function(_0x8d3886,_0x3e939b){return db[_0x2ff6('0x36')][_0x2ff6('0x54')]({'where':{'id':_0x8d3886[_0x2ff6('0x52')]['id']}})[_0x2ff6('0x1f')](handleEntityNotFound(_0x3e939b,null))[_0x2ff6('0x1f')](removeEntity(_0x3e939b,null))[_0x2ff6('0x50')](handleError(_0x3e939b,null));};exports['describe']=function(_0x2a88b2,_0x257145){return db[_0x2ff6('0x36')]['describe']()[_0x2ff6('0x1f')](respondWithResult(_0x257145,null))[_0x2ff6('0x50')](handleError(_0x257145,null));};exports[_0x2ff6('0x57')]=function(_0x24394a,_0x32adb4,_0x10aefd){return db[_0x2ff6('0x58')][_0x2ff6('0x4c')]({'where':{'ChatGroupId':_0x24394a[_0x2ff6('0x52')]['id'],'ToId':_0x24394a[_0x2ff6('0x59')]['id'],'read':![]}})[_0x2ff6('0x1f')](function(_0x11ac67){return{'id':_[_0x2ff6('0x5a')](_0x24394a[_0x2ff6('0x52')]['id']),'count':_0x11ac67};})[_0x2ff6('0x1f')](respondWithResult(_0x32adb4,null))['catch'](handleError(_0x32adb4,null));};exports['addMembers']=function(_0x35e407,_0x2ac5e3,_0x3d9139){return db[_0x2ff6('0x36')]['find']({'where':{'id':_0x35e407[_0x2ff6('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ac5e3,null))['then'](function(_0xb34b7a){if(_0xb34b7a){return _0xb34b7a[_0x2ff6('0x5b')](_0x35e407[_0x2ff6('0x56')][_0x2ff6('0x5c')],_[_0x2ff6('0x5d')](_0x35e407[_0x2ff6('0x56')],[_0x2ff6('0x5c'),'id'])||{});}})[_0x2ff6('0x1f')](respondWithResult(_0x2ac5e3,null))[_0x2ff6('0x50')](handleError(_0x2ac5e3,null));};exports[_0x2ff6('0x5e')]=function(_0x2089db,_0x330bc7,_0x69beb1){var _0x5bf87b={};var _0x8cfd83={};var _0x21a5e8;var _0x29226a;return db[_0x2ff6('0x36')]['findOne']({'where':{'id':_0x2089db[_0x2ff6('0x52')]['id']}})[_0x2ff6('0x1f')](handleEntityNotFound(_0x330bc7,null))['then'](function(_0x461c23){if(_0x461c23){_0x21a5e8=_0x461c23;_0x8cfd83[_0x2ff6('0x38')]=_['keys'](db['User'][_0x2ff6('0x37')]);_0x8cfd83[_0x2ff6('0x3a')]=_[_0x2ff6('0x39')](_0x2089db[_0x2ff6('0x3a')]);_0x8cfd83[_0x2ff6('0x3b')]=_[_0x2ff6('0x3c')](_0x8cfd83[_0x2ff6('0x38')],_0x8cfd83[_0x2ff6('0x3a')]);_0x5bf87b[_0x2ff6('0x3d')]=_['intersection'](_0x8cfd83[_0x2ff6('0x38')],qs['fields'](_0x2089db['query'][_0x2ff6('0x3e')]));_0x5bf87b['attributes']=_0x5bf87b[_0x2ff6('0x3d')][_0x2ff6('0x3f')]?_0x5bf87b[_0x2ff6('0x3d')]:_0x8cfd83[_0x2ff6('0x38')];_0x5bf87b[_0x2ff6('0x41')]=qs[_0x2ff6('0x42')](_0x2089db[_0x2ff6('0x3a')][_0x2ff6('0x42')]);_0x5bf87b[_0x2ff6('0x43')]=qs[_0x2ff6('0x3b')](_[_0x2ff6('0x5f')](_0x2089db[_0x2ff6('0x3a')],_0x8cfd83[_0x2ff6('0x3b')]));if(_0x2089db[_0x2ff6('0x3a')][_0x2ff6('0x44')]){_0x5bf87b[_0x2ff6('0x43')]=_[_0x2ff6('0x4a')](_0x5bf87b[_0x2ff6('0x43')],{'$or':_[_0x2ff6('0x45')](_0x5bf87b[_0x2ff6('0x3d')],function(_0x5d1e6d){var _0x585762={};_0x585762[_0x5d1e6d]={'$like':'%'+_0x2089db[_0x2ff6('0x3a')][_0x2ff6('0x44')]+'%'};return _0x585762;})});}_0x5bf87b=_[_0x2ff6('0x4a')]({},_0x5bf87b,_0x2089db['options']);return _0x21a5e8[_0x2ff6('0x5e')](_0x5bf87b);}})[_0x2ff6('0x1f')](function(_0x11095d){if(_0x11095d){_0x29226a=_0x11095d[_0x2ff6('0x3f')];if(!_0x2089db[_0x2ff6('0x3a')][_0x2ff6('0x40')](_0x2ff6('0x60'))){_0x5bf87b[_0x2ff6('0x2e')]=qs[_0x2ff6('0x2e')](_0x2089db[_0x2ff6('0x3a')][_0x2ff6('0x2e')]);_0x5bf87b[_0x2ff6('0x2d')]=qs[_0x2ff6('0x2d')](_0x2089db['query'][_0x2ff6('0x2d')]);}return _0x21a5e8[_0x2ff6('0x5e')](_0x5bf87b);}})[_0x2ff6('0x1f')](function(_0x1f667d){if(_0x1f667d){return _0x1f667d?{'count':_0x29226a,'rows':_0x1f667d}:null;}})['then'](respondWithResult(_0x330bc7,null))[_0x2ff6('0x50')](handleError(_0x330bc7,null));};exports['removeMembers']=function(_0x5d91ad,_0x9e5dbf,_0x35985b){return db[_0x2ff6('0x36')][_0x2ff6('0x54')]({'where':{'id':_0x5d91ad[_0x2ff6('0x52')]['id']}})[_0x2ff6('0x1f')](handleEntityNotFound(_0x9e5dbf,null))[_0x2ff6('0x1f')](function(_0x85ddb8){if(_0x85ddb8){return _0x85ddb8[_0x2ff6('0x61')](_0x5d91ad['query'][_0x2ff6('0x5c')]);}})[_0x2ff6('0x1f')](respondWithStatusCode(_0x9e5dbf,null))[_0x2ff6('0x50')](handleError(_0x9e5dbf,null));};exports['addMessage']=function(_0x256c95,_0xefec6f,_0x1bd796){if(_0x256c95['body']['id']){delete _0x256c95[_0x2ff6('0x56')]['id'];}return db['ChatGroup'][_0x2ff6('0x54')]({'where':{'id':_0x256c95['params']['id']}})[_0x2ff6('0x1f')](handleEntityNotFound(_0xefec6f,null))[_0x2ff6('0x1f')](function(_0x2baee4){if(_0x2baee4){_0x256c95[_0x2ff6('0x56')][_0x2ff6('0x62')]=_0x2baee4['id'];return db['ChatInternalMessage'][_0x2ff6('0x55')](_0x256c95['body']);}})['then'](respondWithResult(_0xefec6f,null))['catch'](handleError(_0xefec6f,null));};exports[_0x2ff6('0x63')]=function(_0x3d432c,_0x4034f4,_0x3eceb4){var _0x4c3bc8={};var _0x238164={};var _0xc0b9d3;var _0x47bf95;return db['ChatGroup']['findOne']({'where':{'id':_0x3d432c[_0x2ff6('0x52')]['id']}})[_0x2ff6('0x1f')](handleEntityNotFound(_0x4034f4,null))['then'](function(_0xfe39cc){if(_0xfe39cc){_0xc0b9d3=_0xfe39cc;_0x238164[_0x2ff6('0x38')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x238164[_0x2ff6('0x3a')]=_[_0x2ff6('0x39')](_0x3d432c['query']);_0x238164[_0x2ff6('0x3b')]=_[_0x2ff6('0x3c')](_0x238164[_0x2ff6('0x38')],_0x238164[_0x2ff6('0x3a')]);_0x4c3bc8[_0x2ff6('0x3d')]=_[_0x2ff6('0x3c')](_0x238164[_0x2ff6('0x38')],qs[_0x2ff6('0x3e')](_0x3d432c[_0x2ff6('0x3a')]['fields']));_0x4c3bc8[_0x2ff6('0x3d')]=_0x4c3bc8[_0x2ff6('0x3d')][_0x2ff6('0x3f')]?_0x4c3bc8[_0x2ff6('0x3d')]:_0x238164[_0x2ff6('0x38')];_0x4c3bc8[_0x2ff6('0x41')]=qs[_0x2ff6('0x42')](_0x3d432c['query'][_0x2ff6('0x42')]);_0x4c3bc8[_0x2ff6('0x43')]=qs['filters'](_[_0x2ff6('0x5f')](_0x3d432c[_0x2ff6('0x3a')],_0x238164[_0x2ff6('0x3b')]));if(_0x3d432c[_0x2ff6('0x3a')][_0x2ff6('0x44')]){_0x4c3bc8[_0x2ff6('0x43')]=_[_0x2ff6('0x4a')](_0x4c3bc8[_0x2ff6('0x43')],{'$or':_[_0x2ff6('0x45')](_0x4c3bc8['attributes'],function(_0x414e9a){var _0x57bac7={};_0x57bac7[_0x414e9a]={'$like':'%'+_0x3d432c[_0x2ff6('0x3a')][_0x2ff6('0x44')]+'%'};return _0x57bac7;})});}if(_0x3d432c[_0x2ff6('0x3a')]['$gte']){var _0x3f1e18=_0x3d432c[_0x2ff6('0x3a')][_0x2ff6('0x64')][_0x2ff6('0x65')](',');var _0x445662={};_0x445662[_0x3f1e18[0x0]]={'$gte':moment(_0x3f1e18[0x1])[_0x2ff6('0x66')](_0x2ff6('0x67'))};_0x4c3bc8[_0x2ff6('0x43')]=_[_0x2ff6('0x4a')](_0x4c3bc8[_0x2ff6('0x43')],_0x445662);}_0x4c3bc8=_[_0x2ff6('0x4a')]({},_0x4c3bc8,_0x3d432c['options']);return _0xc0b9d3[_0x2ff6('0x63')](_0x4c3bc8);}})['then'](function(_0x27c847){if(_0x27c847){_0x47bf95=_0x27c847[_0x2ff6('0x3f')];if(!_0x3d432c[_0x2ff6('0x3a')]['hasOwnProperty'](_0x2ff6('0x60'))){_0x4c3bc8[_0x2ff6('0x2e')]=qs[_0x2ff6('0x2e')](_0x3d432c[_0x2ff6('0x3a')]['limit']);_0x4c3bc8['offset']=qs[_0x2ff6('0x2d')](_0x3d432c[_0x2ff6('0x3a')]['offset']);}return _0xc0b9d3[_0x2ff6('0x63')](_0x4c3bc8);}})[_0x2ff6('0x1f')](function(_0x80e1c4){if(_0x80e1c4){return _0x80e1c4?{'count':_0x47bf95,'rows':_0x80e1c4}:null;}})[_0x2ff6('0x1f')](respondWithResult(_0x4034f4,null))[_0x2ff6('0x50')](handleError(_0x4034f4,null));}; \ No newline at end of file +var _0x1aa7=['message','result','catch','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','name','send','index','ChatGroup','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','includeAll','include','findAll','rows','show','params','options','create','body','find','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x46a7b6,_0x4953f6){var _0x212cc5=function(_0x2dacb9){while(--_0x2dacb9){_0x46a7b6['push'](_0x46a7b6['shift']());}};_0x212cc5(++_0x4953f6);}(_0x1aa7,0xaa));var _0x71aa=function(_0x12b816,_0x4afafc){_0x12b816=_0x12b816-0x0;var _0x20e0d2=_0x1aa7[_0x12b816];return _0x20e0d2;};'use strict';var pdf=require(_0x71aa('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x71aa('0x1'));var jsonpatch=require(_0x71aa('0x2'));var rp=require(_0x71aa('0x3'));var moment=require(_0x71aa('0x4'));var BPromise=require(_0x71aa('0x5'));var Mustache=require(_0x71aa('0x6'));var util=require(_0x71aa('0x7'));var path=require(_0x71aa('0x8'));var sox=require(_0x71aa('0x9'));var csv=require(_0x71aa('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71aa('0xb'));var squel=require(_0x71aa('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x71aa('0xd'));var toCsv=require(_0x71aa('0xa'));var querystring=require(_0x71aa('0xe'));var Papa=require(_0x71aa('0xf'));var Redis=require(_0x71aa('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x71aa('0x11'));var hardwareService=require(_0x71aa('0x12'));var logger=require(_0x71aa('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x71aa('0x14'));var db=require(_0x71aa('0x15'))['db'];config[_0x71aa('0x16')]=_['defaults'](config[_0x71aa('0x16')],{'host':_0x71aa('0x17'),'port':0x18eb});var socket=require(_0x71aa('0x18'))(new Redis(config[_0x71aa('0x16')]));require(_0x71aa('0x19'))[_0x71aa('0x1a')](socket);var jayson=require(_0x71aa('0x1b'));var client=jayson[_0x71aa('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0xd29bcb,_0x2cd879,_0x1c5aec){if(_0x1c5aec){var _0x382789=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x382789['test'](_0x2cd879)){return _0xd29bcb;}else{throw new Error(_0x71aa('0x1d'));}}else{return _0xd29bcb;}}function respondWithRpcPromise(_0x4605c1,_0x40f9ad,_0x29c866,_0x2674da){return new BPromise(function(_0x1e363b,_0x4a1d53){var _0x59e70c=_0x2674da||client;return _0x59e70c['request'](_0x4605c1,_0x29c866)['then'](function(_0x28a7d9){logger['info'](_0x71aa('0x1e'),_0x40f9ad,_0x71aa('0x1f'));logger[_0x71aa('0x20')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x40f9ad,_0x71aa('0x1f'),JSON[_0x71aa('0x21')](_0x28a7d9));if(_0x28a7d9['error']){if(_0x28a7d9['error'][_0x71aa('0x22')]===0x1f4){logger[_0x71aa('0x23')](_0x71aa('0x1e'),_0x40f9ad,_0x28a7d9[_0x71aa('0x23')]['message']);return _0x4a1d53(_0x28a7d9['error']['message']);}logger[_0x71aa('0x23')](_0x71aa('0x1e'),_0x40f9ad,_0x28a7d9['error'][_0x71aa('0x24')]);return _0x1e363b(_0x28a7d9[_0x71aa('0x23')]['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x40f9ad,_0x71aa('0x1f'));_0x1e363b(_0x28a7d9[_0x71aa('0x25')][_0x71aa('0x24')]);}})[_0x71aa('0x26')](function(_0x105999){logger[_0x71aa('0x23')](_0x71aa('0x1e'),_0x40f9ad,_0x105999);_0x4a1d53(_0x105999);});});}function respondWithStatusCode(_0x134b58,_0x489d7a){_0x489d7a=_0x489d7a||0xcc;return function(_0x3b1e27){if(_0x3b1e27){return _0x134b58['sendStatus'](_0x489d7a);}return _0x134b58['status'](_0x489d7a)[_0x71aa('0x27')]();};}function respondWithResult(_0x4db666,_0x1f39fd){_0x1f39fd=_0x1f39fd||0xc8;return function(_0x5e6de1){if(_0x5e6de1){return _0x4db666[_0x71aa('0x28')](_0x1f39fd)[_0x71aa('0x29')](_0x5e6de1);}};}function respondWithFilteredResult(_0x4b2d13,_0x4a0073){return function(_0x36d915){if(_0x36d915){var _0x47fa37=_0x36d915[_0x71aa('0x2a')],_0x84bf97=_0x4a0073[_0x71aa('0x2b')],_0xb48be=_0x4a0073[_0x71aa('0x2b')]+_0x4a0073[_0x71aa('0x2c')],_0x3269c4;if(_0xb48be>=_0x47fa37){_0xb48be=_0x47fa37;_0x3269c4=0xc8;}else{_0x3269c4=0xce;}_0x4b2d13[_0x71aa('0x28')](_0x3269c4);return _0x4b2d13[_0x71aa('0x2d')]('Content-Range',_0x84bf97+'-'+_0xb48be+'/'+_0x47fa37)[_0x71aa('0x29')](_0x36d915);}return null;};}function patchUpdates(_0x4ee9f2){return function(_0x33b087){try{jsonpatch[_0x71aa('0x2e')](_0x33b087,_0x4ee9f2,!![]);}catch(_0x1ef081){return BPromise[_0x71aa('0x2f')](_0x1ef081);}return _0x33b087[_0x71aa('0x30')]();};}function saveUpdates(_0x1f0915,_0x5976a9){return function(_0x3f5957){if(_0x3f5957){return _0x3f5957[_0x71aa('0x31')](_0x1f0915)[_0x71aa('0x32')](function(_0xe0547d){return _0xe0547d;});}return null;};}function removeEntity(_0x4c5f00,_0x2141e4){return function(_0x543071){if(_0x543071){return _0x543071[_0x71aa('0x33')]()[_0x71aa('0x32')](function(){_0x4c5f00['status'](0xcc)[_0x71aa('0x27')]();});}};}function handleEntityNotFound(_0x339417,_0x88030b){return function(_0x4b8dc5){if(!_0x4b8dc5){_0x339417['sendStatus'](0x194);}return _0x4b8dc5;};}function handleError(_0x52a994,_0x3e38a4){_0x3e38a4=_0x3e38a4||0x1f4;return function(_0x5de038){logger[_0x71aa('0x23')](_0x5de038['stack']);if(_0x5de038[_0x71aa('0x34')]){delete _0x5de038[_0x71aa('0x34')];}_0x52a994[_0x71aa('0x28')](_0x3e38a4)[_0x71aa('0x35')](_0x5de038);};}exports[_0x71aa('0x36')]=function(_0x5569b5,_0x5488b7){var _0x4be59f={},_0x2b4d82={},_0xb76587={'count':0x0,'rows':[]};var _0x42dd4b=db[_0x71aa('0x37')][_0x71aa('0x38')];_0x2b4d82[_0x71aa('0x39')]=_[_0x71aa('0x3a')](_0x42dd4b);_0x2b4d82['query']=_[_0x71aa('0x3a')](_0x5569b5['query']);_0x2b4d82[_0x71aa('0x3b')]=_[_0x71aa('0x3c')](_0x2b4d82[_0x71aa('0x39')],_0x2b4d82[_0x71aa('0x3d')]);_0x4be59f[_0x71aa('0x3e')]=_['intersection'](_0x2b4d82[_0x71aa('0x39')],qs[_0x71aa('0x3f')](_0x5569b5[_0x71aa('0x3d')][_0x71aa('0x3f')]));_0x4be59f[_0x71aa('0x3e')]=_0x4be59f[_0x71aa('0x3e')][_0x71aa('0x40')]?_0x4be59f[_0x71aa('0x3e')]:_0x2b4d82['model'];if(!_0x5569b5[_0x71aa('0x3d')][_0x71aa('0x41')](_0x71aa('0x42'))){_0x4be59f[_0x71aa('0x2c')]=qs[_0x71aa('0x2c')](_0x5569b5[_0x71aa('0x3d')][_0x71aa('0x2c')]);_0x4be59f[_0x71aa('0x2b')]=qs[_0x71aa('0x2b')](_0x5569b5[_0x71aa('0x3d')][_0x71aa('0x2b')]);}_0x4be59f[_0x71aa('0x43')]=qs['sort'](_0x5569b5['query'][_0x71aa('0x44')]);_0x4be59f[_0x71aa('0x45')]=qs[_0x71aa('0x3b')](_[_0x71aa('0x46')](_0x5569b5[_0x71aa('0x3d')],_0x2b4d82[_0x71aa('0x3b')]));if(_0x5569b5[_0x71aa('0x3d')][_0x71aa('0x47')]){_0x4be59f['where']=_[_0x71aa('0x48')](_0x4be59f[_0x71aa('0x45')],{'$or':_[_0x71aa('0x49')](_0x42dd4b,function(_0x56b5d8){if(_0x56b5d8[_0x71aa('0x4a')][_0x71aa('0x4b')]!=='VIRTUAL'){var _0x4e0712={};_0x4e0712[_0x56b5d8['field']]={'$like':'%'+_0x5569b5[_0x71aa('0x3d')][_0x71aa('0x47')]+'%'};return _0x4e0712;}})});}_0x4be59f=_['merge']({},_0x4be59f,_0x5569b5['options']);var _0x54513d={'where':_0x4be59f[_0x71aa('0x45')]};return db[_0x71aa('0x37')][_0x71aa('0x2a')](_0x54513d)['then'](function(_0x44ef05){_0xb76587[_0x71aa('0x2a')]=_0x44ef05;if(_0x5569b5['query'][_0x71aa('0x4c')]){_0x4be59f[_0x71aa('0x4d')]=[{'all':!![]}];}return db[_0x71aa('0x37')][_0x71aa('0x4e')](_0x4be59f);})['then'](function(_0x566e7b){_0xb76587[_0x71aa('0x4f')]=_0x566e7b;return _0xb76587;})[_0x71aa('0x32')](respondWithFilteredResult(_0x5488b7,_0x4be59f))[_0x71aa('0x26')](handleError(_0x5488b7,null));};exports[_0x71aa('0x50')]=function(_0x430868,_0x2f909a){var _0xb16aa={'raw':!![],'where':{'id':_0x430868[_0x71aa('0x51')]['id']}},_0xdc877c={};_0xdc877c['model']=_[_0x71aa('0x3a')](db[_0x71aa('0x37')][_0x71aa('0x38')]);_0xdc877c['query']=_[_0x71aa('0x3a')](_0x430868[_0x71aa('0x3d')]);_0xdc877c[_0x71aa('0x3b')]=_[_0x71aa('0x3c')](_0xdc877c[_0x71aa('0x39')],_0xdc877c[_0x71aa('0x3d')]);_0xb16aa['attributes']=_[_0x71aa('0x3c')](_0xdc877c['model'],qs[_0x71aa('0x3f')](_0x430868[_0x71aa('0x3d')][_0x71aa('0x3f')]));_0xb16aa['attributes']=_0xb16aa[_0x71aa('0x3e')][_0x71aa('0x40')]?_0xb16aa[_0x71aa('0x3e')]:_0xdc877c[_0x71aa('0x39')];if(_0x430868[_0x71aa('0x3d')][_0x71aa('0x4c')]){_0xb16aa[_0x71aa('0x4d')]=[{'all':!![]}];}_0xb16aa=_[_0x71aa('0x48')]({},_0xb16aa,_0x430868[_0x71aa('0x52')]);return db[_0x71aa('0x37')]['find'](_0xb16aa)[_0x71aa('0x32')](handleEntityNotFound(_0x2f909a,null))[_0x71aa('0x32')](respondWithResult(_0x2f909a,null))['catch'](handleError(_0x2f909a,null));};exports[_0x71aa('0x53')]=function(_0x18bdf4,_0x4dbb85){return db['ChatGroup'][_0x71aa('0x53')](_0x18bdf4[_0x71aa('0x54')],{})[_0x71aa('0x32')](respondWithResult(_0x4dbb85,0xc9))[_0x71aa('0x26')](handleError(_0x4dbb85,null));};exports[_0x71aa('0x31')]=function(_0x41626a,_0x31dd80){if(_0x41626a[_0x71aa('0x54')]['id']){delete _0x41626a[_0x71aa('0x54')]['id'];}return db[_0x71aa('0x37')][_0x71aa('0x55')]({'where':{'id':_0x41626a[_0x71aa('0x51')]['id']}})[_0x71aa('0x32')](handleEntityNotFound(_0x31dd80,null))['then'](saveUpdates(_0x41626a[_0x71aa('0x54')],null))[_0x71aa('0x32')](respondWithResult(_0x31dd80,null))[_0x71aa('0x26')](handleError(_0x31dd80,null));};exports['destroy']=function(_0x3c3f82,_0x5e4b50){return db['ChatGroup'][_0x71aa('0x55')]({'where':{'id':_0x3c3f82[_0x71aa('0x51')]['id']}})[_0x71aa('0x32')](handleEntityNotFound(_0x5e4b50,null))['then'](removeEntity(_0x5e4b50,null))[_0x71aa('0x26')](handleError(_0x5e4b50,null));};exports[_0x71aa('0x56')]=function(_0x443c18,_0x368e3f){return db[_0x71aa('0x37')]['describe']()[_0x71aa('0x32')](respondWithResult(_0x368e3f,null))[_0x71aa('0x26')](handleError(_0x368e3f,null));};exports[_0x71aa('0x57')]=function(_0x480f89,_0x56acb7,_0x332f76){return db[_0x71aa('0x58')][_0x71aa('0x2a')]({'where':{'ChatGroupId':_0x480f89['params']['id'],'ToId':_0x480f89[_0x71aa('0x59')]['id'],'read':![]}})[_0x71aa('0x32')](function(_0xa40436){return{'id':_['toInteger'](_0x480f89[_0x71aa('0x51')]['id']),'count':_0xa40436};})[_0x71aa('0x32')](respondWithResult(_0x56acb7,null))['catch'](handleError(_0x56acb7,null));};exports[_0x71aa('0x5a')]=function(_0x6dd495,_0x305685,_0x4e9821){return db[_0x71aa('0x37')][_0x71aa('0x55')]({'where':{'id':_0x6dd495['params']['id']}})['then'](handleEntityNotFound(_0x305685,null))[_0x71aa('0x32')](function(_0x45f92c){if(_0x45f92c){return _0x45f92c[_0x71aa('0x5a')](_0x6dd495[_0x71aa('0x54')][_0x71aa('0x5b')],_[_0x71aa('0x5c')](_0x6dd495['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x305685,null))[_0x71aa('0x26')](handleError(_0x305685,null));};exports[_0x71aa('0x5d')]=function(_0x16f580,_0x3220e2,_0xc730ec){var _0x4275e3={};var _0x55b0df={};var _0x3d6702;var _0xa4e2ff;return db['ChatGroup'][_0x71aa('0x5e')]({'where':{'id':_0x16f580[_0x71aa('0x51')]['id']}})[_0x71aa('0x32')](handleEntityNotFound(_0x3220e2,null))[_0x71aa('0x32')](function(_0x1d0547){if(_0x1d0547){_0x3d6702=_0x1d0547;_0x55b0df[_0x71aa('0x39')]=_[_0x71aa('0x3a')](db['User']['rawAttributes']);_0x55b0df[_0x71aa('0x3d')]=_[_0x71aa('0x3a')](_0x16f580[_0x71aa('0x3d')]);_0x55b0df[_0x71aa('0x3b')]=_[_0x71aa('0x3c')](_0x55b0df[_0x71aa('0x39')],_0x55b0df[_0x71aa('0x3d')]);_0x4275e3['attributes']=_[_0x71aa('0x3c')](_0x55b0df['model'],qs[_0x71aa('0x3f')](_0x16f580[_0x71aa('0x3d')]['fields']));_0x4275e3[_0x71aa('0x3e')]=_0x4275e3[_0x71aa('0x3e')]['length']?_0x4275e3[_0x71aa('0x3e')]:_0x55b0df[_0x71aa('0x39')];_0x4275e3[_0x71aa('0x43')]=qs[_0x71aa('0x44')](_0x16f580['query'][_0x71aa('0x44')]);_0x4275e3[_0x71aa('0x45')]=qs[_0x71aa('0x3b')](_[_0x71aa('0x46')](_0x16f580[_0x71aa('0x3d')],_0x55b0df[_0x71aa('0x3b')]));if(_0x16f580['query'][_0x71aa('0x47')]){_0x4275e3[_0x71aa('0x45')]=_[_0x71aa('0x48')](_0x4275e3[_0x71aa('0x45')],{'$or':_[_0x71aa('0x49')](_0x4275e3['attributes'],function(_0x31095d){var _0x303c97={};_0x303c97[_0x31095d]={'$like':'%'+_0x16f580['query'][_0x71aa('0x47')]+'%'};return _0x303c97;})});}_0x4275e3=_['merge']({},_0x4275e3,_0x16f580[_0x71aa('0x52')]);return _0x3d6702['getMembers'](_0x4275e3);}})[_0x71aa('0x32')](function(_0x25aaf4){if(_0x25aaf4){_0xa4e2ff=_0x25aaf4[_0x71aa('0x40')];if(!_0x16f580[_0x71aa('0x3d')][_0x71aa('0x41')]('nolimit')){_0x4275e3[_0x71aa('0x2c')]=qs['limit'](_0x16f580['query'][_0x71aa('0x2c')]);_0x4275e3['offset']=qs['offset'](_0x16f580[_0x71aa('0x3d')]['offset']);}return _0x3d6702[_0x71aa('0x5d')](_0x4275e3);}})[_0x71aa('0x32')](function(_0x464bb3){if(_0x464bb3){return _0x464bb3?{'count':_0xa4e2ff,'rows':_0x464bb3}:null;}})[_0x71aa('0x32')](respondWithResult(_0x3220e2,null))[_0x71aa('0x26')](handleError(_0x3220e2,null));};exports[_0x71aa('0x5f')]=function(_0x31414c,_0x32c623,_0x3a6843){return db[_0x71aa('0x37')][_0x71aa('0x55')]({'where':{'id':_0x31414c[_0x71aa('0x51')]['id']}})[_0x71aa('0x32')](handleEntityNotFound(_0x32c623,null))['then'](function(_0x2f17ea){if(_0x2f17ea){return _0x2f17ea[_0x71aa('0x5f')](_0x31414c[_0x71aa('0x3d')][_0x71aa('0x5b')]);}})[_0x71aa('0x32')](respondWithStatusCode(_0x32c623,null))[_0x71aa('0x26')](handleError(_0x32c623,null));};exports[_0x71aa('0x60')]=function(_0x20b6a8,_0x247b41,_0x51e963){if(_0x20b6a8[_0x71aa('0x54')]['id']){delete _0x20b6a8[_0x71aa('0x54')]['id'];}return db[_0x71aa('0x37')][_0x71aa('0x55')]({'where':{'id':_0x20b6a8[_0x71aa('0x51')]['id']}})[_0x71aa('0x32')](handleEntityNotFound(_0x247b41,null))[_0x71aa('0x32')](function(_0x1bd906){if(_0x1bd906){_0x20b6a8['body'][_0x71aa('0x61')]=_0x1bd906['id'];return db[_0x71aa('0x58')][_0x71aa('0x53')](_0x20b6a8[_0x71aa('0x54')]);}})[_0x71aa('0x32')](respondWithResult(_0x247b41,null))[_0x71aa('0x26')](handleError(_0x247b41,null));};exports[_0x71aa('0x62')]=function(_0x5240ca,_0x5e6b88,_0x421320){var _0x17d65b={};var _0x396e3b={};var _0x333b8a;var _0x11de7b;return db[_0x71aa('0x37')][_0x71aa('0x5e')]({'where':{'id':_0x5240ca[_0x71aa('0x51')]['id']}})[_0x71aa('0x32')](handleEntityNotFound(_0x5e6b88,null))[_0x71aa('0x32')](function(_0x57e499){if(_0x57e499){_0x333b8a=_0x57e499;_0x396e3b['model']=_[_0x71aa('0x3a')](db[_0x71aa('0x58')]['rawAttributes']);_0x396e3b[_0x71aa('0x3d')]=_['keys'](_0x5240ca['query']);_0x396e3b[_0x71aa('0x3b')]=_[_0x71aa('0x3c')](_0x396e3b[_0x71aa('0x39')],_0x396e3b[_0x71aa('0x3d')]);_0x17d65b[_0x71aa('0x3e')]=_['intersection'](_0x396e3b[_0x71aa('0x39')],qs[_0x71aa('0x3f')](_0x5240ca[_0x71aa('0x3d')][_0x71aa('0x3f')]));_0x17d65b[_0x71aa('0x3e')]=_0x17d65b[_0x71aa('0x3e')][_0x71aa('0x40')]?_0x17d65b[_0x71aa('0x3e')]:_0x396e3b[_0x71aa('0x39')];_0x17d65b[_0x71aa('0x43')]=qs[_0x71aa('0x44')](_0x5240ca[_0x71aa('0x3d')][_0x71aa('0x44')]);_0x17d65b[_0x71aa('0x45')]=qs[_0x71aa('0x3b')](_[_0x71aa('0x46')](_0x5240ca[_0x71aa('0x3d')],_0x396e3b[_0x71aa('0x3b')]));if(_0x5240ca[_0x71aa('0x3d')][_0x71aa('0x47')]){_0x17d65b[_0x71aa('0x45')]=_[_0x71aa('0x48')](_0x17d65b[_0x71aa('0x45')],{'$or':_[_0x71aa('0x49')](_0x17d65b[_0x71aa('0x3e')],function(_0x5170ed){var _0x4a3383={};_0x4a3383[_0x5170ed]={'$like':'%'+_0x5240ca[_0x71aa('0x3d')][_0x71aa('0x47')]+'%'};return _0x4a3383;})});}if(_0x5240ca[_0x71aa('0x3d')][_0x71aa('0x63')]){var _0x92a47d=_0x5240ca[_0x71aa('0x3d')][_0x71aa('0x63')][_0x71aa('0x64')](',');var _0x139796={};_0x139796[_0x92a47d[0x0]]={'$gte':moment(_0x92a47d[0x1])[_0x71aa('0x65')](_0x71aa('0x66'))};_0x17d65b[_0x71aa('0x45')]=_['merge'](_0x17d65b[_0x71aa('0x45')],_0x139796);}_0x17d65b=_[_0x71aa('0x48')]({},_0x17d65b,_0x5240ca[_0x71aa('0x52')]);return _0x333b8a[_0x71aa('0x62')](_0x17d65b);}})[_0x71aa('0x32')](function(_0x233a53){if(_0x233a53){_0x11de7b=_0x233a53[_0x71aa('0x40')];if(!_0x5240ca[_0x71aa('0x3d')]['hasOwnProperty']('nolimit')){_0x17d65b[_0x71aa('0x2c')]=qs[_0x71aa('0x2c')](_0x5240ca[_0x71aa('0x3d')][_0x71aa('0x2c')]);_0x17d65b['offset']=qs[_0x71aa('0x2b')](_0x5240ca['query'][_0x71aa('0x2b')]);}return _0x333b8a[_0x71aa('0x62')](_0x17d65b);}})['then'](function(_0x21667b){if(_0x21667b){return _0x21667b?{'count':_0x11de7b,'rows':_0x21667b}:null;}})[_0x71aa('0x32')](respondWithResult(_0x5e6b88,null))[_0x71aa('0x26')](handleError(_0x5e6b88,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 7e783a0..06b2784 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 _0x6efe=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x6efe,0xfe));var _0xe6ef=function(_0x59366e,_0x38bed6){_0x59366e=_0x59366e-0x0;var _0x42ab1e=_0x6efe[_0x59366e];return _0x42ab1e;};'use strict';var EventEmitter=require(_0xe6ef('0x0'));var ChatGroup=require(_0xe6ef('0x1'))['db'][_0xe6ef('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe6ef('0x3')](0x0);var events={'afterCreate':_0xe6ef('0x4'),'afterUpdate':'update','afterDestroy':_0xe6ef('0x5')};function emitEvent(_0xcd36ef){return function(_0x56a7e1,_0x8bc042,_0xa061b3){ChatGroupEvents[_0xe6ef('0x6')](_0xcd36ef+':'+_0x56a7e1['id'],_0x56a7e1);ChatGroupEvents[_0xe6ef('0x6')](_0xcd36ef,_0x56a7e1);_0xa061b3(null);};}for(var e in events){if(events[_0xe6ef('0x7')](e)){var event=events[e];ChatGroup[_0xe6ef('0x8')](e,emitEvent(event));}}module[_0xe6ef('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x8907=['hasOwnProperty','hook','exports','events','ChatGroup','save','update','remove','emit'];(function(_0x1ff1d2,_0x3efa0a){var _0x28c7c9=function(_0x5a9e79){while(--_0x5a9e79){_0x1ff1d2['push'](_0x1ff1d2['shift']());}};_0x28c7c9(++_0x3efa0a);}(_0x8907,0xae));var _0x7890=function(_0x183ea5,_0x4cb27b){_0x183ea5=_0x183ea5-0x0;var _0x5be5fa=_0x8907[_0x183ea5];return _0x5be5fa;};'use strict';var EventEmitter=require(_0x7890('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x7890('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7890('0x2'),'afterUpdate':_0x7890('0x3'),'afterDestroy':_0x7890('0x4')};function emitEvent(_0x336c8d){return function(_0x3eeb70,_0x44f9f3,_0x3d9c8e){ChatGroupEvents[_0x7890('0x5')](_0x336c8d+':'+_0x3eeb70['id'],_0x3eeb70);ChatGroupEvents[_0x7890('0x5')](_0x336c8d,_0x3eeb70);_0x3d9c8e(null);};}for(var e in events){if(events[_0x7890('0x6')](e)){var event=events[e];ChatGroup[_0x7890('0x7')](e,emitEvent(event));}}module[_0x7890('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index c53b095..4193a26 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 _0xbfce=['exports','ChatGroup','chat_groups','util','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes'];(function(_0x321231,_0x10fbe0){var _0x2a1c8a=function(_0x51b068){while(--_0x51b068){_0x321231['push'](_0x321231['shift']());}};_0x2a1c8a(++_0x10fbe0);}(_0xbfce,0x66));var _0xebfc=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xbfce[_0x40dd56];return _0x4f850f;};'use strict';var _=require('lodash');var util=require(_0xebfc('0x0'));var logger=require('../../config/logger')(_0xebfc('0x1'));var moment=require(_0xebfc('0x2'));var BPromise=require(_0xebfc('0x3'));var rp=require(_0xebfc('0x4'));var fs=require('fs');var path=require(_0xebfc('0x5'));var rimraf=require(_0xebfc('0x6'));var config=require('../../config/environment');var attributes=require(_0xebfc('0x7'));module[_0xebfc('0x8')]=function(_0x365b86,_0x268fc4){return _0x365b86['define'](_0xebfc('0x9'),attributes,{'tableName':_0xebfc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c5a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x4c5a,0x8a));var _0xa4c5=function(_0x4a8a55,_0x4d5258){_0x4a8a55=_0x4a8a55-0x0;var _0x4369c3=_0x4c5a[_0x4a8a55];return _0x4369c3;};'use strict';var _=require(_0xa4c5('0x0'));var util=require(_0xa4c5('0x1'));var logger=require(_0xa4c5('0x2'))(_0xa4c5('0x3'));var moment=require(_0xa4c5('0x4'));var BPromise=require(_0xa4c5('0x5'));var rp=require(_0xa4c5('0x6'));var fs=require('fs');var path=require(_0xa4c5('0x7'));var rimraf=require(_0xa4c5('0x8'));var config=require(_0xa4c5('0x9'));var attributes=require('./chatGroup.attributes');module[_0xa4c5('0xa')]=function(_0x5dea53,_0x575e3d){return _0x5dea53[_0xa4c5('0xb')](_0xa4c5('0xc'),attributes,{'tableName':_0xa4c5('0xd'),'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 f3c20c3..2b3a7a2 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 _0x5636=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x3ffdea,_0x12d82c){var _0xeb24ad=function(_0x25c879){while(--_0x25c879){_0x3ffdea['push'](_0x3ffdea['shift']());}};_0xeb24ad(++_0x12d82c);}(_0x5636,0x102));var _0x6563=function(_0x27c24f,_0x1c5ba0){_0x27c24f=_0x27c24f-0x0;var _0x26a53a=_0x5636[_0x27c24f];return _0x26a53a;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);function respondWithRpcPromise(_0x516d1a,_0x51fdc2,_0x2946f3){return new BPromise(function(_0x129fa3,_0x490a56){return client['request'](_0x516d1a,_0x2946f3)['then'](function(_0x1ef002){logger[_0x6563('0x10')](_0x6563('0x11'),_0x51fdc2,_0x6563('0x12'));logger[_0x6563('0x13')](_0x6563('0x14'),_0x51fdc2,_0x6563('0x12'),JSON[_0x6563('0x15')](_0x1ef002));if(_0x1ef002[_0x6563('0x16')]){if(_0x1ef002['error'][_0x6563('0x17')]===0x1f4){logger['error'](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x490a56(_0x1ef002[_0x6563('0x16')]['message']);}logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x129fa3(_0x1ef002['error'][_0x6563('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x51fdc2,'request\x20sent');_0x129fa3(_0x1ef002[_0x6563('0x19')]['message']);}})['catch'](function(_0x27651b){logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x27651b);_0x490a56(_0x27651b);});});} \ No newline at end of file +var _0x4fdb=['redis','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults'];(function(_0x36a83e,_0x2dfaaa){var _0x2d6049=function(_0x8dfe74){while(--_0x8dfe74){_0x36a83e['push'](_0x36a83e['shift']());}};_0x2d6049(++_0x2dfaaa);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1a1ec5,_0x4109e3){_0x1a1ec5=_0x1a1ec5-0x0;var _0x144c71=_0x4fdb[_0x1a1ec5];return _0x144c71;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});config['redis']=_[_0xb4fd('0xb')](config[_0xb4fd('0xc')],{'host':_0xb4fd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb4fd('0xe'))[_0xb4fd('0xf')](socket);function respondWithRpcPromise(_0x18c0f7,_0x4eb1ae,_0x1e1e16){return new BPromise(function(_0x17ac4b,_0x2148db){return client[_0xb4fd('0x10')](_0x18c0f7,_0x1e1e16)[_0xb4fd('0x11')](function(_0x502379){logger[_0xb4fd('0x12')](_0xb4fd('0x13'),_0x4eb1ae,_0xb4fd('0x14'));logger[_0xb4fd('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4eb1ae,_0xb4fd('0x14'),JSON[_0xb4fd('0x16')](_0x502379));if(_0x502379[_0xb4fd('0x17')]){if(_0x502379['error'][_0xb4fd('0x18')]===0x1f4){logger[_0xb4fd('0x17')](_0xb4fd('0x13'),_0x4eb1ae,_0x502379[_0xb4fd('0x17')][_0xb4fd('0x19')]);return _0x2148db(_0x502379[_0xb4fd('0x17')][_0xb4fd('0x19')]);}logger['error'](_0xb4fd('0x13'),_0x4eb1ae,_0x502379[_0xb4fd('0x17')][_0xb4fd('0x19')]);return _0x17ac4b(_0x502379[_0xb4fd('0x17')][_0xb4fd('0x19')]);}else{logger[_0xb4fd('0x12')](_0xb4fd('0x13'),_0x4eb1ae,_0xb4fd('0x14'));_0x17ac4b(_0x502379[_0xb4fd('0x1a')][_0xb4fd('0x19')]);}})[_0xb4fd('0x1b')](function(_0x5e930d){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4eb1ae,_0x5e930d);_0x2148db(_0x5e930d);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ced1d5b..cec915c 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 _0x3667=['remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x283da8,_0x341e81){var _0x163ab1=function(_0x422ca8){while(--_0x422ca8){_0x283da8['push'](_0x283da8['shift']());}};_0x163ab1(++_0x341e81);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x7366('0x0'));var events=[_0x7366('0x1'),_0x7366('0x2'),_0x7366('0x3')];function createListener(_0x3c601d,_0x5d1072){return function(_0x27a90d){_0x5d1072[_0x7366('0x4')](_0x3c601d,_0x27a90d);};}function removeListener(_0x4b32a7,_0x27726b){return function(){ChatGroupEvents[_0x7366('0x5')](_0x4b32a7,_0x27726b);};}exports[_0x7366('0x6')]=function(_0x1c0cf4){for(var _0x101e3d=0x0,_0x589397=events[_0x7366('0x7')];_0x101e3d<_0x589397;_0x101e3d++){var _0xa1a3c5=events[_0x101e3d];var _0x2dd32b=createListener(_0x7366('0x8')+_0xa1a3c5,_0x1c0cf4);ChatGroupEvents['on'](_0xa1a3c5,_0x2dd32b);}}; \ No newline at end of file +var _0xde2c=['save','remove','update','emit','removeListener','register','length','./chatGroup.events'];(function(_0x2bf418,_0x1f5979){var _0x12296b=function(_0x16fe2c){while(--_0x16fe2c){_0x2bf418['push'](_0x2bf418['shift']());}};_0x12296b(++_0x1f5979);}(_0xde2c,0x7f));var _0xcde2=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0xde2c[_0x3e0dc4];return _0x586111;};'use strict';var ChatGroupEvents=require(_0xcde2('0x0'));var events=[_0xcde2('0x1'),_0xcde2('0x2'),_0xcde2('0x3')];function createListener(_0x7595ed,_0x40fa0a){return function(_0x33bb0c){_0x40fa0a[_0xcde2('0x4')](_0x7595ed,_0x33bb0c);};}function removeListener(_0x55c175,_0x4353c8){return function(){ChatGroupEvents[_0xcde2('0x5')](_0x55c175,_0x4353c8);};}exports[_0xcde2('0x6')]=function(_0x1398de){for(var _0x401b16=0x0,_0x53c558=events[_0xcde2('0x7')];_0x401b16<_0x53c558;_0x401b16++){var _0x385e83=events[_0x401b16];var _0x9c7036=createListener('chatGroup:'+_0x385e83,_0x1398de);ChatGroupEvents['on'](_0x385e83,_0x9c7036);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ad60509..ca0ebfb 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 _0x0ba7=['post','create','addMessage','put','update','delete','destroy','removeMembers','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','/:id/members','/:id/messages','getMessages'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x0ba7,0x116));var _0x70ba=function(_0x391eeb,_0x3733f1){_0x391eeb=_0x391eeb-0x0;var _0x678b3=_0x0ba7[_0x391eeb];return _0x678b3;};'use strict';var multer=require(_0x70ba('0x0'));var util=require('util');var path=require(_0x70ba('0x1'));var timeout=require(_0x70ba('0x2'));var express=require(_0x70ba('0x3'));var router=express[_0x70ba('0x4')]();var auth=require(_0x70ba('0x5'));var interaction=require(_0x70ba('0x6'));var config=require('../../config/environment');var controller=require(_0x70ba('0x7'));router['get']('/',auth[_0x70ba('0x8')](),controller[_0x70ba('0x9')]);router['get'](_0x70ba('0xa'),auth['isAuthenticated'](),controller[_0x70ba('0xb')]);router[_0x70ba('0xc')](_0x70ba('0xd'),auth[_0x70ba('0x8')](),controller[_0x70ba('0xe')]);router['get'](_0x70ba('0xf'),auth[_0x70ba('0x8')](),controller['getUnread']);router[_0x70ba('0xc')](_0x70ba('0x10'),auth[_0x70ba('0x8')](),controller['getMembers']);router['get'](_0x70ba('0x11'),auth[_0x70ba('0x8')](),controller[_0x70ba('0x12')]);router[_0x70ba('0x13')]('/',auth['isAuthenticated'](),controller[_0x70ba('0x14')]);router[_0x70ba('0x13')](_0x70ba('0x10'),auth[_0x70ba('0x8')](),controller['addMembers']);router[_0x70ba('0x13')](_0x70ba('0x11'),auth[_0x70ba('0x8')](),controller[_0x70ba('0x15')]);router[_0x70ba('0x16')](_0x70ba('0xd'),auth['isAuthenticated'](),controller[_0x70ba('0x17')]);router[_0x70ba('0x18')](_0x70ba('0xd'),auth[_0x70ba('0x8')](),controller[_0x70ba('0x19')]);router[_0x70ba('0x18')]('/:id/members',auth['isAuthenticated'](),controller[_0x70ba('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xf1ca=['addMessage','update','delete','removeMembers','util','path','connect-timeout','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf1ca,0x1a6));var _0xaf1c=function(_0x4e0830,_0x205497){_0x4e0830=_0x4e0830-0x0;var _0x37d264=_0xf1ca[_0x4e0830];return _0x37d264;};'use strict';var multer=require('multer');var util=require(_0xaf1c('0x0'));var path=require(_0xaf1c('0x1'));var timeout=require(_0xaf1c('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf1c('0x3'));var controller=require(_0xaf1c('0x4'));router[_0xaf1c('0x5')]('/',auth[_0xaf1c('0x6')](),controller['index']);router[_0xaf1c('0x5')](_0xaf1c('0x7'),auth[_0xaf1c('0x6')](),controller[_0xaf1c('0x8')]);router['get'](_0xaf1c('0x9'),auth[_0xaf1c('0x6')](),controller[_0xaf1c('0xa')]);router[_0xaf1c('0x5')](_0xaf1c('0xb'),auth[_0xaf1c('0x6')](),controller['getUnread']);router[_0xaf1c('0x5')](_0xaf1c('0xc'),auth[_0xaf1c('0x6')](),controller[_0xaf1c('0xd')]);router['get'](_0xaf1c('0xe'),auth[_0xaf1c('0x6')](),controller[_0xaf1c('0xf')]);router[_0xaf1c('0x10')]('/',auth[_0xaf1c('0x6')](),controller[_0xaf1c('0x11')]);router['post'](_0xaf1c('0xc'),auth[_0xaf1c('0x6')](),controller['addMembers']);router[_0xaf1c('0x10')]('/:id/messages',auth[_0xaf1c('0x6')](),controller[_0xaf1c('0x12')]);router['put'](_0xaf1c('0x9'),auth[_0xaf1c('0x6')](),controller[_0xaf1c('0x13')]);router[_0xaf1c('0x14')]('/:id',auth[_0xaf1c('0x6')](),controller['destroy']);router[_0xaf1c('0x14')]('/:id/members',auth[_0xaf1c('0x6')](),controller[_0xaf1c('0x15')]);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 48d8d0b..92f926d 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 _0xed3c=['ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb','STRING','DATE','TEXT','long'];(function(_0x372e39,_0x51d52e){var _0x109428=function(_0x5a71b4){while(--_0x5a71b4){_0x372e39['push'](_0x372e39['shift']());}};_0x109428(++_0x51d52e);}(_0xed3c,0x1a6));var _0xced3=function(_0x3f0bd7,_0x16284c){_0x3f0bd7=_0x3f0bd7-0x0;var _0x1cbb2f=_0xed3c[_0x3f0bd7];return _0x1cbb2f;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'closed':{'type':Sequelize[_0xced3('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xced3('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xced3('0x4'),_0xced3('0x5')),'defaultValue':_0xced3('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xced3('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xced3('0x7')]},'disposition':{'type':Sequelize[_0xced3('0x6')]},'note':{'type':Sequelize[_0xced3('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xced3('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xced3('0x6')]},'customerIp':{'type':Sequelize[_0xced3('0x6')]},'formData':{'type':Sequelize[_0xced3('0x8')](_0xced3('0x9'))},'read1stAt':{'type':Sequelize[_0xced3('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xced3('0xa')]('in',_0xced3('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xced3('0x6')]}}; \ No newline at end of file +var _0x6324=['long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','TEXT','DATE','STRING'];(function(_0x27a1ce,_0x360446){var _0xb6e2f7=function(_0x57fb35){while(--_0x57fb35){_0x27a1ce['push'](_0x27a1ce['shift']());}};_0xb6e2f7(++_0x360446);}(_0x6324,0x142));var _0x4632=function(_0x163cd0,_0x461c03){_0x163cd0=_0x163cd0-0x0;var _0x166213=_0x6324[_0x163cd0];return _0x166213;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'closed':{'type':Sequelize[_0x4632('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4632('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x4632('0x4'),'thumb'),'defaultValue':_0x4632('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x4632('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4632('0x6')]},'disposition':{'type':Sequelize[_0x4632('0x7')]},'note':{'type':Sequelize[_0x4632('0x7')]},'browserName':{'type':Sequelize[_0x4632('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x4632('0x7')]},'osVersion':{'type':Sequelize[_0x4632('0x7')]},'deviceModel':{'type':Sequelize[_0x4632('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x4632('0x7')]},'referer':{'type':Sequelize[_0x4632('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x4632('0x8'))},'read1stAt':{'type':Sequelize[_0x4632('0x6')]},'lastMsgAt':{'type':Sequelize[_0x4632('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x4632('0x9')]('in',_0x4632('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4632('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index c6f4476..7146c2b 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 _0x8bb1=['tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','`Messages.count`\x20=\x200','sequelize','keyBy','merge','a.key','Account.key','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','push','all','rows','show','params','includeAll','include','options','find','create','body','destroy','describe','customUpdate','abandon','entity\x20not\x20found','UserId','Sequelize','ValidationError','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','originalname','filename','type','mimetype','Attachment','findOne','Unauthorized','attachId','download','root','server/files/attachments/','basename','server/files/chat/upload/','now','pathTranscript','User','ChatWebsite','CmContact','Messages','agentAlias','System','customer','agentIdentifier','website_alias','%s%d','agent_alias','alias','fullname','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','user','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','mailTranscript','addMessage','omit','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAgent','findAll','addTags','setTags','spread','Tag','color','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Chat','YYYY-MM-DD','N.A.','closedAt','browserName','referer','customerIp','tail','existsSync','createWriteStream','out','Contact','renderFile','views','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','name','send','closed','unreadMessages','ChatMessage','map','Tags','TagIds','split','forEach','ChatInteraction','rawAttributes','model','keys','query','intersection','fields','attributes','nolimit','order','sort','filters','pick','select','field','from','tools_tags','where','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','expr','advancedFilter','parse','createdAt','dateStart','startOf','day','format','utc','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','length','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','Messages.count','\x20IN\x20?','LIKE','c.email','hasOwnProperty','filter','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','QueryTypes','SELECT','clone','COUNT(*)','read','%s\x20=\x200','having','%s\x20>\x200','`Messages.count`\x20>\x200'];(function(_0x1f4c0b,_0x28f740){var _0xa2eddb=function(_0x51f179){while(--_0x51f179){_0x1f4c0b['push'](_0x1f4c0b['shift']());}};_0xa2eddb(++_0x28f740);}(_0x8bb1,0x1bd));var _0x18bb=function(_0x19f154,_0x16b694){_0x19f154=_0x19f154-0x0;var _0x34ded8=_0x8bb1[_0x19f154];return _0x34ded8;};'use strict';var pdf=require(_0x18bb('0x0'));var emlformat=require(_0x18bb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x18bb('0x2'));var jsonpatch=require(_0x18bb('0x3'));var rp=require(_0x18bb('0x4'));var moment=require(_0x18bb('0x5'));var BPromise=require(_0x18bb('0x6'));var Mustache=require(_0x18bb('0x7'));var util=require(_0x18bb('0x8'));var path=require('path');var sox=require(_0x18bb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x18bb('0xa'));var squel=require(_0x18bb('0xb'));var crypto=require('crypto');var jsforce=require(_0x18bb('0xc'));var deskjs=require(_0x18bb('0xd'));var toCsv=require(_0x18bb('0xe'));var querystring=require(_0x18bb('0xf'));var Papa=require('papaparse');var Redis=require(_0x18bb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x18bb('0x11'));var hardwareService=require(_0x18bb('0x12'));var logger=require(_0x18bb('0x13'))('api');var utils=require(_0x18bb('0x14'));var config=require(_0x18bb('0x15'));var db=require(_0x18bb('0x16'))['db'];config[_0x18bb('0x17')]=_[_0x18bb('0x18')](config[_0x18bb('0x17')],{'host':_0x18bb('0x19'),'port':0x18eb});var socket=require(_0x18bb('0x1a'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x18bb('0x1b')](socket);var jayson=require(_0x18bb('0x1c'));var client=jayson['client'][_0x18bb('0x1d')]({'port':0x232b});var client9004=jayson[_0x18bb('0x1e')][_0x18bb('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x38d00b,_0x4a67e2,_0x117e5d){if(_0x117e5d){var _0x1ae631=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ae631[_0x18bb('0x1f')](_0x4a67e2)){return _0x38d00b;}else{throw new Error(_0x18bb('0x20'));}}else{return _0x38d00b;}}function respondWithRpcPromise(_0x1da4f4,_0x4c4f18,_0x326f9f,_0x1b5640){return new BPromise(function(_0xd8d6f5,_0x31dace){var _0x4876d9=_0x1b5640||client;return _0x4876d9[_0x18bb('0x21')](_0x1da4f4,_0x326f9f)[_0x18bb('0x22')](function(_0x4e5303){logger['info'](_0x18bb('0x23'),_0x4c4f18,_0x18bb('0x24'));logger[_0x18bb('0x25')](_0x18bb('0x26'),_0x4c4f18,'request\x20sent',JSON['stringify'](_0x4e5303));if(_0x4e5303[_0x18bb('0x27')]){if(_0x4e5303[_0x18bb('0x27')][_0x18bb('0x28')]===0x1f4){logger[_0x18bb('0x27')](_0x18bb('0x23'),_0x4c4f18,_0x4e5303['error'][_0x18bb('0x29')]);return _0x31dace(_0x4e5303[_0x18bb('0x27')][_0x18bb('0x29')]);}logger[_0x18bb('0x27')](_0x18bb('0x23'),_0x4c4f18,_0x4e5303[_0x18bb('0x27')][_0x18bb('0x29')]);return _0xd8d6f5(_0x4e5303['error'][_0x18bb('0x29')]);}else{logger[_0x18bb('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c4f18,'request\x20sent');_0xd8d6f5(_0x4e5303[_0x18bb('0x2b')]['message']);}})[_0x18bb('0x2c')](function(_0x1eea7d){logger[_0x18bb('0x27')](_0x18bb('0x23'),_0x4c4f18,_0x1eea7d);_0x31dace(_0x1eea7d);});});}function respondWithStatusCode(_0x584a41,_0x2ce164){_0x2ce164=_0x2ce164||0xcc;return function(_0x32e35b){if(_0x32e35b){return _0x584a41[_0x18bb('0x2d')](_0x2ce164);}return _0x584a41[_0x18bb('0x2e')](_0x2ce164)[_0x18bb('0x2f')]();};}function respondWithResult(_0x4e784e,_0x484b5a){_0x484b5a=_0x484b5a||0xc8;return function(_0x292468){if(_0x292468){return _0x4e784e[_0x18bb('0x2e')](_0x484b5a)['json'](_0x292468);}};}function respondWithFilteredResult(_0x1c75ef,_0x29d548){return function(_0x1b8db8){if(_0x1b8db8){var _0x2c6892=_0x1b8db8[_0x18bb('0x30')],_0x1d4934=_0x29d548[_0x18bb('0x31')],_0x2f3399=_0x29d548[_0x18bb('0x31')]+_0x29d548[_0x18bb('0x32')],_0x53b7cd;if(_0x2f3399>=_0x2c6892){_0x2f3399=_0x2c6892;_0x53b7cd=0xc8;}else{_0x53b7cd=0xce;}_0x1c75ef[_0x18bb('0x2e')](_0x53b7cd);return _0x1c75ef[_0x18bb('0x33')](_0x18bb('0x34'),_0x1d4934+'-'+_0x2f3399+'/'+_0x2c6892)[_0x18bb('0x35')](_0x1b8db8);}return null;};}function patchUpdates(_0x418b35){return function(_0x1e4bf1){try{jsonpatch[_0x18bb('0x36')](_0x1e4bf1,_0x418b35,!![]);}catch(_0x40acba){return BPromise[_0x18bb('0x37')](_0x40acba);}return _0x1e4bf1[_0x18bb('0x38')]();};}function saveUpdates(_0x45da19,_0x121674){return function(_0x44ac24){if(_0x44ac24){return _0x44ac24[_0x18bb('0x39')](_0x45da19)['then'](function(_0xecb685){return _0xecb685;});}return null;};}function removeEntity(_0x7bed8d,_0x3404dc){return function(_0x20e0d2){if(_0x20e0d2){return _0x20e0d2['destroy']()[_0x18bb('0x22')](function(){_0x7bed8d[_0x18bb('0x2e')](0xcc)[_0x18bb('0x2f')]();});}};}function handleEntityNotFound(_0x3aebe6,_0x68df7c){return function(_0x51fd4f){if(!_0x51fd4f){_0x3aebe6['sendStatus'](0x194);}return _0x51fd4f;};}function handleError(_0x2be3ad,_0x38a513){_0x38a513=_0x38a513||0x1f4;return function(_0x56001e){logger[_0x18bb('0x27')](_0x56001e['stack']);if(_0x56001e[_0x18bb('0x3a')]){delete _0x56001e[_0x18bb('0x3a')];}_0x2be3ad[_0x18bb('0x2e')](_0x38a513)[_0x18bb('0x3b')](_0x56001e);};}function getInteractionUnreadMessages(_0x3a1144){return new BPromise(function(_0x411007,_0x567278){try{if(_0x3a1144[_0x18bb('0x3c')]){_0x3a1144[_0x18bb('0x3d')]=0x0;_0x411007(_0x3a1144);}else{return db[_0x18bb('0x3e')][_0x18bb('0x30')]({'where':{'ChatInteractionId':_0x3a1144['id'],'direction':'in','read':![]}})[_0x18bb('0x22')](function(_0x3cedeb){_0x3a1144['unreadMessages']=_0x3cedeb;_0x411007(_0x3a1144);});}}catch(_0x66486){_0x567278(_0x66486);}});}function getInteractionUsers(_0x1fc4ce,_0x3da7ec){return new BPromise(function(_0x2c5d1d,_0x13a3c5){try{if(_0x3da7ec[_0x1fc4ce['id']]){_0x1fc4ce['Users']=_[_0x18bb('0x3f')](_0x3da7ec[_0x1fc4ce['id']],function(_0x2aad00){return{'id':_0x2aad00['id']};});}}catch(_0x30ba79){_0x13a3c5(_0x30ba79);}_0x2c5d1d(_0x1fc4ce);});}function getInteractionTags(_0x21135f,_0x1966d8){return new BPromise(function(_0x29c7d6,_0x286d02){try{if(_0x21135f['TagIds']){_0x21135f[_0x18bb('0x40')]=[];_0x21135f[_0x18bb('0x41')][_0x18bb('0x42')](',')[_0x18bb('0x43')](function(_0x1f041b){_0x21135f[_0x18bb('0x40')]['push'](_0x1966d8[_0x1f041b]);});}delete _0x21135f['TagIds'];}catch(_0x1eb26a){_0x286d02(_0x1eb26a);}_0x29c7d6(_0x21135f);});}function updateChatInteraction(_0x55cb49,_0x52d60d,_0xae0a71){return new BPromise(function(_0x4d7b44,_0x27baf3){return getInteractionUnreadMessages(_0x55cb49)[_0x18bb('0x22')](function(_0x36a0c3){return getInteractionUsers(_0x36a0c3,_0xae0a71);})[_0x18bb('0x22')](function(_0x23b587){return getInteractionTags(_0x23b587,_0x52d60d);})[_0x18bb('0x22')](function(_0x574f33){_0x4d7b44(_0x574f33);})[_0x18bb('0x2c')](function(_0x31c424){_0x27baf3(_0x31c424);});});}exports['index']=function(_0x136238,_0x5edb37){var _0x1e8c15={},_0x1be302={},_0x2ab9d1={'count':0x0,'rows':[]};var _0x35bfe4=db[_0x18bb('0x44')][_0x18bb('0x45')];_0x1be302[_0x18bb('0x46')]=_[_0x18bb('0x47')](_0x35bfe4);_0x1be302[_0x18bb('0x48')]=_[_0x18bb('0x47')](_0x136238['query']);_0x1be302['filters']=_['intersection'](_0x1be302[_0x18bb('0x46')],_0x1be302['query']);_0x1e8c15['attributes']=_[_0x18bb('0x49')](_0x1be302[_0x18bb('0x46')],qs[_0x18bb('0x4a')](_0x136238[_0x18bb('0x48')][_0x18bb('0x4a')]));_0x1e8c15[_0x18bb('0x4b')]=_0x1e8c15['attributes']['length']?_0x1e8c15[_0x18bb('0x4b')]:_0x1be302[_0x18bb('0x46')];if(!_0x136238[_0x18bb('0x48')]['hasOwnProperty'](_0x18bb('0x4c'))){_0x1e8c15[_0x18bb('0x32')]=qs[_0x18bb('0x32')](_0x136238[_0x18bb('0x48')][_0x18bb('0x32')]);_0x1e8c15[_0x18bb('0x31')]=qs[_0x18bb('0x31')](_0x136238[_0x18bb('0x48')][_0x18bb('0x31')]);}_0x1e8c15[_0x18bb('0x4d')]=qs[_0x18bb('0x4e')](_0x136238[_0x18bb('0x48')][_0x18bb('0x4e')]);_0x1e8c15['where']=qs[_0x18bb('0x4f')](_[_0x18bb('0x50')](_0x136238[_0x18bb('0x48')],_0x1be302[_0x18bb('0x4f')]));var _0x9f6c40=[];var _0x19a791=squel[_0x18bb('0x51')]()[_0x18bb('0x52')]('id')[_0x18bb('0x52')](_0x18bb('0x3a'))[_0x18bb('0x52')]('color')[_0x18bb('0x53')](_0x18bb('0x54'));var _0x23652f=squel[_0x18bb('0x51')]()[_0x18bb('0x52')]('COUNT(*)')[_0x18bb('0x53')]('chat_messages','me')[_0x18bb('0x55')](_0x18bb('0x56'))[_0x18bb('0x55')](_0x18bb('0x57'))[_0x18bb('0x55')](_0x18bb('0x58'));var _0x1c282e=squel[_0x18bb('0x51')]()['field'](_0x18bb('0x59'))[_0x18bb('0x52')]('ui.ChatInteractionId')[_0x18bb('0x53')](_0x18bb('0x5a'),'ui')[_0x18bb('0x5b')]('users','u',_0x18bb('0x5c'));var _0x39c94a=squel['select']()[_0x18bb('0x53')](_0x18bb('0x5d'),'i')[_0x18bb('0x5b')](_0x18bb('0x5e'),'c',_0x18bb('0x5f'))['left_join'](_0x18bb('0x60'),'o',_0x18bb('0x61'))[_0x18bb('0x5b')](_0x18bb('0x62'),'a',_0x18bb('0x63'))[_0x18bb('0x5b')](_0x18bb('0x64'),'me',_0x18bb('0x56'));var _0x3d120e=squel[_0x18bb('0x65')]();if(_0x136238[_0x18bb('0x48')][_0x18bb('0x66')]){var _0x24c1fc=JSON[_0x18bb('0x67')](_0x136238[_0x18bb('0x48')][_0x18bb('0x66')]);_['keys'](_0x24c1fc)['forEach'](function(_0x16d1d2){var _0x375af0=_0x24c1fc[_0x16d1d2];if(_0x16d1d2===_0x18bb('0x68')){var _0x5dec6e=moment(_0x375af0['value'][_0x18bb('0x69')])[_0x18bb('0x6a')](_0x18bb('0x6b'))['utc']()[_0x18bb('0x6c')]();var _0x4cb480=moment(_0x4cb480)[_0x18bb('0x6d')]()[_0x18bb('0x6e')]('day')[_0x18bb('0x6c')]();_0x3d120e[_0x18bb('0x6f')](_0x18bb('0x70'),_0x5dec6e,_0x4cb480);}else{if(_[_0x18bb('0x71')](_0x375af0[_0x18bb('0x72')])){_0x375af0[_0x18bb('0x72')][_0x18bb('0x43')](function(_0x27f58d){switch(_0x375af0[_0x18bb('0x72')][_0x18bb('0x73')]){case'IS':if(_0x16d1d2!==_0x18bb('0x74')&&_0x16d1d2!=='Messages.count'){if(_[_0x18bb('0x71')](_0x375af0[_0x18bb('0x73')])&&_0x375af0['value'][_0x18bb('0x75')]>0x1){_0x3d120e['and'](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+'\x20IN\x20?',_0x375af0[_0x18bb('0x73')]);}else{_0x3d120e[_0x18bb('0x6f')](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x77'),_0x375af0['value'][0x0]);}}break;case'=':_0x3d120e[_0x18bb('0x6f')](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x77'),_0x375af0[_0x18bb('0x73')]);break;case'LIKE':if(_0x16d1d2===_0x18bb('0x78')){_0x3d120e[_0x18bb('0x6f')](_0x18bb('0x79')+_0x18bb('0x7a'),'%'+_0x375af0[_0x18bb('0x73')]+'%');_0x3d120e['or']('c.lastName'+_0x18bb('0x7a'),'%'+_0x375af0['value']+'%');_0x3d120e['or']('c.email'+'\x20LIKE\x20?','%'+_0x375af0['value']+'%');}else{_0x3d120e['and'](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x7a'),'%'+_0x375af0[_0x18bb('0x73')]+'%');}break;case'>':_0x3d120e[_0x18bb('0x6f')](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x7b'),_0x375af0[_0x18bb('0x73')]);break;case'<':_0x3d120e['and'](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x7c'),_0x375af0[_0x18bb('0x73')]);break;}});}else{switch(_0x375af0[_0x18bb('0x72')][_0x18bb('0x73')]){case'IS':if(_0x16d1d2!==_0x18bb('0x74')&&_0x16d1d2!==_0x18bb('0x7d')){if(_[_0x18bb('0x71')](_0x375af0[_0x18bb('0x73')])&&_0x375af0[_0x18bb('0x73')]['length']>0x1){_0x3d120e[_0x18bb('0x6f')](_0x375af0['tableAlias']+'.'+_0x16d1d2+_0x18bb('0x7e'),_0x375af0[_0x18bb('0x73')]);}else{_0x3d120e[_0x18bb('0x6f')](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x77'),_0x375af0[_0x18bb('0x73')][0x0]);}}break;case'=':_0x3d120e[_0x18bb('0x6f')](_0x375af0['tableAlias']+'.'+_0x16d1d2+_0x18bb('0x77'),_0x375af0['value']);break;case _0x18bb('0x7f'):if(_0x16d1d2===_0x18bb('0x78')){_0x3d120e[_0x18bb('0x6f')](_0x18bb('0x79')+_0x18bb('0x7a'),'%'+_0x375af0[_0x18bb('0x73')]+'%');_0x3d120e['or']('c.lastName'+_0x18bb('0x7a'),'%'+_0x375af0['value']+'%');_0x3d120e['or'](_0x18bb('0x80')+_0x18bb('0x7a'),'%'+_0x375af0[_0x18bb('0x73')]+'%');}else{_0x3d120e[_0x18bb('0x6f')](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x7a'),'%'+_0x375af0[_0x18bb('0x73')]+'%');}break;case'>':_0x3d120e[_0x18bb('0x6f')](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x7b'),_0x375af0['value']);break;case'<':_0x3d120e[_0x18bb('0x6f')](_0x375af0[_0x18bb('0x76')]+'.'+_0x16d1d2+_0x18bb('0x7c'),_0x375af0[_0x18bb('0x73')]);break;}}}});}else{var _0x274f65=_(Object[_0x18bb('0x47')](_0x136238[_0x18bb('0x48')]))[_0x18bb('0x3f')](function(_0xaa88ee){return _0x35bfe4[_0x18bb('0x81')](_0xaa88ee)?_0xaa88ee:undefined;})[_0x18bb('0x82')](function(_0x570587){return!_['isNil'](_0x570587);})[_0x18bb('0x73')]();if(!_['isEmpty'](_0x274f65)){_0x274f65[_0x18bb('0x43')](function(_0x50782a){if(_0x50782a===_0x18bb('0x83')){_0x39c94a[_0x18bb('0x55')](_0x18bb('0x84'),[][_0x18bb('0x85')](_0x136238[_0x18bb('0x48')][_0x50782a]));}else if(_0x50782a===_0x18bb('0x68')){var _0xdc17dc=JSON[_0x18bb('0x67')](_0x136238[_0x18bb('0x48')][_0x50782a])[_0x18bb('0x86')];var _0x1d1363=JSON[_0x18bb('0x67')](_0x136238[_0x18bb('0x48')][_0x50782a])[_0x18bb('0x87')];_0x39c94a[_0x18bb('0x55')](_0x18bb('0x70'),_0xdc17dc,_0x1d1363);}else{if(_0x136238[_0x18bb('0x48')][_0x50782a]===_0x18bb('0x88')){_0x39c94a[_0x18bb('0x55')]('i.'+_0x50782a+_0x18bb('0x89'));}else{_0x39c94a[_0x18bb('0x55')]('i.'+_0x50782a+_0x18bb('0x77'),_0x136238[_0x18bb('0x48')][_0x50782a]);}}});}if(_0x136238[_0x18bb('0x48')][_0x18bb('0x82')]){var _0x4bcd7b=_0x136238[_0x18bb('0x48')][_0x18bb('0x82')][_0x18bb('0x8a')]('\x5c','\x5c\x5c')[_0x18bb('0x8a')]('\x27\x27',_0x18bb('0x8b'));if(qs['isNumeric'](_0x4bcd7b)){_0x3d120e['or'](_0x18bb('0x8c'),_0x4bcd7b+'%');}else{var _0xdd8040=[];_0x4bcd7b[_0x18bb('0x42')]('\x20')[_0x18bb('0x43')](function(_0x2ab5d4){_0xdd8040['push']('+'+_0x2ab5d4[_0x18bb('0x8d')]());});var _0x431a46=_0xdd8040[_0x18bb('0x8e')]('\x20');_0x3d120e['or'](_0x18bb('0x8f'),_0x431a46)['or'](_0x18bb('0x90'),_0x4bcd7b+'%');}}}_0x39c94a[_0x18bb('0x55')](_0x3d120e);if(_0x1e8c15[_0x18bb('0x4d')]){_0x1e8c15['order'][_0x18bb('0x43')](function(_0x435a63){_0x39c94a[_0x18bb('0x4d')]('i.'+_0x435a63[0x0],_0x435a63[0x1]===_0x18bb('0x91')?![]:!![]);});}_0x39c94a[_0x18bb('0x92')](_0x18bb('0x93'));var _0x2eebf6={'type':db['Sequelize'][_0x18bb('0x94')][_0x18bb('0x95')],'raw':!![]};var _0x8b6e7=_0x39c94a[_0x18bb('0x96')]()['field'](_0x18bb('0x97'));if(!_0x136238[_0x18bb('0x48')][_0x18bb('0x66')]){if(_0x136238['query'][_0x18bb('0x98')]){if(_0x136238['query']['read']==0x1){_0x8b6e7[_0x18bb('0x55')](util[_0x18bb('0x6c')](_0x18bb('0x99'),_0x23652f['toString']()));_0x39c94a[_0x18bb('0x9a')]('`Messages.count`\x20=\x200');}else{_0x8b6e7[_0x18bb('0x55')](util[_0x18bb('0x6c')](_0x18bb('0x9b'),_0x23652f['toString']()));_0x39c94a[_0x18bb('0x9a')](_0x18bb('0x9c'));}}if(_0x136238[_0x18bb('0x48')]['tag']){var _0x4d47da=_[_0x18bb('0x71')](_0x136238['query'][_0x18bb('0x9d')])?_0x136238['query'][_0x18bb('0x9d')]:new Array(_0x136238[_0x18bb('0x48')][_0x18bb('0x9d')]);var _0x54554b=squel['expr']();_0x4d47da[_0x18bb('0x43')](function(_0x5a03e3){_0x54554b['or'](_0x18bb('0x9e'),'%,'+_0x5a03e3+',%');});_0x39c94a[_0x18bb('0x9a')](_0x54554b);_0x8b6e7[_0x18bb('0x5b')](_0x18bb('0x9f'),'it',_0x18bb('0xa0'));_0x8b6e7['left_join'](_0x18bb('0x54'),'t',_0x18bb('0xa1'));_0x8b6e7['where']('t.id\x20IN\x20?',_0x4d47da);}}else{var _0x24c1fc=JSON[_0x18bb('0x67')](_0x136238[_0x18bb('0x48')][_0x18bb('0x66')]);_[_0x18bb('0x47')](_0x24c1fc)[_0x18bb('0x43')](function(_0xcb4fcd){var _0x548e3e=_0x24c1fc[_0xcb4fcd];if(_0xcb4fcd==='TagId'){var _0x27f4de=_0x548e3e[_0x18bb('0x73')];var _0x10f3e9=squel[_0x18bb('0x65')]();_0x27f4de[_0x18bb('0x43')](function(_0x4818f1){_0x10f3e9['or'](_0x18bb('0x9e'),'%,'+_0x4818f1+',%');});_0x39c94a['having'](_0x10f3e9);_0x8b6e7['left_join']('mail_interaction_has_tags','it',_0x18bb('0xa2'));_0x8b6e7[_0x18bb('0x5b')](_0x18bb('0x54'),'t',_0x18bb('0xa1'));_0x8b6e7['where'](_0x18bb('0xa3'),_0x27f4de);}else if(_0xcb4fcd==='Messages.count'){if(_0x548e3e[_0x18bb('0x73')][_0x18bb('0x75')]===0x1){if(_0x548e3e['value'][0x0]===0x1){_0x8b6e7[_0x18bb('0x55')](util[_0x18bb('0x6c')](_0x18bb('0x99'),_0x23652f[_0x18bb('0x8d')]()));_0x39c94a['having'](_0x18bb('0xa4'));}else{_0x8b6e7['where'](util['format']('%s\x20>\x200',_0x23652f['toString']()));_0x39c94a[_0x18bb('0x9a')](_0x18bb('0x9c'));}}}});}db[_0x18bb('0xa5')][_0x18bb('0x48')](_0x8b6e7[_0x18bb('0x8d')](),_0x2eebf6)[_0x18bb('0x22')](function(_0x43c122){_0x2ab9d1[_0x18bb('0x30')]=_0x43c122[_0x18bb('0x75')];if(_0x2ab9d1[_0x18bb('0x30')]===0x0)return[];return db[_0x18bb('0xa5')][_0x18bb('0x48')](_0x19a791[_0x18bb('0x8d')](),_0x2eebf6)[_0x18bb('0x22')](function(_0xc5bf01){_0x9f6c40=_[_0x18bb('0xa6')](_0xc5bf01,'id');_0x2eebf6=_[_0x18bb('0xa7')](_0x2eebf6,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x39c94a['field'](_0x18bb('0xa8'),_0x18bb('0xa9'));_0x39c94a[_0x18bb('0x52')]('i.*');_0x39c94a[_0x18bb('0x52')](_0x18bb('0x79'),_0x18bb('0xaa'));_0x39c94a[_0x18bb('0x52')](_0x18bb('0xab'),'Contact.lastName');_0x39c94a['field'](_0x18bb('0x80'),_0x18bb('0xac'));_0x39c94a['field'](_0x18bb('0xad'),_0x18bb('0xae'));_0x39c94a[_0x18bb('0x52')](_0x18bb('0xaf'),'Contact.mobile');_0x39c94a[_0x18bb('0x52')](_0x18bb('0xb0'),_0x18bb('0xb1'));_0x39c94a['field'](_0x18bb('0xb2'),_0x18bb('0x41'));_0x39c94a[_0x18bb('0x5b')]('chat_interaction_has_tags','it',_0x18bb('0xa0'));_0x39c94a[_0x18bb('0x5b')](_0x18bb('0x54'),'t','t.id\x20=\x20it.TagId');_0x39c94a[_0x18bb('0x32')](_0x1e8c15[_0x18bb('0x32')]);_0x39c94a[_0x18bb('0x31')](_0x1e8c15['offset']);return db['sequelize']['query'](_0x39c94a[_0x18bb('0x8d')](),_0x2eebf6);})[_0x18bb('0x22')](function(_0x581145){_0x1c282e[_0x18bb('0x55')]('ui.ChatInteractionId\x20IN\x20?',_[_0x18bb('0x3f')](_0x581145,'id'));return db[_0x18bb('0xa5')][_0x18bb('0x48')](_0x1c282e[_0x18bb('0x8d')](),_0x2eebf6)[_0x18bb('0x22')](function(_0x7a1de2){var _0x2d2084=_[_0x18bb('0xb3')](_0x7a1de2,_0x18bb('0xb4'));var _0x3ba3d6=[];_0x581145[_0x18bb('0x43')](function(_0x1d5787){_0x3ba3d6[_0x18bb('0xb5')](updateChatInteraction(_0x1d5787,_0x9f6c40,_0x2d2084));});return BPromise[_0x18bb('0xb6')](_0x3ba3d6);});});})[_0x18bb('0x22')](function(_0x41691f){_0x2ab9d1[_0x18bb('0xb7')]=_0x41691f;return _0x2ab9d1;})[_0x18bb('0x22')](respondWithFilteredResult(_0x5edb37,_0x1e8c15))['catch'](handleError(_0x5edb37,null));};exports[_0x18bb('0xb8')]=function(_0x28f81a,_0x3d4ef7){var _0x8654a0={'raw':![],'where':{'id':_0x28f81a[_0x18bb('0xb9')]['id']}},_0x163857={};_0x163857[_0x18bb('0x46')]=_['keys'](db['ChatInteraction'][_0x18bb('0x45')]);_0x163857['query']=_[_0x18bb('0x47')](_0x28f81a[_0x18bb('0x48')]);_0x163857[_0x18bb('0x4f')]=_[_0x18bb('0x49')](_0x163857[_0x18bb('0x46')],_0x163857[_0x18bb('0x48')]);_0x8654a0[_0x18bb('0x4b')]=_[_0x18bb('0x49')](_0x163857[_0x18bb('0x46')],qs[_0x18bb('0x4a')](_0x28f81a[_0x18bb('0x48')][_0x18bb('0x4a')]));_0x8654a0[_0x18bb('0x4b')]=_0x8654a0['attributes'][_0x18bb('0x75')]?_0x8654a0[_0x18bb('0x4b')]:_0x163857[_0x18bb('0x46')];if(_0x28f81a[_0x18bb('0x48')][_0x18bb('0xba')]){_0x8654a0[_0x18bb('0xbb')]=[{'all':!![]}];}_0x8654a0=_[_0x18bb('0xa7')]({},_0x8654a0,_0x28f81a[_0x18bb('0xbc')]);return db[_0x18bb('0x44')][_0x18bb('0xbd')](_0x8654a0)[_0x18bb('0x22')](handleEntityNotFound(_0x3d4ef7,null))[_0x18bb('0x22')](respondWithResult(_0x3d4ef7,null))[_0x18bb('0x2c')](handleError(_0x3d4ef7,null));};exports['create']=function(_0x45b7dc,_0x3b8034){return db[_0x18bb('0x44')][_0x18bb('0xbe')](_0x45b7dc['body'],{})['then'](respondWithResult(_0x3b8034,0xc9))[_0x18bb('0x2c')](handleError(_0x3b8034,null));};exports[_0x18bb('0x39')]=function(_0x17117a,_0x3e1826){if(_0x17117a[_0x18bb('0xbf')]['id']){delete _0x17117a[_0x18bb('0xbf')]['id'];}return db[_0x18bb('0x44')][_0x18bb('0xbd')]({'where':{'id':_0x17117a[_0x18bb('0xb9')]['id']}})[_0x18bb('0x22')](handleEntityNotFound(_0x3e1826,null))[_0x18bb('0x22')](saveUpdates(_0x17117a[_0x18bb('0xbf')],null))[_0x18bb('0x22')](respondWithResult(_0x3e1826,null))[_0x18bb('0x2c')](handleError(_0x3e1826,null));};exports[_0x18bb('0xc0')]=function(_0xb079d8,_0x372f37){return db[_0x18bb('0x44')][_0x18bb('0xbd')]({'where':{'id':_0xb079d8[_0x18bb('0xb9')]['id']}})[_0x18bb('0x22')](handleEntityNotFound(_0x372f37,null))[_0x18bb('0x22')](removeEntity(_0x372f37,null))['catch'](handleError(_0x372f37,null));};exports[_0x18bb('0xc1')]=function(_0x118a3c,_0x20fdef){return db[_0x18bb('0x44')]['describe']()[_0x18bb('0x22')](respondWithResult(_0x20fdef,null))['catch'](handleError(_0x20fdef,null));};exports[_0x18bb('0xc2')]=function(_0x578505,_0x47d94b){if(_0x578505[_0x18bb('0xbf')]['id']){delete _0x578505['body']['id'];}return db['ChatInteraction'][_0x18bb('0xbd')]({'where':{'id':_0x578505[_0x18bb('0xb9')]['id']}})[_0x18bb('0x22')](handleEntityNotFound(_0x47d94b,null))['then'](saveUpdates(_0x578505[_0x18bb('0xbf')],null))[_0x18bb('0x22')](respondWithResult(_0x47d94b,null))[_0x18bb('0x2c')](handleError(_0x47d94b,null));};exports[_0x18bb('0xc3')]=function(_0x5bf53d,_0x250531,_0x1559e1){if(_0x5bf53d['body']['id']){delete _0x5bf53d[_0x18bb('0xbf')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5bf53d['params']['id']}})[_0x18bb('0x22')](function(_0x5404d1){if(!_0x5404d1){logger[_0x18bb('0x27')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x18bb('0xc3'),0x194,_0x18bb('0xc4'));_0x250531[_0x18bb('0x2d')](0x194);}else{if(_0x5404d1[_0x18bb('0xc5')]){throw new db[(_0x18bb('0xc6'))][(_0x18bb('0xc7'))](_0x18bb('0xc8'));}}return _0x5404d1;})[_0x18bb('0x22')](function(_0x1b37f0){if(_0x1b37f0){return _0x1b37f0[_0x18bb('0x39')]({'closed':_0x5bf53d['body'][_0x18bb('0x3c')],'disposition':_0x5bf53d[_0x18bb('0xbf')][_0x18bb('0xc9')]})[_0x18bb('0x22')](function(_0xc8316a){return _0xc8316a;});}})[_0x18bb('0x22')](function(_0x18596){return respondWithRpcPromise(_0x18bb('0xca'),_0x18bb('0xc3'),_0x5bf53d[_0x18bb('0xbf')],client9004);})[_0x18bb('0x22')](respondWithResult(_0x250531,null))[_0x18bb('0x2c')](handleError(_0x250531,null));};exports[_0x18bb('0xcb')]=function(_0x3f157c,_0x42d7b7,_0x5a0064){_0x3f157c[_0x18bb('0xbf')][_0x18bb('0x3a')]=_0x3f157c['file'][_0x18bb('0xcc')];_0x3f157c[_0x18bb('0xbf')]['basename']=_0x3f157c['file'][_0x18bb('0xcd')];_0x3f157c[_0x18bb('0xbf')][_0x18bb('0xce')]=_0x3f157c['file'][_0x18bb('0xcf')];return db[_0x18bb('0xd0')][_0x18bb('0xbe')](_0x3f157c[_0x18bb('0xbf')])[_0x18bb('0x22')](respondWithResult(_0x42d7b7,0xc9))[_0x18bb('0x2c')](handleError(_0x42d7b7,null));};exports['attachmentDownload']=function(_0x4a8e32,_0xc5b069,_0x1bbeb0){return db['ChatInteraction'][_0x18bb('0xd1')]({'where':{'id':_0x4a8e32[_0x18bb('0xb9')]['id']},'raw':!![]})[_0x18bb('0x22')](handleEntityNotFound(_0xc5b069,null))[_0x18bb('0x22')](function(_0x23b343){if(_0x23b343){if(_0x23b343['closed']){return _0xc5b069[_0x18bb('0x2e')](0x193)[_0x18bb('0x35')]({'status':0x193,'message':_0x18bb('0xd2')});}return db[_0x18bb('0xd0')][_0x18bb('0xd1')]({'where':{'id':_0x4a8e32['query'][_0x18bb('0xd3')]},'raw':!![]})[_0x18bb('0x22')](handleEntityNotFound(_0xc5b069,null));}})[_0x18bb('0x22')](function(_0x164048){if(_0x164048){return _0xc5b069[_0x18bb('0xd4')](path[_0x18bb('0x8e')](config[_0x18bb('0xd5')],_0x18bb('0xd6'),_0x164048[_0x18bb('0xd7')]));}})['catch'](handleError(_0xc5b069,null));};exports['close']=function(_0x15d7c,_0x47ac9c){var _0x91748e=null;var _0x57195a=null;var _0x5b057e=null;var _0x292891=null;if(_0x15d7c[_0x18bb('0xbf')]['id']){delete _0x15d7c[_0x18bb('0xbf')]['id'];}if(_0x15d7c[_0x18bb('0xbf')]['mailTranscript']){_0x292891=path[_0x18bb('0x8e')](config[_0x18bb('0xd5')],_0x18bb('0xd8'),util[_0x18bb('0x6c')]('transcript-%s.txt',Date[_0x18bb('0xd9')]()));_0x15d7c['body'][_0x18bb('0xda')]=_0x292891;}return db['ChatInteraction'][_0x18bb('0xbd')]({'where':{'id':_0x15d7c[_0x18bb('0xb9')]['id']},'include':[{'model':db[_0x18bb('0x3e')],'as':'Messages','include':[{'model':db[_0x18bb('0xdb')],'as':_0x18bb('0xdb')}]}]})[_0x18bb('0x22')](handleEntityNotFound(_0x47ac9c,null))[_0x18bb('0x22')](saveUpdates(_0x15d7c[_0x18bb('0xbf')],null))['then'](function(_0x56eb3f){if(_0x56eb3f){_0x91748e=_0x56eb3f;return db[_0x18bb('0xdc')]['find']({'where':{'id':_0x91748e[_0x18bb('0x83')]}});}})['then'](function(_0xad40b3){if(_0xad40b3){_0x5b057e=_0xad40b3;return db[_0x18bb('0xdd')][_0x18bb('0xbd')]({'where':{'id':_0x91748e['ContactId']}});}})[_0x18bb('0x22')](function(_0x4937ba){if(_0x4937ba){_0x57195a=_0x4937ba;if(_0x292891){var _0xc73fd3=null;for(var _0x2a199b=0x1;_0x2a199b<_0x91748e[_0x18bb('0xde')]['length'];++_0x2a199b){_0xc73fd3=_0x91748e[_0x18bb('0xde')][_0x2a199b];var _0x554507=_0xc73fd3[_0x18bb('0xc5')]?util[_0x18bb('0x6c')]('%s%d',_0x5b057e[_0x18bb('0xdf')],_0xc73fd3[_0x18bb('0xc5')]):_0x18bb('0xe0');var _0x121c58=_0x15d7c[_0x18bb('0xbf')][_0x18bb('0xe1')]||util[_0x18bb('0x6c')]('%s%d','Visitor',_0xc73fd3[_0x18bb('0x78')]);switch(_0x5b057e[_0x18bb('0xe2')]){case _0x18bb('0xe3'):_0x554507=_0xc73fd3[_0x18bb('0xc5')]?util[_0x18bb('0x6c')](_0x18bb('0xe4'),_0x5b057e[_0x18bb('0xdf')],_0xc73fd3['UserId']):_0x18bb('0xe0');break;case _0x18bb('0xe5'):_0x554507=_0xc73fd3['UserId']?_0xc73fd3[_0x18bb('0xdb')][_0x18bb('0xe6')]||_0xc73fd3[_0x18bb('0xdb')][_0x18bb('0xe7')]:'System';break;case _0x18bb('0xe8'):_0x554507=_0xc73fd3[_0x18bb('0xc5')]?_0xc73fd3['User']['fullname']:_0x18bb('0xe0');break;default:_0x554507=_0xc73fd3[_0x18bb('0xc5')]?util[_0x18bb('0x6c')]('%s%d',_0x5b057e[_0x18bb('0xdf')],_0xc73fd3[_0x18bb('0xc5')]):_0x18bb('0xe0');}var _0x4d6b18=util[_0x18bb('0x6c')](_0x18bb('0xe9'),moment(_0xc73fd3[_0x18bb('0x68')])['format'](_0x18bb('0xea')),_0xc73fd3[_0x18bb('0xeb')]==='in'?_0x121c58:_0x554507,_0xc73fd3['body']);if(!_0xc73fd3[_0x18bb('0xec')]){fs[_0x18bb('0xed')](_0x292891,_0x4d6b18);}}return db[_0x18bb('0xee')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x18bb('0xef')],'as':'Smtp','raw':!![]}]});}}})[_0x18bb('0x22')](function(_0xd4a9e3){if(_0xd4a9e3&&_0xd4a9e3[_0x18bb('0xf0')]&&_0x15d7c['body']){var _0x268e06={'tls':{'rejectUnauthorized':![]}};if(_0xd4a9e3[_0x18bb('0xf0')][_0x18bb('0xf1')]){_0x268e06[_0x18bb('0xf1')]=_0xd4a9e3[_0x18bb('0xf0')][_0x18bb('0xf1')];}else{_0x268e06[_0x18bb('0xf2')]=_0xd4a9e3[_0x18bb('0xf0')][_0x18bb('0xf2')];_0x268e06['port']=_0xd4a9e3[_0x18bb('0xf0')][_0x18bb('0xf3')];_0x268e06[_0x18bb('0xf4')]=_0xd4a9e3[_0x18bb('0xf0')][_0x18bb('0xf4')];}if(_0xd4a9e3[_0x18bb('0xf0')][_0x18bb('0xf5')]){_0x268e06[_0x18bb('0xf6')]={'user':_0xd4a9e3[_0x18bb('0xf0')][_0x18bb('0xf7')],'pass':_0xd4a9e3['Smtp']['pass']};}return respondWithRpcPromise(_0x18bb('0xf8'),_0x18bb('0xf9'),{'account':_0x268e06,'message':{'from':util['format'](_0x18bb('0xfa'),_0xd4a9e3[_0x18bb('0x3a')],_0xd4a9e3[_0x18bb('0xfb')]||_0xd4a9e3[_0x18bb('0xf0')]['user']),'to':_0x15d7c[_0x18bb('0xbf')]['mailTranscript'],'subject':_0x18bb('0xfc'),'text':util[_0x18bb('0x6c')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x15d7c[_0x18bb('0xbf')][_0x18bb('0xfd')]),'attachments':[{'path':_0x292891}]}})['then'](function(){return _0x91748e;})['catch'](function(_0x213725){console[_0x18bb('0x27')](_0x213725);});}else{return _0x91748e;}})['then'](respondWithStatusCode(_0x47ac9c,0xc8))[_0x18bb('0x2c')](handleError(_0x47ac9c,null));};exports['addMessage']=function(_0x484d43,_0x19807,_0x543b83){return db[_0x18bb('0x3e')][_0x18bb('0xbd')]({'where':{'id':_0x484d43['params']['id']}})[_0x18bb('0x22')](handleEntityNotFound(_0x19807,null))[_0x18bb('0x22')](function(_0x335ba3){if(_0x335ba3){return _0x335ba3[_0x18bb('0xfe')](_0x484d43[_0x18bb('0xbf')]['ids'],_[_0x18bb('0xff')](_0x484d43[_0x18bb('0xbf')],[_0x18bb('0x100'),'id'])||{});}})[_0x18bb('0x22')](respondWithResult(_0x19807,null))[_0x18bb('0x2c')](handleError(_0x19807,null));};exports[_0x18bb('0x101')]=function(_0x26c5fa,_0x5a097d,_0x207bbf){var _0x25604b={'raw':![],'where':{}};var _0x5b216a={};var _0x4b7458={'count':0x0,'rows':[]};return db[_0x18bb('0x44')]['findOne']({'where':{'id':_0x26c5fa[_0x18bb('0xb9')]['id']}})[_0x18bb('0x22')](handleEntityNotFound(_0x5a097d,null))[_0x18bb('0x22')](function(_0x2b3faf){if(_0x2b3faf){_0x5b216a['model']=_[_0x18bb('0x47')](db[_0x18bb('0x3e')][_0x18bb('0x45')]);_0x5b216a[_0x18bb('0x48')]=_[_0x18bb('0x47')](_0x26c5fa[_0x18bb('0x48')]);_0x5b216a[_0x18bb('0x4f')]=_['intersection'](_0x5b216a['model'],_0x5b216a['query']);_0x25604b['attributes']=_[_0x18bb('0x49')](_0x5b216a[_0x18bb('0x46')],qs['fields'](_0x26c5fa[_0x18bb('0x48')]['fields']));_0x25604b[_0x18bb('0x4b')]=_0x25604b[_0x18bb('0x4b')][_0x18bb('0x75')]?_0x25604b['attributes']:_0x5b216a[_0x18bb('0x46')];if(!_0x26c5fa['query'][_0x18bb('0x81')](_0x18bb('0x4c'))){_0x25604b[_0x18bb('0x32')]=qs['limit'](_0x26c5fa[_0x18bb('0x48')][_0x18bb('0x32')]);_0x25604b[_0x18bb('0x31')]=qs[_0x18bb('0x31')](_0x26c5fa[_0x18bb('0x48')]['offset']);}_0x25604b['order']=qs[_0x18bb('0x4e')](_0x26c5fa[_0x18bb('0x48')][_0x18bb('0x4e')]);_0x25604b[_0x18bb('0x55')]=qs['filters'](_[_0x18bb('0x50')](_0x26c5fa['query'],_0x5b216a['filters']));_0x25604b['where'][_0x18bb('0xb4')]=_0x2b3faf['id'];if(_0x26c5fa[_0x18bb('0x48')][_0x18bb('0x82')]){_0x25604b[_0x18bb('0x55')]=_[_0x18bb('0xa7')](_0x25604b[_0x18bb('0x55')],{'$or':_[_0x18bb('0x3f')](_0x25604b['attributes'],function(_0x2fa545){var _0x32051a={};_0x32051a[_0x2fa545]={'$like':'%'+_0x26c5fa[_0x18bb('0x48')][_0x18bb('0x82')]+'%'};return _0x32051a;})});}if(_0x26c5fa[_0x18bb('0x48')][_0x18bb('0x86')]){var _0xf52ecb=_0x26c5fa[_0x18bb('0x48')][_0x18bb('0x86')][_0x18bb('0x42')](',');var _0x9acdfa={};_0x9acdfa[_0xf52ecb[0x0]]={'$gte':moment(_0xf52ecb[0x1])[_0x18bb('0x6c')](_0x18bb('0x102'))};_0x25604b[_0x18bb('0x55')]=_[_0x18bb('0xa7')](_0x25604b[_0x18bb('0x55')],_0x9acdfa);}_0x25604b=_['merge']({},_0x25604b,_0x26c5fa[_0x18bb('0xbc')]);return db[_0x18bb('0x3e')][_0x18bb('0x30')]({'where':_0x25604b[_0x18bb('0x55')]})[_0x18bb('0x22')](function(_0x78a11b){_0x4b7458[_0x18bb('0x30')]=_0x78a11b;if(_0x26c5fa['query'][_0x18bb('0xba')]){_0x25604b[_0x18bb('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x25604b);})['then'](function(_0x569921){_0x4b7458[_0x18bb('0xb7')]=_0x569921;return _0x4b7458;});}})[_0x18bb('0x22')](respondWithFilteredResult(_0x5a097d,_0x25604b))[_0x18bb('0x2c')](handleError(_0x5a097d,null));};exports['getMyMessages']=function(_0x27c6cb,_0x523efb,_0x1e9cd8){var _0x2c9311={'where':{}},_0x2839ad={},_0x37b79e={'count':0x0,'rows':[]};return db[_0x18bb('0x44')][_0x18bb('0xd1')]({'where':{'id':_0x27c6cb[_0x18bb('0xb9')]['id']}})[_0x18bb('0x22')](handleEntityNotFound(_0x523efb,null))['then'](function(_0x41e0d3){if(_0x41e0d3){_0x2839ad['model']=_[_0x18bb('0x47')](db[_0x18bb('0x3e')]['rawAttributes']);_0x2839ad[_0x18bb('0x48')]=_[_0x18bb('0x47')](_0x27c6cb[_0x18bb('0x48')]);_0x2839ad['filters']=_['intersection'](_0x2839ad['model'],_0x2839ad[_0x18bb('0x48')]);_0x2c9311[_0x18bb('0x4b')]=_[_0x18bb('0x49')](_0x2839ad[_0x18bb('0x46')],qs['fields'](_0x27c6cb[_0x18bb('0x48')][_0x18bb('0x4a')]));_0x2c9311['attributes']=_0x2c9311[_0x18bb('0x4b')][_0x18bb('0x75')]?_0x2c9311[_0x18bb('0x4b')]:_0x2839ad[_0x18bb('0x46')];if(!_0x27c6cb[_0x18bb('0x48')][_0x18bb('0x81')]('nolimit')){_0x2c9311[_0x18bb('0x32')]=qs[_0x18bb('0x32')](_0x27c6cb[_0x18bb('0x48')][_0x18bb('0x32')]);_0x2c9311['offset']=qs[_0x18bb('0x31')](_0x27c6cb[_0x18bb('0x48')][_0x18bb('0x31')]);}_0x2c9311['order']=qs[_0x18bb('0x4e')](_0x27c6cb['query'][_0x18bb('0x4e')]);_0x2c9311[_0x18bb('0x55')]=qs[_0x18bb('0x4f')](_[_0x18bb('0x50')](_0x27c6cb['query'],_0x2839ad[_0x18bb('0x4f')]));_0x2c9311[_0x18bb('0x55')][_0x18bb('0xb4')]=_0x41e0d3['id'];if(_0x27c6cb['query'][_0x18bb('0x82')]){_0x2c9311[_0x18bb('0x55')]=_[_0x18bb('0xa7')](_0x2c9311[_0x18bb('0x55')],{'$or':_[_0x18bb('0x3f')](_0x2c9311[_0x18bb('0x4b')],function(_0x28ff3b){var _0x146d64={};_0x146d64[_0x28ff3b]={'$like':'%'+_0x27c6cb[_0x18bb('0x48')][_0x18bb('0x82')]+'%'};return _0x146d64;})});}_0x2c9311[_0x18bb('0x55')][_0x18bb('0xec')]=![];if(_0x27c6cb[_0x18bb('0x48')]['id']){_0x2c9311['where']['id']={'$gt':_0x27c6cb['query']['id']};}_0x2c9311=_[_0x18bb('0xa7')]({},_0x2c9311,_0x27c6cb[_0x18bb('0xbc')]);return db[_0x18bb('0x3e')][_0x18bb('0x30')]({'where':_0x2c9311[_0x18bb('0x55')]})[_0x18bb('0x22')](function(_0x441bff){_0x37b79e[_0x18bb('0x30')]=_0x441bff;_0x2c9311[_0x18bb('0xbb')]=[];if(_0x27c6cb[_0x18bb('0x48')][_0x18bb('0x103')]){_0x2c9311[_0x18bb('0xbb')][_0x18bb('0xb5')]({'model':db[_0x18bb('0xdb')],'as':_0x18bb('0xdb'),'attributes':['id',_0x18bb('0xe7'),_0x18bb('0xe6')]});}if(_0x27c6cb[_0x18bb('0x48')][_0x18bb('0xba')]){_0x2c9311['include']=[{'all':!![]}];}return db[_0x18bb('0x3e')][_0x18bb('0x104')](_0x2c9311);})[_0x18bb('0x22')](function(_0x4f1b10){_0x37b79e[_0x18bb('0xb7')]=_0x4f1b10;return _0x37b79e;});}})[_0x18bb('0x22')](respondWithFilteredResult(_0x523efb,_0x2c9311))['catch'](handleError(_0x523efb,null));};exports[_0x18bb('0x105')]=function(_0x43ffa1,_0x3802b2,_0x3a4c00){return db[_0x18bb('0x44')]['find']({'where':{'id':_0x43ffa1['params']['id']}})['then'](handleEntityNotFound(_0x3802b2,null))['then'](function(_0x5a86c4){if(_0x5a86c4){return _0x5a86c4[_0x18bb('0x106')](_0x43ffa1[_0x18bb('0xbf')][_0x18bb('0x100')],_[_0x18bb('0xff')](_0x43ffa1['body'],[_0x18bb('0x100'),'id'])||{})[_0x18bb('0x107')](function(){return db[_0x18bb('0x108')][_0x18bb('0x104')]({'attributes':['id',_0x18bb('0x3a'),_0x18bb('0x109')],'where':{'id':_0x43ffa1[_0x18bb('0xbf')][_0x18bb('0x100')]}});})[_0x18bb('0x22')](function(_0xce5d08){socket['emit']('chatInteractionTags:save',{'id':Number(_0x43ffa1['params']['id']),'tags':_0xce5d08||[]});return{'id':Number(_0x43ffa1['params']['id']),'tags':_0xce5d08||[]};});}})[_0x18bb('0x22')](respondWithResult(_0x3802b2,null))[_0x18bb('0x2c')](handleError(_0x3802b2,null));};exports[_0x18bb('0x10a')]=function(_0x892d0a,_0x3e2d29,_0x1105d1){return db[_0x18bb('0x44')][_0x18bb('0xbd')]({'where':{'id':_0x892d0a['params']['id']}})[_0x18bb('0x22')](handleEntityNotFound(_0x3e2d29,null))['then'](function(_0x5c866d){if(_0x5c866d){return _0x5c866d[_0x18bb('0x10a')](_0x892d0a[_0x18bb('0x48')][_0x18bb('0x100')]);}})[_0x18bb('0x22')](respondWithStatusCode(_0x3e2d29,null))[_0x18bb('0x2c')](handleError(_0x3e2d29,null));};exports[_0x18bb('0xd4')]=function(_0x24dace,_0x5f3c67){var _0x124008=moment()['unix']()['toString']();var _0xa52504=path[_0x18bb('0x8e')](config[_0x18bb('0xd5')],_0x18bb('0x10b'),_0x18bb('0x10c'),_0x18bb('0x10d'));var _0x41ead5=path[_0x18bb('0x8e')](config[_0x18bb('0xd5')],'server',_0x18bb('0x10c'),_0x18bb('0x10e'));var _0xb57fb9=path[_0x18bb('0x8e')](_0xa52504,_0x124008);var _0x473d85=util['format'](_0x18bb('0x10f'),_0x24dace[_0x18bb('0xb9')]['id'],_0x124008);var _0x5efb69=path['join'](_0xa52504,_0x473d85);var _0x98c5ce=![];return db[_0x18bb('0x44')][_0x18bb('0xbd')]({'where':{'id':_0x24dace['params']['id']},'include':[{'model':db[_0x18bb('0x3e')],'as':_0x18bb('0xde'),'attributes':['id','body',_0x18bb('0x68'),_0x18bb('0xeb'),_0x18bb('0xec')],'include':[{'model':db[_0x18bb('0xdb')],'as':_0x18bb('0xdb'),'attributes':['id',_0x18bb('0xe7')],'raw':!![]},{'model':db[_0x18bb('0xdd')],'as':'Contact','attributes':['id',_0x18bb('0x110'),_0x18bb('0x111')],'raw':!![]},{'model':db[_0x18bb('0xd0')],'as':_0x18bb('0xd0'),'raw':!![]}]},{'model':db['ChatWebsite'],'as':_0x18bb('0x112'),'attributes':['id',_0x18bb('0x3a')]},{'model':db[_0x18bb('0xdb')],'as':_0x18bb('0x113'),'attributes':['id',_0x18bb('0xe7')]}]})[_0x18bb('0x22')](handleEntityNotFound(_0x5f3c67,null))['then'](function(_0x424a2b){if(_0x424a2b){var _0x5d8982=_0x424a2b[_0x18bb('0x114')]({'plain':!![]});_0x98c5ce=!![];var _0x25840e={'format':'A4','border':_0x18bb('0x115'),'header':{'height':_0x18bb('0x116'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x18bb('0x117'),'contents':{'default':util[_0x18bb('0x6c')](_0x18bb('0x118'),util[_0x18bb('0x6c')]('%s\x20#%d',_0x18bb('0x119'),_0x5d8982['id']),moment()[_0x18bb('0x6c')](_0x18bb('0x11a'))[_0x18bb('0x8d')]())}}};fs['mkdirSync'](_0xb57fb9);var _0x3a6140={'channel':'Chat','account':_0x5d8982[_0x18bb('0x112')]['name'],'agent':_0x5d8982[_0x18bb('0x113')]?_0x5d8982[_0x18bb('0x113')][_0x18bb('0xe7')]:_0x18bb('0x11b'),'createdAt':moment(_0x5d8982[_0x18bb('0x68')])[_0x18bb('0x6c')](_0x18bb('0x102'))[_0x18bb('0x8d')](),'closedAt':_0x5d8982['closed']?moment(_0x5d8982[_0x18bb('0x11c')])[_0x18bb('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x18bb('0x8d')]():'','disposition':_0x5d8982['disposition'],'chatInfo':{'browser':_0x5d8982[_0x18bb('0x11d')],'os':_0x5d8982['osName'],'referer':_0x5d8982[_0x18bb('0x11e')],'customerIp':_0x5d8982[_0x18bb('0x11f')]},'messages':_(_0x5d8982['Messages'])[_0x18bb('0x120')]()[_0x18bb('0x82')]({'secret':![]})['map'](function(_0x16fb25){if(_0x16fb25['Attachment']){var _0x32b368=path[_0x18bb('0x8e')](_0x41ead5,_0x16fb25[_0x18bb('0xd0')]['basename']);if(fs[_0x18bb('0x121')](_0x32b368)){fs['createReadStream'](_0x32b368)['pipe'](fs[_0x18bb('0x122')](path[_0x18bb('0x8e')](_0xb57fb9,_0x16fb25[_0x18bb('0xd0')][_0x18bb('0xd7')])));}}return{'date':moment(_0x16fb25[_0x18bb('0x68')])[_0x18bb('0x6c')](_0x18bb('0x102'))[_0x18bb('0x8d')](),'sender':_0x16fb25[_0x18bb('0xeb')]===_0x18bb('0x123')?_0x16fb25[_0x18bb('0xdb')]?_0x16fb25['User'][_0x18bb('0xe7')]:_0x18bb('0xe0'):_0x16fb25[_0x18bb('0x124')][_0x18bb('0x110')]+(_0x16fb25[_0x18bb('0x124')]['lastName']?'\x20'+_0x16fb25['Contact'][_0x18bb('0x111')]:''),'body':_0x16fb25['Attachment']?_0x16fb25['Attachment'][_0x18bb('0xd7')]:_0x16fb25[_0x18bb('0xbf')],'direction':_0x16fb25[_0x18bb('0xeb')]===_0x18bb('0x123')?'A':'C','secret':_0x16fb25[_0x18bb('0xec')],'attachment':_0x16fb25[_0x18bb('0xd0')]};})['value']()};return ejs[_0x18bb('0x125')](path[_0x18bb('0x8e')](config[_0x18bb('0xd5')],_0x18bb('0x10b'),_0x18bb('0x126'),'downloadInteraction.html'),{'interaction':_0x3a6140})[_0x18bb('0x22')](function(_0x527246){return new BPromise(function(_0x4e47e5,_0x366b1d){pdf['create'](_0x527246,_0x25840e)[_0x18bb('0x127')](path[_0x18bb('0x8e')](_0xb57fb9,_0x18bb('0x128')+_0x5d8982['id']+'-'+_0x124008+_0x18bb('0x129')),function(_0x2c828c,_0x49617f){if(_0x2c828c)return _0x366b1d(_0x2c828c);_0x4e47e5(_0x49617f);});});});}})[_0x18bb('0x22')](function(){if(_0x98c5ce){return new BPromise(function(_0x3b5eff,_0x4148fd){zipdir(_0xb57fb9,{'saveTo':_0x5efb69},function(_0x551921,_0x4ca261){if(_0x551921)return _0x4148fd(_0x551921);return _0x3b5eff(_0x4ca261);});})['then'](function(){return new BPromise(function(_0x125a6b,_0x365e1d){rimraf(_0xb57fb9,function(_0x4a7560){if(_0x4a7560)_0x365e1d(_0x4a7560);return _0x125a6b();});});})[_0x18bb('0x22')](function(){return _0x5f3c67['download'](_0x5efb69,_0x473d85,function(_0x24c28e){if(_0x24c28e){console[_0x18bb('0x12a')](_0x18bb('0x12b'),_0x24c28e);}else{fs[_0x18bb('0x12c')](_0x5efb69);}});});}else{return _0x5f3c67[_0x18bb('0x2d')](0xc8);}})[_0x18bb('0x2c')](handleError(_0x5f3c67,null));}; \ No newline at end of file +var _0x3a99=['sequelize','keyBy','merge','a.key','Account.key','i.*','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','ChatInteraction','options','find','create','body','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','attachmentDownload','findOne','Unauthorized','Attachment','attachId','download','root','server/files/attachments/','close','server/files/chat/upload/','transcript-%s.txt','ChatWebsite','CmContact','Messages','%s%d','agentAlias','customer','agentIdentifier','website_alias','System','agent_alias','User','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','includeAll','include','findAll','getMyMessages','secret','includeAgent','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','Account','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Chat','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerIp','existsSync','createReadStream','out','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','name','send','unreadMessages','ChatMessage','Users','map','Tags','TagIds','split','forEach','index','rawAttributes','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','COUNT(*)','from','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','expr','parse','advancedFilter','createdAt','value','dateStart','startOf','day','format','endOf','and','isArray','condition','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','TagId','LIKE','c.lastName','filter','isNil','isEmpty','ChatWebsiteId','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','read','%s\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','%s\x20=\x200','`Messages.count`\x20>\x200'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x3a99,0x86));var _0x93a9=function(_0x41b6df,_0x2b0ee9){_0x41b6df=_0x41b6df-0x0;var _0x3f0a33=_0x3a99[_0x41b6df];return _0x3f0a33;};'use strict';var pdf=require(_0x93a9('0x0'));var emlformat=require(_0x93a9('0x1'));var rimraf=require(_0x93a9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93a9('0x3'));var rp=require(_0x93a9('0x4'));var moment=require(_0x93a9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x93a9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x93a9('0x7'));var csv=require('to-csv');var ejs=require(_0x93a9('0x8'));var fs=require('fs');var _=require(_0x93a9('0x9'));var squel=require(_0x93a9('0xa'));var crypto=require(_0x93a9('0xb'));var jsforce=require(_0x93a9('0xc'));var deskjs=require(_0x93a9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93a9('0xe'));var Papa=require(_0x93a9('0xf'));var Redis=require(_0x93a9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x93a9('0x11'));var utils=require(_0x93a9('0x12'));var config=require('../../config/environment');var db=require(_0x93a9('0x13'))['db'];config[_0x93a9('0x14')]=_['defaults'](config[_0x93a9('0x14')],{'host':_0x93a9('0x15'),'port':0x18eb});var socket=require(_0x93a9('0x16'))(new Redis(config['redis']));require(_0x93a9('0x17'))['register'](socket);var jayson=require(_0x93a9('0x18'));var client=jayson[_0x93a9('0x19')]['http']({'port':0x232b});var client9004=jayson[_0x93a9('0x19')][_0x93a9('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x5583b4,_0x58af2a,_0x24ccf5){if(_0x24ccf5){var _0x3162ef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3162ef['test'](_0x58af2a)){return _0x5583b4;}else{throw new Error(_0x93a9('0x1b'));}}else{return _0x5583b4;}}function respondWithRpcPromise(_0x172e21,_0x36b34a,_0x316cec,_0x463298){return new BPromise(function(_0x13b09e,_0x32e450){var _0x56590d=_0x463298||client;return _0x56590d[_0x93a9('0x1c')](_0x172e21,_0x316cec)[_0x93a9('0x1d')](function(_0xec22ca){logger[_0x93a9('0x1e')](_0x93a9('0x1f'),_0x36b34a,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x36b34a,_0x93a9('0x20'),JSON[_0x93a9('0x21')](_0xec22ca));if(_0xec22ca[_0x93a9('0x22')]){if(_0xec22ca[_0x93a9('0x22')]['code']===0x1f4){logger[_0x93a9('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x36b34a,_0xec22ca[_0x93a9('0x22')][_0x93a9('0x23')]);return _0x32e450(_0xec22ca[_0x93a9('0x22')][_0x93a9('0x23')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x36b34a,_0xec22ca[_0x93a9('0x22')]['message']);return _0x13b09e(_0xec22ca['error'][_0x93a9('0x23')]);}else{logger[_0x93a9('0x1e')](_0x93a9('0x1f'),_0x36b34a,_0x93a9('0x20'));_0x13b09e(_0xec22ca[_0x93a9('0x24')][_0x93a9('0x23')]);}})[_0x93a9('0x25')](function(_0x12ec8a){logger[_0x93a9('0x22')](_0x93a9('0x1f'),_0x36b34a,_0x12ec8a);_0x32e450(_0x12ec8a);});});}function respondWithStatusCode(_0x57313e,_0x5150d3){_0x5150d3=_0x5150d3||0xcc;return function(_0x4e6eb8){if(_0x4e6eb8){return _0x57313e['sendStatus'](_0x5150d3);}return _0x57313e['status'](_0x5150d3)[_0x93a9('0x26')]();};}function respondWithResult(_0x43fa74,_0x2fd0c9){_0x2fd0c9=_0x2fd0c9||0xc8;return function(_0x5e49a7){if(_0x5e49a7){return _0x43fa74[_0x93a9('0x27')](_0x2fd0c9)[_0x93a9('0x28')](_0x5e49a7);}};}function respondWithFilteredResult(_0x22b44f,_0x4dea57){return function(_0x48ea5a){if(_0x48ea5a){var _0x35f934=_0x48ea5a[_0x93a9('0x29')],_0x158c73=_0x4dea57[_0x93a9('0x2a')],_0x367390=_0x4dea57['offset']+_0x4dea57[_0x93a9('0x2b')],_0x3859d6;if(_0x367390>=_0x35f934){_0x367390=_0x35f934;_0x3859d6=0xc8;}else{_0x3859d6=0xce;}_0x22b44f[_0x93a9('0x27')](_0x3859d6);return _0x22b44f[_0x93a9('0x2c')](_0x93a9('0x2d'),_0x158c73+'-'+_0x367390+'/'+_0x35f934)[_0x93a9('0x28')](_0x48ea5a);}return null;};}function patchUpdates(_0x364bdd){return function(_0x41549c){try{jsonpatch['apply'](_0x41549c,_0x364bdd,!![]);}catch(_0x51dc28){return BPromise[_0x93a9('0x2e')](_0x51dc28);}return _0x41549c[_0x93a9('0x2f')]();};}function saveUpdates(_0x4f6492,_0x57674c){return function(_0x262c6a){if(_0x262c6a){return _0x262c6a[_0x93a9('0x30')](_0x4f6492)[_0x93a9('0x1d')](function(_0x2fbcd2){return _0x2fbcd2;});}return null;};}function removeEntity(_0x27a8b9,_0x2903e9){return function(_0x4a234e){if(_0x4a234e){return _0x4a234e[_0x93a9('0x31')]()[_0x93a9('0x1d')](function(){_0x27a8b9[_0x93a9('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43451d,_0x4f2a3d){return function(_0x8d1916){if(!_0x8d1916){_0x43451d[_0x93a9('0x32')](0x194);}return _0x8d1916;};}function handleError(_0x48eb07,_0x1edbcf){_0x1edbcf=_0x1edbcf||0x1f4;return function(_0x2ca8bd){logger[_0x93a9('0x22')](_0x2ca8bd['stack']);if(_0x2ca8bd[_0x93a9('0x33')]){delete _0x2ca8bd['name'];}_0x48eb07[_0x93a9('0x27')](_0x1edbcf)[_0x93a9('0x34')](_0x2ca8bd);};}function getInteractionUnreadMessages(_0x4e6c1b){return new BPromise(function(_0x572a82,_0x379218){try{if(_0x4e6c1b['closed']){_0x4e6c1b[_0x93a9('0x35')]=0x0;_0x572a82(_0x4e6c1b);}else{return db[_0x93a9('0x36')][_0x93a9('0x29')]({'where':{'ChatInteractionId':_0x4e6c1b['id'],'direction':'in','read':![]}})[_0x93a9('0x1d')](function(_0x2173e9){_0x4e6c1b[_0x93a9('0x35')]=_0x2173e9;_0x572a82(_0x4e6c1b);});}}catch(_0x350fde){_0x379218(_0x350fde);}});}function getInteractionUsers(_0x46dd22,_0x2e6be0){return new BPromise(function(_0x10e830,_0xcd0a97){try{if(_0x2e6be0[_0x46dd22['id']]){_0x46dd22[_0x93a9('0x37')]=_[_0x93a9('0x38')](_0x2e6be0[_0x46dd22['id']],function(_0x5340a4){return{'id':_0x5340a4['id']};});}}catch(_0x13092a){_0xcd0a97(_0x13092a);}_0x10e830(_0x46dd22);});}function getInteractionTags(_0x3defb5,_0x386371){return new BPromise(function(_0x4148ff,_0x43e950){try{if(_0x3defb5['TagIds']){_0x3defb5[_0x93a9('0x39')]=[];_0x3defb5[_0x93a9('0x3a')][_0x93a9('0x3b')](',')[_0x93a9('0x3c')](function(_0x3b82b7){_0x3defb5['Tags']['push'](_0x386371[_0x3b82b7]);});}delete _0x3defb5['TagIds'];}catch(_0x950d9){_0x43e950(_0x950d9);}_0x4148ff(_0x3defb5);});}function updateChatInteraction(_0x4a7dcf,_0x4eaa63,_0x52d682){return new BPromise(function(_0x407d0b,_0x25ed9f){return getInteractionUnreadMessages(_0x4a7dcf)['then'](function(_0x3424c8){return getInteractionUsers(_0x3424c8,_0x52d682);})[_0x93a9('0x1d')](function(_0x39fdd6){return getInteractionTags(_0x39fdd6,_0x4eaa63);})[_0x93a9('0x1d')](function(_0x41f516){_0x407d0b(_0x41f516);})[_0x93a9('0x25')](function(_0x558dd5){_0x25ed9f(_0x558dd5);});});}exports[_0x93a9('0x3d')]=function(_0x3eb1ec,_0x31fb41){var _0x3c115a={},_0x5016fe={},_0x2a8aa3={'count':0x0,'rows':[]};var _0x26390d=db['ChatInteraction'][_0x93a9('0x3e')];_0x5016fe[_0x93a9('0x3f')]=_[_0x93a9('0x40')](_0x26390d);_0x5016fe['query']=_[_0x93a9('0x40')](_0x3eb1ec['query']);_0x5016fe[_0x93a9('0x41')]=_['intersection'](_0x5016fe['model'],_0x5016fe[_0x93a9('0x42')]);_0x3c115a[_0x93a9('0x43')]=_[_0x93a9('0x44')](_0x5016fe['model'],qs['fields'](_0x3eb1ec['query'][_0x93a9('0x45')]));_0x3c115a['attributes']=_0x3c115a[_0x93a9('0x43')][_0x93a9('0x46')]?_0x3c115a['attributes']:_0x5016fe[_0x93a9('0x3f')];if(!_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x47')](_0x93a9('0x48'))){_0x3c115a[_0x93a9('0x2b')]=qs[_0x93a9('0x2b')](_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x2b')]);_0x3c115a[_0x93a9('0x2a')]=qs[_0x93a9('0x2a')](_0x3eb1ec[_0x93a9('0x42')]['offset']);}_0x3c115a[_0x93a9('0x49')]=qs['sort'](_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x4a')]);_0x3c115a[_0x93a9('0x4b')]=qs['filters'](_[_0x93a9('0x4c')](_0x3eb1ec[_0x93a9('0x42')],_0x5016fe[_0x93a9('0x41')]));var _0x57341a=[];var _0x37b44c=squel[_0x93a9('0x4d')]()['field']('id')[_0x93a9('0x4e')](_0x93a9('0x33'))[_0x93a9('0x4e')](_0x93a9('0x4f'))['from'](_0x93a9('0x50'));var _0x28cd74=squel[_0x93a9('0x4d')]()[_0x93a9('0x4e')](_0x93a9('0x51'))[_0x93a9('0x52')](_0x93a9('0x53'),'me')[_0x93a9('0x4b')](_0x93a9('0x54'))[_0x93a9('0x4b')](_0x93a9('0x55'))[_0x93a9('0x4b')](_0x93a9('0x56'));var _0x17cf3a=squel[_0x93a9('0x4d')]()[_0x93a9('0x4e')]('u.id')[_0x93a9('0x4e')]('ui.ChatInteractionId')[_0x93a9('0x52')](_0x93a9('0x57'),'ui')[_0x93a9('0x58')](_0x93a9('0x59'),'u',_0x93a9('0x5a'));var _0x402654=squel['select']()[_0x93a9('0x52')](_0x93a9('0x5b'),'i')[_0x93a9('0x58')](_0x93a9('0x5c'),'c',_0x93a9('0x5d'))[_0x93a9('0x58')](_0x93a9('0x59'),'o',_0x93a9('0x5e'))[_0x93a9('0x58')]('chat_websites','a',_0x93a9('0x5f'))[_0x93a9('0x58')](_0x93a9('0x53'),'me',_0x93a9('0x54'));var _0x5c4d0b=squel[_0x93a9('0x60')]();if(_0x3eb1ec[_0x93a9('0x42')]['advancedFilter']){var _0x2ae23f=JSON[_0x93a9('0x61')](_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x62')]);_[_0x93a9('0x40')](_0x2ae23f)[_0x93a9('0x3c')](function(_0x5c9eb9){var _0x348719=_0x2ae23f[_0x5c9eb9];if(_0x5c9eb9===_0x93a9('0x63')){var _0x1d492b=moment(_0x348719[_0x93a9('0x64')][_0x93a9('0x65')])[_0x93a9('0x66')](_0x93a9('0x67'))['utc']()[_0x93a9('0x68')]();var _0x120c50=moment(_0x120c50)['utc']()[_0x93a9('0x69')](_0x93a9('0x67'))[_0x93a9('0x68')]();_0x5c4d0b[_0x93a9('0x6a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1d492b,_0x120c50);}else{if(_[_0x93a9('0x6b')](_0x348719['condition'])){_0x348719[_0x93a9('0x6c')]['forEach'](function(_0x2a2e08){switch(_0x348719[_0x93a9('0x6c')][_0x93a9('0x64')]){case'IS':if(_0x5c9eb9!=='TagId'&&_0x5c9eb9!==_0x93a9('0x6d')){if(_['isArray'](_0x348719['value'])&&_0x348719['value']['length']>0x1){_0x5c4d0b[_0x93a9('0x6a')](_0x348719[_0x93a9('0x6e')]+'.'+_0x5c9eb9+_0x93a9('0x6f'),_0x348719[_0x93a9('0x64')]);}else{_0x5c4d0b[_0x93a9('0x6a')](_0x348719['tableAlias']+'.'+_0x5c9eb9+_0x93a9('0x70'),_0x348719['value'][0x0]);}}break;case'=':_0x5c4d0b[_0x93a9('0x6a')](_0x348719[_0x93a9('0x6e')]+'.'+_0x5c9eb9+_0x93a9('0x70'),_0x348719[_0x93a9('0x64')]);break;case'LIKE':if(_0x5c9eb9===_0x93a9('0x71')){_0x5c4d0b[_0x93a9('0x6a')](_0x93a9('0x72')+_0x93a9('0x73'),'%'+_0x348719['value']+'%');_0x5c4d0b['or']('c.lastName'+_0x93a9('0x73'),'%'+_0x348719[_0x93a9('0x64')]+'%');_0x5c4d0b['or'](_0x93a9('0x74')+_0x93a9('0x73'),'%'+_0x348719['value']+'%');}else{_0x5c4d0b['and'](_0x348719[_0x93a9('0x6e')]+'.'+_0x5c9eb9+_0x93a9('0x73'),'%'+_0x348719[_0x93a9('0x64')]+'%');}break;case'>':_0x5c4d0b[_0x93a9('0x6a')](_0x348719[_0x93a9('0x6e')]+'.'+_0x5c9eb9+_0x93a9('0x75'),_0x348719[_0x93a9('0x64')]);break;case'<':_0x5c4d0b[_0x93a9('0x6a')](_0x348719['tableAlias']+'.'+_0x5c9eb9+_0x93a9('0x76'),_0x348719[_0x93a9('0x64')]);break;}});}else{switch(_0x348719[_0x93a9('0x6c')][_0x93a9('0x64')]){case'IS':if(_0x5c9eb9!==_0x93a9('0x77')&&_0x5c9eb9!==_0x93a9('0x6d')){if(_[_0x93a9('0x6b')](_0x348719[_0x93a9('0x64')])&&_0x348719[_0x93a9('0x64')][_0x93a9('0x46')]>0x1){_0x5c4d0b[_0x93a9('0x6a')](_0x348719[_0x93a9('0x6e')]+'.'+_0x5c9eb9+_0x93a9('0x6f'),_0x348719[_0x93a9('0x64')]);}else{_0x5c4d0b[_0x93a9('0x6a')](_0x348719['tableAlias']+'.'+_0x5c9eb9+_0x93a9('0x70'),_0x348719['value'][0x0]);}}break;case'=':_0x5c4d0b[_0x93a9('0x6a')](_0x348719[_0x93a9('0x6e')]+'.'+_0x5c9eb9+'\x20=\x20?',_0x348719[_0x93a9('0x64')]);break;case _0x93a9('0x78'):if(_0x5c9eb9===_0x93a9('0x71')){_0x5c4d0b['and'](_0x93a9('0x72')+'\x20LIKE\x20?','%'+_0x348719['value']+'%');_0x5c4d0b['or'](_0x93a9('0x79')+_0x93a9('0x73'),'%'+_0x348719[_0x93a9('0x64')]+'%');_0x5c4d0b['or'](_0x93a9('0x74')+'\x20LIKE\x20?','%'+_0x348719['value']+'%');}else{_0x5c4d0b['and'](_0x348719[_0x93a9('0x6e')]+'.'+_0x5c9eb9+'\x20LIKE\x20?','%'+_0x348719[_0x93a9('0x64')]+'%');}break;case'>':_0x5c4d0b[_0x93a9('0x6a')](_0x348719['tableAlias']+'.'+_0x5c9eb9+'\x20>\x20?',_0x348719[_0x93a9('0x64')]);break;case'<':_0x5c4d0b[_0x93a9('0x6a')](_0x348719['tableAlias']+'.'+_0x5c9eb9+'\x20<\x20?',_0x348719[_0x93a9('0x64')]);break;}}}});}else{var _0x367156=_(Object[_0x93a9('0x40')](_0x3eb1ec[_0x93a9('0x42')]))[_0x93a9('0x38')](function(_0x4e4eda){return _0x26390d['hasOwnProperty'](_0x4e4eda)?_0x4e4eda:undefined;})[_0x93a9('0x7a')](function(_0xebbdd4){return!_[_0x93a9('0x7b')](_0xebbdd4);})['value']();if(!_[_0x93a9('0x7c')](_0x367156)){_0x367156[_0x93a9('0x3c')](function(_0x2db3bb){if(_0x2db3bb===_0x93a9('0x7d')){_0x402654[_0x93a9('0x4b')]('i.ChatWebsiteId\x20IN\x20?',[][_0x93a9('0x7e')](_0x3eb1ec['query'][_0x2db3bb]));}else if(_0x2db3bb===_0x93a9('0x63')){var _0x2cf125=JSON[_0x93a9('0x61')](_0x3eb1ec[_0x93a9('0x42')][_0x2db3bb])[_0x93a9('0x7f')];var _0x5c31fc=JSON[_0x93a9('0x61')](_0x3eb1ec[_0x93a9('0x42')][_0x2db3bb])[_0x93a9('0x80')];_0x402654[_0x93a9('0x4b')](_0x93a9('0x81'),_0x2cf125,_0x5c31fc);}else{if(_0x3eb1ec[_0x93a9('0x42')][_0x2db3bb]===_0x93a9('0x82')){_0x402654[_0x93a9('0x4b')]('i.'+_0x2db3bb+_0x93a9('0x83'));}else{_0x402654[_0x93a9('0x4b')]('i.'+_0x2db3bb+'\x20=\x20?',_0x3eb1ec[_0x93a9('0x42')][_0x2db3bb]);}}});}if(_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x7a')]){var _0x45f97b=_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x7a')][_0x93a9('0x84')]('\x5c','\x5c\x5c')[_0x93a9('0x84')]('\x27\x27',_0x93a9('0x85'));if(qs[_0x93a9('0x86')](_0x45f97b)){_0x5c4d0b['or'](_0x93a9('0x87'),_0x45f97b+'%');}else{var _0x471747=[];_0x45f97b['split']('\x20')[_0x93a9('0x3c')](function(_0x8b4f2b){_0x471747[_0x93a9('0x88')]('+'+_0x8b4f2b[_0x93a9('0x89')]());});var _0x412a91=_0x471747[_0x93a9('0x8a')]('\x20');_0x5c4d0b['or'](_0x93a9('0x8b'),_0x412a91)['or'](_0x93a9('0x8c'),_0x45f97b+'%');}}}_0x402654['where'](_0x5c4d0b);if(_0x3c115a['order']){_0x3c115a['order']['forEach'](function(_0x2ddeb4){_0x402654[_0x93a9('0x49')]('i.'+_0x2ddeb4[0x0],_0x2ddeb4[0x1]==='DESC'?![]:!![]);});}_0x402654[_0x93a9('0x8d')]('i.id');var _0x55d58a={'type':db[_0x93a9('0x8e')][_0x93a9('0x8f')][_0x93a9('0x90')],'raw':!![]};var _0x3f6770=_0x402654[_0x93a9('0x91')]()[_0x93a9('0x4e')](_0x93a9('0x51'));if(!_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x62')]){if(_0x3eb1ec['query'][_0x93a9('0x92')]){if(_0x3eb1ec[_0x93a9('0x42')]['read']==0x1){_0x3f6770[_0x93a9('0x4b')](util[_0x93a9('0x68')]('%s\x20=\x200',_0x28cd74[_0x93a9('0x89')]()));_0x402654['having']('`Messages.count`\x20=\x200');}else{_0x3f6770[_0x93a9('0x4b')](util[_0x93a9('0x68')](_0x93a9('0x93'),_0x28cd74[_0x93a9('0x89')]()));_0x402654['having']('`Messages.count`\x20>\x200');}}if(_0x3eb1ec[_0x93a9('0x42')]['tag']){var _0x191768=_[_0x93a9('0x6b')](_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x94')])?_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x94')]:new Array(_0x3eb1ec[_0x93a9('0x42')]['tag']);var _0x1d7ca9=squel['expr']();_0x191768['forEach'](function(_0x4805c9){_0x1d7ca9['or'](_0x93a9('0x95'),'%,'+_0x4805c9+',%');});_0x402654[_0x93a9('0x96')](_0x1d7ca9);_0x3f6770[_0x93a9('0x58')](_0x93a9('0x97'),'it',_0x93a9('0x98'));_0x3f6770[_0x93a9('0x58')](_0x93a9('0x50'),'t',_0x93a9('0x99'));_0x3f6770[_0x93a9('0x4b')](_0x93a9('0x9a'),_0x191768);}}else{var _0x2ae23f=JSON[_0x93a9('0x61')](_0x3eb1ec[_0x93a9('0x42')][_0x93a9('0x62')]);_['keys'](_0x2ae23f)[_0x93a9('0x3c')](function(_0x51263b){var _0x42ba94=_0x2ae23f[_0x51263b];if(_0x51263b===_0x93a9('0x77')){var _0x4103b8=_0x42ba94['value'];var _0x5f47da=squel[_0x93a9('0x60')]();_0x4103b8['forEach'](function(_0x2f1faa){_0x5f47da['or'](_0x93a9('0x95'),'%,'+_0x2f1faa+',%');});_0x402654[_0x93a9('0x96')](_0x5f47da);_0x3f6770[_0x93a9('0x58')](_0x93a9('0x9b'),'it',_0x93a9('0x9c'));_0x3f6770[_0x93a9('0x58')](_0x93a9('0x50'),'t',_0x93a9('0x99'));_0x3f6770[_0x93a9('0x4b')](_0x93a9('0x9a'),_0x4103b8);}else if(_0x51263b==='Messages.count'){if(_0x42ba94[_0x93a9('0x64')]['length']===0x1){if(_0x42ba94[_0x93a9('0x64')][0x0]===0x1){_0x3f6770[_0x93a9('0x4b')](util['format'](_0x93a9('0x9d'),_0x28cd74['toString']()));_0x402654[_0x93a9('0x96')]('`Messages.count`\x20=\x200');}else{_0x3f6770['where'](util['format']('%s\x20>\x200',_0x28cd74['toString']()));_0x402654[_0x93a9('0x96')](_0x93a9('0x9e'));}}}});}db[_0x93a9('0x9f')][_0x93a9('0x42')](_0x3f6770[_0x93a9('0x89')](),_0x55d58a)['then'](function(_0x1f9a45){_0x2a8aa3[_0x93a9('0x29')]=_0x1f9a45[_0x93a9('0x46')];if(_0x2a8aa3[_0x93a9('0x29')]===0x0)return[];return db[_0x93a9('0x9f')][_0x93a9('0x42')](_0x37b44c[_0x93a9('0x89')](),_0x55d58a)[_0x93a9('0x1d')](function(_0x481d5c){_0x57341a=_[_0x93a9('0xa0')](_0x481d5c,'id');_0x55d58a=_[_0x93a9('0xa1')](_0x55d58a,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x402654[_0x93a9('0x4e')](_0x93a9('0xa2'),_0x93a9('0xa3'));_0x402654[_0x93a9('0x4e')](_0x93a9('0xa4'));_0x402654[_0x93a9('0x4e')]('c.firstName','Contact.firstName');_0x402654[_0x93a9('0x4e')](_0x93a9('0x79'),_0x93a9('0xa5'));_0x402654[_0x93a9('0x4e')](_0x93a9('0x74'),_0x93a9('0xa6'));_0x402654[_0x93a9('0x4e')](_0x93a9('0xa7'),_0x93a9('0xa8'));_0x402654[_0x93a9('0x4e')](_0x93a9('0xa9'),_0x93a9('0xaa'));_0x402654[_0x93a9('0x4e')](_0x93a9('0xab'),'Contact.fax');_0x402654['field'](_0x93a9('0xac'),_0x93a9('0x3a'));_0x402654[_0x93a9('0x58')](_0x93a9('0x97'),'it',_0x93a9('0x98'));_0x402654[_0x93a9('0x58')](_0x93a9('0x50'),'t',_0x93a9('0x99'));_0x402654[_0x93a9('0x2b')](_0x3c115a[_0x93a9('0x2b')]);_0x402654[_0x93a9('0x2a')](_0x3c115a['offset']);return db[_0x93a9('0x9f')][_0x93a9('0x42')](_0x402654[_0x93a9('0x89')](),_0x55d58a);})[_0x93a9('0x1d')](function(_0x1f8aad){_0x17cf3a['where'](_0x93a9('0xad'),_[_0x93a9('0x38')](_0x1f8aad,'id'));return db[_0x93a9('0x9f')][_0x93a9('0x42')](_0x17cf3a[_0x93a9('0x89')](),_0x55d58a)[_0x93a9('0x1d')](function(_0x2e6c96){var _0x52ada3=_['groupBy'](_0x2e6c96,_0x93a9('0xae'));var _0x2f6aff=[];_0x1f8aad[_0x93a9('0x3c')](function(_0xd9c585){_0x2f6aff[_0x93a9('0x88')](updateChatInteraction(_0xd9c585,_0x57341a,_0x52ada3));});return BPromise[_0x93a9('0xaf')](_0x2f6aff);});});})['then'](function(_0x458da7){_0x2a8aa3[_0x93a9('0xb0')]=_0x458da7;return _0x2a8aa3;})[_0x93a9('0x1d')](respondWithFilteredResult(_0x31fb41,_0x3c115a))[_0x93a9('0x25')](handleError(_0x31fb41,null));};exports['show']=function(_0x3a1d3b,_0x248a84){var _0x454703={'raw':![],'where':{'id':_0x3a1d3b[_0x93a9('0xb1')]['id']}},_0x32307a={};_0x32307a[_0x93a9('0x3f')]=_[_0x93a9('0x40')](db[_0x93a9('0xb2')][_0x93a9('0x3e')]);_0x32307a[_0x93a9('0x42')]=_[_0x93a9('0x40')](_0x3a1d3b['query']);_0x32307a[_0x93a9('0x41')]=_['intersection'](_0x32307a[_0x93a9('0x3f')],_0x32307a[_0x93a9('0x42')]);_0x454703[_0x93a9('0x43')]=_[_0x93a9('0x44')](_0x32307a[_0x93a9('0x3f')],qs['fields'](_0x3a1d3b[_0x93a9('0x42')]['fields']));_0x454703[_0x93a9('0x43')]=_0x454703[_0x93a9('0x43')][_0x93a9('0x46')]?_0x454703[_0x93a9('0x43')]:_0x32307a['model'];if(_0x3a1d3b[_0x93a9('0x42')]['includeAll']){_0x454703['include']=[{'all':!![]}];}_0x454703=_[_0x93a9('0xa1')]({},_0x454703,_0x3a1d3b[_0x93a9('0xb3')]);return db[_0x93a9('0xb2')][_0x93a9('0xb4')](_0x454703)[_0x93a9('0x1d')](handleEntityNotFound(_0x248a84,null))[_0x93a9('0x1d')](respondWithResult(_0x248a84,null))['catch'](handleError(_0x248a84,null));};exports[_0x93a9('0xb5')]=function(_0x30a4ca,_0x4e9b07){return db[_0x93a9('0xb2')][_0x93a9('0xb5')](_0x30a4ca[_0x93a9('0xb6')],{})[_0x93a9('0x1d')](respondWithResult(_0x4e9b07,0xc9))['catch'](handleError(_0x4e9b07,null));};exports['update']=function(_0x1f8f90,_0x5dde20){if(_0x1f8f90[_0x93a9('0xb6')]['id']){delete _0x1f8f90[_0x93a9('0xb6')]['id'];}return db['ChatInteraction'][_0x93a9('0xb4')]({'where':{'id':_0x1f8f90[_0x93a9('0xb1')]['id']}})[_0x93a9('0x1d')](handleEntityNotFound(_0x5dde20,null))[_0x93a9('0x1d')](saveUpdates(_0x1f8f90[_0x93a9('0xb6')],null))[_0x93a9('0x1d')](respondWithResult(_0x5dde20,null))['catch'](handleError(_0x5dde20,null));};exports[_0x93a9('0x31')]=function(_0x1178da,_0x3015bb){return db[_0x93a9('0xb2')][_0x93a9('0xb4')]({'where':{'id':_0x1178da[_0x93a9('0xb1')]['id']}})[_0x93a9('0x1d')](handleEntityNotFound(_0x3015bb,null))['then'](removeEntity(_0x3015bb,null))[_0x93a9('0x25')](handleError(_0x3015bb,null));};exports['describe']=function(_0x532f8f,_0x235f0f){return db[_0x93a9('0xb2')]['describe']()[_0x93a9('0x1d')](respondWithResult(_0x235f0f,null))[_0x93a9('0x25')](handleError(_0x235f0f,null));};exports['customUpdate']=function(_0x3dcbed,_0x34684b){if(_0x3dcbed[_0x93a9('0xb6')]['id']){delete _0x3dcbed[_0x93a9('0xb6')]['id'];}return db[_0x93a9('0xb2')][_0x93a9('0xb4')]({'where':{'id':_0x3dcbed[_0x93a9('0xb1')]['id']}})[_0x93a9('0x1d')](handleEntityNotFound(_0x34684b,null))['then'](saveUpdates(_0x3dcbed[_0x93a9('0xb6')],null))[_0x93a9('0x1d')](respondWithResult(_0x34684b,null))['catch'](handleError(_0x34684b,null));};exports['abandon']=function(_0x19331c,_0x342ef4,_0x5948b5){if(_0x19331c['body']['id']){delete _0x19331c[_0x93a9('0xb6')]['id'];}return db['ChatInteraction'][_0x93a9('0xb4')]({'where':{'id':_0x19331c[_0x93a9('0xb1')]['id']}})[_0x93a9('0x1d')](function(_0x39a405){if(!_0x39a405){logger[_0x93a9('0x22')](_0x93a9('0xb7'),_0x93a9('0xb8'),0x194,'entity\x20not\x20found');_0x342ef4['sendStatus'](0x194);}else{if(_0x39a405[_0x93a9('0xb9')]){throw new db[(_0x93a9('0x8e'))][(_0x93a9('0xba'))](_0x93a9('0xbb'));}}return _0x39a405;})[_0x93a9('0x1d')](function(_0x1820ec){if(_0x1820ec){return _0x1820ec[_0x93a9('0x30')]({'closed':_0x19331c[_0x93a9('0xb6')][_0x93a9('0xbc')],'disposition':_0x19331c[_0x93a9('0xb6')][_0x93a9('0xbd')]})[_0x93a9('0x1d')](function(_0x1f417a){return _0x1f417a;});}})[_0x93a9('0x1d')](function(_0x65d0bf){return respondWithRpcPromise(_0x93a9('0xbe'),_0x93a9('0xb8'),_0x19331c['body'],client9004);})['then'](respondWithResult(_0x342ef4,null))[_0x93a9('0x25')](handleError(_0x342ef4,null));};exports[_0x93a9('0xbf')]=function(_0x53361a,_0x32d7a8,_0x5fb68a){_0x53361a['body'][_0x93a9('0x33')]=_0x53361a[_0x93a9('0xc0')][_0x93a9('0xc1')];_0x53361a['body'][_0x93a9('0xc2')]=_0x53361a[_0x93a9('0xc0')][_0x93a9('0xc3')];_0x53361a[_0x93a9('0xb6')][_0x93a9('0xc4')]=_0x53361a[_0x93a9('0xc0')]['mimetype'];return db['Attachment'][_0x93a9('0xb5')](_0x53361a[_0x93a9('0xb6')])['then'](respondWithResult(_0x32d7a8,0xc9))[_0x93a9('0x25')](handleError(_0x32d7a8,null));};exports[_0x93a9('0xc5')]=function(_0x2e282b,_0x213966,_0x14af7b){return db['ChatInteraction'][_0x93a9('0xc6')]({'where':{'id':_0x2e282b[_0x93a9('0xb1')]['id']},'raw':!![]})[_0x93a9('0x1d')](handleEntityNotFound(_0x213966,null))['then'](function(_0x3d9c8e){if(_0x3d9c8e){if(_0x3d9c8e[_0x93a9('0xbc')]){return _0x213966['status'](0x193)[_0x93a9('0x28')]({'status':0x193,'message':_0x93a9('0xc7')});}return db[_0x93a9('0xc8')][_0x93a9('0xc6')]({'where':{'id':_0x2e282b['query'][_0x93a9('0xc9')]},'raw':!![]})[_0x93a9('0x1d')](handleEntityNotFound(_0x213966,null));}})[_0x93a9('0x1d')](function(_0x3fd35f){if(_0x3fd35f){return _0x213966[_0x93a9('0xca')](path[_0x93a9('0x8a')](config[_0x93a9('0xcb')],_0x93a9('0xcc'),_0x3fd35f[_0x93a9('0xc2')]));}})[_0x93a9('0x25')](handleError(_0x213966,null));};exports[_0x93a9('0xcd')]=function(_0x378b32,_0x2a74df){var _0x1a53df=null;var _0x5077a7=null;var _0x13f7fc=null;var _0xdfd8fb=null;if(_0x378b32[_0x93a9('0xb6')]['id']){delete _0x378b32['body']['id'];}if(_0x378b32[_0x93a9('0xb6')]['mailTranscript']){_0xdfd8fb=path[_0x93a9('0x8a')](config[_0x93a9('0xcb')],_0x93a9('0xce'),util[_0x93a9('0x68')](_0x93a9('0xcf'),Date['now']()));_0x378b32[_0x93a9('0xb6')]['pathTranscript']=_0xdfd8fb;}return db[_0x93a9('0xb2')][_0x93a9('0xb4')]({'where':{'id':_0x378b32[_0x93a9('0xb1')]['id']},'include':[{'model':db[_0x93a9('0x36')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x2a74df,null))['then'](saveUpdates(_0x378b32['body'],null))[_0x93a9('0x1d')](function(_0x5f01cd){if(_0x5f01cd){_0x1a53df=_0x5f01cd;return db[_0x93a9('0xd0')]['find']({'where':{'id':_0x1a53df[_0x93a9('0x7d')]}});}})[_0x93a9('0x1d')](function(_0x54f6f9){if(_0x54f6f9){_0x13f7fc=_0x54f6f9;return db[_0x93a9('0xd1')]['find']({'where':{'id':_0x1a53df[_0x93a9('0x71')]}});}})[_0x93a9('0x1d')](function(_0x162579){if(_0x162579){_0x5077a7=_0x162579;if(_0xdfd8fb){var _0x57b5fd=null;for(var _0x3e5d7=0x1;_0x3e5d7<_0x1a53df[_0x93a9('0xd2')][_0x93a9('0x46')];++_0x3e5d7){_0x57b5fd=_0x1a53df['Messages'][_0x3e5d7];var _0x1ac7ed=_0x57b5fd['UserId']?util[_0x93a9('0x68')](_0x93a9('0xd3'),_0x13f7fc[_0x93a9('0xd4')],_0x57b5fd[_0x93a9('0xb9')]):'System';var _0x3a3b72=_0x378b32[_0x93a9('0xb6')][_0x93a9('0xd5')]||util[_0x93a9('0x68')]('%s%d','Visitor',_0x57b5fd[_0x93a9('0x71')]);switch(_0x13f7fc[_0x93a9('0xd6')]){case _0x93a9('0xd7'):_0x1ac7ed=_0x57b5fd[_0x93a9('0xb9')]?util[_0x93a9('0x68')](_0x93a9('0xd3'),_0x13f7fc[_0x93a9('0xd4')],_0x57b5fd[_0x93a9('0xb9')]):_0x93a9('0xd8');break;case _0x93a9('0xd9'):_0x1ac7ed=_0x57b5fd[_0x93a9('0xb9')]?_0x57b5fd[_0x93a9('0xda')][_0x93a9('0xdb')]||_0x57b5fd[_0x93a9('0xda')][_0x93a9('0xdc')]:_0x93a9('0xd8');break;case _0x93a9('0xdd'):_0x1ac7ed=_0x57b5fd[_0x93a9('0xb9')]?_0x57b5fd[_0x93a9('0xda')][_0x93a9('0xdc')]:'System';break;default:_0x1ac7ed=_0x57b5fd[_0x93a9('0xb9')]?util['format'](_0x93a9('0xd3'),_0x13f7fc['agentAlias'],_0x57b5fd[_0x93a9('0xb9')]):_0x93a9('0xd8');}var _0x42a88e=util[_0x93a9('0x68')](_0x93a9('0xde'),moment(_0x57b5fd['createdAt'])[_0x93a9('0x68')](_0x93a9('0xdf')),_0x57b5fd[_0x93a9('0xe0')]==='in'?_0x3a3b72:_0x1ac7ed,_0x57b5fd[_0x93a9('0xb6')]);if(!_0x57b5fd['secret']){fs[_0x93a9('0xe1')](_0xdfd8fb,_0x42a88e);}}return db['MailAccount'][_0x93a9('0xc6')]({'where':{'service':!![]},'include':[{'model':db[_0x93a9('0xe2')],'as':_0x93a9('0xe3'),'raw':!![]}]});}}})[_0x93a9('0x1d')](function(_0x5dde1e){if(_0x5dde1e&&_0x5dde1e['Smtp']&&_0x378b32[_0x93a9('0xb6')]){var _0x551376={'tls':{'rejectUnauthorized':![]}};if(_0x5dde1e[_0x93a9('0xe3')]['service']){_0x551376[_0x93a9('0xe4')]=_0x5dde1e['Smtp'][_0x93a9('0xe4')];}else{_0x551376['host']=_0x5dde1e[_0x93a9('0xe3')][_0x93a9('0xe5')];_0x551376['port']=_0x5dde1e[_0x93a9('0xe3')][_0x93a9('0xe6')];_0x551376['secure']=_0x5dde1e[_0x93a9('0xe3')][_0x93a9('0xe7')];}if(_0x5dde1e['Smtp'][_0x93a9('0xe8')]){_0x551376[_0x93a9('0xe9')]={'user':_0x5dde1e[_0x93a9('0xe3')][_0x93a9('0xea')],'pass':_0x5dde1e[_0x93a9('0xe3')][_0x93a9('0xeb')]};}return respondWithRpcPromise('SendMail',_0x93a9('0xec'),{'account':_0x551376,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x5dde1e[_0x93a9('0x33')],_0x5dde1e['email']||_0x5dde1e[_0x93a9('0xe3')][_0x93a9('0xea')]),'to':_0x378b32[_0x93a9('0xb6')]['mailTranscript'],'subject':_0x93a9('0xed'),'text':util['format'](_0x93a9('0xee'),_0x378b32[_0x93a9('0xb6')][_0x93a9('0xef')]),'attachments':[{'path':_0xdfd8fb}]}})[_0x93a9('0x1d')](function(){return _0x1a53df;})['catch'](function(_0x48fb39){console[_0x93a9('0x22')](_0x48fb39);});}else{return _0x1a53df;}})[_0x93a9('0x1d')](respondWithStatusCode(_0x2a74df,0xc8))[_0x93a9('0x25')](handleError(_0x2a74df,null));};exports[_0x93a9('0xf0')]=function(_0x578be1,_0x2f132f,_0x2631cf){return db[_0x93a9('0x36')][_0x93a9('0xb4')]({'where':{'id':_0x578be1[_0x93a9('0xb1')]['id']}})['then'](handleEntityNotFound(_0x2f132f,null))[_0x93a9('0x1d')](function(_0x59362c){if(_0x59362c){return _0x59362c[_0x93a9('0xf0')](_0x578be1['body'][_0x93a9('0xf1')],_[_0x93a9('0xf2')](_0x578be1[_0x93a9('0xb6')],[_0x93a9('0xf1'),'id'])||{});}})['then'](respondWithResult(_0x2f132f,null))['catch'](handleError(_0x2f132f,null));};exports[_0x93a9('0xf3')]=function(_0x505d96,_0x345ac9,_0x32e922){var _0x549ac9={'raw':![],'where':{}};var _0x18e4e2={};var _0x48b16a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x93a9('0xc6')]({'where':{'id':_0x505d96[_0x93a9('0xb1')]['id']}})[_0x93a9('0x1d')](handleEntityNotFound(_0x345ac9,null))[_0x93a9('0x1d')](function(_0x5e09a0){if(_0x5e09a0){_0x18e4e2[_0x93a9('0x3f')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x18e4e2[_0x93a9('0x42')]=_[_0x93a9('0x40')](_0x505d96[_0x93a9('0x42')]);_0x18e4e2[_0x93a9('0x41')]=_[_0x93a9('0x44')](_0x18e4e2[_0x93a9('0x3f')],_0x18e4e2['query']);_0x549ac9[_0x93a9('0x43')]=_[_0x93a9('0x44')](_0x18e4e2[_0x93a9('0x3f')],qs[_0x93a9('0x45')](_0x505d96[_0x93a9('0x42')][_0x93a9('0x45')]));_0x549ac9[_0x93a9('0x43')]=_0x549ac9['attributes'][_0x93a9('0x46')]?_0x549ac9['attributes']:_0x18e4e2['model'];if(!_0x505d96[_0x93a9('0x42')][_0x93a9('0x47')]('nolimit')){_0x549ac9[_0x93a9('0x2b')]=qs['limit'](_0x505d96[_0x93a9('0x42')]['limit']);_0x549ac9[_0x93a9('0x2a')]=qs[_0x93a9('0x2a')](_0x505d96[_0x93a9('0x42')]['offset']);}_0x549ac9[_0x93a9('0x49')]=qs[_0x93a9('0x4a')](_0x505d96[_0x93a9('0x42')][_0x93a9('0x4a')]);_0x549ac9['where']=qs[_0x93a9('0x41')](_['pick'](_0x505d96[_0x93a9('0x42')],_0x18e4e2[_0x93a9('0x41')]));_0x549ac9[_0x93a9('0x4b')][_0x93a9('0xae')]=_0x5e09a0['id'];if(_0x505d96['query'][_0x93a9('0x7a')]){_0x549ac9[_0x93a9('0x4b')]=_[_0x93a9('0xa1')](_0x549ac9[_0x93a9('0x4b')],{'$or':_[_0x93a9('0x38')](_0x549ac9[_0x93a9('0x43')],function(_0x1d89a7){var _0x375399={};_0x375399[_0x1d89a7]={'$like':'%'+_0x505d96[_0x93a9('0x42')][_0x93a9('0x7a')]+'%'};return _0x375399;})});}if(_0x505d96['query']['$gte']){var _0x63621b=_0x505d96[_0x93a9('0x42')][_0x93a9('0x7f')][_0x93a9('0x3b')](',');var _0x2a3202={};_0x2a3202[_0x63621b[0x0]]={'$gte':moment(_0x63621b[0x1])[_0x93a9('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};_0x549ac9['where']=_['merge'](_0x549ac9[_0x93a9('0x4b')],_0x2a3202);}_0x549ac9=_[_0x93a9('0xa1')]({},_0x549ac9,_0x505d96['options']);return db[_0x93a9('0x36')][_0x93a9('0x29')]({'where':_0x549ac9['where']})[_0x93a9('0x1d')](function(_0x29c10c){_0x48b16a['count']=_0x29c10c;if(_0x505d96['query'][_0x93a9('0xf4')]){_0x549ac9[_0x93a9('0xf5')]=[{'all':!![]}];}return db['ChatMessage'][_0x93a9('0xf6')](_0x549ac9);})[_0x93a9('0x1d')](function(_0x38292e){_0x48b16a[_0x93a9('0xb0')]=_0x38292e;return _0x48b16a;});}})[_0x93a9('0x1d')](respondWithFilteredResult(_0x345ac9,_0x549ac9))[_0x93a9('0x25')](handleError(_0x345ac9,null));};exports[_0x93a9('0xf7')]=function(_0x1a7ec0,_0x19152d,_0x1e97fb){var _0x1430ef={'where':{}},_0x1e33a1={},_0x55d130={'count':0x0,'rows':[]};return db[_0x93a9('0xb2')][_0x93a9('0xc6')]({'where':{'id':_0x1a7ec0[_0x93a9('0xb1')]['id']}})[_0x93a9('0x1d')](handleEntityNotFound(_0x19152d,null))[_0x93a9('0x1d')](function(_0x327006){if(_0x327006){_0x1e33a1[_0x93a9('0x3f')]=_['keys'](db[_0x93a9('0x36')][_0x93a9('0x3e')]);_0x1e33a1[_0x93a9('0x42')]=_[_0x93a9('0x40')](_0x1a7ec0[_0x93a9('0x42')]);_0x1e33a1['filters']=_['intersection'](_0x1e33a1[_0x93a9('0x3f')],_0x1e33a1[_0x93a9('0x42')]);_0x1430ef[_0x93a9('0x43')]=_['intersection'](_0x1e33a1[_0x93a9('0x3f')],qs['fields'](_0x1a7ec0[_0x93a9('0x42')]['fields']));_0x1430ef[_0x93a9('0x43')]=_0x1430ef[_0x93a9('0x43')][_0x93a9('0x46')]?_0x1430ef[_0x93a9('0x43')]:_0x1e33a1[_0x93a9('0x3f')];if(!_0x1a7ec0[_0x93a9('0x42')][_0x93a9('0x47')](_0x93a9('0x48'))){_0x1430ef[_0x93a9('0x2b')]=qs[_0x93a9('0x2b')](_0x1a7ec0[_0x93a9('0x42')][_0x93a9('0x2b')]);_0x1430ef[_0x93a9('0x2a')]=qs['offset'](_0x1a7ec0[_0x93a9('0x42')]['offset']);}_0x1430ef[_0x93a9('0x49')]=qs[_0x93a9('0x4a')](_0x1a7ec0['query'][_0x93a9('0x4a')]);_0x1430ef[_0x93a9('0x4b')]=qs[_0x93a9('0x41')](_['pick'](_0x1a7ec0['query'],_0x1e33a1['filters']));_0x1430ef[_0x93a9('0x4b')][_0x93a9('0xae')]=_0x327006['id'];if(_0x1a7ec0[_0x93a9('0x42')][_0x93a9('0x7a')]){_0x1430ef['where']=_[_0x93a9('0xa1')](_0x1430ef[_0x93a9('0x4b')],{'$or':_[_0x93a9('0x38')](_0x1430ef[_0x93a9('0x43')],function(_0x181d8f){var _0x2f9857={};_0x2f9857[_0x181d8f]={'$like':'%'+_0x1a7ec0[_0x93a9('0x42')][_0x93a9('0x7a')]+'%'};return _0x2f9857;})});}_0x1430ef[_0x93a9('0x4b')][_0x93a9('0xf8')]=![];if(_0x1a7ec0[_0x93a9('0x42')]['id']){_0x1430ef[_0x93a9('0x4b')]['id']={'$gt':_0x1a7ec0[_0x93a9('0x42')]['id']};}_0x1430ef=_[_0x93a9('0xa1')]({},_0x1430ef,_0x1a7ec0[_0x93a9('0xb3')]);return db[_0x93a9('0x36')][_0x93a9('0x29')]({'where':_0x1430ef['where']})['then'](function(_0x5ceb4f){_0x55d130['count']=_0x5ceb4f;_0x1430ef['include']=[];if(_0x1a7ec0[_0x93a9('0x42')][_0x93a9('0xf9')]){_0x1430ef['include'][_0x93a9('0x88')]({'model':db[_0x93a9('0xda')],'as':_0x93a9('0xda'),'attributes':['id',_0x93a9('0xdc'),'alias']});}if(_0x1a7ec0['query']['includeAll']){_0x1430ef[_0x93a9('0xf5')]=[{'all':!![]}];}return db[_0x93a9('0x36')]['findAll'](_0x1430ef);})['then'](function(_0x5481ef){_0x55d130[_0x93a9('0xb0')]=_0x5481ef;return _0x55d130;});}})['then'](respondWithFilteredResult(_0x19152d,_0x1430ef))['catch'](handleError(_0x19152d,null));};exports[_0x93a9('0xfa')]=function(_0x2e6592,_0x593b08,_0x235205){return db[_0x93a9('0xb2')][_0x93a9('0xb4')]({'where':{'id':_0x2e6592[_0x93a9('0xb1')]['id']}})[_0x93a9('0x1d')](handleEntityNotFound(_0x593b08,null))[_0x93a9('0x1d')](function(_0xe6f850){if(_0xe6f850){return _0xe6f850[_0x93a9('0xfb')](_0x2e6592[_0x93a9('0xb6')][_0x93a9('0xf1')],_['omit'](_0x2e6592[_0x93a9('0xb6')],[_0x93a9('0xf1'),'id'])||{})[_0x93a9('0xfc')](function(){return db[_0x93a9('0xfd')]['findAll']({'attributes':['id',_0x93a9('0x33'),_0x93a9('0x4f')],'where':{'id':_0x2e6592[_0x93a9('0xb6')][_0x93a9('0xf1')]}});})[_0x93a9('0x1d')](function(_0x3ebda2){socket[_0x93a9('0xfe')](_0x93a9('0xff'),{'id':Number(_0x2e6592[_0x93a9('0xb1')]['id']),'tags':_0x3ebda2||[]});return{'id':Number(_0x2e6592[_0x93a9('0xb1')]['id']),'tags':_0x3ebda2||[]};});}})[_0x93a9('0x1d')](respondWithResult(_0x593b08,null))[_0x93a9('0x25')](handleError(_0x593b08,null));};exports[_0x93a9('0x100')]=function(_0x2fe8b5,_0x5a4fdd,_0xdd95b7){return db['ChatInteraction']['find']({'where':{'id':_0x2fe8b5[_0x93a9('0xb1')]['id']}})['then'](handleEntityNotFound(_0x5a4fdd,null))[_0x93a9('0x1d')](function(_0x82a1bc){if(_0x82a1bc){return _0x82a1bc[_0x93a9('0x100')](_0x2fe8b5[_0x93a9('0x42')][_0x93a9('0xf1')]);}})['then'](respondWithStatusCode(_0x5a4fdd,null))[_0x93a9('0x25')](handleError(_0x5a4fdd,null));};exports['download']=function(_0x23c220,_0xf8e44){var _0x48446b=moment()[_0x93a9('0x101')]()[_0x93a9('0x89')]();var _0x44463b=path[_0x93a9('0x8a')](config['root'],'server','files',_0x93a9('0x102'));var _0x102997=path[_0x93a9('0x8a')](config[_0x93a9('0xcb')],_0x93a9('0x103'),_0x93a9('0x104'),_0x93a9('0x105'));var _0x12ba3e=path[_0x93a9('0x8a')](_0x44463b,_0x48446b);var _0x132c8b=util[_0x93a9('0x68')](_0x93a9('0x106'),_0x23c220[_0x93a9('0xb1')]['id'],_0x48446b);var _0x3fa68a=path[_0x93a9('0x8a')](_0x44463b,_0x132c8b);var _0x40cc4e=![];return db['ChatInteraction'][_0x93a9('0xb4')]({'where':{'id':_0x23c220['params']['id']},'include':[{'model':db[_0x93a9('0x36')],'as':_0x93a9('0xd2'),'attributes':['id','body','createdAt',_0x93a9('0xe0'),_0x93a9('0xf8')],'include':[{'model':db[_0x93a9('0xda')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0x93a9('0x107'),'attributes':['id',_0x93a9('0x108'),'lastName'],'raw':!![]},{'model':db['Attachment'],'as':_0x93a9('0xc8'),'raw':!![]}]},{'model':db[_0x93a9('0xd0')],'as':_0x93a9('0x109'),'attributes':['id','name']},{'model':db[_0x93a9('0xda')],'as':'Owner','attributes':['id','fullname']}]})[_0x93a9('0x1d')](handleEntityNotFound(_0xf8e44,null))[_0x93a9('0x1d')](function(_0x1b581b){if(_0x1b581b){var _0x4f5740=_0x1b581b[_0x93a9('0x10a')]({'plain':!![]});_0x40cc4e=!![];var _0x59a022={'format':'A4','border':_0x93a9('0x10b'),'header':{'height':_0x93a9('0x10c'),'contents':{'first':_0x93a9('0x10d')}},'footer':{'height':_0x93a9('0x10e'),'contents':{'default':util[_0x93a9('0x68')](_0x93a9('0x10f'),util['format']('%s\x20#%d',_0x93a9('0x110'),_0x4f5740['id']),moment()[_0x93a9('0x68')]('YYYY-MM-DD')[_0x93a9('0x89')]())}}};fs[_0x93a9('0x111')](_0x12ba3e);var _0x31c7f7={'channel':_0x93a9('0x110'),'account':_0x4f5740[_0x93a9('0x109')][_0x93a9('0x33')],'agent':_0x4f5740[_0x93a9('0x112')]?_0x4f5740[_0x93a9('0x112')][_0x93a9('0xdc')]:_0x93a9('0x113'),'createdAt':moment(_0x4f5740[_0x93a9('0x63')])[_0x93a9('0x68')](_0x93a9('0x114'))[_0x93a9('0x89')](),'closedAt':_0x4f5740[_0x93a9('0xbc')]?moment(_0x4f5740[_0x93a9('0x115')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x93a9('0x89')]():'','disposition':_0x4f5740[_0x93a9('0xbd')],'chatInfo':{'browser':_0x4f5740[_0x93a9('0x116')],'os':_0x4f5740['osName'],'referer':_0x4f5740[_0x93a9('0x117')],'customerIp':_0x4f5740[_0x93a9('0x118')]},'messages':_(_0x4f5740[_0x93a9('0xd2')])['tail']()[_0x93a9('0x7a')]({'secret':![]})[_0x93a9('0x38')](function(_0x422faa){if(_0x422faa[_0x93a9('0xc8')]){var _0x49456f=path[_0x93a9('0x8a')](_0x102997,_0x422faa[_0x93a9('0xc8')][_0x93a9('0xc2')]);if(fs[_0x93a9('0x119')](_0x49456f)){fs[_0x93a9('0x11a')](_0x49456f)['pipe'](fs['createWriteStream'](path[_0x93a9('0x8a')](_0x12ba3e,_0x422faa[_0x93a9('0xc8')][_0x93a9('0xc2')])));}}return{'date':moment(_0x422faa[_0x93a9('0x63')])['format'](_0x93a9('0x114'))[_0x93a9('0x89')](),'sender':_0x422faa[_0x93a9('0xe0')]===_0x93a9('0x11b')?_0x422faa[_0x93a9('0xda')]?_0x422faa['User'][_0x93a9('0xdc')]:_0x93a9('0xd8'):_0x422faa[_0x93a9('0x107')][_0x93a9('0x108')]+(_0x422faa[_0x93a9('0x107')][_0x93a9('0x11c')]?'\x20'+_0x422faa[_0x93a9('0x107')][_0x93a9('0x11c')]:''),'body':_0x422faa['Attachment']?_0x422faa[_0x93a9('0xc8')]['basename']:_0x422faa[_0x93a9('0xb6')],'direction':_0x422faa[_0x93a9('0xe0')]===_0x93a9('0x11b')?'A':'C','secret':_0x422faa['secret'],'attachment':_0x422faa[_0x93a9('0xc8')]};})[_0x93a9('0x64')]()};return ejs[_0x93a9('0x11d')](path[_0x93a9('0x8a')](config[_0x93a9('0xcb')],_0x93a9('0x103'),_0x93a9('0x11e'),_0x93a9('0x11f')),{'interaction':_0x31c7f7})[_0x93a9('0x1d')](function(_0xcd00b){return new BPromise(function(_0x266ba5,_0x7d6fb2){pdf['create'](_0xcd00b,_0x59a022)[_0x93a9('0x120')](path[_0x93a9('0x8a')](_0x12ba3e,_0x93a9('0x121')+_0x4f5740['id']+'-'+_0x48446b+'.pdf'),function(_0x3cfeec,_0x11ef87){if(_0x3cfeec)return _0x7d6fb2(_0x3cfeec);_0x266ba5(_0x11ef87);});});});}})[_0x93a9('0x1d')](function(){if(_0x40cc4e){return new BPromise(function(_0x309628,_0x4b36e4){zipdir(_0x12ba3e,{'saveTo':_0x3fa68a},function(_0x21b577,_0x2d386e){if(_0x21b577)return _0x4b36e4(_0x21b577);return _0x309628(_0x2d386e);});})[_0x93a9('0x1d')](function(){return new BPromise(function(_0xc54d91,_0x467d24){rimraf(_0x12ba3e,function(_0x29f390){if(_0x29f390)_0x467d24(_0x29f390);return _0xc54d91();});});})[_0x93a9('0x1d')](function(){return _0xf8e44[_0x93a9('0xca')](_0x3fa68a,_0x132c8b,function(_0x17f685){if(_0x17f685){console[_0x93a9('0x122')](_0x93a9('0x123'),_0x17f685);}else{fs[_0x93a9('0x124')](_0x3fa68a);}});});}else{return _0xf8e44[_0x93a9('0x32')](0xc8);}})[_0x93a9('0x25')](handleError(_0xf8e44,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 5ddb328..32cd02b 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 _0xf153=['emit','catch','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','findAll','then','unreadMessages','length'];(function(_0x5e6941,_0xc3a94c){var _0x55e3bd=function(_0x1bed62){while(--_0x1bed62){_0x5e6941['push'](_0x5e6941['shift']());}};_0x55e3bd(++_0xc3a94c);}(_0xf153,0x9e));var _0x3f15=function(_0x4dce52,_0x54822f){_0x4dce52=_0x4dce52-0x0;var _0x611ec0=_0xf153[_0x4dce52];return _0x611ec0;};'use strict';var EventEmitter=require(_0x3f15('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3f15('0x1')];var ChatMessage=require(_0x3f15('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3f15('0x3')](0x0);var events={'afterCreate':_0x3f15('0x4'),'afterUpdate':_0x3f15('0x5'),'afterDestroy':_0x3f15('0x6')};function emitEvent(_0x574598){return function(_0x152d45,_0x1ef3ea,_0x39ffb7){ChatMessage[_0x3f15('0x7')]({'where':{'ChatInteractionId':_0x152d45['id'],'direction':'in','read':![]},'raw':!![]})[_0x3f15('0x8')](function(_0x36b4db){_0x152d45['setDataValue'](_0x3f15('0x9'),_0x36b4db[_0x3f15('0xa')]);ChatInteractionEvents['emit'](_0x574598+':'+_0x152d45['id'],_0x152d45);ChatInteractionEvents[_0x3f15('0xb')](_0x574598,_0x152d45);_0x39ffb7(null);})[_0x3f15('0xc')](_0x39ffb7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xe12c=['../../mysqldb','setMaxListeners','save','update','remove','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','ChatInteraction'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xe12c,0x133));var _0xce12=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xe12c[_0x1abeb2];return _0x48da20;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xce12('0x0')];var ChatMessage=require(_0xce12('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xce12('0x2')](0x0);var events={'afterCreate':_0xce12('0x3'),'afterUpdate':_0xce12('0x4'),'afterDestroy':_0xce12('0x5')};function emitEvent(_0x4882f5){return function(_0x54ce5c,_0x3cd821,_0x346cdb){ChatMessage[_0xce12('0x6')]({'where':{'ChatInteractionId':_0x54ce5c['id'],'direction':'in','read':![]},'raw':!![]})['then'](function(_0x62ff08){_0x54ce5c[_0xce12('0x7')](_0xce12('0x8'),_0x62ff08[_0xce12('0x9')]);ChatInteractionEvents[_0xce12('0xa')](_0x4882f5+':'+_0x54ce5c['id'],_0x54ce5c);ChatInteractionEvents[_0xce12('0xa')](_0x4882f5,_0x54ce5c);_0x346cdb(null);})[_0xce12('0xb')](_0x346cdb(null));};}for(var e in events){if(events[_0xce12('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xce12('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ffea398..03160fd 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 _0xb7e7=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed'];(function(_0x3d410d,_0x5e151c){var _0x4deded=function(_0x3e4b1a){while(--_0x3e4b1a){_0x3d410d['push'](_0x3d410d['shift']());}};_0x4deded(++_0x5e151c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xb7e7[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42b871,_0x223587,_0x2917f9){if(_0x42b871[_0x7b7e('0x9')](_0x7b7e('0xa'))){_0x42b871[_0x7b7e('0xb')]=moment()[_0x7b7e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2917f9(null,_0x42b871);}},'charset':_0x7b7e('0xd'),'collate':_0x7b7e('0xe')});}; \ No newline at end of file +var _0xb10b=['./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5eeb42,_0x3ec961){var _0x984f7b=function(_0x41251c){while(--_0x41251c){_0x5eeb42['push'](_0x5eeb42['shift']());}};_0x984f7b(++_0x3ec961);}(_0xb10b,0x12a));var _0xbb10=function(_0x34620e,_0x582015){_0x34620e=_0x34620e-0x0;var _0x3d33cd=_0xb10b[_0x34620e];return _0x3d33cd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatInteraction',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fb675,_0x21370f,_0x1c3ee5){if(_0x3fb675[_0xbb10('0xc')](_0xbb10('0xd'))){_0x3fb675[_0xbb10('0xe')]=moment()[_0xbb10('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1c3ee5(null,_0x3fb675);}},'charset':'utf8mb4','collate':_0xbb10('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6afc35a..27b9444 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 _0x7e77=['request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','stringify','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x7e77,0x143));var _0x77e7=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7e77[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x77e7('0x0'));var util=require(_0x77e7('0x1'));var moment=require('moment');var BPromise=require(_0x77e7('0x2'));var rs=require(_0x77e7('0x3'));var fs=require('fs');var Redis=require(_0x77e7('0x4'));var db=require(_0x77e7('0x5'))['db'];var utils=require(_0x77e7('0x6'));var logger=require(_0x77e7('0x7'))('rpc');var config=require(_0x77e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e7('0x9')][_0x77e7('0xa')]({'port':0x232a});config[_0x77e7('0xb')]=_['defaults'](config[_0x77e7('0xb')],{'host':_0x77e7('0xc'),'port':0x18eb});var socket=require(_0x77e7('0xd'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x77e7('0xe')](socket);function respondWithRpcPromise(_0x563bf8,_0x4e2d15,_0x3eead0){return new BPromise(function(_0xfe6ab1,_0x56d860){return client[_0x77e7('0xf')](_0x563bf8,_0x3eead0)[_0x77e7('0x10')](function(_0x56a9a2){logger[_0x77e7('0x11')](_0x77e7('0x12'),_0x4e2d15,_0x77e7('0x13'));logger[_0x77e7('0x14')](_0x77e7('0x15'),_0x4e2d15,'request\x20sent',JSON['stringify'](_0x56a9a2));if(_0x56a9a2[_0x77e7('0x16')]){if(_0x56a9a2['error']['code']===0x1f4){logger[_0x77e7('0x16')](_0x77e7('0x12'),_0x4e2d15,_0x56a9a2['error'][_0x77e7('0x17')]);return _0x56d860(_0x56a9a2['error'][_0x77e7('0x17')]);}logger['error'](_0x77e7('0x12'),_0x4e2d15,_0x56a9a2['error'][_0x77e7('0x17')]);return _0xfe6ab1(_0x56a9a2['error'][_0x77e7('0x17')]);}else{logger[_0x77e7('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x4e2d15,'request\x20sent');_0xfe6ab1(_0x56a9a2[_0x77e7('0x18')]['message']);}})[_0x77e7('0x19')](function(_0x13c8ff){logger[_0x77e7('0x16')](_0x77e7('0x12'),_0x4e2d15,_0x13c8ff);_0x56d860(_0x13c8ff);});});}exports[_0x77e7('0x1a')]=function(_0x7b29fe){var _0x39a80b=this;return new Promise(function(_0x580c84,_0x4473dd){return db[_0x77e7('0x1b')][_0x77e7('0x1c')](_0x7b29fe[_0x77e7('0x1d')],{'raw':_0x7b29fe[_0x77e7('0x1e')]?_0x7b29fe[_0x77e7('0x1e')][_0x77e7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7b29fe[_0x77e7('0x1e')]?_0x7b29fe[_0x77e7('0x1e')][_0x77e7('0x20')]||null:null,'attributes':_0x7b29fe[_0x77e7('0x1e')]?_0x7b29fe[_0x77e7('0x1e')]['attributes']||null:null,'limit':_0x7b29fe[_0x77e7('0x1e')]?_0x7b29fe[_0x77e7('0x1e')]['limit']||null:null})['then'](function(_0x3934f8){logger[_0x77e7('0x11')](_0x77e7('0x1a'),_0x7b29fe);logger[_0x77e7('0x14')](_0x77e7('0x1a'),_0x7b29fe,JSON[_0x77e7('0x21')](_0x3934f8));_0x580c84(_0x3934f8);})[_0x77e7('0x19')](function(_0x541161){logger[_0x77e7('0x16')](_0x77e7('0x1a'),_0x541161[_0x77e7('0x17')],_0x7b29fe);_0x4473dd(_0x39a80b[_0x77e7('0x16')](0x1f4,_0x541161[_0x77e7('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x3ad616){return new Promise(function(_0x289240,_0x1dfb50){return db[_0x77e7('0x1b')]['find']({'where':_0x3ad616[_0x77e7('0x1e')]?_0x3ad616[_0x77e7('0x1e')][_0x77e7('0x20')]||null:null})[_0x77e7('0x10')](function(_0xfc299d){if(_0xfc299d){return _0xfc299d['addTags'](_0x3ad616['body'][_0x77e7('0x22')],_[_0x77e7('0x23')](_0x3ad616[_0x77e7('0x1d')],[_0x77e7('0x22'),'id'])||{});}})[_0x77e7('0x24')](function(_0x3b432f){logger['info'](_0x77e7('0x25'),_0x3ad616);logger[_0x77e7('0x14')](_0x77e7('0x25'),_0x3ad616,JSON[_0x77e7('0x21')](_0x3b432f));_0x289240(_0x3b432f);})[_0x77e7('0x19')](function(_0x54ecbe){logger[_0x77e7('0x16')](_0x77e7('0x25'),_0x54ecbe[_0x77e7('0x17')],_0x3ad616);_0x1dfb50(_this[_0x77e7('0x16')](0x1f4,_0x54ecbe[_0x77e7('0x17')]));});});}; \ No newline at end of file +var _0x8a71=['client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3257af,_0xb03526){var _0x473543=function(_0x3f149e){while(--_0x3f149e){_0x3257af['push'](_0x3257af['shift']());}};_0x473543(++_0xb03526);}(_0x8a71,0x70));var _0x18a7=function(_0x1ffc15,_0x1e525e){_0x1ffc15=_0x1ffc15-0x0;var _0x57a214=_0x8a71[_0x1ffc15];return _0x57a214;};'use strict';var _=require(_0x18a7('0x0'));var util=require('util');var moment=require(_0x18a7('0x1'));var BPromise=require(_0x18a7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18a7('0x3'))['db'];var utils=require(_0x18a7('0x4'));var logger=require('../../config/logger')(_0x18a7('0x5'));var config=require(_0x18a7('0x6'));var jayson=require(_0x18a7('0x7'));var client=jayson[_0x18a7('0x8')][_0x18a7('0x9')]({'port':0x232a});config[_0x18a7('0xa')]=_[_0x18a7('0xb')](config[_0x18a7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x18a7('0xc'))(new Redis(config[_0x18a7('0xa')]));require(_0x18a7('0xd'))[_0x18a7('0xe')](socket);function respondWithRpcPromise(_0x23b6f5,_0x1eeaa3,_0x800722){return new BPromise(function(_0x487f09,_0x39ef1c){return client['request'](_0x23b6f5,_0x800722)[_0x18a7('0xf')](function(_0x1e5dd2){logger[_0x18a7('0x10')](_0x18a7('0x11'),_0x1eeaa3,_0x18a7('0x12'));logger[_0x18a7('0x13')](_0x18a7('0x14'),_0x1eeaa3,_0x18a7('0x12'),JSON[_0x18a7('0x15')](_0x1e5dd2));if(_0x1e5dd2['error']){if(_0x1e5dd2[_0x18a7('0x16')][_0x18a7('0x17')]===0x1f4){logger[_0x18a7('0x16')](_0x18a7('0x11'),_0x1eeaa3,_0x1e5dd2[_0x18a7('0x16')]['message']);return _0x39ef1c(_0x1e5dd2[_0x18a7('0x16')][_0x18a7('0x18')]);}logger['error'](_0x18a7('0x11'),_0x1eeaa3,_0x1e5dd2[_0x18a7('0x16')][_0x18a7('0x18')]);return _0x487f09(_0x1e5dd2[_0x18a7('0x16')]['message']);}else{logger[_0x18a7('0x10')](_0x18a7('0x11'),_0x1eeaa3,_0x18a7('0x12'));_0x487f09(_0x1e5dd2[_0x18a7('0x19')]['message']);}})[_0x18a7('0x1a')](function(_0x1da950){logger['error'](_0x18a7('0x11'),_0x1eeaa3,_0x1da950);_0x39ef1c(_0x1da950);});});}exports[_0x18a7('0x1b')]=function(_0x63c151){var _0x2b1ce7=this;return new Promise(function(_0x320449,_0x4590c2){return db[_0x18a7('0x1c')][_0x18a7('0x1d')](_0x63c151[_0x18a7('0x1e')],{'raw':_0x63c151['options']?_0x63c151[_0x18a7('0x1f')][_0x18a7('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x63c151[_0x18a7('0x1f')]?_0x63c151[_0x18a7('0x1f')][_0x18a7('0x21')]||null:null,'attributes':_0x63c151[_0x18a7('0x1f')]?_0x63c151[_0x18a7('0x1f')][_0x18a7('0x22')]||null:null,'limit':_0x63c151[_0x18a7('0x1f')]?_0x63c151[_0x18a7('0x1f')]['limit']||null:null})[_0x18a7('0xf')](function(_0x4eb699){logger[_0x18a7('0x10')](_0x18a7('0x1b'),_0x63c151);logger['debug'](_0x18a7('0x1b'),_0x63c151,JSON['stringify'](_0x4eb699));_0x320449(_0x4eb699);})[_0x18a7('0x1a')](function(_0x477cbe){logger[_0x18a7('0x16')](_0x18a7('0x1b'),_0x477cbe['message'],_0x63c151);_0x4590c2(_0x2b1ce7['error'](0x1f4,_0x477cbe[_0x18a7('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x327756){return new Promise(function(_0x57fc60,_0x342de2){return db['ChatInteraction'][_0x18a7('0x23')]({'where':_0x327756['options']?_0x327756[_0x18a7('0x1f')]['where']||null:null})[_0x18a7('0xf')](function(_0x2c01a2){if(_0x2c01a2){return _0x2c01a2[_0x18a7('0x24')](_0x327756['body'][_0x18a7('0x25')],_[_0x18a7('0x26')](_0x327756[_0x18a7('0x1e')],['ids','id'])||{});}})['spread'](function(_0x132dba){logger[_0x18a7('0x10')]('AddTags',_0x327756);logger[_0x18a7('0x13')](_0x18a7('0x27'),_0x327756,JSON[_0x18a7('0x15')](_0x132dba));_0x57fc60(_0x132dba);})['catch'](function(_0x413edd){logger[_0x18a7('0x16')](_0x18a7('0x27'),_0x413edd['message'],_0x327756);_0x342de2(_this[_0x18a7('0x16')](0x1f4,_0x413edd[_0x18a7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 31ee220..e89097c 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 _0x3cae=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','removeListener'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x3cae,0x123));var _0xe3ca=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x3cae[_0x4953da];return _0x2d3780;};'use strict';var ChatInteractionEvents=require(_0xe3ca('0x0'));var events=[_0xe3ca('0x1'),_0xe3ca('0x2'),_0xe3ca('0x3')];function createListener(_0x2eae78,_0x544750){return function(_0x3e6909){_0x544750['emit'](_0x2eae78,_0x3e6909);};}function removeListener(_0x23cc00,_0xc914fe){return function(){ChatInteractionEvents[_0xe3ca('0x4')](_0x23cc00,_0xc914fe);};}exports[_0xe3ca('0x5')]=function(_0x479e27){for(var _0x1b6f4e=0x0,_0x2f7d4e=events[_0xe3ca('0x6')];_0x1b6f4e<_0x2f7d4e;_0x1b6f4e++){var _0x8bcb52=events[_0x1b6f4e];var _0x5003d2=createListener(_0xe3ca('0x7')+_0x8bcb52,_0x479e27);ChatInteractionEvents['on'](_0x8bcb52,_0x5003d2);}}; \ No newline at end of file +var _0x9b93=['update','length','remove'];(function(_0x3eeb9c,_0x43e282){var _0x283726=function(_0x34459f){while(--_0x34459f){_0x3eeb9c['push'](_0x3eeb9c['shift']());}};_0x283726(++_0x43e282);}(_0x9b93,0xe9));var _0x39b9=function(_0x59f97a,_0x511696){_0x59f97a=_0x59f97a-0x0;var _0x411b33=_0x9b93[_0x59f97a];return _0x411b33;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x39b9('0x0'),_0x39b9('0x1')];function createListener(_0x40694b,_0x2572cc){return function(_0x3cb41f){_0x2572cc['emit'](_0x40694b,_0x3cb41f);};}function removeListener(_0x5f06cc,_0x7d09b3){return function(){ChatInteractionEvents['removeListener'](_0x5f06cc,_0x7d09b3);};}exports['register']=function(_0x234130){for(var _0x3ee9e7=0x0,_0x52adb6=events[_0x39b9('0x2')];_0x3ee9e7<_0x52adb6;_0x3ee9e7++){var _0x3dc71a=events[_0x3ee9e7];var _0x3114fc=createListener('chatInteraction:'+_0x3dc71a,_0x234130);ChatInteractionEvents['on'](_0x3dc71a,_0x3114fc);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 139dbb5..17b580b 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 _0xc900=['root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','addTags','put','tracked','chatinteraction:update','update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','diskStorage','join'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xc900,0xb3));var _0x0c90=function(_0x598882,_0x35b944){_0x598882=_0x598882-0x0;var _0x2f01d6=_0xc900[_0x598882];return _0x2f01d6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c90('0x0'));var timeout=require(_0x0c90('0x1'));var express=require(_0x0c90('0x2'));var router=express['Router']();var auth=require(_0x0c90('0x3'));var interaction=require(_0x0c90('0x4'));var config=require('../../config/environment');var controller=require(_0x0c90('0x5'));router[_0x0c90('0x6')]('/',auth[_0x0c90('0x7')](),controller[_0x0c90('0x8')]);router[_0x0c90('0x6')](_0x0c90('0x9'),auth['isAuthenticated'](),controller[_0x0c90('0xa')]);router[_0x0c90('0x6')](_0x0c90('0xb'),auth[_0x0c90('0xc')](),controller[_0x0c90('0xd')]);router[_0x0c90('0x6')](_0x0c90('0xe'),auth[_0x0c90('0xc')](),controller[_0x0c90('0xf')]);router[_0x0c90('0x6')](_0x0c90('0x10'),auth[_0x0c90('0x7')](),controller[_0x0c90('0x11')]);router['get'](_0x0c90('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x0c90('0x13')]);router['get'](_0x0c90('0x14'),auth[_0x0c90('0x7')](),controller[_0x0c90('0x15')]);router[_0x0c90('0x16')]('/',auth[_0x0c90('0x7')](),controller['create']);var upload=multer({'storage':multer[_0x0c90('0x17')]({'destination':function(_0x4451e0,_0x4f35f4,_0x2c82a4){_0x2c82a4(null,path[_0x0c90('0x18')](config[_0x0c90('0x19')],'server/files/attachments/'));},'filename':function(_0x5daeb7,_0x412635,_0x15ca42){_0x15ca42(null,util[_0x0c90('0x1a')](_0x0c90('0x1b'),Date[_0x0c90('0x1c')](),_0x412635[_0x0c90('0x1d')][_0x0c90('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x0c90('0x1f'),upload[_0x0c90('0x20')](_0x0c90('0x21')),controller[_0x0c90('0x22')]);router['post'](_0x0c90('0x10'),auth[_0x0c90('0xc')](),controller[_0x0c90('0x23')]);router[_0x0c90('0x16')](_0x0c90('0x24'),auth[_0x0c90('0x7')](),interaction['tracked'](_0x0c90('0x25'),'chatinteraction:addtags'),controller[_0x0c90('0x26')]);router[_0x0c90('0x27')]('/:id',auth[_0x0c90('0x7')](),interaction[_0x0c90('0x28')](_0x0c90('0x25'),_0x0c90('0x29')),controller[_0x0c90('0x2a')]);router[_0x0c90('0x27')]('/:id/custom_update',controller[_0x0c90('0x2b')]);router[_0x0c90('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x0c90('0x2c')]);router[_0x0c90('0x27')](_0x0c90('0x2d'),controller[_0x0c90('0x2e')]);router['delete'](_0x0c90('0xb'),auth[_0x0c90('0x7')](),interaction[_0x0c90('0x28')](_0x0c90('0x25'),_0x0c90('0x2f')),controller[_0x0c90('0x30')]);router['delete'](_0x0c90('0x24'),auth[_0x0c90('0x7')](),controller[_0x0c90('0x31')]);module[_0x0c90('0x32')]=router; \ No newline at end of file +var _0xd824=['../../config/environment','./chatInteraction.controller','index','isAuthenticated','describe','get','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','post','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3cc6b4,_0x58b1aa){var _0x1c07b8=function(_0x156458){while(--_0x156458){_0x3cc6b4['push'](_0x3cc6b4['shift']());}};_0x1c07b8(++_0x58b1aa);}(_0xd824,0xc2));var _0x4d82=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd824[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d82('0x2'));var router=express[_0x4d82('0x3')]();var auth=require(_0x4d82('0x4'));var interaction=require(_0x4d82('0x5'));var config=require(_0x4d82('0x6'));var controller=require(_0x4d82('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4d82('0x8')]);router['get']('/describe',auth[_0x4d82('0x9')](),controller[_0x4d82('0xa')]);router[_0x4d82('0xb')]('/:id',auth[_0x4d82('0xc')](),controller['show']);router['get'](_0x4d82('0xd'),auth[_0x4d82('0xc')](),controller[_0x4d82('0xe')]);router['get'](_0x4d82('0xf'),auth['isAuthenticated'](),controller[_0x4d82('0x10')]);router[_0x4d82('0xb')](_0x4d82('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x4d82('0xb')](_0x4d82('0x12'),auth[_0x4d82('0x9')](),controller[_0x4d82('0x13')]);router['post']('/',auth[_0x4d82('0x9')](),controller[_0x4d82('0x14')]);var upload=multer({'storage':multer[_0x4d82('0x15')]({'destination':function(_0x486152,_0x70c598,_0x4f4c45){_0x4f4c45(null,path[_0x4d82('0x16')](config['root'],_0x4d82('0x17')));},'filename':function(_0x496f3b,_0x474acf,_0xb1640d){_0xb1640d(null,util[_0x4d82('0x18')](_0x4d82('0x19'),Date[_0x4d82('0x1a')](),_0x474acf[_0x4d82('0x1b')][_0x4d82('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4d82('0x1d')](_0x4d82('0x1e'),upload['single'](_0x4d82('0x1f')),controller[_0x4d82('0x20')]);router[_0x4d82('0x1d')](_0x4d82('0xf'),auth[_0x4d82('0xc')](),controller[_0x4d82('0x21')]);router[_0x4d82('0x1d')](_0x4d82('0x22'),auth[_0x4d82('0x9')](),interaction[_0x4d82('0x23')](_0x4d82('0x24'),'chatinteraction:addtags'),controller[_0x4d82('0x25')]);router[_0x4d82('0x26')]('/:id',auth[_0x4d82('0x9')](),interaction[_0x4d82('0x23')](_0x4d82('0x24'),_0x4d82('0x27')),controller[_0x4d82('0x28')]);router[_0x4d82('0x26')](_0x4d82('0x29'),controller[_0x4d82('0x2a')]);router[_0x4d82('0x26')](_0x4d82('0x2b'),auth[_0x4d82('0xc')](),controller[_0x4d82('0x2c')]);router[_0x4d82('0x26')](_0x4d82('0x2d'),controller[_0x4d82('0x2e')]);router['delete']('/:id',auth[_0x4d82('0x9')](),interaction[_0x4d82('0x23')](_0x4d82('0x24'),_0x4d82('0x2f')),controller['destroy']);router[_0x4d82('0x30')](_0x4d82('0x22'),auth[_0x4d82('0x9')](),controller[_0x4d82('0x31')]);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 7cb5f06..e3e96f7 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 _0xb44a=['TEXT','BOOLEAN'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xb44a,0x1c2));var _0xab44=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xb44a[_0x12aaee];return _0x37c350;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xab44('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xab44('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x323f=['BOOLEAN','INTEGER','exports','medium'];(function(_0x51a089,_0x258674){var _0x5df1c5=function(_0x49ed7e){while(--_0x49ed7e){_0x51a089['push'](_0x51a089['shift']());}};_0x5df1c5(++_0x258674);}(_0x323f,0x1ee));var _0xf323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x323f[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xf323('0x0')]={'body':{'type':Sequelize['TEXT'](_0xf323('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xf323('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf323('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b51d703..78d5111 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 _0x5d70=['describe','messages','lastMessageAt','lastMessage','format','agent','admin','user','fullname','role','userpic','internal','online','showWebBar','sort','-online','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','FromId','ToId','read','-createdAt','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','index','ChatInternalMessage','rawAttributes','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','options','find','create','body','params'];(function(_0x4d916f,_0x59fab1){var _0x267390=function(_0x512b77){while(--_0x512b77){_0x4d916f['push'](_0x4d916f['shift']());}};_0x267390(++_0x59fab1);}(_0x5d70,0x8d));var _0x05d7=function(_0x253cd8,_0x5f0e6b){_0x253cd8=_0x253cd8-0x0;var _0x11aed6=_0x5d70[_0x253cd8];return _0x11aed6;};'use strict';var pdf=require(_0x05d7('0x0'));var emlformat=require(_0x05d7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x05d7('0x2'));var jsonpatch=require(_0x05d7('0x3'));var rp=require(_0x05d7('0x4'));var moment=require(_0x05d7('0x5'));var BPromise=require(_0x05d7('0x6'));var Mustache=require(_0x05d7('0x7'));var util=require('util');var path=require(_0x05d7('0x8'));var sox=require(_0x05d7('0x9'));var csv=require(_0x05d7('0xa'));var ejs=require(_0x05d7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x05d7('0xc'));var jsforce=require(_0x05d7('0xd'));var deskjs=require(_0x05d7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x05d7('0xf'));var Redis=require(_0x05d7('0x10'));var authService=require(_0x05d7('0x11'));var qs=require(_0x05d7('0x12'));var hardwareService=require(_0x05d7('0x13'));var logger=require(_0x05d7('0x14'))(_0x05d7('0x15'));var utils=require(_0x05d7('0x16'));var config=require(_0x05d7('0x17'));var db=require(_0x05d7('0x18'))['db'];config[_0x05d7('0x19')]=_[_0x05d7('0x1a')](config[_0x05d7('0x19')],{'host':_0x05d7('0x1b'),'port':0x18eb});var socket=require(_0x05d7('0x1c'))(new Redis(config[_0x05d7('0x19')]));require(_0x05d7('0x1d'))[_0x05d7('0x1e')](socket);function respondWithStatusCode(_0x171746,_0x34cd5b){_0x34cd5b=_0x34cd5b||0xcc;return function(_0x231f62){if(_0x231f62){return _0x171746[_0x05d7('0x1f')](_0x34cd5b);}return _0x171746[_0x05d7('0x20')](_0x34cd5b)['end']();};}function respondWithResult(_0x38b3c7,_0x5ba163){_0x5ba163=_0x5ba163||0xc8;return function(_0x42c95f){if(_0x42c95f){return _0x38b3c7[_0x05d7('0x20')](_0x5ba163)['json'](_0x42c95f);}};}function respondWithFilteredResult(_0x559545,_0x5b4ac1){return function(_0x55b9d3){if(_0x55b9d3){var _0x4a36e8=_0x55b9d3[_0x05d7('0x21')],_0x3e364b=_0x5b4ac1[_0x05d7('0x22')],_0x9e84b2=_0x5b4ac1[_0x05d7('0x22')]+_0x5b4ac1[_0x05d7('0x23')],_0x292d48;if(_0x9e84b2>=_0x4a36e8){_0x9e84b2=_0x4a36e8;_0x292d48=0xc8;}else{_0x292d48=0xce;}_0x559545[_0x05d7('0x20')](_0x292d48);return _0x559545[_0x05d7('0x24')](_0x05d7('0x25'),_0x3e364b+'-'+_0x9e84b2+'/'+_0x4a36e8)[_0x05d7('0x26')](_0x55b9d3);}return null;};}function patchUpdates(_0x31199b){return function(_0x4e182f){try{jsonpatch[_0x05d7('0x27')](_0x4e182f,_0x31199b,!![]);}catch(_0x47d3ca){return BPromise['reject'](_0x47d3ca);}return _0x4e182f[_0x05d7('0x28')]();};}function saveUpdates(_0x356fe7,_0xd1e51b){return function(_0x10fde1){if(_0x10fde1){return _0x10fde1[_0x05d7('0x29')](_0x356fe7)[_0x05d7('0x2a')](function(_0x34aaad){return _0x34aaad;});}return null;};}function removeEntity(_0x1d0bee,_0x31081f){return function(_0x81dab7){if(_0x81dab7){return _0x81dab7[_0x05d7('0x2b')]()[_0x05d7('0x2a')](function(){_0x1d0bee[_0x05d7('0x20')](0xcc)[_0x05d7('0x2c')]();});}};}function handleEntityNotFound(_0x32e802,_0x2083d5){return function(_0x4e33bb){if(!_0x4e33bb){_0x32e802['sendStatus'](0x194);}return _0x4e33bb;};}function handleError(_0x5d3bad,_0xefd156){_0xefd156=_0xefd156||0x1f4;return function(_0x2b2e93){logger[_0x05d7('0x2d')](_0x2b2e93[_0x05d7('0x2e')]);if(_0x2b2e93[_0x05d7('0x2f')]){delete _0x2b2e93[_0x05d7('0x2f')];}_0x5d3bad[_0x05d7('0x20')](_0xefd156)['send'](_0x2b2e93);};}exports[_0x05d7('0x30')]=function(_0x355d2b,_0x24c125){var _0x232238={},_0x3cf995={},_0x13464d={'count':0x0,'rows':[]};var _0x3cdd60=db[_0x05d7('0x31')][_0x05d7('0x32')];_0x3cf995['model']=_[_0x05d7('0x33')](_0x3cdd60);_0x3cf995[_0x05d7('0x34')]=_[_0x05d7('0x33')](_0x355d2b[_0x05d7('0x34')]);_0x3cf995[_0x05d7('0x35')]=_[_0x05d7('0x36')](_0x3cf995['model'],_0x3cf995[_0x05d7('0x34')]);_0x232238[_0x05d7('0x37')]=_[_0x05d7('0x36')](_0x3cf995['model'],qs[_0x05d7('0x38')](_0x355d2b[_0x05d7('0x34')][_0x05d7('0x38')]));_0x232238['attributes']=_0x232238['attributes'][_0x05d7('0x39')]?_0x232238[_0x05d7('0x37')]:_0x3cf995[_0x05d7('0x3a')];if(!_0x355d2b[_0x05d7('0x34')][_0x05d7('0x3b')]('nolimit')){_0x232238[_0x05d7('0x23')]=qs['limit'](_0x355d2b[_0x05d7('0x34')][_0x05d7('0x23')]);_0x232238[_0x05d7('0x22')]=qs[_0x05d7('0x22')](_0x355d2b[_0x05d7('0x34')][_0x05d7('0x22')]);}_0x232238['order']=qs['sort'](_0x355d2b[_0x05d7('0x34')]['sort']);_0x232238[_0x05d7('0x3c')]=qs[_0x05d7('0x35')](_[_0x05d7('0x3d')](_0x355d2b[_0x05d7('0x34')],_0x3cf995[_0x05d7('0x35')]));if(_0x355d2b[_0x05d7('0x34')][_0x05d7('0x3e')]){_0x232238['where']=_[_0x05d7('0x3f')](_0x232238['where'],{'$or':_[_0x05d7('0x40')](_0x3cdd60,function(_0x25e757){if(_0x25e757[_0x05d7('0x41')]['key']!==_0x05d7('0x42')){var _0x3966ce={};_0x3966ce[_0x25e757[_0x05d7('0x43')]]={'$like':'%'+_0x355d2b['query'][_0x05d7('0x3e')]+'%'};return _0x3966ce;}})});}_0x232238=_['merge']({},_0x232238,_0x355d2b['options']);var _0x493e18={'where':_0x232238['where']};return db[_0x05d7('0x31')][_0x05d7('0x21')](_0x493e18)[_0x05d7('0x2a')](function(_0x3df819){_0x13464d[_0x05d7('0x21')]=_0x3df819;if(_0x355d2b[_0x05d7('0x34')][_0x05d7('0x44')]){_0x232238[_0x05d7('0x45')]=[{'all':!![]}];}return db[_0x05d7('0x31')][_0x05d7('0x46')](_0x232238);})[_0x05d7('0x2a')](function(_0x3c31f8){_0x13464d[_0x05d7('0x47')]=_0x3c31f8;return _0x13464d;})[_0x05d7('0x2a')](respondWithFilteredResult(_0x24c125,_0x232238))[_0x05d7('0x48')](handleError(_0x24c125,null));};exports[_0x05d7('0x49')]=function(_0x1372b2,_0x534b29){var _0x2469b5={'raw':!![],'where':{'id':_0x1372b2['params']['id']}},_0x46fab4={};_0x46fab4[_0x05d7('0x3a')]=_[_0x05d7('0x33')](db['ChatInternalMessage'][_0x05d7('0x32')]);_0x46fab4['query']=_[_0x05d7('0x33')](_0x1372b2['query']);_0x46fab4[_0x05d7('0x35')]=_[_0x05d7('0x36')](_0x46fab4['model'],_0x46fab4['query']);_0x2469b5[_0x05d7('0x37')]=_[_0x05d7('0x36')](_0x46fab4[_0x05d7('0x3a')],qs[_0x05d7('0x38')](_0x1372b2['query']['fields']));_0x2469b5['attributes']=_0x2469b5['attributes'][_0x05d7('0x39')]?_0x2469b5['attributes']:_0x46fab4[_0x05d7('0x3a')];if(_0x1372b2['query'][_0x05d7('0x44')]){_0x2469b5['include']=[{'all':!![]}];}_0x2469b5=_['merge']({},_0x2469b5,_0x1372b2[_0x05d7('0x4a')]);return db[_0x05d7('0x31')][_0x05d7('0x4b')](_0x2469b5)[_0x05d7('0x2a')](handleEntityNotFound(_0x534b29,null))[_0x05d7('0x2a')](respondWithResult(_0x534b29,null))[_0x05d7('0x48')](handleError(_0x534b29,null));};exports[_0x05d7('0x4c')]=function(_0x3a4af9,_0xa44d37){return db[_0x05d7('0x31')][_0x05d7('0x4c')](_0x3a4af9[_0x05d7('0x4d')],{})[_0x05d7('0x2a')](respondWithResult(_0xa44d37,0xc9))['catch'](handleError(_0xa44d37,null));};exports[_0x05d7('0x29')]=function(_0x596a8e,_0x3eee61){if(_0x596a8e['body']['id']){delete _0x596a8e['body']['id'];}return db[_0x05d7('0x31')][_0x05d7('0x4b')]({'where':{'id':_0x596a8e[_0x05d7('0x4e')]['id']}})[_0x05d7('0x2a')](handleEntityNotFound(_0x3eee61,null))[_0x05d7('0x2a')](saveUpdates(_0x596a8e[_0x05d7('0x4d')],null))[_0x05d7('0x2a')](respondWithResult(_0x3eee61,null))['catch'](handleError(_0x3eee61,null));};exports[_0x05d7('0x2b')]=function(_0x1adf42,_0x170b21){return db[_0x05d7('0x31')][_0x05d7('0x4b')]({'where':{'id':_0x1adf42[_0x05d7('0x4e')]['id']}})[_0x05d7('0x2a')](handleEntityNotFound(_0x170b21,null))[_0x05d7('0x2a')](removeEntity(_0x170b21,null))[_0x05d7('0x48')](handleError(_0x170b21,null));};exports[_0x05d7('0x4f')]=function(_0x3e1a1e,_0x252b2d){return db[_0x05d7('0x31')][_0x05d7('0x4f')]()[_0x05d7('0x2a')](respondWithResult(_0x252b2d,null))[_0x05d7('0x48')](handleError(_0x252b2d,null));};function wrapUser(_0x9b88db){return function(_0x493e23){var _0x332bae=_0x9b88db['get']({'plain':!![]});_0x332bae[_0x05d7('0x50')]=[];if(_0x493e23){_0x332bae[_0x05d7('0x51')]=_0x493e23['createdAt'];_0x332bae[_0x05d7('0x52')]=_0x493e23;}else{_0x332bae[_0x05d7('0x51')]=moment(0x0)[_0x05d7('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x332bae[_0x05d7('0x52')]={};}return _0x332bae;};}exports['getUsers']=function(_0x102a12,_0x1d7baf,_0x2b2c05){var _0x1cbee7=[];return db['User'][_0x05d7('0x46')]({'where':{'role':[_0x05d7('0x54'),_0x05d7('0x55'),_0x05d7('0x56')]},'attributes':['id',_0x05d7('0x57'),'name',_0x05d7('0x58'),_0x05d7('0x59'),_0x05d7('0x5a'),_0x05d7('0x5b'),'lastLoginAt','allowmessenger',_0x05d7('0x5c')],'order':qs[_0x05d7('0x5d')](_0x05d7('0x5e')),'include':[{'model':db[_0x05d7('0x5f')],'as':_0x05d7('0x60'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x05d7('0x2a')](function(_0x1bb474){if(_0x1bb474){var _0x3cee40=_0x102a12['user'][_0x05d7('0x61')]({'plain':!![]});if(!_0x3cee40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cee40[_0x05d7('0x58')]===_0x05d7('0x56')){return db[_0x05d7('0x62')][_0x05d7('0x4b')]({'where':{'name':_0x05d7('0x63'),'userProfileId':_0x3cee40[_0x05d7('0x64')]},'raw':!![]})[_0x05d7('0x2a')](function(_0x235378){if(_0x235378){if(_0x235378[_0x05d7('0x65')]===0x0){return db[_0x05d7('0x66')]['findAll']({'where':{'sectionId':_0x235378['id']},'raw':!![]})[_0x05d7('0x2a')](function(_0x379c0d){var _0x5d1490=[];if(_['isEmpty'](_0x379c0d)){_0x5d1490=_[_0x05d7('0x3e')](_0x1bb474,function(_0x175685){if(_0x175685['role']!==_0x05d7('0x54')){return _0x175685;}});return _0x5d1490;}else{for(var _0x4611fe=0x0;_0x4611fe<_0x1bb474[_0x05d7('0x39')];_0x4611fe++){var _0x150680=_0x1bb474[_0x4611fe];if(_0x150680[_0x05d7('0x58')]==='agent'){var _0x44d7f9=_[_0x05d7('0x4b')](_0x379c0d,function(_0x4f2994){return _0x4f2994[_0x05d7('0x67')]===_0x150680['id'];});if(_0x44d7f9)_0x5d1490[_0x05d7('0x68')](_0x150680);}else{_0x5d1490[_0x05d7('0x68')](_0x150680);}}return _0x5d1490;}});}else{return _0x1bb474;}}else{var _0x54f009=_[_0x05d7('0x3e')](_0x1bb474,function(_0x10f5ce){if(_0x10f5ce['role']!==_0x05d7('0x54')){return _0x10f5ce;}});return _0x54f009;}});}else{return _0x1bb474;}}})[_0x05d7('0x2a')](function(_0x342580){var _0x3178e2=[];if(_0x342580){_0x1cbee7=_0x342580;for(var _0xce73b9=0x0;_0xce73b9<_0x342580[_0x05d7('0x39')];_0xce73b9+=0x1){_0x1cbee7[_0xce73b9][_0x05d7('0x50')]=[];_0x3178e2[_0x05d7('0x68')](db[_0x05d7('0x31')][_0x05d7('0x4b')]({'where':{'FromId':[_0x102a12[_0x05d7('0x56')]['id'],_0x342580[_0xce73b9]['id']],'ToId':[_0x102a12[_0x05d7('0x56')]['id'],_0x342580[_0xce73b9]['id']],'ChatGroupId':null},'attributes':['id',_0x05d7('0x69'),_0x05d7('0x6a'),_0x05d7('0x6b'),_0x05d7('0x6c'),'body'],'order':qs['sort'](_0x05d7('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x05d7('0x2a')](wrapUser(_0x342580[_0xce73b9])));}return BPromise['all'](_0x3178e2);}return[];})[_0x05d7('0x2a')](function(_0x471ea1){return{'rows':_0x471ea1,'count':_0x471ea1['length']};})['then'](respondWithResult(_0x1d7baf,null))[_0x05d7('0x48')](handleError(_0x1d7baf,null));}; \ No newline at end of file +var _0x5223=['sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','key','field','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','get','messages','lastMessageAt','lastMessage','format','getUsers','User','findAll','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','isEmpty','agent','resourceId','push','createdAt','FromId','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','end','status','count','offset','limit','Content-Range','json','reject','save','update','then'];(function(_0x8a6cad,_0x2eae0e){var _0x1797ff=function(_0x20dff5){while(--_0x20dff5){_0x8a6cad['push'](_0x8a6cad['shift']());}};_0x1797ff(++_0x2eae0e);}(_0x5223,0x11f));var _0x3522=function(_0xafdc89,_0x15a532){_0xafdc89=_0xafdc89-0x0;var _0x3d5263=_0x5223[_0xafdc89];return _0x3d5263;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3522('0x0'));var rimraf=require(_0x3522('0x1'));var zipdir=require(_0x3522('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3522('0x3'));var moment=require(_0x3522('0x4'));var BPromise=require(_0x3522('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3522('0x6'));var sox=require(_0x3522('0x7'));var csv=require(_0x3522('0x8'));var ejs=require(_0x3522('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3522('0xa'));var jsforce=require(_0x3522('0xb'));var deskjs=require(_0x3522('0xc'));var toCsv=require(_0x3522('0x8'));var querystring=require('querystring');var Papa=require(_0x3522('0xd'));var Redis=require(_0x3522('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3522('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3522('0x10'))(_0x3522('0x11'));var utils=require(_0x3522('0x12'));var config=require(_0x3522('0x13'));var db=require('../../mysqldb')['db'];config[_0x3522('0x14')]=_[_0x3522('0x15')](config[_0x3522('0x14')],{'host':_0x3522('0x16'),'port':0x18eb});var socket=require(_0x3522('0x17'))(new Redis(config[_0x3522('0x14')]));require(_0x3522('0x18'))[_0x3522('0x19')](socket);function respondWithStatusCode(_0x4582f4,_0x31f1cd){_0x31f1cd=_0x31f1cd||0xcc;return function(_0x23c220){if(_0x23c220){return _0x4582f4['sendStatus'](_0x31f1cd);}return _0x4582f4['status'](_0x31f1cd)[_0x3522('0x1a')]();};}function respondWithResult(_0x284982,_0x4365f5){_0x4365f5=_0x4365f5||0xc8;return function(_0x5cf5d7){if(_0x5cf5d7){return _0x284982[_0x3522('0x1b')](_0x4365f5)['json'](_0x5cf5d7);}};}function respondWithFilteredResult(_0x1d2bf1,_0x1e5bb3){return function(_0x117ffb){if(_0x117ffb){var _0x181fca=_0x117ffb[_0x3522('0x1c')],_0x24eab0=_0x1e5bb3['offset'],_0xd58c57=_0x1e5bb3[_0x3522('0x1d')]+_0x1e5bb3[_0x3522('0x1e')],_0x183568;if(_0xd58c57>=_0x181fca){_0xd58c57=_0x181fca;_0x183568=0xc8;}else{_0x183568=0xce;}_0x1d2bf1[_0x3522('0x1b')](_0x183568);return _0x1d2bf1['set'](_0x3522('0x1f'),_0x24eab0+'-'+_0xd58c57+'/'+_0x181fca)[_0x3522('0x20')](_0x117ffb);}return null;};}function patchUpdates(_0x318b92){return function(_0x4d43d4){try{jsonpatch['apply'](_0x4d43d4,_0x318b92,!![]);}catch(_0x397a75){return BPromise[_0x3522('0x21')](_0x397a75);}return _0x4d43d4[_0x3522('0x22')]();};}function saveUpdates(_0x4b3770,_0x333034){return function(_0x424c21){if(_0x424c21){return _0x424c21[_0x3522('0x23')](_0x4b3770)[_0x3522('0x24')](function(_0x2210f8){return _0x2210f8;});}return null;};}function removeEntity(_0x43af92,_0x2f51b7){return function(_0x341e80){if(_0x341e80){return _0x341e80['destroy']()[_0x3522('0x24')](function(){_0x43af92[_0x3522('0x1b')](0xcc)[_0x3522('0x1a')]();});}};}function handleEntityNotFound(_0x54d477,_0xc27ac9){return function(_0x3c367e){if(!_0x3c367e){_0x54d477[_0x3522('0x25')](0x194);}return _0x3c367e;};}function handleError(_0x562231,_0x176d10){_0x176d10=_0x176d10||0x1f4;return function(_0x5a8aa4){logger[_0x3522('0x26')](_0x5a8aa4[_0x3522('0x27')]);if(_0x5a8aa4[_0x3522('0x28')]){delete _0x5a8aa4[_0x3522('0x28')];}_0x562231[_0x3522('0x1b')](_0x176d10)[_0x3522('0x29')](_0x5a8aa4);};}exports[_0x3522('0x2a')]=function(_0x3ef62e,_0x44e16d){var _0x5715ab={},_0xbee8d9={},_0x1aea8f={'count':0x0,'rows':[]};var _0x491b65=db[_0x3522('0x2b')][_0x3522('0x2c')];_0xbee8d9[_0x3522('0x2d')]=_['keys'](_0x491b65);_0xbee8d9['query']=_[_0x3522('0x2e')](_0x3ef62e['query']);_0xbee8d9[_0x3522('0x2f')]=_[_0x3522('0x30')](_0xbee8d9[_0x3522('0x2d')],_0xbee8d9[_0x3522('0x31')]);_0x5715ab[_0x3522('0x32')]=_[_0x3522('0x30')](_0xbee8d9[_0x3522('0x2d')],qs[_0x3522('0x33')](_0x3ef62e['query'][_0x3522('0x33')]));_0x5715ab['attributes']=_0x5715ab[_0x3522('0x32')][_0x3522('0x34')]?_0x5715ab[_0x3522('0x32')]:_0xbee8d9[_0x3522('0x2d')];if(!_0x3ef62e[_0x3522('0x31')]['hasOwnProperty'](_0x3522('0x35'))){_0x5715ab[_0x3522('0x1e')]=qs['limit'](_0x3ef62e[_0x3522('0x31')]['limit']);_0x5715ab[_0x3522('0x1d')]=qs[_0x3522('0x1d')](_0x3ef62e[_0x3522('0x31')]['offset']);}_0x5715ab[_0x3522('0x36')]=qs[_0x3522('0x37')](_0x3ef62e[_0x3522('0x31')][_0x3522('0x37')]);_0x5715ab[_0x3522('0x38')]=qs['filters'](_[_0x3522('0x39')](_0x3ef62e[_0x3522('0x31')],_0xbee8d9[_0x3522('0x2f')]));if(_0x3ef62e[_0x3522('0x31')][_0x3522('0x3a')]){_0x5715ab[_0x3522('0x38')]=_[_0x3522('0x3b')](_0x5715ab['where'],{'$or':_['map'](_0x491b65,function(_0x3715b6){if(_0x3715b6['type'][_0x3522('0x3c')]!=='VIRTUAL'){var _0x971433={};_0x971433[_0x3715b6[_0x3522('0x3d')]]={'$like':'%'+_0x3ef62e[_0x3522('0x31')][_0x3522('0x3a')]+'%'};return _0x971433;}})});}_0x5715ab=_[_0x3522('0x3b')]({},_0x5715ab,_0x3ef62e['options']);var _0x3fd215={'where':_0x5715ab[_0x3522('0x38')]};return db['ChatInternalMessage'][_0x3522('0x1c')](_0x3fd215)[_0x3522('0x24')](function(_0x112944){_0x1aea8f[_0x3522('0x1c')]=_0x112944;if(_0x3ef62e[_0x3522('0x31')][_0x3522('0x3e')]){_0x5715ab[_0x3522('0x3f')]=[{'all':!![]}];}return db[_0x3522('0x2b')]['findAll'](_0x5715ab);})[_0x3522('0x24')](function(_0x559117){_0x1aea8f[_0x3522('0x40')]=_0x559117;return _0x1aea8f;})[_0x3522('0x24')](respondWithFilteredResult(_0x44e16d,_0x5715ab))[_0x3522('0x41')](handleError(_0x44e16d,null));};exports[_0x3522('0x42')]=function(_0x110c02,_0x43b9b6){var _0x4f6928={'raw':!![],'where':{'id':_0x110c02[_0x3522('0x43')]['id']}},_0x2f8fe2={};_0x2f8fe2[_0x3522('0x2d')]=_[_0x3522('0x2e')](db[_0x3522('0x2b')][_0x3522('0x2c')]);_0x2f8fe2[_0x3522('0x31')]=_[_0x3522('0x2e')](_0x110c02[_0x3522('0x31')]);_0x2f8fe2[_0x3522('0x2f')]=_['intersection'](_0x2f8fe2['model'],_0x2f8fe2['query']);_0x4f6928[_0x3522('0x32')]=_[_0x3522('0x30')](_0x2f8fe2['model'],qs[_0x3522('0x33')](_0x110c02['query']['fields']));_0x4f6928[_0x3522('0x32')]=_0x4f6928[_0x3522('0x32')][_0x3522('0x34')]?_0x4f6928['attributes']:_0x2f8fe2['model'];if(_0x110c02[_0x3522('0x31')]['includeAll']){_0x4f6928[_0x3522('0x3f')]=[{'all':!![]}];}_0x4f6928=_[_0x3522('0x3b')]({},_0x4f6928,_0x110c02['options']);return db['ChatInternalMessage'][_0x3522('0x44')](_0x4f6928)[_0x3522('0x24')](handleEntityNotFound(_0x43b9b6,null))[_0x3522('0x24')](respondWithResult(_0x43b9b6,null))['catch'](handleError(_0x43b9b6,null));};exports[_0x3522('0x45')]=function(_0x4d338e,_0x3655d8){return db[_0x3522('0x2b')][_0x3522('0x45')](_0x4d338e[_0x3522('0x46')],{})['then'](respondWithResult(_0x3655d8,0xc9))['catch'](handleError(_0x3655d8,null));};exports[_0x3522('0x23')]=function(_0x1638e1,_0x4929c1){if(_0x1638e1['body']['id']){delete _0x1638e1[_0x3522('0x46')]['id'];}return db[_0x3522('0x2b')][_0x3522('0x44')]({'where':{'id':_0x1638e1[_0x3522('0x43')]['id']}})[_0x3522('0x24')](handleEntityNotFound(_0x4929c1,null))[_0x3522('0x24')](saveUpdates(_0x1638e1[_0x3522('0x46')],null))[_0x3522('0x24')](respondWithResult(_0x4929c1,null))[_0x3522('0x41')](handleError(_0x4929c1,null));};exports[_0x3522('0x47')]=function(_0x52b6a7,_0x5df961){return db[_0x3522('0x2b')][_0x3522('0x44')]({'where':{'id':_0x52b6a7[_0x3522('0x43')]['id']}})[_0x3522('0x24')](handleEntityNotFound(_0x5df961,null))['then'](removeEntity(_0x5df961,null))['catch'](handleError(_0x5df961,null));};exports[_0x3522('0x48')]=function(_0x5f20b9,_0x12dada){return db[_0x3522('0x2b')]['describe']()[_0x3522('0x24')](respondWithResult(_0x12dada,null))[_0x3522('0x41')](handleError(_0x12dada,null));};function wrapUser(_0x23d7d8){return function(_0x5629bc){var _0xd2ef62=_0x23d7d8[_0x3522('0x49')]({'plain':!![]});_0xd2ef62[_0x3522('0x4a')]=[];if(_0x5629bc){_0xd2ef62[_0x3522('0x4b')]=_0x5629bc['createdAt'];_0xd2ef62[_0x3522('0x4c')]=_0x5629bc;}else{_0xd2ef62[_0x3522('0x4b')]=moment(0x0)[_0x3522('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0xd2ef62[_0x3522('0x4c')]={};}return _0xd2ef62;};}exports[_0x3522('0x4e')]=function(_0x233065,_0x1ee182,_0x1b6929){var _0x15b91e=[];return db[_0x3522('0x4f')][_0x3522('0x50')]({'where':{'role':['agent',_0x3522('0x51'),_0x3522('0x52')]},'attributes':['id',_0x3522('0x53'),_0x3522('0x28'),_0x3522('0x54'),_0x3522('0x55'),_0x3522('0x56'),_0x3522('0x57'),_0x3522('0x58'),_0x3522('0x59'),_0x3522('0x5a')],'order':qs['sort'](_0x3522('0x5b')),'include':[{'model':db[_0x3522('0x5c')],'as':_0x3522('0x5d'),'attributes':['id',_0x3522('0x28'),_0x3522('0x5e')],'through':{'attributes':[]}}]})[_0x3522('0x24')](function(_0x136efe){if(_0x136efe){var _0x3aee65=_0x233065['user'][_0x3522('0x49')]({'plain':!![]});if(!_0x3aee65)throw new Error(_0x3522('0x5f'));if(_0x3aee65['role']===_0x3522('0x52')){return db[_0x3522('0x60')]['find']({'where':{'name':_0x3522('0x61'),'userProfileId':_0x3aee65[_0x3522('0x62')]},'raw':!![]})['then'](function(_0x3a9ee2){if(_0x3a9ee2){if(_0x3a9ee2['autoAssociation']===0x0){return db['UserProfileResource'][_0x3522('0x50')]({'where':{'sectionId':_0x3a9ee2['id']},'raw':!![]})['then'](function(_0x4048c8){var _0x2214ef=[];if(_[_0x3522('0x63')](_0x4048c8)){_0x2214ef=_['filter'](_0x136efe,function(_0x336e14){if(_0x336e14['role']!=='agent'){return _0x336e14;}});return _0x2214ef;}else{for(var _0x48dd89=0x0;_0x48dd89<_0x136efe['length'];_0x48dd89++){var _0x53eb94=_0x136efe[_0x48dd89];if(_0x53eb94['role']===_0x3522('0x64')){var _0x6d8e3d=_['find'](_0x4048c8,function(_0x1c27e5){return _0x1c27e5[_0x3522('0x65')]===_0x53eb94['id'];});if(_0x6d8e3d)_0x2214ef[_0x3522('0x66')](_0x53eb94);}else{_0x2214ef[_0x3522('0x66')](_0x53eb94);}}return _0x2214ef;}});}else{return _0x136efe;}}else{var _0x59d886=_['filter'](_0x136efe,function(_0x43c5ad){if(_0x43c5ad[_0x3522('0x54')]!==_0x3522('0x64')){return _0x43c5ad;}});return _0x59d886;}});}else{return _0x136efe;}}})['then'](function(_0x4b5130){var _0x4d46ec=[];if(_0x4b5130){_0x15b91e=_0x4b5130;for(var _0x2e108e=0x0;_0x2e108e<_0x4b5130[_0x3522('0x34')];_0x2e108e+=0x1){_0x15b91e[_0x2e108e][_0x3522('0x4a')]=[];_0x4d46ec['push'](db[_0x3522('0x2b')][_0x3522('0x44')]({'where':{'FromId':[_0x233065['user']['id'],_0x4b5130[_0x2e108e]['id']],'ToId':[_0x233065[_0x3522('0x52')]['id'],_0x4b5130[_0x2e108e]['id']],'ChatGroupId':null},'attributes':['id',_0x3522('0x67'),_0x3522('0x68'),_0x3522('0x69'),_0x3522('0x6a'),'body'],'order':qs[_0x3522('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x4b5130[_0x2e108e])));}return BPromise[_0x3522('0x6b')](_0x4d46ec);}return[];})[_0x3522('0x24')](function(_0xaff027){return{'rows':_0xaff027,'count':_0xaff027[_0x3522('0x34')]};})[_0x3522('0x24')](respondWithResult(_0x1ee182,null))['catch'](handleError(_0x1ee182,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 4a9c14f..4c54aef 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 _0xb9a7=['emit','hasOwnProperty','hook','exports','../../mysqldb','update'];(function(_0x171e77,_0x503489){var _0xc37140=function(_0x148c94){while(--_0x148c94){_0x171e77['push'](_0x171e77['shift']());}};_0xc37140(++_0x503489);}(_0xb9a7,0x112));var _0x7b9a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb9a7[_0x2064e5];return _0x21a233;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x7b9a('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b9a('0x1'),'afterDestroy':'remove'};function emitEvent(_0x1396ec){return function(_0x40ef7d,_0x37b25b,_0x24cae3){ChatInternalMessageEvents[_0x7b9a('0x2')](_0x1396ec+':'+_0x40ef7d['id'],_0x40ef7d);ChatInternalMessageEvents[_0x7b9a('0x2')](_0x1396ec,_0x40ef7d);_0x24cae3(null);};}for(var e in events){if(events[_0x7b9a('0x3')](e)){var event=events[e];ChatInternalMessage[_0x7b9a('0x4')](e,emitEvent(event));}}module[_0x7b9a('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x4fad=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','save'];(function(_0xb5054,_0x17ca0a){var _0x1161da=function(_0xc6d4e6){while(--_0xc6d4e6){_0xb5054['push'](_0xb5054['shift']());}};_0x1161da(++_0x17ca0a);}(_0x4fad,0xcb));var _0xd4fa=function(_0x26095c,_0x3538a6){_0x26095c=_0x26095c-0x0;var _0x36a3c4=_0x4fad[_0x26095c];return _0x36a3c4;};'use strict';var EventEmitter=require(_0xd4fa('0x0'));var ChatInternalMessage=require(_0xd4fa('0x1'))['db'][_0xd4fa('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4fa('0x3'),'afterUpdate':_0xd4fa('0x4'),'afterDestroy':_0xd4fa('0x5')};function emitEvent(_0x3fc857){return function(_0x419a9c,_0x3903a1,_0x138bcb){ChatInternalMessageEvents[_0xd4fa('0x6')](_0x3fc857+':'+_0x419a9c['id'],_0x419a9c);ChatInternalMessageEvents['emit'](_0x3fc857,_0x419a9c);_0x138bcb(null);};}for(var e in events){if(events[_0xd4fa('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xd4fa('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 ccdf995..aaff1ac 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 _0xc522=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x1bd7b0,_0x5e99e0){var _0x508e45=function(_0x367a19){while(--_0x367a19){_0x1bd7b0['push'](_0x1bd7b0['shift']());}};_0x508e45(++_0x5e99e0);}(_0xc522,0x100));var _0x2c52=function(_0x59f1e2,_0x5c86f7){_0x59f1e2=_0x59f1e2-0x0;var _0x2eaa60=_0xc522[_0x59f1e2];return _0x2eaa60;};'use strict';var _=require('lodash');var util=require(_0x2c52('0x0'));var logger=require(_0x2c52('0x1'))(_0x2c52('0x2'));var moment=require(_0x2c52('0x3'));var BPromise=require('bluebird');var rp=require(_0x2c52('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c52('0x5'));var attributes=require(_0x2c52('0x6'));module[_0x2c52('0x7')]=function(_0x292afd,_0x4471be){return _0x292afd[_0x2c52('0x8')](_0x2c52('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c52('0xa'),'collate':_0x2c52('0xb')});}; \ No newline at end of file +var _0x0e9c=['chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','ChatInternalMessage'];(function(_0x145e9e,_0x2e6dd4){var _0x2264c2=function(_0x57d209){while(--_0x57d209){_0x145e9e['push'](_0x145e9e['shift']());}};_0x2264c2(++_0x2e6dd4);}(_0x0e9c,0x1d6));var _0xc0e9=function(_0x3b1666,_0xea4e07){_0x3b1666=_0x3b1666-0x0;var _0x4b6de4=_0x0e9c[_0x3b1666];return _0x4b6de4;};'use strict';var _=require(_0xc0e9('0x0'));var util=require(_0xc0e9('0x1'));var logger=require(_0xc0e9('0x2'))(_0xc0e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc0e9('0x4'));var fs=require('fs');var path=require(_0xc0e9('0x5'));var rimraf=require('rimraf');var config=require(_0xc0e9('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0xc0e9('0x7')]=function(_0x3644fd,_0x43b5ac){return _0x3644fd[_0xc0e9('0x8')](_0xc0e9('0x9'),attributes,{'tableName':_0xc0e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc0e9('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index e2a1e61..9ba134d 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 _0x3e68=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1ff572,_0x2b5691){var _0xd597b0=function(_0x39a0f2){while(--_0x39a0f2){_0x1ff572['push'](_0x1ff572['shift']());}};_0xd597b0(++_0x2b5691);}(_0x3e68,0x190));var _0x83e6=function(_0x155bd8,_0x32f852){_0x155bd8=_0x155bd8-0x0;var _0x572cfc=_0x3e68[_0x155bd8];return _0x572cfc;};'use strict';var _=require(_0x83e6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x83e6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83e6('0x2'));var db=require(_0x83e6('0x3'))['db'];var utils=require(_0x83e6('0x4'));var logger=require(_0x83e6('0x5'))(_0x83e6('0x6'));var config=require(_0x83e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x83e6('0x8')][_0x83e6('0x9')]({'port':0x232a});config[_0x83e6('0xa')]=_[_0x83e6('0xb')](config[_0x83e6('0xa')],{'host':_0x83e6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83e6('0xa')]));require(_0x83e6('0xd'))[_0x83e6('0xe')](socket);function respondWithRpcPromise(_0x40f1f4,_0x38ea8e,_0x377c5a){return new BPromise(function(_0x2edf34,_0x1f9bef){return client[_0x83e6('0xf')](_0x40f1f4,_0x377c5a)[_0x83e6('0x10')](function(_0x5a9ad3){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x38ea8e,_0x83e6('0x11'));logger[_0x83e6('0x12')](_0x83e6('0x13'),_0x38ea8e,'request\x20sent',JSON[_0x83e6('0x14')](_0x5a9ad3));if(_0x5a9ad3[_0x83e6('0x15')]){if(_0x5a9ad3[_0x83e6('0x15')]['code']===0x1f4){logger[_0x83e6('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x38ea8e,_0x5a9ad3[_0x83e6('0x15')][_0x83e6('0x16')]);return _0x1f9bef(_0x5a9ad3[_0x83e6('0x15')][_0x83e6('0x16')]);}logger['error'](_0x83e6('0x17'),_0x38ea8e,_0x5a9ad3[_0x83e6('0x15')][_0x83e6('0x16')]);return _0x2edf34(_0x5a9ad3[_0x83e6('0x15')][_0x83e6('0x16')]);}else{logger[_0x83e6('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x38ea8e,'request\x20sent');_0x2edf34(_0x5a9ad3[_0x83e6('0x19')][_0x83e6('0x16')]);}})[_0x83e6('0x1a')](function(_0x22da68){logger['error'](_0x83e6('0x17'),_0x38ea8e,_0x22da68);_0x1f9bef(_0x22da68);});});} \ No newline at end of file +var _0xf5a1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xf5a1,0x129));var _0x1f5a=function(_0x1fc2a6,_0x115106){_0x1fc2a6=_0x1fc2a6-0x0;var _0x3376a2=_0xf5a1[_0x1fc2a6];return _0x3376a2;};'use strict';var _=require(_0x1f5a('0x0'));var util=require(_0x1f5a('0x1'));var moment=require(_0x1f5a('0x2'));var BPromise=require(_0x1f5a('0x3'));var rs=require(_0x1f5a('0x4'));var fs=require('fs');var Redis=require(_0x1f5a('0x5'));var db=require(_0x1f5a('0x6'))['db'];var utils=require(_0x1f5a('0x7'));var logger=require('../../config/logger')(_0x1f5a('0x8'));var config=require(_0x1f5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1f5a('0xa')][_0x1f5a('0xb')]({'port':0x232a});config[_0x1f5a('0xc')]=_['defaults'](config[_0x1f5a('0xc')],{'host':_0x1f5a('0xd'),'port':0x18eb});var socket=require(_0x1f5a('0xe'))(new Redis(config[_0x1f5a('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52d0dd,_0x10b3fe,_0x4babe9){return new BPromise(function(_0x34ee57,_0x44c941){return client[_0x1f5a('0xf')](_0x52d0dd,_0x4babe9)[_0x1f5a('0x10')](function(_0x29001e){logger['info'](_0x1f5a('0x11'),_0x10b3fe,_0x1f5a('0x12'));logger[_0x1f5a('0x13')](_0x1f5a('0x14'),_0x10b3fe,_0x1f5a('0x12'),JSON[_0x1f5a('0x15')](_0x29001e));if(_0x29001e['error']){if(_0x29001e[_0x1f5a('0x16')]['code']===0x1f4){logger['error'](_0x1f5a('0x11'),_0x10b3fe,_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);return _0x44c941(_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);}logger[_0x1f5a('0x16')](_0x1f5a('0x11'),_0x10b3fe,_0x29001e[_0x1f5a('0x16')][_0x1f5a('0x17')]);return _0x34ee57(_0x29001e[_0x1f5a('0x16')]['message']);}else{logger[_0x1f5a('0x18')](_0x1f5a('0x11'),_0x10b3fe,_0x1f5a('0x12'));_0x34ee57(_0x29001e[_0x1f5a('0x19')]['message']);}})[_0x1f5a('0x1a')](function(_0x253e2a){logger[_0x1f5a('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x10b3fe,_0x253e2a);_0x44c941(_0x253e2a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 1615111..8317253 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 _0x0748=['emit','removeListener','length','chatInternalMessage:','save','remove','update'];(function(_0x289af2,_0xf1a70c){var _0x35f1d7=function(_0x13db44){while(--_0x13db44){_0x289af2['push'](_0x289af2['shift']());}};_0x35f1d7(++_0xf1a70c);}(_0x0748,0x1b6));var _0x8074=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x0748[_0x27e811];return _0x1627fa;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x8074('0x0'),_0x8074('0x1'),_0x8074('0x2')];function createListener(_0x5698d,_0x599779){return function(_0x241113){_0x599779[_0x8074('0x3')](_0x5698d,_0x241113);};}function removeListener(_0x4f5af7,_0x3b7fdc){return function(){ChatInternalMessageEvents[_0x8074('0x4')](_0x4f5af7,_0x3b7fdc);};}exports['register']=function(_0x370a38){for(var _0x4e7815=0x0,_0x58069c=events[_0x8074('0x5')];_0x4e7815<_0x58069c;_0x4e7815++){var _0x54a5ad=events[_0x4e7815];var _0x1c39ec=createListener(_0x8074('0x6')+_0x54a5ad,_0x370a38);ChatInternalMessageEvents['on'](_0x54a5ad,_0x1c39ec);}}; \ No newline at end of file +var _0xd5da=['remove','update','emit','register','./chatInternalMessage.events','save'];(function(_0x56edc2,_0x2c2fff){var _0x20420d=function(_0x3379ef){while(--_0x3379ef){_0x56edc2['push'](_0x56edc2['shift']());}};_0x20420d(++_0x2c2fff);}(_0xd5da,0x19c));var _0xad5d=function(_0x295bc0,_0x1903af){_0x295bc0=_0x295bc0-0x0;var _0x300115=_0xd5da[_0x295bc0];return _0x300115;};'use strict';var ChatInternalMessageEvents=require(_0xad5d('0x0'));var events=[_0xad5d('0x1'),_0xad5d('0x2'),_0xad5d('0x3')];function createListener(_0x2d5081,_0x2604bf){return function(_0x548227){_0x2604bf[_0xad5d('0x4')](_0x2d5081,_0x548227);};}function removeListener(_0x3117b9,_0xaa5b62){return function(){ChatInternalMessageEvents['removeListener'](_0x3117b9,_0xaa5b62);};}exports[_0xad5d('0x5')]=function(_0x52d1ae){for(var _0x1b65ba=0x0,_0x5fcea8=events['length'];_0x1b65ba<_0x5fcea8;_0x1b65ba++){var _0x5ec94d=events[_0x1b65ba];var _0x5ac71e=createListener('chatInternalMessage:'+_0x5ec94d,_0x52d1ae);ChatInternalMessageEvents['on'](_0x5ec94d,_0x5ac71e);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index b3f48cf..87f9af1 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 _0xbb6b=['./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x47a768,_0x3357cc){var _0x5d756d=function(_0x3d89b4){while(--_0x3d89b4){_0x47a768['push'](_0x47a768['shift']());}};_0x5d756d(++_0x3357cc);}(_0xbb6b,0xa9));var _0xbbb6=function(_0x517378,_0x4f6ba6){_0x517378=_0x517378-0x0;var _0x271119=_0xbb6b[_0x517378];return _0x271119;};'use strict';var multer=require(_0xbbb6('0x0'));var util=require(_0xbbb6('0x1'));var path=require(_0xbbb6('0x2'));var timeout=require(_0xbbb6('0x3'));var express=require(_0xbbb6('0x4'));var router=express['Router']();var auth=require(_0xbbb6('0x5'));var interaction=require(_0xbbb6('0x6'));var config=require('../../config/environment');var controller=require(_0xbbb6('0x7'));router[_0xbbb6('0x8')]('/',auth[_0xbbb6('0x9')](),controller[_0xbbb6('0xa')]);router[_0xbbb6('0x8')](_0xbbb6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xbbb6('0x8')](_0xbbb6('0xc'),auth[_0xbbb6('0x9')](),controller[_0xbbb6('0xd')]);router[_0xbbb6('0x8')]('/:id',auth[_0xbbb6('0x9')](),controller[_0xbbb6('0xe')]);router[_0xbbb6('0xf')]('/',auth[_0xbbb6('0x9')](),controller[_0xbbb6('0x10')]);router[_0xbbb6('0x11')](_0xbbb6('0x12'),controller[_0xbbb6('0x13')]);router['delete'](_0xbbb6('0x12'),auth[_0xbbb6('0x9')](),controller[_0xbbb6('0x14')]);module[_0xbbb6('0x15')]=router; \ No newline at end of file +var _0xf966=['get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xf966,0x184));var _0x6f96=function(_0x440638,_0x44cd10){_0x440638=_0x440638-0x0;var _0x1d93f9=_0xf966[_0x440638];return _0x1d93f9;};'use strict';var multer=require(_0x6f96('0x0'));var util=require(_0x6f96('0x1'));var path=require(_0x6f96('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f96('0x3'));var router=express[_0x6f96('0x4')]();var auth=require(_0x6f96('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f96('0x6'));var controller=require(_0x6f96('0x7'));router[_0x6f96('0x8')]('/',auth['isAuthenticated'](),controller[_0x6f96('0x9')]);router[_0x6f96('0x8')](_0x6f96('0xa'),auth[_0x6f96('0xb')](),controller[_0x6f96('0xc')]);router[_0x6f96('0x8')](_0x6f96('0xd'),auth[_0x6f96('0xb')](),controller[_0x6f96('0xe')]);router[_0x6f96('0x8')](_0x6f96('0xf'),auth[_0x6f96('0xb')](),controller[_0x6f96('0x10')]);router[_0x6f96('0x11')]('/',auth[_0x6f96('0xb')](),controller['create']);router[_0x6f96('0x12')]('/:id',controller['update']);router[_0x6f96('0x13')](_0x6f96('0xf'),auth['isAuthenticated'](),controller[_0x6f96('0x14')]);module[_0x6f96('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 37ac866..fc4b8cf 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 _0x0ab8=['sequelize','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x584a4b,_0x8603da){var _0x4b1ade=function(_0x2b8858){while(--_0x2b8858){_0x584a4b['push'](_0x584a4b['shift']());}};_0x4b1ade(++_0x8603da);}(_0x0ab8,0x1d5));var _0x80ab=function(_0x1db321,_0x1d8929){_0x1db321=_0x1db321-0x0;var _0x3de066=_0x0ab8[_0x1db321];return _0x3de066;};'use strict';var Sequelize=require(_0x80ab('0x0'));module['exports']={'body':{'type':Sequelize[_0x80ab('0x1')](_0x80ab('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x80ab('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x80ab('0x4')]('in',_0x80ab('0x5')),'defaultValue':_0x80ab('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x80ab('0x6')]}}; \ No newline at end of file +var _0x165b=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x1835ec,_0x352b78){var _0x19e32f=function(_0x4aa8cf){while(--_0x4aa8cf){_0x1835ec['push'](_0x1835ec['shift']());}};_0x19e32f(++_0x352b78);}(_0x165b,0x114));var _0xb165=function(_0x4521a8,_0x27ca74){_0x4521a8=_0x4521a8-0x0;var _0x5a3d58=_0x165b[_0x4521a8];return _0x5a3d58;};'use strict';var Sequelize=require(_0xb165('0x0'));module[_0xb165('0x1')]={'body':{'type':Sequelize[_0xb165('0x2')](_0xb165('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb165('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb165('0x5')]('in',_0xb165('0x6')),'defaultValue':_0xb165('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb165('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index bc150ef..cb11f80 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 _0x2fc7=['client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','then','destroy','stack','send','index','ChatMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','map','type','key','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','includeAll','find','create','body','describe','../../config/logger','chat-interactions','accept','read','readAt','format','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','name','role','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','chat','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register'];(function(_0x46533c,_0x245b0c){var _0x571030=function(_0x66dd9f){while(--_0x66dd9f){_0x46533c['push'](_0x46533c['shift']());}};_0x571030(++_0x245b0c);}(_0x2fc7,0x15b));var _0x72fc=function(_0x14e768,_0x33b635){_0x14e768=_0x14e768-0x0;var _0x2b6225=_0x2fc7[_0x14e768];return _0x2b6225;};'use strict';var pdf=require(_0x72fc('0x0'));var emlformat=require(_0x72fc('0x1'));var rimraf=require(_0x72fc('0x2'));var zipdir=require(_0x72fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72fc('0x4'));var moment=require(_0x72fc('0x5'));var BPromise=require(_0x72fc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x72fc('0x7'));var sox=require(_0x72fc('0x8'));var csv=require('to-csv');var ejs=require(_0x72fc('0x9'));var fs=require('fs');var _=require(_0x72fc('0xa'));var squel=require('squel');var crypto=require(_0x72fc('0xb'));var jsforce=require(_0x72fc('0xc'));var deskjs=require(_0x72fc('0xd'));var toCsv=require(_0x72fc('0xe'));var querystring=require(_0x72fc('0xf'));var Papa=require(_0x72fc('0x10'));var Redis=require(_0x72fc('0x11'));var authService=require(_0x72fc('0x12'));var qs=require(_0x72fc('0x13'));var hardwareService=require(_0x72fc('0x14'));var logger=require('../../config/logger')(_0x72fc('0x15'));var utils=require('../../config/utils');var config=require(_0x72fc('0x16'));var db=require(_0x72fc('0x17'))['db'];config[_0x72fc('0x18')]=_[_0x72fc('0x19')](config[_0x72fc('0x18')],{'host':_0x72fc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72fc('0x18')]));require('./chatMessage.socket')[_0x72fc('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x72fc('0x1c')][_0x72fc('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x72fc('0x1d')]({'port':0x232a});function checkPasswordPattern(_0xd4203e,_0x4a5004,_0x9ef4e9){if(_0x9ef4e9){var _0x321ec9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x321ec9['test'](_0x4a5004)){return _0xd4203e;}else{throw new Error(_0x72fc('0x1e'));}}else{return _0xd4203e;}}function respondWithRpcPromise(_0x56e202,_0xd0261f,_0x4ce552,_0x349514){return new BPromise(function(_0x6da7b7,_0x2efefb){var _0x322b10=_0x349514||client;return _0x322b10[_0x72fc('0x1f')](_0x56e202,_0x4ce552)['then'](function(_0x50faa1){logger[_0x72fc('0x20')]('ChatMessage,\x20%s,\x20%s',_0xd0261f,'request\x20sent');logger[_0x72fc('0x21')](_0x72fc('0x22'),_0xd0261f,_0x72fc('0x23'),JSON[_0x72fc('0x24')](_0x50faa1));if(_0x50faa1[_0x72fc('0x25')]){if(_0x50faa1['error']['code']===0x1f4){logger[_0x72fc('0x25')](_0x72fc('0x26'),_0xd0261f,_0x50faa1['error'][_0x72fc('0x27')]);return _0x2efefb(_0x50faa1[_0x72fc('0x25')][_0x72fc('0x27')]);}logger[_0x72fc('0x25')]('ChatMessage,\x20%s,\x20%s',_0xd0261f,_0x50faa1[_0x72fc('0x25')][_0x72fc('0x27')]);return _0x6da7b7(_0x50faa1[_0x72fc('0x25')][_0x72fc('0x27')]);}else{logger[_0x72fc('0x20')](_0x72fc('0x26'),_0xd0261f,'request\x20sent');_0x6da7b7(_0x50faa1[_0x72fc('0x28')]['message']);}})[_0x72fc('0x29')](function(_0x43cf2a){logger[_0x72fc('0x25')](_0x72fc('0x26'),_0xd0261f,_0x43cf2a);_0x2efefb(_0x43cf2a);});});}function respondWithStatusCode(_0x56b741,_0x4b524b){_0x4b524b=_0x4b524b||0xcc;return function(_0x24bcaa){if(_0x24bcaa){return _0x56b741[_0x72fc('0x2a')](_0x4b524b);}return _0x56b741[_0x72fc('0x2b')](_0x4b524b)[_0x72fc('0x2c')]();};}function respondWithResult(_0x36929a,_0x43c7a9){_0x43c7a9=_0x43c7a9||0xc8;return function(_0x42c866){if(_0x42c866){return _0x36929a[_0x72fc('0x2b')](_0x43c7a9)['json'](_0x42c866);}};}function respondWithFilteredResult(_0x355825,_0x1f5e38){return function(_0x40d6e2){if(_0x40d6e2){var _0x5f50a3=_0x40d6e2[_0x72fc('0x2d')],_0x437972=_0x1f5e38['offset'],_0x273757=_0x1f5e38[_0x72fc('0x2e')]+_0x1f5e38['limit'],_0x16f0ee;if(_0x273757>=_0x5f50a3){_0x273757=_0x5f50a3;_0x16f0ee=0xc8;}else{_0x16f0ee=0xce;}_0x355825[_0x72fc('0x2b')](_0x16f0ee);return _0x355825['set'](_0x72fc('0x2f'),_0x437972+'-'+_0x273757+'/'+_0x5f50a3)[_0x72fc('0x30')](_0x40d6e2);}return null;};}function patchUpdates(_0x2966e2){return function(_0x1325fe){try{jsonpatch[_0x72fc('0x31')](_0x1325fe,_0x2966e2,!![]);}catch(_0x17b0e8){return BPromise[_0x72fc('0x32')](_0x17b0e8);}return _0x1325fe[_0x72fc('0x33')]();};}function saveUpdates(_0x35191f,_0x53a984){return function(_0x581675){if(_0x581675){return _0x581675['update'](_0x35191f)[_0x72fc('0x34')](function(_0x1d346b){return _0x1d346b;});}return null;};}function removeEntity(_0x1efe35,_0x10964e){return function(_0x114679){if(_0x114679){return _0x114679[_0x72fc('0x35')]()[_0x72fc('0x34')](function(){_0x1efe35['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc8569a,_0x27b7a1){return function(_0x39da07){if(!_0x39da07){_0xc8569a[_0x72fc('0x2a')](0x194);}return _0x39da07;};}function handleError(_0x201884,_0x43e257){_0x43e257=_0x43e257||0x1f4;return function(_0x207a16){logger[_0x72fc('0x25')](_0x207a16[_0x72fc('0x36')]);if(_0x207a16['name']){delete _0x207a16['name'];}_0x201884[_0x72fc('0x2b')](_0x43e257)[_0x72fc('0x37')](_0x207a16);};}exports[_0x72fc('0x38')]=function(_0x4f3f11,_0x3f032b){var _0x55b15c={},_0x33cc38={},_0x36d173={'count':0x0,'rows':[]};var _0x375085=db[_0x72fc('0x39')][_0x72fc('0x3a')];_0x33cc38[_0x72fc('0x3b')]=_[_0x72fc('0x3c')](_0x375085);_0x33cc38[_0x72fc('0x3d')]=_[_0x72fc('0x3c')](_0x4f3f11['query']);_0x33cc38[_0x72fc('0x3e')]=_[_0x72fc('0x3f')](_0x33cc38[_0x72fc('0x3b')],_0x33cc38['query']);_0x55b15c[_0x72fc('0x40')]=_['intersection'](_0x33cc38[_0x72fc('0x3b')],qs[_0x72fc('0x41')](_0x4f3f11['query']['fields']));_0x55b15c['attributes']=_0x55b15c['attributes'][_0x72fc('0x42')]?_0x55b15c[_0x72fc('0x40')]:_0x33cc38[_0x72fc('0x3b')];if(!_0x4f3f11['query'][_0x72fc('0x43')](_0x72fc('0x44'))){_0x55b15c[_0x72fc('0x45')]=qs[_0x72fc('0x45')](_0x4f3f11['query'][_0x72fc('0x45')]);_0x55b15c[_0x72fc('0x2e')]=qs[_0x72fc('0x2e')](_0x4f3f11[_0x72fc('0x3d')][_0x72fc('0x2e')]);}_0x55b15c[_0x72fc('0x46')]=qs[_0x72fc('0x47')](_0x4f3f11[_0x72fc('0x3d')][_0x72fc('0x47')]);_0x55b15c['where']=qs[_0x72fc('0x3e')](_[_0x72fc('0x48')](_0x4f3f11[_0x72fc('0x3d')],_0x33cc38['filters']));if(_0x4f3f11[_0x72fc('0x3d')]['filter']){_0x55b15c['where']=_['merge'](_0x55b15c[_0x72fc('0x49')],{'$or':_[_0x72fc('0x4a')](_0x375085,function(_0x3ba341){if(_0x3ba341[_0x72fc('0x4b')][_0x72fc('0x4c')]!==_0x72fc('0x4d')){var _0x529378={};_0x529378[_0x3ba341['field']]={'$like':'%'+_0x4f3f11['query'][_0x72fc('0x4e')]+'%'};return _0x529378;}})});}_0x55b15c=_[_0x72fc('0x4f')]({},_0x55b15c,_0x4f3f11[_0x72fc('0x50')]);var _0x298c51={'where':_0x55b15c[_0x72fc('0x49')]};return db[_0x72fc('0x39')][_0x72fc('0x2d')](_0x298c51)[_0x72fc('0x34')](function(_0x50b74f){_0x36d173[_0x72fc('0x2d')]=_0x50b74f;if(_0x4f3f11[_0x72fc('0x3d')]['includeAll']){_0x55b15c[_0x72fc('0x51')]=[{'all':!![]}];}return db[_0x72fc('0x39')][_0x72fc('0x52')](_0x55b15c);})[_0x72fc('0x34')](function(_0x3d1cda){_0x36d173[_0x72fc('0x53')]=_0x3d1cda;return _0x36d173;})[_0x72fc('0x34')](respondWithFilteredResult(_0x3f032b,_0x55b15c))[_0x72fc('0x29')](handleError(_0x3f032b,null));};exports[_0x72fc('0x54')]=function(_0x5e549e,_0x8cdd19){var _0x201eb8={'raw':!![],'where':{'id':_0x5e549e[_0x72fc('0x55')]['id']}},_0x25995a={};_0x25995a[_0x72fc('0x3b')]=_[_0x72fc('0x3c')](db[_0x72fc('0x39')]['rawAttributes']);_0x25995a[_0x72fc('0x3d')]=_['keys'](_0x5e549e[_0x72fc('0x3d')]);_0x25995a[_0x72fc('0x3e')]=_['intersection'](_0x25995a[_0x72fc('0x3b')],_0x25995a[_0x72fc('0x3d')]);_0x201eb8[_0x72fc('0x40')]=_[_0x72fc('0x3f')](_0x25995a[_0x72fc('0x3b')],qs[_0x72fc('0x41')](_0x5e549e[_0x72fc('0x3d')]['fields']));_0x201eb8[_0x72fc('0x40')]=_0x201eb8[_0x72fc('0x40')][_0x72fc('0x42')]?_0x201eb8[_0x72fc('0x40')]:_0x25995a['model'];if(_0x5e549e[_0x72fc('0x3d')][_0x72fc('0x56')]){_0x201eb8[_0x72fc('0x51')]=[{'all':!![]}];}_0x201eb8=_[_0x72fc('0x4f')]({},_0x201eb8,_0x5e549e[_0x72fc('0x50')]);return db[_0x72fc('0x39')][_0x72fc('0x57')](_0x201eb8)[_0x72fc('0x34')](handleEntityNotFound(_0x8cdd19,null))[_0x72fc('0x34')](respondWithResult(_0x8cdd19,null))['catch'](handleError(_0x8cdd19,null));};exports[_0x72fc('0x58')]=function(_0x48ea15,_0x4e51d0){return db['ChatMessage']['create'](_0x48ea15[_0x72fc('0x59')],{})[_0x72fc('0x34')](respondWithResult(_0x4e51d0,0xc9))[_0x72fc('0x29')](handleError(_0x4e51d0,null));};exports['update']=function(_0x400a9d,_0x1ac349){if(_0x400a9d[_0x72fc('0x59')]['id']){delete _0x400a9d[_0x72fc('0x59')]['id'];}return db[_0x72fc('0x39')][_0x72fc('0x57')]({'where':{'id':_0x400a9d[_0x72fc('0x55')]['id']}})[_0x72fc('0x34')](handleEntityNotFound(_0x1ac349,null))[_0x72fc('0x34')](saveUpdates(_0x400a9d[_0x72fc('0x59')],null))[_0x72fc('0x34')](respondWithResult(_0x1ac349,null))[_0x72fc('0x29')](handleError(_0x1ac349,null));};exports[_0x72fc('0x35')]=function(_0x2e6f07,_0x10424a){return db[_0x72fc('0x39')][_0x72fc('0x57')]({'where':{'id':_0x2e6f07[_0x72fc('0x55')]['id']}})[_0x72fc('0x34')](handleEntityNotFound(_0x10424a,null))[_0x72fc('0x34')](removeEntity(_0x10424a,null))['catch'](handleError(_0x10424a,null));};exports[_0x72fc('0x5a')]=function(_0x5af6d8,_0x2634c5){return db['ChatMessage'][_0x72fc('0x5a')]()[_0x72fc('0x34')](respondWithResult(_0x2634c5,null))[_0x72fc('0x29')](handleError(_0x2634c5,null));};var interaction_log=require(_0x72fc('0x5b'))(_0x72fc('0x5c'));exports[_0x72fc('0x5d')]=function(_0x467b76,_0x172561,_0x190715){var _0x459f18={'channel':'chat'};if(_0x467b76[_0x72fc('0x59')]['id']){delete _0x467b76[_0x72fc('0x59')]['id'];}_0x467b76[_0x72fc('0x59')][_0x72fc('0x5e')]=!![];_0x467b76[_0x72fc('0x59')][_0x72fc('0x5f')]=moment()[_0x72fc('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x467b76['body'][_0x72fc('0x61')]=_0x467b76[_0x72fc('0x59')][_0x72fc('0x61')]||_0x467b76['user']['id'];return db[_0x72fc('0x39')][_0x72fc('0x57')]({'where':{'id':_0x467b76[_0x72fc('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x72fc('0x62')],'as':_0x72fc('0x63')}]})[_0x72fc('0x34')](handleEntityNotFound(_0x172561,null))[_0x72fc('0x34')](saveUpdates(_0x467b76[_0x72fc('0x59')],null))[_0x72fc('0x34')](function(_0x3b128a){if(_0x3b128a){_0x459f18[_0x72fc('0x27')]=_0x3b128a[_0x72fc('0x64')]({'plain':!![]});return db[_0x72fc('0x65')][_0x72fc('0x57')]({'where':{'id':_0x3b128a[_0x72fc('0x66')]}});}return null;})[_0x72fc('0x34')](handleEntityNotFound(_0x172561,null))[_0x72fc('0x34')](function(_0x161dd7){if(_0x161dd7){return _0x161dd7['update']({'UserId':_0x467b76[_0x72fc('0x59')][_0x72fc('0x61')],'read1stAt':_['isNil'](_0x161dd7[_0x72fc('0x67')])?moment()[_0x72fc('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2806e4){if(_0x2806e4){_0x459f18[_0x72fc('0x68')]=_0x2806e4[_0x72fc('0x64')]({'plain':!![]});interaction_log[_0x72fc('0x20')](_0x72fc('0x69'),_0x467b76[_0x72fc('0x6a')]['id'],_0x467b76[_0x72fc('0x6a')][_0x72fc('0x6b')],_0x467b76['user'][_0x72fc('0x6c')],_0x459f18[_0x72fc('0x68')]['id'],_0x467b76[_0x72fc('0x59')]?JSON[_0x72fc('0x24')](_0x467b76[_0x72fc('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0x72fc('0x6d'),_0x459f18);}return null;})[_0x72fc('0x34')](function(_0x516de0){if(_0x516de0){if(_0x467b76[_0x72fc('0x59')][_0x72fc('0x6e')]){_0x459f18[_0x72fc('0x27')][_0x72fc('0x6f')]=util[_0x72fc('0x60')](_0x72fc('0x70'),_0x467b76[_0x72fc('0x6a')][_0x72fc('0x6b')]);_0x459f18[_0x72fc('0x27')][_0x72fc('0x71')]=_0x459f18[_0x72fc('0x71')];_0x459f18[_0x72fc('0x27')][_0x72fc('0x72')]=_0x72fc('0x5d');return respondWithRpcPromise(_0x72fc('0x73'),_0x72fc('0x73'),{'event':_0x72fc('0x74'),'message':_[_0x72fc('0x4f')](_0x459f18['message'],JSON[_0x72fc('0x75')](_0x459f18[_0x72fc('0x68')]['formData']))},client9002)['then'](function(){return _0x459f18;});}return _0x459f18;}return null;})[_0x72fc('0x34')](respondWithResult(_0x172561,null))[_0x72fc('0x29')](handleError(_0x172561,null));};var interaction_log=require(_0x72fc('0x5b'))(_0x72fc('0x5c'));exports[_0x72fc('0x32')]=function(_0x21a158,_0x1db90a,_0x292ab2){var _0x15bad1={'agent':{},'channel':_0x72fc('0x76')};if(_0x21a158[_0x72fc('0x59')]['id']){delete _0x21a158[_0x72fc('0x59')]['id'];}_0x21a158[_0x72fc('0x59')][_0x72fc('0x61')]=_0x21a158[_0x72fc('0x59')][_0x72fc('0x61')]||_0x21a158[_0x72fc('0x6a')]['id'];_0x15bad1[_0x72fc('0x77')]['id']=_0x21a158['body'][_0x72fc('0x61')];return db[_0x72fc('0x39')][_0x72fc('0x57')]({'where':{'id':_0x21a158[_0x72fc('0x55')]['id'],'UserId':null}})[_0x72fc('0x34')](handleEntityNotFound(_0x1db90a,null))['then'](function(_0xcd191){if(_0xcd191){_0x15bad1[_0x72fc('0x27')]=_0xcd191[_0x72fc('0x64')]({'plain':!![]});return db[_0x72fc('0x65')][_0x72fc('0x57')]({'where':{'id':_0xcd191['ChatInteractionId']}});}return null;})[_0x72fc('0x34')](handleEntityNotFound(_0x1db90a,null))[_0x72fc('0x34')](function(_0x3211eb){if(_0x3211eb){_0x15bad1['interaction']=_0x3211eb['get']({'plain':!![]});interaction_log[_0x72fc('0x20')](_0x72fc('0x78'),_0x21a158[_0x72fc('0x6a')]['id'],_0x21a158['user'][_0x72fc('0x6b')],_0x21a158[_0x72fc('0x6a')][_0x72fc('0x6c')],_0x15bad1['interaction']['id'],_0x21a158[_0x72fc('0x59')]?JSON[_0x72fc('0x24')](_0x21a158[_0x72fc('0x59')]):_0x72fc('0x79'));return respondWithRpcPromise(_0x72fc('0x7a'),_0x72fc('0x7b'),_0x15bad1);}return null;})[_0x72fc('0x34')](function(_0x220ba1){if(_0x220ba1){_0x220ba1[_0x72fc('0x27')]['interface']=util[_0x72fc('0x60')]('SIP/%s',_0x21a158[_0x72fc('0x6a')][_0x72fc('0x6b')]);_0x220ba1[_0x72fc('0x27')]['channel']=_0x15bad1[_0x72fc('0x71')];_0x220ba1[_0x72fc('0x27')]['event']=_0x72fc('0x32');respondWithRpcPromise('EventManager',_0x72fc('0x73'),{'event':_0x72fc('0x7c'),'message':_0x220ba1[_0x72fc('0x27')]},client9002);return _0x15bad1;}return null;})['then'](respondWithResult(_0x1db90a,null))[_0x72fc('0x29')](handleError(_0x1db90a,null));}; \ No newline at end of file +var _0x5331=['ChatMessage','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','rawAttributes','find','create','body','destroy','describe','chat-interactions','accept','chat','read','readAt','format','UserId','Contact','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','params','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','stack','name','send','index'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0x5331,0xbe));var _0x1533=function(_0x51def3,_0x5dab6d){_0x51def3=_0x51def3-0x0;var _0x11493f=_0x5331[_0x51def3];return _0x11493f;};'use strict';var pdf=require(_0x1533('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1533('0x1'));var zipdir=require(_0x1533('0x2'));var jsonpatch=require(_0x1533('0x3'));var rp=require(_0x1533('0x4'));var moment=require('moment');var BPromise=require(_0x1533('0x5'));var Mustache=require(_0x1533('0x6'));var util=require(_0x1533('0x7'));var path=require(_0x1533('0x8'));var sox=require(_0x1533('0x9'));var csv=require(_0x1533('0xa'));var ejs=require(_0x1533('0xb'));var fs=require('fs');var _=require(_0x1533('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1533('0xd'));var deskjs=require(_0x1533('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1533('0xf'));var Papa=require(_0x1533('0x10'));var Redis=require(_0x1533('0x11'));var authService=require(_0x1533('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1533('0x13'));var logger=require(_0x1533('0x14'))('api');var utils=require(_0x1533('0x15'));var config=require(_0x1533('0x16'));var db=require(_0x1533('0x17'))['db'];config[_0x1533('0x18')]=_['defaults'](config[_0x1533('0x18')],{'host':_0x1533('0x19'),'port':0x18eb});var socket=require(_0x1533('0x1a'))(new Redis(config[_0x1533('0x18')]));require(_0x1533('0x1b'))[_0x1533('0x1c')](socket);var jayson=require(_0x1533('0x1d'));var client=jayson[_0x1533('0x1e')][_0x1533('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x1533('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x42a6d1,_0x44f5ae,_0x1bb2c4){if(_0x1bb2c4){var _0x3fae4b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fae4b['test'](_0x44f5ae)){return _0x42a6d1;}else{throw new Error(_0x1533('0x20'));}}else{return _0x42a6d1;}}function respondWithRpcPromise(_0xcb07c4,_0x55dc0a,_0x4ce4d8,_0x114345){return new BPromise(function(_0x1d5eeb,_0x15e3b2){var _0xb343a4=_0x114345||client;return _0xb343a4[_0x1533('0x21')](_0xcb07c4,_0x4ce4d8)[_0x1533('0x22')](function(_0x7356c){logger[_0x1533('0x23')](_0x1533('0x24'),_0x55dc0a,_0x1533('0x25'));logger[_0x1533('0x26')](_0x1533('0x27'),_0x55dc0a,_0x1533('0x25'),JSON[_0x1533('0x28')](_0x7356c));if(_0x7356c['error']){if(_0x7356c[_0x1533('0x29')][_0x1533('0x2a')]===0x1f4){logger[_0x1533('0x29')](_0x1533('0x24'),_0x55dc0a,_0x7356c[_0x1533('0x29')][_0x1533('0x2b')]);return _0x15e3b2(_0x7356c[_0x1533('0x29')][_0x1533('0x2b')]);}logger['error'](_0x1533('0x24'),_0x55dc0a,_0x7356c['error'][_0x1533('0x2b')]);return _0x1d5eeb(_0x7356c[_0x1533('0x29')][_0x1533('0x2b')]);}else{logger[_0x1533('0x23')](_0x1533('0x24'),_0x55dc0a,_0x1533('0x25'));_0x1d5eeb(_0x7356c['result'][_0x1533('0x2b')]);}})[_0x1533('0x2c')](function(_0x2cf162){logger['error'](_0x1533('0x24'),_0x55dc0a,_0x2cf162);_0x15e3b2(_0x2cf162);});});}function respondWithStatusCode(_0x18091b,_0x4e8cc8){_0x4e8cc8=_0x4e8cc8||0xcc;return function(_0x3e04e6){if(_0x3e04e6){return _0x18091b[_0x1533('0x2d')](_0x4e8cc8);}return _0x18091b[_0x1533('0x2e')](_0x4e8cc8)[_0x1533('0x2f')]();};}function respondWithResult(_0x291ffb,_0x1bc1b1){_0x1bc1b1=_0x1bc1b1||0xc8;return function(_0x10fd74){if(_0x10fd74){return _0x291ffb['status'](_0x1bc1b1)[_0x1533('0x30')](_0x10fd74);}};}function respondWithFilteredResult(_0x242eef,_0x11bb98){return function(_0x106779){if(_0x106779){var _0x499566=_0x106779['count'],_0x1c4fd7=_0x11bb98['offset'],_0x422ee6=_0x11bb98[_0x1533('0x31')]+_0x11bb98[_0x1533('0x32')],_0x51d7b6;if(_0x422ee6>=_0x499566){_0x422ee6=_0x499566;_0x51d7b6=0xc8;}else{_0x51d7b6=0xce;}_0x242eef[_0x1533('0x2e')](_0x51d7b6);return _0x242eef[_0x1533('0x33')](_0x1533('0x34'),_0x1c4fd7+'-'+_0x422ee6+'/'+_0x499566)[_0x1533('0x30')](_0x106779);}return null;};}function patchUpdates(_0x2e9967){return function(_0x548231){try{jsonpatch['apply'](_0x548231,_0x2e9967,!![]);}catch(_0x166c90){return BPromise[_0x1533('0x35')](_0x166c90);}return _0x548231[_0x1533('0x36')]();};}function saveUpdates(_0xa43504,_0x56ae3b){return function(_0x5432f8){if(_0x5432f8){return _0x5432f8[_0x1533('0x37')](_0xa43504)[_0x1533('0x22')](function(_0x363a44){return _0x363a44;});}return null;};}function removeEntity(_0xb2c1c9,_0x488c9e){return function(_0x22a54f){if(_0x22a54f){return _0x22a54f['destroy']()[_0x1533('0x22')](function(){_0xb2c1c9['status'](0xcc)[_0x1533('0x2f')]();});}};}function handleEntityNotFound(_0x535427,_0x5443d0){return function(_0x28dd92){if(!_0x28dd92){_0x535427['sendStatus'](0x194);}return _0x28dd92;};}function handleError(_0x59a80f,_0x31ff39){_0x31ff39=_0x31ff39||0x1f4;return function(_0xdcf01e){logger[_0x1533('0x29')](_0xdcf01e[_0x1533('0x38')]);if(_0xdcf01e[_0x1533('0x39')]){delete _0xdcf01e[_0x1533('0x39')];}_0x59a80f[_0x1533('0x2e')](_0x31ff39)[_0x1533('0x3a')](_0xdcf01e);};}exports[_0x1533('0x3b')]=function(_0x107140,_0x56e188){var _0x13b408={},_0x1e3f34={},_0x1987b9={'count':0x0,'rows':[]};var _0x4f2747=db[_0x1533('0x3c')]['rawAttributes'];_0x1e3f34['model']=_[_0x1533('0x3d')](_0x4f2747);_0x1e3f34[_0x1533('0x3e')]=_[_0x1533('0x3d')](_0x107140[_0x1533('0x3e')]);_0x1e3f34['filters']=_[_0x1533('0x3f')](_0x1e3f34['model'],_0x1e3f34['query']);_0x13b408[_0x1533('0x40')]=_[_0x1533('0x3f')](_0x1e3f34[_0x1533('0x41')],qs['fields'](_0x107140[_0x1533('0x3e')][_0x1533('0x42')]));_0x13b408[_0x1533('0x40')]=_0x13b408[_0x1533('0x40')][_0x1533('0x43')]?_0x13b408[_0x1533('0x40')]:_0x1e3f34[_0x1533('0x41')];if(!_0x107140[_0x1533('0x3e')][_0x1533('0x44')](_0x1533('0x45'))){_0x13b408[_0x1533('0x32')]=qs[_0x1533('0x32')](_0x107140[_0x1533('0x3e')][_0x1533('0x32')]);_0x13b408[_0x1533('0x31')]=qs[_0x1533('0x31')](_0x107140[_0x1533('0x3e')]['offset']);}_0x13b408[_0x1533('0x46')]=qs[_0x1533('0x47')](_0x107140[_0x1533('0x3e')]['sort']);_0x13b408['where']=qs[_0x1533('0x48')](_[_0x1533('0x49')](_0x107140[_0x1533('0x3e')],_0x1e3f34[_0x1533('0x48')]));if(_0x107140[_0x1533('0x3e')][_0x1533('0x4a')]){_0x13b408[_0x1533('0x4b')]=_['merge'](_0x13b408[_0x1533('0x4b')],{'$or':_[_0x1533('0x4c')](_0x4f2747,function(_0x5ea903){if(_0x5ea903[_0x1533('0x4d')]['key']!==_0x1533('0x4e')){var _0x2102ab={};_0x2102ab[_0x5ea903[_0x1533('0x4f')]]={'$like':'%'+_0x107140['query'][_0x1533('0x4a')]+'%'};return _0x2102ab;}})});}_0x13b408=_[_0x1533('0x50')]({},_0x13b408,_0x107140[_0x1533('0x51')]);var _0x45103a={'where':_0x13b408['where']};return db[_0x1533('0x3c')][_0x1533('0x52')](_0x45103a)[_0x1533('0x22')](function(_0x1ae648){_0x1987b9[_0x1533('0x52')]=_0x1ae648;if(_0x107140[_0x1533('0x3e')][_0x1533('0x53')]){_0x13b408[_0x1533('0x54')]=[{'all':!![]}];}return db[_0x1533('0x3c')][_0x1533('0x55')](_0x13b408);})['then'](function(_0x1fd2f2){_0x1987b9[_0x1533('0x56')]=_0x1fd2f2;return _0x1987b9;})[_0x1533('0x22')](respondWithFilteredResult(_0x56e188,_0x13b408))[_0x1533('0x2c')](handleError(_0x56e188,null));};exports['show']=function(_0x31f4f3,_0x4bd361){var _0x4faf3e={'raw':!![],'where':{'id':_0x31f4f3['params']['id']}},_0x2acf87={};_0x2acf87[_0x1533('0x41')]=_[_0x1533('0x3d')](db[_0x1533('0x3c')][_0x1533('0x57')]);_0x2acf87[_0x1533('0x3e')]=_['keys'](_0x31f4f3[_0x1533('0x3e')]);_0x2acf87[_0x1533('0x48')]=_['intersection'](_0x2acf87[_0x1533('0x41')],_0x2acf87[_0x1533('0x3e')]);_0x4faf3e[_0x1533('0x40')]=_['intersection'](_0x2acf87[_0x1533('0x41')],qs[_0x1533('0x42')](_0x31f4f3[_0x1533('0x3e')][_0x1533('0x42')]));_0x4faf3e['attributes']=_0x4faf3e[_0x1533('0x40')][_0x1533('0x43')]?_0x4faf3e['attributes']:_0x2acf87[_0x1533('0x41')];if(_0x31f4f3[_0x1533('0x3e')][_0x1533('0x53')]){_0x4faf3e[_0x1533('0x54')]=[{'all':!![]}];}_0x4faf3e=_[_0x1533('0x50')]({},_0x4faf3e,_0x31f4f3[_0x1533('0x51')]);return db['ChatMessage'][_0x1533('0x58')](_0x4faf3e)['then'](handleEntityNotFound(_0x4bd361,null))[_0x1533('0x22')](respondWithResult(_0x4bd361,null))[_0x1533('0x2c')](handleError(_0x4bd361,null));};exports[_0x1533('0x59')]=function(_0x4ae2c4,_0x330983){return db[_0x1533('0x3c')][_0x1533('0x59')](_0x4ae2c4[_0x1533('0x5a')],{})[_0x1533('0x22')](respondWithResult(_0x330983,0xc9))['catch'](handleError(_0x330983,null));};exports[_0x1533('0x37')]=function(_0x5e9ef6,_0x1e29f4){if(_0x5e9ef6['body']['id']){delete _0x5e9ef6['body']['id'];}return db[_0x1533('0x3c')]['find']({'where':{'id':_0x5e9ef6['params']['id']}})[_0x1533('0x22')](handleEntityNotFound(_0x1e29f4,null))['then'](saveUpdates(_0x5e9ef6[_0x1533('0x5a')],null))['then'](respondWithResult(_0x1e29f4,null))[_0x1533('0x2c')](handleError(_0x1e29f4,null));};exports[_0x1533('0x5b')]=function(_0x160e16,_0x25f428){return db['ChatMessage'][_0x1533('0x58')]({'where':{'id':_0x160e16['params']['id']}})[_0x1533('0x22')](handleEntityNotFound(_0x25f428,null))['then'](removeEntity(_0x25f428,null))['catch'](handleError(_0x25f428,null));};exports[_0x1533('0x5c')]=function(_0xfc4d88,_0x277d49){return db[_0x1533('0x3c')][_0x1533('0x5c')]()[_0x1533('0x22')](respondWithResult(_0x277d49,null))['catch'](handleError(_0x277d49,null));};var interaction_log=require(_0x1533('0x14'))(_0x1533('0x5d'));exports[_0x1533('0x5e')]=function(_0x37cbf2,_0x3b1d2e,_0x1851cd){var _0x45d59a={'channel':_0x1533('0x5f')};if(_0x37cbf2['body']['id']){delete _0x37cbf2[_0x1533('0x5a')]['id'];}_0x37cbf2['body'][_0x1533('0x60')]=!![];_0x37cbf2[_0x1533('0x5a')][_0x1533('0x61')]=moment()[_0x1533('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x37cbf2[_0x1533('0x5a')][_0x1533('0x63')]=_0x37cbf2['body'][_0x1533('0x63')]||_0x37cbf2['user']['id'];return db[_0x1533('0x3c')][_0x1533('0x58')]({'where':{'id':_0x37cbf2['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x1533('0x64')}]})[_0x1533('0x22')](handleEntityNotFound(_0x3b1d2e,null))[_0x1533('0x22')](saveUpdates(_0x37cbf2[_0x1533('0x5a')],null))[_0x1533('0x22')](function(_0x4fb053){if(_0x4fb053){_0x45d59a['message']=_0x4fb053[_0x1533('0x65')]({'plain':!![]});return db[_0x1533('0x66')]['find']({'where':{'id':_0x4fb053[_0x1533('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x3b1d2e,null))[_0x1533('0x22')](function(_0x1d1270){if(_0x1d1270){return _0x1d1270[_0x1533('0x37')]({'UserId':_0x37cbf2['body'][_0x1533('0x63')],'read1stAt':_['isNil'](_0x1d1270[_0x1533('0x68')])?moment()[_0x1533('0x62')](_0x1533('0x69')):undefined});}return null;})[_0x1533('0x22')](function(_0x698436){if(_0x698436){_0x45d59a[_0x1533('0x6a')]=_0x698436[_0x1533('0x65')]({'plain':!![]});interaction_log[_0x1533('0x23')](_0x1533('0x6b'),_0x37cbf2[_0x1533('0x6c')]['id'],_0x37cbf2['user'][_0x1533('0x39')],_0x37cbf2[_0x1533('0x6c')][_0x1533('0x6d')],_0x45d59a[_0x1533('0x6a')]['id'],_0x37cbf2['body']?JSON[_0x1533('0x28')](_0x37cbf2[_0x1533('0x5a')]):_0x1533('0x6e'));return respondWithRpcPromise(_0x1533('0x6f'),'acceptMessage',_0x45d59a);}return null;})[_0x1533('0x22')](function(_0x1f814c){if(_0x1f814c){if(_0x37cbf2['body'][_0x1533('0x70')]){_0x45d59a[_0x1533('0x2b')][_0x1533('0x71')]=util[_0x1533('0x62')](_0x1533('0x72'),_0x37cbf2[_0x1533('0x6c')][_0x1533('0x39')]);_0x45d59a[_0x1533('0x2b')][_0x1533('0x73')]=_0x45d59a[_0x1533('0x73')];_0x45d59a[_0x1533('0x2b')]['event']=_0x1533('0x5e');return respondWithRpcPromise(_0x1533('0x74'),_0x1533('0x74'),{'event':_0x1533('0x75'),'message':_[_0x1533('0x50')](_0x45d59a[_0x1533('0x2b')],JSON['parse'](_0x45d59a[_0x1533('0x6a')]['formData']))},client9002)[_0x1533('0x22')](function(){return _0x45d59a;});}return _0x45d59a;}return null;})[_0x1533('0x22')](respondWithResult(_0x3b1d2e,null))[_0x1533('0x2c')](handleError(_0x3b1d2e,null));};var interaction_log=require(_0x1533('0x14'))(_0x1533('0x5d'));exports[_0x1533('0x35')]=function(_0x47754e,_0x168bc4,_0x34295a){var _0x33f5e0={'agent':{},'channel':_0x1533('0x5f')};if(_0x47754e[_0x1533('0x5a')]['id']){delete _0x47754e[_0x1533('0x5a')]['id'];}_0x47754e[_0x1533('0x5a')][_0x1533('0x63')]=_0x47754e[_0x1533('0x5a')][_0x1533('0x63')]||_0x47754e[_0x1533('0x6c')]['id'];_0x33f5e0[_0x1533('0x76')]['id']=_0x47754e['body'][_0x1533('0x63')];return db[_0x1533('0x3c')][_0x1533('0x58')]({'where':{'id':_0x47754e[_0x1533('0x77')]['id'],'UserId':null}})[_0x1533('0x22')](handleEntityNotFound(_0x168bc4,null))[_0x1533('0x22')](function(_0x33ae8b){if(_0x33ae8b){_0x33f5e0[_0x1533('0x2b')]=_0x33ae8b[_0x1533('0x65')]({'plain':!![]});return db[_0x1533('0x66')][_0x1533('0x58')]({'where':{'id':_0x33ae8b[_0x1533('0x67')]}});}return null;})[_0x1533('0x22')](handleEntityNotFound(_0x168bc4,null))[_0x1533('0x22')](function(_0x30704f){if(_0x30704f){_0x33f5e0[_0x1533('0x6a')]=_0x30704f[_0x1533('0x65')]({'plain':!![]});interaction_log[_0x1533('0x23')](_0x1533('0x78'),_0x47754e[_0x1533('0x6c')]['id'],_0x47754e[_0x1533('0x6c')][_0x1533('0x39')],_0x47754e[_0x1533('0x6c')][_0x1533('0x6d')],_0x33f5e0[_0x1533('0x6a')]['id'],_0x47754e['body']?JSON[_0x1533('0x28')](_0x47754e['body']):_0x1533('0x6e'));return respondWithRpcPromise(_0x1533('0x79'),_0x1533('0x7a'),_0x33f5e0);}return null;})['then'](function(_0x9e918a){if(_0x9e918a){_0x9e918a[_0x1533('0x2b')][_0x1533('0x71')]=util[_0x1533('0x62')](_0x1533('0x72'),_0x47754e[_0x1533('0x6c')][_0x1533('0x39')]);_0x9e918a[_0x1533('0x2b')][_0x1533('0x73')]=_0x33f5e0['channel'];_0x9e918a[_0x1533('0x2b')][_0x1533('0x7b')]=_0x1533('0x35');respondWithRpcPromise(_0x1533('0x74'),_0x1533('0x74'),{'event':_0x1533('0x7c'),'message':_0x9e918a[_0x1533('0x2b')]},client9002);return _0x33f5e0;}return null;})['then'](respondWithResult(_0x168bc4,null))['catch'](handleError(_0x168bc4,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index bab7360..dc583d0 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 _0x9ccd=['hasOwnProperty','hook','exports','events','ChatMessage','setMaxListeners','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd9cc('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xd9cc('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd9cc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd9cc('0x3')};function emitEvent(_0x581eb3){return function(_0xe2426f,_0x296228,_0x425ab8){ChatMessageEvents[_0xd9cc('0x4')](_0x581eb3+':'+_0xe2426f['id'],_0xe2426f);ChatMessageEvents[_0xd9cc('0x4')](_0x581eb3,_0xe2426f);_0x425ab8(null);};}for(var e in events){if(events[_0xd9cc('0x5')](e)){var event=events[e];ChatMessage[_0xd9cc('0x6')](e,emitEvent(event));}}module[_0xd9cc('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x0833=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x40e848,_0x453432){var _0x390251=function(_0x5b166a){while(--_0x5b166a){_0x40e848['push'](_0x40e848['shift']());}};_0x390251(++_0x453432);}(_0x0833,0x1bd));var _0x3083=function(_0x2d9628,_0x5eaa00){_0x2d9628=_0x2d9628-0x0;var _0x3ade7b=_0x0833[_0x2d9628];return _0x3ade7b;};'use strict';var EventEmitter=require(_0x3083('0x0'));var ChatMessage=require(_0x3083('0x1'))['db'][_0x3083('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3083('0x3')](0x0);var events={'afterCreate':_0x3083('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4eec30){return function(_0x22717c,_0x58a865,_0xa26470){ChatMessageEvents[_0x3083('0x5')](_0x4eec30+':'+_0x22717c['id'],_0x22717c);ChatMessageEvents[_0x3083('0x5')](_0x4eec30,_0x22717c);_0xa26470(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x3083('0x6')](e,emitEvent(event));}}module[_0x3083('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index f913be4..e97cf51 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 _0x1c36=['moment','path','../../config/environment','exports','chat_messages','fti_chat_messages','body','models','get','toLowerCase','out','isNil','ChatInteraction','findOne','ChatInteractionId','createdAt','direction','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x9789ad,_0x4f1eb5){var _0x321910=function(_0x335460){while(--_0x335460){_0x9789ad['push'](_0x9789ad['shift']());}};_0x321910(++_0x4f1eb5);}(_0x1c36,0xd4));var _0x61c3=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x1c36[_0x163040];return _0x364667;};'use strict';var _=require(_0x61c3('0x0'));var util=require(_0x61c3('0x1'));var logger=require(_0x61c3('0x2'))(_0x61c3('0x3'));var moment=require(_0x61c3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61c3('0x5'));var rimraf=require('rimraf');var config=require(_0x61c3('0x6'));var attributes=require('./chatMessage.attributes');module[_0x61c3('0x7')]=function(_0x247dde,_0x28c122){return _0x247dde['define']('ChatMessage',attributes,{'tableName':_0x61c3('0x8'),'paranoid':![],'indexes':[{'name':_0x61c3('0x9'),'fields':[_0x61c3('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x592e56,_0x3be4d8,_0x31ffca){var _0x29f6f9=_0x247dde[_0x61c3('0xb')];var _0x13a7a8=_0x592e56[_0x61c3('0xc')]({'plain':!![]});if(_0x13a7a8['direction'][_0x61c3('0xd')]()==='in'||_0x13a7a8['direction'][_0x61c3('0xd')]()===_0x61c3('0xe')&&!_0x13a7a8['secret']&&!_[_0x61c3('0xf')](_0x13a7a8['UserId'])){_0x29f6f9[_0x61c3('0x10')][_0x61c3('0x11')]({'where':{'id':_0x13a7a8[_0x61c3('0x12')]}})['then'](function(_0x560c5d){if(_0x560c5d){_0x560c5d['update']({'lastMsgAt':_0x13a7a8[_0x61c3('0x13')],'lastMsgDirection':_0x13a7a8[_0x61c3('0x14')][_0x61c3('0xd')]()});}})[_0x61c3('0x15')](function(_0x59fcd7){console[_0x61c3('0x16')](_0x59fcd7);});}_0x31ffca();}},'charset':'utf8mb4','collate':_0x61c3('0x17')});}; \ No newline at end of file +var _0x2817=['exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','toLowerCase','direction','out','secret','UserId','ChatInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes'];(function(_0x355ee0,_0x2af3f5){var _0xd1ac35=function(_0x20c564){while(--_0x20c564){_0x355ee0['push'](_0x355ee0['shift']());}};_0xd1ac35(++_0x2af3f5);}(_0x2817,0x1d7));var _0x7281=function(_0x477448,_0x5800b7){_0x477448=_0x477448-0x0;var _0x50111d=_0x2817[_0x477448];return _0x50111d;};'use strict';var _=require(_0x7281('0x0'));var util=require('util');var logger=require(_0x7281('0x1'))(_0x7281('0x2'));var moment=require('moment');var BPromise=require(_0x7281('0x3'));var rp=require(_0x7281('0x4'));var fs=require('fs');var path=require(_0x7281('0x5'));var rimraf=require(_0x7281('0x6'));var config=require(_0x7281('0x7'));var attributes=require(_0x7281('0x8'));module[_0x7281('0x9')]=function(_0x5ccd41,_0x8b1553){return _0x5ccd41[_0x7281('0xa')](_0x7281('0xb'),attributes,{'tableName':_0x7281('0xc'),'paranoid':![],'indexes':[{'name':_0x7281('0xd'),'fields':[_0x7281('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24bb3e,_0x42be99,_0x158f0b){var _0x3a65cb=_0x5ccd41[_0x7281('0xf')];var _0x18689a=_0x24bb3e[_0x7281('0x10')]({'plain':!![]});if(_0x18689a['direction'][_0x7281('0x11')]()==='in'||_0x18689a[_0x7281('0x12')][_0x7281('0x11')]()===_0x7281('0x13')&&!_0x18689a[_0x7281('0x14')]&&!_['isNil'](_0x18689a[_0x7281('0x15')])){_0x3a65cb[_0x7281('0x16')][_0x7281('0x17')]({'where':{'id':_0x18689a['ChatInteractionId']}})[_0x7281('0x18')](function(_0x42f438){if(_0x42f438){_0x42f438[_0x7281('0x19')]({'lastMsgAt':_0x18689a['createdAt'],'lastMsgDirection':_0x18689a[_0x7281('0x12')]['toLowerCase']()});}})[_0x7281('0x1a')](function(_0x4f6323){console[_0x7281('0x1b')](_0x4f6323);});}_0x158f0b();}},'charset':_0x7281('0x1c'),'collate':_0x7281('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 5b939ab..3c4043f 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 _0x6e42=['register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','ChatMessage','create','body','raw','CreateChatMessage','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./chatMessage.socket'];(function(_0x5ba8fc,_0x3120dd){var _0x974890=function(_0x4ec53d){while(--_0x4ec53d){_0x5ba8fc['push'](_0x5ba8fc['shift']());}};_0x974890(++_0x3120dd);}(_0x6e42,0x19e));var _0x26e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e42[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x26e4('0x0'));var util=require('util');var moment=require(_0x26e4('0x1'));var BPromise=require(_0x26e4('0x2'));var rs=require(_0x26e4('0x3'));var fs=require('fs');var Redis=require(_0x26e4('0x4'));var db=require(_0x26e4('0x5'))['db'];var utils=require(_0x26e4('0x6'));var logger=require(_0x26e4('0x7'))(_0x26e4('0x8'));var config=require(_0x26e4('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x26e4('0xa')]({'port':0x232a});config[_0x26e4('0xb')]=_[_0x26e4('0xc')](config[_0x26e4('0xb')],{'host':_0x26e4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26e4('0xb')]));require(_0x26e4('0xe'))[_0x26e4('0xf')](socket);function respondWithRpcPromise(_0x5a84a4,_0x36b44a,_0x58a445){return new BPromise(function(_0x3fc70b,_0xbf03f1){return client[_0x26e4('0x10')](_0x5a84a4,_0x58a445)[_0x26e4('0x11')](function(_0x2235f3){logger['info'](_0x26e4('0x12'),_0x36b44a,_0x26e4('0x13'));logger[_0x26e4('0x14')](_0x26e4('0x15'),_0x36b44a,_0x26e4('0x13'),JSON[_0x26e4('0x16')](_0x2235f3));if(_0x2235f3['error']){if(_0x2235f3['error'][_0x26e4('0x17')]===0x1f4){logger[_0x26e4('0x18')](_0x26e4('0x12'),_0x36b44a,_0x2235f3['error'][_0x26e4('0x19')]);return _0xbf03f1(_0x2235f3[_0x26e4('0x18')][_0x26e4('0x19')]);}logger['error'](_0x26e4('0x12'),_0x36b44a,_0x2235f3[_0x26e4('0x18')][_0x26e4('0x19')]);return _0x3fc70b(_0x2235f3[_0x26e4('0x18')][_0x26e4('0x19')]);}else{logger[_0x26e4('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x36b44a,_0x26e4('0x13'));_0x3fc70b(_0x2235f3['result'][_0x26e4('0x19')]);}})['catch'](function(_0x2ffd82){logger[_0x26e4('0x18')](_0x26e4('0x12'),_0x36b44a,_0x2ffd82);_0xbf03f1(_0x2ffd82);});});}exports['CreateChatMessage']=function(_0x2e3562){var _0xe44236=this;return new Promise(function(_0x5923b1,_0x5d5af7){return db[_0x26e4('0x1b')][_0x26e4('0x1c')](_0x2e3562[_0x26e4('0x1d')],{'raw':_0x2e3562['options']?_0x2e3562['options'][_0x26e4('0x1e')]===undefined?!![]:![]:!![]})[_0x26e4('0x11')](function(_0x5608e6){logger[_0x26e4('0x1a')](_0x26e4('0x1f'),_0x2e3562);logger[_0x26e4('0x14')](_0x26e4('0x1f'),_0x2e3562,JSON[_0x26e4('0x16')](_0x5608e6));_0x5923b1(_0x5608e6);})[_0x26e4('0x20')](function(_0x525442){logger[_0x26e4('0x18')](_0x26e4('0x1f'),_0x525442[_0x26e4('0x19')],_0x2e3562);_0x5d5af7(_0xe44236[_0x26e4('0x18')](0x1f4,_0x525442['message']));});});}; \ No newline at end of file +var _0xed74=['redis','defaults','localhost','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','code','error','message','info','catch','CreateChatMessage','create','body','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http'];(function(_0x35d92c,_0xf4e28d){var _0x24c70b=function(_0x425df5){while(--_0x425df5){_0x35d92c['push'](_0x35d92c['shift']());}};_0x24c70b(++_0xf4e28d);}(_0xed74,0x12b));var _0x4ed7=function(_0x198d5f,_0x22871d){_0x198d5f=_0x198d5f-0x0;var _0x130679=_0xed74[_0x198d5f];return _0x130679;};'use strict';var _=require('lodash');var util=require(_0x4ed7('0x0'));var moment=require(_0x4ed7('0x1'));var BPromise=require(_0x4ed7('0x2'));var rs=require(_0x4ed7('0x3'));var fs=require('fs');var Redis=require(_0x4ed7('0x4'));var db=require(_0x4ed7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4ed7('0x6'));var jayson=require(_0x4ed7('0x7'));var client=jayson['client'][_0x4ed7('0x8')]({'port':0x232a});config[_0x4ed7('0x9')]=_[_0x4ed7('0xa')](config[_0x4ed7('0x9')],{'host':_0x4ed7('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ed7('0x9')]));require('./chatMessage.socket')[_0x4ed7('0xc')](socket);function respondWithRpcPromise(_0x563e61,_0x41c371,_0x5efe3c){return new BPromise(function(_0x1d4361,_0x525c8c){return client[_0x4ed7('0xd')](_0x563e61,_0x5efe3c)[_0x4ed7('0xe')](function(_0x4fabb6){logger['info'](_0x4ed7('0xf'),_0x41c371,_0x4ed7('0x10'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x41c371,_0x4ed7('0x10'),JSON['stringify'](_0x4fabb6));if(_0x4fabb6['error']){if(_0x4fabb6['error'][_0x4ed7('0x11')]===0x1f4){logger[_0x4ed7('0x12')](_0x4ed7('0xf'),_0x41c371,_0x4fabb6[_0x4ed7('0x12')]['message']);return _0x525c8c(_0x4fabb6[_0x4ed7('0x12')][_0x4ed7('0x13')]);}logger[_0x4ed7('0x12')]('ChatMessage,\x20%s,\x20%s',_0x41c371,_0x4fabb6[_0x4ed7('0x12')][_0x4ed7('0x13')]);return _0x1d4361(_0x4fabb6[_0x4ed7('0x12')]['message']);}else{logger[_0x4ed7('0x14')](_0x4ed7('0xf'),_0x41c371,_0x4ed7('0x10'));_0x1d4361(_0x4fabb6['result'][_0x4ed7('0x13')]);}})[_0x4ed7('0x15')](function(_0x40343c){logger[_0x4ed7('0x12')](_0x4ed7('0xf'),_0x41c371,_0x40343c);_0x525c8c(_0x40343c);});});}exports[_0x4ed7('0x16')]=function(_0x2f6743){var _0x371e97=this;return new Promise(function(_0x531511,_0x33ff68){return db['ChatMessage'][_0x4ed7('0x17')](_0x2f6743[_0x4ed7('0x18')],{'raw':_0x2f6743[_0x4ed7('0x19')]?_0x2f6743['options'][_0x4ed7('0x1a')]===undefined?!![]:![]:!![]})[_0x4ed7('0xe')](function(_0x292dcf){logger[_0x4ed7('0x14')](_0x4ed7('0x16'),_0x2f6743);logger[_0x4ed7('0x1b')]('CreateChatMessage',_0x2f6743,JSON['stringify'](_0x292dcf));_0x531511(_0x292dcf);})[_0x4ed7('0x15')](function(_0x221428){logger[_0x4ed7('0x12')](_0x4ed7('0x16'),_0x221428[_0x4ed7('0x13')],_0x2f6743);_0x33ff68(_0x371e97[_0x4ed7('0x12')](0x1f4,_0x221428[_0x4ed7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 92f8a47..a0e0252 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 _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x55ca,0x126));var _0xa55c=function(_0x7a319d,_0x235959){_0x7a319d=_0x7a319d-0x0;var _0x5c6b4e=_0x55ca[_0x7a319d];return _0x5c6b4e;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x3e74,0x175));var _0x43e7=function(_0xd59335,_0x5dc34e){_0xd59335=_0xd59335-0x0;var _0x2d0d89=_0x3e74[_0xd59335];return _0x2d0d89;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 4aa3615..08855ef 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 _0xa948=['create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','post','chatmessage:create'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xa948,0xd7));var _0x8a94=function(_0x455d02,_0x51dfb1){_0x455d02=_0x455d02-0x0;var _0x1fa776=_0xa948[_0x455d02];return _0x1fa776;};'use strict';var multer=require(_0x8a94('0x0'));var util=require('util');var path=require(_0x8a94('0x1'));var timeout=require(_0x8a94('0x2'));var express=require(_0x8a94('0x3'));var router=express['Router']();var auth=require(_0x8a94('0x4'));var interaction=require(_0x8a94('0x5'));var config=require(_0x8a94('0x6'));var controller=require('./chatMessage.controller');router[_0x8a94('0x7')]('/',auth['isAuthenticated'](),controller[_0x8a94('0x8')]);router[_0x8a94('0x7')](_0x8a94('0x9'),auth['isAuthenticated'](),controller[_0x8a94('0xa')]);router[_0x8a94('0x7')](_0x8a94('0xb'),auth[_0x8a94('0xc')](),controller['show']);router[_0x8a94('0xd')]('/',auth[_0x8a94('0xc')](),interaction['tracked']('chat',_0x8a94('0xe')),controller[_0x8a94('0xf')]);router[_0x8a94('0x10')]('/:id',controller['update']);router[_0x8a94('0x10')](_0x8a94('0x11'),auth[_0x8a94('0xc')](),controller[_0x8a94('0x12')]);router[_0x8a94('0x10')](_0x8a94('0x13'),auth['isAuthenticated'](),controller[_0x8a94('0x14')]);router[_0x8a94('0x15')](_0x8a94('0xb'),auth[_0x8a94('0xc')](),controller['destroy']);module[_0x8a94('0x16')]=router; \ No newline at end of file +var _0xb175=['express','Router','../../config/environment','./chatMessage.controller','get','/describe','isAuthenticated','/:id','show','post','tracked','chat','create','put','update','/:id/accept','delete','destroy','util','path'];(function(_0x5c223f,_0x4093d9){var _0x305f14=function(_0x258dd8){while(--_0x258dd8){_0x5c223f['push'](_0x5c223f['shift']());}};_0x305f14(++_0x4093d9);}(_0xb175,0x8a));var _0x5b17=function(_0x27663d,_0xf7e7a3){_0x27663d=_0x27663d-0x0;var _0x53279c=_0xb175[_0x27663d];return _0x53279c;};'use strict';var multer=require('multer');var util=require(_0x5b17('0x0'));var path=require(_0x5b17('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b17('0x2'));var router=express[_0x5b17('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b17('0x4'));var controller=require(_0x5b17('0x5'));router[_0x5b17('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b17('0x6')](_0x5b17('0x7'),auth[_0x5b17('0x8')](),controller['describe']);router[_0x5b17('0x6')](_0x5b17('0x9'),auth[_0x5b17('0x8')](),controller[_0x5b17('0xa')]);router[_0x5b17('0xb')]('/',auth[_0x5b17('0x8')](),interaction[_0x5b17('0xc')](_0x5b17('0xd'),'chatmessage:create'),controller[_0x5b17('0xe')]);router[_0x5b17('0xf')](_0x5b17('0x9'),controller[_0x5b17('0x10')]);router[_0x5b17('0xf')](_0x5b17('0x11'),auth[_0x5b17('0x8')](),controller['accept']);router[_0x5b17('0xf')]('/:id/reject',auth[_0x5b17('0x8')](),controller['reject']);router[_0x5b17('0x12')](_0x5b17('0x9'),auth[_0x5b17('0x8')](),controller[_0x5b17('0x13')]);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 86f83e5..2776fad 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 _0x4c08=['TEXT','medium','sequelize'];(function(_0x5d7ffc,_0x2247c1){var _0x844445=function(_0x588ab9){while(--_0x588ab9){_0x5d7ffc['push'](_0x5d7ffc['shift']());}};_0x844445(++_0x2247c1);}(_0x4c08,0x1ee));var _0x84c0=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x4c08[_0x4bc65f];return _0x44f85f;};'use strict';var Sequelize=require(_0x84c0('0x0'));module['exports']={'body':{'type':Sequelize[_0x84c0('0x1')](_0x84c0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x78ee=['TEXT','medium','sequelize','exports'];(function(_0x66f455,_0x43978d){var _0x2f4d67=function(_0x5cc247){while(--_0x5cc247){_0x66f455['push'](_0x66f455['shift']());}};_0x2f4d67(++_0x43978d);}(_0x78ee,0x1d2));var _0xe78e=function(_0x286577,_0x4feca0){_0x286577=_0x286577-0x0;var _0x578c40=_0x78ee[_0x286577];return _0x578c40;};'use strict';var Sequelize=require(_0xe78e('0x0'));module[_0xe78e('0x1')]={'body':{'type':Sequelize[_0xe78e('0x2')](_0xe78e('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index bd3270c..e8e2278 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 _0xe205=['sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','create','body','catch','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','destroy','then','error','stack','name','send','ChatOfflineMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x474da5,_0xc113eb){var _0x381d1e=function(_0x67844f){while(--_0x67844f){_0x474da5['push'](_0x474da5['shift']());}};_0x381d1e(++_0xc113eb);}(_0xe205,0xa7));var _0x5e20=function(_0x13c704,_0x485ae0){_0x13c704=_0x13c704-0x0;var _0x3a2103=_0xe205[_0x13c704];return _0x3a2103;};'use strict';var pdf=require(_0x5e20('0x0'));var emlformat=require(_0x5e20('0x1'));var rimraf=require(_0x5e20('0x2'));var zipdir=require(_0x5e20('0x3'));var jsonpatch=require(_0x5e20('0x4'));var rp=require(_0x5e20('0x5'));var moment=require(_0x5e20('0x6'));var BPromise=require(_0x5e20('0x7'));var Mustache=require(_0x5e20('0x8'));var util=require('util');var path=require(_0x5e20('0x9'));var sox=require(_0x5e20('0xa'));var csv=require(_0x5e20('0xb'));var ejs=require(_0x5e20('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e20('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e20('0xb'));var querystring=require(_0x5e20('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e20('0xf'));var authService=require(_0x5e20('0x10'));var qs=require(_0x5e20('0x11'));var hardwareService=require(_0x5e20('0x12'));var logger=require('../../config/logger')(_0x5e20('0x13'));var utils=require(_0x5e20('0x14'));var config=require(_0x5e20('0x15'));var db=require(_0x5e20('0x16'))['db'];function respondWithStatusCode(_0x165824,_0x296dfd){_0x296dfd=_0x296dfd||0xcc;return function(_0x54deee){if(_0x54deee){return _0x165824[_0x5e20('0x17')](_0x296dfd);}return _0x165824[_0x5e20('0x18')](_0x296dfd)[_0x5e20('0x19')]();};}function respondWithResult(_0x5868c0,_0x1dc92e){_0x1dc92e=_0x1dc92e||0xc8;return function(_0x5d827e){if(_0x5d827e){return _0x5868c0[_0x5e20('0x18')](_0x1dc92e)['json'](_0x5d827e);}};}function respondWithFilteredResult(_0x15587b,_0x330cdf){return function(_0x275026){if(_0x275026){var _0x148ada=_0x275026[_0x5e20('0x1a')],_0x294df8=_0x330cdf[_0x5e20('0x1b')],_0x542b3c=_0x330cdf[_0x5e20('0x1b')]+_0x330cdf[_0x5e20('0x1c')],_0xeaeb77;if(_0x542b3c>=_0x148ada){_0x542b3c=_0x148ada;_0xeaeb77=0xc8;}else{_0xeaeb77=0xce;}_0x15587b[_0x5e20('0x18')](_0xeaeb77);return _0x15587b[_0x5e20('0x1d')](_0x5e20('0x1e'),_0x294df8+'-'+_0x542b3c+'/'+_0x148ada)['json'](_0x275026);}return null;};}function patchUpdates(_0x434686){return function(_0xd38d1f){try{jsonpatch['apply'](_0xd38d1f,_0x434686,!![]);}catch(_0x295eb3){return BPromise[_0x5e20('0x1f')](_0x295eb3);}return _0xd38d1f[_0x5e20('0x20')]();};}function saveUpdates(_0x2d373d,_0x4a45bd){return function(_0x2954fc){if(_0x2954fc){return _0x2954fc['update'](_0x2d373d)['then'](function(_0x57c7c5){return _0x57c7c5;});}return null;};}function removeEntity(_0x5d0d1a,_0xe562ba){return function(_0x5cca90){if(_0x5cca90){return _0x5cca90[_0x5e20('0x21')]()[_0x5e20('0x22')](function(){_0x5d0d1a[_0x5e20('0x18')](0xcc)[_0x5e20('0x19')]();});}};}function handleEntityNotFound(_0x3ef7fa,_0x2d4614){return function(_0x4c5732){if(!_0x4c5732){_0x3ef7fa[_0x5e20('0x17')](0x194);}return _0x4c5732;};}function handleError(_0x5a755f,_0x52d4f5){_0x52d4f5=_0x52d4f5||0x1f4;return function(_0x33993a){logger[_0x5e20('0x23')](_0x33993a[_0x5e20('0x24')]);if(_0x33993a[_0x5e20('0x25')]){delete _0x33993a[_0x5e20('0x25')];}_0x5a755f[_0x5e20('0x18')](_0x52d4f5)[_0x5e20('0x26')](_0x33993a);};}exports['index']=function(_0x3bf4f4,_0x420f63){var _0x238758={},_0x3032ef={},_0x4c799d={'count':0x0,'rows':[]};var _0x3a0f06=db[_0x5e20('0x27')][_0x5e20('0x28')];_0x3032ef[_0x5e20('0x29')]=_[_0x5e20('0x2a')](_0x3a0f06);_0x3032ef[_0x5e20('0x2b')]=_['keys'](_0x3bf4f4[_0x5e20('0x2b')]);_0x3032ef[_0x5e20('0x2c')]=_['intersection'](_0x3032ef[_0x5e20('0x29')],_0x3032ef[_0x5e20('0x2b')]);_0x238758[_0x5e20('0x2d')]=_[_0x5e20('0x2e')](_0x3032ef[_0x5e20('0x29')],qs[_0x5e20('0x2f')](_0x3bf4f4['query'][_0x5e20('0x2f')]));_0x238758[_0x5e20('0x2d')]=_0x238758[_0x5e20('0x2d')][_0x5e20('0x30')]?_0x238758[_0x5e20('0x2d')]:_0x3032ef[_0x5e20('0x29')];if(!_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x31')](_0x5e20('0x32'))){_0x238758[_0x5e20('0x1c')]=qs[_0x5e20('0x1c')](_0x3bf4f4['query'][_0x5e20('0x1c')]);_0x238758[_0x5e20('0x1b')]=qs[_0x5e20('0x1b')](_0x3bf4f4['query'][_0x5e20('0x1b')]);}_0x238758[_0x5e20('0x33')]=qs[_0x5e20('0x34')](_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x34')]);_0x238758[_0x5e20('0x35')]=qs[_0x5e20('0x2c')](_[_0x5e20('0x36')](_0x3bf4f4[_0x5e20('0x2b')],_0x3032ef[_0x5e20('0x2c')]));if(_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x37')]){_0x238758[_0x5e20('0x35')]=_[_0x5e20('0x38')](_0x238758['where'],{'$or':_[_0x5e20('0x39')](_0x3a0f06,function(_0x53cf9c){if(_0x53cf9c['type'][_0x5e20('0x3a')]!==_0x5e20('0x3b')){var _0x4e3307={};_0x4e3307[_0x53cf9c[_0x5e20('0x3c')]]={'$like':'%'+_0x3bf4f4[_0x5e20('0x2b')]['filter']+'%'};return _0x4e3307;}})});}_0x238758=_[_0x5e20('0x38')]({},_0x238758,_0x3bf4f4[_0x5e20('0x3d')]);var _0x20dc98={'where':_0x238758[_0x5e20('0x35')]};return db[_0x5e20('0x27')][_0x5e20('0x1a')](_0x20dc98)[_0x5e20('0x22')](function(_0x3d9354){_0x4c799d[_0x5e20('0x1a')]=_0x3d9354;if(_0x3bf4f4[_0x5e20('0x2b')][_0x5e20('0x3e')]){_0x238758[_0x5e20('0x3f')]=[{'all':!![]}];}return db[_0x5e20('0x27')][_0x5e20('0x40')](_0x238758);})[_0x5e20('0x22')](function(_0x3d618c){_0x4c799d[_0x5e20('0x41')]=_0x3d618c;return _0x4c799d;})[_0x5e20('0x22')](respondWithFilteredResult(_0x420f63,_0x238758))['catch'](handleError(_0x420f63,null));};exports[_0x5e20('0x42')]=function(_0x29215f,_0x377afc){var _0xb3394d={'raw':!![],'where':{'id':_0x29215f['params']['id']}},_0x39018d={};_0x39018d[_0x5e20('0x29')]=_[_0x5e20('0x2a')](db[_0x5e20('0x27')][_0x5e20('0x28')]);_0x39018d[_0x5e20('0x2b')]=_[_0x5e20('0x2a')](_0x29215f['query']);_0x39018d[_0x5e20('0x2c')]=_[_0x5e20('0x2e')](_0x39018d[_0x5e20('0x29')],_0x39018d['query']);_0xb3394d[_0x5e20('0x2d')]=_[_0x5e20('0x2e')](_0x39018d[_0x5e20('0x29')],qs[_0x5e20('0x2f')](_0x29215f[_0x5e20('0x2b')][_0x5e20('0x2f')]));_0xb3394d[_0x5e20('0x2d')]=_0xb3394d[_0x5e20('0x2d')]['length']?_0xb3394d[_0x5e20('0x2d')]:_0x39018d[_0x5e20('0x29')];if(_0x29215f[_0x5e20('0x2b')]['includeAll']){_0xb3394d[_0x5e20('0x3f')]=[{'all':!![]}];}_0xb3394d=_['merge']({},_0xb3394d,_0x29215f[_0x5e20('0x3d')]);return db[_0x5e20('0x27')][_0x5e20('0x43')](_0xb3394d)[_0x5e20('0x22')](handleEntityNotFound(_0x377afc,null))[_0x5e20('0x22')](respondWithResult(_0x377afc,null))['catch'](handleError(_0x377afc,null));};exports[_0x5e20('0x44')]=function(_0x59ee49,_0x49e42f){return db[_0x5e20('0x27')][_0x5e20('0x44')](_0x59ee49[_0x5e20('0x45')],{})[_0x5e20('0x22')](respondWithResult(_0x49e42f,0xc9))[_0x5e20('0x46')](handleError(_0x49e42f,null));};exports[_0x5e20('0x47')]=function(_0x57c794,_0x59c79f){if(_0x57c794['body']['id']){delete _0x57c794[_0x5e20('0x45')]['id'];}return db[_0x5e20('0x27')]['find']({'where':{'id':_0x57c794[_0x5e20('0x48')]['id']}})[_0x5e20('0x22')](handleEntityNotFound(_0x59c79f,null))[_0x5e20('0x22')](saveUpdates(_0x57c794[_0x5e20('0x45')],null))[_0x5e20('0x22')](respondWithResult(_0x59c79f,null))['catch'](handleError(_0x59c79f,null));};exports[_0x5e20('0x21')]=function(_0x245b52,_0x25491e){return db[_0x5e20('0x27')][_0x5e20('0x43')]({'where':{'id':_0x245b52[_0x5e20('0x48')]['id']}})[_0x5e20('0x22')](handleEntityNotFound(_0x25491e,null))[_0x5e20('0x22')](removeEntity(_0x25491e,null))['catch'](handleError(_0x25491e,null));};exports['describe']=function(_0x4ea7d9,_0x9723ed){return db[_0x5e20('0x27')]['describe']()[_0x5e20('0x22')](respondWithResult(_0x9723ed,null))['catch'](handleError(_0x9723ed,null));}; \ No newline at end of file +var _0xb7e7=['moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','ChatOfflineMessage','includeAll','findAll','show','params','rawAttributes','include','catch','create','body','find','describe','html-pdf','rimraf','fast-json-patch'];(function(_0x5b4e0e,_0x5474c5){var _0x2260ab=function(_0x12ee4c){while(--_0x12ee4c){_0x5b4e0e['push'](_0x5b4e0e['shift']());}};_0x2260ab(++_0x5474c5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7b7e('0x11'));var logger=require(_0x7b7e('0x12'))(_0x7b7e('0x13'));var utils=require(_0x7b7e('0x14'));var config=require(_0x7b7e('0x15'));var db=require(_0x7b7e('0x16'))['db'];function respondWithStatusCode(_0x36d2a3,_0x55620b){_0x55620b=_0x55620b||0xcc;return function(_0xaadda){if(_0xaadda){return _0x36d2a3['sendStatus'](_0x55620b);}return _0x36d2a3[_0x7b7e('0x17')](_0x55620b)[_0x7b7e('0x18')]();};}function respondWithResult(_0x50d7d2,_0x422d3a){_0x422d3a=_0x422d3a||0xc8;return function(_0x5976ac){if(_0x5976ac){return _0x50d7d2['status'](_0x422d3a)[_0x7b7e('0x19')](_0x5976ac);}};}function respondWithFilteredResult(_0xd304f5,_0xf067da){return function(_0x457ec5){if(_0x457ec5){var _0x3d2fb2=_0x457ec5[_0x7b7e('0x1a')],_0x5703fd=_0xf067da[_0x7b7e('0x1b')],_0x51baf6=_0xf067da[_0x7b7e('0x1b')]+_0xf067da[_0x7b7e('0x1c')],_0xc7f087;if(_0x51baf6>=_0x3d2fb2){_0x51baf6=_0x3d2fb2;_0xc7f087=0xc8;}else{_0xc7f087=0xce;}_0xd304f5[_0x7b7e('0x17')](_0xc7f087);return _0xd304f5[_0x7b7e('0x1d')](_0x7b7e('0x1e'),_0x5703fd+'-'+_0x51baf6+'/'+_0x3d2fb2)[_0x7b7e('0x19')](_0x457ec5);}return null;};}function patchUpdates(_0x429a0e){return function(_0x12e8e9){try{jsonpatch[_0x7b7e('0x1f')](_0x12e8e9,_0x429a0e,!![]);}catch(_0x448980){return BPromise[_0x7b7e('0x20')](_0x448980);}return _0x12e8e9[_0x7b7e('0x21')]();};}function saveUpdates(_0x864287,_0x3a7b8b){return function(_0x49eddb){if(_0x49eddb){return _0x49eddb[_0x7b7e('0x22')](_0x864287)[_0x7b7e('0x23')](function(_0x24718c){return _0x24718c;});}return null;};}function removeEntity(_0x4c0647,_0x313122){return function(_0xbf0cb3){if(_0xbf0cb3){return _0xbf0cb3[_0x7b7e('0x24')]()[_0x7b7e('0x23')](function(){_0x4c0647[_0x7b7e('0x17')](0xcc)[_0x7b7e('0x18')]();});}};}function handleEntityNotFound(_0x28bf43,_0x10a66a){return function(_0x53bbb3){if(!_0x53bbb3){_0x28bf43['sendStatus'](0x194);}return _0x53bbb3;};}function handleError(_0x4a836a,_0x26ee14){_0x26ee14=_0x26ee14||0x1f4;return function(_0x22598e){logger[_0x7b7e('0x25')](_0x22598e['stack']);if(_0x22598e['name']){delete _0x22598e['name'];}_0x4a836a[_0x7b7e('0x17')](_0x26ee14)[_0x7b7e('0x26')](_0x22598e);};}exports[_0x7b7e('0x27')]=function(_0x7aa71,_0x3ceaf5){var _0x48fad1={},_0x6a1e71={},_0x21a15={'count':0x0,'rows':[]};var _0x4c46b8=db['ChatOfflineMessage']['rawAttributes'];_0x6a1e71[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](_0x4c46b8);_0x6a1e71['query']=_[_0x7b7e('0x29')](_0x7aa71['query']);_0x6a1e71[_0x7b7e('0x2a')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],_0x6a1e71['query']);_0x48fad1[_0x7b7e('0x2c')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],qs[_0x7b7e('0x2d')](_0x7aa71[_0x7b7e('0x2e')]['fields']));_0x48fad1[_0x7b7e('0x2c')]=_0x48fad1['attributes'][_0x7b7e('0x2f')]?_0x48fad1[_0x7b7e('0x2c')]:_0x6a1e71[_0x7b7e('0x28')];if(!_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x30')](_0x7b7e('0x31'))){_0x48fad1[_0x7b7e('0x1c')]=qs['limit'](_0x7aa71['query'][_0x7b7e('0x1c')]);_0x48fad1[_0x7b7e('0x1b')]=qs['offset'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x1b')]);}_0x48fad1[_0x7b7e('0x32')]=qs['sort'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x33')]);_0x48fad1[_0x7b7e('0x34')]=qs[_0x7b7e('0x2a')](_[_0x7b7e('0x35')](_0x7aa71[_0x7b7e('0x2e')],_0x6a1e71[_0x7b7e('0x2a')]));if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]){_0x48fad1[_0x7b7e('0x34')]=_[_0x7b7e('0x37')](_0x48fad1[_0x7b7e('0x34')],{'$or':_[_0x7b7e('0x38')](_0x4c46b8,function(_0xdcb8ef){if(_0xdcb8ef[_0x7b7e('0x39')][_0x7b7e('0x3a')]!=='VIRTUAL'){var _0x8c80d5={};_0x8c80d5[_0xdcb8ef[_0x7b7e('0x3b')]]={'$like':'%'+_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]+'%'};return _0x8c80d5;}})});}_0x48fad1=_[_0x7b7e('0x37')]({},_0x48fad1,_0x7aa71[_0x7b7e('0x3c')]);var _0x7f15={'where':_0x48fad1[_0x7b7e('0x34')]};return db[_0x7b7e('0x3d')][_0x7b7e('0x1a')](_0x7f15)['then'](function(_0x3d6571){_0x21a15[_0x7b7e('0x1a')]=_0x3d6571;if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0x48fad1['include']=[{'all':!![]}];}return db[_0x7b7e('0x3d')][_0x7b7e('0x3f')](_0x48fad1);})[_0x7b7e('0x23')](function(_0x5c58c0){_0x21a15['rows']=_0x5c58c0;return _0x21a15;})[_0x7b7e('0x23')](respondWithFilteredResult(_0x3ceaf5,_0x48fad1))['catch'](handleError(_0x3ceaf5,null));};exports[_0x7b7e('0x40')]=function(_0x3b16d7,_0x4de331){var _0xa5daaa={'raw':!![],'where':{'id':_0x3b16d7[_0x7b7e('0x41')]['id']}},_0x2074d1={};_0x2074d1[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](db[_0x7b7e('0x3d')][_0x7b7e('0x42')]);_0x2074d1[_0x7b7e('0x2e')]=_[_0x7b7e('0x29')](_0x3b16d7['query']);_0x2074d1['filters']=_[_0x7b7e('0x2b')](_0x2074d1['model'],_0x2074d1[_0x7b7e('0x2e')]);_0xa5daaa['attributes']=_['intersection'](_0x2074d1[_0x7b7e('0x28')],qs['fields'](_0x3b16d7[_0x7b7e('0x2e')]['fields']));_0xa5daaa[_0x7b7e('0x2c')]=_0xa5daaa[_0x7b7e('0x2c')][_0x7b7e('0x2f')]?_0xa5daaa[_0x7b7e('0x2c')]:_0x2074d1['model'];if(_0x3b16d7[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0xa5daaa[_0x7b7e('0x43')]=[{'all':!![]}];}_0xa5daaa=_[_0x7b7e('0x37')]({},_0xa5daaa,_0x3b16d7[_0x7b7e('0x3c')]);return db[_0x7b7e('0x3d')]['find'](_0xa5daaa)['then'](handleEntityNotFound(_0x4de331,null))['then'](respondWithResult(_0x4de331,null))[_0x7b7e('0x44')](handleError(_0x4de331,null));};exports[_0x7b7e('0x45')]=function(_0x2f9de2,_0x2cfe70){return db[_0x7b7e('0x3d')][_0x7b7e('0x45')](_0x2f9de2['body'],{})[_0x7b7e('0x23')](respondWithResult(_0x2cfe70,0xc9))[_0x7b7e('0x44')](handleError(_0x2cfe70,null));};exports['update']=function(_0x5efcb8,_0x1dcb88){if(_0x5efcb8[_0x7b7e('0x46')]['id']){delete _0x5efcb8[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5efcb8[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1dcb88,null))[_0x7b7e('0x23')](saveUpdates(_0x5efcb8['body'],null))[_0x7b7e('0x23')](respondWithResult(_0x1dcb88,null))[_0x7b7e('0x44')](handleError(_0x1dcb88,null));};exports[_0x7b7e('0x24')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5874e2[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x23')](handleEntityNotFound(_0x58e4e6,null))[_0x7b7e('0x23')](removeEntity(_0x58e4e6,null))['catch'](handleError(_0x58e4e6,null));};exports[_0x7b7e('0x48')]=function(_0x270c4a,_0x21868a){return db[_0x7b7e('0x3d')][_0x7b7e('0x48')]()['then'](respondWithResult(_0x21868a,null))[_0x7b7e('0x44')](handleError(_0x21868a,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 6ba8424..01764cf 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 _0xc9b2=['chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x667081,_0x1d02b8){var _0x1c1e88=function(_0x4231c2){while(--_0x4231c2){_0x667081['push'](_0x667081['shift']());}};_0x1c1e88(++_0x1d02b8);}(_0xc9b2,0x11f));var _0x2c9b=function(_0x4615e3,_0x19f759){_0x4615e3=_0x4615e3-0x0;var _0x1d843d=_0xc9b2[_0x4615e3];return _0x1d843d;};'use strict';var _=require(_0x2c9b('0x0'));var util=require(_0x2c9b('0x1'));var logger=require(_0x2c9b('0x2'))(_0x2c9b('0x3'));var moment=require(_0x2c9b('0x4'));var BPromise=require(_0x2c9b('0x5'));var rp=require(_0x2c9b('0x6'));var fs=require('fs');var path=require(_0x2c9b('0x7'));var rimraf=require(_0x2c9b('0x8'));var config=require(_0x2c9b('0x9'));var attributes=require(_0x2c9b('0xa'));module[_0x2c9b('0xb')]=function(_0xc1ca58,_0x33bd2c){return _0xc1ca58['define'](_0x2c9b('0xc'),attributes,{'tableName':_0x2c9b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c9b('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xccd1=['exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xccd1,0x83));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1ccd('0x0'));var util=require(_0x1ccd('0x1'));var logger=require(_0x1ccd('0x2'))(_0x1ccd('0x3'));var moment=require(_0x1ccd('0x4'));var BPromise=require(_0x1ccd('0x5'));var rp=require(_0x1ccd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1ccd('0x7'));var attributes=require(_0x1ccd('0x8'));module[_0x1ccd('0x9')]=function(_0x4bddd3,_0x3795e0){return _0x4bddd3[_0x1ccd('0xa')]('ChatOfflineMessage',attributes,{'tableName':_0x1ccd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ccd('0xc'),'collate':_0x1ccd('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7b51f25..96437d3 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 _0xf2e6=['stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x596d22,_0x57598a){var _0x31564a=function(_0x2e7e2e){while(--_0x2e7e2e){_0x596d22['push'](_0x596d22['shift']());}};_0x31564a(++_0x57598a);}(_0xf2e6,0xe0));var _0x6f2e=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xf2e6[_0x2261ce];return _0x524640;};'use strict';var _=require(_0x6f2e('0x0'));var util=require(_0x6f2e('0x1'));var moment=require(_0x6f2e('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f2e('0x3'));var fs=require('fs');var Redis=require(_0x6f2e('0x4'));var db=require(_0x6f2e('0x5'))['db'];var utils=require(_0x6f2e('0x6'));var logger=require(_0x6f2e('0x7'))(_0x6f2e('0x8'));var config=require(_0x6f2e('0x9'));var jayson=require(_0x6f2e('0xa'));var client=jayson['client'][_0x6f2e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc46d,_0x5c82e2,_0x13bd34){return new BPromise(function(_0x29d392,_0x480788){return client['request'](_0x3bc46d,_0x13bd34)[_0x6f2e('0xc')](function(_0x187e0d){logger[_0x6f2e('0xd')](_0x6f2e('0xe'),_0x5c82e2,'request\x20sent');logger[_0x6f2e('0xf')](_0x6f2e('0x10'),_0x5c82e2,_0x6f2e('0x11'),JSON[_0x6f2e('0x12')](_0x187e0d));if(_0x187e0d['error']){if(_0x187e0d[_0x6f2e('0x13')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5c82e2,_0x187e0d['error'][_0x6f2e('0x14')]);return _0x480788(_0x187e0d[_0x6f2e('0x13')][_0x6f2e('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5c82e2,_0x187e0d['error'][_0x6f2e('0x14')]);return _0x29d392(_0x187e0d['error'][_0x6f2e('0x14')]);}else{logger[_0x6f2e('0xd')](_0x6f2e('0xe'),_0x5c82e2,'request\x20sent');_0x29d392(_0x187e0d[_0x6f2e('0x15')]['message']);}})['catch'](function(_0x3f462e){logger[_0x6f2e('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c82e2,_0x3f462e);_0x480788(_0x3f462e);});});} \ No newline at end of file +var _0x33bd=['../../config/environment','jayson/promise','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9eca78,_0x1d3e7a){var _0x420e15=function(_0x1b88ed){while(--_0x1b88ed){_0x9eca78['push'](_0x9eca78['shift']());}};_0x420e15(++_0x1d3e7a);}(_0x33bd,0x148));var _0xd33b=function(_0x4293bf,_0x18ea86){_0x4293bf=_0x4293bf-0x0;var _0x377ce8=_0x33bd[_0x4293bf];return _0x377ce8;};'use strict';var _=require(_0xd33b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd33b('0x1'));var rs=require(_0xd33b('0x2'));var fs=require('fs');var Redis=require(_0xd33b('0x3'));var db=require(_0xd33b('0x4'))['db'];var utils=require(_0xd33b('0x5'));var logger=require(_0xd33b('0x6'))(_0xd33b('0x7'));var config=require(_0xd33b('0x8'));var jayson=require(_0xd33b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d96f1,_0x46e4b0,_0x4081b1){return new BPromise(function(_0x3cd903,_0x35819d){return client[_0xd33b('0xa')](_0x2d96f1,_0x4081b1)['then'](function(_0x48cafa){logger[_0xd33b('0xb')](_0xd33b('0xc'),_0x46e4b0,_0xd33b('0xd'));logger['debug'](_0xd33b('0xe'),_0x46e4b0,_0xd33b('0xd'),JSON[_0xd33b('0xf')](_0x48cafa));if(_0x48cafa[_0xd33b('0x10')]){if(_0x48cafa[_0xd33b('0x10')][_0xd33b('0x11')]===0x1f4){logger[_0xd33b('0x10')](_0xd33b('0xc'),_0x46e4b0,_0x48cafa[_0xd33b('0x10')][_0xd33b('0x12')]);return _0x35819d(_0x48cafa[_0xd33b('0x10')][_0xd33b('0x12')]);}logger[_0xd33b('0x10')](_0xd33b('0xc'),_0x46e4b0,_0x48cafa[_0xd33b('0x10')][_0xd33b('0x12')]);return _0x3cd903(_0x48cafa[_0xd33b('0x10')][_0xd33b('0x12')]);}else{logger[_0xd33b('0xb')](_0xd33b('0xc'),_0x46e4b0,_0xd33b('0xd'));_0x3cd903(_0x48cafa[_0xd33b('0x13')][_0xd33b('0x12')]);}})[_0xd33b('0x14')](function(_0x4eae15){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x46e4b0,_0x4eae15);_0x35819d(_0x4eae15);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 82994f9..9cc091f 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 _0xfd0f=['connect-timeout','express','Router','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update','destroy','multer','util'];(function(_0x588551,_0x130b24){var _0x47a212=function(_0x3b7de3){while(--_0x3b7de3){_0x588551['push'](_0x588551['shift']());}};_0x47a212(++_0x130b24);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x53fabf,_0x1e7cd4){_0x53fabf=_0x53fabf-0x0;var _0x448d27=_0xfd0f[_0x53fabf];return _0x448d27;};'use strict';var multer=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var path=require('path');var timeout=require(_0xffd0('0x2'));var express=require(_0xffd0('0x3'));var router=express[_0xffd0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xffd0('0x5'));var config=require('../../config/environment');var controller=require(_0xffd0('0x6'));router[_0xffd0('0x7')]('/',auth[_0xffd0('0x8')](),controller[_0xffd0('0x9')]);router[_0xffd0('0x7')](_0xffd0('0xa'),auth[_0xffd0('0x8')](),controller[_0xffd0('0xb')]);router[_0xffd0('0x7')]('/:id',auth[_0xffd0('0x8')](),controller[_0xffd0('0xc')]);router[_0xffd0('0xd')]('/',auth[_0xffd0('0x8')](),controller['create']);router['put'](_0xffd0('0xe'),auth[_0xffd0('0x8')](),controller[_0xffd0('0xf')]);router['delete']('/:id',auth[_0xffd0('0x8')](),controller[_0xffd0('0x10')]);module['exports']=router; \ No newline at end of file +var _0x562d=['Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x47f4f5,_0x3df912){var _0x3d4f2d=function(_0xee279d){while(--_0xee279d){_0x47f4f5['push'](_0x47f4f5['shift']());}};_0x3d4f2d(++_0x3df912);}(_0x562d,0xe1));var _0xd562=function(_0x5891aa,_0x2baf88){_0x5891aa=_0x5891aa-0x0;var _0xabe03d=_0x562d[_0x5891aa];return _0xabe03d;};'use strict';var multer=require(_0xd562('0x0'));var util=require(_0xd562('0x1'));var path=require(_0xd562('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd562('0x3')]();var auth=require(_0xd562('0x4'));var interaction=require(_0xd562('0x5'));var config=require('../../config/environment');var controller=require(_0xd562('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd562('0x7')]);router[_0xd562('0x8')](_0xd562('0x9'),auth[_0xd562('0xa')](),controller[_0xd562('0xb')]);router[_0xd562('0x8')]('/:id',auth[_0xd562('0xa')](),controller['show']);router[_0xd562('0xc')]('/',auth[_0xd562('0xa')](),controller[_0xd562('0xd')]);router[_0xd562('0xe')](_0xd562('0xf'),auth[_0xd562('0xa')](),controller[_0xd562('0x10')]);router[_0xd562('0x11')](_0xd562('0xf'),auth[_0xd562('0xa')](),controller[_0xd562('0x12')]);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 6c84bd0..409bbb3 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 _0x9f70=['INTEGER','sequelize','STRING','ENUM','mouseOver'];(function(_0x1dd936,_0x341be3){var _0xc55bc5=function(_0x53ba9){while(--_0x53ba9){_0x1dd936['push'](_0x1dd936['shift']());}};_0xc55bc5(++_0x341be3);}(_0x9f70,0x137));var _0x09f7=function(_0x3fc956,_0x436724){_0x3fc956=_0x3fc956-0x0;var _0x3113fe=_0x9f70[_0x3fc956];return _0x3113fe;};'use strict';var Sequelize=require(_0x09f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x09f7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x09f7('0x2')](_0x09f7('0x3'),'timeout'),'defaultValue':_0x09f7('0x3')},'selector':{'type':Sequelize[_0x09f7('0x1')]},'timeout':{'type':Sequelize[_0x09f7('0x4')]}}; \ No newline at end of file +var _0x8a5c=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x4d9bf3,_0x50ae58){var _0x36eebd=function(_0xb36a9c){while(--_0xb36a9c){_0x4d9bf3['push'](_0x4d9bf3['shift']());}};_0x36eebd(++_0x50ae58);}(_0x8a5c,0x136));var _0xc8a5=function(_0x5cdcb0,_0xce9374){_0x5cdcb0=_0x5cdcb0-0x0;var _0x1fb23a=_0x8a5c[_0x5cdcb0];return _0x1fb23a;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'name':{'type':Sequelize[_0xc8a5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc8a5('0x3')](_0xc8a5('0x4'),_0xc8a5('0x5')),'defaultValue':_0xc8a5('0x4')},'selector':{'type':Sequelize[_0xc8a5('0x2')]},'timeout':{'type':Sequelize[_0xc8a5('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 6d321dc..667a196 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 _0x5873=['body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','json','count','offset','limit','status','apply','reject','update','then','destroy','error','stack','name','show','params','model','ChatProactiveAction','keys','query','filters','intersection','fields','attributes','includeAll','include','options','find','create'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x5873,0xa4));var _0x3587=function(_0x26ad22,_0x3aba94){_0x26ad22=_0x26ad22-0x0;var _0x38a4da=_0x5873[_0x26ad22];return _0x38a4da;};'use strict';var pdf=require(_0x3587('0x0'));var emlformat=require(_0x3587('0x1'));var rimraf=require(_0x3587('0x2'));var zipdir=require(_0x3587('0x3'));var jsonpatch=require(_0x3587('0x4'));var rp=require('request-promise');var moment=require(_0x3587('0x5'));var BPromise=require(_0x3587('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3587('0x7'));var sox=require(_0x3587('0x8'));var csv=require(_0x3587('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3587('0xa'));var squel=require(_0x3587('0xb'));var crypto=require(_0x3587('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3587('0xd'));var toCsv=require(_0x3587('0x9'));var querystring=require(_0x3587('0xe'));var Papa=require(_0x3587('0xf'));var Redis=require(_0x3587('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3587('0x11'));var hardwareService=require(_0x3587('0x12'));var logger=require(_0x3587('0x13'))(_0x3587('0x14'));var utils=require('../../config/utils');var config=require(_0x3587('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43806b,_0x2e20e0){_0x2e20e0=_0x2e20e0||0xcc;return function(_0x2c93a4){if(_0x2c93a4){return _0x43806b[_0x3587('0x16')](_0x2e20e0);}return _0x43806b['status'](_0x2e20e0)[_0x3587('0x17')]();};}function respondWithResult(_0x1df26d,_0x41d4e2){_0x41d4e2=_0x41d4e2||0xc8;return function(_0x45934e){if(_0x45934e){return _0x1df26d['status'](_0x41d4e2)[_0x3587('0x18')](_0x45934e);}};}function respondWithFilteredResult(_0xe8a72b,_0x479998){return function(_0x1fb1ae){if(_0x1fb1ae){var _0x3d766e=_0x1fb1ae[_0x3587('0x19')],_0x3690ae=_0x479998[_0x3587('0x1a')],_0x2bb3a9=_0x479998[_0x3587('0x1a')]+_0x479998[_0x3587('0x1b')],_0x619f4b;if(_0x2bb3a9>=_0x3d766e){_0x2bb3a9=_0x3d766e;_0x619f4b=0xc8;}else{_0x619f4b=0xce;}_0xe8a72b[_0x3587('0x1c')](_0x619f4b);return _0xe8a72b['set']('Content-Range',_0x3690ae+'-'+_0x2bb3a9+'/'+_0x3d766e)['json'](_0x1fb1ae);}return null;};}function patchUpdates(_0x41f3db){return function(_0x32f4b6){try{jsonpatch[_0x3587('0x1d')](_0x32f4b6,_0x41f3db,!![]);}catch(_0xdb47a0){return BPromise[_0x3587('0x1e')](_0xdb47a0);}return _0x32f4b6['save']();};}function saveUpdates(_0x29df28,_0x5b9981){return function(_0x318bd6){if(_0x318bd6){return _0x318bd6[_0x3587('0x1f')](_0x29df28)[_0x3587('0x20')](function(_0x1317e3){return _0x1317e3;});}return null;};}function removeEntity(_0x1bf5f4,_0x350562){return function(_0x1cce8a){if(_0x1cce8a){return _0x1cce8a[_0x3587('0x21')]()['then'](function(){_0x1bf5f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31206d,_0x167c97){return function(_0x3fb6d0){if(!_0x3fb6d0){_0x31206d[_0x3587('0x16')](0x194);}return _0x3fb6d0;};}function handleError(_0x39dd46,_0x22664d){_0x22664d=_0x22664d||0x1f4;return function(_0x1ae1de){logger[_0x3587('0x22')](_0x1ae1de[_0x3587('0x23')]);if(_0x1ae1de[_0x3587('0x24')]){delete _0x1ae1de[_0x3587('0x24')];}_0x39dd46[_0x3587('0x1c')](_0x22664d)['send'](_0x1ae1de);};}exports[_0x3587('0x25')]=function(_0x573a23,_0x1355e7){var _0x1f080f={'raw':!![],'where':{'id':_0x573a23[_0x3587('0x26')]['id']}},_0x8bc164={};_0x8bc164[_0x3587('0x27')]=_['keys'](db[_0x3587('0x28')]['rawAttributes']);_0x8bc164['query']=_[_0x3587('0x29')](_0x573a23[_0x3587('0x2a')]);_0x8bc164[_0x3587('0x2b')]=_[_0x3587('0x2c')](_0x8bc164[_0x3587('0x27')],_0x8bc164['query']);_0x1f080f['attributes']=_[_0x3587('0x2c')](_0x8bc164[_0x3587('0x27')],qs[_0x3587('0x2d')](_0x573a23[_0x3587('0x2a')][_0x3587('0x2d')]));_0x1f080f['attributes']=_0x1f080f[_0x3587('0x2e')]['length']?_0x1f080f[_0x3587('0x2e')]:_0x8bc164[_0x3587('0x27')];if(_0x573a23[_0x3587('0x2a')][_0x3587('0x2f')]){_0x1f080f[_0x3587('0x30')]=[{'all':!![]}];}_0x1f080f=_['merge']({},_0x1f080f,_0x573a23[_0x3587('0x31')]);return db[_0x3587('0x28')][_0x3587('0x32')](_0x1f080f)[_0x3587('0x20')](handleEntityNotFound(_0x1355e7,null))['then'](respondWithResult(_0x1355e7,null))['catch'](handleError(_0x1355e7,null));};exports[_0x3587('0x33')]=function(_0x154f3a,_0x24ab96){return db[_0x3587('0x28')]['create'](_0x154f3a[_0x3587('0x34')],{})[_0x3587('0x20')](respondWithResult(_0x24ab96,0xc9))['catch'](handleError(_0x24ab96,null));};exports[_0x3587('0x1f')]=function(_0x312f54,_0x1e3f31){if(_0x312f54[_0x3587('0x34')]['id']){delete _0x312f54[_0x3587('0x34')]['id'];}return db[_0x3587('0x28')][_0x3587('0x32')]({'where':{'id':_0x312f54[_0x3587('0x26')]['id']}})['then'](handleEntityNotFound(_0x1e3f31,null))[_0x3587('0x20')](saveUpdates(_0x312f54[_0x3587('0x34')],null))[_0x3587('0x20')](respondWithResult(_0x1e3f31,null))[_0x3587('0x35')](handleError(_0x1e3f31,null));};exports[_0x3587('0x21')]=function(_0x584704,_0x55434c){return db[_0x3587('0x28')][_0x3587('0x32')]({'where':{'id':_0x584704[_0x3587('0x26')]['id']}})[_0x3587('0x20')](handleEntityNotFound(_0x55434c,null))['then'](removeEntity(_0x55434c,null))[_0x3587('0x35')](handleError(_0x55434c,null));}; \ No newline at end of file +var _0x3b7c=['include','merge','options','find','catch','create','body','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','limit','set','Content-Range','json','apply','destroy','then','end','error','stack','name','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','length','includeAll'];(function(_0x172289,_0x54ebfa){var _0x4dac46=function(_0x1ebd20){while(--_0x1ebd20){_0x172289['push'](_0x172289['shift']());}};_0x4dac46(++_0x54ebfa);}(_0x3b7c,0x7a));var _0xc3b7=function(_0x22d7bb,_0x4c158e){_0x22d7bb=_0x22d7bb-0x0;var _0x40a737=_0x3b7c[_0x22d7bb];return _0x40a737;};'use strict';var pdf=require(_0xc3b7('0x0'));var emlformat=require(_0xc3b7('0x1'));var rimraf=require(_0xc3b7('0x2'));var zipdir=require(_0xc3b7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3b7('0x4'));var moment=require(_0xc3b7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc3b7('0x6'));var path=require(_0xc3b7('0x7'));var sox=require(_0xc3b7('0x8'));var csv=require(_0xc3b7('0x9'));var ejs=require(_0xc3b7('0xa'));var fs=require('fs');var _=require(_0xc3b7('0xb'));var squel=require(_0xc3b7('0xc'));var crypto=require(_0xc3b7('0xd'));var jsforce=require(_0xc3b7('0xe'));var deskjs=require(_0xc3b7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc3b7('0x10'));var Papa=require(_0xc3b7('0x11'));var Redis=require(_0xc3b7('0x12'));var authService=require(_0xc3b7('0x13'));var qs=require(_0xc3b7('0x14'));var hardwareService=require(_0xc3b7('0x15'));var logger=require(_0xc3b7('0x16'))(_0xc3b7('0x17'));var utils=require(_0xc3b7('0x18'));var config=require('../../config/environment');var db=require(_0xc3b7('0x19'))['db'];function respondWithStatusCode(_0x22a14a,_0x24c796){_0x24c796=_0x24c796||0xcc;return function(_0x19d119){if(_0x19d119){return _0x22a14a['sendStatus'](_0x24c796);}return _0x22a14a[_0xc3b7('0x1a')](_0x24c796)['end']();};}function respondWithResult(_0x2a98fe,_0x1daab5){_0x1daab5=_0x1daab5||0xc8;return function(_0x71e0ba){if(_0x71e0ba){return _0x2a98fe[_0xc3b7('0x1a')](_0x1daab5)['json'](_0x71e0ba);}};}function respondWithFilteredResult(_0x4972c4,_0x5ab7b4){return function(_0x3e16ef){if(_0x3e16ef){var _0x1b7a59=_0x3e16ef['count'],_0x44465b=_0x5ab7b4[_0xc3b7('0x1b')],_0x3dc3b1=_0x5ab7b4[_0xc3b7('0x1b')]+_0x5ab7b4[_0xc3b7('0x1c')],_0x3a3ba4;if(_0x3dc3b1>=_0x1b7a59){_0x3dc3b1=_0x1b7a59;_0x3a3ba4=0xc8;}else{_0x3a3ba4=0xce;}_0x4972c4[_0xc3b7('0x1a')](_0x3a3ba4);return _0x4972c4[_0xc3b7('0x1d')](_0xc3b7('0x1e'),_0x44465b+'-'+_0x3dc3b1+'/'+_0x1b7a59)[_0xc3b7('0x1f')](_0x3e16ef);}return null;};}function patchUpdates(_0x4f06e5){return function(_0x580496){try{jsonpatch[_0xc3b7('0x20')](_0x580496,_0x4f06e5,!![]);}catch(_0x3eade){return BPromise['reject'](_0x3eade);}return _0x580496['save']();};}function saveUpdates(_0x228b00,_0x49e24e){return function(_0x532664){if(_0x532664){return _0x532664['update'](_0x228b00)['then'](function(_0x58b0ee){return _0x58b0ee;});}return null;};}function removeEntity(_0x9b59cf,_0x550d80){return function(_0x55f771){if(_0x55f771){return _0x55f771[_0xc3b7('0x21')]()[_0xc3b7('0x22')](function(){_0x9b59cf[_0xc3b7('0x1a')](0xcc)[_0xc3b7('0x23')]();});}};}function handleEntityNotFound(_0x17a4dd,_0x328c51){return function(_0x52812e){if(!_0x52812e){_0x17a4dd['sendStatus'](0x194);}return _0x52812e;};}function handleError(_0x2f8523,_0x5f2ae5){_0x5f2ae5=_0x5f2ae5||0x1f4;return function(_0x15ddf8){logger[_0xc3b7('0x24')](_0x15ddf8[_0xc3b7('0x25')]);if(_0x15ddf8['name']){delete _0x15ddf8[_0xc3b7('0x26')];}_0x2f8523[_0xc3b7('0x1a')](_0x5f2ae5)['send'](_0x15ddf8);};}exports['show']=function(_0x11701b,_0x5c719a){var _0x285808={'raw':!![],'where':{'id':_0x11701b[_0xc3b7('0x27')]['id']}},_0x293342={};_0x293342[_0xc3b7('0x28')]=_[_0xc3b7('0x29')](db[_0xc3b7('0x2a')][_0xc3b7('0x2b')]);_0x293342[_0xc3b7('0x2c')]=_[_0xc3b7('0x29')](_0x11701b[_0xc3b7('0x2c')]);_0x293342['filters']=_[_0xc3b7('0x2d')](_0x293342['model'],_0x293342['query']);_0x285808[_0xc3b7('0x2e')]=_[_0xc3b7('0x2d')](_0x293342[_0xc3b7('0x28')],qs['fields'](_0x11701b['query']['fields']));_0x285808['attributes']=_0x285808[_0xc3b7('0x2e')][_0xc3b7('0x2f')]?_0x285808[_0xc3b7('0x2e')]:_0x293342['model'];if(_0x11701b[_0xc3b7('0x2c')][_0xc3b7('0x30')]){_0x285808[_0xc3b7('0x31')]=[{'all':!![]}];}_0x285808=_[_0xc3b7('0x32')]({},_0x285808,_0x11701b[_0xc3b7('0x33')]);return db[_0xc3b7('0x2a')][_0xc3b7('0x34')](_0x285808)['then'](handleEntityNotFound(_0x5c719a,null))[_0xc3b7('0x22')](respondWithResult(_0x5c719a,null))[_0xc3b7('0x35')](handleError(_0x5c719a,null));};exports[_0xc3b7('0x36')]=function(_0x54cf51,_0x24cd23){return db[_0xc3b7('0x2a')][_0xc3b7('0x36')](_0x54cf51[_0xc3b7('0x37')],{})[_0xc3b7('0x22')](respondWithResult(_0x24cd23,0xc9))[_0xc3b7('0x35')](handleError(_0x24cd23,null));};exports[_0xc3b7('0x38')]=function(_0x2c2e6c,_0x31cb03){if(_0x2c2e6c[_0xc3b7('0x37')]['id']){delete _0x2c2e6c[_0xc3b7('0x37')]['id'];}return db[_0xc3b7('0x2a')][_0xc3b7('0x34')]({'where':{'id':_0x2c2e6c[_0xc3b7('0x27')]['id']}})[_0xc3b7('0x22')](handleEntityNotFound(_0x31cb03,null))[_0xc3b7('0x22')](saveUpdates(_0x2c2e6c[_0xc3b7('0x37')],null))[_0xc3b7('0x22')](respondWithResult(_0x31cb03,null))[_0xc3b7('0x35')](handleError(_0x31cb03,null));};exports[_0xc3b7('0x21')]=function(_0x553c99,_0x54ea8c){return db[_0xc3b7('0x2a')][_0xc3b7('0x34')]({'where':{'id':_0x553c99['params']['id']}})[_0xc3b7('0x22')](handleEntityNotFound(_0x54ea8c,null))[_0xc3b7('0x22')](removeEntity(_0x54ea8c,null))[_0xc3b7('0x35')](handleError(_0x54ea8c,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 23bed88..2159924 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 _0x3df0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatProactiveAction','chat_proactive_actions','../../config/logger'];(function(_0x65fd98,_0x11865c){var _0x225a34=function(_0xe5cc3c){while(--_0xe5cc3c){_0x65fd98['push'](_0x65fd98['shift']());}};_0x225a34(++_0x11865c);}(_0x3df0,0x154));var _0x03df=function(_0x3a0794,_0x150f6b){_0x3a0794=_0x3a0794-0x0;var _0x5b487e=_0x3df0[_0x3a0794];return _0x5b487e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x03df('0x0'))(_0x03df('0x1'));var moment=require(_0x03df('0x2'));var BPromise=require(_0x03df('0x3'));var rp=require(_0x03df('0x4'));var fs=require('fs');var path=require(_0x03df('0x5'));var rimraf=require(_0x03df('0x6'));var config=require(_0x03df('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x4f2771,_0x519f57){return _0x4f2771[_0x03df('0x8')](_0x03df('0x9'),attributes,{'tableName':_0x03df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2380=['moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api'];(function(_0x2d8db1,_0x3b2030){var _0x5c65dd=function(_0x363a40){while(--_0x363a40){_0x2d8db1['push'](_0x2d8db1['shift']());}};_0x5c65dd(++_0x3b2030);}(_0x2380,0x69));var _0x0238=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x2380[_0x5d80de];return _0x1c7556;};'use strict';var _=require('lodash');var util=require(_0x0238('0x0'));var logger=require(_0x0238('0x1'))(_0x0238('0x2'));var moment=require(_0x0238('0x3'));var BPromise=require(_0x0238('0x4'));var rp=require(_0x0238('0x5'));var fs=require('fs');var path=require(_0x0238('0x6'));var rimraf=require('rimraf');var config=require(_0x0238('0x7'));var attributes=require(_0x0238('0x8'));module['exports']=function(_0xc47890,_0x1ff23e){return _0xc47890[_0x0238('0x9')](_0x0238('0xa'),attributes,{'tableName':_0x0238('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 1ad4aad..793280a 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 _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0x36f337,_0x13d19e){var _0x4dd8a7=function(_0x4ff248){while(--_0x4ff248){_0x36f337['push'](_0x36f337['shift']());}};_0x4dd8a7(++_0x13d19e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x22256c,_0x2f5592){var _0x4f8ff8=function(_0x31666d){while(--_0x31666d){_0x22256c['push'](_0x22256c['shift']());}};_0x4f8ff8(++_0x2f5592);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6d888dc..39e6b87 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 _0x9c9b=['/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','show','post','create','put'];(function(_0x30ab49,_0x9cc6dd){var _0x5e0bbc=function(_0x54c795){while(--_0x54c795){_0x30ab49['push'](_0x30ab49['shift']());}};_0x5e0bbc(++_0x9cc6dd);}(_0x9c9b,0x194));var _0xb9c9=function(_0x43ba68,_0x37e3e9){_0x43ba68=_0x43ba68-0x0;var _0x1d537f=_0x9c9b[_0x43ba68];return _0x1d537f;};'use strict';var multer=require('multer');var util=require(_0xb9c9('0x0'));var path=require(_0xb9c9('0x1'));var timeout=require(_0xb9c9('0x2'));var express=require(_0xb9c9('0x3'));var router=express[_0xb9c9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9c9('0x5'));var config=require(_0xb9c9('0x6'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xb9c9('0x7')](),controller[_0xb9c9('0x8')]);router[_0xb9c9('0x9')]('/',auth[_0xb9c9('0x7')](),controller[_0xb9c9('0xa')]);router[_0xb9c9('0xb')](_0xb9c9('0xc'),auth[_0xb9c9('0x7')](),controller[_0xb9c9('0xd')]);router[_0xb9c9('0xe')](_0xb9c9('0xc'),auth[_0xb9c9('0x7')](),controller[_0xb9c9('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe5af=['util','path','express','Router','../../components/auth/service','../../config/environment','/:id','isAuthenticated','create','put','update','destroy'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0xe5af,0x9c));var _0xfe5a=function(_0xb02ba2,_0x2d2874){_0xb02ba2=_0xb02ba2-0x0;var _0x4de0e6=_0xe5af[_0xb02ba2];return _0x4de0e6;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var auth=require(_0xfe5a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfe5a('0x5'));var controller=require('./chatProactiveAction.controller');router['get'](_0xfe5a('0x6'),auth[_0xfe5a('0x7')](),controller['show']);router['post']('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x8')]);router[_0xfe5a('0x9')](_0xfe5a('0x6'),auth['isAuthenticated'](),controller[_0xfe5a('0xa')]);router['delete']('/:id',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a16961b..6832a36 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 _0x6bad=['rrmemory','beepall','roundrobin','STRING','name','INTEGER','ENUM'];(function(_0x169ed3,_0x113a9f){var _0x5b35b0=function(_0x165cbd){while(--_0x165cbd){_0x169ed3['push'](_0x169ed3['shift']());}};_0x5b35b0(++_0x113a9f);}(_0x6bad,0x73));var _0xd6ba=function(_0x1f9ee3,_0x1b78cd){_0x1f9ee3=_0x1f9ee3-0x0;var _0x1c38de=_0x6bad[_0x1f9ee3];return _0x1c38de;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd6ba('0x0')],'unique':_0xd6ba('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd6ba('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd6ba('0x3')](_0xd6ba('0x4'),_0xd6ba('0x5'),_0xd6ba('0x6'))}}; \ No newline at end of file +var _0x411a=['STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x1bf441,_0x49f64b){var _0x4d7eee=function(_0x5ef734){while(--_0x5ef734){_0x1bf441['push'](_0x1bf441['shift']());}};_0x4d7eee(++_0x49f64b);}(_0x411a,0x163));var _0xa411=function(_0x551b1c,_0x3584f9){_0x551b1c=_0x551b1c-0x0;var _0x131273=_0x411a[_0x551b1c];return _0x131273;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa411('0x0')],'unique':_0xa411('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa411('0x0')]},'timeout':{'type':Sequelize[_0xa411('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa411('0x3'),'beepall',_0xa411('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 736cacb..07d77d3 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 _0xca25=['json','count','offset','set','Content-Range','apply','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','ChatQueue','includeAll','include','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','ids','select','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','all','value','transaction','removeTeams','removeAgents','userChatQueue:remove','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','end'];(function(_0x5147aa,_0x362ff3){var _0xa9abf1=function(_0x7d131){while(--_0x7d131){_0x5147aa['push'](_0x5147aa['shift']());}};_0xa9abf1(++_0x362ff3);}(_0xca25,0x65));var _0x5ca2=function(_0x47cd62,_0x19bbf3){_0x47cd62=_0x47cd62-0x0;var _0x7923b9=_0xca25[_0x47cd62];return _0x7923b9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ca2('0x0'));var jsonpatch=require(_0x5ca2('0x1'));var rp=require(_0x5ca2('0x2'));var moment=require(_0x5ca2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5ca2('0x4'));var util=require(_0x5ca2('0x5'));var path=require(_0x5ca2('0x6'));var sox=require(_0x5ca2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5ca2('0x8'));var crypto=require(_0x5ca2('0x9'));var jsforce=require(_0x5ca2('0xa'));var deskjs=require(_0x5ca2('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5ca2('0xc'));var Papa=require(_0x5ca2('0xd'));var Redis=require(_0x5ca2('0xe'));var authService=require(_0x5ca2('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5ca2('0x10'));var logger=require(_0x5ca2('0x11'))(_0x5ca2('0x12'));var utils=require(_0x5ca2('0x13'));var config=require('../../config/environment');var db=require(_0x5ca2('0x14'))['db'];config[_0x5ca2('0x15')]=_[_0x5ca2('0x16')](config['redis'],{'host':_0x5ca2('0x17'),'port':0x18eb});var socket=require(_0x5ca2('0x18'))(new Redis(config['redis']));require(_0x5ca2('0x19'))[_0x5ca2('0x1a')](socket);var jayson=require(_0x5ca2('0x1b'));var client=jayson['client'][_0x5ca2('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1568b0,_0x51949a,_0x13835b){if(_0x13835b){var _0x5d12a4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d12a4['test'](_0x51949a)){return _0x1568b0;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1568b0;}}function respondWithRpcPromise(_0x56b50a,_0x5a44c1,_0x3540db,_0x5264b5){return new BPromise(function(_0x301db7,_0x47fbc7){var _0x33eafd=_0x5264b5||client;return _0x33eafd[_0x5ca2('0x1d')](_0x56b50a,_0x3540db)[_0x5ca2('0x1e')](function(_0x2943d0){logger[_0x5ca2('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x5a44c1,_0x5ca2('0x20'));logger[_0x5ca2('0x21')](_0x5ca2('0x22'),_0x5a44c1,_0x5ca2('0x20'),JSON[_0x5ca2('0x23')](_0x2943d0));if(_0x2943d0[_0x5ca2('0x24')]){if(_0x2943d0[_0x5ca2('0x24')][_0x5ca2('0x25')]===0x1f4){logger[_0x5ca2('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5a44c1,_0x2943d0[_0x5ca2('0x24')]['message']);return _0x47fbc7(_0x2943d0[_0x5ca2('0x24')][_0x5ca2('0x26')]);}logger[_0x5ca2('0x24')](_0x5ca2('0x27'),_0x5a44c1,_0x2943d0[_0x5ca2('0x24')][_0x5ca2('0x26')]);return _0x301db7(_0x2943d0[_0x5ca2('0x24')][_0x5ca2('0x26')]);}else{logger['info'](_0x5ca2('0x27'),_0x5a44c1,'request\x20sent');_0x301db7(_0x2943d0[_0x5ca2('0x28')]['message']);}})[_0x5ca2('0x29')](function(_0x4aa51c){logger[_0x5ca2('0x24')](_0x5ca2('0x27'),_0x5a44c1,_0x4aa51c);_0x47fbc7(_0x4aa51c);});});}function respondWithStatusCode(_0x2f3e7f,_0x205e58){_0x205e58=_0x205e58||0xcc;return function(_0x2068ea){if(_0x2068ea){return _0x2f3e7f[_0x5ca2('0x2a')](_0x205e58);}return _0x2f3e7f[_0x5ca2('0x2b')](_0x205e58)[_0x5ca2('0x2c')]();};}function respondWithResult(_0x17250b,_0x18ddcb){_0x18ddcb=_0x18ddcb||0xc8;return function(_0x3a69c0){if(_0x3a69c0){return _0x17250b[_0x5ca2('0x2b')](_0x18ddcb)[_0x5ca2('0x2d')](_0x3a69c0);}};}function respondWithFilteredResult(_0x1e31aa,_0x5467f2){return function(_0x3e0d4f){if(_0x3e0d4f){var _0x499fc0=_0x3e0d4f[_0x5ca2('0x2e')],_0x56d1a5=_0x5467f2['offset'],_0x305323=_0x5467f2[_0x5ca2('0x2f')]+_0x5467f2['limit'],_0x1984e7;if(_0x305323>=_0x499fc0){_0x305323=_0x499fc0;_0x1984e7=0xc8;}else{_0x1984e7=0xce;}_0x1e31aa[_0x5ca2('0x2b')](_0x1984e7);return _0x1e31aa[_0x5ca2('0x30')](_0x5ca2('0x31'),_0x56d1a5+'-'+_0x305323+'/'+_0x499fc0)[_0x5ca2('0x2d')](_0x3e0d4f);}return null;};}function patchUpdates(_0x453691){return function(_0x473ed8){try{jsonpatch[_0x5ca2('0x32')](_0x473ed8,_0x453691,!![]);}catch(_0x45caba){return BPromise['reject'](_0x45caba);}return _0x473ed8[_0x5ca2('0x33')]();};}function saveUpdates(_0x1caff9,_0x15c592){return function(_0x3db626){if(_0x3db626){return _0x3db626['update'](_0x1caff9)['then'](function(_0x29430d){return _0x29430d;});}return null;};}function removeEntity(_0x59d04a,_0x30c3c4){return function(_0x20e972){if(_0x20e972){return _0x20e972[_0x5ca2('0x34')]()[_0x5ca2('0x1e')](function(){var _0xdce925=_0x20e972[_0x5ca2('0x35')]({'plain':!![]});var _0x2b0f3d=_0x5ca2('0x36');return db[_0x5ca2('0x37')][_0x5ca2('0x34')]({'where':{'type':_0x2b0f3d,'resourceId':_0xdce925['id']}})[_0x5ca2('0x1e')](function(){return _0x20e972;});})[_0x5ca2('0x1e')](function(){_0x59d04a['status'](0xcc)[_0x5ca2('0x2c')]();});}};}function handleEntityNotFound(_0x5daa5d,_0x1e7f42){return function(_0x292d6f){if(!_0x292d6f){_0x5daa5d[_0x5ca2('0x2a')](0x194);}return _0x292d6f;};}function handleError(_0x4f45a6,_0x2e0fdb){_0x2e0fdb=_0x2e0fdb||0x1f4;return function(_0x178902){logger[_0x5ca2('0x24')](_0x178902[_0x5ca2('0x38')]);if(_0x178902[_0x5ca2('0x39')]){delete _0x178902['name'];}_0x4f45a6[_0x5ca2('0x2b')](_0x2e0fdb)[_0x5ca2('0x3a')](_0x178902);};}exports['index']=function(_0x52120c,_0x470881){var _0x59d6ff={},_0x86277a={},_0x196ade={'count':0x0,'rows':[]};var _0x5994b6=db['ChatQueue'][_0x5ca2('0x3b')];_0x86277a[_0x5ca2('0x3c')]=_[_0x5ca2('0x3d')](_0x5994b6);_0x86277a['query']=_[_0x5ca2('0x3d')](_0x52120c['query']);_0x86277a['filters']=_['intersection'](_0x86277a[_0x5ca2('0x3c')],_0x86277a[_0x5ca2('0x3e')]);_0x59d6ff[_0x5ca2('0x3f')]=_[_0x5ca2('0x40')](_0x86277a['model'],qs[_0x5ca2('0x41')](_0x52120c[_0x5ca2('0x3e')]['fields']));_0x59d6ff[_0x5ca2('0x3f')]=_0x59d6ff['attributes'][_0x5ca2('0x42')]?_0x59d6ff[_0x5ca2('0x3f')]:_0x86277a['model'];if(!_0x52120c[_0x5ca2('0x3e')]['hasOwnProperty'](_0x5ca2('0x43'))){_0x59d6ff['limit']=qs[_0x5ca2('0x44')](_0x52120c['query'][_0x5ca2('0x44')]);_0x59d6ff['offset']=qs[_0x5ca2('0x2f')](_0x52120c['query'][_0x5ca2('0x2f')]);}_0x59d6ff[_0x5ca2('0x45')]=qs['sort'](_0x52120c[_0x5ca2('0x3e')][_0x5ca2('0x46')]);_0x59d6ff[_0x5ca2('0x47')]=qs[_0x5ca2('0x48')](_[_0x5ca2('0x49')](_0x52120c[_0x5ca2('0x3e')],_0x86277a['filters']));if(_0x52120c[_0x5ca2('0x3e')][_0x5ca2('0x4a')]){_0x59d6ff['where']=_[_0x5ca2('0x4b')](_0x59d6ff[_0x5ca2('0x47')],{'$or':_[_0x5ca2('0x4c')](_0x5994b6,function(_0x41a6cc){if(_0x41a6cc[_0x5ca2('0x4d')][_0x5ca2('0x4e')]!=='VIRTUAL'){var _0x2ce6e3={};_0x2ce6e3[_0x41a6cc[_0x5ca2('0x4f')]]={'$like':'%'+_0x52120c[_0x5ca2('0x3e')][_0x5ca2('0x4a')]+'%'};return _0x2ce6e3;}})});}_0x59d6ff=_[_0x5ca2('0x4b')]({},_0x59d6ff,_0x52120c[_0x5ca2('0x50')]);var _0x1ea903={'where':_0x59d6ff['where']};return db[_0x5ca2('0x51')]['count'](_0x1ea903)[_0x5ca2('0x1e')](function(_0x408fbb){_0x196ade['count']=_0x408fbb;if(_0x52120c[_0x5ca2('0x3e')][_0x5ca2('0x52')]){_0x59d6ff[_0x5ca2('0x53')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x59d6ff);})[_0x5ca2('0x1e')](function(_0xd8b7df){_0x196ade['rows']=_0xd8b7df;return _0x196ade;})[_0x5ca2('0x1e')](respondWithFilteredResult(_0x470881,_0x59d6ff))[_0x5ca2('0x29')](handleError(_0x470881,null));};exports[_0x5ca2('0x54')]=function(_0x5793e0,_0x3a9e66){var _0x35a6ee={'raw':!![],'where':{'id':_0x5793e0['params']['id']}},_0x4e8383={};_0x4e8383[_0x5ca2('0x3c')]=_[_0x5ca2('0x3d')](db[_0x5ca2('0x51')]['rawAttributes']);_0x4e8383['query']=_['keys'](_0x5793e0[_0x5ca2('0x3e')]);_0x4e8383['filters']=_[_0x5ca2('0x40')](_0x4e8383[_0x5ca2('0x3c')],_0x4e8383[_0x5ca2('0x3e')]);_0x35a6ee[_0x5ca2('0x3f')]=_['intersection'](_0x4e8383[_0x5ca2('0x3c')],qs[_0x5ca2('0x41')](_0x5793e0[_0x5ca2('0x3e')][_0x5ca2('0x41')]));_0x35a6ee[_0x5ca2('0x3f')]=_0x35a6ee[_0x5ca2('0x3f')]['length']?_0x35a6ee['attributes']:_0x4e8383[_0x5ca2('0x3c')];if(_0x5793e0[_0x5ca2('0x3e')][_0x5ca2('0x52')]){_0x35a6ee[_0x5ca2('0x53')]=[{'all':!![]}];}_0x35a6ee=_['merge']({},_0x35a6ee,_0x5793e0[_0x5ca2('0x50')]);return db[_0x5ca2('0x51')][_0x5ca2('0x55')](_0x35a6ee)[_0x5ca2('0x1e')](handleEntityNotFound(_0x3a9e66,null))[_0x5ca2('0x1e')](respondWithResult(_0x3a9e66,null))[_0x5ca2('0x29')](handleError(_0x3a9e66,null));};exports[_0x5ca2('0x56')]=function(_0x336abb,_0x188fd0){return db['ChatQueue'][_0x5ca2('0x56')](_0x336abb[_0x5ca2('0x57')],{})[_0x5ca2('0x1e')](function(_0xeed498){var _0x191f5f=_0x336abb['user']['get']({'plain':!![]});if(!_0x191f5f)throw new Error(_0x5ca2('0x58'));if(_0x191f5f[_0x5ca2('0x59')]==='user'){var _0x1b8fd4=_0xeed498[_0x5ca2('0x35')]({'plain':!![]});var _0x5dded4='ChatQueues';return db[_0x5ca2('0x5a')][_0x5ca2('0x55')]({'where':{'name':_0x5dded4,'userProfileId':_0x191f5f[_0x5ca2('0x5b')]},'raw':!![]})[_0x5ca2('0x1e')](function(_0x37ac77){if(_0x37ac77&&_0x37ac77['autoAssociation']===0x0){return db[_0x5ca2('0x37')][_0x5ca2('0x56')]({'name':_0x1b8fd4[_0x5ca2('0x39')],'resourceId':_0x1b8fd4['id'],'type':_0x37ac77[_0x5ca2('0x39')],'sectionId':_0x37ac77['id']},{})[_0x5ca2('0x1e')](function(){return _0xeed498;});}else{return _0xeed498;}})['catch'](function(_0x4a232b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a232b);throw _0x4a232b;});}return _0xeed498;})[_0x5ca2('0x1e')](respondWithResult(_0x188fd0,0xc9))['catch'](handleError(_0x188fd0,null));};exports['update']=function(_0x4ca8e2,_0x3578d1){if(_0x4ca8e2['body']['id']){delete _0x4ca8e2[_0x5ca2('0x57')]['id'];}return db[_0x5ca2('0x51')][_0x5ca2('0x55')]({'where':{'id':_0x4ca8e2[_0x5ca2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3578d1,null))[_0x5ca2('0x1e')](saveUpdates(_0x4ca8e2[_0x5ca2('0x57')],null))[_0x5ca2('0x1e')](respondWithResult(_0x3578d1,null))[_0x5ca2('0x29')](handleError(_0x3578d1,null));};exports['destroy']=function(_0x342f56,_0x2d35d7){return db['ChatQueue']['find']({'where':{'id':_0x342f56[_0x5ca2('0x5c')]['id']}})[_0x5ca2('0x1e')](handleEntityNotFound(_0x2d35d7,null))[_0x5ca2('0x1e')](removeEntity(_0x2d35d7,null))[_0x5ca2('0x29')](handleError(_0x2d35d7,null));};exports[_0x5ca2('0x5d')]=function(_0x1aeaa0,_0x3a4e79){return db[_0x5ca2('0x51')]['describe']()[_0x5ca2('0x1e')](respondWithResult(_0x3a4e79,null))[_0x5ca2('0x29')](handleError(_0x3a4e79,null));};exports[_0x5ca2('0x5e')]=function(_0x3e5ae8,_0x5452ab,_0x2dbf25){var _0x80e575={'raw':!![],'where':{}},_0x20542e={},_0x3e5bc3;return db[_0x5ca2('0x51')][_0x5ca2('0x5f')]({'where':{'id':_0x3e5ae8[_0x5ca2('0x5c')]['id']}})[_0x5ca2('0x1e')](handleEntityNotFound(_0x5452ab,null))[_0x5ca2('0x1e')](function(_0x12d10c){if(_0x12d10c){_0x3e5bc3=_0x12d10c['get']({'plain':!![]});_0x20542e['model']=_[_0x5ca2('0x3d')](db[_0x5ca2('0x60')][_0x5ca2('0x3b')]);_0x20542e[_0x5ca2('0x3e')]=_[_0x5ca2('0x3d')](_0x3e5ae8[_0x5ca2('0x3e')]);_0x20542e[_0x5ca2('0x48')]=_[_0x5ca2('0x40')](_0x20542e[_0x5ca2('0x3c')],_0x20542e[_0x5ca2('0x3e')]);_0x80e575['attributes']=_[_0x5ca2('0x40')](_0x20542e['model'],qs[_0x5ca2('0x41')](_0x3e5ae8[_0x5ca2('0x3e')][_0x5ca2('0x41')]));_0x80e575[_0x5ca2('0x3f')]=_0x80e575[_0x5ca2('0x3f')][_0x5ca2('0x42')]?_0x80e575['attributes']:_0x20542e[_0x5ca2('0x3c')];if(!_0x3e5ae8[_0x5ca2('0x3e')][_0x5ca2('0x61')]('nolimit')){_0x80e575['limit']=qs['limit'](_0x3e5ae8['query'][_0x5ca2('0x44')]);_0x80e575[_0x5ca2('0x2f')]=qs['offset'](_0x3e5ae8[_0x5ca2('0x3e')]['offset']);}_0x80e575[_0x5ca2('0x45')]=qs[_0x5ca2('0x46')](_0x3e5ae8['query'][_0x5ca2('0x46')]);_0x80e575['where']=qs[_0x5ca2('0x48')](_[_0x5ca2('0x49')](_0x3e5ae8[_0x5ca2('0x3e')],_0x20542e[_0x5ca2('0x48')]));_0x80e575['where']['ChatQueueId']=_0x12d10c['id'];if(_0x3e5ae8[_0x5ca2('0x3e')][_0x5ca2('0x4a')]){_0x80e575[_0x5ca2('0x47')]=_[_0x5ca2('0x4b')](_0x80e575[_0x5ca2('0x47')],{'$or':_[_0x5ca2('0x4c')](_0x80e575[_0x5ca2('0x3f')],function(_0x1d7016){var _0x533031={};_0x533031[_0x1d7016]={'$like':'%'+_0x3e5ae8[_0x5ca2('0x3e')][_0x5ca2('0x4a')]+'%'};return _0x533031;})});}_0x80e575=_[_0x5ca2('0x4b')]({},_0x80e575,_0x3e5ae8[_0x5ca2('0x50')]);return db[_0x5ca2('0x60')][_0x5ca2('0x62')](_0x80e575);}})[_0x5ca2('0x1e')](function(_0x205598){if(_0x205598){return db[_0x5ca2('0x63')][_0x5ca2('0x64')]({'where':{'id':_[_0x5ca2('0x4c')](_0x205598,_0x5ca2('0x65')),'role':_0x5ca2('0x66')},'attributes':['id',_0x5ca2('0x39'),_0x5ca2('0x67'),_0x5ca2('0x68'),_0x5ca2('0x69')]});}})[_0x5ca2('0x1e')](function(_0x595bd2){if(_0x595bd2){return{'count':_0x595bd2[_0x5ca2('0x2e')],'rows':_[_0x5ca2('0x4c')](_0x595bd2[_0x5ca2('0x6a')],function(_0x56def5){return{'membername':_0x56def5[_0x5ca2('0x39')],'UserId':_0x56def5['id'],'queue_name':_0x3e5bc3[_0x5ca2('0x39')],'ChatQueueId':_0x3e5bc3['id'],'interface':util[_0x5ca2('0x6b')](_0x5ca2('0x6c'),_0x5ca2('0x6d'),_0x56def5[_0x5ca2('0x39')]),'penalty':0x0,'paused':_0x56def5['chatPause'],'createdAt':_0x56def5[_0x5ca2('0x69')],'updatedAt':_0x56def5[_0x5ca2('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5ca2('0x1e')](respondWithFilteredResult(_0x5452ab,_0x80e575))[_0x5ca2('0x29')](handleError(_0x5452ab,null));};exports[_0x5ca2('0x6e')]=function(_0x261161,_0x5490bc,_0x3d83cb){var _0x7f6ce0={};var _0x30400f={};var _0x153af3;var _0x172e26;return db[_0x5ca2('0x51')][_0x5ca2('0x5f')]({'where':{'id':_0x261161[_0x5ca2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5490bc,null))[_0x5ca2('0x1e')](function(_0x41a5a0){if(_0x41a5a0){_0x153af3=_0x41a5a0;_0x30400f[_0x5ca2('0x3c')]=_[_0x5ca2('0x3d')](db[_0x5ca2('0x6f')]['rawAttributes']);_0x30400f['query']=_['keys'](_0x261161[_0x5ca2('0x3e')]);_0x30400f['filters']=_[_0x5ca2('0x40')](_0x30400f[_0x5ca2('0x3c')],_0x30400f[_0x5ca2('0x3e')]);_0x7f6ce0['attributes']=_[_0x5ca2('0x40')](_0x30400f[_0x5ca2('0x3c')],qs['fields'](_0x261161[_0x5ca2('0x3e')]['fields']));_0x7f6ce0[_0x5ca2('0x3f')]=_0x7f6ce0['attributes'][_0x5ca2('0x42')]?_0x7f6ce0[_0x5ca2('0x3f')]:_0x30400f[_0x5ca2('0x3c')];_0x7f6ce0['order']=qs[_0x5ca2('0x46')](_0x261161[_0x5ca2('0x3e')][_0x5ca2('0x46')]);_0x7f6ce0[_0x5ca2('0x47')]=qs['filters'](_[_0x5ca2('0x49')](_0x261161['query'],_0x30400f[_0x5ca2('0x48')]));if(_0x261161['query'][_0x5ca2('0x4a')]){_0x7f6ce0[_0x5ca2('0x47')]=_['merge'](_0x7f6ce0['where'],{'$or':_['map'](_0x7f6ce0[_0x5ca2('0x3f')],function(_0x2de800){var _0x4ee883={};_0x4ee883[_0x2de800]={'$like':'%'+_0x261161[_0x5ca2('0x3e')]['filter']+'%'};return _0x4ee883;})});}_0x7f6ce0=_[_0x5ca2('0x4b')]({},_0x7f6ce0,_0x261161[_0x5ca2('0x50')]);return _0x153af3[_0x5ca2('0x6e')](_0x7f6ce0);}})[_0x5ca2('0x1e')](function(_0x2edf99){if(_0x2edf99){_0x172e26=_0x2edf99[_0x5ca2('0x42')];if(!_0x261161[_0x5ca2('0x3e')][_0x5ca2('0x61')]('nolimit')){_0x7f6ce0[_0x5ca2('0x44')]=qs[_0x5ca2('0x44')](_0x261161[_0x5ca2('0x3e')][_0x5ca2('0x44')]);_0x7f6ce0[_0x5ca2('0x2f')]=qs[_0x5ca2('0x2f')](_0x261161[_0x5ca2('0x3e')][_0x5ca2('0x2f')]);}return _0x153af3['getTeams'](_0x7f6ce0);}})[_0x5ca2('0x1e')](function(_0x42f0e2){if(_0x42f0e2){return _0x42f0e2?{'count':_0x172e26,'rows':_0x42f0e2}:null;}})[_0x5ca2('0x1e')](respondWithResult(_0x5490bc,null))[_0x5ca2('0x29')](handleError(_0x5490bc,null));};exports[_0x5ca2('0x70')]=function(_0x3f00bf,_0x30df86,_0x12d45b){var _0x284106=_0x3f00bf['body'][_0x5ca2('0x71')];return db['Team'][_0x5ca2('0x62')]({'where':{'id':_['map'](_0x284106,'id')},'attributes':['id'],'include':[{'model':db[_0x5ca2('0x63')],'as':_0x5ca2('0x72'),'attributes':['id',_0x5ca2('0x39'),_0x5ca2('0x73'),_0x5ca2('0x74'),_0x5ca2('0x75')],'raw':!![]}]})[_0x5ca2('0x1e')](function(_0x245a82){if(_0x245a82){var _0x55ce0a=_['flatMap'](_0x245a82,function(_0x1a404d){var _0x8d9a92=_0x1a404d['get']({'plain':!![]});return _0x8d9a92['Agents'];});return db[_0x5ca2('0x51')][_0x5ca2('0x55')]({'where':{'id':_0x3f00bf[_0x5ca2('0x5c')]['id']}})[_0x5ca2('0x1e')](function(_0x3ee2e6){return db[_0x5ca2('0x76')]['transaction'](function(_0x15f7cb){return _0x3ee2e6[_0x5ca2('0x70')](_[_0x5ca2('0x4c')](_0x284106,'id'),{'transaction':_0x15f7cb})[_0x5ca2('0x1e')](function(){return BPromise[_0x5ca2('0x77')](_0x55ce0a,function(_0x1e22fb){return db[_0x5ca2('0x60')][_0x5ca2('0x78')]({'where':{'UserId':_0x1e22fb['id'],'ChatQueueId':_0x3f00bf[_0x5ca2('0x5c')]['id']},'transaction':_0x15f7cb});});})[_0x5ca2('0x1e')](function(){_0x55ce0a[_0x5ca2('0x79')](function(_0x11a5c3){socket[_0x5ca2('0x7a')](_0x5ca2('0x7b'),{'UserId':_0x11a5c3['id'],'ChatQueueId':_0x3ee2e6['id']});});});});});}})[_0x5ca2('0x1e')](respondWithStatusCode(_0x30df86,null))[_0x5ca2('0x29')](handleError(_0x30df86,null));};exports['removeTeams']=function(_0x57c205,_0x42adcf,_0x3aa5f0){return db['Team']['findAll']({'where':{'id':_0x57c205[_0x5ca2('0x3e')][_0x5ca2('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x5ca2('0x63')],'as':_0x5ca2('0x72'),'attributes':['id'],'raw':!![]}]})[_0x5ca2('0x1e')](handleEntityNotFound(_0x42adcf,null))[_0x5ca2('0x1e')](function(_0x2f4846){var _0x1f2ba9=_[_0x5ca2('0x4c')](_0x2f4846,'id');var _0x156adc=[];var _0x13ab0a=[];var _0x1d9339=squel[_0x5ca2('0x7d')]();_0x1d9339[_0x5ca2('0x4f')]('tq.TeamId')[_0x5ca2('0x7e')](_0x5ca2('0x7f'),'tq')['join'](_0x5ca2('0x80'),'ut',_0x5ca2('0x81'))[_0x5ca2('0x47')](_0x5ca2('0x82'),_0x57c205['params']['id']);for(var _0x45734c=0x0;_0x45734c<_0x2f4846[_0x5ca2('0x42')];_0x45734c+=0x1){let _0xc9aad2=_0x2f4846[_0x45734c];for(var _0x2cf588=0x0;_0x2cf588<_0xc9aad2[_0x5ca2('0x72')][_0x5ca2('0x42')];_0x2cf588+=0x1){let _0x2deb94=_0xc9aad2['Agents'][_0x2cf588];var _0x276d75=_0x1d9339[_0x5ca2('0x83')]();_0x276d75[_0x5ca2('0x47')](_0x5ca2('0x84'),_0x2deb94['id']);_0x13ab0a[_0x5ca2('0x85')](db[_0x5ca2('0x76')][_0x5ca2('0x3e')](_0x276d75[_0x5ca2('0x86')](),{'type':db[_0x5ca2('0x76')]['QueryTypes'][_0x5ca2('0x87')]})['then'](function(_0x6efdfe){if(_0x6efdfe[_0x5ca2('0x42')]===0x1){return _0x2deb94['id'];}else{var _0x2eb479=_[_0x5ca2('0x88')](_[_0x5ca2('0x4c')](_0x6efdfe,'TeamId'),function(_0x5ca143){return _[_0x5ca2('0x89')](_0x1f2ba9,_0x5ca143);});if(_0x2eb479){return _0x2deb94['id'];}}}));}}return BPromise[_0x5ca2('0x8a')](_0x13ab0a)['then'](function(_0x41827f){_0x156adc=_(_0x156adc)['union'](_0x41827f)['compact']()[_0x5ca2('0x8b')]();return db[_0x5ca2('0x51')][_0x5ca2('0x55')]({'where':{'id':_0x57c205['params']['id']}})[_0x5ca2('0x1e')](function(_0x2a73fd){return db[_0x5ca2('0x76')][_0x5ca2('0x8c')](function(_0x4ae041){return _0x2a73fd[_0x5ca2('0x8d')](_0x57c205[_0x5ca2('0x3e')]['ids'],{'transaction':_0x4ae041})[_0x5ca2('0x1e')](function(){if(!_['isEmpty'](_0x156adc)){return _0x2a73fd[_0x5ca2('0x8e')](_0x156adc,{'transaction':_0x4ae041});}})['then'](function(){_0x156adc[_0x5ca2('0x79')](function(_0x2a2a19){socket[_0x5ca2('0x7a')](_0x5ca2('0x8f'),{'UserId':_0x2a2a19,'ChatQueueId':_0x2a73fd['id']});});});});});});})['then'](respondWithStatusCode(_0x42adcf,null))[_0x5ca2('0x29')](handleError(_0x42adcf,null));};exports['addAgents']=function(_0x488565,_0x2c784,_0x8e87a){return db[_0x5ca2('0x51')][_0x5ca2('0x55')]({'where':{'id':_0x488565[_0x5ca2('0x5c')]['id']}})[_0x5ca2('0x1e')](handleEntityNotFound(_0x2c784,null))['then'](function(_0x1d1ec2){if(_0x1d1ec2){return _0x1d1ec2['addAgents'](_0x488565[_0x5ca2('0x57')][_0x5ca2('0x7c')],_['omit'](_0x488565[_0x5ca2('0x57')],[_0x5ca2('0x7c'),'id'])||{})['spread'](function(_0x1668fc){for(var _0xf317f7=0x0;_0xf317f7<_0x488565['body']['ids'][_0x5ca2('0x42')];_0xf317f7+=0x1){socket[_0x5ca2('0x7a')](_0x5ca2('0x7b'),{'UserId':_0x488565[_0x5ca2('0x57')]['ids'][_0xf317f7],'ChatQueueId':_0x488565[_0x5ca2('0x5c')]['id']});}return _0x1668fc;});}})['then'](respondWithResult(_0x2c784,null))[_0x5ca2('0x29')](handleError(_0x2c784,null));};exports[_0x5ca2('0x8e')]=function(_0x3619b4,_0x4cbcb8,_0x57f4f4){return db['ChatQueue'][_0x5ca2('0x55')]({'where':{'id':_0x3619b4[_0x5ca2('0x5c')]['id']}})[_0x5ca2('0x1e')](handleEntityNotFound(_0x4cbcb8,null))['then'](function(_0xb122b8){if(_0xb122b8){return _0xb122b8[_0x5ca2('0x8e')](_0x3619b4[_0x5ca2('0x3e')]['ids'])[_0x5ca2('0x1e')](function(){if(_[_0x5ca2('0x90')](_0x3619b4[_0x5ca2('0x3e')]['ids'])){for(var _0x3548a1=0x0;_0x3548a1<_0x3619b4[_0x5ca2('0x3e')]['ids'][_0x5ca2('0x42')];_0x3548a1+=0x1){socket[_0x5ca2('0x7a')](_0x5ca2('0x8f'),{'UserId':Number(_0x3619b4['query'][_0x5ca2('0x7c')][_0x3548a1]),'ChatQueueId':Number(_0x3619b4[_0x5ca2('0x5c')]['id'])});}}else{socket[_0x5ca2('0x7a')](_0x5ca2('0x8f'),{'UserId':Number(_0x3619b4[_0x5ca2('0x3e')][_0x5ca2('0x7c')]),'ChatQueueId':Number(_0x3619b4[_0x5ca2('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x4cbcb8,null))['catch'](handleError(_0x4cbcb8,null));};exports[_0x5ca2('0x91')]=function(_0x135452,_0x52bb13,_0x117e13){var _0x1379c6={};var _0x905c93={};var _0x2c902e;var _0xc66f6a;return db[_0x5ca2('0x51')]['findOne']({'where':{'id':_0x135452[_0x5ca2('0x5c')]['id']}})[_0x5ca2('0x1e')](handleEntityNotFound(_0x52bb13,null))[_0x5ca2('0x1e')](function(_0x2b7620){if(_0x2b7620){_0x2c902e=_0x2b7620;_0x905c93[_0x5ca2('0x3c')]=_[_0x5ca2('0x3d')](db[_0x5ca2('0x63')][_0x5ca2('0x3b')]);_0x905c93[_0x5ca2('0x3e')]=_['keys'](_0x135452['query']);_0x905c93[_0x5ca2('0x48')]=_[_0x5ca2('0x40')](_0x905c93[_0x5ca2('0x3c')],_0x905c93['query']);_0x1379c6[_0x5ca2('0x3f')]=_[_0x5ca2('0x40')](_0x905c93[_0x5ca2('0x3c')],qs[_0x5ca2('0x41')](_0x135452['query'][_0x5ca2('0x41')]));_0x1379c6[_0x5ca2('0x3f')]=_0x1379c6['attributes'][_0x5ca2('0x42')]?_0x1379c6[_0x5ca2('0x3f')]:_0x905c93['model'];_0x1379c6[_0x5ca2('0x45')]=qs[_0x5ca2('0x46')](_0x135452[_0x5ca2('0x3e')][_0x5ca2('0x46')]);_0x1379c6[_0x5ca2('0x47')]=qs['filters'](_[_0x5ca2('0x49')](_0x135452[_0x5ca2('0x3e')],_0x905c93[_0x5ca2('0x48')]));if(_0x135452[_0x5ca2('0x3e')][_0x5ca2('0x4a')]){_0x1379c6[_0x5ca2('0x47')]=_[_0x5ca2('0x4b')](_0x1379c6[_0x5ca2('0x47')],{'$or':_[_0x5ca2('0x4c')](_0x1379c6['attributes'],function(_0x332b84){var _0x44571f={};_0x44571f[_0x332b84]={'$like':'%'+_0x135452['query'][_0x5ca2('0x4a')]+'%'};return _0x44571f;})});}_0x1379c6=_[_0x5ca2('0x4b')]({},_0x1379c6,_0x135452[_0x5ca2('0x50')]);return _0x2c902e[_0x5ca2('0x91')](_0x1379c6);}})[_0x5ca2('0x1e')](function(_0x6b20d2){if(_0x6b20d2){_0xc66f6a=_0x6b20d2[_0x5ca2('0x42')];if(!_0x135452['query'][_0x5ca2('0x61')](_0x5ca2('0x43'))){_0x1379c6[_0x5ca2('0x44')]=qs[_0x5ca2('0x44')](_0x135452[_0x5ca2('0x3e')][_0x5ca2('0x44')]);_0x1379c6[_0x5ca2('0x2f')]=qs[_0x5ca2('0x2f')](_0x135452[_0x5ca2('0x3e')][_0x5ca2('0x2f')]);}return _0x2c902e[_0x5ca2('0x91')](_0x1379c6);}})[_0x5ca2('0x1e')](function(_0x33c849){if(_0x33c849){return _0x33c849?{'count':_0xc66f6a,'rows':_0x33c849}:null;}})[_0x5ca2('0x1e')](respondWithResult(_0x52bb13,null))['catch'](handleError(_0x52bb13,null));}; \ No newline at end of file +var _0x1dbd=['team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','./chatQueue.socket','register','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','offset','limit','Content-Range','json','apply','save','update','destroy','ChatQueues','UserProfileResource','status','stack','name','send','ChatQueue','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','rows','catch','show','params','include','create','body','user','get','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','ChatQueueId','map','UserChatQueue','findAll','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','getTeams','Team','addTeams','User','Agents','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','ids','select','from'];(function(_0x3672e6,_0x478b20){var _0x28df7d=function(_0x5e264d){while(--_0x5e264d){_0x3672e6['push'](_0x3672e6['shift']());}};_0x28df7d(++_0x478b20);}(_0x1dbd,0x1d6));var _0xd1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd1db('0x0'));var emlformat=require(_0xd1db('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd1db('0x2'));var jsonpatch=require(_0xd1db('0x3'));var rp=require(_0xd1db('0x4'));var moment=require(_0xd1db('0x5'));var BPromise=require(_0xd1db('0x6'));var Mustache=require(_0xd1db('0x7'));var util=require(_0xd1db('0x8'));var path=require(_0xd1db('0x9'));var sox=require('sox');var csv=require(_0xd1db('0xa'));var ejs=require(_0xd1db('0xb'));var fs=require('fs');var _=require(_0xd1db('0xc'));var squel=require(_0xd1db('0xd'));var crypto=require(_0xd1db('0xe'));var jsforce=require(_0xd1db('0xf'));var deskjs=require(_0xd1db('0x10'));var toCsv=require(_0xd1db('0xa'));var querystring=require(_0xd1db('0x11'));var Papa=require(_0xd1db('0x12'));var Redis=require(_0xd1db('0x13'));var authService=require(_0xd1db('0x14'));var qs=require(_0xd1db('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1db('0x16'))('api');var utils=require(_0xd1db('0x17'));var config=require(_0xd1db('0x18'));var db=require(_0xd1db('0x19'))['db'];config[_0xd1db('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd1db('0x1a')]));require(_0xd1db('0x1b'))[_0xd1db('0x1c')](socket);var jayson=require(_0xd1db('0x1d'));var client=jayson['client'][_0xd1db('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x558135,_0x3cf829,_0x474255){if(_0x474255){var _0xc58973=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc58973['test'](_0x3cf829)){return _0x558135;}else{throw new Error(_0xd1db('0x1f'));}}else{return _0x558135;}}function respondWithRpcPromise(_0x41f46b,_0x48971a,_0x4b4e6b,_0x4a6a88){return new BPromise(function(_0x42a3c7,_0x29c616){var _0x41e4c5=_0x4a6a88||client;return _0x41e4c5[_0xd1db('0x20')](_0x41f46b,_0x4b4e6b)[_0xd1db('0x21')](function(_0x540495){logger[_0xd1db('0x22')](_0xd1db('0x23'),_0x48971a,_0xd1db('0x24'));logger[_0xd1db('0x25')](_0xd1db('0x26'),_0x48971a,_0xd1db('0x24'),JSON[_0xd1db('0x27')](_0x540495));if(_0x540495['error']){if(_0x540495['error']['code']===0x1f4){logger[_0xd1db('0x28')](_0xd1db('0x23'),_0x48971a,_0x540495[_0xd1db('0x28')][_0xd1db('0x29')]);return _0x29c616(_0x540495[_0xd1db('0x28')]['message']);}logger['error'](_0xd1db('0x23'),_0x48971a,_0x540495[_0xd1db('0x28')][_0xd1db('0x29')]);return _0x42a3c7(_0x540495['error'][_0xd1db('0x29')]);}else{logger[_0xd1db('0x22')]('ChatQueue,\x20%s,\x20%s',_0x48971a,'request\x20sent');_0x42a3c7(_0x540495[_0xd1db('0x2a')]['message']);}})['catch'](function(_0x217476){logger[_0xd1db('0x28')]('ChatQueue,\x20%s,\x20%s',_0x48971a,_0x217476);_0x29c616(_0x217476);});});}function respondWithStatusCode(_0x459269,_0x52e329){_0x52e329=_0x52e329||0xcc;return function(_0x20bae8){if(_0x20bae8){return _0x459269[_0xd1db('0x2b')](_0x52e329);}return _0x459269['status'](_0x52e329)[_0xd1db('0x2c')]();};}function respondWithResult(_0x1889f9,_0x58a6f2){_0x58a6f2=_0x58a6f2||0xc8;return function(_0x4eab05){if(_0x4eab05){return _0x1889f9['status'](_0x58a6f2)['json'](_0x4eab05);}};}function respondWithFilteredResult(_0xd59617,_0x316184){return function(_0x548b64){if(_0x548b64){var _0x189bea=_0x548b64['count'],_0x24b14a=_0x316184[_0xd1db('0x2d')],_0x2c2d57=_0x316184[_0xd1db('0x2d')]+_0x316184[_0xd1db('0x2e')],_0x2611d1;if(_0x2c2d57>=_0x189bea){_0x2c2d57=_0x189bea;_0x2611d1=0xc8;}else{_0x2611d1=0xce;}_0xd59617['status'](_0x2611d1);return _0xd59617['set'](_0xd1db('0x2f'),_0x24b14a+'-'+_0x2c2d57+'/'+_0x189bea)[_0xd1db('0x30')](_0x548b64);}return null;};}function patchUpdates(_0x3d4319){return function(_0xbd219e){try{jsonpatch[_0xd1db('0x31')](_0xbd219e,_0x3d4319,!![]);}catch(_0x1e03cf){return BPromise['reject'](_0x1e03cf);}return _0xbd219e[_0xd1db('0x32')]();};}function saveUpdates(_0x573028,_0x85f87c){return function(_0x21d76a){if(_0x21d76a){return _0x21d76a[_0xd1db('0x33')](_0x573028)[_0xd1db('0x21')](function(_0x853066){return _0x853066;});}return null;};}function removeEntity(_0x3040e6,_0xa341ad){return function(_0x428019){if(_0x428019){return _0x428019[_0xd1db('0x34')]()[_0xd1db('0x21')](function(){var _0x121b6d=_0x428019['get']({'plain':!![]});var _0x5c3602=_0xd1db('0x35');return db[_0xd1db('0x36')][_0xd1db('0x34')]({'where':{'type':_0x5c3602,'resourceId':_0x121b6d['id']}})[_0xd1db('0x21')](function(){return _0x428019;});})[_0xd1db('0x21')](function(){_0x3040e6[_0xd1db('0x37')](0xcc)[_0xd1db('0x2c')]();});}};}function handleEntityNotFound(_0x35d15d,_0x433829){return function(_0x2c14a7){if(!_0x2c14a7){_0x35d15d['sendStatus'](0x194);}return _0x2c14a7;};}function handleError(_0x3aa706,_0x18f51e){_0x18f51e=_0x18f51e||0x1f4;return function(_0x3260ce){logger['error'](_0x3260ce[_0xd1db('0x38')]);if(_0x3260ce[_0xd1db('0x39')]){delete _0x3260ce['name'];}_0x3aa706[_0xd1db('0x37')](_0x18f51e)[_0xd1db('0x3a')](_0x3260ce);};}exports['index']=function(_0xb1d957,_0x4ecb72){var _0x5dbc67={},_0x3a2e59={},_0xed93f6={'count':0x0,'rows':[]};var _0x3e534f=db[_0xd1db('0x3b')][_0xd1db('0x3c')];_0x3a2e59[_0xd1db('0x3d')]=_['keys'](_0x3e534f);_0x3a2e59[_0xd1db('0x3e')]=_[_0xd1db('0x3f')](_0xb1d957['query']);_0x3a2e59['filters']=_[_0xd1db('0x40')](_0x3a2e59[_0xd1db('0x3d')],_0x3a2e59['query']);_0x5dbc67[_0xd1db('0x41')]=_[_0xd1db('0x40')](_0x3a2e59['model'],qs[_0xd1db('0x42')](_0xb1d957[_0xd1db('0x3e')][_0xd1db('0x42')]));_0x5dbc67[_0xd1db('0x41')]=_0x5dbc67[_0xd1db('0x41')][_0xd1db('0x43')]?_0x5dbc67['attributes']:_0x3a2e59[_0xd1db('0x3d')];if(!_0xb1d957['query'][_0xd1db('0x44')](_0xd1db('0x45'))){_0x5dbc67['limit']=qs[_0xd1db('0x2e')](_0xb1d957['query'][_0xd1db('0x2e')]);_0x5dbc67['offset']=qs['offset'](_0xb1d957[_0xd1db('0x3e')][_0xd1db('0x2d')]);}_0x5dbc67[_0xd1db('0x46')]=qs[_0xd1db('0x47')](_0xb1d957[_0xd1db('0x3e')][_0xd1db('0x47')]);_0x5dbc67[_0xd1db('0x48')]=qs[_0xd1db('0x49')](_[_0xd1db('0x4a')](_0xb1d957['query'],_0x3a2e59['filters']));if(_0xb1d957[_0xd1db('0x3e')][_0xd1db('0x4b')]){_0x5dbc67[_0xd1db('0x48')]=_[_0xd1db('0x4c')](_0x5dbc67[_0xd1db('0x48')],{'$or':_['map'](_0x3e534f,function(_0x2c5fe8){if(_0x2c5fe8[_0xd1db('0x4d')][_0xd1db('0x4e')]!==_0xd1db('0x4f')){var _0x221100={};_0x221100[_0x2c5fe8[_0xd1db('0x50')]]={'$like':'%'+_0xb1d957[_0xd1db('0x3e')][_0xd1db('0x4b')]+'%'};return _0x221100;}})});}_0x5dbc67=_[_0xd1db('0x4c')]({},_0x5dbc67,_0xb1d957[_0xd1db('0x51')]);var _0xcdf496={'where':_0x5dbc67[_0xd1db('0x48')]};return db[_0xd1db('0x3b')]['count'](_0xcdf496)[_0xd1db('0x21')](function(_0x4132f8){_0xed93f6[_0xd1db('0x52')]=_0x4132f8;if(_0xb1d957[_0xd1db('0x3e')][_0xd1db('0x53')]){_0x5dbc67['include']=[{'all':!![]}];}return db[_0xd1db('0x3b')]['findAll'](_0x5dbc67);})[_0xd1db('0x21')](function(_0x1e7ba1){_0xed93f6[_0xd1db('0x54')]=_0x1e7ba1;return _0xed93f6;})[_0xd1db('0x21')](respondWithFilteredResult(_0x4ecb72,_0x5dbc67))[_0xd1db('0x55')](handleError(_0x4ecb72,null));};exports[_0xd1db('0x56')]=function(_0x4bd3d3,_0x5dfd0d){var _0x401b67={'raw':!![],'where':{'id':_0x4bd3d3[_0xd1db('0x57')]['id']}},_0x1661b9={};_0x1661b9[_0xd1db('0x3d')]=_[_0xd1db('0x3f')](db[_0xd1db('0x3b')][_0xd1db('0x3c')]);_0x1661b9[_0xd1db('0x3e')]=_[_0xd1db('0x3f')](_0x4bd3d3[_0xd1db('0x3e')]);_0x1661b9[_0xd1db('0x49')]=_['intersection'](_0x1661b9[_0xd1db('0x3d')],_0x1661b9[_0xd1db('0x3e')]);_0x401b67[_0xd1db('0x41')]=_['intersection'](_0x1661b9['model'],qs[_0xd1db('0x42')](_0x4bd3d3[_0xd1db('0x3e')][_0xd1db('0x42')]));_0x401b67['attributes']=_0x401b67[_0xd1db('0x41')][_0xd1db('0x43')]?_0x401b67[_0xd1db('0x41')]:_0x1661b9[_0xd1db('0x3d')];if(_0x4bd3d3[_0xd1db('0x3e')][_0xd1db('0x53')]){_0x401b67[_0xd1db('0x58')]=[{'all':!![]}];}_0x401b67=_[_0xd1db('0x4c')]({},_0x401b67,_0x4bd3d3['options']);return db[_0xd1db('0x3b')]['find'](_0x401b67)['then'](handleEntityNotFound(_0x5dfd0d,null))['then'](respondWithResult(_0x5dfd0d,null))[_0xd1db('0x55')](handleError(_0x5dfd0d,null));};exports['create']=function(_0x1d5c6c,_0x208d65){return db[_0xd1db('0x3b')][_0xd1db('0x59')](_0x1d5c6c[_0xd1db('0x5a')],{})[_0xd1db('0x21')](function(_0x42bf){var _0x12265f=_0x1d5c6c[_0xd1db('0x5b')][_0xd1db('0x5c')]({'plain':!![]});if(!_0x12265f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12265f[_0xd1db('0x5d')]===_0xd1db('0x5b')){var _0x3d9799=_0x42bf[_0xd1db('0x5c')]({'plain':!![]});var _0x269cd2=_0xd1db('0x35');return db['UserProfileSection'][_0xd1db('0x5e')]({'where':{'name':_0x269cd2,'userProfileId':_0x12265f[_0xd1db('0x5f')]},'raw':!![]})['then'](function(_0x48ac70){if(_0x48ac70&&_0x48ac70['autoAssociation']===0x0){return db[_0xd1db('0x36')]['create']({'name':_0x3d9799[_0xd1db('0x39')],'resourceId':_0x3d9799['id'],'type':_0x48ac70['name'],'sectionId':_0x48ac70['id']},{})[_0xd1db('0x21')](function(){return _0x42bf;});}else{return _0x42bf;}})[_0xd1db('0x55')](function(_0x29d6c0){logger[_0xd1db('0x28')](_0xd1db('0x60'),_0x29d6c0);throw _0x29d6c0;});}return _0x42bf;})[_0xd1db('0x21')](respondWithResult(_0x208d65,0xc9))[_0xd1db('0x55')](handleError(_0x208d65,null));};exports[_0xd1db('0x33')]=function(_0x1380aa,_0x1d5579){if(_0x1380aa[_0xd1db('0x5a')]['id']){delete _0x1380aa['body']['id'];}return db[_0xd1db('0x3b')][_0xd1db('0x5e')]({'where':{'id':_0x1380aa['params']['id']}})['then'](handleEntityNotFound(_0x1d5579,null))[_0xd1db('0x21')](saveUpdates(_0x1380aa[_0xd1db('0x5a')],null))['then'](respondWithResult(_0x1d5579,null))[_0xd1db('0x55')](handleError(_0x1d5579,null));};exports[_0xd1db('0x34')]=function(_0x84ac77,_0x23d495){return db['ChatQueue'][_0xd1db('0x5e')]({'where':{'id':_0x84ac77[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](handleEntityNotFound(_0x23d495,null))[_0xd1db('0x21')](removeEntity(_0x23d495,null))[_0xd1db('0x55')](handleError(_0x23d495,null));};exports['describe']=function(_0x2fc9b3,_0xa7e7c){return db[_0xd1db('0x3b')]['describe']()[_0xd1db('0x21')](respondWithResult(_0xa7e7c,null))[_0xd1db('0x55')](handleError(_0xa7e7c,null));};exports[_0xd1db('0x61')]=function(_0x36a0a1,_0x7a4c8b,_0x308b60){var _0x446e19={'raw':!![],'where':{}},_0x94d795={},_0x2ced36;return db[_0xd1db('0x3b')][_0xd1db('0x62')]({'where':{'id':_0x36a0a1[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](handleEntityNotFound(_0x7a4c8b,null))[_0xd1db('0x21')](function(_0x56ec27){if(_0x56ec27){_0x2ced36=_0x56ec27[_0xd1db('0x5c')]({'plain':!![]});_0x94d795[_0xd1db('0x3d')]=_[_0xd1db('0x3f')](db['UserChatQueue'][_0xd1db('0x3c')]);_0x94d795[_0xd1db('0x3e')]=_[_0xd1db('0x3f')](_0x36a0a1[_0xd1db('0x3e')]);_0x94d795['filters']=_['intersection'](_0x94d795[_0xd1db('0x3d')],_0x94d795[_0xd1db('0x3e')]);_0x446e19[_0xd1db('0x41')]=_[_0xd1db('0x40')](_0x94d795['model'],qs[_0xd1db('0x42')](_0x36a0a1[_0xd1db('0x3e')][_0xd1db('0x42')]));_0x446e19[_0xd1db('0x41')]=_0x446e19[_0xd1db('0x41')][_0xd1db('0x43')]?_0x446e19[_0xd1db('0x41')]:_0x94d795[_0xd1db('0x3d')];if(!_0x36a0a1[_0xd1db('0x3e')][_0xd1db('0x44')](_0xd1db('0x45'))){_0x446e19[_0xd1db('0x2e')]=qs['limit'](_0x36a0a1[_0xd1db('0x3e')]['limit']);_0x446e19[_0xd1db('0x2d')]=qs[_0xd1db('0x2d')](_0x36a0a1[_0xd1db('0x3e')][_0xd1db('0x2d')]);}_0x446e19[_0xd1db('0x46')]=qs[_0xd1db('0x47')](_0x36a0a1[_0xd1db('0x3e')][_0xd1db('0x47')]);_0x446e19['where']=qs[_0xd1db('0x49')](_[_0xd1db('0x4a')](_0x36a0a1[_0xd1db('0x3e')],_0x94d795[_0xd1db('0x49')]));_0x446e19[_0xd1db('0x48')][_0xd1db('0x63')]=_0x56ec27['id'];if(_0x36a0a1[_0xd1db('0x3e')]['filter']){_0x446e19['where']=_['merge'](_0x446e19['where'],{'$or':_[_0xd1db('0x64')](_0x446e19[_0xd1db('0x41')],function(_0x12c17d){var _0x1c730a={};_0x1c730a[_0x12c17d]={'$like':'%'+_0x36a0a1[_0xd1db('0x3e')]['filter']+'%'};return _0x1c730a;})});}_0x446e19=_['merge']({},_0x446e19,_0x36a0a1['options']);return db[_0xd1db('0x65')][_0xd1db('0x66')](_0x446e19);}})[_0xd1db('0x21')](function(_0x18f809){if(_0x18f809){return db['User'][_0xd1db('0x67')]({'where':{'id':_[_0xd1db('0x64')](_0x18f809,'UserId'),'role':_0xd1db('0x68')},'attributes':['id',_0xd1db('0x39'),_0xd1db('0x69'),_0xd1db('0x6a'),_0xd1db('0x6b')]});}})[_0xd1db('0x21')](function(_0x735fc7){if(_0x735fc7){return{'count':_0x735fc7[_0xd1db('0x52')],'rows':_[_0xd1db('0x64')](_0x735fc7[_0xd1db('0x54')],function(_0x549cdb){return{'membername':_0x549cdb[_0xd1db('0x39')],'UserId':_0x549cdb['id'],'queue_name':_0x2ced36[_0xd1db('0x39')],'ChatQueueId':_0x2ced36['id'],'interface':util[_0xd1db('0x6c')]('%s/%s','SIP',_0x549cdb['name']),'penalty':0x0,'paused':_0x549cdb['chatPause'],'createdAt':_0x549cdb[_0xd1db('0x6b')],'updatedAt':_0x549cdb[_0xd1db('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd1db('0x21')](respondWithFilteredResult(_0x7a4c8b,_0x446e19))[_0xd1db('0x55')](handleError(_0x7a4c8b,null));};exports[_0xd1db('0x6d')]=function(_0x50355e,_0x4ac151,_0x2e96c5){var _0x512ba2={};var _0x32dfa7={};var _0x3220e2;var _0x15dcf4;return db[_0xd1db('0x3b')]['findOne']({'where':{'id':_0x50355e[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](handleEntityNotFound(_0x4ac151,null))[_0xd1db('0x21')](function(_0x276520){if(_0x276520){_0x3220e2=_0x276520;_0x32dfa7[_0xd1db('0x3d')]=_[_0xd1db('0x3f')](db[_0xd1db('0x6e')]['rawAttributes']);_0x32dfa7[_0xd1db('0x3e')]=_[_0xd1db('0x3f')](_0x50355e[_0xd1db('0x3e')]);_0x32dfa7[_0xd1db('0x49')]=_[_0xd1db('0x40')](_0x32dfa7[_0xd1db('0x3d')],_0x32dfa7[_0xd1db('0x3e')]);_0x512ba2[_0xd1db('0x41')]=_[_0xd1db('0x40')](_0x32dfa7['model'],qs['fields'](_0x50355e[_0xd1db('0x3e')]['fields']));_0x512ba2[_0xd1db('0x41')]=_0x512ba2[_0xd1db('0x41')][_0xd1db('0x43')]?_0x512ba2[_0xd1db('0x41')]:_0x32dfa7[_0xd1db('0x3d')];_0x512ba2[_0xd1db('0x46')]=qs[_0xd1db('0x47')](_0x50355e[_0xd1db('0x3e')]['sort']);_0x512ba2[_0xd1db('0x48')]=qs[_0xd1db('0x49')](_[_0xd1db('0x4a')](_0x50355e['query'],_0x32dfa7['filters']));if(_0x50355e[_0xd1db('0x3e')][_0xd1db('0x4b')]){_0x512ba2[_0xd1db('0x48')]=_[_0xd1db('0x4c')](_0x512ba2['where'],{'$or':_[_0xd1db('0x64')](_0x512ba2[_0xd1db('0x41')],function(_0x2eed67){var _0x55ad94={};_0x55ad94[_0x2eed67]={'$like':'%'+_0x50355e[_0xd1db('0x3e')][_0xd1db('0x4b')]+'%'};return _0x55ad94;})});}_0x512ba2=_[_0xd1db('0x4c')]({},_0x512ba2,_0x50355e[_0xd1db('0x51')]);return _0x3220e2[_0xd1db('0x6d')](_0x512ba2);}})['then'](function(_0x4db327){if(_0x4db327){_0x15dcf4=_0x4db327[_0xd1db('0x43')];if(!_0x50355e[_0xd1db('0x3e')][_0xd1db('0x44')](_0xd1db('0x45'))){_0x512ba2[_0xd1db('0x2e')]=qs[_0xd1db('0x2e')](_0x50355e[_0xd1db('0x3e')][_0xd1db('0x2e')]);_0x512ba2[_0xd1db('0x2d')]=qs[_0xd1db('0x2d')](_0x50355e[_0xd1db('0x3e')][_0xd1db('0x2d')]);}return _0x3220e2[_0xd1db('0x6d')](_0x512ba2);}})[_0xd1db('0x21')](function(_0x3fac00){if(_0x3fac00){return _0x3fac00?{'count':_0x15dcf4,'rows':_0x3fac00}:null;}})[_0xd1db('0x21')](respondWithResult(_0x4ac151,null))[_0xd1db('0x55')](handleError(_0x4ac151,null));};exports[_0xd1db('0x6f')]=function(_0x50fe79,_0x53e755,_0xf6edfd){var _0x3e00f3=_0x50fe79['body']['teams'];return db[_0xd1db('0x6e')][_0xd1db('0x66')]({'where':{'id':_['map'](_0x3e00f3,'id')},'attributes':['id'],'include':[{'model':db[_0xd1db('0x70')],'as':_0xd1db('0x71'),'attributes':['id',_0xd1db('0x39'),'online',_0xd1db('0x72'),_0xd1db('0x73')],'raw':!![]}]})[_0xd1db('0x21')](function(_0xa8f59){if(_0xa8f59){var _0x3117d3=_[_0xd1db('0x74')](_0xa8f59,function(_0x1deb69){var _0x47ed51=_0x1deb69[_0xd1db('0x5c')]({'plain':!![]});return _0x47ed51[_0xd1db('0x71')];});return db['ChatQueue'][_0xd1db('0x5e')]({'where':{'id':_0x50fe79[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](function(_0x2d4c54){return db['sequelize'][_0xd1db('0x75')](function(_0x70007c){return _0x2d4c54['addTeams'](_[_0xd1db('0x64')](_0x3e00f3,'id'),{'transaction':_0x70007c})[_0xd1db('0x21')](function(){return BPromise[_0xd1db('0x76')](_0x3117d3,function(_0x2c0395){return db[_0xd1db('0x65')][_0xd1db('0x77')]({'where':{'UserId':_0x2c0395['id'],'ChatQueueId':_0x50fe79[_0xd1db('0x57')]['id']},'transaction':_0x70007c});});})[_0xd1db('0x21')](function(){_0x3117d3[_0xd1db('0x78')](function(_0x1b0c77){socket['emit'](_0xd1db('0x79'),{'UserId':_0x1b0c77['id'],'ChatQueueId':_0x2d4c54['id']});});});});});}})['then'](respondWithStatusCode(_0x53e755,null))[_0xd1db('0x55')](handleError(_0x53e755,null));};exports[_0xd1db('0x7a')]=function(_0x409d74,_0x409958,_0x2a2e32){return db[_0xd1db('0x6e')][_0xd1db('0x66')]({'where':{'id':_0x409d74[_0xd1db('0x3e')][_0xd1db('0x7b')]},'attributes':['id'],'include':[{'model':db[_0xd1db('0x70')],'as':_0xd1db('0x71'),'attributes':['id'],'raw':!![]}]})[_0xd1db('0x21')](handleEntityNotFound(_0x409958,null))['then'](function(_0x3efa99){var _0x220cb3=_[_0xd1db('0x64')](_0x3efa99,'id');var _0x5572fc=[];var _0x2a6539=[];var _0xfc8dcf=squel[_0xd1db('0x7c')]();_0xfc8dcf[_0xd1db('0x50')]('tq.TeamId')[_0xd1db('0x7d')](_0xd1db('0x7e'),'tq')[_0xd1db('0x7f')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd1db('0x80'),_0x409d74[_0xd1db('0x57')]['id']);for(var _0x14eb7d=0x0;_0x14eb7d<_0x3efa99['length'];_0x14eb7d+=0x1){let _0x939666=_0x3efa99[_0x14eb7d];for(var _0x384639=0x0;_0x384639<_0x939666[_0xd1db('0x71')]['length'];_0x384639+=0x1){let _0x2d987a=_0x939666[_0xd1db('0x71')][_0x384639];var _0x32611f=_0xfc8dcf[_0xd1db('0x81')]();_0x32611f['where'](_0xd1db('0x82'),_0x2d987a['id']);_0x2a6539[_0xd1db('0x83')](db[_0xd1db('0x84')][_0xd1db('0x3e')](_0x32611f[_0xd1db('0x85')](),{'type':db[_0xd1db('0x84')][_0xd1db('0x86')][_0xd1db('0x87')]})[_0xd1db('0x21')](function(_0x4aa0f2){if(_0x4aa0f2['length']===0x1){return _0x2d987a['id'];}else{var _0x150a5e=_[_0xd1db('0x88')](_[_0xd1db('0x64')](_0x4aa0f2,_0xd1db('0x89')),function(_0x2a3dd7){return _[_0xd1db('0x8a')](_0x220cb3,_0x2a3dd7);});if(_0x150a5e){return _0x2d987a['id'];}}}));}}return BPromise['all'](_0x2a6539)[_0xd1db('0x21')](function(_0x585ac6){_0x5572fc=_(_0x5572fc)['union'](_0x585ac6)[_0xd1db('0x8b')]()[_0xd1db('0x8c')]();return db[_0xd1db('0x3b')][_0xd1db('0x5e')]({'where':{'id':_0x409d74[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](function(_0x3b22c1){return db[_0xd1db('0x84')]['transaction'](function(_0x52fe46){return _0x3b22c1[_0xd1db('0x7a')](_0x409d74['query']['ids'],{'transaction':_0x52fe46})[_0xd1db('0x21')](function(){if(!_['isEmpty'](_0x5572fc)){return _0x3b22c1['removeAgents'](_0x5572fc,{'transaction':_0x52fe46});}})[_0xd1db('0x21')](function(){_0x5572fc[_0xd1db('0x78')](function(_0x14b280){socket[_0xd1db('0x8d')](_0xd1db('0x8e'),{'UserId':_0x14b280,'ChatQueueId':_0x3b22c1['id']});});});});});});})[_0xd1db('0x21')](respondWithStatusCode(_0x409958,null))[_0xd1db('0x55')](handleError(_0x409958,null));};exports[_0xd1db('0x8f')]=function(_0x2c5549,_0x1df74e,_0xbed71){return db[_0xd1db('0x3b')][_0xd1db('0x5e')]({'where':{'id':_0x2c5549[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](handleEntityNotFound(_0x1df74e,null))[_0xd1db('0x21')](function(_0x159825){if(_0x159825){return _0x159825[_0xd1db('0x8f')](_0x2c5549[_0xd1db('0x5a')][_0xd1db('0x7b')],_[_0xd1db('0x90')](_0x2c5549[_0xd1db('0x5a')],[_0xd1db('0x7b'),'id'])||{})[_0xd1db('0x91')](function(_0x227547){for(var _0x169311=0x0;_0x169311<_0x2c5549[_0xd1db('0x5a')][_0xd1db('0x7b')]['length'];_0x169311+=0x1){socket[_0xd1db('0x8d')](_0xd1db('0x79'),{'UserId':_0x2c5549[_0xd1db('0x5a')]['ids'][_0x169311],'ChatQueueId':_0x2c5549[_0xd1db('0x57')]['id']});}return _0x227547;});}})['then'](respondWithResult(_0x1df74e,null))['catch'](handleError(_0x1df74e,null));};exports[_0xd1db('0x92')]=function(_0x2842e3,_0xff531c,_0x11c03a){return db[_0xd1db('0x3b')]['find']({'where':{'id':_0x2842e3[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](handleEntityNotFound(_0xff531c,null))[_0xd1db('0x21')](function(_0x504000){if(_0x504000){return _0x504000[_0xd1db('0x92')](_0x2842e3['query'][_0xd1db('0x7b')])[_0xd1db('0x21')](function(){if(_[_0xd1db('0x93')](_0x2842e3[_0xd1db('0x3e')][_0xd1db('0x7b')])){for(var _0x55c2fc=0x0;_0x55c2fc<_0x2842e3['query'][_0xd1db('0x7b')][_0xd1db('0x43')];_0x55c2fc+=0x1){socket[_0xd1db('0x8d')]('userChatQueue:remove',{'UserId':Number(_0x2842e3[_0xd1db('0x3e')]['ids'][_0x55c2fc]),'ChatQueueId':Number(_0x2842e3[_0xd1db('0x57')]['id'])});}}else{socket[_0xd1db('0x8d')](_0xd1db('0x8e'),{'UserId':Number(_0x2842e3[_0xd1db('0x3e')]['ids']),'ChatQueueId':Number(_0x2842e3[_0xd1db('0x57')]['id'])});}});}})[_0xd1db('0x21')](respondWithStatusCode(_0xff531c,null))[_0xd1db('0x55')](handleError(_0xff531c,null));};exports['getAgents']=function(_0x2b4932,_0x292b06,_0x2219b2){var _0x1ee99a={};var _0x107537={};var _0x2ec952;var _0x26207b;return db[_0xd1db('0x3b')][_0xd1db('0x62')]({'where':{'id':_0x2b4932[_0xd1db('0x57')]['id']}})[_0xd1db('0x21')](handleEntityNotFound(_0x292b06,null))['then'](function(_0x23b63d){if(_0x23b63d){_0x2ec952=_0x23b63d;_0x107537[_0xd1db('0x3d')]=_[_0xd1db('0x3f')](db['User'][_0xd1db('0x3c')]);_0x107537[_0xd1db('0x3e')]=_['keys'](_0x2b4932[_0xd1db('0x3e')]);_0x107537[_0xd1db('0x49')]=_[_0xd1db('0x40')](_0x107537['model'],_0x107537[_0xd1db('0x3e')]);_0x1ee99a['attributes']=_['intersection'](_0x107537[_0xd1db('0x3d')],qs[_0xd1db('0x42')](_0x2b4932['query'][_0xd1db('0x42')]));_0x1ee99a[_0xd1db('0x41')]=_0x1ee99a[_0xd1db('0x41')][_0xd1db('0x43')]?_0x1ee99a[_0xd1db('0x41')]:_0x107537[_0xd1db('0x3d')];_0x1ee99a[_0xd1db('0x46')]=qs[_0xd1db('0x47')](_0x2b4932[_0xd1db('0x3e')]['sort']);_0x1ee99a[_0xd1db('0x48')]=qs['filters'](_['pick'](_0x2b4932[_0xd1db('0x3e')],_0x107537[_0xd1db('0x49')]));if(_0x2b4932[_0xd1db('0x3e')]['filter']){_0x1ee99a['where']=_[_0xd1db('0x4c')](_0x1ee99a[_0xd1db('0x48')],{'$or':_[_0xd1db('0x64')](_0x1ee99a[_0xd1db('0x41')],function(_0x4cce29){var _0xf1a5cb={};_0xf1a5cb[_0x4cce29]={'$like':'%'+_0x2b4932[_0xd1db('0x3e')]['filter']+'%'};return _0xf1a5cb;})});}_0x1ee99a=_['merge']({},_0x1ee99a,_0x2b4932[_0xd1db('0x51')]);return _0x2ec952[_0xd1db('0x94')](_0x1ee99a);}})[_0xd1db('0x21')](function(_0x1d0f71){if(_0x1d0f71){_0x26207b=_0x1d0f71[_0xd1db('0x43')];if(!_0x2b4932[_0xd1db('0x3e')][_0xd1db('0x44')](_0xd1db('0x45'))){_0x1ee99a[_0xd1db('0x2e')]=qs[_0xd1db('0x2e')](_0x2b4932['query'][_0xd1db('0x2e')]);_0x1ee99a[_0xd1db('0x2d')]=qs['offset'](_0x2b4932['query'][_0xd1db('0x2d')]);}return _0x2ec952[_0xd1db('0x94')](_0x1ee99a);}})[_0xd1db('0x21')](function(_0x33d7a3){if(_0x33d7a3){return _0x33d7a3?{'count':_0x26207b,'rows':_0x33d7a3}:null;}})[_0xd1db('0x21')](respondWithResult(_0x292b06,null))[_0xd1db('0x55')](handleError(_0x292b06,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 586c0ab..0f0448c 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 _0x16d2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x3b64ae,_0x2c4e93){var _0x1506b8=function(_0x2591d7){while(--_0x2591d7){_0x3b64ae['push'](_0x3b64ae['shift']());}};_0x1506b8(++_0x2c4e93);}(_0x16d2,0x123));var _0x216d=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0x16d2[_0x3fcc20];return _0x15d3ce;};'use strict';var EventEmitter=require(_0x216d('0x0'));var ChatQueue=require(_0x216d('0x1'))['db'][_0x216d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x216d('0x3')](0x0);var events={'afterCreate':_0x216d('0x4'),'afterUpdate':_0x216d('0x5'),'afterDestroy':_0x216d('0x6')};function emitEvent(_0x239b49){return function(_0xfd7306,_0x593bb0,_0x2c662d){ChatQueueEvents[_0x216d('0x7')](_0x239b49+':'+_0xfd7306['id'],_0xfd7306);ChatQueueEvents[_0x216d('0x7')](_0x239b49,_0xfd7306);_0x2c662d(null);};}for(var e in events){if(events[_0x216d('0x8')](e)){var event=events[e];ChatQueue[_0x216d('0x9')](e,emitEvent(event));}}module[_0x216d('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x59d1e5,_0x205e67){var _0x4960ed=function(_0x5eb110){while(--_0x5eb110){_0x59d1e5['push'](_0x59d1e5['shift']());}};_0x4960ed(++_0x205e67);}(_0x13f6,0x124));var _0x613f=function(_0x58b99a,_0x4526e0){_0x58b99a=_0x58b99a-0x0;var _0x1e28e7=_0x13f6[_0x58b99a];return _0x1e28e7;};'use strict';var EventEmitter=require(_0x613f('0x0'));var ChatQueue=require(_0x613f('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){ChatQueueEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);ChatQueueEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('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 6d3c8db..25ea2a2 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 _0x7c59=['moment','request-promise','path','./chatQueue.attributes','exports','define','chat_queues','util','../../config/logger','api'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7c59,0x147));var _0x97c5=function(_0x36c6f4,_0x156cd5){_0x36c6f4=_0x36c6f4-0x0;var _0xd6b8bf=_0x7c59[_0x36c6f4];return _0xd6b8bf;};'use strict';var _=require('lodash');var util=require(_0x97c5('0x0'));var logger=require(_0x97c5('0x1'))(_0x97c5('0x2'));var moment=require(_0x97c5('0x3'));var BPromise=require('bluebird');var rp=require(_0x97c5('0x4'));var fs=require('fs');var path=require(_0x97c5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x97c5('0x6'));module[_0x97c5('0x7')]=function(_0x29832f,_0xb7c5e1){return _0x29832f[_0x97c5('0x8')]('ChatQueue',attributes,{'tableName':_0x97c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc686=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','../../config/logger','moment'];(function(_0x9a90fb,_0x414e44){var _0x47e648=function(_0x5db283){while(--_0x5db283){_0x9a90fb['push'](_0x9a90fb['shift']());}};_0x47e648(++_0x414e44);}(_0xc686,0x148));var _0x6c68=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xc686[_0x484e36];return _0xafc85d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6c68('0x0'))('api');var moment=require(_0x6c68('0x1'));var BPromise=require('bluebird');var rp=require(_0x6c68('0x2'));var fs=require('fs');var path=require(_0x6c68('0x3'));var rimraf=require(_0x6c68('0x4'));var config=require(_0x6c68('0x5'));var attributes=require(_0x6c68('0x6'));module[_0x6c68('0x7')]=function(_0x1c1b02,_0x2d5dda){return _0x1c1b02[_0x6c68('0x8')](_0x6c68('0x9'),attributes,{'tableName':_0x6c68('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 91cde43..4ef5489 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 _0x7706=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x7706,0x11a));var _0x6770=function(_0x2cc247,_0x17acb8){_0x2cc247=_0x2cc247-0x0;var _0x513ed5=_0x7706[_0x2cc247];return _0x513ed5;};'use strict';var _=require(_0x6770('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6770('0x1'));var fs=require('fs');var Redis=require(_0x6770('0x2'));var db=require(_0x6770('0x3'))['db'];var utils=require(_0x6770('0x4'));var logger=require('../../config/logger')(_0x6770('0x5'));var config=require(_0x6770('0x6'));var jayson=require(_0x6770('0x7'));var client=jayson[_0x6770('0x8')]['http']({'port':0x232a});config['redis']=_[_0x6770('0x9')](config[_0x6770('0xa')],{'host':_0x6770('0xb'),'port':0x18eb});var socket=require(_0x6770('0xc'))(new Redis(config[_0x6770('0xa')]));require(_0x6770('0xd'))[_0x6770('0xe')](socket);function respondWithRpcPromise(_0x533280,_0x558b36,_0x3711a0){return new BPromise(function(_0x5e718e,_0xa2e2c3){return client[_0x6770('0xf')](_0x533280,_0x3711a0)[_0x6770('0x10')](function(_0x384434){logger['info'](_0x6770('0x11'),_0x558b36,_0x6770('0x12'));logger[_0x6770('0x13')](_0x6770('0x14'),_0x558b36,_0x6770('0x12'),JSON[_0x6770('0x15')](_0x384434));if(_0x384434['error']){if(_0x384434[_0x6770('0x16')][_0x6770('0x17')]===0x1f4){logger[_0x6770('0x16')](_0x6770('0x11'),_0x558b36,_0x384434['error']['message']);return _0xa2e2c3(_0x384434['error'][_0x6770('0x18')]);}logger[_0x6770('0x16')](_0x6770('0x11'),_0x558b36,_0x384434['error']['message']);return _0x5e718e(_0x384434['error']['message']);}else{logger[_0x6770('0x19')](_0x6770('0x11'),_0x558b36,_0x6770('0x12'));_0x5e718e(_0x384434[_0x6770('0x1a')][_0x6770('0x18')]);}})[_0x6770('0x1b')](function(_0x2d23ef){logger[_0x6770('0x16')](_0x6770('0x11'),_0x558b36,_0x2d23ef);_0xa2e2c3(_0x2d23ef);});});}exports[_0x6770('0x1c')]=function(_0x47a1fc){var _0x4c5e8c=this;return new Promise(function(_0x53b053,_0x152654){return db['ChatQueue'][_0x6770('0x1d')]({'raw':_0x47a1fc[_0x6770('0x1e')]?_0x47a1fc['options']['raw']===undefined?!![]:![]:!![],'where':_0x47a1fc['options']?_0x47a1fc[_0x6770('0x1e')][_0x6770('0x1f')]||null:null,'attributes':_0x47a1fc[_0x6770('0x1e')]?_0x47a1fc[_0x6770('0x1e')][_0x6770('0x20')]||null:null,'limit':_0x47a1fc[_0x6770('0x1e')]?_0x47a1fc[_0x6770('0x1e')][_0x6770('0x21')]||null:null,'include':_0x47a1fc[_0x6770('0x1e')]?_0x47a1fc['options'][_0x6770('0x22')]?_[_0x6770('0x23')](_0x47a1fc['options'][_0x6770('0x22')],function(_0x1ddd31){return{'model':db[_0x1ddd31[_0x6770('0x24')]],'as':_0x1ddd31['as'],'attributes':_0x1ddd31[_0x6770('0x20')],'include':_0x1ddd31[_0x6770('0x22')]?_['map'](_0x1ddd31['include'],function(_0x1a7142){return{'model':db[_0x1a7142[_0x6770('0x24')]],'as':_0x1a7142['as'],'attributes':_0x1a7142[_0x6770('0x20')],'include':_0x1a7142['include']?_[_0x6770('0x23')](_0x1a7142[_0x6770('0x22')],function(_0x5c7305){return{'model':db[_0x5c7305[_0x6770('0x24')]],'as':_0x5c7305['as'],'attributes':_0x5c7305[_0x6770('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6770('0x10')](function(_0x5e0f00){logger[_0x6770('0x19')](_0x6770('0x1c'),_0x47a1fc);logger['debug'](_0x6770('0x1c'),_0x47a1fc,JSON[_0x6770('0x15')](_0x5e0f00));_0x53b053(_0x5e0f00);})[_0x6770('0x1b')](function(_0x33e8db){logger[_0x6770('0x16')](_0x6770('0x1c'),_0x33e8db[_0x6770('0x18')],_0x47a1fc);_0x152654(_0x4c5e8c[_0x6770('0x16')](0x1f4,_0x33e8db[_0x6770('0x18')]));});});};exports[_0x6770('0x25')]=function(_0x1702f7){var _0x1a0ea6=this;return new Promise(function(_0x398311,_0x506bc1){return db[_0x6770('0x26')][_0x6770('0x27')]({'raw':_0x1702f7[_0x6770('0x1e')]?_0x1702f7['options'][_0x6770('0x28')]===undefined?!![]:![]:!![],'where':_0x1702f7[_0x6770('0x1e')]?_0x1702f7['options'][_0x6770('0x1f')]||null:null,'attributes':_0x1702f7['options']?_0x1702f7[_0x6770('0x1e')]['attributes']||null:null,'include':_0x1702f7[_0x6770('0x1e')]?_0x1702f7['options'][_0x6770('0x22')]?_['map'](_0x1702f7[_0x6770('0x1e')][_0x6770('0x22')],function(_0x106c47){return{'model':db[_0x106c47['model']],'as':_0x106c47['as'],'attributes':_0x106c47[_0x6770('0x20')],'include':_0x106c47[_0x6770('0x22')]?_['map'](_0x106c47[_0x6770('0x22')],function(_0x6adec5){return{'model':db[_0x6adec5[_0x6770('0x24')]],'as':_0x6adec5['as'],'attributes':_0x6adec5[_0x6770('0x20')],'include':_0x6adec5['include']?_[_0x6770('0x23')](_0x6adec5['include'],function(_0xaa75d6){return{'model':db[_0xaa75d6['model']],'as':_0xaa75d6['as'],'attributes':_0xaa75d6[_0x6770('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6770('0x10')](function(_0x10a0d8){logger[_0x6770('0x19')](_0x6770('0x25'),_0x1702f7);logger[_0x6770('0x13')](_0x6770('0x25'),_0x1702f7,JSON[_0x6770('0x15')](_0x10a0d8));_0x398311(_0x10a0d8);})[_0x6770('0x1b')](function(_0x17d14d){logger['error'](_0x6770('0x25'),_0x17d14d[_0x6770('0x18')],_0x1702f7);_0x506bc1(_0x1a0ea6[_0x6770('0x16')](0x1f4,_0x17d14d[_0x6770('0x18')]));});});}; \ No newline at end of file +var _0x6d77=['model','stringify','ShowChatQueue','ChatQueue','find','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0xc0e82b,_0xde63d4){var _0x3dcad6=function(_0x12580){while(--_0x12580){_0xc0e82b['push'](_0xc0e82b['shift']());}};_0x3dcad6(++_0xde63d4);}(_0x6d77,0x13d));var _0x76d7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d77[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x76d7('0x0'));var util=require(_0x76d7('0x1'));var moment=require(_0x76d7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76d7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76d7('0x4'))(_0x76d7('0x5'));var config=require(_0x76d7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x76d7('0x7')]({'port':0x232a});config['redis']=_[_0x76d7('0x8')](config[_0x76d7('0x9')],{'host':_0x76d7('0xa'),'port':0x18eb});var socket=require(_0x76d7('0xb'))(new Redis(config[_0x76d7('0x9')]));require(_0x76d7('0xc'))[_0x76d7('0xd')](socket);function respondWithRpcPromise(_0x2f26e1,_0x2bde7e,_0x5dfab9){return new BPromise(function(_0x5b46aa,_0x32db1){return client['request'](_0x2f26e1,_0x5dfab9)[_0x76d7('0xe')](function(_0x3cefe6){logger['info'](_0x76d7('0xf'),_0x2bde7e,'request\x20sent');logger[_0x76d7('0x10')](_0x76d7('0x11'),_0x2bde7e,_0x76d7('0x12'),JSON['stringify'](_0x3cefe6));if(_0x3cefe6['error']){if(_0x3cefe6[_0x76d7('0x13')][_0x76d7('0x14')]===0x1f4){logger[_0x76d7('0x13')](_0x76d7('0xf'),_0x2bde7e,_0x3cefe6['error']['message']);return _0x32db1(_0x3cefe6[_0x76d7('0x13')][_0x76d7('0x15')]);}logger[_0x76d7('0x13')](_0x76d7('0xf'),_0x2bde7e,_0x3cefe6[_0x76d7('0x13')][_0x76d7('0x15')]);return _0x5b46aa(_0x3cefe6[_0x76d7('0x13')][_0x76d7('0x15')]);}else{logger[_0x76d7('0x16')](_0x76d7('0xf'),_0x2bde7e,'request\x20sent');_0x5b46aa(_0x3cefe6[_0x76d7('0x17')]['message']);}})[_0x76d7('0x18')](function(_0x4c9c89){logger['error'](_0x76d7('0xf'),_0x2bde7e,_0x4c9c89);_0x32db1(_0x4c9c89);});});}exports[_0x76d7('0x19')]=function(_0x8278a6){var _0x3cfe20=this;return new Promise(function(_0x39c1ec,_0x2719d1){return db['ChatQueue'][_0x76d7('0x1a')]({'raw':_0x8278a6[_0x76d7('0x1b')]?_0x8278a6[_0x76d7('0x1b')][_0x76d7('0x1c')]===undefined?!![]:![]:!![],'where':_0x8278a6[_0x76d7('0x1b')]?_0x8278a6[_0x76d7('0x1b')][_0x76d7('0x1d')]||null:null,'attributes':_0x8278a6[_0x76d7('0x1b')]?_0x8278a6['options'][_0x76d7('0x1e')]||null:null,'limit':_0x8278a6[_0x76d7('0x1b')]?_0x8278a6[_0x76d7('0x1b')][_0x76d7('0x1f')]||null:null,'include':_0x8278a6['options']?_0x8278a6[_0x76d7('0x1b')][_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x8278a6[_0x76d7('0x1b')][_0x76d7('0x20')],function(_0x1e3ec5){return{'model':db[_0x1e3ec5[_0x76d7('0x22')]],'as':_0x1e3ec5['as'],'attributes':_0x1e3ec5[_0x76d7('0x1e')],'include':_0x1e3ec5['include']?_[_0x76d7('0x21')](_0x1e3ec5[_0x76d7('0x20')],function(_0x4a8a57){return{'model':db[_0x4a8a57[_0x76d7('0x22')]],'as':_0x4a8a57['as'],'attributes':_0x4a8a57['attributes'],'include':_0x4a8a57['include']?_[_0x76d7('0x21')](_0x4a8a57['include'],function(_0x3bfc62){return{'model':db[_0x3bfc62[_0x76d7('0x22')]],'as':_0x3bfc62['as'],'attributes':_0x3bfc62['attributes']};}):[]};}):[]};}):[]:[]})[_0x76d7('0xe')](function(_0x101131){logger[_0x76d7('0x16')](_0x76d7('0x19'),_0x8278a6);logger[_0x76d7('0x10')]('GetChatQueue',_0x8278a6,JSON[_0x76d7('0x23')](_0x101131));_0x39c1ec(_0x101131);})[_0x76d7('0x18')](function(_0x55a06b){logger[_0x76d7('0x13')]('GetChatQueue',_0x55a06b[_0x76d7('0x15')],_0x8278a6);_0x2719d1(_0x3cfe20[_0x76d7('0x13')](0x1f4,_0x55a06b[_0x76d7('0x15')]));});});};exports[_0x76d7('0x24')]=function(_0x89569b){var _0xf6ad5a=this;return new Promise(function(_0xf3fa9e,_0x47e129){return db[_0x76d7('0x25')][_0x76d7('0x26')]({'raw':_0x89569b[_0x76d7('0x1b')]?_0x89569b[_0x76d7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x89569b[_0x76d7('0x1b')]?_0x89569b['options'][_0x76d7('0x1d')]||null:null,'attributes':_0x89569b[_0x76d7('0x1b')]?_0x89569b[_0x76d7('0x1b')][_0x76d7('0x1e')]||null:null,'include':_0x89569b[_0x76d7('0x1b')]?_0x89569b['options'][_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x89569b[_0x76d7('0x1b')]['include'],function(_0x17146b){return{'model':db[_0x17146b[_0x76d7('0x22')]],'as':_0x17146b['as'],'attributes':_0x17146b[_0x76d7('0x1e')],'include':_0x17146b[_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x17146b[_0x76d7('0x20')],function(_0x24a347){return{'model':db[_0x24a347['model']],'as':_0x24a347['as'],'attributes':_0x24a347[_0x76d7('0x1e')],'include':_0x24a347[_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x24a347[_0x76d7('0x20')],function(_0x284dfc){return{'model':db[_0x284dfc[_0x76d7('0x22')]],'as':_0x284dfc['as'],'attributes':_0x284dfc[_0x76d7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1688e8){logger[_0x76d7('0x16')](_0x76d7('0x24'),_0x89569b);logger['debug'](_0x76d7('0x24'),_0x89569b,JSON[_0x76d7('0x23')](_0x1688e8));_0xf3fa9e(_0x1688e8);})[_0x76d7('0x18')](function(_0x262d8a){logger['error'](_0x76d7('0x24'),_0x262d8a[_0x76d7('0x15')],_0x89569b);_0x47e129(_0xf6ad5a['error'](0x1f4,_0x262d8a['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9bf8ed5..ac61189 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 0ffc272..2750ccb 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 _0x09ce=['getTeams','/:id/users','post','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams'];(function(_0xc1b34b,_0x1119ae){var _0x4481e9=function(_0x2acab1){while(--_0x2acab1){_0xc1b34b['push'](_0xc1b34b['shift']());}};_0x4481e9(++_0x1119ae);}(_0x09ce,0x172));var _0xe09c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x09ce[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xe09c('0x0'));var util=require(_0xe09c('0x1'));var path=require('path');var timeout=require(_0xe09c('0x2'));var express=require('express');var router=express[_0xe09c('0x3')]();var auth=require(_0xe09c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueue.controller');router[_0xe09c('0x5')]('/',auth[_0xe09c('0x6')](),controller[_0xe09c('0x7')]);router[_0xe09c('0x5')](_0xe09c('0x8'),auth[_0xe09c('0x6')](),controller[_0xe09c('0x9')]);router['get'](_0xe09c('0xa'),auth['isAuthenticated'](),controller[_0xe09c('0xb')]);router[_0xe09c('0x5')](_0xe09c('0xc'),auth[_0xe09c('0x6')](),controller['getMembers']);router['get'](_0xe09c('0xd'),auth[_0xe09c('0x6')](),controller[_0xe09c('0xe')]);router[_0xe09c('0x5')](_0xe09c('0xf'),auth[_0xe09c('0x6')](),controller['getAgents']);router[_0xe09c('0x10')]('/',auth[_0xe09c('0x6')](),controller['create']);router[_0xe09c('0x10')](_0xe09c('0xd'),auth[_0xe09c('0x6')](),controller[_0xe09c('0x11')]);router['post'](_0xe09c('0xf'),auth[_0xe09c('0x6')](),controller[_0xe09c('0x12')]);router[_0xe09c('0x13')]('/:id',auth[_0xe09c('0x6')](),controller['update']);router[_0xe09c('0x14')](_0xe09c('0xa'),auth['isAuthenticated'](),controller[_0xe09c('0x15')]);router[_0xe09c('0x14')](_0xe09c('0xd'),auth[_0xe09c('0x6')](),controller[_0xe09c('0x16')]);router[_0xe09c('0x14')](_0xe09c('0xf'),auth[_0xe09c('0x6')](),controller[_0xe09c('0x17')]);module['exports']=router; \ No newline at end of file +var _0x9032=['/describe','describe','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','/:id','destroy','delete','removeTeams','removeAgents','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2db23b,_0x33e1b2){var _0x9975b8=function(_0x4c2ae8){while(--_0x4c2ae8){_0x2db23b['push'](_0x2db23b['shift']());}};_0x9975b8(++_0x33e1b2);}(_0x9032,0x79));var _0x2903=function(_0x1d822f,_0x366325){_0x1d822f=_0x1d822f-0x0;var _0x4cb17d=_0x9032[_0x1d822f];return _0x4cb17d;};'use strict';var multer=require('multer');var util=require(_0x2903('0x0'));var path=require('path');var timeout=require(_0x2903('0x1'));var express=require(_0x2903('0x2'));var router=express['Router']();var auth=require(_0x2903('0x3'));var interaction=require(_0x2903('0x4'));var config=require(_0x2903('0x5'));var controller=require('./chatQueue.controller');router[_0x2903('0x6')]('/',auth[_0x2903('0x7')](),controller[_0x2903('0x8')]);router['get'](_0x2903('0x9'),auth[_0x2903('0x7')](),controller[_0x2903('0xa')]);router[_0x2903('0x6')]('/:id',auth[_0x2903('0x7')](),controller['show']);router[_0x2903('0x6')]('/:id/members',auth[_0x2903('0x7')](),controller[_0x2903('0xb')]);router[_0x2903('0x6')](_0x2903('0xc'),auth[_0x2903('0x7')](),controller[_0x2903('0xd')]);router['get']('/:id/users',auth[_0x2903('0x7')](),controller[_0x2903('0xe')]);router[_0x2903('0xf')]('/',auth['isAuthenticated'](),controller[_0x2903('0x10')]);router['post'](_0x2903('0xc'),auth['isAuthenticated'](),controller[_0x2903('0x11')]);router['post'](_0x2903('0x12'),auth[_0x2903('0x7')](),controller[_0x2903('0x13')]);router['put'](_0x2903('0x14'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2903('0x14'),auth[_0x2903('0x7')](),controller[_0x2903('0x15')]);router[_0x2903('0x16')](_0x2903('0xc'),auth[_0x2903('0x7')](),controller[_0x2903('0x17')]);router['delete'](_0x2903('0x12'),auth[_0x2903('0x7')](),controller[_0x2903('0x18')]);module[_0x2903('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 0778d24..1fba04f 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 _0x6433=['DATE','moment','exports','STRING'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x6433,0xed));var _0x3643=function(_0x221131,_0x40584d){_0x221131=_0x221131-0x0;var _0x52c03a=_0x6433[_0x221131];return _0x52c03a;};'use strict';var moment=require(_0x3643('0x0'));var Sequelize=require('sequelize');module[_0x3643('0x1')]={'uniqueid':{'type':Sequelize[_0x3643('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3643('0x3')]},'leaveAt':{'type':Sequelize[_0x3643('0x3')]},'acceptAt':{'type':Sequelize[_0x3643('0x3')]},'exitAt':{'type':Sequelize[_0x3643('0x3')]},'reason':{'type':Sequelize[_0x3643('0x2')]}}; \ No newline at end of file +var _0x1151=['STRING','DATE','moment','exports'];(function(_0x29e9d8,_0x49de48){var _0x429978=function(_0x4a39ef){while(--_0x4a39ef){_0x29e9d8['push'](_0x29e9d8['shift']());}};_0x429978(++_0x49de48);}(_0x1151,0x166));var _0x1115=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x1151[_0x5dfc2a];return _0x3f1a71;};'use strict';var moment=require(_0x1115('0x0'));var Sequelize=require('sequelize');module[_0x1115('0x1')]={'uniqueid':{'type':Sequelize[_0x1115('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1115('0x2')]},'joinAt':{'type':Sequelize[_0x1115('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1115('0x3')]},'exitAt':{'type':Sequelize[_0x1115('0x3')]},'reason':{'type':Sequelize[_0x1115('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index c8ea378..2815308 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 _0x2556=['find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','json','apply','reject','save','update','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','catch','params','length'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x2556,0x11c));var _0x6255=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x2556[_0x1deb03];return _0x189fe7;};'use strict';var pdf=require(_0x6255('0x0'));var emlformat=require(_0x6255('0x1'));var rimraf=require(_0x6255('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6255('0x3'));var rp=require(_0x6255('0x4'));var moment=require('moment');var BPromise=require(_0x6255('0x5'));var Mustache=require('mustache');var util=require(_0x6255('0x6'));var path=require(_0x6255('0x7'));var sox=require('sox');var csv=require(_0x6255('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6255('0x9'));var crypto=require(_0x6255('0xa'));var jsforce=require(_0x6255('0xb'));var deskjs=require(_0x6255('0xc'));var toCsv=require(_0x6255('0x8'));var querystring=require(_0x6255('0xd'));var Papa=require(_0x6255('0xe'));var Redis=require(_0x6255('0xf'));var authService=require(_0x6255('0x10'));var qs=require(_0x6255('0x11'));var hardwareService=require(_0x6255('0x12'));var logger=require('../../config/logger')(_0x6255('0x13'));var utils=require(_0x6255('0x14'));var config=require('../../config/environment');var db=require(_0x6255('0x15'))['db'];function respondWithStatusCode(_0x2ac3b3,_0x52025d){_0x52025d=_0x52025d||0xcc;return function(_0x42577e){if(_0x42577e){return _0x2ac3b3[_0x6255('0x16')](_0x52025d);}return _0x2ac3b3['status'](_0x52025d)[_0x6255('0x17')]();};}function respondWithResult(_0x1de08a,_0xcbf1bc){_0xcbf1bc=_0xcbf1bc||0xc8;return function(_0x5997e9){if(_0x5997e9){return _0x1de08a[_0x6255('0x18')](_0xcbf1bc)['json'](_0x5997e9);}};}function respondWithFilteredResult(_0x2cec7e,_0x173eae){return function(_0x1ca22c){if(_0x1ca22c){var _0x55ad25=_0x1ca22c['count'],_0x3e4ae2=_0x173eae[_0x6255('0x19')],_0x34b8f7=_0x173eae[_0x6255('0x19')]+_0x173eae['limit'],_0x13308;if(_0x34b8f7>=_0x55ad25){_0x34b8f7=_0x55ad25;_0x13308=0xc8;}else{_0x13308=0xce;}_0x2cec7e[_0x6255('0x18')](_0x13308);return _0x2cec7e['set']('Content-Range',_0x3e4ae2+'-'+_0x34b8f7+'/'+_0x55ad25)[_0x6255('0x1a')](_0x1ca22c);}return null;};}function patchUpdates(_0x42e4ac){return function(_0x5423aa){try{jsonpatch[_0x6255('0x1b')](_0x5423aa,_0x42e4ac,!![]);}catch(_0x5aa02b){return BPromise[_0x6255('0x1c')](_0x5aa02b);}return _0x5423aa[_0x6255('0x1d')]();};}function saveUpdates(_0x19522a,_0x4d8162){return function(_0x5b887e){if(_0x5b887e){return _0x5b887e[_0x6255('0x1e')](_0x19522a)[_0x6255('0x1f')](function(_0x14a896){return _0x14a896;});}return null;};}function removeEntity(_0x3b614e,_0x16f1e5){return function(_0x54f5cc){if(_0x54f5cc){return _0x54f5cc[_0x6255('0x20')]()[_0x6255('0x1f')](function(){_0x3b614e[_0x6255('0x18')](0xcc)[_0x6255('0x17')]();});}};}function handleEntityNotFound(_0x7e6411,_0x585661){return function(_0x30359d){if(!_0x30359d){_0x7e6411[_0x6255('0x16')](0x194);}return _0x30359d;};}function handleError(_0xf2ef0,_0x29a9f0){_0x29a9f0=_0x29a9f0||0x1f4;return function(_0xacf64f){logger['error'](_0xacf64f[_0x6255('0x21')]);if(_0xacf64f[_0x6255('0x22')]){delete _0xacf64f[_0x6255('0x22')];}_0xf2ef0['status'](_0x29a9f0)[_0x6255('0x23')](_0xacf64f);};}exports[_0x6255('0x24')]=function(_0x301b12,_0xfde886){var _0x58ddab={},_0x20862d={},_0x4c9e89={'count':0x0,'rows':[]};var _0x1cd984=db[_0x6255('0x25')][_0x6255('0x26')];_0x20862d[_0x6255('0x27')]=_[_0x6255('0x28')](_0x1cd984);_0x20862d[_0x6255('0x29')]=_['keys'](_0x301b12[_0x6255('0x29')]);_0x20862d[_0x6255('0x2a')]=_[_0x6255('0x2b')](_0x20862d[_0x6255('0x27')],_0x20862d[_0x6255('0x29')]);_0x58ddab[_0x6255('0x2c')]=_[_0x6255('0x2b')](_0x20862d['model'],qs[_0x6255('0x2d')](_0x301b12[_0x6255('0x29')][_0x6255('0x2d')]));_0x58ddab['attributes']=_0x58ddab[_0x6255('0x2c')]['length']?_0x58ddab['attributes']:_0x20862d[_0x6255('0x27')];if(!_0x301b12[_0x6255('0x29')][_0x6255('0x2e')](_0x6255('0x2f'))){_0x58ddab[_0x6255('0x30')]=qs[_0x6255('0x30')](_0x301b12[_0x6255('0x29')][_0x6255('0x30')]);_0x58ddab[_0x6255('0x19')]=qs[_0x6255('0x19')](_0x301b12['query'][_0x6255('0x19')]);}_0x58ddab[_0x6255('0x31')]=qs[_0x6255('0x32')](_0x301b12[_0x6255('0x29')]['sort']);_0x58ddab[_0x6255('0x33')]=qs['filters'](_[_0x6255('0x34')](_0x301b12[_0x6255('0x29')],_0x20862d['filters']));if(_0x301b12[_0x6255('0x29')][_0x6255('0x35')]){_0x58ddab['where']=_[_0x6255('0x36')](_0x58ddab[_0x6255('0x33')],{'$or':_[_0x6255('0x37')](_0x1cd984,function(_0x3c1db1){if(_0x3c1db1['type'][_0x6255('0x38')]!==_0x6255('0x39')){var _0x443e85={};_0x443e85[_0x3c1db1[_0x6255('0x3a')]]={'$like':'%'+_0x301b12[_0x6255('0x29')][_0x6255('0x35')]+'%'};return _0x443e85;}})});}_0x58ddab=_['merge']({},_0x58ddab,_0x301b12[_0x6255('0x3b')]);var _0x594fac={'where':_0x58ddab[_0x6255('0x33')]};return db['ChatQueueReport'][_0x6255('0x3c')](_0x594fac)['then'](function(_0x3c266b){_0x4c9e89['count']=_0x3c266b;if(_0x301b12[_0x6255('0x29')][_0x6255('0x3d')]){_0x58ddab[_0x6255('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x58ddab);})[_0x6255('0x1f')](function(_0x23699c){_0x4c9e89['rows']=_0x23699c;return _0x4c9e89;})[_0x6255('0x1f')](respondWithFilteredResult(_0xfde886,_0x58ddab))[_0x6255('0x3f')](handleError(_0xfde886,null));};exports['show']=function(_0x3b687c,_0x3f7805){var _0x4cbfa6={'raw':!![],'where':{'id':_0x3b687c[_0x6255('0x40')]['id']}},_0x20bcd4={};_0x20bcd4[_0x6255('0x27')]=_[_0x6255('0x28')](db[_0x6255('0x25')][_0x6255('0x26')]);_0x20bcd4[_0x6255('0x29')]=_['keys'](_0x3b687c[_0x6255('0x29')]);_0x20bcd4[_0x6255('0x2a')]=_[_0x6255('0x2b')](_0x20bcd4['model'],_0x20bcd4[_0x6255('0x29')]);_0x4cbfa6[_0x6255('0x2c')]=_['intersection'](_0x20bcd4['model'],qs[_0x6255('0x2d')](_0x3b687c[_0x6255('0x29')][_0x6255('0x2d')]));_0x4cbfa6[_0x6255('0x2c')]=_0x4cbfa6[_0x6255('0x2c')][_0x6255('0x41')]?_0x4cbfa6[_0x6255('0x2c')]:_0x20bcd4[_0x6255('0x27')];if(_0x3b687c[_0x6255('0x29')][_0x6255('0x3d')]){_0x4cbfa6[_0x6255('0x3e')]=[{'all':!![]}];}_0x4cbfa6=_[_0x6255('0x36')]({},_0x4cbfa6,_0x3b687c[_0x6255('0x3b')]);return db[_0x6255('0x25')][_0x6255('0x42')](_0x4cbfa6)[_0x6255('0x1f')](handleEntityNotFound(_0x3f7805,null))[_0x6255('0x1f')](respondWithResult(_0x3f7805,null))[_0x6255('0x3f')](handleError(_0x3f7805,null));};exports[_0x6255('0x43')]=function(_0x5c509e,_0x17546d){return db[_0x6255('0x25')][_0x6255('0x43')](_0x5c509e[_0x6255('0x44')],{})[_0x6255('0x1f')](respondWithResult(_0x17546d,0xc9))[_0x6255('0x3f')](handleError(_0x17546d,null));};exports[_0x6255('0x1e')]=function(_0x103f9f,_0x1556e7){if(_0x103f9f[_0x6255('0x44')]['id']){delete _0x103f9f[_0x6255('0x44')]['id'];}return db[_0x6255('0x25')][_0x6255('0x42')]({'where':{'id':_0x103f9f[_0x6255('0x40')]['id']}})['then'](handleEntityNotFound(_0x1556e7,null))[_0x6255('0x1f')](saveUpdates(_0x103f9f[_0x6255('0x44')],null))['then'](respondWithResult(_0x1556e7,null))[_0x6255('0x3f')](handleError(_0x1556e7,null));};exports['destroy']=function(_0x22abcc,_0x1aa9ec){return db[_0x6255('0x25')]['find']({'where':{'id':_0x22abcc[_0x6255('0x40')]['id']}})[_0x6255('0x1f')](handleEntityNotFound(_0x1aa9ec,null))[_0x6255('0x1f')](removeEntity(_0x1aa9ec,null))[_0x6255('0x3f')](handleError(_0x1aa9ec,null));};exports[_0x6255('0x45')]=function(_0x21bec6,_0x14ff80){return db[_0x6255('0x25')][_0x6255('0x45')]()[_0x6255('0x1f')](respondWithResult(_0x14ff80,null))[_0x6255('0x3f')](handleError(_0x14ff80,null));}; \ No newline at end of file +var _0x9741=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','limit','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','where','map','key','VIRTUAL','field','filter','merge','options','count','includeAll','include','rows','catch','show','params','length','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x9741,0x1ee));var _0x1974=function(_0x192d2a,_0x127c99){_0x192d2a=_0x192d2a-0x0;var _0x319c58=_0x9741[_0x192d2a];return _0x319c58;};'use strict';var pdf=require(_0x1974('0x0'));var emlformat=require(_0x1974('0x1'));var rimraf=require(_0x1974('0x2'));var zipdir=require(_0x1974('0x3'));var jsonpatch=require(_0x1974('0x4'));var rp=require(_0x1974('0x5'));var moment=require('moment');var BPromise=require(_0x1974('0x6'));var Mustache=require(_0x1974('0x7'));var util=require('util');var path=require(_0x1974('0x8'));var sox=require(_0x1974('0x9'));var csv=require(_0x1974('0xa'));var ejs=require(_0x1974('0xb'));var fs=require('fs');var _=require(_0x1974('0xc'));var squel=require(_0x1974('0xd'));var crypto=require(_0x1974('0xe'));var jsforce=require(_0x1974('0xf'));var deskjs=require(_0x1974('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1974('0x11'));var Papa=require(_0x1974('0x12'));var Redis=require('ioredis');var authService=require(_0x1974('0x13'));var qs=require(_0x1974('0x14'));var hardwareService=require(_0x1974('0x15'));var logger=require(_0x1974('0x16'))(_0x1974('0x17'));var utils=require(_0x1974('0x18'));var config=require('../../config/environment');var db=require(_0x1974('0x19'))['db'];function respondWithStatusCode(_0x2832f2,_0x50eeb5){_0x50eeb5=_0x50eeb5||0xcc;return function(_0x165a5e){if(_0x165a5e){return _0x2832f2['sendStatus'](_0x50eeb5);}return _0x2832f2[_0x1974('0x1a')](_0x50eeb5)[_0x1974('0x1b')]();};}function respondWithResult(_0x32a5bc,_0x2bb512){_0x2bb512=_0x2bb512||0xc8;return function(_0x4e3478){if(_0x4e3478){return _0x32a5bc['status'](_0x2bb512)['json'](_0x4e3478);}};}function respondWithFilteredResult(_0xc1a14c,_0x5e074c){return function(_0xee4cdf){if(_0xee4cdf){var _0x190ef8=_0xee4cdf['count'],_0x50dca3=_0x5e074c[_0x1974('0x1c')],_0x2e77a6=_0x5e074c[_0x1974('0x1c')]+_0x5e074c[_0x1974('0x1d')],_0x2b1d45;if(_0x2e77a6>=_0x190ef8){_0x2e77a6=_0x190ef8;_0x2b1d45=0xc8;}else{_0x2b1d45=0xce;}_0xc1a14c['status'](_0x2b1d45);return _0xc1a14c[_0x1974('0x1e')](_0x1974('0x1f'),_0x50dca3+'-'+_0x2e77a6+'/'+_0x190ef8)[_0x1974('0x20')](_0xee4cdf);}return null;};}function patchUpdates(_0x3fc17a){return function(_0x317b3d){try{jsonpatch['apply'](_0x317b3d,_0x3fc17a,!![]);}catch(_0x3fe80a){return BPromise['reject'](_0x3fe80a);}return _0x317b3d[_0x1974('0x21')]();};}function saveUpdates(_0x13ada1,_0x916412){return function(_0x1696cd){if(_0x1696cd){return _0x1696cd[_0x1974('0x22')](_0x13ada1)[_0x1974('0x23')](function(_0x5247f2){return _0x5247f2;});}return null;};}function removeEntity(_0x2e26c2,_0xbd089e){return function(_0x33ca74){if(_0x33ca74){return _0x33ca74[_0x1974('0x24')]()[_0x1974('0x23')](function(){_0x2e26c2[_0x1974('0x1a')](0xcc)[_0x1974('0x1b')]();});}};}function handleEntityNotFound(_0x124842,_0x51ba40){return function(_0xf74d1b){if(!_0xf74d1b){_0x124842[_0x1974('0x25')](0x194);}return _0xf74d1b;};}function handleError(_0x56f766,_0x3dc96c){_0x3dc96c=_0x3dc96c||0x1f4;return function(_0x199c55){logger[_0x1974('0x26')](_0x199c55[_0x1974('0x27')]);if(_0x199c55['name']){delete _0x199c55[_0x1974('0x28')];}_0x56f766['status'](_0x3dc96c)[_0x1974('0x29')](_0x199c55);};}exports[_0x1974('0x2a')]=function(_0x29d769,_0x3f8578){var _0x7d6ed2={},_0x3ff3fc={},_0x506f0d={'count':0x0,'rows':[]};var _0x16f294=db[_0x1974('0x2b')][_0x1974('0x2c')];_0x3ff3fc[_0x1974('0x2d')]=_['keys'](_0x16f294);_0x3ff3fc[_0x1974('0x2e')]=_[_0x1974('0x2f')](_0x29d769['query']);_0x3ff3fc['filters']=_[_0x1974('0x30')](_0x3ff3fc[_0x1974('0x2d')],_0x3ff3fc[_0x1974('0x2e')]);_0x7d6ed2[_0x1974('0x31')]=_[_0x1974('0x30')](_0x3ff3fc['model'],qs[_0x1974('0x32')](_0x29d769[_0x1974('0x2e')][_0x1974('0x32')]));_0x7d6ed2[_0x1974('0x31')]=_0x7d6ed2[_0x1974('0x31')]['length']?_0x7d6ed2[_0x1974('0x31')]:_0x3ff3fc[_0x1974('0x2d')];if(!_0x29d769[_0x1974('0x2e')][_0x1974('0x33')]('nolimit')){_0x7d6ed2[_0x1974('0x1d')]=qs['limit'](_0x29d769[_0x1974('0x2e')][_0x1974('0x1d')]);_0x7d6ed2[_0x1974('0x1c')]=qs['offset'](_0x29d769[_0x1974('0x2e')][_0x1974('0x1c')]);}_0x7d6ed2['order']=qs[_0x1974('0x34')](_0x29d769[_0x1974('0x2e')][_0x1974('0x34')]);_0x7d6ed2['where']=qs[_0x1974('0x35')](_[_0x1974('0x36')](_0x29d769[_0x1974('0x2e')],_0x3ff3fc['filters']));if(_0x29d769[_0x1974('0x2e')]['filter']){_0x7d6ed2[_0x1974('0x37')]=_['merge'](_0x7d6ed2[_0x1974('0x37')],{'$or':_[_0x1974('0x38')](_0x16f294,function(_0x404cce){if(_0x404cce['type'][_0x1974('0x39')]!==_0x1974('0x3a')){var _0xb24efa={};_0xb24efa[_0x404cce[_0x1974('0x3b')]]={'$like':'%'+_0x29d769[_0x1974('0x2e')][_0x1974('0x3c')]+'%'};return _0xb24efa;}})});}_0x7d6ed2=_[_0x1974('0x3d')]({},_0x7d6ed2,_0x29d769[_0x1974('0x3e')]);var _0x43d89b={'where':_0x7d6ed2[_0x1974('0x37')]};return db[_0x1974('0x2b')][_0x1974('0x3f')](_0x43d89b)[_0x1974('0x23')](function(_0x3f4a0d){_0x506f0d['count']=_0x3f4a0d;if(_0x29d769[_0x1974('0x2e')][_0x1974('0x40')]){_0x7d6ed2[_0x1974('0x41')]=[{'all':!![]}];}return db[_0x1974('0x2b')]['findAll'](_0x7d6ed2);})[_0x1974('0x23')](function(_0x3a854c){_0x506f0d[_0x1974('0x42')]=_0x3a854c;return _0x506f0d;})[_0x1974('0x23')](respondWithFilteredResult(_0x3f8578,_0x7d6ed2))[_0x1974('0x43')](handleError(_0x3f8578,null));};exports[_0x1974('0x44')]=function(_0x330e23,_0x3a60bc){var _0xf967d1={'raw':!![],'where':{'id':_0x330e23[_0x1974('0x45')]['id']}},_0xe76cdf={};_0xe76cdf[_0x1974('0x2d')]=_[_0x1974('0x2f')](db[_0x1974('0x2b')][_0x1974('0x2c')]);_0xe76cdf['query']=_[_0x1974('0x2f')](_0x330e23[_0x1974('0x2e')]);_0xe76cdf[_0x1974('0x35')]=_[_0x1974('0x30')](_0xe76cdf['model'],_0xe76cdf[_0x1974('0x2e')]);_0xf967d1[_0x1974('0x31')]=_[_0x1974('0x30')](_0xe76cdf[_0x1974('0x2d')],qs['fields'](_0x330e23['query'][_0x1974('0x32')]));_0xf967d1[_0x1974('0x31')]=_0xf967d1['attributes'][_0x1974('0x46')]?_0xf967d1[_0x1974('0x31')]:_0xe76cdf[_0x1974('0x2d')];if(_0x330e23[_0x1974('0x2e')][_0x1974('0x40')]){_0xf967d1[_0x1974('0x41')]=[{'all':!![]}];}_0xf967d1=_['merge']({},_0xf967d1,_0x330e23[_0x1974('0x3e')]);return db[_0x1974('0x2b')]['find'](_0xf967d1)['then'](handleEntityNotFound(_0x3a60bc,null))['then'](respondWithResult(_0x3a60bc,null))[_0x1974('0x43')](handleError(_0x3a60bc,null));};exports[_0x1974('0x47')]=function(_0x45680e,_0xdc9937){return db[_0x1974('0x2b')][_0x1974('0x47')](_0x45680e['body'],{})['then'](respondWithResult(_0xdc9937,0xc9))[_0x1974('0x43')](handleError(_0xdc9937,null));};exports[_0x1974('0x22')]=function(_0x5db0d5,_0x50cf13){if(_0x5db0d5[_0x1974('0x48')]['id']){delete _0x5db0d5[_0x1974('0x48')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5db0d5[_0x1974('0x45')]['id']}})[_0x1974('0x23')](handleEntityNotFound(_0x50cf13,null))[_0x1974('0x23')](saveUpdates(_0x5db0d5[_0x1974('0x48')],null))[_0x1974('0x23')](respondWithResult(_0x50cf13,null))[_0x1974('0x43')](handleError(_0x50cf13,null));};exports[_0x1974('0x24')]=function(_0x452c3d,_0x5caf0e){return db[_0x1974('0x2b')]['find']({'where':{'id':_0x452c3d['params']['id']}})['then'](handleEntityNotFound(_0x5caf0e,null))[_0x1974('0x23')](removeEntity(_0x5caf0e,null))[_0x1974('0x43')](handleError(_0x5caf0e,null));};exports['describe']=function(_0x24894f,_0x665c86){return db['ChatQueueReport']['describe']()[_0x1974('0x23')](respondWithResult(_0x665c86,null))['catch'](handleError(_0x665c86,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d0b18d7..59c9aae 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 _0x88b5=['../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e279b,_0x45f222){var _0x20c0e8=function(_0x573b35){while(--_0x573b35){_0x3e279b['push'](_0x3e279b['shift']());}};_0x20c0e8(++_0x45f222);}(_0x88b5,0x124));var _0x588b=function(_0x1702dd,_0x587509){_0x1702dd=_0x1702dd-0x0;var _0xa01471=_0x88b5[_0x1702dd];return _0xa01471;};'use strict';var _=require(_0x588b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x588b('0x1'));var moment=require(_0x588b('0x2'));var BPromise=require(_0x588b('0x3'));var rp=require(_0x588b('0x4'));var fs=require('fs');var path=require(_0x588b('0x5'));var rimraf=require(_0x588b('0x6'));var config=require(_0x588b('0x7'));var attributes=require(_0x588b('0x8'));module[_0x588b('0x9')]=function(_0x4e0519,_0x15034a){return _0x4e0519[_0x588b('0xa')](_0x588b('0xb'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x588b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9283=['api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','define','uniqueid','lodash','../../config/logger'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0x9283,0x11c));var _0x3928=function(_0x3c4acf,_0x1df5f7){_0x3c4acf=_0x3c4acf-0x0;var _0xda2fce=_0x9283[_0x3c4acf];return _0xda2fce;};'use strict';var _=require(_0x3928('0x0'));var util=require('util');var logger=require(_0x3928('0x1'))(_0x3928('0x2'));var moment=require(_0x3928('0x3'));var BPromise=require('bluebird');var rp=require(_0x3928('0x4'));var fs=require('fs');var path=require(_0x3928('0x5'));var rimraf=require(_0x3928('0x6'));var config=require(_0x3928('0x7'));var attributes=require(_0x3928('0x8'));module['exports']=function(_0x5abcdf,_0x31f5e8){return _0x5abcdf[_0x3928('0x9')]('ChatQueueReport',attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x3928('0xa'),'fields':[_0x3928('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 3664c35..b323189 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 _0x0f8d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','create','body','options','UpdateChatQueueReport','ChatQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0f8d,0xa9));var _0xd0f8=function(_0x2c7226,_0x29e306){_0x2c7226=_0x2c7226-0x0;var _0x7853d8=_0x0f8d[_0x2c7226];return _0x7853d8;};'use strict';var _=require(_0xd0f8('0x0'));var util=require(_0xd0f8('0x1'));var moment=require(_0xd0f8('0x2'));var BPromise=require(_0xd0f8('0x3'));var rs=require(_0xd0f8('0x4'));var fs=require('fs');var Redis=require(_0xd0f8('0x5'));var db=require(_0xd0f8('0x6'))['db'];var utils=require(_0xd0f8('0x7'));var logger=require(_0xd0f8('0x8'))(_0xd0f8('0x9'));var config=require(_0xd0f8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd0f8('0xb')][_0xd0f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x99bab7,_0x534f72,_0x1c6ddf){return new BPromise(function(_0x566481,_0x50b34b){return client[_0xd0f8('0xd')](_0x99bab7,_0x1c6ddf)[_0xd0f8('0xe')](function(_0x3a264f){logger[_0xd0f8('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x534f72,_0xd0f8('0x10'));logger[_0xd0f8('0x11')](_0xd0f8('0x12'),_0x534f72,'request\x20sent',JSON[_0xd0f8('0x13')](_0x3a264f));if(_0x3a264f[_0xd0f8('0x14')]){if(_0x3a264f[_0xd0f8('0x14')][_0xd0f8('0x15')]===0x1f4){logger[_0xd0f8('0x14')](_0xd0f8('0x16'),_0x534f72,_0x3a264f[_0xd0f8('0x14')][_0xd0f8('0x17')]);return _0x50b34b(_0x3a264f[_0xd0f8('0x14')][_0xd0f8('0x17')]);}logger[_0xd0f8('0x14')](_0xd0f8('0x16'),_0x534f72,_0x3a264f[_0xd0f8('0x14')]['message']);return _0x566481(_0x3a264f[_0xd0f8('0x14')][_0xd0f8('0x17')]);}else{logger[_0xd0f8('0xf')](_0xd0f8('0x16'),_0x534f72,'request\x20sent');_0x566481(_0x3a264f['result'][_0xd0f8('0x17')]);}})[_0xd0f8('0x18')](function(_0xe763f7){logger[_0xd0f8('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x534f72,_0xe763f7);_0x50b34b(_0xe763f7);});});}exports[_0xd0f8('0x19')]=function(_0x430874){var _0x26bf7f=this;return new Promise(function(_0x100c1f,_0x1d24bd){return db['ChatQueueReport'][_0xd0f8('0x1a')](_0x430874[_0xd0f8('0x1b')],{'raw':_0x430874[_0xd0f8('0x1c')]?_0x430874[_0xd0f8('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xd0f8('0xe')](function(_0xa27465){logger[_0xd0f8('0xf')](_0xd0f8('0x19'),_0x430874);logger['debug'](_0xd0f8('0x19'),_0x430874,JSON[_0xd0f8('0x13')](_0xa27465));_0x100c1f(_0xa27465);})[_0xd0f8('0x18')](function(_0x39fea1){logger[_0xd0f8('0x14')](_0xd0f8('0x19'),_0x39fea1[_0xd0f8('0x17')],_0x430874);_0x1d24bd(_0x26bf7f[_0xd0f8('0x14')](0x1f4,_0x39fea1[_0xd0f8('0x17')]));});});};exports[_0xd0f8('0x1d')]=function(_0x47c9d4){var _0x494dd5=this;return new Promise(function(_0x251338,_0x27e651){return db[_0xd0f8('0x1e')][_0xd0f8('0x1f')](_0x47c9d4[_0xd0f8('0x1b')],{'raw':_0x47c9d4[_0xd0f8('0x1c')]?_0x47c9d4[_0xd0f8('0x1c')][_0xd0f8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47c9d4['options']?_0x47c9d4[_0xd0f8('0x1c')][_0xd0f8('0x21')]||null:null,'attributes':_0x47c9d4['options']?_0x47c9d4[_0xd0f8('0x1c')]['attributes']||null:null,'limit':_0x47c9d4[_0xd0f8('0x1c')]?_0x47c9d4[_0xd0f8('0x1c')][_0xd0f8('0x22')]||null:null})[_0xd0f8('0xe')](function(_0x2a943c){logger[_0xd0f8('0xf')]('UpdateChatQueueReport',_0x47c9d4);logger[_0xd0f8('0x11')](_0xd0f8('0x1d'),_0x47c9d4,JSON[_0xd0f8('0x13')](_0x2a943c));_0x251338(_0x2a943c);})[_0xd0f8('0x18')](function(_0x1460ac){logger[_0xd0f8('0x14')]('UpdateChatQueueReport',_0x1460ac[_0xd0f8('0x17')],_0x47c9d4);_0x27e651(_0x494dd5['error'](0x1f4,_0x1460ac['message']));});});}; \ No newline at end of file +var _0x0bc8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','catch','lodash','moment','bluebird','randomstring'];(function(_0x2bd0d7,_0x158fb3){var _0x3f3d78=function(_0x204a96){while(--_0x204a96){_0x2bd0d7['push'](_0x2bd0d7['shift']());}};_0x3f3d78(++_0x158fb3);}(_0x0bc8,0x8c));var _0x80bc=function(_0x5ceed3,_0x41544a){_0x5ceed3=_0x5ceed3-0x0;var _0x10b9b5=_0x0bc8[_0x5ceed3];return _0x10b9b5;};'use strict';var _=require(_0x80bc('0x0'));var util=require('util');var moment=require(_0x80bc('0x1'));var BPromise=require(_0x80bc('0x2'));var rs=require(_0x80bc('0x3'));var fs=require('fs');var Redis=require(_0x80bc('0x4'));var db=require(_0x80bc('0x5'))['db'];var utils=require(_0x80bc('0x6'));var logger=require(_0x80bc('0x7'))(_0x80bc('0x8'));var config=require(_0x80bc('0x9'));var jayson=require(_0x80bc('0xa'));var client=jayson[_0x80bc('0xb')][_0x80bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d1ac,_0x3ba911,_0x2b9b4a){return new BPromise(function(_0x18fab1,_0x4e24ca){return client[_0x80bc('0xd')](_0x41d1ac,_0x2b9b4a)[_0x80bc('0xe')](function(_0x26e887){logger[_0x80bc('0xf')](_0x80bc('0x10'),_0x3ba911,_0x80bc('0x11'));logger[_0x80bc('0x12')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3ba911,_0x80bc('0x11'),JSON[_0x80bc('0x13')](_0x26e887));if(_0x26e887['error']){if(_0x26e887['error'][_0x80bc('0x14')]===0x1f4){logger[_0x80bc('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x3ba911,_0x26e887[_0x80bc('0x15')][_0x80bc('0x16')]);return _0x4e24ca(_0x26e887[_0x80bc('0x15')][_0x80bc('0x16')]);}logger['error'](_0x80bc('0x10'),_0x3ba911,_0x26e887[_0x80bc('0x15')][_0x80bc('0x16')]);return _0x18fab1(_0x26e887[_0x80bc('0x15')]['message']);}else{logger[_0x80bc('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x3ba911,'request\x20sent');_0x18fab1(_0x26e887[_0x80bc('0x17')][_0x80bc('0x16')]);}})['catch'](function(_0x73106d){logger[_0x80bc('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x3ba911,_0x73106d);_0x4e24ca(_0x73106d);});});}exports[_0x80bc('0x18')]=function(_0x438511){var _0xc828b8=this;return new Promise(function(_0x1efa14,_0xb86060){return db[_0x80bc('0x19')][_0x80bc('0x1a')](_0x438511[_0x80bc('0x1b')],{'raw':_0x438511[_0x80bc('0x1c')]?_0x438511['options'][_0x80bc('0x1d')]===undefined?!![]:![]:!![]})[_0x80bc('0xe')](function(_0x2ffa8e){logger['info'](_0x80bc('0x18'),_0x438511);logger[_0x80bc('0x12')](_0x80bc('0x18'),_0x438511,JSON[_0x80bc('0x13')](_0x2ffa8e));_0x1efa14(_0x2ffa8e);})['catch'](function(_0x124f44){logger['error'](_0x80bc('0x18'),_0x124f44[_0x80bc('0x16')],_0x438511);_0xb86060(_0xc828b8[_0x80bc('0x15')](0x1f4,_0x124f44['message']));});});};exports[_0x80bc('0x1e')]=function(_0x5e7bb6){var _0x103c36=this;return new Promise(function(_0xfabac6,_0x145e78){return db[_0x80bc('0x19')][_0x80bc('0x1f')](_0x5e7bb6[_0x80bc('0x1b')],{'raw':_0x5e7bb6[_0x80bc('0x1c')]?_0x5e7bb6[_0x80bc('0x1c')][_0x80bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e7bb6['options']?_0x5e7bb6['options'][_0x80bc('0x20')]||null:null,'attributes':_0x5e7bb6['options']?_0x5e7bb6[_0x80bc('0x1c')][_0x80bc('0x21')]||null:null,'limit':_0x5e7bb6['options']?_0x5e7bb6['options'][_0x80bc('0x22')]||null:null})[_0x80bc('0xe')](function(_0x233cbd){logger[_0x80bc('0xf')](_0x80bc('0x1e'),_0x5e7bb6);logger['debug'](_0x80bc('0x1e'),_0x5e7bb6,JSON[_0x80bc('0x13')](_0x233cbd));_0xfabac6(_0x233cbd);})[_0x80bc('0x23')](function(_0x3dd330){logger[_0x80bc('0x15')]('UpdateChatQueueReport',_0x3dd330[_0x80bc('0x16')],_0x5e7bb6);_0x145e78(_0x103c36['error'](0x1f4,_0x3dd330[_0x80bc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 9bf494f..1a1903b 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 _0x798a=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x798a,0x112));var _0xa798=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x798a[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xa798('0x0'));var util=require(_0xa798('0x1'));var path=require('path');var timeout=require(_0xa798('0x2'));var express=require('express');var router=express[_0xa798('0x3')]();var auth=require(_0xa798('0x4'));var interaction=require(_0xa798('0x5'));var config=require(_0xa798('0x6'));var controller=require(_0xa798('0x7'));router['get']('/',auth[_0xa798('0x8')](),controller[_0xa798('0x9')]);router[_0xa798('0xa')](_0xa798('0xb'),auth[_0xa798('0x8')](),controller[_0xa798('0xc')]);router[_0xa798('0xa')](_0xa798('0xd'),auth[_0xa798('0x8')](),controller[_0xa798('0xe')]);router[_0xa798('0xf')]('/',auth[_0xa798('0x8')](),controller['create']);router[_0xa798('0x10')]('/:id',auth[_0xa798('0x8')](),controller[_0xa798('0x11')]);router[_0xa798('0x12')](_0xa798('0xd'),auth[_0xa798('0x8')](),controller[_0xa798('0x13')]);module[_0xa798('0x14')]=router; \ No newline at end of file +var _0xf19c=['util','path','express','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','multer'];(function(_0x160bc8,_0x2125ac){var _0x57394f=function(_0x1a5843){while(--_0x1a5843){_0x160bc8['push'](_0x160bc8['shift']());}};_0x57394f(++_0x2125ac);}(_0xf19c,0x18e));var _0xcf19=function(_0x2ea5ca,_0x81dc2c){_0x2ea5ca=_0x2ea5ca-0x0;var _0x46f8c7=_0xf19c[_0x2ea5ca];return _0x46f8c7;};'use strict';var multer=require(_0xcf19('0x0'));var util=require(_0xcf19('0x1'));var path=require(_0xcf19('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf19('0x3'));var router=express['Router']();var auth=require(_0xcf19('0x4'));var interaction=require(_0xcf19('0x5'));var config=require('../../config/environment');var controller=require(_0xcf19('0x6'));router['get']('/',auth[_0xcf19('0x7')](),controller[_0xcf19('0x8')]);router[_0xcf19('0x9')](_0xcf19('0xa'),auth[_0xcf19('0x7')](),controller[_0xcf19('0xb')]);router[_0xcf19('0x9')](_0xcf19('0xc'),auth[_0xcf19('0x7')](),controller[_0xcf19('0xd')]);router[_0xcf19('0xe')]('/',auth[_0xcf19('0x7')](),controller[_0xcf19('0xf')]);router['put'](_0xcf19('0xc'),auth[_0xcf19('0x7')](),controller[_0xcf19('0x10')]);router[_0xcf19('0x11')](_0xcf19('0xc'),auth[_0xcf19('0x7')](),controller[_0xcf19('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 439508e..ab9d9c0 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 _0xdf5e=['agent','DATE','NOW','moment','STRING','account'];(function(_0x5d623d,_0xc2bee1){var _0x30a526=function(_0x4dfa1a){while(--_0x4dfa1a){_0x5d623d['push'](_0x5d623d['shift']());}};_0x30a526(++_0xc2bee1);}(_0xdf5e,0x12f));var _0xedf5=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0xdf5e[_0x5c2e5e];return _0x46a5da;};'use strict';var moment=require(_0xedf5('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xedf5('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xedf5('0x2'),_0xedf5('0x3'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xedf5('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xedf5('0x5')]}}; \ No newline at end of file +var _0xd3bd=['queue','DATE','NOW','moment','STRING','ENUM','account','agent'];(function(_0xe3b3ad,_0xd09d7f){var _0x2e09cd=function(_0x40979d){while(--_0x40979d){_0xe3b3ad['push'](_0xe3b3ad['shift']());}};_0x2e09cd(++_0xd09d7f);}(_0xd3bd,0xab));var _0xdd3b=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xd3bd[_0x2763f2];return _0x3ef471;};'use strict';var moment=require(_0xdd3b('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xdd3b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdd3b('0x2')](_0xdd3b('0x3'),_0xdd3b('0x4'),_0xdd3b('0x5')),'allowNull':![],'defaultValue':_0xdd3b('0x5')},'transferredAt':{'type':Sequelize[_0xdd3b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xdd3b('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 490feae..591bbc8 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 _0x2bce=['show','fields','length','includeAll','include','options','create','body','params','describe','html-pdf','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','apply','reject','save','update','destroy','then','error','stack','name','send','ChatTransferReport','rawAttributes','model','keys','query','intersection','attributes','nolimit','limit','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','count','findAll','rows','catch'];(function(_0x32d1ae,_0x575e52){var _0x49cf0b=function(_0x7dc05c){while(--_0x7dc05c){_0x32d1ae['push'](_0x32d1ae['shift']());}};_0x49cf0b(++_0x575e52);}(_0x2bce,0xd6));var _0xe2bc=function(_0x42f0a4,_0x43c8fe){_0x42f0a4=_0x42f0a4-0x0;var _0x679a9d=_0x2bce[_0x42f0a4];return _0x679a9d;};'use strict';var pdf=require(_0xe2bc('0x0'));var emlformat=require(_0xe2bc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe2bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe2bc('0x3'));var BPromise=require(_0xe2bc('0x4'));var Mustache=require('mustache');var util=require(_0xe2bc('0x5'));var path=require('path');var sox=require(_0xe2bc('0x6'));var csv=require(_0xe2bc('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe2bc('0x8'));var crypto=require(_0xe2bc('0x9'));var jsforce=require(_0xe2bc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe2bc('0x7'));var querystring=require(_0xe2bc('0xb'));var Papa=require(_0xe2bc('0xc'));var Redis=require(_0xe2bc('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe2bc('0xe'));var hardwareService=require(_0xe2bc('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xe2bc('0x10'));var config=require(_0xe2bc('0x11'));var db=require(_0xe2bc('0x12'))['db'];function respondWithStatusCode(_0x596308,_0x17bedd){_0x17bedd=_0x17bedd||0xcc;return function(_0x27cd36){if(_0x27cd36){return _0x596308[_0xe2bc('0x13')](_0x17bedd);}return _0x596308['status'](_0x17bedd)[_0xe2bc('0x14')]();};}function respondWithResult(_0x502a3c,_0x5ca211){_0x5ca211=_0x5ca211||0xc8;return function(_0x3c0a6a){if(_0x3c0a6a){return _0x502a3c[_0xe2bc('0x15')](_0x5ca211)[_0xe2bc('0x16')](_0x3c0a6a);}};}function respondWithFilteredResult(_0x5d986e,_0x529f86){return function(_0x31dedf){if(_0x31dedf){var _0x26cfa5=_0x31dedf['count'],_0x2974aa=_0x529f86[_0xe2bc('0x17')],_0x2cf3ad=_0x529f86['offset']+_0x529f86['limit'],_0x5f0bba;if(_0x2cf3ad>=_0x26cfa5){_0x2cf3ad=_0x26cfa5;_0x5f0bba=0xc8;}else{_0x5f0bba=0xce;}_0x5d986e[_0xe2bc('0x15')](_0x5f0bba);return _0x5d986e[_0xe2bc('0x18')]('Content-Range',_0x2974aa+'-'+_0x2cf3ad+'/'+_0x26cfa5)['json'](_0x31dedf);}return null;};}function patchUpdates(_0x33c7a6){return function(_0x74a1c7){try{jsonpatch[_0xe2bc('0x19')](_0x74a1c7,_0x33c7a6,!![]);}catch(_0x20bed5){return BPromise[_0xe2bc('0x1a')](_0x20bed5);}return _0x74a1c7[_0xe2bc('0x1b')]();};}function saveUpdates(_0x2d99bd,_0x25b9c3){return function(_0x4f5b0f){if(_0x4f5b0f){return _0x4f5b0f[_0xe2bc('0x1c')](_0x2d99bd)['then'](function(_0x86d9e){return _0x86d9e;});}return null;};}function removeEntity(_0x13c87a,_0x4e0cd7){return function(_0x1275cb){if(_0x1275cb){return _0x1275cb[_0xe2bc('0x1d')]()[_0xe2bc('0x1e')](function(){_0x13c87a[_0xe2bc('0x15')](0xcc)[_0xe2bc('0x14')]();});}};}function handleEntityNotFound(_0x4f79b1,_0xa7e134){return function(_0x28e229){if(!_0x28e229){_0x4f79b1[_0xe2bc('0x13')](0x194);}return _0x28e229;};}function handleError(_0x1ae500,_0xc6536d){_0xc6536d=_0xc6536d||0x1f4;return function(_0x1d8b21){logger[_0xe2bc('0x1f')](_0x1d8b21[_0xe2bc('0x20')]);if(_0x1d8b21[_0xe2bc('0x21')]){delete _0x1d8b21['name'];}_0x1ae500[_0xe2bc('0x15')](_0xc6536d)[_0xe2bc('0x22')](_0x1d8b21);};}exports['index']=function(_0x368905,_0x30fc20){var _0x2606e5={},_0x2a6a8a={},_0x5d6cfe={'count':0x0,'rows':[]};var _0x4331d8=db[_0xe2bc('0x23')][_0xe2bc('0x24')];_0x2a6a8a[_0xe2bc('0x25')]=_[_0xe2bc('0x26')](_0x4331d8);_0x2a6a8a[_0xe2bc('0x27')]=_[_0xe2bc('0x26')](_0x368905[_0xe2bc('0x27')]);_0x2a6a8a['filters']=_[_0xe2bc('0x28')](_0x2a6a8a[_0xe2bc('0x25')],_0x2a6a8a[_0xe2bc('0x27')]);_0x2606e5[_0xe2bc('0x29')]=_['intersection'](_0x2a6a8a[_0xe2bc('0x25')],qs['fields'](_0x368905['query']['fields']));_0x2606e5[_0xe2bc('0x29')]=_0x2606e5['attributes']['length']?_0x2606e5[_0xe2bc('0x29')]:_0x2a6a8a[_0xe2bc('0x25')];if(!_0x368905[_0xe2bc('0x27')]['hasOwnProperty'](_0xe2bc('0x2a'))){_0x2606e5[_0xe2bc('0x2b')]=qs[_0xe2bc('0x2b')](_0x368905[_0xe2bc('0x27')][_0xe2bc('0x2b')]);_0x2606e5[_0xe2bc('0x17')]=qs[_0xe2bc('0x17')](_0x368905['query'][_0xe2bc('0x17')]);}_0x2606e5['order']=qs[_0xe2bc('0x2c')](_0x368905[_0xe2bc('0x27')][_0xe2bc('0x2c')]);_0x2606e5[_0xe2bc('0x2d')]=qs[_0xe2bc('0x2e')](_[_0xe2bc('0x2f')](_0x368905[_0xe2bc('0x27')],_0x2a6a8a[_0xe2bc('0x2e')]));if(_0x368905[_0xe2bc('0x27')][_0xe2bc('0x30')]){_0x2606e5[_0xe2bc('0x2d')]=_[_0xe2bc('0x31')](_0x2606e5['where'],{'$or':_[_0xe2bc('0x32')](_0x4331d8,function(_0x20ee10){if(_0x20ee10['type'][_0xe2bc('0x33')]!==_0xe2bc('0x34')){var _0xc17397={};_0xc17397[_0x20ee10[_0xe2bc('0x35')]]={'$like':'%'+_0x368905[_0xe2bc('0x27')][_0xe2bc('0x30')]+'%'};return _0xc17397;}})});}_0x2606e5=_[_0xe2bc('0x31')]({},_0x2606e5,_0x368905['options']);var _0x181d76={'where':_0x2606e5[_0xe2bc('0x2d')]};return db[_0xe2bc('0x23')][_0xe2bc('0x36')](_0x181d76)[_0xe2bc('0x1e')](function(_0x2ea902){_0x5d6cfe[_0xe2bc('0x36')]=_0x2ea902;if(_0x368905[_0xe2bc('0x27')]['includeAll']){_0x2606e5['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xe2bc('0x37')](_0x2606e5);})['then'](function(_0x2960cd){_0x5d6cfe[_0xe2bc('0x38')]=_0x2960cd;return _0x5d6cfe;})['then'](respondWithFilteredResult(_0x30fc20,_0x2606e5))[_0xe2bc('0x39')](handleError(_0x30fc20,null));};exports[_0xe2bc('0x3a')]=function(_0x5b2b30,_0x4d1744){var _0x10a764={'raw':!![],'where':{'id':_0x5b2b30['params']['id']}},_0x442a9e={};_0x442a9e[_0xe2bc('0x25')]=_[_0xe2bc('0x26')](db[_0xe2bc('0x23')][_0xe2bc('0x24')]);_0x442a9e[_0xe2bc('0x27')]=_[_0xe2bc('0x26')](_0x5b2b30['query']);_0x442a9e['filters']=_[_0xe2bc('0x28')](_0x442a9e[_0xe2bc('0x25')],_0x442a9e[_0xe2bc('0x27')]);_0x10a764['attributes']=_['intersection'](_0x442a9e['model'],qs[_0xe2bc('0x3b')](_0x5b2b30[_0xe2bc('0x27')][_0xe2bc('0x3b')]));_0x10a764['attributes']=_0x10a764[_0xe2bc('0x29')][_0xe2bc('0x3c')]?_0x10a764[_0xe2bc('0x29')]:_0x442a9e[_0xe2bc('0x25')];if(_0x5b2b30[_0xe2bc('0x27')][_0xe2bc('0x3d')]){_0x10a764[_0xe2bc('0x3e')]=[{'all':!![]}];}_0x10a764=_[_0xe2bc('0x31')]({},_0x10a764,_0x5b2b30[_0xe2bc('0x3f')]);return db['ChatTransferReport']['find'](_0x10a764)['then'](handleEntityNotFound(_0x4d1744,null))[_0xe2bc('0x1e')](respondWithResult(_0x4d1744,null))['catch'](handleError(_0x4d1744,null));};exports[_0xe2bc('0x40')]=function(_0x38e59f,_0x17f06d){return db[_0xe2bc('0x23')]['create'](_0x38e59f[_0xe2bc('0x41')],{})[_0xe2bc('0x1e')](respondWithResult(_0x17f06d,0xc9))[_0xe2bc('0x39')](handleError(_0x17f06d,null));};exports[_0xe2bc('0x1c')]=function(_0x4db1e8,_0x2d38f4){if(_0x4db1e8[_0xe2bc('0x41')]['id']){delete _0x4db1e8[_0xe2bc('0x41')]['id'];}return db[_0xe2bc('0x23')]['find']({'where':{'id':_0x4db1e8[_0xe2bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d38f4,null))[_0xe2bc('0x1e')](saveUpdates(_0x4db1e8['body'],null))[_0xe2bc('0x1e')](respondWithResult(_0x2d38f4,null))[_0xe2bc('0x39')](handleError(_0x2d38f4,null));};exports[_0xe2bc('0x1d')]=function(_0x4b5b18,_0x565f79){return db['ChatTransferReport']['find']({'where':{'id':_0x4b5b18[_0xe2bc('0x42')]['id']}})[_0xe2bc('0x1e')](handleEntityNotFound(_0x565f79,null))[_0xe2bc('0x1e')](removeEntity(_0x565f79,null))['catch'](handleError(_0x565f79,null));};exports['describe']=function(_0x4e0540,_0x3e9e77){return db[_0xe2bc('0x23')][_0xe2bc('0x43')]()[_0xe2bc('0x1e')](respondWithResult(_0x3e9e77,null))[_0xe2bc('0x39')](handleError(_0x3e9e77,null));}; \ No newline at end of file +var _0x4049=['sendStatus','status','end','count','offset','limit','json','reject','save','update','destroy','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','ChatTransferReport','then','include','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x584e52,_0x5443dc){var _0x5cf710=function(_0x4fc333){while(--_0x4fc333){_0x584e52['push'](_0x584e52['shift']());}};_0x5cf710(++_0x5443dc);}(_0x4049,0x17c));var _0x9404=function(_0x347d58,_0x4cce25){_0x347d58=_0x347d58-0x0;var _0x1eeb4f=_0x4049[_0x347d58];return _0x1eeb4f;};'use strict';var pdf=require(_0x9404('0x0'));var emlformat=require(_0x9404('0x1'));var rimraf=require(_0x9404('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9404('0x3'));var rp=require(_0x9404('0x4'));var moment=require(_0x9404('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9404('0x6'));var path=require(_0x9404('0x7'));var sox=require(_0x9404('0x8'));var csv=require(_0x9404('0x9'));var ejs=require(_0x9404('0xa'));var fs=require('fs');var _=require(_0x9404('0xb'));var squel=require('squel');var crypto=require(_0x9404('0xc'));var jsforce=require(_0x9404('0xd'));var deskjs=require(_0x9404('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9404('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9404('0x10'));var qs=require(_0x9404('0x11'));var hardwareService=require(_0x9404('0x12'));var logger=require(_0x9404('0x13'))('api');var utils=require(_0x9404('0x14'));var config=require(_0x9404('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4989b4,_0x22b677){_0x22b677=_0x22b677||0xcc;return function(_0x5dee89){if(_0x5dee89){return _0x4989b4[_0x9404('0x16')](_0x22b677);}return _0x4989b4[_0x9404('0x17')](_0x22b677)[_0x9404('0x18')]();};}function respondWithResult(_0x16fbb8,_0x4681e7){_0x4681e7=_0x4681e7||0xc8;return function(_0xe7a4c3){if(_0xe7a4c3){return _0x16fbb8[_0x9404('0x17')](_0x4681e7)['json'](_0xe7a4c3);}};}function respondWithFilteredResult(_0x43f087,_0x1efcf6){return function(_0x53e74f){if(_0x53e74f){var _0x38f2d6=_0x53e74f[_0x9404('0x19')],_0x56b4fc=_0x1efcf6[_0x9404('0x1a')],_0xc3768b=_0x1efcf6['offset']+_0x1efcf6[_0x9404('0x1b')],_0xbddcaf;if(_0xc3768b>=_0x38f2d6){_0xc3768b=_0x38f2d6;_0xbddcaf=0xc8;}else{_0xbddcaf=0xce;}_0x43f087['status'](_0xbddcaf);return _0x43f087['set']('Content-Range',_0x56b4fc+'-'+_0xc3768b+'/'+_0x38f2d6)[_0x9404('0x1c')](_0x53e74f);}return null;};}function patchUpdates(_0x27479f){return function(_0x30185){try{jsonpatch['apply'](_0x30185,_0x27479f,!![]);}catch(_0x1cfef4){return BPromise[_0x9404('0x1d')](_0x1cfef4);}return _0x30185[_0x9404('0x1e')]();};}function saveUpdates(_0xf8f870,_0x50908b){return function(_0x9e8d76){if(_0x9e8d76){return _0x9e8d76[_0x9404('0x1f')](_0xf8f870)['then'](function(_0xcfda28){return _0xcfda28;});}return null;};}function removeEntity(_0x292b61,_0x220fef){return function(_0x4ed7cc){if(_0x4ed7cc){return _0x4ed7cc[_0x9404('0x20')]()['then'](function(){_0x292b61[_0x9404('0x17')](0xcc)[_0x9404('0x18')]();});}};}function handleEntityNotFound(_0x4e9f81,_0x159b8d){return function(_0x56be79){if(!_0x56be79){_0x4e9f81[_0x9404('0x16')](0x194);}return _0x56be79;};}function handleError(_0x2d2cfc,_0x37f86d){_0x37f86d=_0x37f86d||0x1f4;return function(_0x612d04){logger['error'](_0x612d04['stack']);if(_0x612d04['name']){delete _0x612d04[_0x9404('0x21')];}_0x2d2cfc['status'](_0x37f86d)['send'](_0x612d04);};}exports[_0x9404('0x22')]=function(_0xb567d9,_0x1044d2){var _0x2dbade={},_0x5072e0={},_0xdeb8c4={'count':0x0,'rows':[]};var _0x3f70fd=db['ChatTransferReport'][_0x9404('0x23')];_0x5072e0[_0x9404('0x24')]=_[_0x9404('0x25')](_0x3f70fd);_0x5072e0[_0x9404('0x26')]=_[_0x9404('0x25')](_0xb567d9['query']);_0x5072e0[_0x9404('0x27')]=_[_0x9404('0x28')](_0x5072e0[_0x9404('0x24')],_0x5072e0['query']);_0x2dbade[_0x9404('0x29')]=_[_0x9404('0x28')](_0x5072e0[_0x9404('0x24')],qs['fields'](_0xb567d9['query'][_0x9404('0x2a')]));_0x2dbade['attributes']=_0x2dbade[_0x9404('0x29')][_0x9404('0x2b')]?_0x2dbade[_0x9404('0x29')]:_0x5072e0['model'];if(!_0xb567d9[_0x9404('0x26')]['hasOwnProperty'](_0x9404('0x2c'))){_0x2dbade[_0x9404('0x1b')]=qs[_0x9404('0x1b')](_0xb567d9[_0x9404('0x26')][_0x9404('0x1b')]);_0x2dbade[_0x9404('0x1a')]=qs[_0x9404('0x1a')](_0xb567d9['query'][_0x9404('0x1a')]);}_0x2dbade[_0x9404('0x2d')]=qs[_0x9404('0x2e')](_0xb567d9['query'][_0x9404('0x2e')]);_0x2dbade[_0x9404('0x2f')]=qs[_0x9404('0x27')](_[_0x9404('0x30')](_0xb567d9['query'],_0x5072e0['filters']));if(_0xb567d9[_0x9404('0x26')][_0x9404('0x31')]){_0x2dbade[_0x9404('0x2f')]=_[_0x9404('0x32')](_0x2dbade[_0x9404('0x2f')],{'$or':_[_0x9404('0x33')](_0x3f70fd,function(_0x7671f7){if(_0x7671f7[_0x9404('0x34')][_0x9404('0x35')]!==_0x9404('0x36')){var _0x1d317c={};_0x1d317c[_0x7671f7['field']]={'$like':'%'+_0xb567d9['query']['filter']+'%'};return _0x1d317c;}})});}_0x2dbade=_[_0x9404('0x32')]({},_0x2dbade,_0xb567d9[_0x9404('0x37')]);var _0x3bab1a={'where':_0x2dbade[_0x9404('0x2f')]};return db[_0x9404('0x38')][_0x9404('0x19')](_0x3bab1a)[_0x9404('0x39')](function(_0x397388){_0xdeb8c4['count']=_0x397388;if(_0xb567d9['query']['includeAll']){_0x2dbade[_0x9404('0x3a')]=[{'all':!![]}];}return db[_0x9404('0x38')]['findAll'](_0x2dbade);})['then'](function(_0x2ca7cb){_0xdeb8c4['rows']=_0x2ca7cb;return _0xdeb8c4;})['then'](respondWithFilteredResult(_0x1044d2,_0x2dbade))[_0x9404('0x3b')](handleError(_0x1044d2,null));};exports[_0x9404('0x3c')]=function(_0x4b88cc,_0xefc859){var _0x44453f={'raw':!![],'where':{'id':_0x4b88cc[_0x9404('0x3d')]['id']}},_0x5c1d05={};_0x5c1d05[_0x9404('0x24')]=_[_0x9404('0x25')](db['ChatTransferReport'][_0x9404('0x23')]);_0x5c1d05[_0x9404('0x26')]=_[_0x9404('0x25')](_0x4b88cc[_0x9404('0x26')]);_0x5c1d05['filters']=_['intersection'](_0x5c1d05[_0x9404('0x24')],_0x5c1d05[_0x9404('0x26')]);_0x44453f['attributes']=_['intersection'](_0x5c1d05[_0x9404('0x24')],qs[_0x9404('0x2a')](_0x4b88cc[_0x9404('0x26')][_0x9404('0x2a')]));_0x44453f[_0x9404('0x29')]=_0x44453f[_0x9404('0x29')][_0x9404('0x2b')]?_0x44453f[_0x9404('0x29')]:_0x5c1d05[_0x9404('0x24')];if(_0x4b88cc[_0x9404('0x26')][_0x9404('0x3e')]){_0x44453f[_0x9404('0x3a')]=[{'all':!![]}];}_0x44453f=_[_0x9404('0x32')]({},_0x44453f,_0x4b88cc[_0x9404('0x37')]);return db[_0x9404('0x38')][_0x9404('0x3f')](_0x44453f)['then'](handleEntityNotFound(_0xefc859,null))['then'](respondWithResult(_0xefc859,null))[_0x9404('0x3b')](handleError(_0xefc859,null));};exports['create']=function(_0x171d84,_0x2e0023){return db['ChatTransferReport'][_0x9404('0x40')](_0x171d84['body'],{})['then'](respondWithResult(_0x2e0023,0xc9))[_0x9404('0x3b')](handleError(_0x2e0023,null));};exports['update']=function(_0x48e0d7,_0x52fadb){if(_0x48e0d7[_0x9404('0x41')]['id']){delete _0x48e0d7[_0x9404('0x41')]['id'];}return db[_0x9404('0x38')][_0x9404('0x3f')]({'where':{'id':_0x48e0d7[_0x9404('0x3d')]['id']}})[_0x9404('0x39')](handleEntityNotFound(_0x52fadb,null))[_0x9404('0x39')](saveUpdates(_0x48e0d7[_0x9404('0x41')],null))[_0x9404('0x39')](respondWithResult(_0x52fadb,null))[_0x9404('0x3b')](handleError(_0x52fadb,null));};exports['destroy']=function(_0x3a65d9,_0xb0b5d9){return db[_0x9404('0x38')][_0x9404('0x3f')]({'where':{'id':_0x3a65d9[_0x9404('0x3d')]['id']}})[_0x9404('0x39')](handleEntityNotFound(_0xb0b5d9,null))['then'](removeEntity(_0xb0b5d9,null))[_0x9404('0x3b')](handleError(_0xb0b5d9,null));};exports['describe']=function(_0x5359d0,_0x2c13bc){return db['ChatTransferReport'][_0x9404('0x42')]()['then'](respondWithResult(_0x2c13bc,null))[_0x9404('0x3b')](handleError(_0x2c13bc,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 62eff7d..ada2754 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 _0xb4d8=['uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','report_chat_transfer'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xb4d8,0xe8));var _0x8b4d=function(_0x38a1fd,_0x1ee88e){_0x38a1fd=_0x38a1fd-0x0;var _0x527b63=_0xb4d8[_0x38a1fd];return _0x527b63;};'use strict';var _=require(_0x8b4d('0x0'));var util=require(_0x8b4d('0x1'));var logger=require(_0x8b4d('0x2'))(_0x8b4d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8b4d('0x4'));var fs=require('fs');var path=require(_0x8b4d('0x5'));var rimraf=require(_0x8b4d('0x6'));var config=require(_0x8b4d('0x7'));var attributes=require(_0x8b4d('0x8'));module['exports']=function(_0x86e41,_0x562b46){return _0x86e41['define']('ChatTransferReport',attributes,{'tableName':_0x8b4d('0x9'),'paranoid':![],'indexes':[{'name':_0x8b4d('0xa'),'fields':[_0x8b4d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b74=['path','rimraf','exports','define','ChatTransferReport','uniqueid','lodash','util','api','moment','request-promise'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x6b74,0xcc));var _0x46b7=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0x6b74[_0x4843f9];return _0x193c6a;};'use strict';var _=require(_0x46b7('0x0'));var util=require(_0x46b7('0x1'));var logger=require('../../config/logger')(_0x46b7('0x2'));var moment=require(_0x46b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x46b7('0x4'));var fs=require('fs');var path=require(_0x46b7('0x5'));var rimraf=require(_0x46b7('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x46b7('0x7')]=function(_0x3005ff,_0x4df32f){return _0x3005ff[_0x46b7('0x8')](_0x46b7('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x46b7('0xa'),'fields':[_0x46b7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 0b64b56..8f21980 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 _0x5b02=['client','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2410e9,_0x6028ce){var _0x560eba=function(_0x2fac3e){while(--_0x2fac3e){_0x2410e9['push'](_0x2410e9['shift']());}};_0x560eba(++_0x6028ce);}(_0x5b02,0xe9));var _0x25b0=function(_0x24fc6c,_0x588351){_0x24fc6c=_0x24fc6c-0x0;var _0x24676e=_0x5b02[_0x24fc6c];return _0x24676e;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25b0('0x5'))(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var jayson=require(_0x25b0('0x8'));var client=jayson[_0x25b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d82c6,_0xd8276d,_0x49ef3a){return new BPromise(function(_0x412954,_0x4d3e71){return client['request'](_0x1d82c6,_0x49ef3a)[_0x25b0('0xa')](function(_0x45429b){logger[_0x25b0('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0xd8276d,_0x25b0('0xc'));logger[_0x25b0('0xd')](_0x25b0('0xe'),_0xd8276d,_0x25b0('0xc'),JSON[_0x25b0('0xf')](_0x45429b));if(_0x45429b[_0x25b0('0x10')]){if(_0x45429b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x4d3e71(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x412954(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}else{logger[_0x25b0('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0xd8276d,'request\x20sent');_0x412954(_0x45429b[_0x25b0('0x14')]['message']);}})[_0x25b0('0x15')](function(_0x1d009f){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x1d009f);_0x4d3e71(_0x1d009f);});});} \ No newline at end of file +var _0x4631=['bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','lodash','util'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x4631,0xb9));var _0x1463=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x4631[_0x33975c];return _0x1c15ab;};'use strict';var _=require(_0x1463('0x0'));var util=require(_0x1463('0x1'));var moment=require('moment');var BPromise=require(_0x1463('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(_0x1463('0x3'))(_0x1463('0x4'));var config=require(_0x1463('0x5'));var jayson=require(_0x1463('0x6'));var client=jayson[_0x1463('0x7')][_0x1463('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21c69d,_0x4f6578,_0x18f65d){return new BPromise(function(_0x218597,_0x18f3e4){return client[_0x1463('0x9')](_0x21c69d,_0x18f65d)['then'](function(_0x3fa5ae){logger[_0x1463('0xa')](_0x1463('0xb'),_0x4f6578,'request\x20sent');logger[_0x1463('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4f6578,_0x1463('0xd'),JSON['stringify'](_0x3fa5ae));if(_0x3fa5ae[_0x1463('0xe')]){if(_0x3fa5ae['error']['code']===0x1f4){logger['error'](_0x1463('0xb'),_0x4f6578,_0x3fa5ae[_0x1463('0xe')][_0x1463('0xf')]);return _0x18f3e4(_0x3fa5ae[_0x1463('0xe')][_0x1463('0xf')]);}logger[_0x1463('0xe')](_0x1463('0xb'),_0x4f6578,_0x3fa5ae[_0x1463('0xe')][_0x1463('0xf')]);return _0x218597(_0x3fa5ae[_0x1463('0xe')][_0x1463('0xf')]);}else{logger[_0x1463('0xa')](_0x1463('0xb'),_0x4f6578,_0x1463('0xd'));_0x218597(_0x3fa5ae['result'][_0x1463('0xf')]);}})[_0x1463('0x10')](function(_0x3f0239){logger[_0x1463('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x4f6578,_0x3f0239);_0x18f3e4(_0x3f0239);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index f6dbedc..2d48dfb 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 _0x9ed7=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','update'];(function(_0x84323a,_0x4eb2f0){var _0x5952e6=function(_0xe5df18){while(--_0xe5df18){_0x84323a['push'](_0x84323a['shift']());}};_0x5952e6(++_0x4eb2f0);}(_0x9ed7,0x153));var _0x79ed=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0x9ed7[_0x15106b];return _0x521203;};'use strict';var multer=require(_0x79ed('0x0'));var util=require('util');var path=require(_0x79ed('0x1'));var timeout=require('connect-timeout');var express=require(_0x79ed('0x2'));var router=express[_0x79ed('0x3')]();var auth=require(_0x79ed('0x4'));var interaction=require(_0x79ed('0x5'));var config=require(_0x79ed('0x6'));var controller=require(_0x79ed('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x79ed('0x8')]);router[_0x79ed('0x9')](_0x79ed('0xa'),auth[_0x79ed('0xb')](),controller[_0x79ed('0xc')]);router[_0x79ed('0x9')](_0x79ed('0xd'),auth[_0x79ed('0xb')](),controller[_0x79ed('0xe')]);router[_0x79ed('0xf')]('/',auth[_0x79ed('0xb')](),controller[_0x79ed('0x10')]);router['put'](_0x79ed('0xd'),auth[_0x79ed('0xb')](),controller[_0x79ed('0x11')]);router[_0x79ed('0x12')](_0x79ed('0xd'),auth['isAuthenticated'](),controller[_0x79ed('0x13')]);module[_0x79ed('0x14')]=router; \ No newline at end of file +var _0x6b29=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x54e217,_0x243297){var _0x590ead=function(_0x2f1d78){while(--_0x2f1d78){_0x54e217['push'](_0x54e217['shift']());}};_0x590ead(++_0x243297);}(_0x6b29,0x188));var _0x96b2=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x6b29[_0x580971];return _0x16d873;};'use strict';var multer=require(_0x96b2('0x0'));var util=require(_0x96b2('0x1'));var path=require(_0x96b2('0x2'));var timeout=require(_0x96b2('0x3'));var express=require(_0x96b2('0x4'));var router=express[_0x96b2('0x5')]();var auth=require(_0x96b2('0x6'));var interaction=require(_0x96b2('0x7'));var config=require(_0x96b2('0x8'));var controller=require(_0x96b2('0x9'));router['get']('/',auth[_0x96b2('0xa')](),controller[_0x96b2('0xb')]);router[_0x96b2('0xc')](_0x96b2('0xd'),auth[_0x96b2('0xa')](),controller['describe']);router[_0x96b2('0xc')](_0x96b2('0xe'),auth[_0x96b2('0xa')](),controller[_0x96b2('0xf')]);router['post']('/',auth[_0x96b2('0xa')](),controller['create']);router[_0x96b2('0x10')](_0x96b2('0xe'),auth[_0x96b2('0xa')](),controller[_0x96b2('0x11')]);router[_0x96b2('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x96b2('0x13')]);module[_0x96b2('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 ec9aa6a..9a5d1de 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 _0x85fd=['parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','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','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','address','email','Agent','#9f946a','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','name','text','onlineForm'];(function(_0x35bc54,_0x1e0bc5){var _0x3ed1b4=function(_0xa46869){while(--_0xa46869){_0x35bc54['push'](_0x35bc54['shift']());}};_0x3ed1b4(++_0x1e0bc5);}(_0x85fd,0x7d));var _0xd85f=function(_0x252441,_0x2c6379){_0x252441=_0x252441-0x0;var _0x30d6ac=_0x85fd[_0x252441];return _0x30d6ac;};'use strict';var Sequelize=require(_0xd85f('0x0'));var rs=require('randomstring');module[_0xd85f('0x1')]={'name':{'type':Sequelize[_0xd85f('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd85f('0x2')],'allowNull':![],'unique':_0xd85f('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x4')},'key':{'type':Sequelize[_0xd85f('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x5')},'customerAlias':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd85f('0x2')],'allowNull':![],'defaultValue':_0xd85f('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd85f('0x2')],'allowNull':![],'defaultValue':_0xd85f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd85f('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd85f('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd85f('0x2')]},'animation':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd85f('0x9')]('rounded',_0xd85f('0xa')),'defaultValue':_0xd85f('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd85f('0xc')},'start_chat_button':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd85f('0xd')},'header_offline':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0xe')},'download_transcript':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd85f('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd85f('0x10')]},'closingQuestion':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd85f('0x13')},'noteTitle':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x14')},'placeholderMessage':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd85f('0x16')},'closingMessageButton':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0xd')},'skipMessageButton':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x17')},'conditionAgreement':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xd85f('0x9')](_0xd85f('0x18'),_0xd85f('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd85f('0x10')],'defaultValue':function(){return JSON[_0xd85f('0x1a')]({'items':[{'type':_0xd85f('0x1b'),'variable':null,'config':{'placeholder':_0xd85f('0x1c'),'type':_0xd85f('0x1d'),'required':!![]},'props':{'title':_0xd85f('0x1c'),'helpText':''}},{'type':'input','props':{'title':_0xd85f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd85f('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xd85f('0x1e'))?JSON[_0xd85f('0x1f')](this[_0xd85f('0x20')](_0xd85f('0x1e'))):{};},'set':function(_0x533bb3){return this[_0xd85f('0x21')](_0xd85f('0x1e'),JSON[_0xd85f('0x1a')](_0x533bb3));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd85f('0x1a')]({'items':[{'type':_0xd85f('0x1b'),'props':{'title':_0xd85f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd85f('0x4'),'type':_0xd85f('0x4')},'variable':null},{'type':_0xd85f('0x22'),'config':{'placeholder':'Comments'},'props':{'title':_0xd85f('0x23'),'helpText':_0xd85f('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xd85f('0x20')](_0xd85f('0x25'))?JSON[_0xd85f('0x1f')](this['getDataValue'](_0xd85f('0x25'))):{};},'set':function(_0x3fc3cb){return this[_0xd85f('0x21')](_0xd85f('0x25'),JSON['stringify'](_0x3fc3cb));}},'token':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':function(){return rs[_0xd85f('0x26')]();}},'autoclose':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd85f('0x2')]},'forwardOffline':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x27')},'waitingMessage':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd85f('0x29')},'offlineMessageBody':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x2a')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x2b')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd85f('0x17')},'sendUnmanaged':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd85f('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd85f('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd85f('0x2c');}},'notificationSound':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd85f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x2e')},'verticalAlignment':{'type':Sequelize[_0xd85f('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x2f')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xd85f('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd85f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd85f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd85f('0x2')],'defaultValue':_0xd85f('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd85f('0x7')],'comment':_0xd85f('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd85f('0x32'),'set':function(_0x434a6f){if(!_0x434a6f)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xd85f('0x33'),_0x434a6f);}}}; \ No newline at end of file +var _0xc05d=['offlineForm','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','TEXT','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc05d,0x6b));var _0xdc05=function(_0x49d9dc,_0xf7d84d){_0x49d9dc=_0x49d9dc-0x0;var _0x93385d=_0xc05d[_0x49d9dc];return _0x93385d;};'use strict';var Sequelize=require(_0xdc05('0x0'));var rs=require(_0xdc05('0x1'));module[_0xdc05('0x2')]={'name':{'type':Sequelize[_0xdc05('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xdc05('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xdc05('0x5')},'customerAlias':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdc05('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdc05('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdc05('0x3')],'allowNull':![],'defaultValue':_0xdc05('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdc05('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdc05('0x3')]},'animation':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdc05('0x9')](_0xdc05('0xa'),'squared'),'defaultValue':_0xdc05('0xa')},'header_online':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xdc05('0xc')},'offline_chat_button':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0xd')},'header_offline':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0xe')},'download_transcript':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdc05('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdc05('0x11')},'closingMessage':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0x12')},'closingMessageButton':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0xdc05('0x13'),_0xdc05('0x14')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xdc05('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xdc05('0x15')],'defaultValue':function(){return JSON[_0xdc05('0x16')]({'items':[{'type':_0xdc05('0x17'),'variable':null,'config':{'placeholder':_0xdc05('0x18'),'type':'text','required':!![]},'props':{'title':_0xdc05('0x18'),'helpText':''}},{'type':'input','props':{'title':_0xdc05('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xdc05('0x4'),'type':_0xdc05('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdc05('0x19')](_0xdc05('0x1a'))?JSON['parse'](this[_0xdc05('0x19')]('onlineForm')):{};},'set':function(_0x57a017){return this[_0xdc05('0x1b')](_0xdc05('0x1a'),JSON[_0xdc05('0x16')](_0x57a017));}},'offlineForm':{'type':Sequelize[_0xdc05('0x15')],'defaultValue':function(){return JSON[_0xdc05('0x16')]({'items':[{'type':_0xdc05('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xdc05('0x4'),'type':_0xdc05('0x4')},'variable':null},{'type':_0xdc05('0x1c'),'config':{'placeholder':_0xdc05('0x1d')},'props':{'title':_0xdc05('0x1d'),'helpText':_0xdc05('0x1e')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xdc05('0x1f'))?JSON[_0xdc05('0x20')](this[_0xdc05('0x19')]('offlineForm')):{};},'set':function(_0x3802a6){return this[_0xdc05('0x1b')]('offlineForm',JSON[_0xdc05('0x16')](_0x3802a6));}},'token':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdc05('0x3')]},'forwardOffline':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdc05('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xdc05('0x21')},'waitingMessage':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdc05('0x24')},'skipUnmanaged':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdc05('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xdc05('0x25');}},'notificationSound':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xdc05('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xdc05('0x3')],'defaultValue':_0xdc05('0x27')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xdc05('0x15')]},'showCustomerAvatar':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdc05('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdc05('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xdc05('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc05('0x7')],'comment':_0xdc05('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdc05('0x2b'),'set':function(_0xc77d9c){if(!_0xc77d9c)this[_0xdc05('0x1b')](_0xdc05('0x2c'),null);this[_0xdc05('0x1b')](_0xdc05('0x2d'),_0xc77d9c);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index e90f17e..00ac33c 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 _0xc788=['show','params','length','include','options','find','create','body','user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','agentAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Applications','List','list','applications','orderBy','priority','asc','account','Contacts','contact','firstName','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','addInteraction','Contact','User','Owner','fullname','Tag','Tags','color','tag','getSnippet','timezone','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','all','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','connection','replace','render','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatWebsite.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','count','includeAll','findAll'];(function(_0x1da4c7,_0xd8ea1){var _0x37dac6=function(_0x20f197){while(--_0x20f197){_0x1da4c7['push'](_0x1da4c7['shift']());}};_0x37dac6(++_0xd8ea1);}(_0xc788,0xc4));var _0x8c78=function(_0x51fb3c,_0x28a763){_0x51fb3c=_0x51fb3c-0x0;var _0x941d96=_0xc788[_0x51fb3c];return _0x941d96;};'use strict';var pdf=require(_0x8c78('0x0'));var emlformat=require(_0x8c78('0x1'));var rimraf=require(_0x8c78('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c78('0x3'));var moment=require(_0x8c78('0x4'));var BPromise=require(_0x8c78('0x5'));var Mustache=require(_0x8c78('0x6'));var util=require(_0x8c78('0x7'));var path=require('path');var sox=require(_0x8c78('0x8'));var csv=require(_0x8c78('0x9'));var ejs=require(_0x8c78('0xa'));var fs=require('fs');var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x9'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c78('0x13'))(_0x8c78('0x14'));var utils=require('../../config/utils');var config=require(_0x8c78('0x15'));var db=require(_0x8c78('0x16'))['db'];config['redis']=_[_0x8c78('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8c78('0x18'))(new Redis(config[_0x8c78('0x19')]));require(_0x8c78('0x1a'))[_0x8c78('0x1b')](socket);var jayson=require(_0x8c78('0x1c'));var client=jayson[_0x8c78('0x1d')][_0x8c78('0x1e')]({'port':0x232c});var client9002=jayson[_0x8c78('0x1d')][_0x8c78('0x1e')]({'port':0x232a});var client9003=jayson[_0x8c78('0x1d')]['http']({'port':0x232b});function checkPasswordPattern(_0x1fa78e,_0x293cfe,_0x57ad11){if(_0x57ad11){var _0x45b85f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45b85f[_0x8c78('0x1f')](_0x293cfe)){return _0x1fa78e;}else{throw new Error(_0x8c78('0x20'));}}else{return _0x1fa78e;}}function respondWithRpcPromise(_0x23824e,_0x2a982c,_0x461eff,_0x54eafa){return new BPromise(function(_0x4f7bf9,_0x339d04){var _0x4a81a4=_0x54eafa||client;return _0x4a81a4['request'](_0x23824e,_0x461eff)[_0x8c78('0x21')](function(_0x56c191){logger[_0x8c78('0x22')](_0x8c78('0x23'),_0x2a982c,'request\x20sent');logger[_0x8c78('0x24')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2a982c,_0x8c78('0x25'),JSON[_0x8c78('0x26')](_0x56c191));if(_0x56c191['error']){if(_0x56c191[_0x8c78('0x27')][_0x8c78('0x28')]===0x1f4){logger['error'](_0x8c78('0x23'),_0x2a982c,_0x56c191[_0x8c78('0x27')][_0x8c78('0x29')]);return _0x339d04(_0x56c191[_0x8c78('0x27')][_0x8c78('0x29')]);}logger[_0x8c78('0x27')](_0x8c78('0x23'),_0x2a982c,_0x56c191[_0x8c78('0x27')][_0x8c78('0x29')]);return _0x4f7bf9(_0x56c191['error'][_0x8c78('0x29')]);}else{logger[_0x8c78('0x22')](_0x8c78('0x23'),_0x2a982c,'request\x20sent');_0x4f7bf9(_0x56c191[_0x8c78('0x2a')]['message']);}})[_0x8c78('0x2b')](function(_0x24f9a7){logger[_0x8c78('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x2a982c,_0x24f9a7);_0x339d04(_0x24f9a7);});});}function respondWithStatusCode(_0x583a74,_0x2568d5){_0x2568d5=_0x2568d5||0xcc;return function(_0x4be49d){if(_0x4be49d){return _0x583a74[_0x8c78('0x2c')](_0x2568d5);}return _0x583a74[_0x8c78('0x2d')](_0x2568d5)[_0x8c78('0x2e')]();};}function respondWithResult(_0x36e8e5,_0x253776){_0x253776=_0x253776||0xc8;return function(_0x2ab5cc){if(_0x2ab5cc){return _0x36e8e5['status'](_0x253776)[_0x8c78('0x2f')](_0x2ab5cc);}};}function respondWithFilteredResult(_0x51add6,_0xfa5e7b){return function(_0x17f4c8){if(_0x17f4c8){var _0xb69c52=_0x17f4c8['count'],_0x4e764f=_0xfa5e7b[_0x8c78('0x30')],_0x1f1a0c=_0xfa5e7b[_0x8c78('0x30')]+_0xfa5e7b[_0x8c78('0x31')],_0x3816d2;if(_0x1f1a0c>=_0xb69c52){_0x1f1a0c=_0xb69c52;_0x3816d2=0xc8;}else{_0x3816d2=0xce;}_0x51add6['status'](_0x3816d2);return _0x51add6[_0x8c78('0x32')](_0x8c78('0x33'),_0x4e764f+'-'+_0x1f1a0c+'/'+_0xb69c52)[_0x8c78('0x2f')](_0x17f4c8);}return null;};}function patchUpdates(_0x5348ab){return function(_0x22ec9b){try{jsonpatch[_0x8c78('0x34')](_0x22ec9b,_0x5348ab,!![]);}catch(_0x5cbfb0){return BPromise[_0x8c78('0x35')](_0x5cbfb0);}return _0x22ec9b[_0x8c78('0x36')]();};}function saveUpdates(_0x3a9372,_0x13942f){return function(_0x3c8c6c){if(_0x3c8c6c){return _0x3c8c6c[_0x8c78('0x37')](_0x3a9372)[_0x8c78('0x21')](function(_0x37a005){return _0x37a005;});}return null;};}function removeEntity(_0x201a43,_0x15a868){return function(_0x5c1f63){if(_0x5c1f63){return _0x5c1f63[_0x8c78('0x38')]()[_0x8c78('0x21')](function(){var _0x2e0c6c=_0x5c1f63[_0x8c78('0x39')]({'plain':!![]});var _0x34481a='ChatWebsites';return db[_0x8c78('0x3a')][_0x8c78('0x38')]({'where':{'type':_0x34481a,'resourceId':_0x2e0c6c['id']}})[_0x8c78('0x21')](function(){return _0x5c1f63;});})['then'](function(){_0x201a43[_0x8c78('0x2d')](0xcc)[_0x8c78('0x2e')]();});}};}function handleEntityNotFound(_0x58d7b8,_0x3cc886){return function(_0x588a54){if(!_0x588a54){_0x58d7b8[_0x8c78('0x2c')](0x194);}return _0x588a54;};}function handleError(_0xf6cc5f,_0x245f62){_0x245f62=_0x245f62||0x1f4;return function(_0x157b81){logger['error'](_0x157b81[_0x8c78('0x3b')]);if(_0x157b81['name']){delete _0x157b81[_0x8c78('0x3c')];}_0xf6cc5f[_0x8c78('0x2d')](_0x245f62)[_0x8c78('0x3d')](_0x157b81);};}exports['index']=function(_0x5a04fa,_0x3a3694){var _0x25d143={'include':[{'model':db[_0x8c78('0x3e')],'as':_0x8c78('0x3f')}]},_0x203df0={},_0x36ea82={'count':0x0,'rows':[]};var _0x326b34=db[_0x8c78('0x40')][_0x8c78('0x41')];_0x203df0[_0x8c78('0x42')]=_[_0x8c78('0x43')](_0x326b34);_0x203df0[_0x8c78('0x44')]=_[_0x8c78('0x43')](_0x5a04fa['query']);_0x203df0[_0x8c78('0x45')]=_[_0x8c78('0x46')](_0x203df0['model'],_0x203df0['query']);_0x25d143[_0x8c78('0x47')]=_[_0x8c78('0x46')](_0x203df0['model'],qs[_0x8c78('0x48')](_0x5a04fa[_0x8c78('0x44')]['fields']));_0x25d143[_0x8c78('0x47')]=_0x25d143[_0x8c78('0x47')]['length']?_0x25d143[_0x8c78('0x47')]:_0x203df0[_0x8c78('0x42')];if(!_0x5a04fa[_0x8c78('0x44')][_0x8c78('0x49')](_0x8c78('0x4a'))){_0x25d143['limit']=qs['limit'](_0x5a04fa[_0x8c78('0x44')][_0x8c78('0x31')]);_0x25d143[_0x8c78('0x30')]=qs[_0x8c78('0x30')](_0x5a04fa[_0x8c78('0x44')][_0x8c78('0x30')]);}_0x25d143[_0x8c78('0x4b')]=qs[_0x8c78('0x4c')](_0x5a04fa[_0x8c78('0x44')][_0x8c78('0x4c')]);_0x25d143[_0x8c78('0x4d')]=qs['filters'](_[_0x8c78('0x4e')](_0x5a04fa[_0x8c78('0x44')],_0x203df0[_0x8c78('0x45')]));if(_0x5a04fa[_0x8c78('0x44')][_0x8c78('0x4f')]){_0x25d143['where']=_[_0x8c78('0x50')](_0x25d143[_0x8c78('0x4d')],{'$or':_[_0x8c78('0x51')](_0x326b34,function(_0x267f87){if(_0x267f87[_0x8c78('0x52')]['key']!==_0x8c78('0x53')){var _0x541a34={};_0x541a34[_0x267f87['field']]={'$like':'%'+_0x5a04fa[_0x8c78('0x44')][_0x8c78('0x4f')]+'%'};return _0x541a34;}})});}_0x25d143=_[_0x8c78('0x50')]({},_0x25d143,_0x5a04fa['options']);var _0x1d78a0={'where':_0x25d143[_0x8c78('0x4d')]};return db[_0x8c78('0x40')][_0x8c78('0x54')](_0x1d78a0)[_0x8c78('0x21')](function(_0x38083e){_0x36ea82[_0x8c78('0x54')]=_0x38083e;if(_0x5a04fa[_0x8c78('0x44')][_0x8c78('0x55')]){_0x25d143['include']=[{'all':!![]}];}return db[_0x8c78('0x40')][_0x8c78('0x56')](_0x25d143);})[_0x8c78('0x21')](function(_0x2cbee8){_0x36ea82['rows']=_0x2cbee8;return _0x36ea82;})[_0x8c78('0x21')](respondWithFilteredResult(_0x3a3694,_0x25d143))[_0x8c78('0x2b')](handleError(_0x3a3694,null));};exports[_0x8c78('0x57')]=function(_0x431125,_0x53e75c){var _0x336b95={'raw':![],'where':{'id':_0x431125[_0x8c78('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8c78('0x3f')}]},_0x38f7af={};_0x38f7af['model']=_[_0x8c78('0x43')](db[_0x8c78('0x40')][_0x8c78('0x41')]);_0x38f7af[_0x8c78('0x44')]=_[_0x8c78('0x43')](_0x431125[_0x8c78('0x44')]);_0x38f7af[_0x8c78('0x45')]=_[_0x8c78('0x46')](_0x38f7af[_0x8c78('0x42')],_0x38f7af[_0x8c78('0x44')]);_0x336b95[_0x8c78('0x47')]=_[_0x8c78('0x46')](_0x38f7af[_0x8c78('0x42')],qs[_0x8c78('0x48')](_0x431125['query'][_0x8c78('0x48')]));_0x336b95[_0x8c78('0x47')]=_0x336b95[_0x8c78('0x47')][_0x8c78('0x59')]?_0x336b95['attributes']:_0x38f7af[_0x8c78('0x42')];if(_0x431125[_0x8c78('0x44')][_0x8c78('0x55')]){_0x336b95[_0x8c78('0x5a')]=[{'all':!![]}];}_0x336b95=_[_0x8c78('0x50')]({},_0x336b95,_0x431125[_0x8c78('0x5b')]);return db['ChatWebsite'][_0x8c78('0x5c')](_0x336b95)[_0x8c78('0x21')](handleEntityNotFound(_0x53e75c,null))['then'](respondWithResult(_0x53e75c,null))[_0x8c78('0x2b')](handleError(_0x53e75c,null));};exports['create']=function(_0x338503,_0x2a7149){return db[_0x8c78('0x40')][_0x8c78('0x5d')](_0x338503[_0x8c78('0x5e')],{})[_0x8c78('0x21')](function(_0x416a05){var _0x49fa4c=_0x338503[_0x8c78('0x5f')][_0x8c78('0x39')]({'plain':!![]});if(!_0x49fa4c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49fa4c[_0x8c78('0x60')]===_0x8c78('0x5f')){var _0x577361=_0x416a05[_0x8c78('0x39')]({'plain':!![]});var _0x2307d1=_0x8c78('0x61');return db[_0x8c78('0x62')][_0x8c78('0x5c')]({'where':{'name':_0x2307d1,'userProfileId':_0x49fa4c[_0x8c78('0x63')]},'raw':!![]})[_0x8c78('0x21')](function(_0x445630){if(_0x445630&&_0x445630[_0x8c78('0x64')]===0x0){return db[_0x8c78('0x3a')][_0x8c78('0x5d')]({'name':_0x577361[_0x8c78('0x3c')],'resourceId':_0x577361['id'],'type':_0x445630[_0x8c78('0x3c')],'sectionId':_0x445630['id']},{})[_0x8c78('0x21')](function(){return _0x416a05;});}else{return _0x416a05;}})['catch'](function(_0x3897ea){logger['error'](_0x8c78('0x65'),_0x3897ea);throw _0x3897ea;});}return _0x416a05;})['then'](respondWithResult(_0x2a7149,0xc9))['catch'](handleError(_0x2a7149,null));};exports['update']=function(_0x240ab6,_0x5d4778){if(_0x240ab6['body']['id']){delete _0x240ab6['body']['id'];}return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x240ab6[_0x8c78('0x58')]['id']},'include':[{'model':db[_0x8c78('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x8c78('0x21')](handleEntityNotFound(_0x5d4778,null))[_0x8c78('0x21')](saveUpdates(_0x240ab6[_0x8c78('0x5e')],null))[_0x8c78('0x21')](respondWithResult(_0x5d4778,null))[_0x8c78('0x2b')](handleError(_0x5d4778,null));};exports[_0x8c78('0x38')]=function(_0x3990c2,_0x54d561){return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x3990c2[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x54d561,null))[_0x8c78('0x21')](removeEntity(_0x54d561,null))[_0x8c78('0x2b')](handleError(_0x54d561,null));};exports['describe']=function(_0x46f57b,_0x4ed66c){return db[_0x8c78('0x40')][_0x8c78('0x66')]()[_0x8c78('0x21')](respondWithResult(_0x4ed66c,null))['catch'](handleError(_0x4ed66c,null));};exports[_0x8c78('0x67')]=function(_0x3e2961,_0x3f3aff,_0x4fa0b0){if(_0x3e2961[_0x8c78('0x5e')]['id']){delete _0x3e2961[_0x8c78('0x5e')]['id'];}return db['ChatWebsite'][_0x8c78('0x5c')]({'where':{'id':_0x3e2961[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x3f3aff,null))['then'](function(_0x3780cd){if(_0x3780cd){_0x3e2961[_0x8c78('0x5e')][_0x8c78('0x68')]=_0x3780cd['id'];return db[_0x8c78('0x69')][_0x8c78('0x5d')](_0x3e2961[_0x8c78('0x5e')]);}})[_0x8c78('0x21')](respondWithResult(_0x3f3aff,null))[_0x8c78('0x2b')](handleError(_0x3f3aff,null));};exports[_0x8c78('0x6a')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886={'raw':![],'where':{}};var _0x2c20d1={};var _0x35d4fa={'count':0x0,'rows':[]};return db[_0x8c78('0x40')][_0x8c78('0x6b')]({'where':{'id':_0x5646ff[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x3dcee2){if(_0x3dcee2){_0x2c20d1[_0x8c78('0x42')]=_['keys'](db['Disposition'][_0x8c78('0x41')]);_0x2c20d1['query']=_[_0x8c78('0x43')](_0x5646ff[_0x8c78('0x44')]);_0x2c20d1[_0x8c78('0x45')]=_[_0x8c78('0x46')](_0x2c20d1[_0x8c78('0x42')],_0x2c20d1[_0x8c78('0x44')]);_0x3c6886['attributes']=_['intersection'](_0x2c20d1[_0x8c78('0x42')],qs[_0x8c78('0x48')](_0x5646ff[_0x8c78('0x44')][_0x8c78('0x48')]));_0x3c6886[_0x8c78('0x47')]=_0x3c6886['attributes'][_0x8c78('0x59')]?_0x3c6886[_0x8c78('0x47')]:_0x2c20d1[_0x8c78('0x42')];if(!_0x5646ff[_0x8c78('0x44')][_0x8c78('0x49')](_0x8c78('0x4a'))){_0x3c6886['limit']=qs[_0x8c78('0x31')](_0x5646ff[_0x8c78('0x44')]['limit']);_0x3c6886[_0x8c78('0x30')]=qs[_0x8c78('0x30')](_0x5646ff[_0x8c78('0x44')][_0x8c78('0x30')]);}_0x3c6886[_0x8c78('0x4b')]=qs[_0x8c78('0x4c')](_0x5646ff[_0x8c78('0x44')][_0x8c78('0x4c')]);_0x3c6886[_0x8c78('0x4d')]=qs[_0x8c78('0x45')](_[_0x8c78('0x4e')](_0x5646ff[_0x8c78('0x44')],_0x2c20d1[_0x8c78('0x45')]));_0x3c6886[_0x8c78('0x4d')][_0x8c78('0x68')]=_0x3dcee2['id'];if(_0x5646ff[_0x8c78('0x44')][_0x8c78('0x4f')]){_0x3c6886['where']=_[_0x8c78('0x50')](_0x3c6886['where'],{'$or':_['map'](_0x3c6886[_0x8c78('0x47')],function(_0x28fbc1){var _0x2e540b={};_0x2e540b[_0x28fbc1]={'$like':'%'+_0x5646ff[_0x8c78('0x44')]['filter']+'%'};return _0x2e540b;})});}_0x3c6886=_[_0x8c78('0x50')]({},_0x3c6886,_0x5646ff[_0x8c78('0x5b')]);return db[_0x8c78('0x69')]['count']({'where':_0x3c6886[_0x8c78('0x4d')]})[_0x8c78('0x21')](function(_0x2fbf59){_0x35d4fa[_0x8c78('0x54')]=_0x2fbf59;if(_0x5646ff['query'][_0x8c78('0x55')]){_0x3c6886[_0x8c78('0x5a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3c6886);})['then'](function(_0x269c5b){_0x35d4fa[_0x8c78('0x6c')]=_0x269c5b;return _0x35d4fa;});}})[_0x8c78('0x21')](respondWithFilteredResult(_0x1f2b8f,_0x3c6886))[_0x8c78('0x2b')](handleError(_0x1f2b8f,null));};exports['removeDispositions']=function(_0xae30e3,_0x4da14f,_0x2f6e82){return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0xae30e3[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x4da14f,null))[_0x8c78('0x21')](function(_0x5b1a37){if(_0x5b1a37){return _0x5b1a37['removeDispositions'](_0xae30e3['query'][_0x8c78('0x6d')]);}})[_0x8c78('0x21')](respondWithStatusCode(_0x4da14f,null))['catch'](handleError(_0x4da14f,null));};exports[_0x8c78('0x6e')]=function(_0x1e6d75,_0x21c6ef,_0x57943b){if(_0x1e6d75[_0x8c78('0x5e')]['id']){delete _0x1e6d75['body']['id'];}return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x1e6d75[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x21c6ef,null))[_0x8c78('0x21')](function(_0x3e14c8){if(_0x3e14c8){_0x1e6d75[_0x8c78('0x5e')][_0x8c78('0x68')]=_0x3e14c8['id'];return db[_0x8c78('0x6f')][_0x8c78('0x5d')](_0x1e6d75[_0x8c78('0x5e')]);}})[_0x8c78('0x21')](respondWithResult(_0x21c6ef,null))['catch'](handleError(_0x21c6ef,null));};exports[_0x8c78('0x70')]=function(_0x427d69,_0x367ce3,_0x48fa07){var _0x2cc6f8={'raw':![],'where':{}};var _0x1ba75a={};var _0x2eeaa={'count':0x0,'rows':[]};return db[_0x8c78('0x40')]['findOne']({'where':{'id':_0x427d69[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x367ce3,null))[_0x8c78('0x21')](function(_0x5b1c9a){if(_0x5b1c9a){_0x1ba75a[_0x8c78('0x42')]=_[_0x8c78('0x43')](db[_0x8c78('0x6f')][_0x8c78('0x41')]);_0x1ba75a[_0x8c78('0x44')]=_[_0x8c78('0x43')](_0x427d69[_0x8c78('0x44')]);_0x1ba75a[_0x8c78('0x45')]=_[_0x8c78('0x46')](_0x1ba75a['model'],_0x1ba75a['query']);_0x2cc6f8[_0x8c78('0x47')]=_['intersection'](_0x1ba75a[_0x8c78('0x42')],qs[_0x8c78('0x48')](_0x427d69[_0x8c78('0x44')][_0x8c78('0x48')]));_0x2cc6f8['attributes']=_0x2cc6f8[_0x8c78('0x47')][_0x8c78('0x59')]?_0x2cc6f8[_0x8c78('0x47')]:_0x1ba75a[_0x8c78('0x42')];if(!_0x427d69[_0x8c78('0x44')][_0x8c78('0x49')](_0x8c78('0x4a'))){_0x2cc6f8['limit']=qs[_0x8c78('0x31')](_0x427d69[_0x8c78('0x44')]['limit']);_0x2cc6f8[_0x8c78('0x30')]=qs[_0x8c78('0x30')](_0x427d69[_0x8c78('0x44')][_0x8c78('0x30')]);}_0x2cc6f8[_0x8c78('0x4b')]=qs[_0x8c78('0x4c')](_0x427d69[_0x8c78('0x44')][_0x8c78('0x4c')]);_0x2cc6f8[_0x8c78('0x4d')]=qs['filters'](_[_0x8c78('0x4e')](_0x427d69[_0x8c78('0x44')],_0x1ba75a[_0x8c78('0x45')]));_0x2cc6f8[_0x8c78('0x4d')][_0x8c78('0x68')]=_0x5b1c9a['id'];if(_0x427d69[_0x8c78('0x44')][_0x8c78('0x4f')]){_0x2cc6f8[_0x8c78('0x4d')]=_[_0x8c78('0x50')](_0x2cc6f8[_0x8c78('0x4d')],{'$or':_[_0x8c78('0x51')](_0x2cc6f8[_0x8c78('0x47')],function(_0x55b69e){var _0x22e85d={};_0x22e85d[_0x55b69e]={'$like':'%'+_0x427d69[_0x8c78('0x44')][_0x8c78('0x4f')]+'%'};return _0x22e85d;})});}_0x2cc6f8=_['merge']({},_0x2cc6f8,_0x427d69[_0x8c78('0x5b')]);return db['CannedAnswer'][_0x8c78('0x54')]({'where':_0x2cc6f8[_0x8c78('0x4d')]})[_0x8c78('0x21')](function(_0x4f0eed){_0x2eeaa['count']=_0x4f0eed;if(_0x427d69['query'][_0x8c78('0x55')]){_0x2cc6f8['include']=[{'all':!![]}];}return db[_0x8c78('0x6f')]['findAll'](_0x2cc6f8);})[_0x8c78('0x21')](function(_0x3e2426){_0x2eeaa[_0x8c78('0x6c')]=_0x3e2426;return _0x2eeaa;});}})[_0x8c78('0x21')](respondWithFilteredResult(_0x367ce3,_0x2cc6f8))[_0x8c78('0x2b')](handleError(_0x367ce3,null));};exports[_0x8c78('0x71')]=function(_0x3757cc,_0x4b8f49,_0x340569){return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x3757cc['params']['id']}})['then'](handleEntityNotFound(_0x4b8f49,null))['then'](function(_0x4b886c){if(_0x4b886c){return _0x4b886c[_0x8c78('0x71')](_0x3757cc[_0x8c78('0x44')][_0x8c78('0x6d')]);}})['then'](respondWithStatusCode(_0x4b8f49,null))[_0x8c78('0x2b')](handleError(_0x4b8f49,null));};exports[_0x8c78('0x72')]=function(_0x38c19a,_0xfa86f5,_0x54ffbc){_0x38c19a[_0x8c78('0x5e')]['sitepic']=_0x38c19a[_0x8c78('0x73')]['filename'];return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x38c19a[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0xfa86f5,null))[_0x8c78('0x21')](saveUpdates(_0x38c19a[_0x8c78('0x5e')],null))[_0x8c78('0x21')](respondWithResult(_0xfa86f5,null))['catch'](handleError(_0xfa86f5,null));};exports['addAvatar']=function(_0x3f6cec,_0x80b388,_0x20fe16){_0x3f6cec[_0x8c78('0x5e')][_0x8c78('0x74')]=_0x3f6cec[_0x8c78('0x73')]['filename'];return db[_0x8c78('0x40')]['find']({'where':{'id':_0x3f6cec[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x80b388,null))[_0x8c78('0x21')](saveUpdates(_0x3f6cec[_0x8c78('0x5e')],null))[_0x8c78('0x21')](respondWithResult(_0x80b388,null))[_0x8c78('0x2b')](handleError(_0x80b388,null));};exports[_0x8c78('0x75')]=function(_0x33babd,_0x52c335,_0x42623a){_0x33babd[_0x8c78('0x5e')][_0x8c78('0x76')]=_0x33babd[_0x8c78('0x73')][_0x8c78('0x77')];return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x33babd[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x52c335,null))[_0x8c78('0x21')](saveUpdates(_0x33babd[_0x8c78('0x5e')],null))[_0x8c78('0x21')](respondWithResult(_0x52c335,null))[_0x8c78('0x2b')](handleError(_0x52c335,null));};exports[_0x8c78('0x78')]=function(_0x20ba51,_0x2ecbb1,_0x252166){_0x20ba51[_0x8c78('0x5e')]['systemAvatar']=_0x20ba51['file'][_0x8c78('0x77')];return db[_0x8c78('0x40')]['find']({'where':{'id':_0x20ba51[_0x8c78('0x58')]['id']}})['then'](handleEntityNotFound(_0x2ecbb1,null))['then'](saveUpdates(_0x20ba51[_0x8c78('0x5e')],null))['then'](respondWithResult(_0x2ecbb1,null))[_0x8c78('0x2b')](handleError(_0x2ecbb1,null));};exports[_0x8c78('0x79')]=function(_0x2c0b23,_0x594fd8,_0x2d011f){var _0x3d6306=path[_0x8c78('0x7a')](config['root'],_0x8c78('0x7b'));var _0x59da60={'where':{'id':_0x2c0b23[_0x8c78('0x58')]['id']},'attributes':['id',_0x8c78('0x7c')],'raw':!![]};var _0x2e6c75=![];return require(_0x8c78('0x7d'))[_0x8c78('0x7e')]()['then'](function(_0x157dd4){if(_0x157dd4){_0x2e6c75=_0x157dd4[_0x8c78('0x7f')];}})[_0x8c78('0x21')](function(){return db['ChatWebsite'][_0x8c78('0x5c')](_0x59da60);})[_0x8c78('0x21')](handleEntityNotFound(_0x594fd8,null))[_0x8c78('0x21')](function(_0x1e34b0){if(_0x1e34b0){if(!_[_0x8c78('0x80')](_0x1e34b0['sitepic'])){if(fs[_0x8c78('0x81')](path[_0x8c78('0x7a')](config[_0x8c78('0x82')],'server/files/images/logos/',_0x1e34b0[_0x8c78('0x7c')]))&&_0x2e6c75){_0x3d6306=path[_0x8c78('0x7a')](config['root'],_0x8c78('0x83'),_0x1e34b0[_0x8c78('0x7c')]);}}return _0x594fd8['download'](_0x3d6306);}})[_0x8c78('0x2b')](handleError(_0x594fd8,null));};exports[_0x8c78('0x84')]=function(_0x2aac96,_0x23e8db,_0x45d783){var _0x517842=path[_0x8c78('0x7a')](config[_0x8c78('0x82')],_0x8c78('0x85'));var _0x19c580={'where':{'id':_0x2aac96['params']['id']},'attributes':['id',_0x8c78('0x74')],'raw':!![]};return db['ChatWebsite'][_0x8c78('0x5c')](_0x19c580)[_0x8c78('0x21')](handleEntityNotFound(_0x23e8db,null))[_0x8c78('0x21')](function(_0x487e3c){if(_0x487e3c){if(!_[_0x8c78('0x80')](_0x487e3c['agentAvatar'])){if(fs[_0x8c78('0x81')](path['join'](config[_0x8c78('0x82')],_0x8c78('0x86'),_0x487e3c[_0x8c78('0x74')]))){_0x517842=path[_0x8c78('0x7a')](config[_0x8c78('0x82')],_0x8c78('0x86'),_0x487e3c[_0x8c78('0x74')]);}}return _0x23e8db[_0x8c78('0x87')](_0x517842);}})[_0x8c78('0x2b')](handleError(_0x23e8db,null));};exports[_0x8c78('0x88')]=function(_0x53632c,_0x14957a,_0x1e307c){var _0x1baa14=path[_0x8c78('0x7a')](config[_0x8c78('0x82')],_0x8c78('0x89'));var _0x973361={'where':{'id':_0x53632c[_0x8c78('0x58')]['id']},'attributes':['id',_0x8c78('0x76'),_0x8c78('0x8a')],'raw':!![]};return db[_0x8c78('0x40')][_0x8c78('0x5c')](_0x973361)['then'](handleEntityNotFound(_0x14957a,null))[_0x8c78('0x21')](function(_0x244148){if(_0x244148){if(!_[_0x8c78('0x80')](_0x244148['customerAvatar'])){if(fs[_0x8c78('0x81')](path[_0x8c78('0x7a')](config['root'],'server/files/images/avatars/',_0x244148['customerAvatar']))&&_0x244148[_0x8c78('0x8a')]){_0x1baa14=path[_0x8c78('0x7a')](config[_0x8c78('0x82')],_0x8c78('0x86'),_0x244148[_0x8c78('0x76')]);}}return _0x14957a[_0x8c78('0x87')](_0x1baa14);}})[_0x8c78('0x2b')](handleError(_0x14957a,null));};exports[_0x8c78('0x8b')]=function(_0x5511a3,_0x5d2567,_0x262cb7){var _0x5a27ac=path[_0x8c78('0x7a')](config[_0x8c78('0x82')],_0x8c78('0x8c'));var _0xa64514={'where':{'id':_0x5511a3[_0x8c78('0x58')]['id']},'attributes':['id',_0x8c78('0x8d')],'raw':!![]};return db[_0x8c78('0x40')]['find'](_0xa64514)['then'](handleEntityNotFound(_0x5d2567,null))[_0x8c78('0x21')](function(_0x1ffa68){if(_0x1ffa68){if(!_[_0x8c78('0x80')](_0x1ffa68['systemAvatar'])){if(fs[_0x8c78('0x81')](path[_0x8c78('0x7a')](config[_0x8c78('0x82')],_0x8c78('0x86'),_0x1ffa68[_0x8c78('0x8d')]))){_0x5a27ac=path[_0x8c78('0x7a')](config[_0x8c78('0x82')],'server/files/images/avatars/',_0x1ffa68[_0x8c78('0x8d')]);}}return _0x5d2567[_0x8c78('0x87')](_0x5a27ac);}})[_0x8c78('0x2b')](handleError(_0x5d2567,null));};exports[_0x8c78('0x8e')]=function(_0x249a01,_0x59aa74,_0x3328d){var _0x5f6412=require(_0x8c78('0x8f'));var _0x2cd26f=new _0x5f6412();var _0x46f313=_0x2cd26f[_0x8c78('0x90')](_0x249a01[_0x8c78('0x91')][_0x8c78('0x92')])[_0x8c78('0x93')]();var _0x4b2a77={'body':_0x249a01[_0x8c78('0x5e')],'channel':_0x8c78('0x94')};var _0x35abed=[];var _0x4a62cd=[];var _0x3a7cca={};var _0x1339c3=![];return db[_0x8c78('0x95')]['describe']()[_0x8c78('0x21')](function(_0x391047){if(!_0x391047){throw new db[(_0x8c78('0x96'))][(_0x8c78('0x97'))](_0x8c78('0x98'));}_0x35abed=_[_0x8c78('0x99')](_[_0x8c78('0x43')](_0x391047),['createdAt',_0x8c78('0x9a')]);_0x4a62cd=_[_0x8c78('0x99')](_[_0x8c78('0x43')](_0x391047),[_0x8c78('0x9b'),_0x8c78('0x9a'),_0x8c78('0x9c'),_0x8c78('0x9d')]);if(_0x249a01[_0x8c78('0x5e')]['id']){delete _0x249a01[_0x8c78('0x5e')]['id'];}if(_['isNil'](_0x249a01[_0x8c78('0x5e')][_0x8c78('0x9e')])){throw new db[(_0x8c78('0x96'))][(_0x8c78('0x97'))](_0x8c78('0x9f'));}if(_[_0x8c78('0x80')](_0x249a01[_0x8c78('0x5e')][_0x8c78('0x5e')])||_0x249a01['body']['body']===''){throw new db['Sequelize'][(_0x8c78('0x97'))](_0x8c78('0xa0'));}if(_['isNil'](_0x249a01[_0x8c78('0x5e')][_0x8c78('0xa1')])){throw new db[(_0x8c78('0x96'))][(_0x8c78('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a62cd);}if(!_[_0x8c78('0xa2')](_0x4a62cd,_0x249a01[_0x8c78('0x5e')][_0x8c78('0xa1')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a62cd);}_0x3a7cca[_0x249a01[_0x8c78('0x5e')][_0x8c78('0xa1')]]=_0x249a01[_0x8c78('0x5e')]['from'];})[_0x8c78('0x21')](function(){return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x249a01[_0x8c78('0x58')]['id']},'include':[{'model':db[_0x8c78('0xa3')],'as':'List','include':[{'model':db[_0x8c78('0x95')],'as':'Contacts','where':_0x3a7cca,'limit':0x1,'order':[[_0x8c78('0x9a'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x8c78('0xa4')}]});})[_0x8c78('0x21')](handleEntityNotFound(_0x59aa74,null))[_0x8c78('0x21')](function(_0x52e317){if(_0x52e317&&_0x52e317[_0x8c78('0xa5')]){_0x4b2a77['account']=_0x52e317;_0x4b2a77['applications']=_0x52e317['Applications'];_0x4b2a77[_0x8c78('0xa6')]=_0x52e317[_0x8c78('0xa5')];_0x4b2a77[_0x8c78('0xa7')]=_[_0x8c78('0xa8')](_0x4b2a77[_0x8c78('0xa7')],[_0x8c78('0xa9')],[_0x8c78('0xaa')]);if(_0x4b2a77[_0x8c78('0xab')][_0x8c78('0xa4')]){delete _0x4b2a77[_0x8c78('0xab')][_0x8c78('0xa4')];}if(_0x4b2a77['account'][_0x8c78('0xa5')]&&_0x4b2a77['account']['List'][_0x8c78('0xac')][_0x8c78('0x59')]){return _0x4b2a77['account']['List'][_0x8c78('0xac')][0x0];}var _0x4eab89=_[_0x8c78('0x17')](_0x249a01[_0x8c78('0x5e')],{'firstName':_0x249a01[_0x8c78('0x5e')]['from'],'ListId':_0x52e317[_0x8c78('0x9d')]});_0x4eab89[_0x249a01[_0x8c78('0x5e')][_0x8c78('0xa1')]]=_0x249a01[_0x8c78('0x5e')][_0x8c78('0x9e')];return db[_0x8c78('0x95')][_0x8c78('0x5d')](_0x4eab89,{'fields':_0x35abed,'raw':!![]});}})['then'](handleEntityNotFound(_0x59aa74,null))[_0x8c78('0x21')](function(_0x1b2d6a){_0x4b2a77[_0x8c78('0xad')]=_0x1b2d6a;if(_0x1b2d6a){var _0x2d9806={'ContactId':_0x1b2d6a['id'],'ChatWebsiteId':_0x249a01[_0x8c78('0x58')]['id'],'from':(_0x1b2d6a[_0x8c78('0xae')]||'')+'\x20'+(_0x1b2d6a['lastName']||''),'customerIp':_0x249a01[_0x8c78('0x5e')]['customerIp'],'referer':_0x249a01[_0x8c78('0x5e')][_0x8c78('0xaf')],'browserName':_0x46f313[_0x8c78('0xb0')][_0x8c78('0x3c')]&&_0x46f313[_0x8c78('0xb0')]['version']?util[_0x8c78('0xb1')](_0x8c78('0xb2'),_0x46f313[_0x8c78('0xb0')][_0x8c78('0x3c')],_0x46f313[_0x8c78('0xb0')][_0x8c78('0xb3')]):'unknown','browserVersion':_0x46f313[_0x8c78('0xb0')][_0x8c78('0xb3')]||_0x8c78('0xb4'),'osName':util[_0x8c78('0xb1')](_0x8c78('0xb2'),_0x46f313['os'][_0x8c78('0x3c')],_0x46f313['os']['version']),'osVersion':_0x46f313['os']['version'],'deviceModel':_0x46f313[_0x8c78('0xb5')][_0x8c78('0x42')]&&_0x46f313['device'][_0x8c78('0xb6')]?util[_0x8c78('0xb1')](_0x8c78('0xb7'),_0x46f313[_0x8c78('0xb5')]['model'],_0x46f313[_0x8c78('0xb5')]['vendor'],_0x46f313[_0x8c78('0xb5')][_0x8c78('0x52')]):null,'deviceVendor':_0x46f313[_0x8c78('0xb5')]['vendor'],'deviceType':_0x46f313[_0x8c78('0xb5')]['type'],'formData':JSON['stringify'](_0x249a01[_0x8c78('0x5e')])};var _0x279c8f={'ChatWebsiteId':_0x249a01[_0x8c78('0x58')]['id'],'closed':![]};if(_0x249a01['body'][_0x8c78('0xb8')]){_0x279c8f['threadId']=_0x249a01['body']['threadId'];return db[_0x8c78('0xb9')][_0x8c78('0x5c')]({'where':_0x279c8f})[_0x8c78('0x21')](function(_0x416226){if(_0x416226){return[_0x416226,![]];}_0x2d9806[_0x8c78('0xb8')]=_0x249a01[_0x8c78('0x5e')]['threadId'];_0x2d9806['externalUrl']=_0x249a01[_0x8c78('0x5e')][_0x8c78('0xba')];return db[_0x8c78('0xb9')][_0x8c78('0x5d')](_0x2d9806)[_0x8c78('0x21')](function(_0x1f7e96){return[_0x1f7e96,!![]];});});}_0x279c8f[_0x8c78('0xbb')]=_0x1b2d6a['id'];if(_0x249a01[_0x8c78('0x5e')][_0x8c78('0xbc')]&&_0x249a01[_0x8c78('0x5e')]['interaction']['id']){_0x279c8f['id']=_0x249a01[_0x8c78('0x5e')][_0x8c78('0xbc')]['id'];return db[_0x8c78('0xb9')]['find']({'where':_0x279c8f})[_0x8c78('0x21')](function(_0x41ac69){if(_0x41ac69){return[_0x41ac69,![]];}return db['ChatInteraction'][_0x8c78('0x5d')](_0x2d9806)[_0x8c78('0x21')](function(_0x23f013){return[_0x23f013,!![]];});});}return db[_0x8c78('0xb9')]['create'](_0x2d9806)[_0x8c78('0x21')](function(_0xcc7113){return[_0xcc7113,!![]];});}})[_0x8c78('0xbd')](function(_0x19b7d8,_0x1ead50){if(_0x19b7d8){_0x1339c3=_0x1ead50;if(!_0x1ead50){var _0x3f0deb={'from':(_0x4b2a77[_0x8c78('0xad')][_0x8c78('0xae')]||'')+'\x20'+(_0x4b2a77['contact'][_0x8c78('0xbe')]||'')};if(_0x249a01[_0x8c78('0x5e')][_0x8c78('0xb8')]&&_0x249a01[_0x8c78('0x5e')][_0x8c78('0xbf')]&&_0x249a01[_0x8c78('0x5e')][_0x8c78('0xb8')]!=_0x249a01[_0x8c78('0x5e')]['messageId']){_0x3f0deb[_0x8c78('0xb8')]=_0x249a01['body'][_0x8c78('0xbf')];}return _0x19b7d8[_0x8c78('0x37')](_0x3f0deb);}else{return _0x19b7d8;}}})[_0x8c78('0x21')](function(_0x3ff40e){_0x4b2a77[_0x8c78('0xbc')]=_0x3ff40e[_0x8c78('0x39')]({'plain':!![]});_0x4b2a77[_0x8c78('0xbc')][_0x8c78('0xc0')]=_0x1339c3;if(_0x4b2a77[_0x8c78('0xbc')][_0x8c78('0xc0')]){if(_0x4b2a77['account'][_0x8c78('0xc1')]){_0x4b2a77['applications'][_0x8c78('0xc2')]({'id':0x0,'priority':_0x4b2a77[_0x8c78('0xa7')][_0x8c78('0x59')]+0x1,'app':_0x8c78('0xc3'),'appdata':_0x8c78('0xc4'),'interval':_0x8c78('0xc5')});}}return db[_0x8c78('0xc6')]['create']({'body':_0x249a01[_0x8c78('0x5e')][_0x8c78('0x5e')],'ChatWebsiteId':_0x249a01[_0x8c78('0x58')]['id'],'ChatInteractionId':_0x3ff40e['id'],'direction':'in','ContactId':_0x4b2a77['contact']['id'],'AttachmentId':_0x249a01[_0x8c78('0x5e')][_0x8c78('0xc7')]});})[_0x8c78('0x21')](function(_0x3ed0ce){_0x4b2a77[_0x8c78('0x29')]=_0x3ed0ce;if(_0x4b2a77['interaction']['UserId']){return db['User'][_0x8c78('0x5c')]({'attributes':['id','name'],'where':{'id':_0x4b2a77[_0x8c78('0xbc')][_0x8c78('0xc8')]}})['then'](function(_0xe7959c){if(_0xe7959c){_0x4b2a77[_0x8c78('0xa7')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe7959c[_0x8c78('0x3c')]+','+(_0x4b2a77[_0x8c78('0xab')][_0x8c78('0xc9')]||0xa),'interval':_0x8c78('0xc5')});_0x4b2a77[_0x8c78('0xca')]=!![];}return respondWithRpcPromise(_0x8c78('0xcb'),_0x8c78('0xcc'),_0x4b2a77);});}return respondWithRpcPromise('Start',_0x8c78('0xcc'),_0x4b2a77);})[_0x8c78('0x21')](function(_0x3437cd){respondWithRpcPromise(_0x8c78('0xcd'),'EventManager',{'event':_0x8c78('0x8e'),'message':_0x3437cd},client9002);return _0x3437cd;})['then'](respondWithResult(_0x59aa74,null))[_0x8c78('0x2b')](handleError(_0x59aa74,null));};exports[_0x8c78('0xce')]=function(_0x5bb7d5,_0x1a7bb7,_0x10a6f5){var _0x1b28a7,_0x422007,_0x172b28;var _0x34e820=[];var _0xb6617c=[];var _0x3e3227={};return db[_0x8c78('0x95')][_0x8c78('0x66')]()[_0x8c78('0x21')](function(_0x53322c){if(!_0x53322c){throw new db[(_0x8c78('0x96'))][(_0x8c78('0x97'))](_0x8c78('0x98'));}_0xb6617c=_[_0x8c78('0x99')](_[_0x8c78('0x43')](_0x53322c),[_0x8c78('0x9b'),_0x8c78('0x9a')]);_0x34e820=_[_0x8c78('0x99')](_[_0x8c78('0x43')](_0x53322c),[_0x8c78('0x9b'),_0x8c78('0x9a'),_0x8c78('0x9c'),'ListId']);if(_0x5bb7d5[_0x8c78('0x5e')]['id']){delete _0x5bb7d5[_0x8c78('0x5e')]['id'];}if(_[_0x8c78('0x80')](_0x5bb7d5[_0x8c78('0x5e')]['from'])){throw _0x1a7bb7['status'](0x1f4)[_0x8c78('0x3d')](new db[(_0x8c78('0x96'))][(_0x8c78('0x97'))](_0x8c78('0x9f')));}if(_[_0x8c78('0x80')](_0x5bb7d5[_0x8c78('0x5e')][_0x8c78('0x5e')])||_0x5bb7d5[_0x8c78('0x5e')]['body']===''){throw _0x1a7bb7[_0x8c78('0x2d')](0x1f4)[_0x8c78('0x3d')](new db['Sequelize'][(_0x8c78('0x97'))](_0x8c78('0xa0')));}if(_[_0x8c78('0x80')](_0x5bb7d5[_0x8c78('0x5e')][_0x8c78('0xcf')])){throw _0x1a7bb7[_0x8c78('0x2d')](0x1f4)[_0x8c78('0x3d')](new db[(_0x8c78('0x96'))][(_0x8c78('0x97'))](_0x8c78('0xd0')+_0x34e820));}if(!_[_0x8c78('0xa2')](_0x34e820,_0x5bb7d5[_0x8c78('0x5e')][_0x8c78('0xcf')])){throw _0x1a7bb7[_0x8c78('0x2d')](0x1f4)['send'](new db[(_0x8c78('0x96'))]['ValidationError'](_0x8c78('0xd1')+_0x34e820));}_0x3e3227[_0x5bb7d5['body']['mapKeyOffline']]=_0x5bb7d5['body'][_0x8c78('0x9e')];})[_0x8c78('0x21')](function(){return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x5bb7d5['params']['id']},'include':[{'model':db[_0x8c78('0xa3')],'as':_0x8c78('0xa5')}]});})[_0x8c78('0x21')](handleEntityNotFound(_0x1a7bb7,null))[_0x8c78('0x21')](function(_0x3f66a8){if(_0x3f66a8&&_0x3f66a8[_0x8c78('0xa5')]){_0x422007=_0x3f66a8;var _0x2d3859=_['defaults'](_0x5bb7d5[_0x8c78('0x5e')],{'firstName':_0x5bb7d5[_0x8c78('0x5e')][_0x8c78('0x9e')],'phone':_0x5bb7d5[_0x8c78('0x5e')]['from'],'ListId':_0x3f66a8[_0x8c78('0x9d')]});_0x2d3859[_0x5bb7d5[_0x8c78('0x5e')][_0x8c78('0xcf')]]=_0x5bb7d5[_0x8c78('0x5e')][_0x8c78('0x9e')];return db[_0x8c78('0x95')][_0x8c78('0xd2')]({'where':_0x3e3227,'defaults':_0x2d3859});}})[_0x8c78('0xbd')](function(_0xe833e1){if(_0xe833e1){_0x172b28=_0xe833e1;var _0x215330=fs['readFileSync'](path[_0x8c78('0x7a')](config['root'],_0x8c78('0xd3')),_0x8c78('0xd4'));var _0x2f9e18=ejs['render'](_0x215330,{'body':_['toPairs'](_0x5bb7d5[_0x8c78('0x5e')][_0x8c78('0x5e')]),'bodyTitle':_0x422007[_0x8c78('0xd5')]});return db['ChatOfflineMessage'][_0x8c78('0x5d')]({'body':_0x2f9e18,'ContactId':_0xe833e1['id'],'ChatWebsiteId':_0x422007['id']});}})['then'](function(_0x31329b){if(_0x31329b){_0x1b28a7=_0x31329b;return db[_0x8c78('0xd6')][_0x8c78('0x6b')]({'where':{'service':!![]},'include':[{'model':db[_0x8c78('0xd7')],'as':_0x8c78('0xd8'),'raw':!![]}]});}})[_0x8c78('0x21')](function(_0x410f4b){if(_0x410f4b&&_0x410f4b[_0x8c78('0xd8')]&&_0x422007[_0x8c78('0xd9')]){var _0x38f59a={'tls':{'rejectUnauthorized':![]}};if(_0x410f4b[_0x8c78('0xd8')][_0x8c78('0xda')]){_0x38f59a[_0x8c78('0xda')]=_0x410f4b[_0x8c78('0xd8')][_0x8c78('0xda')];}else{_0x38f59a['host']=_0x410f4b['Smtp'][_0x8c78('0xdb')];_0x38f59a[_0x8c78('0xdc')]=_0x410f4b[_0x8c78('0xd8')][_0x8c78('0xdc')];_0x38f59a[_0x8c78('0xdd')]=_0x410f4b[_0x8c78('0xd8')][_0x8c78('0xdd')];}if(_0x410f4b['Smtp'][_0x8c78('0xde')]){_0x38f59a[_0x8c78('0xdf')]={'user':_0x410f4b['Smtp'][_0x8c78('0x5f')],'pass':_0x410f4b[_0x8c78('0xd8')][_0x8c78('0xe0')]};}return respondWithRpcPromise('SendMail',_0x8c78('0xe1'),{'account':_0x38f59a,'message':{'from':util['format'](_0x8c78('0xe2'),_0x410f4b['name'],_0x410f4b[_0x8c78('0xe3')]||_0x410f4b[_0x8c78('0xd8')]['user']),'to':_0x422007[_0x8c78('0xd9')],'subject':_0x422007['offlineMessageSubject'],'text':_0x1b28a7['body']}},client9003)[_0x8c78('0x21')](function(){return _0x1b28a7;})[_0x8c78('0x2b')](function(_0xb36c40){console['error'](_0xb36c40);});}})[_0x8c78('0x21')](function(){if(_0x1b28a7){return _0x1b28a7;}})[_0x8c78('0x21')](respondWithResult(_0x1a7bb7,null))[_0x8c78('0x2b')](handleError(_0x1a7bb7,null));};exports[_0x8c78('0xe4')]=function(_0xf88e5f,_0x1c70a1,_0x11c766){return db[_0x8c78('0xb9')][_0x8c78('0x5c')]({'where':{'id':_0xf88e5f[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x1c70a1,null))[_0x8c78('0x21')](function(_0x4b6057){if(_0x4b6057){return _0x4b6057[_0x8c78('0xe4')](_0xf88e5f[_0x8c78('0x5e')][_0x8c78('0x6d')],_['omit'](_0xf88e5f[_0x8c78('0x5e')],['ids','id'])||{});}})[_0x8c78('0x21')](respondWithResult(_0x1c70a1,null))[_0x8c78('0x2b')](handleError(_0x1c70a1,null));};exports['getInteractions']=function(_0x3b2178,_0x2dc5bc,_0x33eb20){var _0xb8ef39={'raw':![],'where':{}};var _0xd9566a={};var _0x22cd49={'count':0x0,'rows':[]};return db[_0x8c78('0x40')][_0x8c78('0x6b')]({'where':{'id':_0x3b2178[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x2dc5bc,null))[_0x8c78('0x21')](function(_0x6687d5){if(_0x6687d5){_0xd9566a[_0x8c78('0x42')]=_['keys'](db[_0x8c78('0xb9')][_0x8c78('0x41')]);_0xd9566a[_0x8c78('0x44')]=_[_0x8c78('0x43')](_0x3b2178['query']);_0xd9566a['filters']=_[_0x8c78('0x46')](_0xd9566a[_0x8c78('0x42')],_0xd9566a[_0x8c78('0x44')]);_0xb8ef39[_0x8c78('0x47')]=_[_0x8c78('0x46')](_0xd9566a[_0x8c78('0x42')],qs['fields'](_0x3b2178['query'][_0x8c78('0x48')]));_0xb8ef39[_0x8c78('0x47')]=_0xb8ef39[_0x8c78('0x47')][_0x8c78('0x59')]?_0xb8ef39[_0x8c78('0x47')]:_0xd9566a[_0x8c78('0x42')];if(!_0x3b2178[_0x8c78('0x44')][_0x8c78('0x49')]('nolimit')){_0xb8ef39[_0x8c78('0x31')]=qs[_0x8c78('0x31')](_0x3b2178[_0x8c78('0x44')]['limit']);_0xb8ef39[_0x8c78('0x30')]=qs['offset'](_0x3b2178['query'][_0x8c78('0x30')]);}_0xb8ef39[_0x8c78('0x4b')]=qs['sort'](_0x3b2178[_0x8c78('0x44')][_0x8c78('0x4c')]);_0xb8ef39[_0x8c78('0x4d')]=qs['filters'](_[_0x8c78('0x4e')](_0x3b2178['query'],_0xd9566a['filters']));_0xb8ef39[_0x8c78('0x4d')][_0x8c78('0x68')]=_0x6687d5['id'];if(_0x3b2178[_0x8c78('0x44')][_0x8c78('0x4f')]){_0xb8ef39[_0x8c78('0x4d')]=_[_0x8c78('0x50')](_0xb8ef39[_0x8c78('0x4d')],{'$or':_[_0x8c78('0x51')](_0xb8ef39[_0x8c78('0x47')],function(_0x4a98b2){var _0x412fbe={};_0x412fbe[_0x4a98b2]={'$like':'%'+_0x3b2178[_0x8c78('0x44')][_0x8c78('0x4f')]+'%'};return _0x412fbe;})});}_0xb8ef39=_['merge']({},_0xb8ef39,_0x3b2178[_0x8c78('0x5b')]);return db['ChatInteraction'][_0x8c78('0x54')]({'where':_0xb8ef39['where']})['then'](function(_0x16e5dd){_0x22cd49[_0x8c78('0x54')]=_0x16e5dd;if(_0x3b2178[_0x8c78('0x44')][_0x8c78('0x55')]){_0xb8ef39[_0x8c78('0x5a')]=[{'model':db[_0x8c78('0x95')],'as':_0x8c78('0xe5'),'required':![]},{'model':db[_0x8c78('0xe6')],'as':_0x8c78('0xe7'),'attributes':[_0x8c78('0x3c'),_0x8c78('0xe8'),'internal'],'required':![]},{'model':db[_0x8c78('0xe9')],'as':_0x8c78('0xea'),'attributes':['id',_0x8c78('0x3c'),_0x8c78('0xeb')],'where':_0x3b2178[_0x8c78('0x44')][_0x8c78('0xec')]?{'id':_0x3b2178[_0x8c78('0x44')][_0x8c78('0xec')]}:undefined,'required':_0x3b2178[_0x8c78('0x44')]['tag']?!![]:![]}];}return db[_0x8c78('0xb9')]['findAll'](_0xb8ef39);})[_0x8c78('0x21')](function(_0x206dbe){_0x22cd49[_0x8c78('0x6c')]=_0x206dbe;return _0x22cd49;});}})['then'](respondWithFilteredResult(_0x2dc5bc,_0xb8ef39))['catch'](handleError(_0x2dc5bc,null));};function iftimePromise(_0x207701,_0x39e491){return respondWithRpcPromise('Command',_0x8c78('0xed'),{'command':_0x39e491[_0x8c78('0xee')]?util['format']('iftime\x20%s,%s',_0x207701[_0x8c78('0xef')],_0x39e491[_0x8c78('0xee')]):util['format']('iftime\x20%s',_0x207701[_0x8c78('0xef')])},client9002)[_0x8c78('0x21')](function(_0x475792){var _0x5267dd=_0x475792&&_0x475792['indexOf']('true')>=0x0?!![]:![];logger[_0x8c78('0x22')](_0x8c78('0xf0'),_0x39e491['id'],_0x207701['id'],_0x207701['interval'],_0x5267dd?'ONLINE':'OFFLINE',_0x39e491[_0x8c78('0xee')]?_0x39e491[_0x8c78('0xee')]:_0x8c78('0xf1'));return _0x5267dd;})[_0x8c78('0x2b')](function(_0x1345ef){logger[_0x8c78('0x27')](_0x8c78('0xf0'),_0x39e491['id'],_0x207701['id'],_0x207701[_0x8c78('0xef')],util[_0x8c78('0xf2')](_0x1345ef,{'showHidden':![],'depth':null}),_0x39e491[_0x8c78('0xee')]?_0x39e491[_0x8c78('0xee')]:'No\x20timezone');return![];});}exports[_0x8c78('0xed')]=function(_0xd2b224,_0x3a176f,_0x35fa17){var _0x39bba9=0x0;var _0x2cf562=0x0;var _0x2473f6=![];var _0x3f47d0;var _0x24a681;return db[_0x8c78('0x40')]['find']({'where':{'id':_0xd2b224['params']['id']},'include':[{'model':db[_0x8c78('0xf3')],'as':'Interval','include':[{'model':db[_0x8c78('0xf3')],'as':_0x8c78('0xf4'),'attributes':['id',_0x8c78('0xef')],'raw':!![]}]}]})[_0x8c78('0x21')](handleEntityNotFound(_0x3a176f,null))[_0x8c78('0x21')](function(_0x27ecbb){if(_0x27ecbb){_0x3f47d0=_0x27ecbb;return _0x27ecbb['getProactiveActions']({'raw':!![]});}})['then'](function(_0x6ec0e7){if(_0x3f47d0){if(_0x6ec0e7){_0x24a681=_0x6ec0e7;}}return require('../../config/license/util')[_0x8c78('0x7e')]();})[_0x8c78('0x21')](function(_0x451306){if(_0x451306){_0x2cf562=_0x451306[_0x8c78('0xf5')];_0x2473f6=_0x451306[_0x8c78('0x7f')];}})[_0x8c78('0x21')](function(){return db[_0x8c78('0xb9')][_0x8c78('0x54')]({'where':{'closed':![]}});})[_0x8c78('0x21')](function(_0x1da08a){_0x39bba9=_0x1da08a;if(_0x2cf562&&_0x1da08a>_0x2cf562){return db[_0x8c78('0xf6')][_0x8c78('0x6b')]({'where':{'id':0x1}})['then'](function(_0x3b88d5){if(_0x3b88d5){_0x3b88d5[_0x8c78('0xf7')]('chatLicenseExceeded');}});}})[_0x8c78('0x21')](function(){if(_0x3f47d0[_0x8c78('0xf3')]&&_0x3f47d0[_0x8c78('0xf3')][_0x8c78('0xf4')]){var _0x15901a=[];for(var _0x3f2f86=0x0;_0x3f2f86<_0x3f47d0[_0x8c78('0xf3')][_0x8c78('0xf4')][_0x8c78('0x59')];_0x3f2f86++){var _0x5a80e2=_0x3f47d0[_0x8c78('0xf3')][_0x8c78('0xf4')][_0x3f2f86][_0x8c78('0x39')]({'plain':!![]});_0x15901a['push'](iftimePromise(_0x5a80e2,_0x3f47d0));}return BPromise[_0x8c78('0xf8')](_0x15901a)[_0x8c78('0x21')](function(_0x4d63d6){return _['some'](_0x4d63d6);});}else{return!![];}})[_0x8c78('0x21')](function(_0x26db13){var _0x46c362=fs['readFileSync'](path['join'](config[_0x8c78('0x82')],_0x8c78('0xf9')),_0x8c78('0xd4'));var _0x51b692={'remote':_0x3f47d0[_0x8c78('0xfa')],'query':querystring[_0x8c78('0x26')](_[_0x8c78('0x50')](_0x3f47d0[_0x8c78('0x39')]({'plain':!![]}),{'customerIp':_0xd2b224['headers'][_0x8c78('0xfb')]||_0xd2b224['headers'][_0x8c78('0xfc')]||_0xd2b224[_0x8c78('0xfd')]['remoteAddress']||_0xd2b224['ip'],'referer':_0xd2b224[_0x8c78('0x91')][_0x8c78('0xaf')],'openedInteractions':_0x39bba9,'maxInteractions':_0x2cf562,'virtual':_0x2473f6[_0x8c78('0xf5')],'online':_0x26db13,'custom':_0x2473f6}))[_0x8c78('0xfe')](/'/g,'\x5c\x27')};_0x3a176f['send'](ejs[_0x8c78('0xff')](Mustache['render'](_0x46c362,_0x51b692),{'proactiveActions':_0x24a681,'alignment':_0x3f47d0[_0x8c78('0x100')],'verticalAlignment':_0x3f47d0[_0x8c78('0x101')]}));})[_0x8c78('0x2b')](handleError(_0x3a176f,null));};exports[_0x8c78('0x102')]=function(_0x4099b5,_0x4d243a,_0x52b9fa){return db[_0x8c78('0x40')][_0x8c78('0x6b')]({'where':{'id':_0x4099b5[_0x8c78('0x58')]['id']}})['then'](handleEntityNotFound(_0x4d243a,null))[_0x8c78('0x21')](function(_0x32cd85){if(_0x32cd85){return db[_0x8c78('0x103')][_0x8c78('0x104')](function(_0x26989f){return db[_0x8c78('0x105')][_0x8c78('0x38')]({'where':{'ChatWebsiteId':_0x4099b5[_0x8c78('0x58')]['id']},'transaction':_0x26989f})[_0x8c78('0x21')](function(_0x5531cb){var _0x3368d1=_[_0x8c78('0x51')](_0x4099b5[_0x8c78('0x5e')],function(_0x512c6a){_0x512c6a[_0x8c78('0x68')]=_0x4099b5[_0x8c78('0x58')]['id'];return _0x512c6a;});return db[_0x8c78('0x105')][_0x8c78('0x106')](_0x3368d1,{'transaction':_0x26989f});});})[_0x8c78('0x21')](function(){return db[_0x8c78('0x105')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4099b5[_0x8c78('0x58')]['id']},'order':_0x8c78('0xa9')});});}})[_0x8c78('0x21')](respondWithResult(_0x4d243a,null))[_0x8c78('0x2b')](handleError(_0x4d243a,null));};exports[_0x8c78('0x107')]=function(_0x89f2fd,_0x2f4d70,_0xe956ec){var _0x781aae={};var _0x4f1b3c={};var _0x25fcf8;var _0x3c04e1;return db[_0x8c78('0x40')][_0x8c78('0x6b')]({'where':{'id':_0x89f2fd['params']['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x2f4d70,null))['then'](function(_0x3ee0a0){if(_0x3ee0a0){_0x25fcf8=_0x3ee0a0;_0x4f1b3c[_0x8c78('0x42')]=_[_0x8c78('0x43')](db[_0x8c78('0x105')][_0x8c78('0x41')]);_0x4f1b3c[_0x8c78('0x44')]=_[_0x8c78('0x43')](_0x89f2fd[_0x8c78('0x44')]);_0x4f1b3c['filters']=_['intersection'](_0x4f1b3c[_0x8c78('0x42')],_0x4f1b3c[_0x8c78('0x44')]);_0x781aae[_0x8c78('0x47')]=_[_0x8c78('0x46')](_0x4f1b3c['model'],qs[_0x8c78('0x48')](_0x89f2fd[_0x8c78('0x44')]['fields']));_0x781aae['attributes']=_0x781aae['attributes'][_0x8c78('0x59')]?_0x781aae['attributes']:_0x4f1b3c[_0x8c78('0x42')];_0x781aae[_0x8c78('0x4b')]=qs[_0x8c78('0x4c')](_0x89f2fd[_0x8c78('0x44')][_0x8c78('0x4c')]);_0x781aae[_0x8c78('0x4d')]=qs[_0x8c78('0x45')](_['pick'](_0x89f2fd[_0x8c78('0x44')],_0x4f1b3c[_0x8c78('0x45')]));if(_0x89f2fd[_0x8c78('0x44')][_0x8c78('0x4f')]){_0x781aae[_0x8c78('0x4d')]=_[_0x8c78('0x50')](_0x781aae[_0x8c78('0x4d')],{'$or':_[_0x8c78('0x51')](_0x781aae[_0x8c78('0x47')],function(_0x2c2460){var _0x3d9614={};_0x3d9614[_0x2c2460]={'$like':'%'+_0x89f2fd[_0x8c78('0x44')][_0x8c78('0x4f')]+'%'};return _0x3d9614;})});}_0x781aae=_[_0x8c78('0x50')]({},_0x781aae,_0x89f2fd[_0x8c78('0x5b')]);return _0x25fcf8['getApplications'](_0x781aae);}})[_0x8c78('0x21')](function(_0x4d8d50){if(_0x4d8d50){_0x3c04e1=_0x4d8d50[_0x8c78('0x59')];if(!_0x89f2fd[_0x8c78('0x44')][_0x8c78('0x49')](_0x8c78('0x4a'))){_0x781aae[_0x8c78('0x31')]=qs[_0x8c78('0x31')](_0x89f2fd[_0x8c78('0x44')][_0x8c78('0x31')]);_0x781aae[_0x8c78('0x30')]=qs[_0x8c78('0x30')](_0x89f2fd['query']['offset']);}return _0x25fcf8[_0x8c78('0x107')](_0x781aae);}})[_0x8c78('0x21')](function(_0x29ecc7){if(_0x29ecc7){return _0x29ecc7?{'count':_0x3c04e1,'rows':_0x29ecc7}:null;}})[_0x8c78('0x21')](respondWithResult(_0x2f4d70,null))[_0x8c78('0x2b')](handleError(_0x2f4d70,null));};exports[_0x8c78('0x108')]=function(_0xf9904e,_0x3d5c07,_0xd60e60){return db[_0x8c78('0x109')][_0x8c78('0x5c')]({'where':{'id':_0xf9904e[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x3d5c07,null))[_0x8c78('0x21')](function(_0xcd1f){if(_0xcd1f){return _0xcd1f[_0x8c78('0x108')](_0xf9904e['body'][_0x8c78('0x6d')],_[_0x8c78('0x10a')](_0xf9904e[_0x8c78('0x5e')],[_0x8c78('0x6d'),'id'])||{});}})[_0x8c78('0x21')](respondWithResult(_0x3d5c07,null))[_0x8c78('0x2b')](handleError(_0x3d5c07,null));};exports[_0x8c78('0x10b')]=function(_0xa8977e,_0xc8e32d,_0x5c3989){var _0x151e15={};var _0x112889={};var _0x4b05ae;var _0x500830;return db['ChatWebsite'][_0x8c78('0x6b')]({'where':{'id':_0xa8977e[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0xc8e32d,null))['then'](function(_0x3c687f){if(_0x3c687f){_0x4b05ae=_0x3c687f;_0x112889[_0x8c78('0x42')]=_[_0x8c78('0x43')](db[_0x8c78('0x10c')][_0x8c78('0x41')]);_0x112889[_0x8c78('0x44')]=_[_0x8c78('0x43')](_0xa8977e['query']);_0x112889[_0x8c78('0x45')]=_[_0x8c78('0x46')](_0x112889[_0x8c78('0x42')],_0x112889[_0x8c78('0x44')]);_0x151e15[_0x8c78('0x47')]=_['intersection'](_0x112889['model'],qs[_0x8c78('0x48')](_0xa8977e[_0x8c78('0x44')][_0x8c78('0x48')]));_0x151e15[_0x8c78('0x47')]=_0x151e15[_0x8c78('0x47')]['length']?_0x151e15[_0x8c78('0x47')]:_0x112889[_0x8c78('0x42')];_0x151e15[_0x8c78('0x4b')]=qs['sort'](_0xa8977e['query'][_0x8c78('0x4c')]);_0x151e15[_0x8c78('0x4d')]=qs[_0x8c78('0x45')](_[_0x8c78('0x4e')](_0xa8977e[_0x8c78('0x44')],_0x112889[_0x8c78('0x45')]));if(_0xa8977e[_0x8c78('0x44')][_0x8c78('0x4f')]){_0x151e15[_0x8c78('0x4d')]=_[_0x8c78('0x50')](_0x151e15[_0x8c78('0x4d')],{'$or':_[_0x8c78('0x51')](_0x151e15[_0x8c78('0x47')],function(_0x45b55e){var _0x12c0bd={};_0x12c0bd[_0x45b55e]={'$like':'%'+_0xa8977e[_0x8c78('0x44')]['filter']+'%'};return _0x12c0bd;})});}_0x151e15=_[_0x8c78('0x50')]({},_0x151e15,_0xa8977e['options']);return _0x4b05ae[_0x8c78('0x10b')](_0x151e15);}})[_0x8c78('0x21')](function(_0x68450a){if(_0x68450a){_0x500830=_0x68450a[_0x8c78('0x59')];if(!_0xa8977e[_0x8c78('0x44')][_0x8c78('0x49')](_0x8c78('0x4a'))){_0x151e15[_0x8c78('0x31')]=qs[_0x8c78('0x31')](_0xa8977e[_0x8c78('0x44')][_0x8c78('0x31')]);_0x151e15[_0x8c78('0x30')]=qs[_0x8c78('0x30')](_0xa8977e[_0x8c78('0x44')][_0x8c78('0x30')]);}return _0x4b05ae[_0x8c78('0x10b')](_0x151e15);}})['then'](function(_0x43450e){if(_0x43450e){return _0x43450e?{'count':_0x500830,'rows':_0x43450e}:null;}})['then'](respondWithResult(_0xc8e32d,null))[_0x8c78('0x2b')](handleError(_0xc8e32d,null));};exports[_0x8c78('0x10d')]=function(_0x55ec00,_0xa42686,_0x3320d7){var _0x358edd=_0x55ec00[_0x8c78('0x44')]['online']===_0x8c78('0x10e')?_0x8c78('0x10f'):_0x8c78('0x110');return db['ChatWebsite']['find']({'attributes':['id',_0x358edd],'where':{'id':_0x55ec00['params']['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0xa42686,null))[_0x8c78('0x21')](function(_0x5f2c42){if(_0x5f2c42){var _0x232561=_0x5f2c42[_0x358edd];var _0x4aad0a=_0x232561&&_0x232561['items']?_0x232561[_0x8c78('0x111')]:[];_0xa42686['send']({'fromKey':_[_0x8c78('0x80')](_0x232561[_0x8c78('0x112')])?undefined:_0x232561['fromKey'],'count':_0x4aad0a[_0x8c78('0x59')],'rows':_0x4aad0a});}})['catch'](handleError(_0xa42686,null));};exports[_0x8c78('0x113')]=function(_0x1afcd2,_0x373bbe,_0x2508ba){var _0x1b201f={'raw':!![],'where':{}};var _0x2d6e6c={};var _0xb526e8={'count':0x0,'rows':[]};return db[_0x8c78('0x40')][_0x8c78('0x6b')]({'where':{'id':_0x1afcd2[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x373bbe,null))['then'](function(_0x3d5b86){if(_0x3d5b86){_0x2d6e6c[_0x8c78('0x42')]=_[_0x8c78('0x43')](db[_0x8c78('0x114')][_0x8c78('0x41')]);_0x2d6e6c[_0x8c78('0x44')]=_[_0x8c78('0x43')](_0x1afcd2[_0x8c78('0x44')]);_0x2d6e6c[_0x8c78('0x45')]=_['intersection'](_0x2d6e6c[_0x8c78('0x42')],_0x2d6e6c[_0x8c78('0x44')]);_0x1b201f[_0x8c78('0x47')]=_[_0x8c78('0x46')](_0x2d6e6c[_0x8c78('0x42')],qs[_0x8c78('0x48')](_0x1afcd2[_0x8c78('0x44')][_0x8c78('0x48')]));_0x1b201f[_0x8c78('0x47')]=_0x1b201f[_0x8c78('0x47')][_0x8c78('0x59')]?_0x1b201f[_0x8c78('0x47')]:_0x2d6e6c[_0x8c78('0x42')];if(!_0x1afcd2[_0x8c78('0x44')][_0x8c78('0x49')]('nolimit')){_0x1b201f[_0x8c78('0x31')]=qs['limit'](_0x1afcd2['query'][_0x8c78('0x31')]);_0x1b201f[_0x8c78('0x30')]=qs[_0x8c78('0x30')](_0x1afcd2['query']['offset']);}_0x1b201f[_0x8c78('0x4b')]=qs[_0x8c78('0x4c')](_0x1afcd2['query']['sort']);_0x1b201f['where']=qs[_0x8c78('0x45')](_[_0x8c78('0x4e')](_0x1afcd2[_0x8c78('0x44')],_0x2d6e6c[_0x8c78('0x45')]));_0x1b201f[_0x8c78('0x4d')][_0x8c78('0x68')]=_0x3d5b86['id'];if(_0x1afcd2[_0x8c78('0x44')][_0x8c78('0x4f')]){_0x1b201f['where']=_[_0x8c78('0x50')](_0x1b201f[_0x8c78('0x4d')],{'$or':_[_0x8c78('0x51')](_0x1b201f['attributes'],function(_0x3beecb){var _0x288323={};_0x288323[_0x3beecb]={'$like':'%'+_0x1afcd2[_0x8c78('0x44')]['filter']+'%'};return _0x288323;})});}_0x1b201f=_['merge']({},_0x1b201f,_0x1afcd2[_0x8c78('0x5b')]);return db[_0x8c78('0x114')][_0x8c78('0x54')]({'where':_0x1b201f[_0x8c78('0x4d')]})[_0x8c78('0x21')](function(_0x2533f8){_0xb526e8[_0x8c78('0x54')]=_0x2533f8;if(_0x1afcd2[_0x8c78('0x44')][_0x8c78('0x55')]){_0x1b201f[_0x8c78('0x5a')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x8c78('0x56')](_0x1b201f);})[_0x8c78('0x21')](function(_0x17cfc3){_0xb526e8[_0x8c78('0x6c')]=_0x17cfc3;return _0xb526e8;});}})[_0x8c78('0x21')](respondWithFilteredResult(_0x373bbe,_0x1b201f))['catch'](handleError(_0x373bbe,null));};exports['addAgents']=function(_0x4d4df0,_0x4e13fb,_0x4f5b56){return db[_0x8c78('0x40')][_0x8c78('0x5c')]({'where':{'id':_0x4d4df0['params']['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x4e13fb,null))[_0x8c78('0x21')](function(_0x2a15bd){if(_0x2a15bd){return _0x2a15bd[_0x8c78('0x115')](_0x4d4df0[_0x8c78('0x5e')][_0x8c78('0x6d')],_['omit'](_0x4d4df0[_0x8c78('0x5e')],[_0x8c78('0x6d'),'id'])||{})[_0x8c78('0xbd')](function(_0x119f6f){for(var _0x150b33=0x0;_0x150b33<_0x4d4df0[_0x8c78('0x5e')][_0x8c78('0x6d')][_0x8c78('0x59')];_0x150b33+=0x1){socket['emit']('userChatWebsite:save',{'UserId':_0x4d4df0[_0x8c78('0x5e')][_0x8c78('0x6d')][_0x150b33],'ChatWebsiteId':_0x4d4df0['params']['id']});}return _0x119f6f;});}})[_0x8c78('0x21')](respondWithResult(_0x4e13fb,null))[_0x8c78('0x2b')](handleError(_0x4e13fb,null));};exports[_0x8c78('0x116')]=function(_0x291286,_0x35d31f,_0xee553c){return db[_0x8c78('0x40')]['find']({'where':{'id':_0x291286[_0x8c78('0x58')]['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x35d31f,null))['then'](function(_0x1e9308){if(_0x1e9308){return _0x1e9308[_0x8c78('0x116')](_0x291286[_0x8c78('0x44')][_0x8c78('0x6d')])[_0x8c78('0x21')](function(){if(_[_0x8c78('0x117')](_0x291286[_0x8c78('0x44')]['ids'])){for(var _0x521616=0x0;_0x521616<_0x291286['query'][_0x8c78('0x6d')][_0x8c78('0x59')];_0x521616+=0x1){socket[_0x8c78('0x118')](_0x8c78('0x119'),{'UserId':Number(_0x291286[_0x8c78('0x44')][_0x8c78('0x6d')][_0x521616]),'ChatWebsiteId':Number(_0x291286['params']['id'])});}}else{socket['emit'](_0x8c78('0x119'),{'UserId':Number(_0x291286[_0x8c78('0x44')][_0x8c78('0x6d')]),'ChatWebsiteId':Number(_0x291286[_0x8c78('0x58')]['id'])});}});}})[_0x8c78('0x21')](respondWithStatusCode(_0x35d31f,null))['catch'](handleError(_0x35d31f,null));};exports[_0x8c78('0x11a')]=function(_0x1a24c5,_0x18247b,_0x1c5cac){var _0x1ddbba={};var _0x226e68={};var _0xbadea7;var _0x2fcf73;return db['ChatWebsite']['findOne']({'where':{'id':_0x1a24c5['params']['id']}})[_0x8c78('0x21')](handleEntityNotFound(_0x18247b,null))[_0x8c78('0x21')](function(_0x4b8341){if(_0x4b8341){_0xbadea7=_0x4b8341;_0x226e68[_0x8c78('0x42')]=_[_0x8c78('0x43')](db[_0x8c78('0xe6')][_0x8c78('0x41')]);_0x226e68['query']=_['keys'](_0x1a24c5[_0x8c78('0x44')]);_0x226e68[_0x8c78('0x45')]=_[_0x8c78('0x46')](_0x226e68[_0x8c78('0x42')],_0x226e68[_0x8c78('0x44')]);_0x1ddbba[_0x8c78('0x47')]=_[_0x8c78('0x46')](_0x226e68[_0x8c78('0x42')],qs['fields'](_0x1a24c5['query']['fields']));_0x1ddbba[_0x8c78('0x47')]=_0x1ddbba[_0x8c78('0x47')][_0x8c78('0x59')]?_0x1ddbba['attributes']:_0x226e68[_0x8c78('0x42')];_0x1ddbba[_0x8c78('0x4b')]=qs['sort'](_0x1a24c5[_0x8c78('0x44')]['sort']);_0x1ddbba[_0x8c78('0x4d')]=qs[_0x8c78('0x45')](_[_0x8c78('0x4e')](_0x1a24c5[_0x8c78('0x44')],_0x226e68[_0x8c78('0x45')]));if(_0x1a24c5['query']['filter']){_0x1ddbba['where']=_[_0x8c78('0x50')](_0x1ddbba['where'],{'$or':_['map'](_0x1ddbba['attributes'],function(_0x3e3582){var _0x1c2027={};_0x1c2027[_0x3e3582]={'$like':'%'+_0x1a24c5[_0x8c78('0x44')][_0x8c78('0x4f')]+'%'};return _0x1c2027;})});}_0x1ddbba=_[_0x8c78('0x50')]({},_0x1ddbba,_0x1a24c5[_0x8c78('0x5b')]);return _0xbadea7[_0x8c78('0x11a')](_0x1ddbba);}})[_0x8c78('0x21')](function(_0x2502d6){if(_0x2502d6){_0x2fcf73=_0x2502d6[_0x8c78('0x59')];if(!_0x1a24c5['query'][_0x8c78('0x49')]('nolimit')){_0x1ddbba[_0x8c78('0x31')]=qs[_0x8c78('0x31')](_0x1a24c5[_0x8c78('0x44')][_0x8c78('0x31')]);_0x1ddbba[_0x8c78('0x30')]=qs[_0x8c78('0x30')](_0x1a24c5['query'][_0x8c78('0x30')]);}return _0xbadea7['getAgents'](_0x1ddbba);}})[_0x8c78('0x21')](function(_0x4875c9){if(_0x4875c9){return _0x4875c9?{'count':_0x2fcf73,'rows':_0x4875c9}:null;}})['then'](respondWithResult(_0x18247b,null))[_0x8c78('0x2b')](handleError(_0x18247b,null));}; \ No newline at end of file +var _0x2dae=['mandatoryDispositionPause','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','pick','ChatWebsiteId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.png','getLicense','custom','isNil','sitepic','root','server/files/images/logos/','getAvatar','download','getCustomerAvatar','showCustomerAvatar','existsSync','server/files/images/avatars/','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','chat','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','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','CmContact','Contacts','DESC','ChatApplication','List','applications','Applications','orderBy','priority','asc','account','contact','firstName','customerIp','referer','name','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','offline','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','getInteractions','fullname','Tags','color','tag','Command','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','timezone','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-forwarded-for','connection','remoteAddress','replace','render','alignment','verticalAlignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','index','ChatWebsite','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','include','findAll','rows','show','Pause'];(function(_0x57966a,_0x477964){var _0x191765=function(_0x106a01){while(--_0x106a01){_0x57966a['push'](_0x57966a['shift']());}};_0x191765(++_0x477964);}(_0x2dae,0xc3));var _0xe2da=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x2dae[_0x51fe5f];return _0x4abce9;};'use strict';var pdf=require(_0xe2da('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe2da('0x1'));var zipdir=require(_0xe2da('0x2'));var jsonpatch=require(_0xe2da('0x3'));var rp=require(_0xe2da('0x4'));var moment=require(_0xe2da('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe2da('0x6'));var util=require(_0xe2da('0x7'));var path=require(_0xe2da('0x8'));var sox=require(_0xe2da('0x9'));var csv=require('to-csv');var ejs=require(_0xe2da('0xa'));var fs=require('fs');var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x10'));var querystring=require(_0xe2da('0x11'));var Papa=require(_0xe2da('0x12'));var Redis=require('ioredis');var authService=require(_0xe2da('0x13'));var qs=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var db=require(_0xe2da('0x1a'))['db'];config['redis']=_[_0xe2da('0x1b')](config['redis'],{'host':_0xe2da('0x1c'),'port':0x18eb});var socket=require(_0xe2da('0x1d'))(new Redis(config[_0xe2da('0x1e')]));require(_0xe2da('0x1f'))[_0xe2da('0x20')](socket);var jayson=require(_0xe2da('0x21'));var client=jayson[_0xe2da('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xe2da('0x22')]['http']({'port':0x232a});var client9003=jayson['client'][_0xe2da('0x23')]({'port':0x232b});function checkPasswordPattern(_0x3dfc52,_0x33f919,_0x4dc58b){if(_0x4dc58b){var _0x25d4fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25d4fa[_0xe2da('0x24')](_0x33f919)){return _0x3dfc52;}else{throw new Error(_0xe2da('0x25'));}}else{return _0x3dfc52;}}function respondWithRpcPromise(_0x33568f,_0x4e1623,_0x45bb92,_0x1f7d33){return new BPromise(function(_0x417363,_0x2e5730){var _0x329ffe=_0x1f7d33||client;return _0x329ffe['request'](_0x33568f,_0x45bb92)[_0xe2da('0x26')](function(_0x2e16b2){logger['info'](_0xe2da('0x27'),_0x4e1623,_0xe2da('0x28'));logger[_0xe2da('0x29')](_0xe2da('0x2a'),_0x4e1623,_0xe2da('0x28'),JSON[_0xe2da('0x2b')](_0x2e16b2));if(_0x2e16b2['error']){if(_0x2e16b2[_0xe2da('0x2c')]['code']===0x1f4){logger[_0xe2da('0x2c')](_0xe2da('0x27'),_0x4e1623,_0x2e16b2[_0xe2da('0x2c')][_0xe2da('0x2d')]);return _0x2e5730(_0x2e16b2[_0xe2da('0x2c')][_0xe2da('0x2d')]);}logger[_0xe2da('0x2c')](_0xe2da('0x27'),_0x4e1623,_0x2e16b2['error'][_0xe2da('0x2d')]);return _0x417363(_0x2e16b2[_0xe2da('0x2c')][_0xe2da('0x2d')]);}else{logger[_0xe2da('0x2e')](_0xe2da('0x27'),_0x4e1623,_0xe2da('0x28'));_0x417363(_0x2e16b2[_0xe2da('0x2f')]['message']);}})[_0xe2da('0x30')](function(_0x3e23d7){logger[_0xe2da('0x2c')](_0xe2da('0x27'),_0x4e1623,_0x3e23d7);_0x2e5730(_0x3e23d7);});});}function respondWithStatusCode(_0x36ca43,_0x2b6c9e){_0x2b6c9e=_0x2b6c9e||0xcc;return function(_0x1b4aff){if(_0x1b4aff){return _0x36ca43[_0xe2da('0x31')](_0x2b6c9e);}return _0x36ca43['status'](_0x2b6c9e)['end']();};}function respondWithResult(_0x5e259a,_0x3c4845){_0x3c4845=_0x3c4845||0xc8;return function(_0x8c91db){if(_0x8c91db){return _0x5e259a[_0xe2da('0x32')](_0x3c4845)[_0xe2da('0x33')](_0x8c91db);}};}function respondWithFilteredResult(_0x5de7fb,_0x490794){return function(_0x356ab4){if(_0x356ab4){var _0x1ec8ca=_0x356ab4[_0xe2da('0x34')],_0x262d40=_0x490794[_0xe2da('0x35')],_0x39f983=_0x490794[_0xe2da('0x35')]+_0x490794[_0xe2da('0x36')],_0x7ab5ee;if(_0x39f983>=_0x1ec8ca){_0x39f983=_0x1ec8ca;_0x7ab5ee=0xc8;}else{_0x7ab5ee=0xce;}_0x5de7fb['status'](_0x7ab5ee);return _0x5de7fb['set'](_0xe2da('0x37'),_0x262d40+'-'+_0x39f983+'/'+_0x1ec8ca)[_0xe2da('0x33')](_0x356ab4);}return null;};}function patchUpdates(_0x2cb457){return function(_0x34f5fe){try{jsonpatch[_0xe2da('0x38')](_0x34f5fe,_0x2cb457,!![]);}catch(_0x27e86d){return BPromise[_0xe2da('0x39')](_0x27e86d);}return _0x34f5fe[_0xe2da('0x3a')]();};}function saveUpdates(_0x28e61a,_0x46df04){return function(_0x3087a8){if(_0x3087a8){return _0x3087a8[_0xe2da('0x3b')](_0x28e61a)[_0xe2da('0x26')](function(_0x19d6c8){return _0x19d6c8;});}return null;};}function removeEntity(_0x3649cd,_0x2618a1){return function(_0x109d51){if(_0x109d51){return _0x109d51[_0xe2da('0x3c')]()['then'](function(){var _0x32dddc=_0x109d51[_0xe2da('0x3d')]({'plain':!![]});var _0x39dae5='ChatWebsites';return db[_0xe2da('0x3e')][_0xe2da('0x3c')]({'where':{'type':_0x39dae5,'resourceId':_0x32dddc['id']}})[_0xe2da('0x26')](function(){return _0x109d51;});})['then'](function(){_0x3649cd['status'](0xcc)[_0xe2da('0x3f')]();});}};}function handleEntityNotFound(_0x1f4a5a,_0x4d6e6c){return function(_0x2e7324){if(!_0x2e7324){_0x1f4a5a[_0xe2da('0x31')](0x194);}return _0x2e7324;};}function handleError(_0x3aefe2,_0x256a0c){_0x256a0c=_0x256a0c||0x1f4;return function(_0x3a6ca3){logger['error'](_0x3a6ca3[_0xe2da('0x40')]);if(_0x3a6ca3['name']){delete _0x3a6ca3['name'];}_0x3aefe2[_0xe2da('0x32')](_0x256a0c)['send'](_0x3a6ca3);};}exports[_0xe2da('0x41')]=function(_0x27435b,_0x54d8a3){var _0x365968={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ef0e8={},_0x538f1f={'count':0x0,'rows':[]};var _0x2d9c0a=db[_0xe2da('0x42')][_0xe2da('0x43')];_0x3ef0e8[_0xe2da('0x44')]=_[_0xe2da('0x45')](_0x2d9c0a);_0x3ef0e8[_0xe2da('0x46')]=_[_0xe2da('0x45')](_0x27435b['query']);_0x3ef0e8[_0xe2da('0x47')]=_[_0xe2da('0x48')](_0x3ef0e8[_0xe2da('0x44')],_0x3ef0e8[_0xe2da('0x46')]);_0x365968[_0xe2da('0x49')]=_['intersection'](_0x3ef0e8[_0xe2da('0x44')],qs[_0xe2da('0x4a')](_0x27435b[_0xe2da('0x46')]['fields']));_0x365968[_0xe2da('0x49')]=_0x365968[_0xe2da('0x49')][_0xe2da('0x4b')]?_0x365968[_0xe2da('0x49')]:_0x3ef0e8[_0xe2da('0x44')];if(!_0x27435b[_0xe2da('0x46')][_0xe2da('0x4c')](_0xe2da('0x4d'))){_0x365968['limit']=qs[_0xe2da('0x36')](_0x27435b[_0xe2da('0x46')][_0xe2da('0x36')]);_0x365968[_0xe2da('0x35')]=qs[_0xe2da('0x35')](_0x27435b['query'][_0xe2da('0x35')]);}_0x365968[_0xe2da('0x4e')]=qs[_0xe2da('0x4f')](_0x27435b[_0xe2da('0x46')][_0xe2da('0x4f')]);_0x365968[_0xe2da('0x50')]=qs[_0xe2da('0x47')](_['pick'](_0x27435b[_0xe2da('0x46')],_0x3ef0e8['filters']));if(_0x27435b[_0xe2da('0x46')][_0xe2da('0x51')]){_0x365968[_0xe2da('0x50')]=_['merge'](_0x365968[_0xe2da('0x50')],{'$or':_[_0xe2da('0x52')](_0x2d9c0a,function(_0x525912){if(_0x525912[_0xe2da('0x53')][_0xe2da('0x54')]!==_0xe2da('0x55')){var _0x55ae08={};_0x55ae08[_0x525912[_0xe2da('0x56')]]={'$like':'%'+_0x27435b['query']['filter']+'%'};return _0x55ae08;}})});}_0x365968=_[_0xe2da('0x57')]({},_0x365968,_0x27435b['options']);var _0x3af438={'where':_0x365968[_0xe2da('0x50')]};return db['ChatWebsite'][_0xe2da('0x34')](_0x3af438)[_0xe2da('0x26')](function(_0x482547){_0x538f1f['count']=_0x482547;if(_0x27435b[_0xe2da('0x46')]['includeAll']){_0x365968[_0xe2da('0x58')]=[{'all':!![]}];}return db[_0xe2da('0x42')][_0xe2da('0x59')](_0x365968);})[_0xe2da('0x26')](function(_0x3e46b){_0x538f1f[_0xe2da('0x5a')]=_0x3e46b;return _0x538f1f;})[_0xe2da('0x26')](respondWithFilteredResult(_0x54d8a3,_0x365968))[_0xe2da('0x30')](handleError(_0x54d8a3,null));};exports[_0xe2da('0x5b')]=function(_0x515f9b,_0x3ce9a8){var _0x157c36={'raw':![],'where':{'id':_0x515f9b['params']['id']},'include':[{'model':db[_0xe2da('0x5c')],'as':_0xe2da('0x5d')}]},_0x3adab5={};_0x3adab5[_0xe2da('0x44')]=_[_0xe2da('0x45')](db[_0xe2da('0x42')][_0xe2da('0x43')]);_0x3adab5[_0xe2da('0x46')]=_['keys'](_0x515f9b['query']);_0x3adab5[_0xe2da('0x47')]=_[_0xe2da('0x48')](_0x3adab5[_0xe2da('0x44')],_0x3adab5['query']);_0x157c36['attributes']=_[_0xe2da('0x48')](_0x3adab5['model'],qs[_0xe2da('0x4a')](_0x515f9b[_0xe2da('0x46')][_0xe2da('0x4a')]));_0x157c36[_0xe2da('0x49')]=_0x157c36[_0xe2da('0x49')][_0xe2da('0x4b')]?_0x157c36[_0xe2da('0x49')]:_0x3adab5[_0xe2da('0x44')];if(_0x515f9b[_0xe2da('0x46')]['includeAll']){_0x157c36[_0xe2da('0x58')]=[{'all':!![]}];}_0x157c36=_[_0xe2da('0x57')]({},_0x157c36,_0x515f9b[_0xe2da('0x5e')]);return db[_0xe2da('0x42')]['find'](_0x157c36)[_0xe2da('0x26')](handleEntityNotFound(_0x3ce9a8,null))[_0xe2da('0x26')](respondWithResult(_0x3ce9a8,null))[_0xe2da('0x30')](handleError(_0x3ce9a8,null));};exports['create']=function(_0x394511,_0x24cd44){return db[_0xe2da('0x42')][_0xe2da('0x5f')](_0x394511[_0xe2da('0x60')],{})[_0xe2da('0x26')](function(_0x12128b){var _0x377db9=_0x394511[_0xe2da('0x61')][_0xe2da('0x3d')]({'plain':!![]});if(!_0x377db9)throw new Error(_0xe2da('0x62'));if(_0x377db9[_0xe2da('0x63')]==='user'){var _0x2b50cb=_0x12128b[_0xe2da('0x3d')]({'plain':!![]});var _0xe5d403=_0xe2da('0x64');return db[_0xe2da('0x65')][_0xe2da('0x66')]({'where':{'name':_0xe5d403,'userProfileId':_0x377db9[_0xe2da('0x67')]},'raw':!![]})['then'](function(_0x214ff6){if(_0x214ff6&&_0x214ff6['autoAssociation']===0x0){return db[_0xe2da('0x3e')][_0xe2da('0x5f')]({'name':_0x2b50cb['name'],'resourceId':_0x2b50cb['id'],'type':_0x214ff6['name'],'sectionId':_0x214ff6['id']},{})[_0xe2da('0x26')](function(){return _0x12128b;});}else{return _0x12128b;}})['catch'](function(_0x48e2b1){logger['error'](_0xe2da('0x68'),_0x48e2b1);throw _0x48e2b1;});}return _0x12128b;})[_0xe2da('0x26')](respondWithResult(_0x24cd44,0xc9))[_0xe2da('0x30')](handleError(_0x24cd44,null));};exports['update']=function(_0x5610db,_0x5f280f){if(_0x5610db[_0xe2da('0x60')]['id']){delete _0x5610db[_0xe2da('0x60')]['id'];}return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x5610db['params']['id']},'include':[{'model':db[_0xe2da('0x5c')],'as':_0xe2da('0x5d')}]})[_0xe2da('0x26')](handleEntityNotFound(_0x5f280f,null))[_0xe2da('0x26')](saveUpdates(_0x5610db[_0xe2da('0x60')],null))[_0xe2da('0x26')](respondWithResult(_0x5f280f,null))[_0xe2da('0x30')](handleError(_0x5f280f,null));};exports['destroy']=function(_0x18592d,_0x4666b3){return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x18592d[_0xe2da('0x69')]['id']}})['then'](handleEntityNotFound(_0x4666b3,null))[_0xe2da('0x26')](removeEntity(_0x4666b3,null))['catch'](handleError(_0x4666b3,null));};exports[_0xe2da('0x6a')]=function(_0x4d5997,_0x2b6694){return db['ChatWebsite']['describe']()[_0xe2da('0x26')](respondWithResult(_0x2b6694,null))[_0xe2da('0x30')](handleError(_0x2b6694,null));};exports[_0xe2da('0x6b')]=function(_0x37eccf,_0x2e8aa9,_0x44b96e){if(_0x37eccf[_0xe2da('0x60')]['id']){delete _0x37eccf[_0xe2da('0x60')]['id'];}return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x37eccf['params']['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x2e8aa9,null))[_0xe2da('0x26')](function(_0x3eb2c3){if(_0x3eb2c3){_0x37eccf[_0xe2da('0x60')]['ChatWebsiteId']=_0x3eb2c3['id'];return db[_0xe2da('0x6c')][_0xe2da('0x5f')](_0x37eccf[_0xe2da('0x60')]);}})[_0xe2da('0x26')](respondWithResult(_0x2e8aa9,null))['catch'](handleError(_0x2e8aa9,null));};exports[_0xe2da('0x6d')]=function(_0x57bf38,_0x36431a,_0x3c2294){var _0x5bde50={'raw':![],'where':{}};var _0x19f06f={};var _0xe006f5={'count':0x0,'rows':[]};return db[_0xe2da('0x42')][_0xe2da('0x6e')]({'where':{'id':_0x57bf38[_0xe2da('0x69')]['id']}})['then'](handleEntityNotFound(_0x36431a,null))[_0xe2da('0x26')](function(_0x53a070){if(_0x53a070){_0x19f06f['model']=_['keys'](db['Disposition'][_0xe2da('0x43')]);_0x19f06f[_0xe2da('0x46')]=_[_0xe2da('0x45')](_0x57bf38[_0xe2da('0x46')]);_0x19f06f[_0xe2da('0x47')]=_[_0xe2da('0x48')](_0x19f06f[_0xe2da('0x44')],_0x19f06f[_0xe2da('0x46')]);_0x5bde50[_0xe2da('0x49')]=_['intersection'](_0x19f06f[_0xe2da('0x44')],qs[_0xe2da('0x4a')](_0x57bf38[_0xe2da('0x46')][_0xe2da('0x4a')]));_0x5bde50[_0xe2da('0x49')]=_0x5bde50[_0xe2da('0x49')][_0xe2da('0x4b')]?_0x5bde50[_0xe2da('0x49')]:_0x19f06f[_0xe2da('0x44')];if(!_0x57bf38[_0xe2da('0x46')]['hasOwnProperty'](_0xe2da('0x4d'))){_0x5bde50[_0xe2da('0x36')]=qs[_0xe2da('0x36')](_0x57bf38[_0xe2da('0x46')][_0xe2da('0x36')]);_0x5bde50[_0xe2da('0x35')]=qs[_0xe2da('0x35')](_0x57bf38[_0xe2da('0x46')][_0xe2da('0x35')]);}_0x5bde50[_0xe2da('0x4e')]=qs[_0xe2da('0x4f')](_0x57bf38[_0xe2da('0x46')]['sort']);_0x5bde50[_0xe2da('0x50')]=qs['filters'](_[_0xe2da('0x6f')](_0x57bf38[_0xe2da('0x46')],_0x19f06f[_0xe2da('0x47')]));_0x5bde50[_0xe2da('0x50')][_0xe2da('0x70')]=_0x53a070['id'];if(_0x57bf38[_0xe2da('0x46')][_0xe2da('0x51')]){_0x5bde50['where']=_[_0xe2da('0x57')](_0x5bde50[_0xe2da('0x50')],{'$or':_[_0xe2da('0x52')](_0x5bde50[_0xe2da('0x49')],function(_0x273520){var _0x1dc743={};_0x1dc743[_0x273520]={'$like':'%'+_0x57bf38['query'][_0xe2da('0x51')]+'%'};return _0x1dc743;})});}_0x5bde50=_[_0xe2da('0x57')]({},_0x5bde50,_0x57bf38[_0xe2da('0x5e')]);return db[_0xe2da('0x6c')][_0xe2da('0x34')]({'where':_0x5bde50[_0xe2da('0x50')]})[_0xe2da('0x26')](function(_0x4e72b7){_0xe006f5[_0xe2da('0x34')]=_0x4e72b7;if(_0x57bf38[_0xe2da('0x46')][_0xe2da('0x71')]){_0x5bde50[_0xe2da('0x58')]=[{'all':!![]}];}return db[_0xe2da('0x6c')][_0xe2da('0x59')](_0x5bde50);})['then'](function(_0x166f97){_0xe006f5['rows']=_0x166f97;return _0xe006f5;});}})['then'](respondWithFilteredResult(_0x36431a,_0x5bde50))[_0xe2da('0x30')](handleError(_0x36431a,null));};exports[_0xe2da('0x72')]=function(_0x4afc18,_0x539c43,_0x3f0e80){return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x4afc18[_0xe2da('0x69')]['id']}})['then'](handleEntityNotFound(_0x539c43,null))[_0xe2da('0x26')](function(_0x4e2325){if(_0x4e2325){return _0x4e2325['removeDispositions'](_0x4afc18[_0xe2da('0x46')][_0xe2da('0x73')]);}})[_0xe2da('0x26')](respondWithStatusCode(_0x539c43,null))[_0xe2da('0x30')](handleError(_0x539c43,null));};exports[_0xe2da('0x74')]=function(_0x42210e,_0x4990a4,_0x761f4d){if(_0x42210e[_0xe2da('0x60')]['id']){delete _0x42210e[_0xe2da('0x60')]['id'];}return db['ChatWebsite'][_0xe2da('0x66')]({'where':{'id':_0x42210e[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x4990a4,null))['then'](function(_0x21ac55){if(_0x21ac55){_0x42210e[_0xe2da('0x60')][_0xe2da('0x70')]=_0x21ac55['id'];return db[_0xe2da('0x75')][_0xe2da('0x5f')](_0x42210e['body']);}})[_0xe2da('0x26')](respondWithResult(_0x4990a4,null))[_0xe2da('0x30')](handleError(_0x4990a4,null));};exports[_0xe2da('0x76')]=function(_0x30da68,_0xfecbd,_0x3f6082){var _0x1fff3f={'raw':![],'where':{}};var _0x10d3ed={};var _0x862f5c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe2da('0x6e')]({'where':{'id':_0x30da68[_0xe2da('0x69')]['id']}})['then'](handleEntityNotFound(_0xfecbd,null))[_0xe2da('0x26')](function(_0x5c5baa){if(_0x5c5baa){_0x10d3ed['model']=_['keys'](db[_0xe2da('0x75')][_0xe2da('0x43')]);_0x10d3ed['query']=_[_0xe2da('0x45')](_0x30da68['query']);_0x10d3ed[_0xe2da('0x47')]=_[_0xe2da('0x48')](_0x10d3ed[_0xe2da('0x44')],_0x10d3ed[_0xe2da('0x46')]);_0x1fff3f[_0xe2da('0x49')]=_[_0xe2da('0x48')](_0x10d3ed[_0xe2da('0x44')],qs['fields'](_0x30da68['query'][_0xe2da('0x4a')]));_0x1fff3f[_0xe2da('0x49')]=_0x1fff3f[_0xe2da('0x49')][_0xe2da('0x4b')]?_0x1fff3f['attributes']:_0x10d3ed[_0xe2da('0x44')];if(!_0x30da68['query'][_0xe2da('0x4c')](_0xe2da('0x4d'))){_0x1fff3f[_0xe2da('0x36')]=qs[_0xe2da('0x36')](_0x30da68[_0xe2da('0x46')][_0xe2da('0x36')]);_0x1fff3f['offset']=qs[_0xe2da('0x35')](_0x30da68[_0xe2da('0x46')][_0xe2da('0x35')]);}_0x1fff3f[_0xe2da('0x4e')]=qs[_0xe2da('0x4f')](_0x30da68[_0xe2da('0x46')][_0xe2da('0x4f')]);_0x1fff3f[_0xe2da('0x50')]=qs['filters'](_[_0xe2da('0x6f')](_0x30da68['query'],_0x10d3ed[_0xe2da('0x47')]));_0x1fff3f[_0xe2da('0x50')]['ChatWebsiteId']=_0x5c5baa['id'];if(_0x30da68['query'][_0xe2da('0x51')]){_0x1fff3f['where']=_[_0xe2da('0x57')](_0x1fff3f[_0xe2da('0x50')],{'$or':_[_0xe2da('0x52')](_0x1fff3f['attributes'],function(_0x33c94c){var _0x4cc5cc={};_0x4cc5cc[_0x33c94c]={'$like':'%'+_0x30da68['query'][_0xe2da('0x51')]+'%'};return _0x4cc5cc;})});}_0x1fff3f=_[_0xe2da('0x57')]({},_0x1fff3f,_0x30da68['options']);return db[_0xe2da('0x75')]['count']({'where':_0x1fff3f[_0xe2da('0x50')]})[_0xe2da('0x26')](function(_0x2d3a76){_0x862f5c[_0xe2da('0x34')]=_0x2d3a76;if(_0x30da68[_0xe2da('0x46')]['includeAll']){_0x1fff3f[_0xe2da('0x58')]=[{'all':!![]}];}return db[_0xe2da('0x75')][_0xe2da('0x59')](_0x1fff3f);})['then'](function(_0x36f141){_0x862f5c[_0xe2da('0x5a')]=_0x36f141;return _0x862f5c;});}})[_0xe2da('0x26')](respondWithFilteredResult(_0xfecbd,_0x1fff3f))[_0xe2da('0x30')](handleError(_0xfecbd,null));};exports[_0xe2da('0x77')]=function(_0x87545d,_0x126530,_0x22142f){return db['ChatWebsite']['find']({'where':{'id':_0x87545d[_0xe2da('0x69')]['id']}})['then'](handleEntityNotFound(_0x126530,null))[_0xe2da('0x26')](function(_0x1d54ec){if(_0x1d54ec){return _0x1d54ec[_0xe2da('0x77')](_0x87545d[_0xe2da('0x46')][_0xe2da('0x73')]);}})[_0xe2da('0x26')](respondWithStatusCode(_0x126530,null))[_0xe2da('0x30')](handleError(_0x126530,null));};exports['addLogo']=function(_0x346ed7,_0x5c5342,_0x1d8a75){_0x346ed7['body']['sitepic']=_0x346ed7[_0xe2da('0x78')][_0xe2da('0x79')];return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x346ed7[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x5c5342,null))[_0xe2da('0x26')](saveUpdates(_0x346ed7['body'],null))[_0xe2da('0x26')](respondWithResult(_0x5c5342,null))[_0xe2da('0x30')](handleError(_0x5c5342,null));};exports[_0xe2da('0x7a')]=function(_0x49bae7,_0x11288d,_0x4852f7){_0x49bae7['body'][_0xe2da('0x7b')]=_0x49bae7[_0xe2da('0x78')]['filename'];return db['ChatWebsite'][_0xe2da('0x66')]({'where':{'id':_0x49bae7['params']['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x11288d,null))[_0xe2da('0x26')](saveUpdates(_0x49bae7[_0xe2da('0x60')],null))[_0xe2da('0x26')](respondWithResult(_0x11288d,null))[_0xe2da('0x30')](handleError(_0x11288d,null));};exports[_0xe2da('0x7c')]=function(_0x5be60a,_0x29a89d,_0xc41f34){_0x5be60a[_0xe2da('0x60')][_0xe2da('0x7d')]=_0x5be60a[_0xe2da('0x78')][_0xe2da('0x79')];return db['ChatWebsite'][_0xe2da('0x66')]({'where':{'id':_0x5be60a[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x29a89d,null))['then'](saveUpdates(_0x5be60a[_0xe2da('0x60')],null))[_0xe2da('0x26')](respondWithResult(_0x29a89d,null))[_0xe2da('0x30')](handleError(_0x29a89d,null));};exports[_0xe2da('0x7e')]=function(_0x30f413,_0x2b6c45,_0x4e7789){_0x30f413['body'][_0xe2da('0x7f')]=_0x30f413[_0xe2da('0x78')]['filename'];return db['ChatWebsite'][_0xe2da('0x66')]({'where':{'id':_0x30f413['params']['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x2b6c45,null))[_0xe2da('0x26')](saveUpdates(_0x30f413['body'],null))[_0xe2da('0x26')](respondWithResult(_0x2b6c45,null))[_0xe2da('0x30')](handleError(_0x2b6c45,null));};exports[_0xe2da('0x80')]=function(_0x3603b1,_0x7f1097,_0x18f79a){var _0x5bc403=path[_0xe2da('0x81')](config['root'],_0xe2da('0x82'));var _0x39c44b={'where':{'id':_0x3603b1[_0xe2da('0x69')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x39ef54=![];return require('../../config/license/util')[_0xe2da('0x83')]()['then'](function(_0x4c6b21){if(_0x4c6b21){_0x39ef54=_0x4c6b21[_0xe2da('0x84')];}})['then'](function(){return db[_0xe2da('0x42')][_0xe2da('0x66')](_0x39c44b);})[_0xe2da('0x26')](handleEntityNotFound(_0x7f1097,null))[_0xe2da('0x26')](function(_0x242092){if(_0x242092){if(!_[_0xe2da('0x85')](_0x242092[_0xe2da('0x86')])){if(fs['existsSync'](path['join'](config[_0xe2da('0x87')],_0xe2da('0x88'),_0x242092[_0xe2da('0x86')]))&&_0x39ef54){_0x5bc403=path[_0xe2da('0x81')](config[_0xe2da('0x87')],_0xe2da('0x88'),_0x242092['sitepic']);}}return _0x7f1097['download'](_0x5bc403);}})[_0xe2da('0x30')](handleError(_0x7f1097,null));};exports[_0xe2da('0x89')]=function(_0x817216,_0x53e5c8,_0x54c148){var _0x122b47=path[_0xe2da('0x81')](config[_0xe2da('0x87')],'server/files/images/avatars/default_avatar.png');var _0x32d697={'where':{'id':_0x817216['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe2da('0x42')]['find'](_0x32d697)['then'](handleEntityNotFound(_0x53e5c8,null))[_0xe2da('0x26')](function(_0x7a762c){if(_0x7a762c){if(!_[_0xe2da('0x85')](_0x7a762c[_0xe2da('0x7b')])){if(fs['existsSync'](path[_0xe2da('0x81')](config['root'],'server/files/images/avatars/',_0x7a762c['agentAvatar']))){_0x122b47=path[_0xe2da('0x81')](config[_0xe2da('0x87')],'server/files/images/avatars/',_0x7a762c[_0xe2da('0x7b')]);}}return _0x53e5c8[_0xe2da('0x8a')](_0x122b47);}})['catch'](handleError(_0x53e5c8,null));};exports[_0xe2da('0x8b')]=function(_0x229b4d,_0x50aa0f,_0x2f9b17){var _0x5a1eb0=path[_0xe2da('0x81')](config[_0xe2da('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x50ff2c={'where':{'id':_0x229b4d[_0xe2da('0x69')]['id']},'attributes':['id',_0xe2da('0x7d'),_0xe2da('0x8c')],'raw':!![]};return db['ChatWebsite']['find'](_0x50ff2c)['then'](handleEntityNotFound(_0x50aa0f,null))['then'](function(_0x244e96){if(_0x244e96){if(!_[_0xe2da('0x85')](_0x244e96[_0xe2da('0x7d')])){if(fs[_0xe2da('0x8d')](path[_0xe2da('0x81')](config[_0xe2da('0x87')],_0xe2da('0x8e'),_0x244e96[_0xe2da('0x7d')]))&&_0x244e96[_0xe2da('0x8c')]){_0x5a1eb0=path[_0xe2da('0x81')](config[_0xe2da('0x87')],_0xe2da('0x8e'),_0x244e96['customerAvatar']);}}return _0x50aa0f[_0xe2da('0x8a')](_0x5a1eb0);}})[_0xe2da('0x30')](handleError(_0x50aa0f,null));};exports['getSystemAvatar']=function(_0x134373,_0x38cf52,_0xe6181a){var _0x16b8c4=path['join'](config[_0xe2da('0x87')],_0xe2da('0x8f'));var _0x17060b={'where':{'id':_0x134373[_0xe2da('0x69')]['id']},'attributes':['id',_0xe2da('0x7f')],'raw':!![]};return db[_0xe2da('0x42')][_0xe2da('0x66')](_0x17060b)[_0xe2da('0x26')](handleEntityNotFound(_0x38cf52,null))[_0xe2da('0x26')](function(_0x106673){if(_0x106673){if(!_[_0xe2da('0x85')](_0x106673[_0xe2da('0x7f')])){if(fs['existsSync'](path[_0xe2da('0x81')](config[_0xe2da('0x87')],_0xe2da('0x8e'),_0x106673['systemAvatar']))){_0x16b8c4=path[_0xe2da('0x81')](config[_0xe2da('0x87')],_0xe2da('0x8e'),_0x106673[_0xe2da('0x7f')]);}}return _0x38cf52[_0xe2da('0x8a')](_0x16b8c4);}})[_0xe2da('0x30')](handleError(_0x38cf52,null));};exports['notify']=function(_0x1535e3,_0x1b8217,_0x540e77){var _0x3a19ab=require(_0xe2da('0x90'));var _0x5b3310=new _0x3a19ab();var _0x4b82a0=_0x5b3310[_0xe2da('0x91')](_0x1535e3[_0xe2da('0x92')]['user-agent'])[_0xe2da('0x93')]();var _0x21c008={'body':_0x1535e3[_0xe2da('0x60')],'channel':_0xe2da('0x94')};var _0x300d19=[];var _0x5af48a=[];var _0x3320d4={};var _0x341a0a=![];return db['CmContact']['describe']()['then'](function(_0x6e59db){if(!_0x6e59db){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x300d19=_[_0xe2da('0x95')](_['keys'](_0x6e59db),[_0xe2da('0x96'),_0xe2da('0x97')]);_0x5af48a=_[_0xe2da('0x95')](_[_0xe2da('0x45')](_0x6e59db),['createdAt',_0xe2da('0x97'),_0xe2da('0x98'),_0xe2da('0x99')]);if(_0x1535e3[_0xe2da('0x60')]['id']){delete _0x1535e3[_0xe2da('0x60')]['id'];}if(_[_0xe2da('0x85')](_0x1535e3[_0xe2da('0x60')][_0xe2da('0x9a')])){throw new db[(_0xe2da('0x9b'))][(_0xe2da('0x9c'))](_0xe2da('0x9d'));}if(_[_0xe2da('0x85')](_0x1535e3[_0xe2da('0x60')][_0xe2da('0x60')])||_0x1535e3['body'][_0xe2da('0x60')]===''){throw new db['Sequelize'][(_0xe2da('0x9c'))](_0xe2da('0x9e'));}if(_[_0xe2da('0x85')](_0x1535e3['body'][_0xe2da('0x9f')])){throw new db[(_0xe2da('0x9b'))][(_0xe2da('0x9c'))](_0xe2da('0xa0')+_0x5af48a);}if(!_[_0xe2da('0xa1')](_0x5af48a,_0x1535e3[_0xe2da('0x60')]['mapKey'])){throw new db[(_0xe2da('0x9b'))][(_0xe2da('0x9c'))](_0xe2da('0xa2')+_0x5af48a);}_0x3320d4[_0x1535e3[_0xe2da('0x60')][_0xe2da('0x9f')]]=_0x1535e3[_0xe2da('0x60')]['from'];})[_0xe2da('0x26')](function(){return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x1535e3['params']['id']},'include':[{'model':db[_0xe2da('0xa3')],'as':'List','include':[{'model':db[_0xe2da('0xa4')],'as':_0xe2da('0xa5'),'where':_0x3320d4,'limit':0x1,'order':[[_0xe2da('0x97'),_0xe2da('0xa6')]]}]},{'model':db[_0xe2da('0xa7')],'as':'Applications'}]});})[_0xe2da('0x26')](handleEntityNotFound(_0x1b8217,null))[_0xe2da('0x26')](function(_0x2fa2f9){if(_0x2fa2f9&&_0x2fa2f9[_0xe2da('0xa8')]){_0x21c008['account']=_0x2fa2f9;_0x21c008[_0xe2da('0xa9')]=_0x2fa2f9[_0xe2da('0xaa')];_0x21c008['list']=_0x2fa2f9[_0xe2da('0xa8')];_0x21c008[_0xe2da('0xa9')]=_[_0xe2da('0xab')](_0x21c008[_0xe2da('0xa9')],[_0xe2da('0xac')],[_0xe2da('0xad')]);if(_0x21c008['account'][_0xe2da('0xaa')]){delete _0x21c008[_0xe2da('0xae')]['Applications'];}if(_0x21c008['account']['List']&&_0x21c008['account']['List'][_0xe2da('0xa5')][_0xe2da('0x4b')]){return _0x21c008['account'][_0xe2da('0xa8')][_0xe2da('0xa5')][0x0];}var _0x3ca50e=_[_0xe2da('0x1b')](_0x1535e3[_0xe2da('0x60')],{'firstName':_0x1535e3[_0xe2da('0x60')][_0xe2da('0x9a')],'ListId':_0x2fa2f9[_0xe2da('0x99')]});_0x3ca50e[_0x1535e3[_0xe2da('0x60')][_0xe2da('0x9f')]]=_0x1535e3[_0xe2da('0x60')][_0xe2da('0x9a')];return db[_0xe2da('0xa4')][_0xe2da('0x5f')](_0x3ca50e,{'fields':_0x300d19,'raw':!![]});}})[_0xe2da('0x26')](handleEntityNotFound(_0x1b8217,null))['then'](function(_0x520581){_0x21c008[_0xe2da('0xaf')]=_0x520581;if(_0x520581){var _0x39aa28={'ContactId':_0x520581['id'],'ChatWebsiteId':_0x1535e3['params']['id'],'from':(_0x520581[_0xe2da('0xb0')]||'')+'\x20'+(_0x520581['lastName']||''),'customerIp':_0x1535e3[_0xe2da('0x60')][_0xe2da('0xb1')],'referer':_0x1535e3[_0xe2da('0x60')][_0xe2da('0xb2')],'browserName':_0x4b82a0['browser'][_0xe2da('0xb3')]&&_0x4b82a0[_0xe2da('0xb4')][_0xe2da('0xb5')]?util[_0xe2da('0xb6')](_0xe2da('0xb7'),_0x4b82a0[_0xe2da('0xb4')][_0xe2da('0xb3')],_0x4b82a0[_0xe2da('0xb4')][_0xe2da('0xb5')]):_0xe2da('0xb8'),'browserVersion':_0x4b82a0[_0xe2da('0xb4')][_0xe2da('0xb5')]||_0xe2da('0xb8'),'osName':util['format']('%s\x20%s',_0x4b82a0['os'][_0xe2da('0xb3')],_0x4b82a0['os'][_0xe2da('0xb5')]),'osVersion':_0x4b82a0['os']['version'],'deviceModel':_0x4b82a0[_0xe2da('0xb9')][_0xe2da('0x44')]&&_0x4b82a0[_0xe2da('0xb9')][_0xe2da('0xba')]?util[_0xe2da('0xb6')]('%s\x20%s\x20%s',_0x4b82a0[_0xe2da('0xb9')][_0xe2da('0x44')],_0x4b82a0[_0xe2da('0xb9')][_0xe2da('0xba')],_0x4b82a0[_0xe2da('0xb9')][_0xe2da('0x53')]):null,'deviceVendor':_0x4b82a0[_0xe2da('0xb9')][_0xe2da('0xba')],'deviceType':_0x4b82a0['device']['type'],'formData':JSON[_0xe2da('0x2b')](_0x1535e3[_0xe2da('0x60')])};var _0x10993c={'ChatWebsiteId':_0x1535e3[_0xe2da('0x69')]['id'],'closed':![]};if(_0x1535e3['body'][_0xe2da('0xbb')]){_0x10993c[_0xe2da('0xbb')]=_0x1535e3['body'][_0xe2da('0xbb')];return db[_0xe2da('0xbc')][_0xe2da('0x66')]({'where':_0x10993c})[_0xe2da('0x26')](function(_0x20e0ff){if(_0x20e0ff){return[_0x20e0ff,![]];}_0x39aa28['threadId']=_0x1535e3[_0xe2da('0x60')][_0xe2da('0xbb')];_0x39aa28[_0xe2da('0xbd')]=_0x1535e3[_0xe2da('0x60')]['externalUrl'];return db[_0xe2da('0xbc')][_0xe2da('0x5f')](_0x39aa28)[_0xe2da('0x26')](function(_0x4c010d){return[_0x4c010d,!![]];});});}_0x10993c['ContactId']=_0x520581['id'];if(_0x1535e3[_0xe2da('0x60')][_0xe2da('0xbe')]&&_0x1535e3[_0xe2da('0x60')][_0xe2da('0xbe')]['id']){_0x10993c['id']=_0x1535e3['body'][_0xe2da('0xbe')]['id'];return db[_0xe2da('0xbc')][_0xe2da('0x66')]({'where':_0x10993c})[_0xe2da('0x26')](function(_0x19da52){if(_0x19da52){return[_0x19da52,![]];}return db[_0xe2da('0xbc')][_0xe2da('0x5f')](_0x39aa28)[_0xe2da('0x26')](function(_0x4b6e6b){return[_0x4b6e6b,!![]];});});}return db[_0xe2da('0xbc')][_0xe2da('0x5f')](_0x39aa28)[_0xe2da('0x26')](function(_0xa8e7cd){return[_0xa8e7cd,!![]];});}})['spread'](function(_0x34381,_0x191113){if(_0x34381){_0x341a0a=_0x191113;if(!_0x191113){var _0x40636b={'from':(_0x21c008[_0xe2da('0xaf')][_0xe2da('0xb0')]||'')+'\x20'+(_0x21c008[_0xe2da('0xaf')][_0xe2da('0xbf')]||'')};if(_0x1535e3[_0xe2da('0x60')][_0xe2da('0xbb')]&&_0x1535e3[_0xe2da('0x60')]['messageId']&&_0x1535e3[_0xe2da('0x60')][_0xe2da('0xbb')]!=_0x1535e3['body'][_0xe2da('0xc0')]){_0x40636b[_0xe2da('0xbb')]=_0x1535e3[_0xe2da('0x60')][_0xe2da('0xc0')];}return _0x34381[_0xe2da('0x3b')](_0x40636b);}else{return _0x34381;}}})[_0xe2da('0x26')](function(_0x3b935){_0x21c008[_0xe2da('0xbe')]=_0x3b935[_0xe2da('0x3d')]({'plain':!![]});_0x21c008[_0xe2da('0xbe')][_0xe2da('0xc1')]=_0x341a0a;if(_0x21c008[_0xe2da('0xbe')][_0xe2da('0xc1')]){if(_0x21c008[_0xe2da('0xae')][_0xe2da('0xc2')]){_0x21c008[_0xe2da('0xa9')][_0xe2da('0xc3')]({'id':0x0,'priority':_0x21c008[_0xe2da('0xa9')][_0xe2da('0x4b')]+0x1,'app':_0xe2da('0xc4'),'appdata':_0xe2da('0xc5'),'interval':_0xe2da('0xc6')});}}return db[_0xe2da('0xc7')][_0xe2da('0x5f')]({'body':_0x1535e3[_0xe2da('0x60')]['body'],'ChatWebsiteId':_0x1535e3[_0xe2da('0x69')]['id'],'ChatInteractionId':_0x3b935['id'],'direction':'in','ContactId':_0x21c008[_0xe2da('0xaf')]['id'],'AttachmentId':_0x1535e3[_0xe2da('0x60')]['AttachmentId']});})[_0xe2da('0x26')](function(_0x1da37e){_0x21c008[_0xe2da('0x2d')]=_0x1da37e;if(_0x21c008[_0xe2da('0xbe')][_0xe2da('0xc8')]){return db[_0xe2da('0xc9')][_0xe2da('0x66')]({'attributes':['id',_0xe2da('0xb3')],'where':{'id':_0x21c008['interaction'][_0xe2da('0xc8')]}})['then'](function(_0x5bcf6b){if(_0x5bcf6b){_0x21c008[_0xe2da('0xa9')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe2da('0xca'),'appdata':_0x5bcf6b[_0xe2da('0xb3')]+','+(_0x21c008[_0xe2da('0xae')][_0xe2da('0xcb')]||0xa),'interval':'*,*,*,*'});_0x21c008['forcedOwnership']=!![];}return respondWithRpcPromise(_0xe2da('0xcc'),_0xe2da('0xcd'),_0x21c008);});}return respondWithRpcPromise(_0xe2da('0xcc'),_0xe2da('0xcd'),_0x21c008);})[_0xe2da('0x26')](function(_0xb8f630){respondWithRpcPromise(_0xe2da('0xce'),_0xe2da('0xce'),{'event':_0xe2da('0xcf'),'message':_0xb8f630},client9002);return _0xb8f630;})[_0xe2da('0x26')](respondWithResult(_0x1b8217,null))[_0xe2da('0x30')](handleError(_0x1b8217,null));};exports[_0xe2da('0xd0')]=function(_0x2102fa,_0x5ad48c,_0x1f8b64){var _0x3a2f79,_0x33f6de,_0x1833f8;var _0x201ce5=[];var _0x85615e=[];var _0x222550={};return db[_0xe2da('0xa4')][_0xe2da('0x6a')]()[_0xe2da('0x26')](function(_0x303a97){if(!_0x303a97){throw new db[(_0xe2da('0x9b'))][(_0xe2da('0x9c'))]('no\x20available\x20attributes');}_0x85615e=_['difference'](_[_0xe2da('0x45')](_0x303a97),[_0xe2da('0x96'),_0xe2da('0x97')]);_0x201ce5=_['difference'](_['keys'](_0x303a97),[_0xe2da('0x96'),'updatedAt',_0xe2da('0x98'),'ListId']);if(_0x2102fa[_0xe2da('0x60')]['id']){delete _0x2102fa[_0xe2da('0x60')]['id'];}if(_[_0xe2da('0x85')](_0x2102fa[_0xe2da('0x60')][_0xe2da('0x9a')])){throw _0x5ad48c[_0xe2da('0x32')](0x1f4)[_0xe2da('0xd1')](new db[(_0xe2da('0x9b'))][(_0xe2da('0x9c'))]('from\x20is\x20mandatory'));}if(_[_0xe2da('0x85')](_0x2102fa[_0xe2da('0x60')][_0xe2da('0x60')])||_0x2102fa[_0xe2da('0x60')][_0xe2da('0x60')]===''){throw _0x5ad48c['status'](0x1f4)['send'](new db['Sequelize'][(_0xe2da('0x9c'))](_0xe2da('0x9e')));}if(_[_0xe2da('0x85')](_0x2102fa['body'][_0xe2da('0xd2')])){throw _0x5ad48c[_0xe2da('0x32')](0x1f4)[_0xe2da('0xd1')](new db[(_0xe2da('0x9b'))][(_0xe2da('0x9c'))](_0xe2da('0xd3')+_0x201ce5));}if(!_[_0xe2da('0xa1')](_0x201ce5,_0x2102fa[_0xe2da('0x60')][_0xe2da('0xd2')])){throw _0x5ad48c[_0xe2da('0x32')](0x1f4)[_0xe2da('0xd1')](new db[(_0xe2da('0x9b'))]['ValidationError'](_0xe2da('0xd4')+_0x201ce5));}_0x222550[_0x2102fa[_0xe2da('0x60')]['mapKeyOffline']]=_0x2102fa[_0xe2da('0x60')][_0xe2da('0x9a')];})[_0xe2da('0x26')](function(){return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x2102fa[_0xe2da('0x69')]['id']},'include':[{'model':db[_0xe2da('0xa3')],'as':_0xe2da('0xa8')}]});})['then'](handleEntityNotFound(_0x5ad48c,null))[_0xe2da('0x26')](function(_0x547e6e){if(_0x547e6e&&_0x547e6e[_0xe2da('0xa8')]){_0x33f6de=_0x547e6e;var _0x559723=_['defaults'](_0x2102fa['body'],{'firstName':_0x2102fa[_0xe2da('0x60')][_0xe2da('0x9a')],'phone':_0x2102fa[_0xe2da('0x60')]['from'],'ListId':_0x547e6e[_0xe2da('0x99')]});_0x559723[_0x2102fa[_0xe2da('0x60')][_0xe2da('0xd2')]]=_0x2102fa[_0xe2da('0x60')][_0xe2da('0x9a')];return db[_0xe2da('0xa4')][_0xe2da('0xd5')]({'where':_0x222550,'defaults':_0x559723});}})[_0xe2da('0xd6')](function(_0x4d3fff){if(_0x4d3fff){_0x1833f8=_0x4d3fff;var _0x1de65f=fs[_0xe2da('0xd7')](path[_0xe2da('0x81')](config['root'],_0xe2da('0xd8')),_0xe2da('0xd9'));var _0x21e23b=ejs['render'](_0x1de65f,{'body':_[_0xe2da('0xda')](_0x2102fa[_0xe2da('0x60')][_0xe2da('0x60')]),'bodyTitle':_0x33f6de[_0xe2da('0xdb')]});return db['ChatOfflineMessage'][_0xe2da('0x5f')]({'body':_0x21e23b,'ContactId':_0x4d3fff['id'],'ChatWebsiteId':_0x33f6de['id']});}})[_0xe2da('0x26')](function(_0x439a8e){if(_0x439a8e){_0x3a2f79=_0x439a8e;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe2da('0xdc'),'raw':!![]}]});}})[_0xe2da('0x26')](function(_0x2dc146){if(_0x2dc146&&_0x2dc146[_0xe2da('0xdc')]&&_0x33f6de[_0xe2da('0xdd')]){var _0x11a71e={'tls':{'rejectUnauthorized':![]}};if(_0x2dc146[_0xe2da('0xdc')][_0xe2da('0xde')]){_0x11a71e[_0xe2da('0xde')]=_0x2dc146['Smtp'][_0xe2da('0xde')];}else{_0x11a71e[_0xe2da('0xdf')]=_0x2dc146[_0xe2da('0xdc')]['host'];_0x11a71e[_0xe2da('0xe0')]=_0x2dc146[_0xe2da('0xdc')]['port'];_0x11a71e[_0xe2da('0xe1')]=_0x2dc146['Smtp'][_0xe2da('0xe1')];}if(_0x2dc146[_0xe2da('0xdc')][_0xe2da('0xe2')]){_0x11a71e[_0xe2da('0xe3')]={'user':_0x2dc146['Smtp'][_0xe2da('0x61')],'pass':_0x2dc146[_0xe2da('0xdc')][_0xe2da('0xe4')]};}return respondWithRpcPromise(_0xe2da('0xe5'),'sendMail',{'account':_0x11a71e,'message':{'from':util[_0xe2da('0xb6')](_0xe2da('0xe6'),_0x2dc146[_0xe2da('0xb3')],_0x2dc146['email']||_0x2dc146[_0xe2da('0xdc')][_0xe2da('0x61')]),'to':_0x33f6de[_0xe2da('0xdd')],'subject':_0x33f6de['offlineMessageSubject'],'text':_0x3a2f79[_0xe2da('0x60')]}},client9003)[_0xe2da('0x26')](function(){return _0x3a2f79;})[_0xe2da('0x30')](function(_0x1e4966){console['error'](_0x1e4966);});}})[_0xe2da('0x26')](function(){if(_0x3a2f79){return _0x3a2f79;}})[_0xe2da('0x26')](respondWithResult(_0x5ad48c,null))[_0xe2da('0x30')](handleError(_0x5ad48c,null));};exports['addInteraction']=function(_0x159450,_0x251569,_0x52cef9){return db[_0xe2da('0xbc')]['find']({'where':{'id':_0x159450[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x251569,null))[_0xe2da('0x26')](function(_0x1fef76){if(_0x1fef76){return _0x1fef76['addInteraction'](_0x159450['body'][_0xe2da('0x73')],_['omit'](_0x159450[_0xe2da('0x60')],[_0xe2da('0x73'),'id'])||{});}})[_0xe2da('0x26')](respondWithResult(_0x251569,null))[_0xe2da('0x30')](handleError(_0x251569,null));};exports[_0xe2da('0xe7')]=function(_0x3c1f42,_0x35ff66,_0x5b0dd5){var _0xe63356={'raw':![],'where':{}};var _0x22ce48={};var _0x2c9c74={'count':0x0,'rows':[]};return db[_0xe2da('0x42')][_0xe2da('0x6e')]({'where':{'id':_0x3c1f42[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x35ff66,null))[_0xe2da('0x26')](function(_0x1d9254){if(_0x1d9254){_0x22ce48[_0xe2da('0x44')]=_[_0xe2da('0x45')](db[_0xe2da('0xbc')]['rawAttributes']);_0x22ce48[_0xe2da('0x46')]=_[_0xe2da('0x45')](_0x3c1f42[_0xe2da('0x46')]);_0x22ce48[_0xe2da('0x47')]=_[_0xe2da('0x48')](_0x22ce48[_0xe2da('0x44')],_0x22ce48[_0xe2da('0x46')]);_0xe63356['attributes']=_[_0xe2da('0x48')](_0x22ce48[_0xe2da('0x44')],qs[_0xe2da('0x4a')](_0x3c1f42[_0xe2da('0x46')][_0xe2da('0x4a')]));_0xe63356[_0xe2da('0x49')]=_0xe63356[_0xe2da('0x49')][_0xe2da('0x4b')]?_0xe63356[_0xe2da('0x49')]:_0x22ce48[_0xe2da('0x44')];if(!_0x3c1f42['query']['hasOwnProperty']('nolimit')){_0xe63356[_0xe2da('0x36')]=qs['limit'](_0x3c1f42['query'][_0xe2da('0x36')]);_0xe63356[_0xe2da('0x35')]=qs[_0xe2da('0x35')](_0x3c1f42['query'][_0xe2da('0x35')]);}_0xe63356['order']=qs[_0xe2da('0x4f')](_0x3c1f42['query']['sort']);_0xe63356['where']=qs[_0xe2da('0x47')](_[_0xe2da('0x6f')](_0x3c1f42['query'],_0x22ce48[_0xe2da('0x47')]));_0xe63356[_0xe2da('0x50')]['ChatWebsiteId']=_0x1d9254['id'];if(_0x3c1f42['query']['filter']){_0xe63356[_0xe2da('0x50')]=_[_0xe2da('0x57')](_0xe63356[_0xe2da('0x50')],{'$or':_[_0xe2da('0x52')](_0xe63356[_0xe2da('0x49')],function(_0x293328){var _0x5965dd={};_0x5965dd[_0x293328]={'$like':'%'+_0x3c1f42[_0xe2da('0x46')][_0xe2da('0x51')]+'%'};return _0x5965dd;})});}_0xe63356=_[_0xe2da('0x57')]({},_0xe63356,_0x3c1f42[_0xe2da('0x5e')]);return db['ChatInteraction'][_0xe2da('0x34')]({'where':_0xe63356[_0xe2da('0x50')]})[_0xe2da('0x26')](function(_0x1e68ca){_0x2c9c74[_0xe2da('0x34')]=_0x1e68ca;if(_0x3c1f42[_0xe2da('0x46')][_0xe2da('0x71')]){_0xe63356[_0xe2da('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xe2da('0xc9')],'as':'Owner','attributes':['name',_0xe2da('0xe8'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xe2da('0xe9'),'attributes':['id',_0xe2da('0xb3'),_0xe2da('0xea')],'where':_0x3c1f42['query']['tag']?{'id':_0x3c1f42[_0xe2da('0x46')][_0xe2da('0xeb')]}:undefined,'required':_0x3c1f42[_0xe2da('0x46')][_0xe2da('0xeb')]?!![]:![]}];}return db[_0xe2da('0xbc')]['findAll'](_0xe63356);})['then'](function(_0x5b1d39){_0x2c9c74['rows']=_0x5b1d39;return _0x2c9c74;});}})['then'](respondWithFilteredResult(_0x35ff66,_0xe63356))[_0xe2da('0x30')](handleError(_0x35ff66,null));};function iftimePromise(_0x2193b5,_0x27657e){return respondWithRpcPromise(_0xe2da('0xec'),'getSnippet',{'command':_0x27657e['timezone']?util['format'](_0xe2da('0xed'),_0x2193b5[_0xe2da('0xee')],_0x27657e['timezone']):util[_0xe2da('0xb6')](_0xe2da('0xef'),_0x2193b5[_0xe2da('0xee')])},client9002)[_0xe2da('0x26')](function(_0x39627b){var _0x55b8cc=_0x39627b&&_0x39627b[_0xe2da('0xf0')]('true')>=0x0?!![]:![];logger[_0xe2da('0x2e')](_0xe2da('0xf1'),_0x27657e['id'],_0x2193b5['id'],_0x2193b5[_0xe2da('0xee')],_0x55b8cc?'ONLINE':_0xe2da('0xf2'),_0x27657e['timezone']?_0x27657e[_0xe2da('0xf3')]:_0xe2da('0xf4'));return _0x55b8cc;})[_0xe2da('0x30')](function(_0x58ab40){logger[_0xe2da('0x2c')](_0xe2da('0xf1'),_0x27657e['id'],_0x2193b5['id'],_0x2193b5['interval'],util[_0xe2da('0xf5')](_0x58ab40,{'showHidden':![],'depth':null}),_0x27657e[_0xe2da('0xf3')]?_0x27657e[_0xe2da('0xf3')]:_0xe2da('0xf4'));return![];});}exports[_0xe2da('0xf6')]=function(_0x41882f,_0xd4f93e,_0x39c7b2){var _0x4517d6=0x0;var _0x294fcd=0x0;var _0x324cfe=![];var _0x5d4c82;var _0xdd0ce9;return db['ChatWebsite'][_0xe2da('0x66')]({'where':{'id':_0x41882f[_0xe2da('0x69')]['id']},'include':[{'model':db[_0xe2da('0xf7')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xe2da('0xf8'),'attributes':['id',_0xe2da('0xee')],'raw':!![]}]}]})[_0xe2da('0x26')](handleEntityNotFound(_0xd4f93e,null))[_0xe2da('0x26')](function(_0x236d98){if(_0x236d98){_0x5d4c82=_0x236d98;return _0x236d98[_0xe2da('0xf9')]({'raw':!![]});}})[_0xe2da('0x26')](function(_0x12ba08){if(_0x5d4c82){if(_0x12ba08){_0xdd0ce9=_0x12ba08;}}return require(_0xe2da('0xfa'))[_0xe2da('0x83')]();})[_0xe2da('0x26')](function(_0xf9b745){if(_0xf9b745){_0x294fcd=_0xf9b745[_0xe2da('0xfb')];_0x324cfe=_0xf9b745[_0xe2da('0x84')];}})[_0xe2da('0x26')](function(){return db['ChatInteraction'][_0xe2da('0x34')]({'where':{'closed':![]}});})[_0xe2da('0x26')](function(_0x447193){_0x4517d6=_0x447193;if(_0x294fcd&&_0x447193>_0x294fcd){return db[_0xe2da('0xfc')]['findOne']({'where':{'id':0x1}})[_0xe2da('0x26')](function(_0x206728){if(_0x206728){_0x206728[_0xe2da('0xfd')](_0xe2da('0xfe'));}});}})['then'](function(){if(_0x5d4c82[_0xe2da('0xf7')]&&_0x5d4c82['Interval'][_0xe2da('0xf8')]){var _0x282be8=[];for(var _0x40096e=0x0;_0x40096e<_0x5d4c82['Interval'][_0xe2da('0xf8')][_0xe2da('0x4b')];_0x40096e++){var _0x5a6db5=_0x5d4c82['Interval']['Intervals'][_0x40096e][_0xe2da('0x3d')]({'plain':!![]});_0x282be8['push'](iftimePromise(_0x5a6db5,_0x5d4c82));}return BPromise[_0xe2da('0xff')](_0x282be8)['then'](function(_0x5c3030){return _[_0xe2da('0x100')](_0x5c3030);});}else{return!![];}})['then'](function(_0x50196a){var _0x521dbc=fs[_0xe2da('0xd7')](path[_0xe2da('0x81')](config[_0xe2da('0x87')],_0xe2da('0x101')),_0xe2da('0xd9'));var _0x5be6f5={'remote':_0x5d4c82[_0xe2da('0x102')],'query':querystring[_0xe2da('0x2b')](_['merge'](_0x5d4c82[_0xe2da('0x3d')]({'plain':!![]}),{'customerIp':_0x41882f[_0xe2da('0x92')][_0xe2da('0x103')]||_0x41882f[_0xe2da('0x92')]['x-real-ip']||_0x41882f[_0xe2da('0x104')][_0xe2da('0x105')]||_0x41882f['ip'],'referer':_0x41882f[_0xe2da('0x92')][_0xe2da('0xb2')],'openedInteractions':_0x4517d6,'maxInteractions':_0x294fcd,'virtual':_0x324cfe['virtual'],'online':_0x50196a,'custom':_0x324cfe}))[_0xe2da('0x106')](/'/g,'\x5c\x27')};_0xd4f93e[_0xe2da('0xd1')](ejs['render'](Mustache[_0xe2da('0x107')](_0x521dbc,_0x5be6f5),{'proactiveActions':_0xdd0ce9,'alignment':_0x5d4c82[_0xe2da('0x108')],'verticalAlignment':_0x5d4c82[_0xe2da('0x109')]}));})['catch'](handleError(_0xd4f93e,null));};exports[_0xe2da('0x10a')]=function(_0x5475c7,_0x73cffb,_0x5085b0){return db['ChatWebsite'][_0xe2da('0x6e')]({'where':{'id':_0x5475c7[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x73cffb,null))['then'](function(_0x5ae2de){if(_0x5ae2de){return db[_0xe2da('0x10b')][_0xe2da('0x10c')](function(_0x1b713d){return db[_0xe2da('0xa7')][_0xe2da('0x3c')]({'where':{'ChatWebsiteId':_0x5475c7[_0xe2da('0x69')]['id']},'transaction':_0x1b713d})[_0xe2da('0x26')](function(_0xcaff81){var _0x474549=_[_0xe2da('0x52')](_0x5475c7[_0xe2da('0x60')],function(_0x3b481a){_0x3b481a['ChatWebsiteId']=_0x5475c7[_0xe2da('0x69')]['id'];return _0x3b481a;});return db[_0xe2da('0xa7')][_0xe2da('0x10d')](_0x474549,{'transaction':_0x1b713d});});})['then'](function(){return db[_0xe2da('0xa7')][_0xe2da('0x10e')]({'where':{'ChatWebsiteId':_0x5475c7['params']['id']},'order':_0xe2da('0xac')});});}})['then'](respondWithResult(_0x73cffb,null))['catch'](handleError(_0x73cffb,null));};exports[_0xe2da('0x10f')]=function(_0x21b3a5,_0x58a4bf,_0x5c26b0){var _0x3e053a={};var _0x3b1ccb={};var _0x344b54;var _0x2747a1;return db[_0xe2da('0x42')]['findOne']({'where':{'id':_0x21b3a5[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x58a4bf,null))[_0xe2da('0x26')](function(_0x49e157){if(_0x49e157){_0x344b54=_0x49e157;_0x3b1ccb['model']=_['keys'](db[_0xe2da('0xa7')][_0xe2da('0x43')]);_0x3b1ccb[_0xe2da('0x46')]=_[_0xe2da('0x45')](_0x21b3a5[_0xe2da('0x46')]);_0x3b1ccb[_0xe2da('0x47')]=_['intersection'](_0x3b1ccb[_0xe2da('0x44')],_0x3b1ccb[_0xe2da('0x46')]);_0x3e053a[_0xe2da('0x49')]=_[_0xe2da('0x48')](_0x3b1ccb[_0xe2da('0x44')],qs[_0xe2da('0x4a')](_0x21b3a5[_0xe2da('0x46')][_0xe2da('0x4a')]));_0x3e053a[_0xe2da('0x49')]=_0x3e053a[_0xe2da('0x49')][_0xe2da('0x4b')]?_0x3e053a['attributes']:_0x3b1ccb[_0xe2da('0x44')];_0x3e053a['order']=qs['sort'](_0x21b3a5[_0xe2da('0x46')][_0xe2da('0x4f')]);_0x3e053a[_0xe2da('0x50')]=qs[_0xe2da('0x47')](_[_0xe2da('0x6f')](_0x21b3a5[_0xe2da('0x46')],_0x3b1ccb[_0xe2da('0x47')]));if(_0x21b3a5[_0xe2da('0x46')][_0xe2da('0x51')]){_0x3e053a[_0xe2da('0x50')]=_[_0xe2da('0x57')](_0x3e053a[_0xe2da('0x50')],{'$or':_[_0xe2da('0x52')](_0x3e053a[_0xe2da('0x49')],function(_0x3e157){var _0x313a2e={};_0x313a2e[_0x3e157]={'$like':'%'+_0x21b3a5[_0xe2da('0x46')][_0xe2da('0x51')]+'%'};return _0x313a2e;})});}_0x3e053a=_[_0xe2da('0x57')]({},_0x3e053a,_0x21b3a5[_0xe2da('0x5e')]);return _0x344b54[_0xe2da('0x10f')](_0x3e053a);}})[_0xe2da('0x26')](function(_0x43d08c){if(_0x43d08c){_0x2747a1=_0x43d08c[_0xe2da('0x4b')];if(!_0x21b3a5[_0xe2da('0x46')][_0xe2da('0x4c')](_0xe2da('0x4d'))){_0x3e053a[_0xe2da('0x36')]=qs[_0xe2da('0x36')](_0x21b3a5['query'][_0xe2da('0x36')]);_0x3e053a['offset']=qs[_0xe2da('0x35')](_0x21b3a5[_0xe2da('0x46')][_0xe2da('0x35')]);}return _0x344b54[_0xe2da('0x10f')](_0x3e053a);}})[_0xe2da('0x26')](function(_0x526e54){if(_0x526e54){return _0x526e54?{'count':_0x2747a1,'rows':_0x526e54}:null;}})[_0xe2da('0x26')](respondWithResult(_0x58a4bf,null))[_0xe2da('0x30')](handleError(_0x58a4bf,null));};exports[_0xe2da('0x110')]=function(_0x5b9f65,_0x5a8305,_0x7b9865){return db[_0xe2da('0x111')][_0xe2da('0x66')]({'where':{'id':_0x5b9f65[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x5a8305,null))['then'](function(_0xc2d1a5){if(_0xc2d1a5){return _0xc2d1a5['addProactiveActions'](_0x5b9f65['body'][_0xe2da('0x73')],_[_0xe2da('0x112')](_0x5b9f65[_0xe2da('0x60')],['ids','id'])||{});}})[_0xe2da('0x26')](respondWithResult(_0x5a8305,null))[_0xe2da('0x30')](handleError(_0x5a8305,null));};exports['getProactiveActions']=function(_0x59d3e7,_0x234cd0,_0x3a45e4){var _0x30e12e={};var _0x28ca5e={};var _0xbae589;var _0x25a1c7;return db[_0xe2da('0x42')][_0xe2da('0x6e')]({'where':{'id':_0x59d3e7['params']['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x234cd0,null))[_0xe2da('0x26')](function(_0x549551){if(_0x549551){_0xbae589=_0x549551;_0x28ca5e[_0xe2da('0x44')]=_['keys'](db['ChatProactiveAction'][_0xe2da('0x43')]);_0x28ca5e[_0xe2da('0x46')]=_[_0xe2da('0x45')](_0x59d3e7['query']);_0x28ca5e[_0xe2da('0x47')]=_[_0xe2da('0x48')](_0x28ca5e['model'],_0x28ca5e[_0xe2da('0x46')]);_0x30e12e[_0xe2da('0x49')]=_[_0xe2da('0x48')](_0x28ca5e[_0xe2da('0x44')],qs[_0xe2da('0x4a')](_0x59d3e7[_0xe2da('0x46')][_0xe2da('0x4a')]));_0x30e12e[_0xe2da('0x49')]=_0x30e12e[_0xe2da('0x49')][_0xe2da('0x4b')]?_0x30e12e['attributes']:_0x28ca5e[_0xe2da('0x44')];_0x30e12e[_0xe2da('0x4e')]=qs[_0xe2da('0x4f')](_0x59d3e7['query'][_0xe2da('0x4f')]);_0x30e12e[_0xe2da('0x50')]=qs['filters'](_[_0xe2da('0x6f')](_0x59d3e7['query'],_0x28ca5e[_0xe2da('0x47')]));if(_0x59d3e7[_0xe2da('0x46')][_0xe2da('0x51')]){_0x30e12e['where']=_['merge'](_0x30e12e[_0xe2da('0x50')],{'$or':_[_0xe2da('0x52')](_0x30e12e[_0xe2da('0x49')],function(_0x9e9b0b){var _0x289e5c={};_0x289e5c[_0x9e9b0b]={'$like':'%'+_0x59d3e7[_0xe2da('0x46')][_0xe2da('0x51')]+'%'};return _0x289e5c;})});}_0x30e12e=_['merge']({},_0x30e12e,_0x59d3e7[_0xe2da('0x5e')]);return _0xbae589[_0xe2da('0xf9')](_0x30e12e);}})['then'](function(_0x51ff5b){if(_0x51ff5b){_0x25a1c7=_0x51ff5b[_0xe2da('0x4b')];if(!_0x59d3e7['query']['hasOwnProperty'](_0xe2da('0x4d'))){_0x30e12e['limit']=qs[_0xe2da('0x36')](_0x59d3e7[_0xe2da('0x46')]['limit']);_0x30e12e[_0xe2da('0x35')]=qs['offset'](_0x59d3e7[_0xe2da('0x46')]['offset']);}return _0xbae589[_0xe2da('0xf9')](_0x30e12e);}})[_0xe2da('0x26')](function(_0x31d9ac){if(_0x31d9ac){return _0x31d9ac?{'count':_0x25a1c7,'rows':_0x31d9ac}:null;}})[_0xe2da('0x26')](respondWithResult(_0x234cd0,null))[_0xe2da('0x30')](handleError(_0x234cd0,null));};exports[_0xe2da('0x113')]=function(_0x37f4e7,_0x943e05,_0x3ec192){var _0x4db5f9=_0x37f4e7[_0xe2da('0x46')][_0xe2da('0x114')]==='false'?'offlineForm':_0xe2da('0x115');return db[_0xe2da('0x42')][_0xe2da('0x66')]({'attributes':['id',_0x4db5f9],'where':{'id':_0x37f4e7[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x943e05,null))[_0xe2da('0x26')](function(_0x2b8f3c){if(_0x2b8f3c){var _0x1e22bd=_0x2b8f3c[_0x4db5f9];var _0x280540=_0x1e22bd&&_0x1e22bd[_0xe2da('0x116')]?_0x1e22bd[_0xe2da('0x116')]:[];_0x943e05[_0xe2da('0xd1')]({'fromKey':_['isNil'](_0x1e22bd[_0xe2da('0x117')])?undefined:_0x1e22bd[_0xe2da('0x117')],'count':_0x280540['length'],'rows':_0x280540});}})[_0xe2da('0x30')](handleError(_0x943e05,null));};exports[_0xe2da('0x118')]=function(_0x5758ae,_0x3cd846,_0x429403){var _0x3d450d={'raw':!![],'where':{}};var _0x141534={};var _0x5aa285={'count':0x0,'rows':[]};return db[_0xe2da('0x42')][_0xe2da('0x6e')]({'where':{'id':_0x5758ae[_0xe2da('0x69')]['id']}})['then'](handleEntityNotFound(_0x3cd846,null))['then'](function(_0xe78b3f){if(_0xe78b3f){_0x141534[_0xe2da('0x44')]=_[_0xe2da('0x45')](db[_0xe2da('0x119')][_0xe2da('0x43')]);_0x141534[_0xe2da('0x46')]=_[_0xe2da('0x45')](_0x5758ae['query']);_0x141534['filters']=_['intersection'](_0x141534[_0xe2da('0x44')],_0x141534['query']);_0x3d450d[_0xe2da('0x49')]=_['intersection'](_0x141534[_0xe2da('0x44')],qs['fields'](_0x5758ae['query'][_0xe2da('0x4a')]));_0x3d450d[_0xe2da('0x49')]=_0x3d450d[_0xe2da('0x49')]['length']?_0x3d450d[_0xe2da('0x49')]:_0x141534[_0xe2da('0x44')];if(!_0x5758ae[_0xe2da('0x46')][_0xe2da('0x4c')](_0xe2da('0x4d'))){_0x3d450d['limit']=qs[_0xe2da('0x36')](_0x5758ae['query'][_0xe2da('0x36')]);_0x3d450d[_0xe2da('0x35')]=qs[_0xe2da('0x35')](_0x5758ae['query'][_0xe2da('0x35')]);}_0x3d450d[_0xe2da('0x4e')]=qs[_0xe2da('0x4f')](_0x5758ae[_0xe2da('0x46')][_0xe2da('0x4f')]);_0x3d450d['where']=qs[_0xe2da('0x47')](_['pick'](_0x5758ae['query'],_0x141534[_0xe2da('0x47')]));_0x3d450d['where'][_0xe2da('0x70')]=_0xe78b3f['id'];if(_0x5758ae['query'][_0xe2da('0x51')]){_0x3d450d[_0xe2da('0x50')]=_['merge'](_0x3d450d['where'],{'$or':_[_0xe2da('0x52')](_0x3d450d[_0xe2da('0x49')],function(_0x2737bf){var _0x596847={};_0x596847[_0x2737bf]={'$like':'%'+_0x5758ae['query'][_0xe2da('0x51')]+'%'};return _0x596847;})});}_0x3d450d=_[_0xe2da('0x57')]({},_0x3d450d,_0x5758ae[_0xe2da('0x5e')]);return db['ChatOfflineMessage'][_0xe2da('0x34')]({'where':_0x3d450d[_0xe2da('0x50')]})[_0xe2da('0x26')](function(_0x5d7b25){_0x5aa285['count']=_0x5d7b25;if(_0x5758ae[_0xe2da('0x46')]['includeAll']){_0x3d450d[_0xe2da('0x58')]=[{'all':!![]}];}return db[_0xe2da('0x119')][_0xe2da('0x59')](_0x3d450d);})[_0xe2da('0x26')](function(_0x544a65){_0x5aa285[_0xe2da('0x5a')]=_0x544a65;return _0x5aa285;});}})[_0xe2da('0x26')](respondWithFilteredResult(_0x3cd846,_0x3d450d))[_0xe2da('0x30')](handleError(_0x3cd846,null));};exports[_0xe2da('0x11a')]=function(_0x2c32bc,_0x2f1ced,_0x36dcbb){return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x2c32bc[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x2f1ced,null))[_0xe2da('0x26')](function(_0x5342f8){if(_0x5342f8){return _0x5342f8[_0xe2da('0x11a')](_0x2c32bc['body'][_0xe2da('0x73')],_[_0xe2da('0x112')](_0x2c32bc['body'],[_0xe2da('0x73'),'id'])||{})[_0xe2da('0xd6')](function(_0x5d58cb){for(var _0x5aeafc=0x0;_0x5aeafc<_0x2c32bc[_0xe2da('0x60')][_0xe2da('0x73')][_0xe2da('0x4b')];_0x5aeafc+=0x1){socket[_0xe2da('0x11b')]('userChatWebsite:save',{'UserId':_0x2c32bc[_0xe2da('0x60')][_0xe2da('0x73')][_0x5aeafc],'ChatWebsiteId':_0x2c32bc[_0xe2da('0x69')]['id']});}return _0x5d58cb;});}})[_0xe2da('0x26')](respondWithResult(_0x2f1ced,null))['catch'](handleError(_0x2f1ced,null));};exports[_0xe2da('0x11c')]=function(_0x14464d,_0x4c5682,_0x59d16b){return db[_0xe2da('0x42')][_0xe2da('0x66')]({'where':{'id':_0x14464d[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x4c5682,null))['then'](function(_0x3f8ab7){if(_0x3f8ab7){return _0x3f8ab7[_0xe2da('0x11c')](_0x14464d['query']['ids'])[_0xe2da('0x26')](function(){if(_[_0xe2da('0x11d')](_0x14464d[_0xe2da('0x46')]['ids'])){for(var _0x41c22b=0x0;_0x41c22b<_0x14464d[_0xe2da('0x46')][_0xe2da('0x73')][_0xe2da('0x4b')];_0x41c22b+=0x1){socket[_0xe2da('0x11b')](_0xe2da('0x11e'),{'UserId':Number(_0x14464d[_0xe2da('0x46')][_0xe2da('0x73')][_0x41c22b]),'ChatWebsiteId':Number(_0x14464d[_0xe2da('0x69')]['id'])});}}else{socket[_0xe2da('0x11b')](_0xe2da('0x11e'),{'UserId':Number(_0x14464d[_0xe2da('0x46')][_0xe2da('0x73')]),'ChatWebsiteId':Number(_0x14464d[_0xe2da('0x69')]['id'])});}});}})[_0xe2da('0x26')](respondWithStatusCode(_0x4c5682,null))['catch'](handleError(_0x4c5682,null));};exports[_0xe2da('0x11f')]=function(_0x50874f,_0x4b48c8,_0x4d22d1){var _0x1f7099={};var _0x17ab42={};var _0x23cfc1;var _0x2261a6;return db[_0xe2da('0x42')][_0xe2da('0x6e')]({'where':{'id':_0x50874f[_0xe2da('0x69')]['id']}})[_0xe2da('0x26')](handleEntityNotFound(_0x4b48c8,null))[_0xe2da('0x26')](function(_0x92e983){if(_0x92e983){_0x23cfc1=_0x92e983;_0x17ab42[_0xe2da('0x44')]=_[_0xe2da('0x45')](db[_0xe2da('0xc9')]['rawAttributes']);_0x17ab42[_0xe2da('0x46')]=_[_0xe2da('0x45')](_0x50874f[_0xe2da('0x46')]);_0x17ab42['filters']=_['intersection'](_0x17ab42['model'],_0x17ab42[_0xe2da('0x46')]);_0x1f7099[_0xe2da('0x49')]=_[_0xe2da('0x48')](_0x17ab42['model'],qs[_0xe2da('0x4a')](_0x50874f[_0xe2da('0x46')][_0xe2da('0x4a')]));_0x1f7099[_0xe2da('0x49')]=_0x1f7099[_0xe2da('0x49')][_0xe2da('0x4b')]?_0x1f7099[_0xe2da('0x49')]:_0x17ab42[_0xe2da('0x44')];_0x1f7099[_0xe2da('0x4e')]=qs[_0xe2da('0x4f')](_0x50874f[_0xe2da('0x46')][_0xe2da('0x4f')]);_0x1f7099['where']=qs['filters'](_[_0xe2da('0x6f')](_0x50874f[_0xe2da('0x46')],_0x17ab42[_0xe2da('0x47')]));if(_0x50874f['query'][_0xe2da('0x51')]){_0x1f7099[_0xe2da('0x50')]=_['merge'](_0x1f7099[_0xe2da('0x50')],{'$or':_[_0xe2da('0x52')](_0x1f7099['attributes'],function(_0x893364){var _0x27b6d2={};_0x27b6d2[_0x893364]={'$like':'%'+_0x50874f['query']['filter']+'%'};return _0x27b6d2;})});}_0x1f7099=_[_0xe2da('0x57')]({},_0x1f7099,_0x50874f[_0xe2da('0x5e')]);return _0x23cfc1[_0xe2da('0x11f')](_0x1f7099);}})['then'](function(_0x1e4a02){if(_0x1e4a02){_0x2261a6=_0x1e4a02[_0xe2da('0x4b')];if(!_0x50874f['query'][_0xe2da('0x4c')]('nolimit')){_0x1f7099[_0xe2da('0x36')]=qs[_0xe2da('0x36')](_0x50874f[_0xe2da('0x46')][_0xe2da('0x36')]);_0x1f7099[_0xe2da('0x35')]=qs[_0xe2da('0x35')](_0x50874f['query'][_0xe2da('0x35')]);}return _0x23cfc1['getAgents'](_0x1f7099);}})[_0xe2da('0x26')](function(_0x25b180){if(_0x25b180){return _0x25b180?{'count':_0x2261a6,'rows':_0x25b180}:null;}})[_0xe2da('0x26')](respondWithResult(_0x4b48c8,null))[_0xe2da('0x30')](handleError(_0x4b48c8,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b6736a8..04ec446 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 _0x79d3=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2ccd53,_0xf23c5b){var _0x1f1b96=function(_0x5d6573){while(--_0x5d6573){_0x2ccd53['push'](_0x2ccd53['shift']());}};_0x1f1b96(++_0xf23c5b);}(_0x79d3,0x13c));var _0x379d=function(_0x3217d3,_0xf66fcf){_0x3217d3=_0x3217d3-0x0;var _0x260f43=_0x79d3[_0x3217d3];return _0x260f43;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x379d('0x0'))['db'][_0x379d('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x379d('0x2')](0x0);var events={'afterCreate':_0x379d('0x3'),'afterUpdate':_0x379d('0x4'),'afterDestroy':_0x379d('0x5')};function emitEvent(_0x41074f){return function(_0x412fc7,_0xe36600,_0x391622){ChatWebsiteEvents[_0x379d('0x6')](_0x41074f+':'+_0x412fc7['id'],_0x412fc7);ChatWebsiteEvents['emit'](_0x41074f,_0x412fc7);_0x391622(null);};}for(var e in events){if(events[_0x379d('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x379d('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x39bf=['events','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x23eaf2,_0x465cfb){var _0x54efb4=function(_0x5f3727){while(--_0x5f3727){_0x23eaf2['push'](_0x23eaf2['shift']());}};_0x54efb4(++_0x465cfb);}(_0x39bf,0xf3));var _0xf39b=function(_0x3c3e6a,_0x2d7cdd){_0x3c3e6a=_0x3c3e6a-0x0;var _0x1a0a7a=_0x39bf[_0x3c3e6a];return _0x1a0a7a;};'use strict';var EventEmitter=require(_0xf39b('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xf39b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf39b('0x2')](0x0);var events={'afterCreate':_0xf39b('0x3'),'afterUpdate':'update','afterDestroy':_0xf39b('0x4')};function emitEvent(_0x430bb3){return function(_0x49db64,_0x50441d,_0x307cf1){ChatWebsiteEvents[_0xf39b('0x5')](_0x430bb3+':'+_0x49db64['id'],_0x49db64);ChatWebsiteEvents[_0xf39b('0x5')](_0x430bb3,_0x49db64);_0x307cf1(null);};}for(var e in events){if(events[_0xf39b('0x6')](e)){var event=events[e];ChatWebsite[_0xf39b('0x7')](e,emitEvent(event));}}module[_0xf39b('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 784020a..4a5bd01 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 _0xae89=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0xae89,0x66));var _0x9ae8=function(_0x5491e5,_0x37a869){_0x5491e5=_0x5491e5-0x0;var _0x214eb5=_0xae89[_0x5491e5];return _0x214eb5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9ae8('0x0'));var moment=require(_0x9ae8('0x1'));var BPromise=require(_0x9ae8('0x2'));var rp=require(_0x9ae8('0x3'));var fs=require('fs');var path=require(_0x9ae8('0x4'));var rimraf=require(_0x9ae8('0x5'));var config=require(_0x9ae8('0x6'));var attributes=require(_0x9ae8('0x7'));module[_0x9ae8('0x8')]=function(_0x554c1f,_0x35abac){return _0x554c1f[_0x9ae8('0x9')](_0x9ae8('0xa'),attributes,{'tableName':_0x9ae8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf564=['ChatWebsite','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x2304ce,_0x5e2bb0){var _0x503964=function(_0x13e9f2){while(--_0x13e9f2){_0x2304ce['push'](_0x2304ce['shift']());}};_0x503964(++_0x5e2bb0);}(_0xf564,0x11f));var _0x4f56=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0xf564[_0x5b5eb4];return _0x42af53;};'use strict';var _=require(_0x4f56('0x0'));var util=require(_0x4f56('0x1'));var logger=require('../../config/logger')(_0x4f56('0x2'));var moment=require(_0x4f56('0x3'));var BPromise=require(_0x4f56('0x4'));var rp=require(_0x4f56('0x5'));var fs=require('fs');var path=require(_0x4f56('0x6'));var rimraf=require(_0x4f56('0x7'));var config=require(_0x4f56('0x8'));var attributes=require(_0x4f56('0x9'));module[_0x4f56('0xa')]=function(_0x2a9f74,_0x5ee882){return _0x2a9f74[_0x4f56('0xb')](_0x4f56('0xc'),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 5c52a36..027a659 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 _0x81a1=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5ed63c,_0x55b1f3){var _0x5cdf92=function(_0x3dc2da){while(--_0x3dc2da){_0x5ed63c['push'](_0x5ed63c['shift']());}};_0x5cdf92(++_0x55b1f3);}(_0x81a1,0xea));var _0x181a=function(_0x457528,_0x4dad42){_0x457528=_0x457528-0x0;var _0x201893=_0x81a1[_0x457528];return _0x201893;};'use strict';var _=require(_0x181a('0x0'));var util=require(_0x181a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x181a('0x2'));var fs=require('fs');var Redis=require(_0x181a('0x3'));var db=require(_0x181a('0x4'))['db'];var utils=require(_0x181a('0x5'));var logger=require(_0x181a('0x6'))(_0x181a('0x7'));var config=require('../../config/environment');var jayson=require(_0x181a('0x8'));var client=jayson[_0x181a('0x9')]['http']({'port':0x232a});config[_0x181a('0xa')]=_['defaults'](config[_0x181a('0xa')],{'host':_0x181a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x181a('0xa')]));require(_0x181a('0xc'))[_0x181a('0xd')](socket);function respondWithRpcPromise(_0x46a4d7,_0x1d3f00,_0x2b585d){return new BPromise(function(_0x2f35d8,_0x5dfea8){return client[_0x181a('0xe')](_0x46a4d7,_0x2b585d)['then'](function(_0xbce4c){logger[_0x181a('0xf')](_0x181a('0x10'),_0x1d3f00,'request\x20sent');logger[_0x181a('0x11')](_0x181a('0x12'),_0x1d3f00,_0x181a('0x13'),JSON[_0x181a('0x14')](_0xbce4c));if(_0xbce4c[_0x181a('0x15')]){if(_0xbce4c['error'][_0x181a('0x16')]===0x1f4){logger[_0x181a('0x15')](_0x181a('0x10'),_0x1d3f00,_0xbce4c['error']['message']);return _0x5dfea8(_0xbce4c['error'][_0x181a('0x17')]);}logger[_0x181a('0x15')](_0x181a('0x10'),_0x1d3f00,_0xbce4c[_0x181a('0x15')][_0x181a('0x17')]);return _0x2f35d8(_0xbce4c[_0x181a('0x15')][_0x181a('0x17')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1d3f00,_0x181a('0x13'));_0x2f35d8(_0xbce4c[_0x181a('0x18')][_0x181a('0x17')]);}})[_0x181a('0x19')](function(_0x4113b1){logger[_0x181a('0x15')](_0x181a('0x10'),_0x1d3f00,_0x4113b1);_0x5dfea8(_0x4113b1);});});} \ No newline at end of file +var _0xe4bc=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x456cd7,_0x3be3f2){var _0x40c880=function(_0x172089){while(--_0x172089){_0x456cd7['push'](_0x456cd7['shift']());}};_0x40c880(++_0x3be3f2);}(_0xe4bc,0x16a));var _0xce4b=function(_0x529400,_0x12fa24){_0x529400=_0x529400-0x0;var _0x18fad8=_0xe4bc[_0x529400];return _0x18fad8;};'use strict';var _=require(_0xce4b('0x0'));var util=require(_0xce4b('0x1'));var moment=require(_0xce4b('0x2'));var BPromise=require(_0xce4b('0x3'));var rs=require(_0xce4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce4b('0x5'))['db'];var utils=require(_0xce4b('0x6'));var logger=require(_0xce4b('0x7'))('rpc');var config=require(_0xce4b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce4b('0x9')][_0xce4b('0xa')]({'port':0x232a});config[_0xce4b('0xb')]=_[_0xce4b('0xc')](config[_0xce4b('0xb')],{'host':_0xce4b('0xd'),'port':0x18eb});var socket=require(_0xce4b('0xe'))(new Redis(config[_0xce4b('0xb')]));require(_0xce4b('0xf'))[_0xce4b('0x10')](socket);function respondWithRpcPromise(_0x47769d,_0x4710bb,_0x2b7a49){return new BPromise(function(_0x3c2789,_0x5bd185){return client['request'](_0x47769d,_0x2b7a49)[_0xce4b('0x11')](function(_0x5c08f8){logger[_0xce4b('0x12')](_0xce4b('0x13'),_0x4710bb,_0xce4b('0x14'));logger['debug'](_0xce4b('0x15'),_0x4710bb,_0xce4b('0x14'),JSON[_0xce4b('0x16')](_0x5c08f8));if(_0x5c08f8['error']){if(_0x5c08f8[_0xce4b('0x17')][_0xce4b('0x18')]===0x1f4){logger[_0xce4b('0x17')](_0xce4b('0x13'),_0x4710bb,_0x5c08f8['error'][_0xce4b('0x19')]);return _0x5bd185(_0x5c08f8['error'][_0xce4b('0x19')]);}logger[_0xce4b('0x17')](_0xce4b('0x13'),_0x4710bb,_0x5c08f8[_0xce4b('0x17')][_0xce4b('0x19')]);return _0x3c2789(_0x5c08f8[_0xce4b('0x17')][_0xce4b('0x19')]);}else{logger[_0xce4b('0x12')](_0xce4b('0x13'),_0x4710bb,_0xce4b('0x14'));_0x3c2789(_0x5c08f8[_0xce4b('0x1a')][_0xce4b('0x19')]);}})[_0xce4b('0x1b')](function(_0x3af0fb){logger[_0xce4b('0x17')](_0xce4b('0x13'),_0x4710bb,_0x3af0fb);_0x5bd185(_0x3af0fb);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 33122f8..71aa037 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 _0x9f59=['length','chatWebsite:','remove','update','emit','removeListener','register'];(function(_0x24bd83,_0x1830c4){var _0x3a047e=function(_0x5d8bc4){while(--_0x5d8bc4){_0x24bd83['push'](_0x24bd83['shift']());}};_0x3a047e(++_0x1830c4);}(_0x9f59,0xcd));var _0x99f5=function(_0x29eb90,_0x2d7202){_0x29eb90=_0x29eb90-0x0;var _0x1371a6=_0x9f59[_0x29eb90];return _0x1371a6;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x99f5('0x0'),_0x99f5('0x1')];function createListener(_0x2535ec,_0x334ce4){return function(_0x5608fb){_0x334ce4[_0x99f5('0x2')](_0x2535ec,_0x5608fb);};}function removeListener(_0x4fdbfa,_0x596eb5){return function(){ChatWebsiteEvents[_0x99f5('0x3')](_0x4fdbfa,_0x596eb5);};}exports[_0x99f5('0x4')]=function(_0x3f00f6){for(var _0xa87849=0x0,_0x2d0154=events[_0x99f5('0x5')];_0xa87849<_0x2d0154;_0xa87849++){var _0x16fc38=events[_0xa87849];var _0x2d5a08=createListener(_0x99f5('0x6')+_0x16fc38,_0x3f00f6);ChatWebsiteEvents['on'](_0x16fc38,_0x2d5a08);}}; \ No newline at end of file +var _0x6d41=['update','emit','removeListener','length','./chatWebsite.events','save','remove'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x6d41,0x123));var _0x16d4=function(_0x13073f,_0x4ba4ed){_0x13073f=_0x13073f-0x0;var _0x780065=_0x6d41[_0x13073f];return _0x780065;};'use strict';var ChatWebsiteEvents=require(_0x16d4('0x0'));var events=[_0x16d4('0x1'),_0x16d4('0x2'),_0x16d4('0x3')];function createListener(_0x4cec89,_0x309159){return function(_0x3cc64e){_0x309159[_0x16d4('0x4')](_0x4cec89,_0x3cc64e);};}function removeListener(_0x13008b,_0x3f85d){return function(){ChatWebsiteEvents[_0x16d4('0x5')](_0x13008b,_0x3f85d);};}exports['register']=function(_0x1921f2){for(var _0x34b5fc=0x0,_0x239792=events[_0x16d4('0x6')];_0x34b5fc<_0x239792;_0x34b5fc++){var _0x1e5ce6=events[_0x34b5fc];var _0x3ef8c6=createListener('chatWebsite:'+_0x1e5ce6,_0x1921f2);ChatWebsiteEvents['on'](_0x1e5ce6,_0x3ef8c6);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 596b63a..662d66b 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 _0x33a4=['/:id/system_avatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addApplications','addProactiveActions','addAgents','put','delete','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','Router','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','originalname','file','diskStorage','now','single','addAvatar','server/files/images/avatars/','addCustomerAvatar'];(function(_0x375252,_0x5d6e86){var _0x7f02a1=function(_0x301bdd){while(--_0x301bdd){_0x375252['push'](_0x375252['shift']());}};_0x7f02a1(++_0x5d6e86);}(_0x33a4,0x88));var _0x433a=function(_0x1a487a,_0xa4393){_0x1a487a=_0x1a487a-0x0;var _0x5de126=_0x33a4[_0x1a487a];return _0x5de126;};'use strict';var multer=require('multer');var util=require(_0x433a('0x0'));var path=require('path');var timeout=require(_0x433a('0x1'));var express=require(_0x433a('0x2'));var router=express[_0x433a('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x433a('0x4'));router[_0x433a('0x5')]('/',auth[_0x433a('0x6')](),controller[_0x433a('0x7')]);router[_0x433a('0x5')]('/describe',auth[_0x433a('0x6')](),controller['describe']);router[_0x433a('0x5')](_0x433a('0x8'),auth[_0x433a('0x6')](),controller[_0x433a('0x9')]);router['get']('/:id/dispositions',auth[_0x433a('0x6')](),controller[_0x433a('0xa')]);router[_0x433a('0x5')](_0x433a('0xb'),auth[_0x433a('0x6')](),controller['getAnswers']);router['get'](_0x433a('0xc'),controller[_0x433a('0xd')]);router[_0x433a('0x5')](_0x433a('0xe'),controller['getAvatar']);router[_0x433a('0x5')](_0x433a('0xf'),controller['getCustomerAvatar']);router[_0x433a('0x5')]('/:id/system_avatar',controller[_0x433a('0x10')]);router[_0x433a('0x5')](_0x433a('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x433a('0x5')](_0x433a('0x12'),controller[_0x433a('0x13')]);router[_0x433a('0x5')](_0x433a('0x14'),auth['isAuthenticated'](),controller['getApplications']);router[_0x433a('0x5')](_0x433a('0x15'),auth[_0x433a('0x6')](),controller[_0x433a('0x16')]);router[_0x433a('0x5')](_0x433a('0x17'),controller[_0x433a('0x18')]);router[_0x433a('0x5')](_0x433a('0x19'),auth[_0x433a('0x6')](),controller[_0x433a('0x1a')]);router['get'](_0x433a('0x1b'),auth['isAuthenticated'](),controller[_0x433a('0x1c')]);router['post']('/',auth[_0x433a('0x6')](),controller[_0x433a('0x1d')]);router[_0x433a('0x1e')](_0x433a('0x1f'),auth[_0x433a('0x6')](),controller[_0x433a('0x20')]);router[_0x433a('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x433a('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x326785,_0x4e6142,_0xf69a42){_0xf69a42(null,path[_0x433a('0x22')](config[_0x433a('0x23')],_0x433a('0x24')));},'filename':function(_0x344e26,_0xaea8aa,_0x4b057a){_0x4b057a(null,util[_0x433a('0x25')](_0x433a('0x26'),Date['now'](),_0xaea8aa[_0x433a('0x27')]));}})});router['post']('/:id/logo',upload['single'](_0x433a('0x28')),controller['addLogo']);var upload=multer({'storage':multer[_0x433a('0x29')]({'destination':function(_0x499e8c,_0x49f03e,_0x46e452){_0x46e452(null,path[_0x433a('0x22')](config[_0x433a('0x23')],'server/files/images/avatars/'));},'filename':function(_0x383ad1,_0x3eb91e,_0x469b41){_0x469b41(null,util['format']('%s-%s',Date[_0x433a('0x2a')](),_0x3eb91e[_0x433a('0x27')]));}})});router[_0x433a('0x1e')](_0x433a('0xe'),upload[_0x433a('0x2b')](_0x433a('0x28')),controller[_0x433a('0x2c')]);var upload=multer({'storage':multer[_0x433a('0x29')]({'destination':function(_0x5246a6,_0x3c84cb,_0x2459d7){_0x2459d7(null,path[_0x433a('0x22')](config[_0x433a('0x23')],_0x433a('0x2d')));},'filename':function(_0x3ef5c9,_0x29fd7f,_0x3eb3e6){_0x3eb3e6(null,util[_0x433a('0x25')](_0x433a('0x26'),Date[_0x433a('0x2a')](),_0x29fd7f['originalname']));}})});router[_0x433a('0x1e')](_0x433a('0xf'),upload[_0x433a('0x2b')](_0x433a('0x28')),controller[_0x433a('0x2e')]);var upload=multer({'storage':multer[_0x433a('0x29')]({'destination':function(_0x475c9a,_0x367875,_0x1756d2){_0x1756d2(null,path[_0x433a('0x22')](config[_0x433a('0x23')],'server/files/images/avatars/'));},'filename':function(_0x3d8562,_0x266a9c,_0x54d216){_0x54d216(null,util['format'](_0x433a('0x26'),Date['now'](),_0x266a9c[_0x433a('0x27')]));}})});router[_0x433a('0x1e')](_0x433a('0x2f'),upload['single']('file'),controller[_0x433a('0x30')]);router[_0x433a('0x1e')](_0x433a('0x31'),controller[_0x433a('0x32')]);router[_0x433a('0x1e')](_0x433a('0x33'),controller['offline']);router['post'](_0x433a('0x11'),auth[_0x433a('0x6')](),controller['addInteraction']);router[_0x433a('0x1e')](_0x433a('0x14'),auth[_0x433a('0x6')](),controller[_0x433a('0x34')]);router[_0x433a('0x1e')](_0x433a('0x15'),auth['isAuthenticated'](),controller[_0x433a('0x35')]);router[_0x433a('0x1e')](_0x433a('0x1b'),auth[_0x433a('0x6')](),controller[_0x433a('0x36')]);router[_0x433a('0x37')](_0x433a('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x433a('0x38')](_0x433a('0x8'),auth[_0x433a('0x6')](),controller['destroy']);router[_0x433a('0x38')]('/:id/dispositions',auth[_0x433a('0x6')](),controller[_0x433a('0x39')]);router[_0x433a('0x38')](_0x433a('0xb'),auth['isAuthenticated'](),controller[_0x433a('0x3a')]);router[_0x433a('0x38')](_0x433a('0x1b'),auth[_0x433a('0x6')](),controller[_0x433a('0x3b')]);module[_0x433a('0x3c')]=router; \ No newline at end of file +var _0xfaec=['path','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','describe','show','/:id/dispositions','isAuthenticated','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','originalname','single','addLogo','now','file','addAvatar','server/files/images/avatars/','notify','/:id/offline','addInteraction','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','delete','/:id','removeDispositions','removeAgents','exports','multer','util'];(function(_0x4cab20,_0x268c14){var _0x1f32a7=function(_0x3ec705){while(--_0x3ec705){_0x4cab20['push'](_0x4cab20['shift']());}};_0x1f32a7(++_0x268c14);}(_0xfaec,0x12f));var _0xcfae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfaec[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xcfae('0x0'));var util=require(_0xcfae('0x1'));var path=require(_0xcfae('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xcfae('0x3'));var interaction=require(_0xcfae('0x4'));var config=require(_0xcfae('0x5'));var controller=require(_0xcfae('0x6'));router[_0xcfae('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcfae('0x7')](_0xcfae('0x8'),auth['isAuthenticated'](),controller[_0xcfae('0x9')]);router[_0xcfae('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xcfae('0xa')]);router[_0xcfae('0x7')](_0xcfae('0xb'),auth[_0xcfae('0xc')](),controller['getDispositions']);router[_0xcfae('0x7')](_0xcfae('0xd'),auth['isAuthenticated'](),controller[_0xcfae('0xe')]);router[_0xcfae('0x7')](_0xcfae('0xf'),controller[_0xcfae('0x10')]);router['get'](_0xcfae('0x11'),controller['getAvatar']);router[_0xcfae('0x7')](_0xcfae('0x12'),controller[_0xcfae('0x13')]);router['get'](_0xcfae('0x14'),controller[_0xcfae('0x15')]);router[_0xcfae('0x7')](_0xcfae('0x16'),auth[_0xcfae('0xc')](),controller['getInteractions']);router[_0xcfae('0x7')](_0xcfae('0x17'),controller[_0xcfae('0x18')]);router[_0xcfae('0x7')]('/:id/applications',auth[_0xcfae('0xc')](),controller[_0xcfae('0x19')]);router[_0xcfae('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xcfae('0x1a')]);router['get']('/:id/fields',controller[_0xcfae('0x1b')]);router['get'](_0xcfae('0x1c'),auth['isAuthenticated'](),controller[_0xcfae('0x1d')]);router[_0xcfae('0x7')]('/:id/users',auth[_0xcfae('0xc')](),controller[_0xcfae('0x1e')]);router[_0xcfae('0x1f')]('/',auth[_0xcfae('0xc')](),controller[_0xcfae('0x20')]);router[_0xcfae('0x1f')](_0xcfae('0xb'),auth[_0xcfae('0xc')](),controller[_0xcfae('0x21')]);router[_0xcfae('0x1f')](_0xcfae('0xd'),auth['isAuthenticated'](),controller[_0xcfae('0x22')]);var upload=multer({'storage':multer[_0xcfae('0x23')]({'destination':function(_0x33e819,_0x2fd264,_0x3824f5){_0x3824f5(null,path[_0xcfae('0x24')](config[_0xcfae('0x25')],'server/files/images/logos/'));},'filename':function(_0x1849a1,_0xe49262,_0x2cd487){_0x2cd487(null,util[_0xcfae('0x26')](_0xcfae('0x27'),Date['now'](),_0xe49262[_0xcfae('0x28')]));}})});router['post'](_0xcfae('0xf'),upload[_0xcfae('0x29')]('file'),controller[_0xcfae('0x2a')]);var upload=multer({'storage':multer[_0xcfae('0x23')]({'destination':function(_0xfa773e,_0x4567b0,_0x66c791){_0x66c791(null,path[_0xcfae('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x11ecf7,_0x5c4abe,_0xaf38ac){_0xaf38ac(null,util[_0xcfae('0x26')](_0xcfae('0x27'),Date[_0xcfae('0x2b')](),_0x5c4abe[_0xcfae('0x28')]));}})});router[_0xcfae('0x1f')](_0xcfae('0x11'),upload['single'](_0xcfae('0x2c')),controller[_0xcfae('0x2d')]);var upload=multer({'storage':multer[_0xcfae('0x23')]({'destination':function(_0x36989d,_0x1fde43,_0x28fcbc){_0x28fcbc(null,path[_0xcfae('0x24')](config[_0xcfae('0x25')],_0xcfae('0x2e')));},'filename':function(_0x549989,_0x34f0b1,_0x1c0450){_0x1c0450(null,util[_0xcfae('0x26')](_0xcfae('0x27'),Date[_0xcfae('0x2b')](),_0x34f0b1[_0xcfae('0x28')]));}})});router[_0xcfae('0x1f')](_0xcfae('0x12'),upload[_0xcfae('0x29')](_0xcfae('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xcfae('0x23')]({'destination':function(_0x1f982a,_0x201026,_0x2a020d){_0x2a020d(null,path[_0xcfae('0x24')](config[_0xcfae('0x25')],'server/files/images/avatars/'));},'filename':function(_0x4dfab3,_0x564e2e,_0x5f5466){_0x5f5466(null,util['format'](_0xcfae('0x27'),Date[_0xcfae('0x2b')](),_0x564e2e['originalname']));}})});router[_0xcfae('0x1f')]('/:id/system_avatar',upload['single'](_0xcfae('0x2c')),controller['addSystemAvatar']);router['post']('/:id/notify',controller[_0xcfae('0x2f')]);router[_0xcfae('0x1f')](_0xcfae('0x30'),controller['offline']);router[_0xcfae('0x1f')](_0xcfae('0x16'),auth[_0xcfae('0xc')](),controller[_0xcfae('0x31')]);router[_0xcfae('0x1f')]('/:id/applications',auth[_0xcfae('0xc')](),controller['addApplications']);router[_0xcfae('0x1f')](_0xcfae('0x32'),auth[_0xcfae('0xc')](),controller[_0xcfae('0x33')]);router['post'](_0xcfae('0x34'),auth[_0xcfae('0xc')](),controller[_0xcfae('0x35')]);router[_0xcfae('0x36')]('/:id',auth[_0xcfae('0xc')](),controller[_0xcfae('0x37')]);router[_0xcfae('0x38')](_0xcfae('0x39'),auth['isAuthenticated'](),controller['destroy']);router[_0xcfae('0x38')]('/:id/dispositions',auth[_0xcfae('0xc')](),controller[_0xcfae('0x3a')]);router[_0xcfae('0x38')](_0xcfae('0xd'),auth[_0xcfae('0xc')](),controller['removeAnswers']);router[_0xcfae('0x38')](_0xcfae('0x34'),auth[_0xcfae('0xc')](),controller[_0xcfae('0x3b')]);module[_0xcfae('0x3c')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 3a3b161..52736f9 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 _0x45b3=['exports','STRING'];(function(_0x5d7321,_0x1fe4f7){var _0x2828ed=function(_0x43faa){while(--_0x43faa){_0x5d7321['push'](_0x5d7321['shift']());}};_0x2828ed(++_0x1fe4f7);}(_0x45b3,0x1b8));var _0x345b=function(_0x586461,_0xd1a042){_0x586461=_0x586461-0x0;var _0x142233=_0x45b3[_0x586461];return _0x142233;};'use strict';var Sequelize=require('sequelize');module[_0x345b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x345b('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x345b('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x345b('0x1')]},'type':{'type':Sequelize[_0x345b('0x1')]},'street':{'type':Sequelize[_0x345b('0x1')]},'postalCode':{'type':Sequelize[_0x345b('0x1')]},'city':{'type':Sequelize[_0x345b('0x1')]},'country':{'type':Sequelize[_0x345b('0x1')]},'email':{'type':Sequelize[_0x345b('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x345b('0x1')]},'sStreet':{'type':Sequelize[_0x345b('0x1')]},'sPostalCode':{'type':Sequelize[_0x345b('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x345b('0x1')]}}; \ No newline at end of file +var _0xae8e=['name','exports','STRING'];(function(_0x5aa584,_0x2a9d65){var _0x1c3017=function(_0x31250f){while(--_0x31250f){_0x5aa584['push'](_0x5aa584['shift']());}};_0x1c3017(++_0x2a9d65);}(_0xae8e,0x1a5));var _0xeae8=function(_0x1aeff7,_0x10c93d){_0x1aeff7=_0x1aeff7-0x0;var _0x47bfd0=_0xae8e[_0x1aeff7];return _0x47bfd0;};'use strict';var Sequelize=require('sequelize');module[_0xeae8('0x0')]={'name':{'type':Sequelize[_0xeae8('0x1')],'unique':_0xeae8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xeae8('0x1')]},'website':{'type':Sequelize[_0xeae8('0x1')]},'phone':{'type':Sequelize[_0xeae8('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xeae8('0x1')]},'street':{'type':Sequelize[_0xeae8('0x1')]},'postalCode':{'type':Sequelize[_0xeae8('0x1')]},'city':{'type':Sequelize[_0xeae8('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xeae8('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xeae8('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xeae8('0x1')]},'sCountry':{'type':Sequelize[_0xeae8('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index a6b8bbf..25d8c46 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 _0xfa08=['create','user','role','UserProfileSection','userProfileId','UserProfileResource','error','body','CmContact','addContacts','omit','ids','findOne','hasOwnProperty','nolimit','html-pdf','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','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','Companies','destroy','sendStatus','stack','name','send','index','CmCompany','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','map','type','key','field','merge','options','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xfa08,0x117));var _0x8fa0=function(_0x29a868,_0x19dc91){_0x29a868=_0x29a868-0x0;var _0x33561c=_0xfa08[_0x29a868];return _0x33561c;};'use strict';var pdf=require(_0x8fa0('0x0'));var emlformat=require(_0x8fa0('0x1'));var rimraf=require(_0x8fa0('0x2'));var zipdir=require(_0x8fa0('0x3'));var jsonpatch=require(_0x8fa0('0x4'));var rp=require('request-promise');var moment=require(_0x8fa0('0x5'));var BPromise=require(_0x8fa0('0x6'));var Mustache=require(_0x8fa0('0x7'));var util=require(_0x8fa0('0x8'));var path=require(_0x8fa0('0x9'));var sox=require('sox');var csv=require(_0x8fa0('0xa'));var ejs=require(_0x8fa0('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8fa0('0xc'));var crypto=require(_0x8fa0('0xd'));var jsforce=require(_0x8fa0('0xe'));var deskjs=require(_0x8fa0('0xf'));var toCsv=require(_0x8fa0('0xa'));var querystring=require(_0x8fa0('0x10'));var Papa=require(_0x8fa0('0x11'));var Redis=require('ioredis');var authService=require(_0x8fa0('0x12'));var qs=require(_0x8fa0('0x13'));var hardwareService=require(_0x8fa0('0x14'));var logger=require('../../config/logger')(_0x8fa0('0x15'));var utils=require(_0x8fa0('0x16'));var config=require(_0x8fa0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17be75,_0x32a937){_0x32a937=_0x32a937||0xcc;return function(_0x20ed08){if(_0x20ed08){return _0x17be75['sendStatus'](_0x32a937);}return _0x17be75[_0x8fa0('0x18')](_0x32a937)[_0x8fa0('0x19')]();};}function respondWithResult(_0x22699e,_0x3a0201){_0x3a0201=_0x3a0201||0xc8;return function(_0x599c1d){if(_0x599c1d){return _0x22699e[_0x8fa0('0x18')](_0x3a0201)[_0x8fa0('0x1a')](_0x599c1d);}};}function respondWithFilteredResult(_0x128e4d,_0x8d0fa3){return function(_0x384c8e){if(_0x384c8e){var _0x1ccf0b=_0x384c8e[_0x8fa0('0x1b')],_0x293a79=_0x8d0fa3[_0x8fa0('0x1c')],_0x2a0ae7=_0x8d0fa3[_0x8fa0('0x1c')]+_0x8d0fa3[_0x8fa0('0x1d')],_0x2f1949;if(_0x2a0ae7>=_0x1ccf0b){_0x2a0ae7=_0x1ccf0b;_0x2f1949=0xc8;}else{_0x2f1949=0xce;}_0x128e4d['status'](_0x2f1949);return _0x128e4d[_0x8fa0('0x1e')](_0x8fa0('0x1f'),_0x293a79+'-'+_0x2a0ae7+'/'+_0x1ccf0b)[_0x8fa0('0x1a')](_0x384c8e);}return null;};}function patchUpdates(_0x2d9b10){return function(_0x204a51){try{jsonpatch['apply'](_0x204a51,_0x2d9b10,!![]);}catch(_0x3f8b75){return BPromise[_0x8fa0('0x20')](_0x3f8b75);}return _0x204a51[_0x8fa0('0x21')]();};}function saveUpdates(_0x5a9906,_0x2282da){return function(_0x304461){if(_0x304461){return _0x304461[_0x8fa0('0x22')](_0x5a9906)['then'](function(_0x474d9f){return _0x474d9f;});}return null;};}function removeEntity(_0x5c39ce,_0x3eda58){return function(_0x33cf29){if(_0x33cf29){return _0x33cf29['destroy']()[_0x8fa0('0x23')](function(){var _0x1ecbb2=_0x33cf29[_0x8fa0('0x24')]({'plain':!![]});var _0x5b698d=_0x8fa0('0x25');return db['UserProfileResource'][_0x8fa0('0x26')]({'where':{'type':_0x5b698d,'resourceId':_0x1ecbb2['id']}})[_0x8fa0('0x23')](function(){return _0x33cf29;});})[_0x8fa0('0x23')](function(){_0x5c39ce[_0x8fa0('0x18')](0xcc)[_0x8fa0('0x19')]();});}};}function handleEntityNotFound(_0x56c469,_0x2aca85){return function(_0x587138){if(!_0x587138){_0x56c469[_0x8fa0('0x27')](0x194);}return _0x587138;};}function handleError(_0x308cb4,_0x256456){_0x256456=_0x256456||0x1f4;return function(_0x4a4588){logger['error'](_0x4a4588[_0x8fa0('0x28')]);if(_0x4a4588[_0x8fa0('0x29')]){delete _0x4a4588['name'];}_0x308cb4[_0x8fa0('0x18')](_0x256456)[_0x8fa0('0x2a')](_0x4a4588);};}exports[_0x8fa0('0x2b')]=function(_0x89e1c1,_0x515b4a){var _0x2ea5fe={},_0x39d036={},_0x22138e={'count':0x0,'rows':[]};var _0x169ada=db[_0x8fa0('0x2c')][_0x8fa0('0x2d')];_0x39d036['model']=_[_0x8fa0('0x2e')](_0x169ada);_0x39d036[_0x8fa0('0x2f')]=_[_0x8fa0('0x2e')](_0x89e1c1[_0x8fa0('0x2f')]);_0x39d036[_0x8fa0('0x30')]=_[_0x8fa0('0x31')](_0x39d036[_0x8fa0('0x32')],_0x39d036[_0x8fa0('0x2f')]);_0x2ea5fe[_0x8fa0('0x33')]=_[_0x8fa0('0x31')](_0x39d036[_0x8fa0('0x32')],qs[_0x8fa0('0x34')](_0x89e1c1[_0x8fa0('0x2f')][_0x8fa0('0x34')]));_0x2ea5fe['attributes']=_0x2ea5fe[_0x8fa0('0x33')][_0x8fa0('0x35')]?_0x2ea5fe[_0x8fa0('0x33')]:_0x39d036[_0x8fa0('0x32')];if(!_0x89e1c1[_0x8fa0('0x2f')]['hasOwnProperty']('nolimit')){_0x2ea5fe['limit']=qs[_0x8fa0('0x1d')](_0x89e1c1[_0x8fa0('0x2f')]['limit']);_0x2ea5fe['offset']=qs[_0x8fa0('0x1c')](_0x89e1c1[_0x8fa0('0x2f')]['offset']);}_0x2ea5fe[_0x8fa0('0x36')]=qs[_0x8fa0('0x37')](_0x89e1c1['query'][_0x8fa0('0x37')]);_0x2ea5fe[_0x8fa0('0x38')]=qs[_0x8fa0('0x30')](_[_0x8fa0('0x39')](_0x89e1c1[_0x8fa0('0x2f')],_0x39d036['filters']));if(_0x89e1c1[_0x8fa0('0x2f')][_0x8fa0('0x3a')]){_0x2ea5fe[_0x8fa0('0x38')]=_['merge'](_0x2ea5fe[_0x8fa0('0x38')],{'$or':_[_0x8fa0('0x3b')](_0x169ada,function(_0x45dabc){if(_0x45dabc[_0x8fa0('0x3c')][_0x8fa0('0x3d')]!=='VIRTUAL'){var _0x1e3d39={};_0x1e3d39[_0x45dabc[_0x8fa0('0x3e')]]={'$like':'%'+_0x89e1c1[_0x8fa0('0x2f')][_0x8fa0('0x3a')]+'%'};return _0x1e3d39;}})});}_0x2ea5fe=_[_0x8fa0('0x3f')]({},_0x2ea5fe,_0x89e1c1[_0x8fa0('0x40')]);var _0x31b1e0={'where':_0x2ea5fe[_0x8fa0('0x38')]};return db[_0x8fa0('0x2c')]['count'](_0x31b1e0)[_0x8fa0('0x23')](function(_0x49e559){_0x22138e['count']=_0x49e559;if(_0x89e1c1[_0x8fa0('0x2f')][_0x8fa0('0x41')]){_0x2ea5fe[_0x8fa0('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0x8fa0('0x43')](_0x2ea5fe);})['then'](function(_0xf29653){_0x22138e[_0x8fa0('0x44')]=_0xf29653;return _0x22138e;})[_0x8fa0('0x23')](respondWithFilteredResult(_0x515b4a,_0x2ea5fe))[_0x8fa0('0x45')](handleError(_0x515b4a,null));};exports[_0x8fa0('0x46')]=function(_0x3305ca,_0x568e70){var _0x1d3519={'raw':![],'where':{'id':_0x3305ca[_0x8fa0('0x47')]['id']}},_0x28d891={};_0x28d891['model']=_[_0x8fa0('0x2e')](db[_0x8fa0('0x2c')][_0x8fa0('0x2d')]);_0x28d891[_0x8fa0('0x2f')]=_[_0x8fa0('0x2e')](_0x3305ca[_0x8fa0('0x2f')]);_0x28d891[_0x8fa0('0x30')]=_[_0x8fa0('0x31')](_0x28d891['model'],_0x28d891[_0x8fa0('0x2f')]);_0x1d3519[_0x8fa0('0x33')]=_[_0x8fa0('0x31')](_0x28d891['model'],qs['fields'](_0x3305ca['query']['fields']));_0x1d3519[_0x8fa0('0x33')]=_0x1d3519[_0x8fa0('0x33')][_0x8fa0('0x35')]?_0x1d3519[_0x8fa0('0x33')]:_0x28d891[_0x8fa0('0x32')];if(_0x3305ca[_0x8fa0('0x2f')][_0x8fa0('0x41')]){_0x1d3519[_0x8fa0('0x42')]=[{'all':!![]}];}_0x1d3519=_[_0x8fa0('0x3f')]({},_0x1d3519,_0x3305ca['options']);return db['CmCompany'][_0x8fa0('0x48')](_0x1d3519)[_0x8fa0('0x23')](handleEntityNotFound(_0x568e70,null))['then'](respondWithResult(_0x568e70,null))[_0x8fa0('0x45')](handleError(_0x568e70,null));};exports[_0x8fa0('0x49')]=function(_0x3d06bc,_0x9cd8cf){return db[_0x8fa0('0x2c')][_0x8fa0('0x49')](_0x3d06bc['body'],{})['then'](function(_0x53fa64){var _0x14ce5f=_0x3d06bc[_0x8fa0('0x4a')]['get']({'plain':!![]});if(!_0x14ce5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14ce5f[_0x8fa0('0x4b')]===_0x8fa0('0x4a')){var _0x24f983=_0x53fa64[_0x8fa0('0x24')]({'plain':!![]});var _0x204ea1=_0x8fa0('0x25');return db[_0x8fa0('0x4c')]['find']({'where':{'name':_0x204ea1,'userProfileId':_0x14ce5f[_0x8fa0('0x4d')]},'raw':!![]})[_0x8fa0('0x23')](function(_0x24a77b){if(_0x24a77b&&_0x24a77b['autoAssociation']===0x0){return db[_0x8fa0('0x4e')][_0x8fa0('0x49')]({'name':_0x24f983['name'],'resourceId':_0x24f983['id'],'type':_0x24a77b[_0x8fa0('0x29')],'sectionId':_0x24a77b['id']},{})[_0x8fa0('0x23')](function(){return _0x53fa64;});}else{return _0x53fa64;}})[_0x8fa0('0x45')](function(_0x187da9){logger[_0x8fa0('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x187da9);throw _0x187da9;});}return _0x53fa64;})['then'](respondWithResult(_0x9cd8cf,0xc9))[_0x8fa0('0x45')](handleError(_0x9cd8cf,null));};exports['update']=function(_0x2d8de9,_0x4642f9){if(_0x2d8de9[_0x8fa0('0x50')]['id']){delete _0x2d8de9[_0x8fa0('0x50')]['id'];}return db[_0x8fa0('0x2c')]['find']({'where':{'id':_0x2d8de9[_0x8fa0('0x47')]['id']}})[_0x8fa0('0x23')](handleEntityNotFound(_0x4642f9,null))[_0x8fa0('0x23')](saveUpdates(_0x2d8de9['body'],null))['then'](respondWithResult(_0x4642f9,null))[_0x8fa0('0x45')](handleError(_0x4642f9,null));};exports['destroy']=function(_0x5ceda1,_0x17a606){return db[_0x8fa0('0x2c')][_0x8fa0('0x48')]({'where':{'id':_0x5ceda1[_0x8fa0('0x47')]['id']}})['then'](handleEntityNotFound(_0x17a606,null))[_0x8fa0('0x23')](removeEntity(_0x17a606,null))['catch'](handleError(_0x17a606,null));};exports['addContacts']=function(_0x312dc7,_0x1993ba,_0x872748){return db[_0x8fa0('0x51')]['find']({'where':{'id':_0x312dc7[_0x8fa0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1993ba,null))['then'](function(_0x42cbc2){if(_0x42cbc2){return _0x42cbc2[_0x8fa0('0x52')](_0x312dc7[_0x8fa0('0x50')]['ids'],_[_0x8fa0('0x53')](_0x312dc7[_0x8fa0('0x50')],[_0x8fa0('0x54'),'id'])||{});}})[_0x8fa0('0x23')](respondWithResult(_0x1993ba,null))['catch'](handleError(_0x1993ba,null));};exports['getContacts']=function(_0x2ec074,_0x420ab2,_0x4717a3){var _0x34a03e={};var _0x27dace={};var _0x3b9cbb;var _0x502284;return db[_0x8fa0('0x2c')][_0x8fa0('0x55')]({'where':{'id':_0x2ec074['params']['id']}})['then'](handleEntityNotFound(_0x420ab2,null))[_0x8fa0('0x23')](function(_0x61154d){if(_0x61154d){_0x3b9cbb=_0x61154d;_0x27dace[_0x8fa0('0x32')]=_[_0x8fa0('0x2e')](db[_0x8fa0('0x51')][_0x8fa0('0x2d')]);_0x27dace['query']=_[_0x8fa0('0x2e')](_0x2ec074[_0x8fa0('0x2f')]);_0x27dace[_0x8fa0('0x30')]=_[_0x8fa0('0x31')](_0x27dace[_0x8fa0('0x32')],_0x27dace[_0x8fa0('0x2f')]);_0x34a03e[_0x8fa0('0x33')]=_[_0x8fa0('0x31')](_0x27dace[_0x8fa0('0x32')],qs['fields'](_0x2ec074['query'][_0x8fa0('0x34')]));_0x34a03e['attributes']=_0x34a03e['attributes'][_0x8fa0('0x35')]?_0x34a03e[_0x8fa0('0x33')]:_0x27dace[_0x8fa0('0x32')];_0x34a03e[_0x8fa0('0x36')]=qs[_0x8fa0('0x37')](_0x2ec074['query'][_0x8fa0('0x37')]);_0x34a03e[_0x8fa0('0x38')]=qs[_0x8fa0('0x30')](_[_0x8fa0('0x39')](_0x2ec074[_0x8fa0('0x2f')],_0x27dace[_0x8fa0('0x30')]));if(_0x2ec074[_0x8fa0('0x2f')][_0x8fa0('0x3a')]){_0x34a03e[_0x8fa0('0x38')]=_[_0x8fa0('0x3f')](_0x34a03e['where'],{'$or':_['map'](_0x34a03e[_0x8fa0('0x33')],function(_0x28818f){var _0x2ac66d={};_0x2ac66d[_0x28818f]={'$like':'%'+_0x2ec074[_0x8fa0('0x2f')]['filter']+'%'};return _0x2ac66d;})});}_0x34a03e=_[_0x8fa0('0x3f')]({},_0x34a03e,_0x2ec074['options']);return _0x3b9cbb['getContacts'](_0x34a03e);}})[_0x8fa0('0x23')](function(_0x5d6e06){if(_0x5d6e06){_0x502284=_0x5d6e06[_0x8fa0('0x35')];if(!_0x2ec074[_0x8fa0('0x2f')][_0x8fa0('0x56')](_0x8fa0('0x57'))){_0x34a03e[_0x8fa0('0x1d')]=qs[_0x8fa0('0x1d')](_0x2ec074[_0x8fa0('0x2f')][_0x8fa0('0x1d')]);_0x34a03e[_0x8fa0('0x1c')]=qs[_0x8fa0('0x1c')](_0x2ec074[_0x8fa0('0x2f')][_0x8fa0('0x1c')]);}return _0x3b9cbb['getContacts'](_0x34a03e);}})[_0x8fa0('0x23')](function(_0x4f7f78){if(_0x4f7f78){return _0x4f7f78?{'count':_0x502284,'rows':_0x4f7f78}:null;}})[_0x8fa0('0x23')](respondWithResult(_0x420ab2,null))[_0x8fa0('0x45')](handleError(_0x420ab2,null));}; \ No newline at end of file +var _0x9e9c=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','name','send','CmCompany','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x9e9c,0x1b7));var _0xc9e9=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0x9e9c[_0x543c51];return _0x360555;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc9e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc9e9('0x1'));var jsonpatch=require(_0xc9e9('0x2'));var rp=require(_0xc9e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc9e9('0x4'));var util=require(_0xc9e9('0x5'));var path=require(_0xc9e9('0x6'));var sox=require(_0xc9e9('0x7'));var csv=require(_0xc9e9('0x8'));var ejs=require(_0xc9e9('0x9'));var fs=require('fs');var _=require(_0xc9e9('0xa'));var squel=require(_0xc9e9('0xb'));var crypto=require(_0xc9e9('0xc'));var jsforce=require(_0xc9e9('0xd'));var deskjs=require(_0xc9e9('0xe'));var toCsv=require(_0xc9e9('0x8'));var querystring=require(_0xc9e9('0xf'));var Papa=require(_0xc9e9('0x10'));var Redis=require('ioredis');var authService=require(_0xc9e9('0x11'));var qs=require(_0xc9e9('0x12'));var hardwareService=require(_0xc9e9('0x13'));var logger=require(_0xc9e9('0x14'))(_0xc9e9('0x15'));var utils=require(_0xc9e9('0x16'));var config=require(_0xc9e9('0x17'));var db=require(_0xc9e9('0x18'))['db'];function respondWithStatusCode(_0x16bd7b,_0x3568f6){_0x3568f6=_0x3568f6||0xcc;return function(_0x24c440){if(_0x24c440){return _0x16bd7b[_0xc9e9('0x19')](_0x3568f6);}return _0x16bd7b[_0xc9e9('0x1a')](_0x3568f6)['end']();};}function respondWithResult(_0x279b86,_0x233628){_0x233628=_0x233628||0xc8;return function(_0xed0c7c){if(_0xed0c7c){return _0x279b86[_0xc9e9('0x1a')](_0x233628)[_0xc9e9('0x1b')](_0xed0c7c);}};}function respondWithFilteredResult(_0x97e43b,_0x27dbd7){return function(_0x371632){if(_0x371632){var _0x3f0381=_0x371632['count'],_0x384e28=_0x27dbd7[_0xc9e9('0x1c')],_0x53f17f=_0x27dbd7[_0xc9e9('0x1c')]+_0x27dbd7[_0xc9e9('0x1d')],_0x3f19af;if(_0x53f17f>=_0x3f0381){_0x53f17f=_0x3f0381;_0x3f19af=0xc8;}else{_0x3f19af=0xce;}_0x97e43b[_0xc9e9('0x1a')](_0x3f19af);return _0x97e43b[_0xc9e9('0x1e')](_0xc9e9('0x1f'),_0x384e28+'-'+_0x53f17f+'/'+_0x3f0381)[_0xc9e9('0x1b')](_0x371632);}return null;};}function patchUpdates(_0x291e9e){return function(_0x46b961){try{jsonpatch[_0xc9e9('0x20')](_0x46b961,_0x291e9e,!![]);}catch(_0x451121){return BPromise[_0xc9e9('0x21')](_0x451121);}return _0x46b961[_0xc9e9('0x22')]();};}function saveUpdates(_0x581dbe,_0x336ff4){return function(_0x3d3c81){if(_0x3d3c81){return _0x3d3c81[_0xc9e9('0x23')](_0x581dbe)[_0xc9e9('0x24')](function(_0x50db4f){return _0x50db4f;});}return null;};}function removeEntity(_0x12cca5,_0x5cb3cf){return function(_0x438c1f){if(_0x438c1f){return _0x438c1f[_0xc9e9('0x25')]()[_0xc9e9('0x24')](function(){var _0x3ea267=_0x438c1f[_0xc9e9('0x26')]({'plain':!![]});var _0xe3ca50=_0xc9e9('0x27');return db['UserProfileResource'][_0xc9e9('0x25')]({'where':{'type':_0xe3ca50,'resourceId':_0x3ea267['id']}})[_0xc9e9('0x24')](function(){return _0x438c1f;});})['then'](function(){_0x12cca5[_0xc9e9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3c0b,_0x8fa0ff){return function(_0x33278b){if(!_0x33278b){_0x1f3c0b[_0xc9e9('0x19')](0x194);}return _0x33278b;};}function handleError(_0x387e22,_0x26ef23){_0x26ef23=_0x26ef23||0x1f4;return function(_0x36122c){logger['error'](_0x36122c['stack']);if(_0x36122c[_0xc9e9('0x28')]){delete _0x36122c['name'];}_0x387e22['status'](_0x26ef23)[_0xc9e9('0x29')](_0x36122c);};}exports['index']=function(_0x1eb14f,_0x61818){var _0x21e05c={},_0x17cdf6={},_0x57eb6d={'count':0x0,'rows':[]};var _0x5ed623=db[_0xc9e9('0x2a')]['rawAttributes'];_0x17cdf6[_0xc9e9('0x2b')]=_['keys'](_0x5ed623);_0x17cdf6[_0xc9e9('0x2c')]=_[_0xc9e9('0x2d')](_0x1eb14f['query']);_0x17cdf6[_0xc9e9('0x2e')]=_['intersection'](_0x17cdf6[_0xc9e9('0x2b')],_0x17cdf6[_0xc9e9('0x2c')]);_0x21e05c[_0xc9e9('0x2f')]=_[_0xc9e9('0x30')](_0x17cdf6[_0xc9e9('0x2b')],qs['fields'](_0x1eb14f[_0xc9e9('0x2c')][_0xc9e9('0x31')]));_0x21e05c[_0xc9e9('0x2f')]=_0x21e05c['attributes'][_0xc9e9('0x32')]?_0x21e05c['attributes']:_0x17cdf6[_0xc9e9('0x2b')];if(!_0x1eb14f['query']['hasOwnProperty']('nolimit')){_0x21e05c['limit']=qs['limit'](_0x1eb14f['query']['limit']);_0x21e05c[_0xc9e9('0x1c')]=qs[_0xc9e9('0x1c')](_0x1eb14f[_0xc9e9('0x2c')][_0xc9e9('0x1c')]);}_0x21e05c[_0xc9e9('0x33')]=qs[_0xc9e9('0x34')](_0x1eb14f[_0xc9e9('0x2c')]['sort']);_0x21e05c[_0xc9e9('0x35')]=qs['filters'](_[_0xc9e9('0x36')](_0x1eb14f['query'],_0x17cdf6[_0xc9e9('0x2e')]));if(_0x1eb14f['query'][_0xc9e9('0x37')]){_0x21e05c[_0xc9e9('0x35')]=_['merge'](_0x21e05c[_0xc9e9('0x35')],{'$or':_[_0xc9e9('0x38')](_0x5ed623,function(_0x589c73){if(_0x589c73[_0xc9e9('0x39')][_0xc9e9('0x3a')]!==_0xc9e9('0x3b')){var _0x234480={};_0x234480[_0x589c73[_0xc9e9('0x3c')]]={'$like':'%'+_0x1eb14f[_0xc9e9('0x2c')]['filter']+'%'};return _0x234480;}})});}_0x21e05c=_[_0xc9e9('0x3d')]({},_0x21e05c,_0x1eb14f['options']);var _0x5a5e6c={'where':_0x21e05c[_0xc9e9('0x35')]};return db[_0xc9e9('0x2a')][_0xc9e9('0x3e')](_0x5a5e6c)['then'](function(_0x53e901){_0x57eb6d[_0xc9e9('0x3e')]=_0x53e901;if(_0x1eb14f[_0xc9e9('0x2c')][_0xc9e9('0x3f')]){_0x21e05c[_0xc9e9('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0xc9e9('0x41')](_0x21e05c);})['then'](function(_0x1d7df5){_0x57eb6d['rows']=_0x1d7df5;return _0x57eb6d;})[_0xc9e9('0x24')](respondWithFilteredResult(_0x61818,_0x21e05c))[_0xc9e9('0x42')](handleError(_0x61818,null));};exports[_0xc9e9('0x43')]=function(_0x451795,_0x242d63){var _0x5f5844={'raw':![],'where':{'id':_0x451795[_0xc9e9('0x44')]['id']}},_0x40b531={};_0x40b531[_0xc9e9('0x2b')]=_[_0xc9e9('0x2d')](db[_0xc9e9('0x2a')][_0xc9e9('0x45')]);_0x40b531[_0xc9e9('0x2c')]=_['keys'](_0x451795[_0xc9e9('0x2c')]);_0x40b531[_0xc9e9('0x2e')]=_[_0xc9e9('0x30')](_0x40b531[_0xc9e9('0x2b')],_0x40b531[_0xc9e9('0x2c')]);_0x5f5844[_0xc9e9('0x2f')]=_[_0xc9e9('0x30')](_0x40b531['model'],qs[_0xc9e9('0x31')](_0x451795[_0xc9e9('0x2c')][_0xc9e9('0x31')]));_0x5f5844[_0xc9e9('0x2f')]=_0x5f5844['attributes']['length']?_0x5f5844['attributes']:_0x40b531[_0xc9e9('0x2b')];if(_0x451795[_0xc9e9('0x2c')][_0xc9e9('0x3f')]){_0x5f5844[_0xc9e9('0x40')]=[{'all':!![]}];}_0x5f5844=_[_0xc9e9('0x3d')]({},_0x5f5844,_0x451795[_0xc9e9('0x46')]);return db['CmCompany'][_0xc9e9('0x47')](_0x5f5844)['then'](handleEntityNotFound(_0x242d63,null))['then'](respondWithResult(_0x242d63,null))[_0xc9e9('0x42')](handleError(_0x242d63,null));};exports['create']=function(_0x389bf1,_0x254244){return db[_0xc9e9('0x2a')][_0xc9e9('0x48')](_0x389bf1[_0xc9e9('0x49')],{})['then'](function(_0x43dd67){var _0x52714d=_0x389bf1['user'][_0xc9e9('0x26')]({'plain':!![]});if(!_0x52714d)throw new Error(_0xc9e9('0x4a'));if(_0x52714d[_0xc9e9('0x4b')]===_0xc9e9('0x4c')){var _0x729bb7=_0x43dd67[_0xc9e9('0x26')]({'plain':!![]});var _0xec5e5=_0xc9e9('0x27');return db[_0xc9e9('0x4d')]['find']({'where':{'name':_0xec5e5,'userProfileId':_0x52714d[_0xc9e9('0x4e')]},'raw':!![]})[_0xc9e9('0x24')](function(_0x5e2826){if(_0x5e2826&&_0x5e2826[_0xc9e9('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x729bb7[_0xc9e9('0x28')],'resourceId':_0x729bb7['id'],'type':_0x5e2826[_0xc9e9('0x28')],'sectionId':_0x5e2826['id']},{})[_0xc9e9('0x24')](function(){return _0x43dd67;});}else{return _0x43dd67;}})['catch'](function(_0xa9eff4){logger[_0xc9e9('0x50')](_0xc9e9('0x51'),_0xa9eff4);throw _0xa9eff4;});}return _0x43dd67;})['then'](respondWithResult(_0x254244,0xc9))['catch'](handleError(_0x254244,null));};exports[_0xc9e9('0x23')]=function(_0x456ae6,_0x2b7f52){if(_0x456ae6[_0xc9e9('0x49')]['id']){delete _0x456ae6[_0xc9e9('0x49')]['id'];}return db[_0xc9e9('0x2a')][_0xc9e9('0x47')]({'where':{'id':_0x456ae6[_0xc9e9('0x44')]['id']}})[_0xc9e9('0x24')](handleEntityNotFound(_0x2b7f52,null))['then'](saveUpdates(_0x456ae6[_0xc9e9('0x49')],null))[_0xc9e9('0x24')](respondWithResult(_0x2b7f52,null))[_0xc9e9('0x42')](handleError(_0x2b7f52,null));};exports[_0xc9e9('0x25')]=function(_0x442ea2,_0xbc2954){return db['CmCompany'][_0xc9e9('0x47')]({'where':{'id':_0x442ea2[_0xc9e9('0x44')]['id']}})[_0xc9e9('0x24')](handleEntityNotFound(_0xbc2954,null))[_0xc9e9('0x24')](removeEntity(_0xbc2954,null))[_0xc9e9('0x42')](handleError(_0xbc2954,null));};exports[_0xc9e9('0x52')]=function(_0x448962,_0x19df01,_0x12d982){return db[_0xc9e9('0x53')][_0xc9e9('0x47')]({'where':{'id':_0x448962['params']['id']}})['then'](handleEntityNotFound(_0x19df01,null))['then'](function(_0x5d80da){if(_0x5d80da){return _0x5d80da[_0xc9e9('0x52')](_0x448962[_0xc9e9('0x49')][_0xc9e9('0x54')],_[_0xc9e9('0x55')](_0x448962[_0xc9e9('0x49')],['ids','id'])||{});}})['then'](respondWithResult(_0x19df01,null))[_0xc9e9('0x42')](handleError(_0x19df01,null));};exports[_0xc9e9('0x56')]=function(_0x28a65e,_0x40631a,_0x3c0fb6){var _0x52a341={};var _0x4a1d17={};var _0x389966;var _0x26afbf;return db[_0xc9e9('0x2a')][_0xc9e9('0x57')]({'where':{'id':_0x28a65e[_0xc9e9('0x44')]['id']}})[_0xc9e9('0x24')](handleEntityNotFound(_0x40631a,null))[_0xc9e9('0x24')](function(_0xa3a636){if(_0xa3a636){_0x389966=_0xa3a636;_0x4a1d17[_0xc9e9('0x2b')]=_[_0xc9e9('0x2d')](db[_0xc9e9('0x53')][_0xc9e9('0x45')]);_0x4a1d17['query']=_['keys'](_0x28a65e['query']);_0x4a1d17[_0xc9e9('0x2e')]=_[_0xc9e9('0x30')](_0x4a1d17['model'],_0x4a1d17[_0xc9e9('0x2c')]);_0x52a341[_0xc9e9('0x2f')]=_[_0xc9e9('0x30')](_0x4a1d17['model'],qs[_0xc9e9('0x31')](_0x28a65e[_0xc9e9('0x2c')][_0xc9e9('0x31')]));_0x52a341[_0xc9e9('0x2f')]=_0x52a341[_0xc9e9('0x2f')][_0xc9e9('0x32')]?_0x52a341[_0xc9e9('0x2f')]:_0x4a1d17[_0xc9e9('0x2b')];_0x52a341[_0xc9e9('0x33')]=qs[_0xc9e9('0x34')](_0x28a65e['query']['sort']);_0x52a341[_0xc9e9('0x35')]=qs['filters'](_[_0xc9e9('0x36')](_0x28a65e[_0xc9e9('0x2c')],_0x4a1d17[_0xc9e9('0x2e')]));if(_0x28a65e[_0xc9e9('0x2c')]['filter']){_0x52a341[_0xc9e9('0x35')]=_[_0xc9e9('0x3d')](_0x52a341[_0xc9e9('0x35')],{'$or':_[_0xc9e9('0x38')](_0x52a341[_0xc9e9('0x2f')],function(_0x2935ce){var _0x324e8b={};_0x324e8b[_0x2935ce]={'$like':'%'+_0x28a65e[_0xc9e9('0x2c')][_0xc9e9('0x37')]+'%'};return _0x324e8b;})});}_0x52a341=_[_0xc9e9('0x3d')]({},_0x52a341,_0x28a65e[_0xc9e9('0x46')]);return _0x389966['getContacts'](_0x52a341);}})[_0xc9e9('0x24')](function(_0x773173){if(_0x773173){_0x26afbf=_0x773173[_0xc9e9('0x32')];if(!_0x28a65e[_0xc9e9('0x2c')]['hasOwnProperty'](_0xc9e9('0x58'))){_0x52a341[_0xc9e9('0x1d')]=qs[_0xc9e9('0x1d')](_0x28a65e[_0xc9e9('0x2c')][_0xc9e9('0x1d')]);_0x52a341[_0xc9e9('0x1c')]=qs[_0xc9e9('0x1c')](_0x28a65e[_0xc9e9('0x2c')][_0xc9e9('0x1c')]);}return _0x389966[_0xc9e9('0x56')](_0x52a341);}})[_0xc9e9('0x24')](function(_0x54541a){if(_0x54541a){return _0x54541a?{'count':_0x26afbf,'rows':_0x54541a}:null;}})[_0xc9e9('0x24')](respondWithResult(_0x40631a,null))[_0xc9e9('0x42')](handleError(_0x40631a,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 211fc6f..e1e22fd 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 _0x065e=['moment','bluebird','request-promise','../../config/environment','./cmCompany.attributes','define','cm_companies','lodash'];(function(_0x11cf88,_0x2ac512){var _0xd51772=function(_0x1470a9){while(--_0x1470a9){_0x11cf88['push'](_0x11cf88['shift']());}};_0xd51772(++_0x2ac512);}(_0x065e,0x1a7));var _0xe065=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x065e[_0x4b6830];return _0x239e4a;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe065('0x1'));var BPromise=require(_0xe065('0x2'));var rp=require(_0xe065('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe065('0x4'));var attributes=require(_0xe065('0x5'));module['exports']=function(_0x10b45f,_0x1e7e69){return _0x10b45f[_0xe065('0x6')]('CmCompany',attributes,{'tableName':_0xe065('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb016=['../../config/environment','exports','cm_companies','lodash','util','moment','request-promise','path','rimraf'];(function(_0x506e89,_0x556089){var _0x1b5828=function(_0x5b1f50){while(--_0x5b1f50){_0x506e89['push'](_0x506e89['shift']());}};_0x1b5828(++_0x556089);}(_0xb016,0x159));var _0x6b01=function(_0x3737ae,_0x5580d5){_0x3737ae=_0x3737ae-0x0;var _0x426255=_0xb016[_0x3737ae];return _0x426255;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./cmCompany.attributes');module[_0x6b01('0x7')]=function(_0x65407a,_0x192b2d){return _0x65407a['define']('CmCompany',attributes,{'tableName':_0x6b01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 5dc063a..fc837e9 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 _0xdb06=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5cafd3,_0x49e611){var _0x1970d3=function(_0x291d9f){while(--_0x291d9f){_0x5cafd3['push'](_0x5cafd3['shift']());}};_0x1970d3(++_0x49e611);}(_0xdb06,0xf0));var _0x6db0=function(_0x1874fd,_0x3a1ad7){_0x1874fd=_0x1874fd-0x0;var _0x4d9881=_0xdb06[_0x1874fd];return _0x4d9881;};'use strict';var _=require(_0x6db0('0x0'));var util=require(_0x6db0('0x1'));var moment=require(_0x6db0('0x2'));var BPromise=require(_0x6db0('0x3'));var rs=require(_0x6db0('0x4'));var fs=require('fs');var Redis=require(_0x6db0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6db0('0x6'));var logger=require('../../config/logger')(_0x6db0('0x7'));var config=require('../../config/environment');var jayson=require(_0x6db0('0x8'));var client=jayson[_0x6db0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dbc09,_0x26d630,_0x40b7e3){return new BPromise(function(_0x14e668,_0x21f7a7){return client[_0x6db0('0xa')](_0x1dbc09,_0x40b7e3)['then'](function(_0x5028b3){logger[_0x6db0('0xb')](_0x6db0('0xc'),_0x26d630,_0x6db0('0xd'));logger[_0x6db0('0xe')](_0x6db0('0xf'),_0x26d630,_0x6db0('0xd'),JSON[_0x6db0('0x10')](_0x5028b3));if(_0x5028b3[_0x6db0('0x11')]){if(_0x5028b3['error'][_0x6db0('0x12')]===0x1f4){logger[_0x6db0('0x11')](_0x6db0('0xc'),_0x26d630,_0x5028b3['error']['message']);return _0x21f7a7(_0x5028b3[_0x6db0('0x11')][_0x6db0('0x13')]);}logger['error'](_0x6db0('0xc'),_0x26d630,_0x5028b3[_0x6db0('0x11')][_0x6db0('0x13')]);return _0x14e668(_0x5028b3[_0x6db0('0x11')][_0x6db0('0x13')]);}else{logger[_0x6db0('0xb')](_0x6db0('0xc'),_0x26d630,_0x6db0('0xd'));_0x14e668(_0x5028b3[_0x6db0('0x14')]['message']);}})[_0x6db0('0x15')](function(_0x4c578a){logger[_0x6db0('0x11')](_0x6db0('0xc'),_0x26d630,_0x4c578a);_0x21f7a7(_0x4c578a);});});} \ No newline at end of file +var _0xf6d4=['../../config/environment','jayson/promise','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4e8236,_0x2b2720){var _0x3f5e47=function(_0x455b7a){while(--_0x455b7a){_0x4e8236['push'](_0x4e8236['shift']());}};_0x3f5e47(++_0x2b2720);}(_0xf6d4,0x86));var _0x4f6d=function(_0x491bf3,_0x3364cd){_0x491bf3=_0x491bf3-0x0;var _0x1ac24b=_0xf6d4[_0x491bf3];return _0x1ac24b;};'use strict';var _=require(_0x4f6d('0x0'));var util=require(_0x4f6d('0x1'));var moment=require(_0x4f6d('0x2'));var BPromise=require(_0x4f6d('0x3'));var rs=require(_0x4f6d('0x4'));var fs=require('fs');var Redis=require(_0x4f6d('0x5'));var db=require(_0x4f6d('0x6'))['db'];var utils=require(_0x4f6d('0x7'));var logger=require(_0x4f6d('0x8'))(_0x4f6d('0x9'));var config=require(_0x4f6d('0xa'));var jayson=require(_0x4f6d('0xb'));var client=jayson['client'][_0x4f6d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35be84,_0x32a6d0,_0xeed489){return new BPromise(function(_0x226129,_0x19ce30){return client[_0x4f6d('0xd')](_0x35be84,_0xeed489)['then'](function(_0x5b11c0){logger[_0x4f6d('0xe')](_0x4f6d('0xf'),_0x32a6d0,_0x4f6d('0x10'));logger[_0x4f6d('0x11')](_0x4f6d('0x12'),_0x32a6d0,_0x4f6d('0x10'),JSON['stringify'](_0x5b11c0));if(_0x5b11c0[_0x4f6d('0x13')]){if(_0x5b11c0['error'][_0x4f6d('0x14')]===0x1f4){logger[_0x4f6d('0x13')]('CmCompany,\x20%s,\x20%s',_0x32a6d0,_0x5b11c0[_0x4f6d('0x13')][_0x4f6d('0x15')]);return _0x19ce30(_0x5b11c0[_0x4f6d('0x13')][_0x4f6d('0x15')]);}logger['error'](_0x4f6d('0xf'),_0x32a6d0,_0x5b11c0['error']['message']);return _0x226129(_0x5b11c0['error'][_0x4f6d('0x15')]);}else{logger[_0x4f6d('0xe')](_0x4f6d('0xf'),_0x32a6d0,'request\x20sent');_0x226129(_0x5b11c0[_0x4f6d('0x16')][_0x4f6d('0x15')]);}})[_0x4f6d('0x17')](function(_0x393457){logger[_0x4f6d('0x13')](_0x4f6d('0xf'),_0x32a6d0,_0x393457);_0x19ce30(_0x393457);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 683f0db..8ebfb29 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 _0xb43e=['index','/:id','isAuthenticated','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get'];(function(_0x1d6fb9,_0x425e6c){var _0x3a4e57=function(_0x1a2a6c){while(--_0x1a2a6c){_0x1d6fb9['push'](_0x1d6fb9['shift']());}};_0x3a4e57(++_0x425e6c);}(_0xb43e,0x1f0));var _0xeb43=function(_0x3cbb3f,_0x1f5ed6){_0x3cbb3f=_0x3cbb3f-0x0;var _0x35537d=_0xb43e[_0x3cbb3f];return _0x35537d;};'use strict';var multer=require('multer');var util=require(_0xeb43('0x0'));var path=require(_0xeb43('0x1'));var timeout=require(_0xeb43('0x2'));var express=require('express');var router=express[_0xeb43('0x3')]();var auth=require(_0xeb43('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xeb43('0x5'));var controller=require(_0xeb43('0x6'));router[_0xeb43('0x7')]('/',auth['isAuthenticated'](),controller[_0xeb43('0x8')]);router[_0xeb43('0x7')](_0xeb43('0x9'),auth[_0xeb43('0xa')](),controller[_0xeb43('0xb')]);router[_0xeb43('0x7')](_0xeb43('0xc'),auth[_0xeb43('0xa')](),controller[_0xeb43('0xd')]);router['post']('/',auth[_0xeb43('0xa')](),controller['create']);router[_0xeb43('0xe')](_0xeb43('0xc'),auth['isAuthenticated'](),controller[_0xeb43('0xf')]);router[_0xeb43('0x10')](_0xeb43('0x9'),auth[_0xeb43('0xa')](),controller[_0xeb43('0x11')]);router[_0xeb43('0x12')]('/:id',auth[_0xeb43('0xa')](),controller[_0xeb43('0x13')]);module[_0xeb43('0x14')]=router; \ No newline at end of file +var _0x76ef=['../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','destroy','exports','connect-timeout'];(function(_0x1ab6a7,_0x2aa9ba){var _0x548275=function(_0x4fc354){while(--_0x4fc354){_0x1ab6a7['push'](_0x1ab6a7['shift']());}};_0x548275(++_0x2aa9ba);}(_0x76ef,0x1ec));var _0xf76e=function(_0x2a2621,_0x10c6b2){_0x2a2621=_0x2a2621-0x0;var _0x19629b=_0x76ef[_0x2a2621];return _0x19629b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf76e('0x0'));var express=require('express');var router=express['Router']();var auth=require(_0xf76e('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0xf76e('0x2'));var controller=require(_0xf76e('0x3'));router[_0xf76e('0x4')]('/',auth[_0xf76e('0x5')](),controller[_0xf76e('0x6')]);router[_0xf76e('0x4')](_0xf76e('0x7'),auth['isAuthenticated'](),controller[_0xf76e('0x8')]);router[_0xf76e('0x4')](_0xf76e('0x9'),auth['isAuthenticated'](),controller[_0xf76e('0xa')]);router[_0xf76e('0xb')]('/',auth[_0xf76e('0x5')](),controller['create']);router[_0xf76e('0xb')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xf76e('0xc')]);router[_0xf76e('0xd')](_0xf76e('0x7'),auth[_0xf76e('0x5')](),controller[_0xf76e('0xe')]);router['delete'](_0xf76e('0x7'),auth['isAuthenticated'](),controller[_0xf76e('0xf')]);module[_0xf76e('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a4e1f99..ee63480 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 _0xdce3=['lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0x10f1ff,_0x5ac035){var _0x1de0da=function(_0x3c247e){while(--_0x3c247e){_0x10f1ff['push'](_0x10f1ff['shift']());}};_0x1de0da(++_0x5ac035);}(_0xdce3,0x1a9));var _0x3dce=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdce3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3dce('0x0'));var Sequelize=require(_0x3dce('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x3dce('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3dce('0x2')]},'street':{'type':Sequelize[_0x3dce('0x2')]},'postalCode':{'type':Sequelize[_0x3dce('0x2')]},'city':{'type':Sequelize[_0x3dce('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x3dce('0x2')]},'description':{'type':Sequelize[_0x3dce('0x3')]},'phone':{'type':Sequelize[_0x3dce('0x2')]},'mobile':{'type':Sequelize[_0x3dce('0x2')]},'fax':{'type':Sequelize[_0x3dce('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x3dce('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3dce('0x2')]},'twitter':{'type':Sequelize[_0x3dce('0x2')]},'skype':{'type':Sequelize[_0x3dce('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x3dce('0x2')]},'UserId':{'type':Sequelize[_0x3dce('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa3cf=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize'];(function(_0x2db315,_0x58d720){var _0x12f9a2=function(_0x1f146e){while(--_0x1f146e){_0x2db315['push'](_0x2db315['shift']());}};_0x12f9a2(++_0x58d720);}(_0xa3cf,0x156));var _0xfa3c=function(_0x3be453,_0x15d02d){_0x3be453=_0x3be453-0x0;var _0x44763c=_0xa3cf[_0x3be453];return _0x44763c;};'use strict';var _=require(_0xfa3c('0x0'));var Sequelize=require(_0xfa3c('0x1'));module[_0xfa3c('0x2')]={'firstName':{'type':Sequelize[_0xfa3c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xfa3c('0x3')]},'street':{'type':Sequelize[_0xfa3c('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfa3c('0x3')]},'country':{'type':Sequelize[_0xfa3c('0x3')]},'dateOfBirth':{'type':Sequelize[_0xfa3c('0x3')]},'description':{'type':Sequelize[_0xfa3c('0x4')]},'phone':{'type':Sequelize[_0xfa3c('0x3')]},'mobile':{'type':Sequelize[_0xfa3c('0x3')]},'fax':{'type':Sequelize[_0xfa3c('0x3')]},'email':{'type':Sequelize[_0xfa3c('0x3')]},'url':{'type':Sequelize[_0xfa3c('0x3')]},'facebook':{'type':Sequelize[_0xfa3c('0x3')]},'fb_data':{'type':Sequelize[_0xfa3c('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xfa3c('0x3')]},'teams':{'type':Sequelize[_0xfa3c('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xfa3c('0x3')]},'UserId':{'type':Sequelize[_0xfa3c('0x5')]},'priority':{'type':Sequelize[_0xfa3c('0x5')](0x2)[_0xfa3c('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfa3c('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5f23cfd..8735cd9 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 _0xac0d=['CompanyId','meta','import','User','binding','No\x20phone\x20column\x20specified','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','apply','save','update','destroy','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','where','select','field','from','tools_tags','cm_contacts','c.deletedAt\x20IS\x20NULL','expr','advancedFilter','parse','forEach','isArray','value','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','order','DESC','c.id','QueryTypes','SELECT','clone','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','sequelize','toString','then','keyBy','count','c.*','TagIds','Tags','split','push','rows','catch','CmContact','params','startsWith','cf_','columnName','CmCustomField','findAll','displayName','alias','custom','type','values','hasOwnProperty','merge','body','get','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','create','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','Tag','color','$and','omit','find','format','cf_%d','table','setFields','id\x20=\x20?','toParam','text','phone','findOne','rawAttributes','sort','pick','options','getTags','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv'];(function(_0x394149,_0x268fe1){var _0x3f187a=function(_0x58583c){while(--_0x58583c){_0x394149['push'](_0x394149['shift']());}};_0x3f187a(++_0x268fe1);}(_0xac0d,0xe8));var _0xdac0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xac0d[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0xdac0('0x0'));var emlformat=require(_0xdac0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdac0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdac0('0x3'));var BPromise=require(_0xdac0('0x4'));var Mustache=require(_0xdac0('0x5'));var util=require('util');var path=require(_0xdac0('0x6'));var sox=require(_0xdac0('0x7'));var csv=require(_0xdac0('0x8'));var ejs=require(_0xdac0('0x9'));var fs=require('fs');var _=require(_0xdac0('0xa'));var squel=require(_0xdac0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdac0('0xc'));var toCsv=require(_0xdac0('0x8'));var querystring=require(_0xdac0('0xd'));var Papa=require(_0xdac0('0xe'));var Redis=require(_0xdac0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdac0('0x10'));var hardwareService=require(_0xdac0('0x11'));var logger=require(_0xdac0('0x12'))(_0xdac0('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdac0('0x14'))['db'];config[_0xdac0('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdac0('0x16'))(new Redis(config[_0xdac0('0x15')]));require(_0xdac0('0x17'))[_0xdac0('0x18')](socket);function respondWithStatusCode(_0x4b908b,_0x375bf1){_0x375bf1=_0x375bf1||0xcc;return function(_0x4ba594){if(_0x4ba594){return _0x4b908b[_0xdac0('0x19')](_0x375bf1);}return _0x4b908b[_0xdac0('0x1a')](_0x375bf1)[_0xdac0('0x1b')]();};}function respondWithResult(_0x23da5d,_0x2398ba){_0x2398ba=_0x2398ba||0xc8;return function(_0x16570a){if(_0x16570a){return _0x23da5d['status'](_0x2398ba)[_0xdac0('0x1c')](_0x16570a);}};}function respondWithFilteredResult(_0x42747f,_0x4b29d0){return function(_0x490a5d){if(_0x490a5d){var _0x54f149=_0x490a5d['count'],_0x35c601=_0x4b29d0['offset'],_0x2d299f=_0x4b29d0[_0xdac0('0x1d')]+_0x4b29d0['limit'],_0x27997b;if(_0x2d299f>=_0x54f149){_0x2d299f=_0x54f149;_0x27997b=0xc8;}else{_0x27997b=0xce;}_0x42747f['status'](_0x27997b);return _0x42747f['set']('Content-Range',_0x35c601+'-'+_0x2d299f+'/'+_0x54f149)[_0xdac0('0x1c')](_0x490a5d);}return null;};}function patchUpdates(_0x32a852){return function(_0x505414){try{jsonpatch[_0xdac0('0x1e')](_0x505414,_0x32a852,!![]);}catch(_0x22ad53){return BPromise['reject'](_0x22ad53);}return _0x505414[_0xdac0('0x1f')]();};}function saveUpdates(_0x4201a5,_0x30495b){return function(_0x570bbe){if(_0x570bbe){return _0x570bbe[_0xdac0('0x20')](_0x4201a5)['then'](function(_0x7b73ce){return _0x7b73ce;});}return null;};}function removeEntity(_0x4615e4,_0xc69ce7){return function(_0x2caabf){if(_0x2caabf){return _0x2caabf[_0xdac0('0x21')]()['then'](function(){_0x4615e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a1e9,_0x5619d0){return function(_0x27ed0d){if(!_0x27ed0d){_0x59a1e9[_0xdac0('0x19')](0x194);}return _0x27ed0d;};}function handleError(_0x2d4bb2,_0x3db3c2){_0x3db3c2=_0x3db3c2||0x1f4;return function(_0x39cf73){logger[_0xdac0('0x22')](_0x39cf73[_0xdac0('0x23')]);if(_0x39cf73['name']){delete _0x39cf73[_0xdac0('0x24')];}_0x2d4bb2[_0xdac0('0x1a')](_0x3db3c2)[_0xdac0('0x25')](_0x39cf73);};}exports[_0xdac0('0x26')]=function(_0xf0186,_0x2e7cc4){var _0x40a7fa={},_0x171b9c={},_0x33d6e6={'count':0x0,'rows':[]};return db['CmContact'][_0xdac0('0x27')]()['then'](function(_0x2641c8){_0x171b9c[_0xdac0('0x28')]=_[_0xdac0('0x29')](_0x2641c8);_0x171b9c[_0xdac0('0x2a')]=_['keys'](_0xf0186['query']);_0x171b9c[_0xdac0('0x2b')]=_[_0xdac0('0x2c')](_0x171b9c[_0xdac0('0x28')],_0x171b9c[_0xdac0('0x2a')]);_0x40a7fa[_0xdac0('0x2d')]=_[_0xdac0('0x2c')](_0x171b9c[_0xdac0('0x28')],qs[_0xdac0('0x2e')](_0xf0186[_0xdac0('0x2a')][_0xdac0('0x2e')]));_0x40a7fa[_0xdac0('0x2d')]=_0x40a7fa[_0xdac0('0x2d')][_0xdac0('0x2f')]?_0x40a7fa['attributes']:_0x171b9c[_0xdac0('0x28')];if(!_0xf0186[_0xdac0('0x2a')]['hasOwnProperty'](_0xdac0('0x30'))){_0x40a7fa['limit']=qs[_0xdac0('0x31')](_0xf0186['query'][_0xdac0('0x31')]);_0x40a7fa[_0xdac0('0x1d')]=qs[_0xdac0('0x1d')](_0xf0186[_0xdac0('0x2a')]['offset']);}_0x40a7fa['order']=qs['sort'](_0xf0186[_0xdac0('0x2a')]['sort']);_0x40a7fa[_0xdac0('0x32')]=qs[_0xdac0('0x2b')](_['pick'](_0xf0186[_0xdac0('0x2a')],_0x171b9c[_0xdac0('0x2b')]));var _0x334ab8=[];var _0x5d36c5=squel[_0xdac0('0x33')]()[_0xdac0('0x34')]('id')['field'](_0xdac0('0x24'))['field']('color')[_0xdac0('0x35')](_0xdac0('0x36'));var _0x1cdad4=squel[_0xdac0('0x33')]()[_0xdac0('0x35')](_0xdac0('0x37'),'c')[_0xdac0('0x32')](_0xdac0('0x38'));var _0x363fcd=squel[_0xdac0('0x39')]();if(_0xf0186[_0xdac0('0x2a')][_0xdac0('0x3a')]){var _0x58b6b8=JSON[_0xdac0('0x3b')](_0xf0186[_0xdac0('0x2a')][_0xdac0('0x3a')]);_[_0xdac0('0x29')](_0x58b6b8)[_0xdac0('0x3c')](function(_0x1e9724){var _0x243c4d=_0x58b6b8[_0x1e9724];switch(_0x243c4d['condition']){case'IS':if(_[_0xdac0('0x3d')](_0x243c4d[_0xdac0('0x3e')])&&_0x243c4d[_0xdac0('0x3e')][_0xdac0('0x2f')]>0x1){_0x363fcd[_0xdac0('0x3f')](_0x243c4d[_0xdac0('0x40')]+'.'+_0x1e9724+_0xdac0('0x41'),_0x243c4d[_0xdac0('0x3e')]);}else{_0x363fcd[_0xdac0('0x3f')](_0x243c4d['tableAlias']+'.'+_0x1e9724+'\x20=\x20?',_0x243c4d[_0xdac0('0x3e')][0x0]);}break;case'=':_0x363fcd[_0xdac0('0x3f')](_0x243c4d[_0xdac0('0x40')]+'.'+_0x1e9724+_0xdac0('0x42'),_0x243c4d[_0xdac0('0x3e')]);break;case _0xdac0('0x43'):_0x363fcd[_0xdac0('0x3f')](_0x243c4d['tableAlias']+'.'+_0x1e9724+_0xdac0('0x44'),'%'+_0x243c4d[_0xdac0('0x3e')]+'%');break;case'>':_0x363fcd['and'](_0x243c4d[_0xdac0('0x40')]+'.'+_0x1e9724+_0xdac0('0x45'),_0x243c4d['value']);break;case'<':_0x363fcd[_0xdac0('0x3f')](_0x243c4d[_0xdac0('0x40')]+'.'+_0x1e9724+_0xdac0('0x46'),_0x243c4d[_0xdac0('0x3e')]);break;}});}else{var _0x4ab193=_(Object[_0xdac0('0x29')](_0xf0186[_0xdac0('0x2a')]))[_0xdac0('0x47')](function(_0x5cd298){return _0x2641c8['hasOwnProperty'](_0x5cd298)?_0x5cd298:undefined;})[_0xdac0('0x48')](function(_0x126cd9){return!_[_0xdac0('0x49')](_0x126cd9);})[_0xdac0('0x3e')]();if(!_[_0xdac0('0x4a')](_0x4ab193)){_0x4ab193[_0xdac0('0x3c')](function(_0x220a1f){if(_0x220a1f===_0xdac0('0x4b')){_0x1cdad4[_0xdac0('0x32')](_0xdac0('0x4c'),[][_0xdac0('0x4d')](_0xf0186[_0xdac0('0x2a')][_0x220a1f]));}else{_0x1cdad4[_0xdac0('0x32')]('c.'+_0x220a1f+_0xdac0('0x42'),_0xf0186['query'][_0x220a1f]);}});}if(_0xf0186[_0xdac0('0x2a')][_0xdac0('0x48')]){var _0x5207e8=_0xf0186[_0xdac0('0x2a')]['filter'][_0xdac0('0x4e')]('\x5c','\x5c\x5c')[_0xdac0('0x4e')]('\x27\x27',_0xdac0('0x4f'));if(qs[_0xdac0('0x50')](_0x5207e8)){_0x363fcd['or']('c.id\x20LIKE\x20?',_0x5207e8+'%');_0x363fcd['or'](_0xdac0('0x51'),_0x5207e8+'%');_0x363fcd['or']('c.mobile\x20LIKE\x20?',_0x5207e8+'%');_0x363fcd['or'](_0xdac0('0x52'),_0x5207e8+'%');}else if(qs['isEmail'](_0x5207e8)){_0x363fcd['or'](_0xdac0('0x53'),_0x5207e8+'%');}else{_0x363fcd['or'](_0xdac0('0x53'),_0x5207e8+'%');_0x363fcd['or'](_0xdac0('0x54'),_0x5207e8+'%');_0x363fcd['or'](_0xdac0('0x55'),_0x5207e8+'%');}}}_0x1cdad4[_0xdac0('0x32')](_0x363fcd);if(_0x40a7fa[_0xdac0('0x56')]){_0x40a7fa[_0xdac0('0x56')][_0xdac0('0x3c')](function(_0x5ee5b5){_0x1cdad4[_0xdac0('0x56')]('c.'+_0x5ee5b5[0x0],_0x5ee5b5[0x1]===_0xdac0('0x57')?![]:!![]);});}_0x1cdad4['group'](_0xdac0('0x58'));var _0x5ddc90={'type':db['Sequelize'][_0xdac0('0x59')][_0xdac0('0x5a')],'raw':!![]};var _0x157520=_0x1cdad4[_0xdac0('0x5b')]()[_0xdac0('0x34')]('COUNT(*)');if(!_0xf0186['query'][_0xdac0('0x3a')]){if(_0xf0186[_0xdac0('0x2a')][_0xdac0('0x5c')]){var _0x5eacbd=_[_0xdac0('0x3d')](_0xf0186['query']['tag'])?_0xf0186[_0xdac0('0x2a')]['tag']:new Array(_0xf0186[_0xdac0('0x2a')][_0xdac0('0x5c')]);var _0x50eab1=squel[_0xdac0('0x39')]();_0x5eacbd[_0xdac0('0x3c')](function(_0x531792){_0x50eab1['or'](_0xdac0('0x5d'),'%,'+_0x531792+',%');});_0x1cdad4[_0xdac0('0x5e')](_0x50eab1);_0x157520[_0xdac0('0x5f')](_0xdac0('0x60'),'ct',_0xdac0('0x61'));_0x157520[_0xdac0('0x5f')](_0xdac0('0x36'),'t',_0xdac0('0x62'));_0x157520['where'](_0xdac0('0x63'),_0x5eacbd);}}db[_0xdac0('0x64')][_0xdac0('0x2a')](_0x5d36c5[_0xdac0('0x65')](),_0x5ddc90)[_0xdac0('0x66')](function(_0x1cb15e){_0x334ab8=_[_0xdac0('0x67')](_0x1cb15e,'id');return db[_0xdac0('0x64')][_0xdac0('0x2a')](_0x157520['toString'](),_0x5ddc90);})['then'](function(_0x4b9a58){_0x33d6e6[_0xdac0('0x68')]=_0x4b9a58['length'];_0x5ddc90=_['merge'](_0x5ddc90,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1cdad4[_0xdac0('0x34')](_0xdac0('0x69'));_0x1cdad4[_0xdac0('0x34')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xdac0('0x6a'));_0x1cdad4[_0xdac0('0x5f')](_0xdac0('0x60'),'ct',_0xdac0('0x61'));_0x1cdad4[_0xdac0('0x5f')](_0xdac0('0x36'),'t',_0xdac0('0x62'));if(_0x40a7fa[_0xdac0('0x31')]){_0x1cdad4[_0xdac0('0x31')](_0x40a7fa[_0xdac0('0x31')]);}if(_0x40a7fa['offset']){_0x1cdad4[_0xdac0('0x1d')](_0x40a7fa[_0xdac0('0x1d')]);}db['sequelize'][_0xdac0('0x2a')](_0x1cdad4[_0xdac0('0x65')](),_0x5ddc90)[_0xdac0('0x66')](function(_0x188e67){_0x188e67[_0xdac0('0x3c')](function(_0x77e68a){if(_0x77e68a[_0xdac0('0x6a')]){_0x77e68a[_0xdac0('0x6b')]=[];_0x77e68a['TagIds'][_0xdac0('0x6c')](',')[_0xdac0('0x3c')](function(_0x15e11f){_0x77e68a[_0xdac0('0x6b')][_0xdac0('0x6d')](_0x334ab8[_0x15e11f]);});}delete _0x77e68a[_0xdac0('0x6a')];});_0x33d6e6[_0xdac0('0x6e')]=_0x188e67;return _0x33d6e6;})[_0xdac0('0x66')](respondWithFilteredResult(_0x2e7cc4,_0x40a7fa))[_0xdac0('0x6f')](handleError(_0x2e7cc4,null));});});};exports[_0xdac0('0x21')]=function(_0x5d9feb,_0xc68b2d){return db[_0xdac0('0x70')]['find']({'where':{'id':_0x5d9feb[_0xdac0('0x71')]['id']}})['then'](handleEntityNotFound(_0xc68b2d,null))[_0xdac0('0x66')](removeEntity(_0xc68b2d,null))[_0xdac0('0x6f')](handleError(_0xc68b2d,null));};exports['describe']=function(_0x830d4c,_0x2a4c99){return db[_0xdac0('0x70')][_0xdac0('0x27')]()[_0xdac0('0x66')](function(_0x187998){for(var _0x36b8b9=0x0;_0x36b8b9=_0x1b28b3){_0x1f5dab=_0x1b28b3;_0x47d154=0xc8;}else{_0x47d154=0xce;}_0x454ce0[_0x2833('0x1c')](_0x47d154);return _0x454ce0[_0x2833('0x21')](_0x2833('0x22'),_0x2b185c+'-'+_0x1f5dab+'/'+_0x1b28b3)[_0x2833('0x23')](_0x4142ea);}return null;};}function patchUpdates(_0x23f31a){return function(_0x40fb2e){try{jsonpatch[_0x2833('0x24')](_0x40fb2e,_0x23f31a,!![]);}catch(_0x2860cf){return BPromise['reject'](_0x2860cf);}return _0x40fb2e[_0x2833('0x25')]();};}function saveUpdates(_0x24dcd9,_0x37ff6d){return function(_0x175b93){if(_0x175b93){return _0x175b93[_0x2833('0x26')](_0x24dcd9)[_0x2833('0x27')](function(_0x50dc01){return _0x50dc01;});}return null;};}function removeEntity(_0x1e26d3,_0x21ebfe){return function(_0x137279){if(_0x137279){return _0x137279['destroy']()[_0x2833('0x27')](function(){_0x1e26d3[_0x2833('0x1c')](0xcc)[_0x2833('0x1d')]();});}};}function handleEntityNotFound(_0x4ad4d1,_0x5626ab){return function(_0xc89cd1){if(!_0xc89cd1){_0x4ad4d1[_0x2833('0x28')](0x194);}return _0xc89cd1;};}function handleError(_0x5baf7b,_0x3aa595){_0x3aa595=_0x3aa595||0x1f4;return function(_0x6cd7c0){logger['error'](_0x6cd7c0[_0x2833('0x29')]);if(_0x6cd7c0[_0x2833('0x2a')]){delete _0x6cd7c0[_0x2833('0x2a')];}_0x5baf7b['status'](_0x3aa595)[_0x2833('0x2b')](_0x6cd7c0);};}exports[_0x2833('0x2c')]=function(_0x188ce8,_0x75562b){var _0x3ea135={},_0x18f156={},_0x25f6da={'count':0x0,'rows':[]};return db[_0x2833('0x2d')]['describe']()[_0x2833('0x27')](function(_0x46a301){_0x18f156[_0x2833('0x2e')]=_[_0x2833('0x2f')](_0x46a301);_0x18f156['query']=_[_0x2833('0x2f')](_0x188ce8[_0x2833('0x30')]);_0x18f156['filters']=_[_0x2833('0x31')](_0x18f156['model'],_0x18f156[_0x2833('0x30')]);_0x3ea135[_0x2833('0x32')]=_[_0x2833('0x31')](_0x18f156[_0x2833('0x2e')],qs[_0x2833('0x33')](_0x188ce8[_0x2833('0x30')][_0x2833('0x33')]));_0x3ea135['attributes']=_0x3ea135['attributes'][_0x2833('0x34')]?_0x3ea135[_0x2833('0x32')]:_0x18f156['model'];if(!_0x188ce8[_0x2833('0x30')][_0x2833('0x35')]('nolimit')){_0x3ea135['limit']=qs[_0x2833('0x20')](_0x188ce8[_0x2833('0x30')][_0x2833('0x20')]);_0x3ea135['offset']=qs[_0x2833('0x1f')](_0x188ce8['query'][_0x2833('0x1f')]);}_0x3ea135[_0x2833('0x36')]=qs[_0x2833('0x37')](_0x188ce8[_0x2833('0x30')][_0x2833('0x37')]);_0x3ea135['where']=qs[_0x2833('0x38')](_[_0x2833('0x39')](_0x188ce8[_0x2833('0x30')],_0x18f156[_0x2833('0x38')]));var _0xb1faa4=[];var _0x446a64=squel[_0x2833('0x3a')]()[_0x2833('0x3b')]('id')[_0x2833('0x3b')](_0x2833('0x2a'))['field'](_0x2833('0x3c'))[_0x2833('0x3d')](_0x2833('0x3e'));var _0x5b296e=squel[_0x2833('0x3a')]()['from']('cm_contacts','c')[_0x2833('0x3f')](_0x2833('0x40'));var _0x340b52=squel[_0x2833('0x41')]();if(_0x188ce8['query'][_0x2833('0x42')]){var _0xaea510=JSON[_0x2833('0x43')](_0x188ce8[_0x2833('0x30')][_0x2833('0x42')]);_[_0x2833('0x2f')](_0xaea510)['forEach'](function(_0x40865a){var _0x11f859=_0xaea510[_0x40865a];switch(_0x11f859[_0x2833('0x44')]){case'IS':if(_[_0x2833('0x45')](_0x11f859[_0x2833('0x46')])&&_0x11f859[_0x2833('0x46')]['length']>0x1){_0x340b52['and'](_0x11f859[_0x2833('0x47')]+'.'+_0x40865a+_0x2833('0x48'),_0x11f859[_0x2833('0x46')]);}else{_0x340b52['and'](_0x11f859[_0x2833('0x47')]+'.'+_0x40865a+_0x2833('0x49'),_0x11f859[_0x2833('0x46')][0x0]);}break;case'=':_0x340b52[_0x2833('0x4a')](_0x11f859[_0x2833('0x47')]+'.'+_0x40865a+'\x20=\x20?',_0x11f859[_0x2833('0x46')]);break;case _0x2833('0x4b'):_0x340b52[_0x2833('0x4a')](_0x11f859[_0x2833('0x47')]+'.'+_0x40865a+_0x2833('0x4c'),'%'+_0x11f859['value']+'%');break;case'>':_0x340b52[_0x2833('0x4a')](_0x11f859[_0x2833('0x47')]+'.'+_0x40865a+'\x20>\x20?',_0x11f859[_0x2833('0x46')]);break;case'<':_0x340b52[_0x2833('0x4a')](_0x11f859[_0x2833('0x47')]+'.'+_0x40865a+_0x2833('0x4d'),_0x11f859[_0x2833('0x46')]);break;}});}else{var _0x5eff14=_(Object['keys'](_0x188ce8[_0x2833('0x30')]))[_0x2833('0x4e')](function(_0x48ee79){return _0x46a301[_0x2833('0x35')](_0x48ee79)?_0x48ee79:undefined;})[_0x2833('0x4f')](function(_0x674b12){return!_[_0x2833('0x50')](_0x674b12);})['value']();if(!_[_0x2833('0x51')](_0x5eff14)){_0x5eff14[_0x2833('0x52')](function(_0x9c6121){if(_0x9c6121==='ListId'){_0x5b296e['where'](_0x2833('0x53'),[][_0x2833('0x54')](_0x188ce8['query'][_0x9c6121]));}else{_0x5b296e[_0x2833('0x3f')]('c.'+_0x9c6121+_0x2833('0x49'),_0x188ce8[_0x2833('0x30')][_0x9c6121]);}});}if(_0x188ce8[_0x2833('0x30')][_0x2833('0x4f')]){var _0x1b4810=_0x188ce8[_0x2833('0x30')][_0x2833('0x4f')]['replace']('\x5c','\x5c\x5c')[_0x2833('0x55')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x2833('0x56')](_0x1b4810)){_0x340b52['or'](_0x2833('0x57'),_0x1b4810+'%');_0x340b52['or']('c.phone\x20LIKE\x20?',_0x1b4810+'%');_0x340b52['or']('c.mobile\x20LIKE\x20?',_0x1b4810+'%');_0x340b52['or'](_0x2833('0x58'),_0x1b4810+'%');}else if(qs['isEmail'](_0x1b4810)){_0x340b52['or']('c.email\x20LIKE\x20?',_0x1b4810+'%');}else{_0x340b52['or']('c.email\x20LIKE\x20?',_0x1b4810+'%');_0x340b52['or'](_0x2833('0x59'),_0x1b4810+'%');_0x340b52['or'](_0x2833('0x5a'),_0x1b4810+'%');}}}_0x5b296e[_0x2833('0x3f')](_0x340b52);if(_0x3ea135['order']){_0x3ea135['order'][_0x2833('0x52')](function(_0x1cdd72){_0x5b296e['order']('c.'+_0x1cdd72[0x0],_0x1cdd72[0x1]===_0x2833('0x5b')?![]:!![]);});}_0x5b296e[_0x2833('0x5c')](_0x2833('0x5d'));var _0x41e5ec={'type':db[_0x2833('0x5e')][_0x2833('0x5f')][_0x2833('0x60')],'raw':!![]};var _0x21908e=_0x5b296e['clone']()['field'](_0x2833('0x61'));if(!_0x188ce8['query'][_0x2833('0x42')]){if(_0x188ce8[_0x2833('0x30')][_0x2833('0x62')]){var _0x82d2fc=_[_0x2833('0x45')](_0x188ce8[_0x2833('0x30')][_0x2833('0x62')])?_0x188ce8[_0x2833('0x30')][_0x2833('0x62')]:new Array(_0x188ce8[_0x2833('0x30')][_0x2833('0x62')]);var _0x149cb3=squel['expr']();_0x82d2fc[_0x2833('0x52')](function(_0x1840a6){_0x149cb3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1840a6+',%');});_0x5b296e[_0x2833('0x63')](_0x149cb3);_0x21908e['left_join']('cm_contact_has_tags','ct',_0x2833('0x64'));_0x21908e['left_join'](_0x2833('0x3e'),'t',_0x2833('0x65'));_0x21908e[_0x2833('0x3f')](_0x2833('0x66'),_0x82d2fc);}}db[_0x2833('0x67')][_0x2833('0x30')](_0x446a64[_0x2833('0x68')](),_0x41e5ec)[_0x2833('0x27')](function(_0x456590){_0xb1faa4=_[_0x2833('0x69')](_0x456590,'id');return db['sequelize']['query'](_0x21908e[_0x2833('0x68')](),_0x41e5ec);})[_0x2833('0x27')](function(_0x564865){_0x25f6da['count']=_0x564865[_0x2833('0x34')];_0x41e5ec=_[_0x2833('0x6a')](_0x41e5ec,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5b296e[_0x2833('0x3b')](_0x2833('0x6b'));_0x5b296e[_0x2833('0x3b')](_0x2833('0x6c'),_0x2833('0x6d'));_0x5b296e[_0x2833('0x6e')](_0x2833('0x6f'),'ct',_0x2833('0x64'));_0x5b296e['left_join'](_0x2833('0x3e'),'t',_0x2833('0x65'));if(_0x3ea135[_0x2833('0x20')]){_0x5b296e['limit'](_0x3ea135[_0x2833('0x20')]);}if(_0x3ea135['offset']){_0x5b296e[_0x2833('0x1f')](_0x3ea135['offset']);}db[_0x2833('0x67')][_0x2833('0x30')](_0x5b296e[_0x2833('0x68')](),_0x41e5ec)['then'](function(_0x447236){_0x447236['forEach'](function(_0x585c68){if(_0x585c68[_0x2833('0x6d')]){_0x585c68[_0x2833('0x70')]=[];_0x585c68[_0x2833('0x6d')][_0x2833('0x71')](',')[_0x2833('0x52')](function(_0x55f853){_0x585c68[_0x2833('0x70')][_0x2833('0x72')](_0xb1faa4[_0x55f853]);});}delete _0x585c68['TagIds'];});_0x25f6da['rows']=_0x447236;return _0x25f6da;})[_0x2833('0x27')](respondWithFilteredResult(_0x75562b,_0x3ea135))[_0x2833('0x73')](handleError(_0x75562b,null));});});};exports['destroy']=function(_0x59c663,_0x3d6e86){return db[_0x2833('0x2d')][_0x2833('0x74')]({'where':{'id':_0x59c663[_0x2833('0x75')]['id']}})['then'](handleEntityNotFound(_0x3d6e86,null))[_0x2833('0x27')](removeEntity(_0x3d6e86,null))[_0x2833('0x73')](handleError(_0x3d6e86,null));};exports[_0x2833('0x76')]=function(_0x475b6d,_0x157e42){return db[_0x2833('0x2d')][_0x2833('0x76')]()[_0x2833('0x27')](function(_0x259459){for(var _0x249cce=0x0;_0x249cce{}\s\\|]/g,'-');_0x458233(null,util['format'](_0xfc0a('0x23'),path['basename'](_0x1ac5dc[_0xfc0a('0x21')],path[_0xfc0a('0x24')](_0x1ac5dc[_0xfc0a('0x21')])),Date['now'](),path['extname'](_0x1ac5dc[_0xfc0a('0x21')])));}})});router[_0xfc0a('0x19')](_0xfc0a('0x25'),upload[_0xfc0a('0x26')](_0xfc0a('0x27')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xfc0a('0x1d')]({'destination':function(_0x253863,_0x119a11,_0x595ec7){_0x595ec7(null,path['join'](config[_0xfc0a('0x1f')],'server/files/tmp'));},'filename':function(_0xab8853,_0x12966f,_0x1548e8){_0x12966f[_0xfc0a('0x21')]=_0x12966f[_0xfc0a('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1548e8(null,util[_0xfc0a('0x28')](_0xfc0a('0x23'),path[_0xfc0a('0x29')](_0x12966f[_0xfc0a('0x21')],path['extname'](_0x12966f[_0xfc0a('0x21')])),Date[_0xfc0a('0x2a')](),path[_0xfc0a('0x24')](_0x12966f[_0xfc0a('0x21')])));}})});router[_0xfc0a('0x19')](_0xfc0a('0x2b'),upload[_0xfc0a('0x26')](_0xfc0a('0x27')),controller[_0xfc0a('0x2c')]);router['post'](_0xfc0a('0x2d'),auth[_0xfc0a('0xa')](),controller[_0xfc0a('0x2e')]);router[_0xfc0a('0x2f')](_0xfc0a('0xd'),auth['isAuthenticated'](),controller[_0xfc0a('0x30')]);router[_0xfc0a('0x31')](_0xfc0a('0xd'),auth[_0xfc0a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x265f=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','join','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','/csv','file','uploadCsv','root','format','now','single','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','isAuthenticated','describe','show','/:id/tags','getTags'];(function(_0x4a60b0,_0x432b5c){var _0x3d2e72=function(_0x3c374a){while(--_0x3c374a){_0x4a60b0['push'](_0x4a60b0['shift']());}};_0x3d2e72(++_0x432b5c);}(_0x265f,0x168));var _0xf265=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x265f[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0xf265('0x0'));var util=require(_0xf265('0x1'));var path=require(_0xf265('0x2'));var timeout=require(_0xf265('0x3'));var express=require(_0xf265('0x4'));var router=express[_0xf265('0x5')]();var auth=require(_0xf265('0x6'));var interaction=require(_0xf265('0x7'));var config=require(_0xf265('0x8'));var controller=require(_0xf265('0x9'));router[_0xf265('0xa')]('/',auth['isAuthenticated'](),controller[_0xf265('0xb')]);router[_0xf265('0xa')](_0xf265('0xc'),auth[_0xf265('0xd')](),controller[_0xf265('0xe')]);router[_0xf265('0xa')]('/:id',auth[_0xf265('0xd')](),controller[_0xf265('0xf')]);router[_0xf265('0xa')](_0xf265('0x10'),auth[_0xf265('0xd')](),controller[_0xf265('0x11')]);router['get'](_0xf265('0x12'),auth[_0xf265('0xd')](),controller[_0xf265('0x13')]);router[_0xf265('0xa')](_0xf265('0x14'),auth[_0xf265('0xd')](),controller[_0xf265('0x15')]);router[_0xf265('0xa')](_0xf265('0x16'),auth['isAuthenticated'](),controller[_0xf265('0x17')]);router[_0xf265('0xa')]('/:id/jscripty_sessions',auth[_0xf265('0xd')](),controller[_0xf265('0x18')]);router[_0xf265('0x19')](_0xf265('0x1a'),auth[_0xf265('0xd')](),controller[_0xf265('0x1b')]);router[_0xf265('0x19')]('/',auth[_0xf265('0xd')](),controller[_0xf265('0x1c')]);router['post'](_0xf265('0x1d'),auth[_0xf265('0xd')](),controller[_0xf265('0x1e')]);router[_0xf265('0x19')](_0xf265('0x10'),auth[_0xf265('0xd')](),controller['setTags']);var upload=multer({'storage':multer[_0xf265('0x1f')]({'destination':function(_0x11c968,_0x23fdb3,_0x2e10cc){_0x2e10cc(null,path[_0xf265('0x20')](config['root'],_0xf265('0x21')));},'filename':function(_0x101b56,_0x88ddd9,_0x1a77aa){_0x88ddd9[_0xf265('0x22')]=_0x88ddd9['originalname'][_0xf265('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a77aa(null,util['format'](_0xf265('0x24'),path[_0xf265('0x25')](_0x88ddd9[_0xf265('0x22')],path[_0xf265('0x26')](_0x88ddd9['originalname'])),Date['now'](),path[_0xf265('0x26')](_0x88ddd9[_0xf265('0x22')])));}})});router['post'](_0xf265('0x27'),upload['single'](_0xf265('0x28')),controller[_0xf265('0x29')]);var upload=multer({'storage':multer[_0xf265('0x1f')]({'destination':function(_0x5af815,_0x1d1370,_0x325867){_0x325867(null,path[_0xf265('0x20')](config[_0xf265('0x2a')],_0xf265('0x21')));},'filename':function(_0x9f3c39,_0x2363a1,_0x1b2639){_0x2363a1[_0xf265('0x22')]=_0x2363a1[_0xf265('0x22')][_0xf265('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b2639(null,util[_0xf265('0x2b')]('%s-%s%s',path[_0xf265('0x25')](_0x2363a1[_0xf265('0x22')],path[_0xf265('0x26')](_0x2363a1[_0xf265('0x22')])),Date[_0xf265('0x2c')](),path[_0xf265('0x26')](_0x2363a1['originalname'])));}})});router[_0xf265('0x19')]('/upload',upload[_0xf265('0x2d')]('file'),controller[_0xf265('0x2e')]);router[_0xf265('0x19')](_0xf265('0x2f'),auth[_0xf265('0xd')](),controller[_0xf265('0x30')]);router[_0xf265('0x31')](_0xf265('0x32'),auth['isAuthenticated'](),controller[_0xf265('0x33')]);router['delete']('/:id',auth[_0xf265('0xd')](),controller[_0xf265('0x34')]);module[_0xf265('0x35')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 91b03a6..93c550c 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 _0x7e8e=['type','select','parse','values','isArray','setDataValue','BOOLEAN','sequelize','VIRTUAL','alias','getDataValue','name','long'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7e8e,0x96));var _0xe7e8=function(_0x49c54c,_0x54a647){_0x49c54c=_0x49c54c-0x0;var _0x446225=_0x7e8e[_0x49c54c];return _0x446225;};'use strict';var Sequelize=require(_0xe7e8('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xe7e8('0x1')],'get':function(_0x5c1103){return this['getDataValue'](_0xe7e8('0x2'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x23bee2){this['setDataValue'](_0xe7e8('0x2'),_0x23bee2?_0x23bee2:this[_0xe7e8('0x3')](_0xe7e8('0x4')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xe7e8('0x5')),'get':function(){if(this[_0xe7e8('0x3')](_0xe7e8('0x6'))===_0xe7e8('0x7')){return JSON[_0xe7e8('0x8')](this[_0xe7e8('0x3')]('values'));}else{return this['getDataValue'](_0xe7e8('0x9'));}},'set':function(_0x18f08c){if(Array[_0xe7e8('0xa')](_0x18f08c)){this['setDataValue'](_0xe7e8('0x9'),JSON['stringify'](_0x18f08c));}else{this[_0xe7e8('0xb')](_0xe7e8('0x9'),_0x18f08c);}}},'required':{'type':Sequelize[_0xe7e8('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x7096=['long','type','select','parse','values','stringify','BOOLEAN','sequelize','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','name','TEXT'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x7096,0xb7));var _0x6709=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x7096[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x6709('0x0'));var _=require('lodash');module[_0x6709('0x1')]={'name':{'type':Sequelize[_0x6709('0x2')],'get':function(_0x2a78fe){return this['getDataValue'](_0x6709('0x3'));}},'alias':{'type':Sequelize[_0x6709('0x4')],'allowNull':![],'set':function(_0x571dd5){this[_0x6709('0x5')]('alias',_0x571dd5?_0x571dd5:this[_0x6709('0x6')](_0x6709('0x7')));}},'type':{'type':Sequelize[_0x6709('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x6709('0x8')](_0x6709('0x9')),'get':function(){if(this['getDataValue'](_0x6709('0xa'))===_0x6709('0xb')){return JSON[_0x6709('0xc')](this[_0x6709('0x6')]('values'));}else{return this[_0x6709('0x6')](_0x6709('0xd'));}},'set':function(_0x21c4c1){if(Array['isArray'](_0x21c4c1)){this['setDataValue'](_0x6709('0xd'),JSON[_0x6709('0xe')](_0x21c4c1));}else{this['setDataValue']('values',_0x21c4c1);}}},'required':{'type':Sequelize[_0x6709('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 99dd19e..a290658 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 _0x8245=['includeAll','include','rows','find','create','sequelize','transaction','body','catch','params','destroy','html-pdf','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','save','update','then','end','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','where','merge','map','type','key','field','filter','options','CmCustomField'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8245,0x99));var _0x5824=function(_0xc446d1,_0x45a0b6){_0xc446d1=_0xc446d1-0x0;var _0x21973f=_0x8245[_0xc446d1];return _0x21973f;};'use strict';var pdf=require(_0x5824('0x0'));var emlformat=require(_0x5824('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5824('0x2'));var jsonpatch=require(_0x5824('0x3'));var rp=require(_0x5824('0x4'));var moment=require(_0x5824('0x5'));var BPromise=require(_0x5824('0x6'));var Mustache=require(_0x5824('0x7'));var util=require(_0x5824('0x8'));var path=require(_0x5824('0x9'));var sox=require(_0x5824('0xa'));var csv=require(_0x5824('0xb'));var ejs=require(_0x5824('0xc'));var fs=require('fs');var _=require(_0x5824('0xd'));var squel=require(_0x5824('0xe'));var crypto=require(_0x5824('0xf'));var jsforce=require(_0x5824('0x10'));var deskjs=require(_0x5824('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5824('0x12'));var Papa=require('papaparse');var Redis=require(_0x5824('0x13'));var authService=require(_0x5824('0x14'));var qs=require(_0x5824('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5824('0x16'))(_0x5824('0x17'));var utils=require(_0x5824('0x18'));var config=require(_0x5824('0x19'));var db=require(_0x5824('0x1a'))['db'];function respondWithStatusCode(_0x8f89a4,_0xe599c7){_0xe599c7=_0xe599c7||0xcc;return function(_0x5104c6){if(_0x5104c6){return _0x8f89a4['sendStatus'](_0xe599c7);}return _0x8f89a4[_0x5824('0x1b')](_0xe599c7)['end']();};}function respondWithResult(_0x7e09b6,_0x31f0db){_0x31f0db=_0x31f0db||0xc8;return function(_0x29feca){if(_0x29feca){return _0x7e09b6[_0x5824('0x1b')](_0x31f0db)[_0x5824('0x1c')](_0x29feca);}};}function respondWithFilteredResult(_0x265813,_0x5bb104){return function(_0x44c5bd){if(_0x44c5bd){var _0x585605=_0x44c5bd[_0x5824('0x1d')],_0x2662f5=_0x5bb104[_0x5824('0x1e')],_0x64d0e1=_0x5bb104[_0x5824('0x1e')]+_0x5bb104[_0x5824('0x1f')],_0x5d2ac6;if(_0x64d0e1>=_0x585605){_0x64d0e1=_0x585605;_0x5d2ac6=0xc8;}else{_0x5d2ac6=0xce;}_0x265813[_0x5824('0x1b')](_0x5d2ac6);return _0x265813[_0x5824('0x20')](_0x5824('0x21'),_0x2662f5+'-'+_0x64d0e1+'/'+_0x585605)[_0x5824('0x1c')](_0x44c5bd);}return null;};}function patchUpdates(_0x3c3995){return function(_0x1966ea){try{jsonpatch['apply'](_0x1966ea,_0x3c3995,!![]);}catch(_0x4245ea){return BPromise['reject'](_0x4245ea);}return _0x1966ea[_0x5824('0x22')]();};}function saveUpdates(_0x171ff3,_0x4f3582){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x5824('0x23')](_0x171ff3)[_0x5824('0x24')](function(_0x2330c0){return _0x2330c0;});}return null;};}function removeEntity(_0x1c0746,_0x47630f){return function(_0x12e0a1){if(_0x12e0a1){return _0x12e0a1['destroy']()[_0x5824('0x24')](function(){_0x1c0746[_0x5824('0x1b')](0xcc)[_0x5824('0x25')]();});}};}function handleEntityNotFound(_0x646a64,_0x149762){return function(_0x421f21){if(!_0x421f21){_0x646a64['sendStatus'](0x194);}return _0x421f21;};}function handleError(_0x546a95,_0x2ab251){_0x2ab251=_0x2ab251||0x1f4;return function(_0x4e60a7){logger['error'](_0x4e60a7[_0x5824('0x26')]);if(_0x4e60a7[_0x5824('0x27')]){delete _0x4e60a7[_0x5824('0x27')];}_0x546a95[_0x5824('0x1b')](_0x2ab251)['send'](_0x4e60a7);};}exports[_0x5824('0x28')]=function(_0x4b108a,_0x6ec35a){var _0x5bc996={},_0x4d88de={},_0x2ca94c={'count':0x0,'rows':[]};var _0x101b8f=db['CmCustomField'][_0x5824('0x29')];_0x4d88de[_0x5824('0x2a')]=_['differenceBy'](_[_0x5824('0x2b')](_0x101b8f),[_0x5824('0x27')]);_0x4d88de[_0x5824('0x2c')]=_['keys'](_0x4b108a[_0x5824('0x2c')]);_0x4d88de[_0x5824('0x2d')]=_[_0x5824('0x2e')](_0x4d88de[_0x5824('0x2a')],_0x4d88de[_0x5824('0x2c')]);_0x5bc996[_0x5824('0x2f')]=_[_0x5824('0x2e')](_0x4d88de['model'],qs[_0x5824('0x30')](_0x4b108a[_0x5824('0x2c')]['fields']));_0x5bc996[_0x5824('0x2f')]=_0x5bc996[_0x5824('0x2f')]['length']?_0x5bc996['attributes']:_0x4d88de[_0x5824('0x2a')];if(!_0x4b108a[_0x5824('0x2c')][_0x5824('0x31')]('nolimit')){_0x5bc996['limit']=qs[_0x5824('0x1f')](_0x4b108a[_0x5824('0x2c')][_0x5824('0x1f')]);_0x5bc996[_0x5824('0x1e')]=qs[_0x5824('0x1e')](_0x4b108a[_0x5824('0x2c')]['offset']);}_0x5bc996[_0x5824('0x32')]=qs['sort'](_0x4b108a[_0x5824('0x2c')]['sort']);_0x5bc996[_0x5824('0x33')]=qs[_0x5824('0x2d')](_['pick'](_0x4b108a[_0x5824('0x2c')],_0x4d88de[_0x5824('0x2d')]));if(_0x4b108a['query']['filter']){_0x5bc996[_0x5824('0x33')]=_[_0x5824('0x34')](_0x5bc996[_0x5824('0x33')],{'$or':_[_0x5824('0x35')](_0x101b8f,function(_0x1b333e){if(_0x1b333e[_0x5824('0x36')][_0x5824('0x37')]!=='VIRTUAL'){var _0x73ecc5={};_0x73ecc5[_0x1b333e[_0x5824('0x38')]]={'$like':'%'+_0x4b108a[_0x5824('0x2c')][_0x5824('0x39')]+'%'};return _0x73ecc5;}})});}_0x5bc996=_[_0x5824('0x34')]({},_0x5bc996,_0x4b108a[_0x5824('0x3a')]);var _0x3f1a05={'where':_0x5bc996[_0x5824('0x33')]};return db[_0x5824('0x3b')][_0x5824('0x1d')](_0x3f1a05)[_0x5824('0x24')](function(_0x3e5478){_0x2ca94c[_0x5824('0x1d')]=_0x3e5478;if(_0x4b108a[_0x5824('0x2c')][_0x5824('0x3c')]){_0x5bc996[_0x5824('0x3d')]=[{'all':!![]}];}return db[_0x5824('0x3b')]['findAll'](_0x5bc996);})[_0x5824('0x24')](function(_0x30e696){_0x2ca94c[_0x5824('0x3e')]=_0x30e696;return _0x2ca94c;})[_0x5824('0x24')](respondWithFilteredResult(_0x6ec35a,_0x5bc996))['catch'](handleError(_0x6ec35a,null));};exports['show']=function(_0x5cd3be,_0x3320e6){var _0x1888fb={'raw':!![],'where':{'id':_0x5cd3be['params']['id']}},_0x188f04={};_0x188f04[_0x5824('0x2a')]=_['keys'](db[_0x5824('0x3b')][_0x5824('0x29')]);_0x188f04[_0x5824('0x2c')]=_[_0x5824('0x2b')](_0x5cd3be[_0x5824('0x2c')]);_0x188f04[_0x5824('0x2d')]=_['intersection'](_0x188f04[_0x5824('0x2a')],_0x188f04[_0x5824('0x2c')]);_0x1888fb['attributes']=_['intersection'](_0x188f04['model'],qs[_0x5824('0x30')](_0x5cd3be[_0x5824('0x2c')][_0x5824('0x30')]));_0x1888fb[_0x5824('0x2f')]=_0x1888fb[_0x5824('0x2f')]['length']?_0x1888fb[_0x5824('0x2f')]:_0x188f04['model'];if(_0x5cd3be[_0x5824('0x2c')][_0x5824('0x3c')]){_0x1888fb[_0x5824('0x3d')]=[{'all':!![]}];}_0x1888fb=_['merge']({},_0x1888fb,_0x5cd3be['options']);return db[_0x5824('0x3b')][_0x5824('0x3f')](_0x1888fb)['then'](handleEntityNotFound(_0x3320e6,null))[_0x5824('0x24')](respondWithResult(_0x3320e6,null))['catch'](handleError(_0x3320e6,null));};exports[_0x5824('0x40')]=function(_0x2bdbbb,_0x206d8d){return db[_0x5824('0x41')][_0x5824('0x42')](function(_0x3dc96e){return db[_0x5824('0x3b')]['create'](_0x2bdbbb[_0x5824('0x43')],{'transaction':_0x3dc96e});})[_0x5824('0x24')](respondWithResult(_0x206d8d,0xc9))[_0x5824('0x44')](handleError(_0x206d8d,null));};exports[_0x5824('0x23')]=function(_0x3854f1,_0x1eafb7){if(_0x3854f1[_0x5824('0x43')]['id']){delete _0x3854f1[_0x5824('0x43')]['id'];}return db[_0x5824('0x3b')][_0x5824('0x3f')]({'where':{'id':_0x3854f1[_0x5824('0x45')]['id']}})[_0x5824('0x24')](handleEntityNotFound(_0x1eafb7,null))['then'](saveUpdates(_0x3854f1[_0x5824('0x43')],null))[_0x5824('0x24')](respondWithResult(_0x1eafb7,null))[_0x5824('0x44')](handleError(_0x1eafb7,null));};exports[_0x5824('0x46')]=function(_0x4370c5,_0x222994){return db[_0x5824('0x3b')][_0x5824('0x3f')]({'where':{'id':_0x4370c5['params']['id']}})[_0x5824('0x24')](handleEntityNotFound(_0x222994,null))['then'](removeEntity(_0x222994,null))['catch'](handleError(_0x222994,null));}; \ No newline at end of file +var _0xe087=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','index','CmCustomField','rawAttributes','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','merge','type','key','field','filter','options','includeAll','include','findAll','rows','catch','find','create','sequelize','transaction','body','update','params'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe087,0x1a4));var _0x7e08=function(_0x1181ab,_0x13a543){_0x1181ab=_0x1181ab-0x0;var _0x58a8c5=_0xe087[_0x1181ab];return _0x58a8c5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7e08('0x0'));var zipdir=require(_0x7e08('0x1'));var jsonpatch=require(_0x7e08('0x2'));var rp=require(_0x7e08('0x3'));var moment=require('moment');var BPromise=require(_0x7e08('0x4'));var Mustache=require(_0x7e08('0x5'));var util=require(_0x7e08('0x6'));var path=require('path');var sox=require(_0x7e08('0x7'));var csv=require(_0x7e08('0x8'));var ejs=require(_0x7e08('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7e08('0xa'));var crypto=require('crypto');var jsforce=require(_0x7e08('0xb'));var deskjs=require(_0x7e08('0xc'));var toCsv=require(_0x7e08('0x8'));var querystring=require(_0x7e08('0xd'));var Papa=require(_0x7e08('0xe'));var Redis=require(_0x7e08('0xf'));var authService=require(_0x7e08('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7e08('0x11'));var utils=require(_0x7e08('0x12'));var config=require('../../config/environment');var db=require(_0x7e08('0x13'))['db'];function respondWithStatusCode(_0x21bcc9,_0x2fdba1){_0x2fdba1=_0x2fdba1||0xcc;return function(_0x492810){if(_0x492810){return _0x21bcc9['sendStatus'](_0x2fdba1);}return _0x21bcc9['status'](_0x2fdba1)[_0x7e08('0x14')]();};}function respondWithResult(_0x268c7c,_0x345b29){_0x345b29=_0x345b29||0xc8;return function(_0x47a13d){if(_0x47a13d){return _0x268c7c[_0x7e08('0x15')](_0x345b29)[_0x7e08('0x16')](_0x47a13d);}};}function respondWithFilteredResult(_0x441134,_0x4bb52c){return function(_0x4f7152){if(_0x4f7152){var _0x560ad1=_0x4f7152[_0x7e08('0x17')],_0x3f3f88=_0x4bb52c[_0x7e08('0x18')],_0x2eb2c3=_0x4bb52c[_0x7e08('0x18')]+_0x4bb52c['limit'],_0x3c18c6;if(_0x2eb2c3>=_0x560ad1){_0x2eb2c3=_0x560ad1;_0x3c18c6=0xc8;}else{_0x3c18c6=0xce;}_0x441134['status'](_0x3c18c6);return _0x441134[_0x7e08('0x19')](_0x7e08('0x1a'),_0x3f3f88+'-'+_0x2eb2c3+'/'+_0x560ad1)[_0x7e08('0x16')](_0x4f7152);}return null;};}function patchUpdates(_0x3f0121){return function(_0x1ceb3e){try{jsonpatch[_0x7e08('0x1b')](_0x1ceb3e,_0x3f0121,!![]);}catch(_0x558910){return BPromise['reject'](_0x558910);}return _0x1ceb3e[_0x7e08('0x1c')]();};}function saveUpdates(_0x26f9ba,_0x44a122){return function(_0xf38619){if(_0xf38619){return _0xf38619['update'](_0x26f9ba)[_0x7e08('0x1d')](function(_0x433301){return _0x433301;});}return null;};}function removeEntity(_0x426a82,_0x43c31c){return function(_0x862254){if(_0x862254){return _0x862254[_0x7e08('0x1e')]()['then'](function(){_0x426a82[_0x7e08('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41706e,_0x2b72b7){return function(_0x49d5e1){if(!_0x49d5e1){_0x41706e[_0x7e08('0x1f')](0x194);}return _0x49d5e1;};}function handleError(_0x1e8ad4,_0x20d4d3){_0x20d4d3=_0x20d4d3||0x1f4;return function(_0x30c01a){logger[_0x7e08('0x20')](_0x30c01a[_0x7e08('0x21')]);if(_0x30c01a['name']){delete _0x30c01a[_0x7e08('0x22')];}_0x1e8ad4[_0x7e08('0x15')](_0x20d4d3)['send'](_0x30c01a);};}exports[_0x7e08('0x23')]=function(_0x4bd28e,_0x19a798){var _0x4e2a35={},_0x441d61={},_0x5bb822={'count':0x0,'rows':[]};var _0x4d4b74=db[_0x7e08('0x24')][_0x7e08('0x25')];_0x441d61[_0x7e08('0x26')]=_[_0x7e08('0x27')](_['keys'](_0x4d4b74),[_0x7e08('0x22')]);_0x441d61[_0x7e08('0x28')]=_[_0x7e08('0x29')](_0x4bd28e[_0x7e08('0x28')]);_0x441d61[_0x7e08('0x2a')]=_['intersection'](_0x441d61['model'],_0x441d61['query']);_0x4e2a35[_0x7e08('0x2b')]=_[_0x7e08('0x2c')](_0x441d61[_0x7e08('0x26')],qs[_0x7e08('0x2d')](_0x4bd28e[_0x7e08('0x28')][_0x7e08('0x2d')]));_0x4e2a35['attributes']=_0x4e2a35[_0x7e08('0x2b')][_0x7e08('0x2e')]?_0x4e2a35[_0x7e08('0x2b')]:_0x441d61['model'];if(!_0x4bd28e[_0x7e08('0x28')][_0x7e08('0x2f')]('nolimit')){_0x4e2a35[_0x7e08('0x30')]=qs[_0x7e08('0x30')](_0x4bd28e['query']['limit']);_0x4e2a35[_0x7e08('0x18')]=qs[_0x7e08('0x18')](_0x4bd28e[_0x7e08('0x28')][_0x7e08('0x18')]);}_0x4e2a35['order']=qs[_0x7e08('0x31')](_0x4bd28e[_0x7e08('0x28')][_0x7e08('0x31')]);_0x4e2a35[_0x7e08('0x32')]=qs[_0x7e08('0x2a')](_[_0x7e08('0x33')](_0x4bd28e['query'],_0x441d61['filters']));if(_0x4bd28e[_0x7e08('0x28')]['filter']){_0x4e2a35['where']=_[_0x7e08('0x34')](_0x4e2a35[_0x7e08('0x32')],{'$or':_['map'](_0x4d4b74,function(_0x104fb9){if(_0x104fb9[_0x7e08('0x35')][_0x7e08('0x36')]!=='VIRTUAL'){var _0x5bdf35={};_0x5bdf35[_0x104fb9[_0x7e08('0x37')]]={'$like':'%'+_0x4bd28e[_0x7e08('0x28')][_0x7e08('0x38')]+'%'};return _0x5bdf35;}})});}_0x4e2a35=_['merge']({},_0x4e2a35,_0x4bd28e[_0x7e08('0x39')]);var _0x3efefa={'where':_0x4e2a35[_0x7e08('0x32')]};return db['CmCustomField'][_0x7e08('0x17')](_0x3efefa)[_0x7e08('0x1d')](function(_0x46a6d2){_0x5bb822[_0x7e08('0x17')]=_0x46a6d2;if(_0x4bd28e[_0x7e08('0x28')][_0x7e08('0x3a')]){_0x4e2a35[_0x7e08('0x3b')]=[{'all':!![]}];}return db[_0x7e08('0x24')][_0x7e08('0x3c')](_0x4e2a35);})[_0x7e08('0x1d')](function(_0x4a1147){_0x5bb822[_0x7e08('0x3d')]=_0x4a1147;return _0x5bb822;})[_0x7e08('0x1d')](respondWithFilteredResult(_0x19a798,_0x4e2a35))[_0x7e08('0x3e')](handleError(_0x19a798,null));};exports['show']=function(_0x4c80e1,_0x222266){var _0xb2d461={'raw':!![],'where':{'id':_0x4c80e1['params']['id']}},_0x2bad22={};_0x2bad22[_0x7e08('0x26')]=_['keys'](db[_0x7e08('0x24')][_0x7e08('0x25')]);_0x2bad22[_0x7e08('0x28')]=_[_0x7e08('0x29')](_0x4c80e1['query']);_0x2bad22[_0x7e08('0x2a')]=_['intersection'](_0x2bad22[_0x7e08('0x26')],_0x2bad22['query']);_0xb2d461[_0x7e08('0x2b')]=_[_0x7e08('0x2c')](_0x2bad22[_0x7e08('0x26')],qs['fields'](_0x4c80e1['query'][_0x7e08('0x2d')]));_0xb2d461[_0x7e08('0x2b')]=_0xb2d461[_0x7e08('0x2b')][_0x7e08('0x2e')]?_0xb2d461[_0x7e08('0x2b')]:_0x2bad22[_0x7e08('0x26')];if(_0x4c80e1['query'][_0x7e08('0x3a')]){_0xb2d461[_0x7e08('0x3b')]=[{'all':!![]}];}_0xb2d461=_[_0x7e08('0x34')]({},_0xb2d461,_0x4c80e1[_0x7e08('0x39')]);return db['CmCustomField'][_0x7e08('0x3f')](_0xb2d461)[_0x7e08('0x1d')](handleEntityNotFound(_0x222266,null))[_0x7e08('0x1d')](respondWithResult(_0x222266,null))[_0x7e08('0x3e')](handleError(_0x222266,null));};exports[_0x7e08('0x40')]=function(_0xc34a2a,_0x49552b){return db[_0x7e08('0x41')][_0x7e08('0x42')](function(_0x1d181e){return db[_0x7e08('0x24')][_0x7e08('0x40')](_0xc34a2a[_0x7e08('0x43')],{'transaction':_0x1d181e});})['then'](respondWithResult(_0x49552b,0xc9))[_0x7e08('0x3e')](handleError(_0x49552b,null));};exports[_0x7e08('0x44')]=function(_0x1ec382,_0xfffa83){if(_0x1ec382['body']['id']){delete _0x1ec382[_0x7e08('0x43')]['id'];}return db['CmCustomField'][_0x7e08('0x3f')]({'where':{'id':_0x1ec382[_0x7e08('0x45')]['id']}})[_0x7e08('0x1d')](handleEntityNotFound(_0xfffa83,null))[_0x7e08('0x1d')](saveUpdates(_0x1ec382[_0x7e08('0x43')],null))[_0x7e08('0x1d')](respondWithResult(_0xfffa83,null))['catch'](handleError(_0xfffa83,null));};exports[_0x7e08('0x1e')]=function(_0x5e5e4d,_0x57a9e8){return db[_0x7e08('0x24')][_0x7e08('0x3f')]({'where':{'id':_0x5e5e4d[_0x7e08('0x45')]['id']}})[_0x7e08('0x1d')](handleEntityNotFound(_0x57a9e8,null))[_0x7e08('0x1d')](removeEntity(_0x57a9e8,null))['catch'](handleError(_0x57a9e8,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2816287..15efbe3 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 _0x2d1c=['number','INTEGER','defaultValue','queryInterface','addColumn','format','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','TEXT','transaction','type'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2d1c,0x12c));var _0xc2d1=function(_0xeb6ad9,_0x56c3e8){_0xeb6ad9=_0xeb6ad9-0x0;var _0x458158=_0x2d1c[_0xeb6ad9];return _0x458158;};'use strict';var _=require(_0xc2d1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc2d1('0x1'));var moment=require(_0xc2d1('0x2'));var BPromise=require(_0xc2d1('0x3'));var rp=require(_0xc2d1('0x4'));var fs=require('fs');var path=require(_0xc2d1('0x5'));var rimraf=require('rimraf');var config=require(_0xc2d1('0x6'));var attributes=require(_0xc2d1('0x7'));module[_0xc2d1('0x8')]=function(_0x51c2eb,_0x599104){return _0x51c2eb[_0xc2d1('0x9')](_0xc2d1('0xa'),attributes,{'tableName':_0xc2d1('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x23c65a,_0x361167,_0x4f4940){var _0x230ad6=_0x23c65a['get']({'plain':!![]});var _0x4b4444={'type':_0x599104[_0xc2d1('0xc')],'transaction':_0x361167[_0xc2d1('0xd')]};switch(_0x230ad6[_0xc2d1('0xe')]){case'text':_0x4b4444[_0xc2d1('0xe')]=_0x599104[_0xc2d1('0xc')];break;case _0xc2d1('0xf'):_0x4b4444['type']=_0x599104[_0xc2d1('0x10')];break;case'switch':_0x4b4444[_0xc2d1('0xe')]=_0x599104['BOOLEAN'];_0x4b4444[_0xc2d1('0x11')]=![];break;}_0x51c2eb[_0xc2d1('0x12')][_0xc2d1('0x13')]('cm_contacts',util[_0xc2d1('0x14')]('cf_%d',_0x230ad6['id']),_0x4b4444);_0x4f4940();}}});}; \ No newline at end of file +var _0x614f=['INTEGER','switch','BOOLEAN','defaultValue','queryInterface','format','cf_%d','lodash','../../config/logger','api','path','rimraf','define','CmCustomField','cm_custom_fields','TEXT','type','text'];(function(_0x48e75c,_0x18b885){var _0xc625ce=function(_0x3ddb48){while(--_0x3ddb48){_0x48e75c['push'](_0x48e75c['shift']());}};_0xc625ce(++_0x18b885);}(_0x614f,0x127));var _0xf614=function(_0x164201,_0xd2a428){_0x164201=_0x164201-0x0;var _0x36e8d3=_0x614f[_0x164201];return _0x36e8d3;};'use strict';var _=require(_0xf614('0x0'));var util=require('util');var logger=require(_0xf614('0x1'))(_0xf614('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf614('0x3'));var rimraf=require(_0xf614('0x4'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x5a4b4c,_0x48ee47){return _0x5a4b4c[_0xf614('0x5')](_0xf614('0x6'),attributes,{'tableName':_0xf614('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x25ae0b,_0x3b1570,_0x10cd25){var _0x2974f3=_0x25ae0b['get']({'plain':!![]});var _0x2db1d4={'type':_0x48ee47[_0xf614('0x8')],'transaction':_0x3b1570['transaction']};switch(_0x2974f3[_0xf614('0x9')]){case _0xf614('0xa'):_0x2db1d4['type']=_0x48ee47[_0xf614('0x8')];break;case'number':_0x2db1d4['type']=_0x48ee47[_0xf614('0xb')];break;case _0xf614('0xc'):_0x2db1d4[_0xf614('0x9')]=_0x48ee47[_0xf614('0xd')];_0x2db1d4[_0xf614('0xe')]=![];break;}_0x5a4b4c[_0xf614('0xf')]['addColumn']('cm_contacts',util[_0xf614('0x10')](_0xf614('0x11'),_0x2974f3['id']),_0x2db1d4);_0x10cd25();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index fb5a637..9f7fbc5 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 _0xaded=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x52e4dd,_0x53fbb2){var _0x192f71=function(_0x11d905){while(--_0x11d905){_0x52e4dd['push'](_0x52e4dd['shift']());}};_0x192f71(++_0x53fbb2);}(_0xaded,0x1c7));var _0xdade=function(_0x4e294e,_0x37ccf4){_0x4e294e=_0x4e294e-0x0;var _0xa5565b=_0xaded[_0x4e294e];return _0xa5565b;};'use strict';var _=require(_0xdade('0x0'));var util=require(_0xdade('0x1'));var moment=require('moment');var BPromise=require(_0xdade('0x2'));var rs=require(_0xdade('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdade('0x4'))['db'];var utils=require(_0xdade('0x5'));var logger=require(_0xdade('0x6'))('rpc');var config=require(_0xdade('0x7'));var jayson=require(_0xdade('0x8'));var client=jayson[_0xdade('0x9')][_0xdade('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf9eace,_0x17a74a,_0x3a7219){return new BPromise(function(_0x2b1289,_0x313e14){return client[_0xdade('0xb')](_0xf9eace,_0x3a7219)[_0xdade('0xc')](function(_0x3d3241){logger[_0xdade('0xd')]('CmCustomField,\x20%s,\x20%s',_0x17a74a,_0xdade('0xe'));logger[_0xdade('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x17a74a,_0xdade('0xe'),JSON[_0xdade('0x10')](_0x3d3241));if(_0x3d3241['error']){if(_0x3d3241[_0xdade('0x11')][_0xdade('0x12')]===0x1f4){logger[_0xdade('0x11')](_0xdade('0x13'),_0x17a74a,_0x3d3241[_0xdade('0x11')]['message']);return _0x313e14(_0x3d3241[_0xdade('0x11')]['message']);}logger[_0xdade('0x11')](_0xdade('0x13'),_0x17a74a,_0x3d3241[_0xdade('0x11')]['message']);return _0x2b1289(_0x3d3241['error'][_0xdade('0x14')]);}else{logger[_0xdade('0xd')]('CmCustomField,\x20%s,\x20%s',_0x17a74a,_0xdade('0xe'));_0x2b1289(_0x3d3241[_0xdade('0x15')][_0xdade('0x14')]);}})[_0xdade('0x16')](function(_0x78979){logger['error'](_0xdade('0x13'),_0x17a74a,_0x78979);_0x313e14(_0x78979);});});} \ No newline at end of file +var _0x5d9d=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0x5d9d,0xa6));var _0xd5d9=function(_0x2141c1,_0x1f1733){_0x2141c1=_0x2141c1-0x0;var _0x46e7f1=_0x5d9d[_0x2141c1];return _0x46e7f1;};'use strict';var _=require(_0xd5d9('0x0'));var util=require(_0xd5d9('0x1'));var moment=require(_0xd5d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5d9('0x3'));var db=require(_0xd5d9('0x4'))['db'];var utils=require(_0xd5d9('0x5'));var logger=require(_0xd5d9('0x6'))(_0xd5d9('0x7'));var config=require(_0xd5d9('0x8'));var jayson=require(_0xd5d9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd4b641,_0x37393c,_0x16d397){return new BPromise(function(_0x14cbf8,_0x3d56c6){return client[_0xd5d9('0xa')](_0xd4b641,_0x16d397)['then'](function(_0x572cb0){logger[_0xd5d9('0xb')](_0xd5d9('0xc'),_0x37393c,_0xd5d9('0xd'));logger[_0xd5d9('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x37393c,_0xd5d9('0xd'),JSON[_0xd5d9('0xf')](_0x572cb0));if(_0x572cb0[_0xd5d9('0x10')]){if(_0x572cb0[_0xd5d9('0x10')][_0xd5d9('0x11')]===0x1f4){logger[_0xd5d9('0x10')]('CmCustomField,\x20%s,\x20%s',_0x37393c,_0x572cb0[_0xd5d9('0x10')][_0xd5d9('0x12')]);return _0x3d56c6(_0x572cb0[_0xd5d9('0x10')][_0xd5d9('0x12')]);}logger['error'](_0xd5d9('0xc'),_0x37393c,_0x572cb0[_0xd5d9('0x10')][_0xd5d9('0x12')]);return _0x14cbf8(_0x572cb0[_0xd5d9('0x10')]['message']);}else{logger['info'](_0xd5d9('0xc'),_0x37393c,'request\x20sent');_0x14cbf8(_0x572cb0[_0xd5d9('0x13')][_0xd5d9('0x12')]);}})[_0xd5d9('0x14')](function(_0x2c9c0b){logger[_0xd5d9('0x10')]('CmCustomField,\x20%s,\x20%s',_0x37393c,_0x2c9c0b);_0x3d56c6(_0x2c9c0b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3e02121..3ce2d1e 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 _0xf458=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x572dd3,_0x56be84){var _0x32c62c=function(_0x5b06df){while(--_0x5b06df){_0x572dd3['push'](_0x572dd3['shift']());}};_0x32c62c(++_0x56be84);}(_0xf458,0x11e));var _0x8f45=function(_0x4cee7a,_0x519f31){_0x4cee7a=_0x4cee7a-0x0;var _0x3331b0=_0xf458[_0x4cee7a];return _0x3331b0;};'use strict';var multer=require('multer');var util=require(_0x8f45('0x0'));var path=require(_0x8f45('0x1'));var timeout=require(_0x8f45('0x2'));var express=require(_0x8f45('0x3'));var router=express[_0x8f45('0x4')]();var auth=require(_0x8f45('0x5'));var interaction=require(_0x8f45('0x6'));var config=require(_0x8f45('0x7'));var controller=require('./cmCustomField.controller');router[_0x8f45('0x8')]('/',auth[_0x8f45('0x9')](),controller[_0x8f45('0xa')]);router[_0x8f45('0x8')](_0x8f45('0xb'),auth[_0x8f45('0x9')](),controller[_0x8f45('0xc')]);router[_0x8f45('0xd')]('/',auth[_0x8f45('0x9')](),controller[_0x8f45('0xe')]);router[_0x8f45('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8f45('0x10')]('/:id',auth[_0x8f45('0x9')](),controller[_0x8f45('0x11')]);module[_0x8f45('0x12')]=router; \ No newline at end of file +var _0x9145=['delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0xbb28ac,_0x526394){var _0x5a3341=function(_0x15ea40){while(--_0x15ea40){_0xbb28ac['push'](_0xbb28ac['shift']());}};_0x5a3341(++_0x526394);}(_0x9145,0xf9));var _0x5914=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9145[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x5914('0x0'));var util=require(_0x5914('0x1'));var path=require('path');var timeout=require(_0x5914('0x2'));var express=require(_0x5914('0x3'));var router=express[_0x5914('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5914('0x5'));var config=require(_0x5914('0x6'));var controller=require(_0x5914('0x7'));router['get']('/',auth[_0x5914('0x8')](),controller[_0x5914('0x9')]);router[_0x5914('0xa')](_0x5914('0xb'),auth['isAuthenticated'](),controller[_0x5914('0xc')]);router[_0x5914('0xd')]('/',auth[_0x5914('0x8')](),controller[_0x5914('0xe')]);router[_0x5914('0xf')](_0x5914('0xb'),auth['isAuthenticated'](),controller[_0x5914('0x10')]);router[_0x5914('0x11')](_0x5914('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5914('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 4a373fb..3f0f77d 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 _0x8f74=['INTEGER','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x8f74,0x12e));var _0x48f7=function(_0x1bc74d,_0x55aff4){_0x1bc74d=_0x1bc74d-0x0;var _0x4724fd=_0x8f74[_0x1bc74d];return _0x4724fd;};'use strict';var moment=require(_0x48f7('0x0'));var Sequelize=require(_0x48f7('0x1'));module[_0x48f7('0x2')]={'phone':{'type':Sequelize[_0x48f7('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x48f7('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x48f7('0x5')],'defaultValue':moment()[_0x48f7('0x6')](_0x48f7('0x7'))},'countbusyretry':{'type':Sequelize[_0x48f7('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x48f7('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x48f7('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x48f7('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x48f7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x48f7('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x48f7('0x8')],'unique':_0x48f7('0x9')},'ListId':{'type':Sequelize[_0x48f7('0x8')],'unique':_0x48f7('0x9')},'UserId':{'type':Sequelize[_0x48f7('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x48f7('0x8')],'unique':_0x48f7('0x9')},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6598=['exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x6598,0x15d));var _0x8659=function(_0x210ca6,_0x4fc21d){_0x210ca6=_0x210ca6-0x0;var _0x37f311=_0x6598[_0x210ca6];return _0x37f311;};'use strict';var moment=require('moment');var Sequelize=require(_0x8659('0x0'));module[_0x8659('0x1')]={'phone':{'type':Sequelize[_0x8659('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8659('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8659('0x4')],'defaultValue':moment()[_0x8659('0x5')](_0x8659('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8659('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8659('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8659('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8659('0x4')]},'priority':{'type':Sequelize[_0x8659('0x7')](0x2)[_0x8659('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8659('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8659('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8659('0x7')],'unique':_0x8659('0x9')},'UserId':{'type':Sequelize[_0x8659('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x8659('0x7')],'unique':_0x8659('0x9')},'CampaignId':{'type':Sequelize[_0x8659('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 9a40d04..f6d7b1a 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 _0x65a0=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','rawAttributes','keys','query','intersection','filters','concat','$or','$gte','$lt','$lte','$ne','$eq','$not','$in','$like','$notLike','$notILike','$overlap','$contains','$any','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','CmHopper','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','isNumber','getOpenContacts','entity\x20not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path'];(function(_0x27128e,_0x4d340e){var _0x372aa0=function(_0x557416){while(--_0x557416){_0x27128e['push'](_0x27128e['shift']());}};_0x372aa0(++_0x4d340e);}(_0x65a0,0x89));var _0x065a=function(_0x4d4f6d,_0x4b11dd){_0x4d4f6d=_0x4d4f6d-0x0;var _0xecdb59=_0x65a0[_0x4d4f6d];return _0xecdb59;};'use strict';var pdf=require(_0x065a('0x0'));var emlformat=require(_0x065a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x065a('0x2'));var jsonpatch=require(_0x065a('0x3'));var rp=require(_0x065a('0x4'));var moment=require(_0x065a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x065a('0x6'));var util=require('util');var path=require(_0x065a('0x7'));var sox=require(_0x065a('0x8'));var csv=require(_0x065a('0x9'));var ejs=require(_0x065a('0xa'));var fs=require('fs');var _=require(_0x065a('0xb'));var squel=require(_0x065a('0xc'));var crypto=require('crypto');var jsforce=require(_0x065a('0xd'));var deskjs=require(_0x065a('0xe'));var toCsv=require(_0x065a('0x9'));var querystring=require(_0x065a('0xf'));var Papa=require('papaparse');var Redis=require(_0x065a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x065a('0x11'));var hardwareService=require(_0x065a('0x12'));var logger=require('../../config/logger')(_0x065a('0x13'));var utils=require('../../config/utils');var config=require(_0x065a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a4f00,_0xe4b405){_0xe4b405=_0xe4b405||0xcc;return function(_0x3133fa){if(_0x3133fa){return _0x3a4f00[_0x065a('0x15')](_0xe4b405);}return _0x3a4f00[_0x065a('0x16')](_0xe4b405)[_0x065a('0x17')]();};}function respondWithResult(_0x38a138,_0x9d720){_0x9d720=_0x9d720||0xc8;return function(_0x5282bd){if(_0x5282bd){return _0x38a138['status'](_0x9d720)[_0x065a('0x18')](_0x5282bd);}};}function respondWithFilteredResult(_0x4e12cc,_0x57ea74){return function(_0xc93fbf){if(_0xc93fbf){var _0x173ea9=_0xc93fbf[_0x065a('0x19')],_0x3fe393=_0x57ea74[_0x065a('0x1a')],_0x77b2fc=_0x57ea74['offset']+_0x57ea74['limit'],_0x360685;if(_0x77b2fc>=_0x173ea9){_0x77b2fc=_0x173ea9;_0x360685=0xc8;}else{_0x360685=0xce;}_0x4e12cc[_0x065a('0x16')](_0x360685);return _0x4e12cc['set'](_0x065a('0x1b'),_0x3fe393+'-'+_0x77b2fc+'/'+_0x173ea9)[_0x065a('0x18')](_0xc93fbf);}return null;};}function patchUpdates(_0x3a906a){return function(_0x4a1943){try{jsonpatch[_0x065a('0x1c')](_0x4a1943,_0x3a906a,!![]);}catch(_0x445a57){return BPromise[_0x065a('0x1d')](_0x445a57);}return _0x4a1943[_0x065a('0x1e')]();};}function saveUpdates(_0x5094ad,_0x3443f1){return function(_0x660287){if(_0x660287){return _0x660287[_0x065a('0x1f')](_0x5094ad)[_0x065a('0x20')](function(_0x368933){return _0x368933;});}return null;};}function removeEntity(_0xa616ab,_0x36b896){return function(_0x49335e){if(_0x49335e){return _0x49335e[_0x065a('0x21')]()[_0x065a('0x20')](function(){_0xa616ab[_0x065a('0x16')](0xcc)[_0x065a('0x17')]();});}};}function handleEntityNotFound(_0x4ae565,_0x53758e){return function(_0x5c9c9b){if(!_0x5c9c9b){_0x4ae565['sendStatus'](0x194);}return _0x5c9c9b;};}function handleError(_0x1a4f57,_0x278d39){_0x278d39=_0x278d39||0x1f4;return function(_0x390320){logger[_0x065a('0x22')](_0x390320[_0x065a('0x23')]);if(_0x390320[_0x065a('0x24')]){delete _0x390320[_0x065a('0x24')];}_0x1a4f57[_0x065a('0x16')](_0x278d39)['send'](_0x390320);};}exports['index']=function(_0x3592a5,_0x399840){var _0xac7951={},_0xd7cdd2={},_0x3dba25={'count':0x0,'rows':[]};var _0xc52c71=db['CmHopper'][_0x065a('0x25')];_0xd7cdd2['model']=_[_0x065a('0x26')](_0xc52c71);_0xd7cdd2[_0x065a('0x27')]=_[_0x065a('0x26')](_0x3592a5[_0x065a('0x27')]);_0xd7cdd2['filters']=_[_0x065a('0x28')](_0xd7cdd2['model'],_0xd7cdd2[_0x065a('0x27')]);_0xd7cdd2[_0x065a('0x29')]=_[_0x065a('0x2a')](_0xd7cdd2[_0x065a('0x29')],['$and',_0x065a('0x2b'),'$gt',_0x065a('0x2c'),_0x065a('0x2d'),_0x065a('0x2e'),_0x065a('0x2f'),_0x065a('0x30'),_0x065a('0x31'),'$between','$notBetween',_0x065a('0x32'),'$notIn',_0x065a('0x33'),_0x065a('0x34'),'$iLike',_0x065a('0x35'),_0x065a('0x33'),_0x065a('0x36'),_0x065a('0x37'),'$contained',_0x065a('0x38')]);_0xac7951[_0x065a('0x39')]=_['intersection'](_0xd7cdd2[_0x065a('0x3a')],qs['fields'](_0x3592a5['query'][_0x065a('0x3b')]));_0xac7951[_0x065a('0x39')]=_0xac7951[_0x065a('0x39')][_0x065a('0x3c')]?_0xac7951[_0x065a('0x39')]:_0xd7cdd2['model'];if(!_0x3592a5[_0x065a('0x27')][_0x065a('0x3d')](_0x065a('0x3e'))){_0xac7951[_0x065a('0x3f')]=qs[_0x065a('0x3f')](_0x3592a5[_0x065a('0x27')][_0x065a('0x3f')]);_0xac7951[_0x065a('0x1a')]=qs[_0x065a('0x1a')](_0x3592a5[_0x065a('0x27')]['offset']);}_0xac7951[_0x065a('0x40')]=qs[_0x065a('0x41')](_0x3592a5[_0x065a('0x27')][_0x065a('0x41')]);_0xac7951['where']=qs[_0x065a('0x29')](_[_0x065a('0x42')](_0x3592a5[_0x065a('0x27')],_0xd7cdd2['filters']));if(_0x3592a5[_0x065a('0x27')][_0x065a('0x43')]){_0xac7951[_0x065a('0x44')]=_['merge'](_0xac7951[_0x065a('0x44')],{'$or':_[_0x065a('0x45')](_0xc52c71,function(_0xfbd48d){if(_0xfbd48d[_0x065a('0x46')][_0x065a('0x47')]!==_0x065a('0x48')){var _0x17f341={};_0x17f341[_0xfbd48d[_0x065a('0x49')]]={'$like':'%'+_0x3592a5[_0x065a('0x27')]['filter']+'%'};return _0x17f341;}})});}_0xac7951=_[_0x065a('0x4a')]({},_0xac7951,_0x3592a5['options']);var _0x8384e={'where':_0xac7951[_0x065a('0x44')]};return db[_0x065a('0x4b')][_0x065a('0x19')](_0x8384e)['then'](function(_0x4f863f){_0x3dba25[_0x065a('0x19')]=_0x4f863f;if(_0x3592a5[_0x065a('0x27')]['includeAll']){_0xac7951[_0x065a('0x4c')]=[{'all':!![]}];}return db[_0x065a('0x4b')][_0x065a('0x4d')](_0xac7951);})[_0x065a('0x20')](function(_0x3ea81a){_0x3dba25[_0x065a('0x4e')]=_0x3ea81a;return _0x3dba25;})['then'](respondWithFilteredResult(_0x399840,_0xac7951))[_0x065a('0x4f')](handleError(_0x399840,null));};exports[_0x065a('0x50')]=function(_0xfb2098,_0x5dba2e){var _0x2031cb={'raw':!![],'where':{'id':_0xfb2098[_0x065a('0x51')]['id']}},_0x250d7a={};_0x250d7a[_0x065a('0x3a')]=_['keys'](db[_0x065a('0x4b')][_0x065a('0x25')]);_0x250d7a[_0x065a('0x27')]=_[_0x065a('0x26')](_0xfb2098[_0x065a('0x27')]);_0x250d7a[_0x065a('0x29')]=_[_0x065a('0x28')](_0x250d7a['model'],_0x250d7a[_0x065a('0x27')]);_0x2031cb['attributes']=_['intersection'](_0x250d7a[_0x065a('0x3a')],qs[_0x065a('0x3b')](_0xfb2098[_0x065a('0x27')][_0x065a('0x3b')]));_0x2031cb[_0x065a('0x39')]=_0x2031cb[_0x065a('0x39')][_0x065a('0x3c')]?_0x2031cb['attributes']:_0x250d7a[_0x065a('0x3a')];if(_0xfb2098[_0x065a('0x27')][_0x065a('0x52')]){_0x2031cb[_0x065a('0x4c')]=[{'all':!![]}];}_0x2031cb=_['merge']({},_0x2031cb,_0xfb2098['options']);return db['CmHopper'][_0x065a('0x53')](_0x2031cb)[_0x065a('0x20')](handleEntityNotFound(_0x5dba2e,null))[_0x065a('0x20')](respondWithResult(_0x5dba2e,null))['catch'](handleError(_0x5dba2e,null));};exports[_0x065a('0x54')]=function(_0x5c1ce7,_0x29447f){return db[_0x065a('0x4b')][_0x065a('0x54')](_0x5c1ce7['body'],{})[_0x065a('0x20')](respondWithResult(_0x29447f,0xc9))[_0x065a('0x4f')](handleError(_0x29447f,null));};exports[_0x065a('0x1f')]=function(_0x5f42a0,_0x58472d){if(_0x5f42a0[_0x065a('0x55')]['id']){delete _0x5f42a0[_0x065a('0x55')]['id'];}return db[_0x065a('0x4b')][_0x065a('0x53')]({'where':{'id':_0x5f42a0[_0x065a('0x51')]['id']}})['then'](handleEntityNotFound(_0x58472d,null))[_0x065a('0x20')](saveUpdates(_0x5f42a0['body'],null))[_0x065a('0x20')](respondWithResult(_0x58472d,null))[_0x065a('0x4f')](handleError(_0x58472d,null));};exports[_0x065a('0x56')]=function(_0x5f1cff,_0x15b80a){return db[_0x065a('0x4b')][_0x065a('0x56')]()[_0x065a('0x20')](respondWithResult(_0x15b80a,null))[_0x065a('0x4f')](handleError(_0x15b80a,null));};exports[_0x065a('0x21')]=function(_0x2f6032,_0x2abddb){var _0x13d108;return db[_0x065a('0x4b')][_0x065a('0x53')]({'where':{'id':_0x2f6032[_0x065a('0x51')]['id']}})['then'](handleEntityNotFound(_0x2abddb,null))[_0x065a('0x20')](function(_0x176669){if(_0x176669){return _0x176669[_0x065a('0x21')]()[_0x065a('0x20')](function(_0x4697a3){return _0x4697a3;});}})[_0x065a('0x20')](function(_0x775b02){_0x13d108=_0x775b02;if(_0x775b02){if(_0x775b02[_0x065a('0x57')]||_0x775b02[_0x065a('0x58')]){return db[_0x775b02[_0x065a('0x57')]?_0x065a('0x59'):'Campaign']['find']({'where':{'id':_0x775b02[_0x065a('0x57')]?_0x775b02[_0x065a('0x57')]:_0x775b02[_0x065a('0x58')]},'attributes':['id',_0x065a('0x24')],'raw':!![]});}}})[_0x065a('0x20')](function(_0x14748d){var _0x25f5be={};if(_0x14748d){_[_0x065a('0x4a')](_0x25f5be,_[_0x065a('0x5a')](_0x13d108[_0x065a('0x5b')],[_0x065a('0x5c'),_0x065a('0x5d'),'id']));_0x25f5be[_0x065a('0x5e')]=0x15;_0x25f5be[_0x065a('0x5f')]=_0x065a('0x60');_0x25f5be['campaign']=_0x14748d[_0x065a('0x24')];_0x25f5be[_0x065a('0x61')]=_0x2f6032[_0x065a('0x62')][_0x065a('0x24')];_0x25f5be[_0x065a('0x63')]=_0x2f6032[_0x065a('0x62')]['id'];_0x25f5be['deleted']=!![];_0x25f5be[_0x065a('0x64')]=moment()[_0x065a('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x25f5be['calleridnum']=_0x13d108[_0x065a('0x66')];_0x25f5be[_0x065a('0x67')]=_0x13d108[_0x065a('0x57')]?_0x065a('0x68'):_0x065a('0x69');return db['CmContact']['find']({'where':{'id':_0x25f5be[_0x065a('0x6a')]},'attributes':[_0x065a('0x6b'),_0x065a('0x6c')]})[_0x065a('0x20')](function(_0x13a369){if(!_[_0x065a('0x6d')](_0x2abddb)&&!_['isNil'](_0x13a369[_0x065a('0x6b')])){_0x25f5be[_0x065a('0x6e')]=_0x13a369[_0x065a('0x6b')];if(!_['isNil'](_0x13a369['lastName'])){_0x25f5be[_0x065a('0x6e')]+='\x20'+_0x13a369[_0x065a('0x6c')];}}})[_0x065a('0x6f')](function(){return db[_0x065a('0x70')][_0x065a('0x54')](_0x25f5be);});}})[_0x065a('0x20')](function(){return _0x2abddb['status'](0xcc)[_0x065a('0x17')]();})['catch'](handleError(_0x2abddb,null));};exports['getPreview']=function(_0x4243a7,_0x343d17,_0x56cda0){var _0x204502=[];return db[_0x065a('0x71')][_0x065a('0x56')]()[_0x065a('0x20')](function(_0x3f69ff){_0x204502=_[_0x065a('0x26')](_0x3f69ff);return _0x4243a7['user'][_0x065a('0x72')]({'where':{'type':_0x065a('0x73'),'dialActive':!![],'dialMethod':_0x065a('0x74')},'attributes':['id',_0x065a('0x75')],'raw':!![]});})[_0x065a('0x20')](function(_0x5cd65f){if(_0x5cd65f&&_0x5cd65f[_0x065a('0x3c')]){return db[_0x065a('0x76')][_0x065a('0x77')](function(_0x432d71){var _0x5904b9={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x065a('0x65')](_0x065a('0x78'))},'VoiceQueueId':{'$in':_[_0x065a('0x45')](_0x5cd65f,'id')},'$or':[{'UserId':null},{'UserId':_0x4243a7[_0x065a('0x62')]['id']}]};var _0x204165=[];if(_0x4243a7[_0x065a('0x55')][_0x065a('0x79')]&&_0x4243a7['body']['direction']===_0x065a('0x7a')){if(!_[_0x065a('0x7b')](_0x4243a7[_0x065a('0x55')]['hopperIds'])){_0x5904b9['id']={'$in':_0x4243a7[_0x065a('0x55')][_0x065a('0x7c')]};}_0x204165=[['priority',_0x065a('0x7d')],[_0x065a('0x7e'),_0x5cd65f[0x0][_0x065a('0x75')]===_0x065a('0x7d')?_0x065a('0x7f'):_0x065a('0x7d')],db['sequelize'][_0x065a('0x80')](_0x065a('0x81')),['id','DESC']];}else{if(!_[_0x065a('0x7b')](_0x4243a7[_0x065a('0x55')][_0x065a('0x7c')])){_0x5904b9['id']={'$notIn':_0x4243a7[_0x065a('0x55')][_0x065a('0x7c')]};}_0x204165=[['priority',_0x065a('0x7f')],[_0x065a('0x7e'),_0x5cd65f[0x0]['dialOrderByScheduledAt']],db[_0x065a('0x76')]['literal'](_0x065a('0x82')),['id',_0x065a('0x7d')]];}return db[_0x065a('0x4b')][_0x065a('0x83')]({'attributes':['id',_0x065a('0x84')],'where':_0x5904b9,'order':_0x204165,'transaction':_0x432d71,'lock':_0x432d71[_0x065a('0x85')][_0x065a('0x86')],'include':[{'model':db['CmContact'],'as':_0x065a('0x87'),'attributes':_0x204502,'include':[{'model':db[_0x065a('0x88')],'as':_0x065a('0x89'),'attributes':['id',_0x065a('0x24')]}]},{'model':db[_0x065a('0x8a')],'as':_0x065a('0x8b'),'attributes':['id',_0x065a('0x24')]},{'model':db[_0x065a('0x59')],'as':_0x065a('0x8c'),'attributes':['id',_0x065a('0x24'),_0x065a('0x8d')]}]})['then'](function(_0x1d9263){if(_0x1d9263){return _0x1d9263['update']({'UserId':_0x4243a7[_0x065a('0x62')]['id']},{'transaction':_0x432d71});}});});}})['then'](handleEntityNotFound(_0x343d17,null))[_0x065a('0x20')](respondWithResult(_0x343d17,null))[_0x065a('0x4f')](handleError(_0x343d17,null));};exports['getOpenContacts']=function(_0x49c9a8,_0x400609,_0x24a7d2){return _0x49c9a8[_0x065a('0x62')][_0x065a('0x72')]({'where':{'type':_0x065a('0x73'),'dialActive':!![],'dialMethod':_0x065a('0x74')},'attributes':['id'],'raw':!![]})['then'](function(_0x3e8eb4){if(_0x3e8eb4&&_0x3e8eb4[_0x065a('0x3c')]){return db[_0x065a('0x4b')][_0x065a('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x065a('0x65')](_0x065a('0x78'))},'VoiceQueueId':{'$in':_[_0x065a('0x45')](_0x3e8eb4,'id')},'$or':[{'UserId':null},{'UserId':_0x49c9a8[_0x065a('0x62')]['id']}]}});}return 0x0;})[_0x065a('0x20')](function(_0x544a7c){if(!_[_0x065a('0x6d')](_0x544a7c)&&_[_0x065a('0x8e')](_0x544a7c)){return _0x400609[_0x065a('0x16')](0xc8)[_0x065a('0x18')]({'contacts':_0x544a7c});}else{logger[_0x065a('0x22')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x065a('0x8f'),0x194,_0x065a('0x90'));_0x400609[_0x065a('0x15')](0x194);}})[_0x065a('0x4f')](handleError(_0x400609,null));}; \ No newline at end of file +var _0x1561=['priority','ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','List','getOpenContacts','getVoiceQueues','outbound','isNumber','entity\x20not\x20found','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','index','keys','query','intersection','model','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$notBetween','$like','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','field','count','CmHopper','findAll','rows','catch','params','rawAttributes','includeAll','include','options','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','updatedAt','state','statedesc','deleted','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','getPreview','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds'];(function(_0x3b1e3f,_0xf8826b){var _0x3b1cd3=function(_0x26ad44){while(--_0x26ad44){_0x3b1e3f['push'](_0x3b1e3f['shift']());}};_0x3b1cd3(++_0xf8826b);}(_0x1561,0x1b7));var _0x1156=function(_0x1dbb31,_0x9c26c9){_0x1dbb31=_0x1dbb31-0x0;var _0x4e181d=_0x1561[_0x1dbb31];return _0x4e181d;};'use strict';var pdf=require(_0x1156('0x0'));var emlformat=require(_0x1156('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1156('0x2'));var rp=require(_0x1156('0x3'));var moment=require(_0x1156('0x4'));var BPromise=require(_0x1156('0x5'));var Mustache=require(_0x1156('0x6'));var util=require(_0x1156('0x7'));var path=require(_0x1156('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1156('0x9'));var fs=require('fs');var _=require(_0x1156('0xa'));var squel=require(_0x1156('0xb'));var crypto=require(_0x1156('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1156('0xd'));var toCsv=require(_0x1156('0xe'));var querystring=require('querystring');var Papa=require(_0x1156('0xf'));var Redis=require(_0x1156('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1156('0x11'));var hardwareService=require(_0x1156('0x12'));var logger=require('../../config/logger')(_0x1156('0x13'));var utils=require(_0x1156('0x14'));var config=require(_0x1156('0x15'));var db=require(_0x1156('0x16'))['db'];function respondWithStatusCode(_0x5516c9,_0x31c732){_0x31c732=_0x31c732||0xcc;return function(_0x3bd40b){if(_0x3bd40b){return _0x5516c9[_0x1156('0x17')](_0x31c732);}return _0x5516c9[_0x1156('0x18')](_0x31c732)[_0x1156('0x19')]();};}function respondWithResult(_0x188fca,_0x5f2e00){_0x5f2e00=_0x5f2e00||0xc8;return function(_0x1f039d){if(_0x1f039d){return _0x188fca[_0x1156('0x18')](_0x5f2e00)[_0x1156('0x1a')](_0x1f039d);}};}function respondWithFilteredResult(_0x4a774c,_0x2ab498){return function(_0x18e456){if(_0x18e456){var _0x235bcc=_0x18e456['count'],_0x2ed7d2=_0x2ab498[_0x1156('0x1b')],_0x4457de=_0x2ab498['offset']+_0x2ab498[_0x1156('0x1c')],_0x59687e;if(_0x4457de>=_0x235bcc){_0x4457de=_0x235bcc;_0x59687e=0xc8;}else{_0x59687e=0xce;}_0x4a774c[_0x1156('0x18')](_0x59687e);return _0x4a774c[_0x1156('0x1d')](_0x1156('0x1e'),_0x2ed7d2+'-'+_0x4457de+'/'+_0x235bcc)[_0x1156('0x1a')](_0x18e456);}return null;};}function patchUpdates(_0x180662){return function(_0xa5adbe){try{jsonpatch['apply'](_0xa5adbe,_0x180662,!![]);}catch(_0x234a4c){return BPromise[_0x1156('0x1f')](_0x234a4c);}return _0xa5adbe[_0x1156('0x20')]();};}function saveUpdates(_0x6caa91,_0x296bf8){return function(_0x1a95eb){if(_0x1a95eb){return _0x1a95eb[_0x1156('0x21')](_0x6caa91)[_0x1156('0x22')](function(_0x2345c7){return _0x2345c7;});}return null;};}function removeEntity(_0x25f1e7,_0x160026){return function(_0x38d251){if(_0x38d251){return _0x38d251['destroy']()[_0x1156('0x22')](function(){_0x25f1e7[_0x1156('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4669ee,_0x43f195){return function(_0x50cc00){if(!_0x50cc00){_0x4669ee['sendStatus'](0x194);}return _0x50cc00;};}function handleError(_0x228511,_0x2959da){_0x2959da=_0x2959da||0x1f4;return function(_0x26a8c7){logger[_0x1156('0x23')](_0x26a8c7[_0x1156('0x24')]);if(_0x26a8c7[_0x1156('0x25')]){delete _0x26a8c7[_0x1156('0x25')];}_0x228511[_0x1156('0x18')](_0x2959da)[_0x1156('0x26')](_0x26a8c7);};}exports[_0x1156('0x27')]=function(_0x1001c2,_0x4ad413){var _0x400adb={},_0x2190d9={},_0x560525={'count':0x0,'rows':[]};var _0x58ee94=db['CmHopper']['rawAttributes'];_0x2190d9['model']=_[_0x1156('0x28')](_0x58ee94);_0x2190d9[_0x1156('0x29')]=_[_0x1156('0x28')](_0x1001c2[_0x1156('0x29')]);_0x2190d9['filters']=_[_0x1156('0x2a')](_0x2190d9[_0x1156('0x2b')],_0x2190d9['query']);_0x2190d9[_0x1156('0x2c')]=_[_0x1156('0x2d')](_0x2190d9[_0x1156('0x2c')],[_0x1156('0x2e'),_0x1156('0x2f'),_0x1156('0x30'),_0x1156('0x31'),_0x1156('0x32'),_0x1156('0x33'),_0x1156('0x34'),'$eq','$not','$between',_0x1156('0x35'),'$in','$notIn',_0x1156('0x36'),'$notLike','$iLike',_0x1156('0x37'),_0x1156('0x36'),_0x1156('0x38'),_0x1156('0x39'),_0x1156('0x3a'),'$any']);_0x400adb[_0x1156('0x3b')]=_['intersection'](_0x2190d9[_0x1156('0x2b')],qs[_0x1156('0x3c')](_0x1001c2[_0x1156('0x29')][_0x1156('0x3c')]));_0x400adb['attributes']=_0x400adb[_0x1156('0x3b')][_0x1156('0x3d')]?_0x400adb[_0x1156('0x3b')]:_0x2190d9['model'];if(!_0x1001c2[_0x1156('0x29')][_0x1156('0x3e')]('nolimit')){_0x400adb['limit']=qs['limit'](_0x1001c2['query'][_0x1156('0x1c')]);_0x400adb[_0x1156('0x1b')]=qs[_0x1156('0x1b')](_0x1001c2[_0x1156('0x29')][_0x1156('0x1b')]);}_0x400adb[_0x1156('0x3f')]=qs[_0x1156('0x40')](_0x1001c2['query'][_0x1156('0x40')]);_0x400adb[_0x1156('0x41')]=qs[_0x1156('0x2c')](_['pick'](_0x1001c2[_0x1156('0x29')],_0x2190d9['filters']));if(_0x1001c2[_0x1156('0x29')][_0x1156('0x42')]){_0x400adb[_0x1156('0x41')]=_[_0x1156('0x43')](_0x400adb[_0x1156('0x41')],{'$or':_[_0x1156('0x44')](_0x58ee94,function(_0x225668){if(_0x225668[_0x1156('0x45')][_0x1156('0x46')]!=='VIRTUAL'){var _0x391194={};_0x391194[_0x225668[_0x1156('0x47')]]={'$like':'%'+_0x1001c2[_0x1156('0x29')][_0x1156('0x42')]+'%'};return _0x391194;}})});}_0x400adb=_[_0x1156('0x43')]({},_0x400adb,_0x1001c2['options']);var _0xcde563={'where':_0x400adb[_0x1156('0x41')]};return db['CmHopper'][_0x1156('0x48')](_0xcde563)[_0x1156('0x22')](function(_0x44dbce){_0x560525[_0x1156('0x48')]=_0x44dbce;if(_0x1001c2['query']['includeAll']){_0x400adb['include']=[{'all':!![]}];}return db[_0x1156('0x49')][_0x1156('0x4a')](_0x400adb);})['then'](function(_0x40afce){_0x560525[_0x1156('0x4b')]=_0x40afce;return _0x560525;})[_0x1156('0x22')](respondWithFilteredResult(_0x4ad413,_0x400adb))[_0x1156('0x4c')](handleError(_0x4ad413,null));};exports['show']=function(_0x30a094,_0x444e9d){var _0x1aa02d={'raw':!![],'where':{'id':_0x30a094[_0x1156('0x4d')]['id']}},_0xbaa1b6={};_0xbaa1b6['model']=_['keys'](db[_0x1156('0x49')][_0x1156('0x4e')]);_0xbaa1b6[_0x1156('0x29')]=_[_0x1156('0x28')](_0x30a094[_0x1156('0x29')]);_0xbaa1b6[_0x1156('0x2c')]=_[_0x1156('0x2a')](_0xbaa1b6['model'],_0xbaa1b6[_0x1156('0x29')]);_0x1aa02d[_0x1156('0x3b')]=_[_0x1156('0x2a')](_0xbaa1b6['model'],qs[_0x1156('0x3c')](_0x30a094[_0x1156('0x29')][_0x1156('0x3c')]));_0x1aa02d[_0x1156('0x3b')]=_0x1aa02d[_0x1156('0x3b')][_0x1156('0x3d')]?_0x1aa02d[_0x1156('0x3b')]:_0xbaa1b6['model'];if(_0x30a094[_0x1156('0x29')][_0x1156('0x4f')]){_0x1aa02d[_0x1156('0x50')]=[{'all':!![]}];}_0x1aa02d=_['merge']({},_0x1aa02d,_0x30a094[_0x1156('0x51')]);return db[_0x1156('0x49')][_0x1156('0x52')](_0x1aa02d)[_0x1156('0x22')](handleEntityNotFound(_0x444e9d,null))[_0x1156('0x22')](respondWithResult(_0x444e9d,null))['catch'](handleError(_0x444e9d,null));};exports[_0x1156('0x53')]=function(_0x3c2bce,_0xf8ef18){return db[_0x1156('0x49')][_0x1156('0x53')](_0x3c2bce['body'],{})[_0x1156('0x22')](respondWithResult(_0xf8ef18,0xc9))['catch'](handleError(_0xf8ef18,null));};exports[_0x1156('0x21')]=function(_0x3a5f17,_0x2db862){if(_0x3a5f17[_0x1156('0x54')]['id']){delete _0x3a5f17[_0x1156('0x54')]['id'];}return db[_0x1156('0x49')]['find']({'where':{'id':_0x3a5f17[_0x1156('0x4d')]['id']}})[_0x1156('0x22')](handleEntityNotFound(_0x2db862,null))[_0x1156('0x22')](saveUpdates(_0x3a5f17['body'],null))[_0x1156('0x22')](respondWithResult(_0x2db862,null))[_0x1156('0x4c')](handleError(_0x2db862,null));};exports[_0x1156('0x55')]=function(_0x1f4ea3,_0x27a05f){return db[_0x1156('0x49')]['describe']()[_0x1156('0x22')](respondWithResult(_0x27a05f,null))[_0x1156('0x4c')](handleError(_0x27a05f,null));};exports['destroy']=function(_0x14556c,_0x5aaa59){var _0x39c9c3;return db[_0x1156('0x49')][_0x1156('0x52')]({'where':{'id':_0x14556c[_0x1156('0x4d')]['id']}})[_0x1156('0x22')](handleEntityNotFound(_0x5aaa59,null))[_0x1156('0x22')](function(_0x36debe){if(_0x36debe){return _0x36debe[_0x1156('0x56')]()['then'](function(_0x51afa7){return _0x51afa7;});}})[_0x1156('0x22')](function(_0x3a8e20){_0x39c9c3=_0x3a8e20;if(_0x3a8e20){if(_0x3a8e20[_0x1156('0x57')]||_0x3a8e20[_0x1156('0x58')]){return db[_0x3a8e20[_0x1156('0x57')]?_0x1156('0x59'):_0x1156('0x5a')][_0x1156('0x52')]({'where':{'id':_0x3a8e20[_0x1156('0x57')]?_0x3a8e20[_0x1156('0x57')]:_0x3a8e20[_0x1156('0x58')]},'attributes':['id',_0x1156('0x25')],'raw':!![]});}}})['then'](function(_0x19e61e){var _0x4f08b9={};if(_0x19e61e){_[_0x1156('0x43')](_0x4f08b9,_[_0x1156('0x5b')](_0x39c9c3['dataValues'],['createdAt',_0x1156('0x5c'),'id']));_0x4f08b9[_0x1156('0x5d')]=0x15;_0x4f08b9[_0x1156('0x5e')]=_0x1156('0x5f');_0x4f08b9['campaign']=_0x19e61e[_0x1156('0x25')];_0x4f08b9[_0x1156('0x60')]=_0x14556c['user'][_0x1156('0x25')];_0x4f08b9[_0x1156('0x61')]=_0x14556c[_0x1156('0x62')]['id'];_0x4f08b9[_0x1156('0x5f')]=!![];_0x4f08b9[_0x1156('0x63')]=moment()[_0x1156('0x64')](_0x1156('0x65'));_0x4f08b9[_0x1156('0x66')]=_0x39c9c3[_0x1156('0x67')];_0x4f08b9[_0x1156('0x68')]=_0x39c9c3[_0x1156('0x57')]?_0x1156('0x69'):_0x1156('0x6a');return db[_0x1156('0x6b')]['find']({'where':{'id':_0x4f08b9['ContactId']},'attributes':[_0x1156('0x6c'),_0x1156('0x6d')]})[_0x1156('0x22')](function(_0x3eacc3){if(!_['isNil'](_0x5aaa59)&&!_[_0x1156('0x6e')](_0x3eacc3['firstName'])){_0x4f08b9[_0x1156('0x6f')]=_0x3eacc3[_0x1156('0x6c')];if(!_[_0x1156('0x6e')](_0x3eacc3[_0x1156('0x6d')])){_0x4f08b9[_0x1156('0x6f')]+='\x20'+_0x3eacc3['lastName'];}}})[_0x1156('0x70')](function(){return db['CmHopperFinal'][_0x1156('0x53')](_0x4f08b9);});}})['then'](function(){return _0x5aaa59[_0x1156('0x18')](0xcc)[_0x1156('0x19')]();})[_0x1156('0x4c')](handleError(_0x5aaa59,null));};exports[_0x1156('0x71')]=function(_0x939cc7,_0x275197,_0x2fc6c7){var _0x1c2b5e=[];return db[_0x1156('0x6b')][_0x1156('0x55')]()[_0x1156('0x22')](function(_0x5246e8){_0x1c2b5e=_[_0x1156('0x28')](_0x5246e8);return _0x939cc7[_0x1156('0x62')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x1156('0x72')},'attributes':['id',_0x1156('0x73')],'raw':!![]});})[_0x1156('0x22')](function(_0x499e0a){if(_0x499e0a&&_0x499e0a[_0x1156('0x3d')]){return db['sequelize'][_0x1156('0x74')](function(_0x10ad17){var _0x285da7={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1156('0x64')](_0x1156('0x65'))},'VoiceQueueId':{'$in':_[_0x1156('0x44')](_0x499e0a,'id')},'$or':[{'UserId':null},{'UserId':_0x939cc7['user']['id']}]};var _0x3f0fe2=[];if(_0x939cc7['body'][_0x1156('0x75')]&&_0x939cc7[_0x1156('0x54')][_0x1156('0x75')]===_0x1156('0x76')){if(!_[_0x1156('0x77')](_0x939cc7[_0x1156('0x54')]['hopperIds'])){_0x285da7['id']={'$in':_0x939cc7[_0x1156('0x54')][_0x1156('0x78')]};}_0x3f0fe2=[[_0x1156('0x79'),_0x1156('0x7a')],['scheduledAt',_0x499e0a[0x0][_0x1156('0x73')]==='ASC'?'DESC':_0x1156('0x7a')],db[_0x1156('0x7b')][_0x1156('0x7c')](_0x1156('0x7d')),['id',_0x1156('0x7e')]];}else{if(!_[_0x1156('0x77')](_0x939cc7['body'][_0x1156('0x78')])){_0x285da7['id']={'$notIn':_0x939cc7['body'][_0x1156('0x78')]};}_0x3f0fe2=[[_0x1156('0x79'),_0x1156('0x7e')],[_0x1156('0x7f'),_0x499e0a[0x0]['dialOrderByScheduledAt']],db[_0x1156('0x7b')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x1156('0x7a')]];}return db[_0x1156('0x49')][_0x1156('0x80')]({'attributes':['id',_0x1156('0x81')],'where':_0x285da7,'order':_0x3f0fe2,'transaction':_0x10ad17,'lock':_0x10ad17[_0x1156('0x82')][_0x1156('0x83')],'include':[{'model':db[_0x1156('0x6b')],'as':_0x1156('0x84'),'attributes':_0x1c2b5e,'include':[{'model':db[_0x1156('0x85')],'as':'Company','attributes':['id',_0x1156('0x25')]}]},{'model':db['CmList'],'as':_0x1156('0x86'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x1156('0x25'),'dialActive']}]})[_0x1156('0x22')](function(_0x7f82fe){if(_0x7f82fe){return _0x7f82fe['update']({'UserId':_0x939cc7['user']['id']},{'transaction':_0x10ad17});}});});}})[_0x1156('0x22')](handleEntityNotFound(_0x275197,null))[_0x1156('0x22')](respondWithResult(_0x275197,null))[_0x1156('0x4c')](handleError(_0x275197,null));};exports[_0x1156('0x87')]=function(_0x10973b,_0x567228,_0x4fe0df){return _0x10973b[_0x1156('0x62')][_0x1156('0x88')]({'where':{'type':_0x1156('0x89'),'dialActive':!![],'dialMethod':_0x1156('0x72')},'attributes':['id'],'raw':!![]})[_0x1156('0x22')](function(_0x1ffc7f){if(_0x1ffc7f&&_0x1ffc7f['length']){return db['CmHopper'][_0x1156('0x48')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1156('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x1ffc7f,'id')},'$or':[{'UserId':null},{'UserId':_0x10973b[_0x1156('0x62')]['id']}]}});}return 0x0;})['then'](function(_0x1006a1){if(!_[_0x1156('0x6e')](_0x1006a1)&&_[_0x1156('0x8a')](_0x1006a1)){return _0x567228[_0x1156('0x18')](0xc8)[_0x1156('0x1a')]({'contacts':_0x1006a1});}else{logger[_0x1156('0x23')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1156('0x87'),0x194,_0x1156('0x8b'));_0x567228['sendStatus'](0x194);}})[_0x1156('0x4c')](handleError(_0x567228,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index ef93eae..41e21bd 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 _0x702d=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x2162e0,_0xd18181){var _0x162d05=function(_0x421403){while(--_0x421403){_0x2162e0['push'](_0x2162e0['shift']());}};_0x162d05(++_0xd18181);}(_0x702d,0x147));var _0xd702=function(_0x3950fc,_0x16b3ca){_0x3950fc=_0x3950fc-0x0;var _0x4f46ca=_0x702d[_0x3950fc];return _0x4f46ca;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./cmHopper.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xd702('0xc'),'fields':['scheduledat']},{'name':_0xd702('0xd'),'fields':[_0xd702('0xd')]},{'name':_0xd702('0xe'),'fields':[_0xd702('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e81=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x220609,_0x91204f){var _0x5d6924=function(_0x100c0d){while(--_0x100c0d){_0x220609['push'](_0x220609['shift']());}};_0x5d6924(++_0x91204f);}(_0x4e81,0x1bc));var _0x14e8=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x4e81[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14e8('0x3'));var fs=require('fs');var path=require(_0x14e8('0x4'));var rimraf=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var attributes=require(_0x14e8('0x7'));module[_0x14e8('0x8')]=function(_0x56a266,_0x57c79b){return _0x56a266[_0x14e8('0x9')](_0x14e8('0xa'),attributes,{'tableName':_0x14e8('0xb'),'paranoid':![],'indexes':[{'name':_0x14e8('0xc'),'fields':[_0x14e8('0xc')]},{'name':_0x14e8('0xd'),'fields':[_0x14e8('0xd')]},{'name':_0x14e8('0xe'),'fields':[_0x14e8('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 15e3aa0..8b0451c 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 _0x4ccf=['create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','keys','length','push','all','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','UserId','GetContactRecallMe','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowCmHopper','find','CreateCmHopper'];(function(_0x5cf809,_0x4c7034){var _0x5b8286=function(_0x5944b3){while(--_0x5944b3){_0x5cf809['push'](_0x5cf809['shift']());}};_0x5b8286(++_0x4c7034);}(_0x4ccf,0x167));var _0xf4cc=function(_0x45ac47,_0x3a7416){_0x45ac47=_0x45ac47-0x0;var _0x605141=_0x4ccf[_0x45ac47];return _0x605141;};'use strict';var _=require('lodash');var util=require(_0xf4cc('0x0'));var moment=require(_0xf4cc('0x1'));var BPromise=require(_0xf4cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4cc('0x3'));var db=require(_0xf4cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4cc('0x5'))(_0xf4cc('0x6'));var config=require(_0xf4cc('0x7'));var jayson=require(_0xf4cc('0x8'));var client=jayson[_0xf4cc('0x9')][_0xf4cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cd173,_0xba8a8b,_0x5322a3){return new BPromise(function(_0x4c4cdd,_0x1569d3){return client[_0xf4cc('0xb')](_0x5cd173,_0x5322a3)['then'](function(_0x3d7b2f){logger[_0xf4cc('0xc')](_0xf4cc('0xd'),_0xba8a8b,_0xf4cc('0xe'));logger[_0xf4cc('0xf')](_0xf4cc('0x10'),_0xba8a8b,_0xf4cc('0xe'),JSON[_0xf4cc('0x11')](_0x3d7b2f));if(_0x3d7b2f['error']){if(_0x3d7b2f[_0xf4cc('0x12')]['code']===0x1f4){logger[_0xf4cc('0x12')]('CmHopper,\x20%s,\x20%s',_0xba8a8b,_0x3d7b2f['error']['message']);return _0x1569d3(_0x3d7b2f[_0xf4cc('0x12')][_0xf4cc('0x13')]);}logger[_0xf4cc('0x12')](_0xf4cc('0xd'),_0xba8a8b,_0x3d7b2f['error'][_0xf4cc('0x13')]);return _0x4c4cdd(_0x3d7b2f[_0xf4cc('0x12')][_0xf4cc('0x13')]);}else{logger[_0xf4cc('0xc')](_0xf4cc('0xd'),_0xba8a8b,_0xf4cc('0xe'));_0x4c4cdd(_0x3d7b2f[_0xf4cc('0x14')][_0xf4cc('0x13')]);}})[_0xf4cc('0x15')](function(_0x296040){logger[_0xf4cc('0x12')]('CmHopper,\x20%s,\x20%s',_0xba8a8b,_0x296040);_0x1569d3(_0x296040);});});}exports[_0xf4cc('0x16')]=function(_0x5d1d83){var _0x1e590b=this;return new Promise(function(_0x2f8306,_0x53e345){return db[_0xf4cc('0x17')][_0xf4cc('0x18')]({'raw':_0x5d1d83['options']?_0x5d1d83[_0xf4cc('0x19')][_0xf4cc('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d1d83[_0xf4cc('0x19')]?_0x5d1d83[_0xf4cc('0x19')][_0xf4cc('0x1b')]||null:null,'attributes':_0x5d1d83['options']?_0x5d1d83['options'][_0xf4cc('0x1c')]||null:null,'limit':_0x5d1d83[_0xf4cc('0x19')]?_0x5d1d83['options'][_0xf4cc('0x1d')]||null:null,'include':_0x5d1d83[_0xf4cc('0x19')]?_0x5d1d83[_0xf4cc('0x19')][_0xf4cc('0x1e')]?_['map'](_0x5d1d83[_0xf4cc('0x19')][_0xf4cc('0x1e')],function(_0x57f2a5){return{'model':db[_0x57f2a5[_0xf4cc('0x1f')]],'as':_0x57f2a5['as'],'attributes':_0x57f2a5[_0xf4cc('0x1c')],'include':_0x57f2a5[_0xf4cc('0x1e')]?_['map'](_0x57f2a5['include'],function(_0x4b040d){return{'model':db[_0x4b040d['model']],'as':_0x4b040d['as'],'attributes':_0x4b040d[_0xf4cc('0x1c')],'include':_0x4b040d['include']?_[_0xf4cc('0x20')](_0x4b040d['include'],function(_0x5b78ab){return{'model':db[_0x5b78ab[_0xf4cc('0x1f')]],'as':_0x5b78ab['as'],'attributes':_0x5b78ab[_0xf4cc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf4cc('0x21')](function(_0x16c380){logger[_0xf4cc('0xc')](_0xf4cc('0x16'),_0x5d1d83);logger[_0xf4cc('0xf')]('GetCmHopper',_0x5d1d83,JSON[_0xf4cc('0x11')](_0x16c380));_0x2f8306(_0x16c380);})[_0xf4cc('0x15')](function(_0x40f610){logger[_0xf4cc('0x12')](_0xf4cc('0x16'),_0x40f610[_0xf4cc('0x13')],_0x5d1d83);_0x53e345(_0x1e590b['error'](0x1f4,_0x40f610['message']));});});};exports[_0xf4cc('0x22')]=function(_0x4a717e){var _0x3e81c6=this;return new Promise(function(_0x39698d,_0x4533fa){return db['CmHopper'][_0xf4cc('0x23')]({'raw':_0x4a717e[_0xf4cc('0x19')]?_0x4a717e['options'][_0xf4cc('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a717e[_0xf4cc('0x19')]?_0x4a717e[_0xf4cc('0x19')]['where']||null:null,'attributes':_0x4a717e[_0xf4cc('0x19')]?_0x4a717e[_0xf4cc('0x19')]['attributes']||null:null,'include':_0x4a717e[_0xf4cc('0x19')]?_0x4a717e[_0xf4cc('0x19')]['include']?_[_0xf4cc('0x20')](_0x4a717e[_0xf4cc('0x19')][_0xf4cc('0x1e')],function(_0x2bb41f){return{'model':db[_0x2bb41f[_0xf4cc('0x1f')]],'as':_0x2bb41f['as'],'attributes':_0x2bb41f[_0xf4cc('0x1c')],'include':_0x2bb41f[_0xf4cc('0x1e')]?_[_0xf4cc('0x20')](_0x2bb41f['include'],function(_0x3e44fd){return{'model':db[_0x3e44fd['model']],'as':_0x3e44fd['as'],'attributes':_0x3e44fd['attributes'],'include':_0x3e44fd[_0xf4cc('0x1e')]?_[_0xf4cc('0x20')](_0x3e44fd[_0xf4cc('0x1e')],function(_0x499df0){return{'model':db[_0x499df0[_0xf4cc('0x1f')]],'as':_0x499df0['as'],'attributes':_0x499df0[_0xf4cc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf4cc('0x21')](function(_0x940ee0){logger[_0xf4cc('0xc')](_0xf4cc('0x22'),_0x4a717e);logger[_0xf4cc('0xf')]('ShowCmHopper',_0x4a717e,JSON[_0xf4cc('0x11')](_0x940ee0));_0x39698d(_0x940ee0);})[_0xf4cc('0x15')](function(_0x1b5d8d){logger[_0xf4cc('0x12')](_0xf4cc('0x22'),_0x1b5d8d['message'],_0x4a717e);_0x4533fa(_0x3e81c6[_0xf4cc('0x12')](0x1f4,_0x1b5d8d[_0xf4cc('0x13')]));});});};exports[_0xf4cc('0x24')]=function(_0x55bccd){var _0x235578=this;return new Promise(function(_0x5131ce,_0x323660){return db[_0xf4cc('0x17')][_0xf4cc('0x25')](_0x55bccd[_0xf4cc('0x26')],{'raw':_0x55bccd[_0xf4cc('0x19')]?_0x55bccd[_0xf4cc('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xf4cc('0x21')](function(_0x36d62c){logger[_0xf4cc('0xc')](_0xf4cc('0x24'),_0x55bccd);logger['debug'](_0xf4cc('0x24'),_0x55bccd,JSON[_0xf4cc('0x11')](_0x36d62c));_0x5131ce(_0x36d62c);})['catch'](function(_0x5ca204){logger[_0xf4cc('0x12')](_0xf4cc('0x24'),_0x5ca204['message'],_0x55bccd);_0x323660(_0x235578[_0xf4cc('0x12')](0x1f4,_0x5ca204['message']));});});};exports['UpdateCmHopper']=function(_0x5415f0){var _0xc81b4a=this;return new Promise(function(_0x22a177,_0xa8d1ae){return db['CmHopper'][_0xf4cc('0x27')](_0x5415f0[_0xf4cc('0x26')],{'raw':_0x5415f0['options']?_0x5415f0[_0xf4cc('0x19')][_0xf4cc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5415f0[_0xf4cc('0x19')]?_0x5415f0['options'][_0xf4cc('0x1b')]||null:null,'attributes':_0x5415f0['options']?_0x5415f0[_0xf4cc('0x19')][_0xf4cc('0x1c')]||null:null,'limit':_0x5415f0['options']?_0x5415f0[_0xf4cc('0x19')][_0xf4cc('0x1d')]||null:null})[_0xf4cc('0x21')](function(_0x1d33e0){logger['info'](_0xf4cc('0x28'),_0x5415f0);logger['debug']('UpdateCmHopper',_0x5415f0,JSON[_0xf4cc('0x11')](_0x1d33e0));_0x22a177(_0x1d33e0);})['catch'](function(_0x4e5d6c){logger[_0xf4cc('0x12')](_0xf4cc('0x28'),_0x4e5d6c[_0xf4cc('0x13')],_0x5415f0);_0xa8d1ae(_0xc81b4a['error'](0x1f4,_0x4e5d6c[_0xf4cc('0x13')]));});});};exports[_0xf4cc('0x29')]=function(_0x31ceba){var _0x2fb570=this;return new Promise(function(_0x4a9671,_0x209fc0){return db[_0xf4cc('0x17')][_0xf4cc('0x2a')]({'where':_0x31ceba[_0xf4cc('0x19')]?_0x31ceba[_0xf4cc('0x19')][_0xf4cc('0x1b')]||null:null})[_0xf4cc('0x21')](function(_0x307a38){logger[_0xf4cc('0xc')](_0xf4cc('0x29'),_0x31ceba);logger[_0xf4cc('0xf')](_0xf4cc('0x29'),_0x31ceba,JSON[_0xf4cc('0x11')](_0x307a38));_0x4a9671(_0x307a38);})[_0xf4cc('0x15')](function(_0x36ed5a){logger[_0xf4cc('0x12')]('DestroyCmHopper',_0x36ed5a[_0xf4cc('0x13')],_0x31ceba);_0x209fc0(_0x2fb570[_0xf4cc('0x12')](0x1f4,_0x36ed5a[_0xf4cc('0x13')]));});});};exports[_0xf4cc('0x2b')]=function(_0x5a1680){var _0x4006f4=this;return new Promise(function(_0x24b21d,_0x22e8de){return db[_0xf4cc('0x2c')][_0xf4cc('0x2d')]()[_0xf4cc('0x21')](function(_0x35552b){return db[_0xf4cc('0x2e')][_0xf4cc('0x2f')](function(_0x9878bc){return db[_0xf4cc('0x17')][_0xf4cc('0x18')]({'where':_0x5a1680['options']?_0x5a1680[_0xf4cc('0x19')][_0xf4cc('0x1b')]||null:null,'attributes':_0x5a1680[_0xf4cc('0x19')]?_0x5a1680['options'][_0xf4cc('0x1c')]||null:null,'limit':_0x5a1680[_0xf4cc('0x19')]?_0x5a1680[_0xf4cc('0x19')][_0xf4cc('0x1d')]||null:null,'order':_0x5a1680[_0xf4cc('0x19')]?_0x5a1680[_0xf4cc('0x19')]['order']||null:null,'transaction':_0x9878bc,'lock':_0x9878bc[_0xf4cc('0x30')][_0xf4cc('0x31')],'include':[{'model':db[_0xf4cc('0x2c')],'as':_0xf4cc('0x32'),'attributes':_[_0xf4cc('0x33')](_0x35552b)}]})[_0xf4cc('0x21')](function(_0x4a93c5){var _0xf2ec87=[];for(var _0x4db45c=0x0;_0x4db45c<_0x4a93c5[_0xf4cc('0x34')];_0x4db45c+=0x1){_0xf2ec87[_0xf4cc('0x35')](_0x4a93c5[_0x4db45c][_0xf4cc('0x27')](_0x5a1680[_0xf4cc('0x26')],{'transaction':_0x9878bc}));}return BPromise[_0xf4cc('0x36')](_0xf2ec87);});})[_0xf4cc('0x21')](function(_0x3ad422){logger['info'](_0xf4cc('0x2b'),_0x5a1680);logger['debug'](_0xf4cc('0x2b'),_0x5a1680,JSON[_0xf4cc('0x11')](_0x3ad422));_0x24b21d(_0x3ad422);})[_0xf4cc('0x15')](function(_0x1f811c){logger[_0xf4cc('0x12')]('GetContactDialer',_0x1f811c['message'],_0x5a1680);_0x22e8de(_0x4006f4[_0xf4cc('0x12')](0x1f4,_0x1f811c[_0xf4cc('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x165a67){var _0x38c3c6=this;return new Promise(function(_0x51a78d,_0x5329e8){return db[_0xf4cc('0x2e')][_0xf4cc('0x2f')](function(_0x47423a){return db[_0xf4cc('0x37')]['create'](_0x165a67[_0xf4cc('0x26')],{'raw':_0x165a67[_0xf4cc('0x19')]?_0x165a67[_0xf4cc('0x19')][_0xf4cc('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x47423a})[_0xf4cc('0x21')](function(){return db[_0xf4cc('0x17')]['destroy']({'where':_0x165a67['options']?_0x165a67[_0xf4cc('0x19')][_0xf4cc('0x1b')]||null:null,'transaction':_0x47423a});});})[_0xf4cc('0x21')](function(_0x41bbef){logger[_0xf4cc('0xc')](_0xf4cc('0x38'),_0x165a67);logger[_0xf4cc('0xf')]('MoveContactManagedDialer',_0x165a67,JSON['stringify'](_0x41bbef));_0x51a78d(_0x41bbef);})[_0xf4cc('0x15')](function(_0xbaca9f){logger[_0xf4cc('0x12')](_0xf4cc('0x38'),_0xbaca9f[_0xf4cc('0x13')],_0x165a67);_0x5329e8(_0x38c3c6['error'](0x1f4,_0xbaca9f[_0xf4cc('0x13')]));});});};exports[_0xf4cc('0x39')]=function(_0x31c3aa){var _0xcec9c0=this;return new Promise(function(_0x3d97a4,_0x213711){return db['CmHopper'][_0xf4cc('0x18')]({'raw':_0x31c3aa[_0xf4cc('0x19')]?_0x31c3aa['options'][_0xf4cc('0x1a')]===undefined?!![]:![]:!![],'where':_0x31c3aa[_0xf4cc('0x19')]?_0x31c3aa[_0xf4cc('0x19')][_0xf4cc('0x1b')]||null:null,'attributes':[[db[_0xf4cc('0x2e')]['fn']('COUNT',db[_0xf4cc('0x2e')]['fn']('IF',db[_0xf4cc('0x2e')][_0xf4cc('0x3a')](_0xf4cc('0x3b')+util[_0xf4cc('0x3c')](_0xf4cc('0x3d'),moment()[_0xf4cc('0x3c')](_0xf4cc('0x3e')))+_0xf4cc('0x3f')))),'contactsRescheduled']]})['then'](function(_0x5bf0df){logger[_0xf4cc('0xc')]('CountReScheduled',_0x31c3aa);logger['debug'](_0xf4cc('0x39'),_0x31c3aa,JSON[_0xf4cc('0x11')](_0x5bf0df));_0x3d97a4(_0x5bf0df);})[_0xf4cc('0x15')](function(_0x26cbb7){logger[_0xf4cc('0x12')](_0xf4cc('0x39'),_0x26cbb7[_0xf4cc('0x13')],_0x31c3aa);_0x213711(_0xcec9c0[_0xf4cc('0x12')](0x1f4,_0x26cbb7[_0xf4cc('0x13')]));});});};exports['GetContactRecallMe']=function(_0x29958f){var _0x110d95=this;return new Promise(function(_0xa6988b,_0xb7d2b3){return db[_0xf4cc('0x2c')]['describe']()[_0xf4cc('0x21')](function(_0x402592){return db[_0xf4cc('0x2e')][_0xf4cc('0x2f')](function(_0x1b1d1c){return db[_0xf4cc('0x17')][_0xf4cc('0x18')]({'where':_0x29958f[_0xf4cc('0x19')]?_0x29958f[_0xf4cc('0x19')][_0xf4cc('0x1b')]||null:null,'attributes':_0x29958f[_0xf4cc('0x19')]?_0x29958f[_0xf4cc('0x19')]['attributes']||null:null,'limit':0x1,'order':_0x29958f[_0xf4cc('0x19')]?_0x29958f[_0xf4cc('0x19')]['order']||null:null,'group':db[_0xf4cc('0x17')][_0xf4cc('0x40')],'transaction':_0x1b1d1c,'lock':_0x1b1d1c[_0xf4cc('0x30')][_0xf4cc('0x31')],'include':_0x29958f[_0xf4cc('0x19')]?_0x29958f['options'][_0xf4cc('0x1e')]?_[_0xf4cc('0x20')](_0x29958f[_0xf4cc('0x19')]['include'],function(_0x777803){return{'model':db[_0x777803[_0xf4cc('0x1f')]],'as':_0x777803['as'],'attributes':_0x777803['attributes'],'include':_0x777803[_0xf4cc('0x1e')]?_[_0xf4cc('0x20')](_0x777803[_0xf4cc('0x1e')],function(_0x1cc97e){return{'model':db[_0x1cc97e[_0xf4cc('0x1f')]],'as':_0x1cc97e['as'],'attributes':_0x1cc97e['attributes'],'include':_0x1cc97e[_0xf4cc('0x1e')]?_['map'](_0x1cc97e[_0xf4cc('0x1e')],function(_0x155c4b){return{'model':db[_0x155c4b[_0xf4cc('0x1f')]],'as':_0x155c4b['as'],'attributes':_0x155c4b[_0xf4cc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf4cc('0x21')](function(_0x18dfec){var _0x37c5e5=[];for(var _0x4bf24f=0x0;_0x4bf24f<_0x18dfec['length'];_0x4bf24f+=0x1){_0x37c5e5[_0xf4cc('0x35')](_0x18dfec[_0x4bf24f]['update'](_0x29958f[_0xf4cc('0x26')],{'transaction':_0x1b1d1c}));}return BPromise[_0xf4cc('0x36')](_0x37c5e5);});})['then'](function(_0x13b097){logger[_0xf4cc('0xc')](_0xf4cc('0x41'),_0x29958f);logger[_0xf4cc('0xf')](_0xf4cc('0x41'),_0x29958f,JSON[_0xf4cc('0x11')](_0x13b097));_0xa6988b(_0x13b097);})[_0xf4cc('0x15')](function(_0x165348){logger[_0xf4cc('0x12')](_0xf4cc('0x41'),_0x165348['message'],_0x29958f);_0xb7d2b3(_0x110d95['error'](0x1f4,_0x165348[_0xf4cc('0x13')]));});});});}; \ No newline at end of file +var _0xbda7=['stringify','error','code','message','result','catch','CmHopper','findAll','options','raw','where','attributes','include','map','model','GetCmHopper','ShowCmHopper','find','create','body','then','CreateCmHopper','UpdateCmHopper','update','limit','DestroyCmHopper','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','UserId','length','push','GetContactRecallMe','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45afc4,_0xeaa0e3){var _0x43e32b=function(_0x4fa1b0){while(--_0x4fa1b0){_0x45afc4['push'](_0x45afc4['shift']());}};_0x43e32b(++_0xeaa0e3);}(_0xbda7,0xfa));var _0x7bda=function(_0x121ace,_0x2dbda2){_0x121ace=_0x121ace-0x0;var _0x3e7bc5=_0xbda7[_0x121ace];return _0x3e7bc5;};'use strict';var _=require(_0x7bda('0x0'));var util=require('util');var moment=require(_0x7bda('0x1'));var BPromise=require(_0x7bda('0x2'));var rs=require(_0x7bda('0x3'));var fs=require('fs');var Redis=require(_0x7bda('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7bda('0x5'))(_0x7bda('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7bda('0x7')][_0x7bda('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30276f,_0x5509ea,_0x5b11d4){return new BPromise(function(_0x7a74a8,_0x4ec9d4){return client[_0x7bda('0x9')](_0x30276f,_0x5b11d4)['then'](function(_0x6bb142){logger[_0x7bda('0xa')](_0x7bda('0xb'),_0x5509ea,_0x7bda('0xc'));logger[_0x7bda('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5509ea,'request\x20sent',JSON[_0x7bda('0xe')](_0x6bb142));if(_0x6bb142[_0x7bda('0xf')]){if(_0x6bb142[_0x7bda('0xf')][_0x7bda('0x10')]===0x1f4){logger[_0x7bda('0xf')]('CmHopper,\x20%s,\x20%s',_0x5509ea,_0x6bb142[_0x7bda('0xf')][_0x7bda('0x11')]);return _0x4ec9d4(_0x6bb142['error'][_0x7bda('0x11')]);}logger[_0x7bda('0xf')](_0x7bda('0xb'),_0x5509ea,_0x6bb142[_0x7bda('0xf')][_0x7bda('0x11')]);return _0x7a74a8(_0x6bb142['error'][_0x7bda('0x11')]);}else{logger[_0x7bda('0xa')](_0x7bda('0xb'),_0x5509ea,_0x7bda('0xc'));_0x7a74a8(_0x6bb142[_0x7bda('0x12')][_0x7bda('0x11')]);}})[_0x7bda('0x13')](function(_0x1124e8){logger['error'](_0x7bda('0xb'),_0x5509ea,_0x1124e8);_0x4ec9d4(_0x1124e8);});});}exports['GetCmHopper']=function(_0x55a02a){var _0x4a098d=this;return new Promise(function(_0x253c16,_0x54e704){return db[_0x7bda('0x14')][_0x7bda('0x15')]({'raw':_0x55a02a[_0x7bda('0x16')]?_0x55a02a[_0x7bda('0x16')][_0x7bda('0x17')]===undefined?!![]:![]:!![],'where':_0x55a02a[_0x7bda('0x16')]?_0x55a02a[_0x7bda('0x16')][_0x7bda('0x18')]||null:null,'attributes':_0x55a02a[_0x7bda('0x16')]?_0x55a02a[_0x7bda('0x16')][_0x7bda('0x19')]||null:null,'limit':_0x55a02a['options']?_0x55a02a[_0x7bda('0x16')]['limit']||null:null,'include':_0x55a02a[_0x7bda('0x16')]?_0x55a02a[_0x7bda('0x16')][_0x7bda('0x1a')]?_[_0x7bda('0x1b')](_0x55a02a[_0x7bda('0x16')][_0x7bda('0x1a')],function(_0x501bad){return{'model':db[_0x501bad['model']],'as':_0x501bad['as'],'attributes':_0x501bad[_0x7bda('0x19')],'include':_0x501bad[_0x7bda('0x1a')]?_['map'](_0x501bad[_0x7bda('0x1a')],function(_0x1a9558){return{'model':db[_0x1a9558[_0x7bda('0x1c')]],'as':_0x1a9558['as'],'attributes':_0x1a9558[_0x7bda('0x19')],'include':_0x1a9558[_0x7bda('0x1a')]?_['map'](_0x1a9558['include'],function(_0x57a039){return{'model':db[_0x57a039['model']],'as':_0x57a039['as'],'attributes':_0x57a039[_0x7bda('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd69f55){logger['info']('GetCmHopper',_0x55a02a);logger[_0x7bda('0xd')](_0x7bda('0x1d'),_0x55a02a,JSON['stringify'](_0xd69f55));_0x253c16(_0xd69f55);})[_0x7bda('0x13')](function(_0x49d07b){logger[_0x7bda('0xf')](_0x7bda('0x1d'),_0x49d07b[_0x7bda('0x11')],_0x55a02a);_0x54e704(_0x4a098d[_0x7bda('0xf')](0x1f4,_0x49d07b[_0x7bda('0x11')]));});});};exports[_0x7bda('0x1e')]=function(_0x2d7c76){var _0x309421=this;return new Promise(function(_0x2c0261,_0x409381){return db[_0x7bda('0x14')][_0x7bda('0x1f')]({'raw':_0x2d7c76[_0x7bda('0x16')]?_0x2d7c76[_0x7bda('0x16')][_0x7bda('0x17')]===undefined?!![]:![]:!![],'where':_0x2d7c76[_0x7bda('0x16')]?_0x2d7c76[_0x7bda('0x16')][_0x7bda('0x18')]||null:null,'attributes':_0x2d7c76[_0x7bda('0x16')]?_0x2d7c76['options']['attributes']||null:null,'include':_0x2d7c76['options']?_0x2d7c76['options'][_0x7bda('0x1a')]?_[_0x7bda('0x1b')](_0x2d7c76[_0x7bda('0x16')]['include'],function(_0x1f1160){return{'model':db[_0x1f1160[_0x7bda('0x1c')]],'as':_0x1f1160['as'],'attributes':_0x1f1160['attributes'],'include':_0x1f1160[_0x7bda('0x1a')]?_[_0x7bda('0x1b')](_0x1f1160['include'],function(_0x505031){return{'model':db[_0x505031[_0x7bda('0x1c')]],'as':_0x505031['as'],'attributes':_0x505031['attributes'],'include':_0x505031[_0x7bda('0x1a')]?_['map'](_0x505031[_0x7bda('0x1a')],function(_0x34210a){return{'model':db[_0x34210a[_0x7bda('0x1c')]],'as':_0x34210a['as'],'attributes':_0x34210a[_0x7bda('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb44ca8){logger[_0x7bda('0xa')]('ShowCmHopper',_0x2d7c76);logger[_0x7bda('0xd')](_0x7bda('0x1e'),_0x2d7c76,JSON[_0x7bda('0xe')](_0xb44ca8));_0x2c0261(_0xb44ca8);})[_0x7bda('0x13')](function(_0x1f1ad8){logger[_0x7bda('0xf')]('ShowCmHopper',_0x1f1ad8[_0x7bda('0x11')],_0x2d7c76);_0x409381(_0x309421['error'](0x1f4,_0x1f1ad8[_0x7bda('0x11')]));});});};exports['CreateCmHopper']=function(_0x27a7d8){var _0x5ea12c=this;return new Promise(function(_0x535398,_0x2250a2){return db[_0x7bda('0x14')][_0x7bda('0x20')](_0x27a7d8[_0x7bda('0x21')],{'raw':_0x27a7d8['options']?_0x27a7d8[_0x7bda('0x16')][_0x7bda('0x17')]===undefined?!![]:![]:!![]})[_0x7bda('0x22')](function(_0x163f35){logger[_0x7bda('0xa')](_0x7bda('0x23'),_0x27a7d8);logger[_0x7bda('0xd')](_0x7bda('0x23'),_0x27a7d8,JSON['stringify'](_0x163f35));_0x535398(_0x163f35);})[_0x7bda('0x13')](function(_0x351260){logger[_0x7bda('0xf')](_0x7bda('0x23'),_0x351260[_0x7bda('0x11')],_0x27a7d8);_0x2250a2(_0x5ea12c[_0x7bda('0xf')](0x1f4,_0x351260[_0x7bda('0x11')]));});});};exports[_0x7bda('0x24')]=function(_0x5e8731){var _0x580356=this;return new Promise(function(_0x42d4d2,_0x46060b){return db[_0x7bda('0x14')][_0x7bda('0x25')](_0x5e8731[_0x7bda('0x21')],{'raw':_0x5e8731[_0x7bda('0x16')]?_0x5e8731[_0x7bda('0x16')][_0x7bda('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e8731['options']?_0x5e8731[_0x7bda('0x16')][_0x7bda('0x18')]||null:null,'attributes':_0x5e8731[_0x7bda('0x16')]?_0x5e8731[_0x7bda('0x16')][_0x7bda('0x19')]||null:null,'limit':_0x5e8731[_0x7bda('0x16')]?_0x5e8731[_0x7bda('0x16')][_0x7bda('0x26')]||null:null})['then'](function(_0x4bd5bb){logger['info'](_0x7bda('0x24'),_0x5e8731);logger['debug']('UpdateCmHopper',_0x5e8731,JSON[_0x7bda('0xe')](_0x4bd5bb));_0x42d4d2(_0x4bd5bb);})[_0x7bda('0x13')](function(_0x3aae74){logger['error'](_0x7bda('0x24'),_0x3aae74[_0x7bda('0x11')],_0x5e8731);_0x46060b(_0x580356[_0x7bda('0xf')](0x1f4,_0x3aae74[_0x7bda('0x11')]));});});};exports[_0x7bda('0x27')]=function(_0x1668b2){var _0x152dbf=this;return new Promise(function(_0x522e5a,_0x31b7b2){return db[_0x7bda('0x14')]['destroy']({'where':_0x1668b2[_0x7bda('0x16')]?_0x1668b2[_0x7bda('0x16')][_0x7bda('0x18')]||null:null})[_0x7bda('0x22')](function(_0x4dab62){logger[_0x7bda('0xa')]('DestroyCmHopper',_0x1668b2);logger[_0x7bda('0xd')](_0x7bda('0x27'),_0x1668b2,JSON[_0x7bda('0xe')](_0x4dab62));_0x522e5a(_0x4dab62);})['catch'](function(_0x262034){logger[_0x7bda('0xf')](_0x7bda('0x27'),_0x262034[_0x7bda('0x11')],_0x1668b2);_0x31b7b2(_0x152dbf['error'](0x1f4,_0x262034['message']));});});};exports['GetContactDialer']=function(_0x16bdf0){var _0x3e371c=this;return new Promise(function(_0x249049,_0x155a44){return db[_0x7bda('0x28')][_0x7bda('0x29')]()[_0x7bda('0x22')](function(_0x29a484){return db[_0x7bda('0x2a')][_0x7bda('0x2b')](function(_0x2fd01a){return db['CmHopper'][_0x7bda('0x15')]({'where':_0x16bdf0[_0x7bda('0x16')]?_0x16bdf0[_0x7bda('0x16')]['where']||null:null,'attributes':_0x16bdf0['options']?_0x16bdf0[_0x7bda('0x16')]['attributes']||null:null,'limit':_0x16bdf0['options']?_0x16bdf0[_0x7bda('0x16')]['limit']||null:null,'order':_0x16bdf0[_0x7bda('0x16')]?_0x16bdf0[_0x7bda('0x16')][_0x7bda('0x2c')]||null:null,'transaction':_0x2fd01a,'lock':_0x2fd01a[_0x7bda('0x2d')][_0x7bda('0x2e')],'include':[{'model':db[_0x7bda('0x28')],'as':_0x7bda('0x2f'),'attributes':_[_0x7bda('0x30')](_0x29a484)}]})[_0x7bda('0x22')](function(_0xf8e618){var _0x1495e0=[];for(var _0x137c6b=0x0;_0x137c6b<_0xf8e618['length'];_0x137c6b+=0x1){_0x1495e0['push'](_0xf8e618[_0x137c6b][_0x7bda('0x25')](_0x16bdf0['body'],{'transaction':_0x2fd01a}));}return BPromise[_0x7bda('0x31')](_0x1495e0);});})[_0x7bda('0x22')](function(_0x138f48){logger[_0x7bda('0xa')](_0x7bda('0x32'),_0x16bdf0);logger['debug'](_0x7bda('0x32'),_0x16bdf0,JSON[_0x7bda('0xe')](_0x138f48));_0x249049(_0x138f48);})[_0x7bda('0x13')](function(_0x220cf4){logger[_0x7bda('0xf')](_0x7bda('0x32'),_0x220cf4[_0x7bda('0x11')],_0x16bdf0);_0x155a44(_0x3e371c[_0x7bda('0xf')](0x1f4,_0x220cf4[_0x7bda('0x11')]));});});});};exports[_0x7bda('0x33')]=function(_0x3fc470){var _0x4a3ca4=this;return new Promise(function(_0x2000d8,_0xf06b2a){return db[_0x7bda('0x2a')][_0x7bda('0x2b')](function(_0x54e75c){return db[_0x7bda('0x34')]['create'](_0x3fc470['body'],{'raw':_0x3fc470[_0x7bda('0x16')]?_0x3fc470[_0x7bda('0x16')][_0x7bda('0x17')]===undefined?!![]:![]:!![],'transaction':_0x54e75c})[_0x7bda('0x22')](function(){return db['CmHopper'][_0x7bda('0x35')]({'where':_0x3fc470[_0x7bda('0x16')]?_0x3fc470[_0x7bda('0x16')]['where']||null:null,'transaction':_0x54e75c});});})[_0x7bda('0x22')](function(_0x41c45e){logger['info'](_0x7bda('0x33'),_0x3fc470);logger[_0x7bda('0xd')](_0x7bda('0x33'),_0x3fc470,JSON[_0x7bda('0xe')](_0x41c45e));_0x2000d8(_0x41c45e);})[_0x7bda('0x13')](function(_0x11e053){logger[_0x7bda('0xf')]('MoveContactManagedDialer',_0x11e053[_0x7bda('0x11')],_0x3fc470);_0xf06b2a(_0x4a3ca4[_0x7bda('0xf')](0x1f4,_0x11e053['message']));});});};exports[_0x7bda('0x36')]=function(_0x3d554d){var _0x1fa728=this;return new Promise(function(_0x1d2833,_0x49a6eb){return db[_0x7bda('0x14')][_0x7bda('0x15')]({'raw':_0x3d554d[_0x7bda('0x16')]?_0x3d554d['options'][_0x7bda('0x17')]===undefined?!![]:![]:!![],'where':_0x3d554d[_0x7bda('0x16')]?_0x3d554d[_0x7bda('0x16')][_0x7bda('0x18')]||null:null,'attributes':[[db[_0x7bda('0x2a')]['fn'](_0x7bda('0x37'),db[_0x7bda('0x2a')]['fn']('IF',db[_0x7bda('0x2a')][_0x7bda('0x38')](_0x7bda('0x39')+util[_0x7bda('0x3a')](_0x7bda('0x3b'),moment()[_0x7bda('0x3a')](_0x7bda('0x3c')))+'\x20,\x201,\x20null'))),_0x7bda('0x3d')]]})['then'](function(_0x57d74a){logger[_0x7bda('0xa')](_0x7bda('0x36'),_0x3d554d);logger['debug'](_0x7bda('0x36'),_0x3d554d,JSON[_0x7bda('0xe')](_0x57d74a));_0x1d2833(_0x57d74a);})[_0x7bda('0x13')](function(_0x1d8213){logger[_0x7bda('0xf')]('CountReScheduled',_0x1d8213[_0x7bda('0x11')],_0x3d554d);_0x49a6eb(_0x1fa728[_0x7bda('0xf')](0x1f4,_0x1d8213[_0x7bda('0x11')]));});});};exports['GetContactRecallMe']=function(_0x4e51c3){var _0x4e5471=this;return new Promise(function(_0xd925bb,_0x4ad6f4){return db[_0x7bda('0x28')]['describe']()[_0x7bda('0x22')](function(_0x4f76c8){return db[_0x7bda('0x2a')][_0x7bda('0x2b')](function(_0x273968){return db[_0x7bda('0x14')][_0x7bda('0x15')]({'where':_0x4e51c3['options']?_0x4e51c3['options']['where']||null:null,'attributes':_0x4e51c3[_0x7bda('0x16')]?_0x4e51c3[_0x7bda('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x4e51c3[_0x7bda('0x16')]?_0x4e51c3[_0x7bda('0x16')][_0x7bda('0x2c')]||null:null,'group':db['CmHopper'][_0x7bda('0x3e')],'transaction':_0x273968,'lock':_0x273968[_0x7bda('0x2d')][_0x7bda('0x2e')],'include':_0x4e51c3['options']?_0x4e51c3[_0x7bda('0x16')][_0x7bda('0x1a')]?_['map'](_0x4e51c3['options'][_0x7bda('0x1a')],function(_0x2ea34d){return{'model':db[_0x2ea34d['model']],'as':_0x2ea34d['as'],'attributes':_0x2ea34d['attributes'],'include':_0x2ea34d['include']?_['map'](_0x2ea34d[_0x7bda('0x1a')],function(_0x4667ce){return{'model':db[_0x4667ce['model']],'as':_0x4667ce['as'],'attributes':_0x4667ce[_0x7bda('0x19')],'include':_0x4667ce['include']?_[_0x7bda('0x1b')](_0x4667ce[_0x7bda('0x1a')],function(_0x256846){return{'model':db[_0x256846[_0x7bda('0x1c')]],'as':_0x256846['as'],'attributes':_0x256846['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e30ea){var _0x3a18bf=[];for(var _0x3e773d=0x0;_0x3e773d<_0x5e30ea[_0x7bda('0x3f')];_0x3e773d+=0x1){_0x3a18bf[_0x7bda('0x40')](_0x5e30ea[_0x3e773d][_0x7bda('0x25')](_0x4e51c3[_0x7bda('0x21')],{'transaction':_0x273968}));}return BPromise[_0x7bda('0x31')](_0x3a18bf);});})[_0x7bda('0x22')](function(_0x1fe4bb){logger['info']('GetContactRecallMe',_0x4e51c3);logger[_0x7bda('0xd')](_0x7bda('0x41'),_0x4e51c3,JSON[_0x7bda('0xe')](_0x1fe4bb));_0xd925bb(_0x1fe4bb);})['catch'](function(_0x3b8ebb){logger['error'](_0x7bda('0x41'),_0x3b8ebb['message'],_0x4e51c3);_0x4ad6f4(_0x4e5471['error'](0x1f4,_0x3b8ebb[_0x7bda('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c33d781..a7d8a28 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 _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x2ce053,_0x2d725b){var _0x46e730=function(_0x4784eb){while(--_0x4784eb){_0x2ce053['push'](_0x2ce053['shift']());}};_0x46e730(++_0x2d725b);}(_0x7a54,0x106));var _0x47a5=function(_0x50b3db,_0x5cdd6a){_0x50b3db=_0x50b3db-0x0;var _0x5a652b=_0x7a54[_0x50b3db];return _0x5a652b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 96593c0..159726e 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 _0x1810=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x596d38,_0x41a79e){var _0x3f7219=function(_0x4ffb7e){while(--_0x4ffb7e){_0x596d38['push'](_0x596d38['shift']());}};_0x3f7219(++_0x41a79e);}(_0x1810,0x1cc));var _0x0181=function(_0x39f375,_0x3aa8ec){_0x39f375=_0x39f375-0x0;var _0x463f93=_0x1810[_0x39f375];return _0x463f93;};'use strict';var moment=require(_0x0181('0x0'));var Sequelize=require('sequelize');module[_0x0181('0x1')]={'phone':{'type':Sequelize[_0x0181('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0181('0x3')],'unique':_0x0181('0x4')},'ListId':{'type':Sequelize[_0x0181('0x3')],'unique':_0x0181('0x4')},'VoiceQueueId':{'type':Sequelize[_0x0181('0x3')],'unique':_0x0181('0x4')}}; \ No newline at end of file +var _0xcf63=['STRING','contactListQueue','INTEGER','exports'];(function(_0x7be910,_0x2b381b){var _0x496ddf=function(_0x3ac518){while(--_0x3ac518){_0x7be910['push'](_0x7be910['shift']());}};_0x496ddf(++_0x2b381b);}(_0xcf63,0x163));var _0x3cf6=function(_0x1c87d4,_0x3a8eab){_0x1c87d4=_0x1c87d4-0x0;var _0x123614=_0xcf63[_0x1c87d4];return _0x123614;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x3cf6('0x0')]={'phone':{'type':Sequelize[_0x3cf6('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x3cf6('0x2')},'ListId':{'type':Sequelize[_0x3cf6('0x3')],'unique':_0x3cf6('0x2')},'VoiceQueueId':{'type':Sequelize[_0x3cf6('0x3')],'unique':_0x3cf6('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 4420a5a..85c29fa 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 _0x494e=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','CmHopperBlack','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','map','type','key','field','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','length','body','find','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js'];(function(_0x16251a,_0x512731){var _0x9c9ca6=function(_0x3acb16){while(--_0x3acb16){_0x16251a['push'](_0x16251a['shift']());}};_0x9c9ca6(++_0x512731);}(_0x494e,0x18b));var _0xe494=function(_0x239ed5,_0x4ea839){_0x239ed5=_0x239ed5-0x0;var _0x2fbef1=_0x494e[_0x239ed5];return _0x2fbef1;};'use strict';var pdf=require(_0xe494('0x0'));var emlformat=require(_0xe494('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe494('0x2'));var rp=require(_0xe494('0x3'));var moment=require(_0xe494('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe494('0x5'));var util=require('util');var path=require(_0xe494('0x6'));var sox=require(_0xe494('0x7'));var csv=require(_0xe494('0x8'));var ejs=require(_0xe494('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe494('0xa'));var jsforce=require(_0xe494('0xb'));var deskjs=require(_0xe494('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe494('0xd'));var Papa=require(_0xe494('0xe'));var Redis=require('ioredis');var authService=require(_0xe494('0xf'));var qs=require(_0xe494('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe494('0x11'))(_0xe494('0x12'));var utils=require('../../config/utils');var config=require(_0xe494('0x13'));var db=require(_0xe494('0x14'))['db'];function respondWithStatusCode(_0x4d35ce,_0x347b93){_0x347b93=_0x347b93||0xcc;return function(_0x389238){if(_0x389238){return _0x4d35ce[_0xe494('0x15')](_0x347b93);}return _0x4d35ce[_0xe494('0x16')](_0x347b93)[_0xe494('0x17')]();};}function respondWithResult(_0x229015,_0xfd1859){_0xfd1859=_0xfd1859||0xc8;return function(_0x1ac931){if(_0x1ac931){return _0x229015['status'](_0xfd1859)[_0xe494('0x18')](_0x1ac931);}};}function respondWithFilteredResult(_0x1c8dee,_0x1d32e8){return function(_0x50b869){if(_0x50b869){var _0x215154=_0x50b869[_0xe494('0x19')],_0x42c6b4=_0x1d32e8[_0xe494('0x1a')],_0x1410bd=_0x1d32e8[_0xe494('0x1a')]+_0x1d32e8[_0xe494('0x1b')],_0x419bd9;if(_0x1410bd>=_0x215154){_0x1410bd=_0x215154;_0x419bd9=0xc8;}else{_0x419bd9=0xce;}_0x1c8dee[_0xe494('0x16')](_0x419bd9);return _0x1c8dee[_0xe494('0x1c')]('Content-Range',_0x42c6b4+'-'+_0x1410bd+'/'+_0x215154)[_0xe494('0x18')](_0x50b869);}return null;};}function patchUpdates(_0x128d5e){return function(_0x52ff3b){try{jsonpatch[_0xe494('0x1d')](_0x52ff3b,_0x128d5e,!![]);}catch(_0x520fa2){return BPromise[_0xe494('0x1e')](_0x520fa2);}return _0x52ff3b['save']();};}function saveUpdates(_0x526a30,_0xb635c2){return function(_0x463576){if(_0x463576){return _0x463576[_0xe494('0x1f')](_0x526a30)[_0xe494('0x20')](function(_0x2150a3){return _0x2150a3;});}return null;};}function removeEntity(_0x19af92,_0x1b8646){return function(_0x141852){if(_0x141852){return _0x141852[_0xe494('0x21')]()[_0xe494('0x20')](function(){_0x19af92[_0xe494('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee14a,_0x2c4541){return function(_0x58de21){if(!_0x58de21){_0x2ee14a['sendStatus'](0x194);}return _0x58de21;};}function handleError(_0x15f246,_0x471d07){_0x471d07=_0x471d07||0x1f4;return function(_0x269a8b){logger[_0xe494('0x22')](_0x269a8b[_0xe494('0x23')]);if(_0x269a8b['name']){delete _0x269a8b[_0xe494('0x24')];}_0x15f246[_0xe494('0x16')](_0x471d07)[_0xe494('0x25')](_0x269a8b);};}exports['index']=function(_0x2dbbc6,_0x788955){var _0x54ca17={},_0x54a95={},_0x4c90e5={'count':0x0,'rows':[]};var _0x3fbd74=db[_0xe494('0x26')]['rawAttributes'];_0x54a95[_0xe494('0x27')]=_[_0xe494('0x28')](_0x3fbd74);_0x54a95[_0xe494('0x29')]=_[_0xe494('0x28')](_0x2dbbc6[_0xe494('0x29')]);_0x54a95[_0xe494('0x2a')]=_[_0xe494('0x2b')](_0x54a95[_0xe494('0x27')],_0x54a95[_0xe494('0x29')]);_0x54ca17[_0xe494('0x2c')]=_[_0xe494('0x2b')](_0x54a95['model'],qs['fields'](_0x2dbbc6[_0xe494('0x29')][_0xe494('0x2d')]));_0x54ca17['attributes']=_0x54ca17['attributes']['length']?_0x54ca17[_0xe494('0x2c')]:_0x54a95[_0xe494('0x27')];if(!_0x2dbbc6[_0xe494('0x29')][_0xe494('0x2e')]('nolimit')){_0x54ca17[_0xe494('0x1b')]=qs[_0xe494('0x1b')](_0x2dbbc6['query'][_0xe494('0x1b')]);_0x54ca17['offset']=qs[_0xe494('0x1a')](_0x2dbbc6[_0xe494('0x29')][_0xe494('0x1a')]);}_0x54ca17[_0xe494('0x2f')]=qs['sort'](_0x2dbbc6[_0xe494('0x29')][_0xe494('0x30')]);_0x54ca17[_0xe494('0x31')]=qs[_0xe494('0x2a')](_['pick'](_0x2dbbc6[_0xe494('0x29')],_0x54a95[_0xe494('0x2a')]));if(_0x2dbbc6[_0xe494('0x29')]['filter']){_0x54ca17['where']=_[_0xe494('0x32')](_0x54ca17[_0xe494('0x31')],{'$or':_[_0xe494('0x33')](_0x3fbd74,function(_0x3c4493){if(_0x3c4493[_0xe494('0x34')][_0xe494('0x35')]!=='VIRTUAL'){var _0x344af4={};_0x344af4[_0x3c4493[_0xe494('0x36')]]={'$like':'%'+_0x2dbbc6['query'][_0xe494('0x37')]+'%'};return _0x344af4;}})});}_0x54ca17=_['merge']({},_0x54ca17,_0x2dbbc6[_0xe494('0x38')]);var _0x5d6b17={'where':_0x54ca17[_0xe494('0x31')]};return db[_0xe494('0x26')]['count'](_0x5d6b17)['then'](function(_0x5de662){_0x4c90e5[_0xe494('0x19')]=_0x5de662;if(_0x2dbbc6['query'][_0xe494('0x39')]){_0x54ca17[_0xe494('0x3a')]=[{'all':!![]}];}return db[_0xe494('0x26')]['findAll'](_0x54ca17);})[_0xe494('0x20')](function(_0x46f766){_0x4c90e5[_0xe494('0x3b')]=_0x46f766;return _0x4c90e5;})[_0xe494('0x20')](respondWithFilteredResult(_0x788955,_0x54ca17))[_0xe494('0x3c')](handleError(_0x788955,null));};exports[_0xe494('0x3d')]=function(_0x11d0c2,_0x5b4fb5){var _0x4d9d26={'raw':!![],'where':{'id':_0x11d0c2[_0xe494('0x3e')]['id']}},_0x1be8ac={};_0x1be8ac[_0xe494('0x27')]=_[_0xe494('0x28')](db[_0xe494('0x26')][_0xe494('0x3f')]);_0x1be8ac[_0xe494('0x29')]=_['keys'](_0x11d0c2[_0xe494('0x29')]);_0x1be8ac[_0xe494('0x2a')]=_['intersection'](_0x1be8ac['model'],_0x1be8ac[_0xe494('0x29')]);_0x4d9d26[_0xe494('0x2c')]=_[_0xe494('0x2b')](_0x1be8ac[_0xe494('0x27')],qs[_0xe494('0x2d')](_0x11d0c2[_0xe494('0x29')]['fields']));_0x4d9d26[_0xe494('0x2c')]=_0x4d9d26['attributes'][_0xe494('0x40')]?_0x4d9d26[_0xe494('0x2c')]:_0x1be8ac[_0xe494('0x27')];if(_0x11d0c2[_0xe494('0x29')][_0xe494('0x39')]){_0x4d9d26[_0xe494('0x3a')]=[{'all':!![]}];}_0x4d9d26=_[_0xe494('0x32')]({},_0x4d9d26,_0x11d0c2['options']);return db[_0xe494('0x26')]['find'](_0x4d9d26)[_0xe494('0x20')](handleEntityNotFound(_0x5b4fb5,null))[_0xe494('0x20')](respondWithResult(_0x5b4fb5,null))[_0xe494('0x3c')](handleError(_0x5b4fb5,null));};exports[_0xe494('0x1f')]=function(_0x7da8c,_0x512eb0){if(_0x7da8c[_0xe494('0x41')]['id']){delete _0x7da8c[_0xe494('0x41')]['id'];}return db[_0xe494('0x26')][_0xe494('0x42')]({'where':{'id':_0x7da8c[_0xe494('0x3e')]['id']}})[_0xe494('0x20')](handleEntityNotFound(_0x512eb0,null))['then'](saveUpdates(_0x7da8c['body'],null))[_0xe494('0x20')](respondWithResult(_0x512eb0,null))['catch'](handleError(_0x512eb0,null));};exports[_0xe494('0x21')]=function(_0x14a3c7,_0x2f4dc0){return db[_0xe494('0x26')][_0xe494('0x42')]({'where':{'id':_0x14a3c7[_0xe494('0x3e')]['id']}})[_0xe494('0x20')](handleEntityNotFound(_0x2f4dc0,null))[_0xe494('0x20')](removeEntity(_0x2f4dc0,null))['catch'](handleError(_0x2f4dc0,null));};exports['describe']=function(_0x1f92ba,_0x299973){return db[_0xe494('0x26')][_0xe494('0x43')]()[_0xe494('0x20')](respondWithResult(_0x299973,null))[_0xe494('0x3c')](handleError(_0x299973,null));}; \ No newline at end of file +var _0xb5c9=['../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','update','end','error','stack','index','CmHopperBlack','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','then','rows','catch','show','find','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x58d30c,_0x5e9a7a){var _0x516417=function(_0x3aa318){while(--_0x3aa318){_0x58d30c['push'](_0x58d30c['shift']());}};_0x516417(++_0x5e9a7a);}(_0xb5c9,0x150));var _0x9b5c=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb5c9[_0x565c49];return _0x20ca34;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9b5c('0x0'));var rimraf=require(_0x9b5c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b5c('0x2'));var rp=require('request-promise');var moment=require(_0x9b5c('0x3'));var BPromise=require(_0x9b5c('0x4'));var Mustache=require(_0x9b5c('0x5'));var util=require(_0x9b5c('0x6'));var path=require(_0x9b5c('0x7'));var sox=require(_0x9b5c('0x8'));var csv=require(_0x9b5c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b5c('0xa'));var squel=require(_0x9b5c('0xb'));var crypto=require(_0x9b5c('0xc'));var jsforce=require(_0x9b5c('0xd'));var deskjs=require(_0x9b5c('0xe'));var toCsv=require(_0x9b5c('0x9'));var querystring=require(_0x9b5c('0xf'));var Papa=require(_0x9b5c('0x10'));var Redis=require(_0x9b5c('0x11'));var authService=require(_0x9b5c('0x12'));var qs=require(_0x9b5c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9b5c('0x14'));var utils=require(_0x9b5c('0x15'));var config=require(_0x9b5c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b8084,_0x3714f5){_0x3714f5=_0x3714f5||0xcc;return function(_0x4b4748){if(_0x4b4748){return _0x2b8084[_0x9b5c('0x17')](_0x3714f5);}return _0x2b8084['status'](_0x3714f5)['end']();};}function respondWithResult(_0x173636,_0x4f6443){_0x4f6443=_0x4f6443||0xc8;return function(_0x1f6cc0){if(_0x1f6cc0){return _0x173636[_0x9b5c('0x18')](_0x4f6443)['json'](_0x1f6cc0);}};}function respondWithFilteredResult(_0x6f0c2d,_0x2e1fcb){return function(_0x36f06e){if(_0x36f06e){var _0x46ffa0=_0x36f06e[_0x9b5c('0x19')],_0x41f0de=_0x2e1fcb[_0x9b5c('0x1a')],_0x10f735=_0x2e1fcb['offset']+_0x2e1fcb[_0x9b5c('0x1b')],_0x3bc923;if(_0x10f735>=_0x46ffa0){_0x10f735=_0x46ffa0;_0x3bc923=0xc8;}else{_0x3bc923=0xce;}_0x6f0c2d[_0x9b5c('0x18')](_0x3bc923);return _0x6f0c2d['set'](_0x9b5c('0x1c'),_0x41f0de+'-'+_0x10f735+'/'+_0x46ffa0)[_0x9b5c('0x1d')](_0x36f06e);}return null;};}function patchUpdates(_0x2d05d0){return function(_0x808e67){try{jsonpatch[_0x9b5c('0x1e')](_0x808e67,_0x2d05d0,!![]);}catch(_0x5bfbe3){return BPromise[_0x9b5c('0x1f')](_0x5bfbe3);}return _0x808e67[_0x9b5c('0x20')]();};}function saveUpdates(_0x57a178,_0x4848cf){return function(_0x545008){if(_0x545008){return _0x545008[_0x9b5c('0x21')](_0x57a178)['then'](function(_0x5bd905){return _0x5bd905;});}return null;};}function removeEntity(_0x36ac03,_0x19f306){return function(_0x39bb6d){if(_0x39bb6d){return _0x39bb6d['destroy']()['then'](function(){_0x36ac03[_0x9b5c('0x18')](0xcc)[_0x9b5c('0x22')]();});}};}function handleEntityNotFound(_0x21891f,_0x42dc84){return function(_0x5b0255){if(!_0x5b0255){_0x21891f[_0x9b5c('0x17')](0x194);}return _0x5b0255;};}function handleError(_0x50885b,_0x5e755b){_0x5e755b=_0x5e755b||0x1f4;return function(_0x2d60e5){logger[_0x9b5c('0x23')](_0x2d60e5[_0x9b5c('0x24')]);if(_0x2d60e5['name']){delete _0x2d60e5['name'];}_0x50885b[_0x9b5c('0x18')](_0x5e755b)['send'](_0x2d60e5);};}exports[_0x9b5c('0x25')]=function(_0xfec962,_0x164caa){var _0x2f45e6={},_0x199dc0={},_0xf5aba5={'count':0x0,'rows':[]};var _0x476b51=db[_0x9b5c('0x26')][_0x9b5c('0x27')];_0x199dc0[_0x9b5c('0x28')]=_[_0x9b5c('0x29')](_0x476b51);_0x199dc0[_0x9b5c('0x2a')]=_[_0x9b5c('0x29')](_0xfec962['query']);_0x199dc0[_0x9b5c('0x2b')]=_[_0x9b5c('0x2c')](_0x199dc0[_0x9b5c('0x28')],_0x199dc0[_0x9b5c('0x2a')]);_0x2f45e6[_0x9b5c('0x2d')]=_[_0x9b5c('0x2c')](_0x199dc0[_0x9b5c('0x28')],qs[_0x9b5c('0x2e')](_0xfec962['query']['fields']));_0x2f45e6[_0x9b5c('0x2d')]=_0x2f45e6[_0x9b5c('0x2d')]['length']?_0x2f45e6['attributes']:_0x199dc0[_0x9b5c('0x28')];if(!_0xfec962[_0x9b5c('0x2a')][_0x9b5c('0x2f')](_0x9b5c('0x30'))){_0x2f45e6['limit']=qs[_0x9b5c('0x1b')](_0xfec962[_0x9b5c('0x2a')][_0x9b5c('0x1b')]);_0x2f45e6[_0x9b5c('0x1a')]=qs[_0x9b5c('0x1a')](_0xfec962[_0x9b5c('0x2a')][_0x9b5c('0x1a')]);}_0x2f45e6['order']=qs[_0x9b5c('0x31')](_0xfec962[_0x9b5c('0x2a')][_0x9b5c('0x31')]);_0x2f45e6[_0x9b5c('0x32')]=qs['filters'](_[_0x9b5c('0x33')](_0xfec962['query'],_0x199dc0['filters']));if(_0xfec962[_0x9b5c('0x2a')][_0x9b5c('0x34')]){_0x2f45e6['where']=_[_0x9b5c('0x35')](_0x2f45e6[_0x9b5c('0x32')],{'$or':_[_0x9b5c('0x36')](_0x476b51,function(_0x11e763){if(_0x11e763[_0x9b5c('0x37')][_0x9b5c('0x38')]!==_0x9b5c('0x39')){var _0x29967b={};_0x29967b[_0x11e763[_0x9b5c('0x3a')]]={'$like':'%'+_0xfec962[_0x9b5c('0x2a')][_0x9b5c('0x34')]+'%'};return _0x29967b;}})});}_0x2f45e6=_[_0x9b5c('0x35')]({},_0x2f45e6,_0xfec962[_0x9b5c('0x3b')]);var _0x3ac13f={'where':_0x2f45e6[_0x9b5c('0x32')]};return db[_0x9b5c('0x26')][_0x9b5c('0x19')](_0x3ac13f)['then'](function(_0xa27f00){_0xf5aba5[_0x9b5c('0x19')]=_0xa27f00;if(_0xfec962[_0x9b5c('0x2a')][_0x9b5c('0x3c')]){_0x2f45e6[_0x9b5c('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x9b5c('0x3e')](_0x2f45e6);})[_0x9b5c('0x3f')](function(_0x2a9779){_0xf5aba5[_0x9b5c('0x40')]=_0x2a9779;return _0xf5aba5;})[_0x9b5c('0x3f')](respondWithFilteredResult(_0x164caa,_0x2f45e6))[_0x9b5c('0x41')](handleError(_0x164caa,null));};exports[_0x9b5c('0x42')]=function(_0x2a4bf7,_0x19c661){var _0x45f754={'raw':!![],'where':{'id':_0x2a4bf7['params']['id']}},_0x416cbf={};_0x416cbf['model']=_[_0x9b5c('0x29')](db[_0x9b5c('0x26')][_0x9b5c('0x27')]);_0x416cbf['query']=_['keys'](_0x2a4bf7['query']);_0x416cbf[_0x9b5c('0x2b')]=_['intersection'](_0x416cbf['model'],_0x416cbf[_0x9b5c('0x2a')]);_0x45f754['attributes']=_[_0x9b5c('0x2c')](_0x416cbf[_0x9b5c('0x28')],qs[_0x9b5c('0x2e')](_0x2a4bf7[_0x9b5c('0x2a')][_0x9b5c('0x2e')]));_0x45f754[_0x9b5c('0x2d')]=_0x45f754[_0x9b5c('0x2d')]['length']?_0x45f754[_0x9b5c('0x2d')]:_0x416cbf[_0x9b5c('0x28')];if(_0x2a4bf7[_0x9b5c('0x2a')]['includeAll']){_0x45f754[_0x9b5c('0x3d')]=[{'all':!![]}];}_0x45f754=_[_0x9b5c('0x35')]({},_0x45f754,_0x2a4bf7[_0x9b5c('0x3b')]);return db['CmHopperBlack'][_0x9b5c('0x43')](_0x45f754)[_0x9b5c('0x3f')](handleEntityNotFound(_0x19c661,null))[_0x9b5c('0x3f')](respondWithResult(_0x19c661,null))[_0x9b5c('0x41')](handleError(_0x19c661,null));};exports[_0x9b5c('0x21')]=function(_0x23d743,_0x1ac63d){if(_0x23d743[_0x9b5c('0x44')]['id']){delete _0x23d743[_0x9b5c('0x44')]['id'];}return db[_0x9b5c('0x26')]['find']({'where':{'id':_0x23d743[_0x9b5c('0x45')]['id']}})[_0x9b5c('0x3f')](handleEntityNotFound(_0x1ac63d,null))[_0x9b5c('0x3f')](saveUpdates(_0x23d743[_0x9b5c('0x44')],null))[_0x9b5c('0x3f')](respondWithResult(_0x1ac63d,null))[_0x9b5c('0x41')](handleError(_0x1ac63d,null));};exports['destroy']=function(_0x374d81,_0x3aa6de){return db[_0x9b5c('0x26')][_0x9b5c('0x43')]({'where':{'id':_0x374d81['params']['id']}})[_0x9b5c('0x3f')](handleEntityNotFound(_0x3aa6de,null))[_0x9b5c('0x3f')](removeEntity(_0x3aa6de,null))[_0x9b5c('0x41')](handleError(_0x3aa6de,null));};exports[_0x9b5c('0x46')]=function(_0xd89102,_0x4ffdfd){return db[_0x9b5c('0x26')][_0x9b5c('0x46')]()[_0x9b5c('0x3f')](respondWithResult(_0x4ffdfd,null))[_0x9b5c('0x41')](handleError(_0x4ffdfd,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4d74cd7..0988233 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 _0x9bde=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','api','bluebird'];(function(_0x142394,_0x4216ce){var _0x43c6b7=function(_0xe8b27e){while(--_0xe8b27e){_0x142394['push'](_0x142394['shift']());}};_0x43c6b7(++_0x4216ce);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2553fd,_0xcb68a){_0x2553fd=_0x2553fd-0x0;var _0x1cafb5=_0x9bde[_0x2553fd];return _0x1cafb5;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81bd=['../../config/environment','./cmHopperBlack.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x19bcde,_0x5012ef){var _0x4c760c=function(_0x15bb78){while(--_0x15bb78){_0x19bcde['push'](_0x19bcde['shift']());}};_0x4c760c(++_0x5012ef);}(_0x81bd,0x7c));var _0xd81b=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x81bd[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index fa6f5fe..9a68acd 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 _0x0b8e=['../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0b8e,0xad));var _0xe0b8=function(_0xdbd85c,_0xca242f){_0xdbd85c=_0xdbd85c-0x0;var _0x24c053=_0x0b8e[_0xdbd85c];return _0x24c053;};'use strict';var _=require('lodash');var util=require(_0xe0b8('0x0'));var moment=require('moment');var BPromise=require(_0xe0b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0b8('0x2'));var db=require(_0xe0b8('0x3'))['db'];var utils=require(_0xe0b8('0x4'));var logger=require(_0xe0b8('0x5'))(_0xe0b8('0x6'));var config=require(_0xe0b8('0x7'));var jayson=require(_0xe0b8('0x8'));var client=jayson[_0xe0b8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40919d,_0x3b7e8f,_0x285eb8){return new BPromise(function(_0x43f9c9,_0x10c47b){return client[_0xe0b8('0xa')](_0x40919d,_0x285eb8)[_0xe0b8('0xb')](function(_0x367350){logger[_0xe0b8('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x3b7e8f,'request\x20sent');logger['debug'](_0xe0b8('0xd'),_0x3b7e8f,'request\x20sent',JSON[_0xe0b8('0xe')](_0x367350));if(_0x367350['error']){if(_0x367350[_0xe0b8('0xf')]['code']===0x1f4){logger['error'](_0xe0b8('0x10'),_0x3b7e8f,_0x367350[_0xe0b8('0xf')][_0xe0b8('0x11')]);return _0x10c47b(_0x367350[_0xe0b8('0xf')][_0xe0b8('0x11')]);}logger[_0xe0b8('0xf')](_0xe0b8('0x10'),_0x3b7e8f,_0x367350[_0xe0b8('0xf')][_0xe0b8('0x11')]);return _0x43f9c9(_0x367350[_0xe0b8('0xf')][_0xe0b8('0x11')]);}else{logger['info'](_0xe0b8('0x10'),_0x3b7e8f,'request\x20sent');_0x43f9c9(_0x367350[_0xe0b8('0x12')][_0xe0b8('0x11')]);}})[_0xe0b8('0x13')](function(_0x3786ba){logger[_0xe0b8('0xf')](_0xe0b8('0x10'),_0x3b7e8f,_0x3786ba);_0x10c47b(_0x3786ba);});});}exports[_0xe0b8('0x14')]=function(_0x370449){var _0x521597=this;return new Promise(function(_0x236984,_0x55b213){return db[_0xe0b8('0x15')][_0xe0b8('0x16')]({'raw':_0x370449['options']?_0x370449[_0xe0b8('0x17')][_0xe0b8('0x18')]===undefined?!![]:![]:!![],'where':_0x370449[_0xe0b8('0x17')]?_0x370449[_0xe0b8('0x17')][_0xe0b8('0x19')]||null:null,'attributes':_0x370449['options']?_0x370449[_0xe0b8('0x17')][_0xe0b8('0x1a')]||null:null,'limit':_0x370449['options']?_0x370449[_0xe0b8('0x17')][_0xe0b8('0x1b')]||null:null,'include':_0x370449[_0xe0b8('0x17')]?_0x370449[_0xe0b8('0x17')]['include']?_[_0xe0b8('0x1c')](_0x370449[_0xe0b8('0x17')][_0xe0b8('0x1d')],function(_0x27b264){return{'model':db[_0x27b264['model']],'as':_0x27b264['as'],'attributes':_0x27b264[_0xe0b8('0x1a')],'include':_0x27b264[_0xe0b8('0x1d')]?_[_0xe0b8('0x1c')](_0x27b264['include'],function(_0x549c73){return{'model':db[_0x549c73[_0xe0b8('0x1e')]],'as':_0x549c73['as'],'attributes':_0x549c73[_0xe0b8('0x1a')],'include':_0x549c73[_0xe0b8('0x1d')]?_[_0xe0b8('0x1c')](_0x549c73['include'],function(_0x8b60ad){return{'model':db[_0x8b60ad['model']],'as':_0x8b60ad['as'],'attributes':_0x8b60ad[_0xe0b8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe0b8('0xb')](function(_0x5164a1){logger[_0xe0b8('0xc')](_0xe0b8('0x14'),_0x370449);logger[_0xe0b8('0x1f')](_0xe0b8('0x14'),_0x370449,JSON[_0xe0b8('0xe')](_0x5164a1));_0x236984(_0x5164a1);})[_0xe0b8('0x13')](function(_0x339a5f){logger[_0xe0b8('0xf')](_0xe0b8('0x14'),_0x339a5f['message'],_0x370449);_0x55b213(_0x521597[_0xe0b8('0xf')](0x1f4,_0x339a5f[_0xe0b8('0x11')]));});});};exports[_0xe0b8('0x20')]=function(_0x4befba){var _0x154fb7=this;return new Promise(function(_0x158e01,_0x33e666){return db['CmHopperBlack'][_0xe0b8('0x21')](_0x4befba[_0xe0b8('0x22')],{'raw':_0x4befba['options']?_0x4befba[_0xe0b8('0x17')][_0xe0b8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4befba[_0xe0b8('0x17')]?_0x4befba[_0xe0b8('0x17')][_0xe0b8('0x19')]||null:null,'attributes':_0x4befba[_0xe0b8('0x17')]?_0x4befba[_0xe0b8('0x17')][_0xe0b8('0x1a')]||null:null,'limit':_0x4befba[_0xe0b8('0x17')]?_0x4befba[_0xe0b8('0x17')][_0xe0b8('0x1b')]||null:null})[_0xe0b8('0xb')](function(_0x2a8e0b){logger[_0xe0b8('0xc')](_0xe0b8('0x20'),_0x4befba);logger[_0xe0b8('0x1f')](_0xe0b8('0x20'),_0x4befba,JSON[_0xe0b8('0xe')](_0x2a8e0b));_0x158e01(_0x2a8e0b);})['catch'](function(_0x3de378){logger[_0xe0b8('0xf')]('UpdateCmHopperBlack',_0x3de378['message'],_0x4befba);_0x33e666(_0x154fb7[_0xe0b8('0xf')](0x1f4,_0x3de378['message']));});});};exports[_0xe0b8('0x23')]=function(_0x3510d5){var _0x574667=this;return new Promise(function(_0x2dc42d,_0x556a94){return db[_0xe0b8('0x15')]['destroy']({'where':_0x3510d5['options']?_0x3510d5[_0xe0b8('0x17')][_0xe0b8('0x19')]||null:null})[_0xe0b8('0xb')](function(_0x176f3f){logger[_0xe0b8('0xc')](_0xe0b8('0x23'),_0x3510d5);logger[_0xe0b8('0x1f')](_0xe0b8('0x23'),_0x3510d5,JSON[_0xe0b8('0xe')](_0x176f3f));_0x2dc42d(_0x176f3f);})[_0xe0b8('0x13')](function(_0xde117a){logger[_0xe0b8('0xf')](_0xe0b8('0x23'),_0xde117a['message'],_0x3510d5);_0x556a94(_0x574667['error'](0x1f4,_0xde117a['message']));});});}; \ No newline at end of file +var _0x98b2=['error','code','message','info','result','catch','CmHopperBlack','options','where','attributes','limit','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4a4ab5,_0x2e1592){var _0x19c372=function(_0x8bf977){while(--_0x8bf977){_0x4a4ab5['push'](_0x4a4ab5['shift']());}};_0x19c372(++_0x2e1592);}(_0x98b2,0x108));var _0x298b=function(_0x205dba,_0x47c8f2){_0x205dba=_0x205dba-0x0;var _0x57bf3a=_0x98b2[_0x205dba];return _0x57bf3a;};'use strict';var _=require('lodash');var util=require(_0x298b('0x0'));var moment=require(_0x298b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x298b('0x2'));var db=require(_0x298b('0x3'))['db'];var utils=require(_0x298b('0x4'));var logger=require('../../config/logger')(_0x298b('0x5'));var config=require(_0x298b('0x6'));var jayson=require(_0x298b('0x7'));var client=jayson[_0x298b('0x8')][_0x298b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x119394,_0x2208c2,_0x1a35f9){return new BPromise(function(_0x43af2a,_0x555a4d){return client[_0x298b('0xa')](_0x119394,_0x1a35f9)[_0x298b('0xb')](function(_0x154ae4){logger['info'](_0x298b('0xc'),_0x2208c2,_0x298b('0xd'));logger[_0x298b('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2208c2,_0x298b('0xd'),JSON[_0x298b('0xf')](_0x154ae4));if(_0x154ae4[_0x298b('0x10')]){if(_0x154ae4[_0x298b('0x10')][_0x298b('0x11')]===0x1f4){logger[_0x298b('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2208c2,_0x154ae4[_0x298b('0x10')][_0x298b('0x12')]);return _0x555a4d(_0x154ae4[_0x298b('0x10')]['message']);}logger['error'](_0x298b('0xc'),_0x2208c2,_0x154ae4[_0x298b('0x10')][_0x298b('0x12')]);return _0x43af2a(_0x154ae4[_0x298b('0x10')]['message']);}else{logger[_0x298b('0x13')](_0x298b('0xc'),_0x2208c2,_0x298b('0xd'));_0x43af2a(_0x154ae4[_0x298b('0x14')][_0x298b('0x12')]);}})[_0x298b('0x15')](function(_0x584720){logger[_0x298b('0x10')](_0x298b('0xc'),_0x2208c2,_0x584720);_0x555a4d(_0x584720);});});}exports['GetCmHopperBlack']=function(_0x45ca07){var _0x312458=this;return new Promise(function(_0x445291,_0x280440){return db[_0x298b('0x16')]['findAll']({'raw':_0x45ca07['options']?_0x45ca07[_0x298b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x45ca07[_0x298b('0x17')]?_0x45ca07[_0x298b('0x17')][_0x298b('0x18')]||null:null,'attributes':_0x45ca07[_0x298b('0x17')]?_0x45ca07[_0x298b('0x17')][_0x298b('0x19')]||null:null,'limit':_0x45ca07[_0x298b('0x17')]?_0x45ca07['options'][_0x298b('0x1a')]||null:null,'include':_0x45ca07[_0x298b('0x17')]?_0x45ca07[_0x298b('0x17')][_0x298b('0x1b')]?_[_0x298b('0x1c')](_0x45ca07['options'][_0x298b('0x1b')],function(_0x3daa82){return{'model':db[_0x3daa82[_0x298b('0x1d')]],'as':_0x3daa82['as'],'attributes':_0x3daa82[_0x298b('0x19')],'include':_0x3daa82[_0x298b('0x1b')]?_['map'](_0x3daa82['include'],function(_0x972296){return{'model':db[_0x972296[_0x298b('0x1d')]],'as':_0x972296['as'],'attributes':_0x972296[_0x298b('0x19')],'include':_0x972296[_0x298b('0x1b')]?_[_0x298b('0x1c')](_0x972296['include'],function(_0x187675){return{'model':db[_0x187675['model']],'as':_0x187675['as'],'attributes':_0x187675[_0x298b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x298b('0xb')](function(_0x2178bf){logger[_0x298b('0x13')](_0x298b('0x1e'),_0x45ca07);logger['debug'](_0x298b('0x1e'),_0x45ca07,JSON[_0x298b('0xf')](_0x2178bf));_0x445291(_0x2178bf);})[_0x298b('0x15')](function(_0x1c9ce5){logger['error']('GetCmHopperBlack',_0x1c9ce5[_0x298b('0x12')],_0x45ca07);_0x280440(_0x312458['error'](0x1f4,_0x1c9ce5[_0x298b('0x12')]));});});};exports[_0x298b('0x1f')]=function(_0x53cc1f){var _0x1c86b2=this;return new Promise(function(_0x4045c0,_0x30688e){return db[_0x298b('0x16')][_0x298b('0x20')](_0x53cc1f['body'],{'raw':_0x53cc1f[_0x298b('0x17')]?_0x53cc1f[_0x298b('0x17')][_0x298b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53cc1f[_0x298b('0x17')]?_0x53cc1f['options']['where']||null:null,'attributes':_0x53cc1f[_0x298b('0x17')]?_0x53cc1f[_0x298b('0x17')]['attributes']||null:null,'limit':_0x53cc1f[_0x298b('0x17')]?_0x53cc1f[_0x298b('0x17')][_0x298b('0x1a')]||null:null})[_0x298b('0xb')](function(_0x814132){logger['info'](_0x298b('0x1f'),_0x53cc1f);logger[_0x298b('0xe')](_0x298b('0x1f'),_0x53cc1f,JSON[_0x298b('0xf')](_0x814132));_0x4045c0(_0x814132);})['catch'](function(_0x1f4304){logger[_0x298b('0x10')](_0x298b('0x1f'),_0x1f4304['message'],_0x53cc1f);_0x30688e(_0x1c86b2[_0x298b('0x10')](0x1f4,_0x1f4304[_0x298b('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x57e7e2){var _0x2e5447=this;return new Promise(function(_0x5b196b,_0x11ef21){return db[_0x298b('0x16')]['destroy']({'where':_0x57e7e2['options']?_0x57e7e2[_0x298b('0x17')]['where']||null:null})[_0x298b('0xb')](function(_0x4539b2){logger['info'](_0x298b('0x22'),_0x57e7e2);logger['debug'](_0x298b('0x22'),_0x57e7e2,JSON[_0x298b('0xf')](_0x4539b2));_0x5b196b(_0x4539b2);})['catch'](function(_0x55970c){logger['error']('DestroyCmHopperBlack',_0x55970c['message'],_0x57e7e2);_0x11ef21(_0x2e5447[_0x298b('0x10')](0x1f4,_0x55970c['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8584619..c4322b6 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 _0x5859=['/describe','describe','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index'];(function(_0x5ecc63,_0x110d0d){var _0x56e65f=function(_0x138202){while(--_0x138202){_0x5ecc63['push'](_0x5ecc63['shift']());}};_0x56e65f(++_0x110d0d);}(_0x5859,0xc4));var _0x9585=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x5859[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x9585('0x0'));var util=require(_0x9585('0x1'));var path=require(_0x9585('0x2'));var timeout=require(_0x9585('0x3'));var express=require(_0x9585('0x4'));var router=express[_0x9585('0x5')]();var auth=require(_0x9585('0x6'));var interaction=require(_0x9585('0x7'));var config=require(_0x9585('0x8'));var controller=require(_0x9585('0x9'));router[_0x9585('0xa')]('/',auth[_0x9585('0xb')](),controller[_0x9585('0xc')]);router['get'](_0x9585('0xd'),auth[_0x9585('0xb')](),controller[_0x9585('0xe')]);router['get'](_0x9585('0xf'),auth[_0x9585('0xb')](),controller['show']);router['put'](_0x9585('0xf'),auth[_0x9585('0xb')](),controller[_0x9585('0x10')]);router[_0x9585('0x11')]('/:id',auth[_0x9585('0xb')](),controller['destroy']);module[_0x9585('0x12')]=router; \ No newline at end of file +var _0x4f88=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','show'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x4f88,0xf3));var _0x84f8=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0x4f88[_0x1c2f29];return _0x258465;};'use strict';var multer=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var path=require('path');var timeout=require(_0x84f8('0x2'));var express=require(_0x84f8('0x3'));var router=express[_0x84f8('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x84f8('0x5'));var controller=require(_0x84f8('0x6'));router[_0x84f8('0x7')]('/',auth[_0x84f8('0x8')](),controller[_0x84f8('0x9')]);router[_0x84f8('0x7')]('/describe',auth[_0x84f8('0x8')](),controller[_0x84f8('0xa')]);router['get']('/:id',auth[_0x84f8('0x8')](),controller[_0x84f8('0xb')]);router[_0x84f8('0xc')](_0x84f8('0xd'),auth[_0x84f8('0x8')](),controller[_0x84f8('0xe')]);router[_0x84f8('0xf')](_0x84f8('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x84f8('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index adca7b5..6129eed 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 _0x81bb=['setDataValue','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','followuptime','diff'];(function(_0xc7f9a9,_0x3474e6){var _0x157093=function(_0x4f06e0){while(--_0x4f06e0){_0xc7f9a9['push'](_0xc7f9a9['shift']());}};_0x157093(++_0x3474e6);}(_0x81bb,0x178));var _0xb81b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb81b('0x0'));var moment=require(_0xb81b('0x1'));module[_0xb81b('0x2')]={'state':{'type':Sequelize[_0xb81b('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xb81b('0x4')]},'scheduledat':{'type':Sequelize[_0xb81b('0x5')]},'countbusyretry':{'type':Sequelize[_0xb81b('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb81b('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb81b('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb81b('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xb81b('0x4')]},'originatecalleridname':{'type':Sequelize[_0xb81b('0x4')]},'calleridnum':{'type':Sequelize[_0xb81b('0x4')]},'calleridname':{'type':Sequelize[_0xb81b('0x4')]},'starttime':{'type':Sequelize[_0xb81b('0x5')]},'responsetime':{'type':Sequelize[_0xb81b('0x5')]},'answertime':{'type':Sequelize[_0xb81b('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb81b('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb81b('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb81b('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb81b('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb81b('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb81b('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xb81b('0x4')]},'dispositionat':{'type':Sequelize[_0xb81b('0x5')],'set':function(_0x1c502f){var _0x534ace=this[_0xb81b('0x6')]('endtime');if(_0x534ace&&_0x1c502f){this['setDataValue'](_0xb81b('0x7'),moment(_0x1c502f)[_0xb81b('0x8')](moment(_0x534ace),'seconds'));}return this[_0xb81b('0x9')]('dispositionat',_0x1c502f);}},'amd':{'type':Sequelize[_0xb81b('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb81b('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb81b('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb81b('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb81b('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb81b('0x5')]},'deleted':{'type':Sequelize[_0xb81b('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb81b('0x5')]},'recallme':{'type':Sequelize[_0xb81b('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb81b('0x5')]}}; \ No newline at end of file +var _0xa5c7=['DATE','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa5c7,0xa6));var _0x7a5c=function(_0x52a666,_0x3971a1){_0x52a666=_0x52a666-0x0;var _0x10ad52=_0xa5c7[_0x52a666];return _0x10ad52;};'use strict';var Sequelize=require(_0x7a5c('0x0'));var moment=require(_0x7a5c('0x1'));module[_0x7a5c('0x2')]={'state':{'type':Sequelize[_0x7a5c('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7a5c('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x7a5c('0x4')]},'originatecalleridname':{'type':Sequelize[_0x7a5c('0x4')]},'calleridnum':{'type':Sequelize[_0x7a5c('0x4')]},'calleridname':{'type':Sequelize[_0x7a5c('0x4')]},'starttime':{'type':Sequelize[_0x7a5c('0x5')]},'responsetime':{'type':Sequelize[_0x7a5c('0x5')]},'answertime':{'type':Sequelize[_0x7a5c('0x5')]},'droptime':{'type':Sequelize[_0x7a5c('0x5')]},'endtime':{'type':Sequelize[_0x7a5c('0x5')]},'ringtime':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7a5c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7a5c('0x4')]},'campaign':{'type':Sequelize[_0x7a5c('0x4')]},'campaigntype':{'type':Sequelize[_0x7a5c('0x4')]},'membername':{'type':Sequelize[_0x7a5c('0x4')]},'reason':{'type':Sequelize[_0x7a5c('0x4')]},'disposition':{'type':Sequelize[_0x7a5c('0x4')]},'dispositionat':{'type':Sequelize[_0x7a5c('0x5')],'set':function(_0x279ee4){var _0xfca6f3=this['getDataValue']('endtime');if(_0xfca6f3&&_0x279ee4){this['setDataValue']('followuptime',moment(_0x279ee4)['diff'](moment(_0xfca6f3),_0x7a5c('0x6')));}return this['setDataValue'](_0x7a5c('0x7'),_0x279ee4);}},'amd':{'type':Sequelize[_0x7a5c('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x7a5c('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x7a5c('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x7a5c('0x5')]},'callback':{'type':Sequelize[_0x7a5c('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7a5c('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7a5c('0x5')]},'deleted':{'type':Sequelize[_0x7a5c('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x7a5c('0x5')]},'recallme':{'type':Sequelize[_0x7a5c('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x7a5c('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 89e5101..fe4367b 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 _0x0c53=['`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','VoiceQueue','insert','into','fromQuery','scheduledAt','ContactId','ListId','createdAt','select','field','phone','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','updatedAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','update','then','destroy','end','error','name','send','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','map','type','key','VIRTUAL','merge','options','CmHopperFinal','includeAll','findAll','rows','catch','show','params','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','literal','COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0x0c53,0xa4));var _0x30c5=function(_0x5b9c46,_0x1daac3){_0x5b9c46=_0x5b9c46-0x0;var _0x45c7ad=_0x0c53[_0x5b9c46];return _0x45c7ad;};'use strict';var pdf=require(_0x30c5('0x0'));var emlformat=require(_0x30c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x30c5('0x2'));var jsonpatch=require(_0x30c5('0x3'));var rp=require('request-promise');var moment=require(_0x30c5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x30c5('0x5'));var util=require(_0x30c5('0x6'));var path=require('path');var sox=require(_0x30c5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x30c5('0x8'));var squel=require(_0x30c5('0x9'));var crypto=require(_0x30c5('0xa'));var jsforce=require(_0x30c5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x30c5('0xc'));var querystring=require('querystring');var Papa=require(_0x30c5('0xd'));var Redis=require('ioredis');var authService=require(_0x30c5('0xe'));var qs=require(_0x30c5('0xf'));var hardwareService=require(_0x30c5('0x10'));var logger=require('../../config/logger')(_0x30c5('0x11'));var utils=require(_0x30c5('0x12'));var config=require(_0x30c5('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40befc,_0x45a430){_0x45a430=_0x45a430||0xcc;return function(_0x404688){if(_0x404688){return _0x40befc[_0x30c5('0x14')](_0x45a430);}return _0x40befc['status'](_0x45a430)['end']();};}function respondWithResult(_0x4c5ed8,_0x4cb5d9){_0x4cb5d9=_0x4cb5d9||0xc8;return function(_0x302c70){if(_0x302c70){return _0x4c5ed8[_0x30c5('0x15')](_0x4cb5d9)[_0x30c5('0x16')](_0x302c70);}};}function respondWithFilteredResult(_0x9a148,_0x3fada4){return function(_0x26917f){if(_0x26917f){var _0x1104e0=_0x26917f[_0x30c5('0x17')],_0x4eba8c=_0x3fada4[_0x30c5('0x18')],_0x57721b=_0x3fada4[_0x30c5('0x18')]+_0x3fada4['limit'],_0x10222b;if(_0x57721b>=_0x1104e0){_0x57721b=_0x1104e0;_0x10222b=0xc8;}else{_0x10222b=0xce;}_0x9a148['status'](_0x10222b);return _0x9a148[_0x30c5('0x19')](_0x30c5('0x1a'),_0x4eba8c+'-'+_0x57721b+'/'+_0x1104e0)[_0x30c5('0x16')](_0x26917f);}return null;};}function patchUpdates(_0x34d917){return function(_0x532361){try{jsonpatch['apply'](_0x532361,_0x34d917,!![]);}catch(_0x3abfa5){return BPromise[_0x30c5('0x1b')](_0x3abfa5);}return _0x532361['save']();};}function saveUpdates(_0x4bbd7a,_0xabb243){return function(_0x1b5688){if(_0x1b5688){return _0x1b5688[_0x30c5('0x1c')](_0x4bbd7a)[_0x30c5('0x1d')](function(_0x5ad135){return _0x5ad135;});}return null;};}function removeEntity(_0x4dc164,_0x252a65){return function(_0x47753b){if(_0x47753b){return _0x47753b[_0x30c5('0x1e')]()['then'](function(){_0x4dc164[_0x30c5('0x15')](0xcc)[_0x30c5('0x1f')]();});}};}function handleEntityNotFound(_0x3aa21d,_0x2246e2){return function(_0x59c8ed){if(!_0x59c8ed){_0x3aa21d[_0x30c5('0x14')](0x194);}return _0x59c8ed;};}function handleError(_0x327e23,_0x128f3e){_0x128f3e=_0x128f3e||0x1f4;return function(_0x530c82){logger[_0x30c5('0x20')](_0x530c82['stack']);if(_0x530c82['name']){delete _0x530c82[_0x30c5('0x21')];}_0x327e23[_0x30c5('0x15')](_0x128f3e)[_0x30c5('0x22')](_0x530c82);};}exports['index']=function(_0x5e1e86,_0xfd1e1a){var _0x5b0bf6={},_0x3bfb14={},_0x237256={'count':0x0,'rows':[]};var _0x3dd8c9=db['CmHopperFinal'][_0x30c5('0x23')];_0x3bfb14['model']=_[_0x30c5('0x24')](_0x3dd8c9);_0x3bfb14[_0x30c5('0x25')]=_[_0x30c5('0x24')](_0x5e1e86['query']);_0x3bfb14[_0x30c5('0x26')]=_[_0x30c5('0x27')](_0x3bfb14[_0x30c5('0x28')],_0x3bfb14[_0x30c5('0x25')]);_0x5b0bf6[_0x30c5('0x29')]=_[_0x30c5('0x27')](_0x3bfb14[_0x30c5('0x28')],qs[_0x30c5('0x2a')](_0x5e1e86[_0x30c5('0x25')][_0x30c5('0x2a')]));_0x5b0bf6['attributes']=_0x5b0bf6[_0x30c5('0x29')][_0x30c5('0x2b')]?_0x5b0bf6['attributes']:_0x3bfb14[_0x30c5('0x28')];if(!_0x5e1e86[_0x30c5('0x25')][_0x30c5('0x2c')](_0x30c5('0x2d'))){_0x5b0bf6[_0x30c5('0x2e')]=qs[_0x30c5('0x2e')](_0x5e1e86[_0x30c5('0x25')][_0x30c5('0x2e')]);_0x5b0bf6[_0x30c5('0x18')]=qs['offset'](_0x5e1e86[_0x30c5('0x25')][_0x30c5('0x18')]);}_0x5b0bf6[_0x30c5('0x2f')]=qs[_0x30c5('0x30')](_0x5e1e86[_0x30c5('0x25')][_0x30c5('0x30')]);_0x5b0bf6[_0x30c5('0x31')]=qs['filters'](_['pick'](_0x5e1e86[_0x30c5('0x25')],_0x3bfb14['filters']));if(_0x5e1e86['query']['filter']){_0x5b0bf6['where']=_['merge'](_0x5b0bf6[_0x30c5('0x31')],{'$or':_[_0x30c5('0x32')](_0x3dd8c9,function(_0x108274){if(_0x108274[_0x30c5('0x33')][_0x30c5('0x34')]!==_0x30c5('0x35')){var _0x2db9b6={};_0x2db9b6[_0x108274['field']]={'$like':'%'+_0x5e1e86[_0x30c5('0x25')]['filter']+'%'};return _0x2db9b6;}})});}_0x5b0bf6=_[_0x30c5('0x36')]({},_0x5b0bf6,_0x5e1e86[_0x30c5('0x37')]);var _0x5a65a6={'where':_0x5b0bf6['where']};return db[_0x30c5('0x38')][_0x30c5('0x17')](_0x5a65a6)[_0x30c5('0x1d')](function(_0x4fbd61){_0x237256[_0x30c5('0x17')]=_0x4fbd61;if(_0x5e1e86['query'][_0x30c5('0x39')]){_0x5b0bf6['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x30c5('0x3a')](_0x5b0bf6);})[_0x30c5('0x1d')](function(_0x559b7d){_0x237256[_0x30c5('0x3b')]=_0x559b7d;return _0x237256;})[_0x30c5('0x1d')](respondWithFilteredResult(_0xfd1e1a,_0x5b0bf6))[_0x30c5('0x3c')](handleError(_0xfd1e1a,null));};exports[_0x30c5('0x3d')]=function(_0x5b6600,_0xda2f41){var _0x2528c4={'raw':!![],'where':{'id':_0x5b6600[_0x30c5('0x3e')]['id']}},_0x422efd={};_0x422efd[_0x30c5('0x28')]=_[_0x30c5('0x24')](db[_0x30c5('0x38')][_0x30c5('0x23')]);_0x422efd[_0x30c5('0x25')]=_['keys'](_0x5b6600[_0x30c5('0x25')]);_0x422efd['filters']=_['intersection'](_0x422efd[_0x30c5('0x28')],_0x422efd[_0x30c5('0x25')]);_0x2528c4[_0x30c5('0x29')]=_[_0x30c5('0x27')](_0x422efd[_0x30c5('0x28')],qs[_0x30c5('0x2a')](_0x5b6600['query'][_0x30c5('0x2a')]));_0x2528c4['attributes']=_0x2528c4[_0x30c5('0x29')][_0x30c5('0x2b')]?_0x2528c4['attributes']:_0x422efd[_0x30c5('0x28')];if(_0x5b6600['query'][_0x30c5('0x39')]){_0x2528c4[_0x30c5('0x3f')]=[{'all':!![]}];}_0x2528c4=_['merge']({},_0x2528c4,_0x5b6600[_0x30c5('0x37')]);return db[_0x30c5('0x38')]['find'](_0x2528c4)[_0x30c5('0x1d')](handleEntityNotFound(_0xda2f41,null))[_0x30c5('0x1d')](respondWithResult(_0xda2f41,null))[_0x30c5('0x3c')](handleError(_0xda2f41,null));};exports['describe']=function(_0x35b4bf,_0x48e459){return db[_0x30c5('0x38')][_0x30c5('0x40')]()[_0x30c5('0x1d')](respondWithResult(_0x48e459,null))[_0x30c5('0x3c')](handleError(_0x48e459,null));};exports['update']=function(_0x1aef86,_0x4ab78f){if(_0x1aef86[_0x30c5('0x41')][_0x30c5('0x42')]){delete _0x1aef86[_0x30c5('0x41')][_0x30c5('0x42')];}return db['CmHopperFinal'][_0x30c5('0x43')]({'where':{'uniqueid':_0x1aef86[_0x30c5('0x3e')]['id']}})[_0x30c5('0x1d')](handleEntityNotFound(_0x4ab78f,null))[_0x30c5('0x1d')](saveUpdates(_0x1aef86['body'],null))[_0x30c5('0x1d')](respondWithResult(_0x4ab78f,null))[_0x30c5('0x3c')](handleError(_0x4ab78f,null));};exports[_0x30c5('0x44')]=function(_0x58c600,_0x1c1133,_0x582c2d){return db[_0x30c5('0x38')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x58c600[_0x30c5('0x3e')]['id']},'attributes':[[db[_0x30c5('0x45')]['fn']('COUNT',db[_0x30c5('0x45')]['fn']('IF',db['sequelize'][_0x30c5('0x46')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x30c5('0x45')]['fn']('COUNT',db[_0x30c5('0x45')]['fn']('IF',db['sequelize'][_0x30c5('0x46')](_0x30c5('0x48')))),_0x30c5('0x49')],[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db['sequelize']['literal'](_0x30c5('0x4a')))),_0x30c5('0x4b')],[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db[_0x30c5('0x45')]['literal'](_0x30c5('0x4c')))),'dropContacts'],[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db[_0x30c5('0x45')]['literal'](_0x30c5('0x4d')))),_0x30c5('0x4e')],[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x30c5('0x4f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')](_0x30c5('0x50')))),_0x30c5('0x51')]]})[_0x30c5('0x1d')](handleEntityNotFound(_0x1c1133,null))[_0x30c5('0x1d')](respondWithResult(_0x1c1133,null))[_0x30c5('0x3c')](handleError(_0x1c1133,null));};exports[_0x30c5('0x52')]=function(_0xe9b9bd,_0x31fc69,_0x33010f){return db[_0x30c5('0x38')][_0x30c5('0x3a')]({'raw':![],'where':{'CampaignId':_0xe9b9bd['params']['id']},'attributes':[[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db['sequelize']['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')](_0x30c5('0x53')))),_0x30c5('0x54')],[db[_0x30c5('0x45')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')]('`state`\x20=\x205,\x201,\x20null'))),_0x30c5('0x49')],[db[_0x30c5('0x45')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x30c5('0x4b')],[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db['sequelize'][_0x30c5('0x46')](_0x30c5('0x4c')))),'dropContacts'],[db['sequelize']['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db[_0x30c5('0x45')]['literal'](_0x30c5('0x4d')))),_0x30c5('0x4e')],[db[_0x30c5('0x45')]['fn'](_0x30c5('0x47'),db[_0x30c5('0x45')]['fn']('IF',db[_0x30c5('0x45')][_0x30c5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x30c5('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x30c5('0x46')](_0x30c5('0x50')))),_0x30c5('0x51')]]})[_0x30c5('0x1d')](handleEntityNotFound(_0x31fc69,null))[_0x30c5('0x1d')](respondWithResult(_0x31fc69,null))[_0x30c5('0x3c')](handleError(_0x31fc69,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x58989f,_0x1fc903,_0x48d233){return db[_0x30c5('0x55')][_0x30c5('0x43')]({'where':{'id':_0x58989f[_0x30c5('0x3e')]['id']}})[_0x30c5('0x1d')](handleEntityNotFound(_0x1fc903,null))[_0x30c5('0x1d')](function(_0x4a83ed){var _0xc611e5;if(_0x4a83ed){_0xc611e5=squel[_0x30c5('0x56')]()[_0x30c5('0x57')]('cm_hopper')[_0x30c5('0x58')](['phone',_0x30c5('0x59'),_0x30c5('0x5a'),_0x30c5('0x5b'),'VoiceQueueId',_0x30c5('0x5c'),'updatedAt'],squel[_0x30c5('0x5d')]()[_0x30c5('0x5e')]('ANY_VALUE(calleridnum)',_0x30c5('0x5f'))[_0x30c5('0x5e')]('NOW()',_0x30c5('0x59'))[_0x30c5('0x5e')](_0x30c5('0x60'),_0x30c5('0x5a'))['field']('ANY_VALUE(ListId)',_0x30c5('0x5b'))[_0x30c5('0x5e')](_0x30c5('0x61'),_0x30c5('0x62'))[_0x30c5('0x5e')](_0x30c5('0x63'),_0x30c5('0x5c'))[_0x30c5('0x5e')](_0x30c5('0x63'),_0x30c5('0x64'))[_0x30c5('0x65')](_0x30c5('0x66'))[_0x30c5('0x31')]('VoiceQueueId\x20=\x20?',_0x58989f[_0x30c5('0x3e')]['id'][_0x30c5('0x67')]())[_0x30c5('0x31')](_0x30c5('0x68'),_0x58989f[_0x30c5('0x41')][_0x30c5('0x69')]['toString']())[_0x30c5('0x31')](_0x30c5('0x6a'))['where'](_0x30c5('0x6b'),squel[_0x30c5('0x5d')]()[_0x30c5('0x5e')](_0x30c5('0x5f'))[_0x30c5('0x65')](_0x30c5('0x6c'))[_0x30c5('0x31')](_0x30c5('0x6d'),_0x58989f[_0x30c5('0x3e')]['id'][_0x30c5('0x67')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x30c5('0x5d')]()[_0x30c5('0x5e')]('calleridnum')[_0x30c5('0x65')]('cm_hopper_final')[_0x30c5('0x31')](_0x30c5('0x6d'),_0x58989f['params']['id'][_0x30c5('0x67')]())[_0x30c5('0x31')](_0x30c5('0x6e')))[_0x30c5('0x6f')](_0x30c5('0x5a')))[_0x30c5('0x67')]();return db['sequelize'][_0x30c5('0x25')](_0xc611e5);}return[];})[_0x30c5('0x1d')](respondWithResult(_0x1fc903,null))['catch'](handleError(_0x1fc903,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1d8754,_0x4dcd2b,_0x2f1f0a){return db[_0x30c5('0x70')][_0x30c5('0x43')]({'where':{'id':_0x1d8754[_0x30c5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4dcd2b,null))['then'](function(_0x3e66e7){var _0x30408c;if(_0x3e66e7){_0x30408c=squel[_0x30c5('0x56')]()[_0x30c5('0x57')](_0x30c5('0x6c'))['fromQuery']([_0x30c5('0x5f'),_0x30c5('0x59'),_0x30c5('0x5a'),_0x30c5('0x5b'),_0x30c5('0x71'),_0x30c5('0x5c'),_0x30c5('0x64')],squel[_0x30c5('0x5d')]()['field'](_0x30c5('0x72'),_0x30c5('0x5f'))[_0x30c5('0x5e')](_0x30c5('0x63'),_0x30c5('0x59'))['field']('ANY_VALUE(ContactId)','ContactId')[_0x30c5('0x5e')]('ANY_VALUE(ListId)','ListId')['field'](_0x30c5('0x73'),'CampaignId')[_0x30c5('0x5e')]('NOW()',_0x30c5('0x5c'))[_0x30c5('0x5e')]('NOW()',_0x30c5('0x64'))['from']('cm_hopper_final')['where'](_0x30c5('0x74'),_0x1d8754[_0x30c5('0x3e')]['id'][_0x30c5('0x67')]())['where'](_0x30c5('0x68'),_0x1d8754[_0x30c5('0x41')][_0x30c5('0x69')][_0x30c5('0x67')]())['where'](_0x30c5('0x6a'))[_0x30c5('0x31')](_0x30c5('0x6b'),squel[_0x30c5('0x5d')]()[_0x30c5('0x5e')](_0x30c5('0x5f'))['from'](_0x30c5('0x6c'))[_0x30c5('0x31')](_0x30c5('0x74'),_0x1d8754['params']['id'][_0x30c5('0x67')]()))[_0x30c5('0x31')](_0x30c5('0x6b'),squel[_0x30c5('0x5d')]()[_0x30c5('0x5e')]('calleridnum')['from'](_0x30c5('0x66'))[_0x30c5('0x31')](_0x30c5('0x74'),_0x1d8754[_0x30c5('0x3e')]['id'][_0x30c5('0x67')]())[_0x30c5('0x31')](_0x30c5('0x6e')))[_0x30c5('0x6f')](_0x30c5('0x5a')))[_0x30c5('0x67')]();return db[_0x30c5('0x45')][_0x30c5('0x25')](_0x30408c);}return[];})[_0x30c5('0x1d')](respondWithResult(_0x4dcd2b,null))['catch'](handleError(_0x4dcd2b,null));};exports[_0x30c5('0x75')]=function(_0x280bce,_0x35826e,_0x4f032b){return db[_0x30c5('0x76')]['findOne']({'where':{'VoiceQueueId':_0x280bce['body']['VoiceQueueId'],'CampaignId':_0x280bce[_0x30c5('0x41')][_0x30c5('0x71')],'ContactId':_0x280bce[_0x30c5('0x41')]['ContactId']}})[_0x30c5('0x1d')](handleEntityNotFound(_0x35826e,null))[_0x30c5('0x1d')](function(_0x2aee6e){if(_0x2aee6e){return _0x2aee6e;}return null;})[_0x30c5('0x1d')](respondWithResult(_0x35826e,null))[_0x30c5('0x3c')](handleError(_0x35826e,null));}; \ No newline at end of file +var _0xcb7b=['intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','map','key','VIRTUAL','filter','options','include','findAll','rows','rawAttributes','includeAll','find','catch','describe','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','calleridnum','toString','state\x20=\x204','group','Campaign','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','model','query','keys'];(function(_0x62d8ca,_0x617aa0){var _0x5302dc=function(_0x1f4626){while(--_0x1f4626){_0x62d8ca['push'](_0x62d8ca['shift']());}};_0x5302dc(++_0x617aa0);}(_0xcb7b,0x14a));var _0xbcb7=function(_0x30f39f,_0x5c85f9){_0x30f39f=_0x30f39f-0x0;var _0x4b4a99=_0xcb7b[_0x30f39f];return _0x4b4a99;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbcb7('0x0'));var zipdir=require(_0xbcb7('0x1'));var jsonpatch=require(_0xbcb7('0x2'));var rp=require(_0xbcb7('0x3'));var moment=require(_0xbcb7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcb7('0x5'));var path=require(_0xbcb7('0x6'));var sox=require(_0xbcb7('0x7'));var csv=require(_0xbcb7('0x8'));var ejs=require(_0xbcb7('0x9'));var fs=require('fs');var _=require(_0xbcb7('0xa'));var squel=require('squel');var crypto=require(_0xbcb7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbcb7('0xc'));var Papa=require('papaparse');var Redis=require(_0xbcb7('0xd'));var authService=require(_0xbcb7('0xe'));var qs=require(_0xbcb7('0xf'));var hardwareService=require(_0xbcb7('0x10'));var logger=require(_0xbcb7('0x11'))(_0xbcb7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xbcb7('0x13'))['db'];function respondWithStatusCode(_0x41790a,_0x6f6d27){_0x6f6d27=_0x6f6d27||0xcc;return function(_0x501da3){if(_0x501da3){return _0x41790a[_0xbcb7('0x14')](_0x6f6d27);}return _0x41790a[_0xbcb7('0x15')](_0x6f6d27)[_0xbcb7('0x16')]();};}function respondWithResult(_0x5ebf5c,_0x36fad0){_0x36fad0=_0x36fad0||0xc8;return function(_0x3390a8){if(_0x3390a8){return _0x5ebf5c[_0xbcb7('0x15')](_0x36fad0)[_0xbcb7('0x17')](_0x3390a8);}};}function respondWithFilteredResult(_0x8921b,_0x1b0a5b){return function(_0x5bd975){if(_0x5bd975){var _0x1e78c4=_0x5bd975[_0xbcb7('0x18')],_0x2aa6cd=_0x1b0a5b['offset'],_0x580b67=_0x1b0a5b[_0xbcb7('0x19')]+_0x1b0a5b[_0xbcb7('0x1a')],_0x459b06;if(_0x580b67>=_0x1e78c4){_0x580b67=_0x1e78c4;_0x459b06=0xc8;}else{_0x459b06=0xce;}_0x8921b['status'](_0x459b06);return _0x8921b['set'](_0xbcb7('0x1b'),_0x2aa6cd+'-'+_0x580b67+'/'+_0x1e78c4)[_0xbcb7('0x17')](_0x5bd975);}return null;};}function patchUpdates(_0x4f9b37){return function(_0xb75b0c){try{jsonpatch[_0xbcb7('0x1c')](_0xb75b0c,_0x4f9b37,!![]);}catch(_0x58bd9d){return BPromise['reject'](_0x58bd9d);}return _0xb75b0c[_0xbcb7('0x1d')]();};}function saveUpdates(_0x24344e,_0x2fd444){return function(_0x1096d3){if(_0x1096d3){return _0x1096d3[_0xbcb7('0x1e')](_0x24344e)[_0xbcb7('0x1f')](function(_0x2d0f5b){return _0x2d0f5b;});}return null;};}function removeEntity(_0x4150cb,_0x343454){return function(_0x1acd93){if(_0x1acd93){return _0x1acd93[_0xbcb7('0x20')]()[_0xbcb7('0x1f')](function(){_0x4150cb[_0xbcb7('0x15')](0xcc)[_0xbcb7('0x16')]();});}};}function handleEntityNotFound(_0x5becac,_0x27c2ff){return function(_0x3b789e){if(!_0x3b789e){_0x5becac['sendStatus'](0x194);}return _0x3b789e;};}function handleError(_0x55df61,_0x213edb){_0x213edb=_0x213edb||0x1f4;return function(_0x890191){logger[_0xbcb7('0x21')](_0x890191[_0xbcb7('0x22')]);if(_0x890191[_0xbcb7('0x23')]){delete _0x890191[_0xbcb7('0x23')];}_0x55df61[_0xbcb7('0x15')](_0x213edb)[_0xbcb7('0x24')](_0x890191);};}exports[_0xbcb7('0x25')]=function(_0x1966ba,_0x1c3836){var _0xb01c9c={},_0x3c052a={},_0x588164={'count':0x0,'rows':[]};var _0x3f74ab=db[_0xbcb7('0x26')]['rawAttributes'];_0x3c052a[_0xbcb7('0x27')]=_['keys'](_0x3f74ab);_0x3c052a[_0xbcb7('0x28')]=_[_0xbcb7('0x29')](_0x1966ba['query']);_0x3c052a['filters']=_[_0xbcb7('0x2a')](_0x3c052a[_0xbcb7('0x27')],_0x3c052a[_0xbcb7('0x28')]);_0xb01c9c[_0xbcb7('0x2b')]=_['intersection'](_0x3c052a[_0xbcb7('0x27')],qs[_0xbcb7('0x2c')](_0x1966ba[_0xbcb7('0x28')][_0xbcb7('0x2c')]));_0xb01c9c[_0xbcb7('0x2b')]=_0xb01c9c[_0xbcb7('0x2b')][_0xbcb7('0x2d')]?_0xb01c9c[_0xbcb7('0x2b')]:_0x3c052a[_0xbcb7('0x27')];if(!_0x1966ba[_0xbcb7('0x28')]['hasOwnProperty'](_0xbcb7('0x2e'))){_0xb01c9c[_0xbcb7('0x1a')]=qs[_0xbcb7('0x1a')](_0x1966ba[_0xbcb7('0x28')][_0xbcb7('0x1a')]);_0xb01c9c['offset']=qs[_0xbcb7('0x19')](_0x1966ba[_0xbcb7('0x28')][_0xbcb7('0x19')]);}_0xb01c9c[_0xbcb7('0x2f')]=qs['sort'](_0x1966ba[_0xbcb7('0x28')][_0xbcb7('0x30')]);_0xb01c9c[_0xbcb7('0x31')]=qs[_0xbcb7('0x32')](_[_0xbcb7('0x33')](_0x1966ba['query'],_0x3c052a[_0xbcb7('0x32')]));if(_0x1966ba['query']['filter']){_0xb01c9c[_0xbcb7('0x31')]=_[_0xbcb7('0x34')](_0xb01c9c[_0xbcb7('0x31')],{'$or':_[_0xbcb7('0x35')](_0x3f74ab,function(_0x4b37cc){if(_0x4b37cc['type'][_0xbcb7('0x36')]!==_0xbcb7('0x37')){var _0x552a26={};_0x552a26[_0x4b37cc['field']]={'$like':'%'+_0x1966ba[_0xbcb7('0x28')][_0xbcb7('0x38')]+'%'};return _0x552a26;}})});}_0xb01c9c=_[_0xbcb7('0x34')]({},_0xb01c9c,_0x1966ba[_0xbcb7('0x39')]);var _0x471ea8={'where':_0xb01c9c['where']};return db[_0xbcb7('0x26')][_0xbcb7('0x18')](_0x471ea8)[_0xbcb7('0x1f')](function(_0x11f69c){_0x588164[_0xbcb7('0x18')]=_0x11f69c;if(_0x1966ba[_0xbcb7('0x28')]['includeAll']){_0xb01c9c[_0xbcb7('0x3a')]=[{'all':!![]}];}return db[_0xbcb7('0x26')][_0xbcb7('0x3b')](_0xb01c9c);})[_0xbcb7('0x1f')](function(_0x3ca283){_0x588164[_0xbcb7('0x3c')]=_0x3ca283;return _0x588164;})[_0xbcb7('0x1f')](respondWithFilteredResult(_0x1c3836,_0xb01c9c))['catch'](handleError(_0x1c3836,null));};exports['show']=function(_0x16da8c,_0x1f5258){var _0x3a37a4={'raw':!![],'where':{'id':_0x16da8c['params']['id']}},_0xe3d544={};_0xe3d544[_0xbcb7('0x27')]=_[_0xbcb7('0x29')](db[_0xbcb7('0x26')][_0xbcb7('0x3d')]);_0xe3d544[_0xbcb7('0x28')]=_[_0xbcb7('0x29')](_0x16da8c[_0xbcb7('0x28')]);_0xe3d544[_0xbcb7('0x32')]=_[_0xbcb7('0x2a')](_0xe3d544[_0xbcb7('0x27')],_0xe3d544[_0xbcb7('0x28')]);_0x3a37a4[_0xbcb7('0x2b')]=_[_0xbcb7('0x2a')](_0xe3d544[_0xbcb7('0x27')],qs[_0xbcb7('0x2c')](_0x16da8c[_0xbcb7('0x28')]['fields']));_0x3a37a4[_0xbcb7('0x2b')]=_0x3a37a4['attributes'][_0xbcb7('0x2d')]?_0x3a37a4[_0xbcb7('0x2b')]:_0xe3d544[_0xbcb7('0x27')];if(_0x16da8c['query'][_0xbcb7('0x3e')]){_0x3a37a4[_0xbcb7('0x3a')]=[{'all':!![]}];}_0x3a37a4=_[_0xbcb7('0x34')]({},_0x3a37a4,_0x16da8c[_0xbcb7('0x39')]);return db[_0xbcb7('0x26')][_0xbcb7('0x3f')](_0x3a37a4)[_0xbcb7('0x1f')](handleEntityNotFound(_0x1f5258,null))[_0xbcb7('0x1f')](respondWithResult(_0x1f5258,null))[_0xbcb7('0x40')](handleError(_0x1f5258,null));};exports[_0xbcb7('0x41')]=function(_0x421ce4,_0x14aa13){return db[_0xbcb7('0x26')]['describe']()[_0xbcb7('0x1f')](respondWithResult(_0x14aa13,null))[_0xbcb7('0x40')](handleError(_0x14aa13,null));};exports[_0xbcb7('0x1e')]=function(_0x20125a,_0x585ac5){if(_0x20125a['body'][_0xbcb7('0x42')]){delete _0x20125a['body'][_0xbcb7('0x42')];}return db[_0xbcb7('0x26')][_0xbcb7('0x3f')]({'where':{'uniqueid':_0x20125a[_0xbcb7('0x43')]['id']}})[_0xbcb7('0x1f')](handleEntityNotFound(_0x585ac5,null))[_0xbcb7('0x1f')](saveUpdates(_0x20125a[_0xbcb7('0x44')],null))[_0xbcb7('0x1f')](respondWithResult(_0x585ac5,null))[_0xbcb7('0x40')](handleError(_0x585ac5,null));};exports[_0xbcb7('0x45')]=function(_0x1ff19a,_0x371be8,_0x5b20e9){return db['CmHopperFinal'][_0xbcb7('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0x1ff19a[_0xbcb7('0x43')]['id']},'attributes':[[db[_0xbcb7('0x46')]['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')](_0xbcb7('0x49')))),'noSuchContacts'],[db['sequelize']['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')](_0xbcb7('0x4a')))),_0xbcb7('0x4b')],[db['sequelize']['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')](_0xbcb7('0x4c')))),_0xbcb7('0x4d')],[db[_0xbcb7('0x46')]['fn'](_0xbcb7('0x47'),db['sequelize']['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')]('`state`\x20=\x208,\x201,\x20null'))),_0xbcb7('0x4e')],[db['sequelize']['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xbcb7('0x4f')],[db[_0xbcb7('0x46')]['fn'](_0xbcb7('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0xbcb7('0x48')](_0xbcb7('0x50')))),'abandonedContacts'],[db[_0xbcb7('0x46')]['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db['sequelize'][_0xbcb7('0x48')]('`state`\x20=\x2022,\x201,\x20null'))),_0xbcb7('0x51')],[db['sequelize']['fn']('COUNT',db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0xbcb7('0x52')]]})['then'](handleEntityNotFound(_0x371be8,null))[_0xbcb7('0x1f')](respondWithResult(_0x371be8,null))[_0xbcb7('0x40')](handleError(_0x371be8,null));};exports[_0xbcb7('0x53')]=function(_0xf80ce2,_0x236327,_0x1e30eb){return db[_0xbcb7('0x26')]['findAll']({'raw':![],'where':{'CampaignId':_0xf80ce2[_0xbcb7('0x43')]['id']},'attributes':[[db[_0xbcb7('0x46')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')](_0xbcb7('0x49')))),_0xbcb7('0x54')],[db[_0xbcb7('0x46')]['fn']('COUNT',db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')](_0xbcb7('0x4a')))),_0xbcb7('0x4b')],[db['sequelize']['fn'](_0xbcb7('0x47'),db['sequelize']['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')]('`state`\x20=\x205,\x201,\x20null'))),_0xbcb7('0x4d')],[db[_0xbcb7('0x46')]['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db['sequelize'][_0xbcb7('0x48')](_0xbcb7('0x55')))),_0xbcb7('0x4e')],[db[_0xbcb7('0x46')]['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')](_0xbcb7('0x56')))),_0xbcb7('0x4f')],[db['sequelize']['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0xbcb7('0x47'),db[_0xbcb7('0x46')]['fn']('IF',db['sequelize'][_0xbcb7('0x48')](_0xbcb7('0x57')))),_0xbcb7('0x51')],[db['sequelize']['fn']('COUNT',db[_0xbcb7('0x46')]['fn']('IF',db[_0xbcb7('0x46')][_0xbcb7('0x48')]('`state`\x20=\x2019,\x201,\x20null'))),_0xbcb7('0x52')]]})[_0xbcb7('0x1f')](handleEntityNotFound(_0x236327,null))[_0xbcb7('0x1f')](respondWithResult(_0x236327,null))[_0xbcb7('0x40')](handleError(_0x236327,null));};exports[_0xbcb7('0x58')]=function(_0x316df6,_0x4fdc76,_0x8743ba){return db[_0xbcb7('0x59')][_0xbcb7('0x3f')]({'where':{'id':_0x316df6[_0xbcb7('0x43')]['id']}})[_0xbcb7('0x1f')](handleEntityNotFound(_0x4fdc76,null))[_0xbcb7('0x1f')](function(_0x3fef29){var _0x4ffc59;if(_0x3fef29){_0x4ffc59=squel[_0xbcb7('0x5a')]()[_0xbcb7('0x5b')](_0xbcb7('0x5c'))[_0xbcb7('0x5d')](['phone',_0xbcb7('0x5e'),_0xbcb7('0x5f'),_0xbcb7('0x60'),_0xbcb7('0x61'),_0xbcb7('0x62'),_0xbcb7('0x63')],squel[_0xbcb7('0x64')]()['field'](_0xbcb7('0x65'),_0xbcb7('0x66'))[_0xbcb7('0x67')]('NOW()',_0xbcb7('0x5e'))[_0xbcb7('0x67')](_0xbcb7('0x68'),'ContactId')[_0xbcb7('0x67')](_0xbcb7('0x69'),_0xbcb7('0x60'))[_0xbcb7('0x67')](_0xbcb7('0x6a'),_0xbcb7('0x61'))[_0xbcb7('0x67')](_0xbcb7('0x6b'),_0xbcb7('0x62'))[_0xbcb7('0x67')]('NOW()',_0xbcb7('0x63'))[_0xbcb7('0x6c')](_0xbcb7('0x6d'))[_0xbcb7('0x31')]('VoiceQueueId\x20=\x20?',_0x316df6[_0xbcb7('0x43')]['id']['toString']())['where']('state\x20=\x20?',_0x316df6[_0xbcb7('0x44')][_0xbcb7('0x6e')]['toString']())['where'](_0xbcb7('0x6f'))[_0xbcb7('0x31')](_0xbcb7('0x70'),squel[_0xbcb7('0x64')]()[_0xbcb7('0x67')](_0xbcb7('0x66'))[_0xbcb7('0x6c')](_0xbcb7('0x5c'))['where'](_0xbcb7('0x71'),_0x316df6['params']['id']['toString']()))[_0xbcb7('0x31')](_0xbcb7('0x70'),squel[_0xbcb7('0x64')]()['field'](_0xbcb7('0x72'))[_0xbcb7('0x6c')](_0xbcb7('0x6d'))[_0xbcb7('0x31')](_0xbcb7('0x71'),_0x316df6[_0xbcb7('0x43')]['id'][_0xbcb7('0x73')]())[_0xbcb7('0x31')](_0xbcb7('0x74')))[_0xbcb7('0x75')](_0xbcb7('0x5f')))['toString']();return db[_0xbcb7('0x46')]['query'](_0x4ffc59);}return[];})[_0xbcb7('0x1f')](respondWithResult(_0x4fdc76,null))[_0xbcb7('0x40')](handleError(_0x4fdc76,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x24c383,_0x3d357f,_0x15d0bf){return db[_0xbcb7('0x76')][_0xbcb7('0x3f')]({'where':{'id':_0x24c383[_0xbcb7('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d357f,null))['then'](function(_0x4c22dc){var _0x127476;if(_0x4c22dc){_0x127476=squel[_0xbcb7('0x5a')]()[_0xbcb7('0x5b')](_0xbcb7('0x5c'))[_0xbcb7('0x5d')]([_0xbcb7('0x66'),_0xbcb7('0x5e'),_0xbcb7('0x5f'),'ListId','CampaignId',_0xbcb7('0x62'),'updatedAt'],squel[_0xbcb7('0x64')]()[_0xbcb7('0x67')](_0xbcb7('0x65'),_0xbcb7('0x66'))[_0xbcb7('0x67')](_0xbcb7('0x6b'),_0xbcb7('0x5e'))['field'](_0xbcb7('0x68'),_0xbcb7('0x5f'))[_0xbcb7('0x67')](_0xbcb7('0x69'),_0xbcb7('0x60'))[_0xbcb7('0x67')]('ANY_VALUE(CampaignId)',_0xbcb7('0x77'))[_0xbcb7('0x67')](_0xbcb7('0x6b'),'createdAt')[_0xbcb7('0x67')](_0xbcb7('0x6b'),_0xbcb7('0x63'))[_0xbcb7('0x6c')](_0xbcb7('0x6d'))[_0xbcb7('0x31')](_0xbcb7('0x78'),_0x24c383['params']['id'][_0xbcb7('0x73')]())[_0xbcb7('0x31')](_0xbcb7('0x79'),_0x24c383[_0xbcb7('0x44')][_0xbcb7('0x6e')]['toString']())[_0xbcb7('0x31')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xbcb7('0x70'),squel[_0xbcb7('0x64')]()[_0xbcb7('0x67')](_0xbcb7('0x66'))[_0xbcb7('0x6c')]('cm_hopper')['where'](_0xbcb7('0x78'),_0x24c383[_0xbcb7('0x43')]['id'][_0xbcb7('0x73')]()))[_0xbcb7('0x31')](_0xbcb7('0x70'),squel[_0xbcb7('0x64')]()[_0xbcb7('0x67')](_0xbcb7('0x72'))[_0xbcb7('0x6c')](_0xbcb7('0x6d'))[_0xbcb7('0x31')](_0xbcb7('0x78'),_0x24c383[_0xbcb7('0x43')]['id'][_0xbcb7('0x73')]())[_0xbcb7('0x31')](_0xbcb7('0x74')))[_0xbcb7('0x75')](_0xbcb7('0x5f')))['toString']();return db[_0xbcb7('0x46')][_0xbcb7('0x28')](_0x127476);}return[];})[_0xbcb7('0x1f')](respondWithResult(_0x3d357f,null))['catch'](handleError(_0x3d357f,null));};exports[_0xbcb7('0x7a')]=function(_0x4178bf,_0x27a404,_0x561d25){return db[_0xbcb7('0x7b')]['findOne']({'where':{'VoiceQueueId':_0x4178bf['body']['VoiceQueueId'],'CampaignId':_0x4178bf[_0xbcb7('0x44')][_0xbcb7('0x77')],'ContactId':_0x4178bf['body'][_0xbcb7('0x5f')]}})[_0xbcb7('0x1f')](handleEntityNotFound(_0x27a404,null))[_0xbcb7('0x1f')](function(_0x1035fa){if(_0x1035fa){return _0x1035fa;}return null;})[_0xbcb7('0x1f')](respondWithResult(_0x27a404,null))['catch'](handleError(_0x27a404,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d76807c..b5a8f98 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 _0x34a5=['exports','define','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x27e607,_0x54e2c0){var _0x19919e=function(_0x1219b8){while(--_0x1219b8){_0x27e607['push'](_0x27e607['shift']());}};_0x19919e(++_0x54e2c0);}(_0x34a5,0xdc));var _0x534a=function(_0x311158,_0x68bd5f){_0x311158=_0x311158-0x0;var _0x1bd3cd=_0x34a5[_0x311158];return _0x1bd3cd;};'use strict';var _=require(_0x534a('0x0'));var util=require(_0x534a('0x1'));var logger=require(_0x534a('0x2'))(_0x534a('0x3'));var moment=require(_0x534a('0x4'));var BPromise=require(_0x534a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x534a('0x6'));var config=require(_0x534a('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x534a('0x8')]=function(_0x49f19a,_0x17f8d6){return _0x49f19a[_0x534a('0x9')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x534a('0xa'),'fields':[_0x534a('0xa')]},{'name':_0x534a('0xb'),'fields':[_0x534a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x521f=['rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','path'];(function(_0x48ea99,_0x1afa32){var _0xa444f8=function(_0x1a03d2){while(--_0x1a03d2){_0x48ea99['push'](_0x48ea99['shift']());}};_0xa444f8(++_0x1afa32);}(_0x521f,0xe8));var _0xf521=function(_0x4de615,_0x45d8e3){_0x4de615=_0x4de615-0x0;var _0x22180c=_0x521f[_0x4de615];return _0x22180c;};'use strict';var _=require(_0xf521('0x0'));var util=require(_0xf521('0x1'));var logger=require('../../config/logger')(_0xf521('0x2'));var moment=require(_0xf521('0x3'));var BPromise=require(_0xf521('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf521('0x5'));var rimraf=require(_0xf521('0x6'));var config=require(_0xf521('0x7'));var attributes=require(_0xf521('0x8'));module[_0xf521('0x9')]=function(_0x118887,_0x1c6d36){return _0x118887[_0xf521('0xa')]('CmHopperFinal',attributes,{'tableName':_0xf521('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xf521('0xc')]},{'name':_0xf521('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 3763d99..deb3294 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 _0xd3d1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','lodash','util'];(function(_0x36a1b8,_0x1384de){var _0xd100d=function(_0x5c0bd4){while(--_0x5c0bd4){_0x36a1b8['push'](_0x36a1b8['shift']());}};_0xd100d(++_0x1384de);}(_0xd3d1,0x172));var _0x1d3d=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xd3d1[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d3d('0x2'));var fs=require('fs');var Redis=require(_0x1d3d('0x3'));var db=require(_0x1d3d('0x4'))['db'];var utils=require(_0x1d3d('0x5'));var logger=require(_0x1d3d('0x6'))(_0x1d3d('0x7'));var config=require(_0x1d3d('0x8'));var jayson=require(_0x1d3d('0x9'));var client=jayson[_0x1d3d('0xa')][_0x1d3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3831ce,_0xb1b3c6,_0xe10bca){return new BPromise(function(_0x2c377c,_0xbea61e){return client[_0x1d3d('0xc')](_0x3831ce,_0xe10bca)[_0x1d3d('0xd')](function(_0x510a37){logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));logger[_0x1d3d('0x11')](_0x1d3d('0x12'),_0xb1b3c6,_0x1d3d('0x10'),JSON[_0x1d3d('0x13')](_0x510a37));if(_0x510a37[_0x1d3d('0x14')]){if(_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x15')]===0x1f4){logger[_0x1d3d('0x14')]('CmHopperFinal,\x20%s,\x20%s',_0xb1b3c6,_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x16')]);return _0xbea61e(_0x510a37['error']['message']);}logger[_0x1d3d('0x14')](_0x1d3d('0xf'),_0xb1b3c6,_0x510a37[_0x1d3d('0x14')]['message']);return _0x2c377c(_0x510a37[_0x1d3d('0x14')]['message']);}else{logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));_0x2c377c(_0x510a37[_0x1d3d('0x17')][_0x1d3d('0x16')]);}})[_0x1d3d('0x18')](function(_0x3dcb67){logger['error']('CmHopperFinal,\x20%s,\x20%s',_0xb1b3c6,_0x3dcb67);_0xbea61e(_0x3dcb67);});});}exports[_0x1d3d('0x19')]=function(_0xe0a583){var _0x50bab4=this;return new Promise(function(_0x3b9174,_0x57d6de){return db[_0x1d3d('0x1a')][_0x1d3d('0x1b')](_0xe0a583[_0x1d3d('0x1c')],{'raw':_0xe0a583[_0x1d3d('0x1d')]?_0xe0a583['options'][_0x1d3d('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x56c424){logger[_0x1d3d('0xe')](_0x1d3d('0x19'),_0xe0a583);logger[_0x1d3d('0x11')](_0x1d3d('0x19'),_0xe0a583,JSON[_0x1d3d('0x13')](_0x56c424));_0x3b9174(_0x56c424);})[_0x1d3d('0x18')](function(_0x471df5){logger[_0x1d3d('0x14')](_0x1d3d('0x19'),_0x471df5[_0x1d3d('0x16')],_0xe0a583);_0x57d6de(_0x50bab4[_0x1d3d('0x14')](0x1f4,_0x471df5['message']));});});}; \ No newline at end of file +var _0xb903=['CmHopperFinal,\x20%s,\x20%s','message','info','result','create','options','then','CreateCmHopperFinal','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1deb3e,_0x290251){var _0x5ddbaa=function(_0x472d81){while(--_0x472d81){_0x1deb3e['push'](_0x1deb3e['shift']());}};_0x5ddbaa(++_0x290251);}(_0xb903,0x185));var _0x3b90=function(_0x2f5ae9,_0x184cb6){_0x2f5ae9=_0x2f5ae9-0x0;var _0x496e96=_0xb903[_0x2f5ae9];return _0x496e96;};'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});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('CmHopperFinal,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}exports['CreateCmHopperFinal']=function(_0x269488){var _0x3cf281=this;return new Promise(function(_0x11ad7d,_0x131f3f){return db['CmHopperFinal'][_0x3b90('0x14')](_0x269488['body'],{'raw':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3b90('0x16')](function(_0x12e1cf){logger[_0x3b90('0x12')](_0x3b90('0x17'),_0x269488);logger[_0x3b90('0x18')](_0x3b90('0x17'),_0x269488,JSON[_0x3b90('0x19')](_0x12e1cf));_0x11ad7d(_0x12e1cf);})[_0x3b90('0x1a')](function(_0xa98414){logger[_0x3b90('0xf')]('CreateCmHopperFinal',_0xa98414[_0x3b90('0x11')],_0x269488);_0x131f3f(_0x3cf281[_0x3b90('0xf')](0x1f4,_0xa98414[_0x3b90('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 373c78d..758cce4 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x38f6ba,_0x246948){var _0x466dbb=function(_0x6917e1){while(--_0x6917e1){_0x38f6ba['push'](_0x38f6ba['shift']());}};_0x466dbb(++_0x246948);}(_0x34e8,0x12c));var _0x834e=function(_0x5e5110,_0x47692b){_0x5e5110=_0x5e5110-0x0;var _0x25aecc=_0x34e8[_0x5e5110];return _0x25aecc;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x18d5bd,_0x56f946){var _0x4473d7=function(_0x4da180){while(--_0x4da180){_0x18d5bd['push'](_0x18d5bd['shift']());}};_0x4473d7(++_0x56f946);}(_0x34e8,0x12c));var _0x834e=function(_0x1aeb68,_0x530e32){_0x1aeb68=_0x1aeb68-0x0;var _0x37cedf=_0x34e8[_0x1aeb68];return _0x37cedf;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('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 50a38d0..3135018 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 _0x23f4=['DATE','INTEGER','STRING','BOOLEAN','exports'];(function(_0x6d52,_0x5e42fd){var _0x3c8221=function(_0x441c3e){while(--_0x441c3e){_0x6d52['push'](_0x6d52['shift']());}};_0x3c8221(++_0x5e42fd);}(_0x23f4,0x1ee));var _0x423f=function(_0x354ed1,_0x425597){_0x354ed1=_0x354ed1-0x0;var _0x1576ea=_0x23f4[_0x354ed1];return _0x1576ea;};'use strict';var Sequelize=require('sequelize');module[_0x423f('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x423f('0x1')]},'countbusyretry':{'type':Sequelize[_0x423f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x423f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x423f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x423f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x423f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x423f('0x3')]},'originatecalleridname':{'type':Sequelize[_0x423f('0x3')]},'calleridnum':{'type':Sequelize[_0x423f('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x423f('0x1')]},'responsetime':{'type':Sequelize[_0x423f('0x1')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x423f('0x1')]},'endtime':{'type':Sequelize[_0x423f('0x1')]},'ringtime':{'type':Sequelize[_0x423f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x423f('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x423f('0x3')]},'membername':{'type':Sequelize[_0x423f('0x3')]},'reason':{'type':Sequelize[_0x423f('0x3')]},'amd':{'type':Sequelize[_0x423f('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x423f('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x423f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x423f('0x1')]},'recallme':{'type':Sequelize[_0x423f('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x423f('0x1')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x89c3=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x5e8b64,_0x3b0ad7){var _0x57cf34=function(_0x261cda){while(--_0x261cda){_0x5e8b64['push'](_0x5e8b64['shift']());}};_0x57cf34(++_0x3b0ad7);}(_0x89c3,0xff));var _0x389c=function(_0x595335,_0x4653a9){_0x595335=_0x595335-0x0;var _0x3a9bd7=_0x89c3[_0x595335];return _0x3a9bd7;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'state':{'type':Sequelize[_0x389c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x389c('0x3')]},'scheduledat':{'type':Sequelize[_0x389c('0x4')]},'countbusyretry':{'type':Sequelize[_0x389c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x389c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x389c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x389c('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x389c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x389c('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x389c('0x4')]},'endtime':{'type':Sequelize[_0x389c('0x4')]},'ringtime':{'type':Sequelize[_0x389c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x389c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x389c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x389c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x389c('0x3')]},'campaign':{'type':Sequelize[_0x389c('0x3')]},'campaigntype':{'type':Sequelize[_0x389c('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x389c('0x3')]},'amd':{'type':Sequelize[_0x389c('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x389c('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x389c('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x389c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x389c('0x4')]},'edited':{'type':Sequelize[_0x389c('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index cbc74a3..a47ea01 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 _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','update','uniqueid','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x5945ff,_0x20c4ee){var _0x15d465=function(_0x4d387b){while(--_0x4d387b){_0x5945ff['push'](_0x5945ff['shift']());}};_0x15d465(++_0x20c4ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['CmHopperHistory'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){return db['CmHopperHistory'][_0x0a9e('0x41')]()['then'](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')]){delete _0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')];}return db[_0x0a9e('0x24')][_0x0a9e('0x3e')]({'where':{'uniqueid':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x3b')](handleError(_0x562fb4,null));}; \ No newline at end of file +var _0xb10b=['options','find','create','describe','body','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','CmHopperHistory','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count','includeAll','findAll','catch','params','model'];(function(_0x3ae4bf,_0x554978){var _0x27f7dd=function(_0x406997){while(--_0x406997){_0x3ae4bf['push'](_0x3ae4bf['shift']());}};_0x27f7dd(++_0x554978);}(_0xb10b,0x12a));var _0xbb10=function(_0x441dd4,_0x582db9){_0x441dd4=_0x441dd4-0x0;var _0x54ea8b=_0xb10b[_0x441dd4];return _0x54ea8b;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':!![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['describe']=function(_0x14e1cb,_0x2f5027){return db[_0xbb10('0x29')][_0xbb10('0x46')]()[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports[_0xbb10('0x23')]=function(_0x5be85e,_0x4a9793){if(_0x5be85e[_0xbb10('0x47')][_0xbb10('0x48')]){delete _0x5be85e[_0xbb10('0x47')]['uniqueid'];}return db['CmHopperHistory'][_0xbb10('0x44')]({'where':{'uniqueid':_0x5be85e[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x4a9793,null))[_0xbb10('0x25')](saveUpdates(_0x5be85e[_0xbb10('0x47')],null))[_0xbb10('0x25')](respondWithResult(_0x4a9793,null))[_0xbb10('0x40')](handleError(_0x4a9793,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 04e41fb..9d1955c 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 _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x3c848b,_0x158967){var _0x34db37=function(_0x2b3618){while(--_0x2b3618){_0x3c848b['push'](_0x3c848b['shift']());}};_0x34db37(++_0x158967);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x15a6ac,_0x475539){var _0x5b89c9=function(_0x4ad798){while(--_0x4ad798){_0x15a6ac['push'](_0x15a6ac['shift']());}};_0x5b89c9(++_0x475539);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 42b7c70..e6e6742 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 _0x336a=['`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=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit'];(function(_0xe65ab6,_0x514b22){var _0x48ed10=function(_0x10071d){while(--_0x10071d){_0xe65ab6['push'](_0xe65ab6['shift']());}};_0x48ed10(++_0x514b22);}(_0x336a,0xa3));var _0xa336=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x336a[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xa336('0x0'));var util=require(_0xa336('0x1'));var moment=require(_0xa336('0x2'));var BPromise=require('bluebird');var rs=require(_0xa336('0x3'));var fs=require('fs');var Redis=require(_0xa336('0x4'));var db=require(_0xa336('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa336('0x6'))(_0xa336('0x7'));var config=require(_0xa336('0x8'));var jayson=require(_0xa336('0x9'));var client=jayson[_0xa336('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbec93d,_0x925e4c,_0x1b25de){return new BPromise(function(_0x527ad8,_0x1fdd6e){return client[_0xa336('0xb')](_0xbec93d,_0x1b25de)[_0xa336('0xc')](function(_0x1c7a09){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x925e4c,_0xa336('0xd'));logger[_0xa336('0xe')](_0xa336('0xf'),_0x925e4c,_0xa336('0xd'),JSON[_0xa336('0x10')](_0x1c7a09));if(_0x1c7a09[_0xa336('0x11')]){if(_0x1c7a09[_0xa336('0x11')][_0xa336('0x12')]===0x1f4){logger['error'](_0xa336('0x13'),_0x925e4c,_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);return _0x1fdd6e(_0x1c7a09[_0xa336('0x11')]['message']);}logger['error'](_0xa336('0x13'),_0x925e4c,_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);return _0x527ad8(_0x1c7a09[_0xa336('0x11')][_0xa336('0x14')]);}else{logger[_0xa336('0x15')](_0xa336('0x13'),_0x925e4c,'request\x20sent');_0x527ad8(_0x1c7a09[_0xa336('0x16')][_0xa336('0x14')]);}})[_0xa336('0x17')](function(_0x4fe949){logger['error'](_0xa336('0x13'),_0x925e4c,_0x4fe949);_0x1fdd6e(_0x4fe949);});});}exports[_0xa336('0x18')]=function(_0x30b5cc){var _0x283ac8=this;return new Promise(function(_0x303861,_0x134cc9){return db[_0xa336('0x19')][_0xa336('0x1a')](_0x30b5cc[_0xa336('0x1b')],{'raw':_0x30b5cc[_0xa336('0x1c')]?_0x30b5cc[_0xa336('0x1c')][_0xa336('0x1d')]===undefined?!![]:![]:!![]})[_0xa336('0xc')](function(_0x53360d){logger[_0xa336('0x15')](_0xa336('0x18'),_0x30b5cc);logger['debug'](_0xa336('0x18'),_0x30b5cc,JSON[_0xa336('0x10')](_0x53360d));_0x303861(_0x53360d);})[_0xa336('0x17')](function(_0x2b2dca){logger[_0xa336('0x11')](_0xa336('0x18'),_0x2b2dca[_0xa336('0x14')],_0x30b5cc);_0x134cc9(_0x283ac8['error'](0x1f4,_0x2b2dca['message']));});});};exports['AvgHandleTime']=function(_0x50bd0f){var _0x5b1d98=this;return new Promise(function(_0x12fc38,_0x745266){return db[_0xa336('0x19')][_0xa336('0x1e')]({'raw':_0x50bd0f[_0xa336('0x1c')]?_0x50bd0f[_0xa336('0x1c')][_0xa336('0x1d')]===undefined?!![]:![]:!![],'where':_0x50bd0f[_0xa336('0x1c')]?_0x50bd0f[_0xa336('0x1c')][_0xa336('0x1f')]||null:null,'attributes':[[db[_0xa336('0x20')]['fn']('COUNT',db[_0xa336('0x20')][_0xa336('0x21')]('id')),_0xa336('0x22')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x25')))),_0xa336('0x26')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0xa336('0x27')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db['sequelize']['fn']('IF',db[_0xa336('0x20')]['literal'](_0xa336('0x28')))),_0xa336('0x29')],[db[_0xa336('0x20')]['fn']('AVG',db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0xa336('0x20')]['fn'](_0xa336('0x2b'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x2c')))),'predictiveIntervalAvgTalktime']]})[_0xa336('0xc')](function(_0x4af287){logger[_0xa336('0x15')](_0xa336('0x2d'),_0x50bd0f);logger['debug'](_0xa336('0x2d'),_0x50bd0f,JSON['stringify'](_0x4af287));_0x12fc38(_0x4af287);})[_0xa336('0x17')](function(_0x2807d9){logger[_0xa336('0x11')](_0xa336('0x2d'),_0x2807d9['message'],_0x50bd0f);_0x745266(_0x5b1d98[_0xa336('0x11')](0x1f4,_0x2807d9[_0xa336('0x14')]));});});};exports[_0xa336('0x2e')]=function(_0x4912d4){var _0x4f0d8d=this;return new Promise(function(_0x1aac91,_0x209395){return db[_0xa336('0x19')][_0xa336('0x1e')]({'raw':_0x4912d4[_0xa336('0x1c')]?_0x4912d4[_0xa336('0x1c')][_0xa336('0x1d')]===undefined?!![]:![]:!![],'where':_0x4912d4[_0xa336('0x1c')]?_0x4912d4[_0xa336('0x1c')]['where']||null:null,'attributes':[[_0xa336('0x2f'),_0xa336('0x30')],[db[_0xa336('0x20')]['fn']('COUNT',db[_0xa336('0x20')]['fn']('IF',db['sequelize'][_0xa336('0x24')]('`state`\x20=\x200,\x201,\x20null'))),_0xa336('0x31')],[db[_0xa336('0x20')]['fn']('COUNT',db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x32')))),_0xa336('0x33')],[db['sequelize']['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0xa336('0x34')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db['sequelize']['fn']('IF',db[_0xa336('0x20')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db['sequelize'][_0xa336('0x24')](_0xa336('0x35')))),_0xa336('0x36')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x37')))),_0xa336('0x38')],[db['sequelize']['fn']('COUNT',db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x39')))),_0xa336('0x3a')],[db[_0xa336('0x20')]['fn']('COUNT',db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')]['literal'](_0xa336('0x3b')))),_0xa336('0x3c')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db['sequelize'][_0xa336('0x24')](_0xa336('0x3d')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x3e')))),_0xa336('0x3f')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x40')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')]['literal'](_0xa336('0x41')))),_0xa336('0x42')],[db['sequelize']['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x43')))),_0xa336('0x44')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x45')))),_0xa336('0x46')]],'group':[_0xa336('0x2f')]})[_0xa336('0xc')](function(_0x16912c){logger[_0xa336('0x15')](_0xa336('0x2e'),_0x4912d4);logger[_0xa336('0xe')](_0xa336('0x2e'),_0x4912d4,JSON[_0xa336('0x10')](_0x16912c));_0x1aac91(_0x16912c);})[_0xa336('0x17')](function(_0x2a5d92){logger['error'](_0xa336('0x2e'),_0x2a5d92[_0xa336('0x14')],_0x4912d4);_0x209395(_0x4f0d8d[_0xa336('0x11')](0x1f4,_0x2a5d92[_0xa336('0x14')]));});});};exports[_0xa336('0x47')]=function(_0x38c283){var _0x56106e=this;return new Promise(function(_0x1ab4d7,_0xd08df8){return db[_0xa336('0x19')]['findAll']({'raw':_0x38c283[_0xa336('0x1c')]?_0x38c283[_0xa336('0x1c')][_0xa336('0x1d')]===undefined?!![]:![]:!![],'where':_0x38c283[_0xa336('0x1c')]?_0x38c283[_0xa336('0x1c')][_0xa336('0x1f')]||null:null,'attributes':[['campaign',_0xa336('0x30')],[db[_0xa336('0x20')]['fn']('COUNT',db['sequelize']['col']('id')),_0xa336('0x48')],[db[_0xa336('0x20')]['fn'](_0xa336('0x23'),db[_0xa336('0x20')]['fn']('IF',db[_0xa336('0x20')][_0xa336('0x24')](_0xa336('0x25')))),_0xa336('0x49')]],'group':[_0xa336('0x2f')]})['then'](function(_0x14cefe){logger['info']('GetCampaignHopperHistory',_0x38c283);logger['debug'](_0xa336('0x47'),_0x38c283,JSON[_0xa336('0x10')](_0x14cefe));_0x1ab4d7(_0x14cefe);})[_0xa336('0x17')](function(_0x2d6d5f){logger[_0xa336('0x11')](_0xa336('0x47'),_0x2d6d5f['message'],_0x38c283);_0xd08df8(_0x56106e[_0xa336('0x11')](0x1f4,_0x2d6d5f[_0xa336('0x14')]));});});}; \ No newline at end of file +var _0xad95=['catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','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','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','util','moment','ioredis','../../mysqldb','rpc','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0xad95,0x70));var _0x5ad9=function(_0xdd4c5d,_0x39cb00){_0xdd4c5d=_0xdd4c5d-0x0;var _0x52aba5=_0xad95[_0xdd4c5d];return _0x52aba5;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});}exports[_0x5ad9('0x11')]=function(_0x54f392){var _0x3d1c8f=this;return new Promise(function(_0x28682f,_0xe4171b){return db[_0x5ad9('0x12')][_0x5ad9('0x13')](_0x54f392[_0x5ad9('0x14')],{'raw':_0x54f392[_0x5ad9('0x15')]?_0x54f392['options'][_0x5ad9('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x49363b){logger[_0x5ad9('0xe')]('CreateCmHopperHistory',_0x54f392);logger[_0x5ad9('0x9')](_0x5ad9('0x11'),_0x54f392,JSON[_0x5ad9('0xa')](_0x49363b));_0x28682f(_0x49363b);})[_0x5ad9('0x10')](function(_0x1274f7){logger['error'](_0x5ad9('0x11'),_0x1274f7['message'],_0x54f392);_0xe4171b(_0x3d1c8f[_0x5ad9('0xb')](0x1f4,_0x1274f7['message']));});});};exports['AvgHandleTime']=function(_0x524249){var _0x1502d6=this;return new Promise(function(_0x3701d8,_0x39a124){return db[_0x5ad9('0x12')][_0x5ad9('0x17')]({'raw':_0x524249[_0x5ad9('0x15')]?_0x524249[_0x5ad9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x524249['options']?_0x524249[_0x5ad9('0x15')]['where']||null:null,'attributes':[[db[_0x5ad9('0x18')]['fn']('COUNT',db[_0x5ad9('0x18')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db['sequelize']['fn']('IF',db['sequelize'][_0x5ad9('0x1a')](_0x5ad9('0x1b')))),_0x5ad9('0x1c')],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db['sequelize'][_0x5ad9('0x1a')](_0x5ad9('0x1d')))),_0x5ad9('0x1e')],[db[_0x5ad9('0x18')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0x5ad9('0x1f'),db[_0x5ad9('0x18')]['fn']('IF',db['sequelize'][_0x5ad9('0x1a')](_0x5ad9('0x20')))),_0x5ad9('0x21')],[db[_0x5ad9('0x18')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')](_0x5ad9('0x22')))),_0x5ad9('0x23')]]})[_0x5ad9('0x6')](function(_0x5b84b6){logger[_0x5ad9('0xe')](_0x5ad9('0x24'),_0x524249);logger[_0x5ad9('0x9')](_0x5ad9('0x24'),_0x524249,JSON[_0x5ad9('0xa')](_0x5b84b6));_0x3701d8(_0x5b84b6);})[_0x5ad9('0x10')](function(_0x524673){logger[_0x5ad9('0xb')](_0x5ad9('0x24'),_0x524673['message'],_0x524249);_0x39a124(_0x1502d6[_0x5ad9('0xb')](0x1f4,_0x524673[_0x5ad9('0xd')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x3de569){var _0x319b95=this;return new Promise(function(_0x12b264,_0x5b2274){return db[_0x5ad9('0x12')][_0x5ad9('0x17')]({'raw':_0x3de569[_0x5ad9('0x15')]?_0x3de569[_0x5ad9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3de569[_0x5ad9('0x15')]?_0x3de569[_0x5ad9('0x15')][_0x5ad9('0x25')]||null:null,'attributes':[[_0x5ad9('0x26'),_0x5ad9('0x27')],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')]['literal'](_0x5ad9('0x28')))),_0x5ad9('0x29')],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db['sequelize'][_0x5ad9('0x1a')](_0x5ad9('0x2a')))),_0x5ad9('0x2b')],[db['sequelize']['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')]['literal'](_0x5ad9('0x1b')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x5ad9('0x18')]['fn']('COUNT',db[_0x5ad9('0x18')]['fn']('IF',db['sequelize'][_0x5ad9('0x1a')]('`state`\x20=\x208,\x201,\x20null'))),_0x5ad9('0x2c')],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')](_0x5ad9('0x2d')))),_0x5ad9('0x2e')],[db[_0x5ad9('0x18')]['fn']('COUNT',db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')](_0x5ad9('0x2f')))),_0x5ad9('0x30')],[db['sequelize']['fn'](_0x5ad9('0x19'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5ad9('0x31')))),_0x5ad9('0x32')],[db[_0x5ad9('0x18')]['fn']('COUNT',db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')](_0x5ad9('0x33')))),'outboundBlacklistCallsDay'],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')]['literal'](_0x5ad9('0x34')))),_0x5ad9('0x35')],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')]('`state`\x20=\x2018,\x201,\x20null'))),_0x5ad9('0x36')],[db['sequelize']['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')](_0x5ad9('0x37')))),_0x5ad9('0x38')],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')](_0x5ad9('0x39')))),_0x5ad9('0x36')],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db['sequelize']['fn']('IF',db[_0x5ad9('0x18')][_0x5ad9('0x1a')](_0x5ad9('0x3a')))),_0x5ad9('0x3b')]],'group':[_0x5ad9('0x26')]})[_0x5ad9('0x6')](function(_0xb5222e){logger[_0x5ad9('0xe')]('GetVoiceQueueHopperHistory',_0x3de569);logger[_0x5ad9('0x9')]('GetVoiceQueueHopperHistory',_0x3de569,JSON[_0x5ad9('0xa')](_0xb5222e));_0x12b264(_0xb5222e);})[_0x5ad9('0x10')](function(_0x469b19){logger['error'](_0x5ad9('0x3c'),_0x469b19[_0x5ad9('0xd')],_0x3de569);_0x5b2274(_0x319b95[_0x5ad9('0xb')](0x1f4,_0x469b19['message']));});});};exports[_0x5ad9('0x3d')]=function(_0x5530e1){var _0x4e2bbb=this;return new Promise(function(_0x4071aa,_0x4312b7){return db['CmHopperHistory']['findAll']({'raw':_0x5530e1[_0x5ad9('0x15')]?_0x5530e1[_0x5ad9('0x15')][_0x5ad9('0x16')]===undefined?!![]:![]:!![],'where':_0x5530e1[_0x5ad9('0x15')]?_0x5530e1[_0x5ad9('0x15')][_0x5ad9('0x25')]||null:null,'attributes':[[_0x5ad9('0x26'),_0x5ad9('0x27')],[db[_0x5ad9('0x18')]['fn']('COUNT',db[_0x5ad9('0x18')][_0x5ad9('0x3e')]('id')),'ivrTotalCallsDays'],[db[_0x5ad9('0x18')]['fn'](_0x5ad9('0x19'),db[_0x5ad9('0x18')]['fn']('IF',db['sequelize'][_0x5ad9('0x1a')](_0x5ad9('0x1b')))),_0x5ad9('0x3f')]],'group':[_0x5ad9('0x26')]})[_0x5ad9('0x6')](function(_0x2ea39d){logger[_0x5ad9('0xe')](_0x5ad9('0x3d'),_0x5530e1);logger['debug'](_0x5ad9('0x3d'),_0x5530e1,JSON[_0x5ad9('0xa')](_0x2ea39d));_0x4071aa(_0x2ea39d);})[_0x5ad9('0x10')](function(_0x2cf9d6){logger[_0x5ad9('0xb')](_0x5ad9('0x3d'),_0x2cf9d6[_0x5ad9('0xd')],_0x5530e1);_0x4312b7(_0x4e2bbb[_0x5ad9('0xb')](0x1f4,_0x2cf9d6[_0x5ad9('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 4d685d1..ff96815 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 _0x8ad5=['describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe'];(function(_0x5fb536,_0x3fa471){var _0x307bab=function(_0x420cf4){while(--_0x420cf4){_0x5fb536['push'](_0x5fb536['shift']());}};_0x307bab(++_0x3fa471);}(_0x8ad5,0xf1));var _0x58ad=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x8ad5[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var path=require(_0x58ad('0x2'));var timeout=require(_0x58ad('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x58ad('0x4'));var interaction=require(_0x58ad('0x5'));var config=require(_0x58ad('0x6'));var controller=require(_0x58ad('0x7'));router[_0x58ad('0x8')]('/',auth[_0x58ad('0x9')](),controller['index']);router['get'](_0x58ad('0xa'),auth[_0x58ad('0x9')](),controller[_0x58ad('0xb')]);router[_0x58ad('0x8')](_0x58ad('0xc'),auth[_0x58ad('0x9')](),controller[_0x58ad('0xd')]);router[_0x58ad('0xe')]('/',auth[_0x58ad('0x9')](),controller['create']);router[_0x58ad('0xf')](_0x58ad('0xc'),auth[_0x58ad('0x9')](),controller[_0x58ad('0x10')]);module[_0x58ad('0x11')]=router; \ No newline at end of file +var _0x61b8=['update','multer','util','path','express','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x41a70d,_0x1dfad6){var _0x27ab11=function(_0x3ab213){while(--_0x3ab213){_0x41a70d['push'](_0x41a70d['shift']());}};_0x27ab11(++_0x1dfad6);}(_0x61b8,0x169));var _0x861b=function(_0xb3ac24,_0x520530){_0xb3ac24=_0xb3ac24-0x0;var _0x51fe6c=_0x61b8[_0xb3ac24];return _0x51fe6c;};'use strict';var multer=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var path=require(_0x861b('0x2'));var timeout=require('connect-timeout');var express=require(_0x861b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x861b('0x4'));var config=require(_0x861b('0x5'));var controller=require(_0x861b('0x6'));router['get']('/',auth[_0x861b('0x7')](),controller[_0x861b('0x8')]);router[_0x861b('0x9')](_0x861b('0xa'),auth[_0x861b('0x7')](),controller[_0x861b('0xb')]);router[_0x861b('0x9')](_0x861b('0xc'),auth[_0x861b('0x7')](),controller[_0x861b('0xd')]);router[_0x861b('0xe')]('/',auth['isAuthenticated'](),controller[_0x861b('0xf')]);router[_0x861b('0x10')](_0x861b('0xc'),auth['isAuthenticated'](),controller[_0x861b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 306f721..67cf91a 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 _0x9957=['exports','STRING','name','sequelize'];(function(_0x31a1ff,_0x26fef9){var _0x2da9b8=function(_0x5f11fe){while(--_0x5f11fe){_0x31a1ff['push'](_0x31a1ff['shift']());}};_0x2da9b8(++_0x26fef9);}(_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')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','name'];(function(_0x29d31e,_0x7b5a9e){var _0x3462e4=function(_0x4dd53d){while(--_0x4dd53d){_0x29d31e['push'](_0x29d31e['shift']());}};_0x3462e4(++_0x7b5a9e);}(_0x98a8,0x12c));var _0x898a=function(_0x11da93,_0x524802){_0x11da93=_0x11da93-0x0;var _0x2037bf=_0x98a8[_0x11da93];return _0x2037bf;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'unique':_0x898a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x898a('0x2')]},'dialPrefix':{'type':Sequelize[_0x898a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 833cb6a..931989c 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 _0x24e5=['params','rawAttributes','includeAll','find','create','body','user','Lists','UserProfileSection','userProfileId','autoAssociation','update','describe','ListId','getDispositions','findOne','Disposition','options','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','omit','success','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','setHeader','Content-type','text/csv','download','addCustomField','transaction','TEXT','Sequelize','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','getCustomFields','addAgents','ids','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','end','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','sendStatus','error','name','index','CmList','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','include','findAll','catch','show'];(function(_0x2c1b1c,_0x5e9c8e){var _0x1520fb=function(_0x313269){while(--_0x313269){_0x2c1b1c['push'](_0x2c1b1c['shift']());}};_0x1520fb(++_0x5e9c8e);}(_0x24e5,0x1c9));var _0x524e=function(_0x50c155,_0x35307e){_0x50c155=_0x50c155-0x0;var _0x23eb03=_0x24e5[_0x50c155];return _0x23eb03;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x524e('0x0'));var moment=require('moment');var BPromise=require(_0x524e('0x1'));var Mustache=require(_0x524e('0x2'));var util=require(_0x524e('0x3'));var path=require(_0x524e('0x4'));var sox=require(_0x524e('0x5'));var csv=require(_0x524e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x524e('0x7'));var squel=require(_0x524e('0x8'));var crypto=require(_0x524e('0x9'));var jsforce=require(_0x524e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x524e('0x6'));var querystring=require(_0x524e('0xb'));var Papa=require('papaparse');var Redis=require(_0x524e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x524e('0xd'));var hardwareService=require(_0x524e('0xe'));var logger=require(_0x524e('0xf'))(_0x524e('0x10'));var utils=require(_0x524e('0x11'));var config=require(_0x524e('0x12'));var db=require(_0x524e('0x13'))['db'];config[_0x524e('0x14')]=_[_0x524e('0x15')](config[_0x524e('0x14')],{'host':_0x524e('0x16'),'port':0x18eb});var socket=require(_0x524e('0x17'))(new Redis(config[_0x524e('0x14')]));require(_0x524e('0x18'))['register'](socket);function respondWithStatusCode(_0x31e67a,_0x47b773){_0x47b773=_0x47b773||0xcc;return function(_0x3dd939){if(_0x3dd939){return _0x31e67a['sendStatus'](_0x47b773);}return _0x31e67a['status'](_0x47b773)[_0x524e('0x19')]();};}function respondWithResult(_0x339cf1,_0x4b5fba){_0x4b5fba=_0x4b5fba||0xc8;return function(_0x4a1199){if(_0x4a1199){return _0x339cf1[_0x524e('0x1a')](_0x4b5fba)[_0x524e('0x1b')](_0x4a1199);}};}function respondWithFilteredResult(_0x1aa6aa,_0xcb6e1f){return function(_0x59a7c6){if(_0x59a7c6){var _0x2367f3=_0x59a7c6[_0x524e('0x1c')],_0x33594e=_0xcb6e1f[_0x524e('0x1d')],_0x4ce276=_0xcb6e1f[_0x524e('0x1d')]+_0xcb6e1f[_0x524e('0x1e')],_0x33f377;if(_0x4ce276>=_0x2367f3){_0x4ce276=_0x2367f3;_0x33f377=0xc8;}else{_0x33f377=0xce;}_0x1aa6aa[_0x524e('0x1a')](_0x33f377);return _0x1aa6aa[_0x524e('0x1f')](_0x524e('0x20'),_0x33594e+'-'+_0x4ce276+'/'+_0x2367f3)[_0x524e('0x1b')](_0x59a7c6);}return null;};}function patchUpdates(_0x6cc3d3){return function(_0x1821b6){try{jsonpatch[_0x524e('0x21')](_0x1821b6,_0x6cc3d3,!![]);}catch(_0x2f4475){return BPromise['reject'](_0x2f4475);}return _0x1821b6[_0x524e('0x22')]();};}function saveUpdates(_0x1c1f16,_0x173b5d){return function(_0x2f9207){if(_0x2f9207){return _0x2f9207['update'](_0x1c1f16)[_0x524e('0x23')](function(_0x179a8b){return _0x179a8b;});}return null;};}function removeEntity(_0x10ee2d,_0xc6d2c5){return function(_0x2d96ae){if(_0x2d96ae){return _0x2d96ae[_0x524e('0x24')]()['then'](function(){var _0x4be9e7=_0x2d96ae[_0x524e('0x25')]({'plain':!![]});var _0x51f52a='Lists';return db[_0x524e('0x26')][_0x524e('0x24')]({'where':{'type':_0x51f52a,'resourceId':_0x4be9e7['id']}})[_0x524e('0x23')](function(){return _0x2d96ae;});})['then'](function(){_0x10ee2d[_0x524e('0x1a')](0xcc)[_0x524e('0x19')]();});}};}function handleEntityNotFound(_0x43d6d5,_0x12c553){return function(_0x3e2dbb){if(!_0x3e2dbb){_0x43d6d5[_0x524e('0x27')](0x194);}return _0x3e2dbb;};}function handleError(_0x766922,_0x2eda22){_0x2eda22=_0x2eda22||0x1f4;return function(_0x3d7c29){logger[_0x524e('0x28')](_0x3d7c29['stack']);if(_0x3d7c29[_0x524e('0x29')]){delete _0x3d7c29['name'];}_0x766922[_0x524e('0x1a')](_0x2eda22)['send'](_0x3d7c29);};}exports[_0x524e('0x2a')]=function(_0x133529,_0x2ff2cf){var _0x266949={},_0x4318d8={},_0x46c2b6={'count':0x0,'rows':[]};var _0x4f397c=db[_0x524e('0x2b')]['rawAttributes'];_0x4318d8[_0x524e('0x2c')]=_[_0x524e('0x2d')](_0x4f397c);_0x4318d8[_0x524e('0x2e')]=_['keys'](_0x133529[_0x524e('0x2e')]);_0x4318d8[_0x524e('0x2f')]=_['intersection'](_0x4318d8['model'],_0x4318d8[_0x524e('0x2e')]);_0x266949['attributes']=_[_0x524e('0x30')](_0x4318d8[_0x524e('0x2c')],qs[_0x524e('0x31')](_0x133529['query'][_0x524e('0x31')]));_0x266949[_0x524e('0x32')]=_0x266949['attributes'][_0x524e('0x33')]?_0x266949[_0x524e('0x32')]:_0x4318d8[_0x524e('0x2c')];if(!_0x133529[_0x524e('0x2e')][_0x524e('0x34')](_0x524e('0x35'))){_0x266949[_0x524e('0x1e')]=qs[_0x524e('0x1e')](_0x133529[_0x524e('0x2e')]['limit']);_0x266949[_0x524e('0x1d')]=qs[_0x524e('0x1d')](_0x133529[_0x524e('0x2e')][_0x524e('0x1d')]);}_0x266949[_0x524e('0x36')]=qs[_0x524e('0x37')](_0x133529[_0x524e('0x2e')][_0x524e('0x37')]);_0x266949[_0x524e('0x38')]=qs[_0x524e('0x2f')](_[_0x524e('0x39')](_0x133529[_0x524e('0x2e')],_0x4318d8[_0x524e('0x2f')]));if(_0x133529[_0x524e('0x2e')][_0x524e('0x3a')]){_0x266949[_0x524e('0x38')]=_[_0x524e('0x3b')](_0x266949[_0x524e('0x38')],{'$or':_[_0x524e('0x3c')](_0x4f397c,function(_0x597bd0){if(_0x597bd0[_0x524e('0x3d')]['key']!=='VIRTUAL'){var _0x2b1786={};_0x2b1786[_0x597bd0[_0x524e('0x3e')]]={'$like':'%'+_0x133529[_0x524e('0x2e')][_0x524e('0x3a')]+'%'};return _0x2b1786;}})});}_0x266949=_['merge']({},_0x266949,_0x133529['options']);var _0x5ecfbb={'where':_0x266949[_0x524e('0x38')]};return db[_0x524e('0x2b')]['count'](_0x5ecfbb)['then'](function(_0x1c9e85){_0x46c2b6['count']=_0x1c9e85;if(_0x133529[_0x524e('0x2e')]['includeAll']){_0x266949[_0x524e('0x3f')]=[{'all':!![]}];}return db['CmList'][_0x524e('0x40')](_0x266949);})[_0x524e('0x23')](function(_0x475916){_0x46c2b6['rows']=_0x475916;return _0x46c2b6;})[_0x524e('0x23')](respondWithFilteredResult(_0x2ff2cf,_0x266949))[_0x524e('0x41')](handleError(_0x2ff2cf,null));};exports[_0x524e('0x42')]=function(_0x4e0708,_0xdbaf9f){var _0x578602={'raw':![],'where':{'id':_0x4e0708[_0x524e('0x43')]['id']}},_0x512dda={};_0x512dda[_0x524e('0x2c')]=_[_0x524e('0x2d')](db[_0x524e('0x2b')][_0x524e('0x44')]);_0x512dda[_0x524e('0x2e')]=_[_0x524e('0x2d')](_0x4e0708['query']);_0x512dda['filters']=_['intersection'](_0x512dda['model'],_0x512dda[_0x524e('0x2e')]);_0x578602[_0x524e('0x32')]=_[_0x524e('0x30')](_0x512dda[_0x524e('0x2c')],qs['fields'](_0x4e0708[_0x524e('0x2e')]['fields']));_0x578602[_0x524e('0x32')]=_0x578602[_0x524e('0x32')][_0x524e('0x33')]?_0x578602[_0x524e('0x32')]:_0x512dda['model'];if(_0x4e0708[_0x524e('0x2e')][_0x524e('0x45')]){_0x578602[_0x524e('0x3f')]=[{'all':!![]}];}_0x578602=_[_0x524e('0x3b')]({},_0x578602,_0x4e0708['options']);return db[_0x524e('0x2b')][_0x524e('0x46')](_0x578602)['then'](handleEntityNotFound(_0xdbaf9f,null))[_0x524e('0x23')](respondWithResult(_0xdbaf9f,null))['catch'](handleError(_0xdbaf9f,null));};exports[_0x524e('0x47')]=function(_0x1c8041,_0x3b946e){return db[_0x524e('0x2b')][_0x524e('0x47')](_0x1c8041[_0x524e('0x48')],{})[_0x524e('0x23')](function(_0x5a9d01){var _0x2f8030=_0x1c8041['user'][_0x524e('0x25')]({'plain':!![]});if(!_0x2f8030)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8030['role']===_0x524e('0x49')){var _0x5d4259=_0x5a9d01[_0x524e('0x25')]({'plain':!![]});var _0x3f06da=_0x524e('0x4a');return db[_0x524e('0x4b')][_0x524e('0x46')]({'where':{'name':_0x3f06da,'userProfileId':_0x2f8030[_0x524e('0x4c')]},'raw':!![]})[_0x524e('0x23')](function(_0x34e0f4){if(_0x34e0f4&&_0x34e0f4[_0x524e('0x4d')]===0x0){return db[_0x524e('0x26')]['create']({'name':_0x5d4259['name'],'resourceId':_0x5d4259['id'],'type':_0x34e0f4[_0x524e('0x29')],'sectionId':_0x34e0f4['id']},{})['then'](function(){return _0x5a9d01;});}else{return _0x5a9d01;}})[_0x524e('0x41')](function(_0x1c5a33){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c5a33);throw _0x1c5a33;});}return _0x5a9d01;})[_0x524e('0x23')](respondWithResult(_0x3b946e,0xc9))[_0x524e('0x41')](handleError(_0x3b946e,null));};exports[_0x524e('0x4e')]=function(_0x29647f,_0x57ec11){if(_0x29647f['body']['id']){delete _0x29647f[_0x524e('0x48')]['id'];}return db[_0x524e('0x2b')][_0x524e('0x46')]({'where':{'id':_0x29647f[_0x524e('0x43')]['id']}})['then'](handleEntityNotFound(_0x57ec11,null))['then'](saveUpdates(_0x29647f['body'],null))[_0x524e('0x23')](respondWithResult(_0x57ec11,null))['catch'](handleError(_0x57ec11,null));};exports[_0x524e('0x24')]=function(_0x3f7676,_0xe76ca5){return db[_0x524e('0x2b')][_0x524e('0x46')]({'where':{'id':_0x3f7676[_0x524e('0x43')]['id']}})['then'](handleEntityNotFound(_0xe76ca5,null))[_0x524e('0x23')](removeEntity(_0xe76ca5,null))[_0x524e('0x41')](handleError(_0xe76ca5,null));};exports[_0x524e('0x4f')]=function(_0x19ac21,_0x365d38){return db[_0x524e('0x2b')][_0x524e('0x4f')]()[_0x524e('0x23')](respondWithResult(_0x365d38,null))['catch'](handleError(_0x365d38,null));};exports['addDisposition']=function(_0x7de9d1,_0x5d40ff,_0x74d896){if(_0x7de9d1[_0x524e('0x48')]['id']){delete _0x7de9d1[_0x524e('0x48')]['id'];}return db[_0x524e('0x2b')][_0x524e('0x46')]({'where':{'id':_0x7de9d1[_0x524e('0x43')]['id']}})[_0x524e('0x23')](handleEntityNotFound(_0x5d40ff,null))[_0x524e('0x23')](function(_0x3d29d3){if(_0x3d29d3){_0x7de9d1[_0x524e('0x48')][_0x524e('0x50')]=_0x3d29d3['id'];return db['Disposition']['create'](_0x7de9d1[_0x524e('0x48')]);}})[_0x524e('0x23')](respondWithResult(_0x5d40ff,null))[_0x524e('0x41')](handleError(_0x5d40ff,null));};exports[_0x524e('0x51')]=function(_0x9acf6a,_0x7940c3,_0x142ed0){var _0x3a5ec7={'raw':![],'where':{}};var _0x386bea={};var _0x4f6730={'count':0x0,'rows':[]};return db[_0x524e('0x2b')][_0x524e('0x52')]({'where':{'id':_0x9acf6a[_0x524e('0x43')]['id']}})['then'](handleEntityNotFound(_0x7940c3,null))['then'](function(_0x5b76bf){if(_0x5b76bf){_0x386bea[_0x524e('0x2c')]=_[_0x524e('0x2d')](db[_0x524e('0x53')][_0x524e('0x44')]);_0x386bea[_0x524e('0x2e')]=_['keys'](_0x9acf6a[_0x524e('0x2e')]);_0x386bea[_0x524e('0x2f')]=_[_0x524e('0x30')](_0x386bea[_0x524e('0x2c')],_0x386bea[_0x524e('0x2e')]);_0x3a5ec7['attributes']=_[_0x524e('0x30')](_0x386bea[_0x524e('0x2c')],qs[_0x524e('0x31')](_0x9acf6a[_0x524e('0x2e')][_0x524e('0x31')]));_0x3a5ec7[_0x524e('0x32')]=_0x3a5ec7[_0x524e('0x32')]['length']?_0x3a5ec7[_0x524e('0x32')]:_0x386bea[_0x524e('0x2c')];if(!_0x9acf6a[_0x524e('0x2e')][_0x524e('0x34')](_0x524e('0x35'))){_0x3a5ec7[_0x524e('0x1e')]=qs[_0x524e('0x1e')](_0x9acf6a[_0x524e('0x2e')][_0x524e('0x1e')]);_0x3a5ec7['offset']=qs[_0x524e('0x1d')](_0x9acf6a[_0x524e('0x2e')][_0x524e('0x1d')]);}_0x3a5ec7['order']=qs[_0x524e('0x37')](_0x9acf6a[_0x524e('0x2e')][_0x524e('0x37')]);_0x3a5ec7[_0x524e('0x38')]=qs['filters'](_['pick'](_0x9acf6a[_0x524e('0x2e')],_0x386bea[_0x524e('0x2f')]));_0x3a5ec7[_0x524e('0x38')][_0x524e('0x50')]=_0x5b76bf['id'];if(_0x9acf6a['query'][_0x524e('0x3a')]){_0x3a5ec7[_0x524e('0x38')]=_['merge'](_0x3a5ec7[_0x524e('0x38')],{'$or':_[_0x524e('0x3c')](_0x3a5ec7[_0x524e('0x32')],function(_0xe7eae5){var _0x529a79={};_0x529a79[_0xe7eae5]={'$like':'%'+_0x9acf6a['query'][_0x524e('0x3a')]+'%'};return _0x529a79;})});}_0x3a5ec7=_[_0x524e('0x3b')]({},_0x3a5ec7,_0x9acf6a[_0x524e('0x54')]);return db[_0x524e('0x53')]['count']({'where':_0x3a5ec7[_0x524e('0x38')]})[_0x524e('0x23')](function(_0x9edd28){_0x4f6730[_0x524e('0x1c')]=_0x9edd28;if(_0x9acf6a['query'][_0x524e('0x45')]){_0x3a5ec7[_0x524e('0x3f')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3a5ec7);})[_0x524e('0x23')](function(_0x50951b){_0x4f6730[_0x524e('0x55')]=_0x50951b;return _0x4f6730;});}})[_0x524e('0x23')](respondWithFilteredResult(_0x7940c3,_0x3a5ec7))[_0x524e('0x41')](handleError(_0x7940c3,null));};exports[_0x524e('0x56')]=function(_0x2f723c,_0x5359d4,_0x423306){return db[_0x524e('0x2b')]['find']({'where':{'id':_0x2f723c[_0x524e('0x43')]['id']}})['then'](handleEntityNotFound(_0x5359d4,null))[_0x524e('0x23')](function(_0x490504){if(_0x490504){return _0x490504[_0x524e('0x56')](_0x2f723c[_0x524e('0x2e')]['ids']);}})[_0x524e('0x23')](respondWithStatusCode(_0x5359d4,null))['catch'](handleError(_0x5359d4,null));};exports[_0x524e('0x57')]=function(_0x4e7841,_0x2ef78c,_0x2b6e2a){return db[_0x524e('0x2b')][_0x524e('0x46')]({'where':{'id':_0x4e7841[_0x524e('0x43')]['id']}})[_0x524e('0x23')](handleEntityNotFound(_0x2ef78c,null))['then'](function(_0x5c1da0){if(_0x5c1da0){var _0x4da23d=[];var _0xe3ee87={'success':[],'errors':[]};return db[_0x524e('0x58')][_0x524e('0x4f')]()[_0x524e('0x23')](function(_0x37339f){if(_0x4e7841[_0x524e('0x48')][_0x524e('0x59')]&&_[_0x524e('0x5a')](_0x4e7841[_0x524e('0x48')]['tags'])){if(_0x4e7841[_0x524e('0x48')]['tags'][_0x524e('0x33')]){_0x4e7841[_0x524e('0x48')][_0x524e('0x59')]=_0x4e7841[_0x524e('0x48')][_0x524e('0x59')][_0x524e('0x5b')](';')+';';}else{_0x4e7841['body']['tags']=null;}}else{_0x4e7841['body'][_0x524e('0x59')]=null;}if(_0x4e7841[_0x524e('0x48')]&&_[_0x524e('0x5a')](_0x4e7841[_0x524e('0x48')])){for(var _0x1a938e=0x0;_0x1a938e<_0x4e7841['body'][_0x524e('0x33')];_0x1a938e+=0x1){_0x4e7841[_0x524e('0x48')][_0x1a938e]['ListId']=_0x4e7841[_0x524e('0x43')]['id'];_0x4da23d[_0x524e('0x5c')](_0x4e7841['body'][_0x1a938e]);}return BPromise['each'](_0x4da23d,function(_0x5c258a){return db['CmContact'][_0x524e('0x47')](_[_0x524e('0x5d')](_0x5c258a,['ids','id'])||{},{'fields':_[_0x524e('0x2d')](_0x37339f),'raw':!![]})['then'](function(_0x3d685c){_0xe3ee87[_0x524e('0x5e')][_0x524e('0x5c')](_0x3d685c['dataValues']);})['catch'](function(_0x4060f5){_0xe3ee87[_0x524e('0x5f')]['push']({'data':_0x5c258a,'error':_0x4060f5[_0x524e('0x60')]});});})[_0x524e('0x23')](function(_0x102254){return _0xe3ee87;})[_0x524e('0x41')](function(_0x5c1361){return _0x5c1361;});}else{_0x2ef78c[_0x524e('0x1a')](0x190)[_0x524e('0x1b')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x524e('0x23')](respondWithResult(_0x2ef78c,null))[_0x524e('0x41')](handleError(_0x2ef78c,null));};exports[_0x524e('0x61')]=function(_0x173a0b,_0x4f7358,_0x467f78){var _0x465e98;return db['CmList'][_0x524e('0x46')]({'where':{'id':_0x173a0b[_0x524e('0x43')]['id']},'include':[{'model':db[_0x524e('0x62')],'as':_0x524e('0x63')}]})[_0x524e('0x23')](handleEntityNotFound(_0x4f7358,null))[_0x524e('0x23')](function(_0x47904e){if(_0x47904e){_0x465e98=_0x47904e;return db[_0x524e('0x58')][_0x524e('0x44')];}})[_0x524e('0x23')](function(_0x15c93f){if(_0x15c93f){var _0x562c8f={};var _0x4c03e6={};_0x4c03e6[_0x524e('0x2c')]=_[_0x524e('0x64')](_[_0x524e('0x2d')](_0x15c93f),_[_0x524e('0x3c')](_0x465e98[_0x524e('0x63')],function(_0x149a43){return util[_0x524e('0x65')](_0x524e('0x66'),_0x149a43['id']);}));_0x4c03e6['query']=_[_0x524e('0x2d')](_0x173a0b[_0x524e('0x2e')]);_0x4c03e6['filters']=_['intersection'](_0x4c03e6[_0x524e('0x2c')],_0x4c03e6[_0x524e('0x2e')]);_0x562c8f[_0x524e('0x32')]=_[_0x524e('0x30')](_0x4c03e6['model'],qs[_0x524e('0x31')](_0x173a0b['query'][_0x524e('0x31')]));_0x562c8f[_0x524e('0x32')]=_0x562c8f['attributes'][_0x524e('0x33')]?_0x562c8f[_0x524e('0x32')]:_0x4c03e6[_0x524e('0x2c')];if(!_0x173a0b[_0x524e('0x2e')][_0x524e('0x34')]('nolimit')){_0x562c8f['limit']=qs['limit'](_0x173a0b['query']['limit']);_0x562c8f[_0x524e('0x1d')]=qs[_0x524e('0x1d')](_0x173a0b[_0x524e('0x2e')]['offset']);}_0x562c8f['order']=qs[_0x524e('0x37')](_0x173a0b['query'][_0x524e('0x37')]);_0x562c8f[_0x524e('0x38')]=qs[_0x524e('0x2f')](_[_0x524e('0x39')](_0x173a0b[_0x524e('0x2e')],_0x4c03e6[_0x524e('0x2f')]));_0x562c8f[_0x524e('0x67')]=!![];if(_0x173a0b[_0x524e('0x2e')]['filter']){_0x562c8f['where']=_['merge'](_0x562c8f[_0x524e('0x38')],{'$or':_[_0x524e('0x3c')](_0x562c8f['attributes'],function(_0x7d7435){var _0xd5335c={};_0xd5335c[_0x7d7435]={'$like':'%'+_0x173a0b[_0x524e('0x2e')][_0x524e('0x3a')]+'%'};return _0xd5335c;})});}_0x562c8f=_[_0x524e('0x3b')]({},_0x562c8f,_0x173a0b[_0x524e('0x54')]);return _0x465e98['getContacts'](_0x562c8f);}})[_0x524e('0x23')](respondWithResult(_0x4f7358,null))[_0x524e('0x41')](handleError(_0x4f7358,null));};exports['getContactsCsv']=function(_0x1ad040,_0x597fd4,_0x32ac67){var _0x3f14a0;return db[_0x524e('0x2b')][_0x524e('0x46')]({'where':{'id':_0x1ad040[_0x524e('0x43')]['id']},'include':[{'model':db[_0x524e('0x62')],'as':_0x524e('0x63')}]})[_0x524e('0x23')](handleEntityNotFound(_0x597fd4,null))[_0x524e('0x23')](function(_0x5be0b5){if(_0x5be0b5){_0x3f14a0=_0x5be0b5;return db[_0x524e('0x58')][_0x524e('0x44')];}})[_0x524e('0x23')](function(_0x67507c){if(_0x67507c){var _0x1a16cc={};var _0x2f1a9c={};_0x2f1a9c[_0x524e('0x2c')]=_['concat'](_[_0x524e('0x2d')](_0x67507c),_[_0x524e('0x3c')](_0x3f14a0['CustomFields'],function(_0x94020b){return util['format'](_0x524e('0x66'),_0x94020b['id']);}));_0x2f1a9c['query']=_[_0x524e('0x2d')](_0x1ad040['query']);_0x2f1a9c[_0x524e('0x2f')]=_['intersection'](_0x2f1a9c[_0x524e('0x2c')],_0x2f1a9c[_0x524e('0x2e')]);_0x1a16cc[_0x524e('0x32')]=_['intersection'](_0x2f1a9c[_0x524e('0x2c')],qs[_0x524e('0x31')](_0x1ad040[_0x524e('0x2e')]['fields']));_0x1a16cc['attributes']=_0x1a16cc[_0x524e('0x32')]['length']?_0x1a16cc[_0x524e('0x32')]:_0x2f1a9c['model'];if(!_0x1ad040[_0x524e('0x2e')][_0x524e('0x34')](_0x524e('0x35'))){_0x1a16cc[_0x524e('0x1e')]=qs[_0x524e('0x1e')](_0x1ad040['query']['limit']);_0x1a16cc['offset']=qs[_0x524e('0x1d')](_0x1ad040[_0x524e('0x2e')][_0x524e('0x1d')]);}_0x1a16cc['order']=qs[_0x524e('0x37')](_0x1ad040[_0x524e('0x2e')][_0x524e('0x37')]);_0x1a16cc['where']=qs['filters'](_[_0x524e('0x39')](_0x1ad040[_0x524e('0x2e')],_0x2f1a9c[_0x524e('0x2f')]));_0x1a16cc[_0x524e('0x67')]=!![];if(_0x1ad040[_0x524e('0x2e')][_0x524e('0x3a')]){_0x1a16cc[_0x524e('0x38')]=_[_0x524e('0x3b')](_0x1a16cc[_0x524e('0x38')],{'$or':_[_0x524e('0x3c')](_0x1a16cc[_0x524e('0x32')],function(_0x189fd2){var _0x54904d={};_0x54904d[_0x189fd2]={'$like':'%'+_0x1ad040[_0x524e('0x2e')][_0x524e('0x3a')]+'%'};return _0x54904d;})});}_0x1a16cc=_[_0x524e('0x3b')]({},_0x1a16cc,_0x1ad040[_0x524e('0x54')]);return _0x3f14a0[_0x524e('0x61')](_0x1a16cc);}})[_0x524e('0x23')](function(_0x15df72){if(!_['isEmpty'](_0x15df72)){var _0x4cb89e=toCsv(_0x15df72);var _0xae0229=Date[_0x524e('0x68')]();fs[_0x524e('0x69')](util[_0x524e('0x65')](_0x524e('0x6a'),_0x3f14a0['id'],_0xae0229),_0x4cb89e);_0x597fd4['setHeader'](_0x524e('0x6b'),'attachment;\x20filename='+util['format']('list_%d_%s.csv',_0x3f14a0['id'],_0xae0229));_0x597fd4[_0x524e('0x6c')](_0x524e('0x6d'),_0x524e('0x6e'));return _0x597fd4[_0x524e('0x6f')](util['format'](_0x524e('0x6a'),_0x3f14a0['id'],_0xae0229));}else{return _0x597fd4['sendStatus'](0xcc);}})[_0x524e('0x41')](handleError(_0x597fd4,null));};exports[_0x524e('0x70')]=function(_0xcd67bf,_0x2815eb,_0x28e524){var _0x3a6e4d;delete _0xcd67bf['body']['id'];return db[_0x524e('0x2b')][_0x524e('0x52')]({'where':{'id':_0xcd67bf[_0x524e('0x43')]['id']}})['then'](handleEntityNotFound(_0x2815eb,null))[_0x524e('0x23')](function(_0x50acda){if(_0x50acda){return db['sequelize'][_0x524e('0x71')](function(_0x25d9a8){return db[_0x524e('0x62')]['create'](_0xcd67bf[_0x524e('0x48')],{'transaction':_0x25d9a8})[_0x524e('0x23')](function(_0x1fae45){_0x3a6e4d=_0x1fae45;return _0x50acda['addCustomFields'](_0x1fae45,{'transaction':_0x25d9a8});})[_0x524e('0x23')](function(){var _0x5555ae={'type':db['Sequelize'][_0x524e('0x72')],'transaction':_0x25d9a8};switch(_0xcd67bf[_0x524e('0x48')]['type']){case'text':_0x5555ae[_0x524e('0x3d')]=db['Sequelize'][_0x524e('0x72')];break;case'number':_0x5555ae[_0x524e('0x3d')]=db[_0x524e('0x73')]['INTEGER'];break;case _0x524e('0x74'):_0x5555ae[_0x524e('0x3d')]=db[_0x524e('0x73')][_0x524e('0x75')];_0x5555ae[_0x524e('0x76')]=![];break;default:}return db[_0x524e('0x77')][_0x524e('0x78')]['addColumn'](_0x524e('0x79'),util[_0x524e('0x65')]('cf_%s',_0x3a6e4d['id']),_0x5555ae);})['then'](function(){return _0x3a6e4d;});});}})[_0x524e('0x23')](respondWithResult(_0x2815eb,null))[_0x524e('0x41')](handleError(_0x2815eb,null));};exports[_0x524e('0x7a')]=function(_0x2ee02a,_0x4642db,_0x42d3f1){var _0x33f059={};var _0x53baf5={};var _0x3188d2;var _0x18b87a;return db[_0x524e('0x2b')][_0x524e('0x52')]({'where':{'id':_0x2ee02a[_0x524e('0x43')]['id']}})[_0x524e('0x23')](handleEntityNotFound(_0x4642db,null))[_0x524e('0x23')](function(_0x200097){if(_0x200097){_0x3188d2=_0x200097;_0x53baf5[_0x524e('0x2c')]=_[_0x524e('0x2d')](db[_0x524e('0x62')][_0x524e('0x44')]);_0x53baf5['query']=_[_0x524e('0x2d')](_0x2ee02a[_0x524e('0x2e')]);_0x53baf5['filters']=_['intersection'](_0x53baf5['model'],_0x53baf5[_0x524e('0x2e')]);_0x33f059['attributes']=_[_0x524e('0x30')](_0x53baf5['model'],qs['fields'](_0x2ee02a['query'][_0x524e('0x31')]));_0x33f059[_0x524e('0x32')]=_0x33f059[_0x524e('0x32')][_0x524e('0x33')]?_0x33f059[_0x524e('0x32')]:_0x53baf5[_0x524e('0x2c')];_0x33f059[_0x524e('0x36')]=qs[_0x524e('0x37')](_0x2ee02a[_0x524e('0x2e')][_0x524e('0x37')]);_0x33f059[_0x524e('0x38')]=qs[_0x524e('0x2f')](_[_0x524e('0x39')](_0x2ee02a[_0x524e('0x2e')],_0x53baf5[_0x524e('0x2f')]));_0x33f059['where']=_[_0x524e('0x3b')](_0x33f059['where'],{'$or':[{'ListId':_0x200097['id']},{'ListId':null}]});if(_0x2ee02a['query'][_0x524e('0x3a')]){_0x33f059[_0x524e('0x38')]=_[_0x524e('0x3b')](_0x33f059['where'],{'$or':_['map'](_0x33f059['attributes'],function(_0x4d278f){var _0x47258e={};_0x47258e[_0x4d278f]={'$like':'%'+_0x2ee02a['query'][_0x524e('0x3a')]+'%'};return _0x47258e;})});}_0x33f059=_[_0x524e('0x3b')]({},_0x33f059,_0x2ee02a['options']);return db['CmCustomField']['findAndCountAll'](_0x33f059);}})[_0x524e('0x23')](respondWithResult(_0x4642db,null))[_0x524e('0x41')](handleError(_0x4642db,null));};exports[_0x524e('0x7b')]=function(_0x47ced3,_0x1fa0bc,_0x5b079e){return db[_0x524e('0x2b')][_0x524e('0x46')]({'where':{'id':_0x47ced3['params']['id']}})[_0x524e('0x23')](handleEntityNotFound(_0x1fa0bc,null))['then'](function(_0x2a89c0){if(_0x2a89c0){return _0x2a89c0[_0x524e('0x7b')](_0x47ced3['body'][_0x524e('0x7c')],_[_0x524e('0x5d')](_0x47ced3['body'],[_0x524e('0x7c'),'id'])||{})['spread'](function(_0x58670e){for(var _0x288886=0x0;_0x288886<_0x47ced3[_0x524e('0x48')][_0x524e('0x7c')][_0x524e('0x33')];_0x288886+=0x1){socket[_0x524e('0x7d')](_0x524e('0x7e'),{'UserId':_0x47ced3[_0x524e('0x48')][_0x524e('0x7c')][_0x288886],'CmListId':_0x47ced3[_0x524e('0x43')]['id']});}return _0x58670e;});}})['then'](respondWithResult(_0x1fa0bc,null))[_0x524e('0x41')](handleError(_0x1fa0bc,null));};exports[_0x524e('0x7f')]=function(_0x287694,_0x48f7bc,_0x5e8dea){return db[_0x524e('0x2b')][_0x524e('0x46')]({'where':{'id':_0x287694['params']['id']}})[_0x524e('0x23')](handleEntityNotFound(_0x48f7bc,null))[_0x524e('0x23')](function(_0x47362c){if(_0x47362c){return _0x47362c['removeAgents'](_0x287694['query'][_0x524e('0x7c')])[_0x524e('0x23')](function(){if(_['isArray'](_0x287694[_0x524e('0x2e')][_0x524e('0x7c')])){for(var _0xd4bbe3=0x0;_0xd4bbe3<_0x287694[_0x524e('0x2e')][_0x524e('0x7c')][_0x524e('0x33')];_0xd4bbe3+=0x1){socket[_0x524e('0x7d')](_0x524e('0x80'),{'UserId':Number(_0x287694[_0x524e('0x2e')][_0x524e('0x7c')][_0xd4bbe3]),'CmListId':Number(_0x287694[_0x524e('0x43')]['id'])});}}else{socket[_0x524e('0x7d')](_0x524e('0x80'),{'UserId':Number(_0x287694[_0x524e('0x2e')][_0x524e('0x7c')]),'CmListId':Number(_0x287694[_0x524e('0x43')]['id'])});}});}})[_0x524e('0x23')](respondWithStatusCode(_0x48f7bc,null))[_0x524e('0x41')](handleError(_0x48f7bc,null));};exports[_0x524e('0x81')]=function(_0x686245,_0x15933c,_0x16aec0){var _0x2b538c={};var _0x3178f0={};var _0x1efe00;var _0x28080b;return db[_0x524e('0x2b')]['findOne']({'where':{'id':_0x686245[_0x524e('0x43')]['id']}})[_0x524e('0x23')](handleEntityNotFound(_0x15933c,null))['then'](function(_0x29d1b2){if(_0x29d1b2){_0x1efe00=_0x29d1b2;_0x3178f0[_0x524e('0x2c')]=_[_0x524e('0x2d')](db[_0x524e('0x82')][_0x524e('0x44')]);_0x3178f0['query']=_[_0x524e('0x2d')](_0x686245[_0x524e('0x2e')]);_0x3178f0[_0x524e('0x2f')]=_['intersection'](_0x3178f0[_0x524e('0x2c')],_0x3178f0[_0x524e('0x2e')]);_0x2b538c[_0x524e('0x32')]=_['intersection'](_0x3178f0['model'],qs['fields'](_0x686245[_0x524e('0x2e')][_0x524e('0x31')]));_0x2b538c['attributes']=_0x2b538c[_0x524e('0x32')]['length']?_0x2b538c['attributes']:_0x3178f0[_0x524e('0x2c')];_0x2b538c[_0x524e('0x36')]=qs[_0x524e('0x37')](_0x686245[_0x524e('0x2e')]['sort']);_0x2b538c[_0x524e('0x38')]=qs[_0x524e('0x2f')](_['pick'](_0x686245[_0x524e('0x2e')],_0x3178f0[_0x524e('0x2f')]));if(_0x686245[_0x524e('0x2e')][_0x524e('0x3a')]){_0x2b538c[_0x524e('0x38')]=_['merge'](_0x2b538c['where'],{'$or':_[_0x524e('0x3c')](_0x2b538c[_0x524e('0x32')],function(_0x34b5f1){var _0x34bb20={};_0x34bb20[_0x34b5f1]={'$like':'%'+_0x686245[_0x524e('0x2e')]['filter']+'%'};return _0x34bb20;})});}_0x2b538c=_['merge']({},_0x2b538c,_0x686245[_0x524e('0x54')]);return _0x1efe00[_0x524e('0x81')](_0x2b538c);}})[_0x524e('0x23')](function(_0x3ad6b5){if(_0x3ad6b5){_0x28080b=_0x3ad6b5['length'];if(!_0x686245['query']['hasOwnProperty'](_0x524e('0x35'))){_0x2b538c['limit']=qs['limit'](_0x686245['query'][_0x524e('0x1e')]);_0x2b538c[_0x524e('0x1d')]=qs[_0x524e('0x1d')](_0x686245[_0x524e('0x2e')][_0x524e('0x1d')]);}return _0x1efe00['getAgents'](_0x2b538c);}})[_0x524e('0x23')](function(_0x178706){if(_0x178706){return _0x178706?{'count':_0x28080b,'rows':_0x178706}:null;}})[_0x524e('0x23')](respondWithResult(_0x15933c,null))['catch'](handleError(_0x15933c,null));}; \ No newline at end of file +var _0xe66c=['body','user','role','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','nolimit','pick','map','removeDispositions','ids','CmContact','tags','isArray','omit','success','dataValues','errors','push','message','json','Malformed\x20request\x20syntax','CustomFields','concat','format','raw','getContacts','getContactsCsv','CmCustomField','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','Sequelize','text','type','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','destroy','get','Lists','then','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','key','VIRTUAL','field','options','CmList','includeAll','include','findAll','rows','params','find','create'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xe66c,0x166));var _0xce66=function(_0x19815c,_0xa56e00){_0x19815c=_0x19815c-0x0;var _0x152b7f=_0xe66c[_0x19815c];return _0x152b7f;};'use strict';var pdf=require(_0xce66('0x0'));var emlformat=require(_0xce66('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xce66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce66('0x3'));var moment=require(_0xce66('0x4'));var BPromise=require(_0xce66('0x5'));var Mustache=require(_0xce66('0x6'));var util=require(_0xce66('0x7'));var path=require(_0xce66('0x8'));var sox=require(_0xce66('0x9'));var csv=require(_0xce66('0xa'));var ejs=require(_0xce66('0xb'));var fs=require('fs');var _=require(_0xce66('0xc'));var squel=require(_0xce66('0xd'));var crypto=require(_0xce66('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xce66('0xf'));var toCsv=require(_0xce66('0xa'));var querystring=require(_0xce66('0x10'));var Papa=require(_0xce66('0x11'));var Redis=require(_0xce66('0x12'));var authService=require(_0xce66('0x13'));var qs=require(_0xce66('0x14'));var hardwareService=require(_0xce66('0x15'));var logger=require(_0xce66('0x16'))(_0xce66('0x17'));var utils=require(_0xce66('0x18'));var config=require(_0xce66('0x19'));var db=require(_0xce66('0x1a'))['db'];config[_0xce66('0x1b')]=_[_0xce66('0x1c')](config[_0xce66('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xce66('0x1d'))(new Redis(config[_0xce66('0x1b')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x452c66,_0x20d07a){_0x20d07a=_0x20d07a||0xcc;return function(_0x15d763){if(_0x15d763){return _0x452c66[_0xce66('0x1e')](_0x20d07a);}return _0x452c66[_0xce66('0x1f')](_0x20d07a)[_0xce66('0x20')]();};}function respondWithResult(_0x271553,_0x49df45){_0x49df45=_0x49df45||0xc8;return function(_0x274292){if(_0x274292){return _0x271553['status'](_0x49df45)['json'](_0x274292);}};}function respondWithFilteredResult(_0x1ea1e6,_0x4f288e){return function(_0x438e97){if(_0x438e97){var _0x3a87c9=_0x438e97[_0xce66('0x21')],_0x575765=_0x4f288e[_0xce66('0x22')],_0x2764e4=_0x4f288e[_0xce66('0x22')]+_0x4f288e[_0xce66('0x23')],_0x14129a;if(_0x2764e4>=_0x3a87c9){_0x2764e4=_0x3a87c9;_0x14129a=0xc8;}else{_0x14129a=0xce;}_0x1ea1e6[_0xce66('0x1f')](_0x14129a);return _0x1ea1e6[_0xce66('0x24')](_0xce66('0x25'),_0x575765+'-'+_0x2764e4+'/'+_0x3a87c9)['json'](_0x438e97);}return null;};}function patchUpdates(_0xe87f13){return function(_0x29632b){try{jsonpatch['apply'](_0x29632b,_0xe87f13,!![]);}catch(_0x1e3411){return BPromise[_0xce66('0x26')](_0x1e3411);}return _0x29632b[_0xce66('0x27')]();};}function saveUpdates(_0x2776e8,_0x1bcbe0){return function(_0x1ce13e){if(_0x1ce13e){return _0x1ce13e['update'](_0x2776e8)['then'](function(_0x5ea04d){return _0x5ea04d;});}return null;};}function removeEntity(_0x1384cb,_0x49145b){return function(_0x259bad){if(_0x259bad){return _0x259bad[_0xce66('0x28')]()['then'](function(){var _0x544800=_0x259bad[_0xce66('0x29')]({'plain':!![]});var _0x2003e7=_0xce66('0x2a');return db['UserProfileResource'][_0xce66('0x28')]({'where':{'type':_0x2003e7,'resourceId':_0x544800['id']}})[_0xce66('0x2b')](function(){return _0x259bad;});})['then'](function(){_0x1384cb[_0xce66('0x1f')](0xcc)[_0xce66('0x20')]();});}};}function handleEntityNotFound(_0x51d1ac,_0x34ad6e){return function(_0x30af9b){if(!_0x30af9b){_0x51d1ac['sendStatus'](0x194);}return _0x30af9b;};}function handleError(_0x29ee1d,_0x196153){_0x196153=_0x196153||0x1f4;return function(_0x41260b){logger['error'](_0x41260b[_0xce66('0x2c')]);if(_0x41260b['name']){delete _0x41260b[_0xce66('0x2d')];}_0x29ee1d[_0xce66('0x1f')](_0x196153)[_0xce66('0x2e')](_0x41260b);};}exports[_0xce66('0x2f')]=function(_0x2831cd,_0x97966e){var _0x132fc4={},_0x10fd97={},_0x2fc08b={'count':0x0,'rows':[]};var _0xf5c759=db['CmList'][_0xce66('0x30')];_0x10fd97[_0xce66('0x31')]=_[_0xce66('0x32')](_0xf5c759);_0x10fd97[_0xce66('0x33')]=_[_0xce66('0x32')](_0x2831cd[_0xce66('0x33')]);_0x10fd97[_0xce66('0x34')]=_[_0xce66('0x35')](_0x10fd97['model'],_0x10fd97[_0xce66('0x33')]);_0x132fc4[_0xce66('0x36')]=_[_0xce66('0x35')](_0x10fd97['model'],qs['fields'](_0x2831cd[_0xce66('0x33')][_0xce66('0x37')]));_0x132fc4['attributes']=_0x132fc4[_0xce66('0x36')]['length']?_0x132fc4[_0xce66('0x36')]:_0x10fd97[_0xce66('0x31')];if(!_0x2831cd[_0xce66('0x33')][_0xce66('0x38')]('nolimit')){_0x132fc4['limit']=qs[_0xce66('0x23')](_0x2831cd[_0xce66('0x33')][_0xce66('0x23')]);_0x132fc4[_0xce66('0x22')]=qs[_0xce66('0x22')](_0x2831cd[_0xce66('0x33')][_0xce66('0x22')]);}_0x132fc4[_0xce66('0x39')]=qs[_0xce66('0x3a')](_0x2831cd[_0xce66('0x33')][_0xce66('0x3a')]);_0x132fc4[_0xce66('0x3b')]=qs[_0xce66('0x34')](_['pick'](_0x2831cd[_0xce66('0x33')],_0x10fd97[_0xce66('0x34')]));if(_0x2831cd[_0xce66('0x33')][_0xce66('0x3c')]){_0x132fc4[_0xce66('0x3b')]=_[_0xce66('0x3d')](_0x132fc4['where'],{'$or':_['map'](_0xf5c759,function(_0x54d0d1){if(_0x54d0d1['type'][_0xce66('0x3e')]!==_0xce66('0x3f')){var _0x29d672={};_0x29d672[_0x54d0d1[_0xce66('0x40')]]={'$like':'%'+_0x2831cd[_0xce66('0x33')][_0xce66('0x3c')]+'%'};return _0x29d672;}})});}_0x132fc4=_[_0xce66('0x3d')]({},_0x132fc4,_0x2831cd[_0xce66('0x41')]);var _0x5e8a37={'where':_0x132fc4[_0xce66('0x3b')]};return db[_0xce66('0x42')][_0xce66('0x21')](_0x5e8a37)[_0xce66('0x2b')](function(_0x2de594){_0x2fc08b[_0xce66('0x21')]=_0x2de594;if(_0x2831cd[_0xce66('0x33')][_0xce66('0x43')]){_0x132fc4[_0xce66('0x44')]=[{'all':!![]}];}return db['CmList'][_0xce66('0x45')](_0x132fc4);})[_0xce66('0x2b')](function(_0x28af0a){_0x2fc08b[_0xce66('0x46')]=_0x28af0a;return _0x2fc08b;})[_0xce66('0x2b')](respondWithFilteredResult(_0x97966e,_0x132fc4))['catch'](handleError(_0x97966e,null));};exports['show']=function(_0x8640dc,_0x34549e){var _0xa1b267={'raw':![],'where':{'id':_0x8640dc[_0xce66('0x47')]['id']}},_0x3adec4={};_0x3adec4[_0xce66('0x31')]=_[_0xce66('0x32')](db['CmList']['rawAttributes']);_0x3adec4[_0xce66('0x33')]=_[_0xce66('0x32')](_0x8640dc[_0xce66('0x33')]);_0x3adec4[_0xce66('0x34')]=_['intersection'](_0x3adec4['model'],_0x3adec4['query']);_0xa1b267[_0xce66('0x36')]=_[_0xce66('0x35')](_0x3adec4[_0xce66('0x31')],qs['fields'](_0x8640dc[_0xce66('0x33')]['fields']));_0xa1b267[_0xce66('0x36')]=_0xa1b267[_0xce66('0x36')]['length']?_0xa1b267[_0xce66('0x36')]:_0x3adec4[_0xce66('0x31')];if(_0x8640dc[_0xce66('0x33')]['includeAll']){_0xa1b267['include']=[{'all':!![]}];}_0xa1b267=_[_0xce66('0x3d')]({},_0xa1b267,_0x8640dc[_0xce66('0x41')]);return db['CmList'][_0xce66('0x48')](_0xa1b267)[_0xce66('0x2b')](handleEntityNotFound(_0x34549e,null))[_0xce66('0x2b')](respondWithResult(_0x34549e,null))['catch'](handleError(_0x34549e,null));};exports[_0xce66('0x49')]=function(_0x222b07,_0x54cd89){return db[_0xce66('0x42')][_0xce66('0x49')](_0x222b07[_0xce66('0x4a')],{})[_0xce66('0x2b')](function(_0x4e18c7){var _0xd60710=_0x222b07[_0xce66('0x4b')][_0xce66('0x29')]({'plain':!![]});if(!_0xd60710)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd60710[_0xce66('0x4c')]===_0xce66('0x4b')){var _0x231e21=_0x4e18c7['get']({'plain':!![]});var _0x2af1f1=_0xce66('0x2a');return db['UserProfileSection'][_0xce66('0x48')]({'where':{'name':_0x2af1f1,'userProfileId':_0xd60710[_0xce66('0x4d')]},'raw':!![]})[_0xce66('0x2b')](function(_0x15c111){if(_0x15c111&&_0x15c111[_0xce66('0x4e')]===0x0){return db[_0xce66('0x4f')][_0xce66('0x49')]({'name':_0x231e21[_0xce66('0x2d')],'resourceId':_0x231e21['id'],'type':_0x15c111[_0xce66('0x2d')],'sectionId':_0x15c111['id']},{})[_0xce66('0x2b')](function(){return _0x4e18c7;});}else{return _0x4e18c7;}})[_0xce66('0x50')](function(_0x4e4721){logger[_0xce66('0x51')](_0xce66('0x52'),_0x4e4721);throw _0x4e4721;});}return _0x4e18c7;})[_0xce66('0x2b')](respondWithResult(_0x54cd89,0xc9))[_0xce66('0x50')](handleError(_0x54cd89,null));};exports[_0xce66('0x53')]=function(_0x5f1f07,_0x57cb91){if(_0x5f1f07[_0xce66('0x4a')]['id']){delete _0x5f1f07[_0xce66('0x4a')]['id'];}return db[_0xce66('0x42')][_0xce66('0x48')]({'where':{'id':_0x5f1f07[_0xce66('0x47')]['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x57cb91,null))[_0xce66('0x2b')](saveUpdates(_0x5f1f07[_0xce66('0x4a')],null))[_0xce66('0x2b')](respondWithResult(_0x57cb91,null))['catch'](handleError(_0x57cb91,null));};exports['destroy']=function(_0x37520d,_0xafb9d){return db[_0xce66('0x42')][_0xce66('0x48')]({'where':{'id':_0x37520d[_0xce66('0x47')]['id']}})['then'](handleEntityNotFound(_0xafb9d,null))[_0xce66('0x2b')](removeEntity(_0xafb9d,null))[_0xce66('0x50')](handleError(_0xafb9d,null));};exports[_0xce66('0x54')]=function(_0x3a5f58,_0x524adc){return db[_0xce66('0x42')][_0xce66('0x54')]()[_0xce66('0x2b')](respondWithResult(_0x524adc,null))[_0xce66('0x50')](handleError(_0x524adc,null));};exports[_0xce66('0x55')]=function(_0xb87da6,_0xa34593,_0x50a1d0){if(_0xb87da6[_0xce66('0x4a')]['id']){delete _0xb87da6['body']['id'];}return db[_0xce66('0x42')][_0xce66('0x48')]({'where':{'id':_0xb87da6[_0xce66('0x47')]['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0xa34593,null))[_0xce66('0x2b')](function(_0x3406f3){if(_0x3406f3){_0xb87da6[_0xce66('0x4a')][_0xce66('0x56')]=_0x3406f3['id'];return db[_0xce66('0x57')][_0xce66('0x49')](_0xb87da6[_0xce66('0x4a')]);}})[_0xce66('0x2b')](respondWithResult(_0xa34593,null))[_0xce66('0x50')](handleError(_0xa34593,null));};exports[_0xce66('0x58')]=function(_0x2d8601,_0xae7d7e,_0x423467){var _0x2d20f5={'raw':![],'where':{}};var _0x4da873={};var _0x226cba={'count':0x0,'rows':[]};return db[_0xce66('0x42')][_0xce66('0x59')]({'where':{'id':_0x2d8601[_0xce66('0x47')]['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0xae7d7e,null))[_0xce66('0x2b')](function(_0x1940d0){if(_0x1940d0){_0x4da873[_0xce66('0x31')]=_['keys'](db[_0xce66('0x57')][_0xce66('0x30')]);_0x4da873['query']=_['keys'](_0x2d8601[_0xce66('0x33')]);_0x4da873[_0xce66('0x34')]=_[_0xce66('0x35')](_0x4da873[_0xce66('0x31')],_0x4da873[_0xce66('0x33')]);_0x2d20f5['attributes']=_[_0xce66('0x35')](_0x4da873[_0xce66('0x31')],qs[_0xce66('0x37')](_0x2d8601['query'][_0xce66('0x37')]));_0x2d20f5[_0xce66('0x36')]=_0x2d20f5[_0xce66('0x36')][_0xce66('0x5a')]?_0x2d20f5[_0xce66('0x36')]:_0x4da873[_0xce66('0x31')];if(!_0x2d8601[_0xce66('0x33')][_0xce66('0x38')](_0xce66('0x5b'))){_0x2d20f5[_0xce66('0x23')]=qs[_0xce66('0x23')](_0x2d8601[_0xce66('0x33')][_0xce66('0x23')]);_0x2d20f5[_0xce66('0x22')]=qs['offset'](_0x2d8601[_0xce66('0x33')]['offset']);}_0x2d20f5[_0xce66('0x39')]=qs[_0xce66('0x3a')](_0x2d8601[_0xce66('0x33')][_0xce66('0x3a')]);_0x2d20f5[_0xce66('0x3b')]=qs[_0xce66('0x34')](_[_0xce66('0x5c')](_0x2d8601[_0xce66('0x33')],_0x4da873['filters']));_0x2d20f5['where'][_0xce66('0x56')]=_0x1940d0['id'];if(_0x2d8601['query'][_0xce66('0x3c')]){_0x2d20f5[_0xce66('0x3b')]=_[_0xce66('0x3d')](_0x2d20f5[_0xce66('0x3b')],{'$or':_[_0xce66('0x5d')](_0x2d20f5[_0xce66('0x36')],function(_0x352fb5){var _0x392e24={};_0x392e24[_0x352fb5]={'$like':'%'+_0x2d8601[_0xce66('0x33')]['filter']+'%'};return _0x392e24;})});}_0x2d20f5=_['merge']({},_0x2d20f5,_0x2d8601[_0xce66('0x41')]);return db[_0xce66('0x57')][_0xce66('0x21')]({'where':_0x2d20f5['where']})[_0xce66('0x2b')](function(_0x530dcb){_0x226cba['count']=_0x530dcb;if(_0x2d8601[_0xce66('0x33')][_0xce66('0x43')]){_0x2d20f5['include']=[{'all':!![]}];}return db[_0xce66('0x57')][_0xce66('0x45')](_0x2d20f5);})[_0xce66('0x2b')](function(_0x57adf1){_0x226cba[_0xce66('0x46')]=_0x57adf1;return _0x226cba;});}})[_0xce66('0x2b')](respondWithFilteredResult(_0xae7d7e,_0x2d20f5))[_0xce66('0x50')](handleError(_0xae7d7e,null));};exports['removeDispositions']=function(_0x3ce62c,_0x1ec0d3,_0x5eba5e){return db[_0xce66('0x42')][_0xce66('0x48')]({'where':{'id':_0x3ce62c[_0xce66('0x47')]['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x1ec0d3,null))[_0xce66('0x2b')](function(_0x1d5cee){if(_0x1d5cee){return _0x1d5cee[_0xce66('0x5e')](_0x3ce62c[_0xce66('0x33')][_0xce66('0x5f')]);}})[_0xce66('0x2b')](respondWithStatusCode(_0x1ec0d3,null))[_0xce66('0x50')](handleError(_0x1ec0d3,null));};exports['addContacts']=function(_0x5d082f,_0x155698,_0x9947df){return db['CmList'][_0xce66('0x48')]({'where':{'id':_0x5d082f['params']['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x155698,null))[_0xce66('0x2b')](function(_0x151ea7){if(_0x151ea7){var _0x184342=[];var _0x4a8b2a={'success':[],'errors':[]};return db[_0xce66('0x60')][_0xce66('0x54')]()[_0xce66('0x2b')](function(_0x547b2f){if(_0x5d082f[_0xce66('0x4a')][_0xce66('0x61')]&&_[_0xce66('0x62')](_0x5d082f[_0xce66('0x4a')][_0xce66('0x61')])){if(_0x5d082f[_0xce66('0x4a')][_0xce66('0x61')][_0xce66('0x5a')]){_0x5d082f['body'][_0xce66('0x61')]=_0x5d082f[_0xce66('0x4a')][_0xce66('0x61')]['join'](';')+';';}else{_0x5d082f['body'][_0xce66('0x61')]=null;}}else{_0x5d082f['body'][_0xce66('0x61')]=null;}if(_0x5d082f['body']&&_['isArray'](_0x5d082f[_0xce66('0x4a')])){for(var _0x42b7d4=0x0;_0x42b7d4<_0x5d082f['body'][_0xce66('0x5a')];_0x42b7d4+=0x1){_0x5d082f['body'][_0x42b7d4][_0xce66('0x56')]=_0x5d082f['params']['id'];_0x184342['push'](_0x5d082f[_0xce66('0x4a')][_0x42b7d4]);}return BPromise['each'](_0x184342,function(_0x33a0c6){return db[_0xce66('0x60')]['create'](_[_0xce66('0x63')](_0x33a0c6,[_0xce66('0x5f'),'id'])||{},{'fields':_[_0xce66('0x32')](_0x547b2f),'raw':!![]})[_0xce66('0x2b')](function(_0x3f7083){_0x4a8b2a[_0xce66('0x64')]['push'](_0x3f7083[_0xce66('0x65')]);})[_0xce66('0x50')](function(_0x1212d4){_0x4a8b2a[_0xce66('0x66')][_0xce66('0x67')]({'data':_0x33a0c6,'error':_0x1212d4[_0xce66('0x68')]});});})[_0xce66('0x2b')](function(_0x8a1df0){return _0x4a8b2a;})[_0xce66('0x50')](function(_0x441401){return _0x441401;});}else{_0x155698[_0xce66('0x1f')](0x190)[_0xce66('0x69')]({'message':_0xce66('0x6a')});}});}})[_0xce66('0x2b')](respondWithResult(_0x155698,null))['catch'](handleError(_0x155698,null));};exports['getContacts']=function(_0x492d71,_0x566c20,_0x451911){var _0x9bd919;return db[_0xce66('0x42')][_0xce66('0x48')]({'where':{'id':_0x492d71[_0xce66('0x47')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xce66('0x6b')}]})[_0xce66('0x2b')](handleEntityNotFound(_0x566c20,null))['then'](function(_0x246007){if(_0x246007){_0x9bd919=_0x246007;return db['CmContact'][_0xce66('0x30')];}})[_0xce66('0x2b')](function(_0x3630c1){if(_0x3630c1){var _0x1d381f={};var _0x278d55={};_0x278d55[_0xce66('0x31')]=_[_0xce66('0x6c')](_[_0xce66('0x32')](_0x3630c1),_['map'](_0x9bd919[_0xce66('0x6b')],function(_0x32f89b){return util[_0xce66('0x6d')]('cf_%d',_0x32f89b['id']);}));_0x278d55[_0xce66('0x33')]=_[_0xce66('0x32')](_0x492d71['query']);_0x278d55['filters']=_[_0xce66('0x35')](_0x278d55[_0xce66('0x31')],_0x278d55[_0xce66('0x33')]);_0x1d381f[_0xce66('0x36')]=_['intersection'](_0x278d55['model'],qs['fields'](_0x492d71[_0xce66('0x33')]['fields']));_0x1d381f[_0xce66('0x36')]=_0x1d381f['attributes']['length']?_0x1d381f[_0xce66('0x36')]:_0x278d55[_0xce66('0x31')];if(!_0x492d71[_0xce66('0x33')][_0xce66('0x38')](_0xce66('0x5b'))){_0x1d381f[_0xce66('0x23')]=qs[_0xce66('0x23')](_0x492d71['query']['limit']);_0x1d381f[_0xce66('0x22')]=qs[_0xce66('0x22')](_0x492d71['query'][_0xce66('0x22')]);}_0x1d381f[_0xce66('0x39')]=qs[_0xce66('0x3a')](_0x492d71[_0xce66('0x33')][_0xce66('0x3a')]);_0x1d381f[_0xce66('0x3b')]=qs[_0xce66('0x34')](_['pick'](_0x492d71[_0xce66('0x33')],_0x278d55['filters']));_0x1d381f[_0xce66('0x6e')]=!![];if(_0x492d71[_0xce66('0x33')][_0xce66('0x3c')]){_0x1d381f[_0xce66('0x3b')]=_[_0xce66('0x3d')](_0x1d381f[_0xce66('0x3b')],{'$or':_[_0xce66('0x5d')](_0x1d381f[_0xce66('0x36')],function(_0x10c49e){var _0x204ab0={};_0x204ab0[_0x10c49e]={'$like':'%'+_0x492d71[_0xce66('0x33')][_0xce66('0x3c')]+'%'};return _0x204ab0;})});}_0x1d381f=_[_0xce66('0x3d')]({},_0x1d381f,_0x492d71[_0xce66('0x41')]);return _0x9bd919[_0xce66('0x6f')](_0x1d381f);}})[_0xce66('0x2b')](respondWithResult(_0x566c20,null))['catch'](handleError(_0x566c20,null));};exports[_0xce66('0x70')]=function(_0x50294e,_0x5129e3,_0x18ad1a){var _0x2a719f;return db[_0xce66('0x42')]['find']({'where':{'id':_0x50294e[_0xce66('0x47')]['id']},'include':[{'model':db[_0xce66('0x71')],'as':'CustomFields'}]})[_0xce66('0x2b')](handleEntityNotFound(_0x5129e3,null))[_0xce66('0x2b')](function(_0x115dd3){if(_0x115dd3){_0x2a719f=_0x115dd3;return db[_0xce66('0x60')][_0xce66('0x30')];}})[_0xce66('0x2b')](function(_0x5ec3ba){if(_0x5ec3ba){var _0x5a0f44={};var _0x2e740c={};_0x2e740c[_0xce66('0x31')]=_['concat'](_[_0xce66('0x32')](_0x5ec3ba),_['map'](_0x2a719f[_0xce66('0x6b')],function(_0x2dab95){return util[_0xce66('0x6d')]('cf_%d',_0x2dab95['id']);}));_0x2e740c['query']=_[_0xce66('0x32')](_0x50294e[_0xce66('0x33')]);_0x2e740c[_0xce66('0x34')]=_[_0xce66('0x35')](_0x2e740c[_0xce66('0x31')],_0x2e740c['query']);_0x5a0f44[_0xce66('0x36')]=_[_0xce66('0x35')](_0x2e740c['model'],qs[_0xce66('0x37')](_0x50294e['query'][_0xce66('0x37')]));_0x5a0f44[_0xce66('0x36')]=_0x5a0f44[_0xce66('0x36')][_0xce66('0x5a')]?_0x5a0f44['attributes']:_0x2e740c[_0xce66('0x31')];if(!_0x50294e['query']['hasOwnProperty'](_0xce66('0x5b'))){_0x5a0f44[_0xce66('0x23')]=qs[_0xce66('0x23')](_0x50294e[_0xce66('0x33')][_0xce66('0x23')]);_0x5a0f44['offset']=qs[_0xce66('0x22')](_0x50294e[_0xce66('0x33')]['offset']);}_0x5a0f44[_0xce66('0x39')]=qs[_0xce66('0x3a')](_0x50294e[_0xce66('0x33')][_0xce66('0x3a')]);_0x5a0f44['where']=qs[_0xce66('0x34')](_['pick'](_0x50294e[_0xce66('0x33')],_0x2e740c[_0xce66('0x34')]));_0x5a0f44['raw']=!![];if(_0x50294e[_0xce66('0x33')][_0xce66('0x3c')]){_0x5a0f44['where']=_['merge'](_0x5a0f44['where'],{'$or':_[_0xce66('0x5d')](_0x5a0f44['attributes'],function(_0x3b747c){var _0x36de78={};_0x36de78[_0x3b747c]={'$like':'%'+_0x50294e[_0xce66('0x33')][_0xce66('0x3c')]+'%'};return _0x36de78;})});}_0x5a0f44=_['merge']({},_0x5a0f44,_0x50294e[_0xce66('0x41')]);return _0x2a719f['getContacts'](_0x5a0f44);}})[_0xce66('0x2b')](function(_0x11f466){if(!_[_0xce66('0x72')](_0x11f466)){var _0x757d57=toCsv(_0x11f466);var _0x564dd2=Date[_0xce66('0x73')]();fs[_0xce66('0x74')](util[_0xce66('0x6d')]('/tmp/list_%d_%s.csv',_0x2a719f['id'],_0x564dd2),_0x757d57);_0x5129e3[_0xce66('0x75')](_0xce66('0x76'),_0xce66('0x77')+util[_0xce66('0x6d')]('list_%d_%s.csv',_0x2a719f['id'],_0x564dd2));_0x5129e3[_0xce66('0x75')](_0xce66('0x78'),'text/csv');return _0x5129e3[_0xce66('0x79')](util[_0xce66('0x6d')](_0xce66('0x7a'),_0x2a719f['id'],_0x564dd2));}else{return _0x5129e3['sendStatus'](0xcc);}})[_0xce66('0x50')](handleError(_0x5129e3,null));};exports[_0xce66('0x7b')]=function(_0x5d3fe7,_0x3fe05f,_0x117f4b){var _0x5cf802;delete _0x5d3fe7['body']['id'];return db[_0xce66('0x42')][_0xce66('0x59')]({'where':{'id':_0x5d3fe7[_0xce66('0x47')]['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x3fe05f,null))[_0xce66('0x2b')](function(_0x5dae5a){if(_0x5dae5a){return db[_0xce66('0x7c')]['transaction'](function(_0x374b3c){return db[_0xce66('0x71')][_0xce66('0x49')](_0x5d3fe7[_0xce66('0x4a')],{'transaction':_0x374b3c})[_0xce66('0x2b')](function(_0x42e427){_0x5cf802=_0x42e427;return _0x5dae5a['addCustomFields'](_0x42e427,{'transaction':_0x374b3c});})[_0xce66('0x2b')](function(){var _0x52ad16={'type':db[_0xce66('0x7d')]['TEXT'],'transaction':_0x374b3c};switch(_0x5d3fe7[_0xce66('0x4a')]['type']){case _0xce66('0x7e'):_0x52ad16[_0xce66('0x7f')]=db['Sequelize'][_0xce66('0x80')];break;case _0xce66('0x81'):_0x52ad16['type']=db['Sequelize'][_0xce66('0x82')];break;case _0xce66('0x83'):_0x52ad16[_0xce66('0x7f')]=db['Sequelize'][_0xce66('0x84')];_0x52ad16[_0xce66('0x85')]=![];break;default:}return db[_0xce66('0x7c')]['queryInterface'][_0xce66('0x86')]('cm_contacts',util[_0xce66('0x6d')](_0xce66('0x87'),_0x5cf802['id']),_0x52ad16);})[_0xce66('0x2b')](function(){return _0x5cf802;});});}})[_0xce66('0x2b')](respondWithResult(_0x3fe05f,null))[_0xce66('0x50')](handleError(_0x3fe05f,null));};exports[_0xce66('0x88')]=function(_0x1bf4f1,_0x384209,_0x157834){var _0x44eb90={};var _0x48e6e8={};var _0x5de0fd;var _0x140172;return db[_0xce66('0x42')]['findOne']({'where':{'id':_0x1bf4f1['params']['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x384209,null))[_0xce66('0x2b')](function(_0x5dc942){if(_0x5dc942){_0x5de0fd=_0x5dc942;_0x48e6e8[_0xce66('0x31')]=_[_0xce66('0x32')](db[_0xce66('0x71')][_0xce66('0x30')]);_0x48e6e8[_0xce66('0x33')]=_[_0xce66('0x32')](_0x1bf4f1[_0xce66('0x33')]);_0x48e6e8['filters']=_[_0xce66('0x35')](_0x48e6e8[_0xce66('0x31')],_0x48e6e8[_0xce66('0x33')]);_0x44eb90['attributes']=_[_0xce66('0x35')](_0x48e6e8[_0xce66('0x31')],qs[_0xce66('0x37')](_0x1bf4f1[_0xce66('0x33')][_0xce66('0x37')]));_0x44eb90[_0xce66('0x36')]=_0x44eb90[_0xce66('0x36')][_0xce66('0x5a')]?_0x44eb90[_0xce66('0x36')]:_0x48e6e8[_0xce66('0x31')];_0x44eb90[_0xce66('0x39')]=qs['sort'](_0x1bf4f1[_0xce66('0x33')][_0xce66('0x3a')]);_0x44eb90[_0xce66('0x3b')]=qs[_0xce66('0x34')](_['pick'](_0x1bf4f1[_0xce66('0x33')],_0x48e6e8[_0xce66('0x34')]));_0x44eb90['where']=_[_0xce66('0x3d')](_0x44eb90[_0xce66('0x3b')],{'$or':[{'ListId':_0x5dc942['id']},{'ListId':null}]});if(_0x1bf4f1[_0xce66('0x33')][_0xce66('0x3c')]){_0x44eb90[_0xce66('0x3b')]=_['merge'](_0x44eb90[_0xce66('0x3b')],{'$or':_[_0xce66('0x5d')](_0x44eb90['attributes'],function(_0x47b5b7){var _0x3d3f4b={};_0x3d3f4b[_0x47b5b7]={'$like':'%'+_0x1bf4f1['query'][_0xce66('0x3c')]+'%'};return _0x3d3f4b;})});}_0x44eb90=_[_0xce66('0x3d')]({},_0x44eb90,_0x1bf4f1[_0xce66('0x41')]);return db[_0xce66('0x71')][_0xce66('0x89')](_0x44eb90);}})[_0xce66('0x2b')](respondWithResult(_0x384209,null))[_0xce66('0x50')](handleError(_0x384209,null));};exports[_0xce66('0x8a')]=function(_0x4b58dc,_0x20f786,_0x212337){return db['CmList']['find']({'where':{'id':_0x4b58dc['params']['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x20f786,null))[_0xce66('0x2b')](function(_0xbbc840){if(_0xbbc840){return _0xbbc840[_0xce66('0x8a')](_0x4b58dc[_0xce66('0x4a')]['ids'],_['omit'](_0x4b58dc[_0xce66('0x4a')],[_0xce66('0x5f'),'id'])||{})['spread'](function(_0xd69c9d){for(var _0x4f63e0=0x0;_0x4f63e0<_0x4b58dc['body'][_0xce66('0x5f')]['length'];_0x4f63e0+=0x1){socket[_0xce66('0x8b')](_0xce66('0x8c'),{'UserId':_0x4b58dc[_0xce66('0x4a')][_0xce66('0x5f')][_0x4f63e0],'CmListId':_0x4b58dc['params']['id']});}return _0xd69c9d;});}})[_0xce66('0x2b')](respondWithResult(_0x20f786,null))[_0xce66('0x50')](handleError(_0x20f786,null));};exports[_0xce66('0x8d')]=function(_0x2fdf41,_0x4898b3,_0x459202){return db[_0xce66('0x42')][_0xce66('0x48')]({'where':{'id':_0x2fdf41[_0xce66('0x47')]['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x4898b3,null))[_0xce66('0x2b')](function(_0x3c8034){if(_0x3c8034){return _0x3c8034[_0xce66('0x8d')](_0x2fdf41[_0xce66('0x33')]['ids'])['then'](function(){if(_[_0xce66('0x62')](_0x2fdf41[_0xce66('0x33')][_0xce66('0x5f')])){for(var _0x2ae2a2=0x0;_0x2ae2a2<_0x2fdf41['query'][_0xce66('0x5f')][_0xce66('0x5a')];_0x2ae2a2+=0x1){socket[_0xce66('0x8b')](_0xce66('0x8e'),{'UserId':Number(_0x2fdf41[_0xce66('0x33')]['ids'][_0x2ae2a2]),'CmListId':Number(_0x2fdf41[_0xce66('0x47')]['id'])});}}else{socket[_0xce66('0x8b')](_0xce66('0x8e'),{'UserId':Number(_0x2fdf41[_0xce66('0x33')][_0xce66('0x5f')]),'CmListId':Number(_0x2fdf41[_0xce66('0x47')]['id'])});}});}})[_0xce66('0x2b')](respondWithStatusCode(_0x4898b3,null))[_0xce66('0x50')](handleError(_0x4898b3,null));};exports[_0xce66('0x8f')]=function(_0x14f7ee,_0x5b3e1b,_0x1c72cf){var _0x59965f={};var _0x1f1999={};var _0x3dcb2b;var _0x361c01;return db[_0xce66('0x42')]['findOne']({'where':{'id':_0x14f7ee[_0xce66('0x47')]['id']}})[_0xce66('0x2b')](handleEntityNotFound(_0x5b3e1b,null))[_0xce66('0x2b')](function(_0x43bd82){if(_0x43bd82){_0x3dcb2b=_0x43bd82;_0x1f1999[_0xce66('0x31')]=_[_0xce66('0x32')](db['User']['rawAttributes']);_0x1f1999[_0xce66('0x33')]=_[_0xce66('0x32')](_0x14f7ee[_0xce66('0x33')]);_0x1f1999[_0xce66('0x34')]=_['intersection'](_0x1f1999[_0xce66('0x31')],_0x1f1999['query']);_0x59965f[_0xce66('0x36')]=_[_0xce66('0x35')](_0x1f1999[_0xce66('0x31')],qs['fields'](_0x14f7ee[_0xce66('0x33')][_0xce66('0x37')]));_0x59965f[_0xce66('0x36')]=_0x59965f[_0xce66('0x36')][_0xce66('0x5a')]?_0x59965f[_0xce66('0x36')]:_0x1f1999[_0xce66('0x31')];_0x59965f[_0xce66('0x39')]=qs[_0xce66('0x3a')](_0x14f7ee['query'][_0xce66('0x3a')]);_0x59965f[_0xce66('0x3b')]=qs[_0xce66('0x34')](_[_0xce66('0x5c')](_0x14f7ee[_0xce66('0x33')],_0x1f1999[_0xce66('0x34')]));if(_0x14f7ee[_0xce66('0x33')][_0xce66('0x3c')]){_0x59965f[_0xce66('0x3b')]=_[_0xce66('0x3d')](_0x59965f[_0xce66('0x3b')],{'$or':_[_0xce66('0x5d')](_0x59965f['attributes'],function(_0xaec387){var _0x4713b1={};_0x4713b1[_0xaec387]={'$like':'%'+_0x14f7ee[_0xce66('0x33')][_0xce66('0x3c')]+'%'};return _0x4713b1;})});}_0x59965f=_['merge']({},_0x59965f,_0x14f7ee['options']);return _0x3dcb2b[_0xce66('0x8f')](_0x59965f);}})[_0xce66('0x2b')](function(_0x974016){if(_0x974016){_0x361c01=_0x974016[_0xce66('0x5a')];if(!_0x14f7ee[_0xce66('0x33')]['hasOwnProperty']('nolimit')){_0x59965f['limit']=qs['limit'](_0x14f7ee['query'][_0xce66('0x23')]);_0x59965f[_0xce66('0x22')]=qs[_0xce66('0x22')](_0x14f7ee['query'][_0xce66('0x22')]);}return _0x3dcb2b[_0xce66('0x8f')](_0x59965f);}})[_0xce66('0x2b')](function(_0x51278e){if(_0x51278e){return _0x51278e?{'count':_0x361c01,'rows':_0x51278e}:null;}})[_0xce66('0x2b')](respondWithResult(_0x5b3e1b,null))['catch'](handleError(_0x5b3e1b,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 01e770e..0f1a983 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 _0x12b7=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x44a0e4,_0x22cb71){var _0x6586cc=function(_0x398156){while(--_0x398156){_0x44a0e4['push'](_0x44a0e4['shift']());}};_0x6586cc(++_0x22cb71);}(_0x12b7,0x106));var _0x712b=function(_0x887f2a,_0x4669e4){_0x887f2a=_0x887f2a-0x0;var _0x47a286=_0x12b7[_0x887f2a];return _0x47a286;};'use strict';var EventEmitter=require(_0x712b('0x0'));var CmList=require(_0x712b('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x712b('0x2')](0x0);var events={'afterCreate':_0x712b('0x3'),'afterUpdate':_0x712b('0x4'),'afterDestroy':_0x712b('0x5')};function emitEvent(_0x31e79d){return function(_0x43d6ba,_0x16b520,_0x14b1d7){CmListEvents[_0x712b('0x6')](_0x31e79d+':'+_0x43d6ba['id'],_0x43d6ba);CmListEvents['emit'](_0x31e79d,_0x43d6ba);_0x14b1d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x712b('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xf2ee=['hasOwnProperty','hook','exports','events','../../mysqldb','CmList','update','remove','emit'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xf2ee,0x162));var _0xef2e=function(_0xbe25d,_0xea3f10){_0xbe25d=_0xbe25d-0x0;var _0x1265f6=_0xf2ee[_0xbe25d];return _0x1265f6;};'use strict';var EventEmitter=require(_0xef2e('0x0'));var CmList=require(_0xef2e('0x1'))['db'][_0xef2e('0x2')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xef2e('0x3'),'afterDestroy':_0xef2e('0x4')};function emitEvent(_0x404538){return function(_0x1a28db,_0x165575,_0x236300){CmListEvents[_0xef2e('0x5')](_0x404538+':'+_0x1a28db['id'],_0x1a28db);CmListEvents[_0xef2e('0x5')](_0x404538,_0x1a28db);_0x236300(null);};}for(var e in events){if(events[_0xef2e('0x6')](e)){var event=events[e];CmList[_0xef2e('0x7')](e,emitEvent(event));}}module[_0xef2e('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index e5d02c1..2f9b028 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 _0xaefc=['lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','CmList'];(function(_0x57a730,_0x2a8535){var _0x4f58d7=function(_0x48c665){while(--_0x48c665){_0x57a730['push'](_0x57a730['shift']());}};_0x4f58d7(++_0x2a8535);}(_0xaefc,0xc8));var _0xcaef=function(_0x18a236,_0x3d75c3){_0x18a236=_0x18a236-0x0;var _0x4a89d0=_0xaefc[_0x18a236];return _0x4a89d0;};'use strict';var _=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var logger=require(_0xcaef('0x2'))('api');var moment=require(_0xcaef('0x3'));var BPromise=require(_0xcaef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var attributes=require('./cmList.attributes');module['exports']=function(_0x47457d,_0x4471a1){return _0x47457d['define'](_0xcaef('0x7'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90ae=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash'];(function(_0x5c8edb,_0x105253){var _0x5a1451=function(_0x5371f8){while(--_0x5371f8){_0x5c8edb['push'](_0x5c8edb['shift']());}};_0x5a1451(++_0x105253);}(_0x90ae,0x195));var _0xe90a=function(_0x26cf94,_0x1c912e){_0x26cf94=_0x26cf94-0x0;var _0x457faa=_0x90ae[_0x26cf94];return _0x457faa;};'use strict';var _=require(_0xe90a('0x0'));var util=require(_0xe90a('0x1'));var logger=require(_0xe90a('0x2'))('api');var moment=require(_0xe90a('0x3'));var BPromise=require(_0xe90a('0x4'));var rp=require(_0xe90a('0x5'));var fs=require('fs');var path=require(_0xe90a('0x6'));var rimraf=require(_0xe90a('0x7'));var config=require(_0xe90a('0x8'));var attributes=require(_0xe90a('0x9'));module[_0xe90a('0xa')]=function(_0x30cb7b,_0x5c3573){return _0x30cb7b[_0xe90a('0xb')](_0xe90a('0xc'),attributes,{'tableName':_0xe90a('0xd'),'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 9147cfc..50dcd6c 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 _0xfa10=['redis','localhost','./cmList.socket','then','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x4fcfa8,_0x5f2c4f){var _0x4998d7=function(_0x32db0b){while(--_0x32db0b){_0x4fcfa8['push'](_0x4fcfa8['shift']());}};_0x4998d7(++_0x5f2c4f);}(_0xfa10,0x16d));var _0x0fa1=function(_0x36f6e9,_0x36d983){_0x36f6e9=_0x36f6e9-0x0;var _0x4c5feb=_0xfa10[_0x36f6e9];return _0x4c5feb;};'use strict';var _=require('lodash');var util=require(_0x0fa1('0x0'));var moment=require(_0x0fa1('0x1'));var BPromise=require('bluebird');var rs=require(_0x0fa1('0x2'));var fs=require('fs');var Redis=require(_0x0fa1('0x3'));var db=require(_0x0fa1('0x4'))['db'];var utils=require(_0x0fa1('0x5'));var logger=require(_0x0fa1('0x6'))(_0x0fa1('0x7'));var config=require(_0x0fa1('0x8'));var jayson=require(_0x0fa1('0x9'));var client=jayson[_0x0fa1('0xa')][_0x0fa1('0xb')]({'port':0x232a});config['redis']=_[_0x0fa1('0xc')](config[_0x0fa1('0xd')],{'host':_0x0fa1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fa1('0xd')]));require(_0x0fa1('0xf'))['register'](socket);function respondWithRpcPromise(_0x861aaf,_0x2f19fe,_0x736a9e){return new BPromise(function(_0x54fc28,_0x11de6a){return client['request'](_0x861aaf,_0x736a9e)[_0x0fa1('0x10')](function(_0x548fd6){logger['info']('CmList,\x20%s,\x20%s',_0x2f19fe,_0x0fa1('0x11'));logger['debug'](_0x0fa1('0x12'),_0x2f19fe,'request\x20sent',JSON[_0x0fa1('0x13')](_0x548fd6));if(_0x548fd6[_0x0fa1('0x14')]){if(_0x548fd6['error'][_0x0fa1('0x15')]===0x1f4){logger['error'](_0x0fa1('0x16'),_0x2f19fe,_0x548fd6[_0x0fa1('0x14')][_0x0fa1('0x17')]);return _0x11de6a(_0x548fd6[_0x0fa1('0x14')][_0x0fa1('0x17')]);}logger['error']('CmList,\x20%s,\x20%s',_0x2f19fe,_0x548fd6[_0x0fa1('0x14')][_0x0fa1('0x17')]);return _0x54fc28(_0x548fd6[_0x0fa1('0x14')][_0x0fa1('0x17')]);}else{logger[_0x0fa1('0x18')](_0x0fa1('0x16'),_0x2f19fe,_0x0fa1('0x11'));_0x54fc28(_0x548fd6[_0x0fa1('0x19')][_0x0fa1('0x17')]);}})[_0x0fa1('0x1a')](function(_0x2b7f0b){logger['error']('CmList,\x20%s,\x20%s',_0x2f19fe,_0x2b7f0b);_0x11de6a(_0x2b7f0b);});});} \ No newline at end of file +var _0xab2d=['CmList,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x562d2a,_0x3a6e1f){var _0x181b2d=function(_0x14fe97){while(--_0x14fe97){_0x562d2a['push'](_0x562d2a['shift']());}};_0x181b2d(++_0x3a6e1f);}(_0xab2d,0x170));var _0xdab2=function(_0x14a88d,_0x387623){_0x14a88d=_0x14a88d-0x0;var _0x401aa9=_0xab2d[_0x14a88d];return _0x401aa9;};'use strict';var _=require(_0xdab2('0x0'));var util=require(_0xdab2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdab2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdab2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdab2('0x4'))(_0xdab2('0x5'));var config=require(_0xdab2('0x6'));var jayson=require(_0xdab2('0x7'));var client=jayson[_0xdab2('0x8')][_0xdab2('0x9')]({'port':0x232a});config[_0xdab2('0xa')]=_[_0xdab2('0xb')](config[_0xdab2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdab2('0xc'))(new Redis(config[_0xdab2('0xa')]));require(_0xdab2('0xd'))[_0xdab2('0xe')](socket);function respondWithRpcPromise(_0x69893e,_0x48edf5,_0x331925){return new BPromise(function(_0x391ea0,_0x30fdcf){return client[_0xdab2('0xf')](_0x69893e,_0x331925)[_0xdab2('0x10')](function(_0x6bad54){logger[_0xdab2('0x11')]('CmList,\x20%s,\x20%s',_0x48edf5,_0xdab2('0x12'));logger[_0xdab2('0x13')](_0xdab2('0x14'),_0x48edf5,_0xdab2('0x12'),JSON[_0xdab2('0x15')](_0x6bad54));if(_0x6bad54['error']){if(_0x6bad54[_0xdab2('0x16')][_0xdab2('0x17')]===0x1f4){logger[_0xdab2('0x16')](_0xdab2('0x18'),_0x48edf5,_0x6bad54[_0xdab2('0x16')]['message']);return _0x30fdcf(_0x6bad54[_0xdab2('0x16')][_0xdab2('0x19')]);}logger[_0xdab2('0x16')](_0xdab2('0x18'),_0x48edf5,_0x6bad54[_0xdab2('0x16')][_0xdab2('0x19')]);return _0x391ea0(_0x6bad54[_0xdab2('0x16')][_0xdab2('0x19')]);}else{logger[_0xdab2('0x11')](_0xdab2('0x18'),_0x48edf5,'request\x20sent');_0x391ea0(_0x6bad54[_0xdab2('0x1a')][_0xdab2('0x19')]);}})[_0xdab2('0x1b')](function(_0x135ba5){logger['error'](_0xdab2('0x18'),_0x48edf5,_0x135ba5);_0x30fdcf(_0x135ba5);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index e65c688..cdbfc22 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 _0x2d53=['./cmList.events','save','emit','removeListener','cmList:'];(function(_0x284b75,_0x38cfea){var _0x16e0d9=function(_0x23fe87){while(--_0x23fe87){_0x284b75['push'](_0x284b75['shift']());}};_0x16e0d9(++_0x38cfea);}(_0x2d53,0x8c));var _0x32d5=function(_0x4cfaca,_0x477428){_0x4cfaca=_0x4cfaca-0x0;var _0x33d40f=_0x2d53[_0x4cfaca];return _0x33d40f;};'use strict';var CmListEvents=require(_0x32d5('0x0'));var events=[_0x32d5('0x1'),'remove','update'];function createListener(_0x24a046,_0x4b640a){return function(_0x41a235){_0x4b640a[_0x32d5('0x2')](_0x24a046,_0x41a235);};}function removeListener(_0x4559e6,_0x500958){return function(){CmListEvents[_0x32d5('0x3')](_0x4559e6,_0x500958);};}exports['register']=function(_0x4556c0){for(var _0x2ba903=0x0,_0x22e2ef=events['length'];_0x2ba903<_0x22e2ef;_0x2ba903++){var _0x3e5dfe=events[_0x2ba903];var _0x1d12b0=createListener(_0x32d5('0x4')+_0x3e5dfe,_0x4556c0);CmListEvents['on'](_0x3e5dfe,_0x1d12b0);}}; \ No newline at end of file +var _0xd959=['removeListener','register','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x2f4d0c,_0x1f5a1a){var _0x16312e=function(_0x492071){while(--_0x492071){_0x2f4d0c['push'](_0x2f4d0c['shift']());}};_0x16312e(++_0x1f5a1a);}(_0xd959,0xd3));var _0x9d95=function(_0x50d6d5,_0x22ee8c){_0x50d6d5=_0x50d6d5-0x0;var _0xf5d86d=_0xd959[_0x50d6d5];return _0xf5d86d;};'use strict';var CmListEvents=require(_0x9d95('0x0'));var events=[_0x9d95('0x1'),_0x9d95('0x2'),_0x9d95('0x3')];function createListener(_0x52b4c1,_0x2a2e68){return function(_0x440ebf){_0x2a2e68[_0x9d95('0x4')](_0x52b4c1,_0x440ebf);};}function removeListener(_0x55f633,_0x50b7cd){return function(){CmListEvents[_0x9d95('0x5')](_0x55f633,_0x50b7cd);};}exports[_0x9d95('0x6')]=function(_0x1d3afa){for(var _0x4e94ee=0x0,_0x1e4f68=events['length'];_0x4e94ee<_0x1e4f68;_0x4e94ee++){var _0x203822=events[_0x4e94ee];var _0x3a338f=createListener(_0x9d95('0x7')+_0x203822,_0x1d3afa);CmListEvents['on'](_0x203822,_0x3a338f);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 580be74..f724f59 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 _0x50b7=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','put','update','delete','destroy','removeDispositions','/:id/users','removeAgents'];(function(_0x1a1d1c,_0x11c081){var _0x386c9d=function(_0x84d2d3){while(--_0x84d2d3){_0x1a1d1c['push'](_0x1a1d1c['shift']());}};_0x386c9d(++_0x11c081);}(_0x50b7,0x12a));var _0x750b=function(_0x1f3ec3,_0x3c7452){_0x1f3ec3=_0x1f3ec3-0x0;var _0x4927a2=_0x50b7[_0x1f3ec3];return _0x4927a2;};'use strict';var multer=require(_0x750b('0x0'));var util=require(_0x750b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x750b('0x2'));var router=express['Router']();var auth=require(_0x750b('0x3'));var interaction=require(_0x750b('0x4'));var config=require(_0x750b('0x5'));var controller=require(_0x750b('0x6'));router[_0x750b('0x7')]('/',auth[_0x750b('0x8')](),controller[_0x750b('0x9')]);router['get'](_0x750b('0xa'),auth['isAuthenticated'](),controller[_0x750b('0xb')]);router[_0x750b('0x7')](_0x750b('0xc'),auth[_0x750b('0x8')](),controller[_0x750b('0xd')]);router[_0x750b('0x7')](_0x750b('0xe'),auth[_0x750b('0x8')](),controller['getDispositions']);router[_0x750b('0x7')]('/:id/contacts',auth[_0x750b('0x8')](),controller['getContacts']);router[_0x750b('0x7')](_0x750b('0xf'),auth[_0x750b('0x8')](),controller['getContactsCsv']);router[_0x750b('0x7')](_0x750b('0x10'),auth[_0x750b('0x8')](),controller[_0x750b('0x11')]);router[_0x750b('0x7')]('/:id/users',auth[_0x750b('0x8')](),controller[_0x750b('0x12')]);router[_0x750b('0x13')]('/',auth[_0x750b('0x8')](),controller[_0x750b('0x14')]);router[_0x750b('0x13')](_0x750b('0xe'),auth[_0x750b('0x8')](),controller[_0x750b('0x15')]);router[_0x750b('0x13')](_0x750b('0x16'),auth['isAuthenticated'](),controller[_0x750b('0x17')]);router[_0x750b('0x13')]('/:id/fields',auth['isAuthenticated'](),controller[_0x750b('0x18')]);router[_0x750b('0x13')]('/:id/users',auth[_0x750b('0x8')](),controller['addAgents']);router[_0x750b('0x19')]('/:id',auth[_0x750b('0x8')](),controller[_0x750b('0x1a')]);router[_0x750b('0x1b')](_0x750b('0xc'),auth[_0x750b('0x8')](),controller[_0x750b('0x1c')]);router[_0x750b('0x1b')](_0x750b('0xe'),auth[_0x750b('0x8')](),controller[_0x750b('0x1d')]);router['delete'](_0x750b('0x1e'),auth[_0x750b('0x8')](),controller[_0x750b('0x1f')]);module[_0x750b('0x20')]=router; \ No newline at end of file +var _0x6674=['put','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','addDisposition','addCustomField','addAgents'];(function(_0x5869f5,_0x176fd5){var _0x6beba1=function(_0x253e04){while(--_0x253e04){_0x5869f5['push'](_0x5869f5['shift']());}};_0x6beba1(++_0x176fd5);}(_0x6674,0x15b));var _0x4667=function(_0x321dab,_0x2f9996){_0x321dab=_0x321dab-0x0;var _0x3107f5=_0x6674[_0x321dab];return _0x3107f5;};'use strict';var multer=require('multer');var util=require(_0x4667('0x0'));var path=require(_0x4667('0x1'));var timeout=require(_0x4667('0x2'));var express=require('express');var router=express[_0x4667('0x3')]();var auth=require(_0x4667('0x4'));var interaction=require(_0x4667('0x5'));var config=require(_0x4667('0x6'));var controller=require(_0x4667('0x7'));router['get']('/',auth[_0x4667('0x8')](),controller[_0x4667('0x9')]);router[_0x4667('0xa')](_0x4667('0xb'),auth[_0x4667('0x8')](),controller[_0x4667('0xc')]);router[_0x4667('0xa')](_0x4667('0xd'),auth['isAuthenticated'](),controller[_0x4667('0xe')]);router[_0x4667('0xa')](_0x4667('0xf'),auth['isAuthenticated'](),controller[_0x4667('0x10')]);router[_0x4667('0xa')](_0x4667('0x11'),auth[_0x4667('0x8')](),controller[_0x4667('0x12')]);router[_0x4667('0xa')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x4667('0x13')]);router[_0x4667('0xa')](_0x4667('0x14'),auth[_0x4667('0x8')](),controller[_0x4667('0x15')]);router[_0x4667('0xa')](_0x4667('0x16'),auth[_0x4667('0x8')](),controller['getAgents']);router[_0x4667('0x17')]('/',auth[_0x4667('0x8')](),controller['create']);router[_0x4667('0x17')](_0x4667('0xf'),auth[_0x4667('0x8')](),controller[_0x4667('0x18')]);router[_0x4667('0x17')]('/:id/contacts',auth[_0x4667('0x8')](),controller['addContacts']);router[_0x4667('0x17')]('/:id/fields',auth[_0x4667('0x8')](),controller[_0x4667('0x19')]);router[_0x4667('0x17')](_0x4667('0x16'),auth[_0x4667('0x8')](),controller[_0x4667('0x1a')]);router[_0x4667('0x1b')]('/:id',auth[_0x4667('0x8')](),controller[_0x4667('0x1c')]);router[_0x4667('0x1d')](_0x4667('0xd'),auth[_0x4667('0x8')](),controller[_0x4667('0x1e')]);router[_0x4667('0x1d')](_0x4667('0xf'),auth[_0x4667('0x8')](),controller[_0x4667('0x1f')]);router['delete'](_0x4667('0x16'),auth['isAuthenticated'](),controller[_0x4667('0x20')]);module[_0x4667('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 4429e42..fc0a726 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 _0x799b=['field','STRING','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x799b,0x8c));var _0xb799=function(_0x5b2a2a,_0x17d85a){_0x5b2a2a=_0x5b2a2a-0x0;var _0x44225b=_0x799b[_0x5b2a2a];return _0x44225b;};'use strict';var Sequelize=require(_0xb799('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xde4cf7){return this['getDataValue'](_0xb799('0x1'));}},'field':{'type':Sequelize[_0xb799('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0xb799('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb799('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd085=['STRING','sequelize','exports','field'];(function(_0x2b830d,_0xb4a030){var _0x500080=function(_0x10b024){while(--_0x10b024){_0x2b830d['push'](_0x2b830d['shift']());}};_0x500080(++_0xb4a030);}(_0xd085,0x129));var _0x5d08=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0xd085[_0x57d370];return _0x550fd2;};'use strict';var Sequelize=require(_0x5d08('0x0'));module[_0x5d08('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4fa3df){return this['getDataValue'](_0x5d08('0x2'));}},'field':{'type':Sequelize[_0x5d08('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x5d08('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x5d08('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 8d778d7..a269ddb 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 _0x6920=['fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','save','update','then','error','stack','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x6920,0x164));var _0x0692=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x6920[_0x4bb581];return _0x316bf5;};'use strict';var pdf=require(_0x0692('0x0'));var emlformat=require(_0x0692('0x1'));var rimraf=require(_0x0692('0x2'));var zipdir=require(_0x0692('0x3'));var jsonpatch=require(_0x0692('0x4'));var rp=require(_0x0692('0x5'));var moment=require(_0x0692('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x0692('0x7'));var util=require('util');var path=require(_0x0692('0x8'));var sox=require(_0x0692('0x9'));var csv=require(_0x0692('0xa'));var ejs=require(_0x0692('0xb'));var fs=require('fs');var _=require(_0x0692('0xc'));var squel=require(_0x0692('0xd'));var crypto=require(_0x0692('0xe'));var jsforce=require(_0x0692('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0692('0xa'));var querystring=require(_0x0692('0x10'));var Papa=require(_0x0692('0x11'));var Redis=require(_0x0692('0x12'));var authService=require(_0x0692('0x13'));var qs=require(_0x0692('0x14'));var hardwareService=require(_0x0692('0x15'));var logger=require('../../config/logger')(_0x0692('0x16'));var utils=require(_0x0692('0x17'));var config=require('../../config/environment');var db=require(_0x0692('0x18'))['db'];function respondWithStatusCode(_0x161eda,_0x5600aa){_0x5600aa=_0x5600aa||0xcc;return function(_0x48c889){if(_0x48c889){return _0x161eda[_0x0692('0x19')](_0x5600aa);}return _0x161eda[_0x0692('0x1a')](_0x5600aa)[_0x0692('0x1b')]();};}function respondWithResult(_0x1f1d2d,_0x3f21ac){_0x3f21ac=_0x3f21ac||0xc8;return function(_0x4a939d){if(_0x4a939d){return _0x1f1d2d[_0x0692('0x1a')](_0x3f21ac)['json'](_0x4a939d);}};}function respondWithFilteredResult(_0x581a48,_0x2d9069){return function(_0x17ac00){if(_0x17ac00){var _0x92d3cd=_0x17ac00[_0x0692('0x1c')],_0x17396f=_0x2d9069['offset'],_0x1390c1=_0x2d9069[_0x0692('0x1d')]+_0x2d9069[_0x0692('0x1e')],_0x1ad997;if(_0x1390c1>=_0x92d3cd){_0x1390c1=_0x92d3cd;_0x1ad997=0xc8;}else{_0x1ad997=0xce;}_0x581a48[_0x0692('0x1a')](_0x1ad997);return _0x581a48['set'](_0x0692('0x1f'),_0x17396f+'-'+_0x1390c1+'/'+_0x92d3cd)['json'](_0x17ac00);}return null;};}function patchUpdates(_0x203d24){return function(_0x4a7854){try{jsonpatch[_0x0692('0x20')](_0x4a7854,_0x203d24,!![]);}catch(_0x49c153){return BPromise['reject'](_0x49c153);}return _0x4a7854[_0x0692('0x21')]();};}function saveUpdates(_0x3713d2,_0x54d24c){return function(_0x2c81de){if(_0x2c81de){return _0x2c81de[_0x0692('0x22')](_0x3713d2)[_0x0692('0x23')](function(_0x524d9d){return _0x524d9d;});}return null;};}function removeEntity(_0x5170e3,_0x4ce738){return function(_0x243413){if(_0x243413){return _0x243413['destroy']()['then'](function(){_0x5170e3[_0x0692('0x1a')](0xcc)[_0x0692('0x1b')]();});}};}function handleEntityNotFound(_0x151a1f,_0x1b0f62){return function(_0x400025){if(!_0x400025){_0x151a1f['sendStatus'](0x194);}return _0x400025;};}function handleError(_0x238a3f,_0x175292){_0x175292=_0x175292||0x1f4;return function(_0x4bda50){logger[_0x0692('0x24')](_0x4bda50[_0x0692('0x25')]);if(_0x4bda50['name']){delete _0x4bda50[_0x0692('0x26')];}_0x238a3f['status'](_0x175292)[_0x0692('0x27')](_0x4bda50);};}exports['update']=function(_0x289ec0,_0x424a8c){if(_0x289ec0[_0x0692('0x28')]['id']){delete _0x289ec0['body']['id'];}return db[_0x0692('0x29')][_0x0692('0x2a')]({'where':{'id':_0x289ec0[_0x0692('0x2b')]['id']}})[_0x0692('0x23')](handleEntityNotFound(_0x424a8c,null))[_0x0692('0x23')](saveUpdates(_0x289ec0[_0x0692('0x28')],null))['then'](respondWithResult(_0x424a8c,null))['catch'](handleError(_0x424a8c,null));};exports['destroy']=function(_0x202f87,_0x433393){return db[_0x0692('0x29')]['find']({'where':{'id':_0x202f87[_0x0692('0x2b')]['id']}})[_0x0692('0x23')](handleEntityNotFound(_0x433393,null))['then'](removeEntity(_0x433393,null))[_0x0692('0x2c')](handleError(_0x433393,null));}; \ No newline at end of file +var _0x9853=['json','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','body','Condition','params','catch','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9853,0x173));var _0x3985=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x9853[_0x217ff6];return _0x417c93;};'use strict';var pdf=require(_0x3985('0x0'));var emlformat=require(_0x3985('0x1'));var rimraf=require(_0x3985('0x2'));var zipdir=require(_0x3985('0x3'));var jsonpatch=require(_0x3985('0x4'));var rp=require(_0x3985('0x5'));var moment=require(_0x3985('0x6'));var BPromise=require(_0x3985('0x7'));var Mustache=require(_0x3985('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3985('0x9'));var ejs=require(_0x3985('0xa'));var fs=require('fs');var _=require(_0x3985('0xb'));var squel=require(_0x3985('0xc'));var crypto=require('crypto');var jsforce=require(_0x3985('0xd'));var deskjs=require(_0x3985('0xe'));var toCsv=require(_0x3985('0x9'));var querystring=require('querystring');var Papa=require(_0x3985('0xf'));var Redis=require(_0x3985('0x10'));var authService=require(_0x3985('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3985('0x12'));var logger=require(_0x3985('0x13'))(_0x3985('0x14'));var utils=require(_0x3985('0x15'));var config=require('../../config/environment');var db=require(_0x3985('0x16'))['db'];function respondWithStatusCode(_0x2245ba,_0x2e44c8){_0x2e44c8=_0x2e44c8||0xcc;return function(_0x17b2d6){if(_0x17b2d6){return _0x2245ba['sendStatus'](_0x2e44c8);}return _0x2245ba[_0x3985('0x17')](_0x2e44c8)[_0x3985('0x18')]();};}function respondWithResult(_0x36bff9,_0x33dbe1){_0x33dbe1=_0x33dbe1||0xc8;return function(_0x3724ed){if(_0x3724ed){return _0x36bff9[_0x3985('0x17')](_0x33dbe1)[_0x3985('0x19')](_0x3724ed);}};}function respondWithFilteredResult(_0x13c13b,_0x116af4){return function(_0x4e8fcb){if(_0x4e8fcb){var _0x112507=_0x4e8fcb[_0x3985('0x1a')],_0x454966=_0x116af4['offset'],_0x36e2ae=_0x116af4[_0x3985('0x1b')]+_0x116af4['limit'],_0x1e5e29;if(_0x36e2ae>=_0x112507){_0x36e2ae=_0x112507;_0x1e5e29=0xc8;}else{_0x1e5e29=0xce;}_0x13c13b['status'](_0x1e5e29);return _0x13c13b['set'](_0x3985('0x1c'),_0x454966+'-'+_0x36e2ae+'/'+_0x112507)[_0x3985('0x19')](_0x4e8fcb);}return null;};}function patchUpdates(_0x26f841){return function(_0x260d0a){try{jsonpatch[_0x3985('0x1d')](_0x260d0a,_0x26f841,!![]);}catch(_0x2675d2){return BPromise[_0x3985('0x1e')](_0x2675d2);}return _0x260d0a[_0x3985('0x1f')]();};}function saveUpdates(_0x50bce1,_0x5e4a96){return function(_0x19546c){if(_0x19546c){return _0x19546c[_0x3985('0x20')](_0x50bce1)[_0x3985('0x21')](function(_0x5e80ab){return _0x5e80ab;});}return null;};}function removeEntity(_0x4c813e,_0xd2dbb9){return function(_0x52364d){if(_0x52364d){return _0x52364d[_0x3985('0x22')]()[_0x3985('0x21')](function(){_0x4c813e[_0x3985('0x17')](0xcc)[_0x3985('0x18')]();});}};}function handleEntityNotFound(_0xa0a201,_0x2ca1b){return function(_0x475cff){if(!_0x475cff){_0xa0a201[_0x3985('0x23')](0x194);}return _0x475cff;};}function handleError(_0x28e660,_0x2b3bed){_0x2b3bed=_0x2b3bed||0x1f4;return function(_0x4c606d){logger[_0x3985('0x24')](_0x4c606d['stack']);if(_0x4c606d[_0x3985('0x25')]){delete _0x4c606d[_0x3985('0x25')];}_0x28e660[_0x3985('0x17')](_0x2b3bed)[_0x3985('0x26')](_0x4c606d);};}exports['update']=function(_0x437311,_0x55c1fb){if(_0x437311[_0x3985('0x27')]['id']){delete _0x437311[_0x3985('0x27')]['id'];}return db[_0x3985('0x28')]['find']({'where':{'id':_0x437311[_0x3985('0x29')]['id']}})['then'](handleEntityNotFound(_0x55c1fb,null))[_0x3985('0x21')](saveUpdates(_0x437311[_0x3985('0x27')],null))['then'](respondWithResult(_0x55c1fb,null))[_0x3985('0x2a')](handleError(_0x55c1fb,null));};exports[_0x3985('0x22')]=function(_0x4a48b8,_0x3c59dc){return db[_0x3985('0x28')][_0x3985('0x2b')]({'where':{'id':_0x4a48b8[_0x3985('0x29')]['id']}})[_0x3985('0x21')](handleEntityNotFound(_0x3c59dc,null))[_0x3985('0x21')](removeEntity(_0x3c59dc,null))[_0x3985('0x2a')](handleError(_0x3c59dc,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index b38db24..19dcb23 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 _0xbdd8=['request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api','bluebird'];(function(_0x775f37,_0x5dc46f){var _0x59755b=function(_0x398f05){while(--_0x398f05){_0x775f37['push'](_0x775f37['shift']());}};_0x59755b(++_0x5dc46f);}(_0xbdd8,0x68));var _0x8bdd=function(_0x3902b0,_0x3eec72){_0x3902b0=_0x3902b0-0x0;var _0x4c0d8a=_0xbdd8[_0x3902b0];return _0x4c0d8a;};'use strict';var _=require(_0x8bdd('0x0'));var util=require('util');var logger=require(_0x8bdd('0x1'))(_0x8bdd('0x2'));var moment=require('moment');var BPromise=require(_0x8bdd('0x3'));var rp=require(_0x8bdd('0x4'));var fs=require('fs');var path=require(_0x8bdd('0x5'));var rimraf=require(_0x8bdd('0x6'));var config=require('../../config/environment');var attributes=require(_0x8bdd('0x7'));module[_0x8bdd('0x8')]=function(_0x1d4897,_0x538279){return _0x1d4897[_0x8bdd('0x9')](_0x8bdd('0xa'),attributes,{'tableName':_0x8bdd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ec=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x4aff05,_0x1194c){var _0x1dd2de=function(_0x344d15){while(--_0x344d15){_0x4aff05['push'](_0x4aff05['shift']());}};_0x1dd2de(++_0x1194c);}(_0x06ec,0xb1));var _0xc06e=function(_0x21d4ac,_0x463381){_0x21d4ac=_0x21d4ac-0x0;var _0x416f63=_0x06ec[_0x21d4ac];return _0x416f63;};'use strict';var _=require(_0xc06e('0x0'));var util=require(_0xc06e('0x1'));var logger=require(_0xc06e('0x2'))(_0xc06e('0x3'));var moment=require(_0xc06e('0x4'));var BPromise=require(_0xc06e('0x5'));var rp=require(_0xc06e('0x6'));var fs=require('fs');var path=require(_0xc06e('0x7'));var rimraf=require(_0xc06e('0x8'));var config=require(_0xc06e('0x9'));var attributes=require(_0xc06e('0xa'));module[_0xc06e('0xb')]=function(_0x329064,_0x367726){return _0x329064['define'](_0xc06e('0xc'),attributes,{'tableName':_0xc06e('0xd'),'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 ac0b76f..99a617e 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 _0xcb82=['code','error','message','Condition,\x20%s,\x20%s','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11bef7,_0x35cfa2){var _0x516854=function(_0x45eb17){while(--_0x45eb17){_0x11bef7['push'](_0x11bef7['shift']());}};_0x516854(++_0x35cfa2);}(_0xcb82,0x16d));var _0x2cb8=function(_0xacc5a1,_0x21a98b){_0xacc5a1=_0xacc5a1-0x0;var _0x5774aa=_0xcb82[_0xacc5a1];return _0x5774aa;};'use strict';var _=require('lodash');var util=require(_0x2cb8('0x0'));var moment=require('moment');var BPromise=require(_0x2cb8('0x1'));var rs=require(_0x2cb8('0x2'));var fs=require('fs');var Redis=require(_0x2cb8('0x3'));var db=require(_0x2cb8('0x4'))['db'];var utils=require(_0x2cb8('0x5'));var logger=require(_0x2cb8('0x6'))(_0x2cb8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2cb8('0x8')][_0x2cb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3025fa,_0x127a2d,_0x2993cf){return new BPromise(function(_0x5eca0f,_0x2e820d){return client['request'](_0x3025fa,_0x2993cf)[_0x2cb8('0xa')](function(_0x524c85){logger[_0x2cb8('0xb')]('Condition,\x20%s,\x20%s',_0x127a2d,_0x2cb8('0xc'));logger['debug'](_0x2cb8('0xd'),_0x127a2d,_0x2cb8('0xc'),JSON[_0x2cb8('0xe')](_0x524c85));if(_0x524c85['error']){if(_0x524c85['error'][_0x2cb8('0xf')]===0x1f4){logger[_0x2cb8('0x10')]('Condition,\x20%s,\x20%s',_0x127a2d,_0x524c85['error']['message']);return _0x2e820d(_0x524c85[_0x2cb8('0x10')][_0x2cb8('0x11')]);}logger[_0x2cb8('0x10')]('Condition,\x20%s,\x20%s',_0x127a2d,_0x524c85[_0x2cb8('0x10')][_0x2cb8('0x11')]);return _0x5eca0f(_0x524c85['error'][_0x2cb8('0x11')]);}else{logger[_0x2cb8('0xb')](_0x2cb8('0x12'),_0x127a2d,'request\x20sent');_0x5eca0f(_0x524c85['result'][_0x2cb8('0x11')]);}})[_0x2cb8('0x13')](function(_0x35241b){logger[_0x2cb8('0x10')](_0x2cb8('0x12'),_0x127a2d,_0x35241b);_0x2e820d(_0x35241b);});});} \ No newline at end of file +var _0xda86=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x39853d,_0x2501bf){var _0x5864ca=function(_0xbc99d5){while(--_0xbc99d5){_0x39853d['push'](_0x39853d['shift']());}};_0x5864ca(++_0x2501bf);}(_0xda86,0x129));var _0x6da8=function(_0x4d5bb2,_0x102a23){_0x4d5bb2=_0x4d5bb2-0x0;var _0x313676=_0xda86[_0x4d5bb2];return _0x313676;};'use strict';var _=require(_0x6da8('0x0'));var util=require(_0x6da8('0x1'));var moment=require(_0x6da8('0x2'));var BPromise=require(_0x6da8('0x3'));var rs=require(_0x6da8('0x4'));var fs=require('fs');var Redis=require(_0x6da8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6da8('0x6'));var logger=require(_0x6da8('0x7'))(_0x6da8('0x8'));var config=require(_0x6da8('0x9'));var jayson=require(_0x6da8('0xa'));var client=jayson['client'][_0x6da8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4965b7,_0x1f47e0,_0x2b4cc0){return new BPromise(function(_0x40f252,_0x30578e){return client[_0x6da8('0xc')](_0x4965b7,_0x2b4cc0)[_0x6da8('0xd')](function(_0x594eac){logger[_0x6da8('0xe')](_0x6da8('0xf'),_0x1f47e0,_0x6da8('0x10'));logger[_0x6da8('0x11')](_0x6da8('0x12'),_0x1f47e0,_0x6da8('0x10'),JSON[_0x6da8('0x13')](_0x594eac));if(_0x594eac[_0x6da8('0x14')]){if(_0x594eac[_0x6da8('0x14')]['code']===0x1f4){logger[_0x6da8('0x14')](_0x6da8('0xf'),_0x1f47e0,_0x594eac[_0x6da8('0x14')]['message']);return _0x30578e(_0x594eac[_0x6da8('0x14')][_0x6da8('0x15')]);}logger[_0x6da8('0x14')]('Condition,\x20%s,\x20%s',_0x1f47e0,_0x594eac['error']['message']);return _0x40f252(_0x594eac[_0x6da8('0x14')][_0x6da8('0x15')]);}else{logger[_0x6da8('0xe')](_0x6da8('0xf'),_0x1f47e0,_0x6da8('0x10'));_0x40f252(_0x594eac['result'][_0x6da8('0x15')]);}})[_0x6da8('0x16')](function(_0x533725){logger[_0x6da8('0x14')](_0x6da8('0xf'),_0x1f47e0,_0x533725);_0x30578e(_0x533725);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5c874ef..a6aedcc 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 _0xd693=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0xebb12,_0x4f3869){var _0x4f3c04=function(_0x3ac428){while(--_0x3ac428){_0xebb12['push'](_0xebb12['shift']());}};_0x4f3c04(++_0x4f3869);}(_0xd693,0xc3));var _0x3d69=function(_0x5d2a16,_0x5ca1ca){_0x5d2a16=_0x5d2a16-0x0;var _0x2fd4b7=_0xd693[_0x5d2a16];return _0x2fd4b7;};'use strict';var multer=require(_0x3d69('0x0'));var util=require('util');var path=require(_0x3d69('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3d69('0x2')]();var auth=require(_0x3d69('0x3'));var interaction=require(_0x3d69('0x4'));var config=require(_0x3d69('0x5'));var controller=require(_0x3d69('0x6'));router[_0x3d69('0x7')](_0x3d69('0x8'),auth[_0x3d69('0x9')](),controller[_0x3d69('0xa')]);router[_0x3d69('0xb')](_0x3d69('0x8'),auth['isAuthenticated'](),controller[_0x3d69('0xc')]);module[_0x3d69('0xd')]=router; \ No newline at end of file +var _0x6e36=['isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x5e1afd,_0x1719d8){var _0x54b097=function(_0x307f23){while(--_0x307f23){_0x5e1afd['push'](_0x5e1afd['shift']());}};_0x54b097(++_0x1719d8);}(_0x6e36,0x189));var _0x66e3=function(_0x517c2e,_0x3d4bf3){_0x517c2e=_0x517c2e-0x0;var _0x5d4029=_0x6e36[_0x517c2e];return _0x5d4029;};'use strict';var multer=require(_0x66e3('0x0'));var util=require(_0x66e3('0x1'));var path=require('path');var timeout=require(_0x66e3('0x2'));var express=require(_0x66e3('0x3'));var router=express[_0x66e3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x66e3('0x5'));var config=require(_0x66e3('0x6'));var controller=require(_0x66e3('0x7'));router[_0x66e3('0x8')](_0x66e3('0x9'),auth[_0x66e3('0xa')](),controller['update']);router['delete'](_0x66e3('0x9'),auth[_0x66e3('0xa')](),controller[_0x66e3('0xb')]);module[_0x66e3('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index ce52b74..8efd55b 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 _0x7911=['name','sequelize','STRING'];(function(_0x26a382,_0x3d54db){var _0x14f9c8=function(_0x1b69f6){while(--_0x1b69f6){_0x26a382['push'](_0x26a382['shift']());}};_0x14f9c8(++_0x3d54db);}(_0x7911,0xd6));var _0x1791=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x7911[_0x40dd56];return _0x4f850f;};'use strict';var Sequelize=require(_0x1791('0x0'));module['exports']={'name':{'type':Sequelize[_0x1791('0x1')],'allowNull':![],'unique':_0x1791('0x2')},'description':{'type':Sequelize[_0x1791('0x1')]}}; \ No newline at end of file +var _0x2e4d=['STRING'];(function(_0xf1aa01,_0x477960){var _0x2e8946=function(_0x37e388){while(--_0x37e388){_0xf1aa01['push'](_0xf1aa01['shift']());}};_0x2e8946(++_0x477960);}(_0x2e4d,0x97));var _0xd2e4=function(_0xef26fb,_0x3b99b3){_0xef26fb=_0xef26fb-0x0;var _0x48abe4=_0x2e4d[_0xef26fb];return _0x48abe4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd2e4('0x0')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 428e523..0f41744 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 _0x1b5c=['stringify','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','json','count','offset','limit','set','apply','save','update','then','destroy','UserProfileResource','status','end','error','stack','name','send','index','Dashboard','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','type','key','VIRTUAL','field','merge','options','include','catch','show','params','rawAttributes','includeAll','find','body','user','role','get','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','https://','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0x1b5c,0xf7));var _0xc1b5=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x1b5c[_0x4de9e8];return _0x4db0de;};'use strict';var pdf=require(_0xc1b5('0x0'));var emlformat=require(_0xc1b5('0x1'));var rimraf=require(_0xc1b5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc1b5('0x3'));var moment=require(_0xc1b5('0x4'));var BPromise=require(_0xc1b5('0x5'));var Mustache=require(_0xc1b5('0x6'));var util=require(_0xc1b5('0x7'));var path=require(_0xc1b5('0x8'));var sox=require(_0xc1b5('0x9'));var csv=require(_0xc1b5('0xa'));var ejs=require(_0xc1b5('0xb'));var fs=require('fs');var _=require(_0xc1b5('0xc'));var squel=require(_0xc1b5('0xd'));var crypto=require(_0xc1b5('0xe'));var jsforce=require(_0xc1b5('0xf'));var deskjs=require(_0xc1b5('0x10'));var toCsv=require(_0xc1b5('0xa'));var querystring=require(_0xc1b5('0x11'));var Papa=require(_0xc1b5('0x12'));var Redis=require(_0xc1b5('0x13'));var authService=require(_0xc1b5('0x14'));var qs=require(_0xc1b5('0x15'));var hardwareService=require(_0xc1b5('0x16'));var logger=require('../../config/logger')(_0xc1b5('0x17'));var utils=require('../../config/utils');var config=require(_0xc1b5('0x18'));var db=require('../../mysqldb')['db'];config[_0xc1b5('0x19')]=_[_0xc1b5('0x1a')](config[_0xc1b5('0x19')],{'host':_0xc1b5('0x1b'),'port':0x18eb});var socket=require(_0xc1b5('0x1c'))(new Redis(config['redis']));require(_0xc1b5('0x1d'))[_0xc1b5('0x1e')](socket);function respondWithStatusCode(_0x459aa4,_0x237132){_0x237132=_0x237132||0xcc;return function(_0x3ee0ad){if(_0x3ee0ad){return _0x459aa4[_0xc1b5('0x1f')](_0x237132);}return _0x459aa4['status'](_0x237132)['end']();};}function respondWithResult(_0x5a0ae5,_0x2a49dc){_0x2a49dc=_0x2a49dc||0xc8;return function(_0x427c81){if(_0x427c81){return _0x5a0ae5['status'](_0x2a49dc)[_0xc1b5('0x20')](_0x427c81);}};}function respondWithFilteredResult(_0x2befbb,_0x19e752){return function(_0x64d47b){if(_0x64d47b){var _0x5905d8=_0x64d47b[_0xc1b5('0x21')],_0x38c07e=_0x19e752[_0xc1b5('0x22')],_0x5e96ad=_0x19e752[_0xc1b5('0x22')]+_0x19e752[_0xc1b5('0x23')],_0x5e2402;if(_0x5e96ad>=_0x5905d8){_0x5e96ad=_0x5905d8;_0x5e2402=0xc8;}else{_0x5e2402=0xce;}_0x2befbb['status'](_0x5e2402);return _0x2befbb[_0xc1b5('0x24')]('Content-Range',_0x38c07e+'-'+_0x5e96ad+'/'+_0x5905d8)[_0xc1b5('0x20')](_0x64d47b);}return null;};}function patchUpdates(_0x390dbb){return function(_0x405f02){try{jsonpatch[_0xc1b5('0x25')](_0x405f02,_0x390dbb,!![]);}catch(_0x1f0f4b){return BPromise['reject'](_0x1f0f4b);}return _0x405f02[_0xc1b5('0x26')]();};}function saveUpdates(_0x5093e2,_0x1a7141){return function(_0x2a0fed){if(_0x2a0fed){return _0x2a0fed[_0xc1b5('0x27')](_0x5093e2)[_0xc1b5('0x28')](function(_0x18fc1d){return _0x18fc1d;});}return null;};}function removeEntity(_0x427a88,_0x363f51){return function(_0x547610){if(_0x547610){return _0x547610[_0xc1b5('0x29')]()['then'](function(){var _0x20b09c=_0x547610['get']({'plain':!![]});var _0x5b7e6d='CustomDashboards';return db[_0xc1b5('0x2a')][_0xc1b5('0x29')]({'where':{'type':_0x5b7e6d,'resourceId':_0x20b09c['id']}})[_0xc1b5('0x28')](function(){return _0x547610;});})[_0xc1b5('0x28')](function(){_0x427a88[_0xc1b5('0x2b')](0xcc)[_0xc1b5('0x2c')]();});}};}function handleEntityNotFound(_0x13d3c3,_0x43ee37){return function(_0x1de0e3){if(!_0x1de0e3){_0x13d3c3[_0xc1b5('0x1f')](0x194);}return _0x1de0e3;};}function handleError(_0x418d19,_0x3060f4){_0x3060f4=_0x3060f4||0x1f4;return function(_0x5dc5d0){logger[_0xc1b5('0x2d')](_0x5dc5d0[_0xc1b5('0x2e')]);if(_0x5dc5d0[_0xc1b5('0x2f')]){delete _0x5dc5d0['name'];}_0x418d19[_0xc1b5('0x2b')](_0x3060f4)[_0xc1b5('0x30')](_0x5dc5d0);};}exports[_0xc1b5('0x31')]=function(_0x43a861,_0x3da356){var _0x3c3d66={},_0xd3c08e={},_0x38a373={'count':0x0,'rows':[]};var _0x4f2d91=db[_0xc1b5('0x32')]['rawAttributes'];_0xd3c08e[_0xc1b5('0x33')]=_[_0xc1b5('0x34')](_0x4f2d91);_0xd3c08e['query']=_['keys'](_0x43a861[_0xc1b5('0x35')]);_0xd3c08e['filters']=_[_0xc1b5('0x36')](_0xd3c08e['model'],_0xd3c08e[_0xc1b5('0x35')]);_0x3c3d66[_0xc1b5('0x37')]=_[_0xc1b5('0x36')](_0xd3c08e['model'],qs[_0xc1b5('0x38')](_0x43a861[_0xc1b5('0x35')][_0xc1b5('0x38')]));_0x3c3d66[_0xc1b5('0x37')]=_0x3c3d66[_0xc1b5('0x37')][_0xc1b5('0x39')]?_0x3c3d66[_0xc1b5('0x37')]:_0xd3c08e[_0xc1b5('0x33')];if(!_0x43a861[_0xc1b5('0x35')][_0xc1b5('0x3a')](_0xc1b5('0x3b'))){_0x3c3d66[_0xc1b5('0x23')]=qs[_0xc1b5('0x23')](_0x43a861[_0xc1b5('0x35')][_0xc1b5('0x23')]);_0x3c3d66[_0xc1b5('0x22')]=qs[_0xc1b5('0x22')](_0x43a861[_0xc1b5('0x35')][_0xc1b5('0x22')]);}_0x3c3d66[_0xc1b5('0x3c')]=qs['sort'](_0x43a861[_0xc1b5('0x35')][_0xc1b5('0x3d')]);_0x3c3d66[_0xc1b5('0x3e')]=qs['filters'](_[_0xc1b5('0x3f')](_0x43a861[_0xc1b5('0x35')],_0xd3c08e[_0xc1b5('0x40')]));if(_0x43a861[_0xc1b5('0x35')][_0xc1b5('0x41')]){_0x3c3d66[_0xc1b5('0x3e')]=_['merge'](_0x3c3d66['where'],{'$or':_[_0xc1b5('0x42')](_0x4f2d91,function(_0x225f26){if(_0x225f26[_0xc1b5('0x43')][_0xc1b5('0x44')]!==_0xc1b5('0x45')){var _0x523616={};_0x523616[_0x225f26[_0xc1b5('0x46')]]={'$like':'%'+_0x43a861['query'][_0xc1b5('0x41')]+'%'};return _0x523616;}})});}_0x3c3d66=_[_0xc1b5('0x47')]({},_0x3c3d66,_0x43a861[_0xc1b5('0x48')]);var _0x21a3e2={'where':_0x3c3d66[_0xc1b5('0x3e')]};return db[_0xc1b5('0x32')]['count'](_0x21a3e2)[_0xc1b5('0x28')](function(_0x16a85a){_0x38a373['count']=_0x16a85a;if(_0x43a861[_0xc1b5('0x35')]['includeAll']){_0x3c3d66[_0xc1b5('0x49')]=[{'all':!![]}];}return db[_0xc1b5('0x32')]['findAll'](_0x3c3d66);})[_0xc1b5('0x28')](function(_0x33cfcf){_0x38a373['rows']=_0x33cfcf;return _0x38a373;})[_0xc1b5('0x28')](respondWithFilteredResult(_0x3da356,_0x3c3d66))[_0xc1b5('0x4a')](handleError(_0x3da356,null));};exports[_0xc1b5('0x4b')]=function(_0x8c81ea,_0x4bf636){var _0x3e3e89={'raw':![],'where':{'id':_0x8c81ea[_0xc1b5('0x4c')]['id']}},_0x33c7a5={};_0x33c7a5['model']=_[_0xc1b5('0x34')](db[_0xc1b5('0x32')][_0xc1b5('0x4d')]);_0x33c7a5[_0xc1b5('0x35')]=_['keys'](_0x8c81ea[_0xc1b5('0x35')]);_0x33c7a5[_0xc1b5('0x40')]=_[_0xc1b5('0x36')](_0x33c7a5['model'],_0x33c7a5['query']);_0x3e3e89[_0xc1b5('0x37')]=_[_0xc1b5('0x36')](_0x33c7a5[_0xc1b5('0x33')],qs[_0xc1b5('0x38')](_0x8c81ea['query'][_0xc1b5('0x38')]));_0x3e3e89['attributes']=_0x3e3e89[_0xc1b5('0x37')][_0xc1b5('0x39')]?_0x3e3e89[_0xc1b5('0x37')]:_0x33c7a5[_0xc1b5('0x33')];if(_0x8c81ea[_0xc1b5('0x35')][_0xc1b5('0x4e')]){_0x3e3e89['include']=[{'all':!![]}];}_0x3e3e89=_['merge']({},_0x3e3e89,_0x8c81ea[_0xc1b5('0x48')]);return db[_0xc1b5('0x32')][_0xc1b5('0x4f')](_0x3e3e89)[_0xc1b5('0x28')](handleEntityNotFound(_0x4bf636,null))['then'](respondWithResult(_0x4bf636,null))[_0xc1b5('0x4a')](handleError(_0x4bf636,null));};exports['create']=function(_0x204225,_0x33ce47){return db[_0xc1b5('0x32')]['create'](_0x204225[_0xc1b5('0x50')],{})['then'](function(_0x150c93){var _0x209c0f=_0x204225[_0xc1b5('0x51')]['get']({'plain':!![]});if(!_0x209c0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x209c0f[_0xc1b5('0x52')]===_0xc1b5('0x51')){var _0x5b89a7=_0x150c93[_0xc1b5('0x53')]({'plain':!![]});var _0x8ea53b=_0xc1b5('0x54');return db[_0xc1b5('0x55')][_0xc1b5('0x4f')]({'where':{'name':_0x8ea53b,'userProfileId':_0x209c0f[_0xc1b5('0x56')]},'raw':!![]})[_0xc1b5('0x28')](function(_0x43b6a7){if(_0x43b6a7&&_0x43b6a7[_0xc1b5('0x57')]===0x0){return db[_0xc1b5('0x2a')][_0xc1b5('0x58')]({'name':_0x5b89a7[_0xc1b5('0x2f')],'resourceId':_0x5b89a7['id'],'type':_0x43b6a7[_0xc1b5('0x2f')],'sectionId':_0x43b6a7['id']},{})[_0xc1b5('0x28')](function(){return _0x150c93;});}else{return _0x150c93;}})[_0xc1b5('0x4a')](function(_0x167657){logger[_0xc1b5('0x2d')](_0xc1b5('0x59'),_0x167657);throw _0x167657;});}return _0x150c93;})[_0xc1b5('0x28')](respondWithResult(_0x33ce47,0xc9))['catch'](handleError(_0x33ce47,null));};exports[_0xc1b5('0x5a')]=function(_0xa10eb9,_0x467db5){var _0x52e2e7={'raw':![],'where':{'id':_0xa10eb9[_0xc1b5('0x4c')]['id']}},_0xbe28c2={};_0xbe28c2[_0xc1b5('0x33')]=_[_0xc1b5('0x34')](db[_0xc1b5('0x32')][_0xc1b5('0x4d')]);_0x52e2e7[_0xc1b5('0x37')]=_[_0xc1b5('0x36')](_0xbe28c2[_0xc1b5('0x33')],qs[_0xc1b5('0x38')](_0xa10eb9[_0xc1b5('0x35')][_0xc1b5('0x38')]));_0x52e2e7[_0xc1b5('0x37')]=_0x52e2e7[_0xc1b5('0x37')][_0xc1b5('0x39')]?_0x52e2e7[_0xc1b5('0x37')]:_0xbe28c2[_0xc1b5('0x33')];if(_0xa10eb9[_0xc1b5('0x35')][_0xc1b5('0x4e')]){_0x52e2e7[_0xc1b5('0x49')]=[{'all':!![]}];}_0x52e2e7=_['merge']({},_0x52e2e7,_0xa10eb9[_0xc1b5('0x48')]);return db['Dashboard'][_0xc1b5('0x4f')](_0x52e2e7)['then'](handleEntityNotFound(_0x467db5,null))[_0xc1b5('0x28')](function(_0xd40866){if(_0xd40866){var _0x252f3c=_0xd40866['get']({'plain':!![]});_0x252f3c=qs[_0xc1b5('0x5b')](_0x252f3c,['id',_0xc1b5('0x5c'),'updatedAt']);_0xa10eb9[_0xc1b5('0x50')]=_[_0xc1b5('0x5b')](_0xa10eb9['body'],['id',_0xc1b5('0x5c'),_0xc1b5('0x5d')]);return db['Dashboard']['create'](_[_0xc1b5('0x47')](_0x252f3c,_0xa10eb9[_0xc1b5('0x50')]),{'include':_0xa10eb9[_0xc1b5('0x35')][_0xc1b5('0x4e')]?[{'all':!![]}]:undefined})[_0xc1b5('0x28')](function(_0x3fb049){var _0x3b176e=_0xa10eb9['user'][_0xc1b5('0x53')]({'plain':!![]});if(!_0x3b176e)throw new Error(_0xc1b5('0x5e'));if(_0x3b176e['role']===_0xc1b5('0x51')){var _0x2293e1=_0x3fb049[_0xc1b5('0x53')]({'plain':!![]});var _0x10ab78=_0xc1b5('0x54');return db['UserProfileSection'][_0xc1b5('0x4f')]({'where':{'name':_0x10ab78,'userProfileId':_0x3b176e[_0xc1b5('0x56')]},'raw':!![]})[_0xc1b5('0x28')](function(_0x3cd972){if(_0x3cd972&&_0x3cd972[_0xc1b5('0x57')]===0x0){return db[_0xc1b5('0x2a')][_0xc1b5('0x58')]({'name':_0x2293e1[_0xc1b5('0x2f')],'resourceId':_0x2293e1['id'],'type':_0x3cd972[_0xc1b5('0x2f')],'sectionId':_0x3cd972['id']},{})['then'](function(){return _0x3fb049;});}else{return _0x3fb049;}})['catch'](function(_0xc2f9b8){logger[_0xc1b5('0x2d')](_0xc1b5('0x59'),_0xc2f9b8);throw _0xc2f9b8;});}return _0x3fb049;});}})['then'](respondWithResult(_0x467db5,0xc9))['catch'](handleError(_0x467db5,null));};exports['update']=function(_0x4c5af7,_0x19be88){if(_0x4c5af7[_0xc1b5('0x50')]['id']){delete _0x4c5af7['body']['id'];}return db[_0xc1b5('0x32')]['find']({'where':{'id':_0x4c5af7[_0xc1b5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x19be88,null))['then'](saveUpdates(_0x4c5af7[_0xc1b5('0x50')],null))[_0xc1b5('0x28')](respondWithResult(_0x19be88,null))[_0xc1b5('0x4a')](handleError(_0x19be88,null));};exports[_0xc1b5('0x29')]=function(_0x316bcb,_0x26ec3a){return db[_0xc1b5('0x32')][_0xc1b5('0x4f')]({'where':{'id':_0x316bcb[_0xc1b5('0x4c')]['id']}})[_0xc1b5('0x28')](handleEntityNotFound(_0x26ec3a,null))[_0xc1b5('0x28')](removeEntity(_0x26ec3a,null))[_0xc1b5('0x4a')](handleError(_0x26ec3a,null));};function widgetAttributes(_0xeb1746){try{switch(_0xeb1746['type']){case _0xc1b5('0x5f'):return[{'name':_0xc1b5('0x60'),'value':_0xeb1746['attrUrl']||(_0xeb1746['attrs']&&_0xeb1746[_0xc1b5('0x61')][0x0]?_0xeb1746[_0xc1b5('0x61')][0x0][_0xc1b5('0x62')]:undefined)||_0xc1b5('0x63')}];case'custom':return[{'name':_0xc1b5('0x64'),'value':_0xeb1746['attrPath']||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x0]?_0xeb1746[_0xc1b5('0x61')][0x0][_0xc1b5('0x62')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0xeb1746['attrHourFormat']||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x0]?_0xeb1746[_0xc1b5('0x61')][0x0][_0xc1b5('0x62')]:undefined)||_0xc1b5('0x65')},{'name':_0xc1b5('0x66'),'value':_0xeb1746['attrTimezone']||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746['attrs'][0x1]?_0xeb1746['attrs'][0x1][_0xc1b5('0x62')]:undefined)||_0xc1b5('0x67')},{'name':_0xc1b5('0x68'),'value':_0xeb1746[_0xc1b5('0x68')]||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746['attrs'][0x2]?_0xeb1746['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xc1b5('0x69'),'value':_0xeb1746[_0xc1b5('0x69')]||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x0]?_0xeb1746['attrs'][0x0][_0xc1b5('0x62')]:undefined)||_0xc1b5('0x6a')},{'name':_0xc1b5('0x6b'),'value':_0xeb1746[_0xc1b5('0x6b')]||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x1]?_0xeb1746[_0xc1b5('0x61')][0x1][_0xc1b5('0x62')]:undefined)||[]},{'name':_0xc1b5('0x68'),'value':_0xeb1746['attrFontSize']||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x2]?_0xeb1746[_0xc1b5('0x61')][0x2][_0xc1b5('0x62')]:undefined)||0x14}];case _0xc1b5('0x6c'):case _0xc1b5('0x6d'):return[{'name':_0xc1b5('0x6e'),'value':_0xeb1746[_0xc1b5('0x6e')]||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x0]?_0xeb1746[_0xc1b5('0x61')][0x0][_0xc1b5('0x62')]:undefined)||_0xc1b5('0x6a')},{'name':_0xc1b5('0x6f'),'value':_0xeb1746['attrSerie2']||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x1]?_0xeb1746[_0xc1b5('0x61')][0x1][_0xc1b5('0x62')]:undefined)||null},{'name':_0xc1b5('0x70'),'value':_0xeb1746[_0xc1b5('0x70')]||(_0xeb1746['attrs']&&_0xeb1746['attrs'][0x2]?_0xeb1746['attrs'][0x2][_0xc1b5('0x62')]:undefined)||null},{'name':_0xc1b5('0x6b'),'value':_0xeb1746[_0xc1b5('0x6b')]||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x3]?_0xeb1746[_0xc1b5('0x61')][0x3][_0xc1b5('0x62')]:undefined)||[]}];case _0xc1b5('0x71'):return[{'name':'attrReport','type':_0xeb1746[_0xc1b5('0x72')]||(_0xeb1746['attrs']&&_0xeb1746['attrs'][0x0]?_0xeb1746[_0xc1b5('0x61')][0x0][_0xc1b5('0x43')]:undefined)||null,'value':_0xeb1746['attrReport']||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x0]?_0xeb1746[_0xc1b5('0x61')][0x0][_0xc1b5('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0xeb1746[_0xc1b5('0x73')]||(_0xeb1746[_0xc1b5('0x61')]&&_0xeb1746[_0xc1b5('0x61')][0x1]?_0xeb1746[_0xc1b5('0x61')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xfdca90){logger[_0xc1b5('0x2d')]('widgetAttributes:\x20%s',JSON[_0xc1b5('0x74')](_0xfdca90));return[];}}exports['addItem']=function(_0x16e7cb,_0x4074d9,_0x5aa29d){if(_0x16e7cb[_0xc1b5('0x50')]['id']){delete _0x16e7cb['body']['id'];}return db[_0xc1b5('0x32')][_0xc1b5('0x4f')]({'where':{'id':_0x16e7cb['params']['id']}})['then'](handleEntityNotFound(_0x4074d9,null))[_0xc1b5('0x28')](function(_0x353e04){if(_0x353e04){_0x16e7cb[_0xc1b5('0x50')][_0xc1b5('0x75')]=_0x353e04['id'];_0x16e7cb[_0xc1b5('0x50')][_0xc1b5('0x61')]=widgetAttributes(_0x16e7cb[_0xc1b5('0x50')]);return db[_0xc1b5('0x76')][_0xc1b5('0x58')](_0x16e7cb[_0xc1b5('0x50')]);}})[_0xc1b5('0x28')](respondWithResult(_0x4074d9,null))['catch'](handleError(_0x4074d9,null));};exports[_0xc1b5('0x77')]=function(_0x35fa88,_0x1f66a2,_0x3401e8){var _0x3e1e46={};var _0x5c56f0={};var _0x46ea87;var _0x22266a;return db[_0xc1b5('0x32')][_0xc1b5('0x78')]({'where':{'id':_0x35fa88[_0xc1b5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1f66a2,null))[_0xc1b5('0x28')](function(_0x29d16b){if(_0x29d16b){_0x46ea87=_0x29d16b;_0x5c56f0[_0xc1b5('0x33')]=_[_0xc1b5('0x34')](db['DashboardItem']['rawAttributes']);_0x5c56f0[_0xc1b5('0x35')]=_[_0xc1b5('0x34')](_0x35fa88[_0xc1b5('0x35')]);_0x5c56f0[_0xc1b5('0x40')]=_['intersection'](_0x5c56f0[_0xc1b5('0x33')],_0x5c56f0['query']);_0x3e1e46[_0xc1b5('0x37')]=_[_0xc1b5('0x36')](_0x5c56f0[_0xc1b5('0x33')],qs[_0xc1b5('0x38')](_0x35fa88['query']['fields']));_0x3e1e46[_0xc1b5('0x37')]=_0x3e1e46['attributes']['length']?_0x3e1e46[_0xc1b5('0x37')]:_0x5c56f0[_0xc1b5('0x33')];_0x3e1e46[_0xc1b5('0x3c')]=qs[_0xc1b5('0x3d')](_0x35fa88[_0xc1b5('0x35')]['sort']);_0x3e1e46['where']=qs[_0xc1b5('0x40')](_['pick'](_0x35fa88[_0xc1b5('0x35')],_0x5c56f0[_0xc1b5('0x40')]));if(_0x35fa88[_0xc1b5('0x35')][_0xc1b5('0x41')]){_0x3e1e46[_0xc1b5('0x3e')]=_[_0xc1b5('0x47')](_0x3e1e46['where'],{'$or':_[_0xc1b5('0x42')](_0x3e1e46['attributes'],function(_0x855940){var _0x119f21={};_0x119f21[_0x855940]={'$like':'%'+_0x35fa88[_0xc1b5('0x35')][_0xc1b5('0x41')]+'%'};return _0x119f21;})});}_0x3e1e46=_['merge']({},_0x3e1e46,_0x35fa88[_0xc1b5('0x48')]);return _0x46ea87[_0xc1b5('0x77')](_0x3e1e46);}})['then'](function(_0x562068){if(_0x562068){_0x22266a=_0x562068['length'];if(!_0x35fa88[_0xc1b5('0x35')][_0xc1b5('0x3a')]('nolimit')){_0x3e1e46['limit']=qs[_0xc1b5('0x23')](_0x35fa88[_0xc1b5('0x35')][_0xc1b5('0x23')]);_0x3e1e46[_0xc1b5('0x22')]=qs['offset'](_0x35fa88[_0xc1b5('0x35')][_0xc1b5('0x22')]);}return _0x46ea87[_0xc1b5('0x77')](_0x3e1e46);}})[_0xc1b5('0x28')](function(_0x442af5){if(_0x442af5){return _0x442af5?{'count':_0x22266a,'rows':_0x442af5}:null;}})[_0xc1b5('0x28')](respondWithResult(_0x1f66a2,null))[_0xc1b5('0x4a')](handleError(_0x1f66a2,null));}; \ No newline at end of file +var _0x89d9=['./dashboard.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','index','Dashboard','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','options','includeAll','include','findAll','rows','show','params','catch','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','DashboardItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x89d9,0x15c));var _0x989d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x89d9[_0x27af45];return _0x18df21;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x989d('0x0'));var rimraf=require(_0x989d('0x1'));var zipdir=require(_0x989d('0x2'));var jsonpatch=require(_0x989d('0x3'));var rp=require(_0x989d('0x4'));var moment=require(_0x989d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x989d('0x6'));var util=require(_0x989d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x989d('0x8'));var ejs=require(_0x989d('0x9'));var fs=require('fs');var _=require(_0x989d('0xa'));var squel=require(_0x989d('0xb'));var crypto=require(_0x989d('0xc'));var jsforce=require(_0x989d('0xd'));var deskjs=require(_0x989d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x989d('0xf'));var Papa=require(_0x989d('0x10'));var Redis=require(_0x989d('0x11'));var authService=require(_0x989d('0x12'));var qs=require(_0x989d('0x13'));var hardwareService=require(_0x989d('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x989d('0x15'));var db=require(_0x989d('0x16'))['db'];config[_0x989d('0x17')]=_[_0x989d('0x18')](config[_0x989d('0x17')],{'host':_0x989d('0x19'),'port':0x18eb});var socket=require(_0x989d('0x1a'))(new Redis(config[_0x989d('0x17')]));require(_0x989d('0x1b'))[_0x989d('0x1c')](socket);function respondWithStatusCode(_0x6b2bf,_0x323f52){_0x323f52=_0x323f52||0xcc;return function(_0x1dbd76){if(_0x1dbd76){return _0x6b2bf['sendStatus'](_0x323f52);}return _0x6b2bf[_0x989d('0x1d')](_0x323f52)['end']();};}function respondWithResult(_0x2f0409,_0x368930){_0x368930=_0x368930||0xc8;return function(_0xc82c94){if(_0xc82c94){return _0x2f0409[_0x989d('0x1d')](_0x368930)[_0x989d('0x1e')](_0xc82c94);}};}function respondWithFilteredResult(_0x2b8756,_0x41b245){return function(_0x6f3f53){if(_0x6f3f53){var _0x37d99c=_0x6f3f53[_0x989d('0x1f')],_0x668d1c=_0x41b245[_0x989d('0x20')],_0x3bfdb3=_0x41b245[_0x989d('0x20')]+_0x41b245[_0x989d('0x21')],_0x430a84;if(_0x3bfdb3>=_0x37d99c){_0x3bfdb3=_0x37d99c;_0x430a84=0xc8;}else{_0x430a84=0xce;}_0x2b8756[_0x989d('0x1d')](_0x430a84);return _0x2b8756[_0x989d('0x22')](_0x989d('0x23'),_0x668d1c+'-'+_0x3bfdb3+'/'+_0x37d99c)['json'](_0x6f3f53);}return null;};}function patchUpdates(_0x22b382){return function(_0x1a30bb){try{jsonpatch[_0x989d('0x24')](_0x1a30bb,_0x22b382,!![]);}catch(_0x779a83){return BPromise[_0x989d('0x25')](_0x779a83);}return _0x1a30bb[_0x989d('0x26')]();};}function saveUpdates(_0x54476d,_0x2077d9){return function(_0x418271){if(_0x418271){return _0x418271['update'](_0x54476d)[_0x989d('0x27')](function(_0x5eb906){return _0x5eb906;});}return null;};}function removeEntity(_0x335ea7,_0x46a8f7){return function(_0x40405f){if(_0x40405f){return _0x40405f[_0x989d('0x28')]()[_0x989d('0x27')](function(){var _0x5dae05=_0x40405f[_0x989d('0x29')]({'plain':!![]});var _0x8fca20='CustomDashboards';return db[_0x989d('0x2a')]['destroy']({'where':{'type':_0x8fca20,'resourceId':_0x5dae05['id']}})[_0x989d('0x27')](function(){return _0x40405f;});})[_0x989d('0x27')](function(){_0x335ea7[_0x989d('0x1d')](0xcc)[_0x989d('0x2b')]();});}};}function handleEntityNotFound(_0x939295,_0x3816de){return function(_0x46e05c){if(!_0x46e05c){_0x939295[_0x989d('0x2c')](0x194);}return _0x46e05c;};}function handleError(_0x1dec81,_0x4cf836){_0x4cf836=_0x4cf836||0x1f4;return function(_0x53a83b){logger[_0x989d('0x2d')](_0x53a83b[_0x989d('0x2e')]);if(_0x53a83b[_0x989d('0x2f')]){delete _0x53a83b[_0x989d('0x2f')];}_0x1dec81[_0x989d('0x1d')](_0x4cf836)['send'](_0x53a83b);};}exports[_0x989d('0x30')]=function(_0x47a64c,_0x508d01){var _0x4a24e0={},_0x53f41d={},_0x4e6621={'count':0x0,'rows':[]};var _0x44351b=db[_0x989d('0x31')][_0x989d('0x32')];_0x53f41d[_0x989d('0x33')]=_[_0x989d('0x34')](_0x44351b);_0x53f41d[_0x989d('0x35')]=_['keys'](_0x47a64c['query']);_0x53f41d[_0x989d('0x36')]=_[_0x989d('0x37')](_0x53f41d[_0x989d('0x33')],_0x53f41d[_0x989d('0x35')]);_0x4a24e0[_0x989d('0x38')]=_[_0x989d('0x37')](_0x53f41d['model'],qs[_0x989d('0x39')](_0x47a64c[_0x989d('0x35')][_0x989d('0x39')]));_0x4a24e0['attributes']=_0x4a24e0[_0x989d('0x38')][_0x989d('0x3a')]?_0x4a24e0[_0x989d('0x38')]:_0x53f41d[_0x989d('0x33')];if(!_0x47a64c['query'][_0x989d('0x3b')](_0x989d('0x3c'))){_0x4a24e0[_0x989d('0x21')]=qs[_0x989d('0x21')](_0x47a64c[_0x989d('0x35')][_0x989d('0x21')]);_0x4a24e0[_0x989d('0x20')]=qs[_0x989d('0x20')](_0x47a64c[_0x989d('0x35')][_0x989d('0x20')]);}_0x4a24e0[_0x989d('0x3d')]=qs[_0x989d('0x3e')](_0x47a64c[_0x989d('0x35')][_0x989d('0x3e')]);_0x4a24e0[_0x989d('0x3f')]=qs[_0x989d('0x36')](_[_0x989d('0x40')](_0x47a64c['query'],_0x53f41d[_0x989d('0x36')]));if(_0x47a64c[_0x989d('0x35')][_0x989d('0x41')]){_0x4a24e0['where']=_[_0x989d('0x42')](_0x4a24e0[_0x989d('0x3f')],{'$or':_[_0x989d('0x43')](_0x44351b,function(_0x4897a7){if(_0x4897a7['type'][_0x989d('0x44')]!=='VIRTUAL'){var _0x11900d={};_0x11900d[_0x4897a7['field']]={'$like':'%'+_0x47a64c[_0x989d('0x35')][_0x989d('0x41')]+'%'};return _0x11900d;}})});}_0x4a24e0=_[_0x989d('0x42')]({},_0x4a24e0,_0x47a64c[_0x989d('0x45')]);var _0x275c00={'where':_0x4a24e0[_0x989d('0x3f')]};return db[_0x989d('0x31')][_0x989d('0x1f')](_0x275c00)[_0x989d('0x27')](function(_0xad1fa3){_0x4e6621[_0x989d('0x1f')]=_0xad1fa3;if(_0x47a64c[_0x989d('0x35')][_0x989d('0x46')]){_0x4a24e0[_0x989d('0x47')]=[{'all':!![]}];}return db[_0x989d('0x31')][_0x989d('0x48')](_0x4a24e0);})[_0x989d('0x27')](function(_0x24bbe2){_0x4e6621[_0x989d('0x49')]=_0x24bbe2;return _0x4e6621;})[_0x989d('0x27')](respondWithFilteredResult(_0x508d01,_0x4a24e0))['catch'](handleError(_0x508d01,null));};exports[_0x989d('0x4a')]=function(_0x41eb83,_0xfde6b5){var _0x1960a6={'raw':![],'where':{'id':_0x41eb83[_0x989d('0x4b')]['id']}},_0x47a3ac={};_0x47a3ac[_0x989d('0x33')]=_[_0x989d('0x34')](db[_0x989d('0x31')][_0x989d('0x32')]);_0x47a3ac[_0x989d('0x35')]=_['keys'](_0x41eb83[_0x989d('0x35')]);_0x47a3ac[_0x989d('0x36')]=_[_0x989d('0x37')](_0x47a3ac[_0x989d('0x33')],_0x47a3ac[_0x989d('0x35')]);_0x1960a6['attributes']=_[_0x989d('0x37')](_0x47a3ac[_0x989d('0x33')],qs[_0x989d('0x39')](_0x41eb83['query'][_0x989d('0x39')]));_0x1960a6['attributes']=_0x1960a6[_0x989d('0x38')][_0x989d('0x3a')]?_0x1960a6[_0x989d('0x38')]:_0x47a3ac[_0x989d('0x33')];if(_0x41eb83[_0x989d('0x35')]['includeAll']){_0x1960a6['include']=[{'all':!![]}];}_0x1960a6=_[_0x989d('0x42')]({},_0x1960a6,_0x41eb83[_0x989d('0x45')]);return db['Dashboard']['find'](_0x1960a6)[_0x989d('0x27')](handleEntityNotFound(_0xfde6b5,null))[_0x989d('0x27')](respondWithResult(_0xfde6b5,null))[_0x989d('0x4c')](handleError(_0xfde6b5,null));};exports[_0x989d('0x4d')]=function(_0x56512f,_0x279226){return db[_0x989d('0x31')]['create'](_0x56512f[_0x989d('0x4e')],{})['then'](function(_0x1b92d0){var _0x3229b1=_0x56512f[_0x989d('0x4f')][_0x989d('0x29')]({'plain':!![]});if(!_0x3229b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3229b1[_0x989d('0x50')]===_0x989d('0x4f')){var _0x329202=_0x1b92d0['get']({'plain':!![]});var _0x5ae619='CustomDashboards';return db[_0x989d('0x51')][_0x989d('0x52')]({'where':{'name':_0x5ae619,'userProfileId':_0x3229b1[_0x989d('0x53')]},'raw':!![]})[_0x989d('0x27')](function(_0x2a8fc5){if(_0x2a8fc5&&_0x2a8fc5[_0x989d('0x54')]===0x0){return db[_0x989d('0x2a')][_0x989d('0x4d')]({'name':_0x329202[_0x989d('0x2f')],'resourceId':_0x329202['id'],'type':_0x2a8fc5[_0x989d('0x2f')],'sectionId':_0x2a8fc5['id']},{})[_0x989d('0x27')](function(){return _0x1b92d0;});}else{return _0x1b92d0;}})[_0x989d('0x4c')](function(_0x20294f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20294f);throw _0x20294f;});}return _0x1b92d0;})['then'](respondWithResult(_0x279226,0xc9))[_0x989d('0x4c')](handleError(_0x279226,null));};exports['clone']=function(_0x563132,_0x21e8df){var _0x2bc41d={'raw':![],'where':{'id':_0x563132[_0x989d('0x4b')]['id']}},_0x1d4c56={};_0x1d4c56[_0x989d('0x33')]=_[_0x989d('0x34')](db['Dashboard']['rawAttributes']);_0x2bc41d[_0x989d('0x38')]=_[_0x989d('0x37')](_0x1d4c56['model'],qs['fields'](_0x563132[_0x989d('0x35')][_0x989d('0x39')]));_0x2bc41d[_0x989d('0x38')]=_0x2bc41d[_0x989d('0x38')][_0x989d('0x3a')]?_0x2bc41d[_0x989d('0x38')]:_0x1d4c56[_0x989d('0x33')];if(_0x563132[_0x989d('0x35')]['includeAll']){_0x2bc41d[_0x989d('0x47')]=[{'all':!![]}];}_0x2bc41d=_['merge']({},_0x2bc41d,_0x563132['options']);return db[_0x989d('0x31')][_0x989d('0x52')](_0x2bc41d)['then'](handleEntityNotFound(_0x21e8df,null))['then'](function(_0xc0aa60){if(_0xc0aa60){var _0x4891c3=_0xc0aa60[_0x989d('0x29')]({'plain':!![]});_0x4891c3=qs[_0x989d('0x55')](_0x4891c3,['id','createdAt',_0x989d('0x56')]);_0x563132['body']=_['omit'](_0x563132['body'],['id',_0x989d('0x57'),'updatedAt']);return db[_0x989d('0x31')][_0x989d('0x4d')](_[_0x989d('0x42')](_0x4891c3,_0x563132[_0x989d('0x4e')]),{'include':_0x563132['query'][_0x989d('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0xc516cf){var _0x2f33a9=_0x563132[_0x989d('0x4f')][_0x989d('0x29')]({'plain':!![]});if(!_0x2f33a9)throw new Error(_0x989d('0x58'));if(_0x2f33a9[_0x989d('0x50')]===_0x989d('0x4f')){var _0x4f926e=_0xc516cf['get']({'plain':!![]});var _0x3ff7c5=_0x989d('0x59');return db[_0x989d('0x51')]['find']({'where':{'name':_0x3ff7c5,'userProfileId':_0x2f33a9['userProfileId']},'raw':!![]})[_0x989d('0x27')](function(_0x42219a){if(_0x42219a&&_0x42219a[_0x989d('0x54')]===0x0){return db[_0x989d('0x2a')][_0x989d('0x4d')]({'name':_0x4f926e['name'],'resourceId':_0x4f926e['id'],'type':_0x42219a[_0x989d('0x2f')],'sectionId':_0x42219a['id']},{})['then'](function(){return _0xc516cf;});}else{return _0xc516cf;}})[_0x989d('0x4c')](function(_0x3fb25c){logger['error'](_0x989d('0x5a'),_0x3fb25c);throw _0x3fb25c;});}return _0xc516cf;});}})[_0x989d('0x27')](respondWithResult(_0x21e8df,0xc9))[_0x989d('0x4c')](handleError(_0x21e8df,null));};exports[_0x989d('0x5b')]=function(_0x10f605,_0x4b80fb){if(_0x10f605['body']['id']){delete _0x10f605['body']['id'];}return db[_0x989d('0x31')][_0x989d('0x52')]({'where':{'id':_0x10f605[_0x989d('0x4b')]['id']}})[_0x989d('0x27')](handleEntityNotFound(_0x4b80fb,null))[_0x989d('0x27')](saveUpdates(_0x10f605[_0x989d('0x4e')],null))['then'](respondWithResult(_0x4b80fb,null))[_0x989d('0x4c')](handleError(_0x4b80fb,null));};exports[_0x989d('0x28')]=function(_0xcfabc7,_0x2db3bb){return db[_0x989d('0x31')]['find']({'where':{'id':_0xcfabc7[_0x989d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2db3bb,null))['then'](removeEntity(_0x2db3bb,null))['catch'](handleError(_0x2db3bb,null));};function widgetAttributes(_0x406b37){try{switch(_0x406b37[_0x989d('0x5c')]){case _0x989d('0x5d'):return[{'name':_0x989d('0x5e'),'value':_0x406b37[_0x989d('0x5e')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x0]?_0x406b37[_0x989d('0x5f')][0x0][_0x989d('0x60')]:undefined)||_0x989d('0x61')}];case _0x989d('0x62'):return[{'name':_0x989d('0x63'),'value':_0x406b37['attrPath']||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x0]?_0x406b37[_0x989d('0x5f')][0x0][_0x989d('0x60')]:undefined)||''}];case _0x989d('0x64'):return[{'name':_0x989d('0x65'),'value':_0x406b37[_0x989d('0x65')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x0]?_0x406b37[_0x989d('0x5f')][0x0][_0x989d('0x60')]:undefined)||_0x989d('0x66')},{'name':'attrTimezone','value':_0x406b37[_0x989d('0x67')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x1]?_0x406b37['attrs'][0x1][_0x989d('0x60')]:undefined)||_0x989d('0x68')},{'name':_0x989d('0x69'),'value':_0x406b37[_0x989d('0x69')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x2]?_0x406b37['attrs'][0x2][_0x989d('0x60')]:undefined)||0xc}];case _0x989d('0x6a'):return[{'name':'attrMetric','value':_0x406b37[_0x989d('0x6b')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37['attrs'][0x0]?_0x406b37[_0x989d('0x5f')][0x0][_0x989d('0x60')]:undefined)||_0x989d('0x6c')},{'name':'attrVoiceQueues','value':_0x406b37[_0x989d('0x6d')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x1]?_0x406b37['attrs'][0x1][_0x989d('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x406b37[_0x989d('0x69')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x2]?_0x406b37['attrs'][0x2][_0x989d('0x60')]:undefined)||0x14}];case _0x989d('0x6e'):case _0x989d('0x6f'):return[{'name':_0x989d('0x70'),'value':_0x406b37[_0x989d('0x70')]||(_0x406b37['attrs']&&_0x406b37['attrs'][0x0]?_0x406b37[_0x989d('0x5f')][0x0][_0x989d('0x60')]:undefined)||_0x989d('0x6c')},{'name':_0x989d('0x71'),'value':_0x406b37[_0x989d('0x71')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x1]?_0x406b37[_0x989d('0x5f')][0x1][_0x989d('0x60')]:undefined)||null},{'name':_0x989d('0x72'),'value':_0x406b37[_0x989d('0x72')]||(_0x406b37['attrs']&&_0x406b37[_0x989d('0x5f')][0x2]?_0x406b37[_0x989d('0x5f')][0x2][_0x989d('0x60')]:undefined)||null},{'name':_0x989d('0x6d'),'value':_0x406b37[_0x989d('0x6d')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37['attrs'][0x3]?_0x406b37['attrs'][0x3][_0x989d('0x60')]:undefined)||[]}];case _0x989d('0x73'):return[{'name':_0x989d('0x74'),'type':_0x406b37[_0x989d('0x75')]||(_0x406b37['attrs']&&_0x406b37[_0x989d('0x5f')][0x0]?_0x406b37[_0x989d('0x5f')][0x0][_0x989d('0x5c')]:undefined)||null,'value':_0x406b37[_0x989d('0x74')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37['attrs'][0x0]?_0x406b37[_0x989d('0x5f')][0x0][_0x989d('0x60')]:undefined)||null},{'name':_0x989d('0x76'),'value':_0x406b37[_0x989d('0x76')]||(_0x406b37[_0x989d('0x5f')]&&_0x406b37[_0x989d('0x5f')][0x1]?_0x406b37[_0x989d('0x5f')][0x1][_0x989d('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x2027d0){logger[_0x989d('0x2d')](_0x989d('0x77'),JSON['stringify'](_0x2027d0));return[];}}exports[_0x989d('0x78')]=function(_0x4c7123,_0x10ea20,_0x449d46){if(_0x4c7123[_0x989d('0x4e')]['id']){delete _0x4c7123['body']['id'];}return db[_0x989d('0x31')][_0x989d('0x52')]({'where':{'id':_0x4c7123[_0x989d('0x4b')]['id']}})[_0x989d('0x27')](handleEntityNotFound(_0x10ea20,null))[_0x989d('0x27')](function(_0x5d7569){if(_0x5d7569){_0x4c7123['body'][_0x989d('0x79')]=_0x5d7569['id'];_0x4c7123['body'][_0x989d('0x5f')]=widgetAttributes(_0x4c7123[_0x989d('0x4e')]);return db['DashboardItem'][_0x989d('0x4d')](_0x4c7123['body']);}})[_0x989d('0x27')](respondWithResult(_0x10ea20,null))[_0x989d('0x4c')](handleError(_0x10ea20,null));};exports[_0x989d('0x7a')]=function(_0x46063e,_0x1a04b3,_0x5b6edf){var _0x1d4052={};var _0x2ae004={};var _0x52f820;var _0x2c89c5;return db['Dashboard'][_0x989d('0x7b')]({'where':{'id':_0x46063e[_0x989d('0x4b')]['id']}})[_0x989d('0x27')](handleEntityNotFound(_0x1a04b3,null))[_0x989d('0x27')](function(_0x4fb9e8){if(_0x4fb9e8){_0x52f820=_0x4fb9e8;_0x2ae004[_0x989d('0x33')]=_[_0x989d('0x34')](db[_0x989d('0x7c')][_0x989d('0x32')]);_0x2ae004[_0x989d('0x35')]=_[_0x989d('0x34')](_0x46063e['query']);_0x2ae004[_0x989d('0x36')]=_['intersection'](_0x2ae004[_0x989d('0x33')],_0x2ae004[_0x989d('0x35')]);_0x1d4052['attributes']=_[_0x989d('0x37')](_0x2ae004['model'],qs[_0x989d('0x39')](_0x46063e[_0x989d('0x35')][_0x989d('0x39')]));_0x1d4052[_0x989d('0x38')]=_0x1d4052[_0x989d('0x38')][_0x989d('0x3a')]?_0x1d4052[_0x989d('0x38')]:_0x2ae004[_0x989d('0x33')];_0x1d4052[_0x989d('0x3d')]=qs[_0x989d('0x3e')](_0x46063e['query'][_0x989d('0x3e')]);_0x1d4052[_0x989d('0x3f')]=qs[_0x989d('0x36')](_[_0x989d('0x40')](_0x46063e[_0x989d('0x35')],_0x2ae004[_0x989d('0x36')]));if(_0x46063e[_0x989d('0x35')][_0x989d('0x41')]){_0x1d4052[_0x989d('0x3f')]=_[_0x989d('0x42')](_0x1d4052[_0x989d('0x3f')],{'$or':_[_0x989d('0x43')](_0x1d4052[_0x989d('0x38')],function(_0x3c7da3){var _0x52dce2={};_0x52dce2[_0x3c7da3]={'$like':'%'+_0x46063e['query'][_0x989d('0x41')]+'%'};return _0x52dce2;})});}_0x1d4052=_[_0x989d('0x42')]({},_0x1d4052,_0x46063e['options']);return _0x52f820['getItems'](_0x1d4052);}})[_0x989d('0x27')](function(_0x5eeaef){if(_0x5eeaef){_0x2c89c5=_0x5eeaef[_0x989d('0x3a')];if(!_0x46063e[_0x989d('0x35')][_0x989d('0x3b')](_0x989d('0x3c'))){_0x1d4052['limit']=qs[_0x989d('0x21')](_0x46063e[_0x989d('0x35')][_0x989d('0x21')]);_0x1d4052['offset']=qs[_0x989d('0x20')](_0x46063e[_0x989d('0x35')][_0x989d('0x20')]);}return _0x52f820['getItems'](_0x1d4052);}})[_0x989d('0x27')](function(_0x2e2556){if(_0x2e2556){return _0x2e2556?{'count':_0x2c89c5,'rows':_0x2e2556}:null;}})[_0x989d('0x27')](respondWithResult(_0x1a04b3,null))[_0x989d('0x4c')](handleError(_0x1a04b3,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index d59a707..2db1a54 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 _0x40a4=['save','update','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x17f2b7,_0x32a8b0){var _0x4164f6=function(_0x5608ad){while(--_0x5608ad){_0x17f2b7['push'](_0x17f2b7['shift']());}};_0x4164f6(++_0x32a8b0);}(_0x40a4,0x12c));var _0x440a=function(_0x3d489a,_0x5ac6ce){_0x3d489a=_0x3d489a-0x0;var _0x5172c0=_0x40a4[_0x3d489a];return _0x5172c0;};'use strict';var EventEmitter=require(_0x440a('0x0'));var Dashboard=require(_0x440a('0x1'))['db'][_0x440a('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x440a('0x3')](0x0);var events={'afterCreate':_0x440a('0x4'),'afterUpdate':_0x440a('0x5'),'afterDestroy':'remove'};function emitEvent(_0xea75dd){return function(_0x210095,_0x497073,_0x428ded){DashboardEvents['emit'](_0xea75dd+':'+_0x210095['id'],_0x210095);DashboardEvents['emit'](_0xea75dd,_0x210095);_0x428ded(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x440a('0x6')](e,emitEvent(event));}}module[_0x440a('0x7')]=DashboardEvents; \ No newline at end of file +var _0xa8be=['remove','emit','exports','events','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0x4f1b36,_0x511442){var _0x4d9eb1=function(_0x261304){while(--_0x261304){_0x4f1b36['push'](_0x4f1b36['shift']());}};_0x4d9eb1(++_0x511442);}(_0xa8be,0x9b));var _0xea8b=function(_0x13c74f,_0x797db6){_0x13c74f=_0x13c74f-0x0;var _0x19b19c=_0xa8be[_0x13c74f];return _0x19b19c;};'use strict';var EventEmitter=require(_0xea8b('0x0'));var Dashboard=require(_0xea8b('0x1'))['db'][_0xea8b('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xea8b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea8b('0x4'),'afterDestroy':_0xea8b('0x5')};function emitEvent(_0x463f9f){return function(_0x3fba27,_0x1da649,_0x205514){DashboardEvents[_0xea8b('0x6')](_0x463f9f+':'+_0x3fba27['id'],_0x3fba27);DashboardEvents[_0xea8b('0x6')](_0x463f9f,_0x3fba27);_0x205514(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xea8b('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 94997a6..6e9c0f7 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 _0x09f4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards'];(function(_0x34efa6,_0x343fe2){var _0x469490=function(_0xc1d725){while(--_0xc1d725){_0x34efa6['push'](_0x34efa6['shift']());}};_0x469490(++_0x343fe2);}(_0x09f4,0xe4));var _0x409f=function(_0xc4a89a,_0x322f6a){_0xc4a89a=_0xc4a89a-0x0;var _0x13f7bc=_0x09f4[_0xc4a89a];return _0x13f7bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x409f('0x0'))(_0x409f('0x1'));var moment=require(_0x409f('0x2'));var BPromise=require(_0x409f('0x3'));var rp=require(_0x409f('0x4'));var fs=require('fs');var path=require(_0x409f('0x5'));var rimraf=require(_0x409f('0x6'));var config=require(_0x409f('0x7'));var attributes=require(_0x409f('0x8'));module[_0x409f('0x9')]=function(_0x2ca9ed,_0x4a17e8){return _0x2ca9ed['define'](_0x409f('0xa'),attributes,{'tableName':_0x409f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b27=['rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x47eb27,_0x22d4fc){var _0xe8cae8=function(_0x2fd189){while(--_0x2fd189){_0x47eb27['push'](_0x47eb27['shift']());}};_0xe8cae8(++_0x22d4fc);}(_0x7b27,0x186));var _0x77b2=function(_0x492939,_0x4f69d6){_0x492939=_0x492939-0x0;var _0x2d2a83=_0x7b27[_0x492939];return _0x2d2a83;};'use strict';var _=require(_0x77b2('0x0'));var util=require('util');var logger=require(_0x77b2('0x1'))(_0x77b2('0x2'));var moment=require(_0x77b2('0x3'));var BPromise=require(_0x77b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x77b2('0x5'));var rimraf=require(_0x77b2('0x6'));var config=require('../../config/environment');var attributes=require(_0x77b2('0x7'));module[_0x77b2('0x8')]=function(_0x243b61,_0x569bce){return _0x243b61[_0x77b2('0x9')](_0x77b2('0xa'),attributes,{'tableName':_0x77b2('0xb'),'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 6a44512..271454e 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 _0x4ada=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0x4ada,0xa2));var _0xa4ad=function(_0x1f8dc1,_0x8250bb){_0x1f8dc1=_0x1f8dc1-0x0;var _0x461773=_0x4ada[_0x1f8dc1];return _0x461773;};'use strict';var _=require(_0xa4ad('0x0'));var util=require(_0xa4ad('0x1'));var moment=require(_0xa4ad('0x2'));var BPromise=require(_0xa4ad('0x3'));var rs=require(_0xa4ad('0x4'));var fs=require('fs');var Redis=require(_0xa4ad('0x5'));var db=require(_0xa4ad('0x6'))['db'];var utils=require(_0xa4ad('0x7'));var logger=require(_0xa4ad('0x8'))(_0xa4ad('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa4ad('0xa')][_0xa4ad('0xb')]({'port':0x232a});config[_0xa4ad('0xc')]=_['defaults'](config[_0xa4ad('0xc')],{'host':_0xa4ad('0xd'),'port':0x18eb});var socket=require(_0xa4ad('0xe'))(new Redis(config[_0xa4ad('0xc')]));require(_0xa4ad('0xf'))[_0xa4ad('0x10')](socket);function respondWithRpcPromise(_0x2ffa5f,_0x5eb091,_0x561eae){return new BPromise(function(_0x4d4ce6,_0x43f08c){return client[_0xa4ad('0x11')](_0x2ffa5f,_0x561eae)['then'](function(_0x45d854){logger[_0xa4ad('0x12')](_0xa4ad('0x13'),_0x5eb091,_0xa4ad('0x14'));logger[_0xa4ad('0x15')](_0xa4ad('0x16'),_0x5eb091,_0xa4ad('0x14'),JSON['stringify'](_0x45d854));if(_0x45d854[_0xa4ad('0x17')]){if(_0x45d854['error'][_0xa4ad('0x18')]===0x1f4){logger[_0xa4ad('0x17')](_0xa4ad('0x13'),_0x5eb091,_0x45d854[_0xa4ad('0x17')][_0xa4ad('0x19')]);return _0x43f08c(_0x45d854[_0xa4ad('0x17')][_0xa4ad('0x19')]);}logger['error'](_0xa4ad('0x13'),_0x5eb091,_0x45d854['error'][_0xa4ad('0x19')]);return _0x4d4ce6(_0x45d854[_0xa4ad('0x17')][_0xa4ad('0x19')]);}else{logger[_0xa4ad('0x12')](_0xa4ad('0x13'),_0x5eb091,_0xa4ad('0x14'));_0x4d4ce6(_0x45d854[_0xa4ad('0x1a')]['message']);}})[_0xa4ad('0x1b')](function(_0x5a5652){logger[_0xa4ad('0x17')](_0xa4ad('0x13'),_0x5eb091,_0x5a5652);_0x43f08c(_0x5a5652);});});} \ No newline at end of file +var _0x5882=['./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x12939d,_0x24971d){var _0x38f9ab=function(_0x23a8d5){while(--_0x23a8d5){_0x12939d['push'](_0x12939d['shift']());}};_0x38f9ab(++_0x24971d);}(_0x5882,0xff));var _0x2588=function(_0x5a2a99,_0x3617d9){_0x5a2a99=_0x5a2a99-0x0;var _0xe8d732=_0x5882[_0x5a2a99];return _0xe8d732;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2588('0x0'));var BPromise=require(_0x2588('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2588('0x2'));var db=require(_0x2588('0x3'))['db'];var utils=require(_0x2588('0x4'));var logger=require(_0x2588('0x5'))(_0x2588('0x6'));var config=require(_0x2588('0x7'));var jayson=require(_0x2588('0x8'));var client=jayson[_0x2588('0x9')][_0x2588('0xa')]({'port':0x232a});config['redis']=_[_0x2588('0xb')](config[_0x2588('0xc')],{'host':_0x2588('0xd'),'port':0x18eb});var socket=require(_0x2588('0xe'))(new Redis(config['redis']));require(_0x2588('0xf'))[_0x2588('0x10')](socket);function respondWithRpcPromise(_0x1a0fac,_0x1eaf8d,_0x5c0215){return new BPromise(function(_0x52ab23,_0x55ca0e){return client[_0x2588('0x11')](_0x1a0fac,_0x5c0215)[_0x2588('0x12')](function(_0x103a5a){logger[_0x2588('0x13')](_0x2588('0x14'),_0x1eaf8d,_0x2588('0x15'));logger[_0x2588('0x16')](_0x2588('0x17'),_0x1eaf8d,_0x2588('0x15'),JSON['stringify'](_0x103a5a));if(_0x103a5a[_0x2588('0x18')]){if(_0x103a5a['error']['code']===0x1f4){logger[_0x2588('0x18')]('Dashboard,\x20%s,\x20%s',_0x1eaf8d,_0x103a5a[_0x2588('0x18')][_0x2588('0x19')]);return _0x55ca0e(_0x103a5a[_0x2588('0x18')][_0x2588('0x19')]);}logger[_0x2588('0x18')]('Dashboard,\x20%s,\x20%s',_0x1eaf8d,_0x103a5a['error'][_0x2588('0x19')]);return _0x52ab23(_0x103a5a['error'][_0x2588('0x19')]);}else{logger[_0x2588('0x13')]('Dashboard,\x20%s,\x20%s',_0x1eaf8d,_0x2588('0x15'));_0x52ab23(_0x103a5a[_0x2588('0x1a')]['message']);}})['catch'](function(_0x36bc33){logger['error'](_0x2588('0x14'),_0x1eaf8d,_0x36bc33);_0x55ca0e(_0x36bc33);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 4d1ee2b..a634a03 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 _0xf069=['length','dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x3a8c32,_0x4b025b){var _0x2119f0=function(_0x2d5a43){while(--_0x2d5a43){_0x3a8c32['push'](_0x3a8c32['shift']());}};_0x2119f0(++_0x4b025b);}(_0xf069,0x16a));var _0x9f06=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf069[_0x14add3];return _0x4a174f;};'use strict';var DashboardEvents=require(_0x9f06('0x0'));var events=[_0x9f06('0x1'),_0x9f06('0x2'),_0x9f06('0x3')];function createListener(_0x39c9ac,_0x1a67b0){return function(_0xb06d9b){_0x1a67b0[_0x9f06('0x4')](_0x39c9ac,_0xb06d9b);};}function removeListener(_0xc07bba,_0x4c23ce){return function(){DashboardEvents[_0x9f06('0x5')](_0xc07bba,_0x4c23ce);};}exports[_0x9f06('0x6')]=function(_0x3a8d95){for(var _0x281528=0x0,_0x3f8ffc=events[_0x9f06('0x7')];_0x281528<_0x3f8ffc;_0x281528++){var _0xefa553=events[_0x281528];var _0x1f1175=createListener(_0x9f06('0x8')+_0xefa553,_0x3a8d95);DashboardEvents['on'](_0xefa553,_0x1f1175);}}; \ No newline at end of file +var _0xf221=['update','register','remove'];(function(_0x35d691,_0x1b4479){var _0x4aa2e6=function(_0x122446){while(--_0x122446){_0x35d691['push'](_0x35d691['shift']());}};_0x4aa2e6(++_0x1b4479);}(_0xf221,0x1a6));var _0x1f22=function(_0x51f8f1,_0x2e8275){_0x51f8f1=_0x51f8f1-0x0;var _0x478101=_0xf221[_0x51f8f1];return _0x478101;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x1f22('0x0'),_0x1f22('0x1')];function createListener(_0x12aa1e,_0x73cb92){return function(_0x2e4c4a){_0x73cb92['emit'](_0x12aa1e,_0x2e4c4a);};}function removeListener(_0x5073d3,_0x21041f){return function(){DashboardEvents['removeListener'](_0x5073d3,_0x21041f);};}exports[_0x1f22('0x2')]=function(_0x45f3fc){for(var _0x34b8b6=0x0,_0xa5829b=events['length'];_0x34b8b6<_0xa5829b;_0x34b8b6++){var _0x8aaf0=events[_0x34b8b6];var _0x151ae4=createListener('dashboard:'+_0x8aaf0,_0x45f3fc);DashboardEvents['on'](_0x8aaf0,_0x151ae4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 89a4cde..ce7cb16 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 _0x96dd=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','post','/:id/clone','clone','addItem','put','update','delete','destroy','util'];(function(_0x392dbc,_0x4d31cf){var _0x119302=function(_0x250580){while(--_0x250580){_0x392dbc['push'](_0x392dbc['shift']());}};_0x119302(++_0x4d31cf);}(_0x96dd,0x1b7));var _0xd96d=function(_0x261033,_0x32bf08){_0x261033=_0x261033-0x0;var _0xab82f9=_0x96dd[_0x261033];return _0xab82f9;};'use strict';var multer=require('multer');var util=require(_0xd96d('0x0'));var path=require(_0xd96d('0x1'));var timeout=require(_0xd96d('0x2'));var express=require(_0xd96d('0x3'));var router=express[_0xd96d('0x4')]();var auth=require(_0xd96d('0x5'));var interaction=require(_0xd96d('0x6'));var config=require(_0xd96d('0x7'));var controller=require(_0xd96d('0x8'));router[_0xd96d('0x9')]('/',auth[_0xd96d('0xa')](),controller['index']);router[_0xd96d('0x9')](_0xd96d('0xb'),auth[_0xd96d('0xa')](),controller[_0xd96d('0xc')]);router['get'](_0xd96d('0xd'),auth[_0xd96d('0xa')](),controller['getItems']);router[_0xd96d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd96d('0xe')](_0xd96d('0xf'),auth[_0xd96d('0xa')](),controller[_0xd96d('0x10')]);router[_0xd96d('0xe')]('/:id/items',auth[_0xd96d('0xa')](),controller[_0xd96d('0x11')]);router[_0xd96d('0x12')](_0xd96d('0xb'),auth[_0xd96d('0xa')](),controller[_0xd96d('0x13')]);router[_0xd96d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd96d('0x15')]);module['exports']=router; \ No newline at end of file +var _0xafc2=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','get','show','post','/:id/clone','clone','/:id/items','addItem','put','/:id','update','delete','exports','multer'];(function(_0x58b900,_0x4067f4){var _0x142565=function(_0x475ac2){while(--_0x475ac2){_0x58b900['push'](_0x58b900['shift']());}};_0x142565(++_0x4067f4);}(_0xafc2,0x15f));var _0x2afc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xafc2[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x2afc('0x0'));var util=require('util');var path=require(_0x2afc('0x1'));var timeout=require(_0x2afc('0x2'));var express=require(_0x2afc('0x3'));var router=express[_0x2afc('0x4')]();var auth=require(_0x2afc('0x5'));var interaction=require(_0x2afc('0x6'));var config=require(_0x2afc('0x7'));var controller=require(_0x2afc('0x8'));router['get']('/',auth[_0x2afc('0x9')](),controller['index']);router[_0x2afc('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2afc('0xb')]);router['get']('/:id/items',auth[_0x2afc('0x9')](),controller['getItems']);router[_0x2afc('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2afc('0xc')](_0x2afc('0xd'),auth['isAuthenticated'](),controller[_0x2afc('0xe')]);router['post'](_0x2afc('0xf'),auth['isAuthenticated'](),controller[_0x2afc('0x10')]);router[_0x2afc('0x11')](_0x2afc('0x12'),auth[_0x2afc('0x9')](),controller[_0x2afc('0x13')]);router[_0x2afc('0x14')](_0x2afc('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x2afc('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 8b3ee27..2568d63 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 _0x8b60=['#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','parse','attrs','setDataValue','stringify','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b60,0x109));var _0x08b6=function(_0x1e8561,_0x11319e){_0x1e8561=_0x1e8561-0x0;var _0xc38877=_0x8b60[_0x1e8561];return _0xc38877;};'use strict';var Sequelize=require(_0x08b6('0x0'));var squel=require(_0x08b6('0x1'));var _=require(_0x08b6('0x2'));module[_0x08b6('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x08b6('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x08b6('0x5')]('long'),'get':function(){try{return JSON[_0x08b6('0x6')](this['getDataValue'](_0x08b6('0x7')));}catch(_0x1a74c0){return[];}},'set':function(_0x205b5e){try{this[_0x08b6('0x8')]('attrs',JSON[_0x08b6('0x9')](_0x205b5e));}catch(_0x84ed9d){this[_0x08b6('0x8')]('attrs',JSON[_0x08b6('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x08b6('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x08b6('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x08b6('0x4')],'allowNull':![],'defaultValue':_0x08b6('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x08b6('0x4')]}}; \ No newline at end of file +var _0xc390=['getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse'];(function(_0x2bc46c,_0x3895d9){var _0x183f31=function(_0x1c0003){while(--_0x1c0003){_0x2bc46c['push'](_0x2bc46c['shift']());}};_0x183f31(++_0x3895d9);}(_0xc390,0x156));var _0x0c39=function(_0x188afe,_0x51dde5){_0x188afe=_0x188afe-0x0;var _0x586f85=_0xc390[_0x188afe];return _0x586f85;};'use strict';var Sequelize=require(_0x0c39('0x0'));var squel=require(_0x0c39('0x1'));var _=require(_0x0c39('0x2'));module[_0x0c39('0x3')]={'title':{'type':Sequelize[_0x0c39('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x0c39('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x0c39('0x5')](_0x0c39('0x6')),'get':function(){try{return JSON[_0x0c39('0x7')](this[_0x0c39('0x8')]('attrs'));}catch(_0x322c40){return[];}},'set':function(_0x4c9bf6){try{this[_0x0c39('0x9')](_0x0c39('0xa'),JSON[_0x0c39('0xb')](_0x4c9bf6));}catch(_0x4fb23a){this[_0x0c39('0x9')](_0x0c39('0xa'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x0c39('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x0c39('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x0c39('0xc')]},'col':{'type':Sequelize[_0x0c39('0xc')]},'background':{'type':Sequelize[_0x0c39('0x4')],'allowNull':![],'defaultValue':_0x0c39('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x0c39('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x0c39('0x4')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index f81c527..d96d4ff 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 _0x58f1=['params','type','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','pie-chart','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','show','keys','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58f1,0x1c3));var _0x158f=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x58f1[_0x519756];return _0x37047e;};'use strict';var pdf=require(_0x158f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x158f('0x1'));var zipdir=require(_0x158f('0x2'));var jsonpatch=require(_0x158f('0x3'));var rp=require(_0x158f('0x4'));var moment=require(_0x158f('0x5'));var BPromise=require(_0x158f('0x6'));var Mustache=require('mustache');var util=require(_0x158f('0x7'));var path=require(_0x158f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x158f('0x9'));var fs=require('fs');var _=require(_0x158f('0xa'));var squel=require(_0x158f('0xb'));var crypto=require(_0x158f('0xc'));var jsforce=require(_0x158f('0xd'));var deskjs=require(_0x158f('0xe'));var toCsv=require(_0x158f('0xf'));var querystring=require(_0x158f('0x10'));var Papa=require(_0x158f('0x11'));var Redis=require(_0x158f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x158f('0x13'));var hardwareService=require(_0x158f('0x14'));var logger=require(_0x158f('0x15'))(_0x158f('0x16'));var utils=require('../../config/utils');var config=require(_0x158f('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x158f('0x18')](config['redis'],{'host':_0x158f('0x19'),'port':0x18eb});var socket=require(_0x158f('0x1a'))(new Redis(config[_0x158f('0x1b')]));require(_0x158f('0x1c'))['register'](socket);function respondWithStatusCode(_0x2a5d95,_0x4335f3){_0x4335f3=_0x4335f3||0xcc;return function(_0x515171){if(_0x515171){return _0x2a5d95[_0x158f('0x1d')](_0x4335f3);}return _0x2a5d95[_0x158f('0x1e')](_0x4335f3)['end']();};}function respondWithResult(_0x1c78a1,_0x398678){_0x398678=_0x398678||0xc8;return function(_0x1ccff9){if(_0x1ccff9){return _0x1c78a1[_0x158f('0x1e')](_0x398678)[_0x158f('0x1f')](_0x1ccff9);}};}function respondWithFilteredResult(_0x481edf,_0x335ca3){return function(_0x31d7b6){if(_0x31d7b6){var _0x396ffc=_0x31d7b6['count'],_0x130269=_0x335ca3[_0x158f('0x20')],_0x1f8b5d=_0x335ca3[_0x158f('0x20')]+_0x335ca3[_0x158f('0x21')],_0x47a61c;if(_0x1f8b5d>=_0x396ffc){_0x1f8b5d=_0x396ffc;_0x47a61c=0xc8;}else{_0x47a61c=0xce;}_0x481edf[_0x158f('0x1e')](_0x47a61c);return _0x481edf[_0x158f('0x22')](_0x158f('0x23'),_0x130269+'-'+_0x1f8b5d+'/'+_0x396ffc)[_0x158f('0x1f')](_0x31d7b6);}return null;};}function patchUpdates(_0x84ac5d){return function(_0x24b662){try{jsonpatch[_0x158f('0x24')](_0x24b662,_0x84ac5d,!![]);}catch(_0x258b82){return BPromise[_0x158f('0x25')](_0x258b82);}return _0x24b662[_0x158f('0x26')]();};}function saveUpdates(_0x159dd9,_0x54302f){return function(_0x1889d3){if(_0x1889d3){return _0x1889d3['update'](_0x159dd9)[_0x158f('0x27')](function(_0x2ea88e){return _0x2ea88e;});}return null;};}function removeEntity(_0x487bec,_0x2fbf2c){return function(_0x288ed9){if(_0x288ed9){return _0x288ed9[_0x158f('0x28')]()[_0x158f('0x27')](function(){_0x487bec[_0x158f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c53f5,_0x8d6eb){return function(_0x21a6a5){if(!_0x21a6a5){_0x3c53f5[_0x158f('0x1d')](0x194);}return _0x21a6a5;};}function handleError(_0x43dc89,_0x332057){_0x332057=_0x332057||0x1f4;return function(_0x36592d){logger['error'](_0x36592d[_0x158f('0x29')]);if(_0x36592d[_0x158f('0x2a')]){delete _0x36592d[_0x158f('0x2a')];}_0x43dc89[_0x158f('0x1e')](_0x332057)[_0x158f('0x2b')](_0x36592d);};}exports[_0x158f('0x2c')]=function(_0x47af18,_0x192040){var _0x2dfe69={'raw':![],'where':{'id':_0x47af18['params']['id']}},_0x260011={};_0x260011['model']=_[_0x158f('0x2d')](db[_0x158f('0x2e')][_0x158f('0x2f')]);_0x260011['query']=_[_0x158f('0x2d')](_0x47af18[_0x158f('0x30')]);_0x260011[_0x158f('0x31')]=_[_0x158f('0x32')](_0x260011[_0x158f('0x33')],_0x260011[_0x158f('0x30')]);_0x2dfe69[_0x158f('0x34')]=_[_0x158f('0x32')](_0x260011[_0x158f('0x33')],qs[_0x158f('0x35')](_0x47af18[_0x158f('0x30')]['fields']));_0x2dfe69[_0x158f('0x34')]=_0x2dfe69[_0x158f('0x34')][_0x158f('0x36')]?_0x2dfe69[_0x158f('0x34')]:_0x260011[_0x158f('0x33')];if(_0x47af18['query'][_0x158f('0x37')]){_0x2dfe69[_0x158f('0x38')]=[{'all':!![]}];}_0x2dfe69=_['merge']({},_0x2dfe69,_0x47af18['options']);return db[_0x158f('0x2e')][_0x158f('0x39')](_0x2dfe69)[_0x158f('0x27')](handleEntityNotFound(_0x192040,null))[_0x158f('0x27')](respondWithResult(_0x192040,null))[_0x158f('0x3a')](handleError(_0x192040,null));};exports[_0x158f('0x28')]=function(_0x28c042,_0x565521){return db[_0x158f('0x2e')][_0x158f('0x39')]({'where':{'id':_0x28c042[_0x158f('0x3b')]['id']}})[_0x158f('0x27')](handleEntityNotFound(_0x565521,null))[_0x158f('0x27')](removeEntity(_0x565521,null))[_0x158f('0x3a')](handleError(_0x565521,null));};function widgetAttributes(_0x5362d0){try{switch(_0x5362d0[_0x158f('0x3c')]){case'iframe':return[{'name':_0x158f('0x3d'),'value':_0x5362d0[_0x158f('0x3d')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0[_0x158f('0x3e')][0x0]?_0x5362d0[_0x158f('0x3e')][0x0]['value']:undefined)||_0x158f('0x3f')}];case'custom':return[{'name':_0x158f('0x40'),'value':_0x5362d0[_0x158f('0x40')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0[_0x158f('0x3e')][0x0]?_0x5362d0[_0x158f('0x3e')][0x0][_0x158f('0x41')]:undefined)||''}];case _0x158f('0x42'):return[{'name':_0x158f('0x43'),'value':_0x5362d0[_0x158f('0x43')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0['attrs'][0x0]?_0x5362d0['attrs'][0x0]['value']:undefined)||_0x158f('0x44')},{'name':_0x158f('0x45'),'value':_0x5362d0['attrTimezone']||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0[_0x158f('0x3e')][0x1]?_0x5362d0[_0x158f('0x3e')][0x1][_0x158f('0x41')]:undefined)||_0x158f('0x46')},{'name':'attrFontSize','value':_0x5362d0[_0x158f('0x47')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0['attrs'][0x2]?_0x5362d0[_0x158f('0x3e')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5362d0['attrMetric']||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0['attrs'][0x0]?_0x5362d0['attrs'][0x0][_0x158f('0x41')]:undefined)||_0x158f('0x48')},{'name':'attrVoiceQueues','value':_0x5362d0[_0x158f('0x49')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0[_0x158f('0x3e')][0x1]?_0x5362d0[_0x158f('0x3e')][0x1][_0x158f('0x41')]:undefined)||[]},{'name':'attrFontSize','value':_0x5362d0[_0x158f('0x47')]||(_0x5362d0['attrs']&&_0x5362d0[_0x158f('0x3e')][0x2]?_0x5362d0[_0x158f('0x3e')][0x2][_0x158f('0x41')]:undefined)||0x14}];case'multibar-chart':case _0x158f('0x4a'):return[{'name':'attrSerie1','value':_0x5362d0['attrSerie1']||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0[_0x158f('0x3e')][0x0]?_0x5362d0[_0x158f('0x3e')][0x0][_0x158f('0x41')]:undefined)||_0x158f('0x48')},{'name':'attrSerie2','value':_0x5362d0['attrSerie2']||(_0x5362d0['attrs']&&_0x5362d0[_0x158f('0x3e')][0x1]?_0x5362d0['attrs'][0x1][_0x158f('0x41')]:undefined)||null},{'name':_0x158f('0x4b'),'value':_0x5362d0[_0x158f('0x4b')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0[_0x158f('0x3e')][0x2]?_0x5362d0[_0x158f('0x3e')][0x2][_0x158f('0x41')]:undefined)||null},{'name':_0x158f('0x49'),'value':_0x5362d0[_0x158f('0x49')]||(_0x5362d0['attrs']&&_0x5362d0[_0x158f('0x3e')][0x3]?_0x5362d0[_0x158f('0x3e')][0x3][_0x158f('0x41')]:undefined)||[]}];case _0x158f('0x4c'):return[{'name':_0x158f('0x4d'),'type':_0x5362d0[_0x158f('0x4e')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0[_0x158f('0x3e')][0x0]?_0x5362d0[_0x158f('0x3e')][0x0][_0x158f('0x3c')]:undefined)||null,'value':_0x5362d0[_0x158f('0x4d')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0['attrs'][0x0]?_0x5362d0['attrs'][0x0][_0x158f('0x41')]:undefined)||null},{'name':_0x158f('0x4f'),'value':_0x5362d0[_0x158f('0x4f')]||(_0x5362d0[_0x158f('0x3e')]&&_0x5362d0['attrs'][0x1]?_0x5362d0[_0x158f('0x3e')][0x1][_0x158f('0x41')]:undefined)||0x0}];default:return[];}}catch(_0xff2dec){logger[_0x158f('0x50')](_0x158f('0x51'),JSON[_0x158f('0x52')](_0xff2dec));return[];}}exports[_0x158f('0x53')]=function(_0x26da58,_0x2a910c){if(_0x26da58[_0x158f('0x54')]){_0x26da58['body']['attrs']=widgetAttributes(_0x26da58['body']);}return db[_0x158f('0x2e')][_0x158f('0x53')](_0x26da58[_0x158f('0x54')],{})[_0x158f('0x27')](respondWithResult(_0x2a910c,0xc9))[_0x158f('0x3a')](handleError(_0x2a910c,null));};exports['update']=function(_0xe67009,_0x157103){if(_0xe67009['body']['id']){delete _0xe67009[_0x158f('0x54')]['id'];}_0xe67009['body'][_0x158f('0x3e')]=widgetAttributes(_0xe67009[_0x158f('0x54')]);return db[_0x158f('0x2e')][_0x158f('0x39')]({'where':{'id':_0xe67009[_0x158f('0x3b')]['id']}})[_0x158f('0x27')](handleEntityNotFound(_0x157103,null))['then'](saveUpdates(_0xe67009[_0x158f('0x54')],null))['then'](respondWithResult(_0x157103,null))[_0x158f('0x3a')](handleError(_0x157103,null));}; \ No newline at end of file +var _0xf71d=['attrSerie2','attrSerie3','web-report','reportType','attrRefresh','error','widgetAttributes:\x20%s','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','options','DashboardItem','find','catch','type','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0xf71d,0x160));var _0xdf71=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xf71d[_0x58c20f];return _0x3b0318;};'use strict';var pdf=require(_0xdf71('0x0'));var emlformat=require(_0xdf71('0x1'));var rimraf=require(_0xdf71('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf71('0x3'));var rp=require(_0xdf71('0x4'));var moment=require('moment');var BPromise=require(_0xdf71('0x5'));var Mustache=require(_0xdf71('0x6'));var util=require(_0xdf71('0x7'));var path=require(_0xdf71('0x8'));var sox=require(_0xdf71('0x9'));var csv=require(_0xdf71('0xa'));var ejs=require(_0xdf71('0xb'));var fs=require('fs');var _=require(_0xdf71('0xc'));var squel=require(_0xdf71('0xd'));var crypto=require(_0xdf71('0xe'));var jsforce=require(_0xdf71('0xf'));var deskjs=require(_0xdf71('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf71('0x11'));var Redis=require(_0xdf71('0x12'));var authService=require(_0xdf71('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdf71('0x14'));var logger=require(_0xdf71('0x15'))('api');var utils=require(_0xdf71('0x16'));var config=require(_0xdf71('0x17'));var db=require(_0xdf71('0x18'))['db'];config[_0xdf71('0x19')]=_[_0xdf71('0x1a')](config['redis'],{'host':_0xdf71('0x1b'),'port':0x18eb});var socket=require(_0xdf71('0x1c'))(new Redis(config['redis']));require(_0xdf71('0x1d'))[_0xdf71('0x1e')](socket);function respondWithStatusCode(_0x2fbe02,_0x11ae47){_0x11ae47=_0x11ae47||0xcc;return function(_0x127131){if(_0x127131){return _0x2fbe02[_0xdf71('0x1f')](_0x11ae47);}return _0x2fbe02[_0xdf71('0x20')](_0x11ae47)[_0xdf71('0x21')]();};}function respondWithResult(_0x4293be,_0x3d8f6f){_0x3d8f6f=_0x3d8f6f||0xc8;return function(_0x53cc1a){if(_0x53cc1a){return _0x4293be['status'](_0x3d8f6f)[_0xdf71('0x22')](_0x53cc1a);}};}function respondWithFilteredResult(_0x1f956d,_0x60781f){return function(_0x1f0323){if(_0x1f0323){var _0x129d1a=_0x1f0323[_0xdf71('0x23')],_0xa38ea6=_0x60781f[_0xdf71('0x24')],_0x23eaef=_0x60781f[_0xdf71('0x24')]+_0x60781f['limit'],_0x40b5a6;if(_0x23eaef>=_0x129d1a){_0x23eaef=_0x129d1a;_0x40b5a6=0xc8;}else{_0x40b5a6=0xce;}_0x1f956d[_0xdf71('0x20')](_0x40b5a6);return _0x1f956d[_0xdf71('0x25')](_0xdf71('0x26'),_0xa38ea6+'-'+_0x23eaef+'/'+_0x129d1a)[_0xdf71('0x22')](_0x1f0323);}return null;};}function patchUpdates(_0x45aebe){return function(_0x40cf89){try{jsonpatch[_0xdf71('0x27')](_0x40cf89,_0x45aebe,!![]);}catch(_0x4251cc){return BPromise[_0xdf71('0x28')](_0x4251cc);}return _0x40cf89[_0xdf71('0x29')]();};}function saveUpdates(_0x3bdddc,_0x5457a8){return function(_0x15c6bb){if(_0x15c6bb){return _0x15c6bb[_0xdf71('0x2a')](_0x3bdddc)[_0xdf71('0x2b')](function(_0x411750){return _0x411750;});}return null;};}function removeEntity(_0x324b1e,_0x1b644f){return function(_0x36598d){if(_0x36598d){return _0x36598d[_0xdf71('0x2c')]()[_0xdf71('0x2b')](function(){_0x324b1e['status'](0xcc)[_0xdf71('0x21')]();});}};}function handleEntityNotFound(_0x3255a3,_0x416501){return function(_0x26b8b1){if(!_0x26b8b1){_0x3255a3[_0xdf71('0x1f')](0x194);}return _0x26b8b1;};}function handleError(_0x1cf5bf,_0x43ff01){_0x43ff01=_0x43ff01||0x1f4;return function(_0x469b24){logger['error'](_0x469b24[_0xdf71('0x2d')]);if(_0x469b24['name']){delete _0x469b24[_0xdf71('0x2e')];}_0x1cf5bf[_0xdf71('0x20')](_0x43ff01)['send'](_0x469b24);};}exports[_0xdf71('0x2f')]=function(_0x4ecae2,_0x5086ca){var _0x27d204={'raw':![],'where':{'id':_0x4ecae2[_0xdf71('0x30')]['id']}},_0x2b721b={};_0x2b721b[_0xdf71('0x31')]=_[_0xdf71('0x32')](db['DashboardItem'][_0xdf71('0x33')]);_0x2b721b[_0xdf71('0x34')]=_[_0xdf71('0x32')](_0x4ecae2['query']);_0x2b721b['filters']=_[_0xdf71('0x35')](_0x2b721b[_0xdf71('0x31')],_0x2b721b[_0xdf71('0x34')]);_0x27d204[_0xdf71('0x36')]=_[_0xdf71('0x35')](_0x2b721b[_0xdf71('0x31')],qs['fields'](_0x4ecae2['query'][_0xdf71('0x37')]));_0x27d204[_0xdf71('0x36')]=_0x27d204[_0xdf71('0x36')][_0xdf71('0x38')]?_0x27d204['attributes']:_0x2b721b[_0xdf71('0x31')];if(_0x4ecae2['query'][_0xdf71('0x39')]){_0x27d204['include']=[{'all':!![]}];}_0x27d204=_[_0xdf71('0x3a')]({},_0x27d204,_0x4ecae2[_0xdf71('0x3b')]);return db[_0xdf71('0x3c')][_0xdf71('0x3d')](_0x27d204)[_0xdf71('0x2b')](handleEntityNotFound(_0x5086ca,null))['then'](respondWithResult(_0x5086ca,null))[_0xdf71('0x3e')](handleError(_0x5086ca,null));};exports[_0xdf71('0x2c')]=function(_0x24e286,_0x13ac82){return db['DashboardItem'][_0xdf71('0x3d')]({'where':{'id':_0x24e286[_0xdf71('0x30')]['id']}})[_0xdf71('0x2b')](handleEntityNotFound(_0x13ac82,null))[_0xdf71('0x2b')](removeEntity(_0x13ac82,null))[_0xdf71('0x3e')](handleError(_0x13ac82,null));};function widgetAttributes(_0x4f08de){try{switch(_0x4f08de[_0xdf71('0x3f')]){case'iframe':return[{'name':'attrUrl','value':_0x4f08de['attrUrl']||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de['attrs'][0x0]?_0x4f08de[_0xdf71('0x40')][0x0][_0xdf71('0x41')]:undefined)||'https://'}];case _0xdf71('0x42'):return[{'name':'attrPath','value':_0x4f08de[_0xdf71('0x43')]||(_0x4f08de['attrs']&&_0x4f08de[_0xdf71('0x40')][0x0]?_0x4f08de['attrs'][0x0][_0xdf71('0x41')]:undefined)||''}];case _0xdf71('0x44'):return[{'name':_0xdf71('0x45'),'value':_0x4f08de['attrHourFormat']||(_0x4f08de['attrs']&&_0x4f08de[_0xdf71('0x40')][0x0]?_0x4f08de['attrs'][0x0]['value']:undefined)||_0xdf71('0x46')},{'name':'attrTimezone','value':_0x4f08de['attrTimezone']||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x1]?_0x4f08de[_0xdf71('0x40')][0x1]['value']:undefined)||'0.00'},{'name':'attrFontSize','value':_0x4f08de[_0xdf71('0x47')]||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de['attrs'][0x2]?_0x4f08de[_0xdf71('0x40')][0x2][_0xdf71('0x41')]:undefined)||0xc}];case _0xdf71('0x48'):return[{'name':_0xdf71('0x49'),'value':_0x4f08de[_0xdf71('0x49')]||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x0]?_0x4f08de[_0xdf71('0x40')][0x0][_0xdf71('0x41')]:undefined)||_0xdf71('0x4a')},{'name':'attrVoiceQueues','value':_0x4f08de[_0xdf71('0x4b')]||(_0x4f08de['attrs']&&_0x4f08de[_0xdf71('0x40')][0x1]?_0x4f08de['attrs'][0x1][_0xdf71('0x41')]:undefined)||[]},{'name':_0xdf71('0x47'),'value':_0x4f08de['attrFontSize']||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x2]?_0x4f08de[_0xdf71('0x40')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0xdf71('0x4c'):return[{'name':_0xdf71('0x4d'),'value':_0x4f08de['attrSerie1']||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x0]?_0x4f08de[_0xdf71('0x40')][0x0][_0xdf71('0x41')]:undefined)||_0xdf71('0x4a')},{'name':'attrSerie2','value':_0x4f08de[_0xdf71('0x4e')]||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x1]?_0x4f08de[_0xdf71('0x40')][0x1][_0xdf71('0x41')]:undefined)||null},{'name':_0xdf71('0x4f'),'value':_0x4f08de[_0xdf71('0x4f')]||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x2]?_0x4f08de[_0xdf71('0x40')][0x2][_0xdf71('0x41')]:undefined)||null},{'name':_0xdf71('0x4b'),'value':_0x4f08de[_0xdf71('0x4b')]||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x3]?_0x4f08de[_0xdf71('0x40')][0x3][_0xdf71('0x41')]:undefined)||[]}];case _0xdf71('0x50'):return[{'name':'attrReport','type':_0x4f08de[_0xdf71('0x51')]||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x0]?_0x4f08de[_0xdf71('0x40')][0x0][_0xdf71('0x3f')]:undefined)||null,'value':_0x4f08de['attrReport']||(_0x4f08de[_0xdf71('0x40')]&&_0x4f08de[_0xdf71('0x40')][0x0]?_0x4f08de['attrs'][0x0][_0xdf71('0x41')]:undefined)||null},{'name':'attrRefresh','value':_0x4f08de[_0xdf71('0x52')]||(_0x4f08de['attrs']&&_0x4f08de[_0xdf71('0x40')][0x1]?_0x4f08de['attrs'][0x1][_0xdf71('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x4d3ef3){logger[_0xdf71('0x53')](_0xdf71('0x54'),JSON['stringify'](_0x4d3ef3));return[];}}exports['create']=function(_0x6fb23d,_0x122dcf){if(_0x6fb23d['body']){_0x6fb23d[_0xdf71('0x55')][_0xdf71('0x40')]=widgetAttributes(_0x6fb23d[_0xdf71('0x55')]);}return db[_0xdf71('0x3c')]['create'](_0x6fb23d['body'],{})[_0xdf71('0x2b')](respondWithResult(_0x122dcf,0xc9))[_0xdf71('0x3e')](handleError(_0x122dcf,null));};exports['update']=function(_0x291af7,_0x21b4b8){if(_0x291af7['body']['id']){delete _0x291af7[_0xdf71('0x55')]['id'];}_0x291af7['body'][_0xdf71('0x40')]=widgetAttributes(_0x291af7[_0xdf71('0x55')]);return db[_0xdf71('0x3c')][_0xdf71('0x3d')]({'where':{'id':_0x291af7[_0xdf71('0x30')]['id']}})[_0xdf71('0x2b')](handleEntityNotFound(_0x21b4b8,null))[_0xdf71('0x2b')](saveUpdates(_0x291af7['body'],null))['then'](respondWithResult(_0x21b4b8,null))['catch'](handleError(_0x21b4b8,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 6882b13..3cf5a3e 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 _0xc648=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x55c8b2,_0x416bb8){var _0x3ddb9c=function(_0x4754bb){while(--_0x4754bb){_0x55c8b2['push'](_0x55c8b2['shift']());}};_0x3ddb9c(++_0x416bb8);}(_0xc648,0x171));var _0x8c64=function(_0x3d94ea,_0x337eb1){_0x3d94ea=_0x3d94ea-0x0;var _0x2fe04b=_0xc648[_0x3d94ea];return _0x2fe04b;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x8c64('0x0'))['db'][_0x8c64('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8c64('0x2')](0x0);var events={'afterCreate':_0x8c64('0x3'),'afterUpdate':_0x8c64('0x4'),'afterDestroy':_0x8c64('0x5')};function emitEvent(_0x294e8e){return function(_0x577182,_0x544324,_0x5a1084){DashboardItemEvents[_0x8c64('0x6')](_0x294e8e+':'+_0x577182['id'],_0x577182);DashboardItemEvents[_0x8c64('0x6')](_0x294e8e,_0x577182);_0x5a1084(null);};}for(var e in events){if(events[_0x8c64('0x7')](e)){var event=events[e];DashboardItem[_0x8c64('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x29b7=['exports','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0x29b7,0x17d));var _0x729b=function(_0x1f5bd5,_0x34618c){_0x1f5bd5=_0x1f5bd5-0x0;var _0x1214fe=_0x29b7[_0x1f5bd5];return _0x1214fe;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x729b('0x0'))['db'][_0x729b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x729b('0x2')](0x0);var events={'afterCreate':_0x729b('0x3'),'afterUpdate':_0x729b('0x4'),'afterDestroy':_0x729b('0x5')};function emitEvent(_0x1c4c0c){return function(_0x2bfcaf,_0x5c4add,_0x385175){DashboardItemEvents[_0x729b('0x6')](_0x1c4c0c+':'+_0x2bfcaf['id'],_0x2bfcaf);DashboardItemEvents['emit'](_0x1c4c0c,_0x2bfcaf);_0x385175(null);};}for(var e in events){if(events[_0x729b('0x7')](e)){var event=events[e];DashboardItem[_0x729b('0x8')](e,emitEvent(event));}}module[_0x729b('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index e61995e..96e5de0 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 _0x6c00=['./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x3f06c7,_0xd58ada){var _0x4aa19f=function(_0xaa7b3){while(--_0xaa7b3){_0x3f06c7['push'](_0x3f06c7['shift']());}};_0x4aa19f(++_0xd58ada);}(_0x6c00,0x95));var _0x06c0=function(_0x5b36bd,_0x4dfb36){_0x5b36bd=_0x5b36bd-0x0;var _0x1614fe=_0x6c00[_0x5b36bd];return _0x1614fe;};'use strict';var _=require(_0x06c0('0x0'));var util=require(_0x06c0('0x1'));var logger=require('../../config/logger')(_0x06c0('0x2'));var moment=require(_0x06c0('0x3'));var BPromise=require(_0x06c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x06c0('0x5'));var rimraf=require(_0x06c0('0x6'));var config=require('../../config/environment');var attributes=require(_0x06c0('0x7'));module[_0x06c0('0x8')]=function(_0x1a92c3,_0x3c7dd8){return _0x1a92c3[_0x06c0('0x9')](_0x06c0('0xa'),attributes,{'tableName':_0x06c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4de3=['exports','define','DashboardItem','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./dashboardItem.attributes'];(function(_0x571c1d,_0x3b0586){var _0x33c609=function(_0x226499){while(--_0x226499){_0x571c1d['push'](_0x571c1d['shift']());}};_0x33c609(++_0x3b0586);}(_0x4de3,0x137));var _0x34de=function(_0x46c6bb,_0x21351a){_0x46c6bb=_0x46c6bb-0x0;var _0x140f28=_0x4de3[_0x46c6bb];return _0x140f28;};'use strict';var _=require(_0x34de('0x0'));var util=require(_0x34de('0x1'));var logger=require(_0x34de('0x2'))('api');var moment=require(_0x34de('0x3'));var BPromise=require(_0x34de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34de('0x5'));var rimraf=require(_0x34de('0x6'));var config=require('../../config/environment');var attributes=require(_0x34de('0x7'));module[_0x34de('0x8')]=function(_0x382fe3,_0xf24b78){return _0x382fe3[_0x34de('0x9')](_0x34de('0xa'),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 1b614fc..d680fbb 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 _0x982a=['info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then'];(function(_0x13c4c3,_0x9ff629){var _0x496901=function(_0x46818a){while(--_0x46818a){_0x13c4c3['push'](_0x13c4c3['shift']());}};_0x496901(++_0x9ff629);}(_0x982a,0xba));var _0xa982=function(_0x2e6ddc,_0x578256){_0x2e6ddc=_0x2e6ddc-0x0;var _0x30ab59=_0x982a[_0x2e6ddc];return _0x30ab59;};'use strict';var _=require(_0xa982('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa982('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa982('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa982('0x3'));var config=require(_0xa982('0x4'));var jayson=require(_0xa982('0x5'));var client=jayson[_0xa982('0x6')]['http']({'port':0x232a});config[_0xa982('0x7')]=_[_0xa982('0x8')](config[_0xa982('0x7')],{'host':_0xa982('0x9'),'port':0x18eb});var socket=require(_0xa982('0xa'))(new Redis(config[_0xa982('0x7')]));require(_0xa982('0xb'))[_0xa982('0xc')](socket);function respondWithRpcPromise(_0xcb9b80,_0x45d45d,_0x3bb4b7){return new BPromise(function(_0x47dc2c,_0x33534e){return client['request'](_0xcb9b80,_0x3bb4b7)[_0xa982('0xd')](function(_0x1aaf6f){logger[_0xa982('0xe')](_0xa982('0xf'),_0x45d45d,'request\x20sent');logger[_0xa982('0x10')](_0xa982('0x11'),_0x45d45d,_0xa982('0x12'),JSON[_0xa982('0x13')](_0x1aaf6f));if(_0x1aaf6f['error']){if(_0x1aaf6f[_0xa982('0x14')][_0xa982('0x15')]===0x1f4){logger['error'](_0xa982('0xf'),_0x45d45d,_0x1aaf6f[_0xa982('0x14')][_0xa982('0x16')]);return _0x33534e(_0x1aaf6f[_0xa982('0x14')][_0xa982('0x16')]);}logger['error'](_0xa982('0xf'),_0x45d45d,_0x1aaf6f[_0xa982('0x14')][_0xa982('0x16')]);return _0x47dc2c(_0x1aaf6f[_0xa982('0x14')][_0xa982('0x16')]);}else{logger[_0xa982('0xe')](_0xa982('0xf'),_0x45d45d,'request\x20sent');_0x47dc2c(_0x1aaf6f[_0xa982('0x17')]['message']);}})[_0xa982('0x18')](function(_0x5f52a3){logger[_0xa982('0x14')](_0xa982('0xf'),_0x45d45d,_0x5f52a3);_0x33534e(_0x5f52a3);});});} \ No newline at end of file +var _0x503f=['http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x268763,_0x531c62){var _0x537d69=function(_0x1a1177){while(--_0x1a1177){_0x268763['push'](_0x268763['shift']());}};_0x537d69(++_0x531c62);}(_0x503f,0xcd));var _0xf503=function(_0x1ce12f,_0x1732e5){_0x1ce12f=_0x1ce12f-0x0;var _0x2e2a64=_0x503f[_0x1ce12f];return _0x2e2a64;};'use strict';var _=require(_0xf503('0x0'));var util=require(_0xf503('0x1'));var moment=require(_0xf503('0x2'));var BPromise=require(_0xf503('0x3'));var rs=require(_0xf503('0x4'));var fs=require('fs');var Redis=require(_0xf503('0x5'));var db=require(_0xf503('0x6'))['db'];var utils=require(_0xf503('0x7'));var logger=require(_0xf503('0x8'))(_0xf503('0x9'));var config=require('../../config/environment');var jayson=require(_0xf503('0xa'));var client=jayson['client'][_0xf503('0xb')]({'port':0x232a});config[_0xf503('0xc')]=_[_0xf503('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf503('0xe'))(new Redis(config['redis']));require(_0xf503('0xf'))[_0xf503('0x10')](socket);function respondWithRpcPromise(_0x150229,_0x9ce825,_0x340a45){return new BPromise(function(_0x3aa7e2,_0x22cb0e){return client['request'](_0x150229,_0x340a45)[_0xf503('0x11')](function(_0x2391fa){logger[_0xf503('0x12')](_0xf503('0x13'),_0x9ce825,'request\x20sent');logger['debug'](_0xf503('0x14'),_0x9ce825,_0xf503('0x15'),JSON[_0xf503('0x16')](_0x2391fa));if(_0x2391fa['error']){if(_0x2391fa['error'][_0xf503('0x17')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x9ce825,_0x2391fa[_0xf503('0x18')]['message']);return _0x22cb0e(_0x2391fa[_0xf503('0x18')][_0xf503('0x19')]);}logger['error'](_0xf503('0x13'),_0x9ce825,_0x2391fa[_0xf503('0x18')][_0xf503('0x19')]);return _0x3aa7e2(_0x2391fa[_0xf503('0x18')][_0xf503('0x19')]);}else{logger[_0xf503('0x12')](_0xf503('0x13'),_0x9ce825,_0xf503('0x15'));_0x3aa7e2(_0x2391fa[_0xf503('0x1a')][_0xf503('0x19')]);}})['catch'](function(_0x18337c){logger[_0xf503('0x18')](_0xf503('0x13'),_0x9ce825,_0x18337c);_0x22cb0e(_0x18337c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index bed8305..decaece 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 _0x55ca=['removeListener','register','./dashboardItem.events','save'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x55ca,0x126));var _0xa55c=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x55ca[_0x21f9c2];return _0x3da17f;};'use strict';var DashboardItemEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){DashboardItemEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('dashboardItem:'+_0x2121fd,_0x3c97c8);DashboardItemEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file +var _0x9c44=['emit','removeListener','length','dashboardItem:','remove','update'];(function(_0x5bc09e,_0x5c7938){var _0x3efb22=function(_0x545524){while(--_0x545524){_0x5bc09e['push'](_0x5bc09e['shift']());}};_0x3efb22(++_0x5c7938);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){DashboardItemEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);DashboardItemEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b24fea3..8f77862 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 _0x102c=['../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x52e129,_0x21975e){var _0x1acfc6=function(_0x4d87d2){while(--_0x4d87d2){_0x52e129['push'](_0x52e129['shift']());}};_0x1acfc6(++_0x21975e);}(_0x102c,0xbb));var _0xc102=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x102c[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xc102('0x0'));var util=require('util');var path=require(_0xc102('0x1'));var timeout=require(_0xc102('0x2'));var express=require(_0xc102('0x3'));var router=express[_0xc102('0x4')]();var auth=require(_0xc102('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc102('0x6'));var controller=require(_0xc102('0x7'));router['get'](_0xc102('0x8'),auth[_0xc102('0x9')](),controller[_0xc102('0xa')]);router[_0xc102('0xb')]('/',auth[_0xc102('0x9')](),controller['create']);router[_0xc102('0xc')](_0xc102('0x8'),auth[_0xc102('0x9')](),controller[_0xc102('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc102('0xe')]);module[_0xc102('0xf')]=router; \ No newline at end of file +var _0x1325=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x1325,0x140));var _0x5132=function(_0x5bf65f,_0x33cfff){_0x5bf65f=_0x5bf65f-0x0;var _0x121f80=_0x1325[_0x5bf65f];return _0x121f80;};'use strict';var multer=require(_0x5132('0x0'));var util=require(_0x5132('0x1'));var path=require(_0x5132('0x2'));var timeout=require(_0x5132('0x3'));var express=require(_0x5132('0x4'));var router=express['Router']();var auth=require(_0x5132('0x5'));var interaction=require(_0x5132('0x6'));var config=require(_0x5132('0x7'));var controller=require(_0x5132('0x8'));router[_0x5132('0x9')](_0x5132('0xa'),auth[_0x5132('0xb')](),controller['show']);router[_0x5132('0xc')]('/',auth['isAuthenticated'](),controller[_0x5132('0xd')]);router[_0x5132('0xe')](_0x5132('0xa'),auth[_0x5132('0xb')](),controller[_0x5132('0xf')]);router[_0x5132('0x10')](_0x5132('0xa'),auth[_0x5132('0xb')](),controller[_0x5132('0x11')]);module[_0x5132('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index b9d7749..9b1cdd7 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 _0xf089=['exports','STRING'];(function(_0x2b4e52,_0x36dccd){var _0x20adc7=function(_0x4cb487){while(--_0x4cb487){_0x2b4e52['push'](_0x2b4e52['shift']());}};_0x20adc7(++_0x36dccd);}(_0xf089,0xba));var _0x9f08=function(_0x211ba8,_0x323ffa){_0x211ba8=_0x211ba8-0x0;var _0x367e96=_0xf089[_0x211ba8];return _0x367e96;};'use strict';var Sequelize=require('sequelize');module[_0x9f08('0x0')]={'name':{'type':Sequelize[_0x9f08('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xdd1f=['STRING','exports'];(function(_0x5b8608,_0x527731){var _0x3f8d3d=function(_0x131b70){while(--_0x131b70){_0x5b8608['push'](_0x5b8608['shift']());}};_0x3f8d3d(++_0x527731);}(_0xdd1f,0x13b));var _0xfdd1=function(_0x180df8,_0x47064b){_0x180df8=_0x180df8-0x0;var _0x399d75=_0xdd1f[_0x180df8];return _0x399d75;};'use strict';var Sequelize=require('sequelize');module[_0xfdd1('0x0')]={'name':{'type':Sequelize[_0xfdd1('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index f99a7ea..22cca3c 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 _0xe3de=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','set','Content-Range','apply','save','update','then','get','Dispositions','error','stack','name','index','Disposition','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','catch','show','create','body','role','UserProfileSection','find','autoAssociation','UserProfileResource','destroy','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x454c6f,_0x59aede){var _0xbfa414=function(_0x1b54f2){while(--_0x1b54f2){_0x454c6f['push'](_0x454c6f['shift']());}};_0xbfa414(++_0x59aede);}(_0xe3de,0xd3));var _0xee3d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe3de[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xee3d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee3d('0x1'));var rp=require(_0xee3d('0x2'));var moment=require(_0xee3d('0x3'));var BPromise=require(_0xee3d('0x4'));var Mustache=require('mustache');var util=require(_0xee3d('0x5'));var path=require(_0xee3d('0x6'));var sox=require(_0xee3d('0x7'));var csv=require(_0xee3d('0x8'));var ejs=require(_0xee3d('0x9'));var fs=require('fs');var _=require(_0xee3d('0xa'));var squel=require(_0xee3d('0xb'));var crypto=require(_0xee3d('0xc'));var jsforce=require(_0xee3d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xee3d('0x8'));var querystring=require('querystring');var Papa=require(_0xee3d('0xe'));var Redis=require(_0xee3d('0xf'));var authService=require(_0xee3d('0x10'));var qs=require(_0xee3d('0x11'));var hardwareService=require(_0xee3d('0x12'));var logger=require(_0xee3d('0x13'))(_0xee3d('0x14'));var utils=require(_0xee3d('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc3c6,_0x2c9219){_0x2c9219=_0x2c9219||0xcc;return function(_0x4ec6bf){if(_0x4ec6bf){return _0x2bc3c6['sendStatus'](_0x2c9219);}return _0x2bc3c6[_0xee3d('0x16')](_0x2c9219)[_0xee3d('0x17')]();};}function respondWithResult(_0x396715,_0x3a95ee){_0x3a95ee=_0x3a95ee||0xc8;return function(_0x548e8c){if(_0x548e8c){return _0x396715[_0xee3d('0x16')](_0x3a95ee)[_0xee3d('0x18')](_0x548e8c);}};}function respondWithFilteredResult(_0x1ec368,_0x3fd438){return function(_0x43d74f){if(_0x43d74f){var _0x4b0bc8=_0x43d74f[_0xee3d('0x19')],_0x118714=_0x3fd438[_0xee3d('0x1a')],_0x104d33=_0x3fd438['offset']+_0x3fd438['limit'],_0x39aa2c;if(_0x104d33>=_0x4b0bc8){_0x104d33=_0x4b0bc8;_0x39aa2c=0xc8;}else{_0x39aa2c=0xce;}_0x1ec368['status'](_0x39aa2c);return _0x1ec368[_0xee3d('0x1b')](_0xee3d('0x1c'),_0x118714+'-'+_0x104d33+'/'+_0x4b0bc8)[_0xee3d('0x18')](_0x43d74f);}return null;};}function patchUpdates(_0x35a50c){return function(_0x60d32c){try{jsonpatch[_0xee3d('0x1d')](_0x60d32c,_0x35a50c,!![]);}catch(_0x132d39){return BPromise['reject'](_0x132d39);}return _0x60d32c[_0xee3d('0x1e')]();};}function saveUpdates(_0x24f892,_0x206f6b){return function(_0x1732b2){if(_0x1732b2){return _0x1732b2[_0xee3d('0x1f')](_0x24f892)[_0xee3d('0x20')](function(_0xd81fdf){return _0xd81fdf;});}return null;};}function removeEntity(_0x3c8919,_0xfccd21){return function(_0x645c92){if(_0x645c92){return _0x645c92['destroy']()['then'](function(){var _0x101ea1=_0x645c92[_0xee3d('0x21')]({'plain':!![]});var _0x120670=_0xee3d('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x120670,'resourceId':_0x101ea1['id']}})[_0xee3d('0x20')](function(){return _0x645c92;});})[_0xee3d('0x20')](function(){_0x3c8919[_0xee3d('0x16')](0xcc)[_0xee3d('0x17')]();});}};}function handleEntityNotFound(_0x56d27b,_0xaccdca){return function(_0x4a5967){if(!_0x4a5967){_0x56d27b['sendStatus'](0x194);}return _0x4a5967;};}function handleError(_0x112c03,_0x143a19){_0x143a19=_0x143a19||0x1f4;return function(_0x376931){logger[_0xee3d('0x23')](_0x376931[_0xee3d('0x24')]);if(_0x376931[_0xee3d('0x25')]){delete _0x376931[_0xee3d('0x25')];}_0x112c03[_0xee3d('0x16')](_0x143a19)['send'](_0x376931);};}exports[_0xee3d('0x26')]=function(_0x43baa9,_0x11b48e){var _0x449469={},_0x201518={},_0x4b6c99={'count':0x0,'rows':[]};var _0x1628fa=db[_0xee3d('0x27')][_0xee3d('0x28')];_0x201518['model']=_['keys'](_0x1628fa);_0x201518[_0xee3d('0x29')]=_[_0xee3d('0x2a')](_0x43baa9['query']);_0x201518[_0xee3d('0x2b')]=_[_0xee3d('0x2c')](_0x201518[_0xee3d('0x2d')],_0x201518[_0xee3d('0x29')]);_0x449469[_0xee3d('0x2e')]=_['intersection'](_0x201518[_0xee3d('0x2d')],qs['fields'](_0x43baa9[_0xee3d('0x29')][_0xee3d('0x2f')]));_0x449469[_0xee3d('0x2e')]=_0x449469[_0xee3d('0x2e')][_0xee3d('0x30')]?_0x449469[_0xee3d('0x2e')]:_0x201518['model'];if(!_0x43baa9[_0xee3d('0x29')]['hasOwnProperty'](_0xee3d('0x31'))){_0x449469[_0xee3d('0x32')]=qs[_0xee3d('0x32')](_0x43baa9[_0xee3d('0x29')]['limit']);_0x449469[_0xee3d('0x1a')]=qs[_0xee3d('0x1a')](_0x43baa9[_0xee3d('0x29')][_0xee3d('0x1a')]);}_0x449469[_0xee3d('0x33')]=qs[_0xee3d('0x34')](_0x43baa9[_0xee3d('0x29')][_0xee3d('0x34')]);_0x449469[_0xee3d('0x35')]=qs['filters'](_[_0xee3d('0x36')](_0x43baa9[_0xee3d('0x29')],_0x201518['filters']));if(_0x43baa9[_0xee3d('0x29')][_0xee3d('0x37')]){_0x449469[_0xee3d('0x35')]=_[_0xee3d('0x38')](_0x449469['where'],{'$or':_[_0xee3d('0x39')](_0x1628fa,function(_0x5ed68d){if(_0x5ed68d[_0xee3d('0x3a')][_0xee3d('0x3b')]!=='VIRTUAL'){var _0x581b18={};_0x581b18[_0x5ed68d[_0xee3d('0x3c')]]={'$like':'%'+_0x43baa9[_0xee3d('0x29')][_0xee3d('0x37')]+'%'};return _0x581b18;}})});}_0x449469=_[_0xee3d('0x38')]({},_0x449469,_0x43baa9[_0xee3d('0x3d')]);var _0x3c7922={'where':_0x449469[_0xee3d('0x35')]};return db['Disposition']['count'](_0x3c7922)[_0xee3d('0x20')](function(_0x408eb9){_0x4b6c99[_0xee3d('0x19')]=_0x408eb9;if(_0x43baa9[_0xee3d('0x29')][_0xee3d('0x3e')]){_0x449469[_0xee3d('0x3f')]=[{'all':!![]}];}return db[_0xee3d('0x27')][_0xee3d('0x40')](_0x449469);})[_0xee3d('0x20')](function(_0x34ea6){_0x4b6c99['rows']=_0x34ea6;return _0x4b6c99;})[_0xee3d('0x20')](respondWithFilteredResult(_0x11b48e,_0x449469))[_0xee3d('0x41')](handleError(_0x11b48e,null));};exports[_0xee3d('0x42')]=function(_0x59e73d,_0x35a282){var _0x372880={'raw':!![],'where':{'id':_0x59e73d['params']['id']}},_0x39a3cb={};_0x39a3cb[_0xee3d('0x2d')]=_[_0xee3d('0x2a')](db[_0xee3d('0x27')]['rawAttributes']);_0x39a3cb[_0xee3d('0x29')]=_['keys'](_0x59e73d['query']);_0x39a3cb[_0xee3d('0x2b')]=_[_0xee3d('0x2c')](_0x39a3cb[_0xee3d('0x2d')],_0x39a3cb[_0xee3d('0x29')]);_0x372880[_0xee3d('0x2e')]=_[_0xee3d('0x2c')](_0x39a3cb['model'],qs['fields'](_0x59e73d['query'][_0xee3d('0x2f')]));_0x372880['attributes']=_0x372880[_0xee3d('0x2e')][_0xee3d('0x30')]?_0x372880[_0xee3d('0x2e')]:_0x39a3cb['model'];if(_0x59e73d['query'][_0xee3d('0x3e')]){_0x372880[_0xee3d('0x3f')]=[{'all':!![]}];}_0x372880=_['merge']({},_0x372880,_0x59e73d[_0xee3d('0x3d')]);return db[_0xee3d('0x27')]['find'](_0x372880)[_0xee3d('0x20')](handleEntityNotFound(_0x35a282,null))[_0xee3d('0x20')](respondWithResult(_0x35a282,null))[_0xee3d('0x41')](handleError(_0x35a282,null));};exports[_0xee3d('0x43')]=function(_0x39a671,_0x5427e4){return db[_0xee3d('0x27')]['create'](_0x39a671[_0xee3d('0x44')],{})[_0xee3d('0x20')](function(_0x4e0afd){var _0x44b45f=_0x39a671['user'][_0xee3d('0x21')]({'plain':!![]});if(!_0x44b45f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44b45f[_0xee3d('0x45')]==='user'){var _0x212697=_0x4e0afd['get']({'plain':!![]});var _0x2f837a='Dispositions';return db[_0xee3d('0x46')][_0xee3d('0x47')]({'where':{'name':_0x2f837a,'userProfileId':_0x44b45f['userProfileId']},'raw':!![]})[_0xee3d('0x20')](function(_0x4189b2){if(_0x4189b2&&_0x4189b2[_0xee3d('0x48')]===0x0){return db[_0xee3d('0x49')][_0xee3d('0x43')]({'name':_0x212697[_0xee3d('0x25')],'resourceId':_0x212697['id'],'type':_0x4189b2[_0xee3d('0x25')],'sectionId':_0x4189b2['id']},{})['then'](function(){return _0x4e0afd;});}else{return _0x4e0afd;}})[_0xee3d('0x41')](function(_0x360b92){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x360b92);throw _0x360b92;});}return _0x4e0afd;})[_0xee3d('0x20')](respondWithResult(_0x5427e4,0xc9))[_0xee3d('0x41')](handleError(_0x5427e4,null));};exports[_0xee3d('0x1f')]=function(_0xbc5f62,_0x130ab8){if(_0xbc5f62['body']['id']){delete _0xbc5f62[_0xee3d('0x44')]['id'];}return db[_0xee3d('0x27')][_0xee3d('0x47')]({'where':{'id':_0xbc5f62['params']['id']}})[_0xee3d('0x20')](handleEntityNotFound(_0x130ab8,null))[_0xee3d('0x20')](saveUpdates(_0xbc5f62['body'],null))[_0xee3d('0x20')](respondWithResult(_0x130ab8,null))['catch'](handleError(_0x130ab8,null));};exports[_0xee3d('0x4a')]=function(_0x3aa145,_0xdf1efa){return db[_0xee3d('0x27')][_0xee3d('0x47')]({'where':{'id':_0x3aa145[_0xee3d('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf1efa,null))[_0xee3d('0x20')](removeEntity(_0xdf1efa,null))[_0xee3d('0x41')](handleError(_0xdf1efa,null));}; \ No newline at end of file +var _0xa551=['update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','Disposition','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','type','key','field','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','Dispositions','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','limit','Content-Range','save'];(function(_0x5348bb,_0xa80c8a){var _0x51ed6b=function(_0x42e2e7){while(--_0x42e2e7){_0x5348bb['push'](_0x5348bb['shift']());}};_0x51ed6b(++_0xa80c8a);}(_0xa551,0xd2));var _0x1a55=function(_0x29e2cd,_0x1d7d0a){_0x29e2cd=_0x29e2cd-0x0;var _0x32bad1=_0xa551[_0x29e2cd];return _0x32bad1;};'use strict';var pdf=require(_0x1a55('0x0'));var emlformat=require(_0x1a55('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1a55('0x2'));var rp=require(_0x1a55('0x3'));var moment=require(_0x1a55('0x4'));var BPromise=require(_0x1a55('0x5'));var Mustache=require('mustache');var util=require(_0x1a55('0x6'));var path=require(_0x1a55('0x7'));var sox=require(_0x1a55('0x8'));var csv=require(_0x1a55('0x9'));var ejs=require(_0x1a55('0xa'));var fs=require('fs');var _=require(_0x1a55('0xb'));var squel=require('squel');var crypto=require(_0x1a55('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a55('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1a55('0xe'));var Papa=require(_0x1a55('0xf'));var Redis=require(_0x1a55('0x10'));var authService=require(_0x1a55('0x11'));var qs=require(_0x1a55('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a55('0x13'))(_0x1a55('0x14'));var utils=require(_0x1a55('0x15'));var config=require('../../config/environment');var db=require(_0x1a55('0x16'))['db'];function respondWithStatusCode(_0x550e21,_0x5e184e){_0x5e184e=_0x5e184e||0xcc;return function(_0x2d5356){if(_0x2d5356){return _0x550e21['sendStatus'](_0x5e184e);}return _0x550e21[_0x1a55('0x17')](_0x5e184e)[_0x1a55('0x18')]();};}function respondWithResult(_0x35959f,_0x8e89c6){_0x8e89c6=_0x8e89c6||0xc8;return function(_0x2e06a8){if(_0x2e06a8){return _0x35959f['status'](_0x8e89c6)[_0x1a55('0x19')](_0x2e06a8);}};}function respondWithFilteredResult(_0x52b4e4,_0x282ee2){return function(_0x1d9486){if(_0x1d9486){var _0x11d4b3=_0x1d9486[_0x1a55('0x1a')],_0x242d7b=_0x282ee2['offset'],_0xa504ca=_0x282ee2['offset']+_0x282ee2[_0x1a55('0x1b')],_0x435a24;if(_0xa504ca>=_0x11d4b3){_0xa504ca=_0x11d4b3;_0x435a24=0xc8;}else{_0x435a24=0xce;}_0x52b4e4[_0x1a55('0x17')](_0x435a24);return _0x52b4e4['set'](_0x1a55('0x1c'),_0x242d7b+'-'+_0xa504ca+'/'+_0x11d4b3)[_0x1a55('0x19')](_0x1d9486);}return null;};}function patchUpdates(_0x312957){return function(_0x28d348){try{jsonpatch['apply'](_0x28d348,_0x312957,!![]);}catch(_0x1ce688){return BPromise['reject'](_0x1ce688);}return _0x28d348[_0x1a55('0x1d')]();};}function saveUpdates(_0x12bfd8,_0x109406){return function(_0x36555b){if(_0x36555b){return _0x36555b[_0x1a55('0x1e')](_0x12bfd8)[_0x1a55('0x1f')](function(_0x505484){return _0x505484;});}return null;};}function removeEntity(_0x3f0b0a,_0x96af25){return function(_0x21bfc3){if(_0x21bfc3){return _0x21bfc3[_0x1a55('0x20')]()[_0x1a55('0x1f')](function(){var _0x36da27=_0x21bfc3[_0x1a55('0x21')]({'plain':!![]});var _0x3d3c76='Dispositions';return db[_0x1a55('0x22')][_0x1a55('0x20')]({'where':{'type':_0x3d3c76,'resourceId':_0x36da27['id']}})[_0x1a55('0x1f')](function(){return _0x21bfc3;});})[_0x1a55('0x1f')](function(){_0x3f0b0a[_0x1a55('0x17')](0xcc)[_0x1a55('0x18')]();});}};}function handleEntityNotFound(_0xdc95a2,_0x132320){return function(_0x38ae04){if(!_0x38ae04){_0xdc95a2[_0x1a55('0x23')](0x194);}return _0x38ae04;};}function handleError(_0x2e9135,_0x55eb4d){_0x55eb4d=_0x55eb4d||0x1f4;return function(_0x5ab41d){logger[_0x1a55('0x24')](_0x5ab41d[_0x1a55('0x25')]);if(_0x5ab41d[_0x1a55('0x26')]){delete _0x5ab41d[_0x1a55('0x26')];}_0x2e9135['status'](_0x55eb4d)[_0x1a55('0x27')](_0x5ab41d);};}exports[_0x1a55('0x28')]=function(_0x4cc2ab,_0x31abee){var _0x39d7e9={},_0xc0dfab={},_0x38a9ff={'count':0x0,'rows':[]};var _0x4d67c3=db[_0x1a55('0x29')]['rawAttributes'];_0xc0dfab[_0x1a55('0x2a')]=_[_0x1a55('0x2b')](_0x4d67c3);_0xc0dfab[_0x1a55('0x2c')]=_[_0x1a55('0x2b')](_0x4cc2ab['query']);_0xc0dfab[_0x1a55('0x2d')]=_[_0x1a55('0x2e')](_0xc0dfab[_0x1a55('0x2a')],_0xc0dfab[_0x1a55('0x2c')]);_0x39d7e9[_0x1a55('0x2f')]=_[_0x1a55('0x2e')](_0xc0dfab[_0x1a55('0x2a')],qs[_0x1a55('0x30')](_0x4cc2ab[_0x1a55('0x2c')][_0x1a55('0x30')]));_0x39d7e9[_0x1a55('0x2f')]=_0x39d7e9[_0x1a55('0x2f')][_0x1a55('0x31')]?_0x39d7e9[_0x1a55('0x2f')]:_0xc0dfab[_0x1a55('0x2a')];if(!_0x4cc2ab[_0x1a55('0x2c')][_0x1a55('0x32')](_0x1a55('0x33'))){_0x39d7e9[_0x1a55('0x1b')]=qs[_0x1a55('0x1b')](_0x4cc2ab[_0x1a55('0x2c')][_0x1a55('0x1b')]);_0x39d7e9[_0x1a55('0x34')]=qs[_0x1a55('0x34')](_0x4cc2ab[_0x1a55('0x2c')][_0x1a55('0x34')]);}_0x39d7e9[_0x1a55('0x35')]=qs['sort'](_0x4cc2ab['query'][_0x1a55('0x36')]);_0x39d7e9[_0x1a55('0x37')]=qs[_0x1a55('0x2d')](_[_0x1a55('0x38')](_0x4cc2ab[_0x1a55('0x2c')],_0xc0dfab[_0x1a55('0x2d')]));if(_0x4cc2ab[_0x1a55('0x2c')]['filter']){_0x39d7e9[_0x1a55('0x37')]=_[_0x1a55('0x39')](_0x39d7e9[_0x1a55('0x37')],{'$or':_[_0x1a55('0x3a')](_0x4d67c3,function(_0x9b7e5c){if(_0x9b7e5c[_0x1a55('0x3b')][_0x1a55('0x3c')]!=='VIRTUAL'){var _0x507625={};_0x507625[_0x9b7e5c[_0x1a55('0x3d')]]={'$like':'%'+_0x4cc2ab[_0x1a55('0x2c')][_0x1a55('0x3e')]+'%'};return _0x507625;}})});}_0x39d7e9=_[_0x1a55('0x39')]({},_0x39d7e9,_0x4cc2ab[_0x1a55('0x3f')]);var _0x1afee8={'where':_0x39d7e9[_0x1a55('0x37')]};return db[_0x1a55('0x29')]['count'](_0x1afee8)[_0x1a55('0x1f')](function(_0x43184c){_0x38a9ff[_0x1a55('0x1a')]=_0x43184c;if(_0x4cc2ab[_0x1a55('0x2c')][_0x1a55('0x40')]){_0x39d7e9['include']=[{'all':!![]}];}return db['Disposition'][_0x1a55('0x41')](_0x39d7e9);})[_0x1a55('0x1f')](function(_0x372a6e){_0x38a9ff[_0x1a55('0x42')]=_0x372a6e;return _0x38a9ff;})[_0x1a55('0x1f')](respondWithFilteredResult(_0x31abee,_0x39d7e9))[_0x1a55('0x43')](handleError(_0x31abee,null));};exports[_0x1a55('0x44')]=function(_0x3be65e,_0x2fe072){var _0x2ec412={'raw':!![],'where':{'id':_0x3be65e[_0x1a55('0x45')]['id']}},_0x1c4b80={};_0x1c4b80[_0x1a55('0x2a')]=_[_0x1a55('0x2b')](db[_0x1a55('0x29')]['rawAttributes']);_0x1c4b80['query']=_[_0x1a55('0x2b')](_0x3be65e['query']);_0x1c4b80[_0x1a55('0x2d')]=_['intersection'](_0x1c4b80[_0x1a55('0x2a')],_0x1c4b80[_0x1a55('0x2c')]);_0x2ec412[_0x1a55('0x2f')]=_[_0x1a55('0x2e')](_0x1c4b80['model'],qs[_0x1a55('0x30')](_0x3be65e[_0x1a55('0x2c')][_0x1a55('0x30')]));_0x2ec412[_0x1a55('0x2f')]=_0x2ec412['attributes'][_0x1a55('0x31')]?_0x2ec412[_0x1a55('0x2f')]:_0x1c4b80['model'];if(_0x3be65e[_0x1a55('0x2c')][_0x1a55('0x40')]){_0x2ec412[_0x1a55('0x46')]=[{'all':!![]}];}_0x2ec412=_[_0x1a55('0x39')]({},_0x2ec412,_0x3be65e[_0x1a55('0x3f')]);return db[_0x1a55('0x29')][_0x1a55('0x47')](_0x2ec412)['then'](handleEntityNotFound(_0x2fe072,null))[_0x1a55('0x1f')](respondWithResult(_0x2fe072,null))[_0x1a55('0x43')](handleError(_0x2fe072,null));};exports[_0x1a55('0x48')]=function(_0x4a6116,_0x2c2e98){return db[_0x1a55('0x29')][_0x1a55('0x48')](_0x4a6116[_0x1a55('0x49')],{})[_0x1a55('0x1f')](function(_0x4395f2){var _0x30c0b7=_0x4a6116[_0x1a55('0x4a')][_0x1a55('0x21')]({'plain':!![]});if(!_0x30c0b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30c0b7[_0x1a55('0x4b')]===_0x1a55('0x4a')){var _0x38b5b2=_0x4395f2[_0x1a55('0x21')]({'plain':!![]});var _0x38f4d7=_0x1a55('0x4c');return db[_0x1a55('0x4d')][_0x1a55('0x47')]({'where':{'name':_0x38f4d7,'userProfileId':_0x30c0b7['userProfileId']},'raw':!![]})[_0x1a55('0x1f')](function(_0x2d9a07){if(_0x2d9a07&&_0x2d9a07[_0x1a55('0x4e')]===0x0){return db[_0x1a55('0x22')][_0x1a55('0x48')]({'name':_0x38b5b2[_0x1a55('0x26')],'resourceId':_0x38b5b2['id'],'type':_0x2d9a07['name'],'sectionId':_0x2d9a07['id']},{})[_0x1a55('0x1f')](function(){return _0x4395f2;});}else{return _0x4395f2;}})[_0x1a55('0x43')](function(_0x302646){logger[_0x1a55('0x24')](_0x1a55('0x4f'),_0x302646);throw _0x302646;});}return _0x4395f2;})[_0x1a55('0x1f')](respondWithResult(_0x2c2e98,0xc9))[_0x1a55('0x43')](handleError(_0x2c2e98,null));};exports['update']=function(_0x140175,_0x107653){if(_0x140175[_0x1a55('0x49')]['id']){delete _0x140175['body']['id'];}return db[_0x1a55('0x29')][_0x1a55('0x47')]({'where':{'id':_0x140175[_0x1a55('0x45')]['id']}})['then'](handleEntityNotFound(_0x107653,null))[_0x1a55('0x1f')](saveUpdates(_0x140175[_0x1a55('0x49')],null))[_0x1a55('0x1f')](respondWithResult(_0x107653,null))[_0x1a55('0x43')](handleError(_0x107653,null));};exports[_0x1a55('0x20')]=function(_0x36513c,_0x33fdc0){return db[_0x1a55('0x29')][_0x1a55('0x47')]({'where':{'id':_0x36513c[_0x1a55('0x45')]['id']}})[_0x1a55('0x1f')](handleEntityNotFound(_0x33fdc0,null))[_0x1a55('0x1f')](removeEntity(_0x33fdc0,null))[_0x1a55('0x43')](handleError(_0x33fdc0,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index fa1f31f..2ab8944 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 _0xa08b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Disposition','tools_dispositions','name_voice','name','name_chat','name_mail','MailAccountId','FaxAccountId','name_openchannel','util','../../config/logger','api'];(function(_0x397bfb,_0x589665){var _0x16c9b9=function(_0x13ce8a){while(--_0x13ce8a){_0x397bfb['push'](_0x397bfb['shift']());}};_0x16c9b9(++_0x589665);}(_0xa08b,0xe1));var _0xba08=function(_0x5577f3,_0x2b6def){_0x5577f3=_0x5577f3-0x0;var _0x2bfbbc=_0xa08b[_0x5577f3];return _0x2bfbbc;};'use strict';var _=require('lodash');var util=require(_0xba08('0x0'));var logger=require(_0xba08('0x1'))(_0xba08('0x2'));var moment=require(_0xba08('0x3'));var BPromise=require(_0xba08('0x4'));var rp=require(_0xba08('0x5'));var fs=require('fs');var path=require(_0xba08('0x6'));var rimraf=require(_0xba08('0x7'));var config=require(_0xba08('0x8'));var attributes=require('./disposition.attributes');module['exports']=function(_0x5af2b2,_0x4c231f){return _0x5af2b2[_0xba08('0x9')](_0xba08('0xa'),attributes,{'tableName':_0xba08('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xba08('0xc'),'fields':[_0xba08('0xd'),'ListId']},{'unique':!![],'name':_0xba08('0xe'),'fields':[_0xba08('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0xba08('0xf'),'fields':[_0xba08('0xd'),_0xba08('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0xba08('0xd'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name',_0xba08('0x11')]},{'unique':!![],'name':_0xba08('0x12'),'fields':['name','OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7da1=['FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','Disposition','name_voice','name','name_chat','ChatWebsiteId','MailAccountId','name_fax'];(function(_0x25bafd,_0x15cfd6){var _0x1b7ddb=function(_0x5e4968){while(--_0x5e4968){_0x25bafd['push'](_0x25bafd['shift']());}};_0x1b7ddb(++_0x15cfd6);}(_0x7da1,0x1b3));var _0x17da=function(_0x34c274,_0x3e8664){_0x34c274=_0x34c274-0x0;var _0xf72059=_0x7da1[_0x34c274];return _0xf72059;};'use strict';var _=require(_0x17da('0x0'));var util=require('util');var logger=require(_0x17da('0x1'))(_0x17da('0x2'));var moment=require('moment');var BPromise=require(_0x17da('0x3'));var rp=require(_0x17da('0x4'));var fs=require('fs');var path=require(_0x17da('0x5'));var rimraf=require('rimraf');var config=require(_0x17da('0x6'));var attributes=require('./disposition.attributes');module['exports']=function(_0xef0fc3,_0x3e8dfc){return _0xef0fc3[_0x17da('0x7')](_0x17da('0x8'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x17da('0x9'),'fields':[_0x17da('0xa'),'ListId']},{'unique':!![],'name':_0x17da('0xb'),'fields':[_0x17da('0xa'),_0x17da('0xc')]},{'unique':!![],'name':'name_mail','fields':[_0x17da('0xa'),_0x17da('0xd')]},{'unique':!![],'name':'name_sms','fields':[_0x17da('0xa'),'SmsAccountId']},{'unique':!![],'name':_0x17da('0xe'),'fields':['name',_0x17da('0xf')]},{'unique':!![],'name':_0x17da('0x10'),'fields':[_0x17da('0xa'),_0x17da('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 4b20100..84c9682 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x53ec,0x192));var _0xc53e=function(_0x509d9e,_0x2d1197){_0x509d9e=_0x509d9e-0x0;var _0x56b488=_0x53ec[_0x509d9e];return _0x56b488;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Disposition,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x2494=['../../config/utils','../../config/environment','client','http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21e29b,_0x1a8003){var _0x44afc6=function(_0xa29725){while(--_0xa29725){_0x21e29b['push'](_0x21e29b['shift']());}};_0x44afc6(++_0x1a8003);}(_0x2494,0x82));var _0x4249=function(_0x620a39,_0x23d84b){_0x620a39=_0x620a39-0x0;var _0x37e85b=_0x2494[_0x620a39];return _0x37e85b;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var moment=require(_0x4249('0x1'));var BPromise=require(_0x4249('0x2'));var rs=require(_0x4249('0x3'));var fs=require('fs');var Redis=require(_0x4249('0x4'));var db=require(_0x4249('0x5'))['db'];var utils=require(_0x4249('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4249('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4249('0x8')][_0x4249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed716a,_0x5b1b17,_0x326336){return new BPromise(function(_0x2b7934,_0x21060d){return client['request'](_0xed716a,_0x326336)['then'](function(_0x3efaa6){logger[_0x4249('0xa')](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));logger[_0x4249('0xd')](_0x4249('0xe'),_0x5b1b17,_0x4249('0xc'),JSON['stringify'](_0x3efaa6));if(_0x3efaa6['error']){if(_0x3efaa6[_0x4249('0xf')]['code']===0x1f4){logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6['error'][_0x4249('0x10')]);return _0x21060d(_0x3efaa6[_0x4249('0xf')]['message']);}logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);return _0x2b7934(_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);}else{logger['info'](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));_0x2b7934(_0x3efaa6['result'][_0x4249('0x10')]);}})['catch'](function(_0x501e9c){logger['error'](_0x4249('0xb'),_0x5b1b17,_0x501e9c);_0x21060d(_0x501e9c);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 674f832..60cddf0 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 _0x368e=['../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0xffdf67,_0x35077e){var _0x3334e4=function(_0x483689){while(--_0x483689){_0xffdf67['push'](_0xffdf67['shift']());}};_0x3334e4(++_0x35077e);}(_0x368e,0x118));var _0xe368=function(_0x1b658,_0x344b6a){_0x1b658=_0x1b658-0x0;var _0x1d17e5=_0x368e[_0x1b658];return _0x1d17e5;};'use strict';var multer=require('multer');var util=require(_0xe368('0x0'));var path=require(_0xe368('0x1'));var timeout=require(_0xe368('0x2'));var express=require(_0xe368('0x3'));var router=express['Router']();var auth=require(_0xe368('0x4'));var interaction=require(_0xe368('0x5'));var config=require(_0xe368('0x6'));var controller=require(_0xe368('0x7'));router[_0xe368('0x8')]('/',auth[_0xe368('0x9')](),controller['index']);router['get'](_0xe368('0xa'),auth[_0xe368('0x9')](),controller[_0xe368('0xb')]);router[_0xe368('0xc')]('/',auth[_0xe368('0x9')](),controller[_0xe368('0xd')]);router[_0xe368('0xe')]('/:id',auth[_0xe368('0x9')](),controller[_0xe368('0xf')]);router[_0xe368('0x10')](_0xe368('0xa'),auth[_0xe368('0x9')](),controller[_0xe368('0x11')]);module[_0xe368('0x12')]=router; \ No newline at end of file +var _0xc64e=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','create','put','isAuthenticated','update','delete','/:id'];(function(_0xb2f182,_0x390b84){var _0x1085d2=function(_0x35b955){while(--_0x35b955){_0xb2f182['push'](_0xb2f182['shift']());}};_0x1085d2(++_0x390b84);}(_0xc64e,0x17e));var _0xec64=function(_0x421459,_0x283598){_0x421459=_0x421459-0x0;var _0x890ef9=_0xc64e[_0x421459];return _0x890ef9;};'use strict';var multer=require('multer');var util=require(_0xec64('0x0'));var path=require(_0xec64('0x1'));var timeout=require(_0xec64('0x2'));var express=require(_0xec64('0x3'));var router=express[_0xec64('0x4')]();var auth=require(_0xec64('0x5'));var interaction=require(_0xec64('0x6'));var config=require(_0xec64('0x7'));var controller=require('./disposition.controller');router[_0xec64('0x8')]('/',auth['isAuthenticated'](),controller[_0xec64('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xec64('0xa')]);router[_0xec64('0xb')]('/',auth['isAuthenticated'](),controller[_0xec64('0xc')]);router[_0xec64('0xd')]('/:id',auth[_0xec64('0xe')](),controller[_0xec64('0xf')]);router[_0xec64('0x10')](_0xec64('0x11'),auth[_0xec64('0xe')](),controller[_0xec64('0x12')]);module[_0xec64('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a4237e9..9a5dfc0 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 _0x0e4d=['setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','2400','4800','9600','12000','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0e4d,0x178));var _0xd0e4=function(_0x10c304,_0x2771db){_0x10c304=_0x10c304-0x0;var _0x5853ce=_0x0e4d[_0x10c304];return _0x5853ce;};'use strict';var Sequelize=require(_0xd0e4('0x0'));module[_0xd0e4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0e4('0x2')]},'ecm':{'type':Sequelize[_0xd0e4('0x3')]('yes','no'),'defaultValue':_0xd0e4('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xd0e4('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xd0e4('0x3')](_0xd0e4('0x5'),_0xd0e4('0x6'),'7200',_0xd0e4('0x7'),_0xd0e4('0x8'),_0xd0e4('0x9')),'defaultValue':_0xd0e4('0x6')},'maxrate':{'type':Sequelize[_0xd0e4('0x3')](_0xd0e4('0x5'),_0xd0e4('0x6'),_0xd0e4('0xa'),'9600','12000',_0xd0e4('0x9')),'defaultValue':_0xd0e4('0x9')},'modem':{'type':Sequelize[_0xd0e4('0x2')],'defaultValue':_0xd0e4('0xb')},'gateway':{'type':Sequelize[_0xd0e4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd0e4('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd0e4('0x3')](_0xd0e4('0xd'),_0xd0e4('0xe'),_0xd0e4('0xf'),_0xd0e4('0x10')),'defaultValue':_0xd0e4('0xd')},'key':{'type':Sequelize[_0xd0e4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd0e4('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd0e4('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0e4('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0e4('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd0e4('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd0e4('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd0e4('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd0e4('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd0e4('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xd0e4('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x14e766){if(!_0x14e766)this[_0xd0e4('0x14')]('mandatoryDispositionPauseId',null);this[_0xd0e4('0x14')](_0xd0e4('0x15'),_0x14e766);}}}; \ No newline at end of file +var _0xeea1=['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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xeea1,0x11b));var _0x1eea=function(_0x437618,_0x5ee66d){_0x437618=_0x437618-0x0;var _0x42f432=_0xeea1[_0x437618];return _0x42f432;};'use strict';var Sequelize=require(_0x1eea('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1eea('0x1')]},'ecm':{'type':Sequelize[_0x1eea('0x2')](_0x1eea('0x3'),'no'),'defaultValue':_0x1eea('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x1eea('0x1')],'unique':_0x1eea('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x1eea('0x5'),_0x1eea('0x6'),_0x1eea('0x7'),_0x1eea('0x8'),_0x1eea('0x9'),_0x1eea('0xa')),'defaultValue':_0x1eea('0x6')},'maxrate':{'type':Sequelize[_0x1eea('0x2')]('2400','4800',_0x1eea('0x7'),_0x1eea('0x8'),'12000',_0x1eea('0xa')),'defaultValue':_0x1eea('0xa')},'modem':{'type':Sequelize[_0x1eea('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x1eea('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1eea('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1eea('0x2')](_0x1eea('0xc'),_0x1eea('0xd'),_0x1eea('0xe'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x1eea('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1eea('0xf')],'defaultValue':function(){return _0x1eea('0x10');}},'notificationSound':{'type':Sequelize[_0x1eea('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1eea('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1eea('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1eea('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1eea('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1eea('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1eea('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1eea('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1eea('0x13'),'set':function(_0x4b199f){if(!_0x4b199f)this[_0x1eea('0x14')]('mandatoryDispositionPauseId',null);this[_0x1eea('0x14')]('mandatoryDisposition',_0x4b199f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e10de49..fbce323 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 _0xfaa7=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','length','nolimit','pick','FaxAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','getApplications','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','priority','Answer','push','Set','ecm','faxdetect','headerinfo','maxrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','bulkCreate','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','from','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','register','jayson/promise','client','test','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','update','destroy','then','FaxAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','keys','query','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','filters','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x1398db,_0x5a6003){var _0x178e86=function(_0x1a5612){while(--_0x1a5612){_0x1398db['push'](_0x1398db['shift']());}};_0x178e86(++_0x5a6003);}(_0xfaa7,0x1dc));var _0x7faa=function(_0x41f7fa,_0x5818a0){_0x41f7fa=_0x41f7fa-0x0;var _0x1502ce=_0xfaa7[_0x41f7fa];return _0x1502ce;};'use strict';var pdf=require(_0x7faa('0x0'));var emlformat=require(_0x7faa('0x1'));var rimraf=require(_0x7faa('0x2'));var zipdir=require(_0x7faa('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7faa('0x4'));var moment=require(_0x7faa('0x5'));var BPromise=require(_0x7faa('0x6'));var Mustache=require(_0x7faa('0x7'));var util=require(_0x7faa('0x8'));var path=require('path');var sox=require(_0x7faa('0x9'));var csv=require(_0x7faa('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7faa('0xb'));var squel=require(_0x7faa('0xc'));var crypto=require(_0x7faa('0xd'));var jsforce=require(_0x7faa('0xe'));var deskjs=require(_0x7faa('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7faa('0x10'));var Redis=require(_0x7faa('0x11'));var authService=require(_0x7faa('0x12'));var qs=require(_0x7faa('0x13'));var hardwareService=require(_0x7faa('0x14'));var logger=require(_0x7faa('0x15'))(_0x7faa('0x16'));var utils=require(_0x7faa('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7faa('0x18')]=_[_0x7faa('0x19')](config[_0x7faa('0x18')],{'host':_0x7faa('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0x7faa('0x1b')](socket);var jayson=require(_0x7faa('0x1c'));var client=jayson[_0x7faa('0x1d')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x347990,_0x4d703b,_0x1b8e72){if(_0x1b8e72){var _0x37a63c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37a63c[_0x7faa('0x1e')](_0x4d703b)){return _0x347990;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x347990;}}function respondWithRpcPromise(_0x573f6f,_0x5e6007,_0x3fb23b,_0x2504f2){return new BPromise(function(_0xda3532,_0x3245a3){var _0x578850=_0x2504f2||client;return _0x578850['request'](_0x573f6f,_0x3fb23b)['then'](function(_0x3a3de){logger['info'](_0x7faa('0x1f'),_0x5e6007,'request\x20sent');logger[_0x7faa('0x20')](_0x7faa('0x21'),_0x5e6007,'request\x20sent',JSON[_0x7faa('0x22')](_0x3a3de));if(_0x3a3de['error']){if(_0x3a3de['error']['code']===0x1f4){logger[_0x7faa('0x23')]('FaxAccount,\x20%s,\x20%s',_0x5e6007,_0x3a3de[_0x7faa('0x23')][_0x7faa('0x24')]);return _0x3245a3(_0x3a3de[_0x7faa('0x23')][_0x7faa('0x24')]);}logger[_0x7faa('0x23')](_0x7faa('0x1f'),_0x5e6007,_0x3a3de[_0x7faa('0x23')][_0x7faa('0x24')]);return _0xda3532(_0x3a3de['error'][_0x7faa('0x24')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x5e6007,_0x7faa('0x25'));_0xda3532(_0x3a3de[_0x7faa('0x26')]['message']);}})['catch'](function(_0x489cbe){logger['error'](_0x7faa('0x1f'),_0x5e6007,_0x489cbe);_0x3245a3(_0x489cbe);});});}function respondWithStatusCode(_0x425cbe,_0x21b7a1){_0x21b7a1=_0x21b7a1||0xcc;return function(_0x28169f){if(_0x28169f){return _0x425cbe[_0x7faa('0x27')](_0x21b7a1);}return _0x425cbe['status'](_0x21b7a1)['end']();};}function respondWithResult(_0x1d5428,_0x154657){_0x154657=_0x154657||0xc8;return function(_0x37b1e0){if(_0x37b1e0){return _0x1d5428['status'](_0x154657)[_0x7faa('0x28')](_0x37b1e0);}};}function respondWithFilteredResult(_0x22126b,_0x2345a0){return function(_0x3414c4){if(_0x3414c4){var _0x3594f6=_0x3414c4[_0x7faa('0x29')],_0x1f575c=_0x2345a0[_0x7faa('0x2a')],_0x2207bd=_0x2345a0[_0x7faa('0x2a')]+_0x2345a0[_0x7faa('0x2b')],_0x20a9bf;if(_0x2207bd>=_0x3594f6){_0x2207bd=_0x3594f6;_0x20a9bf=0xc8;}else{_0x20a9bf=0xce;}_0x22126b[_0x7faa('0x2c')](_0x20a9bf);return _0x22126b[_0x7faa('0x2d')](_0x7faa('0x2e'),_0x1f575c+'-'+_0x2207bd+'/'+_0x3594f6)[_0x7faa('0x28')](_0x3414c4);}return null;};}function patchUpdates(_0x4ad022){return function(_0x1a076a){try{jsonpatch[_0x7faa('0x2f')](_0x1a076a,_0x4ad022,!![]);}catch(_0x1f4da4){return BPromise[_0x7faa('0x30')](_0x1f4da4);}return _0x1a076a['save']();};}function saveUpdates(_0x54208e,_0x262d66){return function(_0x3ed8e6){if(_0x3ed8e6){return _0x3ed8e6[_0x7faa('0x31')](_0x54208e)['then'](function(_0x4036fa){return _0x4036fa;});}return null;};}function removeEntity(_0x4b2873,_0x28066f){return function(_0x32fe45){if(_0x32fe45){return _0x32fe45[_0x7faa('0x32')]()[_0x7faa('0x33')](function(){var _0x2c8210=_0x32fe45['get']({'plain':!![]});var _0x3e60ff=_0x7faa('0x34');return db[_0x7faa('0x35')]['destroy']({'where':{'type':_0x3e60ff,'resourceId':_0x2c8210['id']}})['then'](function(){return _0x32fe45;});})[_0x7faa('0x33')](function(){_0x4b2873[_0x7faa('0x2c')](0xcc)[_0x7faa('0x36')]();});}};}function handleEntityNotFound(_0x433f1e,_0x283708){return function(_0x2188bd){if(!_0x2188bd){_0x433f1e[_0x7faa('0x27')](0x194);}return _0x2188bd;};}function handleError(_0x4e7a16,_0x573b2a){_0x573b2a=_0x573b2a||0x1f4;return function(_0x4c532f){logger[_0x7faa('0x23')](_0x4c532f[_0x7faa('0x37')]);if(_0x4c532f[_0x7faa('0x38')]){delete _0x4c532f[_0x7faa('0x38')];}_0x4e7a16[_0x7faa('0x2c')](_0x573b2a)[_0x7faa('0x39')](_0x4c532f);};}exports[_0x7faa('0x3a')]=function(_0x443d25,_0x4174b0){var _0x48ec5b={'include':[{'model':db[_0x7faa('0x3b')],'as':_0x7faa('0x3c')}]},_0x2a6fb9={},_0x1608e8={'count':0x0,'rows':[]};var _0x5f22ee=db[_0x7faa('0x3d')]['rawAttributes'];_0x2a6fb9['model']=_[_0x7faa('0x3e')](_0x5f22ee);_0x2a6fb9[_0x7faa('0x3f')]=_[_0x7faa('0x3e')](_0x443d25[_0x7faa('0x3f')]);_0x2a6fb9['filters']=_[_0x7faa('0x40')](_0x2a6fb9[_0x7faa('0x41')],_0x2a6fb9['query']);_0x48ec5b['attributes']=_[_0x7faa('0x40')](_0x2a6fb9[_0x7faa('0x41')],qs[_0x7faa('0x42')](_0x443d25[_0x7faa('0x3f')][_0x7faa('0x42')]));_0x48ec5b[_0x7faa('0x43')]=_0x48ec5b[_0x7faa('0x43')]['length']?_0x48ec5b['attributes']:_0x2a6fb9[_0x7faa('0x41')];if(!_0x443d25[_0x7faa('0x3f')][_0x7faa('0x44')]('nolimit')){_0x48ec5b[_0x7faa('0x2b')]=qs[_0x7faa('0x2b')](_0x443d25['query'][_0x7faa('0x2b')]);_0x48ec5b[_0x7faa('0x2a')]=qs[_0x7faa('0x2a')](_0x443d25[_0x7faa('0x3f')]['offset']);}_0x48ec5b[_0x7faa('0x45')]=qs[_0x7faa('0x46')](_0x443d25[_0x7faa('0x3f')][_0x7faa('0x46')]);_0x48ec5b[_0x7faa('0x47')]=qs['filters'](_['pick'](_0x443d25['query'],_0x2a6fb9[_0x7faa('0x48')]));if(_0x443d25[_0x7faa('0x3f')]['filter']){_0x48ec5b[_0x7faa('0x47')]=_['merge'](_0x48ec5b[_0x7faa('0x47')],{'$or':_[_0x7faa('0x49')](_0x5f22ee,function(_0x12a65c){if(_0x12a65c[_0x7faa('0x4a')][_0x7faa('0x4b')]!==_0x7faa('0x4c')){var _0x411bd5={};_0x411bd5[_0x12a65c[_0x7faa('0x4d')]]={'$like':'%'+_0x443d25[_0x7faa('0x3f')][_0x7faa('0x4e')]+'%'};return _0x411bd5;}})});}_0x48ec5b=_[_0x7faa('0x4f')]({},_0x48ec5b,_0x443d25[_0x7faa('0x50')]);var _0x558011={'where':_0x48ec5b[_0x7faa('0x47')]};return db[_0x7faa('0x3d')][_0x7faa('0x29')](_0x558011)[_0x7faa('0x33')](function(_0x40e96b){_0x1608e8['count']=_0x40e96b;if(_0x443d25['query'][_0x7faa('0x51')]){_0x48ec5b['include']=[{'all':!![]}];}return db[_0x7faa('0x3d')][_0x7faa('0x52')](_0x48ec5b);})[_0x7faa('0x33')](function(_0x2f52cc){_0x1608e8['rows']=_0x2f52cc;return _0x1608e8;})[_0x7faa('0x33')](respondWithFilteredResult(_0x4174b0,_0x48ec5b))[_0x7faa('0x53')](handleError(_0x4174b0,null));};exports[_0x7faa('0x54')]=function(_0x5aac93,_0x51742d){var _0xc9777b={'raw':![],'where':{'id':_0x5aac93[_0x7faa('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7faa('0x3c')}]},_0x274485={};_0x274485[_0x7faa('0x41')]=_['keys'](db[_0x7faa('0x3d')][_0x7faa('0x56')]);_0x274485[_0x7faa('0x3f')]=_[_0x7faa('0x3e')](_0x5aac93['query']);_0x274485[_0x7faa('0x48')]=_['intersection'](_0x274485[_0x7faa('0x41')],_0x274485[_0x7faa('0x3f')]);_0xc9777b[_0x7faa('0x43')]=_[_0x7faa('0x40')](_0x274485[_0x7faa('0x41')],qs['fields'](_0x5aac93['query'][_0x7faa('0x42')]));_0xc9777b[_0x7faa('0x43')]=_0xc9777b['attributes']['length']?_0xc9777b[_0x7faa('0x43')]:_0x274485[_0x7faa('0x41')];if(_0x5aac93[_0x7faa('0x3f')][_0x7faa('0x51')]){_0xc9777b[_0x7faa('0x57')]=[{'all':!![]}];}_0xc9777b=_[_0x7faa('0x4f')]({},_0xc9777b,_0x5aac93[_0x7faa('0x50')]);return db['FaxAccount'][_0x7faa('0x58')](_0xc9777b)[_0x7faa('0x33')](handleEntityNotFound(_0x51742d,null))['then'](respondWithResult(_0x51742d,null))[_0x7faa('0x53')](handleError(_0x51742d,null));};exports[_0x7faa('0x59')]=function(_0x572dbf,_0x4573c0){return db[_0x7faa('0x3d')]['create'](_0x572dbf[_0x7faa('0x5a')],{})[_0x7faa('0x33')](function(_0x399174){var _0x5d8254=_0x572dbf['user'][_0x7faa('0x5b')]({'plain':!![]});if(!_0x5d8254)throw new Error(_0x7faa('0x5c'));if(_0x5d8254['role']===_0x7faa('0x5d')){var _0x11d88d=_0x399174['get']({'plain':!![]});var _0x88f086='FaxAccounts';return db[_0x7faa('0x5e')]['find']({'where':{'name':_0x88f086,'userProfileId':_0x5d8254[_0x7faa('0x5f')]},'raw':!![]})['then'](function(_0x113331){if(_0x113331&&_0x113331[_0x7faa('0x60')]===0x0){return db['UserProfileResource'][_0x7faa('0x59')]({'name':_0x11d88d[_0x7faa('0x38')],'resourceId':_0x11d88d['id'],'type':_0x113331[_0x7faa('0x38')],'sectionId':_0x113331['id']},{})['then'](function(){return _0x399174;});}else{return _0x399174;}})[_0x7faa('0x53')](function(_0x18bc4f){logger[_0x7faa('0x23')](_0x7faa('0x61'),_0x18bc4f);throw _0x18bc4f;});}return _0x399174;})['then'](respondWithResult(_0x4573c0,0xc9))['catch'](handleError(_0x4573c0,null));};exports[_0x7faa('0x31')]=function(_0x1b4b51,_0x332c69){if(_0x1b4b51[_0x7faa('0x5a')]['id']){delete _0x1b4b51['body']['id'];}return db[_0x7faa('0x3d')]['find']({'where':{'id':_0x1b4b51[_0x7faa('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x7faa('0x33')](handleEntityNotFound(_0x332c69,null))[_0x7faa('0x33')](saveUpdates(_0x1b4b51[_0x7faa('0x5a')],null))[_0x7faa('0x33')](respondWithResult(_0x332c69,null))[_0x7faa('0x53')](handleError(_0x332c69,null));};exports[_0x7faa('0x32')]=function(_0x29dcc8,_0x282799){return db[_0x7faa('0x3d')][_0x7faa('0x58')]({'where':{'id':_0x29dcc8['params']['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x282799,null))['then'](removeEntity(_0x282799,null))[_0x7faa('0x53')](handleError(_0x282799,null));};exports[_0x7faa('0x62')]=function(_0x1fafdd,_0x3c7891){return db[_0x7faa('0x3d')][_0x7faa('0x62')]()[_0x7faa('0x33')](respondWithResult(_0x3c7891,null))[_0x7faa('0x53')](handleError(_0x3c7891,null));};exports[_0x7faa('0x63')]=function(_0x711f45,_0x552ce7,_0x50fc65){if(_0x711f45['body']['id']){delete _0x711f45[_0x7faa('0x5a')]['id'];}return db[_0x7faa('0x3d')][_0x7faa('0x58')]({'where':{'id':_0x711f45[_0x7faa('0x55')]['id']}})['then'](handleEntityNotFound(_0x552ce7,null))['then'](function(_0x513639){if(_0x513639){_0x711f45[_0x7faa('0x5a')]['FaxAccountId']=_0x513639['id'];return db[_0x7faa('0x64')][_0x7faa('0x59')](_0x711f45[_0x7faa('0x5a')]);}})[_0x7faa('0x33')](respondWithResult(_0x552ce7,null))['catch'](handleError(_0x552ce7,null));};exports[_0x7faa('0x65')]=function(_0x19a1ab,_0x4f323b,_0x29d7a8){var _0x4d742e={'raw':![],'where':{}};var _0x46911e={};var _0x4ee630={'count':0x0,'rows':[]};return db[_0x7faa('0x3d')][_0x7faa('0x66')]({'where':{'id':_0x19a1ab[_0x7faa('0x55')]['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x4f323b,null))[_0x7faa('0x33')](function(_0x31aba5){if(_0x31aba5){_0x46911e['model']=_['keys'](db[_0x7faa('0x64')][_0x7faa('0x56')]);_0x46911e['query']=_['keys'](_0x19a1ab[_0x7faa('0x3f')]);_0x46911e[_0x7faa('0x48')]=_['intersection'](_0x46911e['model'],_0x46911e[_0x7faa('0x3f')]);_0x4d742e[_0x7faa('0x43')]=_[_0x7faa('0x40')](_0x46911e[_0x7faa('0x41')],qs['fields'](_0x19a1ab[_0x7faa('0x3f')][_0x7faa('0x42')]));_0x4d742e[_0x7faa('0x43')]=_0x4d742e[_0x7faa('0x43')][_0x7faa('0x67')]?_0x4d742e['attributes']:_0x46911e[_0x7faa('0x41')];if(!_0x19a1ab['query'][_0x7faa('0x44')](_0x7faa('0x68'))){_0x4d742e[_0x7faa('0x2b')]=qs['limit'](_0x19a1ab[_0x7faa('0x3f')][_0x7faa('0x2b')]);_0x4d742e['offset']=qs['offset'](_0x19a1ab[_0x7faa('0x3f')]['offset']);}_0x4d742e[_0x7faa('0x45')]=qs['sort'](_0x19a1ab[_0x7faa('0x3f')]['sort']);_0x4d742e[_0x7faa('0x47')]=qs[_0x7faa('0x48')](_[_0x7faa('0x69')](_0x19a1ab[_0x7faa('0x3f')],_0x46911e[_0x7faa('0x48')]));_0x4d742e[_0x7faa('0x47')][_0x7faa('0x6a')]=_0x31aba5['id'];if(_0x19a1ab[_0x7faa('0x3f')][_0x7faa('0x4e')]){_0x4d742e[_0x7faa('0x47')]=_['merge'](_0x4d742e['where'],{'$or':_['map'](_0x4d742e['attributes'],function(_0xebf75){var _0x354e81={};_0x354e81[_0xebf75]={'$like':'%'+_0x19a1ab[_0x7faa('0x3f')]['filter']+'%'};return _0x354e81;})});}_0x4d742e=_[_0x7faa('0x4f')]({},_0x4d742e,_0x19a1ab[_0x7faa('0x50')]);return db[_0x7faa('0x64')][_0x7faa('0x29')]({'where':_0x4d742e[_0x7faa('0x47')]})[_0x7faa('0x33')](function(_0x45c3dc){_0x4ee630[_0x7faa('0x29')]=_0x45c3dc;if(_0x19a1ab[_0x7faa('0x3f')][_0x7faa('0x51')]){_0x4d742e[_0x7faa('0x57')]=[{'all':!![]}];}return db[_0x7faa('0x64')][_0x7faa('0x52')](_0x4d742e);})[_0x7faa('0x33')](function(_0x299694){_0x4ee630[_0x7faa('0x6b')]=_0x299694;return _0x4ee630;});}})['then'](respondWithFilteredResult(_0x4f323b,_0x4d742e))['catch'](handleError(_0x4f323b,null));};exports[_0x7faa('0x6c')]=function(_0x4ea938,_0x306638,_0x4a8930){return db['FaxAccount'][_0x7faa('0x58')]({'where':{'id':_0x4ea938[_0x7faa('0x55')]['id']}})['then'](handleEntityNotFound(_0x306638,null))['then'](function(_0x46f065){if(_0x46f065){return _0x46f065[_0x7faa('0x6c')](_0x4ea938[_0x7faa('0x3f')][_0x7faa('0x6d')]);}})[_0x7faa('0x33')](respondWithStatusCode(_0x306638,null))[_0x7faa('0x53')](handleError(_0x306638,null));};exports[_0x7faa('0x6e')]=function(_0x55de84,_0x3df4ef,_0x201586){if(_0x55de84[_0x7faa('0x5a')]['id']){delete _0x55de84[_0x7faa('0x5a')]['id'];}return db['FaxAccount'][_0x7faa('0x58')]({'where':{'id':_0x55de84['params']['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x3df4ef,null))[_0x7faa('0x33')](function(_0x1f1703){if(_0x1f1703){_0x55de84[_0x7faa('0x5a')][_0x7faa('0x6a')]=_0x1f1703['id'];return db[_0x7faa('0x6f')][_0x7faa('0x59')](_0x55de84[_0x7faa('0x5a')]);}})['then'](respondWithResult(_0x3df4ef,null))[_0x7faa('0x53')](handleError(_0x3df4ef,null));};exports['getAnswers']=function(_0x352a5a,_0x540949,_0x15afb5){var _0x37a48d={'raw':![],'where':{}};var _0x20e5fd={};var _0x36237c={'count':0x0,'rows':[]};return db[_0x7faa('0x3d')][_0x7faa('0x66')]({'where':{'id':_0x352a5a[_0x7faa('0x55')]['id']}})['then'](handleEntityNotFound(_0x540949,null))[_0x7faa('0x33')](function(_0x404be9){if(_0x404be9){_0x20e5fd['model']=_[_0x7faa('0x3e')](db['CannedAnswer'][_0x7faa('0x56')]);_0x20e5fd[_0x7faa('0x3f')]=_[_0x7faa('0x3e')](_0x352a5a[_0x7faa('0x3f')]);_0x20e5fd[_0x7faa('0x48')]=_['intersection'](_0x20e5fd[_0x7faa('0x41')],_0x20e5fd[_0x7faa('0x3f')]);_0x37a48d[_0x7faa('0x43')]=_[_0x7faa('0x40')](_0x20e5fd[_0x7faa('0x41')],qs[_0x7faa('0x42')](_0x352a5a[_0x7faa('0x3f')]['fields']));_0x37a48d[_0x7faa('0x43')]=_0x37a48d[_0x7faa('0x43')][_0x7faa('0x67')]?_0x37a48d[_0x7faa('0x43')]:_0x20e5fd['model'];if(!_0x352a5a[_0x7faa('0x3f')]['hasOwnProperty']('nolimit')){_0x37a48d[_0x7faa('0x2b')]=qs[_0x7faa('0x2b')](_0x352a5a['query'][_0x7faa('0x2b')]);_0x37a48d[_0x7faa('0x2a')]=qs[_0x7faa('0x2a')](_0x352a5a['query'][_0x7faa('0x2a')]);}_0x37a48d[_0x7faa('0x45')]=qs[_0x7faa('0x46')](_0x352a5a[_0x7faa('0x3f')][_0x7faa('0x46')]);_0x37a48d[_0x7faa('0x47')]=qs[_0x7faa('0x48')](_[_0x7faa('0x69')](_0x352a5a[_0x7faa('0x3f')],_0x20e5fd[_0x7faa('0x48')]));_0x37a48d[_0x7faa('0x47')][_0x7faa('0x6a')]=_0x404be9['id'];if(_0x352a5a[_0x7faa('0x3f')][_0x7faa('0x4e')]){_0x37a48d[_0x7faa('0x47')]=_['merge'](_0x37a48d[_0x7faa('0x47')],{'$or':_[_0x7faa('0x49')](_0x37a48d['attributes'],function(_0x16ee5c){var _0x3427d3={};_0x3427d3[_0x16ee5c]={'$like':'%'+_0x352a5a[_0x7faa('0x3f')][_0x7faa('0x4e')]+'%'};return _0x3427d3;})});}_0x37a48d=_[_0x7faa('0x4f')]({},_0x37a48d,_0x352a5a[_0x7faa('0x50')]);return db[_0x7faa('0x6f')][_0x7faa('0x29')]({'where':_0x37a48d[_0x7faa('0x47')]})['then'](function(_0x139fa8){_0x36237c[_0x7faa('0x29')]=_0x139fa8;if(_0x352a5a[_0x7faa('0x3f')][_0x7faa('0x51')]){_0x37a48d[_0x7faa('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7faa('0x52')](_0x37a48d);})['then'](function(_0x3aefeb){_0x36237c['rows']=_0x3aefeb;return _0x36237c;});}})[_0x7faa('0x33')](respondWithFilteredResult(_0x540949,_0x37a48d))[_0x7faa('0x53')](handleError(_0x540949,null));};exports[_0x7faa('0x70')]=function(_0x5f41f2,_0x4727d6,_0x3e6260){return db['FaxAccount'][_0x7faa('0x58')]({'where':{'id':_0x5f41f2['params']['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x4727d6,null))['then'](function(_0x2088c1){if(_0x2088c1){return _0x2088c1[_0x7faa('0x70')](_0x5f41f2[_0x7faa('0x3f')][_0x7faa('0x6d')]);}})['then'](respondWithStatusCode(_0x4727d6,null))[_0x7faa('0x53')](handleError(_0x4727d6,null));};exports['addInteraction']=function(_0x218699,_0x415152,_0x13db1d){return db['FaxInteraction'][_0x7faa('0x58')]({'where':{'id':_0x218699[_0x7faa('0x55')]['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x415152,null))['then'](function(_0x393cad){if(_0x393cad){return _0x393cad[_0x7faa('0x71')](_0x218699[_0x7faa('0x5a')][_0x7faa('0x6d')],_[_0x7faa('0x72')](_0x218699[_0x7faa('0x5a')],[_0x7faa('0x6d'),'id'])||{});}})[_0x7faa('0x33')](respondWithResult(_0x415152,null))[_0x7faa('0x53')](handleError(_0x415152,null));};exports[_0x7faa('0x73')]=function(_0x162776,_0x597013,_0xfd588f){var _0x12df63={'raw':![],'where':{}};var _0x3cab62={};var _0x1be1a2={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x162776[_0x7faa('0x55')]['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x597013,null))[_0x7faa('0x33')](function(_0x537ddc){if(_0x537ddc){_0x3cab62[_0x7faa('0x41')]=_[_0x7faa('0x3e')](db[_0x7faa('0x74')][_0x7faa('0x56')]);_0x3cab62[_0x7faa('0x3f')]=_['keys'](_0x162776['query']);_0x3cab62['filters']=_[_0x7faa('0x40')](_0x3cab62[_0x7faa('0x41')],_0x3cab62['query']);_0x12df63[_0x7faa('0x43')]=_[_0x7faa('0x40')](_0x3cab62[_0x7faa('0x41')],qs[_0x7faa('0x42')](_0x162776[_0x7faa('0x3f')][_0x7faa('0x42')]));_0x12df63['attributes']=_0x12df63['attributes']['length']?_0x12df63[_0x7faa('0x43')]:_0x3cab62[_0x7faa('0x41')];if(!_0x162776['query'][_0x7faa('0x44')](_0x7faa('0x68'))){_0x12df63[_0x7faa('0x2b')]=qs[_0x7faa('0x2b')](_0x162776['query'][_0x7faa('0x2b')]);_0x12df63[_0x7faa('0x2a')]=qs[_0x7faa('0x2a')](_0x162776[_0x7faa('0x3f')][_0x7faa('0x2a')]);}_0x12df63[_0x7faa('0x45')]=qs[_0x7faa('0x46')](_0x162776[_0x7faa('0x3f')][_0x7faa('0x46')]);_0x12df63[_0x7faa('0x47')]=qs['filters'](_[_0x7faa('0x69')](_0x162776[_0x7faa('0x3f')],_0x3cab62[_0x7faa('0x48')]));_0x12df63[_0x7faa('0x47')][_0x7faa('0x6a')]=_0x537ddc['id'];if(_0x162776[_0x7faa('0x3f')]['filter']){_0x12df63[_0x7faa('0x47')]=_[_0x7faa('0x4f')](_0x12df63[_0x7faa('0x47')],{'$or':_[_0x7faa('0x49')](_0x12df63['attributes'],function(_0x394dde){var _0x3ce991={};_0x3ce991[_0x394dde]={'$like':'%'+_0x162776[_0x7faa('0x3f')][_0x7faa('0x4e')]+'%'};return _0x3ce991;})});}_0x12df63=_[_0x7faa('0x4f')]({},_0x12df63,_0x162776['options']);return db[_0x7faa('0x74')][_0x7faa('0x29')]({'where':_0x12df63[_0x7faa('0x47')]})[_0x7faa('0x33')](function(_0x40dce0){_0x1be1a2['count']=_0x40dce0;if(_0x162776[_0x7faa('0x3f')][_0x7faa('0x51')]){_0x12df63['include']=[{'model':db[_0x7faa('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x7faa('0x76'),'attributes':[_0x7faa('0x38'),_0x7faa('0x77'),'internal'],'required':![]},{'model':db[_0x7faa('0x78')],'as':'Tags','attributes':['id',_0x7faa('0x38'),_0x7faa('0x79')],'where':_0x162776['query'][_0x7faa('0x7a')]?{'id':_0x162776[_0x7faa('0x3f')][_0x7faa('0x7a')]}:undefined,'required':_0x162776[_0x7faa('0x3f')][_0x7faa('0x7a')]?!![]:![]}];}return db[_0x7faa('0x74')][_0x7faa('0x52')](_0x12df63);})['then'](function(_0x3c5373){_0x1be1a2[_0x7faa('0x6b')]=_0x3c5373;return _0x1be1a2;});}})[_0x7faa('0x33')](respondWithFilteredResult(_0x597013,_0x12df63))[_0x7faa('0x53')](handleError(_0x597013,null));};exports[_0x7faa('0x7b')]=function(_0x75ea7,_0x470ba4,_0xf73123){return db['FaxAccount']['findOne']({'where':{'id':_0x75ea7[_0x7faa('0x55')]['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x470ba4,null))[_0x7faa('0x33')](function(_0x7328fd){if(_0x7328fd){return db[_0x7faa('0x7c')][_0x7faa('0x7d')](function(_0x4fb545){return db['FaxApplication'][_0x7faa('0x32')]({'where':{'FaxAccountId':_0x75ea7['params']['id']},'transaction':_0x4fb545})['then'](function(_0x2b0f6c){var _0x24fe9b=_[_0x7faa('0x49')](_0x75ea7[_0x7faa('0x5a')],function(_0x25a8a2){_0x25a8a2[_0x7faa('0x6a')]=_0x75ea7[_0x7faa('0x55')]['id'];return _0x25a8a2;});return db[_0x7faa('0x7e')]['bulkCreate'](_0x24fe9b,{'transaction':_0x4fb545});});})[_0x7faa('0x33')](function(){return db['FaxApplication'][_0x7faa('0x7f')]({'where':{'FaxAccountId':_0x75ea7['params']['id']},'order':'priority'});});}})[_0x7faa('0x33')](respondWithResult(_0x470ba4,null))[_0x7faa('0x53')](handleError(_0x470ba4,null));};exports[_0x7faa('0x80')]=function(_0x2b8e47,_0xcd8dd8,_0x4d98ad){var _0x2259ab={};var _0x3c494c={};var _0x19552d;var _0x5e678e;return db['FaxAccount'][_0x7faa('0x66')]({'where':{'id':_0x2b8e47[_0x7faa('0x55')]['id']}})['then'](handleEntityNotFound(_0xcd8dd8,null))['then'](function(_0x3c95b6){if(_0x3c95b6){_0x19552d=_0x3c95b6;_0x3c494c['model']=_[_0x7faa('0x3e')](db[_0x7faa('0x7e')][_0x7faa('0x56')]);_0x3c494c[_0x7faa('0x3f')]=_[_0x7faa('0x3e')](_0x2b8e47['query']);_0x3c494c[_0x7faa('0x48')]=_['intersection'](_0x3c494c[_0x7faa('0x41')],_0x3c494c[_0x7faa('0x3f')]);_0x2259ab['attributes']=_['intersection'](_0x3c494c[_0x7faa('0x41')],qs[_0x7faa('0x42')](_0x2b8e47[_0x7faa('0x3f')][_0x7faa('0x42')]));_0x2259ab[_0x7faa('0x43')]=_0x2259ab[_0x7faa('0x43')][_0x7faa('0x67')]?_0x2259ab['attributes']:_0x3c494c[_0x7faa('0x41')];_0x2259ab[_0x7faa('0x45')]=qs['sort'](_0x2b8e47[_0x7faa('0x3f')][_0x7faa('0x46')]);_0x2259ab[_0x7faa('0x47')]=qs[_0x7faa('0x48')](_[_0x7faa('0x69')](_0x2b8e47['query'],_0x3c494c[_0x7faa('0x48')]));if(_0x2b8e47[_0x7faa('0x3f')][_0x7faa('0x4e')]){_0x2259ab[_0x7faa('0x47')]=_[_0x7faa('0x4f')](_0x2259ab[_0x7faa('0x47')],{'$or':_[_0x7faa('0x49')](_0x2259ab[_0x7faa('0x43')],function(_0x2e1ed8){var _0x404cfb={};_0x404cfb[_0x2e1ed8]={'$like':'%'+_0x2b8e47[_0x7faa('0x3f')][_0x7faa('0x4e')]+'%'};return _0x404cfb;})});}_0x2259ab=_[_0x7faa('0x4f')]({},_0x2259ab,_0x2b8e47[_0x7faa('0x50')]);return _0x19552d[_0x7faa('0x80')](_0x2259ab);}})[_0x7faa('0x33')](function(_0x5dd50e){if(_0x5dd50e){_0x5e678e=_0x5dd50e[_0x7faa('0x67')];if(!_0x2b8e47['query'][_0x7faa('0x44')](_0x7faa('0x68'))){_0x2259ab[_0x7faa('0x2b')]=qs[_0x7faa('0x2b')](_0x2b8e47[_0x7faa('0x3f')][_0x7faa('0x2b')]);_0x2259ab[_0x7faa('0x2a')]=qs[_0x7faa('0x2a')](_0x2b8e47['query'][_0x7faa('0x2a')]);}return _0x19552d[_0x7faa('0x80')](_0x2259ab);}})['then'](function(_0xe24273){if(_0xe24273){return _0xe24273?{'count':_0x5e678e,'rows':_0xe24273}:null;}})[_0x7faa('0x33')](respondWithResult(_0xcd8dd8,null))['catch'](handleError(_0xcd8dd8,null));};function Extension(_0x3f1e85,_0x398dba,_0x200d4e,_0x1aecbd){this['context']=_0x7faa('0x81');this[_0x7faa('0x82')]=_0x3f1e85[_0x7faa('0x83')];this['app']=_0x1aecbd;this[_0x7faa('0x4a')]=_0x7faa('0x84');this[_0x7faa('0x85')]=_0x7faa('0x86');this[_0x7faa('0x6a')]=_0x3f1e85['id'];this[_0x7faa('0x87')]=_0x398dba;this['appdata']=_0x200d4e;}function createExtensionsReciveFax(_0x325764){var _0x4ebb47=0x1;var _0x2e2843=[];_0x2e2843['push'](new Extension(_0x325764,_0x4ebb47,'',_0x7faa('0x88')));_0x4ebb47+=0x1;_0x2e2843[_0x7faa('0x89')](new Extension(_0x325764,_0x4ebb47,'CDR(type)=inbound-fax',_0x7faa('0x8a')));_0x4ebb47+=0x1;for(var _0x3cb1ba in _0x325764){if(_0x325764[_0x7faa('0x44')](_0x3cb1ba)&&(_0x3cb1ba===_0x7faa('0x8b')||_0x3cb1ba===_0x7faa('0x83')||_0x3cb1ba==='gateway'||_0x3cb1ba===_0x7faa('0x8c')||_0x3cb1ba===_0x7faa('0x8d')||_0x3cb1ba===_0x7faa('0x8e')||_0x3cb1ba==='minrate'||_0x3cb1ba===_0x7faa('0x8f')||_0x3cb1ba==='t38timeout')){_0x2e2843['push'](new Extension(_0x325764,_0x4ebb47,_0x7faa('0x90')+_0x3cb1ba+')='+_0x325764[_0x3cb1ba],_0x7faa('0x8a')));_0x4ebb47+=0x1;}}_0x2e2843[_0x7faa('0x89')](new Extension(_0x325764,_0x4ebb47,'6',_0x7faa('0x91')));_0x4ebb47+=0x1;_0x2e2843[_0x7faa('0x89')](new Extension(_0x325764,_0x4ebb47,_0x7faa('0x92'),'ReceiveFax'));_0x4ebb47=0x0;return _0x2e2843;}exports['addAccountApplications']=function(_0x40097c,_0x1be9d9,_0x57ed13){var _0x5e3a6f;return db[_0x7faa('0x7c')][_0x7faa('0x7d')](function(_0x441c5){return db['FaxAccount'][_0x7faa('0x59')](_0x40097c[_0x7faa('0x5a')],{'transaction':_0x441c5})['then'](function(_0x573d9b){_0x5e3a6f=_0x573d9b[_0x7faa('0x5b')]({'plain':!![]});return db['VoiceExtension'][_0x7faa('0x93')](createExtensionsReciveFax(_0x5e3a6f),{'transaction':_0x441c5});});})[_0x7faa('0x33')](function(){return _0x5e3a6f;})[_0x7faa('0x33')](respondWithResult(_0x1be9d9,null))[_0x7faa('0x53')](handleError(_0x1be9d9,null));};exports['updateAccountApplications']=function(_0x5a630e,_0x53903a,_0xbe8f0e){var _0x10805a;return db[_0x7faa('0x7c')][_0x7faa('0x7d')](function(_0x25a99f){return db[_0x7faa('0x3d')]['update'](_0x5a630e[_0x7faa('0x5a')],{'where':{'id':_0x5a630e[_0x7faa('0x5a')]['id']},'transaction':_0x25a99f})[_0x7faa('0x33')](function(_0x3ef168){return db[_0x7faa('0x94')]['destroy']({'where':{'FaxAccountId':_0x5a630e['body']['id']},'transaction':_0x25a99f})[_0x7faa('0x33')](function(_0x4cdc3b){return db[_0x7faa('0x94')]['bulkCreate'](createExtensionsReciveFax(_[_0x7faa('0x72')](_0x5a630e[_0x7faa('0x5a')],[_0x7faa('0x95'),_0x7faa('0x4b'),'createdAt',_0x7faa('0x96'),_0x7faa('0x97'),_0x7faa('0x98')])),{'transaction':_0x25a99f});});});})[_0x7faa('0x33')](function(){return db[_0x7faa('0x3d')][_0x7faa('0x99')](_0x5a630e['body']['id']);})[_0x7faa('0x33')](respondWithResult(_0x53903a,null))[_0x7faa('0x53')](handleError(_0x53903a,null));};exports[_0x7faa('0x9a')]=function(_0x2e6b57,_0x357f12,_0x590ad9){var _0x3c6d62={'raw':!![],'where':{}};var _0x510d2a={};var _0x493d06={'count':0x0,'rows':[]};return db[_0x7faa('0x3d')][_0x7faa('0x66')]({'where':{'id':_0x2e6b57['params']['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x357f12,null))[_0x7faa('0x33')](function(_0x8ce4b5){if(_0x8ce4b5){_0x510d2a[_0x7faa('0x41')]=_[_0x7faa('0x3e')](db['FaxMessage'][_0x7faa('0x56')]);_0x510d2a[_0x7faa('0x3f')]=_[_0x7faa('0x3e')](_0x2e6b57[_0x7faa('0x3f')]);_0x510d2a['filters']=_['intersection'](_0x510d2a[_0x7faa('0x41')],_0x510d2a[_0x7faa('0x3f')]);_0x3c6d62['attributes']=_[_0x7faa('0x40')](_0x510d2a[_0x7faa('0x41')],qs['fields'](_0x2e6b57[_0x7faa('0x3f')]['fields']));_0x3c6d62['attributes']=_0x3c6d62[_0x7faa('0x43')][_0x7faa('0x67')]?_0x3c6d62['attributes']:_0x510d2a['model'];if(!_0x2e6b57[_0x7faa('0x3f')][_0x7faa('0x44')]('nolimit')){_0x3c6d62[_0x7faa('0x2b')]=qs['limit'](_0x2e6b57['query']['limit']);_0x3c6d62['offset']=qs['offset'](_0x2e6b57['query'][_0x7faa('0x2a')]);}_0x3c6d62['order']=qs[_0x7faa('0x46')](_0x2e6b57[_0x7faa('0x3f')]['sort']);_0x3c6d62['where']=qs[_0x7faa('0x48')](_[_0x7faa('0x69')](_0x2e6b57['query'],_0x510d2a[_0x7faa('0x48')]));_0x3c6d62['where']['FaxAccountId']=_0x8ce4b5['id'];if(_0x2e6b57['query'][_0x7faa('0x4e')]){_0x3c6d62[_0x7faa('0x47')]=_[_0x7faa('0x4f')](_0x3c6d62['where'],{'$or':_[_0x7faa('0x49')](_0x3c6d62['attributes'],function(_0x189b05){var _0x32ca78={};_0x32ca78[_0x189b05]={'$like':'%'+_0x2e6b57['query'][_0x7faa('0x4e')]+'%'};return _0x32ca78;})});}if(_0x2e6b57['query']['$gte']){var _0xfd7668=_0x2e6b57['query'][_0x7faa('0x9b')]['split'](',');var _0x44eedc={};_0x44eedc[_0xfd7668[0x0]]={'$gte':moment(_0xfd7668[0x1])[_0x7faa('0x9c')](_0x7faa('0x9d'))};_0x3c6d62[_0x7faa('0x47')]=_[_0x7faa('0x4f')](_0x3c6d62[_0x7faa('0x47')],_0x44eedc);}_0x3c6d62=_['merge']({},_0x3c6d62,_0x2e6b57[_0x7faa('0x50')]);return db[_0x7faa('0x9e')][_0x7faa('0x29')]({'where':_0x3c6d62[_0x7faa('0x47')]})['then'](function(_0x465c9d){_0x493d06['count']=_0x465c9d;if(_0x2e6b57[_0x7faa('0x3f')][_0x7faa('0x51')]){_0x3c6d62[_0x7faa('0x57')]=[{'all':!![]}];}return db['FaxMessage'][_0x7faa('0x52')](_0x3c6d62);})[_0x7faa('0x33')](function(_0x2b8082){_0x493d06[_0x7faa('0x6b')]=_0x2b8082;return _0x493d06;});}})['then'](respondWithFilteredResult(_0x357f12,_0x3c6d62))[_0x7faa('0x53')](handleError(_0x357f12,null));};exports['send']=function(_0x5e1fe2,_0x4485d2,_0x5e05ac){var _0x1390f9,_0x31b72f={},_0x31af80;if(_0x5e1fe2['body']['to']){_0x31af80=_0x5e1fe2['body']['to'][0x0];}return db[_0x7faa('0x3d')][_0x7faa('0x58')]({'where':{'id':_0x5e1fe2[_0x7faa('0x55')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7faa('0x75')],'as':_0x7faa('0x9f'),'where':{'fax':_0x31af80},'limit':0x1,'order':[[_0x7faa('0x96'),_0x7faa('0xa0')]]}]}]})[_0x7faa('0x33')](handleEntityNotFound(_0x4485d2,null))[_0x7faa('0x33')](function(_0x9014f6){_0x1390f9=_0x9014f6;if(_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')]&&_0x5e1fe2[_0x7faa('0x5a')]['attachments']['length']){for(var _0x356286=0x0;_0x356286<_0x5e1fe2[_0x7faa('0x5a')]['attachments'][_0x7faa('0x67')];_0x356286+=0x1){_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][_0x356286]={'filename':_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][_0x356286]['name'],'id':_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][_0x356286]['id'],'path':path[_0x7faa('0xa2')](config[_0x7faa('0xa3')],_0x7faa('0xa4'),_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][_0x356286]['basename'])};}}return respondWithRpcPromise(_0x7faa('0xa5'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x5e1fe2[_0x7faa('0x55')]['id'])?undefined:_0x5e1fe2[_0x7faa('0x55')]['id'],'path':_[_0x7faa('0xa6')](_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][0x0][_0x7faa('0xa7')])?undefined:_0x5e1fe2['body'][_0x7faa('0xa1')][0x0][_0x7faa('0xa7')],'fax':_[_0x7faa('0xa6')](_0x5e1fe2[_0x7faa('0x5a')]['to'][0x0])?undefined:_0x5e1fe2['body']['to'][0x0]},client9002);})['then'](function(){if(_0x1390f9){if(_[_0x7faa('0xa6')](_0x5e1fe2['body'][_0x7faa('0xa8')])){_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa8')]=util[_0x7faa('0x9c')]('\x22%s\x22\x20<%s>',_0x1390f9[_0x7faa('0x38')],_0x1390f9[_0x7faa('0xa9')]);}if(_0x1390f9[_0x7faa('0xaa')]){if(_0x1390f9[_0x7faa('0xaa')][_0x7faa('0x9f')][_0x7faa('0x67')]){return _0x1390f9[_0x7faa('0xaa')][_0x7faa('0x9f')][0x0];}else{return db[_0x7faa('0x75')][_0x7faa('0x59')](_[_0x7faa('0x19')](_0x5e1fe2[_0x7faa('0x5a')],{'firstName':_0x5e1fe2[_0x7faa('0x5a')]['to'][0x0],'phone':_0x5e1fe2['body']['to'][0x0],'fax':_0x5e1fe2[_0x7faa('0x5a')]['to'][0x0],'ListId':_0x1390f9[_0x7faa('0x98')]}));}}else{throw new Error(_0x7faa('0xab'));}}else{throw new Error(_0x7faa('0xac'));}})[_0x7faa('0x33')](function(_0x1ba769){if(_0x1ba769){return db[_0x7faa('0x74')][_0x7faa('0x58')]({'where':{'ContactId':_0x1ba769['id'],'closed':![],'FaxAccountId':_0x1390f9['id']}})[_0x7faa('0x33')](function(_0x179cb7){if(_0x179cb7){return[_0x179cb7,![]];}return db[_0x7faa('0x74')][_0x7faa('0x59')]({'UserId':_0x5e1fe2[_0x7faa('0x5d')]['id'],'ContactId':_0x1ba769['id'],'FaxAccountId':_0x1390f9['id'],'fax':_0x5e1fe2[_0x7faa('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x7faa('0x4f')](_0x5e1fe2[_0x7faa('0x5a')],{'read':![],'body':_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][0x0][_0x7faa('0xad')],'FaxAccountId':_0x1390f9['id'],'UserId':_0x5e1fe2[_0x7faa('0x5d')]['id'],'ContactId':_0x1ba769['id'],'AttachmentId':_0x5e1fe2[_0x7faa('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x7faa('0x9e')],'as':_0x7faa('0xae')}]})['then'](function(_0x3b7714){return[_0x3b7714,!![]];});});}else{throw new Error(_0x7faa('0xaf'));}})[_0x7faa('0xb0')](function(_0x6585ea,_0x1804a8){if(_0x1804a8){return _0x6585ea;}return db[_0x7faa('0x9e')][_0x7faa('0x59')]({'direction':_0x7faa('0xb1'),'read':![],'body':_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][0x0][_0x7faa('0xad')],'FaxAccountId':_0x1390f9['id'],'FaxInteractionId':_0x6585ea['id'],'UserId':_0x5e1fe2[_0x7faa('0x5d')]['id'],'ContactId':_0x6585ea[_0x7faa('0xb2')],'AttachmentId':_0x5e1fe2[_0x7faa('0x5a')]['attachments'][0x0]['id']})[_0x7faa('0x33')](function(_0x928719){_0x6585ea['dataValues'][_0x7faa('0xae')]=[];_0x6585ea[_0x7faa('0xb3')]['Messages']['push'](_0x928719[_0x7faa('0xb3')]);return _0x6585ea;});})[_0x7faa('0x33')](function(_0x3c6133){respondWithRpcPromise(_0x7faa('0xb4'),_0x7faa('0xb4'),{'FaxAccountId':_[_0x7faa('0xa6')](_0x5e1fe2['params']['id'])?undefined:_0x5e1fe2[_0x7faa('0x55')]['id'],'path':_[_0x7faa('0xa6')](_0x5e1fe2[_0x7faa('0x5a')]['attachments'][0x0][_0x7faa('0xa7')])?undefined:_0x5e1fe2['body'][_0x7faa('0xa1')][0x0][_0x7faa('0xa7')],'fax':_[_0x7faa('0xa6')](_0x5e1fe2[_0x7faa('0x5a')]['to'][0x0])?undefined:_0x5e1fe2[_0x7faa('0x5a')]['to'][0x0],'AttachmentId':_0x5e1fe2[_0x7faa('0x5a')][_0x7faa('0xa1')][0x0]['id']},client9002)[_0x7faa('0x33')](function(_0x1f3be7){logger[_0x7faa('0xb5')](_0x7faa('0xb6'),_0x1f3be7);})[_0x7faa('0x53')](function(_0x4bb479){logger[_0x7faa('0xb5')](_0x7faa('0xb6'),_0x4bb479);});return _0x3c6133;})[_0x7faa('0x33')](respondWithResult(_0x4485d2,null))[_0x7faa('0x53')](handleError(_0x4485d2,null));};exports[_0x7faa('0xb7')]=function(_0x516cc4,_0x487672,_0x2bc460){return db[_0x7faa('0x3d')][_0x7faa('0x58')]({'where':{'id':_0x516cc4['params']['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x487672,null))[_0x7faa('0x33')](function(_0x5358dd){if(_0x5358dd){return _0x5358dd[_0x7faa('0xb7')](_0x516cc4[_0x7faa('0x5a')]['ids'],_['omit'](_0x516cc4[_0x7faa('0x5a')],[_0x7faa('0x6d'),'id'])||{})[_0x7faa('0xb0')](function(_0x45edad){for(var _0x4301b4=0x0;_0x4301b4<_0x516cc4[_0x7faa('0x5a')][_0x7faa('0x6d')]['length'];_0x4301b4+=0x1){socket[_0x7faa('0xb8')]('userFaxAccount:save',{'UserId':_0x516cc4[_0x7faa('0x5a')][_0x7faa('0x6d')][_0x4301b4],'FaxAccountId':_0x516cc4[_0x7faa('0x55')]['id']});}return _0x45edad;});}})['then'](respondWithResult(_0x487672,null))[_0x7faa('0x53')](handleError(_0x487672,null));};exports[_0x7faa('0xb9')]=function(_0x131a50,_0x69a721,_0x3c6038){return db[_0x7faa('0x3d')][_0x7faa('0x58')]({'where':{'id':_0x131a50[_0x7faa('0x55')]['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x69a721,null))[_0x7faa('0x33')](function(_0x4011c9){if(_0x4011c9){return _0x4011c9[_0x7faa('0xb9')](_0x131a50[_0x7faa('0x3f')]['ids'])[_0x7faa('0x33')](function(){if(_[_0x7faa('0xba')](_0x131a50[_0x7faa('0x3f')][_0x7faa('0x6d')])){for(var _0x1e010d=0x0;_0x1e010d<_0x131a50[_0x7faa('0x3f')][_0x7faa('0x6d')][_0x7faa('0x67')];_0x1e010d+=0x1){socket[_0x7faa('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x131a50[_0x7faa('0x3f')][_0x7faa('0x6d')][_0x1e010d]),'FaxAccountId':Number(_0x131a50[_0x7faa('0x55')]['id'])});}}else{socket[_0x7faa('0xb8')](_0x7faa('0xbb'),{'UserId':Number(_0x131a50[_0x7faa('0x3f')][_0x7faa('0x6d')]),'FaxAccountId':Number(_0x131a50[_0x7faa('0x55')]['id'])});}});}})[_0x7faa('0x33')](respondWithStatusCode(_0x69a721,null))[_0x7faa('0x53')](handleError(_0x69a721,null));};exports[_0x7faa('0xbc')]=function(_0x12e1f5,_0x13bf3a,_0x1fd357){var _0x11ba81={};var _0x5a75f1={};var _0x1b446c;var _0x224449;return db[_0x7faa('0x3d')][_0x7faa('0x66')]({'where':{'id':_0x12e1f5[_0x7faa('0x55')]['id']}})[_0x7faa('0x33')](handleEntityNotFound(_0x13bf3a,null))[_0x7faa('0x33')](function(_0x2806e3){if(_0x2806e3){_0x1b446c=_0x2806e3;_0x5a75f1[_0x7faa('0x41')]=_[_0x7faa('0x3e')](db[_0x7faa('0xbd')][_0x7faa('0x56')]);_0x5a75f1[_0x7faa('0x3f')]=_['keys'](_0x12e1f5['query']);_0x5a75f1[_0x7faa('0x48')]=_[_0x7faa('0x40')](_0x5a75f1[_0x7faa('0x41')],_0x5a75f1[_0x7faa('0x3f')]);_0x11ba81[_0x7faa('0x43')]=_[_0x7faa('0x40')](_0x5a75f1[_0x7faa('0x41')],qs[_0x7faa('0x42')](_0x12e1f5[_0x7faa('0x3f')][_0x7faa('0x42')]));_0x11ba81[_0x7faa('0x43')]=_0x11ba81[_0x7faa('0x43')][_0x7faa('0x67')]?_0x11ba81['attributes']:_0x5a75f1[_0x7faa('0x41')];_0x11ba81[_0x7faa('0x45')]=qs[_0x7faa('0x46')](_0x12e1f5['query'][_0x7faa('0x46')]);_0x11ba81[_0x7faa('0x47')]=qs[_0x7faa('0x48')](_[_0x7faa('0x69')](_0x12e1f5[_0x7faa('0x3f')],_0x5a75f1['filters']));if(_0x12e1f5[_0x7faa('0x3f')]['filter']){_0x11ba81['where']=_[_0x7faa('0x4f')](_0x11ba81[_0x7faa('0x47')],{'$or':_[_0x7faa('0x49')](_0x11ba81[_0x7faa('0x43')],function(_0x502665){var _0x5cf133={};_0x5cf133[_0x502665]={'$like':'%'+_0x12e1f5[_0x7faa('0x3f')]['filter']+'%'};return _0x5cf133;})});}_0x11ba81=_[_0x7faa('0x4f')]({},_0x11ba81,_0x12e1f5['options']);return _0x1b446c[_0x7faa('0xbc')](_0x11ba81);}})['then'](function(_0x47caa6){if(_0x47caa6){_0x224449=_0x47caa6['length'];if(!_0x12e1f5[_0x7faa('0x3f')][_0x7faa('0x44')](_0x7faa('0x68'))){_0x11ba81[_0x7faa('0x2b')]=qs[_0x7faa('0x2b')](_0x12e1f5['query']['limit']);_0x11ba81[_0x7faa('0x2a')]=qs[_0x7faa('0x2a')](_0x12e1f5[_0x7faa('0x3f')]['offset']);}return _0x1b446c['getAgents'](_0x11ba81);}})[_0x7faa('0x33')](function(_0x36689d){if(_0x36689d){return _0x36689d?{'count':_0x224449,'rows':_0x36689d}:null;}})['then'](respondWithResult(_0x13bf3a,null))[_0x7faa('0x53')](handleError(_0x13bf3a,null));}; \ No newline at end of file +var _0xf4db=['exten','localstationid','app','system','description','appdata','push','Answer','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','basename','CheckAfterSend','isNil','path','from','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./faxAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','get','FaxAccounts','UserProfileResource','destroy','then','end','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','field','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','body','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','FaxAccountId','removeDispositions','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xf4db,0x1cb));var _0xbf4d=function(_0x4c0d67,_0xfc97a){_0x4c0d67=_0x4c0d67-0x0;var _0x5463b3=_0xf4db[_0x4c0d67];return _0x5463b3;};'use strict';var pdf=require(_0xbf4d('0x0'));var emlformat=require(_0xbf4d('0x1'));var rimraf=require(_0xbf4d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4d('0x3'));var moment=require('moment');var BPromise=require(_0xbf4d('0x4'));var Mustache=require(_0xbf4d('0x5'));var util=require(_0xbf4d('0x6'));var path=require('path');var sox=require(_0xbf4d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf4d('0x8'));var squel=require('squel');var crypto=require(_0xbf4d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbf4d('0xa'));var toCsv=require(_0xbf4d('0xb'));var querystring=require(_0xbf4d('0xc'));var Papa=require(_0xbf4d('0xd'));var Redis=require(_0xbf4d('0xe'));var authService=require(_0xbf4d('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf4d('0x10'))(_0xbf4d('0x11'));var utils=require(_0xbf4d('0x12'));var config=require(_0xbf4d('0x13'));var db=require(_0xbf4d('0x14'))['db'];config['redis']=_['defaults'](config[_0xbf4d('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf4d('0x15')]));require(_0xbf4d('0x16'))[_0xbf4d('0x17')](socket);var jayson=require(_0xbf4d('0x18'));var client=jayson[_0xbf4d('0x19')][_0xbf4d('0x1a')]({'port':0x232c});var client9002=jayson[_0xbf4d('0x19')][_0xbf4d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x23c09c,_0x516ff6,_0x251c5b){if(_0x251c5b){var _0x21e24a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21e24a[_0xbf4d('0x1b')](_0x516ff6)){return _0x23c09c;}else{throw new Error(_0xbf4d('0x1c'));}}else{return _0x23c09c;}}function respondWithRpcPromise(_0x10bc73,_0x13aa88,_0xdcd60a,_0x4304e4){return new BPromise(function(_0x5db388,_0x42aa65){var _0x809d57=_0x4304e4||client;return _0x809d57[_0xbf4d('0x1d')](_0x10bc73,_0xdcd60a)['then'](function(_0x2a56c4){logger[_0xbf4d('0x1e')](_0xbf4d('0x1f'),_0x13aa88,_0xbf4d('0x20'));logger['debug'](_0xbf4d('0x21'),_0x13aa88,_0xbf4d('0x20'),JSON[_0xbf4d('0x22')](_0x2a56c4));if(_0x2a56c4[_0xbf4d('0x23')]){if(_0x2a56c4['error'][_0xbf4d('0x24')]===0x1f4){logger['error'](_0xbf4d('0x1f'),_0x13aa88,_0x2a56c4[_0xbf4d('0x23')]['message']);return _0x42aa65(_0x2a56c4[_0xbf4d('0x23')][_0xbf4d('0x25')]);}logger['error'](_0xbf4d('0x1f'),_0x13aa88,_0x2a56c4[_0xbf4d('0x23')][_0xbf4d('0x25')]);return _0x5db388(_0x2a56c4[_0xbf4d('0x23')][_0xbf4d('0x25')]);}else{logger['info'](_0xbf4d('0x1f'),_0x13aa88,_0xbf4d('0x20'));_0x5db388(_0x2a56c4[_0xbf4d('0x26')][_0xbf4d('0x25')]);}})['catch'](function(_0x1c105e){logger['error'](_0xbf4d('0x1f'),_0x13aa88,_0x1c105e);_0x42aa65(_0x1c105e);});});}function respondWithStatusCode(_0x3da6a0,_0x8204fd){_0x8204fd=_0x8204fd||0xcc;return function(_0x359ac3){if(_0x359ac3){return _0x3da6a0[_0xbf4d('0x27')](_0x8204fd);}return _0x3da6a0[_0xbf4d('0x28')](_0x8204fd)['end']();};}function respondWithResult(_0x494e08,_0x4eebd8){_0x4eebd8=_0x4eebd8||0xc8;return function(_0x469865){if(_0x469865){return _0x494e08[_0xbf4d('0x28')](_0x4eebd8)[_0xbf4d('0x29')](_0x469865);}};}function respondWithFilteredResult(_0xda98a0,_0x2bdbbd){return function(_0x7b3a35){if(_0x7b3a35){var _0x553ec6=_0x7b3a35[_0xbf4d('0x2a')],_0x5ca4ef=_0x2bdbbd[_0xbf4d('0x2b')],_0x4a4ab8=_0x2bdbbd[_0xbf4d('0x2b')]+_0x2bdbbd[_0xbf4d('0x2c')],_0x2ed66e;if(_0x4a4ab8>=_0x553ec6){_0x4a4ab8=_0x553ec6;_0x2ed66e=0xc8;}else{_0x2ed66e=0xce;}_0xda98a0[_0xbf4d('0x28')](_0x2ed66e);return _0xda98a0[_0xbf4d('0x2d')](_0xbf4d('0x2e'),_0x5ca4ef+'-'+_0x4a4ab8+'/'+_0x553ec6)[_0xbf4d('0x29')](_0x7b3a35);}return null;};}function patchUpdates(_0x3660f5){return function(_0x2f3831){try{jsonpatch[_0xbf4d('0x2f')](_0x2f3831,_0x3660f5,!![]);}catch(_0x13132b){return BPromise[_0xbf4d('0x30')](_0x13132b);}return _0x2f3831[_0xbf4d('0x31')]();};}function saveUpdates(_0x158089,_0x3f910b){return function(_0x3f7adc){if(_0x3f7adc){return _0x3f7adc['update'](_0x158089)['then'](function(_0x484a1b){return _0x484a1b;});}return null;};}function removeEntity(_0x2ccf28,_0xc27664){return function(_0x25ac97){if(_0x25ac97){return _0x25ac97['destroy']()['then'](function(){var _0x4a5e86=_0x25ac97[_0xbf4d('0x32')]({'plain':!![]});var _0x4731db=_0xbf4d('0x33');return db[_0xbf4d('0x34')][_0xbf4d('0x35')]({'where':{'type':_0x4731db,'resourceId':_0x4a5e86['id']}})[_0xbf4d('0x36')](function(){return _0x25ac97;});})[_0xbf4d('0x36')](function(){_0x2ccf28[_0xbf4d('0x28')](0xcc)[_0xbf4d('0x37')]();});}};}function handleEntityNotFound(_0x78de77,_0x3a2daf){return function(_0x374287){if(!_0x374287){_0x78de77['sendStatus'](0x194);}return _0x374287;};}function handleError(_0x57ce64,_0x4c2f6b){_0x4c2f6b=_0x4c2f6b||0x1f4;return function(_0x2564e6){logger['error'](_0x2564e6[_0xbf4d('0x38')]);if(_0x2564e6[_0xbf4d('0x39')]){delete _0x2564e6[_0xbf4d('0x39')];}_0x57ce64[_0xbf4d('0x28')](_0x4c2f6b)[_0xbf4d('0x3a')](_0x2564e6);};}exports[_0xbf4d('0x3b')]=function(_0x373767,_0x116ecc){var _0x44658c={'include':[{'model':db[_0xbf4d('0x3c')],'as':_0xbf4d('0x3d')}]},_0x31cdcf={},_0x414c09={'count':0x0,'rows':[]};var _0x4937a7=db[_0xbf4d('0x3e')]['rawAttributes'];_0x31cdcf['model']=_[_0xbf4d('0x3f')](_0x4937a7);_0x31cdcf[_0xbf4d('0x40')]=_[_0xbf4d('0x3f')](_0x373767['query']);_0x31cdcf[_0xbf4d('0x41')]=_[_0xbf4d('0x42')](_0x31cdcf[_0xbf4d('0x43')],_0x31cdcf['query']);_0x44658c[_0xbf4d('0x44')]=_[_0xbf4d('0x42')](_0x31cdcf['model'],qs[_0xbf4d('0x45')](_0x373767[_0xbf4d('0x40')]['fields']));_0x44658c[_0xbf4d('0x44')]=_0x44658c[_0xbf4d('0x44')][_0xbf4d('0x46')]?_0x44658c[_0xbf4d('0x44')]:_0x31cdcf['model'];if(!_0x373767[_0xbf4d('0x40')]['hasOwnProperty'](_0xbf4d('0x47'))){_0x44658c[_0xbf4d('0x2c')]=qs[_0xbf4d('0x2c')](_0x373767['query']['limit']);_0x44658c[_0xbf4d('0x2b')]=qs[_0xbf4d('0x2b')](_0x373767[_0xbf4d('0x40')][_0xbf4d('0x2b')]);}_0x44658c[_0xbf4d('0x48')]=qs[_0xbf4d('0x49')](_0x373767[_0xbf4d('0x40')][_0xbf4d('0x49')]);_0x44658c['where']=qs[_0xbf4d('0x41')](_[_0xbf4d('0x4a')](_0x373767[_0xbf4d('0x40')],_0x31cdcf[_0xbf4d('0x41')]));if(_0x373767[_0xbf4d('0x40')][_0xbf4d('0x4b')]){_0x44658c[_0xbf4d('0x4c')]=_[_0xbf4d('0x4d')](_0x44658c[_0xbf4d('0x4c')],{'$or':_[_0xbf4d('0x4e')](_0x4937a7,function(_0x67ef36){if(_0x67ef36[_0xbf4d('0x4f')]['key']!=='VIRTUAL'){var _0x3b6041={};_0x3b6041[_0x67ef36[_0xbf4d('0x50')]]={'$like':'%'+_0x373767['query'][_0xbf4d('0x4b')]+'%'};return _0x3b6041;}})});}_0x44658c=_[_0xbf4d('0x4d')]({},_0x44658c,_0x373767[_0xbf4d('0x51')]);var _0x5ecb28={'where':_0x44658c[_0xbf4d('0x4c')]};return db[_0xbf4d('0x3e')][_0xbf4d('0x2a')](_0x5ecb28)[_0xbf4d('0x36')](function(_0x8e1a49){_0x414c09[_0xbf4d('0x2a')]=_0x8e1a49;if(_0x373767[_0xbf4d('0x40')]['includeAll']){_0x44658c[_0xbf4d('0x52')]=[{'all':!![]}];}return db[_0xbf4d('0x3e')][_0xbf4d('0x53')](_0x44658c);})['then'](function(_0x51ed5f){_0x414c09[_0xbf4d('0x54')]=_0x51ed5f;return _0x414c09;})['then'](respondWithFilteredResult(_0x116ecc,_0x44658c))['catch'](handleError(_0x116ecc,null));};exports[_0xbf4d('0x55')]=function(_0x217bac,_0x44ab91){var _0x10d443={'raw':![],'where':{'id':_0x217bac[_0xbf4d('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xbf4d('0x3d')}]},_0x3ae43c={};_0x3ae43c[_0xbf4d('0x43')]=_[_0xbf4d('0x3f')](db[_0xbf4d('0x3e')][_0xbf4d('0x57')]);_0x3ae43c[_0xbf4d('0x40')]=_[_0xbf4d('0x3f')](_0x217bac[_0xbf4d('0x40')]);_0x3ae43c[_0xbf4d('0x41')]=_[_0xbf4d('0x42')](_0x3ae43c[_0xbf4d('0x43')],_0x3ae43c['query']);_0x10d443['attributes']=_['intersection'](_0x3ae43c[_0xbf4d('0x43')],qs[_0xbf4d('0x45')](_0x217bac[_0xbf4d('0x40')][_0xbf4d('0x45')]));_0x10d443[_0xbf4d('0x44')]=_0x10d443[_0xbf4d('0x44')]['length']?_0x10d443['attributes']:_0x3ae43c[_0xbf4d('0x43')];if(_0x217bac['query'][_0xbf4d('0x58')]){_0x10d443[_0xbf4d('0x52')]=[{'all':!![]}];}_0x10d443=_[_0xbf4d('0x4d')]({},_0x10d443,_0x217bac['options']);return db['FaxAccount'][_0xbf4d('0x59')](_0x10d443)[_0xbf4d('0x36')](handleEntityNotFound(_0x44ab91,null))[_0xbf4d('0x36')](respondWithResult(_0x44ab91,null))[_0xbf4d('0x5a')](handleError(_0x44ab91,null));};exports['create']=function(_0x4f5e4a,_0x127e1d){return db[_0xbf4d('0x3e')]['create'](_0x4f5e4a['body'],{})[_0xbf4d('0x36')](function(_0x5cf636){var _0x3d1351=_0x4f5e4a[_0xbf4d('0x5b')]['get']({'plain':!![]});if(!_0x3d1351)throw new Error(_0xbf4d('0x5c'));if(_0x3d1351[_0xbf4d('0x5d')]===_0xbf4d('0x5b')){var _0x4a1a68=_0x5cf636['get']({'plain':!![]});var _0x317b5d=_0xbf4d('0x33');return db[_0xbf4d('0x5e')]['find']({'where':{'name':_0x317b5d,'userProfileId':_0x3d1351[_0xbf4d('0x5f')]},'raw':!![]})[_0xbf4d('0x36')](function(_0x47b9ba){if(_0x47b9ba&&_0x47b9ba['autoAssociation']===0x0){return db[_0xbf4d('0x34')]['create']({'name':_0x4a1a68[_0xbf4d('0x39')],'resourceId':_0x4a1a68['id'],'type':_0x47b9ba[_0xbf4d('0x39')],'sectionId':_0x47b9ba['id']},{})[_0xbf4d('0x36')](function(){return _0x5cf636;});}else{return _0x5cf636;}})[_0xbf4d('0x5a')](function(_0x7ec58b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7ec58b);throw _0x7ec58b;});}return _0x5cf636;})[_0xbf4d('0x36')](respondWithResult(_0x127e1d,0xc9))[_0xbf4d('0x5a')](handleError(_0x127e1d,null));};exports[_0xbf4d('0x60')]=function(_0x23e595,_0x913d4c){if(_0x23e595['body']['id']){delete _0x23e595[_0xbf4d('0x61')]['id'];}return db[_0xbf4d('0x3e')][_0xbf4d('0x59')]({'where':{'id':_0x23e595['params']['id']},'include':[{'model':db[_0xbf4d('0x3c')],'as':_0xbf4d('0x3d')}]})[_0xbf4d('0x36')](handleEntityNotFound(_0x913d4c,null))[_0xbf4d('0x36')](saveUpdates(_0x23e595[_0xbf4d('0x61')],null))[_0xbf4d('0x36')](respondWithResult(_0x913d4c,null))[_0xbf4d('0x5a')](handleError(_0x913d4c,null));};exports[_0xbf4d('0x35')]=function(_0x517bbe,_0x29e06f){return db[_0xbf4d('0x3e')]['find']({'where':{'id':_0x517bbe['params']['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x29e06f,null))['then'](removeEntity(_0x29e06f,null))[_0xbf4d('0x5a')](handleError(_0x29e06f,null));};exports[_0xbf4d('0x62')]=function(_0xac4aa8,_0x5d81a1){return db['FaxAccount'][_0xbf4d('0x62')]()[_0xbf4d('0x36')](respondWithResult(_0x5d81a1,null))['catch'](handleError(_0x5d81a1,null));};exports[_0xbf4d('0x63')]=function(_0x5a51d3,_0x317979,_0x944c96){if(_0x5a51d3[_0xbf4d('0x61')]['id']){delete _0x5a51d3['body']['id'];}return db[_0xbf4d('0x3e')]['find']({'where':{'id':_0x5a51d3['params']['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x317979,null))[_0xbf4d('0x36')](function(_0x2c7f90){if(_0x2c7f90){_0x5a51d3[_0xbf4d('0x61')]['FaxAccountId']=_0x2c7f90['id'];return db['Disposition']['create'](_0x5a51d3[_0xbf4d('0x61')]);}})['then'](respondWithResult(_0x317979,null))[_0xbf4d('0x5a')](handleError(_0x317979,null));};exports[_0xbf4d('0x64')]=function(_0x540f6a,_0x518648,_0x74f1eb){var _0x48f142={'raw':![],'where':{}};var _0x2db601={};var _0x390a51={'count':0x0,'rows':[]};return db[_0xbf4d('0x3e')][_0xbf4d('0x65')]({'where':{'id':_0x540f6a['params']['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x518648,null))[_0xbf4d('0x36')](function(_0x1e0a87){if(_0x1e0a87){_0x2db601[_0xbf4d('0x43')]=_[_0xbf4d('0x3f')](db[_0xbf4d('0x66')]['rawAttributes']);_0x2db601[_0xbf4d('0x40')]=_[_0xbf4d('0x3f')](_0x540f6a[_0xbf4d('0x40')]);_0x2db601[_0xbf4d('0x41')]=_[_0xbf4d('0x42')](_0x2db601[_0xbf4d('0x43')],_0x2db601['query']);_0x48f142[_0xbf4d('0x44')]=_['intersection'](_0x2db601['model'],qs[_0xbf4d('0x45')](_0x540f6a['query'][_0xbf4d('0x45')]));_0x48f142[_0xbf4d('0x44')]=_0x48f142['attributes'][_0xbf4d('0x46')]?_0x48f142[_0xbf4d('0x44')]:_0x2db601[_0xbf4d('0x43')];if(!_0x540f6a['query'][_0xbf4d('0x67')](_0xbf4d('0x47'))){_0x48f142['limit']=qs[_0xbf4d('0x2c')](_0x540f6a['query'][_0xbf4d('0x2c')]);_0x48f142[_0xbf4d('0x2b')]=qs[_0xbf4d('0x2b')](_0x540f6a[_0xbf4d('0x40')][_0xbf4d('0x2b')]);}_0x48f142[_0xbf4d('0x48')]=qs[_0xbf4d('0x49')](_0x540f6a[_0xbf4d('0x40')][_0xbf4d('0x49')]);_0x48f142[_0xbf4d('0x4c')]=qs[_0xbf4d('0x41')](_[_0xbf4d('0x4a')](_0x540f6a[_0xbf4d('0x40')],_0x2db601['filters']));_0x48f142[_0xbf4d('0x4c')][_0xbf4d('0x68')]=_0x1e0a87['id'];if(_0x540f6a[_0xbf4d('0x40')]['filter']){_0x48f142[_0xbf4d('0x4c')]=_[_0xbf4d('0x4d')](_0x48f142['where'],{'$or':_[_0xbf4d('0x4e')](_0x48f142[_0xbf4d('0x44')],function(_0x31be19){var _0x16f772={};_0x16f772[_0x31be19]={'$like':'%'+_0x540f6a[_0xbf4d('0x40')][_0xbf4d('0x4b')]+'%'};return _0x16f772;})});}_0x48f142=_[_0xbf4d('0x4d')]({},_0x48f142,_0x540f6a[_0xbf4d('0x51')]);return db[_0xbf4d('0x66')][_0xbf4d('0x2a')]({'where':_0x48f142[_0xbf4d('0x4c')]})[_0xbf4d('0x36')](function(_0x25483e){_0x390a51[_0xbf4d('0x2a')]=_0x25483e;if(_0x540f6a[_0xbf4d('0x40')][_0xbf4d('0x58')]){_0x48f142['include']=[{'all':!![]}];}return db['Disposition'][_0xbf4d('0x53')](_0x48f142);})[_0xbf4d('0x36')](function(_0xcba98d){_0x390a51[_0xbf4d('0x54')]=_0xcba98d;return _0x390a51;});}})[_0xbf4d('0x36')](respondWithFilteredResult(_0x518648,_0x48f142))['catch'](handleError(_0x518648,null));};exports[_0xbf4d('0x69')]=function(_0x1da3e1,_0x201f3e,_0x1cdb0f){return db[_0xbf4d('0x3e')]['find']({'where':{'id':_0x1da3e1['params']['id']}})['then'](handleEntityNotFound(_0x201f3e,null))[_0xbf4d('0x36')](function(_0x13127e){if(_0x13127e){return _0x13127e[_0xbf4d('0x69')](_0x1da3e1[_0xbf4d('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x201f3e,null))[_0xbf4d('0x5a')](handleError(_0x201f3e,null));};exports[_0xbf4d('0x6a')]=function(_0x25f898,_0x5a3a50,_0x39506d){if(_0x25f898[_0xbf4d('0x61')]['id']){delete _0x25f898['body']['id'];}return db['FaxAccount'][_0xbf4d('0x59')]({'where':{'id':_0x25f898['params']['id']}})['then'](handleEntityNotFound(_0x5a3a50,null))[_0xbf4d('0x36')](function(_0x1b25db){if(_0x1b25db){_0x25f898[_0xbf4d('0x61')][_0xbf4d('0x68')]=_0x1b25db['id'];return db[_0xbf4d('0x6b')][_0xbf4d('0x6c')](_0x25f898[_0xbf4d('0x61')]);}})[_0xbf4d('0x36')](respondWithResult(_0x5a3a50,null))[_0xbf4d('0x5a')](handleError(_0x5a3a50,null));};exports[_0xbf4d('0x6d')]=function(_0x4f2c00,_0x5022a3,_0x105cd6){var _0x3096ce={'raw':![],'where':{}};var _0x587c11={};var _0x254ddd={'count':0x0,'rows':[]};return db[_0xbf4d('0x3e')][_0xbf4d('0x65')]({'where':{'id':_0x4f2c00[_0xbf4d('0x56')]['id']}})['then'](handleEntityNotFound(_0x5022a3,null))[_0xbf4d('0x36')](function(_0x242cde){if(_0x242cde){_0x587c11['model']=_['keys'](db[_0xbf4d('0x6b')][_0xbf4d('0x57')]);_0x587c11[_0xbf4d('0x40')]=_[_0xbf4d('0x3f')](_0x4f2c00[_0xbf4d('0x40')]);_0x587c11[_0xbf4d('0x41')]=_['intersection'](_0x587c11[_0xbf4d('0x43')],_0x587c11[_0xbf4d('0x40')]);_0x3096ce[_0xbf4d('0x44')]=_['intersection'](_0x587c11['model'],qs[_0xbf4d('0x45')](_0x4f2c00['query'][_0xbf4d('0x45')]));_0x3096ce[_0xbf4d('0x44')]=_0x3096ce[_0xbf4d('0x44')][_0xbf4d('0x46')]?_0x3096ce['attributes']:_0x587c11[_0xbf4d('0x43')];if(!_0x4f2c00[_0xbf4d('0x40')][_0xbf4d('0x67')]('nolimit')){_0x3096ce[_0xbf4d('0x2c')]=qs[_0xbf4d('0x2c')](_0x4f2c00['query'][_0xbf4d('0x2c')]);_0x3096ce[_0xbf4d('0x2b')]=qs[_0xbf4d('0x2b')](_0x4f2c00['query']['offset']);}_0x3096ce[_0xbf4d('0x48')]=qs[_0xbf4d('0x49')](_0x4f2c00[_0xbf4d('0x40')]['sort']);_0x3096ce['where']=qs['filters'](_['pick'](_0x4f2c00['query'],_0x587c11[_0xbf4d('0x41')]));_0x3096ce[_0xbf4d('0x4c')][_0xbf4d('0x68')]=_0x242cde['id'];if(_0x4f2c00[_0xbf4d('0x40')]['filter']){_0x3096ce[_0xbf4d('0x4c')]=_[_0xbf4d('0x4d')](_0x3096ce[_0xbf4d('0x4c')],{'$or':_[_0xbf4d('0x4e')](_0x3096ce['attributes'],function(_0x2e77c1){var _0x290b2c={};_0x290b2c[_0x2e77c1]={'$like':'%'+_0x4f2c00[_0xbf4d('0x40')][_0xbf4d('0x4b')]+'%'};return _0x290b2c;})});}_0x3096ce=_[_0xbf4d('0x4d')]({},_0x3096ce,_0x4f2c00[_0xbf4d('0x51')]);return db[_0xbf4d('0x6b')]['count']({'where':_0x3096ce[_0xbf4d('0x4c')]})[_0xbf4d('0x36')](function(_0x587075){_0x254ddd['count']=_0x587075;if(_0x4f2c00['query']['includeAll']){_0x3096ce[_0xbf4d('0x52')]=[{'all':!![]}];}return db[_0xbf4d('0x6b')][_0xbf4d('0x53')](_0x3096ce);})['then'](function(_0x58884b){_0x254ddd[_0xbf4d('0x54')]=_0x58884b;return _0x254ddd;});}})['then'](respondWithFilteredResult(_0x5022a3,_0x3096ce))[_0xbf4d('0x5a')](handleError(_0x5022a3,null));};exports[_0xbf4d('0x6e')]=function(_0x3213e5,_0x13d6bf,_0xbcd743){return db[_0xbf4d('0x3e')][_0xbf4d('0x59')]({'where':{'id':_0x3213e5['params']['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x13d6bf,null))[_0xbf4d('0x36')](function(_0x3ce30e){if(_0x3ce30e){return _0x3ce30e['removeAnswers'](_0x3213e5[_0xbf4d('0x40')][_0xbf4d('0x6f')]);}})['then'](respondWithStatusCode(_0x13d6bf,null))[_0xbf4d('0x5a')](handleError(_0x13d6bf,null));};exports[_0xbf4d('0x70')]=function(_0x22019d,_0x259809,_0x3f329a){return db[_0xbf4d('0x71')][_0xbf4d('0x59')]({'where':{'id':_0x22019d[_0xbf4d('0x56')]['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x259809,null))['then'](function(_0x66a42d){if(_0x66a42d){return _0x66a42d[_0xbf4d('0x70')](_0x22019d['body']['ids'],_[_0xbf4d('0x72')](_0x22019d['body'],[_0xbf4d('0x6f'),'id'])||{});}})[_0xbf4d('0x36')](respondWithResult(_0x259809,null))[_0xbf4d('0x5a')](handleError(_0x259809,null));};exports[_0xbf4d('0x73')]=function(_0x3605a6,_0x39a446,_0xa8b5bf){var _0x5b1a46={'raw':![],'where':{}};var _0x4c3145={};var _0x1fd685={'count':0x0,'rows':[]};return db[_0xbf4d('0x3e')][_0xbf4d('0x65')]({'where':{'id':_0x3605a6['params']['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x39a446,null))[_0xbf4d('0x36')](function(_0x69c195){if(_0x69c195){_0x4c3145['model']=_[_0xbf4d('0x3f')](db[_0xbf4d('0x71')][_0xbf4d('0x57')]);_0x4c3145[_0xbf4d('0x40')]=_[_0xbf4d('0x3f')](_0x3605a6[_0xbf4d('0x40')]);_0x4c3145[_0xbf4d('0x41')]=_[_0xbf4d('0x42')](_0x4c3145[_0xbf4d('0x43')],_0x4c3145[_0xbf4d('0x40')]);_0x5b1a46[_0xbf4d('0x44')]=_[_0xbf4d('0x42')](_0x4c3145[_0xbf4d('0x43')],qs[_0xbf4d('0x45')](_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x45')]));_0x5b1a46[_0xbf4d('0x44')]=_0x5b1a46[_0xbf4d('0x44')][_0xbf4d('0x46')]?_0x5b1a46[_0xbf4d('0x44')]:_0x4c3145[_0xbf4d('0x43')];if(!_0x3605a6[_0xbf4d('0x40')]['hasOwnProperty'](_0xbf4d('0x47'))){_0x5b1a46[_0xbf4d('0x2c')]=qs[_0xbf4d('0x2c')](_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x2c')]);_0x5b1a46[_0xbf4d('0x2b')]=qs[_0xbf4d('0x2b')](_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x2b')]);}_0x5b1a46[_0xbf4d('0x48')]=qs[_0xbf4d('0x49')](_0x3605a6[_0xbf4d('0x40')]['sort']);_0x5b1a46[_0xbf4d('0x4c')]=qs[_0xbf4d('0x41')](_[_0xbf4d('0x4a')](_0x3605a6[_0xbf4d('0x40')],_0x4c3145[_0xbf4d('0x41')]));_0x5b1a46[_0xbf4d('0x4c')][_0xbf4d('0x68')]=_0x69c195['id'];if(_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x4b')]){_0x5b1a46[_0xbf4d('0x4c')]=_[_0xbf4d('0x4d')](_0x5b1a46[_0xbf4d('0x4c')],{'$or':_[_0xbf4d('0x4e')](_0x5b1a46[_0xbf4d('0x44')],function(_0x2cebcc){var _0x3b1494={};_0x3b1494[_0x2cebcc]={'$like':'%'+_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x4b')]+'%'};return _0x3b1494;})});}_0x5b1a46=_['merge']({},_0x5b1a46,_0x3605a6['options']);return db['FaxInteraction'][_0xbf4d('0x2a')]({'where':_0x5b1a46['where']})[_0xbf4d('0x36')](function(_0x288cae){_0x1fd685['count']=_0x288cae;if(_0x3605a6[_0xbf4d('0x40')]['includeAll']){_0x5b1a46[_0xbf4d('0x52')]=[{'model':db[_0xbf4d('0x74')],'as':_0xbf4d('0x75'),'required':![]},{'model':db[_0xbf4d('0x76')],'as':_0xbf4d('0x77'),'attributes':[_0xbf4d('0x39'),_0xbf4d('0x78'),_0xbf4d('0x79')],'required':![]},{'model':db[_0xbf4d('0x7a')],'as':_0xbf4d('0x7b'),'attributes':['id',_0xbf4d('0x39'),_0xbf4d('0x7c')],'where':_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x7d')]?{'id':_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x7d')]}:undefined,'required':_0x3605a6[_0xbf4d('0x40')][_0xbf4d('0x7d')]?!![]:![]}];}return db[_0xbf4d('0x71')][_0xbf4d('0x53')](_0x5b1a46);})['then'](function(_0x531e07){_0x1fd685[_0xbf4d('0x54')]=_0x531e07;return _0x1fd685;});}})[_0xbf4d('0x36')](respondWithFilteredResult(_0x39a446,_0x5b1a46))[_0xbf4d('0x5a')](handleError(_0x39a446,null));};exports[_0xbf4d('0x7e')]=function(_0x2e39d7,_0x202f48,_0x374035){return db[_0xbf4d('0x3e')][_0xbf4d('0x65')]({'where':{'id':_0x2e39d7[_0xbf4d('0x56')]['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x202f48,null))['then'](function(_0x3df96d){if(_0x3df96d){return db[_0xbf4d('0x7f')]['transaction'](function(_0x69cbc5){return db[_0xbf4d('0x80')][_0xbf4d('0x35')]({'where':{'FaxAccountId':_0x2e39d7[_0xbf4d('0x56')]['id']},'transaction':_0x69cbc5})[_0xbf4d('0x36')](function(_0x2c31d1){var _0x397c9b=_[_0xbf4d('0x4e')](_0x2e39d7[_0xbf4d('0x61')],function(_0x42f8ce){_0x42f8ce[_0xbf4d('0x68')]=_0x2e39d7[_0xbf4d('0x56')]['id'];return _0x42f8ce;});return db[_0xbf4d('0x80')][_0xbf4d('0x81')](_0x397c9b,{'transaction':_0x69cbc5});});})[_0xbf4d('0x36')](function(){return db[_0xbf4d('0x80')][_0xbf4d('0x82')]({'where':{'FaxAccountId':_0x2e39d7[_0xbf4d('0x56')]['id']},'order':_0xbf4d('0x83')});});}})['then'](respondWithResult(_0x202f48,null))[_0xbf4d('0x5a')](handleError(_0x202f48,null));};exports['getApplications']=function(_0x210a07,_0xfc0ef5,_0x4725e2){var _0x4a1416={};var _0x39443d={};var _0x3ef2c1;var _0x2445cb;return db['FaxAccount'][_0xbf4d('0x65')]({'where':{'id':_0x210a07[_0xbf4d('0x56')]['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0xfc0ef5,null))[_0xbf4d('0x36')](function(_0x46dd55){if(_0x46dd55){_0x3ef2c1=_0x46dd55;_0x39443d[_0xbf4d('0x43')]=_[_0xbf4d('0x3f')](db[_0xbf4d('0x80')]['rawAttributes']);_0x39443d['query']=_[_0xbf4d('0x3f')](_0x210a07[_0xbf4d('0x40')]);_0x39443d['filters']=_[_0xbf4d('0x42')](_0x39443d['model'],_0x39443d['query']);_0x4a1416['attributes']=_[_0xbf4d('0x42')](_0x39443d[_0xbf4d('0x43')],qs[_0xbf4d('0x45')](_0x210a07[_0xbf4d('0x40')]['fields']));_0x4a1416[_0xbf4d('0x44')]=_0x4a1416[_0xbf4d('0x44')][_0xbf4d('0x46')]?_0x4a1416[_0xbf4d('0x44')]:_0x39443d[_0xbf4d('0x43')];_0x4a1416[_0xbf4d('0x48')]=qs['sort'](_0x210a07[_0xbf4d('0x40')][_0xbf4d('0x49')]);_0x4a1416[_0xbf4d('0x4c')]=qs['filters'](_['pick'](_0x210a07[_0xbf4d('0x40')],_0x39443d[_0xbf4d('0x41')]));if(_0x210a07['query'][_0xbf4d('0x4b')]){_0x4a1416['where']=_[_0xbf4d('0x4d')](_0x4a1416[_0xbf4d('0x4c')],{'$or':_[_0xbf4d('0x4e')](_0x4a1416[_0xbf4d('0x44')],function(_0x722047){var _0x5280f2={};_0x5280f2[_0x722047]={'$like':'%'+_0x210a07['query'][_0xbf4d('0x4b')]+'%'};return _0x5280f2;})});}_0x4a1416=_[_0xbf4d('0x4d')]({},_0x4a1416,_0x210a07['options']);return _0x3ef2c1[_0xbf4d('0x84')](_0x4a1416);}})[_0xbf4d('0x36')](function(_0x39b517){if(_0x39b517){_0x2445cb=_0x39b517[_0xbf4d('0x46')];if(!_0x210a07['query'][_0xbf4d('0x67')](_0xbf4d('0x47'))){_0x4a1416['limit']=qs['limit'](_0x210a07[_0xbf4d('0x40')]['limit']);_0x4a1416[_0xbf4d('0x2b')]=qs[_0xbf4d('0x2b')](_0x210a07[_0xbf4d('0x40')][_0xbf4d('0x2b')]);}return _0x3ef2c1[_0xbf4d('0x84')](_0x4a1416);}})['then'](function(_0x3b50fc){if(_0x3b50fc){return _0x3b50fc?{'count':_0x2445cb,'rows':_0x3b50fc}:null;}})[_0xbf4d('0x36')](respondWithResult(_0xfc0ef5,null))['catch'](handleError(_0xfc0ef5,null));};function Extension(_0x33b35d,_0xd5cbb2,_0x1eec1d,_0x409167){this[_0xbf4d('0x85')]=_0xbf4d('0x86');this[_0xbf4d('0x87')]=_0x33b35d[_0xbf4d('0x88')];this[_0xbf4d('0x89')]=_0x409167;this[_0xbf4d('0x4f')]=_0xbf4d('0x8a');this[_0xbf4d('0x8b')]='Fax\x20Extension';this['FaxAccountId']=_0x33b35d['id'];this[_0xbf4d('0x83')]=_0xd5cbb2;this[_0xbf4d('0x8c')]=_0x1eec1d;}function createExtensionsReciveFax(_0xb29ee8){var _0x16f5ba=0x1;var _0x5f2a67=[];_0x5f2a67[_0xbf4d('0x8d')](new Extension(_0xb29ee8,_0x16f5ba,'',_0xbf4d('0x8e')));_0x16f5ba+=0x1;_0x5f2a67['push'](new Extension(_0xb29ee8,_0x16f5ba,'CDR(type)=inbound-fax',_0xbf4d('0x8f')));_0x16f5ba+=0x1;for(var _0x4251f2 in _0xb29ee8){if(_0xb29ee8[_0xbf4d('0x67')](_0x4251f2)&&(_0x4251f2==='ecm'||_0x4251f2==='localstationid'||_0x4251f2===_0xbf4d('0x90')||_0x4251f2===_0xbf4d('0x91')||_0x4251f2===_0xbf4d('0x92')||_0x4251f2===_0xbf4d('0x93')||_0x4251f2===_0xbf4d('0x94')||_0x4251f2===_0xbf4d('0x95')||_0x4251f2===_0xbf4d('0x96'))){_0x5f2a67['push'](new Extension(_0xb29ee8,_0x16f5ba,'FAXOPT('+_0x4251f2+')='+_0xb29ee8[_0x4251f2],_0xbf4d('0x8f')));_0x16f5ba+=0x1;}}_0x5f2a67[_0xbf4d('0x8d')](new Extension(_0xb29ee8,_0x16f5ba,'6','Wait'));_0x16f5ba+=0x1;_0x5f2a67[_0xbf4d('0x8d')](new Extension(_0xb29ee8,_0x16f5ba,_0xbf4d('0x97'),_0xbf4d('0x98')));_0x16f5ba=0x0;return _0x5f2a67;}exports[_0xbf4d('0x99')]=function(_0x55af83,_0x450a11,_0x403840){var _0x32fa00;return db[_0xbf4d('0x7f')][_0xbf4d('0x9a')](function(_0x1be2b4){return db[_0xbf4d('0x3e')]['create'](_0x55af83['body'],{'transaction':_0x1be2b4})[_0xbf4d('0x36')](function(_0x1d6465){_0x32fa00=_0x1d6465[_0xbf4d('0x32')]({'plain':!![]});return db['VoiceExtension'][_0xbf4d('0x81')](createExtensionsReciveFax(_0x32fa00),{'transaction':_0x1be2b4});});})[_0xbf4d('0x36')](function(){return _0x32fa00;})[_0xbf4d('0x36')](respondWithResult(_0x450a11,null))[_0xbf4d('0x5a')](handleError(_0x450a11,null));};exports[_0xbf4d('0x9b')]=function(_0x582e74,_0x15f672,_0x5c3b59){var _0x5b2765;return db[_0xbf4d('0x7f')][_0xbf4d('0x9a')](function(_0x4b8655){return db[_0xbf4d('0x3e')][_0xbf4d('0x60')](_0x582e74[_0xbf4d('0x61')],{'where':{'id':_0x582e74['body']['id']},'transaction':_0x4b8655})['then'](function(_0x5e6a71){return db[_0xbf4d('0x9c')]['destroy']({'where':{'FaxAccountId':_0x582e74[_0xbf4d('0x61')]['id']},'transaction':_0x4b8655})['then'](function(_0x19a27f){return db[_0xbf4d('0x9c')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x582e74[_0xbf4d('0x61')],[_0xbf4d('0x9d'),'key',_0xbf4d('0x9e'),_0xbf4d('0x9f'),_0xbf4d('0xa0'),_0xbf4d('0xa1')])),{'transaction':_0x4b8655});});});})['then'](function(){return db[_0xbf4d('0x3e')][_0xbf4d('0xa2')](_0x582e74['body']['id']);})['then'](respondWithResult(_0x15f672,null))[_0xbf4d('0x5a')](handleError(_0x15f672,null));};exports[_0xbf4d('0xa3')]=function(_0x2df089,_0xf8ff57,_0x1b2c8a){var _0x4c3cbb={'raw':!![],'where':{}};var _0x962150={};var _0x2bb7ef={'count':0x0,'rows':[]};return db[_0xbf4d('0x3e')][_0xbf4d('0x65')]({'where':{'id':_0x2df089[_0xbf4d('0x56')]['id']}})['then'](handleEntityNotFound(_0xf8ff57,null))['then'](function(_0x6adc24){if(_0x6adc24){_0x962150[_0xbf4d('0x43')]=_[_0xbf4d('0x3f')](db[_0xbf4d('0xa4')][_0xbf4d('0x57')]);_0x962150[_0xbf4d('0x40')]=_['keys'](_0x2df089[_0xbf4d('0x40')]);_0x962150['filters']=_['intersection'](_0x962150[_0xbf4d('0x43')],_0x962150[_0xbf4d('0x40')]);_0x4c3cbb[_0xbf4d('0x44')]=_[_0xbf4d('0x42')](_0x962150[_0xbf4d('0x43')],qs['fields'](_0x2df089['query'][_0xbf4d('0x45')]));_0x4c3cbb[_0xbf4d('0x44')]=_0x4c3cbb['attributes'][_0xbf4d('0x46')]?_0x4c3cbb[_0xbf4d('0x44')]:_0x962150['model'];if(!_0x2df089['query'][_0xbf4d('0x67')](_0xbf4d('0x47'))){_0x4c3cbb['limit']=qs['limit'](_0x2df089['query'][_0xbf4d('0x2c')]);_0x4c3cbb[_0xbf4d('0x2b')]=qs[_0xbf4d('0x2b')](_0x2df089['query'][_0xbf4d('0x2b')]);}_0x4c3cbb[_0xbf4d('0x48')]=qs[_0xbf4d('0x49')](_0x2df089[_0xbf4d('0x40')][_0xbf4d('0x49')]);_0x4c3cbb[_0xbf4d('0x4c')]=qs[_0xbf4d('0x41')](_[_0xbf4d('0x4a')](_0x2df089[_0xbf4d('0x40')],_0x962150[_0xbf4d('0x41')]));_0x4c3cbb[_0xbf4d('0x4c')]['FaxAccountId']=_0x6adc24['id'];if(_0x2df089[_0xbf4d('0x40')][_0xbf4d('0x4b')]){_0x4c3cbb[_0xbf4d('0x4c')]=_[_0xbf4d('0x4d')](_0x4c3cbb[_0xbf4d('0x4c')],{'$or':_[_0xbf4d('0x4e')](_0x4c3cbb[_0xbf4d('0x44')],function(_0x1b0ad8){var _0xb3d968={};_0xb3d968[_0x1b0ad8]={'$like':'%'+_0x2df089[_0xbf4d('0x40')][_0xbf4d('0x4b')]+'%'};return _0xb3d968;})});}if(_0x2df089[_0xbf4d('0x40')][_0xbf4d('0xa5')]){var _0xb6e63=_0x2df089[_0xbf4d('0x40')][_0xbf4d('0xa5')][_0xbf4d('0xa6')](',');var _0x55a284={};_0x55a284[_0xb6e63[0x0]]={'$gte':moment(_0xb6e63[0x1])[_0xbf4d('0xa7')](_0xbf4d('0xa8'))};_0x4c3cbb[_0xbf4d('0x4c')]=_['merge'](_0x4c3cbb[_0xbf4d('0x4c')],_0x55a284);}_0x4c3cbb=_[_0xbf4d('0x4d')]({},_0x4c3cbb,_0x2df089[_0xbf4d('0x51')]);return db[_0xbf4d('0xa4')][_0xbf4d('0x2a')]({'where':_0x4c3cbb['where']})['then'](function(_0x58e559){_0x2bb7ef[_0xbf4d('0x2a')]=_0x58e559;if(_0x2df089['query'][_0xbf4d('0x58')]){_0x4c3cbb[_0xbf4d('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0xbf4d('0x53')](_0x4c3cbb);})['then'](function(_0x12d253){_0x2bb7ef[_0xbf4d('0x54')]=_0x12d253;return _0x2bb7ef;});}})[_0xbf4d('0x36')](respondWithFilteredResult(_0xf8ff57,_0x4c3cbb))[_0xbf4d('0x5a')](handleError(_0xf8ff57,null));};exports[_0xbf4d('0x3a')]=function(_0x13d44a,_0x3f475a,_0x57e97b){var _0x55e3c9,_0x4e450f={},_0x1d24a1;if(_0x13d44a['body']['to']){_0x1d24a1=_0x13d44a['body']['to'][0x0];}return db['FaxAccount'][_0xbf4d('0x59')]({'where':{'id':_0x13d44a['params']['id']},'include':[{'model':db['CmList'],'as':_0xbf4d('0xa9'),'include':[{'model':db[_0xbf4d('0x74')],'as':_0xbf4d('0xaa'),'where':{'fax':_0x1d24a1},'limit':0x1,'order':[['updatedAt',_0xbf4d('0xab')]]}]}]})['then'](handleEntityNotFound(_0x3f475a,null))[_0xbf4d('0x36')](function(_0x1e812d){_0x55e3c9=_0x1e812d;if(_0x13d44a[_0xbf4d('0x61')]['attachments']&&_0x13d44a[_0xbf4d('0x61')]['attachments'][_0xbf4d('0x46')]){for(var _0x3e707e=0x0;_0x3e707e<_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][_0xbf4d('0x46')];_0x3e707e+=0x1){_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][_0x3e707e]={'filename':_0x13d44a['body'][_0xbf4d('0xac')][_0x3e707e][_0xbf4d('0x39')],'id':_0x13d44a[_0xbf4d('0x61')]['attachments'][_0x3e707e]['id'],'path':path[_0xbf4d('0xad')](config['root'],'server/files/attachments',_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][_0x3e707e][_0xbf4d('0xae')])};}}return respondWithRpcPromise(_0xbf4d('0xaf'),'CheckAfterSend',{'FaxAccountId':_[_0xbf4d('0xb0')](_0x13d44a[_0xbf4d('0x56')]['id'])?undefined:_0x13d44a[_0xbf4d('0x56')]['id'],'path':_[_0xbf4d('0xb0')](_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][0x0][_0xbf4d('0xb1')])?undefined:_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][0x0][_0xbf4d('0xb1')],'fax':_[_0xbf4d('0xb0')](_0x13d44a[_0xbf4d('0x61')]['to'][0x0])?undefined:_0x13d44a[_0xbf4d('0x61')]['to'][0x0]},client9002);})['then'](function(){if(_0x55e3c9){if(_[_0xbf4d('0xb0')](_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xb2')])){_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xb2')]=util[_0xbf4d('0xa7')]('\x22%s\x22\x20<%s>',_0x55e3c9[_0xbf4d('0x39')],_0x55e3c9[_0xbf4d('0xb3')]);}if(_0x55e3c9[_0xbf4d('0xa9')]){if(_0x55e3c9[_0xbf4d('0xa9')]['Contacts'][_0xbf4d('0x46')]){return _0x55e3c9[_0xbf4d('0xa9')][_0xbf4d('0xaa')][0x0];}else{return db[_0xbf4d('0x74')][_0xbf4d('0x6c')](_[_0xbf4d('0xb4')](_0x13d44a['body'],{'firstName':_0x13d44a['body']['to'][0x0],'phone':_0x13d44a[_0xbf4d('0x61')]['to'][0x0],'fax':_0x13d44a['body']['to'][0x0],'ListId':_0x55e3c9[_0xbf4d('0xa1')]}));}}else{throw new Error(_0xbf4d('0xb5'));}}else{throw new Error(_0xbf4d('0xb6'));}})['then'](function(_0x52ff3e){if(_0x52ff3e){return db[_0xbf4d('0x71')]['find']({'where':{'ContactId':_0x52ff3e['id'],'closed':![],'FaxAccountId':_0x55e3c9['id']}})[_0xbf4d('0x36')](function(_0x1f73da){if(_0x1f73da){return[_0x1f73da,![]];}return db[_0xbf4d('0x71')]['create']({'UserId':_0x13d44a[_0xbf4d('0x5b')]['id'],'ContactId':_0x52ff3e['id'],'FaxAccountId':_0x55e3c9['id'],'fax':_0x13d44a[_0xbf4d('0x61')]['to'][0x0],'firstMsgDirection':_0xbf4d('0xb7'),'Messages':[_[_0xbf4d('0x4d')](_0x13d44a[_0xbf4d('0x61')],{'read':![],'body':_0x13d44a['body'][_0xbf4d('0xac')][0x0][_0xbf4d('0xb8')],'FaxAccountId':_0x55e3c9['id'],'UserId':_0x13d44a[_0xbf4d('0x5b')]['id'],'ContactId':_0x52ff3e['id'],'AttachmentId':_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][0x0]['id']})]},{'include':[{'model':db[_0xbf4d('0xa4')],'as':'Messages'}]})[_0xbf4d('0x36')](function(_0x5c321a){return[_0x5c321a,!![]];});});}else{throw new Error(_0xbf4d('0xb9'));}})[_0xbf4d('0xba')](function(_0x195ce2,_0x3d033a){if(_0x3d033a){return _0x195ce2;}return db[_0xbf4d('0xa4')][_0xbf4d('0x6c')]({'direction':_0xbf4d('0xb7'),'read':![],'body':_0x13d44a[_0xbf4d('0x61')]['attachments'][0x0][_0xbf4d('0xb8')],'FaxAccountId':_0x55e3c9['id'],'FaxInteractionId':_0x195ce2['id'],'UserId':_0x13d44a[_0xbf4d('0x5b')]['id'],'ContactId':_0x195ce2['ContactId'],'AttachmentId':_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][0x0]['id']})[_0xbf4d('0x36')](function(_0x4f3b21){_0x195ce2[_0xbf4d('0xbb')]['Messages']=[];_0x195ce2[_0xbf4d('0xbb')][_0xbf4d('0xbc')][_0xbf4d('0x8d')](_0x4f3b21[_0xbf4d('0xbb')]);return _0x195ce2;});})['then'](function(_0x1a0174){respondWithRpcPromise(_0xbf4d('0xbd'),_0xbf4d('0xbd'),{'FaxAccountId':_[_0xbf4d('0xb0')](_0x13d44a[_0xbf4d('0x56')]['id'])?undefined:_0x13d44a['params']['id'],'path':_[_0xbf4d('0xb0')](_0x13d44a[_0xbf4d('0x61')]['attachments'][0x0]['path'])?undefined:_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][0x0][_0xbf4d('0xb1')],'fax':_[_0xbf4d('0xb0')](_0x13d44a[_0xbf4d('0x61')]['to'][0x0])?undefined:_0x13d44a[_0xbf4d('0x61')]['to'][0x0],'AttachmentId':_0x13d44a[_0xbf4d('0x61')][_0xbf4d('0xac')][0x0]['id']},client9002)['then'](function(_0x270854){logger['info']('SendFaxRpc,\x20%s',_0x270854);})[_0xbf4d('0x5a')](function(_0x480907){logger[_0xbf4d('0x1e')](_0xbf4d('0xbe'),_0x480907);});return _0x1a0174;})[_0xbf4d('0x36')](respondWithResult(_0x3f475a,null))['catch'](handleError(_0x3f475a,null));};exports[_0xbf4d('0xbf')]=function(_0x5343a7,_0x4457fa,_0x2e78af){return db[_0xbf4d('0x3e')]['find']({'where':{'id':_0x5343a7[_0xbf4d('0x56')]['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x4457fa,null))[_0xbf4d('0x36')](function(_0x974003){if(_0x974003){return _0x974003[_0xbf4d('0xbf')](_0x5343a7['body']['ids'],_['omit'](_0x5343a7['body'],[_0xbf4d('0x6f'),'id'])||{})[_0xbf4d('0xba')](function(_0x1f2f66){for(var _0x447e2e=0x0;_0x447e2e<_0x5343a7[_0xbf4d('0x61')][_0xbf4d('0x6f')]['length'];_0x447e2e+=0x1){socket[_0xbf4d('0xc0')](_0xbf4d('0xc1'),{'UserId':_0x5343a7[_0xbf4d('0x61')][_0xbf4d('0x6f')][_0x447e2e],'FaxAccountId':_0x5343a7[_0xbf4d('0x56')]['id']});}return _0x1f2f66;});}})[_0xbf4d('0x36')](respondWithResult(_0x4457fa,null))[_0xbf4d('0x5a')](handleError(_0x4457fa,null));};exports[_0xbf4d('0xc2')]=function(_0x52cffa,_0x3d096e,_0x27577b){return db[_0xbf4d('0x3e')][_0xbf4d('0x59')]({'where':{'id':_0x52cffa['params']['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x3d096e,null))[_0xbf4d('0x36')](function(_0x5a0676){if(_0x5a0676){return _0x5a0676['removeAgents'](_0x52cffa[_0xbf4d('0x40')]['ids'])[_0xbf4d('0x36')](function(){if(_[_0xbf4d('0xc3')](_0x52cffa[_0xbf4d('0x40')][_0xbf4d('0x6f')])){for(var _0x32fd7f=0x0;_0x32fd7f<_0x52cffa[_0xbf4d('0x40')][_0xbf4d('0x6f')]['length'];_0x32fd7f+=0x1){socket[_0xbf4d('0xc0')](_0xbf4d('0xc4'),{'UserId':Number(_0x52cffa['query'][_0xbf4d('0x6f')][_0x32fd7f]),'FaxAccountId':Number(_0x52cffa['params']['id'])});}}else{socket['emit'](_0xbf4d('0xc4'),{'UserId':Number(_0x52cffa[_0xbf4d('0x40')][_0xbf4d('0x6f')]),'FaxAccountId':Number(_0x52cffa['params']['id'])});}});}})[_0xbf4d('0x36')](respondWithStatusCode(_0x3d096e,null))[_0xbf4d('0x5a')](handleError(_0x3d096e,null));};exports[_0xbf4d('0xc5')]=function(_0x4f2650,_0x10d628,_0x1c41e7){var _0x49b63e={};var _0x334132={};var _0x5bd6e9;var _0x534a0f;return db[_0xbf4d('0x3e')][_0xbf4d('0x65')]({'where':{'id':_0x4f2650[_0xbf4d('0x56')]['id']}})[_0xbf4d('0x36')](handleEntityNotFound(_0x10d628,null))['then'](function(_0x4e3fd1){if(_0x4e3fd1){_0x5bd6e9=_0x4e3fd1;_0x334132[_0xbf4d('0x43')]=_[_0xbf4d('0x3f')](db['User']['rawAttributes']);_0x334132[_0xbf4d('0x40')]=_[_0xbf4d('0x3f')](_0x4f2650[_0xbf4d('0x40')]);_0x334132[_0xbf4d('0x41')]=_[_0xbf4d('0x42')](_0x334132[_0xbf4d('0x43')],_0x334132['query']);_0x49b63e['attributes']=_['intersection'](_0x334132[_0xbf4d('0x43')],qs['fields'](_0x4f2650[_0xbf4d('0x40')]['fields']));_0x49b63e[_0xbf4d('0x44')]=_0x49b63e[_0xbf4d('0x44')][_0xbf4d('0x46')]?_0x49b63e['attributes']:_0x334132['model'];_0x49b63e[_0xbf4d('0x48')]=qs[_0xbf4d('0x49')](_0x4f2650['query'][_0xbf4d('0x49')]);_0x49b63e[_0xbf4d('0x4c')]=qs[_0xbf4d('0x41')](_[_0xbf4d('0x4a')](_0x4f2650[_0xbf4d('0x40')],_0x334132[_0xbf4d('0x41')]));if(_0x4f2650[_0xbf4d('0x40')][_0xbf4d('0x4b')]){_0x49b63e[_0xbf4d('0x4c')]=_['merge'](_0x49b63e[_0xbf4d('0x4c')],{'$or':_[_0xbf4d('0x4e')](_0x49b63e[_0xbf4d('0x44')],function(_0x1b447d){var _0x5887a8={};_0x5887a8[_0x1b447d]={'$like':'%'+_0x4f2650[_0xbf4d('0x40')][_0xbf4d('0x4b')]+'%'};return _0x5887a8;})});}_0x49b63e=_[_0xbf4d('0x4d')]({},_0x49b63e,_0x4f2650[_0xbf4d('0x51')]);return _0x5bd6e9[_0xbf4d('0xc5')](_0x49b63e);}})[_0xbf4d('0x36')](function(_0x4ca12a){if(_0x4ca12a){_0x534a0f=_0x4ca12a['length'];if(!_0x4f2650[_0xbf4d('0x40')][_0xbf4d('0x67')](_0xbf4d('0x47'))){_0x49b63e[_0xbf4d('0x2c')]=qs[_0xbf4d('0x2c')](_0x4f2650[_0xbf4d('0x40')][_0xbf4d('0x2c')]);_0x49b63e['offset']=qs[_0xbf4d('0x2b')](_0x4f2650[_0xbf4d('0x40')]['offset']);}return _0x5bd6e9['getAgents'](_0x49b63e);}})[_0xbf4d('0x36')](function(_0x59df9e){if(_0x59df9e){return _0x59df9e?{'count':_0x534a0f,'rows':_0x59df9e}:null;}})[_0xbf4d('0x36')](respondWithResult(_0x10d628,null))[_0xbf4d('0x5a')](handleError(_0x10d628,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7a8c4bb..6771306 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 _0xb0c0=['FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb0c0,0xee));var _0x0b0c=function(_0x4b0c5e,_0x12b433){_0x4b0c5e=_0x4b0c5e-0x0;var _0x2053a6=_0xb0c0[_0x4b0c5e];return _0x2053a6;};'use strict';var EventEmitter=require(_0x0b0c('0x0'));var FaxAccount=require(_0x0b0c('0x1'))['db'][_0x0b0c('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0b0c('0x3')](0x0);var events={'afterCreate':_0x0b0c('0x4'),'afterUpdate':_0x0b0c('0x5'),'afterDestroy':_0x0b0c('0x6')};function emitEvent(_0x5defef){return function(_0x25487c,_0x1761a0,_0x1e58a8){FaxAccountEvents[_0x0b0c('0x7')](_0x5defef+':'+_0x25487c['id'],_0x25487c);FaxAccountEvents[_0x0b0c('0x7')](_0x5defef,_0x25487c);_0x1e58a8(null);};}for(var e in events){if(events[_0x0b0c('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x0b0c('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x27b2=['hook','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x279378,_0x4c3a3c){var _0x5825ed=function(_0x307b79){while(--_0x307b79){_0x279378['push'](_0x279378['shift']());}};_0x5825ed(++_0x4c3a3c);}(_0x27b2,0xd4));var _0x227b=function(_0x26eb11,_0x98ba0c){_0x26eb11=_0x26eb11-0x0;var _0x124077=_0x27b2[_0x26eb11];return _0x124077;};'use strict';var EventEmitter=require(_0x227b('0x0'));var FaxAccount=require(_0x227b('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x227b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x227b('0x3')};function emitEvent(_0xe06892){return function(_0x5836ca,_0x4a117e,_0x5f4656){FaxAccountEvents['emit'](_0xe06892+':'+_0x5836ca['id'],_0x5836ca);FaxAccountEvents[_0x227b('0x4')](_0xe06892,_0x5836ca);_0x5f4656(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x227b('0x5')](e,emitEvent(event));}}module[_0x227b('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 22e9ddb..690cb9b 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 _0x158e=['./faxAccount.attributes','define','FaxAccount','fax_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16f2d6,_0x59b80e){var _0x5dab62=function(_0x5e00cd){while(--_0x5e00cd){_0x16f2d6['push'](_0x16f2d6['shift']());}};_0x5dab62(++_0x59b80e);}(_0x158e,0x1f0));var _0xe158=function(_0x546c23,_0x4c2e1b){_0x546c23=_0x546c23-0x0;var _0x25acce=_0x158e[_0x546c23];return _0x25acce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe158('0x0'))(_0xe158('0x1'));var moment=require(_0xe158('0x2'));var BPromise=require(_0xe158('0x3'));var rp=require(_0xe158('0x4'));var fs=require('fs');var path=require(_0xe158('0x5'));var rimraf=require(_0xe158('0x6'));var config=require(_0xe158('0x7'));var attributes=require(_0xe158('0x8'));module['exports']=function(_0x26310a,_0x497a71){return _0x26310a[_0xe158('0x9')](_0xe158('0xa'),attributes,{'tableName':_0xe158('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0d9=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xc0d9,0x192));var _0x9c0d=function(_0x11a62a,_0x42525f){_0x11a62a=_0x11a62a-0x0;var _0x373582=_0xc0d9[_0x11a62a];return _0x373582;};'use strict';var _=require(_0x9c0d('0x0'));var util=require(_0x9c0d('0x1'));var logger=require(_0x9c0d('0x2'))(_0x9c0d('0x3'));var moment=require('moment');var BPromise=require(_0x9c0d('0x4'));var rp=require(_0x9c0d('0x5'));var fs=require('fs');var path=require(_0x9c0d('0x6'));var rimraf=require(_0x9c0d('0x7'));var config=require(_0x9c0d('0x8'));var attributes=require(_0x9c0d('0x9'));module[_0x9c0d('0xa')]=function(_0x25ebbf,_0x4dd209){return _0x25ebbf[_0x9c0d('0xb')]('FaxAccount',attributes,{'tableName':_0x9c0d('0xc'),'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 3041fa3..5b062fa 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 _0x7355=['Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','updatedAt','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','from','CmContact','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','created','interaction','ContactId','AttachmentId','User','name','UserId','agent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','map','include','model','GetFaxAccount','body','fax','ValidationError','no\x20available\x20attributes','keys','difference','createdAt','ListId','isNil'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7355,0x7e));var _0x5735=function(_0x910379,_0x506551){_0x910379=_0x910379-0x0;var _0x4c0e2f=_0x7355[_0x910379];return _0x4c0e2f;};'use strict';var _=require(_0x5735('0x0'));var util=require(_0x5735('0x1'));var moment=require(_0x5735('0x2'));var BPromise=require('bluebird');var rs=require(_0x5735('0x3'));var fs=require('fs');var Redis=require(_0x5735('0x4'));var db=require(_0x5735('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5735('0x6'))(_0x5735('0x7'));var config=require(_0x5735('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5735('0x9')]({'port':0x232c});config[_0x5735('0xa')]=_[_0x5735('0xb')](config[_0x5735('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5735('0xa')]));require(_0x5735('0xc'))[_0x5735('0xd')](socket);function respondWithRpcPromise(_0xe0ddc0,_0xdb95db,_0xa5bd0f){return new BPromise(function(_0x160256,_0x449b86){return client['request'](_0xe0ddc0,_0xa5bd0f)[_0x5735('0xe')](function(_0x107149){logger[_0x5735('0xf')](_0x5735('0x10'),_0xdb95db,_0x5735('0x11'));logger[_0x5735('0x12')](_0x5735('0x13'),_0xdb95db,_0x5735('0x11'),JSON[_0x5735('0x14')](_0x107149));if(_0x107149[_0x5735('0x15')]){if(_0x107149[_0x5735('0x15')]['code']===0x1f4){logger[_0x5735('0x15')]('FaxAccount,\x20%s,\x20%s',_0xdb95db,_0x107149[_0x5735('0x15')][_0x5735('0x16')]);return _0x449b86(_0x107149[_0x5735('0x15')][_0x5735('0x16')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0xdb95db,_0x107149[_0x5735('0x15')]['message']);return _0x160256(_0x107149[_0x5735('0x15')][_0x5735('0x16')]);}else{logger[_0x5735('0xf')](_0x5735('0x10'),_0xdb95db,_0x5735('0x11'));_0x160256(_0x107149[_0x5735('0x17')][_0x5735('0x16')]);}})[_0x5735('0x18')](function(_0x2e4fa3){logger[_0x5735('0x15')](_0x5735('0x10'),_0xdb95db,_0x2e4fa3);_0x449b86(_0x2e4fa3);});});}exports['GetFaxAccount']=function(_0x7dd89d){var _0x436224=this;return new Promise(function(_0x292946,_0x199266){return db[_0x5735('0x19')][_0x5735('0x1a')]({'raw':_0x7dd89d[_0x5735('0x1b')]?_0x7dd89d[_0x5735('0x1b')][_0x5735('0x1c')]===undefined?!![]:![]:!![],'where':_0x7dd89d[_0x5735('0x1b')]?_0x7dd89d['options'][_0x5735('0x1d')]||null:null,'attributes':_0x7dd89d['options']?_0x7dd89d[_0x5735('0x1b')][_0x5735('0x1e')]||null:null,'limit':_0x7dd89d[_0x5735('0x1b')]?_0x7dd89d[_0x5735('0x1b')]['limit']||null:null,'include':_0x7dd89d['options']?_0x7dd89d['options']['include']?_[_0x5735('0x1f')](_0x7dd89d[_0x5735('0x1b')][_0x5735('0x20')],function(_0x96099c){return{'model':db[_0x96099c[_0x5735('0x21')]],'as':_0x96099c['as'],'attributes':_0x96099c[_0x5735('0x1e')],'include':_0x96099c[_0x5735('0x20')]?_['map'](_0x96099c['include'],function(_0x57546d){return{'model':db[_0x57546d[_0x5735('0x21')]],'as':_0x57546d['as'],'attributes':_0x57546d[_0x5735('0x1e')],'include':_0x57546d[_0x5735('0x20')]?_['map'](_0x57546d['include'],function(_0x505819){return{'model':db[_0x505819[_0x5735('0x21')]],'as':_0x505819['as'],'attributes':_0x505819[_0x5735('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x565e47){logger[_0x5735('0xf')](_0x5735('0x22'),_0x7dd89d);logger[_0x5735('0x12')](_0x5735('0x22'),_0x7dd89d,JSON['stringify'](_0x565e47));_0x292946(_0x565e47);})[_0x5735('0x18')](function(_0x4dd0b2){logger[_0x5735('0x15')]('GetFaxAccount',_0x4dd0b2[_0x5735('0x16')],_0x7dd89d);_0x199266(_0x436224[_0x5735('0x15')](0x1f4,_0x4dd0b2[_0x5735('0x16')]));});});};exports['NotifyFaxAccount']=function(_0xd8c43b,_0x3e93b4,_0x477891){var _0x5d145e=this;return new Promise(function(_0x1c291f,_0x448ed8){var _0x4c46e5={'body':_0xd8c43b[_0x5735('0x23')],'channel':_0x5735('0x24')};var _0x1d6bcf=[];var _0x2ebf6b=[];var _0x46d4be={};return db['CmContact']['describe']()['then'](function(_0x4c926e){if(!_0x4c926e){throw new db['Sequelize'][(_0x5735('0x25'))](_0x5735('0x26'));}_0x1d6bcf=_['difference'](_[_0x5735('0x27')](_0x4c926e),['createdAt','updatedAt']);_0x2ebf6b=_[_0x5735('0x28')](_[_0x5735('0x27')](_0x4c926e),[_0x5735('0x29'),'updatedAt','CompanyId',_0x5735('0x2a')]);if(_0xd8c43b[_0x5735('0x23')]['id']){delete _0xd8c43b[_0x5735('0x23')]['id'];}if(_[_0x5735('0x2b')](_0xd8c43b[_0x5735('0x23')]['from'])){throw new db[(_0x5735('0x2c'))][(_0x5735('0x25'))](_0x5735('0x2d'));}if(_[_0x5735('0x2b')](_0xd8c43b[_0x5735('0x23')]['body'])||_0xd8c43b[_0x5735('0x23')][_0x5735('0x23')]===''){throw new db[(_0x5735('0x2c'))][(_0x5735('0x25'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5735('0x2b')](_0xd8c43b['body']['mapKey'])){throw new db[(_0x5735('0x2c'))][(_0x5735('0x25'))](_0x5735('0x2e')+_0x2ebf6b);}if(!_['includes'](_0x2ebf6b,_0xd8c43b[_0x5735('0x23')][_0x5735('0x2f')])){throw new db[(_0x5735('0x2c'))][(_0x5735('0x25'))](_0x5735('0x30')+_0x2ebf6b);}_0x46d4be[_0xd8c43b['body'][_0x5735('0x2f')]]=_0xd8c43b[_0x5735('0x23')]['from'];})[_0x5735('0xe')](function(){return db[_0x5735('0x19')][_0x5735('0x31')]({'where':{'id':_0xd8c43b[_0x5735('0x32')]['id']},'include':[{'model':db[_0x5735('0x33')],'as':_0x5735('0x34'),'include':[{'model':db['CmContact'],'as':_0x5735('0x35'),'where':_0x46d4be,'limit':0x1,'order':[[_0x5735('0x36'),_0x5735('0x37')]]}]},{'model':db[_0x5735('0x38')],'as':_0x5735('0x39')}]});})[_0x5735('0xe')](function(_0x5be77b){if(_0x5be77b&&_0x5be77b[_0x5735('0x34')]){var _0x14b18b=_0x5be77b[_0x5735('0x3a')]({'plain':!![]});_0x4c46e5[_0x5735('0x32')]=_0x14b18b;_0x4c46e5[_0x5735('0x3b')]=_0x14b18b['Applications'];_0x4c46e5[_0x5735('0x3c')]=_0x14b18b[_0x5735('0x34')];_0x4c46e5[_0x5735('0x3b')]=_[_0x5735('0x3d')](_0x4c46e5[_0x5735('0x3b')],[_0x5735('0x3e')],['asc']);if(_0x4c46e5['account'][_0x5735('0x39')]){delete _0x4c46e5['account'][_0x5735('0x39')];}if(_0x4c46e5[_0x5735('0x32')][_0x5735('0x34')]&&_0x4c46e5[_0x5735('0x32')][_0x5735('0x34')][_0x5735('0x35')]['length']){return _0x4c46e5['account'][_0x5735('0x34')][_0x5735('0x35')][0x0];}var _0x2011b8=_[_0x5735('0xb')](_0xd8c43b[_0x5735('0x23')],{'firstName':_0xd8c43b[_0x5735('0x23')][_0x5735('0x3f')],'ListId':_0x14b18b[_0x5735('0x2a')]});_0x2011b8[_0xd8c43b[_0x5735('0x23')][_0x5735('0x2f')]]=_0xd8c43b[_0x5735('0x23')][_0x5735('0x3f')];return db[_0x5735('0x40')][_0x5735('0x41')](_0x2011b8,{'fields':_0x1d6bcf,'raw':!![]});}})[_0x5735('0xe')](function(_0x32391e){_0x4c46e5[_0x5735('0x42')]=_0x32391e;if(_0x32391e){var _0x2f0e8e={'ContactId':_0x32391e['id'],'FaxAccountId':_0xd8c43b[_0x5735('0x32')]['id'],'fax':_0x32391e[_0x5735('0x24')]};return db['FaxInteraction'][_0x5735('0x31')]({'where':{'ContactId':_0x32391e['id'],'closed':![],'FaxAccountId':_0xd8c43b[_0x5735('0x32')]['id']}})[_0x5735('0xe')](function(_0x444140){if(_0x444140){return[_0x444140,![]];}return db[_0x5735('0x43')][_0x5735('0x41')](_0x2f0e8e)['then'](function(_0x86098e){return[_0x86098e,!![]];});});}else{throw new Error(_0x5735('0x44'));}})[_0x5735('0x45')](function(_0x26905a,_0x21adb4){var _0x265a3d=_0x26905a[_0x5735('0x3a')]({'plain':!![]});if(_0x21adb4){if(_0x4c46e5['account'][_0x5735('0x46')]){_0x4c46e5[_0x5735('0x3b')][_0x5735('0x47')]({'id':0x0,'priority':_0x4c46e5[_0x5735('0x3b')][_0x5735('0x48')]+0x1,'app':_0x5735('0x49'),'appdata':_0x5735('0x4a'),'interval':'*,*,*,*'});}_0x265a3d[_0x5735('0x4b')]=!![];}else{_0x265a3d[_0x5735('0x4b')]=![];}_0x4c46e5[_0x5735('0x4c')]=_0x265a3d;return db['FaxMessage'][_0x5735('0x41')]({'body':_0xd8c43b['body']['body'],'FaxAccountId':_0xd8c43b[_0x5735('0x32')]['id'],'FaxInteractionId':_0x26905a['id'],'direction':'in','ContactId':_0x26905a[_0x5735('0x4d')],'AttachmentId':_0xd8c43b[_0x5735('0x23')][_0x5735('0x4e')]});})[_0x5735('0xe')](function(_0x5d0a92){_0x4c46e5['message']=_0x5d0a92;if(_0x4c46e5[_0x5735('0x4c')]['UserId']){return db[_0x5735('0x4f')]['find']({'attributes':['id',_0x5735('0x50')],'where':{'id':_0x4c46e5[_0x5735('0x4c')][_0x5735('0x51')]}})[_0x5735('0xe')](function(_0x21b89d){if(_0x21b89d){_0x4c46e5[_0x5735('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5735('0x52'),'appdata':_0x21b89d['name']+','+(_0x4c46e5[_0x5735('0x32')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5735('0x53'),_0x5735('0x54'),_0x4c46e5);});}return respondWithRpcPromise(_0x5735('0x53'),_0x5735('0x54'),_0x4c46e5);})[_0x5735('0xe')](function(_0x3ddd41){_0x1c291f(_0x3ddd41);})['catch'](function(_0x5a2ab){_0x448ed8(_0x5d145e[_0x5735('0x15')](0x1f4,_0x5a2ab[_0x5735('0x16')]));});});}; \ No newline at end of file +var _0xc593=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','where','attributes','include','model','map','then','NotifyFaxAccount','body','fax','describe','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','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','FaxAccount','find','account','List','CmContact','FaxApplication','Applications','get','applications','orderBy','priority','asc','Contacts','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','Start','startRouting','lodash','util','moment','bluebird','randomstring'];(function(_0x5ca494,_0x273970){var _0x4ddabc=function(_0x358689){while(--_0x358689){_0x5ca494['push'](_0x5ca494['shift']());}};_0x4ddabc(++_0x273970);}(_0xc593,0xb1));var _0x3c59=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc593[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3c59('0x0'));var util=require(_0x3c59('0x1'));var moment=require(_0x3c59('0x2'));var BPromise=require(_0x3c59('0x3'));var rs=require(_0x3c59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c59('0x5'))['db'];var utils=require(_0x3c59('0x6'));var logger=require(_0x3c59('0x7'))(_0x3c59('0x8'));var config=require('../../config/environment');var jayson=require(_0x3c59('0x9'));var client=jayson[_0x3c59('0xa')][_0x3c59('0xb')]({'port':0x232c});config[_0x3c59('0xc')]=_[_0x3c59('0xd')](config[_0x3c59('0xc')],{'host':_0x3c59('0xe'),'port':0x18eb});var socket=require(_0x3c59('0xf'))(new Redis(config['redis']));require(_0x3c59('0x10'))['register'](socket);function respondWithRpcPromise(_0x1be5dc,_0xca9631,_0x57d202){return new BPromise(function(_0x271a3d,_0x46122b){return client['request'](_0x1be5dc,_0x57d202)['then'](function(_0x2700be){logger[_0x3c59('0x11')](_0x3c59('0x12'),_0xca9631,_0x3c59('0x13'));logger[_0x3c59('0x14')](_0x3c59('0x15'),_0xca9631,_0x3c59('0x13'),JSON[_0x3c59('0x16')](_0x2700be));if(_0x2700be[_0x3c59('0x17')]){if(_0x2700be[_0x3c59('0x17')][_0x3c59('0x18')]===0x1f4){logger[_0x3c59('0x17')](_0x3c59('0x12'),_0xca9631,_0x2700be[_0x3c59('0x17')][_0x3c59('0x19')]);return _0x46122b(_0x2700be['error']['message']);}logger[_0x3c59('0x17')]('FaxAccount,\x20%s,\x20%s',_0xca9631,_0x2700be['error'][_0x3c59('0x19')]);return _0x271a3d(_0x2700be[_0x3c59('0x17')][_0x3c59('0x19')]);}else{logger[_0x3c59('0x11')]('FaxAccount,\x20%s,\x20%s',_0xca9631,_0x3c59('0x13'));_0x271a3d(_0x2700be[_0x3c59('0x1a')][_0x3c59('0x19')]);}})[_0x3c59('0x1b')](function(_0xab9479){logger[_0x3c59('0x17')]('FaxAccount,\x20%s,\x20%s',_0xca9631,_0xab9479);_0x46122b(_0xab9479);});});}exports[_0x3c59('0x1c')]=function(_0x42d7eb){var _0x34518f=this;return new Promise(function(_0x5e8b44,_0x9dfc5f){return db['FaxAccount'][_0x3c59('0x1d')]({'raw':_0x42d7eb[_0x3c59('0x1e')]?_0x42d7eb[_0x3c59('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x42d7eb['options']?_0x42d7eb[_0x3c59('0x1e')][_0x3c59('0x1f')]||null:null,'attributes':_0x42d7eb[_0x3c59('0x1e')]?_0x42d7eb[_0x3c59('0x1e')][_0x3c59('0x20')]||null:null,'limit':_0x42d7eb['options']?_0x42d7eb[_0x3c59('0x1e')]['limit']||null:null,'include':_0x42d7eb[_0x3c59('0x1e')]?_0x42d7eb[_0x3c59('0x1e')]['include']?_['map'](_0x42d7eb[_0x3c59('0x1e')][_0x3c59('0x21')],function(_0x5eeb7a){return{'model':db[_0x5eeb7a[_0x3c59('0x22')]],'as':_0x5eeb7a['as'],'attributes':_0x5eeb7a[_0x3c59('0x20')],'include':_0x5eeb7a[_0x3c59('0x21')]?_[_0x3c59('0x23')](_0x5eeb7a[_0x3c59('0x21')],function(_0x193ec8){return{'model':db[_0x193ec8['model']],'as':_0x193ec8['as'],'attributes':_0x193ec8[_0x3c59('0x20')],'include':_0x193ec8[_0x3c59('0x21')]?_[_0x3c59('0x23')](_0x193ec8[_0x3c59('0x21')],function(_0x5661fb){return{'model':db[_0x5661fb[_0x3c59('0x22')]],'as':_0x5661fb['as'],'attributes':_0x5661fb[_0x3c59('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3c59('0x24')](function(_0xd075d4){logger[_0x3c59('0x11')](_0x3c59('0x1c'),_0x42d7eb);logger['debug']('GetFaxAccount',_0x42d7eb,JSON[_0x3c59('0x16')](_0xd075d4));_0x5e8b44(_0xd075d4);})['catch'](function(_0x5c6855){logger[_0x3c59('0x17')]('GetFaxAccount',_0x5c6855[_0x3c59('0x19')],_0x42d7eb);_0x9dfc5f(_0x34518f['error'](0x1f4,_0x5c6855[_0x3c59('0x19')]));});});};exports[_0x3c59('0x25')]=function(_0x4ac911,_0x19e6a7,_0xc4dc4c){var _0x164bbe=this;return new Promise(function(_0x42c1aa,_0x17cb37){var _0x3dd47d={'body':_0x4ac911[_0x3c59('0x26')],'channel':_0x3c59('0x27')};var _0x55aac3=[];var _0x1822fc=[];var _0x23aab2={};return db['CmContact'][_0x3c59('0x28')]()[_0x3c59('0x24')](function(_0x1b4d60){if(!_0x1b4d60){throw new db['Sequelize'][(_0x3c59('0x29'))](_0x3c59('0x2a'));}_0x55aac3=_['difference'](_[_0x3c59('0x2b')](_0x1b4d60),[_0x3c59('0x2c'),_0x3c59('0x2d')]);_0x1822fc=_[_0x3c59('0x2e')](_[_0x3c59('0x2b')](_0x1b4d60),[_0x3c59('0x2c'),'updatedAt',_0x3c59('0x2f'),_0x3c59('0x30')]);if(_0x4ac911[_0x3c59('0x26')]['id']){delete _0x4ac911[_0x3c59('0x26')]['id'];}if(_[_0x3c59('0x31')](_0x4ac911[_0x3c59('0x26')][_0x3c59('0x32')])){throw new db['Sequelize'][(_0x3c59('0x29'))](_0x3c59('0x33'));}if(_[_0x3c59('0x31')](_0x4ac911['body'][_0x3c59('0x26')])||_0x4ac911[_0x3c59('0x26')][_0x3c59('0x26')]===''){throw new db[(_0x3c59('0x34'))]['ValidationError'](_0x3c59('0x35'));}if(_[_0x3c59('0x31')](_0x4ac911[_0x3c59('0x26')][_0x3c59('0x36')])){throw new db['Sequelize']['ValidationError'](_0x3c59('0x37')+_0x1822fc);}if(!_[_0x3c59('0x38')](_0x1822fc,_0x4ac911['body'][_0x3c59('0x36')])){throw new db[(_0x3c59('0x34'))][(_0x3c59('0x29'))](_0x3c59('0x39')+_0x1822fc);}_0x23aab2[_0x4ac911[_0x3c59('0x26')][_0x3c59('0x36')]]=_0x4ac911['body'][_0x3c59('0x32')];})['then'](function(){return db[_0x3c59('0x3a')][_0x3c59('0x3b')]({'where':{'id':_0x4ac911[_0x3c59('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0x3c59('0x3d'),'include':[{'model':db[_0x3c59('0x3e')],'as':'Contacts','where':_0x23aab2,'limit':0x1,'order':[[_0x3c59('0x2d'),'DESC']]}]},{'model':db[_0x3c59('0x3f')],'as':_0x3c59('0x40')}]});})[_0x3c59('0x24')](function(_0x373f73){if(_0x373f73&&_0x373f73[_0x3c59('0x3d')]){var _0x2038d8=_0x373f73[_0x3c59('0x41')]({'plain':!![]});_0x3dd47d[_0x3c59('0x3c')]=_0x2038d8;_0x3dd47d[_0x3c59('0x42')]=_0x2038d8[_0x3c59('0x40')];_0x3dd47d['list']=_0x2038d8[_0x3c59('0x3d')];_0x3dd47d['applications']=_[_0x3c59('0x43')](_0x3dd47d[_0x3c59('0x42')],[_0x3c59('0x44')],[_0x3c59('0x45')]);if(_0x3dd47d['account'][_0x3c59('0x40')]){delete _0x3dd47d[_0x3c59('0x3c')][_0x3c59('0x40')];}if(_0x3dd47d[_0x3c59('0x3c')][_0x3c59('0x3d')]&&_0x3dd47d[_0x3c59('0x3c')][_0x3c59('0x3d')][_0x3c59('0x46')]['length']){return _0x3dd47d[_0x3c59('0x3c')][_0x3c59('0x3d')]['Contacts'][0x0];}var _0xfe68cd=_['defaults'](_0x4ac911[_0x3c59('0x26')],{'firstName':_0x4ac911[_0x3c59('0x26')][_0x3c59('0x32')],'ListId':_0x2038d8[_0x3c59('0x30')]});_0xfe68cd[_0x4ac911[_0x3c59('0x26')][_0x3c59('0x36')]]=_0x4ac911[_0x3c59('0x26')][_0x3c59('0x32')];return db[_0x3c59('0x3e')][_0x3c59('0x47')](_0xfe68cd,{'fields':_0x55aac3,'raw':!![]});}})[_0x3c59('0x24')](function(_0x223094){_0x3dd47d[_0x3c59('0x48')]=_0x223094;if(_0x223094){var _0x3afc67={'ContactId':_0x223094['id'],'FaxAccountId':_0x4ac911[_0x3c59('0x3c')]['id'],'fax':_0x223094[_0x3c59('0x27')]};return db['FaxInteraction'][_0x3c59('0x3b')]({'where':{'ContactId':_0x223094['id'],'closed':![],'FaxAccountId':_0x4ac911[_0x3c59('0x3c')]['id']}})[_0x3c59('0x24')](function(_0x3a4b4b){if(_0x3a4b4b){return[_0x3a4b4b,![]];}return db[_0x3c59('0x49')][_0x3c59('0x47')](_0x3afc67)[_0x3c59('0x24')](function(_0x1089cb){return[_0x1089cb,!![]];});});}else{throw new Error(_0x3c59('0x4a'));}})[_0x3c59('0x4b')](function(_0x5c8236,_0x2b294f){var _0x43c2a0=_0x5c8236[_0x3c59('0x41')]({'plain':!![]});if(_0x2b294f){if(_0x3dd47d[_0x3c59('0x3c')]['autoclose']){_0x3dd47d[_0x3c59('0x42')][_0x3c59('0x4c')]({'id':0x0,'priority':_0x3dd47d[_0x3c59('0x42')][_0x3c59('0x4d')]+0x1,'app':_0x3c59('0x4e'),'appdata':_0x3c59('0x4f'),'interval':_0x3c59('0x50')});}_0x43c2a0[_0x3c59('0x51')]=!![];}else{_0x43c2a0[_0x3c59('0x51')]=![];}_0x3dd47d[_0x3c59('0x52')]=_0x43c2a0;return db[_0x3c59('0x53')]['create']({'body':_0x4ac911[_0x3c59('0x26')][_0x3c59('0x26')],'FaxAccountId':_0x4ac911[_0x3c59('0x3c')]['id'],'FaxInteractionId':_0x5c8236['id'],'direction':'in','ContactId':_0x5c8236[_0x3c59('0x54')],'AttachmentId':_0x4ac911['body'][_0x3c59('0x55')]});})[_0x3c59('0x24')](function(_0x15f4ae){_0x3dd47d[_0x3c59('0x19')]=_0x15f4ae;if(_0x3dd47d[_0x3c59('0x52')][_0x3c59('0x56')]){return db['User']['find']({'attributes':['id',_0x3c59('0x57')],'where':{'id':_0x3dd47d[_0x3c59('0x52')][_0x3c59('0x56')]}})[_0x3c59('0x24')](function(_0x1338a4){if(_0x1338a4){_0x3dd47d['applications'][_0x3c59('0x58')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1338a4[_0x3c59('0x57')]+','+(_0x3dd47d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x3c59('0x50')});}return respondWithRpcPromise(_0x3c59('0x59'),'startRouting',_0x3dd47d);});}return respondWithRpcPromise('Start',_0x3c59('0x5a'),_0x3dd47d);})[_0x3c59('0x24')](function(_0x58133d){_0x42c1aa(_0x58133d);})[_0x3c59('0x1b')](function(_0x2e8efd){_0x17cb37(_0x164bbe[_0x3c59('0x17')](0x1f4,_0x2e8efd['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 629e8a4..a91c945 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 _0xfd0d=['faxAccount:','./faxAccount.events','save','remove','update','emit','register'];(function(_0x27cfd9,_0x5893c1){var _0x384945=function(_0x58740b){while(--_0x58740b){_0x27cfd9['push'](_0x27cfd9['shift']());}};_0x384945(++_0x5893c1);}(_0xfd0d,0xf6));var _0xdfd0=function(_0x4d7e31,_0xa91bba){_0x4d7e31=_0x4d7e31-0x0;var _0x5c4e68=_0xfd0d[_0x4d7e31];return _0x5c4e68;};'use strict';var FaxAccountEvents=require(_0xdfd0('0x0'));var events=[_0xdfd0('0x1'),_0xdfd0('0x2'),_0xdfd0('0x3')];function createListener(_0x9add32,_0x1e3e05){return function(_0x8d6e15){_0x1e3e05[_0xdfd0('0x4')](_0x9add32,_0x8d6e15);};}function removeListener(_0x3b39b1,_0x13ef30){return function(){FaxAccountEvents['removeListener'](_0x3b39b1,_0x13ef30);};}exports[_0xdfd0('0x5')]=function(_0x365582){for(var _0x1eeeff=0x0,_0x129033=events['length'];_0x1eeeff<_0x129033;_0x1eeeff++){var _0x46c268=events[_0x1eeeff];var _0xe984c0=createListener(_0xdfd0('0x6')+_0x46c268,_0x365582);FaxAccountEvents['on'](_0x46c268,_0xe984c0);}}; \ No newline at end of file +var _0x195c=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x4c9f9f,_0x5a7432){var _0x16b264=function(_0x24e92e){while(--_0x24e92e){_0x4c9f9f['push'](_0x4c9f9f['shift']());}};_0x16b264(++_0x5a7432);}(_0x195c,0xf6));var _0xc195=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x195c[_0x8ba19a];return _0x2bd8b4;};'use strict';var FaxAccountEvents=require(_0xc195('0x0'));var events=[_0xc195('0x1'),_0xc195('0x2'),_0xc195('0x3')];function createListener(_0xe0d8e0,_0x49ca81){return function(_0x3ffed8){_0x49ca81[_0xc195('0x4')](_0xe0d8e0,_0x3ffed8);};}function removeListener(_0x12b577,_0x383212){return function(){FaxAccountEvents[_0xc195('0x5')](_0x12b577,_0x383212);};}exports[_0xc195('0x6')]=function(_0xeb2c23){for(var _0x54d240=0x0,_0x165540=events[_0xc195('0x7')];_0x54d240<_0x165540;_0x54d240++){var _0x7dd95a=events[_0x54d240];var _0x4a4f1b=createListener(_0xc195('0x8')+_0x7dd95a,_0xeb2c23);FaxAccountEvents['on'](_0x7dd95a,_0x4a4f1b);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f066997..a604aff 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 _0xace2=['/:id/canned_answers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','update','destroy','removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions'];(function(_0x361baf,_0x34f308){var _0xb9a81f=function(_0xa689cf){while(--_0xa689cf){_0x361baf['push'](_0x361baf['shift']());}};_0xb9a81f(++_0x34f308);}(_0xace2,0x177));var _0x2ace=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xace2[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x2ace('0x0'));var util=require('util');var path=require(_0x2ace('0x1'));var timeout=require(_0x2ace('0x2'));var express=require(_0x2ace('0x3'));var router=express[_0x2ace('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2ace('0x5'));var config=require(_0x2ace('0x6'));var controller=require(_0x2ace('0x7'));router[_0x2ace('0x8')]('/',auth[_0x2ace('0x9')](),controller[_0x2ace('0xa')]);router[_0x2ace('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2ace('0xb')]);router['get'](_0x2ace('0xc'),auth[_0x2ace('0x9')](),controller[_0x2ace('0xd')]);router[_0x2ace('0x8')](_0x2ace('0xe'),auth[_0x2ace('0x9')](),controller['getDispositions']);router[_0x2ace('0x8')](_0x2ace('0xf'),auth[_0x2ace('0x9')](),controller['getAnswers']);router[_0x2ace('0x8')](_0x2ace('0x10'),auth[_0x2ace('0x9')](),controller['getInteractions']);router[_0x2ace('0x8')](_0x2ace('0x11'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x12')]);router['get'](_0x2ace('0x13'),auth['isAuthenticated'](),controller[_0x2ace('0x14')]);router[_0x2ace('0x8')](_0x2ace('0x15'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x16')]);router[_0x2ace('0x17')]('/',auth[_0x2ace('0x9')](),controller['create']);router[_0x2ace('0x17')]('/:id/dispositions',auth[_0x2ace('0x9')](),controller[_0x2ace('0x18')]);router[_0x2ace('0x17')](_0x2ace('0xf'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x19')]);router['post']('/:id/interactions',auth[_0x2ace('0x9')](),controller[_0x2ace('0x1a')]);router['post'](_0x2ace('0x11'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x1b')]);router[_0x2ace('0x17')](_0x2ace('0x1c'),auth['isAuthenticated'](),controller['addAccountApplications']);router[_0x2ace('0x17')](_0x2ace('0x1d'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x1e')]);router[_0x2ace('0x17')](_0x2ace('0x1f'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x20')]);router['post']('/:id/users',auth[_0x2ace('0x9')](),controller['addAgents']);router[_0x2ace('0x21')](_0x2ace('0xc'),auth['isAuthenticated'](),controller[_0x2ace('0x22')]);router['delete'](_0x2ace('0xc'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x23')]);router['delete'](_0x2ace('0xe'),auth[_0x2ace('0x9')](),controller[_0x2ace('0x24')]);router['delete']('/:id/canned_answers',auth[_0x2ace('0x9')](),controller[_0x2ace('0x25')]);router['delete'](_0x2ace('0x15'),auth[_0x2ace('0x9')](),controller['removeAgents']);module[_0x2ace('0x26')]=router; \ No newline at end of file +var _0xe364=['../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','updateAccountApplications','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x25c087,_0x60ae5e){var _0x7856b5=function(_0x453d0a){while(--_0x453d0a){_0x25c087['push'](_0x25c087['shift']());}};_0x7856b5(++_0x60ae5e);}(_0xe364,0x9d));var _0x4e36=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0xe364[_0x29e2af];return _0x1ea06a;};'use strict';var multer=require(_0x4e36('0x0'));var util=require(_0x4e36('0x1'));var path=require(_0x4e36('0x2'));var timeout=require(_0x4e36('0x3'));var express=require('express');var router=express[_0x4e36('0x4')]();var auth=require(_0x4e36('0x5'));var interaction=require(_0x4e36('0x6'));var config=require(_0x4e36('0x7'));var controller=require('./faxAccount.controller');router[_0x4e36('0x8')]('/',auth['isAuthenticated'](),controller[_0x4e36('0x9')]);router[_0x4e36('0x8')](_0x4e36('0xa'),auth[_0x4e36('0xb')](),controller[_0x4e36('0xc')]);router[_0x4e36('0x8')]('/:id',auth[_0x4e36('0xb')](),controller[_0x4e36('0xd')]);router[_0x4e36('0x8')](_0x4e36('0xe'),auth[_0x4e36('0xb')](),controller[_0x4e36('0xf')]);router[_0x4e36('0x8')](_0x4e36('0x10'),auth['isAuthenticated'](),controller[_0x4e36('0x11')]);router['get'](_0x4e36('0x12'),auth[_0x4e36('0xb')](),controller['getInteractions']);router[_0x4e36('0x8')](_0x4e36('0x13'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x14')]);router[_0x4e36('0x8')](_0x4e36('0x15'),auth[_0x4e36('0xb')](),controller['getMessages']);router[_0x4e36('0x8')](_0x4e36('0x16'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x17')]);router[_0x4e36('0x18')]('/',auth[_0x4e36('0xb')](),controller[_0x4e36('0x19')]);router[_0x4e36('0x18')](_0x4e36('0xe'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x1a')]);router[_0x4e36('0x18')](_0x4e36('0x10'),auth['isAuthenticated'](),controller[_0x4e36('0x1b')]);router[_0x4e36('0x18')](_0x4e36('0x12'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x1c')]);router['post']('/:id/applications',auth[_0x4e36('0xb')](),controller[_0x4e36('0x1d')]);router[_0x4e36('0x18')]('/addaccountapplications',auth[_0x4e36('0xb')](),controller[_0x4e36('0x1e')]);router[_0x4e36('0x18')]('/updateaccountapplications',auth[_0x4e36('0xb')](),controller[_0x4e36('0x1f')]);router[_0x4e36('0x18')]('/:id/send',auth[_0x4e36('0xb')](),controller['send']);router[_0x4e36('0x18')](_0x4e36('0x16'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x20')]);router[_0x4e36('0x21')](_0x4e36('0x22'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x23')]);router[_0x4e36('0x24')](_0x4e36('0x22'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x25')]);router[_0x4e36('0x24')](_0x4e36('0xe'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x26')]);router[_0x4e36('0x24')](_0x4e36('0x10'),auth[_0x4e36('0xb')](),controller[_0x4e36('0x27')]);router[_0x4e36('0x24')]('/:id/users',auth[_0x4e36('0xb')](),controller[_0x4e36('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index a133f4e..c9528bd 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 _0x6ac2=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x54b1d7,_0x4a1716){var _0x214b1f=function(_0x2d1def){while(--_0x2d1def){_0x54b1d7['push'](_0x54b1d7['shift']());}};_0x214b1f(++_0x4a1716);}(_0x6ac2,0x184));var _0x26ac=function(_0x19b02b,_0xa0e9c7){_0x19b02b=_0x19b02b-0x0;var _0xee26a1=_0x6ac2[_0x19b02b];return _0xee26a1;};'use strict';var Sequelize=require(_0x26ac('0x0'));module['exports']={'priority':{'type':Sequelize[_0x26ac('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x26ac('0x2')],'allowNull':![],'defaultValue':_0x26ac('0x3')},'appdata':{'type':Sequelize[_0x26ac('0x4')]()},'description':{'type':Sequelize[_0x26ac('0x2')]},'interval':{'type':Sequelize[_0x26ac('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0d91=['INTEGER','STRING','TEXT','sequelize','exports'];(function(_0x5b6636,_0x44e045){var _0x55d9bf=function(_0x2cd946){while(--_0x2cd946){_0x5b6636['push'](_0x5b6636['shift']());}};_0x55d9bf(++_0x44e045);}(_0x0d91,0x76));var _0x10d9=function(_0x2c0421,_0xa30722){_0x2c0421=_0x2c0421-0x0;var _0x25a09e=_0x0d91[_0x2c0421];return _0x25a09e;};'use strict';var Sequelize=require(_0x10d9('0x0'));module[_0x10d9('0x1')]={'priority':{'type':Sequelize[_0x10d9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x10d9('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x10d9('0x4')]()},'description':{'type':Sequelize[_0x10d9('0x3')]},'interval':{'type':Sequelize[_0x10d9('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index f61f073..582d15e 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 _0x1307=['path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','Content-Range','reject','save','then','destroy','end','error','name','send','index','FaxApplication','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util'];(function(_0xfe5859,_0x2c3755){var _0x16831d=function(_0x2a7d7a){while(--_0x2a7d7a){_0xfe5859['push'](_0xfe5859['shift']());}};_0x16831d(++_0x2c3755);}(_0x1307,0x84));var _0x7130=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x1307[_0x1ccdf7];return _0x52a0ae;};'use strict';var pdf=require(_0x7130('0x0'));var emlformat=require(_0x7130('0x1'));var rimraf=require(_0x7130('0x2'));var zipdir=require(_0x7130('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7130('0x4'));var moment=require(_0x7130('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7130('0x6'));var util=require(_0x7130('0x7'));var path=require(_0x7130('0x8'));var sox=require('sox');var csv=require(_0x7130('0x9'));var ejs=require(_0x7130('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7130('0xb'));var crypto=require(_0x7130('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7130('0xd'));var toCsv=require(_0x7130('0x9'));var querystring=require(_0x7130('0xe'));var Papa=require(_0x7130('0xf'));var Redis=require(_0x7130('0x10'));var authService=require(_0x7130('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7130('0x12'));var logger=require(_0x7130('0x13'))(_0x7130('0x14'));var utils=require(_0x7130('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x167dfd,_0x389f45){_0x389f45=_0x389f45||0xcc;return function(_0x3f51d0){if(_0x3f51d0){return _0x167dfd[_0x7130('0x16')](_0x389f45);}return _0x167dfd['status'](_0x389f45)['end']();};}function respondWithResult(_0x208d05,_0x4e6415){_0x4e6415=_0x4e6415||0xc8;return function(_0x3bbf6a){if(_0x3bbf6a){return _0x208d05[_0x7130('0x17')](_0x4e6415)[_0x7130('0x18')](_0x3bbf6a);}};}function respondWithFilteredResult(_0x4f141c,_0x34f17a){return function(_0x5ea599){if(_0x5ea599){var _0x42c51c=_0x5ea599[_0x7130('0x19')],_0x2f4af2=_0x34f17a[_0x7130('0x1a')],_0x1a67ca=_0x34f17a['offset']+_0x34f17a['limit'],_0x912aa;if(_0x1a67ca>=_0x42c51c){_0x1a67ca=_0x42c51c;_0x912aa=0xc8;}else{_0x912aa=0xce;}_0x4f141c[_0x7130('0x17')](_0x912aa);return _0x4f141c['set'](_0x7130('0x1b'),_0x2f4af2+'-'+_0x1a67ca+'/'+_0x42c51c)[_0x7130('0x18')](_0x5ea599);}return null;};}function patchUpdates(_0x1af3cb){return function(_0xe73a39){try{jsonpatch['apply'](_0xe73a39,_0x1af3cb,!![]);}catch(_0x293d9a){return BPromise[_0x7130('0x1c')](_0x293d9a);}return _0xe73a39[_0x7130('0x1d')]();};}function saveUpdates(_0x57a7ad,_0x66352b){return function(_0x1abaa5){if(_0x1abaa5){return _0x1abaa5['update'](_0x57a7ad)[_0x7130('0x1e')](function(_0x25561b){return _0x25561b;});}return null;};}function removeEntity(_0xbdbb08,_0x2da5a0){return function(_0x36c153){if(_0x36c153){return _0x36c153[_0x7130('0x1f')]()[_0x7130('0x1e')](function(){_0xbdbb08['status'](0xcc)[_0x7130('0x20')]();});}};}function handleEntityNotFound(_0x1c0cb4,_0x4975ae){return function(_0x2a3e9c){if(!_0x2a3e9c){_0x1c0cb4['sendStatus'](0x194);}return _0x2a3e9c;};}function handleError(_0x5d60e9,_0xfcf6c0){_0xfcf6c0=_0xfcf6c0||0x1f4;return function(_0x1912d5){logger[_0x7130('0x21')](_0x1912d5['stack']);if(_0x1912d5[_0x7130('0x22')]){delete _0x1912d5[_0x7130('0x22')];}_0x5d60e9[_0x7130('0x17')](_0xfcf6c0)[_0x7130('0x23')](_0x1912d5);};}exports[_0x7130('0x24')]=function(_0x549505,_0x57c7a9){var _0x4511f4={},_0x4fd653={},_0x3b7dc2={'count':0x0,'rows':[]};var _0x4b20b6=db[_0x7130('0x25')]['rawAttributes'];_0x4fd653['model']=_['keys'](_0x4b20b6);_0x4fd653['query']=_[_0x7130('0x26')](_0x549505[_0x7130('0x27')]);_0x4fd653[_0x7130('0x28')]=_[_0x7130('0x29')](_0x4fd653[_0x7130('0x2a')],_0x4fd653[_0x7130('0x27')]);_0x4511f4['attributes']=_[_0x7130('0x29')](_0x4fd653['model'],qs[_0x7130('0x2b')](_0x549505[_0x7130('0x27')][_0x7130('0x2b')]));_0x4511f4[_0x7130('0x2c')]=_0x4511f4[_0x7130('0x2c')]['length']?_0x4511f4['attributes']:_0x4fd653[_0x7130('0x2a')];if(!_0x549505[_0x7130('0x27')][_0x7130('0x2d')]('nolimit')){_0x4511f4['limit']=qs['limit'](_0x549505[_0x7130('0x27')][_0x7130('0x2e')]);_0x4511f4[_0x7130('0x1a')]=qs[_0x7130('0x1a')](_0x549505['query'][_0x7130('0x1a')]);}_0x4511f4[_0x7130('0x2f')]=qs[_0x7130('0x30')](_0x549505[_0x7130('0x27')][_0x7130('0x30')]);_0x4511f4['where']=qs[_0x7130('0x28')](_[_0x7130('0x31')](_0x549505[_0x7130('0x27')],_0x4fd653[_0x7130('0x28')]));if(_0x549505[_0x7130('0x27')][_0x7130('0x32')]){_0x4511f4[_0x7130('0x33')]=_[_0x7130('0x34')](_0x4511f4[_0x7130('0x33')],{'$or':_[_0x7130('0x35')](_0x4b20b6,function(_0x471dbf){if(_0x471dbf[_0x7130('0x36')][_0x7130('0x37')]!=='VIRTUAL'){var _0x3019fe={};_0x3019fe[_0x471dbf[_0x7130('0x38')]]={'$like':'%'+_0x549505[_0x7130('0x27')][_0x7130('0x32')]+'%'};return _0x3019fe;}})});}_0x4511f4=_['merge']({},_0x4511f4,_0x549505[_0x7130('0x39')]);var _0x574958={'where':_0x4511f4['where']};return db[_0x7130('0x25')][_0x7130('0x19')](_0x574958)[_0x7130('0x1e')](function(_0x32770c){_0x3b7dc2[_0x7130('0x19')]=_0x32770c;if(_0x549505[_0x7130('0x27')][_0x7130('0x3a')]){_0x4511f4[_0x7130('0x3b')]=[{'all':!![]}];}return db[_0x7130('0x25')][_0x7130('0x3c')](_0x4511f4);})[_0x7130('0x1e')](function(_0x19d9e7){_0x3b7dc2[_0x7130('0x3d')]=_0x19d9e7;return _0x3b7dc2;})[_0x7130('0x1e')](respondWithFilteredResult(_0x57c7a9,_0x4511f4))[_0x7130('0x3e')](handleError(_0x57c7a9,null));};exports[_0x7130('0x3f')]=function(_0x11fdd5,_0x30baa7){var _0xb0a48={'raw':!![],'where':{'id':_0x11fdd5[_0x7130('0x40')]['id']}},_0x46f54b={};_0x46f54b[_0x7130('0x2a')]=_['keys'](db[_0x7130('0x25')][_0x7130('0x41')]);_0x46f54b[_0x7130('0x27')]=_[_0x7130('0x26')](_0x11fdd5[_0x7130('0x27')]);_0x46f54b[_0x7130('0x28')]=_[_0x7130('0x29')](_0x46f54b[_0x7130('0x2a')],_0x46f54b[_0x7130('0x27')]);_0xb0a48[_0x7130('0x2c')]=_['intersection'](_0x46f54b[_0x7130('0x2a')],qs['fields'](_0x11fdd5[_0x7130('0x27')]['fields']));_0xb0a48[_0x7130('0x2c')]=_0xb0a48[_0x7130('0x2c')]['length']?_0xb0a48[_0x7130('0x2c')]:_0x46f54b[_0x7130('0x2a')];if(_0x11fdd5[_0x7130('0x27')][_0x7130('0x3a')]){_0xb0a48['include']=[{'all':!![]}];}_0xb0a48=_[_0x7130('0x34')]({},_0xb0a48,_0x11fdd5[_0x7130('0x39')]);return db[_0x7130('0x25')][_0x7130('0x42')](_0xb0a48)[_0x7130('0x1e')](handleEntityNotFound(_0x30baa7,null))['then'](respondWithResult(_0x30baa7,null))[_0x7130('0x3e')](handleError(_0x30baa7,null));};exports['create']=function(_0x438326,_0x543763){return db[_0x7130('0x25')][_0x7130('0x43')](_0x438326['body'],{})[_0x7130('0x1e')](respondWithResult(_0x543763,0xc9))[_0x7130('0x3e')](handleError(_0x543763,null));};exports[_0x7130('0x44')]=function(_0xf6febc,_0x1979b4){if(_0xf6febc[_0x7130('0x45')]['id']){delete _0xf6febc[_0x7130('0x45')]['id'];}return db['FaxApplication'][_0x7130('0x42')]({'where':{'id':_0xf6febc['params']['id']}})[_0x7130('0x1e')](handleEntityNotFound(_0x1979b4,null))[_0x7130('0x1e')](saveUpdates(_0xf6febc[_0x7130('0x45')],null))[_0x7130('0x1e')](respondWithResult(_0x1979b4,null))['catch'](handleError(_0x1979b4,null));};exports[_0x7130('0x1f')]=function(_0x45dcc2,_0x4c6ab4){return db['FaxApplication'][_0x7130('0x42')]({'where':{'id':_0x45dcc2[_0x7130('0x40')]['id']}})[_0x7130('0x1e')](handleEntityNotFound(_0x4c6ab4,null))[_0x7130('0x1e')](removeEntity(_0x4c6ab4,null))[_0x7130('0x3e')](handleError(_0x4c6ab4,null));}; \ No newline at end of file +var _0x5e7c=['set','Content-Range','reject','update','then','destroy','error','stack','name','index','FaxApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','findAll','catch','show','includeAll','find','create','body','params','eml-format','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','status','json','count','offset','limit'];(function(_0x210580,_0x1329d5){var _0x477835=function(_0x202c95){while(--_0x202c95){_0x210580['push'](_0x210580['shift']());}};_0x477835(++_0x1329d5);}(_0x5e7c,0x1a4));var _0xc5e7=function(_0xc070d4,_0x3f1998){_0xc070d4=_0xc070d4-0x0;var _0x37e0b3=_0x5e7c[_0xc070d4];return _0x37e0b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc5e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc5e7('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xc5e7('0x2'));var util=require(_0xc5e7('0x3'));var path=require(_0xc5e7('0x4'));var sox=require('sox');var csv=require(_0xc5e7('0x5'));var ejs=require(_0xc5e7('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc5e7('0x7'));var crypto=require(_0xc5e7('0x8'));var jsforce=require(_0xc5e7('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc5e7('0x5'));var querystring=require(_0xc5e7('0xa'));var Papa=require(_0xc5e7('0xb'));var Redis=require('ioredis');var authService=require(_0xc5e7('0xc'));var qs=require(_0xc5e7('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5e7('0xe'))(_0xc5e7('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20d8fa,_0x12fc20){_0x12fc20=_0x12fc20||0xcc;return function(_0x271782){if(_0x271782){return _0x20d8fa['sendStatus'](_0x12fc20);}return _0x20d8fa[_0xc5e7('0x10')](_0x12fc20)['end']();};}function respondWithResult(_0x160985,_0x2a897e){_0x2a897e=_0x2a897e||0xc8;return function(_0x588f17){if(_0x588f17){return _0x160985[_0xc5e7('0x10')](_0x2a897e)[_0xc5e7('0x11')](_0x588f17);}};}function respondWithFilteredResult(_0x8df1e0,_0x5545){return function(_0x2c9a95){if(_0x2c9a95){var _0x4e3603=_0x2c9a95[_0xc5e7('0x12')],_0x3e0061=_0x5545[_0xc5e7('0x13')],_0x5427d7=_0x5545['offset']+_0x5545[_0xc5e7('0x14')],_0x1946a6;if(_0x5427d7>=_0x4e3603){_0x5427d7=_0x4e3603;_0x1946a6=0xc8;}else{_0x1946a6=0xce;}_0x8df1e0[_0xc5e7('0x10')](_0x1946a6);return _0x8df1e0[_0xc5e7('0x15')](_0xc5e7('0x16'),_0x3e0061+'-'+_0x5427d7+'/'+_0x4e3603)[_0xc5e7('0x11')](_0x2c9a95);}return null;};}function patchUpdates(_0x490354){return function(_0x582bf1){try{jsonpatch['apply'](_0x582bf1,_0x490354,!![]);}catch(_0x5940b4){return BPromise[_0xc5e7('0x17')](_0x5940b4);}return _0x582bf1['save']();};}function saveUpdates(_0x2601e2,_0x37f9aa){return function(_0x488eba){if(_0x488eba){return _0x488eba[_0xc5e7('0x18')](_0x2601e2)[_0xc5e7('0x19')](function(_0x5e4163){return _0x5e4163;});}return null;};}function removeEntity(_0x42f937,_0x15f8f3){return function(_0x5d5976){if(_0x5d5976){return _0x5d5976[_0xc5e7('0x1a')]()[_0xc5e7('0x19')](function(){_0x42f937['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x560143,_0x1200bc){return function(_0x79cf01){if(!_0x79cf01){_0x560143['sendStatus'](0x194);}return _0x79cf01;};}function handleError(_0x10e08d,_0x5056c0){_0x5056c0=_0x5056c0||0x1f4;return function(_0x400c3c){logger[_0xc5e7('0x1b')](_0x400c3c[_0xc5e7('0x1c')]);if(_0x400c3c[_0xc5e7('0x1d')]){delete _0x400c3c[_0xc5e7('0x1d')];}_0x10e08d[_0xc5e7('0x10')](_0x5056c0)['send'](_0x400c3c);};}exports[_0xc5e7('0x1e')]=function(_0x2e3e8e,_0x27779f){var _0x322009={},_0x5c6945={},_0x42cbe6={'count':0x0,'rows':[]};var _0x591bf2=db[_0xc5e7('0x1f')][_0xc5e7('0x20')];_0x5c6945[_0xc5e7('0x21')]=_[_0xc5e7('0x22')](_0x591bf2);_0x5c6945['query']=_[_0xc5e7('0x22')](_0x2e3e8e[_0xc5e7('0x23')]);_0x5c6945[_0xc5e7('0x24')]=_[_0xc5e7('0x25')](_0x5c6945['model'],_0x5c6945[_0xc5e7('0x23')]);_0x322009[_0xc5e7('0x26')]=_[_0xc5e7('0x25')](_0x5c6945[_0xc5e7('0x21')],qs['fields'](_0x2e3e8e[_0xc5e7('0x23')][_0xc5e7('0x27')]));_0x322009['attributes']=_0x322009[_0xc5e7('0x26')][_0xc5e7('0x28')]?_0x322009[_0xc5e7('0x26')]:_0x5c6945[_0xc5e7('0x21')];if(!_0x2e3e8e[_0xc5e7('0x23')][_0xc5e7('0x29')](_0xc5e7('0x2a'))){_0x322009['limit']=qs[_0xc5e7('0x14')](_0x2e3e8e[_0xc5e7('0x23')][_0xc5e7('0x14')]);_0x322009[_0xc5e7('0x13')]=qs[_0xc5e7('0x13')](_0x2e3e8e[_0xc5e7('0x23')][_0xc5e7('0x13')]);}_0x322009[_0xc5e7('0x2b')]=qs[_0xc5e7('0x2c')](_0x2e3e8e[_0xc5e7('0x23')][_0xc5e7('0x2c')]);_0x322009['where']=qs[_0xc5e7('0x24')](_[_0xc5e7('0x2d')](_0x2e3e8e[_0xc5e7('0x23')],_0x5c6945[_0xc5e7('0x24')]));if(_0x2e3e8e[_0xc5e7('0x23')][_0xc5e7('0x2e')]){_0x322009[_0xc5e7('0x2f')]=_[_0xc5e7('0x30')](_0x322009[_0xc5e7('0x2f')],{'$or':_[_0xc5e7('0x31')](_0x591bf2,function(_0x1a990a){if(_0x1a990a[_0xc5e7('0x32')][_0xc5e7('0x33')]!==_0xc5e7('0x34')){var _0x1c9168={};_0x1c9168[_0x1a990a[_0xc5e7('0x35')]]={'$like':'%'+_0x2e3e8e[_0xc5e7('0x23')][_0xc5e7('0x2e')]+'%'};return _0x1c9168;}})});}_0x322009=_[_0xc5e7('0x30')]({},_0x322009,_0x2e3e8e[_0xc5e7('0x36')]);var _0x1be2ee={'where':_0x322009[_0xc5e7('0x2f')]};return db[_0xc5e7('0x1f')][_0xc5e7('0x12')](_0x1be2ee)[_0xc5e7('0x19')](function(_0x433ab6){_0x42cbe6[_0xc5e7('0x12')]=_0x433ab6;if(_0x2e3e8e['query']['includeAll']){_0x322009['include']=[{'all':!![]}];}return db[_0xc5e7('0x1f')][_0xc5e7('0x37')](_0x322009);})[_0xc5e7('0x19')](function(_0x5b3a3d){_0x42cbe6['rows']=_0x5b3a3d;return _0x42cbe6;})[_0xc5e7('0x19')](respondWithFilteredResult(_0x27779f,_0x322009))[_0xc5e7('0x38')](handleError(_0x27779f,null));};exports[_0xc5e7('0x39')]=function(_0x4d28b8,_0x1f331a){var _0x211ce3={'raw':!![],'where':{'id':_0x4d28b8['params']['id']}},_0x31efff={};_0x31efff[_0xc5e7('0x21')]=_[_0xc5e7('0x22')](db['FaxApplication'][_0xc5e7('0x20')]);_0x31efff[_0xc5e7('0x23')]=_['keys'](_0x4d28b8[_0xc5e7('0x23')]);_0x31efff[_0xc5e7('0x24')]=_[_0xc5e7('0x25')](_0x31efff['model'],_0x31efff[_0xc5e7('0x23')]);_0x211ce3[_0xc5e7('0x26')]=_[_0xc5e7('0x25')](_0x31efff[_0xc5e7('0x21')],qs[_0xc5e7('0x27')](_0x4d28b8[_0xc5e7('0x23')]['fields']));_0x211ce3['attributes']=_0x211ce3[_0xc5e7('0x26')][_0xc5e7('0x28')]?_0x211ce3[_0xc5e7('0x26')]:_0x31efff['model'];if(_0x4d28b8[_0xc5e7('0x23')][_0xc5e7('0x3a')]){_0x211ce3['include']=[{'all':!![]}];}_0x211ce3=_[_0xc5e7('0x30')]({},_0x211ce3,_0x4d28b8['options']);return db[_0xc5e7('0x1f')][_0xc5e7('0x3b')](_0x211ce3)[_0xc5e7('0x19')](handleEntityNotFound(_0x1f331a,null))[_0xc5e7('0x19')](respondWithResult(_0x1f331a,null))[_0xc5e7('0x38')](handleError(_0x1f331a,null));};exports[_0xc5e7('0x3c')]=function(_0xa16d90,_0xf8da07){return db[_0xc5e7('0x1f')][_0xc5e7('0x3c')](_0xa16d90[_0xc5e7('0x3d')],{})[_0xc5e7('0x19')](respondWithResult(_0xf8da07,0xc9))[_0xc5e7('0x38')](handleError(_0xf8da07,null));};exports[_0xc5e7('0x18')]=function(_0x1fdff5,_0x2b5d20){if(_0x1fdff5[_0xc5e7('0x3d')]['id']){delete _0x1fdff5[_0xc5e7('0x3d')]['id'];}return db[_0xc5e7('0x1f')][_0xc5e7('0x3b')]({'where':{'id':_0x1fdff5[_0xc5e7('0x3e')]['id']}})[_0xc5e7('0x19')](handleEntityNotFound(_0x2b5d20,null))[_0xc5e7('0x19')](saveUpdates(_0x1fdff5[_0xc5e7('0x3d')],null))[_0xc5e7('0x19')](respondWithResult(_0x2b5d20,null))[_0xc5e7('0x38')](handleError(_0x2b5d20,null));};exports['destroy']=function(_0x28df5e,_0x1fe44c){return db[_0xc5e7('0x1f')][_0xc5e7('0x3b')]({'where':{'id':_0x28df5e[_0xc5e7('0x3e')]['id']}})[_0xc5e7('0x19')](handleEntityNotFound(_0x1fe44c,null))[_0xc5e7('0x19')](removeEntity(_0x1fe44c,null))[_0xc5e7('0x38')](handleError(_0x1fe44c,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index c50c524..130bc42 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 _0x5ad3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0x5ad3[_0x483e3a];return _0x43fca9;};'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')]('FaxApplication',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x35ad('0xd'),'collate':_0x35ad('0xe')});}; \ No newline at end of file +var _0xf69d=['fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0xf69d,0xd3));var _0xdf69=function(_0x31a171,_0x4249bf){_0x31a171=_0x31a171-0x0;var _0x54becf=_0xf69d[_0x31a171];return _0x54becf;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf69('0xe'),'collate':_0xdf69('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index fb4dc6b..bf2a6a2 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 _0x3ff5=['request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','attributes','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s'];(function(_0x2693af,_0x1e5563){var _0x4b3d32=function(_0x2df73b){while(--_0x2df73b){_0x2693af['push'](_0x2693af['shift']());}};_0x4b3d32(++_0x1e5563);}(_0x3ff5,0x13b));var _0x53ff=function(_0x935566,_0x311f5b){_0x935566=_0x935566-0x0;var _0x18ae16=_0x3ff5[_0x935566];return _0x18ae16;};'use strict';var _=require('lodash');var util=require(_0x53ff('0x0'));var moment=require(_0x53ff('0x1'));var BPromise=require(_0x53ff('0x2'));var rs=require(_0x53ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53ff('0x4'))['db'];var utils=require(_0x53ff('0x5'));var logger=require(_0x53ff('0x6'))(_0x53ff('0x7'));var config=require(_0x53ff('0x8'));var jayson=require(_0x53ff('0x9'));var client=jayson[_0x53ff('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7123c3,_0x24b430,_0x492fc1){return new BPromise(function(_0x18df59,_0x491106){return client[_0x53ff('0xb')](_0x7123c3,_0x492fc1)[_0x53ff('0xc')](function(_0x23d040){logger[_0x53ff('0xd')](_0x53ff('0xe'),_0x24b430,_0x53ff('0xf'));logger['debug'](_0x53ff('0x10'),_0x24b430,_0x53ff('0xf'),JSON[_0x53ff('0x11')](_0x23d040));if(_0x23d040[_0x53ff('0x12')]){if(_0x23d040['error'][_0x53ff('0x13')]===0x1f4){logger[_0x53ff('0x12')]('FaxApplication,\x20%s,\x20%s',_0x24b430,_0x23d040['error'][_0x53ff('0x14')]);return _0x491106(_0x23d040[_0x53ff('0x12')][_0x53ff('0x14')]);}logger[_0x53ff('0x12')]('FaxApplication,\x20%s,\x20%s',_0x24b430,_0x23d040[_0x53ff('0x12')]['message']);return _0x18df59(_0x23d040[_0x53ff('0x12')]['message']);}else{logger['info'](_0x53ff('0xe'),_0x24b430,_0x53ff('0xf'));_0x18df59(_0x23d040[_0x53ff('0x15')][_0x53ff('0x14')]);}})[_0x53ff('0x16')](function(_0x429bbc){logger[_0x53ff('0x12')](_0x53ff('0xe'),_0x24b430,_0x429bbc);_0x491106(_0x429bbc);});});}exports[_0x53ff('0x17')]=function(_0x560de2){var _0x22fde3=this;return new Promise(function(_0x2704a4,_0x51973e){return db[_0x53ff('0x18')]['update'](_0x560de2[_0x53ff('0x19')],{'raw':_0x560de2[_0x53ff('0x1a')]?_0x560de2['options'][_0x53ff('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x560de2[_0x53ff('0x1a')]?_0x560de2[_0x53ff('0x1a')]['where']||null:null,'attributes':_0x560de2[_0x53ff('0x1a')]?_0x560de2[_0x53ff('0x1a')][_0x53ff('0x1c')]||null:null,'limit':_0x560de2[_0x53ff('0x1a')]?_0x560de2[_0x53ff('0x1a')]['limit']||null:null})['then'](function(_0x42bc36){logger['info'](_0x53ff('0x17'),_0x560de2);logger[_0x53ff('0x1d')](_0x53ff('0x17'),_0x560de2,JSON[_0x53ff('0x11')](_0x42bc36));_0x2704a4(_0x42bc36);})[_0x53ff('0x16')](function(_0x324b6a){logger['error']('UpdateFaxApplication',_0x324b6a[_0x53ff('0x14')],_0x560de2);_0x51973e(_0x22fde3[_0x53ff('0x12')](0x1f4,_0x324b6a[_0x53ff('0x14')]));});});}; \ No newline at end of file +var _0x6b5b=['message','catch','FaxApplication','update','body','options','where','limit','UpdateFaxApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x37e2f9,_0x14ff7b){var _0x40f3ad=function(_0x2abb25){while(--_0x2abb25){_0x37e2f9['push'](_0x37e2f9['shift']());}};_0x40f3ad(++_0x14ff7b);}(_0x6b5b,0x118));var _0xb6b5=function(_0x1febe9,_0x8dd768){_0x1febe9=_0x1febe9-0x0;var _0x2ed0bf=_0x6b5b[_0x1febe9];return _0x2ed0bf;};'use strict';var _=require(_0xb6b5('0x0'));var util=require(_0xb6b5('0x1'));var moment=require(_0xb6b5('0x2'));var BPromise=require(_0xb6b5('0x3'));var rs=require(_0xb6b5('0x4'));var fs=require('fs');var Redis=require(_0xb6b5('0x5'));var db=require(_0xb6b5('0x6'))['db'];var utils=require(_0xb6b5('0x7'));var logger=require(_0xb6b5('0x8'))('rpc');var config=require(_0xb6b5('0x9'));var jayson=require(_0xb6b5('0xa'));var client=jayson[_0xb6b5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239d01,_0x246e64,_0x161f42){return new BPromise(function(_0xc3494b,_0x9c4bfa){return client[_0xb6b5('0xc')](_0x239d01,_0x161f42)[_0xb6b5('0xd')](function(_0x278101){logger[_0xb6b5('0xe')](_0xb6b5('0xf'),_0x246e64,_0xb6b5('0x10'));logger[_0xb6b5('0x11')](_0xb6b5('0x12'),_0x246e64,_0xb6b5('0x10'),JSON['stringify'](_0x278101));if(_0x278101[_0xb6b5('0x13')]){if(_0x278101[_0xb6b5('0x13')]['code']===0x1f4){logger['error'](_0xb6b5('0xf'),_0x246e64,_0x278101[_0xb6b5('0x13')][_0xb6b5('0x14')]);return _0x9c4bfa(_0x278101[_0xb6b5('0x13')][_0xb6b5('0x14')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x246e64,_0x278101[_0xb6b5('0x13')][_0xb6b5('0x14')]);return _0xc3494b(_0x278101[_0xb6b5('0x13')][_0xb6b5('0x14')]);}else{logger[_0xb6b5('0xe')](_0xb6b5('0xf'),_0x246e64,_0xb6b5('0x10'));_0xc3494b(_0x278101['result']['message']);}})[_0xb6b5('0x15')](function(_0x26ad57){logger[_0xb6b5('0x13')](_0xb6b5('0xf'),_0x246e64,_0x26ad57);_0x9c4bfa(_0x26ad57);});});}exports['UpdateFaxApplication']=function(_0x20bd9b){var _0x42de44=this;return new Promise(function(_0x5d2014,_0x5d7d95){return db[_0xb6b5('0x16')][_0xb6b5('0x17')](_0x20bd9b[_0xb6b5('0x18')],{'raw':_0x20bd9b[_0xb6b5('0x19')]?_0x20bd9b[_0xb6b5('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20bd9b['options']?_0x20bd9b[_0xb6b5('0x19')][_0xb6b5('0x1a')]||null:null,'attributes':_0x20bd9b[_0xb6b5('0x19')]?_0x20bd9b['options']['attributes']||null:null,'limit':_0x20bd9b[_0xb6b5('0x19')]?_0x20bd9b['options'][_0xb6b5('0x1b')]||null:null})[_0xb6b5('0xd')](function(_0x2126d3){logger[_0xb6b5('0xe')]('UpdateFaxApplication',_0x20bd9b);logger[_0xb6b5('0x11')](_0xb6b5('0x1c'),_0x20bd9b,JSON[_0xb6b5('0x1d')](_0x2126d3));_0x5d2014(_0x2126d3);})[_0xb6b5('0x15')](function(_0x1d94fb){logger[_0xb6b5('0x13')](_0xb6b5('0x1c'),_0x1d94fb['message'],_0x20bd9b);_0x5d7d95(_0x42de44['error'](0x1f4,_0x1d94fb[_0xb6b5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0ddaede..c9fa33c 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 _0xbfcc=['exports','multer','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xbfcc[_0x409353];return _0x4f4b59;};'use strict';var multer=require(_0xcbfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcbfc('0x1'));var express=require(_0xcbfc('0x2'));var router=express[_0xcbfc('0x3')]();var auth=require(_0xcbfc('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxApplication.controller');router['get']('/',auth[_0xcbfc('0x5')](),controller[_0xcbfc('0x6')]);router['get'](_0xcbfc('0x7'),auth['isAuthenticated'](),controller[_0xcbfc('0x8')]);router[_0xcbfc('0x9')]('/',auth[_0xcbfc('0x5')](),controller[_0xcbfc('0xa')]);router['put'](_0xcbfc('0x7'),auth[_0xcbfc('0x5')](),controller[_0xcbfc('0xb')]);router[_0xcbfc('0xc')](_0xcbfc('0x7'),auth[_0xcbfc('0x5')](),controller['destroy']);module[_0xcbfc('0xd')]=router; \ No newline at end of file +var _0xef0f=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x3a9968,_0x4efb6d){var _0x5b8690=function(_0x2aabb0){while(--_0x2aabb0){_0x3a9968['push'](_0x3a9968['shift']());}};_0x5b8690(++_0x4efb6d);}(_0xef0f,0x168));var _0xfef0=function(_0xce3443,_0x5be752){_0xce3443=_0xce3443-0x0;var _0x2f6770=_0xef0f[_0xce3443];return _0x2f6770;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var auth=require(_0xfef0('0x4'));var interaction=require(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var controller=require('./faxApplication.controller');router[_0xfef0('0x7')]('/',auth[_0xfef0('0x8')](),controller[_0xfef0('0x9')]);router[_0xfef0('0x7')](_0xfef0('0xa'),auth[_0xfef0('0x8')](),controller['show']);router[_0xfef0('0xb')]('/',auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router[_0xfef0('0xd')](_0xfef0('0xa'),auth[_0xfef0('0x8')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')](_0xfef0('0xa'),auth[_0xfef0('0x8')](),controller[_0xfef0('0x10')]);module[_0xfef0('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index a0e948f..51b8d3a 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 _0xf231=['ENUM','out','sequelize','BOOLEAN','DATE','STRING'];(function(_0x34160a,_0x4029ea){var _0x9c7cb2=function(_0xfe1a76){while(--_0xfe1a76){_0x34160a['push'](_0x34160a['shift']());}};_0x9c7cb2(++_0x4029ea);}(_0xf231,0x1ee));var _0x1f23=function(_0x2b5a7b,_0x51d015){_0x2b5a7b=_0x2b5a7b-0x0;var _0x5dfe8a=_0xf231[_0x2b5a7b];return _0x5dfe8a;};'use strict';var Sequelize=require(_0x1f23('0x0'));module['exports']={'closed':{'type':Sequelize[_0x1f23('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1f23('0x2')]},'disposition':{'type':Sequelize[_0x1f23('0x3')]},'note':{'type':Sequelize[_0x1f23('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x1f23('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1f23('0x4')]('in',_0x1f23('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1f23('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x1f23('0x4')]('in',_0x1f23('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x1157=['DATE','STRING','ENUM','out','sequelize','BOOLEAN'];(function(_0x47cab1,_0x40a0fa){var _0x11e81d=function(_0x2e91c4){while(--_0x2e91c4){_0x47cab1['push'](_0x47cab1['shift']());}};_0x11e81d(++_0x40a0fa);}(_0x1157,0x1a8));var _0x7115=function(_0x39a343,_0x206176){_0x39a343=_0x39a343-0x0;var _0x328ee6=_0x1157[_0x39a343];return _0x328ee6;};'use strict';var Sequelize=require(_0x7115('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7115('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7115('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7115('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7115('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7115('0x4')]('in',_0x7115('0x5')),'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 ddcaf93..5e3fa9a 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 _0xb43b=['find','params','describe','addMessage','ids','omit','getMessages','findOne','sort','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','findAll','emit','faxInteractionTags:save','removeTags','download','join','root','server','attachments','files','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','json','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','name','status','send','closed','FaxMessage','then','unreadMessages','map','TagIds','Tags','split','forEach','catch','index','FaxInteraction','query','keys','intersection','model','attributes','fields','hasOwnProperty','limit','order','where','filters','pick','select','field','color','tools_tags','COUNT(*)','from','fax_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','expr','advancedFilter','parse','createdAt','startOf','utc','format','endOf','day','and','isArray','condition','value','TagId','length','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','Messages.count','filter','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','%s\x20=\x200','toString','having','`Messages.count`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','%s\x20>\x200','sequelize','count','keyBy','a.key','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.FaxInteractionId\x20=\x20i.id','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','show','rawAttributes','includeAll','include','merge','options','create','body'];(function(_0x4ef4f0,_0x32eba4){var _0x183e95=function(_0x172c70){while(--_0x172c70){_0x4ef4f0['push'](_0x4ef4f0['shift']());}};_0x183e95(++_0x32eba4);}(_0xb43b,0x1b2));var _0xbb43=function(_0x421871,_0x3e34b5){_0x421871=_0x421871-0x0;var _0x42e053=_0xb43b[_0x421871];return _0x42e053;};'use strict';var pdf=require(_0xbb43('0x0'));var emlformat=require(_0xbb43('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x2'));var jsonpatch=require(_0xbb43('0x3'));var rp=require(_0xbb43('0x4'));var moment=require('moment');var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb43('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var hardwareService=require(_0xbb43('0x12'));var logger=require(_0xbb43('0x13'))(_0xbb43('0x14'));var utils=require(_0xbb43('0x15'));var config=require(_0xbb43('0x16'));var db=require('../../mysqldb')['db'];config[_0xbb43('0x17')]=_[_0xbb43('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbb43('0x19'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xbb43('0x1a')](socket);function respondWithStatusCode(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xcc;return function(_0x43021d){if(_0x43021d){return _0x5a509f['sendStatus'](_0x68d45d);}return _0x5a509f['status'](_0x68d45d)['end']();};}function respondWithResult(_0x338120,_0x2abce0){_0x2abce0=_0x2abce0||0xc8;return function(_0x57bd1d){if(_0x57bd1d){return _0x338120['status'](_0x2abce0)[_0xbb43('0x1b')](_0x57bd1d);}};}function respondWithFilteredResult(_0x563ce1,_0x5923dc){return function(_0x2b0797){if(_0x2b0797){var _0x8242ab=_0x2b0797['count'],_0x2e3b43=_0x5923dc[_0xbb43('0x1c')],_0x55dd73=_0x5923dc[_0xbb43('0x1c')]+_0x5923dc['limit'],_0x1c16d7;if(_0x55dd73>=_0x8242ab){_0x55dd73=_0x8242ab;_0x1c16d7=0xc8;}else{_0x1c16d7=0xce;}_0x563ce1['status'](_0x1c16d7);return _0x563ce1[_0xbb43('0x1d')](_0xbb43('0x1e'),_0x2e3b43+'-'+_0x55dd73+'/'+_0x8242ab)[_0xbb43('0x1b')](_0x2b0797);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x1f')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x20')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x21')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x22')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x23')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x24')]){delete _0x3874fb[_0xbb43('0x24')];}_0x2da653[_0xbb43('0x25')](_0x226827)[_0xbb43('0x26')](_0x3874fb);};}function getInteractionUnreadMessages(_0x510b05){return new BPromise(function(_0x40b04b,_0x21d386){try{if(_0x510b05[_0xbb43('0x27')]){_0x510b05['unreadMessages']=0x0;_0x40b04b(_0x510b05);}else{return db[_0xbb43('0x28')]['count']({'where':{'FaxInteractionId':_0x510b05['id'],'direction':'in','read':![]}})[_0xbb43('0x29')](function(_0x436fd5){_0x510b05[_0xbb43('0x2a')]=_0x436fd5;_0x40b04b(_0x510b05);});}}catch(_0x1880cd){_0x21d386(_0x1880cd);}});}function getInteractionUsers(_0x555b99,_0x157d62){return new BPromise(function(_0x547a6f,_0x5566cf){try{if(_0x157d62[_0x555b99['id']]){_0x555b99['Users']=_[_0xbb43('0x2b')](_0x157d62[_0x555b99['id']],function(_0x573a05){return{'id':_0x573a05['id']};});}}catch(_0xa7e144){_0x5566cf(_0xa7e144);}_0x547a6f(_0x555b99);});}function getInteractionTags(_0x4511d9,_0xc577ac){return new BPromise(function(_0x596a62,_0x205011){try{if(_0x4511d9[_0xbb43('0x2c')]){_0x4511d9[_0xbb43('0x2d')]=[];_0x4511d9[_0xbb43('0x2c')][_0xbb43('0x2e')](',')[_0xbb43('0x2f')](function(_0x3de482){_0x4511d9[_0xbb43('0x2d')]['push'](_0xc577ac[_0x3de482]);});}delete _0x4511d9[_0xbb43('0x2c')];}catch(_0x3961f5){_0x205011(_0x3961f5);}_0x596a62(_0x4511d9);});}function updateFaxInteraction(_0x15e5f7,_0x244d66,_0x4015ec){return new BPromise(function(_0x37c565,_0x1eae09){return getInteractionUnreadMessages(_0x15e5f7)[_0xbb43('0x29')](function(_0x349a83){return getInteractionUsers(_0x349a83,_0x4015ec);})[_0xbb43('0x29')](function(_0x21346a){return getInteractionTags(_0x21346a,_0x244d66);})[_0xbb43('0x29')](function(_0x2b87c7){_0x37c565(_0x2b87c7);})[_0xbb43('0x30')](function(_0x39062a){_0x1eae09(_0x39062a);});});}exports[_0xbb43('0x31')]=function(_0x549841,_0x39cbd7){var _0x2d2056={},_0x52a694={},_0x285014={'count':0x0,'rows':[]};var _0x2c9a7c=db[_0xbb43('0x32')]['rawAttributes'];_0x52a694['model']=_['keys'](_0x2c9a7c);_0x52a694[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x549841['query']);_0x52a694['filters']=_[_0xbb43('0x35')](_0x52a694[_0xbb43('0x36')],_0x52a694[_0xbb43('0x33')]);_0x2d2056[_0xbb43('0x37')]=_[_0xbb43('0x35')](_0x52a694['model'],qs[_0xbb43('0x38')](_0x549841[_0xbb43('0x33')][_0xbb43('0x38')]));_0x2d2056[_0xbb43('0x37')]=_0x2d2056[_0xbb43('0x37')]['length']?_0x2d2056[_0xbb43('0x37')]:_0x52a694['model'];if(!_0x549841[_0xbb43('0x33')][_0xbb43('0x39')]('nolimit')){_0x2d2056[_0xbb43('0x3a')]=qs['limit'](_0x549841[_0xbb43('0x33')][_0xbb43('0x3a')]);_0x2d2056[_0xbb43('0x1c')]=qs[_0xbb43('0x1c')](_0x549841['query'][_0xbb43('0x1c')]);}_0x2d2056[_0xbb43('0x3b')]=qs['sort'](_0x549841[_0xbb43('0x33')]['sort']);_0x2d2056[_0xbb43('0x3c')]=qs[_0xbb43('0x3d')](_[_0xbb43('0x3e')](_0x549841[_0xbb43('0x33')],_0x52a694[_0xbb43('0x3d')]));var _0x1e762c=[];var _0x4bf8ed=squel[_0xbb43('0x3f')]()['field']('id')[_0xbb43('0x40')](_0xbb43('0x24'))[_0xbb43('0x40')](_0xbb43('0x41'))['from'](_0xbb43('0x42'));var _0x39f75f=squel[_0xbb43('0x3f')]()[_0xbb43('0x40')](_0xbb43('0x43'))[_0xbb43('0x44')](_0xbb43('0x45'),'me')[_0xbb43('0x3c')]('me.FaxInteractionId\x20=\x20i.id')[_0xbb43('0x3c')](_0xbb43('0x46'))['where'](_0xbb43('0x47'));var _0x5d4c19=squel['select']()['field']('u.id')[_0xbb43('0x40')]('ui.FaxInteractionId')[_0xbb43('0x44')]('user_has_fax_interactions','ui')[_0xbb43('0x48')](_0xbb43('0x49'),'u',_0xbb43('0x4a'));var _0x4a0755=squel[_0xbb43('0x3f')]()['from'](_0xbb43('0x4b'),'i')[_0xbb43('0x48')](_0xbb43('0x4c'),'c',_0xbb43('0x4d'))[_0xbb43('0x48')](_0xbb43('0x49'),'o',_0xbb43('0x4e'))['left_join'](_0xbb43('0x4f'),'a',_0xbb43('0x50'))[_0xbb43('0x48')](_0xbb43('0x45'),'me','me.FaxInteractionId\x20=\x20i.id');var _0x46a4af=squel[_0xbb43('0x51')]();if(_0x549841[_0xbb43('0x33')][_0xbb43('0x52')]){var _0x16cf4d=JSON[_0xbb43('0x53')](_0x549841[_0xbb43('0x33')][_0xbb43('0x52')]);_['keys'](_0x16cf4d)[_0xbb43('0x2f')](function(_0x2a8a93){var _0x73d4ce=_0x16cf4d[_0x2a8a93];if(_0x2a8a93===_0xbb43('0x54')){var _0x3402f2=moment(_0x73d4ce['value']['dateStart'])[_0xbb43('0x55')]('day')[_0xbb43('0x56')]()[_0xbb43('0x57')]();var _0x5d043d=moment(_0x5d043d)[_0xbb43('0x56')]()[_0xbb43('0x58')](_0xbb43('0x59'))[_0xbb43('0x57')]();_0x46a4af[_0xbb43('0x5a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3402f2,_0x5d043d);}else{if(_[_0xbb43('0x5b')](_0x73d4ce['condition'])){_0x73d4ce['condition'][_0xbb43('0x2f')](function(_0x1b9307){switch(_0x73d4ce[_0xbb43('0x5c')][_0xbb43('0x5d')]){case'IS':if(_0x2a8a93!==_0xbb43('0x5e')&&_0x2a8a93!=='Messages.count'){if(_['isArray'](_0x73d4ce[_0xbb43('0x5d')])&&_0x73d4ce[_0xbb43('0x5d')][_0xbb43('0x5f')]>0x1){_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x61'),_0x73d4ce[_0xbb43('0x5d')]);}else{_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+'\x20=\x20?',_0x73d4ce[_0xbb43('0x5d')][0x0]);}}break;case'=':_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x62'),_0x73d4ce[_0xbb43('0x5d')]);break;case _0xbb43('0x63'):if(_0x2a8a93===_0xbb43('0x64')){_0x46a4af[_0xbb43('0x5a')](_0xbb43('0x65')+'\x20LIKE\x20?','%'+_0x73d4ce['value']+'%');_0x46a4af['or'](_0xbb43('0x66')+_0xbb43('0x67'),'%'+_0x73d4ce[_0xbb43('0x5d')]+'%');_0x46a4af['or'](_0xbb43('0x68')+_0xbb43('0x67'),'%'+_0x73d4ce[_0xbb43('0x5d')]+'%');}else{_0x46a4af[_0xbb43('0x5a')](_0x73d4ce['tableAlias']+'.'+_0x2a8a93+_0xbb43('0x67'),'%'+_0x73d4ce['value']+'%');}break;case'>':_0x46a4af['and'](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x69'),_0x73d4ce[_0xbb43('0x5d')]);break;case'<':_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x6a'),_0x73d4ce[_0xbb43('0x5d')]);break;}});}else{switch(_0x73d4ce[_0xbb43('0x5c')]['value']){case'IS':if(_0x2a8a93!=='TagId'&&_0x2a8a93!==_0xbb43('0x6b')){if(_[_0xbb43('0x5b')](_0x73d4ce[_0xbb43('0x5d')])&&_0x73d4ce[_0xbb43('0x5d')][_0xbb43('0x5f')]>0x1){_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x61'),_0x73d4ce[_0xbb43('0x5d')]);}else{_0x46a4af['and'](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x62'),_0x73d4ce[_0xbb43('0x5d')][0x0]);}}break;case'=':_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x62'),_0x73d4ce['value']);break;case _0xbb43('0x63'):if(_0x2a8a93===_0xbb43('0x64')){_0x46a4af[_0xbb43('0x5a')](_0xbb43('0x65')+_0xbb43('0x67'),'%'+_0x73d4ce['value']+'%');_0x46a4af['or'](_0xbb43('0x66')+_0xbb43('0x67'),'%'+_0x73d4ce[_0xbb43('0x5d')]+'%');_0x46a4af['or'](_0xbb43('0x68')+_0xbb43('0x67'),'%'+_0x73d4ce[_0xbb43('0x5d')]+'%');}else{_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x67'),'%'+_0x73d4ce[_0xbb43('0x5d')]+'%');}break;case'>':_0x46a4af['and'](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+'\x20>\x20?',_0x73d4ce[_0xbb43('0x5d')]);break;case'<':_0x46a4af[_0xbb43('0x5a')](_0x73d4ce[_0xbb43('0x60')]+'.'+_0x2a8a93+_0xbb43('0x6a'),_0x73d4ce[_0xbb43('0x5d')]);break;}}}});}else{var _0x5cbdb4=_(Object['keys'](_0x549841[_0xbb43('0x33')]))[_0xbb43('0x2b')](function(_0x48f14a){return _0x2c9a7c[_0xbb43('0x39')](_0x48f14a)?_0x48f14a:undefined;})[_0xbb43('0x6c')](function(_0x41d26a){return!_[_0xbb43('0x6d')](_0x41d26a);})[_0xbb43('0x5d')]();if(!_[_0xbb43('0x6e')](_0x5cbdb4)){_0x5cbdb4[_0xbb43('0x2f')](function(_0x42a737){if(_0x42a737===_0xbb43('0x6f')){_0x4a0755[_0xbb43('0x3c')](_0xbb43('0x70'),[][_0xbb43('0x71')](_0x549841[_0xbb43('0x33')][_0x42a737]));}else if(_0x42a737===_0xbb43('0x54')){var _0x566268=JSON['parse'](_0x549841[_0xbb43('0x33')][_0x42a737])[_0xbb43('0x72')];var _0x4758d3=JSON['parse'](_0x549841[_0xbb43('0x33')][_0x42a737])[_0xbb43('0x73')];_0x4a0755[_0xbb43('0x3c')](_0xbb43('0x74'),_0x566268,_0x4758d3);}else{if(_0x549841[_0xbb43('0x33')][_0x42a737]==='null'){_0x4a0755[_0xbb43('0x3c')]('i.'+_0x42a737+_0xbb43('0x75'));}else{_0x4a0755[_0xbb43('0x3c')]('i.'+_0x42a737+'\x20=\x20?',_0x549841[_0xbb43('0x33')][_0x42a737]);}}});}if(_0x549841[_0xbb43('0x33')][_0xbb43('0x6c')]){var _0x38f301=_0x549841[_0xbb43('0x33')][_0xbb43('0x6c')][_0xbb43('0x76')]('\x5c','\x5c\x5c')[_0xbb43('0x76')]('\x27\x27',_0xbb43('0x77'));if(qs[_0xbb43('0x78')](_0x38f301)){_0x46a4af['or'](_0xbb43('0x79'),_0x38f301+'%')['or']('i.fax\x20LIKE\x20?',_0x38f301+'%');}_0x46a4af['or'](_0xbb43('0x7a'),_0x38f301+'%');}}_0x4a0755[_0xbb43('0x3c')](_0x46a4af);if(_0x2d2056[_0xbb43('0x3b')]){_0x2d2056[_0xbb43('0x3b')][_0xbb43('0x2f')](function(_0x4ce918){_0x4a0755['order']('i.'+_0x4ce918[0x0],_0x4ce918[0x1]==='DESC'?![]:!![]);});}_0x4a0755[_0xbb43('0x7b')](_0xbb43('0x7c'));var _0x39ef1e={'type':db[_0xbb43('0x7d')][_0xbb43('0x7e')][_0xbb43('0x7f')],'raw':!![]};var _0x53cd0b=_0x4a0755['clone']()[_0xbb43('0x40')](_0xbb43('0x43'));if(!_0x549841[_0xbb43('0x33')]['advancedFilter']){if(_0x549841[_0xbb43('0x33')]['read']){if(_0x549841[_0xbb43('0x33')]['read']==0x1){_0x53cd0b[_0xbb43('0x3c')](util[_0xbb43('0x57')](_0xbb43('0x80'),_0x39f75f[_0xbb43('0x81')]()));_0x4a0755[_0xbb43('0x82')](_0xbb43('0x83'));}else{_0x53cd0b[_0xbb43('0x3c')](util[_0xbb43('0x57')]('%s\x20>\x200',_0x39f75f[_0xbb43('0x81')]()));_0x4a0755[_0xbb43('0x82')]('`Messages.count`\x20>\x200');}}if(_0x549841[_0xbb43('0x33')][_0xbb43('0x84')]){var _0x3d578d=_['isArray'](_0x549841[_0xbb43('0x33')][_0xbb43('0x84')])?_0x549841[_0xbb43('0x33')][_0xbb43('0x84')]:new Array(_0x549841[_0xbb43('0x33')][_0xbb43('0x84')]);var _0x4f356d=squel[_0xbb43('0x51')]();_0x3d578d['forEach'](function(_0x160d19){_0x4f356d['or'](_0xbb43('0x85'),'%,'+_0x160d19+',%');});_0x4a0755['having'](_0x4f356d);_0x53cd0b[_0xbb43('0x48')](_0xbb43('0x86'),'it','it.FaxInteractionId\x20=\x20i.id');_0x53cd0b['left_join'](_0xbb43('0x42'),'t',_0xbb43('0x87'));_0x53cd0b[_0xbb43('0x3c')](_0xbb43('0x88'),_0x3d578d);}}else{var _0x16cf4d=JSON[_0xbb43('0x53')](_0x549841[_0xbb43('0x33')][_0xbb43('0x52')]);_[_0xbb43('0x34')](_0x16cf4d)[_0xbb43('0x2f')](function(_0x5ce941){var _0x180a2a=_0x16cf4d[_0x5ce941];if(_0x5ce941===_0xbb43('0x5e')){var _0xdaeb62=_0x180a2a['value'];var _0x4b2b94=squel[_0xbb43('0x51')]();_0xdaeb62[_0xbb43('0x2f')](function(_0x145f30){_0x4b2b94['or'](_0xbb43('0x85'),'%,'+_0x145f30+',%');});_0x4a0755['having'](_0x4b2b94);_0x53cd0b[_0xbb43('0x48')]('mail_interaction_has_tags','it',_0xbb43('0x89'));_0x53cd0b[_0xbb43('0x48')](_0xbb43('0x42'),'t','t.id\x20=\x20it.TagId');_0x53cd0b[_0xbb43('0x3c')](_0xbb43('0x88'),_0xdaeb62);}else if(_0x5ce941==='Messages.count'){if(_0x180a2a['value'][_0xbb43('0x5f')]===0x1){if(_0x180a2a[_0xbb43('0x5d')][0x0]===0x1){_0x53cd0b[_0xbb43('0x3c')](util[_0xbb43('0x57')](_0xbb43('0x80'),_0x39f75f[_0xbb43('0x81')]()));_0x4a0755[_0xbb43('0x82')](_0xbb43('0x83'));}else{_0x53cd0b['where'](util[_0xbb43('0x57')](_0xbb43('0x8a'),_0x39f75f[_0xbb43('0x81')]()));_0x4a0755[_0xbb43('0x82')]('`Messages.count`\x20>\x200');}}}});}db[_0xbb43('0x8b')]['query'](_0x53cd0b['toString'](),_0x39ef1e)[_0xbb43('0x29')](function(_0x40f913){_0x285014[_0xbb43('0x8c')]=_0x40f913['length'];if(_0x285014['count']===0x0)return[];return db['sequelize'][_0xbb43('0x33')](_0x4bf8ed[_0xbb43('0x81')](),_0x39ef1e)[_0xbb43('0x29')](function(_0x27a870){_0x1e762c=_[_0xbb43('0x8d')](_0x27a870,'id');_0x39ef1e=_['merge'](_0x39ef1e,{'model':db[_0xbb43('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4a0755['field'](_0xbb43('0x8e'),'Account.key');_0x4a0755['field']('i.*');_0x4a0755[_0xbb43('0x40')](_0xbb43('0x65'),'Contact.firstName');_0x4a0755[_0xbb43('0x40')](_0xbb43('0x66'),_0xbb43('0x8f'));_0x4a0755[_0xbb43('0x40')](_0xbb43('0x68'),_0xbb43('0x90'));_0x4a0755[_0xbb43('0x40')](_0xbb43('0x91'),_0xbb43('0x92'));_0x4a0755[_0xbb43('0x40')](_0xbb43('0x93'),'Contact.mobile');_0x4a0755[_0xbb43('0x40')](_0xbb43('0x94'),_0xbb43('0x95'));_0x4a0755[_0xbb43('0x40')](_0xbb43('0x96'),_0xbb43('0x2c'));_0x4a0755[_0xbb43('0x48')](_0xbb43('0x86'),'it',_0xbb43('0x97'));_0x4a0755[_0xbb43('0x48')](_0xbb43('0x42'),'t','t.id\x20=\x20it.TagId');_0x4a0755['limit'](_0x2d2056[_0xbb43('0x3a')]);_0x4a0755[_0xbb43('0x1c')](_0x2d2056['offset']);return db[_0xbb43('0x8b')]['query'](_0x4a0755[_0xbb43('0x81')](),_0x39ef1e);})[_0xbb43('0x29')](function(_0x436b48){_0x5d4c19[_0xbb43('0x3c')](_0xbb43('0x98'),_[_0xbb43('0x2b')](_0x436b48,'id'));return db['sequelize'][_0xbb43('0x33')](_0x5d4c19[_0xbb43('0x81')](),_0x39ef1e)[_0xbb43('0x29')](function(_0x3cce62){var _0x380530=_[_0xbb43('0x99')](_0x3cce62,_0xbb43('0x9a'));var _0x23e216=[];_0x436b48[_0xbb43('0x2f')](function(_0x32ce38){_0x23e216[_0xbb43('0x9b')](updateFaxInteraction(_0x32ce38,_0x1e762c,_0x380530));});return BPromise[_0xbb43('0x9c')](_0x23e216);});});})[_0xbb43('0x29')](function(_0x15259b){_0x285014[_0xbb43('0x9d')]=_0x15259b;return _0x285014;})['then'](respondWithFilteredResult(_0x39cbd7,_0x2d2056))[_0xbb43('0x30')](handleError(_0x39cbd7,null));};exports[_0xbb43('0x9e')]=function(_0x5287b5,_0x4de272){var _0x28ba92={'raw':![],'where':{'id':_0x5287b5['params']['id']}},_0x5560d0={};_0x5560d0[_0xbb43('0x36')]=_['keys'](db[_0xbb43('0x32')][_0xbb43('0x9f')]);_0x5560d0[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x5287b5['query']);_0x5560d0[_0xbb43('0x3d')]=_[_0xbb43('0x35')](_0x5560d0[_0xbb43('0x36')],_0x5560d0['query']);_0x28ba92[_0xbb43('0x37')]=_[_0xbb43('0x35')](_0x5560d0['model'],qs[_0xbb43('0x38')](_0x5287b5[_0xbb43('0x33')][_0xbb43('0x38')]));_0x28ba92[_0xbb43('0x37')]=_0x28ba92[_0xbb43('0x37')][_0xbb43('0x5f')]?_0x28ba92[_0xbb43('0x37')]:_0x5560d0[_0xbb43('0x36')];if(_0x5287b5[_0xbb43('0x33')][_0xbb43('0xa0')]){_0x28ba92[_0xbb43('0xa1')]=[{'all':!![]}];}_0x28ba92=_[_0xbb43('0xa2')]({},_0x28ba92,_0x5287b5[_0xbb43('0xa3')]);return db[_0xbb43('0x32')]['find'](_0x28ba92)[_0xbb43('0x29')](handleEntityNotFound(_0x4de272,null))[_0xbb43('0x29')](respondWithResult(_0x4de272,null))[_0xbb43('0x30')](handleError(_0x4de272,null));};exports[_0xbb43('0xa4')]=function(_0x50be32,_0x242f05){return db[_0xbb43('0x32')][_0xbb43('0xa4')](_0x50be32[_0xbb43('0xa5')],{})[_0xbb43('0x29')](respondWithResult(_0x242f05,0xc9))['catch'](handleError(_0x242f05,null));};exports[_0xbb43('0x21')]=function(_0x37fd54,_0x5d881a){if(_0x37fd54[_0xbb43('0xa5')]['id']){delete _0x37fd54[_0xbb43('0xa5')]['id'];}return db['FaxInteraction'][_0xbb43('0xa6')]({'where':{'id':_0x37fd54[_0xbb43('0xa7')]['id']}})[_0xbb43('0x29')](handleEntityNotFound(_0x5d881a,null))[_0xbb43('0x29')](saveUpdates(_0x37fd54[_0xbb43('0xa5')],null))['then'](respondWithResult(_0x5d881a,null))[_0xbb43('0x30')](handleError(_0x5d881a,null));};exports[_0xbb43('0x22')]=function(_0x3a73d4,_0x1a851e){return db[_0xbb43('0x32')]['find']({'where':{'id':_0x3a73d4[_0xbb43('0xa7')]['id']}})['then'](handleEntityNotFound(_0x1a851e,null))['then'](removeEntity(_0x1a851e,null))[_0xbb43('0x30')](handleError(_0x1a851e,null));};exports[_0xbb43('0xa8')]=function(_0x3e34d6,_0x3a15dd){return db[_0xbb43('0x32')][_0xbb43('0xa8')]()['then'](respondWithResult(_0x3a15dd,null))['catch'](handleError(_0x3a15dd,null));};exports['addMessage']=function(_0xe7b08a,_0x285758,_0x3c2082){return db[_0xbb43('0x28')][_0xbb43('0xa6')]({'where':{'id':_0xe7b08a[_0xbb43('0xa7')]['id']}})[_0xbb43('0x29')](handleEntityNotFound(_0x285758,null))[_0xbb43('0x29')](function(_0x4d2c51){if(_0x4d2c51){return _0x4d2c51[_0xbb43('0xa9')](_0xe7b08a['body'][_0xbb43('0xaa')],_[_0xbb43('0xab')](_0xe7b08a[_0xbb43('0xa5')],[_0xbb43('0xaa'),'id'])||{});}})[_0xbb43('0x29')](respondWithResult(_0x285758,null))[_0xbb43('0x30')](handleError(_0x285758,null));};exports[_0xbb43('0xac')]=function(_0x3b1d17,_0x1be5c1,_0x55b883){var _0x115fef={'raw':![],'where':{}};var _0x38cf36={};var _0xc1f2c={'count':0x0,'rows':[]};return db[_0xbb43('0x32')][_0xbb43('0xad')]({'where':{'id':_0x3b1d17[_0xbb43('0xa7')]['id']}})['then'](handleEntityNotFound(_0x1be5c1,null))[_0xbb43('0x29')](function(_0x2965ec){if(_0x2965ec){_0x38cf36[_0xbb43('0x36')]=_[_0xbb43('0x34')](db[_0xbb43('0x28')][_0xbb43('0x9f')]);_0x38cf36[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x3b1d17[_0xbb43('0x33')]);_0x38cf36['filters']=_[_0xbb43('0x35')](_0x38cf36[_0xbb43('0x36')],_0x38cf36[_0xbb43('0x33')]);_0x115fef['attributes']=_[_0xbb43('0x35')](_0x38cf36['model'],qs['fields'](_0x3b1d17[_0xbb43('0x33')][_0xbb43('0x38')]));_0x115fef['attributes']=_0x115fef[_0xbb43('0x37')]['length']?_0x115fef[_0xbb43('0x37')]:_0x38cf36[_0xbb43('0x36')];if(!_0x3b1d17[_0xbb43('0x33')]['hasOwnProperty']('nolimit')){_0x115fef['limit']=qs[_0xbb43('0x3a')](_0x3b1d17[_0xbb43('0x33')][_0xbb43('0x3a')]);_0x115fef[_0xbb43('0x1c')]=qs[_0xbb43('0x1c')](_0x3b1d17['query'][_0xbb43('0x1c')]);}_0x115fef[_0xbb43('0x3b')]=qs[_0xbb43('0xae')](_0x3b1d17[_0xbb43('0x33')][_0xbb43('0xae')]);_0x115fef[_0xbb43('0x3c')]=qs['filters'](_['pick'](_0x3b1d17[_0xbb43('0x33')],_0x38cf36[_0xbb43('0x3d')]));_0x115fef['where']['FaxInteractionId']=_0x2965ec['id'];if(_0x3b1d17[_0xbb43('0x33')]['filter']){_0x115fef[_0xbb43('0x3c')]=_[_0xbb43('0xa2')](_0x115fef[_0xbb43('0x3c')],{'$or':_[_0xbb43('0x2b')](_0x115fef['attributes'],function(_0x19b2bb){var _0xaf740c={};_0xaf740c[_0x19b2bb]={'$like':'%'+_0x3b1d17[_0xbb43('0x33')][_0xbb43('0x6c')]+'%'};return _0xaf740c;})});}if(_0x3b1d17[_0xbb43('0x33')][_0xbb43('0x72')]){var _0x49729d=_0x3b1d17['query'][_0xbb43('0x72')][_0xbb43('0x2e')](',');var _0x2e1749={};_0x2e1749[_0x49729d[0x0]]={'$gte':moment(_0x49729d[0x1])[_0xbb43('0x57')](_0xbb43('0xaf'))};_0x115fef['where']=_['merge'](_0x115fef[_0xbb43('0x3c')],_0x2e1749);}_0x115fef=_[_0xbb43('0xa2')]({},_0x115fef,_0x3b1d17[_0xbb43('0xa3')]);return db['FaxMessage'][_0xbb43('0x8c')]({'where':_0x115fef[_0xbb43('0x3c')]})[_0xbb43('0x29')](function(_0x4bc906){_0xc1f2c[_0xbb43('0x8c')]=_0x4bc906;if(_0x3b1d17['query'][_0xbb43('0xa0')]){_0x115fef[_0xbb43('0xa1')]=[{'all':!![]}];}return db[_0xbb43('0x28')]['findAll'](_0x115fef);})[_0xbb43('0x29')](function(_0x30045e){_0xc1f2c[_0xbb43('0x9d')]=_0x30045e;return _0xc1f2c;});}})[_0xbb43('0x29')](respondWithFilteredResult(_0x1be5c1,_0x115fef))[_0xbb43('0x30')](handleError(_0x1be5c1,null));};exports[_0xbb43('0xb0')]=function(_0x339b30,_0x4122e7,_0x301b7f){return db[_0xbb43('0x32')][_0xbb43('0xa6')]({'where':{'id':_0x339b30[_0xbb43('0xa7')]['id']}})[_0xbb43('0x29')](handleEntityNotFound(_0x4122e7,null))[_0xbb43('0x29')](function(_0x5e2afe){if(_0x5e2afe){return _0x5e2afe[_0xbb43('0xb1')](_0x339b30[_0xbb43('0xa5')][_0xbb43('0xaa')],_[_0xbb43('0xab')](_0x339b30[_0xbb43('0xa5')],[_0xbb43('0xaa'),'id'])||{})[_0xbb43('0xb2')](function(){return db[_0xbb43('0xb3')][_0xbb43('0xb4')]({'attributes':['id',_0xbb43('0x24'),_0xbb43('0x41')],'where':{'id':_0x339b30[_0xbb43('0xa5')][_0xbb43('0xaa')]}});})[_0xbb43('0x29')](function(_0x199b58){socket[_0xbb43('0xb5')](_0xbb43('0xb6'),{'id':Number(_0x339b30['params']['id']),'tags':_0x199b58||[]});return{'id':Number(_0x339b30[_0xbb43('0xa7')]['id']),'tags':_0x199b58||[]};});}})['then'](respondWithResult(_0x4122e7,null))['catch'](handleError(_0x4122e7,null));};exports[_0xbb43('0xb7')]=function(_0x1be4de,_0x52e906,_0x5c8b42){return db[_0xbb43('0x32')][_0xbb43('0xa6')]({'where':{'id':_0x1be4de['params']['id']}})[_0xbb43('0x29')](handleEntityNotFound(_0x52e906,null))['then'](function(_0x41f3fe){if(_0x41f3fe){return _0x41f3fe['removeTags'](_0x1be4de[_0xbb43('0x33')][_0xbb43('0xaa')]);}})['then'](respondWithStatusCode(_0x52e906,null))[_0xbb43('0x30')](handleError(_0x52e906,null));};exports[_0xbb43('0xb8')]=function(_0x1ae77c,_0x321b75){var _0x1dd2f5=moment()['unix']()[_0xbb43('0x81')]();var _0x240d76=path[_0xbb43('0xb9')](config[_0xbb43('0xba')],_0xbb43('0xbb'),'files',_0xbb43('0xbc'));var _0x370699=path[_0xbb43('0xb9')](config['root'],'server',_0xbb43('0xbd'),_0xbb43('0xbe'));var _0x193891=path['join'](_0x370699,_0x1dd2f5);var _0x536482=util[_0xbb43('0x57')](_0xbb43('0xbf'),_0x1dd2f5);var _0x35f06d=path[_0xbb43('0xb9')](_0x370699,_0x536482);var _0x235942=![];return db['FaxInteraction'][_0xbb43('0xa6')]({'where':{'id':_0x1ae77c[_0xbb43('0xa7')]['id']}})[_0xbb43('0x29')](handleEntityNotFound(_0x321b75,null))[_0xbb43('0x29')](function(_0x36c375){if(_0x36c375){return _0x36c375[_0xbb43('0xac')]({'attributes':['id','body',_0xbb43('0x54')],'include':[{'model':db[_0xbb43('0xc0')],'as':_0xbb43('0xc0')}]});}return[];})['then'](function(_0x3a3990){_0x235942=_0x3a3990['length'];if(_0x3a3990[_0xbb43('0x5f')]){fs[_0xbb43('0xc1')](_0x193891);for(var _0x8bff1b=0x0;_0x8bff1b<_0x3a3990[_0xbb43('0x5f')];_0x8bff1b++){var _0x59bb83=_0x3a3990[_0x8bff1b];var _0x314771=_0x59bb83['Attachment'];if(_0x314771){var _0x108ac8=path[_0xbb43('0xb9')](_0x240d76,_0x314771[_0xbb43('0xc2')]);if(fs[_0xbb43('0xc3')](_0x108ac8)){fs[_0xbb43('0xc4')](_0x108ac8)['pipe'](fs[_0xbb43('0xc5')](path[_0xbb43('0xb9')](_0x193891,_0x314771[_0xbb43('0xc2')])));}}}}})[_0xbb43('0x29')](function(){if(_0x235942){return new BPromise(function(_0xb8b5c5,_0x597c10){zipdir(_0x193891,{'saveTo':_0x35f06d},function(_0x1ba8b8,_0x3b50e8){if(_0x1ba8b8)return _0x597c10(_0x1ba8b8);return _0xb8b5c5(_0x3b50e8);});});}})[_0xbb43('0x29')](function(){if(_0x235942){return new BPromise(function(_0x4e6ac5,_0x144c62){rimraf(_0x193891,function(_0x570ce3){if(_0x570ce3)_0x144c62(_0x570ce3);return _0x4e6ac5();});});}})['then'](function(){if(_0x235942){return _0x321b75['download'](_0x35f06d,_0x536482,function(_0x585f71){if(_0x585f71){console[_0xbb43('0xc6')]('err',_0x585f71);}else{fs[_0xbb43('0xc7')](_0x35f06d);}});}else{return _0x321b75[_0xbb43('0x23')](0xc8);}})[_0xbb43('0x30')](handleError(_0x321b75,null));}; \ No newline at end of file +var _0xf3cd=['Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','include','merge','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','download','join','attachments','root','server','files','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','pipe','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','send','closed','unreadMessages','FaxMessage','Users','map','TagIds','Tags','split','push','catch','index','FaxInteraction','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','name','color','from','COUNT(*)','fax_messages','me.direction\x20=\x20\x27in\x27','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','parse','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','TagId','c.lastName','filter','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','DESC','group','Sequelize','SELECT','clone','read','%s\x20=\x200','having','%s\x20>\x200','toString','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','`Messages.count`\x20>\x200','sequelize','keyBy','Account.key'];(function(_0xbcd181,_0x14398c){var _0x45e55b=function(_0x397e65){while(--_0x397e65){_0xbcd181['push'](_0xbcd181['shift']());}};_0x45e55b(++_0x14398c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x248bf0,_0x29a685){_0x248bf0=_0x248bf0-0x0;var _0x455c00=_0xf3cd[_0x248bf0];return _0x455c00;};'use strict';var pdf=require(_0xdf3c('0x0'));var emlformat=require(_0xdf3c('0x1'));var rimraf=require(_0xdf3c('0x2'));var zipdir=require(_0xdf3c('0x3'));var jsonpatch=require(_0xdf3c('0x4'));var rp=require(_0xdf3c('0x5'));var moment=require('moment');var BPromise=require(_0xdf3c('0x6'));var Mustache=require(_0xdf3c('0x7'));var util=require(_0xdf3c('0x8'));var path=require('path');var sox=require(_0xdf3c('0x9'));var csv=require(_0xdf3c('0xa'));var ejs=require(_0xdf3c('0xb'));var fs=require('fs');var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var hardwareService=require(_0xdf3c('0x13'));var logger=require(_0xdf3c('0x14'))(_0xdf3c('0x15'));var utils=require(_0xdf3c('0x16'));var config=require(_0xdf3c('0x17'));var db=require(_0xdf3c('0x18'))['db'];config[_0xdf3c('0x19')]=_['defaults'](config[_0xdf3c('0x19')],{'host':_0xdf3c('0x1a'),'port':0x18eb});var socket=require(_0xdf3c('0x1b'))(new Redis(config[_0xdf3c('0x19')]));require('./faxInteraction.socket')[_0xdf3c('0x1c')](socket);function respondWithStatusCode(_0x461079,_0x13ea5f){_0x13ea5f=_0x13ea5f||0xcc;return function(_0x5e0047){if(_0x5e0047){return _0x461079[_0xdf3c('0x1d')](_0x13ea5f);}return _0x461079[_0xdf3c('0x1e')](_0x13ea5f)[_0xdf3c('0x1f')]();};}function respondWithResult(_0x4274fd,_0x21e587){_0x21e587=_0x21e587||0xc8;return function(_0x1a7a5a){if(_0x1a7a5a){return _0x4274fd[_0xdf3c('0x1e')](_0x21e587)[_0xdf3c('0x20')](_0x1a7a5a);}};}function respondWithFilteredResult(_0x2986d0,_0x5d3991){return function(_0x54cdd4){if(_0x54cdd4){var _0x13b0e6=_0x54cdd4[_0xdf3c('0x21')],_0x465e7d=_0x5d3991[_0xdf3c('0x22')],_0xf1da1f=_0x5d3991[_0xdf3c('0x22')]+_0x5d3991[_0xdf3c('0x23')],_0x18d4ec;if(_0xf1da1f>=_0x13b0e6){_0xf1da1f=_0x13b0e6;_0x18d4ec=0xc8;}else{_0x18d4ec=0xce;}_0x2986d0[_0xdf3c('0x1e')](_0x18d4ec);return _0x2986d0[_0xdf3c('0x24')](_0xdf3c('0x25'),_0x465e7d+'-'+_0xf1da1f+'/'+_0x13b0e6)[_0xdf3c('0x20')](_0x54cdd4);}return null;};}function patchUpdates(_0x25487c){return function(_0x5d2390){try{jsonpatch['apply'](_0x5d2390,_0x25487c,!![]);}catch(_0x3aa254){return BPromise['reject'](_0x3aa254);}return _0x5d2390[_0xdf3c('0x26')]();};}function saveUpdates(_0x40e7ec,_0x36552e){return function(_0x38b319){if(_0x38b319){return _0x38b319[_0xdf3c('0x27')](_0x40e7ec)[_0xdf3c('0x28')](function(_0x50d8ca){return _0x50d8ca;});}return null;};}function removeEntity(_0x22a164,_0x213d75){return function(_0x13e3ca){if(_0x13e3ca){return _0x13e3ca[_0xdf3c('0x29')]()[_0xdf3c('0x28')](function(){_0x22a164[_0xdf3c('0x1e')](0xcc)[_0xdf3c('0x1f')]();});}};}function handleEntityNotFound(_0x155f54,_0x18cb46){return function(_0x1adee4){if(!_0x1adee4){_0x155f54['sendStatus'](0x194);}return _0x1adee4;};}function handleError(_0xd284d7,_0x153daa){_0x153daa=_0x153daa||0x1f4;return function(_0x4b57a4){logger[_0xdf3c('0x2a')](_0x4b57a4['stack']);if(_0x4b57a4['name']){delete _0x4b57a4['name'];}_0xd284d7[_0xdf3c('0x1e')](_0x153daa)[_0xdf3c('0x2b')](_0x4b57a4);};}function getInteractionUnreadMessages(_0x52b8f6){return new BPromise(function(_0x5c3b5a,_0x37ecfd){try{if(_0x52b8f6[_0xdf3c('0x2c')]){_0x52b8f6[_0xdf3c('0x2d')]=0x0;_0x5c3b5a(_0x52b8f6);}else{return db[_0xdf3c('0x2e')]['count']({'where':{'FaxInteractionId':_0x52b8f6['id'],'direction':'in','read':![]}})[_0xdf3c('0x28')](function(_0x2a2d94){_0x52b8f6['unreadMessages']=_0x2a2d94;_0x5c3b5a(_0x52b8f6);});}}catch(_0x51e0a4){_0x37ecfd(_0x51e0a4);}});}function getInteractionUsers(_0x1f1d8a,_0x46f0e3){return new BPromise(function(_0x36937e,_0x540f3a){try{if(_0x46f0e3[_0x1f1d8a['id']]){_0x1f1d8a[_0xdf3c('0x2f')]=_[_0xdf3c('0x30')](_0x46f0e3[_0x1f1d8a['id']],function(_0x21e7b8){return{'id':_0x21e7b8['id']};});}}catch(_0x10099e){_0x540f3a(_0x10099e);}_0x36937e(_0x1f1d8a);});}function getInteractionTags(_0x575ae1,_0xda0de0){return new BPromise(function(_0x46b445,_0x522e5f){try{if(_0x575ae1[_0xdf3c('0x31')]){_0x575ae1[_0xdf3c('0x32')]=[];_0x575ae1[_0xdf3c('0x31')][_0xdf3c('0x33')](',')['forEach'](function(_0x33632f){_0x575ae1[_0xdf3c('0x32')][_0xdf3c('0x34')](_0xda0de0[_0x33632f]);});}delete _0x575ae1[_0xdf3c('0x31')];}catch(_0x4c1f49){_0x522e5f(_0x4c1f49);}_0x46b445(_0x575ae1);});}function updateFaxInteraction(_0x474564,_0x3e7a4b,_0x5ddd21){return new BPromise(function(_0x4f68f9,_0x12cc19){return getInteractionUnreadMessages(_0x474564)['then'](function(_0x216115){return getInteractionUsers(_0x216115,_0x5ddd21);})['then'](function(_0x57faba){return getInteractionTags(_0x57faba,_0x3e7a4b);})['then'](function(_0x44a478){_0x4f68f9(_0x44a478);})[_0xdf3c('0x35')](function(_0x1d0b8a){_0x12cc19(_0x1d0b8a);});});}exports[_0xdf3c('0x36')]=function(_0x54c25f,_0x49f147){var _0x3d8557={},_0x49d0f0={},_0x46e40f={'count':0x0,'rows':[]};var _0x17b502=db[_0xdf3c('0x37')][_0xdf3c('0x38')];_0x49d0f0[_0xdf3c('0x39')]=_[_0xdf3c('0x3a')](_0x17b502);_0x49d0f0[_0xdf3c('0x3b')]=_[_0xdf3c('0x3a')](_0x54c25f[_0xdf3c('0x3b')]);_0x49d0f0['filters']=_[_0xdf3c('0x3c')](_0x49d0f0['model'],_0x49d0f0['query']);_0x3d8557[_0xdf3c('0x3d')]=_['intersection'](_0x49d0f0[_0xdf3c('0x39')],qs['fields'](_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x3e')]));_0x3d8557[_0xdf3c('0x3d')]=_0x3d8557[_0xdf3c('0x3d')][_0xdf3c('0x3f')]?_0x3d8557[_0xdf3c('0x3d')]:_0x49d0f0[_0xdf3c('0x39')];if(!_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x40')](_0xdf3c('0x41'))){_0x3d8557[_0xdf3c('0x23')]=qs[_0xdf3c('0x23')](_0x54c25f['query']['limit']);_0x3d8557[_0xdf3c('0x22')]=qs['offset'](_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x22')]);}_0x3d8557[_0xdf3c('0x42')]=qs[_0xdf3c('0x43')](_0x54c25f['query']['sort']);_0x3d8557[_0xdf3c('0x44')]=qs[_0xdf3c('0x45')](_[_0xdf3c('0x46')](_0x54c25f['query'],_0x49d0f0[_0xdf3c('0x45')]));var _0x59041d=[];var _0x6fc3b6=squel[_0xdf3c('0x47')]()['field']('id')[_0xdf3c('0x48')](_0xdf3c('0x49'))[_0xdf3c('0x48')](_0xdf3c('0x4a'))[_0xdf3c('0x4b')]('tools_tags');var _0x410aaf=squel[_0xdf3c('0x47')]()[_0xdf3c('0x48')](_0xdf3c('0x4c'))[_0xdf3c('0x4b')](_0xdf3c('0x4d'),'me')['where']('me.FaxInteractionId\x20=\x20i.id')[_0xdf3c('0x44')](_0xdf3c('0x4e'))['where']('me.read\x20=\x20false');var _0x269723=squel[_0xdf3c('0x47')]()[_0xdf3c('0x48')](_0xdf3c('0x4f'))[_0xdf3c('0x48')](_0xdf3c('0x50'))[_0xdf3c('0x4b')](_0xdf3c('0x51'),'ui')[_0xdf3c('0x52')]('users','u',_0xdf3c('0x53'));var _0x2cfdb2=squel[_0xdf3c('0x47')]()[_0xdf3c('0x4b')](_0xdf3c('0x54'),'i')[_0xdf3c('0x52')](_0xdf3c('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xdf3c('0x52')]('users','o',_0xdf3c('0x56'))['left_join'](_0xdf3c('0x57'),'a',_0xdf3c('0x58'))[_0xdf3c('0x52')](_0xdf3c('0x4d'),'me','me.FaxInteractionId\x20=\x20i.id');var _0x55da0f=squel['expr']();if(_0x54c25f[_0xdf3c('0x3b')]['advancedFilter']){var _0x32d09d=JSON[_0xdf3c('0x59')](_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x5a')]);_[_0xdf3c('0x3a')](_0x32d09d)['forEach'](function(_0x4e7250){var _0x2371aa=_0x32d09d[_0x4e7250];if(_0x4e7250===_0xdf3c('0x5b')){var _0x591018=moment(_0x2371aa[_0xdf3c('0x5c')][_0xdf3c('0x5d')])[_0xdf3c('0x5e')](_0xdf3c('0x5f'))[_0xdf3c('0x60')]()[_0xdf3c('0x61')]();var _0x43e3dd=moment(_0x43e3dd)['utc']()['endOf'](_0xdf3c('0x5f'))[_0xdf3c('0x61')]();_0x55da0f[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x591018,_0x43e3dd);}else{if(_[_0xdf3c('0x64')](_0x2371aa[_0xdf3c('0x65')])){_0x2371aa[_0xdf3c('0x65')][_0xdf3c('0x66')](function(_0x143d01){switch(_0x2371aa[_0xdf3c('0x65')][_0xdf3c('0x5c')]){case'IS':if(_0x4e7250!=='TagId'&&_0x4e7250!==_0xdf3c('0x67')){if(_['isArray'](_0x2371aa['value'])&&_0x2371aa['value']['length']>0x1){_0x55da0f['and'](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+_0xdf3c('0x69'),_0x2371aa['value']);}else{_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+'\x20=\x20?',_0x2371aa[_0xdf3c('0x5c')][0x0]);}}break;case'=':_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+_0xdf3c('0x6a'),_0x2371aa[_0xdf3c('0x5c')]);break;case _0xdf3c('0x6b'):if(_0x4e7250===_0xdf3c('0x6c')){_0x55da0f[_0xdf3c('0x62')](_0xdf3c('0x6d')+_0xdf3c('0x6e'),'%'+_0x2371aa[_0xdf3c('0x5c')]+'%');_0x55da0f['or']('c.lastName'+_0xdf3c('0x6e'),'%'+_0x2371aa[_0xdf3c('0x5c')]+'%');_0x55da0f['or'](_0xdf3c('0x6f')+'\x20LIKE\x20?','%'+_0x2371aa[_0xdf3c('0x5c')]+'%');}else{_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+'\x20LIKE\x20?','%'+_0x2371aa[_0xdf3c('0x5c')]+'%');}break;case'>':_0x55da0f[_0xdf3c('0x62')](_0x2371aa['tableAlias']+'.'+_0x4e7250+_0xdf3c('0x70'),_0x2371aa['value']);break;case'<':_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+_0xdf3c('0x71'),_0x2371aa[_0xdf3c('0x5c')]);break;}});}else{switch(_0x2371aa[_0xdf3c('0x65')][_0xdf3c('0x5c')]){case'IS':if(_0x4e7250!==_0xdf3c('0x72')&&_0x4e7250!==_0xdf3c('0x67')){if(_[_0xdf3c('0x64')](_0x2371aa[_0xdf3c('0x5c')])&&_0x2371aa[_0xdf3c('0x5c')][_0xdf3c('0x3f')]>0x1){_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+_0xdf3c('0x69'),_0x2371aa[_0xdf3c('0x5c')]);}else{_0x55da0f[_0xdf3c('0x62')](_0x2371aa['tableAlias']+'.'+_0x4e7250+'\x20=\x20?',_0x2371aa[_0xdf3c('0x5c')][0x0]);}}break;case'=':_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+'\x20=\x20?',_0x2371aa[_0xdf3c('0x5c')]);break;case'LIKE':if(_0x4e7250==='ContactId'){_0x55da0f[_0xdf3c('0x62')](_0xdf3c('0x6d')+_0xdf3c('0x6e'),'%'+_0x2371aa[_0xdf3c('0x5c')]+'%');_0x55da0f['or'](_0xdf3c('0x73')+_0xdf3c('0x6e'),'%'+_0x2371aa[_0xdf3c('0x5c')]+'%');_0x55da0f['or'](_0xdf3c('0x6f')+_0xdf3c('0x6e'),'%'+_0x2371aa[_0xdf3c('0x5c')]+'%');}else{_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+_0xdf3c('0x6e'),'%'+_0x2371aa['value']+'%');}break;case'>':_0x55da0f[_0xdf3c('0x62')](_0x2371aa[_0xdf3c('0x68')]+'.'+_0x4e7250+_0xdf3c('0x70'),_0x2371aa[_0xdf3c('0x5c')]);break;case'<':_0x55da0f[_0xdf3c('0x62')](_0x2371aa['tableAlias']+'.'+_0x4e7250+_0xdf3c('0x71'),_0x2371aa[_0xdf3c('0x5c')]);break;}}}});}else{var _0x163666=_(Object[_0xdf3c('0x3a')](_0x54c25f[_0xdf3c('0x3b')]))[_0xdf3c('0x30')](function(_0x3c0a8d){return _0x17b502[_0xdf3c('0x40')](_0x3c0a8d)?_0x3c0a8d:undefined;})[_0xdf3c('0x74')](function(_0x1b52cf){return!_['isNil'](_0x1b52cf);})[_0xdf3c('0x5c')]();if(!_[_0xdf3c('0x75')](_0x163666)){_0x163666[_0xdf3c('0x66')](function(_0x1de114){if(_0x1de114===_0xdf3c('0x76')){_0x2cfdb2[_0xdf3c('0x44')](_0xdf3c('0x77'),[]['concat'](_0x54c25f[_0xdf3c('0x3b')][_0x1de114]));}else if(_0x1de114===_0xdf3c('0x5b')){var _0x4e1b77=JSON['parse'](_0x54c25f[_0xdf3c('0x3b')][_0x1de114])[_0xdf3c('0x78')];var _0x3064de=JSON[_0xdf3c('0x59')](_0x54c25f[_0xdf3c('0x3b')][_0x1de114])[_0xdf3c('0x79')];_0x2cfdb2[_0xdf3c('0x44')](_0xdf3c('0x63'),_0x4e1b77,_0x3064de);}else{if(_0x54c25f['query'][_0x1de114]===_0xdf3c('0x7a')){_0x2cfdb2[_0xdf3c('0x44')]('i.'+_0x1de114+_0xdf3c('0x7b'));}else{_0x2cfdb2['where']('i.'+_0x1de114+_0xdf3c('0x6a'),_0x54c25f[_0xdf3c('0x3b')][_0x1de114]);}}});}if(_0x54c25f[_0xdf3c('0x3b')]['filter']){var _0x11c5a5=_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x74')][_0xdf3c('0x7c')]('\x5c','\x5c\x5c')[_0xdf3c('0x7c')]('\x27\x27',_0xdf3c('0x7d'));if(qs['isNumeric'](_0x11c5a5)){_0x55da0f['or']('i.id\x20LIKE\x20?',_0x11c5a5+'%')['or']('i.fax\x20LIKE\x20?',_0x11c5a5+'%');}_0x55da0f['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x11c5a5+'%');}}_0x2cfdb2['where'](_0x55da0f);if(_0x3d8557[_0xdf3c('0x42')]){_0x3d8557[_0xdf3c('0x42')][_0xdf3c('0x66')](function(_0x583105){_0x2cfdb2[_0xdf3c('0x42')]('i.'+_0x583105[0x0],_0x583105[0x1]===_0xdf3c('0x7e')?![]:!![]);});}_0x2cfdb2[_0xdf3c('0x7f')]('i.id');var _0x591936={'type':db[_0xdf3c('0x80')]['QueryTypes'][_0xdf3c('0x81')],'raw':!![]};var _0x4a191f=_0x2cfdb2[_0xdf3c('0x82')]()[_0xdf3c('0x48')](_0xdf3c('0x4c'));if(!_0x54c25f[_0xdf3c('0x3b')]['advancedFilter']){if(_0x54c25f['query'][_0xdf3c('0x83')]){if(_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x83')]==0x1){_0x4a191f[_0xdf3c('0x44')](util[_0xdf3c('0x61')](_0xdf3c('0x84'),_0x410aaf['toString']()));_0x2cfdb2[_0xdf3c('0x85')]('`Messages.count`\x20=\x200');}else{_0x4a191f[_0xdf3c('0x44')](util[_0xdf3c('0x61')](_0xdf3c('0x86'),_0x410aaf[_0xdf3c('0x87')]()));_0x2cfdb2[_0xdf3c('0x85')]('`Messages.count`\x20>\x200');}}if(_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x88')]){var _0x332041=_['isArray'](_0x54c25f['query']['tag'])?_0x54c25f['query'][_0xdf3c('0x88')]:new Array(_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x88')]);var _0x391042=squel[_0xdf3c('0x89')]();_0x332041[_0xdf3c('0x66')](function(_0x5c8e5e){_0x391042['or'](_0xdf3c('0x8a'),'%,'+_0x5c8e5e+',%');});_0x2cfdb2['having'](_0x391042);_0x4a191f[_0xdf3c('0x52')](_0xdf3c('0x8b'),'it',_0xdf3c('0x8c'));_0x4a191f[_0xdf3c('0x52')](_0xdf3c('0x8d'),'t',_0xdf3c('0x8e'));_0x4a191f[_0xdf3c('0x44')](_0xdf3c('0x8f'),_0x332041);}}else{var _0x32d09d=JSON[_0xdf3c('0x59')](_0x54c25f[_0xdf3c('0x3b')][_0xdf3c('0x5a')]);_[_0xdf3c('0x3a')](_0x32d09d)[_0xdf3c('0x66')](function(_0x55fd73){var _0x118ab5=_0x32d09d[_0x55fd73];if(_0x55fd73===_0xdf3c('0x72')){var _0x1e2982=_0x118ab5[_0xdf3c('0x5c')];var _0x5bbe5c=squel[_0xdf3c('0x89')]();_0x1e2982[_0xdf3c('0x66')](function(_0x54b7b8){_0x5bbe5c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x54b7b8+',%');});_0x2cfdb2[_0xdf3c('0x85')](_0x5bbe5c);_0x4a191f[_0xdf3c('0x52')](_0xdf3c('0x90'),'it',_0xdf3c('0x91'));_0x4a191f[_0xdf3c('0x52')]('tools_tags','t',_0xdf3c('0x8e'));_0x4a191f[_0xdf3c('0x44')](_0xdf3c('0x8f'),_0x1e2982);}else if(_0x55fd73===_0xdf3c('0x67')){if(_0x118ab5[_0xdf3c('0x5c')][_0xdf3c('0x3f')]===0x1){if(_0x118ab5['value'][0x0]===0x1){_0x4a191f[_0xdf3c('0x44')](util[_0xdf3c('0x61')](_0xdf3c('0x84'),_0x410aaf[_0xdf3c('0x87')]()));_0x2cfdb2[_0xdf3c('0x85')]('`Messages.count`\x20=\x200');}else{_0x4a191f['where'](util['format'](_0xdf3c('0x86'),_0x410aaf[_0xdf3c('0x87')]()));_0x2cfdb2[_0xdf3c('0x85')](_0xdf3c('0x92'));}}}});}db[_0xdf3c('0x93')][_0xdf3c('0x3b')](_0x4a191f[_0xdf3c('0x87')](),_0x591936)[_0xdf3c('0x28')](function(_0x5c52e2){_0x46e40f[_0xdf3c('0x21')]=_0x5c52e2[_0xdf3c('0x3f')];if(_0x46e40f[_0xdf3c('0x21')]===0x0)return[];return db[_0xdf3c('0x93')][_0xdf3c('0x3b')](_0x6fc3b6[_0xdf3c('0x87')](),_0x591936)['then'](function(_0x428fdd){_0x59041d=_[_0xdf3c('0x94')](_0x428fdd,'id');_0x591936=_['merge'](_0x591936,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2cfdb2[_0xdf3c('0x48')]('a.key',_0xdf3c('0x95'));_0x2cfdb2[_0xdf3c('0x48')]('i.*');_0x2cfdb2[_0xdf3c('0x48')](_0xdf3c('0x6d'),_0xdf3c('0x96'));_0x2cfdb2[_0xdf3c('0x48')](_0xdf3c('0x73'),_0xdf3c('0x97'));_0x2cfdb2['field'](_0xdf3c('0x6f'),_0xdf3c('0x98'));_0x2cfdb2[_0xdf3c('0x48')](_0xdf3c('0x99'),_0xdf3c('0x9a'));_0x2cfdb2[_0xdf3c('0x48')](_0xdf3c('0x9b'),'Contact.mobile');_0x2cfdb2['field'](_0xdf3c('0x9c'),_0xdf3c('0x9d'));_0x2cfdb2[_0xdf3c('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xdf3c('0x31'));_0x2cfdb2['left_join']('fax_interaction_has_tags','it',_0xdf3c('0x8c'));_0x2cfdb2[_0xdf3c('0x52')]('tools_tags','t',_0xdf3c('0x8e'));_0x2cfdb2['limit'](_0x3d8557[_0xdf3c('0x23')]);_0x2cfdb2['offset'](_0x3d8557[_0xdf3c('0x22')]);return db[_0xdf3c('0x93')][_0xdf3c('0x3b')](_0x2cfdb2[_0xdf3c('0x87')](),_0x591936);})[_0xdf3c('0x28')](function(_0x87e942){_0x269723[_0xdf3c('0x44')](_0xdf3c('0x9e'),_[_0xdf3c('0x30')](_0x87e942,'id'));return db[_0xdf3c('0x93')][_0xdf3c('0x3b')](_0x269723[_0xdf3c('0x87')](),_0x591936)[_0xdf3c('0x28')](function(_0x1acc47){var _0x5b3aa5=_[_0xdf3c('0x9f')](_0x1acc47,_0xdf3c('0xa0'));var _0x3d60d0=[];_0x87e942['forEach'](function(_0x2cdf93){_0x3d60d0[_0xdf3c('0x34')](updateFaxInteraction(_0x2cdf93,_0x59041d,_0x5b3aa5));});return BPromise[_0xdf3c('0xa1')](_0x3d60d0);});});})[_0xdf3c('0x28')](function(_0x3da55b){_0x46e40f[_0xdf3c('0xa2')]=_0x3da55b;return _0x46e40f;})[_0xdf3c('0x28')](respondWithFilteredResult(_0x49f147,_0x3d8557))[_0xdf3c('0x35')](handleError(_0x49f147,null));};exports[_0xdf3c('0xa3')]=function(_0x335c0a,_0x258578){var _0x48fa88={'raw':![],'where':{'id':_0x335c0a[_0xdf3c('0xa4')]['id']}},_0x3bc3c9={};_0x3bc3c9[_0xdf3c('0x39')]=_[_0xdf3c('0x3a')](db[_0xdf3c('0x37')][_0xdf3c('0x38')]);_0x3bc3c9[_0xdf3c('0x3b')]=_[_0xdf3c('0x3a')](_0x335c0a[_0xdf3c('0x3b')]);_0x3bc3c9[_0xdf3c('0x45')]=_[_0xdf3c('0x3c')](_0x3bc3c9[_0xdf3c('0x39')],_0x3bc3c9['query']);_0x48fa88[_0xdf3c('0x3d')]=_[_0xdf3c('0x3c')](_0x3bc3c9[_0xdf3c('0x39')],qs[_0xdf3c('0x3e')](_0x335c0a[_0xdf3c('0x3b')][_0xdf3c('0x3e')]));_0x48fa88[_0xdf3c('0x3d')]=_0x48fa88['attributes'][_0xdf3c('0x3f')]?_0x48fa88[_0xdf3c('0x3d')]:_0x3bc3c9[_0xdf3c('0x39')];if(_0x335c0a[_0xdf3c('0x3b')]['includeAll']){_0x48fa88[_0xdf3c('0xa5')]=[{'all':!![]}];}_0x48fa88=_[_0xdf3c('0xa6')]({},_0x48fa88,_0x335c0a['options']);return db[_0xdf3c('0x37')]['find'](_0x48fa88)[_0xdf3c('0x28')](handleEntityNotFound(_0x258578,null))[_0xdf3c('0x28')](respondWithResult(_0x258578,null))['catch'](handleError(_0x258578,null));};exports[_0xdf3c('0xa7')]=function(_0x106d32,_0x2eede9){return db['FaxInteraction']['create'](_0x106d32[_0xdf3c('0xa8')],{})['then'](respondWithResult(_0x2eede9,0xc9))[_0xdf3c('0x35')](handleError(_0x2eede9,null));};exports[_0xdf3c('0x27')]=function(_0x161604,_0x91dd6e){if(_0x161604['body']['id']){delete _0x161604[_0xdf3c('0xa8')]['id'];}return db[_0xdf3c('0x37')]['find']({'where':{'id':_0x161604[_0xdf3c('0xa4')]['id']}})['then'](handleEntityNotFound(_0x91dd6e,null))[_0xdf3c('0x28')](saveUpdates(_0x161604[_0xdf3c('0xa8')],null))['then'](respondWithResult(_0x91dd6e,null))['catch'](handleError(_0x91dd6e,null));};exports[_0xdf3c('0x29')]=function(_0x4e01ca,_0x37ed69){return db[_0xdf3c('0x37')][_0xdf3c('0xa9')]({'where':{'id':_0x4e01ca[_0xdf3c('0xa4')]['id']}})[_0xdf3c('0x28')](handleEntityNotFound(_0x37ed69,null))[_0xdf3c('0x28')](removeEntity(_0x37ed69,null))[_0xdf3c('0x35')](handleError(_0x37ed69,null));};exports[_0xdf3c('0xaa')]=function(_0x42ae0a,_0x3d8ff0){return db[_0xdf3c('0x37')]['describe']()[_0xdf3c('0x28')](respondWithResult(_0x3d8ff0,null))[_0xdf3c('0x35')](handleError(_0x3d8ff0,null));};exports['addMessage']=function(_0x164d11,_0x367e4d,_0x21c508){return db[_0xdf3c('0x2e')][_0xdf3c('0xa9')]({'where':{'id':_0x164d11[_0xdf3c('0xa4')]['id']}})['then'](handleEntityNotFound(_0x367e4d,null))[_0xdf3c('0x28')](function(_0x4b32ec){if(_0x4b32ec){return _0x4b32ec[_0xdf3c('0xab')](_0x164d11[_0xdf3c('0xa8')][_0xdf3c('0xac')],_[_0xdf3c('0xad')](_0x164d11[_0xdf3c('0xa8')],[_0xdf3c('0xac'),'id'])||{});}})['then'](respondWithResult(_0x367e4d,null))[_0xdf3c('0x35')](handleError(_0x367e4d,null));};exports[_0xdf3c('0xae')]=function(_0x5b4e32,_0x2ad761,_0x2501e4){var _0x204b5a={'raw':![],'where':{}};var _0x11b368={};var _0x2cf275={'count':0x0,'rows':[]};return db[_0xdf3c('0x37')][_0xdf3c('0xaf')]({'where':{'id':_0x5b4e32[_0xdf3c('0xa4')]['id']}})['then'](handleEntityNotFound(_0x2ad761,null))['then'](function(_0x44dc52){if(_0x44dc52){_0x11b368[_0xdf3c('0x39')]=_[_0xdf3c('0x3a')](db[_0xdf3c('0x2e')]['rawAttributes']);_0x11b368['query']=_[_0xdf3c('0x3a')](_0x5b4e32['query']);_0x11b368[_0xdf3c('0x45')]=_['intersection'](_0x11b368[_0xdf3c('0x39')],_0x11b368[_0xdf3c('0x3b')]);_0x204b5a[_0xdf3c('0x3d')]=_['intersection'](_0x11b368[_0xdf3c('0x39')],qs[_0xdf3c('0x3e')](_0x5b4e32['query']['fields']));_0x204b5a[_0xdf3c('0x3d')]=_0x204b5a[_0xdf3c('0x3d')][_0xdf3c('0x3f')]?_0x204b5a[_0xdf3c('0x3d')]:_0x11b368[_0xdf3c('0x39')];if(!_0x5b4e32[_0xdf3c('0x3b')][_0xdf3c('0x40')]('nolimit')){_0x204b5a['limit']=qs[_0xdf3c('0x23')](_0x5b4e32[_0xdf3c('0x3b')][_0xdf3c('0x23')]);_0x204b5a[_0xdf3c('0x22')]=qs[_0xdf3c('0x22')](_0x5b4e32[_0xdf3c('0x3b')][_0xdf3c('0x22')]);}_0x204b5a[_0xdf3c('0x42')]=qs[_0xdf3c('0x43')](_0x5b4e32[_0xdf3c('0x3b')][_0xdf3c('0x43')]);_0x204b5a[_0xdf3c('0x44')]=qs[_0xdf3c('0x45')](_[_0xdf3c('0x46')](_0x5b4e32[_0xdf3c('0x3b')],_0x11b368[_0xdf3c('0x45')]));_0x204b5a[_0xdf3c('0x44')][_0xdf3c('0xa0')]=_0x44dc52['id'];if(_0x5b4e32[_0xdf3c('0x3b')]['filter']){_0x204b5a['where']=_[_0xdf3c('0xa6')](_0x204b5a['where'],{'$or':_['map'](_0x204b5a[_0xdf3c('0x3d')],function(_0x5b3f84){var _0x38895b={};_0x38895b[_0x5b3f84]={'$like':'%'+_0x5b4e32[_0xdf3c('0x3b')]['filter']+'%'};return _0x38895b;})});}if(_0x5b4e32['query']['$gte']){var _0x1c7b50=_0x5b4e32[_0xdf3c('0x3b')][_0xdf3c('0x78')]['split'](',');var _0x197b8a={};_0x197b8a[_0x1c7b50[0x0]]={'$gte':moment(_0x1c7b50[0x1])['format'](_0xdf3c('0xb0'))};_0x204b5a['where']=_['merge'](_0x204b5a[_0xdf3c('0x44')],_0x197b8a);}_0x204b5a=_[_0xdf3c('0xa6')]({},_0x204b5a,_0x5b4e32[_0xdf3c('0xb1')]);return db[_0xdf3c('0x2e')][_0xdf3c('0x21')]({'where':_0x204b5a[_0xdf3c('0x44')]})['then'](function(_0x4f017c){_0x2cf275[_0xdf3c('0x21')]=_0x4f017c;if(_0x5b4e32['query'][_0xdf3c('0xb2')]){_0x204b5a[_0xdf3c('0xa5')]=[{'all':!![]}];}return db[_0xdf3c('0x2e')][_0xdf3c('0xb3')](_0x204b5a);})[_0xdf3c('0x28')](function(_0x619c66){_0x2cf275[_0xdf3c('0xa2')]=_0x619c66;return _0x2cf275;});}})['then'](respondWithFilteredResult(_0x2ad761,_0x204b5a))['catch'](handleError(_0x2ad761,null));};exports[_0xdf3c('0xb4')]=function(_0x1446af,_0x3fa455,_0x13a882){return db['FaxInteraction'][_0xdf3c('0xa9')]({'where':{'id':_0x1446af[_0xdf3c('0xa4')]['id']}})[_0xdf3c('0x28')](handleEntityNotFound(_0x3fa455,null))[_0xdf3c('0x28')](function(_0x33ef58){if(_0x33ef58){return _0x33ef58[_0xdf3c('0xb5')](_0x1446af['body'][_0xdf3c('0xac')],_[_0xdf3c('0xad')](_0x1446af['body'],[_0xdf3c('0xac'),'id'])||{})[_0xdf3c('0xb6')](function(){return db[_0xdf3c('0xb7')]['findAll']({'attributes':['id',_0xdf3c('0x49'),_0xdf3c('0x4a')],'where':{'id':_0x1446af[_0xdf3c('0xa8')][_0xdf3c('0xac')]}});})[_0xdf3c('0x28')](function(_0x147769){socket[_0xdf3c('0xb8')](_0xdf3c('0xb9'),{'id':Number(_0x1446af[_0xdf3c('0xa4')]['id']),'tags':_0x147769||[]});return{'id':Number(_0x1446af['params']['id']),'tags':_0x147769||[]};});}})[_0xdf3c('0x28')](respondWithResult(_0x3fa455,null))['catch'](handleError(_0x3fa455,null));};exports[_0xdf3c('0xba')]=function(_0x160568,_0xfcf42f,_0x2d54b6){return db[_0xdf3c('0x37')][_0xdf3c('0xa9')]({'where':{'id':_0x160568[_0xdf3c('0xa4')]['id']}})[_0xdf3c('0x28')](handleEntityNotFound(_0xfcf42f,null))[_0xdf3c('0x28')](function(_0x36a8c7){if(_0x36a8c7){return _0x36a8c7[_0xdf3c('0xba')](_0x160568['query'][_0xdf3c('0xac')]);}})[_0xdf3c('0x28')](respondWithStatusCode(_0xfcf42f,null))['catch'](handleError(_0xfcf42f,null));};exports[_0xdf3c('0xbb')]=function(_0x8fd9e4,_0x367cd3){var _0xb69432=moment()['unix']()[_0xdf3c('0x87')]();var _0xdf510b=path[_0xdf3c('0xbc')](config['root'],'server','files',_0xdf3c('0xbd'));var _0x2ea850=path[_0xdf3c('0xbc')](config[_0xdf3c('0xbe')],_0xdf3c('0xbf'),_0xdf3c('0xc0'),_0xdf3c('0xc1'));var _0x18bb73=path['join'](_0x2ea850,_0xb69432);var _0x1a0613=util['format'](_0xdf3c('0xc2'),_0xb69432);var _0x2b03be=path[_0xdf3c('0xbc')](_0x2ea850,_0x1a0613);var _0x3263e7=![];return db[_0xdf3c('0x37')][_0xdf3c('0xa9')]({'where':{'id':_0x8fd9e4['params']['id']}})[_0xdf3c('0x28')](handleEntityNotFound(_0x367cd3,null))[_0xdf3c('0x28')](function(_0x4d3059){if(_0x4d3059){return _0x4d3059[_0xdf3c('0xae')]({'attributes':['id',_0xdf3c('0xa8'),_0xdf3c('0x5b')],'include':[{'model':db[_0xdf3c('0xc3')],'as':'Attachment'}]});}return[];})[_0xdf3c('0x28')](function(_0x4b6c85){_0x3263e7=_0x4b6c85[_0xdf3c('0x3f')];if(_0x4b6c85[_0xdf3c('0x3f')]){fs[_0xdf3c('0xc4')](_0x18bb73);for(var _0x22b15f=0x0;_0x22b15f<_0x4b6c85[_0xdf3c('0x3f')];_0x22b15f++){var _0x2643be=_0x4b6c85[_0x22b15f];var _0x5be97e=_0x2643be['Attachment'];if(_0x5be97e){var _0x4ee9b8=path[_0xdf3c('0xbc')](_0xdf510b,_0x5be97e[_0xdf3c('0xc5')]);if(fs['existsSync'](_0x4ee9b8)){fs['createReadStream'](_0x4ee9b8)[_0xdf3c('0xc6')](fs['createWriteStream'](path['join'](_0x18bb73,_0x5be97e['basename'])));}}}}})[_0xdf3c('0x28')](function(){if(_0x3263e7){return new BPromise(function(_0x242b95,_0x2ab6bc){zipdir(_0x18bb73,{'saveTo':_0x2b03be},function(_0x5126be,_0x187ce8){if(_0x5126be)return _0x2ab6bc(_0x5126be);return _0x242b95(_0x187ce8);});});}})['then'](function(){if(_0x3263e7){return new BPromise(function(_0x1ce1b6,_0x17ddb7){rimraf(_0x18bb73,function(_0x44df3b){if(_0x44df3b)_0x17ddb7(_0x44df3b);return _0x1ce1b6();});});}})[_0xdf3c('0x28')](function(){if(_0x3263e7){return _0x367cd3[_0xdf3c('0xbb')](_0x2b03be,_0x1a0613,function(_0x467090){if(_0x467090){console[_0xdf3c('0xc7')](_0xdf3c('0xc8'),_0x467090);}else{fs[_0xdf3c('0xc9')](_0x2b03be);}});}else{return _0x367cd3['sendStatus'](0xc8);}})[_0xdf3c('0x35')](handleError(_0x367cd3,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 5adc5b2..2a8fa27 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 _0xfa93=['unreadMessages','length','emit','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','findAll','then','setDataValue'];(function(_0x1d68cc,_0x2e84b4){var _0x303f07=function(_0x281cf6){while(--_0x281cf6){_0x1d68cc['push'](_0x1d68cc['shift']());}};_0x303f07(++_0x2e84b4);}(_0xfa93,0x65));var _0x3fa9=function(_0x5d1817,_0x480d17){_0x5d1817=_0x5d1817-0x0;var _0x3670b4=_0xfa93[_0x5d1817];return _0x3670b4;};'use strict';var EventEmitter=require(_0x3fa9('0x0'));var FaxInteraction=require(_0x3fa9('0x1'))['db'][_0x3fa9('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x3fa9('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3fa9('0x4')](0x0);var events={'afterCreate':_0x3fa9('0x5'),'afterUpdate':_0x3fa9('0x6'),'afterDestroy':_0x3fa9('0x7')};function emitEvent(_0x3cbd14){return function(_0x952712,_0x52b827,_0x426e4c){FaxMessage[_0x3fa9('0x8')]({'where':{'FaxInteractionId':_0x952712['id'],'direction':'in','read':![]},'raw':!![]})[_0x3fa9('0x9')](function(_0x414705){_0x952712[_0x3fa9('0xa')](_0x3fa9('0xb'),_0x414705[_0x3fa9('0xc')]);FaxInteractionEvents[_0x3fa9('0xd')](_0x3cbd14+':'+_0x952712['id'],_0x952712);FaxInteractionEvents[_0x3fa9('0xd')](_0x3cbd14,_0x952712);_0x426e4c(null);})['catch'](_0x426e4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x3fa9('0xe')](e,emitEvent(event));}}module[_0x3fa9('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x9c7e=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c7e,0x87));var _0xe9c7=function(_0x49750c,_0x53ecd7){_0x49750c=_0x49750c-0x0;var _0x5be9e0=_0x9c7e[_0x49750c];return _0x5be9e0;};'use strict';var EventEmitter=require(_0xe9c7('0x0'));var FaxInteraction=require(_0xe9c7('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xe9c7('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe9c7('0x3')](0x0);var events={'afterCreate':_0xe9c7('0x4'),'afterUpdate':_0xe9c7('0x5'),'afterDestroy':_0xe9c7('0x6')};function emitEvent(_0x483e12){return function(_0x1eee34,_0xbf3d0d,_0x5a03d2){FaxMessage[_0xe9c7('0x7')]({'where':{'FaxInteractionId':_0x1eee34['id'],'direction':'in','read':![]},'raw':!![]})[_0xe9c7('0x8')](function(_0x517289){_0x1eee34[_0xe9c7('0x9')](_0xe9c7('0xa'),_0x517289[_0xe9c7('0xb')]);FaxInteractionEvents[_0xe9c7('0xc')](_0x483e12+':'+_0x1eee34['id'],_0x1eee34);FaxInteractionEvents[_0xe9c7('0xc')](_0x483e12,_0x1eee34);_0x5a03d2(null);})[_0xe9c7('0xd')](_0x5a03d2(null));};}for(var e in events){if(events[_0xe9c7('0xe')](e)){var event=events[e];FaxInteraction[_0xe9c7('0xf')](e,emitEvent(event));}}module[_0xe9c7('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 255879a..71e8892 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 _0x7ef4=['FaxInteraction','fax_interactions','changed','format','lodash','util','api','moment','request-promise','path','rimraf','./faxInteraction.attributes','exports','define'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x7ef4,0xba));var _0x47ef=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7ef4[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x47ef('0x0'));var util=require(_0x47ef('0x1'));var logger=require('../../config/logger')(_0x47ef('0x2'));var moment=require(_0x47ef('0x3'));var BPromise=require('bluebird');var rp=require(_0x47ef('0x4'));var fs=require('fs');var path=require(_0x47ef('0x5'));var rimraf=require(_0x47ef('0x6'));var config=require('../../config/environment');var attributes=require(_0x47ef('0x7'));module[_0x47ef('0x8')]=function(_0x4d2c22,_0x15bd7c){return _0x4d2c22[_0x47ef('0x9')](_0x47ef('0xa'),attributes,{'tableName':_0x47ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x433587,_0x9bd3e2,_0x7ea338){if(_0x433587[_0x47ef('0xc')]('closed')){_0x433587['closedAt']=moment()[_0x47ef('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x7ea338(null,_0x433587);}}});}; \ No newline at end of file +var _0x8da5=['changed','closed','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions'];(function(_0x8df18b,_0x499438){var _0x2917f5=function(_0x54a169){while(--_0x54a169){_0x8df18b['push'](_0x8df18b['shift']());}};_0x2917f5(++_0x499438);}(_0x8da5,0x1b5));var _0x58da=function(_0x13f014,_0x41da5a){_0x13f014=_0x13f014-0x0;var _0x212c22=_0x8da5[_0x13f014];return _0x212c22;};'use strict';var _=require('lodash');var util=require(_0x58da('0x0'));var logger=require(_0x58da('0x1'))('api');var moment=require(_0x58da('0x2'));var BPromise=require(_0x58da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58da('0x4'));var rimraf=require(_0x58da('0x5'));var config=require(_0x58da('0x6'));var attributes=require(_0x58da('0x7'));module[_0x58da('0x8')]=function(_0x1ba7be,_0x857c35){return _0x1ba7be[_0x58da('0x9')]('FaxInteraction',attributes,{'tableName':_0x58da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x945a5,_0x268314,_0x99dca2){if(_0x945a5[_0x58da('0xb')](_0x58da('0xc'))){_0x945a5['closedAt']=moment()['format'](_0x58da('0xd'));}_0x99dca2(null,_0x945a5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 2eadc3a..fc36122 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 _0xc03b=['AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','limit','debug'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0xc03b,0xe9));var _0xbc03=function(_0x53c2a9,_0x591554){_0x53c2a9=_0x53c2a9-0x0;var _0x3030a3=_0xc03b[_0x53c2a9];return _0x3030a3;};'use strict';var _=require(_0xbc03('0x0'));var util=require(_0xbc03('0x1'));var moment=require(_0xbc03('0x2'));var BPromise=require(_0xbc03('0x3'));var rs=require(_0xbc03('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc03('0x5'))['db'];var utils=require(_0xbc03('0x6'));var logger=require('../../config/logger')(_0xbc03('0x7'));var config=require(_0xbc03('0x8'));var jayson=require(_0xbc03('0x9'));var client=jayson[_0xbc03('0xa')][_0xbc03('0xb')]({'port':0x232a});config[_0xbc03('0xc')]=_[_0xbc03('0xd')](config[_0xbc03('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xbc03('0xe'))(new Redis(config[_0xbc03('0xc')]));require(_0xbc03('0xf'))[_0xbc03('0x10')](socket);function respondWithRpcPromise(_0x338ea1,_0x1b83d5,_0x2a82ca){return new BPromise(function(_0x4209d1,_0x835c45){return client['request'](_0x338ea1,_0x2a82ca)[_0xbc03('0x11')](function(_0x5b1574){logger[_0xbc03('0x12')](_0xbc03('0x13'),_0x1b83d5,_0xbc03('0x14'));logger['debug'](_0xbc03('0x15'),_0x1b83d5,_0xbc03('0x14'),JSON[_0xbc03('0x16')](_0x5b1574));if(_0x5b1574[_0xbc03('0x17')]){if(_0x5b1574['error'][_0xbc03('0x18')]===0x1f4){logger[_0xbc03('0x17')](_0xbc03('0x13'),_0x1b83d5,_0x5b1574['error']['message']);return _0x835c45(_0x5b1574[_0xbc03('0x17')]['message']);}logger[_0xbc03('0x17')](_0xbc03('0x13'),_0x1b83d5,_0x5b1574[_0xbc03('0x17')][_0xbc03('0x19')]);return _0x4209d1(_0x5b1574[_0xbc03('0x17')][_0xbc03('0x19')]);}else{logger[_0xbc03('0x12')](_0xbc03('0x13'),_0x1b83d5,_0xbc03('0x14'));_0x4209d1(_0x5b1574[_0xbc03('0x1a')]['message']);}})[_0xbc03('0x1b')](function(_0x1b89fe){logger[_0xbc03('0x17')](_0xbc03('0x13'),_0x1b83d5,_0x1b89fe);_0x835c45(_0x1b89fe);});});}exports[_0xbc03('0x1c')]=function(_0x3c5c28){var _0x57e908=this;return new Promise(function(_0x2c0f18,_0x50232e){return db['FaxInteraction'][_0xbc03('0x1d')](_0x3c5c28[_0xbc03('0x1e')],{'raw':_0x3c5c28[_0xbc03('0x1f')]?_0x3c5c28['options'][_0xbc03('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c5c28[_0xbc03('0x1f')]?_0x3c5c28['options'][_0xbc03('0x21')]||null:null,'attributes':_0x3c5c28['options']?_0x3c5c28[_0xbc03('0x1f')][_0xbc03('0x22')]||null:null,'limit':_0x3c5c28[_0xbc03('0x1f')]?_0x3c5c28[_0xbc03('0x1f')][_0xbc03('0x23')]||null:null})[_0xbc03('0x11')](function(_0x5d97f0){logger['info']('UpdateFaxInteraction',_0x3c5c28);logger[_0xbc03('0x24')](_0xbc03('0x1c'),_0x3c5c28,JSON[_0xbc03('0x16')](_0x5d97f0));_0x2c0f18(_0x5d97f0);})[_0xbc03('0x1b')](function(_0x19a74e){logger[_0xbc03('0x17')](_0xbc03('0x1c'),_0x19a74e[_0xbc03('0x19')],_0x3c5c28);_0x50232e(_0x57e908[_0xbc03('0x17')](0x1f4,_0x19a74e[_0xbc03('0x19')]));});});};exports[_0xbc03('0x25')]=function(_0x490bf4){return new Promise(function(_0x4bf350,_0x59483f){return db[_0xbc03('0x26')][_0xbc03('0x27')]({'where':_0x490bf4[_0xbc03('0x1f')]?_0x490bf4['options'][_0xbc03('0x21')]||null:null})[_0xbc03('0x11')](function(_0x1b85d3){if(_0x1b85d3){return _0x1b85d3[_0xbc03('0x28')](_0x490bf4[_0xbc03('0x1e')][_0xbc03('0x29')],_[_0xbc03('0x2a')](_0x490bf4['body'],[_0xbc03('0x29'),'id'])||{});}})[_0xbc03('0x2b')](function(_0x309030){logger['info'](_0xbc03('0x2c'),_0x490bf4);logger['debug']('AddTags',_0x490bf4,JSON['stringify'](_0x309030));_0x4bf350(_0x309030);})['catch'](function(_0x19eba7){logger['error'](_0xbc03('0x2c'),_0x19eba7[_0xbc03('0x19')],_0x490bf4);_0x59483f(_this[_0xbc03('0x17')](0x1f4,_0x19eba7[_0xbc03('0x19')]));});});}; \ No newline at end of file +var _0x508b=['then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','stringify','AddTagsToFaxInteraction','addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request'];(function(_0x395fc2,_0x26eda7){var _0x48e0c6=function(_0x6f9629){while(--_0x6f9629){_0x395fc2['push'](_0x395fc2['shift']());}};_0x48e0c6(++_0x26eda7);}(_0x508b,0xbc));var _0xb508=function(_0x3c9487,_0x1316d5){_0x3c9487=_0x3c9487-0x0;var _0x1149c0=_0x508b[_0x3c9487];return _0x1149c0;};'use strict';var _=require('lodash');var util=require(_0xb508('0x0'));var moment=require('moment');var BPromise=require(_0xb508('0x1'));var rs=require(_0xb508('0x2'));var fs=require('fs');var Redis=require(_0xb508('0x3'));var db=require(_0xb508('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb508('0x5'))(_0xb508('0x6'));var config=require(_0xb508('0x7'));var jayson=require(_0xb508('0x8'));var client=jayson['client'][_0xb508('0x9')]({'port':0x232a});config[_0xb508('0xa')]=_[_0xb508('0xb')](config[_0xb508('0xa')],{'host':_0xb508('0xc'),'port':0x18eb});var socket=require(_0xb508('0xd'))(new Redis(config[_0xb508('0xa')]));require(_0xb508('0xe'))[_0xb508('0xf')](socket);function respondWithRpcPromise(_0x558f8c,_0x11d15e,_0x55346c){return new BPromise(function(_0x2e1472,_0x75d0a9){return client[_0xb508('0x10')](_0x558f8c,_0x55346c)[_0xb508('0x11')](function(_0x20a871){logger[_0xb508('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x11d15e,_0xb508('0x13'));logger[_0xb508('0x14')](_0xb508('0x15'),_0x11d15e,_0xb508('0x13'),JSON['stringify'](_0x20a871));if(_0x20a871[_0xb508('0x16')]){if(_0x20a871['error'][_0xb508('0x17')]===0x1f4){logger[_0xb508('0x16')](_0xb508('0x18'),_0x11d15e,_0x20a871['error'][_0xb508('0x19')]);return _0x75d0a9(_0x20a871[_0xb508('0x16')][_0xb508('0x19')]);}logger[_0xb508('0x16')](_0xb508('0x18'),_0x11d15e,_0x20a871[_0xb508('0x16')][_0xb508('0x19')]);return _0x2e1472(_0x20a871[_0xb508('0x16')][_0xb508('0x19')]);}else{logger[_0xb508('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x11d15e,'request\x20sent');_0x2e1472(_0x20a871[_0xb508('0x1a')]['message']);}})[_0xb508('0x1b')](function(_0x3e3ea1){logger[_0xb508('0x16')](_0xb508('0x18'),_0x11d15e,_0x3e3ea1);_0x75d0a9(_0x3e3ea1);});});}exports[_0xb508('0x1c')]=function(_0x14efcf){var _0x5de6f4=this;return new Promise(function(_0x2f79b,_0xb995a1){return db[_0xb508('0x1d')][_0xb508('0x1e')](_0x14efcf[_0xb508('0x1f')],{'raw':_0x14efcf[_0xb508('0x20')]?_0x14efcf[_0xb508('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14efcf[_0xb508('0x20')]?_0x14efcf['options'][_0xb508('0x21')]||null:null,'attributes':_0x14efcf[_0xb508('0x20')]?_0x14efcf[_0xb508('0x20')][_0xb508('0x22')]||null:null,'limit':_0x14efcf[_0xb508('0x20')]?_0x14efcf['options']['limit']||null:null})[_0xb508('0x11')](function(_0x20d931){logger[_0xb508('0x12')](_0xb508('0x1c'),_0x14efcf);logger[_0xb508('0x14')](_0xb508('0x1c'),_0x14efcf,JSON[_0xb508('0x23')](_0x20d931));_0x2f79b(_0x20d931);})['catch'](function(_0x42fbb9){logger[_0xb508('0x16')](_0xb508('0x1c'),_0x42fbb9[_0xb508('0x19')],_0x14efcf);_0xb995a1(_0x5de6f4[_0xb508('0x16')](0x1f4,_0x42fbb9[_0xb508('0x19')]));});});};exports[_0xb508('0x24')]=function(_0x10cd85){return new Promise(function(_0x1de04a,_0xae4640){return db[_0xb508('0x1d')]['find']({'where':_0x10cd85[_0xb508('0x20')]?_0x10cd85[_0xb508('0x20')]['where']||null:null})[_0xb508('0x11')](function(_0x2d833f){if(_0x2d833f){return _0x2d833f[_0xb508('0x25')](_0x10cd85['body'][_0xb508('0x26')],_['omit'](_0x10cd85[_0xb508('0x1f')],[_0xb508('0x26'),'id'])||{});}})[_0xb508('0x27')](function(_0x60e3a5){logger['info'](_0xb508('0x28'),_0x10cd85);logger['debug'](_0xb508('0x28'),_0x10cd85,JSON[_0xb508('0x23')](_0x60e3a5));_0x1de04a(_0x60e3a5);})[_0xb508('0x1b')](function(_0x1f7fac){logger[_0xb508('0x16')]('AddTags',_0x1f7fac[_0xb508('0x19')],_0x10cd85);_0xae4640(_this[_0xb508('0x16')](0x1f4,_0x1f7fac['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 671a6b4..40a3c98 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 _0x022f=['faxInteraction:','./faxInteraction.events','save','remove','removeListener','register'];(function(_0x161fdc,_0x573ade){var _0x2f1b64=function(_0x2c4f44){while(--_0x2c4f44){_0x161fdc['push'](_0x161fdc['shift']());}};_0x2f1b64(++_0x573ade);}(_0x022f,0x19f));var _0xf022=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x022f[_0x20a584];return _0x4b41a8;};'use strict';var FaxInteractionEvents=require(_0xf022('0x0'));var events=[_0xf022('0x1'),_0xf022('0x2'),'update'];function createListener(_0x58128a,_0x5a87f5){return function(_0x5da8a4){_0x5a87f5['emit'](_0x58128a,_0x5da8a4);};}function removeListener(_0x3527c4,_0x1d460c){return function(){FaxInteractionEvents[_0xf022('0x3')](_0x3527c4,_0x1d460c);};}exports[_0xf022('0x4')]=function(_0x304e13){for(var _0xea2aff=0x0,_0x47bff2=events['length'];_0xea2aff<_0x47bff2;_0xea2aff++){var _0x12e99e=events[_0xea2aff];var _0x420e71=createListener(_0xf022('0x5')+_0x12e99e,_0x304e13);FaxInteractionEvents['on'](_0x12e99e,_0x420e71);}}; \ No newline at end of file +var _0x4502=['register','./faxInteraction.events','update','removeListener'];(function(_0x3e5621,_0x4f71b3){var _0x685398=function(_0x4470fd){while(--_0x4470fd){_0x3e5621['push'](_0x3e5621['shift']());}};_0x685398(++_0x4f71b3);}(_0x4502,0x7d));var _0x2450=function(_0x5f1d3d,_0x4c4f02){_0x5f1d3d=_0x5f1d3d-0x0;var _0x70af62=_0x4502[_0x5f1d3d];return _0x70af62;};'use strict';var FaxInteractionEvents=require(_0x2450('0x0'));var events=['save','remove',_0x2450('0x1')];function createListener(_0x464add,_0x14b855){return function(_0x29fbaf){_0x14b855['emit'](_0x464add,_0x29fbaf);};}function removeListener(_0x4aa129,_0x465ff1){return function(){FaxInteractionEvents[_0x2450('0x2')](_0x4aa129,_0x465ff1);};}exports[_0x2450('0x3')]=function(_0x1ab4ee){for(var _0x4ae2b2=0x0,_0x2c97aa=events['length'];_0x4ae2b2<_0x2c97aa;_0x4ae2b2++){var _0x55247f=events[_0x4ae2b2];var _0x5dad4e=createListener('faxInteraction:'+_0x55247f,_0x1ab4ee);FaxInteractionEvents['on'](_0x55247f,_0x5dad4e);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 337e42d..c6d69a9 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 _0xff5c=['path','express','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','multer','util'];(function(_0x244fc3,_0x1619f4){var _0xfd831e=function(_0x323e09){while(--_0x323e09){_0x244fc3['push'](_0x244fc3['shift']());}};_0xfd831e(++_0x1619f4);}(_0xff5c,0x94));var _0xcff5=function(_0x29f4c9,_0x220a8a){_0x29f4c9=_0x29f4c9-0x0;var _0x3d210e=_0xff5c[_0x29f4c9];return _0x3d210e;};'use strict';var multer=require(_0xcff5('0x0'));var util=require(_0xcff5('0x1'));var path=require(_0xcff5('0x2'));var timeout=require('connect-timeout');var express=require(_0xcff5('0x3'));var router=express['Router']();var auth=require(_0xcff5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcff5('0x5'));var controller=require(_0xcff5('0x6'));router[_0xcff5('0x7')]('/',auth[_0xcff5('0x8')](),controller[_0xcff5('0x9')]);router[_0xcff5('0x7')](_0xcff5('0xa'),auth['isAuthenticated'](),controller[_0xcff5('0xb')]);router[_0xcff5('0x7')](_0xcff5('0xc'),auth[_0xcff5('0x8')](),controller['show']);router[_0xcff5('0x7')](_0xcff5('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xcff5('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xcff5('0xe')]);router[_0xcff5('0xf')]('/',auth[_0xcff5('0x8')](),controller[_0xcff5('0x10')]);router[_0xcff5('0xf')]('/:id/messages',auth[_0xcff5('0x8')](),controller[_0xcff5('0x11')]);router[_0xcff5('0xf')](_0xcff5('0x12'),auth['isAuthenticated'](),interaction[_0xcff5('0x13')](_0xcff5('0x14'),_0xcff5('0x15')),controller[_0xcff5('0x16')]);router[_0xcff5('0x17')](_0xcff5('0xc'),auth[_0xcff5('0x8')](),interaction[_0xcff5('0x13')](_0xcff5('0x14'),_0xcff5('0x18')),controller[_0xcff5('0x19')]);router['delete'](_0xcff5('0xc'),auth[_0xcff5('0x8')](),interaction[_0xcff5('0x13')](_0xcff5('0x14'),_0xcff5('0x1a')),controller[_0xcff5('0x1b')]);router[_0xcff5('0x1c')](_0xcff5('0x12'),auth[_0xcff5('0x8')](),controller[_0xcff5('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xb2cd=['show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/:id'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xb2cd,0xe3));var _0xdb2c=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xb2cd[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0xdb2c('0x0'));var util=require('util');var path=require(_0xdb2c('0x1'));var timeout=require(_0xdb2c('0x2'));var express=require(_0xdb2c('0x3'));var router=express[_0xdb2c('0x4')]();var auth=require(_0xdb2c('0x5'));var interaction=require(_0xdb2c('0x6'));var config=require(_0xdb2c('0x7'));var controller=require(_0xdb2c('0x8'));router[_0xdb2c('0x9')]('/',auth[_0xdb2c('0xa')](),controller[_0xdb2c('0xb')]);router['get']('/describe',auth[_0xdb2c('0xa')](),controller['describe']);router[_0xdb2c('0x9')](_0xdb2c('0xc'),auth['isAuthenticated'](),controller[_0xdb2c('0xd')]);router['get'](_0xdb2c('0xe'),auth[_0xdb2c('0xa')](),controller[_0xdb2c('0xf')]);router[_0xdb2c('0x9')]('/:id/download',auth[_0xdb2c('0xa')](),controller[_0xdb2c('0x10')]);router[_0xdb2c('0x11')]('/',auth[_0xdb2c('0xa')](),controller['create']);router[_0xdb2c('0x11')](_0xdb2c('0xe'),auth[_0xdb2c('0xa')](),controller[_0xdb2c('0x12')]);router[_0xdb2c('0x11')](_0xdb2c('0x13'),auth['isAuthenticated'](),interaction[_0xdb2c('0x14')](_0xdb2c('0x15'),_0xdb2c('0x16')),controller[_0xdb2c('0x17')]);router['put'](_0xdb2c('0xc'),auth[_0xdb2c('0xa')](),interaction[_0xdb2c('0x14')](_0xdb2c('0x15'),_0xdb2c('0x18')),controller[_0xdb2c('0x19')]);router['delete'](_0xdb2c('0xc'),auth[_0xdb2c('0xa')](),interaction[_0xdb2c('0x14')]('fax','faxinteraction:destroy'),controller[_0xdb2c('0x1a')]);router[_0xdb2c('0x1b')](_0xdb2c('0x13'),auth[_0xdb2c('0xa')](),controller[_0xdb2c('0x1c')]);module[_0xdb2c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index a6afea6..df06a55 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 _0x17d3=['TEXT','DATE','sequelize','exports','medium','ENUM','out'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0x17d3,0x121));var _0x317d=function(_0x349429,_0x220525){_0x349429=_0x349429-0x0;var _0x3a1990=_0x17d3[_0x349429];return _0x3a1990;};'use strict';var Sequelize=require(_0x317d('0x0'));module[_0x317d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x317d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x317d('0x3')]('in',_0x317d('0x4')),'defaultValue':_0x317d('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x317d('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x317d('0x6')]}}; \ No newline at end of file +var _0xdd92=['ENUM','out','sequelize','exports','TEXT','medium'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xdd92,0x188));var _0x2dd9=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xdd92[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require(_0x2dd9('0x0'));module[_0x2dd9('0x1')]={'body':{'type':Sequelize[_0x2dd9('0x2')](_0x2dd9('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2dd9('0x4')]('in',_0x2dd9('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x2dd9('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 29debd4..72fc97c 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 _0xb7cf=['FaxMessage','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','rawAttributes','length','update','body','find','params','../../config/logger','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','interaction','role','null','AcceptMessage','manual','channel','event','EventManager','acceptmessage','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','SIP/%s','create','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','files','attachments','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','test','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','sendStatus','stack','name','index'];(function(_0x30f369,_0x529575){var _0x42d60e=function(_0x500015){while(--_0x500015){_0x30f369['push'](_0x30f369['shift']());}};_0x42d60e(++_0x529575);}(_0xb7cf,0xca));var _0xfb7c=function(_0x1d7599,_0x49929f){_0x1d7599=_0x1d7599-0x0;var _0x55da12=_0xb7cf[_0x1d7599];return _0x55da12;};'use strict';var pdf=require(_0xfb7c('0x0'));var emlformat=require(_0xfb7c('0x1'));var rimraf=require(_0xfb7c('0x2'));var zipdir=require(_0xfb7c('0x3'));var jsonpatch=require(_0xfb7c('0x4'));var rp=require('request-promise');var moment=require(_0xfb7c('0x5'));var BPromise=require(_0xfb7c('0x6'));var Mustache=require(_0xfb7c('0x7'));var util=require(_0xfb7c('0x8'));var path=require(_0xfb7c('0x9'));var sox=require(_0xfb7c('0xa'));var csv=require(_0xfb7c('0xb'));var ejs=require(_0xfb7c('0xc'));var fs=require('fs');var _=require(_0xfb7c('0xd'));var squel=require(_0xfb7c('0xe'));var crypto=require(_0xfb7c('0xf'));var jsforce=require(_0xfb7c('0x10'));var deskjs=require(_0xfb7c('0x11'));var toCsv=require(_0xfb7c('0xb'));var querystring=require('querystring');var Papa=require(_0xfb7c('0x12'));var Redis=require(_0xfb7c('0x13'));var authService=require(_0xfb7c('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfb7c('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xfb7c('0x16'));var config=require(_0xfb7c('0x17'));var db=require(_0xfb7c('0x18'))['db'];config[_0xfb7c('0x19')]=_[_0xfb7c('0x1a')](config[_0xfb7c('0x19')],{'host':_0xfb7c('0x1b'),'port':0x18eb});var socket=require(_0xfb7c('0x1c'))(new Redis(config['redis']));require(_0xfb7c('0x1d'))[_0xfb7c('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfb7c('0x1f')][_0xfb7c('0x20')]({'port':0x232c});var client9002=jayson[_0xfb7c('0x1f')][_0xfb7c('0x20')]({'port':0x232a});function checkPasswordPattern(_0x4d4339,_0x10f26f,_0x536122){if(_0x536122){var _0x580250=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x580250[_0xfb7c('0x21')](_0x10f26f)){return _0x4d4339;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4d4339;}}function respondWithRpcPromise(_0xa66d3a,_0x2f041d,_0x2a0241,_0x133acf){return new BPromise(function(_0x493d7b,_0x20115a){var _0x4f0c3b=_0x133acf||client;return _0x4f0c3b[_0xfb7c('0x22')](_0xa66d3a,_0x2a0241)[_0xfb7c('0x23')](function(_0x3b2298){logger[_0xfb7c('0x24')](_0xfb7c('0x25'),_0x2f041d,_0xfb7c('0x26'));logger[_0xfb7c('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2f041d,_0xfb7c('0x26'),JSON['stringify'](_0x3b2298));if(_0x3b2298[_0xfb7c('0x28')]){if(_0x3b2298[_0xfb7c('0x28')][_0xfb7c('0x29')]===0x1f4){logger[_0xfb7c('0x28')](_0xfb7c('0x25'),_0x2f041d,_0x3b2298[_0xfb7c('0x28')][_0xfb7c('0x2a')]);return _0x20115a(_0x3b2298[_0xfb7c('0x28')][_0xfb7c('0x2a')]);}logger['error'](_0xfb7c('0x25'),_0x2f041d,_0x3b2298['error']['message']);return _0x493d7b(_0x3b2298[_0xfb7c('0x28')][_0xfb7c('0x2a')]);}else{logger['info'](_0xfb7c('0x25'),_0x2f041d,'request\x20sent');_0x493d7b(_0x3b2298['result'][_0xfb7c('0x2a')]);}})[_0xfb7c('0x2b')](function(_0x340680){logger[_0xfb7c('0x28')](_0xfb7c('0x25'),_0x2f041d,_0x340680);_0x20115a(_0x340680);});});}function respondWithStatusCode(_0x39dbc7,_0x32a707){_0x32a707=_0x32a707||0xcc;return function(_0x294f37){if(_0x294f37){return _0x39dbc7['sendStatus'](_0x32a707);}return _0x39dbc7[_0xfb7c('0x2c')](_0x32a707)[_0xfb7c('0x2d')]();};}function respondWithResult(_0x561d3a,_0x57d4a2){_0x57d4a2=_0x57d4a2||0xc8;return function(_0x5d0824){if(_0x5d0824){return _0x561d3a[_0xfb7c('0x2c')](_0x57d4a2)['json'](_0x5d0824);}};}function respondWithFilteredResult(_0x4a423a,_0x5c779d){return function(_0x10e338){if(_0x10e338){var _0x20df6a=_0x10e338[_0xfb7c('0x2e')],_0xc1f324=_0x5c779d[_0xfb7c('0x2f')],_0x2f1a20=_0x5c779d[_0xfb7c('0x2f')]+_0x5c779d[_0xfb7c('0x30')],_0x207735;if(_0x2f1a20>=_0x20df6a){_0x2f1a20=_0x20df6a;_0x207735=0xc8;}else{_0x207735=0xce;}_0x4a423a[_0xfb7c('0x2c')](_0x207735);return _0x4a423a[_0xfb7c('0x31')](_0xfb7c('0x32'),_0xc1f324+'-'+_0x2f1a20+'/'+_0x20df6a)[_0xfb7c('0x33')](_0x10e338);}return null;};}function patchUpdates(_0x4cd807){return function(_0xe4c0b9){try{jsonpatch[_0xfb7c('0x34')](_0xe4c0b9,_0x4cd807,!![]);}catch(_0x212c3c){return BPromise[_0xfb7c('0x35')](_0x212c3c);}return _0xe4c0b9[_0xfb7c('0x36')]();};}function saveUpdates(_0x4f1a80,_0x140ffd){return function(_0x872367){if(_0x872367){return _0x872367['update'](_0x4f1a80)['then'](function(_0x598a95){return _0x598a95;});}return null;};}function removeEntity(_0x5b9e17,_0xc48e75){return function(_0x2ad304){if(_0x2ad304){return _0x2ad304[_0xfb7c('0x37')]()[_0xfb7c('0x23')](function(){_0x5b9e17[_0xfb7c('0x2c')](0xcc)[_0xfb7c('0x2d')]();});}};}function handleEntityNotFound(_0x1b3528,_0x571b62){return function(_0x16b57a){if(!_0x16b57a){_0x1b3528[_0xfb7c('0x38')](0x194);}return _0x16b57a;};}function handleError(_0x4d3480,_0x1013ef){_0x1013ef=_0x1013ef||0x1f4;return function(_0x44be9c){logger['error'](_0x44be9c[_0xfb7c('0x39')]);if(_0x44be9c[_0xfb7c('0x3a')]){delete _0x44be9c[_0xfb7c('0x3a')];}_0x4d3480[_0xfb7c('0x2c')](_0x1013ef)['send'](_0x44be9c);};}exports[_0xfb7c('0x3b')]=function(_0x59723c,_0x2fd6f1){var _0x66339d={},_0x5a2045={},_0x16f329={'count':0x0,'rows':[]};var _0x154bc2=db[_0xfb7c('0x3c')]['rawAttributes'];_0x5a2045[_0xfb7c('0x3d')]=_[_0xfb7c('0x3e')](_0x154bc2);_0x5a2045[_0xfb7c('0x3f')]=_[_0xfb7c('0x3e')](_0x59723c[_0xfb7c('0x3f')]);_0x5a2045[_0xfb7c('0x40')]=_[_0xfb7c('0x41')](_0x5a2045['model'],_0x5a2045[_0xfb7c('0x3f')]);_0x66339d[_0xfb7c('0x42')]=_['intersection'](_0x5a2045['model'],qs[_0xfb7c('0x43')](_0x59723c[_0xfb7c('0x3f')][_0xfb7c('0x43')]));_0x66339d['attributes']=_0x66339d[_0xfb7c('0x42')]['length']?_0x66339d[_0xfb7c('0x42')]:_0x5a2045[_0xfb7c('0x3d')];if(!_0x59723c[_0xfb7c('0x3f')][_0xfb7c('0x44')]('nolimit')){_0x66339d[_0xfb7c('0x30')]=qs[_0xfb7c('0x30')](_0x59723c['query'][_0xfb7c('0x30')]);_0x66339d[_0xfb7c('0x2f')]=qs[_0xfb7c('0x2f')](_0x59723c[_0xfb7c('0x3f')][_0xfb7c('0x2f')]);}_0x66339d['order']=qs[_0xfb7c('0x45')](_0x59723c['query'][_0xfb7c('0x45')]);_0x66339d[_0xfb7c('0x46')]=qs[_0xfb7c('0x40')](_['pick'](_0x59723c['query'],_0x5a2045[_0xfb7c('0x40')]));if(_0x59723c['query'][_0xfb7c('0x47')]){_0x66339d[_0xfb7c('0x46')]=_[_0xfb7c('0x48')](_0x66339d[_0xfb7c('0x46')],{'$or':_[_0xfb7c('0x49')](_0x154bc2,function(_0x305215){if(_0x305215['type'][_0xfb7c('0x4a')]!==_0xfb7c('0x4b')){var _0x4239ee={};_0x4239ee[_0x305215[_0xfb7c('0x4c')]]={'$like':'%'+_0x59723c[_0xfb7c('0x3f')]['filter']+'%'};return _0x4239ee;}})});}_0x66339d=_[_0xfb7c('0x48')]({},_0x66339d,_0x59723c[_0xfb7c('0x4d')]);var _0x210d08={'where':_0x66339d[_0xfb7c('0x46')]};return db['FaxMessage'][_0xfb7c('0x2e')](_0x210d08)[_0xfb7c('0x23')](function(_0x348610){_0x16f329[_0xfb7c('0x2e')]=_0x348610;if(_0x59723c[_0xfb7c('0x3f')][_0xfb7c('0x4e')]){_0x66339d[_0xfb7c('0x4f')]=[{'all':!![]}];}return db['FaxMessage'][_0xfb7c('0x50')](_0x66339d);})[_0xfb7c('0x23')](function(_0x506583){_0x16f329[_0xfb7c('0x51')]=_0x506583;return _0x16f329;})[_0xfb7c('0x23')](respondWithFilteredResult(_0x2fd6f1,_0x66339d))[_0xfb7c('0x2b')](handleError(_0x2fd6f1,null));};exports[_0xfb7c('0x52')]=function(_0x29098f,_0x1bf217){var _0x1fbbca={'raw':!![],'where':{'id':_0x29098f['params']['id']}},_0x2b054d={};_0x2b054d[_0xfb7c('0x3d')]=_[_0xfb7c('0x3e')](db[_0xfb7c('0x3c')][_0xfb7c('0x53')]);_0x2b054d[_0xfb7c('0x3f')]=_[_0xfb7c('0x3e')](_0x29098f[_0xfb7c('0x3f')]);_0x2b054d[_0xfb7c('0x40')]=_[_0xfb7c('0x41')](_0x2b054d[_0xfb7c('0x3d')],_0x2b054d[_0xfb7c('0x3f')]);_0x1fbbca[_0xfb7c('0x42')]=_['intersection'](_0x2b054d['model'],qs['fields'](_0x29098f[_0xfb7c('0x3f')][_0xfb7c('0x43')]));_0x1fbbca[_0xfb7c('0x42')]=_0x1fbbca[_0xfb7c('0x42')][_0xfb7c('0x54')]?_0x1fbbca[_0xfb7c('0x42')]:_0x2b054d[_0xfb7c('0x3d')];if(_0x29098f[_0xfb7c('0x3f')][_0xfb7c('0x4e')]){_0x1fbbca['include']=[{'all':!![]}];}_0x1fbbca=_['merge']({},_0x1fbbca,_0x29098f[_0xfb7c('0x4d')]);return db[_0xfb7c('0x3c')]['find'](_0x1fbbca)[_0xfb7c('0x23')](handleEntityNotFound(_0x1bf217,null))[_0xfb7c('0x23')](respondWithResult(_0x1bf217,null))[_0xfb7c('0x2b')](handleError(_0x1bf217,null));};exports[_0xfb7c('0x55')]=function(_0x39ee98,_0x1d222e){if(_0x39ee98[_0xfb7c('0x56')]['id']){delete _0x39ee98[_0xfb7c('0x56')]['id'];}return db[_0xfb7c('0x3c')][_0xfb7c('0x57')]({'where':{'id':_0x39ee98[_0xfb7c('0x58')]['id']}})[_0xfb7c('0x23')](handleEntityNotFound(_0x1d222e,null))[_0xfb7c('0x23')](saveUpdates(_0x39ee98[_0xfb7c('0x56')],null))[_0xfb7c('0x23')](respondWithResult(_0x1d222e,null))[_0xfb7c('0x2b')](handleError(_0x1d222e,null));};exports['destroy']=function(_0xac62ef,_0x572976){return db[_0xfb7c('0x3c')][_0xfb7c('0x57')]({'where':{'id':_0xac62ef['params']['id']}})[_0xfb7c('0x23')](handleEntityNotFound(_0x572976,null))[_0xfb7c('0x23')](removeEntity(_0x572976,null))[_0xfb7c('0x2b')](handleError(_0x572976,null));};exports['describe']=function(_0x5913d5,_0x3ed7fe){return db[_0xfb7c('0x3c')]['describe']()[_0xfb7c('0x23')](respondWithResult(_0x3ed7fe,null))[_0xfb7c('0x2b')](handleError(_0x3ed7fe,null));};var interaction_log=require(_0xfb7c('0x59'))(_0xfb7c('0x5a'));exports[_0xfb7c('0x5b')]=function(_0x2c1b73,_0x18ec18,_0x5cc22a){var _0x84f259={'channel':_0xfb7c('0x5c')};if(_0x2c1b73['body']['id']){delete _0x2c1b73['body']['id'];}_0x2c1b73[_0xfb7c('0x56')][_0xfb7c('0x5d')]=!![];_0x2c1b73['body']['readAt']=moment()[_0xfb7c('0x5e')](_0xfb7c('0x5f'));_0x2c1b73[_0xfb7c('0x56')][_0xfb7c('0x60')]=_0x2c1b73[_0xfb7c('0x56')][_0xfb7c('0x60')]||_0x2c1b73[_0xfb7c('0x61')]['id'];return db[_0xfb7c('0x3c')][_0xfb7c('0x57')]({'where':{'id':_0x2c1b73[_0xfb7c('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xfb7c('0x62')],'as':_0xfb7c('0x63')}]})['then'](handleEntityNotFound(_0x18ec18,null))[_0xfb7c('0x23')](saveUpdates(_0x2c1b73['body'],null))['then'](function(_0x44d63d){if(_0x44d63d){_0x84f259[_0xfb7c('0x2a')]=_0x44d63d[_0xfb7c('0x64')]({'plain':!![]});return db[_0xfb7c('0x65')][_0xfb7c('0x57')]({'where':{'id':_0x44d63d[_0xfb7c('0x66')]}});}return null;})[_0xfb7c('0x23')](handleEntityNotFound(_0x18ec18,null))[_0xfb7c('0x23')](function(_0xd052e5){if(_0xd052e5){return _0xd052e5[_0xfb7c('0x55')]({'UserId':_0x2c1b73['body'][_0xfb7c('0x60')],'read1stAt':_[_0xfb7c('0x67')](_0xd052e5['read1stAt'])?moment()['format'](_0xfb7c('0x5f')):undefined});}return null;})['then'](function(_0x189fcc){if(_0x189fcc){_0x84f259[_0xfb7c('0x68')]=_0x189fcc[_0xfb7c('0x64')]({'plain':!![]});interaction_log[_0xfb7c('0x24')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c1b73[_0xfb7c('0x61')]['id'],_0x2c1b73[_0xfb7c('0x61')][_0xfb7c('0x3a')],_0x2c1b73['user'][_0xfb7c('0x69')],_0x84f259[_0xfb7c('0x68')]['id'],_0x2c1b73[_0xfb7c('0x56')]?JSON['stringify'](_0x2c1b73[_0xfb7c('0x56')]):_0xfb7c('0x6a'));return respondWithRpcPromise(_0xfb7c('0x6b'),'acceptMessage',_0x84f259);}return null;})['then'](function(_0x5e65aa){if(_0x5e65aa){if(_0x2c1b73[_0xfb7c('0x56')][_0xfb7c('0x6c')]){_0x84f259[_0xfb7c('0x2a')]['interface']=util[_0xfb7c('0x5e')]('SIP/%s',_0x2c1b73[_0xfb7c('0x61')][_0xfb7c('0x3a')]);_0x84f259['message'][_0xfb7c('0x6d')]=_0x84f259[_0xfb7c('0x6d')];_0x84f259[_0xfb7c('0x2a')][_0xfb7c('0x6e')]=_0xfb7c('0x5b');return respondWithRpcPromise(_0xfb7c('0x6f'),'EventManager',{'event':_0xfb7c('0x70'),'message':_0x84f259[_0xfb7c('0x2a')]},client9002)[_0xfb7c('0x23')](function(){return _0x84f259;});}return _0x84f259;}return null;})['then'](respondWithResult(_0x18ec18,null))[_0xfb7c('0x2b')](handleError(_0x18ec18,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['reject']=function(_0x140bb0,_0x24af61,_0x2de784){var _0x59cbc8={'agent':{},'channel':_0xfb7c('0x5c')};if(_0x140bb0[_0xfb7c('0x56')]['id']){delete _0x140bb0[_0xfb7c('0x56')]['id'];}_0x140bb0[_0xfb7c('0x56')]['UserId']=_0x140bb0[_0xfb7c('0x56')]['UserId']||_0x140bb0[_0xfb7c('0x61')]['id'];_0x59cbc8[_0xfb7c('0x71')]['id']=_0x140bb0[_0xfb7c('0x56')][_0xfb7c('0x60')];return db[_0xfb7c('0x3c')]['find']({'where':{'id':_0x140bb0[_0xfb7c('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24af61,null))[_0xfb7c('0x23')](function(_0x1db0cc){if(_0x1db0cc){_0x59cbc8['message']=_0x1db0cc[_0xfb7c('0x64')]({'plain':!![]});return db[_0xfb7c('0x65')]['find']({'where':{'id':_0x1db0cc[_0xfb7c('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x24af61,null))['then'](function(_0x3d0549){if(_0x3d0549){_0x59cbc8['interaction']=_0x3d0549[_0xfb7c('0x64')]({'plain':!![]});interaction_log[_0xfb7c('0x24')](_0xfb7c('0x72'),_0x140bb0['user']['id'],_0x140bb0[_0xfb7c('0x61')]['name'],_0x140bb0[_0xfb7c('0x61')][_0xfb7c('0x69')],_0x59cbc8[_0xfb7c('0x68')]['id'],_0x140bb0[_0xfb7c('0x56')]?JSON['stringify'](_0x140bb0[_0xfb7c('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xfb7c('0x73'),_0x59cbc8);}return null;})[_0xfb7c('0x23')](function(_0x5045af){if(_0x5045af){_0x5045af[_0xfb7c('0x2a')][_0xfb7c('0x74')]=util[_0xfb7c('0x5e')](_0xfb7c('0x75'),_0x140bb0[_0xfb7c('0x61')][_0xfb7c('0x3a')]);_0x5045af[_0xfb7c('0x2a')][_0xfb7c('0x6d')]=_0x59cbc8[_0xfb7c('0x6d')];_0x5045af[_0xfb7c('0x2a')][_0xfb7c('0x6e')]=_0xfb7c('0x35');respondWithRpcPromise(_0xfb7c('0x6f'),_0xfb7c('0x6f'),{'event':'rejectmessage','message':_0x5045af[_0xfb7c('0x2a')]},client9002);return _0x59cbc8;}return null;})[_0xfb7c('0x23')](respondWithResult(_0x24af61,null))[_0xfb7c('0x2b')](handleError(_0x24af61,null));};exports['create']=function(_0x165b58,_0x745c1d){var _0x38b7d6;return db[_0xfb7c('0x3c')][_0xfb7c('0x76')](_0x165b58[_0xfb7c('0x56')],{})[_0xfb7c('0x23')](function(_0x5764df){_0x38b7d6=_0x5764df;return db['CmContact'][_0xfb7c('0x77')]({'where':{'id':_0x38b7d6['ContactId']}});})['then'](function(_0x4b6e51){if(_[_0xfb7c('0x67')](_0x4b6e51)){return;}else{_0x38b7d6['fax']=_0x4b6e51[_0xfb7c('0x5c')];return db[_0xfb7c('0x78')][_0xfb7c('0x77')]({'where':{'id':_0x38b7d6[_0xfb7c('0x79')]}});}})[_0xfb7c('0x23')](function(_0x1f51ad){return respondWithRpcPromise('SendFax',_0xfb7c('0x7a'),{'FaxAccountId':_['isNil'](_0x165b58[_0xfb7c('0x56')])?undefined:_0x165b58['body']['FaxAccountId'],'path':_['isNil'](_0x1f51ad)?undefined:util[_0xfb7c('0x5e')](_0xfb7c('0x7b'),_0x1f51ad[_0xfb7c('0x7c')]),'fax':_['isNil'](_0x38b7d6[_0xfb7c('0x5c')])?undefined:_0x38b7d6[_0xfb7c('0x5c')],'AttachmentId':_0x38b7d6[_0xfb7c('0x79')]},client9002);})['then'](respondWithResult(_0x745c1d,0xc9))['catch'](handleError(_0x745c1d,null));};exports['download']=function(_0x4778e1,_0x14a3dc){var _0x240ad7=path[_0xfb7c('0x7d')](config[_0xfb7c('0x7e')],_0xfb7c('0x7f'),_0xfb7c('0x80'),_0xfb7c('0x81'));return db[_0xfb7c('0x3c')][_0xfb7c('0x57')]({'where':{'id':_0x4778e1[_0xfb7c('0x58')]['id']},'include':[{'model':db['Attachment'],'as':_0xfb7c('0x78')}]})['then'](handleEntityNotFound(_0x14a3dc,null))[_0xfb7c('0x23')](function(_0x1610cc){if(_0x1610cc){return _0x14a3dc[_0xfb7c('0x82')](path['join'](_0x240ad7,_0x1610cc['Attachment']['basename']));}})[_0xfb7c('0x2b')](handleError(_0x14a3dc,null));}; \ No newline at end of file +var _0x257e=['test','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','update','destroy','stack','send','index','FaxMessage','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','key','VIRTUAL','field','merge','options','count','includeAll','findAll','rows','show','include','body','find','params','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','AcceptMessage','acceptMessage','manual','interface','channel','accept','EventManager','acceptmessage','agent','FaxInteraction','name','RejectMessage','rejectMessage','SIP/%s','event','create','CmContact','ContactId','Attachment','findOne','FaxAccountId','basename','AttachmentId','join','server','attachments','download','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http'];(function(_0x11053e,_0x3a25f0){var _0x2a5676=function(_0xc5d252){while(--_0xc5d252){_0x11053e['push'](_0x11053e['shift']());}};_0x2a5676(++_0x3a25f0);}(_0x257e,0x1dc));var _0xe257=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x257e[_0x7791d5];return _0x5ce288;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe257('0x0'));var rimraf=require(_0xe257('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe257('0x2'));var rp=require('request-promise');var moment=require(_0xe257('0x3'));var BPromise=require(_0xe257('0x4'));var Mustache=require(_0xe257('0x5'));var util=require(_0xe257('0x6'));var path=require('path');var sox=require(_0xe257('0x7'));var csv=require(_0xe257('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe257('0x9'));var squel=require(_0xe257('0xa'));var crypto=require(_0xe257('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe257('0xc'));var toCsv=require(_0xe257('0x8'));var querystring=require(_0xe257('0xd'));var Papa=require(_0xe257('0xe'));var Redis=require(_0xe257('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe257('0x10'));var logger=require(_0xe257('0x11'))('api');var utils=require(_0xe257('0x12'));var config=require(_0xe257('0x13'));var db=require('../../mysqldb')['db'];config[_0xe257('0x14')]=_[_0xe257('0x15')](config[_0xe257('0x14')],{'host':_0xe257('0x16'),'port':0x18eb});var socket=require(_0xe257('0x17'))(new Redis(config['redis']));require(_0xe257('0x18'))[_0xe257('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe257('0x1a')][_0xe257('0x1b')]({'port':0x232c});var client9002=jayson[_0xe257('0x1a')][_0xe257('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x1e34db,_0x44f6d8,_0x44a016){if(_0x44a016){var _0x396be4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x396be4[_0xe257('0x1c')](_0x44f6d8)){return _0x1e34db;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1e34db;}}function respondWithRpcPromise(_0x9df9de,_0x584c54,_0x2a1a10,_0x5c22e8){return new BPromise(function(_0x481419,_0x3189b3){var _0x56f1dc=_0x5c22e8||client;return _0x56f1dc['request'](_0x9df9de,_0x2a1a10)[_0xe257('0x1d')](function(_0x50764b){logger[_0xe257('0x1e')](_0xe257('0x1f'),_0x584c54,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x584c54,_0xe257('0x20'),JSON['stringify'](_0x50764b));if(_0x50764b['error']){if(_0x50764b['error']['code']===0x1f4){logger[_0xe257('0x21')]('FaxMessage,\x20%s,\x20%s',_0x584c54,_0x50764b[_0xe257('0x21')][_0xe257('0x22')]);return _0x3189b3(_0x50764b[_0xe257('0x21')][_0xe257('0x22')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x584c54,_0x50764b[_0xe257('0x21')][_0xe257('0x22')]);return _0x481419(_0x50764b['error']['message']);}else{logger[_0xe257('0x1e')](_0xe257('0x1f'),_0x584c54,_0xe257('0x20'));_0x481419(_0x50764b[_0xe257('0x23')]['message']);}})[_0xe257('0x24')](function(_0x1281c9){logger[_0xe257('0x21')](_0xe257('0x1f'),_0x584c54,_0x1281c9);_0x3189b3(_0x1281c9);});});}function respondWithStatusCode(_0x1c9ce0,_0x5532d3){_0x5532d3=_0x5532d3||0xcc;return function(_0x1c3c8c){if(_0x1c3c8c){return _0x1c9ce0[_0xe257('0x25')](_0x5532d3);}return _0x1c9ce0['status'](_0x5532d3)[_0xe257('0x26')]();};}function respondWithResult(_0x5097cc,_0x39a0f2){_0x39a0f2=_0x39a0f2||0xc8;return function(_0x59ff61){if(_0x59ff61){return _0x5097cc[_0xe257('0x27')](_0x39a0f2)[_0xe257('0x28')](_0x59ff61);}};}function respondWithFilteredResult(_0x25d1bd,_0x4f6fb6){return function(_0x5be955){if(_0x5be955){var _0x2d7095=_0x5be955['count'],_0x595c7a=_0x4f6fb6[_0xe257('0x29')],_0x57812a=_0x4f6fb6['offset']+_0x4f6fb6[_0xe257('0x2a')],_0x182edb;if(_0x57812a>=_0x2d7095){_0x57812a=_0x2d7095;_0x182edb=0xc8;}else{_0x182edb=0xce;}_0x25d1bd[_0xe257('0x27')](_0x182edb);return _0x25d1bd['set'](_0xe257('0x2b'),_0x595c7a+'-'+_0x57812a+'/'+_0x2d7095)['json'](_0x5be955);}return null;};}function patchUpdates(_0x11ecf4){return function(_0xf38e67){try{jsonpatch[_0xe257('0x2c')](_0xf38e67,_0x11ecf4,!![]);}catch(_0x1ab2bb){return BPromise[_0xe257('0x2d')](_0x1ab2bb);}return _0xf38e67['save']();};}function saveUpdates(_0x5cf895,_0x4db479){return function(_0x1fec4b){if(_0x1fec4b){return _0x1fec4b[_0xe257('0x2e')](_0x5cf895)['then'](function(_0x9db5f9){return _0x9db5f9;});}return null;};}function removeEntity(_0x427a97,_0x19ae5a){return function(_0x441120){if(_0x441120){return _0x441120[_0xe257('0x2f')]()[_0xe257('0x1d')](function(){_0x427a97[_0xe257('0x27')](0xcc)[_0xe257('0x26')]();});}};}function handleEntityNotFound(_0x7cc438,_0x58b3d6){return function(_0x26d7c8){if(!_0x26d7c8){_0x7cc438[_0xe257('0x25')](0x194);}return _0x26d7c8;};}function handleError(_0x124698,_0x5632b4){_0x5632b4=_0x5632b4||0x1f4;return function(_0x4b129d){logger[_0xe257('0x21')](_0x4b129d[_0xe257('0x30')]);if(_0x4b129d['name']){delete _0x4b129d['name'];}_0x124698[_0xe257('0x27')](_0x5632b4)[_0xe257('0x31')](_0x4b129d);};}exports[_0xe257('0x32')]=function(_0x2cd2dc,_0x1420de){var _0x3d8dc8={},_0x1c1782={},_0x9e7e11={'count':0x0,'rows':[]};var _0x1223a0=db[_0xe257('0x33')][_0xe257('0x34')];_0x1c1782['model']=_[_0xe257('0x35')](_0x1223a0);_0x1c1782[_0xe257('0x36')]=_['keys'](_0x2cd2dc[_0xe257('0x36')]);_0x1c1782[_0xe257('0x37')]=_['intersection'](_0x1c1782[_0xe257('0x38')],_0x1c1782[_0xe257('0x36')]);_0x3d8dc8[_0xe257('0x39')]=_[_0xe257('0x3a')](_0x1c1782[_0xe257('0x38')],qs[_0xe257('0x3b')](_0x2cd2dc[_0xe257('0x36')][_0xe257('0x3b')]));_0x3d8dc8[_0xe257('0x39')]=_0x3d8dc8[_0xe257('0x39')][_0xe257('0x3c')]?_0x3d8dc8[_0xe257('0x39')]:_0x1c1782[_0xe257('0x38')];if(!_0x2cd2dc[_0xe257('0x36')][_0xe257('0x3d')]('nolimit')){_0x3d8dc8[_0xe257('0x2a')]=qs[_0xe257('0x2a')](_0x2cd2dc[_0xe257('0x36')][_0xe257('0x2a')]);_0x3d8dc8[_0xe257('0x29')]=qs[_0xe257('0x29')](_0x2cd2dc['query']['offset']);}_0x3d8dc8[_0xe257('0x3e')]=qs[_0xe257('0x3f')](_0x2cd2dc['query']['sort']);_0x3d8dc8['where']=qs[_0xe257('0x37')](_['pick'](_0x2cd2dc['query'],_0x1c1782[_0xe257('0x37')]));if(_0x2cd2dc[_0xe257('0x36')][_0xe257('0x40')]){_0x3d8dc8['where']=_['merge'](_0x3d8dc8[_0xe257('0x41')],{'$or':_['map'](_0x1223a0,function(_0xfae076){if(_0xfae076['type'][_0xe257('0x42')]!==_0xe257('0x43')){var _0x2a4fe7={};_0x2a4fe7[_0xfae076[_0xe257('0x44')]]={'$like':'%'+_0x2cd2dc['query']['filter']+'%'};return _0x2a4fe7;}})});}_0x3d8dc8=_[_0xe257('0x45')]({},_0x3d8dc8,_0x2cd2dc[_0xe257('0x46')]);var _0x1c7746={'where':_0x3d8dc8[_0xe257('0x41')]};return db['FaxMessage'][_0xe257('0x47')](_0x1c7746)[_0xe257('0x1d')](function(_0x342042){_0x9e7e11['count']=_0x342042;if(_0x2cd2dc[_0xe257('0x36')][_0xe257('0x48')]){_0x3d8dc8['include']=[{'all':!![]}];}return db['FaxMessage'][_0xe257('0x49')](_0x3d8dc8);})[_0xe257('0x1d')](function(_0xd082e6){_0x9e7e11[_0xe257('0x4a')]=_0xd082e6;return _0x9e7e11;})[_0xe257('0x1d')](respondWithFilteredResult(_0x1420de,_0x3d8dc8))[_0xe257('0x24')](handleError(_0x1420de,null));};exports[_0xe257('0x4b')]=function(_0x228b4b,_0x26805a){var _0x5da62d={'raw':!![],'where':{'id':_0x228b4b['params']['id']}},_0x12f37e={};_0x12f37e[_0xe257('0x38')]=_['keys'](db[_0xe257('0x33')][_0xe257('0x34')]);_0x12f37e[_0xe257('0x36')]=_[_0xe257('0x35')](_0x228b4b[_0xe257('0x36')]);_0x12f37e['filters']=_['intersection'](_0x12f37e[_0xe257('0x38')],_0x12f37e['query']);_0x5da62d['attributes']=_[_0xe257('0x3a')](_0x12f37e['model'],qs[_0xe257('0x3b')](_0x228b4b['query']['fields']));_0x5da62d['attributes']=_0x5da62d['attributes']['length']?_0x5da62d[_0xe257('0x39')]:_0x12f37e[_0xe257('0x38')];if(_0x228b4b[_0xe257('0x36')][_0xe257('0x48')]){_0x5da62d[_0xe257('0x4c')]=[{'all':!![]}];}_0x5da62d=_[_0xe257('0x45')]({},_0x5da62d,_0x228b4b[_0xe257('0x46')]);return db[_0xe257('0x33')]['find'](_0x5da62d)[_0xe257('0x1d')](handleEntityNotFound(_0x26805a,null))['then'](respondWithResult(_0x26805a,null))[_0xe257('0x24')](handleError(_0x26805a,null));};exports['update']=function(_0x543b7f,_0x27ccc7){if(_0x543b7f[_0xe257('0x4d')]['id']){delete _0x543b7f['body']['id'];}return db['FaxMessage'][_0xe257('0x4e')]({'where':{'id':_0x543b7f[_0xe257('0x4f')]['id']}})['then'](handleEntityNotFound(_0x27ccc7,null))[_0xe257('0x1d')](saveUpdates(_0x543b7f[_0xe257('0x4d')],null))[_0xe257('0x1d')](respondWithResult(_0x27ccc7,null))['catch'](handleError(_0x27ccc7,null));};exports[_0xe257('0x2f')]=function(_0x3d503c,_0x4f8403){return db[_0xe257('0x33')][_0xe257('0x4e')]({'where':{'id':_0x3d503c[_0xe257('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f8403,null))[_0xe257('0x1d')](removeEntity(_0x4f8403,null))['catch'](handleError(_0x4f8403,null));};exports[_0xe257('0x50')]=function(_0x483a8c,_0x2f645a){return db[_0xe257('0x33')][_0xe257('0x50')]()[_0xe257('0x1d')](respondWithResult(_0x2f645a,null))['catch'](handleError(_0x2f645a,null));};var interaction_log=require(_0xe257('0x11'))(_0xe257('0x51'));exports['accept']=function(_0x406082,_0x43d090,_0x5b9158){var _0x58e148={'channel':_0xe257('0x52')};if(_0x406082[_0xe257('0x4d')]['id']){delete _0x406082[_0xe257('0x4d')]['id'];}_0x406082[_0xe257('0x4d')][_0xe257('0x53')]=!![];_0x406082['body'][_0xe257('0x54')]=moment()[_0xe257('0x55')](_0xe257('0x56'));_0x406082[_0xe257('0x4d')][_0xe257('0x57')]=_0x406082[_0xe257('0x4d')][_0xe257('0x57')]||_0x406082['user']['id'];return db[_0xe257('0x33')][_0xe257('0x4e')]({'where':{'id':_0x406082[_0xe257('0x4f')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xe257('0x58')}]})[_0xe257('0x1d')](handleEntityNotFound(_0x43d090,null))[_0xe257('0x1d')](saveUpdates(_0x406082[_0xe257('0x4d')],null))[_0xe257('0x1d')](function(_0x3c9834){if(_0x3c9834){_0x58e148[_0xe257('0x22')]=_0x3c9834[_0xe257('0x59')]({'plain':!![]});return db['FaxInteraction'][_0xe257('0x4e')]({'where':{'id':_0x3c9834[_0xe257('0x5a')]}});}return null;})['then'](handleEntityNotFound(_0x43d090,null))[_0xe257('0x1d')](function(_0xc68f2f){if(_0xc68f2f){return _0xc68f2f[_0xe257('0x2e')]({'UserId':_0x406082[_0xe257('0x4d')]['UserId'],'read1stAt':_[_0xe257('0x5b')](_0xc68f2f[_0xe257('0x5c')])?moment()['format'](_0xe257('0x56')):undefined});}return null;})[_0xe257('0x1d')](function(_0x575bc5){if(_0x575bc5){_0x58e148['interaction']=_0x575bc5[_0xe257('0x59')]({'plain':!![]});interaction_log[_0xe257('0x1e')](_0xe257('0x5d'),_0x406082[_0xe257('0x5e')]['id'],_0x406082['user']['name'],_0x406082[_0xe257('0x5e')][_0xe257('0x5f')],_0x58e148[_0xe257('0x60')]['id'],_0x406082[_0xe257('0x4d')]?JSON[_0xe257('0x61')](_0x406082[_0xe257('0x4d')]):_0xe257('0x62'));return respondWithRpcPromise(_0xe257('0x63'),_0xe257('0x64'),_0x58e148);}return null;})[_0xe257('0x1d')](function(_0x9f0b03){if(_0x9f0b03){if(_0x406082[_0xe257('0x4d')][_0xe257('0x65')]){_0x58e148['message'][_0xe257('0x66')]=util['format']('SIP/%s',_0x406082[_0xe257('0x5e')]['name']);_0x58e148[_0xe257('0x22')][_0xe257('0x67')]=_0x58e148['channel'];_0x58e148[_0xe257('0x22')]['event']=_0xe257('0x68');return respondWithRpcPromise(_0xe257('0x69'),'EventManager',{'event':_0xe257('0x6a'),'message':_0x58e148['message']},client9002)[_0xe257('0x1d')](function(){return _0x58e148;});}return _0x58e148;}return null;})[_0xe257('0x1d')](respondWithResult(_0x43d090,null))[_0xe257('0x24')](handleError(_0x43d090,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xe257('0x2d')]=function(_0x3118d7,_0x261fe1,_0x1b592b){var _0x36f343={'agent':{},'channel':'fax'};if(_0x3118d7[_0xe257('0x4d')]['id']){delete _0x3118d7[_0xe257('0x4d')]['id'];}_0x3118d7[_0xe257('0x4d')][_0xe257('0x57')]=_0x3118d7[_0xe257('0x4d')][_0xe257('0x57')]||_0x3118d7[_0xe257('0x5e')]['id'];_0x36f343[_0xe257('0x6b')]['id']=_0x3118d7[_0xe257('0x4d')][_0xe257('0x57')];return db[_0xe257('0x33')]['find']({'where':{'id':_0x3118d7[_0xe257('0x4f')]['id'],'UserId':null}})[_0xe257('0x1d')](handleEntityNotFound(_0x261fe1,null))['then'](function(_0x6e22cd){if(_0x6e22cd){_0x36f343['message']=_0x6e22cd[_0xe257('0x59')]({'plain':!![]});return db[_0xe257('0x6c')][_0xe257('0x4e')]({'where':{'id':_0x6e22cd[_0xe257('0x5a')]}});}return null;})[_0xe257('0x1d')](handleEntityNotFound(_0x261fe1,null))[_0xe257('0x1d')](function(_0x1ea77c){if(_0x1ea77c){_0x36f343[_0xe257('0x60')]=_0x1ea77c[_0xe257('0x59')]({'plain':!![]});interaction_log[_0xe257('0x1e')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3118d7['user']['id'],_0x3118d7[_0xe257('0x5e')][_0xe257('0x6d')],_0x3118d7['user'][_0xe257('0x5f')],_0x36f343[_0xe257('0x60')]['id'],_0x3118d7[_0xe257('0x4d')]?JSON['stringify'](_0x3118d7[_0xe257('0x4d')]):_0xe257('0x62'));return respondWithRpcPromise(_0xe257('0x6e'),_0xe257('0x6f'),_0x36f343);}return null;})[_0xe257('0x1d')](function(_0x1d8726){if(_0x1d8726){_0x1d8726['message'][_0xe257('0x66')]=util[_0xe257('0x55')](_0xe257('0x70'),_0x3118d7[_0xe257('0x5e')][_0xe257('0x6d')]);_0x1d8726[_0xe257('0x22')]['channel']=_0x36f343[_0xe257('0x67')];_0x1d8726['message'][_0xe257('0x71')]=_0xe257('0x2d');respondWithRpcPromise('EventManager',_0xe257('0x69'),{'event':'rejectmessage','message':_0x1d8726[_0xe257('0x22')]},client9002);return _0x36f343;}return null;})[_0xe257('0x1d')](respondWithResult(_0x261fe1,null))['catch'](handleError(_0x261fe1,null));};exports['create']=function(_0xccdd6e,_0x179298){var _0x545e25;return db[_0xe257('0x33')][_0xe257('0x72')](_0xccdd6e[_0xe257('0x4d')],{})[_0xe257('0x1d')](function(_0x209a00){_0x545e25=_0x209a00;return db[_0xe257('0x73')]['findOne']({'where':{'id':_0x545e25[_0xe257('0x74')]}});})[_0xe257('0x1d')](function(_0x48d2e2){if(_[_0xe257('0x5b')](_0x48d2e2)){return;}else{_0x545e25[_0xe257('0x52')]=_0x48d2e2[_0xe257('0x52')];return db[_0xe257('0x75')][_0xe257('0x76')]({'where':{'id':_0x545e25['AttachmentId']}});}})[_0xe257('0x1d')](function(_0x4a977b){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xe257('0x5b')](_0xccdd6e[_0xe257('0x4d')])?undefined:_0xccdd6e[_0xe257('0x4d')][_0xe257('0x77')],'path':_[_0xe257('0x5b')](_0x4a977b)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x4a977b[_0xe257('0x78')]),'fax':_[_0xe257('0x5b')](_0x545e25[_0xe257('0x52')])?undefined:_0x545e25[_0xe257('0x52')],'AttachmentId':_0x545e25[_0xe257('0x79')]},client9002);})[_0xe257('0x1d')](respondWithResult(_0x179298,0xc9))['catch'](handleError(_0x179298,null));};exports['download']=function(_0x43dae9,_0x2b11bb){var _0x37d310=path[_0xe257('0x7a')](config['root'],_0xe257('0x7b'),'files',_0xe257('0x7c'));return db['FaxMessage']['find']({'where':{'id':_0x43dae9[_0xe257('0x4f')]['id']},'include':[{'model':db[_0xe257('0x75')],'as':_0xe257('0x75')}]})['then'](handleEntityNotFound(_0x2b11bb,null))['then'](function(_0x153479){if(_0x153479){return _0x2b11bb[_0xe257('0x7d')](path[_0xe257('0x7a')](_0x37d310,_0x153479[_0xe257('0x75')]['basename']));}})['catch'](handleError(_0x2b11bb,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 23eb306..bc621f0 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 _0xf2b6=['hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2b6,0x65));var _0x6f2b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf2b6[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x6f2b('0x0'));var FaxMessage=require(_0x6f2b('0x1'))['db'][_0x6f2b('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6f2b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f2b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45c1ac){return function(_0x2df78d,_0x5b186c,_0x510e64){FaxMessageEvents['emit'](_0x45c1ac+':'+_0x2df78d['id'],_0x2df78d);FaxMessageEvents[_0x6f2b('0x5')](_0x45c1ac,_0x2df78d);_0x510e64(null);};}for(var e in events){if(events[_0x6f2b('0x6')](e)){var event=events[e];FaxMessage[_0x6f2b('0x7')](e,emitEvent(event));}}module[_0x6f2b('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x9495=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0xa8f831,_0x52aa4b){var _0x59ae97=function(_0x6ebe39){while(--_0x6ebe39){_0xa8f831['push'](_0xa8f831['shift']());}};_0x59ae97(++_0x52aa4b);}(_0x9495,0x13c));var _0x5949=function(_0x25d6db,_0x51b7f8){_0x25d6db=_0x25d6db-0x0;var _0x2abc0c=_0x9495[_0x25d6db];return _0x2abc0c;};'use strict';var EventEmitter=require(_0x5949('0x0'));var FaxMessage=require(_0x5949('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5949('0x2')](0x0);var events={'afterCreate':_0x5949('0x3'),'afterUpdate':_0x5949('0x4'),'afterDestroy':_0x5949('0x5')};function emitEvent(_0x26aa7b){return function(_0x27854c,_0xa2a66d,_0x32b20f){FaxMessageEvents['emit'](_0x26aa7b+':'+_0x27854c['id'],_0x27854c);FaxMessageEvents[_0x5949('0x6')](_0x26aa7b,_0x27854c);_0x32b20f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x5949('0x7')](e,emitEvent(event));}}module[_0x5949('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0e0a5c0..2cd491b 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 _0x2884=['path','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','direction','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a7f29,_0x2c89dc){var _0x38924b=function(_0x422538){while(--_0x422538){_0x2a7f29['push'](_0x2a7f29['shift']());}};_0x38924b(++_0x2c89dc);}(_0x2884,0xc5));var _0x4288=function(_0x33b85e,_0x9ab507){_0x33b85e=_0x33b85e-0x0;var _0x4d222e=_0x2884[_0x33b85e];return _0x4d222e;};'use strict';var _=require('lodash');var util=require(_0x4288('0x0'));var logger=require(_0x4288('0x1'))(_0x4288('0x2'));var moment=require(_0x4288('0x3'));var BPromise=require(_0x4288('0x4'));var rp=require(_0x4288('0x5'));var fs=require('fs');var path=require(_0x4288('0x6'));var rimraf=require('rimraf');var config=require(_0x4288('0x7'));var attributes=require('./faxMessage.attributes');module[_0x4288('0x8')]=function(_0x37cf84,_0x27a7f8){return _0x37cf84[_0x4288('0x9')](_0x4288('0xa'),attributes,{'tableName':_0x4288('0xb'),'paranoid':![],'indexes':[{'name':_0x4288('0xc'),'fields':['body'],'type':_0x4288('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c076f,_0x4cb3a0,_0x459cb2){var _0x4af119=_0x37cf84[_0x4288('0xe')];var _0x3e6117=_0x3c076f[_0x4288('0xf')]({'plain':!![]});if(_0x3e6117['direction'][_0x4288('0x10')]()==='in'||_0x3e6117['direction'][_0x4288('0x10')]()===_0x4288('0x11')&&!_0x3e6117['secret']&&!_[_0x4288('0x12')](_0x3e6117[_0x4288('0x13')])){_0x4af119[_0x4288('0x14')][_0x4288('0x15')]({'where':{'id':_0x3e6117[_0x4288('0x16')]}})[_0x4288('0x17')](function(_0x2f9643){if(_0x2f9643){_0x2f9643[_0x4288('0x18')]({'lastMsgAt':_0x3e6117['createdAt'],'lastMsgDirection':_0x3e6117[_0x4288('0x19')][_0x4288('0x10')]()});}})[_0x4288('0x1a')](function(_0x341296){console[_0x4288('0x1b')](_0x341296);});}_0x459cb2();}},'charset':_0x4288('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2b5b=['moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5b6d3c,_0x1e8d60){var _0x25af8c=function(_0x294830){while(--_0x294830){_0x5b6d3c['push'](_0x5b6d3c['shift']());}};_0x25af8c(++_0x1e8d60);}(_0x2b5b,0x171));var _0xb2b5=function(_0x54b453,_0x139462){_0x54b453=_0x54b453-0x0;var _0x3ddbcc=_0x2b5b[_0x54b453];return _0x3ddbcc;};'use strict';var _=require(_0xb2b5('0x0'));var util=require('util');var logger=require(_0xb2b5('0x1'))(_0xb2b5('0x2'));var moment=require(_0xb2b5('0x3'));var BPromise=require(_0xb2b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b5('0x5'));var rimraf=require(_0xb2b5('0x6'));var config=require('../../config/environment');var attributes=require(_0xb2b5('0x7'));module[_0xb2b5('0x8')]=function(_0x4aa067,_0x4df076){return _0x4aa067[_0xb2b5('0x9')](_0xb2b5('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xb2b5('0xb'),'fields':[_0xb2b5('0xc')],'type':_0xb2b5('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x270561,_0x3c8378,_0x19dcab){var _0x10748a=_0x4aa067[_0xb2b5('0xe')];var _0x1484b0=_0x270561[_0xb2b5('0xf')]({'plain':!![]});if(_0x1484b0[_0xb2b5('0x10')]['toLowerCase']()==='in'||_0x1484b0['direction'][_0xb2b5('0x11')]()===_0xb2b5('0x12')&&!_0x1484b0[_0xb2b5('0x13')]&&!_[_0xb2b5('0x14')](_0x1484b0[_0xb2b5('0x15')])){_0x10748a['FaxInteraction'][_0xb2b5('0x16')]({'where':{'id':_0x1484b0[_0xb2b5('0x17')]}})[_0xb2b5('0x18')](function(_0x239027){if(_0x239027){_0x239027[_0xb2b5('0x19')]({'lastMsgAt':_0x1484b0[_0xb2b5('0x1a')],'lastMsgDirection':_0x1484b0[_0xb2b5('0x10')][_0xb2b5('0x11')]()});}})[_0xb2b5('0x1b')](function(_0x32a967){console[_0xb2b5('0x1c')](_0x32a967);});}_0x19dcab();}},'charset':_0xb2b5('0x1d'),'collate':_0xb2b5('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index af69f9e..fa6dfe1 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 _0x6596=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','limit','lodash'];(function(_0x499ab0,_0x4ffa3b){var _0x4c44c9=function(_0x5e73da){while(--_0x5e73da){_0x499ab0['push'](_0x499ab0['shift']());}};_0x4c44c9(++_0x4ffa3b);}(_0x6596,0x1d3));var _0x6659=function(_0x363671,_0x49b1fd){_0x363671=_0x363671-0x0;var _0x5c908c=_0x6596[_0x363671];return _0x5c908c;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var moment=require('moment');var BPromise=require(_0x6659('0x2'));var rs=require(_0x6659('0x3'));var fs=require('fs');var Redis=require(_0x6659('0x4'));var db=require(_0x6659('0x5'))['db'];var utils=require(_0x6659('0x6'));var logger=require(_0x6659('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6659('0x8'));var client=jayson[_0x6659('0x9')][_0x6659('0xa')]({'port':0x232a});config[_0x6659('0xb')]=_[_0x6659('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6659('0xd'))(new Redis(config[_0x6659('0xb')]));require(_0x6659('0xe'))[_0x6659('0xf')](socket);function respondWithRpcPromise(_0x27dd8c,_0x2b0484,_0x4e5c6c){return new BPromise(function(_0xe1e51b,_0x4d1337){return client['request'](_0x27dd8c,_0x4e5c6c)[_0x6659('0x10')](function(_0x482f1c){logger[_0x6659('0x11')](_0x6659('0x12'),_0x2b0484,_0x6659('0x13'));logger[_0x6659('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2b0484,_0x6659('0x13'),JSON[_0x6659('0x15')](_0x482f1c));if(_0x482f1c['error']){if(_0x482f1c[_0x6659('0x16')][_0x6659('0x17')]===0x1f4){logger[_0x6659('0x16')](_0x6659('0x12'),_0x2b0484,_0x482f1c[_0x6659('0x16')][_0x6659('0x18')]);return _0x4d1337(_0x482f1c['error'][_0x6659('0x18')]);}logger[_0x6659('0x16')](_0x6659('0x12'),_0x2b0484,_0x482f1c[_0x6659('0x16')][_0x6659('0x18')]);return _0xe1e51b(_0x482f1c[_0x6659('0x16')]['message']);}else{logger['info'](_0x6659('0x12'),_0x2b0484,'request\x20sent');_0xe1e51b(_0x482f1c[_0x6659('0x19')][_0x6659('0x18')]);}})['catch'](function(_0x440bc2){logger['error'](_0x6659('0x12'),_0x2b0484,_0x440bc2);_0x4d1337(_0x440bc2);});});}exports[_0x6659('0x1a')]=function(_0x522f2e){var _0x36bd4c=this;return new Promise(function(_0x18e4a6,_0x332d2c){return db[_0x6659('0x1b')][_0x6659('0x1c')](_0x522f2e[_0x6659('0x1d')],{'raw':_0x522f2e[_0x6659('0x1e')]?_0x522f2e['options'][_0x6659('0x1f')]===undefined?!![]:![]:!![]})[_0x6659('0x10')](function(_0x314e40){logger[_0x6659('0x11')]('CreateFaxMessage',_0x522f2e);logger['debug']('CreateFaxMessage',_0x522f2e,JSON['stringify'](_0x314e40));_0x18e4a6(_0x314e40);})[_0x6659('0x20')](function(_0x2bf1f6){logger[_0x6659('0x16')](_0x6659('0x1a'),_0x2bf1f6[_0x6659('0x18')],_0x522f2e);_0x332d2c(_0x36bd4c[_0x6659('0x16')](0x1f4,_0x2bf1f6[_0x6659('0x18')]));});});};exports[_0x6659('0x21')]=function(_0x19fe18){var _0x5f48d6=this;return new Promise(function(_0x187571,_0x373a3d){return db[_0x6659('0x1b')]['update'](_0x19fe18['body'],{'raw':_0x19fe18[_0x6659('0x1e')]?_0x19fe18[_0x6659('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19fe18[_0x6659('0x1e')]?_0x19fe18[_0x6659('0x1e')][_0x6659('0x22')]||null:null,'attributes':_0x19fe18[_0x6659('0x1e')]?_0x19fe18[_0x6659('0x1e')]['attributes']||null:null,'limit':_0x19fe18[_0x6659('0x1e')]?_0x19fe18[_0x6659('0x1e')][_0x6659('0x23')]||null:null})[_0x6659('0x10')](function(_0xc9bd6a){logger['info'](_0x6659('0x21'),_0x19fe18);logger[_0x6659('0x14')](_0x6659('0x21'),_0x19fe18,JSON[_0x6659('0x15')](_0xc9bd6a));_0x187571(_0xc9bd6a);})[_0x6659('0x20')](function(_0x41094b){logger[_0x6659('0x16')]('UpdateFaxMessage',_0x41094b[_0x6659('0x18')],_0x19fe18);_0x373a3d(_0x5f48d6[_0x6659('0x16')](0x1f4,_0x41094b['message']));});});}; \ No newline at end of file +var _0x3645=['http','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','update','where','limit','UpdateFaxMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x20d2e2,_0x2d1482){var _0x4c9a59=function(_0x3da32a){while(--_0x3da32a){_0x20d2e2['push'](_0x20d2e2['shift']());}};_0x4c9a59(++_0x2d1482);}(_0x3645,0x154));var _0x5364=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x3645[_0x2891d1];return _0x486948;};'use strict';var _=require('lodash');var util=require(_0x5364('0x0'));var moment=require(_0x5364('0x1'));var BPromise=require(_0x5364('0x2'));var rs=require(_0x5364('0x3'));var fs=require('fs');var Redis=require(_0x5364('0x4'));var db=require(_0x5364('0x5'))['db'];var utils=require(_0x5364('0x6'));var logger=require('../../config/logger')(_0x5364('0x7'));var config=require(_0x5364('0x8'));var jayson=require(_0x5364('0x9'));var client=jayson[_0x5364('0xa')][_0x5364('0xb')]({'port':0x232a});config[_0x5364('0xc')]=_[_0x5364('0xd')](config[_0x5364('0xc')],{'host':_0x5364('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5364('0xc')]));require(_0x5364('0xf'))[_0x5364('0x10')](socket);function respondWithRpcPromise(_0x244d2e,_0x180904,_0x1a7702){return new BPromise(function(_0x106842,_0x65f168){return client[_0x5364('0x11')](_0x244d2e,_0x1a7702)[_0x5364('0x12')](function(_0x19f33d){logger[_0x5364('0x13')](_0x5364('0x14'),_0x180904,'request\x20sent');logger[_0x5364('0x15')](_0x5364('0x16'),_0x180904,_0x5364('0x17'),JSON[_0x5364('0x18')](_0x19f33d));if(_0x19f33d['error']){if(_0x19f33d[_0x5364('0x19')]['code']===0x1f4){logger[_0x5364('0x19')]('FaxMessage,\x20%s,\x20%s',_0x180904,_0x19f33d[_0x5364('0x19')][_0x5364('0x1a')]);return _0x65f168(_0x19f33d[_0x5364('0x19')][_0x5364('0x1a')]);}logger[_0x5364('0x19')]('FaxMessage,\x20%s,\x20%s',_0x180904,_0x19f33d['error'][_0x5364('0x1a')]);return _0x106842(_0x19f33d[_0x5364('0x19')][_0x5364('0x1a')]);}else{logger[_0x5364('0x13')](_0x5364('0x14'),_0x180904,_0x5364('0x17'));_0x106842(_0x19f33d[_0x5364('0x1b')][_0x5364('0x1a')]);}})[_0x5364('0x1c')](function(_0x5192df){logger[_0x5364('0x19')](_0x5364('0x14'),_0x180904,_0x5192df);_0x65f168(_0x5192df);});});}exports[_0x5364('0x1d')]=function(_0x23fb8b){var _0x3c2283=this;return new Promise(function(_0x32a60d,_0x1d5a30){return db[_0x5364('0x1e')][_0x5364('0x1f')](_0x23fb8b[_0x5364('0x20')],{'raw':_0x23fb8b[_0x5364('0x21')]?_0x23fb8b['options'][_0x5364('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x59df7c){logger[_0x5364('0x13')]('CreateFaxMessage',_0x23fb8b);logger[_0x5364('0x15')](_0x5364('0x1d'),_0x23fb8b,JSON[_0x5364('0x18')](_0x59df7c));_0x32a60d(_0x59df7c);})[_0x5364('0x1c')](function(_0x1dfa2c){logger['error'](_0x5364('0x1d'),_0x1dfa2c['message'],_0x23fb8b);_0x1d5a30(_0x3c2283[_0x5364('0x19')](0x1f4,_0x1dfa2c[_0x5364('0x1a')]));});});};exports['UpdateFaxMessage']=function(_0x474923){var _0x2edc31=this;return new Promise(function(_0x5bd2f7,_0xb5ae80){return db[_0x5364('0x1e')][_0x5364('0x23')](_0x474923[_0x5364('0x20')],{'raw':_0x474923['options']?_0x474923[_0x5364('0x21')][_0x5364('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x474923[_0x5364('0x21')]?_0x474923[_0x5364('0x21')][_0x5364('0x24')]||null:null,'attributes':_0x474923[_0x5364('0x21')]?_0x474923['options']['attributes']||null:null,'limit':_0x474923[_0x5364('0x21')]?_0x474923['options'][_0x5364('0x25')]||null:null})[_0x5364('0x12')](function(_0x46dfcc){logger[_0x5364('0x13')](_0x5364('0x26'),_0x474923);logger['debug'](_0x5364('0x26'),_0x474923,JSON[_0x5364('0x18')](_0x46dfcc));_0x5bd2f7(_0x46dfcc);})[_0x5364('0x1c')](function(_0x10c6b4){logger[_0x5364('0x19')](_0x5364('0x26'),_0x10c6b4[_0x5364('0x1a')],_0x474923);_0xb5ae80(_0x2edc31[_0x5364('0x19')](0x1f4,_0x10c6b4[_0x5364('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 627eb6f..fb5d5cb 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 _0xd449=['emit','removeListener','length','faxMessage:','./faxMessage.events'];(function(_0x271d3a,_0x2775b6){var _0x476001=function(_0x414a3d){while(--_0x414a3d){_0x271d3a['push'](_0x271d3a['shift']());}};_0x476001(++_0x2775b6);}(_0xd449,0x153));var _0x9d44=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xd449[_0x1f7413];return _0x2d2775;};'use strict';var FaxMessageEvents=require(_0x9d44('0x0'));var events=['save','remove','update'];function createListener(_0x579f2c,_0x47e219){return function(_0x503798){_0x47e219[_0x9d44('0x1')](_0x579f2c,_0x503798);};}function removeListener(_0x47441c,_0x1c57fd){return function(){FaxMessageEvents[_0x9d44('0x2')](_0x47441c,_0x1c57fd);};}exports['register']=function(_0x3ad7ba){for(var _0x128f0c=0x0,_0x333c78=events[_0x9d44('0x3')];_0x128f0c<_0x333c78;_0x128f0c++){var _0x158bb1=events[_0x128f0c];var _0x52df6c=createListener(_0x9d44('0x4')+_0x158bb1,_0x3ad7ba);FaxMessageEvents['on'](_0x158bb1,_0x52df6c);}}; \ No newline at end of file +var _0x815b=['./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x4bf321,_0xe370da){var _0x5965cf=function(_0x2de25a){while(--_0x2de25a){_0x4bf321['push'](_0x4bf321['shift']());}};_0x5965cf(++_0xe370da);}(_0x815b,0xb4));var _0xb815=function(_0x2fef01,_0x480cf3){_0x2fef01=_0x2fef01-0x0;var _0x4b9f4c=_0x815b[_0x2fef01];return _0x4b9f4c;};'use strict';var FaxMessageEvents=require(_0xb815('0x0'));var events=[_0xb815('0x1'),_0xb815('0x2'),_0xb815('0x3')];function createListener(_0x6314c,_0x592cd5){return function(_0x1e70fa){_0x592cd5['emit'](_0x6314c,_0x1e70fa);};}function removeListener(_0x5b4516,_0x16c25e){return function(){FaxMessageEvents[_0xb815('0x4')](_0x5b4516,_0x16c25e);};}exports[_0xb815('0x5')]=function(_0x5a5c18){for(var _0x466899=0x0,_0x3f7a40=events['length'];_0x466899<_0x3f7a40;_0x466899++){var _0xeba45d=events[_0x466899];var _0x479b09=createListener('faxMessage:'+_0xeba45d,_0x5a5c18);FaxMessageEvents['on'](_0xeba45d,_0x479b09);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d40ac0a..a264fa5 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 _0x4975=['/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','describe','/:id/download','download','post','tracked','fax','/:id','update','put','/:id/accept','accept'];(function(_0x5d9cc2,_0x1211c8){var _0x10d17f=function(_0x1ecdf0){while(--_0x1ecdf0){_0x5d9cc2['push'](_0x5d9cc2['shift']());}};_0x10d17f(++_0x1211c8);}(_0x4975,0x86));var _0x5497=function(_0x380b2f,_0xe7ff6d){_0x380b2f=_0x380b2f-0x0;var _0x326ffa=_0x4975[_0x380b2f];return _0x326ffa;};'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 auth=require(_0x5497('0x5'));var interaction=require(_0x5497('0x6'));var config=require(_0x5497('0x7'));var controller=require(_0x5497('0x8'));router[_0x5497('0x9')]('/',auth[_0x5497('0xa')](),controller['index']);router[_0x5497('0x9')]('/describe',auth[_0x5497('0xa')](),controller[_0x5497('0xb')]);router[_0x5497('0x9')]('/:id',auth[_0x5497('0xa')](),controller['show']);router[_0x5497('0x9')](_0x5497('0xc'),auth[_0x5497('0xa')](),controller[_0x5497('0xd')]);router[_0x5497('0xe')]('/',auth[_0x5497('0xa')](),interaction[_0x5497('0xf')](_0x5497('0x10'),'faxmessage:create'),controller['create']);router['put'](_0x5497('0x11'),auth[_0x5497('0xa')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0x14'),auth[_0x5497('0xa')](),controller[_0x5497('0x15')]);router[_0x5497('0x13')](_0x5497('0x16'),auth[_0x5497('0xa')](),controller['reject']);router[_0x5497('0x17')]('/:id',auth[_0x5497('0xa')](),controller[_0x5497('0x18')]);module[_0x5497('0x19')]=router; \ No newline at end of file +var _0x2a07=['accept','reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','tracked','fax','faxmessage:create','create','update','put','/:id/accept'];(function(_0x1db5e3,_0x520aff){var _0x54cd75=function(_0x38a844){while(--_0x38a844){_0x1db5e3['push'](_0x1db5e3['shift']());}};_0x54cd75(++_0x520aff);}(_0x2a07,0x74));var _0x72a0=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x2a07[_0x4206f5];return _0xa29cf3;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var auth=require(_0x72a0('0x5'));var interaction=require(_0x72a0('0x6'));var config=require(_0x72a0('0x7'));var controller=require(_0x72a0('0x8'));router[_0x72a0('0x9')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xb')]);router[_0x72a0('0x9')](_0x72a0('0xc'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xd')]);router[_0x72a0('0x9')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xf')]);router[_0x72a0('0x9')]('/:id/download',auth[_0x72a0('0xa')](),controller[_0x72a0('0x10')]);router['post']('/',auth[_0x72a0('0xa')](),interaction[_0x72a0('0x11')](_0x72a0('0x12'),_0x72a0('0x13')),controller[_0x72a0('0x14')]);router['put'](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0x15')]);router[_0x72a0('0x16')](_0x72a0('0x17'),auth[_0x72a0('0xa')](),controller[_0x72a0('0x18')]);router['put']('/:id/reject',auth[_0x72a0('0xa')](),controller[_0x72a0('0x19')]);router[_0x72a0('0x1a')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index ef45237..313c6f5 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 _0x4978=['INTEGER','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x4978,0x1e6));var _0x8497=function(_0x2e937e,_0x925b29){_0x2e937e=_0x2e937e-0x0;var _0xb9cb1b=_0x4978[_0x2e937e];return _0xb9cb1b;};'use strict';var Sequelize=require(_0x8497('0x0'));module[_0x8497('0x1')]={'name':{'type':Sequelize[_0x8497('0x2')],'unique':_0x8497('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8497('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8497('0x5'),_0x8497('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8497('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x720c=['roundrobin','INTEGER','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x584d56,_0x3690eb){var _0xfc787=function(_0x46a754){while(--_0x46a754){_0x584d56['push'](_0x584d56['shift']());}};_0xfc787(++_0x3690eb);}(_0x720c,0x1aa));var _0xc720=function(_0x5307d4,_0x1fb0dc){_0x5307d4=_0x5307d4-0x0;var _0x30313b=_0x720c[_0x5307d4];return _0x30313b;};'use strict';var Sequelize=require(_0xc720('0x0'));module[_0xc720('0x1')]={'name':{'type':Sequelize[_0xc720('0x2')],'unique':_0xc720('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc720('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc720('0x4')]('rrmemory',_0xc720('0x5'),_0xc720('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc720('0x7')],'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 1b65aba..e7dd8f4 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 _0x739c=['select','tq.TeamId','from','team_has_fax_queues','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','forEach','userFaxQueue:remove','addAgents','removeAgents','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','save','update','get','FaxQueues','UserProfileResource','then','name','send','index','FaxQueue','rawAttributes','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','destroy','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit','addTeams','teams','User','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','ids'];(function(_0x43bd1f,_0x2ddf58){var _0x2a5b94=function(_0x3d4fb3){while(--_0x3d4fb3){_0x43bd1f['push'](_0x43bd1f['shift']());}};_0x2a5b94(++_0x2ddf58);}(_0x739c,0x121));var _0xc739=function(_0x12c9a4,_0x6b541c){_0x12c9a4=_0x12c9a4-0x0;var _0x527f1f=_0x739c[_0x12c9a4];return _0x527f1f;};'use strict';var pdf=require(_0xc739('0x0'));var emlformat=require(_0xc739('0x1'));var rimraf=require(_0xc739('0x2'));var zipdir=require(_0xc739('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc739('0x4'));var BPromise=require(_0xc739('0x5'));var Mustache=require(_0xc739('0x6'));var util=require(_0xc739('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc739('0x8'));var ejs=require(_0xc739('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc739('0xa'));var crypto=require(_0xc739('0xb'));var jsforce=require(_0xc739('0xc'));var deskjs=require(_0xc739('0xd'));var toCsv=require(_0xc739('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc739('0xe'));var authService=require(_0xc739('0xf'));var qs=require(_0xc739('0x10'));var hardwareService=require(_0xc739('0x11'));var logger=require(_0xc739('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc739('0x13'));var db=require(_0xc739('0x14'))['db'];config['redis']=_[_0xc739('0x15')](config['redis'],{'host':_0xc739('0x16'),'port':0x18eb});var socket=require(_0xc739('0x17'))(new Redis(config['redis']));require(_0xc739('0x18'))[_0xc739('0x19')](socket);function respondWithStatusCode(_0x4029cc,_0x1d63f9){_0x1d63f9=_0x1d63f9||0xcc;return function(_0x20ac17){if(_0x20ac17){return _0x4029cc[_0xc739('0x1a')](_0x1d63f9);}return _0x4029cc[_0xc739('0x1b')](_0x1d63f9)[_0xc739('0x1c')]();};}function respondWithResult(_0x2140af,_0x45cb1){_0x45cb1=_0x45cb1||0xc8;return function(_0x59f0ce){if(_0x59f0ce){return _0x2140af[_0xc739('0x1b')](_0x45cb1)[_0xc739('0x1d')](_0x59f0ce);}};}function respondWithFilteredResult(_0xd482c2,_0x4da3af){return function(_0x3e72b7){if(_0x3e72b7){var _0x1fb76b=_0x3e72b7[_0xc739('0x1e')],_0x402a8e=_0x4da3af['offset'],_0x5d172a=_0x4da3af[_0xc739('0x1f')]+_0x4da3af[_0xc739('0x20')],_0x5da571;if(_0x5d172a>=_0x1fb76b){_0x5d172a=_0x1fb76b;_0x5da571=0xc8;}else{_0x5da571=0xce;}_0xd482c2[_0xc739('0x1b')](_0x5da571);return _0xd482c2[_0xc739('0x21')]('Content-Range',_0x402a8e+'-'+_0x5d172a+'/'+_0x1fb76b)[_0xc739('0x1d')](_0x3e72b7);}return null;};}function patchUpdates(_0x1b569a){return function(_0x42617d){try{jsonpatch['apply'](_0x42617d,_0x1b569a,!![]);}catch(_0x428d2d){return BPromise['reject'](_0x428d2d);}return _0x42617d[_0xc739('0x22')]();};}function saveUpdates(_0xa4f92a,_0x4c70dd){return function(_0xe7e7e2){if(_0xe7e7e2){return _0xe7e7e2[_0xc739('0x23')](_0xa4f92a)['then'](function(_0x416f42){return _0x416f42;});}return null;};}function removeEntity(_0x264f2b,_0x1c1209){return function(_0x8dcc28){if(_0x8dcc28){return _0x8dcc28['destroy']()['then'](function(){var _0x4f57a6=_0x8dcc28[_0xc739('0x24')]({'plain':!![]});var _0x388209=_0xc739('0x25');return db[_0xc739('0x26')]['destroy']({'where':{'type':_0x388209,'resourceId':_0x4f57a6['id']}})[_0xc739('0x27')](function(){return _0x8dcc28;});})[_0xc739('0x27')](function(){_0x264f2b[_0xc739('0x1b')](0xcc)[_0xc739('0x1c')]();});}};}function handleEntityNotFound(_0x2ecb6f,_0x16d1a7){return function(_0x20e44b){if(!_0x20e44b){_0x2ecb6f[_0xc739('0x1a')](0x194);}return _0x20e44b;};}function handleError(_0xc3cab3,_0x28dfe2){_0x28dfe2=_0x28dfe2||0x1f4;return function(_0x151585){logger['error'](_0x151585['stack']);if(_0x151585[_0xc739('0x28')]){delete _0x151585[_0xc739('0x28')];}_0xc3cab3[_0xc739('0x1b')](_0x28dfe2)[_0xc739('0x29')](_0x151585);};}exports[_0xc739('0x2a')]=function(_0x331f21,_0x3c6e53){var _0x35c650={},_0x4b25ae={},_0x40f3f0={'count':0x0,'rows':[]};var _0x3fd7ac=db[_0xc739('0x2b')][_0xc739('0x2c')];_0x4b25ae[_0xc739('0x2d')]=_['keys'](_0x3fd7ac);_0x4b25ae[_0xc739('0x2e')]=_[_0xc739('0x2f')](_0x331f21[_0xc739('0x2e')]);_0x4b25ae[_0xc739('0x30')]=_[_0xc739('0x31')](_0x4b25ae[_0xc739('0x2d')],_0x4b25ae['query']);_0x35c650[_0xc739('0x32')]=_[_0xc739('0x31')](_0x4b25ae[_0xc739('0x2d')],qs[_0xc739('0x33')](_0x331f21['query']['fields']));_0x35c650['attributes']=_0x35c650[_0xc739('0x32')]['length']?_0x35c650[_0xc739('0x32')]:_0x4b25ae[_0xc739('0x2d')];if(!_0x331f21['query']['hasOwnProperty']('nolimit')){_0x35c650[_0xc739('0x20')]=qs['limit'](_0x331f21[_0xc739('0x2e')][_0xc739('0x20')]);_0x35c650['offset']=qs[_0xc739('0x1f')](_0x331f21[_0xc739('0x2e')][_0xc739('0x1f')]);}_0x35c650[_0xc739('0x34')]=qs[_0xc739('0x35')](_0x331f21[_0xc739('0x2e')]['sort']);_0x35c650[_0xc739('0x36')]=qs[_0xc739('0x30')](_[_0xc739('0x37')](_0x331f21[_0xc739('0x2e')],_0x4b25ae[_0xc739('0x30')]));if(_0x331f21[_0xc739('0x2e')][_0xc739('0x38')]){_0x35c650['where']=_[_0xc739('0x39')](_0x35c650[_0xc739('0x36')],{'$or':_[_0xc739('0x3a')](_0x3fd7ac,function(_0x496656){if(_0x496656['type'][_0xc739('0x3b')]!==_0xc739('0x3c')){var _0x42889c={};_0x42889c[_0x496656[_0xc739('0x3d')]]={'$like':'%'+_0x331f21['query'][_0xc739('0x38')]+'%'};return _0x42889c;}})});}_0x35c650=_[_0xc739('0x39')]({},_0x35c650,_0x331f21['options']);var _0x5396d5={'where':_0x35c650['where']};return db['FaxQueue']['count'](_0x5396d5)[_0xc739('0x27')](function(_0x71fe7){_0x40f3f0[_0xc739('0x1e')]=_0x71fe7;if(_0x331f21['query'][_0xc739('0x3e')]){_0x35c650[_0xc739('0x3f')]=[{'all':!![]}];}return db['FaxQueue'][_0xc739('0x40')](_0x35c650);})[_0xc739('0x27')](function(_0x1e58ea){_0x40f3f0[_0xc739('0x41')]=_0x1e58ea;return _0x40f3f0;})[_0xc739('0x27')](respondWithFilteredResult(_0x3c6e53,_0x35c650))['catch'](handleError(_0x3c6e53,null));};exports[_0xc739('0x42')]=function(_0x168498,_0x2eec2e){var _0x594b59={'raw':!![],'where':{'id':_0x168498[_0xc739('0x43')]['id']}},_0x100a82={};_0x100a82['model']=_['keys'](db[_0xc739('0x2b')][_0xc739('0x2c')]);_0x100a82[_0xc739('0x2e')]=_[_0xc739('0x2f')](_0x168498['query']);_0x100a82[_0xc739('0x30')]=_[_0xc739('0x31')](_0x100a82[_0xc739('0x2d')],_0x100a82[_0xc739('0x2e')]);_0x594b59['attributes']=_[_0xc739('0x31')](_0x100a82[_0xc739('0x2d')],qs['fields'](_0x168498[_0xc739('0x2e')]['fields']));_0x594b59[_0xc739('0x32')]=_0x594b59['attributes'][_0xc739('0x44')]?_0x594b59[_0xc739('0x32')]:_0x100a82[_0xc739('0x2d')];if(_0x168498['query'][_0xc739('0x3e')]){_0x594b59[_0xc739('0x3f')]=[{'all':!![]}];}_0x594b59=_['merge']({},_0x594b59,_0x168498[_0xc739('0x45')]);return db['FaxQueue'][_0xc739('0x46')](_0x594b59)[_0xc739('0x27')](handleEntityNotFound(_0x2eec2e,null))[_0xc739('0x27')](respondWithResult(_0x2eec2e,null))[_0xc739('0x47')](handleError(_0x2eec2e,null));};exports['create']=function(_0x4b82cf,_0xcee675){return db[_0xc739('0x2b')][_0xc739('0x48')](_0x4b82cf[_0xc739('0x49')],{})['then'](function(_0x3a8d5a){var _0x4be674=_0x4b82cf[_0xc739('0x4a')][_0xc739('0x24')]({'plain':!![]});if(!_0x4be674)throw new Error(_0xc739('0x4b'));if(_0x4be674['role']===_0xc739('0x4a')){var _0x1ed186=_0x3a8d5a['get']({'plain':!![]});var _0x23ce16=_0xc739('0x25');return db[_0xc739('0x4c')][_0xc739('0x46')]({'where':{'name':_0x23ce16,'userProfileId':_0x4be674[_0xc739('0x4d')]},'raw':!![]})['then'](function(_0x5641b3){if(_0x5641b3&&_0x5641b3[_0xc739('0x4e')]===0x0){return db[_0xc739('0x26')][_0xc739('0x48')]({'name':_0x1ed186['name'],'resourceId':_0x1ed186['id'],'type':_0x5641b3['name'],'sectionId':_0x5641b3['id']},{})[_0xc739('0x27')](function(){return _0x3a8d5a;});}else{return _0x3a8d5a;}})[_0xc739('0x47')](function(_0x3b62dd){logger[_0xc739('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b62dd);throw _0x3b62dd;});}return _0x3a8d5a;})['then'](respondWithResult(_0xcee675,0xc9))[_0xc739('0x47')](handleError(_0xcee675,null));};exports[_0xc739('0x23')]=function(_0x176912,_0xab17d6){if(_0x176912[_0xc739('0x49')]['id']){delete _0x176912[_0xc739('0x49')]['id'];}return db[_0xc739('0x2b')][_0xc739('0x46')]({'where':{'id':_0x176912['params']['id']}})[_0xc739('0x27')](handleEntityNotFound(_0xab17d6,null))[_0xc739('0x27')](saveUpdates(_0x176912[_0xc739('0x49')],null))[_0xc739('0x27')](respondWithResult(_0xab17d6,null))[_0xc739('0x47')](handleError(_0xab17d6,null));};exports[_0xc739('0x50')]=function(_0x2aeefb,_0x275ba3){return db[_0xc739('0x2b')][_0xc739('0x46')]({'where':{'id':_0x2aeefb[_0xc739('0x43')]['id']}})['then'](handleEntityNotFound(_0x275ba3,null))[_0xc739('0x27')](removeEntity(_0x275ba3,null))[_0xc739('0x47')](handleError(_0x275ba3,null));};exports[_0xc739('0x51')]=function(_0x11f502,_0x142660){return db[_0xc739('0x2b')][_0xc739('0x51')]()[_0xc739('0x27')](respondWithResult(_0x142660,null))[_0xc739('0x47')](handleError(_0x142660,null));};exports[_0xc739('0x52')]=function(_0x2c938d,_0x4695ce,_0x40f891){var _0x1e64ce={'raw':!![],'where':{}},_0x11ae9f={},_0x47f492;return db['FaxQueue'][_0xc739('0x53')]({'where':{'id':_0x2c938d[_0xc739('0x43')]['id']}})[_0xc739('0x27')](handleEntityNotFound(_0x4695ce,null))[_0xc739('0x27')](function(_0x345e1c){if(_0x345e1c){_0x47f492=_0x345e1c[_0xc739('0x24')]({'plain':!![]});_0x11ae9f['model']=_[_0xc739('0x2f')](db[_0xc739('0x54')][_0xc739('0x2c')]);_0x11ae9f[_0xc739('0x2e')]=_[_0xc739('0x2f')](_0x2c938d[_0xc739('0x2e')]);_0x11ae9f[_0xc739('0x30')]=_['intersection'](_0x11ae9f[_0xc739('0x2d')],_0x11ae9f[_0xc739('0x2e')]);_0x1e64ce['attributes']=_[_0xc739('0x31')](_0x11ae9f[_0xc739('0x2d')],qs[_0xc739('0x33')](_0x2c938d['query'][_0xc739('0x33')]));_0x1e64ce[_0xc739('0x32')]=_0x1e64ce[_0xc739('0x32')]['length']?_0x1e64ce[_0xc739('0x32')]:_0x11ae9f[_0xc739('0x2d')];if(!_0x2c938d[_0xc739('0x2e')][_0xc739('0x55')]('nolimit')){_0x1e64ce[_0xc739('0x20')]=qs[_0xc739('0x20')](_0x2c938d['query'][_0xc739('0x20')]);_0x1e64ce[_0xc739('0x1f')]=qs['offset'](_0x2c938d['query'][_0xc739('0x1f')]);}_0x1e64ce[_0xc739('0x34')]=qs['sort'](_0x2c938d['query'][_0xc739('0x35')]);_0x1e64ce['where']=qs[_0xc739('0x30')](_[_0xc739('0x37')](_0x2c938d[_0xc739('0x2e')],_0x11ae9f[_0xc739('0x30')]));_0x1e64ce[_0xc739('0x36')][_0xc739('0x56')]=_0x345e1c['id'];if(_0x2c938d[_0xc739('0x2e')][_0xc739('0x38')]){_0x1e64ce[_0xc739('0x36')]=_[_0xc739('0x39')](_0x1e64ce[_0xc739('0x36')],{'$or':_[_0xc739('0x3a')](_0x1e64ce[_0xc739('0x32')],function(_0x423504){var _0x27b1a6={};_0x27b1a6[_0x423504]={'$like':'%'+_0x2c938d[_0xc739('0x2e')]['filter']+'%'};return _0x27b1a6;})});}_0x1e64ce=_['merge']({},_0x1e64ce,_0x2c938d[_0xc739('0x45')]);return db[_0xc739('0x54')][_0xc739('0x40')](_0x1e64ce);}})[_0xc739('0x27')](function(_0x1878bf){if(_0x1878bf){return db['User'][_0xc739('0x57')]({'where':{'id':_[_0xc739('0x3a')](_0x1878bf,_0xc739('0x58')),'role':_0xc739('0x59')},'attributes':['id','name',_0xc739('0x5a'),_0xc739('0x5b'),_0xc739('0x5c')]});}})['then'](function(_0x1dc7c4){if(_0x1dc7c4){return{'count':_0x1dc7c4['count'],'rows':_['map'](_0x1dc7c4['rows'],function(_0x18d34e){return{'membername':_0x18d34e['name'],'UserId':_0x18d34e['id'],'queue_name':_0x47f492['name'],'FaxQueueId':_0x47f492['id'],'interface':util[_0xc739('0x5d')](_0xc739('0x5e'),_0xc739('0x5f'),_0x18d34e['name']),'penalty':0x0,'paused':_0x18d34e[_0xc739('0x5a')],'createdAt':_0x18d34e[_0xc739('0x5c')],'updatedAt':_0x18d34e[_0xc739('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc739('0x27')](respondWithFilteredResult(_0x4695ce,_0x1e64ce))[_0xc739('0x47')](handleError(_0x4695ce,null));};exports[_0xc739('0x60')]=function(_0x55abf2,_0x543431,_0x1066db){var _0xaa3e35={};var _0x26fd23={};var _0x3d8b7f;var _0x3f07f3;return db['FaxQueue'][_0xc739('0x53')]({'where':{'id':_0x55abf2['params']['id']}})[_0xc739('0x27')](handleEntityNotFound(_0x543431,null))[_0xc739('0x27')](function(_0x3e3244){if(_0x3e3244){_0x3d8b7f=_0x3e3244;_0x26fd23[_0xc739('0x2d')]=_[_0xc739('0x2f')](db[_0xc739('0x61')][_0xc739('0x2c')]);_0x26fd23['query']=_[_0xc739('0x2f')](_0x55abf2[_0xc739('0x2e')]);_0x26fd23['filters']=_[_0xc739('0x31')](_0x26fd23[_0xc739('0x2d')],_0x26fd23[_0xc739('0x2e')]);_0xaa3e35[_0xc739('0x32')]=_[_0xc739('0x31')](_0x26fd23[_0xc739('0x2d')],qs[_0xc739('0x33')](_0x55abf2[_0xc739('0x2e')][_0xc739('0x33')]));_0xaa3e35[_0xc739('0x32')]=_0xaa3e35[_0xc739('0x32')][_0xc739('0x44')]?_0xaa3e35[_0xc739('0x32')]:_0x26fd23[_0xc739('0x2d')];_0xaa3e35[_0xc739('0x34')]=qs[_0xc739('0x35')](_0x55abf2[_0xc739('0x2e')][_0xc739('0x35')]);_0xaa3e35[_0xc739('0x36')]=qs[_0xc739('0x30')](_[_0xc739('0x37')](_0x55abf2['query'],_0x26fd23['filters']));if(_0x55abf2['query'][_0xc739('0x38')]){_0xaa3e35[_0xc739('0x36')]=_['merge'](_0xaa3e35['where'],{'$or':_[_0xc739('0x3a')](_0xaa3e35[_0xc739('0x32')],function(_0x43b555){var _0xb18ba7={};_0xb18ba7[_0x43b555]={'$like':'%'+_0x55abf2[_0xc739('0x2e')][_0xc739('0x38')]+'%'};return _0xb18ba7;})});}_0xaa3e35=_[_0xc739('0x39')]({},_0xaa3e35,_0x55abf2[_0xc739('0x45')]);return _0x3d8b7f[_0xc739('0x60')](_0xaa3e35);}})[_0xc739('0x27')](function(_0x5efb09){if(_0x5efb09){_0x3f07f3=_0x5efb09['length'];if(!_0x55abf2[_0xc739('0x2e')][_0xc739('0x55')](_0xc739('0x62'))){_0xaa3e35[_0xc739('0x20')]=qs['limit'](_0x55abf2[_0xc739('0x2e')][_0xc739('0x20')]);_0xaa3e35['offset']=qs[_0xc739('0x1f')](_0x55abf2[_0xc739('0x2e')][_0xc739('0x1f')]);}return _0x3d8b7f[_0xc739('0x60')](_0xaa3e35);}})['then'](function(_0x58b114){if(_0x58b114){return _0x58b114?{'count':_0x3f07f3,'rows':_0x58b114}:null;}})[_0xc739('0x27')](respondWithResult(_0x543431,null))['catch'](handleError(_0x543431,null));};exports[_0xc739('0x63')]=function(_0x95dffc,_0x85f5b6,_0x2b71a5){var _0x161dcf=_0x95dffc[_0xc739('0x49')][_0xc739('0x64')];return db[_0xc739('0x61')][_0xc739('0x40')]({'where':{'id':_['map'](_0x161dcf,'id')},'attributes':['id'],'include':[{'model':db[_0xc739('0x65')],'as':'Agents','attributes':['id',_0xc739('0x28'),_0xc739('0x66'),_0xc739('0x67'),'interface'],'raw':!![]}]})[_0xc739('0x27')](function(_0x2475c3){if(_0x2475c3){var _0x3ee731=_[_0xc739('0x68')](_0x2475c3,function(_0xe3a7ef){var _0x40a515=_0xe3a7ef['get']({'plain':!![]});return _0x40a515[_0xc739('0x69')];});return db['FaxQueue'][_0xc739('0x46')]({'where':{'id':_0x95dffc[_0xc739('0x43')]['id']}})['then'](function(_0x3165e5){return db[_0xc739('0x6a')][_0xc739('0x6b')](function(_0x577b76){return _0x3165e5[_0xc739('0x63')](_['map'](_0x161dcf,'id'),{'transaction':_0x577b76})['then'](function(){return BPromise[_0xc739('0x6c')](_0x3ee731,function(_0x31ebfd){return db[_0xc739('0x54')][_0xc739('0x6d')]({'where':{'UserId':_0x31ebfd['id'],'FaxQueueId':_0x95dffc[_0xc739('0x43')]['id']},'transaction':_0x577b76});});})[_0xc739('0x27')](function(){_0x3ee731['forEach'](function(_0x23d82e){socket[_0xc739('0x6e')](_0xc739('0x6f'),{'UserId':_0x23d82e['id'],'FaxQueueId':_0x3165e5['id']});});});});});}})[_0xc739('0x27')](respondWithStatusCode(_0x85f5b6,null))[_0xc739('0x47')](handleError(_0x85f5b6,null));};exports['removeTeams']=function(_0x354126,_0x520098,_0x5e1c35){return db['Team'][_0xc739('0x40')]({'where':{'id':_0x354126[_0xc739('0x2e')][_0xc739('0x70')]},'attributes':['id'],'include':[{'model':db[_0xc739('0x65')],'as':_0xc739('0x69'),'attributes':['id'],'raw':!![]}]})[_0xc739('0x27')](handleEntityNotFound(_0x520098,null))['then'](function(_0x3cfd51){var _0xe99032=_[_0xc739('0x3a')](_0x3cfd51,'id');var _0x1201d8=[];var _0x5303c7=[];var _0x325ff1=squel[_0xc739('0x71')]();_0x325ff1[_0xc739('0x3d')](_0xc739('0x72'))[_0xc739('0x73')](_0xc739('0x74'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc739('0x36')]('FaxQueueId\x20=\x20?',_0x354126['params']['id']);for(var _0x261127=0x0;_0x261127<_0x3cfd51[_0xc739('0x44')];_0x261127+=0x1){let _0xcbce36=_0x3cfd51[_0x261127];for(var _0xf110a8=0x0;_0xf110a8<_0xcbce36[_0xc739('0x69')][_0xc739('0x44')];_0xf110a8+=0x1){let _0x1f21ce=_0xcbce36[_0xc739('0x69')][_0xf110a8];var _0x5a4a9a=_0x325ff1[_0xc739('0x75')]();_0x5a4a9a['where'](_0xc739('0x76'),_0x1f21ce['id']);_0x5303c7['push'](db[_0xc739('0x6a')][_0xc739('0x2e')](_0x5a4a9a[_0xc739('0x77')](),{'type':db[_0xc739('0x6a')]['QueryTypes'][_0xc739('0x78')]})[_0xc739('0x27')](function(_0x2a6d04){if(_0x2a6d04['length']===0x1){return _0x1f21ce['id'];}else{var _0x333a23=_['every'](_[_0xc739('0x3a')](_0x2a6d04,_0xc739('0x79')),function(_0xb9be85){return _[_0xc739('0x7a')](_0xe99032,_0xb9be85);});if(_0x333a23){return _0x1f21ce['id'];}}}));}}return BPromise[_0xc739('0x7b')](_0x5303c7)[_0xc739('0x27')](function(_0x29c3d7){_0x1201d8=_(_0x1201d8)[_0xc739('0x7c')](_0x29c3d7)[_0xc739('0x7d')]()[_0xc739('0x7e')]();return db[_0xc739('0x2b')][_0xc739('0x46')]({'where':{'id':_0x354126[_0xc739('0x43')]['id']}})[_0xc739('0x27')](function(_0x4098f0){return db['sequelize'][_0xc739('0x6b')](function(_0x5d5d74){return _0x4098f0[_0xc739('0x7f')](_0x354126['query'][_0xc739('0x70')],{'transaction':_0x5d5d74})[_0xc739('0x27')](function(){if(!_[_0xc739('0x80')](_0x1201d8)){return _0x4098f0['removeAgents'](_0x1201d8,{'transaction':_0x5d5d74});}})[_0xc739('0x27')](function(){_0x1201d8[_0xc739('0x81')](function(_0x3317dc){socket[_0xc739('0x6e')](_0xc739('0x82'),{'UserId':_0x3317dc,'FaxQueueId':_0x4098f0['id']});});});});});});})[_0xc739('0x27')](respondWithStatusCode(_0x520098,null))[_0xc739('0x47')](handleError(_0x520098,null));};exports['addAgents']=function(_0x3e7070,_0x1d5391,_0xa0bf5c){return db[_0xc739('0x2b')][_0xc739('0x46')]({'where':{'id':_0x3e7070[_0xc739('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d5391,null))[_0xc739('0x27')](function(_0x5c7c63){if(_0x5c7c63){return _0x5c7c63[_0xc739('0x83')](_0x3e7070['body'][_0xc739('0x70')],_['omit'](_0x3e7070[_0xc739('0x49')],[_0xc739('0x70'),'id'])||{})['spread'](function(_0x478377){for(var _0x12bafd=0x0;_0x12bafd<_0x3e7070[_0xc739('0x49')][_0xc739('0x70')][_0xc739('0x44')];_0x12bafd+=0x1){socket['emit']('userFaxQueue:save',{'UserId':_0x3e7070[_0xc739('0x49')][_0xc739('0x70')][_0x12bafd],'FaxQueueId':_0x3e7070[_0xc739('0x43')]['id']});}return _0x478377;});}})['then'](respondWithResult(_0x1d5391,null))['catch'](handleError(_0x1d5391,null));};exports[_0xc739('0x84')]=function(_0x23d3f8,_0x1b245,_0x5889e2){return db[_0xc739('0x2b')][_0xc739('0x46')]({'where':{'id':_0x23d3f8[_0xc739('0x43')]['id']}})[_0xc739('0x27')](handleEntityNotFound(_0x1b245,null))[_0xc739('0x27')](function(_0xbecb4f){if(_0xbecb4f){return _0xbecb4f[_0xc739('0x84')](_0x23d3f8[_0xc739('0x2e')][_0xc739('0x70')])[_0xc739('0x27')](function(){if(_['isArray'](_0x23d3f8[_0xc739('0x2e')][_0xc739('0x70')])){for(var _0x57fcf8=0x0;_0x57fcf8<_0x23d3f8[_0xc739('0x2e')]['ids'][_0xc739('0x44')];_0x57fcf8+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x23d3f8[_0xc739('0x2e')][_0xc739('0x70')][_0x57fcf8]),'FaxQueueId':Number(_0x23d3f8[_0xc739('0x43')]['id'])});}}else{socket[_0xc739('0x6e')](_0xc739('0x82'),{'UserId':Number(_0x23d3f8[_0xc739('0x2e')][_0xc739('0x70')]),'FaxQueueId':Number(_0x23d3f8[_0xc739('0x43')]['id'])});}});}})[_0xc739('0x27')](respondWithStatusCode(_0x1b245,null))[_0xc739('0x47')](handleError(_0x1b245,null));};exports[_0xc739('0x85')]=function(_0x33ee7e,_0x5e8a0c,_0x45d1bd){var _0x1c5fff={};var _0x5eda91={};var _0x3e0415;var _0x541479;return db[_0xc739('0x2b')][_0xc739('0x53')]({'where':{'id':_0x33ee7e['params']['id']}})[_0xc739('0x27')](handleEntityNotFound(_0x5e8a0c,null))['then'](function(_0x5d0725){if(_0x5d0725){_0x3e0415=_0x5d0725;_0x5eda91['model']=_[_0xc739('0x2f')](db[_0xc739('0x65')][_0xc739('0x2c')]);_0x5eda91['query']=_['keys'](_0x33ee7e[_0xc739('0x2e')]);_0x5eda91[_0xc739('0x30')]=_[_0xc739('0x31')](_0x5eda91['model'],_0x5eda91[_0xc739('0x2e')]);_0x1c5fff[_0xc739('0x32')]=_[_0xc739('0x31')](_0x5eda91[_0xc739('0x2d')],qs[_0xc739('0x33')](_0x33ee7e[_0xc739('0x2e')][_0xc739('0x33')]));_0x1c5fff[_0xc739('0x32')]=_0x1c5fff['attributes'][_0xc739('0x44')]?_0x1c5fff[_0xc739('0x32')]:_0x5eda91[_0xc739('0x2d')];_0x1c5fff[_0xc739('0x34')]=qs['sort'](_0x33ee7e['query'][_0xc739('0x35')]);_0x1c5fff[_0xc739('0x36')]=qs[_0xc739('0x30')](_[_0xc739('0x37')](_0x33ee7e[_0xc739('0x2e')],_0x5eda91[_0xc739('0x30')]));if(_0x33ee7e['query']['filter']){_0x1c5fff[_0xc739('0x36')]=_[_0xc739('0x39')](_0x1c5fff[_0xc739('0x36')],{'$or':_['map'](_0x1c5fff['attributes'],function(_0x51d0ac){var _0x3139fa={};_0x3139fa[_0x51d0ac]={'$like':'%'+_0x33ee7e[_0xc739('0x2e')][_0xc739('0x38')]+'%'};return _0x3139fa;})});}_0x1c5fff=_[_0xc739('0x39')]({},_0x1c5fff,_0x33ee7e[_0xc739('0x45')]);return _0x3e0415[_0xc739('0x85')](_0x1c5fff);}})[_0xc739('0x27')](function(_0x50b78f){if(_0x50b78f){_0x541479=_0x50b78f[_0xc739('0x44')];if(!_0x33ee7e['query']['hasOwnProperty']('nolimit')){_0x1c5fff[_0xc739('0x20')]=qs[_0xc739('0x20')](_0x33ee7e[_0xc739('0x2e')]['limit']);_0x1c5fff[_0xc739('0x1f')]=qs['offset'](_0x33ee7e['query']['offset']);}return _0x3e0415[_0xc739('0x85')](_0x1c5fff);}})[_0xc739('0x27')](function(_0x1e6703){if(_0x1e6703){return _0x1e6703?{'count':_0x541479,'rows':_0x1e6703}:null;}})[_0xc739('0x27')](respondWithResult(_0x5e8a0c,null))[_0xc739('0x47')](handleError(_0x5e8a0c,null));}; \ No newline at end of file +var _0x320d=['every','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','spread','emit','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','stack','name','send','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','filter','FaxQueue','include','findAll','rows','show','rawAttributes','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','UserFaxQueue','order','FaxQueueId','findAndCountAll','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','findOne','Team','getTeams','teams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','userFaxQueue:save','removeTeams','ids','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x320d,0x1a8));var _0xd320=function(_0x5c5b79,_0x5f1dbd){_0x5c5b79=_0x5c5b79-0x0;var _0x3f3a73=_0x320d[_0x5c5b79];return _0x3f3a73;};'use strict';var pdf=require(_0xd320('0x0'));var emlformat=require(_0xd320('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd320('0x2'));var jsonpatch=require(_0xd320('0x3'));var rp=require(_0xd320('0x4'));var moment=require(_0xd320('0x5'));var BPromise=require(_0xd320('0x6'));var Mustache=require(_0xd320('0x7'));var util=require(_0xd320('0x8'));var path=require(_0xd320('0x9'));var sox=require(_0xd320('0xa'));var csv=require(_0xd320('0xb'));var ejs=require(_0xd320('0xc'));var fs=require('fs');var _=require(_0xd320('0xd'));var squel=require(_0xd320('0xe'));var crypto=require(_0xd320('0xf'));var jsforce=require(_0xd320('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd320('0xb'));var querystring=require(_0xd320('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd320('0x12'));var qs=require(_0xd320('0x13'));var hardwareService=require(_0xd320('0x14'));var logger=require(_0xd320('0x15'))(_0xd320('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd320('0x17')]=_[_0xd320('0x18')](config[_0xd320('0x17')],{'host':_0xd320('0x19'),'port':0x18eb});var socket=require(_0xd320('0x1a'))(new Redis(config[_0xd320('0x17')]));require(_0xd320('0x1b'))[_0xd320('0x1c')](socket);function respondWithStatusCode(_0x567584,_0x3b5f14){_0x3b5f14=_0x3b5f14||0xcc;return function(_0x4765ec){if(_0x4765ec){return _0x567584[_0xd320('0x1d')](_0x3b5f14);}return _0x567584[_0xd320('0x1e')](_0x3b5f14)[_0xd320('0x1f')]();};}function respondWithResult(_0x339449,_0x14b755){_0x14b755=_0x14b755||0xc8;return function(_0x129268){if(_0x129268){return _0x339449['status'](_0x14b755)[_0xd320('0x20')](_0x129268);}};}function respondWithFilteredResult(_0x297bf6,_0x55fa1a){return function(_0x4934d2){if(_0x4934d2){var _0x5789d3=_0x4934d2[_0xd320('0x21')],_0x590185=_0x55fa1a[_0xd320('0x22')],_0x3f6d8e=_0x55fa1a[_0xd320('0x22')]+_0x55fa1a[_0xd320('0x23')],_0x367021;if(_0x3f6d8e>=_0x5789d3){_0x3f6d8e=_0x5789d3;_0x367021=0xc8;}else{_0x367021=0xce;}_0x297bf6['status'](_0x367021);return _0x297bf6[_0xd320('0x24')](_0xd320('0x25'),_0x590185+'-'+_0x3f6d8e+'/'+_0x5789d3)[_0xd320('0x20')](_0x4934d2);}return null;};}function patchUpdates(_0x49b5cb){return function(_0x3c6227){try{jsonpatch['apply'](_0x3c6227,_0x49b5cb,!![]);}catch(_0x53682b){return BPromise[_0xd320('0x26')](_0x53682b);}return _0x3c6227[_0xd320('0x27')]();};}function saveUpdates(_0x3c3d4a,_0x44fa16){return function(_0x136df1){if(_0x136df1){return _0x136df1[_0xd320('0x28')](_0x3c3d4a)['then'](function(_0x1925cf){return _0x1925cf;});}return null;};}function removeEntity(_0xf10cf1,_0x17bd17){return function(_0x4d9ba5){if(_0x4d9ba5){return _0x4d9ba5[_0xd320('0x29')]()[_0xd320('0x2a')](function(){var _0xd997e6=_0x4d9ba5[_0xd320('0x2b')]({'plain':!![]});var _0x5094ad='FaxQueues';return db['UserProfileResource'][_0xd320('0x29')]({'where':{'type':_0x5094ad,'resourceId':_0xd997e6['id']}})[_0xd320('0x2a')](function(){return _0x4d9ba5;});})[_0xd320('0x2a')](function(){_0xf10cf1[_0xd320('0x1e')](0xcc)[_0xd320('0x1f')]();});}};}function handleEntityNotFound(_0x47af4c,_0x4ded96){return function(_0x7a05b0){if(!_0x7a05b0){_0x47af4c[_0xd320('0x1d')](0x194);}return _0x7a05b0;};}function handleError(_0x942841,_0x49e6af){_0x49e6af=_0x49e6af||0x1f4;return function(_0x47d67a){logger['error'](_0x47d67a[_0xd320('0x2c')]);if(_0x47d67a[_0xd320('0x2d')]){delete _0x47d67a[_0xd320('0x2d')];}_0x942841[_0xd320('0x1e')](_0x49e6af)[_0xd320('0x2e')](_0x47d67a);};}exports['index']=function(_0x77d035,_0x5071a0){var _0x314792={},_0x321a74={},_0x54a3ae={'count':0x0,'rows':[]};var _0x1ca085=db['FaxQueue']['rawAttributes'];_0x321a74[_0xd320('0x2f')]=_[_0xd320('0x30')](_0x1ca085);_0x321a74['query']=_['keys'](_0x77d035['query']);_0x321a74[_0xd320('0x31')]=_[_0xd320('0x32')](_0x321a74['model'],_0x321a74['query']);_0x314792[_0xd320('0x33')]=_[_0xd320('0x32')](_0x321a74[_0xd320('0x2f')],qs['fields'](_0x77d035[_0xd320('0x34')][_0xd320('0x35')]));_0x314792[_0xd320('0x33')]=_0x314792[_0xd320('0x33')][_0xd320('0x36')]?_0x314792[_0xd320('0x33')]:_0x321a74[_0xd320('0x2f')];if(!_0x77d035[_0xd320('0x34')][_0xd320('0x37')](_0xd320('0x38'))){_0x314792[_0xd320('0x23')]=qs[_0xd320('0x23')](_0x77d035[_0xd320('0x34')][_0xd320('0x23')]);_0x314792[_0xd320('0x22')]=qs[_0xd320('0x22')](_0x77d035[_0xd320('0x34')][_0xd320('0x22')]);}_0x314792['order']=qs['sort'](_0x77d035[_0xd320('0x34')][_0xd320('0x39')]);_0x314792[_0xd320('0x3a')]=qs[_0xd320('0x31')](_[_0xd320('0x3b')](_0x77d035[_0xd320('0x34')],_0x321a74[_0xd320('0x31')]));if(_0x77d035['query']['filter']){_0x314792['where']=_[_0xd320('0x3c')](_0x314792[_0xd320('0x3a')],{'$or':_[_0xd320('0x3d')](_0x1ca085,function(_0x167fc7){if(_0x167fc7[_0xd320('0x3e')][_0xd320('0x3f')]!=='VIRTUAL'){var _0x161f0b={};_0x161f0b[_0x167fc7['field']]={'$like':'%'+_0x77d035[_0xd320('0x34')][_0xd320('0x40')]+'%'};return _0x161f0b;}})});}_0x314792=_['merge']({},_0x314792,_0x77d035['options']);var _0x18c52a={'where':_0x314792[_0xd320('0x3a')]};return db[_0xd320('0x41')][_0xd320('0x21')](_0x18c52a)['then'](function(_0x1d195d){_0x54a3ae[_0xd320('0x21')]=_0x1d195d;if(_0x77d035[_0xd320('0x34')]['includeAll']){_0x314792[_0xd320('0x42')]=[{'all':!![]}];}return db[_0xd320('0x41')][_0xd320('0x43')](_0x314792);})[_0xd320('0x2a')](function(_0x133a90){_0x54a3ae[_0xd320('0x44')]=_0x133a90;return _0x54a3ae;})[_0xd320('0x2a')](respondWithFilteredResult(_0x5071a0,_0x314792))['catch'](handleError(_0x5071a0,null));};exports[_0xd320('0x45')]=function(_0x825cc4,_0xf3c679){var _0x4a8a85={'raw':!![],'where':{'id':_0x825cc4['params']['id']}},_0x488b15={};_0x488b15[_0xd320('0x2f')]=_[_0xd320('0x30')](db[_0xd320('0x41')][_0xd320('0x46')]);_0x488b15[_0xd320('0x34')]=_[_0xd320('0x30')](_0x825cc4['query']);_0x488b15['filters']=_[_0xd320('0x32')](_0x488b15[_0xd320('0x2f')],_0x488b15['query']);_0x4a8a85[_0xd320('0x33')]=_[_0xd320('0x32')](_0x488b15[_0xd320('0x2f')],qs['fields'](_0x825cc4[_0xd320('0x34')][_0xd320('0x35')]));_0x4a8a85['attributes']=_0x4a8a85[_0xd320('0x33')]['length']?_0x4a8a85[_0xd320('0x33')]:_0x488b15[_0xd320('0x2f')];if(_0x825cc4[_0xd320('0x34')][_0xd320('0x47')]){_0x4a8a85[_0xd320('0x42')]=[{'all':!![]}];}_0x4a8a85=_['merge']({},_0x4a8a85,_0x825cc4[_0xd320('0x48')]);return db[_0xd320('0x41')][_0xd320('0x49')](_0x4a8a85)[_0xd320('0x2a')](handleEntityNotFound(_0xf3c679,null))[_0xd320('0x2a')](respondWithResult(_0xf3c679,null))[_0xd320('0x4a')](handleError(_0xf3c679,null));};exports[_0xd320('0x4b')]=function(_0x52bafa,_0x49c487){return db[_0xd320('0x41')][_0xd320('0x4b')](_0x52bafa[_0xd320('0x4c')],{})[_0xd320('0x2a')](function(_0x42714b){var _0x2319fc=_0x52bafa[_0xd320('0x4d')][_0xd320('0x2b')]({'plain':!![]});if(!_0x2319fc)throw new Error(_0xd320('0x4e'));if(_0x2319fc[_0xd320('0x4f')]==='user'){var _0x11d492=_0x42714b[_0xd320('0x2b')]({'plain':!![]});var _0x3a3ff2='FaxQueues';return db[_0xd320('0x50')]['find']({'where':{'name':_0x3a3ff2,'userProfileId':_0x2319fc[_0xd320('0x51')]},'raw':!![]})[_0xd320('0x2a')](function(_0x287365){if(_0x287365&&_0x287365[_0xd320('0x52')]===0x0){return db[_0xd320('0x53')][_0xd320('0x4b')]({'name':_0x11d492['name'],'resourceId':_0x11d492['id'],'type':_0x287365[_0xd320('0x2d')],'sectionId':_0x287365['id']},{})['then'](function(){return _0x42714b;});}else{return _0x42714b;}})[_0xd320('0x4a')](function(_0x3a41b9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a41b9);throw _0x3a41b9;});}return _0x42714b;})['then'](respondWithResult(_0x49c487,0xc9))[_0xd320('0x4a')](handleError(_0x49c487,null));};exports[_0xd320('0x28')]=function(_0x194587,_0x3fa04d){if(_0x194587[_0xd320('0x4c')]['id']){delete _0x194587[_0xd320('0x4c')]['id'];}return db[_0xd320('0x41')][_0xd320('0x49')]({'where':{'id':_0x194587[_0xd320('0x54')]['id']}})[_0xd320('0x2a')](handleEntityNotFound(_0x3fa04d,null))[_0xd320('0x2a')](saveUpdates(_0x194587[_0xd320('0x4c')],null))[_0xd320('0x2a')](respondWithResult(_0x3fa04d,null))[_0xd320('0x4a')](handleError(_0x3fa04d,null));};exports[_0xd320('0x29')]=function(_0x24ee55,_0xfd577a){return db[_0xd320('0x41')][_0xd320('0x49')]({'where':{'id':_0x24ee55[_0xd320('0x54')]['id']}})['then'](handleEntityNotFound(_0xfd577a,null))[_0xd320('0x2a')](removeEntity(_0xfd577a,null))['catch'](handleError(_0xfd577a,null));};exports[_0xd320('0x55')]=function(_0x2dda56,_0x228adb){return db['FaxQueue'][_0xd320('0x55')]()['then'](respondWithResult(_0x228adb,null))[_0xd320('0x4a')](handleError(_0x228adb,null));};exports['getMembers']=function(_0x5112e9,_0x4d7fb4,_0xd3dab9){var _0x5137d4={'raw':!![],'where':{}},_0x2a1893={},_0x71909b;return db['FaxQueue']['findOne']({'where':{'id':_0x5112e9[_0xd320('0x54')]['id']}})[_0xd320('0x2a')](handleEntityNotFound(_0x4d7fb4,null))[_0xd320('0x2a')](function(_0x56ab16){if(_0x56ab16){_0x71909b=_0x56ab16[_0xd320('0x2b')]({'plain':!![]});_0x2a1893[_0xd320('0x2f')]=_[_0xd320('0x30')](db[_0xd320('0x56')][_0xd320('0x46')]);_0x2a1893[_0xd320('0x34')]=_[_0xd320('0x30')](_0x5112e9[_0xd320('0x34')]);_0x2a1893[_0xd320('0x31')]=_['intersection'](_0x2a1893[_0xd320('0x2f')],_0x2a1893[_0xd320('0x34')]);_0x5137d4[_0xd320('0x33')]=_[_0xd320('0x32')](_0x2a1893[_0xd320('0x2f')],qs[_0xd320('0x35')](_0x5112e9[_0xd320('0x34')][_0xd320('0x35')]));_0x5137d4['attributes']=_0x5137d4[_0xd320('0x33')][_0xd320('0x36')]?_0x5137d4[_0xd320('0x33')]:_0x2a1893[_0xd320('0x2f')];if(!_0x5112e9[_0xd320('0x34')]['hasOwnProperty'](_0xd320('0x38'))){_0x5137d4[_0xd320('0x23')]=qs['limit'](_0x5112e9[_0xd320('0x34')][_0xd320('0x23')]);_0x5137d4[_0xd320('0x22')]=qs[_0xd320('0x22')](_0x5112e9['query'][_0xd320('0x22')]);}_0x5137d4[_0xd320('0x57')]=qs['sort'](_0x5112e9[_0xd320('0x34')][_0xd320('0x39')]);_0x5137d4[_0xd320('0x3a')]=qs['filters'](_[_0xd320('0x3b')](_0x5112e9[_0xd320('0x34')],_0x2a1893['filters']));_0x5137d4[_0xd320('0x3a')][_0xd320('0x58')]=_0x56ab16['id'];if(_0x5112e9[_0xd320('0x34')][_0xd320('0x40')]){_0x5137d4[_0xd320('0x3a')]=_[_0xd320('0x3c')](_0x5137d4[_0xd320('0x3a')],{'$or':_[_0xd320('0x3d')](_0x5137d4[_0xd320('0x33')],function(_0x56d193){var _0x3aa16a={};_0x3aa16a[_0x56d193]={'$like':'%'+_0x5112e9[_0xd320('0x34')][_0xd320('0x40')]+'%'};return _0x3aa16a;})});}_0x5137d4=_[_0xd320('0x3c')]({},_0x5137d4,_0x5112e9['options']);return db[_0xd320('0x56')][_0xd320('0x43')](_0x5137d4);}})['then'](function(_0x37ae21){if(_0x37ae21){return db['User'][_0xd320('0x59')]({'where':{'id':_['map'](_0x37ae21,'UserId'),'role':_0xd320('0x5a')},'attributes':['id',_0xd320('0x2d'),_0xd320('0x5b'),_0xd320('0x5c'),'createdAt']});}})[_0xd320('0x2a')](function(_0x2709d1){if(_0x2709d1){return{'count':_0x2709d1['count'],'rows':_['map'](_0x2709d1[_0xd320('0x44')],function(_0x1b794b){return{'membername':_0x1b794b[_0xd320('0x2d')],'UserId':_0x1b794b['id'],'queue_name':_0x71909b[_0xd320('0x2d')],'FaxQueueId':_0x71909b['id'],'interface':util[_0xd320('0x5d')](_0xd320('0x5e'),_0xd320('0x5f'),_0x1b794b['name']),'penalty':0x0,'paused':_0x1b794b[_0xd320('0x5b')],'createdAt':_0x1b794b[_0xd320('0x60')],'updatedAt':_0x1b794b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4d7fb4,_0x5137d4))[_0xd320('0x4a')](handleError(_0x4d7fb4,null));};exports['getTeams']=function(_0x4b0cee,_0x52ab22,_0x50fcb8){var _0x12a43f={};var _0x1d7b20={};var _0x3652c1;var _0x508bfe;return db[_0xd320('0x41')][_0xd320('0x61')]({'where':{'id':_0x4b0cee[_0xd320('0x54')]['id']}})[_0xd320('0x2a')](handleEntityNotFound(_0x52ab22,null))['then'](function(_0x7b6c7c){if(_0x7b6c7c){_0x3652c1=_0x7b6c7c;_0x1d7b20[_0xd320('0x2f')]=_[_0xd320('0x30')](db[_0xd320('0x62')][_0xd320('0x46')]);_0x1d7b20[_0xd320('0x34')]=_[_0xd320('0x30')](_0x4b0cee[_0xd320('0x34')]);_0x1d7b20[_0xd320('0x31')]=_[_0xd320('0x32')](_0x1d7b20[_0xd320('0x2f')],_0x1d7b20[_0xd320('0x34')]);_0x12a43f['attributes']=_['intersection'](_0x1d7b20[_0xd320('0x2f')],qs['fields'](_0x4b0cee[_0xd320('0x34')][_0xd320('0x35')]));_0x12a43f[_0xd320('0x33')]=_0x12a43f[_0xd320('0x33')][_0xd320('0x36')]?_0x12a43f[_0xd320('0x33')]:_0x1d7b20['model'];_0x12a43f['order']=qs['sort'](_0x4b0cee[_0xd320('0x34')][_0xd320('0x39')]);_0x12a43f[_0xd320('0x3a')]=qs[_0xd320('0x31')](_['pick'](_0x4b0cee[_0xd320('0x34')],_0x1d7b20[_0xd320('0x31')]));if(_0x4b0cee[_0xd320('0x34')][_0xd320('0x40')]){_0x12a43f['where']=_[_0xd320('0x3c')](_0x12a43f[_0xd320('0x3a')],{'$or':_[_0xd320('0x3d')](_0x12a43f['attributes'],function(_0x332c7e){var _0x4fc406={};_0x4fc406[_0x332c7e]={'$like':'%'+_0x4b0cee[_0xd320('0x34')][_0xd320('0x40')]+'%'};return _0x4fc406;})});}_0x12a43f=_[_0xd320('0x3c')]({},_0x12a43f,_0x4b0cee[_0xd320('0x48')]);return _0x3652c1[_0xd320('0x63')](_0x12a43f);}})['then'](function(_0x4aed8b){if(_0x4aed8b){_0x508bfe=_0x4aed8b[_0xd320('0x36')];if(!_0x4b0cee[_0xd320('0x34')]['hasOwnProperty']('nolimit')){_0x12a43f[_0xd320('0x23')]=qs[_0xd320('0x23')](_0x4b0cee['query'][_0xd320('0x23')]);_0x12a43f[_0xd320('0x22')]=qs[_0xd320('0x22')](_0x4b0cee[_0xd320('0x34')][_0xd320('0x22')]);}return _0x3652c1['getTeams'](_0x12a43f);}})['then'](function(_0x5871d8){if(_0x5871d8){return _0x5871d8?{'count':_0x508bfe,'rows':_0x5871d8}:null;}})[_0xd320('0x2a')](respondWithResult(_0x52ab22,null))['catch'](handleError(_0x52ab22,null));};exports['addTeams']=function(_0x584889,_0x2922a6,_0x215956){var _0x5f0215=_0x584889[_0xd320('0x4c')][_0xd320('0x64')];return db['Team'][_0xd320('0x43')]({'where':{'id':_['map'](_0x5f0215,'id')},'attributes':['id'],'include':[{'model':db[_0xd320('0x65')],'as':_0xd320('0x66'),'attributes':['id',_0xd320('0x2d'),_0xd320('0x67'),_0xd320('0x68'),_0xd320('0x69')],'raw':!![]}]})[_0xd320('0x2a')](function(_0x5313ff){if(_0x5313ff){var _0x5edfe0=_[_0xd320('0x6a')](_0x5313ff,function(_0x2b2bb9){var _0x30e239=_0x2b2bb9[_0xd320('0x2b')]({'plain':!![]});return _0x30e239['Agents'];});return db['FaxQueue'][_0xd320('0x49')]({'where':{'id':_0x584889[_0xd320('0x54')]['id']}})[_0xd320('0x2a')](function(_0x4bcdd9){return db[_0xd320('0x6b')][_0xd320('0x6c')](function(_0x29394a){return _0x4bcdd9['addTeams'](_[_0xd320('0x3d')](_0x5f0215,'id'),{'transaction':_0x29394a})[_0xd320('0x2a')](function(){return BPromise[_0xd320('0x6d')](_0x5edfe0,function(_0x3a69ed){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x3a69ed['id'],'FaxQueueId':_0x584889[_0xd320('0x54')]['id']},'transaction':_0x29394a});});})[_0xd320('0x2a')](function(){_0x5edfe0[_0xd320('0x6e')](function(_0x501107){socket['emit'](_0xd320('0x6f'),{'UserId':_0x501107['id'],'FaxQueueId':_0x4bcdd9['id']});});});});});}})[_0xd320('0x2a')](respondWithStatusCode(_0x2922a6,null))[_0xd320('0x4a')](handleError(_0x2922a6,null));};exports[_0xd320('0x70')]=function(_0x44e894,_0x3fc5aa,_0x281178){return db[_0xd320('0x62')][_0xd320('0x43')]({'where':{'id':_0x44e894[_0xd320('0x34')][_0xd320('0x71')]},'attributes':['id'],'include':[{'model':db[_0xd320('0x65')],'as':_0xd320('0x66'),'attributes':['id'],'raw':!![]}]})[_0xd320('0x2a')](handleEntityNotFound(_0x3fc5aa,null))[_0xd320('0x2a')](function(_0x13e52a){var _0xada7ed=_[_0xd320('0x3d')](_0x13e52a,'id');var _0x80c5e0=[];var _0x17d516=[];var _0x74877d=squel['select']();_0x74877d[_0xd320('0x72')]('tq.TeamId')[_0xd320('0x73')](_0xd320('0x74'),'tq')[_0xd320('0x75')](_0xd320('0x76'),'ut',_0xd320('0x77'))[_0xd320('0x3a')](_0xd320('0x78'),_0x44e894[_0xd320('0x54')]['id']);for(var _0x1a64a3=0x0;_0x1a64a3<_0x13e52a[_0xd320('0x36')];_0x1a64a3+=0x1){let _0x192b84=_0x13e52a[_0x1a64a3];for(var _0x14378d=0x0;_0x14378d<_0x192b84['Agents']['length'];_0x14378d+=0x1){let _0x175954=_0x192b84[_0xd320('0x66')][_0x14378d];var _0x1295a3=_0x74877d['clone']();_0x1295a3[_0xd320('0x3a')]('ut.UserId\x20=\x20?',_0x175954['id']);_0x17d516[_0xd320('0x79')](db[_0xd320('0x6b')]['query'](_0x1295a3[_0xd320('0x7a')](),{'type':db[_0xd320('0x6b')][_0xd320('0x7b')]['SELECT']})[_0xd320('0x2a')](function(_0x3b40cb){if(_0x3b40cb[_0xd320('0x36')]===0x1){return _0x175954['id'];}else{var _0x5caeed=_[_0xd320('0x7c')](_[_0xd320('0x3d')](_0x3b40cb,'TeamId'),function(_0x420b06){return _['includes'](_0xada7ed,_0x420b06);});if(_0x5caeed){return _0x175954['id'];}}}));}}return BPromise[_0xd320('0x7d')](_0x17d516)[_0xd320('0x2a')](function(_0x1662b8){_0x80c5e0=_(_0x80c5e0)[_0xd320('0x7e')](_0x1662b8)[_0xd320('0x7f')]()[_0xd320('0x80')]();return db[_0xd320('0x41')][_0xd320('0x49')]({'where':{'id':_0x44e894['params']['id']}})[_0xd320('0x2a')](function(_0x359063){return db[_0xd320('0x6b')]['transaction'](function(_0x2fb8d6){return _0x359063[_0xd320('0x70')](_0x44e894['query']['ids'],{'transaction':_0x2fb8d6})[_0xd320('0x2a')](function(){if(!_[_0xd320('0x81')](_0x80c5e0)){return _0x359063['removeAgents'](_0x80c5e0,{'transaction':_0x2fb8d6});}})[_0xd320('0x2a')](function(){_0x80c5e0['forEach'](function(_0x49b0ee){socket['emit'](_0xd320('0x82'),{'UserId':_0x49b0ee,'FaxQueueId':_0x359063['id']});});});});});});})[_0xd320('0x2a')](respondWithStatusCode(_0x3fc5aa,null))[_0xd320('0x4a')](handleError(_0x3fc5aa,null));};exports[_0xd320('0x83')]=function(_0xd319d0,_0x278a70,_0x5262cd){return db[_0xd320('0x41')]['find']({'where':{'id':_0xd319d0[_0xd320('0x54')]['id']}})[_0xd320('0x2a')](handleEntityNotFound(_0x278a70,null))[_0xd320('0x2a')](function(_0x445b53){if(_0x445b53){return _0x445b53['addAgents'](_0xd319d0[_0xd320('0x4c')][_0xd320('0x71')],_['omit'](_0xd319d0[_0xd320('0x4c')],[_0xd320('0x71'),'id'])||{})[_0xd320('0x84')](function(_0x2fbacc){for(var _0x6b9f8f=0x0;_0x6b9f8f<_0xd319d0[_0xd320('0x4c')][_0xd320('0x71')][_0xd320('0x36')];_0x6b9f8f+=0x1){socket[_0xd320('0x85')](_0xd320('0x6f'),{'UserId':_0xd319d0['body'][_0xd320('0x71')][_0x6b9f8f],'FaxQueueId':_0xd319d0[_0xd320('0x54')]['id']});}return _0x2fbacc;});}})[_0xd320('0x2a')](respondWithResult(_0x278a70,null))['catch'](handleError(_0x278a70,null));};exports[_0xd320('0x86')]=function(_0x17ac59,_0x1ccb7e,_0x3af5f8){return db['FaxQueue']['find']({'where':{'id':_0x17ac59['params']['id']}})['then'](handleEntityNotFound(_0x1ccb7e,null))[_0xd320('0x2a')](function(_0x4ccf20){if(_0x4ccf20){return _0x4ccf20[_0xd320('0x86')](_0x17ac59[_0xd320('0x34')][_0xd320('0x71')])[_0xd320('0x2a')](function(){if(_[_0xd320('0x87')](_0x17ac59[_0xd320('0x34')][_0xd320('0x71')])){for(var _0x3f4d8d=0x0;_0x3f4d8d<_0x17ac59['query'][_0xd320('0x71')]['length'];_0x3f4d8d+=0x1){socket[_0xd320('0x85')](_0xd320('0x82'),{'UserId':Number(_0x17ac59[_0xd320('0x34')][_0xd320('0x71')][_0x3f4d8d]),'FaxQueueId':Number(_0x17ac59['params']['id'])});}}else{socket['emit'](_0xd320('0x82'),{'UserId':Number(_0x17ac59[_0xd320('0x34')]['ids']),'FaxQueueId':Number(_0x17ac59[_0xd320('0x54')]['id'])});}});}})[_0xd320('0x2a')](respondWithStatusCode(_0x1ccb7e,null))[_0xd320('0x4a')](handleError(_0x1ccb7e,null));};exports['getAgents']=function(_0x1c96f1,_0x5f0979,_0x74597b){var _0xc59518={};var _0x4f8e8d={};var _0x32883c;var _0x191b13;return db[_0xd320('0x41')][_0xd320('0x61')]({'where':{'id':_0x1c96f1['params']['id']}})['then'](handleEntityNotFound(_0x5f0979,null))[_0xd320('0x2a')](function(_0x50a6a5){if(_0x50a6a5){_0x32883c=_0x50a6a5;_0x4f8e8d[_0xd320('0x2f')]=_[_0xd320('0x30')](db[_0xd320('0x65')][_0xd320('0x46')]);_0x4f8e8d[_0xd320('0x34')]=_[_0xd320('0x30')](_0x1c96f1[_0xd320('0x34')]);_0x4f8e8d[_0xd320('0x31')]=_[_0xd320('0x32')](_0x4f8e8d[_0xd320('0x2f')],_0x4f8e8d[_0xd320('0x34')]);_0xc59518[_0xd320('0x33')]=_[_0xd320('0x32')](_0x4f8e8d[_0xd320('0x2f')],qs[_0xd320('0x35')](_0x1c96f1[_0xd320('0x34')][_0xd320('0x35')]));_0xc59518['attributes']=_0xc59518[_0xd320('0x33')][_0xd320('0x36')]?_0xc59518[_0xd320('0x33')]:_0x4f8e8d[_0xd320('0x2f')];_0xc59518[_0xd320('0x57')]=qs[_0xd320('0x39')](_0x1c96f1[_0xd320('0x34')]['sort']);_0xc59518[_0xd320('0x3a')]=qs['filters'](_['pick'](_0x1c96f1[_0xd320('0x34')],_0x4f8e8d[_0xd320('0x31')]));if(_0x1c96f1[_0xd320('0x34')][_0xd320('0x40')]){_0xc59518['where']=_[_0xd320('0x3c')](_0xc59518[_0xd320('0x3a')],{'$or':_[_0xd320('0x3d')](_0xc59518[_0xd320('0x33')],function(_0x19b8f7){var _0x2d8d1f={};_0x2d8d1f[_0x19b8f7]={'$like':'%'+_0x1c96f1[_0xd320('0x34')][_0xd320('0x40')]+'%'};return _0x2d8d1f;})});}_0xc59518=_['merge']({},_0xc59518,_0x1c96f1[_0xd320('0x48')]);return _0x32883c['getAgents'](_0xc59518);}})[_0xd320('0x2a')](function(_0x915e52){if(_0x915e52){_0x191b13=_0x915e52['length'];if(!_0x1c96f1[_0xd320('0x34')][_0xd320('0x37')](_0xd320('0x38'))){_0xc59518[_0xd320('0x23')]=qs[_0xd320('0x23')](_0x1c96f1[_0xd320('0x34')][_0xd320('0x23')]);_0xc59518[_0xd320('0x22')]=qs['offset'](_0x1c96f1[_0xd320('0x34')][_0xd320('0x22')]);}return _0x32883c[_0xd320('0x88')](_0xc59518);}})[_0xd320('0x2a')](function(_0xc771f){if(_0xc771f){return _0xc771f?{'count':_0x191b13,'rows':_0xc771f}:null;}})['then'](respondWithResult(_0x5f0979,null))[_0xd320('0x4a')](handleError(_0x5f0979,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d164778..d5cb6a5 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 _0x16d2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x33cfe6,_0x3e215c){var _0x34b6cf=function(_0x4ce4c5){while(--_0x4ce4c5){_0x33cfe6['push'](_0x33cfe6['shift']());}};_0x34b6cf(++_0x3e215c);}(_0x16d2,0x123));var _0x216d=function(_0x141ad6,_0xcb24c0){_0x141ad6=_0x141ad6-0x0;var _0x17475b=_0x16d2[_0x141ad6];return _0x17475b;};'use strict';var EventEmitter=require(_0x216d('0x0'));var FaxQueue=require(_0x216d('0x1'))['db'][_0x216d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x216d('0x3')](0x0);var events={'afterCreate':_0x216d('0x4'),'afterUpdate':_0x216d('0x5'),'afterDestroy':_0x216d('0x6')};function emitEvent(_0x239b49){return function(_0xfd7306,_0x593bb0,_0x2c662d){FaxQueueEvents[_0x216d('0x7')](_0x239b49+':'+_0xfd7306['id'],_0xfd7306);FaxQueueEvents[_0x216d('0x7')](_0x239b49,_0xfd7306);_0x2c662d(null);};}for(var e in events){if(events[_0x216d('0x8')](e)){var event=events[e];FaxQueue[_0x216d('0x9')](e,emitEvent(event));}}module[_0x216d('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x0713=['exports','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x300860,_0x509371){var _0x2094ad=function(_0x2090a2){while(--_0x2090a2){_0x300860['push'](_0x300860['shift']());}};_0x2094ad(++_0x509371);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x3071('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3071('0x1')](0x0);var events={'afterCreate':_0x3071('0x2'),'afterUpdate':_0x3071('0x3'),'afterDestroy':_0x3071('0x4')};function emitEvent(_0x52b5fb){return function(_0x2c547f,_0x7b18a4,_0x33a70c){FaxQueueEvents[_0x3071('0x5')](_0x52b5fb+':'+_0x2c547f['id'],_0x2c547f);FaxQueueEvents[_0x3071('0x5')](_0x52b5fb,_0x2c547f);_0x33a70c(null);};}for(var e in events){if(events[_0x3071('0x6')](e)){var event=events[e];FaxQueue[_0x3071('0x7')](e,emitEvent(event));}}module[_0x3071('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 8e6b8e2..2c01613 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 _0x0b0e=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2f44c5,_0x5a8599){var _0x26b793=function(_0x1eb4fd){while(--_0x1eb4fd){_0x2f44c5['push'](_0x2f44c5['shift']());}};_0x26b793(++_0x5a8599);}(_0x0b0e,0x187));var _0xe0b0=function(_0x28b4cd,_0x573ff1){_0x28b4cd=_0x28b4cd-0x0;var _0x4229cc=_0x0b0e[_0x28b4cd];return _0x4229cc;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0e=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x57f575,_0x50cc23){var _0x25cfa1=function(_0x37efb8){while(--_0x37efb8){_0x57f575['push'](_0x57f575['shift']());}};_0x25cfa1(++_0x50cc23);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12309b,_0x59dd8c){_0x12309b=_0x12309b-0x0;var _0x482e4d=_0x0b0e[_0x12309b];return _0x482e4d;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('FaxQueue',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 9890325..0a38f04 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 _0x5255=['../../config/environment','client','http','defaults','redis','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xfa0568,_0x1de7ce){var _0x5ec3ca=function(_0x3ae0d4){while(--_0x3ae0d4){_0xfa0568['push'](_0xfa0568['shift']());}};_0x5ec3ca(++_0x1de7ce);}(_0x5255,0x115));var _0x5525=function(_0x4ca767,_0x53c5db){_0x4ca767=_0x4ca767-0x0;var _0x556ff8=_0x5255[_0x4ca767];return _0x556ff8;};'use strict';var _=require(_0x5525('0x0'));var util=require(_0x5525('0x1'));var moment=require(_0x5525('0x2'));var BPromise=require(_0x5525('0x3'));var rs=require(_0x5525('0x4'));var fs=require('fs');var Redis=require(_0x5525('0x5'));var db=require(_0x5525('0x6'))['db'];var utils=require(_0x5525('0x7'));var logger=require(_0x5525('0x8'))(_0x5525('0x9'));var config=require(_0x5525('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5525('0xb')][_0x5525('0xc')]({'port':0x232a});config['redis']=_[_0x5525('0xd')](config[_0x5525('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x5525('0xf'))(new Redis(config[_0x5525('0xe')]));require(_0x5525('0x10'))['register'](socket);function respondWithRpcPromise(_0x37e3c3,_0x5aa3ff,_0x37cf2e){return new BPromise(function(_0x56ee62,_0x2933e9){return client[_0x5525('0x11')](_0x37e3c3,_0x37cf2e)[_0x5525('0x12')](function(_0x17f5ce){logger[_0x5525('0x13')](_0x5525('0x14'),_0x5aa3ff,_0x5525('0x15'));logger[_0x5525('0x16')](_0x5525('0x17'),_0x5aa3ff,'request\x20sent',JSON[_0x5525('0x18')](_0x17f5ce));if(_0x17f5ce['error']){if(_0x17f5ce[_0x5525('0x19')]['code']===0x1f4){logger['error'](_0x5525('0x14'),_0x5aa3ff,_0x17f5ce[_0x5525('0x19')][_0x5525('0x1a')]);return _0x2933e9(_0x17f5ce['error'][_0x5525('0x1a')]);}logger['error'](_0x5525('0x14'),_0x5aa3ff,_0x17f5ce['error']['message']);return _0x56ee62(_0x17f5ce[_0x5525('0x19')]['message']);}else{logger[_0x5525('0x13')](_0x5525('0x14'),_0x5aa3ff,_0x5525('0x15'));_0x56ee62(_0x17f5ce[_0x5525('0x1b')]['message']);}})[_0x5525('0x1c')](function(_0x23a4f5){logger[_0x5525('0x19')](_0x5525('0x14'),_0x5aa3ff,_0x23a4f5);_0x2933e9(_0x23a4f5);});});}exports[_0x5525('0x1d')]=function(_0x1efa42){var _0x568b52=this;return new Promise(function(_0x58b738,_0x24df40){return db[_0x5525('0x1e')][_0x5525('0x1f')]({'raw':_0x1efa42[_0x5525('0x20')]?_0x1efa42['options'][_0x5525('0x21')]===undefined?!![]:![]:!![],'where':_0x1efa42[_0x5525('0x20')]?_0x1efa42['options'][_0x5525('0x22')]||null:null,'attributes':_0x1efa42[_0x5525('0x20')]?_0x1efa42[_0x5525('0x20')][_0x5525('0x23')]||null:null,'limit':_0x1efa42['options']?_0x1efa42[_0x5525('0x20')][_0x5525('0x24')]||null:null,'include':_0x1efa42[_0x5525('0x20')]?_0x1efa42[_0x5525('0x20')][_0x5525('0x25')]?_[_0x5525('0x26')](_0x1efa42[_0x5525('0x20')][_0x5525('0x25')],function(_0x116592){return{'model':db[_0x116592[_0x5525('0x27')]],'as':_0x116592['as'],'attributes':_0x116592[_0x5525('0x23')],'include':_0x116592['include']?_[_0x5525('0x26')](_0x116592[_0x5525('0x25')],function(_0x1e8785){return{'model':db[_0x1e8785['model']],'as':_0x1e8785['as'],'attributes':_0x1e8785['attributes'],'include':_0x1e8785[_0x5525('0x25')]?_['map'](_0x1e8785[_0x5525('0x25')],function(_0x33d8eb){return{'model':db[_0x33d8eb['model']],'as':_0x33d8eb['as'],'attributes':_0x33d8eb[_0x5525('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5525('0x12')](function(_0x994337){logger['info'](_0x5525('0x1d'),_0x1efa42);logger[_0x5525('0x16')](_0x5525('0x1d'),_0x1efa42,JSON[_0x5525('0x18')](_0x994337));_0x58b738(_0x994337);})['catch'](function(_0x292f9f){logger[_0x5525('0x19')](_0x5525('0x1d'),_0x292f9f[_0x5525('0x1a')],_0x1efa42);_0x24df40(_0x568b52[_0x5525('0x19')](0x1f4,_0x292f9f[_0x5525('0x1a')]));});});};exports[_0x5525('0x28')]=function(_0x2d5cbc){var _0x1efb7e=this;return new Promise(function(_0x3beb70,_0x1f9ff3){return db[_0x5525('0x1e')]['find']({'raw':_0x2d5cbc[_0x5525('0x20')]?_0x2d5cbc['options'][_0x5525('0x21')]===undefined?!![]:![]:!![],'where':_0x2d5cbc[_0x5525('0x20')]?_0x2d5cbc[_0x5525('0x20')][_0x5525('0x22')]||null:null,'attributes':_0x2d5cbc['options']?_0x2d5cbc['options'][_0x5525('0x23')]||null:null,'include':_0x2d5cbc[_0x5525('0x20')]?_0x2d5cbc['options'][_0x5525('0x25')]?_[_0x5525('0x26')](_0x2d5cbc[_0x5525('0x20')]['include'],function(_0x54cdfc){return{'model':db[_0x54cdfc[_0x5525('0x27')]],'as':_0x54cdfc['as'],'attributes':_0x54cdfc[_0x5525('0x23')],'include':_0x54cdfc[_0x5525('0x25')]?_[_0x5525('0x26')](_0x54cdfc[_0x5525('0x25')],function(_0x5c8313){return{'model':db[_0x5c8313[_0x5525('0x27')]],'as':_0x5c8313['as'],'attributes':_0x5c8313[_0x5525('0x23')],'include':_0x5c8313[_0x5525('0x25')]?_[_0x5525('0x26')](_0x5c8313['include'],function(_0x4e0834){return{'model':db[_0x4e0834[_0x5525('0x27')]],'as':_0x4e0834['as'],'attributes':_0x4e0834[_0x5525('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5525('0x12')](function(_0x2dcc7e){logger['info']('ShowFaxQueue',_0x2d5cbc);logger[_0x5525('0x16')](_0x5525('0x28'),_0x2d5cbc,JSON[_0x5525('0x18')](_0x2dcc7e));_0x3beb70(_0x2dcc7e);})[_0x5525('0x1c')](function(_0x12a7e5){logger[_0x5525('0x19')](_0x5525('0x28'),_0x12a7e5[_0x5525('0x1a')],_0x2d5cbc);_0x1f9ff3(_0x1efb7e['error'](0x1f4,_0x12a7e5[_0x5525('0x1a')]));});});}; \ No newline at end of file +var _0x46ff=['find','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetFaxQueue','options','raw','attributes','include','map','model','stringify','ShowFaxQueue','FaxQueue'];(function(_0x59d58c,_0x556852){var _0x212cd3=function(_0x307341){while(--_0x307341){_0x59d58c['push'](_0x59d58c['shift']());}};_0x212cd3(++_0x556852);}(_0x46ff,0x6a));var _0xf46f=function(_0x40d524,_0x485032){_0x40d524=_0x40d524-0x0;var _0x3333b9=_0x46ff[_0x40d524];return _0x3333b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf46f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf46f('0x1'));var logger=require(_0xf46f('0x2'))('rpc');var config=require(_0xf46f('0x3'));var jayson=require(_0xf46f('0x4'));var client=jayson[_0xf46f('0x5')][_0xf46f('0x6')]({'port':0x232a});config[_0xf46f('0x7')]=_[_0xf46f('0x8')](config[_0xf46f('0x7')],{'host':_0xf46f('0x9'),'port':0x18eb});var socket=require(_0xf46f('0xa'))(new Redis(config['redis']));require('./faxQueue.socket')[_0xf46f('0xb')](socket);function respondWithRpcPromise(_0x2d3c28,_0x43de18,_0x251da8){return new BPromise(function(_0xab3613,_0x26488d){return client[_0xf46f('0xc')](_0x2d3c28,_0x251da8)[_0xf46f('0xd')](function(_0x46fd0b){logger['info'](_0xf46f('0xe'),_0x43de18,_0xf46f('0xf'));logger[_0xf46f('0x10')](_0xf46f('0x11'),_0x43de18,_0xf46f('0xf'),JSON['stringify'](_0x46fd0b));if(_0x46fd0b[_0xf46f('0x12')]){if(_0x46fd0b['error'][_0xf46f('0x13')]===0x1f4){logger[_0xf46f('0x12')]('FaxQueue,\x20%s,\x20%s',_0x43de18,_0x46fd0b[_0xf46f('0x12')][_0xf46f('0x14')]);return _0x26488d(_0x46fd0b[_0xf46f('0x12')][_0xf46f('0x14')]);}logger['error'](_0xf46f('0xe'),_0x43de18,_0x46fd0b[_0xf46f('0x12')][_0xf46f('0x14')]);return _0xab3613(_0x46fd0b[_0xf46f('0x12')][_0xf46f('0x14')]);}else{logger[_0xf46f('0x15')]('FaxQueue,\x20%s,\x20%s',_0x43de18,_0xf46f('0xf'));_0xab3613(_0x46fd0b[_0xf46f('0x16')][_0xf46f('0x14')]);}})[_0xf46f('0x17')](function(_0x42d69f){logger[_0xf46f('0x12')]('FaxQueue,\x20%s,\x20%s',_0x43de18,_0x42d69f);_0x26488d(_0x42d69f);});});}exports[_0xf46f('0x18')]=function(_0x3f5f9e){var _0x3bcca7=this;return new Promise(function(_0x16d212,_0x3b2b7f){return db['FaxQueue']['findAll']({'raw':_0x3f5f9e[_0xf46f('0x19')]?_0x3f5f9e[_0xf46f('0x19')][_0xf46f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f5f9e[_0xf46f('0x19')]?_0x3f5f9e[_0xf46f('0x19')]['where']||null:null,'attributes':_0x3f5f9e['options']?_0x3f5f9e['options'][_0xf46f('0x1b')]||null:null,'limit':_0x3f5f9e[_0xf46f('0x19')]?_0x3f5f9e[_0xf46f('0x19')]['limit']||null:null,'include':_0x3f5f9e[_0xf46f('0x19')]?_0x3f5f9e[_0xf46f('0x19')][_0xf46f('0x1c')]?_['map'](_0x3f5f9e['options'][_0xf46f('0x1c')],function(_0x58a643){return{'model':db[_0x58a643['model']],'as':_0x58a643['as'],'attributes':_0x58a643[_0xf46f('0x1b')],'include':_0x58a643[_0xf46f('0x1c')]?_[_0xf46f('0x1d')](_0x58a643[_0xf46f('0x1c')],function(_0x344083){return{'model':db[_0x344083[_0xf46f('0x1e')]],'as':_0x344083['as'],'attributes':_0x344083[_0xf46f('0x1b')],'include':_0x344083[_0xf46f('0x1c')]?_[_0xf46f('0x1d')](_0x344083[_0xf46f('0x1c')],function(_0x3de676){return{'model':db[_0x3de676[_0xf46f('0x1e')]],'as':_0x3de676['as'],'attributes':_0x3de676[_0xf46f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf46f('0xd')](function(_0x492553){logger[_0xf46f('0x15')](_0xf46f('0x18'),_0x3f5f9e);logger[_0xf46f('0x10')](_0xf46f('0x18'),_0x3f5f9e,JSON[_0xf46f('0x1f')](_0x492553));_0x16d212(_0x492553);})[_0xf46f('0x17')](function(_0x1c57d7){logger[_0xf46f('0x12')](_0xf46f('0x18'),_0x1c57d7[_0xf46f('0x14')],_0x3f5f9e);_0x3b2b7f(_0x3bcca7['error'](0x1f4,_0x1c57d7[_0xf46f('0x14')]));});});};exports[_0xf46f('0x20')]=function(_0x397206){var _0x350fdf=this;return new Promise(function(_0x4631f7,_0x7de3e9){return db[_0xf46f('0x21')][_0xf46f('0x22')]({'raw':_0x397206['options']?_0x397206[_0xf46f('0x19')][_0xf46f('0x1a')]===undefined?!![]:![]:!![],'where':_0x397206['options']?_0x397206[_0xf46f('0x19')]['where']||null:null,'attributes':_0x397206[_0xf46f('0x19')]?_0x397206[_0xf46f('0x19')][_0xf46f('0x1b')]||null:null,'include':_0x397206[_0xf46f('0x19')]?_0x397206[_0xf46f('0x19')][_0xf46f('0x1c')]?_[_0xf46f('0x1d')](_0x397206[_0xf46f('0x19')]['include'],function(_0x3793cb){return{'model':db[_0x3793cb['model']],'as':_0x3793cb['as'],'attributes':_0x3793cb['attributes'],'include':_0x3793cb[_0xf46f('0x1c')]?_[_0xf46f('0x1d')](_0x3793cb[_0xf46f('0x1c')],function(_0x4e4380){return{'model':db[_0x4e4380['model']],'as':_0x4e4380['as'],'attributes':_0x4e4380[_0xf46f('0x1b')],'include':_0x4e4380[_0xf46f('0x1c')]?_[_0xf46f('0x1d')](_0x4e4380[_0xf46f('0x1c')],function(_0x10f301){return{'model':db[_0x10f301['model']],'as':_0x10f301['as'],'attributes':_0x10f301['attributes']};}):[]};}):[]};}):[]:[]})[_0xf46f('0xd')](function(_0x368c15){logger[_0xf46f('0x15')](_0xf46f('0x20'),_0x397206);logger[_0xf46f('0x10')](_0xf46f('0x20'),_0x397206,JSON['stringify'](_0x368c15));_0x4631f7(_0x368c15);})[_0xf46f('0x17')](function(_0x1e4dca){logger['error']('ShowFaxQueue',_0x1e4dca[_0xf46f('0x14')],_0x397206);_0x7de3e9(_0x350fdf[_0xf46f('0x12')](0x1f4,_0x1e4dca['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index fab3f1e..d8a50f8 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 _0x17a3=['save','removeListener','register','length'];(function(_0x3c7594,_0x210b15){var _0x35a40c=function(_0x1365af){while(--_0x1365af){_0x3c7594['push'](_0x3c7594['shift']());}};_0x35a40c(++_0x210b15);}(_0x17a3,0xec));var _0x317a=function(_0x5d17bc,_0x3a3add){_0x5d17bc=_0x5d17bc-0x0;var _0x44cc9a=_0x17a3[_0x5d17bc];return _0x44cc9a;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x317a('0x0'),'remove','update'];function createListener(_0x34fc53,_0x5b16ea){return function(_0xb8bc3){_0x5b16ea['emit'](_0x34fc53,_0xb8bc3);};}function removeListener(_0x2a94a3,_0x30aa8d){return function(){FaxQueueEvents[_0x317a('0x1')](_0x2a94a3,_0x30aa8d);};}exports[_0x317a('0x2')]=function(_0x2d87ad){for(var _0x43d3e2=0x0,_0x360643=events[_0x317a('0x3')];_0x43d3e2<_0x360643;_0x43d3e2++){var _0x15dcb6=events[_0x43d3e2];var _0x45b284=createListener('faxQueue:'+_0x15dcb6,_0x2d87ad);FaxQueueEvents['on'](_0x15dcb6,_0x45b284);}}; \ No newline at end of file +var _0x9278=['register','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x435b01,_0x4c537c){var _0x223c80=function(_0x334c48){while(--_0x334c48){_0x435b01['push'](_0x435b01['shift']());}};_0x223c80(++_0x4c537c);}(_0x9278,0x16a));var _0x8927=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9278[_0x126558];return _0x1f6d14;};'use strict';var FaxQueueEvents=require(_0x8927('0x0'));var events=[_0x8927('0x1'),_0x8927('0x2'),_0x8927('0x3')];function createListener(_0x111984,_0x3e0bd2){return function(_0x38acd6){_0x3e0bd2[_0x8927('0x4')](_0x111984,_0x38acd6);};}function removeListener(_0x5750c3,_0xd26056){return function(){FaxQueueEvents[_0x8927('0x5')](_0x5750c3,_0xd26056);};}exports[_0x8927('0x6')]=function(_0x1f328e){for(var _0x154e6e=0x0,_0x4f74c3=events['length'];_0x154e6e<_0x4f74c3;_0x154e6e++){var _0x433814=events[_0x154e6e];var _0x4b33fc=createListener(_0x8927('0x7')+_0x433814,_0x1f328e);FaxQueueEvents['on'](_0x433814,_0x4b33fc);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7f9354a..68aa489 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 _0x4361=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','get','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','put','update','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4361,0xb4));var _0x1436=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x4361[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x1436('0x0'));var util=require(_0x1436('0x1'));var path=require(_0x1436('0x2'));var timeout=require(_0x1436('0x3'));var express=require(_0x1436('0x4'));var router=express[_0x1436('0x5')]();var auth=require(_0x1436('0x6'));var interaction=require(_0x1436('0x7'));var config=require('../../config/environment');var controller=require(_0x1436('0x8'));router['get']('/',auth[_0x1436('0x9')](),controller['index']);router[_0x1436('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x1436('0xb')]);router[_0x1436('0xa')]('/:id',auth[_0x1436('0x9')](),controller[_0x1436('0xc')]);router['get'](_0x1436('0xd'),auth['isAuthenticated'](),controller[_0x1436('0xe')]);router['get'](_0x1436('0xf'),auth[_0x1436('0x9')](),controller[_0x1436('0x10')]);router['get'](_0x1436('0x11'),auth[_0x1436('0x9')](),controller['getAgents']);router[_0x1436('0x12')]('/',auth[_0x1436('0x9')](),controller[_0x1436('0x13')]);router[_0x1436('0x12')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x1436('0x12')](_0x1436('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1436('0x14')]('/:id',auth[_0x1436('0x9')](),controller[_0x1436('0x15')]);router[_0x1436('0x16')]('/:id',auth[_0x1436('0x9')](),controller['destroy']);router[_0x1436('0x16')](_0x1436('0xf'),auth['isAuthenticated'](),controller[_0x1436('0x17')]);router[_0x1436('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x1436('0x18')]);module[_0x1436('0x19')]=router; \ No newline at end of file +var _0xd673=['/:id/users','post','addAgents','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','/:id/teams'];(function(_0x24bd4d,_0x1558a8){var _0x3c0d4a=function(_0x41e15a){while(--_0x41e15a){_0x24bd4d['push'](_0x24bd4d['shift']());}};_0x3c0d4a(++_0x1558a8);}(_0xd673,0xb0));var _0x3d67=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd673[_0x4e676e];return _0x336a3c;};'use strict';var multer=require('multer');var util=require(_0x3d67('0x0'));var path=require(_0x3d67('0x1'));var timeout=require(_0x3d67('0x2'));var express=require(_0x3d67('0x3'));var router=express[_0x3d67('0x4')]();var auth=require(_0x3d67('0x5'));var interaction=require(_0x3d67('0x6'));var config=require('../../config/environment');var controller=require(_0x3d67('0x7'));router[_0x3d67('0x8')]('/',auth[_0x3d67('0x9')](),controller[_0x3d67('0xa')]);router[_0x3d67('0x8')](_0x3d67('0xb'),auth[_0x3d67('0x9')](),controller[_0x3d67('0xc')]);router[_0x3d67('0x8')](_0x3d67('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x3d67('0x8')](_0x3d67('0xe'),auth[_0x3d67('0x9')](),controller['getMembers']);router[_0x3d67('0x8')](_0x3d67('0xf'),auth[_0x3d67('0x9')](),controller['getTeams']);router[_0x3d67('0x8')](_0x3d67('0x10'),auth[_0x3d67('0x9')](),controller['getAgents']);router['post']('/',auth[_0x3d67('0x9')](),controller['create']);router[_0x3d67('0x11')](_0x3d67('0xf'),auth[_0x3d67('0x9')](),controller['addTeams']);router[_0x3d67('0x11')](_0x3d67('0x10'),auth[_0x3d67('0x9')](),controller[_0x3d67('0x12')]);router[_0x3d67('0x13')](_0x3d67('0xd'),auth[_0x3d67('0x9')](),controller[_0x3d67('0x14')]);router[_0x3d67('0x15')](_0x3d67('0xd'),auth[_0x3d67('0x9')](),controller[_0x3d67('0x16')]);router[_0x3d67('0x15')](_0x3d67('0xf'),auth[_0x3d67('0x9')](),controller['removeTeams']);router[_0x3d67('0x15')](_0x3d67('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x3d67('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b57fddd..44c42e7 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 _0xb241=['STRING','DATE','sequelize'];(function(_0x13dcc7,_0x279c9b){var _0x73dffb=function(_0x178df2){while(--_0x178df2){_0x13dcc7['push'](_0x13dcc7['shift']());}};_0x73dffb(++_0x279c9b);}(_0xb241,0xc2));var _0x1b24=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb241[_0x3e5086];return _0xfeb102;};'use strict';var moment=require('moment');var Sequelize=require(_0x1b24('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1b24('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1b24('0x2')]},'leaveAt':{'type':Sequelize[_0x1b24('0x2')]},'acceptAt':{'type':Sequelize[_0x1b24('0x2')]},'exitAt':{'type':Sequelize[_0x1b24('0x2')]},'reason':{'type':Sequelize[_0x1b24('0x1')]}}; \ No newline at end of file +var _0x029a=['STRING','DATE','moment'];(function(_0x23389c,_0x36ba6a){var _0x171ba0=function(_0x3f549b){while(--_0x3f549b){_0x23389c['push'](_0x23389c['shift']());}};_0x171ba0(++_0x36ba6a);}(_0x029a,0xc2));var _0xa029=function(_0x4334ce,_0x3c916c){_0x4334ce=_0x4334ce-0x0;var _0x5aa108=_0x029a[_0x4334ce];return _0x5aa108;};'use strict';var moment=require(_0xa029('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa029('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xa029('0x1')]},'joinAt':{'type':Sequelize[_0xa029('0x2')]},'leaveAt':{'type':Sequelize[_0xa029('0x2')]},'acceptAt':{'type':Sequelize[_0xa029('0x2')]},'exitAt':{'type':Sequelize[_0xa029('0x2')]},'reason':{'type':Sequelize[_0xa029('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 01a8484..17885a0 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 _0x862f=['intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','FaxQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','describe','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','rawAttributes','model','keys','query'];(function(_0x2fbb25,_0x3ffac1){var _0x9f32ad=function(_0x4922f2){while(--_0x4922f2){_0x2fbb25['push'](_0x2fbb25['shift']());}};_0x9f32ad(++_0x3ffac1);}(_0x862f,0x1db));var _0xf862=function(_0x3e0628,_0x511646){_0x3e0628=_0x3e0628-0x0;var _0x4e1918=_0x862f[_0x3e0628];return _0x4e1918;};'use strict';var pdf=require(_0xf862('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf862('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf862('0x2'));var rp=require(_0xf862('0x3'));var moment=require('moment');var BPromise=require(_0xf862('0x4'));var Mustache=require(_0xf862('0x5'));var util=require('util');var path=require(_0xf862('0x6'));var sox=require(_0xf862('0x7'));var csv=require(_0xf862('0x8'));var ejs=require(_0xf862('0x9'));var fs=require('fs');var _=require(_0xf862('0xa'));var squel=require(_0xf862('0xb'));var crypto=require(_0xf862('0xc'));var jsforce=require(_0xf862('0xd'));var deskjs=require(_0xf862('0xe'));var toCsv=require(_0xf862('0x8'));var querystring=require(_0xf862('0xf'));var Papa=require(_0xf862('0x10'));var Redis=require(_0xf862('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf862('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf862('0x13'))('api');var utils=require(_0xf862('0x14'));var config=require(_0xf862('0x15'));var db=require(_0xf862('0x16'))['db'];function respondWithStatusCode(_0x522a2b,_0x294217){_0x294217=_0x294217||0xcc;return function(_0x2fe3b9){if(_0x2fe3b9){return _0x522a2b[_0xf862('0x17')](_0x294217);}return _0x522a2b[_0xf862('0x18')](_0x294217)[_0xf862('0x19')]();};}function respondWithResult(_0x594f2c,_0x11e860){_0x11e860=_0x11e860||0xc8;return function(_0x4e3188){if(_0x4e3188){return _0x594f2c[_0xf862('0x18')](_0x11e860)[_0xf862('0x1a')](_0x4e3188);}};}function respondWithFilteredResult(_0x9b0f4d,_0x4e5e2b){return function(_0x263dc2){if(_0x263dc2){var _0x5ab613=_0x263dc2[_0xf862('0x1b')],_0x15b743=_0x4e5e2b[_0xf862('0x1c')],_0x5b0964=_0x4e5e2b[_0xf862('0x1c')]+_0x4e5e2b[_0xf862('0x1d')],_0x3ee3da;if(_0x5b0964>=_0x5ab613){_0x5b0964=_0x5ab613;_0x3ee3da=0xc8;}else{_0x3ee3da=0xce;}_0x9b0f4d[_0xf862('0x18')](_0x3ee3da);return _0x9b0f4d[_0xf862('0x1e')](_0xf862('0x1f'),_0x15b743+'-'+_0x5b0964+'/'+_0x5ab613)[_0xf862('0x1a')](_0x263dc2);}return null;};}function patchUpdates(_0xd4c6bc){return function(_0x1c2dd2){try{jsonpatch['apply'](_0x1c2dd2,_0xd4c6bc,!![]);}catch(_0x472753){return BPromise[_0xf862('0x20')](_0x472753);}return _0x1c2dd2[_0xf862('0x21')]();};}function saveUpdates(_0x2888af,_0xc3b079){return function(_0x2a554f){if(_0x2a554f){return _0x2a554f['update'](_0x2888af)[_0xf862('0x22')](function(_0x16e0d3){return _0x16e0d3;});}return null;};}function removeEntity(_0x13ef68,_0x54ecdc){return function(_0x694526){if(_0x694526){return _0x694526['destroy']()[_0xf862('0x22')](function(){_0x13ef68[_0xf862('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2698a0,_0x52b609){return function(_0x40ee2e){if(!_0x40ee2e){_0x2698a0[_0xf862('0x17')](0x194);}return _0x40ee2e;};}function handleError(_0x48b014,_0x22ff9a){_0x22ff9a=_0x22ff9a||0x1f4;return function(_0x488006){logger[_0xf862('0x23')](_0x488006[_0xf862('0x24')]);if(_0x488006['name']){delete _0x488006[_0xf862('0x25')];}_0x48b014[_0xf862('0x18')](_0x22ff9a)[_0xf862('0x26')](_0x488006);};}exports['index']=function(_0x3a4e0b,_0x16c018){var _0x49c81e={},_0x297797={},_0x5ad9a9={'count':0x0,'rows':[]};var _0x58e35b=db['FaxQueueReport'][_0xf862('0x27')];_0x297797[_0xf862('0x28')]=_[_0xf862('0x29')](_0x58e35b);_0x297797['query']=_[_0xf862('0x29')](_0x3a4e0b[_0xf862('0x2a')]);_0x297797['filters']=_[_0xf862('0x2b')](_0x297797[_0xf862('0x28')],_0x297797[_0xf862('0x2a')]);_0x49c81e[_0xf862('0x2c')]=_[_0xf862('0x2b')](_0x297797[_0xf862('0x28')],qs[_0xf862('0x2d')](_0x3a4e0b['query'][_0xf862('0x2d')]));_0x49c81e[_0xf862('0x2c')]=_0x49c81e[_0xf862('0x2c')][_0xf862('0x2e')]?_0x49c81e[_0xf862('0x2c')]:_0x297797[_0xf862('0x28')];if(!_0x3a4e0b['query']['hasOwnProperty'](_0xf862('0x2f'))){_0x49c81e[_0xf862('0x1d')]=qs[_0xf862('0x1d')](_0x3a4e0b[_0xf862('0x2a')][_0xf862('0x1d')]);_0x49c81e['offset']=qs[_0xf862('0x1c')](_0x3a4e0b['query']['offset']);}_0x49c81e[_0xf862('0x30')]=qs[_0xf862('0x31')](_0x3a4e0b[_0xf862('0x2a')]['sort']);_0x49c81e[_0xf862('0x32')]=qs[_0xf862('0x33')](_[_0xf862('0x34')](_0x3a4e0b[_0xf862('0x2a')],_0x297797['filters']));if(_0x3a4e0b[_0xf862('0x2a')][_0xf862('0x35')]){_0x49c81e[_0xf862('0x32')]=_[_0xf862('0x36')](_0x49c81e['where'],{'$or':_[_0xf862('0x37')](_0x58e35b,function(_0x50000a){if(_0x50000a[_0xf862('0x38')][_0xf862('0x39')]!==_0xf862('0x3a')){var _0x21c01b={};_0x21c01b[_0x50000a[_0xf862('0x3b')]]={'$like':'%'+_0x3a4e0b[_0xf862('0x2a')]['filter']+'%'};return _0x21c01b;}})});}_0x49c81e=_[_0xf862('0x36')]({},_0x49c81e,_0x3a4e0b[_0xf862('0x3c')]);var _0x14f9bf={'where':_0x49c81e[_0xf862('0x32')]};return db[_0xf862('0x3d')][_0xf862('0x1b')](_0x14f9bf)[_0xf862('0x22')](function(_0x3d8629){_0x5ad9a9[_0xf862('0x1b')]=_0x3d8629;if(_0x3a4e0b[_0xf862('0x2a')][_0xf862('0x3e')]){_0x49c81e[_0xf862('0x3f')]=[{'all':!![]}];}return db[_0xf862('0x3d')][_0xf862('0x40')](_0x49c81e);})[_0xf862('0x22')](function(_0x5df4a9){_0x5ad9a9[_0xf862('0x41')]=_0x5df4a9;return _0x5ad9a9;})['then'](respondWithFilteredResult(_0x16c018,_0x49c81e))[_0xf862('0x42')](handleError(_0x16c018,null));};exports['show']=function(_0x539a3a,_0x18b796){var _0x3a0b6c={'raw':!![],'where':{'id':_0x539a3a[_0xf862('0x43')]['id']}},_0x4ece54={};_0x4ece54[_0xf862('0x28')]=_['keys'](db['FaxQueueReport'][_0xf862('0x27')]);_0x4ece54[_0xf862('0x2a')]=_[_0xf862('0x29')](_0x539a3a['query']);_0x4ece54[_0xf862('0x33')]=_[_0xf862('0x2b')](_0x4ece54[_0xf862('0x28')],_0x4ece54[_0xf862('0x2a')]);_0x3a0b6c[_0xf862('0x2c')]=_[_0xf862('0x2b')](_0x4ece54[_0xf862('0x28')],qs[_0xf862('0x2d')](_0x539a3a[_0xf862('0x2a')][_0xf862('0x2d')]));_0x3a0b6c[_0xf862('0x2c')]=_0x3a0b6c['attributes'][_0xf862('0x2e')]?_0x3a0b6c[_0xf862('0x2c')]:_0x4ece54[_0xf862('0x28')];if(_0x539a3a[_0xf862('0x2a')][_0xf862('0x3e')]){_0x3a0b6c['include']=[{'all':!![]}];}_0x3a0b6c=_['merge']({},_0x3a0b6c,_0x539a3a['options']);return db[_0xf862('0x3d')][_0xf862('0x44')](_0x3a0b6c)[_0xf862('0x22')](handleEntityNotFound(_0x18b796,null))['then'](respondWithResult(_0x18b796,null))[_0xf862('0x42')](handleError(_0x18b796,null));};exports[_0xf862('0x45')]=function(_0x5ccf1b,_0x22c4da){return db[_0xf862('0x3d')]['create'](_0x5ccf1b[_0xf862('0x46')],{})[_0xf862('0x22')](respondWithResult(_0x22c4da,0xc9))[_0xf862('0x42')](handleError(_0x22c4da,null));};exports[_0xf862('0x47')]=function(_0x483efe,_0xf12915){if(_0x483efe[_0xf862('0x46')]['id']){delete _0x483efe['body']['id'];}return db[_0xf862('0x3d')]['find']({'where':{'id':_0x483efe[_0xf862('0x43')]['id']}})[_0xf862('0x22')](handleEntityNotFound(_0xf12915,null))[_0xf862('0x22')](saveUpdates(_0x483efe[_0xf862('0x46')],null))[_0xf862('0x22')](respondWithResult(_0xf12915,null))[_0xf862('0x42')](handleError(_0xf12915,null));};exports[_0xf862('0x48')]=function(_0x3c4003,_0x2532d1){return db['FaxQueueReport'][_0xf862('0x44')]({'where':{'id':_0x3c4003['params']['id']}})[_0xf862('0x22')](handleEntityNotFound(_0x2532d1,null))[_0xf862('0x22')](removeEntity(_0x2532d1,null))[_0xf862('0x42')](handleError(_0x2532d1,null));};exports['describe']=function(_0x38a583,_0x422e26){return db[_0xf862('0x3d')][_0xf862('0x49')]()[_0xf862('0x22')](respondWithResult(_0x422e26,null))[_0xf862('0x42')](handleError(_0x422e26,null));}; \ No newline at end of file +var _0x0090=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','name','send','index','FaxQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x515639,_0x29cd43){var _0x3a6be7=function(_0x277a13){while(--_0x277a13){_0x515639['push'](_0x515639['shift']());}};_0x3a6be7(++_0x29cd43);}(_0x0090,0x8e));var _0x0009=function(_0x3e973a,_0x2f2d37){_0x3e973a=_0x3e973a-0x0;var _0x3f65af=_0x0090[_0x3e973a];return _0x3f65af;};'use strict';var pdf=require(_0x0009('0x0'));var emlformat=require(_0x0009('0x1'));var rimraf=require(_0x0009('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0009('0x3'));var rp=require(_0x0009('0x4'));var moment=require(_0x0009('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0009('0x6'));var path=require(_0x0009('0x7'));var sox=require(_0x0009('0x8'));var csv=require(_0x0009('0x9'));var ejs=require(_0x0009('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0009('0xb'));var crypto=require(_0x0009('0xc'));var jsforce=require(_0x0009('0xd'));var deskjs=require(_0x0009('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0009('0xf'));var Papa=require(_0x0009('0x10'));var Redis=require(_0x0009('0x11'));var authService=require(_0x0009('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0009('0x13'));var logger=require(_0x0009('0x14'))(_0x0009('0x15'));var utils=require(_0x0009('0x16'));var config=require(_0x0009('0x17'));var db=require(_0x0009('0x18'))['db'];function respondWithStatusCode(_0x30c3bf,_0x314eac){_0x314eac=_0x314eac||0xcc;return function(_0xa0ef7a){if(_0xa0ef7a){return _0x30c3bf['sendStatus'](_0x314eac);}return _0x30c3bf[_0x0009('0x19')](_0x314eac)['end']();};}function respondWithResult(_0x397cac,_0x464048){_0x464048=_0x464048||0xc8;return function(_0x52c02f){if(_0x52c02f){return _0x397cac[_0x0009('0x19')](_0x464048)[_0x0009('0x1a')](_0x52c02f);}};}function respondWithFilteredResult(_0x306668,_0x4a2128){return function(_0x41c152){if(_0x41c152){var _0x4b38ce=_0x41c152[_0x0009('0x1b')],_0x17904e=_0x4a2128[_0x0009('0x1c')],_0x446bc8=_0x4a2128['offset']+_0x4a2128[_0x0009('0x1d')],_0x2ac356;if(_0x446bc8>=_0x4b38ce){_0x446bc8=_0x4b38ce;_0x2ac356=0xc8;}else{_0x2ac356=0xce;}_0x306668[_0x0009('0x19')](_0x2ac356);return _0x306668[_0x0009('0x1e')](_0x0009('0x1f'),_0x17904e+'-'+_0x446bc8+'/'+_0x4b38ce)[_0x0009('0x1a')](_0x41c152);}return null;};}function patchUpdates(_0x487c37){return function(_0x4af71d){try{jsonpatch[_0x0009('0x20')](_0x4af71d,_0x487c37,!![]);}catch(_0x45f062){return BPromise['reject'](_0x45f062);}return _0x4af71d[_0x0009('0x21')]();};}function saveUpdates(_0x41d904,_0x75b70b){return function(_0x2348fd){if(_0x2348fd){return _0x2348fd[_0x0009('0x22')](_0x41d904)[_0x0009('0x23')](function(_0x3482d7){return _0x3482d7;});}return null;};}function removeEntity(_0x16935d,_0x554492){return function(_0x121ae9){if(_0x121ae9){return _0x121ae9[_0x0009('0x24')]()[_0x0009('0x23')](function(){_0x16935d[_0x0009('0x19')](0xcc)[_0x0009('0x25')]();});}};}function handleEntityNotFound(_0x34f28d,_0x264bb9){return function(_0x4ff46e){if(!_0x4ff46e){_0x34f28d[_0x0009('0x26')](0x194);}return _0x4ff46e;};}function handleError(_0x4484d8,_0x552c6a){_0x552c6a=_0x552c6a||0x1f4;return function(_0x3a6132){logger[_0x0009('0x27')](_0x3a6132['stack']);if(_0x3a6132['name']){delete _0x3a6132[_0x0009('0x28')];}_0x4484d8[_0x0009('0x19')](_0x552c6a)[_0x0009('0x29')](_0x3a6132);};}exports[_0x0009('0x2a')]=function(_0x1ceb53,_0x4e97da){var _0x51a5bf={},_0x2fdbc3={},_0xa262f6={'count':0x0,'rows':[]};var _0x3f182c=db[_0x0009('0x2b')][_0x0009('0x2c')];_0x2fdbc3[_0x0009('0x2d')]=_[_0x0009('0x2e')](_0x3f182c);_0x2fdbc3['query']=_[_0x0009('0x2e')](_0x1ceb53[_0x0009('0x2f')]);_0x2fdbc3[_0x0009('0x30')]=_[_0x0009('0x31')](_0x2fdbc3[_0x0009('0x2d')],_0x2fdbc3['query']);_0x51a5bf[_0x0009('0x32')]=_['intersection'](_0x2fdbc3[_0x0009('0x2d')],qs['fields'](_0x1ceb53['query'][_0x0009('0x33')]));_0x51a5bf[_0x0009('0x32')]=_0x51a5bf['attributes'][_0x0009('0x34')]?_0x51a5bf['attributes']:_0x2fdbc3[_0x0009('0x2d')];if(!_0x1ceb53[_0x0009('0x2f')][_0x0009('0x35')](_0x0009('0x36'))){_0x51a5bf['limit']=qs[_0x0009('0x1d')](_0x1ceb53[_0x0009('0x2f')][_0x0009('0x1d')]);_0x51a5bf[_0x0009('0x1c')]=qs[_0x0009('0x1c')](_0x1ceb53['query'][_0x0009('0x1c')]);}_0x51a5bf['order']=qs['sort'](_0x1ceb53['query']['sort']);_0x51a5bf[_0x0009('0x37')]=qs[_0x0009('0x30')](_[_0x0009('0x38')](_0x1ceb53['query'],_0x2fdbc3[_0x0009('0x30')]));if(_0x1ceb53['query'][_0x0009('0x39')]){_0x51a5bf['where']=_[_0x0009('0x3a')](_0x51a5bf[_0x0009('0x37')],{'$or':_['map'](_0x3f182c,function(_0x2a7879){if(_0x2a7879[_0x0009('0x3b')][_0x0009('0x3c')]!==_0x0009('0x3d')){var _0x51ccf8={};_0x51ccf8[_0x2a7879[_0x0009('0x3e')]]={'$like':'%'+_0x1ceb53['query'][_0x0009('0x39')]+'%'};return _0x51ccf8;}})});}_0x51a5bf=_['merge']({},_0x51a5bf,_0x1ceb53[_0x0009('0x3f')]);var _0xd590e6={'where':_0x51a5bf['where']};return db[_0x0009('0x2b')]['count'](_0xd590e6)[_0x0009('0x23')](function(_0x279c03){_0xa262f6['count']=_0x279c03;if(_0x1ceb53[_0x0009('0x2f')][_0x0009('0x40')]){_0x51a5bf[_0x0009('0x41')]=[{'all':!![]}];}return db[_0x0009('0x2b')][_0x0009('0x42')](_0x51a5bf);})[_0x0009('0x23')](function(_0x442373){_0xa262f6['rows']=_0x442373;return _0xa262f6;})[_0x0009('0x23')](respondWithFilteredResult(_0x4e97da,_0x51a5bf))['catch'](handleError(_0x4e97da,null));};exports[_0x0009('0x43')]=function(_0x119094,_0x36bc52){var _0x3bca8a={'raw':!![],'where':{'id':_0x119094[_0x0009('0x44')]['id']}},_0x31e62a={};_0x31e62a[_0x0009('0x2d')]=_[_0x0009('0x2e')](db[_0x0009('0x2b')][_0x0009('0x2c')]);_0x31e62a[_0x0009('0x2f')]=_[_0x0009('0x2e')](_0x119094[_0x0009('0x2f')]);_0x31e62a['filters']=_[_0x0009('0x31')](_0x31e62a[_0x0009('0x2d')],_0x31e62a[_0x0009('0x2f')]);_0x3bca8a[_0x0009('0x32')]=_[_0x0009('0x31')](_0x31e62a['model'],qs[_0x0009('0x33')](_0x119094['query'][_0x0009('0x33')]));_0x3bca8a[_0x0009('0x32')]=_0x3bca8a['attributes'][_0x0009('0x34')]?_0x3bca8a[_0x0009('0x32')]:_0x31e62a[_0x0009('0x2d')];if(_0x119094[_0x0009('0x2f')][_0x0009('0x40')]){_0x3bca8a[_0x0009('0x41')]=[{'all':!![]}];}_0x3bca8a=_[_0x0009('0x3a')]({},_0x3bca8a,_0x119094['options']);return db['FaxQueueReport'][_0x0009('0x45')](_0x3bca8a)[_0x0009('0x23')](handleEntityNotFound(_0x36bc52,null))[_0x0009('0x23')](respondWithResult(_0x36bc52,null))[_0x0009('0x46')](handleError(_0x36bc52,null));};exports[_0x0009('0x47')]=function(_0x1e5b1b,_0x5007ff){return db[_0x0009('0x2b')]['create'](_0x1e5b1b[_0x0009('0x48')],{})[_0x0009('0x23')](respondWithResult(_0x5007ff,0xc9))['catch'](handleError(_0x5007ff,null));};exports[_0x0009('0x22')]=function(_0x1c858d,_0x4152c8){if(_0x1c858d['body']['id']){delete _0x1c858d['body']['id'];}return db['FaxQueueReport'][_0x0009('0x45')]({'where':{'id':_0x1c858d[_0x0009('0x44')]['id']}})[_0x0009('0x23')](handleEntityNotFound(_0x4152c8,null))[_0x0009('0x23')](saveUpdates(_0x1c858d[_0x0009('0x48')],null))[_0x0009('0x23')](respondWithResult(_0x4152c8,null))[_0x0009('0x46')](handleError(_0x4152c8,null));};exports['destroy']=function(_0x32aa32,_0x19c3a1){return db[_0x0009('0x2b')][_0x0009('0x45')]({'where':{'id':_0x32aa32[_0x0009('0x44')]['id']}})[_0x0009('0x23')](handleEntityNotFound(_0x19c3a1,null))[_0x0009('0x23')](removeEntity(_0x19c3a1,null))[_0x0009('0x46')](handleError(_0x19c3a1,null));};exports[_0x0009('0x49')]=function(_0x1bd849,_0x2f22df){return db[_0x0009('0x2b')][_0x0009('0x49')]()[_0x0009('0x23')](respondWithResult(_0x2f22df,null))[_0x0009('0x46')](handleError(_0x2f22df,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 678d75e..4e6e7af 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 _0x7f07=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','util'];(function(_0x4b2784,_0x3989a8){var _0x1cb6f5=function(_0x549f7e){while(--_0x549f7e){_0x4b2784['push'](_0x4b2784['shift']());}};_0x1cb6f5(++_0x3989a8);}(_0x7f07,0x1c6));var _0x77f0=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x7f07[_0x48326a];return _0x466709;};'use strict';var _=require('lodash');var util=require(_0x77f0('0x0'));var logger=require(_0x77f0('0x1'))(_0x77f0('0x2'));var moment=require('moment');var BPromise=require(_0x77f0('0x3'));var rp=require(_0x77f0('0x4'));var fs=require('fs');var path=require(_0x77f0('0x5'));var rimraf=require('rimraf');var config=require(_0x77f0('0x6'));var attributes=require(_0x77f0('0x7'));module[_0x77f0('0x8')]=function(_0x3439ae,_0x44cef7){return _0x3439ae[_0x77f0('0x9')](_0x77f0('0xa'),attributes,{'tableName':_0x77f0('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x77f0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf186=['../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x4ba276,_0x1e2180){var _0x579fc5=function(_0x5ad3a7){while(--_0x5ad3a7){_0x4ba276['push'](_0x4ba276['shift']());}};_0x579fc5(++_0x1e2180);}(_0xf186,0x1a9));var _0x6f18=function(_0x33cd22,_0x4caef7){_0x33cd22=_0x33cd22-0x0;var _0x344d6e=_0xf186[_0x33cd22];return _0x344d6e;};'use strict';var _=require(_0x6f18('0x0'));var util=require(_0x6f18('0x1'));var logger=require(_0x6f18('0x2'))(_0x6f18('0x3'));var moment=require('moment');var BPromise=require(_0x6f18('0x4'));var rp=require(_0x6f18('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f18('0x6'));var config=require(_0x6f18('0x7'));var attributes=require(_0x6f18('0x8'));module[_0x6f18('0x9')]=function(_0x52e38d,_0x2248d2){return _0x52e38d[_0x6f18('0xa')](_0x6f18('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index dc17607..796bb38 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 _0x60e1=['rpc','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueueReport','create','body','options','CreateFaxQueueReport','UpdateFaxQueueReport','raw','where','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x60e1,0x14c));var _0x160e=function(_0x5e48bf,_0x51e50e){_0x5e48bf=_0x5e48bf-0x0;var _0x3471a9=_0x60e1[_0x5e48bf];return _0x3471a9;};'use strict';var _=require(_0x160e('0x0'));var util=require('util');var moment=require(_0x160e('0x1'));var BPromise=require(_0x160e('0x2'));var rs=require(_0x160e('0x3'));var fs=require('fs');var Redis=require(_0x160e('0x4'));var db=require(_0x160e('0x5'))['db'];var utils=require(_0x160e('0x6'));var logger=require(_0x160e('0x7'))(_0x160e('0x8'));var config=require(_0x160e('0x9'));var jayson=require(_0x160e('0xa'));var client=jayson['client'][_0x160e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4da502,_0x3b58ca,_0x195a22){return new BPromise(function(_0xbc9baa,_0x5cc74f){return client[_0x160e('0xc')](_0x4da502,_0x195a22)[_0x160e('0xd')](function(_0x2b90da){logger[_0x160e('0xe')](_0x160e('0xf'),_0x3b58ca,_0x160e('0x10'));logger['debug'](_0x160e('0x11'),_0x3b58ca,_0x160e('0x10'),JSON[_0x160e('0x12')](_0x2b90da));if(_0x2b90da[_0x160e('0x13')]){if(_0x2b90da[_0x160e('0x13')][_0x160e('0x14')]===0x1f4){logger[_0x160e('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0x5cc74f(_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);}logger['error'](_0x160e('0xf'),_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0xbc9baa(_0x2b90da[_0x160e('0x13')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x3b58ca,'request\x20sent');_0xbc9baa(_0x2b90da[_0x160e('0x16')][_0x160e('0x15')]);}})[_0x160e('0x17')](function(_0x2a5ec5){logger[_0x160e('0x13')](_0x160e('0xf'),_0x3b58ca,_0x2a5ec5);_0x5cc74f(_0x2a5ec5);});});}exports['CreateFaxQueueReport']=function(_0x37d722){var _0x1edeff=this;return new Promise(function(_0x5c7bde,_0x38561b){return db[_0x160e('0x18')][_0x160e('0x19')](_0x37d722[_0x160e('0x1a')],{'raw':_0x37d722[_0x160e('0x1b')]?_0x37d722[_0x160e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x160e('0xd')](function(_0x4ca9d4){logger[_0x160e('0xe')](_0x160e('0x1c'),_0x37d722);logger['debug'](_0x160e('0x1c'),_0x37d722,JSON['stringify'](_0x4ca9d4));_0x5c7bde(_0x4ca9d4);})[_0x160e('0x17')](function(_0x4d1047){logger[_0x160e('0x13')]('CreateFaxQueueReport',_0x4d1047[_0x160e('0x15')],_0x37d722);_0x38561b(_0x1edeff[_0x160e('0x13')](0x1f4,_0x4d1047['message']));});});};exports[_0x160e('0x1d')]=function(_0x48aed9){var _0x2aaa6f=this;return new Promise(function(_0x5180bc,_0x228754){return db['FaxQueueReport']['update'](_0x48aed9[_0x160e('0x1a')],{'raw':_0x48aed9[_0x160e('0x1b')]?_0x48aed9[_0x160e('0x1b')][_0x160e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48aed9[_0x160e('0x1b')]?_0x48aed9[_0x160e('0x1b')][_0x160e('0x1f')]||null:null,'attributes':_0x48aed9[_0x160e('0x1b')]?_0x48aed9[_0x160e('0x1b')][_0x160e('0x20')]||null:null,'limit':_0x48aed9[_0x160e('0x1b')]?_0x48aed9[_0x160e('0x1b')]['limit']||null:null})[_0x160e('0xd')](function(_0x4ac531){logger[_0x160e('0xe')](_0x160e('0x1d'),_0x48aed9);logger[_0x160e('0x21')](_0x160e('0x1d'),_0x48aed9,JSON[_0x160e('0x12')](_0x4ac531));_0x5180bc(_0x4ac531);})[_0x160e('0x17')](function(_0x373e9e){logger[_0x160e('0x13')](_0x160e('0x1d'),_0x373e9e[_0x160e('0x15')],_0x48aed9);_0x228754(_0x2aaa6f[_0x160e('0x13')](0x1f4,_0x373e9e[_0x160e('0x15')]));});});}; \ No newline at end of file +var _0x69d3=['options','raw','then','CreateFaxQueueReport','UpdateFaxQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxQueueReport','body'];(function(_0x10c958,_0x1d6e2e){var _0xb2f284=function(_0x34fba3){while(--_0x34fba3){_0x10c958['push'](_0x10c958['shift']());}};_0xb2f284(++_0x1d6e2e);}(_0x69d3,0xda));var _0x369d=function(_0x54add9,_0x308e6d){_0x54add9=_0x54add9-0x0;var _0x150b7f=_0x69d3[_0x54add9];return _0x150b7f;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var moment=require(_0x369d('0x2'));var BPromise=require('bluebird');var rs=require(_0x369d('0x3'));var fs=require('fs');var Redis=require(_0x369d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x369d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x369d('0x6'));var client=jayson[_0x369d('0x7')][_0x369d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x424d8c,_0x1bd94c,_0x186302){return new BPromise(function(_0x3adb26,_0x2ac0ec){return client[_0x369d('0x9')](_0x424d8c,_0x186302)['then'](function(_0x5d2ded){logger[_0x369d('0xa')](_0x369d('0xb'),_0x1bd94c,_0x369d('0xc'));logger[_0x369d('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1bd94c,'request\x20sent',JSON[_0x369d('0xe')](_0x5d2ded));if(_0x5d2ded[_0x369d('0xf')]){if(_0x5d2ded[_0x369d('0xf')][_0x369d('0x10')]===0x1f4){logger[_0x369d('0xf')](_0x369d('0xb'),_0x1bd94c,_0x5d2ded['error'][_0x369d('0x11')]);return _0x2ac0ec(_0x5d2ded[_0x369d('0xf')][_0x369d('0x11')]);}logger[_0x369d('0xf')](_0x369d('0xb'),_0x1bd94c,_0x5d2ded['error']['message']);return _0x3adb26(_0x5d2ded['error'][_0x369d('0x11')]);}else{logger[_0x369d('0xa')](_0x369d('0xb'),_0x1bd94c,'request\x20sent');_0x3adb26(_0x5d2ded[_0x369d('0x12')][_0x369d('0x11')]);}})[_0x369d('0x13')](function(_0x4e234e){logger[_0x369d('0xf')](_0x369d('0xb'),_0x1bd94c,_0x4e234e);_0x2ac0ec(_0x4e234e);});});}exports['CreateFaxQueueReport']=function(_0x572513){var _0x597b67=this;return new Promise(function(_0x2946be,_0x4494b3){return db[_0x369d('0x14')]['create'](_0x572513[_0x369d('0x15')],{'raw':_0x572513[_0x369d('0x16')]?_0x572513[_0x369d('0x16')][_0x369d('0x17')]===undefined?!![]:![]:!![]})[_0x369d('0x18')](function(_0x538ca4){logger[_0x369d('0xa')](_0x369d('0x19'),_0x572513);logger[_0x369d('0xd')](_0x369d('0x19'),_0x572513,JSON[_0x369d('0xe')](_0x538ca4));_0x2946be(_0x538ca4);})[_0x369d('0x13')](function(_0x15fbef){logger[_0x369d('0xf')]('CreateFaxQueueReport',_0x15fbef['message'],_0x572513);_0x4494b3(_0x597b67[_0x369d('0xf')](0x1f4,_0x15fbef[_0x369d('0x11')]));});});};exports[_0x369d('0x1a')]=function(_0xcae58){var _0x30e7c5=this;return new Promise(function(_0x38f0b8,_0x36cf04){return db['FaxQueueReport']['update'](_0xcae58[_0x369d('0x15')],{'raw':_0xcae58[_0x369d('0x16')]?_0xcae58[_0x369d('0x16')][_0x369d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcae58[_0x369d('0x16')]?_0xcae58[_0x369d('0x16')][_0x369d('0x1b')]||null:null,'attributes':_0xcae58['options']?_0xcae58[_0x369d('0x16')][_0x369d('0x1c')]||null:null,'limit':_0xcae58[_0x369d('0x16')]?_0xcae58[_0x369d('0x16')][_0x369d('0x1d')]||null:null})[_0x369d('0x18')](function(_0x3d1ce0){logger['info'](_0x369d('0x1a'),_0xcae58);logger['debug']('UpdateFaxQueueReport',_0xcae58,JSON[_0x369d('0xe')](_0x3d1ce0));_0x38f0b8(_0x3d1ce0);})[_0x369d('0x13')](function(_0x5844c7){logger[_0x369d('0xf')]('UpdateFaxQueueReport',_0x5844c7[_0x369d('0x11')],_0xcae58);_0x36cf04(_0x30e7c5[_0x369d('0xf')](0x1f4,_0x5844c7[_0x369d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 057a1f9..7733eaa 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 _0xf7f7=['create','/:id','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7f7,0x1b3));var _0x7f7f=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xf7f7[_0x4cbf20];return _0x582ae4;};'use strict';var multer=require(_0x7f7f('0x0'));var util=require(_0x7f7f('0x1'));var path=require(_0x7f7f('0x2'));var timeout=require(_0x7f7f('0x3'));var express=require(_0x7f7f('0x4'));var router=express['Router']();var auth=require(_0x7f7f('0x5'));var interaction=require(_0x7f7f('0x6'));var config=require(_0x7f7f('0x7'));var controller=require(_0x7f7f('0x8'));router[_0x7f7f('0x9')]('/',auth[_0x7f7f('0xa')](),controller[_0x7f7f('0xb')]);router['get'](_0x7f7f('0xc'),auth[_0x7f7f('0xa')](),controller['describe']);router['get']('/:id',auth[_0x7f7f('0xa')](),controller[_0x7f7f('0xd')]);router[_0x7f7f('0xe')]('/',auth[_0x7f7f('0xa')](),controller[_0x7f7f('0xf')]);router['put'](_0x7f7f('0x10'),auth[_0x7f7f('0xa')](),controller['update']);router[_0x7f7f('0x11')](_0x7f7f('0x10'),auth[_0x7f7f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0516=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x28a102,_0x42348d){var _0x11c277=function(_0x43ea6e){while(--_0x43ea6e){_0x28a102['push'](_0x28a102['shift']());}};_0x11c277(++_0x42348d);}(_0x0516,0x10f));var _0x6051=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0x0516[_0x47c5bf];return _0x11b779;};'use strict';var multer=require(_0x6051('0x0'));var util=require(_0x6051('0x1'));var path=require(_0x6051('0x2'));var timeout=require(_0x6051('0x3'));var express=require(_0x6051('0x4'));var router=express[_0x6051('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6051('0x6'));var config=require(_0x6051('0x7'));var controller=require(_0x6051('0x8'));router['get']('/',auth[_0x6051('0x9')](),controller[_0x6051('0xa')]);router[_0x6051('0xb')](_0x6051('0xc'),auth['isAuthenticated'](),controller[_0x6051('0xd')]);router[_0x6051('0xb')](_0x6051('0xe'),auth[_0x6051('0x9')](),controller['show']);router[_0x6051('0xf')]('/',auth[_0x6051('0x9')](),controller[_0x6051('0x10')]);router[_0x6051('0x11')](_0x6051('0xe'),auth['isAuthenticated'](),controller[_0x6051('0x12')]);router[_0x6051('0x13')](_0x6051('0xe'),auth[_0x6051('0x9')](),controller[_0x6051('0x14')]);module[_0x6051('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 3b872c6..0c6a64d 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 _0x67a4=['account','agent','queue','DATE','moment','sequelize','exports','ENUM'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x67a4,0x194));var _0x467a=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x67a4[_0x513aa5];return _0x1a1a7c;};'use strict';var moment=require(_0x467a('0x0'));var Sequelize=require(_0x467a('0x1'));module[_0x467a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x467a('0x3')](_0x467a('0x4'),_0x467a('0x5'),_0x467a('0x6')),'allowNull':![],'defaultValue':_0x467a('0x6')},'transferredAt':{'type':Sequelize[_0x467a('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa06b=['NOW','moment','sequelize','exports','STRING','account','queue','DATE'];(function(_0x3035b5,_0x2295ef){var _0x4a8bf5=function(_0x2e8ff6){while(--_0x2e8ff6){_0x3035b5['push'](_0x3035b5['shift']());}};_0x4a8bf5(++_0x2295ef);}(_0xa06b,0x1e9));var _0xba06=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa06b[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0xba06('0x0'));var Sequelize=require(_0xba06('0x1'));module[_0xba06('0x2')]={'uniqueid':{'type':Sequelize[_0xba06('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xba06('0x4'),'agent',_0xba06('0x5')),'allowNull':![],'defaultValue':_0xba06('0x5')},'transferredAt':{'type':Sequelize[_0xba06('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xba06('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index b237f27..8726c72 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 _0x4fca=['sox','to-csv','ejs','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','name','send','index','FaxTransferReport','rawAttributes','keys','query','filters','intersection','model','attributes','nolimit','sort','filter','merge','where','map','key','VIRTUAL','includeAll','include','findAll','rows','show','params','fields','length','options','find','create','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x7d1b29,_0x3fb6ae){var _0x53981b=function(_0x1ff33a){while(--_0x1ff33a){_0x7d1b29['push'](_0x7d1b29['shift']());}};_0x53981b(++_0x3fb6ae);}(_0x4fca,0x1ce));var _0xa4fc=function(_0x1ffab2,_0x515575){_0x1ffab2=_0x1ffab2-0x0;var _0x8a16ca=_0x4fca[_0x1ffab2];return _0x8a16ca;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa4fc('0x0'));var rimraf=require(_0xa4fc('0x1'));var zipdir=require(_0xa4fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4fc('0x3'));var moment=require('moment');var BPromise=require(_0xa4fc('0x4'));var Mustache=require(_0xa4fc('0x5'));var util=require(_0xa4fc('0x6'));var path=require('path');var sox=require(_0xa4fc('0x7'));var csv=require(_0xa4fc('0x8'));var ejs=require(_0xa4fc('0x9'));var fs=require('fs');var _=require(_0xa4fc('0xa'));var squel=require('squel');var crypto=require(_0xa4fc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa4fc('0x8'));var querystring=require(_0xa4fc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa4fc('0xd'));var qs=require(_0xa4fc('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4fc('0xf'))(_0xa4fc('0x10'));var utils=require(_0xa4fc('0x11'));var config=require(_0xa4fc('0x12'));var db=require(_0xa4fc('0x13'))['db'];function respondWithStatusCode(_0x304cc8,_0x2a1a94){_0x2a1a94=_0x2a1a94||0xcc;return function(_0x5ece60){if(_0x5ece60){return _0x304cc8[_0xa4fc('0x14')](_0x2a1a94);}return _0x304cc8[_0xa4fc('0x15')](_0x2a1a94)[_0xa4fc('0x16')]();};}function respondWithResult(_0x25c9be,_0x4aeff3){_0x4aeff3=_0x4aeff3||0xc8;return function(_0x4d4b95){if(_0x4d4b95){return _0x25c9be[_0xa4fc('0x15')](_0x4aeff3)[_0xa4fc('0x17')](_0x4d4b95);}};}function respondWithFilteredResult(_0x3b8d67,_0x169b09){return function(_0xfe4736){if(_0xfe4736){var _0x209ca9=_0xfe4736[_0xa4fc('0x18')],_0x1cbab8=_0x169b09[_0xa4fc('0x19')],_0xdc0100=_0x169b09['offset']+_0x169b09[_0xa4fc('0x1a')],_0x483e12;if(_0xdc0100>=_0x209ca9){_0xdc0100=_0x209ca9;_0x483e12=0xc8;}else{_0x483e12=0xce;}_0x3b8d67[_0xa4fc('0x15')](_0x483e12);return _0x3b8d67[_0xa4fc('0x1b')](_0xa4fc('0x1c'),_0x1cbab8+'-'+_0xdc0100+'/'+_0x209ca9)[_0xa4fc('0x17')](_0xfe4736);}return null;};}function patchUpdates(_0x49987e){return function(_0x503126){try{jsonpatch[_0xa4fc('0x1d')](_0x503126,_0x49987e,!![]);}catch(_0x1e27b6){return BPromise['reject'](_0x1e27b6);}return _0x503126[_0xa4fc('0x1e')]();};}function saveUpdates(_0x203070,_0x372ac1){return function(_0x460230){if(_0x460230){return _0x460230[_0xa4fc('0x1f')](_0x203070)[_0xa4fc('0x20')](function(_0x3376fe){return _0x3376fe;});}return null;};}function removeEntity(_0x342420,_0x50def9){return function(_0x415b33){if(_0x415b33){return _0x415b33['destroy']()[_0xa4fc('0x20')](function(){_0x342420[_0xa4fc('0x15')](0xcc)[_0xa4fc('0x16')]();});}};}function handleEntityNotFound(_0x30ba44,_0x3f8861){return function(_0x2f45a6){if(!_0x2f45a6){_0x30ba44[_0xa4fc('0x14')](0x194);}return _0x2f45a6;};}function handleError(_0x97dca0,_0x492264){_0x492264=_0x492264||0x1f4;return function(_0x10f926){logger[_0xa4fc('0x21')](_0x10f926['stack']);if(_0x10f926[_0xa4fc('0x22')]){delete _0x10f926[_0xa4fc('0x22')];}_0x97dca0[_0xa4fc('0x15')](_0x492264)[_0xa4fc('0x23')](_0x10f926);};}exports[_0xa4fc('0x24')]=function(_0x4ab134,_0xb32944){var _0x25a4f4={},_0x3603a0={},_0x4f2df4={'count':0x0,'rows':[]};var _0x5cc964=db[_0xa4fc('0x25')][_0xa4fc('0x26')];_0x3603a0['model']=_[_0xa4fc('0x27')](_0x5cc964);_0x3603a0[_0xa4fc('0x28')]=_['keys'](_0x4ab134[_0xa4fc('0x28')]);_0x3603a0[_0xa4fc('0x29')]=_[_0xa4fc('0x2a')](_0x3603a0[_0xa4fc('0x2b')],_0x3603a0[_0xa4fc('0x28')]);_0x25a4f4[_0xa4fc('0x2c')]=_['intersection'](_0x3603a0['model'],qs['fields'](_0x4ab134[_0xa4fc('0x28')]['fields']));_0x25a4f4['attributes']=_0x25a4f4[_0xa4fc('0x2c')]['length']?_0x25a4f4['attributes']:_0x3603a0[_0xa4fc('0x2b')];if(!_0x4ab134[_0xa4fc('0x28')]['hasOwnProperty'](_0xa4fc('0x2d'))){_0x25a4f4[_0xa4fc('0x1a')]=qs[_0xa4fc('0x1a')](_0x4ab134[_0xa4fc('0x28')][_0xa4fc('0x1a')]);_0x25a4f4['offset']=qs[_0xa4fc('0x19')](_0x4ab134[_0xa4fc('0x28')][_0xa4fc('0x19')]);}_0x25a4f4['order']=qs[_0xa4fc('0x2e')](_0x4ab134[_0xa4fc('0x28')]['sort']);_0x25a4f4['where']=qs[_0xa4fc('0x29')](_['pick'](_0x4ab134[_0xa4fc('0x28')],_0x3603a0[_0xa4fc('0x29')]));if(_0x4ab134['query'][_0xa4fc('0x2f')]){_0x25a4f4['where']=_[_0xa4fc('0x30')](_0x25a4f4[_0xa4fc('0x31')],{'$or':_[_0xa4fc('0x32')](_0x5cc964,function(_0xedf2c5){if(_0xedf2c5['type'][_0xa4fc('0x33')]!==_0xa4fc('0x34')){var _0xb2170a={};_0xb2170a[_0xedf2c5['field']]={'$like':'%'+_0x4ab134[_0xa4fc('0x28')][_0xa4fc('0x2f')]+'%'};return _0xb2170a;}})});}_0x25a4f4=_[_0xa4fc('0x30')]({},_0x25a4f4,_0x4ab134['options']);var _0x1702fe={'where':_0x25a4f4[_0xa4fc('0x31')]};return db[_0xa4fc('0x25')][_0xa4fc('0x18')](_0x1702fe)['then'](function(_0x3173be){_0x4f2df4[_0xa4fc('0x18')]=_0x3173be;if(_0x4ab134[_0xa4fc('0x28')][_0xa4fc('0x35')]){_0x25a4f4[_0xa4fc('0x36')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xa4fc('0x37')](_0x25a4f4);})[_0xa4fc('0x20')](function(_0x434023){_0x4f2df4[_0xa4fc('0x38')]=_0x434023;return _0x4f2df4;})[_0xa4fc('0x20')](respondWithFilteredResult(_0xb32944,_0x25a4f4))['catch'](handleError(_0xb32944,null));};exports[_0xa4fc('0x39')]=function(_0xce285e,_0xe831ad){var _0x6244d4={'raw':!![],'where':{'id':_0xce285e[_0xa4fc('0x3a')]['id']}},_0x415d6c={};_0x415d6c[_0xa4fc('0x2b')]=_[_0xa4fc('0x27')](db[_0xa4fc('0x25')][_0xa4fc('0x26')]);_0x415d6c['query']=_[_0xa4fc('0x27')](_0xce285e['query']);_0x415d6c[_0xa4fc('0x29')]=_[_0xa4fc('0x2a')](_0x415d6c[_0xa4fc('0x2b')],_0x415d6c[_0xa4fc('0x28')]);_0x6244d4[_0xa4fc('0x2c')]=_[_0xa4fc('0x2a')](_0x415d6c[_0xa4fc('0x2b')],qs[_0xa4fc('0x3b')](_0xce285e['query']['fields']));_0x6244d4[_0xa4fc('0x2c')]=_0x6244d4[_0xa4fc('0x2c')][_0xa4fc('0x3c')]?_0x6244d4[_0xa4fc('0x2c')]:_0x415d6c[_0xa4fc('0x2b')];if(_0xce285e[_0xa4fc('0x28')][_0xa4fc('0x35')]){_0x6244d4[_0xa4fc('0x36')]=[{'all':!![]}];}_0x6244d4=_[_0xa4fc('0x30')]({},_0x6244d4,_0xce285e[_0xa4fc('0x3d')]);return db[_0xa4fc('0x25')][_0xa4fc('0x3e')](_0x6244d4)['then'](handleEntityNotFound(_0xe831ad,null))[_0xa4fc('0x20')](respondWithResult(_0xe831ad,null))['catch'](handleError(_0xe831ad,null));};exports['create']=function(_0x203766,_0x3f395d){return db[_0xa4fc('0x25')][_0xa4fc('0x3f')](_0x203766[_0xa4fc('0x40')],{})[_0xa4fc('0x20')](respondWithResult(_0x3f395d,0xc9))[_0xa4fc('0x41')](handleError(_0x3f395d,null));};exports['update']=function(_0xba3521,_0x40fa95){if(_0xba3521[_0xa4fc('0x40')]['id']){delete _0xba3521[_0xa4fc('0x40')]['id'];}return db[_0xa4fc('0x25')][_0xa4fc('0x3e')]({'where':{'id':_0xba3521[_0xa4fc('0x3a')]['id']}})[_0xa4fc('0x20')](handleEntityNotFound(_0x40fa95,null))[_0xa4fc('0x20')](saveUpdates(_0xba3521[_0xa4fc('0x40')],null))[_0xa4fc('0x20')](respondWithResult(_0x40fa95,null))[_0xa4fc('0x41')](handleError(_0x40fa95,null));};exports[_0xa4fc('0x42')]=function(_0x510e79,_0x2d2500){return db['FaxTransferReport']['find']({'where':{'id':_0x510e79['params']['id']}})[_0xa4fc('0x20')](handleEntityNotFound(_0x2d2500,null))['then'](removeEntity(_0x2d2500,null))['catch'](handleError(_0x2d2500,null));};exports['describe']=function(_0x5c5253,_0x120152){return db[_0xa4fc('0x25')]['describe']()[_0xa4fc('0x20')](respondWithResult(_0x120152,null))[_0xa4fc('0x41')](handleError(_0x120152,null));}; \ No newline at end of file +var _0x4c0c=['order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','reject','then','destroy','end','error','stack','name','send','FaxTransferReport','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit'];(function(_0x1ca93c,_0x3271ab){var _0x185169=function(_0x507763){while(--_0x507763){_0x1ca93c['push'](_0x1ca93c['shift']());}};_0x185169(++_0x3271ab);}(_0x4c0c,0x181));var _0xc4c0=function(_0x4cb660,_0x5cebf6){_0x4cb660=_0x4cb660-0x0;var _0x59cbba=_0x4c0c[_0x4cb660];return _0x59cbba;};'use strict';var pdf=require(_0xc4c0('0x0'));var emlformat=require(_0xc4c0('0x1'));var rimraf=require(_0xc4c0('0x2'));var zipdir=require(_0xc4c0('0x3'));var jsonpatch=require(_0xc4c0('0x4'));var rp=require(_0xc4c0('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc4c0('0x6'));var path=require('path');var sox=require(_0xc4c0('0x7'));var csv=require(_0xc4c0('0x8'));var ejs=require(_0xc4c0('0x9'));var fs=require('fs');var _=require(_0xc4c0('0xa'));var squel=require(_0xc4c0('0xb'));var crypto=require('crypto');var jsforce=require(_0xc4c0('0xc'));var deskjs=require(_0xc4c0('0xd'));var toCsv=require(_0xc4c0('0x8'));var querystring=require(_0xc4c0('0xe'));var Papa=require(_0xc4c0('0xf'));var Redis=require(_0xc4c0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc4c0('0x11'));var hardwareService=require(_0xc4c0('0x12'));var logger=require('../../config/logger')(_0xc4c0('0x13'));var utils=require('../../config/utils');var config=require(_0xc4c0('0x14'));var db=require(_0xc4c0('0x15'))['db'];function respondWithStatusCode(_0x4feb7b,_0x5943c2){_0x5943c2=_0x5943c2||0xcc;return function(_0x55eb77){if(_0x55eb77){return _0x4feb7b[_0xc4c0('0x16')](_0x5943c2);}return _0x4feb7b[_0xc4c0('0x17')](_0x5943c2)['end']();};}function respondWithResult(_0x4dada8,_0x53ba91){_0x53ba91=_0x53ba91||0xc8;return function(_0x53f365){if(_0x53f365){return _0x4dada8[_0xc4c0('0x17')](_0x53ba91)['json'](_0x53f365);}};}function respondWithFilteredResult(_0x1db974,_0x5dcc34){return function(_0x33da8e){if(_0x33da8e){var _0x4f0ee9=_0x33da8e['count'],_0x42b69b=_0x5dcc34[_0xc4c0('0x18')],_0x3a4144=_0x5dcc34['offset']+_0x5dcc34[_0xc4c0('0x19')],_0x46c217;if(_0x3a4144>=_0x4f0ee9){_0x3a4144=_0x4f0ee9;_0x46c217=0xc8;}else{_0x46c217=0xce;}_0x1db974['status'](_0x46c217);return _0x1db974[_0xc4c0('0x1a')](_0xc4c0('0x1b'),_0x42b69b+'-'+_0x3a4144+'/'+_0x4f0ee9)[_0xc4c0('0x1c')](_0x33da8e);}return null;};}function patchUpdates(_0x35eb30){return function(_0x4d8bbd){try{jsonpatch['apply'](_0x4d8bbd,_0x35eb30,!![]);}catch(_0x401644){return BPromise[_0xc4c0('0x1d')](_0x401644);}return _0x4d8bbd['save']();};}function saveUpdates(_0x377bf7,_0x26ffbc){return function(_0x2f080f){if(_0x2f080f){return _0x2f080f['update'](_0x377bf7)[_0xc4c0('0x1e')](function(_0x412400){return _0x412400;});}return null;};}function removeEntity(_0x1cd539,_0x526a28){return function(_0x460981){if(_0x460981){return _0x460981[_0xc4c0('0x1f')]()[_0xc4c0('0x1e')](function(){_0x1cd539[_0xc4c0('0x17')](0xcc)[_0xc4c0('0x20')]();});}};}function handleEntityNotFound(_0x27628d,_0x564112){return function(_0x561b97){if(!_0x561b97){_0x27628d[_0xc4c0('0x16')](0x194);}return _0x561b97;};}function handleError(_0x209640,_0x20fb52){_0x20fb52=_0x20fb52||0x1f4;return function(_0x9e4d51){logger[_0xc4c0('0x21')](_0x9e4d51[_0xc4c0('0x22')]);if(_0x9e4d51[_0xc4c0('0x23')]){delete _0x9e4d51['name'];}_0x209640[_0xc4c0('0x17')](_0x20fb52)[_0xc4c0('0x24')](_0x9e4d51);};}exports['index']=function(_0x2e1ab8,_0x4f83fb){var _0x62e994={},_0x18029e={},_0x2af1f5={'count':0x0,'rows':[]};var _0x8e267d=db[_0xc4c0('0x25')][_0xc4c0('0x26')];_0x18029e[_0xc4c0('0x27')]=_[_0xc4c0('0x28')](_0x8e267d);_0x18029e[_0xc4c0('0x29')]=_[_0xc4c0('0x28')](_0x2e1ab8['query']);_0x18029e['filters']=_['intersection'](_0x18029e[_0xc4c0('0x27')],_0x18029e[_0xc4c0('0x29')]);_0x62e994[_0xc4c0('0x2a')]=_[_0xc4c0('0x2b')](_0x18029e['model'],qs[_0xc4c0('0x2c')](_0x2e1ab8[_0xc4c0('0x29')][_0xc4c0('0x2c')]));_0x62e994['attributes']=_0x62e994['attributes']['length']?_0x62e994['attributes']:_0x18029e[_0xc4c0('0x27')];if(!_0x2e1ab8[_0xc4c0('0x29')][_0xc4c0('0x2d')](_0xc4c0('0x2e'))){_0x62e994[_0xc4c0('0x19')]=qs[_0xc4c0('0x19')](_0x2e1ab8['query']['limit']);_0x62e994[_0xc4c0('0x18')]=qs[_0xc4c0('0x18')](_0x2e1ab8[_0xc4c0('0x29')][_0xc4c0('0x18')]);}_0x62e994[_0xc4c0('0x2f')]=qs['sort'](_0x2e1ab8[_0xc4c0('0x29')][_0xc4c0('0x30')]);_0x62e994[_0xc4c0('0x31')]=qs[_0xc4c0('0x32')](_[_0xc4c0('0x33')](_0x2e1ab8[_0xc4c0('0x29')],_0x18029e[_0xc4c0('0x32')]));if(_0x2e1ab8[_0xc4c0('0x29')][_0xc4c0('0x34')]){_0x62e994[_0xc4c0('0x31')]=_[_0xc4c0('0x35')](_0x62e994[_0xc4c0('0x31')],{'$or':_[_0xc4c0('0x36')](_0x8e267d,function(_0x3c2396){if(_0x3c2396['type'][_0xc4c0('0x37')]!==_0xc4c0('0x38')){var _0x3b181a={};_0x3b181a[_0x3c2396[_0xc4c0('0x39')]]={'$like':'%'+_0x2e1ab8[_0xc4c0('0x29')]['filter']+'%'};return _0x3b181a;}})});}_0x62e994=_['merge']({},_0x62e994,_0x2e1ab8[_0xc4c0('0x3a')]);var _0xbc9e2f={'where':_0x62e994[_0xc4c0('0x31')]};return db[_0xc4c0('0x25')]['count'](_0xbc9e2f)[_0xc4c0('0x1e')](function(_0x47cf34){_0x2af1f5[_0xc4c0('0x3b')]=_0x47cf34;if(_0x2e1ab8[_0xc4c0('0x29')][_0xc4c0('0x3c')]){_0x62e994[_0xc4c0('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xc4c0('0x3e')](_0x62e994);})[_0xc4c0('0x1e')](function(_0x763dd7){_0x2af1f5[_0xc4c0('0x3f')]=_0x763dd7;return _0x2af1f5;})[_0xc4c0('0x1e')](respondWithFilteredResult(_0x4f83fb,_0x62e994))[_0xc4c0('0x40')](handleError(_0x4f83fb,null));};exports[_0xc4c0('0x41')]=function(_0x584662,_0x18e56e){var _0x435464={'raw':!![],'where':{'id':_0x584662[_0xc4c0('0x42')]['id']}},_0x4f8d2f={};_0x4f8d2f['model']=_[_0xc4c0('0x28')](db[_0xc4c0('0x25')][_0xc4c0('0x26')]);_0x4f8d2f[_0xc4c0('0x29')]=_[_0xc4c0('0x28')](_0x584662[_0xc4c0('0x29')]);_0x4f8d2f[_0xc4c0('0x32')]=_[_0xc4c0('0x2b')](_0x4f8d2f[_0xc4c0('0x27')],_0x4f8d2f[_0xc4c0('0x29')]);_0x435464['attributes']=_['intersection'](_0x4f8d2f[_0xc4c0('0x27')],qs[_0xc4c0('0x2c')](_0x584662[_0xc4c0('0x29')][_0xc4c0('0x2c')]));_0x435464['attributes']=_0x435464['attributes'][_0xc4c0('0x43')]?_0x435464['attributes']:_0x4f8d2f['model'];if(_0x584662[_0xc4c0('0x29')][_0xc4c0('0x3c')]){_0x435464[_0xc4c0('0x3d')]=[{'all':!![]}];}_0x435464=_[_0xc4c0('0x35')]({},_0x435464,_0x584662[_0xc4c0('0x3a')]);return db[_0xc4c0('0x25')]['find'](_0x435464)[_0xc4c0('0x1e')](handleEntityNotFound(_0x18e56e,null))[_0xc4c0('0x1e')](respondWithResult(_0x18e56e,null))[_0xc4c0('0x40')](handleError(_0x18e56e,null));};exports[_0xc4c0('0x44')]=function(_0x4594ec,_0x57369a){return db[_0xc4c0('0x25')]['create'](_0x4594ec[_0xc4c0('0x45')],{})[_0xc4c0('0x1e')](respondWithResult(_0x57369a,0xc9))[_0xc4c0('0x40')](handleError(_0x57369a,null));};exports['update']=function(_0x50c60d,_0x3108fe){if(_0x50c60d[_0xc4c0('0x45')]['id']){delete _0x50c60d['body']['id'];}return db[_0xc4c0('0x25')][_0xc4c0('0x46')]({'where':{'id':_0x50c60d[_0xc4c0('0x42')]['id']}})[_0xc4c0('0x1e')](handleEntityNotFound(_0x3108fe,null))['then'](saveUpdates(_0x50c60d[_0xc4c0('0x45')],null))[_0xc4c0('0x1e')](respondWithResult(_0x3108fe,null))[_0xc4c0('0x40')](handleError(_0x3108fe,null));};exports['destroy']=function(_0x4d4522,_0x119615){return db['FaxTransferReport'][_0xc4c0('0x46')]({'where':{'id':_0x4d4522[_0xc4c0('0x42')]['id']}})['then'](handleEntityNotFound(_0x119615,null))[_0xc4c0('0x1e')](removeEntity(_0x119615,null))[_0xc4c0('0x40')](handleError(_0x119615,null));};exports[_0xc4c0('0x47')]=function(_0x1cfffd,_0x472f37){return db[_0xc4c0('0x25')][_0xc4c0('0x47')]()[_0xc4c0('0x1e')](respondWithResult(_0x472f37,null))[_0xc4c0('0x40')](handleError(_0x472f37,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index db9bf74..7d13b5f 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 _0x52de=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0x52de,0x76));var _0xe52d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x52de[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe52d('0x0'));var util=require(_0xe52d('0x1'));var logger=require(_0xe52d('0x2'))(_0xe52d('0x3'));var moment=require(_0xe52d('0x4'));var BPromise=require(_0xe52d('0x5'));var rp=require(_0xe52d('0x6'));var fs=require('fs');var path=require(_0xe52d('0x7'));var rimraf=require(_0xe52d('0x8'));var config=require(_0xe52d('0x9'));var attributes=require(_0xe52d('0xa'));module['exports']=function(_0x25a57b,_0x4ed621){return _0x25a57b[_0xe52d('0xb')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xe52d('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xebf3=['moment','request-promise','rimraf','../../config/environment','define','report_fax_transfer','uniqueid','lodash','util'];(function(_0x2239c7,_0xda118){var _0x449af0=function(_0x18d95c){while(--_0x18d95c){_0x2239c7['push'](_0x2239c7['shift']());}};_0x449af0(++_0xda118);}(_0xebf3,0x73));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ebf('0x0'));var util=require(_0x3ebf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3ebf('0x2'));var BPromise=require('bluebird');var rp=require(_0x3ebf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ebf('0x4'));var config=require(_0x3ebf('0x5'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x4a26a2,_0x13d2f9){return _0x4a26a2[_0x3ebf('0x6')]('FaxTransferReport',attributes,{'tableName':_0x3ebf('0x7'),'paranoid':![],'indexes':[{'name':_0x3ebf('0x8'),'fields':[_0x3ebf('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 4afe658..9dc5561 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 _0x629c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x23285a,_0x42616d){var _0x59b153=function(_0x5052a1){while(--_0x5052a1){_0x23285a['push'](_0x23285a['shift']());}};_0x59b153(++_0x42616d);}(_0x629c,0xee));var _0xc629=function(_0x1c9542,_0x15f66f){_0x1c9542=_0x1c9542-0x0;var _0x3d2832=_0x629c[_0x1c9542];return _0x3d2832;};'use strict';var _=require(_0xc629('0x0'));var util=require(_0xc629('0x1'));var moment=require('moment');var BPromise=require(_0xc629('0x2'));var rs=require(_0xc629('0x3'));var fs=require('fs');var Redis=require(_0xc629('0x4'));var db=require(_0xc629('0x5'))['db'];var utils=require(_0xc629('0x6'));var logger=require(_0xc629('0x7'))('rpc');var config=require(_0xc629('0x8'));var jayson=require(_0xc629('0x9'));var client=jayson[_0xc629('0xa')][_0xc629('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20cffc,_0x2cd673,_0x19fbbd){return new BPromise(function(_0xbff6b9,_0x43e4b8){return client[_0xc629('0xc')](_0x20cffc,_0x19fbbd)[_0xc629('0xd')](function(_0x2ad709){logger[_0xc629('0xe')](_0xc629('0xf'),_0x2cd673,_0xc629('0x10'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2cd673,_0xc629('0x10'),JSON[_0xc629('0x11')](_0x2ad709));if(_0x2ad709[_0xc629('0x12')]){if(_0x2ad709[_0xc629('0x12')]['code']===0x1f4){logger[_0xc629('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x2cd673,_0x2ad709['error'][_0xc629('0x13')]);return _0x43e4b8(_0x2ad709[_0xc629('0x12')][_0xc629('0x13')]);}logger[_0xc629('0x12')](_0xc629('0xf'),_0x2cd673,_0x2ad709[_0xc629('0x12')]['message']);return _0xbff6b9(_0x2ad709[_0xc629('0x12')]['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2cd673,_0xc629('0x10'));_0xbff6b9(_0x2ad709[_0xc629('0x14')]['message']);}})[_0xc629('0x15')](function(_0x58f4da){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2cd673,_0x58f4da);_0x43e4b8(_0x58f4da);});});} \ No newline at end of file +var _0x7285=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4ee11e,_0x2ce1e6){var _0x483885=function(_0x11717e){while(--_0x11717e){_0x4ee11e['push'](_0x4ee11e['shift']());}};_0x483885(++_0x2ce1e6);}(_0x7285,0x175));var _0x5728=function(_0x300154,_0x14ea2f){_0x300154=_0x300154-0x0;var _0x3ddb7e=_0x7285[_0x300154];return _0x3ddb7e;};'use strict';var _=require(_0x5728('0x0'));var util=require(_0x5728('0x1'));var moment=require(_0x5728('0x2'));var BPromise=require(_0x5728('0x3'));var rs=require(_0x5728('0x4'));var fs=require('fs');var Redis=require(_0x5728('0x5'));var db=require(_0x5728('0x6'))['db'];var utils=require(_0x5728('0x7'));var logger=require(_0x5728('0x8'))(_0x5728('0x9'));var config=require(_0x5728('0xa'));var jayson=require(_0x5728('0xb'));var client=jayson['client'][_0x5728('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d9999,_0x3d6bdf,_0x325f9f){return new BPromise(function(_0x23a796,_0x56ee4c){return client[_0x5728('0xd')](_0x5d9999,_0x325f9f)[_0x5728('0xe')](function(_0x4c99d7){logger[_0x5728('0xf')](_0x5728('0x10'),_0x3d6bdf,_0x5728('0x11'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x3d6bdf,_0x5728('0x11'),JSON['stringify'](_0x4c99d7));if(_0x4c99d7[_0x5728('0x12')]){if(_0x4c99d7[_0x5728('0x12')][_0x5728('0x13')]===0x1f4){logger[_0x5728('0x12')](_0x5728('0x10'),_0x3d6bdf,_0x4c99d7[_0x5728('0x12')]['message']);return _0x56ee4c(_0x4c99d7['error'][_0x5728('0x14')]);}logger[_0x5728('0x12')](_0x5728('0x10'),_0x3d6bdf,_0x4c99d7[_0x5728('0x12')][_0x5728('0x14')]);return _0x23a796(_0x4c99d7[_0x5728('0x12')][_0x5728('0x14')]);}else{logger[_0x5728('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x3d6bdf,_0x5728('0x11'));_0x23a796(_0x4c99d7[_0x5728('0x15')]['message']);}})[_0x5728('0x16')](function(_0x100563){logger[_0x5728('0x12')](_0x5728('0x10'),_0x3d6bdf,_0x100563);_0x56ee4c(_0x100563);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7495bd5..725f965 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 _0xeec6=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','exports'];(function(_0x14477,_0x38e281){var _0x92c8be=function(_0x3b5d1f){while(--_0x3b5d1f){_0x14477['push'](_0x14477['shift']());}};_0x92c8be(++_0x38e281);}(_0xeec6,0x1c2));var _0x6eec=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0xeec6[_0x1f1a97];return _0x29fc6a;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var auth=require(_0x6eec('0x5'));var interaction=require(_0x6eec('0x6'));var config=require(_0x6eec('0x7'));var controller=require(_0x6eec('0x8'));router[_0x6eec('0x9')]('/',auth['isAuthenticated'](),controller[_0x6eec('0xa')]);router[_0x6eec('0x9')]('/describe',auth[_0x6eec('0xb')](),controller[_0x6eec('0xc')]);router[_0x6eec('0x9')](_0x6eec('0xd'),auth['isAuthenticated'](),controller[_0x6eec('0xe')]);router[_0x6eec('0xf')]('/',auth[_0x6eec('0xb')](),controller['create']);router['put']('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0x10')]);router['delete']('/:id',auth[_0x6eec('0xb')](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file +var _0x6aa7=['Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0xf9ef84,_0x4b0536){var _0x2e3dbd=function(_0x633d82){while(--_0x633d82){_0xf9ef84['push'](_0xf9ef84['shift']());}};_0x2e3dbd(++_0x4b0536);}(_0x6aa7,0x178));var _0x76aa=function(_0x478699,_0x5ca6dc){_0x478699=_0x478699-0x0;var _0x453883=_0x6aa7[_0x478699];return _0x453883;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76aa('0x5'));var config=require(_0x76aa('0x6'));var controller=require(_0x76aa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x76aa('0x8')]);router['get'](_0x76aa('0x9'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xd')]);router['post']('/',auth[_0x76aa('0xa')](),controller[_0x76aa('0xe')]);router[_0x76aa('0xf')](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x10')]);router[_0x76aa('0x11')](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 74c491f..916f942 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 _0xb076=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x56035c,_0x595601){var _0x23553e=function(_0x24828b){while(--_0x24828b){_0x56035c['push'](_0x56035c['shift']());}};_0x23553e(++_0x595601);}(_0xb076,0x125));var _0x6b07=function(_0x340d75,_0x561cb0){_0x340d75=_0x340d75-0x0;var _0x3f1114=_0xb076[_0x340d75];return _0x3f1114;};'use strict';var multer=require(_0x6b07('0x0'));var util=require('util');var path=require(_0x6b07('0x1'));var timeout=require(_0x6b07('0x2'));var express=require('express');var router=express[_0x6b07('0x3')]();var auth=require(_0x6b07('0x4'));var interaction=require(_0x6b07('0x5'));var config=require(_0x6b07('0x6'));var controller=require(_0x6b07('0x7'));router['get']('/',auth[_0x6b07('0x8')](),controller[_0x6b07('0x9')]);router['get'](_0x6b07('0xa'),auth[_0x6b07('0x8')](),controller[_0x6b07('0xb')]);router['get'](_0x6b07('0xc'),auth[_0x6b07('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x6b07('0x8')](),controller[_0x6b07('0xd')]);router[_0x6b07('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b07('0xe')]('/:id/configurations',auth[_0x6b07('0x8')](),controller[_0x6b07('0xf')]);router[_0x6b07('0x10')](_0x6b07('0xa'),auth[_0x6b07('0x8')](),controller[_0x6b07('0x11')]);router[_0x6b07('0x12')](_0x6b07('0xa'),auth[_0x6b07('0x8')](),controller[_0x6b07('0x13')]);module[_0x6b07('0x14')]=router; \ No newline at end of file +var _0x5ed4=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','create','put'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0x5ed4,0x11b));var _0x45ed=function(_0x35ebe1,_0xde5fec){_0x35ebe1=_0x35ebe1-0x0;var _0x1e8cee=_0x5ed4[_0x35ebe1];return _0x1e8cee;};'use strict';var multer=require(_0x45ed('0x0'));var util=require(_0x45ed('0x1'));var path=require(_0x45ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x45ed('0x3'));var router=express[_0x45ed('0x4')]();var auth=require(_0x45ed('0x5'));var interaction=require(_0x45ed('0x6'));var config=require(_0x45ed('0x7'));var controller=require(_0x45ed('0x8'));router['get']('/',auth[_0x45ed('0x9')](),controller[_0x45ed('0xa')]);router['get'](_0x45ed('0xb'),auth[_0x45ed('0x9')](),controller[_0x45ed('0xc')]);router[_0x45ed('0xd')](_0x45ed('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x45ed('0xd')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x45ed('0xf')]);router['post'](_0x45ed('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x45ed('0x10')](_0x45ed('0xb'),auth[_0x45ed('0x9')](),controller['update']);router[_0x45ed('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x45ed('0x12')]);module[_0x45ed('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e68aa2f..af13512 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 _0x4ccf=['basic','integrationTab','newTab','sequelize','STRING','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4ccf,0x12f));var _0xf4cc=function(_0x2a7e20,_0x44b5be){_0x2a7e20=_0x2a7e20-0x0;var _0x462d46=_0x4ccf[_0x2a7e20];return _0x462d46;};'use strict';var Sequelize=require(_0xf4cc('0x0'));module['exports']={'name':{'type':Sequelize[_0xf4cc('0x1')]},'description':{'type':Sequelize[_0xf4cc('0x1')]},'username':{'type':Sequelize[_0xf4cc('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xf4cc('0x2')](_0xf4cc('0x3')),'defaultValue':_0xf4cc('0x3')},'password':{'type':Sequelize[_0xf4cc('0x1')]},'consumerKey':{'type':Sequelize[_0xf4cc('0x1')]},'consumerSecret':{'type':Sequelize[_0xf4cc('0x1')]},'token':{'type':Sequelize[_0xf4cc('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf4cc('0x1')]},'type':{'type':Sequelize['ENUM'](_0xf4cc('0x4'),_0xf4cc('0x5')),'defaultValue':_0xf4cc('0x4')}}; \ No newline at end of file +var _0xdd3f=['newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xdd3f,0x1d5));var _0xfdd3=function(_0x28b07c,_0x101a62){_0x28b07c=_0x28b07c-0x0;var _0x297458=_0xdd3f[_0x28b07c];return _0x297458;};'use strict';var Sequelize=require(_0xfdd3('0x0'));module[_0xfdd3('0x1')]={'name':{'type':Sequelize[_0xfdd3('0x2')]},'description':{'type':Sequelize[_0xfdd3('0x2')]},'username':{'type':Sequelize[_0xfdd3('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xfdd3('0x3')](_0xfdd3('0x4')),'defaultValue':_0xfdd3('0x4')},'password':{'type':Sequelize[_0xfdd3('0x2')]},'consumerKey':{'type':Sequelize[_0xfdd3('0x2')]},'consumerSecret':{'type':Sequelize[_0xfdd3('0x2')]},'token':{'type':Sequelize[_0xfdd3('0x2')]},'tokenSecret':{'type':Sequelize[_0xfdd3('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('integrationTab',_0xfdd3('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d46fc70..435ebac 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 _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','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 _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file +var _0xd8b0=['findAll','rows','show','params','rawAttributes','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','options','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','%s/custom_fields','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','map','active','label','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','limit','set','json','save','destroy','stack','name','index','DeskAccount','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','field','count','include'];(function(_0xc76453,_0x4ec5a4){var _0x46437f=function(_0x43d48a){while(--_0x43d48a){_0xc76453['push'](_0xc76453['shift']());}};_0x46437f(++_0x4ec5a4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];var integrations=require(_0x0d8b('0x15'));var jayson=require(_0x0d8b('0x16'));var client=jayson[_0x0d8b('0x17')][_0x0d8b('0x18')]({'port':0x232a});function checkPasswordPattern(_0x32bb1a,_0x15dd0f,_0x31a8cc){if(_0x31a8cc){var _0x1d4bbc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d4bbc[_0x0d8b('0x19')](_0x15dd0f)){return _0x32bb1a;}else{throw new Error(_0x0d8b('0x1a'));}}else{return _0x32bb1a;}}function respondWithRpcPromise(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){var _0x17f7df=_0x4f6f21||client;return _0x17f7df[_0x0d8b('0x1b')](_0xe65334,_0x2d4e1c)[_0x0d8b('0x1c')](function(_0x5cd485){logger[_0x0d8b('0x1d')](_0x0d8b('0x1e'),_0x1567ce,_0x0d8b('0x1f'));logger[_0x0d8b('0x20')](_0x0d8b('0x21'),_0x1567ce,_0x0d8b('0x1f'),JSON[_0x0d8b('0x22')](_0x5cd485));if(_0x5cd485[_0x0d8b('0x23')]){if(_0x5cd485['error'][_0x0d8b('0x24')]===0x1f4){logger[_0x0d8b('0x23')](_0x0d8b('0x1e'),_0x1567ce,_0x5cd485[_0x0d8b('0x23')][_0x0d8b('0x25')]);return _0xa86349(_0x5cd485[_0x0d8b('0x23')][_0x0d8b('0x25')]);}logger[_0x0d8b('0x23')]('DeskAccount,\x20%s,\x20%s',_0x1567ce,_0x5cd485['error'][_0x0d8b('0x25')]);return _0x23eb7b(_0x5cd485['error']['message']);}else{logger['info'](_0x0d8b('0x1e'),_0x1567ce,_0x0d8b('0x1f'));_0x23eb7b(_0x5cd485[_0x0d8b('0x26')][_0x0d8b('0x25')]);}})[_0x0d8b('0x27')](function(_0x2c64e2){logger[_0x0d8b('0x23')](_0x0d8b('0x1e'),_0x1567ce,_0x2c64e2);_0xa86349(_0x2c64e2);});});}function respondWithStatusCode(_0x27b695,_0x5e5bc3){_0x5e5bc3=_0x5e5bc3||0xcc;return function(_0xe8bbee){if(_0xe8bbee){return _0x27b695[_0x0d8b('0x28')](_0x5e5bc3);}return _0x27b695['status'](_0x5e5bc3)[_0x0d8b('0x29')]();};}function respondWithResult(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0xc8;return function(_0x234bdd){if(_0x234bdd){return _0x4a0ae4[_0x0d8b('0x2a')](_0x3dd149)['json'](_0x234bdd);}};}function respondWithFilteredResult(_0x59a905,_0x28f639){return function(_0x3ef745){if(_0x3ef745){var _0x4c05ee=_0x3ef745['count'],_0xcbc4ac=_0x28f639[_0x0d8b('0x2b')],_0x59aa83=_0x28f639['offset']+_0x28f639[_0x0d8b('0x2c')],_0x1b2b59;if(_0x59aa83>=_0x4c05ee){_0x59aa83=_0x4c05ee;_0x1b2b59=0xc8;}else{_0x1b2b59=0xce;}_0x59a905['status'](_0x1b2b59);return _0x59a905[_0x0d8b('0x2d')]('Content-Range',_0xcbc4ac+'-'+_0x59aa83+'/'+_0x4c05ee)[_0x0d8b('0x2e')](_0x3ef745);}return null;};}function patchUpdates(_0x106e4c){return function(_0x2c058d){try{jsonpatch['apply'](_0x2c058d,_0x106e4c,!![]);}catch(_0x4c80a2){return BPromise['reject'](_0x4c80a2);}return _0x2c058d[_0x0d8b('0x2f')]();};}function saveUpdates(_0x5515d2,_0x3cdf3c){return function(_0x54f6f3){if(_0x54f6f3){return _0x54f6f3['update'](_0x5515d2)[_0x0d8b('0x1c')](function(_0x1b6920){return _0x1b6920;});}return null;};}function removeEntity(_0x109c14,_0xdeee5d){return function(_0x183220){if(_0x183220){return _0x183220[_0x0d8b('0x30')]()[_0x0d8b('0x1c')](function(){_0x109c14[_0x0d8b('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ca42,_0x3ef48d){return function(_0x4b3ea0){if(!_0x4b3ea0){_0x37ca42[_0x0d8b('0x28')](0x194);}return _0x4b3ea0;};}function handleError(_0x23f7f6,_0x18a905){_0x18a905=_0x18a905||0x1f4;return function(_0x4f2ed2){logger[_0x0d8b('0x23')](_0x4f2ed2[_0x0d8b('0x31')]);if(_0x4f2ed2[_0x0d8b('0x32')]){delete _0x4f2ed2[_0x0d8b('0x32')];}_0x23f7f6[_0x0d8b('0x2a')](_0x18a905)['send'](_0x4f2ed2);};}exports[_0x0d8b('0x33')]=function(_0x1649fc,_0x5ad0fe){var _0x1180ac={},_0x3cc3ee={},_0x188af2={'count':0x0,'rows':[]};var _0x974b9b=db[_0x0d8b('0x34')]['rawAttributes'];_0x3cc3ee['model']=_[_0x0d8b('0x35')](_0x974b9b);_0x3cc3ee['query']=_['keys'](_0x1649fc[_0x0d8b('0x36')]);_0x3cc3ee[_0x0d8b('0x37')]=_[_0x0d8b('0x38')](_0x3cc3ee[_0x0d8b('0x39')],_0x3cc3ee[_0x0d8b('0x36')]);_0x1180ac[_0x0d8b('0x3a')]=_['intersection'](_0x3cc3ee[_0x0d8b('0x39')],qs[_0x0d8b('0x3b')](_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x3b')]));_0x1180ac[_0x0d8b('0x3a')]=_0x1180ac[_0x0d8b('0x3a')][_0x0d8b('0x3c')]?_0x1180ac['attributes']:_0x3cc3ee[_0x0d8b('0x39')];if(!_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x3d')](_0x0d8b('0x3e'))){_0x1180ac['limit']=qs[_0x0d8b('0x2c')](_0x1649fc['query'][_0x0d8b('0x2c')]);_0x1180ac[_0x0d8b('0x2b')]=qs[_0x0d8b('0x2b')](_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x2b')]);}_0x1180ac[_0x0d8b('0x3f')]=qs[_0x0d8b('0x40')](_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x40')]);_0x1180ac[_0x0d8b('0x41')]=qs['filters'](_['pick'](_0x1649fc['query'],_0x3cc3ee['filters']));if(_0x1649fc['query'][_0x0d8b('0x42')]){_0x1180ac[_0x0d8b('0x41')]=_[_0x0d8b('0x43')](_0x1180ac['where'],{'$or':_['map'](_0x974b9b,function(_0x1b216d){if(_0x1b216d[_0x0d8b('0x44')][_0x0d8b('0x45')]!=='VIRTUAL'){var _0x214583={};_0x214583[_0x1b216d[_0x0d8b('0x46')]]={'$like':'%'+_0x1649fc['query']['filter']+'%'};return _0x214583;}})});}_0x1180ac=_[_0x0d8b('0x43')]({},_0x1180ac,_0x1649fc['options']);var _0x1e22e5={'where':_0x1180ac['where']};return db['DeskAccount'][_0x0d8b('0x47')](_0x1e22e5)[_0x0d8b('0x1c')](function(_0x5a75c7){_0x188af2['count']=_0x5a75c7;if(_0x1649fc['query']['includeAll']){_0x1180ac[_0x0d8b('0x48')]=[{'all':!![]}];}return db[_0x0d8b('0x34')][_0x0d8b('0x49')](_0x1180ac);})['then'](function(_0xb0910e){_0x188af2[_0x0d8b('0x4a')]=_0xb0910e;return _0x188af2;})[_0x0d8b('0x1c')](respondWithFilteredResult(_0x5ad0fe,_0x1180ac))[_0x0d8b('0x27')](handleError(_0x5ad0fe,null));};exports[_0x0d8b('0x4b')]=function(_0x2d5246,_0x11d22b){var _0x1d5067={'raw':![],'where':{'id':_0x2d5246[_0x0d8b('0x4c')]['id']}},_0x384a5e={};_0x384a5e[_0x0d8b('0x39')]=_[_0x0d8b('0x35')](db[_0x0d8b('0x34')][_0x0d8b('0x4d')]);_0x384a5e[_0x0d8b('0x36')]=_[_0x0d8b('0x35')](_0x2d5246[_0x0d8b('0x36')]);_0x384a5e[_0x0d8b('0x37')]=_[_0x0d8b('0x38')](_0x384a5e['model'],_0x384a5e[_0x0d8b('0x36')]);_0x1d5067['attributes']=_['intersection'](_0x384a5e[_0x0d8b('0x39')],qs[_0x0d8b('0x3b')](_0x2d5246[_0x0d8b('0x36')][_0x0d8b('0x3b')]));_0x1d5067['attributes']=_0x1d5067[_0x0d8b('0x3a')][_0x0d8b('0x3c')]?_0x1d5067[_0x0d8b('0x3a')]:_0x384a5e[_0x0d8b('0x39')];if(_0x2d5246[_0x0d8b('0x36')]['includeAll']){_0x1d5067['include']=[{'all':!![]}];}_0x1d5067=_['merge']({},_0x1d5067,_0x2d5246['options']);return db[_0x0d8b('0x34')][_0x0d8b('0x4e')](_0x1d5067)['then'](handleEntityNotFound(_0x11d22b,null))['then'](respondWithResult(_0x11d22b,null))[_0x0d8b('0x27')](handleError(_0x11d22b,null));};exports[_0x0d8b('0x4f')]=function(_0x5c5bd7,_0x5ef6c3){return db[_0x0d8b('0x34')][_0x0d8b('0x4f')](_0x5c5bd7[_0x0d8b('0x50')],{})[_0x0d8b('0x1c')](respondWithResult(_0x5ef6c3,0xc9))[_0x0d8b('0x27')](handleError(_0x5ef6c3,null));};exports['update']=function(_0x2de903,_0x2afe34){if(_0x2de903['body']['id']){delete _0x2de903['body']['id'];}return db[_0x0d8b('0x34')][_0x0d8b('0x4e')]({'where':{'id':_0x2de903['params']['id']}})['then'](handleEntityNotFound(_0x2afe34,null))[_0x0d8b('0x1c')](saveUpdates(_0x2de903[_0x0d8b('0x50')],null))[_0x0d8b('0x1c')](respondWithResult(_0x2afe34,null))[_0x0d8b('0x27')](handleError(_0x2afe34,null));};exports['destroy']=function(_0x356b3d,_0x598e03){return db['DeskAccount'][_0x0d8b('0x4e')]({'where':{'id':_0x356b3d[_0x0d8b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x598e03,null))['then'](removeEntity(_0x598e03,null))[_0x0d8b('0x27')](handleError(_0x598e03,null));};exports[_0x0d8b('0x51')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76={};var _0x3978e5={};var _0x3bead7;var _0x5418d8;return db[_0x0d8b('0x34')][_0x0d8b('0x52')]({'where':{'id':_0xccc2a9[_0x0d8b('0x4c')]['id']}})[_0x0d8b('0x1c')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x1c')](function(_0x47104e){if(_0x47104e){_0x3bead7=_0x47104e;_0x3978e5[_0x0d8b('0x39')]=_[_0x0d8b('0x35')](db[_0x0d8b('0x53')]['rawAttributes']);_0x3978e5[_0x0d8b('0x36')]=_[_0x0d8b('0x35')](_0xccc2a9[_0x0d8b('0x36')]);_0x3978e5[_0x0d8b('0x37')]=_[_0x0d8b('0x38')](_0x3978e5['model'],_0x3978e5[_0x0d8b('0x36')]);_0xb66e76[_0x0d8b('0x3a')]=_[_0x0d8b('0x38')](_0x3978e5[_0x0d8b('0x39')],qs[_0x0d8b('0x3b')](_0xccc2a9['query']['fields']));_0xb66e76[_0x0d8b('0x3a')]=_0xb66e76[_0x0d8b('0x3a')][_0x0d8b('0x3c')]?_0xb66e76[_0x0d8b('0x3a')]:_0x3978e5['model'];_0xb66e76[_0x0d8b('0x3f')]=qs[_0x0d8b('0x40')](_0xccc2a9[_0x0d8b('0x36')]['sort']);_0xb66e76[_0x0d8b('0x41')]=qs['filters'](_[_0x0d8b('0x54')](_0xccc2a9[_0x0d8b('0x36')],_0x3978e5[_0x0d8b('0x37')]));if(_0xccc2a9[_0x0d8b('0x36')][_0x0d8b('0x42')]){_0xb66e76[_0x0d8b('0x41')]=_['merge'](_0xb66e76[_0x0d8b('0x41')],{'$or':_['map'](_0xb66e76[_0x0d8b('0x3a')],function(_0x4577c8){var _0xafeeb0={};_0xafeeb0[_0x4577c8]={'$like':'%'+_0xccc2a9[_0x0d8b('0x36')]['filter']+'%'};return _0xafeeb0;})});}_0xb66e76=_[_0x0d8b('0x43')]({},_0xb66e76,_0xccc2a9[_0x0d8b('0x55')]);return _0x3bead7[_0x0d8b('0x51')](_0xb66e76);}})[_0x0d8b('0x1c')](function(_0x2ccdae){if(_0x2ccdae){_0x5418d8=_0x2ccdae[_0x0d8b('0x3c')];if(!_0xccc2a9[_0x0d8b('0x36')][_0x0d8b('0x3d')](_0x0d8b('0x3e'))){_0xb66e76[_0x0d8b('0x2c')]=qs['limit'](_0xccc2a9['query'][_0x0d8b('0x2c')]);_0xb66e76[_0x0d8b('0x2b')]=qs['offset'](_0xccc2a9[_0x0d8b('0x36')]['offset']);}return _0x3bead7['getConfigurations'](_0xb66e76);}})[_0x0d8b('0x1c')](function(_0x1c4e96){if(_0x1c4e96){return _0x1c4e96?{'count':_0x5418d8,'rows':_0x1c4e96}:null;}})['then'](respondWithResult(_0x2c1eb0,null))['catch'](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x56')]=function(_0x1c007b,_0x70e4b2,_0x435090){if(_0x1c007b[_0x0d8b('0x50')]['id']){delete _0x1c007b[_0x0d8b('0x50')]['id'];}return db[_0x0d8b('0x34')]['findOne']({'where':{'id':_0x1c007b[_0x0d8b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x70e4b2,null))[_0x0d8b('0x1c')](function(_0x2c6242){if(_0x2c6242){_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x57')]=_0x2c6242['id'];_0x1c007b['body'][_0x0d8b('0x58')]=integrations['getSubjects'](_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x59')],_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x44')]);_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x5a')]=integrations[_0x0d8b('0x5b')](_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x59')],_0x1c007b[_0x0d8b('0x50')]['type']);return db[_0x0d8b('0x53')]['create'](_0x1c007b[_0x0d8b('0x50')],{'include':[{'model':db[_0x0d8b('0x5c')],'as':'Subjects'},{'model':db[_0x0d8b('0x5c')],'as':'Descriptions'}]});}return null;})[_0x0d8b('0x1c')](respondWithResult(_0x70e4b2,null))[_0x0d8b('0x27')](handleError(_0x70e4b2,null));};exports[_0x0d8b('0x5d')]=function(_0x259ac9,_0x2242cd,_0x299f98){var _0x3a073b=[{'name':_0x0d8b('0x5e'),'label':'priority','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 _0x10eca6='';return db[_0x0d8b('0x34')]['findOne']({'where':{'id':_0x259ac9[_0x0d8b('0x4c')]['id']},'attributes':['id',_0x0d8b('0x5f'),_0x0d8b('0x60'),_0x0d8b('0x61'),_0x0d8b('0x62'),_0x0d8b('0x63'),_0x0d8b('0x64'),_0x0d8b('0x65'),_0x0d8b('0x66')]})[_0x0d8b('0x1c')](handleEntityNotFound(_0x2242cd,null))[_0x0d8b('0x1c')](function(_0x16df83){if(_0x16df83){_0x10eca6=_0x16df83['remoteUri'];var _0x1ece98=_0x10eca6[_0x0d8b('0x67')](-0x1);if(_0x1ece98==='/'){_0x10eca6=_0x10eca6[_0x0d8b('0x68')](0x0,_0x10eca6['lastIndexOf'](_0x1ece98));}var _0x5db3b4={'method':_0x0d8b('0x69'),'uri':util[_0x0d8b('0x6a')](_0x0d8b('0x6b'),_0x10eca6),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x16df83[_0x0d8b('0x60')]===_0x0d8b('0x6c')){_0x5db3b4[_0x0d8b('0x6d')][_0x0d8b('0x6e')]=util[_0x0d8b('0x6a')](_0x0d8b('0x6f'),new Buffer(util[_0x0d8b('0x6a')](_0x0d8b('0x70'),_0x16df83[_0x0d8b('0x61')],_0x16df83[_0x0d8b('0x62')]))[_0x0d8b('0x71')](_0x0d8b('0x72')));}return rp(_0x5db3b4)[_0x0d8b('0x1c')](function(_0x5dbc6b){return _0x3a073b[_0x0d8b('0x73')](_[_0x0d8b('0x74')](_0x5dbc6b['_embedded']['entries'],function(_0x1a1029){return{'id':_0x1a1029[_0x0d8b('0x32')],'name':_0x1a1029[_0x0d8b('0x32')],'type':_0x1a1029[_0x0d8b('0x44')],'active':_0x1a1029[_0x0d8b('0x75')],'label':_0x1a1029[_0x0d8b('0x76')],'custom':!![]};}));});}})['then'](function(_0x502715){return{'count':_0x502715['length'],'rows':_0x502715};})[_0x0d8b('0x1c')](respondWithResult(_0x2242cd,null))[_0x0d8b('0x27')](function(_0x466442){var _0x28f9b7=_0x259ac9[_0x0d8b('0x36')][_0x0d8b('0x19')]?0x1f4:_0x466442['statusCode']||0x1f4;logger[_0x0d8b('0x23')](_0x0d8b('0x77'),'getFields',_0x28f9b7,JSON[_0x0d8b('0x22')](_0x466442));delete _0x466442['name'];if(_0x28f9b7===0x191){_0x28f9b7=0x190;}_0x2242cd[_0x0d8b('0x2a')](_0x28f9b7)[_0x0d8b('0x78')](_0x259ac9[_0x0d8b('0x36')][_0x0d8b('0x19')]?{'message':_0x0d8b('0x79'),'statusCode':_0x466442[_0x0d8b('0x7a')]}:_0x466442);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 2211571..024626a 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 _0xa75b=['request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','api','moment','bluebird'];(function(_0xcb7250,_0x5e7fd8){var _0x1e7095=function(_0x2c7539){while(--_0x2c7539){_0xcb7250['push'](_0xcb7250['shift']());}};_0x1e7095(++_0x5e7fd8);}(_0xa75b,0x170));var _0xba75=function(_0x1558d8,_0x48b245){_0x1558d8=_0x1558d8-0x0;var _0x11fb39=_0xa75b[_0x1558d8];return _0x11fb39;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));var integrations=require(_0xba75('0x9'));module[_0xba75('0xa')]=function(_0x2baa28,_0x238a33){return _0x2baa28[_0xba75('0xb')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea3=['define','DeskAccount','lodash','util','../../config/logger','api','bluebird','path','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x17b23c,_0x423472){var _0x3af1b4=function(_0x34e307){while(--_0x34e307){_0x17b23c['push'](_0x17b23c['shift']());}};_0x3af1b4(++_0x423472);}(_0x4ea3,0x70));var _0x34ea=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4ea3[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));var integrations=require(_0x34ea('0x7'));module[_0x34ea('0x8')]=function(_0x123d48,_0x40434e){return _0x123d48[_0x34ea('0x9')](_0x34ea('0xa'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 2fe4f59..5c29b32 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 _0x349f=['info','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message'];(function(_0x19f497,_0x368d29){var _0x22e9d3=function(_0x26c591){while(--_0x26c591){_0x19f497['push'](_0x19f497['shift']());}};_0x22e9d3(++_0x368d29);}(_0x349f,0xa8));var _0xf349=function(_0x4e86d4,_0x3156ca){_0x4e86d4=_0x4e86d4-0x0;var _0x56a5c1=_0x349f[_0x4e86d4];return _0x56a5c1;};'use strict';var _=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var moment=require(_0xf349('0x2'));var BPromise=require('bluebird');var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require(_0xf349('0x4'));var db=require(_0xf349('0x5'))['db'];var utils=require(_0xf349('0x6'));var logger=require(_0xf349('0x7'))(_0xf349('0x8'));var config=require(_0xf349('0x9'));var jayson=require(_0xf349('0xa'));var client=jayson[_0xf349('0xb')][_0xf349('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c6f4c,_0x1bd44a,_0x23fb4b){return new BPromise(function(_0x6c6cd2,_0x21a480){return client[_0xf349('0xd')](_0x4c6f4c,_0x23fb4b)[_0xf349('0xe')](function(_0x3e2147){logger['info']('DeskAccount,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));logger[_0xf349('0x10')](_0xf349('0x11'),_0x1bd44a,_0xf349('0xf'),JSON[_0xf349('0x12')](_0x3e2147));if(_0x3e2147['error']){if(_0x3e2147['error']['code']===0x1f4){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147[_0xf349('0x13')][_0xf349('0x15')]);return _0x21a480(_0x3e2147[_0xf349('0x13')]['message']);}logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147['error'][_0xf349('0x15')]);return _0x6c6cd2(_0x3e2147[_0xf349('0x13')]['message']);}else{logger[_0xf349('0x16')]('DeskAccount,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));_0x6c6cd2(_0x3e2147[_0xf349('0x17')][_0xf349('0x15')]);}})[_0xf349('0x18')](function(_0x14c06d){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x14c06d);_0x21a480(_0x14c06d);});});}exports['GetDeskAccount']=function(_0x44aa98){var _0x5aec49=this;return new Promise(function(_0x3b56cc,_0x1431fe){return db[_0xf349('0x19')][_0xf349('0x1a')]({'raw':_0x44aa98[_0xf349('0x1b')]?_0x44aa98[_0xf349('0x1b')][_0xf349('0x1c')]===undefined?!![]:![]:!![],'where':_0x44aa98[_0xf349('0x1b')]?_0x44aa98['options'][_0xf349('0x1d')]||null:null,'attributes':_0x44aa98['options']?_0x44aa98[_0xf349('0x1b')][_0xf349('0x1e')]||null:null,'limit':_0x44aa98[_0xf349('0x1b')]?_0x44aa98['options'][_0xf349('0x1f')]||null:null,'include':_0x44aa98[_0xf349('0x1b')]?_0x44aa98[_0xf349('0x1b')]['include']?_[_0xf349('0x20')](_0x44aa98[_0xf349('0x1b')]['include'],function(_0x5752b5){return{'model':db[_0x5752b5['model']],'as':_0x5752b5['as'],'attributes':_0x5752b5[_0xf349('0x1e')],'include':_0x5752b5[_0xf349('0x21')]?_[_0xf349('0x20')](_0x5752b5['include'],function(_0x3de06b){return{'model':db[_0x3de06b[_0xf349('0x22')]],'as':_0x3de06b['as'],'attributes':_0x3de06b[_0xf349('0x1e')],'include':_0x3de06b[_0xf349('0x21')]?_[_0xf349('0x20')](_0x3de06b[_0xf349('0x21')],function(_0x3da7b7){return{'model':db[_0x3da7b7[_0xf349('0x22')]],'as':_0x3da7b7['as'],'attributes':_0x3da7b7[_0xf349('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf349('0xe')](function(_0x403816){logger[_0xf349('0x16')](_0xf349('0x23'),_0x44aa98);logger[_0xf349('0x10')]('GetDeskAccount',_0x44aa98,JSON['stringify'](_0x403816));_0x3b56cc(_0x403816);})['catch'](function(_0x4f2ae2){logger[_0xf349('0x13')]('GetDeskAccount',_0x4f2ae2[_0xf349('0x15')],_0x44aa98);_0x1431fe(_0x5aec49['error'](0x1f4,_0x4f2ae2['message']));});});};exports['ShowDeskAccount']=function(_0x59a583){var _0x1a3ec6=this;return new Promise(function(_0xe3a5f7,_0xc1c0){return db[_0xf349('0x19')][_0xf349('0x24')]({'raw':_0x59a583['options']?_0x59a583['options'][_0xf349('0x1c')]===undefined?!![]:![]:!![],'where':_0x59a583[_0xf349('0x1b')]?_0x59a583[_0xf349('0x1b')][_0xf349('0x1d')]||null:null,'attributes':_0x59a583[_0xf349('0x1b')]?_0x59a583['options'][_0xf349('0x1e')]||null:null,'include':_0x59a583[_0xf349('0x1b')]?_0x59a583['options']['include']?_['map'](_0x59a583[_0xf349('0x1b')][_0xf349('0x21')],function(_0x362ee9){return{'model':db[_0x362ee9['model']],'as':_0x362ee9['as'],'attributes':_0x362ee9[_0xf349('0x1e')],'include':_0x362ee9[_0xf349('0x21')]?_[_0xf349('0x20')](_0x362ee9[_0xf349('0x21')],function(_0x30b9ab){return{'model':db[_0x30b9ab['model']],'as':_0x30b9ab['as'],'attributes':_0x30b9ab[_0xf349('0x1e')],'include':_0x30b9ab['include']?_[_0xf349('0x20')](_0x30b9ab[_0xf349('0x21')],function(_0xdf0d69){return{'model':db[_0xdf0d69[_0xf349('0x22')]],'as':_0xdf0d69['as'],'attributes':_0xdf0d69[_0xf349('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf349('0xe')](function(_0x37f8ea){logger['info']('ShowDeskAccount',_0x59a583);logger['debug'](_0xf349('0x25'),_0x59a583,JSON[_0xf349('0x12')](_0x37f8ea));_0xe3a5f7(_0x37f8ea);})['catch'](function(_0x1f03cb){logger[_0xf349('0x13')]('ShowDeskAccount',_0x1f03cb[_0xf349('0x15')],_0x59a583);_0xc1c0(_0x1a3ec6[_0xf349('0x13')](0x1f4,_0x1f03cb[_0xf349('0x15')]));});});}; \ No newline at end of file +var _0x8c8c=['../../config/environment','jayson/promise','client','info','request\x20sent','debug','error','code','DeskAccount,\x20%s,\x20%s','message','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowDeskAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x167eaf,_0x5e3eb6){var _0x41c661=function(_0x5c7228){while(--_0x5c7228){_0x167eaf['push'](_0x167eaf['shift']());}};_0x41c661(++_0x5e3eb6);}(_0x8c8c,0x185));var _0xc8c8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8c8c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc8c8('0x0'));var util=require(_0xc8c8('0x1'));var moment=require(_0xc8c8('0x2'));var BPromise=require(_0xc8c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc8c8('0x5'))(_0xc8c8('0x6'));var config=require(_0xc8c8('0x7'));var jayson=require(_0xc8c8('0x8'));var client=jayson[_0xc8c8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8bcfec,_0x2bad6d,_0x12ced7){return new BPromise(function(_0x1246e3,_0x172274){return client['request'](_0x8bcfec,_0x12ced7)['then'](function(_0x430b8e){logger[_0xc8c8('0xa')]('DeskAccount,\x20%s,\x20%s',_0x2bad6d,_0xc8c8('0xb'));logger[_0xc8c8('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2bad6d,_0xc8c8('0xb'),JSON['stringify'](_0x430b8e));if(_0x430b8e[_0xc8c8('0xd')]){if(_0x430b8e[_0xc8c8('0xd')][_0xc8c8('0xe')]===0x1f4){logger[_0xc8c8('0xd')](_0xc8c8('0xf'),_0x2bad6d,_0x430b8e['error']['message']);return _0x172274(_0x430b8e[_0xc8c8('0xd')][_0xc8c8('0x10')]);}logger[_0xc8c8('0xd')](_0xc8c8('0xf'),_0x2bad6d,_0x430b8e[_0xc8c8('0xd')]['message']);return _0x1246e3(_0x430b8e[_0xc8c8('0xd')][_0xc8c8('0x10')]);}else{logger[_0xc8c8('0xa')](_0xc8c8('0xf'),_0x2bad6d,_0xc8c8('0xb'));_0x1246e3(_0x430b8e['result'][_0xc8c8('0x10')]);}})[_0xc8c8('0x11')](function(_0x2ae2dd){logger[_0xc8c8('0xd')](_0xc8c8('0xf'),_0x2bad6d,_0x2ae2dd);_0x172274(_0x2ae2dd);});});}exports[_0xc8c8('0x12')]=function(_0x4c5992){var _0x13178b=this;return new Promise(function(_0x505eac,_0x63f482){return db[_0xc8c8('0x13')][_0xc8c8('0x14')]({'raw':_0x4c5992[_0xc8c8('0x15')]?_0x4c5992[_0xc8c8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4c5992['options']?_0x4c5992['options'][_0xc8c8('0x16')]||null:null,'attributes':_0x4c5992[_0xc8c8('0x15')]?_0x4c5992['options'][_0xc8c8('0x17')]||null:null,'limit':_0x4c5992['options']?_0x4c5992[_0xc8c8('0x15')][_0xc8c8('0x18')]||null:null,'include':_0x4c5992[_0xc8c8('0x15')]?_0x4c5992[_0xc8c8('0x15')][_0xc8c8('0x19')]?_['map'](_0x4c5992['options']['include'],function(_0x15371b){return{'model':db[_0x15371b['model']],'as':_0x15371b['as'],'attributes':_0x15371b[_0xc8c8('0x17')],'include':_0x15371b[_0xc8c8('0x19')]?_[_0xc8c8('0x1a')](_0x15371b[_0xc8c8('0x19')],function(_0x5281c9){return{'model':db[_0x5281c9[_0xc8c8('0x1b')]],'as':_0x5281c9['as'],'attributes':_0x5281c9[_0xc8c8('0x17')],'include':_0x5281c9['include']?_['map'](_0x5281c9[_0xc8c8('0x19')],function(_0x151024){return{'model':db[_0x151024[_0xc8c8('0x1b')]],'as':_0x151024['as'],'attributes':_0x151024[_0xc8c8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc8c8('0x1c')](function(_0x297e34){logger[_0xc8c8('0xa')](_0xc8c8('0x12'),_0x4c5992);logger[_0xc8c8('0xc')]('GetDeskAccount',_0x4c5992,JSON[_0xc8c8('0x1d')](_0x297e34));_0x505eac(_0x297e34);})[_0xc8c8('0x11')](function(_0x4fc92f){logger[_0xc8c8('0xd')](_0xc8c8('0x12'),_0x4fc92f[_0xc8c8('0x10')],_0x4c5992);_0x63f482(_0x13178b[_0xc8c8('0xd')](0x1f4,_0x4fc92f[_0xc8c8('0x10')]));});});};exports[_0xc8c8('0x1e')]=function(_0x2d2e6e){var _0x40b04f=this;return new Promise(function(_0x286666,_0x4dd596){return db[_0xc8c8('0x13')][_0xc8c8('0x1f')]({'raw':_0x2d2e6e[_0xc8c8('0x15')]?_0x2d2e6e[_0xc8c8('0x15')][_0xc8c8('0x20')]===undefined?!![]:![]:!![],'where':_0x2d2e6e['options']?_0x2d2e6e['options'][_0xc8c8('0x16')]||null:null,'attributes':_0x2d2e6e[_0xc8c8('0x15')]?_0x2d2e6e[_0xc8c8('0x15')][_0xc8c8('0x17')]||null:null,'include':_0x2d2e6e[_0xc8c8('0x15')]?_0x2d2e6e[_0xc8c8('0x15')][_0xc8c8('0x19')]?_[_0xc8c8('0x1a')](_0x2d2e6e[_0xc8c8('0x15')][_0xc8c8('0x19')],function(_0x5164e9){return{'model':db[_0x5164e9[_0xc8c8('0x1b')]],'as':_0x5164e9['as'],'attributes':_0x5164e9[_0xc8c8('0x17')],'include':_0x5164e9[_0xc8c8('0x19')]?_[_0xc8c8('0x1a')](_0x5164e9['include'],function(_0x17b181){return{'model':db[_0x17b181[_0xc8c8('0x1b')]],'as':_0x17b181['as'],'attributes':_0x17b181['attributes'],'include':_0x17b181[_0xc8c8('0x19')]?_[_0xc8c8('0x1a')](_0x17b181['include'],function(_0x1bdc43){return{'model':db[_0x1bdc43[_0xc8c8('0x1b')]],'as':_0x1bdc43['as'],'attributes':_0x1bdc43[_0xc8c8('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50e507){logger[_0xc8c8('0xa')](_0xc8c8('0x1e'),_0x2d2e6e);logger[_0xc8c8('0xc')](_0xc8c8('0x1e'),_0x2d2e6e,JSON[_0xc8c8('0x1d')](_0x50e507));_0x286666(_0x50e507);})[_0xc8c8('0x11')](function(_0x396e2d){logger['error'](_0xc8c8('0x1e'),_0x396e2d[_0xc8c8('0x10')],_0x2d2e6e);_0x4dd596(_0x40b04f[_0xc8c8('0xd')](0x1f4,_0x396e2d['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 1cd55f9..e672345 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 _0x181c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x181c,0x161));var _0xc181=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0x181c[_0x8854f2];return _0x38505d;};'use strict';var multer=require(_0xc181('0x0'));var util=require(_0xc181('0x1'));var path=require(_0xc181('0x2'));var timeout=require(_0xc181('0x3'));var express=require(_0xc181('0x4'));var router=express[_0xc181('0x5')]();var auth=require(_0xc181('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc181('0x7'));var controller=require(_0xc181('0x8'));router[_0xc181('0x9')]('/',auth[_0xc181('0xa')](),controller[_0xc181('0xb')]);router[_0xc181('0x9')](_0xc181('0xc'),auth['isAuthenticated'](),controller[_0xc181('0xd')]);router[_0xc181('0x9')](_0xc181('0xe'),auth['isAuthenticated'](),controller[_0xc181('0xf')]);router[_0xc181('0x9')]('/:id/subjects',auth[_0xc181('0xa')](),controller['getSubjects']);router['get'](_0xc181('0x10'),auth[_0xc181('0xa')](),controller[_0xc181('0x11')]);router[_0xc181('0x9')](_0xc181('0x12'),auth['isAuthenticated'](),controller[_0xc181('0x13')]);router[_0xc181('0x14')]('/',auth[_0xc181('0xa')](),controller['create']);router[_0xc181('0x14')]('/:id/tags',auth[_0xc181('0xa')](),controller['setTags']);router[_0xc181('0x15')]('/:id',auth[_0xc181('0xa')](),controller[_0xc181('0x16')]);router['delete'](_0xc181('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xc181('0x17')]=router; \ No newline at end of file +var _0x5b3f=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update'];(function(_0x559b7b,_0x1e41dd){var _0x51e06a=function(_0x52b5d5){while(--_0x52b5d5){_0x559b7b['push'](_0x559b7b['shift']());}};_0x51e06a(++_0x1e41dd);}(_0x5b3f,0xfd));var _0xf5b3=function(_0x24e01,_0x58be5a){_0x24e01=_0x24e01-0x0;var _0x25efc6=_0x5b3f[_0x24e01];return _0x25efc6;};'use strict';var multer=require(_0xf5b3('0x0'));var util=require('util');var path=require(_0xf5b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf5b3('0x2'));var router=express[_0xf5b3('0x3')]();var auth=require(_0xf5b3('0x4'));var interaction=require(_0xf5b3('0x5'));var config=require('../../config/environment');var controller=require(_0xf5b3('0x6'));router[_0xf5b3('0x7')]('/',auth[_0xf5b3('0x8')](),controller[_0xf5b3('0x9')]);router['get'](_0xf5b3('0xa'),auth[_0xf5b3('0x8')](),controller[_0xf5b3('0xb')]);router[_0xf5b3('0x7')](_0xf5b3('0xc'),auth[_0xf5b3('0x8')](),controller[_0xf5b3('0xd')]);router[_0xf5b3('0x7')]('/:id/subjects',auth[_0xf5b3('0x8')](),controller['getSubjects']);router[_0xf5b3('0x7')](_0xf5b3('0xe'),auth[_0xf5b3('0x8')](),controller[_0xf5b3('0xf')]);router[_0xf5b3('0x7')](_0xf5b3('0x10'),auth[_0xf5b3('0x8')](),controller[_0xf5b3('0x11')]);router['post']('/',auth[_0xf5b3('0x8')](),controller['create']);router[_0xf5b3('0x12')](_0xf5b3('0x10'),auth[_0xf5b3('0x8')](),controller[_0xf5b3('0x13')]);router[_0xf5b3('0x14')](_0xf5b3('0xa'),auth[_0xf5b3('0x8')](),controller[_0xf5b3('0x15')]);router[_0xf5b3('0x16')](_0xf5b3('0xa'),auth['isAuthenticated'](),controller[_0xf5b3('0x17')]);module[_0xf5b3('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 0ed0303..56a34a4 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 _0x9b8d=['sequelize','exports','STRING'];(function(_0x25128e,_0x1eea25){var _0x1b196e=function(_0x131c26){while(--_0x131c26){_0x25128e['push'](_0x25128e['shift']());}};_0x1b196e(++_0x1eea25);}(_0x9b8d,0x189));var _0xd9b8=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x9b8d[_0xa79977];return _0x109f10;};'use strict';var Sequelize=require(_0xd9b8('0x0'));module[_0xd9b8('0x1')]={'name':{'type':Sequelize[_0xd9b8('0x2')]},'description':{'type':Sequelize[_0xd9b8('0x2')]}}; \ No newline at end of file +var _0xa2e5=['STRING','exports'];(function(_0x4db8d9,_0x100e73){var _0x1e1a49=function(_0x292d49){while(--_0x292d49){_0x4db8d9['push'](_0x4db8d9['shift']());}};_0x1e1a49(++_0x100e73);}(_0xa2e5,0x16b));var _0x5a2e=function(_0x3e9347,_0x2298b4){_0x3e9347=_0x3e9347-0x0;var _0x52501c=_0xa2e5[_0x3e9347];return _0x52501c;};'use strict';var Sequelize=require('sequelize');module[_0x5a2e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5a2e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 23b4304..46e2d08 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 _0xee11=['status','json','offset','limit','apply','save','then','stack','name','send','index','DeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','key','VIRTUAL','field','count','includeAll','include','findAll','rows','show','params','options','find','create','body','update','destroy','getFields','findOne','DeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end'];(function(_0x3c6ba7,_0x73de6e){var _0x33cb07=function(_0x46761c){while(--_0x46761c){_0x3c6ba7['push'](_0x3c6ba7['shift']());}};_0x33cb07(++_0x73de6e);}(_0xee11,0x146));var _0x1ee1=function(_0x19fbdc,_0x2e1d6a){_0x19fbdc=_0x19fbdc-0x0;var _0x176533=_0xee11[_0x19fbdc];return _0x176533;};'use strict';var pdf=require(_0x1ee1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1ee1('0x1'));var jsonpatch=require(_0x1ee1('0x2'));var rp=require(_0x1ee1('0x3'));var moment=require(_0x1ee1('0x4'));var BPromise=require(_0x1ee1('0x5'));var Mustache=require(_0x1ee1('0x6'));var util=require(_0x1ee1('0x7'));var path=require(_0x1ee1('0x8'));var sox=require('sox');var csv=require(_0x1ee1('0x9'));var ejs=require(_0x1ee1('0xa'));var fs=require('fs');var _=require(_0x1ee1('0xb'));var squel=require(_0x1ee1('0xc'));var crypto=require(_0x1ee1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ee1('0x9'));var querystring=require(_0x1ee1('0xe'));var Papa=require(_0x1ee1('0xf'));var Redis=require(_0x1ee1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1ee1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ee1('0x12'))(_0x1ee1('0x13'));var utils=require(_0x1ee1('0x14'));var config=require(_0x1ee1('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1ee1('0x16'));var client=jayson[_0x1ee1('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x35d97c,_0xc2b64e,_0x97cc85){if(_0x97cc85){var _0x33ab2a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33ab2a[_0x1ee1('0x18')](_0xc2b64e)){return _0x35d97c;}else{throw new Error(_0x1ee1('0x19'));}}else{return _0x35d97c;}}function respondWithRpcPromise(_0x1a23e4,_0xbc8577,_0x2f4c8d,_0x189191){return new BPromise(function(_0x2bc943,_0x443dff){var _0x3c64f1=_0x189191||client;return _0x3c64f1[_0x1ee1('0x1a')](_0x1a23e4,_0x2f4c8d)['then'](function(_0x4f4d55){logger[_0x1ee1('0x1b')](_0x1ee1('0x1c'),_0xbc8577,_0x1ee1('0x1d'));logger[_0x1ee1('0x1e')](_0x1ee1('0x1f'),_0xbc8577,_0x1ee1('0x1d'),JSON['stringify'](_0x4f4d55));if(_0x4f4d55[_0x1ee1('0x20')]){if(_0x4f4d55[_0x1ee1('0x20')]['code']===0x1f4){logger[_0x1ee1('0x20')](_0x1ee1('0x1c'),_0xbc8577,_0x4f4d55['error']['message']);return _0x443dff(_0x4f4d55[_0x1ee1('0x20')][_0x1ee1('0x21')]);}logger[_0x1ee1('0x20')](_0x1ee1('0x1c'),_0xbc8577,_0x4f4d55['error'][_0x1ee1('0x21')]);return _0x2bc943(_0x4f4d55[_0x1ee1('0x20')][_0x1ee1('0x21')]);}else{logger['info'](_0x1ee1('0x1c'),_0xbc8577,_0x1ee1('0x1d'));_0x2bc943(_0x4f4d55[_0x1ee1('0x22')][_0x1ee1('0x21')]);}})[_0x1ee1('0x23')](function(_0x353542){logger['error'](_0x1ee1('0x1c'),_0xbc8577,_0x353542);_0x443dff(_0x353542);});});}function respondWithStatusCode(_0x5d1948,_0x4932cd){_0x4932cd=_0x4932cd||0xcc;return function(_0x1d9974){if(_0x1d9974){return _0x5d1948[_0x1ee1('0x24')](_0x4932cd);}return _0x5d1948['status'](_0x4932cd)[_0x1ee1('0x25')]();};}function respondWithResult(_0x1a90b3,_0x1036f5){_0x1036f5=_0x1036f5||0xc8;return function(_0x31ede7){if(_0x31ede7){return _0x1a90b3[_0x1ee1('0x26')](_0x1036f5)[_0x1ee1('0x27')](_0x31ede7);}};}function respondWithFilteredResult(_0x56a1e3,_0x14f388){return function(_0x8a95d8){if(_0x8a95d8){var _0x1784b4=_0x8a95d8['count'],_0x11ce8d=_0x14f388[_0x1ee1('0x28')],_0x3d0ffc=_0x14f388['offset']+_0x14f388[_0x1ee1('0x29')],_0x1a2246;if(_0x3d0ffc>=_0x1784b4){_0x3d0ffc=_0x1784b4;_0x1a2246=0xc8;}else{_0x1a2246=0xce;}_0x56a1e3[_0x1ee1('0x26')](_0x1a2246);return _0x56a1e3['set']('Content-Range',_0x11ce8d+'-'+_0x3d0ffc+'/'+_0x1784b4)[_0x1ee1('0x27')](_0x8a95d8);}return null;};}function patchUpdates(_0xfd544d){return function(_0xf63d67){try{jsonpatch[_0x1ee1('0x2a')](_0xf63d67,_0xfd544d,!![]);}catch(_0x49241e){return BPromise['reject'](_0x49241e);}return _0xf63d67[_0x1ee1('0x2b')]();};}function saveUpdates(_0x3a612f,_0xf0dd37){return function(_0x3153b6){if(_0x3153b6){return _0x3153b6['update'](_0x3a612f)['then'](function(_0x100e42){return _0x100e42;});}return null;};}function removeEntity(_0x4e782d,_0x25fb77){return function(_0x2a6883){if(_0x2a6883){return _0x2a6883['destroy']()[_0x1ee1('0x2c')](function(){_0x4e782d['status'](0xcc)[_0x1ee1('0x25')]();});}};}function handleEntityNotFound(_0x4866a9,_0x285110){return function(_0x48a147){if(!_0x48a147){_0x4866a9[_0x1ee1('0x24')](0x194);}return _0x48a147;};}function handleError(_0x139118,_0x513124){_0x513124=_0x513124||0x1f4;return function(_0x4cc56e){logger[_0x1ee1('0x20')](_0x4cc56e[_0x1ee1('0x2d')]);if(_0x4cc56e['name']){delete _0x4cc56e[_0x1ee1('0x2e')];}_0x139118[_0x1ee1('0x26')](_0x513124)[_0x1ee1('0x2f')](_0x4cc56e);};}exports[_0x1ee1('0x30')]=function(_0x40964d,_0x71f867){var _0x1f5afc={},_0x29011b={},_0x24ca9e={'count':0x0,'rows':[]};var _0xb651ba=db[_0x1ee1('0x31')][_0x1ee1('0x32')];_0x29011b[_0x1ee1('0x33')]=_[_0x1ee1('0x34')](_0xb651ba);_0x29011b[_0x1ee1('0x35')]=_[_0x1ee1('0x34')](_0x40964d[_0x1ee1('0x35')]);_0x29011b[_0x1ee1('0x36')]=_[_0x1ee1('0x37')](_0x29011b[_0x1ee1('0x33')],_0x29011b[_0x1ee1('0x35')]);_0x1f5afc[_0x1ee1('0x38')]=_['intersection'](_0x29011b[_0x1ee1('0x33')],qs[_0x1ee1('0x39')](_0x40964d[_0x1ee1('0x35')][_0x1ee1('0x39')]));_0x1f5afc[_0x1ee1('0x38')]=_0x1f5afc[_0x1ee1('0x38')][_0x1ee1('0x3a')]?_0x1f5afc[_0x1ee1('0x38')]:_0x29011b[_0x1ee1('0x33')];if(!_0x40964d[_0x1ee1('0x35')][_0x1ee1('0x3b')](_0x1ee1('0x3c'))){_0x1f5afc['limit']=qs[_0x1ee1('0x29')](_0x40964d[_0x1ee1('0x35')][_0x1ee1('0x29')]);_0x1f5afc[_0x1ee1('0x28')]=qs[_0x1ee1('0x28')](_0x40964d[_0x1ee1('0x35')][_0x1ee1('0x28')]);}_0x1f5afc['order']=qs[_0x1ee1('0x3d')](_0x40964d[_0x1ee1('0x35')]['sort']);_0x1f5afc[_0x1ee1('0x3e')]=qs['filters'](_['pick'](_0x40964d[_0x1ee1('0x35')],_0x29011b[_0x1ee1('0x36')]));if(_0x40964d['query'][_0x1ee1('0x3f')]){_0x1f5afc[_0x1ee1('0x3e')]=_[_0x1ee1('0x40')](_0x1f5afc[_0x1ee1('0x3e')],{'$or':_[_0x1ee1('0x41')](_0xb651ba,function(_0x5301c3){if(_0x5301c3['type'][_0x1ee1('0x42')]!==_0x1ee1('0x43')){var _0x2d8494={};_0x2d8494[_0x5301c3[_0x1ee1('0x44')]]={'$like':'%'+_0x40964d[_0x1ee1('0x35')][_0x1ee1('0x3f')]+'%'};return _0x2d8494;}})});}_0x1f5afc=_[_0x1ee1('0x40')]({},_0x1f5afc,_0x40964d['options']);var _0x1dc129={'where':_0x1f5afc['where']};return db[_0x1ee1('0x31')][_0x1ee1('0x45')](_0x1dc129)[_0x1ee1('0x2c')](function(_0x4001a3){_0x24ca9e[_0x1ee1('0x45')]=_0x4001a3;if(_0x40964d[_0x1ee1('0x35')][_0x1ee1('0x46')]){_0x1f5afc[_0x1ee1('0x47')]=[{'all':!![]}];}return db[_0x1ee1('0x31')][_0x1ee1('0x48')](_0x1f5afc);})['then'](function(_0x1cb9c0){_0x24ca9e[_0x1ee1('0x49')]=_0x1cb9c0;return _0x24ca9e;})[_0x1ee1('0x2c')](respondWithFilteredResult(_0x71f867,_0x1f5afc))['catch'](handleError(_0x71f867,null));};exports[_0x1ee1('0x4a')]=function(_0x81fe7e,_0x2112ae){var _0x4f965d={'raw':![],'where':{'id':_0x81fe7e[_0x1ee1('0x4b')]['id']}},_0x8214cd={};_0x8214cd[_0x1ee1('0x33')]=_[_0x1ee1('0x34')](db['DeskConfiguration'][_0x1ee1('0x32')]);_0x8214cd[_0x1ee1('0x35')]=_[_0x1ee1('0x34')](_0x81fe7e[_0x1ee1('0x35')]);_0x8214cd['filters']=_['intersection'](_0x8214cd[_0x1ee1('0x33')],_0x8214cd[_0x1ee1('0x35')]);_0x4f965d[_0x1ee1('0x38')]=_[_0x1ee1('0x37')](_0x8214cd['model'],qs[_0x1ee1('0x39')](_0x81fe7e[_0x1ee1('0x35')]['fields']));_0x4f965d[_0x1ee1('0x38')]=_0x4f965d[_0x1ee1('0x38')][_0x1ee1('0x3a')]?_0x4f965d[_0x1ee1('0x38')]:_0x8214cd[_0x1ee1('0x33')];if(_0x81fe7e[_0x1ee1('0x35')]['includeAll']){_0x4f965d[_0x1ee1('0x47')]=[{'all':!![]}];}_0x4f965d=_[_0x1ee1('0x40')]({},_0x4f965d,_0x81fe7e[_0x1ee1('0x4c')]);return db[_0x1ee1('0x31')][_0x1ee1('0x4d')](_0x4f965d)[_0x1ee1('0x2c')](handleEntityNotFound(_0x2112ae,null))['then'](respondWithResult(_0x2112ae,null))['catch'](handleError(_0x2112ae,null));};exports[_0x1ee1('0x4e')]=function(_0xe93945,_0x5627ef){return db['DeskConfiguration'][_0x1ee1('0x4e')](_0xe93945[_0x1ee1('0x4f')],{})[_0x1ee1('0x2c')](respondWithResult(_0x5627ef,0xc9))['catch'](handleError(_0x5627ef,null));};exports[_0x1ee1('0x50')]=function(_0x1f0b6b,_0x1ddc4b){if(_0x1f0b6b[_0x1ee1('0x4f')]['id']){delete _0x1f0b6b[_0x1ee1('0x4f')]['id'];}return db[_0x1ee1('0x31')][_0x1ee1('0x4d')]({'where':{'id':_0x1f0b6b[_0x1ee1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ddc4b,null))['then'](saveUpdates(_0x1f0b6b[_0x1ee1('0x4f')],null))['then'](respondWithResult(_0x1ddc4b,null))['catch'](handleError(_0x1ddc4b,null));};exports[_0x1ee1('0x51')]=function(_0x4822c2,_0x4fdfa7){return db[_0x1ee1('0x31')][_0x1ee1('0x4d')]({'where':{'id':_0x4822c2['params']['id']}})[_0x1ee1('0x2c')](handleEntityNotFound(_0x4fdfa7,null))['then'](removeEntity(_0x4fdfa7,null))[_0x1ee1('0x23')](handleError(_0x4fdfa7,null));};exports[_0x1ee1('0x52')]=function(_0x5110fd,_0x117f90,_0xc837b7){var _0x2abf4f={};var _0x231410={};var _0xf6499d;var _0x2bb3ca;return db[_0x1ee1('0x31')][_0x1ee1('0x53')]({'where':{'id':_0x5110fd[_0x1ee1('0x4b')]['id']}})[_0x1ee1('0x2c')](handleEntityNotFound(_0x117f90,null))[_0x1ee1('0x2c')](function(_0x3f5d6b){if(_0x3f5d6b){_0xf6499d=_0x3f5d6b;_0x231410['model']=_[_0x1ee1('0x34')](db[_0x1ee1('0x54')]['rawAttributes']);_0x231410['query']=_[_0x1ee1('0x34')](_0x5110fd[_0x1ee1('0x35')]);_0x231410['filters']=_[_0x1ee1('0x37')](_0x231410['model'],_0x231410[_0x1ee1('0x35')]);_0x2abf4f[_0x1ee1('0x38')]=_[_0x1ee1('0x37')](_0x231410[_0x1ee1('0x33')],qs[_0x1ee1('0x39')](_0x5110fd[_0x1ee1('0x35')]['fields']));_0x2abf4f[_0x1ee1('0x38')]=_0x2abf4f['attributes'][_0x1ee1('0x3a')]?_0x2abf4f[_0x1ee1('0x38')]:_0x231410[_0x1ee1('0x33')];_0x2abf4f[_0x1ee1('0x55')]=qs[_0x1ee1('0x3d')](_0x5110fd[_0x1ee1('0x35')][_0x1ee1('0x3d')]);_0x2abf4f[_0x1ee1('0x3e')]=qs[_0x1ee1('0x36')](_['pick'](_0x5110fd[_0x1ee1('0x35')],_0x231410[_0x1ee1('0x36')]));if(_0x5110fd[_0x1ee1('0x35')]['filter']){_0x2abf4f[_0x1ee1('0x3e')]=_[_0x1ee1('0x40')](_0x2abf4f[_0x1ee1('0x3e')],{'$or':_[_0x1ee1('0x41')](_0x2abf4f[_0x1ee1('0x38')],function(_0x169693){var _0x2af459={};_0x2af459[_0x169693]={'$like':'%'+_0x5110fd[_0x1ee1('0x35')][_0x1ee1('0x3f')]+'%'};return _0x2af459;})});}_0x2abf4f=_[_0x1ee1('0x40')]({},_0x2abf4f,_0x5110fd[_0x1ee1('0x4c')]);return _0xf6499d['getFields'](_0x2abf4f);}})['then'](function(_0x194a05){if(_0x194a05){_0x2bb3ca=_0x194a05['length'];if(!_0x5110fd['query'][_0x1ee1('0x3b')](_0x1ee1('0x3c'))){_0x2abf4f['limit']=qs['limit'](_0x5110fd[_0x1ee1('0x35')][_0x1ee1('0x29')]);_0x2abf4f[_0x1ee1('0x28')]=qs[_0x1ee1('0x28')](_0x5110fd[_0x1ee1('0x35')][_0x1ee1('0x28')]);}return _0xf6499d['getFields'](_0x2abf4f);}})[_0x1ee1('0x2c')](function(_0x180241){if(_0x180241){return _0x180241?{'count':_0x2bb3ca,'rows':_0x180241}:null;}})[_0x1ee1('0x2c')](respondWithResult(_0x117f90,null))[_0x1ee1('0x23')](handleError(_0x117f90,null));};exports[_0x1ee1('0x56')]=function(_0x574e85,_0x247674,_0x1efd22){var _0x5e51ec={};var _0x321eac={};var _0x56474e;var _0x14de7c;return db[_0x1ee1('0x31')]['findOne']({'where':{'id':_0x574e85['params']['id']}})[_0x1ee1('0x2c')](handleEntityNotFound(_0x247674,null))[_0x1ee1('0x2c')](function(_0x377688){if(_0x377688){_0x56474e=_0x377688;_0x321eac[_0x1ee1('0x33')]=_[_0x1ee1('0x34')](db[_0x1ee1('0x54')][_0x1ee1('0x32')]);_0x321eac['query']=_['keys'](_0x574e85[_0x1ee1('0x35')]);_0x321eac[_0x1ee1('0x36')]=_['intersection'](_0x321eac[_0x1ee1('0x33')],_0x321eac['query']);_0x5e51ec[_0x1ee1('0x38')]=_[_0x1ee1('0x37')](_0x321eac[_0x1ee1('0x33')],qs[_0x1ee1('0x39')](_0x574e85[_0x1ee1('0x35')]['fields']));_0x5e51ec[_0x1ee1('0x38')]=_0x5e51ec[_0x1ee1('0x38')][_0x1ee1('0x3a')]?_0x5e51ec[_0x1ee1('0x38')]:_0x321eac[_0x1ee1('0x33')];_0x5e51ec[_0x1ee1('0x55')]=qs['sort'](_0x574e85[_0x1ee1('0x35')]['sort']);_0x5e51ec[_0x1ee1('0x3e')]=qs[_0x1ee1('0x36')](_['pick'](_0x574e85['query'],_0x321eac[_0x1ee1('0x36')]));if(_0x574e85[_0x1ee1('0x35')][_0x1ee1('0x3f')]){_0x5e51ec[_0x1ee1('0x3e')]=_[_0x1ee1('0x40')](_0x5e51ec[_0x1ee1('0x3e')],{'$or':_[_0x1ee1('0x41')](_0x5e51ec[_0x1ee1('0x38')],function(_0x205592){var _0x3dee6b={};_0x3dee6b[_0x205592]={'$like':'%'+_0x574e85[_0x1ee1('0x35')][_0x1ee1('0x3f')]+'%'};return _0x3dee6b;})});}_0x5e51ec=_[_0x1ee1('0x40')]({},_0x5e51ec,_0x574e85[_0x1ee1('0x4c')]);return _0x56474e[_0x1ee1('0x56')](_0x5e51ec);}})[_0x1ee1('0x2c')](function(_0x33625a){if(_0x33625a){_0x14de7c=_0x33625a[_0x1ee1('0x3a')];if(!_0x574e85[_0x1ee1('0x35')]['hasOwnProperty'](_0x1ee1('0x3c'))){_0x5e51ec[_0x1ee1('0x29')]=qs[_0x1ee1('0x29')](_0x574e85[_0x1ee1('0x35')]['limit']);_0x5e51ec['offset']=qs[_0x1ee1('0x28')](_0x574e85['query'][_0x1ee1('0x28')]);}return _0x56474e[_0x1ee1('0x56')](_0x5e51ec);}})[_0x1ee1('0x2c')](function(_0x16a52a){if(_0x16a52a){return _0x16a52a?{'count':_0x14de7c,'rows':_0x16a52a}:null;}})[_0x1ee1('0x2c')](respondWithResult(_0x247674,null))[_0x1ee1('0x23')](handleError(_0x247674,null));};exports[_0x1ee1('0x57')]=function(_0x511415,_0x28d428,_0x303c9a){var _0x43b35e={};var _0x15a415={};var _0x4e9635;var _0x4ce51b;return db[_0x1ee1('0x31')][_0x1ee1('0x53')]({'where':{'id':_0x511415[_0x1ee1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28d428,null))['then'](function(_0xa3a6f5){if(_0xa3a6f5){_0x4e9635=_0xa3a6f5;_0x15a415[_0x1ee1('0x33')]=_[_0x1ee1('0x34')](db['DeskField'][_0x1ee1('0x32')]);_0x15a415['query']=_[_0x1ee1('0x34')](_0x511415['query']);_0x15a415[_0x1ee1('0x36')]=_[_0x1ee1('0x37')](_0x15a415[_0x1ee1('0x33')],_0x15a415[_0x1ee1('0x35')]);_0x43b35e[_0x1ee1('0x38')]=_[_0x1ee1('0x37')](_0x15a415[_0x1ee1('0x33')],qs[_0x1ee1('0x39')](_0x511415['query'][_0x1ee1('0x39')]));_0x43b35e[_0x1ee1('0x38')]=_0x43b35e[_0x1ee1('0x38')][_0x1ee1('0x3a')]?_0x43b35e[_0x1ee1('0x38')]:_0x15a415[_0x1ee1('0x33')];_0x43b35e[_0x1ee1('0x55')]=qs[_0x1ee1('0x3d')](_0x511415[_0x1ee1('0x35')][_0x1ee1('0x3d')]);_0x43b35e[_0x1ee1('0x3e')]=qs[_0x1ee1('0x36')](_['pick'](_0x511415[_0x1ee1('0x35')],_0x15a415[_0x1ee1('0x36')]));if(_0x511415[_0x1ee1('0x35')]['filter']){_0x43b35e[_0x1ee1('0x3e')]=_[_0x1ee1('0x40')](_0x43b35e[_0x1ee1('0x3e')],{'$or':_[_0x1ee1('0x41')](_0x43b35e[_0x1ee1('0x38')],function(_0x1b446e){var _0x1c1037={};_0x1c1037[_0x1b446e]={'$like':'%'+_0x511415[_0x1ee1('0x35')][_0x1ee1('0x3f')]+'%'};return _0x1c1037;})});}_0x43b35e=_[_0x1ee1('0x40')]({},_0x43b35e,_0x511415[_0x1ee1('0x4c')]);return _0x4e9635[_0x1ee1('0x57')](_0x43b35e);}})[_0x1ee1('0x2c')](function(_0x26e4dc){if(_0x26e4dc){_0x4ce51b=_0x26e4dc[_0x1ee1('0x3a')];if(!_0x511415[_0x1ee1('0x35')][_0x1ee1('0x3b')](_0x1ee1('0x3c'))){_0x43b35e[_0x1ee1('0x29')]=qs[_0x1ee1('0x29')](_0x511415['query'][_0x1ee1('0x29')]);_0x43b35e[_0x1ee1('0x28')]=qs[_0x1ee1('0x28')](_0x511415[_0x1ee1('0x35')][_0x1ee1('0x28')]);}return _0x4e9635[_0x1ee1('0x57')](_0x43b35e);}})[_0x1ee1('0x2c')](function(_0x543fbc){if(_0x543fbc){return _0x543fbc?{'count':_0x4ce51b,'rows':_0x543fbc}:null;}})[_0x1ee1('0x2c')](respondWithResult(_0x28d428,null))[_0x1ee1('0x23')](handleError(_0x28d428,null));};exports['getTags']=function(_0x19030c,_0x466569,_0x2b1180){var _0x535666={};var _0x3526ff={};var _0x4ba56b;var _0xe46376;return db['DeskConfiguration']['findOne']({'where':{'id':_0x19030c[_0x1ee1('0x4b')]['id']}})[_0x1ee1('0x2c')](handleEntityNotFound(_0x466569,null))[_0x1ee1('0x2c')](function(_0x291dd6){if(_0x291dd6){_0x4ba56b=_0x291dd6;_0x3526ff[_0x1ee1('0x33')]=_['keys'](db[_0x1ee1('0x58')][_0x1ee1('0x32')]);_0x3526ff['query']=_[_0x1ee1('0x34')](_0x19030c['query']);_0x3526ff[_0x1ee1('0x36')]=_[_0x1ee1('0x37')](_0x3526ff[_0x1ee1('0x33')],_0x3526ff[_0x1ee1('0x35')]);_0x535666['attributes']=_[_0x1ee1('0x37')](_0x3526ff[_0x1ee1('0x33')],qs[_0x1ee1('0x39')](_0x19030c[_0x1ee1('0x35')][_0x1ee1('0x39')]));_0x535666[_0x1ee1('0x38')]=_0x535666[_0x1ee1('0x38')][_0x1ee1('0x3a')]?_0x535666[_0x1ee1('0x38')]:_0x3526ff[_0x1ee1('0x33')];_0x535666[_0x1ee1('0x55')]=qs[_0x1ee1('0x3d')](_0x19030c[_0x1ee1('0x35')]['sort']);_0x535666[_0x1ee1('0x3e')]=qs[_0x1ee1('0x36')](_['pick'](_0x19030c[_0x1ee1('0x35')],_0x3526ff[_0x1ee1('0x36')]));if(_0x19030c[_0x1ee1('0x35')][_0x1ee1('0x3f')]){_0x535666[_0x1ee1('0x3e')]=_['merge'](_0x535666[_0x1ee1('0x3e')],{'$or':_[_0x1ee1('0x41')](_0x535666[_0x1ee1('0x38')],function(_0x5c3b6f){var _0x55030c={};_0x55030c[_0x5c3b6f]={'$like':'%'+_0x19030c['query'][_0x1ee1('0x3f')]+'%'};return _0x55030c;})});}_0x535666=_[_0x1ee1('0x40')]({},_0x535666,_0x19030c[_0x1ee1('0x4c')]);return _0x4ba56b['getTags'](_0x535666);}})[_0x1ee1('0x2c')](function(_0x5080db){if(_0x5080db){_0xe46376=_0x5080db[_0x1ee1('0x3a')];if(!_0x19030c['query'][_0x1ee1('0x3b')](_0x1ee1('0x3c'))){_0x535666['limit']=qs[_0x1ee1('0x29')](_0x19030c['query'][_0x1ee1('0x29')]);_0x535666[_0x1ee1('0x28')]=qs[_0x1ee1('0x28')](_0x19030c[_0x1ee1('0x35')][_0x1ee1('0x28')]);}return _0x4ba56b[_0x1ee1('0x59')](_0x535666);}})['then'](function(_0x21d6de){if(_0x21d6de){return _0x21d6de?{'count':_0xe46376,'rows':_0x21d6de}:null;}})[_0x1ee1('0x2c')](respondWithResult(_0x466569,null))['catch'](handleError(_0x466569,null));};exports[_0x1ee1('0x5a')]=function(_0x53c83e,_0x181d61,_0x120c1a){if(_0x53c83e['body']['id']){delete _0x53c83e[_0x1ee1('0x4f')]['id'];}return db[_0x1ee1('0x31')]['findOne']({'where':{'id':_0x53c83e[_0x1ee1('0x4b')]['id']}})[_0x1ee1('0x2c')](handleEntityNotFound(_0x181d61,null))[_0x1ee1('0x2c')](function(_0x18bc3d){if(_0x18bc3d){return _0x18bc3d[_0x1ee1('0x5a')](_0x53c83e['body']['ids']||[]);}return null;})[_0x1ee1('0x2c')](respondWithResult(_0x181d61,null))[_0x1ee1('0x23')](handleError(_0x181d61,null));}; \ No newline at end of file +var _0x6ce9=['type','key','field','count','include','findAll','rows','catch','params','intersection','includeAll','options','find','create','body','getFields','findOne','hasOwnProperty','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','DeskConfiguration','rawAttributes','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6ce9,0x76));var _0x96ce=function(_0x5221ee,_0x14b548){_0x5221ee=_0x5221ee-0x0;var _0x5d95df=_0x6ce9[_0x5221ee];return _0x5d95df;};'use strict';var pdf=require(_0x96ce('0x0'));var emlformat=require(_0x96ce('0x1'));var rimraf=require(_0x96ce('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x96ce('0x3'));var moment=require('moment');var BPromise=require(_0x96ce('0x4'));var Mustache=require(_0x96ce('0x5'));var util=require(_0x96ce('0x6'));var path=require(_0x96ce('0x7'));var sox=require('sox');var csv=require(_0x96ce('0x8'));var ejs=require(_0x96ce('0x9'));var fs=require('fs');var _=require(_0x96ce('0xa'));var squel=require('squel');var crypto=require(_0x96ce('0xb'));var jsforce=require(_0x96ce('0xc'));var deskjs=require(_0x96ce('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96ce('0xe'));var Redis=require(_0x96ce('0xf'));var authService=require(_0x96ce('0x10'));var qs=require(_0x96ce('0x11'));var hardwareService=require(_0x96ce('0x12'));var logger=require(_0x96ce('0x13'))(_0x96ce('0x14'));var utils=require(_0x96ce('0x15'));var config=require(_0x96ce('0x16'));var db=require(_0x96ce('0x17'))['db'];var jayson=require(_0x96ce('0x18'));var client=jayson['client'][_0x96ce('0x19')]({'port':0x232a});function checkPasswordPattern(_0xb2a714,_0xa3c20e,_0x4e24e2){if(_0x4e24e2){var _0x1743b3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1743b3[_0x96ce('0x1a')](_0xa3c20e)){return _0xb2a714;}else{throw new Error(_0x96ce('0x1b'));}}else{return _0xb2a714;}}function respondWithRpcPromise(_0x715161,_0x402431,_0x79e56d,_0x36d501){return new BPromise(function(_0x3d46d1,_0x329d7a){var _0xc3f97f=_0x36d501||client;return _0xc3f97f[_0x96ce('0x1c')](_0x715161,_0x79e56d)[_0x96ce('0x1d')](function(_0x2ee4b9){logger[_0x96ce('0x1e')](_0x96ce('0x1f'),_0x402431,'request\x20sent');logger['debug'](_0x96ce('0x20'),_0x402431,_0x96ce('0x21'),JSON[_0x96ce('0x22')](_0x2ee4b9));if(_0x2ee4b9[_0x96ce('0x23')]){if(_0x2ee4b9[_0x96ce('0x23')][_0x96ce('0x24')]===0x1f4){logger[_0x96ce('0x23')](_0x96ce('0x1f'),_0x402431,_0x2ee4b9[_0x96ce('0x23')][_0x96ce('0x25')]);return _0x329d7a(_0x2ee4b9['error'][_0x96ce('0x25')]);}logger[_0x96ce('0x23')](_0x96ce('0x1f'),_0x402431,_0x2ee4b9[_0x96ce('0x23')][_0x96ce('0x25')]);return _0x3d46d1(_0x2ee4b9[_0x96ce('0x23')][_0x96ce('0x25')]);}else{logger['info'](_0x96ce('0x1f'),_0x402431,_0x96ce('0x21'));_0x3d46d1(_0x2ee4b9[_0x96ce('0x26')]['message']);}})['catch'](function(_0x58196f){logger['error'](_0x96ce('0x1f'),_0x402431,_0x58196f);_0x329d7a(_0x58196f);});});}function respondWithStatusCode(_0x9dc88b,_0xa703d){_0xa703d=_0xa703d||0xcc;return function(_0x2c969c){if(_0x2c969c){return _0x9dc88b['sendStatus'](_0xa703d);}return _0x9dc88b[_0x96ce('0x27')](_0xa703d)[_0x96ce('0x28')]();};}function respondWithResult(_0x2426fa,_0x5c8e2b){_0x5c8e2b=_0x5c8e2b||0xc8;return function(_0x45d90e){if(_0x45d90e){return _0x2426fa[_0x96ce('0x27')](_0x5c8e2b)[_0x96ce('0x29')](_0x45d90e);}};}function respondWithFilteredResult(_0x25c309,_0x1672b7){return function(_0x558b93){if(_0x558b93){var _0x31b51b=_0x558b93['count'],_0x4276e0=_0x1672b7[_0x96ce('0x2a')],_0x174c2e=_0x1672b7[_0x96ce('0x2a')]+_0x1672b7[_0x96ce('0x2b')],_0x131073;if(_0x174c2e>=_0x31b51b){_0x174c2e=_0x31b51b;_0x131073=0xc8;}else{_0x131073=0xce;}_0x25c309['status'](_0x131073);return _0x25c309[_0x96ce('0x2c')](_0x96ce('0x2d'),_0x4276e0+'-'+_0x174c2e+'/'+_0x31b51b)[_0x96ce('0x29')](_0x558b93);}return null;};}function patchUpdates(_0x402ce0){return function(_0xb4eba9){try{jsonpatch[_0x96ce('0x2e')](_0xb4eba9,_0x402ce0,!![]);}catch(_0x4aaed8){return BPromise[_0x96ce('0x2f')](_0x4aaed8);}return _0xb4eba9[_0x96ce('0x30')]();};}function saveUpdates(_0x4a1e3e,_0x2c6ea8){return function(_0xb3ab57){if(_0xb3ab57){return _0xb3ab57[_0x96ce('0x31')](_0x4a1e3e)[_0x96ce('0x1d')](function(_0x3cd83a){return _0x3cd83a;});}return null;};}function removeEntity(_0x440970,_0xd6ef1){return function(_0x4fe787){if(_0x4fe787){return _0x4fe787[_0x96ce('0x32')]()[_0x96ce('0x1d')](function(){_0x440970[_0x96ce('0x27')](0xcc)[_0x96ce('0x28')]();});}};}function handleEntityNotFound(_0x2d0d48,_0x2cc2f5){return function(_0x25a81c){if(!_0x25a81c){_0x2d0d48[_0x96ce('0x33')](0x194);}return _0x25a81c;};}function handleError(_0x3842f9,_0x6c0cdc){_0x6c0cdc=_0x6c0cdc||0x1f4;return function(_0x11ca5b){logger[_0x96ce('0x23')](_0x11ca5b['stack']);if(_0x11ca5b[_0x96ce('0x34')]){delete _0x11ca5b[_0x96ce('0x34')];}_0x3842f9[_0x96ce('0x27')](_0x6c0cdc)['send'](_0x11ca5b);};}exports['index']=function(_0x39ba23,_0xa7169a){var _0x465f0e={},_0x584943={},_0x27cd5c={'count':0x0,'rows':[]};var _0x167924=db[_0x96ce('0x35')][_0x96ce('0x36')];_0x584943[_0x96ce('0x37')]=_['keys'](_0x167924);_0x584943[_0x96ce('0x38')]=_[_0x96ce('0x39')](_0x39ba23[_0x96ce('0x38')]);_0x584943[_0x96ce('0x3a')]=_['intersection'](_0x584943[_0x96ce('0x37')],_0x584943[_0x96ce('0x38')]);_0x465f0e[_0x96ce('0x3b')]=_['intersection'](_0x584943[_0x96ce('0x37')],qs[_0x96ce('0x3c')](_0x39ba23['query'][_0x96ce('0x3c')]));_0x465f0e[_0x96ce('0x3b')]=_0x465f0e[_0x96ce('0x3b')][_0x96ce('0x3d')]?_0x465f0e['attributes']:_0x584943['model'];if(!_0x39ba23[_0x96ce('0x38')]['hasOwnProperty'](_0x96ce('0x3e'))){_0x465f0e[_0x96ce('0x2b')]=qs['limit'](_0x39ba23[_0x96ce('0x38')][_0x96ce('0x2b')]);_0x465f0e['offset']=qs[_0x96ce('0x2a')](_0x39ba23[_0x96ce('0x38')][_0x96ce('0x2a')]);}_0x465f0e[_0x96ce('0x3f')]=qs['sort'](_0x39ba23[_0x96ce('0x38')][_0x96ce('0x40')]);_0x465f0e[_0x96ce('0x41')]=qs[_0x96ce('0x3a')](_[_0x96ce('0x42')](_0x39ba23[_0x96ce('0x38')],_0x584943[_0x96ce('0x3a')]));if(_0x39ba23[_0x96ce('0x38')][_0x96ce('0x43')]){_0x465f0e['where']=_[_0x96ce('0x44')](_0x465f0e['where'],{'$or':_[_0x96ce('0x45')](_0x167924,function(_0x2d5c45){if(_0x2d5c45[_0x96ce('0x46')][_0x96ce('0x47')]!=='VIRTUAL'){var _0x59f2cc={};_0x59f2cc[_0x2d5c45[_0x96ce('0x48')]]={'$like':'%'+_0x39ba23[_0x96ce('0x38')][_0x96ce('0x43')]+'%'};return _0x59f2cc;}})});}_0x465f0e=_[_0x96ce('0x44')]({},_0x465f0e,_0x39ba23['options']);var _0x4f506e={'where':_0x465f0e[_0x96ce('0x41')]};return db[_0x96ce('0x35')][_0x96ce('0x49')](_0x4f506e)[_0x96ce('0x1d')](function(_0x191b62){_0x27cd5c[_0x96ce('0x49')]=_0x191b62;if(_0x39ba23[_0x96ce('0x38')]['includeAll']){_0x465f0e[_0x96ce('0x4a')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x96ce('0x4b')](_0x465f0e);})['then'](function(_0x4152ab){_0x27cd5c[_0x96ce('0x4c')]=_0x4152ab;return _0x27cd5c;})['then'](respondWithFilteredResult(_0xa7169a,_0x465f0e))[_0x96ce('0x4d')](handleError(_0xa7169a,null));};exports['show']=function(_0x5b0214,_0x33d246){var _0x33fd96={'raw':![],'where':{'id':_0x5b0214[_0x96ce('0x4e')]['id']}},_0x164138={};_0x164138[_0x96ce('0x37')]=_[_0x96ce('0x39')](db['DeskConfiguration'][_0x96ce('0x36')]);_0x164138[_0x96ce('0x38')]=_[_0x96ce('0x39')](_0x5b0214['query']);_0x164138['filters']=_[_0x96ce('0x4f')](_0x164138[_0x96ce('0x37')],_0x164138['query']);_0x33fd96[_0x96ce('0x3b')]=_[_0x96ce('0x4f')](_0x164138['model'],qs[_0x96ce('0x3c')](_0x5b0214[_0x96ce('0x38')][_0x96ce('0x3c')]));_0x33fd96['attributes']=_0x33fd96[_0x96ce('0x3b')]['length']?_0x33fd96[_0x96ce('0x3b')]:_0x164138[_0x96ce('0x37')];if(_0x5b0214['query'][_0x96ce('0x50')]){_0x33fd96['include']=[{'all':!![]}];}_0x33fd96=_[_0x96ce('0x44')]({},_0x33fd96,_0x5b0214[_0x96ce('0x51')]);return db[_0x96ce('0x35')][_0x96ce('0x52')](_0x33fd96)[_0x96ce('0x1d')](handleEntityNotFound(_0x33d246,null))[_0x96ce('0x1d')](respondWithResult(_0x33d246,null))[_0x96ce('0x4d')](handleError(_0x33d246,null));};exports['create']=function(_0x194d06,_0x49ac92){return db['DeskConfiguration'][_0x96ce('0x53')](_0x194d06['body'],{})[_0x96ce('0x1d')](respondWithResult(_0x49ac92,0xc9))[_0x96ce('0x4d')](handleError(_0x49ac92,null));};exports[_0x96ce('0x31')]=function(_0x5cd569,_0x9f6690){if(_0x5cd569['body']['id']){delete _0x5cd569[_0x96ce('0x54')]['id'];}return db[_0x96ce('0x35')][_0x96ce('0x52')]({'where':{'id':_0x5cd569[_0x96ce('0x4e')]['id']}})[_0x96ce('0x1d')](handleEntityNotFound(_0x9f6690,null))[_0x96ce('0x1d')](saveUpdates(_0x5cd569[_0x96ce('0x54')],null))[_0x96ce('0x1d')](respondWithResult(_0x9f6690,null))[_0x96ce('0x4d')](handleError(_0x9f6690,null));};exports['destroy']=function(_0xa1da1c,_0x205aaa){return db[_0x96ce('0x35')][_0x96ce('0x52')]({'where':{'id':_0xa1da1c['params']['id']}})['then'](handleEntityNotFound(_0x205aaa,null))[_0x96ce('0x1d')](removeEntity(_0x205aaa,null))[_0x96ce('0x4d')](handleError(_0x205aaa,null));};exports[_0x96ce('0x55')]=function(_0x25a999,_0xe1c0da,_0x4d1652){var _0x6ae612={};var _0x1e86a8={};var _0xecf866;var _0x18e742;return db[_0x96ce('0x35')][_0x96ce('0x56')]({'where':{'id':_0x25a999[_0x96ce('0x4e')]['id']}})[_0x96ce('0x1d')](handleEntityNotFound(_0xe1c0da,null))[_0x96ce('0x1d')](function(_0xafc2b2){if(_0xafc2b2){_0xecf866=_0xafc2b2;_0x1e86a8[_0x96ce('0x37')]=_[_0x96ce('0x39')](db['DeskField'][_0x96ce('0x36')]);_0x1e86a8[_0x96ce('0x38')]=_[_0x96ce('0x39')](_0x25a999[_0x96ce('0x38')]);_0x1e86a8[_0x96ce('0x3a')]=_[_0x96ce('0x4f')](_0x1e86a8[_0x96ce('0x37')],_0x1e86a8['query']);_0x6ae612[_0x96ce('0x3b')]=_[_0x96ce('0x4f')](_0x1e86a8[_0x96ce('0x37')],qs[_0x96ce('0x3c')](_0x25a999[_0x96ce('0x38')][_0x96ce('0x3c')]));_0x6ae612[_0x96ce('0x3b')]=_0x6ae612[_0x96ce('0x3b')][_0x96ce('0x3d')]?_0x6ae612['attributes']:_0x1e86a8[_0x96ce('0x37')];_0x6ae612[_0x96ce('0x3f')]=qs[_0x96ce('0x40')](_0x25a999[_0x96ce('0x38')][_0x96ce('0x40')]);_0x6ae612['where']=qs[_0x96ce('0x3a')](_[_0x96ce('0x42')](_0x25a999[_0x96ce('0x38')],_0x1e86a8[_0x96ce('0x3a')]));if(_0x25a999[_0x96ce('0x38')][_0x96ce('0x43')]){_0x6ae612['where']=_[_0x96ce('0x44')](_0x6ae612[_0x96ce('0x41')],{'$or':_[_0x96ce('0x45')](_0x6ae612[_0x96ce('0x3b')],function(_0x11edbc){var _0x4187d1={};_0x4187d1[_0x11edbc]={'$like':'%'+_0x25a999[_0x96ce('0x38')]['filter']+'%'};return _0x4187d1;})});}_0x6ae612=_[_0x96ce('0x44')]({},_0x6ae612,_0x25a999[_0x96ce('0x51')]);return _0xecf866['getFields'](_0x6ae612);}})[_0x96ce('0x1d')](function(_0x27d59e){if(_0x27d59e){_0x18e742=_0x27d59e['length'];if(!_0x25a999[_0x96ce('0x38')][_0x96ce('0x57')](_0x96ce('0x3e'))){_0x6ae612['limit']=qs['limit'](_0x25a999[_0x96ce('0x38')]['limit']);_0x6ae612[_0x96ce('0x2a')]=qs[_0x96ce('0x2a')](_0x25a999[_0x96ce('0x38')][_0x96ce('0x2a')]);}return _0xecf866[_0x96ce('0x55')](_0x6ae612);}})[_0x96ce('0x1d')](function(_0x306f3b){if(_0x306f3b){return _0x306f3b?{'count':_0x18e742,'rows':_0x306f3b}:null;}})[_0x96ce('0x1d')](respondWithResult(_0xe1c0da,null))[_0x96ce('0x4d')](handleError(_0xe1c0da,null));};exports['getSubjects']=function(_0x42e6b5,_0x2d4222,_0x3f78ec){var _0x475c13={};var _0x512594={};var _0xacdbed;var _0x28abcb;return db[_0x96ce('0x35')][_0x96ce('0x56')]({'where':{'id':_0x42e6b5[_0x96ce('0x4e')]['id']}})[_0x96ce('0x1d')](handleEntityNotFound(_0x2d4222,null))['then'](function(_0x150701){if(_0x150701){_0xacdbed=_0x150701;_0x512594['model']=_[_0x96ce('0x39')](db[_0x96ce('0x58')]['rawAttributes']);_0x512594[_0x96ce('0x38')]=_[_0x96ce('0x39')](_0x42e6b5[_0x96ce('0x38')]);_0x512594[_0x96ce('0x3a')]=_[_0x96ce('0x4f')](_0x512594[_0x96ce('0x37')],_0x512594[_0x96ce('0x38')]);_0x475c13[_0x96ce('0x3b')]=_[_0x96ce('0x4f')](_0x512594[_0x96ce('0x37')],qs[_0x96ce('0x3c')](_0x42e6b5[_0x96ce('0x38')]['fields']));_0x475c13[_0x96ce('0x3b')]=_0x475c13[_0x96ce('0x3b')][_0x96ce('0x3d')]?_0x475c13[_0x96ce('0x3b')]:_0x512594['model'];_0x475c13[_0x96ce('0x3f')]=qs[_0x96ce('0x40')](_0x42e6b5[_0x96ce('0x38')][_0x96ce('0x40')]);_0x475c13[_0x96ce('0x41')]=qs[_0x96ce('0x3a')](_['pick'](_0x42e6b5[_0x96ce('0x38')],_0x512594[_0x96ce('0x3a')]));if(_0x42e6b5[_0x96ce('0x38')][_0x96ce('0x43')]){_0x475c13[_0x96ce('0x41')]=_[_0x96ce('0x44')](_0x475c13[_0x96ce('0x41')],{'$or':_[_0x96ce('0x45')](_0x475c13[_0x96ce('0x3b')],function(_0x35ddfb){var _0x21e218={};_0x21e218[_0x35ddfb]={'$like':'%'+_0x42e6b5[_0x96ce('0x38')]['filter']+'%'};return _0x21e218;})});}_0x475c13=_[_0x96ce('0x44')]({},_0x475c13,_0x42e6b5[_0x96ce('0x51')]);return _0xacdbed[_0x96ce('0x59')](_0x475c13);}})['then'](function(_0x8fff9f){if(_0x8fff9f){_0x28abcb=_0x8fff9f[_0x96ce('0x3d')];if(!_0x42e6b5['query'][_0x96ce('0x57')](_0x96ce('0x3e'))){_0x475c13[_0x96ce('0x2b')]=qs[_0x96ce('0x2b')](_0x42e6b5['query']['limit']);_0x475c13[_0x96ce('0x2a')]=qs['offset'](_0x42e6b5[_0x96ce('0x38')][_0x96ce('0x2a')]);}return _0xacdbed['getSubjects'](_0x475c13);}})[_0x96ce('0x1d')](function(_0x25e681){if(_0x25e681){return _0x25e681?{'count':_0x28abcb,'rows':_0x25e681}:null;}})['then'](respondWithResult(_0x2d4222,null))[_0x96ce('0x4d')](handleError(_0x2d4222,null));};exports['getDescriptions']=function(_0x15f732,_0x3a2f61,_0x277bc3){var _0x13ced0={};var _0x5725e3={};var _0x53e3b7;var _0x5d3ec4;return db['DeskConfiguration'][_0x96ce('0x56')]({'where':{'id':_0x15f732[_0x96ce('0x4e')]['id']}})[_0x96ce('0x1d')](handleEntityNotFound(_0x3a2f61,null))[_0x96ce('0x1d')](function(_0x2b28a0){if(_0x2b28a0){_0x53e3b7=_0x2b28a0;_0x5725e3['model']=_['keys'](db['DeskField'][_0x96ce('0x36')]);_0x5725e3['query']=_[_0x96ce('0x39')](_0x15f732['query']);_0x5725e3['filters']=_[_0x96ce('0x4f')](_0x5725e3[_0x96ce('0x37')],_0x5725e3[_0x96ce('0x38')]);_0x13ced0[_0x96ce('0x3b')]=_[_0x96ce('0x4f')](_0x5725e3[_0x96ce('0x37')],qs[_0x96ce('0x3c')](_0x15f732[_0x96ce('0x38')][_0x96ce('0x3c')]));_0x13ced0[_0x96ce('0x3b')]=_0x13ced0[_0x96ce('0x3b')][_0x96ce('0x3d')]?_0x13ced0[_0x96ce('0x3b')]:_0x5725e3[_0x96ce('0x37')];_0x13ced0[_0x96ce('0x3f')]=qs[_0x96ce('0x40')](_0x15f732[_0x96ce('0x38')][_0x96ce('0x40')]);_0x13ced0[_0x96ce('0x41')]=qs[_0x96ce('0x3a')](_['pick'](_0x15f732[_0x96ce('0x38')],_0x5725e3[_0x96ce('0x3a')]));if(_0x15f732[_0x96ce('0x38')]['filter']){_0x13ced0['where']=_[_0x96ce('0x44')](_0x13ced0[_0x96ce('0x41')],{'$or':_[_0x96ce('0x45')](_0x13ced0['attributes'],function(_0x4eb672){var _0x54e487={};_0x54e487[_0x4eb672]={'$like':'%'+_0x15f732[_0x96ce('0x38')][_0x96ce('0x43')]+'%'};return _0x54e487;})});}_0x13ced0=_[_0x96ce('0x44')]({},_0x13ced0,_0x15f732[_0x96ce('0x51')]);return _0x53e3b7['getDescriptions'](_0x13ced0);}})[_0x96ce('0x1d')](function(_0x4a474c){if(_0x4a474c){_0x5d3ec4=_0x4a474c['length'];if(!_0x15f732[_0x96ce('0x38')][_0x96ce('0x57')](_0x96ce('0x3e'))){_0x13ced0[_0x96ce('0x2b')]=qs[_0x96ce('0x2b')](_0x15f732['query'][_0x96ce('0x2b')]);_0x13ced0[_0x96ce('0x2a')]=qs[_0x96ce('0x2a')](_0x15f732[_0x96ce('0x38')]['offset']);}return _0x53e3b7[_0x96ce('0x5a')](_0x13ced0);}})[_0x96ce('0x1d')](function(_0x208a97){if(_0x208a97){return _0x208a97?{'count':_0x5d3ec4,'rows':_0x208a97}:null;}})[_0x96ce('0x1d')](respondWithResult(_0x3a2f61,null))[_0x96ce('0x4d')](handleError(_0x3a2f61,null));};exports[_0x96ce('0x5b')]=function(_0xb1faef,_0x561fab,_0x57f5bf){var _0x3e6999={};var _0x5cb8fc={};var _0x347d37;var _0x320c19;return db[_0x96ce('0x35')]['findOne']({'where':{'id':_0xb1faef['params']['id']}})['then'](handleEntityNotFound(_0x561fab,null))[_0x96ce('0x1d')](function(_0x2d3f3e){if(_0x2d3f3e){_0x347d37=_0x2d3f3e;_0x5cb8fc[_0x96ce('0x37')]=_[_0x96ce('0x39')](db['Tag']['rawAttributes']);_0x5cb8fc[_0x96ce('0x38')]=_[_0x96ce('0x39')](_0xb1faef[_0x96ce('0x38')]);_0x5cb8fc[_0x96ce('0x3a')]=_[_0x96ce('0x4f')](_0x5cb8fc[_0x96ce('0x37')],_0x5cb8fc['query']);_0x3e6999[_0x96ce('0x3b')]=_[_0x96ce('0x4f')](_0x5cb8fc[_0x96ce('0x37')],qs[_0x96ce('0x3c')](_0xb1faef[_0x96ce('0x38')][_0x96ce('0x3c')]));_0x3e6999[_0x96ce('0x3b')]=_0x3e6999[_0x96ce('0x3b')][_0x96ce('0x3d')]?_0x3e6999[_0x96ce('0x3b')]:_0x5cb8fc[_0x96ce('0x37')];_0x3e6999[_0x96ce('0x3f')]=qs[_0x96ce('0x40')](_0xb1faef[_0x96ce('0x38')][_0x96ce('0x40')]);_0x3e6999[_0x96ce('0x41')]=qs[_0x96ce('0x3a')](_[_0x96ce('0x42')](_0xb1faef[_0x96ce('0x38')],_0x5cb8fc[_0x96ce('0x3a')]));if(_0xb1faef[_0x96ce('0x38')]['filter']){_0x3e6999['where']=_[_0x96ce('0x44')](_0x3e6999[_0x96ce('0x41')],{'$or':_[_0x96ce('0x45')](_0x3e6999[_0x96ce('0x3b')],function(_0x45c553){var _0x479492={};_0x479492[_0x45c553]={'$like':'%'+_0xb1faef[_0x96ce('0x38')][_0x96ce('0x43')]+'%'};return _0x479492;})});}_0x3e6999=_['merge']({},_0x3e6999,_0xb1faef[_0x96ce('0x51')]);return _0x347d37[_0x96ce('0x5b')](_0x3e6999);}})[_0x96ce('0x1d')](function(_0x36f07b){if(_0x36f07b){_0x320c19=_0x36f07b[_0x96ce('0x3d')];if(!_0xb1faef[_0x96ce('0x38')][_0x96ce('0x57')](_0x96ce('0x3e'))){_0x3e6999[_0x96ce('0x2b')]=qs[_0x96ce('0x2b')](_0xb1faef[_0x96ce('0x38')][_0x96ce('0x2b')]);_0x3e6999['offset']=qs[_0x96ce('0x2a')](_0xb1faef[_0x96ce('0x38')][_0x96ce('0x2a')]);}return _0x347d37[_0x96ce('0x5b')](_0x3e6999);}})[_0x96ce('0x1d')](function(_0xa5dad5){if(_0xa5dad5){return _0xa5dad5?{'count':_0x320c19,'rows':_0xa5dad5}:null;}})[_0x96ce('0x1d')](respondWithResult(_0x561fab,null))[_0x96ce('0x4d')](handleError(_0x561fab,null));};exports['setTags']=function(_0x4ad08a,_0x3bc5ad,_0x531a52){if(_0x4ad08a[_0x96ce('0x54')]['id']){delete _0x4ad08a[_0x96ce('0x54')]['id'];}return db['DeskConfiguration'][_0x96ce('0x56')]({'where':{'id':_0x4ad08a[_0x96ce('0x4e')]['id']}})[_0x96ce('0x1d')](handleEntityNotFound(_0x3bc5ad,null))[_0x96ce('0x1d')](function(_0x22ac5f){if(_0x22ac5f){return _0x22ac5f[_0x96ce('0x5c')](_0x4ad08a[_0x96ce('0x54')][_0x96ce('0x5d')]||[]);}return null;})['then'](respondWithResult(_0x3bc5ad,null))[_0x96ce('0x4d')](handleError(_0x3bc5ad,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index e689b21..40d1fbb 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 _0x5a96=['int_desk_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a96,0xdd));var _0x65a9=function(_0x108bf5,_0x211fd6){_0x108bf5=_0x108bf5-0x0;var _0x2d846d=_0x5a96[_0x108bf5];return _0x2d846d;};'use strict';var _=require(_0x65a9('0x0'));var util=require('util');var logger=require(_0x65a9('0x1'))(_0x65a9('0x2'));var moment=require('moment');var BPromise=require(_0x65a9('0x3'));var rp=require(_0x65a9('0x4'));var fs=require('fs');var path=require(_0x65a9('0x5'));var rimraf=require(_0x65a9('0x6'));var config=require(_0x65a9('0x7'));var attributes=require(_0x65a9('0x8'));module['exports']=function(_0x353517,_0x401d78){return _0x353517['define']('DeskConfiguration',attributes,{'tableName':_0x65a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e92=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','int_desk_configurations'];(function(_0x152ce0,_0x242300){var _0x38fe61=function(_0x5d93ff){while(--_0x5d93ff){_0x152ce0['push'](_0x152ce0['shift']());}};_0x38fe61(++_0x242300);}(_0x7e92,0xe7));var _0x27e9=function(_0x14eab4,_0x288f4a){_0x14eab4=_0x14eab4-0x0;var _0x44a059=_0x7e92[_0x14eab4];return _0x44a059;};'use strict';var _=require(_0x27e9('0x0'));var util=require(_0x27e9('0x1'));var logger=require(_0x27e9('0x2'))(_0x27e9('0x3'));var moment=require(_0x27e9('0x4'));var BPromise=require('bluebird');var rp=require(_0x27e9('0x5'));var fs=require('fs');var path=require(_0x27e9('0x6'));var rimraf=require(_0x27e9('0x7'));var config=require(_0x27e9('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x27e9('0x9')]=function(_0x5d2b2c,_0x30afce){return _0x5d2b2c['define']('DeskConfiguration',attributes,{'tableName':_0x27e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 03f7a1f..99e993e 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 _0xf2ca=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2de815,_0x2e2a9e){var _0xbf7d32=function(_0x361952){while(--_0x361952){_0x2de815['push'](_0x2de815['shift']());}};_0xbf7d32(++_0x2e2a9e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0xf2ca[_0x588011];return _0x3b3773;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9531,_0x58351f,_0x37fedd){return new BPromise(function(_0x3c0421,_0x4a7397){return client[_0xaf2c('0xc')](_0x1f9531,_0x37fedd)['then'](function(_0x439ca3){logger['info'](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x58351f,'request\x20sent',JSON['stringify'](_0x439ca3));if(_0x439ca3[_0xaf2c('0x11')]){if(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x12')]===0x1f4){logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3['error']['message']);return _0x4a7397(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);return _0x3c0421(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}else{logger[_0xaf2c('0x14')](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));_0x3c0421(_0x439ca3[_0xaf2c('0x15')][_0xaf2c('0x13')]);}})[_0xaf2c('0x16')](function(_0x705d09){logger['error'](_0xaf2c('0xd'),_0x58351f,_0x705d09);_0x4a7397(_0x705d09);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x5c0ef7,_0x4f8a90){var _0x446791=function(_0x591c8f){while(--_0x591c8f){_0x5c0ef7['push'](_0x5c0ef7['shift']());}};_0x446791(++_0x4f8a90);}(_0xabce,0x103));var _0xeabc=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xabce[_0x4baae2];return _0x1a2285;};'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')]('DeskConfiguration,\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 diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 1343819..a7cbced 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 _0xb242=['put','/:id','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','show','post','create'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb242,0x137));var _0x2b24=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0xb242[_0x397f37];return _0x31cae6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b24('0x0'));var timeout=require(_0x2b24('0x1'));var express=require(_0x2b24('0x2'));var router=express[_0x2b24('0x3')]();var auth=require(_0x2b24('0x4'));var interaction=require(_0x2b24('0x5'));var config=require(_0x2b24('0x6'));var controller=require(_0x2b24('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2b24('0x8')]('/:id',auth[_0x2b24('0x9')](),controller[_0x2b24('0xa')]);router[_0x2b24('0xb')]('/',auth[_0x2b24('0x9')](),controller[_0x2b24('0xc')]);router[_0x2b24('0xd')](_0x2b24('0xe'),auth[_0x2b24('0x9')](),controller[_0x2b24('0xf')]);router[_0x2b24('0x10')](_0x2b24('0xe'),auth[_0x2b24('0x9')](),controller['destroy']);module[_0x2b24('0x11')]=router; \ No newline at end of file +var _0x93ab=['create','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x33e93d,_0x1a8423){var _0x19e99d=function(_0x194faa){while(--_0x194faa){_0x33e93d['push'](_0x33e93d['shift']());}};_0x19e99d(++_0x1a8423);}(_0x93ab,0x124));var _0xb93a=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x93ab[_0x225f50];return _0x19d003;};'use strict';var multer=require(_0xb93a('0x0'));var util=require(_0xb93a('0x1'));var path=require(_0xb93a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb93a('0x3')]();var auth=require(_0xb93a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb93a('0x5'));var controller=require(_0xb93a('0x6'));router[_0xb93a('0x7')]('/',auth[_0xb93a('0x8')](),controller['index']);router[_0xb93a('0x7')](_0xb93a('0x9'),auth[_0xb93a('0x8')](),controller[_0xb93a('0xa')]);router[_0xb93a('0xb')]('/',auth['isAuthenticated'](),controller[_0xb93a('0xc')]);router['put']('/:id',auth[_0xb93a('0x8')](),controller[_0xb93a('0xd')]);router['delete'](_0xb93a('0x9'),auth[_0xb93a('0x8')](),controller[_0xb93a('0xe')]);module[_0xb93a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e366917..ea468b5 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 _0x9c44=['variable','customVariable','keyValue','STRING','ENUM','string'];(function(_0x5b1bbc,_0x98e6c3){var _0x424fb4=function(_0x45ba56){while(--_0x45ba56){_0x5b1bbc['push'](_0x5b1bbc['shift']());}};_0x424fb4(++_0x98e6c3);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x49c4('0x0')](_0x49c4('0x1'),_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')),'defaultValue':_0x49c4('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x49c4('0x0')]('string',_0x49c4('0x2'),_0x49c4('0x3'))},'keyContent':{'type':Sequelize[_0x49c4('0x5')]},'idField':{'type':Sequelize[_0x49c4('0x5')]},'nameField':{'type':Sequelize[_0x49c4('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49c4('0x5')]}}; \ No newline at end of file +var _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x41dd9a,_0x70c7e0){var _0x25fb35=function(_0x1a73e9){while(--_0x1a73e9){_0x41dd9a['push'](_0x41dd9a['shift']());}};_0x25fb35(++_0x70c7e0);}(_0x750a,0x140));var _0xa750=function(_0x12a035,_0x5b3abe){_0x12a035=_0x12a035-0x0;var _0x26f1d4=_0x750a[_0x12a035];return _0x26f1d4;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa750('0x1'),_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x4')},'content':{'type':Sequelize[_0xa750('0x5')]},'key':{'type':Sequelize[_0xa750('0x5')]},'keyType':{'type':Sequelize[_0xa750('0x6')](_0xa750('0x4'),_0xa750('0x1'),_0xa750('0x2'))},'keyContent':{'type':Sequelize[_0xa750('0x5')]},'idField':{'type':Sequelize[_0xa750('0x5')]},'nameField':{'type':Sequelize[_0xa750('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 6050b7e..ac4159c 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 _0x594d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','apply','update','then','destroy','error','stack','send','index','DeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','field','options','count','includeAll','findAll','catch','show','include','find','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','papaparse'];(function(_0xb328fb,_0x2c62f2){var _0x1965c3=function(_0x38421a){while(--_0x38421a){_0xb328fb['push'](_0xb328fb['shift']());}};_0x1965c3(++_0x2c62f2);}(_0x594d,0x172));var _0xd594=function(_0x32793c,_0x28acdb){_0x32793c=_0x32793c-0x0;var _0x41667a=_0x594d[_0x32793c];return _0x41667a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd594('0x0'));var zipdir=require(_0xd594('0x1'));var jsonpatch=require(_0xd594('0x2'));var rp=require(_0xd594('0x3'));var moment=require(_0xd594('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd594('0x5'));var util=require(_0xd594('0x6'));var path=require(_0xd594('0x7'));var sox=require(_0xd594('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd594('0x9'));var crypto=require(_0xd594('0xa'));var jsforce=require(_0xd594('0xb'));var deskjs=require(_0xd594('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd594('0xd'));var Redis=require(_0xd594('0xe'));var authService=require(_0xd594('0xf'));var qs=require(_0xd594('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd594('0x11'))(_0xd594('0x12'));var utils=require(_0xd594('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4845ac,_0x22bc54){_0x22bc54=_0x22bc54||0xcc;return function(_0x4ff238){if(_0x4ff238){return _0x4845ac[_0xd594('0x14')](_0x22bc54);}return _0x4845ac[_0xd594('0x15')](_0x22bc54)[_0xd594('0x16')]();};}function respondWithResult(_0x567805,_0x299dc8){_0x299dc8=_0x299dc8||0xc8;return function(_0x5c4845){if(_0x5c4845){return _0x567805[_0xd594('0x15')](_0x299dc8)[_0xd594('0x17')](_0x5c4845);}};}function respondWithFilteredResult(_0x50c79a,_0x14159e){return function(_0x3e39ef){if(_0x3e39ef){var _0x1b5a8e=_0x3e39ef['count'],_0x2299c7=_0x14159e[_0xd594('0x18')],_0x5464e2=_0x14159e[_0xd594('0x18')]+_0x14159e[_0xd594('0x19')],_0x311d8d;if(_0x5464e2>=_0x1b5a8e){_0x5464e2=_0x1b5a8e;_0x311d8d=0xc8;}else{_0x311d8d=0xce;}_0x50c79a['status'](_0x311d8d);return _0x50c79a[_0xd594('0x1a')]('Content-Range',_0x2299c7+'-'+_0x5464e2+'/'+_0x1b5a8e)[_0xd594('0x17')](_0x3e39ef);}return null;};}function patchUpdates(_0x4e39c3){return function(_0x50ba67){try{jsonpatch[_0xd594('0x1b')](_0x50ba67,_0x4e39c3,!![]);}catch(_0x1abb98){return BPromise['reject'](_0x1abb98);}return _0x50ba67['save']();};}function saveUpdates(_0x481dbd,_0x47b31d){return function(_0x51b768){if(_0x51b768){return _0x51b768[_0xd594('0x1c')](_0x481dbd)[_0xd594('0x1d')](function(_0x99d36b){return _0x99d36b;});}return null;};}function removeEntity(_0x131ddc,_0x2873a4){return function(_0x18dff5){if(_0x18dff5){return _0x18dff5[_0xd594('0x1e')]()[_0xd594('0x1d')](function(){_0x131ddc[_0xd594('0x15')](0xcc)[_0xd594('0x16')]();});}};}function handleEntityNotFound(_0x4e9b72,_0x3c9cdd){return function(_0x3414d6){if(!_0x3414d6){_0x4e9b72['sendStatus'](0x194);}return _0x3414d6;};}function handleError(_0x25daa2,_0x10f35a){_0x10f35a=_0x10f35a||0x1f4;return function(_0x1d090f){logger[_0xd594('0x1f')](_0x1d090f[_0xd594('0x20')]);if(_0x1d090f['name']){delete _0x1d090f['name'];}_0x25daa2[_0xd594('0x15')](_0x10f35a)[_0xd594('0x21')](_0x1d090f);};}exports[_0xd594('0x22')]=function(_0x348ea6,_0x5cb20b){var _0x5601b8={},_0x2ab26f={},_0xecf17f={'count':0x0,'rows':[]};var _0x380457=db[_0xd594('0x23')][_0xd594('0x24')];_0x2ab26f[_0xd594('0x25')]=_[_0xd594('0x26')](_0x380457);_0x2ab26f[_0xd594('0x27')]=_['keys'](_0x348ea6[_0xd594('0x27')]);_0x2ab26f[_0xd594('0x28')]=_[_0xd594('0x29')](_0x2ab26f[_0xd594('0x25')],_0x2ab26f[_0xd594('0x27')]);_0x5601b8[_0xd594('0x2a')]=_[_0xd594('0x29')](_0x2ab26f[_0xd594('0x25')],qs[_0xd594('0x2b')](_0x348ea6[_0xd594('0x27')][_0xd594('0x2b')]));_0x5601b8['attributes']=_0x5601b8[_0xd594('0x2a')][_0xd594('0x2c')]?_0x5601b8[_0xd594('0x2a')]:_0x2ab26f[_0xd594('0x25')];if(!_0x348ea6[_0xd594('0x27')][_0xd594('0x2d')](_0xd594('0x2e'))){_0x5601b8[_0xd594('0x19')]=qs['limit'](_0x348ea6['query'][_0xd594('0x19')]);_0x5601b8['offset']=qs[_0xd594('0x18')](_0x348ea6[_0xd594('0x27')]['offset']);}_0x5601b8['order']=qs[_0xd594('0x2f')](_0x348ea6[_0xd594('0x27')][_0xd594('0x2f')]);_0x5601b8[_0xd594('0x30')]=qs[_0xd594('0x28')](_['pick'](_0x348ea6[_0xd594('0x27')],_0x2ab26f[_0xd594('0x28')]));if(_0x348ea6[_0xd594('0x27')][_0xd594('0x31')]){_0x5601b8[_0xd594('0x30')]=_[_0xd594('0x32')](_0x5601b8[_0xd594('0x30')],{'$or':_['map'](_0x380457,function(_0x4f55de){if(_0x4f55de[_0xd594('0x33')]['key']!==_0xd594('0x34')){var _0x56bae4={};_0x56bae4[_0x4f55de[_0xd594('0x35')]]={'$like':'%'+_0x348ea6[_0xd594('0x27')][_0xd594('0x31')]+'%'};return _0x56bae4;}})});}_0x5601b8=_[_0xd594('0x32')]({},_0x5601b8,_0x348ea6[_0xd594('0x36')]);var _0x3f698b={'where':_0x5601b8['where']};return db[_0xd594('0x23')][_0xd594('0x37')](_0x3f698b)['then'](function(_0x476246){_0xecf17f[_0xd594('0x37')]=_0x476246;if(_0x348ea6[_0xd594('0x27')][_0xd594('0x38')]){_0x5601b8['include']=[{'all':!![]}];}return db[_0xd594('0x23')][_0xd594('0x39')](_0x5601b8);})[_0xd594('0x1d')](function(_0x374b2a){_0xecf17f['rows']=_0x374b2a;return _0xecf17f;})[_0xd594('0x1d')](respondWithFilteredResult(_0x5cb20b,_0x5601b8))[_0xd594('0x3a')](handleError(_0x5cb20b,null));};exports[_0xd594('0x3b')]=function(_0x2eb237,_0x2ac333){var _0x3b242e={'raw':!![],'where':{'id':_0x2eb237['params']['id']}},_0x201735={};_0x201735[_0xd594('0x25')]=_[_0xd594('0x26')](db['DeskField'][_0xd594('0x24')]);_0x201735[_0xd594('0x27')]=_[_0xd594('0x26')](_0x2eb237['query']);_0x201735[_0xd594('0x28')]=_[_0xd594('0x29')](_0x201735[_0xd594('0x25')],_0x201735[_0xd594('0x27')]);_0x3b242e[_0xd594('0x2a')]=_['intersection'](_0x201735[_0xd594('0x25')],qs[_0xd594('0x2b')](_0x2eb237[_0xd594('0x27')][_0xd594('0x2b')]));_0x3b242e['attributes']=_0x3b242e[_0xd594('0x2a')][_0xd594('0x2c')]?_0x3b242e['attributes']:_0x201735[_0xd594('0x25')];if(_0x2eb237['query'][_0xd594('0x38')]){_0x3b242e[_0xd594('0x3c')]=[{'all':!![]}];}_0x3b242e=_[_0xd594('0x32')]({},_0x3b242e,_0x2eb237[_0xd594('0x36')]);return db[_0xd594('0x23')][_0xd594('0x3d')](_0x3b242e)[_0xd594('0x1d')](handleEntityNotFound(_0x2ac333,null))[_0xd594('0x1d')](respondWithResult(_0x2ac333,null))[_0xd594('0x3a')](handleError(_0x2ac333,null));};exports['create']=function(_0xd69610,_0x4cad2a){return db[_0xd594('0x23')]['create'](_0xd69610[_0xd594('0x3e')],{})[_0xd594('0x1d')](respondWithResult(_0x4cad2a,0xc9))[_0xd594('0x3a')](handleError(_0x4cad2a,null));};exports[_0xd594('0x1c')]=function(_0x390989,_0x218a6b){if(_0x390989[_0xd594('0x3e')]['id']){delete _0x390989['body']['id'];}return db['DeskField'][_0xd594('0x3d')]({'where':{'id':_0x390989[_0xd594('0x3f')]['id']}})[_0xd594('0x1d')](handleEntityNotFound(_0x218a6b,null))[_0xd594('0x1d')](saveUpdates(_0x390989[_0xd594('0x3e')],null))[_0xd594('0x1d')](respondWithResult(_0x218a6b,null))[_0xd594('0x3a')](handleError(_0x218a6b,null));};exports[_0xd594('0x1e')]=function(_0xc94665,_0x22a20a){return db[_0xd594('0x23')]['find']({'where':{'id':_0xc94665[_0xd594('0x3f')]['id']}})[_0xd594('0x1d')](handleEntityNotFound(_0x22a20a,null))[_0xd594('0x1d')](removeEntity(_0x22a20a,null))[_0xd594('0x3a')](handleError(_0x22a20a,null));}; \ No newline at end of file +var _0xf46d=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','error','stack','send','DeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto'];(function(_0x5eb78e,_0x498d17){var _0x352bd9=function(_0xd1acfe){while(--_0xd1acfe){_0x5eb78e['push'](_0x5eb78e['shift']());}};_0x352bd9(++_0x498d17);}(_0xf46d,0x1c3));var _0xdf46=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0xf46d[_0x3cc9d9];return _0x1a425d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdf46('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf46('0x1'));var jsonpatch=require(_0xdf46('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdf46('0x3'));var Mustache=require(_0xdf46('0x4'));var util=require('util');var path=require(_0xdf46('0x5'));var sox=require(_0xdf46('0x6'));var csv=require(_0xdf46('0x7'));var ejs=require(_0xdf46('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdf46('0x9'));var crypto=require(_0xdf46('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdf46('0xb'));var toCsv=require(_0xdf46('0x7'));var querystring=require(_0xdf46('0xc'));var Papa=require('papaparse');var Redis=require(_0xdf46('0xd'));var authService=require(_0xdf46('0xe'));var qs=require(_0xdf46('0xf'));var hardwareService=require(_0xdf46('0x10'));var logger=require(_0xdf46('0x11'))(_0xdf46('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b0249,_0x1b7974){_0x1b7974=_0x1b7974||0xcc;return function(_0x4cdf43){if(_0x4cdf43){return _0x4b0249[_0xdf46('0x13')](_0x1b7974);}return _0x4b0249[_0xdf46('0x14')](_0x1b7974)[_0xdf46('0x15')]();};}function respondWithResult(_0x294f94,_0x56b9ac){_0x56b9ac=_0x56b9ac||0xc8;return function(_0x928b0f){if(_0x928b0f){return _0x294f94['status'](_0x56b9ac)[_0xdf46('0x16')](_0x928b0f);}};}function respondWithFilteredResult(_0xac600c,_0x28d701){return function(_0x534b32){if(_0x534b32){var _0x3c4586=_0x534b32[_0xdf46('0x17')],_0x150e58=_0x28d701[_0xdf46('0x18')],_0x597be0=_0x28d701[_0xdf46('0x18')]+_0x28d701['limit'],_0x310cba;if(_0x597be0>=_0x3c4586){_0x597be0=_0x3c4586;_0x310cba=0xc8;}else{_0x310cba=0xce;}_0xac600c[_0xdf46('0x14')](_0x310cba);return _0xac600c[_0xdf46('0x19')]('Content-Range',_0x150e58+'-'+_0x597be0+'/'+_0x3c4586)[_0xdf46('0x16')](_0x534b32);}return null;};}function patchUpdates(_0x2459ee){return function(_0x29f8d8){try{jsonpatch[_0xdf46('0x1a')](_0x29f8d8,_0x2459ee,!![]);}catch(_0x36e62c){return BPromise[_0xdf46('0x1b')](_0x36e62c);}return _0x29f8d8[_0xdf46('0x1c')]();};}function saveUpdates(_0x3df9e9,_0x3f40ae){return function(_0x5f08c6){if(_0x5f08c6){return _0x5f08c6[_0xdf46('0x1d')](_0x3df9e9)['then'](function(_0x7ae7d9){return _0x7ae7d9;});}return null;};}function removeEntity(_0x331e20,_0x486b55){return function(_0x12a175){if(_0x12a175){return _0x12a175['destroy']()[_0xdf46('0x1e')](function(){_0x331e20[_0xdf46('0x14')](0xcc)[_0xdf46('0x15')]();});}};}function handleEntityNotFound(_0x1d8d65,_0x21199f){return function(_0x22f825){if(!_0x22f825){_0x1d8d65[_0xdf46('0x13')](0x194);}return _0x22f825;};}function handleError(_0x59342e,_0x162e6e){_0x162e6e=_0x162e6e||0x1f4;return function(_0x2f7de9){logger[_0xdf46('0x1f')](_0x2f7de9[_0xdf46('0x20')]);if(_0x2f7de9['name']){delete _0x2f7de9['name'];}_0x59342e[_0xdf46('0x14')](_0x162e6e)[_0xdf46('0x21')](_0x2f7de9);};}exports['index']=function(_0x3b38c9,_0x32636b){var _0x40ff85={},_0x1c987b={},_0x5e8a1e={'count':0x0,'rows':[]};var _0x514090=db[_0xdf46('0x22')][_0xdf46('0x23')];_0x1c987b[_0xdf46('0x24')]=_[_0xdf46('0x25')](_0x514090);_0x1c987b[_0xdf46('0x26')]=_[_0xdf46('0x25')](_0x3b38c9[_0xdf46('0x26')]);_0x1c987b[_0xdf46('0x27')]=_[_0xdf46('0x28')](_0x1c987b[_0xdf46('0x24')],_0x1c987b[_0xdf46('0x26')]);_0x40ff85[_0xdf46('0x29')]=_[_0xdf46('0x28')](_0x1c987b[_0xdf46('0x24')],qs[_0xdf46('0x2a')](_0x3b38c9[_0xdf46('0x26')][_0xdf46('0x2a')]));_0x40ff85['attributes']=_0x40ff85[_0xdf46('0x29')][_0xdf46('0x2b')]?_0x40ff85['attributes']:_0x1c987b[_0xdf46('0x24')];if(!_0x3b38c9[_0xdf46('0x26')]['hasOwnProperty']('nolimit')){_0x40ff85[_0xdf46('0x2c')]=qs[_0xdf46('0x2c')](_0x3b38c9[_0xdf46('0x26')][_0xdf46('0x2c')]);_0x40ff85[_0xdf46('0x18')]=qs[_0xdf46('0x18')](_0x3b38c9[_0xdf46('0x26')][_0xdf46('0x18')]);}_0x40ff85[_0xdf46('0x2d')]=qs['sort'](_0x3b38c9[_0xdf46('0x26')][_0xdf46('0x2e')]);_0x40ff85[_0xdf46('0x2f')]=qs[_0xdf46('0x27')](_[_0xdf46('0x30')](_0x3b38c9[_0xdf46('0x26')],_0x1c987b[_0xdf46('0x27')]));if(_0x3b38c9[_0xdf46('0x26')][_0xdf46('0x31')]){_0x40ff85['where']=_[_0xdf46('0x32')](_0x40ff85[_0xdf46('0x2f')],{'$or':_[_0xdf46('0x33')](_0x514090,function(_0x3769c2){if(_0x3769c2[_0xdf46('0x34')][_0xdf46('0x35')]!==_0xdf46('0x36')){var _0x59adba={};_0x59adba[_0x3769c2[_0xdf46('0x37')]]={'$like':'%'+_0x3b38c9[_0xdf46('0x26')][_0xdf46('0x31')]+'%'};return _0x59adba;}})});}_0x40ff85=_[_0xdf46('0x32')]({},_0x40ff85,_0x3b38c9[_0xdf46('0x38')]);var _0x3fb71c={'where':_0x40ff85[_0xdf46('0x2f')]};return db['DeskField'][_0xdf46('0x17')](_0x3fb71c)[_0xdf46('0x1e')](function(_0x5d2716){_0x5e8a1e[_0xdf46('0x17')]=_0x5d2716;if(_0x3b38c9[_0xdf46('0x26')][_0xdf46('0x39')]){_0x40ff85[_0xdf46('0x3a')]=[{'all':!![]}];}return db['DeskField'][_0xdf46('0x3b')](_0x40ff85);})['then'](function(_0x169f4d){_0x5e8a1e[_0xdf46('0x3c')]=_0x169f4d;return _0x5e8a1e;})['then'](respondWithFilteredResult(_0x32636b,_0x40ff85))[_0xdf46('0x3d')](handleError(_0x32636b,null));};exports['show']=function(_0x44bc9f,_0x2e4c87){var _0x3b9b11={'raw':!![],'where':{'id':_0x44bc9f[_0xdf46('0x3e')]['id']}},_0x37e301={};_0x37e301[_0xdf46('0x24')]=_['keys'](db['DeskField'][_0xdf46('0x23')]);_0x37e301[_0xdf46('0x26')]=_[_0xdf46('0x25')](_0x44bc9f['query']);_0x37e301['filters']=_[_0xdf46('0x28')](_0x37e301['model'],_0x37e301[_0xdf46('0x26')]);_0x3b9b11[_0xdf46('0x29')]=_[_0xdf46('0x28')](_0x37e301[_0xdf46('0x24')],qs['fields'](_0x44bc9f['query'][_0xdf46('0x2a')]));_0x3b9b11[_0xdf46('0x29')]=_0x3b9b11[_0xdf46('0x29')][_0xdf46('0x2b')]?_0x3b9b11[_0xdf46('0x29')]:_0x37e301[_0xdf46('0x24')];if(_0x44bc9f[_0xdf46('0x26')][_0xdf46('0x39')]){_0x3b9b11[_0xdf46('0x3a')]=[{'all':!![]}];}_0x3b9b11=_[_0xdf46('0x32')]({},_0x3b9b11,_0x44bc9f[_0xdf46('0x38')]);return db['DeskField']['find'](_0x3b9b11)['then'](handleEntityNotFound(_0x2e4c87,null))[_0xdf46('0x1e')](respondWithResult(_0x2e4c87,null))[_0xdf46('0x3d')](handleError(_0x2e4c87,null));};exports[_0xdf46('0x3f')]=function(_0x38e1dd,_0x22de55){return db[_0xdf46('0x22')][_0xdf46('0x3f')](_0x38e1dd[_0xdf46('0x40')],{})[_0xdf46('0x1e')](respondWithResult(_0x22de55,0xc9))[_0xdf46('0x3d')](handleError(_0x22de55,null));};exports[_0xdf46('0x1d')]=function(_0x19135b,_0x5f13f0){if(_0x19135b[_0xdf46('0x40')]['id']){delete _0x19135b[_0xdf46('0x40')]['id'];}return db[_0xdf46('0x22')]['find']({'where':{'id':_0x19135b[_0xdf46('0x3e')]['id']}})[_0xdf46('0x1e')](handleEntityNotFound(_0x5f13f0,null))[_0xdf46('0x1e')](saveUpdates(_0x19135b['body'],null))[_0xdf46('0x1e')](respondWithResult(_0x5f13f0,null))[_0xdf46('0x3d')](handleError(_0x5f13f0,null));};exports['destroy']=function(_0xd2e819,_0x563cc6){return db['DeskField'][_0xdf46('0x41')]({'where':{'id':_0xd2e819[_0xdf46('0x3e')]['id']}})[_0xdf46('0x1e')](handleEntityNotFound(_0x563cc6,null))['then'](removeEntity(_0x563cc6,null))[_0xdf46('0x3d')](handleError(_0x563cc6,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6e0db35..59f5e61 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 _0xf22f=['exports','define','DeskField','int_desk_fields','idField','lodash','bluebird','path','../../config/environment','./intDeskField.attributes'];(function(_0x2c02ba,_0x196104){var _0x474776=function(_0x45ed31){while(--_0x45ed31){_0x2c02ba['push'](_0x2c02ba['shift']());}};_0x474776(++_0x196104);}(_0xf22f,0x1a9));var _0xff22=function(_0x4cc051,_0x2f0343){_0x4cc051=_0x4cc051-0x0;var _0x2fc703=_0xf22f[_0x4cc051];return _0x2fc703;};'use strict';var _=require(_0xff22('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xff22('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff22('0x2'));var rimraf=require('rimraf');var config=require(_0xff22('0x3'));var attributes=require(_0xff22('0x4'));module[_0xff22('0x5')]=function(_0x293947,_0x5e0272){return _0x293947[_0xff22('0x6')](_0xff22('0x7'),attributes,{'tableName':_0xff22('0x8'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xff22('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc932=['define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intDeskField.attributes'];(function(_0x1003c1,_0x15a38b){var _0x3a791e=function(_0x1606f4){while(--_0x1606f4){_0x1003c1['push'](_0x1003c1['shift']());}};_0x3a791e(++_0x15a38b);}(_0xc932,0x155));var _0x2c93=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xc932[_0x56825b];return _0x69ce77;};'use strict';var _=require(_0x2c93('0x0'));var util=require(_0x2c93('0x1'));var logger=require(_0x2c93('0x2'))(_0x2c93('0x3'));var moment=require(_0x2c93('0x4'));var BPromise=require(_0x2c93('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c93('0x6'));var rimraf=require('rimraf');var config=require(_0x2c93('0x7'));var attributes=require(_0x2c93('0x8'));module['exports']=function(_0x35c89c,_0x3317b8){return _0x35c89c[_0x2c93('0x9')](_0x2c93('0xa'),attributes,{'tableName':_0x2c93('0xb'),'paranoid':![],'indexes':[{'name':_0x2c93('0xc'),'fields':['idField',_0x2c93('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 21c0af6..5cea489 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 _0x41bb=['DeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5aa56b,_0x3f7e61){var _0x259b8d=function(_0x4add05){while(--_0x4add05){_0x5aa56b['push'](_0x5aa56b['shift']());}};_0x259b8d(++_0x3f7e61);}(_0x41bb,0xc5));var _0xb41b=function(_0x177947,_0x2a3514){_0x177947=_0x177947-0x0;var _0x3d5b51=_0x41bb[_0x177947];return _0x3d5b51;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});} \ No newline at end of file +var _0xf4eb=['DeskField,\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(_0x4a09a8,_0x4ed12d){var _0x7d30a9=function(_0x459184){while(--_0x459184){_0x4a09a8['push'](_0x4a09a8['shift']());}};_0x7d30a9(++_0x4ed12d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3086de,_0x1ba118){_0x3086de=_0x3086de-0x0;var _0xb51c10=_0xf4eb[_0x3086de];return _0xb51c10;};'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')]('DeskField,\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')]('DeskField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 437c3d5..c2d2474 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 _0xca9a=['destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','delete','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca9a,0xca));var _0xaca9=function(_0x5cde3d,_0x30a08e){_0x5cde3d=_0x5cde3d-0x0;var _0x10e671=_0xca9a[_0x5cde3d];return _0x10e671;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xaca9('0x0'));var express=require(_0xaca9('0x1'));var router=express[_0xaca9('0x2')]();var auth=require(_0xaca9('0x3'));var interaction=require(_0xaca9('0x4'));var config=require(_0xaca9('0x5'));var controller=require(_0xaca9('0x6'));router[_0xaca9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaca9('0x7')]('/:id',auth[_0xaca9('0x8')](),controller['show']);router['get'](_0xaca9('0x9'),auth[_0xaca9('0x8')](),controller[_0xaca9('0xa')]);router[_0xaca9('0x7')](_0xaca9('0xb'),auth['isAuthenticated'](),controller[_0xaca9('0xc')]);router[_0xaca9('0xd')]('/',auth[_0xaca9('0x8')](),controller[_0xaca9('0xe')]);router[_0xaca9('0xd')](_0xaca9('0x9'),auth[_0xaca9('0x8')](),controller['addConfiguration']);router['put']('/:id',auth[_0xaca9('0x8')](),controller[_0xaca9('0xf')]);router[_0xaca9('0x10')](_0xaca9('0x11'),auth[_0xaca9('0x8')](),controller[_0xaca9('0x12')]);module[_0xaca9('0x13')]=router; \ No newline at end of file +var _0x11e6=['delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','create','post','put','update'];(function(_0x578eb3,_0x4d01f1){var _0x1edf62=function(_0x47e7f0){while(--_0x47e7f0){_0x578eb3['push'](_0x578eb3['shift']());}};_0x1edf62(++_0x4d01f1);}(_0x11e6,0x1e2));var _0x611e=function(_0x1323dc,_0x4f78a2){_0x1323dc=_0x1323dc-0x0;var _0x2451a6=_0x11e6[_0x1323dc];return _0x2451a6;};'use strict';var multer=require(_0x611e('0x0'));var util=require(_0x611e('0x1'));var path=require(_0x611e('0x2'));var timeout=require('connect-timeout');var express=require(_0x611e('0x3'));var router=express[_0x611e('0x4')]();var auth=require(_0x611e('0x5'));var interaction=require(_0x611e('0x6'));var config=require('../../config/environment');var controller=require(_0x611e('0x7'));router[_0x611e('0x8')]('/',auth[_0x611e('0x9')](),controller['index']);router['get'](_0x611e('0xa'),auth[_0x611e('0x9')](),controller['show']);router[_0x611e('0x8')](_0x611e('0xb'),auth[_0x611e('0x9')](),controller['getConfigurations']);router['get'](_0x611e('0xc'),auth[_0x611e('0x9')](),controller[_0x611e('0xd')]);router['post']('/',auth[_0x611e('0x9')](),controller[_0x611e('0xe')]);router[_0x611e('0xf')](_0x611e('0xb'),auth[_0x611e('0x9')](),controller['addConfiguration']);router[_0x611e('0x10')](_0x611e('0xa'),auth[_0x611e('0x9')](),controller[_0x611e('0x11')]);router[_0x611e('0x12')](_0x611e('0xa'),auth[_0x611e('0x9')](),controller['destroy']);module[_0x611e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c70142c..cc3706e 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 _0xa100=['sequelize','STRING'];(function(_0x53a382,_0x21cfcf){var _0x150aca=function(_0x51ecd9){while(--_0x51ecd9){_0x53a382['push'](_0x53a382['shift']());}};_0x150aca(++_0x21cfcf);}(_0xa100,0xb6));var _0x0a10=function(_0x2e1fdb,_0x139dcf){_0x2e1fdb=_0x2e1fdb-0x0;var _0x418086=_0xa100[_0x2e1fdb];return _0x418086;};'use strict';var Sequelize=require(_0x0a10('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a10('0x1')]},'username':{'type':Sequelize[_0x0a10('0x1')]},'password':{'type':Sequelize[_0x0a10('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x0a10('0x1')]},'clientId':{'type':Sequelize[_0x0a10('0x1')]},'clientSecret':{'type':Sequelize[_0x0a10('0x1')]},'serverUrl':{'type':Sequelize[_0x0a10('0x1')]},'description':{'type':Sequelize[_0x0a10('0x1')]}}; \ No newline at end of file +var _0xf873=['STRING','exports'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0xf873,0xeb));var _0x3f87=function(_0x5f36a6,_0x3c7ce6){_0x5f36a6=_0x5f36a6-0x0;var _0x401565=_0xf873[_0x5f36a6];return _0x401565;};'use strict';var Sequelize=require('sequelize');module[_0x3f87('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3f87('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3f87('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x3f87('0x1')]},'clientSecret':{'type':Sequelize[_0x3f87('0x1')]},'serverUrl':{'type':Sequelize[_0x3f87('0x1')]},'description':{'type':Sequelize[_0x3f87('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 7f8f38c..7a18ddd 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 _0xc86f=['DisplayName','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','name','Dynamics365Account','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','map','type','key','field','include','findAll','rows','show','params','includeAll','options','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','remoteUri','clientId','clientSecret','format','%s/api/data/v9.0/','tenantId','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','GET','EntityDefinitions(','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','MetadataId','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','statusCode','send','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Options','Label','Value','LogicalName'];(function(_0x2317af,_0x1332d3){var _0x3cb58d=function(_0x4e75a0){while(--_0x4e75a0){_0x2317af['push'](_0x2317af['shift']());}};_0x3cb58d(++_0x1332d3);}(_0xc86f,0xe0));var _0xfc86=function(_0x1d8679,_0x32a98f){_0x1d8679=_0x1d8679-0x0;var _0x427125=_0xc86f[_0x1d8679];return _0x427125;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc86('0x0'));var rimraf=require(_0xfc86('0x1'));var zipdir=require(_0xfc86('0x2'));var jsonpatch=require(_0xfc86('0x3'));var rp=require(_0xfc86('0x4'));var moment=require(_0xfc86('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfc86('0x6'));var path=require(_0xfc86('0x7'));var sox=require('sox');var csv=require(_0xfc86('0x8'));var ejs=require(_0xfc86('0x9'));var fs=require('fs');var _=require(_0xfc86('0xa'));var squel=require(_0xfc86('0xb'));var crypto=require(_0xfc86('0xc'));var jsforce=require(_0xfc86('0xd'));var deskjs=require(_0xfc86('0xe'));var toCsv=require(_0xfc86('0x8'));var querystring=require(_0xfc86('0xf'));var Papa=require(_0xfc86('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfc86('0x11'));var logger=require('../../config/logger')(_0xfc86('0x12'));var utils=require(_0xfc86('0x13'));var config=require(_0xfc86('0x14'));var db=require(_0xfc86('0x15'))['db'];var integrations=require(_0xfc86('0x16'));var jayson=require(_0xfc86('0x17'));var client=jayson[_0xfc86('0x18')][_0xfc86('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4bcc1a,_0xa6f2a1,_0x13dfbc){if(_0x13dfbc){var _0x194c1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x194c1d[_0xfc86('0x1a')](_0xa6f2a1)){return _0x4bcc1a;}else{throw new Error(_0xfc86('0x1b'));}}else{return _0x4bcc1a;}}function respondWithRpcPromise(_0x1c451c,_0x57cc2e,_0x153695,_0x3e4a63){return new BPromise(function(_0x21371e,_0x1b869b){var _0x2c35cb=_0x3e4a63||client;return _0x2c35cb[_0xfc86('0x1c')](_0x1c451c,_0x153695)[_0xfc86('0x1d')](function(_0x52d5d3){logger['info'](_0xfc86('0x1e'),_0x57cc2e,_0xfc86('0x1f'));logger[_0xfc86('0x20')](_0xfc86('0x21'),_0x57cc2e,_0xfc86('0x1f'),JSON[_0xfc86('0x22')](_0x52d5d3));if(_0x52d5d3['error']){if(_0x52d5d3[_0xfc86('0x23')][_0xfc86('0x24')]===0x1f4){logger['error'](_0xfc86('0x1e'),_0x57cc2e,_0x52d5d3['error']['message']);return _0x1b869b(_0x52d5d3['error'][_0xfc86('0x25')]);}logger[_0xfc86('0x23')]('Dynamics365Account,\x20%s,\x20%s',_0x57cc2e,_0x52d5d3[_0xfc86('0x23')][_0xfc86('0x25')]);return _0x21371e(_0x52d5d3[_0xfc86('0x23')]['message']);}else{logger[_0xfc86('0x26')](_0xfc86('0x1e'),_0x57cc2e,'request\x20sent');_0x21371e(_0x52d5d3['result'][_0xfc86('0x25')]);}})['catch'](function(_0x11d2a9){logger[_0xfc86('0x23')](_0xfc86('0x1e'),_0x57cc2e,_0x11d2a9);_0x1b869b(_0x11d2a9);});});}function respondWithStatusCode(_0x479cb2,_0x15112a){_0x15112a=_0x15112a||0xcc;return function(_0x4310b5){if(_0x4310b5){return _0x479cb2['sendStatus'](_0x15112a);}return _0x479cb2[_0xfc86('0x27')](_0x15112a)[_0xfc86('0x28')]();};}function respondWithResult(_0x150dbc,_0x228624){_0x228624=_0x228624||0xc8;return function(_0x425ab8){if(_0x425ab8){return _0x150dbc[_0xfc86('0x27')](_0x228624)[_0xfc86('0x29')](_0x425ab8);}};}function respondWithFilteredResult(_0x2b9a90,_0x5f08a3){return function(_0x2fd3f9){if(_0x2fd3f9){var _0x23bbce=_0x2fd3f9[_0xfc86('0x2a')],_0x13403b=_0x5f08a3['offset'],_0x49947c=_0x5f08a3[_0xfc86('0x2b')]+_0x5f08a3[_0xfc86('0x2c')],_0xd12672;if(_0x49947c>=_0x23bbce){_0x49947c=_0x23bbce;_0xd12672=0xc8;}else{_0xd12672=0xce;}_0x2b9a90[_0xfc86('0x27')](_0xd12672);return _0x2b9a90[_0xfc86('0x2d')](_0xfc86('0x2e'),_0x13403b+'-'+_0x49947c+'/'+_0x23bbce)[_0xfc86('0x29')](_0x2fd3f9);}return null;};}function patchUpdates(_0x10e8c6){return function(_0x56f2e3){try{jsonpatch[_0xfc86('0x2f')](_0x56f2e3,_0x10e8c6,!![]);}catch(_0x24d1a7){return BPromise[_0xfc86('0x30')](_0x24d1a7);}return _0x56f2e3['save']();};}function saveUpdates(_0x46ae6b,_0x41915a){return function(_0x4ed78d){if(_0x4ed78d){return _0x4ed78d[_0xfc86('0x31')](_0x46ae6b)[_0xfc86('0x1d')](function(_0xf2a518){return _0xf2a518;});}return null;};}function removeEntity(_0x1f864b,_0x35c61f){return function(_0x15a87f){if(_0x15a87f){return _0x15a87f[_0xfc86('0x32')]()[_0xfc86('0x1d')](function(){_0x1f864b[_0xfc86('0x27')](0xcc)[_0xfc86('0x28')]();});}};}function handleEntityNotFound(_0xa5ed15,_0x7908b2){return function(_0x372450){if(!_0x372450){_0xa5ed15[_0xfc86('0x33')](0x194);}return _0x372450;};}function handleError(_0x593f78,_0x551818){_0x551818=_0x551818||0x1f4;return function(_0x154d8e){logger[_0xfc86('0x23')](_0x154d8e['stack']);if(_0x154d8e[_0xfc86('0x34')]){delete _0x154d8e[_0xfc86('0x34')];}_0x593f78['status'](_0x551818)['send'](_0x154d8e);};}exports['index']=function(_0x505d7a,_0x5cea60){var _0x5aea48={},_0x153484={},_0x7ceab4={'count':0x0,'rows':[]};var _0x13de7b=db[_0xfc86('0x35')][_0xfc86('0x36')];_0x153484[_0xfc86('0x37')]=_[_0xfc86('0x38')](_0x13de7b);_0x153484['query']=_[_0xfc86('0x38')](_0x505d7a[_0xfc86('0x39')]);_0x153484[_0xfc86('0x3a')]=_[_0xfc86('0x3b')](_0x153484['model'],_0x153484[_0xfc86('0x39')]);_0x5aea48['attributes']=_['intersection'](_0x153484[_0xfc86('0x37')],qs[_0xfc86('0x3c')](_0x505d7a[_0xfc86('0x39')]['fields']));_0x5aea48[_0xfc86('0x3d')]=_0x5aea48[_0xfc86('0x3d')][_0xfc86('0x3e')]?_0x5aea48[_0xfc86('0x3d')]:_0x153484['model'];if(!_0x505d7a[_0xfc86('0x39')][_0xfc86('0x3f')](_0xfc86('0x40'))){_0x5aea48[_0xfc86('0x2c')]=qs[_0xfc86('0x2c')](_0x505d7a[_0xfc86('0x39')]['limit']);_0x5aea48['offset']=qs[_0xfc86('0x2b')](_0x505d7a['query'][_0xfc86('0x2b')]);}_0x5aea48['order']=qs[_0xfc86('0x41')](_0x505d7a['query'][_0xfc86('0x41')]);_0x5aea48['where']=qs['filters'](_[_0xfc86('0x42')](_0x505d7a['query'],_0x153484[_0xfc86('0x3a')]));if(_0x505d7a[_0xfc86('0x39')][_0xfc86('0x43')]){_0x5aea48['where']=_[_0xfc86('0x44')](_0x5aea48[_0xfc86('0x45')],{'$or':_[_0xfc86('0x46')](_0x13de7b,function(_0x233d54){if(_0x233d54[_0xfc86('0x47')][_0xfc86('0x48')]!=='VIRTUAL'){var _0x26242f={};_0x26242f[_0x233d54[_0xfc86('0x49')]]={'$like':'%'+_0x505d7a[_0xfc86('0x39')]['filter']+'%'};return _0x26242f;}})});}_0x5aea48=_[_0xfc86('0x44')]({},_0x5aea48,_0x505d7a['options']);var _0x38b17d={'where':_0x5aea48[_0xfc86('0x45')]};return db[_0xfc86('0x35')][_0xfc86('0x2a')](_0x38b17d)[_0xfc86('0x1d')](function(_0x453395){_0x7ceab4[_0xfc86('0x2a')]=_0x453395;if(_0x505d7a[_0xfc86('0x39')]['includeAll']){_0x5aea48[_0xfc86('0x4a')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xfc86('0x4b')](_0x5aea48);})[_0xfc86('0x1d')](function(_0xf12151){_0x7ceab4[_0xfc86('0x4c')]=_0xf12151;return _0x7ceab4;})[_0xfc86('0x1d')](respondWithFilteredResult(_0x5cea60,_0x5aea48))['catch'](handleError(_0x5cea60,null));};exports[_0xfc86('0x4d')]=function(_0x5b38a0,_0x525031){var _0x1634ff={'raw':![],'where':{'id':_0x5b38a0[_0xfc86('0x4e')]['id']}},_0xc94881={};_0xc94881[_0xfc86('0x37')]=_[_0xfc86('0x38')](db[_0xfc86('0x35')]['rawAttributes']);_0xc94881[_0xfc86('0x39')]=_[_0xfc86('0x38')](_0x5b38a0[_0xfc86('0x39')]);_0xc94881['filters']=_['intersection'](_0xc94881[_0xfc86('0x37')],_0xc94881[_0xfc86('0x39')]);_0x1634ff[_0xfc86('0x3d')]=_[_0xfc86('0x3b')](_0xc94881['model'],qs['fields'](_0x5b38a0[_0xfc86('0x39')][_0xfc86('0x3c')]));_0x1634ff[_0xfc86('0x3d')]=_0x1634ff[_0xfc86('0x3d')][_0xfc86('0x3e')]?_0x1634ff[_0xfc86('0x3d')]:_0xc94881[_0xfc86('0x37')];if(_0x5b38a0[_0xfc86('0x39')][_0xfc86('0x4f')]){_0x1634ff[_0xfc86('0x4a')]=[{'all':!![]}];}_0x1634ff=_[_0xfc86('0x44')]({},_0x1634ff,_0x5b38a0[_0xfc86('0x50')]);return db[_0xfc86('0x35')]['find'](_0x1634ff)[_0xfc86('0x1d')](handleEntityNotFound(_0x525031,null))[_0xfc86('0x1d')](respondWithResult(_0x525031,null))[_0xfc86('0x51')](handleError(_0x525031,null));};exports[_0xfc86('0x52')]=function(_0x2d7918,_0x5c7519){return db[_0xfc86('0x35')]['create'](_0x2d7918[_0xfc86('0x53')],{})['then'](respondWithResult(_0x5c7519,0xc9))[_0xfc86('0x51')](handleError(_0x5c7519,null));};exports[_0xfc86('0x31')]=function(_0x10b15c,_0x47b7f0){if(_0x10b15c[_0xfc86('0x53')]['id']){delete _0x10b15c[_0xfc86('0x53')]['id'];}return db[_0xfc86('0x35')]['find']({'where':{'id':_0x10b15c[_0xfc86('0x4e')]['id']}})['then'](handleEntityNotFound(_0x47b7f0,null))['then'](saveUpdates(_0x10b15c[_0xfc86('0x53')],null))['then'](respondWithResult(_0x47b7f0,null))[_0xfc86('0x51')](handleError(_0x47b7f0,null));};exports[_0xfc86('0x32')]=function(_0x160b93,_0x2e6a70){return db['Dynamics365Account']['find']({'where':{'id':_0x160b93[_0xfc86('0x4e')]['id']}})[_0xfc86('0x1d')](handleEntityNotFound(_0x2e6a70,null))[_0xfc86('0x1d')](removeEntity(_0x2e6a70,null))[_0xfc86('0x51')](handleError(_0x2e6a70,null));};exports[_0xfc86('0x54')]=function(_0x2767fc,_0x57fe71,_0xd7993){var _0x9a9f04={};var _0x360e2c={};var _0x46f3a8;var _0x2375ab;return db[_0xfc86('0x35')][_0xfc86('0x55')]({'where':{'id':_0x2767fc[_0xfc86('0x4e')]['id']}})[_0xfc86('0x1d')](handleEntityNotFound(_0x57fe71,null))[_0xfc86('0x1d')](function(_0x81ffc7){if(_0x81ffc7){_0x46f3a8=_0x81ffc7;_0x360e2c['model']=_['keys'](db[_0xfc86('0x56')][_0xfc86('0x36')]);_0x360e2c['query']=_['keys'](_0x2767fc['query']);_0x360e2c['filters']=_['intersection'](_0x360e2c[_0xfc86('0x37')],_0x360e2c[_0xfc86('0x39')]);_0x9a9f04['attributes']=_['intersection'](_0x360e2c[_0xfc86('0x37')],qs[_0xfc86('0x3c')](_0x2767fc[_0xfc86('0x39')][_0xfc86('0x3c')]));_0x9a9f04[_0xfc86('0x3d')]=_0x9a9f04[_0xfc86('0x3d')][_0xfc86('0x3e')]?_0x9a9f04['attributes']:_0x360e2c[_0xfc86('0x37')];_0x9a9f04[_0xfc86('0x57')]=qs[_0xfc86('0x41')](_0x2767fc[_0xfc86('0x39')][_0xfc86('0x41')]);_0x9a9f04[_0xfc86('0x45')]=qs[_0xfc86('0x3a')](_['pick'](_0x2767fc[_0xfc86('0x39')],_0x360e2c[_0xfc86('0x3a')]));if(_0x2767fc[_0xfc86('0x39')][_0xfc86('0x43')]){_0x9a9f04['where']=_[_0xfc86('0x44')](_0x9a9f04[_0xfc86('0x45')],{'$or':_[_0xfc86('0x46')](_0x9a9f04[_0xfc86('0x3d')],function(_0x3be8a7){var _0x5da119={};_0x5da119[_0x3be8a7]={'$like':'%'+_0x2767fc[_0xfc86('0x39')][_0xfc86('0x43')]+'%'};return _0x5da119;})});}_0x9a9f04=_['merge']({},_0x9a9f04,_0x2767fc['options']);return _0x46f3a8[_0xfc86('0x54')](_0x9a9f04);}})[_0xfc86('0x1d')](function(_0x45f263){if(_0x45f263){_0x2375ab=_0x45f263['length'];if(!_0x2767fc[_0xfc86('0x39')]['hasOwnProperty'](_0xfc86('0x40'))){_0x9a9f04[_0xfc86('0x2c')]=qs[_0xfc86('0x2c')](_0x2767fc['query'][_0xfc86('0x2c')]);_0x9a9f04[_0xfc86('0x2b')]=qs[_0xfc86('0x2b')](_0x2767fc[_0xfc86('0x39')][_0xfc86('0x2b')]);}return _0x46f3a8['getConfigurations'](_0x9a9f04);}})['then'](function(_0x1d33dd){if(_0x1d33dd){return _0x1d33dd?{'count':_0x2375ab,'rows':_0x1d33dd}:null;}})[_0xfc86('0x1d')](respondWithResult(_0x57fe71,null))[_0xfc86('0x51')](handleError(_0x57fe71,null));};exports[_0xfc86('0x58')]=function(_0x39b66a,_0xf515f9,_0x3a977f){if(_0x39b66a['body']['id']){delete _0x39b66a[_0xfc86('0x53')]['id'];}return db[_0xfc86('0x35')][_0xfc86('0x55')]({'where':{'id':_0x39b66a[_0xfc86('0x4e')]['id']}})['then'](handleEntityNotFound(_0xf515f9,null))[_0xfc86('0x1d')](function(_0x386497){if(_0x386497){_0x39b66a['body']['AccountId']=_0x386497['id'];_0x39b66a['body'][_0xfc86('0x59')]=integrations[_0xfc86('0x5a')](_0x39b66a[_0xfc86('0x53')][_0xfc86('0x5b')],_0x39b66a['body'][_0xfc86('0x47')]);_0x39b66a['body'][_0xfc86('0x5c')]=integrations[_0xfc86('0x5d')](_0x39b66a[_0xfc86('0x53')][_0xfc86('0x5b')],_0x39b66a[_0xfc86('0x53')][_0xfc86('0x47')]);return db[_0xfc86('0x56')][_0xfc86('0x52')](_0x39b66a[_0xfc86('0x53')],{'include':[{'model':db[_0xfc86('0x5e')],'as':_0xfc86('0x59')},{'model':db[_0xfc86('0x5e')],'as':'Descriptions'}]});}return null;})[_0xfc86('0x1d')](respondWithResult(_0xf515f9,null))[_0xfc86('0x51')](handleError(_0xf515f9,null));};exports[_0xfc86('0x5f')]=function(_0x4b8063,_0x5ae3f5,_0x531916){var _0xe8f63f=_0x4b8063[_0xfc86('0x39')][_0xfc86('0x60')];var _0xfade09=_0xe8f63f===_0xfc86('0x61')?'Incident':_0xfc86('0x62');var _0x5f1184='';var _0xb77c03='';var _0x3a7885='';var _0x441780='';var _0x3575ad='';var _0x167bf0='';var _0x4f9a6c='';var _0x39b9a4='';var _0x162f9e=['title',_0xfc86('0x63'),_0xfc86('0x64'),_0xfc86('0x65'),_0xfc86('0x66'),_0xfc86('0x67'),_0xfc86('0x68'),_0xfc86('0x69'),_0xfc86('0x6a'),'phonecall_activity_parties'];var _0x229689=['accountidname',_0xfc86('0x6b'),_0xfc86('0x6c'),_0xfc86('0x6d'),_0xfc86('0x6e'),'contactidyominame',_0xfc86('0x6f'),_0xfc86('0x70'),_0xfc86('0x71'),'createdbyexternalpartyyominame','createdbyname',_0xfc86('0x72'),'createdon',_0xfc86('0x73'),'createdonbehalfbyyominame',_0xfc86('0x74'),'customeridtype',_0xfc86('0x75'),_0xfc86('0x76'),_0xfc86('0x77'),'entityimage_timestamp',_0xfc86('0x78'),_0xfc86('0x79'),'exchangerate','firstresponsebykpiidname',_0xfc86('0x7a'),_0xfc86('0x7b'),'influencescore',_0xfc86('0x7c'),_0xfc86('0x7d'),_0xfc86('0x7e'),_0xfc86('0x7f'),_0xfc86('0x80'),'modifiedbyname','modifiedbyyominame','modifiedon',_0xfc86('0x81'),_0xfc86('0x82'),_0xfc86('0x83'),_0xfc86('0x84'),_0xfc86('0x85'),_0xfc86('0x86'),_0xfc86('0x87'),'owneridname',_0xfc86('0x88'),_0xfc86('0x89'),_0xfc86('0x8a'),_0xfc86('0x8b'),_0xfc86('0x8c'),_0xfc86('0x8d'),_0xfc86('0x8e'),_0xfc86('0x8f'),_0xfc86('0x90'),_0xfc86('0x91'),_0xfc86('0x92'),_0xfc86('0x93'),_0xfc86('0x94'),_0xfc86('0x95'),_0xfc86('0x96'),_0xfc86('0x97'),_0xfc86('0x98'),_0xfc86('0x99'),_0xfc86('0x9a'),_0xfc86('0x9b'),'ticketnumber',_0xfc86('0x9c'),_0xfc86('0x9d'),'traversedpath',_0xfc86('0x9e'),'versionnumber'];var _0x530eae=_0x162f9e[_0xfc86('0x9f')](_0x229689);return db[_0xfc86('0x35')][_0xfc86('0x55')]({'where':{'id':_0x4b8063[_0xfc86('0x4e')]['id']},'attributes':['id',_0xfc86('0xa0'),_0xfc86('0xa1'),_0xfc86('0xa2'),'tenantId',_0xfc86('0xa3'),_0xfc86('0xa4')]})['then'](handleEntityNotFound(_0x5ae3f5,null))[_0xfc86('0x1d')](function(_0x220c58){if(_0x220c58){_0x39b9a4=_0x220c58[_0xfc86('0xa2')];var _0x4e963d=_0x39b9a4['slice'](-0x1);if(_0x4e963d==='/'){_0x39b9a4=_0x39b9a4['substring'](0x0,_0x39b9a4['lastIndexOf'](_0x4e963d));}_0x4f9a6c=util[_0xfc86('0xa5')](_0xfc86('0xa6'),_0x39b9a4);var _0x514faf={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x220c58[_0xfc86('0xa7')]+'/oauth2/token','form':{'client_id':_0x220c58[_0xfc86('0xa3')],'resource':_0x39b9a4,'username':_0x220c58[_0xfc86('0xa0')],'password':_0x220c58[_0xfc86('0xa1')],'grant_type':_0xfc86('0xa1'),'client_secret':_0x220c58[_0xfc86('0xa4')]},'json':!![]};return rp(_0x514faf);}})[_0xfc86('0x1d')](function(_0x43030e){_0x167bf0=_0x43030e[_0xfc86('0xa8')];var _0x162960={'method':'GET','uri':encodeURI(_0x4f9a6c+_0xfc86('0xa9')+_0xfade09+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x167bf0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x162960);})[_0xfc86('0x1d')](function(_0x113dc1){var _0x372bdb=_0x113dc1[_0xfc86('0xaa')][0x0];var _0x4599bd=_0x372bdb['MetadataId'];var _0x22e415={'method':_0xfc86('0xab'),'uri':_0x4f9a6c+_0xfc86('0xac')+_0x4599bd+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xfc86('0xad')+_0x167bf0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x22e415);})[_0xfc86('0x1d')](function(_0x132862){_0x5f1184=_0x132862;_0xb77c03=_0x5f1184[_0xfc86('0xae')];_0xb77c03=_[_0xfc86('0xaf')](_0xb77c03,function(_0x111149){return!_0x530eae[_0xfc86('0xb0')](_0x111149['LogicalName']);});var _0x7e110b=[];var _0xb68a73=[];_0xb77c03[_0xfc86('0xb1')](function(_0x30e0d0){if(_0x30e0d0[_0xfc86('0xb2')]){var _0xab5cb6=_0x30e0d0[_0xfc86('0xb2')][_0xfc86('0xb3')](_0x30e0d0[_0xfc86('0xb2')][_0xfc86('0xb4')]('.')+0x1);if(_0xab5cb6===_0xfc86('0xb5')){_0x7e110b[_0xfc86('0xb6')](getSelectList(_0x4f9a6c,_0xe8f63f,_0xb68a73,_0x5f1184['MetadataId'],_0x30e0d0['MetadataId'],_0x167bf0));}}});return Promise[_0xfc86('0xb7')](_0x7e110b);})[_0xfc86('0x1d')](function(_0x14282d){_0x3a7885=_0x14282d[0x0];var _0x501ea6=[];var _0xe25824=[];_0xb77c03[_0xfc86('0xb1')](function(_0x2414a9){if(!_[_0xfc86('0xb8')](_0x2414a9['@odata.type'])){var _0x372ea0=_0x2414a9[_0xfc86('0xb2')][_0xfc86('0xb3')](_0x2414a9[_0xfc86('0xb2')][_0xfc86('0xb4')]('.')+0x1);if(_0x372ea0===_0xfc86('0xb9')){_0x501ea6[_0xfc86('0xb6')](getBooleanList(_0x4f9a6c,_0xe8f63f,_0xe25824,_0x5f1184[_0xfc86('0xba')],_0x2414a9[_0xfc86('0xba')],_0x167bf0));}}});return Promise['all'](_0x501ea6);})[_0xfc86('0x1d')](function(_0x263135){_0x441780=_0x263135[0x0];var _0x8550f0=[];var _0x51eb5c=[];_0xb77c03[_0xfc86('0xb1')](function(_0x39e41d){if(_0x39e41d[_0xfc86('0xb2')]){var _0x2a56b6=_0x39e41d[_0xfc86('0xb2')][_0xfc86('0xb3')](_0x39e41d[_0xfc86('0xb2')]['lastIndexOf']('.')+0x1);if(_0x2a56b6===_0xfc86('0xbb')||_0x2a56b6===_0xfc86('0xbc')||_0x2a56b6===_0xfc86('0xbd')||_0x2a56b6===_0xfc86('0xbe')||_0x2a56b6===_0xfc86('0xbf')||_0x2a56b6===_0xfc86('0xc0')||_0x2a56b6===_0xfc86('0xc1')||_0x2a56b6==='EntityNameAttributeMetadata'||_0x2a56b6===_0xfc86('0xc2')||_0x2a56b6===_0xfc86('0xc3')){_0x8550f0['push'](getInputList(_0x4f9a6c,_0xe8f63f,_0x2a56b6,_0x51eb5c,_0x5f1184[_0xfc86('0xba')],_0x39e41d[_0xfc86('0xba')],_0x167bf0));}}});return Promise[_0xfc86('0xb7')](_0x8550f0);})['then'](function(_0x56f085){_0x3575ad=_0x56f085[0x0];var _0x323e4f=_0x3a7885[_0xfc86('0x9f')](_0x441780)[_0xfc86('0x9f')](_0x3575ad);var _0x223dda={'count':_0x323e4f[_0xfc86('0x3e')],'rows':_0x323e4f};return _0x223dda;})[_0xfc86('0x1d')](respondWithResult(_0x5ae3f5,null))[_0xfc86('0x51')](function(_0x19bd91){console[_0xfc86('0xc4')]('Dynamics365\x20error:\x20'+_0x19bd91);var _0x317d30=_0x4b8063[_0xfc86('0x39')][_0xfc86('0x1a')]?0x1f4:_0x19bd91[_0xfc86('0xc5')]||0x1f4;logger[_0xfc86('0x23')](_0x19bd91['stack']);delete _0x19bd91[_0xfc86('0x34')];if(_0x317d30===0x191){_0x317d30=0x190;}_0x5ae3f5[_0xfc86('0x27')](_0x317d30)[_0xfc86('0xc6')](_0x4b8063[_0xfc86('0x39')][_0xfc86('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x19bd91[_0xfc86('0xc5')]}:_0x19bd91);});};function getSelectList(_0x5654c3,_0x28c365,_0x58e3ef,_0x29d7ca,_0x711f75,_0xc670b9){var _0xe7d529={'method':_0xfc86('0xab'),'uri':_0x5654c3+_0xfc86('0xac')+_0x29d7ca+')/Attributes('+_0x711f75+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xfc86('0xc7'),'headers':{'Authorization':_0xfc86('0xad')+_0xc670b9,'If-None-Match':null,'OData-Version':_0xfc86('0xc8')},'json':!![]};return rp(_0xe7d529)[_0xfc86('0x1d')](function(_0x36aed2){var _0x2fa948=[];var _0x1ad793=_0x36aed2[_0xfc86('0xc9')][_0xfc86('0xca')];_0x1ad793[_0xfc86('0xb1')](function(_0x5e4618){_0x2fa948[_0xfc86('0xb6')]({'name':_0x5e4618[_0xfc86('0xcb')]['UserLocalizedLabel']['Label'],'value':String(_0x5e4618[_0xfc86('0xcc')])});});var _0x13da50={'id':_0x28c365+'_'+_0x36aed2[_0xfc86('0xcd')],'name':_0x36aed2[_0xfc86('0xce')][_0xfc86('0xcf')][_0xfc86('0xcb')],'custom':![],'options':_0x2fa948};_0x58e3ef[_0xfc86('0xb6')](_0x13da50);return _0x58e3ef;});}function getBooleanList(_0x5e6062,_0x4cbf18,_0x159fdc,_0x38005e,_0x7b79cb,_0x28c4de){var _0x55b4b3={'method':_0xfc86('0xab'),'uri':_0x5e6062+_0xfc86('0xac')+_0x38005e+_0xfc86('0xd0')+_0x7b79cb+_0xfc86('0xd1'),'headers':{'Authorization':_0xfc86('0xad')+_0x28c4de,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x55b4b3)[_0xfc86('0x1d')](function(_0x40985e){var _0x505176=[];_0x505176[_0xfc86('0xb6')]({'name':_0x40985e[_0xfc86('0xc9')][_0xfc86('0xd2')][_0xfc86('0xcb')][_0xfc86('0xcf')][_0xfc86('0xcb')],'value':_0xfc86('0xd3')},{'name':_0x40985e['OptionSet']['FalseOption']['Label'][_0xfc86('0xcf')]['Label'],'value':_0xfc86('0xd4')});var _0x2f5432={'id':_0x4cbf18+'_'+_0x40985e[_0xfc86('0xcd')],'name':_0x40985e[_0xfc86('0xce')][_0xfc86('0xcf')][_0xfc86('0xcb')],'custom':![],'options':_0x505176};_0x159fdc[_0xfc86('0xb6')](_0x2f5432);return _0x159fdc;});}function getInputList(_0x393a4e,_0x4fd22f,_0x1482c3,_0x197658,_0x557f05,_0xbb4580,_0x599e2f){var _0xeed4d8={'method':'GET','uri':_0x393a4e+_0xfc86('0xac')+_0x557f05+_0xfc86('0xd0')+_0xbb4580+_0xfc86('0xd5')+_0x1482c3+_0xfc86('0xd6'),'headers':{'Authorization':_0xfc86('0xad')+_0x599e2f,'If-None-Match':null,'OData-Version':_0xfc86('0xc8')},'json':!![]};return rp(_0xeed4d8)[_0xfc86('0x1d')](function(_0x374fec){var _0x5a4d29={'id':_0x4fd22f+'_'+_0x374fec[_0xfc86('0xcd')],'name':_0x374fec['DisplayName'][_0xfc86('0xcf')]?_0x374fec[_0xfc86('0xce')][_0xfc86('0xcf')]['Label']:_0x374fec[_0xfc86('0xcd')],'custom':![],'options':[]};_0x197658[_0xfc86('0xb6')](_0x5a4d29);return _0x197658;});} \ No newline at end of file +var _0xa6fa=['incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','owneridname','owneridtype','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','slaname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','password','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','LogicalName','forEach','@odata.type','push','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','GET',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','end','status','json','count','offset','limit','set','reject','save','update','destroy','stack','name','send','index','Dynamics365Account','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','key','VIRTUAL','includeAll','include','findAll','show','params','length','find','create','body','getConfigurations','findOne','Dynamics365Configuration','map','options','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields'];(function(_0x61b4c7,_0xf6eafa){var _0x5f57a1=function(_0x5cbc37){while(--_0x5cbc37){_0x61b4c7['push'](_0x61b4c7['shift']());}};_0x5f57a1(++_0xf6eafa);}(_0xa6fa,0x70));var _0xaa6f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa6fa[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xaa6f('0x0'));var emlformat=require(_0xaa6f('0x1'));var rimraf=require(_0xaa6f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaa6f('0x3'));var moment=require(_0xaa6f('0x4'));var BPromise=require(_0xaa6f('0x5'));var Mustache=require(_0xaa6f('0x6'));var util=require(_0xaa6f('0x7'));var path=require(_0xaa6f('0x8'));var sox=require(_0xaa6f('0x9'));var csv=require(_0xaa6f('0xa'));var ejs=require(_0xaa6f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaa6f('0xc'));var crypto=require(_0xaa6f('0xd'));var jsforce=require(_0xaa6f('0xe'));var deskjs=require(_0xaa6f('0xf'));var toCsv=require(_0xaa6f('0xa'));var querystring=require(_0xaa6f('0x10'));var Papa=require(_0xaa6f('0x11'));var Redis=require(_0xaa6f('0x12'));var authService=require(_0xaa6f('0x13'));var qs=require(_0xaa6f('0x14'));var hardwareService=require(_0xaa6f('0x15'));var logger=require(_0xaa6f('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xaa6f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xaa6f('0x18'));var jayson=require(_0xaa6f('0x19'));var client=jayson['client'][_0xaa6f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x65393a,_0x2d88b0,_0x42f9dd){if(_0x42f9dd){var _0x5dd85e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5dd85e[_0xaa6f('0x1b')](_0x2d88b0)){return _0x65393a;}else{throw new Error(_0xaa6f('0x1c'));}}else{return _0x65393a;}}function respondWithRpcPromise(_0x12c568,_0x447659,_0x6181f5,_0x2e6e1c){return new BPromise(function(_0x36f2b7,_0x28ffd3){var _0x3a00a1=_0x2e6e1c||client;return _0x3a00a1[_0xaa6f('0x1d')](_0x12c568,_0x6181f5)[_0xaa6f('0x1e')](function(_0x282fa8){logger[_0xaa6f('0x1f')]('Dynamics365Account,\x20%s,\x20%s',_0x447659,_0xaa6f('0x20'));logger['debug'](_0xaa6f('0x21'),_0x447659,_0xaa6f('0x20'),JSON[_0xaa6f('0x22')](_0x282fa8));if(_0x282fa8['error']){if(_0x282fa8[_0xaa6f('0x23')][_0xaa6f('0x24')]===0x1f4){logger[_0xaa6f('0x23')](_0xaa6f('0x25'),_0x447659,_0x282fa8['error']['message']);return _0x28ffd3(_0x282fa8['error']['message']);}logger[_0xaa6f('0x23')](_0xaa6f('0x25'),_0x447659,_0x282fa8[_0xaa6f('0x23')][_0xaa6f('0x26')]);return _0x36f2b7(_0x282fa8[_0xaa6f('0x23')]['message']);}else{logger[_0xaa6f('0x1f')](_0xaa6f('0x25'),_0x447659,_0xaa6f('0x20'));_0x36f2b7(_0x282fa8[_0xaa6f('0x27')][_0xaa6f('0x26')]);}})[_0xaa6f('0x28')](function(_0x2b9775){logger[_0xaa6f('0x23')](_0xaa6f('0x25'),_0x447659,_0x2b9775);_0x28ffd3(_0x2b9775);});});}function respondWithStatusCode(_0x1a4404,_0x108801){_0x108801=_0x108801||0xcc;return function(_0x514df2){if(_0x514df2){return _0x1a4404['sendStatus'](_0x108801);}return _0x1a4404['status'](_0x108801)[_0xaa6f('0x29')]();};}function respondWithResult(_0x153c16,_0x11a2d6){_0x11a2d6=_0x11a2d6||0xc8;return function(_0xe2eabb){if(_0xe2eabb){return _0x153c16[_0xaa6f('0x2a')](_0x11a2d6)[_0xaa6f('0x2b')](_0xe2eabb);}};}function respondWithFilteredResult(_0x54a2e0,_0x164f1c){return function(_0x2279e2){if(_0x2279e2){var _0x50859d=_0x2279e2[_0xaa6f('0x2c')],_0x191605=_0x164f1c[_0xaa6f('0x2d')],_0x3ceb00=_0x164f1c[_0xaa6f('0x2d')]+_0x164f1c[_0xaa6f('0x2e')],_0x1e5879;if(_0x3ceb00>=_0x50859d){_0x3ceb00=_0x50859d;_0x1e5879=0xc8;}else{_0x1e5879=0xce;}_0x54a2e0['status'](_0x1e5879);return _0x54a2e0[_0xaa6f('0x2f')]('Content-Range',_0x191605+'-'+_0x3ceb00+'/'+_0x50859d)[_0xaa6f('0x2b')](_0x2279e2);}return null;};}function patchUpdates(_0x32e64d){return function(_0x3553df){try{jsonpatch['apply'](_0x3553df,_0x32e64d,!![]);}catch(_0xb1f919){return BPromise[_0xaa6f('0x30')](_0xb1f919);}return _0x3553df[_0xaa6f('0x31')]();};}function saveUpdates(_0x401479,_0xe26e16){return function(_0x4368c9){if(_0x4368c9){return _0x4368c9[_0xaa6f('0x32')](_0x401479)['then'](function(_0x45b729){return _0x45b729;});}return null;};}function removeEntity(_0xd55036,_0x454105){return function(_0x36537c){if(_0x36537c){return _0x36537c[_0xaa6f('0x33')]()[_0xaa6f('0x1e')](function(){_0xd55036[_0xaa6f('0x2a')](0xcc)[_0xaa6f('0x29')]();});}};}function handleEntityNotFound(_0x30b636,_0x285579){return function(_0x490a7a){if(!_0x490a7a){_0x30b636['sendStatus'](0x194);}return _0x490a7a;};}function handleError(_0x217cb0,_0x1ea331){_0x1ea331=_0x1ea331||0x1f4;return function(_0x78a6d6){logger[_0xaa6f('0x23')](_0x78a6d6[_0xaa6f('0x34')]);if(_0x78a6d6[_0xaa6f('0x35')]){delete _0x78a6d6[_0xaa6f('0x35')];}_0x217cb0[_0xaa6f('0x2a')](_0x1ea331)[_0xaa6f('0x36')](_0x78a6d6);};}exports[_0xaa6f('0x37')]=function(_0x127682,_0x45dd06){var _0x7751cd={},_0x4e2973={},_0x543e69={'count':0x0,'rows':[]};var _0x268278=db[_0xaa6f('0x38')][_0xaa6f('0x39')];_0x4e2973[_0xaa6f('0x3a')]=_[_0xaa6f('0x3b')](_0x268278);_0x4e2973['query']=_[_0xaa6f('0x3b')](_0x127682[_0xaa6f('0x3c')]);_0x4e2973[_0xaa6f('0x3d')]=_[_0xaa6f('0x3e')](_0x4e2973['model'],_0x4e2973[_0xaa6f('0x3c')]);_0x7751cd[_0xaa6f('0x3f')]=_[_0xaa6f('0x3e')](_0x4e2973[_0xaa6f('0x3a')],qs[_0xaa6f('0x40')](_0x127682[_0xaa6f('0x3c')]['fields']));_0x7751cd[_0xaa6f('0x3f')]=_0x7751cd['attributes']['length']?_0x7751cd['attributes']:_0x4e2973['model'];if(!_0x127682['query'][_0xaa6f('0x41')]('nolimit')){_0x7751cd[_0xaa6f('0x2e')]=qs[_0xaa6f('0x2e')](_0x127682[_0xaa6f('0x3c')][_0xaa6f('0x2e')]);_0x7751cd[_0xaa6f('0x2d')]=qs[_0xaa6f('0x2d')](_0x127682[_0xaa6f('0x3c')][_0xaa6f('0x2d')]);}_0x7751cd[_0xaa6f('0x42')]=qs[_0xaa6f('0x43')](_0x127682['query'][_0xaa6f('0x43')]);_0x7751cd[_0xaa6f('0x44')]=qs[_0xaa6f('0x3d')](_[_0xaa6f('0x45')](_0x127682[_0xaa6f('0x3c')],_0x4e2973[_0xaa6f('0x3d')]));if(_0x127682['query'][_0xaa6f('0x46')]){_0x7751cd[_0xaa6f('0x44')]=_[_0xaa6f('0x47')](_0x7751cd[_0xaa6f('0x44')],{'$or':_['map'](_0x268278,function(_0x5ae902){if(_0x5ae902['type'][_0xaa6f('0x48')]!==_0xaa6f('0x49')){var _0x24c0e0={};_0x24c0e0[_0x5ae902['field']]={'$like':'%'+_0x127682[_0xaa6f('0x3c')]['filter']+'%'};return _0x24c0e0;}})});}_0x7751cd=_['merge']({},_0x7751cd,_0x127682['options']);var _0x361d55={'where':_0x7751cd[_0xaa6f('0x44')]};return db[_0xaa6f('0x38')][_0xaa6f('0x2c')](_0x361d55)['then'](function(_0x59c372){_0x543e69[_0xaa6f('0x2c')]=_0x59c372;if(_0x127682['query'][_0xaa6f('0x4a')]){_0x7751cd[_0xaa6f('0x4b')]=[{'all':!![]}];}return db[_0xaa6f('0x38')][_0xaa6f('0x4c')](_0x7751cd);})[_0xaa6f('0x1e')](function(_0x1d4431){_0x543e69['rows']=_0x1d4431;return _0x543e69;})[_0xaa6f('0x1e')](respondWithFilteredResult(_0x45dd06,_0x7751cd))['catch'](handleError(_0x45dd06,null));};exports[_0xaa6f('0x4d')]=function(_0x1d288a,_0x29e171){var _0x11f731={'raw':![],'where':{'id':_0x1d288a[_0xaa6f('0x4e')]['id']}},_0x38d211={};_0x38d211[_0xaa6f('0x3a')]=_[_0xaa6f('0x3b')](db['Dynamics365Account'][_0xaa6f('0x39')]);_0x38d211['query']=_[_0xaa6f('0x3b')](_0x1d288a[_0xaa6f('0x3c')]);_0x38d211[_0xaa6f('0x3d')]=_['intersection'](_0x38d211[_0xaa6f('0x3a')],_0x38d211[_0xaa6f('0x3c')]);_0x11f731[_0xaa6f('0x3f')]=_[_0xaa6f('0x3e')](_0x38d211[_0xaa6f('0x3a')],qs[_0xaa6f('0x40')](_0x1d288a[_0xaa6f('0x3c')][_0xaa6f('0x40')]));_0x11f731[_0xaa6f('0x3f')]=_0x11f731[_0xaa6f('0x3f')][_0xaa6f('0x4f')]?_0x11f731[_0xaa6f('0x3f')]:_0x38d211[_0xaa6f('0x3a')];if(_0x1d288a[_0xaa6f('0x3c')][_0xaa6f('0x4a')]){_0x11f731[_0xaa6f('0x4b')]=[{'all':!![]}];}_0x11f731=_['merge']({},_0x11f731,_0x1d288a['options']);return db['Dynamics365Account'][_0xaa6f('0x50')](_0x11f731)['then'](handleEntityNotFound(_0x29e171,null))[_0xaa6f('0x1e')](respondWithResult(_0x29e171,null))[_0xaa6f('0x28')](handleError(_0x29e171,null));};exports[_0xaa6f('0x51')]=function(_0x27bc11,_0x4e4568){return db[_0xaa6f('0x38')][_0xaa6f('0x51')](_0x27bc11['body'],{})[_0xaa6f('0x1e')](respondWithResult(_0x4e4568,0xc9))['catch'](handleError(_0x4e4568,null));};exports[_0xaa6f('0x32')]=function(_0x37c032,_0x465e09){if(_0x37c032[_0xaa6f('0x52')]['id']){delete _0x37c032[_0xaa6f('0x52')]['id'];}return db[_0xaa6f('0x38')][_0xaa6f('0x50')]({'where':{'id':_0x37c032['params']['id']}})[_0xaa6f('0x1e')](handleEntityNotFound(_0x465e09,null))['then'](saveUpdates(_0x37c032[_0xaa6f('0x52')],null))['then'](respondWithResult(_0x465e09,null))[_0xaa6f('0x28')](handleError(_0x465e09,null));};exports['destroy']=function(_0x194299,_0x1420df){return db[_0xaa6f('0x38')]['find']({'where':{'id':_0x194299['params']['id']}})['then'](handleEntityNotFound(_0x1420df,null))[_0xaa6f('0x1e')](removeEntity(_0x1420df,null))[_0xaa6f('0x28')](handleError(_0x1420df,null));};exports[_0xaa6f('0x53')]=function(_0x785b89,_0x2bf834,_0x6b633a){var _0x39199f={};var _0x159f2b={};var _0x28693a;var _0x1ad43a;return db[_0xaa6f('0x38')][_0xaa6f('0x54')]({'where':{'id':_0x785b89[_0xaa6f('0x4e')]['id']}})[_0xaa6f('0x1e')](handleEntityNotFound(_0x2bf834,null))['then'](function(_0x15aec3){if(_0x15aec3){_0x28693a=_0x15aec3;_0x159f2b[_0xaa6f('0x3a')]=_[_0xaa6f('0x3b')](db[_0xaa6f('0x55')][_0xaa6f('0x39')]);_0x159f2b['query']=_[_0xaa6f('0x3b')](_0x785b89[_0xaa6f('0x3c')]);_0x159f2b[_0xaa6f('0x3d')]=_[_0xaa6f('0x3e')](_0x159f2b[_0xaa6f('0x3a')],_0x159f2b[_0xaa6f('0x3c')]);_0x39199f['attributes']=_['intersection'](_0x159f2b[_0xaa6f('0x3a')],qs[_0xaa6f('0x40')](_0x785b89['query'][_0xaa6f('0x40')]));_0x39199f[_0xaa6f('0x3f')]=_0x39199f[_0xaa6f('0x3f')][_0xaa6f('0x4f')]?_0x39199f[_0xaa6f('0x3f')]:_0x159f2b[_0xaa6f('0x3a')];_0x39199f['order']=qs[_0xaa6f('0x43')](_0x785b89[_0xaa6f('0x3c')][_0xaa6f('0x43')]);_0x39199f[_0xaa6f('0x44')]=qs['filters'](_[_0xaa6f('0x45')](_0x785b89[_0xaa6f('0x3c')],_0x159f2b[_0xaa6f('0x3d')]));if(_0x785b89[_0xaa6f('0x3c')][_0xaa6f('0x46')]){_0x39199f[_0xaa6f('0x44')]=_[_0xaa6f('0x47')](_0x39199f[_0xaa6f('0x44')],{'$or':_[_0xaa6f('0x56')](_0x39199f['attributes'],function(_0x3f086c){var _0x4ce257={};_0x4ce257[_0x3f086c]={'$like':'%'+_0x785b89[_0xaa6f('0x3c')][_0xaa6f('0x46')]+'%'};return _0x4ce257;})});}_0x39199f=_[_0xaa6f('0x47')]({},_0x39199f,_0x785b89[_0xaa6f('0x57')]);return _0x28693a[_0xaa6f('0x53')](_0x39199f);}})['then'](function(_0x33c8ac){if(_0x33c8ac){_0x1ad43a=_0x33c8ac['length'];if(!_0x785b89[_0xaa6f('0x3c')][_0xaa6f('0x41')](_0xaa6f('0x58'))){_0x39199f[_0xaa6f('0x2e')]=qs['limit'](_0x785b89[_0xaa6f('0x3c')]['limit']);_0x39199f[_0xaa6f('0x2d')]=qs[_0xaa6f('0x2d')](_0x785b89[_0xaa6f('0x3c')][_0xaa6f('0x2d')]);}return _0x28693a[_0xaa6f('0x53')](_0x39199f);}})[_0xaa6f('0x1e')](function(_0x51ba6c){if(_0x51ba6c){return _0x51ba6c?{'count':_0x1ad43a,'rows':_0x51ba6c}:null;}})[_0xaa6f('0x1e')](respondWithResult(_0x2bf834,null))['catch'](handleError(_0x2bf834,null));};exports[_0xaa6f('0x59')]=function(_0x480f2b,_0x96f5e6,_0x23ebfc){if(_0x480f2b[_0xaa6f('0x52')]['id']){delete _0x480f2b[_0xaa6f('0x52')]['id'];}return db[_0xaa6f('0x38')][_0xaa6f('0x54')]({'where':{'id':_0x480f2b[_0xaa6f('0x4e')]['id']}})[_0xaa6f('0x1e')](handleEntityNotFound(_0x96f5e6,null))[_0xaa6f('0x1e')](function(_0xd820cc){if(_0xd820cc){_0x480f2b['body'][_0xaa6f('0x5a')]=_0xd820cc['id'];_0x480f2b[_0xaa6f('0x52')][_0xaa6f('0x5b')]=integrations[_0xaa6f('0x5c')](_0x480f2b[_0xaa6f('0x52')][_0xaa6f('0x5d')],_0x480f2b[_0xaa6f('0x52')]['type']);_0x480f2b[_0xaa6f('0x52')][_0xaa6f('0x5e')]=integrations[_0xaa6f('0x5f')](_0x480f2b[_0xaa6f('0x52')]['channel'],_0x480f2b['body']['type']);return db['Dynamics365Configuration']['create'](_0x480f2b['body'],{'include':[{'model':db[_0xaa6f('0x60')],'as':_0xaa6f('0x5b')},{'model':db['Dynamics365Field'],'as':_0xaa6f('0x5e')}]});}return null;})[_0xaa6f('0x1e')](respondWithResult(_0x96f5e6,null))[_0xaa6f('0x28')](handleError(_0x96f5e6,null));};exports[_0xaa6f('0x61')]=function(_0x2180cb,_0x21ff62,_0x3a1cf2){var _0x599ad1=_0x2180cb[_0xaa6f('0x3c')]['ticketType'];var _0x1ec2b4=_0x599ad1===_0xaa6f('0x62')?_0xaa6f('0x63'):_0xaa6f('0x64');var _0x244231='';var _0x4b1a32='';var _0xda2dc0='';var _0x3ade19='';var _0x26b470='';var _0x5e644c='';var _0x20921d='';var _0x2502f5='';var _0x52c8df=[_0xaa6f('0x65'),_0xaa6f('0x66'),_0xaa6f('0x67'),_0xaa6f('0x68'),_0xaa6f('0x69'),'subject',_0xaa6f('0x6a'),_0xaa6f('0x6b'),_0xaa6f('0x6c'),_0xaa6f('0x6d')];var _0x1df643=[_0xaa6f('0x6e'),_0xaa6f('0x6f'),'actualserviceunits',_0xaa6f('0x70'),_0xaa6f('0x71'),_0xaa6f('0x72'),'contractdetailidname','contractidname',_0xaa6f('0x73'),'createdbyexternalpartyyominame',_0xaa6f('0x74'),_0xaa6f('0x75'),_0xaa6f('0x76'),_0xaa6f('0x77'),_0xaa6f('0x78'),'customeridname',_0xaa6f('0x79'),_0xaa6f('0x7a'),'emailaddress',_0xaa6f('0x7b'),'entityimage_timestamp','entityimage_url','escalatedon',_0xaa6f('0x7c'),_0xaa6f('0x7d'),_0xaa6f('0x7e'),_0xaa6f('0x7f'),'influencescore','kbarticleidname',_0xaa6f('0x80'),_0xaa6f('0x81'),_0xaa6f('0x82'),_0xaa6f('0x83'),_0xaa6f('0x84'),'modifiedbyyominame',_0xaa6f('0x85'),_0xaa6f('0x86'),_0xaa6f('0x87'),_0xaa6f('0x88'),_0xaa6f('0x89'),'numberofchildincidents','onholdtime','overriddencreatedon',_0xaa6f('0x8a'),_0xaa6f('0x8b'),'owneridyominame',_0xaa6f('0x8c'),_0xaa6f('0x8d'),'primarycontactidyominame',_0xaa6f('0x8e'),_0xaa6f('0x8f'),_0xaa6f('0x90'),_0xaa6f('0x91'),_0xaa6f('0x92'),_0xaa6f('0x93'),_0xaa6f('0x94'),'responsiblecontactidyominame','sentimentvalue',_0xaa6f('0x95'),_0xaa6f('0x96'),'socialprofileidname','statecode','statuscode','subjectidname','ticketnumber',_0xaa6f('0x97'),_0xaa6f('0x98'),_0xaa6f('0x99'),_0xaa6f('0x9a'),'versionnumber'];var _0x2476db=_0x52c8df[_0xaa6f('0x9b')](_0x1df643);return db[_0xaa6f('0x38')][_0xaa6f('0x54')]({'where':{'id':_0x2180cb[_0xaa6f('0x4e')]['id']},'attributes':['id',_0xaa6f('0x9c'),'password','remoteUri',_0xaa6f('0x9d'),_0xaa6f('0x9e'),_0xaa6f('0x9f')]})[_0xaa6f('0x1e')](handleEntityNotFound(_0x21ff62,null))[_0xaa6f('0x1e')](function(_0x4e4b5d){if(_0x4e4b5d){_0x2502f5=_0x4e4b5d[_0xaa6f('0xa0')];var _0x22f3e6=_0x2502f5[_0xaa6f('0xa1')](-0x1);if(_0x22f3e6==='/'){_0x2502f5=_0x2502f5[_0xaa6f('0xa2')](0x0,_0x2502f5[_0xaa6f('0xa3')](_0x22f3e6));}_0x20921d=util[_0xaa6f('0xa4')](_0xaa6f('0xa5'),_0x2502f5);var _0x7a71a={'method':_0xaa6f('0xa6'),'uri':'https://login.microsoftonline.com/'+_0x4e4b5d[_0xaa6f('0x9d')]+_0xaa6f('0xa7'),'form':{'client_id':_0x4e4b5d[_0xaa6f('0x9e')],'resource':_0x2502f5,'username':_0x4e4b5d[_0xaa6f('0x9c')],'password':_0x4e4b5d[_0xaa6f('0xa8')],'grant_type':'password','client_secret':_0x4e4b5d[_0xaa6f('0x9f')]},'json':!![]};return rp(_0x7a71a);}})[_0xaa6f('0x1e')](function(_0x3ac33f){_0x5e644c=_0x3ac33f[_0xaa6f('0xa9')];var _0x14c06d={'method':'GET','uri':encodeURI(_0x20921d+_0xaa6f('0xaa')+_0x1ec2b4+'\x27'),'headers':{'Authorization':_0xaa6f('0xab')+_0x5e644c,'If-None-Match':null,'OData-Version':_0xaa6f('0xac')},'json':!![]};return rp(_0x14c06d);})[_0xaa6f('0x1e')](function(_0xfe4a20){var _0x48373a=_0xfe4a20[_0xaa6f('0xad')][0x0];var _0x587e18=_0x48373a[_0xaa6f('0xae')];var _0x14a54a={'method':'GET','uri':_0x20921d+_0xaa6f('0xaf')+_0x587e18+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x5e644c,'If-None-Match':null,'OData-Version':_0xaa6f('0xac')},'json':!![]};return rp(_0x14a54a);})[_0xaa6f('0x1e')](function(_0xf2662b){_0x244231=_0xf2662b;_0x4b1a32=_0x244231[_0xaa6f('0xb0')];_0x4b1a32=_[_0xaa6f('0xb1')](_0x4b1a32,function(_0x1dd95e){return!_0x2476db['includes'](_0x1dd95e[_0xaa6f('0xb2')]);});var _0x50526d=[];var _0x4f30b7=[];_0x4b1a32[_0xaa6f('0xb3')](function(_0x2077d4){if(_0x2077d4[_0xaa6f('0xb4')]){var _0x389799=_0x2077d4['@odata.type']['substring'](_0x2077d4['@odata.type'][_0xaa6f('0xa3')]('.')+0x1);if(_0x389799==='PicklistAttributeMetadata'){_0x50526d[_0xaa6f('0xb5')](getSelectList(_0x20921d,_0x599ad1,_0x4f30b7,_0x244231[_0xaa6f('0xae')],_0x2077d4[_0xaa6f('0xae')],_0x5e644c));}}});return Promise['all'](_0x50526d);})[_0xaa6f('0x1e')](function(_0x4116e7){_0xda2dc0=_0x4116e7[0x0];var _0x9b7d9a=[];var _0x55839b=[];_0x4b1a32[_0xaa6f('0xb3')](function(_0x30d839){if(!_[_0xaa6f('0xb6')](_0x30d839[_0xaa6f('0xb4')])){var _0x1455c7=_0x30d839['@odata.type'][_0xaa6f('0xa2')](_0x30d839['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1455c7===_0xaa6f('0xb7')){_0x9b7d9a['push'](getBooleanList(_0x20921d,_0x599ad1,_0x55839b,_0x244231[_0xaa6f('0xae')],_0x30d839['MetadataId'],_0x5e644c));}}});return Promise[_0xaa6f('0xb8')](_0x9b7d9a);})[_0xaa6f('0x1e')](function(_0x525d26){_0x3ade19=_0x525d26[0x0];var _0x5f2942=[];var _0x294c25=[];_0x4b1a32['forEach'](function(_0x517dfa){if(_0x517dfa[_0xaa6f('0xb4')]){var _0x4ceef0=_0x517dfa[_0xaa6f('0xb4')]['substring'](_0x517dfa['@odata.type'][_0xaa6f('0xa3')]('.')+0x1);if(_0x4ceef0===_0xaa6f('0xb9')||_0x4ceef0===_0xaa6f('0xba')||_0x4ceef0===_0xaa6f('0xbb')||_0x4ceef0===_0xaa6f('0xbc')||_0x4ceef0==='MemoAttributeMetadata'||_0x4ceef0===_0xaa6f('0xbd')||_0x4ceef0===_0xaa6f('0xbe')||_0x4ceef0===_0xaa6f('0xbf')||_0x4ceef0==='StateAttributeMetadata'||_0x4ceef0===_0xaa6f('0xc0')){_0x5f2942[_0xaa6f('0xb5')](getInputList(_0x20921d,_0x599ad1,_0x4ceef0,_0x294c25,_0x244231['MetadataId'],_0x517dfa[_0xaa6f('0xae')],_0x5e644c));}}});return Promise[_0xaa6f('0xb8')](_0x5f2942);})[_0xaa6f('0x1e')](function(_0x5c1e5d){_0x26b470=_0x5c1e5d[0x0];var _0x1c9f14=_0xda2dc0['concat'](_0x3ade19)[_0xaa6f('0x9b')](_0x26b470);var _0x3c6ce7={'count':_0x1c9f14[_0xaa6f('0x4f')],'rows':_0x1c9f14};return _0x3c6ce7;})[_0xaa6f('0x1e')](respondWithResult(_0x21ff62,null))['catch'](function(_0x207071){console[_0xaa6f('0xc1')](_0xaa6f('0xc2')+_0x207071);var _0x329c44=_0x2180cb['query'][_0xaa6f('0x1b')]?0x1f4:_0x207071['statusCode']||0x1f4;logger[_0xaa6f('0x23')](_0x207071[_0xaa6f('0x34')]);delete _0x207071[_0xaa6f('0x35')];if(_0x329c44===0x191){_0x329c44=0x190;}_0x21ff62['status'](_0x329c44)[_0xaa6f('0x36')](_0x2180cb[_0xaa6f('0x3c')][_0xaa6f('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x207071['statusCode']}:_0x207071);});};function getSelectList(_0x3d1ada,_0x1958b0,_0x267f0a,_0x1c15ba,_0x36e166,_0xd6e8b7){var _0x24f323={'method':_0xaa6f('0xc3'),'uri':_0x3d1ada+'EntityDefinitions('+_0x1c15ba+_0xaa6f('0xc4')+_0x36e166+_0xaa6f('0xc5')+_0xaa6f('0xc6'),'headers':{'Authorization':'Bearer\x20'+_0xd6e8b7,'If-None-Match':null,'OData-Version':_0xaa6f('0xac')},'json':!![]};return rp(_0x24f323)['then'](function(_0x2d2fe3){var _0x5006d4=[];var _0x4f3f5d=_0x2d2fe3[_0xaa6f('0xc7')][_0xaa6f('0xc8')];_0x4f3f5d['forEach'](function(_0x1133d9){_0x5006d4[_0xaa6f('0xb5')]({'name':_0x1133d9['Label'][_0xaa6f('0xc9')][_0xaa6f('0xca')],'value':String(_0x1133d9[_0xaa6f('0xcb')])});});var _0x163ad3={'id':_0x1958b0+'_'+_0x2d2fe3[_0xaa6f('0xb2')],'name':_0x2d2fe3[_0xaa6f('0xcc')][_0xaa6f('0xc9')][_0xaa6f('0xca')],'custom':![],'options':_0x5006d4};_0x267f0a[_0xaa6f('0xb5')](_0x163ad3);return _0x267f0a;});}function getBooleanList(_0x5b610a,_0x39d541,_0x772d99,_0x10d32a,_0x21e8ad,_0x5209c6){var _0x3264c9={'method':_0xaa6f('0xc3'),'uri':_0x5b610a+_0xaa6f('0xaf')+_0x10d32a+_0xaa6f('0xc4')+_0x21e8ad+_0xaa6f('0xcd'),'headers':{'Authorization':_0xaa6f('0xab')+_0x5209c6,'If-None-Match':null,'OData-Version':_0xaa6f('0xac')},'json':!![]};return rp(_0x3264c9)['then'](function(_0x5d892e){var _0x118628=[];_0x118628['push']({'name':_0x5d892e[_0xaa6f('0xc7')][_0xaa6f('0xce')]['Label']['UserLocalizedLabel']['Label'],'value':'true'},{'name':_0x5d892e[_0xaa6f('0xc7')][_0xaa6f('0xcf')][_0xaa6f('0xca')]['UserLocalizedLabel'][_0xaa6f('0xca')],'value':_0xaa6f('0xd0')});var _0x2c4ba9={'id':_0x39d541+'_'+_0x5d892e['LogicalName'],'name':_0x5d892e[_0xaa6f('0xcc')][_0xaa6f('0xc9')][_0xaa6f('0xca')],'custom':![],'options':_0x118628};_0x772d99[_0xaa6f('0xb5')](_0x2c4ba9);return _0x772d99;});}function getInputList(_0x3fc613,_0x5761d9,_0x1046c7,_0x58a610,_0x1fc5f1,_0x35617e,_0x113b47){var _0x180d81={'method':_0xaa6f('0xc3'),'uri':_0x3fc613+'EntityDefinitions('+_0x1fc5f1+')/Attributes('+_0x35617e+_0xaa6f('0xd1')+_0x1046c7+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xaa6f('0xab')+_0x113b47,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x180d81)[_0xaa6f('0x1e')](function(_0x49122a){var _0x327397={'id':_0x5761d9+'_'+_0x49122a['LogicalName'],'name':_0x49122a[_0xaa6f('0xcc')][_0xaa6f('0xc9')]?_0x49122a[_0xaa6f('0xcc')][_0xaa6f('0xc9')]['Label']:_0x49122a[_0xaa6f('0xb2')],'custom':![],'options':[]};_0x58a610['push'](_0x327397);return _0x58a610;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 0c02043..6b57fb3 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 _0x1470=['int_dynamics365_accounts','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4ab049,_0x285d29){var _0x407d4b=function(_0x1114cb){while(--_0x1114cb){_0x4ab049['push'](_0x4ab049['shift']());}};_0x407d4b(++_0x285d29);}(_0x1470,0xcd));var _0x0147=function(_0x4fe778,_0x54f502){_0x4fe778=_0x4fe778-0x0;var _0x2ae46b=_0x1470[_0x4fe778];return _0x2ae46b;};'use strict';var _=require(_0x0147('0x0'));var util=require(_0x0147('0x1'));var logger=require(_0x0147('0x2'))('api');var moment=require(_0x0147('0x3'));var BPromise=require('bluebird');var rp=require(_0x0147('0x4'));var fs=require('fs');var path=require(_0x0147('0x5'));var rimraf=require(_0x0147('0x6'));var config=require('../../config/environment');var attributes=require(_0x0147('0x7'));var integrations=require(_0x0147('0x8'));module[_0x0147('0x9')]=function(_0x1e2df9,_0x2e3222){return _0x1e2df9[_0x0147('0xa')]('Dynamics365Account',attributes,{'tableName':_0x0147('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff7f=['moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','Dynamics365Account','int_dynamics365_accounts','util','../../config/logger'];(function(_0x190660,_0x53385b){var _0x36cd92=function(_0x1204b0){while(--_0x1204b0){_0x190660['push'](_0x190660['shift']());}};_0x36cd92(++_0x53385b);}(_0xff7f,0xa6));var _0xfff7=function(_0x25c6ef,_0x19e2bb){_0x25c6ef=_0x25c6ef-0x0;var _0x2adef6=_0xff7f[_0x25c6ef];return _0x2adef6;};'use strict';var _=require('lodash');var util=require(_0xfff7('0x0'));var logger=require(_0xfff7('0x1'))('api');var moment=require(_0xfff7('0x2'));var BPromise=require(_0xfff7('0x3'));var rp=require(_0xfff7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfff7('0x5'));var config=require(_0xfff7('0x6'));var attributes=require(_0xfff7('0x7'));var integrations=require(_0xfff7('0x8'));module[_0xfff7('0x9')]=function(_0x19a497,_0x106086){return _0x19a497['define'](_0xfff7('0xa'),attributes,{'tableName':_0xfff7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 319f696..9f53c74 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 _0x3462=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','ShowDynamics365Account'];(function(_0x1d0e23,_0x66c6eb){var _0x404656=function(_0x311b3a){while(--_0x311b3a){_0x1d0e23['push'](_0x1d0e23['shift']());}};_0x404656(++_0x66c6eb);}(_0x3462,0x70));var _0x2346=function(_0x79443b,_0x4b8fcd){_0x79443b=_0x79443b-0x0;var _0xf0dc16=_0x3462[_0x79443b];return _0xf0dc16;};'use strict';var _=require(_0x2346('0x0'));var util=require(_0x2346('0x1'));var moment=require(_0x2346('0x2'));var BPromise=require(_0x2346('0x3'));var rs=require(_0x2346('0x4'));var fs=require('fs');var Redis=require(_0x2346('0x5'));var db=require(_0x2346('0x6'))['db'];var utils=require(_0x2346('0x7'));var logger=require(_0x2346('0x8'))(_0x2346('0x9'));var config=require(_0x2346('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2346('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314b99,_0x276737,_0x3e987d){return new BPromise(function(_0x5890aa,_0x484d2a){return client[_0x2346('0xc')](_0x314b99,_0x3e987d)[_0x2346('0xd')](function(_0x16665f){logger[_0x2346('0xe')](_0x2346('0xf'),_0x276737,_0x2346('0x10'));logger[_0x2346('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x276737,_0x2346('0x10'),JSON[_0x2346('0x12')](_0x16665f));if(_0x16665f[_0x2346('0x13')]){if(_0x16665f[_0x2346('0x13')][_0x2346('0x14')]===0x1f4){logger[_0x2346('0x13')](_0x2346('0xf'),_0x276737,_0x16665f[_0x2346('0x13')][_0x2346('0x15')]);return _0x484d2a(_0x16665f[_0x2346('0x13')]['message']);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x276737,_0x16665f[_0x2346('0x13')][_0x2346('0x15')]);return _0x5890aa(_0x16665f['error'][_0x2346('0x15')]);}else{logger[_0x2346('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x276737,_0x2346('0x10'));_0x5890aa(_0x16665f[_0x2346('0x16')][_0x2346('0x15')]);}})[_0x2346('0x17')](function(_0x5720e6){logger[_0x2346('0x13')](_0x2346('0xf'),_0x276737,_0x5720e6);_0x484d2a(_0x5720e6);});});}exports[_0x2346('0x18')]=function(_0x49b31e){var _0x567fe0=this;return new Promise(function(_0x1711db,_0x43b75a){return db[_0x2346('0x19')][_0x2346('0x1a')]({'raw':_0x49b31e['options']?_0x49b31e[_0x2346('0x1b')][_0x2346('0x1c')]===undefined?!![]:![]:!![],'where':_0x49b31e['options']?_0x49b31e[_0x2346('0x1b')][_0x2346('0x1d')]||null:null,'attributes':_0x49b31e['options']?_0x49b31e[_0x2346('0x1b')][_0x2346('0x1e')]||null:null,'limit':_0x49b31e[_0x2346('0x1b')]?_0x49b31e[_0x2346('0x1b')][_0x2346('0x1f')]||null:null,'include':_0x49b31e[_0x2346('0x1b')]?_0x49b31e[_0x2346('0x1b')]['include']?_[_0x2346('0x20')](_0x49b31e[_0x2346('0x1b')][_0x2346('0x21')],function(_0x1452b3){return{'model':db[_0x1452b3[_0x2346('0x22')]],'as':_0x1452b3['as'],'attributes':_0x1452b3['attributes'],'include':_0x1452b3['include']?_[_0x2346('0x20')](_0x1452b3[_0x2346('0x21')],function(_0x20d0a6){return{'model':db[_0x20d0a6[_0x2346('0x22')]],'as':_0x20d0a6['as'],'attributes':_0x20d0a6[_0x2346('0x1e')],'include':_0x20d0a6[_0x2346('0x21')]?_[_0x2346('0x20')](_0x20d0a6[_0x2346('0x21')],function(_0x40c3c6){return{'model':db[_0x40c3c6[_0x2346('0x22')]],'as':_0x40c3c6['as'],'attributes':_0x40c3c6[_0x2346('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2346('0xd')](function(_0x18365b){logger[_0x2346('0xe')](_0x2346('0x18'),_0x49b31e);logger[_0x2346('0x11')](_0x2346('0x18'),_0x49b31e,JSON['stringify'](_0x18365b));_0x1711db(_0x18365b);})['catch'](function(_0x2df540){logger[_0x2346('0x13')](_0x2346('0x18'),_0x2df540[_0x2346('0x15')],_0x49b31e);_0x43b75a(_0x567fe0[_0x2346('0x13')](0x1f4,_0x2df540[_0x2346('0x15')]));});});};exports[_0x2346('0x23')]=function(_0x118632){var _0x475518=this;return new Promise(function(_0x128826,_0x2564c6){return db['Dynamics365Account'][_0x2346('0x24')]({'raw':_0x118632[_0x2346('0x1b')]?_0x118632[_0x2346('0x1b')][_0x2346('0x1c')]===undefined?!![]:![]:!![],'where':_0x118632[_0x2346('0x1b')]?_0x118632[_0x2346('0x1b')][_0x2346('0x1d')]||null:null,'attributes':_0x118632[_0x2346('0x1b')]?_0x118632[_0x2346('0x1b')]['attributes']||null:null,'include':_0x118632['options']?_0x118632['options']['include']?_[_0x2346('0x20')](_0x118632[_0x2346('0x1b')][_0x2346('0x21')],function(_0x137ce1){return{'model':db[_0x137ce1[_0x2346('0x22')]],'as':_0x137ce1['as'],'attributes':_0x137ce1[_0x2346('0x1e')],'include':_0x137ce1['include']?_['map'](_0x137ce1[_0x2346('0x21')],function(_0x1b5f2d){return{'model':db[_0x1b5f2d[_0x2346('0x22')]],'as':_0x1b5f2d['as'],'attributes':_0x1b5f2d[_0x2346('0x1e')],'include':_0x1b5f2d[_0x2346('0x21')]?_[_0x2346('0x20')](_0x1b5f2d['include'],function(_0x215c21){return{'model':db[_0x215c21[_0x2346('0x22')]],'as':_0x215c21['as'],'attributes':_0x215c21[_0x2346('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2346('0xd')](function(_0xaa3864){logger[_0x2346('0xe')](_0x2346('0x23'),_0x118632);logger[_0x2346('0x11')]('ShowDynamics365Account',_0x118632,JSON['stringify'](_0xaa3864));_0x128826(_0xaa3864);})['catch'](function(_0x17d2a2){logger['error']('ShowDynamics365Account',_0x17d2a2[_0x2346('0x15')],_0x118632);_0x2564c6(_0x475518[_0x2346('0x13')](0x1f4,_0x17d2a2[_0x2346('0x15')]));});});}; \ No newline at end of file +var _0xbf9b=['error','message','info','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','ShowDynamics365Account','find','lodash','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5ceaf0,_0x211b82){var _0x57b2a8=function(_0x30faeb){while(--_0x30faeb){_0x5ceaf0['push'](_0x5ceaf0['shift']());}};_0x57b2a8(++_0x211b82);}(_0xbf9b,0x1a4));var _0xbbf9=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xbf9b[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xbbf9('0x0'));var util=require('util');var moment=require(_0xbbf9('0x1'));var BPromise=require(_0xbbf9('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(_0xbbf9('0x3'))(_0xbbf9('0x4'));var config=require('../../config/environment');var jayson=require(_0xbbf9('0x5'));var client=jayson[_0xbbf9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b0796,_0x3c9dfc,_0xedb781){return new BPromise(function(_0x4239f4,_0x14a9d5){return client[_0xbbf9('0x7')](_0x4b0796,_0xedb781)[_0xbbf9('0x8')](function(_0x133a4e){logger['info'](_0xbbf9('0x9'),_0x3c9dfc,'request\x20sent');logger[_0xbbf9('0xa')](_0xbbf9('0xb'),_0x3c9dfc,_0xbbf9('0xc'),JSON[_0xbbf9('0xd')](_0x133a4e));if(_0x133a4e[_0xbbf9('0xe')]){if(_0x133a4e[_0xbbf9('0xe')]['code']===0x1f4){logger[_0xbbf9('0xe')](_0xbbf9('0x9'),_0x3c9dfc,_0x133a4e[_0xbbf9('0xe')][_0xbbf9('0xf')]);return _0x14a9d5(_0x133a4e[_0xbbf9('0xe')][_0xbbf9('0xf')]);}logger[_0xbbf9('0xe')](_0xbbf9('0x9'),_0x3c9dfc,_0x133a4e[_0xbbf9('0xe')]['message']);return _0x4239f4(_0x133a4e[_0xbbf9('0xe')][_0xbbf9('0xf')]);}else{logger[_0xbbf9('0x10')](_0xbbf9('0x9'),_0x3c9dfc,_0xbbf9('0xc'));_0x4239f4(_0x133a4e['result']['message']);}})[_0xbbf9('0x11')](function(_0x227a32){logger[_0xbbf9('0xe')](_0xbbf9('0x9'),_0x3c9dfc,_0x227a32);_0x14a9d5(_0x227a32);});});}exports[_0xbbf9('0x12')]=function(_0x34914c){var _0x3414ff=this;return new Promise(function(_0x2b9f49,_0x1225de){return db[_0xbbf9('0x13')][_0xbbf9('0x14')]({'raw':_0x34914c[_0xbbf9('0x15')]?_0x34914c[_0xbbf9('0x15')][_0xbbf9('0x16')]===undefined?!![]:![]:!![],'where':_0x34914c[_0xbbf9('0x15')]?_0x34914c[_0xbbf9('0x15')][_0xbbf9('0x17')]||null:null,'attributes':_0x34914c[_0xbbf9('0x15')]?_0x34914c[_0xbbf9('0x15')][_0xbbf9('0x18')]||null:null,'limit':_0x34914c['options']?_0x34914c[_0xbbf9('0x15')][_0xbbf9('0x19')]||null:null,'include':_0x34914c[_0xbbf9('0x15')]?_0x34914c['options']['include']?_[_0xbbf9('0x1a')](_0x34914c['options'][_0xbbf9('0x1b')],function(_0x52bd7c){return{'model':db[_0x52bd7c[_0xbbf9('0x1c')]],'as':_0x52bd7c['as'],'attributes':_0x52bd7c[_0xbbf9('0x18')],'include':_0x52bd7c['include']?_[_0xbbf9('0x1a')](_0x52bd7c[_0xbbf9('0x1b')],function(_0xfb1cb6){return{'model':db[_0xfb1cb6['model']],'as':_0xfb1cb6['as'],'attributes':_0xfb1cb6[_0xbbf9('0x18')],'include':_0xfb1cb6['include']?_[_0xbbf9('0x1a')](_0xfb1cb6['include'],function(_0x5f3663){return{'model':db[_0x5f3663[_0xbbf9('0x1c')]],'as':_0x5f3663['as'],'attributes':_0x5f3663[_0xbbf9('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7372d5){logger[_0xbbf9('0x10')](_0xbbf9('0x12'),_0x34914c);logger[_0xbbf9('0xa')]('GetDynamics365Account',_0x34914c,JSON[_0xbbf9('0xd')](_0x7372d5));_0x2b9f49(_0x7372d5);})[_0xbbf9('0x11')](function(_0x52fc9c){logger['error'](_0xbbf9('0x12'),_0x52fc9c['message'],_0x34914c);_0x1225de(_0x3414ff['error'](0x1f4,_0x52fc9c[_0xbbf9('0xf')]));});});};exports[_0xbbf9('0x1d')]=function(_0x38f808){var _0xd65d08=this;return new Promise(function(_0x342009,_0x15cc39){return db[_0xbbf9('0x13')][_0xbbf9('0x1e')]({'raw':_0x38f808[_0xbbf9('0x15')]?_0x38f808[_0xbbf9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x38f808[_0xbbf9('0x15')]?_0x38f808['options'][_0xbbf9('0x17')]||null:null,'attributes':_0x38f808['options']?_0x38f808[_0xbbf9('0x15')][_0xbbf9('0x18')]||null:null,'include':_0x38f808[_0xbbf9('0x15')]?_0x38f808[_0xbbf9('0x15')][_0xbbf9('0x1b')]?_[_0xbbf9('0x1a')](_0x38f808[_0xbbf9('0x15')][_0xbbf9('0x1b')],function(_0x38d31d){return{'model':db[_0x38d31d[_0xbbf9('0x1c')]],'as':_0x38d31d['as'],'attributes':_0x38d31d[_0xbbf9('0x18')],'include':_0x38d31d['include']?_['map'](_0x38d31d[_0xbbf9('0x1b')],function(_0x1c4015){return{'model':db[_0x1c4015[_0xbbf9('0x1c')]],'as':_0x1c4015['as'],'attributes':_0x1c4015[_0xbbf9('0x18')],'include':_0x1c4015['include']?_[_0xbbf9('0x1a')](_0x1c4015[_0xbbf9('0x1b')],function(_0x4df184){return{'model':db[_0x4df184['model']],'as':_0x4df184['as'],'attributes':_0x4df184[_0xbbf9('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x561c1e){logger[_0xbbf9('0x10')](_0xbbf9('0x1d'),_0x38f808);logger['debug']('ShowDynamics365Account',_0x38f808,JSON[_0xbbf9('0xd')](_0x561c1e));_0x342009(_0x561c1e);})[_0xbbf9('0x11')](function(_0x30097d){logger[_0xbbf9('0xe')](_0xbbf9('0x1d'),_0x30097d[_0xbbf9('0xf')],_0x38f808);_0x15cc39(_0xd65d08[_0xbbf9('0xe')](0x1f4,_0x30097d[_0xbbf9('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 951a4cb..2139b2c 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 _0xba75=['delete','destroy','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getSubjects','getDescriptions','post','create','put','/:id','update'];(function(_0x3f2ebe,_0x4cea82){var _0x2d4695=function(_0x4e8c38){while(--_0x4e8c38){_0x3f2ebe['push'](_0x3f2ebe['shift']());}};_0x2d4695(++_0x4cea82);}(_0xba75,0x17f));var _0x5ba7=function(_0x517c2e,_0x3d4bf3){_0x517c2e=_0x517c2e-0x0;var _0x5d4029=_0xba75[_0x517c2e];return _0x5d4029;};'use strict';var multer=require('multer');var util=require(_0x5ba7('0x0'));var path=require('path');var timeout=require(_0x5ba7('0x1'));var express=require(_0x5ba7('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5ba7('0x3'));var config=require(_0x5ba7('0x4'));var controller=require('./intDynamics365Configuration.controller');router[_0x5ba7('0x5')]('/',auth[_0x5ba7('0x6')](),controller[_0x5ba7('0x7')]);router[_0x5ba7('0x5')]('/:id',auth[_0x5ba7('0x6')](),controller[_0x5ba7('0x8')]);router[_0x5ba7('0x5')]('/:id/fields',auth[_0x5ba7('0x6')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x5ba7('0x6')](),controller[_0x5ba7('0x9')]);router[_0x5ba7('0x5')]('/:id/descriptions',auth[_0x5ba7('0x6')](),controller[_0x5ba7('0xa')]);router[_0x5ba7('0xb')]('/',auth[_0x5ba7('0x6')](),controller[_0x5ba7('0xc')]);router[_0x5ba7('0xd')](_0x5ba7('0xe'),auth[_0x5ba7('0x6')](),controller[_0x5ba7('0xf')]);router[_0x5ba7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5ba7('0x11')]);module[_0x5ba7('0x12')]=router; \ No newline at end of file +var _0x8d1a=['put','delete','exports','multer','util','path','express','Router','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d1a,0x1bc));var _0xa8d1=function(_0x242d35,_0x33a809){_0x242d35=_0x242d35-0x0;var _0x131699=_0x8d1a[_0x242d35];return _0x131699;};'use strict';var multer=require(_0xa8d1('0x0'));var util=require(_0xa8d1('0x1'));var path=require(_0xa8d1('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8d1('0x3'));var router=express[_0xa8d1('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa8d1('0x5'));var controller=require(_0xa8d1('0x6'));router[_0xa8d1('0x7')]('/',auth[_0xa8d1('0x8')](),controller[_0xa8d1('0x9')]);router[_0xa8d1('0x7')](_0xa8d1('0xa'),auth[_0xa8d1('0x8')](),controller[_0xa8d1('0xb')]);router['get'](_0xa8d1('0xc'),auth[_0xa8d1('0x8')](),controller[_0xa8d1('0xd')]);router['get'](_0xa8d1('0xe'),auth[_0xa8d1('0x8')](),controller[_0xa8d1('0xf')]);router[_0xa8d1('0x7')]('/:id/descriptions',auth[_0xa8d1('0x8')](),controller[_0xa8d1('0x10')]);router[_0xa8d1('0x11')]('/',auth[_0xa8d1('0x8')](),controller['create']);router[_0xa8d1('0x12')]('/:id',auth[_0xa8d1('0x8')](),controller['update']);router[_0xa8d1('0x13')](_0xa8d1('0xa'),auth[_0xa8d1('0x8')](),controller['destroy']);module[_0xa8d1('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 2ffd8a4..8fb662f 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 _0xa8d4=['sequelize','STRING','incident','phonecall'];(function(_0x27fcd1,_0x4256fa){var _0x505780=function(_0xb40bb){while(--_0xb40bb){_0x27fcd1['push'](_0x27fcd1['shift']());}};_0x505780(++_0x4256fa);}(_0xa8d4,0x1a8));var _0x4a8d=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0xa8d4[_0xa3fadc];return _0x23ecb8;};'use strict';var Sequelize=require(_0x4a8d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a8d('0x1')]},'description':{'type':Sequelize[_0x4a8d('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x4a8d('0x2'),_0x4a8d('0x3')),'defaultValue':_0x4a8d('0x2')}}; \ No newline at end of file +var _0x32ee=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0xd33d4d,_0x3bd41f){var _0x4b5861=function(_0x5aa075){while(--_0x5aa075){_0xd33d4d['push'](_0xd33d4d['shift']());}};_0x4b5861(++_0x3bd41f);}(_0x32ee,0x11b));var _0xe32e=function(_0x3f1c39,_0x513be5){_0x3f1c39=_0x3f1c39-0x0;var _0x43211a=_0x32ee[_0x3f1c39];return _0x43211a;};'use strict';var Sequelize=require(_0xe32e('0x0'));module[_0xe32e('0x1')]={'name':{'type':Sequelize[_0xe32e('0x2')]},'description':{'type':Sequelize[_0xe32e('0x2')]},'ticketType':{'type':Sequelize[_0xe32e('0x3')](_0xe32e('0x4'),_0xe32e('0x5')),'defaultValue':_0xe32e('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 65ed0a4..e7567fc 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 _0xb466=['api','../../config/environment','../../mysqldb','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','stack','index','Dynamics365Configuration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger'];(function(_0x10fd18,_0x4c5c62){var _0x1592b4=function(_0xa195f9){while(--_0xa195f9){_0x10fd18['push'](_0x10fd18['shift']());}};_0x1592b4(++_0x4c5c62);}(_0xb466,0xf2));var _0x6b46=function(_0x51ce03,_0x2295fc){_0x51ce03=_0x51ce03-0x0;var _0x5d353e=_0xb466[_0x51ce03];return _0x5d353e;};'use strict';var pdf=require(_0x6b46('0x0'));var emlformat=require(_0x6b46('0x1'));var rimraf=require(_0x6b46('0x2'));var zipdir=require(_0x6b46('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b46('0x4'));var moment=require(_0x6b46('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b46('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6b46('0x7'));var ejs=require(_0x6b46('0x8'));var fs=require('fs');var _=require(_0x6b46('0x9'));var squel=require(_0x6b46('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b46('0xb'));var deskjs=require(_0x6b46('0xc'));var toCsv=require(_0x6b46('0x7'));var querystring=require('querystring');var Papa=require(_0x6b46('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6b46('0xe'));var logger=require(_0x6b46('0xf'))(_0x6b46('0x10'));var utils=require('../../config/utils');var config=require(_0x6b46('0x11'));var db=require(_0x6b46('0x12'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6b46('0x13')]['http']({'port':0x232a});function checkPasswordPattern(_0x414fd0,_0x21c51e,_0x2de4eb){if(_0x2de4eb){var _0x25f3dc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25f3dc[_0x6b46('0x14')](_0x21c51e)){return _0x414fd0;}else{throw new Error(_0x6b46('0x15'));}}else{return _0x414fd0;}}function respondWithRpcPromise(_0x21e604,_0x20d402,_0x398fd1,_0x524371){return new BPromise(function(_0x4c031e,_0x8474c7){var _0x1ee04c=_0x524371||client;return _0x1ee04c[_0x6b46('0x16')](_0x21e604,_0x398fd1)['then'](function(_0x1958c7){logger['info'](_0x6b46('0x17'),_0x20d402,_0x6b46('0x18'));logger[_0x6b46('0x19')](_0x6b46('0x1a'),_0x20d402,_0x6b46('0x18'),JSON[_0x6b46('0x1b')](_0x1958c7));if(_0x1958c7[_0x6b46('0x1c')]){if(_0x1958c7[_0x6b46('0x1c')]['code']===0x1f4){logger[_0x6b46('0x1c')]('Dynamics365Configuration,\x20%s,\x20%s',_0x20d402,_0x1958c7['error'][_0x6b46('0x1d')]);return _0x8474c7(_0x1958c7['error'][_0x6b46('0x1d')]);}logger[_0x6b46('0x1c')](_0x6b46('0x17'),_0x20d402,_0x1958c7['error'][_0x6b46('0x1d')]);return _0x4c031e(_0x1958c7['error'][_0x6b46('0x1d')]);}else{logger[_0x6b46('0x1e')](_0x6b46('0x17'),_0x20d402,_0x6b46('0x18'));_0x4c031e(_0x1958c7[_0x6b46('0x1f')][_0x6b46('0x1d')]);}})[_0x6b46('0x20')](function(_0x15b2ae){logger[_0x6b46('0x1c')]('Dynamics365Configuration,\x20%s,\x20%s',_0x20d402,_0x15b2ae);_0x8474c7(_0x15b2ae);});});}function respondWithStatusCode(_0x5630a7,_0x4fc268){_0x4fc268=_0x4fc268||0xcc;return function(_0x1587a9){if(_0x1587a9){return _0x5630a7[_0x6b46('0x21')](_0x4fc268);}return _0x5630a7['status'](_0x4fc268)[_0x6b46('0x22')]();};}function respondWithResult(_0x263297,_0x4c2a10){_0x4c2a10=_0x4c2a10||0xc8;return function(_0xd479c0){if(_0xd479c0){return _0x263297['status'](_0x4c2a10)[_0x6b46('0x23')](_0xd479c0);}};}function respondWithFilteredResult(_0x26f251,_0x320de8){return function(_0x180f13){if(_0x180f13){var _0x497e3e=_0x180f13[_0x6b46('0x24')],_0x34a6bc=_0x320de8[_0x6b46('0x25')],_0xa53b5e=_0x320de8['offset']+_0x320de8[_0x6b46('0x26')],_0x337dba;if(_0xa53b5e>=_0x497e3e){_0xa53b5e=_0x497e3e;_0x337dba=0xc8;}else{_0x337dba=0xce;}_0x26f251[_0x6b46('0x27')](_0x337dba);return _0x26f251[_0x6b46('0x28')](_0x6b46('0x29'),_0x34a6bc+'-'+_0xa53b5e+'/'+_0x497e3e)[_0x6b46('0x23')](_0x180f13);}return null;};}function patchUpdates(_0x27793f){return function(_0x41e331){try{jsonpatch[_0x6b46('0x2a')](_0x41e331,_0x27793f,!![]);}catch(_0xe98e75){return BPromise['reject'](_0xe98e75);}return _0x41e331[_0x6b46('0x2b')]();};}function saveUpdates(_0x58313a,_0xfb6b13){return function(_0x5b21a3){if(_0x5b21a3){return _0x5b21a3[_0x6b46('0x2c')](_0x58313a)[_0x6b46('0x2d')](function(_0x4220c8){return _0x4220c8;});}return null;};}function removeEntity(_0x31f20f,_0x4a3706){return function(_0x2b142e){if(_0x2b142e){return _0x2b142e[_0x6b46('0x2e')]()[_0x6b46('0x2d')](function(){_0x31f20f[_0x6b46('0x27')](0xcc)[_0x6b46('0x22')]();});}};}function handleEntityNotFound(_0x17a57d,_0x260746){return function(_0x1eea1f){if(!_0x1eea1f){_0x17a57d[_0x6b46('0x21')](0x194);}return _0x1eea1f;};}function handleError(_0x2477bc,_0x5289ba){_0x5289ba=_0x5289ba||0x1f4;return function(_0x320d30){logger[_0x6b46('0x1c')](_0x320d30[_0x6b46('0x2f')]);if(_0x320d30['name']){delete _0x320d30['name'];}_0x2477bc[_0x6b46('0x27')](_0x5289ba)['send'](_0x320d30);};}exports[_0x6b46('0x30')]=function(_0x368878,_0x46938f){var _0x472a8a={},_0x43573f={},_0x10af4a={'count':0x0,'rows':[]};var _0x215bc0=db[_0x6b46('0x31')]['rawAttributes'];_0x43573f[_0x6b46('0x32')]=_[_0x6b46('0x33')](_0x215bc0);_0x43573f[_0x6b46('0x34')]=_['keys'](_0x368878[_0x6b46('0x34')]);_0x43573f[_0x6b46('0x35')]=_[_0x6b46('0x36')](_0x43573f[_0x6b46('0x32')],_0x43573f[_0x6b46('0x34')]);_0x472a8a[_0x6b46('0x37')]=_[_0x6b46('0x36')](_0x43573f[_0x6b46('0x32')],qs[_0x6b46('0x38')](_0x368878['query']['fields']));_0x472a8a['attributes']=_0x472a8a['attributes'][_0x6b46('0x39')]?_0x472a8a[_0x6b46('0x37')]:_0x43573f[_0x6b46('0x32')];if(!_0x368878[_0x6b46('0x34')][_0x6b46('0x3a')](_0x6b46('0x3b'))){_0x472a8a[_0x6b46('0x26')]=qs['limit'](_0x368878[_0x6b46('0x34')][_0x6b46('0x26')]);_0x472a8a[_0x6b46('0x25')]=qs[_0x6b46('0x25')](_0x368878[_0x6b46('0x34')][_0x6b46('0x25')]);}_0x472a8a[_0x6b46('0x3c')]=qs[_0x6b46('0x3d')](_0x368878[_0x6b46('0x34')]['sort']);_0x472a8a[_0x6b46('0x3e')]=qs[_0x6b46('0x35')](_[_0x6b46('0x3f')](_0x368878[_0x6b46('0x34')],_0x43573f[_0x6b46('0x35')]));if(_0x368878['query'][_0x6b46('0x40')]){_0x472a8a[_0x6b46('0x3e')]=_[_0x6b46('0x41')](_0x472a8a['where'],{'$or':_[_0x6b46('0x42')](_0x215bc0,function(_0x412732){if(_0x412732[_0x6b46('0x43')][_0x6b46('0x44')]!==_0x6b46('0x45')){var _0x295f34={};_0x295f34[_0x412732['field']]={'$like':'%'+_0x368878['query'][_0x6b46('0x40')]+'%'};return _0x295f34;}})});}_0x472a8a=_[_0x6b46('0x41')]({},_0x472a8a,_0x368878[_0x6b46('0x46')]);var _0x5bfd72={'where':_0x472a8a[_0x6b46('0x3e')]};return db[_0x6b46('0x31')]['count'](_0x5bfd72)[_0x6b46('0x2d')](function(_0xa2448){_0x10af4a[_0x6b46('0x24')]=_0xa2448;if(_0x368878[_0x6b46('0x34')][_0x6b46('0x47')]){_0x472a8a[_0x6b46('0x48')]=[{'all':!![]}];}return db[_0x6b46('0x31')][_0x6b46('0x49')](_0x472a8a);})[_0x6b46('0x2d')](function(_0x2b6be8){_0x10af4a[_0x6b46('0x4a')]=_0x2b6be8;return _0x10af4a;})[_0x6b46('0x2d')](respondWithFilteredResult(_0x46938f,_0x472a8a))['catch'](handleError(_0x46938f,null));};exports[_0x6b46('0x4b')]=function(_0x4da156,_0xf55ba0){var _0xd3318d={'raw':![],'where':{'id':_0x4da156[_0x6b46('0x4c')]['id']}},_0x30447e={};_0x30447e[_0x6b46('0x32')]=_[_0x6b46('0x33')](db[_0x6b46('0x31')][_0x6b46('0x4d')]);_0x30447e[_0x6b46('0x34')]=_[_0x6b46('0x33')](_0x4da156[_0x6b46('0x34')]);_0x30447e[_0x6b46('0x35')]=_[_0x6b46('0x36')](_0x30447e[_0x6b46('0x32')],_0x30447e[_0x6b46('0x34')]);_0xd3318d[_0x6b46('0x37')]=_['intersection'](_0x30447e[_0x6b46('0x32')],qs[_0x6b46('0x38')](_0x4da156['query'][_0x6b46('0x38')]));_0xd3318d[_0x6b46('0x37')]=_0xd3318d[_0x6b46('0x37')][_0x6b46('0x39')]?_0xd3318d['attributes']:_0x30447e[_0x6b46('0x32')];if(_0x4da156[_0x6b46('0x34')]['includeAll']){_0xd3318d[_0x6b46('0x48')]=[{'all':!![]}];}_0xd3318d=_[_0x6b46('0x41')]({},_0xd3318d,_0x4da156[_0x6b46('0x46')]);return db[_0x6b46('0x31')][_0x6b46('0x4e')](_0xd3318d)[_0x6b46('0x2d')](handleEntityNotFound(_0xf55ba0,null))[_0x6b46('0x2d')](respondWithResult(_0xf55ba0,null))[_0x6b46('0x20')](handleError(_0xf55ba0,null));};exports[_0x6b46('0x4f')]=function(_0xc00672,_0x85b002){return db['Dynamics365Configuration'][_0x6b46('0x4f')](_0xc00672[_0x6b46('0x50')],{})[_0x6b46('0x2d')](respondWithResult(_0x85b002,0xc9))[_0x6b46('0x20')](handleError(_0x85b002,null));};exports[_0x6b46('0x2c')]=function(_0x17697a,_0x5d80f9){if(_0x17697a[_0x6b46('0x50')]['id']){delete _0x17697a[_0x6b46('0x50')]['id'];}return db[_0x6b46('0x31')][_0x6b46('0x4e')]({'where':{'id':_0x17697a['params']['id']}})[_0x6b46('0x2d')](handleEntityNotFound(_0x5d80f9,null))[_0x6b46('0x2d')](saveUpdates(_0x17697a['body'],null))[_0x6b46('0x2d')](respondWithResult(_0x5d80f9,null))[_0x6b46('0x20')](handleError(_0x5d80f9,null));};exports[_0x6b46('0x2e')]=function(_0xb960e6,_0x21566c){return db[_0x6b46('0x31')]['find']({'where':{'id':_0xb960e6[_0x6b46('0x4c')]['id']}})[_0x6b46('0x2d')](handleEntityNotFound(_0x21566c,null))[_0x6b46('0x2d')](removeEntity(_0x21566c,null))[_0x6b46('0x20')](handleError(_0x21566c,null));};exports[_0x6b46('0x51')]=function(_0x54b670,_0x118af5,_0x54e082){var _0x5e1eb5={};var _0x144731={};var _0x515da1;var _0x57f964;return db[_0x6b46('0x31')][_0x6b46('0x52')]({'where':{'id':_0x54b670[_0x6b46('0x4c')]['id']}})[_0x6b46('0x2d')](handleEntityNotFound(_0x118af5,null))[_0x6b46('0x2d')](function(_0x2d9b5e){if(_0x2d9b5e){_0x515da1=_0x2d9b5e;_0x144731[_0x6b46('0x32')]=_['keys'](db[_0x6b46('0x53')][_0x6b46('0x4d')]);_0x144731['query']=_[_0x6b46('0x33')](_0x54b670[_0x6b46('0x34')]);_0x144731[_0x6b46('0x35')]=_['intersection'](_0x144731[_0x6b46('0x32')],_0x144731['query']);_0x5e1eb5[_0x6b46('0x37')]=_['intersection'](_0x144731['model'],qs[_0x6b46('0x38')](_0x54b670[_0x6b46('0x34')][_0x6b46('0x38')]));_0x5e1eb5[_0x6b46('0x37')]=_0x5e1eb5[_0x6b46('0x37')]['length']?_0x5e1eb5[_0x6b46('0x37')]:_0x144731[_0x6b46('0x32')];_0x5e1eb5['order']=qs[_0x6b46('0x3d')](_0x54b670['query'][_0x6b46('0x3d')]);_0x5e1eb5[_0x6b46('0x3e')]=qs[_0x6b46('0x35')](_[_0x6b46('0x3f')](_0x54b670[_0x6b46('0x34')],_0x144731[_0x6b46('0x35')]));if(_0x54b670[_0x6b46('0x34')][_0x6b46('0x40')]){_0x5e1eb5[_0x6b46('0x3e')]=_[_0x6b46('0x41')](_0x5e1eb5[_0x6b46('0x3e')],{'$or':_['map'](_0x5e1eb5['attributes'],function(_0x525d7d){var _0x16bc42={};_0x16bc42[_0x525d7d]={'$like':'%'+_0x54b670['query'][_0x6b46('0x40')]+'%'};return _0x16bc42;})});}_0x5e1eb5=_[_0x6b46('0x41')]({},_0x5e1eb5,_0x54b670[_0x6b46('0x46')]);return _0x515da1[_0x6b46('0x51')](_0x5e1eb5);}})[_0x6b46('0x2d')](function(_0x2f3d67){if(_0x2f3d67){_0x57f964=_0x2f3d67[_0x6b46('0x39')];if(!_0x54b670[_0x6b46('0x34')][_0x6b46('0x3a')](_0x6b46('0x3b'))){_0x5e1eb5[_0x6b46('0x26')]=qs['limit'](_0x54b670[_0x6b46('0x34')][_0x6b46('0x26')]);_0x5e1eb5['offset']=qs[_0x6b46('0x25')](_0x54b670[_0x6b46('0x34')]['offset']);}return _0x515da1['getFields'](_0x5e1eb5);}})[_0x6b46('0x2d')](function(_0x53d53d){if(_0x53d53d){return _0x53d53d?{'count':_0x57f964,'rows':_0x53d53d}:null;}})[_0x6b46('0x2d')](respondWithResult(_0x118af5,null))[_0x6b46('0x20')](handleError(_0x118af5,null));};exports[_0x6b46('0x54')]=function(_0x12abe5,_0x217ab3,_0x17fdef){var _0x1e6093={};var _0x424ac3={};var _0x20ea7a;var _0x412eff;return db[_0x6b46('0x31')][_0x6b46('0x52')]({'where':{'id':_0x12abe5[_0x6b46('0x4c')]['id']}})['then'](handleEntityNotFound(_0x217ab3,null))[_0x6b46('0x2d')](function(_0x62c788){if(_0x62c788){_0x20ea7a=_0x62c788;_0x424ac3['model']=_[_0x6b46('0x33')](db[_0x6b46('0x53')][_0x6b46('0x4d')]);_0x424ac3['query']=_['keys'](_0x12abe5['query']);_0x424ac3[_0x6b46('0x35')]=_['intersection'](_0x424ac3['model'],_0x424ac3[_0x6b46('0x34')]);_0x1e6093[_0x6b46('0x37')]=_['intersection'](_0x424ac3[_0x6b46('0x32')],qs[_0x6b46('0x38')](_0x12abe5['query'][_0x6b46('0x38')]));_0x1e6093[_0x6b46('0x37')]=_0x1e6093['attributes'][_0x6b46('0x39')]?_0x1e6093['attributes']:_0x424ac3[_0x6b46('0x32')];_0x1e6093['order']=qs[_0x6b46('0x3d')](_0x12abe5['query']['sort']);_0x1e6093[_0x6b46('0x3e')]=qs[_0x6b46('0x35')](_[_0x6b46('0x3f')](_0x12abe5[_0x6b46('0x34')],_0x424ac3['filters']));if(_0x12abe5['query'][_0x6b46('0x40')]){_0x1e6093[_0x6b46('0x3e')]=_['merge'](_0x1e6093[_0x6b46('0x3e')],{'$or':_[_0x6b46('0x42')](_0x1e6093[_0x6b46('0x37')],function(_0x423142){var _0x45271d={};_0x45271d[_0x423142]={'$like':'%'+_0x12abe5[_0x6b46('0x34')][_0x6b46('0x40')]+'%'};return _0x45271d;})});}_0x1e6093=_[_0x6b46('0x41')]({},_0x1e6093,_0x12abe5['options']);return _0x20ea7a[_0x6b46('0x54')](_0x1e6093);}})[_0x6b46('0x2d')](function(_0x16051b){if(_0x16051b){_0x412eff=_0x16051b['length'];if(!_0x12abe5['query'][_0x6b46('0x3a')](_0x6b46('0x3b'))){_0x1e6093[_0x6b46('0x26')]=qs[_0x6b46('0x26')](_0x12abe5[_0x6b46('0x34')][_0x6b46('0x26')]);_0x1e6093[_0x6b46('0x25')]=qs[_0x6b46('0x25')](_0x12abe5[_0x6b46('0x34')][_0x6b46('0x25')]);}return _0x20ea7a[_0x6b46('0x54')](_0x1e6093);}})[_0x6b46('0x2d')](function(_0x4eb87e){if(_0x4eb87e){return _0x4eb87e?{'count':_0x412eff,'rows':_0x4eb87e}:null;}})[_0x6b46('0x2d')](respondWithResult(_0x217ab3,null))[_0x6b46('0x20')](handleError(_0x217ab3,null));};exports['getDescriptions']=function(_0x1feb51,_0x2b0c93,_0x41937c){var _0x59195b={};var _0x3573f0={};var _0x3677af;var _0x547dae;return db[_0x6b46('0x31')][_0x6b46('0x52')]({'where':{'id':_0x1feb51[_0x6b46('0x4c')]['id']}})[_0x6b46('0x2d')](handleEntityNotFound(_0x2b0c93,null))['then'](function(_0x2788ce){if(_0x2788ce){_0x3677af=_0x2788ce;_0x3573f0[_0x6b46('0x32')]=_[_0x6b46('0x33')](db[_0x6b46('0x53')][_0x6b46('0x4d')]);_0x3573f0[_0x6b46('0x34')]=_[_0x6b46('0x33')](_0x1feb51['query']);_0x3573f0['filters']=_[_0x6b46('0x36')](_0x3573f0['model'],_0x3573f0[_0x6b46('0x34')]);_0x59195b['attributes']=_[_0x6b46('0x36')](_0x3573f0[_0x6b46('0x32')],qs['fields'](_0x1feb51['query'][_0x6b46('0x38')]));_0x59195b[_0x6b46('0x37')]=_0x59195b[_0x6b46('0x37')]['length']?_0x59195b[_0x6b46('0x37')]:_0x3573f0[_0x6b46('0x32')];_0x59195b[_0x6b46('0x3c')]=qs[_0x6b46('0x3d')](_0x1feb51['query'][_0x6b46('0x3d')]);_0x59195b[_0x6b46('0x3e')]=qs['filters'](_[_0x6b46('0x3f')](_0x1feb51[_0x6b46('0x34')],_0x3573f0[_0x6b46('0x35')]));if(_0x1feb51[_0x6b46('0x34')][_0x6b46('0x40')]){_0x59195b[_0x6b46('0x3e')]=_[_0x6b46('0x41')](_0x59195b[_0x6b46('0x3e')],{'$or':_[_0x6b46('0x42')](_0x59195b[_0x6b46('0x37')],function(_0x427ae0){var _0x1e28d2={};_0x1e28d2[_0x427ae0]={'$like':'%'+_0x1feb51[_0x6b46('0x34')][_0x6b46('0x40')]+'%'};return _0x1e28d2;})});}_0x59195b=_[_0x6b46('0x41')]({},_0x59195b,_0x1feb51[_0x6b46('0x46')]);return _0x3677af[_0x6b46('0x55')](_0x59195b);}})[_0x6b46('0x2d')](function(_0x446411){if(_0x446411){_0x547dae=_0x446411[_0x6b46('0x39')];if(!_0x1feb51[_0x6b46('0x34')][_0x6b46('0x3a')](_0x6b46('0x3b'))){_0x59195b[_0x6b46('0x26')]=qs[_0x6b46('0x26')](_0x1feb51[_0x6b46('0x34')][_0x6b46('0x26')]);_0x59195b['offset']=qs['offset'](_0x1feb51[_0x6b46('0x34')][_0x6b46('0x25')]);}return _0x3677af['getDescriptions'](_0x59195b);}})[_0x6b46('0x2d')](function(_0x246716){if(_0x246716){return _0x246716?{'count':_0x547dae,'rows':_0x246716}:null;}})[_0x6b46('0x2d')](respondWithResult(_0x2b0c93,null))[_0x6b46('0x20')](handleError(_0x2b0c93,null));}; \ No newline at end of file +var _0xbde6=['bluebird','mustache','to-csv','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','test','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','end','stack','name','send','index','Dynamics365Configuration','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','rows','params','filters','intersection','find','create','body','getFields','Dynamics365Field','order','getSubjects','findOne','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0xbde6,0x1f4));var _0x6bde=function(_0x3e5c1a,_0xdcad82){_0x3e5c1a=_0x3e5c1a-0x0;var _0x33240e=_0xbde6[_0x3e5c1a];return _0x33240e;};'use strict';var pdf=require(_0x6bde('0x0'));var emlformat=require(_0x6bde('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6bde('0x2'));var jsonpatch=require(_0x6bde('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6bde('0x4'));var Mustache=require(_0x6bde('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6bde('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6bde('0x7'));var crypto=require('crypto');var jsforce=require(_0x6bde('0x8'));var deskjs=require(_0x6bde('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6bde('0xa'));var Redis=require('ioredis');var authService=require(_0x6bde('0xb'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6bde('0xc'));var logger=require(_0x6bde('0xd'))(_0x6bde('0xe'));var utils=require(_0x6bde('0xf'));var config=require(_0x6bde('0x10'));var db=require(_0x6bde('0x11'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x197921,_0x53f0aa,_0x1f200){if(_0x1f200){var _0x28d780=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28d780[_0x6bde('0x12')](_0x53f0aa)){return _0x197921;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x197921;}}function respondWithRpcPromise(_0x23b827,_0x1fa2b4,_0x27ed4e,_0x1af951){return new BPromise(function(_0x42de30,_0x18045c){var _0x351c0c=_0x1af951||client;return _0x351c0c[_0x6bde('0x13')](_0x23b827,_0x27ed4e)[_0x6bde('0x14')](function(_0x4594f7){logger[_0x6bde('0x15')](_0x6bde('0x16'),_0x1fa2b4,'request\x20sent');logger[_0x6bde('0x17')](_0x6bde('0x18'),_0x1fa2b4,_0x6bde('0x19'),JSON[_0x6bde('0x1a')](_0x4594f7));if(_0x4594f7[_0x6bde('0x1b')]){if(_0x4594f7[_0x6bde('0x1b')]['code']===0x1f4){logger[_0x6bde('0x1b')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1fa2b4,_0x4594f7['error'][_0x6bde('0x1c')]);return _0x18045c(_0x4594f7[_0x6bde('0x1b')][_0x6bde('0x1c')]);}logger['error'](_0x6bde('0x16'),_0x1fa2b4,_0x4594f7[_0x6bde('0x1b')][_0x6bde('0x1c')]);return _0x42de30(_0x4594f7[_0x6bde('0x1b')][_0x6bde('0x1c')]);}else{logger[_0x6bde('0x15')](_0x6bde('0x16'),_0x1fa2b4,'request\x20sent');_0x42de30(_0x4594f7[_0x6bde('0x1d')]['message']);}})[_0x6bde('0x1e')](function(_0x2d6485){logger[_0x6bde('0x1b')](_0x6bde('0x16'),_0x1fa2b4,_0x2d6485);_0x18045c(_0x2d6485);});});}function respondWithStatusCode(_0x4cc310,_0x310d0c){_0x310d0c=_0x310d0c||0xcc;return function(_0x4e3c53){if(_0x4e3c53){return _0x4cc310[_0x6bde('0x1f')](_0x310d0c);}return _0x4cc310['status'](_0x310d0c)['end']();};}function respondWithResult(_0x10e77e,_0x20d227){_0x20d227=_0x20d227||0xc8;return function(_0x64001){if(_0x64001){return _0x10e77e[_0x6bde('0x20')](_0x20d227)['json'](_0x64001);}};}function respondWithFilteredResult(_0x4ead4e,_0x276692){return function(_0x1f3a3f){if(_0x1f3a3f){var _0x2e64a9=_0x1f3a3f[_0x6bde('0x21')],_0x34f967=_0x276692[_0x6bde('0x22')],_0xb6825e=_0x276692[_0x6bde('0x22')]+_0x276692[_0x6bde('0x23')],_0xe6c358;if(_0xb6825e>=_0x2e64a9){_0xb6825e=_0x2e64a9;_0xe6c358=0xc8;}else{_0xe6c358=0xce;}_0x4ead4e[_0x6bde('0x20')](_0xe6c358);return _0x4ead4e[_0x6bde('0x24')](_0x6bde('0x25'),_0x34f967+'-'+_0xb6825e+'/'+_0x2e64a9)[_0x6bde('0x26')](_0x1f3a3f);}return null;};}function patchUpdates(_0x3bfaf0){return function(_0x2ae4d0){try{jsonpatch['apply'](_0x2ae4d0,_0x3bfaf0,!![]);}catch(_0x3ce544){return BPromise[_0x6bde('0x27')](_0x3ce544);}return _0x2ae4d0[_0x6bde('0x28')]();};}function saveUpdates(_0x35d0b3,_0x454de6){return function(_0x3e0c4b){if(_0x3e0c4b){return _0x3e0c4b[_0x6bde('0x29')](_0x35d0b3)[_0x6bde('0x14')](function(_0x5b0784){return _0x5b0784;});}return null;};}function removeEntity(_0x51db6b,_0x22e27f){return function(_0x51b00a){if(_0x51b00a){return _0x51b00a[_0x6bde('0x2a')]()['then'](function(){_0x51db6b[_0x6bde('0x20')](0xcc)[_0x6bde('0x2b')]();});}};}function handleEntityNotFound(_0x3007b6,_0x3d6e4f){return function(_0x31841b){if(!_0x31841b){_0x3007b6[_0x6bde('0x1f')](0x194);}return _0x31841b;};}function handleError(_0xa40e1f,_0x382852){_0x382852=_0x382852||0x1f4;return function(_0x27af48){logger['error'](_0x27af48[_0x6bde('0x2c')]);if(_0x27af48[_0x6bde('0x2d')]){delete _0x27af48[_0x6bde('0x2d')];}_0xa40e1f['status'](_0x382852)[_0x6bde('0x2e')](_0x27af48);};}exports[_0x6bde('0x2f')]=function(_0x33fd01,_0x37defe){var _0x1fb155={},_0x32a7a7={},_0x31e816={'count':0x0,'rows':[]};var _0x2f4de9=db[_0x6bde('0x30')][_0x6bde('0x31')];_0x32a7a7[_0x6bde('0x32')]=_[_0x6bde('0x33')](_0x2f4de9);_0x32a7a7[_0x6bde('0x34')]=_[_0x6bde('0x33')](_0x33fd01['query']);_0x32a7a7['filters']=_['intersection'](_0x32a7a7[_0x6bde('0x32')],_0x32a7a7['query']);_0x1fb155[_0x6bde('0x35')]=_['intersection'](_0x32a7a7['model'],qs[_0x6bde('0x36')](_0x33fd01[_0x6bde('0x34')][_0x6bde('0x36')]));_0x1fb155['attributes']=_0x1fb155[_0x6bde('0x35')][_0x6bde('0x37')]?_0x1fb155['attributes']:_0x32a7a7['model'];if(!_0x33fd01['query'][_0x6bde('0x38')](_0x6bde('0x39'))){_0x1fb155['limit']=qs[_0x6bde('0x23')](_0x33fd01['query'][_0x6bde('0x23')]);_0x1fb155[_0x6bde('0x22')]=qs[_0x6bde('0x22')](_0x33fd01[_0x6bde('0x34')]['offset']);}_0x1fb155['order']=qs[_0x6bde('0x3a')](_0x33fd01[_0x6bde('0x34')][_0x6bde('0x3a')]);_0x1fb155[_0x6bde('0x3b')]=qs['filters'](_[_0x6bde('0x3c')](_0x33fd01[_0x6bde('0x34')],_0x32a7a7['filters']));if(_0x33fd01[_0x6bde('0x34')][_0x6bde('0x3d')]){_0x1fb155['where']=_['merge'](_0x1fb155[_0x6bde('0x3b')],{'$or':_[_0x6bde('0x3e')](_0x2f4de9,function(_0xdec669){if(_0xdec669[_0x6bde('0x3f')][_0x6bde('0x40')]!==_0x6bde('0x41')){var _0x3b1862={};_0x3b1862[_0xdec669[_0x6bde('0x42')]]={'$like':'%'+_0x33fd01['query'][_0x6bde('0x3d')]+'%'};return _0x3b1862;}})});}_0x1fb155=_[_0x6bde('0x43')]({},_0x1fb155,_0x33fd01[_0x6bde('0x44')]);var _0x18964c={'where':_0x1fb155[_0x6bde('0x3b')]};return db[_0x6bde('0x30')][_0x6bde('0x21')](_0x18964c)['then'](function(_0x35b01f){_0x31e816[_0x6bde('0x21')]=_0x35b01f;if(_0x33fd01[_0x6bde('0x34')][_0x6bde('0x45')]){_0x1fb155[_0x6bde('0x46')]=[{'all':!![]}];}return db[_0x6bde('0x30')]['findAll'](_0x1fb155);})[_0x6bde('0x14')](function(_0x3faced){_0x31e816[_0x6bde('0x47')]=_0x3faced;return _0x31e816;})[_0x6bde('0x14')](respondWithFilteredResult(_0x37defe,_0x1fb155))[_0x6bde('0x1e')](handleError(_0x37defe,null));};exports['show']=function(_0x521751,_0xbf4693){var _0x41b024={'raw':![],'where':{'id':_0x521751[_0x6bde('0x48')]['id']}},_0x41fd2a={};_0x41fd2a['model']=_[_0x6bde('0x33')](db[_0x6bde('0x30')][_0x6bde('0x31')]);_0x41fd2a[_0x6bde('0x34')]=_[_0x6bde('0x33')](_0x521751[_0x6bde('0x34')]);_0x41fd2a[_0x6bde('0x49')]=_[_0x6bde('0x4a')](_0x41fd2a[_0x6bde('0x32')],_0x41fd2a['query']);_0x41b024['attributes']=_[_0x6bde('0x4a')](_0x41fd2a[_0x6bde('0x32')],qs[_0x6bde('0x36')](_0x521751['query'][_0x6bde('0x36')]));_0x41b024[_0x6bde('0x35')]=_0x41b024['attributes']['length']?_0x41b024[_0x6bde('0x35')]:_0x41fd2a[_0x6bde('0x32')];if(_0x521751['query'][_0x6bde('0x45')]){_0x41b024['include']=[{'all':!![]}];}_0x41b024=_[_0x6bde('0x43')]({},_0x41b024,_0x521751['options']);return db[_0x6bde('0x30')][_0x6bde('0x4b')](_0x41b024)[_0x6bde('0x14')](handleEntityNotFound(_0xbf4693,null))[_0x6bde('0x14')](respondWithResult(_0xbf4693,null))[_0x6bde('0x1e')](handleError(_0xbf4693,null));};exports['create']=function(_0x2a5f8a,_0x35f2fb){return db[_0x6bde('0x30')][_0x6bde('0x4c')](_0x2a5f8a['body'],{})[_0x6bde('0x14')](respondWithResult(_0x35f2fb,0xc9))[_0x6bde('0x1e')](handleError(_0x35f2fb,null));};exports[_0x6bde('0x29')]=function(_0x3db4e1,_0x2a3c1b){if(_0x3db4e1[_0x6bde('0x4d')]['id']){delete _0x3db4e1[_0x6bde('0x4d')]['id'];}return db[_0x6bde('0x30')]['find']({'where':{'id':_0x3db4e1[_0x6bde('0x48')]['id']}})[_0x6bde('0x14')](handleEntityNotFound(_0x2a3c1b,null))[_0x6bde('0x14')](saveUpdates(_0x3db4e1[_0x6bde('0x4d')],null))[_0x6bde('0x14')](respondWithResult(_0x2a3c1b,null))[_0x6bde('0x1e')](handleError(_0x2a3c1b,null));};exports[_0x6bde('0x2a')]=function(_0x15a9aa,_0x583def){return db['Dynamics365Configuration'][_0x6bde('0x4b')]({'where':{'id':_0x15a9aa['params']['id']}})['then'](handleEntityNotFound(_0x583def,null))[_0x6bde('0x14')](removeEntity(_0x583def,null))[_0x6bde('0x1e')](handleError(_0x583def,null));};exports[_0x6bde('0x4e')]=function(_0x342786,_0x1912ba,_0x560b96){var _0x285b55={};var _0x955ab5={};var _0x29ddf3;var _0x25a2a8;return db[_0x6bde('0x30')]['findOne']({'where':{'id':_0x342786[_0x6bde('0x48')]['id']}})[_0x6bde('0x14')](handleEntityNotFound(_0x1912ba,null))[_0x6bde('0x14')](function(_0x411d35){if(_0x411d35){_0x29ddf3=_0x411d35;_0x955ab5[_0x6bde('0x32')]=_[_0x6bde('0x33')](db[_0x6bde('0x4f')][_0x6bde('0x31')]);_0x955ab5[_0x6bde('0x34')]=_[_0x6bde('0x33')](_0x342786[_0x6bde('0x34')]);_0x955ab5['filters']=_['intersection'](_0x955ab5[_0x6bde('0x32')],_0x955ab5['query']);_0x285b55[_0x6bde('0x35')]=_[_0x6bde('0x4a')](_0x955ab5[_0x6bde('0x32')],qs[_0x6bde('0x36')](_0x342786[_0x6bde('0x34')][_0x6bde('0x36')]));_0x285b55[_0x6bde('0x35')]=_0x285b55[_0x6bde('0x35')]['length']?_0x285b55[_0x6bde('0x35')]:_0x955ab5[_0x6bde('0x32')];_0x285b55[_0x6bde('0x50')]=qs[_0x6bde('0x3a')](_0x342786[_0x6bde('0x34')][_0x6bde('0x3a')]);_0x285b55[_0x6bde('0x3b')]=qs[_0x6bde('0x49')](_[_0x6bde('0x3c')](_0x342786[_0x6bde('0x34')],_0x955ab5[_0x6bde('0x49')]));if(_0x342786[_0x6bde('0x34')][_0x6bde('0x3d')]){_0x285b55['where']=_[_0x6bde('0x43')](_0x285b55[_0x6bde('0x3b')],{'$or':_[_0x6bde('0x3e')](_0x285b55['attributes'],function(_0x4017d3){var _0x49b1b7={};_0x49b1b7[_0x4017d3]={'$like':'%'+_0x342786[_0x6bde('0x34')]['filter']+'%'};return _0x49b1b7;})});}_0x285b55=_['merge']({},_0x285b55,_0x342786[_0x6bde('0x44')]);return _0x29ddf3[_0x6bde('0x4e')](_0x285b55);}})[_0x6bde('0x14')](function(_0x23d25a){if(_0x23d25a){_0x25a2a8=_0x23d25a[_0x6bde('0x37')];if(!_0x342786[_0x6bde('0x34')][_0x6bde('0x38')]('nolimit')){_0x285b55[_0x6bde('0x23')]=qs['limit'](_0x342786[_0x6bde('0x34')][_0x6bde('0x23')]);_0x285b55[_0x6bde('0x22')]=qs['offset'](_0x342786[_0x6bde('0x34')][_0x6bde('0x22')]);}return _0x29ddf3[_0x6bde('0x4e')](_0x285b55);}})[_0x6bde('0x14')](function(_0x2478aa){if(_0x2478aa){return _0x2478aa?{'count':_0x25a2a8,'rows':_0x2478aa}:null;}})[_0x6bde('0x14')](respondWithResult(_0x1912ba,null))[_0x6bde('0x1e')](handleError(_0x1912ba,null));};exports[_0x6bde('0x51')]=function(_0x18877b,_0x253218,_0x34de2b){var _0x491dc4={};var _0x2b3d9a={};var _0x3e4191;var _0x1624d9;return db['Dynamics365Configuration'][_0x6bde('0x52')]({'where':{'id':_0x18877b[_0x6bde('0x48')]['id']}})[_0x6bde('0x14')](handleEntityNotFound(_0x253218,null))[_0x6bde('0x14')](function(_0x4f75f9){if(_0x4f75f9){_0x3e4191=_0x4f75f9;_0x2b3d9a['model']=_[_0x6bde('0x33')](db[_0x6bde('0x4f')][_0x6bde('0x31')]);_0x2b3d9a['query']=_['keys'](_0x18877b[_0x6bde('0x34')]);_0x2b3d9a[_0x6bde('0x49')]=_[_0x6bde('0x4a')](_0x2b3d9a['model'],_0x2b3d9a['query']);_0x491dc4[_0x6bde('0x35')]=_['intersection'](_0x2b3d9a[_0x6bde('0x32')],qs[_0x6bde('0x36')](_0x18877b[_0x6bde('0x34')][_0x6bde('0x36')]));_0x491dc4[_0x6bde('0x35')]=_0x491dc4[_0x6bde('0x35')][_0x6bde('0x37')]?_0x491dc4[_0x6bde('0x35')]:_0x2b3d9a[_0x6bde('0x32')];_0x491dc4[_0x6bde('0x50')]=qs[_0x6bde('0x3a')](_0x18877b[_0x6bde('0x34')]['sort']);_0x491dc4['where']=qs[_0x6bde('0x49')](_[_0x6bde('0x3c')](_0x18877b[_0x6bde('0x34')],_0x2b3d9a[_0x6bde('0x49')]));if(_0x18877b[_0x6bde('0x34')][_0x6bde('0x3d')]){_0x491dc4[_0x6bde('0x3b')]=_[_0x6bde('0x43')](_0x491dc4[_0x6bde('0x3b')],{'$or':_[_0x6bde('0x3e')](_0x491dc4['attributes'],function(_0x2784f2){var _0x9b23d9={};_0x9b23d9[_0x2784f2]={'$like':'%'+_0x18877b[_0x6bde('0x34')][_0x6bde('0x3d')]+'%'};return _0x9b23d9;})});}_0x491dc4=_[_0x6bde('0x43')]({},_0x491dc4,_0x18877b[_0x6bde('0x44')]);return _0x3e4191[_0x6bde('0x51')](_0x491dc4);}})[_0x6bde('0x14')](function(_0x2d677a){if(_0x2d677a){_0x1624d9=_0x2d677a[_0x6bde('0x37')];if(!_0x18877b[_0x6bde('0x34')]['hasOwnProperty'](_0x6bde('0x39'))){_0x491dc4[_0x6bde('0x23')]=qs[_0x6bde('0x23')](_0x18877b[_0x6bde('0x34')][_0x6bde('0x23')]);_0x491dc4[_0x6bde('0x22')]=qs['offset'](_0x18877b[_0x6bde('0x34')][_0x6bde('0x22')]);}return _0x3e4191['getSubjects'](_0x491dc4);}})['then'](function(_0x4a9086){if(_0x4a9086){return _0x4a9086?{'count':_0x1624d9,'rows':_0x4a9086}:null;}})[_0x6bde('0x14')](respondWithResult(_0x253218,null))[_0x6bde('0x1e')](handleError(_0x253218,null));};exports[_0x6bde('0x53')]=function(_0x59ab3a,_0x59a2f8,_0x4073ec){var _0x48cb7b={};var _0x1d4bf7={};var _0x1e6f01;var _0xfcf8b0;return db[_0x6bde('0x30')]['findOne']({'where':{'id':_0x59ab3a[_0x6bde('0x48')]['id']}})[_0x6bde('0x14')](handleEntityNotFound(_0x59a2f8,null))[_0x6bde('0x14')](function(_0x1c5bb3){if(_0x1c5bb3){_0x1e6f01=_0x1c5bb3;_0x1d4bf7[_0x6bde('0x32')]=_[_0x6bde('0x33')](db[_0x6bde('0x4f')][_0x6bde('0x31')]);_0x1d4bf7['query']=_['keys'](_0x59ab3a[_0x6bde('0x34')]);_0x1d4bf7[_0x6bde('0x49')]=_[_0x6bde('0x4a')](_0x1d4bf7['model'],_0x1d4bf7[_0x6bde('0x34')]);_0x48cb7b[_0x6bde('0x35')]=_[_0x6bde('0x4a')](_0x1d4bf7[_0x6bde('0x32')],qs['fields'](_0x59ab3a['query'][_0x6bde('0x36')]));_0x48cb7b[_0x6bde('0x35')]=_0x48cb7b[_0x6bde('0x35')][_0x6bde('0x37')]?_0x48cb7b[_0x6bde('0x35')]:_0x1d4bf7[_0x6bde('0x32')];_0x48cb7b[_0x6bde('0x50')]=qs['sort'](_0x59ab3a[_0x6bde('0x34')]['sort']);_0x48cb7b['where']=qs[_0x6bde('0x49')](_['pick'](_0x59ab3a[_0x6bde('0x34')],_0x1d4bf7['filters']));if(_0x59ab3a[_0x6bde('0x34')][_0x6bde('0x3d')]){_0x48cb7b['where']=_[_0x6bde('0x43')](_0x48cb7b[_0x6bde('0x3b')],{'$or':_['map'](_0x48cb7b['attributes'],function(_0x28e36a){var _0x3a83a9={};_0x3a83a9[_0x28e36a]={'$like':'%'+_0x59ab3a[_0x6bde('0x34')][_0x6bde('0x3d')]+'%'};return _0x3a83a9;})});}_0x48cb7b=_[_0x6bde('0x43')]({},_0x48cb7b,_0x59ab3a[_0x6bde('0x44')]);return _0x1e6f01[_0x6bde('0x53')](_0x48cb7b);}})[_0x6bde('0x14')](function(_0x52e4fc){if(_0x52e4fc){_0xfcf8b0=_0x52e4fc[_0x6bde('0x37')];if(!_0x59ab3a[_0x6bde('0x34')]['hasOwnProperty'](_0x6bde('0x39'))){_0x48cb7b['limit']=qs['limit'](_0x59ab3a[_0x6bde('0x34')]['limit']);_0x48cb7b[_0x6bde('0x22')]=qs[_0x6bde('0x22')](_0x59ab3a[_0x6bde('0x34')][_0x6bde('0x22')]);}return _0x1e6f01[_0x6bde('0x53')](_0x48cb7b);}})[_0x6bde('0x14')](function(_0x233de5){if(_0x233de5){return _0x233de5?{'count':_0xfcf8b0,'rows':_0x233de5}:null;}})['then'](respondWithResult(_0x59a2f8,null))[_0x6bde('0x1e')](handleError(_0x59a2f8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 2cde112..fab9fcf 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 _0xb8fe=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Dynamics365Configuration'];(function(_0x5de1b4,_0x48fb3e){var _0x25c0d8=function(_0x75852b){while(--_0x75852b){_0x5de1b4['push'](_0x5de1b4['shift']());}};_0x25c0d8(++_0x48fb3e);}(_0xb8fe,0x1c9));var _0xeb8f=function(_0x13400e,_0x2b1e13){_0x13400e=_0x13400e-0x0;var _0x2e2133=_0xb8fe[_0x13400e];return _0x2e2133;};'use strict';var _=require(_0xeb8f('0x0'));var util=require(_0xeb8f('0x1'));var logger=require(_0xeb8f('0x2'))(_0xeb8f('0x3'));var moment=require('moment');var BPromise=require(_0xeb8f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb8f('0x5'));var rimraf=require(_0xeb8f('0x6'));var config=require(_0xeb8f('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xeb8f('0x8')]=function(_0x35325c,_0x62bc99){return _0x35325c[_0xeb8f('0x9')](_0xeb8f('0xa'),attributes,{'tableName':_0xeb8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e9c=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd6504e,_0x549f21){var _0x425340=function(_0x114288){while(--_0x114288){_0xd6504e['push'](_0xd6504e['shift']());}};_0x425340(++_0x549f21);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3e9c[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xc3e9('0x0'));var util=require(_0xc3e9('0x1'));var logger=require(_0xc3e9('0x2'))(_0xc3e9('0x3'));var moment=require(_0xc3e9('0x4'));var BPromise=require(_0xc3e9('0x5'));var rp=require(_0xc3e9('0x6'));var fs=require('fs');var path=require(_0xc3e9('0x7'));var rimraf=require(_0xc3e9('0x8'));var config=require(_0xc3e9('0x9'));var attributes=require(_0xc3e9('0xa'));module[_0xc3e9('0xb')]=function(_0x2b5a4b,_0x1e08b9){return _0x2b5a4b[_0xc3e9('0xc')](_0xc3e9('0xd'),attributes,{'tableName':_0xc3e9('0xe'),'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 69b6411..e58cb86 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 _0xe91f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x1f506e,_0x27038f){var _0x424387=function(_0xb25930){while(--_0xb25930){_0x1f506e['push'](_0x1f506e['shift']());}};_0x424387(++_0x27038f);}(_0xe91f,0xa1));var _0xfe91=function(_0x2f1b90,_0x2a5dc2){_0x2f1b90=_0x2f1b90-0x0;var _0x223550=_0xe91f[_0x2f1b90];return _0x223550;};'use strict';var _=require(_0xfe91('0x0'));var util=require(_0xfe91('0x1'));var moment=require(_0xfe91('0x2'));var BPromise=require(_0xfe91('0x3'));var rs=require(_0xfe91('0x4'));var fs=require('fs');var Redis=require(_0xfe91('0x5'));var db=require(_0xfe91('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe91('0x7'))(_0xfe91('0x8'));var config=require(_0xfe91('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfe91('0xa')][_0xfe91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d50b0,_0x51f929,_0x36ecc5){return new BPromise(function(_0x30b64f,_0x55d2e8){return client['request'](_0x5d50b0,_0x36ecc5)[_0xfe91('0xc')](function(_0x3b71bf){logger[_0xfe91('0xd')](_0xfe91('0xe'),_0x51f929,_0xfe91('0xf'));logger[_0xfe91('0x10')](_0xfe91('0x11'),_0x51f929,_0xfe91('0xf'),JSON[_0xfe91('0x12')](_0x3b71bf));if(_0x3b71bf['error']){if(_0x3b71bf[_0xfe91('0x13')]['code']===0x1f4){logger[_0xfe91('0x13')](_0xfe91('0xe'),_0x51f929,_0x3b71bf['error'][_0xfe91('0x14')]);return _0x55d2e8(_0x3b71bf[_0xfe91('0x13')][_0xfe91('0x14')]);}logger[_0xfe91('0x13')](_0xfe91('0xe'),_0x51f929,_0x3b71bf['error'][_0xfe91('0x14')]);return _0x30b64f(_0x3b71bf[_0xfe91('0x13')]['message']);}else{logger[_0xfe91('0xd')](_0xfe91('0xe'),_0x51f929,_0xfe91('0xf'));_0x30b64f(_0x3b71bf[_0xfe91('0x15')]['message']);}})[_0xfe91('0x16')](function(_0x47be0d){logger[_0xfe91('0x13')](_0xfe91('0xe'),_0x51f929,_0x47be0d);_0x55d2e8(_0x47be0d);});});} \ No newline at end of file +var _0x5246=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','lodash','util','ioredis'];(function(_0x4ede74,_0x31ed8c){var _0x5329de=function(_0x5b1597){while(--_0x5b1597){_0x4ede74['push'](_0x4ede74['shift']());}};_0x5329de(++_0x31ed8c);}(_0x5246,0x1d8));var _0x6524=function(_0x1142a8,_0x1f265b){_0x1142a8=_0x1142a8-0x0;var _0x3de9ae=_0x5246[_0x1142a8];return _0x3de9ae;};'use strict';var _=require(_0x6524('0x0'));var util=require(_0x6524('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6524('0x2'));var db=require(_0x6524('0x3'))['db'];var utils=require(_0x6524('0x4'));var logger=require('../../config/logger')(_0x6524('0x5'));var config=require('../../config/environment');var jayson=require(_0x6524('0x6'));var client=jayson[_0x6524('0x7')][_0x6524('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d1f0e,_0x2b0fc9,_0x188c13){return new BPromise(function(_0x421fe6,_0x4a54c0){return client[_0x6524('0x9')](_0x4d1f0e,_0x188c13)['then'](function(_0x3c23df){logger[_0x6524('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2b0fc9,_0x6524('0xb'));logger[_0x6524('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2b0fc9,_0x6524('0xb'),JSON[_0x6524('0xd')](_0x3c23df));if(_0x3c23df[_0x6524('0xe')]){if(_0x3c23df[_0x6524('0xe')][_0x6524('0xf')]===0x1f4){logger[_0x6524('0xe')](_0x6524('0x10'),_0x2b0fc9,_0x3c23df[_0x6524('0xe')][_0x6524('0x11')]);return _0x4a54c0(_0x3c23df['error']['message']);}logger[_0x6524('0xe')](_0x6524('0x10'),_0x2b0fc9,_0x3c23df[_0x6524('0xe')][_0x6524('0x11')]);return _0x421fe6(_0x3c23df[_0x6524('0xe')]['message']);}else{logger[_0x6524('0xa')](_0x6524('0x10'),_0x2b0fc9,_0x6524('0xb'));_0x421fe6(_0x3c23df[_0x6524('0x12')][_0x6524('0x11')]);}})['catch'](function(_0x1bf4e5){logger[_0x6524('0xe')](_0x6524('0x10'),_0x2b0fc9,_0x1bf4e5);_0x4a54c0(_0x1bf4e5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4d4e802..3e17cb0 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 _0xe418=['isAuthenticated','/:id','post','create','put','update','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x35e00a,_0x4f48d4){var _0x3594d5=function(_0x59295f){while(--_0x59295f){_0x35e00a['push'](_0x35e00a['shift']());}};_0x3594d5(++_0x4f48d4);}(_0xe418,0x1c8));var _0x8e41=function(_0x2923b4,_0x5eb32e){_0x2923b4=_0x2923b4-0x0;var _0x5c43bf=_0xe418[_0x2923b4];return _0x5c43bf;};'use strict';var multer=require(_0x8e41('0x0'));var util=require(_0x8e41('0x1'));var path=require(_0x8e41('0x2'));var timeout=require(_0x8e41('0x3'));var express=require(_0x8e41('0x4'));var router=express['Router']();var auth=require(_0x8e41('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e41('0x6'));var controller=require(_0x8e41('0x7'));router[_0x8e41('0x8')]('/',auth[_0x8e41('0x9')](),controller['index']);router[_0x8e41('0x8')](_0x8e41('0xa'),auth[_0x8e41('0x9')](),controller['show']);router[_0x8e41('0xb')]('/',auth[_0x8e41('0x9')](),controller[_0x8e41('0xc')]);router[_0x8e41('0xd')](_0x8e41('0xa'),auth[_0x8e41('0x9')](),controller[_0x8e41('0xe')]);router['delete'](_0x8e41('0xa'),auth[_0x8e41('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3a5e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','path'];(function(_0x1f4e0b,_0x90182){var _0x329f1d=function(_0x39b139){while(--_0x39b139){_0x1f4e0b['push'](_0x1f4e0b['shift']());}};_0x329f1d(++_0x90182);}(_0x3a5e,0x6b));var _0xe3a5=function(_0x5bc513,_0x3f8862){_0x5bc513=_0x5bc513-0x0;var _0x4848d4=_0x3a5e[_0x5bc513];return _0x4848d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe3a5('0x0'));var timeout=require(_0xe3a5('0x1'));var express=require(_0xe3a5('0x2'));var router=express[_0xe3a5('0x3')]();var auth=require(_0xe3a5('0x4'));var interaction=require(_0xe3a5('0x5'));var config=require(_0xe3a5('0x6'));var controller=require(_0xe3a5('0x7'));router[_0xe3a5('0x8')]('/',auth[_0xe3a5('0x9')](),controller['index']);router[_0xe3a5('0x8')](_0xe3a5('0xa'),auth[_0xe3a5('0x9')](),controller[_0xe3a5('0xb')]);router[_0xe3a5('0xc')]('/',auth[_0xe3a5('0x9')](),controller[_0xe3a5('0xd')]);router[_0xe3a5('0xe')]('/:id',auth[_0xe3a5('0x9')](),controller[_0xe3a5('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe3a5('0x10')]);module[_0xe3a5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 67dc1ee..fc74301 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 _0x5c00=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x1e6dc8,_0x3c1d7c){var _0x4ed2b4=function(_0x1e57c1){while(--_0x1e57c1){_0x1e6dc8['push'](_0x1e6dc8['shift']());}};_0x4ed2b4(++_0x3c1d7c);}(_0x5c00,0x17e));var _0x05c0=function(_0x17e4ac,_0x315ed6){_0x17e4ac=_0x17e4ac-0x0;var _0x7a9a6a=_0x5c00[_0x17e4ac];return _0x7a9a6a;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'type':{'type':Sequelize[_0x05c0('0x2')]('string',_0x05c0('0x3'),'customVariable',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'content':{'type':Sequelize[_0x05c0('0x6')]},'key':{'type':Sequelize[_0x05c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x05c0('0x5'),_0x05c0('0x3'),_0x05c0('0x7'))},'keyContent':{'type':Sequelize[_0x05c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05c0('0x6')]},'customField':{'type':Sequelize[_0x05c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05c0('0x6')]}}; \ No newline at end of file +var _0x96cc=['keyValue','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x13c7d9,_0x559240){var _0x17c1e9=function(_0x3fb9c4){while(--_0x3fb9c4){_0x13c7d9['push'](_0x13c7d9['shift']());}};_0x17c1e9(++_0x559240);}(_0x96cc,0x16c));var _0xc96c=function(_0x358fb5,_0x4407b8){_0x358fb5=_0x358fb5-0x0;var _0x4abfeb=_0x96cc[_0x358fb5];return _0x4abfeb;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'type':{'type':Sequelize[_0xc96c('0x1')]('string',_0xc96c('0x2'),_0xc96c('0x3'),_0xc96c('0x4')),'defaultValue':_0xc96c('0x5')},'content':{'type':Sequelize[_0xc96c('0x6')]},'key':{'type':Sequelize[_0xc96c('0x6')]},'keyType':{'type':Sequelize[_0xc96c('0x1')](_0xc96c('0x5'),_0xc96c('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc96c('0x6')]},'idField':{'type':Sequelize[_0xc96c('0x6')]},'nameField':{'type':Sequelize[_0xc96c('0x6')]},'customField':{'type':Sequelize[_0xc96c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc96c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index bf09997..8d46634 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','Dynamics365Field','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x4f9746,_0x3a631a){var _0xa4793d=function(_0x13c095){while(--_0x13c095){_0x4f9746['push'](_0x4f9746['shift']());}};_0xa4793d(++_0x3a631a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['Dynamics365Field'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Dynamics365Field'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0x0713=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','Content-Range','json','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','key','VIRTUAL','field','include','findAll','catch','show','params','length','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x46a49d,_0xef9d24){var _0x289bed=function(_0x2524f4){while(--_0x2524f4){_0x46a49d['push'](_0x46a49d['shift']());}};_0x289bed(++_0xef9d24);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var hardwareService=require(_0x3071('0x14'));var logger=require(_0x3071('0x15'))('api');var utils=require(_0x3071('0x16'));var config=require(_0x3071('0x17'));var db=require(_0x3071('0x18'))['db'];function respondWithStatusCode(_0x3ed4a0,_0xa0c1){_0xa0c1=_0xa0c1||0xcc;return function(_0x4a8cc7){if(_0x4a8cc7){return _0x3ed4a0['sendStatus'](_0xa0c1);}return _0x3ed4a0[_0x3071('0x19')](_0xa0c1)['end']();};}function respondWithResult(_0x31c220,_0x44fbae){_0x44fbae=_0x44fbae||0xc8;return function(_0x5d4883){if(_0x5d4883){return _0x31c220[_0x3071('0x19')](_0x44fbae)['json'](_0x5d4883);}};}function respondWithFilteredResult(_0x2fc15d,_0x45c93b){return function(_0x1271d0){if(_0x1271d0){var _0x1f14e1=_0x1271d0[_0x3071('0x1a')],_0x1caa5d=_0x45c93b[_0x3071('0x1b')],_0x2a6a4b=_0x45c93b[_0x3071('0x1b')]+_0x45c93b['limit'],_0x157a47;if(_0x2a6a4b>=_0x1f14e1){_0x2a6a4b=_0x1f14e1;_0x157a47=0xc8;}else{_0x157a47=0xce;}_0x2fc15d[_0x3071('0x19')](_0x157a47);return _0x2fc15d[_0x3071('0x1c')](_0x3071('0x1d'),_0x1caa5d+'-'+_0x2a6a4b+'/'+_0x1f14e1)[_0x3071('0x1e')](_0x1271d0);}return null;};}function patchUpdates(_0x3acf0e){return function(_0x17aee2){try{jsonpatch[_0x3071('0x1f')](_0x17aee2,_0x3acf0e,!![]);}catch(_0x26f113){return BPromise['reject'](_0x26f113);}return _0x17aee2[_0x3071('0x20')]();};}function saveUpdates(_0x2bfa33,_0xd3e23d){return function(_0x56c267){if(_0x56c267){return _0x56c267[_0x3071('0x21')](_0x2bfa33)['then'](function(_0x833074){return _0x833074;});}return null;};}function removeEntity(_0x43128c,_0x3762d8){return function(_0x457b57){if(_0x457b57){return _0x457b57[_0x3071('0x22')]()[_0x3071('0x23')](function(){_0x43128c[_0x3071('0x19')](0xcc)[_0x3071('0x24')]();});}};}function handleEntityNotFound(_0x542646,_0x481a51){return function(_0x2ce48a){if(!_0x2ce48a){_0x542646[_0x3071('0x25')](0x194);}return _0x2ce48a;};}function handleError(_0x412652,_0x13df9f){_0x13df9f=_0x13df9f||0x1f4;return function(_0x2793ef){logger[_0x3071('0x26')](_0x2793ef[_0x3071('0x27')]);if(_0x2793ef[_0x3071('0x28')]){delete _0x2793ef[_0x3071('0x28')];}_0x412652['status'](_0x13df9f)[_0x3071('0x29')](_0x2793ef);};}exports[_0x3071('0x2a')]=function(_0x177138,_0x4d5c4b){var _0x4fb1ca={},_0x28792d={},_0x163604={'count':0x0,'rows':[]};var _0x950fde=db[_0x3071('0x2b')][_0x3071('0x2c')];_0x28792d[_0x3071('0x2d')]=_[_0x3071('0x2e')](_0x950fde);_0x28792d[_0x3071('0x2f')]=_[_0x3071('0x2e')](_0x177138[_0x3071('0x2f')]);_0x28792d['filters']=_['intersection'](_0x28792d[_0x3071('0x2d')],_0x28792d[_0x3071('0x2f')]);_0x4fb1ca[_0x3071('0x30')]=_[_0x3071('0x31')](_0x28792d[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x177138[_0x3071('0x2f')][_0x3071('0x32')]));_0x4fb1ca['attributes']=_0x4fb1ca['attributes']['length']?_0x4fb1ca[_0x3071('0x30')]:_0x28792d[_0x3071('0x2d')];if(!_0x177138['query'][_0x3071('0x33')](_0x3071('0x34'))){_0x4fb1ca[_0x3071('0x35')]=qs[_0x3071('0x35')](_0x177138['query'][_0x3071('0x35')]);_0x4fb1ca[_0x3071('0x1b')]=qs[_0x3071('0x1b')](_0x177138[_0x3071('0x2f')][_0x3071('0x1b')]);}_0x4fb1ca[_0x3071('0x36')]=qs[_0x3071('0x37')](_0x177138[_0x3071('0x2f')]['sort']);_0x4fb1ca[_0x3071('0x38')]=qs['filters'](_['pick'](_0x177138[_0x3071('0x2f')],_0x28792d[_0x3071('0x39')]));if(_0x177138['query'][_0x3071('0x3a')]){_0x4fb1ca[_0x3071('0x38')]=_[_0x3071('0x3b')](_0x4fb1ca[_0x3071('0x38')],{'$or':_[_0x3071('0x3c')](_0x950fde,function(_0x232235){if(_0x232235['type'][_0x3071('0x3d')]!==_0x3071('0x3e')){var _0x4ce6d4={};_0x4ce6d4[_0x232235[_0x3071('0x3f')]]={'$like':'%'+_0x177138['query'][_0x3071('0x3a')]+'%'};return _0x4ce6d4;}})});}_0x4fb1ca=_[_0x3071('0x3b')]({},_0x4fb1ca,_0x177138['options']);var _0x593c99={'where':_0x4fb1ca[_0x3071('0x38')]};return db[_0x3071('0x2b')][_0x3071('0x1a')](_0x593c99)['then'](function(_0x4dea69){_0x163604['count']=_0x4dea69;if(_0x177138[_0x3071('0x2f')]['includeAll']){_0x4fb1ca[_0x3071('0x40')]=[{'all':!![]}];}return db[_0x3071('0x2b')][_0x3071('0x41')](_0x4fb1ca);})[_0x3071('0x23')](function(_0x30ab68){_0x163604['rows']=_0x30ab68;return _0x163604;})['then'](respondWithFilteredResult(_0x4d5c4b,_0x4fb1ca))[_0x3071('0x42')](handleError(_0x4d5c4b,null));};exports[_0x3071('0x43')]=function(_0x1455be,_0x1f69a6){var _0x525389={'raw':!![],'where':{'id':_0x1455be[_0x3071('0x44')]['id']}},_0x3cfc05={};_0x3cfc05[_0x3071('0x2d')]=_[_0x3071('0x2e')](db[_0x3071('0x2b')][_0x3071('0x2c')]);_0x3cfc05['query']=_[_0x3071('0x2e')](_0x1455be['query']);_0x3cfc05['filters']=_['intersection'](_0x3cfc05['model'],_0x3cfc05[_0x3071('0x2f')]);_0x525389[_0x3071('0x30')]=_[_0x3071('0x31')](_0x3cfc05[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x1455be[_0x3071('0x2f')][_0x3071('0x32')]));_0x525389[_0x3071('0x30')]=_0x525389['attributes'][_0x3071('0x45')]?_0x525389[_0x3071('0x30')]:_0x3cfc05[_0x3071('0x2d')];if(_0x1455be[_0x3071('0x2f')][_0x3071('0x46')]){_0x525389['include']=[{'all':!![]}];}_0x525389=_['merge']({},_0x525389,_0x1455be[_0x3071('0x47')]);return db[_0x3071('0x2b')][_0x3071('0x48')](_0x525389)[_0x3071('0x23')](handleEntityNotFound(_0x1f69a6,null))[_0x3071('0x23')](respondWithResult(_0x1f69a6,null))['catch'](handleError(_0x1f69a6,null));};exports[_0x3071('0x49')]=function(_0x4a1d29,_0x18a773){return db['Dynamics365Field']['create'](_0x4a1d29[_0x3071('0x4a')],{})['then'](respondWithResult(_0x18a773,0xc9))[_0x3071('0x42')](handleError(_0x18a773,null));};exports['update']=function(_0x717c43,_0x1d75e5){if(_0x717c43[_0x3071('0x4a')]['id']){delete _0x717c43[_0x3071('0x4a')]['id'];}return db['Dynamics365Field'][_0x3071('0x48')]({'where':{'id':_0x717c43['params']['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x1d75e5,null))['then'](saveUpdates(_0x717c43[_0x3071('0x4a')],null))[_0x3071('0x23')](respondWithResult(_0x1d75e5,null))['catch'](handleError(_0x1d75e5,null));};exports[_0x3071('0x22')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x2b')][_0x3071('0x48')]({'where':{'id':_0x117e73[_0x3071('0x44')]['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x224a70,null))['then'](removeEntity(_0x224a70,null))[_0x3071('0x42')](handleError(_0x224a70,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 460be90..852b839 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 _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x1c8041,_0x192a93){var _0x2e3f78=function(_0x61b9fd){while(--_0x61b9fd){_0x1c8041['push'](_0x1c8041['shift']());}};_0x2e3f78(++_0x192a93);}(_0x7a54,0x106));var _0x47a5=function(_0x5794a3,_0x26b052){_0x5794a3=_0x5794a3-0x0;var _0x4ed6a9=_0x7a54[_0x5794a3];return _0x4ed6a9;};'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':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x4819de,_0x55280b){var _0x25c589=function(_0x364f4f){while(--_0x364f4f){_0x4819de['push'](_0x4819de['shift']());}};_0x25c589(++_0x55280b);}(_0xb10b,0x12a));var _0xbb10=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xb10b[_0x11a220];return _0x20d8fe;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('Dynamics365Field',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd'),_0xbb10('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index e839ee5..2b86c93 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 _0x2d6d=['stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x2d6d,0x66));var _0xd2d6=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x2d6d[_0x5f0501];return _0x3c2c45;};'use strict';var _=require(_0xd2d6('0x0'));var util=require(_0xd2d6('0x1'));var moment=require(_0xd2d6('0x2'));var BPromise=require(_0xd2d6('0x3'));var rs=require(_0xd2d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd2d6('0x5'));var logger=require(_0xd2d6('0x6'))(_0xd2d6('0x7'));var config=require(_0xd2d6('0x8'));var jayson=require(_0xd2d6('0x9'));var client=jayson[_0xd2d6('0xa')][_0xd2d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24207a,_0x261c64,_0x4cef30){return new BPromise(function(_0x13e031,_0x4b93a6){return client[_0xd2d6('0xc')](_0x24207a,_0x4cef30)['then'](function(_0x4dec6e){logger[_0xd2d6('0xd')](_0xd2d6('0xe'),_0x261c64,_0xd2d6('0xf'));logger[_0xd2d6('0x10')](_0xd2d6('0x11'),_0x261c64,_0xd2d6('0xf'),JSON[_0xd2d6('0x12')](_0x4dec6e));if(_0x4dec6e['error']){if(_0x4dec6e['error'][_0xd2d6('0x13')]===0x1f4){logger[_0xd2d6('0x14')](_0xd2d6('0xe'),_0x261c64,_0x4dec6e[_0xd2d6('0x14')][_0xd2d6('0x15')]);return _0x4b93a6(_0x4dec6e[_0xd2d6('0x14')]['message']);}logger[_0xd2d6('0x14')](_0xd2d6('0xe'),_0x261c64,_0x4dec6e[_0xd2d6('0x14')][_0xd2d6('0x15')]);return _0x13e031(_0x4dec6e['error']['message']);}else{logger[_0xd2d6('0xd')](_0xd2d6('0xe'),_0x261c64,_0xd2d6('0xf'));_0x13e031(_0x4dec6e[_0xd2d6('0x16')][_0xd2d6('0x15')]);}})[_0xd2d6('0x17')](function(_0x58e05f){logger[_0xd2d6('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x261c64,_0x58e05f);_0x4b93a6(_0x58e05f);});});} \ No newline at end of file +var _0xa887=['rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x48825f,_0x47ed83){var _0x2b3aae=function(_0x50eca4){while(--_0x50eca4){_0x48825f['push'](_0x48825f['shift']());}};_0x2b3aae(++_0x47ed83);}(_0xa887,0x89));var _0x7a88=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa887[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x7a88('0x0'));var util=require('util');var moment=require(_0x7a88('0x1'));var BPromise=require(_0x7a88('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a88('0x3'));var db=require(_0x7a88('0x4'))['db'];var utils=require(_0x7a88('0x5'));var logger=require(_0x7a88('0x6'))(_0x7a88('0x7'));var config=require(_0x7a88('0x8'));var jayson=require(_0x7a88('0x9'));var client=jayson[_0x7a88('0xa')][_0x7a88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52edce,_0x3a49be,_0x2d0445){return new BPromise(function(_0x5d7a48,_0x34f335){return client['request'](_0x52edce,_0x2d0445)[_0x7a88('0xc')](function(_0x179388){logger[_0x7a88('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x3a49be,'request\x20sent');logger[_0x7a88('0xe')](_0x7a88('0xf'),_0x3a49be,_0x7a88('0x10'),JSON[_0x7a88('0x11')](_0x179388));if(_0x179388[_0x7a88('0x12')]){if(_0x179388[_0x7a88('0x12')][_0x7a88('0x13')]===0x1f4){logger[_0x7a88('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x3a49be,_0x179388[_0x7a88('0x12')]['message']);return _0x34f335(_0x179388[_0x7a88('0x12')][_0x7a88('0x14')]);}logger[_0x7a88('0x12')](_0x7a88('0x15'),_0x3a49be,_0x179388['error'][_0x7a88('0x14')]);return _0x5d7a48(_0x179388['error'][_0x7a88('0x14')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x3a49be,'request\x20sent');_0x5d7a48(_0x179388[_0x7a88('0x16')]['message']);}})[_0x7a88('0x17')](function(_0x71c7b9){logger[_0x7a88('0x12')](_0x7a88('0x15'),_0x3a49be,_0x71c7b9);_0x34f335(_0x71c7b9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 9c32320..c45933b 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 _0xb1bd=['./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x550534,_0x46f1e2){var _0x562775=function(_0x181678){while(--_0x181678){_0x550534['push'](_0x550534['shift']());}};_0x562775(++_0x46f1e2);}(_0xb1bd,0x94));var _0xdb1b=function(_0x7157c1,_0x22690d){_0x7157c1=_0x7157c1-0x0;var _0x5970df=_0xb1bd[_0x7157c1];return _0x5970df;};'use strict';var multer=require(_0xdb1b('0x0'));var util=require('util');var path=require(_0xdb1b('0x1'));var timeout=require(_0xdb1b('0x2'));var express=require(_0xdb1b('0x3'));var router=express[_0xdb1b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdb1b('0x5'));var config=require('../../config/environment');var controller=require(_0xdb1b('0x6'));router[_0xdb1b('0x7')]('/',auth[_0xdb1b('0x8')](),controller[_0xdb1b('0x9')]);router[_0xdb1b('0x7')]('/:id',auth[_0xdb1b('0x8')](),controller[_0xdb1b('0xa')]);router[_0xdb1b('0x7')](_0xdb1b('0xb'),auth[_0xdb1b('0x8')](),controller['getConfigurations']);router['get'](_0xdb1b('0xc'),auth[_0xdb1b('0x8')](),controller[_0xdb1b('0xd')]);router['post']('/',auth[_0xdb1b('0x8')](),controller[_0xdb1b('0xe')]);router[_0xdb1b('0xf')](_0xdb1b('0xb'),auth['isAuthenticated'](),controller[_0xdb1b('0x10')]);router['put'](_0xdb1b('0x11'),auth[_0xdb1b('0x8')](),controller[_0xdb1b('0x12')]);router[_0xdb1b('0x13')](_0xdb1b('0x11'),auth[_0xdb1b('0x8')](),controller[_0xdb1b('0x14')]);module[_0xdb1b('0x15')]=router; \ No newline at end of file +var _0x7fad=['../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','/:id','show','get','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','exports','path','connect-timeout'];(function(_0xcfaded,_0x1c90be){var _0x95b843=function(_0x48deb0){while(--_0x48deb0){_0xcfaded['push'](_0xcfaded['shift']());}};_0x95b843(++_0x1c90be);}(_0x7fad,0xbc));var _0xd7fa=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0x7fad[_0x36b400];return _0x4d47bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd7fa('0x0'));var timeout=require(_0xd7fa('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd7fa('0x2'));var config=require(_0xd7fa('0x3'));var controller=require(_0xd7fa('0x4'));router['get']('/',auth[_0xd7fa('0x5')](),controller['index']);router['get'](_0xd7fa('0x6'),auth[_0xd7fa('0x5')](),controller[_0xd7fa('0x7')]);router[_0xd7fa('0x8')](_0xd7fa('0x9'),auth['isAuthenticated'](),controller[_0xd7fa('0xa')]);router[_0xd7fa('0x8')]('/:id/fields',auth[_0xd7fa('0x5')](),controller[_0xd7fa('0xb')]);router[_0xd7fa('0xc')]('/',auth['isAuthenticated'](),controller[_0xd7fa('0xd')]);router[_0xd7fa('0xc')](_0xd7fa('0x9'),auth[_0xd7fa('0x5')](),controller[_0xd7fa('0xe')]);router['put']('/:id',auth[_0xd7fa('0x5')](),controller[_0xd7fa('0xf')]);router[_0xd7fa('0x10')](_0xd7fa('0x6'),auth[_0xd7fa('0x5')](),controller[_0xd7fa('0x11')]);module[_0xd7fa('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index e82fb1c..9128b55 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 _0x3b35=['remoteUri','sequelize','STRING','username'];(function(_0x9b7d99,_0x2ff447){var _0x353eef=function(_0x525aec){while(--_0x525aec){_0x9b7d99['push'](_0x9b7d99['shift']());}};_0x353eef(++_0x2ff447);}(_0x3b35,0x14d));var _0x53b3=function(_0x406ffa,_0x54dd60){_0x406ffa=_0x406ffa-0x0;var _0x404d17=_0x3b35[_0x406ffa];return _0x404d17;};'use strict';var Sequelize=require(_0x53b3('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x53b3('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x53b3('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x53b3('0x3')},'serverUrl':{'type':Sequelize[_0x53b3('0x1')]}}; \ No newline at end of file +var _0xdb31=['remoteUri','exports','STRING','username'];(function(_0x4cf358,_0x40aad2){var _0x474b42=function(_0x1917a9){while(--_0x1917a9){_0x4cf358['push'](_0x4cf358['shift']());}};_0x474b42(++_0x40aad2);}(_0xdb31,0x169));var _0x1db3=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0xdb31[_0x366e51];return _0x4e23e3;};'use strict';var Sequelize=require('sequelize');module[_0x1db3('0x0')]={'name':{'type':Sequelize[_0x1db3('0x1')]},'description':{'type':Sequelize[_0x1db3('0x1')]},'username':{'type':Sequelize[_0x1db3('0x1')],'unique':_0x1db3('0x2')},'apiKey':{'type':Sequelize[_0x1db3('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1db3('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 8becd05..d9e3b5a 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 _0x6d19=['create','body','params','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','Basic\x20%s','format','%s:X','requester','subject','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','json','offset','status','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','map','type','key','VIRTUAL','filter','FreshdeskAccount','count','include','findAll','rows','show','rawAttributes','includeAll','merge','options','find'];(function(_0x1dd467,_0x4a19b4){var _0x106e44=function(_0x3ef7b7){while(--_0x3ef7b7){_0x1dd467['push'](_0x1dd467['shift']());}};_0x106e44(++_0x4a19b4);}(_0x6d19,0xa6));var _0x96d1=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x6d19[_0x474bc0];return _0x4b24cf;};'use strict';var pdf=require(_0x96d1('0x0'));var emlformat=require(_0x96d1('0x1'));var rimraf=require(_0x96d1('0x2'));var zipdir=require(_0x96d1('0x3'));var jsonpatch=require(_0x96d1('0x4'));var rp=require(_0x96d1('0x5'));var moment=require(_0x96d1('0x6'));var BPromise=require(_0x96d1('0x7'));var Mustache=require(_0x96d1('0x8'));var util=require(_0x96d1('0x9'));var path=require(_0x96d1('0xa'));var sox=require('sox');var csv=require(_0x96d1('0xb'));var ejs=require(_0x96d1('0xc'));var fs=require('fs');var _=require(_0x96d1('0xd'));var squel=require('squel');var crypto=require(_0x96d1('0xe'));var jsforce=require(_0x96d1('0xf'));var deskjs=require(_0x96d1('0x10'));var toCsv=require(_0x96d1('0xb'));var querystring=require(_0x96d1('0x11'));var Papa=require(_0x96d1('0x12'));var Redis=require('ioredis');var authService=require(_0x96d1('0x13'));var qs=require(_0x96d1('0x14'));var hardwareService=require(_0x96d1('0x15'));var logger=require('../../config/logger')(_0x96d1('0x16'));var utils=require(_0x96d1('0x17'));var config=require(_0x96d1('0x18'));var db=require(_0x96d1('0x19'))['db'];var integrations=require(_0x96d1('0x1a'));var jayson=require(_0x96d1('0x1b'));var client=jayson[_0x96d1('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x19159c,_0x29d84b,_0x213b02){if(_0x213b02){var _0x5c77fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c77fb[_0x96d1('0x1d')](_0x29d84b)){return _0x19159c;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x19159c;}}function respondWithRpcPromise(_0x3a58d9,_0x458733,_0x3c220c,_0x2ae94c){return new BPromise(function(_0x604eaf,_0x612ac9){var _0x48b0ef=_0x2ae94c||client;return _0x48b0ef['request'](_0x3a58d9,_0x3c220c)['then'](function(_0xa521f8){logger['info'](_0x96d1('0x1e'),_0x458733,_0x96d1('0x1f'));logger[_0x96d1('0x20')](_0x96d1('0x21'),_0x458733,'request\x20sent',JSON[_0x96d1('0x22')](_0xa521f8));if(_0xa521f8['error']){if(_0xa521f8[_0x96d1('0x23')][_0x96d1('0x24')]===0x1f4){logger[_0x96d1('0x23')](_0x96d1('0x1e'),_0x458733,_0xa521f8[_0x96d1('0x23')]['message']);return _0x612ac9(_0xa521f8[_0x96d1('0x23')][_0x96d1('0x25')]);}logger[_0x96d1('0x23')](_0x96d1('0x1e'),_0x458733,_0xa521f8[_0x96d1('0x23')][_0x96d1('0x25')]);return _0x604eaf(_0xa521f8[_0x96d1('0x23')][_0x96d1('0x25')]);}else{logger[_0x96d1('0x26')]('FreshdeskAccount,\x20%s,\x20%s',_0x458733,'request\x20sent');_0x604eaf(_0xa521f8['result'][_0x96d1('0x25')]);}})[_0x96d1('0x27')](function(_0x7a75da){logger[_0x96d1('0x23')]('FreshdeskAccount,\x20%s,\x20%s',_0x458733,_0x7a75da);_0x612ac9(_0x7a75da);});});}function respondWithStatusCode(_0x4dd254,_0x15cd9a){_0x15cd9a=_0x15cd9a||0xcc;return function(_0x2f23b9){if(_0x2f23b9){return _0x4dd254[_0x96d1('0x28')](_0x15cd9a);}return _0x4dd254['status'](_0x15cd9a)[_0x96d1('0x29')]();};}function respondWithResult(_0x11d03b,_0x50cfea){_0x50cfea=_0x50cfea||0xc8;return function(_0x5ab352){if(_0x5ab352){return _0x11d03b['status'](_0x50cfea)[_0x96d1('0x2a')](_0x5ab352);}};}function respondWithFilteredResult(_0xbda76f,_0x11d640){return function(_0x219971){if(_0x219971){var _0x18544a=_0x219971['count'],_0x28e55d=_0x11d640[_0x96d1('0x2b')],_0xf8924f=_0x11d640['offset']+_0x11d640['limit'],_0x708f31;if(_0xf8924f>=_0x18544a){_0xf8924f=_0x18544a;_0x708f31=0xc8;}else{_0x708f31=0xce;}_0xbda76f[_0x96d1('0x2c')](_0x708f31);return _0xbda76f[_0x96d1('0x2d')](_0x96d1('0x2e'),_0x28e55d+'-'+_0xf8924f+'/'+_0x18544a)['json'](_0x219971);}return null;};}function patchUpdates(_0x1b764c){return function(_0xf7093f){try{jsonpatch['apply'](_0xf7093f,_0x1b764c,!![]);}catch(_0x23cdb0){return BPromise[_0x96d1('0x2f')](_0x23cdb0);}return _0xf7093f[_0x96d1('0x30')]();};}function saveUpdates(_0x2f51b0,_0x576a36){return function(_0x2ad00f){if(_0x2ad00f){return _0x2ad00f[_0x96d1('0x31')](_0x2f51b0)[_0x96d1('0x32')](function(_0x53933a){return _0x53933a;});}return null;};}function removeEntity(_0x1cfecc,_0x537383){return function(_0x5d3d36){if(_0x5d3d36){return _0x5d3d36[_0x96d1('0x33')]()[_0x96d1('0x32')](function(){_0x1cfecc[_0x96d1('0x2c')](0xcc)[_0x96d1('0x29')]();});}};}function handleEntityNotFound(_0x4e57f7,_0x5743fd){return function(_0x88cb82){if(!_0x88cb82){_0x4e57f7[_0x96d1('0x28')](0x194);}return _0x88cb82;};}function handleError(_0xe8ee60,_0x24c37a){_0x24c37a=_0x24c37a||0x1f4;return function(_0x1c4c18){logger[_0x96d1('0x23')](_0x1c4c18[_0x96d1('0x34')]);if(_0x1c4c18['name']){delete _0x1c4c18[_0x96d1('0x35')];}_0xe8ee60[_0x96d1('0x2c')](_0x24c37a)[_0x96d1('0x36')](_0x1c4c18);};}exports[_0x96d1('0x37')]=function(_0x2e4dbb,_0x2f85b8){var _0x4b4f34={},_0x5acf37={},_0x4447f2={'count':0x0,'rows':[]};var _0x48e80c=db['FreshdeskAccount']['rawAttributes'];_0x5acf37[_0x96d1('0x38')]=_[_0x96d1('0x39')](_0x48e80c);_0x5acf37[_0x96d1('0x3a')]=_[_0x96d1('0x39')](_0x2e4dbb[_0x96d1('0x3a')]);_0x5acf37[_0x96d1('0x3b')]=_['intersection'](_0x5acf37[_0x96d1('0x38')],_0x5acf37[_0x96d1('0x3a')]);_0x4b4f34[_0x96d1('0x3c')]=_[_0x96d1('0x3d')](_0x5acf37['model'],qs[_0x96d1('0x3e')](_0x2e4dbb[_0x96d1('0x3a')][_0x96d1('0x3e')]));_0x4b4f34[_0x96d1('0x3c')]=_0x4b4f34[_0x96d1('0x3c')][_0x96d1('0x3f')]?_0x4b4f34[_0x96d1('0x3c')]:_0x5acf37[_0x96d1('0x38')];if(!_0x2e4dbb[_0x96d1('0x3a')][_0x96d1('0x40')](_0x96d1('0x41'))){_0x4b4f34[_0x96d1('0x42')]=qs[_0x96d1('0x42')](_0x2e4dbb[_0x96d1('0x3a')]['limit']);_0x4b4f34[_0x96d1('0x2b')]=qs['offset'](_0x2e4dbb[_0x96d1('0x3a')][_0x96d1('0x2b')]);}_0x4b4f34['order']=qs[_0x96d1('0x43')](_0x2e4dbb[_0x96d1('0x3a')][_0x96d1('0x43')]);_0x4b4f34[_0x96d1('0x44')]=qs[_0x96d1('0x3b')](_[_0x96d1('0x45')](_0x2e4dbb[_0x96d1('0x3a')],_0x5acf37[_0x96d1('0x3b')]));if(_0x2e4dbb[_0x96d1('0x3a')]['filter']){_0x4b4f34[_0x96d1('0x44')]=_['merge'](_0x4b4f34[_0x96d1('0x44')],{'$or':_[_0x96d1('0x46')](_0x48e80c,function(_0x4574c1){if(_0x4574c1[_0x96d1('0x47')][_0x96d1('0x48')]!==_0x96d1('0x49')){var _0x52d3a2={};_0x52d3a2[_0x4574c1['field']]={'$like':'%'+_0x2e4dbb[_0x96d1('0x3a')][_0x96d1('0x4a')]+'%'};return _0x52d3a2;}})});}_0x4b4f34=_['merge']({},_0x4b4f34,_0x2e4dbb['options']);var _0x1cf7a3={'where':_0x4b4f34[_0x96d1('0x44')]};return db[_0x96d1('0x4b')][_0x96d1('0x4c')](_0x1cf7a3)['then'](function(_0x464dcd){_0x4447f2[_0x96d1('0x4c')]=_0x464dcd;if(_0x2e4dbb[_0x96d1('0x3a')]['includeAll']){_0x4b4f34[_0x96d1('0x4d')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x96d1('0x4e')](_0x4b4f34);})[_0x96d1('0x32')](function(_0x5dafe6){_0x4447f2[_0x96d1('0x4f')]=_0x5dafe6;return _0x4447f2;})['then'](respondWithFilteredResult(_0x2f85b8,_0x4b4f34))[_0x96d1('0x27')](handleError(_0x2f85b8,null));};exports[_0x96d1('0x50')]=function(_0x43908,_0x21cf10){var _0x2ec0ba={'raw':![],'where':{'id':_0x43908['params']['id']}},_0xe51c26={};_0xe51c26[_0x96d1('0x38')]=_[_0x96d1('0x39')](db['FreshdeskAccount'][_0x96d1('0x51')]);_0xe51c26[_0x96d1('0x3a')]=_[_0x96d1('0x39')](_0x43908[_0x96d1('0x3a')]);_0xe51c26['filters']=_[_0x96d1('0x3d')](_0xe51c26['model'],_0xe51c26['query']);_0x2ec0ba[_0x96d1('0x3c')]=_[_0x96d1('0x3d')](_0xe51c26[_0x96d1('0x38')],qs[_0x96d1('0x3e')](_0x43908[_0x96d1('0x3a')][_0x96d1('0x3e')]));_0x2ec0ba['attributes']=_0x2ec0ba[_0x96d1('0x3c')][_0x96d1('0x3f')]?_0x2ec0ba['attributes']:_0xe51c26[_0x96d1('0x38')];if(_0x43908['query'][_0x96d1('0x52')]){_0x2ec0ba[_0x96d1('0x4d')]=[{'all':!![]}];}_0x2ec0ba=_[_0x96d1('0x53')]({},_0x2ec0ba,_0x43908[_0x96d1('0x54')]);return db['FreshdeskAccount'][_0x96d1('0x55')](_0x2ec0ba)[_0x96d1('0x32')](handleEntityNotFound(_0x21cf10,null))[_0x96d1('0x32')](respondWithResult(_0x21cf10,null))[_0x96d1('0x27')](handleError(_0x21cf10,null));};exports[_0x96d1('0x56')]=function(_0x267c6a,_0x13fad0){return db[_0x96d1('0x4b')][_0x96d1('0x56')](_0x267c6a[_0x96d1('0x57')],{})[_0x96d1('0x32')](respondWithResult(_0x13fad0,0xc9))[_0x96d1('0x27')](handleError(_0x13fad0,null));};exports['update']=function(_0x4ebd07,_0x83620){if(_0x4ebd07[_0x96d1('0x57')]['id']){delete _0x4ebd07[_0x96d1('0x57')]['id'];}return db[_0x96d1('0x4b')][_0x96d1('0x55')]({'where':{'id':_0x4ebd07[_0x96d1('0x58')]['id']}})[_0x96d1('0x32')](handleEntityNotFound(_0x83620,null))[_0x96d1('0x32')](saveUpdates(_0x4ebd07['body'],null))['then'](respondWithResult(_0x83620,null))[_0x96d1('0x27')](handleError(_0x83620,null));};exports[_0x96d1('0x33')]=function(_0x58276f,_0x20a3e8){return db[_0x96d1('0x4b')][_0x96d1('0x55')]({'where':{'id':_0x58276f['params']['id']}})[_0x96d1('0x32')](handleEntityNotFound(_0x20a3e8,null))[_0x96d1('0x32')](removeEntity(_0x20a3e8,null))['catch'](handleError(_0x20a3e8,null));};exports[_0x96d1('0x59')]=function(_0x4f95e8,_0x4be5c5,_0x5aabfb){var _0x212a66={};var _0x1ee604={};var _0x4a7be5;var _0x4bf76c;return db[_0x96d1('0x4b')][_0x96d1('0x5a')]({'where':{'id':_0x4f95e8[_0x96d1('0x58')]['id']}})['then'](handleEntityNotFound(_0x4be5c5,null))['then'](function(_0x3e9f3f){if(_0x3e9f3f){_0x4a7be5=_0x3e9f3f;_0x1ee604[_0x96d1('0x38')]=_['keys'](db[_0x96d1('0x5b')]['rawAttributes']);_0x1ee604[_0x96d1('0x3a')]=_[_0x96d1('0x39')](_0x4f95e8[_0x96d1('0x3a')]);_0x1ee604[_0x96d1('0x3b')]=_[_0x96d1('0x3d')](_0x1ee604[_0x96d1('0x38')],_0x1ee604[_0x96d1('0x3a')]);_0x212a66[_0x96d1('0x3c')]=_[_0x96d1('0x3d')](_0x1ee604[_0x96d1('0x38')],qs['fields'](_0x4f95e8[_0x96d1('0x3a')]['fields']));_0x212a66[_0x96d1('0x3c')]=_0x212a66['attributes'][_0x96d1('0x3f')]?_0x212a66['attributes']:_0x1ee604[_0x96d1('0x38')];_0x212a66[_0x96d1('0x5c')]=qs[_0x96d1('0x43')](_0x4f95e8['query'][_0x96d1('0x43')]);_0x212a66[_0x96d1('0x44')]=qs['filters'](_[_0x96d1('0x45')](_0x4f95e8[_0x96d1('0x3a')],_0x1ee604[_0x96d1('0x3b')]));if(_0x4f95e8['query'][_0x96d1('0x4a')]){_0x212a66[_0x96d1('0x44')]=_[_0x96d1('0x53')](_0x212a66[_0x96d1('0x44')],{'$or':_[_0x96d1('0x46')](_0x212a66['attributes'],function(_0xd35cae){var _0x1f4dae={};_0x1f4dae[_0xd35cae]={'$like':'%'+_0x4f95e8[_0x96d1('0x3a')][_0x96d1('0x4a')]+'%'};return _0x1f4dae;})});}_0x212a66=_['merge']({},_0x212a66,_0x4f95e8[_0x96d1('0x54')]);return _0x4a7be5[_0x96d1('0x59')](_0x212a66);}})[_0x96d1('0x32')](function(_0x323171){if(_0x323171){_0x4bf76c=_0x323171['length'];if(!_0x4f95e8['query']['hasOwnProperty']('nolimit')){_0x212a66[_0x96d1('0x42')]=qs[_0x96d1('0x42')](_0x4f95e8['query'][_0x96d1('0x42')]);_0x212a66[_0x96d1('0x2b')]=qs[_0x96d1('0x2b')](_0x4f95e8[_0x96d1('0x3a')]['offset']);}return _0x4a7be5['getConfigurations'](_0x212a66);}})[_0x96d1('0x32')](function(_0x41bde3){if(_0x41bde3){return _0x41bde3?{'count':_0x4bf76c,'rows':_0x41bde3}:null;}})[_0x96d1('0x32')](respondWithResult(_0x4be5c5,null))[_0x96d1('0x27')](handleError(_0x4be5c5,null));};exports[_0x96d1('0x5d')]=function(_0x52a188,_0x27aad9,_0x105f9f){if(_0x52a188[_0x96d1('0x57')]['id']){delete _0x52a188[_0x96d1('0x57')]['id'];}return db['FreshdeskAccount'][_0x96d1('0x5a')]({'where':{'id':_0x52a188[_0x96d1('0x58')]['id']}})[_0x96d1('0x32')](handleEntityNotFound(_0x27aad9,null))[_0x96d1('0x32')](function(_0x41f0e6){if(_0x41f0e6){_0x52a188[_0x96d1('0x57')]['AccountId']=_0x41f0e6['id'];_0x52a188[_0x96d1('0x57')][_0x96d1('0x5e')]=integrations[_0x96d1('0x5f')](_0x52a188['body'][_0x96d1('0x60')],_0x52a188[_0x96d1('0x57')][_0x96d1('0x47')]);_0x52a188[_0x96d1('0x57')]['Descriptions']=integrations[_0x96d1('0x61')](_0x52a188[_0x96d1('0x57')][_0x96d1('0x60')],_0x52a188['body']['type']);return db[_0x96d1('0x5b')][_0x96d1('0x56')](_0x52a188[_0x96d1('0x57')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x96d1('0x62')],'as':_0x96d1('0x63')}]});}return null;})[_0x96d1('0x32')](respondWithResult(_0x27aad9,null))[_0x96d1('0x27')](handleError(_0x27aad9,null));};exports[_0x96d1('0x64')]=function(_0x57171d,_0x2adc58,_0x5a6aaa){var _0x306bf1='';return db[_0x96d1('0x4b')][_0x96d1('0x5a')]({'where':{'id':_0x57171d[_0x96d1('0x58')]['id']},'attributes':['id',_0x96d1('0x65'),_0x96d1('0x66')]})['then'](handleEntityNotFound(_0x2adc58,null))['then'](function(_0x5cb9a7){if(_0x5cb9a7){_0x306bf1=_0x5cb9a7[_0x96d1('0x65')];var _0x246209=_0x306bf1[_0x96d1('0x67')](-0x1);if(_0x246209==='/'){_0x306bf1=_0x306bf1[_0x96d1('0x68')](0x0,_0x306bf1[_0x96d1('0x69')](_0x246209));}return rp({'method':_0x96d1('0x6a'),'uri':util['format'](_0x96d1('0x6b'),_0x306bf1,_0x96d1('0x6c')),'headers':{'Authorization':util['format'](_0x96d1('0x6d'),new Buffer(util[_0x96d1('0x6e')](_0x96d1('0x6f'),_0x5cb9a7[_0x96d1('0x66')]))['toString']('base64'))},'json':!![]});}})[_0x96d1('0x32')](function(_0x23b0e0){if(_0x23b0e0){var _0x5c3a18=[_0x96d1('0x70'),_0x96d1('0x71'),'agent','description','status','priority',_0x96d1('0x72'),'source',_0x96d1('0x73'),_0x96d1('0x72'),_0x96d1('0x74')];_[_0x96d1('0x75')](_0x23b0e0,function(_0x4c9dda){return _0x5c3a18[_0x96d1('0x76')](_0x4c9dda[_0x96d1('0x35')])||!_0x4c9dda[_0x96d1('0x77')]&&_0x4c9dda[_0x96d1('0x47')]!==_0x96d1('0x78')&&_0x4c9dda['type']!==_0x96d1('0x79');});return{'count':_0x23b0e0[_0x96d1('0x3f')],'rows':_[_0x96d1('0x46')](_0x23b0e0,function(_0xd38750){return{'id':_0xd38750[_0x96d1('0x35')],'name':_0xd38750['label'],'custom':!_0xd38750[_0x96d1('0x77')],'options':_0xd38750[_0x96d1('0x7a')]?_[_0x96d1('0x46')](_0xd38750['choices'],function(_0x591bd1){return{'name':_[_0x96d1('0x7b')](_0x591bd1),'value':_0x591bd1};}):[]};})};}})['then'](respondWithResult(_0x2adc58,null))[_0x96d1('0x27')](function(_0x260ddd){var _0x206ec6=_0x57171d[_0x96d1('0x3a')][_0x96d1('0x1d')]?0x1f4:_0x260ddd['statusCode']||0x1f4;logger[_0x96d1('0x23')](_0x96d1('0x7c'),_0x96d1('0x64'),_0x206ec6,JSON[_0x96d1('0x22')](_0x260ddd));delete _0x260ddd[_0x96d1('0x35')];if(_0x206ec6===0x191){_0x206ec6=0x190;}_0x2adc58['status'](_0x206ec6)[_0x96d1('0x36')](_0x57171d[_0x96d1('0x3a')][_0x96d1('0x1d')]?{'message':'Wrong\x20credentials','statusCode':_0x260ddd[_0x96d1('0x7d')]}:_0x260ddd);});}; \ No newline at end of file +var _0x9804=['reject','save','update','stack','name','index','FreshdeskAccount','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','findOne','rawAttributes','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','Subjects','getFields','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','toString','requester','subject','description','priority','group','source','company','remove','includes','default','label','choices','capitalize','statusCode','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x9804,0x148));var _0x4980=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x9804[_0x200827];return _0x120047;};'use strict';var pdf=require(_0x4980('0x0'));var emlformat=require(_0x4980('0x1'));var rimraf=require(_0x4980('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4980('0x3'));var rp=require(_0x4980('0x4'));var moment=require(_0x4980('0x5'));var BPromise=require(_0x4980('0x6'));var Mustache=require(_0x4980('0x7'));var util=require(_0x4980('0x8'));var path=require(_0x4980('0x9'));var sox=require(_0x4980('0xa'));var csv=require('to-csv');var ejs=require(_0x4980('0xb'));var fs=require('fs');var _=require(_0x4980('0xc'));var squel=require(_0x4980('0xd'));var crypto=require('crypto');var jsforce=require(_0x4980('0xe'));var deskjs=require(_0x4980('0xf'));var toCsv=require(_0x4980('0x10'));var querystring=require(_0x4980('0x11'));var Papa=require(_0x4980('0x12'));var Redis=require(_0x4980('0x13'));var authService=require(_0x4980('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4980('0x15'));var utils=require(_0x4980('0x16'));var config=require('../../config/environment');var db=require(_0x4980('0x17'))['db'];var integrations=require(_0x4980('0x18'));var jayson=require(_0x4980('0x19'));var client=jayson[_0x4980('0x1a')][_0x4980('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xd8b43d,_0x54a55a,_0x4c8f3f){if(_0x4c8f3f){var _0x227b33=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x227b33[_0x4980('0x1c')](_0x54a55a)){return _0xd8b43d;}else{throw new Error(_0x4980('0x1d'));}}else{return _0xd8b43d;}}function respondWithRpcPromise(_0xc41ed,_0x39fb45,_0x1028ce,_0x49665d){return new BPromise(function(_0x1c0306,_0x437ea3){var _0x22bad5=_0x49665d||client;return _0x22bad5[_0x4980('0x1e')](_0xc41ed,_0x1028ce)[_0x4980('0x1f')](function(_0x2c655b){logger[_0x4980('0x20')](_0x4980('0x21'),_0x39fb45,_0x4980('0x22'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x39fb45,'request\x20sent',JSON[_0x4980('0x23')](_0x2c655b));if(_0x2c655b[_0x4980('0x24')]){if(_0x2c655b['error'][_0x4980('0x25')]===0x1f4){logger[_0x4980('0x24')](_0x4980('0x21'),_0x39fb45,_0x2c655b[_0x4980('0x24')][_0x4980('0x26')]);return _0x437ea3(_0x2c655b[_0x4980('0x24')][_0x4980('0x26')]);}logger[_0x4980('0x24')](_0x4980('0x21'),_0x39fb45,_0x2c655b[_0x4980('0x24')]['message']);return _0x1c0306(_0x2c655b[_0x4980('0x24')]['message']);}else{logger[_0x4980('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x39fb45,'request\x20sent');_0x1c0306(_0x2c655b[_0x4980('0x27')][_0x4980('0x26')]);}})['catch'](function(_0xa8604f){logger['error'](_0x4980('0x21'),_0x39fb45,_0xa8604f);_0x437ea3(_0xa8604f);});});}function respondWithStatusCode(_0x3e0576,_0x257a60){_0x257a60=_0x257a60||0xcc;return function(_0x5ea732){if(_0x5ea732){return _0x3e0576[_0x4980('0x28')](_0x257a60);}return _0x3e0576[_0x4980('0x29')](_0x257a60)[_0x4980('0x2a')]();};}function respondWithResult(_0x4b1f30,_0x26d4db){_0x26d4db=_0x26d4db||0xc8;return function(_0x31a0c9){if(_0x31a0c9){return _0x4b1f30['status'](_0x26d4db)[_0x4980('0x2b')](_0x31a0c9);}};}function respondWithFilteredResult(_0x2e7a8b,_0x27fa71){return function(_0x3c7803){if(_0x3c7803){var _0x1d2da9=_0x3c7803[_0x4980('0x2c')],_0x398af5=_0x27fa71[_0x4980('0x2d')],_0x5e9e78=_0x27fa71[_0x4980('0x2d')]+_0x27fa71[_0x4980('0x2e')],_0x28eed3;if(_0x5e9e78>=_0x1d2da9){_0x5e9e78=_0x1d2da9;_0x28eed3=0xc8;}else{_0x28eed3=0xce;}_0x2e7a8b[_0x4980('0x29')](_0x28eed3);return _0x2e7a8b[_0x4980('0x2f')](_0x4980('0x30'),_0x398af5+'-'+_0x5e9e78+'/'+_0x1d2da9)[_0x4980('0x2b')](_0x3c7803);}return null;};}function patchUpdates(_0x4314ed){return function(_0x2b13f1){try{jsonpatch[_0x4980('0x31')](_0x2b13f1,_0x4314ed,!![]);}catch(_0x5dde5b){return BPromise[_0x4980('0x32')](_0x5dde5b);}return _0x2b13f1[_0x4980('0x33')]();};}function saveUpdates(_0x5a1f03,_0xde62d1){return function(_0x2b72d6){if(_0x2b72d6){return _0x2b72d6[_0x4980('0x34')](_0x5a1f03)['then'](function(_0x4d56b1){return _0x4d56b1;});}return null;};}function removeEntity(_0x6c5b5d,_0xea704){return function(_0x22fef8){if(_0x22fef8){return _0x22fef8['destroy']()[_0x4980('0x1f')](function(){_0x6c5b5d[_0x4980('0x29')](0xcc)[_0x4980('0x2a')]();});}};}function handleEntityNotFound(_0x359e3c,_0x256287){return function(_0x1d1b5c){if(!_0x1d1b5c){_0x359e3c[_0x4980('0x28')](0x194);}return _0x1d1b5c;};}function handleError(_0x4af6a9,_0x4050f0){_0x4050f0=_0x4050f0||0x1f4;return function(_0x38dada){logger[_0x4980('0x24')](_0x38dada[_0x4980('0x35')]);if(_0x38dada[_0x4980('0x36')]){delete _0x38dada['name'];}_0x4af6a9[_0x4980('0x29')](_0x4050f0)['send'](_0x38dada);};}exports[_0x4980('0x37')]=function(_0x552f90,_0x3b79f8){var _0x30789d={},_0x48964d={},_0x17093a={'count':0x0,'rows':[]};var _0x217630=db[_0x4980('0x38')]['rawAttributes'];_0x48964d['model']=_[_0x4980('0x39')](_0x217630);_0x48964d[_0x4980('0x3a')]=_['keys'](_0x552f90[_0x4980('0x3a')]);_0x48964d[_0x4980('0x3b')]=_['intersection'](_0x48964d[_0x4980('0x3c')],_0x48964d[_0x4980('0x3a')]);_0x30789d[_0x4980('0x3d')]=_[_0x4980('0x3e')](_0x48964d['model'],qs[_0x4980('0x3f')](_0x552f90[_0x4980('0x3a')][_0x4980('0x3f')]));_0x30789d['attributes']=_0x30789d[_0x4980('0x3d')][_0x4980('0x40')]?_0x30789d[_0x4980('0x3d')]:_0x48964d[_0x4980('0x3c')];if(!_0x552f90['query'][_0x4980('0x41')](_0x4980('0x42'))){_0x30789d[_0x4980('0x2e')]=qs['limit'](_0x552f90[_0x4980('0x3a')][_0x4980('0x2e')]);_0x30789d[_0x4980('0x2d')]=qs['offset'](_0x552f90[_0x4980('0x3a')]['offset']);}_0x30789d[_0x4980('0x43')]=qs[_0x4980('0x44')](_0x552f90[_0x4980('0x3a')][_0x4980('0x44')]);_0x30789d[_0x4980('0x45')]=qs[_0x4980('0x3b')](_[_0x4980('0x46')](_0x552f90[_0x4980('0x3a')],_0x48964d[_0x4980('0x3b')]));if(_0x552f90['query'][_0x4980('0x47')]){_0x30789d['where']=_[_0x4980('0x48')](_0x30789d[_0x4980('0x45')],{'$or':_[_0x4980('0x49')](_0x217630,function(_0x3b72c6){if(_0x3b72c6[_0x4980('0x4a')][_0x4980('0x4b')]!==_0x4980('0x4c')){var _0x56a87c={};_0x56a87c[_0x3b72c6['field']]={'$like':'%'+_0x552f90[_0x4980('0x3a')][_0x4980('0x47')]+'%'};return _0x56a87c;}})});}_0x30789d=_['merge']({},_0x30789d,_0x552f90[_0x4980('0x4d')]);var _0x544898={'where':_0x30789d[_0x4980('0x45')]};return db[_0x4980('0x38')][_0x4980('0x2c')](_0x544898)[_0x4980('0x1f')](function(_0x1a003c){_0x17093a[_0x4980('0x2c')]=_0x1a003c;if(_0x552f90['query'][_0x4980('0x4e')]){_0x30789d['include']=[{'all':!![]}];}return db[_0x4980('0x38')][_0x4980('0x4f')](_0x30789d);})[_0x4980('0x1f')](function(_0x366d2f){_0x17093a[_0x4980('0x50')]=_0x366d2f;return _0x17093a;})['then'](respondWithFilteredResult(_0x3b79f8,_0x30789d))[_0x4980('0x51')](handleError(_0x3b79f8,null));};exports[_0x4980('0x52')]=function(_0x53bc90,_0x471628){var _0x16c104={'raw':![],'where':{'id':_0x53bc90[_0x4980('0x53')]['id']}},_0x1dd2e1={};_0x1dd2e1[_0x4980('0x3c')]=_['keys'](db[_0x4980('0x38')]['rawAttributes']);_0x1dd2e1['query']=_[_0x4980('0x39')](_0x53bc90[_0x4980('0x3a')]);_0x1dd2e1[_0x4980('0x3b')]=_[_0x4980('0x3e')](_0x1dd2e1['model'],_0x1dd2e1['query']);_0x16c104[_0x4980('0x3d')]=_['intersection'](_0x1dd2e1['model'],qs['fields'](_0x53bc90[_0x4980('0x3a')]['fields']));_0x16c104[_0x4980('0x3d')]=_0x16c104[_0x4980('0x3d')][_0x4980('0x40')]?_0x16c104['attributes']:_0x1dd2e1['model'];if(_0x53bc90[_0x4980('0x3a')][_0x4980('0x4e')]){_0x16c104[_0x4980('0x54')]=[{'all':!![]}];}_0x16c104=_[_0x4980('0x48')]({},_0x16c104,_0x53bc90[_0x4980('0x4d')]);return db['FreshdeskAccount'][_0x4980('0x55')](_0x16c104)[_0x4980('0x1f')](handleEntityNotFound(_0x471628,null))[_0x4980('0x1f')](respondWithResult(_0x471628,null))[_0x4980('0x51')](handleError(_0x471628,null));};exports[_0x4980('0x56')]=function(_0x572d1c,_0x40de56){return db[_0x4980('0x38')][_0x4980('0x56')](_0x572d1c[_0x4980('0x57')],{})['then'](respondWithResult(_0x40de56,0xc9))[_0x4980('0x51')](handleError(_0x40de56,null));};exports['update']=function(_0x16518a,_0x41e44b){if(_0x16518a[_0x4980('0x57')]['id']){delete _0x16518a[_0x4980('0x57')]['id'];}return db[_0x4980('0x38')][_0x4980('0x55')]({'where':{'id':_0x16518a['params']['id']}})[_0x4980('0x1f')](handleEntityNotFound(_0x41e44b,null))[_0x4980('0x1f')](saveUpdates(_0x16518a[_0x4980('0x57')],null))[_0x4980('0x1f')](respondWithResult(_0x41e44b,null))[_0x4980('0x51')](handleError(_0x41e44b,null));};exports[_0x4980('0x58')]=function(_0x2dd4e1,_0x39792e){return db[_0x4980('0x38')][_0x4980('0x55')]({'where':{'id':_0x2dd4e1['params']['id']}})[_0x4980('0x1f')](handleEntityNotFound(_0x39792e,null))['then'](removeEntity(_0x39792e,null))[_0x4980('0x51')](handleError(_0x39792e,null));};exports[_0x4980('0x59')]=function(_0x145e34,_0x2eae98,_0x4ac147){var _0x24f221={};var _0x161879={};var _0x749e56;var _0x1abfd4;return db['FreshdeskAccount'][_0x4980('0x5a')]({'where':{'id':_0x145e34[_0x4980('0x53')]['id']}})[_0x4980('0x1f')](handleEntityNotFound(_0x2eae98,null))[_0x4980('0x1f')](function(_0x26df85){if(_0x26df85){_0x749e56=_0x26df85;_0x161879['model']=_['keys'](db['FreshdeskConfiguration'][_0x4980('0x5b')]);_0x161879[_0x4980('0x3a')]=_['keys'](_0x145e34[_0x4980('0x3a')]);_0x161879[_0x4980('0x3b')]=_[_0x4980('0x3e')](_0x161879[_0x4980('0x3c')],_0x161879['query']);_0x24f221[_0x4980('0x3d')]=_[_0x4980('0x3e')](_0x161879[_0x4980('0x3c')],qs['fields'](_0x145e34[_0x4980('0x3a')]['fields']));_0x24f221[_0x4980('0x3d')]=_0x24f221[_0x4980('0x3d')][_0x4980('0x40')]?_0x24f221[_0x4980('0x3d')]:_0x161879[_0x4980('0x3c')];_0x24f221[_0x4980('0x43')]=qs[_0x4980('0x44')](_0x145e34[_0x4980('0x3a')][_0x4980('0x44')]);_0x24f221[_0x4980('0x45')]=qs['filters'](_[_0x4980('0x46')](_0x145e34['query'],_0x161879[_0x4980('0x3b')]));if(_0x145e34[_0x4980('0x3a')]['filter']){_0x24f221[_0x4980('0x45')]=_[_0x4980('0x48')](_0x24f221[_0x4980('0x45')],{'$or':_[_0x4980('0x49')](_0x24f221[_0x4980('0x3d')],function(_0x55a4f5){var _0x449a0a={};_0x449a0a[_0x55a4f5]={'$like':'%'+_0x145e34[_0x4980('0x3a')]['filter']+'%'};return _0x449a0a;})});}_0x24f221=_[_0x4980('0x48')]({},_0x24f221,_0x145e34['options']);return _0x749e56[_0x4980('0x59')](_0x24f221);}})[_0x4980('0x1f')](function(_0x158436){if(_0x158436){_0x1abfd4=_0x158436[_0x4980('0x40')];if(!_0x145e34['query'][_0x4980('0x41')](_0x4980('0x42'))){_0x24f221[_0x4980('0x2e')]=qs[_0x4980('0x2e')](_0x145e34[_0x4980('0x3a')][_0x4980('0x2e')]);_0x24f221['offset']=qs['offset'](_0x145e34[_0x4980('0x3a')][_0x4980('0x2d')]);}return _0x749e56['getConfigurations'](_0x24f221);}})[_0x4980('0x1f')](function(_0x2957a5){if(_0x2957a5){return _0x2957a5?{'count':_0x1abfd4,'rows':_0x2957a5}:null;}})[_0x4980('0x1f')](respondWithResult(_0x2eae98,null))[_0x4980('0x51')](handleError(_0x2eae98,null));};exports[_0x4980('0x5c')]=function(_0x135bbf,_0x171743,_0x18d20e){if(_0x135bbf['body']['id']){delete _0x135bbf[_0x4980('0x57')]['id'];}return db[_0x4980('0x38')][_0x4980('0x5a')]({'where':{'id':_0x135bbf[_0x4980('0x53')]['id']}})[_0x4980('0x1f')](handleEntityNotFound(_0x171743,null))[_0x4980('0x1f')](function(_0x378228){if(_0x378228){_0x135bbf[_0x4980('0x57')][_0x4980('0x5d')]=_0x378228['id'];_0x135bbf[_0x4980('0x57')]['Subjects']=integrations[_0x4980('0x5e')](_0x135bbf['body']['channel'],_0x135bbf[_0x4980('0x57')][_0x4980('0x4a')]);_0x135bbf['body'][_0x4980('0x5f')]=integrations[_0x4980('0x60')](_0x135bbf[_0x4980('0x57')][_0x4980('0x61')],_0x135bbf[_0x4980('0x57')][_0x4980('0x4a')]);return db[_0x4980('0x62')][_0x4980('0x56')](_0x135bbf[_0x4980('0x57')],{'include':[{'model':db[_0x4980('0x63')],'as':_0x4980('0x64')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x171743,null))[_0x4980('0x51')](handleError(_0x171743,null));};exports[_0x4980('0x65')]=function(_0x49d4ea,_0x4a3d0f,_0x158465){var _0x12d521='';return db[_0x4980('0x38')][_0x4980('0x5a')]({'where':{'id':_0x49d4ea[_0x4980('0x53')]['id']},'attributes':['id',_0x4980('0x66'),'apiKey']})[_0x4980('0x1f')](handleEntityNotFound(_0x4a3d0f,null))[_0x4980('0x1f')](function(_0x3959ec){if(_0x3959ec){_0x12d521=_0x3959ec['remoteUri'];var _0x5c6235=_0x12d521[_0x4980('0x67')](-0x1);if(_0x5c6235==='/'){_0x12d521=_0x12d521[_0x4980('0x68')](0x0,_0x12d521['lastIndexOf'](_0x5c6235));}return rp({'method':_0x4980('0x69'),'uri':util[_0x4980('0x6a')](_0x4980('0x6b'),_0x12d521,_0x4980('0x6c')),'headers':{'Authorization':util[_0x4980('0x6a')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x3959ec['apiKey']))[_0x4980('0x6d')]('base64'))},'json':!![]});}})[_0x4980('0x1f')](function(_0x4a70ae){if(_0x4a70ae){var _0x3fc926=[_0x4980('0x6e'),_0x4980('0x6f'),'agent',_0x4980('0x70'),_0x4980('0x29'),_0x4980('0x71'),_0x4980('0x72'),_0x4980('0x73'),'ticket_type',_0x4980('0x72'),_0x4980('0x74')];_[_0x4980('0x75')](_0x4a70ae,function(_0x229485){return _0x3fc926[_0x4980('0x76')](_0x229485[_0x4980('0x36')])||!_0x229485[_0x4980('0x77')]&&_0x229485[_0x4980('0x4a')]!=='custom_text'&&_0x229485['type']!=='custom_dropdown';});return{'count':_0x4a70ae['length'],'rows':_[_0x4980('0x49')](_0x4a70ae,function(_0x32adb4){return{'id':_0x32adb4[_0x4980('0x36')],'name':_0x32adb4[_0x4980('0x78')],'custom':!_0x32adb4['default'],'options':_0x32adb4['choices']?_[_0x4980('0x49')](_0x32adb4[_0x4980('0x79')],function(_0x5e97b3){return{'name':_[_0x4980('0x7a')](_0x5e97b3),'value':_0x5e97b3};}):[]};})};}})[_0x4980('0x1f')](respondWithResult(_0x4a3d0f,null))[_0x4980('0x51')](function(_0x5be380){var _0x321eee=_0x49d4ea['query']['test']?0x1f4:_0x5be380[_0x4980('0x7b')]||0x1f4;logger[_0x4980('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x4980('0x65'),_0x321eee,JSON[_0x4980('0x23')](_0x5be380));delete _0x5be380['name'];if(_0x321eee===0x191){_0x321eee=0x190;}_0x4a3d0f[_0x4980('0x29')](_0x321eee)[_0x4980('0x7c')](_0x49d4ea[_0x4980('0x3a')][_0x4980('0x1c')]?{'message':_0x4980('0x7d'),'statusCode':_0x5be380['statusCode']}:_0x5be380);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a9020a3..7c413da 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 _0xe2b8=['api','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','lodash','util','../../config/logger'];(function(_0x5bc8d1,_0x5800fe){var _0x5db7d0=function(_0x5a9756){while(--_0x5a9756){_0x5bc8d1['push'](_0x5bc8d1['shift']());}};_0x5db7d0(++_0x5800fe);}(_0xe2b8,0xc9));var _0x8e2b=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0xe2b8[_0x4bd950];return _0x5dc59a;};'use strict';var _=require(_0x8e2b('0x0'));var util=require(_0x8e2b('0x1'));var logger=require(_0x8e2b('0x2'))(_0x8e2b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8e2b('0x4'));var fs=require('fs');var path=require(_0x8e2b('0x5'));var rimraf=require(_0x8e2b('0x6'));var config=require(_0x8e2b('0x7'));var attributes=require(_0x8e2b('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8e2b('0x9')]=function(_0x4c2a46,_0x495f1f){return _0x4c2a46[_0x8e2b('0xa')](_0x8e2b('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d79=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d79,0x94));var _0x90d7=function(_0x53e0f9,_0x2c84f0){_0x53e0f9=_0x53e0f9-0x0;var _0x46afe5=_0x0d79[_0x53e0f9];return _0x46afe5;};'use strict';var _=require(_0x90d7('0x0'));var util=require('util');var logger=require(_0x90d7('0x1'))(_0x90d7('0x2'));var moment=require('moment');var BPromise=require(_0x90d7('0x3'));var rp=require(_0x90d7('0x4'));var fs=require('fs');var path=require(_0x90d7('0x5'));var rimraf=require(_0x90d7('0x6'));var config=require(_0x90d7('0x7'));var attributes=require(_0x90d7('0x8'));var integrations=require(_0x90d7('0x9'));module[_0x90d7('0xa')]=function(_0x3ae17f,_0x162b4b){return _0x3ae17f[_0x90d7('0xb')](_0x90d7('0xc'),attributes,{'tableName':_0x90d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 8e29dfc..520f0cb 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 _0x5a34=['catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','moment','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0x5a34,0x8a));var _0x45a3=function(_0xaddecb,_0x376ff0){_0xaddecb=_0xaddecb-0x0;var _0x3b3651=_0x5a34[_0xaddecb];return _0x3b3651;};'use strict';var _=require(_0x45a3('0x0'));var util=require('util');var moment=require(_0x45a3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x45a3('0x2'));var jayson=require(_0x45a3('0x3'));var client=jayson[_0x45a3('0x4')][_0x45a3('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3c6a8a,_0x1e52c0,_0x298429){return new BPromise(function(_0x4e2448,_0x5e90a0){return client[_0x45a3('0x6')](_0x3c6a8a,_0x298429)[_0x45a3('0x7')](function(_0x17787c){logger[_0x45a3('0x8')](_0x45a3('0x9'),_0x1e52c0,'request\x20sent');logger[_0x45a3('0xa')](_0x45a3('0xb'),_0x1e52c0,'request\x20sent',JSON[_0x45a3('0xc')](_0x17787c));if(_0x17787c[_0x45a3('0xd')]){if(_0x17787c[_0x45a3('0xd')]['code']===0x1f4){logger[_0x45a3('0xd')](_0x45a3('0x9'),_0x1e52c0,_0x17787c['error'][_0x45a3('0xe')]);return _0x5e90a0(_0x17787c[_0x45a3('0xd')]['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1e52c0,_0x17787c['error']['message']);return _0x4e2448(_0x17787c[_0x45a3('0xd')][_0x45a3('0xe')]);}else{logger[_0x45a3('0x8')](_0x45a3('0x9'),_0x1e52c0,_0x45a3('0xf'));_0x4e2448(_0x17787c[_0x45a3('0x10')][_0x45a3('0xe')]);}})[_0x45a3('0x11')](function(_0xf47664){logger[_0x45a3('0xd')](_0x45a3('0x9'),_0x1e52c0,_0xf47664);_0x5e90a0(_0xf47664);});});}exports[_0x45a3('0x12')]=function(_0x4ada68){var _0x1b11b7=this;return new Promise(function(_0x5d6de8,_0x20780a){return db[_0x45a3('0x13')][_0x45a3('0x14')]({'raw':_0x4ada68['options']?_0x4ada68[_0x45a3('0x15')][_0x45a3('0x16')]===undefined?!![]:![]:!![],'where':_0x4ada68[_0x45a3('0x15')]?_0x4ada68[_0x45a3('0x15')][_0x45a3('0x17')]||null:null,'attributes':_0x4ada68[_0x45a3('0x15')]?_0x4ada68[_0x45a3('0x15')][_0x45a3('0x18')]||null:null,'limit':_0x4ada68['options']?_0x4ada68[_0x45a3('0x15')][_0x45a3('0x19')]||null:null,'include':_0x4ada68[_0x45a3('0x15')]?_0x4ada68[_0x45a3('0x15')][_0x45a3('0x1a')]?_[_0x45a3('0x1b')](_0x4ada68[_0x45a3('0x15')][_0x45a3('0x1a')],function(_0x4ccd26){return{'model':db[_0x4ccd26[_0x45a3('0x1c')]],'as':_0x4ccd26['as'],'attributes':_0x4ccd26['attributes'],'include':_0x4ccd26['include']?_[_0x45a3('0x1b')](_0x4ccd26['include'],function(_0xb6ba6b){return{'model':db[_0xb6ba6b[_0x45a3('0x1c')]],'as':_0xb6ba6b['as'],'attributes':_0xb6ba6b[_0x45a3('0x18')],'include':_0xb6ba6b[_0x45a3('0x1a')]?_[_0x45a3('0x1b')](_0xb6ba6b[_0x45a3('0x1a')],function(_0x23ef55){return{'model':db[_0x23ef55[_0x45a3('0x1c')]],'as':_0x23ef55['as'],'attributes':_0x23ef55[_0x45a3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x45a3('0x7')](function(_0xe225e6){logger['info']('GetFreshdeskAccount',_0x4ada68);logger[_0x45a3('0xa')](_0x45a3('0x12'),_0x4ada68,JSON[_0x45a3('0xc')](_0xe225e6));_0x5d6de8(_0xe225e6);})[_0x45a3('0x11')](function(_0x144008){logger[_0x45a3('0xd')]('GetFreshdeskAccount',_0x144008[_0x45a3('0xe')],_0x4ada68);_0x20780a(_0x1b11b7[_0x45a3('0xd')](0x1f4,_0x144008[_0x45a3('0xe')]));});});};exports[_0x45a3('0x1d')]=function(_0x58f269){var _0x4cc87d=this;return new Promise(function(_0x337fe3,_0x122ca1){return db[_0x45a3('0x13')][_0x45a3('0x1e')]({'raw':_0x58f269['options']?_0x58f269[_0x45a3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x58f269[_0x45a3('0x15')]?_0x58f269[_0x45a3('0x15')]['where']||null:null,'attributes':_0x58f269[_0x45a3('0x15')]?_0x58f269[_0x45a3('0x15')][_0x45a3('0x18')]||null:null,'include':_0x58f269[_0x45a3('0x15')]?_0x58f269[_0x45a3('0x15')][_0x45a3('0x1a')]?_[_0x45a3('0x1b')](_0x58f269[_0x45a3('0x15')][_0x45a3('0x1a')],function(_0x107705){return{'model':db[_0x107705[_0x45a3('0x1c')]],'as':_0x107705['as'],'attributes':_0x107705['attributes'],'include':_0x107705[_0x45a3('0x1a')]?_[_0x45a3('0x1b')](_0x107705[_0x45a3('0x1a')],function(_0x2f397e){return{'model':db[_0x2f397e['model']],'as':_0x2f397e['as'],'attributes':_0x2f397e[_0x45a3('0x18')],'include':_0x2f397e[_0x45a3('0x1a')]?_[_0x45a3('0x1b')](_0x2f397e[_0x45a3('0x1a')],function(_0x1e7121){return{'model':db[_0x1e7121[_0x45a3('0x1c')]],'as':_0x1e7121['as'],'attributes':_0x1e7121[_0x45a3('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d4a00){logger[_0x45a3('0x8')]('ShowFreshdeskAccount',_0x58f269);logger[_0x45a3('0xa')](_0x45a3('0x1d'),_0x58f269,JSON[_0x45a3('0xc')](_0x5d4a00));_0x337fe3(_0x5d4a00);})[_0x45a3('0x11')](function(_0x3bcc41){logger['error'](_0x45a3('0x1d'),_0x3bcc41[_0x45a3('0xe')],_0x58f269);_0x122ca1(_0x4cc87d[_0x45a3('0xd')](0x1f4,_0x3bcc41[_0x45a3('0xe')]));});});}; \ No newline at end of file +var _0x909e=['info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFreshdeskAccount','options','raw','attributes','limit','map','include','model','then','stringify','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x5400a1,_0x12ade6){var _0x550038=function(_0x5687bd){while(--_0x5687bd){_0x5400a1['push'](_0x5400a1['shift']());}};_0x550038(++_0x12ade6);}(_0x909e,0x9e));var _0xe909=function(_0x6ccc2a,_0x3ea4e1){_0x6ccc2a=_0x6ccc2a-0x0;var _0x352968=_0x909e[_0x6ccc2a];return _0x352968;};'use strict';var _=require(_0xe909('0x0'));var util=require(_0xe909('0x1'));var moment=require(_0xe909('0x2'));var BPromise=require(_0xe909('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe909('0x4'));var db=require(_0xe909('0x5'))['db'];var utils=require(_0xe909('0x6'));var logger=require(_0xe909('0x7'))(_0xe909('0x8'));var config=require(_0xe909('0x9'));var jayson=require(_0xe909('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25f290,_0xc9bf68,_0x34dee6){return new BPromise(function(_0x1efcab,_0x4c802f){return client[_0xe909('0xb')](_0x25f290,_0x34dee6)['then'](function(_0x5ebf25){logger[_0xe909('0xc')](_0xe909('0xd'),_0xc9bf68,_0xe909('0xe'));logger[_0xe909('0xf')](_0xe909('0x10'),_0xc9bf68,_0xe909('0xe'),JSON['stringify'](_0x5ebf25));if(_0x5ebf25['error']){if(_0x5ebf25[_0xe909('0x11')][_0xe909('0x12')]===0x1f4){logger[_0xe909('0x11')](_0xe909('0xd'),_0xc9bf68,_0x5ebf25[_0xe909('0x11')]['message']);return _0x4c802f(_0x5ebf25[_0xe909('0x11')][_0xe909('0x13')]);}logger[_0xe909('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0xc9bf68,_0x5ebf25[_0xe909('0x11')]['message']);return _0x1efcab(_0x5ebf25['error'][_0xe909('0x13')]);}else{logger[_0xe909('0xc')](_0xe909('0xd'),_0xc9bf68,_0xe909('0xe'));_0x1efcab(_0x5ebf25[_0xe909('0x14')][_0xe909('0x13')]);}})[_0xe909('0x15')](function(_0x2f82ad){logger[_0xe909('0x11')](_0xe909('0xd'),_0xc9bf68,_0x2f82ad);_0x4c802f(_0x2f82ad);});});}exports[_0xe909('0x16')]=function(_0x171697){var _0x2085ca=this;return new Promise(function(_0x2dcce6,_0xcdc115){return db['FreshdeskAccount']['findAll']({'raw':_0x171697[_0xe909('0x17')]?_0x171697[_0xe909('0x17')][_0xe909('0x18')]===undefined?!![]:![]:!![],'where':_0x171697[_0xe909('0x17')]?_0x171697[_0xe909('0x17')]['where']||null:null,'attributes':_0x171697[_0xe909('0x17')]?_0x171697[_0xe909('0x17')][_0xe909('0x19')]||null:null,'limit':_0x171697[_0xe909('0x17')]?_0x171697[_0xe909('0x17')][_0xe909('0x1a')]||null:null,'include':_0x171697[_0xe909('0x17')]?_0x171697[_0xe909('0x17')]['include']?_[_0xe909('0x1b')](_0x171697[_0xe909('0x17')][_0xe909('0x1c')],function(_0x1d5818){return{'model':db[_0x1d5818['model']],'as':_0x1d5818['as'],'attributes':_0x1d5818[_0xe909('0x19')],'include':_0x1d5818[_0xe909('0x1c')]?_[_0xe909('0x1b')](_0x1d5818[_0xe909('0x1c')],function(_0x49ab3e){return{'model':db[_0x49ab3e[_0xe909('0x1d')]],'as':_0x49ab3e['as'],'attributes':_0x49ab3e[_0xe909('0x19')],'include':_0x49ab3e[_0xe909('0x1c')]?_['map'](_0x49ab3e[_0xe909('0x1c')],function(_0x5ad6fe){return{'model':db[_0x5ad6fe[_0xe909('0x1d')]],'as':_0x5ad6fe['as'],'attributes':_0x5ad6fe[_0xe909('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe909('0x1e')](function(_0x59a432){logger[_0xe909('0xc')]('GetFreshdeskAccount',_0x171697);logger[_0xe909('0xf')](_0xe909('0x16'),_0x171697,JSON[_0xe909('0x1f')](_0x59a432));_0x2dcce6(_0x59a432);})['catch'](function(_0x4bbbeb){logger[_0xe909('0x11')](_0xe909('0x16'),_0x4bbbeb['message'],_0x171697);_0xcdc115(_0x2085ca[_0xe909('0x11')](0x1f4,_0x4bbbeb[_0xe909('0x13')]));});});};exports[_0xe909('0x20')]=function(_0x3cb864){var _0x5ecc39=this;return new Promise(function(_0x578483,_0x5e0b49){return db['FreshdeskAccount'][_0xe909('0x21')]({'raw':_0x3cb864[_0xe909('0x17')]?_0x3cb864[_0xe909('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cb864[_0xe909('0x17')]?_0x3cb864[_0xe909('0x17')]['where']||null:null,'attributes':_0x3cb864[_0xe909('0x17')]?_0x3cb864[_0xe909('0x17')][_0xe909('0x19')]||null:null,'include':_0x3cb864[_0xe909('0x17')]?_0x3cb864[_0xe909('0x17')][_0xe909('0x1c')]?_[_0xe909('0x1b')](_0x3cb864['options']['include'],function(_0xb440dc){return{'model':db[_0xb440dc[_0xe909('0x1d')]],'as':_0xb440dc['as'],'attributes':_0xb440dc[_0xe909('0x19')],'include':_0xb440dc[_0xe909('0x1c')]?_[_0xe909('0x1b')](_0xb440dc[_0xe909('0x1c')],function(_0x4cc6d5){return{'model':db[_0x4cc6d5[_0xe909('0x1d')]],'as':_0x4cc6d5['as'],'attributes':_0x4cc6d5['attributes'],'include':_0x4cc6d5[_0xe909('0x1c')]?_[_0xe909('0x1b')](_0x4cc6d5[_0xe909('0x1c')],function(_0x59e098){return{'model':db[_0x59e098[_0xe909('0x1d')]],'as':_0x59e098['as'],'attributes':_0x59e098[_0xe909('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3eca79){logger[_0xe909('0xc')](_0xe909('0x20'),_0x3cb864);logger[_0xe909('0xf')](_0xe909('0x20'),_0x3cb864,JSON[_0xe909('0x1f')](_0x3eca79));_0x578483(_0x3eca79);})['catch'](function(_0x173a47){logger['error'](_0xe909('0x20'),_0x173a47[_0xe909('0x13')],_0x3cb864);_0x5e0b49(_0x5ecc39[_0xe909('0x11')](0x1f4,_0x173a47[_0xe909('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 7f12c18..fccb095 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 _0x6334=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0xbaf7fb,_0xbce607){var _0x5c901a=function(_0x231595){while(--_0x231595){_0xbaf7fb['push'](_0xbaf7fb['shift']());}};_0x5c901a(++_0xbce607);}(_0x6334,0x119));var _0x4633=function(_0x1af482,_0x1af5b7){_0x1af482=_0x1af482-0x0;var _0x7e7580=_0x6334[_0x1af482];return _0x7e7580;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4633('0x6'));var config=require(_0x4633('0x7'));var controller=require(_0x4633('0x8'));router[_0x4633('0x9')]('/',auth[_0x4633('0xa')](),controller[_0x4633('0xb')]);router[_0x4633('0x9')]('/:id',auth[_0x4633('0xa')](),controller['show']);router[_0x4633('0x9')](_0x4633('0xc'),auth['isAuthenticated'](),controller[_0x4633('0xd')]);router[_0x4633('0x9')](_0x4633('0xe'),auth['isAuthenticated'](),controller[_0x4633('0xf')]);router[_0x4633('0x9')]('/:id/descriptions',auth[_0x4633('0xa')](),controller[_0x4633('0x10')]);router[_0x4633('0x9')](_0x4633('0x11'),auth['isAuthenticated'](),controller[_0x4633('0x12')]);router[_0x4633('0x13')]('/',auth[_0x4633('0xa')](),controller['create']);router['post']('/:id/tags',auth[_0x4633('0xa')](),controller[_0x4633('0x14')]);router['put']('/:id',auth[_0x4633('0xa')](),controller['update']);router[_0x4633('0x15')](_0x4633('0x16'),auth[_0x4633('0xa')](),controller[_0x4633('0x17')]);module['exports']=router; \ No newline at end of file +var _0x04de=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update'];(function(_0x5b62e3,_0xb78534){var _0x3f46d2=function(_0x20de54){while(--_0x20de54){_0x5b62e3['push'](_0x5b62e3['shift']());}};_0x3f46d2(++_0xb78534);}(_0x04de,0x107));var _0xe04d=function(_0x22c9eb,_0x46071b){_0x22c9eb=_0x22c9eb-0x0;var _0x276e4d=_0x04de[_0x22c9eb];return _0x276e4d;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var auth=require(_0xe04d('0x6'));var interaction=require(_0xe04d('0x7'));var config=require(_0xe04d('0x8'));var controller=require(_0xe04d('0x9'));router[_0xe04d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xe04d('0xb')](),controller[_0xe04d('0xc')]);router[_0xe04d('0xa')](_0xe04d('0xd'),auth[_0xe04d('0xb')](),controller[_0xe04d('0xe')]);router[_0xe04d('0xa')](_0xe04d('0xf'),auth['isAuthenticated'](),controller[_0xe04d('0x10')]);router[_0xe04d('0xa')](_0xe04d('0x11'),auth[_0xe04d('0xb')](),controller[_0xe04d('0x12')]);router[_0xe04d('0xa')](_0xe04d('0x13'),auth[_0xe04d('0xb')](),controller[_0xe04d('0x14')]);router['post']('/',auth[_0xe04d('0xb')](),controller[_0xe04d('0x15')]);router[_0xe04d('0x16')](_0xe04d('0x13'),auth[_0xe04d('0xb')](),controller[_0xe04d('0x17')]);router[_0xe04d('0x18')](_0xe04d('0x19'),auth[_0xe04d('0xb')](),controller[_0xe04d('0x1a')]);router[_0xe04d('0x1b')](_0xe04d('0x19'),auth['isAuthenticated'](),controller[_0xe04d('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 27d1d2a..c668083 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 _0xf203=['STRING','sequelize'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xf203,0x87));var _0x3f20=function(_0x13206b,_0x43d155){_0x13206b=_0x13206b-0x0;var _0x38d143=_0xf203[_0x13206b];return _0x38d143;};'use strict';var Sequelize=require(_0x3f20('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f20('0x1')]}}; \ No newline at end of file +var _0xb0af=['sequelize','STRING'];(function(_0x2048e1,_0x30bbf0){var _0x26e535=function(_0x31dfaa){while(--_0x31dfaa){_0x2048e1['push'](_0x2048e1['shift']());}};_0x26e535(++_0x30bbf0);}(_0xb0af,0xe6));var _0xfb0a=function(_0x1875be,_0x4b8496){_0x1875be=_0x1875be-0x0;var _0x356054=_0xb0af[_0x1875be];return _0x356054;};'use strict';var Sequelize=require(_0xfb0a('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb0a('0x1')]},'description':{'type':Sequelize[_0xfb0a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 30a6276..106c0a0 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 _0xb89c=['stack','name','send','index','FreshdeskConfiguration','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','key','field','filter','count','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','create','body','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','setTags','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','http','test','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','update','then'];(function(_0x50f8fb,_0x6a4b5c){var _0x5032f9=function(_0x1955c2){while(--_0x1955c2){_0x50f8fb['push'](_0x50f8fb['shift']());}};_0x5032f9(++_0x6a4b5c);}(_0xb89c,0x198));var _0xcb89=function(_0x6709c3,_0x5077c0){_0x6709c3=_0x6709c3-0x0;var _0x6ca8e2=_0xb89c[_0x6709c3];return _0x6ca8e2;};'use strict';var pdf=require(_0xcb89('0x0'));var emlformat=require(_0xcb89('0x1'));var rimraf=require(_0xcb89('0x2'));var zipdir=require(_0xcb89('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb89('0x4'));var moment=require(_0xcb89('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcb89('0x6'));var util=require(_0xcb89('0x7'));var path=require(_0xcb89('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcb89('0x9'));var fs=require('fs');var _=require(_0xcb89('0xa'));var squel=require(_0xcb89('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb89('0xc'));var deskjs=require(_0xcb89('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcb89('0xe'));var Redis=require('ioredis');var authService=require(_0xcb89('0xf'));var qs=require(_0xcb89('0x10'));var hardwareService=require(_0xcb89('0x11'));var logger=require(_0xcb89('0x12'))(_0xcb89('0x13'));var utils=require(_0xcb89('0x14'));var config=require('../../config/environment');var db=require(_0xcb89('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xcb89('0x16')][_0xcb89('0x17')]({'port':0x232a});function checkPasswordPattern(_0x31dbd7,_0x363de1,_0x23b94d){if(_0x23b94d){var _0x126903=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x126903[_0xcb89('0x18')](_0x363de1)){return _0x31dbd7;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x31dbd7;}}function respondWithRpcPromise(_0x33f09a,_0x90a9eb,_0x5686ac,_0x335236){return new BPromise(function(_0x15c35e,_0x1805fa){var _0x50a395=_0x335236||client;return _0x50a395[_0xcb89('0x19')](_0x33f09a,_0x5686ac)['then'](function(_0x5a17a3){logger[_0xcb89('0x1a')](_0xcb89('0x1b'),_0x90a9eb,_0xcb89('0x1c'));logger[_0xcb89('0x1d')](_0xcb89('0x1e'),_0x90a9eb,_0xcb89('0x1c'),JSON[_0xcb89('0x1f')](_0x5a17a3));if(_0x5a17a3[_0xcb89('0x20')]){if(_0x5a17a3['error'][_0xcb89('0x21')]===0x1f4){logger[_0xcb89('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x90a9eb,_0x5a17a3['error'][_0xcb89('0x22')]);return _0x1805fa(_0x5a17a3[_0xcb89('0x20')][_0xcb89('0x22')]);}logger[_0xcb89('0x20')](_0xcb89('0x1b'),_0x90a9eb,_0x5a17a3[_0xcb89('0x20')][_0xcb89('0x22')]);return _0x15c35e(_0x5a17a3[_0xcb89('0x20')]['message']);}else{logger[_0xcb89('0x1a')](_0xcb89('0x1b'),_0x90a9eb,_0xcb89('0x1c'));_0x15c35e(_0x5a17a3[_0xcb89('0x23')]['message']);}})[_0xcb89('0x24')](function(_0x4e81e2){logger[_0xcb89('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x90a9eb,_0x4e81e2);_0x1805fa(_0x4e81e2);});});}function respondWithStatusCode(_0x3f9e5c,_0x1299bd){_0x1299bd=_0x1299bd||0xcc;return function(_0x45f813){if(_0x45f813){return _0x3f9e5c['sendStatus'](_0x1299bd);}return _0x3f9e5c[_0xcb89('0x25')](_0x1299bd)[_0xcb89('0x26')]();};}function respondWithResult(_0x304824,_0x25b797){_0x25b797=_0x25b797||0xc8;return function(_0x7dc2d2){if(_0x7dc2d2){return _0x304824[_0xcb89('0x25')](_0x25b797)[_0xcb89('0x27')](_0x7dc2d2);}};}function respondWithFilteredResult(_0x21b739,_0x2eb18f){return function(_0x52ec43){if(_0x52ec43){var _0x27edb2=_0x52ec43['count'],_0x5c1a2f=_0x2eb18f[_0xcb89('0x28')],_0x20e570=_0x2eb18f[_0xcb89('0x28')]+_0x2eb18f[_0xcb89('0x29')],_0x557dd4;if(_0x20e570>=_0x27edb2){_0x20e570=_0x27edb2;_0x557dd4=0xc8;}else{_0x557dd4=0xce;}_0x21b739[_0xcb89('0x25')](_0x557dd4);return _0x21b739[_0xcb89('0x2a')](_0xcb89('0x2b'),_0x5c1a2f+'-'+_0x20e570+'/'+_0x27edb2)[_0xcb89('0x27')](_0x52ec43);}return null;};}function patchUpdates(_0x240258){return function(_0x1d545a){try{jsonpatch[_0xcb89('0x2c')](_0x1d545a,_0x240258,!![]);}catch(_0x2b7808){return BPromise['reject'](_0x2b7808);}return _0x1d545a['save']();};}function saveUpdates(_0xbb8d66,_0x1f0150){return function(_0x5f0548){if(_0x5f0548){return _0x5f0548[_0xcb89('0x2d')](_0xbb8d66)[_0xcb89('0x2e')](function(_0x593c34){return _0x593c34;});}return null;};}function removeEntity(_0x29a087,_0x3c0aa8){return function(_0xab6d80){if(_0xab6d80){return _0xab6d80['destroy']()[_0xcb89('0x2e')](function(){_0x29a087['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd5790c,_0x73c9bc){return function(_0x49c857){if(!_0x49c857){_0xd5790c['sendStatus'](0x194);}return _0x49c857;};}function handleError(_0x1d4d85,_0x38f131){_0x38f131=_0x38f131||0x1f4;return function(_0x153b77){logger['error'](_0x153b77[_0xcb89('0x2f')]);if(_0x153b77[_0xcb89('0x30')]){delete _0x153b77[_0xcb89('0x30')];}_0x1d4d85[_0xcb89('0x25')](_0x38f131)[_0xcb89('0x31')](_0x153b77);};}exports[_0xcb89('0x32')]=function(_0x5179cb,_0x5f171a){var _0x175fa0={},_0x54dcd7={},_0x4be348={'count':0x0,'rows':[]};var _0x3d5bb7=db[_0xcb89('0x33')]['rawAttributes'];_0x54dcd7[_0xcb89('0x34')]=_[_0xcb89('0x35')](_0x3d5bb7);_0x54dcd7[_0xcb89('0x36')]=_[_0xcb89('0x35')](_0x5179cb[_0xcb89('0x36')]);_0x54dcd7['filters']=_['intersection'](_0x54dcd7[_0xcb89('0x34')],_0x54dcd7[_0xcb89('0x36')]);_0x175fa0[_0xcb89('0x37')]=_[_0xcb89('0x38')](_0x54dcd7['model'],qs['fields'](_0x5179cb[_0xcb89('0x36')]['fields']));_0x175fa0[_0xcb89('0x37')]=_0x175fa0[_0xcb89('0x37')][_0xcb89('0x39')]?_0x175fa0[_0xcb89('0x37')]:_0x54dcd7['model'];if(!_0x5179cb[_0xcb89('0x36')][_0xcb89('0x3a')](_0xcb89('0x3b'))){_0x175fa0[_0xcb89('0x29')]=qs[_0xcb89('0x29')](_0x5179cb[_0xcb89('0x36')][_0xcb89('0x29')]);_0x175fa0['offset']=qs[_0xcb89('0x28')](_0x5179cb[_0xcb89('0x36')]['offset']);}_0x175fa0[_0xcb89('0x3c')]=qs['sort'](_0x5179cb[_0xcb89('0x36')][_0xcb89('0x3d')]);_0x175fa0[_0xcb89('0x3e')]=qs[_0xcb89('0x3f')](_[_0xcb89('0x40')](_0x5179cb[_0xcb89('0x36')],_0x54dcd7['filters']));if(_0x5179cb['query']['filter']){_0x175fa0[_0xcb89('0x3e')]=_[_0xcb89('0x41')](_0x175fa0[_0xcb89('0x3e')],{'$or':_[_0xcb89('0x42')](_0x3d5bb7,function(_0x574494){if(_0x574494[_0xcb89('0x43')][_0xcb89('0x44')]!=='VIRTUAL'){var _0x5e400d={};_0x5e400d[_0x574494[_0xcb89('0x45')]]={'$like':'%'+_0x5179cb[_0xcb89('0x36')][_0xcb89('0x46')]+'%'};return _0x5e400d;}})});}_0x175fa0=_[_0xcb89('0x41')]({},_0x175fa0,_0x5179cb['options']);var _0x2c2b38={'where':_0x175fa0[_0xcb89('0x3e')]};return db[_0xcb89('0x33')][_0xcb89('0x47')](_0x2c2b38)['then'](function(_0xa98b92){_0x4be348['count']=_0xa98b92;if(_0x5179cb[_0xcb89('0x36')][_0xcb89('0x48')]){_0x175fa0[_0xcb89('0x49')]=[{'all':!![]}];}return db[_0xcb89('0x33')][_0xcb89('0x4a')](_0x175fa0);})['then'](function(_0x2bdf2d){_0x4be348[_0xcb89('0x4b')]=_0x2bdf2d;return _0x4be348;})['then'](respondWithFilteredResult(_0x5f171a,_0x175fa0))[_0xcb89('0x24')](handleError(_0x5f171a,null));};exports[_0xcb89('0x4c')]=function(_0x511841,_0x4bb31e){var _0x3775b3={'raw':![],'where':{'id':_0x511841[_0xcb89('0x4d')]['id']}},_0x46df58={};_0x46df58[_0xcb89('0x34')]=_[_0xcb89('0x35')](db[_0xcb89('0x33')][_0xcb89('0x4e')]);_0x46df58[_0xcb89('0x36')]=_['keys'](_0x511841[_0xcb89('0x36')]);_0x46df58[_0xcb89('0x3f')]=_['intersection'](_0x46df58[_0xcb89('0x34')],_0x46df58['query']);_0x3775b3[_0xcb89('0x37')]=_[_0xcb89('0x38')](_0x46df58[_0xcb89('0x34')],qs[_0xcb89('0x4f')](_0x511841['query']['fields']));_0x3775b3[_0xcb89('0x37')]=_0x3775b3[_0xcb89('0x37')][_0xcb89('0x39')]?_0x3775b3[_0xcb89('0x37')]:_0x46df58[_0xcb89('0x34')];if(_0x511841[_0xcb89('0x36')][_0xcb89('0x48')]){_0x3775b3[_0xcb89('0x49')]=[{'all':!![]}];}_0x3775b3=_[_0xcb89('0x41')]({},_0x3775b3,_0x511841['options']);return db[_0xcb89('0x33')][_0xcb89('0x50')](_0x3775b3)[_0xcb89('0x2e')](handleEntityNotFound(_0x4bb31e,null))['then'](respondWithResult(_0x4bb31e,null))[_0xcb89('0x24')](handleError(_0x4bb31e,null));};exports['create']=function(_0x248aca,_0x1b1355){return db[_0xcb89('0x33')][_0xcb89('0x51')](_0x248aca[_0xcb89('0x52')],{})[_0xcb89('0x2e')](respondWithResult(_0x1b1355,0xc9))[_0xcb89('0x24')](handleError(_0x1b1355,null));};exports[_0xcb89('0x2d')]=function(_0x2759a5,_0x4670ea){if(_0x2759a5[_0xcb89('0x52')]['id']){delete _0x2759a5[_0xcb89('0x52')]['id'];}return db[_0xcb89('0x33')][_0xcb89('0x50')]({'where':{'id':_0x2759a5[_0xcb89('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4670ea,null))['then'](saveUpdates(_0x2759a5[_0xcb89('0x52')],null))[_0xcb89('0x2e')](respondWithResult(_0x4670ea,null))['catch'](handleError(_0x4670ea,null));};exports['destroy']=function(_0x231303,_0x172ead){return db[_0xcb89('0x33')][_0xcb89('0x50')]({'where':{'id':_0x231303[_0xcb89('0x4d')]['id']}})[_0xcb89('0x2e')](handleEntityNotFound(_0x172ead,null))[_0xcb89('0x2e')](removeEntity(_0x172ead,null))[_0xcb89('0x24')](handleError(_0x172ead,null));};exports[_0xcb89('0x53')]=function(_0x1c7de1,_0x3f68e2,_0xa841ec){var _0x572ab2={};var _0x2d1da0={};var _0x24ab28;var _0x596fdb;return db[_0xcb89('0x33')][_0xcb89('0x54')]({'where':{'id':_0x1c7de1['params']['id']}})[_0xcb89('0x2e')](handleEntityNotFound(_0x3f68e2,null))[_0xcb89('0x2e')](function(_0x1f1168){if(_0x1f1168){_0x24ab28=_0x1f1168;_0x2d1da0['model']=_[_0xcb89('0x35')](db[_0xcb89('0x55')][_0xcb89('0x4e')]);_0x2d1da0[_0xcb89('0x36')]=_[_0xcb89('0x35')](_0x1c7de1['query']);_0x2d1da0['filters']=_[_0xcb89('0x38')](_0x2d1da0[_0xcb89('0x34')],_0x2d1da0[_0xcb89('0x36')]);_0x572ab2[_0xcb89('0x37')]=_['intersection'](_0x2d1da0[_0xcb89('0x34')],qs[_0xcb89('0x4f')](_0x1c7de1[_0xcb89('0x36')][_0xcb89('0x4f')]));_0x572ab2['attributes']=_0x572ab2[_0xcb89('0x37')][_0xcb89('0x39')]?_0x572ab2[_0xcb89('0x37')]:_0x2d1da0[_0xcb89('0x34')];_0x572ab2[_0xcb89('0x3c')]=qs[_0xcb89('0x3d')](_0x1c7de1['query'][_0xcb89('0x3d')]);_0x572ab2['where']=qs[_0xcb89('0x3f')](_[_0xcb89('0x40')](_0x1c7de1[_0xcb89('0x36')],_0x2d1da0['filters']));if(_0x1c7de1[_0xcb89('0x36')]['filter']){_0x572ab2[_0xcb89('0x3e')]=_[_0xcb89('0x41')](_0x572ab2[_0xcb89('0x3e')],{'$or':_[_0xcb89('0x42')](_0x572ab2[_0xcb89('0x37')],function(_0x13b49f){var _0x52067d={};_0x52067d[_0x13b49f]={'$like':'%'+_0x1c7de1['query'][_0xcb89('0x46')]+'%'};return _0x52067d;})});}_0x572ab2=_['merge']({},_0x572ab2,_0x1c7de1[_0xcb89('0x56')]);return _0x24ab28[_0xcb89('0x53')](_0x572ab2);}})[_0xcb89('0x2e')](function(_0x28391c){if(_0x28391c){_0x596fdb=_0x28391c['length'];if(!_0x1c7de1[_0xcb89('0x36')][_0xcb89('0x3a')](_0xcb89('0x3b'))){_0x572ab2[_0xcb89('0x29')]=qs[_0xcb89('0x29')](_0x1c7de1[_0xcb89('0x36')][_0xcb89('0x29')]);_0x572ab2[_0xcb89('0x28')]=qs[_0xcb89('0x28')](_0x1c7de1['query'][_0xcb89('0x28')]);}return _0x24ab28[_0xcb89('0x53')](_0x572ab2);}})[_0xcb89('0x2e')](function(_0x18db17){if(_0x18db17){return _0x18db17?{'count':_0x596fdb,'rows':_0x18db17}:null;}})[_0xcb89('0x2e')](respondWithResult(_0x3f68e2,null))[_0xcb89('0x24')](handleError(_0x3f68e2,null));};exports[_0xcb89('0x57')]=function(_0x28623f,_0x7aeeff,_0x1665bb){var _0x41ebd8={};var _0xcfb053={};var _0x2b2748;var _0xa978f7;return db[_0xcb89('0x33')]['findOne']({'where':{'id':_0x28623f['params']['id']}})[_0xcb89('0x2e')](handleEntityNotFound(_0x7aeeff,null))[_0xcb89('0x2e')](function(_0x5435b3){if(_0x5435b3){_0x2b2748=_0x5435b3;_0xcfb053['model']=_[_0xcb89('0x35')](db[_0xcb89('0x55')][_0xcb89('0x4e')]);_0xcfb053[_0xcb89('0x36')]=_[_0xcb89('0x35')](_0x28623f[_0xcb89('0x36')]);_0xcfb053[_0xcb89('0x3f')]=_[_0xcb89('0x38')](_0xcfb053[_0xcb89('0x34')],_0xcfb053[_0xcb89('0x36')]);_0x41ebd8[_0xcb89('0x37')]=_['intersection'](_0xcfb053[_0xcb89('0x34')],qs['fields'](_0x28623f[_0xcb89('0x36')][_0xcb89('0x4f')]));_0x41ebd8[_0xcb89('0x37')]=_0x41ebd8[_0xcb89('0x37')][_0xcb89('0x39')]?_0x41ebd8[_0xcb89('0x37')]:_0xcfb053['model'];_0x41ebd8[_0xcb89('0x3c')]=qs[_0xcb89('0x3d')](_0x28623f[_0xcb89('0x36')][_0xcb89('0x3d')]);_0x41ebd8[_0xcb89('0x3e')]=qs[_0xcb89('0x3f')](_['pick'](_0x28623f[_0xcb89('0x36')],_0xcfb053['filters']));if(_0x28623f[_0xcb89('0x36')][_0xcb89('0x46')]){_0x41ebd8[_0xcb89('0x3e')]=_[_0xcb89('0x41')](_0x41ebd8[_0xcb89('0x3e')],{'$or':_['map'](_0x41ebd8['attributes'],function(_0x547b95){var _0x303521={};_0x303521[_0x547b95]={'$like':'%'+_0x28623f[_0xcb89('0x36')][_0xcb89('0x46')]+'%'};return _0x303521;})});}_0x41ebd8=_[_0xcb89('0x41')]({},_0x41ebd8,_0x28623f[_0xcb89('0x56')]);return _0x2b2748['getSubjects'](_0x41ebd8);}})['then'](function(_0x1329b3){if(_0x1329b3){_0xa978f7=_0x1329b3[_0xcb89('0x39')];if(!_0x28623f[_0xcb89('0x36')][_0xcb89('0x3a')](_0xcb89('0x3b'))){_0x41ebd8[_0xcb89('0x29')]=qs[_0xcb89('0x29')](_0x28623f[_0xcb89('0x36')][_0xcb89('0x29')]);_0x41ebd8['offset']=qs['offset'](_0x28623f[_0xcb89('0x36')][_0xcb89('0x28')]);}return _0x2b2748[_0xcb89('0x57')](_0x41ebd8);}})[_0xcb89('0x2e')](function(_0x5a5ec1){if(_0x5a5ec1){return _0x5a5ec1?{'count':_0xa978f7,'rows':_0x5a5ec1}:null;}})[_0xcb89('0x2e')](respondWithResult(_0x7aeeff,null))[_0xcb89('0x24')](handleError(_0x7aeeff,null));};exports[_0xcb89('0x58')]=function(_0x11dcf9,_0x2cd802,_0x45a768){var _0x225b72={};var _0x17d28b={};var _0x5ca492;var _0x305c9f;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x11dcf9[_0xcb89('0x4d')]['id']}})[_0xcb89('0x2e')](handleEntityNotFound(_0x2cd802,null))[_0xcb89('0x2e')](function(_0x184a3a){if(_0x184a3a){_0x5ca492=_0x184a3a;_0x17d28b[_0xcb89('0x34')]=_[_0xcb89('0x35')](db[_0xcb89('0x55')][_0xcb89('0x4e')]);_0x17d28b[_0xcb89('0x36')]=_[_0xcb89('0x35')](_0x11dcf9[_0xcb89('0x36')]);_0x17d28b[_0xcb89('0x3f')]=_['intersection'](_0x17d28b['model'],_0x17d28b['query']);_0x225b72['attributes']=_[_0xcb89('0x38')](_0x17d28b[_0xcb89('0x34')],qs[_0xcb89('0x4f')](_0x11dcf9['query'][_0xcb89('0x4f')]));_0x225b72[_0xcb89('0x37')]=_0x225b72[_0xcb89('0x37')][_0xcb89('0x39')]?_0x225b72[_0xcb89('0x37')]:_0x17d28b['model'];_0x225b72['order']=qs[_0xcb89('0x3d')](_0x11dcf9[_0xcb89('0x36')][_0xcb89('0x3d')]);_0x225b72[_0xcb89('0x3e')]=qs[_0xcb89('0x3f')](_[_0xcb89('0x40')](_0x11dcf9[_0xcb89('0x36')],_0x17d28b[_0xcb89('0x3f')]));if(_0x11dcf9[_0xcb89('0x36')][_0xcb89('0x46')]){_0x225b72[_0xcb89('0x3e')]=_['merge'](_0x225b72[_0xcb89('0x3e')],{'$or':_[_0xcb89('0x42')](_0x225b72[_0xcb89('0x37')],function(_0x307183){var _0x3bc3c4={};_0x3bc3c4[_0x307183]={'$like':'%'+_0x11dcf9[_0xcb89('0x36')][_0xcb89('0x46')]+'%'};return _0x3bc3c4;})});}_0x225b72=_[_0xcb89('0x41')]({},_0x225b72,_0x11dcf9[_0xcb89('0x56')]);return _0x5ca492[_0xcb89('0x58')](_0x225b72);}})[_0xcb89('0x2e')](function(_0xb4a086){if(_0xb4a086){_0x305c9f=_0xb4a086[_0xcb89('0x39')];if(!_0x11dcf9[_0xcb89('0x36')][_0xcb89('0x3a')](_0xcb89('0x3b'))){_0x225b72[_0xcb89('0x29')]=qs['limit'](_0x11dcf9[_0xcb89('0x36')]['limit']);_0x225b72[_0xcb89('0x28')]=qs['offset'](_0x11dcf9[_0xcb89('0x36')]['offset']);}return _0x5ca492['getDescriptions'](_0x225b72);}})[_0xcb89('0x2e')](function(_0x5152da){if(_0x5152da){return _0x5152da?{'count':_0x305c9f,'rows':_0x5152da}:null;}})[_0xcb89('0x2e')](respondWithResult(_0x2cd802,null))[_0xcb89('0x24')](handleError(_0x2cd802,null));};exports['getTags']=function(_0x4bcc15,_0x2f453a,_0x3a9f85){var _0x227e93={};var _0x2595cf={};var _0x441ba0;var _0x263915;return db[_0xcb89('0x33')][_0xcb89('0x54')]({'where':{'id':_0x4bcc15[_0xcb89('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2f453a,null))['then'](function(_0x32e810){if(_0x32e810){_0x441ba0=_0x32e810;_0x2595cf['model']=_['keys'](db['Tag'][_0xcb89('0x4e')]);_0x2595cf[_0xcb89('0x36')]=_[_0xcb89('0x35')](_0x4bcc15[_0xcb89('0x36')]);_0x2595cf[_0xcb89('0x3f')]=_['intersection'](_0x2595cf[_0xcb89('0x34')],_0x2595cf[_0xcb89('0x36')]);_0x227e93[_0xcb89('0x37')]=_['intersection'](_0x2595cf['model'],qs['fields'](_0x4bcc15[_0xcb89('0x36')][_0xcb89('0x4f')]));_0x227e93['attributes']=_0x227e93[_0xcb89('0x37')][_0xcb89('0x39')]?_0x227e93[_0xcb89('0x37')]:_0x2595cf[_0xcb89('0x34')];_0x227e93[_0xcb89('0x3c')]=qs[_0xcb89('0x3d')](_0x4bcc15['query']['sort']);_0x227e93[_0xcb89('0x3e')]=qs['filters'](_[_0xcb89('0x40')](_0x4bcc15[_0xcb89('0x36')],_0x2595cf[_0xcb89('0x3f')]));if(_0x4bcc15[_0xcb89('0x36')]['filter']){_0x227e93['where']=_[_0xcb89('0x41')](_0x227e93[_0xcb89('0x3e')],{'$or':_['map'](_0x227e93[_0xcb89('0x37')],function(_0x223603){var _0x2dcc12={};_0x2dcc12[_0x223603]={'$like':'%'+_0x4bcc15['query'][_0xcb89('0x46')]+'%'};return _0x2dcc12;})});}_0x227e93=_[_0xcb89('0x41')]({},_0x227e93,_0x4bcc15['options']);return _0x441ba0['getTags'](_0x227e93);}})[_0xcb89('0x2e')](function(_0x461074){if(_0x461074){_0x263915=_0x461074[_0xcb89('0x39')];if(!_0x4bcc15[_0xcb89('0x36')][_0xcb89('0x3a')]('nolimit')){_0x227e93['limit']=qs[_0xcb89('0x29')](_0x4bcc15[_0xcb89('0x36')][_0xcb89('0x29')]);_0x227e93['offset']=qs[_0xcb89('0x28')](_0x4bcc15[_0xcb89('0x36')][_0xcb89('0x28')]);}return _0x441ba0[_0xcb89('0x59')](_0x227e93);}})[_0xcb89('0x2e')](function(_0x110b8c){if(_0x110b8c){return _0x110b8c?{'count':_0x263915,'rows':_0x110b8c}:null;}})['then'](respondWithResult(_0x2f453a,null))[_0xcb89('0x24')](handleError(_0x2f453a,null));};exports[_0xcb89('0x5a')]=function(_0x118087,_0x1137d4,_0x1ad60a){if(_0x118087[_0xcb89('0x52')]['id']){delete _0x118087['body']['id'];}return db[_0xcb89('0x33')][_0xcb89('0x54')]({'where':{'id':_0x118087[_0xcb89('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1137d4,null))[_0xcb89('0x2e')](function(_0x4e281e){if(_0x4e281e){return _0x4e281e[_0xcb89('0x5a')](_0x118087['body']['ids']||[]);}return null;})[_0xcb89('0x2e')](respondWithResult(_0x1137d4,null))[_0xcb89('0x24')](handleError(_0x1137d4,null));}; \ No newline at end of file +var _0x3cb7=['body','params','findOne','getFields','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','count','offset','Content-Range','json','reject','save','update','destroy','stack','name','send','index','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','FreshdeskConfiguration','include','findAll','rows','catch','show','rawAttributes','includeAll','find'];(function(_0x1ace72,_0x274a09){var _0x38e16e=function(_0x4c31e6){while(--_0x4c31e6){_0x1ace72['push'](_0x1ace72['shift']());}};_0x38e16e(++_0x274a09);}(_0x3cb7,0xcf));var _0x73cb=function(_0x10a548,_0x26a534){_0x10a548=_0x10a548-0x0;var _0x2a8b3b=_0x3cb7[_0x10a548];return _0x2a8b3b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x73cb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73cb('0x1'));var rp=require(_0x73cb('0x2'));var moment=require(_0x73cb('0x3'));var BPromise=require(_0x73cb('0x4'));var Mustache=require(_0x73cb('0x5'));var util=require(_0x73cb('0x6'));var path=require(_0x73cb('0x7'));var sox=require(_0x73cb('0x8'));var csv=require('to-csv');var ejs=require(_0x73cb('0x9'));var fs=require('fs');var _=require(_0x73cb('0xa'));var squel=require(_0x73cb('0xb'));var crypto=require(_0x73cb('0xc'));var jsforce=require(_0x73cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x73cb('0xe'));var querystring=require(_0x73cb('0xf'));var Papa=require(_0x73cb('0x10'));var Redis=require(_0x73cb('0x11'));var authService=require(_0x73cb('0x12'));var qs=require(_0x73cb('0x13'));var hardwareService=require(_0x73cb('0x14'));var logger=require('../../config/logger')(_0x73cb('0x15'));var utils=require(_0x73cb('0x16'));var config=require(_0x73cb('0x17'));var db=require(_0x73cb('0x18'))['db'];var jayson=require(_0x73cb('0x19'));var client=jayson[_0x73cb('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0xf64e4a,_0x231254,_0x14d34d){if(_0x14d34d){var _0x1cc1fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cc1fc[_0x73cb('0x1b')](_0x231254)){return _0xf64e4a;}else{throw new Error(_0x73cb('0x1c'));}}else{return _0xf64e4a;}}function respondWithRpcPromise(_0x776818,_0x43b851,_0x1b096b,_0x1587fb){return new BPromise(function(_0x503765,_0x5e5c8e){var _0x4ef98f=_0x1587fb||client;return _0x4ef98f[_0x73cb('0x1d')](_0x776818,_0x1b096b)[_0x73cb('0x1e')](function(_0x135a8b){logger[_0x73cb('0x1f')](_0x73cb('0x20'),_0x43b851,'request\x20sent');logger[_0x73cb('0x21')](_0x73cb('0x22'),_0x43b851,_0x73cb('0x23'),JSON[_0x73cb('0x24')](_0x135a8b));if(_0x135a8b[_0x73cb('0x25')]){if(_0x135a8b[_0x73cb('0x25')][_0x73cb('0x26')]===0x1f4){logger[_0x73cb('0x25')](_0x73cb('0x20'),_0x43b851,_0x135a8b[_0x73cb('0x25')]['message']);return _0x5e5c8e(_0x135a8b[_0x73cb('0x25')][_0x73cb('0x27')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x43b851,_0x135a8b[_0x73cb('0x25')][_0x73cb('0x27')]);return _0x503765(_0x135a8b[_0x73cb('0x25')]['message']);}else{logger[_0x73cb('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x43b851,'request\x20sent');_0x503765(_0x135a8b[_0x73cb('0x28')][_0x73cb('0x27')]);}})['catch'](function(_0x57da9f){logger[_0x73cb('0x25')](_0x73cb('0x20'),_0x43b851,_0x57da9f);_0x5e5c8e(_0x57da9f);});});}function respondWithStatusCode(_0x5c23e4,_0x1b09d3){_0x1b09d3=_0x1b09d3||0xcc;return function(_0x3fc1fb){if(_0x3fc1fb){return _0x5c23e4[_0x73cb('0x29')](_0x1b09d3);}return _0x5c23e4[_0x73cb('0x2a')](_0x1b09d3)[_0x73cb('0x2b')]();};}function respondWithResult(_0x231dc2,_0x353f1e){_0x353f1e=_0x353f1e||0xc8;return function(_0x285408){if(_0x285408){return _0x231dc2[_0x73cb('0x2a')](_0x353f1e)['json'](_0x285408);}};}function respondWithFilteredResult(_0x27f91f,_0x494cab){return function(_0x1e5c7b){if(_0x1e5c7b){var _0x30e924=_0x1e5c7b[_0x73cb('0x2c')],_0x16c59f=_0x494cab['offset'],_0x2823ae=_0x494cab[_0x73cb('0x2d')]+_0x494cab['limit'],_0x2d6ac8;if(_0x2823ae>=_0x30e924){_0x2823ae=_0x30e924;_0x2d6ac8=0xc8;}else{_0x2d6ac8=0xce;}_0x27f91f[_0x73cb('0x2a')](_0x2d6ac8);return _0x27f91f['set'](_0x73cb('0x2e'),_0x16c59f+'-'+_0x2823ae+'/'+_0x30e924)[_0x73cb('0x2f')](_0x1e5c7b);}return null;};}function patchUpdates(_0x281755){return function(_0x2291fc){try{jsonpatch['apply'](_0x2291fc,_0x281755,!![]);}catch(_0x5c7117){return BPromise[_0x73cb('0x30')](_0x5c7117);}return _0x2291fc[_0x73cb('0x31')]();};}function saveUpdates(_0x1c8153,_0x25f373){return function(_0x5084e1){if(_0x5084e1){return _0x5084e1[_0x73cb('0x32')](_0x1c8153)[_0x73cb('0x1e')](function(_0x1bd58d){return _0x1bd58d;});}return null;};}function removeEntity(_0x20f9d8,_0x315915){return function(_0x342385){if(_0x342385){return _0x342385[_0x73cb('0x33')]()[_0x73cb('0x1e')](function(){_0x20f9d8[_0x73cb('0x2a')](0xcc)[_0x73cb('0x2b')]();});}};}function handleEntityNotFound(_0x5b39ad,_0x5b75da){return function(_0x4f685a){if(!_0x4f685a){_0x5b39ad[_0x73cb('0x29')](0x194);}return _0x4f685a;};}function handleError(_0x1a219b,_0x380f82){_0x380f82=_0x380f82||0x1f4;return function(_0x5c9de8){logger[_0x73cb('0x25')](_0x5c9de8[_0x73cb('0x34')]);if(_0x5c9de8['name']){delete _0x5c9de8[_0x73cb('0x35')];}_0x1a219b['status'](_0x380f82)[_0x73cb('0x36')](_0x5c9de8);};}exports[_0x73cb('0x37')]=function(_0x1dcf11,_0x3ed107){var _0x20f932={},_0x3af504={},_0xf2f41={'count':0x0,'rows':[]};var _0x6b4240=db['FreshdeskConfiguration']['rawAttributes'];_0x3af504[_0x73cb('0x38')]=_['keys'](_0x6b4240);_0x3af504[_0x73cb('0x39')]=_[_0x73cb('0x3a')](_0x1dcf11[_0x73cb('0x39')]);_0x3af504[_0x73cb('0x3b')]=_[_0x73cb('0x3c')](_0x3af504['model'],_0x3af504[_0x73cb('0x39')]);_0x20f932[_0x73cb('0x3d')]=_[_0x73cb('0x3c')](_0x3af504[_0x73cb('0x38')],qs['fields'](_0x1dcf11['query'][_0x73cb('0x3e')]));_0x20f932['attributes']=_0x20f932[_0x73cb('0x3d')][_0x73cb('0x3f')]?_0x20f932[_0x73cb('0x3d')]:_0x3af504[_0x73cb('0x38')];if(!_0x1dcf11[_0x73cb('0x39')][_0x73cb('0x40')](_0x73cb('0x41'))){_0x20f932[_0x73cb('0x42')]=qs[_0x73cb('0x42')](_0x1dcf11[_0x73cb('0x39')]['limit']);_0x20f932['offset']=qs[_0x73cb('0x2d')](_0x1dcf11[_0x73cb('0x39')]['offset']);}_0x20f932[_0x73cb('0x43')]=qs[_0x73cb('0x44')](_0x1dcf11[_0x73cb('0x39')][_0x73cb('0x44')]);_0x20f932[_0x73cb('0x45')]=qs[_0x73cb('0x3b')](_[_0x73cb('0x46')](_0x1dcf11[_0x73cb('0x39')],_0x3af504[_0x73cb('0x3b')]));if(_0x1dcf11[_0x73cb('0x39')]['filter']){_0x20f932[_0x73cb('0x45')]=_[_0x73cb('0x47')](_0x20f932[_0x73cb('0x45')],{'$or':_[_0x73cb('0x48')](_0x6b4240,function(_0x16fd43){if(_0x16fd43[_0x73cb('0x49')]['key']!==_0x73cb('0x4a')){var _0x2b194b={};_0x2b194b[_0x16fd43[_0x73cb('0x4b')]]={'$like':'%'+_0x1dcf11[_0x73cb('0x39')][_0x73cb('0x4c')]+'%'};return _0x2b194b;}})});}_0x20f932=_[_0x73cb('0x47')]({},_0x20f932,_0x1dcf11[_0x73cb('0x4d')]);var _0x27f10d={'where':_0x20f932[_0x73cb('0x45')]};return db[_0x73cb('0x4e')][_0x73cb('0x2c')](_0x27f10d)['then'](function(_0x19aec4){_0xf2f41[_0x73cb('0x2c')]=_0x19aec4;if(_0x1dcf11[_0x73cb('0x39')]['includeAll']){_0x20f932[_0x73cb('0x4f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x73cb('0x50')](_0x20f932);})[_0x73cb('0x1e')](function(_0x384c2e){_0xf2f41[_0x73cb('0x51')]=_0x384c2e;return _0xf2f41;})['then'](respondWithFilteredResult(_0x3ed107,_0x20f932))[_0x73cb('0x52')](handleError(_0x3ed107,null));};exports[_0x73cb('0x53')]=function(_0x352424,_0x2f50a1){var _0x22fec6={'raw':![],'where':{'id':_0x352424['params']['id']}},_0x534975={};_0x534975[_0x73cb('0x38')]=_[_0x73cb('0x3a')](db[_0x73cb('0x4e')][_0x73cb('0x54')]);_0x534975[_0x73cb('0x39')]=_['keys'](_0x352424[_0x73cb('0x39')]);_0x534975[_0x73cb('0x3b')]=_[_0x73cb('0x3c')](_0x534975[_0x73cb('0x38')],_0x534975[_0x73cb('0x39')]);_0x22fec6['attributes']=_[_0x73cb('0x3c')](_0x534975[_0x73cb('0x38')],qs[_0x73cb('0x3e')](_0x352424[_0x73cb('0x39')][_0x73cb('0x3e')]));_0x22fec6[_0x73cb('0x3d')]=_0x22fec6['attributes']['length']?_0x22fec6[_0x73cb('0x3d')]:_0x534975[_0x73cb('0x38')];if(_0x352424['query'][_0x73cb('0x55')]){_0x22fec6['include']=[{'all':!![]}];}_0x22fec6=_['merge']({},_0x22fec6,_0x352424[_0x73cb('0x4d')]);return db['FreshdeskConfiguration'][_0x73cb('0x56')](_0x22fec6)[_0x73cb('0x1e')](handleEntityNotFound(_0x2f50a1,null))[_0x73cb('0x1e')](respondWithResult(_0x2f50a1,null))['catch'](handleError(_0x2f50a1,null));};exports['create']=function(_0x3a6ed2,_0x1bac7e){return db[_0x73cb('0x4e')]['create'](_0x3a6ed2[_0x73cb('0x57')],{})[_0x73cb('0x1e')](respondWithResult(_0x1bac7e,0xc9))[_0x73cb('0x52')](handleError(_0x1bac7e,null));};exports['update']=function(_0x389136,_0x2483e6){if(_0x389136['body']['id']){delete _0x389136[_0x73cb('0x57')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x389136['params']['id']}})[_0x73cb('0x1e')](handleEntityNotFound(_0x2483e6,null))[_0x73cb('0x1e')](saveUpdates(_0x389136[_0x73cb('0x57')],null))['then'](respondWithResult(_0x2483e6,null))['catch'](handleError(_0x2483e6,null));};exports[_0x73cb('0x33')]=function(_0x10fb8f,_0x4a683d){return db['FreshdeskConfiguration'][_0x73cb('0x56')]({'where':{'id':_0x10fb8f[_0x73cb('0x58')]['id']}})[_0x73cb('0x1e')](handleEntityNotFound(_0x4a683d,null))[_0x73cb('0x1e')](removeEntity(_0x4a683d,null))[_0x73cb('0x52')](handleError(_0x4a683d,null));};exports['getFields']=function(_0x4e62cb,_0x440be8,_0x43750a){var _0x6e52bb={};var _0xbc8a86={};var _0x17f4a2;var _0x3389de;return db['FreshdeskConfiguration'][_0x73cb('0x59')]({'where':{'id':_0x4e62cb[_0x73cb('0x58')]['id']}})[_0x73cb('0x1e')](handleEntityNotFound(_0x440be8,null))[_0x73cb('0x1e')](function(_0xd7bc5f){if(_0xd7bc5f){_0x17f4a2=_0xd7bc5f;_0xbc8a86['model']=_[_0x73cb('0x3a')](db['FreshdeskField'][_0x73cb('0x54')]);_0xbc8a86[_0x73cb('0x39')]=_[_0x73cb('0x3a')](_0x4e62cb[_0x73cb('0x39')]);_0xbc8a86[_0x73cb('0x3b')]=_[_0x73cb('0x3c')](_0xbc8a86[_0x73cb('0x38')],_0xbc8a86[_0x73cb('0x39')]);_0x6e52bb['attributes']=_[_0x73cb('0x3c')](_0xbc8a86[_0x73cb('0x38')],qs[_0x73cb('0x3e')](_0x4e62cb['query'][_0x73cb('0x3e')]));_0x6e52bb['attributes']=_0x6e52bb[_0x73cb('0x3d')][_0x73cb('0x3f')]?_0x6e52bb[_0x73cb('0x3d')]:_0xbc8a86['model'];_0x6e52bb[_0x73cb('0x43')]=qs[_0x73cb('0x44')](_0x4e62cb['query'][_0x73cb('0x44')]);_0x6e52bb[_0x73cb('0x45')]=qs['filters'](_['pick'](_0x4e62cb[_0x73cb('0x39')],_0xbc8a86[_0x73cb('0x3b')]));if(_0x4e62cb[_0x73cb('0x39')][_0x73cb('0x4c')]){_0x6e52bb[_0x73cb('0x45')]=_[_0x73cb('0x47')](_0x6e52bb[_0x73cb('0x45')],{'$or':_[_0x73cb('0x48')](_0x6e52bb['attributes'],function(_0x335099){var _0x5cf2a2={};_0x5cf2a2[_0x335099]={'$like':'%'+_0x4e62cb[_0x73cb('0x39')][_0x73cb('0x4c')]+'%'};return _0x5cf2a2;})});}_0x6e52bb=_[_0x73cb('0x47')]({},_0x6e52bb,_0x4e62cb[_0x73cb('0x4d')]);return _0x17f4a2[_0x73cb('0x5a')](_0x6e52bb);}})['then'](function(_0x4386c3){if(_0x4386c3){_0x3389de=_0x4386c3['length'];if(!_0x4e62cb[_0x73cb('0x39')][_0x73cb('0x40')](_0x73cb('0x41'))){_0x6e52bb[_0x73cb('0x42')]=qs[_0x73cb('0x42')](_0x4e62cb[_0x73cb('0x39')][_0x73cb('0x42')]);_0x6e52bb[_0x73cb('0x2d')]=qs[_0x73cb('0x2d')](_0x4e62cb[_0x73cb('0x39')][_0x73cb('0x2d')]);}return _0x17f4a2[_0x73cb('0x5a')](_0x6e52bb);}})['then'](function(_0x51b7d0){if(_0x51b7d0){return _0x51b7d0?{'count':_0x3389de,'rows':_0x51b7d0}:null;}})[_0x73cb('0x1e')](respondWithResult(_0x440be8,null))[_0x73cb('0x52')](handleError(_0x440be8,null));};exports[_0x73cb('0x5b')]=function(_0x12854b,_0xb3c66,_0x31f09b){var _0x145fc7={};var _0x1c3b98={};var _0x2ae060;var _0x41771b;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x12854b[_0x73cb('0x58')]['id']}})[_0x73cb('0x1e')](handleEntityNotFound(_0xb3c66,null))[_0x73cb('0x1e')](function(_0x1af797){if(_0x1af797){_0x2ae060=_0x1af797;_0x1c3b98['model']=_['keys'](db[_0x73cb('0x5c')]['rawAttributes']);_0x1c3b98[_0x73cb('0x39')]=_[_0x73cb('0x3a')](_0x12854b[_0x73cb('0x39')]);_0x1c3b98[_0x73cb('0x3b')]=_[_0x73cb('0x3c')](_0x1c3b98[_0x73cb('0x38')],_0x1c3b98[_0x73cb('0x39')]);_0x145fc7[_0x73cb('0x3d')]=_['intersection'](_0x1c3b98[_0x73cb('0x38')],qs['fields'](_0x12854b[_0x73cb('0x39')]['fields']));_0x145fc7[_0x73cb('0x3d')]=_0x145fc7[_0x73cb('0x3d')][_0x73cb('0x3f')]?_0x145fc7[_0x73cb('0x3d')]:_0x1c3b98[_0x73cb('0x38')];_0x145fc7[_0x73cb('0x43')]=qs[_0x73cb('0x44')](_0x12854b[_0x73cb('0x39')][_0x73cb('0x44')]);_0x145fc7[_0x73cb('0x45')]=qs['filters'](_[_0x73cb('0x46')](_0x12854b[_0x73cb('0x39')],_0x1c3b98['filters']));if(_0x12854b[_0x73cb('0x39')][_0x73cb('0x4c')]){_0x145fc7[_0x73cb('0x45')]=_[_0x73cb('0x47')](_0x145fc7[_0x73cb('0x45')],{'$or':_[_0x73cb('0x48')](_0x145fc7[_0x73cb('0x3d')],function(_0x7e0495){var _0x3f8bdf={};_0x3f8bdf[_0x7e0495]={'$like':'%'+_0x12854b[_0x73cb('0x39')][_0x73cb('0x4c')]+'%'};return _0x3f8bdf;})});}_0x145fc7=_[_0x73cb('0x47')]({},_0x145fc7,_0x12854b['options']);return _0x2ae060[_0x73cb('0x5b')](_0x145fc7);}})[_0x73cb('0x1e')](function(_0x1c69a6){if(_0x1c69a6){_0x41771b=_0x1c69a6[_0x73cb('0x3f')];if(!_0x12854b[_0x73cb('0x39')][_0x73cb('0x40')](_0x73cb('0x41'))){_0x145fc7[_0x73cb('0x42')]=qs[_0x73cb('0x42')](_0x12854b[_0x73cb('0x39')][_0x73cb('0x42')]);_0x145fc7['offset']=qs[_0x73cb('0x2d')](_0x12854b[_0x73cb('0x39')][_0x73cb('0x2d')]);}return _0x2ae060[_0x73cb('0x5b')](_0x145fc7);}})['then'](function(_0x1a4a71){if(_0x1a4a71){return _0x1a4a71?{'count':_0x41771b,'rows':_0x1a4a71}:null;}})[_0x73cb('0x1e')](respondWithResult(_0xb3c66,null))[_0x73cb('0x52')](handleError(_0xb3c66,null));};exports['getDescriptions']=function(_0x4f04ec,_0x52e45c,_0x72ca42){var _0x17bd44={};var _0x5ed459={};var _0x2e46d7;var _0x4c04bf;return db[_0x73cb('0x4e')][_0x73cb('0x59')]({'where':{'id':_0x4f04ec[_0x73cb('0x58')]['id']}})[_0x73cb('0x1e')](handleEntityNotFound(_0x52e45c,null))[_0x73cb('0x1e')](function(_0x44a63d){if(_0x44a63d){_0x2e46d7=_0x44a63d;_0x5ed459['model']=_[_0x73cb('0x3a')](db['FreshdeskField'][_0x73cb('0x54')]);_0x5ed459['query']=_['keys'](_0x4f04ec[_0x73cb('0x39')]);_0x5ed459[_0x73cb('0x3b')]=_[_0x73cb('0x3c')](_0x5ed459[_0x73cb('0x38')],_0x5ed459[_0x73cb('0x39')]);_0x17bd44['attributes']=_[_0x73cb('0x3c')](_0x5ed459['model'],qs['fields'](_0x4f04ec['query']['fields']));_0x17bd44['attributes']=_0x17bd44['attributes'][_0x73cb('0x3f')]?_0x17bd44['attributes']:_0x5ed459[_0x73cb('0x38')];_0x17bd44[_0x73cb('0x43')]=qs[_0x73cb('0x44')](_0x4f04ec[_0x73cb('0x39')]['sort']);_0x17bd44[_0x73cb('0x45')]=qs[_0x73cb('0x3b')](_[_0x73cb('0x46')](_0x4f04ec[_0x73cb('0x39')],_0x5ed459[_0x73cb('0x3b')]));if(_0x4f04ec[_0x73cb('0x39')][_0x73cb('0x4c')]){_0x17bd44['where']=_[_0x73cb('0x47')](_0x17bd44['where'],{'$or':_[_0x73cb('0x48')](_0x17bd44[_0x73cb('0x3d')],function(_0x48a105){var _0x193b40={};_0x193b40[_0x48a105]={'$like':'%'+_0x4f04ec[_0x73cb('0x39')][_0x73cb('0x4c')]+'%'};return _0x193b40;})});}_0x17bd44=_['merge']({},_0x17bd44,_0x4f04ec[_0x73cb('0x4d')]);return _0x2e46d7['getDescriptions'](_0x17bd44);}})[_0x73cb('0x1e')](function(_0x3a1ec1){if(_0x3a1ec1){_0x4c04bf=_0x3a1ec1['length'];if(!_0x4f04ec[_0x73cb('0x39')][_0x73cb('0x40')]('nolimit')){_0x17bd44['limit']=qs[_0x73cb('0x42')](_0x4f04ec[_0x73cb('0x39')][_0x73cb('0x42')]);_0x17bd44[_0x73cb('0x2d')]=qs[_0x73cb('0x2d')](_0x4f04ec[_0x73cb('0x39')][_0x73cb('0x2d')]);}return _0x2e46d7[_0x73cb('0x5d')](_0x17bd44);}})[_0x73cb('0x1e')](function(_0x454c5a){if(_0x454c5a){return _0x454c5a?{'count':_0x4c04bf,'rows':_0x454c5a}:null;}})[_0x73cb('0x1e')](respondWithResult(_0x52e45c,null))[_0x73cb('0x52')](handleError(_0x52e45c,null));};exports[_0x73cb('0x5e')]=function(_0xa24bed,_0x185413,_0x1df209){var _0x160c7d={};var _0x15412c={};var _0x2d2e3d;var _0x499d1a;return db[_0x73cb('0x4e')]['findOne']({'where':{'id':_0xa24bed[_0x73cb('0x58')]['id']}})[_0x73cb('0x1e')](handleEntityNotFound(_0x185413,null))['then'](function(_0x31f470){if(_0x31f470){_0x2d2e3d=_0x31f470;_0x15412c['model']=_['keys'](db[_0x73cb('0x5f')][_0x73cb('0x54')]);_0x15412c[_0x73cb('0x39')]=_[_0x73cb('0x3a')](_0xa24bed[_0x73cb('0x39')]);_0x15412c[_0x73cb('0x3b')]=_[_0x73cb('0x3c')](_0x15412c['model'],_0x15412c['query']);_0x160c7d[_0x73cb('0x3d')]=_['intersection'](_0x15412c[_0x73cb('0x38')],qs[_0x73cb('0x3e')](_0xa24bed[_0x73cb('0x39')][_0x73cb('0x3e')]));_0x160c7d[_0x73cb('0x3d')]=_0x160c7d[_0x73cb('0x3d')][_0x73cb('0x3f')]?_0x160c7d[_0x73cb('0x3d')]:_0x15412c[_0x73cb('0x38')];_0x160c7d['order']=qs[_0x73cb('0x44')](_0xa24bed['query'][_0x73cb('0x44')]);_0x160c7d[_0x73cb('0x45')]=qs[_0x73cb('0x3b')](_['pick'](_0xa24bed[_0x73cb('0x39')],_0x15412c[_0x73cb('0x3b')]));if(_0xa24bed[_0x73cb('0x39')]['filter']){_0x160c7d['where']=_['merge'](_0x160c7d['where'],{'$or':_[_0x73cb('0x48')](_0x160c7d[_0x73cb('0x3d')],function(_0x3de275){var _0x353788={};_0x353788[_0x3de275]={'$like':'%'+_0xa24bed[_0x73cb('0x39')][_0x73cb('0x4c')]+'%'};return _0x353788;})});}_0x160c7d=_['merge']({},_0x160c7d,_0xa24bed['options']);return _0x2d2e3d['getTags'](_0x160c7d);}})['then'](function(_0x3c0cb7){if(_0x3c0cb7){_0x499d1a=_0x3c0cb7[_0x73cb('0x3f')];if(!_0xa24bed[_0x73cb('0x39')][_0x73cb('0x40')]('nolimit')){_0x160c7d[_0x73cb('0x42')]=qs['limit'](_0xa24bed[_0x73cb('0x39')][_0x73cb('0x42')]);_0x160c7d[_0x73cb('0x2d')]=qs[_0x73cb('0x2d')](_0xa24bed['query'][_0x73cb('0x2d')]);}return _0x2d2e3d[_0x73cb('0x5e')](_0x160c7d);}})[_0x73cb('0x1e')](function(_0x57f418){if(_0x57f418){return _0x57f418?{'count':_0x499d1a,'rows':_0x57f418}:null;}})[_0x73cb('0x1e')](respondWithResult(_0x185413,null))['catch'](handleError(_0x185413,null));};exports[_0x73cb('0x60')]=function(_0x2d8864,_0x4c97ca,_0x34439d){if(_0x2d8864[_0x73cb('0x57')]['id']){delete _0x2d8864[_0x73cb('0x57')]['id'];}return db[_0x73cb('0x4e')]['findOne']({'where':{'id':_0x2d8864[_0x73cb('0x58')]['id']}})['then'](handleEntityNotFound(_0x4c97ca,null))[_0x73cb('0x1e')](function(_0x3cc456){if(_0x3cc456){return _0x3cc456[_0x73cb('0x60')](_0x2d8864['body'][_0x73cb('0x61')]||[]);}return null;})['then'](respondWithResult(_0x4c97ca,null))['catch'](handleError(_0x4c97ca,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 7e2f2e8..674ffb8 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 _0xb9e5=['FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x71cca0,_0xf8b58a){var _0x362d96=function(_0x483412){while(--_0x483412){_0x71cca0['push'](_0x71cca0['shift']());}};_0x362d96(++_0xf8b58a);}(_0xb9e5,0xa7));var _0x5b9e=function(_0xd3b0ac,_0x2f5065){_0xd3b0ac=_0xd3b0ac-0x0;var _0x3d773e=_0xb9e5[_0xd3b0ac];return _0x3d773e;};'use strict';var _=require('lodash');var util=require(_0x5b9e('0x0'));var logger=require(_0x5b9e('0x1'))('api');var moment=require(_0x5b9e('0x2'));var BPromise=require(_0x5b9e('0x3'));var rp=require(_0x5b9e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b9e('0x5'));var attributes=require(_0x5b9e('0x6'));module[_0x5b9e('0x7')]=function(_0x3945c9,_0x30f2a2){return _0x3945c9[_0x5b9e('0x8')](_0x5b9e('0x9'),attributes,{'tableName':_0x5b9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fbb=['path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','api','moment','request-promise'];(function(_0x37c17e,_0x453b67){var _0x469dcd=function(_0xffe58f){while(--_0xffe58f){_0x37c17e['push'](_0x37c17e['shift']());}};_0x469dcd(++_0x453b67);}(_0x0fbb,0x80));var _0xb0fb=function(_0x36e45b,_0x1f8457){_0x36e45b=_0x36e45b-0x0;var _0x49bf49=_0x0fbb[_0x36e45b];return _0x49bf49;};'use strict';var _=require('lodash');var util=require(_0xb0fb('0x0'));var logger=require('../../config/logger')(_0xb0fb('0x1'));var moment=require(_0xb0fb('0x2'));var BPromise=require('bluebird');var rp=require(_0xb0fb('0x3'));var fs=require('fs');var path=require(_0xb0fb('0x4'));var rimraf=require(_0xb0fb('0x5'));var config=require(_0xb0fb('0x6'));var attributes=require(_0xb0fb('0x7'));module[_0xb0fb('0x8')]=function(_0x21bae7,_0x37f4c6){return _0x21bae7[_0xb0fb('0x9')](_0xb0fb('0xa'),attributes,{'tableName':_0xb0fb('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 eda7e6a..3a49ff5 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 _0xdfb9=['http','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x4e4f06,_0x18ce90){var _0x9984cd=function(_0x54f9cc){while(--_0x54f9cc){_0x4e4f06['push'](_0x4e4f06['shift']());}};_0x9984cd(++_0x18ce90);}(_0xdfb9,0x171));var _0x9dfb=function(_0x597630,_0x42e127){_0x597630=_0x597630-0x0;var _0x3773f6=_0xdfb9[_0x597630];return _0x3773f6;};'use strict';var _=require(_0x9dfb('0x0'));var util=require('util');var moment=require(_0x9dfb('0x1'));var BPromise=require(_0x9dfb('0x2'));var rs=require(_0x9dfb('0x3'));var fs=require('fs');var Redis=require(_0x9dfb('0x4'));var db=require(_0x9dfb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9dfb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9dfb('0x7'));var client=jayson[_0x9dfb('0x8')][_0x9dfb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f26d1,_0x16e1a0,_0x10d876){return new BPromise(function(_0x14e786,_0x269074){return client[_0x9dfb('0xa')](_0x3f26d1,_0x10d876)['then'](function(_0x161aab){logger[_0x9dfb('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x16e1a0,_0x9dfb('0xc'));logger[_0x9dfb('0xd')](_0x9dfb('0xe'),_0x16e1a0,_0x9dfb('0xc'),JSON[_0x9dfb('0xf')](_0x161aab));if(_0x161aab[_0x9dfb('0x10')]){if(_0x161aab[_0x9dfb('0x10')][_0x9dfb('0x11')]===0x1f4){logger[_0x9dfb('0x10')](_0x9dfb('0x12'),_0x16e1a0,_0x161aab[_0x9dfb('0x10')]['message']);return _0x269074(_0x161aab['error'][_0x9dfb('0x13')]);}logger['error'](_0x9dfb('0x12'),_0x16e1a0,_0x161aab['error'][_0x9dfb('0x13')]);return _0x14e786(_0x161aab[_0x9dfb('0x10')][_0x9dfb('0x13')]);}else{logger[_0x9dfb('0xb')](_0x9dfb('0x12'),_0x16e1a0,'request\x20sent');_0x14e786(_0x161aab['result']['message']);}})[_0x9dfb('0x14')](function(_0x4e636f){logger[_0x9dfb('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x16e1a0,_0x4e636f);_0x269074(_0x4e636f);});});} \ No newline at end of file +var _0xeb5c=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3e9edb,_0x464c8f){var _0x2a1e74=function(_0x104505){while(--_0x104505){_0x3e9edb['push'](_0x3e9edb['shift']());}};_0x2a1e74(++_0x464c8f);}(_0xeb5c,0x120));var _0xceb5=function(_0x1d6c99,_0x2764de){_0x1d6c99=_0x1d6c99-0x0;var _0x188ac8=_0xeb5c[_0x1d6c99];return _0x188ac8;};'use strict';var _=require(_0xceb5('0x0'));var util=require('util');var moment=require(_0xceb5('0x1'));var BPromise=require(_0xceb5('0x2'));var rs=require(_0xceb5('0x3'));var fs=require('fs');var Redis=require(_0xceb5('0x4'));var db=require(_0xceb5('0x5'))['db'];var utils=require(_0xceb5('0x6'));var logger=require(_0xceb5('0x7'))(_0xceb5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xceb5('0x9')][_0xceb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x441309,_0x53f59b,_0x144fed){return new BPromise(function(_0x58da4e,_0xb9cc6){return client[_0xceb5('0xb')](_0x441309,_0x144fed)[_0xceb5('0xc')](function(_0xa4cffc){logger[_0xceb5('0xd')](_0xceb5('0xe'),_0x53f59b,_0xceb5('0xf'));logger['debug'](_0xceb5('0x10'),_0x53f59b,_0xceb5('0xf'),JSON['stringify'](_0xa4cffc));if(_0xa4cffc[_0xceb5('0x11')]){if(_0xa4cffc[_0xceb5('0x11')][_0xceb5('0x12')]===0x1f4){logger['error'](_0xceb5('0xe'),_0x53f59b,_0xa4cffc['error'][_0xceb5('0x13')]);return _0xb9cc6(_0xa4cffc[_0xceb5('0x11')][_0xceb5('0x13')]);}logger[_0xceb5('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x53f59b,_0xa4cffc[_0xceb5('0x11')][_0xceb5('0x13')]);return _0x58da4e(_0xa4cffc[_0xceb5('0x11')][_0xceb5('0x13')]);}else{logger[_0xceb5('0xd')](_0xceb5('0xe'),_0x53f59b,_0xceb5('0xf'));_0x58da4e(_0xa4cffc['result'][_0xceb5('0x13')]);}})[_0xceb5('0x14')](function(_0xfaf5ab){logger['error'](_0xceb5('0xe'),_0x53f59b,_0xfaf5ab);_0xb9cc6(_0xfaf5ab);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5f49719..85a6030 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 _0xa2a1=['isAuthenticated','index','/:id','show','post','create','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa2a1,0xf6));var _0x1a2a=function(_0x387b1d,_0x1ee830){_0x387b1d=_0x387b1d-0x0;var _0x4c91e4=_0xa2a1[_0x387b1d];return _0x4c91e4;};'use strict';var multer=require(_0x1a2a('0x0'));var util=require('util');var path=require(_0x1a2a('0x1'));var timeout=require(_0x1a2a('0x2'));var express=require('express');var router=express[_0x1a2a('0x3')]();var auth=require(_0x1a2a('0x4'));var interaction=require(_0x1a2a('0x5'));var config=require(_0x1a2a('0x6'));var controller=require(_0x1a2a('0x7'));router[_0x1a2a('0x8')]('/',auth[_0x1a2a('0x9')](),controller[_0x1a2a('0xa')]);router[_0x1a2a('0x8')](_0x1a2a('0xb'),auth[_0x1a2a('0x9')](),controller[_0x1a2a('0xc')]);router[_0x1a2a('0xd')]('/',auth[_0x1a2a('0x9')](),controller[_0x1a2a('0xe')]);router['put'](_0x1a2a('0xb'),auth[_0x1a2a('0x9')](),controller['update']);router[_0x1a2a('0xf')](_0x1a2a('0xb'),auth[_0x1a2a('0x9')](),controller[_0x1a2a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9a55=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3287c1,_0x1cf376){var _0x2bd924=function(_0x3a2f5c){while(--_0x3a2f5c){_0x3287c1['push'](_0x3287c1['shift']());}};_0x2bd924(++_0x1cf376);}(_0x9a55,0x80));var _0x59a5=function(_0x127593,_0x1f45f4){_0x127593=_0x127593-0x0;var _0x4cdd69=_0x9a55[_0x127593];return _0x4cdd69;};'use strict';var multer=require(_0x59a5('0x0'));var util=require(_0x59a5('0x1'));var path=require(_0x59a5('0x2'));var timeout=require(_0x59a5('0x3'));var express=require(_0x59a5('0x4'));var router=express[_0x59a5('0x5')]();var auth=require(_0x59a5('0x6'));var interaction=require(_0x59a5('0x7'));var config=require(_0x59a5('0x8'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0x59a5('0x9')](),controller['index']);router['get'](_0x59a5('0xa'),auth[_0x59a5('0x9')](),controller[_0x59a5('0xb')]);router[_0x59a5('0xc')]('/',auth[_0x59a5('0x9')](),controller[_0x59a5('0xd')]);router[_0x59a5('0xe')](_0x59a5('0xa'),auth[_0x59a5('0x9')](),controller[_0x59a5('0xf')]);router[_0x59a5('0x10')](_0x59a5('0xa'),auth[_0x59a5('0x9')](),controller[_0x59a5('0x11')]);module[_0x59a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 2e7b009..e3b9895 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 _0x9c00=['sequelize','exports','variable','customVariable','string','STRING','ENUM','BOOLEAN'];(function(_0x2bb682,_0x5537e8){var _0x283800=function(_0x4ad0ca){while(--_0x4ad0ca){_0x2bb682['push'](_0x2bb682['shift']());}};_0x283800(++_0x5537e8);}(_0x9c00,0x1a0));var _0x09c0=function(_0x32062c,_0x43ee1f){_0x32062c=_0x32062c-0x0;var _0xa8ccf1=_0x9c00[_0x32062c];return _0xa8ccf1;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x09c0('0x2'),_0x09c0('0x3'),'keyValue'),'defaultValue':_0x09c0('0x4')},'content':{'type':Sequelize[_0x09c0('0x5')]},'key':{'type':Sequelize[_0x09c0('0x5')]},'keyType':{'type':Sequelize[_0x09c0('0x6')](_0x09c0('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x09c0('0x5')]},'idField':{'type':Sequelize[_0x09c0('0x5')]},'nameField':{'type':Sequelize[_0x09c0('0x5')]},'customField':{'type':Sequelize[_0x09c0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x09c0('0x5')]}}; \ No newline at end of file +var _0xa9e0=['customVariable','string','STRING','sequelize','exports','ENUM'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('string','variable',_0x0a9e('0x3'),'keyValue'),'defaultValue':_0x0a9e('0x4')},'content':{'type':Sequelize[_0x0a9e('0x5')]},'key':{'type':Sequelize[_0x0a9e('0x5')]},'keyType':{'type':Sequelize[_0x0a9e('0x2')](_0x0a9e('0x4'),'variable',_0x0a9e('0x3'))},'keyContent':{'type':Sequelize[_0x0a9e('0x5')]},'idField':{'type':Sequelize[_0x0a9e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a9e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index d17c1d4..795ac5d 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 _0xf1a3=['error','stack','name','send','index','FreshdeskField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','end'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xf1a3,0xff));var _0x3f1a=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xf1a3[_0x243b59];return _0x3e1676;};'use strict';var pdf=require(_0x3f1a('0x0'));var emlformat=require(_0x3f1a('0x1'));var rimraf=require(_0x3f1a('0x2'));var zipdir=require(_0x3f1a('0x3'));var jsonpatch=require(_0x3f1a('0x4'));var rp=require(_0x3f1a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3f1a('0x6'));var util=require(_0x3f1a('0x7'));var path=require(_0x3f1a('0x8'));var sox=require(_0x3f1a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3f1a('0xa'));var crypto=require(_0x3f1a('0xb'));var jsforce=require(_0x3f1a('0xc'));var deskjs=require(_0x3f1a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f1a('0xe'));var Redis=require(_0x3f1a('0xf'));var authService=require(_0x3f1a('0x10'));var qs=require(_0x3f1a('0x11'));var hardwareService=require(_0x3f1a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3f1a('0x13'));var config=require('../../config/environment');var db=require(_0x3f1a('0x14'))['db'];function respondWithStatusCode(_0x4c558f,_0x553aa1){_0x553aa1=_0x553aa1||0xcc;return function(_0x1468bc){if(_0x1468bc){return _0x4c558f['sendStatus'](_0x553aa1);}return _0x4c558f[_0x3f1a('0x15')](_0x553aa1)['end']();};}function respondWithResult(_0x2c0405,_0x288b16){_0x288b16=_0x288b16||0xc8;return function(_0x36a114){if(_0x36a114){return _0x2c0405[_0x3f1a('0x15')](_0x288b16)['json'](_0x36a114);}};}function respondWithFilteredResult(_0x429573,_0x486fc7){return function(_0x581856){if(_0x581856){var _0x39f564=_0x581856[_0x3f1a('0x16')],_0x5c5ad1=_0x486fc7[_0x3f1a('0x17')],_0x19783e=_0x486fc7[_0x3f1a('0x17')]+_0x486fc7[_0x3f1a('0x18')],_0x2c4ac0;if(_0x19783e>=_0x39f564){_0x19783e=_0x39f564;_0x2c4ac0=0xc8;}else{_0x2c4ac0=0xce;}_0x429573['status'](_0x2c4ac0);return _0x429573[_0x3f1a('0x19')](_0x3f1a('0x1a'),_0x5c5ad1+'-'+_0x19783e+'/'+_0x39f564)[_0x3f1a('0x1b')](_0x581856);}return null;};}function patchUpdates(_0x448d13){return function(_0x15d097){try{jsonpatch['apply'](_0x15d097,_0x448d13,!![]);}catch(_0x4867f9){return BPromise[_0x3f1a('0x1c')](_0x4867f9);}return _0x15d097[_0x3f1a('0x1d')]();};}function saveUpdates(_0x11829c,_0x2ed05b){return function(_0x110bd2){if(_0x110bd2){return _0x110bd2[_0x3f1a('0x1e')](_0x11829c)[_0x3f1a('0x1f')](function(_0x4281a0){return _0x4281a0;});}return null;};}function removeEntity(_0x3f0edc,_0x4db040){return function(_0xfc4528){if(_0xfc4528){return _0xfc4528['destroy']()[_0x3f1a('0x1f')](function(){_0x3f0edc[_0x3f1a('0x15')](0xcc)[_0x3f1a('0x20')]();});}};}function handleEntityNotFound(_0x264f65,_0x3452bf){return function(_0x1311df){if(!_0x1311df){_0x264f65['sendStatus'](0x194);}return _0x1311df;};}function handleError(_0x193663,_0x1b8d7f){_0x1b8d7f=_0x1b8d7f||0x1f4;return function(_0x28c213){logger[_0x3f1a('0x21')](_0x28c213[_0x3f1a('0x22')]);if(_0x28c213[_0x3f1a('0x23')]){delete _0x28c213[_0x3f1a('0x23')];}_0x193663['status'](_0x1b8d7f)[_0x3f1a('0x24')](_0x28c213);};}exports[_0x3f1a('0x25')]=function(_0x40935f,_0x5967a0){var _0xe87340={},_0x3aa693={},_0x4db82a={'count':0x0,'rows':[]};var _0x4dff4f=db[_0x3f1a('0x26')][_0x3f1a('0x27')];_0x3aa693[_0x3f1a('0x28')]=_[_0x3f1a('0x29')](_0x4dff4f);_0x3aa693[_0x3f1a('0x2a')]=_[_0x3f1a('0x29')](_0x40935f['query']);_0x3aa693[_0x3f1a('0x2b')]=_['intersection'](_0x3aa693[_0x3f1a('0x28')],_0x3aa693[_0x3f1a('0x2a')]);_0xe87340[_0x3f1a('0x2c')]=_[_0x3f1a('0x2d')](_0x3aa693[_0x3f1a('0x28')],qs[_0x3f1a('0x2e')](_0x40935f[_0x3f1a('0x2a')][_0x3f1a('0x2e')]));_0xe87340['attributes']=_0xe87340['attributes'][_0x3f1a('0x2f')]?_0xe87340[_0x3f1a('0x2c')]:_0x3aa693[_0x3f1a('0x28')];if(!_0x40935f[_0x3f1a('0x2a')][_0x3f1a('0x30')](_0x3f1a('0x31'))){_0xe87340['limit']=qs['limit'](_0x40935f[_0x3f1a('0x2a')][_0x3f1a('0x18')]);_0xe87340[_0x3f1a('0x17')]=qs['offset'](_0x40935f[_0x3f1a('0x2a')][_0x3f1a('0x17')]);}_0xe87340[_0x3f1a('0x32')]=qs[_0x3f1a('0x33')](_0x40935f[_0x3f1a('0x2a')][_0x3f1a('0x33')]);_0xe87340[_0x3f1a('0x34')]=qs[_0x3f1a('0x2b')](_[_0x3f1a('0x35')](_0x40935f[_0x3f1a('0x2a')],_0x3aa693['filters']));if(_0x40935f[_0x3f1a('0x2a')]['filter']){_0xe87340[_0x3f1a('0x34')]=_[_0x3f1a('0x36')](_0xe87340[_0x3f1a('0x34')],{'$or':_[_0x3f1a('0x37')](_0x4dff4f,function(_0x52a284){if(_0x52a284[_0x3f1a('0x38')][_0x3f1a('0x39')]!==_0x3f1a('0x3a')){var _0x29b4a1={};_0x29b4a1[_0x52a284['field']]={'$like':'%'+_0x40935f[_0x3f1a('0x2a')][_0x3f1a('0x3b')]+'%'};return _0x29b4a1;}})});}_0xe87340=_['merge']({},_0xe87340,_0x40935f[_0x3f1a('0x3c')]);var _0x4990d7={'where':_0xe87340[_0x3f1a('0x34')]};return db[_0x3f1a('0x26')][_0x3f1a('0x16')](_0x4990d7)['then'](function(_0x23c9ed){_0x4db82a['count']=_0x23c9ed;if(_0x40935f[_0x3f1a('0x2a')][_0x3f1a('0x3d')]){_0xe87340['include']=[{'all':!![]}];}return db[_0x3f1a('0x26')][_0x3f1a('0x3e')](_0xe87340);})[_0x3f1a('0x1f')](function(_0xac3b7b){_0x4db82a[_0x3f1a('0x3f')]=_0xac3b7b;return _0x4db82a;})[_0x3f1a('0x1f')](respondWithFilteredResult(_0x5967a0,_0xe87340))[_0x3f1a('0x40')](handleError(_0x5967a0,null));};exports[_0x3f1a('0x41')]=function(_0x159c35,_0x40d9dc){var _0x4d6294={'raw':!![],'where':{'id':_0x159c35[_0x3f1a('0x42')]['id']}},_0x52f3cb={};_0x52f3cb[_0x3f1a('0x28')]=_[_0x3f1a('0x29')](db[_0x3f1a('0x26')]['rawAttributes']);_0x52f3cb[_0x3f1a('0x2a')]=_[_0x3f1a('0x29')](_0x159c35[_0x3f1a('0x2a')]);_0x52f3cb[_0x3f1a('0x2b')]=_[_0x3f1a('0x2d')](_0x52f3cb[_0x3f1a('0x28')],_0x52f3cb[_0x3f1a('0x2a')]);_0x4d6294['attributes']=_[_0x3f1a('0x2d')](_0x52f3cb[_0x3f1a('0x28')],qs[_0x3f1a('0x2e')](_0x159c35['query'][_0x3f1a('0x2e')]));_0x4d6294['attributes']=_0x4d6294[_0x3f1a('0x2c')]['length']?_0x4d6294[_0x3f1a('0x2c')]:_0x52f3cb[_0x3f1a('0x28')];if(_0x159c35['query'][_0x3f1a('0x3d')]){_0x4d6294[_0x3f1a('0x43')]=[{'all':!![]}];}_0x4d6294=_[_0x3f1a('0x36')]({},_0x4d6294,_0x159c35[_0x3f1a('0x3c')]);return db[_0x3f1a('0x26')][_0x3f1a('0x44')](_0x4d6294)[_0x3f1a('0x1f')](handleEntityNotFound(_0x40d9dc,null))[_0x3f1a('0x1f')](respondWithResult(_0x40d9dc,null))[_0x3f1a('0x40')](handleError(_0x40d9dc,null));};exports[_0x3f1a('0x45')]=function(_0x54a45e,_0x4cbd63){return db[_0x3f1a('0x26')][_0x3f1a('0x45')](_0x54a45e[_0x3f1a('0x46')],{})['then'](respondWithResult(_0x4cbd63,0xc9))[_0x3f1a('0x40')](handleError(_0x4cbd63,null));};exports[_0x3f1a('0x1e')]=function(_0x21a1ad,_0xdaf27e){if(_0x21a1ad[_0x3f1a('0x46')]['id']){delete _0x21a1ad[_0x3f1a('0x46')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x21a1ad['params']['id']}})[_0x3f1a('0x1f')](handleEntityNotFound(_0xdaf27e,null))['then'](saveUpdates(_0x21a1ad[_0x3f1a('0x46')],null))[_0x3f1a('0x1f')](respondWithResult(_0xdaf27e,null))[_0x3f1a('0x40')](handleError(_0xdaf27e,null));};exports[_0x3f1a('0x47')]=function(_0x2423a0,_0x5bd39d){return db[_0x3f1a('0x26')][_0x3f1a('0x44')]({'where':{'id':_0x2423a0['params']['id']}})['then'](handleEntityNotFound(_0x5bd39d,null))['then'](removeEntity(_0x5bd39d,null))[_0x3f1a('0x40')](handleError(_0x5bd39d,null));}; \ No newline at end of file +var _0xdd08=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','field','include','rows','show','options','find','create','body','catch','params','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x2cafbf,_0x1b31ed){var _0x4546cd=function(_0x5e9e0b){while(--_0x5e9e0b){_0x2cafbf['push'](_0x2cafbf['shift']());}};_0x4546cd(++_0x1b31ed);}(_0xdd08,0x10f));var _0x8dd0=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0xdd08[_0xb8cfbe];return _0x227d51;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8dd0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8dd0('0x1'));var rp=require('request-promise');var moment=require(_0x8dd0('0x2'));var BPromise=require(_0x8dd0('0x3'));var Mustache=require(_0x8dd0('0x4'));var util=require(_0x8dd0('0x5'));var path=require(_0x8dd0('0x6'));var sox=require('sox');var csv=require(_0x8dd0('0x7'));var ejs=require(_0x8dd0('0x8'));var fs=require('fs');var _=require(_0x8dd0('0x9'));var squel=require(_0x8dd0('0xa'));var crypto=require('crypto');var jsforce=require(_0x8dd0('0xb'));var deskjs=require(_0x8dd0('0xc'));var toCsv=require(_0x8dd0('0x7'));var querystring=require(_0x8dd0('0xd'));var Papa=require(_0x8dd0('0xe'));var Redis=require(_0x8dd0('0xf'));var authService=require(_0x8dd0('0x10'));var qs=require(_0x8dd0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8dd0('0x12'))('api');var utils=require(_0x8dd0('0x13'));var config=require(_0x8dd0('0x14'));var db=require(_0x8dd0('0x15'))['db'];function respondWithStatusCode(_0x27300c,_0x1cf22a){_0x1cf22a=_0x1cf22a||0xcc;return function(_0x2ab21c){if(_0x2ab21c){return _0x27300c[_0x8dd0('0x16')](_0x1cf22a);}return _0x27300c[_0x8dd0('0x17')](_0x1cf22a)[_0x8dd0('0x18')]();};}function respondWithResult(_0x25bcc1,_0x41cf91){_0x41cf91=_0x41cf91||0xc8;return function(_0xb21321){if(_0xb21321){return _0x25bcc1[_0x8dd0('0x17')](_0x41cf91)['json'](_0xb21321);}};}function respondWithFilteredResult(_0x3610cf,_0x3891c2){return function(_0x4f30cf){if(_0x4f30cf){var _0x4d46ef=_0x4f30cf[_0x8dd0('0x19')],_0x1acf0c=_0x3891c2['offset'],_0xddc056=_0x3891c2[_0x8dd0('0x1a')]+_0x3891c2[_0x8dd0('0x1b')],_0x51c1ba;if(_0xddc056>=_0x4d46ef){_0xddc056=_0x4d46ef;_0x51c1ba=0xc8;}else{_0x51c1ba=0xce;}_0x3610cf[_0x8dd0('0x17')](_0x51c1ba);return _0x3610cf[_0x8dd0('0x1c')](_0x8dd0('0x1d'),_0x1acf0c+'-'+_0xddc056+'/'+_0x4d46ef)[_0x8dd0('0x1e')](_0x4f30cf);}return null;};}function patchUpdates(_0x25b5ec){return function(_0x5619b3){try{jsonpatch[_0x8dd0('0x1f')](_0x5619b3,_0x25b5ec,!![]);}catch(_0x529e02){return BPromise[_0x8dd0('0x20')](_0x529e02);}return _0x5619b3[_0x8dd0('0x21')]();};}function saveUpdates(_0x5dcabe,_0x29f402){return function(_0x5034d1){if(_0x5034d1){return _0x5034d1[_0x8dd0('0x22')](_0x5dcabe)['then'](function(_0x1119a0){return _0x1119a0;});}return null;};}function removeEntity(_0x218a73,_0x4f0636){return function(_0x19edef){if(_0x19edef){return _0x19edef[_0x8dd0('0x23')]()[_0x8dd0('0x24')](function(){_0x218a73[_0x8dd0('0x17')](0xcc)[_0x8dd0('0x18')]();});}};}function handleEntityNotFound(_0x39d9a4,_0x441b98){return function(_0x397914){if(!_0x397914){_0x39d9a4['sendStatus'](0x194);}return _0x397914;};}function handleError(_0x33bb08,_0x43c4bb){_0x43c4bb=_0x43c4bb||0x1f4;return function(_0x6bb1b1){logger['error'](_0x6bb1b1[_0x8dd0('0x25')]);if(_0x6bb1b1['name']){delete _0x6bb1b1[_0x8dd0('0x26')];}_0x33bb08['status'](_0x43c4bb)[_0x8dd0('0x27')](_0x6bb1b1);};}exports[_0x8dd0('0x28')]=function(_0x4e9a16,_0x5474a4){var _0x5509ec={},_0x2b4ceb={},_0x2488d2={'count':0x0,'rows':[]};var _0x7af5f9=db[_0x8dd0('0x29')][_0x8dd0('0x2a')];_0x2b4ceb[_0x8dd0('0x2b')]=_[_0x8dd0('0x2c')](_0x7af5f9);_0x2b4ceb[_0x8dd0('0x2d')]=_['keys'](_0x4e9a16[_0x8dd0('0x2d')]);_0x2b4ceb[_0x8dd0('0x2e')]=_[_0x8dd0('0x2f')](_0x2b4ceb[_0x8dd0('0x2b')],_0x2b4ceb['query']);_0x5509ec[_0x8dd0('0x30')]=_[_0x8dd0('0x2f')](_0x2b4ceb[_0x8dd0('0x2b')],qs[_0x8dd0('0x31')](_0x4e9a16['query'][_0x8dd0('0x31')]));_0x5509ec['attributes']=_0x5509ec[_0x8dd0('0x30')][_0x8dd0('0x32')]?_0x5509ec[_0x8dd0('0x30')]:_0x2b4ceb[_0x8dd0('0x2b')];if(!_0x4e9a16[_0x8dd0('0x2d')][_0x8dd0('0x33')](_0x8dd0('0x34'))){_0x5509ec[_0x8dd0('0x1b')]=qs[_0x8dd0('0x1b')](_0x4e9a16[_0x8dd0('0x2d')][_0x8dd0('0x1b')]);_0x5509ec[_0x8dd0('0x1a')]=qs[_0x8dd0('0x1a')](_0x4e9a16[_0x8dd0('0x2d')][_0x8dd0('0x1a')]);}_0x5509ec[_0x8dd0('0x35')]=qs[_0x8dd0('0x36')](_0x4e9a16[_0x8dd0('0x2d')][_0x8dd0('0x36')]);_0x5509ec[_0x8dd0('0x37')]=qs[_0x8dd0('0x2e')](_[_0x8dd0('0x38')](_0x4e9a16['query'],_0x2b4ceb['filters']));if(_0x4e9a16[_0x8dd0('0x2d')][_0x8dd0('0x39')]){_0x5509ec[_0x8dd0('0x37')]=_[_0x8dd0('0x3a')](_0x5509ec[_0x8dd0('0x37')],{'$or':_[_0x8dd0('0x3b')](_0x7af5f9,function(_0x5f0222){if(_0x5f0222['type'][_0x8dd0('0x3c')]!=='VIRTUAL'){var _0x315f62={};_0x315f62[_0x5f0222[_0x8dd0('0x3d')]]={'$like':'%'+_0x4e9a16[_0x8dd0('0x2d')][_0x8dd0('0x39')]+'%'};return _0x315f62;}})});}_0x5509ec=_['merge']({},_0x5509ec,_0x4e9a16['options']);var _0x48e27e={'where':_0x5509ec[_0x8dd0('0x37')]};return db['FreshdeskField'][_0x8dd0('0x19')](_0x48e27e)[_0x8dd0('0x24')](function(_0x260cfd){_0x2488d2[_0x8dd0('0x19')]=_0x260cfd;if(_0x4e9a16[_0x8dd0('0x2d')]['includeAll']){_0x5509ec[_0x8dd0('0x3e')]=[{'all':!![]}];}return db[_0x8dd0('0x29')]['findAll'](_0x5509ec);})[_0x8dd0('0x24')](function(_0x2983f2){_0x2488d2[_0x8dd0('0x3f')]=_0x2983f2;return _0x2488d2;})[_0x8dd0('0x24')](respondWithFilteredResult(_0x5474a4,_0x5509ec))['catch'](handleError(_0x5474a4,null));};exports[_0x8dd0('0x40')]=function(_0xfd1050,_0x18b362){var _0x11ca5d={'raw':!![],'where':{'id':_0xfd1050['params']['id']}},_0x18c040={};_0x18c040[_0x8dd0('0x2b')]=_['keys'](db[_0x8dd0('0x29')][_0x8dd0('0x2a')]);_0x18c040[_0x8dd0('0x2d')]=_[_0x8dd0('0x2c')](_0xfd1050[_0x8dd0('0x2d')]);_0x18c040[_0x8dd0('0x2e')]=_[_0x8dd0('0x2f')](_0x18c040['model'],_0x18c040['query']);_0x11ca5d[_0x8dd0('0x30')]=_['intersection'](_0x18c040[_0x8dd0('0x2b')],qs[_0x8dd0('0x31')](_0xfd1050[_0x8dd0('0x2d')][_0x8dd0('0x31')]));_0x11ca5d[_0x8dd0('0x30')]=_0x11ca5d[_0x8dd0('0x30')][_0x8dd0('0x32')]?_0x11ca5d[_0x8dd0('0x30')]:_0x18c040[_0x8dd0('0x2b')];if(_0xfd1050[_0x8dd0('0x2d')]['includeAll']){_0x11ca5d[_0x8dd0('0x3e')]=[{'all':!![]}];}_0x11ca5d=_[_0x8dd0('0x3a')]({},_0x11ca5d,_0xfd1050[_0x8dd0('0x41')]);return db[_0x8dd0('0x29')][_0x8dd0('0x42')](_0x11ca5d)[_0x8dd0('0x24')](handleEntityNotFound(_0x18b362,null))[_0x8dd0('0x24')](respondWithResult(_0x18b362,null))['catch'](handleError(_0x18b362,null));};exports['create']=function(_0x599d4b,_0x5a25a3){return db['FreshdeskField'][_0x8dd0('0x43')](_0x599d4b[_0x8dd0('0x44')],{})[_0x8dd0('0x24')](respondWithResult(_0x5a25a3,0xc9))[_0x8dd0('0x45')](handleError(_0x5a25a3,null));};exports[_0x8dd0('0x22')]=function(_0x4fcdc6,_0x34a3c3){if(_0x4fcdc6['body']['id']){delete _0x4fcdc6[_0x8dd0('0x44')]['id'];}return db[_0x8dd0('0x29')][_0x8dd0('0x42')]({'where':{'id':_0x4fcdc6[_0x8dd0('0x46')]['id']}})[_0x8dd0('0x24')](handleEntityNotFound(_0x34a3c3,null))[_0x8dd0('0x24')](saveUpdates(_0x4fcdc6[_0x8dd0('0x44')],null))[_0x8dd0('0x24')](respondWithResult(_0x34a3c3,null))[_0x8dd0('0x45')](handleError(_0x34a3c3,null));};exports['destroy']=function(_0x27900b,_0x2b722f){return db['FreshdeskField']['find']({'where':{'id':_0x27900b['params']['id']}})[_0x8dd0('0x24')](handleEntityNotFound(_0x2b722f,null))[_0x8dd0('0x24')](removeEntity(_0x2b722f,null))[_0x8dd0('0x45')](handleError(_0x2b722f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index b21a776..89fc978 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 _0xab71=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x274254,_0x5c4155){var _0x4224e6=function(_0x4a3536){while(--_0x4a3536){_0x274254['push'](_0x274254['shift']());}};_0x4224e6(++_0x5c4155);}(_0xab71,0x17d));var _0x1ab7=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xab71[_0x16de68];return _0x1c277e;};'use strict';var _=require(_0x1ab7('0x0'));var util=require('util');var logger=require(_0x1ab7('0x1'))(_0x1ab7('0x2'));var moment=require(_0x1ab7('0x3'));var BPromise=require(_0x1ab7('0x4'));var rp=require(_0x1ab7('0x5'));var fs=require('fs');var path=require(_0x1ab7('0x6'));var rimraf=require(_0x1ab7('0x7'));var config=require(_0x1ab7('0x8'));var attributes=require(_0x1ab7('0x9'));module[_0x1ab7('0xa')]=function(_0x503194,_0x44e7b4){return _0x503194['define'](_0x1ab7('0xb'),attributes,{'tableName':_0x1ab7('0xc'),'paranoid':![],'indexes':[{'name':_0x1ab7('0xd'),'fields':[_0x1ab7('0xe'),_0x1ab7('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c32=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x25c63b,_0x21dab3){var _0x580650=function(_0x5a7d25){while(--_0x5a7d25){_0x25c63b['push'](_0x25c63b['shift']());}};_0x580650(++_0x21dab3);}(_0x7c32,0x145));var _0x27c3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7c32[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x27c3('0x0'));var util=require(_0x27c3('0x1'));var logger=require(_0x27c3('0x2'))(_0x27c3('0x3'));var moment=require(_0x27c3('0x4'));var BPromise=require(_0x27c3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27c3('0x6'));var rimraf=require(_0x27c3('0x7'));var config=require(_0x27c3('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x27c3('0x9')]=function(_0x2f949c,_0x1b2463){return _0x2f949c[_0x27c3('0xa')](_0x27c3('0xb'),attributes,{'tableName':_0x27c3('0xc'),'paranoid':![],'indexes':[{'name':_0x27c3('0xd'),'fields':[_0x27c3('0xe'),_0x27c3('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index b466f91..4bc8c9f 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1d5d7f,_0x5d197e){var _0x492b6d=function(_0x4e009f){while(--_0x4e009f){_0x1d5d7f['push'](_0x1d5d7f['shift']());}};_0x492b6d(++_0x5d197e);}(_0x34e8,0x12c));var _0x834e=function(_0x5efdb5,_0x4dce85){_0x5efdb5=_0x5efdb5-0x0;var _0x24aa51=_0x34e8[_0x5efdb5];return _0x24aa51;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xd6d6=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xcaa39d,_0x17283a){var _0x24f237=function(_0x31c4cd){while(--_0x31c4cd){_0xcaa39d['push'](_0xcaa39d['shift']());}};_0x24f237(++_0x17283a);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4b2de2,_0x39169a){_0x4b2de2=_0x4b2de2-0x0;var _0xb8bea7=_0xd6d6[_0x4b2de2];return _0xb8bea7;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b5f7e75..3208cf6 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 _0xc979=['../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0xc979,0x1af));var _0x9c97=function(_0x53b81e,_0xe51a6c){_0x53b81e=_0x53b81e-0x0;var _0x26b20b=_0xc979[_0x53b81e];return _0x26b20b;};'use strict';var multer=require('multer');var util=require(_0x9c97('0x0'));var path=require(_0x9c97('0x1'));var timeout=require(_0x9c97('0x2'));var express=require('express');var router=express[_0x9c97('0x3')]();var auth=require(_0x9c97('0x4'));var interaction=require(_0x9c97('0x5'));var config=require(_0x9c97('0x6'));var controller=require(_0x9c97('0x7'));router[_0x9c97('0x8')]('/',auth[_0x9c97('0x9')](),controller[_0x9c97('0xa')]);router[_0x9c97('0x8')](_0x9c97('0xb'),auth[_0x9c97('0x9')](),controller[_0x9c97('0xc')]);router[_0x9c97('0x8')](_0x9c97('0xd'),auth[_0x9c97('0x9')](),controller['getConfigurations']);router['get'](_0x9c97('0xe'),auth[_0x9c97('0x9')](),controller[_0x9c97('0xf')]);router[_0x9c97('0x10')]('/',auth['isAuthenticated'](),controller[_0x9c97('0x11')]);router[_0x9c97('0x10')](_0x9c97('0xd'),auth[_0x9c97('0x9')](),controller[_0x9c97('0x12')]);router[_0x9c97('0x13')](_0x9c97('0xb'),auth['isAuthenticated'](),controller[_0x9c97('0x14')]);router['delete'](_0x9c97('0xb'),auth['isAuthenticated'](),controller[_0x9c97('0x15')]);module[_0x9c97('0x16')]=router; \ No newline at end of file +var _0xcaff=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','exports'];(function(_0x6898b1,_0x3bb723){var _0x27702e=function(_0x3d052c){while(--_0x3d052c){_0x6898b1['push'](_0x6898b1['shift']());}};_0x27702e(++_0x3bb723);}(_0xcaff,0x73));var _0xfcaf=function(_0x56340f,_0x1077aa){_0x56340f=_0x56340f-0x0;var _0x3c0876=_0xcaff[_0x56340f];return _0x3c0876;};'use strict';var multer=require(_0xfcaf('0x0'));var util=require('util');var path=require(_0xfcaf('0x1'));var timeout=require(_0xfcaf('0x2'));var express=require(_0xfcaf('0x3'));var router=express[_0xfcaf('0x4')]();var auth=require(_0xfcaf('0x5'));var interaction=require(_0xfcaf('0x6'));var config=require('../../config/environment');var controller=require(_0xfcaf('0x7'));router[_0xfcaf('0x8')]('/',auth[_0xfcaf('0x9')](),controller[_0xfcaf('0xa')]);router[_0xfcaf('0x8')]('/:id',auth[_0xfcaf('0x9')](),controller[_0xfcaf('0xb')]);router[_0xfcaf('0x8')](_0xfcaf('0xc'),auth[_0xfcaf('0x9')](),controller['getConfigurations']);router[_0xfcaf('0x8')](_0xfcaf('0xd'),auth[_0xfcaf('0x9')](),controller[_0xfcaf('0xe')]);router[_0xfcaf('0xf')]('/',auth[_0xfcaf('0x9')](),controller[_0xfcaf('0x10')]);router['post'](_0xfcaf('0xc'),auth[_0xfcaf('0x9')](),controller[_0xfcaf('0x11')]);router[_0xfcaf('0x12')](_0xfcaf('0x13'),auth[_0xfcaf('0x9')](),controller[_0xfcaf('0x14')]);router[_0xfcaf('0x15')](_0xfcaf('0x13'),auth[_0xfcaf('0x9')](),controller['destroy']);module[_0xfcaf('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index a37b0a9..8816af5 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 _0x22aa=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x22aa,0xbe));var _0xa22a=function(_0x435d36,_0xba6a2){_0x435d36=_0x435d36-0x0;var _0x18253c=_0x22aa[_0x435d36];return _0x18253c;};'use strict';var Sequelize=require('sequelize');module[_0xa22a('0x0')]={'name':{'type':Sequelize[_0xa22a('0x1')]},'description':{'type':Sequelize[_0xa22a('0x1')]},'username':{'type':Sequelize[_0xa22a('0x1')],'unique':_0xa22a('0x2')},'remoteUri':{'type':Sequelize[_0xa22a('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa22a('0x1')]},'clientSecret':{'type':Sequelize[_0xa22a('0x1')]},'securityToken':{'type':Sequelize[_0xa22a('0x1')]},'serverUrl':{'type':Sequelize[_0xa22a('0x1')]},'type':{'type':Sequelize[_0xa22a('0x3')](_0xa22a('0x4'),_0xa22a('0x5')),'defaultValue':_0xa22a('0x4')}}; \ No newline at end of file +var _0x40b9=['ENUM','integrationTab','newTab','sequelize','STRING','username'];(function(_0x101b3c,_0x705c0b){var _0x27878d=function(_0x5d8233){while(--_0x5d8233){_0x101b3c['push'](_0x101b3c['shift']());}};_0x27878d(++_0x705c0b);}(_0x40b9,0xdb));var _0x940b=function(_0x23bac9,_0x30944a){_0x23bac9=_0x23bac9-0x0;var _0x2b4732=_0x40b9[_0x23bac9];return _0x2b4732;};'use strict';var Sequelize=require(_0x940b('0x0'));module['exports']={'name':{'type':Sequelize[_0x940b('0x1')]},'description':{'type':Sequelize[_0x940b('0x1')]},'username':{'type':Sequelize[_0x940b('0x1')],'unique':_0x940b('0x2')},'remoteUri':{'type':Sequelize[_0x940b('0x1')]},'password':{'type':Sequelize[_0x940b('0x1')]},'clientId':{'type':Sequelize[_0x940b('0x1')]},'clientSecret':{'type':Sequelize[_0x940b('0x1')]},'securityToken':{'type':Sequelize[_0x940b('0x1')]},'serverUrl':{'type':Sequelize[_0x940b('0x1')]},'type':{'type':Sequelize[_0x940b('0x3')](_0x940b('0x4'),_0x940b('0x5')),'defaultValue':_0x940b('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 97d4209..dae18db 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 _0xf097=['IsArchived','Priority','Status','Type','Case','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','includes','label','custom','picklistValues','boolean','True','true','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','name','send','index','SalesforceAccount','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','count','findAll','rows','catch','show','params','includeAll','include','options','create','body','find','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','lastIndexOf','Connection','clientSecret','login','concat','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallType'];(function(_0x49ac2e,_0x3d5c21){var _0x70c92e=function(_0x2b9cbe){while(--_0x2b9cbe){_0x49ac2e['push'](_0x49ac2e['shift']());}};_0x70c92e(++_0x3d5c21);}(_0xf097,0x1b2));var _0x7f09=function(_0x17dff0,_0x12f8c4){_0x17dff0=_0x17dff0-0x0;var _0x37c0dc=_0xf097[_0x17dff0];return _0x37c0dc;};'use strict';var pdf=require(_0x7f09('0x0'));var emlformat=require(_0x7f09('0x1'));var rimraf=require(_0x7f09('0x2'));var zipdir=require(_0x7f09('0x3'));var jsonpatch=require(_0x7f09('0x4'));var rp=require(_0x7f09('0x5'));var moment=require(_0x7f09('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7f09('0x7'));var sox=require(_0x7f09('0x8'));var csv=require(_0x7f09('0x9'));var ejs=require(_0x7f09('0xa'));var fs=require('fs');var _=require(_0x7f09('0xb'));var squel=require('squel');var crypto=require(_0x7f09('0xc'));var jsforce=require(_0x7f09('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7f09('0x9'));var querystring=require(_0x7f09('0xe'));var Papa=require(_0x7f09('0xf'));var Redis=require(_0x7f09('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7f09('0x11'));var hardwareService=require(_0x7f09('0x12'));var logger=require(_0x7f09('0x13'))(_0x7f09('0x14'));var utils=require(_0x7f09('0x15'));var config=require(_0x7f09('0x16'));var db=require(_0x7f09('0x17'))['db'];var integrations=require(_0x7f09('0x18'));var jayson=require(_0x7f09('0x19'));var client=jayson[_0x7f09('0x1a')][_0x7f09('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2fdb86,_0x365a58,_0x10d292){if(_0x10d292){var _0x44cd29=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44cd29['test'](_0x365a58)){return _0x2fdb86;}else{throw new Error(_0x7f09('0x1c'));}}else{return _0x2fdb86;}}function respondWithRpcPromise(_0x5b31c1,_0x16373a,_0x547ba4,_0x34cd5e){return new BPromise(function(_0x5cce0e,_0x3f4efd){var _0x7fbc44=_0x34cd5e||client;return _0x7fbc44[_0x7f09('0x1d')](_0x5b31c1,_0x547ba4)[_0x7f09('0x1e')](function(_0x5c72aa){logger[_0x7f09('0x1f')](_0x7f09('0x20'),_0x16373a,_0x7f09('0x21'));logger[_0x7f09('0x22')](_0x7f09('0x23'),_0x16373a,_0x7f09('0x21'),JSON[_0x7f09('0x24')](_0x5c72aa));if(_0x5c72aa[_0x7f09('0x25')]){if(_0x5c72aa[_0x7f09('0x25')][_0x7f09('0x26')]===0x1f4){logger[_0x7f09('0x25')](_0x7f09('0x20'),_0x16373a,_0x5c72aa[_0x7f09('0x25')]['message']);return _0x3f4efd(_0x5c72aa[_0x7f09('0x25')][_0x7f09('0x27')]);}logger[_0x7f09('0x25')](_0x7f09('0x20'),_0x16373a,_0x5c72aa[_0x7f09('0x25')]['message']);return _0x5cce0e(_0x5c72aa[_0x7f09('0x25')][_0x7f09('0x27')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x16373a,_0x7f09('0x21'));_0x5cce0e(_0x5c72aa[_0x7f09('0x28')][_0x7f09('0x27')]);}})['catch'](function(_0x5b9579){logger[_0x7f09('0x25')](_0x7f09('0x20'),_0x16373a,_0x5b9579);_0x3f4efd(_0x5b9579);});});}function respondWithStatusCode(_0xcf7927,_0x311186){_0x311186=_0x311186||0xcc;return function(_0x5981a9){if(_0x5981a9){return _0xcf7927[_0x7f09('0x29')](_0x311186);}return _0xcf7927[_0x7f09('0x2a')](_0x311186)[_0x7f09('0x2b')]();};}function respondWithResult(_0x4b5c40,_0x45098f){_0x45098f=_0x45098f||0xc8;return function(_0x57aa4f){if(_0x57aa4f){return _0x4b5c40[_0x7f09('0x2a')](_0x45098f)[_0x7f09('0x2c')](_0x57aa4f);}};}function respondWithFilteredResult(_0x154c8f,_0x5dc80f){return function(_0x15d9ad){if(_0x15d9ad){var _0x21d9ec=_0x15d9ad['count'],_0x4b19fd=_0x5dc80f[_0x7f09('0x2d')],_0x40fc67=_0x5dc80f['offset']+_0x5dc80f[_0x7f09('0x2e')],_0x36cbfc;if(_0x40fc67>=_0x21d9ec){_0x40fc67=_0x21d9ec;_0x36cbfc=0xc8;}else{_0x36cbfc=0xce;}_0x154c8f[_0x7f09('0x2a')](_0x36cbfc);return _0x154c8f['set'](_0x7f09('0x2f'),_0x4b19fd+'-'+_0x40fc67+'/'+_0x21d9ec)[_0x7f09('0x2c')](_0x15d9ad);}return null;};}function patchUpdates(_0x388f0f){return function(_0x2a3013){try{jsonpatch['apply'](_0x2a3013,_0x388f0f,!![]);}catch(_0x53aa86){return BPromise[_0x7f09('0x30')](_0x53aa86);}return _0x2a3013[_0x7f09('0x31')]();};}function saveUpdates(_0x4c2e32,_0x52fe7e){return function(_0x281691){if(_0x281691){return _0x281691[_0x7f09('0x32')](_0x4c2e32)['then'](function(_0x5c9d82){return _0x5c9d82;});}return null;};}function removeEntity(_0x3f8c45,_0x4ab4d1){return function(_0x3e4e65){if(_0x3e4e65){return _0x3e4e65['destroy']()['then'](function(){_0x3f8c45[_0x7f09('0x2a')](0xcc)[_0x7f09('0x2b')]();});}};}function handleEntityNotFound(_0x5a96a3,_0x3e873b){return function(_0xa3f002){if(!_0xa3f002){_0x5a96a3[_0x7f09('0x29')](0x194);}return _0xa3f002;};}function handleError(_0x2224be,_0x406c82){_0x406c82=_0x406c82||0x1f4;return function(_0x9399c6){logger[_0x7f09('0x25')](_0x9399c6['stack']);if(_0x9399c6[_0x7f09('0x33')]){delete _0x9399c6['name'];}_0x2224be['status'](_0x406c82)[_0x7f09('0x34')](_0x9399c6);};}exports[_0x7f09('0x35')]=function(_0x33982d,_0x443fb9){var _0x47eb65={},_0x2010c0={},_0x2b8c00={'count':0x0,'rows':[]};var _0x5deaa9=db[_0x7f09('0x36')][_0x7f09('0x37')];_0x2010c0[_0x7f09('0x38')]=_['keys'](_0x5deaa9);_0x2010c0[_0x7f09('0x39')]=_[_0x7f09('0x3a')](_0x33982d[_0x7f09('0x39')]);_0x2010c0[_0x7f09('0x3b')]=_[_0x7f09('0x3c')](_0x2010c0[_0x7f09('0x38')],_0x2010c0[_0x7f09('0x39')]);_0x47eb65['attributes']=_['intersection'](_0x2010c0[_0x7f09('0x38')],qs[_0x7f09('0x3d')](_0x33982d[_0x7f09('0x39')][_0x7f09('0x3d')]));_0x47eb65[_0x7f09('0x3e')]=_0x47eb65[_0x7f09('0x3e')][_0x7f09('0x3f')]?_0x47eb65['attributes']:_0x2010c0[_0x7f09('0x38')];if(!_0x33982d[_0x7f09('0x39')][_0x7f09('0x40')](_0x7f09('0x41'))){_0x47eb65[_0x7f09('0x2e')]=qs[_0x7f09('0x2e')](_0x33982d['query'][_0x7f09('0x2e')]);_0x47eb65[_0x7f09('0x2d')]=qs['offset'](_0x33982d[_0x7f09('0x39')]['offset']);}_0x47eb65[_0x7f09('0x42')]=qs[_0x7f09('0x43')](_0x33982d[_0x7f09('0x39')][_0x7f09('0x43')]);_0x47eb65[_0x7f09('0x44')]=qs['filters'](_[_0x7f09('0x45')](_0x33982d[_0x7f09('0x39')],_0x2010c0['filters']));if(_0x33982d[_0x7f09('0x39')]['filter']){_0x47eb65['where']=_[_0x7f09('0x46')](_0x47eb65[_0x7f09('0x44')],{'$or':_[_0x7f09('0x47')](_0x5deaa9,function(_0x1611c4){if(_0x1611c4[_0x7f09('0x48')][_0x7f09('0x49')]!==_0x7f09('0x4a')){var _0x468441={};_0x468441[_0x1611c4[_0x7f09('0x4b')]]={'$like':'%'+_0x33982d[_0x7f09('0x39')][_0x7f09('0x4c')]+'%'};return _0x468441;}})});}_0x47eb65=_['merge']({},_0x47eb65,_0x33982d['options']);var _0x492139={'where':_0x47eb65[_0x7f09('0x44')]};return db[_0x7f09('0x36')]['count'](_0x492139)[_0x7f09('0x1e')](function(_0x2a4fff){_0x2b8c00[_0x7f09('0x4d')]=_0x2a4fff;if(_0x33982d['query']['includeAll']){_0x47eb65['include']=[{'all':!![]}];}return db[_0x7f09('0x36')][_0x7f09('0x4e')](_0x47eb65);})['then'](function(_0x36f1d2){_0x2b8c00[_0x7f09('0x4f')]=_0x36f1d2;return _0x2b8c00;})['then'](respondWithFilteredResult(_0x443fb9,_0x47eb65))[_0x7f09('0x50')](handleError(_0x443fb9,null));};exports[_0x7f09('0x51')]=function(_0x8a3eae,_0x5cdcdd){var _0xd07ce5={'raw':![],'where':{'id':_0x8a3eae[_0x7f09('0x52')]['id']}},_0x1a5484={};_0x1a5484[_0x7f09('0x38')]=_[_0x7f09('0x3a')](db[_0x7f09('0x36')]['rawAttributes']);_0x1a5484[_0x7f09('0x39')]=_[_0x7f09('0x3a')](_0x8a3eae[_0x7f09('0x39')]);_0x1a5484[_0x7f09('0x3b')]=_['intersection'](_0x1a5484[_0x7f09('0x38')],_0x1a5484['query']);_0xd07ce5[_0x7f09('0x3e')]=_[_0x7f09('0x3c')](_0x1a5484[_0x7f09('0x38')],qs[_0x7f09('0x3d')](_0x8a3eae[_0x7f09('0x39')]['fields']));_0xd07ce5[_0x7f09('0x3e')]=_0xd07ce5[_0x7f09('0x3e')]['length']?_0xd07ce5[_0x7f09('0x3e')]:_0x1a5484[_0x7f09('0x38')];if(_0x8a3eae[_0x7f09('0x39')][_0x7f09('0x53')]){_0xd07ce5[_0x7f09('0x54')]=[{'all':!![]}];}_0xd07ce5=_[_0x7f09('0x46')]({},_0xd07ce5,_0x8a3eae[_0x7f09('0x55')]);return db[_0x7f09('0x36')]['find'](_0xd07ce5)[_0x7f09('0x1e')](handleEntityNotFound(_0x5cdcdd,null))[_0x7f09('0x1e')](respondWithResult(_0x5cdcdd,null))[_0x7f09('0x50')](handleError(_0x5cdcdd,null));};exports[_0x7f09('0x56')]=function(_0x50a017,_0x4f744d){return db[_0x7f09('0x36')][_0x7f09('0x56')](_0x50a017[_0x7f09('0x57')],{})['then'](respondWithResult(_0x4f744d,0xc9))['catch'](handleError(_0x4f744d,null));};exports['update']=function(_0x52c49f,_0x2717bb){if(_0x52c49f['body']['id']){delete _0x52c49f[_0x7f09('0x57')]['id'];}return db[_0x7f09('0x36')][_0x7f09('0x58')]({'where':{'id':_0x52c49f[_0x7f09('0x52')]['id']}})[_0x7f09('0x1e')](handleEntityNotFound(_0x2717bb,null))['then'](saveUpdates(_0x52c49f[_0x7f09('0x57')],null))[_0x7f09('0x1e')](respondWithResult(_0x2717bb,null))[_0x7f09('0x50')](handleError(_0x2717bb,null));};exports[_0x7f09('0x59')]=function(_0x6ccd9e,_0x5683ca){return db[_0x7f09('0x36')][_0x7f09('0x58')]({'where':{'id':_0x6ccd9e['params']['id']}})[_0x7f09('0x1e')](handleEntityNotFound(_0x5683ca,null))[_0x7f09('0x1e')](removeEntity(_0x5683ca,null))[_0x7f09('0x50')](handleError(_0x5683ca,null));};exports[_0x7f09('0x5a')]=function(_0x1f2b1d,_0x2bf4f0,_0x12b27a){var _0x178898={};var _0x34d02f={};var _0x55aea7;var _0x5491be;return db[_0x7f09('0x36')][_0x7f09('0x5b')]({'where':{'id':_0x1f2b1d[_0x7f09('0x52')]['id']}})[_0x7f09('0x1e')](handleEntityNotFound(_0x2bf4f0,null))[_0x7f09('0x1e')](function(_0x2760fc){if(_0x2760fc){_0x55aea7=_0x2760fc;_0x34d02f['model']=_[_0x7f09('0x3a')](db[_0x7f09('0x5c')][_0x7f09('0x37')]);_0x34d02f['query']=_[_0x7f09('0x3a')](_0x1f2b1d['query']);_0x34d02f[_0x7f09('0x3b')]=_[_0x7f09('0x3c')](_0x34d02f[_0x7f09('0x38')],_0x34d02f[_0x7f09('0x39')]);_0x178898[_0x7f09('0x3e')]=_['intersection'](_0x34d02f[_0x7f09('0x38')],qs[_0x7f09('0x3d')](_0x1f2b1d[_0x7f09('0x39')][_0x7f09('0x3d')]));_0x178898[_0x7f09('0x3e')]=_0x178898[_0x7f09('0x3e')][_0x7f09('0x3f')]?_0x178898[_0x7f09('0x3e')]:_0x34d02f[_0x7f09('0x38')];_0x178898[_0x7f09('0x42')]=qs[_0x7f09('0x43')](_0x1f2b1d[_0x7f09('0x39')][_0x7f09('0x43')]);_0x178898['where']=qs[_0x7f09('0x3b')](_[_0x7f09('0x45')](_0x1f2b1d[_0x7f09('0x39')],_0x34d02f['filters']));if(_0x1f2b1d['query'][_0x7f09('0x4c')]){_0x178898['where']=_[_0x7f09('0x46')](_0x178898[_0x7f09('0x44')],{'$or':_[_0x7f09('0x47')](_0x178898[_0x7f09('0x3e')],function(_0x5270f7){var _0x725143={};_0x725143[_0x5270f7]={'$like':'%'+_0x1f2b1d[_0x7f09('0x39')]['filter']+'%'};return _0x725143;})});}_0x178898=_[_0x7f09('0x46')]({},_0x178898,_0x1f2b1d[_0x7f09('0x55')]);return _0x55aea7[_0x7f09('0x5a')](_0x178898);}})[_0x7f09('0x1e')](function(_0x21cef3){if(_0x21cef3){_0x5491be=_0x21cef3[_0x7f09('0x3f')];if(!_0x1f2b1d[_0x7f09('0x39')][_0x7f09('0x40')](_0x7f09('0x41'))){_0x178898[_0x7f09('0x2e')]=qs[_0x7f09('0x2e')](_0x1f2b1d[_0x7f09('0x39')][_0x7f09('0x2e')]);_0x178898['offset']=qs[_0x7f09('0x2d')](_0x1f2b1d[_0x7f09('0x39')][_0x7f09('0x2d')]);}return _0x55aea7[_0x7f09('0x5a')](_0x178898);}})[_0x7f09('0x1e')](function(_0x2bf026){if(_0x2bf026){return _0x2bf026?{'count':_0x5491be,'rows':_0x2bf026}:null;}})[_0x7f09('0x1e')](respondWithResult(_0x2bf4f0,null))['catch'](handleError(_0x2bf4f0,null));};exports[_0x7f09('0x5d')]=function(_0x115f9b,_0x3f6fbd,_0x54240c){if(_0x115f9b[_0x7f09('0x57')]['id']){delete _0x115f9b[_0x7f09('0x57')]['id'];}return db[_0x7f09('0x36')][_0x7f09('0x5b')]({'where':{'id':_0x115f9b[_0x7f09('0x52')]['id']}})[_0x7f09('0x1e')](handleEntityNotFound(_0x3f6fbd,null))[_0x7f09('0x1e')](function(_0x4f0ad3){if(_0x4f0ad3){_0x115f9b['body'][_0x7f09('0x5e')]=_0x4f0ad3['id'];_0x115f9b['body'][_0x7f09('0x5f')]=integrations[_0x7f09('0x60')](_0x115f9b[_0x7f09('0x57')]['channel'],_0x115f9b[_0x7f09('0x57')][_0x7f09('0x48')]);_0x115f9b[_0x7f09('0x57')][_0x7f09('0x61')]=integrations['getDescriptions'](_0x115f9b[_0x7f09('0x57')][_0x7f09('0x62')],_0x115f9b['body'][_0x7f09('0x48')]);return db[_0x7f09('0x5c')][_0x7f09('0x56')](_0x115f9b[_0x7f09('0x57')],{'include':[{'model':db[_0x7f09('0x63')],'as':_0x7f09('0x5f')},{'model':db[_0x7f09('0x63')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3f6fbd,null))['catch'](handleError(_0x3f6fbd,null));};exports[_0x7f09('0x64')]=function(_0x812dc2,_0x52ba45,_0x23db4e){var _0x37e168;var _0x3086e8='';var _0x17ec37=_0x7f09('0x65');return db[_0x7f09('0x36')][_0x7f09('0x5b')]({'where':{'id':_0x812dc2[_0x7f09('0x52')]['id']},'attributes':['id',_0x7f09('0x66'),_0x7f09('0x67'),'clientSecret',_0x7f09('0x68'),_0x7f09('0x69'),_0x7f09('0x6a')]})[_0x7f09('0x1e')](handleEntityNotFound(_0x52ba45,null))[_0x7f09('0x1e')](function(_0x5582fc){if(_0x5582fc){_0x3086e8=_0x5582fc[_0x7f09('0x66')];var _0x245b42=_0x3086e8['slice'](-0x1);if(_0x245b42==='/'){_0x3086e8=_0x3086e8['substring'](0x0,_0x3086e8[_0x7f09('0x6b')](_0x245b42));}_0x37e168=new jsforce[(_0x7f09('0x6c'))]({'oauth2':{'loginUrl':_0x3086e8,'clientId':_0x5582fc[_0x7f09('0x67')],'clientSecret':_0x5582fc[_0x7f09('0x6d')]}});return _0x37e168[_0x7f09('0x6e')](_0x5582fc[_0x7f09('0x68')],_0x5582fc[_0x7f09('0x69')][_0x7f09('0x6f')](_0x5582fc[_0x7f09('0x6a')]));}})[_0x7f09('0x1e')](function(_0x589198){if(_0x589198){if(!_['isNil'](_0x812dc2[_0x7f09('0x39')][_0x7f09('0x70')])){_0x17ec37=_0x812dc2[_0x7f09('0x39')][_0x7f09('0x70')];}return _0x37e168[_0x7f09('0x71')](_0x17ec37)[_0x7f09('0x72')]();}})['then'](function(_0x449dc2){var _0x3ee620=[_0x7f09('0x73'),_0x7f09('0x74'),'CallObject',_0x7f09('0x75'),_0x7f09('0x76'),_0x7f09('0x77'),_0x7f09('0x78'),_0x7f09('0x79')];if(!_['isNil'](_0x812dc2[_0x7f09('0x39')]['ticketType'])&&_0x812dc2[_0x7f09('0x39')]['ticketType']===_0x7f09('0x7a')){_0x3ee620=[_0x7f09('0x79'),'Origin',_0x7f09('0x7b'),_0x7f09('0x78'),_0x7f09('0x77'),_0x7f09('0x7c'),_0x7f09('0x7d'),_0x7f09('0x7e')];}if(_0x449dc2){_[_0x7f09('0x7f')](_0x449dc2[_0x7f09('0x3d')],function(_0x4d06c0){return _0x4d06c0['custom']===![]&&!_0x3ee620[_0x7f09('0x80')](_0x4d06c0[_0x7f09('0x33')]);});return{'count':_0x449dc2[_0x7f09('0x3d')][_0x7f09('0x3f')],'rows':_['map'](_0x449dc2['fields'],function(_0x41c87d){return{'id':_0x41c87d['name'],'name':_0x41c87d[_0x7f09('0x81')],'custom':_0x41c87d[_0x7f09('0x82')],'options':_0x41c87d[_0x7f09('0x83')][_0x7f09('0x3f')]>0x0?_[_0x7f09('0x47')](_0x41c87d['picklistValues'],function(_0x5a498a){return{'name':_0x5a498a[_0x7f09('0x81')],'value':_0x5a498a['value']};}):_0x41c87d[_0x7f09('0x48')]==_0x7f09('0x84')?[{'name':_0x7f09('0x85'),'value':_0x7f09('0x86')},{'name':'False','value':'false'}]:[]};})};}})[_0x7f09('0x1e')](respondWithResult(_0x52ba45,null))[_0x7f09('0x50')](function(_0x24bb00){var _0x4770c0=_0x812dc2[_0x7f09('0x39')][_0x7f09('0x87')]?0x1f4:_0x24bb00[_0x7f09('0x88')]||0x1f4;logger[_0x7f09('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4770c0,JSON[_0x7f09('0x24')](_0x24bb00));delete _0x24bb00[_0x7f09('0x33')];if(_0x4770c0===0x191){_0x4770c0=0x190;}_0x52ba45[_0x7f09('0x2a')](_0x4770c0)[_0x7f09('0x34')](_0x812dc2[_0x7f09('0x39')][_0x7f09('0x87')]?{'message':_0x7f09('0x89'),'statusCode':_0x24bb00[_0x7f09('0x88')]}:_0x24bb00);});}; \ No newline at end of file +var _0xceee=['includeAll','include','findAll','rows','show','params','find','create','body','destroy','getConfigurations','SalesforceConfiguration','where','addConfiguration','AccountId','getSubjects','channel','type','getDescriptions','Subjects','SalesforceField','getFields','Task','findOne','clientId','clientSecret','username','password','remoteUri','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','sobject','describe','CallDurationInSeconds','CallObject','CallType','Priority','Status','Type','Reason','IsEscalated','SuppliedCompany','custom','includes','label','picklistValues','boolean','True','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','jayson/promise','client','http','test','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','offset','limit','status','set','reject','save','update','name','send','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','key','VIRTUAL','field','options','SalesforceAccount','count'];(function(_0x363cdd,_0x2fe28d){var _0x376a1a=function(_0x3649c7){while(--_0x3649c7){_0x363cdd['push'](_0x363cdd['shift']());}};_0x376a1a(++_0x2fe28d);}(_0xceee,0xbb));var _0xecee=function(_0x391f91,_0x3050d1){_0x391f91=_0x391f91-0x0;var _0x46db44=_0xceee[_0x391f91];return _0x46db44;};'use strict';var pdf=require(_0xecee('0x0'));var emlformat=require(_0xecee('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xecee('0x2'));var rp=require(_0xecee('0x3'));var moment=require(_0xecee('0x4'));var BPromise=require(_0xecee('0x5'));var Mustache=require(_0xecee('0x6'));var util=require(_0xecee('0x7'));var path=require('path');var sox=require(_0xecee('0x8'));var csv=require(_0xecee('0x9'));var ejs=require(_0xecee('0xa'));var fs=require('fs');var _=require(_0xecee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xecee('0xc'));var deskjs=require(_0xecee('0xd'));var toCsv=require('to-csv');var querystring=require(_0xecee('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecee('0xf'));var qs=require(_0xecee('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xecee('0x11'));var config=require('../../config/environment');var db=require(_0xecee('0x12'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xecee('0x13'));var client=jayson[_0xecee('0x14')][_0xecee('0x15')]({'port':0x232a});function checkPasswordPattern(_0x2fb8eb,_0x52c45a,_0x182ff4){if(_0x182ff4){var _0x24b240=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24b240[_0xecee('0x16')](_0x52c45a)){return _0x2fb8eb;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2fb8eb;}}function respondWithRpcPromise(_0x3a7d2f,_0x1db535,_0x1a2878,_0x23c586){return new BPromise(function(_0x3e04a0,_0x48a9be){var _0x4754df=_0x23c586||client;return _0x4754df[_0xecee('0x17')](_0x3a7d2f,_0x1a2878)[_0xecee('0x18')](function(_0x4651f9){logger[_0xecee('0x19')](_0xecee('0x1a'),_0x1db535,_0xecee('0x1b'));logger[_0xecee('0x1c')](_0xecee('0x1d'),_0x1db535,_0xecee('0x1b'),JSON[_0xecee('0x1e')](_0x4651f9));if(_0x4651f9['error']){if(_0x4651f9[_0xecee('0x1f')][_0xecee('0x20')]===0x1f4){logger[_0xecee('0x1f')](_0xecee('0x1a'),_0x1db535,_0x4651f9[_0xecee('0x1f')][_0xecee('0x21')]);return _0x48a9be(_0x4651f9['error']['message']);}logger['error'](_0xecee('0x1a'),_0x1db535,_0x4651f9[_0xecee('0x1f')][_0xecee('0x21')]);return _0x3e04a0(_0x4651f9[_0xecee('0x1f')][_0xecee('0x21')]);}else{logger[_0xecee('0x19')](_0xecee('0x1a'),_0x1db535,_0xecee('0x1b'));_0x3e04a0(_0x4651f9[_0xecee('0x22')]['message']);}})[_0xecee('0x23')](function(_0x5f09b0){logger[_0xecee('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x1db535,_0x5f09b0);_0x48a9be(_0x5f09b0);});});}function respondWithStatusCode(_0x32a791,_0x16624e){_0x16624e=_0x16624e||0xcc;return function(_0x1ae344){if(_0x1ae344){return _0x32a791[_0xecee('0x24')](_0x16624e);}return _0x32a791['status'](_0x16624e)['end']();};}function respondWithResult(_0x25b7af,_0x29f02c){_0x29f02c=_0x29f02c||0xc8;return function(_0x2e6929){if(_0x2e6929){return _0x25b7af['status'](_0x29f02c)[_0xecee('0x25')](_0x2e6929);}};}function respondWithFilteredResult(_0x1eff91,_0x7b7db5){return function(_0x36f0f2){if(_0x36f0f2){var _0x8f2dd=_0x36f0f2['count'],_0x28393e=_0x7b7db5['offset'],_0x4410d8=_0x7b7db5[_0xecee('0x26')]+_0x7b7db5[_0xecee('0x27')],_0x42733d;if(_0x4410d8>=_0x8f2dd){_0x4410d8=_0x8f2dd;_0x42733d=0xc8;}else{_0x42733d=0xce;}_0x1eff91[_0xecee('0x28')](_0x42733d);return _0x1eff91[_0xecee('0x29')]('Content-Range',_0x28393e+'-'+_0x4410d8+'/'+_0x8f2dd)[_0xecee('0x25')](_0x36f0f2);}return null;};}function patchUpdates(_0x56fdb8){return function(_0x325679){try{jsonpatch['apply'](_0x325679,_0x56fdb8,!![]);}catch(_0x1f3f6e){return BPromise[_0xecee('0x2a')](_0x1f3f6e);}return _0x325679[_0xecee('0x2b')]();};}function saveUpdates(_0x1bcc90,_0x213168){return function(_0x5d1b0c){if(_0x5d1b0c){return _0x5d1b0c[_0xecee('0x2c')](_0x1bcc90)[_0xecee('0x18')](function(_0x1cd011){return _0x1cd011;});}return null;};}function removeEntity(_0x1fdaf8,_0xdb0546){return function(_0x1ec3f9){if(_0x1ec3f9){return _0x1ec3f9['destroy']()[_0xecee('0x18')](function(){_0x1fdaf8[_0xecee('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea243,_0x569da4){return function(_0xe4117b){if(!_0xe4117b){_0x2ea243['sendStatus'](0x194);}return _0xe4117b;};}function handleError(_0x5cdb06,_0x41d642){_0x41d642=_0x41d642||0x1f4;return function(_0x1de317){logger[_0xecee('0x1f')](_0x1de317['stack']);if(_0x1de317[_0xecee('0x2d')]){delete _0x1de317['name'];}_0x5cdb06[_0xecee('0x28')](_0x41d642)[_0xecee('0x2e')](_0x1de317);};}exports['index']=function(_0x3f71cf,_0x5f4087){var _0x50693b={},_0x1161a8={},_0xc0343f={'count':0x0,'rows':[]};var _0x59ad53=db['SalesforceAccount']['rawAttributes'];_0x1161a8[_0xecee('0x2f')]=_[_0xecee('0x30')](_0x59ad53);_0x1161a8[_0xecee('0x31')]=_[_0xecee('0x30')](_0x3f71cf['query']);_0x1161a8[_0xecee('0x32')]=_[_0xecee('0x33')](_0x1161a8[_0xecee('0x2f')],_0x1161a8[_0xecee('0x31')]);_0x50693b[_0xecee('0x34')]=_[_0xecee('0x33')](_0x1161a8[_0xecee('0x2f')],qs['fields'](_0x3f71cf[_0xecee('0x31')][_0xecee('0x35')]));_0x50693b[_0xecee('0x34')]=_0x50693b[_0xecee('0x34')][_0xecee('0x36')]?_0x50693b[_0xecee('0x34')]:_0x1161a8[_0xecee('0x2f')];if(!_0x3f71cf[_0xecee('0x31')][_0xecee('0x37')](_0xecee('0x38'))){_0x50693b[_0xecee('0x27')]=qs[_0xecee('0x27')](_0x3f71cf[_0xecee('0x31')]['limit']);_0x50693b['offset']=qs[_0xecee('0x26')](_0x3f71cf[_0xecee('0x31')][_0xecee('0x26')]);}_0x50693b[_0xecee('0x39')]=qs['sort'](_0x3f71cf[_0xecee('0x31')][_0xecee('0x3a')]);_0x50693b['where']=qs[_0xecee('0x32')](_[_0xecee('0x3b')](_0x3f71cf['query'],_0x1161a8[_0xecee('0x32')]));if(_0x3f71cf['query'][_0xecee('0x3c')]){_0x50693b['where']=_[_0xecee('0x3d')](_0x50693b['where'],{'$or':_[_0xecee('0x3e')](_0x59ad53,function(_0x49a700){if(_0x49a700['type'][_0xecee('0x3f')]!==_0xecee('0x40')){var _0xf8a3ad={};_0xf8a3ad[_0x49a700[_0xecee('0x41')]]={'$like':'%'+_0x3f71cf[_0xecee('0x31')][_0xecee('0x3c')]+'%'};return _0xf8a3ad;}})});}_0x50693b=_[_0xecee('0x3d')]({},_0x50693b,_0x3f71cf[_0xecee('0x42')]);var _0x6eb327={'where':_0x50693b['where']};return db[_0xecee('0x43')][_0xecee('0x44')](_0x6eb327)[_0xecee('0x18')](function(_0x3a0161){_0xc0343f['count']=_0x3a0161;if(_0x3f71cf[_0xecee('0x31')][_0xecee('0x45')]){_0x50693b[_0xecee('0x46')]=[{'all':!![]}];}return db[_0xecee('0x43')][_0xecee('0x47')](_0x50693b);})['then'](function(_0x2399c0){_0xc0343f[_0xecee('0x48')]=_0x2399c0;return _0xc0343f;})[_0xecee('0x18')](respondWithFilteredResult(_0x5f4087,_0x50693b))[_0xecee('0x23')](handleError(_0x5f4087,null));};exports[_0xecee('0x49')]=function(_0x10b2fc,_0x23398c){var _0x2d81c5={'raw':![],'where':{'id':_0x10b2fc[_0xecee('0x4a')]['id']}},_0x5e4462={};_0x5e4462[_0xecee('0x2f')]=_[_0xecee('0x30')](db[_0xecee('0x43')]['rawAttributes']);_0x5e4462[_0xecee('0x31')]=_[_0xecee('0x30')](_0x10b2fc[_0xecee('0x31')]);_0x5e4462[_0xecee('0x32')]=_['intersection'](_0x5e4462['model'],_0x5e4462[_0xecee('0x31')]);_0x2d81c5[_0xecee('0x34')]=_[_0xecee('0x33')](_0x5e4462[_0xecee('0x2f')],qs[_0xecee('0x35')](_0x10b2fc[_0xecee('0x31')][_0xecee('0x35')]));_0x2d81c5[_0xecee('0x34')]=_0x2d81c5[_0xecee('0x34')][_0xecee('0x36')]?_0x2d81c5[_0xecee('0x34')]:_0x5e4462[_0xecee('0x2f')];if(_0x10b2fc[_0xecee('0x31')][_0xecee('0x45')]){_0x2d81c5['include']=[{'all':!![]}];}_0x2d81c5=_[_0xecee('0x3d')]({},_0x2d81c5,_0x10b2fc[_0xecee('0x42')]);return db[_0xecee('0x43')][_0xecee('0x4b')](_0x2d81c5)[_0xecee('0x18')](handleEntityNotFound(_0x23398c,null))['then'](respondWithResult(_0x23398c,null))[_0xecee('0x23')](handleError(_0x23398c,null));};exports[_0xecee('0x4c')]=function(_0x4c2953,_0x5f3ebe){return db[_0xecee('0x43')][_0xecee('0x4c')](_0x4c2953[_0xecee('0x4d')],{})[_0xecee('0x18')](respondWithResult(_0x5f3ebe,0xc9))[_0xecee('0x23')](handleError(_0x5f3ebe,null));};exports[_0xecee('0x2c')]=function(_0x24556f,_0x1bd606){if(_0x24556f[_0xecee('0x4d')]['id']){delete _0x24556f[_0xecee('0x4d')]['id'];}return db[_0xecee('0x43')]['find']({'where':{'id':_0x24556f['params']['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x1bd606,null))[_0xecee('0x18')](saveUpdates(_0x24556f[_0xecee('0x4d')],null))['then'](respondWithResult(_0x1bd606,null))[_0xecee('0x23')](handleError(_0x1bd606,null));};exports[_0xecee('0x4e')]=function(_0x58b8fe,_0x292224){return db['SalesforceAccount']['find']({'where':{'id':_0x58b8fe[_0xecee('0x4a')]['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x292224,null))[_0xecee('0x18')](removeEntity(_0x292224,null))[_0xecee('0x23')](handleError(_0x292224,null));};exports[_0xecee('0x4f')]=function(_0x454532,_0x399d25,_0x14e845){var _0x523a94={};var _0x3470cd={};var _0x41a4b8;var _0x102faf;return db['SalesforceAccount']['findOne']({'where':{'id':_0x454532[_0xecee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x399d25,null))[_0xecee('0x18')](function(_0x26768e){if(_0x26768e){_0x41a4b8=_0x26768e;_0x3470cd[_0xecee('0x2f')]=_[_0xecee('0x30')](db[_0xecee('0x50')]['rawAttributes']);_0x3470cd[_0xecee('0x31')]=_[_0xecee('0x30')](_0x454532[_0xecee('0x31')]);_0x3470cd[_0xecee('0x32')]=_[_0xecee('0x33')](_0x3470cd[_0xecee('0x2f')],_0x3470cd['query']);_0x523a94[_0xecee('0x34')]=_[_0xecee('0x33')](_0x3470cd[_0xecee('0x2f')],qs[_0xecee('0x35')](_0x454532[_0xecee('0x31')][_0xecee('0x35')]));_0x523a94[_0xecee('0x34')]=_0x523a94[_0xecee('0x34')]['length']?_0x523a94[_0xecee('0x34')]:_0x3470cd[_0xecee('0x2f')];_0x523a94['order']=qs['sort'](_0x454532['query']['sort']);_0x523a94[_0xecee('0x51')]=qs[_0xecee('0x32')](_[_0xecee('0x3b')](_0x454532[_0xecee('0x31')],_0x3470cd['filters']));if(_0x454532[_0xecee('0x31')]['filter']){_0x523a94['where']=_[_0xecee('0x3d')](_0x523a94[_0xecee('0x51')],{'$or':_['map'](_0x523a94['attributes'],function(_0x43504f){var _0x39421f={};_0x39421f[_0x43504f]={'$like':'%'+_0x454532[_0xecee('0x31')]['filter']+'%'};return _0x39421f;})});}_0x523a94=_[_0xecee('0x3d')]({},_0x523a94,_0x454532['options']);return _0x41a4b8[_0xecee('0x4f')](_0x523a94);}})[_0xecee('0x18')](function(_0x59dd34){if(_0x59dd34){_0x102faf=_0x59dd34[_0xecee('0x36')];if(!_0x454532[_0xecee('0x31')][_0xecee('0x37')](_0xecee('0x38'))){_0x523a94['limit']=qs['limit'](_0x454532[_0xecee('0x31')][_0xecee('0x27')]);_0x523a94['offset']=qs[_0xecee('0x26')](_0x454532[_0xecee('0x31')]['offset']);}return _0x41a4b8[_0xecee('0x4f')](_0x523a94);}})[_0xecee('0x18')](function(_0x296856){if(_0x296856){return _0x296856?{'count':_0x102faf,'rows':_0x296856}:null;}})[_0xecee('0x18')](respondWithResult(_0x399d25,null))[_0xecee('0x23')](handleError(_0x399d25,null));};exports[_0xecee('0x52')]=function(_0xc77832,_0x1f568f,_0xc6321c){if(_0xc77832['body']['id']){delete _0xc77832[_0xecee('0x4d')]['id'];}return db[_0xecee('0x43')]['findOne']({'where':{'id':_0xc77832[_0xecee('0x4a')]['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x1f568f,null))[_0xecee('0x18')](function(_0x400491){if(_0x400491){_0xc77832[_0xecee('0x4d')][_0xecee('0x53')]=_0x400491['id'];_0xc77832[_0xecee('0x4d')]['Subjects']=integrations[_0xecee('0x54')](_0xc77832[_0xecee('0x4d')][_0xecee('0x55')],_0xc77832[_0xecee('0x4d')][_0xecee('0x56')]);_0xc77832[_0xecee('0x4d')]['Descriptions']=integrations[_0xecee('0x57')](_0xc77832[_0xecee('0x4d')]['channel'],_0xc77832['body'][_0xecee('0x56')]);return db['SalesforceConfiguration'][_0xecee('0x4c')](_0xc77832[_0xecee('0x4d')],{'include':[{'model':db['SalesforceField'],'as':_0xecee('0x58')},{'model':db[_0xecee('0x59')],'as':'Descriptions'}]});}return null;})[_0xecee('0x18')](respondWithResult(_0x1f568f,null))[_0xecee('0x23')](handleError(_0x1f568f,null));};exports[_0xecee('0x5a')]=function(_0x298d0a,_0xbdba79,_0x20beff){var _0x27020e;var _0x21bd49='';var _0x250b87=_0xecee('0x5b');return db[_0xecee('0x43')][_0xecee('0x5c')]({'where':{'id':_0x298d0a['params']['id']},'attributes':['id','remoteUri',_0xecee('0x5d'),_0xecee('0x5e'),_0xecee('0x5f'),_0xecee('0x60'),'securityToken']})[_0xecee('0x18')](handleEntityNotFound(_0xbdba79,null))[_0xecee('0x18')](function(_0x1e8cd2){if(_0x1e8cd2){_0x21bd49=_0x1e8cd2[_0xecee('0x61')];var _0x3af969=_0x21bd49['slice'](-0x1);if(_0x3af969==='/'){_0x21bd49=_0x21bd49[_0xecee('0x62')](0x0,_0x21bd49[_0xecee('0x63')](_0x3af969));}_0x27020e=new jsforce[(_0xecee('0x64'))]({'oauth2':{'loginUrl':_0x21bd49,'clientId':_0x1e8cd2[_0xecee('0x5d')],'clientSecret':_0x1e8cd2[_0xecee('0x5e')]}});return _0x27020e[_0xecee('0x65')](_0x1e8cd2[_0xecee('0x5f')],_0x1e8cd2[_0xecee('0x60')][_0xecee('0x66')](_0x1e8cd2[_0xecee('0x67')]));}})[_0xecee('0x18')](function(_0x21e6b9){if(_0x21e6b9){if(!_[_0xecee('0x68')](_0x298d0a['query'][_0xecee('0x69')])){_0x250b87=_0x298d0a[_0xecee('0x31')][_0xecee('0x69')];}return _0x27020e[_0xecee('0x6a')](_0x250b87)[_0xecee('0x6b')]();}})[_0xecee('0x18')](function(_0x4523bf){var _0x4e1533=['CallDisposition',_0xecee('0x6c'),_0xecee('0x6d'),_0xecee('0x6e'),'IsArchived',_0xecee('0x6f'),_0xecee('0x70'),_0xecee('0x71')];if(!_['isNil'](_0x298d0a[_0xecee('0x31')]['ticketType'])&&_0x298d0a[_0xecee('0x31')]['ticketType']==='Case'){_0x4e1533=['Type','Origin',_0xecee('0x72'),_0xecee('0x70'),_0xecee('0x6f'),_0xecee('0x73'),'SuppliedName',_0xecee('0x74')];}if(_0x4523bf){_['remove'](_0x4523bf[_0xecee('0x35')],function(_0x2cb76b){return _0x2cb76b[_0xecee('0x75')]===![]&&!_0x4e1533[_0xecee('0x76')](_0x2cb76b[_0xecee('0x2d')]);});return{'count':_0x4523bf[_0xecee('0x35')]['length'],'rows':_[_0xecee('0x3e')](_0x4523bf['fields'],function(_0x1ff7de){return{'id':_0x1ff7de['name'],'name':_0x1ff7de[_0xecee('0x77')],'custom':_0x1ff7de['custom'],'options':_0x1ff7de[_0xecee('0x78')]['length']>0x0?_[_0xecee('0x3e')](_0x1ff7de[_0xecee('0x78')],function(_0x543001){return{'name':_0x543001[_0xecee('0x77')],'value':_0x543001['value']};}):_0x1ff7de[_0xecee('0x56')]==_0xecee('0x79')?[{'name':_0xecee('0x7a'),'value':'true'},{'name':_0xecee('0x7b'),'value':_0xecee('0x7c')}]:[]};})};}})[_0xecee('0x18')](respondWithResult(_0xbdba79,null))[_0xecee('0x23')](function(_0x25e2e9){var _0x4b24fa=_0x298d0a['query'][_0xecee('0x16')]?0x1f4:_0x25e2e9[_0xecee('0x7d')]||0x1f4;logger[_0xecee('0x1f')](_0xecee('0x7e'),'getFields',_0x4b24fa,JSON[_0xecee('0x1e')](_0x25e2e9));delete _0x25e2e9[_0xecee('0x2d')];if(_0x4b24fa===0x191){_0x4b24fa=0x190;}_0xbdba79[_0xecee('0x28')](_0x4b24fa)[_0xecee('0x2e')](_0x298d0a[_0xecee('0x31')]['test']?{'message':_0xecee('0x7f'),'statusCode':_0x25e2e9['statusCode']}:_0x25e2e9);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 091af03..5d4c453 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 _0xea28=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x105604,_0x3d135a){var _0x5451ef=function(_0x293b42){while(--_0x293b42){_0x105604['push'](_0x105604['shift']());}};_0x5451ef(++_0x3d135a);}(_0xea28,0x13a));var _0x8ea2=function(_0x3586cf,_0x266934){_0x3586cf=_0x3586cf-0x0;var _0x53ccd8=_0xea28[_0x3586cf];return _0x53ccd8;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));var integrations=require(_0x8ea2('0xa'));module['exports']=function(_0x29b82b,_0x435d78){return _0x29b82b[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0102=['exports','define','int_salesforce_accounts','util','../../config/logger','api','moment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x37bc5f,_0x414746){var _0x6739ab=function(_0x55f13c){while(--_0x55f13c){_0x37bc5f['push'](_0x37bc5f['shift']());}};_0x6739ab(++_0x414746);}(_0x0102,0x186));var _0x2010=function(_0x1c866f,_0xeaa6b9){_0x1c866f=_0x1c866f-0x0;var _0x101c8c=_0x0102[_0x1c866f];return _0x101c8c;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var moment=require(_0x2010('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2010('0x4'));var integrations=require(_0x2010('0x5'));module[_0x2010('0x6')]=function(_0x304264,_0x4eeb67){return _0x304264[_0x2010('0x7')]('SalesforceAccount',attributes,{'tableName':_0x2010('0x8'),'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 5d8e25d..9f0879b 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 _0x1916=['result','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','where','attributes','limit','include','map','model','catch','ShowSalesforceAccount','find','stringify','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5cd8a4,_0x5623d8){var _0x4ed629=function(_0x1fbae6){while(--_0x1fbae6){_0x5cd8a4['push'](_0x5cd8a4['shift']());}};_0x4ed629(++_0x5623d8);}(_0x1916,0xf0));var _0x6191=function(_0x142ce9,_0x1d5665){_0x142ce9=_0x142ce9-0x0;var _0x56b96b=_0x1916[_0x142ce9];return _0x56b96b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6191('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6191('0x1'));var db=require(_0x6191('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6191('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6191('0x4'));var client=jayson[_0x6191('0x5')][_0x6191('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x35b785,_0x4b2c16,_0x570fcb){return new BPromise(function(_0x50808a,_0x5dfa3c){return client['request'](_0x35b785,_0x570fcb)[_0x6191('0x7')](function(_0x3d37c0){logger[_0x6191('0x8')](_0x6191('0x9'),_0x4b2c16,_0x6191('0xa'));logger[_0x6191('0xb')](_0x6191('0xc'),_0x4b2c16,'request\x20sent',JSON['stringify'](_0x3d37c0));if(_0x3d37c0[_0x6191('0xd')]){if(_0x3d37c0['error'][_0x6191('0xe')]===0x1f4){logger[_0x6191('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4b2c16,_0x3d37c0[_0x6191('0xd')][_0x6191('0xf')]);return _0x5dfa3c(_0x3d37c0[_0x6191('0xd')][_0x6191('0xf')]);}logger[_0x6191('0xd')](_0x6191('0x9'),_0x4b2c16,_0x3d37c0[_0x6191('0xd')][_0x6191('0xf')]);return _0x50808a(_0x3d37c0[_0x6191('0xd')]['message']);}else{logger[_0x6191('0x8')](_0x6191('0x9'),_0x4b2c16,_0x6191('0xa'));_0x50808a(_0x3d37c0[_0x6191('0x10')][_0x6191('0xf')]);}})['catch'](function(_0x466b06){logger[_0x6191('0xd')](_0x6191('0x9'),_0x4b2c16,_0x466b06);_0x5dfa3c(_0x466b06);});});}exports[_0x6191('0x11')]=function(_0x30a680){var _0x58e3f9=this;return new Promise(function(_0x4772f2,_0x585b46){return db[_0x6191('0x12')][_0x6191('0x13')]({'raw':_0x30a680['options']?_0x30a680['options'][_0x6191('0x14')]===undefined?!![]:![]:!![],'where':_0x30a680[_0x6191('0x15')]?_0x30a680[_0x6191('0x15')][_0x6191('0x16')]||null:null,'attributes':_0x30a680['options']?_0x30a680[_0x6191('0x15')][_0x6191('0x17')]||null:null,'limit':_0x30a680[_0x6191('0x15')]?_0x30a680['options'][_0x6191('0x18')]||null:null,'include':_0x30a680[_0x6191('0x15')]?_0x30a680[_0x6191('0x15')][_0x6191('0x19')]?_[_0x6191('0x1a')](_0x30a680[_0x6191('0x15')][_0x6191('0x19')],function(_0x170d54){return{'model':db[_0x170d54[_0x6191('0x1b')]],'as':_0x170d54['as'],'attributes':_0x170d54[_0x6191('0x17')],'include':_0x170d54[_0x6191('0x19')]?_[_0x6191('0x1a')](_0x170d54[_0x6191('0x19')],function(_0xca2a3e){return{'model':db[_0xca2a3e[_0x6191('0x1b')]],'as':_0xca2a3e['as'],'attributes':_0xca2a3e[_0x6191('0x17')],'include':_0xca2a3e['include']?_['map'](_0xca2a3e[_0x6191('0x19')],function(_0x339d76){return{'model':db[_0x339d76['model']],'as':_0x339d76['as'],'attributes':_0x339d76['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ab211){logger[_0x6191('0x8')](_0x6191('0x11'),_0x30a680);logger['debug'](_0x6191('0x11'),_0x30a680,JSON['stringify'](_0x3ab211));_0x4772f2(_0x3ab211);})[_0x6191('0x1c')](function(_0x173f98){logger[_0x6191('0xd')]('GetSalesforceAccount',_0x173f98[_0x6191('0xf')],_0x30a680);_0x585b46(_0x58e3f9[_0x6191('0xd')](0x1f4,_0x173f98[_0x6191('0xf')]));});});};exports[_0x6191('0x1d')]=function(_0x6ae39c){var _0x13e24c=this;return new Promise(function(_0x4774a3,_0x2ed291){return db['SalesforceAccount'][_0x6191('0x1e')]({'raw':_0x6ae39c[_0x6191('0x15')]?_0x6ae39c['options'][_0x6191('0x14')]===undefined?!![]:![]:!![],'where':_0x6ae39c['options']?_0x6ae39c[_0x6191('0x15')][_0x6191('0x16')]||null:null,'attributes':_0x6ae39c['options']?_0x6ae39c[_0x6191('0x15')]['attributes']||null:null,'include':_0x6ae39c[_0x6191('0x15')]?_0x6ae39c[_0x6191('0x15')][_0x6191('0x19')]?_[_0x6191('0x1a')](_0x6ae39c['options'][_0x6191('0x19')],function(_0x37d754){return{'model':db[_0x37d754['model']],'as':_0x37d754['as'],'attributes':_0x37d754[_0x6191('0x17')],'include':_0x37d754[_0x6191('0x19')]?_[_0x6191('0x1a')](_0x37d754[_0x6191('0x19')],function(_0x490f9e){return{'model':db[_0x490f9e[_0x6191('0x1b')]],'as':_0x490f9e['as'],'attributes':_0x490f9e['attributes'],'include':_0x490f9e[_0x6191('0x19')]?_['map'](_0x490f9e[_0x6191('0x19')],function(_0xe52fff){return{'model':db[_0xe52fff['model']],'as':_0xe52fff['as'],'attributes':_0xe52fff[_0x6191('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20cac7){logger[_0x6191('0x8')]('ShowSalesforceAccount',_0x6ae39c);logger['debug'](_0x6191('0x1d'),_0x6ae39c,JSON[_0x6191('0x1f')](_0x20cac7));_0x4774a3(_0x20cac7);})[_0x6191('0x1c')](function(_0x12776a){logger['error'](_0x6191('0x1d'),_0x12776a[_0x6191('0xf')],_0x6ae39c);_0x2ed291(_0x13e24c[_0x6191('0xd')](0x1f4,_0x12776a['message']));});});}; \ No newline at end of file +var _0x2e67=['../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowSalesforceAccount','SalesforceAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c60cf,_0x6fa013){var _0x18e147=function(_0x2c6ec6){while(--_0x2c6ec6){_0x1c60cf['push'](_0x1c60cf['shift']());}};_0x18e147(++_0x6fa013);}(_0x2e67,0x199));var _0x72e6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2e67[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x72e6('0x0'));var util=require(_0x72e6('0x1'));var moment=require(_0x72e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x72e6('0x3'));var fs=require('fs');var Redis=require(_0x72e6('0x4'));var db=require(_0x72e6('0x5'))['db'];var utils=require(_0x72e6('0x6'));var logger=require(_0x72e6('0x7'))(_0x72e6('0x8'));var config=require(_0x72e6('0x9'));var jayson=require(_0x72e6('0xa'));var client=jayson[_0x72e6('0xb')][_0x72e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x348578,_0x1aa859,_0x44a7ee){return new BPromise(function(_0x15608d,_0x2aee56){return client[_0x72e6('0xd')](_0x348578,_0x44a7ee)[_0x72e6('0xe')](function(_0x5c4fb8){logger['info'](_0x72e6('0xf'),_0x1aa859,'request\x20sent');logger[_0x72e6('0x10')](_0x72e6('0x11'),_0x1aa859,'request\x20sent',JSON['stringify'](_0x5c4fb8));if(_0x5c4fb8[_0x72e6('0x12')]){if(_0x5c4fb8[_0x72e6('0x12')][_0x72e6('0x13')]===0x1f4){logger[_0x72e6('0x12')](_0x72e6('0xf'),_0x1aa859,_0x5c4fb8[_0x72e6('0x12')][_0x72e6('0x14')]);return _0x2aee56(_0x5c4fb8['error'][_0x72e6('0x14')]);}logger['error'](_0x72e6('0xf'),_0x1aa859,_0x5c4fb8[_0x72e6('0x12')][_0x72e6('0x14')]);return _0x15608d(_0x5c4fb8[_0x72e6('0x12')][_0x72e6('0x14')]);}else{logger[_0x72e6('0x15')](_0x72e6('0xf'),_0x1aa859,_0x72e6('0x16'));_0x15608d(_0x5c4fb8[_0x72e6('0x17')]['message']);}})['catch'](function(_0x1529a8){logger[_0x72e6('0x12')](_0x72e6('0xf'),_0x1aa859,_0x1529a8);_0x2aee56(_0x1529a8);});});}exports[_0x72e6('0x18')]=function(_0x3703fd){var _0x360ea7=this;return new Promise(function(_0x36ab8a,_0x15b823){return db['SalesforceAccount'][_0x72e6('0x19')]({'raw':_0x3703fd[_0x72e6('0x1a')]?_0x3703fd[_0x72e6('0x1a')][_0x72e6('0x1b')]===undefined?!![]:![]:!![],'where':_0x3703fd[_0x72e6('0x1a')]?_0x3703fd['options'][_0x72e6('0x1c')]||null:null,'attributes':_0x3703fd['options']?_0x3703fd['options'][_0x72e6('0x1d')]||null:null,'limit':_0x3703fd[_0x72e6('0x1a')]?_0x3703fd[_0x72e6('0x1a')][_0x72e6('0x1e')]||null:null,'include':_0x3703fd[_0x72e6('0x1a')]?_0x3703fd['options'][_0x72e6('0x1f')]?_[_0x72e6('0x20')](_0x3703fd[_0x72e6('0x1a')][_0x72e6('0x1f')],function(_0x45c452){return{'model':db[_0x45c452['model']],'as':_0x45c452['as'],'attributes':_0x45c452[_0x72e6('0x1d')],'include':_0x45c452[_0x72e6('0x1f')]?_['map'](_0x45c452[_0x72e6('0x1f')],function(_0x499e1e){return{'model':db[_0x499e1e[_0x72e6('0x21')]],'as':_0x499e1e['as'],'attributes':_0x499e1e[_0x72e6('0x1d')],'include':_0x499e1e['include']?_[_0x72e6('0x20')](_0x499e1e['include'],function(_0x575ead){return{'model':db[_0x575ead[_0x72e6('0x21')]],'as':_0x575ead['as'],'attributes':_0x575ead[_0x72e6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x72e6('0xe')](function(_0x10e554){logger[_0x72e6('0x15')](_0x72e6('0x18'),_0x3703fd);logger[_0x72e6('0x10')]('GetSalesforceAccount',_0x3703fd,JSON[_0x72e6('0x22')](_0x10e554));_0x36ab8a(_0x10e554);})[_0x72e6('0x23')](function(_0x4dc70d){logger[_0x72e6('0x12')](_0x72e6('0x18'),_0x4dc70d[_0x72e6('0x14')],_0x3703fd);_0x15b823(_0x360ea7['error'](0x1f4,_0x4dc70d['message']));});});};exports[_0x72e6('0x24')]=function(_0x4acc64){var _0x5b7385=this;return new Promise(function(_0x50a206,_0x5f11c4){return db[_0x72e6('0x25')]['find']({'raw':_0x4acc64[_0x72e6('0x1a')]?_0x4acc64[_0x72e6('0x1a')][_0x72e6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4acc64[_0x72e6('0x1a')]?_0x4acc64[_0x72e6('0x1a')][_0x72e6('0x1c')]||null:null,'attributes':_0x4acc64[_0x72e6('0x1a')]?_0x4acc64['options'][_0x72e6('0x1d')]||null:null,'include':_0x4acc64[_0x72e6('0x1a')]?_0x4acc64[_0x72e6('0x1a')][_0x72e6('0x1f')]?_[_0x72e6('0x20')](_0x4acc64['options'][_0x72e6('0x1f')],function(_0x4dcef6){return{'model':db[_0x4dcef6['model']],'as':_0x4dcef6['as'],'attributes':_0x4dcef6[_0x72e6('0x1d')],'include':_0x4dcef6[_0x72e6('0x1f')]?_[_0x72e6('0x20')](_0x4dcef6[_0x72e6('0x1f')],function(_0x38f5d7){return{'model':db[_0x38f5d7[_0x72e6('0x21')]],'as':_0x38f5d7['as'],'attributes':_0x38f5d7[_0x72e6('0x1d')],'include':_0x38f5d7[_0x72e6('0x1f')]?_[_0x72e6('0x20')](_0x38f5d7['include'],function(_0xe769db){return{'model':db[_0xe769db[_0x72e6('0x21')]],'as':_0xe769db['as'],'attributes':_0xe769db[_0x72e6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x72e6('0xe')](function(_0x33ff39){logger[_0x72e6('0x15')](_0x72e6('0x24'),_0x4acc64);logger[_0x72e6('0x10')](_0x72e6('0x24'),_0x4acc64,JSON[_0x72e6('0x22')](_0x33ff39));_0x50a206(_0x33ff39);})[_0x72e6('0x23')](function(_0x28640c){logger[_0x72e6('0x12')](_0x72e6('0x24'),_0x28640c[_0x72e6('0x14')],_0x4acc64);_0x5f11c4(_0x5b7385['error'](0x1f4,_0x28640c['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 0bbd7bc..821fa03 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 _0x47b4=['connect-timeout','express','Router','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','delete','destroy','exports'];(function(_0x3737c0,_0x34000d){var _0x38b21e=function(_0x57f16e){while(--_0x57f16e){_0x3737c0['push'](_0x3737c0['shift']());}};_0x38b21e(++_0x34000d);}(_0x47b4,0x144));var _0x447b=function(_0x33793a,_0x515635){_0x33793a=_0x33793a-0x0;var _0x242389=_0x47b4[_0x33793a];return _0x242389;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x447b('0x0'));var express=require(_0x447b('0x1'));var router=express[_0x447b('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x447b('0x3'));router[_0x447b('0x4')]('/',auth[_0x447b('0x5')](),controller[_0x447b('0x6')]);router['get'](_0x447b('0x7'),auth[_0x447b('0x5')](),controller[_0x447b('0x8')]);router[_0x447b('0x4')](_0x447b('0x9'),auth[_0x447b('0x5')](),controller[_0x447b('0xa')]);router['get'](_0x447b('0xb'),auth[_0x447b('0x5')](),controller['getSubjects']);router[_0x447b('0x4')](_0x447b('0xc'),auth[_0x447b('0x5')](),controller['getDescriptions']);router[_0x447b('0xd')]('/',auth['isAuthenticated'](),controller[_0x447b('0xe')]);router['put'](_0x447b('0x7'),auth[_0x447b('0x5')](),controller['update']);router[_0x447b('0xf')](_0x447b('0x7'),auth[_0x447b('0x5')](),controller[_0x447b('0x10')]);module[_0x447b('0x11')]=router; \ No newline at end of file +var _0x9b43=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields'];(function(_0x319a5a,_0x502f27){var _0x3bc5f9=function(_0x1243ab){while(--_0x1243ab){_0x319a5a['push'](_0x319a5a['shift']());}};_0x3bc5f9(++_0x502f27);}(_0x9b43,0x1e5));var _0x39b4=function(_0x2df65f,_0x323dec){_0x2df65f=_0x2df65f-0x0;var _0x27feea=_0x9b43[_0x2df65f];return _0x27feea;};'use strict';var multer=require(_0x39b4('0x0'));var util=require(_0x39b4('0x1'));var path=require(_0x39b4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x39b4('0x3')]();var auth=require(_0x39b4('0x4'));var interaction=require(_0x39b4('0x5'));var config=require(_0x39b4('0x6'));var controller=require(_0x39b4('0x7'));router[_0x39b4('0x8')]('/',auth['isAuthenticated'](),controller[_0x39b4('0x9')]);router['get'](_0x39b4('0xa'),auth[_0x39b4('0xb')](),controller[_0x39b4('0xc')]);router['get'](_0x39b4('0xd'),auth[_0x39b4('0xb')](),controller[_0x39b4('0xe')]);router['get'](_0x39b4('0xf'),auth['isAuthenticated'](),controller[_0x39b4('0x10')]);router[_0x39b4('0x8')](_0x39b4('0x11'),auth[_0x39b4('0xb')](),controller[_0x39b4('0x12')]);router[_0x39b4('0x13')]('/',auth[_0x39b4('0xb')](),controller[_0x39b4('0x14')]);router[_0x39b4('0x15')]('/:id',auth[_0x39b4('0xb')](),controller['update']);router[_0x39b4('0x16')](_0x39b4('0xa'),auth[_0x39b4('0xb')](),controller[_0x39b4('0x17')]);module[_0x39b4('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 0cb3208..4182084 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 _0xd107=['contact','exports','STRING','ENUM','Task','lead','contact_lead','nothing'];(function(_0x137cea,_0x20e60d){var _0x480882=function(_0x280975){while(--_0x280975){_0x137cea['push'](_0x137cea['shift']());}};_0x480882(++_0x20e60d);}(_0xd107,0xe1));var _0x7d10=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xd107[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');module[_0x7d10('0x0')]={'name':{'type':Sequelize[_0x7d10('0x1')]},'description':{'type':Sequelize[_0x7d10('0x1')]},'ticketType':{'type':Sequelize[_0x7d10('0x2')](_0x7d10('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x7d10('0x2')]('contact_lead','contact',_0x7d10('0x4')),'defaultValue':_0x7d10('0x5')},'moduleCreate':{'type':Sequelize[_0x7d10('0x2')](_0x7d10('0x6'),_0x7d10('0x7'),'lead'),'defaultValue':_0x7d10('0x4')}}; \ No newline at end of file +var _0xf333=['contact','lead','nothing','sequelize','exports','STRING','ENUM','Task'];(function(_0x2b47ad,_0x55c7cc){var _0x1a2426=function(_0x47285b){while(--_0x47285b){_0x2b47ad['push'](_0x2b47ad['shift']());}};_0x1a2426(++_0x55c7cc);}(_0xf333,0xe3));var _0x3f33=function(_0x89b577,_0x7a7ec9){_0x89b577=_0x89b577-0x0;var _0x31d468=_0xf333[_0x89b577];return _0x31d468;};'use strict';var Sequelize=require(_0x3f33('0x0'));module[_0x3f33('0x1')]={'name':{'type':Sequelize[_0x3f33('0x2')]},'description':{'type':Sequelize[_0x3f33('0x2')]},'ticketType':{'type':Sequelize[_0x3f33('0x3')](_0x3f33('0x4'),'Case'),'defaultValue':_0x3f33('0x4')},'moduleSearch':{'type':Sequelize[_0x3f33('0x3')]('contact_lead',_0x3f33('0x5'),_0x3f33('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x3f33('0x7'),_0x3f33('0x5'),_0x3f33('0x6')),'defaultValue':_0x3f33('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 2bd18b5..a310519 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 _0x8af1=['status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','stack','name','index','SalesforceConfiguration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','count','include','findAll','rows','show','params','includeAll','options','find','create','body','update','destroy','getFields','findOne','SalesforceField','pick','filter','map','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','error','message','catch'];(function(_0x2ca401,_0x2575f4){var _0x238a23=function(_0x339412){while(--_0x339412){_0x2ca401['push'](_0x2ca401['shift']());}};_0x238a23(++_0x2575f4);}(_0x8af1,0x91));var _0x18af=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x8af1[_0x650e11];return _0x1a9b47;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x18af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18af('0x1'));var jsonpatch=require(_0x18af('0x2'));var rp=require(_0x18af('0x3'));var moment=require(_0x18af('0x4'));var BPromise=require(_0x18af('0x5'));var Mustache=require(_0x18af('0x6'));var util=require(_0x18af('0x7'));var path=require(_0x18af('0x8'));var sox=require('sox');var csv=require(_0x18af('0x9'));var ejs=require(_0x18af('0xa'));var fs=require('fs');var _=require(_0x18af('0xb'));var squel=require(_0x18af('0xc'));var crypto=require('crypto');var jsforce=require(_0x18af('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x18af('0xe'));var Papa=require('papaparse');var Redis=require(_0x18af('0xf'));var authService=require(_0x18af('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x18af('0x11'));var logger=require(_0x18af('0x12'))(_0x18af('0x13'));var utils=require(_0x18af('0x14'));var config=require(_0x18af('0x15'));var db=require(_0x18af('0x16'))['db'];var jayson=require(_0x18af('0x17'));var client=jayson['client'][_0x18af('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1a4196,_0x41d19a,_0x4a91d6){if(_0x4a91d6){var _0x40d559=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40d559[_0x18af('0x19')](_0x41d19a)){return _0x1a4196;}else{throw new Error(_0x18af('0x1a'));}}else{return _0x1a4196;}}function respondWithRpcPromise(_0x326c3d,_0x1799a4,_0x5e5548,_0xd62445){return new BPromise(function(_0x27b514,_0x4dabc1){var _0x3122bf=_0xd62445||client;return _0x3122bf['request'](_0x326c3d,_0x5e5548)['then'](function(_0x420030){logger[_0x18af('0x1b')](_0x18af('0x1c'),_0x1799a4,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1799a4,_0x18af('0x1d'),JSON['stringify'](_0x420030));if(_0x420030[_0x18af('0x1e')]){if(_0x420030[_0x18af('0x1e')]['code']===0x1f4){logger[_0x18af('0x1e')](_0x18af('0x1c'),_0x1799a4,_0x420030[_0x18af('0x1e')][_0x18af('0x1f')]);return _0x4dabc1(_0x420030[_0x18af('0x1e')][_0x18af('0x1f')]);}logger[_0x18af('0x1e')](_0x18af('0x1c'),_0x1799a4,_0x420030['error'][_0x18af('0x1f')]);return _0x27b514(_0x420030[_0x18af('0x1e')][_0x18af('0x1f')]);}else{logger[_0x18af('0x1b')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1799a4,_0x18af('0x1d'));_0x27b514(_0x420030['result'][_0x18af('0x1f')]);}})[_0x18af('0x20')](function(_0x541f67){logger[_0x18af('0x1e')](_0x18af('0x1c'),_0x1799a4,_0x541f67);_0x4dabc1(_0x541f67);});});}function respondWithStatusCode(_0x3f13c2,_0x24eaae){_0x24eaae=_0x24eaae||0xcc;return function(_0x16d21b){if(_0x16d21b){return _0x3f13c2['sendStatus'](_0x24eaae);}return _0x3f13c2[_0x18af('0x21')](_0x24eaae)[_0x18af('0x22')]();};}function respondWithResult(_0x575622,_0x46c988){_0x46c988=_0x46c988||0xc8;return function(_0x522bbc){if(_0x522bbc){return _0x575622['status'](_0x46c988)[_0x18af('0x23')](_0x522bbc);}};}function respondWithFilteredResult(_0x4fcb35,_0x3c70ae){return function(_0x332eee){if(_0x332eee){var _0x107f4a=_0x332eee['count'],_0x51bb71=_0x3c70ae[_0x18af('0x24')],_0x560384=_0x3c70ae[_0x18af('0x24')]+_0x3c70ae[_0x18af('0x25')],_0x7bc1ef;if(_0x560384>=_0x107f4a){_0x560384=_0x107f4a;_0x7bc1ef=0xc8;}else{_0x7bc1ef=0xce;}_0x4fcb35[_0x18af('0x21')](_0x7bc1ef);return _0x4fcb35[_0x18af('0x26')](_0x18af('0x27'),_0x51bb71+'-'+_0x560384+'/'+_0x107f4a)[_0x18af('0x23')](_0x332eee);}return null;};}function patchUpdates(_0x4dd801){return function(_0x110eae){try{jsonpatch[_0x18af('0x28')](_0x110eae,_0x4dd801,!![]);}catch(_0xb7f41){return BPromise[_0x18af('0x29')](_0xb7f41);}return _0x110eae[_0x18af('0x2a')]();};}function saveUpdates(_0x483bf2,_0x381a93){return function(_0x4eae9a){if(_0x4eae9a){return _0x4eae9a['update'](_0x483bf2)[_0x18af('0x2b')](function(_0xeb0e94){return _0xeb0e94;});}return null;};}function removeEntity(_0x19f6f6,_0x329dc1){return function(_0x2f0c37){if(_0x2f0c37){return _0x2f0c37['destroy']()[_0x18af('0x2b')](function(){_0x19f6f6['status'](0xcc)[_0x18af('0x22')]();});}};}function handleEntityNotFound(_0x5c2d5c,_0x5085c1){return function(_0x38f2b6){if(!_0x38f2b6){_0x5c2d5c[_0x18af('0x2c')](0x194);}return _0x38f2b6;};}function handleError(_0x5ca860,_0x29c929){_0x29c929=_0x29c929||0x1f4;return function(_0x4d8b55){logger[_0x18af('0x1e')](_0x4d8b55[_0x18af('0x2d')]);if(_0x4d8b55['name']){delete _0x4d8b55[_0x18af('0x2e')];}_0x5ca860['status'](_0x29c929)['send'](_0x4d8b55);};}exports[_0x18af('0x2f')]=function(_0x56ea90,_0x2d2005){var _0x4c4f47={},_0x1f1978={},_0xd3d9c5={'count':0x0,'rows':[]};var _0x31467d=db[_0x18af('0x30')][_0x18af('0x31')];_0x1f1978[_0x18af('0x32')]=_[_0x18af('0x33')](_0x31467d);_0x1f1978[_0x18af('0x34')]=_[_0x18af('0x33')](_0x56ea90[_0x18af('0x34')]);_0x1f1978[_0x18af('0x35')]=_['intersection'](_0x1f1978[_0x18af('0x32')],_0x1f1978[_0x18af('0x34')]);_0x4c4f47[_0x18af('0x36')]=_[_0x18af('0x37')](_0x1f1978[_0x18af('0x32')],qs['fields'](_0x56ea90[_0x18af('0x34')][_0x18af('0x38')]));_0x4c4f47[_0x18af('0x36')]=_0x4c4f47[_0x18af('0x36')][_0x18af('0x39')]?_0x4c4f47[_0x18af('0x36')]:_0x1f1978['model'];if(!_0x56ea90[_0x18af('0x34')][_0x18af('0x3a')](_0x18af('0x3b'))){_0x4c4f47[_0x18af('0x25')]=qs['limit'](_0x56ea90['query']['limit']);_0x4c4f47[_0x18af('0x24')]=qs[_0x18af('0x24')](_0x56ea90[_0x18af('0x34')]['offset']);}_0x4c4f47[_0x18af('0x3c')]=qs[_0x18af('0x3d')](_0x56ea90[_0x18af('0x34')][_0x18af('0x3d')]);_0x4c4f47[_0x18af('0x3e')]=qs['filters'](_['pick'](_0x56ea90[_0x18af('0x34')],_0x1f1978['filters']));if(_0x56ea90['query']['filter']){_0x4c4f47['where']=_[_0x18af('0x3f')](_0x4c4f47[_0x18af('0x3e')],{'$or':_['map'](_0x31467d,function(_0x108d46){if(_0x108d46[_0x18af('0x40')][_0x18af('0x41')]!==_0x18af('0x42')){var _0x421dc9={};_0x421dc9[_0x108d46[_0x18af('0x43')]]={'$like':'%'+_0x56ea90[_0x18af('0x34')]['filter']+'%'};return _0x421dc9;}})});}_0x4c4f47=_[_0x18af('0x3f')]({},_0x4c4f47,_0x56ea90['options']);var _0x27a088={'where':_0x4c4f47[_0x18af('0x3e')]};return db[_0x18af('0x30')][_0x18af('0x44')](_0x27a088)[_0x18af('0x2b')](function(_0x202ac6){_0xd3d9c5[_0x18af('0x44')]=_0x202ac6;if(_0x56ea90['query']['includeAll']){_0x4c4f47[_0x18af('0x45')]=[{'all':!![]}];}return db[_0x18af('0x30')][_0x18af('0x46')](_0x4c4f47);})[_0x18af('0x2b')](function(_0x31cf41){_0xd3d9c5[_0x18af('0x47')]=_0x31cf41;return _0xd3d9c5;})[_0x18af('0x2b')](respondWithFilteredResult(_0x2d2005,_0x4c4f47))[_0x18af('0x20')](handleError(_0x2d2005,null));};exports[_0x18af('0x48')]=function(_0x579151,_0xf130f2){var _0x550fb8={'raw':![],'where':{'id':_0x579151[_0x18af('0x49')]['id']}},_0x43dfa2={};_0x43dfa2['model']=_[_0x18af('0x33')](db[_0x18af('0x30')][_0x18af('0x31')]);_0x43dfa2[_0x18af('0x34')]=_[_0x18af('0x33')](_0x579151[_0x18af('0x34')]);_0x43dfa2[_0x18af('0x35')]=_[_0x18af('0x37')](_0x43dfa2[_0x18af('0x32')],_0x43dfa2[_0x18af('0x34')]);_0x550fb8[_0x18af('0x36')]=_[_0x18af('0x37')](_0x43dfa2[_0x18af('0x32')],qs['fields'](_0x579151[_0x18af('0x34')][_0x18af('0x38')]));_0x550fb8[_0x18af('0x36')]=_0x550fb8[_0x18af('0x36')][_0x18af('0x39')]?_0x550fb8['attributes']:_0x43dfa2[_0x18af('0x32')];if(_0x579151['query'][_0x18af('0x4a')]){_0x550fb8['include']=[{'all':!![]}];}_0x550fb8=_['merge']({},_0x550fb8,_0x579151[_0x18af('0x4b')]);return db[_0x18af('0x30')][_0x18af('0x4c')](_0x550fb8)['then'](handleEntityNotFound(_0xf130f2,null))['then'](respondWithResult(_0xf130f2,null))[_0x18af('0x20')](handleError(_0xf130f2,null));};exports['create']=function(_0x39abab,_0x47f699){return db[_0x18af('0x30')][_0x18af('0x4d')](_0x39abab[_0x18af('0x4e')],{})['then'](respondWithResult(_0x47f699,0xc9))[_0x18af('0x20')](handleError(_0x47f699,null));};exports[_0x18af('0x4f')]=function(_0x3e8691,_0x1c00c8){if(_0x3e8691[_0x18af('0x4e')]['id']){delete _0x3e8691[_0x18af('0x4e')]['id'];}return db[_0x18af('0x30')][_0x18af('0x4c')]({'where':{'id':_0x3e8691[_0x18af('0x49')]['id']}})[_0x18af('0x2b')](handleEntityNotFound(_0x1c00c8,null))[_0x18af('0x2b')](saveUpdates(_0x3e8691[_0x18af('0x4e')],null))[_0x18af('0x2b')](respondWithResult(_0x1c00c8,null))[_0x18af('0x20')](handleError(_0x1c00c8,null));};exports[_0x18af('0x50')]=function(_0x4f0b2c,_0x3b2d1f){return db['SalesforceConfiguration'][_0x18af('0x4c')]({'where':{'id':_0x4f0b2c[_0x18af('0x49')]['id']}})[_0x18af('0x2b')](handleEntityNotFound(_0x3b2d1f,null))[_0x18af('0x2b')](removeEntity(_0x3b2d1f,null))['catch'](handleError(_0x3b2d1f,null));};exports[_0x18af('0x51')]=function(_0x490403,_0x41a818,_0x35f802){var _0x445c7a={};var _0x549e09={};var _0x1c7ee5;var _0x4ef712;return db[_0x18af('0x30')][_0x18af('0x52')]({'where':{'id':_0x490403[_0x18af('0x49')]['id']}})[_0x18af('0x2b')](handleEntityNotFound(_0x41a818,null))['then'](function(_0x3a1c65){if(_0x3a1c65){_0x1c7ee5=_0x3a1c65;_0x549e09['model']=_[_0x18af('0x33')](db[_0x18af('0x53')][_0x18af('0x31')]);_0x549e09['query']=_[_0x18af('0x33')](_0x490403[_0x18af('0x34')]);_0x549e09[_0x18af('0x35')]=_[_0x18af('0x37')](_0x549e09[_0x18af('0x32')],_0x549e09[_0x18af('0x34')]);_0x445c7a['attributes']=_[_0x18af('0x37')](_0x549e09[_0x18af('0x32')],qs['fields'](_0x490403['query'][_0x18af('0x38')]));_0x445c7a[_0x18af('0x36')]=_0x445c7a['attributes'][_0x18af('0x39')]?_0x445c7a[_0x18af('0x36')]:_0x549e09['model'];_0x445c7a[_0x18af('0x3c')]=qs[_0x18af('0x3d')](_0x490403['query'][_0x18af('0x3d')]);_0x445c7a[_0x18af('0x3e')]=qs['filters'](_[_0x18af('0x54')](_0x490403['query'],_0x549e09[_0x18af('0x35')]));if(_0x490403['query'][_0x18af('0x55')]){_0x445c7a[_0x18af('0x3e')]=_[_0x18af('0x3f')](_0x445c7a['where'],{'$or':_[_0x18af('0x56')](_0x445c7a[_0x18af('0x36')],function(_0x3df472){var _0x4c33df={};_0x4c33df[_0x3df472]={'$like':'%'+_0x490403[_0x18af('0x34')]['filter']+'%'};return _0x4c33df;})});}_0x445c7a=_['merge']({},_0x445c7a,_0x490403[_0x18af('0x4b')]);return _0x1c7ee5[_0x18af('0x51')](_0x445c7a);}})['then'](function(_0x41378c){if(_0x41378c){_0x4ef712=_0x41378c[_0x18af('0x39')];if(!_0x490403[_0x18af('0x34')][_0x18af('0x3a')](_0x18af('0x3b'))){_0x445c7a[_0x18af('0x25')]=qs[_0x18af('0x25')](_0x490403[_0x18af('0x34')][_0x18af('0x25')]);_0x445c7a[_0x18af('0x24')]=qs[_0x18af('0x24')](_0x490403[_0x18af('0x34')]['offset']);}return _0x1c7ee5[_0x18af('0x51')](_0x445c7a);}})[_0x18af('0x2b')](function(_0x359dab){if(_0x359dab){return _0x359dab?{'count':_0x4ef712,'rows':_0x359dab}:null;}})[_0x18af('0x2b')](respondWithResult(_0x41a818,null))['catch'](handleError(_0x41a818,null));};exports[_0x18af('0x57')]=function(_0x54820d,_0x4a1378,_0x41d523){var _0x5ad906={};var _0x354deb={};var _0x5933a8;var _0x163491;return db[_0x18af('0x30')][_0x18af('0x52')]({'where':{'id':_0x54820d[_0x18af('0x49')]['id']}})[_0x18af('0x2b')](handleEntityNotFound(_0x4a1378,null))[_0x18af('0x2b')](function(_0x574ab7){if(_0x574ab7){_0x5933a8=_0x574ab7;_0x354deb[_0x18af('0x32')]=_[_0x18af('0x33')](db['SalesforceField'][_0x18af('0x31')]);_0x354deb[_0x18af('0x34')]=_['keys'](_0x54820d[_0x18af('0x34')]);_0x354deb[_0x18af('0x35')]=_[_0x18af('0x37')](_0x354deb['model'],_0x354deb[_0x18af('0x34')]);_0x5ad906['attributes']=_[_0x18af('0x37')](_0x354deb[_0x18af('0x32')],qs[_0x18af('0x38')](_0x54820d['query']['fields']));_0x5ad906['attributes']=_0x5ad906['attributes'][_0x18af('0x39')]?_0x5ad906[_0x18af('0x36')]:_0x354deb[_0x18af('0x32')];_0x5ad906[_0x18af('0x3c')]=qs['sort'](_0x54820d[_0x18af('0x34')][_0x18af('0x3d')]);_0x5ad906['where']=qs[_0x18af('0x35')](_[_0x18af('0x54')](_0x54820d[_0x18af('0x34')],_0x354deb[_0x18af('0x35')]));if(_0x54820d[_0x18af('0x34')]['filter']){_0x5ad906[_0x18af('0x3e')]=_[_0x18af('0x3f')](_0x5ad906[_0x18af('0x3e')],{'$or':_['map'](_0x5ad906[_0x18af('0x36')],function(_0x37d27c){var _0x56f0ce={};_0x56f0ce[_0x37d27c]={'$like':'%'+_0x54820d[_0x18af('0x34')][_0x18af('0x55')]+'%'};return _0x56f0ce;})});}_0x5ad906=_[_0x18af('0x3f')]({},_0x5ad906,_0x54820d[_0x18af('0x4b')]);return _0x5933a8[_0x18af('0x57')](_0x5ad906);}})[_0x18af('0x2b')](function(_0x44ef07){if(_0x44ef07){_0x163491=_0x44ef07[_0x18af('0x39')];if(!_0x54820d[_0x18af('0x34')]['hasOwnProperty'](_0x18af('0x3b'))){_0x5ad906[_0x18af('0x25')]=qs[_0x18af('0x25')](_0x54820d['query'][_0x18af('0x25')]);_0x5ad906['offset']=qs[_0x18af('0x24')](_0x54820d[_0x18af('0x34')][_0x18af('0x24')]);}return _0x5933a8[_0x18af('0x57')](_0x5ad906);}})[_0x18af('0x2b')](function(_0x266642){if(_0x266642){return _0x266642?{'count':_0x163491,'rows':_0x266642}:null;}})[_0x18af('0x2b')](respondWithResult(_0x4a1378,null))[_0x18af('0x20')](handleError(_0x4a1378,null));};exports['getDescriptions']=function(_0x419b24,_0x1d65c8,_0x7e92e1){var _0x85a4d4={};var _0x6cb2ab={};var _0x12768d;var _0x7fda0d;return db['SalesforceConfiguration'][_0x18af('0x52')]({'where':{'id':_0x419b24[_0x18af('0x49')]['id']}})[_0x18af('0x2b')](handleEntityNotFound(_0x1d65c8,null))[_0x18af('0x2b')](function(_0x20cc0d){if(_0x20cc0d){_0x12768d=_0x20cc0d;_0x6cb2ab[_0x18af('0x32')]=_[_0x18af('0x33')](db['SalesforceField'][_0x18af('0x31')]);_0x6cb2ab[_0x18af('0x34')]=_[_0x18af('0x33')](_0x419b24[_0x18af('0x34')]);_0x6cb2ab[_0x18af('0x35')]=_['intersection'](_0x6cb2ab[_0x18af('0x32')],_0x6cb2ab[_0x18af('0x34')]);_0x85a4d4[_0x18af('0x36')]=_[_0x18af('0x37')](_0x6cb2ab[_0x18af('0x32')],qs[_0x18af('0x38')](_0x419b24[_0x18af('0x34')][_0x18af('0x38')]));_0x85a4d4[_0x18af('0x36')]=_0x85a4d4[_0x18af('0x36')]['length']?_0x85a4d4[_0x18af('0x36')]:_0x6cb2ab[_0x18af('0x32')];_0x85a4d4[_0x18af('0x3c')]=qs[_0x18af('0x3d')](_0x419b24[_0x18af('0x34')][_0x18af('0x3d')]);_0x85a4d4[_0x18af('0x3e')]=qs['filters'](_[_0x18af('0x54')](_0x419b24[_0x18af('0x34')],_0x6cb2ab[_0x18af('0x35')]));if(_0x419b24[_0x18af('0x34')][_0x18af('0x55')]){_0x85a4d4['where']=_[_0x18af('0x3f')](_0x85a4d4[_0x18af('0x3e')],{'$or':_[_0x18af('0x56')](_0x85a4d4[_0x18af('0x36')],function(_0x5f4633){var _0x4ef74b={};_0x4ef74b[_0x5f4633]={'$like':'%'+_0x419b24[_0x18af('0x34')][_0x18af('0x55')]+'%'};return _0x4ef74b;})});}_0x85a4d4=_[_0x18af('0x3f')]({},_0x85a4d4,_0x419b24[_0x18af('0x4b')]);return _0x12768d[_0x18af('0x58')](_0x85a4d4);}})[_0x18af('0x2b')](function(_0x2a038b){if(_0x2a038b){_0x7fda0d=_0x2a038b[_0x18af('0x39')];if(!_0x419b24[_0x18af('0x34')][_0x18af('0x3a')](_0x18af('0x3b'))){_0x85a4d4[_0x18af('0x25')]=qs[_0x18af('0x25')](_0x419b24[_0x18af('0x34')][_0x18af('0x25')]);_0x85a4d4[_0x18af('0x24')]=qs[_0x18af('0x24')](_0x419b24[_0x18af('0x34')][_0x18af('0x24')]);}return _0x12768d[_0x18af('0x58')](_0x85a4d4);}})[_0x18af('0x2b')](function(_0x5231dc){if(_0x5231dc){return _0x5231dc?{'count':_0x7fda0d,'rows':_0x5231dc}:null;}})[_0x18af('0x2b')](respondWithResult(_0x1d65c8,null))['catch'](handleError(_0x1d65c8,null));}; \ No newline at end of file +var _0xff92=['json','apply','reject','save','update','then','destroy','end','name','send','SalesforceConfiguration','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','merge','where','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','SalesforceField','length','order','map','filter','getSubjects','getDescriptions','html-pdf','rimraf','fast-json-patch','bluebird','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','count','offset','limit'];(function(_0x547648,_0x44ccfd){var _0x628d5d=function(_0xff798d){while(--_0xff798d){_0x547648['push'](_0x547648['shift']());}};_0x628d5d(++_0x44ccfd);}(_0xff92,0x136));var _0x2ff9=function(_0x1d12e4,_0x244315){_0x1d12e4=_0x1d12e4-0x0;var _0x1d0e91=_0xff92[_0x1d12e4];return _0x1d0e91;};'use strict';var pdf=require(_0x2ff9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2ff9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ff9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2ff9('0x3'));var Mustache=require('mustache');var util=require(_0x2ff9('0x4'));var path=require(_0x2ff9('0x5'));var sox=require('sox');var csv=require(_0x2ff9('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2ff9('0x7'));var squel=require('squel');var crypto=require(_0x2ff9('0x8'));var jsforce=require(_0x2ff9('0x9'));var deskjs=require(_0x2ff9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2ff9('0xb'));var Papa=require(_0x2ff9('0xc'));var Redis=require('ioredis');var authService=require(_0x2ff9('0xd'));var qs=require(_0x2ff9('0xe'));var hardwareService=require(_0x2ff9('0xf'));var logger=require(_0x2ff9('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2ff9('0x11'))['db'];var jayson=require(_0x2ff9('0x12'));var client=jayson[_0x2ff9('0x13')][_0x2ff9('0x14')]({'port':0x232a});function checkPasswordPattern(_0x170bcd,_0x28249a,_0x3acba2){if(_0x3acba2){var _0x25ac7f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25ac7f[_0x2ff9('0x15')](_0x28249a)){return _0x170bcd;}else{throw new Error(_0x2ff9('0x16'));}}else{return _0x170bcd;}}function respondWithRpcPromise(_0x4010b8,_0x550712,_0x180aca,_0x5b83ba){return new BPromise(function(_0x311aae,_0x364f21){var _0x4bdbaf=_0x5b83ba||client;return _0x4bdbaf[_0x2ff9('0x17')](_0x4010b8,_0x180aca)['then'](function(_0x200b1f){logger[_0x2ff9('0x18')](_0x2ff9('0x19'),_0x550712,_0x2ff9('0x1a'));logger[_0x2ff9('0x1b')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x550712,_0x2ff9('0x1a'),JSON[_0x2ff9('0x1c')](_0x200b1f));if(_0x200b1f[_0x2ff9('0x1d')]){if(_0x200b1f['error'][_0x2ff9('0x1e')]===0x1f4){logger[_0x2ff9('0x1d')](_0x2ff9('0x19'),_0x550712,_0x200b1f[_0x2ff9('0x1d')][_0x2ff9('0x1f')]);return _0x364f21(_0x200b1f['error']['message']);}logger[_0x2ff9('0x1d')]('SalesforceConfiguration,\x20%s,\x20%s',_0x550712,_0x200b1f[_0x2ff9('0x1d')][_0x2ff9('0x1f')]);return _0x311aae(_0x200b1f[_0x2ff9('0x1d')][_0x2ff9('0x1f')]);}else{logger[_0x2ff9('0x18')](_0x2ff9('0x19'),_0x550712,_0x2ff9('0x1a'));_0x311aae(_0x200b1f[_0x2ff9('0x20')][_0x2ff9('0x1f')]);}})['catch'](function(_0x481a76){logger[_0x2ff9('0x1d')](_0x2ff9('0x19'),_0x550712,_0x481a76);_0x364f21(_0x481a76);});});}function respondWithStatusCode(_0x46c447,_0xa5e7e5){_0xa5e7e5=_0xa5e7e5||0xcc;return function(_0x4e232d){if(_0x4e232d){return _0x46c447[_0x2ff9('0x21')](_0xa5e7e5);}return _0x46c447[_0x2ff9('0x22')](_0xa5e7e5)['end']();};}function respondWithResult(_0x57e8f7,_0x5cc960){_0x5cc960=_0x5cc960||0xc8;return function(_0x1b7d65){if(_0x1b7d65){return _0x57e8f7[_0x2ff9('0x22')](_0x5cc960)['json'](_0x1b7d65);}};}function respondWithFilteredResult(_0x1545ab,_0x238eb8){return function(_0x5ea405){if(_0x5ea405){var _0x57bf3d=_0x5ea405[_0x2ff9('0x23')],_0x330c1b=_0x238eb8['offset'],_0x2483f6=_0x238eb8[_0x2ff9('0x24')]+_0x238eb8[_0x2ff9('0x25')],_0x39ac3d;if(_0x2483f6>=_0x57bf3d){_0x2483f6=_0x57bf3d;_0x39ac3d=0xc8;}else{_0x39ac3d=0xce;}_0x1545ab[_0x2ff9('0x22')](_0x39ac3d);return _0x1545ab['set']('Content-Range',_0x330c1b+'-'+_0x2483f6+'/'+_0x57bf3d)[_0x2ff9('0x26')](_0x5ea405);}return null;};}function patchUpdates(_0x27ec8a){return function(_0x3eea19){try{jsonpatch[_0x2ff9('0x27')](_0x3eea19,_0x27ec8a,!![]);}catch(_0x58fbaf){return BPromise[_0x2ff9('0x28')](_0x58fbaf);}return _0x3eea19[_0x2ff9('0x29')]();};}function saveUpdates(_0x126295,_0x6b6444){return function(_0x4efd3d){if(_0x4efd3d){return _0x4efd3d[_0x2ff9('0x2a')](_0x126295)[_0x2ff9('0x2b')](function(_0x53291a){return _0x53291a;});}return null;};}function removeEntity(_0xfaba96,_0x199b85){return function(_0x490053){if(_0x490053){return _0x490053[_0x2ff9('0x2c')]()[_0x2ff9('0x2b')](function(){_0xfaba96[_0x2ff9('0x22')](0xcc)[_0x2ff9('0x2d')]();});}};}function handleEntityNotFound(_0x17d1bd,_0x551ae5){return function(_0x79002b){if(!_0x79002b){_0x17d1bd[_0x2ff9('0x21')](0x194);}return _0x79002b;};}function handleError(_0x30ed1a,_0x328c03){_0x328c03=_0x328c03||0x1f4;return function(_0x359ba9){logger[_0x2ff9('0x1d')](_0x359ba9['stack']);if(_0x359ba9['name']){delete _0x359ba9[_0x2ff9('0x2e')];}_0x30ed1a['status'](_0x328c03)[_0x2ff9('0x2f')](_0x359ba9);};}exports['index']=function(_0xf4f6e7,_0x45b995){var _0x44800a={},_0x3396e6={},_0x462770={'count':0x0,'rows':[]};var _0x1a1862=db[_0x2ff9('0x30')]['rawAttributes'];_0x3396e6['model']=_[_0x2ff9('0x31')](_0x1a1862);_0x3396e6['query']=_[_0x2ff9('0x31')](_0xf4f6e7['query']);_0x3396e6[_0x2ff9('0x32')]=_['intersection'](_0x3396e6[_0x2ff9('0x33')],_0x3396e6[_0x2ff9('0x34')]);_0x44800a[_0x2ff9('0x35')]=_[_0x2ff9('0x36')](_0x3396e6['model'],qs[_0x2ff9('0x37')](_0xf4f6e7['query'][_0x2ff9('0x37')]));_0x44800a[_0x2ff9('0x35')]=_0x44800a[_0x2ff9('0x35')]['length']?_0x44800a['attributes']:_0x3396e6[_0x2ff9('0x33')];if(!_0xf4f6e7[_0x2ff9('0x34')][_0x2ff9('0x38')](_0x2ff9('0x39'))){_0x44800a[_0x2ff9('0x25')]=qs[_0x2ff9('0x25')](_0xf4f6e7[_0x2ff9('0x34')][_0x2ff9('0x25')]);_0x44800a['offset']=qs['offset'](_0xf4f6e7[_0x2ff9('0x34')]['offset']);}_0x44800a['order']=qs['sort'](_0xf4f6e7[_0x2ff9('0x34')][_0x2ff9('0x3a')]);_0x44800a['where']=qs['filters'](_[_0x2ff9('0x3b')](_0xf4f6e7['query'],_0x3396e6['filters']));if(_0xf4f6e7[_0x2ff9('0x34')]['filter']){_0x44800a['where']=_[_0x2ff9('0x3c')](_0x44800a[_0x2ff9('0x3d')],{'$or':_['map'](_0x1a1862,function(_0x1fc116){if(_0x1fc116[_0x2ff9('0x3e')][_0x2ff9('0x3f')]!==_0x2ff9('0x40')){var _0x2ac356={};_0x2ac356[_0x1fc116[_0x2ff9('0x41')]]={'$like':'%'+_0xf4f6e7['query']['filter']+'%'};return _0x2ac356;}})});}_0x44800a=_[_0x2ff9('0x3c')]({},_0x44800a,_0xf4f6e7[_0x2ff9('0x42')]);var _0xea73a3={'where':_0x44800a[_0x2ff9('0x3d')]};return db[_0x2ff9('0x30')]['count'](_0xea73a3)[_0x2ff9('0x2b')](function(_0x419464){_0x462770['count']=_0x419464;if(_0xf4f6e7[_0x2ff9('0x34')][_0x2ff9('0x43')]){_0x44800a[_0x2ff9('0x44')]=[{'all':!![]}];}return db[_0x2ff9('0x30')][_0x2ff9('0x45')](_0x44800a);})[_0x2ff9('0x2b')](function(_0x35387f){_0x462770[_0x2ff9('0x46')]=_0x35387f;return _0x462770;})[_0x2ff9('0x2b')](respondWithFilteredResult(_0x45b995,_0x44800a))[_0x2ff9('0x47')](handleError(_0x45b995,null));};exports[_0x2ff9('0x48')]=function(_0x4d97ff,_0x2d8f1e){var _0x3398a2={'raw':![],'where':{'id':_0x4d97ff[_0x2ff9('0x49')]['id']}},_0x2e5feb={};_0x2e5feb[_0x2ff9('0x33')]=_[_0x2ff9('0x31')](db[_0x2ff9('0x30')][_0x2ff9('0x4a')]);_0x2e5feb[_0x2ff9('0x34')]=_['keys'](_0x4d97ff[_0x2ff9('0x34')]);_0x2e5feb[_0x2ff9('0x32')]=_[_0x2ff9('0x36')](_0x2e5feb[_0x2ff9('0x33')],_0x2e5feb[_0x2ff9('0x34')]);_0x3398a2['attributes']=_['intersection'](_0x2e5feb[_0x2ff9('0x33')],qs['fields'](_0x4d97ff[_0x2ff9('0x34')][_0x2ff9('0x37')]));_0x3398a2[_0x2ff9('0x35')]=_0x3398a2['attributes']['length']?_0x3398a2[_0x2ff9('0x35')]:_0x2e5feb[_0x2ff9('0x33')];if(_0x4d97ff['query']['includeAll']){_0x3398a2[_0x2ff9('0x44')]=[{'all':!![]}];}_0x3398a2=_[_0x2ff9('0x3c')]({},_0x3398a2,_0x4d97ff[_0x2ff9('0x42')]);return db[_0x2ff9('0x30')][_0x2ff9('0x4b')](_0x3398a2)[_0x2ff9('0x2b')](handleEntityNotFound(_0x2d8f1e,null))['then'](respondWithResult(_0x2d8f1e,null))['catch'](handleError(_0x2d8f1e,null));};exports['create']=function(_0x2de1dc,_0x2498a7){return db[_0x2ff9('0x30')][_0x2ff9('0x4c')](_0x2de1dc['body'],{})[_0x2ff9('0x2b')](respondWithResult(_0x2498a7,0xc9))['catch'](handleError(_0x2498a7,null));};exports[_0x2ff9('0x2a')]=function(_0x4f2c22,_0x1e638f){if(_0x4f2c22[_0x2ff9('0x4d')]['id']){delete _0x4f2c22[_0x2ff9('0x4d')]['id'];}return db[_0x2ff9('0x30')][_0x2ff9('0x4b')]({'where':{'id':_0x4f2c22[_0x2ff9('0x49')]['id']}})[_0x2ff9('0x2b')](handleEntityNotFound(_0x1e638f,null))[_0x2ff9('0x2b')](saveUpdates(_0x4f2c22[_0x2ff9('0x4d')],null))[_0x2ff9('0x2b')](respondWithResult(_0x1e638f,null))[_0x2ff9('0x47')](handleError(_0x1e638f,null));};exports[_0x2ff9('0x2c')]=function(_0x386ad7,_0x22cd43){return db['SalesforceConfiguration'][_0x2ff9('0x4b')]({'where':{'id':_0x386ad7[_0x2ff9('0x49')]['id']}})[_0x2ff9('0x2b')](handleEntityNotFound(_0x22cd43,null))['then'](removeEntity(_0x22cd43,null))['catch'](handleError(_0x22cd43,null));};exports[_0x2ff9('0x4e')]=function(_0x3d124e,_0x7ef443,_0x184703){var _0xda7bef={};var _0x5736d6={};var _0x511627;var _0x3490cf;return db[_0x2ff9('0x30')][_0x2ff9('0x4f')]({'where':{'id':_0x3d124e['params']['id']}})[_0x2ff9('0x2b')](handleEntityNotFound(_0x7ef443,null))[_0x2ff9('0x2b')](function(_0x5813df){if(_0x5813df){_0x511627=_0x5813df;_0x5736d6['model']=_[_0x2ff9('0x31')](db[_0x2ff9('0x50')][_0x2ff9('0x4a')]);_0x5736d6[_0x2ff9('0x34')]=_[_0x2ff9('0x31')](_0x3d124e['query']);_0x5736d6[_0x2ff9('0x32')]=_['intersection'](_0x5736d6[_0x2ff9('0x33')],_0x5736d6[_0x2ff9('0x34')]);_0xda7bef[_0x2ff9('0x35')]=_[_0x2ff9('0x36')](_0x5736d6[_0x2ff9('0x33')],qs[_0x2ff9('0x37')](_0x3d124e[_0x2ff9('0x34')]['fields']));_0xda7bef[_0x2ff9('0x35')]=_0xda7bef['attributes'][_0x2ff9('0x51')]?_0xda7bef[_0x2ff9('0x35')]:_0x5736d6[_0x2ff9('0x33')];_0xda7bef[_0x2ff9('0x52')]=qs[_0x2ff9('0x3a')](_0x3d124e['query'][_0x2ff9('0x3a')]);_0xda7bef[_0x2ff9('0x3d')]=qs[_0x2ff9('0x32')](_['pick'](_0x3d124e[_0x2ff9('0x34')],_0x5736d6['filters']));if(_0x3d124e[_0x2ff9('0x34')]['filter']){_0xda7bef[_0x2ff9('0x3d')]=_[_0x2ff9('0x3c')](_0xda7bef['where'],{'$or':_[_0x2ff9('0x53')](_0xda7bef[_0x2ff9('0x35')],function(_0x3ea766){var _0x47d420={};_0x47d420[_0x3ea766]={'$like':'%'+_0x3d124e['query'][_0x2ff9('0x54')]+'%'};return _0x47d420;})});}_0xda7bef=_[_0x2ff9('0x3c')]({},_0xda7bef,_0x3d124e['options']);return _0x511627[_0x2ff9('0x4e')](_0xda7bef);}})['then'](function(_0x4c1101){if(_0x4c1101){_0x3490cf=_0x4c1101[_0x2ff9('0x51')];if(!_0x3d124e['query'][_0x2ff9('0x38')]('nolimit')){_0xda7bef['limit']=qs[_0x2ff9('0x25')](_0x3d124e[_0x2ff9('0x34')][_0x2ff9('0x25')]);_0xda7bef[_0x2ff9('0x24')]=qs['offset'](_0x3d124e[_0x2ff9('0x34')][_0x2ff9('0x24')]);}return _0x511627[_0x2ff9('0x4e')](_0xda7bef);}})['then'](function(_0x385d26){if(_0x385d26){return _0x385d26?{'count':_0x3490cf,'rows':_0x385d26}:null;}})[_0x2ff9('0x2b')](respondWithResult(_0x7ef443,null))[_0x2ff9('0x47')](handleError(_0x7ef443,null));};exports['getSubjects']=function(_0x556f52,_0x20017d,_0x19ca4b){var _0xcd1bc={};var _0x50eb4e={};var _0x1c32f8;var _0x2bc44c;return db['SalesforceConfiguration'][_0x2ff9('0x4f')]({'where':{'id':_0x556f52[_0x2ff9('0x49')]['id']}})[_0x2ff9('0x2b')](handleEntityNotFound(_0x20017d,null))[_0x2ff9('0x2b')](function(_0x3107f4){if(_0x3107f4){_0x1c32f8=_0x3107f4;_0x50eb4e['model']=_['keys'](db[_0x2ff9('0x50')][_0x2ff9('0x4a')]);_0x50eb4e['query']=_[_0x2ff9('0x31')](_0x556f52[_0x2ff9('0x34')]);_0x50eb4e[_0x2ff9('0x32')]=_['intersection'](_0x50eb4e[_0x2ff9('0x33')],_0x50eb4e[_0x2ff9('0x34')]);_0xcd1bc[_0x2ff9('0x35')]=_[_0x2ff9('0x36')](_0x50eb4e['model'],qs[_0x2ff9('0x37')](_0x556f52[_0x2ff9('0x34')][_0x2ff9('0x37')]));_0xcd1bc['attributes']=_0xcd1bc[_0x2ff9('0x35')]['length']?_0xcd1bc['attributes']:_0x50eb4e[_0x2ff9('0x33')];_0xcd1bc[_0x2ff9('0x52')]=qs[_0x2ff9('0x3a')](_0x556f52[_0x2ff9('0x34')][_0x2ff9('0x3a')]);_0xcd1bc[_0x2ff9('0x3d')]=qs[_0x2ff9('0x32')](_['pick'](_0x556f52[_0x2ff9('0x34')],_0x50eb4e['filters']));if(_0x556f52[_0x2ff9('0x34')][_0x2ff9('0x54')]){_0xcd1bc[_0x2ff9('0x3d')]=_[_0x2ff9('0x3c')](_0xcd1bc['where'],{'$or':_[_0x2ff9('0x53')](_0xcd1bc[_0x2ff9('0x35')],function(_0x531da8){var _0x301bd7={};_0x301bd7[_0x531da8]={'$like':'%'+_0x556f52['query'][_0x2ff9('0x54')]+'%'};return _0x301bd7;})});}_0xcd1bc=_[_0x2ff9('0x3c')]({},_0xcd1bc,_0x556f52[_0x2ff9('0x42')]);return _0x1c32f8[_0x2ff9('0x55')](_0xcd1bc);}})['then'](function(_0x15934d){if(_0x15934d){_0x2bc44c=_0x15934d['length'];if(!_0x556f52[_0x2ff9('0x34')]['hasOwnProperty'](_0x2ff9('0x39'))){_0xcd1bc[_0x2ff9('0x25')]=qs['limit'](_0x556f52[_0x2ff9('0x34')]['limit']);_0xcd1bc[_0x2ff9('0x24')]=qs[_0x2ff9('0x24')](_0x556f52[_0x2ff9('0x34')]['offset']);}return _0x1c32f8[_0x2ff9('0x55')](_0xcd1bc);}})['then'](function(_0x139f8b){if(_0x139f8b){return _0x139f8b?{'count':_0x2bc44c,'rows':_0x139f8b}:null;}})[_0x2ff9('0x2b')](respondWithResult(_0x20017d,null))[_0x2ff9('0x47')](handleError(_0x20017d,null));};exports[_0x2ff9('0x56')]=function(_0x1a4e7c,_0x5ce22b,_0x4e0b93){var _0x52b53d={};var _0xc0cfa9={};var _0x587d8d;var _0x71f2df;return db[_0x2ff9('0x30')][_0x2ff9('0x4f')]({'where':{'id':_0x1a4e7c[_0x2ff9('0x49')]['id']}})[_0x2ff9('0x2b')](handleEntityNotFound(_0x5ce22b,null))[_0x2ff9('0x2b')](function(_0x272291){if(_0x272291){_0x587d8d=_0x272291;_0xc0cfa9['model']=_[_0x2ff9('0x31')](db['SalesforceField'][_0x2ff9('0x4a')]);_0xc0cfa9[_0x2ff9('0x34')]=_[_0x2ff9('0x31')](_0x1a4e7c['query']);_0xc0cfa9['filters']=_['intersection'](_0xc0cfa9[_0x2ff9('0x33')],_0xc0cfa9[_0x2ff9('0x34')]);_0x52b53d['attributes']=_[_0x2ff9('0x36')](_0xc0cfa9[_0x2ff9('0x33')],qs[_0x2ff9('0x37')](_0x1a4e7c['query'][_0x2ff9('0x37')]));_0x52b53d['attributes']=_0x52b53d[_0x2ff9('0x35')][_0x2ff9('0x51')]?_0x52b53d[_0x2ff9('0x35')]:_0xc0cfa9[_0x2ff9('0x33')];_0x52b53d[_0x2ff9('0x52')]=qs['sort'](_0x1a4e7c[_0x2ff9('0x34')]['sort']);_0x52b53d[_0x2ff9('0x3d')]=qs[_0x2ff9('0x32')](_[_0x2ff9('0x3b')](_0x1a4e7c[_0x2ff9('0x34')],_0xc0cfa9[_0x2ff9('0x32')]));if(_0x1a4e7c[_0x2ff9('0x34')]['filter']){_0x52b53d[_0x2ff9('0x3d')]=_[_0x2ff9('0x3c')](_0x52b53d[_0x2ff9('0x3d')],{'$or':_[_0x2ff9('0x53')](_0x52b53d['attributes'],function(_0x3a24de){var _0x325688={};_0x325688[_0x3a24de]={'$like':'%'+_0x1a4e7c[_0x2ff9('0x34')][_0x2ff9('0x54')]+'%'};return _0x325688;})});}_0x52b53d=_[_0x2ff9('0x3c')]({},_0x52b53d,_0x1a4e7c[_0x2ff9('0x42')]);return _0x587d8d[_0x2ff9('0x56')](_0x52b53d);}})[_0x2ff9('0x2b')](function(_0x2071c4){if(_0x2071c4){_0x71f2df=_0x2071c4[_0x2ff9('0x51')];if(!_0x1a4e7c[_0x2ff9('0x34')]['hasOwnProperty'](_0x2ff9('0x39'))){_0x52b53d[_0x2ff9('0x25')]=qs[_0x2ff9('0x25')](_0x1a4e7c[_0x2ff9('0x34')][_0x2ff9('0x25')]);_0x52b53d[_0x2ff9('0x24')]=qs[_0x2ff9('0x24')](_0x1a4e7c[_0x2ff9('0x34')]['offset']);}return _0x587d8d[_0x2ff9('0x56')](_0x52b53d);}})[_0x2ff9('0x2b')](function(_0x390329){if(_0x390329){return _0x390329?{'count':_0x71f2df,'rows':_0x390329}:null;}})[_0x2ff9('0x2b')](respondWithResult(_0x5ce22b,null))[_0x2ff9('0x47')](handleError(_0x5ce22b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c824ed0..8c5d185 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 _0x65c2=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0xd684f9,_0x330657){var _0x13121c=function(_0x2401fd){while(--_0x2401fd){_0xd684f9['push'](_0xd684f9['shift']());}};_0x13121c(++_0x330657);}(_0x65c2,0x64));var _0x265c=function(_0xa0a978,_0x4b6956){_0xa0a978=_0xa0a978-0x0;var _0x4607f0=_0x65c2[_0xa0a978];return _0x4607f0;};'use strict';var _=require(_0x265c('0x0'));var util=require(_0x265c('0x1'));var logger=require('../../config/logger')(_0x265c('0x2'));var moment=require(_0x265c('0x3'));var BPromise=require(_0x265c('0x4'));var rp=require(_0x265c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x265c('0x6'));var attributes=require(_0x265c('0x7'));module[_0x265c('0x8')]=function(_0x5854e1,_0x5349cb){return _0x5854e1[_0x265c('0x9')](_0x265c('0xa'),attributes,{'tableName':_0x265c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93c4=['define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x54bd64,_0x142b58){var _0xdd9a9f=function(_0x29eae9){while(--_0x29eae9){_0x54bd64['push'](_0x54bd64['shift']());}};_0xdd9a9f(++_0x142b58);}(_0x93c4,0x1ca));var _0x493c=function(_0x3f011c,_0x55b6ee){_0x3f011c=_0x3f011c-0x0;var _0x50f28f=_0x93c4[_0x3f011c];return _0x50f28f;};'use strict';var _=require('lodash');var util=require(_0x493c('0x0'));var logger=require(_0x493c('0x1'))(_0x493c('0x2'));var moment=require('moment');var BPromise=require(_0x493c('0x3'));var rp=require(_0x493c('0x4'));var fs=require('fs');var path=require(_0x493c('0x5'));var rimraf=require(_0x493c('0x6'));var config=require(_0x493c('0x7'));var attributes=require(_0x493c('0x8'));module[_0x493c('0x9')]=function(_0x8307be,_0x4ec562){return _0x8307be[_0x493c('0xa')](_0x493c('0xb'),attributes,{'tableName':_0x493c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index b379558..58a0a0d 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x433125,_0x5a56b3){var _0x11ac9f=function(_0xd0e660){while(--_0xd0e660){_0x433125['push'](_0x433125['shift']());}};_0x11ac9f(++_0x5a56b3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7217,0x19e));var _0x7721=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7217[_0x12d033];return _0x3b4e80;};'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')]('SalesforceConfiguration,\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']('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 388fa55..763ee6a 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 _0x8593=['update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x3386c2,_0x524a26){var _0x15fa88=function(_0x3861b2){while(--_0x3861b2){_0x3386c2['push'](_0x3386c2['shift']());}};_0x15fa88(++_0x524a26);}(_0x8593,0x1b9));var _0x3859=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8593[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x3859('0x0'));var util=require(_0x3859('0x1'));var path=require(_0x3859('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3859('0x3')]();var auth=require(_0x3859('0x4'));var interaction=require(_0x3859('0x5'));var config=require(_0x3859('0x6'));var controller=require('./intSalesforceField.controller');router[_0x3859('0x7')]('/',auth[_0x3859('0x8')](),controller[_0x3859('0x9')]);router[_0x3859('0x7')](_0x3859('0xa'),auth[_0x3859('0x8')](),controller[_0x3859('0xb')]);router[_0x3859('0xc')]('/',auth['isAuthenticated'](),controller[_0x3859('0xd')]);router[_0x3859('0xe')](_0x3859('0xa'),auth[_0x3859('0x8')](),controller[_0x3859('0xf')]);router[_0x3859('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3859('0x11')]);module[_0x3859('0x12')]=router; \ No newline at end of file +var _0x5f9c=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','index','get','/:id','show','post','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f9c,0x1c6));var _0xc5f9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5f9c[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xc5f9('0x0'));var util=require(_0xc5f9('0x1'));var path=require(_0xc5f9('0x2'));var timeout=require(_0xc5f9('0x3'));var express=require('express');var router=express[_0xc5f9('0x4')]();var auth=require(_0xc5f9('0x5'));var interaction=require(_0xc5f9('0x6'));var config=require(_0xc5f9('0x7'));var controller=require(_0xc5f9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc5f9('0x9')]);router[_0xc5f9('0xa')](_0xc5f9('0xb'),auth['isAuthenticated'](),controller[_0xc5f9('0xc')]);router[_0xc5f9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc5f9('0xb'),auth[_0xc5f9('0xe')](),controller[_0xc5f9('0xf')]);router[_0xc5f9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc5f9('0x11')]);module[_0xc5f9('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 dac757f..6b3e44e 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 _0x6596=['customVariable','STRING','sequelize','ENUM','string','variable'];(function(_0x3356c3,_0x4a39d4){var _0x5c3cb6=function(_0xe02a7f){while(--_0xe02a7f){_0x3356c3['push'](_0x3356c3['shift']());}};_0x5c3cb6(++_0x4a39d4);}(_0x6596,0x15e));var _0x6659=function(_0x2fa918,_0x4d9d){_0x2fa918=_0x2fa918-0x0;var _0x464156=_0x6596[_0x2fa918];return _0x464156;};'use strict';var Sequelize=require(_0x6659('0x0'));module['exports']={'type':{'type':Sequelize[_0x6659('0x1')](_0x6659('0x2'),_0x6659('0x3'),_0x6659('0x4'),'keyValue'),'defaultValue':_0x6659('0x2')},'content':{'type':Sequelize[_0x6659('0x5')]},'key':{'type':Sequelize[_0x6659('0x5')]},'keyType':{'type':Sequelize[_0x6659('0x1')](_0x6659('0x2'),_0x6659('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x6659('0x5')]}}; \ No newline at end of file +var _0xb7a0=['string','keyValue','STRING','sequelize','ENUM'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0xb7a0,0x1c5));var _0x0b7a=function(_0x3613a5,_0x5b4a86){_0x3613a5=_0x3613a5-0x0;var _0xdf2117=_0xb7a0[_0x3613a5];return _0xdf2117;};'use strict';var Sequelize=require(_0x0b7a('0x0'));module['exports']={'type':{'type':Sequelize[_0x0b7a('0x1')](_0x0b7a('0x2'),'variable','customVariable',_0x0b7a('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0b7a('0x4')]},'keyType':{'type':Sequelize[_0x0b7a('0x1')](_0x0b7a('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x0b7a('0x4')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x0b7a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a8c6c29..5d3c807 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 _0x64a6=['save','then','destroy','error','stack','name','send','index','SalesforceField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','rows','catch','params','length','include','find','create','body','update','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x64a6,0x183));var _0x664a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x64a6[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0x664a('0x0'));var emlformat=require(_0x664a('0x1'));var rimraf=require(_0x664a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x664a('0x3'));var moment=require('moment');var BPromise=require(_0x664a('0x4'));var Mustache=require(_0x664a('0x5'));var util=require(_0x664a('0x6'));var path=require(_0x664a('0x7'));var sox=require(_0x664a('0x8'));var csv=require(_0x664a('0x9'));var ejs=require(_0x664a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x664a('0xb'));var crypto=require(_0x664a('0xc'));var jsforce=require(_0x664a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x664a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x664a('0xe'));var authService=require(_0x664a('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x664a('0x10'))('api');var utils=require(_0x664a('0x11'));var config=require(_0x664a('0x12'));var db=require(_0x664a('0x13'))['db'];function respondWithStatusCode(_0xfd5fad,_0x560e78){_0x560e78=_0x560e78||0xcc;return function(_0x241f55){if(_0x241f55){return _0xfd5fad[_0x664a('0x14')](_0x560e78);}return _0xfd5fad[_0x664a('0x15')](_0x560e78)[_0x664a('0x16')]();};}function respondWithResult(_0x2522d7,_0xd3b4d5){_0xd3b4d5=_0xd3b4d5||0xc8;return function(_0xd1a69d){if(_0xd1a69d){return _0x2522d7[_0x664a('0x15')](_0xd3b4d5)[_0x664a('0x17')](_0xd1a69d);}};}function respondWithFilteredResult(_0x3668b8,_0x389a11){return function(_0x2b32b3){if(_0x2b32b3){var _0x291561=_0x2b32b3[_0x664a('0x18')],_0x521aaf=_0x389a11[_0x664a('0x19')],_0x296262=_0x389a11[_0x664a('0x19')]+_0x389a11['limit'],_0x5316d4;if(_0x296262>=_0x291561){_0x296262=_0x291561;_0x5316d4=0xc8;}else{_0x5316d4=0xce;}_0x3668b8[_0x664a('0x15')](_0x5316d4);return _0x3668b8['set']('Content-Range',_0x521aaf+'-'+_0x296262+'/'+_0x291561)['json'](_0x2b32b3);}return null;};}function patchUpdates(_0x4cd119){return function(_0x548bf1){try{jsonpatch[_0x664a('0x1a')](_0x548bf1,_0x4cd119,!![]);}catch(_0x2e43a7){return BPromise['reject'](_0x2e43a7);}return _0x548bf1[_0x664a('0x1b')]();};}function saveUpdates(_0x43ca29,_0x5f5548){return function(_0x101e9c){if(_0x101e9c){return _0x101e9c['update'](_0x43ca29)[_0x664a('0x1c')](function(_0x45e008){return _0x45e008;});}return null;};}function removeEntity(_0x5bfefa,_0x2ad1c9){return function(_0xc57d63){if(_0xc57d63){return _0xc57d63[_0x664a('0x1d')]()[_0x664a('0x1c')](function(){_0x5bfefa[_0x664a('0x15')](0xcc)[_0x664a('0x16')]();});}};}function handleEntityNotFound(_0x5460e9,_0x2e7fe6){return function(_0x509bf0){if(!_0x509bf0){_0x5460e9[_0x664a('0x14')](0x194);}return _0x509bf0;};}function handleError(_0x124cb4,_0x158321){_0x158321=_0x158321||0x1f4;return function(_0x2b2228){logger[_0x664a('0x1e')](_0x2b2228[_0x664a('0x1f')]);if(_0x2b2228['name']){delete _0x2b2228[_0x664a('0x20')];}_0x124cb4[_0x664a('0x15')](_0x158321)[_0x664a('0x21')](_0x2b2228);};}exports[_0x664a('0x22')]=function(_0xbaf019,_0xc875a5){var _0x338e5b={},_0x1e8912={},_0x350641={'count':0x0,'rows':[]};var _0x5a3e22=db[_0x664a('0x23')][_0x664a('0x24')];_0x1e8912[_0x664a('0x25')]=_['keys'](_0x5a3e22);_0x1e8912[_0x664a('0x26')]=_[_0x664a('0x27')](_0xbaf019[_0x664a('0x26')]);_0x1e8912[_0x664a('0x28')]=_[_0x664a('0x29')](_0x1e8912['model'],_0x1e8912[_0x664a('0x26')]);_0x338e5b[_0x664a('0x2a')]=_[_0x664a('0x29')](_0x1e8912[_0x664a('0x25')],qs[_0x664a('0x2b')](_0xbaf019[_0x664a('0x26')]['fields']));_0x338e5b[_0x664a('0x2a')]=_0x338e5b['attributes']['length']?_0x338e5b['attributes']:_0x1e8912[_0x664a('0x25')];if(!_0xbaf019[_0x664a('0x26')][_0x664a('0x2c')](_0x664a('0x2d'))){_0x338e5b['limit']=qs[_0x664a('0x2e')](_0xbaf019[_0x664a('0x26')][_0x664a('0x2e')]);_0x338e5b[_0x664a('0x19')]=qs[_0x664a('0x19')](_0xbaf019[_0x664a('0x26')][_0x664a('0x19')]);}_0x338e5b[_0x664a('0x2f')]=qs[_0x664a('0x30')](_0xbaf019[_0x664a('0x26')]['sort']);_0x338e5b[_0x664a('0x31')]=qs[_0x664a('0x28')](_[_0x664a('0x32')](_0xbaf019[_0x664a('0x26')],_0x1e8912['filters']));if(_0xbaf019[_0x664a('0x26')][_0x664a('0x33')]){_0x338e5b[_0x664a('0x31')]=_[_0x664a('0x34')](_0x338e5b[_0x664a('0x31')],{'$or':_[_0x664a('0x35')](_0x5a3e22,function(_0x55b345){if(_0x55b345[_0x664a('0x36')][_0x664a('0x37')]!==_0x664a('0x38')){var _0x45ace0={};_0x45ace0[_0x55b345[_0x664a('0x39')]]={'$like':'%'+_0xbaf019['query']['filter']+'%'};return _0x45ace0;}})});}_0x338e5b=_['merge']({},_0x338e5b,_0xbaf019[_0x664a('0x3a')]);var _0xa845f9={'where':_0x338e5b[_0x664a('0x31')]};return db[_0x664a('0x23')][_0x664a('0x18')](_0xa845f9)[_0x664a('0x1c')](function(_0x3aa456){_0x350641[_0x664a('0x18')]=_0x3aa456;if(_0xbaf019[_0x664a('0x26')][_0x664a('0x3b')]){_0x338e5b['include']=[{'all':!![]}];}return db[_0x664a('0x23')]['findAll'](_0x338e5b);})[_0x664a('0x1c')](function(_0x163bf1){_0x350641[_0x664a('0x3c')]=_0x163bf1;return _0x350641;})['then'](respondWithFilteredResult(_0xc875a5,_0x338e5b))[_0x664a('0x3d')](handleError(_0xc875a5,null));};exports['show']=function(_0x29523b,_0x1afb56){var _0x1f03dc={'raw':!![],'where':{'id':_0x29523b[_0x664a('0x3e')]['id']}},_0x45d360={};_0x45d360[_0x664a('0x25')]=_[_0x664a('0x27')](db[_0x664a('0x23')]['rawAttributes']);_0x45d360[_0x664a('0x26')]=_[_0x664a('0x27')](_0x29523b[_0x664a('0x26')]);_0x45d360['filters']=_[_0x664a('0x29')](_0x45d360[_0x664a('0x25')],_0x45d360['query']);_0x1f03dc['attributes']=_[_0x664a('0x29')](_0x45d360['model'],qs[_0x664a('0x2b')](_0x29523b[_0x664a('0x26')][_0x664a('0x2b')]));_0x1f03dc['attributes']=_0x1f03dc[_0x664a('0x2a')][_0x664a('0x3f')]?_0x1f03dc[_0x664a('0x2a')]:_0x45d360[_0x664a('0x25')];if(_0x29523b[_0x664a('0x26')][_0x664a('0x3b')]){_0x1f03dc[_0x664a('0x40')]=[{'all':!![]}];}_0x1f03dc=_[_0x664a('0x34')]({},_0x1f03dc,_0x29523b[_0x664a('0x3a')]);return db[_0x664a('0x23')][_0x664a('0x41')](_0x1f03dc)[_0x664a('0x1c')](handleEntityNotFound(_0x1afb56,null))[_0x664a('0x1c')](respondWithResult(_0x1afb56,null))[_0x664a('0x3d')](handleError(_0x1afb56,null));};exports[_0x664a('0x42')]=function(_0x46bfa9,_0x272165){return db[_0x664a('0x23')][_0x664a('0x42')](_0x46bfa9[_0x664a('0x43')],{})['then'](respondWithResult(_0x272165,0xc9))[_0x664a('0x3d')](handleError(_0x272165,null));};exports[_0x664a('0x44')]=function(_0x5f3def,_0x16b211){if(_0x5f3def[_0x664a('0x43')]['id']){delete _0x5f3def[_0x664a('0x43')]['id'];}return db[_0x664a('0x23')]['find']({'where':{'id':_0x5f3def[_0x664a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x16b211,null))[_0x664a('0x1c')](saveUpdates(_0x5f3def[_0x664a('0x43')],null))[_0x664a('0x1c')](respondWithResult(_0x16b211,null))[_0x664a('0x3d')](handleError(_0x16b211,null));};exports[_0x664a('0x1d')]=function(_0x575f7e,_0x4429bc){return db[_0x664a('0x23')][_0x664a('0x41')]({'where':{'id':_0x575f7e[_0x664a('0x3e')]['id']}})[_0x664a('0x1c')](handleEntityNotFound(_0x4429bc,null))['then'](removeEntity(_0x4429bc,null))[_0x664a('0x3d')](handleError(_0x4429bc,null));}; \ No newline at end of file +var _0x8ca2=['show','params','find','update','body','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','limit','set','json','reject','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','SalesforceField','includeAll','include','findAll','rows','catch'];(function(_0x252229,_0x10180a){var _0x4bdb72=function(_0x217ac2){while(--_0x217ac2){_0x252229['push'](_0x252229['shift']());}};_0x4bdb72(++_0x10180a);}(_0x8ca2,0x109));var _0x28ca=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x8ca2[_0x2763f2];return _0x3ef471;};'use strict';var pdf=require(_0x28ca('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x28ca('0x1'));var jsonpatch=require(_0x28ca('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x28ca('0x3'));var Mustache=require(_0x28ca('0x4'));var util=require(_0x28ca('0x5'));var path=require(_0x28ca('0x6'));var sox=require(_0x28ca('0x7'));var csv=require(_0x28ca('0x8'));var ejs=require(_0x28ca('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x28ca('0xa'));var crypto=require(_0x28ca('0xb'));var jsforce=require(_0x28ca('0xc'));var deskjs=require(_0x28ca('0xd'));var toCsv=require(_0x28ca('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x28ca('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x28ca('0xf'));var logger=require(_0x28ca('0x10'))(_0x28ca('0x11'));var utils=require(_0x28ca('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c9237,_0x48cdd4){_0x48cdd4=_0x48cdd4||0xcc;return function(_0x52504d){if(_0x52504d){return _0x4c9237[_0x28ca('0x13')](_0x48cdd4);}return _0x4c9237[_0x28ca('0x14')](_0x48cdd4)[_0x28ca('0x15')]();};}function respondWithResult(_0x5a50e5,_0x3a9175){_0x3a9175=_0x3a9175||0xc8;return function(_0x4ff0d7){if(_0x4ff0d7){return _0x5a50e5[_0x28ca('0x14')](_0x3a9175)['json'](_0x4ff0d7);}};}function respondWithFilteredResult(_0x292a87,_0x3231cb){return function(_0x30fe65){if(_0x30fe65){var _0x58ce66=_0x30fe65['count'],_0x122d01=_0x3231cb[_0x28ca('0x16')],_0x13935e=_0x3231cb[_0x28ca('0x16')]+_0x3231cb[_0x28ca('0x17')],_0x275060;if(_0x13935e>=_0x58ce66){_0x13935e=_0x58ce66;_0x275060=0xc8;}else{_0x275060=0xce;}_0x292a87[_0x28ca('0x14')](_0x275060);return _0x292a87[_0x28ca('0x18')]('Content-Range',_0x122d01+'-'+_0x13935e+'/'+_0x58ce66)[_0x28ca('0x19')](_0x30fe65);}return null;};}function patchUpdates(_0x66af66){return function(_0x2c10ec){try{jsonpatch['apply'](_0x2c10ec,_0x66af66,!![]);}catch(_0x2e9793){return BPromise[_0x28ca('0x1a')](_0x2e9793);}return _0x2c10ec['save']();};}function saveUpdates(_0x3f8b90,_0x402bb9){return function(_0xaf9035){if(_0xaf9035){return _0xaf9035['update'](_0x3f8b90)[_0x28ca('0x1b')](function(_0x53fa5d){return _0x53fa5d;});}return null;};}function removeEntity(_0x6cb1fb,_0x37faf0){return function(_0x2b16c1){if(_0x2b16c1){return _0x2b16c1[_0x28ca('0x1c')]()[_0x28ca('0x1b')](function(){_0x6cb1fb[_0x28ca('0x14')](0xcc)[_0x28ca('0x15')]();});}};}function handleEntityNotFound(_0x126371,_0x49d3da){return function(_0x58f9f1){if(!_0x58f9f1){_0x126371[_0x28ca('0x13')](0x194);}return _0x58f9f1;};}function handleError(_0x32d7d2,_0x565978){_0x565978=_0x565978||0x1f4;return function(_0x4970b3){logger[_0x28ca('0x1d')](_0x4970b3[_0x28ca('0x1e')]);if(_0x4970b3[_0x28ca('0x1f')]){delete _0x4970b3[_0x28ca('0x1f')];}_0x32d7d2[_0x28ca('0x14')](_0x565978)['send'](_0x4970b3);};}exports[_0x28ca('0x20')]=function(_0x20358b,_0x455818){var _0x12a7fc={},_0x173de5={},_0x42ab1d={'count':0x0,'rows':[]};var _0x24462c=db['SalesforceField'][_0x28ca('0x21')];_0x173de5[_0x28ca('0x22')]=_[_0x28ca('0x23')](_0x24462c);_0x173de5[_0x28ca('0x24')]=_['keys'](_0x20358b[_0x28ca('0x24')]);_0x173de5['filters']=_['intersection'](_0x173de5[_0x28ca('0x22')],_0x173de5['query']);_0x12a7fc['attributes']=_[_0x28ca('0x25')](_0x173de5[_0x28ca('0x22')],qs[_0x28ca('0x26')](_0x20358b[_0x28ca('0x24')][_0x28ca('0x26')]));_0x12a7fc[_0x28ca('0x27')]=_0x12a7fc['attributes'][_0x28ca('0x28')]?_0x12a7fc[_0x28ca('0x27')]:_0x173de5[_0x28ca('0x22')];if(!_0x20358b['query'][_0x28ca('0x29')]('nolimit')){_0x12a7fc[_0x28ca('0x17')]=qs[_0x28ca('0x17')](_0x20358b['query'][_0x28ca('0x17')]);_0x12a7fc[_0x28ca('0x16')]=qs[_0x28ca('0x16')](_0x20358b['query'][_0x28ca('0x16')]);}_0x12a7fc[_0x28ca('0x2a')]=qs[_0x28ca('0x2b')](_0x20358b[_0x28ca('0x24')][_0x28ca('0x2b')]);_0x12a7fc[_0x28ca('0x2c')]=qs[_0x28ca('0x2d')](_[_0x28ca('0x2e')](_0x20358b['query'],_0x173de5[_0x28ca('0x2d')]));if(_0x20358b[_0x28ca('0x24')][_0x28ca('0x2f')]){_0x12a7fc[_0x28ca('0x2c')]=_[_0x28ca('0x30')](_0x12a7fc[_0x28ca('0x2c')],{'$or':_['map'](_0x24462c,function(_0x542f86){if(_0x542f86[_0x28ca('0x31')][_0x28ca('0x32')]!==_0x28ca('0x33')){var _0x3f031d={};_0x3f031d[_0x542f86[_0x28ca('0x34')]]={'$like':'%'+_0x20358b[_0x28ca('0x24')][_0x28ca('0x2f')]+'%'};return _0x3f031d;}})});}_0x12a7fc=_[_0x28ca('0x30')]({},_0x12a7fc,_0x20358b[_0x28ca('0x35')]);var _0x5d0047={'where':_0x12a7fc[_0x28ca('0x2c')]};return db[_0x28ca('0x36')]['count'](_0x5d0047)[_0x28ca('0x1b')](function(_0x1fb74b){_0x42ab1d['count']=_0x1fb74b;if(_0x20358b['query'][_0x28ca('0x37')]){_0x12a7fc[_0x28ca('0x38')]=[{'all':!![]}];}return db['SalesforceField'][_0x28ca('0x39')](_0x12a7fc);})[_0x28ca('0x1b')](function(_0x389426){_0x42ab1d[_0x28ca('0x3a')]=_0x389426;return _0x42ab1d;})['then'](respondWithFilteredResult(_0x455818,_0x12a7fc))[_0x28ca('0x3b')](handleError(_0x455818,null));};exports[_0x28ca('0x3c')]=function(_0x343b19,_0xa8db22){var _0x35bc33={'raw':!![],'where':{'id':_0x343b19[_0x28ca('0x3d')]['id']}},_0x58e0d8={};_0x58e0d8[_0x28ca('0x22')]=_[_0x28ca('0x23')](db[_0x28ca('0x36')]['rawAttributes']);_0x58e0d8[_0x28ca('0x24')]=_[_0x28ca('0x23')](_0x343b19['query']);_0x58e0d8[_0x28ca('0x2d')]=_[_0x28ca('0x25')](_0x58e0d8[_0x28ca('0x22')],_0x58e0d8[_0x28ca('0x24')]);_0x35bc33[_0x28ca('0x27')]=_[_0x28ca('0x25')](_0x58e0d8['model'],qs[_0x28ca('0x26')](_0x343b19[_0x28ca('0x24')]['fields']));_0x35bc33[_0x28ca('0x27')]=_0x35bc33[_0x28ca('0x27')]['length']?_0x35bc33[_0x28ca('0x27')]:_0x58e0d8[_0x28ca('0x22')];if(_0x343b19['query'][_0x28ca('0x37')]){_0x35bc33[_0x28ca('0x38')]=[{'all':!![]}];}_0x35bc33=_[_0x28ca('0x30')]({},_0x35bc33,_0x343b19[_0x28ca('0x35')]);return db[_0x28ca('0x36')][_0x28ca('0x3e')](_0x35bc33)[_0x28ca('0x1b')](handleEntityNotFound(_0xa8db22,null))[_0x28ca('0x1b')](respondWithResult(_0xa8db22,null))[_0x28ca('0x3b')](handleError(_0xa8db22,null));};exports['create']=function(_0x52af24,_0x57f35d){return db[_0x28ca('0x36')]['create'](_0x52af24['body'],{})[_0x28ca('0x1b')](respondWithResult(_0x57f35d,0xc9))['catch'](handleError(_0x57f35d,null));};exports[_0x28ca('0x3f')]=function(_0x43d3f0,_0x306d35){if(_0x43d3f0[_0x28ca('0x40')]['id']){delete _0x43d3f0[_0x28ca('0x40')]['id'];}return db[_0x28ca('0x36')][_0x28ca('0x3e')]({'where':{'id':_0x43d3f0[_0x28ca('0x3d')]['id']}})['then'](handleEntityNotFound(_0x306d35,null))[_0x28ca('0x1b')](saveUpdates(_0x43d3f0['body'],null))['then'](respondWithResult(_0x306d35,null))[_0x28ca('0x3b')](handleError(_0x306d35,null));};exports[_0x28ca('0x1c')]=function(_0x377159,_0x2023fc){return db[_0x28ca('0x36')][_0x28ca('0x3e')]({'where':{'id':_0x377159['params']['id']}})[_0x28ca('0x1b')](handleEntityNotFound(_0x2023fc,null))[_0x28ca('0x1b')](removeEntity(_0x2023fc,null))[_0x28ca('0x3b')](handleError(_0x2023fc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c2faf41..2541f9e 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 _0x15d2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','idField','lodash'];(function(_0x1b22e3,_0xe57c37){var _0x2e7c89=function(_0x3eba90){while(--_0x3eba90){_0x1b22e3['push'](_0x1b22e3['shift']());}};_0x2e7c89(++_0xe57c37);}(_0x15d2,0x15b));var _0x215d=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x15d2[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x215d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x215d('0x1'));var BPromise=require(_0x215d('0x2'));var rp=require(_0x215d('0x3'));var fs=require('fs');var path=require(_0x215d('0x4'));var rimraf=require(_0x215d('0x5'));var config=require(_0x215d('0x6'));var attributes=require(_0x215d('0x7'));module[_0x215d('0x8')]=function(_0x5ec75f,_0x2b30b8){return _0x5ec75f['define'](_0x215d('0x9'),attributes,{'tableName':_0x215d('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x215d('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb66d=['int_salesforce_fields','salesforce_unique_index','idField','lodash','util','moment','bluebird','path','exports','define'];(function(_0x20f220,_0x6d9b43){var _0xa45fc8=function(_0x4baaad){while(--_0x4baaad){_0x20f220['push'](_0x20f220['shift']());}};_0xa45fc8(++_0x6d9b43);}(_0xb66d,0x11b));var _0xdb66=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xb66d[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xdb66('0x0'));var util=require(_0xdb66('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdb66('0x2'));var BPromise=require(_0xdb66('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb66('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xdb66('0x5')]=function(_0x1c6ab0,_0xa91be8){return _0x1c6ab0[_0xdb66('0x6')]('SalesforceField',attributes,{'tableName':_0xdb66('0x7'),'paranoid':![],'indexes':[{'name':_0xdb66('0x8'),'fields':[_0xdb66('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 1e076f0..b0d3ebb 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 _0x4efe=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x430ee3,_0x3db811){var _0x37220e=function(_0x5e96d8){while(--_0x5e96d8){_0x430ee3['push'](_0x430ee3['shift']());}};_0x37220e(++_0x3db811);}(_0x4efe,0x19c));var _0xe4ef=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x4efe[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xe4ef('0x0'));var util=require('util');var moment=require(_0xe4ef('0x1'));var BPromise=require(_0xe4ef('0x2'));var rs=require(_0xe4ef('0x3'));var fs=require('fs');var Redis=require(_0xe4ef('0x4'));var db=require(_0xe4ef('0x5'))['db'];var utils=require(_0xe4ef('0x6'));var logger=require(_0xe4ef('0x7'))('rpc');var config=require(_0xe4ef('0x8'));var jayson=require(_0xe4ef('0x9'));var client=jayson[_0xe4ef('0xa')][_0xe4ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa3a88a,_0x180caa,_0x45b950){return new BPromise(function(_0x35c110,_0x4befef){return client[_0xe4ef('0xc')](_0xa3a88a,_0x45b950)[_0xe4ef('0xd')](function(_0x59477d){logger[_0xe4ef('0xe')]('SalesforceField,\x20%s,\x20%s',_0x180caa,_0xe4ef('0xf'));logger[_0xe4ef('0x10')](_0xe4ef('0x11'),_0x180caa,_0xe4ef('0xf'),JSON['stringify'](_0x59477d));if(_0x59477d[_0xe4ef('0x12')]){if(_0x59477d[_0xe4ef('0x12')]['code']===0x1f4){logger[_0xe4ef('0x12')](_0xe4ef('0x13'),_0x180caa,_0x59477d['error']['message']);return _0x4befef(_0x59477d[_0xe4ef('0x12')][_0xe4ef('0x14')]);}logger[_0xe4ef('0x12')](_0xe4ef('0x13'),_0x180caa,_0x59477d['error'][_0xe4ef('0x14')]);return _0x35c110(_0x59477d['error']['message']);}else{logger[_0xe4ef('0xe')](_0xe4ef('0x13'),_0x180caa,_0xe4ef('0xf'));_0x35c110(_0x59477d[_0xe4ef('0x15')][_0xe4ef('0x14')]);}})[_0xe4ef('0x16')](function(_0x517fe0){logger[_0xe4ef('0x12')]('SalesforceField,\x20%s,\x20%s',_0x180caa,_0x517fe0);_0x4befef(_0x517fe0);});});} \ No newline at end of file +var _0x22ed=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x28b901,_0x2d1369){var _0x2262c8=function(_0x567760){while(--_0x567760){_0x28b901['push'](_0x28b901['shift']());}};_0x2262c8(++_0x2d1369);}(_0x22ed,0x75));var _0xd22e=function(_0x4aec15,_0x5907af){_0x4aec15=_0x4aec15-0x0;var _0x226914=_0x22ed[_0x4aec15];return _0x226914;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require(_0xd22e('0x2'));var BPromise=require(_0xd22e('0x3'));var rs=require(_0xd22e('0x4'));var fs=require('fs');var Redis=require(_0xd22e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd22e('0x6'));var logger=require(_0xd22e('0x7'))(_0xd22e('0x8'));var config=require(_0xd22e('0x9'));var jayson=require(_0xd22e('0xa'));var client=jayson[_0xd22e('0xb')][_0xd22e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4be45e,_0x162768,_0x380381){return new BPromise(function(_0x12b890,_0x2173ad){return client['request'](_0x4be45e,_0x380381)[_0xd22e('0xd')](function(_0x475ef0){logger[_0xd22e('0xe')](_0xd22e('0xf'),_0x162768,_0xd22e('0x10'));logger[_0xd22e('0x11')](_0xd22e('0x12'),_0x162768,_0xd22e('0x10'),JSON[_0xd22e('0x13')](_0x475ef0));if(_0x475ef0['error']){if(_0x475ef0[_0xd22e('0x14')][_0xd22e('0x15')]===0x1f4){logger[_0xd22e('0x14')]('SalesforceField,\x20%s,\x20%s',_0x162768,_0x475ef0['error'][_0xd22e('0x16')]);return _0x2173ad(_0x475ef0[_0xd22e('0x14')][_0xd22e('0x16')]);}logger['error'](_0xd22e('0xf'),_0x162768,_0x475ef0[_0xd22e('0x14')][_0xd22e('0x16')]);return _0x12b890(_0x475ef0[_0xd22e('0x14')][_0xd22e('0x16')]);}else{logger[_0xd22e('0xe')](_0xd22e('0xf'),_0x162768,'request\x20sent');_0x12b890(_0x475ef0['result'][_0xd22e('0x16')]);}})['catch'](function(_0x4dd3ab){logger[_0xd22e('0x14')](_0xd22e('0xf'),_0x162768,_0x4dd3ab);_0x2173ad(_0x4dd3ab);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 479dbdd..cf1f39f 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 _0x123b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','destroy','exports'];(function(_0x31f00e,_0x1c2a7d){var _0x3d63d4=function(_0x44d5cb){while(--_0x44d5cb){_0x31f00e['push'](_0x31f00e['shift']());}};_0x3d63d4(++_0x1c2a7d);}(_0x123b,0x170));var _0xb123=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x123b[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0xb123('0x0'));var util=require(_0xb123('0x1'));var path=require(_0xb123('0x2'));var timeout=require(_0xb123('0x3'));var express=require(_0xb123('0x4'));var router=express[_0xb123('0x5')]();var auth=require(_0xb123('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb123('0x7'));var controller=require(_0xb123('0x8'));router[_0xb123('0x9')]('/',auth[_0xb123('0xa')](),controller[_0xb123('0xb')]);router[_0xb123('0x9')]('/:id',auth[_0xb123('0xa')](),controller['show']);router[_0xb123('0x9')](_0xb123('0xc'),auth[_0xb123('0xa')](),controller[_0xb123('0xd')]);router[_0xb123('0x9')](_0xb123('0xe'),auth[_0xb123('0xa')](),controller[_0xb123('0xf')]);router[_0xb123('0x10')]('/',auth[_0xb123('0xa')](),controller[_0xb123('0x11')]);router[_0xb123('0x10')](_0xb123('0xc'),auth['isAuthenticated'](),controller[_0xb123('0x12')]);router['put'](_0xb123('0x13'),auth[_0xb123('0xa')](),controller[_0xb123('0x14')]);router['delete'](_0xb123('0x13'),auth[_0xb123('0xa')](),controller[_0xb123('0x15')]);module[_0xb123('0x16')]=router; \ No newline at end of file +var _0xfa3e=['put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration'];(function(_0x101176,_0x1ad975){var _0x4ec27c=function(_0x13b7bb){while(--_0x13b7bb){_0x101176['push'](_0x101176['shift']());}};_0x4ec27c(++_0x1ad975);}(_0xfa3e,0xe0));var _0xefa3=function(_0x3f408f,_0x137601){_0x3f408f=_0x3f408f-0x0;var _0x26cd5b=_0xfa3e[_0x3f408f];return _0x26cd5b;};'use strict';var multer=require(_0xefa3('0x0'));var util=require(_0xefa3('0x1'));var path=require('path');var timeout=require(_0xefa3('0x2'));var express=require(_0xefa3('0x3'));var router=express[_0xefa3('0x4')]();var auth=require(_0xefa3('0x5'));var interaction=require(_0xefa3('0x6'));var config=require(_0xefa3('0x7'));var controller=require(_0xefa3('0x8'));router[_0xefa3('0x9')]('/',auth[_0xefa3('0xa')](),controller['index']);router['get'](_0xefa3('0xb'),auth[_0xefa3('0xa')](),controller[_0xefa3('0xc')]);router[_0xefa3('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xefa3('0xd')]);router[_0xefa3('0x9')](_0xefa3('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xefa3('0xf')]('/',auth[_0xefa3('0xa')](),controller[_0xefa3('0x10')]);router[_0xefa3('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xefa3('0x11')]);router[_0xefa3('0x12')](_0xefa3('0xb'),auth['isAuthenticated'](),controller[_0xefa3('0x13')]);router[_0xefa3('0x14')](_0xefa3('0xb'),auth['isAuthenticated'](),controller[_0xefa3('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 27b0a96..8a34378 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 _0x91a7=['exports','STRING','username'];(function(_0x8ef83d,_0x520c3d){var _0x4a4a19=function(_0x189336){while(--_0x189336){_0x8ef83d['push'](_0x8ef83d['shift']());}};_0x4a4a19(++_0x520c3d);}(_0x91a7,0xe7));var _0x791a=function(_0x59ec7a,_0x1eb345){_0x59ec7a=_0x59ec7a-0x0;var _0x8535ed=_0x91a7[_0x59ec7a];return _0x8535ed;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x791a('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x791a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file +var _0xd64b=['username','sequelize','STRING'];(function(_0x21c2b4,_0x2636a3){var _0x392735=function(_0x2e74b4){while(--_0x2e74b4){_0x21c2b4['push'](_0x21c2b4['shift']());}};_0x392735(++_0x2636a3);}(_0xd64b,0xc1));var _0xbd64=function(_0x41749a,_0x4106f4){_0x41749a=_0x41749a-0x0;var _0x4c0505=_0xd64b[_0x41749a];return _0x4c0505;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbd64('0x1')],'unique':_0xbd64('0x2')},'password':{'type':Sequelize[_0xbd64('0x1')]},'email':{'type':Sequelize[_0xbd64('0x1')]},'remoteUri':{'type':Sequelize[_0xbd64('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 620685f..d4fa33e 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 _0x3da5=['rows','show','params','fields','includeAll','find','create','body','getConfigurations','ServicenowConfiguration','pick','map','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','ServicenowField','getFields','hold_reason','knowledge','close_code','notify','category','watch_list','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','business_stc','additional_assignee_list','description','calendar_duration','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','activity_due','assigned_to','severity','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','escalation','upon_approval','location','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','password','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','statusCode','Wrong\x20credentials','boolean','True','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','count','offset','limit','Content-Range','reject','update','destroy','sendStatus','stack','name','send','index','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','include','findAll'];(function(_0x1e0bf3,_0x51152b){var _0xce3f=function(_0x32a5a0){while(--_0x32a5a0){_0x1e0bf3['push'](_0x1e0bf3['shift']());}};_0xce3f(++_0x51152b);}(_0x3da5,0x131));var _0x53da=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3da5[_0x2be8c2];return _0x97f531;};'use strict';var pdf=require(_0x53da('0x0'));var emlformat=require(_0x53da('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x53da('0x2'));var jsonpatch=require(_0x53da('0x3'));var rp=require(_0x53da('0x4'));var moment=require(_0x53da('0x5'));var BPromise=require(_0x53da('0x6'));var Mustache=require(_0x53da('0x7'));var util=require(_0x53da('0x8'));var path=require('path');var sox=require(_0x53da('0x9'));var csv=require(_0x53da('0xa'));var ejs=require(_0x53da('0xb'));var fs=require('fs');var _=require(_0x53da('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x53da('0xa'));var querystring=require(_0x53da('0xe'));var Papa=require(_0x53da('0xf'));var Redis=require(_0x53da('0x10'));var authService=require(_0x53da('0x11'));var qs=require(_0x53da('0x12'));var hardwareService=require(_0x53da('0x13'));var logger=require(_0x53da('0x14'))(_0x53da('0x15'));var utils=require(_0x53da('0x16'));var config=require('../../config/environment');var db=require(_0x53da('0x17'))['db'];var integrations=require(_0x53da('0x18'));var jayson=require(_0x53da('0x19'));var client=jayson[_0x53da('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x439df3,_0x30db08,_0x10c9b7){if(_0x10c9b7){var _0x3f5115=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f5115[_0x53da('0x1b')](_0x30db08)){return _0x439df3;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x439df3;}}function respondWithRpcPromise(_0x19bfe9,_0x3a44d3,_0x404c5a,_0x4e1f08){return new BPromise(function(_0x2e2d49,_0x1df497){var _0x41ee8f=_0x4e1f08||client;return _0x41ee8f[_0x53da('0x1c')](_0x19bfe9,_0x404c5a)[_0x53da('0x1d')](function(_0x20699f){logger[_0x53da('0x1e')](_0x53da('0x1f'),_0x3a44d3,_0x53da('0x20'));logger[_0x53da('0x21')](_0x53da('0x22'),_0x3a44d3,'request\x20sent',JSON['stringify'](_0x20699f));if(_0x20699f[_0x53da('0x23')]){if(_0x20699f[_0x53da('0x23')][_0x53da('0x24')]===0x1f4){logger[_0x53da('0x23')](_0x53da('0x1f'),_0x3a44d3,_0x20699f['error']['message']);return _0x1df497(_0x20699f[_0x53da('0x23')][_0x53da('0x25')]);}logger[_0x53da('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0x3a44d3,_0x20699f[_0x53da('0x23')][_0x53da('0x25')]);return _0x2e2d49(_0x20699f[_0x53da('0x23')][_0x53da('0x25')]);}else{logger['info'](_0x53da('0x1f'),_0x3a44d3,_0x53da('0x20'));_0x2e2d49(_0x20699f[_0x53da('0x26')]['message']);}})[_0x53da('0x27')](function(_0x1371e8){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x3a44d3,_0x1371e8);_0x1df497(_0x1371e8);});});}function respondWithStatusCode(_0x287403,_0x580f99){_0x580f99=_0x580f99||0xcc;return function(_0x4b9518){if(_0x4b9518){return _0x287403['sendStatus'](_0x580f99);}return _0x287403['status'](_0x580f99)[_0x53da('0x28')]();};}function respondWithResult(_0x16835f,_0x194741){_0x194741=_0x194741||0xc8;return function(_0x2b642c){if(_0x2b642c){return _0x16835f[_0x53da('0x29')](_0x194741)[_0x53da('0x2a')](_0x2b642c);}};}function respondWithFilteredResult(_0x3d78ba,_0x57108a){return function(_0xe9b572){if(_0xe9b572){var _0x4afbf2=_0xe9b572[_0x53da('0x2b')],_0x4a382a=_0x57108a[_0x53da('0x2c')],_0x3cdbc8=_0x57108a[_0x53da('0x2c')]+_0x57108a[_0x53da('0x2d')],_0xf63285;if(_0x3cdbc8>=_0x4afbf2){_0x3cdbc8=_0x4afbf2;_0xf63285=0xc8;}else{_0xf63285=0xce;}_0x3d78ba[_0x53da('0x29')](_0xf63285);return _0x3d78ba['set'](_0x53da('0x2e'),_0x4a382a+'-'+_0x3cdbc8+'/'+_0x4afbf2)[_0x53da('0x2a')](_0xe9b572);}return null;};}function patchUpdates(_0x4ab627){return function(_0x581a3b){try{jsonpatch['apply'](_0x581a3b,_0x4ab627,!![]);}catch(_0x1f4cd2){return BPromise[_0x53da('0x2f')](_0x1f4cd2);}return _0x581a3b['save']();};}function saveUpdates(_0x1d0c07,_0x159260){return function(_0x52f695){if(_0x52f695){return _0x52f695[_0x53da('0x30')](_0x1d0c07)[_0x53da('0x1d')](function(_0x14258b){return _0x14258b;});}return null;};}function removeEntity(_0x3b67ad,_0x4834b2){return function(_0x221f5f){if(_0x221f5f){return _0x221f5f[_0x53da('0x31')]()[_0x53da('0x1d')](function(){_0x3b67ad['status'](0xcc)[_0x53da('0x28')]();});}};}function handleEntityNotFound(_0x22ab40,_0x2082ac){return function(_0x4f07ba){if(!_0x4f07ba){_0x22ab40[_0x53da('0x32')](0x194);}return _0x4f07ba;};}function handleError(_0x280d29,_0x284614){_0x284614=_0x284614||0x1f4;return function(_0x2dd75e){logger[_0x53da('0x23')](_0x2dd75e[_0x53da('0x33')]);if(_0x2dd75e[_0x53da('0x34')]){delete _0x2dd75e[_0x53da('0x34')];}_0x280d29[_0x53da('0x29')](_0x284614)[_0x53da('0x35')](_0x2dd75e);};}exports[_0x53da('0x36')]=function(_0x652ef1,_0x25a9c5){var _0x2a1a03={},_0x3da5e4={},_0x28b425={'count':0x0,'rows':[]};var _0x5b1e53=db[_0x53da('0x37')][_0x53da('0x38')];_0x3da5e4[_0x53da('0x39')]=_[_0x53da('0x3a')](_0x5b1e53);_0x3da5e4['query']=_['keys'](_0x652ef1[_0x53da('0x3b')]);_0x3da5e4[_0x53da('0x3c')]=_[_0x53da('0x3d')](_0x3da5e4['model'],_0x3da5e4['query']);_0x2a1a03[_0x53da('0x3e')]=_[_0x53da('0x3d')](_0x3da5e4['model'],qs['fields'](_0x652ef1[_0x53da('0x3b')]['fields']));_0x2a1a03[_0x53da('0x3e')]=_0x2a1a03[_0x53da('0x3e')][_0x53da('0x3f')]?_0x2a1a03[_0x53da('0x3e')]:_0x3da5e4[_0x53da('0x39')];if(!_0x652ef1[_0x53da('0x3b')]['hasOwnProperty'](_0x53da('0x40'))){_0x2a1a03[_0x53da('0x2d')]=qs[_0x53da('0x2d')](_0x652ef1[_0x53da('0x3b')][_0x53da('0x2d')]);_0x2a1a03[_0x53da('0x2c')]=qs[_0x53da('0x2c')](_0x652ef1[_0x53da('0x3b')][_0x53da('0x2c')]);}_0x2a1a03[_0x53da('0x41')]=qs[_0x53da('0x42')](_0x652ef1[_0x53da('0x3b')][_0x53da('0x42')]);_0x2a1a03[_0x53da('0x43')]=qs['filters'](_['pick'](_0x652ef1[_0x53da('0x3b')],_0x3da5e4['filters']));if(_0x652ef1[_0x53da('0x3b')][_0x53da('0x44')]){_0x2a1a03[_0x53da('0x43')]=_[_0x53da('0x45')](_0x2a1a03[_0x53da('0x43')],{'$or':_['map'](_0x5b1e53,function(_0x48a7c6){if(_0x48a7c6[_0x53da('0x46')][_0x53da('0x47')]!==_0x53da('0x48')){var _0x2146a7={};_0x2146a7[_0x48a7c6[_0x53da('0x49')]]={'$like':'%'+_0x652ef1[_0x53da('0x3b')][_0x53da('0x44')]+'%'};return _0x2146a7;}})});}_0x2a1a03=_[_0x53da('0x45')]({},_0x2a1a03,_0x652ef1[_0x53da('0x4a')]);var _0x240159={'where':_0x2a1a03['where']};return db[_0x53da('0x37')][_0x53da('0x2b')](_0x240159)[_0x53da('0x1d')](function(_0x37e181){_0x28b425[_0x53da('0x2b')]=_0x37e181;if(_0x652ef1[_0x53da('0x3b')]['includeAll']){_0x2a1a03[_0x53da('0x4b')]=[{'all':!![]}];}return db[_0x53da('0x37')][_0x53da('0x4c')](_0x2a1a03);})['then'](function(_0x449e15){_0x28b425[_0x53da('0x4d')]=_0x449e15;return _0x28b425;})[_0x53da('0x1d')](respondWithFilteredResult(_0x25a9c5,_0x2a1a03))[_0x53da('0x27')](handleError(_0x25a9c5,null));};exports[_0x53da('0x4e')]=function(_0x1dc18b,_0x54a415){var _0x1ade39={'raw':![],'where':{'id':_0x1dc18b[_0x53da('0x4f')]['id']}},_0x3397f6={};_0x3397f6[_0x53da('0x39')]=_[_0x53da('0x3a')](db[_0x53da('0x37')][_0x53da('0x38')]);_0x3397f6[_0x53da('0x3b')]=_[_0x53da('0x3a')](_0x1dc18b[_0x53da('0x3b')]);_0x3397f6['filters']=_[_0x53da('0x3d')](_0x3397f6[_0x53da('0x39')],_0x3397f6[_0x53da('0x3b')]);_0x1ade39[_0x53da('0x3e')]=_[_0x53da('0x3d')](_0x3397f6[_0x53da('0x39')],qs['fields'](_0x1dc18b[_0x53da('0x3b')][_0x53da('0x50')]));_0x1ade39['attributes']=_0x1ade39[_0x53da('0x3e')]['length']?_0x1ade39['attributes']:_0x3397f6['model'];if(_0x1dc18b['query'][_0x53da('0x51')]){_0x1ade39[_0x53da('0x4b')]=[{'all':!![]}];}_0x1ade39=_[_0x53da('0x45')]({},_0x1ade39,_0x1dc18b[_0x53da('0x4a')]);return db[_0x53da('0x37')][_0x53da('0x52')](_0x1ade39)[_0x53da('0x1d')](handleEntityNotFound(_0x54a415,null))['then'](respondWithResult(_0x54a415,null))[_0x53da('0x27')](handleError(_0x54a415,null));};exports[_0x53da('0x53')]=function(_0x1f05e4,_0x10f9e1){return db[_0x53da('0x37')][_0x53da('0x53')](_0x1f05e4[_0x53da('0x54')],{})[_0x53da('0x1d')](respondWithResult(_0x10f9e1,0xc9))[_0x53da('0x27')](handleError(_0x10f9e1,null));};exports['update']=function(_0x39c586,_0x350da2){if(_0x39c586[_0x53da('0x54')]['id']){delete _0x39c586[_0x53da('0x54')]['id'];}return db[_0x53da('0x37')][_0x53da('0x52')]({'where':{'id':_0x39c586[_0x53da('0x4f')]['id']}})[_0x53da('0x1d')](handleEntityNotFound(_0x350da2,null))[_0x53da('0x1d')](saveUpdates(_0x39c586['body'],null))[_0x53da('0x1d')](respondWithResult(_0x350da2,null))[_0x53da('0x27')](handleError(_0x350da2,null));};exports[_0x53da('0x31')]=function(_0x571696,_0x498bd0){return db[_0x53da('0x37')]['find']({'where':{'id':_0x571696[_0x53da('0x4f')]['id']}})[_0x53da('0x1d')](handleEntityNotFound(_0x498bd0,null))[_0x53da('0x1d')](removeEntity(_0x498bd0,null))[_0x53da('0x27')](handleError(_0x498bd0,null));};exports[_0x53da('0x55')]=function(_0x491646,_0x595db9,_0x4e4fef){var _0x5ca359={};var _0x26e472={};var _0x30da81;var _0x414718;return db[_0x53da('0x37')]['findOne']({'where':{'id':_0x491646['params']['id']}})[_0x53da('0x1d')](handleEntityNotFound(_0x595db9,null))[_0x53da('0x1d')](function(_0x3f60c7){if(_0x3f60c7){_0x30da81=_0x3f60c7;_0x26e472[_0x53da('0x39')]=_[_0x53da('0x3a')](db[_0x53da('0x56')][_0x53da('0x38')]);_0x26e472[_0x53da('0x3b')]=_[_0x53da('0x3a')](_0x491646[_0x53da('0x3b')]);_0x26e472['filters']=_[_0x53da('0x3d')](_0x26e472[_0x53da('0x39')],_0x26e472[_0x53da('0x3b')]);_0x5ca359[_0x53da('0x3e')]=_['intersection'](_0x26e472[_0x53da('0x39')],qs[_0x53da('0x50')](_0x491646[_0x53da('0x3b')][_0x53da('0x50')]));_0x5ca359['attributes']=_0x5ca359[_0x53da('0x3e')][_0x53da('0x3f')]?_0x5ca359[_0x53da('0x3e')]:_0x26e472[_0x53da('0x39')];_0x5ca359[_0x53da('0x41')]=qs[_0x53da('0x42')](_0x491646[_0x53da('0x3b')][_0x53da('0x42')]);_0x5ca359['where']=qs[_0x53da('0x3c')](_[_0x53da('0x57')](_0x491646[_0x53da('0x3b')],_0x26e472['filters']));if(_0x491646[_0x53da('0x3b')][_0x53da('0x44')]){_0x5ca359[_0x53da('0x43')]=_[_0x53da('0x45')](_0x5ca359[_0x53da('0x43')],{'$or':_[_0x53da('0x58')](_0x5ca359['attributes'],function(_0xab5199){var _0x1a471f={};_0x1a471f[_0xab5199]={'$like':'%'+_0x491646[_0x53da('0x3b')][_0x53da('0x44')]+'%'};return _0x1a471f;})});}_0x5ca359=_[_0x53da('0x45')]({},_0x5ca359,_0x491646[_0x53da('0x4a')]);return _0x30da81[_0x53da('0x55')](_0x5ca359);}})[_0x53da('0x1d')](function(_0xdf0004){if(_0xdf0004){_0x414718=_0xdf0004[_0x53da('0x3f')];if(!_0x491646[_0x53da('0x3b')][_0x53da('0x59')](_0x53da('0x40'))){_0x5ca359[_0x53da('0x2d')]=qs['limit'](_0x491646[_0x53da('0x3b')][_0x53da('0x2d')]);_0x5ca359[_0x53da('0x2c')]=qs[_0x53da('0x2c')](_0x491646[_0x53da('0x3b')][_0x53da('0x2c')]);}return _0x30da81[_0x53da('0x55')](_0x5ca359);}})['then'](function(_0x52c695){if(_0x52c695){return _0x52c695?{'count':_0x414718,'rows':_0x52c695}:null;}})[_0x53da('0x1d')](respondWithResult(_0x595db9,null))[_0x53da('0x27')](handleError(_0x595db9,null));};exports[_0x53da('0x5a')]=function(_0x13bc98,_0x186d0b,_0x8af71e){if(_0x13bc98['body']['id']){delete _0x13bc98[_0x53da('0x54')]['id'];}return db[_0x53da('0x37')][_0x53da('0x5b')]({'where':{'id':_0x13bc98[_0x53da('0x4f')]['id']}})[_0x53da('0x1d')](handleEntityNotFound(_0x186d0b,null))[_0x53da('0x1d')](function(_0x51ef7d){if(_0x51ef7d){_0x13bc98[_0x53da('0x54')][_0x53da('0x5c')]=_0x51ef7d['id'];_0x13bc98[_0x53da('0x54')][_0x53da('0x5d')]=integrations[_0x53da('0x5e')](_0x13bc98['body']['channel'],_0x13bc98['body'][_0x53da('0x46')]);_0x13bc98['body'][_0x53da('0x5f')]=integrations['getDescriptions'](_0x13bc98[_0x53da('0x54')][_0x53da('0x60')],_0x13bc98[_0x53da('0x54')][_0x53da('0x46')]);return db[_0x53da('0x56')]['create'](_0x13bc98['body'],{'include':[{'model':db[_0x53da('0x61')],'as':'Subjects'},{'model':db[_0x53da('0x61')],'as':_0x53da('0x5f')}]});}return null;})['then'](respondWithResult(_0x186d0b,null))[_0x53da('0x27')](handleError(_0x186d0b,null));};exports[_0x53da('0x62')]=function(_0xfd407c,_0x4b449b,_0x1f8ada){var _0x364ef3=['made_sla',_0x53da('0x63'),_0x53da('0x64'),'subcategory',_0x53da('0x65'),_0x53da('0x66'),'incident_state','severity',_0x53da('0x67')];var _0x59666e=['parent','made_sla','caused_by',_0x53da('0x68'),'upon_reject','sys_updated_on',_0x53da('0x69'),_0x53da('0x63'),_0x53da('0x6a'),_0x53da('0x6b'),_0x53da('0x6c'),'sys_updated_by',_0x53da('0x6d'),_0x53da('0x6e'),_0x53da('0x6f'),_0x53da('0x70'),_0x53da('0x71'),_0x53da('0x72'),_0x53da('0x64'),_0x53da('0x41'),_0x53da('0x73'),_0x53da('0x74'),'cmdb_ci',_0x53da('0x75'),_0x53da('0x76'),_0x53da('0x77'),_0x53da('0x78'),_0x53da('0x79'),_0x53da('0x7a'),_0x53da('0x7b'),_0x53da('0x7c'),_0x53da('0x7d'),_0x53da('0x7e'),_0x53da('0x7f'),_0x53da('0x80'),_0x53da('0x81'),'work_end',_0x53da('0x82'),_0x53da('0x83'),_0x53da('0x84'),_0x53da('0x85'),'subcategory',_0x53da('0x86'),_0x53da('0x87'),'close_code',_0x53da('0x88'),_0x53da('0x89'),'work_start','assignment_group',_0x53da('0x8a'),_0x53da('0x8b'),_0x53da('0x8c'),_0x53da('0x8d'),'notify','sys_class_name',_0x53da('0x8e'),'closed_by',_0x53da('0x8f'),_0x53da('0x90'),_0x53da('0x91'),_0x53da('0x92'),_0x53da('0x93'),'incident_state',_0x53da('0x94'),'problem_id','company','reassignment_count',_0x53da('0x95'),_0x53da('0x96'),_0x53da('0x97'),'comments',_0x53da('0x98'),_0x53da('0x99'),_0x53da('0x9a'),'due_date',_0x53da('0x9b'),_0x53da('0x9c'),'sys_tags',_0x53da('0x9d'),_0x53da('0x9e'),'correlation_id',_0x53da('0x9f'),'category'];var _0xea9b99='';var _0x23c18d='';var _0x19fe84=[];var _0x2b9b4a='';var _0x4f38ae='';var _0x3345c9=[];var _0x580537='';var _0x3c0919='';var _0x2ebaec={};var _0x2d0593='';return db[_0x53da('0x37')][_0x53da('0x5b')]({'where':{'id':_0xfd407c[_0x53da('0x4f')]['id']},'attributes':['id','username','password',_0x53da('0xa0'),_0x53da('0xa1'),_0x53da('0xa2')]})[_0x53da('0x1d')](handleEntityNotFound(_0x4b449b,null))[_0x53da('0x1d')](function(_0x1573fe){if(_0x1573fe){_0x2d0593=_0x1573fe[_0x53da('0xa1')];var _0x166871=_0x2d0593[_0x53da('0xa3')](-0x1);if(_0x166871==='/'){_0x2d0593=_0x2d0593[_0x53da('0xa4')](0x0,_0x2d0593[_0x53da('0xa5')](_0x166871));}_0x3c0919=util['format']('%s/api/now/doc/table/schema/',_0x2d0593);_0x580537=util[_0x53da('0xa6')](_0x53da('0xa7'),_0x2d0593);_0x2ebaec={'user':_0x1573fe[_0x53da('0xa8')],'pass':_0x1573fe[_0x53da('0xa9')]};var _0x2edaa0={'method':'GET','uri':_0x3c0919+_0x53da('0xaa'),'auth':_0x2ebaec,'json':!![]};return rp(_0x2edaa0);}})[_0x53da('0x1d')](function(_0x18a944){if(_0x18a944[_0x53da('0x26')]['length']>0x0){_0xea9b99=_0x18a944[_0x53da('0x26')];}console[_0x53da('0xab')](_0x53da('0xac'),_0xea9b99);_0x3345c9=[];_0x23c18d=Object[_0x53da('0xad')]([],_0xea9b99);_[_0x53da('0xae')](_0x23c18d,function(_0x368c8b){return!_0x364ef3[_0x53da('0xaf')](_0x368c8b['name']);});_0x23c18d[_0x53da('0xb0')](function(_0x48eb0f){var _0x33f6b3=createFieldObject(_0x580537,_0x2ebaec,_0x48eb0f['internalType'],_0x48eb0f['name'],_0x48eb0f[_0x53da('0xb1')],![]);_0x3345c9['push'](_0x33f6b3);});return Promise[_0x53da('0xb2')](_0x3345c9);})[_0x53da('0x1d')](function(_0x2edf34){_0x19fe84=_0x2edf34;_0x2b9b4a=Object['assign']([],_0xea9b99);console[_0x53da('0xab')](_0x53da('0xb3'),_0xea9b99);_[_0x53da('0xae')](_0x2b9b4a,function(_0x25c78f){return _0x59666e[_0x53da('0xaf')](_0x25c78f[_0x53da('0x34')]);});console[_0x53da('0xab')](_0x53da('0xb4'),_0x2b9b4a);_0x3345c9=[];_0x2b9b4a['forEach'](function(_0x4d7f3b){var _0x5a065f=createFieldObject(_0x580537,_0x2ebaec,_0x4d7f3b['internalType'],_0x4d7f3b[_0x53da('0x34')],_0x4d7f3b[_0x53da('0xb1')],!![]);_0x3345c9[_0x53da('0xb5')](_0x5a065f);});return Promise[_0x53da('0xb2')](_0x3345c9);})[_0x53da('0x1d')](function(_0x1c6c40){_0x4f38ae=_0x1c6c40;var _0x557f83=_0x19fe84['concat'](_0x4f38ae);return{'count':_0x557f83[_0x53da('0x3f')],'rows':_0x557f83};})[_0x53da('0x1d')](respondWithResult(_0x4b449b,null))['catch'](function(_0x315149){console['log']('ServiceNow\x20error:\x20'+_0x315149);var _0x5d9470=_0xfd407c[_0x53da('0x3b')][_0x53da('0x1b')]?0x1f4:_0x315149[_0x53da('0xb6')]||0x1f4;logger[_0x53da('0x23')](_0x315149[_0x53da('0x33')]);delete _0x315149['name'];if(_0x5d9470===0x191){_0x5d9470=0x190;}_0x4b449b[_0x53da('0x29')](_0x5d9470)[_0x53da('0x35')](_0xfd407c[_0x53da('0x3b')]['test']?{'message':_0x53da('0xb7'),'statusCode':_0x315149[_0x53da('0xb6')]}:_0x315149);});};function createFieldObject(_0x3f5922,_0x4626f3,_0x4d78f9,_0x13788c,_0x50521a,_0x1e9d89){return new Promise(function(_0x523528,_0xcc74d3){var _0x29a762={'id':_0x13788c,'name':_0x50521a,'custom':_0x1e9d89};if(_0x4d78f9===_0x53da('0xb8')){_0x29a762[_0x53da('0x4a')]=[{'name':_0x53da('0xb9'),'value':'true'},{'name':_0x53da('0xba'),'value':_0x53da('0xbb')}];_0x523528(_0x29a762);}else{var _0x1371ae={'method':_0x53da('0xbc'),'uri':_0x3f5922+_0x53da('0xbd')+_0x13788c,'auth':_0x4626f3,'json':!![]};return rp(_0x1371ae)[_0x53da('0x1d')](function(_0x2bec5d){var _0x258449=[];if(_0x2bec5d[_0x53da('0x26')]['length']>0x0){_0x2bec5d[_0x53da('0x26')][_0x53da('0xb0')](function(_0x29a8bc){if(_0x29a8bc['inactive']===_0x53da('0xbb')){var _0x5d2b20={'name':_0x29a8bc['label'],'value':_0x29a8bc[_0x53da('0xbe')]};_0x258449['push'](_0x5d2b20);}});}_0x29a762[_0x53da('0x4a')]=_0x258449;if(_0x29a762[_0x53da('0x4a')][_0x53da('0x3f')]>0x0){_0x523528(_0x29a762);}else{if(_0x1e9d89==![]){_0x523528();}else{_0x523528(_0x29a762);}}});}});} \ No newline at end of file +var _0x8ae0=['severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','order','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','business_stc','additional_assignee_list','sys_class_name','close_notes','closed_by','sys_id','reopened_by','problem_id','company','reassignment_count','activity_due','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','correlation_id','location','password','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','log','assign','includes','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','statusCode','send','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','forEach','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','end','status','json','offset','limit','apply','reject','update','destroy','then','sendStatus','stack','name','index','ServicenowAccount','rawAttributes','model','keys','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','key','field','options','includeAll','findAll','rows','show','intersection','include','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','map','hasOwnProperty','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','made_sla','knowledge','subcategory','close_code','notify','incident_state'];(function(_0x4c2894,_0x4d0f4e){var _0x105fc8=function(_0x458e13){while(--_0x458e13){_0x4c2894['push'](_0x4c2894['shift']());}};_0x105fc8(++_0x4d0f4e);}(_0x8ae0,0x115));var _0x08ae=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8ae0[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x08ae('0x0'));var emlformat=require(_0x08ae('0x1'));var rimraf=require(_0x08ae('0x2'));var zipdir=require(_0x08ae('0x3'));var jsonpatch=require(_0x08ae('0x4'));var rp=require('request-promise');var moment=require(_0x08ae('0x5'));var BPromise=require(_0x08ae('0x6'));var Mustache=require(_0x08ae('0x7'));var util=require(_0x08ae('0x8'));var path=require(_0x08ae('0x9'));var sox=require('sox');var csv=require(_0x08ae('0xa'));var ejs=require(_0x08ae('0xb'));var fs=require('fs');var _=require(_0x08ae('0xc'));var squel=require('squel');var crypto=require(_0x08ae('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08ae('0xe'));var Papa=require(_0x08ae('0xf'));var Redis=require(_0x08ae('0x10'));var authService=require(_0x08ae('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x08ae('0x12'));var logger=require(_0x08ae('0x13'))(_0x08ae('0x14'));var utils=require(_0x08ae('0x15'));var config=require(_0x08ae('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x08ae('0x17'));var jayson=require(_0x08ae('0x18'));var client=jayson[_0x08ae('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x9fc151,_0x3be2ba,_0xdb7131){if(_0xdb7131){var _0x68377=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x68377[_0x08ae('0x1a')](_0x3be2ba)){return _0x9fc151;}else{throw new Error(_0x08ae('0x1b'));}}else{return _0x9fc151;}}function respondWithRpcPromise(_0x42f286,_0x23e7f2,_0x3d11f0,_0x576165){return new BPromise(function(_0x574b24,_0xfe9902){var _0x3ea04=_0x576165||client;return _0x3ea04[_0x08ae('0x1c')](_0x42f286,_0x3d11f0)['then'](function(_0x48ea78){logger['info'](_0x08ae('0x1d'),_0x23e7f2,_0x08ae('0x1e'));logger[_0x08ae('0x1f')](_0x08ae('0x20'),_0x23e7f2,_0x08ae('0x1e'),JSON[_0x08ae('0x21')](_0x48ea78));if(_0x48ea78[_0x08ae('0x22')]){if(_0x48ea78['error']['code']===0x1f4){logger[_0x08ae('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x23e7f2,_0x48ea78[_0x08ae('0x22')][_0x08ae('0x23')]);return _0xfe9902(_0x48ea78['error'][_0x08ae('0x23')]);}logger['error'](_0x08ae('0x1d'),_0x23e7f2,_0x48ea78['error'][_0x08ae('0x23')]);return _0x574b24(_0x48ea78[_0x08ae('0x22')][_0x08ae('0x23')]);}else{logger[_0x08ae('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x23e7f2,'request\x20sent');_0x574b24(_0x48ea78[_0x08ae('0x25')][_0x08ae('0x23')]);}})[_0x08ae('0x26')](function(_0x197068){logger[_0x08ae('0x22')](_0x08ae('0x1d'),_0x23e7f2,_0x197068);_0xfe9902(_0x197068);});});}function respondWithStatusCode(_0x3ae56b,_0x335190){_0x335190=_0x335190||0xcc;return function(_0xbd97e1){if(_0xbd97e1){return _0x3ae56b['sendStatus'](_0x335190);}return _0x3ae56b['status'](_0x335190)[_0x08ae('0x27')]();};}function respondWithResult(_0x344973,_0x544874){_0x544874=_0x544874||0xc8;return function(_0x39ac46){if(_0x39ac46){return _0x344973[_0x08ae('0x28')](_0x544874)[_0x08ae('0x29')](_0x39ac46);}};}function respondWithFilteredResult(_0x410a87,_0xb30ce2){return function(_0x1db27a){if(_0x1db27a){var _0x502be7=_0x1db27a['count'],_0x58efe0=_0xb30ce2[_0x08ae('0x2a')],_0x590956=_0xb30ce2['offset']+_0xb30ce2[_0x08ae('0x2b')],_0x4c806c;if(_0x590956>=_0x502be7){_0x590956=_0x502be7;_0x4c806c=0xc8;}else{_0x4c806c=0xce;}_0x410a87[_0x08ae('0x28')](_0x4c806c);return _0x410a87['set']('Content-Range',_0x58efe0+'-'+_0x590956+'/'+_0x502be7)['json'](_0x1db27a);}return null;};}function patchUpdates(_0x8cc416){return function(_0xc8cd3f){try{jsonpatch[_0x08ae('0x2c')](_0xc8cd3f,_0x8cc416,!![]);}catch(_0x5468b1){return BPromise[_0x08ae('0x2d')](_0x5468b1);}return _0xc8cd3f['save']();};}function saveUpdates(_0x219a35,_0x30f59e){return function(_0x58dad3){if(_0x58dad3){return _0x58dad3[_0x08ae('0x2e')](_0x219a35)['then'](function(_0x59b8af){return _0x59b8af;});}return null;};}function removeEntity(_0x453aed,_0x1aae7d){return function(_0x181abc){if(_0x181abc){return _0x181abc[_0x08ae('0x2f')]()[_0x08ae('0x30')](function(){_0x453aed['status'](0xcc)[_0x08ae('0x27')]();});}};}function handleEntityNotFound(_0x10f3d6,_0x514a96){return function(_0x5e463d){if(!_0x5e463d){_0x10f3d6[_0x08ae('0x31')](0x194);}return _0x5e463d;};}function handleError(_0x597f7b,_0x2da0f7){_0x2da0f7=_0x2da0f7||0x1f4;return function(_0x6d4bf1){logger[_0x08ae('0x22')](_0x6d4bf1[_0x08ae('0x32')]);if(_0x6d4bf1['name']){delete _0x6d4bf1[_0x08ae('0x33')];}_0x597f7b[_0x08ae('0x28')](_0x2da0f7)['send'](_0x6d4bf1);};}exports[_0x08ae('0x34')]=function(_0x2f4e59,_0x4c80e8){var _0x12a9c6={},_0x210c3f={},_0xa1d624={'count':0x0,'rows':[]};var _0x581efb=db[_0x08ae('0x35')][_0x08ae('0x36')];_0x210c3f[_0x08ae('0x37')]=_[_0x08ae('0x38')](_0x581efb);_0x210c3f['query']=_[_0x08ae('0x38')](_0x2f4e59[_0x08ae('0x39')]);_0x210c3f[_0x08ae('0x3a')]=_['intersection'](_0x210c3f['model'],_0x210c3f[_0x08ae('0x39')]);_0x12a9c6[_0x08ae('0x3b')]=_['intersection'](_0x210c3f[_0x08ae('0x37')],qs[_0x08ae('0x3c')](_0x2f4e59[_0x08ae('0x39')]['fields']));_0x12a9c6[_0x08ae('0x3b')]=_0x12a9c6[_0x08ae('0x3b')][_0x08ae('0x3d')]?_0x12a9c6['attributes']:_0x210c3f[_0x08ae('0x37')];if(!_0x2f4e59['query']['hasOwnProperty'](_0x08ae('0x3e'))){_0x12a9c6[_0x08ae('0x2b')]=qs[_0x08ae('0x2b')](_0x2f4e59[_0x08ae('0x39')][_0x08ae('0x2b')]);_0x12a9c6['offset']=qs[_0x08ae('0x2a')](_0x2f4e59[_0x08ae('0x39')][_0x08ae('0x2a')]);}_0x12a9c6['order']=qs[_0x08ae('0x3f')](_0x2f4e59[_0x08ae('0x39')][_0x08ae('0x3f')]);_0x12a9c6[_0x08ae('0x40')]=qs[_0x08ae('0x3a')](_[_0x08ae('0x41')](_0x2f4e59[_0x08ae('0x39')],_0x210c3f['filters']));if(_0x2f4e59[_0x08ae('0x39')][_0x08ae('0x42')]){_0x12a9c6[_0x08ae('0x40')]=_[_0x08ae('0x43')](_0x12a9c6['where'],{'$or':_['map'](_0x581efb,function(_0x308882){if(_0x308882[_0x08ae('0x44')][_0x08ae('0x45')]!=='VIRTUAL'){var _0x2627fa={};_0x2627fa[_0x308882[_0x08ae('0x46')]]={'$like':'%'+_0x2f4e59[_0x08ae('0x39')][_0x08ae('0x42')]+'%'};return _0x2627fa;}})});}_0x12a9c6=_['merge']({},_0x12a9c6,_0x2f4e59[_0x08ae('0x47')]);var _0x5a9e50={'where':_0x12a9c6[_0x08ae('0x40')]};return db[_0x08ae('0x35')]['count'](_0x5a9e50)[_0x08ae('0x30')](function(_0xfe1492){_0xa1d624['count']=_0xfe1492;if(_0x2f4e59['query'][_0x08ae('0x48')]){_0x12a9c6['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x08ae('0x49')](_0x12a9c6);})[_0x08ae('0x30')](function(_0x36bd17){_0xa1d624[_0x08ae('0x4a')]=_0x36bd17;return _0xa1d624;})[_0x08ae('0x30')](respondWithFilteredResult(_0x4c80e8,_0x12a9c6))['catch'](handleError(_0x4c80e8,null));};exports[_0x08ae('0x4b')]=function(_0x3ec578,_0x432f1c){var _0x2b0b27={'raw':![],'where':{'id':_0x3ec578['params']['id']}},_0xdc14d7={};_0xdc14d7[_0x08ae('0x37')]=_[_0x08ae('0x38')](db[_0x08ae('0x35')][_0x08ae('0x36')]);_0xdc14d7[_0x08ae('0x39')]=_[_0x08ae('0x38')](_0x3ec578[_0x08ae('0x39')]);_0xdc14d7[_0x08ae('0x3a')]=_[_0x08ae('0x4c')](_0xdc14d7[_0x08ae('0x37')],_0xdc14d7[_0x08ae('0x39')]);_0x2b0b27[_0x08ae('0x3b')]=_[_0x08ae('0x4c')](_0xdc14d7[_0x08ae('0x37')],qs[_0x08ae('0x3c')](_0x3ec578['query'][_0x08ae('0x3c')]));_0x2b0b27[_0x08ae('0x3b')]=_0x2b0b27[_0x08ae('0x3b')][_0x08ae('0x3d')]?_0x2b0b27['attributes']:_0xdc14d7['model'];if(_0x3ec578[_0x08ae('0x39')]['includeAll']){_0x2b0b27[_0x08ae('0x4d')]=[{'all':!![]}];}_0x2b0b27=_[_0x08ae('0x43')]({},_0x2b0b27,_0x3ec578[_0x08ae('0x47')]);return db[_0x08ae('0x35')]['find'](_0x2b0b27)[_0x08ae('0x30')](handleEntityNotFound(_0x432f1c,null))[_0x08ae('0x30')](respondWithResult(_0x432f1c,null))[_0x08ae('0x26')](handleError(_0x432f1c,null));};exports[_0x08ae('0x4e')]=function(_0x24b628,_0x57554d){return db[_0x08ae('0x35')][_0x08ae('0x4e')](_0x24b628[_0x08ae('0x4f')],{})['then'](respondWithResult(_0x57554d,0xc9))['catch'](handleError(_0x57554d,null));};exports[_0x08ae('0x2e')]=function(_0x417812,_0x11bad0){if(_0x417812[_0x08ae('0x4f')]['id']){delete _0x417812[_0x08ae('0x4f')]['id'];}return db[_0x08ae('0x35')][_0x08ae('0x50')]({'where':{'id':_0x417812[_0x08ae('0x51')]['id']}})[_0x08ae('0x30')](handleEntityNotFound(_0x11bad0,null))[_0x08ae('0x30')](saveUpdates(_0x417812[_0x08ae('0x4f')],null))[_0x08ae('0x30')](respondWithResult(_0x11bad0,null))[_0x08ae('0x26')](handleError(_0x11bad0,null));};exports[_0x08ae('0x2f')]=function(_0x188a53,_0x490c9a){return db[_0x08ae('0x35')][_0x08ae('0x50')]({'where':{'id':_0x188a53['params']['id']}})[_0x08ae('0x30')](handleEntityNotFound(_0x490c9a,null))[_0x08ae('0x30')](removeEntity(_0x490c9a,null))[_0x08ae('0x26')](handleError(_0x490c9a,null));};exports[_0x08ae('0x52')]=function(_0x1e9c4c,_0x33e1f7,_0x45f248){var _0x49f2ae={};var _0x3592c6={};var _0xef00b7;var _0x269964;return db[_0x08ae('0x35')][_0x08ae('0x53')]({'where':{'id':_0x1e9c4c['params']['id']}})[_0x08ae('0x30')](handleEntityNotFound(_0x33e1f7,null))[_0x08ae('0x30')](function(_0x115634){if(_0x115634){_0xef00b7=_0x115634;_0x3592c6[_0x08ae('0x37')]=_[_0x08ae('0x38')](db[_0x08ae('0x54')][_0x08ae('0x36')]);_0x3592c6[_0x08ae('0x39')]=_[_0x08ae('0x38')](_0x1e9c4c[_0x08ae('0x39')]);_0x3592c6[_0x08ae('0x3a')]=_['intersection'](_0x3592c6['model'],_0x3592c6[_0x08ae('0x39')]);_0x49f2ae[_0x08ae('0x3b')]=_[_0x08ae('0x4c')](_0x3592c6[_0x08ae('0x37')],qs[_0x08ae('0x3c')](_0x1e9c4c[_0x08ae('0x39')][_0x08ae('0x3c')]));_0x49f2ae['attributes']=_0x49f2ae['attributes'][_0x08ae('0x3d')]?_0x49f2ae[_0x08ae('0x3b')]:_0x3592c6['model'];_0x49f2ae['order']=qs[_0x08ae('0x3f')](_0x1e9c4c[_0x08ae('0x39')][_0x08ae('0x3f')]);_0x49f2ae[_0x08ae('0x40')]=qs['filters'](_['pick'](_0x1e9c4c['query'],_0x3592c6[_0x08ae('0x3a')]));if(_0x1e9c4c[_0x08ae('0x39')][_0x08ae('0x42')]){_0x49f2ae['where']=_[_0x08ae('0x43')](_0x49f2ae['where'],{'$or':_[_0x08ae('0x55')](_0x49f2ae[_0x08ae('0x3b')],function(_0x1d55af){var _0x3cb488={};_0x3cb488[_0x1d55af]={'$like':'%'+_0x1e9c4c[_0x08ae('0x39')][_0x08ae('0x42')]+'%'};return _0x3cb488;})});}_0x49f2ae=_[_0x08ae('0x43')]({},_0x49f2ae,_0x1e9c4c['options']);return _0xef00b7[_0x08ae('0x52')](_0x49f2ae);}})[_0x08ae('0x30')](function(_0x5192dc){if(_0x5192dc){_0x269964=_0x5192dc[_0x08ae('0x3d')];if(!_0x1e9c4c[_0x08ae('0x39')][_0x08ae('0x56')](_0x08ae('0x3e'))){_0x49f2ae[_0x08ae('0x2b')]=qs['limit'](_0x1e9c4c[_0x08ae('0x39')][_0x08ae('0x2b')]);_0x49f2ae['offset']=qs['offset'](_0x1e9c4c[_0x08ae('0x39')][_0x08ae('0x2a')]);}return _0xef00b7[_0x08ae('0x52')](_0x49f2ae);}})[_0x08ae('0x30')](function(_0x1a379c){if(_0x1a379c){return _0x1a379c?{'count':_0x269964,'rows':_0x1a379c}:null;}})[_0x08ae('0x30')](respondWithResult(_0x33e1f7,null))[_0x08ae('0x26')](handleError(_0x33e1f7,null));};exports['addConfiguration']=function(_0x557976,_0x5d43a0,_0xabc0e7){if(_0x557976['body']['id']){delete _0x557976[_0x08ae('0x4f')]['id'];}return db['ServicenowAccount'][_0x08ae('0x53')]({'where':{'id':_0x557976['params']['id']}})[_0x08ae('0x30')](handleEntityNotFound(_0x5d43a0,null))[_0x08ae('0x30')](function(_0x1118bc){if(_0x1118bc){_0x557976[_0x08ae('0x4f')]['AccountId']=_0x1118bc['id'];_0x557976[_0x08ae('0x4f')][_0x08ae('0x57')]=integrations[_0x08ae('0x58')](_0x557976[_0x08ae('0x4f')][_0x08ae('0x59')],_0x557976[_0x08ae('0x4f')][_0x08ae('0x44')]);_0x557976['body']['Descriptions']=integrations[_0x08ae('0x5a')](_0x557976['body'][_0x08ae('0x59')],_0x557976['body'][_0x08ae('0x44')]);return db['ServicenowConfiguration'][_0x08ae('0x4e')](_0x557976[_0x08ae('0x4f')],{'include':[{'model':db[_0x08ae('0x5b')],'as':_0x08ae('0x57')},{'model':db[_0x08ae('0x5b')],'as':_0x08ae('0x5c')}]});}return null;})[_0x08ae('0x30')](respondWithResult(_0x5d43a0,null))[_0x08ae('0x26')](handleError(_0x5d43a0,null));};exports['getFields']=function(_0x938e60,_0x254613,_0x33b157){var _0x4e468c=[_0x08ae('0x5d'),'hold_reason',_0x08ae('0x5e'),_0x08ae('0x5f'),_0x08ae('0x60'),_0x08ae('0x61'),_0x08ae('0x62'),_0x08ae('0x63'),_0x08ae('0x64')];var _0x86a1e3=['parent',_0x08ae('0x5d'),_0x08ae('0x65'),_0x08ae('0x66'),_0x08ae('0x67'),_0x08ae('0x68'),_0x08ae('0x69'),_0x08ae('0x6a'),_0x08ae('0x6b'),_0x08ae('0x6c'),_0x08ae('0x6d'),_0x08ae('0x6e'),'opened_by',_0x08ae('0x6f'),_0x08ae('0x70'),_0x08ae('0x71'),_0x08ae('0x72'),'sys_created_by',_0x08ae('0x5e'),_0x08ae('0x73'),_0x08ae('0x74'),_0x08ae('0x75'),_0x08ae('0x76'),_0x08ae('0x77'),_0x08ae('0x78'),_0x08ae('0x79'),_0x08ae('0x7a'),'business_service',_0x08ae('0x7b'),_0x08ae('0x7c'),_0x08ae('0x7d'),_0x08ae('0x7e'),_0x08ae('0x7f'),'opened_at',_0x08ae('0x80'),_0x08ae('0x81'),_0x08ae('0x82'),_0x08ae('0x83'),_0x08ae('0x84'),_0x08ae('0x85'),_0x08ae('0x86'),_0x08ae('0x5f'),_0x08ae('0x87'),_0x08ae('0x88'),_0x08ae('0x60'),'correlation_display',_0x08ae('0x89'),'work_start','assignment_group',_0x08ae('0x8a'),_0x08ae('0x8b'),'description','calendar_duration',_0x08ae('0x61'),_0x08ae('0x8c'),_0x08ae('0x8d'),_0x08ae('0x8e'),'follow_up','parent_incident',_0x08ae('0x8f'),'contact_type',_0x08ae('0x90'),_0x08ae('0x62'),'urgency',_0x08ae('0x91'),_0x08ae('0x92'),_0x08ae('0x93'),_0x08ae('0x94'),'assigned_to','severity','comments',_0x08ae('0x95'),_0x08ae('0x96'),_0x08ae('0x97'),_0x08ae('0x98'),_0x08ae('0x99'),_0x08ae('0x9a'),'sys_tags',_0x08ae('0x9b'),'upon_approval',_0x08ae('0x9c'),_0x08ae('0x9d'),_0x08ae('0x64')];var _0x4115c3='';var _0x37a287='';var _0x25348b=[];var _0x36aa01='';var _0xbb49ae='';var _0x2c4e9e=[];var _0x40b988='';var _0x1bffa9='';var _0x1c7516={};var _0x1d14eb='';return db[_0x08ae('0x35')][_0x08ae('0x53')]({'where':{'id':_0x938e60[_0x08ae('0x51')]['id']},'attributes':['id','username',_0x08ae('0x9e'),'email',_0x08ae('0x9f'),'serverUrl']})[_0x08ae('0x30')](handleEntityNotFound(_0x254613,null))[_0x08ae('0x30')](function(_0x1c8c68){if(_0x1c8c68){_0x1d14eb=_0x1c8c68[_0x08ae('0x9f')];var _0x5ece6f=_0x1d14eb[_0x08ae('0xa0')](-0x1);if(_0x5ece6f==='/'){_0x1d14eb=_0x1d14eb[_0x08ae('0xa1')](0x0,_0x1d14eb[_0x08ae('0xa2')](_0x5ece6f));}_0x1bffa9=util[_0x08ae('0xa3')](_0x08ae('0xa4'),_0x1d14eb);_0x40b988=util[_0x08ae('0xa3')](_0x08ae('0xa5'),_0x1d14eb);_0x1c7516={'user':_0x1c8c68[_0x08ae('0xa6')],'pass':_0x1c8c68[_0x08ae('0x9e')]};var _0x48016c={'method':_0x08ae('0xa7'),'uri':_0x1bffa9+_0x08ae('0xa8'),'auth':_0x1c7516,'json':!![]};return rp(_0x48016c);}})[_0x08ae('0x30')](function(_0x437140){if(_0x437140['result'][_0x08ae('0x3d')]>0x0){_0x4115c3=_0x437140[_0x08ae('0x25')];}console[_0x08ae('0xa9')]('incident\x20table\x20objects',_0x4115c3);_0x2c4e9e=[];_0x37a287=Object[_0x08ae('0xaa')]([],_0x4115c3);_['remove'](_0x37a287,function(_0xeda476){return!_0x4e468c[_0x08ae('0xab')](_0xeda476[_0x08ae('0x33')]);});_0x37a287['forEach'](function(_0x31f203){var _0x14c6b6=createFieldObject(_0x40b988,_0x1c7516,_0x31f203[_0x08ae('0xac')],_0x31f203[_0x08ae('0x33')],_0x31f203[_0x08ae('0xad')],![]);_0x2c4e9e[_0x08ae('0xae')](_0x14c6b6);});return Promise[_0x08ae('0xaf')](_0x2c4e9e);})[_0x08ae('0x30')](function(_0x3524ec){_0x25348b=_0x3524ec;_0x36aa01=Object[_0x08ae('0xaa')]([],_0x4115c3);console[_0x08ae('0xa9')](_0x08ae('0xb0'),_0x4115c3);_['remove'](_0x36aa01,function(_0x4bed9c){return _0x86a1e3[_0x08ae('0xab')](_0x4bed9c[_0x08ae('0x33')]);});console[_0x08ae('0xa9')](_0x08ae('0xb1'),_0x36aa01);_0x2c4e9e=[];_0x36aa01['forEach'](function(_0x335a9a){var _0x4ac8e6=createFieldObject(_0x40b988,_0x1c7516,_0x335a9a[_0x08ae('0xac')],_0x335a9a['name'],_0x335a9a[_0x08ae('0xad')],!![]);_0x2c4e9e[_0x08ae('0xae')](_0x4ac8e6);});return Promise[_0x08ae('0xaf')](_0x2c4e9e);})['then'](function(_0x3d1d47){_0xbb49ae=_0x3d1d47;var _0x2ced54=_0x25348b['concat'](_0xbb49ae);return{'count':_0x2ced54[_0x08ae('0x3d')],'rows':_0x2ced54};})[_0x08ae('0x30')](respondWithResult(_0x254613,null))['catch'](function(_0x1788d7){console[_0x08ae('0xa9')](_0x08ae('0xb2')+_0x1788d7);var _0x5dbd76=_0x938e60[_0x08ae('0x39')][_0x08ae('0x1a')]?0x1f4:_0x1788d7[_0x08ae('0xb3')]||0x1f4;logger[_0x08ae('0x22')](_0x1788d7['stack']);delete _0x1788d7[_0x08ae('0x33')];if(_0x5dbd76===0x191){_0x5dbd76=0x190;}_0x254613[_0x08ae('0x28')](_0x5dbd76)[_0x08ae('0xb4')](_0x938e60[_0x08ae('0x39')][_0x08ae('0x1a')]?{'message':_0x08ae('0xb5'),'statusCode':_0x1788d7['statusCode']}:_0x1788d7);});};function createFieldObject(_0xe05441,_0x1d0b9e,_0x141665,_0x277f21,_0x1c8756,_0x3bfae3){return new Promise(function(_0x49dac2,_0x4b2cb4){var _0x4d004c={'id':_0x277f21,'name':_0x1c8756,'custom':_0x3bfae3};if(_0x141665===_0x08ae('0xb6')){_0x4d004c[_0x08ae('0x47')]=[{'name':_0x08ae('0xb7'),'value':_0x08ae('0xb8')},{'name':_0x08ae('0xb9'),'value':'false'}];_0x49dac2(_0x4d004c);}else{var _0x570fb6={'method':_0x08ae('0xa7'),'uri':_0xe05441+_0x08ae('0xba')+_0x277f21,'auth':_0x1d0b9e,'json':!![]};return rp(_0x570fb6)[_0x08ae('0x30')](function(_0x438005){var _0x11cff=[];if(_0x438005[_0x08ae('0x25')]['length']>0x0){_0x438005['result'][_0x08ae('0xbb')](function(_0x555033){if(_0x555033['inactive']==='false'){var _0x1c8acf={'name':_0x555033[_0x08ae('0xad')],'value':_0x555033['value']};_0x11cff[_0x08ae('0xae')](_0x1c8acf);}});}_0x4d004c[_0x08ae('0x47')]=_0x11cff;if(_0x4d004c[_0x08ae('0x47')][_0x08ae('0x3d')]>0x0){_0x49dac2(_0x4d004c);}else{if(_0x3bfae3==![]){_0x49dac2();}else{_0x49dac2(_0x4d004c);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 73f22c9..efb7d4a 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x275c4f,_0x1a968c){var _0x1957ef=function(_0x40806c){while(--_0x40806c){_0x275c4f['push'](_0x275c4f['shift']());}};_0x1957ef(++_0x1a968c);}(_0x814b,0x1a2));var _0xb814=function(_0x34ecea,_0x3d11ce){_0x34ecea=_0x34ecea-0x0;var _0x44b6a8=_0x814b[_0x34ecea];return _0x44b6a8;};'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'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x55bb2d,_0x83292a){var _0x251c90=function(_0x12e9c1){while(--_0x12e9c1){_0x55bb2d['push'](_0x55bb2d['shift']());}};_0x251c90(++_0x83292a);}(_0x814b,0x1a2));var _0xb814=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x814b[_0x1a4a06];return _0x49ec08;};'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'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 3b27ee1..d79acf3 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 _0x27d2=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowServicenowAccount','lodash','moment','bluebird','randomstring'];(function(_0x1ee97c,_0x1fda93){var _0x2d6c3c=function(_0x36bdec){while(--_0x36bdec){_0x1ee97c['push'](_0x1ee97c['shift']());}};_0x2d6c3c(++_0x1fda93);}(_0x27d2,0x80));var _0x227d=function(_0xb9c1e8,_0x178961){_0xb9c1e8=_0xb9c1e8-0x0;var _0x4731ea=_0x27d2[_0xb9c1e8];return _0x4731ea;};'use strict';var _=require(_0x227d('0x0'));var util=require('util');var moment=require(_0x227d('0x1'));var BPromise=require(_0x227d('0x2'));var rs=require(_0x227d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x227d('0x4'));var logger=require('../../config/logger')(_0x227d('0x5'));var config=require(_0x227d('0x6'));var jayson=require(_0x227d('0x7'));var client=jayson['client'][_0x227d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x360a09,_0x3c835a,_0x7e3ea5){return new BPromise(function(_0x3738e9,_0x68346c){return client[_0x227d('0x9')](_0x360a09,_0x7e3ea5)[_0x227d('0xa')](function(_0x34fbe5){logger[_0x227d('0xb')](_0x227d('0xc'),_0x3c835a,_0x227d('0xd'));logger[_0x227d('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3c835a,_0x227d('0xd'),JSON[_0x227d('0xf')](_0x34fbe5));if(_0x34fbe5[_0x227d('0x10')]){if(_0x34fbe5[_0x227d('0x10')][_0x227d('0x11')]===0x1f4){logger[_0x227d('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x3c835a,_0x34fbe5[_0x227d('0x10')][_0x227d('0x12')]);return _0x68346c(_0x34fbe5[_0x227d('0x10')][_0x227d('0x12')]);}logger['error'](_0x227d('0xc'),_0x3c835a,_0x34fbe5[_0x227d('0x10')]['message']);return _0x3738e9(_0x34fbe5['error'][_0x227d('0x12')]);}else{logger['info'](_0x227d('0xc'),_0x3c835a,_0x227d('0xd'));_0x3738e9(_0x34fbe5[_0x227d('0x13')][_0x227d('0x12')]);}})[_0x227d('0x14')](function(_0x38227c){logger[_0x227d('0x10')](_0x227d('0xc'),_0x3c835a,_0x38227c);_0x68346c(_0x38227c);});});}exports[_0x227d('0x15')]=function(_0x4748e1){var _0x4e64c8=this;return new Promise(function(_0x560f52,_0x3ceddb){return db['ServicenowAccount'][_0x227d('0x16')]({'raw':_0x4748e1[_0x227d('0x17')]?_0x4748e1['options'][_0x227d('0x18')]===undefined?!![]:![]:!![],'where':_0x4748e1['options']?_0x4748e1[_0x227d('0x17')][_0x227d('0x19')]||null:null,'attributes':_0x4748e1['options']?_0x4748e1[_0x227d('0x17')][_0x227d('0x1a')]||null:null,'limit':_0x4748e1[_0x227d('0x17')]?_0x4748e1['options'][_0x227d('0x1b')]||null:null,'include':_0x4748e1[_0x227d('0x17')]?_0x4748e1[_0x227d('0x17')]['include']?_['map'](_0x4748e1[_0x227d('0x17')][_0x227d('0x1c')],function(_0x4d3ade){return{'model':db[_0x4d3ade[_0x227d('0x1d')]],'as':_0x4d3ade['as'],'attributes':_0x4d3ade[_0x227d('0x1a')],'include':_0x4d3ade[_0x227d('0x1c')]?_[_0x227d('0x1e')](_0x4d3ade['include'],function(_0x2ed3c2){return{'model':db[_0x2ed3c2[_0x227d('0x1d')]],'as':_0x2ed3c2['as'],'attributes':_0x2ed3c2['attributes'],'include':_0x2ed3c2[_0x227d('0x1c')]?_['map'](_0x2ed3c2[_0x227d('0x1c')],function(_0x651725){return{'model':db[_0x651725[_0x227d('0x1d')]],'as':_0x651725['as'],'attributes':_0x651725['attributes']};}):[]};}):[]};}):[]:[]})[_0x227d('0xa')](function(_0x3a524f){logger[_0x227d('0xb')](_0x227d('0x15'),_0x4748e1);logger[_0x227d('0xe')]('GetServicenowAccount',_0x4748e1,JSON[_0x227d('0xf')](_0x3a524f));_0x560f52(_0x3a524f);})['catch'](function(_0x22fcfb){logger[_0x227d('0x10')]('GetServicenowAccount',_0x22fcfb[_0x227d('0x12')],_0x4748e1);_0x3ceddb(_0x4e64c8['error'](0x1f4,_0x22fcfb['message']));});});};exports['ShowServicenowAccount']=function(_0x4562ed){var _0xb34f5c=this;return new Promise(function(_0x57d9cb,_0x7d3a36){return db['ServicenowAccount'][_0x227d('0x1f')]({'raw':_0x4562ed['options']?_0x4562ed[_0x227d('0x17')][_0x227d('0x18')]===undefined?!![]:![]:!![],'where':_0x4562ed['options']?_0x4562ed[_0x227d('0x17')][_0x227d('0x19')]||null:null,'attributes':_0x4562ed[_0x227d('0x17')]?_0x4562ed[_0x227d('0x17')]['attributes']||null:null,'include':_0x4562ed[_0x227d('0x17')]?_0x4562ed['options'][_0x227d('0x1c')]?_['map'](_0x4562ed[_0x227d('0x17')][_0x227d('0x1c')],function(_0x267598){return{'model':db[_0x267598[_0x227d('0x1d')]],'as':_0x267598['as'],'attributes':_0x267598[_0x227d('0x1a')],'include':_0x267598['include']?_['map'](_0x267598['include'],function(_0x34c483){return{'model':db[_0x34c483['model']],'as':_0x34c483['as'],'attributes':_0x34c483[_0x227d('0x1a')],'include':_0x34c483[_0x227d('0x1c')]?_[_0x227d('0x1e')](_0x34c483['include'],function(_0x502541){return{'model':db[_0x502541['model']],'as':_0x502541['as'],'attributes':_0x502541[_0x227d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x227d('0xa')](function(_0x1d6371){logger[_0x227d('0xb')](_0x227d('0x20'),_0x4562ed);logger[_0x227d('0xe')](_0x227d('0x20'),_0x4562ed,JSON[_0x227d('0xf')](_0x1d6371));_0x57d9cb(_0x1d6371);})['catch'](function(_0x671771){logger[_0x227d('0x10')](_0x227d('0x20'),_0x671771[_0x227d('0x12')],_0x4562ed);_0x7d3a36(_0xb34f5c[_0x227d('0x10')](0x1f4,_0x671771['message']));});});}; \ No newline at end of file +var _0x0ecd=['../../config/environment','client','http','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowServicenowAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x149f86,_0x373607){var _0x596e2c=function(_0x1def4b){while(--_0x1def4b){_0x149f86['push'](_0x149f86['shift']());}};_0x596e2c(++_0x373607);}(_0x0ecd,0xca));var _0xd0ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ecd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0ec('0x0'));var util=require(_0xd0ec('0x1'));var moment=require(_0xd0ec('0x2'));var BPromise=require(_0xd0ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0ec('0x4'));var db=require(_0xd0ec('0x5'))['db'];var utils=require(_0xd0ec('0x6'));var logger=require('../../config/logger')(_0xd0ec('0x7'));var config=require(_0xd0ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd0ec('0x9')][_0xd0ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3771ae,_0x5a4b08,_0x3e5bf9){return new BPromise(function(_0x2444d3,_0x3a7818){return client['request'](_0x3771ae,_0x3e5bf9)['then'](function(_0x3c1d92){logger[_0xd0ec('0xb')](_0xd0ec('0xc'),_0x5a4b08,_0xd0ec('0xd'));logger[_0xd0ec('0xe')](_0xd0ec('0xf'),_0x5a4b08,_0xd0ec('0xd'),JSON['stringify'](_0x3c1d92));if(_0x3c1d92[_0xd0ec('0x10')]){if(_0x3c1d92[_0xd0ec('0x10')][_0xd0ec('0x11')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5a4b08,_0x3c1d92[_0xd0ec('0x10')][_0xd0ec('0x12')]);return _0x3a7818(_0x3c1d92['error'][_0xd0ec('0x12')]);}logger[_0xd0ec('0x10')](_0xd0ec('0xc'),_0x5a4b08,_0x3c1d92[_0xd0ec('0x10')][_0xd0ec('0x12')]);return _0x2444d3(_0x3c1d92[_0xd0ec('0x10')][_0xd0ec('0x12')]);}else{logger[_0xd0ec('0xb')](_0xd0ec('0xc'),_0x5a4b08,_0xd0ec('0xd'));_0x2444d3(_0x3c1d92['result'][_0xd0ec('0x12')]);}})[_0xd0ec('0x13')](function(_0x18b353){logger[_0xd0ec('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x5a4b08,_0x18b353);_0x3a7818(_0x18b353);});});}exports[_0xd0ec('0x14')]=function(_0xa58693){var _0x597b41=this;return new Promise(function(_0x477d9e,_0x372613){return db[_0xd0ec('0x15')][_0xd0ec('0x16')]({'raw':_0xa58693['options']?_0xa58693[_0xd0ec('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa58693[_0xd0ec('0x17')]?_0xa58693[_0xd0ec('0x17')][_0xd0ec('0x18')]||null:null,'attributes':_0xa58693['options']?_0xa58693[_0xd0ec('0x17')][_0xd0ec('0x19')]||null:null,'limit':_0xa58693[_0xd0ec('0x17')]?_0xa58693['options'][_0xd0ec('0x1a')]||null:null,'include':_0xa58693['options']?_0xa58693['options'][_0xd0ec('0x1b')]?_[_0xd0ec('0x1c')](_0xa58693[_0xd0ec('0x17')][_0xd0ec('0x1b')],function(_0x78cae6){return{'model':db[_0x78cae6[_0xd0ec('0x1d')]],'as':_0x78cae6['as'],'attributes':_0x78cae6[_0xd0ec('0x19')],'include':_0x78cae6[_0xd0ec('0x1b')]?_['map'](_0x78cae6[_0xd0ec('0x1b')],function(_0x352bf8){return{'model':db[_0x352bf8[_0xd0ec('0x1d')]],'as':_0x352bf8['as'],'attributes':_0x352bf8[_0xd0ec('0x19')],'include':_0x352bf8[_0xd0ec('0x1b')]?_[_0xd0ec('0x1c')](_0x352bf8[_0xd0ec('0x1b')],function(_0x3b6c0b){return{'model':db[_0x3b6c0b[_0xd0ec('0x1d')]],'as':_0x3b6c0b['as'],'attributes':_0x3b6c0b['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0ec('0x1e')](function(_0x270943){logger[_0xd0ec('0xb')](_0xd0ec('0x14'),_0xa58693);logger[_0xd0ec('0xe')](_0xd0ec('0x14'),_0xa58693,JSON[_0xd0ec('0x1f')](_0x270943));_0x477d9e(_0x270943);})[_0xd0ec('0x13')](function(_0x2393d3){logger[_0xd0ec('0x10')]('GetServicenowAccount',_0x2393d3[_0xd0ec('0x12')],_0xa58693);_0x372613(_0x597b41[_0xd0ec('0x10')](0x1f4,_0x2393d3[_0xd0ec('0x12')]));});});};exports[_0xd0ec('0x20')]=function(_0x52d6cc){var _0x3f6dbe=this;return new Promise(function(_0x4253e0,_0x42bfac){return db[_0xd0ec('0x15')][_0xd0ec('0x21')]({'raw':_0x52d6cc['options']?_0x52d6cc[_0xd0ec('0x17')][_0xd0ec('0x22')]===undefined?!![]:![]:!![],'where':_0x52d6cc[_0xd0ec('0x17')]?_0x52d6cc['options'][_0xd0ec('0x18')]||null:null,'attributes':_0x52d6cc[_0xd0ec('0x17')]?_0x52d6cc[_0xd0ec('0x17')][_0xd0ec('0x19')]||null:null,'include':_0x52d6cc['options']?_0x52d6cc['options']['include']?_[_0xd0ec('0x1c')](_0x52d6cc['options']['include'],function(_0x561df9){return{'model':db[_0x561df9[_0xd0ec('0x1d')]],'as':_0x561df9['as'],'attributes':_0x561df9['attributes'],'include':_0x561df9[_0xd0ec('0x1b')]?_['map'](_0x561df9[_0xd0ec('0x1b')],function(_0x1cd287){return{'model':db[_0x1cd287[_0xd0ec('0x1d')]],'as':_0x1cd287['as'],'attributes':_0x1cd287[_0xd0ec('0x19')],'include':_0x1cd287[_0xd0ec('0x1b')]?_[_0xd0ec('0x1c')](_0x1cd287[_0xd0ec('0x1b')],function(_0x3a3f95){return{'model':db[_0x3a3f95[_0xd0ec('0x1d')]],'as':_0x3a3f95['as'],'attributes':_0x3a3f95[_0xd0ec('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd0ec('0x1e')](function(_0x301ab2){logger[_0xd0ec('0xb')](_0xd0ec('0x20'),_0x52d6cc);logger[_0xd0ec('0xe')](_0xd0ec('0x20'),_0x52d6cc,JSON['stringify'](_0x301ab2));_0x4253e0(_0x301ab2);})[_0xd0ec('0x13')](function(_0xd7701){logger[_0xd0ec('0x10')]('ShowServicenowAccount',_0xd7701[_0xd0ec('0x12')],_0x52d6cc);_0x42bfac(_0x3f6dbe['error'](0x1f4,_0xd7701[_0xd0ec('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index cacfb7b..6539a11 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 _0xb39c=['create','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x187cda,_0xd86283){var _0x1e169d=function(_0x1748a3){while(--_0x1748a3){_0x187cda['push'](_0x187cda['shift']());}};_0x1e169d(++_0xd86283);}(_0xb39c,0x1a9));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xcb39('0x0'));var util=require(_0xcb39('0x1'));var path=require(_0xcb39('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb39('0x3'));var router=express['Router']();var auth=require(_0xcb39('0x4'));var interaction=require(_0xcb39('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xcb39('0x6')]('/',auth['isAuthenticated'](),controller[_0xcb39('0x7')]);router['get'](_0xcb39('0x8'),auth[_0xcb39('0x9')](),controller[_0xcb39('0xa')]);router[_0xcb39('0x6')](_0xcb39('0xb'),auth[_0xcb39('0x9')](),controller[_0xcb39('0xc')]);router[_0xcb39('0x6')]('/:id/subjects',auth[_0xcb39('0x9')](),controller[_0xcb39('0xd')]);router['get'](_0xcb39('0xe'),auth[_0xcb39('0x9')](),controller[_0xcb39('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcb39('0x10')]);router[_0xcb39('0x11')](_0xcb39('0x8'),auth['isAuthenticated'](),controller[_0xcb39('0x12')]);router['delete'](_0xcb39('0x8'),auth[_0xcb39('0x9')](),controller[_0xcb39('0x13')]);module[_0xcb39('0x14')]=router; \ No newline at end of file +var _0xeac9=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x50f699,_0x251ec5){var _0x49d7be=function(_0x356f52){while(--_0x356f52){_0x50f699['push'](_0x50f699['shift']());}};_0x49d7be(++_0x251ec5);}(_0xeac9,0x7e));var _0x9eac=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xeac9[_0x186376];return _0x2dbdd9;};'use strict';var multer=require('multer');var util=require(_0x9eac('0x0'));var path=require('path');var timeout=require(_0x9eac('0x1'));var express=require(_0x9eac('0x2'));var router=express['Router']();var auth=require(_0x9eac('0x3'));var interaction=require(_0x9eac('0x4'));var config=require('../../config/environment');var controller=require(_0x9eac('0x5'));router[_0x9eac('0x6')]('/',auth['isAuthenticated'](),controller[_0x9eac('0x7')]);router[_0x9eac('0x6')](_0x9eac('0x8'),auth[_0x9eac('0x9')](),controller[_0x9eac('0xa')]);router['get'](_0x9eac('0xb'),auth[_0x9eac('0x9')](),controller[_0x9eac('0xc')]);router[_0x9eac('0x6')](_0x9eac('0xd'),auth[_0x9eac('0x9')](),controller[_0x9eac('0xe')]);router[_0x9eac('0x6')](_0x9eac('0xf'),auth[_0x9eac('0x9')](),controller[_0x9eac('0x10')]);router[_0x9eac('0x11')]('/',auth[_0x9eac('0x9')](),controller['create']);router[_0x9eac('0x12')]('/:id',auth[_0x9eac('0x9')](),controller[_0x9eac('0x13')]);router[_0x9eac('0x14')](_0x9eac('0x8'),auth[_0x9eac('0x9')](),controller[_0x9eac('0x15')]);module[_0x9eac('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d85a557..288c1c0 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 _0x79b9=['STRING','sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x79b9,0x1a5));var _0x979b=function(_0x1b4f12,_0x4d5251){_0x1b4f12=_0x1b4f12-0x0;var _0x4ed340=_0x79b9[_0x1b4f12];return _0x4ed340;};'use strict';var Sequelize=require(_0x979b('0x0'));module[_0x979b('0x1')]={'name':{'type':Sequelize[_0x979b('0x2')]},'description':{'type':Sequelize[_0x979b('0x2')]}}; \ No newline at end of file +var _0xeebf=['sequelize','exports','STRING'];(function(_0x427c38,_0x3ed857){var _0x17e2fe=function(_0x32ee92){while(--_0x32ee92){_0x427c38['push'](_0x427c38['shift']());}};_0x17e2fe(++_0x3ed857);}(_0xeebf,0x1aa));var _0xfeeb=function(_0x2100d6,_0x55362c){_0x2100d6=_0x2100d6-0x0;var _0x298ddd=_0xeebf[_0x2100d6];return _0x298ddd;};'use strict';var Sequelize=require(_0xfeeb('0x0'));module[_0xfeeb('0x1')]={'name':{'type':Sequelize[_0xfeeb('0x2')]},'description':{'type':Sequelize[_0xfeeb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 07313b9..2afa228 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 _0xc1c4=['filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','field','options','include','findAll','params','length','includeAll','find','create','body','findOne','ServicenowField','getFields','nolimit','getSubjects','getDescriptions','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','apply','save','update','destroy','end','stack','name','ServicenowConfiguration','rawAttributes','model','keys','query'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x1158b6,_0x1b0e00){_0x1158b6=_0x1158b6-0x0;var _0xafd54=_0xc1c4[_0x1158b6];return _0xafd54;};'use strict';var pdf=require(_0x4c1c('0x0'));var emlformat=require(_0x4c1c('0x1'));var rimraf=require(_0x4c1c('0x2'));var zipdir=require(_0x4c1c('0x3'));var jsonpatch=require(_0x4c1c('0x4'));var rp=require(_0x4c1c('0x5'));var moment=require(_0x4c1c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4c1c('0x7'));var util=require(_0x4c1c('0x8'));var path=require(_0x4c1c('0x9'));var sox=require(_0x4c1c('0xa'));var csv=require('to-csv');var ejs=require(_0x4c1c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4c1c('0xc'));var jsforce=require(_0x4c1c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4c1c('0xe'));var querystring=require(_0x4c1c('0xf'));var Papa=require(_0x4c1c('0x10'));var Redis=require(_0x4c1c('0x11'));var authService=require(_0x4c1c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c1c('0x13'))(_0x4c1c('0x14'));var utils=require(_0x4c1c('0x15'));var config=require(_0x4c1c('0x16'));var db=require(_0x4c1c('0x17'))['db'];var jayson=require(_0x4c1c('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x7fbeb0,_0x18c3e7,_0x24eb14){if(_0x24eb14){var _0x30f8d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30f8d0[_0x4c1c('0x19')](_0x18c3e7)){return _0x7fbeb0;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x7fbeb0;}}function respondWithRpcPromise(_0x160ee0,_0x53123e,_0x4deafc,_0x146b14){return new BPromise(function(_0x1ff604,_0x3e37a7){var _0x3fde68=_0x146b14||client;return _0x3fde68[_0x4c1c('0x1a')](_0x160ee0,_0x4deafc)[_0x4c1c('0x1b')](function(_0x457463){logger[_0x4c1c('0x1c')](_0x4c1c('0x1d'),_0x53123e,_0x4c1c('0x1e'));logger[_0x4c1c('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x53123e,_0x4c1c('0x1e'),JSON[_0x4c1c('0x20')](_0x457463));if(_0x457463[_0x4c1c('0x21')]){if(_0x457463[_0x4c1c('0x21')][_0x4c1c('0x22')]===0x1f4){logger[_0x4c1c('0x21')](_0x4c1c('0x1d'),_0x53123e,_0x457463[_0x4c1c('0x21')][_0x4c1c('0x23')]);return _0x3e37a7(_0x457463[_0x4c1c('0x21')]['message']);}logger['error'](_0x4c1c('0x1d'),_0x53123e,_0x457463['error'][_0x4c1c('0x23')]);return _0x1ff604(_0x457463[_0x4c1c('0x21')]['message']);}else{logger[_0x4c1c('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x53123e,'request\x20sent');_0x1ff604(_0x457463[_0x4c1c('0x24')][_0x4c1c('0x23')]);}})[_0x4c1c('0x25')](function(_0x13c2a1){logger[_0x4c1c('0x21')]('ServicenowConfiguration,\x20%s,\x20%s',_0x53123e,_0x13c2a1);_0x3e37a7(_0x13c2a1);});});}function respondWithStatusCode(_0x1b533b,_0x1e07d1){_0x1e07d1=_0x1e07d1||0xcc;return function(_0xca1374){if(_0xca1374){return _0x1b533b[_0x4c1c('0x26')](_0x1e07d1);}return _0x1b533b[_0x4c1c('0x27')](_0x1e07d1)['end']();};}function respondWithResult(_0x577e68,_0x31bfa5){_0x31bfa5=_0x31bfa5||0xc8;return function(_0x4c9b2c){if(_0x4c9b2c){return _0x577e68[_0x4c1c('0x27')](_0x31bfa5)['json'](_0x4c9b2c);}};}function respondWithFilteredResult(_0x3083d1,_0x2d3f47){return function(_0x38f7f7){if(_0x38f7f7){var _0x4a4afe=_0x38f7f7[_0x4c1c('0x28')],_0x10b272=_0x2d3f47[_0x4c1c('0x29')],_0xadb987=_0x2d3f47[_0x4c1c('0x29')]+_0x2d3f47[_0x4c1c('0x2a')],_0x3d6786;if(_0xadb987>=_0x4a4afe){_0xadb987=_0x4a4afe;_0x3d6786=0xc8;}else{_0x3d6786=0xce;}_0x3083d1[_0x4c1c('0x27')](_0x3d6786);return _0x3083d1['set']('Content-Range',_0x10b272+'-'+_0xadb987+'/'+_0x4a4afe)['json'](_0x38f7f7);}return null;};}function patchUpdates(_0x492665){return function(_0x595f1b){try{jsonpatch[_0x4c1c('0x2b')](_0x595f1b,_0x492665,!![]);}catch(_0x1fac70){return BPromise['reject'](_0x1fac70);}return _0x595f1b[_0x4c1c('0x2c')]();};}function saveUpdates(_0x83912e,_0x5cbe86){return function(_0x4ca120){if(_0x4ca120){return _0x4ca120[_0x4c1c('0x2d')](_0x83912e)[_0x4c1c('0x1b')](function(_0x3e06c8){return _0x3e06c8;});}return null;};}function removeEntity(_0x5cd418,_0x58c019){return function(_0x14e02a){if(_0x14e02a){return _0x14e02a[_0x4c1c('0x2e')]()[_0x4c1c('0x1b')](function(){_0x5cd418[_0x4c1c('0x27')](0xcc)[_0x4c1c('0x2f')]();});}};}function handleEntityNotFound(_0x4b556b,_0x2378fd){return function(_0x29157e){if(!_0x29157e){_0x4b556b['sendStatus'](0x194);}return _0x29157e;};}function handleError(_0xdeb825,_0xbb0637){_0xbb0637=_0xbb0637||0x1f4;return function(_0x511029){logger[_0x4c1c('0x21')](_0x511029[_0x4c1c('0x30')]);if(_0x511029[_0x4c1c('0x31')]){delete _0x511029[_0x4c1c('0x31')];}_0xdeb825['status'](_0xbb0637)['send'](_0x511029);};}exports['index']=function(_0x1b773d,_0x14ec9b){var _0x222493={},_0x57248e={},_0xebeb95={'count':0x0,'rows':[]};var _0x4f5c70=db[_0x4c1c('0x32')][_0x4c1c('0x33')];_0x57248e[_0x4c1c('0x34')]=_[_0x4c1c('0x35')](_0x4f5c70);_0x57248e[_0x4c1c('0x36')]=_[_0x4c1c('0x35')](_0x1b773d[_0x4c1c('0x36')]);_0x57248e[_0x4c1c('0x37')]=_[_0x4c1c('0x38')](_0x57248e[_0x4c1c('0x34')],_0x57248e[_0x4c1c('0x36')]);_0x222493[_0x4c1c('0x39')]=_[_0x4c1c('0x38')](_0x57248e[_0x4c1c('0x34')],qs[_0x4c1c('0x3a')](_0x1b773d[_0x4c1c('0x36')]['fields']));_0x222493['attributes']=_0x222493[_0x4c1c('0x39')]['length']?_0x222493[_0x4c1c('0x39')]:_0x57248e[_0x4c1c('0x34')];if(!_0x1b773d[_0x4c1c('0x36')][_0x4c1c('0x3b')]('nolimit')){_0x222493[_0x4c1c('0x2a')]=qs[_0x4c1c('0x2a')](_0x1b773d[_0x4c1c('0x36')]['limit']);_0x222493[_0x4c1c('0x29')]=qs[_0x4c1c('0x29')](_0x1b773d[_0x4c1c('0x36')][_0x4c1c('0x29')]);}_0x222493[_0x4c1c('0x3c')]=qs[_0x4c1c('0x3d')](_0x1b773d[_0x4c1c('0x36')][_0x4c1c('0x3d')]);_0x222493['where']=qs[_0x4c1c('0x37')](_[_0x4c1c('0x3e')](_0x1b773d[_0x4c1c('0x36')],_0x57248e[_0x4c1c('0x37')]));if(_0x1b773d['query'][_0x4c1c('0x3f')]){_0x222493[_0x4c1c('0x40')]=_[_0x4c1c('0x41')](_0x222493[_0x4c1c('0x40')],{'$or':_['map'](_0x4f5c70,function(_0x574d41){if(_0x574d41[_0x4c1c('0x42')]['key']!==_0x4c1c('0x43')){var _0x2722c1={};_0x2722c1[_0x574d41[_0x4c1c('0x44')]]={'$like':'%'+_0x1b773d['query'][_0x4c1c('0x3f')]+'%'};return _0x2722c1;}})});}_0x222493=_[_0x4c1c('0x41')]({},_0x222493,_0x1b773d[_0x4c1c('0x45')]);var _0x58f7a6={'where':_0x222493[_0x4c1c('0x40')]};return db[_0x4c1c('0x32')][_0x4c1c('0x28')](_0x58f7a6)[_0x4c1c('0x1b')](function(_0x12ba66){_0xebeb95['count']=_0x12ba66;if(_0x1b773d[_0x4c1c('0x36')]['includeAll']){_0x222493[_0x4c1c('0x46')]=[{'all':!![]}];}return db[_0x4c1c('0x32')][_0x4c1c('0x47')](_0x222493);})[_0x4c1c('0x1b')](function(_0x178128){_0xebeb95['rows']=_0x178128;return _0xebeb95;})[_0x4c1c('0x1b')](respondWithFilteredResult(_0x14ec9b,_0x222493))['catch'](handleError(_0x14ec9b,null));};exports['show']=function(_0x2b4c09,_0x33a166){var _0x545529={'raw':![],'where':{'id':_0x2b4c09[_0x4c1c('0x48')]['id']}},_0x59e41a={};_0x59e41a[_0x4c1c('0x34')]=_[_0x4c1c('0x35')](db['ServicenowConfiguration'][_0x4c1c('0x33')]);_0x59e41a['query']=_[_0x4c1c('0x35')](_0x2b4c09[_0x4c1c('0x36')]);_0x59e41a[_0x4c1c('0x37')]=_[_0x4c1c('0x38')](_0x59e41a['model'],_0x59e41a[_0x4c1c('0x36')]);_0x545529[_0x4c1c('0x39')]=_[_0x4c1c('0x38')](_0x59e41a[_0x4c1c('0x34')],qs['fields'](_0x2b4c09['query']['fields']));_0x545529[_0x4c1c('0x39')]=_0x545529[_0x4c1c('0x39')][_0x4c1c('0x49')]?_0x545529[_0x4c1c('0x39')]:_0x59e41a[_0x4c1c('0x34')];if(_0x2b4c09[_0x4c1c('0x36')][_0x4c1c('0x4a')]){_0x545529[_0x4c1c('0x46')]=[{'all':!![]}];}_0x545529=_['merge']({},_0x545529,_0x2b4c09[_0x4c1c('0x45')]);return db[_0x4c1c('0x32')][_0x4c1c('0x4b')](_0x545529)[_0x4c1c('0x1b')](handleEntityNotFound(_0x33a166,null))[_0x4c1c('0x1b')](respondWithResult(_0x33a166,null))['catch'](handleError(_0x33a166,null));};exports[_0x4c1c('0x4c')]=function(_0x5ab8bb,_0x413f9e){return db[_0x4c1c('0x32')][_0x4c1c('0x4c')](_0x5ab8bb[_0x4c1c('0x4d')],{})[_0x4c1c('0x1b')](respondWithResult(_0x413f9e,0xc9))[_0x4c1c('0x25')](handleError(_0x413f9e,null));};exports['update']=function(_0x57d1ce,_0x1e4cd4){if(_0x57d1ce[_0x4c1c('0x4d')]['id']){delete _0x57d1ce['body']['id'];}return db['ServicenowConfiguration'][_0x4c1c('0x4b')]({'where':{'id':_0x57d1ce[_0x4c1c('0x48')]['id']}})[_0x4c1c('0x1b')](handleEntityNotFound(_0x1e4cd4,null))[_0x4c1c('0x1b')](saveUpdates(_0x57d1ce[_0x4c1c('0x4d')],null))[_0x4c1c('0x1b')](respondWithResult(_0x1e4cd4,null))[_0x4c1c('0x25')](handleError(_0x1e4cd4,null));};exports[_0x4c1c('0x2e')]=function(_0x4be874,_0xe6a922){return db['ServicenowConfiguration']['find']({'where':{'id':_0x4be874['params']['id']}})[_0x4c1c('0x1b')](handleEntityNotFound(_0xe6a922,null))['then'](removeEntity(_0xe6a922,null))['catch'](handleError(_0xe6a922,null));};exports['getFields']=function(_0x10764c,_0xeadb6e,_0x271df8){var _0x117150={};var _0x5120d5={};var _0x5158e9;var _0x2ee5f0;return db[_0x4c1c('0x32')][_0x4c1c('0x4e')]({'where':{'id':_0x10764c['params']['id']}})[_0x4c1c('0x1b')](handleEntityNotFound(_0xeadb6e,null))[_0x4c1c('0x1b')](function(_0x287903){if(_0x287903){_0x5158e9=_0x287903;_0x5120d5[_0x4c1c('0x34')]=_[_0x4c1c('0x35')](db[_0x4c1c('0x4f')][_0x4c1c('0x33')]);_0x5120d5[_0x4c1c('0x36')]=_[_0x4c1c('0x35')](_0x10764c[_0x4c1c('0x36')]);_0x5120d5[_0x4c1c('0x37')]=_[_0x4c1c('0x38')](_0x5120d5[_0x4c1c('0x34')],_0x5120d5[_0x4c1c('0x36')]);_0x117150[_0x4c1c('0x39')]=_[_0x4c1c('0x38')](_0x5120d5[_0x4c1c('0x34')],qs['fields'](_0x10764c[_0x4c1c('0x36')]['fields']));_0x117150['attributes']=_0x117150['attributes'][_0x4c1c('0x49')]?_0x117150[_0x4c1c('0x39')]:_0x5120d5[_0x4c1c('0x34')];_0x117150[_0x4c1c('0x3c')]=qs[_0x4c1c('0x3d')](_0x10764c[_0x4c1c('0x36')]['sort']);_0x117150[_0x4c1c('0x40')]=qs['filters'](_[_0x4c1c('0x3e')](_0x10764c[_0x4c1c('0x36')],_0x5120d5[_0x4c1c('0x37')]));if(_0x10764c['query'][_0x4c1c('0x3f')]){_0x117150['where']=_[_0x4c1c('0x41')](_0x117150['where'],{'$or':_['map'](_0x117150[_0x4c1c('0x39')],function(_0xfc3cf8){var _0x232b01={};_0x232b01[_0xfc3cf8]={'$like':'%'+_0x10764c[_0x4c1c('0x36')][_0x4c1c('0x3f')]+'%'};return _0x232b01;})});}_0x117150=_[_0x4c1c('0x41')]({},_0x117150,_0x10764c[_0x4c1c('0x45')]);return _0x5158e9[_0x4c1c('0x50')](_0x117150);}})[_0x4c1c('0x1b')](function(_0x4fe15a){if(_0x4fe15a){_0x2ee5f0=_0x4fe15a['length'];if(!_0x10764c[_0x4c1c('0x36')][_0x4c1c('0x3b')](_0x4c1c('0x51'))){_0x117150[_0x4c1c('0x2a')]=qs[_0x4c1c('0x2a')](_0x10764c[_0x4c1c('0x36')][_0x4c1c('0x2a')]);_0x117150[_0x4c1c('0x29')]=qs[_0x4c1c('0x29')](_0x10764c[_0x4c1c('0x36')][_0x4c1c('0x29')]);}return _0x5158e9[_0x4c1c('0x50')](_0x117150);}})[_0x4c1c('0x1b')](function(_0x129caa){if(_0x129caa){return _0x129caa?{'count':_0x2ee5f0,'rows':_0x129caa}:null;}})[_0x4c1c('0x1b')](respondWithResult(_0xeadb6e,null))[_0x4c1c('0x25')](handleError(_0xeadb6e,null));};exports[_0x4c1c('0x52')]=function(_0x39c61f,_0x3812a3,_0x3bf255){var _0x33c228={};var _0x1bc57b={};var _0x5c6eaf;var _0xeebe12;return db[_0x4c1c('0x32')][_0x4c1c('0x4e')]({'where':{'id':_0x39c61f[_0x4c1c('0x48')]['id']}})[_0x4c1c('0x1b')](handleEntityNotFound(_0x3812a3,null))[_0x4c1c('0x1b')](function(_0x3598c5){if(_0x3598c5){_0x5c6eaf=_0x3598c5;_0x1bc57b['model']=_[_0x4c1c('0x35')](db['ServicenowField']['rawAttributes']);_0x1bc57b[_0x4c1c('0x36')]=_[_0x4c1c('0x35')](_0x39c61f['query']);_0x1bc57b[_0x4c1c('0x37')]=_[_0x4c1c('0x38')](_0x1bc57b['model'],_0x1bc57b['query']);_0x33c228[_0x4c1c('0x39')]=_[_0x4c1c('0x38')](_0x1bc57b['model'],qs['fields'](_0x39c61f[_0x4c1c('0x36')][_0x4c1c('0x3a')]));_0x33c228['attributes']=_0x33c228[_0x4c1c('0x39')][_0x4c1c('0x49')]?_0x33c228['attributes']:_0x1bc57b[_0x4c1c('0x34')];_0x33c228[_0x4c1c('0x3c')]=qs[_0x4c1c('0x3d')](_0x39c61f[_0x4c1c('0x36')][_0x4c1c('0x3d')]);_0x33c228['where']=qs[_0x4c1c('0x37')](_[_0x4c1c('0x3e')](_0x39c61f[_0x4c1c('0x36')],_0x1bc57b[_0x4c1c('0x37')]));if(_0x39c61f[_0x4c1c('0x36')][_0x4c1c('0x3f')]){_0x33c228[_0x4c1c('0x40')]=_[_0x4c1c('0x41')](_0x33c228[_0x4c1c('0x40')],{'$or':_['map'](_0x33c228[_0x4c1c('0x39')],function(_0x5654d9){var _0x344a88={};_0x344a88[_0x5654d9]={'$like':'%'+_0x39c61f[_0x4c1c('0x36')]['filter']+'%'};return _0x344a88;})});}_0x33c228=_[_0x4c1c('0x41')]({},_0x33c228,_0x39c61f[_0x4c1c('0x45')]);return _0x5c6eaf[_0x4c1c('0x52')](_0x33c228);}})[_0x4c1c('0x1b')](function(_0x3761e2){if(_0x3761e2){_0xeebe12=_0x3761e2['length'];if(!_0x39c61f[_0x4c1c('0x36')][_0x4c1c('0x3b')]('nolimit')){_0x33c228['limit']=qs['limit'](_0x39c61f[_0x4c1c('0x36')]['limit']);_0x33c228[_0x4c1c('0x29')]=qs[_0x4c1c('0x29')](_0x39c61f[_0x4c1c('0x36')][_0x4c1c('0x29')]);}return _0x5c6eaf['getSubjects'](_0x33c228);}})[_0x4c1c('0x1b')](function(_0x1df4ce){if(_0x1df4ce){return _0x1df4ce?{'count':_0xeebe12,'rows':_0x1df4ce}:null;}})[_0x4c1c('0x1b')](respondWithResult(_0x3812a3,null))[_0x4c1c('0x25')](handleError(_0x3812a3,null));};exports[_0x4c1c('0x53')]=function(_0x236e18,_0x42dabc,_0x309af4){var _0x53d3fd={};var _0x2a4a95={};var _0x1d95d5;var _0x3bf714;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x236e18[_0x4c1c('0x48')]['id']}})['then'](handleEntityNotFound(_0x42dabc,null))[_0x4c1c('0x1b')](function(_0x2da874){if(_0x2da874){_0x1d95d5=_0x2da874;_0x2a4a95['model']=_[_0x4c1c('0x35')](db[_0x4c1c('0x4f')][_0x4c1c('0x33')]);_0x2a4a95[_0x4c1c('0x36')]=_['keys'](_0x236e18['query']);_0x2a4a95[_0x4c1c('0x37')]=_[_0x4c1c('0x38')](_0x2a4a95[_0x4c1c('0x34')],_0x2a4a95[_0x4c1c('0x36')]);_0x53d3fd[_0x4c1c('0x39')]=_[_0x4c1c('0x38')](_0x2a4a95[_0x4c1c('0x34')],qs[_0x4c1c('0x3a')](_0x236e18[_0x4c1c('0x36')][_0x4c1c('0x3a')]));_0x53d3fd[_0x4c1c('0x39')]=_0x53d3fd['attributes'][_0x4c1c('0x49')]?_0x53d3fd[_0x4c1c('0x39')]:_0x2a4a95[_0x4c1c('0x34')];_0x53d3fd[_0x4c1c('0x3c')]=qs[_0x4c1c('0x3d')](_0x236e18['query']['sort']);_0x53d3fd[_0x4c1c('0x40')]=qs[_0x4c1c('0x37')](_[_0x4c1c('0x3e')](_0x236e18[_0x4c1c('0x36')],_0x2a4a95[_0x4c1c('0x37')]));if(_0x236e18[_0x4c1c('0x36')]['filter']){_0x53d3fd[_0x4c1c('0x40')]=_[_0x4c1c('0x41')](_0x53d3fd[_0x4c1c('0x40')],{'$or':_[_0x4c1c('0x54')](_0x53d3fd[_0x4c1c('0x39')],function(_0x1f7335){var _0x320668={};_0x320668[_0x1f7335]={'$like':'%'+_0x236e18[_0x4c1c('0x36')][_0x4c1c('0x3f')]+'%'};return _0x320668;})});}_0x53d3fd=_[_0x4c1c('0x41')]({},_0x53d3fd,_0x236e18['options']);return _0x1d95d5['getDescriptions'](_0x53d3fd);}})[_0x4c1c('0x1b')](function(_0x331c2b){if(_0x331c2b){_0x3bf714=_0x331c2b[_0x4c1c('0x49')];if(!_0x236e18[_0x4c1c('0x36')][_0x4c1c('0x3b')]('nolimit')){_0x53d3fd[_0x4c1c('0x2a')]=qs[_0x4c1c('0x2a')](_0x236e18[_0x4c1c('0x36')][_0x4c1c('0x2a')]);_0x53d3fd[_0x4c1c('0x29')]=qs[_0x4c1c('0x29')](_0x236e18[_0x4c1c('0x36')][_0x4c1c('0x29')]);}return _0x1d95d5['getDescriptions'](_0x53d3fd);}})[_0x4c1c('0x1b')](function(_0x21d6a9){if(_0x21d6a9){return _0x21d6a9?{'count':_0x3bf714,'rows':_0x21d6a9}:null;}})[_0x4c1c('0x1b')](respondWithResult(_0x42dabc,null))[_0x4c1c('0x25')](handleError(_0x42dabc,null));}; \ No newline at end of file +var _0xe020=['find','create','body','params','getFields','findOne','ServicenowField','order','filter','map','getSubjects','getDescriptions','html-pdf','rimraf','fast-json-patch','bluebird','mustache','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','ServicenowConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','type','VIRTUAL','field','merge','options','where','count','includeAll','findAll','rows','show','include'];(function(_0xa270f3,_0x293fd){var _0x48767f=function(_0x2db048){while(--_0x2db048){_0xa270f3['push'](_0xa270f3['shift']());}};_0x48767f(++_0x293fd);}(_0xe020,0x105));var _0x0e02=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xe020[_0x12fc8d];return _0x3f9d04;};'use strict';var pdf=require(_0x0e02('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0e02('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e02('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0e02('0x3'));var Mustache=require(_0x0e02('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0e02('0x5'));var csv=require('to-csv');var ejs=require(_0x0e02('0x6'));var fs=require('fs');var _=require(_0x0e02('0x7'));var squel=require(_0x0e02('0x8'));var crypto=require('crypto');var jsforce=require(_0x0e02('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0e02('0xa'));var querystring=require(_0x0e02('0xb'));var Papa=require(_0x0e02('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e02('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e02('0xe'));var utils=require(_0x0e02('0xf'));var config=require(_0x0e02('0x10'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0e02('0x11'));var client=jayson['client'][_0x0e02('0x12')]({'port':0x232a});function checkPasswordPattern(_0x2349b8,_0x5c6ab2,_0xbe61c3){if(_0xbe61c3){var _0x4b00f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b00f0['test'](_0x5c6ab2)){return _0x2349b8;}else{throw new Error(_0x0e02('0x13'));}}else{return _0x2349b8;}}function respondWithRpcPromise(_0x336d4e,_0x460815,_0x3a2e1f,_0x4aefab){return new BPromise(function(_0x17f386,_0x21b84a){var _0x4e24bf=_0x4aefab||client;return _0x4e24bf[_0x0e02('0x14')](_0x336d4e,_0x3a2e1f)['then'](function(_0x4658c3){logger[_0x0e02('0x15')](_0x0e02('0x16'),_0x460815,_0x0e02('0x17'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x460815,_0x0e02('0x17'),JSON[_0x0e02('0x18')](_0x4658c3));if(_0x4658c3[_0x0e02('0x19')]){if(_0x4658c3[_0x0e02('0x19')]['code']===0x1f4){logger[_0x0e02('0x19')](_0x0e02('0x16'),_0x460815,_0x4658c3[_0x0e02('0x19')][_0x0e02('0x1a')]);return _0x21b84a(_0x4658c3['error'][_0x0e02('0x1a')]);}logger['error'](_0x0e02('0x16'),_0x460815,_0x4658c3['error'][_0x0e02('0x1a')]);return _0x17f386(_0x4658c3[_0x0e02('0x19')][_0x0e02('0x1a')]);}else{logger[_0x0e02('0x15')]('ServicenowConfiguration,\x20%s,\x20%s',_0x460815,_0x0e02('0x17'));_0x17f386(_0x4658c3['result'][_0x0e02('0x1a')]);}})[_0x0e02('0x1b')](function(_0x50bab0){logger[_0x0e02('0x19')]('ServicenowConfiguration,\x20%s,\x20%s',_0x460815,_0x50bab0);_0x21b84a(_0x50bab0);});});}function respondWithStatusCode(_0xfec757,_0x316b1e){_0x316b1e=_0x316b1e||0xcc;return function(_0x4f8eae){if(_0x4f8eae){return _0xfec757[_0x0e02('0x1c')](_0x316b1e);}return _0xfec757[_0x0e02('0x1d')](_0x316b1e)[_0x0e02('0x1e')]();};}function respondWithResult(_0x1a77fb,_0x283467){_0x283467=_0x283467||0xc8;return function(_0x1b532c){if(_0x1b532c){return _0x1a77fb[_0x0e02('0x1d')](_0x283467)[_0x0e02('0x1f')](_0x1b532c);}};}function respondWithFilteredResult(_0x93be93,_0x2947cd){return function(_0x22560c){if(_0x22560c){var _0x34e597=_0x22560c['count'],_0x51dac6=_0x2947cd['offset'],_0x596d34=_0x2947cd[_0x0e02('0x20')]+_0x2947cd[_0x0e02('0x21')],_0x4f32fb;if(_0x596d34>=_0x34e597){_0x596d34=_0x34e597;_0x4f32fb=0xc8;}else{_0x4f32fb=0xce;}_0x93be93[_0x0e02('0x1d')](_0x4f32fb);return _0x93be93[_0x0e02('0x22')](_0x0e02('0x23'),_0x51dac6+'-'+_0x596d34+'/'+_0x34e597)[_0x0e02('0x1f')](_0x22560c);}return null;};}function patchUpdates(_0x57a8f2){return function(_0x48e362){try{jsonpatch[_0x0e02('0x24')](_0x48e362,_0x57a8f2,!![]);}catch(_0x86d0a3){return BPromise[_0x0e02('0x25')](_0x86d0a3);}return _0x48e362[_0x0e02('0x26')]();};}function saveUpdates(_0x4bed71,_0x27d445){return function(_0x4789b2){if(_0x4789b2){return _0x4789b2[_0x0e02('0x27')](_0x4bed71)[_0x0e02('0x28')](function(_0x7932b9){return _0x7932b9;});}return null;};}function removeEntity(_0x2e51ec,_0x45c6fa){return function(_0x10e6ac){if(_0x10e6ac){return _0x10e6ac[_0x0e02('0x29')]()['then'](function(){_0x2e51ec[_0x0e02('0x1d')](0xcc)[_0x0e02('0x1e')]();});}};}function handleEntityNotFound(_0x2c5a13,_0x3be23e){return function(_0x3ab28e){if(!_0x3ab28e){_0x2c5a13[_0x0e02('0x1c')](0x194);}return _0x3ab28e;};}function handleError(_0x47366a,_0x1d6ab4){_0x1d6ab4=_0x1d6ab4||0x1f4;return function(_0x5280d2){logger[_0x0e02('0x19')](_0x5280d2[_0x0e02('0x2a')]);if(_0x5280d2[_0x0e02('0x2b')]){delete _0x5280d2['name'];}_0x47366a[_0x0e02('0x1d')](_0x1d6ab4)['send'](_0x5280d2);};}exports[_0x0e02('0x2c')]=function(_0x51cdf5,_0x327cbc){var _0x201a4f={},_0x8cea51={},_0x419276={'count':0x0,'rows':[]};var _0xe53fec=db[_0x0e02('0x2d')][_0x0e02('0x2e')];_0x8cea51[_0x0e02('0x2f')]=_[_0x0e02('0x30')](_0xe53fec);_0x8cea51[_0x0e02('0x31')]=_['keys'](_0x51cdf5[_0x0e02('0x31')]);_0x8cea51[_0x0e02('0x32')]=_[_0x0e02('0x33')](_0x8cea51['model'],_0x8cea51[_0x0e02('0x31')]);_0x201a4f[_0x0e02('0x34')]=_[_0x0e02('0x33')](_0x8cea51[_0x0e02('0x2f')],qs[_0x0e02('0x35')](_0x51cdf5[_0x0e02('0x31')]['fields']));_0x201a4f[_0x0e02('0x34')]=_0x201a4f[_0x0e02('0x34')][_0x0e02('0x36')]?_0x201a4f[_0x0e02('0x34')]:_0x8cea51['model'];if(!_0x51cdf5[_0x0e02('0x31')][_0x0e02('0x37')](_0x0e02('0x38'))){_0x201a4f[_0x0e02('0x21')]=qs['limit'](_0x51cdf5['query']['limit']);_0x201a4f[_0x0e02('0x20')]=qs['offset'](_0x51cdf5[_0x0e02('0x31')][_0x0e02('0x20')]);}_0x201a4f['order']=qs[_0x0e02('0x39')](_0x51cdf5['query'][_0x0e02('0x39')]);_0x201a4f['where']=qs[_0x0e02('0x32')](_[_0x0e02('0x3a')](_0x51cdf5[_0x0e02('0x31')],_0x8cea51[_0x0e02('0x32')]));if(_0x51cdf5[_0x0e02('0x31')]['filter']){_0x201a4f['where']=_['merge'](_0x201a4f['where'],{'$or':_['map'](_0xe53fec,function(_0x355668){if(_0x355668[_0x0e02('0x3b')]['key']!==_0x0e02('0x3c')){var _0x564c7b={};_0x564c7b[_0x355668[_0x0e02('0x3d')]]={'$like':'%'+_0x51cdf5[_0x0e02('0x31')]['filter']+'%'};return _0x564c7b;}})});}_0x201a4f=_[_0x0e02('0x3e')]({},_0x201a4f,_0x51cdf5[_0x0e02('0x3f')]);var _0x3d63d2={'where':_0x201a4f[_0x0e02('0x40')]};return db[_0x0e02('0x2d')][_0x0e02('0x41')](_0x3d63d2)[_0x0e02('0x28')](function(_0x125697){_0x419276[_0x0e02('0x41')]=_0x125697;if(_0x51cdf5[_0x0e02('0x31')][_0x0e02('0x42')]){_0x201a4f['include']=[{'all':!![]}];}return db[_0x0e02('0x2d')][_0x0e02('0x43')](_0x201a4f);})['then'](function(_0x519104){_0x419276[_0x0e02('0x44')]=_0x519104;return _0x419276;})[_0x0e02('0x28')](respondWithFilteredResult(_0x327cbc,_0x201a4f))[_0x0e02('0x1b')](handleError(_0x327cbc,null));};exports[_0x0e02('0x45')]=function(_0x2cf964,_0x55e796){var _0x3f9d3a={'raw':![],'where':{'id':_0x2cf964['params']['id']}},_0x40c0de={};_0x40c0de['model']=_[_0x0e02('0x30')](db['ServicenowConfiguration']['rawAttributes']);_0x40c0de[_0x0e02('0x31')]=_[_0x0e02('0x30')](_0x2cf964['query']);_0x40c0de[_0x0e02('0x32')]=_[_0x0e02('0x33')](_0x40c0de[_0x0e02('0x2f')],_0x40c0de[_0x0e02('0x31')]);_0x3f9d3a[_0x0e02('0x34')]=_['intersection'](_0x40c0de['model'],qs['fields'](_0x2cf964[_0x0e02('0x31')]['fields']));_0x3f9d3a['attributes']=_0x3f9d3a[_0x0e02('0x34')][_0x0e02('0x36')]?_0x3f9d3a[_0x0e02('0x34')]:_0x40c0de[_0x0e02('0x2f')];if(_0x2cf964[_0x0e02('0x31')][_0x0e02('0x42')]){_0x3f9d3a[_0x0e02('0x46')]=[{'all':!![]}];}_0x3f9d3a=_[_0x0e02('0x3e')]({},_0x3f9d3a,_0x2cf964[_0x0e02('0x3f')]);return db['ServicenowConfiguration'][_0x0e02('0x47')](_0x3f9d3a)[_0x0e02('0x28')](handleEntityNotFound(_0x55e796,null))[_0x0e02('0x28')](respondWithResult(_0x55e796,null))['catch'](handleError(_0x55e796,null));};exports[_0x0e02('0x48')]=function(_0x209d38,_0x24787e){return db['ServicenowConfiguration']['create'](_0x209d38['body'],{})['then'](respondWithResult(_0x24787e,0xc9))[_0x0e02('0x1b')](handleError(_0x24787e,null));};exports[_0x0e02('0x27')]=function(_0x3ede2c,_0x1ca446){if(_0x3ede2c[_0x0e02('0x49')]['id']){delete _0x3ede2c[_0x0e02('0x49')]['id'];}return db['ServicenowConfiguration'][_0x0e02('0x47')]({'where':{'id':_0x3ede2c[_0x0e02('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ca446,null))['then'](saveUpdates(_0x3ede2c[_0x0e02('0x49')],null))['then'](respondWithResult(_0x1ca446,null))[_0x0e02('0x1b')](handleError(_0x1ca446,null));};exports[_0x0e02('0x29')]=function(_0x2c7269,_0x237f43){return db[_0x0e02('0x2d')]['find']({'where':{'id':_0x2c7269[_0x0e02('0x4a')]['id']}})['then'](handleEntityNotFound(_0x237f43,null))['then'](removeEntity(_0x237f43,null))[_0x0e02('0x1b')](handleError(_0x237f43,null));};exports[_0x0e02('0x4b')]=function(_0x55d25f,_0x7aa3d1,_0x24d4b5){var _0x3627c1={};var _0xa37b6f={};var _0x31dac8;var _0xffcfa0;return db[_0x0e02('0x2d')][_0x0e02('0x4c')]({'where':{'id':_0x55d25f['params']['id']}})[_0x0e02('0x28')](handleEntityNotFound(_0x7aa3d1,null))[_0x0e02('0x28')](function(_0x214502){if(_0x214502){_0x31dac8=_0x214502;_0xa37b6f[_0x0e02('0x2f')]=_[_0x0e02('0x30')](db[_0x0e02('0x4d')][_0x0e02('0x2e')]);_0xa37b6f[_0x0e02('0x31')]=_['keys'](_0x55d25f[_0x0e02('0x31')]);_0xa37b6f['filters']=_[_0x0e02('0x33')](_0xa37b6f[_0x0e02('0x2f')],_0xa37b6f[_0x0e02('0x31')]);_0x3627c1[_0x0e02('0x34')]=_['intersection'](_0xa37b6f[_0x0e02('0x2f')],qs['fields'](_0x55d25f[_0x0e02('0x31')][_0x0e02('0x35')]));_0x3627c1[_0x0e02('0x34')]=_0x3627c1[_0x0e02('0x34')][_0x0e02('0x36')]?_0x3627c1[_0x0e02('0x34')]:_0xa37b6f[_0x0e02('0x2f')];_0x3627c1[_0x0e02('0x4e')]=qs[_0x0e02('0x39')](_0x55d25f['query']['sort']);_0x3627c1[_0x0e02('0x40')]=qs[_0x0e02('0x32')](_[_0x0e02('0x3a')](_0x55d25f[_0x0e02('0x31')],_0xa37b6f['filters']));if(_0x55d25f[_0x0e02('0x31')][_0x0e02('0x4f')]){_0x3627c1['where']=_[_0x0e02('0x3e')](_0x3627c1[_0x0e02('0x40')],{'$or':_[_0x0e02('0x50')](_0x3627c1[_0x0e02('0x34')],function(_0x25c669){var _0x156614={};_0x156614[_0x25c669]={'$like':'%'+_0x55d25f['query'][_0x0e02('0x4f')]+'%'};return _0x156614;})});}_0x3627c1=_[_0x0e02('0x3e')]({},_0x3627c1,_0x55d25f[_0x0e02('0x3f')]);return _0x31dac8[_0x0e02('0x4b')](_0x3627c1);}})[_0x0e02('0x28')](function(_0x13c8db){if(_0x13c8db){_0xffcfa0=_0x13c8db['length'];if(!_0x55d25f[_0x0e02('0x31')]['hasOwnProperty']('nolimit')){_0x3627c1[_0x0e02('0x21')]=qs[_0x0e02('0x21')](_0x55d25f[_0x0e02('0x31')]['limit']);_0x3627c1[_0x0e02('0x20')]=qs[_0x0e02('0x20')](_0x55d25f[_0x0e02('0x31')][_0x0e02('0x20')]);}return _0x31dac8[_0x0e02('0x4b')](_0x3627c1);}})[_0x0e02('0x28')](function(_0x6cd839){if(_0x6cd839){return _0x6cd839?{'count':_0xffcfa0,'rows':_0x6cd839}:null;}})[_0x0e02('0x28')](respondWithResult(_0x7aa3d1,null))[_0x0e02('0x1b')](handleError(_0x7aa3d1,null));};exports['getSubjects']=function(_0x1d13cb,_0x9d55c6,_0x509d70){var _0x152586={};var _0x4ce767={};var _0x58595e;var _0x104652;return db[_0x0e02('0x2d')][_0x0e02('0x4c')]({'where':{'id':_0x1d13cb[_0x0e02('0x4a')]['id']}})[_0x0e02('0x28')](handleEntityNotFound(_0x9d55c6,null))['then'](function(_0x1501ef){if(_0x1501ef){_0x58595e=_0x1501ef;_0x4ce767[_0x0e02('0x2f')]=_[_0x0e02('0x30')](db[_0x0e02('0x4d')][_0x0e02('0x2e')]);_0x4ce767[_0x0e02('0x31')]=_[_0x0e02('0x30')](_0x1d13cb[_0x0e02('0x31')]);_0x4ce767[_0x0e02('0x32')]=_['intersection'](_0x4ce767[_0x0e02('0x2f')],_0x4ce767[_0x0e02('0x31')]);_0x152586['attributes']=_['intersection'](_0x4ce767[_0x0e02('0x2f')],qs[_0x0e02('0x35')](_0x1d13cb[_0x0e02('0x31')][_0x0e02('0x35')]));_0x152586[_0x0e02('0x34')]=_0x152586[_0x0e02('0x34')][_0x0e02('0x36')]?_0x152586[_0x0e02('0x34')]:_0x4ce767['model'];_0x152586[_0x0e02('0x4e')]=qs['sort'](_0x1d13cb[_0x0e02('0x31')]['sort']);_0x152586[_0x0e02('0x40')]=qs[_0x0e02('0x32')](_[_0x0e02('0x3a')](_0x1d13cb[_0x0e02('0x31')],_0x4ce767[_0x0e02('0x32')]));if(_0x1d13cb[_0x0e02('0x31')]['filter']){_0x152586['where']=_[_0x0e02('0x3e')](_0x152586[_0x0e02('0x40')],{'$or':_[_0x0e02('0x50')](_0x152586[_0x0e02('0x34')],function(_0x5bef68){var _0x14c41c={};_0x14c41c[_0x5bef68]={'$like':'%'+_0x1d13cb[_0x0e02('0x31')]['filter']+'%'};return _0x14c41c;})});}_0x152586=_[_0x0e02('0x3e')]({},_0x152586,_0x1d13cb[_0x0e02('0x3f')]);return _0x58595e[_0x0e02('0x51')](_0x152586);}})[_0x0e02('0x28')](function(_0x4fe3e0){if(_0x4fe3e0){_0x104652=_0x4fe3e0['length'];if(!_0x1d13cb[_0x0e02('0x31')][_0x0e02('0x37')](_0x0e02('0x38'))){_0x152586['limit']=qs[_0x0e02('0x21')](_0x1d13cb[_0x0e02('0x31')][_0x0e02('0x21')]);_0x152586[_0x0e02('0x20')]=qs[_0x0e02('0x20')](_0x1d13cb['query'][_0x0e02('0x20')]);}return _0x58595e['getSubjects'](_0x152586);}})[_0x0e02('0x28')](function(_0x1f85c7){if(_0x1f85c7){return _0x1f85c7?{'count':_0x104652,'rows':_0x1f85c7}:null;}})['then'](respondWithResult(_0x9d55c6,null))[_0x0e02('0x1b')](handleError(_0x9d55c6,null));};exports[_0x0e02('0x52')]=function(_0x4fd12b,_0x277a30,_0xe3f211){var _0x1e1c39={};var _0x484642={};var _0x1d4f34;var _0x4524c9;return db[_0x0e02('0x2d')][_0x0e02('0x4c')]({'where':{'id':_0x4fd12b[_0x0e02('0x4a')]['id']}})[_0x0e02('0x28')](handleEntityNotFound(_0x277a30,null))[_0x0e02('0x28')](function(_0x252107){if(_0x252107){_0x1d4f34=_0x252107;_0x484642['model']=_[_0x0e02('0x30')](db[_0x0e02('0x4d')][_0x0e02('0x2e')]);_0x484642['query']=_[_0x0e02('0x30')](_0x4fd12b['query']);_0x484642[_0x0e02('0x32')]=_[_0x0e02('0x33')](_0x484642[_0x0e02('0x2f')],_0x484642[_0x0e02('0x31')]);_0x1e1c39[_0x0e02('0x34')]=_[_0x0e02('0x33')](_0x484642['model'],qs['fields'](_0x4fd12b[_0x0e02('0x31')][_0x0e02('0x35')]));_0x1e1c39['attributes']=_0x1e1c39['attributes'][_0x0e02('0x36')]?_0x1e1c39['attributes']:_0x484642['model'];_0x1e1c39[_0x0e02('0x4e')]=qs[_0x0e02('0x39')](_0x4fd12b[_0x0e02('0x31')][_0x0e02('0x39')]);_0x1e1c39[_0x0e02('0x40')]=qs['filters'](_[_0x0e02('0x3a')](_0x4fd12b[_0x0e02('0x31')],_0x484642[_0x0e02('0x32')]));if(_0x4fd12b[_0x0e02('0x31')][_0x0e02('0x4f')]){_0x1e1c39[_0x0e02('0x40')]=_['merge'](_0x1e1c39[_0x0e02('0x40')],{'$or':_[_0x0e02('0x50')](_0x1e1c39[_0x0e02('0x34')],function(_0x187bff){var _0x5cc37d={};_0x5cc37d[_0x187bff]={'$like':'%'+_0x4fd12b[_0x0e02('0x31')][_0x0e02('0x4f')]+'%'};return _0x5cc37d;})});}_0x1e1c39=_[_0x0e02('0x3e')]({},_0x1e1c39,_0x4fd12b[_0x0e02('0x3f')]);return _0x1d4f34[_0x0e02('0x52')](_0x1e1c39);}})[_0x0e02('0x28')](function(_0x2c7888){if(_0x2c7888){_0x4524c9=_0x2c7888[_0x0e02('0x36')];if(!_0x4fd12b['query'][_0x0e02('0x37')](_0x0e02('0x38'))){_0x1e1c39['limit']=qs['limit'](_0x4fd12b[_0x0e02('0x31')][_0x0e02('0x21')]);_0x1e1c39['offset']=qs[_0x0e02('0x20')](_0x4fd12b[_0x0e02('0x31')][_0x0e02('0x20')]);}return _0x1d4f34[_0x0e02('0x52')](_0x1e1c39);}})[_0x0e02('0x28')](function(_0x1545e3){if(_0x1545e3){return _0x1545e3?{'count':_0x4524c9,'rows':_0x1545e3}:null;}})[_0x0e02('0x28')](respondWithResult(_0x277a30,null))[_0x0e02('0x1b')](handleError(_0x277a30,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index be8c83c..3df4df7 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 _0x43bf=['exports','int_servicenow_configurations','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1db153,_0x1ab5d){var _0x530cbe=function(_0x4115f7){while(--_0x4115f7){_0x1db153['push'](_0x1db153['shift']());}};_0x530cbe(++_0x1ab5d);}(_0x43bf,0x9b));var _0xf43b=function(_0x327cf9,_0x4b9efb){_0x327cf9=_0x327cf9-0x0;var _0x4d9e06=_0x43bf[_0x327cf9];return _0x4d9e06;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf43b('0x0'));var moment=require(_0xf43b('0x1'));var BPromise=require(_0xf43b('0x2'));var rp=require(_0xf43b('0x3'));var fs=require('fs');var path=require(_0xf43b('0x4'));var rimraf=require(_0xf43b('0x5'));var config=require(_0xf43b('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xf43b('0x7')]=function(_0x3e0e63,_0xb885d){return _0x3e0e63['define']('ServicenowConfiguration',attributes,{'tableName':_0xf43b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c64=['path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','../../config/logger','api'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x0c64,0x1ce));var _0x40c6=function(_0x1d8c48,_0x2a6f9e){_0x1d8c48=_0x1d8c48-0x0;var _0x56a1fd=_0x0c64[_0x1d8c48];return _0x56a1fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x40c6('0x0'))(_0x40c6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x40c6('0x2'));var rimraf=require('rimraf');var config=require(_0x40c6('0x3'));var attributes=require(_0x40c6('0x4'));module[_0x40c6('0x5')]=function(_0x35dbe3,_0x57026d){return _0x35dbe3[_0x40c6('0x6')](_0x40c6('0x7'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index c175128..27e4e2d 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 _0x13f6=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13f6,0x105));var _0x613f=function(_0x27324c,_0x9599a0){_0x27324c=_0x27324c-0x0;var _0x271256=_0x13f6[_0x27324c];return _0x271256;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x613f('0x4'))['db'];var utils=require(_0x613f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x613f('0x6'));var jayson=require(_0x613f('0x7'));var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x501ed8,_0x49b457,_0x28ba05){return new BPromise(function(_0x8c58d9,_0x13f5e2){return client['request'](_0x501ed8,_0x28ba05)[_0x613f('0xa')](function(_0x27b67d){logger[_0x613f('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x49b457,'request\x20sent');logger[_0x613f('0xc')](_0x613f('0xd'),_0x49b457,_0x613f('0xe'),JSON['stringify'](_0x27b67d));if(_0x27b67d['error']){if(_0x27b67d[_0x613f('0xf')][_0x613f('0x10')]===0x1f4){logger[_0x613f('0xf')](_0x613f('0x11'),_0x49b457,_0x27b67d[_0x613f('0xf')][_0x613f('0x12')]);return _0x13f5e2(_0x27b67d[_0x613f('0xf')]['message']);}logger[_0x613f('0xf')](_0x613f('0x11'),_0x49b457,_0x27b67d[_0x613f('0xf')][_0x613f('0x12')]);return _0x8c58d9(_0x27b67d['error'][_0x613f('0x12')]);}else{logger[_0x613f('0xb')](_0x613f('0x11'),_0x49b457,_0x613f('0xe'));_0x8c58d9(_0x27b67d[_0x613f('0x13')][_0x613f('0x12')]);}})[_0x613f('0x14')](function(_0x622986){logger[_0x613f('0xf')](_0x613f('0x11'),_0x49b457,_0x622986);_0x13f5e2(_0x622986);});});} \ No newline at end of file +var _0x6c04=['../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x3426be,_0xfe241a){var _0x5b9fa3=function(_0x2201a8){while(--_0x2201a8){_0x3426be['push'](_0x3426be['shift']());}};_0x5b9fa3(++_0xfe241a);}(_0x6c04,0x1b3));var _0x46c0=function(_0x563962,_0x17774f){_0x563962=_0x563962-0x0;var _0x298af1=_0x6c04[_0x563962];return _0x298af1;};'use strict';var _=require(_0x46c0('0x0'));var util=require(_0x46c0('0x1'));var moment=require('moment');var BPromise=require(_0x46c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c0('0x3'))['db'];var utils=require(_0x46c0('0x4'));var logger=require(_0x46c0('0x5'))('rpc');var config=require(_0x46c0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x46c0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x75476f,_0x2e9593,_0x1891ab){return new BPromise(function(_0x4d5513,_0x2a786b){return client[_0x46c0('0x8')](_0x75476f,_0x1891ab)['then'](function(_0x13ee5d){logger[_0x46c0('0x9')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2e9593,_0x46c0('0xa'));logger[_0x46c0('0xb')](_0x46c0('0xc'),_0x2e9593,_0x46c0('0xa'),JSON[_0x46c0('0xd')](_0x13ee5d));if(_0x13ee5d[_0x46c0('0xe')]){if(_0x13ee5d['error'][_0x46c0('0xf')]===0x1f4){logger[_0x46c0('0xe')](_0x46c0('0x10'),_0x2e9593,_0x13ee5d[_0x46c0('0xe')][_0x46c0('0x11')]);return _0x2a786b(_0x13ee5d[_0x46c0('0xe')][_0x46c0('0x11')]);}logger[_0x46c0('0xe')](_0x46c0('0x10'),_0x2e9593,_0x13ee5d['error'][_0x46c0('0x11')]);return _0x4d5513(_0x13ee5d['error'][_0x46c0('0x11')]);}else{logger[_0x46c0('0x9')](_0x46c0('0x10'),_0x2e9593,'request\x20sent');_0x4d5513(_0x13ee5d[_0x46c0('0x12')]['message']);}})[_0x46c0('0x13')](function(_0x1420bc){logger[_0x46c0('0xe')](_0x46c0('0x10'),_0x2e9593,_0x1420bc);_0x2a786b(_0x1420bc);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f795d01..399fb9b 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 _0x538b=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x538b,0x79));var _0xb538=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x538b[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xb538('0x0'));var util=require(_0xb538('0x1'));var path=require(_0xb538('0x2'));var timeout=require(_0xb538('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb538('0x4'));var interaction=require(_0xb538('0x5'));var config=require(_0xb538('0x6'));var controller=require(_0xb538('0x7'));router['get']('/',auth[_0xb538('0x8')](),controller[_0xb538('0x9')]);router[_0xb538('0xa')](_0xb538('0xb'),auth[_0xb538('0x8')](),controller[_0xb538('0xc')]);router[_0xb538('0xd')]('/',auth[_0xb538('0x8')](),controller['create']);router[_0xb538('0xe')](_0xb538('0xb'),auth[_0xb538('0x8')](),controller[_0xb538('0xf')]);router['delete']('/:id',auth[_0xb538('0x8')](),controller[_0xb538('0x10')]);module[_0xb538('0x11')]=router; \ No newline at end of file +var _0x7094=['util','path','connect-timeout','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7094,0x1c0));var _0x4709=function(_0x4e23a0,_0x251c81){_0x4e23a0=_0x4e23a0-0x0;var _0x4b427d=_0x7094[_0x4e23a0];return _0x4b427d;};'use strict';var multer=require('multer');var util=require(_0x4709('0x0'));var path=require(_0x4709('0x1'));var timeout=require(_0x4709('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4709('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4709('0x4'));var controller=require(_0x4709('0x5'));router[_0x4709('0x6')]('/',auth[_0x4709('0x7')](),controller['index']);router[_0x4709('0x6')](_0x4709('0x8'),auth[_0x4709('0x7')](),controller['show']);router[_0x4709('0x9')]('/',auth[_0x4709('0x7')](),controller[_0x4709('0xa')]);router[_0x4709('0xb')](_0x4709('0x8'),auth[_0x4709('0x7')](),controller[_0x4709('0xc')]);router[_0x4709('0xd')](_0x4709('0x8'),auth[_0x4709('0x7')](),controller[_0x4709('0xe')]);module[_0x4709('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 25f1f25..c992ace 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 _0x9c00=['sequelize','exports','variable','customVariable','string','STRING','ENUM','BOOLEAN'];(function(_0x51f567,_0x59f429){var _0x54d999=function(_0x1a6c95){while(--_0x1a6c95){_0x51f567['push'](_0x51f567['shift']());}};_0x54d999(++_0x59f429);}(_0x9c00,0x1a0));var _0x09c0=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x9c00[_0xf2f332];return _0x56cce3;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x09c0('0x2'),_0x09c0('0x3'),'keyValue'),'defaultValue':_0x09c0('0x4')},'content':{'type':Sequelize[_0x09c0('0x5')]},'key':{'type':Sequelize[_0x09c0('0x5')]},'keyType':{'type':Sequelize[_0x09c0('0x6')](_0x09c0('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x09c0('0x5')]},'idField':{'type':Sequelize[_0x09c0('0x5')]},'nameField':{'type':Sequelize[_0x09c0('0x5')]},'customField':{'type':Sequelize[_0x09c0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x09c0('0x5')]}}; \ No newline at end of file +var _0x1339=['keyValue','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x2d3be5,_0x487237){var _0x34627a=function(_0x25569a){while(--_0x25569a){_0x2d3be5['push'](_0x2d3be5['shift']());}};_0x34627a(++_0x487237);}(_0x1339,0x1ed));var _0x9133=function(_0x4d295b,_0x1f5def){_0x4d295b=_0x4d295b-0x0;var _0xa11356=_0x1339[_0x4d295b];return _0xa11356;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9133('0x0')](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'),_0x9133('0x4')),'defaultValue':_0x9133('0x1')},'content':{'type':Sequelize[_0x9133('0x5')]},'key':{'type':Sequelize[_0x9133('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9133('0x5')]},'nameField':{'type':Sequelize[_0x9133('0x5')]},'customField':{'type':Sequelize[_0x9133('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9133('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 25e83c0..c41a820 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 _0x3391=['crypto','jsforce','desk.js','querystring','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','ServicenowField','includeAll','include','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x3391,0x13f));var _0x1339=function(_0x25c0bd,_0x3d5090){_0x25c0bd=_0x25c0bd-0x0;var _0x2ab3bb=_0x3391[_0x25c0bd];return _0x2ab3bb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1339('0x0'));var rimraf=require(_0x1339('0x1'));var zipdir=require(_0x1339('0x2'));var jsonpatch=require(_0x1339('0x3'));var rp=require(_0x1339('0x4'));var moment=require(_0x1339('0x5'));var BPromise=require(_0x1339('0x6'));var Mustache=require('mustache');var util=require(_0x1339('0x7'));var path=require(_0x1339('0x8'));var sox=require('sox');var csv=require(_0x1339('0x9'));var ejs=require(_0x1339('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1339('0xb'));var jsforce=require(_0x1339('0xc'));var deskjs=require(_0x1339('0xd'));var toCsv=require(_0x1339('0x9'));var querystring=require(_0x1339('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1339('0xf'));var db=require(_0x1339('0x10'))['db'];function respondWithStatusCode(_0x3bcfe9,_0x35992b){_0x35992b=_0x35992b||0xcc;return function(_0x52fc6d){if(_0x52fc6d){return _0x3bcfe9[_0x1339('0x11')](_0x35992b);}return _0x3bcfe9['status'](_0x35992b)[_0x1339('0x12')]();};}function respondWithResult(_0x433322,_0x352e01){_0x352e01=_0x352e01||0xc8;return function(_0x23e26f){if(_0x23e26f){return _0x433322[_0x1339('0x13')](_0x352e01)[_0x1339('0x14')](_0x23e26f);}};}function respondWithFilteredResult(_0x32a2e6,_0x3a877e){return function(_0x5258ff){if(_0x5258ff){var _0x47ec95=_0x5258ff[_0x1339('0x15')],_0x20dd43=_0x3a877e[_0x1339('0x16')],_0x3168a4=_0x3a877e[_0x1339('0x16')]+_0x3a877e[_0x1339('0x17')],_0x56b793;if(_0x3168a4>=_0x47ec95){_0x3168a4=_0x47ec95;_0x56b793=0xc8;}else{_0x56b793=0xce;}_0x32a2e6[_0x1339('0x13')](_0x56b793);return _0x32a2e6[_0x1339('0x18')]('Content-Range',_0x20dd43+'-'+_0x3168a4+'/'+_0x47ec95)['json'](_0x5258ff);}return null;};}function patchUpdates(_0x5cf814){return function(_0x13f929){try{jsonpatch[_0x1339('0x19')](_0x13f929,_0x5cf814,!![]);}catch(_0x28c3b8){return BPromise[_0x1339('0x1a')](_0x28c3b8);}return _0x13f929[_0x1339('0x1b')]();};}function saveUpdates(_0x3937dc,_0x1b1d36){return function(_0x24a6e1){if(_0x24a6e1){return _0x24a6e1[_0x1339('0x1c')](_0x3937dc)[_0x1339('0x1d')](function(_0x1129af){return _0x1129af;});}return null;};}function removeEntity(_0x3a3505,_0x3916f3){return function(_0x4a2257){if(_0x4a2257){return _0x4a2257[_0x1339('0x1e')]()[_0x1339('0x1d')](function(){_0x3a3505['status'](0xcc)[_0x1339('0x12')]();});}};}function handleEntityNotFound(_0x220a4d,_0x35afbe){return function(_0x227058){if(!_0x227058){_0x220a4d[_0x1339('0x11')](0x194);}return _0x227058;};}function handleError(_0x2f3be5,_0x228232){_0x228232=_0x228232||0x1f4;return function(_0x10e681){logger[_0x1339('0x1f')](_0x10e681['stack']);if(_0x10e681['name']){delete _0x10e681[_0x1339('0x20')];}_0x2f3be5[_0x1339('0x13')](_0x228232)[_0x1339('0x21')](_0x10e681);};}exports[_0x1339('0x22')]=function(_0x5cd5ae,_0x5b5a18){var _0x46a25b={},_0x270b39={},_0xd0831a={'count':0x0,'rows':[]};var _0x560320=db['ServicenowField'][_0x1339('0x23')];_0x270b39['model']=_[_0x1339('0x24')](_0x560320);_0x270b39['query']=_['keys'](_0x5cd5ae[_0x1339('0x25')]);_0x270b39['filters']=_['intersection'](_0x270b39[_0x1339('0x26')],_0x270b39['query']);_0x46a25b[_0x1339('0x27')]=_[_0x1339('0x28')](_0x270b39[_0x1339('0x26')],qs[_0x1339('0x29')](_0x5cd5ae[_0x1339('0x25')][_0x1339('0x29')]));_0x46a25b['attributes']=_0x46a25b['attributes'][_0x1339('0x2a')]?_0x46a25b[_0x1339('0x27')]:_0x270b39[_0x1339('0x26')];if(!_0x5cd5ae[_0x1339('0x25')][_0x1339('0x2b')](_0x1339('0x2c'))){_0x46a25b['limit']=qs['limit'](_0x5cd5ae['query'][_0x1339('0x17')]);_0x46a25b[_0x1339('0x16')]=qs[_0x1339('0x16')](_0x5cd5ae['query'][_0x1339('0x16')]);}_0x46a25b[_0x1339('0x2d')]=qs[_0x1339('0x2e')](_0x5cd5ae['query'][_0x1339('0x2e')]);_0x46a25b[_0x1339('0x2f')]=qs[_0x1339('0x30')](_[_0x1339('0x31')](_0x5cd5ae['query'],_0x270b39[_0x1339('0x30')]));if(_0x5cd5ae[_0x1339('0x25')][_0x1339('0x32')]){_0x46a25b[_0x1339('0x2f')]=_['merge'](_0x46a25b[_0x1339('0x2f')],{'$or':_[_0x1339('0x33')](_0x560320,function(_0x44e6c4){if(_0x44e6c4[_0x1339('0x34')][_0x1339('0x35')]!==_0x1339('0x36')){var _0x315443={};_0x315443[_0x44e6c4['field']]={'$like':'%'+_0x5cd5ae[_0x1339('0x25')][_0x1339('0x32')]+'%'};return _0x315443;}})});}_0x46a25b=_['merge']({},_0x46a25b,_0x5cd5ae['options']);var _0x37ef39={'where':_0x46a25b[_0x1339('0x2f')]};return db[_0x1339('0x37')]['count'](_0x37ef39)[_0x1339('0x1d')](function(_0xde0535){_0xd0831a['count']=_0xde0535;if(_0x5cd5ae[_0x1339('0x25')][_0x1339('0x38')]){_0x46a25b[_0x1339('0x39')]=[{'all':!![]}];}return db[_0x1339('0x37')]['findAll'](_0x46a25b);})[_0x1339('0x1d')](function(_0x36ccb6){_0xd0831a[_0x1339('0x3a')]=_0x36ccb6;return _0xd0831a;})[_0x1339('0x1d')](respondWithFilteredResult(_0x5b5a18,_0x46a25b))['catch'](handleError(_0x5b5a18,null));};exports[_0x1339('0x3b')]=function(_0x26520f,_0x14d15d){var _0x3a680f={'raw':!![],'where':{'id':_0x26520f[_0x1339('0x3c')]['id']}},_0x2ac965={};_0x2ac965['model']=_['keys'](db[_0x1339('0x37')][_0x1339('0x23')]);_0x2ac965['query']=_[_0x1339('0x24')](_0x26520f[_0x1339('0x25')]);_0x2ac965[_0x1339('0x30')]=_[_0x1339('0x28')](_0x2ac965[_0x1339('0x26')],_0x2ac965[_0x1339('0x25')]);_0x3a680f[_0x1339('0x27')]=_[_0x1339('0x28')](_0x2ac965['model'],qs[_0x1339('0x29')](_0x26520f['query']['fields']));_0x3a680f[_0x1339('0x27')]=_0x3a680f['attributes']['length']?_0x3a680f[_0x1339('0x27')]:_0x2ac965[_0x1339('0x26')];if(_0x26520f['query'][_0x1339('0x38')]){_0x3a680f[_0x1339('0x39')]=[{'all':!![]}];}_0x3a680f=_['merge']({},_0x3a680f,_0x26520f[_0x1339('0x3d')]);return db[_0x1339('0x37')][_0x1339('0x3e')](_0x3a680f)[_0x1339('0x1d')](handleEntityNotFound(_0x14d15d,null))[_0x1339('0x1d')](respondWithResult(_0x14d15d,null))[_0x1339('0x3f')](handleError(_0x14d15d,null));};exports[_0x1339('0x40')]=function(_0x271263,_0x4b4085){return db[_0x1339('0x37')][_0x1339('0x40')](_0x271263['body'],{})[_0x1339('0x1d')](respondWithResult(_0x4b4085,0xc9))[_0x1339('0x3f')](handleError(_0x4b4085,null));};exports[_0x1339('0x1c')]=function(_0x39d170,_0x28831d){if(_0x39d170[_0x1339('0x41')]['id']){delete _0x39d170[_0x1339('0x41')]['id'];}return db[_0x1339('0x37')][_0x1339('0x3e')]({'where':{'id':_0x39d170[_0x1339('0x3c')]['id']}})[_0x1339('0x1d')](handleEntityNotFound(_0x28831d,null))[_0x1339('0x1d')](saveUpdates(_0x39d170[_0x1339('0x41')],null))['then'](respondWithResult(_0x28831d,null))[_0x1339('0x3f')](handleError(_0x28831d,null));};exports[_0x1339('0x1e')]=function(_0x2fc36e,_0x3bf12a){return db[_0x1339('0x37')][_0x1339('0x3e')]({'where':{'id':_0x2fc36e[_0x1339('0x3c')]['id']}})[_0x1339('0x1d')](handleEntityNotFound(_0x3bf12a,null))[_0x1339('0x1d')](removeEntity(_0x3bf12a,null))[_0x1339('0x3f')](handleError(_0x3bf12a,null));}; \ No newline at end of file +var _0x9c84=['reject','save','update','destroy','then','end','sendStatus','stack','name','send','index','ServicenowField','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','field','count','include','findAll','rows','catch','params','fields','includeAll','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','limit','set','Content-Range','apply'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x9c84,0x192));var _0x49c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9c84[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x49c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49c8('0x1'));var jsonpatch=require(_0x49c8('0x2'));var rp=require(_0x49c8('0x3'));var moment=require(_0x49c8('0x4'));var BPromise=require(_0x49c8('0x5'));var Mustache=require(_0x49c8('0x6'));var util=require(_0x49c8('0x7'));var path=require(_0x49c8('0x8'));var sox=require(_0x49c8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x49c8('0xa'));var squel=require(_0x49c8('0xb'));var crypto=require(_0x49c8('0xc'));var jsforce=require(_0x49c8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x49c8('0xe'));var querystring=require(_0x49c8('0xf'));var Papa=require(_0x49c8('0x10'));var Redis=require(_0x49c8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x49c8('0x12'));var logger=require(_0x49c8('0x13'))(_0x49c8('0x14'));var utils=require(_0x49c8('0x15'));var config=require(_0x49c8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ab62e,_0x45e217){_0x45e217=_0x45e217||0xcc;return function(_0x575271){if(_0x575271){return _0x5ab62e['sendStatus'](_0x45e217);}return _0x5ab62e[_0x49c8('0x17')](_0x45e217)['end']();};}function respondWithResult(_0x4c92a7,_0x2f1f37){_0x2f1f37=_0x2f1f37||0xc8;return function(_0x493625){if(_0x493625){return _0x4c92a7[_0x49c8('0x17')](_0x2f1f37)[_0x49c8('0x18')](_0x493625);}};}function respondWithFilteredResult(_0x421e53,_0x3443cc){return function(_0x21223f){if(_0x21223f){var _0x341eb5=_0x21223f['count'],_0x34d553=_0x3443cc['offset'],_0xc56260=_0x3443cc[_0x49c8('0x19')]+_0x3443cc[_0x49c8('0x1a')],_0x39f095;if(_0xc56260>=_0x341eb5){_0xc56260=_0x341eb5;_0x39f095=0xc8;}else{_0x39f095=0xce;}_0x421e53[_0x49c8('0x17')](_0x39f095);return _0x421e53[_0x49c8('0x1b')](_0x49c8('0x1c'),_0x34d553+'-'+_0xc56260+'/'+_0x341eb5)[_0x49c8('0x18')](_0x21223f);}return null;};}function patchUpdates(_0x476240){return function(_0x12aaff){try{jsonpatch[_0x49c8('0x1d')](_0x12aaff,_0x476240,!![]);}catch(_0x40ec85){return BPromise[_0x49c8('0x1e')](_0x40ec85);}return _0x12aaff[_0x49c8('0x1f')]();};}function saveUpdates(_0x574699,_0x28cbbd){return function(_0x98532d){if(_0x98532d){return _0x98532d[_0x49c8('0x20')](_0x574699)['then'](function(_0x3237ac){return _0x3237ac;});}return null;};}function removeEntity(_0x4ac199,_0x5a0a01){return function(_0x17af10){if(_0x17af10){return _0x17af10[_0x49c8('0x21')]()[_0x49c8('0x22')](function(){_0x4ac199[_0x49c8('0x17')](0xcc)[_0x49c8('0x23')]();});}};}function handleEntityNotFound(_0x1e709e,_0xba7d6d){return function(_0x32198c){if(!_0x32198c){_0x1e709e[_0x49c8('0x24')](0x194);}return _0x32198c;};}function handleError(_0x1dfa22,_0x5361a8){_0x5361a8=_0x5361a8||0x1f4;return function(_0xfbecf){logger['error'](_0xfbecf[_0x49c8('0x25')]);if(_0xfbecf[_0x49c8('0x26')]){delete _0xfbecf[_0x49c8('0x26')];}_0x1dfa22[_0x49c8('0x17')](_0x5361a8)[_0x49c8('0x27')](_0xfbecf);};}exports[_0x49c8('0x28')]=function(_0x3524bb,_0x19c41f){var _0x1efa22={},_0x596b21={},_0x24edab={'count':0x0,'rows':[]};var _0x78660f=db[_0x49c8('0x29')][_0x49c8('0x2a')];_0x596b21['model']=_['keys'](_0x78660f);_0x596b21['query']=_[_0x49c8('0x2b')](_0x3524bb[_0x49c8('0x2c')]);_0x596b21[_0x49c8('0x2d')]=_[_0x49c8('0x2e')](_0x596b21[_0x49c8('0x2f')],_0x596b21[_0x49c8('0x2c')]);_0x1efa22[_0x49c8('0x30')]=_['intersection'](_0x596b21[_0x49c8('0x2f')],qs['fields'](_0x3524bb['query']['fields']));_0x1efa22[_0x49c8('0x30')]=_0x1efa22[_0x49c8('0x30')][_0x49c8('0x31')]?_0x1efa22[_0x49c8('0x30')]:_0x596b21[_0x49c8('0x2f')];if(!_0x3524bb[_0x49c8('0x2c')][_0x49c8('0x32')](_0x49c8('0x33'))){_0x1efa22[_0x49c8('0x1a')]=qs['limit'](_0x3524bb[_0x49c8('0x2c')][_0x49c8('0x1a')]);_0x1efa22[_0x49c8('0x19')]=qs[_0x49c8('0x19')](_0x3524bb[_0x49c8('0x2c')][_0x49c8('0x19')]);}_0x1efa22[_0x49c8('0x34')]=qs[_0x49c8('0x35')](_0x3524bb[_0x49c8('0x2c')]['sort']);_0x1efa22[_0x49c8('0x36')]=qs[_0x49c8('0x2d')](_['pick'](_0x3524bb[_0x49c8('0x2c')],_0x596b21[_0x49c8('0x2d')]));if(_0x3524bb[_0x49c8('0x2c')][_0x49c8('0x37')]){_0x1efa22[_0x49c8('0x36')]=_[_0x49c8('0x38')](_0x1efa22[_0x49c8('0x36')],{'$or':_['map'](_0x78660f,function(_0x559db4){if(_0x559db4[_0x49c8('0x39')][_0x49c8('0x3a')]!=='VIRTUAL'){var _0x5643ac={};_0x5643ac[_0x559db4[_0x49c8('0x3b')]]={'$like':'%'+_0x3524bb[_0x49c8('0x2c')][_0x49c8('0x37')]+'%'};return _0x5643ac;}})});}_0x1efa22=_[_0x49c8('0x38')]({},_0x1efa22,_0x3524bb['options']);var _0x15fbf0={'where':_0x1efa22['where']};return db[_0x49c8('0x29')]['count'](_0x15fbf0)[_0x49c8('0x22')](function(_0x1d7f19){_0x24edab[_0x49c8('0x3c')]=_0x1d7f19;if(_0x3524bb[_0x49c8('0x2c')]['includeAll']){_0x1efa22[_0x49c8('0x3d')]=[{'all':!![]}];}return db[_0x49c8('0x29')][_0x49c8('0x3e')](_0x1efa22);})['then'](function(_0x27de0a){_0x24edab[_0x49c8('0x3f')]=_0x27de0a;return _0x24edab;})['then'](respondWithFilteredResult(_0x19c41f,_0x1efa22))[_0x49c8('0x40')](handleError(_0x19c41f,null));};exports['show']=function(_0x19ef36,_0xe2602c){var _0x2956c0={'raw':!![],'where':{'id':_0x19ef36[_0x49c8('0x41')]['id']}},_0x1812a9={};_0x1812a9[_0x49c8('0x2f')]=_[_0x49c8('0x2b')](db[_0x49c8('0x29')][_0x49c8('0x2a')]);_0x1812a9[_0x49c8('0x2c')]=_[_0x49c8('0x2b')](_0x19ef36['query']);_0x1812a9[_0x49c8('0x2d')]=_[_0x49c8('0x2e')](_0x1812a9[_0x49c8('0x2f')],_0x1812a9[_0x49c8('0x2c')]);_0x2956c0[_0x49c8('0x30')]=_[_0x49c8('0x2e')](_0x1812a9[_0x49c8('0x2f')],qs[_0x49c8('0x42')](_0x19ef36[_0x49c8('0x2c')][_0x49c8('0x42')]));_0x2956c0[_0x49c8('0x30')]=_0x2956c0[_0x49c8('0x30')]['length']?_0x2956c0[_0x49c8('0x30')]:_0x1812a9[_0x49c8('0x2f')];if(_0x19ef36['query'][_0x49c8('0x43')]){_0x2956c0[_0x49c8('0x3d')]=[{'all':!![]}];}_0x2956c0=_[_0x49c8('0x38')]({},_0x2956c0,_0x19ef36[_0x49c8('0x44')]);return db['ServicenowField'][_0x49c8('0x45')](_0x2956c0)[_0x49c8('0x22')](handleEntityNotFound(_0xe2602c,null))[_0x49c8('0x22')](respondWithResult(_0xe2602c,null))[_0x49c8('0x40')](handleError(_0xe2602c,null));};exports['create']=function(_0x49f99c,_0x40c984){return db['ServicenowField'][_0x49c8('0x46')](_0x49f99c[_0x49c8('0x47')],{})['then'](respondWithResult(_0x40c984,0xc9))[_0x49c8('0x40')](handleError(_0x40c984,null));};exports[_0x49c8('0x20')]=function(_0x56b611,_0x2a537d){if(_0x56b611['body']['id']){delete _0x56b611['body']['id'];}return db[_0x49c8('0x29')][_0x49c8('0x45')]({'where':{'id':_0x56b611[_0x49c8('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a537d,null))['then'](saveUpdates(_0x56b611['body'],null))[_0x49c8('0x22')](respondWithResult(_0x2a537d,null))[_0x49c8('0x40')](handleError(_0x2a537d,null));};exports[_0x49c8('0x21')]=function(_0x818dae,_0x243202){return db[_0x49c8('0x29')][_0x49c8('0x45')]({'where':{'id':_0x818dae['params']['id']}})[_0x49c8('0x22')](handleEntityNotFound(_0x243202,null))[_0x49c8('0x22')](removeEntity(_0x243202,null))[_0x49c8('0x40')](handleError(_0x243202,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7cd749d..3ec337f 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 _0xa726=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xa726,0x110));var _0x6a72=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xa726[_0x1ac120];return _0x19b703;};'use strict';var _=require(_0x6a72('0x0'));var util=require(_0x6a72('0x1'));var logger=require(_0x6a72('0x2'))('api');var moment=require(_0x6a72('0x3'));var BPromise=require(_0x6a72('0x4'));var rp=require(_0x6a72('0x5'));var fs=require('fs');var path=require(_0x6a72('0x6'));var rimraf=require(_0x6a72('0x7'));var config=require(_0x6a72('0x8'));var attributes=require(_0x6a72('0x9'));module[_0x6a72('0xa')]=function(_0x105dda,_0x359937){return _0x105dda[_0x6a72('0xb')](_0x6a72('0xc'),attributes,{'tableName':_0x6a72('0xd'),'paranoid':![],'indexes':[{'name':_0x6a72('0xe'),'fields':[_0x6a72('0xf'),_0x6a72('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x487f=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x487f,0x1d8));var _0xf487=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x487f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xf487('0x0'));var util=require(_0xf487('0x1'));var logger=require(_0xf487('0x2'))(_0xf487('0x3'));var moment=require(_0xf487('0x4'));var BPromise=require(_0xf487('0x5'));var rp=require(_0xf487('0x6'));var fs=require('fs');var path=require(_0xf487('0x7'));var rimraf=require(_0xf487('0x8'));var config=require(_0xf487('0x9'));var attributes=require(_0xf487('0xa'));module[_0xf487('0xb')]=function(_0x433345,_0x2f06da){return _0x433345['define'](_0xf487('0xc'),attributes,{'tableName':_0xf487('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xf487('0xe'),_0xf487('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 0924abf..1f684eb 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 _0xd824=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xd824,0xc2));var _0x4d82=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd824[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');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(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('ServicenowField,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});} \ No newline at end of file +var _0x6d38=['request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x51a355,_0x44e2bf){var _0xafb38f=function(_0x1c4024){while(--_0x1c4024){_0x51a355['push'](_0x51a355['shift']());}};_0xafb38f(++_0x44e2bf);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6d38[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('ServicenowField,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index cba3219..2bd3dfe 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 _0x4ed8=['create','delete','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','post'];(function(_0x12a62c,_0xc9c41a){var _0x268a58=function(_0x100ca9){while(--_0x100ca9){_0x12a62c['push'](_0x12a62c['shift']());}};_0x268a58(++_0xc9c41a);}(_0x4ed8,0xc9));var _0x84ed=function(_0x4ecc4c,_0x4ad4d4){_0x4ecc4c=_0x4ecc4c-0x0;var _0x1ef753=_0x4ed8[_0x4ecc4c];return _0x1ef753;};'use strict';var multer=require(_0x84ed('0x0'));var util=require('util');var path=require(_0x84ed('0x1'));var timeout=require(_0x84ed('0x2'));var express=require('express');var router=express[_0x84ed('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x84ed('0x4'));var config=require(_0x84ed('0x5'));var controller=require(_0x84ed('0x6'));router[_0x84ed('0x7')]('/',auth['isAuthenticated'](),controller[_0x84ed('0x8')]);router[_0x84ed('0x7')](_0x84ed('0x9'),auth[_0x84ed('0xa')](),controller['show']);router[_0x84ed('0x7')](_0x84ed('0xb'),auth[_0x84ed('0xa')](),controller['getConfigurations']);router[_0x84ed('0x7')](_0x84ed('0xc'),auth[_0x84ed('0xa')](),controller[_0x84ed('0xd')]);router[_0x84ed('0xe')]('/',auth[_0x84ed('0xa')](),controller[_0x84ed('0xf')]);router[_0x84ed('0xe')](_0x84ed('0xb'),auth[_0x84ed('0xa')](),controller['addConfiguration']);router['put'](_0x84ed('0x9'),auth[_0x84ed('0xa')](),controller['update']);router[_0x84ed('0x10')](_0x84ed('0x9'),auth[_0x84ed('0xa')](),controller['destroy']);module[_0x84ed('0x11')]=router; \ No newline at end of file +var _0x38ad=['get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1280d1,_0x16e67f){var _0x3c9cb0=function(_0x530069){while(--_0x530069){_0x1280d1['push'](_0x1280d1['shift']());}};_0x3c9cb0(++_0x16e67f);}(_0x38ad,0x77));var _0xd38a=function(_0x21a7d9,_0x1ea2c5){_0x21a7d9=_0x21a7d9-0x0;var _0x411897=_0x38ad[_0x21a7d9];return _0x411897;};'use strict';var multer=require(_0xd38a('0x0'));var util=require(_0xd38a('0x1'));var path=require(_0xd38a('0x2'));var timeout=require(_0xd38a('0x3'));var express=require('express');var router=express[_0xd38a('0x4')]();var auth=require(_0xd38a('0x5'));var interaction=require(_0xd38a('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmAccount.controller');router[_0xd38a('0x7')]('/',auth[_0xd38a('0x8')](),controller['index']);router[_0xd38a('0x7')](_0xd38a('0x9'),auth[_0xd38a('0x8')](),controller['show']);router[_0xd38a('0x7')](_0xd38a('0xa'),auth[_0xd38a('0x8')](),controller['getConfigurations']);router[_0xd38a('0x7')](_0xd38a('0xb'),auth[_0xd38a('0x8')](),controller[_0xd38a('0xc')]);router[_0xd38a('0xd')]('/',auth[_0xd38a('0x8')](),controller[_0xd38a('0xe')]);router[_0xd38a('0xd')](_0xd38a('0xa'),auth[_0xd38a('0x8')](),controller[_0xd38a('0xf')]);router[_0xd38a('0x10')](_0xd38a('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xd38a('0x11')](_0xd38a('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index f5d9b0c..e93effd 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 _0x4822=['username','exports','STRING'];(function(_0x4df969,_0x5df62b){var _0x6a2d46=function(_0x369da8){while(--_0x369da8){_0x4df969['push'](_0x4df969['shift']());}};_0x6a2d46(++_0x5df62b);}(_0x4822,0x1d2));var _0x2482=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x4822[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require('sequelize');module[_0x2482('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2482('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2482('0x2')},'password':{'type':Sequelize[_0x2482('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9906=['STRING','username','sequelize','exports'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x9906,0xda));var _0x6990=function(_0x1cfd34,_0x1159dc){_0x1cfd34=_0x1cfd34-0x0;var _0x3986c5=_0x9906[_0x1cfd34];return _0x3986c5;};'use strict';var Sequelize=require(_0x6990('0x0'));module[_0x6990('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6990('0x2')]},'username':{'type':Sequelize[_0x6990('0x2')],'unique':_0x6990('0x3')},'password':{'type':Sequelize[_0x6990('0x2')]},'remoteUri':{'type':Sequelize[_0x6990('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6990('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index c2625ff..254e6f9 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 _0x02c5=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','debug','request\x20sent','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','end','stack','name','index','SugarcrmAccount','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','map','key','VIRTUAL','field','merge','options','where','includeAll','include','rows','show','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','type','SugarcrmField','created_by','description','date_start','parent_id','parent_type','parent_name','direction','password','remoteUri','substring','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x02c5,0x17f));var _0x502c=function(_0x1a78f0,_0x398b53){_0x1a78f0=_0x1a78f0-0x0;var _0x3704e5=_0x02c5[_0x1a78f0];return _0x3704e5;};'use strict';var pdf=require(_0x502c('0x0'));var emlformat=require(_0x502c('0x1'));var rimraf=require(_0x502c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x502c('0x3'));var rp=require(_0x502c('0x4'));var moment=require(_0x502c('0x5'));var BPromise=require(_0x502c('0x6'));var Mustache=require(_0x502c('0x7'));var util=require(_0x502c('0x8'));var path=require(_0x502c('0x9'));var sox=require(_0x502c('0xa'));var csv=require(_0x502c('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x502c('0xc'));var squel=require(_0x502c('0xd'));var crypto=require(_0x502c('0xe'));var jsforce=require(_0x502c('0xf'));var deskjs=require(_0x502c('0x10'));var toCsv=require(_0x502c('0xb'));var querystring=require(_0x502c('0x11'));var Papa=require(_0x502c('0x12'));var Redis=require(_0x502c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x502c('0x14'));var hardwareService=require(_0x502c('0x15'));var logger=require(_0x502c('0x16'))(_0x502c('0x17'));var utils=require(_0x502c('0x18'));var config=require('../../config/environment');var db=require(_0x502c('0x19'))['db'];var integrations=require(_0x502c('0x1a'));var jayson=require(_0x502c('0x1b'));var client=jayson[_0x502c('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x6037ae,_0x29c534,_0x2da31d){if(_0x2da31d){var _0x1c04e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c04e8[_0x502c('0x1d')](_0x29c534)){return _0x6037ae;}else{throw new Error(_0x502c('0x1e'));}}else{return _0x6037ae;}}function respondWithRpcPromise(_0x4ce068,_0x1f20b8,_0x169574,_0x11a5e4){return new BPromise(function(_0x390fc5,_0x1173bc){var _0x56c98a=_0x11a5e4||client;return _0x56c98a[_0x502c('0x1f')](_0x4ce068,_0x169574)['then'](function(_0x440cab){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x1f20b8,'request\x20sent');logger[_0x502c('0x20')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1f20b8,_0x502c('0x21'),JSON['stringify'](_0x440cab));if(_0x440cab[_0x502c('0x22')]){if(_0x440cab['error'][_0x502c('0x23')]===0x1f4){logger['error'](_0x502c('0x24'),_0x1f20b8,_0x440cab['error'][_0x502c('0x25')]);return _0x1173bc(_0x440cab['error'][_0x502c('0x25')]);}logger[_0x502c('0x22')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f20b8,_0x440cab[_0x502c('0x22')][_0x502c('0x25')]);return _0x390fc5(_0x440cab['error'][_0x502c('0x25')]);}else{logger[_0x502c('0x26')](_0x502c('0x24'),_0x1f20b8,_0x502c('0x21'));_0x390fc5(_0x440cab['result']['message']);}})[_0x502c('0x27')](function(_0x59cc22){logger[_0x502c('0x22')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f20b8,_0x59cc22);_0x1173bc(_0x59cc22);});});}function respondWithStatusCode(_0x53db80,_0x25cbe1){_0x25cbe1=_0x25cbe1||0xcc;return function(_0x442c9e){if(_0x442c9e){return _0x53db80[_0x502c('0x28')](_0x25cbe1);}return _0x53db80['status'](_0x25cbe1)['end']();};}function respondWithResult(_0x1d2ded,_0x41c762){_0x41c762=_0x41c762||0xc8;return function(_0x55f0a5){if(_0x55f0a5){return _0x1d2ded[_0x502c('0x29')](_0x41c762)[_0x502c('0x2a')](_0x55f0a5);}};}function respondWithFilteredResult(_0x516ab7,_0x2cdbc0){return function(_0xabe582){if(_0xabe582){var _0x525a4d=_0xabe582[_0x502c('0x2b')],_0x3e865f=_0x2cdbc0[_0x502c('0x2c')],_0x3c6af1=_0x2cdbc0[_0x502c('0x2c')]+_0x2cdbc0['limit'],_0x3a3d46;if(_0x3c6af1>=_0x525a4d){_0x3c6af1=_0x525a4d;_0x3a3d46=0xc8;}else{_0x3a3d46=0xce;}_0x516ab7[_0x502c('0x29')](_0x3a3d46);return _0x516ab7[_0x502c('0x2d')](_0x502c('0x2e'),_0x3e865f+'-'+_0x3c6af1+'/'+_0x525a4d)[_0x502c('0x2a')](_0xabe582);}return null;};}function patchUpdates(_0x39dd4d){return function(_0x59e23b){try{jsonpatch[_0x502c('0x2f')](_0x59e23b,_0x39dd4d,!![]);}catch(_0xcc42bf){return BPromise['reject'](_0xcc42bf);}return _0x59e23b[_0x502c('0x30')]();};}function saveUpdates(_0x4ed8eb,_0x436c48){return function(_0x101cea){if(_0x101cea){return _0x101cea[_0x502c('0x31')](_0x4ed8eb)['then'](function(_0x432c2f){return _0x432c2f;});}return null;};}function removeEntity(_0x1f1d83,_0x46d064){return function(_0x3b0485){if(_0x3b0485){return _0x3b0485['destroy']()[_0x502c('0x32')](function(){_0x1f1d83[_0x502c('0x29')](0xcc)[_0x502c('0x33')]();});}};}function handleEntityNotFound(_0x47ae96,_0x1996a9){return function(_0x244faa){if(!_0x244faa){_0x47ae96['sendStatus'](0x194);}return _0x244faa;};}function handleError(_0x573a70,_0x4003ac){_0x4003ac=_0x4003ac||0x1f4;return function(_0x4cef2a){logger['error'](_0x4cef2a[_0x502c('0x34')]);if(_0x4cef2a[_0x502c('0x35')]){delete _0x4cef2a[_0x502c('0x35')];}_0x573a70['status'](_0x4003ac)['send'](_0x4cef2a);};}exports[_0x502c('0x36')]=function(_0x263f7c,_0x2a9f8c){var _0x5905ef={},_0x24de42={},_0x3887c5={'count':0x0,'rows':[]};var _0x58205f=db[_0x502c('0x37')]['rawAttributes'];_0x24de42['model']=_[_0x502c('0x38')](_0x58205f);_0x24de42['query']=_['keys'](_0x263f7c[_0x502c('0x39')]);_0x24de42[_0x502c('0x3a')]=_[_0x502c('0x3b')](_0x24de42[_0x502c('0x3c')],_0x24de42['query']);_0x5905ef[_0x502c('0x3d')]=_[_0x502c('0x3b')](_0x24de42[_0x502c('0x3c')],qs['fields'](_0x263f7c[_0x502c('0x39')][_0x502c('0x3e')]));_0x5905ef[_0x502c('0x3d')]=_0x5905ef[_0x502c('0x3d')][_0x502c('0x3f')]?_0x5905ef[_0x502c('0x3d')]:_0x24de42[_0x502c('0x3c')];if(!_0x263f7c['query'][_0x502c('0x40')](_0x502c('0x41'))){_0x5905ef[_0x502c('0x42')]=qs['limit'](_0x263f7c[_0x502c('0x39')]['limit']);_0x5905ef[_0x502c('0x2c')]=qs['offset'](_0x263f7c[_0x502c('0x39')][_0x502c('0x2c')]);}_0x5905ef['order']=qs[_0x502c('0x43')](_0x263f7c[_0x502c('0x39')]['sort']);_0x5905ef['where']=qs['filters'](_[_0x502c('0x44')](_0x263f7c[_0x502c('0x39')],_0x24de42[_0x502c('0x3a')]));if(_0x263f7c[_0x502c('0x39')][_0x502c('0x45')]){_0x5905ef['where']=_['merge'](_0x5905ef['where'],{'$or':_[_0x502c('0x46')](_0x58205f,function(_0x1c09e6){if(_0x1c09e6['type'][_0x502c('0x47')]!==_0x502c('0x48')){var _0x59f9cf={};_0x59f9cf[_0x1c09e6[_0x502c('0x49')]]={'$like':'%'+_0x263f7c[_0x502c('0x39')][_0x502c('0x45')]+'%'};return _0x59f9cf;}})});}_0x5905ef=_[_0x502c('0x4a')]({},_0x5905ef,_0x263f7c[_0x502c('0x4b')]);var _0x47be31={'where':_0x5905ef[_0x502c('0x4c')]};return db[_0x502c('0x37')][_0x502c('0x2b')](_0x47be31)[_0x502c('0x32')](function(_0xb4ec49){_0x3887c5[_0x502c('0x2b')]=_0xb4ec49;if(_0x263f7c['query'][_0x502c('0x4d')]){_0x5905ef[_0x502c('0x4e')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x5905ef);})[_0x502c('0x32')](function(_0x488984){_0x3887c5[_0x502c('0x4f')]=_0x488984;return _0x3887c5;})[_0x502c('0x32')](respondWithFilteredResult(_0x2a9f8c,_0x5905ef))['catch'](handleError(_0x2a9f8c,null));};exports[_0x502c('0x50')]=function(_0x7793ec,_0x217d98){var _0x410da6={'raw':![],'where':{'id':_0x7793ec[_0x502c('0x51')]['id']}},_0x1b1c3f={};_0x1b1c3f[_0x502c('0x3c')]=_[_0x502c('0x38')](db[_0x502c('0x37')][_0x502c('0x52')]);_0x1b1c3f[_0x502c('0x39')]=_['keys'](_0x7793ec['query']);_0x1b1c3f[_0x502c('0x3a')]=_[_0x502c('0x3b')](_0x1b1c3f['model'],_0x1b1c3f[_0x502c('0x39')]);_0x410da6[_0x502c('0x3d')]=_[_0x502c('0x3b')](_0x1b1c3f[_0x502c('0x3c')],qs['fields'](_0x7793ec[_0x502c('0x39')][_0x502c('0x3e')]));_0x410da6[_0x502c('0x3d')]=_0x410da6[_0x502c('0x3d')][_0x502c('0x3f')]?_0x410da6['attributes']:_0x1b1c3f[_0x502c('0x3c')];if(_0x7793ec[_0x502c('0x39')][_0x502c('0x4d')]){_0x410da6[_0x502c('0x4e')]=[{'all':!![]}];}_0x410da6=_[_0x502c('0x4a')]({},_0x410da6,_0x7793ec[_0x502c('0x4b')]);return db[_0x502c('0x37')][_0x502c('0x53')](_0x410da6)[_0x502c('0x32')](handleEntityNotFound(_0x217d98,null))[_0x502c('0x32')](respondWithResult(_0x217d98,null))[_0x502c('0x27')](handleError(_0x217d98,null));};exports[_0x502c('0x54')]=function(_0x5a1b8e,_0x9ae1b1){return db[_0x502c('0x37')][_0x502c('0x54')](_0x5a1b8e[_0x502c('0x55')],{})[_0x502c('0x32')](respondWithResult(_0x9ae1b1,0xc9))[_0x502c('0x27')](handleError(_0x9ae1b1,null));};exports['update']=function(_0x310408,_0x5e9194){if(_0x310408[_0x502c('0x55')]['id']){delete _0x310408[_0x502c('0x55')]['id'];}return db[_0x502c('0x37')][_0x502c('0x53')]({'where':{'id':_0x310408[_0x502c('0x51')]['id']}})[_0x502c('0x32')](handleEntityNotFound(_0x5e9194,null))['then'](saveUpdates(_0x310408[_0x502c('0x55')],null))[_0x502c('0x32')](respondWithResult(_0x5e9194,null))['catch'](handleError(_0x5e9194,null));};exports['destroy']=function(_0x255e1e,_0x46187d){return db[_0x502c('0x37')][_0x502c('0x53')]({'where':{'id':_0x255e1e[_0x502c('0x51')]['id']}})[_0x502c('0x32')](handleEntityNotFound(_0x46187d,null))[_0x502c('0x32')](removeEntity(_0x46187d,null))[_0x502c('0x27')](handleError(_0x46187d,null));};exports[_0x502c('0x56')]=function(_0x438762,_0x170912,_0x1fef5b){var _0x443a73={};var _0x4c5f51={};var _0x2b0eab;var _0x4f6ede;return db[_0x502c('0x37')][_0x502c('0x57')]({'where':{'id':_0x438762[_0x502c('0x51')]['id']}})[_0x502c('0x32')](handleEntityNotFound(_0x170912,null))[_0x502c('0x32')](function(_0x541bb4){if(_0x541bb4){_0x2b0eab=_0x541bb4;_0x4c5f51[_0x502c('0x3c')]=_[_0x502c('0x38')](db[_0x502c('0x58')][_0x502c('0x52')]);_0x4c5f51[_0x502c('0x39')]=_[_0x502c('0x38')](_0x438762['query']);_0x4c5f51[_0x502c('0x3a')]=_[_0x502c('0x3b')](_0x4c5f51['model'],_0x4c5f51[_0x502c('0x39')]);_0x443a73[_0x502c('0x3d')]=_[_0x502c('0x3b')](_0x4c5f51[_0x502c('0x3c')],qs[_0x502c('0x3e')](_0x438762['query']['fields']));_0x443a73[_0x502c('0x3d')]=_0x443a73[_0x502c('0x3d')][_0x502c('0x3f')]?_0x443a73['attributes']:_0x4c5f51[_0x502c('0x3c')];_0x443a73[_0x502c('0x59')]=qs[_0x502c('0x43')](_0x438762['query'][_0x502c('0x43')]);_0x443a73['where']=qs[_0x502c('0x3a')](_[_0x502c('0x44')](_0x438762['query'],_0x4c5f51[_0x502c('0x3a')]));if(_0x438762[_0x502c('0x39')][_0x502c('0x45')]){_0x443a73[_0x502c('0x4c')]=_[_0x502c('0x4a')](_0x443a73[_0x502c('0x4c')],{'$or':_[_0x502c('0x46')](_0x443a73['attributes'],function(_0x5388b9){var _0x1ccd9e={};_0x1ccd9e[_0x5388b9]={'$like':'%'+_0x438762[_0x502c('0x39')][_0x502c('0x45')]+'%'};return _0x1ccd9e;})});}_0x443a73=_[_0x502c('0x4a')]({},_0x443a73,_0x438762[_0x502c('0x4b')]);return _0x2b0eab[_0x502c('0x56')](_0x443a73);}})[_0x502c('0x32')](function(_0x20d698){if(_0x20d698){_0x4f6ede=_0x20d698[_0x502c('0x3f')];if(!_0x438762[_0x502c('0x39')][_0x502c('0x40')](_0x502c('0x41'))){_0x443a73[_0x502c('0x42')]=qs[_0x502c('0x42')](_0x438762[_0x502c('0x39')][_0x502c('0x42')]);_0x443a73[_0x502c('0x2c')]=qs[_0x502c('0x2c')](_0x438762[_0x502c('0x39')][_0x502c('0x2c')]);}return _0x2b0eab[_0x502c('0x56')](_0x443a73);}})['then'](function(_0x131866){if(_0x131866){return _0x131866?{'count':_0x4f6ede,'rows':_0x131866}:null;}})[_0x502c('0x32')](respondWithResult(_0x170912,null))[_0x502c('0x27')](handleError(_0x170912,null));};exports[_0x502c('0x5a')]=function(_0x329805,_0x5d7cfe,_0x263376){if(_0x329805[_0x502c('0x55')]['id']){delete _0x329805[_0x502c('0x55')]['id'];}return db[_0x502c('0x37')][_0x502c('0x57')]({'where':{'id':_0x329805[_0x502c('0x51')]['id']}})[_0x502c('0x32')](handleEntityNotFound(_0x5d7cfe,null))['then'](function(_0x4fc0ef){if(_0x4fc0ef){_0x329805[_0x502c('0x55')]['AccountId']=_0x4fc0ef['id'];_0x329805['body'][_0x502c('0x5b')]=integrations[_0x502c('0x5c')](_0x329805[_0x502c('0x55')][_0x502c('0x5d')],_0x329805[_0x502c('0x55')]['type']);_0x329805[_0x502c('0x55')][_0x502c('0x5e')]=integrations[_0x502c('0x5f')](_0x329805[_0x502c('0x55')]['channel'],_0x329805[_0x502c('0x55')][_0x502c('0x60')]);return db[_0x502c('0x58')][_0x502c('0x54')](_0x329805[_0x502c('0x55')],{'include':[{'model':db[_0x502c('0x61')],'as':_0x502c('0x5b')},{'model':db[_0x502c('0x61')],'as':_0x502c('0x5e')}]});}return null;})[_0x502c('0x32')](respondWithResult(_0x5d7cfe,null))[_0x502c('0x27')](handleError(_0x5d7cfe,null));};exports['getFields']=function(_0x8923fb,_0x571f38,_0x21f08f){var _0x39bff6='';var _0x5bc800=['id',_0x502c('0x35'),'assigned_user_id',_0x502c('0x62'),_0x502c('0x63'),_0x502c('0x64'),'duration_hours','duration_minutes',_0x502c('0x65'),_0x502c('0x66'),_0x502c('0x67'),_0x502c('0x68')];return db[_0x502c('0x37')][_0x502c('0x57')]({'where':{'id':_0x8923fb[_0x502c('0x51')]['id']},'attributes':['id','username',_0x502c('0x69'),_0x502c('0x6a')]})['then'](handleEntityNotFound(_0x571f38,null))[_0x502c('0x32')](function(_0x5dd728){if(_0x5dd728){_0x39bff6=_0x5dd728[_0x502c('0x6a')];var _0x29d0d9=_0x39bff6['slice'](-0x1);if(_0x29d0d9==='/'){_0x39bff6=_0x39bff6[_0x502c('0x6b')](0x0,_0x39bff6['lastIndexOf'](_0x29d0d9));}return rp({'method':_0x502c('0x6c'),'uri':util['format'](_0x502c('0x6d'),_0x39bff6,_0x502c('0x6e')),'json':!![],'form':{'method':_0x502c('0x6f'),'input_type':_0x502c('0x70'),'response_type':_0x502c('0x70'),'rest_data':JSON[_0x502c('0x71')]({'user_auth':{'user_name':_0x5dd728[_0x502c('0x72')],'password':_0x5dd728[_0x502c('0x69')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x502c('0x32')](function(_0x32a5fb){if(_0x32a5fb&&_0x32a5fb['name']!==_0x502c('0x73')&&_0x32a5fb[_0x502c('0x35')]!==_0x502c('0x74')){return rp({'method':_0x502c('0x6c'),'uri':util[_0x502c('0x75')](_0x502c('0x6d'),_0x39bff6,_0x502c('0x6e')),'json':!![],'form':{'method':_0x502c('0x76'),'input_type':_0x502c('0x70'),'response_type':_0x502c('0x70'),'rest_data':JSON[_0x502c('0x71')]({'session':_0x32a5fb['id'],'module_name':_0x502c('0x77')})}})[_0x502c('0x32')](function(_0x4d869d){if(_0x4d869d){var _0x3c5a08=_[_0x502c('0x78')](_0x4d869d[_0x502c('0x79')]);_[_0x502c('0x7a')](_0x3c5a08,function(_0x4d24c4){return _0x5bc800[_0x502c('0x7b')](_0x4d24c4[_0x502c('0x35')]);});return{'count':_0x3c5a08[_0x502c('0x3f')],'rows':_[_0x502c('0x46')](_0x3c5a08,function(_0x30cc19){return{'id':_0x30cc19['name'],'name':_0x30cc19[_0x502c('0x7c')],'custom':_[_0x502c('0x7d')](_0x30cc19[_0x502c('0x35')],'_c')?!![]:![],'options':_0x30cc19[_0x502c('0x4b')]?_[_0x502c('0x46')](_[_0x502c('0x78')](_0x30cc19['options']),function(_0x1fc35d){return{'name':_0x1fc35d[_0x502c('0x7e')],'value':_0x1fc35d[_0x502c('0x35')]};}):[]};})};}})[_0x502c('0x32')](respondWithResult(_0x571f38,null))[_0x502c('0x27')](function(_0x13ed9c){var _0x3e303c=_0x8923fb[_0x502c('0x39')]['test']?0x1f4:_0x13ed9c[_0x502c('0x7f')]||0x1f4;logger['error'](_0x502c('0x80'),'getFields',_0x3e303c,JSON[_0x502c('0x71')](_0x13ed9c));delete _0x13ed9c[_0x502c('0x35')];if(_0x3e303c===0x191){_0x3e303c=0x190;}_0x571f38[_0x502c('0x29')](_0x3e303c)[_0x502c('0x81')](_0x8923fb[_0x502c('0x39')][_0x502c('0x1d')]?{'message':_0x502c('0x82'),'statusCode':_0x13ed9c[_0x502c('0x7f')]}:_0x13ed9c);});}else{var _0x117519=0x1f4;_0x571f38[_0x502c('0x29')](_0x117519)[_0x502c('0x81')]({'message':_0x502c('0x82'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x35d1=['bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','set','reject','save','update','destroy','end','stack','send','index','SugarcrmAccount','rawAttributes','model','keys','intersection','fields','query','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','length','find','create','body','params','getConfigurations','findOne','pick','Subjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','name','assigned_user_id','created_by','description','date_start','duration_hours','parent_type','parent_name','direction','username','remoteUri','substring','lastIndexOf','%s%s','/service/v4_1/rest.php','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','get_module_fields','Calls','values','module_fields','remove','label','endsWith','test','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3e1df1,_0x113297){var _0x322c05=function(_0x3063a1){while(--_0x3063a1){_0x3e1df1['push'](_0x3e1df1['shift']());}};_0x322c05(++_0x113297);}(_0x35d1,0x1e3));var _0x135d=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0x35d1[_0x52684f];return _0x4a55f0;};'use strict';var pdf=require(_0x135d('0x0'));var emlformat=require(_0x135d('0x1'));var rimraf=require(_0x135d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x135d('0x3'));var rp=require(_0x135d('0x4'));var moment=require('moment');var BPromise=require(_0x135d('0x5'));var Mustache=require(_0x135d('0x6'));var util=require(_0x135d('0x7'));var path=require(_0x135d('0x8'));var sox=require('sox');var csv=require(_0x135d('0x9'));var ejs=require(_0x135d('0xa'));var fs=require('fs');var _=require(_0x135d('0xb'));var squel=require(_0x135d('0xc'));var crypto=require('crypto');var jsforce=require(_0x135d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x135d('0x9'));var querystring=require(_0x135d('0xe'));var Papa=require(_0x135d('0xf'));var Redis=require('ioredis');var authService=require(_0x135d('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x135d('0x11'));var logger=require(_0x135d('0x12'))(_0x135d('0x13'));var utils=require('../../config/utils');var config=require(_0x135d('0x14'));var db=require(_0x135d('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2873cb,_0x62541,_0x5a4d57){if(_0x5a4d57){var _0x5277fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5277fc['test'](_0x62541)){return _0x2873cb;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2873cb;}}function respondWithRpcPromise(_0x2dafc7,_0xf3e528,_0x4369ed,_0xdadd69){return new BPromise(function(_0x1695aa,_0x219cc8){var _0x48bc2c=_0xdadd69||client;return _0x48bc2c['request'](_0x2dafc7,_0x4369ed)[_0x135d('0x16')](function(_0x38510f){logger[_0x135d('0x17')](_0x135d('0x18'),_0xf3e528,_0x135d('0x19'));logger[_0x135d('0x1a')](_0x135d('0x1b'),_0xf3e528,_0x135d('0x19'),JSON[_0x135d('0x1c')](_0x38510f));if(_0x38510f[_0x135d('0x1d')]){if(_0x38510f[_0x135d('0x1d')][_0x135d('0x1e')]===0x1f4){logger[_0x135d('0x1d')](_0x135d('0x18'),_0xf3e528,_0x38510f[_0x135d('0x1d')]['message']);return _0x219cc8(_0x38510f[_0x135d('0x1d')][_0x135d('0x1f')]);}logger['error'](_0x135d('0x18'),_0xf3e528,_0x38510f[_0x135d('0x1d')]['message']);return _0x1695aa(_0x38510f[_0x135d('0x1d')][_0x135d('0x1f')]);}else{logger['info'](_0x135d('0x18'),_0xf3e528,'request\x20sent');_0x1695aa(_0x38510f[_0x135d('0x20')][_0x135d('0x1f')]);}})[_0x135d('0x21')](function(_0x22d099){logger[_0x135d('0x1d')]('SugarcrmAccount,\x20%s,\x20%s',_0xf3e528,_0x22d099);_0x219cc8(_0x22d099);});});}function respondWithStatusCode(_0x1a6086,_0x1dfe50){_0x1dfe50=_0x1dfe50||0xcc;return function(_0x407e03){if(_0x407e03){return _0x1a6086[_0x135d('0x22')](_0x1dfe50);}return _0x1a6086[_0x135d('0x23')](_0x1dfe50)['end']();};}function respondWithResult(_0x595cdd,_0x556f0a){_0x556f0a=_0x556f0a||0xc8;return function(_0x3580ff){if(_0x3580ff){return _0x595cdd['status'](_0x556f0a)['json'](_0x3580ff);}};}function respondWithFilteredResult(_0x46a813,_0x927946){return function(_0x2bcb76){if(_0x2bcb76){var _0x1e0134=_0x2bcb76[_0x135d('0x24')],_0x1e192a=_0x927946[_0x135d('0x25')],_0x55c5af=_0x927946[_0x135d('0x25')]+_0x927946['limit'],_0x3207a4;if(_0x55c5af>=_0x1e0134){_0x55c5af=_0x1e0134;_0x3207a4=0xc8;}else{_0x3207a4=0xce;}_0x46a813[_0x135d('0x23')](_0x3207a4);return _0x46a813[_0x135d('0x26')]('Content-Range',_0x1e192a+'-'+_0x55c5af+'/'+_0x1e0134)['json'](_0x2bcb76);}return null;};}function patchUpdates(_0x6d0dd1){return function(_0x29199c){try{jsonpatch['apply'](_0x29199c,_0x6d0dd1,!![]);}catch(_0x311f4a){return BPromise[_0x135d('0x27')](_0x311f4a);}return _0x29199c[_0x135d('0x28')]();};}function saveUpdates(_0x4e372d,_0x23a368){return function(_0x35d999){if(_0x35d999){return _0x35d999[_0x135d('0x29')](_0x4e372d)[_0x135d('0x16')](function(_0x8664e3){return _0x8664e3;});}return null;};}function removeEntity(_0x15dfba,_0x26c6da){return function(_0x806ebe){if(_0x806ebe){return _0x806ebe[_0x135d('0x2a')]()[_0x135d('0x16')](function(){_0x15dfba[_0x135d('0x23')](0xcc)[_0x135d('0x2b')]();});}};}function handleEntityNotFound(_0x23fd66,_0x4e077a){return function(_0x478dfb){if(!_0x478dfb){_0x23fd66['sendStatus'](0x194);}return _0x478dfb;};}function handleError(_0x4bdc4f,_0x48a7e5){_0x48a7e5=_0x48a7e5||0x1f4;return function(_0x130634){logger[_0x135d('0x1d')](_0x130634[_0x135d('0x2c')]);if(_0x130634['name']){delete _0x130634['name'];}_0x4bdc4f[_0x135d('0x23')](_0x48a7e5)[_0x135d('0x2d')](_0x130634);};}exports[_0x135d('0x2e')]=function(_0x5f4668,_0x644193){var _0x332714={},_0x1b8b66={},_0x142dac={'count':0x0,'rows':[]};var _0x3c719a=db[_0x135d('0x2f')][_0x135d('0x30')];_0x1b8b66[_0x135d('0x31')]=_['keys'](_0x3c719a);_0x1b8b66['query']=_[_0x135d('0x32')](_0x5f4668['query']);_0x1b8b66['filters']=_[_0x135d('0x33')](_0x1b8b66[_0x135d('0x31')],_0x1b8b66['query']);_0x332714['attributes']=_[_0x135d('0x33')](_0x1b8b66[_0x135d('0x31')],qs[_0x135d('0x34')](_0x5f4668[_0x135d('0x35')]['fields']));_0x332714['attributes']=_0x332714[_0x135d('0x36')]['length']?_0x332714[_0x135d('0x36')]:_0x1b8b66[_0x135d('0x31')];if(!_0x5f4668[_0x135d('0x35')][_0x135d('0x37')](_0x135d('0x38'))){_0x332714[_0x135d('0x39')]=qs[_0x135d('0x39')](_0x5f4668[_0x135d('0x35')][_0x135d('0x39')]);_0x332714[_0x135d('0x25')]=qs[_0x135d('0x25')](_0x5f4668[_0x135d('0x35')]['offset']);}_0x332714[_0x135d('0x3a')]=qs[_0x135d('0x3b')](_0x5f4668['query'][_0x135d('0x3b')]);_0x332714[_0x135d('0x3c')]=qs[_0x135d('0x3d')](_['pick'](_0x5f4668[_0x135d('0x35')],_0x1b8b66[_0x135d('0x3d')]));if(_0x5f4668[_0x135d('0x35')][_0x135d('0x3e')]){_0x332714[_0x135d('0x3c')]=_[_0x135d('0x3f')](_0x332714[_0x135d('0x3c')],{'$or':_[_0x135d('0x40')](_0x3c719a,function(_0x2bc46c){if(_0x2bc46c['type'][_0x135d('0x41')]!==_0x135d('0x42')){var _0x5b86ca={};_0x5b86ca[_0x2bc46c[_0x135d('0x43')]]={'$like':'%'+_0x5f4668[_0x135d('0x35')][_0x135d('0x3e')]+'%'};return _0x5b86ca;}})});}_0x332714=_[_0x135d('0x3f')]({},_0x332714,_0x5f4668[_0x135d('0x44')]);var _0x52e958={'where':_0x332714[_0x135d('0x3c')]};return db['SugarcrmAccount']['count'](_0x52e958)[_0x135d('0x16')](function(_0x5779f1){_0x142dac[_0x135d('0x24')]=_0x5779f1;if(_0x5f4668[_0x135d('0x35')][_0x135d('0x45')]){_0x332714[_0x135d('0x46')]=[{'all':!![]}];}return db[_0x135d('0x2f')][_0x135d('0x47')](_0x332714);})['then'](function(_0x2c0690){_0x142dac[_0x135d('0x48')]=_0x2c0690;return _0x142dac;})[_0x135d('0x16')](respondWithFilteredResult(_0x644193,_0x332714))['catch'](handleError(_0x644193,null));};exports[_0x135d('0x49')]=function(_0x5ed084,_0x2a33a9){var _0x31d601={'raw':![],'where':{'id':_0x5ed084['params']['id']}},_0x3454ae={};_0x3454ae[_0x135d('0x31')]=_[_0x135d('0x32')](db[_0x135d('0x2f')][_0x135d('0x30')]);_0x3454ae[_0x135d('0x35')]=_[_0x135d('0x32')](_0x5ed084['query']);_0x3454ae[_0x135d('0x3d')]=_[_0x135d('0x33')](_0x3454ae[_0x135d('0x31')],_0x3454ae[_0x135d('0x35')]);_0x31d601['attributes']=_[_0x135d('0x33')](_0x3454ae[_0x135d('0x31')],qs[_0x135d('0x34')](_0x5ed084['query'][_0x135d('0x34')]));_0x31d601['attributes']=_0x31d601[_0x135d('0x36')][_0x135d('0x4a')]?_0x31d601[_0x135d('0x36')]:_0x3454ae['model'];if(_0x5ed084[_0x135d('0x35')][_0x135d('0x45')]){_0x31d601[_0x135d('0x46')]=[{'all':!![]}];}_0x31d601=_[_0x135d('0x3f')]({},_0x31d601,_0x5ed084['options']);return db['SugarcrmAccount'][_0x135d('0x4b')](_0x31d601)[_0x135d('0x16')](handleEntityNotFound(_0x2a33a9,null))['then'](respondWithResult(_0x2a33a9,null))[_0x135d('0x21')](handleError(_0x2a33a9,null));};exports[_0x135d('0x4c')]=function(_0x17ab51,_0x450049){return db[_0x135d('0x2f')]['create'](_0x17ab51[_0x135d('0x4d')],{})[_0x135d('0x16')](respondWithResult(_0x450049,0xc9))[_0x135d('0x21')](handleError(_0x450049,null));};exports[_0x135d('0x29')]=function(_0x53c06c,_0x295065){if(_0x53c06c[_0x135d('0x4d')]['id']){delete _0x53c06c[_0x135d('0x4d')]['id'];}return db[_0x135d('0x2f')]['find']({'where':{'id':_0x53c06c[_0x135d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x295065,null))[_0x135d('0x16')](saveUpdates(_0x53c06c[_0x135d('0x4d')],null))[_0x135d('0x16')](respondWithResult(_0x295065,null))[_0x135d('0x21')](handleError(_0x295065,null));};exports[_0x135d('0x2a')]=function(_0x56f77b,_0x521232){return db[_0x135d('0x2f')][_0x135d('0x4b')]({'where':{'id':_0x56f77b[_0x135d('0x4e')]['id']}})[_0x135d('0x16')](handleEntityNotFound(_0x521232,null))[_0x135d('0x16')](removeEntity(_0x521232,null))['catch'](handleError(_0x521232,null));};exports[_0x135d('0x4f')]=function(_0x18142a,_0x3aaf42,_0x328746){var _0xecda79={};var _0x31c3b2={};var _0x547887;var _0x103fea;return db[_0x135d('0x2f')][_0x135d('0x50')]({'where':{'id':_0x18142a[_0x135d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3aaf42,null))[_0x135d('0x16')](function(_0x522174){if(_0x522174){_0x547887=_0x522174;_0x31c3b2[_0x135d('0x31')]=_[_0x135d('0x32')](db['SugarcrmConfiguration']['rawAttributes']);_0x31c3b2['query']=_[_0x135d('0x32')](_0x18142a[_0x135d('0x35')]);_0x31c3b2[_0x135d('0x3d')]=_[_0x135d('0x33')](_0x31c3b2[_0x135d('0x31')],_0x31c3b2[_0x135d('0x35')]);_0xecda79['attributes']=_[_0x135d('0x33')](_0x31c3b2['model'],qs['fields'](_0x18142a[_0x135d('0x35')][_0x135d('0x34')]));_0xecda79[_0x135d('0x36')]=_0xecda79[_0x135d('0x36')][_0x135d('0x4a')]?_0xecda79[_0x135d('0x36')]:_0x31c3b2['model'];_0xecda79['order']=qs[_0x135d('0x3b')](_0x18142a[_0x135d('0x35')][_0x135d('0x3b')]);_0xecda79['where']=qs[_0x135d('0x3d')](_[_0x135d('0x51')](_0x18142a['query'],_0x31c3b2[_0x135d('0x3d')]));if(_0x18142a[_0x135d('0x35')]['filter']){_0xecda79[_0x135d('0x3c')]=_[_0x135d('0x3f')](_0xecda79['where'],{'$or':_['map'](_0xecda79[_0x135d('0x36')],function(_0x31ec6a){var _0x3d56a3={};_0x3d56a3[_0x31ec6a]={'$like':'%'+_0x18142a[_0x135d('0x35')][_0x135d('0x3e')]+'%'};return _0x3d56a3;})});}_0xecda79=_[_0x135d('0x3f')]({},_0xecda79,_0x18142a['options']);return _0x547887[_0x135d('0x4f')](_0xecda79);}})[_0x135d('0x16')](function(_0x36737e){if(_0x36737e){_0x103fea=_0x36737e['length'];if(!_0x18142a[_0x135d('0x35')]['hasOwnProperty'](_0x135d('0x38'))){_0xecda79[_0x135d('0x39')]=qs[_0x135d('0x39')](_0x18142a[_0x135d('0x35')][_0x135d('0x39')]);_0xecda79['offset']=qs[_0x135d('0x25')](_0x18142a['query'][_0x135d('0x25')]);}return _0x547887[_0x135d('0x4f')](_0xecda79);}})[_0x135d('0x16')](function(_0x53d24a){if(_0x53d24a){return _0x53d24a?{'count':_0x103fea,'rows':_0x53d24a}:null;}})[_0x135d('0x16')](respondWithResult(_0x3aaf42,null))[_0x135d('0x21')](handleError(_0x3aaf42,null));};exports['addConfiguration']=function(_0x222df1,_0x2527ca,_0x355f0e){if(_0x222df1[_0x135d('0x4d')]['id']){delete _0x222df1[_0x135d('0x4d')]['id'];}return db[_0x135d('0x2f')][_0x135d('0x50')]({'where':{'id':_0x222df1[_0x135d('0x4e')]['id']}})[_0x135d('0x16')](handleEntityNotFound(_0x2527ca,null))[_0x135d('0x16')](function(_0x3f6667){if(_0x3f6667){_0x222df1['body']['AccountId']=_0x3f6667['id'];_0x222df1[_0x135d('0x4d')][_0x135d('0x52')]=integrations['getSubjects'](_0x222df1[_0x135d('0x4d')][_0x135d('0x53')],_0x222df1[_0x135d('0x4d')]['type']);_0x222df1[_0x135d('0x4d')][_0x135d('0x54')]=integrations[_0x135d('0x55')](_0x222df1['body'][_0x135d('0x53')],_0x222df1[_0x135d('0x4d')]['type']);return db[_0x135d('0x56')][_0x135d('0x4c')](_0x222df1[_0x135d('0x4d')],{'include':[{'model':db[_0x135d('0x57')],'as':'Subjects'},{'model':db[_0x135d('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2527ca,null))['catch'](handleError(_0x2527ca,null));};exports[_0x135d('0x58')]=function(_0x1c09dc,_0x5076d3,_0x533002){var _0x32f36f='';var _0x3c4e73=['id',_0x135d('0x59'),_0x135d('0x5a'),_0x135d('0x5b'),_0x135d('0x5c'),_0x135d('0x5d'),_0x135d('0x5e'),'duration_minutes','parent_id',_0x135d('0x5f'),_0x135d('0x60'),_0x135d('0x61')];return db['SugarcrmAccount'][_0x135d('0x50')]({'where':{'id':_0x1c09dc[_0x135d('0x4e')]['id']},'attributes':['id',_0x135d('0x62'),'password','remoteUri']})[_0x135d('0x16')](handleEntityNotFound(_0x5076d3,null))[_0x135d('0x16')](function(_0x5d84e1){if(_0x5d84e1){_0x32f36f=_0x5d84e1[_0x135d('0x63')];var _0x13e4aa=_0x32f36f['slice'](-0x1);if(_0x13e4aa==='/'){_0x32f36f=_0x32f36f[_0x135d('0x64')](0x0,_0x32f36f[_0x135d('0x65')](_0x13e4aa));}return rp({'method':'POST','uri':util['format'](_0x135d('0x66'),_0x32f36f,_0x135d('0x67')),'json':!![],'form':{'method':'login','input_type':_0x135d('0x68'),'response_type':'JSON','rest_data':JSON[_0x135d('0x1c')]({'user_auth':{'user_name':_0x5d84e1['username'],'password':_0x5d84e1[_0x135d('0x69')],'encryption':_0x135d('0x6a')},'application':_0x135d('0x6b')})}});}})[_0x135d('0x16')](function(_0x566551){if(_0x566551&&_0x566551[_0x135d('0x59')]!==_0x135d('0x6c')&&_0x566551[_0x135d('0x59')]!==_0x135d('0x6d')){return rp({'method':_0x135d('0x6e'),'uri':util[_0x135d('0x6f')]('%s%s',_0x32f36f,_0x135d('0x67')),'json':!![],'form':{'method':_0x135d('0x70'),'input_type':_0x135d('0x68'),'response_type':_0x135d('0x68'),'rest_data':JSON[_0x135d('0x1c')]({'session':_0x566551['id'],'module_name':_0x135d('0x71')})}})[_0x135d('0x16')](function(_0x5878c7){if(_0x5878c7){var _0x478181=_[_0x135d('0x72')](_0x5878c7[_0x135d('0x73')]);_[_0x135d('0x74')](_0x478181,function(_0x559de7){return _0x3c4e73['includes'](_0x559de7[_0x135d('0x59')]);});return{'count':_0x478181['length'],'rows':_['map'](_0x478181,function(_0x733146){return{'id':_0x733146[_0x135d('0x59')],'name':_0x733146[_0x135d('0x75')],'custom':_[_0x135d('0x76')](_0x733146[_0x135d('0x59')],'_c')?!![]:![],'options':_0x733146['options']?_['map'](_['values'](_0x733146[_0x135d('0x44')]),function(_0x9c98d8){return{'name':_0x9c98d8['value'],'value':_0x9c98d8[_0x135d('0x59')]};}):[]};})};}})['then'](respondWithResult(_0x5076d3,null))[_0x135d('0x21')](function(_0x511c17){var _0x59f658=_0x1c09dc[_0x135d('0x35')]['test']?0x1f4:_0x511c17['statusCode']||0x1f4;logger[_0x135d('0x1d')]('getFields,\x20%s,\x20%s,\x20%s',_0x135d('0x58'),_0x59f658,JSON[_0x135d('0x1c')](_0x511c17));delete _0x511c17[_0x135d('0x59')];if(_0x59f658===0x191){_0x59f658=0x190;}_0x5076d3[_0x135d('0x23')](_0x59f658)[_0x135d('0x2d')](_0x1c09dc['query'][_0x135d('0x77')]?{'message':_0x135d('0x78'),'statusCode':_0x511c17[_0x135d('0x79')]}:_0x511c17);});}else{var _0x94877f=0x1f4;_0x5076d3['status'](_0x94877f)[_0x135d('0x2d')]({'message':_0x135d('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 1f8f933..6898f2d 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 _0xd16d=['SugarcrmAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x365faf,_0x135c2d){var _0x48e976=function(_0x257c33){while(--_0x257c33){_0x365faf['push'](_0x365faf['shift']());}};_0x48e976(++_0x135c2d);}(_0xd16d,0xa9));var _0xdd16=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd16d[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xdd16('0x0'));var util=require(_0xdd16('0x1'));var logger=require(_0xdd16('0x2'))(_0xdd16('0x3'));var moment=require(_0xdd16('0x4'));var BPromise=require(_0xdd16('0x5'));var rp=require(_0xdd16('0x6'));var fs=require('fs');var path=require(_0xdd16('0x7'));var rimraf=require('rimraf');var config=require(_0xdd16('0x8'));var attributes=require(_0xdd16('0x9'));var integrations=require(_0xdd16('0xa'));module[_0xdd16('0xb')]=function(_0x5ea333,_0x3a38f3){return _0x5ea333[_0xdd16('0xc')](_0xdd16('0xd'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7de5=['util','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','lodash'];(function(_0x19296a,_0x15d97f){var _0x200811=function(_0x4c43bb){while(--_0x4c43bb){_0x19296a['push'](_0x19296a['shift']());}};_0x200811(++_0x15d97f);}(_0x7de5,0x196));var _0x57de=function(_0x4a690d,_0x51473d){_0x4a690d=_0x4a690d-0x0;var _0x31e44c=_0x7de5[_0x4a690d];return _0x31e44c;};'use strict';var _=require(_0x57de('0x0'));var util=require(_0x57de('0x1'));var logger=require('../../config/logger')(_0x57de('0x2'));var moment=require(_0x57de('0x3'));var BPromise=require('bluebird');var rp=require(_0x57de('0x4'));var fs=require('fs');var path=require(_0x57de('0x5'));var rimraf=require(_0x57de('0x6'));var config=require(_0x57de('0x7'));var attributes=require(_0x57de('0x8'));var integrations=require(_0x57de('0x9'));module['exports']=function(_0x84f1e9,_0x1832c1){return _0x84f1e9[_0x57de('0xa')]('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 440e7ae..227b7bf 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 _0x3d4f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','findAll','options','raw','where','attributes','map','include','model','then','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util'];(function(_0x45cbc8,_0x44a1b6){var _0x266af5=function(_0x162eaa){while(--_0x162eaa){_0x45cbc8['push'](_0x45cbc8['shift']());}};_0x266af5(++_0x44a1b6);}(_0x3d4f,0x172));var _0xf3d4=function(_0x1ce834,_0x48dac9){_0x1ce834=_0x1ce834-0x0;var _0x248554=_0x3d4f[_0x1ce834];return _0x248554;};'use strict';var _=require(_0xf3d4('0x0'));var util=require(_0xf3d4('0x1'));var moment=require('moment');var BPromise=require(_0xf3d4('0x2'));var rs=require(_0xf3d4('0x3'));var fs=require('fs');var Redis=require(_0xf3d4('0x4'));var db=require(_0xf3d4('0x5'))['db'];var utils=require(_0xf3d4('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf3d4('0x7'));var client=jayson[_0xf3d4('0x8')][_0xf3d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x568cfa,_0x178d44,_0x2e05b0){return new BPromise(function(_0x455f68,_0x4bee17){return client[_0xf3d4('0xa')](_0x568cfa,_0x2e05b0)['then'](function(_0x708ae5){logger['info'](_0xf3d4('0xb'),_0x178d44,_0xf3d4('0xc'));logger[_0xf3d4('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x178d44,_0xf3d4('0xc'),JSON[_0xf3d4('0xe')](_0x708ae5));if(_0x708ae5[_0xf3d4('0xf')]){if(_0x708ae5[_0xf3d4('0xf')]['code']===0x1f4){logger[_0xf3d4('0xf')](_0xf3d4('0xb'),_0x178d44,_0x708ae5[_0xf3d4('0xf')][_0xf3d4('0x10')]);return _0x4bee17(_0x708ae5[_0xf3d4('0xf')][_0xf3d4('0x10')]);}logger[_0xf3d4('0xf')](_0xf3d4('0xb'),_0x178d44,_0x708ae5['error']['message']);return _0x455f68(_0x708ae5[_0xf3d4('0xf')][_0xf3d4('0x10')]);}else{logger[_0xf3d4('0x11')](_0xf3d4('0xb'),_0x178d44,_0xf3d4('0xc'));_0x455f68(_0x708ae5['result'][_0xf3d4('0x10')]);}})[_0xf3d4('0x12')](function(_0x111058){logger[_0xf3d4('0xf')](_0xf3d4('0xb'),_0x178d44,_0x111058);_0x4bee17(_0x111058);});});}exports['GetSugarcrmAccount']=function(_0x47c45c){var _0x2c4df2=this;return new Promise(function(_0x3b2d88,_0x3008d4){return db['SugarcrmAccount'][_0xf3d4('0x13')]({'raw':_0x47c45c['options']?_0x47c45c[_0xf3d4('0x14')][_0xf3d4('0x15')]===undefined?!![]:![]:!![],'where':_0x47c45c[_0xf3d4('0x14')]?_0x47c45c['options'][_0xf3d4('0x16')]||null:null,'attributes':_0x47c45c[_0xf3d4('0x14')]?_0x47c45c['options'][_0xf3d4('0x17')]||null:null,'limit':_0x47c45c[_0xf3d4('0x14')]?_0x47c45c[_0xf3d4('0x14')]['limit']||null:null,'include':_0x47c45c['options']?_0x47c45c['options']['include']?_[_0xf3d4('0x18')](_0x47c45c[_0xf3d4('0x14')][_0xf3d4('0x19')],function(_0x2e6ea6){return{'model':db[_0x2e6ea6[_0xf3d4('0x1a')]],'as':_0x2e6ea6['as'],'attributes':_0x2e6ea6['attributes'],'include':_0x2e6ea6[_0xf3d4('0x19')]?_[_0xf3d4('0x18')](_0x2e6ea6['include'],function(_0x2ae7c7){return{'model':db[_0x2ae7c7['model']],'as':_0x2ae7c7['as'],'attributes':_0x2ae7c7[_0xf3d4('0x17')],'include':_0x2ae7c7[_0xf3d4('0x19')]?_[_0xf3d4('0x18')](_0x2ae7c7['include'],function(_0x32b17c){return{'model':db[_0x32b17c[_0xf3d4('0x1a')]],'as':_0x32b17c['as'],'attributes':_0x32b17c[_0xf3d4('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf3d4('0x1b')](function(_0x30afd5){logger[_0xf3d4('0x11')](_0xf3d4('0x1c'),_0x47c45c);logger['debug'](_0xf3d4('0x1c'),_0x47c45c,JSON[_0xf3d4('0xe')](_0x30afd5));_0x3b2d88(_0x30afd5);})[_0xf3d4('0x12')](function(_0x585dc2){logger[_0xf3d4('0xf')](_0xf3d4('0x1c'),_0x585dc2[_0xf3d4('0x10')],_0x47c45c);_0x3008d4(_0x2c4df2[_0xf3d4('0xf')](0x1f4,_0x585dc2[_0xf3d4('0x10')]));});});};exports[_0xf3d4('0x1d')]=function(_0xb94a7e){var _0x49ef31=this;return new Promise(function(_0x43ab00,_0x2a61d5){return db['SugarcrmAccount'][_0xf3d4('0x1e')]({'raw':_0xb94a7e[_0xf3d4('0x14')]?_0xb94a7e[_0xf3d4('0x14')][_0xf3d4('0x15')]===undefined?!![]:![]:!![],'where':_0xb94a7e['options']?_0xb94a7e[_0xf3d4('0x14')][_0xf3d4('0x16')]||null:null,'attributes':_0xb94a7e[_0xf3d4('0x14')]?_0xb94a7e[_0xf3d4('0x14')][_0xf3d4('0x17')]||null:null,'include':_0xb94a7e['options']?_0xb94a7e['options'][_0xf3d4('0x19')]?_['map'](_0xb94a7e[_0xf3d4('0x14')][_0xf3d4('0x19')],function(_0x18c8f0){return{'model':db[_0x18c8f0[_0xf3d4('0x1a')]],'as':_0x18c8f0['as'],'attributes':_0x18c8f0[_0xf3d4('0x17')],'include':_0x18c8f0[_0xf3d4('0x19')]?_[_0xf3d4('0x18')](_0x18c8f0[_0xf3d4('0x19')],function(_0x167a1f){return{'model':db[_0x167a1f[_0xf3d4('0x1a')]],'as':_0x167a1f['as'],'attributes':_0x167a1f[_0xf3d4('0x17')],'include':_0x167a1f[_0xf3d4('0x19')]?_[_0xf3d4('0x18')](_0x167a1f[_0xf3d4('0x19')],function(_0x2e3648){return{'model':db[_0x2e3648[_0xf3d4('0x1a')]],'as':_0x2e3648['as'],'attributes':_0x2e3648[_0xf3d4('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf3d4('0x1b')](function(_0xed1a0f){logger[_0xf3d4('0x11')]('ShowSugarcrmAccount',_0xb94a7e);logger[_0xf3d4('0xd')](_0xf3d4('0x1d'),_0xb94a7e,JSON[_0xf3d4('0xe')](_0xed1a0f));_0x43ab00(_0xed1a0f);})[_0xf3d4('0x12')](function(_0x2a698b){logger[_0xf3d4('0xf')]('ShowSugarcrmAccount',_0x2a698b[_0xf3d4('0x10')],_0xb94a7e);_0x2a61d5(_0x49ef31[_0xf3d4('0xf')](0x1f4,_0x2a698b['message']));});});}; \ No newline at end of file +var _0x0ad9=['include','model','catch','ShowSugarcrmAccount','find','raw','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit'];(function(_0x23629f,_0x4b37fa){var _0x4d810a=function(_0x4a6d95){while(--_0x4a6d95){_0x23629f['push'](_0x23629f['shift']());}};_0x4d810a(++_0x4b37fa);}(_0x0ad9,0x9f));var _0x90ad=function(_0x529964,_0x435c59){_0x529964=_0x529964-0x0;var _0x3c722c=_0x0ad9[_0x529964];return _0x3c722c;};'use strict';var _=require(_0x90ad('0x0'));var util=require(_0x90ad('0x1'));var moment=require(_0x90ad('0x2'));var BPromise=require(_0x90ad('0x3'));var rs=require(_0x90ad('0x4'));var fs=require('fs');var Redis=require(_0x90ad('0x5'));var db=require(_0x90ad('0x6'))['db'];var utils=require(_0x90ad('0x7'));var logger=require(_0x90ad('0x8'))(_0x90ad('0x9'));var config=require('../../config/environment');var jayson=require(_0x90ad('0xa'));var client=jayson[_0x90ad('0xb')][_0x90ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a11e2,_0x37ba4e,_0x46d428){return new BPromise(function(_0x40458a,_0x5eb3de){return client[_0x90ad('0xd')](_0x5a11e2,_0x46d428)[_0x90ad('0xe')](function(_0x2c953b){logger[_0x90ad('0xf')](_0x90ad('0x10'),_0x37ba4e,_0x90ad('0x11'));logger[_0x90ad('0x12')](_0x90ad('0x13'),_0x37ba4e,_0x90ad('0x11'),JSON[_0x90ad('0x14')](_0x2c953b));if(_0x2c953b[_0x90ad('0x15')]){if(_0x2c953b[_0x90ad('0x15')]['code']===0x1f4){logger['error'](_0x90ad('0x10'),_0x37ba4e,_0x2c953b[_0x90ad('0x15')][_0x90ad('0x16')]);return _0x5eb3de(_0x2c953b[_0x90ad('0x15')][_0x90ad('0x16')]);}logger['error'](_0x90ad('0x10'),_0x37ba4e,_0x2c953b[_0x90ad('0x15')][_0x90ad('0x16')]);return _0x40458a(_0x2c953b[_0x90ad('0x15')][_0x90ad('0x16')]);}else{logger[_0x90ad('0xf')](_0x90ad('0x10'),_0x37ba4e,'request\x20sent');_0x40458a(_0x2c953b[_0x90ad('0x17')]['message']);}})['catch'](function(_0x557e23){logger['error'](_0x90ad('0x10'),_0x37ba4e,_0x557e23);_0x5eb3de(_0x557e23);});});}exports[_0x90ad('0x18')]=function(_0x3a33f9){var _0x3cc427=this;return new Promise(function(_0x108d8a,_0x19131f){return db[_0x90ad('0x19')][_0x90ad('0x1a')]({'raw':_0x3a33f9[_0x90ad('0x1b')]?_0x3a33f9[_0x90ad('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3a33f9[_0x90ad('0x1b')]?_0x3a33f9[_0x90ad('0x1b')][_0x90ad('0x1c')]||null:null,'attributes':_0x3a33f9[_0x90ad('0x1b')]?_0x3a33f9[_0x90ad('0x1b')][_0x90ad('0x1d')]||null:null,'limit':_0x3a33f9['options']?_0x3a33f9[_0x90ad('0x1b')][_0x90ad('0x1e')]||null:null,'include':_0x3a33f9[_0x90ad('0x1b')]?_0x3a33f9['options'][_0x90ad('0x1f')]?_['map'](_0x3a33f9[_0x90ad('0x1b')][_0x90ad('0x1f')],function(_0x3a1aab){return{'model':db[_0x3a1aab[_0x90ad('0x20')]],'as':_0x3a1aab['as'],'attributes':_0x3a1aab[_0x90ad('0x1d')],'include':_0x3a1aab[_0x90ad('0x1f')]?_['map'](_0x3a1aab[_0x90ad('0x1f')],function(_0x524ed2){return{'model':db[_0x524ed2[_0x90ad('0x20')]],'as':_0x524ed2['as'],'attributes':_0x524ed2['attributes'],'include':_0x524ed2['include']?_['map'](_0x524ed2[_0x90ad('0x1f')],function(_0x4ae441){return{'model':db[_0x4ae441[_0x90ad('0x20')]],'as':_0x4ae441['as'],'attributes':_0x4ae441[_0x90ad('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x90ad('0xe')](function(_0x286310){logger[_0x90ad('0xf')](_0x90ad('0x18'),_0x3a33f9);logger[_0x90ad('0x12')](_0x90ad('0x18'),_0x3a33f9,JSON[_0x90ad('0x14')](_0x286310));_0x108d8a(_0x286310);})[_0x90ad('0x21')](function(_0x437ce4){logger['error'](_0x90ad('0x18'),_0x437ce4[_0x90ad('0x16')],_0x3a33f9);_0x19131f(_0x3cc427['error'](0x1f4,_0x437ce4[_0x90ad('0x16')]));});});};exports[_0x90ad('0x22')]=function(_0x22b90d){var _0x447c44=this;return new Promise(function(_0x10b0fe,_0x516209){return db['SugarcrmAccount'][_0x90ad('0x23')]({'raw':_0x22b90d['options']?_0x22b90d[_0x90ad('0x1b')][_0x90ad('0x24')]===undefined?!![]:![]:!![],'where':_0x22b90d[_0x90ad('0x1b')]?_0x22b90d['options']['where']||null:null,'attributes':_0x22b90d[_0x90ad('0x1b')]?_0x22b90d[_0x90ad('0x1b')][_0x90ad('0x1d')]||null:null,'include':_0x22b90d[_0x90ad('0x1b')]?_0x22b90d['options']['include']?_[_0x90ad('0x25')](_0x22b90d[_0x90ad('0x1b')]['include'],function(_0x365825){return{'model':db[_0x365825[_0x90ad('0x20')]],'as':_0x365825['as'],'attributes':_0x365825['attributes'],'include':_0x365825['include']?_['map'](_0x365825['include'],function(_0x2b89df){return{'model':db[_0x2b89df['model']],'as':_0x2b89df['as'],'attributes':_0x2b89df[_0x90ad('0x1d')],'include':_0x2b89df[_0x90ad('0x1f')]?_[_0x90ad('0x25')](_0x2b89df[_0x90ad('0x1f')],function(_0x306750){return{'model':db[_0x306750['model']],'as':_0x306750['as'],'attributes':_0x306750['attributes']};}):[]};}):[]};}):[]:[]})[_0x90ad('0xe')](function(_0x36104b){logger[_0x90ad('0xf')](_0x90ad('0x22'),_0x22b90d);logger[_0x90ad('0x12')](_0x90ad('0x22'),_0x22b90d,JSON[_0x90ad('0x14')](_0x36104b));_0x10b0fe(_0x36104b);})['catch'](function(_0x3625e6){logger['error'](_0x90ad('0x22'),_0x3625e6[_0x90ad('0x16')],_0x22b90d);_0x516209(_0x447c44[_0x90ad('0x15')](0x1f4,_0x3625e6[_0x90ad('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 9164843..5deadf0 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 _0x7dc2=['create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post'];(function(_0x3240ba,_0x1398ba){var _0x51ed9f=function(_0x2aff6e){while(--_0x2aff6e){_0x3240ba['push'](_0x3240ba['shift']());}};_0x51ed9f(++_0x1398ba);}(_0x7dc2,0xeb));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x27dc('0x0'));var util=require(_0x27dc('0x1'));var path=require(_0x27dc('0x2'));var timeout=require(_0x27dc('0x3'));var express=require('express');var router=express[_0x27dc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x27dc('0x5'));var config=require(_0x27dc('0x6'));var controller=require(_0x27dc('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x27dc('0x8')]);router[_0x27dc('0x9')](_0x27dc('0xa'),auth[_0x27dc('0xb')](),controller['show']);router['get'](_0x27dc('0xc'),auth[_0x27dc('0xb')](),controller[_0x27dc('0xd')]);router[_0x27dc('0x9')](_0x27dc('0xe'),auth[_0x27dc('0xb')](),controller[_0x27dc('0xf')]);router[_0x27dc('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x27dc('0x10')]);router[_0x27dc('0x11')]('/',auth[_0x27dc('0xb')](),controller[_0x27dc('0x12')]);router[_0x27dc('0x13')](_0x27dc('0xa'),auth['isAuthenticated'](),controller[_0x27dc('0x14')]);router['delete']('/:id',auth[_0x27dc('0xb')](),controller[_0x27dc('0x15')]);module[_0x27dc('0x16')]=router; \ No newline at end of file +var _0x8ea9=['isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','put','/:id','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','index','/:id/fields'];(function(_0x3bfc5a,_0x1d46da){var _0x5e8de0=function(_0x33ae96){while(--_0x33ae96){_0x3bfc5a['push'](_0x3bfc5a['shift']());}};_0x5e8de0(++_0x1d46da);}(_0x8ea9,0xb3));var _0x98ea=function(_0x1b2868,_0x230a3c){_0x1b2868=_0x1b2868-0x0;var _0x1e0203=_0x8ea9[_0x1b2868];return _0x1e0203;};'use strict';var multer=require(_0x98ea('0x0'));var util=require(_0x98ea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x98ea('0x2'));var router=express[_0x98ea('0x3')]();var auth=require(_0x98ea('0x4'));var interaction=require(_0x98ea('0x5'));var config=require('../../config/environment');var controller=require(_0x98ea('0x6'));router[_0x98ea('0x7')]('/',auth['isAuthenticated'](),controller[_0x98ea('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x98ea('0x9'),auth[_0x98ea('0xa')](),controller[_0x98ea('0xb')]);router[_0x98ea('0x7')]('/:id/subjects',auth[_0x98ea('0xa')](),controller[_0x98ea('0xc')]);router[_0x98ea('0x7')](_0x98ea('0xd'),auth['isAuthenticated'](),controller[_0x98ea('0xe')]);router['post']('/',auth[_0x98ea('0xa')](),controller['create']);router[_0x98ea('0xf')](_0x98ea('0x10'),auth[_0x98ea('0xa')](),controller[_0x98ea('0x11')]);router[_0x98ea('0x12')](_0x98ea('0x10'),auth['isAuthenticated'](),controller[_0x98ea('0x13')]);module[_0x98ea('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 9307763..0cd85d1 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 _0x1fff=['exports','sequelize'];(function(_0x151002,_0x1c9af6){var _0x1a7a58=function(_0x282ec3){while(--_0x282ec3){_0x151002['push'](_0x151002['shift']());}};_0x1a7a58(++_0x1c9af6);}(_0x1fff,0x1b9));var _0xf1ff=function(_0x227522,_0x2e6279){_0x227522=_0x227522-0x0;var _0x3cac77=_0x1fff[_0x227522];return _0x3cac77;};'use strict';var Sequelize=require(_0xf1ff('0x0'));module[_0xf1ff('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0402=['sequelize','exports','STRING'];(function(_0x38c4d4,_0x3165c1){var _0x2afc06=function(_0x18115d){while(--_0x18115d){_0x38c4d4['push'](_0x38c4d4['shift']());}};_0x2afc06(++_0x3165c1);}(_0x0402,0x123));var _0x2040=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x0402[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0x2040('0x0'));module[_0x2040('0x1')]={'name':{'type':Sequelize[_0x2040('0x2')]},'description':{'type':Sequelize[_0x2040('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index bda9a5d..3adcfb4 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 _0x73de=['filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','SugarcrmConfiguration','include','findAll','rows','params','rawAttributes','find','body','destroy','getFields','SugarcrmField','sort','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','status','json','count','offset','limit','apply','save','update','end','sendStatus','stack','name','send','model','keys','query','intersection','attributes','fields','length','order','where'];(function(_0x3f954d,_0x36e76c){var _0xb172bb=function(_0x221f19){while(--_0x221f19){_0x3f954d['push'](_0x3f954d['shift']());}};_0xb172bb(++_0x36e76c);}(_0x73de,0x1ce));var _0xe73d=function(_0x9a6f03,_0x5c7aa8){_0x9a6f03=_0x9a6f03-0x0;var _0x20f739=_0x73de[_0x9a6f03];return _0x20f739;};'use strict';var pdf=require(_0xe73d('0x0'));var emlformat=require(_0xe73d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe73d('0x2'));var jsonpatch=require(_0xe73d('0x3'));var rp=require('request-promise');var moment=require(_0xe73d('0x4'));var BPromise=require(_0xe73d('0x5'));var Mustache=require(_0xe73d('0x6'));var util=require('util');var path=require(_0xe73d('0x7'));var sox=require(_0xe73d('0x8'));var csv=require('to-csv');var ejs=require(_0xe73d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe73d('0xa'));var jsforce=require(_0xe73d('0xb'));var deskjs=require(_0xe73d('0xc'));var toCsv=require(_0xe73d('0xd'));var querystring=require(_0xe73d('0xe'));var Papa=require(_0xe73d('0xf'));var Redis=require(_0xe73d('0x10'));var authService=require(_0xe73d('0x11'));var qs=require(_0xe73d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe73d('0x13'))(_0xe73d('0x14'));var utils=require(_0xe73d('0x15'));var config=require(_0xe73d('0x16'));var db=require(_0xe73d('0x17'))['db'];var jayson=require(_0xe73d('0x18'));var client=jayson['client'][_0xe73d('0x19')]({'port':0x232a});function checkPasswordPattern(_0xd9a07a,_0x54fa7a,_0x1265ff){if(_0x1265ff){var _0x26044e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26044e[_0xe73d('0x1a')](_0x54fa7a)){return _0xd9a07a;}else{throw new Error(_0xe73d('0x1b'));}}else{return _0xd9a07a;}}function respondWithRpcPromise(_0x14011b,_0x59dc29,_0xcf175a,_0x17ad98){return new BPromise(function(_0x59a572,_0x269ab1){var _0x12b65d=_0x17ad98||client;return _0x12b65d[_0xe73d('0x1c')](_0x14011b,_0xcf175a)[_0xe73d('0x1d')](function(_0x1b121a){logger['info'](_0xe73d('0x1e'),_0x59dc29,_0xe73d('0x1f'));logger[_0xe73d('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x59dc29,_0xe73d('0x1f'),JSON[_0xe73d('0x21')](_0x1b121a));if(_0x1b121a[_0xe73d('0x22')]){if(_0x1b121a[_0xe73d('0x22')]['code']===0x1f4){logger[_0xe73d('0x22')](_0xe73d('0x1e'),_0x59dc29,_0x1b121a[_0xe73d('0x22')][_0xe73d('0x23')]);return _0x269ab1(_0x1b121a[_0xe73d('0x22')][_0xe73d('0x23')]);}logger[_0xe73d('0x22')](_0xe73d('0x1e'),_0x59dc29,_0x1b121a[_0xe73d('0x22')]['message']);return _0x59a572(_0x1b121a[_0xe73d('0x22')]['message']);}else{logger[_0xe73d('0x24')](_0xe73d('0x1e'),_0x59dc29,_0xe73d('0x1f'));_0x59a572(_0x1b121a['result']['message']);}})[_0xe73d('0x25')](function(_0x541553){logger[_0xe73d('0x22')](_0xe73d('0x1e'),_0x59dc29,_0x541553);_0x269ab1(_0x541553);});});}function respondWithStatusCode(_0x2ab9f0,_0x17e580){_0x17e580=_0x17e580||0xcc;return function(_0x43c3e9){if(_0x43c3e9){return _0x2ab9f0['sendStatus'](_0x17e580);}return _0x2ab9f0['status'](_0x17e580)['end']();};}function respondWithResult(_0xa86d37,_0x38a981){_0x38a981=_0x38a981||0xc8;return function(_0x38062a){if(_0x38062a){return _0xa86d37[_0xe73d('0x26')](_0x38a981)[_0xe73d('0x27')](_0x38062a);}};}function respondWithFilteredResult(_0x4c1b95,_0x41a48c){return function(_0x2c346c){if(_0x2c346c){var _0x177cae=_0x2c346c[_0xe73d('0x28')],_0x3ae5fb=_0x41a48c[_0xe73d('0x29')],_0x3f787f=_0x41a48c[_0xe73d('0x29')]+_0x41a48c[_0xe73d('0x2a')],_0x87d74d;if(_0x3f787f>=_0x177cae){_0x3f787f=_0x177cae;_0x87d74d=0xc8;}else{_0x87d74d=0xce;}_0x4c1b95['status'](_0x87d74d);return _0x4c1b95['set']('Content-Range',_0x3ae5fb+'-'+_0x3f787f+'/'+_0x177cae)[_0xe73d('0x27')](_0x2c346c);}return null;};}function patchUpdates(_0x4b98e1){return function(_0x558b73){try{jsonpatch[_0xe73d('0x2b')](_0x558b73,_0x4b98e1,!![]);}catch(_0x5f580f){return BPromise['reject'](_0x5f580f);}return _0x558b73[_0xe73d('0x2c')]();};}function saveUpdates(_0x257c36,_0x3a0093){return function(_0x4e27ae){if(_0x4e27ae){return _0x4e27ae[_0xe73d('0x2d')](_0x257c36)[_0xe73d('0x1d')](function(_0xb2af5a){return _0xb2af5a;});}return null;};}function removeEntity(_0x472763,_0x263586){return function(_0x355248){if(_0x355248){return _0x355248['destroy']()[_0xe73d('0x1d')](function(){_0x472763[_0xe73d('0x26')](0xcc)[_0xe73d('0x2e')]();});}};}function handleEntityNotFound(_0x26d091,_0x3f502b){return function(_0x14b57d){if(!_0x14b57d){_0x26d091[_0xe73d('0x2f')](0x194);}return _0x14b57d;};}function handleError(_0x20ad85,_0x18ab65){_0x18ab65=_0x18ab65||0x1f4;return function(_0x4b184e){logger['error'](_0x4b184e[_0xe73d('0x30')]);if(_0x4b184e[_0xe73d('0x31')]){delete _0x4b184e['name'];}_0x20ad85[_0xe73d('0x26')](_0x18ab65)[_0xe73d('0x32')](_0x4b184e);};}exports['index']=function(_0x5d3142,_0x5ae4b8){var _0x532d8b={},_0x476243={},_0x3c0d8a={'count':0x0,'rows':[]};var _0x21979b=db['SugarcrmConfiguration']['rawAttributes'];_0x476243[_0xe73d('0x33')]=_[_0xe73d('0x34')](_0x21979b);_0x476243[_0xe73d('0x35')]=_[_0xe73d('0x34')](_0x5d3142[_0xe73d('0x35')]);_0x476243['filters']=_[_0xe73d('0x36')](_0x476243[_0xe73d('0x33')],_0x476243[_0xe73d('0x35')]);_0x532d8b[_0xe73d('0x37')]=_['intersection'](_0x476243[_0xe73d('0x33')],qs[_0xe73d('0x38')](_0x5d3142[_0xe73d('0x35')][_0xe73d('0x38')]));_0x532d8b['attributes']=_0x532d8b[_0xe73d('0x37')][_0xe73d('0x39')]?_0x532d8b['attributes']:_0x476243[_0xe73d('0x33')];if(!_0x5d3142[_0xe73d('0x35')]['hasOwnProperty']('nolimit')){_0x532d8b[_0xe73d('0x2a')]=qs[_0xe73d('0x2a')](_0x5d3142['query'][_0xe73d('0x2a')]);_0x532d8b[_0xe73d('0x29')]=qs[_0xe73d('0x29')](_0x5d3142[_0xe73d('0x35')]['offset']);}_0x532d8b[_0xe73d('0x3a')]=qs['sort'](_0x5d3142[_0xe73d('0x35')]['sort']);_0x532d8b[_0xe73d('0x3b')]=qs[_0xe73d('0x3c')](_[_0xe73d('0x3d')](_0x5d3142[_0xe73d('0x35')],_0x476243[_0xe73d('0x3c')]));if(_0x5d3142[_0xe73d('0x35')][_0xe73d('0x3e')]){_0x532d8b[_0xe73d('0x3b')]=_[_0xe73d('0x3f')](_0x532d8b['where'],{'$or':_[_0xe73d('0x40')](_0x21979b,function(_0x51d732){if(_0x51d732[_0xe73d('0x41')][_0xe73d('0x42')]!==_0xe73d('0x43')){var _0x336092={};_0x336092[_0x51d732[_0xe73d('0x44')]]={'$like':'%'+_0x5d3142[_0xe73d('0x35')][_0xe73d('0x3e')]+'%'};return _0x336092;}})});}_0x532d8b=_[_0xe73d('0x3f')]({},_0x532d8b,_0x5d3142[_0xe73d('0x45')]);var _0xab1e6={'where':_0x532d8b[_0xe73d('0x3b')]};return db[_0xe73d('0x46')][_0xe73d('0x28')](_0xab1e6)[_0xe73d('0x1d')](function(_0x5b15a5){_0x3c0d8a[_0xe73d('0x28')]=_0x5b15a5;if(_0x5d3142[_0xe73d('0x35')]['includeAll']){_0x532d8b[_0xe73d('0x47')]=[{'all':!![]}];}return db[_0xe73d('0x46')][_0xe73d('0x48')](_0x532d8b);})['then'](function(_0x2f81ae){_0x3c0d8a[_0xe73d('0x49')]=_0x2f81ae;return _0x3c0d8a;})['then'](respondWithFilteredResult(_0x5ae4b8,_0x532d8b))[_0xe73d('0x25')](handleError(_0x5ae4b8,null));};exports['show']=function(_0x3d83f2,_0x4beca1){var _0x471600={'raw':![],'where':{'id':_0x3d83f2[_0xe73d('0x4a')]['id']}},_0x503ac0={};_0x503ac0[_0xe73d('0x33')]=_[_0xe73d('0x34')](db['SugarcrmConfiguration'][_0xe73d('0x4b')]);_0x503ac0['query']=_[_0xe73d('0x34')](_0x3d83f2[_0xe73d('0x35')]);_0x503ac0['filters']=_[_0xe73d('0x36')](_0x503ac0[_0xe73d('0x33')],_0x503ac0[_0xe73d('0x35')]);_0x471600[_0xe73d('0x37')]=_['intersection'](_0x503ac0['model'],qs['fields'](_0x3d83f2[_0xe73d('0x35')][_0xe73d('0x38')]));_0x471600[_0xe73d('0x37')]=_0x471600[_0xe73d('0x37')][_0xe73d('0x39')]?_0x471600[_0xe73d('0x37')]:_0x503ac0[_0xe73d('0x33')];if(_0x3d83f2[_0xe73d('0x35')]['includeAll']){_0x471600[_0xe73d('0x47')]=[{'all':!![]}];}_0x471600=_[_0xe73d('0x3f')]({},_0x471600,_0x3d83f2['options']);return db[_0xe73d('0x46')][_0xe73d('0x4c')](_0x471600)[_0xe73d('0x1d')](handleEntityNotFound(_0x4beca1,null))[_0xe73d('0x1d')](respondWithResult(_0x4beca1,null))[_0xe73d('0x25')](handleError(_0x4beca1,null));};exports['create']=function(_0x1e5830,_0x5c9e13){return db[_0xe73d('0x46')]['create'](_0x1e5830[_0xe73d('0x4d')],{})[_0xe73d('0x1d')](respondWithResult(_0x5c9e13,0xc9))['catch'](handleError(_0x5c9e13,null));};exports[_0xe73d('0x2d')]=function(_0x51518a,_0x50baee){if(_0x51518a[_0xe73d('0x4d')]['id']){delete _0x51518a['body']['id'];}return db[_0xe73d('0x46')][_0xe73d('0x4c')]({'where':{'id':_0x51518a[_0xe73d('0x4a')]['id']}})[_0xe73d('0x1d')](handleEntityNotFound(_0x50baee,null))[_0xe73d('0x1d')](saveUpdates(_0x51518a['body'],null))['then'](respondWithResult(_0x50baee,null))['catch'](handleError(_0x50baee,null));};exports[_0xe73d('0x4e')]=function(_0x41aadb,_0x4878c6){return db[_0xe73d('0x46')][_0xe73d('0x4c')]({'where':{'id':_0x41aadb[_0xe73d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4878c6,null))['then'](removeEntity(_0x4878c6,null))[_0xe73d('0x25')](handleError(_0x4878c6,null));};exports[_0xe73d('0x4f')]=function(_0xcb404c,_0x43e7ab,_0x226299){var _0x66fbba={};var _0x270593={};var _0x244c6b;var _0x171e99;return db[_0xe73d('0x46')]['findOne']({'where':{'id':_0xcb404c['params']['id']}})['then'](handleEntityNotFound(_0x43e7ab,null))['then'](function(_0x503f83){if(_0x503f83){_0x244c6b=_0x503f83;_0x270593[_0xe73d('0x33')]=_[_0xe73d('0x34')](db[_0xe73d('0x50')][_0xe73d('0x4b')]);_0x270593[_0xe73d('0x35')]=_[_0xe73d('0x34')](_0xcb404c[_0xe73d('0x35')]);_0x270593[_0xe73d('0x3c')]=_[_0xe73d('0x36')](_0x270593[_0xe73d('0x33')],_0x270593[_0xe73d('0x35')]);_0x66fbba[_0xe73d('0x37')]=_[_0xe73d('0x36')](_0x270593['model'],qs[_0xe73d('0x38')](_0xcb404c['query'][_0xe73d('0x38')]));_0x66fbba[_0xe73d('0x37')]=_0x66fbba[_0xe73d('0x37')][_0xe73d('0x39')]?_0x66fbba[_0xe73d('0x37')]:_0x270593['model'];_0x66fbba['order']=qs[_0xe73d('0x51')](_0xcb404c[_0xe73d('0x35')][_0xe73d('0x51')]);_0x66fbba[_0xe73d('0x3b')]=qs[_0xe73d('0x3c')](_[_0xe73d('0x3d')](_0xcb404c[_0xe73d('0x35')],_0x270593['filters']));if(_0xcb404c[_0xe73d('0x35')][_0xe73d('0x3e')]){_0x66fbba[_0xe73d('0x3b')]=_['merge'](_0x66fbba['where'],{'$or':_[_0xe73d('0x40')](_0x66fbba[_0xe73d('0x37')],function(_0x236c7b){var _0x4e382c={};_0x4e382c[_0x236c7b]={'$like':'%'+_0xcb404c[_0xe73d('0x35')][_0xe73d('0x3e')]+'%'};return _0x4e382c;})});}_0x66fbba=_['merge']({},_0x66fbba,_0xcb404c[_0xe73d('0x45')]);return _0x244c6b['getFields'](_0x66fbba);}})[_0xe73d('0x1d')](function(_0x4c1890){if(_0x4c1890){_0x171e99=_0x4c1890[_0xe73d('0x39')];if(!_0xcb404c[_0xe73d('0x35')][_0xe73d('0x52')](_0xe73d('0x53'))){_0x66fbba[_0xe73d('0x2a')]=qs[_0xe73d('0x2a')](_0xcb404c['query'][_0xe73d('0x2a')]);_0x66fbba[_0xe73d('0x29')]=qs[_0xe73d('0x29')](_0xcb404c[_0xe73d('0x35')][_0xe73d('0x29')]);}return _0x244c6b[_0xe73d('0x4f')](_0x66fbba);}})['then'](function(_0x281da1){if(_0x281da1){return _0x281da1?{'count':_0x171e99,'rows':_0x281da1}:null;}})[_0xe73d('0x1d')](respondWithResult(_0x43e7ab,null))[_0xe73d('0x25')](handleError(_0x43e7ab,null));};exports[_0xe73d('0x54')]=function(_0x7c42b5,_0x19e6ba,_0x8d5a17){var _0x2b09c1={};var _0x15728e={};var _0x5d6398;var _0x16e7c9;return db[_0xe73d('0x46')][_0xe73d('0x55')]({'where':{'id':_0x7c42b5[_0xe73d('0x4a')]['id']}})[_0xe73d('0x1d')](handleEntityNotFound(_0x19e6ba,null))[_0xe73d('0x1d')](function(_0x47719f){if(_0x47719f){_0x5d6398=_0x47719f;_0x15728e[_0xe73d('0x33')]=_[_0xe73d('0x34')](db['SugarcrmField'][_0xe73d('0x4b')]);_0x15728e[_0xe73d('0x35')]=_['keys'](_0x7c42b5[_0xe73d('0x35')]);_0x15728e[_0xe73d('0x3c')]=_['intersection'](_0x15728e['model'],_0x15728e[_0xe73d('0x35')]);_0x2b09c1[_0xe73d('0x37')]=_['intersection'](_0x15728e[_0xe73d('0x33')],qs['fields'](_0x7c42b5[_0xe73d('0x35')][_0xe73d('0x38')]));_0x2b09c1[_0xe73d('0x37')]=_0x2b09c1[_0xe73d('0x37')]['length']?_0x2b09c1[_0xe73d('0x37')]:_0x15728e[_0xe73d('0x33')];_0x2b09c1[_0xe73d('0x3a')]=qs[_0xe73d('0x51')](_0x7c42b5[_0xe73d('0x35')][_0xe73d('0x51')]);_0x2b09c1[_0xe73d('0x3b')]=qs['filters'](_[_0xe73d('0x3d')](_0x7c42b5[_0xe73d('0x35')],_0x15728e['filters']));if(_0x7c42b5[_0xe73d('0x35')][_0xe73d('0x3e')]){_0x2b09c1[_0xe73d('0x3b')]=_[_0xe73d('0x3f')](_0x2b09c1[_0xe73d('0x3b')],{'$or':_[_0xe73d('0x40')](_0x2b09c1['attributes'],function(_0x508d67){var _0x3e3c80={};_0x3e3c80[_0x508d67]={'$like':'%'+_0x7c42b5['query'][_0xe73d('0x3e')]+'%'};return _0x3e3c80;})});}_0x2b09c1=_['merge']({},_0x2b09c1,_0x7c42b5[_0xe73d('0x45')]);return _0x5d6398[_0xe73d('0x54')](_0x2b09c1);}})[_0xe73d('0x1d')](function(_0x2f8139){if(_0x2f8139){_0x16e7c9=_0x2f8139[_0xe73d('0x39')];if(!_0x7c42b5[_0xe73d('0x35')][_0xe73d('0x52')](_0xe73d('0x53'))){_0x2b09c1[_0xe73d('0x2a')]=qs[_0xe73d('0x2a')](_0x7c42b5['query'][_0xe73d('0x2a')]);_0x2b09c1[_0xe73d('0x29')]=qs['offset'](_0x7c42b5[_0xe73d('0x35')][_0xe73d('0x29')]);}return _0x5d6398[_0xe73d('0x54')](_0x2b09c1);}})[_0xe73d('0x1d')](function(_0x45fd4){if(_0x45fd4){return _0x45fd4?{'count':_0x16e7c9,'rows':_0x45fd4}:null;}})[_0xe73d('0x1d')](respondWithResult(_0x19e6ba,null))[_0xe73d('0x25')](handleError(_0x19e6ba,null));};exports[_0xe73d('0x56')]=function(_0x392e13,_0x4b187f,_0x95ac16){var _0x38db15={};var _0x559359={};var _0x56aa4a;var _0x22cdb7;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x392e13[_0xe73d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b187f,null))[_0xe73d('0x1d')](function(_0x8e08e7){if(_0x8e08e7){_0x56aa4a=_0x8e08e7;_0x559359[_0xe73d('0x33')]=_[_0xe73d('0x34')](db[_0xe73d('0x50')][_0xe73d('0x4b')]);_0x559359[_0xe73d('0x35')]=_[_0xe73d('0x34')](_0x392e13[_0xe73d('0x35')]);_0x559359[_0xe73d('0x3c')]=_[_0xe73d('0x36')](_0x559359['model'],_0x559359['query']);_0x38db15[_0xe73d('0x37')]=_[_0xe73d('0x36')](_0x559359[_0xe73d('0x33')],qs[_0xe73d('0x38')](_0x392e13[_0xe73d('0x35')][_0xe73d('0x38')]));_0x38db15[_0xe73d('0x37')]=_0x38db15[_0xe73d('0x37')][_0xe73d('0x39')]?_0x38db15[_0xe73d('0x37')]:_0x559359[_0xe73d('0x33')];_0x38db15['order']=qs[_0xe73d('0x51')](_0x392e13[_0xe73d('0x35')][_0xe73d('0x51')]);_0x38db15[_0xe73d('0x3b')]=qs[_0xe73d('0x3c')](_[_0xe73d('0x3d')](_0x392e13[_0xe73d('0x35')],_0x559359[_0xe73d('0x3c')]));if(_0x392e13[_0xe73d('0x35')][_0xe73d('0x3e')]){_0x38db15['where']=_[_0xe73d('0x3f')](_0x38db15['where'],{'$or':_[_0xe73d('0x40')](_0x38db15[_0xe73d('0x37')],function(_0x3d1945){var _0xaf6c6f={};_0xaf6c6f[_0x3d1945]={'$like':'%'+_0x392e13[_0xe73d('0x35')][_0xe73d('0x3e')]+'%'};return _0xaf6c6f;})});}_0x38db15=_[_0xe73d('0x3f')]({},_0x38db15,_0x392e13[_0xe73d('0x45')]);return _0x56aa4a[_0xe73d('0x56')](_0x38db15);}})[_0xe73d('0x1d')](function(_0x375e5a){if(_0x375e5a){_0x22cdb7=_0x375e5a[_0xe73d('0x39')];if(!_0x392e13[_0xe73d('0x35')][_0xe73d('0x52')](_0xe73d('0x53'))){_0x38db15['limit']=qs[_0xe73d('0x2a')](_0x392e13[_0xe73d('0x35')][_0xe73d('0x2a')]);_0x38db15[_0xe73d('0x29')]=qs[_0xe73d('0x29')](_0x392e13['query'][_0xe73d('0x29')]);}return _0x56aa4a[_0xe73d('0x56')](_0x38db15);}})[_0xe73d('0x1d')](function(_0x42e2e1){if(_0x42e2e1){return _0x42e2e1?{'count':_0x22cdb7,'rows':_0x42e2e1}:null;}})[_0xe73d('0x1d')](respondWithResult(_0x4b187f,null))[_0xe73d('0x25')](handleError(_0x4b187f,null));}; \ No newline at end of file +var _0xa007=['body','destroy','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','end','stack','name','send','index','SugarcrmConfiguration','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','key','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create'];(function(_0x425029,_0x50a9a1){var _0x34efad=function(_0x3921d5){while(--_0x3921d5){_0x425029['push'](_0x425029['shift']());}};_0x34efad(++_0x50a9a1);}(_0xa007,0xb4));var _0x7a00=function(_0x16ab58,_0x591ef3){_0x16ab58=_0x16ab58-0x0;var _0x33f05f=_0xa007[_0x16ab58];return _0x33f05f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7a00('0x0'));var rimraf=require(_0x7a00('0x1'));var zipdir=require(_0x7a00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a00('0x3'));var moment=require(_0x7a00('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a00('0x5'));var util=require(_0x7a00('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a00('0x7'));var squel=require(_0x7a00('0x8'));var crypto=require(_0x7a00('0x9'));var jsforce=require(_0x7a00('0xa'));var deskjs=require(_0x7a00('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7a00('0xc'));var Papa=require(_0x7a00('0xd'));var Redis=require(_0x7a00('0xe'));var authService=require(_0x7a00('0xf'));var qs=require(_0x7a00('0x10'));var hardwareService=require(_0x7a00('0x11'));var logger=require('../../config/logger')(_0x7a00('0x12'));var utils=require(_0x7a00('0x13'));var config=require(_0x7a00('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7a00('0x15'));var client=jayson[_0x7a00('0x16')][_0x7a00('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5d7f48,_0x495a37,_0x446563){if(_0x446563){var _0x3770b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3770b6['test'](_0x495a37)){return _0x5d7f48;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d7f48;}}function respondWithRpcPromise(_0x4770d7,_0x31364a,_0x1fae94,_0x43c9ce){return new BPromise(function(_0x5ee8fa,_0x1e3f7b){var _0xf75da=_0x43c9ce||client;return _0xf75da[_0x7a00('0x18')](_0x4770d7,_0x1fae94)[_0x7a00('0x19')](function(_0x4fdee2){logger[_0x7a00('0x1a')](_0x7a00('0x1b'),_0x31364a,'request\x20sent');logger['debug'](_0x7a00('0x1c'),_0x31364a,_0x7a00('0x1d'),JSON['stringify'](_0x4fdee2));if(_0x4fdee2[_0x7a00('0x1e')]){if(_0x4fdee2[_0x7a00('0x1e')][_0x7a00('0x1f')]===0x1f4){logger['error'](_0x7a00('0x1b'),_0x31364a,_0x4fdee2[_0x7a00('0x1e')][_0x7a00('0x20')]);return _0x1e3f7b(_0x4fdee2[_0x7a00('0x1e')][_0x7a00('0x20')]);}logger['error'](_0x7a00('0x1b'),_0x31364a,_0x4fdee2['error'][_0x7a00('0x20')]);return _0x5ee8fa(_0x4fdee2['error'][_0x7a00('0x20')]);}else{logger[_0x7a00('0x1a')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x31364a,'request\x20sent');_0x5ee8fa(_0x4fdee2[_0x7a00('0x21')][_0x7a00('0x20')]);}})[_0x7a00('0x22')](function(_0x52962e){logger['error'](_0x7a00('0x1b'),_0x31364a,_0x52962e);_0x1e3f7b(_0x52962e);});});}function respondWithStatusCode(_0x20db0b,_0x4d4d0c){_0x4d4d0c=_0x4d4d0c||0xcc;return function(_0x3025fd){if(_0x3025fd){return _0x20db0b[_0x7a00('0x23')](_0x4d4d0c);}return _0x20db0b[_0x7a00('0x24')](_0x4d4d0c)['end']();};}function respondWithResult(_0x44307f,_0x104b3f){_0x104b3f=_0x104b3f||0xc8;return function(_0x3404ce){if(_0x3404ce){return _0x44307f[_0x7a00('0x24')](_0x104b3f)[_0x7a00('0x25')](_0x3404ce);}};}function respondWithFilteredResult(_0x1b6203,_0x3420f3){return function(_0x55c8c8){if(_0x55c8c8){var _0x1e10c3=_0x55c8c8[_0x7a00('0x26')],_0x2503ba=_0x3420f3[_0x7a00('0x27')],_0x37dcae=_0x3420f3['offset']+_0x3420f3[_0x7a00('0x28')],_0x4b69d3;if(_0x37dcae>=_0x1e10c3){_0x37dcae=_0x1e10c3;_0x4b69d3=0xc8;}else{_0x4b69d3=0xce;}_0x1b6203[_0x7a00('0x24')](_0x4b69d3);return _0x1b6203[_0x7a00('0x29')](_0x7a00('0x2a'),_0x2503ba+'-'+_0x37dcae+'/'+_0x1e10c3)[_0x7a00('0x25')](_0x55c8c8);}return null;};}function patchUpdates(_0x492c60){return function(_0x266eec){try{jsonpatch['apply'](_0x266eec,_0x492c60,!![]);}catch(_0x54a4dc){return BPromise[_0x7a00('0x2b')](_0x54a4dc);}return _0x266eec['save']();};}function saveUpdates(_0x5be03c,_0x1f3353){return function(_0x46181b){if(_0x46181b){return _0x46181b[_0x7a00('0x2c')](_0x5be03c)[_0x7a00('0x19')](function(_0x52cd69){return _0x52cd69;});}return null;};}function removeEntity(_0x3d68d5,_0x45fd27){return function(_0x569740){if(_0x569740){return _0x569740['destroy']()[_0x7a00('0x19')](function(){_0x3d68d5[_0x7a00('0x24')](0xcc)[_0x7a00('0x2d')]();});}};}function handleEntityNotFound(_0x55c996,_0x2a7040){return function(_0x3a565b){if(!_0x3a565b){_0x55c996[_0x7a00('0x23')](0x194);}return _0x3a565b;};}function handleError(_0x2209ed,_0x2ca4a4){_0x2ca4a4=_0x2ca4a4||0x1f4;return function(_0x55f689){logger[_0x7a00('0x1e')](_0x55f689[_0x7a00('0x2e')]);if(_0x55f689[_0x7a00('0x2f')]){delete _0x55f689['name'];}_0x2209ed[_0x7a00('0x24')](_0x2ca4a4)[_0x7a00('0x30')](_0x55f689);};}exports[_0x7a00('0x31')]=function(_0x15d6cf,_0x1189c7){var _0x4190c8={},_0x488f0e={},_0x12c44b={'count':0x0,'rows':[]};var _0x3002ed=db[_0x7a00('0x32')]['rawAttributes'];_0x488f0e[_0x7a00('0x33')]=_[_0x7a00('0x34')](_0x3002ed);_0x488f0e['query']=_['keys'](_0x15d6cf['query']);_0x488f0e[_0x7a00('0x35')]=_[_0x7a00('0x36')](_0x488f0e[_0x7a00('0x33')],_0x488f0e[_0x7a00('0x37')]);_0x4190c8[_0x7a00('0x38')]=_[_0x7a00('0x36')](_0x488f0e[_0x7a00('0x33')],qs[_0x7a00('0x39')](_0x15d6cf[_0x7a00('0x37')][_0x7a00('0x39')]));_0x4190c8[_0x7a00('0x38')]=_0x4190c8[_0x7a00('0x38')][_0x7a00('0x3a')]?_0x4190c8[_0x7a00('0x38')]:_0x488f0e[_0x7a00('0x33')];if(!_0x15d6cf[_0x7a00('0x37')][_0x7a00('0x3b')]('nolimit')){_0x4190c8['limit']=qs[_0x7a00('0x28')](_0x15d6cf[_0x7a00('0x37')][_0x7a00('0x28')]);_0x4190c8[_0x7a00('0x27')]=qs[_0x7a00('0x27')](_0x15d6cf[_0x7a00('0x37')][_0x7a00('0x27')]);}_0x4190c8[_0x7a00('0x3c')]=qs[_0x7a00('0x3d')](_0x15d6cf[_0x7a00('0x37')][_0x7a00('0x3d')]);_0x4190c8[_0x7a00('0x3e')]=qs[_0x7a00('0x35')](_[_0x7a00('0x3f')](_0x15d6cf['query'],_0x488f0e[_0x7a00('0x35')]));if(_0x15d6cf[_0x7a00('0x37')]['filter']){_0x4190c8[_0x7a00('0x3e')]=_[_0x7a00('0x40')](_0x4190c8[_0x7a00('0x3e')],{'$or':_[_0x7a00('0x41')](_0x3002ed,function(_0x51d08a){if(_0x51d08a['type'][_0x7a00('0x42')]!=='VIRTUAL'){var _0x3fc71c={};_0x3fc71c[_0x51d08a['field']]={'$like':'%'+_0x15d6cf['query'][_0x7a00('0x43')]+'%'};return _0x3fc71c;}})});}_0x4190c8=_[_0x7a00('0x40')]({},_0x4190c8,_0x15d6cf[_0x7a00('0x44')]);var _0x39bda8={'where':_0x4190c8[_0x7a00('0x3e')]};return db[_0x7a00('0x32')]['count'](_0x39bda8)[_0x7a00('0x19')](function(_0x2beb34){_0x12c44b[_0x7a00('0x26')]=_0x2beb34;if(_0x15d6cf['query'][_0x7a00('0x45')]){_0x4190c8[_0x7a00('0x46')]=[{'all':!![]}];}return db[_0x7a00('0x32')][_0x7a00('0x47')](_0x4190c8);})[_0x7a00('0x19')](function(_0x3948d6){_0x12c44b[_0x7a00('0x48')]=_0x3948d6;return _0x12c44b;})['then'](respondWithFilteredResult(_0x1189c7,_0x4190c8))[_0x7a00('0x22')](handleError(_0x1189c7,null));};exports[_0x7a00('0x49')]=function(_0x3904db,_0x2e2c47){var _0x221517={'raw':![],'where':{'id':_0x3904db[_0x7a00('0x4a')]['id']}},_0x4acf8d={};_0x4acf8d[_0x7a00('0x33')]=_[_0x7a00('0x34')](db['SugarcrmConfiguration'][_0x7a00('0x4b')]);_0x4acf8d[_0x7a00('0x37')]=_['keys'](_0x3904db[_0x7a00('0x37')]);_0x4acf8d[_0x7a00('0x35')]=_[_0x7a00('0x36')](_0x4acf8d[_0x7a00('0x33')],_0x4acf8d[_0x7a00('0x37')]);_0x221517['attributes']=_[_0x7a00('0x36')](_0x4acf8d[_0x7a00('0x33')],qs[_0x7a00('0x39')](_0x3904db[_0x7a00('0x37')][_0x7a00('0x39')]));_0x221517[_0x7a00('0x38')]=_0x221517[_0x7a00('0x38')][_0x7a00('0x3a')]?_0x221517[_0x7a00('0x38')]:_0x4acf8d[_0x7a00('0x33')];if(_0x3904db['query'][_0x7a00('0x45')]){_0x221517['include']=[{'all':!![]}];}_0x221517=_[_0x7a00('0x40')]({},_0x221517,_0x3904db[_0x7a00('0x44')]);return db[_0x7a00('0x32')][_0x7a00('0x4c')](_0x221517)['then'](handleEntityNotFound(_0x2e2c47,null))[_0x7a00('0x19')](respondWithResult(_0x2e2c47,null))[_0x7a00('0x22')](handleError(_0x2e2c47,null));};exports[_0x7a00('0x4d')]=function(_0x3297a0,_0x1fd1b0){return db[_0x7a00('0x32')][_0x7a00('0x4d')](_0x3297a0[_0x7a00('0x4e')],{})['then'](respondWithResult(_0x1fd1b0,0xc9))[_0x7a00('0x22')](handleError(_0x1fd1b0,null));};exports[_0x7a00('0x2c')]=function(_0x5977e7,_0x13439a){if(_0x5977e7['body']['id']){delete _0x5977e7['body']['id'];}return db['SugarcrmConfiguration'][_0x7a00('0x4c')]({'where':{'id':_0x5977e7[_0x7a00('0x4a')]['id']}})[_0x7a00('0x19')](handleEntityNotFound(_0x13439a,null))[_0x7a00('0x19')](saveUpdates(_0x5977e7[_0x7a00('0x4e')],null))[_0x7a00('0x19')](respondWithResult(_0x13439a,null))[_0x7a00('0x22')](handleError(_0x13439a,null));};exports[_0x7a00('0x4f')]=function(_0x393661,_0x269b92){return db[_0x7a00('0x32')][_0x7a00('0x4c')]({'where':{'id':_0x393661['params']['id']}})['then'](handleEntityNotFound(_0x269b92,null))['then'](removeEntity(_0x269b92,null))[_0x7a00('0x22')](handleError(_0x269b92,null));};exports[_0x7a00('0x50')]=function(_0x3302ae,_0x3f87b6,_0x528411){var _0x44b43b={};var _0x4e7953={};var _0x586ffc;var _0x8f5f35;return db[_0x7a00('0x32')][_0x7a00('0x51')]({'where':{'id':_0x3302ae['params']['id']}})[_0x7a00('0x19')](handleEntityNotFound(_0x3f87b6,null))[_0x7a00('0x19')](function(_0x578228){if(_0x578228){_0x586ffc=_0x578228;_0x4e7953[_0x7a00('0x33')]=_[_0x7a00('0x34')](db[_0x7a00('0x52')][_0x7a00('0x4b')]);_0x4e7953[_0x7a00('0x37')]=_[_0x7a00('0x34')](_0x3302ae['query']);_0x4e7953[_0x7a00('0x35')]=_[_0x7a00('0x36')](_0x4e7953[_0x7a00('0x33')],_0x4e7953[_0x7a00('0x37')]);_0x44b43b['attributes']=_[_0x7a00('0x36')](_0x4e7953['model'],qs['fields'](_0x3302ae[_0x7a00('0x37')][_0x7a00('0x39')]));_0x44b43b['attributes']=_0x44b43b[_0x7a00('0x38')][_0x7a00('0x3a')]?_0x44b43b[_0x7a00('0x38')]:_0x4e7953[_0x7a00('0x33')];_0x44b43b[_0x7a00('0x3c')]=qs[_0x7a00('0x3d')](_0x3302ae[_0x7a00('0x37')][_0x7a00('0x3d')]);_0x44b43b[_0x7a00('0x3e')]=qs[_0x7a00('0x35')](_[_0x7a00('0x3f')](_0x3302ae[_0x7a00('0x37')],_0x4e7953[_0x7a00('0x35')]));if(_0x3302ae[_0x7a00('0x37')][_0x7a00('0x43')]){_0x44b43b['where']=_[_0x7a00('0x40')](_0x44b43b[_0x7a00('0x3e')],{'$or':_[_0x7a00('0x41')](_0x44b43b['attributes'],function(_0x1ec793){var _0x387f7c={};_0x387f7c[_0x1ec793]={'$like':'%'+_0x3302ae[_0x7a00('0x37')]['filter']+'%'};return _0x387f7c;})});}_0x44b43b=_[_0x7a00('0x40')]({},_0x44b43b,_0x3302ae[_0x7a00('0x44')]);return _0x586ffc[_0x7a00('0x50')](_0x44b43b);}})[_0x7a00('0x19')](function(_0x58b055){if(_0x58b055){_0x8f5f35=_0x58b055['length'];if(!_0x3302ae[_0x7a00('0x37')][_0x7a00('0x3b')](_0x7a00('0x53'))){_0x44b43b['limit']=qs[_0x7a00('0x28')](_0x3302ae['query'][_0x7a00('0x28')]);_0x44b43b[_0x7a00('0x27')]=qs[_0x7a00('0x27')](_0x3302ae[_0x7a00('0x37')][_0x7a00('0x27')]);}return _0x586ffc[_0x7a00('0x50')](_0x44b43b);}})[_0x7a00('0x19')](function(_0x33a707){if(_0x33a707){return _0x33a707?{'count':_0x8f5f35,'rows':_0x33a707}:null;}})['then'](respondWithResult(_0x3f87b6,null))[_0x7a00('0x22')](handleError(_0x3f87b6,null));};exports[_0x7a00('0x54')]=function(_0x139422,_0x30d227,_0x451b58){var _0xf81e10={};var _0x1992de={};var _0x4ed617;var _0x7e4f68;return db[_0x7a00('0x32')][_0x7a00('0x51')]({'where':{'id':_0x139422[_0x7a00('0x4a')]['id']}})[_0x7a00('0x19')](handleEntityNotFound(_0x30d227,null))[_0x7a00('0x19')](function(_0x1459b7){if(_0x1459b7){_0x4ed617=_0x1459b7;_0x1992de['model']=_[_0x7a00('0x34')](db['SugarcrmField'][_0x7a00('0x4b')]);_0x1992de[_0x7a00('0x37')]=_[_0x7a00('0x34')](_0x139422[_0x7a00('0x37')]);_0x1992de['filters']=_[_0x7a00('0x36')](_0x1992de[_0x7a00('0x33')],_0x1992de[_0x7a00('0x37')]);_0xf81e10[_0x7a00('0x38')]=_[_0x7a00('0x36')](_0x1992de[_0x7a00('0x33')],qs[_0x7a00('0x39')](_0x139422['query']['fields']));_0xf81e10[_0x7a00('0x38')]=_0xf81e10[_0x7a00('0x38')][_0x7a00('0x3a')]?_0xf81e10[_0x7a00('0x38')]:_0x1992de[_0x7a00('0x33')];_0xf81e10[_0x7a00('0x3c')]=qs['sort'](_0x139422[_0x7a00('0x37')][_0x7a00('0x3d')]);_0xf81e10['where']=qs[_0x7a00('0x35')](_[_0x7a00('0x3f')](_0x139422[_0x7a00('0x37')],_0x1992de[_0x7a00('0x35')]));if(_0x139422['query'][_0x7a00('0x43')]){_0xf81e10[_0x7a00('0x3e')]=_[_0x7a00('0x40')](_0xf81e10[_0x7a00('0x3e')],{'$or':_[_0x7a00('0x41')](_0xf81e10['attributes'],function(_0x2ddb50){var _0x302f02={};_0x302f02[_0x2ddb50]={'$like':'%'+_0x139422['query'][_0x7a00('0x43')]+'%'};return _0x302f02;})});}_0xf81e10=_[_0x7a00('0x40')]({},_0xf81e10,_0x139422[_0x7a00('0x44')]);return _0x4ed617[_0x7a00('0x54')](_0xf81e10);}})[_0x7a00('0x19')](function(_0x7acd7d){if(_0x7acd7d){_0x7e4f68=_0x7acd7d[_0x7a00('0x3a')];if(!_0x139422[_0x7a00('0x37')]['hasOwnProperty']('nolimit')){_0xf81e10[_0x7a00('0x28')]=qs[_0x7a00('0x28')](_0x139422[_0x7a00('0x37')][_0x7a00('0x28')]);_0xf81e10['offset']=qs[_0x7a00('0x27')](_0x139422['query']['offset']);}return _0x4ed617[_0x7a00('0x54')](_0xf81e10);}})[_0x7a00('0x19')](function(_0x74083f){if(_0x74083f){return _0x74083f?{'count':_0x7e4f68,'rows':_0x74083f}:null;}})[_0x7a00('0x19')](respondWithResult(_0x30d227,null))[_0x7a00('0x22')](handleError(_0x30d227,null));};exports[_0x7a00('0x55')]=function(_0xbbcffc,_0x3651ce,_0x2d3494){var _0xda5f8b={};var _0x4dd7c0={};var _0x441dbd;var _0x3e4a9e;return db['SugarcrmConfiguration'][_0x7a00('0x51')]({'where':{'id':_0xbbcffc['params']['id']}})[_0x7a00('0x19')](handleEntityNotFound(_0x3651ce,null))[_0x7a00('0x19')](function(_0x56cf63){if(_0x56cf63){_0x441dbd=_0x56cf63;_0x4dd7c0['model']=_[_0x7a00('0x34')](db[_0x7a00('0x52')][_0x7a00('0x4b')]);_0x4dd7c0[_0x7a00('0x37')]=_[_0x7a00('0x34')](_0xbbcffc['query']);_0x4dd7c0['filters']=_[_0x7a00('0x36')](_0x4dd7c0[_0x7a00('0x33')],_0x4dd7c0[_0x7a00('0x37')]);_0xda5f8b[_0x7a00('0x38')]=_[_0x7a00('0x36')](_0x4dd7c0['model'],qs[_0x7a00('0x39')](_0xbbcffc[_0x7a00('0x37')][_0x7a00('0x39')]));_0xda5f8b[_0x7a00('0x38')]=_0xda5f8b['attributes'][_0x7a00('0x3a')]?_0xda5f8b['attributes']:_0x4dd7c0[_0x7a00('0x33')];_0xda5f8b[_0x7a00('0x3c')]=qs[_0x7a00('0x3d')](_0xbbcffc['query']['sort']);_0xda5f8b[_0x7a00('0x3e')]=qs[_0x7a00('0x35')](_['pick'](_0xbbcffc[_0x7a00('0x37')],_0x4dd7c0['filters']));if(_0xbbcffc[_0x7a00('0x37')][_0x7a00('0x43')]){_0xda5f8b[_0x7a00('0x3e')]=_[_0x7a00('0x40')](_0xda5f8b[_0x7a00('0x3e')],{'$or':_[_0x7a00('0x41')](_0xda5f8b[_0x7a00('0x38')],function(_0x100052){var _0x18664c={};_0x18664c[_0x100052]={'$like':'%'+_0xbbcffc['query'][_0x7a00('0x43')]+'%'};return _0x18664c;})});}_0xda5f8b=_['merge']({},_0xda5f8b,_0xbbcffc[_0x7a00('0x44')]);return _0x441dbd[_0x7a00('0x55')](_0xda5f8b);}})['then'](function(_0x44783a){if(_0x44783a){_0x3e4a9e=_0x44783a[_0x7a00('0x3a')];if(!_0xbbcffc[_0x7a00('0x37')][_0x7a00('0x3b')](_0x7a00('0x53'))){_0xda5f8b['limit']=qs[_0x7a00('0x28')](_0xbbcffc[_0x7a00('0x37')][_0x7a00('0x28')]);_0xda5f8b['offset']=qs[_0x7a00('0x27')](_0xbbcffc['query'][_0x7a00('0x27')]);}return _0x441dbd[_0x7a00('0x55')](_0xda5f8b);}})[_0x7a00('0x19')](function(_0x321d3c){if(_0x321d3c){return _0x321d3c?{'count':_0x3e4a9e,'rows':_0x321d3c}:null;}})[_0x7a00('0x19')](respondWithResult(_0x3651ce,null))[_0x7a00('0x22')](handleError(_0x3651ce,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index bf5cd20..5a89c70 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 _0xb612=['./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x49aaa4,_0x541b3f){var _0x314c91=function(_0x3a35a8){while(--_0x3a35a8){_0x49aaa4['push'](_0x49aaa4['shift']());}};_0x314c91(++_0x541b3f);}(_0xb612,0x143));var _0x2b61=function(_0x1b72bf,_0x55bcfe){_0x1b72bf=_0x1b72bf-0x0;var _0x212f0e=_0xb612[_0x1b72bf];return _0x212f0e;};'use strict';var _=require(_0x2b61('0x0'));var util=require('util');var logger=require(_0x2b61('0x1'))(_0x2b61('0x2'));var moment=require(_0x2b61('0x3'));var BPromise=require(_0x2b61('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b61('0x5'));var rimraf=require(_0x2b61('0x6'));var config=require('../../config/environment');var attributes=require(_0x2b61('0x7'));module[_0x2b61('0x8')]=function(_0x446806,_0x3d7e10){return _0x446806[_0x2b61('0x9')](_0x2b61('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc86d=['bluebird','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','moment'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0xc86d,0x10f));var _0xdc86=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xc86d[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xdc86('0x0'));var util=require('util');var logger=require(_0xdc86('0x1'))(_0xdc86('0x2'));var moment=require(_0xdc86('0x3'));var BPromise=require(_0xdc86('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc86('0x5'));var attributes=require(_0xdc86('0x6'));module[_0xdc86('0x7')]=function(_0x50316a,_0x3b5e77){return _0x50316a[_0xdc86('0x8')](_0xdc86('0x9'),attributes,{'tableName':_0xdc86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 1d7546d..6f7c379 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 _0xc780=['../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x183a3c,_0x4c515a){var _0x2aaa5d=function(_0x48959d){while(--_0x48959d){_0x183a3c['push'](_0x183a3c['shift']());}};_0x2aaa5d(++_0x4c515a);}(_0xc780,0x152));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c78('0x0'));var util=require(_0x0c78('0x1'));var moment=require(_0x0c78('0x2'));var BPromise=require(_0x0c78('0x3'));var rs=require(_0x0c78('0x4'));var fs=require('fs');var Redis=require(_0x0c78('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c78('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c78('0x7'));var jayson=require(_0x0c78('0x8'));var client=jayson[_0x0c78('0x9')][_0x0c78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eb936,_0x3d9e2d,_0x69e92a){return new BPromise(function(_0x111402,_0xbc812a){return client[_0x0c78('0xb')](_0x2eb936,_0x69e92a)[_0x0c78('0xc')](function(_0x247308){logger[_0x0c78('0xd')](_0x0c78('0xe'),_0x3d9e2d,_0x0c78('0xf'));logger['debug'](_0x0c78('0x10'),_0x3d9e2d,'request\x20sent',JSON[_0x0c78('0x11')](_0x247308));if(_0x247308[_0x0c78('0x12')]){if(_0x247308[_0x0c78('0x12')][_0x0c78('0x13')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3d9e2d,_0x247308[_0x0c78('0x12')][_0x0c78('0x14')]);return _0xbc812a(_0x247308[_0x0c78('0x12')][_0x0c78('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3d9e2d,_0x247308[_0x0c78('0x12')]['message']);return _0x111402(_0x247308['error'][_0x0c78('0x14')]);}else{logger[_0x0c78('0xd')](_0x0c78('0xe'),_0x3d9e2d,'request\x20sent');_0x111402(_0x247308[_0x0c78('0x15')][_0x0c78('0x14')]);}})[_0x0c78('0x16')](function(_0xa2b2ab){logger['error'](_0x0c78('0xe'),_0x3d9e2d,_0xa2b2ab);_0xbc812a(_0xa2b2ab);});});} \ No newline at end of file +var _0x7984=['request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0x7984,0x1d4));var _0x4798=function(_0x8e2097,_0x1ed2d1){_0x8e2097=_0x8e2097-0x0;var _0x45b706=_0x7984[_0x8e2097];return _0x45b706;};'use strict';var _=require(_0x4798('0x0'));var util=require(_0x4798('0x1'));var moment=require(_0x4798('0x2'));var BPromise=require(_0x4798('0x3'));var rs=require(_0x4798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4798('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4798('0x6'))(_0x4798('0x7'));var config=require(_0x4798('0x8'));var jayson=require(_0x4798('0x9'));var client=jayson[_0x4798('0xa')][_0x4798('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eb154,_0x3dcd6b,_0x1a6307){return new BPromise(function(_0x36d539,_0x28e796){return client[_0x4798('0xc')](_0x2eb154,_0x1a6307)[_0x4798('0xd')](function(_0x54eace){logger[_0x4798('0xe')](_0x4798('0xf'),_0x3dcd6b,_0x4798('0x10'));logger['debug'](_0x4798('0x11'),_0x3dcd6b,'request\x20sent',JSON['stringify'](_0x54eace));if(_0x54eace[_0x4798('0x12')]){if(_0x54eace[_0x4798('0x12')][_0x4798('0x13')]===0x1f4){logger[_0x4798('0x12')](_0x4798('0xf'),_0x3dcd6b,_0x54eace[_0x4798('0x12')][_0x4798('0x14')]);return _0x28e796(_0x54eace[_0x4798('0x12')][_0x4798('0x14')]);}logger[_0x4798('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3dcd6b,_0x54eace[_0x4798('0x12')]['message']);return _0x36d539(_0x54eace[_0x4798('0x12')][_0x4798('0x14')]);}else{logger[_0x4798('0xe')](_0x4798('0xf'),_0x3dcd6b,'request\x20sent');_0x36d539(_0x54eace[_0x4798('0x15')][_0x4798('0x14')]);}})['catch'](function(_0x333b89){logger[_0x4798('0x12')](_0x4798('0xf'),_0x3dcd6b,_0x333b89);_0x28e796(_0x333b89);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 81660b6..1b80fcf 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 _0x82f2=['index','/:id','show','post','put','update','delete','util','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0x82f2,0x1e3));var _0x282f=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x82f2[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x282f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x282f('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x282f('0x2'));var config=require(_0x282f('0x3'));var controller=require(_0x282f('0x4'));router[_0x282f('0x5')]('/',auth[_0x282f('0x6')](),controller[_0x282f('0x7')]);router[_0x282f('0x5')](_0x282f('0x8'),auth['isAuthenticated'](),controller[_0x282f('0x9')]);router[_0x282f('0xa')]('/',auth[_0x282f('0x6')](),controller['create']);router[_0x282f('0xb')](_0x282f('0x8'),auth[_0x282f('0x6')](),controller[_0x282f('0xc')]);router[_0x282f('0xd')]('/:id',auth[_0x282f('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xab38=['./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xab38,0xe3));var _0x8ab3=function(_0x29fcf3,_0x3d2959){_0x29fcf3=_0x29fcf3-0x0;var _0x496075=_0xab38[_0x29fcf3];return _0x496075;};'use strict';var multer=require(_0x8ab3('0x0'));var util=require(_0x8ab3('0x1'));var path=require(_0x8ab3('0x2'));var timeout=require(_0x8ab3('0x3'));var express=require(_0x8ab3('0x4'));var router=express['Router']();var auth=require(_0x8ab3('0x5'));var interaction=require(_0x8ab3('0x6'));var config=require('../../config/environment');var controller=require(_0x8ab3('0x7'));router[_0x8ab3('0x8')]('/',auth[_0x8ab3('0x9')](),controller[_0x8ab3('0xa')]);router[_0x8ab3('0x8')](_0x8ab3('0xb'),auth[_0x8ab3('0x9')](),controller[_0x8ab3('0xc')]);router[_0x8ab3('0xd')]('/',auth['isAuthenticated'](),controller[_0x8ab3('0xe')]);router['put'](_0x8ab3('0xb'),auth[_0x8ab3('0x9')](),controller['update']);router[_0x8ab3('0xf')]('/:id',auth[_0x8ab3('0x9')](),controller[_0x8ab3('0x10')]);module[_0x8ab3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8a86384..0e7325e 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 _0xe706=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x2f75cb,_0x4fc45a){var _0x3b06e9=function(_0x44e677){while(--_0x44e677){_0x2f75cb['push'](_0x2f75cb['shift']());}};_0x3b06e9(++_0x4fc45a);}(_0xe706,0xa3));var _0x6e70=function(_0x2089b3,_0x31fbde){_0x2089b3=_0x2089b3-0x0;var _0x181087=_0xe706[_0x2089b3];return _0x181087;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'type':{'type':Sequelize[_0x6e70('0x2')]('string',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')),'defaultValue':_0x6e70('0x6')},'content':{'type':Sequelize[_0x6e70('0x7')]},'key':{'type':Sequelize[_0x6e70('0x7')]},'keyType':{'type':Sequelize[_0x6e70('0x2')](_0x6e70('0x6'),_0x6e70('0x3'),_0x6e70('0x4'))},'keyContent':{'type':Sequelize[_0x6e70('0x7')]},'idField':{'type':Sequelize[_0x6e70('0x7')]},'nameField':{'type':Sequelize[_0x6e70('0x7')]},'customField':{'type':Sequelize[_0x6e70('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e70('0x7')]}}; \ No newline at end of file +var _0xf4eb=['string','variable','sequelize','customVariable','STRING','ENUM'];(function(_0x51b42e,_0x8dea09){var _0x43ed23=function(_0x2de749){while(--_0x2de749){_0x51b42e['push'](_0x51b42e['shift']());}};_0x43ed23(++_0x8dea09);}(_0xf4eb,0xec));var _0xbf4e=function(_0x494cba,_0x2a90a1){_0x494cba=_0x494cba-0x0;var _0x3e0c84=_0xf4eb[_0x494cba];return _0x3e0c84;};'use strict';var Sequelize=require(_0xbf4e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0xbf4e('0x1'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xbf4e('0x2')]},'key':{'type':Sequelize[_0xbf4e('0x2')]},'keyType':{'type':Sequelize[_0xbf4e('0x3')](_0xbf4e('0x4'),_0xbf4e('0x5'),_0xbf4e('0x1'))},'keyContent':{'type':Sequelize[_0xbf4e('0x2')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbf4e('0x2')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 8ccce97..6d5f276 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 _0x3a3d=['options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','then','destroy','end','error','stack','name','send','SugarcrmField','rawAttributes','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','field'];(function(_0x420390,_0x218bd5){var _0x55fc21=function(_0x137017){while(--_0x137017){_0x420390['push'](_0x420390['shift']());}};_0x55fc21(++_0x218bd5);}(_0x3a3d,0xe7));var _0xd3a3=function(_0x347899,_0x4e03f){_0x347899=_0x347899-0x0;var _0x3a26ee=_0x3a3d[_0x347899];return _0x3a26ee;};'use strict';var pdf=require(_0xd3a3('0x0'));var emlformat=require(_0xd3a3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd3a3('0x2'));var jsonpatch=require(_0xd3a3('0x3'));var rp=require(_0xd3a3('0x4'));var moment=require(_0xd3a3('0x5'));var BPromise=require(_0xd3a3('0x6'));var Mustache=require(_0xd3a3('0x7'));var util=require(_0xd3a3('0x8'));var path=require('path');var sox=require(_0xd3a3('0x9'));var csv=require(_0xd3a3('0xa'));var ejs=require(_0xd3a3('0xb'));var fs=require('fs');var _=require(_0xd3a3('0xc'));var squel=require(_0xd3a3('0xd'));var crypto=require(_0xd3a3('0xe'));var jsforce=require(_0xd3a3('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd3a3('0x10'));var Papa=require(_0xd3a3('0x11'));var Redis=require(_0xd3a3('0x12'));var authService=require(_0xd3a3('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd3a3('0x14'));var logger=require(_0xd3a3('0x15'))(_0xd3a3('0x16'));var utils=require(_0xd3a3('0x17'));var config=require(_0xd3a3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347e82,_0xeee514){_0xeee514=_0xeee514||0xcc;return function(_0x2c7c98){if(_0x2c7c98){return _0x347e82[_0xd3a3('0x19')](_0xeee514);}return _0x347e82[_0xd3a3('0x1a')](_0xeee514)['end']();};}function respondWithResult(_0x117213,_0x7f6751){_0x7f6751=_0x7f6751||0xc8;return function(_0x1d84f4){if(_0x1d84f4){return _0x117213[_0xd3a3('0x1a')](_0x7f6751)[_0xd3a3('0x1b')](_0x1d84f4);}};}function respondWithFilteredResult(_0x12789b,_0x512538){return function(_0x4b687c){if(_0x4b687c){var _0xdfb99a=_0x4b687c[_0xd3a3('0x1c')],_0xe35097=_0x512538['offset'],_0x5e3119=_0x512538[_0xd3a3('0x1d')]+_0x512538['limit'],_0x3ead2d;if(_0x5e3119>=_0xdfb99a){_0x5e3119=_0xdfb99a;_0x3ead2d=0xc8;}else{_0x3ead2d=0xce;}_0x12789b['status'](_0x3ead2d);return _0x12789b[_0xd3a3('0x1e')](_0xd3a3('0x1f'),_0xe35097+'-'+_0x5e3119+'/'+_0xdfb99a)[_0xd3a3('0x1b')](_0x4b687c);}return null;};}function patchUpdates(_0x575686){return function(_0x18109c){try{jsonpatch[_0xd3a3('0x20')](_0x18109c,_0x575686,!![]);}catch(_0x152c80){return BPromise['reject'](_0x152c80);}return _0x18109c['save']();};}function saveUpdates(_0x16e365,_0x4700f1){return function(_0x3ff041){if(_0x3ff041){return _0x3ff041['update'](_0x16e365)[_0xd3a3('0x21')](function(_0x2c81d3){return _0x2c81d3;});}return null;};}function removeEntity(_0x30a08f,_0x42a80b){return function(_0x4d6365){if(_0x4d6365){return _0x4d6365[_0xd3a3('0x22')]()['then'](function(){_0x30a08f[_0xd3a3('0x1a')](0xcc)[_0xd3a3('0x23')]();});}};}function handleEntityNotFound(_0x431691,_0x12f76b){return function(_0x1862fc){if(!_0x1862fc){_0x431691[_0xd3a3('0x19')](0x194);}return _0x1862fc;};}function handleError(_0x18e610,_0x39d406){_0x39d406=_0x39d406||0x1f4;return function(_0x1e4444){logger[_0xd3a3('0x24')](_0x1e4444[_0xd3a3('0x25')]);if(_0x1e4444['name']){delete _0x1e4444[_0xd3a3('0x26')];}_0x18e610['status'](_0x39d406)[_0xd3a3('0x27')](_0x1e4444);};}exports['index']=function(_0x10d7a5,_0x36aa5a){var _0x18a889={},_0x41b609={},_0x72100d={'count':0x0,'rows':[]};var _0x588d1b=db[_0xd3a3('0x28')][_0xd3a3('0x29')];_0x41b609[_0xd3a3('0x2a')]=_['keys'](_0x588d1b);_0x41b609[_0xd3a3('0x2b')]=_[_0xd3a3('0x2c')](_0x10d7a5['query']);_0x41b609[_0xd3a3('0x2d')]=_['intersection'](_0x41b609[_0xd3a3('0x2a')],_0x41b609[_0xd3a3('0x2b')]);_0x18a889[_0xd3a3('0x2e')]=_[_0xd3a3('0x2f')](_0x41b609[_0xd3a3('0x2a')],qs['fields'](_0x10d7a5[_0xd3a3('0x2b')]['fields']));_0x18a889[_0xd3a3('0x2e')]=_0x18a889[_0xd3a3('0x2e')][_0xd3a3('0x30')]?_0x18a889[_0xd3a3('0x2e')]:_0x41b609[_0xd3a3('0x2a')];if(!_0x10d7a5[_0xd3a3('0x2b')][_0xd3a3('0x31')](_0xd3a3('0x32'))){_0x18a889['limit']=qs['limit'](_0x10d7a5[_0xd3a3('0x2b')][_0xd3a3('0x33')]);_0x18a889[_0xd3a3('0x1d')]=qs[_0xd3a3('0x1d')](_0x10d7a5[_0xd3a3('0x2b')][_0xd3a3('0x1d')]);}_0x18a889[_0xd3a3('0x34')]=qs[_0xd3a3('0x35')](_0x10d7a5['query'][_0xd3a3('0x35')]);_0x18a889[_0xd3a3('0x36')]=qs['filters'](_[_0xd3a3('0x37')](_0x10d7a5[_0xd3a3('0x2b')],_0x41b609[_0xd3a3('0x2d')]));if(_0x10d7a5[_0xd3a3('0x2b')][_0xd3a3('0x38')]){_0x18a889[_0xd3a3('0x36')]=_[_0xd3a3('0x39')](_0x18a889[_0xd3a3('0x36')],{'$or':_['map'](_0x588d1b,function(_0x13aee2){if(_0x13aee2[_0xd3a3('0x3a')]['key']!==_0xd3a3('0x3b')){var _0xcffdce={};_0xcffdce[_0x13aee2[_0xd3a3('0x3c')]]={'$like':'%'+_0x10d7a5[_0xd3a3('0x2b')][_0xd3a3('0x38')]+'%'};return _0xcffdce;}})});}_0x18a889=_[_0xd3a3('0x39')]({},_0x18a889,_0x10d7a5[_0xd3a3('0x3d')]);var _0x3b63ef={'where':_0x18a889[_0xd3a3('0x36')]};return db[_0xd3a3('0x28')][_0xd3a3('0x1c')](_0x3b63ef)[_0xd3a3('0x21')](function(_0x301cc5){_0x72100d[_0xd3a3('0x1c')]=_0x301cc5;if(_0x10d7a5[_0xd3a3('0x2b')][_0xd3a3('0x3e')]){_0x18a889[_0xd3a3('0x3f')]=[{'all':!![]}];}return db['SugarcrmField'][_0xd3a3('0x40')](_0x18a889);})['then'](function(_0x11461d){_0x72100d[_0xd3a3('0x41')]=_0x11461d;return _0x72100d;})[_0xd3a3('0x21')](respondWithFilteredResult(_0x36aa5a,_0x18a889))[_0xd3a3('0x42')](handleError(_0x36aa5a,null));};exports[_0xd3a3('0x43')]=function(_0x453a56,_0x344573){var _0x243790={'raw':!![],'where':{'id':_0x453a56[_0xd3a3('0x44')]['id']}},_0x115ff0={};_0x115ff0[_0xd3a3('0x2a')]=_[_0xd3a3('0x2c')](db[_0xd3a3('0x28')][_0xd3a3('0x29')]);_0x115ff0[_0xd3a3('0x2b')]=_[_0xd3a3('0x2c')](_0x453a56[_0xd3a3('0x2b')]);_0x115ff0[_0xd3a3('0x2d')]=_[_0xd3a3('0x2f')](_0x115ff0['model'],_0x115ff0['query']);_0x243790[_0xd3a3('0x2e')]=_[_0xd3a3('0x2f')](_0x115ff0['model'],qs['fields'](_0x453a56[_0xd3a3('0x2b')][_0xd3a3('0x45')]));_0x243790[_0xd3a3('0x2e')]=_0x243790[_0xd3a3('0x2e')][_0xd3a3('0x30')]?_0x243790[_0xd3a3('0x2e')]:_0x115ff0['model'];if(_0x453a56['query'][_0xd3a3('0x3e')]){_0x243790[_0xd3a3('0x3f')]=[{'all':!![]}];}_0x243790=_[_0xd3a3('0x39')]({},_0x243790,_0x453a56[_0xd3a3('0x3d')]);return db[_0xd3a3('0x28')][_0xd3a3('0x46')](_0x243790)[_0xd3a3('0x21')](handleEntityNotFound(_0x344573,null))['then'](respondWithResult(_0x344573,null))[_0xd3a3('0x42')](handleError(_0x344573,null));};exports[_0xd3a3('0x47')]=function(_0x569ac2,_0x1f758f){return db['SugarcrmField']['create'](_0x569ac2[_0xd3a3('0x48')],{})[_0xd3a3('0x21')](respondWithResult(_0x1f758f,0xc9))[_0xd3a3('0x42')](handleError(_0x1f758f,null));};exports['update']=function(_0x534b26,_0x262382){if(_0x534b26['body']['id']){delete _0x534b26[_0xd3a3('0x48')]['id'];}return db[_0xd3a3('0x28')][_0xd3a3('0x46')]({'where':{'id':_0x534b26[_0xd3a3('0x44')]['id']}})[_0xd3a3('0x21')](handleEntityNotFound(_0x262382,null))[_0xd3a3('0x21')](saveUpdates(_0x534b26[_0xd3a3('0x48')],null))[_0xd3a3('0x21')](respondWithResult(_0x262382,null))[_0xd3a3('0x42')](handleError(_0x262382,null));};exports[_0xd3a3('0x22')]=function(_0x199bd7,_0x27266e){return db[_0xd3a3('0x28')][_0xd3a3('0x46')]({'where':{'id':_0x199bd7[_0xd3a3('0x44')]['id']}})[_0xd3a3('0x21')](handleEntityNotFound(_0x27266e,null))[_0xd3a3('0x21')](removeEntity(_0x27266e,null))[_0xd3a3('0x42')](handleError(_0x27266e,null));}; \ No newline at end of file +var _0x2f74=['end','json','offset','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','VIRTUAL','field','count','includeAll','include','catch','show','params','options','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0xa5fbc1,_0x44858d){var _0x5a895c=function(_0x4e8d73){while(--_0x4e8d73){_0xa5fbc1['push'](_0xa5fbc1['shift']());}};_0x5a895c(++_0x44858d);}(_0x2f74,0x1d2));var _0x42f7=function(_0x928a02,_0x2257cd){_0x928a02=_0x928a02-0x0;var _0x30705c=_0x2f74[_0x928a02];return _0x30705c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x42f7('0x0'));var zipdir=require(_0x42f7('0x1'));var jsonpatch=require(_0x42f7('0x2'));var rp=require(_0x42f7('0x3'));var moment=require('moment');var BPromise=require(_0x42f7('0x4'));var Mustache=require(_0x42f7('0x5'));var util=require(_0x42f7('0x6'));var path=require(_0x42f7('0x7'));var sox=require(_0x42f7('0x8'));var csv=require(_0x42f7('0x9'));var ejs=require(_0x42f7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x42f7('0xb'));var crypto=require('crypto');var jsforce=require(_0x42f7('0xc'));var deskjs=require(_0x42f7('0xd'));var toCsv=require(_0x42f7('0x9'));var querystring=require(_0x42f7('0xe'));var Papa=require(_0x42f7('0xf'));var Redis=require(_0x42f7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x42f7('0x11'));var hardwareService=require(_0x42f7('0x12'));var logger=require('../../config/logger')(_0x42f7('0x13'));var utils=require('../../config/utils');var config=require(_0x42f7('0x14'));var db=require(_0x42f7('0x15'))['db'];function respondWithStatusCode(_0x2d6b22,_0x4b5bc2){_0x4b5bc2=_0x4b5bc2||0xcc;return function(_0x43746e){if(_0x43746e){return _0x2d6b22[_0x42f7('0x16')](_0x4b5bc2);}return _0x2d6b22[_0x42f7('0x17')](_0x4b5bc2)[_0x42f7('0x18')]();};}function respondWithResult(_0x2a3535,_0x53bd30){_0x53bd30=_0x53bd30||0xc8;return function(_0x243d9f){if(_0x243d9f){return _0x2a3535[_0x42f7('0x17')](_0x53bd30)[_0x42f7('0x19')](_0x243d9f);}};}function respondWithFilteredResult(_0xc019f0,_0x4f0599){return function(_0x5a5485){if(_0x5a5485){var _0x507d07=_0x5a5485['count'],_0x3f6f2f=_0x4f0599[_0x42f7('0x1a')],_0x3b616c=_0x4f0599[_0x42f7('0x1a')]+_0x4f0599[_0x42f7('0x1b')],_0x3108e0;if(_0x3b616c>=_0x507d07){_0x3b616c=_0x507d07;_0x3108e0=0xc8;}else{_0x3108e0=0xce;}_0xc019f0['status'](_0x3108e0);return _0xc019f0[_0x42f7('0x1c')]('Content-Range',_0x3f6f2f+'-'+_0x3b616c+'/'+_0x507d07)[_0x42f7('0x19')](_0x5a5485);}return null;};}function patchUpdates(_0x21500a){return function(_0x2dad1f){try{jsonpatch[_0x42f7('0x1d')](_0x2dad1f,_0x21500a,!![]);}catch(_0x43a9e4){return BPromise['reject'](_0x43a9e4);}return _0x2dad1f[_0x42f7('0x1e')]();};}function saveUpdates(_0x2a9288,_0x948ad){return function(_0x599cd4){if(_0x599cd4){return _0x599cd4[_0x42f7('0x1f')](_0x2a9288)[_0x42f7('0x20')](function(_0x2158a6){return _0x2158a6;});}return null;};}function removeEntity(_0x193bbe,_0xc8a0b9){return function(_0x2efb5c){if(_0x2efb5c){return _0x2efb5c[_0x42f7('0x21')]()[_0x42f7('0x20')](function(){_0x193bbe[_0x42f7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8b5b1c,_0x3b94e8){return function(_0x20c828){if(!_0x20c828){_0x8b5b1c[_0x42f7('0x16')](0x194);}return _0x20c828;};}function handleError(_0x2497d7,_0x1fceb3){_0x1fceb3=_0x1fceb3||0x1f4;return function(_0x241da0){logger[_0x42f7('0x22')](_0x241da0[_0x42f7('0x23')]);if(_0x241da0[_0x42f7('0x24')]){delete _0x241da0[_0x42f7('0x24')];}_0x2497d7['status'](_0x1fceb3)[_0x42f7('0x25')](_0x241da0);};}exports[_0x42f7('0x26')]=function(_0x4500fc,_0x9769af){var _0x11c9e2={},_0x1534c4={},_0x4b35eb={'count':0x0,'rows':[]};var _0x579430=db[_0x42f7('0x27')][_0x42f7('0x28')];_0x1534c4[_0x42f7('0x29')]=_['keys'](_0x579430);_0x1534c4[_0x42f7('0x2a')]=_[_0x42f7('0x2b')](_0x4500fc[_0x42f7('0x2a')]);_0x1534c4[_0x42f7('0x2c')]=_['intersection'](_0x1534c4[_0x42f7('0x29')],_0x1534c4[_0x42f7('0x2a')]);_0x11c9e2[_0x42f7('0x2d')]=_[_0x42f7('0x2e')](_0x1534c4[_0x42f7('0x29')],qs[_0x42f7('0x2f')](_0x4500fc['query']['fields']));_0x11c9e2[_0x42f7('0x2d')]=_0x11c9e2['attributes'][_0x42f7('0x30')]?_0x11c9e2[_0x42f7('0x2d')]:_0x1534c4['model'];if(!_0x4500fc[_0x42f7('0x2a')][_0x42f7('0x31')](_0x42f7('0x32'))){_0x11c9e2[_0x42f7('0x1b')]=qs[_0x42f7('0x1b')](_0x4500fc['query'][_0x42f7('0x1b')]);_0x11c9e2[_0x42f7('0x1a')]=qs[_0x42f7('0x1a')](_0x4500fc[_0x42f7('0x2a')][_0x42f7('0x1a')]);}_0x11c9e2['order']=qs[_0x42f7('0x33')](_0x4500fc[_0x42f7('0x2a')][_0x42f7('0x33')]);_0x11c9e2['where']=qs[_0x42f7('0x2c')](_[_0x42f7('0x34')](_0x4500fc[_0x42f7('0x2a')],_0x1534c4['filters']));if(_0x4500fc[_0x42f7('0x2a')][_0x42f7('0x35')]){_0x11c9e2[_0x42f7('0x36')]=_[_0x42f7('0x37')](_0x11c9e2[_0x42f7('0x36')],{'$or':_[_0x42f7('0x38')](_0x579430,function(_0x1ddb84){if(_0x1ddb84[_0x42f7('0x39')]['key']!==_0x42f7('0x3a')){var _0x3d2c48={};_0x3d2c48[_0x1ddb84[_0x42f7('0x3b')]]={'$like':'%'+_0x4500fc[_0x42f7('0x2a')][_0x42f7('0x35')]+'%'};return _0x3d2c48;}})});}_0x11c9e2=_[_0x42f7('0x37')]({},_0x11c9e2,_0x4500fc['options']);var _0x4d85ab={'where':_0x11c9e2[_0x42f7('0x36')]};return db[_0x42f7('0x27')][_0x42f7('0x3c')](_0x4d85ab)['then'](function(_0xe69700){_0x4b35eb[_0x42f7('0x3c')]=_0xe69700;if(_0x4500fc[_0x42f7('0x2a')][_0x42f7('0x3d')]){_0x11c9e2[_0x42f7('0x3e')]=[{'all':!![]}];}return db[_0x42f7('0x27')]['findAll'](_0x11c9e2);})[_0x42f7('0x20')](function(_0x2b8e16){_0x4b35eb['rows']=_0x2b8e16;return _0x4b35eb;})[_0x42f7('0x20')](respondWithFilteredResult(_0x9769af,_0x11c9e2))[_0x42f7('0x3f')](handleError(_0x9769af,null));};exports[_0x42f7('0x40')]=function(_0x1b6b49,_0x57aaa0){var _0x544b76={'raw':!![],'where':{'id':_0x1b6b49[_0x42f7('0x41')]['id']}},_0x3022aa={};_0x3022aa[_0x42f7('0x29')]=_[_0x42f7('0x2b')](db[_0x42f7('0x27')]['rawAttributes']);_0x3022aa[_0x42f7('0x2a')]=_[_0x42f7('0x2b')](_0x1b6b49[_0x42f7('0x2a')]);_0x3022aa[_0x42f7('0x2c')]=_[_0x42f7('0x2e')](_0x3022aa[_0x42f7('0x29')],_0x3022aa[_0x42f7('0x2a')]);_0x544b76[_0x42f7('0x2d')]=_[_0x42f7('0x2e')](_0x3022aa['model'],qs['fields'](_0x1b6b49[_0x42f7('0x2a')][_0x42f7('0x2f')]));_0x544b76[_0x42f7('0x2d')]=_0x544b76[_0x42f7('0x2d')][_0x42f7('0x30')]?_0x544b76[_0x42f7('0x2d')]:_0x3022aa[_0x42f7('0x29')];if(_0x1b6b49['query']['includeAll']){_0x544b76[_0x42f7('0x3e')]=[{'all':!![]}];}_0x544b76=_['merge']({},_0x544b76,_0x1b6b49[_0x42f7('0x42')]);return db[_0x42f7('0x27')]['find'](_0x544b76)[_0x42f7('0x20')](handleEntityNotFound(_0x57aaa0,null))['then'](respondWithResult(_0x57aaa0,null))[_0x42f7('0x3f')](handleError(_0x57aaa0,null));};exports[_0x42f7('0x43')]=function(_0xd24ece,_0x555e58){return db[_0x42f7('0x27')][_0x42f7('0x43')](_0xd24ece[_0x42f7('0x44')],{})[_0x42f7('0x20')](respondWithResult(_0x555e58,0xc9))['catch'](handleError(_0x555e58,null));};exports[_0x42f7('0x1f')]=function(_0x1119ea,_0x6a4168){if(_0x1119ea['body']['id']){delete _0x1119ea[_0x42f7('0x44')]['id'];}return db[_0x42f7('0x27')][_0x42f7('0x45')]({'where':{'id':_0x1119ea[_0x42f7('0x41')]['id']}})[_0x42f7('0x20')](handleEntityNotFound(_0x6a4168,null))[_0x42f7('0x20')](saveUpdates(_0x1119ea[_0x42f7('0x44')],null))[_0x42f7('0x20')](respondWithResult(_0x6a4168,null))['catch'](handleError(_0x6a4168,null));};exports[_0x42f7('0x21')]=function(_0x587542,_0xe0e99b){return db[_0x42f7('0x27')][_0x42f7('0x45')]({'where':{'id':_0x587542[_0x42f7('0x41')]['id']}})[_0x42f7('0x20')](handleEntityNotFound(_0xe0e99b,null))[_0x42f7('0x20')](removeEntity(_0xe0e99b,null))[_0x42f7('0x3f')](handleError(_0xe0e99b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c2ee933..8848024 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 _0xd09d=['util','../../config/logger','request-promise','path','./intSugarcrmField.attributes','exports','define','SugarcrmField','idField','FieldId','lodash'];(function(_0x1a5442,_0x1d9a27){var _0x2c78a6=function(_0x40e18f){while(--_0x40e18f){_0x1a5442['push'](_0x1a5442['shift']());}};_0x2c78a6(++_0x1d9a27);}(_0xd09d,0x112));var _0xdd09=function(_0x5cff8a,_0x16800c){_0x5cff8a=_0x5cff8a-0x0;var _0x4074bb=_0xd09d[_0x5cff8a];return _0x4074bb;};'use strict';var _=require(_0xdd09('0x0'));var util=require(_0xdd09('0x1'));var logger=require(_0xdd09('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd09('0x3'));var fs=require('fs');var path=require(_0xdd09('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd09('0x5'));module[_0xdd09('0x6')]=function(_0x4f9d8d,_0x4d158c){return _0x4f9d8d[_0xdd09('0x7')](_0xdd09('0x8'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xdd09('0x9'),_0xdd09('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a13=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','idField'];(function(_0x4caa85,_0x25a965){var _0x21b7ab=function(_0x52e6c8){while(--_0x52e6c8){_0x4caa85['push'](_0x4caa85['shift']());}};_0x21b7ab(++_0x25a965);}(_0x6a13,0x1c1));var _0x36a1=function(_0xd43eb7,_0xc1d518){_0xd43eb7=_0xd43eb7-0x0;var _0x4001ae=_0x6a13[_0xd43eb7];return _0x4001ae;};'use strict';var _=require('lodash');var util=require(_0x36a1('0x0'));var logger=require(_0x36a1('0x1'))(_0x36a1('0x2'));var moment=require(_0x36a1('0x3'));var BPromise=require(_0x36a1('0x4'));var rp=require(_0x36a1('0x5'));var fs=require('fs');var path=require(_0x36a1('0x6'));var rimraf=require('rimraf');var config=require(_0x36a1('0x7'));var attributes=require(_0x36a1('0x8'));module['exports']=function(_0x5cfc81,_0x3ced97){return _0x5cfc81[_0x36a1('0x9')](_0x36a1('0xa'),attributes,{'tableName':_0x36a1('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x36a1('0xc'),_0x36a1('0xd')],'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 cb8ff3a..cb594ef 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 _0x3e99=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x525315,_0x99c59c){var _0xef935f=function(_0x9fc37d){while(--_0x9fc37d){_0x525315['push'](_0x525315['shift']());}};_0xef935f(++_0x99c59c);}(_0x3e99,0x122));var _0x93e9=function(_0x36c99d,_0x58f8dd){_0x36c99d=_0x36c99d-0x0;var _0x1b38ca=_0x3e99[_0x36c99d];return _0x1b38ca;};'use strict';var _=require(_0x93e9('0x0'));var util=require(_0x93e9('0x1'));var moment=require(_0x93e9('0x2'));var BPromise=require(_0x93e9('0x3'));var rs=require(_0x93e9('0x4'));var fs=require('fs');var Redis=require(_0x93e9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x93e9('0x6'))(_0x93e9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x93e9('0x8')][_0x93e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe6d00,_0x972ed1,_0x13d1e5){return new BPromise(function(_0x3a6089,_0x18851d){return client['request'](_0xbe6d00,_0x13d1e5)['then'](function(_0x51cf48){logger[_0x93e9('0xa')](_0x93e9('0xb'),_0x972ed1,_0x93e9('0xc'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x972ed1,_0x93e9('0xc'),JSON['stringify'](_0x51cf48));if(_0x51cf48[_0x93e9('0xd')]){if(_0x51cf48[_0x93e9('0xd')][_0x93e9('0xe')]===0x1f4){logger[_0x93e9('0xd')](_0x93e9('0xb'),_0x972ed1,_0x51cf48[_0x93e9('0xd')]['message']);return _0x18851d(_0x51cf48['error'][_0x93e9('0xf')]);}logger[_0x93e9('0xd')](_0x93e9('0xb'),_0x972ed1,_0x51cf48[_0x93e9('0xd')][_0x93e9('0xf')]);return _0x3a6089(_0x51cf48[_0x93e9('0xd')][_0x93e9('0xf')]);}else{logger[_0x93e9('0xa')](_0x93e9('0xb'),_0x972ed1,_0x93e9('0xc'));_0x3a6089(_0x51cf48[_0x93e9('0x10')]['message']);}})[_0x93e9('0x11')](function(_0x4efd89){logger[_0x93e9('0xd')](_0x93e9('0xb'),_0x972ed1,_0x4efd89);_0x18851d(_0x4efd89);});});} \ No newline at end of file +var _0x934d=['../../config/environment','client','http','request','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x934d,0x1c2));var _0xd934=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x934d[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0xd934('0x0'));var util=require(_0xd934('0x1'));var moment=require(_0xd934('0x2'));var BPromise=require(_0xd934('0x3'));var rs=require(_0xd934('0x4'));var fs=require('fs');var Redis=require(_0xd934('0x5'));var db=require(_0xd934('0x6'))['db'];var utils=require(_0xd934('0x7'));var logger=require(_0xd934('0x8'))(_0xd934('0x9'));var config=require(_0xd934('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd934('0xb')][_0xd934('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b2d6d,_0x317f6d,_0x443429){return new BPromise(function(_0x1fd9e2,_0x59f2f8){return client[_0xd934('0xd')](_0x5b2d6d,_0x443429)['then'](function(_0x51bc31){logger[_0xd934('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x317f6d,_0xd934('0xf'));logger[_0xd934('0x10')](_0xd934('0x11'),_0x317f6d,_0xd934('0xf'),JSON['stringify'](_0x51bc31));if(_0x51bc31['error']){if(_0x51bc31[_0xd934('0x12')][_0xd934('0x13')]===0x1f4){logger['error'](_0xd934('0x14'),_0x317f6d,_0x51bc31[_0xd934('0x12')][_0xd934('0x15')]);return _0x59f2f8(_0x51bc31[_0xd934('0x12')][_0xd934('0x15')]);}logger[_0xd934('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x317f6d,_0x51bc31[_0xd934('0x12')][_0xd934('0x15')]);return _0x1fd9e2(_0x51bc31[_0xd934('0x12')][_0xd934('0x15')]);}else{logger[_0xd934('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x317f6d,_0xd934('0xf'));_0x1fd9e2(_0x51bc31[_0xd934('0x16')]['message']);}})['catch'](function(_0x3c02f9){logger[_0xd934('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x317f6d,_0x3c02f9);_0x59f2f8(_0x3c02f9);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 210f3a9..9546b2a 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 _0xa645=['Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0xf099af,_0x1daf12){var _0xce57ec=function(_0x3539a3){while(--_0x3539a3){_0xf099af['push'](_0xf099af['shift']());}};_0xce57ec(++_0x1daf12);}(_0xa645,0x1ca));var _0x5a64=function(_0x456077,_0x1b236a){_0x456077=_0x456077-0x0;var _0x10263c=_0xa645[_0x456077];return _0x10263c;};'use strict';var multer=require(_0x5a64('0x0'));var util=require(_0x5a64('0x1'));var path=require(_0x5a64('0x2'));var timeout=require(_0x5a64('0x3'));var express=require('express');var router=express[_0x5a64('0x4')]();var auth=require(_0x5a64('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5a64('0x6'));var controller=require(_0x5a64('0x7'));router['get']('/',auth[_0x5a64('0x8')](),controller[_0x5a64('0x9')]);router[_0x5a64('0xa')]('/:id',auth[_0x5a64('0x8')](),controller['show']);router['get']('/:id/configurations',auth[_0x5a64('0x8')](),controller['getConfigurations']);router[_0x5a64('0xa')]('/:id/fields',auth[_0x5a64('0x8')](),controller[_0x5a64('0xb')]);router[_0x5a64('0xc')]('/',auth[_0x5a64('0x8')](),controller[_0x5a64('0xd')]);router[_0x5a64('0xc')](_0x5a64('0xe'),auth[_0x5a64('0x8')](),controller[_0x5a64('0xf')]);router[_0x5a64('0x10')](_0x5a64('0x11'),auth[_0x5a64('0x8')](),controller[_0x5a64('0x12')]);router[_0x5a64('0x13')](_0x5a64('0x11'),auth['isAuthenticated'](),controller[_0x5a64('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0d23=['getConfigurations','post','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated'];(function(_0x4d5146,_0x1f2b02){var _0x1700fb=function(_0x20dcae){while(--_0x20dcae){_0x4d5146['push'](_0x4d5146['shift']());}};_0x1700fb(++_0x1f2b02);}(_0x0d23,0xaf));var _0x30d2=function(_0x535673,_0x5d4978){_0x535673=_0x535673-0x0;var _0xf7947c=_0x0d23[_0x535673];return _0xf7947c;};'use strict';var multer=require(_0x30d2('0x0'));var util=require(_0x30d2('0x1'));var path=require(_0x30d2('0x2'));var timeout=require(_0x30d2('0x3'));var express=require(_0x30d2('0x4'));var router=express['Router']();var auth=require(_0x30d2('0x5'));var interaction=require(_0x30d2('0x6'));var config=require(_0x30d2('0x7'));var controller=require(_0x30d2('0x8'));router[_0x30d2('0x9')]('/',auth['isAuthenticated'](),controller[_0x30d2('0xa')]);router[_0x30d2('0x9')](_0x30d2('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x30d2('0x9')](_0x30d2('0xc'),auth[_0x30d2('0xd')](),controller[_0x30d2('0xe')]);router[_0x30d2('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x30d2('0xf')]('/',auth[_0x30d2('0xd')](),controller['create']);router[_0x30d2('0xf')](_0x30d2('0xc'),auth[_0x30d2('0xd')](),controller[_0x30d2('0x10')]);router[_0x30d2('0x11')]('/:id',auth[_0x30d2('0xd')](),controller[_0x30d2('0x12')]);router['delete'](_0x30d2('0xb'),auth['isAuthenticated'](),controller[_0x30d2('0x13')]);module[_0x30d2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f82400d..08329de 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 _0xbc08=['STRING','HelpDesk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc08,0x118));var _0x8bc0=function(_0x62edaf,_0x49d69f){_0x62edaf=_0x62edaf-0x0;var _0x169468=_0xbc08[_0x62edaf];return _0x169468;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8bc0('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8bc0('0x0')]},'username':{'type':Sequelize[_0x8bc0('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8bc0('0x0')],'allowNull':![],'defaultValue':_0x8bc0('0x1')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8bc0('0x0')]},'accessKey':{'type':Sequelize[_0x8bc0('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x5867=['STRING','HelpDesk','exports'];(function(_0x4974e3,_0x33fa5d){var _0x5c9af4=function(_0x254d12){while(--_0x254d12){_0x4974e3['push'](_0x4974e3['shift']());}};_0x5c9af4(++_0x33fa5d);}(_0x5867,0xb9));var _0x7586=function(_0x31e188,_0x77b598){_0x31e188=_0x31e188-0x0;var _0x1bfdc5=_0x5867[_0x31e188];return _0x1bfdc5;};'use strict';var Sequelize=require('sequelize');module[_0x7586('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7586('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x7586('0x1')],'allowNull':![],'defaultValue':_0x7586('0x2')},'remoteUri':{'type':Sequelize[_0x7586('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7586('0x1')]},'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 82ba1f0..7cd4f54 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 _0xe74b=['intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','key','VIRTUAL','options','count','include','findAll','then','show','includeAll','create','body','find','params','destroy','getConfigurations','VtigerConfiguration','filter','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','VtigerField','getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','format','%s/webservice.php','GET','login','token','success','describe','sessionName','autogenerated','reference','owner','includes','remove','false','map','startsWith','cf_','picklistValues','label','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','set','apply','reject','update','stack','name','send','index','VtigerAccount','rawAttributes','model','query','keys','filters'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0xe74b,0x143));var _0xbe74=function(_0x36aa93,_0x2ffc57){_0x36aa93=_0x36aa93-0x0;var _0x4b4a48=_0xe74b[_0x36aa93];return _0x4b4a48;};'use strict';var pdf=require(_0xbe74('0x0'));var emlformat=require(_0xbe74('0x1'));var rimraf=require(_0xbe74('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe74('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbe74('0x4'));var util=require('util');var path=require(_0xbe74('0x5'));var sox=require(_0xbe74('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbe74('0x7'));var squel=require(_0xbe74('0x8'));var crypto=require(_0xbe74('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbe74('0xa'));var toCsv=require(_0xbe74('0xb'));var querystring=require(_0xbe74('0xc'));var Papa=require(_0xbe74('0xd'));var Redis=require(_0xbe74('0xe'));var authService=require(_0xbe74('0xf'));var qs=require(_0xbe74('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbe74('0x11'));var utils=require(_0xbe74('0x12'));var config=require(_0xbe74('0x13'));var db=require(_0xbe74('0x14'))['db'];var integrations=require(_0xbe74('0x15'));var jayson=require(_0xbe74('0x16'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x28f015,_0x4d9e82,_0x13f735){if(_0x13f735){var _0x384fa9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x384fa9[_0xbe74('0x17')](_0x4d9e82)){return _0x28f015;}else{throw new Error(_0xbe74('0x18'));}}else{return _0x28f015;}}function respondWithRpcPromise(_0x4030bd,_0x4c9c1e,_0x2ad151,_0x4796fb){return new BPromise(function(_0x21836a,_0x316da2){var _0x120865=_0x4796fb||client;return _0x120865[_0xbe74('0x19')](_0x4030bd,_0x2ad151)['then'](function(_0x433a56){logger[_0xbe74('0x1a')](_0xbe74('0x1b'),_0x4c9c1e,'request\x20sent');logger[_0xbe74('0x1c')](_0xbe74('0x1d'),_0x4c9c1e,'request\x20sent',JSON[_0xbe74('0x1e')](_0x433a56));if(_0x433a56[_0xbe74('0x1f')]){if(_0x433a56[_0xbe74('0x1f')]['code']===0x1f4){logger[_0xbe74('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x4c9c1e,_0x433a56[_0xbe74('0x1f')][_0xbe74('0x20')]);return _0x316da2(_0x433a56[_0xbe74('0x1f')][_0xbe74('0x20')]);}logger[_0xbe74('0x1f')](_0xbe74('0x1b'),_0x4c9c1e,_0x433a56[_0xbe74('0x1f')][_0xbe74('0x20')]);return _0x21836a(_0x433a56['error']['message']);}else{logger[_0xbe74('0x1a')](_0xbe74('0x1b'),_0x4c9c1e,_0xbe74('0x21'));_0x21836a(_0x433a56[_0xbe74('0x22')][_0xbe74('0x20')]);}})[_0xbe74('0x23')](function(_0xfacffa){logger[_0xbe74('0x1f')](_0xbe74('0x1b'),_0x4c9c1e,_0xfacffa);_0x316da2(_0xfacffa);});});}function respondWithStatusCode(_0x43b474,_0x52323d){_0x52323d=_0x52323d||0xcc;return function(_0x1c4533){if(_0x1c4533){return _0x43b474[_0xbe74('0x24')](_0x52323d);}return _0x43b474[_0xbe74('0x25')](_0x52323d)[_0xbe74('0x26')]();};}function respondWithResult(_0x31a405,_0x4b4a33){_0x4b4a33=_0x4b4a33||0xc8;return function(_0x496055){if(_0x496055){return _0x31a405[_0xbe74('0x25')](_0x4b4a33)[_0xbe74('0x27')](_0x496055);}};}function respondWithFilteredResult(_0xa46448,_0x380039){return function(_0x346b23){if(_0x346b23){var _0x42f89d=_0x346b23['count'],_0x510ee2=_0x380039[_0xbe74('0x28')],_0x4763d0=_0x380039[_0xbe74('0x28')]+_0x380039['limit'],_0x2416a2;if(_0x4763d0>=_0x42f89d){_0x4763d0=_0x42f89d;_0x2416a2=0xc8;}else{_0x2416a2=0xce;}_0xa46448['status'](_0x2416a2);return _0xa46448[_0xbe74('0x29')]('Content-Range',_0x510ee2+'-'+_0x4763d0+'/'+_0x42f89d)[_0xbe74('0x27')](_0x346b23);}return null;};}function patchUpdates(_0x25c7de){return function(_0x140088){try{jsonpatch[_0xbe74('0x2a')](_0x140088,_0x25c7de,!![]);}catch(_0x2e1520){return BPromise[_0xbe74('0x2b')](_0x2e1520);}return _0x140088['save']();};}function saveUpdates(_0x4247ce,_0x5841aa){return function(_0x26f989){if(_0x26f989){return _0x26f989[_0xbe74('0x2c')](_0x4247ce)['then'](function(_0x485f16){return _0x485f16;});}return null;};}function removeEntity(_0x257c31,_0x1686ec){return function(_0x3be4a1){if(_0x3be4a1){return _0x3be4a1['destroy']()['then'](function(){_0x257c31[_0xbe74('0x25')](0xcc)[_0xbe74('0x26')]();});}};}function handleEntityNotFound(_0x3708e3,_0x3c8209){return function(_0x420ecd){if(!_0x420ecd){_0x3708e3[_0xbe74('0x24')](0x194);}return _0x420ecd;};}function handleError(_0x5b5d4d,_0x1bcd98){_0x1bcd98=_0x1bcd98||0x1f4;return function(_0x1b3cb9){logger[_0xbe74('0x1f')](_0x1b3cb9[_0xbe74('0x2d')]);if(_0x1b3cb9[_0xbe74('0x2e')]){delete _0x1b3cb9[_0xbe74('0x2e')];}_0x5b5d4d[_0xbe74('0x25')](_0x1bcd98)[_0xbe74('0x2f')](_0x1b3cb9);};}exports[_0xbe74('0x30')]=function(_0x192c30,_0x5a2e98){var _0x3aaae0={},_0x26efe5={},_0x202381={'count':0x0,'rows':[]};var _0xe75bbb=db[_0xbe74('0x31')][_0xbe74('0x32')];_0x26efe5[_0xbe74('0x33')]=_['keys'](_0xe75bbb);_0x26efe5[_0xbe74('0x34')]=_[_0xbe74('0x35')](_0x192c30[_0xbe74('0x34')]);_0x26efe5[_0xbe74('0x36')]=_[_0xbe74('0x37')](_0x26efe5[_0xbe74('0x33')],_0x26efe5[_0xbe74('0x34')]);_0x3aaae0['attributes']=_['intersection'](_0x26efe5['model'],qs[_0xbe74('0x38')](_0x192c30[_0xbe74('0x34')]['fields']));_0x3aaae0[_0xbe74('0x39')]=_0x3aaae0[_0xbe74('0x39')][_0xbe74('0x3a')]?_0x3aaae0[_0xbe74('0x39')]:_0x26efe5[_0xbe74('0x33')];if(!_0x192c30[_0xbe74('0x34')][_0xbe74('0x3b')](_0xbe74('0x3c'))){_0x3aaae0[_0xbe74('0x3d')]=qs[_0xbe74('0x3d')](_0x192c30['query'][_0xbe74('0x3d')]);_0x3aaae0[_0xbe74('0x28')]=qs['offset'](_0x192c30[_0xbe74('0x34')]['offset']);}_0x3aaae0[_0xbe74('0x3e')]=qs[_0xbe74('0x3f')](_0x192c30[_0xbe74('0x34')][_0xbe74('0x3f')]);_0x3aaae0['where']=qs[_0xbe74('0x36')](_[_0xbe74('0x40')](_0x192c30[_0xbe74('0x34')],_0x26efe5[_0xbe74('0x36')]));if(_0x192c30[_0xbe74('0x34')]['filter']){_0x3aaae0[_0xbe74('0x41')]=_[_0xbe74('0x42')](_0x3aaae0['where'],{'$or':_['map'](_0xe75bbb,function(_0x14debd){if(_0x14debd[_0xbe74('0x43')][_0xbe74('0x44')]!==_0xbe74('0x45')){var _0x3ebad5={};_0x3ebad5[_0x14debd['field']]={'$like':'%'+_0x192c30[_0xbe74('0x34')]['filter']+'%'};return _0x3ebad5;}})});}_0x3aaae0=_[_0xbe74('0x42')]({},_0x3aaae0,_0x192c30[_0xbe74('0x46')]);var _0x45cff6={'where':_0x3aaae0[_0xbe74('0x41')]};return db[_0xbe74('0x31')][_0xbe74('0x47')](_0x45cff6)['then'](function(_0x28ccdc){_0x202381[_0xbe74('0x47')]=_0x28ccdc;if(_0x192c30[_0xbe74('0x34')]['includeAll']){_0x3aaae0[_0xbe74('0x48')]=[{'all':!![]}];}return db[_0xbe74('0x31')][_0xbe74('0x49')](_0x3aaae0);})[_0xbe74('0x4a')](function(_0x5946ea){_0x202381['rows']=_0x5946ea;return _0x202381;})[_0xbe74('0x4a')](respondWithFilteredResult(_0x5a2e98,_0x3aaae0))[_0xbe74('0x23')](handleError(_0x5a2e98,null));};exports[_0xbe74('0x4b')]=function(_0x1c154d,_0x35566e){var _0x2ba27e={'raw':![],'where':{'id':_0x1c154d['params']['id']}},_0x35403e={};_0x35403e[_0xbe74('0x33')]=_[_0xbe74('0x35')](db[_0xbe74('0x31')]['rawAttributes']);_0x35403e[_0xbe74('0x34')]=_['keys'](_0x1c154d['query']);_0x35403e[_0xbe74('0x36')]=_[_0xbe74('0x37')](_0x35403e[_0xbe74('0x33')],_0x35403e[_0xbe74('0x34')]);_0x2ba27e[_0xbe74('0x39')]=_[_0xbe74('0x37')](_0x35403e[_0xbe74('0x33')],qs['fields'](_0x1c154d[_0xbe74('0x34')][_0xbe74('0x38')]));_0x2ba27e[_0xbe74('0x39')]=_0x2ba27e['attributes'][_0xbe74('0x3a')]?_0x2ba27e[_0xbe74('0x39')]:_0x35403e['model'];if(_0x1c154d['query'][_0xbe74('0x4c')]){_0x2ba27e[_0xbe74('0x48')]=[{'all':!![]}];}_0x2ba27e=_[_0xbe74('0x42')]({},_0x2ba27e,_0x1c154d[_0xbe74('0x46')]);return db['VtigerAccount']['find'](_0x2ba27e)[_0xbe74('0x4a')](handleEntityNotFound(_0x35566e,null))['then'](respondWithResult(_0x35566e,null))[_0xbe74('0x23')](handleError(_0x35566e,null));};exports[_0xbe74('0x4d')]=function(_0x141156,_0x5b3c89){return db[_0xbe74('0x31')][_0xbe74('0x4d')](_0x141156[_0xbe74('0x4e')],{})[_0xbe74('0x4a')](respondWithResult(_0x5b3c89,0xc9))[_0xbe74('0x23')](handleError(_0x5b3c89,null));};exports[_0xbe74('0x2c')]=function(_0xbd5207,_0x308dba){if(_0xbd5207[_0xbe74('0x4e')]['id']){delete _0xbd5207[_0xbe74('0x4e')]['id'];}return db[_0xbe74('0x31')][_0xbe74('0x4f')]({'where':{'id':_0xbd5207[_0xbe74('0x50')]['id']}})[_0xbe74('0x4a')](handleEntityNotFound(_0x308dba,null))[_0xbe74('0x4a')](saveUpdates(_0xbd5207['body'],null))[_0xbe74('0x4a')](respondWithResult(_0x308dba,null))[_0xbe74('0x23')](handleError(_0x308dba,null));};exports[_0xbe74('0x51')]=function(_0x36f4d8,_0x6394a4){return db[_0xbe74('0x31')][_0xbe74('0x4f')]({'where':{'id':_0x36f4d8[_0xbe74('0x50')]['id']}})[_0xbe74('0x4a')](handleEntityNotFound(_0x6394a4,null))[_0xbe74('0x4a')](removeEntity(_0x6394a4,null))[_0xbe74('0x23')](handleError(_0x6394a4,null));};exports[_0xbe74('0x52')]=function(_0x13edeb,_0x713763,_0x146773){var _0x3c01f8={};var _0x434a0f={};var _0x43c068;var _0x1b711a;return db[_0xbe74('0x31')]['findOne']({'where':{'id':_0x13edeb['params']['id']}})['then'](handleEntityNotFound(_0x713763,null))[_0xbe74('0x4a')](function(_0x31d28e){if(_0x31d28e){_0x43c068=_0x31d28e;_0x434a0f['model']=_[_0xbe74('0x35')](db[_0xbe74('0x53')][_0xbe74('0x32')]);_0x434a0f['query']=_['keys'](_0x13edeb[_0xbe74('0x34')]);_0x434a0f['filters']=_[_0xbe74('0x37')](_0x434a0f[_0xbe74('0x33')],_0x434a0f['query']);_0x3c01f8['attributes']=_[_0xbe74('0x37')](_0x434a0f[_0xbe74('0x33')],qs['fields'](_0x13edeb[_0xbe74('0x34')][_0xbe74('0x38')]));_0x3c01f8[_0xbe74('0x39')]=_0x3c01f8[_0xbe74('0x39')][_0xbe74('0x3a')]?_0x3c01f8[_0xbe74('0x39')]:_0x434a0f['model'];_0x3c01f8[_0xbe74('0x3e')]=qs[_0xbe74('0x3f')](_0x13edeb[_0xbe74('0x34')][_0xbe74('0x3f')]);_0x3c01f8[_0xbe74('0x41')]=qs[_0xbe74('0x36')](_[_0xbe74('0x40')](_0x13edeb[_0xbe74('0x34')],_0x434a0f[_0xbe74('0x36')]));if(_0x13edeb[_0xbe74('0x34')][_0xbe74('0x54')]){_0x3c01f8[_0xbe74('0x41')]=_['merge'](_0x3c01f8['where'],{'$or':_['map'](_0x3c01f8[_0xbe74('0x39')],function(_0x3050ac){var _0x3ab425={};_0x3ab425[_0x3050ac]={'$like':'%'+_0x13edeb[_0xbe74('0x34')][_0xbe74('0x54')]+'%'};return _0x3ab425;})});}_0x3c01f8=_[_0xbe74('0x42')]({},_0x3c01f8,_0x13edeb[_0xbe74('0x46')]);return _0x43c068['getConfigurations'](_0x3c01f8);}})[_0xbe74('0x4a')](function(_0x3bafbf){if(_0x3bafbf){_0x1b711a=_0x3bafbf[_0xbe74('0x3a')];if(!_0x13edeb[_0xbe74('0x34')][_0xbe74('0x3b')](_0xbe74('0x3c'))){_0x3c01f8[_0xbe74('0x3d')]=qs[_0xbe74('0x3d')](_0x13edeb[_0xbe74('0x34')][_0xbe74('0x3d')]);_0x3c01f8[_0xbe74('0x28')]=qs[_0xbe74('0x28')](_0x13edeb[_0xbe74('0x34')][_0xbe74('0x28')]);}return _0x43c068[_0xbe74('0x52')](_0x3c01f8);}})[_0xbe74('0x4a')](function(_0x2c05d3){if(_0x2c05d3){return _0x2c05d3?{'count':_0x1b711a,'rows':_0x2c05d3}:null;}})['then'](respondWithResult(_0x713763,null))[_0xbe74('0x23')](handleError(_0x713763,null));};exports['addConfiguration']=function(_0x540141,_0x52fe13,_0x124553){if(_0x540141[_0xbe74('0x4e')]['id']){delete _0x540141['body']['id'];}return db[_0xbe74('0x31')][_0xbe74('0x55')]({'where':{'id':_0x540141['params']['id']}})[_0xbe74('0x4a')](handleEntityNotFound(_0x52fe13,null))[_0xbe74('0x4a')](function(_0x40566c){if(_0x40566c){_0x540141[_0xbe74('0x4e')][_0xbe74('0x56')]=_0x40566c['id'];_0x540141[_0xbe74('0x4e')]['Subjects']=integrations[_0xbe74('0x57')](_0x540141[_0xbe74('0x4e')]['channel'],_0x540141[_0xbe74('0x4e')][_0xbe74('0x43')]);_0x540141[_0xbe74('0x4e')][_0xbe74('0x58')]=integrations[_0xbe74('0x59')](_0x540141[_0xbe74('0x4e')][_0xbe74('0x5a')],_0x540141[_0xbe74('0x4e')][_0xbe74('0x43')]);return db[_0xbe74('0x53')]['create'](_0x540141[_0xbe74('0x4e')],{'include':[{'model':db[_0xbe74('0x5b')],'as':'Subjects'},{'model':db[_0xbe74('0x5b')],'as':_0xbe74('0x58')}]});}return null;})['then'](respondWithResult(_0x52fe13,null))['catch'](handleError(_0x52fe13,null));};var md5=require('md5');exports[_0xbe74('0x5c')]=function(_0x55be82,_0x45d15e,_0x541bc7){var _0x4cd36f=null;var _0x41ffd1=null;var _0x441bf=null;var _0x2a493c=null;var _0x3678a4='';return db[_0xbe74('0x31')][_0xbe74('0x55')]({'where':{'id':_0x55be82['params']['id']},'attributes':['id',_0xbe74('0x2e'),'username',_0xbe74('0x5d'),_0xbe74('0x5e'),_0xbe74('0x5f'),_0xbe74('0x60'),_0xbe74('0x61')]})[_0xbe74('0x4a')](handleEntityNotFound(_0x45d15e,null))[_0xbe74('0x4a')](function(_0x496dee){if(_0x496dee){_0x4cd36f=_0x496dee[_0xbe74('0x62')];_0x41ffd1=_0x496dee[_0xbe74('0x61')];_0x441bf=_0x496dee[_0xbe74('0x5e')];_0x3678a4=_0x496dee[_0xbe74('0x5f')];var _0x3e65f5=_0x3678a4[_0xbe74('0x63')](-0x1);if(_0x3e65f5==='/'){_0x3678a4=_0x3678a4[_0xbe74('0x64')](0x0,_0x3678a4[_0xbe74('0x65')](_0x3e65f5));}_0x2a493c=util[_0xbe74('0x66')](_0xbe74('0x67'),_0x3678a4);var _0x1900ee={'method':_0xbe74('0x68'),'uri':_0x2a493c,'qs':{'operation':'getchallenge','username':_0x496dee[_0xbe74('0x62')]},'json':!![]};return rp(_0x1900ee);}})[_0xbe74('0x4a')](function(_0x54fa7b){if(_0x54fa7b['success']){var _0x51c647={'method':'POST','uri':_0x2a493c,'form':{'operation':_0xbe74('0x69'),'username':_0x4cd36f,'accessKey':md5(_0x54fa7b['result'][_0xbe74('0x6a')]+_0x41ffd1)},'json':!![]};return rp(_0x51c647);}})['then'](function(_0x1a594a){if(_0x1a594a[_0xbe74('0x6b')]){var _0x1d8bc3={'method':_0xbe74('0x68'),'uri':_0x2a493c,'qs':{'operation':_0xbe74('0x6c'),'username':_0x4cd36f,'sessionName':_0x1a594a[_0xbe74('0x22')][_0xbe74('0x6d')],'elementType':_0x441bf},'json':!![]};return rp(_0x1d8bc3);}})[_0xbe74('0x4a')](function(_0x3e2316){if(_0x3e2316[_0xbe74('0x6b')]){var _0x20ed90=[_0xbe74('0x6e'),_0xbe74('0x6f'),_0xbe74('0x70')];_['remove'](_0x3e2316[_0xbe74('0x22')][_0xbe74('0x38')],function(_0x326526){return _0x20ed90[_0xbe74('0x71')](_0x326526[_0xbe74('0x43')][_0xbe74('0x2e')]);});_[_0xbe74('0x72')](_0x3e2316['result'][_0xbe74('0x38')],function(_0x2a8588){return _0x2a8588['editable']===_0xbe74('0x73');});return{'count':_0x3e2316['result']['fields'][_0xbe74('0x3a')],'rows':_[_0xbe74('0x74')](_0x3e2316['result']['fields'],function(_0x1e8b0e){return{'id':_0x1e8b0e[_0xbe74('0x2e')],'name':_0x1e8b0e['label'],'custom':_[_0xbe74('0x75')](_0x1e8b0e[_0xbe74('0x2e')],_0xbe74('0x76'))?!![]:![],'options':_0x1e8b0e['type'][_0xbe74('0x2e')]==='picklist'&&_0x1e8b0e[_0xbe74('0x43')][_0xbe74('0x77')][_0xbe74('0x3a')]>0x0?_[_0xbe74('0x74')](_0x1e8b0e[_0xbe74('0x43')][_0xbe74('0x77')],function(_0x55233c){return{'name':_0x55233c[_0xbe74('0x78')],'value':_0x55233c[_0xbe74('0x79')]};}):[]};})};}})[_0xbe74('0x4a')](respondWithResult(_0x45d15e,null))[_0xbe74('0x23')](function(_0x510b38){console['log'](_0xbe74('0x7a')+_0x510b38);var _0x39ab9a=_0x55be82[_0xbe74('0x34')]['test']?0x1f4:_0x510b38[_0xbe74('0x7b')]||0x1f4;logger[_0xbe74('0x1f')](_0xbe74('0x7c'),_0xbe74('0x5c'),_0x39ab9a,JSON[_0xbe74('0x1e')](_0x510b38));delete _0x510b38[_0xbe74('0x2e')];if(_0x39ab9a===0x191){_0x39ab9a=0x190;}_0x45d15e[_0xbe74('0x25')](_0x39ab9a)['send'](_0x55be82[_0xbe74('0x34')][_0xbe74('0x17')]?{'message':_0xbe74('0x7d'),'statusCode':_0x510b38[_0xbe74('0x7b')]}:_0x510b38);});}; \ No newline at end of file +var _0x4216=['success','describe','autogenerated','reference','owner','remove','includes','name','editable','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','set','Content-Range','apply','save','update','destroy','sendStatus','send','VtigerAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','limit','sort','where','filter','merge','map','key','VIRTUAL','options','count','include','findAll','rows','show','params','includeAll','create','body','find','getConfigurations','findOne','order','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','username','description','moduleName','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','login','token'];(function(_0x410294,_0x18f431){var _0x5e4c14=function(_0x10cd1d){while(--_0x10cd1d){_0x410294['push'](_0x410294['shift']());}};_0x5e4c14(++_0x18f431);}(_0x4216,0x95));var _0x6421=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4216[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6421('0x0'));var rimraf=require(_0x6421('0x1'));var zipdir=require(_0x6421('0x2'));var jsonpatch=require(_0x6421('0x3'));var rp=require('request-promise');var moment=require(_0x6421('0x4'));var BPromise=require(_0x6421('0x5'));var Mustache=require(_0x6421('0x6'));var util=require(_0x6421('0x7'));var path=require(_0x6421('0x8'));var sox=require(_0x6421('0x9'));var csv=require(_0x6421('0xa'));var ejs=require(_0x6421('0xb'));var fs=require('fs');var _=require(_0x6421('0xc'));var squel=require('squel');var crypto=require(_0x6421('0xd'));var jsforce=require(_0x6421('0xe'));var deskjs=require(_0x6421('0xf'));var toCsv=require(_0x6421('0xa'));var querystring=require('querystring');var Papa=require(_0x6421('0x10'));var Redis=require(_0x6421('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6421('0x12'));var hardwareService=require(_0x6421('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6421('0x14'));var config=require(_0x6421('0x15'));var db=require(_0x6421('0x16'))['db'];var integrations=require(_0x6421('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x6421('0x18')][_0x6421('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5aa918,_0x5a35a0,_0x49bdce){if(_0x49bdce){var _0x5d0bfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d0bfd[_0x6421('0x1a')](_0x5a35a0)){return _0x5aa918;}else{throw new Error(_0x6421('0x1b'));}}else{return _0x5aa918;}}function respondWithRpcPromise(_0x526c39,_0x22d76c,_0x23bca8,_0x59e661){return new BPromise(function(_0xf6e078,_0x3c8d1a){var _0x32bd8b=_0x59e661||client;return _0x32bd8b[_0x6421('0x1c')](_0x526c39,_0x23bca8)[_0x6421('0x1d')](function(_0x40f68c){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x22d76c,'request\x20sent');logger[_0x6421('0x1e')](_0x6421('0x1f'),_0x22d76c,_0x6421('0x20'),JSON[_0x6421('0x21')](_0x40f68c));if(_0x40f68c[_0x6421('0x22')]){if(_0x40f68c[_0x6421('0x22')]['code']===0x1f4){logger[_0x6421('0x22')](_0x6421('0x23'),_0x22d76c,_0x40f68c[_0x6421('0x22')][_0x6421('0x24')]);return _0x3c8d1a(_0x40f68c[_0x6421('0x22')][_0x6421('0x24')]);}logger[_0x6421('0x22')](_0x6421('0x23'),_0x22d76c,_0x40f68c[_0x6421('0x22')]['message']);return _0xf6e078(_0x40f68c[_0x6421('0x22')]['message']);}else{logger[_0x6421('0x25')](_0x6421('0x23'),_0x22d76c,_0x6421('0x20'));_0xf6e078(_0x40f68c[_0x6421('0x26')][_0x6421('0x24')]);}})[_0x6421('0x27')](function(_0x5a78f3){logger[_0x6421('0x22')](_0x6421('0x23'),_0x22d76c,_0x5a78f3);_0x3c8d1a(_0x5a78f3);});});}function respondWithStatusCode(_0x55c6bc,_0x488292){_0x488292=_0x488292||0xcc;return function(_0x46e1bc){if(_0x46e1bc){return _0x55c6bc['sendStatus'](_0x488292);}return _0x55c6bc[_0x6421('0x28')](_0x488292)[_0x6421('0x29')]();};}function respondWithResult(_0x4a14b3,_0x255528){_0x255528=_0x255528||0xc8;return function(_0x386f94){if(_0x386f94){return _0x4a14b3[_0x6421('0x28')](_0x255528)[_0x6421('0x2a')](_0x386f94);}};}function respondWithFilteredResult(_0x46483a,_0xc58614){return function(_0x5e65cf){if(_0x5e65cf){var _0x3c7f6a=_0x5e65cf['count'],_0x587054=_0xc58614[_0x6421('0x2b')],_0x4ea56f=_0xc58614[_0x6421('0x2b')]+_0xc58614['limit'],_0x164506;if(_0x4ea56f>=_0x3c7f6a){_0x4ea56f=_0x3c7f6a;_0x164506=0xc8;}else{_0x164506=0xce;}_0x46483a[_0x6421('0x28')](_0x164506);return _0x46483a[_0x6421('0x2c')](_0x6421('0x2d'),_0x587054+'-'+_0x4ea56f+'/'+_0x3c7f6a)[_0x6421('0x2a')](_0x5e65cf);}return null;};}function patchUpdates(_0x2eb1be){return function(_0x54ad07){try{jsonpatch[_0x6421('0x2e')](_0x54ad07,_0x2eb1be,!![]);}catch(_0x21bf6d){return BPromise['reject'](_0x21bf6d);}return _0x54ad07[_0x6421('0x2f')]();};}function saveUpdates(_0x51e153,_0x3bbb5a){return function(_0x29f437){if(_0x29f437){return _0x29f437[_0x6421('0x30')](_0x51e153)[_0x6421('0x1d')](function(_0x1b6a15){return _0x1b6a15;});}return null;};}function removeEntity(_0x487e15,_0x113840){return function(_0x32999a){if(_0x32999a){return _0x32999a[_0x6421('0x31')]()[_0x6421('0x1d')](function(){_0x487e15[_0x6421('0x28')](0xcc)[_0x6421('0x29')]();});}};}function handleEntityNotFound(_0x37d0a6,_0xb6d65c){return function(_0x45e307){if(!_0x45e307){_0x37d0a6[_0x6421('0x32')](0x194);}return _0x45e307;};}function handleError(_0x3f36d1,_0x57eaf8){_0x57eaf8=_0x57eaf8||0x1f4;return function(_0x1feb66){logger[_0x6421('0x22')](_0x1feb66['stack']);if(_0x1feb66['name']){delete _0x1feb66['name'];}_0x3f36d1[_0x6421('0x28')](_0x57eaf8)[_0x6421('0x33')](_0x1feb66);};}exports['index']=function(_0x482719,_0x2a5dc4){var _0x5bd0d9={},_0x50220c={},_0x3454ca={'count':0x0,'rows':[]};var _0x40288c=db[_0x6421('0x34')][_0x6421('0x35')];_0x50220c[_0x6421('0x36')]=_[_0x6421('0x37')](_0x40288c);_0x50220c['query']=_[_0x6421('0x37')](_0x482719[_0x6421('0x38')]);_0x50220c[_0x6421('0x39')]=_['intersection'](_0x50220c['model'],_0x50220c[_0x6421('0x38')]);_0x5bd0d9[_0x6421('0x3a')]=_[_0x6421('0x3b')](_0x50220c[_0x6421('0x36')],qs[_0x6421('0x3c')](_0x482719['query'][_0x6421('0x3c')]));_0x5bd0d9[_0x6421('0x3a')]=_0x5bd0d9[_0x6421('0x3a')][_0x6421('0x3d')]?_0x5bd0d9[_0x6421('0x3a')]:_0x50220c[_0x6421('0x36')];if(!_0x482719[_0x6421('0x38')]['hasOwnProperty']('nolimit')){_0x5bd0d9[_0x6421('0x3e')]=qs[_0x6421('0x3e')](_0x482719[_0x6421('0x38')][_0x6421('0x3e')]);_0x5bd0d9[_0x6421('0x2b')]=qs[_0x6421('0x2b')](_0x482719[_0x6421('0x38')][_0x6421('0x2b')]);}_0x5bd0d9['order']=qs[_0x6421('0x3f')](_0x482719[_0x6421('0x38')][_0x6421('0x3f')]);_0x5bd0d9[_0x6421('0x40')]=qs['filters'](_['pick'](_0x482719['query'],_0x50220c['filters']));if(_0x482719[_0x6421('0x38')][_0x6421('0x41')]){_0x5bd0d9['where']=_[_0x6421('0x42')](_0x5bd0d9[_0x6421('0x40')],{'$or':_[_0x6421('0x43')](_0x40288c,function(_0x14c9a5){if(_0x14c9a5['type'][_0x6421('0x44')]!==_0x6421('0x45')){var _0x59e9b2={};_0x59e9b2[_0x14c9a5['field']]={'$like':'%'+_0x482719['query'][_0x6421('0x41')]+'%'};return _0x59e9b2;}})});}_0x5bd0d9=_[_0x6421('0x42')]({},_0x5bd0d9,_0x482719[_0x6421('0x46')]);var _0x2b06e4={'where':_0x5bd0d9['where']};return db['VtigerAccount'][_0x6421('0x47')](_0x2b06e4)['then'](function(_0x536ba6){_0x3454ca[_0x6421('0x47')]=_0x536ba6;if(_0x482719[_0x6421('0x38')]['includeAll']){_0x5bd0d9[_0x6421('0x48')]=[{'all':!![]}];}return db[_0x6421('0x34')][_0x6421('0x49')](_0x5bd0d9);})[_0x6421('0x1d')](function(_0x416184){_0x3454ca[_0x6421('0x4a')]=_0x416184;return _0x3454ca;})[_0x6421('0x1d')](respondWithFilteredResult(_0x2a5dc4,_0x5bd0d9))[_0x6421('0x27')](handleError(_0x2a5dc4,null));};exports[_0x6421('0x4b')]=function(_0x58dccd,_0x3bf799){var _0x388fbe={'raw':![],'where':{'id':_0x58dccd[_0x6421('0x4c')]['id']}},_0x557b75={};_0x557b75['model']=_[_0x6421('0x37')](db[_0x6421('0x34')][_0x6421('0x35')]);_0x557b75[_0x6421('0x38')]=_[_0x6421('0x37')](_0x58dccd[_0x6421('0x38')]);_0x557b75[_0x6421('0x39')]=_[_0x6421('0x3b')](_0x557b75[_0x6421('0x36')],_0x557b75[_0x6421('0x38')]);_0x388fbe[_0x6421('0x3a')]=_['intersection'](_0x557b75['model'],qs[_0x6421('0x3c')](_0x58dccd[_0x6421('0x38')]['fields']));_0x388fbe[_0x6421('0x3a')]=_0x388fbe['attributes'][_0x6421('0x3d')]?_0x388fbe[_0x6421('0x3a')]:_0x557b75[_0x6421('0x36')];if(_0x58dccd[_0x6421('0x38')][_0x6421('0x4d')]){_0x388fbe['include']=[{'all':!![]}];}_0x388fbe=_[_0x6421('0x42')]({},_0x388fbe,_0x58dccd['options']);return db['VtigerAccount']['find'](_0x388fbe)['then'](handleEntityNotFound(_0x3bf799,null))[_0x6421('0x1d')](respondWithResult(_0x3bf799,null))['catch'](handleError(_0x3bf799,null));};exports[_0x6421('0x4e')]=function(_0x3805b0,_0x51a946){return db[_0x6421('0x34')][_0x6421('0x4e')](_0x3805b0['body'],{})[_0x6421('0x1d')](respondWithResult(_0x51a946,0xc9))[_0x6421('0x27')](handleError(_0x51a946,null));};exports[_0x6421('0x30')]=function(_0x5ec17c,_0x58eac5){if(_0x5ec17c[_0x6421('0x4f')]['id']){delete _0x5ec17c['body']['id'];}return db[_0x6421('0x34')][_0x6421('0x50')]({'where':{'id':_0x5ec17c[_0x6421('0x4c')]['id']}})[_0x6421('0x1d')](handleEntityNotFound(_0x58eac5,null))[_0x6421('0x1d')](saveUpdates(_0x5ec17c[_0x6421('0x4f')],null))[_0x6421('0x1d')](respondWithResult(_0x58eac5,null))[_0x6421('0x27')](handleError(_0x58eac5,null));};exports[_0x6421('0x31')]=function(_0x568fc8,_0x1895cc){return db[_0x6421('0x34')][_0x6421('0x50')]({'where':{'id':_0x568fc8[_0x6421('0x4c')]['id']}})[_0x6421('0x1d')](handleEntityNotFound(_0x1895cc,null))[_0x6421('0x1d')](removeEntity(_0x1895cc,null))[_0x6421('0x27')](handleError(_0x1895cc,null));};exports[_0x6421('0x51')]=function(_0xc20ec8,_0x3cf757,_0x590ed1){var _0x32c1a3={};var _0x4dfcbf={};var _0x26c99e;var _0x2aaa25;return db[_0x6421('0x34')][_0x6421('0x52')]({'where':{'id':_0xc20ec8['params']['id']}})['then'](handleEntityNotFound(_0x3cf757,null))[_0x6421('0x1d')](function(_0x460a22){if(_0x460a22){_0x26c99e=_0x460a22;_0x4dfcbf[_0x6421('0x36')]=_[_0x6421('0x37')](db['VtigerConfiguration'][_0x6421('0x35')]);_0x4dfcbf[_0x6421('0x38')]=_['keys'](_0xc20ec8[_0x6421('0x38')]);_0x4dfcbf[_0x6421('0x39')]=_[_0x6421('0x3b')](_0x4dfcbf['model'],_0x4dfcbf[_0x6421('0x38')]);_0x32c1a3[_0x6421('0x3a')]=_[_0x6421('0x3b')](_0x4dfcbf[_0x6421('0x36')],qs[_0x6421('0x3c')](_0xc20ec8['query'][_0x6421('0x3c')]));_0x32c1a3[_0x6421('0x3a')]=_0x32c1a3[_0x6421('0x3a')][_0x6421('0x3d')]?_0x32c1a3['attributes']:_0x4dfcbf[_0x6421('0x36')];_0x32c1a3[_0x6421('0x53')]=qs[_0x6421('0x3f')](_0xc20ec8['query'][_0x6421('0x3f')]);_0x32c1a3[_0x6421('0x40')]=qs[_0x6421('0x39')](_[_0x6421('0x54')](_0xc20ec8[_0x6421('0x38')],_0x4dfcbf['filters']));if(_0xc20ec8[_0x6421('0x38')][_0x6421('0x41')]){_0x32c1a3[_0x6421('0x40')]=_['merge'](_0x32c1a3[_0x6421('0x40')],{'$or':_[_0x6421('0x43')](_0x32c1a3[_0x6421('0x3a')],function(_0x49f919){var _0x475f3b={};_0x475f3b[_0x49f919]={'$like':'%'+_0xc20ec8[_0x6421('0x38')][_0x6421('0x41')]+'%'};return _0x475f3b;})});}_0x32c1a3=_['merge']({},_0x32c1a3,_0xc20ec8[_0x6421('0x46')]);return _0x26c99e[_0x6421('0x51')](_0x32c1a3);}})[_0x6421('0x1d')](function(_0xddacc3){if(_0xddacc3){_0x2aaa25=_0xddacc3[_0x6421('0x3d')];if(!_0xc20ec8[_0x6421('0x38')]['hasOwnProperty'](_0x6421('0x55'))){_0x32c1a3[_0x6421('0x3e')]=qs[_0x6421('0x3e')](_0xc20ec8['query'][_0x6421('0x3e')]);_0x32c1a3['offset']=qs[_0x6421('0x2b')](_0xc20ec8['query'][_0x6421('0x2b')]);}return _0x26c99e[_0x6421('0x51')](_0x32c1a3);}})['then'](function(_0x3d65c6){if(_0x3d65c6){return _0x3d65c6?{'count':_0x2aaa25,'rows':_0x3d65c6}:null;}})['then'](respondWithResult(_0x3cf757,null))['catch'](handleError(_0x3cf757,null));};exports[_0x6421('0x56')]=function(_0x5b98c6,_0x37ab59,_0x2970e4){if(_0x5b98c6[_0x6421('0x4f')]['id']){delete _0x5b98c6[_0x6421('0x4f')]['id'];}return db[_0x6421('0x34')][_0x6421('0x52')]({'where':{'id':_0x5b98c6['params']['id']}})[_0x6421('0x1d')](handleEntityNotFound(_0x37ab59,null))[_0x6421('0x1d')](function(_0x2688d1){if(_0x2688d1){_0x5b98c6[_0x6421('0x4f')][_0x6421('0x57')]=_0x2688d1['id'];_0x5b98c6[_0x6421('0x4f')][_0x6421('0x58')]=integrations[_0x6421('0x59')](_0x5b98c6['body'][_0x6421('0x5a')],_0x5b98c6[_0x6421('0x4f')][_0x6421('0x5b')]);_0x5b98c6[_0x6421('0x4f')][_0x6421('0x5c')]=integrations[_0x6421('0x5d')](_0x5b98c6[_0x6421('0x4f')]['channel'],_0x5b98c6['body']['type']);return db[_0x6421('0x5e')][_0x6421('0x4e')](_0x5b98c6[_0x6421('0x4f')],{'include':[{'model':db[_0x6421('0x5f')],'as':'Subjects'},{'model':db[_0x6421('0x5f')],'as':_0x6421('0x5c')}]});}return null;})[_0x6421('0x1d')](respondWithResult(_0x37ab59,null))[_0x6421('0x27')](handleError(_0x37ab59,null));};var md5=require(_0x6421('0x60'));exports['getFields']=function(_0x5ebf3f,_0x265194,_0x5c86a7){var _0x40907f=null;var _0x284076=null;var _0xedd4c8=null;var _0x3dc62b=null;var _0x575bd1='';return db[_0x6421('0x34')][_0x6421('0x52')]({'where':{'id':_0x5ebf3f[_0x6421('0x4c')]['id']},'attributes':['id','name',_0x6421('0x61'),_0x6421('0x62'),_0x6421('0x63'),'remoteUri','serverUrl',_0x6421('0x64')]})['then'](handleEntityNotFound(_0x265194,null))[_0x6421('0x1d')](function(_0x42f978){if(_0x42f978){_0x40907f=_0x42f978['username'];_0x284076=_0x42f978['accessKey'];_0xedd4c8=_0x42f978[_0x6421('0x63')];_0x575bd1=_0x42f978[_0x6421('0x65')];var _0x36c06c=_0x575bd1[_0x6421('0x66')](-0x1);if(_0x36c06c==='/'){_0x575bd1=_0x575bd1[_0x6421('0x67')](0x0,_0x575bd1[_0x6421('0x68')](_0x36c06c));}_0x3dc62b=util[_0x6421('0x69')](_0x6421('0x6a'),_0x575bd1);var _0x3c1150={'method':_0x6421('0x6b'),'uri':_0x3dc62b,'qs':{'operation':_0x6421('0x6c'),'username':_0x42f978['username']},'json':!![]};return rp(_0x3c1150);}})[_0x6421('0x1d')](function(_0x33a83a){if(_0x33a83a['success']){var _0x299b66={'method':'POST','uri':_0x3dc62b,'form':{'operation':_0x6421('0x6d'),'username':_0x40907f,'accessKey':md5(_0x33a83a[_0x6421('0x26')][_0x6421('0x6e')]+_0x284076)},'json':!![]};return rp(_0x299b66);}})['then'](function(_0x2936bc){if(_0x2936bc[_0x6421('0x6f')]){var _0x348274={'method':_0x6421('0x6b'),'uri':_0x3dc62b,'qs':{'operation':_0x6421('0x70'),'username':_0x40907f,'sessionName':_0x2936bc[_0x6421('0x26')]['sessionName'],'elementType':_0xedd4c8},'json':!![]};return rp(_0x348274);}})['then'](function(_0x5ef6a3){if(_0x5ef6a3[_0x6421('0x6f')]){var _0x3180ed=[_0x6421('0x71'),_0x6421('0x72'),_0x6421('0x73')];_[_0x6421('0x74')](_0x5ef6a3['result'][_0x6421('0x3c')],function(_0x1eb84e){return _0x3180ed[_0x6421('0x75')](_0x1eb84e['type'][_0x6421('0x76')]);});_[_0x6421('0x74')](_0x5ef6a3['result'][_0x6421('0x3c')],function(_0x106503){return _0x106503[_0x6421('0x77')]==='false';});return{'count':_0x5ef6a3[_0x6421('0x26')][_0x6421('0x3c')]['length'],'rows':_[_0x6421('0x43')](_0x5ef6a3[_0x6421('0x26')]['fields'],function(_0x3a4ac1){return{'id':_0x3a4ac1[_0x6421('0x76')],'name':_0x3a4ac1[_0x6421('0x78')],'custom':_[_0x6421('0x79')](_0x3a4ac1['name'],_0x6421('0x7a'))?!![]:![],'options':_0x3a4ac1[_0x6421('0x5b')][_0x6421('0x76')]===_0x6421('0x7b')&&_0x3a4ac1[_0x6421('0x5b')][_0x6421('0x7c')][_0x6421('0x3d')]>0x0?_['map'](_0x3a4ac1[_0x6421('0x5b')][_0x6421('0x7c')],function(_0x51b70f){return{'name':_0x51b70f[_0x6421('0x78')],'value':_0x51b70f['value']};}):[]};})};}})[_0x6421('0x1d')](respondWithResult(_0x265194,null))[_0x6421('0x27')](function(_0x59cab2){console[_0x6421('0x7d')](_0x6421('0x7e')+_0x59cab2);var _0x42a2f2=_0x5ebf3f[_0x6421('0x38')][_0x6421('0x1a')]?0x1f4:_0x59cab2[_0x6421('0x7f')]||0x1f4;logger[_0x6421('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x6421('0x80'),_0x42a2f2,JSON['stringify'](_0x59cab2));delete _0x59cab2[_0x6421('0x76')];if(_0x42a2f2===0x191){_0x42a2f2=0x190;}_0x265194[_0x6421('0x28')](_0x42a2f2)['send'](_0x5ebf3f['query']['test']?{'message':_0x6421('0x81'),'statusCode':_0x59cab2['statusCode']}:_0x59cab2);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 931701d..92b97eb 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 _0x0598=['path','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api','request-promise'];(function(_0x2c3695,_0x12b31e){var _0x1a686c=function(_0x5974c0){while(--_0x5974c0){_0x2c3695['push'](_0x2c3695['shift']());}};_0x1a686c(++_0x12b31e);}(_0x0598,0x92));var _0x8059=function(_0x56e588,_0x4f23f4){_0x56e588=_0x56e588-0x0;var _0x188e9a=_0x0598[_0x56e588];return _0x188e9a;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x8059('0x5'));module[_0x8059('0x6')]=function(_0x512c0f,_0x5996d7){return _0x512c0f[_0x8059('0x7')](_0x8059('0x8'),attributes,{'tableName':_0x8059('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c8d=['int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount'];(function(_0x4cea40,_0x53f3a2){var _0x5a830a=function(_0x5e07b9){while(--_0x5e07b9){_0x4cea40['push'](_0x4cea40['shift']());}};_0x5a830a(++_0x53f3a2);}(_0x0c8d,0x79));var _0xd0c8=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x0c8d[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var logger=require(_0xd0c8('0x1'))(_0xd0c8('0x2'));var moment=require(_0xd0c8('0x3'));var BPromise=require(_0xd0c8('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(_0xd0c8('0x5'));var integrations=require(_0xd0c8('0x6'));module[_0xd0c8('0x7')]=function(_0x50484d,_0x16d1c1){return _0x50484d['define'](_0xd0c8('0x8'),attributes,{'tableName':_0xd0c8('0x9'),'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 97871fe..0a01afc 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 _0x8204=['ShowVtigerAccount','find','where','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','findAll','options','raw','include','map','model','attributes','GetVtigerAccount'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x8204,0x10c));var _0x4820=function(_0x3193c9,_0x28f061){_0x3193c9=_0x3193c9-0x0;var _0x1fd2dd=_0x8204[_0x3193c9];return _0x1fd2dd;};'use strict';var _=require('lodash');var util=require(_0x4820('0x0'));var moment=require(_0x4820('0x1'));var BPromise=require('bluebird');var rs=require(_0x4820('0x2'));var fs=require('fs');var Redis=require(_0x4820('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4820('0x4'));var logger=require(_0x4820('0x5'))('rpc');var config=require(_0x4820('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4820('0x7')][_0x4820('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48679b,_0x4b9ed5,_0x21ee92){return new BPromise(function(_0x4e867d,_0x95c75a){return client[_0x4820('0x9')](_0x48679b,_0x21ee92)[_0x4820('0xa')](function(_0x486121){logger[_0x4820('0xb')](_0x4820('0xc'),_0x4b9ed5,'request\x20sent');logger[_0x4820('0xd')](_0x4820('0xe'),_0x4b9ed5,_0x4820('0xf'),JSON['stringify'](_0x486121));if(_0x486121[_0x4820('0x10')]){if(_0x486121[_0x4820('0x10')][_0x4820('0x11')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4b9ed5,_0x486121[_0x4820('0x10')][_0x4820('0x12')]);return _0x95c75a(_0x486121[_0x4820('0x10')][_0x4820('0x12')]);}logger[_0x4820('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4b9ed5,_0x486121['error'][_0x4820('0x12')]);return _0x4e867d(_0x486121[_0x4820('0x10')][_0x4820('0x12')]);}else{logger['info'](_0x4820('0xc'),_0x4b9ed5,_0x4820('0xf'));_0x4e867d(_0x486121[_0x4820('0x13')][_0x4820('0x12')]);}})[_0x4820('0x14')](function(_0x354afe){logger[_0x4820('0x10')](_0x4820('0xc'),_0x4b9ed5,_0x354afe);_0x95c75a(_0x354afe);});});}exports['GetVtigerAccount']=function(_0x4b2d56){var _0x46bfde=this;return new Promise(function(_0x59ca40,_0x54c09a){return db['VtigerAccount'][_0x4820('0x15')]({'raw':_0x4b2d56[_0x4820('0x16')]?_0x4b2d56[_0x4820('0x16')][_0x4820('0x17')]===undefined?!![]:![]:!![],'where':_0x4b2d56['options']?_0x4b2d56[_0x4820('0x16')]['where']||null:null,'attributes':_0x4b2d56[_0x4820('0x16')]?_0x4b2d56['options']['attributes']||null:null,'limit':_0x4b2d56['options']?_0x4b2d56['options']['limit']||null:null,'include':_0x4b2d56[_0x4820('0x16')]?_0x4b2d56['options'][_0x4820('0x18')]?_['map'](_0x4b2d56['options'][_0x4820('0x18')],function(_0xb63685){return{'model':db[_0xb63685['model']],'as':_0xb63685['as'],'attributes':_0xb63685['attributes'],'include':_0xb63685['include']?_[_0x4820('0x19')](_0xb63685[_0x4820('0x18')],function(_0x24a419){return{'model':db[_0x24a419[_0x4820('0x1a')]],'as':_0x24a419['as'],'attributes':_0x24a419[_0x4820('0x1b')],'include':_0x24a419['include']?_[_0x4820('0x19')](_0x24a419['include'],function(_0x11dd0a){return{'model':db[_0x11dd0a[_0x4820('0x1a')]],'as':_0x11dd0a['as'],'attributes':_0x11dd0a[_0x4820('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30190c){logger[_0x4820('0xb')]('GetVtigerAccount',_0x4b2d56);logger[_0x4820('0xd')](_0x4820('0x1c'),_0x4b2d56,JSON['stringify'](_0x30190c));_0x59ca40(_0x30190c);})['catch'](function(_0x2067b1){logger[_0x4820('0x10')]('GetVtigerAccount',_0x2067b1[_0x4820('0x12')],_0x4b2d56);_0x54c09a(_0x46bfde['error'](0x1f4,_0x2067b1['message']));});});};exports[_0x4820('0x1d')]=function(_0x4e119b){var _0x3daa09=this;return new Promise(function(_0x5d42c2,_0x448ee4){return db['VtigerAccount'][_0x4820('0x1e')]({'raw':_0x4e119b[_0x4820('0x16')]?_0x4e119b[_0x4820('0x16')][_0x4820('0x17')]===undefined?!![]:![]:!![],'where':_0x4e119b[_0x4820('0x16')]?_0x4e119b[_0x4820('0x16')][_0x4820('0x1f')]||null:null,'attributes':_0x4e119b[_0x4820('0x16')]?_0x4e119b['options'][_0x4820('0x1b')]||null:null,'include':_0x4e119b[_0x4820('0x16')]?_0x4e119b['options'][_0x4820('0x18')]?_[_0x4820('0x19')](_0x4e119b[_0x4820('0x16')][_0x4820('0x18')],function(_0x4b8f7d){return{'model':db[_0x4b8f7d[_0x4820('0x1a')]],'as':_0x4b8f7d['as'],'attributes':_0x4b8f7d['attributes'],'include':_0x4b8f7d[_0x4820('0x18')]?_['map'](_0x4b8f7d[_0x4820('0x18')],function(_0x3f75a5){return{'model':db[_0x3f75a5[_0x4820('0x1a')]],'as':_0x3f75a5['as'],'attributes':_0x3f75a5[_0x4820('0x1b')],'include':_0x3f75a5[_0x4820('0x18')]?_[_0x4820('0x19')](_0x3f75a5[_0x4820('0x18')],function(_0xbecade){return{'model':db[_0xbecade[_0x4820('0x1a')]],'as':_0xbecade['as'],'attributes':_0xbecade[_0x4820('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x129a34){logger[_0x4820('0xb')]('ShowVtigerAccount',_0x4e119b);logger[_0x4820('0xd')](_0x4820('0x1d'),_0x4e119b,JSON[_0x4820('0x20')](_0x129a34));_0x5d42c2(_0x129a34);})[_0x4820('0x14')](function(_0x365f65){logger[_0x4820('0x10')](_0x4820('0x1d'),_0x365f65[_0x4820('0x12')],_0x4e119b);_0x448ee4(_0x3daa09['error'](0x1f4,_0x365f65[_0x4820('0x12')]));});});}; \ No newline at end of file +var _0x4e65=['../../config/logger','../../config/environment','then','info','debug','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','model','map','find','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3d3db1,_0x2a8226){var _0x34205f=function(_0x3a465d){while(--_0x3a465d){_0x3d3db1['push'](_0x3d3db1['shift']());}};_0x34205f(++_0x2a8226);}(_0x4e65,0x98));var _0x54e6=function(_0x5f27cf,_0x45d8eb){_0x5f27cf=_0x5f27cf-0x0;var _0x15e741=_0x4e65[_0x5f27cf];return _0x15e741;};'use strict';var _=require(_0x54e6('0x0'));var util=require(_0x54e6('0x1'));var moment=require(_0x54e6('0x2'));var BPromise=require(_0x54e6('0x3'));var rs=require(_0x54e6('0x4'));var fs=require('fs');var Redis=require(_0x54e6('0x5'));var db=require(_0x54e6('0x6'))['db'];var utils=require(_0x54e6('0x7'));var logger=require(_0x54e6('0x8'))('rpc');var config=require(_0x54e6('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59dfc3,_0x3224fe,_0x515eec){return new BPromise(function(_0x545f66,_0x347b57){return client['request'](_0x59dfc3,_0x515eec)[_0x54e6('0xa')](function(_0x5ad4a7){logger[_0x54e6('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x3224fe,'request\x20sent');logger[_0x54e6('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x3224fe,_0x54e6('0xd'),JSON[_0x54e6('0xe')](_0x5ad4a7));if(_0x5ad4a7[_0x54e6('0xf')]){if(_0x5ad4a7[_0x54e6('0xf')]['code']===0x1f4){logger['error'](_0x54e6('0x10'),_0x3224fe,_0x5ad4a7['error'][_0x54e6('0x11')]);return _0x347b57(_0x5ad4a7['error']['message']);}logger[_0x54e6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x3224fe,_0x5ad4a7['error'][_0x54e6('0x11')]);return _0x545f66(_0x5ad4a7[_0x54e6('0xf')][_0x54e6('0x11')]);}else{logger[_0x54e6('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x3224fe,_0x54e6('0xd'));_0x545f66(_0x5ad4a7[_0x54e6('0x12')][_0x54e6('0x11')]);}})[_0x54e6('0x13')](function(_0x1302f7){logger[_0x54e6('0xf')](_0x54e6('0x10'),_0x3224fe,_0x1302f7);_0x347b57(_0x1302f7);});});}exports[_0x54e6('0x14')]=function(_0x3f393b){var _0x442aa2=this;return new Promise(function(_0x217908,_0x217b74){return db[_0x54e6('0x15')][_0x54e6('0x16')]({'raw':_0x3f393b[_0x54e6('0x17')]?_0x3f393b[_0x54e6('0x17')][_0x54e6('0x18')]===undefined?!![]:![]:!![],'where':_0x3f393b[_0x54e6('0x17')]?_0x3f393b['options'][_0x54e6('0x19')]||null:null,'attributes':_0x3f393b['options']?_0x3f393b[_0x54e6('0x17')][_0x54e6('0x1a')]||null:null,'limit':_0x3f393b[_0x54e6('0x17')]?_0x3f393b[_0x54e6('0x17')]['limit']||null:null,'include':_0x3f393b[_0x54e6('0x17')]?_0x3f393b[_0x54e6('0x17')][_0x54e6('0x1b')]?_['map'](_0x3f393b[_0x54e6('0x17')][_0x54e6('0x1b')],function(_0x32a140){return{'model':db[_0x32a140[_0x54e6('0x1c')]],'as':_0x32a140['as'],'attributes':_0x32a140[_0x54e6('0x1a')],'include':_0x32a140['include']?_[_0x54e6('0x1d')](_0x32a140[_0x54e6('0x1b')],function(_0x122ccb){return{'model':db[_0x122ccb['model']],'as':_0x122ccb['as'],'attributes':_0x122ccb[_0x54e6('0x1a')],'include':_0x122ccb[_0x54e6('0x1b')]?_[_0x54e6('0x1d')](_0x122ccb[_0x54e6('0x1b')],function(_0x50de1e){return{'model':db[_0x50de1e['model']],'as':_0x50de1e['as'],'attributes':_0x50de1e[_0x54e6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x54e6('0xa')](function(_0x4fb4a0){logger['info'](_0x54e6('0x14'),_0x3f393b);logger[_0x54e6('0xc')]('GetVtigerAccount',_0x3f393b,JSON[_0x54e6('0xe')](_0x4fb4a0));_0x217908(_0x4fb4a0);})[_0x54e6('0x13')](function(_0x108230){logger['error'](_0x54e6('0x14'),_0x108230['message'],_0x3f393b);_0x217b74(_0x442aa2[_0x54e6('0xf')](0x1f4,_0x108230[_0x54e6('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x1f91f2){var _0x5577fc=this;return new Promise(function(_0x5f3783,_0x457df1){return db[_0x54e6('0x15')][_0x54e6('0x1e')]({'raw':_0x1f91f2[_0x54e6('0x17')]?_0x1f91f2[_0x54e6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1f91f2[_0x54e6('0x17')]?_0x1f91f2[_0x54e6('0x17')][_0x54e6('0x19')]||null:null,'attributes':_0x1f91f2[_0x54e6('0x17')]?_0x1f91f2[_0x54e6('0x17')][_0x54e6('0x1a')]||null:null,'include':_0x1f91f2[_0x54e6('0x17')]?_0x1f91f2[_0x54e6('0x17')][_0x54e6('0x1b')]?_['map'](_0x1f91f2[_0x54e6('0x17')]['include'],function(_0x4574af){return{'model':db[_0x4574af[_0x54e6('0x1c')]],'as':_0x4574af['as'],'attributes':_0x4574af[_0x54e6('0x1a')],'include':_0x4574af['include']?_[_0x54e6('0x1d')](_0x4574af['include'],function(_0x4ebb7c){return{'model':db[_0x4ebb7c[_0x54e6('0x1c')]],'as':_0x4ebb7c['as'],'attributes':_0x4ebb7c['attributes'],'include':_0x4ebb7c['include']?_[_0x54e6('0x1d')](_0x4ebb7c[_0x54e6('0x1b')],function(_0x36a3d5){return{'model':db[_0x36a3d5[_0x54e6('0x1c')]],'as':_0x36a3d5['as'],'attributes':_0x36a3d5[_0x54e6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x333f01){logger[_0x54e6('0xb')](_0x54e6('0x1f'),_0x1f91f2);logger[_0x54e6('0xc')](_0x54e6('0x1f'),_0x1f91f2,JSON[_0x54e6('0xe')](_0x333f01));_0x5f3783(_0x333f01);})[_0x54e6('0x13')](function(_0x113c39){logger[_0x54e6('0xf')](_0x54e6('0x1f'),_0x113c39[_0x54e6('0x11')],_0x1f91f2);_0x457df1(_0x5577fc[_0x54e6('0xf')](0x1f4,_0x113c39[_0x54e6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 75e1fba..acc0b5a 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 _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x4deff,_0x42c328){var _0x440123=function(_0x2d7dde){while(--_0x2d7dde){_0x4deff['push'](_0x4deff['shift']());}};_0x440123(++_0x42c328);}(_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 auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file +var _0xb7e7=['create','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xb7e7[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['getSubjects']);router[_0x7b7e('0x6')](_0x7b7e('0xc'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index f30f77d..b3c6225 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 _0x9833=['STRING','exports'];(function(_0x4b1d3a,_0x6be3c1){var _0x17fb04=function(_0x5671ba){while(--_0x5671ba){_0x4b1d3a['push'](_0x4b1d3a['shift']());}};_0x17fb04(++_0x6be3c1);}(_0x9833,0x181));var _0x3983=function(_0x1a8949,_0x325d49){_0x1a8949=_0x1a8949-0x0;var _0x2fcbc7=_0x9833[_0x1a8949];return _0x2fcbc7;};'use strict';var Sequelize=require('sequelize');module[_0x3983('0x0')]={'name':{'type':Sequelize[_0x3983('0x1')]},'description':{'type':Sequelize[_0x3983('0x1')]}}; \ No newline at end of file +var _0x0284=['STRING','sequelize'];(function(_0x32b493,_0x38269a){var _0x426751=function(_0x334e52){while(--_0x334e52){_0x32b493['push'](_0x32b493['shift']());}};_0x426751(++_0x38269a);}(_0x0284,0x121));var _0x4028=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x0284[_0xcd0918];return _0x250704;};'use strict';var Sequelize=require(_0x4028('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4028('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 92a6e17..81631ae 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 _0x22b5=['keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','sort','where','filter','merge','key','VIRTUAL','options','count','include','rows','catch','show','includeAll','find','create','body','params','findOne','VtigerField','order','pick','map','nolimit','getFields','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','VtigerConfiguration','rawAttributes','model'];(function(_0x24cfe0,_0x2eb5ec){var _0x22942b=function(_0x6eafde){while(--_0x6eafde){_0x24cfe0['push'](_0x24cfe0['shift']());}};_0x22942b(++_0x2eb5ec);}(_0x22b5,0x7c));var _0x522b=function(_0x3be134,_0x35f628){_0x3be134=_0x3be134-0x0;var _0x262c0d=_0x22b5[_0x3be134];return _0x262c0d;};'use strict';var pdf=require(_0x522b('0x0'));var emlformat=require(_0x522b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x522b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x522b('0x3'));var moment=require(_0x522b('0x4'));var BPromise=require(_0x522b('0x5'));var Mustache=require(_0x522b('0x6'));var util=require(_0x522b('0x7'));var path=require(_0x522b('0x8'));var sox=require(_0x522b('0x9'));var csv=require(_0x522b('0xa'));var ejs=require(_0x522b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x522b('0xc'));var deskjs=require(_0x522b('0xd'));var toCsv=require(_0x522b('0xa'));var querystring=require(_0x522b('0xe'));var Papa=require(_0x522b('0xf'));var Redis=require(_0x522b('0x10'));var authService=require(_0x522b('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x522b('0x12'));var logger=require(_0x522b('0x13'))(_0x522b('0x14'));var utils=require(_0x522b('0x15'));var config=require(_0x522b('0x16'));var db=require(_0x522b('0x17'))['db'];var jayson=require(_0x522b('0x18'));var client=jayson[_0x522b('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x14a133,_0x5547af,_0x55abb8){if(_0x55abb8){var _0x36312c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36312c[_0x522b('0x1a')](_0x5547af)){return _0x14a133;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x14a133;}}function respondWithRpcPromise(_0x1655e4,_0x5cf9fd,_0x46ac31,_0x46cb4f){return new BPromise(function(_0x341f22,_0x3cd4e8){var _0x5e5247=_0x46cb4f||client;return _0x5e5247[_0x522b('0x1b')](_0x1655e4,_0x46ac31)[_0x522b('0x1c')](function(_0x496c1a){logger[_0x522b('0x1d')](_0x522b('0x1e'),_0x5cf9fd,_0x522b('0x1f'));logger[_0x522b('0x20')](_0x522b('0x21'),_0x5cf9fd,_0x522b('0x1f'),JSON[_0x522b('0x22')](_0x496c1a));if(_0x496c1a[_0x522b('0x23')]){if(_0x496c1a['error']['code']===0x1f4){logger[_0x522b('0x23')](_0x522b('0x1e'),_0x5cf9fd,_0x496c1a[_0x522b('0x23')][_0x522b('0x24')]);return _0x3cd4e8(_0x496c1a[_0x522b('0x23')][_0x522b('0x24')]);}logger['error'](_0x522b('0x1e'),_0x5cf9fd,_0x496c1a[_0x522b('0x23')][_0x522b('0x24')]);return _0x341f22(_0x496c1a[_0x522b('0x23')][_0x522b('0x24')]);}else{logger[_0x522b('0x1d')]('VtigerConfiguration,\x20%s,\x20%s',_0x5cf9fd,_0x522b('0x1f'));_0x341f22(_0x496c1a[_0x522b('0x25')]['message']);}})['catch'](function(_0x561f0c){logger['error'](_0x522b('0x1e'),_0x5cf9fd,_0x561f0c);_0x3cd4e8(_0x561f0c);});});}function respondWithStatusCode(_0x10189a,_0x5bfc1a){_0x5bfc1a=_0x5bfc1a||0xcc;return function(_0x47b8fa){if(_0x47b8fa){return _0x10189a['sendStatus'](_0x5bfc1a);}return _0x10189a[_0x522b('0x26')](_0x5bfc1a)[_0x522b('0x27')]();};}function respondWithResult(_0x3d4373,_0x2cad73){_0x2cad73=_0x2cad73||0xc8;return function(_0x1673f4){if(_0x1673f4){return _0x3d4373[_0x522b('0x26')](_0x2cad73)['json'](_0x1673f4);}};}function respondWithFilteredResult(_0x5903d5,_0x574c27){return function(_0xd4b4c7){if(_0xd4b4c7){var _0x3b5795=_0xd4b4c7['count'],_0x5d5705=_0x574c27[_0x522b('0x28')],_0x18f0af=_0x574c27[_0x522b('0x28')]+_0x574c27[_0x522b('0x29')],_0x3fe8ae;if(_0x18f0af>=_0x3b5795){_0x18f0af=_0x3b5795;_0x3fe8ae=0xc8;}else{_0x3fe8ae=0xce;}_0x5903d5[_0x522b('0x26')](_0x3fe8ae);return _0x5903d5[_0x522b('0x2a')]('Content-Range',_0x5d5705+'-'+_0x18f0af+'/'+_0x3b5795)['json'](_0xd4b4c7);}return null;};}function patchUpdates(_0x464155){return function(_0x51922a){try{jsonpatch[_0x522b('0x2b')](_0x51922a,_0x464155,!![]);}catch(_0x22a057){return BPromise[_0x522b('0x2c')](_0x22a057);}return _0x51922a[_0x522b('0x2d')]();};}function saveUpdates(_0x515588,_0x44ef98){return function(_0x5e3495){if(_0x5e3495){return _0x5e3495[_0x522b('0x2e')](_0x515588)[_0x522b('0x1c')](function(_0x28c847){return _0x28c847;});}return null;};}function removeEntity(_0x23577e,_0x280e41){return function(_0xf1862c){if(_0xf1862c){return _0xf1862c[_0x522b('0x2f')]()[_0x522b('0x1c')](function(){_0x23577e[_0x522b('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4372,_0x1ddba3){return function(_0x503fe8){if(!_0x503fe8){_0x5e4372[_0x522b('0x30')](0x194);}return _0x503fe8;};}function handleError(_0x157adf,_0x2ba63b){_0x2ba63b=_0x2ba63b||0x1f4;return function(_0x57902f){logger[_0x522b('0x23')](_0x57902f[_0x522b('0x31')]);if(_0x57902f[_0x522b('0x32')]){delete _0x57902f['name'];}_0x157adf[_0x522b('0x26')](_0x2ba63b)[_0x522b('0x33')](_0x57902f);};}exports[_0x522b('0x34')]=function(_0x5d6276,_0x54a300){var _0x285e31={},_0x29877f={},_0x15ca76={'count':0x0,'rows':[]};var _0x143db4=db[_0x522b('0x35')][_0x522b('0x36')];_0x29877f[_0x522b('0x37')]=_['keys'](_0x143db4);_0x29877f['query']=_[_0x522b('0x38')](_0x5d6276['query']);_0x29877f[_0x522b('0x39')]=_[_0x522b('0x3a')](_0x29877f[_0x522b('0x37')],_0x29877f['query']);_0x285e31[_0x522b('0x3b')]=_[_0x522b('0x3a')](_0x29877f[_0x522b('0x37')],qs[_0x522b('0x3c')](_0x5d6276[_0x522b('0x3d')]['fields']));_0x285e31[_0x522b('0x3b')]=_0x285e31[_0x522b('0x3b')][_0x522b('0x3e')]?_0x285e31['attributes']:_0x29877f[_0x522b('0x37')];if(!_0x5d6276[_0x522b('0x3d')][_0x522b('0x3f')]('nolimit')){_0x285e31[_0x522b('0x29')]=qs[_0x522b('0x29')](_0x5d6276[_0x522b('0x3d')]['limit']);_0x285e31[_0x522b('0x28')]=qs[_0x522b('0x28')](_0x5d6276[_0x522b('0x3d')]['offset']);}_0x285e31['order']=qs[_0x522b('0x40')](_0x5d6276['query'][_0x522b('0x40')]);_0x285e31[_0x522b('0x41')]=qs[_0x522b('0x39')](_['pick'](_0x5d6276[_0x522b('0x3d')],_0x29877f['filters']));if(_0x5d6276['query'][_0x522b('0x42')]){_0x285e31[_0x522b('0x41')]=_[_0x522b('0x43')](_0x285e31[_0x522b('0x41')],{'$or':_['map'](_0x143db4,function(_0x4af40f){if(_0x4af40f['type'][_0x522b('0x44')]!==_0x522b('0x45')){var _0x2a5c88={};_0x2a5c88[_0x4af40f['field']]={'$like':'%'+_0x5d6276[_0x522b('0x3d')]['filter']+'%'};return _0x2a5c88;}})});}_0x285e31=_[_0x522b('0x43')]({},_0x285e31,_0x5d6276[_0x522b('0x46')]);var _0x51d03a={'where':_0x285e31[_0x522b('0x41')]};return db['VtigerConfiguration'][_0x522b('0x47')](_0x51d03a)[_0x522b('0x1c')](function(_0x2cba7e){_0x15ca76['count']=_0x2cba7e;if(_0x5d6276[_0x522b('0x3d')]['includeAll']){_0x285e31[_0x522b('0x48')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x285e31);})[_0x522b('0x1c')](function(_0x15a522){_0x15ca76[_0x522b('0x49')]=_0x15a522;return _0x15ca76;})[_0x522b('0x1c')](respondWithFilteredResult(_0x54a300,_0x285e31))[_0x522b('0x4a')](handleError(_0x54a300,null));};exports[_0x522b('0x4b')]=function(_0x339637,_0x176560){var _0x313ff1={'raw':![],'where':{'id':_0x339637['params']['id']}},_0x2f492f={};_0x2f492f[_0x522b('0x37')]=_['keys'](db[_0x522b('0x35')]['rawAttributes']);_0x2f492f[_0x522b('0x3d')]=_[_0x522b('0x38')](_0x339637[_0x522b('0x3d')]);_0x2f492f[_0x522b('0x39')]=_['intersection'](_0x2f492f[_0x522b('0x37')],_0x2f492f['query']);_0x313ff1[_0x522b('0x3b')]=_[_0x522b('0x3a')](_0x2f492f['model'],qs[_0x522b('0x3c')](_0x339637[_0x522b('0x3d')][_0x522b('0x3c')]));_0x313ff1[_0x522b('0x3b')]=_0x313ff1[_0x522b('0x3b')][_0x522b('0x3e')]?_0x313ff1[_0x522b('0x3b')]:_0x2f492f[_0x522b('0x37')];if(_0x339637['query'][_0x522b('0x4c')]){_0x313ff1[_0x522b('0x48')]=[{'all':!![]}];}_0x313ff1=_[_0x522b('0x43')]({},_0x313ff1,_0x339637[_0x522b('0x46')]);return db[_0x522b('0x35')][_0x522b('0x4d')](_0x313ff1)[_0x522b('0x1c')](handleEntityNotFound(_0x176560,null))[_0x522b('0x1c')](respondWithResult(_0x176560,null))['catch'](handleError(_0x176560,null));};exports[_0x522b('0x4e')]=function(_0x311cb8,_0x460d2e){return db['VtigerConfiguration'][_0x522b('0x4e')](_0x311cb8[_0x522b('0x4f')],{})[_0x522b('0x1c')](respondWithResult(_0x460d2e,0xc9))[_0x522b('0x4a')](handleError(_0x460d2e,null));};exports[_0x522b('0x2e')]=function(_0x160ede,_0x121a5a){if(_0x160ede[_0x522b('0x4f')]['id']){delete _0x160ede[_0x522b('0x4f')]['id'];}return db[_0x522b('0x35')][_0x522b('0x4d')]({'where':{'id':_0x160ede[_0x522b('0x50')]['id']}})[_0x522b('0x1c')](handleEntityNotFound(_0x121a5a,null))[_0x522b('0x1c')](saveUpdates(_0x160ede[_0x522b('0x4f')],null))['then'](respondWithResult(_0x121a5a,null))[_0x522b('0x4a')](handleError(_0x121a5a,null));};exports[_0x522b('0x2f')]=function(_0x38c2ec,_0x83915){return db[_0x522b('0x35')][_0x522b('0x4d')]({'where':{'id':_0x38c2ec[_0x522b('0x50')]['id']}})[_0x522b('0x1c')](handleEntityNotFound(_0x83915,null))['then'](removeEntity(_0x83915,null))[_0x522b('0x4a')](handleError(_0x83915,null));};exports['getFields']=function(_0x2e0804,_0x3b9662,_0x163d30){var _0x46bdec={};var _0x461c0c={};var _0x4c92d5;var _0x3661f9;return db[_0x522b('0x35')][_0x522b('0x51')]({'where':{'id':_0x2e0804[_0x522b('0x50')]['id']}})[_0x522b('0x1c')](handleEntityNotFound(_0x3b9662,null))['then'](function(_0x463b84){if(_0x463b84){_0x4c92d5=_0x463b84;_0x461c0c[_0x522b('0x37')]=_[_0x522b('0x38')](db[_0x522b('0x52')]['rawAttributes']);_0x461c0c[_0x522b('0x3d')]=_['keys'](_0x2e0804[_0x522b('0x3d')]);_0x461c0c[_0x522b('0x39')]=_[_0x522b('0x3a')](_0x461c0c[_0x522b('0x37')],_0x461c0c[_0x522b('0x3d')]);_0x46bdec[_0x522b('0x3b')]=_['intersection'](_0x461c0c[_0x522b('0x37')],qs[_0x522b('0x3c')](_0x2e0804[_0x522b('0x3d')][_0x522b('0x3c')]));_0x46bdec['attributes']=_0x46bdec[_0x522b('0x3b')][_0x522b('0x3e')]?_0x46bdec['attributes']:_0x461c0c[_0x522b('0x37')];_0x46bdec[_0x522b('0x53')]=qs[_0x522b('0x40')](_0x2e0804['query'][_0x522b('0x40')]);_0x46bdec[_0x522b('0x41')]=qs[_0x522b('0x39')](_[_0x522b('0x54')](_0x2e0804['query'],_0x461c0c[_0x522b('0x39')]));if(_0x2e0804['query']['filter']){_0x46bdec[_0x522b('0x41')]=_[_0x522b('0x43')](_0x46bdec[_0x522b('0x41')],{'$or':_[_0x522b('0x55')](_0x46bdec[_0x522b('0x3b')],function(_0x2530ed){var _0x3b611a={};_0x3b611a[_0x2530ed]={'$like':'%'+_0x2e0804[_0x522b('0x3d')][_0x522b('0x42')]+'%'};return _0x3b611a;})});}_0x46bdec=_['merge']({},_0x46bdec,_0x2e0804[_0x522b('0x46')]);return _0x4c92d5['getFields'](_0x46bdec);}})[_0x522b('0x1c')](function(_0x13a5df){if(_0x13a5df){_0x3661f9=_0x13a5df['length'];if(!_0x2e0804[_0x522b('0x3d')][_0x522b('0x3f')](_0x522b('0x56'))){_0x46bdec['limit']=qs[_0x522b('0x29')](_0x2e0804[_0x522b('0x3d')][_0x522b('0x29')]);_0x46bdec[_0x522b('0x28')]=qs['offset'](_0x2e0804[_0x522b('0x3d')][_0x522b('0x28')]);}return _0x4c92d5[_0x522b('0x57')](_0x46bdec);}})[_0x522b('0x1c')](function(_0x352fe6){if(_0x352fe6){return _0x352fe6?{'count':_0x3661f9,'rows':_0x352fe6}:null;}})[_0x522b('0x1c')](respondWithResult(_0x3b9662,null))['catch'](handleError(_0x3b9662,null));};exports[_0x522b('0x58')]=function(_0x4f8e48,_0xe0a597,_0xd1465f){var _0x1f7f61={};var _0x1df17f={};var _0x43d81a;var _0x156381;return db[_0x522b('0x35')][_0x522b('0x51')]({'where':{'id':_0x4f8e48[_0x522b('0x50')]['id']}})[_0x522b('0x1c')](handleEntityNotFound(_0xe0a597,null))[_0x522b('0x1c')](function(_0x10a1b1){if(_0x10a1b1){_0x43d81a=_0x10a1b1;_0x1df17f[_0x522b('0x37')]=_[_0x522b('0x38')](db[_0x522b('0x52')][_0x522b('0x36')]);_0x1df17f[_0x522b('0x3d')]=_[_0x522b('0x38')](_0x4f8e48[_0x522b('0x3d')]);_0x1df17f[_0x522b('0x39')]=_[_0x522b('0x3a')](_0x1df17f[_0x522b('0x37')],_0x1df17f[_0x522b('0x3d')]);_0x1f7f61[_0x522b('0x3b')]=_[_0x522b('0x3a')](_0x1df17f['model'],qs[_0x522b('0x3c')](_0x4f8e48['query'][_0x522b('0x3c')]));_0x1f7f61['attributes']=_0x1f7f61[_0x522b('0x3b')][_0x522b('0x3e')]?_0x1f7f61['attributes']:_0x1df17f[_0x522b('0x37')];_0x1f7f61[_0x522b('0x53')]=qs[_0x522b('0x40')](_0x4f8e48[_0x522b('0x3d')][_0x522b('0x40')]);_0x1f7f61['where']=qs[_0x522b('0x39')](_[_0x522b('0x54')](_0x4f8e48[_0x522b('0x3d')],_0x1df17f[_0x522b('0x39')]));if(_0x4f8e48['query']['filter']){_0x1f7f61[_0x522b('0x41')]=_['merge'](_0x1f7f61[_0x522b('0x41')],{'$or':_[_0x522b('0x55')](_0x1f7f61[_0x522b('0x3b')],function(_0x51be9a){var _0x14f163={};_0x14f163[_0x51be9a]={'$like':'%'+_0x4f8e48['query'][_0x522b('0x42')]+'%'};return _0x14f163;})});}_0x1f7f61=_[_0x522b('0x43')]({},_0x1f7f61,_0x4f8e48[_0x522b('0x46')]);return _0x43d81a[_0x522b('0x58')](_0x1f7f61);}})[_0x522b('0x1c')](function(_0x6654ae){if(_0x6654ae){_0x156381=_0x6654ae['length'];if(!_0x4f8e48[_0x522b('0x3d')][_0x522b('0x3f')](_0x522b('0x56'))){_0x1f7f61['limit']=qs[_0x522b('0x29')](_0x4f8e48[_0x522b('0x3d')][_0x522b('0x29')]);_0x1f7f61[_0x522b('0x28')]=qs[_0x522b('0x28')](_0x4f8e48[_0x522b('0x3d')][_0x522b('0x28')]);}return _0x43d81a[_0x522b('0x58')](_0x1f7f61);}})[_0x522b('0x1c')](function(_0x2b18bc){if(_0x2b18bc){return _0x2b18bc?{'count':_0x156381,'rows':_0x2b18bc}:null;}})[_0x522b('0x1c')](respondWithResult(_0xe0a597,null))[_0x522b('0x4a')](handleError(_0xe0a597,null));};exports[_0x522b('0x59')]=function(_0x5c4164,_0x366bc7,_0x67ff77){var _0x278708={};var _0x4da001={};var _0x4e9eb7;var _0x195df9;return db[_0x522b('0x35')][_0x522b('0x51')]({'where':{'id':_0x5c4164[_0x522b('0x50')]['id']}})[_0x522b('0x1c')](handleEntityNotFound(_0x366bc7,null))[_0x522b('0x1c')](function(_0x426498){if(_0x426498){_0x4e9eb7=_0x426498;_0x4da001[_0x522b('0x37')]=_['keys'](db[_0x522b('0x52')]['rawAttributes']);_0x4da001['query']=_['keys'](_0x5c4164[_0x522b('0x3d')]);_0x4da001[_0x522b('0x39')]=_[_0x522b('0x3a')](_0x4da001['model'],_0x4da001[_0x522b('0x3d')]);_0x278708[_0x522b('0x3b')]=_[_0x522b('0x3a')](_0x4da001[_0x522b('0x37')],qs[_0x522b('0x3c')](_0x5c4164['query'][_0x522b('0x3c')]));_0x278708[_0x522b('0x3b')]=_0x278708[_0x522b('0x3b')][_0x522b('0x3e')]?_0x278708['attributes']:_0x4da001[_0x522b('0x37')];_0x278708[_0x522b('0x53')]=qs[_0x522b('0x40')](_0x5c4164[_0x522b('0x3d')]['sort']);_0x278708['where']=qs[_0x522b('0x39')](_[_0x522b('0x54')](_0x5c4164['query'],_0x4da001[_0x522b('0x39')]));if(_0x5c4164[_0x522b('0x3d')]['filter']){_0x278708[_0x522b('0x41')]=_[_0x522b('0x43')](_0x278708['where'],{'$or':_[_0x522b('0x55')](_0x278708[_0x522b('0x3b')],function(_0x515bc8){var _0x1b0893={};_0x1b0893[_0x515bc8]={'$like':'%'+_0x5c4164[_0x522b('0x3d')][_0x522b('0x42')]+'%'};return _0x1b0893;})});}_0x278708=_[_0x522b('0x43')]({},_0x278708,_0x5c4164[_0x522b('0x46')]);return _0x4e9eb7[_0x522b('0x59')](_0x278708);}})[_0x522b('0x1c')](function(_0x150830){if(_0x150830){_0x195df9=_0x150830['length'];if(!_0x5c4164['query']['hasOwnProperty'](_0x522b('0x56'))){_0x278708[_0x522b('0x29')]=qs[_0x522b('0x29')](_0x5c4164['query'][_0x522b('0x29')]);_0x278708[_0x522b('0x28')]=qs[_0x522b('0x28')](_0x5c4164['query'][_0x522b('0x28')]);}return _0x4e9eb7['getDescriptions'](_0x278708);}})[_0x522b('0x1c')](function(_0x27942e){if(_0x27942e){return _0x27942e?{'count':_0x195df9,'rows':_0x27942e}:null;}})[_0x522b('0x1c')](respondWithResult(_0x366bc7,null))[_0x522b('0x4a')](handleError(_0x366bc7,null));}; \ No newline at end of file +var _0x1b47=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','count','offset','apply','reject','update','destroy','end','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','limit','sort','where','pick','filter','merge','map','type','key','field','findAll','params','VtigerConfiguration','includeAll','include','options','find','create','body','getFields','findOne','VtigerField','order','hasOwnProperty','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring'];(function(_0x9b6a52,_0x3cb0ab){var _0x5c5c6f=function(_0x439987){while(--_0x439987){_0x9b6a52['push'](_0x9b6a52['shift']());}};_0x5c5c6f(++_0x3cb0ab);}(_0x1b47,0xfa));var _0x71b4=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0x1b47[_0x547add];return _0x2ed1f3;};'use strict';var pdf=require(_0x71b4('0x0'));var emlformat=require(_0x71b4('0x1'));var rimraf=require(_0x71b4('0x2'));var zipdir=require(_0x71b4('0x3'));var jsonpatch=require(_0x71b4('0x4'));var rp=require(_0x71b4('0x5'));var moment=require(_0x71b4('0x6'));var BPromise=require(_0x71b4('0x7'));var Mustache=require('mustache');var util=require(_0x71b4('0x8'));var path=require(_0x71b4('0x9'));var sox=require(_0x71b4('0xa'));var csv=require(_0x71b4('0xb'));var ejs=require(_0x71b4('0xc'));var fs=require('fs');var _=require(_0x71b4('0xd'));var squel=require(_0x71b4('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x71b4('0xf'));var toCsv=require(_0x71b4('0xb'));var querystring=require(_0x71b4('0x10'));var Papa=require(_0x71b4('0x11'));var Redis=require('ioredis');var authService=require(_0x71b4('0x12'));var qs=require(_0x71b4('0x13'));var hardwareService=require(_0x71b4('0x14'));var logger=require(_0x71b4('0x15'))('api');var utils=require(_0x71b4('0x16'));var config=require(_0x71b4('0x17'));var db=require(_0x71b4('0x18'))['db'];var jayson=require(_0x71b4('0x19'));var client=jayson[_0x71b4('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x3fcebe,_0x55cf45,_0x4ff0de){if(_0x4ff0de){var _0x17c7a4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17c7a4['test'](_0x55cf45)){return _0x3fcebe;}else{throw new Error(_0x71b4('0x1b'));}}else{return _0x3fcebe;}}function respondWithRpcPromise(_0x4f68f6,_0xfb65d5,_0x24fbfa,_0x348fd2){return new BPromise(function(_0x754973,_0x443624){var _0x1999dd=_0x348fd2||client;return _0x1999dd[_0x71b4('0x1c')](_0x4f68f6,_0x24fbfa)[_0x71b4('0x1d')](function(_0x2f1807){logger[_0x71b4('0x1e')](_0x71b4('0x1f'),_0xfb65d5,_0x71b4('0x20'));logger[_0x71b4('0x21')](_0x71b4('0x22'),_0xfb65d5,_0x71b4('0x20'),JSON[_0x71b4('0x23')](_0x2f1807));if(_0x2f1807[_0x71b4('0x24')]){if(_0x2f1807['error'][_0x71b4('0x25')]===0x1f4){logger['error'](_0x71b4('0x1f'),_0xfb65d5,_0x2f1807[_0x71b4('0x24')][_0x71b4('0x26')]);return _0x443624(_0x2f1807['error'][_0x71b4('0x26')]);}logger[_0x71b4('0x24')](_0x71b4('0x1f'),_0xfb65d5,_0x2f1807['error'][_0x71b4('0x26')]);return _0x754973(_0x2f1807[_0x71b4('0x24')][_0x71b4('0x26')]);}else{logger[_0x71b4('0x1e')](_0x71b4('0x1f'),_0xfb65d5,_0x71b4('0x20'));_0x754973(_0x2f1807['result'][_0x71b4('0x26')]);}})[_0x71b4('0x27')](function(_0x761893){logger['error'](_0x71b4('0x1f'),_0xfb65d5,_0x761893);_0x443624(_0x761893);});});}function respondWithStatusCode(_0x573ece,_0x182c3f){_0x182c3f=_0x182c3f||0xcc;return function(_0x268b57){if(_0x268b57){return _0x573ece[_0x71b4('0x28')](_0x182c3f);}return _0x573ece[_0x71b4('0x29')](_0x182c3f)['end']();};}function respondWithResult(_0x4763fc,_0x81b0f8){_0x81b0f8=_0x81b0f8||0xc8;return function(_0x1bdd46){if(_0x1bdd46){return _0x4763fc[_0x71b4('0x29')](_0x81b0f8)[_0x71b4('0x2a')](_0x1bdd46);}};}function respondWithFilteredResult(_0x6554a3,_0x49152f){return function(_0x5f0c3d){if(_0x5f0c3d){var _0x5ab1c9=_0x5f0c3d[_0x71b4('0x2b')],_0x399e84=_0x49152f[_0x71b4('0x2c')],_0x3862f9=_0x49152f[_0x71b4('0x2c')]+_0x49152f['limit'],_0x2d7ab8;if(_0x3862f9>=_0x5ab1c9){_0x3862f9=_0x5ab1c9;_0x2d7ab8=0xc8;}else{_0x2d7ab8=0xce;}_0x6554a3[_0x71b4('0x29')](_0x2d7ab8);return _0x6554a3['set']('Content-Range',_0x399e84+'-'+_0x3862f9+'/'+_0x5ab1c9)[_0x71b4('0x2a')](_0x5f0c3d);}return null;};}function patchUpdates(_0x1fc76b){return function(_0x231ce6){try{jsonpatch[_0x71b4('0x2d')](_0x231ce6,_0x1fc76b,!![]);}catch(_0x19ea2a){return BPromise[_0x71b4('0x2e')](_0x19ea2a);}return _0x231ce6['save']();};}function saveUpdates(_0x352079,_0x1d1807){return function(_0xced4cb){if(_0xced4cb){return _0xced4cb[_0x71b4('0x2f')](_0x352079)[_0x71b4('0x1d')](function(_0x4fc9bb){return _0x4fc9bb;});}return null;};}function removeEntity(_0x2992f5,_0xc59f65){return function(_0x4b2af9){if(_0x4b2af9){return _0x4b2af9[_0x71b4('0x30')]()[_0x71b4('0x1d')](function(){_0x2992f5['status'](0xcc)[_0x71b4('0x31')]();});}};}function handleEntityNotFound(_0x14d535,_0x11f918){return function(_0x18bda1){if(!_0x18bda1){_0x14d535[_0x71b4('0x28')](0x194);}return _0x18bda1;};}function handleError(_0xd6bf43,_0x579e5d){_0x579e5d=_0x579e5d||0x1f4;return function(_0x8fb6f){logger[_0x71b4('0x24')](_0x8fb6f[_0x71b4('0x32')]);if(_0x8fb6f[_0x71b4('0x33')]){delete _0x8fb6f[_0x71b4('0x33')];}_0xd6bf43[_0x71b4('0x29')](_0x579e5d)[_0x71b4('0x34')](_0x8fb6f);};}exports['index']=function(_0x56cfcf,_0x70364c){var _0x7f86b7={},_0x326bbd={},_0x4172bd={'count':0x0,'rows':[]};var _0x329ae1=db['VtigerConfiguration'][_0x71b4('0x35')];_0x326bbd[_0x71b4('0x36')]=_[_0x71b4('0x37')](_0x329ae1);_0x326bbd[_0x71b4('0x38')]=_[_0x71b4('0x37')](_0x56cfcf['query']);_0x326bbd[_0x71b4('0x39')]=_['intersection'](_0x326bbd[_0x71b4('0x36')],_0x326bbd[_0x71b4('0x38')]);_0x7f86b7['attributes']=_[_0x71b4('0x3a')](_0x326bbd['model'],qs['fields'](_0x56cfcf['query'][_0x71b4('0x3b')]));_0x7f86b7[_0x71b4('0x3c')]=_0x7f86b7[_0x71b4('0x3c')][_0x71b4('0x3d')]?_0x7f86b7[_0x71b4('0x3c')]:_0x326bbd[_0x71b4('0x36')];if(!_0x56cfcf[_0x71b4('0x38')]['hasOwnProperty']('nolimit')){_0x7f86b7[_0x71b4('0x3e')]=qs['limit'](_0x56cfcf['query']['limit']);_0x7f86b7[_0x71b4('0x2c')]=qs[_0x71b4('0x2c')](_0x56cfcf[_0x71b4('0x38')]['offset']);}_0x7f86b7['order']=qs[_0x71b4('0x3f')](_0x56cfcf[_0x71b4('0x38')][_0x71b4('0x3f')]);_0x7f86b7[_0x71b4('0x40')]=qs[_0x71b4('0x39')](_[_0x71b4('0x41')](_0x56cfcf[_0x71b4('0x38')],_0x326bbd[_0x71b4('0x39')]));if(_0x56cfcf['query'][_0x71b4('0x42')]){_0x7f86b7[_0x71b4('0x40')]=_[_0x71b4('0x43')](_0x7f86b7[_0x71b4('0x40')],{'$or':_[_0x71b4('0x44')](_0x329ae1,function(_0x12a7b4){if(_0x12a7b4[_0x71b4('0x45')][_0x71b4('0x46')]!=='VIRTUAL'){var _0x4510ec={};_0x4510ec[_0x12a7b4[_0x71b4('0x47')]]={'$like':'%'+_0x56cfcf[_0x71b4('0x38')][_0x71b4('0x42')]+'%'};return _0x4510ec;}})});}_0x7f86b7=_[_0x71b4('0x43')]({},_0x7f86b7,_0x56cfcf['options']);var _0x37ba0f={'where':_0x7f86b7[_0x71b4('0x40')]};return db['VtigerConfiguration'][_0x71b4('0x2b')](_0x37ba0f)[_0x71b4('0x1d')](function(_0x35d528){_0x4172bd[_0x71b4('0x2b')]=_0x35d528;if(_0x56cfcf[_0x71b4('0x38')]['includeAll']){_0x7f86b7['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x71b4('0x48')](_0x7f86b7);})[_0x71b4('0x1d')](function(_0x3b23ab){_0x4172bd['rows']=_0x3b23ab;return _0x4172bd;})[_0x71b4('0x1d')](respondWithFilteredResult(_0x70364c,_0x7f86b7))[_0x71b4('0x27')](handleError(_0x70364c,null));};exports['show']=function(_0x42159f,_0x419104){var _0x277e9f={'raw':![],'where':{'id':_0x42159f[_0x71b4('0x49')]['id']}},_0x57a062={};_0x57a062[_0x71b4('0x36')]=_['keys'](db[_0x71b4('0x4a')][_0x71b4('0x35')]);_0x57a062[_0x71b4('0x38')]=_[_0x71b4('0x37')](_0x42159f[_0x71b4('0x38')]);_0x57a062[_0x71b4('0x39')]=_[_0x71b4('0x3a')](_0x57a062['model'],_0x57a062['query']);_0x277e9f['attributes']=_['intersection'](_0x57a062['model'],qs[_0x71b4('0x3b')](_0x42159f[_0x71b4('0x38')][_0x71b4('0x3b')]));_0x277e9f['attributes']=_0x277e9f[_0x71b4('0x3c')][_0x71b4('0x3d')]?_0x277e9f[_0x71b4('0x3c')]:_0x57a062[_0x71b4('0x36')];if(_0x42159f[_0x71b4('0x38')][_0x71b4('0x4b')]){_0x277e9f[_0x71b4('0x4c')]=[{'all':!![]}];}_0x277e9f=_[_0x71b4('0x43')]({},_0x277e9f,_0x42159f[_0x71b4('0x4d')]);return db[_0x71b4('0x4a')][_0x71b4('0x4e')](_0x277e9f)[_0x71b4('0x1d')](handleEntityNotFound(_0x419104,null))['then'](respondWithResult(_0x419104,null))[_0x71b4('0x27')](handleError(_0x419104,null));};exports[_0x71b4('0x4f')]=function(_0x57a1be,_0x38f2de){return db['VtigerConfiguration'][_0x71b4('0x4f')](_0x57a1be['body'],{})[_0x71b4('0x1d')](respondWithResult(_0x38f2de,0xc9))[_0x71b4('0x27')](handleError(_0x38f2de,null));};exports[_0x71b4('0x2f')]=function(_0x39c828,_0x26dd8f){if(_0x39c828[_0x71b4('0x50')]['id']){delete _0x39c828['body']['id'];}return db[_0x71b4('0x4a')][_0x71b4('0x4e')]({'where':{'id':_0x39c828[_0x71b4('0x49')]['id']}})[_0x71b4('0x1d')](handleEntityNotFound(_0x26dd8f,null))[_0x71b4('0x1d')](saveUpdates(_0x39c828[_0x71b4('0x50')],null))[_0x71b4('0x1d')](respondWithResult(_0x26dd8f,null))['catch'](handleError(_0x26dd8f,null));};exports[_0x71b4('0x30')]=function(_0x216a0a,_0x3ca502){return db['VtigerConfiguration']['find']({'where':{'id':_0x216a0a['params']['id']}})[_0x71b4('0x1d')](handleEntityNotFound(_0x3ca502,null))['then'](removeEntity(_0x3ca502,null))['catch'](handleError(_0x3ca502,null));};exports[_0x71b4('0x51')]=function(_0x75b637,_0x31dd19,_0x1bf553){var _0x2b4160={};var _0x5df85b={};var _0x2e5285;var _0x311ae9;return db['VtigerConfiguration'][_0x71b4('0x52')]({'where':{'id':_0x75b637[_0x71b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x31dd19,null))[_0x71b4('0x1d')](function(_0x59ae34){if(_0x59ae34){_0x2e5285=_0x59ae34;_0x5df85b[_0x71b4('0x36')]=_['keys'](db[_0x71b4('0x53')]['rawAttributes']);_0x5df85b[_0x71b4('0x38')]=_['keys'](_0x75b637[_0x71b4('0x38')]);_0x5df85b[_0x71b4('0x39')]=_['intersection'](_0x5df85b[_0x71b4('0x36')],_0x5df85b[_0x71b4('0x38')]);_0x2b4160[_0x71b4('0x3c')]=_[_0x71b4('0x3a')](_0x5df85b['model'],qs[_0x71b4('0x3b')](_0x75b637[_0x71b4('0x38')][_0x71b4('0x3b')]));_0x2b4160[_0x71b4('0x3c')]=_0x2b4160[_0x71b4('0x3c')][_0x71b4('0x3d')]?_0x2b4160[_0x71b4('0x3c')]:_0x5df85b[_0x71b4('0x36')];_0x2b4160[_0x71b4('0x54')]=qs[_0x71b4('0x3f')](_0x75b637[_0x71b4('0x38')][_0x71b4('0x3f')]);_0x2b4160[_0x71b4('0x40')]=qs[_0x71b4('0x39')](_[_0x71b4('0x41')](_0x75b637[_0x71b4('0x38')],_0x5df85b['filters']));if(_0x75b637['query']['filter']){_0x2b4160[_0x71b4('0x40')]=_[_0x71b4('0x43')](_0x2b4160[_0x71b4('0x40')],{'$or':_[_0x71b4('0x44')](_0x2b4160[_0x71b4('0x3c')],function(_0x45a587){var _0x151446={};_0x151446[_0x45a587]={'$like':'%'+_0x75b637['query']['filter']+'%'};return _0x151446;})});}_0x2b4160=_[_0x71b4('0x43')]({},_0x2b4160,_0x75b637[_0x71b4('0x4d')]);return _0x2e5285[_0x71b4('0x51')](_0x2b4160);}})['then'](function(_0x3fb4f9){if(_0x3fb4f9){_0x311ae9=_0x3fb4f9[_0x71b4('0x3d')];if(!_0x75b637['query'][_0x71b4('0x55')](_0x71b4('0x56'))){_0x2b4160[_0x71b4('0x3e')]=qs[_0x71b4('0x3e')](_0x75b637['query'][_0x71b4('0x3e')]);_0x2b4160[_0x71b4('0x2c')]=qs[_0x71b4('0x2c')](_0x75b637[_0x71b4('0x38')][_0x71b4('0x2c')]);}return _0x2e5285['getFields'](_0x2b4160);}})['then'](function(_0xa30cb){if(_0xa30cb){return _0xa30cb?{'count':_0x311ae9,'rows':_0xa30cb}:null;}})[_0x71b4('0x1d')](respondWithResult(_0x31dd19,null))[_0x71b4('0x27')](handleError(_0x31dd19,null));};exports[_0x71b4('0x57')]=function(_0x3340e2,_0x9bf575,_0x4e355c){var _0x268695={};var _0x399228={};var _0x5a1e5f;var _0x4eccd1;return db['VtigerConfiguration'][_0x71b4('0x52')]({'where':{'id':_0x3340e2[_0x71b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x9bf575,null))[_0x71b4('0x1d')](function(_0x2bc8f7){if(_0x2bc8f7){_0x5a1e5f=_0x2bc8f7;_0x399228[_0x71b4('0x36')]=_[_0x71b4('0x37')](db['VtigerField']['rawAttributes']);_0x399228['query']=_[_0x71b4('0x37')](_0x3340e2[_0x71b4('0x38')]);_0x399228[_0x71b4('0x39')]=_[_0x71b4('0x3a')](_0x399228[_0x71b4('0x36')],_0x399228[_0x71b4('0x38')]);_0x268695[_0x71b4('0x3c')]=_[_0x71b4('0x3a')](_0x399228[_0x71b4('0x36')],qs[_0x71b4('0x3b')](_0x3340e2[_0x71b4('0x38')]['fields']));_0x268695[_0x71b4('0x3c')]=_0x268695[_0x71b4('0x3c')][_0x71b4('0x3d')]?_0x268695[_0x71b4('0x3c')]:_0x399228[_0x71b4('0x36')];_0x268695['order']=qs['sort'](_0x3340e2['query'][_0x71b4('0x3f')]);_0x268695[_0x71b4('0x40')]=qs['filters'](_[_0x71b4('0x41')](_0x3340e2[_0x71b4('0x38')],_0x399228[_0x71b4('0x39')]));if(_0x3340e2[_0x71b4('0x38')]['filter']){_0x268695[_0x71b4('0x40')]=_['merge'](_0x268695['where'],{'$or':_[_0x71b4('0x44')](_0x268695[_0x71b4('0x3c')],function(_0xab77cc){var _0x45d660={};_0x45d660[_0xab77cc]={'$like':'%'+_0x3340e2[_0x71b4('0x38')][_0x71b4('0x42')]+'%'};return _0x45d660;})});}_0x268695=_[_0x71b4('0x43')]({},_0x268695,_0x3340e2['options']);return _0x5a1e5f[_0x71b4('0x57')](_0x268695);}})[_0x71b4('0x1d')](function(_0x473581){if(_0x473581){_0x4eccd1=_0x473581[_0x71b4('0x3d')];if(!_0x3340e2[_0x71b4('0x38')][_0x71b4('0x55')]('nolimit')){_0x268695[_0x71b4('0x3e')]=qs['limit'](_0x3340e2[_0x71b4('0x38')][_0x71b4('0x3e')]);_0x268695[_0x71b4('0x2c')]=qs[_0x71b4('0x2c')](_0x3340e2['query'][_0x71b4('0x2c')]);}return _0x5a1e5f[_0x71b4('0x57')](_0x268695);}})[_0x71b4('0x1d')](function(_0x1ab3bf){if(_0x1ab3bf){return _0x1ab3bf?{'count':_0x4eccd1,'rows':_0x1ab3bf}:null;}})[_0x71b4('0x1d')](respondWithResult(_0x9bf575,null))[_0x71b4('0x27')](handleError(_0x9bf575,null));};exports[_0x71b4('0x58')]=function(_0x3c4270,_0x348c71,_0x539fb9){var _0x32ac79={};var _0x2c96f4={};var _0x335394;var _0xebdc6a;return db[_0x71b4('0x4a')][_0x71b4('0x52')]({'where':{'id':_0x3c4270[_0x71b4('0x49')]['id']}})[_0x71b4('0x1d')](handleEntityNotFound(_0x348c71,null))[_0x71b4('0x1d')](function(_0x46e4d1){if(_0x46e4d1){_0x335394=_0x46e4d1;_0x2c96f4[_0x71b4('0x36')]=_['keys'](db[_0x71b4('0x53')][_0x71b4('0x35')]);_0x2c96f4[_0x71b4('0x38')]=_['keys'](_0x3c4270[_0x71b4('0x38')]);_0x2c96f4['filters']=_[_0x71b4('0x3a')](_0x2c96f4[_0x71b4('0x36')],_0x2c96f4[_0x71b4('0x38')]);_0x32ac79[_0x71b4('0x3c')]=_[_0x71b4('0x3a')](_0x2c96f4[_0x71b4('0x36')],qs[_0x71b4('0x3b')](_0x3c4270['query'][_0x71b4('0x3b')]));_0x32ac79[_0x71b4('0x3c')]=_0x32ac79[_0x71b4('0x3c')][_0x71b4('0x3d')]?_0x32ac79[_0x71b4('0x3c')]:_0x2c96f4[_0x71b4('0x36')];_0x32ac79[_0x71b4('0x54')]=qs[_0x71b4('0x3f')](_0x3c4270['query'][_0x71b4('0x3f')]);_0x32ac79[_0x71b4('0x40')]=qs[_0x71b4('0x39')](_[_0x71b4('0x41')](_0x3c4270[_0x71b4('0x38')],_0x2c96f4[_0x71b4('0x39')]));if(_0x3c4270[_0x71b4('0x38')][_0x71b4('0x42')]){_0x32ac79[_0x71b4('0x40')]=_[_0x71b4('0x43')](_0x32ac79[_0x71b4('0x40')],{'$or':_[_0x71b4('0x44')](_0x32ac79[_0x71b4('0x3c')],function(_0x438ccd){var _0x189bb0={};_0x189bb0[_0x438ccd]={'$like':'%'+_0x3c4270['query']['filter']+'%'};return _0x189bb0;})});}_0x32ac79=_[_0x71b4('0x43')]({},_0x32ac79,_0x3c4270['options']);return _0x335394['getDescriptions'](_0x32ac79);}})[_0x71b4('0x1d')](function(_0x5c85fd){if(_0x5c85fd){_0xebdc6a=_0x5c85fd[_0x71b4('0x3d')];if(!_0x3c4270['query'][_0x71b4('0x55')](_0x71b4('0x56'))){_0x32ac79[_0x71b4('0x3e')]=qs[_0x71b4('0x3e')](_0x3c4270[_0x71b4('0x38')][_0x71b4('0x3e')]);_0x32ac79[_0x71b4('0x2c')]=qs[_0x71b4('0x2c')](_0x3c4270[_0x71b4('0x38')][_0x71b4('0x2c')]);}return _0x335394[_0x71b4('0x58')](_0x32ac79);}})[_0x71b4('0x1d')](function(_0x526bf5){if(_0x526bf5){return _0x526bf5?{'count':_0xebdc6a,'rows':_0x526bf5}:null;}})[_0x71b4('0x1d')](respondWithResult(_0x348c71,null))[_0x71b4('0x27')](handleError(_0x348c71,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index e49bf0e..9ef8f93 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 _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x595a69,_0x54cf69){var _0x2edc54=function(_0x447364){while(--_0x447364){_0x595a69['push'](_0x595a69['shift']());}};_0x2edc54(++_0x54cf69);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x60f27b,_0x3d382f){var _0x3a76a5=function(_0x49a19d){while(--_0x49a19d){_0x60f27b['push'](_0x60f27b['shift']());}};_0x3a76a5(++_0x3d382f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 7c2bd0e..9d38d13 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 _0x1128=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1128,0x1e6));var _0x8112=function(_0x45f5a6,_0xa838e7){_0x45f5a6=_0x45f5a6-0x0;var _0x87b443=_0x1128[_0x45f5a6];return _0x87b443;};'use strict';var _=require(_0x8112('0x0'));var util=require(_0x8112('0x1'));var moment=require('moment');var BPromise=require(_0x8112('0x2'));var rs=require(_0x8112('0x3'));var fs=require('fs');var Redis=require(_0x8112('0x4'));var db=require(_0x8112('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8112('0x6'))(_0x8112('0x7'));var config=require(_0x8112('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8112('0x9')][_0x8112('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19361f,_0x3849a2,_0x2587a8){return new BPromise(function(_0x394e8c,_0x12352e){return client[_0x8112('0xb')](_0x19361f,_0x2587a8)[_0x8112('0xc')](function(_0x992ac){logger[_0x8112('0xd')](_0x8112('0xe'),_0x3849a2,'request\x20sent');logger[_0x8112('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3849a2,_0x8112('0x10'),JSON[_0x8112('0x11')](_0x992ac));if(_0x992ac['error']){if(_0x992ac[_0x8112('0x12')]['code']===0x1f4){logger[_0x8112('0x12')](_0x8112('0xe'),_0x3849a2,_0x992ac['error']['message']);return _0x12352e(_0x992ac[_0x8112('0x12')][_0x8112('0x13')]);}logger[_0x8112('0x12')](_0x8112('0xe'),_0x3849a2,_0x992ac[_0x8112('0x12')][_0x8112('0x13')]);return _0x394e8c(_0x992ac[_0x8112('0x12')]['message']);}else{logger[_0x8112('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x3849a2,_0x8112('0x10'));_0x394e8c(_0x992ac[_0x8112('0x14')][_0x8112('0x13')]);}})[_0x8112('0x15')](function(_0x26e042){logger[_0x8112('0x12')](_0x8112('0xe'),_0x3849a2,_0x26e042);_0x12352e(_0x26e042);});});} \ No newline at end of file +var _0xe736=['VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x246081,_0x454f45){var _0x1a7f70=function(_0x4f547e){while(--_0x4f547e){_0x246081['push'](_0x246081['shift']());}};_0x1a7f70(++_0x454f45);}(_0xe736,0x152));var _0x6e73=function(_0x56068e,_0x54ddc3){_0x56068e=_0x56068e-0x0;var _0x367390=_0xe736[_0x56068e];return _0x367390;};'use strict';var _=require(_0x6e73('0x0'));var util=require('util');var moment=require(_0x6e73('0x1'));var BPromise=require(_0x6e73('0x2'));var rs=require(_0x6e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e73('0x4'))['db'];var utils=require(_0x6e73('0x5'));var logger=require(_0x6e73('0x6'))(_0x6e73('0x7'));var config=require(_0x6e73('0x8'));var jayson=require(_0x6e73('0x9'));var client=jayson[_0x6e73('0xa')][_0x6e73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58641f,_0x585675,_0x3414e4){return new BPromise(function(_0x405846,_0x3a0a70){return client[_0x6e73('0xc')](_0x58641f,_0x3414e4)[_0x6e73('0xd')](function(_0x43b618){logger['info'](_0x6e73('0xe'),_0x585675,'request\x20sent');logger['debug'](_0x6e73('0xf'),_0x585675,'request\x20sent',JSON['stringify'](_0x43b618));if(_0x43b618[_0x6e73('0x10')]){if(_0x43b618['error']['code']===0x1f4){logger['error'](_0x6e73('0xe'),_0x585675,_0x43b618[_0x6e73('0x10')][_0x6e73('0x11')]);return _0x3a0a70(_0x43b618['error']['message']);}logger[_0x6e73('0x10')](_0x6e73('0xe'),_0x585675,_0x43b618[_0x6e73('0x10')][_0x6e73('0x11')]);return _0x405846(_0x43b618[_0x6e73('0x10')][_0x6e73('0x11')]);}else{logger[_0x6e73('0x12')](_0x6e73('0xe'),_0x585675,_0x6e73('0x13'));_0x405846(_0x43b618[_0x6e73('0x14')][_0x6e73('0x11')]);}})[_0x6e73('0x15')](function(_0x2021bd){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x585675,_0x2021bd);_0x3a0a70(_0x2021bd);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index feae1fa..c924086 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 _0xc6af=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','path','connect-timeout'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xc6af,0x141));var _0xfc6a=function(_0x3cb819,_0x2d8a1d){_0x3cb819=_0x3cb819-0x0;var _0x5aad64=_0xc6af[_0x3cb819];return _0x5aad64;};'use strict';var multer=require(_0xfc6a('0x0'));var util=require('util');var path=require(_0xfc6a('0x1'));var timeout=require(_0xfc6a('0x2'));var express=require(_0xfc6a('0x3'));var router=express[_0xfc6a('0x4')]();var auth=require(_0xfc6a('0x5'));var interaction=require(_0xfc6a('0x6'));var config=require(_0xfc6a('0x7'));var controller=require('./intVtigerField.controller');router[_0xfc6a('0x8')]('/',auth[_0xfc6a('0x9')](),controller[_0xfc6a('0xa')]);router[_0xfc6a('0x8')](_0xfc6a('0xb'),auth['isAuthenticated'](),controller[_0xfc6a('0xc')]);router[_0xfc6a('0xd')]('/',auth[_0xfc6a('0x9')](),controller[_0xfc6a('0xe')]);router[_0xfc6a('0xf')](_0xfc6a('0xb'),auth[_0xfc6a('0x9')](),controller[_0xfc6a('0x10')]);router[_0xfc6a('0x11')](_0xfc6a('0xb'),auth[_0xfc6a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2301=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x278aff,_0x7fe80){var _0x150d71=function(_0x4b035b){while(--_0x4b035b){_0x278aff['push'](_0x278aff['shift']());}};_0x150d71(++_0x7fe80);}(_0x2301,0x7d));var _0x1230=function(_0x15cae3,_0x458cb9){_0x15cae3=_0x15cae3-0x0;var _0x20596f=_0x2301[_0x15cae3];return _0x20596f;};'use strict';var multer=require(_0x1230('0x0'));var util=require('util');var path=require(_0x1230('0x1'));var timeout=require(_0x1230('0x2'));var express=require(_0x1230('0x3'));var router=express['Router']();var auth=require(_0x1230('0x4'));var interaction=require(_0x1230('0x5'));var config=require('../../config/environment');var controller=require(_0x1230('0x6'));router[_0x1230('0x7')]('/',auth[_0x1230('0x8')](),controller[_0x1230('0x9')]);router['get'](_0x1230('0xa'),auth[_0x1230('0x8')](),controller[_0x1230('0xb')]);router[_0x1230('0xc')]('/',auth[_0x1230('0x8')](),controller[_0x1230('0xd')]);router[_0x1230('0xe')](_0x1230('0xa'),auth[_0x1230('0x8')](),controller[_0x1230('0xf')]);router[_0x1230('0x10')](_0x1230('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1230('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index c297c4f..152a0b4 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 _0xf109=['ENUM','keyValue','string','STRING','variable','customVariable','sequelize','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf109,0xce));var _0x9f10=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xf109[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'type':{'type':Sequelize[_0x9f10('0x2')]('string','variable','customVariable',_0x9f10('0x3')),'defaultValue':_0x9f10('0x4')},'content':{'type':Sequelize[_0x9f10('0x5')]},'key':{'type':Sequelize[_0x9f10('0x5')]},'keyType':{'type':Sequelize[_0x9f10('0x2')](_0x9f10('0x4'),_0x9f10('0x6'),_0x9f10('0x7'))},'keyContent':{'type':Sequelize[_0x9f10('0x5')]},'idField':{'type':Sequelize[_0x9f10('0x5')]},'nameField':{'type':Sequelize[_0x9f10('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f10('0x5')]}}; \ No newline at end of file +var _0xa9e0=['customVariable','string','STRING','sequelize','exports','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('string','variable',_0x0a9e('0x3'),'keyValue'),'defaultValue':_0x0a9e('0x4')},'content':{'type':Sequelize[_0x0a9e('0x5')]},'key':{'type':Sequelize[_0x0a9e('0x5')]},'keyType':{'type':Sequelize[_0x0a9e('0x2')](_0x0a9e('0x4'),'variable',_0x0a9e('0x3'))},'keyContent':{'type':Sequelize[_0x0a9e('0x5')]},'idField':{'type':Sequelize[_0x0a9e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a9e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index beb4e8c..c88d5bc 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 _0x6e6c=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','key','field','VtigerField','includeAll','include','findAll','show','params','catch','create','body','update','find','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','lodash','squel','jsforce','desk.js'];(function(_0x4b505a,_0x1bffc6){var _0x4a09f7=function(_0x56215a){while(--_0x56215a){_0x4b505a['push'](_0x4b505a['shift']());}};_0x4a09f7(++_0x1bffc6);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xc6e6('0x0'));var emlformat=require(_0xc6e6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc6e6('0x2'));var jsonpatch=require(_0xc6e6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc6e6('0x4'));var Mustache=require('mustache');var util=require(_0xc6e6('0x5'));var path=require('path');var sox=require(_0xc6e6('0x6'));var csv=require(_0xc6e6('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var hardwareService=require(_0xc6e6('0x10'));var logger=require(_0xc6e6('0x11'))(_0xc6e6('0x12'));var utils=require(_0xc6e6('0x13'));var config=require(_0xc6e6('0x14'));var db=require(_0xc6e6('0x15'))['db'];function respondWithStatusCode(_0x58540d,_0x3ac3a5){_0x3ac3a5=_0x3ac3a5||0xcc;return function(_0x525d60){if(_0x525d60){return _0x58540d[_0xc6e6('0x16')](_0x3ac3a5);}return _0x58540d[_0xc6e6('0x17')](_0x3ac3a5)[_0xc6e6('0x18')]();};}function respondWithResult(_0x13c8d5,_0x4a88d2){_0x4a88d2=_0x4a88d2||0xc8;return function(_0x149ac6){if(_0x149ac6){return _0x13c8d5[_0xc6e6('0x17')](_0x4a88d2)[_0xc6e6('0x19')](_0x149ac6);}};}function respondWithFilteredResult(_0x1b6ca9,_0x102673){return function(_0x4cdf15){if(_0x4cdf15){var _0x413cf8=_0x4cdf15[_0xc6e6('0x1a')],_0x178b34=_0x102673[_0xc6e6('0x1b')],_0x569474=_0x102673['offset']+_0x102673['limit'],_0x2f11b0;if(_0x569474>=_0x413cf8){_0x569474=_0x413cf8;_0x2f11b0=0xc8;}else{_0x2f11b0=0xce;}_0x1b6ca9['status'](_0x2f11b0);return _0x1b6ca9[_0xc6e6('0x1c')]('Content-Range',_0x178b34+'-'+_0x569474+'/'+_0x413cf8)[_0xc6e6('0x19')](_0x4cdf15);}return null;};}function patchUpdates(_0x2069e4){return function(_0x1ecc8f){try{jsonpatch[_0xc6e6('0x1d')](_0x1ecc8f,_0x2069e4,!![]);}catch(_0x19e1e4){return BPromise[_0xc6e6('0x1e')](_0x19e1e4);}return _0x1ecc8f[_0xc6e6('0x1f')]();};}function saveUpdates(_0x2761c4,_0x28cbc3){return function(_0x3d734d){if(_0x3d734d){return _0x3d734d['update'](_0x2761c4)[_0xc6e6('0x20')](function(_0x4ad70e){return _0x4ad70e;});}return null;};}function removeEntity(_0x1c34cc,_0x1667b8){return function(_0x2be6fc){if(_0x2be6fc){return _0x2be6fc[_0xc6e6('0x21')]()['then'](function(){_0x1c34cc[_0xc6e6('0x17')](0xcc)[_0xc6e6('0x18')]();});}};}function handleEntityNotFound(_0x3a96df,_0x36ebfa){return function(_0x107561){if(!_0x107561){_0x3a96df['sendStatus'](0x194);}return _0x107561;};}function handleError(_0x41fe96,_0x51fe51){_0x51fe51=_0x51fe51||0x1f4;return function(_0x266786){logger[_0xc6e6('0x22')](_0x266786[_0xc6e6('0x23')]);if(_0x266786[_0xc6e6('0x24')]){delete _0x266786['name'];}_0x41fe96[_0xc6e6('0x17')](_0x51fe51)['send'](_0x266786);};}exports[_0xc6e6('0x25')]=function(_0x534745,_0x267c6a){var _0x16dcd9={},_0x348888={},_0x41e7c2={'count':0x0,'rows':[]};var _0x66a240=db['VtigerField'][_0xc6e6('0x26')];_0x348888[_0xc6e6('0x27')]=_[_0xc6e6('0x28')](_0x66a240);_0x348888[_0xc6e6('0x29')]=_['keys'](_0x534745[_0xc6e6('0x29')]);_0x348888['filters']=_[_0xc6e6('0x2a')](_0x348888[_0xc6e6('0x27')],_0x348888[_0xc6e6('0x29')]);_0x16dcd9[_0xc6e6('0x2b')]=_[_0xc6e6('0x2a')](_0x348888[_0xc6e6('0x27')],qs[_0xc6e6('0x2c')](_0x534745[_0xc6e6('0x29')][_0xc6e6('0x2c')]));_0x16dcd9[_0xc6e6('0x2b')]=_0x16dcd9[_0xc6e6('0x2b')][_0xc6e6('0x2d')]?_0x16dcd9[_0xc6e6('0x2b')]:_0x348888[_0xc6e6('0x27')];if(!_0x534745[_0xc6e6('0x29')][_0xc6e6('0x2e')](_0xc6e6('0x2f'))){_0x16dcd9['limit']=qs[_0xc6e6('0x30')](_0x534745[_0xc6e6('0x29')]['limit']);_0x16dcd9['offset']=qs[_0xc6e6('0x1b')](_0x534745[_0xc6e6('0x29')][_0xc6e6('0x1b')]);}_0x16dcd9[_0xc6e6('0x31')]=qs[_0xc6e6('0x32')](_0x534745[_0xc6e6('0x29')]['sort']);_0x16dcd9[_0xc6e6('0x33')]=qs[_0xc6e6('0x34')](_[_0xc6e6('0x35')](_0x534745['query'],_0x348888['filters']));if(_0x534745[_0xc6e6('0x29')][_0xc6e6('0x36')]){_0x16dcd9[_0xc6e6('0x33')]=_[_0xc6e6('0x37')](_0x16dcd9['where'],{'$or':_['map'](_0x66a240,function(_0x24a690){if(_0x24a690['type'][_0xc6e6('0x38')]!=='VIRTUAL'){var _0x357eae={};_0x357eae[_0x24a690[_0xc6e6('0x39')]]={'$like':'%'+_0x534745[_0xc6e6('0x29')][_0xc6e6('0x36')]+'%'};return _0x357eae;}})});}_0x16dcd9=_['merge']({},_0x16dcd9,_0x534745['options']);var _0x281529={'where':_0x16dcd9[_0xc6e6('0x33')]};return db[_0xc6e6('0x3a')][_0xc6e6('0x1a')](_0x281529)['then'](function(_0x4cbdcf){_0x41e7c2[_0xc6e6('0x1a')]=_0x4cbdcf;if(_0x534745[_0xc6e6('0x29')][_0xc6e6('0x3b')]){_0x16dcd9[_0xc6e6('0x3c')]=[{'all':!![]}];}return db['VtigerField'][_0xc6e6('0x3d')](_0x16dcd9);})[_0xc6e6('0x20')](function(_0x5ddab4){_0x41e7c2['rows']=_0x5ddab4;return _0x41e7c2;})[_0xc6e6('0x20')](respondWithFilteredResult(_0x267c6a,_0x16dcd9))['catch'](handleError(_0x267c6a,null));};exports[_0xc6e6('0x3e')]=function(_0x3817fc,_0x53d313){var _0x1117c1={'raw':!![],'where':{'id':_0x3817fc[_0xc6e6('0x3f')]['id']}},_0x50c96d={};_0x50c96d['model']=_[_0xc6e6('0x28')](db[_0xc6e6('0x3a')][_0xc6e6('0x26')]);_0x50c96d[_0xc6e6('0x29')]=_[_0xc6e6('0x28')](_0x3817fc[_0xc6e6('0x29')]);_0x50c96d[_0xc6e6('0x34')]=_[_0xc6e6('0x2a')](_0x50c96d[_0xc6e6('0x27')],_0x50c96d['query']);_0x1117c1[_0xc6e6('0x2b')]=_[_0xc6e6('0x2a')](_0x50c96d[_0xc6e6('0x27')],qs[_0xc6e6('0x2c')](_0x3817fc['query'][_0xc6e6('0x2c')]));_0x1117c1[_0xc6e6('0x2b')]=_0x1117c1[_0xc6e6('0x2b')][_0xc6e6('0x2d')]?_0x1117c1['attributes']:_0x50c96d[_0xc6e6('0x27')];if(_0x3817fc[_0xc6e6('0x29')][_0xc6e6('0x3b')]){_0x1117c1[_0xc6e6('0x3c')]=[{'all':!![]}];}_0x1117c1=_[_0xc6e6('0x37')]({},_0x1117c1,_0x3817fc['options']);return db[_0xc6e6('0x3a')]['find'](_0x1117c1)[_0xc6e6('0x20')](handleEntityNotFound(_0x53d313,null))['then'](respondWithResult(_0x53d313,null))[_0xc6e6('0x40')](handleError(_0x53d313,null));};exports[_0xc6e6('0x41')]=function(_0xd34c20,_0xeba15){return db[_0xc6e6('0x3a')][_0xc6e6('0x41')](_0xd34c20[_0xc6e6('0x42')],{})[_0xc6e6('0x20')](respondWithResult(_0xeba15,0xc9))['catch'](handleError(_0xeba15,null));};exports[_0xc6e6('0x43')]=function(_0x23d741,_0x2fe3d4){if(_0x23d741['body']['id']){delete _0x23d741[_0xc6e6('0x42')]['id'];}return db[_0xc6e6('0x3a')][_0xc6e6('0x44')]({'where':{'id':_0x23d741[_0xc6e6('0x3f')]['id']}})[_0xc6e6('0x20')](handleEntityNotFound(_0x2fe3d4,null))[_0xc6e6('0x20')](saveUpdates(_0x23d741[_0xc6e6('0x42')],null))[_0xc6e6('0x20')](respondWithResult(_0x2fe3d4,null))[_0xc6e6('0x40')](handleError(_0x2fe3d4,null));};exports[_0xc6e6('0x21')]=function(_0x3bfe85,_0x470167){return db[_0xc6e6('0x3a')][_0xc6e6('0x44')]({'where':{'id':_0x3bfe85['params']['id']}})[_0xc6e6('0x20')](handleEntityNotFound(_0x470167,null))['then'](removeEntity(_0x470167,null))[_0xc6e6('0x40')](handleError(_0x470167,null));}; \ No newline at end of file +var _0x3266=['index','VtigerField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','merge','map','type','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','Content-Range','reject','save','update','destroy','then','status','sendStatus','error'];(function(_0x3a2429,_0x3a5a4e){var _0x537376=function(_0x5c1340){while(--_0x5c1340){_0x3a2429['push'](_0x3a2429['shift']());}};_0x537376(++_0x3a5a4e);}(_0x3266,0x6a));var _0x6326=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x3266[_0x2db12b];return _0x20990b;};'use strict';var pdf=require(_0x6326('0x0'));var emlformat=require(_0x6326('0x1'));var rimraf=require(_0x6326('0x2'));var zipdir=require(_0x6326('0x3'));var jsonpatch=require(_0x6326('0x4'));var rp=require(_0x6326('0x5'));var moment=require(_0x6326('0x6'));var BPromise=require(_0x6326('0x7'));var Mustache=require(_0x6326('0x8'));var util=require('util');var path=require(_0x6326('0x9'));var sox=require('sox');var csv=require(_0x6326('0xa'));var ejs=require(_0x6326('0xb'));var fs=require('fs');var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xa'));var querystring=require(_0x6326('0xf'));var Papa=require(_0x6326('0x10'));var Redis=require(_0x6326('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x12'));var hardwareService=require(_0x6326('0x13'));var logger=require(_0x6326('0x14'))(_0x6326('0x15'));var utils=require(_0x6326('0x16'));var config=require(_0x6326('0x17'));var db=require(_0x6326('0x18'))['db'];function respondWithStatusCode(_0x77c4e,_0x40a68a){_0x40a68a=_0x40a68a||0xcc;return function(_0x379358){if(_0x379358){return _0x77c4e['sendStatus'](_0x40a68a);}return _0x77c4e['status'](_0x40a68a)[_0x6326('0x19')]();};}function respondWithResult(_0x136946,_0x591b81){_0x591b81=_0x591b81||0xc8;return function(_0x425878){if(_0x425878){return _0x136946['status'](_0x591b81)[_0x6326('0x1a')](_0x425878);}};}function respondWithFilteredResult(_0x20dcc6,_0x3d6ac0){return function(_0x41c352){if(_0x41c352){var _0x1ed3a3=_0x41c352['count'],_0x2c1879=_0x3d6ac0['offset'],_0x55923a=_0x3d6ac0['offset']+_0x3d6ac0['limit'],_0x1104c5;if(_0x55923a>=_0x1ed3a3){_0x55923a=_0x1ed3a3;_0x1104c5=0xc8;}else{_0x1104c5=0xce;}_0x20dcc6['status'](_0x1104c5);return _0x20dcc6['set'](_0x6326('0x1b'),_0x2c1879+'-'+_0x55923a+'/'+_0x1ed3a3)[_0x6326('0x1a')](_0x41c352);}return null;};}function patchUpdates(_0x2be78e){return function(_0x556c4e){try{jsonpatch['apply'](_0x556c4e,_0x2be78e,!![]);}catch(_0x954ed5){return BPromise[_0x6326('0x1c')](_0x954ed5);}return _0x556c4e[_0x6326('0x1d')]();};}function saveUpdates(_0x3db834,_0x3c08db){return function(_0x25957a){if(_0x25957a){return _0x25957a[_0x6326('0x1e')](_0x3db834)['then'](function(_0x22307f){return _0x22307f;});}return null;};}function removeEntity(_0x549f07,_0x3c5583){return function(_0x3c6cfa){if(_0x3c6cfa){return _0x3c6cfa[_0x6326('0x1f')]()[_0x6326('0x20')](function(){_0x549f07[_0x6326('0x21')](0xcc)[_0x6326('0x19')]();});}};}function handleEntityNotFound(_0x225555,_0x429bb0){return function(_0x4781cc){if(!_0x4781cc){_0x225555[_0x6326('0x22')](0x194);}return _0x4781cc;};}function handleError(_0x34954b,_0x4933e1){_0x4933e1=_0x4933e1||0x1f4;return function(_0x72d020){logger[_0x6326('0x23')](_0x72d020['stack']);if(_0x72d020['name']){delete _0x72d020['name'];}_0x34954b[_0x6326('0x21')](_0x4933e1)['send'](_0x72d020);};}exports[_0x6326('0x24')]=function(_0x1a48da,_0x5a907f){var _0x15e33d={},_0x21ec69={},_0xb68fec={'count':0x0,'rows':[]};var _0x2983e4=db[_0x6326('0x25')][_0x6326('0x26')];_0x21ec69[_0x6326('0x27')]=_[_0x6326('0x28')](_0x2983e4);_0x21ec69[_0x6326('0x29')]=_[_0x6326('0x28')](_0x1a48da[_0x6326('0x29')]);_0x21ec69[_0x6326('0x2a')]=_[_0x6326('0x2b')](_0x21ec69[_0x6326('0x27')],_0x21ec69[_0x6326('0x29')]);_0x15e33d[_0x6326('0x2c')]=_['intersection'](_0x21ec69[_0x6326('0x27')],qs[_0x6326('0x2d')](_0x1a48da[_0x6326('0x29')]['fields']));_0x15e33d[_0x6326('0x2c')]=_0x15e33d['attributes']['length']?_0x15e33d[_0x6326('0x2c')]:_0x21ec69[_0x6326('0x27')];if(!_0x1a48da[_0x6326('0x29')][_0x6326('0x2e')](_0x6326('0x2f'))){_0x15e33d[_0x6326('0x30')]=qs[_0x6326('0x30')](_0x1a48da[_0x6326('0x29')][_0x6326('0x30')]);_0x15e33d[_0x6326('0x31')]=qs[_0x6326('0x31')](_0x1a48da[_0x6326('0x29')]['offset']);}_0x15e33d[_0x6326('0x32')]=qs[_0x6326('0x33')](_0x1a48da['query'][_0x6326('0x33')]);_0x15e33d[_0x6326('0x34')]=qs[_0x6326('0x2a')](_['pick'](_0x1a48da[_0x6326('0x29')],_0x21ec69['filters']));if(_0x1a48da['query'][_0x6326('0x35')]){_0x15e33d[_0x6326('0x34')]=_[_0x6326('0x36')](_0x15e33d['where'],{'$or':_[_0x6326('0x37')](_0x2983e4,function(_0x55a431){if(_0x55a431[_0x6326('0x38')]['key']!==_0x6326('0x39')){var _0x32f860={};_0x32f860[_0x55a431[_0x6326('0x3a')]]={'$like':'%'+_0x1a48da[_0x6326('0x29')][_0x6326('0x35')]+'%'};return _0x32f860;}})});}_0x15e33d=_[_0x6326('0x36')]({},_0x15e33d,_0x1a48da['options']);var _0x37505a={'where':_0x15e33d[_0x6326('0x34')]};return db['VtigerField'][_0x6326('0x3b')](_0x37505a)['then'](function(_0x5607ea){_0xb68fec[_0x6326('0x3b')]=_0x5607ea;if(_0x1a48da[_0x6326('0x29')][_0x6326('0x3c')]){_0x15e33d[_0x6326('0x3d')]=[{'all':!![]}];}return db[_0x6326('0x25')][_0x6326('0x3e')](_0x15e33d);})['then'](function(_0x485bed){_0xb68fec[_0x6326('0x3f')]=_0x485bed;return _0xb68fec;})['then'](respondWithFilteredResult(_0x5a907f,_0x15e33d))[_0x6326('0x40')](handleError(_0x5a907f,null));};exports['show']=function(_0x282f33,_0x517f6b){var _0x335feb={'raw':!![],'where':{'id':_0x282f33[_0x6326('0x41')]['id']}},_0x1da798={};_0x1da798[_0x6326('0x27')]=_[_0x6326('0x28')](db[_0x6326('0x25')][_0x6326('0x26')]);_0x1da798[_0x6326('0x29')]=_[_0x6326('0x28')](_0x282f33['query']);_0x1da798[_0x6326('0x2a')]=_['intersection'](_0x1da798[_0x6326('0x27')],_0x1da798[_0x6326('0x29')]);_0x335feb[_0x6326('0x2c')]=_[_0x6326('0x2b')](_0x1da798['model'],qs[_0x6326('0x2d')](_0x282f33[_0x6326('0x29')]['fields']));_0x335feb[_0x6326('0x2c')]=_0x335feb[_0x6326('0x2c')][_0x6326('0x42')]?_0x335feb[_0x6326('0x2c')]:_0x1da798['model'];if(_0x282f33[_0x6326('0x29')][_0x6326('0x3c')]){_0x335feb[_0x6326('0x3d')]=[{'all':!![]}];}_0x335feb=_[_0x6326('0x36')]({},_0x335feb,_0x282f33[_0x6326('0x43')]);return db[_0x6326('0x25')][_0x6326('0x44')](_0x335feb)['then'](handleEntityNotFound(_0x517f6b,null))[_0x6326('0x20')](respondWithResult(_0x517f6b,null))[_0x6326('0x40')](handleError(_0x517f6b,null));};exports[_0x6326('0x45')]=function(_0x1848a9,_0x5f25cb){return db[_0x6326('0x25')]['create'](_0x1848a9[_0x6326('0x46')],{})[_0x6326('0x20')](respondWithResult(_0x5f25cb,0xc9))[_0x6326('0x40')](handleError(_0x5f25cb,null));};exports[_0x6326('0x1e')]=function(_0x183690,_0x5dc727){if(_0x183690[_0x6326('0x46')]['id']){delete _0x183690['body']['id'];}return db['VtigerField'][_0x6326('0x44')]({'where':{'id':_0x183690[_0x6326('0x41')]['id']}})['then'](handleEntityNotFound(_0x5dc727,null))[_0x6326('0x20')](saveUpdates(_0x183690[_0x6326('0x46')],null))[_0x6326('0x20')](respondWithResult(_0x5dc727,null))[_0x6326('0x40')](handleError(_0x5dc727,null));};exports[_0x6326('0x1f')]=function(_0x4f8dc0,_0x4af0ee){return db[_0x6326('0x25')][_0x6326('0x44')]({'where':{'id':_0x4f8dc0[_0x6326('0x41')]['id']}})[_0x6326('0x20')](handleEntityNotFound(_0x4af0ee,null))[_0x6326('0x20')](removeEntity(_0x4af0ee,null))[_0x6326('0x40')](handleError(_0x4af0ee,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index a23bdf1..7ed7a78 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 _0xcccc=['vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields'];(function(_0x408fc6,_0x4fc7e3){var _0xf442b4=function(_0x4cfaad){while(--_0x4cfaad){_0x408fc6['push'](_0x408fc6['shift']());}};_0xf442b4(++_0x4fc7e3);}(_0xcccc,0x1f2));var _0xcccc=function(_0x31ec29,_0x58915c){_0x31ec29=_0x31ec29-0x0;var _0x3275fc=_0xcccc[_0x31ec29];return _0x3275fc;};'use strict';var _=require(_0xcccc('0x0'));var util=require(_0xcccc('0x1'));var logger=require(_0xcccc('0x2'))(_0xcccc('0x3'));var moment=require(_0xcccc('0x4'));var BPromise=require(_0xcccc('0x5'));var rp=require(_0xcccc('0x6'));var fs=require('fs');var path=require(_0xcccc('0x7'));var rimraf=require(_0xcccc('0x8'));var config=require('../../config/environment');var attributes=require(_0xcccc('0x9'));module[_0xcccc('0xa')]=function(_0x2a2fe5,_0x5d7045){return _0x2a2fe5[_0xcccc('0xb')](_0xcccc('0xc'),attributes,{'tableName':_0xcccc('0xd'),'paranoid':![],'indexes':[{'name':_0xcccc('0xe'),'fields':['idField',_0xcccc('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ede=['bluebird','request-promise','rimraf','./intVtigerField.attributes','exports','define','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x5ee493,_0x34d0e4){var _0x171fb2=function(_0x14c127){while(--_0x14c127){_0x5ee493['push'](_0x5ee493['shift']());}};_0x171fb2(++_0x34d0e4);}(_0x9ede,0x158));var _0xe9ed=function(_0x1c6616,_0x2c0b35){_0x1c6616=_0x1c6616-0x0;var _0x35d5ca=_0x9ede[_0x1c6616];return _0x35d5ca;};'use strict';var _=require(_0xe9ed('0x0'));var util=require(_0xe9ed('0x1'));var logger=require(_0xe9ed('0x2'))('api');var moment=require(_0xe9ed('0x3'));var BPromise=require(_0xe9ed('0x4'));var rp=require(_0xe9ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9ed('0x6'));var config=require('../../config/environment');var attributes=require(_0xe9ed('0x7'));module[_0xe9ed('0x8')]=function(_0x195302,_0x33951b){return _0x195302[_0xe9ed('0x9')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xe9ed('0xa'),_0xe9ed('0xb')],'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 70ac10b..95e581a 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 _0x3a23=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x4b77c1,_0x4c8fdc){var _0x2a54e6=function(_0x39077b){while(--_0x39077b){_0x4b77c1['push'](_0x4b77c1['shift']());}};_0x2a54e6(++_0x4c8fdc);}(_0x3a23,0x93));var _0x33a2=function(_0x5eadd4,_0x17ad39){_0x5eadd4=_0x5eadd4-0x0;var _0x3f5a36=_0x3a23[_0x5eadd4];return _0x3f5a36;};'use strict';var _=require(_0x33a2('0x0'));var util=require(_0x33a2('0x1'));var moment=require(_0x33a2('0x2'));var BPromise=require('bluebird');var rs=require(_0x33a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33a2('0x4'))['db'];var utils=require(_0x33a2('0x5'));var logger=require(_0x33a2('0x6'))(_0x33a2('0x7'));var config=require(_0x33a2('0x8'));var jayson=require(_0x33a2('0x9'));var client=jayson[_0x33a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c4cc7,_0x3a6cdc,_0x424cbd){return new BPromise(function(_0xf980b9,_0x38bfab){return client[_0x33a2('0xb')](_0x4c4cc7,_0x424cbd)[_0x33a2('0xc')](function(_0x3b18fc){logger[_0x33a2('0xd')](_0x33a2('0xe'),_0x3a6cdc,_0x33a2('0xf'));logger[_0x33a2('0x10')](_0x33a2('0x11'),_0x3a6cdc,_0x33a2('0xf'),JSON[_0x33a2('0x12')](_0x3b18fc));if(_0x3b18fc['error']){if(_0x3b18fc['error'][_0x33a2('0x13')]===0x1f4){logger[_0x33a2('0x14')]('VtigerField,\x20%s,\x20%s',_0x3a6cdc,_0x3b18fc[_0x33a2('0x14')][_0x33a2('0x15')]);return _0x38bfab(_0x3b18fc['error']['message']);}logger['error'](_0x33a2('0xe'),_0x3a6cdc,_0x3b18fc[_0x33a2('0x14')][_0x33a2('0x15')]);return _0xf980b9(_0x3b18fc['error'][_0x33a2('0x15')]);}else{logger['info'](_0x33a2('0xe'),_0x3a6cdc,_0x33a2('0xf'));_0xf980b9(_0x3b18fc[_0x33a2('0x16')][_0x33a2('0x15')]);}})['catch'](function(_0x36ee6d){logger[_0x33a2('0x14')](_0x33a2('0xe'),_0x3a6cdc,_0x36ee6d);_0x38bfab(_0x36ee6d);});});} \ No newline at end of file +var _0x1d40=['../../config/environment','http','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x1d40,0xbc));var _0x01d4=function(_0xa30bad,_0x40e784){_0xa30bad=_0xa30bad-0x0;var _0x118bd3=_0x1d40[_0xa30bad];return _0x118bd3;};'use strict';var _=require(_0x01d4('0x0'));var util=require(_0x01d4('0x1'));var moment=require(_0x01d4('0x2'));var BPromise=require(_0x01d4('0x3'));var rs=require(_0x01d4('0x4'));var fs=require('fs');var Redis=require(_0x01d4('0x5'));var db=require(_0x01d4('0x6'))['db'];var utils=require(_0x01d4('0x7'));var logger=require(_0x01d4('0x8'))(_0x01d4('0x9'));var config=require(_0x01d4('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x01d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cba7c,_0x423d9e,_0x4e2579){return new BPromise(function(_0x2eea43,_0x3c9eaa){return client['request'](_0x1cba7c,_0x4e2579)['then'](function(_0x186e8e){logger[_0x01d4('0xc')](_0x01d4('0xd'),_0x423d9e,_0x01d4('0xe'));logger[_0x01d4('0xf')](_0x01d4('0x10'),_0x423d9e,'request\x20sent',JSON[_0x01d4('0x11')](_0x186e8e));if(_0x186e8e[_0x01d4('0x12')]){if(_0x186e8e[_0x01d4('0x12')][_0x01d4('0x13')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x423d9e,_0x186e8e[_0x01d4('0x12')][_0x01d4('0x14')]);return _0x3c9eaa(_0x186e8e[_0x01d4('0x12')][_0x01d4('0x14')]);}logger[_0x01d4('0x12')]('VtigerField,\x20%s,\x20%s',_0x423d9e,_0x186e8e['error'][_0x01d4('0x14')]);return _0x2eea43(_0x186e8e[_0x01d4('0x12')][_0x01d4('0x14')]);}else{logger[_0x01d4('0xc')](_0x01d4('0xd'),_0x423d9e,'request\x20sent');_0x2eea43(_0x186e8e['result'][_0x01d4('0x14')]);}})[_0x01d4('0x15')](function(_0x211e17){logger['error'](_0x01d4('0xd'),_0x423d9e,_0x211e17);_0x3c9eaa(_0x211e17);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index c7640b2..7ca0c01 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 _0xeebc=['show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id'];(function(_0x5a7914,_0x2ab1c4){var _0x38624=function(_0x572b64){while(--_0x572b64){_0x5a7914['push'](_0x5a7914['shift']());}};_0x38624(++_0x2ab1c4);}(_0xeebc,0x16a));var _0xceeb=function(_0x57c71a,_0x9d5d5b){_0x57c71a=_0x57c71a-0x0;var _0x29a20b=_0xeebc[_0x57c71a];return _0x29a20b;};'use strict';var multer=require(_0xceeb('0x0'));var util=require(_0xceeb('0x1'));var path=require(_0xceeb('0x2'));var timeout=require('connect-timeout');var express=require(_0xceeb('0x3'));var router=express[_0xceeb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xceeb('0x5'));var config=require(_0xceeb('0x6'));var controller=require(_0xceeb('0x7'));router['get']('/',auth[_0xceeb('0x8')](),controller[_0xceeb('0x9')]);router[_0xceeb('0xa')](_0xceeb('0xb'),auth['isAuthenticated'](),controller[_0xceeb('0xc')]);router[_0xceeb('0xa')](_0xceeb('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xceeb('0xa')](_0xceeb('0xe'),auth[_0xceeb('0x8')](),controller[_0xceeb('0xf')]);router['post']('/',auth[_0xceeb('0x8')](),controller[_0xceeb('0x10')]);router[_0xceeb('0x11')]('/:id/configurations',auth[_0xceeb('0x8')](),controller[_0xceeb('0x12')]);router[_0xceeb('0x13')](_0xceeb('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xceeb('0x14')](_0xceeb('0xb'),auth[_0xceeb('0x8')](),controller[_0xceeb('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf985=['show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x3bbc98,_0x138310){var _0x3f9749=function(_0x42969d){while(--_0x42969d){_0x3bbc98['push'](_0x3bbc98['shift']());}};_0x3f9749(++_0x138310);}(_0xf985,0x143));var _0x5f98=function(_0x2c55fe,_0x45db35){_0x2c55fe=_0x2c55fe-0x0;var _0x2f4c18=_0xf985[_0x2c55fe];return _0x2f4c18;};'use strict';var multer=require(_0x5f98('0x0'));var util=require(_0x5f98('0x1'));var path=require(_0x5f98('0x2'));var timeout=require(_0x5f98('0x3'));var express=require(_0x5f98('0x4'));var router=express[_0x5f98('0x5')]();var auth=require(_0x5f98('0x6'));var interaction=require(_0x5f98('0x7'));var config=require('../../config/environment');var controller=require(_0x5f98('0x8'));router[_0x5f98('0x9')]('/',auth[_0x5f98('0xa')](),controller[_0x5f98('0xb')]);router[_0x5f98('0x9')](_0x5f98('0xc'),auth[_0x5f98('0xa')](),controller[_0x5f98('0xd')]);router[_0x5f98('0x9')](_0x5f98('0xe'),auth[_0x5f98('0xa')](),controller[_0x5f98('0xf')]);router[_0x5f98('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5f98('0x10')]);router[_0x5f98('0x11')]('/',auth['isAuthenticated'](),controller[_0x5f98('0x12')]);router[_0x5f98('0x11')](_0x5f98('0xe'),auth[_0x5f98('0xa')](),controller['addConfiguration']);router[_0x5f98('0x13')](_0x5f98('0xc'),auth[_0x5f98('0xa')](),controller[_0x5f98('0x14')]);router[_0x5f98('0x15')]('/:id',auth[_0x5f98('0xa')](),controller[_0x5f98('0x16')]);module[_0x5f98('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index e8fb489..8314d6d 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 _0xf026=['remoteUri','ENUM','password','sequelize','exports','STRING','username'];(function(_0x5c908c,_0x4bcfab){var _0x39325f=function(_0x20b5a6){while(--_0x20b5a6){_0x5c908c['push'](_0x5c908c['shift']());}};_0x39325f(++_0x4bcfab);}(_0xf026,0x106));var _0x6f02=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xf026[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0x6f02('0x0'));module[_0x6f02('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6f02('0x2')]},'username':{'type':Sequelize[_0x6f02('0x2')],'unique':_0x6f02('0x3')},'password':{'type':Sequelize[_0x6f02('0x2')]},'token':{'type':Sequelize[_0x6f02('0x2')]},'remoteUri':{'type':Sequelize[_0x6f02('0x2')],'unique':_0x6f02('0x4')},'authType':{'type':Sequelize[_0x6f02('0x5')](_0x6f02('0x6'),'token'),'defaultValue':_0x6f02('0x6')},'serverUrl':{'type':Sequelize[_0x6f02('0x2')]},'type':{'type':Sequelize[_0x6f02('0x5')]('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xd78e=['remoteUri','ENUM','token','password','integrationTab','newTab','exports','STRING','username'];(function(_0xdc356f,_0x3003d0){var _0x339eaa=function(_0xc2283e){while(--_0xc2283e){_0xdc356f['push'](_0xdc356f['shift']());}};_0x339eaa(++_0x3003d0);}(_0xd78e,0x19b));var _0xed78=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xd78e[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require('sequelize');module[_0xed78('0x0')]={'name':{'type':Sequelize[_0xed78('0x1')]},'description':{'type':Sequelize[_0xed78('0x1')]},'username':{'type':Sequelize[_0xed78('0x1')],'unique':_0xed78('0x2')},'password':{'type':Sequelize[_0xed78('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xed78('0x1')],'unique':_0xed78('0x3')},'authType':{'type':Sequelize[_0xed78('0x4')]('password',_0xed78('0x5')),'defaultValue':_0xed78('0x6')},'serverUrl':{'type':Sequelize[_0xed78('0x1')]},'type':{'type':Sequelize['ENUM'](_0xed78('0x7'),_0xed78('0x8')),'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 1aca097..a57dc99 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 _0x3bdd=['format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','index','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','GET'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x3bdd,0x192));var _0xd3bd=function(_0x49aceb,_0x3bd670){_0x49aceb=_0x49aceb-0x0;var _0x25c9cb=_0x3bdd[_0x49aceb];return _0x25c9cb;};'use strict';var pdf=require(_0xd3bd('0x0'));var emlformat=require(_0xd3bd('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd3bd('0x2'));var rp=require(_0xd3bd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3bd('0x4'));var util=require(_0xd3bd('0x5'));var path=require(_0xd3bd('0x6'));var sox=require('sox');var csv=require(_0xd3bd('0x7'));var ejs=require(_0xd3bd('0x8'));var fs=require('fs');var _=require(_0xd3bd('0x9'));var squel=require(_0xd3bd('0xa'));var crypto=require(_0xd3bd('0xb'));var jsforce=require(_0xd3bd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd3bd('0xd'));var Papa=require('papaparse');var Redis=require(_0xd3bd('0xe'));var authService=require(_0xd3bd('0xf'));var qs=require(_0xd3bd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3bd('0x11'))(_0xd3bd('0x12'));var utils=require(_0xd3bd('0x13'));var config=require(_0xd3bd('0x14'));var db=require(_0xd3bd('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xd3bd('0x16'));var client=jayson[_0xd3bd('0x17')][_0xd3bd('0x18')]({'port':0x232a});function checkPasswordPattern(_0x357ae9,_0x41efa5,_0x9e4bbb){if(_0x9e4bbb){var _0x568ee5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x568ee5['test'](_0x41efa5)){return _0x357ae9;}else{throw new Error(_0xd3bd('0x19'));}}else{return _0x357ae9;}}function respondWithRpcPromise(_0x469e02,_0x915f8,_0x5598f9,_0x264eaf){return new BPromise(function(_0x1527cc,_0x5dd6f3){var _0x304ce9=_0x264eaf||client;return _0x304ce9[_0xd3bd('0x1a')](_0x469e02,_0x5598f9)['then'](function(_0xbcd8e4){logger[_0xd3bd('0x1b')](_0xd3bd('0x1c'),_0x915f8,_0xd3bd('0x1d'));logger[_0xd3bd('0x1e')](_0xd3bd('0x1f'),_0x915f8,_0xd3bd('0x1d'),JSON[_0xd3bd('0x20')](_0xbcd8e4));if(_0xbcd8e4[_0xd3bd('0x21')]){if(_0xbcd8e4[_0xd3bd('0x21')][_0xd3bd('0x22')]===0x1f4){logger[_0xd3bd('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x915f8,_0xbcd8e4[_0xd3bd('0x21')][_0xd3bd('0x23')]);return _0x5dd6f3(_0xbcd8e4[_0xd3bd('0x21')][_0xd3bd('0x23')]);}logger[_0xd3bd('0x21')](_0xd3bd('0x1c'),_0x915f8,_0xbcd8e4[_0xd3bd('0x21')][_0xd3bd('0x23')]);return _0x1527cc(_0xbcd8e4['error'][_0xd3bd('0x23')]);}else{logger[_0xd3bd('0x1b')](_0xd3bd('0x1c'),_0x915f8,_0xd3bd('0x1d'));_0x1527cc(_0xbcd8e4[_0xd3bd('0x24')][_0xd3bd('0x23')]);}})['catch'](function(_0x9074a6){logger[_0xd3bd('0x21')](_0xd3bd('0x1c'),_0x915f8,_0x9074a6);_0x5dd6f3(_0x9074a6);});});}function respondWithStatusCode(_0x82c8b8,_0x5cf5de){_0x5cf5de=_0x5cf5de||0xcc;return function(_0x322f96){if(_0x322f96){return _0x82c8b8['sendStatus'](_0x5cf5de);}return _0x82c8b8[_0xd3bd('0x25')](_0x5cf5de)['end']();};}function respondWithResult(_0x51f90b,_0x16d8ba){_0x16d8ba=_0x16d8ba||0xc8;return function(_0x458180){if(_0x458180){return _0x51f90b['status'](_0x16d8ba)[_0xd3bd('0x26')](_0x458180);}};}function respondWithFilteredResult(_0xa8e9d5,_0x4d0f61){return function(_0x1fd330){if(_0x1fd330){var _0xbc32bb=_0x1fd330[_0xd3bd('0x27')],_0x1e0542=_0x4d0f61[_0xd3bd('0x28')],_0x374b8c=_0x4d0f61[_0xd3bd('0x28')]+_0x4d0f61[_0xd3bd('0x29')],_0x268ef6;if(_0x374b8c>=_0xbc32bb){_0x374b8c=_0xbc32bb;_0x268ef6=0xc8;}else{_0x268ef6=0xce;}_0xa8e9d5[_0xd3bd('0x25')](_0x268ef6);return _0xa8e9d5['set'](_0xd3bd('0x2a'),_0x1e0542+'-'+_0x374b8c+'/'+_0xbc32bb)[_0xd3bd('0x26')](_0x1fd330);}return null;};}function patchUpdates(_0x1c878a){return function(_0x34e111){try{jsonpatch[_0xd3bd('0x2b')](_0x34e111,_0x1c878a,!![]);}catch(_0x357136){return BPromise['reject'](_0x357136);}return _0x34e111['save']();};}function saveUpdates(_0x488fff,_0x157a52){return function(_0x23c8e3){if(_0x23c8e3){return _0x23c8e3[_0xd3bd('0x2c')](_0x488fff)[_0xd3bd('0x2d')](function(_0x427b7e){return _0x427b7e;});}return null;};}function removeEntity(_0x26d263,_0x1b5cc3){return function(_0x538377){if(_0x538377){return _0x538377[_0xd3bd('0x2e')]()[_0xd3bd('0x2d')](function(){_0x26d263[_0xd3bd('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50e391,_0x5788d3){return function(_0x1341b8){if(!_0x1341b8){_0x50e391[_0xd3bd('0x2f')](0x194);}return _0x1341b8;};}function handleError(_0x4ebdf5,_0x78c9a){_0x78c9a=_0x78c9a||0x1f4;return function(_0x5209b1){logger[_0xd3bd('0x21')](_0x5209b1[_0xd3bd('0x30')]);if(_0x5209b1[_0xd3bd('0x31')]){delete _0x5209b1[_0xd3bd('0x31')];}_0x4ebdf5['status'](_0x78c9a)[_0xd3bd('0x32')](_0x5209b1);};}exports[_0xd3bd('0x33')]=function(_0x1414d4,_0x23c83e){var _0x49004c={},_0x57f5dd={},_0x3fbd30={'count':0x0,'rows':[]};var _0x16f751=db[_0xd3bd('0x34')][_0xd3bd('0x35')];_0x57f5dd[_0xd3bd('0x36')]=_[_0xd3bd('0x37')](_0x16f751);_0x57f5dd['query']=_['keys'](_0x1414d4[_0xd3bd('0x38')]);_0x57f5dd[_0xd3bd('0x39')]=_[_0xd3bd('0x3a')](_0x57f5dd[_0xd3bd('0x36')],_0x57f5dd[_0xd3bd('0x38')]);_0x49004c[_0xd3bd('0x3b')]=_[_0xd3bd('0x3a')](_0x57f5dd['model'],qs[_0xd3bd('0x3c')](_0x1414d4[_0xd3bd('0x38')][_0xd3bd('0x3c')]));_0x49004c[_0xd3bd('0x3b')]=_0x49004c[_0xd3bd('0x3b')]['length']?_0x49004c[_0xd3bd('0x3b')]:_0x57f5dd[_0xd3bd('0x36')];if(!_0x1414d4['query'][_0xd3bd('0x3d')](_0xd3bd('0x3e'))){_0x49004c['limit']=qs[_0xd3bd('0x29')](_0x1414d4[_0xd3bd('0x38')][_0xd3bd('0x29')]);_0x49004c[_0xd3bd('0x28')]=qs[_0xd3bd('0x28')](_0x1414d4[_0xd3bd('0x38')][_0xd3bd('0x28')]);}_0x49004c[_0xd3bd('0x3f')]=qs[_0xd3bd('0x40')](_0x1414d4[_0xd3bd('0x38')][_0xd3bd('0x40')]);_0x49004c[_0xd3bd('0x41')]=qs[_0xd3bd('0x39')](_['pick'](_0x1414d4[_0xd3bd('0x38')],_0x57f5dd[_0xd3bd('0x39')]));if(_0x1414d4[_0xd3bd('0x38')][_0xd3bd('0x42')]){_0x49004c[_0xd3bd('0x41')]=_[_0xd3bd('0x43')](_0x49004c[_0xd3bd('0x41')],{'$or':_[_0xd3bd('0x44')](_0x16f751,function(_0x983b8e){if(_0x983b8e[_0xd3bd('0x45')][_0xd3bd('0x46')]!=='VIRTUAL'){var _0x3ef2c4={};_0x3ef2c4[_0x983b8e['field']]={'$like':'%'+_0x1414d4[_0xd3bd('0x38')]['filter']+'%'};return _0x3ef2c4;}})});}_0x49004c=_[_0xd3bd('0x43')]({},_0x49004c,_0x1414d4[_0xd3bd('0x47')]);var _0x4a5c60={'where':_0x49004c[_0xd3bd('0x41')]};return db[_0xd3bd('0x34')][_0xd3bd('0x27')](_0x4a5c60)['then'](function(_0x11f4a9){_0x3fbd30[_0xd3bd('0x27')]=_0x11f4a9;if(_0x1414d4[_0xd3bd('0x38')][_0xd3bd('0x48')]){_0x49004c[_0xd3bd('0x49')]=[{'all':!![]}];}return db[_0xd3bd('0x34')][_0xd3bd('0x4a')](_0x49004c);})[_0xd3bd('0x2d')](function(_0x3c5e30){_0x3fbd30[_0xd3bd('0x4b')]=_0x3c5e30;return _0x3fbd30;})[_0xd3bd('0x2d')](respondWithFilteredResult(_0x23c83e,_0x49004c))['catch'](handleError(_0x23c83e,null));};exports[_0xd3bd('0x4c')]=function(_0x173bd6,_0x1000fd){var _0x4dceea={'raw':![],'where':{'id':_0x173bd6[_0xd3bd('0x4d')]['id']}},_0x295d08={};_0x295d08[_0xd3bd('0x36')]=_['keys'](db[_0xd3bd('0x34')][_0xd3bd('0x35')]);_0x295d08['query']=_['keys'](_0x173bd6['query']);_0x295d08[_0xd3bd('0x39')]=_[_0xd3bd('0x3a')](_0x295d08[_0xd3bd('0x36')],_0x295d08['query']);_0x4dceea[_0xd3bd('0x3b')]=_[_0xd3bd('0x3a')](_0x295d08[_0xd3bd('0x36')],qs[_0xd3bd('0x3c')](_0x173bd6['query'][_0xd3bd('0x3c')]));_0x4dceea[_0xd3bd('0x3b')]=_0x4dceea[_0xd3bd('0x3b')][_0xd3bd('0x4e')]?_0x4dceea[_0xd3bd('0x3b')]:_0x295d08['model'];if(_0x173bd6['query'][_0xd3bd('0x48')]){_0x4dceea[_0xd3bd('0x49')]=[{'all':!![]}];}_0x4dceea=_['merge']({},_0x4dceea,_0x173bd6[_0xd3bd('0x47')]);return db[_0xd3bd('0x34')][_0xd3bd('0x4f')](_0x4dceea)['then'](handleEntityNotFound(_0x1000fd,null))[_0xd3bd('0x2d')](respondWithResult(_0x1000fd,null))[_0xd3bd('0x50')](handleError(_0x1000fd,null));};exports['create']=function(_0xe838c8,_0x130844){return db[_0xd3bd('0x34')][_0xd3bd('0x51')](_0xe838c8[_0xd3bd('0x52')],{})['then'](respondWithResult(_0x130844,0xc9))[_0xd3bd('0x50')](handleError(_0x130844,null));};exports[_0xd3bd('0x2c')]=function(_0x31e394,_0x5cc52f){if(_0x31e394['body']['id']){delete _0x31e394[_0xd3bd('0x52')]['id'];}return db[_0xd3bd('0x34')][_0xd3bd('0x4f')]({'where':{'id':_0x31e394[_0xd3bd('0x4d')]['id']}})[_0xd3bd('0x2d')](handleEntityNotFound(_0x5cc52f,null))[_0xd3bd('0x2d')](saveUpdates(_0x31e394[_0xd3bd('0x52')],null))['then'](respondWithResult(_0x5cc52f,null))[_0xd3bd('0x50')](handleError(_0x5cc52f,null));};exports[_0xd3bd('0x2e')]=function(_0xb7ec16,_0x4e4982){return db[_0xd3bd('0x34')][_0xd3bd('0x4f')]({'where':{'id':_0xb7ec16[_0xd3bd('0x4d')]['id']}})[_0xd3bd('0x2d')](handleEntityNotFound(_0x4e4982,null))[_0xd3bd('0x2d')](removeEntity(_0x4e4982,null))[_0xd3bd('0x50')](handleError(_0x4e4982,null));};exports[_0xd3bd('0x53')]=function(_0x22b155,_0x18652f,_0x506275){var _0x4f42ac={};var _0x57ae53={};var _0x446161;var _0x5924b0;return db[_0xd3bd('0x34')][_0xd3bd('0x54')]({'where':{'id':_0x22b155['params']['id']}})[_0xd3bd('0x2d')](handleEntityNotFound(_0x18652f,null))[_0xd3bd('0x2d')](function(_0x12ad5f){if(_0x12ad5f){_0x446161=_0x12ad5f;_0x57ae53[_0xd3bd('0x36')]=_['keys'](db[_0xd3bd('0x55')][_0xd3bd('0x35')]);_0x57ae53[_0xd3bd('0x38')]=_['keys'](_0x22b155[_0xd3bd('0x38')]);_0x57ae53[_0xd3bd('0x39')]=_[_0xd3bd('0x3a')](_0x57ae53[_0xd3bd('0x36')],_0x57ae53[_0xd3bd('0x38')]);_0x4f42ac[_0xd3bd('0x3b')]=_['intersection'](_0x57ae53['model'],qs[_0xd3bd('0x3c')](_0x22b155[_0xd3bd('0x38')][_0xd3bd('0x3c')]));_0x4f42ac[_0xd3bd('0x3b')]=_0x4f42ac['attributes']['length']?_0x4f42ac['attributes']:_0x57ae53[_0xd3bd('0x36')];_0x4f42ac[_0xd3bd('0x3f')]=qs[_0xd3bd('0x40')](_0x22b155[_0xd3bd('0x38')]['sort']);_0x4f42ac[_0xd3bd('0x41')]=qs[_0xd3bd('0x39')](_['pick'](_0x22b155[_0xd3bd('0x38')],_0x57ae53[_0xd3bd('0x39')]));if(_0x22b155[_0xd3bd('0x38')][_0xd3bd('0x42')]){_0x4f42ac[_0xd3bd('0x41')]=_['merge'](_0x4f42ac[_0xd3bd('0x41')],{'$or':_['map'](_0x4f42ac[_0xd3bd('0x3b')],function(_0x11fef9){var _0x58839d={};_0x58839d[_0x11fef9]={'$like':'%'+_0x22b155[_0xd3bd('0x38')]['filter']+'%'};return _0x58839d;})});}_0x4f42ac=_[_0xd3bd('0x43')]({},_0x4f42ac,_0x22b155[_0xd3bd('0x47')]);return _0x446161['getConfigurations'](_0x4f42ac);}})['then'](function(_0x3b9ab8){if(_0x3b9ab8){_0x5924b0=_0x3b9ab8[_0xd3bd('0x4e')];if(!_0x22b155[_0xd3bd('0x38')][_0xd3bd('0x3d')]('nolimit')){_0x4f42ac[_0xd3bd('0x29')]=qs[_0xd3bd('0x29')](_0x22b155[_0xd3bd('0x38')][_0xd3bd('0x29')]);_0x4f42ac[_0xd3bd('0x28')]=qs[_0xd3bd('0x28')](_0x22b155['query'][_0xd3bd('0x28')]);}return _0x446161[_0xd3bd('0x53')](_0x4f42ac);}})[_0xd3bd('0x2d')](function(_0x1badc4){if(_0x1badc4){return _0x1badc4?{'count':_0x5924b0,'rows':_0x1badc4}:null;}})[_0xd3bd('0x2d')](respondWithResult(_0x18652f,null))[_0xd3bd('0x50')](handleError(_0x18652f,null));};exports[_0xd3bd('0x56')]=function(_0x132dfd,_0x58f160,_0x4ffea5){if(_0x132dfd[_0xd3bd('0x52')]['id']){delete _0x132dfd[_0xd3bd('0x52')]['id'];}return db[_0xd3bd('0x34')][_0xd3bd('0x54')]({'where':{'id':_0x132dfd[_0xd3bd('0x4d')]['id']}})[_0xd3bd('0x2d')](handleEntityNotFound(_0x58f160,null))[_0xd3bd('0x2d')](function(_0x15551c){if(_0x15551c){_0x132dfd[_0xd3bd('0x52')][_0xd3bd('0x57')]=_0x15551c['id'];_0x132dfd[_0xd3bd('0x52')][_0xd3bd('0x58')]=integrations[_0xd3bd('0x59')](_0x132dfd[_0xd3bd('0x52')]['channel'],_0x132dfd[_0xd3bd('0x52')]['type']);_0x132dfd[_0xd3bd('0x52')][_0xd3bd('0x5a')]=integrations[_0xd3bd('0x5b')](_0x132dfd[_0xd3bd('0x52')][_0xd3bd('0x5c')],_0x132dfd[_0xd3bd('0x52')]['type']);return db[_0xd3bd('0x55')]['create'](_0x132dfd['body'],{'include':[{'model':db[_0xd3bd('0x5d')],'as':_0xd3bd('0x58')},{'model':db['ZendeskField'],'as':_0xd3bd('0x5a')}]});}return null;})[_0xd3bd('0x2d')](respondWithResult(_0x58f160,null))[_0xd3bd('0x50')](handleError(_0x58f160,null));};exports[_0xd3bd('0x5e')]=function(_0x1fae64,_0x5a13c3,_0x462b08){var _0x103b9d='';return db[_0xd3bd('0x34')][_0xd3bd('0x54')]({'where':{'id':_0x1fae64['params']['id']},'attributes':['id',_0xd3bd('0x5f'),_0xd3bd('0x60'),_0xd3bd('0x61'),_0xd3bd('0x62'),_0xd3bd('0x63')]})[_0xd3bd('0x2d')](handleEntityNotFound(_0x5a13c3,null))['then'](function(_0x5bc279){if(_0x5bc279){_0x103b9d=_0x5bc279[_0xd3bd('0x63')];var _0x1569ae=_0x103b9d[_0xd3bd('0x64')](-0x1);if(_0x1569ae==='/'){_0x103b9d=_0x103b9d['substring'](0x0,_0x103b9d['lastIndexOf'](_0x1569ae));}var _0xd81039={'method':_0xd3bd('0x65'),'uri':util[_0xd3bd('0x66')](_0xd3bd('0x67'),_0x103b9d,_0xd3bd('0x68')),'json':!![]};switch(_0x5bc279[_0xd3bd('0x62')]){case _0xd3bd('0x60'):_0xd81039[_0xd3bd('0x69')]={'Authorization':util[_0xd3bd('0x66')](_0xd3bd('0x6a'),new Buffer(util[_0xd3bd('0x66')](_0xd3bd('0x6b'),_0x5bc279['username'],_0x5bc279[_0xd3bd('0x60')]))[_0xd3bd('0x6c')](_0xd3bd('0x6d')))};break;case _0xd3bd('0x61'):_0xd81039[_0xd3bd('0x69')]={'Authorization':util[_0xd3bd('0x66')](_0xd3bd('0x6a'),new Buffer(util['format'](_0xd3bd('0x6e'),_0x5bc279[_0xd3bd('0x5f')],_0x5bc279[_0xd3bd('0x61')]))[_0xd3bd('0x6c')]('base64'))};break;default:throw new db[(_0xd3bd('0x6f'))][(_0xd3bd('0x70'))]('Unknown\x20authentication\x20type');}return rp(_0xd81039);}})[_0xd3bd('0x2d')](function(_0x213145){if(_0x213145){var _0xb5495f=[_0xd3bd('0x71'),_0xd3bd('0x72'),_0xd3bd('0x73'),_0xd3bd('0x74')];_['remove'](_0x213145[_0xd3bd('0x68')],function(_0x3e72b9){return _0xb5495f[_0xd3bd('0x75')](_0x3e72b9[_0xd3bd('0x45')]);});return{'count':_0x213145[_0xd3bd('0x68')][_0xd3bd('0x4e')],'rows':_[_0xd3bd('0x44')](_0x213145['ticket_fields'],function(_0xb9b753){return{'id':_0xb9b753['id'],'name':_0xb9b753[_0xd3bd('0x76')]>0x7?_0xb9b753[_0xd3bd('0x77')]:_0xb9b753[_0xd3bd('0x45')],'custom':_0xb9b753[_0xd3bd('0x76')]>0x7?!![]:![],'options':_0xb9b753[_0xd3bd('0x78')]?_0xb9b753[_0xd3bd('0x78')]:_0xb9b753[_0xd3bd('0x79')]?_0xb9b753[_0xd3bd('0x79')]:[]};})};}})[_0xd3bd('0x2d')](respondWithResult(_0x5a13c3,null))[_0xd3bd('0x50')](function(_0x54adcd){var _0x37e9=_0x1fae64['query'][_0xd3bd('0x7a')]?0x1f4:_0x54adcd[_0xd3bd('0x7b')]||0x1f4;logger[_0xd3bd('0x21')](_0xd3bd('0x7c'),_0xd3bd('0x5e'),_0x37e9,JSON[_0xd3bd('0x20')](_0x54adcd));delete _0x54adcd[_0xd3bd('0x31')];if(_0x37e9===0x191){_0x37e9=0x190;}_0x5a13c3[_0xd3bd('0x25')](_0x37e9)[_0xd3bd('0x32')](_0x1fae64[_0xd3bd('0x38')][_0xd3bd('0x7a')]?{'message':_0xd3bd('0x7d'),'statusCode':_0x54adcd[_0xd3bd('0x7b')]}:_0x54adcd);});}; \ No newline at end of file +var _0x8757=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','count','offset','limit','set','update','destroy','sendStatus','stack','name','send','ZendeskAccount','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','includeAll','findAll','show','include','options','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','remoteUri','substring','lastIndexOf','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','token','%s/token:%s','base64','Sequelize','ValidationError','description','assignee','remove','ticket_fields','includes','title','position','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x4d8234,_0xf6a39d){var _0x9ca2ed=function(_0x153767){while(--_0x153767){_0x4d8234['push'](_0x4d8234['shift']());}};_0x9ca2ed(++_0xf6a39d);}(_0x8757,0x68));var _0x7875=function(_0x3731e4,_0x4329bb){_0x3731e4=_0x3731e4-0x0;var _0x3e70ff=_0x8757[_0x3731e4];return _0x3e70ff;};'use strict';var pdf=require(_0x7875('0x0'));var emlformat=require(_0x7875('0x1'));var rimraf=require(_0x7875('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7875('0x3'));var rp=require(_0x7875('0x4'));var moment=require(_0x7875('0x5'));var BPromise=require(_0x7875('0x6'));var Mustache=require('mustache');var util=require(_0x7875('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7875('0x8'));var ejs=require(_0x7875('0x9'));var fs=require('fs');var _=require(_0x7875('0xa'));var squel=require(_0x7875('0xb'));var crypto=require(_0x7875('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7875('0xd'));var toCsv=require(_0x7875('0x8'));var querystring=require(_0x7875('0xe'));var Papa=require(_0x7875('0xf'));var Redis=require(_0x7875('0x10'));var authService=require(_0x7875('0x11'));var qs=require(_0x7875('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7875('0x13'))(_0x7875('0x14'));var utils=require(_0x7875('0x15'));var config=require('../../config/environment');var db=require(_0x7875('0x16'))['db'];var integrations=require(_0x7875('0x17'));var jayson=require(_0x7875('0x18'));var client=jayson[_0x7875('0x19')][_0x7875('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5b87de,_0x1161ee,_0x1f4b36){if(_0x1f4b36){var _0x5103b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5103b6['test'](_0x1161ee)){return _0x5b87de;}else{throw new Error(_0x7875('0x1b'));}}else{return _0x5b87de;}}function respondWithRpcPromise(_0xda0aad,_0xadaca4,_0x379302,_0x43d518){return new BPromise(function(_0x115782,_0x2e1ce0){var _0x842ee4=_0x43d518||client;return _0x842ee4['request'](_0xda0aad,_0x379302)[_0x7875('0x1c')](function(_0x11eb51){logger[_0x7875('0x1d')](_0x7875('0x1e'),_0xadaca4,_0x7875('0x1f'));logger[_0x7875('0x20')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xadaca4,_0x7875('0x1f'),JSON[_0x7875('0x21')](_0x11eb51));if(_0x11eb51[_0x7875('0x22')]){if(_0x11eb51[_0x7875('0x22')][_0x7875('0x23')]===0x1f4){logger[_0x7875('0x22')](_0x7875('0x1e'),_0xadaca4,_0x11eb51[_0x7875('0x22')][_0x7875('0x24')]);return _0x2e1ce0(_0x11eb51['error'][_0x7875('0x24')]);}logger[_0x7875('0x22')](_0x7875('0x1e'),_0xadaca4,_0x11eb51[_0x7875('0x22')][_0x7875('0x24')]);return _0x115782(_0x11eb51[_0x7875('0x22')][_0x7875('0x24')]);}else{logger[_0x7875('0x1d')](_0x7875('0x1e'),_0xadaca4,_0x7875('0x1f'));_0x115782(_0x11eb51[_0x7875('0x25')][_0x7875('0x24')]);}})[_0x7875('0x26')](function(_0x341a17){logger[_0x7875('0x22')](_0x7875('0x1e'),_0xadaca4,_0x341a17);_0x2e1ce0(_0x341a17);});});}function respondWithStatusCode(_0x560343,_0x9b8e45){_0x9b8e45=_0x9b8e45||0xcc;return function(_0x554b99){if(_0x554b99){return _0x560343['sendStatus'](_0x9b8e45);}return _0x560343['status'](_0x9b8e45)[_0x7875('0x27')]();};}function respondWithResult(_0x525784,_0x2c1693){_0x2c1693=_0x2c1693||0xc8;return function(_0x2bddf2){if(_0x2bddf2){return _0x525784[_0x7875('0x28')](_0x2c1693)[_0x7875('0x29')](_0x2bddf2);}};}function respondWithFilteredResult(_0x104a3b,_0x320dbf){return function(_0x40f9b7){if(_0x40f9b7){var _0x15a84a=_0x40f9b7[_0x7875('0x2a')],_0x477ac2=_0x320dbf[_0x7875('0x2b')],_0x545e13=_0x320dbf['offset']+_0x320dbf[_0x7875('0x2c')],_0x2e5127;if(_0x545e13>=_0x15a84a){_0x545e13=_0x15a84a;_0x2e5127=0xc8;}else{_0x2e5127=0xce;}_0x104a3b[_0x7875('0x28')](_0x2e5127);return _0x104a3b[_0x7875('0x2d')]('Content-Range',_0x477ac2+'-'+_0x545e13+'/'+_0x15a84a)[_0x7875('0x29')](_0x40f9b7);}return null;};}function patchUpdates(_0x3b089c){return function(_0x54e936){try{jsonpatch['apply'](_0x54e936,_0x3b089c,!![]);}catch(_0x3dc121){return BPromise['reject'](_0x3dc121);}return _0x54e936['save']();};}function saveUpdates(_0x23d2f7,_0xcf6403){return function(_0x5f3209){if(_0x5f3209){return _0x5f3209[_0x7875('0x2e')](_0x23d2f7)['then'](function(_0x5919c4){return _0x5919c4;});}return null;};}function removeEntity(_0x1e8df6,_0x278538){return function(_0x4421e3){if(_0x4421e3){return _0x4421e3[_0x7875('0x2f')]()['then'](function(){_0x1e8df6[_0x7875('0x28')](0xcc)[_0x7875('0x27')]();});}};}function handleEntityNotFound(_0x9a3c1a,_0x460053){return function(_0x461db4){if(!_0x461db4){_0x9a3c1a[_0x7875('0x30')](0x194);}return _0x461db4;};}function handleError(_0x1fe327,_0x3d8149){_0x3d8149=_0x3d8149||0x1f4;return function(_0x587c48){logger[_0x7875('0x22')](_0x587c48[_0x7875('0x31')]);if(_0x587c48['name']){delete _0x587c48[_0x7875('0x32')];}_0x1fe327[_0x7875('0x28')](_0x3d8149)[_0x7875('0x33')](_0x587c48);};}exports['index']=function(_0xfca34f,_0x4e2667){var _0x2a8289={},_0x4f46fd={},_0x14725c={'count':0x0,'rows':[]};var _0x3495b3=db[_0x7875('0x34')][_0x7875('0x35')];_0x4f46fd['model']=_['keys'](_0x3495b3);_0x4f46fd[_0x7875('0x36')]=_[_0x7875('0x37')](_0xfca34f[_0x7875('0x36')]);_0x4f46fd['filters']=_[_0x7875('0x38')](_0x4f46fd[_0x7875('0x39')],_0x4f46fd[_0x7875('0x36')]);_0x2a8289[_0x7875('0x3a')]=_[_0x7875('0x38')](_0x4f46fd[_0x7875('0x39')],qs[_0x7875('0x3b')](_0xfca34f[_0x7875('0x36')]['fields']));_0x2a8289['attributes']=_0x2a8289[_0x7875('0x3a')][_0x7875('0x3c')]?_0x2a8289[_0x7875('0x3a')]:_0x4f46fd[_0x7875('0x39')];if(!_0xfca34f[_0x7875('0x36')][_0x7875('0x3d')](_0x7875('0x3e'))){_0x2a8289[_0x7875('0x2c')]=qs[_0x7875('0x2c')](_0xfca34f[_0x7875('0x36')][_0x7875('0x2c')]);_0x2a8289[_0x7875('0x2b')]=qs[_0x7875('0x2b')](_0xfca34f[_0x7875('0x36')]['offset']);}_0x2a8289['order']=qs['sort'](_0xfca34f[_0x7875('0x36')][_0x7875('0x3f')]);_0x2a8289[_0x7875('0x40')]=qs['filters'](_[_0x7875('0x41')](_0xfca34f[_0x7875('0x36')],_0x4f46fd[_0x7875('0x42')]));if(_0xfca34f[_0x7875('0x36')][_0x7875('0x43')]){_0x2a8289[_0x7875('0x40')]=_[_0x7875('0x44')](_0x2a8289[_0x7875('0x40')],{'$or':_[_0x7875('0x45')](_0x3495b3,function(_0xf1c935){if(_0xf1c935[_0x7875('0x46')]['key']!==_0x7875('0x47')){var _0x5e67e0={};_0x5e67e0[_0xf1c935['field']]={'$like':'%'+_0xfca34f[_0x7875('0x36')]['filter']+'%'};return _0x5e67e0;}})});}_0x2a8289=_[_0x7875('0x44')]({},_0x2a8289,_0xfca34f['options']);var _0x161308={'where':_0x2a8289[_0x7875('0x40')]};return db['ZendeskAccount']['count'](_0x161308)[_0x7875('0x1c')](function(_0x5371c0){_0x14725c[_0x7875('0x2a')]=_0x5371c0;if(_0xfca34f['query'][_0x7875('0x48')]){_0x2a8289['include']=[{'all':!![]}];}return db[_0x7875('0x34')][_0x7875('0x49')](_0x2a8289);})['then'](function(_0xb85044){_0x14725c['rows']=_0xb85044;return _0x14725c;})['then'](respondWithFilteredResult(_0x4e2667,_0x2a8289))['catch'](handleError(_0x4e2667,null));};exports[_0x7875('0x4a')]=function(_0x57ece8,_0x385270){var _0xb0cc8b={'raw':![],'where':{'id':_0x57ece8['params']['id']}},_0x218ff8={};_0x218ff8[_0x7875('0x39')]=_[_0x7875('0x37')](db[_0x7875('0x34')][_0x7875('0x35')]);_0x218ff8[_0x7875('0x36')]=_[_0x7875('0x37')](_0x57ece8[_0x7875('0x36')]);_0x218ff8['filters']=_[_0x7875('0x38')](_0x218ff8['model'],_0x218ff8[_0x7875('0x36')]);_0xb0cc8b[_0x7875('0x3a')]=_[_0x7875('0x38')](_0x218ff8['model'],qs[_0x7875('0x3b')](_0x57ece8['query'][_0x7875('0x3b')]));_0xb0cc8b[_0x7875('0x3a')]=_0xb0cc8b['attributes'][_0x7875('0x3c')]?_0xb0cc8b[_0x7875('0x3a')]:_0x218ff8[_0x7875('0x39')];if(_0x57ece8[_0x7875('0x36')]['includeAll']){_0xb0cc8b[_0x7875('0x4b')]=[{'all':!![]}];}_0xb0cc8b=_['merge']({},_0xb0cc8b,_0x57ece8[_0x7875('0x4c')]);return db[_0x7875('0x34')][_0x7875('0x4d')](_0xb0cc8b)['then'](handleEntityNotFound(_0x385270,null))[_0x7875('0x1c')](respondWithResult(_0x385270,null))['catch'](handleError(_0x385270,null));};exports[_0x7875('0x4e')]=function(_0x5ee794,_0x18742e){return db[_0x7875('0x34')][_0x7875('0x4e')](_0x5ee794[_0x7875('0x4f')],{})[_0x7875('0x1c')](respondWithResult(_0x18742e,0xc9))[_0x7875('0x26')](handleError(_0x18742e,null));};exports['update']=function(_0x4de753,_0x20c733){if(_0x4de753['body']['id']){delete _0x4de753[_0x7875('0x4f')]['id'];}return db[_0x7875('0x34')][_0x7875('0x4d')]({'where':{'id':_0x4de753[_0x7875('0x50')]['id']}})[_0x7875('0x1c')](handleEntityNotFound(_0x20c733,null))[_0x7875('0x1c')](saveUpdates(_0x4de753[_0x7875('0x4f')],null))[_0x7875('0x1c')](respondWithResult(_0x20c733,null))[_0x7875('0x26')](handleError(_0x20c733,null));};exports[_0x7875('0x2f')]=function(_0x279b65,_0x596028){return db[_0x7875('0x34')][_0x7875('0x4d')]({'where':{'id':_0x279b65[_0x7875('0x50')]['id']}})[_0x7875('0x1c')](handleEntityNotFound(_0x596028,null))[_0x7875('0x1c')](removeEntity(_0x596028,null))[_0x7875('0x26')](handleError(_0x596028,null));};exports[_0x7875('0x51')]=function(_0xc15cb,_0xa45c3e,_0x2c33d0){var _0x1f1301={};var _0x53c886={};var _0x3b3af8;var _0x2bdc34;return db[_0x7875('0x34')][_0x7875('0x52')]({'where':{'id':_0xc15cb[_0x7875('0x50')]['id']}})[_0x7875('0x1c')](handleEntityNotFound(_0xa45c3e,null))['then'](function(_0x4d07c4){if(_0x4d07c4){_0x3b3af8=_0x4d07c4;_0x53c886[_0x7875('0x39')]=_[_0x7875('0x37')](db[_0x7875('0x53')][_0x7875('0x35')]);_0x53c886[_0x7875('0x36')]=_[_0x7875('0x37')](_0xc15cb[_0x7875('0x36')]);_0x53c886[_0x7875('0x42')]=_['intersection'](_0x53c886[_0x7875('0x39')],_0x53c886[_0x7875('0x36')]);_0x1f1301[_0x7875('0x3a')]=_[_0x7875('0x38')](_0x53c886[_0x7875('0x39')],qs[_0x7875('0x3b')](_0xc15cb['query'][_0x7875('0x3b')]));_0x1f1301[_0x7875('0x3a')]=_0x1f1301[_0x7875('0x3a')]['length']?_0x1f1301['attributes']:_0x53c886[_0x7875('0x39')];_0x1f1301[_0x7875('0x54')]=qs[_0x7875('0x3f')](_0xc15cb[_0x7875('0x36')][_0x7875('0x3f')]);_0x1f1301[_0x7875('0x40')]=qs[_0x7875('0x42')](_[_0x7875('0x41')](_0xc15cb[_0x7875('0x36')],_0x53c886[_0x7875('0x42')]));if(_0xc15cb['query'][_0x7875('0x43')]){_0x1f1301[_0x7875('0x40')]=_[_0x7875('0x44')](_0x1f1301[_0x7875('0x40')],{'$or':_[_0x7875('0x45')](_0x1f1301[_0x7875('0x3a')],function(_0x259c41){var _0x4dfe0d={};_0x4dfe0d[_0x259c41]={'$like':'%'+_0xc15cb[_0x7875('0x36')][_0x7875('0x43')]+'%'};return _0x4dfe0d;})});}_0x1f1301=_[_0x7875('0x44')]({},_0x1f1301,_0xc15cb[_0x7875('0x4c')]);return _0x3b3af8[_0x7875('0x51')](_0x1f1301);}})[_0x7875('0x1c')](function(_0x748a6f){if(_0x748a6f){_0x2bdc34=_0x748a6f[_0x7875('0x3c')];if(!_0xc15cb[_0x7875('0x36')][_0x7875('0x3d')](_0x7875('0x3e'))){_0x1f1301[_0x7875('0x2c')]=qs[_0x7875('0x2c')](_0xc15cb[_0x7875('0x36')]['limit']);_0x1f1301['offset']=qs[_0x7875('0x2b')](_0xc15cb[_0x7875('0x36')][_0x7875('0x2b')]);}return _0x3b3af8['getConfigurations'](_0x1f1301);}})[_0x7875('0x1c')](function(_0x4b60ae){if(_0x4b60ae){return _0x4b60ae?{'count':_0x2bdc34,'rows':_0x4b60ae}:null;}})['then'](respondWithResult(_0xa45c3e,null))[_0x7875('0x26')](handleError(_0xa45c3e,null));};exports[_0x7875('0x55')]=function(_0x134c7a,_0x15f21b,_0x481a5b){if(_0x134c7a[_0x7875('0x4f')]['id']){delete _0x134c7a[_0x7875('0x4f')]['id'];}return db[_0x7875('0x34')][_0x7875('0x52')]({'where':{'id':_0x134c7a[_0x7875('0x50')]['id']}})[_0x7875('0x1c')](handleEntityNotFound(_0x15f21b,null))[_0x7875('0x1c')](function(_0x1fc418){if(_0x1fc418){_0x134c7a['body'][_0x7875('0x56')]=_0x1fc418['id'];_0x134c7a['body'][_0x7875('0x57')]=integrations['getSubjects'](_0x134c7a[_0x7875('0x4f')][_0x7875('0x58')],_0x134c7a[_0x7875('0x4f')][_0x7875('0x46')]);_0x134c7a['body'][_0x7875('0x59')]=integrations[_0x7875('0x5a')](_0x134c7a[_0x7875('0x4f')][_0x7875('0x58')],_0x134c7a[_0x7875('0x4f')][_0x7875('0x46')]);return db[_0x7875('0x53')][_0x7875('0x4e')](_0x134c7a[_0x7875('0x4f')],{'include':[{'model':db[_0x7875('0x5b')],'as':_0x7875('0x57')},{'model':db['ZendeskField'],'as':_0x7875('0x59')}]});}return null;})[_0x7875('0x1c')](respondWithResult(_0x15f21b,null))[_0x7875('0x26')](handleError(_0x15f21b,null));};exports[_0x7875('0x5c')]=function(_0xe39558,_0x1a6a00,_0x340662){var _0x50144b='';return db[_0x7875('0x34')]['findOne']({'where':{'id':_0xe39558[_0x7875('0x50')]['id']},'attributes':['id',_0x7875('0x5d'),_0x7875('0x5e'),'token','authType',_0x7875('0x5f')]})[_0x7875('0x1c')](handleEntityNotFound(_0x1a6a00,null))[_0x7875('0x1c')](function(_0x3cfac0){if(_0x3cfac0){_0x50144b=_0x3cfac0[_0x7875('0x5f')];var _0xa3a646=_0x50144b['slice'](-0x1);if(_0xa3a646==='/'){_0x50144b=_0x50144b[_0x7875('0x60')](0x0,_0x50144b[_0x7875('0x61')](_0xa3a646));}var _0x3ade1a={'method':'GET','uri':util[_0x7875('0x62')](_0x7875('0x63'),_0x50144b,'ticket_fields'),'json':!![]};switch(_0x3cfac0['authType']){case _0x7875('0x5e'):_0x3ade1a[_0x7875('0x64')]={'Authorization':util['format'](_0x7875('0x65'),new Buffer(util[_0x7875('0x62')](_0x7875('0x66'),_0x3cfac0[_0x7875('0x5d')],_0x3cfac0[_0x7875('0x5e')]))[_0x7875('0x67')]('base64'))};break;case _0x7875('0x68'):_0x3ade1a[_0x7875('0x64')]={'Authorization':util[_0x7875('0x62')](_0x7875('0x65'),new Buffer(util[_0x7875('0x62')](_0x7875('0x69'),_0x3cfac0[_0x7875('0x5d')],_0x3cfac0['token']))['toString'](_0x7875('0x6a')))};break;default:throw new db[(_0x7875('0x6b'))][(_0x7875('0x6c'))]('Unknown\x20authentication\x20type');}return rp(_0x3ade1a);}})[_0x7875('0x1c')](function(_0x7521c4){if(_0x7521c4){var _0x2e2055=['subject',_0x7875('0x6d'),'group',_0x7875('0x6e')];_[_0x7875('0x6f')](_0x7521c4[_0x7875('0x70')],function(_0x1dc975){return _0x2e2055[_0x7875('0x71')](_0x1dc975['type']);});return{'count':_0x7521c4[_0x7875('0x70')][_0x7875('0x3c')],'rows':_['map'](_0x7521c4[_0x7875('0x70')],function(_0x341b74){return{'id':_0x341b74['id'],'name':_0x341b74['position']>0x7?_0x341b74[_0x7875('0x72')]:_0x341b74['type'],'custom':_0x341b74[_0x7875('0x73')]>0x7?!![]:![],'options':_0x341b74[_0x7875('0x74')]?_0x341b74[_0x7875('0x74')]:_0x341b74[_0x7875('0x75')]?_0x341b74[_0x7875('0x75')]:[]};})};}})['then'](respondWithResult(_0x1a6a00,null))[_0x7875('0x26')](function(_0x29d182){var _0x39a5e4=_0xe39558['query'][_0x7875('0x76')]?0x1f4:_0x29d182[_0x7875('0x77')]||0x1f4;logger[_0x7875('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x39a5e4,JSON[_0x7875('0x21')](_0x29d182));delete _0x29d182[_0x7875('0x32')];if(_0x39a5e4===0x191){_0x39a5e4=0x190;}_0x1a6a00[_0x7875('0x28')](_0x39a5e4)[_0x7875('0x33')](_0xe39558['query'][_0x7875('0x76')]?{'message':_0x7875('0x78'),'statusCode':_0x29d182[_0x7875('0x77')]}:_0x29d182);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 4c8abf2..ce5fdba 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 _0xbd3c=['bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','util','../../config/logger','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x513f62,_0x3be91c){_0x513f62=_0x513f62-0x0;var _0x303c19=_0xbd3c[_0x513f62];return _0x303c19;};'use strict';var _=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var logger=require(_0xcbd3('0x2'))('api');var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var rp=require(_0xcbd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbd3('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xcbd3('0x7'));module[_0xcbd3('0x8')]=function(_0x5b27a3,_0x348468){return _0x5b27a3[_0xcbd3('0x9')](_0xcbd3('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b09=['util','api','moment','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x587a4d,_0x157b2a){var _0x27ac41=function(_0x49f68e){while(--_0x49f68e){_0x587a4d['push'](_0x587a4d['shift']());}};_0x27ac41(++_0x157b2a);}(_0x9b09,0x1ad));var _0x99b0=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0x9b09[_0xee5d2a];return _0x346948;};'use strict';var _=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var logger=require('../../config/logger')(_0x99b0('0x2'));var moment=require(_0x99b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x99b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99b0('0x5'));var config=require('../../config/environment');var attributes=require(_0x99b0('0x6'));var integrations=require(_0x99b0('0x7'));module['exports']=function(_0x466c23,_0x220c95){return _0x466c23['define'](_0x99b0('0x8'),attributes,{'tableName':_0x99b0('0x9'),'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 5f07ca9..599fd52 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 _0x63f2=['map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x2e0751,_0x34c27d){var _0x337f60=function(_0x393205){while(--_0x393205){_0x2e0751['push'](_0x2e0751['shift']());}};_0x337f60(++_0x34c27d);}(_0x63f2,0x19b));var _0x263f=function(_0x184712,_0x112a17){_0x184712=_0x184712-0x0;var _0x35d70c=_0x63f2[_0x184712];return _0x35d70c;};'use strict';var _=require(_0x263f('0x0'));var util=require(_0x263f('0x1'));var moment=require(_0x263f('0x2'));var BPromise=require(_0x263f('0x3'));var rs=require(_0x263f('0x4'));var fs=require('fs');var Redis=require(_0x263f('0x5'));var db=require(_0x263f('0x6'))['db'];var utils=require(_0x263f('0x7'));var logger=require(_0x263f('0x8'))('rpc');var config=require(_0x263f('0x9'));var jayson=require(_0x263f('0xa'));var client=jayson['client'][_0x263f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2efa76,_0x67e2d7,_0x48ddcc){return new BPromise(function(_0x2d8236,_0x2a49a5){return client[_0x263f('0xc')](_0x2efa76,_0x48ddcc)[_0x263f('0xd')](function(_0x20fdcc){logger[_0x263f('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x67e2d7,_0x263f('0xf'));logger[_0x263f('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x67e2d7,_0x263f('0xf'),JSON[_0x263f('0x11')](_0x20fdcc));if(_0x20fdcc[_0x263f('0x12')]){if(_0x20fdcc[_0x263f('0x12')][_0x263f('0x13')]===0x1f4){logger[_0x263f('0x12')](_0x263f('0x14'),_0x67e2d7,_0x20fdcc[_0x263f('0x12')][_0x263f('0x15')]);return _0x2a49a5(_0x20fdcc['error'][_0x263f('0x15')]);}logger[_0x263f('0x12')](_0x263f('0x14'),_0x67e2d7,_0x20fdcc[_0x263f('0x12')]['message']);return _0x2d8236(_0x20fdcc['error']['message']);}else{logger[_0x263f('0xe')](_0x263f('0x14'),_0x67e2d7,'request\x20sent');_0x2d8236(_0x20fdcc[_0x263f('0x16')][_0x263f('0x15')]);}})[_0x263f('0x17')](function(_0x2a0ff1){logger['error'](_0x263f('0x14'),_0x67e2d7,_0x2a0ff1);_0x2a49a5(_0x2a0ff1);});});}exports[_0x263f('0x18')]=function(_0x143dcd){var _0x408bf8=this;return new Promise(function(_0x5a68cf,_0x34fea3){return db[_0x263f('0x19')][_0x263f('0x1a')]({'raw':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x1c')]===undefined?!![]:![]:!![],'where':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x1d')]||null:null,'attributes':_0x143dcd[_0x263f('0x1b')]?_0x143dcd['options'][_0x263f('0x1e')]||null:null,'limit':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x1f')]||null:null,'include':_0x143dcd[_0x263f('0x1b')]?_0x143dcd[_0x263f('0x1b')][_0x263f('0x20')]?_[_0x263f('0x21')](_0x143dcd[_0x263f('0x1b')][_0x263f('0x20')],function(_0x57ee4f){return{'model':db[_0x57ee4f[_0x263f('0x22')]],'as':_0x57ee4f['as'],'attributes':_0x57ee4f['attributes'],'include':_0x57ee4f[_0x263f('0x20')]?_['map'](_0x57ee4f['include'],function(_0x501d66){return{'model':db[_0x501d66[_0x263f('0x22')]],'as':_0x501d66['as'],'attributes':_0x501d66['attributes'],'include':_0x501d66['include']?_[_0x263f('0x21')](_0x501d66[_0x263f('0x20')],function(_0x4f912d){return{'model':db[_0x4f912d[_0x263f('0x22')]],'as':_0x4f912d['as'],'attributes':_0x4f912d[_0x263f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x263f('0xd')](function(_0x35e358){logger[_0x263f('0xe')](_0x263f('0x18'),_0x143dcd);logger[_0x263f('0x10')](_0x263f('0x18'),_0x143dcd,JSON['stringify'](_0x35e358));_0x5a68cf(_0x35e358);})[_0x263f('0x17')](function(_0x480baa){logger[_0x263f('0x12')](_0x263f('0x18'),_0x480baa[_0x263f('0x15')],_0x143dcd);_0x34fea3(_0x408bf8[_0x263f('0x12')](0x1f4,_0x480baa['message']));});});};exports[_0x263f('0x23')]=function(_0x1d4404){var _0x25fe4a=this;return new Promise(function(_0x645ddb,_0x1a8f6a){return db[_0x263f('0x19')][_0x263f('0x24')]({'raw':_0x1d4404[_0x263f('0x1b')]?_0x1d4404['options'][_0x263f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d4404[_0x263f('0x1b')]?_0x1d4404['options']['where']||null:null,'attributes':_0x1d4404[_0x263f('0x1b')]?_0x1d4404[_0x263f('0x1b')][_0x263f('0x1e')]||null:null,'include':_0x1d4404[_0x263f('0x1b')]?_0x1d4404[_0x263f('0x1b')][_0x263f('0x20')]?_[_0x263f('0x21')](_0x1d4404[_0x263f('0x1b')][_0x263f('0x20')],function(_0x5d6049){return{'model':db[_0x5d6049[_0x263f('0x22')]],'as':_0x5d6049['as'],'attributes':_0x5d6049['attributes'],'include':_0x5d6049[_0x263f('0x20')]?_[_0x263f('0x21')](_0x5d6049[_0x263f('0x20')],function(_0x3577d7){return{'model':db[_0x3577d7[_0x263f('0x22')]],'as':_0x3577d7['as'],'attributes':_0x3577d7['attributes'],'include':_0x3577d7[_0x263f('0x20')]?_['map'](_0x3577d7[_0x263f('0x20')],function(_0x2e2275){return{'model':db[_0x2e2275[_0x263f('0x22')]],'as':_0x2e2275['as'],'attributes':_0x2e2275[_0x263f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x263f('0xd')](function(_0x18b972){logger[_0x263f('0xe')]('ShowZendeskAccount',_0x1d4404);logger['debug'](_0x263f('0x23'),_0x1d4404,JSON['stringify'](_0x18b972));_0x645ddb(_0x18b972);})['catch'](function(_0x472892){logger[_0x263f('0x12')](_0x263f('0x23'),_0x472892[_0x263f('0x15')],_0x1d4404);_0x1a8f6a(_0x25fe4a[_0x263f('0x12')](0x1f4,_0x472892[_0x263f('0x15')]));});});}; \ No newline at end of file +var _0x6799=['../../config/utils','../../config/environment','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find','debug','bluebird','randomstring','ioredis'];(function(_0x48dd91,_0x55396e){var _0x26bac3=function(_0x1ce39f){while(--_0x1ce39f){_0x48dd91['push'](_0x48dd91['shift']());}};_0x26bac3(++_0x55396e);}(_0x6799,0x1ed));var _0x9679=function(_0x2ffa6a,_0xdd7336){_0x2ffa6a=_0x2ffa6a-0x0;var _0x16bbd7=_0x6799[_0x2ffa6a];return _0x16bbd7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9679('0x0'));var rs=require(_0x9679('0x1'));var fs=require('fs');var Redis=require(_0x9679('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9679('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x9679('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9679('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1c40eb,_0x336bc4,_0x2c260b){return new BPromise(function(_0x217928,_0x57c843){return client[_0x9679('0x6')](_0x1c40eb,_0x2c260b)[_0x9679('0x7')](function(_0x248d76){logger[_0x9679('0x8')](_0x9679('0x9'),_0x336bc4,'request\x20sent');logger['debug'](_0x9679('0xa'),_0x336bc4,_0x9679('0xb'),JSON[_0x9679('0xc')](_0x248d76));if(_0x248d76[_0x9679('0xd')]){if(_0x248d76['error']['code']===0x1f4){logger[_0x9679('0xd')](_0x9679('0x9'),_0x336bc4,_0x248d76['error']['message']);return _0x57c843(_0x248d76[_0x9679('0xd')][_0x9679('0xe')]);}logger[_0x9679('0xd')](_0x9679('0x9'),_0x336bc4,_0x248d76[_0x9679('0xd')][_0x9679('0xe')]);return _0x217928(_0x248d76[_0x9679('0xd')][_0x9679('0xe')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x336bc4,_0x9679('0xb'));_0x217928(_0x248d76[_0x9679('0xf')]['message']);}})[_0x9679('0x10')](function(_0x4543c5){logger['error'](_0x9679('0x9'),_0x336bc4,_0x4543c5);_0x57c843(_0x4543c5);});});}exports[_0x9679('0x11')]=function(_0xb4a3db){var _0x12fdaa=this;return new Promise(function(_0x3d2a34,_0x37e02e){return db[_0x9679('0x12')][_0x9679('0x13')]({'raw':_0xb4a3db[_0x9679('0x14')]?_0xb4a3db['options'][_0x9679('0x15')]===undefined?!![]:![]:!![],'where':_0xb4a3db['options']?_0xb4a3db['options'][_0x9679('0x16')]||null:null,'attributes':_0xb4a3db['options']?_0xb4a3db[_0x9679('0x14')][_0x9679('0x17')]||null:null,'limit':_0xb4a3db['options']?_0xb4a3db[_0x9679('0x14')][_0x9679('0x18')]||null:null,'include':_0xb4a3db[_0x9679('0x14')]?_0xb4a3db[_0x9679('0x14')][_0x9679('0x19')]?_[_0x9679('0x1a')](_0xb4a3db['options'][_0x9679('0x19')],function(_0x232be9){return{'model':db[_0x232be9[_0x9679('0x1b')]],'as':_0x232be9['as'],'attributes':_0x232be9['attributes'],'include':_0x232be9[_0x9679('0x19')]?_[_0x9679('0x1a')](_0x232be9[_0x9679('0x19')],function(_0x397cb8){return{'model':db[_0x397cb8[_0x9679('0x1b')]],'as':_0x397cb8['as'],'attributes':_0x397cb8[_0x9679('0x17')],'include':_0x397cb8[_0x9679('0x19')]?_['map'](_0x397cb8[_0x9679('0x19')],function(_0xc1b64d){return{'model':db[_0xc1b64d[_0x9679('0x1b')]],'as':_0xc1b64d['as'],'attributes':_0xc1b64d[_0x9679('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9679('0x7')](function(_0x6e84c3){logger['info']('GetZendeskAccount',_0xb4a3db);logger['debug'](_0x9679('0x11'),_0xb4a3db,JSON[_0x9679('0xc')](_0x6e84c3));_0x3d2a34(_0x6e84c3);})[_0x9679('0x10')](function(_0x2256b4){logger[_0x9679('0xd')](_0x9679('0x11'),_0x2256b4[_0x9679('0xe')],_0xb4a3db);_0x37e02e(_0x12fdaa['error'](0x1f4,_0x2256b4['message']));});});};exports[_0x9679('0x1c')]=function(_0x1300d2){var _0x56a17e=this;return new Promise(function(_0x407bfe,_0x355e4e){return db[_0x9679('0x12')][_0x9679('0x1d')]({'raw':_0x1300d2[_0x9679('0x14')]?_0x1300d2[_0x9679('0x14')][_0x9679('0x15')]===undefined?!![]:![]:!![],'where':_0x1300d2[_0x9679('0x14')]?_0x1300d2['options'][_0x9679('0x16')]||null:null,'attributes':_0x1300d2['options']?_0x1300d2[_0x9679('0x14')][_0x9679('0x17')]||null:null,'include':_0x1300d2[_0x9679('0x14')]?_0x1300d2[_0x9679('0x14')][_0x9679('0x19')]?_[_0x9679('0x1a')](_0x1300d2[_0x9679('0x14')][_0x9679('0x19')],function(_0x284c23){return{'model':db[_0x284c23[_0x9679('0x1b')]],'as':_0x284c23['as'],'attributes':_0x284c23['attributes'],'include':_0x284c23[_0x9679('0x19')]?_[_0x9679('0x1a')](_0x284c23['include'],function(_0x20522c){return{'model':db[_0x20522c[_0x9679('0x1b')]],'as':_0x20522c['as'],'attributes':_0x20522c[_0x9679('0x17')],'include':_0x20522c[_0x9679('0x19')]?_[_0x9679('0x1a')](_0x20522c[_0x9679('0x19')],function(_0x4196c6){return{'model':db[_0x4196c6[_0x9679('0x1b')]],'as':_0x4196c6['as'],'attributes':_0x4196c6[_0x9679('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9679('0x7')](function(_0xcb677d){logger[_0x9679('0x8')]('ShowZendeskAccount',_0x1300d2);logger[_0x9679('0x1e')]('ShowZendeskAccount',_0x1300d2,JSON[_0x9679('0xc')](_0xcb677d));_0x407bfe(_0xcb677d);})[_0x9679('0x10')](function(_0x2369d0){logger[_0x9679('0xd')]('ShowZendeskAccount',_0x2369d0[_0x9679('0xe')],_0x1300d2);_0x355e4e(_0x56a17e['error'](0x1f4,_0x2369d0[_0x9679('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index e370e44..31bd5d1 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 _0xdac2=['create','setTags','put','update','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xdac2,0x72));var _0x2dac=function(_0x1e1d07,_0x299b1e){_0x1e1d07=_0x1e1d07-0x0;var _0x225dce=_0xdac2[_0x1e1d07];return _0x225dce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2dac('0x0'));var timeout=require(_0x2dac('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x2dac('0x2'));var interaction=require(_0x2dac('0x3'));var config=require('../../config/environment');var controller=require(_0x2dac('0x4'));router[_0x2dac('0x5')]('/',auth[_0x2dac('0x6')](),controller['index']);router['get'](_0x2dac('0x7'),auth[_0x2dac('0x6')](),controller[_0x2dac('0x8')]);router[_0x2dac('0x5')](_0x2dac('0x9'),auth[_0x2dac('0x6')](),controller[_0x2dac('0xa')]);router['get'](_0x2dac('0xb'),auth[_0x2dac('0x6')](),controller[_0x2dac('0xc')]);router[_0x2dac('0x5')](_0x2dac('0xd'),auth[_0x2dac('0x6')](),controller[_0x2dac('0xe')]);router[_0x2dac('0x5')](_0x2dac('0xf'),auth['isAuthenticated'](),controller[_0x2dac('0x10')]);router[_0x2dac('0x11')]('/',auth[_0x2dac('0x6')](),controller[_0x2dac('0x12')]);router[_0x2dac('0x11')](_0x2dac('0xf'),auth['isAuthenticated'](),controller[_0x2dac('0x13')]);router[_0x2dac('0x14')](_0x2dac('0x7'),auth[_0x2dac('0x6')](),controller[_0x2dac('0x15')]);router['delete'](_0x2dac('0x7'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x85ed=['./intZendeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x53e1f8,_0xb1b4ea){var _0x22b761=function(_0x15d23b){while(--_0x15d23b){_0x53e1f8['push'](_0x53e1f8['shift']());}};_0x22b761(++_0xb1b4ea);}(_0x85ed,0xb9));var _0xd85e=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x85ed[_0x29db36];return _0x234e87;};'use strict';var multer=require(_0xd85e('0x0'));var util=require('util');var path=require(_0xd85e('0x1'));var timeout=require(_0xd85e('0x2'));var express=require(_0xd85e('0x3'));var router=express[_0xd85e('0x4')]();var auth=require(_0xd85e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd85e('0x6'));var controller=require(_0xd85e('0x7'));router[_0xd85e('0x8')]('/',auth[_0xd85e('0x9')](),controller['index']);router[_0xd85e('0x8')](_0xd85e('0xa'),auth[_0xd85e('0x9')](),controller['show']);router[_0xd85e('0x8')](_0xd85e('0xb'),auth[_0xd85e('0x9')](),controller[_0xd85e('0xc')]);router[_0xd85e('0x8')](_0xd85e('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xd85e('0x8')](_0xd85e('0xe'),auth['isAuthenticated'](),controller[_0xd85e('0xf')]);router[_0xd85e('0x8')](_0xd85e('0x10'),auth[_0xd85e('0x9')](),controller[_0xd85e('0x11')]);router['post']('/',auth[_0xd85e('0x9')](),controller['create']);router[_0xd85e('0x12')]('/:id/tags',auth[_0xd85e('0x9')](),controller['setTags']);router[_0xd85e('0x13')](_0xd85e('0xa'),auth[_0xd85e('0x9')](),controller[_0xd85e('0x14')]);router[_0xd85e('0x15')](_0xd85e('0xa'),auth[_0xd85e('0x9')](),controller[_0xd85e('0x16')]);module[_0xd85e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 95d9cdc..7bef083 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 _0xb9a5=['exports','STRING'];(function(_0x2ad1a2,_0x3cd0ff){var _0x23f77b=function(_0x2e9bb8){while(--_0x2e9bb8){_0x2ad1a2['push'](_0x2ad1a2['shift']());}};_0x23f77b(++_0x3cd0ff);}(_0xb9a5,0x190));var _0x5b9a=function(_0x66f455,_0x43978d){_0x66f455=_0x66f455-0x0;var _0x2f4d67=_0xb9a5[_0x66f455];return _0x2f4d67;};'use strict';var Sequelize=require('sequelize');module[_0x5b9a('0x0')]={'name':{'type':Sequelize[_0x5b9a('0x1')]},'description':{'type':Sequelize[_0x5b9a('0x1')]}}; \ No newline at end of file +var _0xd95f=['sequelize','exports','STRING'];(function(_0x5bba5c,_0x589fda){var _0x5979bf=function(_0xcec083){while(--_0xcec083){_0x5bba5c['push'](_0x5bba5c['shift']());}};_0x5979bf(++_0x589fda);}(_0xd95f,0x1c2));var _0xfd95=function(_0x17936b,_0x4ba5f7){_0x17936b=_0x17936b-0x0;var _0xf3d364=_0xd95f[_0x17936b];return _0xf3d364;};'use strict';var Sequelize=require(_0xfd95('0x0'));module[_0xfd95('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfd95('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index adc9998..55f0246 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 _0xfbec=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','send','ZendeskConfiguration','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','type','key','filter','options','includeAll','rows','catch','show','params','include','find','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x2b4249,_0xed39be){var _0x2b4d89=function(_0x3423c7){while(--_0x3423c7){_0x2b4249['push'](_0x2b4249['shift']());}};_0x2b4d89(++_0xed39be);}(_0xfbec,0x105));var _0xcfbe=function(_0x525c9c,_0x5a53b8){_0x525c9c=_0x525c9c-0x0;var _0x51a543=_0xfbec[_0x525c9c];return _0x51a543;};'use strict';var pdf=require(_0xcfbe('0x0'));var emlformat=require(_0xcfbe('0x1'));var rimraf=require(_0xcfbe('0x2'));var zipdir=require(_0xcfbe('0x3'));var jsonpatch=require(_0xcfbe('0x4'));var rp=require('request-promise');var moment=require(_0xcfbe('0x5'));var BPromise=require(_0xcfbe('0x6'));var Mustache=require('mustache');var util=require(_0xcfbe('0x7'));var path=require(_0xcfbe('0x8'));var sox=require(_0xcfbe('0x9'));var csv=require(_0xcfbe('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcfbe('0xb'));var squel=require(_0xcfbe('0xc'));var crypto=require(_0xcfbe('0xd'));var jsforce=require(_0xcfbe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcfbe('0xa'));var querystring=require(_0xcfbe('0xf'));var Papa=require(_0xcfbe('0x10'));var Redis=require(_0xcfbe('0x11'));var authService=require(_0xcfbe('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcfbe('0x13'));var logger=require(_0xcfbe('0x14'))(_0xcfbe('0x15'));var utils=require(_0xcfbe('0x16'));var config=require('../../config/environment');var db=require(_0xcfbe('0x17'))['db'];var jayson=require(_0xcfbe('0x18'));var client=jayson['client'][_0xcfbe('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5a7800,_0x143b42,_0x1976ab){if(_0x1976ab){var _0x5c1e5b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c1e5b[_0xcfbe('0x1a')](_0x143b42)){return _0x5a7800;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5a7800;}}function respondWithRpcPromise(_0x440ca3,_0x23c7a7,_0x539f41,_0x28384){return new BPromise(function(_0x66c849,_0x510e85){var _0x4c8519=_0x28384||client;return _0x4c8519[_0xcfbe('0x1b')](_0x440ca3,_0x539f41)[_0xcfbe('0x1c')](function(_0x238170){logger[_0xcfbe('0x1d')](_0xcfbe('0x1e'),_0x23c7a7,_0xcfbe('0x1f'));logger[_0xcfbe('0x20')](_0xcfbe('0x21'),_0x23c7a7,_0xcfbe('0x1f'),JSON[_0xcfbe('0x22')](_0x238170));if(_0x238170[_0xcfbe('0x23')]){if(_0x238170['error'][_0xcfbe('0x24')]===0x1f4){logger[_0xcfbe('0x23')](_0xcfbe('0x1e'),_0x23c7a7,_0x238170[_0xcfbe('0x23')][_0xcfbe('0x25')]);return _0x510e85(_0x238170[_0xcfbe('0x23')][_0xcfbe('0x25')]);}logger[_0xcfbe('0x23')](_0xcfbe('0x1e'),_0x23c7a7,_0x238170[_0xcfbe('0x23')][_0xcfbe('0x25')]);return _0x66c849(_0x238170[_0xcfbe('0x23')][_0xcfbe('0x25')]);}else{logger[_0xcfbe('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x23c7a7,'request\x20sent');_0x66c849(_0x238170['result']['message']);}})['catch'](function(_0x4fe923){logger['error'](_0xcfbe('0x1e'),_0x23c7a7,_0x4fe923);_0x510e85(_0x4fe923);});});}function respondWithStatusCode(_0x5aa897,_0x316edc){_0x316edc=_0x316edc||0xcc;return function(_0x9c22bb){if(_0x9c22bb){return _0x5aa897[_0xcfbe('0x26')](_0x316edc);}return _0x5aa897[_0xcfbe('0x27')](_0x316edc)['end']();};}function respondWithResult(_0x4af507,_0x40931f){_0x40931f=_0x40931f||0xc8;return function(_0x4cb3ea){if(_0x4cb3ea){return _0x4af507[_0xcfbe('0x27')](_0x40931f)[_0xcfbe('0x28')](_0x4cb3ea);}};}function respondWithFilteredResult(_0x149109,_0x174ee7){return function(_0x878b2){if(_0x878b2){var _0xb68bf5=_0x878b2[_0xcfbe('0x29')],_0x46400f=_0x174ee7[_0xcfbe('0x2a')],_0xfd4efa=_0x174ee7[_0xcfbe('0x2a')]+_0x174ee7[_0xcfbe('0x2b')],_0x4c62fa;if(_0xfd4efa>=_0xb68bf5){_0xfd4efa=_0xb68bf5;_0x4c62fa=0xc8;}else{_0x4c62fa=0xce;}_0x149109['status'](_0x4c62fa);return _0x149109[_0xcfbe('0x2c')](_0xcfbe('0x2d'),_0x46400f+'-'+_0xfd4efa+'/'+_0xb68bf5)['json'](_0x878b2);}return null;};}function patchUpdates(_0x44cc08){return function(_0x3e565a){try{jsonpatch['apply'](_0x3e565a,_0x44cc08,!![]);}catch(_0x421815){return BPromise[_0xcfbe('0x2e')](_0x421815);}return _0x3e565a[_0xcfbe('0x2f')]();};}function saveUpdates(_0x124440,_0x37d552){return function(_0x14e5c1){if(_0x14e5c1){return _0x14e5c1[_0xcfbe('0x30')](_0x124440)['then'](function(_0x539b71){return _0x539b71;});}return null;};}function removeEntity(_0x5377aa,_0x671390){return function(_0x1db44){if(_0x1db44){return _0x1db44[_0xcfbe('0x31')]()[_0xcfbe('0x1c')](function(){_0x5377aa[_0xcfbe('0x27')](0xcc)[_0xcfbe('0x32')]();});}};}function handleEntityNotFound(_0x7810d4,_0x3c0956){return function(_0x3ae0eb){if(!_0x3ae0eb){_0x7810d4[_0xcfbe('0x26')](0x194);}return _0x3ae0eb;};}function handleError(_0x44b334,_0x199c6a){_0x199c6a=_0x199c6a||0x1f4;return function(_0x3d70ed){logger[_0xcfbe('0x23')](_0x3d70ed[_0xcfbe('0x33')]);if(_0x3d70ed[_0xcfbe('0x34')]){delete _0x3d70ed['name'];}_0x44b334[_0xcfbe('0x27')](_0x199c6a)[_0xcfbe('0x35')](_0x3d70ed);};}exports['index']=function(_0x4612b6,_0x57c3dd){var _0x2f6cf6={},_0x27b4fb={},_0x48c7a5={'count':0x0,'rows':[]};var _0x1c40b0=db[_0xcfbe('0x36')][_0xcfbe('0x37')];_0x27b4fb[_0xcfbe('0x38')]=_[_0xcfbe('0x39')](_0x1c40b0);_0x27b4fb['query']=_['keys'](_0x4612b6[_0xcfbe('0x3a')]);_0x27b4fb['filters']=_['intersection'](_0x27b4fb[_0xcfbe('0x38')],_0x27b4fb[_0xcfbe('0x3a')]);_0x2f6cf6[_0xcfbe('0x3b')]=_[_0xcfbe('0x3c')](_0x27b4fb[_0xcfbe('0x38')],qs[_0xcfbe('0x3d')](_0x4612b6['query'][_0xcfbe('0x3d')]));_0x2f6cf6[_0xcfbe('0x3b')]=_0x2f6cf6[_0xcfbe('0x3b')][_0xcfbe('0x3e')]?_0x2f6cf6[_0xcfbe('0x3b')]:_0x27b4fb[_0xcfbe('0x38')];if(!_0x4612b6[_0xcfbe('0x3a')][_0xcfbe('0x3f')](_0xcfbe('0x40'))){_0x2f6cf6[_0xcfbe('0x2b')]=qs[_0xcfbe('0x2b')](_0x4612b6[_0xcfbe('0x3a')][_0xcfbe('0x2b')]);_0x2f6cf6['offset']=qs[_0xcfbe('0x2a')](_0x4612b6[_0xcfbe('0x3a')]['offset']);}_0x2f6cf6[_0xcfbe('0x41')]=qs['sort'](_0x4612b6[_0xcfbe('0x3a')][_0xcfbe('0x42')]);_0x2f6cf6[_0xcfbe('0x43')]=qs['filters'](_[_0xcfbe('0x44')](_0x4612b6[_0xcfbe('0x3a')],_0x27b4fb[_0xcfbe('0x45')]));if(_0x4612b6[_0xcfbe('0x3a')]['filter']){_0x2f6cf6[_0xcfbe('0x43')]=_[_0xcfbe('0x46')](_0x2f6cf6[_0xcfbe('0x43')],{'$or':_[_0xcfbe('0x47')](_0x1c40b0,function(_0x5063a6){if(_0x5063a6[_0xcfbe('0x48')][_0xcfbe('0x49')]!=='VIRTUAL'){var _0x4c83b9={};_0x4c83b9[_0x5063a6['field']]={'$like':'%'+_0x4612b6[_0xcfbe('0x3a')][_0xcfbe('0x4a')]+'%'};return _0x4c83b9;}})});}_0x2f6cf6=_[_0xcfbe('0x46')]({},_0x2f6cf6,_0x4612b6[_0xcfbe('0x4b')]);var _0x312697={'where':_0x2f6cf6['where']};return db[_0xcfbe('0x36')][_0xcfbe('0x29')](_0x312697)[_0xcfbe('0x1c')](function(_0x4c2fd2){_0x48c7a5[_0xcfbe('0x29')]=_0x4c2fd2;if(_0x4612b6[_0xcfbe('0x3a')][_0xcfbe('0x4c')]){_0x2f6cf6['include']=[{'all':!![]}];}return db[_0xcfbe('0x36')]['findAll'](_0x2f6cf6);})['then'](function(_0x557d82){_0x48c7a5[_0xcfbe('0x4d')]=_0x557d82;return _0x48c7a5;})[_0xcfbe('0x1c')](respondWithFilteredResult(_0x57c3dd,_0x2f6cf6))[_0xcfbe('0x4e')](handleError(_0x57c3dd,null));};exports[_0xcfbe('0x4f')]=function(_0x1b9992,_0x4e515b){var _0x36d6df={'raw':![],'where':{'id':_0x1b9992[_0xcfbe('0x50')]['id']}},_0x2c2b53={};_0x2c2b53[_0xcfbe('0x38')]=_['keys'](db[_0xcfbe('0x36')][_0xcfbe('0x37')]);_0x2c2b53[_0xcfbe('0x3a')]=_[_0xcfbe('0x39')](_0x1b9992['query']);_0x2c2b53[_0xcfbe('0x45')]=_['intersection'](_0x2c2b53['model'],_0x2c2b53[_0xcfbe('0x3a')]);_0x36d6df['attributes']=_[_0xcfbe('0x3c')](_0x2c2b53[_0xcfbe('0x38')],qs[_0xcfbe('0x3d')](_0x1b9992[_0xcfbe('0x3a')]['fields']));_0x36d6df[_0xcfbe('0x3b')]=_0x36d6df['attributes'][_0xcfbe('0x3e')]?_0x36d6df[_0xcfbe('0x3b')]:_0x2c2b53[_0xcfbe('0x38')];if(_0x1b9992[_0xcfbe('0x3a')][_0xcfbe('0x4c')]){_0x36d6df[_0xcfbe('0x51')]=[{'all':!![]}];}_0x36d6df=_[_0xcfbe('0x46')]({},_0x36d6df,_0x1b9992['options']);return db[_0xcfbe('0x36')][_0xcfbe('0x52')](_0x36d6df)[_0xcfbe('0x1c')](handleEntityNotFound(_0x4e515b,null))[_0xcfbe('0x1c')](respondWithResult(_0x4e515b,null))[_0xcfbe('0x4e')](handleError(_0x4e515b,null));};exports['create']=function(_0x3afe15,_0x568208){return db[_0xcfbe('0x36')]['create'](_0x3afe15[_0xcfbe('0x53')],{})['then'](respondWithResult(_0x568208,0xc9))[_0xcfbe('0x4e')](handleError(_0x568208,null));};exports['update']=function(_0x58329c,_0x56797e){if(_0x58329c[_0xcfbe('0x53')]['id']){delete _0x58329c[_0xcfbe('0x53')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x58329c['params']['id']}})[_0xcfbe('0x1c')](handleEntityNotFound(_0x56797e,null))['then'](saveUpdates(_0x58329c[_0xcfbe('0x53')],null))[_0xcfbe('0x1c')](respondWithResult(_0x56797e,null))[_0xcfbe('0x4e')](handleError(_0x56797e,null));};exports[_0xcfbe('0x31')]=function(_0x1ce79a,_0x5ecf2d){return db[_0xcfbe('0x36')][_0xcfbe('0x52')]({'where':{'id':_0x1ce79a[_0xcfbe('0x50')]['id']}})[_0xcfbe('0x1c')](handleEntityNotFound(_0x5ecf2d,null))[_0xcfbe('0x1c')](removeEntity(_0x5ecf2d,null))[_0xcfbe('0x4e')](handleError(_0x5ecf2d,null));};exports[_0xcfbe('0x54')]=function(_0x44ec53,_0xdbaf30,_0x345af0){var _0x22931f={};var _0x29ab66={};var _0x16ae41;var _0x5778a4;return db[_0xcfbe('0x36')][_0xcfbe('0x55')]({'where':{'id':_0x44ec53[_0xcfbe('0x50')]['id']}})[_0xcfbe('0x1c')](handleEntityNotFound(_0xdbaf30,null))[_0xcfbe('0x1c')](function(_0x3ab6e7){if(_0x3ab6e7){_0x16ae41=_0x3ab6e7;_0x29ab66[_0xcfbe('0x38')]=_[_0xcfbe('0x39')](db[_0xcfbe('0x56')]['rawAttributes']);_0x29ab66['query']=_[_0xcfbe('0x39')](_0x44ec53[_0xcfbe('0x3a')]);_0x29ab66[_0xcfbe('0x45')]=_['intersection'](_0x29ab66['model'],_0x29ab66['query']);_0x22931f[_0xcfbe('0x3b')]=_[_0xcfbe('0x3c')](_0x29ab66[_0xcfbe('0x38')],qs[_0xcfbe('0x3d')](_0x44ec53[_0xcfbe('0x3a')][_0xcfbe('0x3d')]));_0x22931f[_0xcfbe('0x3b')]=_0x22931f[_0xcfbe('0x3b')]['length']?_0x22931f['attributes']:_0x29ab66['model'];_0x22931f[_0xcfbe('0x41')]=qs[_0xcfbe('0x42')](_0x44ec53[_0xcfbe('0x3a')][_0xcfbe('0x42')]);_0x22931f['where']=qs['filters'](_[_0xcfbe('0x44')](_0x44ec53[_0xcfbe('0x3a')],_0x29ab66[_0xcfbe('0x45')]));if(_0x44ec53[_0xcfbe('0x3a')][_0xcfbe('0x4a')]){_0x22931f[_0xcfbe('0x43')]=_[_0xcfbe('0x46')](_0x22931f['where'],{'$or':_[_0xcfbe('0x47')](_0x22931f[_0xcfbe('0x3b')],function(_0x40af22){var _0xfd9188={};_0xfd9188[_0x40af22]={'$like':'%'+_0x44ec53[_0xcfbe('0x3a')][_0xcfbe('0x4a')]+'%'};return _0xfd9188;})});}_0x22931f=_[_0xcfbe('0x46')]({},_0x22931f,_0x44ec53['options']);return _0x16ae41[_0xcfbe('0x54')](_0x22931f);}})['then'](function(_0x416805){if(_0x416805){_0x5778a4=_0x416805[_0xcfbe('0x3e')];if(!_0x44ec53[_0xcfbe('0x3a')][_0xcfbe('0x3f')](_0xcfbe('0x40'))){_0x22931f[_0xcfbe('0x2b')]=qs['limit'](_0x44ec53[_0xcfbe('0x3a')]['limit']);_0x22931f[_0xcfbe('0x2a')]=qs[_0xcfbe('0x2a')](_0x44ec53['query']['offset']);}return _0x16ae41[_0xcfbe('0x54')](_0x22931f);}})['then'](function(_0x4c1cee){if(_0x4c1cee){return _0x4c1cee?{'count':_0x5778a4,'rows':_0x4c1cee}:null;}})[_0xcfbe('0x1c')](respondWithResult(_0xdbaf30,null))['catch'](handleError(_0xdbaf30,null));};exports[_0xcfbe('0x57')]=function(_0x43548e,_0x57b9d1,_0x5b2211){var _0x386a0f={};var _0x325e6a={};var _0x995cf;var _0x27dce8;return db[_0xcfbe('0x36')][_0xcfbe('0x55')]({'where':{'id':_0x43548e['params']['id']}})[_0xcfbe('0x1c')](handleEntityNotFound(_0x57b9d1,null))[_0xcfbe('0x1c')](function(_0x2f90c4){if(_0x2f90c4){_0x995cf=_0x2f90c4;_0x325e6a['model']=_[_0xcfbe('0x39')](db[_0xcfbe('0x56')][_0xcfbe('0x37')]);_0x325e6a[_0xcfbe('0x3a')]=_[_0xcfbe('0x39')](_0x43548e['query']);_0x325e6a['filters']=_[_0xcfbe('0x3c')](_0x325e6a[_0xcfbe('0x38')],_0x325e6a[_0xcfbe('0x3a')]);_0x386a0f[_0xcfbe('0x3b')]=_[_0xcfbe('0x3c')](_0x325e6a['model'],qs[_0xcfbe('0x3d')](_0x43548e[_0xcfbe('0x3a')][_0xcfbe('0x3d')]));_0x386a0f[_0xcfbe('0x3b')]=_0x386a0f[_0xcfbe('0x3b')][_0xcfbe('0x3e')]?_0x386a0f['attributes']:_0x325e6a['model'];_0x386a0f['order']=qs[_0xcfbe('0x42')](_0x43548e[_0xcfbe('0x3a')][_0xcfbe('0x42')]);_0x386a0f[_0xcfbe('0x43')]=qs[_0xcfbe('0x45')](_[_0xcfbe('0x44')](_0x43548e[_0xcfbe('0x3a')],_0x325e6a[_0xcfbe('0x45')]));if(_0x43548e[_0xcfbe('0x3a')][_0xcfbe('0x4a')]){_0x386a0f[_0xcfbe('0x43')]=_[_0xcfbe('0x46')](_0x386a0f['where'],{'$or':_[_0xcfbe('0x47')](_0x386a0f[_0xcfbe('0x3b')],function(_0x18bc3f){var _0x21df54={};_0x21df54[_0x18bc3f]={'$like':'%'+_0x43548e[_0xcfbe('0x3a')][_0xcfbe('0x4a')]+'%'};return _0x21df54;})});}_0x386a0f=_['merge']({},_0x386a0f,_0x43548e['options']);return _0x995cf[_0xcfbe('0x57')](_0x386a0f);}})[_0xcfbe('0x1c')](function(_0x4ebd15){if(_0x4ebd15){_0x27dce8=_0x4ebd15[_0xcfbe('0x3e')];if(!_0x43548e[_0xcfbe('0x3a')]['hasOwnProperty']('nolimit')){_0x386a0f[_0xcfbe('0x2b')]=qs[_0xcfbe('0x2b')](_0x43548e[_0xcfbe('0x3a')][_0xcfbe('0x2b')]);_0x386a0f['offset']=qs[_0xcfbe('0x2a')](_0x43548e[_0xcfbe('0x3a')][_0xcfbe('0x2a')]);}return _0x995cf['getSubjects'](_0x386a0f);}})[_0xcfbe('0x1c')](function(_0x153a9c){if(_0x153a9c){return _0x153a9c?{'count':_0x27dce8,'rows':_0x153a9c}:null;}})[_0xcfbe('0x1c')](respondWithResult(_0x57b9d1,null))[_0xcfbe('0x4e')](handleError(_0x57b9d1,null));};exports[_0xcfbe('0x58')]=function(_0x448afb,_0x41a019,_0x1d3296){var _0xbc1de3={};var _0x22526a={};var _0xee8a6e;var _0x256190;return db[_0xcfbe('0x36')][_0xcfbe('0x55')]({'where':{'id':_0x448afb[_0xcfbe('0x50')]['id']}})['then'](handleEntityNotFound(_0x41a019,null))[_0xcfbe('0x1c')](function(_0x8eb107){if(_0x8eb107){_0xee8a6e=_0x8eb107;_0x22526a[_0xcfbe('0x38')]=_[_0xcfbe('0x39')](db['ZendeskField'][_0xcfbe('0x37')]);_0x22526a[_0xcfbe('0x3a')]=_[_0xcfbe('0x39')](_0x448afb[_0xcfbe('0x3a')]);_0x22526a[_0xcfbe('0x45')]=_[_0xcfbe('0x3c')](_0x22526a[_0xcfbe('0x38')],_0x22526a['query']);_0xbc1de3[_0xcfbe('0x3b')]=_[_0xcfbe('0x3c')](_0x22526a[_0xcfbe('0x38')],qs['fields'](_0x448afb[_0xcfbe('0x3a')][_0xcfbe('0x3d')]));_0xbc1de3[_0xcfbe('0x3b')]=_0xbc1de3['attributes'][_0xcfbe('0x3e')]?_0xbc1de3[_0xcfbe('0x3b')]:_0x22526a[_0xcfbe('0x38')];_0xbc1de3['order']=qs[_0xcfbe('0x42')](_0x448afb[_0xcfbe('0x3a')][_0xcfbe('0x42')]);_0xbc1de3['where']=qs['filters'](_['pick'](_0x448afb[_0xcfbe('0x3a')],_0x22526a['filters']));if(_0x448afb[_0xcfbe('0x3a')][_0xcfbe('0x4a')]){_0xbc1de3[_0xcfbe('0x43')]=_[_0xcfbe('0x46')](_0xbc1de3[_0xcfbe('0x43')],{'$or':_[_0xcfbe('0x47')](_0xbc1de3[_0xcfbe('0x3b')],function(_0x35d2ec){var _0xc24c47={};_0xc24c47[_0x35d2ec]={'$like':'%'+_0x448afb[_0xcfbe('0x3a')][_0xcfbe('0x4a')]+'%'};return _0xc24c47;})});}_0xbc1de3=_[_0xcfbe('0x46')]({},_0xbc1de3,_0x448afb[_0xcfbe('0x4b')]);return _0xee8a6e['getDescriptions'](_0xbc1de3);}})[_0xcfbe('0x1c')](function(_0x1aad2c){if(_0x1aad2c){_0x256190=_0x1aad2c[_0xcfbe('0x3e')];if(!_0x448afb[_0xcfbe('0x3a')]['hasOwnProperty'](_0xcfbe('0x40'))){_0xbc1de3[_0xcfbe('0x2b')]=qs[_0xcfbe('0x2b')](_0x448afb['query'][_0xcfbe('0x2b')]);_0xbc1de3['offset']=qs['offset'](_0x448afb[_0xcfbe('0x3a')]['offset']);}return _0xee8a6e[_0xcfbe('0x58')](_0xbc1de3);}})[_0xcfbe('0x1c')](function(_0x3609df){if(_0x3609df){return _0x3609df?{'count':_0x256190,'rows':_0x3609df}:null;}})[_0xcfbe('0x1c')](respondWithResult(_0x41a019,null))[_0xcfbe('0x4e')](handleError(_0x41a019,null));};exports[_0xcfbe('0x59')]=function(_0x1b396d,_0x1ceb2c,_0x43308c){var _0x4ba20a={};var _0x3c8aa2={};var _0xd50c7e;var _0xb60f9;return db[_0xcfbe('0x36')][_0xcfbe('0x55')]({'where':{'id':_0x1b396d[_0xcfbe('0x50')]['id']}})[_0xcfbe('0x1c')](handleEntityNotFound(_0x1ceb2c,null))[_0xcfbe('0x1c')](function(_0x34d5c0){if(_0x34d5c0){_0xd50c7e=_0x34d5c0;_0x3c8aa2['model']=_[_0xcfbe('0x39')](db[_0xcfbe('0x5a')][_0xcfbe('0x37')]);_0x3c8aa2['query']=_[_0xcfbe('0x39')](_0x1b396d[_0xcfbe('0x3a')]);_0x3c8aa2[_0xcfbe('0x45')]=_[_0xcfbe('0x3c')](_0x3c8aa2[_0xcfbe('0x38')],_0x3c8aa2['query']);_0x4ba20a['attributes']=_[_0xcfbe('0x3c')](_0x3c8aa2[_0xcfbe('0x38')],qs[_0xcfbe('0x3d')](_0x1b396d[_0xcfbe('0x3a')][_0xcfbe('0x3d')]));_0x4ba20a[_0xcfbe('0x3b')]=_0x4ba20a[_0xcfbe('0x3b')][_0xcfbe('0x3e')]?_0x4ba20a[_0xcfbe('0x3b')]:_0x3c8aa2[_0xcfbe('0x38')];_0x4ba20a['order']=qs[_0xcfbe('0x42')](_0x1b396d[_0xcfbe('0x3a')][_0xcfbe('0x42')]);_0x4ba20a[_0xcfbe('0x43')]=qs['filters'](_[_0xcfbe('0x44')](_0x1b396d[_0xcfbe('0x3a')],_0x3c8aa2[_0xcfbe('0x45')]));if(_0x1b396d['query'][_0xcfbe('0x4a')]){_0x4ba20a[_0xcfbe('0x43')]=_[_0xcfbe('0x46')](_0x4ba20a[_0xcfbe('0x43')],{'$or':_[_0xcfbe('0x47')](_0x4ba20a[_0xcfbe('0x3b')],function(_0x566360){var _0x4de3ef={};_0x4de3ef[_0x566360]={'$like':'%'+_0x1b396d[_0xcfbe('0x3a')][_0xcfbe('0x4a')]+'%'};return _0x4de3ef;})});}_0x4ba20a=_[_0xcfbe('0x46')]({},_0x4ba20a,_0x1b396d[_0xcfbe('0x4b')]);return _0xd50c7e[_0xcfbe('0x59')](_0x4ba20a);}})[_0xcfbe('0x1c')](function(_0x3dcc99){if(_0x3dcc99){_0xb60f9=_0x3dcc99['length'];if(!_0x1b396d[_0xcfbe('0x3a')]['hasOwnProperty'](_0xcfbe('0x40'))){_0x4ba20a[_0xcfbe('0x2b')]=qs[_0xcfbe('0x2b')](_0x1b396d[_0xcfbe('0x3a')]['limit']);_0x4ba20a[_0xcfbe('0x2a')]=qs[_0xcfbe('0x2a')](_0x1b396d['query'][_0xcfbe('0x2a')]);}return _0xd50c7e[_0xcfbe('0x59')](_0x4ba20a);}})[_0xcfbe('0x1c')](function(_0x40fea8){if(_0x40fea8){return _0x40fea8?{'count':_0xb60f9,'rows':_0x40fea8}:null;}})[_0xcfbe('0x1c')](respondWithResult(_0x1ceb2c,null))[_0xcfbe('0x4e')](handleError(_0x1ceb2c,null));};exports[_0xcfbe('0x5b')]=function(_0x4f92e1,_0x1af9e7,_0x182377){if(_0x4f92e1['body']['id']){delete _0x4f92e1['body']['id'];}return db[_0xcfbe('0x36')][_0xcfbe('0x55')]({'where':{'id':_0x4f92e1[_0xcfbe('0x50')]['id']}})[_0xcfbe('0x1c')](handleEntityNotFound(_0x1af9e7,null))[_0xcfbe('0x1c')](function(_0xde5c53){if(_0xde5c53){return _0xde5c53['setTags'](_0x4f92e1[_0xcfbe('0x53')]['ids']||[]);}return null;})['then'](respondWithResult(_0x1af9e7,null))['catch'](handleError(_0x1af9e7,null));}; \ No newline at end of file +var _0xd394=['ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','map','type','VIRTUAL','field','merge','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getFields','findOne','ZendeskField','order','filter','getSubjects','getDescriptions','hasOwnProperty','getTags','Tag','setTags'];(function(_0xcafb2b,_0x2cc85e){var _0x539f9a=function(_0x9a96e6){while(--_0x9a96e6){_0xcafb2b['push'](_0xcafb2b['shift']());}};_0x539f9a(++_0x2cc85e);}(_0xd394,0x1d2));var _0x4d39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd394[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4d39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d39('0x1'));var jsonpatch=require(_0x4d39('0x2'));var rp=require(_0x4d39('0x3'));var moment=require(_0x4d39('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d39('0x5'));var path=require(_0x4d39('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d39('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4d39('0x8'));var jsforce=require(_0x4d39('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4d39('0xa'));var querystring=require(_0x4d39('0xb'));var Papa=require(_0x4d39('0xc'));var Redis=require(_0x4d39('0xd'));var authService=require(_0x4d39('0xe'));var qs=require(_0x4d39('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d39('0x10'))(_0x4d39('0x11'));var utils=require('../../config/utils');var config=require(_0x4d39('0x12'));var db=require(_0x4d39('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4d39('0x14')][_0x4d39('0x15')]({'port':0x232a});function checkPasswordPattern(_0x52026c,_0x34cb98,_0x7d2769){if(_0x7d2769){var _0x1869fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1869fa['test'](_0x34cb98)){return _0x52026c;}else{throw new Error(_0x4d39('0x16'));}}else{return _0x52026c;}}function respondWithRpcPromise(_0x19e1ce,_0x403159,_0x2bf55b,_0x34b93c){return new BPromise(function(_0x84c73d,_0x16ecce){var _0x15e415=_0x34b93c||client;return _0x15e415[_0x4d39('0x17')](_0x19e1ce,_0x2bf55b)[_0x4d39('0x18')](function(_0x45110a){logger['info'](_0x4d39('0x19'),_0x403159,_0x4d39('0x1a'));logger[_0x4d39('0x1b')](_0x4d39('0x1c'),_0x403159,'request\x20sent',JSON[_0x4d39('0x1d')](_0x45110a));if(_0x45110a['error']){if(_0x45110a[_0x4d39('0x1e')][_0x4d39('0x1f')]===0x1f4){logger[_0x4d39('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s',_0x403159,_0x45110a['error'][_0x4d39('0x20')]);return _0x16ecce(_0x45110a[_0x4d39('0x1e')][_0x4d39('0x20')]);}logger[_0x4d39('0x1e')](_0x4d39('0x19'),_0x403159,_0x45110a[_0x4d39('0x1e')][_0x4d39('0x20')]);return _0x84c73d(_0x45110a[_0x4d39('0x1e')]['message']);}else{logger[_0x4d39('0x21')]('ZendeskConfiguration,\x20%s,\x20%s',_0x403159,_0x4d39('0x1a'));_0x84c73d(_0x45110a[_0x4d39('0x22')][_0x4d39('0x20')]);}})['catch'](function(_0x31a201){logger[_0x4d39('0x1e')](_0x4d39('0x19'),_0x403159,_0x31a201);_0x16ecce(_0x31a201);});});}function respondWithStatusCode(_0x49a413,_0x4f9acb){_0x4f9acb=_0x4f9acb||0xcc;return function(_0x2391df){if(_0x2391df){return _0x49a413[_0x4d39('0x23')](_0x4f9acb);}return _0x49a413[_0x4d39('0x24')](_0x4f9acb)[_0x4d39('0x25')]();};}function respondWithResult(_0x3bd0d6,_0x229f62){_0x229f62=_0x229f62||0xc8;return function(_0x179ece){if(_0x179ece){return _0x3bd0d6[_0x4d39('0x24')](_0x229f62)['json'](_0x179ece);}};}function respondWithFilteredResult(_0x2e1c19,_0x56da49){return function(_0x2d87aa){if(_0x2d87aa){var _0x438ac0=_0x2d87aa[_0x4d39('0x26')],_0x3f2c8d=_0x56da49[_0x4d39('0x27')],_0x496f96=_0x56da49[_0x4d39('0x27')]+_0x56da49['limit'],_0x35c807;if(_0x496f96>=_0x438ac0){_0x496f96=_0x438ac0;_0x35c807=0xc8;}else{_0x35c807=0xce;}_0x2e1c19[_0x4d39('0x24')](_0x35c807);return _0x2e1c19[_0x4d39('0x28')]('Content-Range',_0x3f2c8d+'-'+_0x496f96+'/'+_0x438ac0)[_0x4d39('0x29')](_0x2d87aa);}return null;};}function patchUpdates(_0x52578a){return function(_0x184c39){try{jsonpatch[_0x4d39('0x2a')](_0x184c39,_0x52578a,!![]);}catch(_0x3707f8){return BPromise[_0x4d39('0x2b')](_0x3707f8);}return _0x184c39[_0x4d39('0x2c')]();};}function saveUpdates(_0x117a66,_0x824552){return function(_0x474dd6){if(_0x474dd6){return _0x474dd6[_0x4d39('0x2d')](_0x117a66)[_0x4d39('0x18')](function(_0x3d7edd){return _0x3d7edd;});}return null;};}function removeEntity(_0x594054,_0x162875){return function(_0x549c5b){if(_0x549c5b){return _0x549c5b['destroy']()['then'](function(){_0x594054[_0x4d39('0x24')](0xcc)[_0x4d39('0x25')]();});}};}function handleEntityNotFound(_0x13efaf,_0x117caf){return function(_0x2050a){if(!_0x2050a){_0x13efaf[_0x4d39('0x23')](0x194);}return _0x2050a;};}function handleError(_0x2519d4,_0x35fe41){_0x35fe41=_0x35fe41||0x1f4;return function(_0x5d88ba){logger[_0x4d39('0x1e')](_0x5d88ba[_0x4d39('0x2e')]);if(_0x5d88ba['name']){delete _0x5d88ba[_0x4d39('0x2f')];}_0x2519d4[_0x4d39('0x24')](_0x35fe41)[_0x4d39('0x30')](_0x5d88ba);};}exports[_0x4d39('0x31')]=function(_0x186bf5,_0x7b084f){var _0x11ae56={},_0x57c6ec={},_0x3a2689={'count':0x0,'rows':[]};var _0x509658=db['ZendeskConfiguration'][_0x4d39('0x32')];_0x57c6ec[_0x4d39('0x33')]=_[_0x4d39('0x34')](_0x509658);_0x57c6ec[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0x186bf5[_0x4d39('0x35')]);_0x57c6ec[_0x4d39('0x36')]=_[_0x4d39('0x37')](_0x57c6ec['model'],_0x57c6ec[_0x4d39('0x35')]);_0x11ae56['attributes']=_[_0x4d39('0x37')](_0x57c6ec[_0x4d39('0x33')],qs[_0x4d39('0x38')](_0x186bf5['query'][_0x4d39('0x38')]));_0x11ae56[_0x4d39('0x39')]=_0x11ae56[_0x4d39('0x39')][_0x4d39('0x3a')]?_0x11ae56[_0x4d39('0x39')]:_0x57c6ec['model'];if(!_0x186bf5[_0x4d39('0x35')]['hasOwnProperty'](_0x4d39('0x3b'))){_0x11ae56[_0x4d39('0x3c')]=qs[_0x4d39('0x3c')](_0x186bf5[_0x4d39('0x35')][_0x4d39('0x3c')]);_0x11ae56[_0x4d39('0x27')]=qs[_0x4d39('0x27')](_0x186bf5[_0x4d39('0x35')][_0x4d39('0x27')]);}_0x11ae56['order']=qs[_0x4d39('0x3d')](_0x186bf5[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x11ae56[_0x4d39('0x3e')]=qs[_0x4d39('0x36')](_[_0x4d39('0x3f')](_0x186bf5[_0x4d39('0x35')],_0x57c6ec[_0x4d39('0x36')]));if(_0x186bf5['query']['filter']){_0x11ae56[_0x4d39('0x3e')]=_['merge'](_0x11ae56[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x40')](_0x509658,function(_0x14a7c7){if(_0x14a7c7[_0x4d39('0x41')]['key']!==_0x4d39('0x42')){var _0x556a89={};_0x556a89[_0x14a7c7[_0x4d39('0x43')]]={'$like':'%'+_0x186bf5[_0x4d39('0x35')]['filter']+'%'};return _0x556a89;}})});}_0x11ae56=_[_0x4d39('0x44')]({},_0x11ae56,_0x186bf5[_0x4d39('0x45')]);var _0x1aed70={'where':_0x11ae56[_0x4d39('0x3e')]};return db[_0x4d39('0x46')][_0x4d39('0x26')](_0x1aed70)[_0x4d39('0x18')](function(_0x5b4378){_0x3a2689[_0x4d39('0x26')]=_0x5b4378;if(_0x186bf5[_0x4d39('0x35')][_0x4d39('0x47')]){_0x11ae56[_0x4d39('0x48')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x4d39('0x49')](_0x11ae56);})[_0x4d39('0x18')](function(_0x398886){_0x3a2689[_0x4d39('0x4a')]=_0x398886;return _0x3a2689;})['then'](respondWithFilteredResult(_0x7b084f,_0x11ae56))[_0x4d39('0x4b')](handleError(_0x7b084f,null));};exports['show']=function(_0x2f2c8c,_0x4983d2){var _0xc4b8d7={'raw':![],'where':{'id':_0x2f2c8c[_0x4d39('0x4c')]['id']}},_0x2809af={};_0x2809af[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x46')][_0x4d39('0x32')]);_0x2809af[_0x4d39('0x35')]=_['keys'](_0x2f2c8c['query']);_0x2809af[_0x4d39('0x36')]=_[_0x4d39('0x37')](_0x2809af[_0x4d39('0x33')],_0x2809af[_0x4d39('0x35')]);_0xc4b8d7[_0x4d39('0x39')]=_[_0x4d39('0x37')](_0x2809af[_0x4d39('0x33')],qs[_0x4d39('0x38')](_0x2f2c8c['query'][_0x4d39('0x38')]));_0xc4b8d7[_0x4d39('0x39')]=_0xc4b8d7[_0x4d39('0x39')][_0x4d39('0x3a')]?_0xc4b8d7[_0x4d39('0x39')]:_0x2809af[_0x4d39('0x33')];if(_0x2f2c8c[_0x4d39('0x35')][_0x4d39('0x47')]){_0xc4b8d7[_0x4d39('0x48')]=[{'all':!![]}];}_0xc4b8d7=_[_0x4d39('0x44')]({},_0xc4b8d7,_0x2f2c8c[_0x4d39('0x45')]);return db[_0x4d39('0x46')][_0x4d39('0x4d')](_0xc4b8d7)[_0x4d39('0x18')](handleEntityNotFound(_0x4983d2,null))[_0x4d39('0x18')](respondWithResult(_0x4983d2,null))['catch'](handleError(_0x4983d2,null));};exports['create']=function(_0x3ab5a6,_0x33acc3){return db[_0x4d39('0x46')][_0x4d39('0x4e')](_0x3ab5a6[_0x4d39('0x4f')],{})[_0x4d39('0x18')](respondWithResult(_0x33acc3,0xc9))[_0x4d39('0x4b')](handleError(_0x33acc3,null));};exports[_0x4d39('0x2d')]=function(_0x26ee61,_0x5a923a){if(_0x26ee61[_0x4d39('0x4f')]['id']){delete _0x26ee61[_0x4d39('0x4f')]['id'];}return db['ZendeskConfiguration'][_0x4d39('0x4d')]({'where':{'id':_0x26ee61['params']['id']}})[_0x4d39('0x18')](handleEntityNotFound(_0x5a923a,null))[_0x4d39('0x18')](saveUpdates(_0x26ee61[_0x4d39('0x4f')],null))[_0x4d39('0x18')](respondWithResult(_0x5a923a,null))['catch'](handleError(_0x5a923a,null));};exports[_0x4d39('0x50')]=function(_0x4c1a7e,_0x3c1748){return db[_0x4d39('0x46')][_0x4d39('0x4d')]({'where':{'id':_0x4c1a7e[_0x4d39('0x4c')]['id']}})[_0x4d39('0x18')](handleEntityNotFound(_0x3c1748,null))['then'](removeEntity(_0x3c1748,null))['catch'](handleError(_0x3c1748,null));};exports[_0x4d39('0x51')]=function(_0x345c1c,_0x571dd8,_0x4528fa){var _0x1048ee={};var _0x28bd50={};var _0x1e513f;var _0x41bec0;return db[_0x4d39('0x46')][_0x4d39('0x52')]({'where':{'id':_0x345c1c[_0x4d39('0x4c')]['id']}})['then'](handleEntityNotFound(_0x571dd8,null))[_0x4d39('0x18')](function(_0x3790e6){if(_0x3790e6){_0x1e513f=_0x3790e6;_0x28bd50[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x53')][_0x4d39('0x32')]);_0x28bd50[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0x345c1c[_0x4d39('0x35')]);_0x28bd50[_0x4d39('0x36')]=_['intersection'](_0x28bd50['model'],_0x28bd50['query']);_0x1048ee['attributes']=_['intersection'](_0x28bd50[_0x4d39('0x33')],qs['fields'](_0x345c1c['query']['fields']));_0x1048ee[_0x4d39('0x39')]=_0x1048ee[_0x4d39('0x39')][_0x4d39('0x3a')]?_0x1048ee['attributes']:_0x28bd50[_0x4d39('0x33')];_0x1048ee[_0x4d39('0x54')]=qs[_0x4d39('0x3d')](_0x345c1c[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x1048ee['where']=qs['filters'](_[_0x4d39('0x3f')](_0x345c1c[_0x4d39('0x35')],_0x28bd50[_0x4d39('0x36')]));if(_0x345c1c[_0x4d39('0x35')][_0x4d39('0x55')]){_0x1048ee[_0x4d39('0x3e')]=_[_0x4d39('0x44')](_0x1048ee['where'],{'$or':_[_0x4d39('0x40')](_0x1048ee[_0x4d39('0x39')],function(_0x1c70df){var _0x31b629={};_0x31b629[_0x1c70df]={'$like':'%'+_0x345c1c[_0x4d39('0x35')][_0x4d39('0x55')]+'%'};return _0x31b629;})});}_0x1048ee=_[_0x4d39('0x44')]({},_0x1048ee,_0x345c1c[_0x4d39('0x45')]);return _0x1e513f[_0x4d39('0x51')](_0x1048ee);}})['then'](function(_0x2bbf86){if(_0x2bbf86){_0x41bec0=_0x2bbf86[_0x4d39('0x3a')];if(!_0x345c1c[_0x4d39('0x35')]['hasOwnProperty'](_0x4d39('0x3b'))){_0x1048ee[_0x4d39('0x3c')]=qs[_0x4d39('0x3c')](_0x345c1c[_0x4d39('0x35')][_0x4d39('0x3c')]);_0x1048ee[_0x4d39('0x27')]=qs[_0x4d39('0x27')](_0x345c1c[_0x4d39('0x35')][_0x4d39('0x27')]);}return _0x1e513f[_0x4d39('0x51')](_0x1048ee);}})[_0x4d39('0x18')](function(_0x25fb96){if(_0x25fb96){return _0x25fb96?{'count':_0x41bec0,'rows':_0x25fb96}:null;}})[_0x4d39('0x18')](respondWithResult(_0x571dd8,null))['catch'](handleError(_0x571dd8,null));};exports['getSubjects']=function(_0x6a3fed,_0x323974,_0x187764){var _0x7fb76f={};var _0x48355e={};var _0x327672;var _0x1d04f0;return db[_0x4d39('0x46')][_0x4d39('0x52')]({'where':{'id':_0x6a3fed['params']['id']}})['then'](handleEntityNotFound(_0x323974,null))['then'](function(_0x3d8b44){if(_0x3d8b44){_0x327672=_0x3d8b44;_0x48355e[_0x4d39('0x33')]=_[_0x4d39('0x34')](db['ZendeskField'][_0x4d39('0x32')]);_0x48355e[_0x4d39('0x35')]=_[_0x4d39('0x34')](_0x6a3fed[_0x4d39('0x35')]);_0x48355e[_0x4d39('0x36')]=_['intersection'](_0x48355e[_0x4d39('0x33')],_0x48355e[_0x4d39('0x35')]);_0x7fb76f[_0x4d39('0x39')]=_[_0x4d39('0x37')](_0x48355e[_0x4d39('0x33')],qs[_0x4d39('0x38')](_0x6a3fed['query'][_0x4d39('0x38')]));_0x7fb76f['attributes']=_0x7fb76f[_0x4d39('0x39')][_0x4d39('0x3a')]?_0x7fb76f['attributes']:_0x48355e[_0x4d39('0x33')];_0x7fb76f[_0x4d39('0x54')]=qs[_0x4d39('0x3d')](_0x6a3fed[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x7fb76f['where']=qs[_0x4d39('0x36')](_[_0x4d39('0x3f')](_0x6a3fed[_0x4d39('0x35')],_0x48355e[_0x4d39('0x36')]));if(_0x6a3fed['query']['filter']){_0x7fb76f[_0x4d39('0x3e')]=_[_0x4d39('0x44')](_0x7fb76f[_0x4d39('0x3e')],{'$or':_['map'](_0x7fb76f[_0x4d39('0x39')],function(_0x596d1f){var _0x1783d4={};_0x1783d4[_0x596d1f]={'$like':'%'+_0x6a3fed[_0x4d39('0x35')]['filter']+'%'};return _0x1783d4;})});}_0x7fb76f=_['merge']({},_0x7fb76f,_0x6a3fed[_0x4d39('0x45')]);return _0x327672[_0x4d39('0x56')](_0x7fb76f);}})[_0x4d39('0x18')](function(_0x5a1bc5){if(_0x5a1bc5){_0x1d04f0=_0x5a1bc5[_0x4d39('0x3a')];if(!_0x6a3fed['query']['hasOwnProperty'](_0x4d39('0x3b'))){_0x7fb76f[_0x4d39('0x3c')]=qs['limit'](_0x6a3fed[_0x4d39('0x35')]['limit']);_0x7fb76f[_0x4d39('0x27')]=qs['offset'](_0x6a3fed[_0x4d39('0x35')][_0x4d39('0x27')]);}return _0x327672[_0x4d39('0x56')](_0x7fb76f);}})['then'](function(_0x55e938){if(_0x55e938){return _0x55e938?{'count':_0x1d04f0,'rows':_0x55e938}:null;}})[_0x4d39('0x18')](respondWithResult(_0x323974,null))['catch'](handleError(_0x323974,null));};exports['getDescriptions']=function(_0x266bf7,_0x1c7bb7,_0x44e165){var _0x4e0aff={};var _0x23a85c={};var _0x1ae40c;var _0x3b23f7;return db[_0x4d39('0x46')][_0x4d39('0x52')]({'where':{'id':_0x266bf7[_0x4d39('0x4c')]['id']}})[_0x4d39('0x18')](handleEntityNotFound(_0x1c7bb7,null))[_0x4d39('0x18')](function(_0x3ecf65){if(_0x3ecf65){_0x1ae40c=_0x3ecf65;_0x23a85c[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x53')][_0x4d39('0x32')]);_0x23a85c['query']=_[_0x4d39('0x34')](_0x266bf7['query']);_0x23a85c[_0x4d39('0x36')]=_[_0x4d39('0x37')](_0x23a85c[_0x4d39('0x33')],_0x23a85c[_0x4d39('0x35')]);_0x4e0aff[_0x4d39('0x39')]=_['intersection'](_0x23a85c[_0x4d39('0x33')],qs[_0x4d39('0x38')](_0x266bf7[_0x4d39('0x35')][_0x4d39('0x38')]));_0x4e0aff[_0x4d39('0x39')]=_0x4e0aff[_0x4d39('0x39')][_0x4d39('0x3a')]?_0x4e0aff[_0x4d39('0x39')]:_0x23a85c[_0x4d39('0x33')];_0x4e0aff['order']=qs['sort'](_0x266bf7['query'][_0x4d39('0x3d')]);_0x4e0aff[_0x4d39('0x3e')]=qs[_0x4d39('0x36')](_[_0x4d39('0x3f')](_0x266bf7[_0x4d39('0x35')],_0x23a85c[_0x4d39('0x36')]));if(_0x266bf7[_0x4d39('0x35')][_0x4d39('0x55')]){_0x4e0aff[_0x4d39('0x3e')]=_[_0x4d39('0x44')](_0x4e0aff[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x40')](_0x4e0aff[_0x4d39('0x39')],function(_0x1a34fd){var _0x4fc56f={};_0x4fc56f[_0x1a34fd]={'$like':'%'+_0x266bf7[_0x4d39('0x35')][_0x4d39('0x55')]+'%'};return _0x4fc56f;})});}_0x4e0aff=_[_0x4d39('0x44')]({},_0x4e0aff,_0x266bf7[_0x4d39('0x45')]);return _0x1ae40c[_0x4d39('0x57')](_0x4e0aff);}})['then'](function(_0x179798){if(_0x179798){_0x3b23f7=_0x179798['length'];if(!_0x266bf7[_0x4d39('0x35')][_0x4d39('0x58')](_0x4d39('0x3b'))){_0x4e0aff['limit']=qs['limit'](_0x266bf7[_0x4d39('0x35')][_0x4d39('0x3c')]);_0x4e0aff['offset']=qs['offset'](_0x266bf7[_0x4d39('0x35')][_0x4d39('0x27')]);}return _0x1ae40c[_0x4d39('0x57')](_0x4e0aff);}})['then'](function(_0xa12f8f){if(_0xa12f8f){return _0xa12f8f?{'count':_0x3b23f7,'rows':_0xa12f8f}:null;}})[_0x4d39('0x18')](respondWithResult(_0x1c7bb7,null))['catch'](handleError(_0x1c7bb7,null));};exports[_0x4d39('0x59')]=function(_0x12ad54,_0x34499b,_0x45fe44){var _0x14e6f7={};var _0x41c733={};var _0x9629b4;var _0x310060;return db[_0x4d39('0x46')][_0x4d39('0x52')]({'where':{'id':_0x12ad54[_0x4d39('0x4c')]['id']}})[_0x4d39('0x18')](handleEntityNotFound(_0x34499b,null))[_0x4d39('0x18')](function(_0x136e1b){if(_0x136e1b){_0x9629b4=_0x136e1b;_0x41c733[_0x4d39('0x33')]=_[_0x4d39('0x34')](db[_0x4d39('0x5a')]['rawAttributes']);_0x41c733['query']=_['keys'](_0x12ad54[_0x4d39('0x35')]);_0x41c733['filters']=_['intersection'](_0x41c733[_0x4d39('0x33')],_0x41c733[_0x4d39('0x35')]);_0x14e6f7['attributes']=_[_0x4d39('0x37')](_0x41c733['model'],qs['fields'](_0x12ad54[_0x4d39('0x35')][_0x4d39('0x38')]));_0x14e6f7[_0x4d39('0x39')]=_0x14e6f7[_0x4d39('0x39')][_0x4d39('0x3a')]?_0x14e6f7[_0x4d39('0x39')]:_0x41c733[_0x4d39('0x33')];_0x14e6f7[_0x4d39('0x54')]=qs[_0x4d39('0x3d')](_0x12ad54[_0x4d39('0x35')][_0x4d39('0x3d')]);_0x14e6f7['where']=qs[_0x4d39('0x36')](_[_0x4d39('0x3f')](_0x12ad54[_0x4d39('0x35')],_0x41c733['filters']));if(_0x12ad54[_0x4d39('0x35')][_0x4d39('0x55')]){_0x14e6f7[_0x4d39('0x3e')]=_[_0x4d39('0x44')](_0x14e6f7[_0x4d39('0x3e')],{'$or':_[_0x4d39('0x40')](_0x14e6f7[_0x4d39('0x39')],function(_0xbcc30e){var _0x538bac={};_0x538bac[_0xbcc30e]={'$like':'%'+_0x12ad54[_0x4d39('0x35')][_0x4d39('0x55')]+'%'};return _0x538bac;})});}_0x14e6f7=_[_0x4d39('0x44')]({},_0x14e6f7,_0x12ad54[_0x4d39('0x45')]);return _0x9629b4[_0x4d39('0x59')](_0x14e6f7);}})['then'](function(_0x231729){if(_0x231729){_0x310060=_0x231729[_0x4d39('0x3a')];if(!_0x12ad54['query'][_0x4d39('0x58')](_0x4d39('0x3b'))){_0x14e6f7['limit']=qs[_0x4d39('0x3c')](_0x12ad54[_0x4d39('0x35')][_0x4d39('0x3c')]);_0x14e6f7['offset']=qs[_0x4d39('0x27')](_0x12ad54['query'][_0x4d39('0x27')]);}return _0x9629b4[_0x4d39('0x59')](_0x14e6f7);}})[_0x4d39('0x18')](function(_0x2f13d4){if(_0x2f13d4){return _0x2f13d4?{'count':_0x310060,'rows':_0x2f13d4}:null;}})[_0x4d39('0x18')](respondWithResult(_0x34499b,null))[_0x4d39('0x4b')](handleError(_0x34499b,null));};exports['setTags']=function(_0x86f207,_0x5daff1,_0x27b09f){if(_0x86f207['body']['id']){delete _0x86f207[_0x4d39('0x4f')]['id'];}return db[_0x4d39('0x46')]['findOne']({'where':{'id':_0x86f207[_0x4d39('0x4c')]['id']}})[_0x4d39('0x18')](handleEntityNotFound(_0x5daff1,null))[_0x4d39('0x18')](function(_0x2c811a){if(_0x2c811a){return _0x2c811a[_0x4d39('0x5b')](_0x86f207[_0x4d39('0x4f')][_0x4d39('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x5daff1,null))[_0x4d39('0x4b')](handleError(_0x5daff1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index f06cd43..fb88d36 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 _0xcb60=['bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1aaef9,_0x25790e){var _0x2ce77f=function(_0x4910b6){while(--_0x4910b6){_0x1aaef9['push'](_0x1aaef9['shift']());}};_0x2ce77f(++_0x25790e);}(_0xcb60,0x157));var _0x0cb6=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xcb60[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x0cb6('0x0'));var util=require(_0x0cb6('0x1'));var logger=require(_0x0cb6('0x2'))(_0x0cb6('0x3'));var moment=require(_0x0cb6('0x4'));var BPromise=require(_0x0cb6('0x5'));var rp=require(_0x0cb6('0x6'));var fs=require('fs');var path=require(_0x0cb6('0x7'));var rimraf=require('rimraf');var config=require(_0x0cb6('0x8'));var attributes=require(_0x0cb6('0x9'));module['exports']=function(_0x2544b9,_0x18449e){return _0x2544b9['define'](_0x0cb6('0xa'),attributes,{'tableName':_0x0cb6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba29=['./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xba29,0x9e));var _0x9ba2=function(_0x525038,_0x23964a){_0x525038=_0x525038-0x0;var _0x468db9=_0xba29[_0x525038];return _0x468db9;};'use strict';var _=require(_0x9ba2('0x0'));var util=require(_0x9ba2('0x1'));var logger=require(_0x9ba2('0x2'))(_0x9ba2('0x3'));var moment=require(_0x9ba2('0x4'));var BPromise=require(_0x9ba2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ba2('0x6'));var attributes=require(_0x9ba2('0x7'));module['exports']=function(_0x159297,_0x3c79fe){return _0x159297[_0x9ba2('0x8')](_0x9ba2('0x9'),attributes,{'tableName':_0x9ba2('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 004f217..2e5c56b 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 _0xd49a=['jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2ed011,_0x273697){var _0x5dd4b8=function(_0xe1a082){while(--_0xe1a082){_0x2ed011['push'](_0x2ed011['shift']());}};_0x5dd4b8(++_0x273697);}(_0xd49a,0x132));var _0xad49=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd49a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xad49('0x0'));var BPromise=require(_0xad49('0x1'));var rs=require(_0xad49('0x2'));var fs=require('fs');var Redis=require(_0xad49('0x3'));var db=require(_0xad49('0x4'))['db'];var utils=require(_0xad49('0x5'));var logger=require(_0xad49('0x6'))(_0xad49('0x7'));var config=require(_0xad49('0x8'));var jayson=require(_0xad49('0x9'));var client=jayson[_0xad49('0xa')][_0xad49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ae81a,_0x46443e,_0x22a3d5){return new BPromise(function(_0x25b8e9,_0x3b8c82){return client['request'](_0x1ae81a,_0x22a3d5)[_0xad49('0xc')](function(_0x585f52){logger[_0xad49('0xd')](_0xad49('0xe'),_0x46443e,_0xad49('0xf'));logger[_0xad49('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x46443e,_0xad49('0xf'),JSON[_0xad49('0x11')](_0x585f52));if(_0x585f52[_0xad49('0x12')]){if(_0x585f52[_0xad49('0x12')]['code']===0x1f4){logger[_0xad49('0x12')](_0xad49('0xe'),_0x46443e,_0x585f52[_0xad49('0x12')][_0xad49('0x13')]);return _0x3b8c82(_0x585f52[_0xad49('0x12')][_0xad49('0x13')]);}logger[_0xad49('0x12')](_0xad49('0xe'),_0x46443e,_0x585f52[_0xad49('0x12')][_0xad49('0x13')]);return _0x25b8e9(_0x585f52[_0xad49('0x12')][_0xad49('0x13')]);}else{logger[_0xad49('0xd')](_0xad49('0xe'),_0x46443e,_0xad49('0xf'));_0x25b8e9(_0x585f52[_0xad49('0x14')][_0xad49('0x13')]);}})['catch'](function(_0x1268e8){logger[_0xad49('0x12')](_0xad49('0xe'),_0x46443e,_0x1268e8);_0x3b8c82(_0x1268e8);});});} \ No newline at end of file +var _0x147c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x24c105,_0x7ad441){var _0x320381=function(_0x382ca3){while(--_0x382ca3){_0x24c105['push'](_0x24c105['shift']());}};_0x320381(++_0x7ad441);}(_0x147c,0x8a));var _0xc147=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0x147c[_0x57a670];return _0x41ce21;};'use strict';var _=require(_0xc147('0x0'));var util=require('util');var moment=require(_0xc147('0x1'));var BPromise=require(_0xc147('0x2'));var rs=require(_0xc147('0x3'));var fs=require('fs');var Redis=require(_0xc147('0x4'));var db=require(_0xc147('0x5'))['db'];var utils=require(_0xc147('0x6'));var logger=require(_0xc147('0x7'))(_0xc147('0x8'));var config=require(_0xc147('0x9'));var jayson=require(_0xc147('0xa'));var client=jayson[_0xc147('0xb')][_0xc147('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c7fb7,_0xd0104a,_0x27790f){return new BPromise(function(_0x307a55,_0x5555dd){return client[_0xc147('0xd')](_0x3c7fb7,_0x27790f)['then'](function(_0x505174){logger[_0xc147('0xe')](_0xc147('0xf'),_0xd0104a,_0xc147('0x10'));logger['debug'](_0xc147('0x11'),_0xd0104a,_0xc147('0x10'),JSON[_0xc147('0x12')](_0x505174));if(_0x505174['error']){if(_0x505174['error'][_0xc147('0x13')]===0x1f4){logger[_0xc147('0x14')](_0xc147('0xf'),_0xd0104a,_0x505174[_0xc147('0x14')][_0xc147('0x15')]);return _0x5555dd(_0x505174[_0xc147('0x14')]['message']);}logger['error'](_0xc147('0xf'),_0xd0104a,_0x505174[_0xc147('0x14')]['message']);return _0x307a55(_0x505174[_0xc147('0x14')][_0xc147('0x15')]);}else{logger['info'](_0xc147('0xf'),_0xd0104a,_0xc147('0x10'));_0x307a55(_0x505174[_0xc147('0x16')]['message']);}})[_0xc147('0x17')](function(_0x30247e){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xd0104a,_0x30247e);_0x5555dd(_0x30247e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index df25f1e..0075097 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 _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x55d5d8,_0x4eeaf5){var _0x11d027=function(_0x3228f2){while(--_0x3228f2){_0x55d5d8['push'](_0x55d5d8['shift']());}};_0x11d027(++_0x4eeaf5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x3e3b0f,_0x1e240a){var _0x1a8148=function(_0x32b574){while(--_0x32b574){_0x3e3b0f['push'](_0x3e3b0f['shift']());}};_0x1a8148(++_0x1e240a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 4e8b176..f8db4bc 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 _0x1339=['keyValue','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x1c2445,_0x129fa0){var _0x560030=function(_0x4ec483){while(--_0x4ec483){_0x1c2445['push'](_0x1c2445['shift']());}};_0x560030(++_0x129fa0);}(_0x1339,0x1ed));var _0x9133=function(_0x153bb8,_0x12354b){_0x153bb8=_0x153bb8-0x0;var _0xcf8bc9=_0x1339[_0x153bb8];return _0xcf8bc9;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9133('0x0')](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'),_0x9133('0x4')),'defaultValue':_0x9133('0x1')},'content':{'type':Sequelize[_0x9133('0x5')]},'key':{'type':Sequelize[_0x9133('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9133('0x1'),_0x9133('0x2'),_0x9133('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9133('0x5')]},'nameField':{'type':Sequelize[_0x9133('0x5')]},'customField':{'type':Sequelize[_0x9133('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9133('0x5')]}}; \ No newline at end of file +var _0x2dae=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x5eb533,_0x378d75){var _0x77cdee=function(_0x57f6c4){while(--_0x57f6c4){_0x5eb533['push'](_0x5eb533['shift']());}};_0x77cdee(++_0x378d75);}(_0x2dae,0xc3));var _0xe2da=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0x2dae[_0x548200];return _0x1a6d74;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'type':{'type':Sequelize[_0xe2da('0x1')](_0xe2da('0x2'),_0xe2da('0x3'),_0xe2da('0x4'),_0xe2da('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe2da('0x6')]},'key':{'type':Sequelize[_0xe2da('0x6')]},'keyType':{'type':Sequelize[_0xe2da('0x1')](_0xe2da('0x2'),'variable',_0xe2da('0x4'))},'keyContent':{'type':Sequelize[_0xe2da('0x6')]},'idField':{'type':Sequelize[_0xe2da('0x6')]},'nameField':{'type':Sequelize[_0xe2da('0x6')]},'customField':{'type':Sequelize[_0xe2da('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe2da('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c61b8a1..1c5e6ce 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 _0x98d4=['order','sort','where','filter','type','key','VIRTUAL','field','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','apply','save','update','then','end','sendStatus','name','send','index','ZendeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4252d7,_0x515575){var _0x4e08aa=function(_0x57b279){while(--_0x57b279){_0x4252d7['push'](_0x4252d7['shift']());}};_0x4e08aa(++_0x515575);}(_0x98d4,0xa3));var _0x498d=function(_0x336b1e,_0xd4bd53){_0x336b1e=_0x336b1e-0x0;var _0x40f2ef=_0x98d4[_0x336b1e];return _0x40f2ef;};'use strict';var pdf=require(_0x498d('0x0'));var emlformat=require(_0x498d('0x1'));var rimraf=require(_0x498d('0x2'));var zipdir=require(_0x498d('0x3'));var jsonpatch=require(_0x498d('0x4'));var rp=require(_0x498d('0x5'));var moment=require(_0x498d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x498d('0x7'));var util=require(_0x498d('0x8'));var path=require('path');var sox=require(_0x498d('0x9'));var csv=require(_0x498d('0xa'));var ejs=require(_0x498d('0xb'));var fs=require('fs');var _=require(_0x498d('0xc'));var squel=require(_0x498d('0xd'));var crypto=require(_0x498d('0xe'));var jsforce=require(_0x498d('0xf'));var deskjs=require(_0x498d('0x10'));var toCsv=require(_0x498d('0xa'));var querystring=require(_0x498d('0x11'));var Papa=require(_0x498d('0x12'));var Redis=require(_0x498d('0x13'));var authService=require(_0x498d('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x498d('0x15'));var logger=require(_0x498d('0x16'))(_0x498d('0x17'));var utils=require(_0x498d('0x18'));var config=require('../../config/environment');var db=require(_0x498d('0x19'))['db'];function respondWithStatusCode(_0x22271f,_0x5beef7){_0x5beef7=_0x5beef7||0xcc;return function(_0x1c8c0b){if(_0x1c8c0b){return _0x22271f['sendStatus'](_0x5beef7);}return _0x22271f[_0x498d('0x1a')](_0x5beef7)['end']();};}function respondWithResult(_0x3451b6,_0x4f429b){_0x4f429b=_0x4f429b||0xc8;return function(_0x5697f0){if(_0x5697f0){return _0x3451b6[_0x498d('0x1a')](_0x4f429b)[_0x498d('0x1b')](_0x5697f0);}};}function respondWithFilteredResult(_0x45ba67,_0x1d3f6f){return function(_0x59ea97){if(_0x59ea97){var _0x907e57=_0x59ea97[_0x498d('0x1c')],_0x3c816f=_0x1d3f6f[_0x498d('0x1d')],_0x3a1bf1=_0x1d3f6f[_0x498d('0x1d')]+_0x1d3f6f[_0x498d('0x1e')],_0xf18e30;if(_0x3a1bf1>=_0x907e57){_0x3a1bf1=_0x907e57;_0xf18e30=0xc8;}else{_0xf18e30=0xce;}_0x45ba67[_0x498d('0x1a')](_0xf18e30);return _0x45ba67[_0x498d('0x1f')]('Content-Range',_0x3c816f+'-'+_0x3a1bf1+'/'+_0x907e57)[_0x498d('0x1b')](_0x59ea97);}return null;};}function patchUpdates(_0x39bbc6){return function(_0x16ed1e){try{jsonpatch[_0x498d('0x20')](_0x16ed1e,_0x39bbc6,!![]);}catch(_0x311b97){return BPromise['reject'](_0x311b97);}return _0x16ed1e[_0x498d('0x21')]();};}function saveUpdates(_0x22e393,_0x4f04db){return function(_0x2a820c){if(_0x2a820c){return _0x2a820c[_0x498d('0x22')](_0x22e393)[_0x498d('0x23')](function(_0x81a87d){return _0x81a87d;});}return null;};}function removeEntity(_0x3c647f,_0x5a480b){return function(_0x34b23e){if(_0x34b23e){return _0x34b23e['destroy']()[_0x498d('0x23')](function(){_0x3c647f[_0x498d('0x1a')](0xcc)[_0x498d('0x24')]();});}};}function handleEntityNotFound(_0x453b89,_0x33e1b1){return function(_0xc94ebc){if(!_0xc94ebc){_0x453b89[_0x498d('0x25')](0x194);}return _0xc94ebc;};}function handleError(_0x2ce6ba,_0x1cbc44){_0x1cbc44=_0x1cbc44||0x1f4;return function(_0x8b5413){logger['error'](_0x8b5413['stack']);if(_0x8b5413[_0x498d('0x26')]){delete _0x8b5413[_0x498d('0x26')];}_0x2ce6ba[_0x498d('0x1a')](_0x1cbc44)[_0x498d('0x27')](_0x8b5413);};}exports[_0x498d('0x28')]=function(_0x28da73,_0x4cd355){var _0x2d590a={},_0x1381cc={},_0x16b7fc={'count':0x0,'rows':[]};var _0x5d6f7f=db[_0x498d('0x29')][_0x498d('0x2a')];_0x1381cc[_0x498d('0x2b')]=_[_0x498d('0x2c')](_0x5d6f7f);_0x1381cc[_0x498d('0x2d')]=_['keys'](_0x28da73[_0x498d('0x2d')]);_0x1381cc[_0x498d('0x2e')]=_[_0x498d('0x2f')](_0x1381cc[_0x498d('0x2b')],_0x1381cc['query']);_0x2d590a[_0x498d('0x30')]=_[_0x498d('0x2f')](_0x1381cc[_0x498d('0x2b')],qs[_0x498d('0x31')](_0x28da73['query'][_0x498d('0x31')]));_0x2d590a[_0x498d('0x30')]=_0x2d590a['attributes'][_0x498d('0x32')]?_0x2d590a[_0x498d('0x30')]:_0x1381cc[_0x498d('0x2b')];if(!_0x28da73['query'][_0x498d('0x33')](_0x498d('0x34'))){_0x2d590a[_0x498d('0x1e')]=qs['limit'](_0x28da73[_0x498d('0x2d')][_0x498d('0x1e')]);_0x2d590a[_0x498d('0x1d')]=qs[_0x498d('0x1d')](_0x28da73[_0x498d('0x2d')][_0x498d('0x1d')]);}_0x2d590a[_0x498d('0x35')]=qs[_0x498d('0x36')](_0x28da73['query'][_0x498d('0x36')]);_0x2d590a[_0x498d('0x37')]=qs[_0x498d('0x2e')](_['pick'](_0x28da73[_0x498d('0x2d')],_0x1381cc['filters']));if(_0x28da73[_0x498d('0x2d')][_0x498d('0x38')]){_0x2d590a[_0x498d('0x37')]=_['merge'](_0x2d590a[_0x498d('0x37')],{'$or':_['map'](_0x5d6f7f,function(_0x2cd1d2){if(_0x2cd1d2[_0x498d('0x39')][_0x498d('0x3a')]!==_0x498d('0x3b')){var _0x4b811a={};_0x4b811a[_0x2cd1d2[_0x498d('0x3c')]]={'$like':'%'+_0x28da73[_0x498d('0x2d')]['filter']+'%'};return _0x4b811a;}})});}_0x2d590a=_[_0x498d('0x3d')]({},_0x2d590a,_0x28da73[_0x498d('0x3e')]);var _0x35454e={'where':_0x2d590a[_0x498d('0x37')]};return db[_0x498d('0x29')]['count'](_0x35454e)[_0x498d('0x23')](function(_0x5ac5d9){_0x16b7fc[_0x498d('0x1c')]=_0x5ac5d9;if(_0x28da73[_0x498d('0x2d')][_0x498d('0x3f')]){_0x2d590a['include']=[{'all':!![]}];}return db[_0x498d('0x29')][_0x498d('0x40')](_0x2d590a);})[_0x498d('0x23')](function(_0x4d0f26){_0x16b7fc['rows']=_0x4d0f26;return _0x16b7fc;})[_0x498d('0x23')](respondWithFilteredResult(_0x4cd355,_0x2d590a))[_0x498d('0x41')](handleError(_0x4cd355,null));};exports[_0x498d('0x42')]=function(_0x1784e7,_0x579af7){var _0x3ce556={'raw':!![],'where':{'id':_0x1784e7[_0x498d('0x43')]['id']}},_0x2720fd={};_0x2720fd[_0x498d('0x2b')]=_[_0x498d('0x2c')](db[_0x498d('0x29')][_0x498d('0x2a')]);_0x2720fd[_0x498d('0x2d')]=_[_0x498d('0x2c')](_0x1784e7[_0x498d('0x2d')]);_0x2720fd['filters']=_[_0x498d('0x2f')](_0x2720fd[_0x498d('0x2b')],_0x2720fd[_0x498d('0x2d')]);_0x3ce556['attributes']=_['intersection'](_0x2720fd['model'],qs['fields'](_0x1784e7[_0x498d('0x2d')][_0x498d('0x31')]));_0x3ce556[_0x498d('0x30')]=_0x3ce556[_0x498d('0x30')][_0x498d('0x32')]?_0x3ce556[_0x498d('0x30')]:_0x2720fd[_0x498d('0x2b')];if(_0x1784e7['query'][_0x498d('0x3f')]){_0x3ce556[_0x498d('0x44')]=[{'all':!![]}];}_0x3ce556=_[_0x498d('0x3d')]({},_0x3ce556,_0x1784e7[_0x498d('0x3e')]);return db[_0x498d('0x29')][_0x498d('0x45')](_0x3ce556)[_0x498d('0x23')](handleEntityNotFound(_0x579af7,null))[_0x498d('0x23')](respondWithResult(_0x579af7,null))[_0x498d('0x41')](handleError(_0x579af7,null));};exports[_0x498d('0x46')]=function(_0x2fb5d6,_0x55bab7){return db['ZendeskField'][_0x498d('0x46')](_0x2fb5d6['body'],{})[_0x498d('0x23')](respondWithResult(_0x55bab7,0xc9))['catch'](handleError(_0x55bab7,null));};exports[_0x498d('0x22')]=function(_0x1efc9e,_0x29d8ca){if(_0x1efc9e['body']['id']){delete _0x1efc9e['body']['id'];}return db['ZendeskField'][_0x498d('0x45')]({'where':{'id':_0x1efc9e[_0x498d('0x43')]['id']}})[_0x498d('0x23')](handleEntityNotFound(_0x29d8ca,null))[_0x498d('0x23')](saveUpdates(_0x1efc9e[_0x498d('0x47')],null))['then'](respondWithResult(_0x29d8ca,null))['catch'](handleError(_0x29d8ca,null));};exports['destroy']=function(_0x14097b,_0xff923){return db[_0x498d('0x29')][_0x498d('0x45')]({'where':{'id':_0x14097b[_0x498d('0x43')]['id']}})['then'](handleEntityNotFound(_0xff923,null))[_0x498d('0x23')](removeEntity(_0xff923,null))[_0x498d('0x41')](handleError(_0xff923,null));}; \ No newline at end of file +var _0x677a=['include','findAll','rows','catch','show','params','ZendeskField','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filter','map','type','field','options','includeAll'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x677a,0xd6));var _0xa677=function(_0x56e214,_0x2102d7){_0x56e214=_0x56e214-0x0;var _0x3a66b5=_0x677a[_0x56e214];return _0x3a66b5;};'use strict';var pdf=require(_0xa677('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa677('0x1'));var zipdir=require(_0xa677('0x2'));var jsonpatch=require(_0xa677('0x3'));var rp=require(_0xa677('0x4'));var moment=require(_0xa677('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa677('0x6'));var util=require(_0xa677('0x7'));var path=require(_0xa677('0x8'));var sox=require(_0xa677('0x9'));var csv=require(_0xa677('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa677('0xb'));var squel=require(_0xa677('0xc'));var crypto=require(_0xa677('0xd'));var jsforce=require(_0xa677('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa677('0xf'));var Redis=require('ioredis');var authService=require(_0xa677('0x10'));var qs=require(_0xa677('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa677('0x12'))(_0xa677('0x13'));var utils=require(_0xa677('0x14'));var config=require(_0xa677('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bbc6e,_0x3540ee){_0x3540ee=_0x3540ee||0xcc;return function(_0xb1d2b6){if(_0xb1d2b6){return _0x1bbc6e[_0xa677('0x16')](_0x3540ee);}return _0x1bbc6e['status'](_0x3540ee)[_0xa677('0x17')]();};}function respondWithResult(_0x5de5c8,_0x1faba2){_0x1faba2=_0x1faba2||0xc8;return function(_0x2e5b2a){if(_0x2e5b2a){return _0x5de5c8[_0xa677('0x18')](_0x1faba2)[_0xa677('0x19')](_0x2e5b2a);}};}function respondWithFilteredResult(_0xca5d15,_0x36634f){return function(_0x268fa5){if(_0x268fa5){var _0x4ffe4c=_0x268fa5[_0xa677('0x1a')],_0x1feb0e=_0x36634f[_0xa677('0x1b')],_0x230363=_0x36634f[_0xa677('0x1b')]+_0x36634f['limit'],_0x25c63b;if(_0x230363>=_0x4ffe4c){_0x230363=_0x4ffe4c;_0x25c63b=0xc8;}else{_0x25c63b=0xce;}_0xca5d15[_0xa677('0x18')](_0x25c63b);return _0xca5d15[_0xa677('0x1c')]('Content-Range',_0x1feb0e+'-'+_0x230363+'/'+_0x4ffe4c)['json'](_0x268fa5);}return null;};}function patchUpdates(_0xbc3f5b){return function(_0x73350){try{jsonpatch[_0xa677('0x1d')](_0x73350,_0xbc3f5b,!![]);}catch(_0x30fbfd){return BPromise['reject'](_0x30fbfd);}return _0x73350[_0xa677('0x1e')]();};}function saveUpdates(_0x2122ac,_0xad957e){return function(_0x44de05){if(_0x44de05){return _0x44de05[_0xa677('0x1f')](_0x2122ac)[_0xa677('0x20')](function(_0x5cbea0){return _0x5cbea0;});}return null;};}function removeEntity(_0x2e8113,_0x4dcab4){return function(_0x470e0a){if(_0x470e0a){return _0x470e0a[_0xa677('0x21')]()[_0xa677('0x20')](function(){_0x2e8113['status'](0xcc)[_0xa677('0x17')]();});}};}function handleEntityNotFound(_0x31acd3,_0x395d33){return function(_0x1c59e4){if(!_0x1c59e4){_0x31acd3['sendStatus'](0x194);}return _0x1c59e4;};}function handleError(_0x1aa82b,_0x17f483){_0x17f483=_0x17f483||0x1f4;return function(_0x595c10){logger[_0xa677('0x22')](_0x595c10[_0xa677('0x23')]);if(_0x595c10[_0xa677('0x24')]){delete _0x595c10[_0xa677('0x24')];}_0x1aa82b[_0xa677('0x18')](_0x17f483)[_0xa677('0x25')](_0x595c10);};}exports['index']=function(_0x34dee4,_0x12756d){var _0x1a7e27={},_0x6189c={},_0x428987={'count':0x0,'rows':[]};var _0x377660=db['ZendeskField'][_0xa677('0x26')];_0x6189c[_0xa677('0x27')]=_[_0xa677('0x28')](_0x377660);_0x6189c['query']=_[_0xa677('0x28')](_0x34dee4[_0xa677('0x29')]);_0x6189c[_0xa677('0x2a')]=_[_0xa677('0x2b')](_0x6189c['model'],_0x6189c[_0xa677('0x29')]);_0x1a7e27[_0xa677('0x2c')]=_[_0xa677('0x2b')](_0x6189c['model'],qs[_0xa677('0x2d')](_0x34dee4[_0xa677('0x29')][_0xa677('0x2d')]));_0x1a7e27[_0xa677('0x2c')]=_0x1a7e27[_0xa677('0x2c')][_0xa677('0x2e')]?_0x1a7e27[_0xa677('0x2c')]:_0x6189c[_0xa677('0x27')];if(!_0x34dee4['query'][_0xa677('0x2f')]('nolimit')){_0x1a7e27[_0xa677('0x30')]=qs[_0xa677('0x30')](_0x34dee4[_0xa677('0x29')][_0xa677('0x30')]);_0x1a7e27[_0xa677('0x1b')]=qs[_0xa677('0x1b')](_0x34dee4[_0xa677('0x29')][_0xa677('0x1b')]);}_0x1a7e27[_0xa677('0x31')]=qs['sort'](_0x34dee4[_0xa677('0x29')]['sort']);_0x1a7e27[_0xa677('0x32')]=qs[_0xa677('0x2a')](_[_0xa677('0x33')](_0x34dee4[_0xa677('0x29')],_0x6189c['filters']));if(_0x34dee4[_0xa677('0x29')][_0xa677('0x34')]){_0x1a7e27[_0xa677('0x32')]=_['merge'](_0x1a7e27['where'],{'$or':_[_0xa677('0x35')](_0x377660,function(_0x9a0837){if(_0x9a0837[_0xa677('0x36')]['key']!=='VIRTUAL'){var _0xbc5bd2={};_0xbc5bd2[_0x9a0837[_0xa677('0x37')]]={'$like':'%'+_0x34dee4[_0xa677('0x29')][_0xa677('0x34')]+'%'};return _0xbc5bd2;}})});}_0x1a7e27=_['merge']({},_0x1a7e27,_0x34dee4[_0xa677('0x38')]);var _0x1b15bb={'where':_0x1a7e27['where']};return db['ZendeskField'][_0xa677('0x1a')](_0x1b15bb)[_0xa677('0x20')](function(_0x5b540f){_0x428987[_0xa677('0x1a')]=_0x5b540f;if(_0x34dee4['query'][_0xa677('0x39')]){_0x1a7e27[_0xa677('0x3a')]=[{'all':!![]}];}return db['ZendeskField'][_0xa677('0x3b')](_0x1a7e27);})[_0xa677('0x20')](function(_0x23ae91){_0x428987[_0xa677('0x3c')]=_0x23ae91;return _0x428987;})[_0xa677('0x20')](respondWithFilteredResult(_0x12756d,_0x1a7e27))[_0xa677('0x3d')](handleError(_0x12756d,null));};exports[_0xa677('0x3e')]=function(_0x240c7b,_0x43a477){var _0x5326d1={'raw':!![],'where':{'id':_0x240c7b[_0xa677('0x3f')]['id']}},_0x21fd10={};_0x21fd10[_0xa677('0x27')]=_[_0xa677('0x28')](db['ZendeskField']['rawAttributes']);_0x21fd10['query']=_[_0xa677('0x28')](_0x240c7b[_0xa677('0x29')]);_0x21fd10['filters']=_[_0xa677('0x2b')](_0x21fd10[_0xa677('0x27')],_0x21fd10[_0xa677('0x29')]);_0x5326d1['attributes']=_[_0xa677('0x2b')](_0x21fd10[_0xa677('0x27')],qs[_0xa677('0x2d')](_0x240c7b[_0xa677('0x29')][_0xa677('0x2d')]));_0x5326d1[_0xa677('0x2c')]=_0x5326d1[_0xa677('0x2c')][_0xa677('0x2e')]?_0x5326d1[_0xa677('0x2c')]:_0x21fd10[_0xa677('0x27')];if(_0x240c7b[_0xa677('0x29')][_0xa677('0x39')]){_0x5326d1[_0xa677('0x3a')]=[{'all':!![]}];}_0x5326d1=_['merge']({},_0x5326d1,_0x240c7b['options']);return db[_0xa677('0x40')][_0xa677('0x41')](_0x5326d1)[_0xa677('0x20')](handleEntityNotFound(_0x43a477,null))[_0xa677('0x20')](respondWithResult(_0x43a477,null))[_0xa677('0x3d')](handleError(_0x43a477,null));};exports[_0xa677('0x42')]=function(_0x130294,_0x509298){return db[_0xa677('0x40')]['create'](_0x130294[_0xa677('0x43')],{})[_0xa677('0x20')](respondWithResult(_0x509298,0xc9))[_0xa677('0x3d')](handleError(_0x509298,null));};exports[_0xa677('0x1f')]=function(_0x28cee0,_0x23790e){if(_0x28cee0[_0xa677('0x43')]['id']){delete _0x28cee0[_0xa677('0x43')]['id'];}return db[_0xa677('0x40')][_0xa677('0x41')]({'where':{'id':_0x28cee0['params']['id']}})['then'](handleEntityNotFound(_0x23790e,null))[_0xa677('0x20')](saveUpdates(_0x28cee0[_0xa677('0x43')],null))[_0xa677('0x20')](respondWithResult(_0x23790e,null))[_0xa677('0x3d')](handleError(_0x23790e,null));};exports[_0xa677('0x21')]=function(_0x39cbb1,_0x50d1f6){return db[_0xa677('0x40')]['find']({'where':{'id':_0x39cbb1[_0xa677('0x3f')]['id']}})[_0xa677('0x20')](handleEntityNotFound(_0x50d1f6,null))['then'](removeEntity(_0x50d1f6,null))['catch'](handleError(_0x50d1f6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 659514e..dbbb7cd 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 _0x86f4=['define','ZendeskField','zendesk_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x5902aa,_0x39a7a9){var _0x25f9ba=function(_0x569712){while(--_0x569712){_0x5902aa['push'](_0x5902aa['shift']());}};_0x25f9ba(++_0x39a7a9);}(_0x86f4,0xae));var _0x486f=function(_0x3eff01,_0x43e635){_0x3eff01=_0x3eff01-0x0;var _0x204ba0=_0x86f4[_0x3eff01];return _0x204ba0;};'use strict';var _=require('lodash');var util=require(_0x486f('0x0'));var logger=require(_0x486f('0x1'))('api');var moment=require(_0x486f('0x2'));var BPromise=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x486f('0x5'));var attributes=require(_0x486f('0x6'));module[_0x486f('0x7')]=function(_0x258cb9,_0x3d5136){return _0x258cb9[_0x486f('0x8')](_0x486f('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x486f('0xa'),'fields':[_0x486f('0xb'),_0x486f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x316d=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x3cac4a,_0x275515){var _0x424bda=function(_0x3d0612){while(--_0x3d0612){_0x3cac4a['push'](_0x3cac4a['shift']());}};_0x424bda(++_0x275515);}(_0x316d,0x83));var _0xd316=function(_0x17fac9,_0x4c638b){_0x17fac9=_0x17fac9-0x0;var _0x3648ed=_0x316d[_0x17fac9];return _0x3648ed;};'use strict';var _=require(_0xd316('0x0'));var util=require(_0xd316('0x1'));var logger=require(_0xd316('0x2'))('api');var moment=require(_0xd316('0x3'));var BPromise=require(_0xd316('0x4'));var rp=require(_0xd316('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd316('0x6'));var config=require(_0xd316('0x7'));var attributes=require('./intZendeskField.attributes');module[_0xd316('0x8')]=function(_0x469ec4,_0x4ce463){return _0x469ec4['define'](_0xd316('0x9'),attributes,{'tableName':_0xd316('0xa'),'paranoid':![],'indexes':[{'name':_0xd316('0xb'),'fields':[_0xd316('0xc'),_0xd316('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 cf716bf..0ccb0ac 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 _0xdac7=['error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xdac7,0x180));var _0x7dac=function(_0x1e5a45,_0x4d468a){_0x1e5a45=_0x1e5a45-0x0;var _0x429104=_0xdac7[_0x1e5a45];return _0x429104;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dac('0x2'));var db=require(_0x7dac('0x3'))['db'];var utils=require(_0x7dac('0x4'));var logger=require(_0x7dac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dac('0x6')][_0x7dac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505705,_0x28cc84,_0x53c460){return new BPromise(function(_0x3b319f,_0x5ccf75){return client[_0x7dac('0x8')](_0x505705,_0x53c460)[_0x7dac('0x9')](function(_0x45fbdc){logger[_0x7dac('0xa')](_0x7dac('0xb'),_0x28cc84,_0x7dac('0xc'));logger[_0x7dac('0xd')](_0x7dac('0xe'),_0x28cc84,_0x7dac('0xc'),JSON[_0x7dac('0xf')](_0x45fbdc));if(_0x45fbdc['error']){if(_0x45fbdc['error']['code']===0x1f4){logger[_0x7dac('0x10')]('ZendeskField,\x20%s,\x20%s',_0x28cc84,_0x45fbdc[_0x7dac('0x10')]['message']);return _0x5ccf75(_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);}logger[_0x7dac('0x10')](_0x7dac('0xb'),_0x28cc84,_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);return _0x3b319f(_0x45fbdc[_0x7dac('0x10')]['message']);}else{logger[_0x7dac('0xa')]('ZendeskField,\x20%s,\x20%s',_0x28cc84,'request\x20sent');_0x3b319f(_0x45fbdc[_0x7dac('0x12')][_0x7dac('0x11')]);}})[_0x7dac('0x13')](function(_0x2de4ea){logger[_0x7dac('0x10')]('ZendeskField,\x20%s,\x20%s',_0x28cc84,_0x2de4ea);_0x5ccf75(_0x2de4ea);});});} \ No newline at end of file +var _0x0102=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0102,0x186));var _0x2010=function(_0x31a198,_0xca861d){_0x31a198=_0x31a198-0x0;var _0x3e3f28=_0x0102[_0x31a198];return _0x3e3f28;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var moment=require(_0x2010('0x1'));var BPromise=require(_0x2010('0x2'));var rs=require(_0x2010('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2010('0x4'));var jayson=require(_0x2010('0x5'));var client=jayson[_0x2010('0x6')][_0x2010('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4eeb67,_0x453fc0,_0x495d98){return new BPromise(function(_0x4728c0,_0x160e41){return client['request'](_0x4eeb67,_0x495d98)[_0x2010('0x8')](function(_0x3c2d98){logger[_0x2010('0x9')](_0x2010('0xa'),_0x453fc0,_0x2010('0xb'));logger[_0x2010('0xc')](_0x2010('0xd'),_0x453fc0,_0x2010('0xb'),JSON[_0x2010('0xe')](_0x3c2d98));if(_0x3c2d98[_0x2010('0xf')]){if(_0x3c2d98[_0x2010('0xf')][_0x2010('0x10')]===0x1f4){logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);return _0x160e41(_0x3c2d98['error']['message']);}logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);return _0x4728c0(_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);}else{logger['info'](_0x2010('0xa'),_0x453fc0,_0x2010('0xb'));_0x4728c0(_0x3c2d98['result'][_0x2010('0x11')]);}})[_0x2010('0x12')](function(_0x410889){logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x410889);_0x160e41(_0x410889);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 18c9b56..aba443c 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 _0x878f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5ed5e4,_0x15d7fc){var _0xcc956a=function(_0x53130a){while(--_0x53130a){_0x5ed5e4['push'](_0x5ed5e4['shift']());}};_0xcc956a(++_0x15d7fc);}(_0x878f,0x173));var _0xf878=function(_0x2c99c0,_0x5578ef){_0x2c99c0=_0x2c99c0-0x0;var _0x53f44f=_0x878f[_0x2c99c0];return _0x53f44f;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var auth=require(_0xf878('0x5'));var interaction=require(_0xf878('0x6'));var config=require(_0xf878('0x7'));var controller=require(_0xf878('0x8'));router[_0xf878('0x9')]('/',auth[_0xf878('0xa')](),controller['index']);router['get'](_0xf878('0xb'),auth[_0xf878('0xa')](),controller['show']);router['get']('/:id/configurations',auth[_0xf878('0xa')](),controller['getConfigurations']);router['get'](_0xf878('0xc'),auth[_0xf878('0xa')](),controller[_0xf878('0xd')]);router['post']('/',auth[_0xf878('0xa')](),controller[_0xf878('0xe')]);router['post'](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router[_0xf878('0x11')](_0xf878('0xb'),auth['isAuthenticated'](),controller[_0xf878('0x12')]);router[_0xf878('0x13')](_0xf878('0xb'),auth['isAuthenticated'](),controller[_0xf878('0x14')]);module[_0xf878('0x15')]=router; \ No newline at end of file +var _0xb62e=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb62e,0x1de));var _0xeb62=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb62e[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var auth=require(_0xeb62('0x5'));var interaction=require(_0xeb62('0x6'));var config=require(_0xeb62('0x7'));var controller=require(_0xeb62('0x8'));router[_0xeb62('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb62('0xa')]);router[_0xeb62('0x9')](_0xeb62('0xb'),auth['isAuthenticated'](),controller[_0xeb62('0xc')]);router[_0xeb62('0x9')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller['getConfigurations']);router['get'](_0xeb62('0xf'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')]('/',auth[_0xeb62('0xe')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x11')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x13')]);router['put'](_0xeb62('0xb'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x14')]);router[_0xeb62('0x15')]('/:id',auth[_0xeb62('0xe')](),controller[_0xeb62('0x16')]);module[_0xeb62('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d32289a..1dc606d 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 _0xc044=['exports','STRING'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0xc044,0x12c));var _0x4c04=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc044[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require('sequelize');module[_0x4c04('0x0')]={'name':{'type':Sequelize[_0x4c04('0x1')]},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4c04('0x1')]},'host':{'type':Sequelize[_0x4c04('0x1')]},'serverUrl':{'type':Sequelize[_0x4c04('0x1')]}}; \ No newline at end of file +var _0xcd50=['sequelize','exports','STRING'];(function(_0x1d91af,_0x2e23b7){var _0x3de910=function(_0x24b14){while(--_0x24b14){_0x1d91af['push'](_0x1d91af['shift']());}};_0x3de910(++_0x2e23b7);}(_0xcd50,0xe4));var _0x0cd5=function(_0x2c9a1c,_0x562643){_0x2c9a1c=_0x2c9a1c-0x0;var _0x108e22=_0xcd50[_0x2c9a1c];return _0x108e22;};'use strict';var Sequelize=require(_0x0cd5('0x0'));module[_0x0cd5('0x1')]={'name':{'type':Sequelize[_0x0cd5('0x2')]},'description':{'type':Sequelize[_0x0cd5('0x2')]},'authToken':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0cd5('0x2')]},'serverUrl':{'type':Sequelize[_0x0cd5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index a2743ac..084ef37 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 _0x7b40=['query','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','map','key','field','options','includeAll','findAll','rows','catch','show','params','find','create','body','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','ZohoField','getFields','host','authToken','slice','GET','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','Call\x20Purpose','section','push','customfield','true','val','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','name','Wrong\x20credentials','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','ZohoAccount','rawAttributes','model','keys'];(function(_0x4cee4b,_0x1dfff3){var _0x4d891d=function(_0x3722ba){while(--_0x3722ba){_0x4cee4b['push'](_0x4cee4b['shift']());}};_0x4d891d(++_0x1dfff3);}(_0x7b40,0xb1));var _0x07b4=function(_0x258d5f,_0x110c24){_0x258d5f=_0x258d5f-0x0;var _0x4f3469=_0x7b40[_0x258d5f];return _0x4f3469;};'use strict';var pdf=require(_0x07b4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x07b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x07b4('0x2'));var moment=require(_0x07b4('0x3'));var BPromise=require(_0x07b4('0x4'));var Mustache=require(_0x07b4('0x5'));var util=require(_0x07b4('0x6'));var path=require(_0x07b4('0x7'));var sox=require(_0x07b4('0x8'));var csv=require(_0x07b4('0x9'));var ejs=require(_0x07b4('0xa'));var fs=require('fs');var _=require(_0x07b4('0xb'));var squel=require(_0x07b4('0xc'));var crypto=require(_0x07b4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x07b4('0xe'));var toCsv=require(_0x07b4('0x9'));var querystring=require(_0x07b4('0xf'));var Papa=require(_0x07b4('0x10'));var Redis=require(_0x07b4('0x11'));var authService=require(_0x07b4('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x07b4('0x13'));var logger=require(_0x07b4('0x14'))(_0x07b4('0x15'));var utils=require(_0x07b4('0x16'));var config=require('../../config/environment');var db=require(_0x07b4('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x07b4('0x18')][_0x07b4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5bbc0d,_0x450511,_0x4a8ca1){if(_0x4a8ca1){var _0x567c93=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x567c93['test'](_0x450511)){return _0x5bbc0d;}else{throw new Error(_0x07b4('0x1a'));}}else{return _0x5bbc0d;}}function respondWithRpcPromise(_0x134e46,_0x3fca0c,_0xbaf505,_0x21513f){return new BPromise(function(_0x5cb480,_0x334d41){var _0x369744=_0x21513f||client;return _0x369744[_0x07b4('0x1b')](_0x134e46,_0xbaf505)[_0x07b4('0x1c')](function(_0x742889){logger['info'](_0x07b4('0x1d'),_0x3fca0c,_0x07b4('0x1e'));logger['debug'](_0x07b4('0x1f'),_0x3fca0c,_0x07b4('0x1e'),JSON['stringify'](_0x742889));if(_0x742889[_0x07b4('0x20')]){if(_0x742889[_0x07b4('0x20')]['code']===0x1f4){logger[_0x07b4('0x20')](_0x07b4('0x1d'),_0x3fca0c,_0x742889['error'][_0x07b4('0x21')]);return _0x334d41(_0x742889[_0x07b4('0x20')][_0x07b4('0x21')]);}logger[_0x07b4('0x20')](_0x07b4('0x1d'),_0x3fca0c,_0x742889['error']['message']);return _0x5cb480(_0x742889[_0x07b4('0x20')][_0x07b4('0x21')]);}else{logger[_0x07b4('0x22')](_0x07b4('0x1d'),_0x3fca0c,_0x07b4('0x1e'));_0x5cb480(_0x742889[_0x07b4('0x23')][_0x07b4('0x21')]);}})['catch'](function(_0x48373d){logger[_0x07b4('0x20')]('ZohoAccount,\x20%s,\x20%s',_0x3fca0c,_0x48373d);_0x334d41(_0x48373d);});});}function respondWithStatusCode(_0x5cf4b8,_0x3ac32d){_0x3ac32d=_0x3ac32d||0xcc;return function(_0x543616){if(_0x543616){return _0x5cf4b8[_0x07b4('0x24')](_0x3ac32d);}return _0x5cf4b8[_0x07b4('0x25')](_0x3ac32d)[_0x07b4('0x26')]();};}function respondWithResult(_0x253389,_0x3503f4){_0x3503f4=_0x3503f4||0xc8;return function(_0x7343c2){if(_0x7343c2){return _0x253389[_0x07b4('0x25')](_0x3503f4)[_0x07b4('0x27')](_0x7343c2);}};}function respondWithFilteredResult(_0x18fd1a,_0x2a16e1){return function(_0x5a514a){if(_0x5a514a){var _0x5b1eb4=_0x5a514a[_0x07b4('0x28')],_0x4bd890=_0x2a16e1['offset'],_0x5e6410=_0x2a16e1['offset']+_0x2a16e1[_0x07b4('0x29')],_0x3c27ed;if(_0x5e6410>=_0x5b1eb4){_0x5e6410=_0x5b1eb4;_0x3c27ed=0xc8;}else{_0x3c27ed=0xce;}_0x18fd1a['status'](_0x3c27ed);return _0x18fd1a[_0x07b4('0x2a')](_0x07b4('0x2b'),_0x4bd890+'-'+_0x5e6410+'/'+_0x5b1eb4)[_0x07b4('0x27')](_0x5a514a);}return null;};}function patchUpdates(_0x198af6){return function(_0x5b7b3d){try{jsonpatch[_0x07b4('0x2c')](_0x5b7b3d,_0x198af6,!![]);}catch(_0x3f3c3c){return BPromise[_0x07b4('0x2d')](_0x3f3c3c);}return _0x5b7b3d[_0x07b4('0x2e')]();};}function saveUpdates(_0x349bcb,_0x3abb6f){return function(_0x2ec94b){if(_0x2ec94b){return _0x2ec94b[_0x07b4('0x2f')](_0x349bcb)[_0x07b4('0x1c')](function(_0x5a1e4d){return _0x5a1e4d;});}return null;};}function removeEntity(_0xbad431,_0x55c4c7){return function(_0x5c977f){if(_0x5c977f){return _0x5c977f[_0x07b4('0x30')]()[_0x07b4('0x1c')](function(){_0xbad431['status'](0xcc)[_0x07b4('0x26')]();});}};}function handleEntityNotFound(_0x542e06,_0x5ed2ac){return function(_0x306e57){if(!_0x306e57){_0x542e06['sendStatus'](0x194);}return _0x306e57;};}function handleError(_0x3cf360,_0x139806){_0x139806=_0x139806||0x1f4;return function(_0x21a1f6){logger[_0x07b4('0x20')](_0x21a1f6[_0x07b4('0x31')]);if(_0x21a1f6['name']){delete _0x21a1f6['name'];}_0x3cf360[_0x07b4('0x25')](_0x139806)['send'](_0x21a1f6);};}exports[_0x07b4('0x32')]=function(_0x4019e0,_0x4a3127){var _0x378809={},_0x1be531={},_0x35f4f7={'count':0x0,'rows':[]};var _0x154a1a=db[_0x07b4('0x33')][_0x07b4('0x34')];_0x1be531[_0x07b4('0x35')]=_[_0x07b4('0x36')](_0x154a1a);_0x1be531['query']=_[_0x07b4('0x36')](_0x4019e0[_0x07b4('0x37')]);_0x1be531[_0x07b4('0x38')]=_[_0x07b4('0x39')](_0x1be531[_0x07b4('0x35')],_0x1be531[_0x07b4('0x37')]);_0x378809['attributes']=_[_0x07b4('0x39')](_0x1be531['model'],qs[_0x07b4('0x3a')](_0x4019e0['query']['fields']));_0x378809['attributes']=_0x378809[_0x07b4('0x3b')][_0x07b4('0x3c')]?_0x378809[_0x07b4('0x3b')]:_0x1be531[_0x07b4('0x35')];if(!_0x4019e0['query'][_0x07b4('0x3d')]('nolimit')){_0x378809['limit']=qs['limit'](_0x4019e0['query'][_0x07b4('0x29')]);_0x378809[_0x07b4('0x3e')]=qs[_0x07b4('0x3e')](_0x4019e0[_0x07b4('0x37')][_0x07b4('0x3e')]);}_0x378809[_0x07b4('0x3f')]=qs[_0x07b4('0x40')](_0x4019e0[_0x07b4('0x37')][_0x07b4('0x40')]);_0x378809['where']=qs[_0x07b4('0x38')](_[_0x07b4('0x41')](_0x4019e0[_0x07b4('0x37')],_0x1be531[_0x07b4('0x38')]));if(_0x4019e0[_0x07b4('0x37')][_0x07b4('0x42')]){_0x378809[_0x07b4('0x43')]=_[_0x07b4('0x44')](_0x378809[_0x07b4('0x43')],{'$or':_[_0x07b4('0x45')](_0x154a1a,function(_0x3ebbf9){if(_0x3ebbf9['type'][_0x07b4('0x46')]!=='VIRTUAL'){var _0x511362={};_0x511362[_0x3ebbf9[_0x07b4('0x47')]]={'$like':'%'+_0x4019e0['query'][_0x07b4('0x42')]+'%'};return _0x511362;}})});}_0x378809=_[_0x07b4('0x44')]({},_0x378809,_0x4019e0[_0x07b4('0x48')]);var _0xba94cb={'where':_0x378809[_0x07b4('0x43')]};return db[_0x07b4('0x33')]['count'](_0xba94cb)[_0x07b4('0x1c')](function(_0x35fa9b){_0x35f4f7['count']=_0x35fa9b;if(_0x4019e0['query'][_0x07b4('0x49')]){_0x378809['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x07b4('0x4a')](_0x378809);})[_0x07b4('0x1c')](function(_0x54990d){_0x35f4f7[_0x07b4('0x4b')]=_0x54990d;return _0x35f4f7;})[_0x07b4('0x1c')](respondWithFilteredResult(_0x4a3127,_0x378809))[_0x07b4('0x4c')](handleError(_0x4a3127,null));};exports[_0x07b4('0x4d')]=function(_0xedc06d,_0x18ed60){var _0x190c7e={'raw':![],'where':{'id':_0xedc06d[_0x07b4('0x4e')]['id']}},_0x464509={};_0x464509[_0x07b4('0x35')]=_['keys'](db['ZohoAccount']['rawAttributes']);_0x464509[_0x07b4('0x37')]=_[_0x07b4('0x36')](_0xedc06d['query']);_0x464509[_0x07b4('0x38')]=_[_0x07b4('0x39')](_0x464509[_0x07b4('0x35')],_0x464509[_0x07b4('0x37')]);_0x190c7e[_0x07b4('0x3b')]=_[_0x07b4('0x39')](_0x464509['model'],qs[_0x07b4('0x3a')](_0xedc06d[_0x07b4('0x37')][_0x07b4('0x3a')]));_0x190c7e[_0x07b4('0x3b')]=_0x190c7e[_0x07b4('0x3b')]['length']?_0x190c7e['attributes']:_0x464509[_0x07b4('0x35')];if(_0xedc06d[_0x07b4('0x37')][_0x07b4('0x49')]){_0x190c7e['include']=[{'all':!![]}];}_0x190c7e=_[_0x07b4('0x44')]({},_0x190c7e,_0xedc06d[_0x07b4('0x48')]);return db[_0x07b4('0x33')][_0x07b4('0x4f')](_0x190c7e)[_0x07b4('0x1c')](handleEntityNotFound(_0x18ed60,null))[_0x07b4('0x1c')](respondWithResult(_0x18ed60,null))[_0x07b4('0x4c')](handleError(_0x18ed60,null));};exports[_0x07b4('0x50')]=function(_0x59fcdd,_0x566f5d){return db['ZohoAccount']['create'](_0x59fcdd[_0x07b4('0x51')],{})[_0x07b4('0x1c')](respondWithResult(_0x566f5d,0xc9))[_0x07b4('0x4c')](handleError(_0x566f5d,null));};exports[_0x07b4('0x2f')]=function(_0x28c093,_0x1ba08c){if(_0x28c093[_0x07b4('0x51')]['id']){delete _0x28c093['body']['id'];}return db['ZohoAccount'][_0x07b4('0x4f')]({'where':{'id':_0x28c093[_0x07b4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ba08c,null))[_0x07b4('0x1c')](saveUpdates(_0x28c093[_0x07b4('0x51')],null))[_0x07b4('0x1c')](respondWithResult(_0x1ba08c,null))['catch'](handleError(_0x1ba08c,null));};exports[_0x07b4('0x30')]=function(_0x377252,_0x39745e){return db[_0x07b4('0x33')]['find']({'where':{'id':_0x377252[_0x07b4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x39745e,null))[_0x07b4('0x1c')](removeEntity(_0x39745e,null))[_0x07b4('0x4c')](handleError(_0x39745e,null));};exports['getConfigurations']=function(_0x3994a3,_0x4c01ef,_0x265a36){var _0x23aef0={};var _0xb8bc84={};var _0x3fae86;var _0x2f3995;return db[_0x07b4('0x33')][_0x07b4('0x52')]({'where':{'id':_0x3994a3[_0x07b4('0x4e')]['id']}})[_0x07b4('0x1c')](handleEntityNotFound(_0x4c01ef,null))[_0x07b4('0x1c')](function(_0x248b26){if(_0x248b26){_0x3fae86=_0x248b26;_0xb8bc84[_0x07b4('0x35')]=_['keys'](db[_0x07b4('0x53')][_0x07b4('0x34')]);_0xb8bc84[_0x07b4('0x37')]=_[_0x07b4('0x36')](_0x3994a3[_0x07b4('0x37')]);_0xb8bc84[_0x07b4('0x38')]=_[_0x07b4('0x39')](_0xb8bc84[_0x07b4('0x35')],_0xb8bc84['query']);_0x23aef0[_0x07b4('0x3b')]=_[_0x07b4('0x39')](_0xb8bc84['model'],qs['fields'](_0x3994a3[_0x07b4('0x37')]['fields']));_0x23aef0[_0x07b4('0x3b')]=_0x23aef0[_0x07b4('0x3b')][_0x07b4('0x3c')]?_0x23aef0[_0x07b4('0x3b')]:_0xb8bc84[_0x07b4('0x35')];_0x23aef0['order']=qs[_0x07b4('0x40')](_0x3994a3[_0x07b4('0x37')][_0x07b4('0x40')]);_0x23aef0[_0x07b4('0x43')]=qs[_0x07b4('0x38')](_[_0x07b4('0x41')](_0x3994a3[_0x07b4('0x37')],_0xb8bc84[_0x07b4('0x38')]));if(_0x3994a3[_0x07b4('0x37')][_0x07b4('0x42')]){_0x23aef0['where']=_[_0x07b4('0x44')](_0x23aef0[_0x07b4('0x43')],{'$or':_[_0x07b4('0x45')](_0x23aef0[_0x07b4('0x3b')],function(_0xf8242){var _0x2bc186={};_0x2bc186[_0xf8242]={'$like':'%'+_0x3994a3['query']['filter']+'%'};return _0x2bc186;})});}_0x23aef0=_['merge']({},_0x23aef0,_0x3994a3['options']);return _0x3fae86[_0x07b4('0x54')](_0x23aef0);}})[_0x07b4('0x1c')](function(_0x2fb1a8){if(_0x2fb1a8){_0x2f3995=_0x2fb1a8[_0x07b4('0x3c')];if(!_0x3994a3[_0x07b4('0x37')][_0x07b4('0x3d')](_0x07b4('0x55'))){_0x23aef0[_0x07b4('0x29')]=qs[_0x07b4('0x29')](_0x3994a3['query']['limit']);_0x23aef0[_0x07b4('0x3e')]=qs[_0x07b4('0x3e')](_0x3994a3[_0x07b4('0x37')][_0x07b4('0x3e')]);}return _0x3fae86[_0x07b4('0x54')](_0x23aef0);}})[_0x07b4('0x1c')](function(_0x33f387){if(_0x33f387){return _0x33f387?{'count':_0x2f3995,'rows':_0x33f387}:null;}})[_0x07b4('0x1c')](respondWithResult(_0x4c01ef,null))['catch'](handleError(_0x4c01ef,null));};exports[_0x07b4('0x56')]=function(_0x3ca45a,_0x1df7f7,_0x261f9a){if(_0x3ca45a[_0x07b4('0x51')]['id']){delete _0x3ca45a[_0x07b4('0x51')]['id'];}return db[_0x07b4('0x33')][_0x07b4('0x52')]({'where':{'id':_0x3ca45a[_0x07b4('0x4e')]['id']}})[_0x07b4('0x1c')](handleEntityNotFound(_0x1df7f7,null))[_0x07b4('0x1c')](function(_0x423cb3){if(_0x423cb3){_0x3ca45a[_0x07b4('0x51')][_0x07b4('0x57')]=_0x423cb3['id'];_0x3ca45a[_0x07b4('0x51')][_0x07b4('0x58')]=integrations[_0x07b4('0x59')](_0x3ca45a['body']['channel'],_0x3ca45a['body'][_0x07b4('0x5a')]);_0x3ca45a['body'][_0x07b4('0x5b')]=integrations[_0x07b4('0x5c')](_0x3ca45a[_0x07b4('0x51')][_0x07b4('0x5d')],_0x3ca45a[_0x07b4('0x51')][_0x07b4('0x5a')]);return db[_0x07b4('0x53')][_0x07b4('0x50')](_0x3ca45a[_0x07b4('0x51')],{'include':[{'model':db[_0x07b4('0x5e')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x07b4('0x5b')}]});}return null;})['then'](respondWithResult(_0x1df7f7,null))['catch'](handleError(_0x1df7f7,null));};exports[_0x07b4('0x5f')]=function(_0xb85724,_0x3e23f1,_0x849c25){var _0xf09af8='';return db[_0x07b4('0x33')][_0x07b4('0x52')]({'where':{'id':_0xb85724[_0x07b4('0x4e')]['id']},'attributes':['id',_0x07b4('0x60'),_0x07b4('0x61')]})['then'](handleEntityNotFound(_0x3e23f1,null))[_0x07b4('0x1c')](function(_0x4dca1e){if(_0x4dca1e){_0xf09af8=_0x4dca1e[_0x07b4('0x60')];var _0x47a1bc=_0xf09af8[_0x07b4('0x62')](-0x1);if(_0x47a1bc==='/'){_0xf09af8=_0xf09af8['substring'](0x0,_0xf09af8['lastIndexOf'](_0x47a1bc));}return rp({'method':_0x07b4('0x63'),'uri':util['format'](_0x07b4('0x64'),_0xf09af8),'qs':{'authtoken':_0x4dca1e[_0x07b4('0x61')],'scope':_0x07b4('0x65')},'json':!![]});}})[_0x07b4('0x1c')](function(_0x14654a){if(_0x14654a){if(_0x14654a[_0x07b4('0x66')]&&_0x14654a['response'][_0x07b4('0x20')]){throw new Error(_0x14654a[_0x07b4('0x66')][_0x07b4('0x20')][_0x07b4('0x21')]);}var _0x57db6f=[];if(_0x14654a[_0x07b4('0x67')]&&_0x14654a[_0x07b4('0x67')]['section']){if(_0x14654a[_0x07b4('0x67')]['section']['FL']){var _0x56e04b=[_0x07b4('0x68')];for(var _0x508f15=0x0,_0x411b3f=_0x14654a[_0x07b4('0x67')][_0x07b4('0x69')]['FL']['length'];_0x508f15<_0x411b3f;_0x508f15++){if(_['includes'](_0x56e04b,_0x14654a[_0x07b4('0x67')][_0x07b4('0x69')]['FL'][_0x508f15]['dv'])){_0x57db6f[_0x07b4('0x6a')]({'id':_0x14654a[_0x07b4('0x67')][_0x07b4('0x69')]['FL'][_0x508f15]['dv'],'name':_0x14654a['Calls']['section']['FL'][_0x508f15]['label'],'custom':_0x14654a[_0x07b4('0x67')][_0x07b4('0x69')]['FL'][_0x508f15][_0x07b4('0x6b')]===_0x07b4('0x6c')?!![]:![],'options':_0x14654a[_0x07b4('0x67')][_0x07b4('0x69')]['FL'][_0x508f15][_0x07b4('0x5a')]==='Pick\x20List'&&_0x14654a['Calls'][_0x07b4('0x69')]['FL'][_0x508f15][_0x07b4('0x6d')]?_['map'](_0x14654a[_0x07b4('0x67')]['section']['FL'][_0x508f15][_0x07b4('0x6d')],function(_0x580a2f){return{'name':_0x580a2f,'value':_0x580a2f};}):[]});}}}}return{'count':_0x57db6f[_0x07b4('0x3c')],'rows':_0x57db6f};}})[_0x07b4('0x1c')](respondWithResult(_0x3e23f1,null))['catch'](function(_0x40b086){var _0x4885f3=_0xb85724[_0x07b4('0x37')][_0x07b4('0x6e')]?0x1f4:_0x40b086[_0x07b4('0x6f')]||0x1f4;logger['error'](_0x07b4('0x70'),_0x07b4('0x5f'),_0x4885f3,JSON[_0x07b4('0x71')](_0x40b086));delete _0x40b086[_0x07b4('0x72')];if(_0x4885f3===0x191){_0x4885f3=0x190;}_0x3e23f1[_0x07b4('0x25')](_0x4885f3)['send'](_0xb85724[_0x07b4('0x37')][_0x07b4('0x6e')]?{'message':_0x07b4('0x73'),'statusCode':_0x40b086[_0x07b4('0x6f')]}:_0x40b086);});}; \ No newline at end of file +var _0x5ab2=['lastIndexOf','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','includes','push','customfield','true','Pick\x20List','val','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','type','field','options','include','ZohoAccount','findAll','rows','show','params','length','merge','body','find','findOne','ZohoConfiguration','pick','map','getConfigurations','hasOwnProperty','AccountId','Subjects','channel','create','ZohoField','getFields','host','authToken','substring'];(function(_0x1b8b95,_0x3ea343){var _0x3657ae=function(_0x3703e1){while(--_0x3703e1){_0x1b8b95['push'](_0x1b8b95['shift']());}};_0x3657ae(++_0x3ea343);}(_0x5ab2,0x157));var _0x25ab=function(_0x671283,_0x3dc64f){_0x671283=_0x671283-0x0;var _0xec0b6b=_0x5ab2[_0x671283];return _0xec0b6b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x25ab('0x0'));var zipdir=require(_0x25ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25ab('0x2'));var moment=require('moment');var BPromise=require(_0x25ab('0x3'));var Mustache=require(_0x25ab('0x4'));var util=require(_0x25ab('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25ab('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x25ab('0x7'));var crypto=require(_0x25ab('0x8'));var jsforce=require(_0x25ab('0x9'));var deskjs=require(_0x25ab('0xa'));var toCsv=require(_0x25ab('0xb'));var querystring=require(_0x25ab('0xc'));var Papa=require('papaparse');var Redis=require(_0x25ab('0xd'));var authService=require(_0x25ab('0xe'));var qs=require(_0x25ab('0xf'));var hardwareService=require(_0x25ab('0x10'));var logger=require(_0x25ab('0x11'))(_0x25ab('0x12'));var utils=require(_0x25ab('0x13'));var config=require('../../config/environment');var db=require(_0x25ab('0x14'))['db'];var integrations=require(_0x25ab('0x15'));var jayson=require(_0x25ab('0x16'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x47c720,_0x551815,_0xc64dbd){if(_0xc64dbd){var _0x375087=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x375087[_0x25ab('0x17')](_0x551815)){return _0x47c720;}else{throw new Error(_0x25ab('0x18'));}}else{return _0x47c720;}}function respondWithRpcPromise(_0x1b129b,_0x5c6642,_0x33169d,_0x4d299d){return new BPromise(function(_0x525ca8,_0x3115e7){var _0x573e78=_0x4d299d||client;return _0x573e78['request'](_0x1b129b,_0x33169d)[_0x25ab('0x19')](function(_0x1eb8c8){logger[_0x25ab('0x1a')](_0x25ab('0x1b'),_0x5c6642,_0x25ab('0x1c'));logger[_0x25ab('0x1d')](_0x25ab('0x1e'),_0x5c6642,_0x25ab('0x1c'),JSON[_0x25ab('0x1f')](_0x1eb8c8));if(_0x1eb8c8[_0x25ab('0x20')]){if(_0x1eb8c8['error'][_0x25ab('0x21')]===0x1f4){logger[_0x25ab('0x20')](_0x25ab('0x1b'),_0x5c6642,_0x1eb8c8[_0x25ab('0x20')][_0x25ab('0x22')]);return _0x3115e7(_0x1eb8c8[_0x25ab('0x20')]['message']);}logger[_0x25ab('0x20')]('ZohoAccount,\x20%s,\x20%s',_0x5c6642,_0x1eb8c8[_0x25ab('0x20')]['message']);return _0x525ca8(_0x1eb8c8[_0x25ab('0x20')][_0x25ab('0x22')]);}else{logger[_0x25ab('0x1a')](_0x25ab('0x1b'),_0x5c6642,_0x25ab('0x1c'));_0x525ca8(_0x1eb8c8[_0x25ab('0x23')][_0x25ab('0x22')]);}})[_0x25ab('0x24')](function(_0x39e188){logger['error'](_0x25ab('0x1b'),_0x5c6642,_0x39e188);_0x3115e7(_0x39e188);});});}function respondWithStatusCode(_0x1e9fbc,_0x5ef2de){_0x5ef2de=_0x5ef2de||0xcc;return function(_0x3748ef){if(_0x3748ef){return _0x1e9fbc[_0x25ab('0x25')](_0x5ef2de);}return _0x1e9fbc[_0x25ab('0x26')](_0x5ef2de)[_0x25ab('0x27')]();};}function respondWithResult(_0x362013,_0x37d71b){_0x37d71b=_0x37d71b||0xc8;return function(_0x255d74){if(_0x255d74){return _0x362013[_0x25ab('0x26')](_0x37d71b)[_0x25ab('0x28')](_0x255d74);}};}function respondWithFilteredResult(_0x3852b2,_0x151a64){return function(_0xf24f8a){if(_0xf24f8a){var _0x16450f=_0xf24f8a[_0x25ab('0x29')],_0x1152c8=_0x151a64['offset'],_0x28f410=_0x151a64[_0x25ab('0x2a')]+_0x151a64[_0x25ab('0x2b')],_0x8a26d3;if(_0x28f410>=_0x16450f){_0x28f410=_0x16450f;_0x8a26d3=0xc8;}else{_0x8a26d3=0xce;}_0x3852b2[_0x25ab('0x26')](_0x8a26d3);return _0x3852b2[_0x25ab('0x2c')]('Content-Range',_0x1152c8+'-'+_0x28f410+'/'+_0x16450f)[_0x25ab('0x28')](_0xf24f8a);}return null;};}function patchUpdates(_0x329786){return function(_0x1f8061){try{jsonpatch['apply'](_0x1f8061,_0x329786,!![]);}catch(_0x35d0b3){return BPromise[_0x25ab('0x2d')](_0x35d0b3);}return _0x1f8061[_0x25ab('0x2e')]();};}function saveUpdates(_0x314b71,_0x3b8f3e){return function(_0x55233f){if(_0x55233f){return _0x55233f[_0x25ab('0x2f')](_0x314b71)[_0x25ab('0x19')](function(_0x475f72){return _0x475f72;});}return null;};}function removeEntity(_0x5ed0e7,_0x258432){return function(_0x21aebd){if(_0x21aebd){return _0x21aebd['destroy']()[_0x25ab('0x19')](function(){_0x5ed0e7[_0x25ab('0x26')](0xcc)[_0x25ab('0x27')]();});}};}function handleEntityNotFound(_0xe90428,_0x2ed0a1){return function(_0xcb605b){if(!_0xcb605b){_0xe90428['sendStatus'](0x194);}return _0xcb605b;};}function handleError(_0x3d60cf,_0x3b27ba){_0x3b27ba=_0x3b27ba||0x1f4;return function(_0x2f8885){logger[_0x25ab('0x20')](_0x2f8885[_0x25ab('0x30')]);if(_0x2f8885[_0x25ab('0x31')]){delete _0x2f8885[_0x25ab('0x31')];}_0x3d60cf['status'](_0x3b27ba)[_0x25ab('0x32')](_0x2f8885);};}exports[_0x25ab('0x33')]=function(_0x299fbf,_0x5f4022){var _0x3063e5={},_0x5c1ebc={},_0x7a37c0={'count':0x0,'rows':[]};var _0x34b560=db['ZohoAccount'][_0x25ab('0x34')];_0x5c1ebc[_0x25ab('0x35')]=_[_0x25ab('0x36')](_0x34b560);_0x5c1ebc[_0x25ab('0x37')]=_['keys'](_0x299fbf['query']);_0x5c1ebc[_0x25ab('0x38')]=_[_0x25ab('0x39')](_0x5c1ebc[_0x25ab('0x35')],_0x5c1ebc['query']);_0x3063e5['attributes']=_[_0x25ab('0x39')](_0x5c1ebc[_0x25ab('0x35')],qs[_0x25ab('0x3a')](_0x299fbf[_0x25ab('0x37')][_0x25ab('0x3a')]));_0x3063e5['attributes']=_0x3063e5[_0x25ab('0x3b')]['length']?_0x3063e5[_0x25ab('0x3b')]:_0x5c1ebc[_0x25ab('0x35')];if(!_0x299fbf[_0x25ab('0x37')]['hasOwnProperty'](_0x25ab('0x3c'))){_0x3063e5[_0x25ab('0x2b')]=qs['limit'](_0x299fbf[_0x25ab('0x37')][_0x25ab('0x2b')]);_0x3063e5[_0x25ab('0x2a')]=qs['offset'](_0x299fbf[_0x25ab('0x37')][_0x25ab('0x2a')]);}_0x3063e5[_0x25ab('0x3d')]=qs[_0x25ab('0x3e')](_0x299fbf[_0x25ab('0x37')][_0x25ab('0x3e')]);_0x3063e5['where']=qs[_0x25ab('0x38')](_['pick'](_0x299fbf['query'],_0x5c1ebc[_0x25ab('0x38')]));if(_0x299fbf['query'][_0x25ab('0x3f')]){_0x3063e5[_0x25ab('0x40')]=_['merge'](_0x3063e5[_0x25ab('0x40')],{'$or':_['map'](_0x34b560,function(_0x5d6ed4){if(_0x5d6ed4[_0x25ab('0x41')]['key']!=='VIRTUAL'){var _0x3c650c={};_0x3c650c[_0x5d6ed4[_0x25ab('0x42')]]={'$like':'%'+_0x299fbf[_0x25ab('0x37')][_0x25ab('0x3f')]+'%'};return _0x3c650c;}})});}_0x3063e5=_['merge']({},_0x3063e5,_0x299fbf[_0x25ab('0x43')]);var _0x3bee5e={'where':_0x3063e5[_0x25ab('0x40')]};return db['ZohoAccount'][_0x25ab('0x29')](_0x3bee5e)['then'](function(_0x15db04){_0x7a37c0[_0x25ab('0x29')]=_0x15db04;if(_0x299fbf[_0x25ab('0x37')]['includeAll']){_0x3063e5[_0x25ab('0x44')]=[{'all':!![]}];}return db[_0x25ab('0x45')][_0x25ab('0x46')](_0x3063e5);})[_0x25ab('0x19')](function(_0x477baa){_0x7a37c0[_0x25ab('0x47')]=_0x477baa;return _0x7a37c0;})['then'](respondWithFilteredResult(_0x5f4022,_0x3063e5))[_0x25ab('0x24')](handleError(_0x5f4022,null));};exports[_0x25ab('0x48')]=function(_0x4e7152,_0x48819b){var _0x59604b={'raw':![],'where':{'id':_0x4e7152[_0x25ab('0x49')]['id']}},_0x38debe={};_0x38debe[_0x25ab('0x35')]=_[_0x25ab('0x36')](db[_0x25ab('0x45')][_0x25ab('0x34')]);_0x38debe[_0x25ab('0x37')]=_[_0x25ab('0x36')](_0x4e7152[_0x25ab('0x37')]);_0x38debe[_0x25ab('0x38')]=_['intersection'](_0x38debe[_0x25ab('0x35')],_0x38debe[_0x25ab('0x37')]);_0x59604b[_0x25ab('0x3b')]=_[_0x25ab('0x39')](_0x38debe[_0x25ab('0x35')],qs[_0x25ab('0x3a')](_0x4e7152[_0x25ab('0x37')]['fields']));_0x59604b[_0x25ab('0x3b')]=_0x59604b[_0x25ab('0x3b')][_0x25ab('0x4a')]?_0x59604b[_0x25ab('0x3b')]:_0x38debe[_0x25ab('0x35')];if(_0x4e7152[_0x25ab('0x37')]['includeAll']){_0x59604b[_0x25ab('0x44')]=[{'all':!![]}];}_0x59604b=_[_0x25ab('0x4b')]({},_0x59604b,_0x4e7152['options']);return db['ZohoAccount']['find'](_0x59604b)[_0x25ab('0x19')](handleEntityNotFound(_0x48819b,null))[_0x25ab('0x19')](respondWithResult(_0x48819b,null))[_0x25ab('0x24')](handleError(_0x48819b,null));};exports['create']=function(_0x321f7e,_0x5bb51d){return db[_0x25ab('0x45')]['create'](_0x321f7e[_0x25ab('0x4c')],{})[_0x25ab('0x19')](respondWithResult(_0x5bb51d,0xc9))['catch'](handleError(_0x5bb51d,null));};exports[_0x25ab('0x2f')]=function(_0x3c19c4,_0x49d96a){if(_0x3c19c4['body']['id']){delete _0x3c19c4['body']['id'];}return db[_0x25ab('0x45')][_0x25ab('0x4d')]({'where':{'id':_0x3c19c4[_0x25ab('0x49')]['id']}})[_0x25ab('0x19')](handleEntityNotFound(_0x49d96a,null))[_0x25ab('0x19')](saveUpdates(_0x3c19c4['body'],null))[_0x25ab('0x19')](respondWithResult(_0x49d96a,null))[_0x25ab('0x24')](handleError(_0x49d96a,null));};exports['destroy']=function(_0x51aff4,_0x1f1c3f){return db[_0x25ab('0x45')]['find']({'where':{'id':_0x51aff4[_0x25ab('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f1c3f,null))['then'](removeEntity(_0x1f1c3f,null))['catch'](handleError(_0x1f1c3f,null));};exports['getConfigurations']=function(_0x5b8d7a,_0x3d7e02,_0x4bbf0f){var _0x25deae={};var _0x51c63b={};var _0x10052f;var _0x5ce3b4;return db[_0x25ab('0x45')][_0x25ab('0x4e')]({'where':{'id':_0x5b8d7a[_0x25ab('0x49')]['id']}})[_0x25ab('0x19')](handleEntityNotFound(_0x3d7e02,null))[_0x25ab('0x19')](function(_0x5472ff){if(_0x5472ff){_0x10052f=_0x5472ff;_0x51c63b['model']=_[_0x25ab('0x36')](db[_0x25ab('0x4f')][_0x25ab('0x34')]);_0x51c63b[_0x25ab('0x37')]=_[_0x25ab('0x36')](_0x5b8d7a[_0x25ab('0x37')]);_0x51c63b['filters']=_['intersection'](_0x51c63b[_0x25ab('0x35')],_0x51c63b[_0x25ab('0x37')]);_0x25deae[_0x25ab('0x3b')]=_[_0x25ab('0x39')](_0x51c63b['model'],qs[_0x25ab('0x3a')](_0x5b8d7a[_0x25ab('0x37')][_0x25ab('0x3a')]));_0x25deae[_0x25ab('0x3b')]=_0x25deae[_0x25ab('0x3b')][_0x25ab('0x4a')]?_0x25deae['attributes']:_0x51c63b[_0x25ab('0x35')];_0x25deae['order']=qs[_0x25ab('0x3e')](_0x5b8d7a[_0x25ab('0x37')][_0x25ab('0x3e')]);_0x25deae[_0x25ab('0x40')]=qs[_0x25ab('0x38')](_[_0x25ab('0x50')](_0x5b8d7a['query'],_0x51c63b[_0x25ab('0x38')]));if(_0x5b8d7a[_0x25ab('0x37')][_0x25ab('0x3f')]){_0x25deae[_0x25ab('0x40')]=_['merge'](_0x25deae[_0x25ab('0x40')],{'$or':_[_0x25ab('0x51')](_0x25deae[_0x25ab('0x3b')],function(_0x23b86f){var _0x5ca2b3={};_0x5ca2b3[_0x23b86f]={'$like':'%'+_0x5b8d7a[_0x25ab('0x37')][_0x25ab('0x3f')]+'%'};return _0x5ca2b3;})});}_0x25deae=_['merge']({},_0x25deae,_0x5b8d7a[_0x25ab('0x43')]);return _0x10052f[_0x25ab('0x52')](_0x25deae);}})[_0x25ab('0x19')](function(_0x18845b){if(_0x18845b){_0x5ce3b4=_0x18845b['length'];if(!_0x5b8d7a['query'][_0x25ab('0x53')](_0x25ab('0x3c'))){_0x25deae[_0x25ab('0x2b')]=qs[_0x25ab('0x2b')](_0x5b8d7a[_0x25ab('0x37')][_0x25ab('0x2b')]);_0x25deae[_0x25ab('0x2a')]=qs[_0x25ab('0x2a')](_0x5b8d7a[_0x25ab('0x37')]['offset']);}return _0x10052f[_0x25ab('0x52')](_0x25deae);}})[_0x25ab('0x19')](function(_0x409919){if(_0x409919){return _0x409919?{'count':_0x5ce3b4,'rows':_0x409919}:null;}})[_0x25ab('0x19')](respondWithResult(_0x3d7e02,null))['catch'](handleError(_0x3d7e02,null));};exports['addConfiguration']=function(_0xa25347,_0x9a8a2c,_0x55420e){if(_0xa25347[_0x25ab('0x4c')]['id']){delete _0xa25347[_0x25ab('0x4c')]['id'];}return db[_0x25ab('0x45')][_0x25ab('0x4e')]({'where':{'id':_0xa25347[_0x25ab('0x49')]['id']}})[_0x25ab('0x19')](handleEntityNotFound(_0x9a8a2c,null))[_0x25ab('0x19')](function(_0x3c2afe){if(_0x3c2afe){_0xa25347[_0x25ab('0x4c')][_0x25ab('0x54')]=_0x3c2afe['id'];_0xa25347['body'][_0x25ab('0x55')]=integrations['getSubjects'](_0xa25347['body'][_0x25ab('0x56')],_0xa25347['body'][_0x25ab('0x41')]);_0xa25347[_0x25ab('0x4c')]['Descriptions']=integrations['getDescriptions'](_0xa25347[_0x25ab('0x4c')]['channel'],_0xa25347[_0x25ab('0x4c')]['type']);return db['ZohoConfiguration'][_0x25ab('0x57')](_0xa25347[_0x25ab('0x4c')],{'include':[{'model':db[_0x25ab('0x58')],'as':_0x25ab('0x55')},{'model':db[_0x25ab('0x58')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x9a8a2c,null))[_0x25ab('0x24')](handleError(_0x9a8a2c,null));};exports[_0x25ab('0x59')]=function(_0x16d34c,_0x380219,_0x50ae4c){var _0x33d055='';return db[_0x25ab('0x45')]['findOne']({'where':{'id':_0x16d34c[_0x25ab('0x49')]['id']},'attributes':['id',_0x25ab('0x5a'),_0x25ab('0x5b')]})['then'](handleEntityNotFound(_0x380219,null))[_0x25ab('0x19')](function(_0x199391){if(_0x199391){_0x33d055=_0x199391[_0x25ab('0x5a')];var _0x19eb20=_0x33d055['slice'](-0x1);if(_0x19eb20==='/'){_0x33d055=_0x33d055[_0x25ab('0x5c')](0x0,_0x33d055[_0x25ab('0x5d')](_0x19eb20));}return rp({'method':'GET','uri':util[_0x25ab('0x5e')](_0x25ab('0x5f'),_0x33d055),'qs':{'authtoken':_0x199391[_0x25ab('0x5b')],'scope':_0x25ab('0x60')},'json':!![]});}})[_0x25ab('0x19')](function(_0x12f8b4){if(_0x12f8b4){if(_0x12f8b4[_0x25ab('0x61')]&&_0x12f8b4[_0x25ab('0x61')][_0x25ab('0x20')]){throw new Error(_0x12f8b4['response']['error'][_0x25ab('0x22')]);}var _0x1d5466=[];if(_0x12f8b4['Calls']&&_0x12f8b4[_0x25ab('0x62')][_0x25ab('0x63')]){if(_0x12f8b4[_0x25ab('0x62')][_0x25ab('0x63')]['FL']){var _0x3cca68=[_0x25ab('0x64')];for(var _0x5d1a17=0x0,_0x195f8e=_0x12f8b4[_0x25ab('0x62')][_0x25ab('0x63')]['FL'][_0x25ab('0x4a')];_0x5d1a17<_0x195f8e;_0x5d1a17++){if(_[_0x25ab('0x65')](_0x3cca68,_0x12f8b4['Calls']['section']['FL'][_0x5d1a17]['dv'])){_0x1d5466[_0x25ab('0x66')]({'id':_0x12f8b4['Calls'][_0x25ab('0x63')]['FL'][_0x5d1a17]['dv'],'name':_0x12f8b4[_0x25ab('0x62')][_0x25ab('0x63')]['FL'][_0x5d1a17]['label'],'custom':_0x12f8b4[_0x25ab('0x62')][_0x25ab('0x63')]['FL'][_0x5d1a17][_0x25ab('0x67')]===_0x25ab('0x68')?!![]:![],'options':_0x12f8b4[_0x25ab('0x62')]['section']['FL'][_0x5d1a17]['type']===_0x25ab('0x69')&&_0x12f8b4[_0x25ab('0x62')][_0x25ab('0x63')]['FL'][_0x5d1a17][_0x25ab('0x6a')]?_[_0x25ab('0x51')](_0x12f8b4[_0x25ab('0x62')]['section']['FL'][_0x5d1a17][_0x25ab('0x6a')],function(_0x28ca27){return{'name':_0x28ca27,'value':_0x28ca27};}):[]});}}}}return{'count':_0x1d5466['length'],'rows':_0x1d5466};}})[_0x25ab('0x19')](respondWithResult(_0x380219,null))[_0x25ab('0x24')](function(_0x685277){var _0x576d20=_0x16d34c[_0x25ab('0x37')]['test']?0x1f4:_0x685277['statusCode']||0x1f4;logger[_0x25ab('0x20')](_0x25ab('0x6b'),'getFields',_0x576d20,JSON[_0x25ab('0x1f')](_0x685277));delete _0x685277[_0x25ab('0x31')];if(_0x576d20===0x191){_0x576d20=0x190;}_0x380219[_0x25ab('0x26')](_0x576d20)[_0x25ab('0x32')](_0x16d34c[_0x25ab('0x37')]['test']?{'message':_0x25ab('0x6c'),'statusCode':_0x685277['statusCode']}:_0x685277);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 488f497..e345ea9 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 _0xb0dd=['moment','path','rimraf','../../config/environment','../../components/integrations/configuration','ZohoAccount','int_zoho_accounts','lodash','util','../../config/logger','api'];(function(_0x29214d,_0x25b25e){var _0x5800d3=function(_0x187f5a){while(--_0x187f5a){_0x29214d['push'](_0x29214d['shift']());}};_0x5800d3(++_0x25b25e);}(_0xb0dd,0x1e0));var _0xdb0d=function(_0x2512d9,_0x1acaae){_0x2512d9=_0x2512d9-0x0;var _0x18537a=_0xb0dd[_0x2512d9];return _0x18537a;};'use strict';var _=require(_0xdb0d('0x0'));var util=require(_0xdb0d('0x1'));var logger=require(_0xdb0d('0x2'))(_0xdb0d('0x3'));var moment=require(_0xdb0d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb0d('0x5'));var rimraf=require(_0xdb0d('0x6'));var config=require(_0xdb0d('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xdb0d('0x8'));module['exports']=function(_0x1d9e06,_0x22f6f7){return _0x1d9e06['define'](_0xdb0d('0x9'),attributes,{'tableName':_0xdb0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9820=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x2dacbc,_0x494a69){var _0x1cc00a=function(_0x4b52d8){while(--_0x4b52d8){_0x2dacbc['push'](_0x2dacbc['shift']());}};_0x1cc00a(++_0x494a69);}(_0x9820,0xb6));var _0x0982=function(_0x495dc9,_0x5d1952){_0x495dc9=_0x495dc9-0x0;var _0x1f82f7=_0x9820[_0x495dc9];return _0x1f82f7;};'use strict';var _=require(_0x0982('0x0'));var util=require('util');var logger=require(_0x0982('0x1'))(_0x0982('0x2'));var moment=require(_0x0982('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0982('0x4'));var rimraf=require(_0x0982('0x5'));var config=require(_0x0982('0x6'));var attributes=require(_0x0982('0x7'));var integrations=require(_0x0982('0x8'));module[_0x0982('0x9')]=function(_0x83f6e2,_0x364b89){return _0x83f6e2[_0x0982('0xa')](_0x0982('0xb'),attributes,{'tableName':_0x0982('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index ae951d8..9758297 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 _0x1126=['jayson/promise','client','http','request','then','info','request\x20sent','error','code','ZohoAccount,\x20%s,\x20%s','message','result','GetZohoAccount','options','raw','where','attributes','limit','include','model','map','stringify','catch','ShowZohoAccount','ZohoAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x13e6f4,_0x23f101){var _0x3bc7cb=function(_0x363bd9){while(--_0x363bd9){_0x13e6f4['push'](_0x13e6f4['shift']());}};_0x3bc7cb(++_0x23f101);}(_0x1126,0x177));var _0x6112=function(_0x5b1df5,_0x25e738){_0x5b1df5=_0x5b1df5-0x0;var _0x158df4=_0x1126[_0x5b1df5];return _0x158df4;};'use strict';var _=require(_0x6112('0x0'));var util=require(_0x6112('0x1'));var moment=require(_0x6112('0x2'));var BPromise=require(_0x6112('0x3'));var rs=require(_0x6112('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6112('0x5'))['db'];var utils=require(_0x6112('0x6'));var logger=require(_0x6112('0x7'))(_0x6112('0x8'));var config=require(_0x6112('0x9'));var jayson=require(_0x6112('0xa'));var client=jayson[_0x6112('0xb')][_0x6112('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a8906,_0x100f77,_0xceaad0){return new BPromise(function(_0x4ccf39,_0x25182e){return client[_0x6112('0xd')](_0x5a8906,_0xceaad0)[_0x6112('0xe')](function(_0x44d1be){logger[_0x6112('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x100f77,_0x6112('0x10'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x100f77,_0x6112('0x10'),JSON['stringify'](_0x44d1be));if(_0x44d1be[_0x6112('0x11')]){if(_0x44d1be[_0x6112('0x11')][_0x6112('0x12')]===0x1f4){logger[_0x6112('0x11')](_0x6112('0x13'),_0x100f77,_0x44d1be[_0x6112('0x11')]['message']);return _0x25182e(_0x44d1be[_0x6112('0x11')][_0x6112('0x14')]);}logger[_0x6112('0x11')](_0x6112('0x13'),_0x100f77,_0x44d1be['error'][_0x6112('0x14')]);return _0x4ccf39(_0x44d1be['error'][_0x6112('0x14')]);}else{logger[_0x6112('0xf')](_0x6112('0x13'),_0x100f77,_0x6112('0x10'));_0x4ccf39(_0x44d1be[_0x6112('0x15')][_0x6112('0x14')]);}})['catch'](function(_0x663811){logger[_0x6112('0x11')](_0x6112('0x13'),_0x100f77,_0x663811);_0x25182e(_0x663811);});});}exports[_0x6112('0x16')]=function(_0x47f3bb){var _0xf7a797=this;return new Promise(function(_0x198b23,_0x4a52bc){return db['ZohoAccount']['findAll']({'raw':_0x47f3bb[_0x6112('0x17')]?_0x47f3bb[_0x6112('0x17')][_0x6112('0x18')]===undefined?!![]:![]:!![],'where':_0x47f3bb[_0x6112('0x17')]?_0x47f3bb['options'][_0x6112('0x19')]||null:null,'attributes':_0x47f3bb[_0x6112('0x17')]?_0x47f3bb[_0x6112('0x17')][_0x6112('0x1a')]||null:null,'limit':_0x47f3bb[_0x6112('0x17')]?_0x47f3bb[_0x6112('0x17')][_0x6112('0x1b')]||null:null,'include':_0x47f3bb[_0x6112('0x17')]?_0x47f3bb[_0x6112('0x17')][_0x6112('0x1c')]?_['map'](_0x47f3bb[_0x6112('0x17')]['include'],function(_0x149cf7){return{'model':db[_0x149cf7[_0x6112('0x1d')]],'as':_0x149cf7['as'],'attributes':_0x149cf7['attributes'],'include':_0x149cf7[_0x6112('0x1c')]?_[_0x6112('0x1e')](_0x149cf7[_0x6112('0x1c')],function(_0x1ecac9){return{'model':db[_0x1ecac9[_0x6112('0x1d')]],'as':_0x1ecac9['as'],'attributes':_0x1ecac9[_0x6112('0x1a')],'include':_0x1ecac9[_0x6112('0x1c')]?_[_0x6112('0x1e')](_0x1ecac9['include'],function(_0x3a5831){return{'model':db[_0x3a5831[_0x6112('0x1d')]],'as':_0x3a5831['as'],'attributes':_0x3a5831['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45f3fc){logger[_0x6112('0xf')](_0x6112('0x16'),_0x47f3bb);logger['debug'](_0x6112('0x16'),_0x47f3bb,JSON[_0x6112('0x1f')](_0x45f3fc));_0x198b23(_0x45f3fc);})[_0x6112('0x20')](function(_0x145185){logger[_0x6112('0x11')](_0x6112('0x16'),_0x145185[_0x6112('0x14')],_0x47f3bb);_0x4a52bc(_0xf7a797['error'](0x1f4,_0x145185[_0x6112('0x14')]));});});};exports[_0x6112('0x21')]=function(_0x48d558){var _0x3ba991=this;return new Promise(function(_0x532b0f,_0x2eb6f0){return db[_0x6112('0x22')]['find']({'raw':_0x48d558[_0x6112('0x17')]?_0x48d558[_0x6112('0x17')][_0x6112('0x18')]===undefined?!![]:![]:!![],'where':_0x48d558[_0x6112('0x17')]?_0x48d558[_0x6112('0x17')][_0x6112('0x19')]||null:null,'attributes':_0x48d558[_0x6112('0x17')]?_0x48d558[_0x6112('0x17')][_0x6112('0x1a')]||null:null,'include':_0x48d558[_0x6112('0x17')]?_0x48d558[_0x6112('0x17')]['include']?_['map'](_0x48d558['options']['include'],function(_0x1a7b8a){return{'model':db[_0x1a7b8a[_0x6112('0x1d')]],'as':_0x1a7b8a['as'],'attributes':_0x1a7b8a[_0x6112('0x1a')],'include':_0x1a7b8a['include']?_[_0x6112('0x1e')](_0x1a7b8a[_0x6112('0x1c')],function(_0x41e2dc){return{'model':db[_0x41e2dc[_0x6112('0x1d')]],'as':_0x41e2dc['as'],'attributes':_0x41e2dc[_0x6112('0x1a')],'include':_0x41e2dc['include']?_[_0x6112('0x1e')](_0x41e2dc[_0x6112('0x1c')],function(_0x5193ea){return{'model':db[_0x5193ea[_0x6112('0x1d')]],'as':_0x5193ea['as'],'attributes':_0x5193ea[_0x6112('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46d886){logger[_0x6112('0xf')]('ShowZohoAccount',_0x48d558);logger['debug'](_0x6112('0x21'),_0x48d558,JSON['stringify'](_0x46d886));_0x532b0f(_0x46d886);})['catch'](function(_0x251a3d){logger[_0x6112('0x11')](_0x6112('0x21'),_0x251a3d[_0x6112('0x14')],_0x48d558);_0x2eb6f0(_0x3ba991[_0x6112('0x11')](0x1f4,_0x251a3d[_0x6112('0x14')]));});});}; \ No newline at end of file +var _0x04d0=['error','code','message','info','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowZohoAccount','find','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x04d0,0x1ab));var _0x004d=function(_0x19de6e,_0x493f05){_0x19de6e=_0x19de6e-0x0;var _0x35c076=_0x04d0[_0x19de6e];return _0x35c076;};'use strict';var _=require('lodash');var util=require(_0x004d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x004d('0x1'));var db=require(_0x004d('0x2'))['db'];var utils=require(_0x004d('0x3'));var logger=require(_0x004d('0x4'))('rpc');var config=require(_0x004d('0x5'));var jayson=require(_0x004d('0x6'));var client=jayson[_0x004d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a130d,_0x291058,_0x32364c){return new BPromise(function(_0x273fdc,_0x73249c){return client[_0x004d('0x8')](_0x1a130d,_0x32364c)[_0x004d('0x9')](function(_0x4ecd1b){logger['info'](_0x004d('0xa'),_0x291058,_0x004d('0xb'));logger[_0x004d('0xc')](_0x004d('0xd'),_0x291058,_0x004d('0xb'),JSON[_0x004d('0xe')](_0x4ecd1b));if(_0x4ecd1b[_0x004d('0xf')]){if(_0x4ecd1b[_0x004d('0xf')][_0x004d('0x10')]===0x1f4){logger[_0x004d('0xf')](_0x004d('0xa'),_0x291058,_0x4ecd1b[_0x004d('0xf')]['message']);return _0x73249c(_0x4ecd1b['error'][_0x004d('0x11')]);}logger[_0x004d('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x291058,_0x4ecd1b['error'][_0x004d('0x11')]);return _0x273fdc(_0x4ecd1b['error']['message']);}else{logger[_0x004d('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x291058,_0x004d('0xb'));_0x273fdc(_0x4ecd1b[_0x004d('0x13')][_0x004d('0x11')]);}})['catch'](function(_0x3ccb6d){logger[_0x004d('0xf')](_0x004d('0xa'),_0x291058,_0x3ccb6d);_0x73249c(_0x3ccb6d);});});}exports[_0x004d('0x14')]=function(_0xacfb98){var _0x55220c=this;return new Promise(function(_0x125baa,_0x1863c8){return db[_0x004d('0x15')][_0x004d('0x16')]({'raw':_0xacfb98['options']?_0xacfb98[_0x004d('0x17')][_0x004d('0x18')]===undefined?!![]:![]:!![],'where':_0xacfb98[_0x004d('0x17')]?_0xacfb98['options'][_0x004d('0x19')]||null:null,'attributes':_0xacfb98['options']?_0xacfb98[_0x004d('0x17')][_0x004d('0x1a')]||null:null,'limit':_0xacfb98['options']?_0xacfb98[_0x004d('0x17')][_0x004d('0x1b')]||null:null,'include':_0xacfb98['options']?_0xacfb98[_0x004d('0x17')]['include']?_[_0x004d('0x1c')](_0xacfb98[_0x004d('0x17')][_0x004d('0x1d')],function(_0x3501a6){return{'model':db[_0x3501a6[_0x004d('0x1e')]],'as':_0x3501a6['as'],'attributes':_0x3501a6['attributes'],'include':_0x3501a6[_0x004d('0x1d')]?_['map'](_0x3501a6[_0x004d('0x1d')],function(_0x40032d){return{'model':db[_0x40032d[_0x004d('0x1e')]],'as':_0x40032d['as'],'attributes':_0x40032d[_0x004d('0x1a')],'include':_0x40032d[_0x004d('0x1d')]?_[_0x004d('0x1c')](_0x40032d[_0x004d('0x1d')],function(_0x508482){return{'model':db[_0x508482['model']],'as':_0x508482['as'],'attributes':_0x508482[_0x004d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x004d('0x9')](function(_0x49fd21){logger[_0x004d('0x12')](_0x004d('0x14'),_0xacfb98);logger[_0x004d('0xc')](_0x004d('0x14'),_0xacfb98,JSON['stringify'](_0x49fd21));_0x125baa(_0x49fd21);})['catch'](function(_0x1070c1){logger[_0x004d('0xf')](_0x004d('0x14'),_0x1070c1[_0x004d('0x11')],_0xacfb98);_0x1863c8(_0x55220c['error'](0x1f4,_0x1070c1['message']));});});};exports[_0x004d('0x1f')]=function(_0x5e5c4f){var _0x23e230=this;return new Promise(function(_0x557e43,_0x58fddd){return db[_0x004d('0x15')][_0x004d('0x20')]({'raw':_0x5e5c4f[_0x004d('0x17')]?_0x5e5c4f[_0x004d('0x17')][_0x004d('0x18')]===undefined?!![]:![]:!![],'where':_0x5e5c4f[_0x004d('0x17')]?_0x5e5c4f[_0x004d('0x17')][_0x004d('0x19')]||null:null,'attributes':_0x5e5c4f[_0x004d('0x17')]?_0x5e5c4f[_0x004d('0x17')][_0x004d('0x1a')]||null:null,'include':_0x5e5c4f[_0x004d('0x17')]?_0x5e5c4f[_0x004d('0x17')][_0x004d('0x1d')]?_[_0x004d('0x1c')](_0x5e5c4f[_0x004d('0x17')][_0x004d('0x1d')],function(_0x3eba3f){return{'model':db[_0x3eba3f[_0x004d('0x1e')]],'as':_0x3eba3f['as'],'attributes':_0x3eba3f[_0x004d('0x1a')],'include':_0x3eba3f['include']?_[_0x004d('0x1c')](_0x3eba3f[_0x004d('0x1d')],function(_0x2c53c4){return{'model':db[_0x2c53c4[_0x004d('0x1e')]],'as':_0x2c53c4['as'],'attributes':_0x2c53c4[_0x004d('0x1a')],'include':_0x2c53c4[_0x004d('0x1d')]?_[_0x004d('0x1c')](_0x2c53c4[_0x004d('0x1d')],function(_0x928d39){return{'model':db[_0x928d39[_0x004d('0x1e')]],'as':_0x928d39['as'],'attributes':_0x928d39[_0x004d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x004d('0x9')](function(_0x3f2cbe){logger[_0x004d('0x12')](_0x004d('0x1f'),_0x5e5c4f);logger[_0x004d('0xc')]('ShowZohoAccount',_0x5e5c4f,JSON[_0x004d('0xe')](_0x3f2cbe));_0x557e43(_0x3f2cbe);})[_0x004d('0x21')](function(_0x2fc92b){logger[_0x004d('0xf')]('ShowZohoAccount',_0x2fc92b['message'],_0x5e5c4f);_0x58fddd(_0x23e230['error'](0x1f4,_0x2fc92b['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 129454d..981a296 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 _0x3a12=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x4b766f,_0x2a720){var _0x4519e8=function(_0x24b97b){while(--_0x24b97b){_0x4b766f['push'](_0x4b766f['shift']());}};_0x4519e8(++_0x2a720);}(_0x3a12,0x1ce));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x23a1('0x0'));var util=require(_0x23a1('0x1'));var path=require(_0x23a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x23a1('0x3'));var router=express[_0x23a1('0x4')]();var auth=require(_0x23a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x23a1('0x6'));var controller=require(_0x23a1('0x7'));router[_0x23a1('0x8')]('/',auth['isAuthenticated'](),controller[_0x23a1('0x9')]);router[_0x23a1('0x8')]('/:id',auth[_0x23a1('0xa')](),controller[_0x23a1('0xb')]);router[_0x23a1('0x8')](_0x23a1('0xc'),auth[_0x23a1('0xa')](),controller[_0x23a1('0xd')]);router[_0x23a1('0x8')](_0x23a1('0xe'),auth[_0x23a1('0xa')](),controller[_0x23a1('0xf')]);router['get'](_0x23a1('0x10'),auth[_0x23a1('0xa')](),controller['getDescriptions']);router[_0x23a1('0x11')]('/',auth['isAuthenticated'](),controller[_0x23a1('0x12')]);router[_0x23a1('0x13')](_0x23a1('0x14'),auth['isAuthenticated'](),controller[_0x23a1('0x15')]);router[_0x23a1('0x16')](_0x23a1('0x14'),auth[_0x23a1('0xa')](),controller[_0x23a1('0x17')]);module[_0x23a1('0x18')]=router; \ No newline at end of file +var _0xdecb=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x31c5e9,_0x30e373){var _0x517a8d=function(_0x7f9a48){while(--_0x7f9a48){_0x31c5e9['push'](_0x31c5e9['shift']());}};_0x517a8d(++_0x30e373);}(_0xdecb,0xe2));var _0xbdec=function(_0xa3d684,_0x4e1a51){_0xa3d684=_0xa3d684-0x0;var _0x1d1b27=_0xdecb[_0xa3d684];return _0x1d1b27;};'use strict';var multer=require('multer');var util=require(_0xbdec('0x0'));var path=require(_0xbdec('0x1'));var timeout=require(_0xbdec('0x2'));var express=require('express');var router=express[_0xbdec('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbdec('0x4'));var config=require(_0xbdec('0x5'));var controller=require(_0xbdec('0x6'));router[_0xbdec('0x7')]('/',auth[_0xbdec('0x8')](),controller[_0xbdec('0x9')]);router[_0xbdec('0x7')]('/:id',auth[_0xbdec('0x8')](),controller[_0xbdec('0xa')]);router[_0xbdec('0x7')](_0xbdec('0xb'),auth[_0xbdec('0x8')](),controller[_0xbdec('0xc')]);router[_0xbdec('0x7')](_0xbdec('0xd'),auth['isAuthenticated'](),controller[_0xbdec('0xe')]);router[_0xbdec('0x7')](_0xbdec('0xf'),auth[_0xbdec('0x8')](),controller['getDescriptions']);router[_0xbdec('0x10')]('/',auth[_0xbdec('0x8')](),controller[_0xbdec('0x11')]);router['put'](_0xbdec('0x12'),auth[_0xbdec('0x8')](),controller[_0xbdec('0x13')]);router[_0xbdec('0x14')](_0xbdec('0x12'),auth[_0xbdec('0x8')](),controller[_0xbdec('0x15')]);module[_0xbdec('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index fdb3597..af0143a 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 _0x7535=['sequelize','STRING'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7535,0x130));var _0x5753=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x7535[_0x237da8];return _0x558825;};'use strict';var Sequelize=require(_0x5753('0x0'));module['exports']={'name':{'type':Sequelize[_0x5753('0x1')]},'description':{'type':Sequelize[_0x5753('0x1')]}}; \ No newline at end of file +var _0xd630=['exports','sequelize'];(function(_0x31433c,_0xaa3fcc){var _0x59e1d4=function(_0x44b750){while(--_0x44b750){_0x31433c['push'](_0x31433c['shift']());}};_0x59e1d4(++_0xaa3fcc);}(_0xd630,0xfb));var _0x0d63=function(_0x1556d8,_0x155d7e){_0x1556d8=_0x1556d8-0x0;var _0x3fa3e5=_0xd630[_0x1556d8];return _0x3fa3e5;};'use strict';var Sequelize=require(_0x0d63('0x0'));module[_0x0d63('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 96e4178..8176f14 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 _0x7729=['result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','name','send','index','ZohoConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','rows','show','length','create','body','update','find','params','destroy','ZohoField','order','pick','getFields','getSubjects','findOne','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info'];(function(_0xfed299,_0x21b8d0){var _0x4ef1f2=function(_0x347a84){while(--_0x347a84){_0xfed299['push'](_0xfed299['shift']());}};_0x4ef1f2(++_0x21b8d0);}(_0x7729,0xed));var _0x9772=function(_0xd25b17,_0x18ca1f){_0xd25b17=_0xd25b17-0x0;var _0x572fc0=_0x7729[_0xd25b17];return _0x572fc0;};'use strict';var pdf=require(_0x9772('0x0'));var emlformat=require(_0x9772('0x1'));var rimraf=require(_0x9772('0x2'));var zipdir=require(_0x9772('0x3'));var jsonpatch=require(_0x9772('0x4'));var rp=require(_0x9772('0x5'));var moment=require(_0x9772('0x6'));var BPromise=require(_0x9772('0x7'));var Mustache=require(_0x9772('0x8'));var util=require('util');var path=require(_0x9772('0x9'));var sox=require(_0x9772('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9772('0xb'));var squel=require(_0x9772('0xc'));var crypto=require('crypto');var jsforce=require(_0x9772('0xd'));var deskjs=require(_0x9772('0xe'));var toCsv=require(_0x9772('0xf'));var querystring=require('querystring');var Papa=require(_0x9772('0x10'));var Redis=require(_0x9772('0x11'));var authService=require(_0x9772('0x12'));var qs=require(_0x9772('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9772('0x14'));var config=require('../../config/environment');var db=require(_0x9772('0x15'))['db'];var jayson=require(_0x9772('0x16'));var client=jayson[_0x9772('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x4ab7e7,_0x5e951a,_0x148ad1){if(_0x148ad1){var _0x4f1923=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f1923[_0x9772('0x18')](_0x5e951a)){return _0x4ab7e7;}else{throw new Error(_0x9772('0x19'));}}else{return _0x4ab7e7;}}function respondWithRpcPromise(_0x5069ad,_0x3244a8,_0x565237,_0x52dade){return new BPromise(function(_0x1dd305,_0x2c8669){var _0x99acda=_0x52dade||client;return _0x99acda[_0x9772('0x1a')](_0x5069ad,_0x565237)[_0x9772('0x1b')](function(_0x52be5f){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3244a8,_0x9772('0x1c'));logger['debug'](_0x9772('0x1d'),_0x3244a8,'request\x20sent',JSON[_0x9772('0x1e')](_0x52be5f));if(_0x52be5f[_0x9772('0x1f')]){if(_0x52be5f[_0x9772('0x1f')][_0x9772('0x20')]===0x1f4){logger[_0x9772('0x1f')](_0x9772('0x21'),_0x3244a8,_0x52be5f[_0x9772('0x1f')][_0x9772('0x22')]);return _0x2c8669(_0x52be5f['error'][_0x9772('0x22')]);}logger['error'](_0x9772('0x21'),_0x3244a8,_0x52be5f['error'][_0x9772('0x22')]);return _0x1dd305(_0x52be5f['error'][_0x9772('0x22')]);}else{logger[_0x9772('0x23')](_0x9772('0x21'),_0x3244a8,_0x9772('0x1c'));_0x1dd305(_0x52be5f[_0x9772('0x24')][_0x9772('0x22')]);}})[_0x9772('0x25')](function(_0x47f964){logger[_0x9772('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x3244a8,_0x47f964);_0x2c8669(_0x47f964);});});}function respondWithStatusCode(_0x6019af,_0x5a2134){_0x5a2134=_0x5a2134||0xcc;return function(_0xb7d598){if(_0xb7d598){return _0x6019af[_0x9772('0x26')](_0x5a2134);}return _0x6019af[_0x9772('0x27')](_0x5a2134)[_0x9772('0x28')]();};}function respondWithResult(_0x5ac262,_0x46ec00){_0x46ec00=_0x46ec00||0xc8;return function(_0x373f48){if(_0x373f48){return _0x5ac262[_0x9772('0x27')](_0x46ec00)[_0x9772('0x29')](_0x373f48);}};}function respondWithFilteredResult(_0x4a3dda,_0x48347a){return function(_0x52b6a3){if(_0x52b6a3){var _0x45042f=_0x52b6a3[_0x9772('0x2a')],_0x25a395=_0x48347a[_0x9772('0x2b')],_0x3c5c7b=_0x48347a['offset']+_0x48347a['limit'],_0xea0ea6;if(_0x3c5c7b>=_0x45042f){_0x3c5c7b=_0x45042f;_0xea0ea6=0xc8;}else{_0xea0ea6=0xce;}_0x4a3dda['status'](_0xea0ea6);return _0x4a3dda[_0x9772('0x2c')]('Content-Range',_0x25a395+'-'+_0x3c5c7b+'/'+_0x45042f)['json'](_0x52b6a3);}return null;};}function patchUpdates(_0x35a671){return function(_0x42d578){try{jsonpatch[_0x9772('0x2d')](_0x42d578,_0x35a671,!![]);}catch(_0x35e0fc){return BPromise[_0x9772('0x2e')](_0x35e0fc);}return _0x42d578[_0x9772('0x2f')]();};}function saveUpdates(_0x1adaa4,_0x23c0c3){return function(_0x5aaeba){if(_0x5aaeba){return _0x5aaeba['update'](_0x1adaa4)[_0x9772('0x1b')](function(_0x5fc23d){return _0x5fc23d;});}return null;};}function removeEntity(_0xee71cb,_0x4b808c){return function(_0xd24aef){if(_0xd24aef){return _0xd24aef['destroy']()['then'](function(){_0xee71cb[_0x9772('0x27')](0xcc)[_0x9772('0x28')]();});}};}function handleEntityNotFound(_0xfeb748,_0x5cce43){return function(_0xa66250){if(!_0xa66250){_0xfeb748[_0x9772('0x26')](0x194);}return _0xa66250;};}function handleError(_0x2184fc,_0x5402ba){_0x5402ba=_0x5402ba||0x1f4;return function(_0x2b9d43){logger['error'](_0x2b9d43['stack']);if(_0x2b9d43[_0x9772('0x30')]){delete _0x2b9d43[_0x9772('0x30')];}_0x2184fc[_0x9772('0x27')](_0x5402ba)[_0x9772('0x31')](_0x2b9d43);};}exports[_0x9772('0x32')]=function(_0x3a6896,_0x3aaecf){var _0x4b49e9={},_0x8a67cd={},_0x14fc5d={'count':0x0,'rows':[]};var _0x1e517f=db[_0x9772('0x33')][_0x9772('0x34')];_0x8a67cd[_0x9772('0x35')]=_[_0x9772('0x36')](_0x1e517f);_0x8a67cd[_0x9772('0x37')]=_[_0x9772('0x36')](_0x3a6896[_0x9772('0x37')]);_0x8a67cd[_0x9772('0x38')]=_[_0x9772('0x39')](_0x8a67cd[_0x9772('0x35')],_0x8a67cd[_0x9772('0x37')]);_0x4b49e9[_0x9772('0x3a')]=_['intersection'](_0x8a67cd[_0x9772('0x35')],qs[_0x9772('0x3b')](_0x3a6896[_0x9772('0x37')]['fields']));_0x4b49e9['attributes']=_0x4b49e9['attributes']['length']?_0x4b49e9[_0x9772('0x3a')]:_0x8a67cd['model'];if(!_0x3a6896['query'][_0x9772('0x3c')](_0x9772('0x3d'))){_0x4b49e9['limit']=qs['limit'](_0x3a6896[_0x9772('0x37')][_0x9772('0x3e')]);_0x4b49e9[_0x9772('0x2b')]=qs[_0x9772('0x2b')](_0x3a6896[_0x9772('0x37')][_0x9772('0x2b')]);}_0x4b49e9['order']=qs[_0x9772('0x3f')](_0x3a6896[_0x9772('0x37')][_0x9772('0x3f')]);_0x4b49e9[_0x9772('0x40')]=qs['filters'](_['pick'](_0x3a6896[_0x9772('0x37')],_0x8a67cd[_0x9772('0x38')]));if(_0x3a6896[_0x9772('0x37')]['filter']){_0x4b49e9[_0x9772('0x40')]=_['merge'](_0x4b49e9[_0x9772('0x40')],{'$or':_[_0x9772('0x41')](_0x1e517f,function(_0x15120f){if(_0x15120f[_0x9772('0x42')][_0x9772('0x43')]!==_0x9772('0x44')){var _0x11193f={};_0x11193f[_0x15120f[_0x9772('0x45')]]={'$like':'%'+_0x3a6896[_0x9772('0x37')][_0x9772('0x46')]+'%'};return _0x11193f;}})});}_0x4b49e9=_[_0x9772('0x47')]({},_0x4b49e9,_0x3a6896[_0x9772('0x48')]);var _0x514d95={'where':_0x4b49e9[_0x9772('0x40')]};return db[_0x9772('0x33')][_0x9772('0x2a')](_0x514d95)['then'](function(_0x2e935a){_0x14fc5d[_0x9772('0x2a')]=_0x2e935a;if(_0x3a6896[_0x9772('0x37')][_0x9772('0x49')]){_0x4b49e9[_0x9772('0x4a')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x4b49e9);})[_0x9772('0x1b')](function(_0x2c7017){_0x14fc5d[_0x9772('0x4b')]=_0x2c7017;return _0x14fc5d;})[_0x9772('0x1b')](respondWithFilteredResult(_0x3aaecf,_0x4b49e9))['catch'](handleError(_0x3aaecf,null));};exports[_0x9772('0x4c')]=function(_0x58d432,_0x2c1be1){var _0x15c213={'raw':![],'where':{'id':_0x58d432['params']['id']}},_0x1c5550={};_0x1c5550[_0x9772('0x35')]=_[_0x9772('0x36')](db[_0x9772('0x33')]['rawAttributes']);_0x1c5550[_0x9772('0x37')]=_['keys'](_0x58d432[_0x9772('0x37')]);_0x1c5550[_0x9772('0x38')]=_[_0x9772('0x39')](_0x1c5550['model'],_0x1c5550['query']);_0x15c213[_0x9772('0x3a')]=_['intersection'](_0x1c5550['model'],qs[_0x9772('0x3b')](_0x58d432[_0x9772('0x37')][_0x9772('0x3b')]));_0x15c213[_0x9772('0x3a')]=_0x15c213['attributes'][_0x9772('0x4d')]?_0x15c213['attributes']:_0x1c5550['model'];if(_0x58d432[_0x9772('0x37')]['includeAll']){_0x15c213['include']=[{'all':!![]}];}_0x15c213=_['merge']({},_0x15c213,_0x58d432['options']);return db[_0x9772('0x33')]['find'](_0x15c213)[_0x9772('0x1b')](handleEntityNotFound(_0x2c1be1,null))[_0x9772('0x1b')](respondWithResult(_0x2c1be1,null))['catch'](handleError(_0x2c1be1,null));};exports[_0x9772('0x4e')]=function(_0x46f28d,_0x1859e6){return db[_0x9772('0x33')][_0x9772('0x4e')](_0x46f28d[_0x9772('0x4f')],{})[_0x9772('0x1b')](respondWithResult(_0x1859e6,0xc9))[_0x9772('0x25')](handleError(_0x1859e6,null));};exports[_0x9772('0x50')]=function(_0x4d7faa,_0x58541f){if(_0x4d7faa[_0x9772('0x4f')]['id']){delete _0x4d7faa[_0x9772('0x4f')]['id'];}return db[_0x9772('0x33')][_0x9772('0x51')]({'where':{'id':_0x4d7faa[_0x9772('0x52')]['id']}})[_0x9772('0x1b')](handleEntityNotFound(_0x58541f,null))['then'](saveUpdates(_0x4d7faa[_0x9772('0x4f')],null))[_0x9772('0x1b')](respondWithResult(_0x58541f,null))[_0x9772('0x25')](handleError(_0x58541f,null));};exports[_0x9772('0x53')]=function(_0x25b2ab,_0x4ab47d){return db['ZohoConfiguration']['find']({'where':{'id':_0x25b2ab[_0x9772('0x52')]['id']}})[_0x9772('0x1b')](handleEntityNotFound(_0x4ab47d,null))['then'](removeEntity(_0x4ab47d,null))[_0x9772('0x25')](handleError(_0x4ab47d,null));};exports['getFields']=function(_0x3efa70,_0x3cf623,_0x31c46f){var _0x49551d={};var _0x18520b={};var _0x15a38a;var _0x292880;return db[_0x9772('0x33')]['findOne']({'where':{'id':_0x3efa70[_0x9772('0x52')]['id']}})['then'](handleEntityNotFound(_0x3cf623,null))['then'](function(_0x455a5e){if(_0x455a5e){_0x15a38a=_0x455a5e;_0x18520b['model']=_[_0x9772('0x36')](db[_0x9772('0x54')][_0x9772('0x34')]);_0x18520b[_0x9772('0x37')]=_['keys'](_0x3efa70[_0x9772('0x37')]);_0x18520b[_0x9772('0x38')]=_[_0x9772('0x39')](_0x18520b['model'],_0x18520b[_0x9772('0x37')]);_0x49551d[_0x9772('0x3a')]=_[_0x9772('0x39')](_0x18520b[_0x9772('0x35')],qs[_0x9772('0x3b')](_0x3efa70[_0x9772('0x37')][_0x9772('0x3b')]));_0x49551d[_0x9772('0x3a')]=_0x49551d[_0x9772('0x3a')][_0x9772('0x4d')]?_0x49551d[_0x9772('0x3a')]:_0x18520b['model'];_0x49551d[_0x9772('0x55')]=qs[_0x9772('0x3f')](_0x3efa70['query'][_0x9772('0x3f')]);_0x49551d[_0x9772('0x40')]=qs['filters'](_[_0x9772('0x56')](_0x3efa70[_0x9772('0x37')],_0x18520b[_0x9772('0x38')]));if(_0x3efa70['query']['filter']){_0x49551d['where']=_[_0x9772('0x47')](_0x49551d[_0x9772('0x40')],{'$or':_[_0x9772('0x41')](_0x49551d[_0x9772('0x3a')],function(_0x3c328f){var _0x5b982f={};_0x5b982f[_0x3c328f]={'$like':'%'+_0x3efa70[_0x9772('0x37')][_0x9772('0x46')]+'%'};return _0x5b982f;})});}_0x49551d=_[_0x9772('0x47')]({},_0x49551d,_0x3efa70[_0x9772('0x48')]);return _0x15a38a[_0x9772('0x57')](_0x49551d);}})[_0x9772('0x1b')](function(_0x1430e3){if(_0x1430e3){_0x292880=_0x1430e3[_0x9772('0x4d')];if(!_0x3efa70[_0x9772('0x37')][_0x9772('0x3c')]('nolimit')){_0x49551d[_0x9772('0x3e')]=qs[_0x9772('0x3e')](_0x3efa70[_0x9772('0x37')]['limit']);_0x49551d[_0x9772('0x2b')]=qs[_0x9772('0x2b')](_0x3efa70[_0x9772('0x37')][_0x9772('0x2b')]);}return _0x15a38a[_0x9772('0x57')](_0x49551d);}})['then'](function(_0x213d0f){if(_0x213d0f){return _0x213d0f?{'count':_0x292880,'rows':_0x213d0f}:null;}})['then'](respondWithResult(_0x3cf623,null))[_0x9772('0x25')](handleError(_0x3cf623,null));};exports[_0x9772('0x58')]=function(_0x5352a7,_0x508c71,_0x131bd3){var _0x5507c5={};var _0xa86a6={};var _0x2bfc33;var _0x3d7779;return db[_0x9772('0x33')][_0x9772('0x59')]({'where':{'id':_0x5352a7[_0x9772('0x52')]['id']}})['then'](handleEntityNotFound(_0x508c71,null))[_0x9772('0x1b')](function(_0x3fd8f1){if(_0x3fd8f1){_0x2bfc33=_0x3fd8f1;_0xa86a6[_0x9772('0x35')]=_['keys'](db['ZohoField'][_0x9772('0x34')]);_0xa86a6[_0x9772('0x37')]=_[_0x9772('0x36')](_0x5352a7[_0x9772('0x37')]);_0xa86a6[_0x9772('0x38')]=_[_0x9772('0x39')](_0xa86a6[_0x9772('0x35')],_0xa86a6[_0x9772('0x37')]);_0x5507c5[_0x9772('0x3a')]=_[_0x9772('0x39')](_0xa86a6['model'],qs[_0x9772('0x3b')](_0x5352a7['query'][_0x9772('0x3b')]));_0x5507c5[_0x9772('0x3a')]=_0x5507c5[_0x9772('0x3a')][_0x9772('0x4d')]?_0x5507c5['attributes']:_0xa86a6[_0x9772('0x35')];_0x5507c5['order']=qs[_0x9772('0x3f')](_0x5352a7[_0x9772('0x37')][_0x9772('0x3f')]);_0x5507c5[_0x9772('0x40')]=qs[_0x9772('0x38')](_[_0x9772('0x56')](_0x5352a7['query'],_0xa86a6['filters']));if(_0x5352a7[_0x9772('0x37')][_0x9772('0x46')]){_0x5507c5[_0x9772('0x40')]=_[_0x9772('0x47')](_0x5507c5[_0x9772('0x40')],{'$or':_[_0x9772('0x41')](_0x5507c5[_0x9772('0x3a')],function(_0x207697){var _0x426089={};_0x426089[_0x207697]={'$like':'%'+_0x5352a7[_0x9772('0x37')][_0x9772('0x46')]+'%'};return _0x426089;})});}_0x5507c5=_[_0x9772('0x47')]({},_0x5507c5,_0x5352a7[_0x9772('0x48')]);return _0x2bfc33[_0x9772('0x58')](_0x5507c5);}})[_0x9772('0x1b')](function(_0x3eeb6a){if(_0x3eeb6a){_0x3d7779=_0x3eeb6a[_0x9772('0x4d')];if(!_0x5352a7[_0x9772('0x37')][_0x9772('0x3c')](_0x9772('0x3d'))){_0x5507c5[_0x9772('0x3e')]=qs[_0x9772('0x3e')](_0x5352a7[_0x9772('0x37')]['limit']);_0x5507c5[_0x9772('0x2b')]=qs[_0x9772('0x2b')](_0x5352a7[_0x9772('0x37')][_0x9772('0x2b')]);}return _0x2bfc33[_0x9772('0x58')](_0x5507c5);}})[_0x9772('0x1b')](function(_0x4a4d3c){if(_0x4a4d3c){return _0x4a4d3c?{'count':_0x3d7779,'rows':_0x4a4d3c}:null;}})[_0x9772('0x1b')](respondWithResult(_0x508c71,null))[_0x9772('0x25')](handleError(_0x508c71,null));};exports[_0x9772('0x5a')]=function(_0x2177fe,_0x53a6f5,_0x3844a4){var _0xaeb109={};var _0x29d623={};var _0x5acd63;var _0x19ef05;return db[_0x9772('0x33')][_0x9772('0x59')]({'where':{'id':_0x2177fe[_0x9772('0x52')]['id']}})[_0x9772('0x1b')](handleEntityNotFound(_0x53a6f5,null))[_0x9772('0x1b')](function(_0x5d2478){if(_0x5d2478){_0x5acd63=_0x5d2478;_0x29d623[_0x9772('0x35')]=_['keys'](db[_0x9772('0x54')]['rawAttributes']);_0x29d623[_0x9772('0x37')]=_[_0x9772('0x36')](_0x2177fe['query']);_0x29d623[_0x9772('0x38')]=_['intersection'](_0x29d623[_0x9772('0x35')],_0x29d623[_0x9772('0x37')]);_0xaeb109[_0x9772('0x3a')]=_['intersection'](_0x29d623[_0x9772('0x35')],qs[_0x9772('0x3b')](_0x2177fe[_0x9772('0x37')][_0x9772('0x3b')]));_0xaeb109[_0x9772('0x3a')]=_0xaeb109[_0x9772('0x3a')][_0x9772('0x4d')]?_0xaeb109['attributes']:_0x29d623[_0x9772('0x35')];_0xaeb109[_0x9772('0x55')]=qs[_0x9772('0x3f')](_0x2177fe[_0x9772('0x37')][_0x9772('0x3f')]);_0xaeb109['where']=qs[_0x9772('0x38')](_[_0x9772('0x56')](_0x2177fe['query'],_0x29d623['filters']));if(_0x2177fe[_0x9772('0x37')]['filter']){_0xaeb109[_0x9772('0x40')]=_[_0x9772('0x47')](_0xaeb109[_0x9772('0x40')],{'$or':_['map'](_0xaeb109['attributes'],function(_0x592525){var _0x66f81d={};_0x66f81d[_0x592525]={'$like':'%'+_0x2177fe['query'][_0x9772('0x46')]+'%'};return _0x66f81d;})});}_0xaeb109=_[_0x9772('0x47')]({},_0xaeb109,_0x2177fe[_0x9772('0x48')]);return _0x5acd63[_0x9772('0x5a')](_0xaeb109);}})[_0x9772('0x1b')](function(_0x2f06ed){if(_0x2f06ed){_0x19ef05=_0x2f06ed[_0x9772('0x4d')];if(!_0x2177fe['query'][_0x9772('0x3c')](_0x9772('0x3d'))){_0xaeb109['limit']=qs[_0x9772('0x3e')](_0x2177fe[_0x9772('0x37')][_0x9772('0x3e')]);_0xaeb109[_0x9772('0x2b')]=qs[_0x9772('0x2b')](_0x2177fe[_0x9772('0x37')][_0x9772('0x2b')]);}return _0x5acd63[_0x9772('0x5a')](_0xaeb109);}})['then'](function(_0x39ee12){if(_0x39ee12){return _0x39ee12?{'count':_0x19ef05,'rows':_0x39ee12}:null;}})['then'](respondWithResult(_0x53a6f5,null))[_0x9772('0x25')](handleError(_0x53a6f5,null));}; \ No newline at end of file +var _0x55d4=['count','includeAll','findAll','rows','show','params','find','create','body','getFields','ZohoField','length','order','getSubjects','findOne','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','test','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','ZohoConfiguration','rawAttributes','model','keys','query','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x55d4,0xc9));var _0x455d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x55d4[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require(_0x455d('0x0'));var emlformat=require(_0x455d('0x1'));var rimraf=require(_0x455d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x455d('0x3'));var moment=require(_0x455d('0x4'));var BPromise=require(_0x455d('0x5'));var Mustache=require(_0x455d('0x6'));var util=require(_0x455d('0x7'));var path=require(_0x455d('0x8'));var sox=require('sox');var csv=require(_0x455d('0x9'));var ejs=require(_0x455d('0xa'));var fs=require('fs');var _=require(_0x455d('0xb'));var squel=require('squel');var crypto=require(_0x455d('0xc'));var jsforce=require(_0x455d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x455d('0x9'));var querystring=require(_0x455d('0xe'));var Papa=require(_0x455d('0xf'));var Redis=require(_0x455d('0x10'));var authService=require(_0x455d('0x11'));var qs=require(_0x455d('0x12'));var hardwareService=require(_0x455d('0x13'));var logger=require(_0x455d('0x14'))(_0x455d('0x15'));var utils=require('../../config/utils');var config=require(_0x455d('0x16'));var db=require(_0x455d('0x17'))['db'];var jayson=require(_0x455d('0x18'));var client=jayson['client'][_0x455d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2c390c,_0x39a243,_0x2a0c3b){if(_0x2a0c3b){var _0x31dd70=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31dd70[_0x455d('0x1a')](_0x39a243)){return _0x2c390c;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2c390c;}}function respondWithRpcPromise(_0x194537,_0x51169f,_0x22c312,_0x2d65f2){return new BPromise(function(_0x1e496c,_0x7cd7c8){var _0x1311f0=_0x2d65f2||client;return _0x1311f0[_0x455d('0x1b')](_0x194537,_0x22c312)[_0x455d('0x1c')](function(_0x161271){logger[_0x455d('0x1d')]('ZohoConfiguration,\x20%s,\x20%s',_0x51169f,'request\x20sent');logger[_0x455d('0x1e')](_0x455d('0x1f'),_0x51169f,_0x455d('0x20'),JSON[_0x455d('0x21')](_0x161271));if(_0x161271['error']){if(_0x161271[_0x455d('0x22')][_0x455d('0x23')]===0x1f4){logger['error'](_0x455d('0x24'),_0x51169f,_0x161271[_0x455d('0x22')][_0x455d('0x25')]);return _0x7cd7c8(_0x161271[_0x455d('0x22')][_0x455d('0x25')]);}logger[_0x455d('0x22')](_0x455d('0x24'),_0x51169f,_0x161271[_0x455d('0x22')]['message']);return _0x1e496c(_0x161271[_0x455d('0x22')][_0x455d('0x25')]);}else{logger[_0x455d('0x1d')](_0x455d('0x24'),_0x51169f,'request\x20sent');_0x1e496c(_0x161271[_0x455d('0x26')][_0x455d('0x25')]);}})[_0x455d('0x27')](function(_0x177d24){logger[_0x455d('0x22')](_0x455d('0x24'),_0x51169f,_0x177d24);_0x7cd7c8(_0x177d24);});});}function respondWithStatusCode(_0x501a51,_0xd8518b){_0xd8518b=_0xd8518b||0xcc;return function(_0x106a9c){if(_0x106a9c){return _0x501a51[_0x455d('0x28')](_0xd8518b);}return _0x501a51[_0x455d('0x29')](_0xd8518b)[_0x455d('0x2a')]();};}function respondWithResult(_0x3b4628,_0x346d0d){_0x346d0d=_0x346d0d||0xc8;return function(_0x1a85f5){if(_0x1a85f5){return _0x3b4628['status'](_0x346d0d)[_0x455d('0x2b')](_0x1a85f5);}};}function respondWithFilteredResult(_0x5db80d,_0x3b650e){return function(_0x3c4891){if(_0x3c4891){var _0x260e94=_0x3c4891['count'],_0x112e34=_0x3b650e[_0x455d('0x2c')],_0x44ed96=_0x3b650e[_0x455d('0x2c')]+_0x3b650e[_0x455d('0x2d')],_0x326a46;if(_0x44ed96>=_0x260e94){_0x44ed96=_0x260e94;_0x326a46=0xc8;}else{_0x326a46=0xce;}_0x5db80d[_0x455d('0x29')](_0x326a46);return _0x5db80d[_0x455d('0x2e')](_0x455d('0x2f'),_0x112e34+'-'+_0x44ed96+'/'+_0x260e94)['json'](_0x3c4891);}return null;};}function patchUpdates(_0x5c750a){return function(_0x531eab){try{jsonpatch[_0x455d('0x30')](_0x531eab,_0x5c750a,!![]);}catch(_0x4723f7){return BPromise[_0x455d('0x31')](_0x4723f7);}return _0x531eab[_0x455d('0x32')]();};}function saveUpdates(_0xb2c611,_0x2032e4){return function(_0x10c7e6){if(_0x10c7e6){return _0x10c7e6[_0x455d('0x33')](_0xb2c611)[_0x455d('0x1c')](function(_0x461d4a){return _0x461d4a;});}return null;};}function removeEntity(_0x31aacd,_0x381ca2){return function(_0x21c408){if(_0x21c408){return _0x21c408[_0x455d('0x34')]()[_0x455d('0x1c')](function(){_0x31aacd[_0x455d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x204038,_0x3bfc11){return function(_0x1778c7){if(!_0x1778c7){_0x204038[_0x455d('0x28')](0x194);}return _0x1778c7;};}function handleError(_0x1e42e3,_0x46e1f3){_0x46e1f3=_0x46e1f3||0x1f4;return function(_0x5a07ff){logger[_0x455d('0x22')](_0x5a07ff['stack']);if(_0x5a07ff[_0x455d('0x35')]){delete _0x5a07ff[_0x455d('0x35')];}_0x1e42e3['status'](_0x46e1f3)[_0x455d('0x36')](_0x5a07ff);};}exports[_0x455d('0x37')]=function(_0xdf4889,_0x536392){var _0x21b41b={},_0x27c1c9={},_0x3ea956={'count':0x0,'rows':[]};var _0x2b3774=db[_0x455d('0x38')][_0x455d('0x39')];_0x27c1c9[_0x455d('0x3a')]=_[_0x455d('0x3b')](_0x2b3774);_0x27c1c9[_0x455d('0x3c')]=_['keys'](_0xdf4889[_0x455d('0x3c')]);_0x27c1c9['filters']=_['intersection'](_0x27c1c9[_0x455d('0x3a')],_0x27c1c9[_0x455d('0x3c')]);_0x21b41b[_0x455d('0x3d')]=_[_0x455d('0x3e')](_0x27c1c9[_0x455d('0x3a')],qs[_0x455d('0x3f')](_0xdf4889[_0x455d('0x3c')][_0x455d('0x3f')]));_0x21b41b[_0x455d('0x3d')]=_0x21b41b[_0x455d('0x3d')]['length']?_0x21b41b['attributes']:_0x27c1c9[_0x455d('0x3a')];if(!_0xdf4889[_0x455d('0x3c')]['hasOwnProperty'](_0x455d('0x40'))){_0x21b41b[_0x455d('0x2d')]=qs[_0x455d('0x2d')](_0xdf4889[_0x455d('0x3c')][_0x455d('0x2d')]);_0x21b41b['offset']=qs['offset'](_0xdf4889[_0x455d('0x3c')][_0x455d('0x2c')]);}_0x21b41b['order']=qs[_0x455d('0x41')](_0xdf4889['query'][_0x455d('0x41')]);_0x21b41b[_0x455d('0x42')]=qs[_0x455d('0x43')](_[_0x455d('0x44')](_0xdf4889['query'],_0x27c1c9[_0x455d('0x43')]));if(_0xdf4889[_0x455d('0x3c')][_0x455d('0x45')]){_0x21b41b[_0x455d('0x42')]=_[_0x455d('0x46')](_0x21b41b['where'],{'$or':_[_0x455d('0x47')](_0x2b3774,function(_0xc64978){if(_0xc64978[_0x455d('0x48')]['key']!==_0x455d('0x49')){var _0x16cb55={};_0x16cb55[_0xc64978['field']]={'$like':'%'+_0xdf4889[_0x455d('0x3c')][_0x455d('0x45')]+'%'};return _0x16cb55;}})});}_0x21b41b=_[_0x455d('0x46')]({},_0x21b41b,_0xdf4889[_0x455d('0x4a')]);var _0x18d8e1={'where':_0x21b41b[_0x455d('0x42')]};return db[_0x455d('0x38')][_0x455d('0x4b')](_0x18d8e1)[_0x455d('0x1c')](function(_0x1c7578){_0x3ea956[_0x455d('0x4b')]=_0x1c7578;if(_0xdf4889[_0x455d('0x3c')][_0x455d('0x4c')]){_0x21b41b['include']=[{'all':!![]}];}return db[_0x455d('0x38')][_0x455d('0x4d')](_0x21b41b);})[_0x455d('0x1c')](function(_0x3d41f1){_0x3ea956[_0x455d('0x4e')]=_0x3d41f1;return _0x3ea956;})[_0x455d('0x1c')](respondWithFilteredResult(_0x536392,_0x21b41b))[_0x455d('0x27')](handleError(_0x536392,null));};exports[_0x455d('0x4f')]=function(_0x2177ab,_0xd73f1d){var _0x38c33c={'raw':![],'where':{'id':_0x2177ab[_0x455d('0x50')]['id']}},_0x533906={};_0x533906['model']=_[_0x455d('0x3b')](db[_0x455d('0x38')][_0x455d('0x39')]);_0x533906['query']=_[_0x455d('0x3b')](_0x2177ab[_0x455d('0x3c')]);_0x533906[_0x455d('0x43')]=_[_0x455d('0x3e')](_0x533906[_0x455d('0x3a')],_0x533906[_0x455d('0x3c')]);_0x38c33c[_0x455d('0x3d')]=_[_0x455d('0x3e')](_0x533906['model'],qs[_0x455d('0x3f')](_0x2177ab[_0x455d('0x3c')]['fields']));_0x38c33c[_0x455d('0x3d')]=_0x38c33c[_0x455d('0x3d')]['length']?_0x38c33c[_0x455d('0x3d')]:_0x533906[_0x455d('0x3a')];if(_0x2177ab[_0x455d('0x3c')]['includeAll']){_0x38c33c['include']=[{'all':!![]}];}_0x38c33c=_['merge']({},_0x38c33c,_0x2177ab[_0x455d('0x4a')]);return db[_0x455d('0x38')][_0x455d('0x51')](_0x38c33c)[_0x455d('0x1c')](handleEntityNotFound(_0xd73f1d,null))[_0x455d('0x1c')](respondWithResult(_0xd73f1d,null))[_0x455d('0x27')](handleError(_0xd73f1d,null));};exports[_0x455d('0x52')]=function(_0x5a1a6b,_0xb59dea){return db[_0x455d('0x38')]['create'](_0x5a1a6b[_0x455d('0x53')],{})[_0x455d('0x1c')](respondWithResult(_0xb59dea,0xc9))[_0x455d('0x27')](handleError(_0xb59dea,null));};exports[_0x455d('0x33')]=function(_0x340e9b,_0x41cbe4){if(_0x340e9b[_0x455d('0x53')]['id']){delete _0x340e9b[_0x455d('0x53')]['id'];}return db[_0x455d('0x38')][_0x455d('0x51')]({'where':{'id':_0x340e9b[_0x455d('0x50')]['id']}})[_0x455d('0x1c')](handleEntityNotFound(_0x41cbe4,null))[_0x455d('0x1c')](saveUpdates(_0x340e9b[_0x455d('0x53')],null))[_0x455d('0x1c')](respondWithResult(_0x41cbe4,null))[_0x455d('0x27')](handleError(_0x41cbe4,null));};exports[_0x455d('0x34')]=function(_0x2b2719,_0x19cb45){return db[_0x455d('0x38')][_0x455d('0x51')]({'where':{'id':_0x2b2719[_0x455d('0x50')]['id']}})[_0x455d('0x1c')](handleEntityNotFound(_0x19cb45,null))[_0x455d('0x1c')](removeEntity(_0x19cb45,null))[_0x455d('0x27')](handleError(_0x19cb45,null));};exports[_0x455d('0x54')]=function(_0x49709b,_0x3ef751,_0x47f095){var _0x42eae3={};var _0x1d6076={};var _0x4ae696;var _0x8e503;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x49709b['params']['id']}})[_0x455d('0x1c')](handleEntityNotFound(_0x3ef751,null))['then'](function(_0x109a7e){if(_0x109a7e){_0x4ae696=_0x109a7e;_0x1d6076[_0x455d('0x3a')]=_[_0x455d('0x3b')](db[_0x455d('0x55')][_0x455d('0x39')]);_0x1d6076[_0x455d('0x3c')]=_['keys'](_0x49709b[_0x455d('0x3c')]);_0x1d6076[_0x455d('0x43')]=_[_0x455d('0x3e')](_0x1d6076[_0x455d('0x3a')],_0x1d6076['query']);_0x42eae3[_0x455d('0x3d')]=_['intersection'](_0x1d6076[_0x455d('0x3a')],qs[_0x455d('0x3f')](_0x49709b[_0x455d('0x3c')][_0x455d('0x3f')]));_0x42eae3[_0x455d('0x3d')]=_0x42eae3[_0x455d('0x3d')][_0x455d('0x56')]?_0x42eae3[_0x455d('0x3d')]:_0x1d6076['model'];_0x42eae3[_0x455d('0x57')]=qs[_0x455d('0x41')](_0x49709b[_0x455d('0x3c')]['sort']);_0x42eae3[_0x455d('0x42')]=qs[_0x455d('0x43')](_[_0x455d('0x44')](_0x49709b[_0x455d('0x3c')],_0x1d6076[_0x455d('0x43')]));if(_0x49709b[_0x455d('0x3c')][_0x455d('0x45')]){_0x42eae3[_0x455d('0x42')]=_[_0x455d('0x46')](_0x42eae3[_0x455d('0x42')],{'$or':_['map'](_0x42eae3['attributes'],function(_0xcee125){var _0x4f2d63={};_0x4f2d63[_0xcee125]={'$like':'%'+_0x49709b['query'][_0x455d('0x45')]+'%'};return _0x4f2d63;})});}_0x42eae3=_['merge']({},_0x42eae3,_0x49709b[_0x455d('0x4a')]);return _0x4ae696[_0x455d('0x54')](_0x42eae3);}})[_0x455d('0x1c')](function(_0x4bc5f6){if(_0x4bc5f6){_0x8e503=_0x4bc5f6['length'];if(!_0x49709b[_0x455d('0x3c')]['hasOwnProperty'](_0x455d('0x40'))){_0x42eae3[_0x455d('0x2d')]=qs['limit'](_0x49709b[_0x455d('0x3c')][_0x455d('0x2d')]);_0x42eae3[_0x455d('0x2c')]=qs[_0x455d('0x2c')](_0x49709b['query'][_0x455d('0x2c')]);}return _0x4ae696[_0x455d('0x54')](_0x42eae3);}})[_0x455d('0x1c')](function(_0x4b12ac){if(_0x4b12ac){return _0x4b12ac?{'count':_0x8e503,'rows':_0x4b12ac}:null;}})[_0x455d('0x1c')](respondWithResult(_0x3ef751,null))[_0x455d('0x27')](handleError(_0x3ef751,null));};exports[_0x455d('0x58')]=function(_0x4de428,_0x499d4a,_0x4de173){var _0x126751={};var _0x3e11c3={};var _0x3f17d3;var _0x14aa4b;return db['ZohoConfiguration'][_0x455d('0x59')]({'where':{'id':_0x4de428[_0x455d('0x50')]['id']}})[_0x455d('0x1c')](handleEntityNotFound(_0x499d4a,null))[_0x455d('0x1c')](function(_0x394d69){if(_0x394d69){_0x3f17d3=_0x394d69;_0x3e11c3[_0x455d('0x3a')]=_[_0x455d('0x3b')](db['ZohoField'][_0x455d('0x39')]);_0x3e11c3[_0x455d('0x3c')]=_[_0x455d('0x3b')](_0x4de428[_0x455d('0x3c')]);_0x3e11c3['filters']=_['intersection'](_0x3e11c3[_0x455d('0x3a')],_0x3e11c3['query']);_0x126751[_0x455d('0x3d')]=_[_0x455d('0x3e')](_0x3e11c3[_0x455d('0x3a')],qs[_0x455d('0x3f')](_0x4de428[_0x455d('0x3c')][_0x455d('0x3f')]));_0x126751[_0x455d('0x3d')]=_0x126751[_0x455d('0x3d')]['length']?_0x126751[_0x455d('0x3d')]:_0x3e11c3[_0x455d('0x3a')];_0x126751[_0x455d('0x57')]=qs['sort'](_0x4de428['query'][_0x455d('0x41')]);_0x126751['where']=qs[_0x455d('0x43')](_[_0x455d('0x44')](_0x4de428[_0x455d('0x3c')],_0x3e11c3[_0x455d('0x43')]));if(_0x4de428[_0x455d('0x3c')]['filter']){_0x126751[_0x455d('0x42')]=_['merge'](_0x126751[_0x455d('0x42')],{'$or':_[_0x455d('0x47')](_0x126751[_0x455d('0x3d')],function(_0x6ad34e){var _0x385fbc={};_0x385fbc[_0x6ad34e]={'$like':'%'+_0x4de428['query']['filter']+'%'};return _0x385fbc;})});}_0x126751=_[_0x455d('0x46')]({},_0x126751,_0x4de428[_0x455d('0x4a')]);return _0x3f17d3[_0x455d('0x58')](_0x126751);}})[_0x455d('0x1c')](function(_0x502ae9){if(_0x502ae9){_0x14aa4b=_0x502ae9[_0x455d('0x56')];if(!_0x4de428[_0x455d('0x3c')][_0x455d('0x5a')](_0x455d('0x40'))){_0x126751['limit']=qs[_0x455d('0x2d')](_0x4de428[_0x455d('0x3c')][_0x455d('0x2d')]);_0x126751[_0x455d('0x2c')]=qs[_0x455d('0x2c')](_0x4de428[_0x455d('0x3c')][_0x455d('0x2c')]);}return _0x3f17d3[_0x455d('0x58')](_0x126751);}})[_0x455d('0x1c')](function(_0x1e531d){if(_0x1e531d){return _0x1e531d?{'count':_0x14aa4b,'rows':_0x1e531d}:null;}})['then'](respondWithResult(_0x499d4a,null))[_0x455d('0x27')](handleError(_0x499d4a,null));};exports[_0x455d('0x5b')]=function(_0x5964a5,_0xabce68,_0x3722c8){var _0x17c03e={};var _0x56b3ea={};var _0xae1f33;var _0x1c240c;return db[_0x455d('0x38')][_0x455d('0x59')]({'where':{'id':_0x5964a5[_0x455d('0x50')]['id']}})[_0x455d('0x1c')](handleEntityNotFound(_0xabce68,null))[_0x455d('0x1c')](function(_0x515420){if(_0x515420){_0xae1f33=_0x515420;_0x56b3ea[_0x455d('0x3a')]=_['keys'](db[_0x455d('0x55')]['rawAttributes']);_0x56b3ea[_0x455d('0x3c')]=_['keys'](_0x5964a5['query']);_0x56b3ea[_0x455d('0x43')]=_[_0x455d('0x3e')](_0x56b3ea['model'],_0x56b3ea[_0x455d('0x3c')]);_0x17c03e[_0x455d('0x3d')]=_[_0x455d('0x3e')](_0x56b3ea[_0x455d('0x3a')],qs[_0x455d('0x3f')](_0x5964a5['query'][_0x455d('0x3f')]));_0x17c03e[_0x455d('0x3d')]=_0x17c03e[_0x455d('0x3d')][_0x455d('0x56')]?_0x17c03e[_0x455d('0x3d')]:_0x56b3ea[_0x455d('0x3a')];_0x17c03e[_0x455d('0x57')]=qs[_0x455d('0x41')](_0x5964a5[_0x455d('0x3c')]['sort']);_0x17c03e[_0x455d('0x42')]=qs['filters'](_[_0x455d('0x44')](_0x5964a5[_0x455d('0x3c')],_0x56b3ea['filters']));if(_0x5964a5['query'][_0x455d('0x45')]){_0x17c03e['where']=_['merge'](_0x17c03e[_0x455d('0x42')],{'$or':_[_0x455d('0x47')](_0x17c03e[_0x455d('0x3d')],function(_0xebb16f){var _0x124887={};_0x124887[_0xebb16f]={'$like':'%'+_0x5964a5[_0x455d('0x3c')][_0x455d('0x45')]+'%'};return _0x124887;})});}_0x17c03e=_['merge']({},_0x17c03e,_0x5964a5[_0x455d('0x4a')]);return _0xae1f33[_0x455d('0x5b')](_0x17c03e);}})[_0x455d('0x1c')](function(_0x16aa26){if(_0x16aa26){_0x1c240c=_0x16aa26[_0x455d('0x56')];if(!_0x5964a5[_0x455d('0x3c')][_0x455d('0x5a')](_0x455d('0x40'))){_0x17c03e['limit']=qs['limit'](_0x5964a5[_0x455d('0x3c')]['limit']);_0x17c03e[_0x455d('0x2c')]=qs[_0x455d('0x2c')](_0x5964a5['query'][_0x455d('0x2c')]);}return _0xae1f33['getDescriptions'](_0x17c03e);}})[_0x455d('0x1c')](function(_0xfaa57e){if(_0xfaa57e){return _0xfaa57e?{'count':_0x1c240c,'rows':_0xfaa57e}:null;}})[_0x455d('0x1c')](respondWithResult(_0xabce68,null))[_0x455d('0x27')](handleError(_0xabce68,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 9fc52ee..28d4960 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 _0x3a25=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash'];(function(_0x207e4c,_0x4f2510){var _0x43374f=function(_0x4ba99e){while(--_0x4ba99e){_0x207e4c['push'](_0x207e4c['shift']());}};_0x43374f(++_0x4f2510);}(_0x3a25,0x15d));var _0x53a2=function(_0x6f73e7,_0x598ac3){_0x6f73e7=_0x6f73e7-0x0;var _0xe902cb=_0x3a25[_0x6f73e7];return _0xe902cb;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var logger=require(_0x53a2('0x2'))(_0x53a2('0x3'));var moment=require(_0x53a2('0x4'));var BPromise=require(_0x53a2('0x5'));var rp=require(_0x53a2('0x6'));var fs=require('fs');var path=require(_0x53a2('0x7'));var rimraf=require(_0x53a2('0x8'));var config=require(_0x53a2('0x9'));var attributes=require(_0x53a2('0xa'));module[_0x53a2('0xb')]=function(_0x2b4011,_0x346fc7){return _0x2b4011[_0x53a2('0xc')]('ZohoConfiguration',attributes,{'tableName':_0x53a2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c00=['moment','request-promise','path','rimraf','../../config/environment','exports','define','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x1ac3fa,_0x484095){var _0x4580f5=function(_0x265b0e){while(--_0x265b0e){_0x1ac3fa['push'](_0x1ac3fa['shift']());}};_0x4580f5(++_0x484095);}(_0x5c00,0x17e));var _0x05c0=function(_0xf53937,_0x2bf512){_0xf53937=_0xf53937-0x0;var _0x33b67b=_0x5c00[_0xf53937];return _0x33b67b;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var logger=require(_0x05c0('0x2'))('api');var moment=require(_0x05c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x05c0('0x4'));var fs=require('fs');var path=require(_0x05c0('0x5'));var rimraf=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x05c0('0x8')]=function(_0x3521fe,_0x261624){return _0x3521fe[_0x05c0('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x05c0('0xa'),'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 12d00c6..da818e8 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 _0xb4d4=['stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x10be9d,_0x432b6b){var _0x3d2efb=function(_0x1beb04){while(--_0x1beb04){_0x10be9d['push'](_0x10be9d['shift']());}};_0x3d2efb(++_0x432b6b);}(_0xb4d4,0x68));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b4d('0x0'));var util=require(_0x4b4d('0x1'));var moment=require(_0x4b4d('0x2'));var BPromise=require(_0x4b4d('0x3'));var rs=require(_0x4b4d('0x4'));var fs=require('fs');var Redis=require(_0x4b4d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b4d('0x6'));var logger=require('../../config/logger')(_0x4b4d('0x7'));var config=require(_0x4b4d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b4d('0x9')][_0x4b4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf2c0b6,_0x2603a,_0x280ea6){return new BPromise(function(_0x241fc4,_0x3413cb){return client[_0x4b4d('0xb')](_0xf2c0b6,_0x280ea6)['then'](function(_0x173070){logger[_0x4b4d('0xc')](_0x4b4d('0xd'),_0x2603a,_0x4b4d('0xe'));logger[_0x4b4d('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2603a,_0x4b4d('0xe'),JSON[_0x4b4d('0x10')](_0x173070));if(_0x173070['error']){if(_0x173070[_0x4b4d('0x11')]['code']===0x1f4){logger[_0x4b4d('0x11')](_0x4b4d('0xd'),_0x2603a,_0x173070[_0x4b4d('0x11')][_0x4b4d('0x12')]);return _0x3413cb(_0x173070[_0x4b4d('0x11')][_0x4b4d('0x12')]);}logger['error'](_0x4b4d('0xd'),_0x2603a,_0x173070[_0x4b4d('0x11')][_0x4b4d('0x12')]);return _0x241fc4(_0x173070['error'][_0x4b4d('0x12')]);}else{logger[_0x4b4d('0xc')](_0x4b4d('0xd'),_0x2603a,'request\x20sent');_0x241fc4(_0x173070[_0x4b4d('0x13')][_0x4b4d('0x12')]);}})['catch'](function(_0x43bb47){logger[_0x4b4d('0x11')](_0x4b4d('0xd'),_0x2603a,_0x43bb47);_0x3413cb(_0x43bb47);});});} \ No newline at end of file +var _0x2765=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x15eac7,_0x2c111d){var _0xa4d1e2=function(_0x4c927b){while(--_0x4c927b){_0x15eac7['push'](_0x15eac7['shift']());}};_0xa4d1e2(++_0x2c111d);}(_0x2765,0x94));var _0x5276=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2765[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5276('0x0'));var util=require('util');var moment=require(_0x5276('0x1'));var BPromise=require(_0x5276('0x2'));var rs=require(_0x5276('0x3'));var fs=require('fs');var Redis=require(_0x5276('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5276('0x5'));var logger=require(_0x5276('0x6'))(_0x5276('0x7'));var config=require(_0x5276('0x8'));var jayson=require(_0x5276('0x9'));var client=jayson[_0x5276('0xa')][_0x5276('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f9d99,_0x3a4cdf,_0x557b8f){return new BPromise(function(_0x2dc841,_0x3b4711){return client['request'](_0x4f9d99,_0x557b8f)[_0x5276('0xc')](function(_0x1bc806){logger[_0x5276('0xd')](_0x5276('0xe'),_0x3a4cdf,_0x5276('0xf'));logger[_0x5276('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3a4cdf,_0x5276('0xf'),JSON[_0x5276('0x11')](_0x1bc806));if(_0x1bc806[_0x5276('0x12')]){if(_0x1bc806[_0x5276('0x12')][_0x5276('0x13')]===0x1f4){logger[_0x5276('0x12')](_0x5276('0xe'),_0x3a4cdf,_0x1bc806[_0x5276('0x12')][_0x5276('0x14')]);return _0x3b4711(_0x1bc806[_0x5276('0x12')][_0x5276('0x14')]);}logger['error'](_0x5276('0xe'),_0x3a4cdf,_0x1bc806['error'][_0x5276('0x14')]);return _0x2dc841(_0x1bc806[_0x5276('0x12')][_0x5276('0x14')]);}else{logger[_0x5276('0xd')](_0x5276('0xe'),_0x3a4cdf,'request\x20sent');_0x2dc841(_0x1bc806[_0x5276('0x15')][_0x5276('0x14')]);}})[_0x5276('0x16')](function(_0x220c12){logger[_0x5276('0x12')](_0x5276('0xe'),_0x3a4cdf,_0x220c12);_0x3b4711(_0x220c12);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 2dc6e96..3af4de1 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 _0xbc2d=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x580256,_0x3110ed){var _0x34e885=function(_0x2e2bd3){while(--_0x2e2bd3){_0x580256['push'](_0x580256['shift']());}};_0x34e885(++_0x3110ed);}(_0xbc2d,0x19d));var _0xdbc2=function(_0x7304b,_0x277127){_0x7304b=_0x7304b-0x0;var _0x4b9126=_0xbc2d[_0x7304b];return _0x4b9126;};'use strict';var multer=require(_0xdbc2('0x0'));var util=require(_0xdbc2('0x1'));var path=require(_0xdbc2('0x2'));var timeout=require(_0xdbc2('0x3'));var express=require(_0xdbc2('0x4'));var router=express[_0xdbc2('0x5')]();var auth=require(_0xdbc2('0x6'));var interaction=require(_0xdbc2('0x7'));var config=require(_0xdbc2('0x8'));var controller=require(_0xdbc2('0x9'));router[_0xdbc2('0xa')]('/',auth[_0xdbc2('0xb')](),controller[_0xdbc2('0xc')]);router[_0xdbc2('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xdbc2('0xd')]);router[_0xdbc2('0xe')]('/',auth[_0xdbc2('0xb')](),controller['create']);router['put'](_0xdbc2('0xf'),auth[_0xdbc2('0xb')](),controller[_0xdbc2('0x10')]);router[_0xdbc2('0x11')](_0xdbc2('0xf'),auth[_0xdbc2('0xb')](),controller[_0xdbc2('0x12')]);module[_0xdbc2('0x13')]=router; \ No newline at end of file +var _0x0a52=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x0a52,0xd7));var _0x20a5=function(_0x57fb7c,_0x1abdca){_0x57fb7c=_0x57fb7c-0x0;var _0x51cf4b=_0x0a52[_0x57fb7c];return _0x51cf4b;};'use strict';var multer=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var path=require(_0x20a5('0x2'));var timeout=require(_0x20a5('0x3'));var express=require(_0x20a5('0x4'));var router=express[_0x20a5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x20a5('0x6'));var config=require(_0x20a5('0x7'));var controller=require(_0x20a5('0x8'));router[_0x20a5('0x9')]('/',auth[_0x20a5('0xa')](),controller['index']);router[_0x20a5('0x9')](_0x20a5('0xb'),auth[_0x20a5('0xa')](),controller[_0x20a5('0xc')]);router[_0x20a5('0xd')]('/',auth[_0x20a5('0xa')](),controller[_0x20a5('0xe')]);router['put'](_0x20a5('0xb'),auth[_0x20a5('0xa')](),controller[_0x20a5('0xf')]);router[_0x20a5('0x10')](_0x20a5('0xb'),auth[_0x20a5('0xa')](),controller[_0x20a5('0x11')]);module[_0x20a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3eeb4e4..4fd4197 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 _0xe706=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0xe706,0xa3));var _0x6e70=function(_0x138387,_0x2a16ac){_0x138387=_0x138387-0x0;var _0x45b15a=_0xe706[_0x138387];return _0x45b15a;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'type':{'type':Sequelize[_0x6e70('0x2')]('string',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')),'defaultValue':_0x6e70('0x6')},'content':{'type':Sequelize[_0x6e70('0x7')]},'key':{'type':Sequelize[_0x6e70('0x7')]},'keyType':{'type':Sequelize[_0x6e70('0x2')](_0x6e70('0x6'),_0x6e70('0x3'),_0x6e70('0x4'))},'keyContent':{'type':Sequelize[_0x6e70('0x7')]},'idField':{'type':Sequelize[_0x6e70('0x7')]},'nameField':{'type':Sequelize[_0x6e70('0x7')]},'customField':{'type':Sequelize[_0x6e70('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e70('0x7')]}}; \ No newline at end of file +var _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x7e4110,_0xc55468){var _0x3ba70f=function(_0x14bda9){while(--_0x14bda9){_0x7e4110['push'](_0x7e4110['shift']());}};_0x3ba70f(++_0xc55468);}(_0xb688,0xcf));var _0x8b68=function(_0x1f0867,_0x5a2976){_0x1f0867=_0x1f0867-0x0;var _0x24e96a=_0xb688[_0x1f0867];return _0x24e96a;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 6466984..c84fbfa 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 _0xda3f=['count','offset','limit','status','set','Content-Range','apply','save','then','destroy','error','name','send','index','ZohoField','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','type','key','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xda3f,0xec));var _0xfda3=function(_0x4878da,_0x150df2){_0x4878da=_0x4878da-0x0;var _0xe81c1e=_0xda3f[_0x4878da];return _0xe81c1e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfda3('0x0'));var rimraf=require(_0xfda3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfda3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfda3('0x3'));var util=require(_0xfda3('0x4'));var path=require('path');var sox=require(_0xfda3('0x5'));var csv=require(_0xfda3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x6'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var hardwareService=require(_0xfda3('0x10'));var logger=require(_0xfda3('0x11'))('api');var utils=require(_0xfda3('0x12'));var config=require(_0xfda3('0x13'));var db=require(_0xfda3('0x14'))['db'];function respondWithStatusCode(_0x11afc1,_0x1443f4){_0x1443f4=_0x1443f4||0xcc;return function(_0x4b77ea){if(_0x4b77ea){return _0x11afc1[_0xfda3('0x15')](_0x1443f4);}return _0x11afc1['status'](_0x1443f4)[_0xfda3('0x16')]();};}function respondWithResult(_0x1e7a55,_0x4929fa){_0x4929fa=_0x4929fa||0xc8;return function(_0x501588){if(_0x501588){return _0x1e7a55['status'](_0x4929fa)[_0xfda3('0x17')](_0x501588);}};}function respondWithFilteredResult(_0x477fc0,_0x5ea793){return function(_0x57a229){if(_0x57a229){var _0x533365=_0x57a229[_0xfda3('0x18')],_0x80ea80=_0x5ea793[_0xfda3('0x19')],_0x474707=_0x5ea793[_0xfda3('0x19')]+_0x5ea793[_0xfda3('0x1a')],_0x249dc6;if(_0x474707>=_0x533365){_0x474707=_0x533365;_0x249dc6=0xc8;}else{_0x249dc6=0xce;}_0x477fc0[_0xfda3('0x1b')](_0x249dc6);return _0x477fc0[_0xfda3('0x1c')](_0xfda3('0x1d'),_0x80ea80+'-'+_0x474707+'/'+_0x533365)['json'](_0x57a229);}return null;};}function patchUpdates(_0x15ddb9){return function(_0x1bbdda){try{jsonpatch[_0xfda3('0x1e')](_0x1bbdda,_0x15ddb9,!![]);}catch(_0x32855a){return BPromise['reject'](_0x32855a);}return _0x1bbdda[_0xfda3('0x1f')]();};}function saveUpdates(_0x43cfac,_0x2ee74c){return function(_0x51e731){if(_0x51e731){return _0x51e731['update'](_0x43cfac)[_0xfda3('0x20')](function(_0x38d428){return _0x38d428;});}return null;};}function removeEntity(_0x4ea9f5,_0x545320){return function(_0x3cf5a9){if(_0x3cf5a9){return _0x3cf5a9[_0xfda3('0x21')]()[_0xfda3('0x20')](function(){_0x4ea9f5[_0xfda3('0x1b')](0xcc)[_0xfda3('0x16')]();});}};}function handleEntityNotFound(_0x2b84b7,_0x2677f6){return function(_0xc6fb9a){if(!_0xc6fb9a){_0x2b84b7[_0xfda3('0x15')](0x194);}return _0xc6fb9a;};}function handleError(_0x5499f5,_0x82341b){_0x82341b=_0x82341b||0x1f4;return function(_0x2d5b44){logger[_0xfda3('0x22')](_0x2d5b44['stack']);if(_0x2d5b44[_0xfda3('0x23')]){delete _0x2d5b44[_0xfda3('0x23')];}_0x5499f5[_0xfda3('0x1b')](_0x82341b)[_0xfda3('0x24')](_0x2d5b44);};}exports[_0xfda3('0x25')]=function(_0xad9f7b,_0x514d2a){var _0x3c6d7d={},_0x1e87fe={},_0x2bef2b={'count':0x0,'rows':[]};var _0x1f2884=db[_0xfda3('0x26')]['rawAttributes'];_0x1e87fe[_0xfda3('0x27')]=_[_0xfda3('0x28')](_0x1f2884);_0x1e87fe[_0xfda3('0x29')]=_[_0xfda3('0x28')](_0xad9f7b[_0xfda3('0x29')]);_0x1e87fe[_0xfda3('0x2a')]=_[_0xfda3('0x2b')](_0x1e87fe['model'],_0x1e87fe['query']);_0x3c6d7d[_0xfda3('0x2c')]=_['intersection'](_0x1e87fe['model'],qs[_0xfda3('0x2d')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x2d')]));_0x3c6d7d[_0xfda3('0x2c')]=_0x3c6d7d[_0xfda3('0x2c')][_0xfda3('0x2e')]?_0x3c6d7d[_0xfda3('0x2c')]:_0x1e87fe[_0xfda3('0x27')];if(!_0xad9f7b[_0xfda3('0x29')]['hasOwnProperty'](_0xfda3('0x2f'))){_0x3c6d7d[_0xfda3('0x1a')]=qs[_0xfda3('0x1a')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x1a')]);_0x3c6d7d[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x19')]);}_0x3c6d7d['order']=qs['sort'](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x30')]);_0x3c6d7d['where']=qs[_0xfda3('0x2a')](_[_0xfda3('0x31')](_0xad9f7b[_0xfda3('0x29')],_0x1e87fe['filters']));if(_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x32')]){_0x3c6d7d[_0xfda3('0x33')]=_[_0xfda3('0x34')](_0x3c6d7d[_0xfda3('0x33')],{'$or':_['map'](_0x1f2884,function(_0xc6dd4e){if(_0xc6dd4e[_0xfda3('0x35')][_0xfda3('0x36')]!=='VIRTUAL'){var _0x373c96={};_0x373c96[_0xc6dd4e['field']]={'$like':'%'+_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x32')]+'%'};return _0x373c96;}})});}_0x3c6d7d=_[_0xfda3('0x34')]({},_0x3c6d7d,_0xad9f7b[_0xfda3('0x37')]);var _0x21c5cc={'where':_0x3c6d7d[_0xfda3('0x33')]};return db[_0xfda3('0x26')][_0xfda3('0x18')](_0x21c5cc)['then'](function(_0x24c7ad){_0x2bef2b[_0xfda3('0x18')]=_0x24c7ad;if(_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x38')]){_0x3c6d7d['include']=[{'all':!![]}];}return db[_0xfda3('0x26')][_0xfda3('0x39')](_0x3c6d7d);})[_0xfda3('0x20')](function(_0x5bad90){_0x2bef2b['rows']=_0x5bad90;return _0x2bef2b;})[_0xfda3('0x20')](respondWithFilteredResult(_0x514d2a,_0x3c6d7d))[_0xfda3('0x3a')](handleError(_0x514d2a,null));};exports[_0xfda3('0x3b')]=function(_0x1aaa6c,_0x2b415d){var _0x115f20={'raw':!![],'where':{'id':_0x1aaa6c[_0xfda3('0x3c')]['id']}},_0x40b814={};_0x40b814[_0xfda3('0x27')]=_[_0xfda3('0x28')](db['ZohoField'][_0xfda3('0x3d')]);_0x40b814[_0xfda3('0x29')]=_['keys'](_0x1aaa6c[_0xfda3('0x29')]);_0x40b814['filters']=_['intersection'](_0x40b814['model'],_0x40b814[_0xfda3('0x29')]);_0x115f20[_0xfda3('0x2c')]=_[_0xfda3('0x2b')](_0x40b814[_0xfda3('0x27')],qs['fields'](_0x1aaa6c[_0xfda3('0x29')][_0xfda3('0x2d')]));_0x115f20[_0xfda3('0x2c')]=_0x115f20[_0xfda3('0x2c')]['length']?_0x115f20[_0xfda3('0x2c')]:_0x40b814[_0xfda3('0x27')];if(_0x1aaa6c[_0xfda3('0x29')]['includeAll']){_0x115f20['include']=[{'all':!![]}];}_0x115f20=_[_0xfda3('0x34')]({},_0x115f20,_0x1aaa6c[_0xfda3('0x37')]);return db[_0xfda3('0x26')][_0xfda3('0x3e')](_0x115f20)[_0xfda3('0x20')](handleEntityNotFound(_0x2b415d,null))[_0xfda3('0x20')](respondWithResult(_0x2b415d,null))[_0xfda3('0x3a')](handleError(_0x2b415d,null));};exports[_0xfda3('0x3f')]=function(_0x12b533,_0x3ed533){return db[_0xfda3('0x26')][_0xfda3('0x3f')](_0x12b533[_0xfda3('0x40')],{})[_0xfda3('0x20')](respondWithResult(_0x3ed533,0xc9))['catch'](handleError(_0x3ed533,null));};exports['update']=function(_0x52b5c3,_0x2acde1){if(_0x52b5c3[_0xfda3('0x40')]['id']){delete _0x52b5c3[_0xfda3('0x40')]['id'];}return db[_0xfda3('0x26')][_0xfda3('0x3e')]({'where':{'id':_0x52b5c3[_0xfda3('0x3c')]['id']}})[_0xfda3('0x20')](handleEntityNotFound(_0x2acde1,null))[_0xfda3('0x20')](saveUpdates(_0x52b5c3[_0xfda3('0x40')],null))['then'](respondWithResult(_0x2acde1,null))[_0xfda3('0x3a')](handleError(_0x2acde1,null));};exports[_0xfda3('0x21')]=function(_0x481356,_0x36aa3a){return db[_0xfda3('0x26')]['find']({'where':{'id':_0x481356[_0xfda3('0x3c')]['id']}})[_0xfda3('0x20')](handleEntityNotFound(_0x36aa3a,null))[_0xfda3('0x20')](removeEntity(_0x36aa3a,null))['catch'](handleError(_0x36aa3a,null));}; \ No newline at end of file +var _0xb688=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','index','ZohoField','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x54d576,_0xd1f47c){var _0x28f905=function(_0x5cfdfa){while(--_0x5cfdfa){_0x54d576['push'](_0x54d576['shift']());}};_0x28f905(++_0xd1f47c);}(_0xb688,0xcf));var _0x8b68=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xb688[_0x547af];return _0x22f7f4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require(_0x8b68('0x3'));var rp=require(_0x8b68('0x4'));var moment=require(_0x8b68('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b68('0x6'));var util=require(_0x8b68('0x7'));var path=require(_0x8b68('0x8'));var sox=require(_0x8b68('0x9'));var csv=require('to-csv');var ejs=require(_0x8b68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0xf'));var querystring=require(_0x8b68('0x10'));var Papa=require(_0x8b68('0x11'));var Redis=require(_0x8b68('0x12'));var authService=require(_0x8b68('0x13'));var qs=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))(_0x8b68('0x17'));var utils=require('../../config/utils');var config=require(_0x8b68('0x18'));var db=require(_0x8b68('0x19'))['db'];function respondWithStatusCode(_0x5e76c,_0x2d8472){_0x2d8472=_0x2d8472||0xcc;return function(_0x1965cf){if(_0x1965cf){return _0x5e76c[_0x8b68('0x1a')](_0x2d8472);}return _0x5e76c[_0x8b68('0x1b')](_0x2d8472)[_0x8b68('0x1c')]();};}function respondWithResult(_0x2686c7,_0x5b4364){_0x5b4364=_0x5b4364||0xc8;return function(_0xb2df35){if(_0xb2df35){return _0x2686c7['status'](_0x5b4364)['json'](_0xb2df35);}};}function respondWithFilteredResult(_0x22f75b,_0x1554d6){return function(_0x27d717){if(_0x27d717){var _0x5d3468=_0x27d717[_0x8b68('0x1d')],_0x5c8d0e=_0x1554d6[_0x8b68('0x1e')],_0x23bd52=_0x1554d6[_0x8b68('0x1e')]+_0x1554d6[_0x8b68('0x1f')],_0x5c1e44;if(_0x23bd52>=_0x5d3468){_0x23bd52=_0x5d3468;_0x5c1e44=0xc8;}else{_0x5c1e44=0xce;}_0x22f75b['status'](_0x5c1e44);return _0x22f75b[_0x8b68('0x20')](_0x8b68('0x21'),_0x5c8d0e+'-'+_0x23bd52+'/'+_0x5d3468)['json'](_0x27d717);}return null;};}function patchUpdates(_0x42b3bd){return function(_0x3c7e5a){try{jsonpatch[_0x8b68('0x22')](_0x3c7e5a,_0x42b3bd,!![]);}catch(_0x17f321){return BPromise[_0x8b68('0x23')](_0x17f321);}return _0x3c7e5a['save']();};}function saveUpdates(_0x7b0b70,_0x4b4b0f){return function(_0x59e9b1){if(_0x59e9b1){return _0x59e9b1[_0x8b68('0x24')](_0x7b0b70)[_0x8b68('0x25')](function(_0x1dbc1d){return _0x1dbc1d;});}return null;};}function removeEntity(_0x5603d4,_0x571adf){return function(_0x23edc1){if(_0x23edc1){return _0x23edc1['destroy']()[_0x8b68('0x25')](function(){_0x5603d4[_0x8b68('0x1b')](0xcc)[_0x8b68('0x1c')]();});}};}function handleEntityNotFound(_0x21ecca,_0x32ddc5){return function(_0x173524){if(!_0x173524){_0x21ecca['sendStatus'](0x194);}return _0x173524;};}function handleError(_0x1a6fe8,_0x46e827){_0x46e827=_0x46e827||0x1f4;return function(_0x4ca77d){logger[_0x8b68('0x26')](_0x4ca77d[_0x8b68('0x27')]);if(_0x4ca77d[_0x8b68('0x28')]){delete _0x4ca77d['name'];}_0x1a6fe8['status'](_0x46e827)['send'](_0x4ca77d);};}exports[_0x8b68('0x29')]=function(_0x448e43,_0x2ba2a3){var _0x583476={},_0x3311c7={},_0x53aaa2={'count':0x0,'rows':[]};var _0x4cf89d=db[_0x8b68('0x2a')]['rawAttributes'];_0x3311c7[_0x8b68('0x2b')]=_[_0x8b68('0x2c')](_0x4cf89d);_0x3311c7['query']=_['keys'](_0x448e43[_0x8b68('0x2d')]);_0x3311c7[_0x8b68('0x2e')]=_[_0x8b68('0x2f')](_0x3311c7[_0x8b68('0x2b')],_0x3311c7[_0x8b68('0x2d')]);_0x583476[_0x8b68('0x30')]=_[_0x8b68('0x2f')](_0x3311c7['model'],qs[_0x8b68('0x31')](_0x448e43['query'][_0x8b68('0x31')]));_0x583476[_0x8b68('0x30')]=_0x583476['attributes'][_0x8b68('0x32')]?_0x583476[_0x8b68('0x30')]:_0x3311c7[_0x8b68('0x2b')];if(!_0x448e43['query']['hasOwnProperty'](_0x8b68('0x33'))){_0x583476[_0x8b68('0x1f')]=qs[_0x8b68('0x1f')](_0x448e43[_0x8b68('0x2d')][_0x8b68('0x1f')]);_0x583476[_0x8b68('0x1e')]=qs[_0x8b68('0x1e')](_0x448e43[_0x8b68('0x2d')][_0x8b68('0x1e')]);}_0x583476[_0x8b68('0x34')]=qs[_0x8b68('0x35')](_0x448e43[_0x8b68('0x2d')][_0x8b68('0x35')]);_0x583476[_0x8b68('0x36')]=qs[_0x8b68('0x2e')](_[_0x8b68('0x37')](_0x448e43[_0x8b68('0x2d')],_0x3311c7[_0x8b68('0x2e')]));if(_0x448e43[_0x8b68('0x2d')][_0x8b68('0x38')]){_0x583476[_0x8b68('0x36')]=_[_0x8b68('0x39')](_0x583476['where'],{'$or':_['map'](_0x4cf89d,function(_0x24026c){if(_0x24026c[_0x8b68('0x3a')][_0x8b68('0x3b')]!==_0x8b68('0x3c')){var _0xf2154f={};_0xf2154f[_0x24026c[_0x8b68('0x3d')]]={'$like':'%'+_0x448e43[_0x8b68('0x2d')][_0x8b68('0x38')]+'%'};return _0xf2154f;}})});}_0x583476=_['merge']({},_0x583476,_0x448e43[_0x8b68('0x3e')]);var _0x2c94d0={'where':_0x583476[_0x8b68('0x36')]};return db[_0x8b68('0x2a')][_0x8b68('0x1d')](_0x2c94d0)[_0x8b68('0x25')](function(_0xff4080){_0x53aaa2[_0x8b68('0x1d')]=_0xff4080;if(_0x448e43['query'][_0x8b68('0x3f')]){_0x583476[_0x8b68('0x40')]=[{'all':!![]}];}return db[_0x8b68('0x2a')][_0x8b68('0x41')](_0x583476);})[_0x8b68('0x25')](function(_0x3b3394){_0x53aaa2[_0x8b68('0x42')]=_0x3b3394;return _0x53aaa2;})['then'](respondWithFilteredResult(_0x2ba2a3,_0x583476))[_0x8b68('0x43')](handleError(_0x2ba2a3,null));};exports[_0x8b68('0x44')]=function(_0x48f159,_0x14ec40){var _0x27a717={'raw':!![],'where':{'id':_0x48f159['params']['id']}},_0x50b2f1={};_0x50b2f1['model']=_['keys'](db[_0x8b68('0x2a')][_0x8b68('0x45')]);_0x50b2f1['query']=_[_0x8b68('0x2c')](_0x48f159['query']);_0x50b2f1[_0x8b68('0x2e')]=_[_0x8b68('0x2f')](_0x50b2f1['model'],_0x50b2f1[_0x8b68('0x2d')]);_0x27a717['attributes']=_['intersection'](_0x50b2f1['model'],qs[_0x8b68('0x31')](_0x48f159[_0x8b68('0x2d')][_0x8b68('0x31')]));_0x27a717[_0x8b68('0x30')]=_0x27a717['attributes'][_0x8b68('0x32')]?_0x27a717['attributes']:_0x50b2f1[_0x8b68('0x2b')];if(_0x48f159[_0x8b68('0x2d')]['includeAll']){_0x27a717[_0x8b68('0x40')]=[{'all':!![]}];}_0x27a717=_[_0x8b68('0x39')]({},_0x27a717,_0x48f159[_0x8b68('0x3e')]);return db[_0x8b68('0x2a')]['find'](_0x27a717)[_0x8b68('0x25')](handleEntityNotFound(_0x14ec40,null))[_0x8b68('0x25')](respondWithResult(_0x14ec40,null))[_0x8b68('0x43')](handleError(_0x14ec40,null));};exports[_0x8b68('0x46')]=function(_0xae2c2a,_0x1362d3){return db[_0x8b68('0x2a')][_0x8b68('0x46')](_0xae2c2a[_0x8b68('0x47')],{})[_0x8b68('0x25')](respondWithResult(_0x1362d3,0xc9))[_0x8b68('0x43')](handleError(_0x1362d3,null));};exports[_0x8b68('0x24')]=function(_0x1af430,_0x108c8d){if(_0x1af430[_0x8b68('0x47')]['id']){delete _0x1af430[_0x8b68('0x47')]['id'];}return db['ZohoField'][_0x8b68('0x48')]({'where':{'id':_0x1af430[_0x8b68('0x49')]['id']}})['then'](handleEntityNotFound(_0x108c8d,null))[_0x8b68('0x25')](saveUpdates(_0x1af430['body'],null))['then'](respondWithResult(_0x108c8d,null))['catch'](handleError(_0x108c8d,null));};exports[_0x8b68('0x4a')]=function(_0x35874b,_0x34047c){return db[_0x8b68('0x2a')]['find']({'where':{'id':_0x35874b['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x34047c,null))[_0x8b68('0x25')](removeEntity(_0x34047c,null))[_0x8b68('0x43')](handleError(_0x34047c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b88a808..670a3e3 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 _0x116a=['define','ZohoField','int_zoho_fields','idField','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0x116a,0xa0));var _0xa116=function(_0x5b57f3,_0x57eb69){_0x5b57f3=_0x5b57f3-0x0;var _0x36b66a=_0x116a[_0x5b57f3];return _0x36b66a;};'use strict';var _=require(_0xa116('0x0'));var util=require('util');var logger=require(_0xa116('0x1'))(_0xa116('0x2'));var moment=require(_0xa116('0x3'));var BPromise=require('bluebird');var rp=require(_0xa116('0x4'));var fs=require('fs');var path=require(_0xa116('0x5'));var rimraf=require(_0xa116('0x6'));var config=require(_0xa116('0x7'));var attributes=require(_0xa116('0x8'));module['exports']=function(_0x2f01c8,_0x10bd3d){return _0x2f01c8[_0xa116('0x9')](_0xa116('0xa'),attributes,{'tableName':_0xa116('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xa116('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e22=['rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','lodash','util','api','moment','bluebird','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2e22,0x18d));var _0x22e2=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x2e22[_0x533e4e];return _0x1f14bb;};'use strict';var _=require(_0x22e2('0x0'));var util=require(_0x22e2('0x1'));var logger=require('../../config/logger')(_0x22e2('0x2'));var moment=require(_0x22e2('0x3'));var BPromise=require(_0x22e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22e2('0x5'));var rimraf=require(_0x22e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x22e2('0x7'));module[_0x22e2('0x8')]=function(_0xbf6170,_0xd62e2a){return _0xbf6170[_0x22e2('0x9')](_0x22e2('0xa'),attributes,{'tableName':_0x22e2('0xb'),'paranoid':![],'indexes':[{'name':_0x22e2('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 cc27d8f..41622ea 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 _0x631b=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x1b773e,_0x37b69c){var _0x44c4a2=function(_0x2eb17d){while(--_0x2eb17d){_0x1b773e['push'](_0x1b773e['shift']());}};_0x44c4a2(++_0x37b69c);}(_0x631b,0x1f3));var _0xb631=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x631b[_0x333798];return _0x389f4e;};'use strict';var _=require('lodash');var util=require(_0xb631('0x0'));var moment=require('moment');var BPromise=require(_0xb631('0x1'));var rs=require(_0xb631('0x2'));var fs=require('fs');var Redis=require(_0xb631('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb631('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb631('0x5'));var jayson=require(_0xb631('0x6'));var client=jayson[_0xb631('0x7')][_0xb631('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20e5f3,_0x402cc6,_0x6089ac){return new BPromise(function(_0xca7eaa,_0x57d5c1){return client['request'](_0x20e5f3,_0x6089ac)[_0xb631('0x9')](function(_0x10a0ff){logger[_0xb631('0xa')](_0xb631('0xb'),_0x402cc6,_0xb631('0xc'));logger[_0xb631('0xd')](_0xb631('0xe'),_0x402cc6,'request\x20sent',JSON[_0xb631('0xf')](_0x10a0ff));if(_0x10a0ff[_0xb631('0x10')]){if(_0x10a0ff[_0xb631('0x10')][_0xb631('0x11')]===0x1f4){logger[_0xb631('0x10')](_0xb631('0xb'),_0x402cc6,_0x10a0ff[_0xb631('0x10')][_0xb631('0x12')]);return _0x57d5c1(_0x10a0ff[_0xb631('0x10')][_0xb631('0x12')]);}logger['error'](_0xb631('0xb'),_0x402cc6,_0x10a0ff[_0xb631('0x10')][_0xb631('0x12')]);return _0xca7eaa(_0x10a0ff[_0xb631('0x10')]['message']);}else{logger[_0xb631('0xa')](_0xb631('0xb'),_0x402cc6,'request\x20sent');_0xca7eaa(_0x10a0ff['result']['message']);}})[_0xb631('0x13')](function(_0x358d3f){logger['error'](_0xb631('0xb'),_0x402cc6,_0x358d3f);_0x57d5c1(_0x358d3f);});});} \ No newline at end of file +var _0xcca3=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc'];(function(_0x215e12,_0x10a9f2){var _0xa4f1fb=function(_0x462c03){while(--_0x462c03){_0x215e12['push'](_0x215e12['shift']());}};_0xa4f1fb(++_0x10a9f2);}(_0xcca3,0x14e));var _0x3cca=function(_0x3a76f7,_0x2cd65d){_0x3a76f7=_0x3a76f7-0x0;var _0x4d4e44=_0xcca3[_0x3a76f7];return _0x4d4e44;};'use strict';var _=require(_0x3cca('0x0'));var util=require(_0x3cca('0x1'));var moment=require(_0x3cca('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cca('0x3'))['db'];var utils=require(_0x3cca('0x4'));var logger=require('../../config/logger')(_0x3cca('0x5'));var config=require(_0x3cca('0x6'));var jayson=require(_0x3cca('0x7'));var client=jayson['client'][_0x3cca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24d631,_0x39c45e,_0x2fd1ae){return new BPromise(function(_0x59b06,_0x5a182d){return client[_0x3cca('0x9')](_0x24d631,_0x2fd1ae)[_0x3cca('0xa')](function(_0x52bf5e){logger[_0x3cca('0xb')]('ZohoField,\x20%s,\x20%s',_0x39c45e,_0x3cca('0xc'));logger[_0x3cca('0xd')](_0x3cca('0xe'),_0x39c45e,'request\x20sent',JSON[_0x3cca('0xf')](_0x52bf5e));if(_0x52bf5e[_0x3cca('0x10')]){if(_0x52bf5e[_0x3cca('0x10')]['code']===0x1f4){logger['error'](_0x3cca('0x11'),_0x39c45e,_0x52bf5e[_0x3cca('0x10')][_0x3cca('0x12')]);return _0x5a182d(_0x52bf5e[_0x3cca('0x10')][_0x3cca('0x12')]);}logger[_0x3cca('0x10')]('ZohoField,\x20%s,\x20%s',_0x39c45e,_0x52bf5e['error'][_0x3cca('0x12')]);return _0x59b06(_0x52bf5e[_0x3cca('0x10')]['message']);}else{logger[_0x3cca('0xb')](_0x3cca('0x11'),_0x39c45e,_0x3cca('0xc'));_0x59b06(_0x52bf5e['result'][_0x3cca('0x12')]);}})[_0x3cca('0x13')](function(_0x36bd75){logger['error'](_0x3cca('0x11'),_0x39c45e,_0x36bd75);_0x5a182d(_0x36bd75);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 67084e6..9ae44d8 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 _0x75dd=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x75dd,0x1c9));var _0xd75d=function(_0x3f2ebd,_0x27dc3b){_0x3f2ebd=_0x3f2ebd-0x0;var _0x5846e4=_0x75dd[_0x3f2ebd];return _0x5846e4;};'use strict';var multer=require(_0xd75d('0x0'));var util=require(_0xd75d('0x1'));var path=require(_0xd75d('0x2'));var timeout=require(_0xd75d('0x3'));var express=require(_0xd75d('0x4'));var router=express[_0xd75d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd75d('0x6'));var config=require(_0xd75d('0x7'));module[_0xd75d('0x8')]=router; \ No newline at end of file +var _0x8ace=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x29a91c,_0x5ac2c5){_0x29a91c=_0x29a91c-0x0;var _0x2ab4ff=_0x8ace[_0x29a91c];return _0x2ab4ff;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var auth=require(_0xe8ac('0x6'));var interaction=require(_0xe8ac('0x7'));var config=require(_0xe8ac('0x8'));module[_0xe8ac('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index f87785e..ff2eff1 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 _0x8fe5=['unique_name_and_version','state','sequelize','exports','STRING'];(function(_0x1956a9,_0x265954){var _0x42f25b=function(_0x3eb4a1){while(--_0x3eb4a1){_0x1956a9['push'](_0x1956a9['shift']());}};_0x42f25b(++_0x265954);}(_0x8fe5,0x18d));var _0x58fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fe5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x58fe('0x0'));module[_0x58fe('0x1')]={'name':{'type':Sequelize[_0x58fe('0x2')],'allowNull':![],'unique':_0x58fe('0x3')},'version':{'type':Sequelize[_0x58fe('0x2')],'allowNull':![],'unique':_0x58fe('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x58fe('0x2')]},'path':{'type':Sequelize[_0x58fe('0x2')]},'type':{'type':Sequelize[_0x58fe('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x58fe('0x2')]},'logo':{'type':Sequelize[_0x58fe('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x58fe('0x4')},'description':{'type':Sequelize[_0x58fe('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x58fe('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5ee8=['exports','unique_name_and_version','app.js','STRING','sequelize'];(function(_0x42bbb5,_0x530502){var _0x3d9fe9=function(_0x60c363){while(--_0x60c363){_0x42bbb5['push'](_0x42bbb5['shift']());}};_0x3d9fe9(++_0x530502);}(_0x5ee8,0xf9));var _0x85ee=function(_0x42e664,_0x2b80b6){_0x42e664=_0x42e664-0x0;var _0x3f8b89=_0x5ee8[_0x42e664];return _0x3f8b89;};'use strict';var Sequelize=require(_0x85ee('0x0'));module[_0x85ee('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x85ee('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x85ee('0x3')},'filename':{'type':Sequelize[_0x85ee('0x4')]},'path':{'type':Sequelize[_0x85ee('0x4')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x85ee('0x4')]},'state':{'type':Sequelize[_0x85ee('0x4')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x85ee('0x4')]},'remoteUri':{'type':Sequelize[_0x85ee('0x4')]},'link':{'type':Sequelize[_0x85ee('0x4')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 697f3ff..1de161a 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 _0x2e38=['create','body','update','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','Content-Range','reject','save','destroy','then','error','name','send','index','Integration','rawAttributes','model','keys','intersection','query','attributes','fields','length','nolimit','limit','offset','sort','where','filters','pick','filter','map','key','VIRTUAL','field','merge','includeAll','include','rows','catch','show','params','find'];(function(_0x2a7262,_0x5af272){var _0x4a7df2=function(_0x107398){while(--_0x107398){_0x2a7262['push'](_0x2a7262['shift']());}};_0x4a7df2(++_0x5af272);}(_0x2e38,0x1d8));var _0x82e3=function(_0x42d521,_0x277643){_0x42d521=_0x42d521-0x0;var _0xc42f28=_0x2e38[_0x42d521];return _0xc42f28;};'use strict';var pdf=require(_0x82e3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82e3('0x1'));var zipdir=require(_0x82e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82e3('0x3'));var moment=require(_0x82e3('0x4'));var BPromise=require(_0x82e3('0x5'));var Mustache=require(_0x82e3('0x6'));var util=require(_0x82e3('0x7'));var path=require(_0x82e3('0x8'));var sox=require(_0x82e3('0x9'));var csv=require(_0x82e3('0xa'));var ejs=require(_0x82e3('0xb'));var fs=require('fs');var _=require(_0x82e3('0xc'));var squel=require(_0x82e3('0xd'));var crypto=require('crypto');var jsforce=require(_0x82e3('0xe'));var deskjs=require(_0x82e3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x82e3('0x10'));var Redis=require(_0x82e3('0x11'));var authService=require(_0x82e3('0x12'));var qs=require(_0x82e3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x82e3('0x14'));var config=require(_0x82e3('0x15'));var db=require(_0x82e3('0x16'))['db'];function respondWithStatusCode(_0x41437e,_0x335618){_0x335618=_0x335618||0xcc;return function(_0x32a1f5){if(_0x32a1f5){return _0x41437e[_0x82e3('0x17')](_0x335618);}return _0x41437e[_0x82e3('0x18')](_0x335618)[_0x82e3('0x19')]();};}function respondWithResult(_0x2a1ec7,_0x3c8b8b){_0x3c8b8b=_0x3c8b8b||0xc8;return function(_0x56e3c5){if(_0x56e3c5){return _0x2a1ec7[_0x82e3('0x18')](_0x3c8b8b)['json'](_0x56e3c5);}};}function respondWithFilteredResult(_0x1ad2d1,_0x4a3b34){return function(_0x413b88){if(_0x413b88){var _0x4079f1=_0x413b88['count'],_0x5de85c=_0x4a3b34['offset'],_0x15845e=_0x4a3b34['offset']+_0x4a3b34['limit'],_0xb3703c;if(_0x15845e>=_0x4079f1){_0x15845e=_0x4079f1;_0xb3703c=0xc8;}else{_0xb3703c=0xce;}_0x1ad2d1[_0x82e3('0x18')](_0xb3703c);return _0x1ad2d1['set'](_0x82e3('0x1a'),_0x5de85c+'-'+_0x15845e+'/'+_0x4079f1)['json'](_0x413b88);}return null;};}function patchUpdates(_0x5397da){return function(_0x5b63ef){try{jsonpatch['apply'](_0x5b63ef,_0x5397da,!![]);}catch(_0x4da501){return BPromise[_0x82e3('0x1b')](_0x4da501);}return _0x5b63ef[_0x82e3('0x1c')]();};}function saveUpdates(_0x6a91f1,_0x54c4f5){return function(_0x2e23ee){if(_0x2e23ee){return _0x2e23ee['update'](_0x6a91f1)['then'](function(_0x2a49b8){return _0x2a49b8;});}return null;};}function removeEntity(_0x122015,_0x276490){return function(_0xe4ed76){if(_0xe4ed76){return _0xe4ed76[_0x82e3('0x1d')]()[_0x82e3('0x1e')](function(){_0x122015['status'](0xcc)[_0x82e3('0x19')]();});}};}function handleEntityNotFound(_0x5f12ee,_0x46a504){return function(_0x59f2ae){if(!_0x59f2ae){_0x5f12ee[_0x82e3('0x17')](0x194);}return _0x59f2ae;};}function handleError(_0x57f915,_0x46e8dc){_0x46e8dc=_0x46e8dc||0x1f4;return function(_0x3ceeff){logger[_0x82e3('0x1f')](_0x3ceeff['stack']);if(_0x3ceeff[_0x82e3('0x20')]){delete _0x3ceeff['name'];}_0x57f915[_0x82e3('0x18')](_0x46e8dc)[_0x82e3('0x21')](_0x3ceeff);};}exports[_0x82e3('0x22')]=function(_0x376b40,_0x52fafc){var _0x308b3f={},_0x55ef46={},_0x4e01fa={'count':0x0,'rows':[]};var _0x41a043=db[_0x82e3('0x23')][_0x82e3('0x24')];_0x55ef46[_0x82e3('0x25')]=_[_0x82e3('0x26')](_0x41a043);_0x55ef46['query']=_[_0x82e3('0x26')](_0x376b40['query']);_0x55ef46['filters']=_[_0x82e3('0x27')](_0x55ef46['model'],_0x55ef46[_0x82e3('0x28')]);_0x308b3f[_0x82e3('0x29')]=_[_0x82e3('0x27')](_0x55ef46['model'],qs[_0x82e3('0x2a')](_0x376b40['query'][_0x82e3('0x2a')]));_0x308b3f[_0x82e3('0x29')]=_0x308b3f[_0x82e3('0x29')][_0x82e3('0x2b')]?_0x308b3f['attributes']:_0x55ef46[_0x82e3('0x25')];if(!_0x376b40[_0x82e3('0x28')]['hasOwnProperty'](_0x82e3('0x2c'))){_0x308b3f[_0x82e3('0x2d')]=qs[_0x82e3('0x2d')](_0x376b40['query'][_0x82e3('0x2d')]);_0x308b3f[_0x82e3('0x2e')]=qs[_0x82e3('0x2e')](_0x376b40['query'][_0x82e3('0x2e')]);}_0x308b3f['order']=qs[_0x82e3('0x2f')](_0x376b40[_0x82e3('0x28')][_0x82e3('0x2f')]);_0x308b3f[_0x82e3('0x30')]=qs[_0x82e3('0x31')](_[_0x82e3('0x32')](_0x376b40[_0x82e3('0x28')],_0x55ef46['filters']));if(_0x376b40[_0x82e3('0x28')][_0x82e3('0x33')]){_0x308b3f['where']=_['merge'](_0x308b3f['where'],{'$or':_[_0x82e3('0x34')](_0x41a043,function(_0x760342){if(_0x760342['type'][_0x82e3('0x35')]!==_0x82e3('0x36')){var _0x368b63={};_0x368b63[_0x760342[_0x82e3('0x37')]]={'$like':'%'+_0x376b40[_0x82e3('0x28')]['filter']+'%'};return _0x368b63;}})});}_0x308b3f=_[_0x82e3('0x38')]({},_0x308b3f,_0x376b40['options']);var _0x26f78b={'where':_0x308b3f[_0x82e3('0x30')]};return db['Integration']['count'](_0x26f78b)[_0x82e3('0x1e')](function(_0xf15b66){_0x4e01fa['count']=_0xf15b66;if(_0x376b40[_0x82e3('0x28')][_0x82e3('0x39')]){_0x308b3f[_0x82e3('0x3a')]=[{'all':!![]}];}return db[_0x82e3('0x23')]['findAll'](_0x308b3f);})['then'](function(_0x5bec87){_0x4e01fa[_0x82e3('0x3b')]=_0x5bec87;return _0x4e01fa;})['then'](respondWithFilteredResult(_0x52fafc,_0x308b3f))[_0x82e3('0x3c')](handleError(_0x52fafc,null));};exports[_0x82e3('0x3d')]=function(_0x495e10,_0xa09998){var _0x49f07f={'raw':![],'where':{'id':_0x495e10[_0x82e3('0x3e')]['id']}},_0x2aea0e={};_0x2aea0e[_0x82e3('0x25')]=_[_0x82e3('0x26')](db[_0x82e3('0x23')]['rawAttributes']);_0x2aea0e[_0x82e3('0x28')]=_['keys'](_0x495e10[_0x82e3('0x28')]);_0x2aea0e[_0x82e3('0x31')]=_[_0x82e3('0x27')](_0x2aea0e[_0x82e3('0x25')],_0x2aea0e['query']);_0x49f07f[_0x82e3('0x29')]=_[_0x82e3('0x27')](_0x2aea0e['model'],qs[_0x82e3('0x2a')](_0x495e10[_0x82e3('0x28')][_0x82e3('0x2a')]));_0x49f07f[_0x82e3('0x29')]=_0x49f07f[_0x82e3('0x29')]['length']?_0x49f07f[_0x82e3('0x29')]:_0x2aea0e[_0x82e3('0x25')];if(_0x495e10[_0x82e3('0x28')][_0x82e3('0x39')]){_0x49f07f['include']=[{'all':!![]}];}_0x49f07f=_[_0x82e3('0x38')]({},_0x49f07f,_0x495e10['options']);return db['Integration'][_0x82e3('0x3f')](_0x49f07f)[_0x82e3('0x1e')](handleEntityNotFound(_0xa09998,null))[_0x82e3('0x1e')](respondWithResult(_0xa09998,null))[_0x82e3('0x3c')](handleError(_0xa09998,null));};exports[_0x82e3('0x40')]=function(_0x329e7c,_0x50fc2c){return db['Integration'][_0x82e3('0x40')](_0x329e7c[_0x82e3('0x41')],{})[_0x82e3('0x1e')](respondWithResult(_0x50fc2c,0xc9))[_0x82e3('0x3c')](handleError(_0x50fc2c,null));};exports[_0x82e3('0x42')]=function(_0x54bdaa,_0x5b5954){if(_0x54bdaa[_0x82e3('0x41')]['id']){delete _0x54bdaa[_0x82e3('0x41')]['id'];}return db['Integration'][_0x82e3('0x3f')]({'where':{'id':_0x54bdaa['params']['id']}})[_0x82e3('0x1e')](handleEntityNotFound(_0x5b5954,null))[_0x82e3('0x1e')](saveUpdates(_0x54bdaa[_0x82e3('0x41')],null))[_0x82e3('0x1e')](respondWithResult(_0x5b5954,null))['catch'](handleError(_0x5b5954,null));};exports['destroy']=function(_0x22a45a,_0x534159){return db['Integration'][_0x82e3('0x3f')]({'where':{'id':_0x22a45a[_0x82e3('0x3e')]['id']}})[_0x82e3('0x1e')](handleEntityNotFound(_0x534159,null))['then'](removeEntity(_0x534159,null))[_0x82e3('0x3c')](handleError(_0x534159,null));}; \ No newline at end of file +var _0x252a=['reject','save','update','then','error','stack','name','send','index','Integration','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply'];(function(_0x19bf71,_0x353200){var _0x536139=function(_0x51aedd){while(--_0x51aedd){_0x19bf71['push'](_0x19bf71['shift']());}};_0x536139(++_0x353200);}(_0x252a,0xbc));var _0xa252=function(_0x4e8d19,_0x5072b9){_0x4e8d19=_0x4e8d19-0x0;var _0x13afa9=_0x252a[_0x4e8d19];return _0x13afa9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa252('0x0'));var jsonpatch=require(_0xa252('0x1'));var rp=require(_0xa252('0x2'));var moment=require(_0xa252('0x3'));var BPromise=require(_0xa252('0x4'));var Mustache=require(_0xa252('0x5'));var util=require(_0xa252('0x6'));var path=require(_0xa252('0x7'));var sox=require(_0xa252('0x8'));var csv=require(_0xa252('0x9'));var ejs=require(_0xa252('0xa'));var fs=require('fs');var _=require(_0xa252('0xb'));var squel=require('squel');var crypto=require(_0xa252('0xc'));var jsforce=require(_0xa252('0xd'));var deskjs=require(_0xa252('0xe'));var toCsv=require(_0xa252('0x9'));var querystring=require(_0xa252('0xf'));var Papa=require(_0xa252('0x10'));var Redis=require(_0xa252('0x11'));var authService=require(_0xa252('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa252('0x13'));var utils=require(_0xa252('0x14'));var config=require('../../config/environment');var db=require(_0xa252('0x15'))['db'];function respondWithStatusCode(_0x2ea776,_0x47931b){_0x47931b=_0x47931b||0xcc;return function(_0x14e465){if(_0x14e465){return _0x2ea776[_0xa252('0x16')](_0x47931b);}return _0x2ea776[_0xa252('0x17')](_0x47931b)[_0xa252('0x18')]();};}function respondWithResult(_0x474c79,_0x561bb3){_0x561bb3=_0x561bb3||0xc8;return function(_0x183d91){if(_0x183d91){return _0x474c79[_0xa252('0x17')](_0x561bb3)['json'](_0x183d91);}};}function respondWithFilteredResult(_0x1b1cca,_0x20f687){return function(_0x5fe9a0){if(_0x5fe9a0){var _0x57b7ce=_0x5fe9a0[_0xa252('0x19')],_0x5860d5=_0x20f687[_0xa252('0x1a')],_0x125537=_0x20f687[_0xa252('0x1a')]+_0x20f687['limit'],_0x5d93da;if(_0x125537>=_0x57b7ce){_0x125537=_0x57b7ce;_0x5d93da=0xc8;}else{_0x5d93da=0xce;}_0x1b1cca[_0xa252('0x17')](_0x5d93da);return _0x1b1cca[_0xa252('0x1b')](_0xa252('0x1c'),_0x5860d5+'-'+_0x125537+'/'+_0x57b7ce)[_0xa252('0x1d')](_0x5fe9a0);}return null;};}function patchUpdates(_0xfa3db7){return function(_0x3da061){try{jsonpatch[_0xa252('0x1e')](_0x3da061,_0xfa3db7,!![]);}catch(_0x2fc670){return BPromise[_0xa252('0x1f')](_0x2fc670);}return _0x3da061[_0xa252('0x20')]();};}function saveUpdates(_0xc6f6de,_0xdea392){return function(_0x298bad){if(_0x298bad){return _0x298bad[_0xa252('0x21')](_0xc6f6de)[_0xa252('0x22')](function(_0x46a82b){return _0x46a82b;});}return null;};}function removeEntity(_0x2e9bb4,_0x547aa6){return function(_0x12f6bc){if(_0x12f6bc){return _0x12f6bc['destroy']()[_0xa252('0x22')](function(){_0x2e9bb4[_0xa252('0x17')](0xcc)[_0xa252('0x18')]();});}};}function handleEntityNotFound(_0x43ba90,_0x2e658e){return function(_0x2771a6){if(!_0x2771a6){_0x43ba90[_0xa252('0x16')](0x194);}return _0x2771a6;};}function handleError(_0xc80ec1,_0x33128f){_0x33128f=_0x33128f||0x1f4;return function(_0x21277d){logger[_0xa252('0x23')](_0x21277d[_0xa252('0x24')]);if(_0x21277d[_0xa252('0x25')]){delete _0x21277d[_0xa252('0x25')];}_0xc80ec1[_0xa252('0x17')](_0x33128f)[_0xa252('0x26')](_0x21277d);};}exports[_0xa252('0x27')]=function(_0x3b7a73,_0x54ffbb){var _0x4aa37b={},_0x930a2b={},_0x3f3b02={'count':0x0,'rows':[]};var _0x3f9e9e=db[_0xa252('0x28')][_0xa252('0x29')];_0x930a2b[_0xa252('0x2a')]=_['keys'](_0x3f9e9e);_0x930a2b[_0xa252('0x2b')]=_[_0xa252('0x2c')](_0x3b7a73['query']);_0x930a2b[_0xa252('0x2d')]=_['intersection'](_0x930a2b[_0xa252('0x2a')],_0x930a2b[_0xa252('0x2b')]);_0x4aa37b[_0xa252('0x2e')]=_[_0xa252('0x2f')](_0x930a2b[_0xa252('0x2a')],qs['fields'](_0x3b7a73[_0xa252('0x2b')][_0xa252('0x30')]));_0x4aa37b['attributes']=_0x4aa37b[_0xa252('0x2e')][_0xa252('0x31')]?_0x4aa37b['attributes']:_0x930a2b['model'];if(!_0x3b7a73['query'][_0xa252('0x32')](_0xa252('0x33'))){_0x4aa37b[_0xa252('0x34')]=qs[_0xa252('0x34')](_0x3b7a73[_0xa252('0x2b')][_0xa252('0x34')]);_0x4aa37b[_0xa252('0x1a')]=qs[_0xa252('0x1a')](_0x3b7a73[_0xa252('0x2b')][_0xa252('0x1a')]);}_0x4aa37b['order']=qs[_0xa252('0x35')](_0x3b7a73[_0xa252('0x2b')][_0xa252('0x35')]);_0x4aa37b[_0xa252('0x36')]=qs[_0xa252('0x2d')](_[_0xa252('0x37')](_0x3b7a73[_0xa252('0x2b')],_0x930a2b['filters']));if(_0x3b7a73[_0xa252('0x2b')][_0xa252('0x38')]){_0x4aa37b['where']=_[_0xa252('0x39')](_0x4aa37b['where'],{'$or':_['map'](_0x3f9e9e,function(_0x46dadd){if(_0x46dadd[_0xa252('0x3a')][_0xa252('0x3b')]!==_0xa252('0x3c')){var _0x3d0dfd={};_0x3d0dfd[_0x46dadd['field']]={'$like':'%'+_0x3b7a73['query'][_0xa252('0x38')]+'%'};return _0x3d0dfd;}})});}_0x4aa37b=_[_0xa252('0x39')]({},_0x4aa37b,_0x3b7a73[_0xa252('0x3d')]);var _0x1df196={'where':_0x4aa37b['where']};return db[_0xa252('0x28')]['count'](_0x1df196)[_0xa252('0x22')](function(_0x813a39){_0x3f3b02[_0xa252('0x19')]=_0x813a39;if(_0x3b7a73['query'][_0xa252('0x3e')]){_0x4aa37b[_0xa252('0x3f')]=[{'all':!![]}];}return db[_0xa252('0x28')][_0xa252('0x40')](_0x4aa37b);})[_0xa252('0x22')](function(_0x3d7e6c){_0x3f3b02[_0xa252('0x41')]=_0x3d7e6c;return _0x3f3b02;})['then'](respondWithFilteredResult(_0x54ffbb,_0x4aa37b))['catch'](handleError(_0x54ffbb,null));};exports[_0xa252('0x42')]=function(_0x125353,_0xa4c9d4){var _0x3f803c={'raw':![],'where':{'id':_0x125353[_0xa252('0x43')]['id']}},_0x19e62f={};_0x19e62f[_0xa252('0x2a')]=_[_0xa252('0x2c')](db[_0xa252('0x28')][_0xa252('0x29')]);_0x19e62f[_0xa252('0x2b')]=_[_0xa252('0x2c')](_0x125353[_0xa252('0x2b')]);_0x19e62f['filters']=_['intersection'](_0x19e62f['model'],_0x19e62f[_0xa252('0x2b')]);_0x3f803c[_0xa252('0x2e')]=_[_0xa252('0x2f')](_0x19e62f[_0xa252('0x2a')],qs['fields'](_0x125353[_0xa252('0x2b')]['fields']));_0x3f803c['attributes']=_0x3f803c[_0xa252('0x2e')][_0xa252('0x31')]?_0x3f803c[_0xa252('0x2e')]:_0x19e62f[_0xa252('0x2a')];if(_0x125353[_0xa252('0x2b')][_0xa252('0x3e')]){_0x3f803c[_0xa252('0x3f')]=[{'all':!![]}];}_0x3f803c=_[_0xa252('0x39')]({},_0x3f803c,_0x125353[_0xa252('0x3d')]);return db[_0xa252('0x28')]['find'](_0x3f803c)['then'](handleEntityNotFound(_0xa4c9d4,null))['then'](respondWithResult(_0xa4c9d4,null))[_0xa252('0x44')](handleError(_0xa4c9d4,null));};exports[_0xa252('0x45')]=function(_0x388b24,_0x40897a){return db[_0xa252('0x28')][_0xa252('0x45')](_0x388b24[_0xa252('0x46')],{})['then'](respondWithResult(_0x40897a,0xc9))[_0xa252('0x44')](handleError(_0x40897a,null));};exports[_0xa252('0x21')]=function(_0x32bee4,_0x398240){if(_0x32bee4[_0xa252('0x46')]['id']){delete _0x32bee4[_0xa252('0x46')]['id'];}return db[_0xa252('0x28')][_0xa252('0x47')]({'where':{'id':_0x32bee4[_0xa252('0x43')]['id']}})['then'](handleEntityNotFound(_0x398240,null))['then'](saveUpdates(_0x32bee4[_0xa252('0x46')],null))['then'](respondWithResult(_0x398240,null))[_0xa252('0x44')](handleError(_0x398240,null));};exports[_0xa252('0x48')]=function(_0x1f2c53,_0x5881d0){return db['Integration'][_0xa252('0x47')]({'where':{'id':_0x1f2c53[_0xa252('0x43')]['id']}})[_0xa252('0x22')](handleEntityNotFound(_0x5881d0,null))[_0xa252('0x22')](removeEntity(_0x5881d0,null))[_0xa252('0x44')](handleError(_0x5881d0,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 9f35f40..bbfa727 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 _0x3ad3=['rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3ad3,0x6e));var _0x33ad=function(_0x417541,_0x4cf131){_0x417541=_0x417541-0x0;var _0x520af9=_0x3ad3[_0x417541];return _0x520af9;};'use strict';var _=require(_0x33ad('0x0'));var util=require(_0x33ad('0x1'));var logger=require(_0x33ad('0x2'))(_0x33ad('0x3'));var moment=require(_0x33ad('0x4'));var BPromise=require('bluebird');var rp=require(_0x33ad('0x5'));var fs=require('fs');var path=require(_0x33ad('0x6'));var rimraf=require(_0x33ad('0x7'));var config=require('../../config/environment');var attributes=require(_0x33ad('0x8'));module[_0x33ad('0x9')]=function(_0x88645e,_0x31cad7){return _0x88645e[_0x33ad('0xa')](_0x33ad('0xb'),attributes,{'tableName':_0x33ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47cb=['../../config/environment','./integration.attributes','exports','define','integrations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x456066,_0x44930c){var _0x5a069a=function(_0x2ed314){while(--_0x2ed314){_0x456066['push'](_0x456066['shift']());}};_0x5a069a(++_0x44930c);}(_0x47cb,0x1cd));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb47c('0x0'));var util=require(_0xb47c('0x1'));var logger=require(_0xb47c('0x2'))(_0xb47c('0x3'));var moment=require('moment');var BPromise=require(_0xb47c('0x4'));var rp=require(_0xb47c('0x5'));var fs=require('fs');var path=require(_0xb47c('0x6'));var rimraf=require('rimraf');var config=require(_0xb47c('0x7'));var attributes=require(_0xb47c('0x8'));module[_0xb47c('0x9')]=function(_0x5d2ae1,_0x50f0a1){return _0x5d2ae1[_0xb47c('0xa')]('Integration',attributes,{'tableName':_0xb47c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 5bfdba9..a888952 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 _0xe6ad=['request','then','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe6ad,0x1af));var _0xde6a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe6ad[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xde6a('0x0'));var util=require('util');var moment=require(_0xde6a('0x1'));var BPromise=require(_0xde6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde6a('0x3'));var db=require(_0xde6a('0x4'))['db'];var utils=require(_0xde6a('0x5'));var logger=require('../../config/logger')(_0xde6a('0x6'));var config=require(_0xde6a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xde6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d7a36,_0x4ac737,_0x139292){return new BPromise(function(_0x2cfb7e,_0x58a1de){return client[_0xde6a('0x9')](_0x1d7a36,_0x139292)[_0xde6a('0xa')](function(_0x4fcc61){logger['info']('Integration,\x20%s,\x20%s',_0x4ac737,_0xde6a('0xb'));logger[_0xde6a('0xc')](_0xde6a('0xd'),_0x4ac737,_0xde6a('0xb'),JSON[_0xde6a('0xe')](_0x4fcc61));if(_0x4fcc61[_0xde6a('0xf')]){if(_0x4fcc61['error']['code']===0x1f4){logger[_0xde6a('0xf')](_0xde6a('0x10'),_0x4ac737,_0x4fcc61[_0xde6a('0xf')]['message']);return _0x58a1de(_0x4fcc61[_0xde6a('0xf')][_0xde6a('0x11')]);}logger[_0xde6a('0xf')](_0xde6a('0x10'),_0x4ac737,_0x4fcc61[_0xde6a('0xf')][_0xde6a('0x11')]);return _0x2cfb7e(_0x4fcc61['error'][_0xde6a('0x11')]);}else{logger[_0xde6a('0x12')](_0xde6a('0x10'),_0x4ac737,_0xde6a('0xb'));_0x2cfb7e(_0x4fcc61[_0xde6a('0x13')]['message']);}})['catch'](function(_0x84b73d){logger[_0xde6a('0xf')](_0xde6a('0x10'),_0x4ac737,_0x84b73d);_0x58a1de(_0x84b73d);});});} \ No newline at end of file +var _0xea28=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s'];(function(_0x30005c,_0x2cfb8c){var _0x475737=function(_0x22e01f){while(--_0x22e01f){_0x30005c['push'](_0x30005c['shift']());}};_0x475737(++_0x2cfb8c);}(_0xea28,0x1aa));var _0x8ea2=function(_0x23d44e,_0x4de9cc){_0x23d44e=_0x23d44e-0x0;var _0x2d3b1e=_0xea28[_0x23d44e];return _0x2d3b1e;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ea2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8ea2('0x4'));var logger=require(_0x8ea2('0x5'))(_0x8ea2('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ea2('0x7'));var client=jayson[_0x8ea2('0x8')][_0x8ea2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19e4c6,_0x540c0c,_0x36ca2c){return new BPromise(function(_0x109daa,_0x35f27a){return client[_0x8ea2('0xa')](_0x19e4c6,_0x36ca2c)[_0x8ea2('0xb')](function(_0x495f38){logger[_0x8ea2('0xc')](_0x8ea2('0xd'),_0x540c0c,_0x8ea2('0xe'));logger[_0x8ea2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x540c0c,'request\x20sent',JSON[_0x8ea2('0x10')](_0x495f38));if(_0x495f38[_0x8ea2('0x11')]){if(_0x495f38['error'][_0x8ea2('0x12')]===0x1f4){logger[_0x8ea2('0x11')](_0x8ea2('0xd'),_0x540c0c,_0x495f38[_0x8ea2('0x11')]['message']);return _0x35f27a(_0x495f38[_0x8ea2('0x11')][_0x8ea2('0x13')]);}logger['error'](_0x8ea2('0xd'),_0x540c0c,_0x495f38[_0x8ea2('0x11')]['message']);return _0x109daa(_0x495f38['error'][_0x8ea2('0x13')]);}else{logger['info']('Integration,\x20%s,\x20%s',_0x540c0c,'request\x20sent');_0x109daa(_0x495f38[_0x8ea2('0x14')][_0x8ea2('0x13')]);}})[_0x8ea2('0x15')](function(_0x357e7c){logger[_0x8ea2('0x11')](_0x8ea2('0xd'),_0x540c0c,_0x357e7c);_0x35f27a(_0x357e7c);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2d80035..57d7d4a 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 _0x84ed=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x535f43,_0x59611f){var _0x34b84a=function(_0x4a3730){while(--_0x4a3730){_0x535f43['push'](_0x535f43['shift']());}};_0x34b84a(++_0x59611f);}(_0x84ed,0x1bc));var _0xd84e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x84ed[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xd84e('0x0'));var util=require(_0xd84e('0x1'));var path=require(_0xd84e('0x2'));var timeout=require(_0xd84e('0x3'));var express=require(_0xd84e('0x4'));var router=express[_0xd84e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd84e('0x6'));var config=require(_0xd84e('0x7'));var controller=require('./integrationReport.controller');router[_0xd84e('0x8')]('/',auth[_0xd84e('0x9')](),controller['index']);router[_0xd84e('0x8')](_0xd84e('0xa'),auth[_0xd84e('0x9')](),controller['describe']);router[_0xd84e('0x8')](_0xd84e('0xb'),auth[_0xd84e('0x9')](),controller[_0xd84e('0xc')]);router[_0xd84e('0xd')]('/',auth[_0xd84e('0x9')](),controller[_0xd84e('0xe')]);router[_0xd84e('0xf')](_0xd84e('0xb'),auth[_0xd84e('0x9')](),controller[_0xd84e('0x10')]);router['delete'](_0xd84e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd84e('0x11')]=router; \ No newline at end of file +var _0x9d6a=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','delete'];(function(_0x24d04d,_0x4da407){var _0x4f8529=function(_0x22314f){while(--_0x22314f){_0x24d04d['push'](_0x24d04d['shift']());}};_0x4f8529(++_0x4da407);}(_0x9d6a,0x1d0));var _0xa9d6=function(_0x533774,_0x1ed00c){_0x533774=_0x533774-0x0;var _0x2590ca=_0x9d6a[_0x533774];return _0x2590ca;};'use strict';var multer=require(_0xa9d6('0x0'));var util=require(_0xa9d6('0x1'));var path=require(_0xa9d6('0x2'));var timeout=require(_0xa9d6('0x3'));var express=require(_0xa9d6('0x4'));var router=express['Router']();var auth=require(_0xa9d6('0x5'));var interaction=require(_0xa9d6('0x6'));var config=require(_0xa9d6('0x7'));var controller=require(_0xa9d6('0x8'));router[_0xa9d6('0x9')]('/',auth['isAuthenticated'](),controller[_0xa9d6('0xa')]);router[_0xa9d6('0x9')](_0xa9d6('0xb'),auth[_0xa9d6('0xc')](),controller[_0xa9d6('0xd')]);router[_0xa9d6('0x9')](_0xa9d6('0xe'),auth['isAuthenticated'](),controller[_0xa9d6('0xf')]);router[_0xa9d6('0x10')]('/',auth[_0xa9d6('0xc')](),controller[_0xa9d6('0x11')]);router['put'](_0xa9d6('0xe'),auth[_0xa9d6('0xc')](),controller['update']);router[_0xa9d6('0x12')](_0xa9d6('0xe'),auth[_0xa9d6('0xc')](),controller[_0xa9d6('0x13')]);module[_0xa9d6('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 20af2cb..bbd5feb 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 _0xf3d3=['BOOLEAN','TEXT','ENUM','SENT','SENDING','sequelize','STRING','INTEGER','DATE'];(function(_0x1b5da8,_0x444cc1){var _0x98289c=function(_0x22f2e7){while(--_0x22f2e7){_0x1b5da8['push'](_0x1b5da8['shift']());}};_0x98289c(++_0x444cc1);}(_0xf3d3,0xdd));var _0x3f3d=function(_0x352ee8,_0x3b8f7b){_0x352ee8=_0x352ee8-0x0;var _0x52ea89=_0xf3d3[_0x352ee8];return _0x52ea89;};'use strict';var Sequelize=require(_0x3f3d('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x3f3d('0x1')]},'exitStatus':{'type':Sequelize[_0x3f3d('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x3f3d('0x2')]},'contacts':{'type':Sequelize[_0x3f3d('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3f3d('0x1')]},'calleridname':{'type':Sequelize[_0x3f3d('0x1')]},'queue':{'type':Sequelize[_0x3f3d('0x1')]},'interface':{'type':Sequelize[_0x3f3d('0x1')]},'membername':{'type':Sequelize[_0x3f3d('0x1')]},'agentcalledAt':{'type':Sequelize[_0x3f3d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3f3d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x3f3d('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3f3d('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x3f3d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x3f3d('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3f3d('0x3')]},'agentdump':{'type':Sequelize[_0x3f3d('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3f3d('0x3')]},'lastevent':{'type':Sequelize[_0x3f3d('0x1')]},'channel':{'type':Sequelize[_0x3f3d('0x1')]},'channelstate':{'type':Sequelize[_0x3f3d('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3f3d('0x1')]},'connectedlinename':{'type':Sequelize[_0x3f3d('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3f3d('0x1')]},'context':{'type':Sequelize[_0x3f3d('0x1')]},'exten':{'type':Sequelize[_0x3f3d('0x1')]},'priority':{'type':Sequelize[_0x3f3d('0x1')]},'destchannel':{'type':Sequelize[_0x3f3d('0x1')]},'destchannelstate':{'type':Sequelize[_0x3f3d('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x3f3d('0x1')]},'destcalleridname':{'type':Sequelize[_0x3f3d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x3f3d('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3f3d('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x3f3d('0x1')]},'destexten':{'type':Sequelize[_0x3f3d('0x1')]},'destpriority':{'type':Sequelize[_0x3f3d('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x3f3d('0x1')]},'subject':{'type':Sequelize[_0x3f3d('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x3f3d('0x1')]},'cc':{'type':Sequelize[_0x3f3d('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x3f3d('0x5')]},'text':{'type':Sequelize[_0x3f3d('0x5')]},'status':{'type':Sequelize[_0x3f3d('0x6')](_0x3f3d('0x7'),_0x3f3d('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x3f3d('0x1')]},'app':{'type':Sequelize[_0x3f3d('0x1')]},'appdata':{'type':Sequelize[_0x3f3d('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8a2c=['BOOLEAN','DATE','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x4d6ff2,_0x4e7630){var _0x4f1fe8=function(_0x23e75e){while(--_0x23e75e){_0x4d6ff2['push'](_0x4d6ff2['shift']());}};_0x4f1fe8(++_0x4e7630);}(_0x8a2c,0x140));var _0xc8a2=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x8a2c[_0x403c20];return _0x2b271a;};'use strict';var Sequelize=require(_0xc8a2('0x0'));module[_0xc8a2('0x1')]={'integration':{'type':Sequelize[_0xc8a2('0x2')]},'eventChannel':{'type':Sequelize[_0xc8a2('0x2')]},'exitStatus':{'type':Sequelize[_0xc8a2('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xc8a2('0x3')]},'contacts':{'type':Sequelize[_0xc8a2('0x2')]},'uniqueid':{'type':Sequelize[_0xc8a2('0x2')]},'calleridnum':{'type':Sequelize[_0xc8a2('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc8a2('0x2')]},'interface':{'type':Sequelize[_0xc8a2('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xc8a2('0x3')]},'agentcomplete':{'type':Sequelize[_0xc8a2('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc8a2('0x5')]},'talktime':{'type':Sequelize[_0xc8a2('0x3')]},'agentacw':{'type':Sequelize[_0xc8a2('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc8a2('0x3')]},'reason':{'type':Sequelize[_0xc8a2('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc8a2('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc8a2('0x5')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc8a2('0x5')]},'lastevent':{'type':Sequelize[_0xc8a2('0x2')]},'channel':{'type':Sequelize[_0xc8a2('0x2')]},'channelstate':{'type':Sequelize[_0xc8a2('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc8a2('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc8a2('0x2')]},'connectedlinename':{'type':Sequelize[_0xc8a2('0x2')]},'language':{'type':Sequelize[_0xc8a2('0x2')]},'accountcode':{'type':Sequelize[_0xc8a2('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc8a2('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc8a2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xc8a2('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc8a2('0x2')]},'destcalleridname':{'type':Sequelize[_0xc8a2('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc8a2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc8a2('0x2')]},'destlanguage':{'type':Sequelize[_0xc8a2('0x2')]},'destaccountcode':{'type':Sequelize[_0xc8a2('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc8a2('0x2')]},'messageId':{'type':Sequelize[_0xc8a2('0x2')]},'inReplyTo':{'type':Sequelize[_0xc8a2('0x2')]},'subject':{'type':Sequelize[_0xc8a2('0x2')]},'from':{'type':Sequelize[_0xc8a2('0x2')]},'to':{'type':Sequelize[_0xc8a2('0x2')]},'cc':{'type':Sequelize[_0xc8a2('0x2')]},'attachment':{'type':Sequelize[_0xc8a2('0x6')]},'html':{'type':Sequelize[_0xc8a2('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xc8a2('0x7')](_0xc8a2('0x8'),_0xc8a2('0x9'),_0xc8a2('0xa'),_0xc8a2('0xb'))},'url':{'type':Sequelize[_0xc8a2('0x2')]},'app':{'type':Sequelize[_0xc8a2('0x2')]},'appdata':{'type':Sequelize[_0xc8a2('0x2')]},'projectId':{'type':Sequelize[_0xc8a2('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 2666359..ec25a1c 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 _0x61a1=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','IntegrationReport','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0x5a8f2d,_0x219dfd){var _0x2dc1eb=function(_0x139290){while(--_0x139290){_0x5a8f2d['push'](_0x5a8f2d['shift']());}};_0x2dc1eb(++_0x219dfd);}(_0x61a1,0x127));var _0x161a=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x61a1[_0x367a3d];return _0x460539;};'use strict';var pdf=require(_0x161a('0x0'));var emlformat=require(_0x161a('0x1'));var rimraf=require(_0x161a('0x2'));var zipdir=require(_0x161a('0x3'));var jsonpatch=require(_0x161a('0x4'));var rp=require('request-promise');var moment=require(_0x161a('0x5'));var BPromise=require(_0x161a('0x6'));var Mustache=require('mustache');var util=require(_0x161a('0x7'));var path=require(_0x161a('0x8'));var sox=require(_0x161a('0x9'));var csv=require(_0x161a('0xa'));var ejs=require(_0x161a('0xb'));var fs=require('fs');var _=require(_0x161a('0xc'));var squel=require(_0x161a('0xd'));var crypto=require(_0x161a('0xe'));var jsforce=require(_0x161a('0xf'));var deskjs=require(_0x161a('0x10'));var toCsv=require(_0x161a('0xa'));var querystring=require(_0x161a('0x11'));var Papa=require(_0x161a('0x12'));var Redis=require(_0x161a('0x13'));var authService=require(_0x161a('0x14'));var qs=require(_0x161a('0x15'));var hardwareService=require(_0x161a('0x16'));var logger=require(_0x161a('0x17'))(_0x161a('0x18'));var utils=require(_0x161a('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564206,_0x5eaf61){_0x5eaf61=_0x5eaf61||0xcc;return function(_0x561e37){if(_0x561e37){return _0x564206[_0x161a('0x1a')](_0x5eaf61);}return _0x564206[_0x161a('0x1b')](_0x5eaf61)[_0x161a('0x1c')]();};}function respondWithResult(_0x17cf0d,_0x46fcf7){_0x46fcf7=_0x46fcf7||0xc8;return function(_0x2f6a2c){if(_0x2f6a2c){return _0x17cf0d[_0x161a('0x1b')](_0x46fcf7)['json'](_0x2f6a2c);}};}function respondWithFilteredResult(_0x58b391,_0x559ec5){return function(_0x2b2a3e){if(_0x2b2a3e){var _0x42eebf=_0x2b2a3e['count'],_0x4cbdb3=_0x559ec5[_0x161a('0x1d')],_0x359ccd=_0x559ec5[_0x161a('0x1d')]+_0x559ec5[_0x161a('0x1e')],_0x32b1a3;if(_0x359ccd>=_0x42eebf){_0x359ccd=_0x42eebf;_0x32b1a3=0xc8;}else{_0x32b1a3=0xce;}_0x58b391[_0x161a('0x1b')](_0x32b1a3);return _0x58b391[_0x161a('0x1f')](_0x161a('0x20'),_0x4cbdb3+'-'+_0x359ccd+'/'+_0x42eebf)[_0x161a('0x21')](_0x2b2a3e);}return null;};}function patchUpdates(_0x1491fa){return function(_0x2a54af){try{jsonpatch[_0x161a('0x22')](_0x2a54af,_0x1491fa,!![]);}catch(_0x4118fe){return BPromise[_0x161a('0x23')](_0x4118fe);}return _0x2a54af[_0x161a('0x24')]();};}function saveUpdates(_0x54bec4,_0x25b8ae){return function(_0x172488){if(_0x172488){return _0x172488[_0x161a('0x25')](_0x54bec4)[_0x161a('0x26')](function(_0x1d14b0){return _0x1d14b0;});}return null;};}function removeEntity(_0x264331,_0x1adf3c){return function(_0x79e925){if(_0x79e925){return _0x79e925[_0x161a('0x27')]()[_0x161a('0x26')](function(){_0x264331['status'](0xcc)[_0x161a('0x1c')]();});}};}function handleEntityNotFound(_0x4bd93e,_0x40aedb){return function(_0x2e7a46){if(!_0x2e7a46){_0x4bd93e['sendStatus'](0x194);}return _0x2e7a46;};}function handleError(_0x1b4937,_0x35b3a1){_0x35b3a1=_0x35b3a1||0x1f4;return function(_0x46695c){logger[_0x161a('0x28')](_0x46695c[_0x161a('0x29')]);if(_0x46695c[_0x161a('0x2a')]){delete _0x46695c[_0x161a('0x2a')];}_0x1b4937[_0x161a('0x1b')](_0x35b3a1)['send'](_0x46695c);};}exports[_0x161a('0x2b')]=function(_0x1b10b0,_0x4cf3f4){var _0x4be3ca={},_0x46a1e1={},_0x3b5779={'count':0x0,'rows':[]};var _0x49f7a1=db[_0x161a('0x2c')]['rawAttributes'];_0x46a1e1['model']=_[_0x161a('0x2d')](_0x49f7a1);_0x46a1e1[_0x161a('0x2e')]=_[_0x161a('0x2d')](_0x1b10b0[_0x161a('0x2e')]);_0x46a1e1[_0x161a('0x2f')]=_[_0x161a('0x30')](_0x46a1e1[_0x161a('0x31')],_0x46a1e1['query']);_0x4be3ca[_0x161a('0x32')]=_[_0x161a('0x30')](_0x46a1e1[_0x161a('0x31')],qs[_0x161a('0x33')](_0x1b10b0['query']['fields']));_0x4be3ca[_0x161a('0x32')]=_0x4be3ca[_0x161a('0x32')][_0x161a('0x34')]?_0x4be3ca[_0x161a('0x32')]:_0x46a1e1[_0x161a('0x31')];if(!_0x1b10b0[_0x161a('0x2e')][_0x161a('0x35')](_0x161a('0x36'))){_0x4be3ca['limit']=qs[_0x161a('0x1e')](_0x1b10b0[_0x161a('0x2e')][_0x161a('0x1e')]);_0x4be3ca[_0x161a('0x1d')]=qs['offset'](_0x1b10b0[_0x161a('0x2e')][_0x161a('0x1d')]);}_0x4be3ca[_0x161a('0x37')]=qs[_0x161a('0x38')](_0x1b10b0[_0x161a('0x2e')][_0x161a('0x38')]);_0x4be3ca[_0x161a('0x39')]=qs[_0x161a('0x2f')](_['pick'](_0x1b10b0[_0x161a('0x2e')],_0x46a1e1[_0x161a('0x2f')]));if(_0x1b10b0[_0x161a('0x2e')][_0x161a('0x3a')]){_0x4be3ca['where']=_[_0x161a('0x3b')](_0x4be3ca[_0x161a('0x39')],{'$or':_['map'](_0x49f7a1,function(_0x3401da){if(_0x3401da[_0x161a('0x3c')]['key']!==_0x161a('0x3d')){var _0x2005c0={};_0x2005c0[_0x3401da[_0x161a('0x3e')]]={'$like':'%'+_0x1b10b0[_0x161a('0x2e')][_0x161a('0x3a')]+'%'};return _0x2005c0;}})});}_0x4be3ca=_[_0x161a('0x3b')]({},_0x4be3ca,_0x1b10b0[_0x161a('0x3f')]);var _0x10d28f={'where':_0x4be3ca[_0x161a('0x39')]};return db[_0x161a('0x2c')][_0x161a('0x40')](_0x10d28f)[_0x161a('0x26')](function(_0x725f38){_0x3b5779[_0x161a('0x40')]=_0x725f38;if(_0x1b10b0[_0x161a('0x2e')][_0x161a('0x41')]){_0x4be3ca[_0x161a('0x42')]=[{'all':!![]}];}return db[_0x161a('0x2c')][_0x161a('0x43')](_0x4be3ca);})[_0x161a('0x26')](function(_0x4708fb){_0x3b5779['rows']=_0x4708fb;return _0x3b5779;})[_0x161a('0x26')](respondWithFilteredResult(_0x4cf3f4,_0x4be3ca))[_0x161a('0x44')](handleError(_0x4cf3f4,null));};exports[_0x161a('0x45')]=function(_0x2eaea6,_0x5380dc){var _0x1808ae={'raw':![],'where':{'id':_0x2eaea6[_0x161a('0x46')]['id']}},_0x42a198={};_0x42a198['model']=_['keys'](db['IntegrationReport'][_0x161a('0x47')]);_0x42a198[_0x161a('0x2e')]=_[_0x161a('0x2d')](_0x2eaea6['query']);_0x42a198[_0x161a('0x2f')]=_['intersection'](_0x42a198['model'],_0x42a198['query']);_0x1808ae[_0x161a('0x32')]=_[_0x161a('0x30')](_0x42a198['model'],qs[_0x161a('0x33')](_0x2eaea6[_0x161a('0x2e')][_0x161a('0x33')]));_0x1808ae[_0x161a('0x32')]=_0x1808ae['attributes'][_0x161a('0x34')]?_0x1808ae[_0x161a('0x32')]:_0x42a198[_0x161a('0x31')];if(_0x2eaea6['query'][_0x161a('0x41')]){_0x1808ae['include']=[{'all':!![]}];}_0x1808ae=_[_0x161a('0x3b')]({},_0x1808ae,_0x2eaea6[_0x161a('0x3f')]);return db[_0x161a('0x2c')][_0x161a('0x48')](_0x1808ae)[_0x161a('0x26')](handleEntityNotFound(_0x5380dc,null))[_0x161a('0x26')](respondWithResult(_0x5380dc,null))[_0x161a('0x44')](handleError(_0x5380dc,null));};exports[_0x161a('0x49')]=function(_0x4df71f,_0x213c91){return db[_0x161a('0x2c')][_0x161a('0x49')](_0x4df71f[_0x161a('0x4a')],{})['then'](respondWithResult(_0x213c91,0xc9))[_0x161a('0x44')](handleError(_0x213c91,null));};exports[_0x161a('0x25')]=function(_0x29429e,_0xf0b61b){if(_0x29429e[_0x161a('0x4a')]['id']){delete _0x29429e['body']['id'];}return db[_0x161a('0x2c')]['find']({'where':{'id':_0x29429e[_0x161a('0x46')]['id']}})[_0x161a('0x26')](handleEntityNotFound(_0xf0b61b,null))[_0x161a('0x26')](saveUpdates(_0x29429e[_0x161a('0x4a')],null))[_0x161a('0x26')](respondWithResult(_0xf0b61b,null))['catch'](handleError(_0xf0b61b,null));};exports['destroy']=function(_0x1b744a,_0x24f920){return db['IntegrationReport'][_0x161a('0x48')]({'where':{'id':_0x1b744a[_0x161a('0x46')]['id']}})['then'](handleEntityNotFound(_0x24f920,null))[_0x161a('0x26')](removeEntity(_0x24f920,null))[_0x161a('0x44')](handleError(_0x24f920,null));};exports[_0x161a('0x4b')]=function(_0x251be0,_0x3e8156){return db['IntegrationReport']['describe']()[_0x161a('0x26')](respondWithResult(_0x3e8156,null))['catch'](handleError(_0x3e8156,null));}; \ No newline at end of file +var _0x9330=['reject','save','then','destroy','sendStatus','error','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','IntegrationReport','includeAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','end','status','count','offset','set','Content-Range','json','apply'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9330,0x14a));var _0x0933=function(_0x84cd55,_0x3708fe){_0x84cd55=_0x84cd55-0x0;var _0x352099=_0x9330[_0x84cd55];return _0x352099;};'use strict';var pdf=require(_0x0933('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0933('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0933('0x2'));var BPromise=require(_0x0933('0x3'));var Mustache=require(_0x0933('0x4'));var util=require(_0x0933('0x5'));var path=require(_0x0933('0x6'));var sox=require(_0x0933('0x7'));var csv=require(_0x0933('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0933('0x9'));var squel=require(_0x0933('0xa'));var crypto=require(_0x0933('0xb'));var jsforce=require(_0x0933('0xc'));var deskjs=require(_0x0933('0xd'));var toCsv=require(_0x0933('0x8'));var querystring=require(_0x0933('0xe'));var Papa=require(_0x0933('0xf'));var Redis=require(_0x0933('0x10'));var authService=require(_0x0933('0x11'));var qs=require(_0x0933('0x12'));var hardwareService=require(_0x0933('0x13'));var logger=require(_0x0933('0x14'))(_0x0933('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x566a2d,_0x2ea2d3){_0x2ea2d3=_0x2ea2d3||0xcc;return function(_0x4b5927){if(_0x4b5927){return _0x566a2d['sendStatus'](_0x2ea2d3);}return _0x566a2d['status'](_0x2ea2d3)[_0x0933('0x16')]();};}function respondWithResult(_0x36fe3c,_0x5b9fab){_0x5b9fab=_0x5b9fab||0xc8;return function(_0x2ec08f){if(_0x2ec08f){return _0x36fe3c[_0x0933('0x17')](_0x5b9fab)['json'](_0x2ec08f);}};}function respondWithFilteredResult(_0x54bdd4,_0x1ab5f7){return function(_0xb019db){if(_0xb019db){var _0x52144e=_0xb019db[_0x0933('0x18')],_0x14b507=_0x1ab5f7[_0x0933('0x19')],_0x15672a=_0x1ab5f7[_0x0933('0x19')]+_0x1ab5f7['limit'],_0x144e4c;if(_0x15672a>=_0x52144e){_0x15672a=_0x52144e;_0x144e4c=0xc8;}else{_0x144e4c=0xce;}_0x54bdd4['status'](_0x144e4c);return _0x54bdd4[_0x0933('0x1a')](_0x0933('0x1b'),_0x14b507+'-'+_0x15672a+'/'+_0x52144e)[_0x0933('0x1c')](_0xb019db);}return null;};}function patchUpdates(_0x25a03a){return function(_0x354863){try{jsonpatch[_0x0933('0x1d')](_0x354863,_0x25a03a,!![]);}catch(_0x1afd61){return BPromise[_0x0933('0x1e')](_0x1afd61);}return _0x354863[_0x0933('0x1f')]();};}function saveUpdates(_0x5d13f5,_0x488996){return function(_0x30f857){if(_0x30f857){return _0x30f857['update'](_0x5d13f5)[_0x0933('0x20')](function(_0x220511){return _0x220511;});}return null;};}function removeEntity(_0x4899cc,_0x1d7bf8){return function(_0x28e7fe){if(_0x28e7fe){return _0x28e7fe[_0x0933('0x21')]()['then'](function(){_0x4899cc[_0x0933('0x17')](0xcc)[_0x0933('0x16')]();});}};}function handleEntityNotFound(_0x4374bf,_0x59d08c){return function(_0x4ff665){if(!_0x4ff665){_0x4374bf[_0x0933('0x22')](0x194);}return _0x4ff665;};}function handleError(_0x1ee8f6,_0x3b1e89){_0x3b1e89=_0x3b1e89||0x1f4;return function(_0x17d090){logger[_0x0933('0x23')](_0x17d090['stack']);if(_0x17d090[_0x0933('0x24')]){delete _0x17d090[_0x0933('0x24')];}_0x1ee8f6[_0x0933('0x17')](_0x3b1e89)[_0x0933('0x25')](_0x17d090);};}exports[_0x0933('0x26')]=function(_0x23b187,_0x54b9e4){var _0x466480={},_0x1de5c6={},_0x21a04c={'count':0x0,'rows':[]};var _0x45cd29=db['IntegrationReport'][_0x0933('0x27')];_0x1de5c6[_0x0933('0x28')]=_['keys'](_0x45cd29);_0x1de5c6[_0x0933('0x29')]=_[_0x0933('0x2a')](_0x23b187[_0x0933('0x29')]);_0x1de5c6[_0x0933('0x2b')]=_[_0x0933('0x2c')](_0x1de5c6[_0x0933('0x28')],_0x1de5c6['query']);_0x466480[_0x0933('0x2d')]=_[_0x0933('0x2c')](_0x1de5c6[_0x0933('0x28')],qs[_0x0933('0x2e')](_0x23b187[_0x0933('0x29')]['fields']));_0x466480[_0x0933('0x2d')]=_0x466480[_0x0933('0x2d')][_0x0933('0x2f')]?_0x466480[_0x0933('0x2d')]:_0x1de5c6['model'];if(!_0x23b187['query'][_0x0933('0x30')](_0x0933('0x31'))){_0x466480[_0x0933('0x32')]=qs[_0x0933('0x32')](_0x23b187[_0x0933('0x29')]['limit']);_0x466480['offset']=qs['offset'](_0x23b187[_0x0933('0x29')][_0x0933('0x19')]);}_0x466480['order']=qs[_0x0933('0x33')](_0x23b187[_0x0933('0x29')][_0x0933('0x33')]);_0x466480[_0x0933('0x34')]=qs[_0x0933('0x2b')](_[_0x0933('0x35')](_0x23b187[_0x0933('0x29')],_0x1de5c6[_0x0933('0x2b')]));if(_0x23b187['query']['filter']){_0x466480['where']=_['merge'](_0x466480[_0x0933('0x34')],{'$or':_[_0x0933('0x36')](_0x45cd29,function(_0x306f49){if(_0x306f49[_0x0933('0x37')][_0x0933('0x38')]!==_0x0933('0x39')){var _0x39f16e={};_0x39f16e[_0x306f49[_0x0933('0x3a')]]={'$like':'%'+_0x23b187[_0x0933('0x29')][_0x0933('0x3b')]+'%'};return _0x39f16e;}})});}_0x466480=_[_0x0933('0x3c')]({},_0x466480,_0x23b187['options']);var _0x5b46db={'where':_0x466480[_0x0933('0x34')]};return db[_0x0933('0x3d')][_0x0933('0x18')](_0x5b46db)[_0x0933('0x20')](function(_0x46a50f){_0x21a04c[_0x0933('0x18')]=_0x46a50f;if(_0x23b187[_0x0933('0x29')][_0x0933('0x3e')]){_0x466480['include']=[{'all':!![]}];}return db[_0x0933('0x3d')]['findAll'](_0x466480);})[_0x0933('0x20')](function(_0x432924){_0x21a04c[_0x0933('0x3f')]=_0x432924;return _0x21a04c;})[_0x0933('0x20')](respondWithFilteredResult(_0x54b9e4,_0x466480))[_0x0933('0x40')](handleError(_0x54b9e4,null));};exports[_0x0933('0x41')]=function(_0x32b0b2,_0x34266a){var _0x50396b={'raw':![],'where':{'id':_0x32b0b2[_0x0933('0x42')]['id']}},_0x167e69={};_0x167e69[_0x0933('0x28')]=_[_0x0933('0x2a')](db[_0x0933('0x3d')][_0x0933('0x27')]);_0x167e69[_0x0933('0x29')]=_['keys'](_0x32b0b2[_0x0933('0x29')]);_0x167e69[_0x0933('0x2b')]=_[_0x0933('0x2c')](_0x167e69['model'],_0x167e69['query']);_0x50396b[_0x0933('0x2d')]=_[_0x0933('0x2c')](_0x167e69[_0x0933('0x28')],qs['fields'](_0x32b0b2[_0x0933('0x29')][_0x0933('0x2e')]));_0x50396b[_0x0933('0x2d')]=_0x50396b[_0x0933('0x2d')][_0x0933('0x2f')]?_0x50396b[_0x0933('0x2d')]:_0x167e69['model'];if(_0x32b0b2['query'][_0x0933('0x3e')]){_0x50396b[_0x0933('0x43')]=[{'all':!![]}];}_0x50396b=_['merge']({},_0x50396b,_0x32b0b2['options']);return db[_0x0933('0x3d')][_0x0933('0x44')](_0x50396b)[_0x0933('0x20')](handleEntityNotFound(_0x34266a,null))[_0x0933('0x20')](respondWithResult(_0x34266a,null))[_0x0933('0x40')](handleError(_0x34266a,null));};exports[_0x0933('0x45')]=function(_0x11393a,_0x2b01d8){return db[_0x0933('0x3d')][_0x0933('0x45')](_0x11393a['body'],{})[_0x0933('0x20')](respondWithResult(_0x2b01d8,0xc9))[_0x0933('0x40')](handleError(_0x2b01d8,null));};exports['update']=function(_0x5dcaf1,_0xb7ab32){if(_0x5dcaf1[_0x0933('0x46')]['id']){delete _0x5dcaf1[_0x0933('0x46')]['id'];}return db[_0x0933('0x3d')][_0x0933('0x44')]({'where':{'id':_0x5dcaf1[_0x0933('0x42')]['id']}})[_0x0933('0x20')](handleEntityNotFound(_0xb7ab32,null))[_0x0933('0x20')](saveUpdates(_0x5dcaf1['body'],null))['then'](respondWithResult(_0xb7ab32,null))['catch'](handleError(_0xb7ab32,null));};exports[_0x0933('0x21')]=function(_0x5b48c4,_0x84e80){return db[_0x0933('0x3d')]['find']({'where':{'id':_0x5b48c4[_0x0933('0x42')]['id']}})[_0x0933('0x20')](handleEntityNotFound(_0x84e80,null))['then'](removeEntity(_0x84e80,null))[_0x0933('0x40')](handleError(_0x84e80,null));};exports[_0x0933('0x47')]=function(_0x20eb62,_0x17a98e){return db[_0x0933('0x3d')][_0x0933('0x47')]()[_0x0933('0x20')](respondWithResult(_0x17a98e,null))[_0x0933('0x40')](handleError(_0x17a98e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index dfedbad..068b742 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 _0x0faf=['path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d3ddd,_0x59b504){var _0x52a4f9=function(_0x349a69){while(--_0x349a69){_0x3d3ddd['push'](_0x3d3ddd['shift']());}};_0x52a4f9(++_0x59b504);}(_0x0faf,0x132));var _0xf0fa=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x0faf[_0x1a8ff0];return _0x3588bf;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var BPromise=require(_0xf0fa('0x4'));var rp=require(_0xf0fa('0x5'));var fs=require('fs');var path=require(_0xf0fa('0x6'));var rimraf=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var attributes=require(_0xf0fa('0x9'));module['exports']=function(_0x3637a3,_0x44ffa0){return _0x3637a3[_0xf0fa('0xa')](_0xf0fa('0xb'),attributes,{'tableName':_0xf0fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa751=['report_integration','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','IntegrationReport'];(function(_0x4a0f60,_0x298c30){var _0x59b579=function(_0x28e479){while(--_0x28e479){_0x4a0f60['push'](_0x4a0f60['shift']());}};_0x59b579(++_0x298c30);}(_0xa751,0x175));var _0x1a75=function(_0x346186,_0x2f448e){_0x346186=_0x346186-0x0;var _0xe830f8=_0xa751[_0x346186];return _0xe830f8;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var logger=require(_0x1a75('0x2'))(_0x1a75('0x3'));var moment=require('moment');var BPromise=require(_0x1a75('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a75('0x5'));var rimraf=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var attributes=require('./integrationReport.attributes');module[_0x1a75('0x8')]=function(_0x220b14,_0x1719c1){return _0x220b14[_0x1a75('0x9')](_0x1a75('0xa'),attributes,{'tableName':_0x1a75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 3c7285b..f459025 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 _0x563e=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x3a41e1,_0x32a1da){var _0x50a35d=function(_0x13ced2){while(--_0x13ced2){_0x3a41e1['push'](_0x3a41e1['shift']());}};_0x50a35d(++_0x32a1da);}(_0x563e,0x1cb));var _0xe563=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x563e[_0x4cbf20];return _0x582ae4;};'use strict';var _=require(_0xe563('0x0'));var util=require(_0xe563('0x1'));var moment=require(_0xe563('0x2'));var BPromise=require(_0xe563('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe563('0x4'));var db=require(_0xe563('0x5'))['db'];var utils=require(_0xe563('0x6'));var logger=require('../../config/logger')(_0xe563('0x7'));var config=require(_0xe563('0x8'));var jayson=require(_0xe563('0x9'));var client=jayson['client'][_0xe563('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa6760,_0x4f95e5,_0x43f6f2){return new BPromise(function(_0x4cfb72,_0x4b66e5){return client[_0xe563('0xb')](_0xfa6760,_0x43f6f2)[_0xe563('0xc')](function(_0x11704a){logger['info'](_0xe563('0xd'),_0x4f95e5,_0xe563('0xe'));logger[_0xe563('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x4f95e5,_0xe563('0xe'),JSON[_0xe563('0x10')](_0x11704a));if(_0x11704a['error']){if(_0x11704a[_0xe563('0x11')][_0xe563('0x12')]===0x1f4){logger['error'](_0xe563('0xd'),_0x4f95e5,_0x11704a[_0xe563('0x11')][_0xe563('0x13')]);return _0x4b66e5(_0x11704a[_0xe563('0x11')][_0xe563('0x13')]);}logger['error'](_0xe563('0xd'),_0x4f95e5,_0x11704a[_0xe563('0x11')][_0xe563('0x13')]);return _0x4cfb72(_0x11704a[_0xe563('0x11')][_0xe563('0x13')]);}else{logger[_0xe563('0x14')](_0xe563('0xd'),_0x4f95e5,'request\x20sent');_0x4cfb72(_0x11704a[_0xe563('0x15')][_0xe563('0x13')]);}})[_0xe563('0x16')](function(_0x33f656){logger[_0xe563('0x11')]('IntegrationReport,\x20%s,\x20%s',_0x4f95e5,_0x33f656);_0x4b66e5(_0x33f656);});});} \ No newline at end of file +var _0xb524=['IntegrationReport,\x20%s,\x20%s,\x20%s','error','IntegrationReport,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x2d00e2,_0x11eae1){var _0x44798b=function(_0xd31c95){while(--_0xd31c95){_0x2d00e2['push'](_0x2d00e2['shift']());}};_0x44798b(++_0x11eae1);}(_0xb524,0xec));var _0x4b52=function(_0x4807bf,_0x272e7a){_0x4807bf=_0x4807bf-0x0;var _0x56d572=_0xb524[_0x4807bf];return _0x56d572;};'use strict';var _=require(_0x4b52('0x0'));var util=require(_0x4b52('0x1'));var moment=require(_0x4b52('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b52('0x3'));var fs=require('fs');var Redis=require(_0x4b52('0x4'));var db=require(_0x4b52('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b52('0x6'))(_0x4b52('0x7'));var config=require(_0x4b52('0x8'));var jayson=require(_0x4b52('0x9'));var client=jayson['client'][_0x4b52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x341e46,_0x14c153,_0x4ed265){return new BPromise(function(_0x27f286,_0x52e811){return client[_0x4b52('0xb')](_0x341e46,_0x4ed265)[_0x4b52('0xc')](function(_0x41abc4){logger[_0x4b52('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x14c153,_0x4b52('0xe'));logger[_0x4b52('0xf')](_0x4b52('0x10'),_0x14c153,'request\x20sent',JSON['stringify'](_0x41abc4));if(_0x41abc4[_0x4b52('0x11')]){if(_0x41abc4[_0x4b52('0x11')]['code']===0x1f4){logger[_0x4b52('0x11')](_0x4b52('0x12'),_0x14c153,_0x41abc4[_0x4b52('0x11')]['message']);return _0x52e811(_0x41abc4['error'][_0x4b52('0x13')]);}logger['error'](_0x4b52('0x12'),_0x14c153,_0x41abc4[_0x4b52('0x11')][_0x4b52('0x13')]);return _0x27f286(_0x41abc4['error'][_0x4b52('0x13')]);}else{logger[_0x4b52('0xd')](_0x4b52('0x12'),_0x14c153,_0x4b52('0xe'));_0x27f286(_0x41abc4[_0x4b52('0x14')][_0x4b52('0x13')]);}})['catch'](function(_0xfad9d){logger['error'](_0x4b52('0x12'),_0x14c153,_0xfad9d);_0x52e811(_0xfad9d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a9ef94f..da8dd32 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 _0xf8e4=['../../components/auth/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','post','create','addInterval','addIntervals','/:id','update','delete','multer','util','path','express','Router'];(function(_0x5b0af9,_0x3a45a0){var _0x9f8dcc=function(_0x23f1dd){while(--_0x23f1dd){_0x5b0af9['push'](_0x5b0af9['shift']());}};_0x9f8dcc(++_0x3a45a0);}(_0xf8e4,0xf2));var _0x4f8e=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xf8e4[_0x4b1032];return _0x5a1d55;};'use strict';var multer=require(_0x4f8e('0x0'));var util=require(_0x4f8e('0x1'));var path=require(_0x4f8e('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f8e('0x3'));var router=express[_0x4f8e('0x4')]();var auth=require(_0x4f8e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4f8e('0x6'));router[_0x4f8e('0x7')]('/',auth[_0x4f8e('0x8')](),controller[_0x4f8e('0x9')]);router['get']('/:id',auth[_0x4f8e('0x8')](),controller[_0x4f8e('0xa')]);router['get'](_0x4f8e('0xb'),auth[_0x4f8e('0x8')](),controller['getIntervals']);router[_0x4f8e('0xc')]('/',auth[_0x4f8e('0x8')](),controller[_0x4f8e('0xd')]);router[_0x4f8e('0xc')](_0x4f8e('0xb'),auth[_0x4f8e('0x8')](),controller[_0x4f8e('0xe')]);router[_0x4f8e('0xc')]('/:id/sub_intervals/create_many',auth[_0x4f8e('0x8')](),controller[_0x4f8e('0xf')]);router['put'](_0x4f8e('0x10'),auth[_0x4f8e('0x8')](),controller[_0x4f8e('0x11')]);router[_0x4f8e('0x12')](_0x4f8e('0x10'),auth[_0x4f8e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbe77=['/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./interval.controller','get','index','isAuthenticated','show'];(function(_0x56ac90,_0x1ed9d1){var _0x34d667=function(_0x18d911){while(--_0x18d911){_0x56ac90['push'](_0x56ac90['shift']());}};_0x34d667(++_0x1ed9d1);}(_0xbe77,0x9c));var _0x7be7=function(_0x1ab1be,_0x3a4dd2){_0x1ab1be=_0x1ab1be-0x0;var _0x1875f2=_0xbe77[_0x1ab1be];return _0x1875f2;};'use strict';var multer=require('multer');var util=require(_0x7be7('0x0'));var path=require(_0x7be7('0x1'));var timeout=require(_0x7be7('0x2'));var express=require(_0x7be7('0x3'));var router=express[_0x7be7('0x4')]();var auth=require(_0x7be7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7be7('0x6'));var controller=require(_0x7be7('0x7'));router[_0x7be7('0x8')]('/',auth['isAuthenticated'](),controller[_0x7be7('0x9')]);router[_0x7be7('0x8')]('/:id',auth[_0x7be7('0xa')](),controller[_0x7be7('0xb')]);router['get'](_0x7be7('0xc'),auth[_0x7be7('0xa')](),controller['getIntervals']);router[_0x7be7('0xd')]('/',auth['isAuthenticated'](),controller[_0x7be7('0xe')]);router['post'](_0x7be7('0xc'),auth[_0x7be7('0xa')](),controller[_0x7be7('0xf')]);router[_0x7be7('0xd')](_0x7be7('0x10'),auth[_0x7be7('0xa')](),controller[_0x7be7('0x11')]);router['put'](_0x7be7('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7be7('0x12'),auth[_0x7be7('0xa')](),controller[_0x7be7('0x13')]);module[_0x7be7('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 4e25861..f177d92 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 _0xf62d=['sequelize','exports','STRING'];(function(_0x5663c9,_0x49fe63){var _0x44f301=function(_0x4100f7){while(--_0x4100f7){_0x5663c9['push'](_0x5663c9['shift']());}};_0x44f301(++_0x49fe63);}(_0xf62d,0x13b));var _0xdf62=function(_0x17149c,_0x4b00a2){_0x17149c=_0x17149c-0x0;var _0x562fe4=_0xf62d[_0x17149c];return _0x562fe4;};'use strict';var Sequelize=require(_0xdf62('0x0'));module[_0xdf62('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdf62('0x2')]},'interval':{'type':Sequelize[_0xdf62('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xbeff=['STRING','sequelize'];(function(_0xfed299,_0x21b8d0){var _0x4ef1f2=function(_0x347a84){while(--_0x347a84){_0xfed299['push'](_0xfed299['shift']());}};_0x4ef1f2(++_0x21b8d0);}(_0xbeff,0x14b));var _0xfbef=function(_0xfaf3ca,_0x1a2cb8){_0xfaf3ca=_0xfaf3ca-0x0;var _0x51701a=_0xbeff[_0xfaf3ca];return _0x51701a;};'use strict';var Sequelize=require(_0xfbef('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfbef('0x1')]},'interval':{'type':Sequelize[_0xfbef('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 cabde45..454ae22 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 _0xc710=['Interval','rawAttributes','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','options','count','include','rows','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','map','sequelize','transaction','findAll','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../components/extensions/rewrite','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send'];(function(_0x564878,_0x32b7db){var _0x26e2fb=function(_0x3fa780){while(--_0x3fa780){_0x564878['push'](_0x564878['shift']());}};_0x26e2fb(++_0x32b7db);}(_0xc710,0x192));var _0x0c71=function(_0x1264bb,_0x460f43){_0x1264bb=_0x1264bb-0x0;var _0x1df1b9=_0xc710[_0x1264bb];return _0x1df1b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0c71('0x0'));var rimraf=require(_0x0c71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0c71('0x2'));var moment=require(_0x0c71('0x3'));var BPromise=require(_0x0c71('0x4'));var Mustache=require(_0x0c71('0x5'));var util=require('util');var path=require(_0x0c71('0x6'));var sox=require(_0x0c71('0x7'));var csv=require(_0x0c71('0x8'));var ejs=require(_0x0c71('0x9'));var fs=require('fs');var _=require(_0x0c71('0xa'));var squel=require(_0x0c71('0xb'));var crypto=require(_0x0c71('0xc'));var jsforce=require(_0x0c71('0xd'));var deskjs=require(_0x0c71('0xe'));var toCsv=require(_0x0c71('0x8'));var querystring=require(_0x0c71('0xf'));var Papa=require(_0x0c71('0x10'));var Redis=require(_0x0c71('0x11'));var authService=require(_0x0c71('0x12'));var qs=require(_0x0c71('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c71('0x14'))(_0x0c71('0x15'));var utils=require(_0x0c71('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var extensions=require(_0x0c71('0x17'));function respondWithStatusCode(_0x501ae5,_0x57a336){_0x57a336=_0x57a336||0xcc;return function(_0x3e8e56){if(_0x3e8e56){return _0x501ae5[_0x0c71('0x18')](_0x57a336);}return _0x501ae5[_0x0c71('0x19')](_0x57a336)[_0x0c71('0x1a')]();};}function respondWithResult(_0x1375b1,_0xaac7c0){_0xaac7c0=_0xaac7c0||0xc8;return function(_0x347961){if(_0x347961){return _0x1375b1['status'](_0xaac7c0)[_0x0c71('0x1b')](_0x347961);}};}function respondWithFilteredResult(_0x1ef3cd,_0x4a2764){return function(_0x46d55e){if(_0x46d55e){var _0x2e14f9=_0x46d55e['count'],_0x463c37=_0x4a2764[_0x0c71('0x1c')],_0x3b3c11=_0x4a2764[_0x0c71('0x1c')]+_0x4a2764[_0x0c71('0x1d')],_0x5a9b92;if(_0x3b3c11>=_0x2e14f9){_0x3b3c11=_0x2e14f9;_0x5a9b92=0xc8;}else{_0x5a9b92=0xce;}_0x1ef3cd[_0x0c71('0x19')](_0x5a9b92);return _0x1ef3cd[_0x0c71('0x1e')]('Content-Range',_0x463c37+'-'+_0x3b3c11+'/'+_0x2e14f9)[_0x0c71('0x1b')](_0x46d55e);}return null;};}function patchUpdates(_0x3a5b35){return function(_0x29d215){try{jsonpatch[_0x0c71('0x1f')](_0x29d215,_0x3a5b35,!![]);}catch(_0x3e81d9){return BPromise[_0x0c71('0x20')](_0x3e81d9);}return _0x29d215[_0x0c71('0x21')]();};}function saveUpdates(_0x18f411,_0x5b3f12){return function(_0x26a77a){if(_0x26a77a){return _0x26a77a[_0x0c71('0x22')](_0x18f411)[_0x0c71('0x23')](function(_0x5162b2){return _0x5162b2;});}return null;};}function removeEntity(_0x120501,_0x5c4a3e){return function(_0x52c164){if(_0x52c164){return _0x52c164[_0x0c71('0x24')]()[_0x0c71('0x23')](function(){var _0x1a0154=_0x52c164['get']({'plain':!![]});var _0x48f435=_0x0c71('0x25');return db[_0x0c71('0x26')][_0x0c71('0x24')]({'where':{'type':_0x48f435,'resourceId':_0x1a0154['id']}})[_0x0c71('0x23')](function(){return _0x52c164;});})[_0x0c71('0x23')](function(){_0x120501[_0x0c71('0x19')](0xcc)[_0x0c71('0x1a')]();});}};}function handleEntityNotFound(_0x3f2ef5,_0x28dd69){return function(_0x3fcfff){if(!_0x3fcfff){_0x3f2ef5['sendStatus'](0x194);}return _0x3fcfff;};}function handleError(_0x15f699,_0xa8b07f){_0xa8b07f=_0xa8b07f||0x1f4;return function(_0x389da7){logger[_0x0c71('0x27')](_0x389da7[_0x0c71('0x28')]);if(_0x389da7[_0x0c71('0x29')]){delete _0x389da7[_0x0c71('0x29')];}_0x15f699[_0x0c71('0x19')](_0xa8b07f)[_0x0c71('0x2a')](_0x389da7);};}exports['index']=function(_0xad90f6,_0xa81a40){var _0x1cd480={},_0xb4ece={},_0x32faa8={'count':0x0,'rows':[]};var _0xa78768=db[_0x0c71('0x2b')][_0x0c71('0x2c')];_0xb4ece['model']=_[_0x0c71('0x2d')](_0xa78768);_0xb4ece['query']=_[_0x0c71('0x2d')](_0xad90f6['query']);_0xb4ece['filters']=_[_0x0c71('0x2e')](_0xb4ece['model'],_0xb4ece[_0x0c71('0x2f')]);_0x1cd480[_0x0c71('0x30')]=_[_0x0c71('0x2e')](_0xb4ece[_0x0c71('0x31')],qs[_0x0c71('0x32')](_0xad90f6[_0x0c71('0x2f')]['fields']));_0x1cd480['attributes']=_0x1cd480[_0x0c71('0x30')][_0x0c71('0x33')]?_0x1cd480['attributes']:_0xb4ece[_0x0c71('0x31')];if(!_0xad90f6[_0x0c71('0x2f')][_0x0c71('0x34')](_0x0c71('0x35'))){_0x1cd480[_0x0c71('0x1d')]=qs['limit'](_0xad90f6[_0x0c71('0x2f')][_0x0c71('0x1d')]);_0x1cd480[_0x0c71('0x1c')]=qs[_0x0c71('0x1c')](_0xad90f6[_0x0c71('0x2f')][_0x0c71('0x1c')]);}_0x1cd480[_0x0c71('0x36')]=qs[_0x0c71('0x37')](_0xad90f6['query'][_0x0c71('0x37')]);_0x1cd480[_0x0c71('0x38')]=qs[_0x0c71('0x39')](_[_0x0c71('0x3a')](_0xad90f6['query'],_0xb4ece['filters']));if(_0xad90f6[_0x0c71('0x2f')][_0x0c71('0x3b')]){_0x1cd480[_0x0c71('0x38')]=_[_0x0c71('0x3c')](_0x1cd480[_0x0c71('0x38')],{'$or':_['map'](_0xa78768,function(_0x52fc24){if(_0x52fc24[_0x0c71('0x3d')]['key']!==_0x0c71('0x3e')){var _0xccaa8d={};_0xccaa8d[_0x52fc24[_0x0c71('0x3f')]]={'$like':'%'+_0xad90f6['query'][_0x0c71('0x3b')]+'%'};return _0xccaa8d;}})});}_0x1cd480=_[_0x0c71('0x3c')]({},_0x1cd480,_0xad90f6[_0x0c71('0x40')]);var _0x1c3f8e={'where':_0x1cd480[_0x0c71('0x38')]};return db['Interval'][_0x0c71('0x41')](_0x1c3f8e)[_0x0c71('0x23')](function(_0x499927){_0x32faa8[_0x0c71('0x41')]=_0x499927;if(_0xad90f6[_0x0c71('0x2f')]['includeAll']){_0x1cd480[_0x0c71('0x42')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x1cd480);})['then'](function(_0x4f4319){_0x32faa8[_0x0c71('0x43')]=_0x4f4319;return _0x32faa8;})[_0x0c71('0x23')](respondWithFilteredResult(_0xa81a40,_0x1cd480))['catch'](handleError(_0xa81a40,null));};exports[_0x0c71('0x44')]=function(_0x5e81dd,_0x1b5b4c){var _0x465ca5={'raw':!![],'where':{'id':_0x5e81dd[_0x0c71('0x45')]['id']}},_0x58ae71={};_0x58ae71[_0x0c71('0x31')]=_[_0x0c71('0x2d')](db[_0x0c71('0x2b')]['rawAttributes']);_0x58ae71['query']=_[_0x0c71('0x2d')](_0x5e81dd['query']);_0x58ae71[_0x0c71('0x39')]=_[_0x0c71('0x2e')](_0x58ae71[_0x0c71('0x31')],_0x58ae71[_0x0c71('0x2f')]);_0x465ca5[_0x0c71('0x30')]=_[_0x0c71('0x2e')](_0x58ae71[_0x0c71('0x31')],qs[_0x0c71('0x32')](_0x5e81dd[_0x0c71('0x2f')][_0x0c71('0x32')]));_0x465ca5['attributes']=_0x465ca5['attributes']['length']?_0x465ca5[_0x0c71('0x30')]:_0x58ae71[_0x0c71('0x31')];if(_0x5e81dd[_0x0c71('0x2f')]['includeAll']){_0x465ca5[_0x0c71('0x42')]=[{'all':!![]}];}_0x465ca5=_[_0x0c71('0x3c')]({},_0x465ca5,_0x5e81dd[_0x0c71('0x40')]);return db[_0x0c71('0x2b')][_0x0c71('0x46')](_0x465ca5)[_0x0c71('0x23')](handleEntityNotFound(_0x1b5b4c,null))[_0x0c71('0x23')](respondWithResult(_0x1b5b4c,null))[_0x0c71('0x47')](handleError(_0x1b5b4c,null));};exports[_0x0c71('0x48')]=function(_0xea734e,_0x2ca966){return db[_0x0c71('0x2b')]['create'](_0xea734e['body'],{})[_0x0c71('0x23')](function(_0x40a5c7){var _0x295de0=_0xea734e[_0x0c71('0x49')][_0x0c71('0x4a')]({'plain':!![]});if(!_0x295de0)throw new Error(_0x0c71('0x4b'));if(_0x295de0['role']===_0x0c71('0x49')){var _0x4ed2e8=_0x40a5c7['get']({'plain':!![]});var _0x4c632a='Intervals';return db[_0x0c71('0x4c')][_0x0c71('0x46')]({'where':{'name':_0x4c632a,'userProfileId':_0x295de0[_0x0c71('0x4d')]},'raw':!![]})['then'](function(_0x2d2667){if(_0x2d2667&&_0x2d2667[_0x0c71('0x4e')]===0x0){return db[_0x0c71('0x26')][_0x0c71('0x48')]({'name':_0x4ed2e8['name'],'resourceId':_0x4ed2e8['id'],'type':_0x2d2667['name'],'sectionId':_0x2d2667['id']},{})[_0x0c71('0x23')](function(){return _0x40a5c7;});}else{return _0x40a5c7;}})[_0x0c71('0x47')](function(_0x52856a){logger[_0x0c71('0x27')](_0x0c71('0x4f'),_0x52856a);throw _0x52856a;});}return _0x40a5c7;})['then'](respondWithResult(_0x2ca966,0xc9))[_0x0c71('0x47')](handleError(_0x2ca966,null));};exports[_0x0c71('0x22')]=function(_0x5670c1,_0x5458df){if(_0x5670c1['body']['id']){delete _0x5670c1[_0x0c71('0x50')]['id'];}return db[_0x0c71('0x2b')][_0x0c71('0x46')]({'where':{'id':_0x5670c1[_0x0c71('0x45')]['id']}})[_0x0c71('0x23')](handleEntityNotFound(_0x5458df,null))['then'](saveUpdates(_0x5670c1[_0x0c71('0x50')],null))[_0x0c71('0x23')](respondWithResult(_0x5458df,null))[_0x0c71('0x47')](handleError(_0x5458df,null));};exports[_0x0c71('0x24')]=function(_0xc644e0,_0x5814ca){return db['Interval']['find']({'where':{'id':_0xc644e0[_0x0c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x5814ca,null))['then'](removeEntity(_0x5814ca,null))[_0x0c71('0x47')](handleError(_0x5814ca,null));};exports[_0x0c71('0x51')]=function(_0x1c7a8d,_0x3021f4,_0x4814da){if(_0x1c7a8d[_0x0c71('0x50')]['id']){delete _0x1c7a8d['body']['id'];}return db[_0x0c71('0x2b')][_0x0c71('0x46')]({'where':{'id':_0x1c7a8d[_0x0c71('0x45')]['id']}})[_0x0c71('0x23')](handleEntityNotFound(_0x3021f4,null))['then'](function(_0x2663d5){if(_0x2663d5){_0x1c7a8d['body'][_0x0c71('0x52')]=_0x2663d5['id'];return db[_0x0c71('0x2b')]['create'](_0x1c7a8d[_0x0c71('0x50')]);}})[_0x0c71('0x23')](respondWithResult(_0x3021f4,null))['catch'](handleError(_0x3021f4,null));};exports[_0x0c71('0x53')]=function(_0x1c08e6,_0x512d0a,_0x79f79f){var _0x359b28={};var _0x11a75d={};var _0x11ed94;var _0x3a817e;return db[_0x0c71('0x2b')][_0x0c71('0x54')]({'where':{'id':_0x1c08e6['params']['id']}})[_0x0c71('0x23')](handleEntityNotFound(_0x512d0a,null))['then'](function(_0x3471e4){if(_0x3471e4){_0x11ed94=_0x3471e4;_0x11a75d[_0x0c71('0x31')]=_[_0x0c71('0x2d')](db[_0x0c71('0x2b')][_0x0c71('0x2c')]);_0x11a75d['query']=_[_0x0c71('0x2d')](_0x1c08e6[_0x0c71('0x2f')]);_0x11a75d[_0x0c71('0x39')]=_['intersection'](_0x11a75d[_0x0c71('0x31')],_0x11a75d[_0x0c71('0x2f')]);_0x359b28[_0x0c71('0x30')]=_[_0x0c71('0x2e')](_0x11a75d[_0x0c71('0x31')],qs[_0x0c71('0x32')](_0x1c08e6[_0x0c71('0x2f')][_0x0c71('0x32')]));_0x359b28[_0x0c71('0x30')]=_0x359b28['attributes'][_0x0c71('0x33')]?_0x359b28[_0x0c71('0x30')]:_0x11a75d[_0x0c71('0x31')];_0x359b28[_0x0c71('0x36')]=qs['sort'](_0x1c08e6[_0x0c71('0x2f')]['sort']);_0x359b28[_0x0c71('0x38')]=qs[_0x0c71('0x39')](_[_0x0c71('0x3a')](_0x1c08e6[_0x0c71('0x2f')],_0x11a75d[_0x0c71('0x39')]));if(_0x1c08e6[_0x0c71('0x2f')]['filter']){_0x359b28[_0x0c71('0x38')]=_[_0x0c71('0x3c')](_0x359b28[_0x0c71('0x38')],{'$or':_[_0x0c71('0x55')](_0x359b28[_0x0c71('0x30')],function(_0x35f31d){var _0x3f6d8a={};_0x3f6d8a[_0x35f31d]={'$like':'%'+_0x1c08e6[_0x0c71('0x2f')][_0x0c71('0x3b')]+'%'};return _0x3f6d8a;})});}_0x359b28=_[_0x0c71('0x3c')]({},_0x359b28,_0x1c08e6[_0x0c71('0x40')]);return _0x11ed94['getIntervals'](_0x359b28);}})['then'](function(_0x76c460){if(_0x76c460){_0x3a817e=_0x76c460[_0x0c71('0x33')];if(!_0x1c08e6[_0x0c71('0x2f')][_0x0c71('0x34')]('nolimit')){_0x359b28[_0x0c71('0x1d')]=qs['limit'](_0x1c08e6[_0x0c71('0x2f')][_0x0c71('0x1d')]);_0x359b28['offset']=qs[_0x0c71('0x1c')](_0x1c08e6[_0x0c71('0x2f')][_0x0c71('0x1c')]);}return _0x11ed94[_0x0c71('0x53')](_0x359b28);}})[_0x0c71('0x23')](function(_0x1497c5){if(_0x1497c5){return _0x1497c5?{'count':_0x3a817e,'rows':_0x1497c5}:null;}})['then'](respondWithResult(_0x512d0a,null))[_0x0c71('0x47')](handleError(_0x512d0a,null));};exports['addIntervals']=function(_0x4448f0,_0x41b6fb,_0x493693){return db['Interval']['findOne']({'where':{'id':_0x4448f0[_0x0c71('0x45')]['id']}})[_0x0c71('0x23')](handleEntityNotFound(_0x41b6fb,null))['then'](function(_0x2dcb62){if(_0x2dcb62){return db[_0x0c71('0x56')][_0x0c71('0x57')](function(_0x5bf8d0){return db['Interval'][_0x0c71('0x24')]({'where':{'IntervalId':_0x4448f0['params']['id']},'transaction':_0x5bf8d0})['then'](function(_0x52ea7e){var _0x473c5d=_[_0x0c71('0x55')](_0x4448f0[_0x0c71('0x50')],function(_0x435b9b){delete _0x435b9b['id'];_0x435b9b[_0x0c71('0x52')]=_0x4448f0[_0x0c71('0x45')]['id'];return _0x435b9b;});return db[_0x0c71('0x2b')]['bulkCreate'](_0x473c5d,{'transaction':_0x5bf8d0});});})['then'](function(){return db[_0x0c71('0x2b')][_0x0c71('0x58')]({'where':{'IntervalId':_0x4448f0[_0x0c71('0x45')]['id']}});});}})[_0x0c71('0x23')](respondWithResult(_0x41b6fb,null))[_0x0c71('0x47')](handleError(_0x41b6fb,null));}; \ No newline at end of file +var _0x490a=['includeAll','include','findAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','intersection','addIntervals','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','status','count','limit','json','apply','reject','then','destroy','get','UserProfileResource','end','stack','name','send','index','Interval','rawAttributes','query','keys','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','map','type','key','VIRTUAL','filter','merge'];(function(_0x11a648,_0x5530a7){var _0x5d4a7a=function(_0x4801f8){while(--_0x4801f8){_0x11a648['push'](_0x11a648['shift']());}};_0x5d4a7a(++_0x5530a7);}(_0x490a,0x1d4));var _0xa490=function(_0x37af25,_0x507bd9){_0x37af25=_0x37af25-0x0;var _0x389281=_0x490a[_0x37af25];return _0x389281;};'use strict';var pdf=require(_0xa490('0x0'));var emlformat=require(_0xa490('0x1'));var rimraf=require(_0xa490('0x2'));var zipdir=require(_0xa490('0x3'));var jsonpatch=require(_0xa490('0x4'));var rp=require(_0xa490('0x5'));var moment=require(_0xa490('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa490('0x7'));var path=require(_0xa490('0x8'));var sox=require(_0xa490('0x9'));var csv=require(_0xa490('0xa'));var ejs=require(_0xa490('0xb'));var fs=require('fs');var _=require(_0xa490('0xc'));var squel=require('squel');var crypto=require(_0xa490('0xd'));var jsforce=require(_0xa490('0xe'));var deskjs=require(_0xa490('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa490('0x10'));var Papa=require(_0xa490('0x11'));var Redis=require('ioredis');var authService=require(_0xa490('0x12'));var qs=require(_0xa490('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa490('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa490('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x57c34e,_0x44e3da){_0x44e3da=_0x44e3da||0xcc;return function(_0x5aed6a){if(_0x5aed6a){return _0x57c34e[_0xa490('0x16')](_0x44e3da);}return _0x57c34e[_0xa490('0x17')](_0x44e3da)['end']();};}function respondWithResult(_0x4a9978,_0x293d24){_0x293d24=_0x293d24||0xc8;return function(_0x2669dd){if(_0x2669dd){return _0x4a9978[_0xa490('0x17')](_0x293d24)['json'](_0x2669dd);}};}function respondWithFilteredResult(_0x3bfec9,_0x8c85cc){return function(_0x43b1ee){if(_0x43b1ee){var _0x244ff2=_0x43b1ee[_0xa490('0x18')],_0x4347b2=_0x8c85cc['offset'],_0x5abd92=_0x8c85cc['offset']+_0x8c85cc[_0xa490('0x19')],_0x4f3b3a;if(_0x5abd92>=_0x244ff2){_0x5abd92=_0x244ff2;_0x4f3b3a=0xc8;}else{_0x4f3b3a=0xce;}_0x3bfec9[_0xa490('0x17')](_0x4f3b3a);return _0x3bfec9['set']('Content-Range',_0x4347b2+'-'+_0x5abd92+'/'+_0x244ff2)[_0xa490('0x1a')](_0x43b1ee);}return null;};}function patchUpdates(_0x617d9){return function(_0x424424){try{jsonpatch[_0xa490('0x1b')](_0x424424,_0x617d9,!![]);}catch(_0x5a95c6){return BPromise[_0xa490('0x1c')](_0x5a95c6);}return _0x424424['save']();};}function saveUpdates(_0x1d1171,_0x1d2eff){return function(_0x34633b){if(_0x34633b){return _0x34633b['update'](_0x1d1171)[_0xa490('0x1d')](function(_0x1331c3){return _0x1331c3;});}return null;};}function removeEntity(_0x4bf3cb,_0x3221e7){return function(_0x3102f1){if(_0x3102f1){return _0x3102f1[_0xa490('0x1e')]()[_0xa490('0x1d')](function(){var _0x12b4e1=_0x3102f1[_0xa490('0x1f')]({'plain':!![]});var _0x87f5c9='Intervals';return db[_0xa490('0x20')][_0xa490('0x1e')]({'where':{'type':_0x87f5c9,'resourceId':_0x12b4e1['id']}})['then'](function(){return _0x3102f1;});})['then'](function(){_0x4bf3cb['status'](0xcc)[_0xa490('0x21')]();});}};}function handleEntityNotFound(_0x26e92b,_0x540a3c){return function(_0x40129c){if(!_0x40129c){_0x26e92b[_0xa490('0x16')](0x194);}return _0x40129c;};}function handleError(_0x27ec7a,_0x2fcdba){_0x2fcdba=_0x2fcdba||0x1f4;return function(_0x4e078a){logger['error'](_0x4e078a[_0xa490('0x22')]);if(_0x4e078a['name']){delete _0x4e078a[_0xa490('0x23')];}_0x27ec7a[_0xa490('0x17')](_0x2fcdba)[_0xa490('0x24')](_0x4e078a);};}exports[_0xa490('0x25')]=function(_0x48162b,_0x5a6bd0){var _0xc28ff6={},_0xec0f61={},_0x5d67f8={'count':0x0,'rows':[]};var _0x501c28=db[_0xa490('0x26')][_0xa490('0x27')];_0xec0f61['model']=_['keys'](_0x501c28);_0xec0f61[_0xa490('0x28')]=_[_0xa490('0x29')](_0x48162b[_0xa490('0x28')]);_0xec0f61['filters']=_['intersection'](_0xec0f61[_0xa490('0x2a')],_0xec0f61[_0xa490('0x28')]);_0xc28ff6['attributes']=_['intersection'](_0xec0f61[_0xa490('0x2a')],qs[_0xa490('0x2b')](_0x48162b[_0xa490('0x28')][_0xa490('0x2b')]));_0xc28ff6[_0xa490('0x2c')]=_0xc28ff6[_0xa490('0x2c')][_0xa490('0x2d')]?_0xc28ff6[_0xa490('0x2c')]:_0xec0f61[_0xa490('0x2a')];if(!_0x48162b[_0xa490('0x28')][_0xa490('0x2e')](_0xa490('0x2f'))){_0xc28ff6[_0xa490('0x19')]=qs['limit'](_0x48162b['query'][_0xa490('0x19')]);_0xc28ff6['offset']=qs['offset'](_0x48162b[_0xa490('0x28')][_0xa490('0x30')]);}_0xc28ff6[_0xa490('0x31')]=qs[_0xa490('0x32')](_0x48162b['query'][_0xa490('0x32')]);_0xc28ff6[_0xa490('0x33')]=qs[_0xa490('0x34')](_[_0xa490('0x35')](_0x48162b[_0xa490('0x28')],_0xec0f61[_0xa490('0x34')]));if(_0x48162b[_0xa490('0x28')]['filter']){_0xc28ff6['where']=_['merge'](_0xc28ff6[_0xa490('0x33')],{'$or':_[_0xa490('0x36')](_0x501c28,function(_0x43da75){if(_0x43da75[_0xa490('0x37')][_0xa490('0x38')]!==_0xa490('0x39')){var _0x349b19={};_0x349b19[_0x43da75['field']]={'$like':'%'+_0x48162b['query'][_0xa490('0x3a')]+'%'};return _0x349b19;}})});}_0xc28ff6=_[_0xa490('0x3b')]({},_0xc28ff6,_0x48162b['options']);var _0x28f19b={'where':_0xc28ff6['where']};return db['Interval'][_0xa490('0x18')](_0x28f19b)[_0xa490('0x1d')](function(_0x2494f4){_0x5d67f8[_0xa490('0x18')]=_0x2494f4;if(_0x48162b[_0xa490('0x28')][_0xa490('0x3c')]){_0xc28ff6[_0xa490('0x3d')]=[{'all':!![]}];}return db[_0xa490('0x26')][_0xa490('0x3e')](_0xc28ff6);})[_0xa490('0x1d')](function(_0x86838d){_0x5d67f8[_0xa490('0x3f')]=_0x86838d;return _0x5d67f8;})[_0xa490('0x1d')](respondWithFilteredResult(_0x5a6bd0,_0xc28ff6))[_0xa490('0x40')](handleError(_0x5a6bd0,null));};exports[_0xa490('0x41')]=function(_0x99012c,_0x19b149){var _0x32155c={'raw':!![],'where':{'id':_0x99012c[_0xa490('0x42')]['id']}},_0x4629ed={};_0x4629ed[_0xa490('0x2a')]=_[_0xa490('0x29')](db['Interval'][_0xa490('0x27')]);_0x4629ed[_0xa490('0x28')]=_[_0xa490('0x29')](_0x99012c[_0xa490('0x28')]);_0x4629ed[_0xa490('0x34')]=_['intersection'](_0x4629ed[_0xa490('0x2a')],_0x4629ed[_0xa490('0x28')]);_0x32155c[_0xa490('0x2c')]=_['intersection'](_0x4629ed['model'],qs[_0xa490('0x2b')](_0x99012c[_0xa490('0x28')][_0xa490('0x2b')]));_0x32155c['attributes']=_0x32155c[_0xa490('0x2c')][_0xa490('0x2d')]?_0x32155c[_0xa490('0x2c')]:_0x4629ed[_0xa490('0x2a')];if(_0x99012c[_0xa490('0x28')][_0xa490('0x3c')]){_0x32155c[_0xa490('0x3d')]=[{'all':!![]}];}_0x32155c=_[_0xa490('0x3b')]({},_0x32155c,_0x99012c[_0xa490('0x43')]);return db[_0xa490('0x26')][_0xa490('0x44')](_0x32155c)['then'](handleEntityNotFound(_0x19b149,null))['then'](respondWithResult(_0x19b149,null))[_0xa490('0x40')](handleError(_0x19b149,null));};exports[_0xa490('0x45')]=function(_0x317a5f,_0xcc2f5f){return db[_0xa490('0x26')][_0xa490('0x45')](_0x317a5f[_0xa490('0x46')],{})[_0xa490('0x1d')](function(_0x55fe48){var _0xce2635=_0x317a5f['user'][_0xa490('0x1f')]({'plain':!![]});if(!_0xce2635)throw new Error(_0xa490('0x47'));if(_0xce2635[_0xa490('0x48')]===_0xa490('0x49')){var _0x4668e9=_0x55fe48[_0xa490('0x1f')]({'plain':!![]});var _0x1ac6d6='Intervals';return db[_0xa490('0x4a')][_0xa490('0x44')]({'where':{'name':_0x1ac6d6,'userProfileId':_0xce2635[_0xa490('0x4b')]},'raw':!![]})['then'](function(_0x9d335e){if(_0x9d335e&&_0x9d335e['autoAssociation']===0x0){return db[_0xa490('0x20')][_0xa490('0x45')]({'name':_0x4668e9[_0xa490('0x23')],'resourceId':_0x4668e9['id'],'type':_0x9d335e[_0xa490('0x23')],'sectionId':_0x9d335e['id']},{})[_0xa490('0x1d')](function(){return _0x55fe48;});}else{return _0x55fe48;}})[_0xa490('0x40')](function(_0x2bed85){logger[_0xa490('0x4c')](_0xa490('0x4d'),_0x2bed85);throw _0x2bed85;});}return _0x55fe48;})['then'](respondWithResult(_0xcc2f5f,0xc9))[_0xa490('0x40')](handleError(_0xcc2f5f,null));};exports[_0xa490('0x4e')]=function(_0x13a259,_0x530e5b){if(_0x13a259[_0xa490('0x46')]['id']){delete _0x13a259[_0xa490('0x46')]['id'];}return db[_0xa490('0x26')]['find']({'where':{'id':_0x13a259['params']['id']}})[_0xa490('0x1d')](handleEntityNotFound(_0x530e5b,null))[_0xa490('0x1d')](saveUpdates(_0x13a259[_0xa490('0x46')],null))['then'](respondWithResult(_0x530e5b,null))[_0xa490('0x40')](handleError(_0x530e5b,null));};exports['destroy']=function(_0x13fc3d,_0x395402){return db[_0xa490('0x26')][_0xa490('0x44')]({'where':{'id':_0x13fc3d[_0xa490('0x42')]['id']}})[_0xa490('0x1d')](handleEntityNotFound(_0x395402,null))[_0xa490('0x1d')](removeEntity(_0x395402,null))[_0xa490('0x40')](handleError(_0x395402,null));};exports[_0xa490('0x4f')]=function(_0x263556,_0x46a1ca,_0x271733){if(_0x263556['body']['id']){delete _0x263556[_0xa490('0x46')]['id'];}return db[_0xa490('0x26')][_0xa490('0x44')]({'where':{'id':_0x263556[_0xa490('0x42')]['id']}})['then'](handleEntityNotFound(_0x46a1ca,null))[_0xa490('0x1d')](function(_0x4feecc){if(_0x4feecc){_0x263556[_0xa490('0x46')][_0xa490('0x50')]=_0x4feecc['id'];return db[_0xa490('0x26')][_0xa490('0x45')](_0x263556[_0xa490('0x46')]);}})[_0xa490('0x1d')](respondWithResult(_0x46a1ca,null))[_0xa490('0x40')](handleError(_0x46a1ca,null));};exports[_0xa490('0x51')]=function(_0x2a3aa7,_0x29ea4a,_0x460672){var _0x1997a7={};var _0x41cf29={};var _0x3c1961;var _0x18f7b7;return db[_0xa490('0x26')][_0xa490('0x52')]({'where':{'id':_0x2a3aa7[_0xa490('0x42')]['id']}})[_0xa490('0x1d')](handleEntityNotFound(_0x29ea4a,null))[_0xa490('0x1d')](function(_0x37caca){if(_0x37caca){_0x3c1961=_0x37caca;_0x41cf29[_0xa490('0x2a')]=_[_0xa490('0x29')](db['Interval'][_0xa490('0x27')]);_0x41cf29[_0xa490('0x28')]=_[_0xa490('0x29')](_0x2a3aa7[_0xa490('0x28')]);_0x41cf29[_0xa490('0x34')]=_[_0xa490('0x53')](_0x41cf29[_0xa490('0x2a')],_0x41cf29[_0xa490('0x28')]);_0x1997a7[_0xa490('0x2c')]=_[_0xa490('0x53')](_0x41cf29[_0xa490('0x2a')],qs[_0xa490('0x2b')](_0x2a3aa7[_0xa490('0x28')][_0xa490('0x2b')]));_0x1997a7[_0xa490('0x2c')]=_0x1997a7[_0xa490('0x2c')][_0xa490('0x2d')]?_0x1997a7[_0xa490('0x2c')]:_0x41cf29[_0xa490('0x2a')];_0x1997a7[_0xa490('0x31')]=qs[_0xa490('0x32')](_0x2a3aa7[_0xa490('0x28')][_0xa490('0x32')]);_0x1997a7[_0xa490('0x33')]=qs[_0xa490('0x34')](_[_0xa490('0x35')](_0x2a3aa7[_0xa490('0x28')],_0x41cf29['filters']));if(_0x2a3aa7[_0xa490('0x28')]['filter']){_0x1997a7[_0xa490('0x33')]=_[_0xa490('0x3b')](_0x1997a7[_0xa490('0x33')],{'$or':_[_0xa490('0x36')](_0x1997a7[_0xa490('0x2c')],function(_0x18b0f6){var _0x2e5e4e={};_0x2e5e4e[_0x18b0f6]={'$like':'%'+_0x2a3aa7['query'][_0xa490('0x3a')]+'%'};return _0x2e5e4e;})});}_0x1997a7=_[_0xa490('0x3b')]({},_0x1997a7,_0x2a3aa7[_0xa490('0x43')]);return _0x3c1961[_0xa490('0x51')](_0x1997a7);}})[_0xa490('0x1d')](function(_0xa9c2e9){if(_0xa9c2e9){_0x18f7b7=_0xa9c2e9[_0xa490('0x2d')];if(!_0x2a3aa7[_0xa490('0x28')][_0xa490('0x2e')](_0xa490('0x2f'))){_0x1997a7[_0xa490('0x19')]=qs[_0xa490('0x19')](_0x2a3aa7[_0xa490('0x28')][_0xa490('0x19')]);_0x1997a7[_0xa490('0x30')]=qs[_0xa490('0x30')](_0x2a3aa7[_0xa490('0x28')][_0xa490('0x30')]);}return _0x3c1961[_0xa490('0x51')](_0x1997a7);}})[_0xa490('0x1d')](function(_0x5de730){if(_0x5de730){return _0x5de730?{'count':_0x18f7b7,'rows':_0x5de730}:null;}})['then'](respondWithResult(_0x29ea4a,null))[_0xa490('0x40')](handleError(_0x29ea4a,null));};exports[_0xa490('0x54')]=function(_0x45e32f,_0x289c07,_0x10e960){return db[_0xa490('0x26')]['findOne']({'where':{'id':_0x45e32f[_0xa490('0x42')]['id']}})[_0xa490('0x1d')](handleEntityNotFound(_0x289c07,null))[_0xa490('0x1d')](function(_0x1d81ff){if(_0x1d81ff){return db[_0xa490('0x55')][_0xa490('0x56')](function(_0x28634a){return db['Interval'][_0xa490('0x1e')]({'where':{'IntervalId':_0x45e32f[_0xa490('0x42')]['id']},'transaction':_0x28634a})[_0xa490('0x1d')](function(_0x2986f2){var _0x40458b=_[_0xa490('0x36')](_0x45e32f['body'],function(_0x27e76c){delete _0x27e76c['id'];_0x27e76c[_0xa490('0x50')]=_0x45e32f[_0xa490('0x42')]['id'];return _0x27e76c;});return db['Interval'][_0xa490('0x57')](_0x40458b,{'transaction':_0x28634a});});})[_0xa490('0x1d')](function(){return db[_0xa490('0x26')][_0xa490('0x3e')]({'where':{'IntervalId':_0x45e32f[_0xa490('0x42')]['id']}});});}})['then'](respondWithResult(_0x289c07,null))['catch'](handleError(_0x289c07,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 49d6dfb..daac51c 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 _0x191d=['../../config/environment','./interval.attributes','exports','define','Interval','rewrite','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x191d,0xf0));var _0xd191=function(_0x4dc999,_0x58f8f7){_0x4dc999=_0x4dc999-0x0;var _0x23d59d=_0x191d[_0x4dc999];return _0x23d59d;};'use strict';var _=require(_0xd191('0x0'));var util=require(_0xd191('0x1'));var logger=require(_0xd191('0x2'))(_0xd191('0x3'));var moment=require(_0xd191('0x4'));var BPromise=require('bluebird');var rp=require(_0xd191('0x5'));var fs=require('fs');var path=require(_0xd191('0x6'));var rimraf=require('rimraf');var config=require(_0xd191('0x7'));var attributes=require(_0xd191('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0xd191('0x9')]=function(_0x641fb5,_0x47bd4d){return _0x641fb5[_0xd191('0xa')](_0xd191('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x31d367,_0x27cb26){extensions['rewrite'](_0x641fb5,_0x31d367);},'afterBulkCreate':function(_0x228750,_0xf36836,_0x2b195d){_0x2b195d();extensions['rewrite'](_0x641fb5,_0x228750[0x0]);},'afterUpdate':function(_0x45db1c,_0xd56460){extensions['rewrite'](_0x641fb5,_0x45db1c);},'afterDestroy':function(_0x103a8a,_0x9ad9b4){extensions[_0xd191('0xc')](_0x641fb5,_0x103a8a);}}});}; \ No newline at end of file +var _0x5e11=['rewrite','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals'];(function(_0x1221ae,_0x25fd13){var _0x5dd5f9=function(_0x3b6769){while(--_0x3b6769){_0x1221ae['push'](_0x1221ae['shift']());}};_0x5dd5f9(++_0x25fd13);}(_0x5e11,0xf8));var _0x15e1=function(_0x5933fb,_0x9115ad){_0x5933fb=_0x5933fb-0x0;var _0x44d988=_0x5e11[_0x5933fb];return _0x44d988;};'use strict';var _=require('lodash');var util=require(_0x15e1('0x0'));var logger=require(_0x15e1('0x1'))(_0x15e1('0x2'));var moment=require(_0x15e1('0x3'));var BPromise=require(_0x15e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15e1('0x5'));var rimraf=require(_0x15e1('0x6'));var config=require(_0x15e1('0x7'));var attributes=require(_0x15e1('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0x15e1('0x9')]=function(_0x3f9bb1,_0x51601e){return _0x3f9bb1[_0x15e1('0xa')]('Interval',attributes,{'tableName':_0x15e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1583fa,_0x131c4d){extensions[_0x15e1('0xc')](_0x3f9bb1,_0x1583fa);},'afterBulkCreate':function(_0x241ee3,_0x455041,_0x2de94b){_0x2de94b();extensions[_0x15e1('0xc')](_0x3f9bb1,_0x241ee3[0x0]);},'afterUpdate':function(_0x1a6acd,_0x3a2d8d){extensions['rewrite'](_0x3f9bb1,_0x1a6acd);},'afterDestroy':function(_0x1b94f2,_0x38745c){extensions[_0x15e1('0xc')](_0x3f9bb1,_0x1b94f2);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 3ce1132..6c2d3b0 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 _0xf69d=['model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','Interval,\x20%s,\x20%s','catch','GetInterval','Interval','options','raw','where','attributes','include','map','ShowInterval','find'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xf69d,0xd3));var _0xdf69=function(_0x1c9d6d,_0x5b53fe){_0x1c9d6d=_0x1c9d6d-0x0;var _0x3e9126=_0xf69d[_0x1c9d6d];return _0x3e9126;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));var BPromise=require(_0xdf69('0x3'));var rs=require(_0xdf69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf69('0x5'))['db'];var utils=require(_0xdf69('0x6'));var logger=require(_0xdf69('0x7'))(_0xdf69('0x8'));var config=require(_0xdf69('0x9'));var jayson=require(_0xdf69('0xa'));var client=jayson[_0xdf69('0xb')][_0xdf69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d2501,_0x12c186,_0x18a08e){return new BPromise(function(_0xc1b77e,_0x38909e){return client[_0xdf69('0xd')](_0x1d2501,_0x18a08e)[_0xdf69('0xe')](function(_0x211ea9){logger[_0xdf69('0xf')]('Interval,\x20%s,\x20%s',_0x12c186,_0xdf69('0x10'));logger[_0xdf69('0x11')](_0xdf69('0x12'),_0x12c186,_0xdf69('0x10'),JSON[_0xdf69('0x13')](_0x211ea9));if(_0x211ea9[_0xdf69('0x14')]){if(_0x211ea9['error']['code']===0x1f4){logger['error']('Interval,\x20%s,\x20%s',_0x12c186,_0x211ea9[_0xdf69('0x14')][_0xdf69('0x15')]);return _0x38909e(_0x211ea9[_0xdf69('0x14')][_0xdf69('0x15')]);}logger[_0xdf69('0x14')](_0xdf69('0x16'),_0x12c186,_0x211ea9['error'][_0xdf69('0x15')]);return _0xc1b77e(_0x211ea9[_0xdf69('0x14')][_0xdf69('0x15')]);}else{logger[_0xdf69('0xf')]('Interval,\x20%s,\x20%s',_0x12c186,_0xdf69('0x10'));_0xc1b77e(_0x211ea9['result'][_0xdf69('0x15')]);}})[_0xdf69('0x17')](function(_0x5263a4){logger[_0xdf69('0x14')](_0xdf69('0x16'),_0x12c186,_0x5263a4);_0x38909e(_0x5263a4);});});}exports[_0xdf69('0x18')]=function(_0x85d1d){var _0x59bfd2=this;return new Promise(function(_0x5ae237,_0x352400){return db[_0xdf69('0x19')]['findAll']({'raw':_0x85d1d[_0xdf69('0x1a')]?_0x85d1d[_0xdf69('0x1a')][_0xdf69('0x1b')]===undefined?!![]:![]:!![],'where':_0x85d1d['options']?_0x85d1d[_0xdf69('0x1a')][_0xdf69('0x1c')]||null:null,'attributes':_0x85d1d['options']?_0x85d1d['options'][_0xdf69('0x1d')]||null:null,'limit':_0x85d1d[_0xdf69('0x1a')]?_0x85d1d[_0xdf69('0x1a')]['limit']||null:null,'include':_0x85d1d['options']?_0x85d1d['options'][_0xdf69('0x1e')]?_['map'](_0x85d1d[_0xdf69('0x1a')][_0xdf69('0x1e')],function(_0x1d37d8){return{'model':db[_0x1d37d8['model']],'as':_0x1d37d8['as'],'attributes':_0x1d37d8['attributes'],'include':_0x1d37d8[_0xdf69('0x1e')]?_[_0xdf69('0x1f')](_0x1d37d8[_0xdf69('0x1e')],function(_0x3fd933){return{'model':db[_0x3fd933['model']],'as':_0x3fd933['as'],'attributes':_0x3fd933[_0xdf69('0x1d')],'include':_0x3fd933[_0xdf69('0x1e')]?_[_0xdf69('0x1f')](_0x3fd933['include'],function(_0x2da3df){return{'model':db[_0x2da3df['model']],'as':_0x2da3df['as'],'attributes':_0x2da3df['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c2738){logger[_0xdf69('0xf')](_0xdf69('0x18'),_0x85d1d);logger['debug'](_0xdf69('0x18'),_0x85d1d,JSON[_0xdf69('0x13')](_0x5c2738));_0x5ae237(_0x5c2738);})[_0xdf69('0x17')](function(_0x12aec3){logger[_0xdf69('0x14')](_0xdf69('0x18'),_0x12aec3[_0xdf69('0x15')],_0x85d1d);_0x352400(_0x59bfd2[_0xdf69('0x14')](0x1f4,_0x12aec3[_0xdf69('0x15')]));});});};exports[_0xdf69('0x20')]=function(_0x38c1bb){var _0x2a23ed=this;return new Promise(function(_0x38f848,_0x2cb97e){return db[_0xdf69('0x19')][_0xdf69('0x21')]({'raw':_0x38c1bb[_0xdf69('0x1a')]?_0x38c1bb['options'][_0xdf69('0x1b')]===undefined?!![]:![]:!![],'where':_0x38c1bb[_0xdf69('0x1a')]?_0x38c1bb[_0xdf69('0x1a')][_0xdf69('0x1c')]||null:null,'attributes':_0x38c1bb[_0xdf69('0x1a')]?_0x38c1bb['options'][_0xdf69('0x1d')]||null:null,'include':_0x38c1bb['options']?_0x38c1bb[_0xdf69('0x1a')][_0xdf69('0x1e')]?_['map'](_0x38c1bb[_0xdf69('0x1a')]['include'],function(_0x1ca0c6){return{'model':db[_0x1ca0c6[_0xdf69('0x22')]],'as':_0x1ca0c6['as'],'attributes':_0x1ca0c6[_0xdf69('0x1d')],'include':_0x1ca0c6[_0xdf69('0x1e')]?_[_0xdf69('0x1f')](_0x1ca0c6['include'],function(_0x175d5a){return{'model':db[_0x175d5a['model']],'as':_0x175d5a['as'],'attributes':_0x175d5a[_0xdf69('0x1d')],'include':_0x175d5a[_0xdf69('0x1e')]?_[_0xdf69('0x1f')](_0x175d5a[_0xdf69('0x1e')],function(_0x5c38db){return{'model':db[_0x5c38db[_0xdf69('0x22')]],'as':_0x5c38db['as'],'attributes':_0x5c38db['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf69('0xe')](function(_0x59c00e){logger[_0xdf69('0xf')]('ShowInterval',_0x38c1bb);logger[_0xdf69('0x11')](_0xdf69('0x20'),_0x38c1bb,JSON[_0xdf69('0x13')](_0x59c00e));_0x38f848(_0x59c00e);})[_0xdf69('0x17')](function(_0xf77362){logger['error'](_0xdf69('0x20'),_0xf77362[_0xdf69('0x15')],_0x38c1bb);_0x2cb97e(_0x2a23ed['error'](0x1f4,_0xf77362['message']));});});}; \ No newline at end of file +var _0x0e85=['http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Interval','findAll','options','raw','where','attributes','limit','include','map','model','GetInterval','ShowInterval','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x111b45,_0x3ac2e8){var _0x28503b=function(_0x1c2d93){while(--_0x1c2d93){_0x111b45['push'](_0x111b45['shift']());}};_0x28503b(++_0x3ac2e8);}(_0x0e85,0x7c));var _0x50e8=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x0e85[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b01,_0x3ce904,_0x108edc){return new BPromise(function(_0x42665e,_0x988da0){return client[_0x50e8('0x9')](_0x5e8b01,_0x108edc)[_0x50e8('0xa')](function(_0x5825f5){logger[_0x50e8('0xb')](_0x50e8('0xc'),_0x3ce904,_0x50e8('0xd'));logger[_0x50e8('0xe')](_0x50e8('0xf'),_0x3ce904,_0x50e8('0xd'),JSON[_0x50e8('0x10')](_0x5825f5));if(_0x5825f5[_0x50e8('0x11')]){if(_0x5825f5['error']['code']===0x1f4){logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error']['message']);return _0x988da0(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error'][_0x50e8('0x12')]);return _0x42665e(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}else{logger['info']('Interval,\x20%s,\x20%s',_0x3ce904,_0x50e8('0xd'));_0x42665e(_0x5825f5[_0x50e8('0x13')][_0x50e8('0x12')]);}})[_0x50e8('0x14')](function(_0x211731){logger[_0x50e8('0x11')]('Interval,\x20%s,\x20%s',_0x3ce904,_0x211731);_0x988da0(_0x211731);});});}exports['GetInterval']=function(_0x441f25){var _0xc97063=this;return new Promise(function(_0x40d060,_0x45ce11){return db[_0x50e8('0x15')][_0x50e8('0x16')]({'raw':_0x441f25[_0x50e8('0x17')]?_0x441f25['options'][_0x50e8('0x18')]===undefined?!![]:![]:!![],'where':_0x441f25['options']?_0x441f25[_0x50e8('0x17')][_0x50e8('0x19')]||null:null,'attributes':_0x441f25[_0x50e8('0x17')]?_0x441f25[_0x50e8('0x17')][_0x50e8('0x1a')]||null:null,'limit':_0x441f25['options']?_0x441f25[_0x50e8('0x17')][_0x50e8('0x1b')]||null:null,'include':_0x441f25['options']?_0x441f25[_0x50e8('0x17')][_0x50e8('0x1c')]?_['map'](_0x441f25[_0x50e8('0x17')][_0x50e8('0x1c')],function(_0x4f56b7){return{'model':db[_0x4f56b7['model']],'as':_0x4f56b7['as'],'attributes':_0x4f56b7['attributes'],'include':_0x4f56b7[_0x50e8('0x1c')]?_[_0x50e8('0x1d')](_0x4f56b7[_0x50e8('0x1c')],function(_0x371a1f){return{'model':db[_0x371a1f[_0x50e8('0x1e')]],'as':_0x371a1f['as'],'attributes':_0x371a1f[_0x50e8('0x1a')],'include':_0x371a1f['include']?_[_0x50e8('0x1d')](_0x371a1f[_0x50e8('0x1c')],function(_0x4b3a09){return{'model':db[_0x4b3a09[_0x50e8('0x1e')]],'as':_0x4b3a09['as'],'attributes':_0x4b3a09[_0x50e8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x50e8('0xa')](function(_0x2af330){logger['info'](_0x50e8('0x1f'),_0x441f25);logger['debug'](_0x50e8('0x1f'),_0x441f25,JSON[_0x50e8('0x10')](_0x2af330));_0x40d060(_0x2af330);})[_0x50e8('0x14')](function(_0x4f0b88){logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x4f0b88[_0x50e8('0x12')],_0x441f25);_0x45ce11(_0xc97063[_0x50e8('0x11')](0x1f4,_0x4f0b88[_0x50e8('0x12')]));});});};exports[_0x50e8('0x20')]=function(_0x2c6fb3){var _0x54d81d=this;return new Promise(function(_0x290fd2,_0x123be9){return db['Interval']['find']({'raw':_0x2c6fb3[_0x50e8('0x17')]?_0x2c6fb3[_0x50e8('0x17')][_0x50e8('0x18')]===undefined?!![]:![]:!![],'where':_0x2c6fb3['options']?_0x2c6fb3['options'][_0x50e8('0x19')]||null:null,'attributes':_0x2c6fb3[_0x50e8('0x17')]?_0x2c6fb3['options'][_0x50e8('0x1a')]||null:null,'include':_0x2c6fb3[_0x50e8('0x17')]?_0x2c6fb3[_0x50e8('0x17')][_0x50e8('0x1c')]?_['map'](_0x2c6fb3[_0x50e8('0x17')]['include'],function(_0x3aec30){return{'model':db[_0x3aec30[_0x50e8('0x1e')]],'as':_0x3aec30['as'],'attributes':_0x3aec30[_0x50e8('0x1a')],'include':_0x3aec30['include']?_[_0x50e8('0x1d')](_0x3aec30[_0x50e8('0x1c')],function(_0x548f3c){return{'model':db[_0x548f3c[_0x50e8('0x1e')]],'as':_0x548f3c['as'],'attributes':_0x548f3c[_0x50e8('0x1a')],'include':_0x548f3c[_0x50e8('0x1c')]?_[_0x50e8('0x1d')](_0x548f3c['include'],function(_0x1c513c){return{'model':db[_0x1c513c[_0x50e8('0x1e')]],'as':_0x1c513c['as'],'attributes':_0x1c513c[_0x50e8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x50e8('0xa')](function(_0x5e556c){logger[_0x50e8('0xb')](_0x50e8('0x20'),_0x2c6fb3);logger[_0x50e8('0xe')]('ShowInterval',_0x2c6fb3,JSON['stringify'](_0x5e556c));_0x290fd2(_0x5e556c);})['catch'](function(_0xd39553){logger[_0x50e8('0x11')](_0x50e8('0x20'),_0xd39553[_0x50e8('0x12')],_0x2c6fb3);_0x123be9(_0x54d81d[_0x50e8('0x11')](0x1f4,_0xd39553[_0x50e8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index e7828ff..9536618 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x3e0191,_0x1d4b20){var _0xf2ae83=function(_0x277210){while(--_0x277210){_0x3e0191['push'](_0x3e0191['shift']());}};_0xf2ae83(++_0x1d4b20);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a691f,_0x1994dd){_0x4a691f=_0x4a691f-0x0;var _0xb33bb8=_0x5f2f[_0x4a691f];return _0xb33bb8;};'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 +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x56f43b,_0x12f74b){_0x56f43b=_0x56f43b-0x0;var _0x2a81de=_0x0b0e[_0x56f43b];return _0x2a81de;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 2915a2d..f3ce4b6 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 _0xa9e0=['Basic\x20','toString','base64','utf8','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json'];(function(_0x52b395,_0x1afa64){var _0x55d9d4=function(_0x35614d){while(--_0x35614d){_0x52b395['push'](_0x52b395['shift']());}};_0x55d9d4(++_0x1afa64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var BPromise=require(_0x0a9e('0x0'));var https=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var USERNAME='support';var PASSWORD=_0x0a9e('0x3');function openIssue(_0x4ce2f1,_0x333808){var _0x432180={'fields':{'project':{'key':_0x4ce2f1[_0x0a9e('0x4')]||_0x0a9e('0x5')},'summary':(_0x4ce2f1[_0x0a9e('0x6')]||'Report')+_0x0a9e('0x7')+_0x4ce2f1['ip'],'description':_0x4ce2f1[_0x0a9e('0x8')]||JSON[_0x0a9e('0x9')](_0x4ce2f1),'issuetype':{'name':_0x4ce2f1['issuetype']||'Bug'}}};_0x432180[_0x0a9e('0xa')]['customfield_11500']=_0x4ce2f1['email'];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xb')]=_0x4ce2f1[_0x0a9e('0xc')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xd')]=_0x4ce2f1[_0x0a9e('0xe')];_0x432180['fields']['customfield_11503']=_0x4ce2f1['name'];_0x432180['fields'][_0x0a9e('0xf')]=_0x4ce2f1[_0x0a9e('0x10')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0x11')]=_0x4ce2f1['ip'];var _0x32d742={'host':_0x0a9e('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0a9e('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x0a9e('0x14'),'Authorization':_0x0a9e('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x0a9e('0x16')](_0x0a9e('0x17'))}};var _0x4d5611=JSON['stringify'](_0x432180);var _0x22dccb=https['request'](_0x32d742,function(_0x1985b6){_0x1985b6['setEncoding'](_0x0a9e('0x18'));var _0x12066b='';_0x1985b6['on']('data',function(_0x225616){_0x12066b+=_0x225616;});_0x1985b6['on']('end',function(){if(_0x333808){return _0x333808[_0x0a9e('0x19')](_0x1985b6[_0x0a9e('0x1a')])[_0x0a9e('0x1b')](JSON[_0x0a9e('0x1c')](_0x12066b));}});});_0x22dccb['on'](_0x0a9e('0x1d'),function(_0x2eb11f){if(_0x333808){return _0x333808[_0x0a9e('0x19')](0x1f4)[_0x0a9e('0x1b')]({'errors':[{'message':_0x0a9e('0x1e'),'type':_0x0a9e('0x1f')}]});}});_0x22dccb[_0x0a9e('0x20')](_0x4d5611);_0x22dccb[_0x0a9e('0x21')]();}exports['openIssue']=openIssue;exports[_0x0a9e('0x22')]=function(_0x155cce,_0x53682f){_0x155cce[_0x0a9e('0x23')]['ip']=_0x155cce['headers']['x-forwarded-for']||_0x155cce[_0x0a9e('0x24')][_0x0a9e('0x25')]||_0x155cce[_0x0a9e('0x26')][_0x0a9e('0x25')]||_0x155cce['connection'][_0x0a9e('0x26')][_0x0a9e('0x25')];return openIssue(_0x155cce[_0x0a9e('0x23')],_0x53682f);}; \ No newline at end of file +var _0xe706=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','utf8','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0'];(function(_0x164512,_0xa5ff2b){var _0x5926ee=function(_0x4c5985){while(--_0x4c5985){_0x164512['push'](_0x164512['shift']());}};_0x5926ee(++_0xa5ff2b);}(_0xe706,0xa3));var _0x6e70=function(_0x25f0d5,_0xc2dbf1){_0x25f0d5=_0x25f0d5-0x0;var _0x3dac6b=_0xe706[_0x25f0d5];return _0x3dac6b;};'use strict';var BPromise=require(_0x6e70('0x0'));var https=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var USERNAME=_0x6e70('0x3');var PASSWORD=_0x6e70('0x4');function openIssue(_0x2ca810,_0x7dfbc3){var _0x142c27={'fields':{'project':{'key':_0x2ca810[_0x6e70('0x5')]||_0x6e70('0x6')},'summary':(_0x2ca810[_0x6e70('0x7')]||_0x6e70('0x8'))+_0x6e70('0x9')+_0x2ca810['ip'],'description':_0x2ca810[_0x6e70('0xa')]||JSON[_0x6e70('0xb')](_0x2ca810),'issuetype':{'name':_0x2ca810[_0x6e70('0xc')]||_0x6e70('0xd')}}};_0x142c27[_0x6e70('0xe')][_0x6e70('0xf')]=_0x2ca810[_0x6e70('0x10')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x11')]=_0x2ca810[_0x6e70('0x12')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x13')]=_0x2ca810[_0x6e70('0x14')];_0x142c27[_0x6e70('0xe')]['customfield_11503']=_0x2ca810['name'];_0x142c27[_0x6e70('0xe')][_0x6e70('0x15')]=_0x2ca810[_0x6e70('0x16')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x17')]=_0x2ca810['ip'];var _0x310eb7={'host':_0x6e70('0x18'),'port':0x1bb,'path':_0x6e70('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6e70('0x1a')]('base64')}};var _0x53aed0=JSON[_0x6e70('0xb')](_0x142c27);var _0x22c50c=https['request'](_0x310eb7,function(_0x24f3ac){_0x24f3ac['setEncoding'](_0x6e70('0x1b'));var _0x161f23='';_0x24f3ac['on']('data',function(_0x49029f){_0x161f23+=_0x49029f;});_0x24f3ac['on'](_0x6e70('0x1c'),function(){if(_0x7dfbc3){return _0x7dfbc3['status'](_0x24f3ac[_0x6e70('0x1d')])[_0x6e70('0x1e')](JSON['parse'](_0x161f23));}});});_0x22c50c['on']('error',function(_0xc238ba){if(_0x7dfbc3){return _0x7dfbc3[_0x6e70('0x1f')](0x1f4)[_0x6e70('0x1e')]({'errors':[{'message':_0x6e70('0x20'),'type':_0x6e70('0x21')}]});}});_0x22c50c[_0x6e70('0x22')](_0x53aed0);_0x22c50c[_0x6e70('0x1c')]();}exports[_0x6e70('0x23')]=openIssue;exports[_0x6e70('0x24')]=function(_0xb29a2a,_0x4a0cfe){_0xb29a2a[_0x6e70('0x25')]['ip']=_0xb29a2a[_0x6e70('0x26')][_0x6e70('0x27')]||_0xb29a2a['connection'][_0x6e70('0x28')]||_0xb29a2a[_0x6e70('0x29')][_0x6e70('0x28')]||_0xb29a2a['connection'][_0x6e70('0x29')]['remoteAddress'];return openIssue(_0xb29a2a['body'],_0x4a0cfe);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 397b517..5794578 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 _0x9275=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x3b350e,_0x53580c){var _0x4e2bf2=function(_0xb880e1){while(--_0xb880e1){_0x3b350e['push'](_0x3b350e['shift']());}};_0x4e2bf2(++_0x53580c);}(_0x9275,0x77));var _0x5927=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x9275[_0x55d8c5];return _0x225ae5;};'use strict';var multer=require(_0x5927('0x0'));var util=require(_0x5927('0x1'));var path=require(_0x5927('0x2'));var timeout=require(_0x5927('0x3'));var express=require(_0x5927('0x4'));var router=express[_0x5927('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5927('0x6'));var config=require(_0x5927('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x5927('0x8')]('/',auth[_0x5927('0x9')](),controller['index']);router[_0x5927('0x8')](_0x5927('0xa'),auth[_0x5927('0x9')](),controller[_0x5927('0xb')]);router[_0x5927('0x8')](_0x5927('0xc'),auth[_0x5927('0x9')](),controller[_0x5927('0xd')]);router['post']('/',auth[_0x5927('0x9')](),controller[_0x5927('0xe')]);router[_0x5927('0xf')](_0x5927('0xc'),auth[_0x5927('0x9')](),controller[_0x5927('0x10')]);router[_0x5927('0x11')](_0x5927('0xc'),auth[_0x5927('0x9')](),controller[_0x5927('0x12')]);module[_0x5927('0x13')]=router; \ No newline at end of file +var _0xde50=['create','/:id','update','delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xde50,0x18c));var _0x0de5=function(_0x5ef905,_0x125a74){_0x5ef905=_0x5ef905-0x0;var _0x13e3f0=_0xde50[_0x5ef905];return _0x13e3f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0de5('0x0'));var timeout=require('connect-timeout');var express=require(_0x0de5('0x1'));var router=express[_0x0de5('0x2')]();var auth=require(_0x0de5('0x3'));var interaction=require(_0x0de5('0x4'));var config=require(_0x0de5('0x5'));var controller=require(_0x0de5('0x6'));router[_0x0de5('0x7')]('/',auth[_0x0de5('0x8')](),controller['index']);router['get'](_0x0de5('0x9'),auth[_0x0de5('0x8')](),controller[_0x0de5('0xa')]);router[_0x0de5('0x7')]('/:id',auth[_0x0de5('0x8')](),controller[_0x0de5('0xb')]);router['post']('/',auth[_0x0de5('0x8')](),controller[_0x0de5('0xc')]);router['put'](_0x0de5('0xd'),auth['isAuthenticated'](),controller[_0x0de5('0xe')]);router[_0x0de5('0xf')](_0x0de5('0xd'),auth[_0x0de5('0x8')](),controller[_0x0de5('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 8f79c7c..e222083 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 _0x6c63=['exports','STRING','TEXT','long','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6c63,0x1ee));var _0x36c6=function(_0x1be5f5,_0x3faf10){_0x1be5f5=_0x1be5f5-0x0;var _0x1a0636=_0x6c63[_0x1be5f5];return _0x1a0636;};'use strict';var Sequelize=require(_0x36c6('0x0'));module[_0x36c6('0x1')]={'question':{'type':Sequelize[_0x36c6('0x2')]},'answer':{'type':Sequelize[_0x36c6('0x3')](_0x36c6('0x4'))},'membername':{'type':Sequelize[_0x36c6('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x36c6('0x2')]},'uniqueid':{'type':Sequelize[_0x36c6('0x2')]},'calleridname':{'type':Sequelize[_0x36c6('0x2')]},'calleridnum':{'type':Sequelize[_0x36c6('0x2')]},'questionId':{'type':Sequelize[_0x36c6('0x2')]}}; \ No newline at end of file +var _0x70e0=['STRING','sequelize','exports'];(function(_0xfbc931,_0x2fb6bc){var _0x4e11f8=function(_0x3916bf){while(--_0x3916bf){_0xfbc931['push'](_0xfbc931['shift']());}};_0x4e11f8(++_0x2fb6bc);}(_0x70e0,0x17b));var _0x070e=function(_0x15853b,_0x57f5d6){_0x15853b=_0x15853b-0x0;var _0x4d3a22=_0x70e0[_0x15853b];return _0x4d3a22;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'question':{'type':Sequelize[_0x070e('0x2')]},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize[_0x070e('0x2')]},'projectname':{'type':Sequelize[_0x070e('0x2')]},'queue':{'type':Sequelize[_0x070e('0x2')]},'uniqueid':{'type':Sequelize[_0x070e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x070e('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index ed04ff0..49a6576 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 _0xd38c=['update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','save','destroy','end','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','catch','show','params','rawAttributes','find','then','create','body'];(function(_0x345988,_0x3ae74c){var _0x1e97ad=function(_0x596923){while(--_0x596923){_0x345988['push'](_0x345988['shift']());}};_0x1e97ad(++_0x3ae74c);}(_0xd38c,0x1b2));var _0xcd38=function(_0x5bd539,_0xa717d9){_0x5bd539=_0x5bd539-0x0;var _0x40f1b5=_0xd38c[_0x5bd539];return _0x40f1b5;};'use strict';var pdf=require(_0xcd38('0x0'));var emlformat=require(_0xcd38('0x1'));var rimraf=require(_0xcd38('0x2'));var zipdir=require(_0xcd38('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd38('0x4'));var moment=require(_0xcd38('0x5'));var BPromise=require(_0xcd38('0x6'));var Mustache=require('mustache');var util=require(_0xcd38('0x7'));var path=require(_0xcd38('0x8'));var sox=require('sox');var csv=require(_0xcd38('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcd38('0xa'));var squel=require(_0xcd38('0xb'));var crypto=require(_0xcd38('0xc'));var jsforce=require(_0xcd38('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcd38('0x9'));var querystring=require(_0xcd38('0xe'));var Papa=require(_0xcd38('0xf'));var Redis=require(_0xcd38('0x10'));var authService=require(_0xcd38('0x11'));var qs=require(_0xcd38('0x12'));var hardwareService=require(_0xcd38('0x13'));var logger=require(_0xcd38('0x14'))(_0xcd38('0x15'));var utils=require(_0xcd38('0x16'));var config=require('../../config/environment');var db=require(_0xcd38('0x17'))['db'];function respondWithStatusCode(_0x75f6d,_0x54656d){_0x54656d=_0x54656d||0xcc;return function(_0x1c7c46){if(_0x1c7c46){return _0x75f6d[_0xcd38('0x18')](_0x54656d);}return _0x75f6d[_0xcd38('0x19')](_0x54656d)['end']();};}function respondWithResult(_0x33f707,_0x501cae){_0x501cae=_0x501cae||0xc8;return function(_0x5d36f4){if(_0x5d36f4){return _0x33f707[_0xcd38('0x19')](_0x501cae)[_0xcd38('0x1a')](_0x5d36f4);}};}function respondWithFilteredResult(_0x4a6d72,_0x3b8153){return function(_0x3e55dd){if(_0x3e55dd){var _0x5a2621=_0x3e55dd[_0xcd38('0x1b')],_0x543d67=_0x3b8153[_0xcd38('0x1c')],_0x525a8d=_0x3b8153['offset']+_0x3b8153['limit'],_0x11a74a;if(_0x525a8d>=_0x5a2621){_0x525a8d=_0x5a2621;_0x11a74a=0xc8;}else{_0x11a74a=0xce;}_0x4a6d72['status'](_0x11a74a);return _0x4a6d72['set'](_0xcd38('0x1d'),_0x543d67+'-'+_0x525a8d+'/'+_0x5a2621)[_0xcd38('0x1a')](_0x3e55dd);}return null;};}function patchUpdates(_0x20710b){return function(_0x1861c0){try{jsonpatch['apply'](_0x1861c0,_0x20710b,!![]);}catch(_0x629f0f){return BPromise['reject'](_0x629f0f);}return _0x1861c0[_0xcd38('0x1e')]();};}function saveUpdates(_0x129726,_0x37c1e7){return function(_0xbcee87){if(_0xbcee87){return _0xbcee87['update'](_0x129726)['then'](function(_0x26a360){return _0x26a360;});}return null;};}function removeEntity(_0xfe82e7,_0x121473){return function(_0x513b0e){if(_0x513b0e){return _0x513b0e[_0xcd38('0x1f')]()['then'](function(){_0xfe82e7[_0xcd38('0x19')](0xcc)[_0xcd38('0x20')]();});}};}function handleEntityNotFound(_0x3c55db,_0xd70472){return function(_0x519fc2){if(!_0x519fc2){_0x3c55db[_0xcd38('0x18')](0x194);}return _0x519fc2;};}function handleError(_0x124951,_0x36b1b7){_0x36b1b7=_0x36b1b7||0x1f4;return function(_0xc4afc6){logger[_0xcd38('0x21')](_0xc4afc6['stack']);if(_0xc4afc6[_0xcd38('0x22')]){delete _0xc4afc6[_0xcd38('0x22')];}_0x124951[_0xcd38('0x19')](_0x36b1b7)[_0xcd38('0x23')](_0xc4afc6);};}exports[_0xcd38('0x24')]=function(_0x3b2ff0,_0x1a2172){var _0x4b5fc9={},_0x4e41c5={},_0x314042={'count':0x0,'rows':[]};var _0x1e049e=db['JscriptyAnswerReport']['rawAttributes'];_0x4e41c5[_0xcd38('0x25')]=_['keys'](_0x1e049e);_0x4e41c5['query']=_[_0xcd38('0x26')](_0x3b2ff0[_0xcd38('0x27')]);_0x4e41c5[_0xcd38('0x28')]=_[_0xcd38('0x29')](_0x4e41c5[_0xcd38('0x25')],_0x4e41c5['query']);_0x4b5fc9[_0xcd38('0x2a')]=_[_0xcd38('0x29')](_0x4e41c5['model'],qs[_0xcd38('0x2b')](_0x3b2ff0[_0xcd38('0x27')][_0xcd38('0x2b')]));_0x4b5fc9[_0xcd38('0x2a')]=_0x4b5fc9[_0xcd38('0x2a')][_0xcd38('0x2c')]?_0x4b5fc9[_0xcd38('0x2a')]:_0x4e41c5[_0xcd38('0x25')];if(!_0x3b2ff0[_0xcd38('0x27')][_0xcd38('0x2d')](_0xcd38('0x2e'))){_0x4b5fc9[_0xcd38('0x2f')]=qs['limit'](_0x3b2ff0[_0xcd38('0x27')][_0xcd38('0x2f')]);_0x4b5fc9['offset']=qs[_0xcd38('0x1c')](_0x3b2ff0['query'][_0xcd38('0x1c')]);}_0x4b5fc9[_0xcd38('0x30')]=qs['sort'](_0x3b2ff0[_0xcd38('0x27')][_0xcd38('0x31')]);_0x4b5fc9['where']=qs[_0xcd38('0x28')](_[_0xcd38('0x32')](_0x3b2ff0[_0xcd38('0x27')],_0x4e41c5['filters']));if(_0x3b2ff0[_0xcd38('0x27')][_0xcd38('0x33')]){_0x4b5fc9[_0xcd38('0x34')]=_[_0xcd38('0x35')](_0x4b5fc9['where'],{'$or':_[_0xcd38('0x36')](_0x1e049e,function(_0x525142){if(_0x525142[_0xcd38('0x37')][_0xcd38('0x38')]!==_0xcd38('0x39')){var _0x20af9a={};_0x20af9a[_0x525142['field']]={'$like':'%'+_0x3b2ff0['query'][_0xcd38('0x33')]+'%'};return _0x20af9a;}})});}_0x4b5fc9=_[_0xcd38('0x35')]({},_0x4b5fc9,_0x3b2ff0['options']);var _0x3721c1={'where':_0x4b5fc9[_0xcd38('0x34')]};return db[_0xcd38('0x3a')][_0xcd38('0x1b')](_0x3721c1)['then'](function(_0x484769){_0x314042[_0xcd38('0x1b')]=_0x484769;if(_0x3b2ff0['query'][_0xcd38('0x3b')]){_0x4b5fc9[_0xcd38('0x3c')]=[{'all':!![]}];}return db[_0xcd38('0x3a')][_0xcd38('0x3d')](_0x4b5fc9);})['then'](function(_0x412cbd){_0x314042['rows']=_0x412cbd;return _0x314042;})['then'](respondWithFilteredResult(_0x1a2172,_0x4b5fc9))[_0xcd38('0x3e')](handleError(_0x1a2172,null));};exports[_0xcd38('0x3f')]=function(_0xdbc882,_0x36e11a){var _0xa69a7f={'raw':!![],'where':{'id':_0xdbc882[_0xcd38('0x40')]['id']}},_0x757bcd={};_0x757bcd['model']=_[_0xcd38('0x26')](db['JscriptyAnswerReport'][_0xcd38('0x41')]);_0x757bcd[_0xcd38('0x27')]=_[_0xcd38('0x26')](_0xdbc882[_0xcd38('0x27')]);_0x757bcd[_0xcd38('0x28')]=_['intersection'](_0x757bcd[_0xcd38('0x25')],_0x757bcd[_0xcd38('0x27')]);_0xa69a7f[_0xcd38('0x2a')]=_[_0xcd38('0x29')](_0x757bcd['model'],qs['fields'](_0xdbc882[_0xcd38('0x27')][_0xcd38('0x2b')]));_0xa69a7f[_0xcd38('0x2a')]=_0xa69a7f[_0xcd38('0x2a')][_0xcd38('0x2c')]?_0xa69a7f['attributes']:_0x757bcd[_0xcd38('0x25')];if(_0xdbc882[_0xcd38('0x27')][_0xcd38('0x3b')]){_0xa69a7f[_0xcd38('0x3c')]=[{'all':!![]}];}_0xa69a7f=_[_0xcd38('0x35')]({},_0xa69a7f,_0xdbc882['options']);return db[_0xcd38('0x3a')][_0xcd38('0x42')](_0xa69a7f)[_0xcd38('0x43')](handleEntityNotFound(_0x36e11a,null))[_0xcd38('0x43')](respondWithResult(_0x36e11a,null))['catch'](handleError(_0x36e11a,null));};exports['create']=function(_0x232022,_0x31b3ed){return db['JscriptyAnswerReport'][_0xcd38('0x44')](_0x232022[_0xcd38('0x45')],{})[_0xcd38('0x43')](respondWithResult(_0x31b3ed,0xc9))['catch'](handleError(_0x31b3ed,null));};exports[_0xcd38('0x46')]=function(_0x4d6a0f,_0xeded7c){if(_0x4d6a0f[_0xcd38('0x45')]['id']){delete _0x4d6a0f[_0xcd38('0x45')]['id'];}return db[_0xcd38('0x3a')][_0xcd38('0x42')]({'where':{'id':_0x4d6a0f[_0xcd38('0x40')]['id']}})[_0xcd38('0x43')](handleEntityNotFound(_0xeded7c,null))[_0xcd38('0x43')](saveUpdates(_0x4d6a0f[_0xcd38('0x45')],null))[_0xcd38('0x43')](respondWithResult(_0xeded7c,null))[_0xcd38('0x3e')](handleError(_0xeded7c,null));};exports[_0xcd38('0x1f')]=function(_0x1a67f6,_0x4e23f8){return db[_0xcd38('0x3a')][_0xcd38('0x42')]({'where':{'id':_0x1a67f6[_0xcd38('0x40')]['id']}})[_0xcd38('0x43')](handleEntityNotFound(_0x4e23f8,null))[_0xcd38('0x43')](removeEntity(_0x4e23f8,null))[_0xcd38('0x3e')](handleError(_0x4e23f8,null));};exports[_0xcd38('0x47')]=function(_0xc3e769,_0x58398f){return db['JscriptyAnswerReport'][_0xcd38('0x47')]()['then'](respondWithResult(_0x58398f,null))['catch'](handleError(_0x58398f,null));}; \ No newline at end of file +var _0x1944=['status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','JscriptyAnswerReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','map','type','field','options','count','includeAll','findAll','catch','show','params','include','merge','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus'];(function(_0x4d1092,_0x5555cb){var _0x4beae6=function(_0x220115){while(--_0x220115){_0x4d1092['push'](_0x4d1092['shift']());}};_0x4beae6(++_0x5555cb);}(_0x1944,0x1d3));var _0x4194=function(_0x390b37,_0x529e36){_0x390b37=_0x390b37-0x0;var _0x4e0197=_0x1944[_0x390b37];return _0x4e0197;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4194('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4194('0x1'));var rp=require(_0x4194('0x2'));var moment=require(_0x4194('0x3'));var BPromise=require(_0x4194('0x4'));var Mustache=require(_0x4194('0x5'));var util=require('util');var path=require(_0x4194('0x6'));var sox=require(_0x4194('0x7'));var csv=require(_0x4194('0x8'));var ejs=require(_0x4194('0x9'));var fs=require('fs');var _=require(_0x4194('0xa'));var squel=require(_0x4194('0xb'));var crypto=require(_0x4194('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4194('0x8'));var querystring=require(_0x4194('0xd'));var Papa=require(_0x4194('0xe'));var Redis=require(_0x4194('0xf'));var authService=require(_0x4194('0x10'));var qs=require(_0x4194('0x11'));var hardwareService=require(_0x4194('0x12'));var logger=require(_0x4194('0x13'))(_0x4194('0x14'));var utils=require(_0x4194('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50c14b,_0x2e1a09){_0x2e1a09=_0x2e1a09||0xcc;return function(_0x18a366){if(_0x18a366){return _0x50c14b[_0x4194('0x16')](_0x2e1a09);}return _0x50c14b[_0x4194('0x17')](_0x2e1a09)[_0x4194('0x18')]();};}function respondWithResult(_0x3db833,_0x586243){_0x586243=_0x586243||0xc8;return function(_0x4d214b){if(_0x4d214b){return _0x3db833[_0x4194('0x17')](_0x586243)[_0x4194('0x19')](_0x4d214b);}};}function respondWithFilteredResult(_0x586466,_0x30d899){return function(_0x3cee05){if(_0x3cee05){var _0x106d73=_0x3cee05['count'],_0x4c00cb=_0x30d899[_0x4194('0x1a')],_0x102b36=_0x30d899[_0x4194('0x1a')]+_0x30d899[_0x4194('0x1b')],_0x5609f8;if(_0x102b36>=_0x106d73){_0x102b36=_0x106d73;_0x5609f8=0xc8;}else{_0x5609f8=0xce;}_0x586466[_0x4194('0x17')](_0x5609f8);return _0x586466[_0x4194('0x1c')]('Content-Range',_0x4c00cb+'-'+_0x102b36+'/'+_0x106d73)[_0x4194('0x19')](_0x3cee05);}return null;};}function patchUpdates(_0x1639d9){return function(_0x1bc4c0){try{jsonpatch[_0x4194('0x1d')](_0x1bc4c0,_0x1639d9,!![]);}catch(_0x22a737){return BPromise[_0x4194('0x1e')](_0x22a737);}return _0x1bc4c0[_0x4194('0x1f')]();};}function saveUpdates(_0x350150,_0x2fcc2c){return function(_0x359bea){if(_0x359bea){return _0x359bea[_0x4194('0x20')](_0x350150)[_0x4194('0x21')](function(_0x2ecbca){return _0x2ecbca;});}return null;};}function removeEntity(_0x47ab98,_0x4ef163){return function(_0x2786f1){if(_0x2786f1){return _0x2786f1[_0x4194('0x22')]()['then'](function(){_0x47ab98['status'](0xcc)[_0x4194('0x18')]();});}};}function handleEntityNotFound(_0x2fbe6d,_0x323fed){return function(_0x1e4981){if(!_0x1e4981){_0x2fbe6d[_0x4194('0x16')](0x194);}return _0x1e4981;};}function handleError(_0x3d1b5d,_0x37e041){_0x37e041=_0x37e041||0x1f4;return function(_0x2da248){logger['error'](_0x2da248[_0x4194('0x23')]);if(_0x2da248[_0x4194('0x24')]){delete _0x2da248['name'];}_0x3d1b5d['status'](_0x37e041)[_0x4194('0x25')](_0x2da248);};}exports[_0x4194('0x26')]=function(_0x3bb1fb,_0x56c089){var _0x4e3dfb={},_0x47da5c={},_0x204aeb={'count':0x0,'rows':[]};var _0x2bd6cb=db[_0x4194('0x27')][_0x4194('0x28')];_0x47da5c[_0x4194('0x29')]=_[_0x4194('0x2a')](_0x2bd6cb);_0x47da5c['query']=_[_0x4194('0x2a')](_0x3bb1fb[_0x4194('0x2b')]);_0x47da5c['filters']=_[_0x4194('0x2c')](_0x47da5c[_0x4194('0x29')],_0x47da5c['query']);_0x4e3dfb[_0x4194('0x2d')]=_[_0x4194('0x2c')](_0x47da5c[_0x4194('0x29')],qs[_0x4194('0x2e')](_0x3bb1fb[_0x4194('0x2b')][_0x4194('0x2e')]));_0x4e3dfb[_0x4194('0x2d')]=_0x4e3dfb[_0x4194('0x2d')][_0x4194('0x2f')]?_0x4e3dfb[_0x4194('0x2d')]:_0x47da5c['model'];if(!_0x3bb1fb[_0x4194('0x2b')]['hasOwnProperty']('nolimit')){_0x4e3dfb['limit']=qs[_0x4194('0x1b')](_0x3bb1fb['query'][_0x4194('0x1b')]);_0x4e3dfb[_0x4194('0x1a')]=qs[_0x4194('0x1a')](_0x3bb1fb[_0x4194('0x2b')][_0x4194('0x1a')]);}_0x4e3dfb[_0x4194('0x30')]=qs[_0x4194('0x31')](_0x3bb1fb[_0x4194('0x2b')][_0x4194('0x31')]);_0x4e3dfb[_0x4194('0x32')]=qs['filters'](_[_0x4194('0x33')](_0x3bb1fb[_0x4194('0x2b')],_0x47da5c[_0x4194('0x34')]));if(_0x3bb1fb[_0x4194('0x2b')][_0x4194('0x35')]){_0x4e3dfb['where']=_['merge'](_0x4e3dfb[_0x4194('0x32')],{'$or':_[_0x4194('0x36')](_0x2bd6cb,function(_0x299c81){if(_0x299c81[_0x4194('0x37')]['key']!=='VIRTUAL'){var _0x35bd04={};_0x35bd04[_0x299c81[_0x4194('0x38')]]={'$like':'%'+_0x3bb1fb[_0x4194('0x2b')]['filter']+'%'};return _0x35bd04;}})});}_0x4e3dfb=_['merge']({},_0x4e3dfb,_0x3bb1fb[_0x4194('0x39')]);var _0x4730f7={'where':_0x4e3dfb['where']};return db[_0x4194('0x27')]['count'](_0x4730f7)['then'](function(_0x3a1a8e){_0x204aeb[_0x4194('0x3a')]=_0x3a1a8e;if(_0x3bb1fb[_0x4194('0x2b')][_0x4194('0x3b')]){_0x4e3dfb['include']=[{'all':!![]}];}return db[_0x4194('0x27')][_0x4194('0x3c')](_0x4e3dfb);})[_0x4194('0x21')](function(_0x468095){_0x204aeb['rows']=_0x468095;return _0x204aeb;})[_0x4194('0x21')](respondWithFilteredResult(_0x56c089,_0x4e3dfb))[_0x4194('0x3d')](handleError(_0x56c089,null));};exports[_0x4194('0x3e')]=function(_0x3db9f1,_0x298d09){var _0x1db0a1={'raw':!![],'where':{'id':_0x3db9f1[_0x4194('0x3f')]['id']}},_0xc823ee={};_0xc823ee[_0x4194('0x29')]=_[_0x4194('0x2a')](db[_0x4194('0x27')][_0x4194('0x28')]);_0xc823ee[_0x4194('0x2b')]=_[_0x4194('0x2a')](_0x3db9f1[_0x4194('0x2b')]);_0xc823ee[_0x4194('0x34')]=_[_0x4194('0x2c')](_0xc823ee['model'],_0xc823ee[_0x4194('0x2b')]);_0x1db0a1[_0x4194('0x2d')]=_[_0x4194('0x2c')](_0xc823ee[_0x4194('0x29')],qs[_0x4194('0x2e')](_0x3db9f1[_0x4194('0x2b')][_0x4194('0x2e')]));_0x1db0a1[_0x4194('0x2d')]=_0x1db0a1['attributes'][_0x4194('0x2f')]?_0x1db0a1['attributes']:_0xc823ee[_0x4194('0x29')];if(_0x3db9f1[_0x4194('0x2b')]['includeAll']){_0x1db0a1[_0x4194('0x40')]=[{'all':!![]}];}_0x1db0a1=_[_0x4194('0x41')]({},_0x1db0a1,_0x3db9f1[_0x4194('0x39')]);return db[_0x4194('0x27')][_0x4194('0x42')](_0x1db0a1)[_0x4194('0x21')](handleEntityNotFound(_0x298d09,null))[_0x4194('0x21')](respondWithResult(_0x298d09,null))['catch'](handleError(_0x298d09,null));};exports[_0x4194('0x43')]=function(_0x2657ac,_0x52932a){return db[_0x4194('0x27')][_0x4194('0x43')](_0x2657ac[_0x4194('0x44')],{})[_0x4194('0x21')](respondWithResult(_0x52932a,0xc9))['catch'](handleError(_0x52932a,null));};exports[_0x4194('0x20')]=function(_0xa9d121,_0x31eaef){if(_0xa9d121['body']['id']){delete _0xa9d121['body']['id'];}return db[_0x4194('0x27')][_0x4194('0x42')]({'where':{'id':_0xa9d121[_0x4194('0x3f')]['id']}})[_0x4194('0x21')](handleEntityNotFound(_0x31eaef,null))['then'](saveUpdates(_0xa9d121[_0x4194('0x44')],null))['then'](respondWithResult(_0x31eaef,null))['catch'](handleError(_0x31eaef,null));};exports[_0x4194('0x22')]=function(_0x385c43,_0x4c0d9b){return db[_0x4194('0x27')][_0x4194('0x42')]({'where':{'id':_0x385c43[_0x4194('0x3f')]['id']}})[_0x4194('0x21')](handleEntityNotFound(_0x4c0d9b,null))['then'](removeEntity(_0x4c0d9b,null))[_0x4194('0x3d')](handleError(_0x4c0d9b,null));};exports[_0x4194('0x45')]=function(_0x2f6254,_0x5b342f){return db[_0x4194('0x27')][_0x4194('0x45')]()[_0x4194('0x21')](respondWithResult(_0x5b342f,null))['catch'](handleError(_0x5b342f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 48b9d8e..d43ba3e 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 _0x5a15=['exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x827fa5,_0x5e2e63){var _0x22aeca=function(_0x11d81f){while(--_0x11d81f){_0x827fa5['push'](_0x827fa5['shift']());}};_0x22aeca(++_0x5e2e63);}(_0x5a15,0x10b));var _0x55a1=function(_0x412d09,_0x2c5537){_0x412d09=_0x412d09-0x0;var _0x2711b9=_0x5a15[_0x412d09];return _0x2711b9;};'use strict';var _=require(_0x55a1('0x0'));var util=require(_0x55a1('0x1'));var logger=require(_0x55a1('0x2'))('api');var moment=require(_0x55a1('0x3'));var BPromise=require(_0x55a1('0x4'));var rp=require(_0x55a1('0x5'));var fs=require('fs');var path=require(_0x55a1('0x6'));var rimraf=require('rimraf');var config=require(_0x55a1('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x55a1('0x8')]=function(_0x9c9fa4,_0x193482){return _0x9c9fa4[_0x55a1('0x9')](_0x55a1('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0b2=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','request-promise'];(function(_0x4465b0,_0x488879){var _0x3dffd2=function(_0x305736){while(--_0x305736){_0x4465b0['push'](_0x4465b0['shift']());}};_0x3dffd2(++_0x488879);}(_0xd0b2,0x1ab));var _0x2d0b=function(_0x5ed2b8,_0x1da1e5){_0x5ed2b8=_0x5ed2b8-0x0;var _0x306700=_0xd0b2[_0x5ed2b8];return _0x306700;};'use strict';var _=require('lodash');var util=require(_0x2d0b('0x0'));var logger=require(_0x2d0b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d0b('0x2'));var fs=require('fs');var path=require(_0x2d0b('0x3'));var rimraf=require(_0x2d0b('0x4'));var config=require(_0x2d0b('0x5'));var attributes=require(_0x2d0b('0x6'));module[_0x2d0b('0x7')]=function(_0x41ccad,_0x3afeed){return _0x41ccad['define'](_0x2d0b('0x8'),attributes,{'tableName':_0x2d0b('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 dd6b580..a7213d8 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 _0xcea0=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x370de7,_0x1002e5){var _0x4726a9=function(_0x200a4b){while(--_0x200a4b){_0x370de7['push'](_0x370de7['shift']());}};_0x4726a9(++_0x1002e5);}(_0xcea0,0xf7));var _0x0cea=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xcea0[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x0cea('0x0'));var util=require(_0x0cea('0x1'));var moment=require(_0x0cea('0x2'));var BPromise=require(_0x0cea('0x3'));var rs=require(_0x0cea('0x4'));var fs=require('fs');var Redis=require(_0x0cea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cea('0x6'));var logger=require('../../config/logger')(_0x0cea('0x7'));var config=require(_0x0cea('0x8'));var jayson=require(_0x0cea('0x9'));var client=jayson[_0x0cea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1661bf,_0x505cdc,_0x4eaf32){return new BPromise(function(_0x571124,_0x3b2a1c){return client[_0x0cea('0xb')](_0x1661bf,_0x4eaf32)[_0x0cea('0xc')](function(_0x1f2f33){logger[_0x0cea('0xd')](_0x0cea('0xe'),_0x505cdc,_0x0cea('0xf'));logger[_0x0cea('0x10')](_0x0cea('0x11'),_0x505cdc,_0x0cea('0xf'),JSON[_0x0cea('0x12')](_0x1f2f33));if(_0x1f2f33[_0x0cea('0x13')]){if(_0x1f2f33[_0x0cea('0x13')][_0x0cea('0x14')]===0x1f4){logger['error'](_0x0cea('0xe'),_0x505cdc,_0x1f2f33[_0x0cea('0x13')][_0x0cea('0x15')]);return _0x3b2a1c(_0x1f2f33['error']['message']);}logger[_0x0cea('0x13')](_0x0cea('0xe'),_0x505cdc,_0x1f2f33['error'][_0x0cea('0x15')]);return _0x571124(_0x1f2f33[_0x0cea('0x13')][_0x0cea('0x15')]);}else{logger[_0x0cea('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x505cdc,'request\x20sent');_0x571124(_0x1f2f33[_0x0cea('0x16')][_0x0cea('0x15')]);}})[_0x0cea('0x17')](function(_0x1c888a){logger[_0x0cea('0x13')](_0x0cea('0xe'),_0x505cdc,_0x1c888a);_0x3b2a1c(_0x1c888a);});});} \ No newline at end of file +var _0x689b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','lodash','moment'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x689b,0x142));var _0xb689=function(_0x33ea31,_0x5cd821){_0x33ea31=_0x33ea31-0x0;var _0x18eec2=_0x689b[_0x33ea31];return _0x18eec2;};'use strict';var _=require(_0xb689('0x0'));var util=require('util');var moment=require(_0xb689('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb689('0x2'));var db=require(_0xb689('0x3'))['db'];var utils=require(_0xb689('0x4'));var logger=require(_0xb689('0x5'))(_0xb689('0x6'));var config=require(_0xb689('0x7'));var jayson=require(_0xb689('0x8'));var client=jayson['client'][_0xb689('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ee263,_0x47752c,_0x56c6ba){return new BPromise(function(_0x6eaf58,_0x1cad3e){return client[_0xb689('0xa')](_0x5ee263,_0x56c6ba)['then'](function(_0x14ef33){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x47752c,_0xb689('0xb'));logger['debug'](_0xb689('0xc'),_0x47752c,'request\x20sent',JSON[_0xb689('0xd')](_0x14ef33));if(_0x14ef33[_0xb689('0xe')]){if(_0x14ef33[_0xb689('0xe')][_0xb689('0xf')]===0x1f4){logger[_0xb689('0xe')](_0xb689('0x10'),_0x47752c,_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);return _0x1cad3e(_0x14ef33[_0xb689('0xe')]['message']);}logger[_0xb689('0xe')](_0xb689('0x10'),_0x47752c,_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);return _0x6eaf58(_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);}else{logger['info'](_0xb689('0x10'),_0x47752c,_0xb689('0xb'));_0x6eaf58(_0x14ef33['result'][_0xb689('0x11')]);}})['catch'](function(_0xf950eb){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x47752c,_0xf950eb);_0x1cad3e(_0xf950eb);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b5da445..d90f7ef 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 _0x9e8e=['connect-timeout','Router','./jscriptyProject.controller','isAuthenticated','index','get','show','/:id/sessions','getSessions','post','create','clone','put','delete','/:id','destroy','exports','multer','util','path'];(function(_0x51536b,_0x18c2ee){var _0x4a2476=function(_0x5c9734){while(--_0x5c9734){_0x51536b['push'](_0x51536b['shift']());}};_0x4a2476(++_0x18c2ee);}(_0x9e8e,0x179));var _0xe9e8=function(_0x16f0dd,_0x5c327e){_0x16f0dd=_0x16f0dd-0x0;var _0x4efab2=_0x9e8e[_0x16f0dd];return _0x4efab2;};'use strict';var multer=require(_0xe9e8('0x0'));var util=require(_0xe9e8('0x1'));var path=require(_0xe9e8('0x2'));var timeout=require(_0xe9e8('0x3'));var express=require('express');var router=express[_0xe9e8('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe9e8('0x5'));router['get']('/',auth[_0xe9e8('0x6')](),controller[_0xe9e8('0x7')]);router[_0xe9e8('0x8')]('/:id',auth[_0xe9e8('0x6')](),controller[_0xe9e8('0x9')]);router['get'](_0xe9e8('0xa'),auth[_0xe9e8('0x6')](),controller[_0xe9e8('0xb')]);router['get']('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xe9e8('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout('30s'),controller['getSummary']);router[_0xe9e8('0xc')]('/',auth[_0xe9e8('0x6')](),controller[_0xe9e8('0xd')]);router[_0xe9e8('0xc')]('/:id/clone',auth[_0xe9e8('0x6')](),controller[_0xe9e8('0xe')]);router[_0xe9e8('0xf')]('/:id',auth[_0xe9e8('0x6')](),controller['update']);router[_0xe9e8('0x10')](_0xe9e8('0x11'),auth[_0xe9e8('0x6')](),controller[_0xe9e8('0x12')]);module[_0xe9e8('0x13')]=router; \ No newline at end of file +var _0xaa65=['../../config/environment','isAuthenticated','index','get','/:id','/:id/answers','30s','getSummary','post','create','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3a6772,_0x6c05d0){var _0x21a255=function(_0x189c41){while(--_0x189c41){_0x3a6772['push'](_0x3a6772['shift']());}};_0x21a255(++_0x6c05d0);}(_0xaa65,0x14b));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var path=require(_0x5aa6('0x2'));var timeout=require(_0x5aa6('0x3'));var express=require('express');var router=express[_0x5aa6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5aa6('0x5'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x5aa6('0x6')](),controller[_0x5aa6('0x7')]);router[_0x5aa6('0x8')](_0x5aa6('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5aa6('0x8')]('/:id/sessions',auth[_0x5aa6('0x6')](),controller['getSessions']);router[_0x5aa6('0x8')](_0x5aa6('0xa'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x5aa6('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x5aa6('0xb')),controller[_0x5aa6('0xc')]);router[_0x5aa6('0xd')]('/',auth[_0x5aa6('0x6')](),controller[_0x5aa6('0xe')]);router[_0x5aa6('0xd')]('/:id/clone',auth[_0x5aa6('0x6')](),controller[_0x5aa6('0xf')]);router[_0x5aa6('0x10')](_0x5aa6('0x9'),auth['isAuthenticated'](),controller[_0x5aa6('0x11')]);router[_0x5aa6('0x12')](_0x5aa6('0x9'),auth[_0x5aa6('0x6')](),controller[_0x5aa6('0x13')]);module[_0x5aa6('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index c4c0eaf..c43dfff 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 _0xdb76=['formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','STRING','name','TEXT','long','setDataValue'];(function(_0x5dd81d,_0x32880b){var _0x2b66d4=function(_0x78429b){while(--_0x78429b){_0x5dd81d['push'](_0x5dd81d['shift']());}};_0x2b66d4(++_0x32880b);}(_0xdb76,0x19a));var _0x6db7=function(_0x3f10f9,_0x310420){_0x3f10f9=_0x3f10f9-0x0;var _0x5abdcf=_0xdb76[_0x3f10f9];return _0x5abdcf;};'use strict';var Sequelize=require(_0x6db7('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x6db7('0x1')],'unique':_0x6db7('0x2')},'description':{'type':Sequelize[_0x6db7('0x1')]},'formData':{'type':Sequelize[_0x6db7('0x3')](_0x6db7('0x4')),'set':function(_0x4c325b){if(_['isObjectLike'](_0x4c325b)){this[_0x6db7('0x5')](_0x6db7('0x6'),JSON[_0x6db7('0x7')](_0x4c325b));}else if(_[_0x6db7('0x8')](_0x4c325b)){this['setDataValue']('formData',_0x4c325b);}else{this[_0x6db7('0x5')](_0x6db7('0x6'),util[_0x6db7('0x9')](_0x6db7('0xa'),this['getDataValue'](_0x6db7('0x2'))||'',this[_0x6db7('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6db7('0xc')],'defaultValue':!![]}}; \ No newline at end of file +var _0x12fc=['formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','sequelize','util','STRING','long','isObjectLike','setDataValue'];(function(_0x1fddd3,_0x516c77){var _0x248c0d=function(_0x527cdf){while(--_0x527cdf){_0x1fddd3['push'](_0x1fddd3['shift']());}};_0x248c0d(++_0x516c77);}(_0x12fc,0xe8));var _0xc12f=function(_0x267e53,_0x22981a){_0x267e53=_0x267e53-0x0;var _0x4ca9aa=_0x12fc[_0x267e53];return _0x4ca9aa;};'use strict';var Sequelize=require(_0xc12f('0x0'));var _=require('lodash');var util=require(_0xc12f('0x1'));module['exports']={'name':{'type':Sequelize[_0xc12f('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xc12f('0x3')),'set':function(_0x322fbe){if(_[_0xc12f('0x4')](_0x322fbe)){this[_0xc12f('0x5')](_0xc12f('0x6'),JSON[_0xc12f('0x7')](_0x322fbe));}else if(_[_0xc12f('0x8')](_0x322fbe)){this[_0xc12f('0x5')](_0xc12f('0x6'),_0x322fbe);}else{this[_0xc12f('0x5')]('formData',util[_0xc12f('0x9')](_0xc12f('0xa'),this[_0xc12f('0xb')](_0xc12f('0xc'))||'',this[_0xc12f('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc12f('0xd')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index b378d36..0a14633 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 _0x8391=['getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','update','then','get','Projects','UserProfileResource','destroy','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','JscriptySessionReport','hasOwnProperty','getAnswers','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace'];(function(_0x428303,_0x129220){var _0x2fba7f=function(_0x15f3d2){while(--_0x15f3d2){_0x428303['push'](_0x428303['shift']());}};_0x2fba7f(++_0x129220);}(_0x8391,0x109));var _0x1839=function(_0x125282,_0x2215a2){_0x125282=_0x125282-0x0;var _0x5dd9a6=_0x8391[_0x125282];return _0x5dd9a6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1839('0x0'));var rimraf=require(_0x1839('0x1'));var zipdir=require(_0x1839('0x2'));var jsonpatch=require(_0x1839('0x3'));var rp=require(_0x1839('0x4'));var moment=require(_0x1839('0x5'));var BPromise=require(_0x1839('0x6'));var Mustache=require(_0x1839('0x7'));var util=require(_0x1839('0x8'));var path=require(_0x1839('0x9'));var sox=require('sox');var csv=require(_0x1839('0xa'));var ejs=require(_0x1839('0xb'));var fs=require('fs');var _=require(_0x1839('0xc'));var squel=require(_0x1839('0xd'));var crypto=require(_0x1839('0xe'));var jsforce=require(_0x1839('0xf'));var deskjs=require(_0x1839('0x10'));var toCsv=require(_0x1839('0xa'));var querystring=require(_0x1839('0x11'));var Papa=require(_0x1839('0x12'));var Redis=require('ioredis');var authService=require(_0x1839('0x13'));var qs=require(_0x1839('0x14'));var hardwareService=require(_0x1839('0x15'));var logger=require(_0x1839('0x16'))(_0x1839('0x17'));var utils=require(_0x1839('0x18'));var config=require(_0x1839('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14fdf3,_0x4366f7){_0x4366f7=_0x4366f7||0xcc;return function(_0x4eb638){if(_0x4eb638){return _0x14fdf3[_0x1839('0x1a')](_0x4366f7);}return _0x14fdf3[_0x1839('0x1b')](_0x4366f7)[_0x1839('0x1c')]();};}function respondWithResult(_0x1a7067,_0x4b9b95){_0x4b9b95=_0x4b9b95||0xc8;return function(_0x4e50e2){if(_0x4e50e2){return _0x1a7067[_0x1839('0x1b')](_0x4b9b95)[_0x1839('0x1d')](_0x4e50e2);}};}function respondWithFilteredResult(_0x4ce467,_0x764cc2){return function(_0x5f08c6){if(_0x5f08c6){var _0x2b92d0=_0x5f08c6[_0x1839('0x1e')],_0x1d9a1f=_0x764cc2['offset'],_0xc05bd7=_0x764cc2[_0x1839('0x1f')]+_0x764cc2[_0x1839('0x20')],_0x56c23b;if(_0xc05bd7>=_0x2b92d0){_0xc05bd7=_0x2b92d0;_0x56c23b=0xc8;}else{_0x56c23b=0xce;}_0x4ce467[_0x1839('0x1b')](_0x56c23b);return _0x4ce467['set']('Content-Range',_0x1d9a1f+'-'+_0xc05bd7+'/'+_0x2b92d0)[_0x1839('0x1d')](_0x5f08c6);}return null;};}function patchUpdates(_0x3ba0fb){return function(_0x2eaada){try{jsonpatch[_0x1839('0x21')](_0x2eaada,_0x3ba0fb,!![]);}catch(_0x166609){return BPromise['reject'](_0x166609);}return _0x2eaada['save']();};}function saveUpdates(_0x6903b8,_0x36ea21){return function(_0x30c642){if(_0x30c642){return _0x30c642[_0x1839('0x22')](_0x6903b8)['then'](function(_0xf314aa){return _0xf314aa;});}return null;};}function removeEntity(_0x229838,_0x35ffed){return function(_0x39a557){if(_0x39a557){return _0x39a557['destroy']()[_0x1839('0x23')](function(){var _0x2836c5=_0x39a557[_0x1839('0x24')]({'plain':!![]});var _0x1a5e4b=_0x1839('0x25');return db[_0x1839('0x26')][_0x1839('0x27')]({'where':{'type':_0x1a5e4b,'resourceId':_0x2836c5['id']}})[_0x1839('0x23')](function(){return _0x39a557;});})[_0x1839('0x23')](function(){_0x229838['status'](0xcc)[_0x1839('0x1c')]();});}};}function handleEntityNotFound(_0x433635,_0x2bc895){return function(_0x39897a){if(!_0x39897a){_0x433635[_0x1839('0x1a')](0x194);}return _0x39897a;};}function handleError(_0x4a28ce,_0x151832){_0x151832=_0x151832||0x1f4;return function(_0x404be8){logger['error'](_0x404be8[_0x1839('0x28')]);if(_0x404be8['name']){delete _0x404be8[_0x1839('0x29')];}_0x4a28ce['status'](_0x151832)[_0x1839('0x2a')](_0x404be8);};}exports[_0x1839('0x2b')]=function(_0x2e482c,_0x502051){var _0xd81da0={},_0x48e426={},_0x59ee38={'count':0x0,'rows':[]};var _0x102937=db[_0x1839('0x2c')][_0x1839('0x2d')];_0x48e426[_0x1839('0x2e')]=_[_0x1839('0x2f')](_0x102937);_0x48e426[_0x1839('0x30')]=_[_0x1839('0x2f')](_0x2e482c[_0x1839('0x30')]);_0x48e426[_0x1839('0x31')]=_[_0x1839('0x32')](_0x48e426[_0x1839('0x2e')],_0x48e426['query']);_0xd81da0[_0x1839('0x33')]=_[_0x1839('0x32')](_0x48e426[_0x1839('0x2e')],qs[_0x1839('0x34')](_0x2e482c[_0x1839('0x30')]['fields']));_0xd81da0[_0x1839('0x33')]=_0xd81da0[_0x1839('0x33')][_0x1839('0x35')]?_0xd81da0[_0x1839('0x33')]:_0x48e426[_0x1839('0x2e')];if(!_0x2e482c['query']['hasOwnProperty'](_0x1839('0x36'))){_0xd81da0[_0x1839('0x20')]=qs[_0x1839('0x20')](_0x2e482c[_0x1839('0x30')][_0x1839('0x20')]);_0xd81da0[_0x1839('0x1f')]=qs[_0x1839('0x1f')](_0x2e482c[_0x1839('0x30')][_0x1839('0x1f')]);}_0xd81da0[_0x1839('0x37')]=qs[_0x1839('0x38')](_0x2e482c[_0x1839('0x30')][_0x1839('0x38')]);_0xd81da0[_0x1839('0x39')]=qs[_0x1839('0x31')](_[_0x1839('0x3a')](_0x2e482c['query'],_0x48e426[_0x1839('0x31')]));if(_0x2e482c[_0x1839('0x30')]['filter']){_0xd81da0[_0x1839('0x39')]=_[_0x1839('0x3b')](_0xd81da0[_0x1839('0x39')],{'$or':_[_0x1839('0x3c')](_0x102937,function(_0x4fbefe){if(_0x4fbefe[_0x1839('0x3d')][_0x1839('0x3e')]!==_0x1839('0x3f')){var _0x103211={};_0x103211[_0x4fbefe['field']]={'$like':'%'+_0x2e482c['query'][_0x1839('0x40')]+'%'};return _0x103211;}})});}_0xd81da0=_[_0x1839('0x3b')]({},_0xd81da0,_0x2e482c[_0x1839('0x41')]);var _0x3b63a1={'where':_0xd81da0[_0x1839('0x39')]};return db[_0x1839('0x2c')]['count'](_0x3b63a1)[_0x1839('0x23')](function(_0x2f8a07){_0x59ee38[_0x1839('0x1e')]=_0x2f8a07;if(_0x2e482c['query'][_0x1839('0x42')]){_0xd81da0['include']=[{'all':!![]}];}return db[_0x1839('0x2c')][_0x1839('0x43')](_0xd81da0);})[_0x1839('0x23')](function(_0x1c1ff0){_0x59ee38[_0x1839('0x44')]=_0x1c1ff0;return _0x59ee38;})[_0x1839('0x23')](respondWithFilteredResult(_0x502051,_0xd81da0))[_0x1839('0x45')](handleError(_0x502051,null));};exports[_0x1839('0x46')]=function(_0x38604c,_0x3d7431){var _0x17b2cd={'raw':![],'where':{'id':_0x38604c[_0x1839('0x47')]['id']}},_0xa7f9e6={};_0xa7f9e6[_0x1839('0x2e')]=_['keys'](db[_0x1839('0x2c')][_0x1839('0x2d')]);_0xa7f9e6[_0x1839('0x30')]=_[_0x1839('0x2f')](_0x38604c['query']);_0xa7f9e6[_0x1839('0x31')]=_[_0x1839('0x32')](_0xa7f9e6[_0x1839('0x2e')],_0xa7f9e6[_0x1839('0x30')]);_0x17b2cd[_0x1839('0x33')]=_[_0x1839('0x32')](_0xa7f9e6[_0x1839('0x2e')],qs[_0x1839('0x34')](_0x38604c['query'][_0x1839('0x34')]));_0x17b2cd['attributes']=_0x17b2cd[_0x1839('0x33')][_0x1839('0x35')]?_0x17b2cd['attributes']:_0xa7f9e6[_0x1839('0x2e')];if(_0x38604c['query'][_0x1839('0x42')]){_0x17b2cd[_0x1839('0x48')]=[{'all':!![]}];}_0x17b2cd=_[_0x1839('0x3b')]({},_0x17b2cd,_0x38604c[_0x1839('0x41')]);return db[_0x1839('0x2c')][_0x1839('0x49')](_0x17b2cd)[_0x1839('0x23')](handleEntityNotFound(_0x3d7431,null))['then'](respondWithResult(_0x3d7431,null))[_0x1839('0x45')](handleError(_0x3d7431,null));};exports[_0x1839('0x4a')]=function(_0x26a2ef,_0x4ae57b){return db[_0x1839('0x2c')][_0x1839('0x4a')](_0x26a2ef[_0x1839('0x4b')],{})[_0x1839('0x23')](function(_0x31c9d3){var _0x5358bb=_0x26a2ef[_0x1839('0x4c')][_0x1839('0x24')]({'plain':!![]});if(!_0x5358bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5358bb[_0x1839('0x4d')]==='user'){var _0x9b4fc3=_0x31c9d3[_0x1839('0x24')]({'plain':!![]});var _0xb466cb=_0x1839('0x25');return db['UserProfileSection'][_0x1839('0x49')]({'where':{'name':_0xb466cb,'userProfileId':_0x5358bb[_0x1839('0x4e')]},'raw':!![]})[_0x1839('0x23')](function(_0x203f57){if(_0x203f57&&_0x203f57[_0x1839('0x4f')]===0x0){return db[_0x1839('0x26')][_0x1839('0x4a')]({'name':_0x9b4fc3[_0x1839('0x29')],'resourceId':_0x9b4fc3['id'],'type':_0x203f57[_0x1839('0x29')],'sectionId':_0x203f57['id']},{})[_0x1839('0x23')](function(){return _0x31c9d3;});}else{return _0x31c9d3;}})[_0x1839('0x45')](function(_0x1d2c42){logger[_0x1839('0x50')](_0x1839('0x51'),_0x1d2c42);throw _0x1d2c42;});}return _0x31c9d3;})[_0x1839('0x23')](respondWithResult(_0x4ae57b,0xc9))['catch'](handleError(_0x4ae57b,null));};exports[_0x1839('0x52')]=function(_0x11894c,_0x5cfdf8){var _0x4f54dc={'raw':![],'where':{'id':_0x11894c[_0x1839('0x47')]['id']}},_0x3a9376={};_0x3a9376[_0x1839('0x2e')]=_['keys'](db[_0x1839('0x2c')][_0x1839('0x2d')]);_0x4f54dc[_0x1839('0x33')]=_[_0x1839('0x32')](_0x3a9376[_0x1839('0x2e')],qs[_0x1839('0x34')](_0x11894c['query'][_0x1839('0x34')]));_0x4f54dc[_0x1839('0x33')]=_0x4f54dc[_0x1839('0x33')]['length']?_0x4f54dc['attributes']:_0x3a9376[_0x1839('0x2e')];if(_0x11894c[_0x1839('0x30')]['includeAll']){_0x4f54dc['include']=[{'all':!![]}];}_0x4f54dc=_['merge']({},_0x4f54dc,_0x11894c[_0x1839('0x41')]);return db[_0x1839('0x2c')][_0x1839('0x49')](_0x4f54dc)[_0x1839('0x23')](handleEntityNotFound(_0x5cfdf8,null))[_0x1839('0x23')](function(_0x481937){if(_0x481937){var _0x19f117=_0x481937[_0x1839('0x24')]({'plain':!![]});_0x19f117=qs[_0x1839('0x53')](_0x19f117,['id',_0x1839('0x54'),'updatedAt']);_0x11894c['body']=_[_0x1839('0x53')](_0x11894c[_0x1839('0x4b')],['id',_0x1839('0x54'),_0x1839('0x55')]);return db['JscriptyProject'][_0x1839('0x4a')](_[_0x1839('0x3b')](_0x19f117,_0x11894c[_0x1839('0x4b')]),{'include':_0x11894c[_0x1839('0x30')][_0x1839('0x42')]?[{'all':!![]}]:undefined})[_0x1839('0x23')](function(_0x1b0a7a){var _0x1b6367=_0x11894c[_0x1839('0x4c')][_0x1839('0x24')]({'plain':!![]});if(!_0x1b6367)throw new Error(_0x1839('0x56'));if(_0x1b6367[_0x1839('0x4d')]==='user'){var _0x2a9421=_0x1b0a7a['get']({'plain':!![]});var _0x1f634f='Projects';return db['UserProfileSection'][_0x1839('0x49')]({'where':{'name':_0x1f634f,'userProfileId':_0x1b6367[_0x1839('0x4e')]},'raw':!![]})['then'](function(_0x265db9){if(_0x265db9&&_0x265db9['autoAssociation']===0x0){return db[_0x1839('0x26')]['create']({'name':_0x2a9421['name'],'resourceId':_0x2a9421['id'],'type':_0x265db9[_0x1839('0x29')],'sectionId':_0x265db9['id']},{})['then'](function(){return _0x1b0a7a;});}else{return _0x1b0a7a;}})[_0x1839('0x45')](function(_0x5b746d){logger[_0x1839('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b746d);throw _0x5b746d;});}return _0x1b0a7a;});}})['then'](respondWithResult(_0x5cfdf8,0xc9))['catch'](handleError(_0x5cfdf8,null));};exports[_0x1839('0x22')]=function(_0x1fd7fe,_0x14ced0){if(_0x1fd7fe[_0x1839('0x4b')]['id']){delete _0x1fd7fe['body']['id'];}return db[_0x1839('0x2c')][_0x1839('0x49')]({'where':{'id':_0x1fd7fe[_0x1839('0x47')]['id']}})['then'](handleEntityNotFound(_0x14ced0,null))[_0x1839('0x23')](saveUpdates(_0x1fd7fe[_0x1839('0x4b')],null))[_0x1839('0x23')](respondWithResult(_0x14ced0,null))[_0x1839('0x45')](handleError(_0x14ced0,null));};exports[_0x1839('0x27')]=function(_0xb44d80,_0x4da8b5){return db[_0x1839('0x2c')][_0x1839('0x49')]({'where':{'id':_0xb44d80[_0x1839('0x47')]['id']}})[_0x1839('0x23')](handleEntityNotFound(_0x4da8b5,null))['then'](removeEntity(_0x4da8b5,null))[_0x1839('0x45')](handleError(_0x4da8b5,null));};exports['getSessions']=function(_0x2d4fca,_0x24b60c,_0x597cc4){var _0x2e3855={'raw':!![],'where':{}};var _0xf56a95={};var _0x1a382a={'count':0x0,'rows':[]};return db[_0x1839('0x2c')][_0x1839('0x57')]({'where':{'id':_0x2d4fca[_0x1839('0x47')]['id']}})[_0x1839('0x23')](handleEntityNotFound(_0x24b60c,null))[_0x1839('0x23')](function(_0x20b8e9){if(_0x20b8e9){_0xf56a95[_0x1839('0x2e')]=_[_0x1839('0x2f')](db[_0x1839('0x58')][_0x1839('0x2d')]);_0xf56a95[_0x1839('0x30')]=_[_0x1839('0x2f')](_0x2d4fca['query']);_0xf56a95[_0x1839('0x31')]=_['intersection'](_0xf56a95['model'],_0xf56a95['query']);_0x2e3855[_0x1839('0x33')]=_[_0x1839('0x32')](_0xf56a95['model'],qs[_0x1839('0x34')](_0x2d4fca[_0x1839('0x30')][_0x1839('0x34')]));_0x2e3855[_0x1839('0x33')]=_0x2e3855['attributes'][_0x1839('0x35')]?_0x2e3855['attributes']:_0xf56a95['model'];if(!_0x2d4fca['query'][_0x1839('0x59')](_0x1839('0x36'))){_0x2e3855[_0x1839('0x20')]=qs['limit'](_0x2d4fca[_0x1839('0x30')][_0x1839('0x20')]);_0x2e3855[_0x1839('0x1f')]=qs[_0x1839('0x1f')](_0x2d4fca[_0x1839('0x30')][_0x1839('0x1f')]);}_0x2e3855[_0x1839('0x37')]=qs[_0x1839('0x38')](_0x2d4fca['query']['sort']);_0x2e3855[_0x1839('0x39')]=qs[_0x1839('0x31')](_[_0x1839('0x3a')](_0x2d4fca[_0x1839('0x30')],_0xf56a95[_0x1839('0x31')]));_0x2e3855['where']['ProjectId']=_0x20b8e9['id'];if(_0x2d4fca[_0x1839('0x30')][_0x1839('0x40')]){_0x2e3855[_0x1839('0x39')]=_[_0x1839('0x3b')](_0x2e3855[_0x1839('0x39')],{'$or':_[_0x1839('0x3c')](_0x2e3855['attributes'],function(_0x481c17){var _0x86fb11={};_0x86fb11[_0x481c17]={'$like':'%'+_0x2d4fca[_0x1839('0x30')][_0x1839('0x40')]+'%'};return _0x86fb11;})});}_0x2e3855=_[_0x1839('0x3b')]({},_0x2e3855,_0x2d4fca[_0x1839('0x41')]);return db['JscriptySessionReport']['count']({'where':_0x2e3855[_0x1839('0x39')]})[_0x1839('0x23')](function(_0x4d9141){_0x1a382a[_0x1839('0x1e')]=_0x4d9141;if(_0x2d4fca[_0x1839('0x30')][_0x1839('0x42')]){_0x2e3855[_0x1839('0x48')]=[{'all':!![]}];}return db[_0x1839('0x58')][_0x1839('0x43')](_0x2e3855);})['then'](function(_0x32ef90){_0x1a382a[_0x1839('0x44')]=_0x32ef90;return _0x1a382a;});}})[_0x1839('0x23')](respondWithFilteredResult(_0x24b60c,_0x2e3855))[_0x1839('0x45')](handleError(_0x24b60c,null));};exports[_0x1839('0x5a')]=function(_0x527de7,_0x41c711,_0x34a8bc){var _0x2e9fb5={'raw':!![],'where':{}};var _0xeda0={};var _0x263bb8={'count':0x0,'rows':[]};return db[_0x1839('0x2c')][_0x1839('0x57')]({'where':{'id':_0x527de7[_0x1839('0x47')]['id']}})['then'](handleEntityNotFound(_0x41c711,null))[_0x1839('0x23')](function(_0x128b37){if(_0x128b37){_0xeda0[_0x1839('0x2e')]=_[_0x1839('0x2f')](db['JscriptyAnswerReport'][_0x1839('0x2d')]);_0xeda0[_0x1839('0x30')]=_[_0x1839('0x2f')](_0x527de7[_0x1839('0x30')]);_0xeda0[_0x1839('0x31')]=_[_0x1839('0x32')](_0xeda0['model'],_0xeda0['query']);_0x2e9fb5[_0x1839('0x33')]=_['intersection'](_0xeda0[_0x1839('0x2e')],qs[_0x1839('0x34')](_0x527de7['query'][_0x1839('0x34')]));_0x2e9fb5[_0x1839('0x33')]=_0x2e9fb5[_0x1839('0x33')][_0x1839('0x35')]?_0x2e9fb5[_0x1839('0x33')]:_0xeda0['model'];if(!_0x527de7[_0x1839('0x30')][_0x1839('0x59')](_0x1839('0x36'))){_0x2e9fb5[_0x1839('0x20')]=qs[_0x1839('0x20')](_0x527de7['query'][_0x1839('0x20')]);_0x2e9fb5['offset']=qs[_0x1839('0x1f')](_0x527de7[_0x1839('0x30')][_0x1839('0x1f')]);}_0x2e9fb5[_0x1839('0x37')]=qs[_0x1839('0x38')](_0x527de7[_0x1839('0x30')][_0x1839('0x38')]);_0x2e9fb5[_0x1839('0x39')]=qs[_0x1839('0x31')](_['pick'](_0x527de7[_0x1839('0x30')],_0xeda0[_0x1839('0x31')]));_0x2e9fb5[_0x1839('0x39')][_0x1839('0x5b')]=_0x128b37['id'];if(_0x527de7[_0x1839('0x30')][_0x1839('0x40')]){_0x2e9fb5[_0x1839('0x39')]=_[_0x1839('0x3b')](_0x2e9fb5[_0x1839('0x39')],{'$or':_[_0x1839('0x3c')](_0x2e9fb5[_0x1839('0x33')],function(_0x56116b){var _0x294433={};_0x294433[_0x56116b]={'$like':'%'+_0x527de7[_0x1839('0x30')][_0x1839('0x40')]+'%'};return _0x294433;})});}_0x2e9fb5=_[_0x1839('0x3b')]({},_0x2e9fb5,_0x527de7[_0x1839('0x41')]);return db['JscriptyAnswerReport'][_0x1839('0x1e')]({'where':_0x2e9fb5[_0x1839('0x39')]})[_0x1839('0x23')](function(_0x5c2419){_0x263bb8[_0x1839('0x1e')]=_0x5c2419;if(_0x527de7['query'][_0x1839('0x42')]){_0x2e9fb5[_0x1839('0x48')]=[{'all':!![]}];}return db[_0x1839('0x5c')][_0x1839('0x43')](_0x2e9fb5);})[_0x1839('0x23')](function(_0x2ca14c){_0x263bb8[_0x1839('0x44')]=_0x2ca14c;return _0x263bb8;});}})[_0x1839('0x23')](respondWithFilteredResult(_0x41c711,_0x2e9fb5))['catch'](handleError(_0x41c711,null));};function char(_0x5eda6b){return _0x1839('0x5d')===typeof _0x5eda6b?String[_0x1839('0x5e')][_0x1839('0x21')](null,arguments):_0x5eda6b;}function needsEncapsulation(_0xd9d5da){return!!_0xd9d5da&&(_0xd9d5da[_0x1839('0x5f')]()[_0x1839('0x60')](char(0xd))>=0x0||_0xd9d5da[_0x1839('0x5f')]()[_0x1839('0x60')](char(0xa))>=0x0||_0xd9d5da[_0x1839('0x5f')]()[_0x1839('0x60')](char(0x2c))>=0x0||_0xd9d5da[_0x1839('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4ccac1){var _0x210bbf=char(0x22),_0x14dbac='\x5c'+char(0x22),_0x21fdf5=_0x4ccac1['toString']()[_0x1839('0x61')](new RegExp(_0x210bbf,'g'),_0x14dbac);return _0x210bbf+_0x21fdf5+_0x210bbf;}exports[_0x1839('0x62')]=function(_0x34d679,_0x48665d,_0x36e410){var _0x309d1b,_0xabe8ab;var _0x10fce8={'where':{'ProjectId':_0x34d679[_0x1839('0x47')]['id']}};if(_0x34d679[_0x1839('0x30')][_0x1839('0x63')]){_0x10fce8[_0x1839('0x39')][_0x1839('0x64')]=JSON[_0x1839('0x65')](_0x34d679[_0x1839('0x30')]['startTime']);}return db[_0x1839('0x58')][_0x1839('0x43')](_0x10fce8)[_0x1839('0x23')](handleEntityNotFound(_0x48665d,null))[_0x1839('0x23')](function(_0x30f6fd){if(_0x30f6fd){_0x309d1b=_0x30f6fd;return db[_0x1839('0x66')][_0x1839('0x43')]({'where':{'SessionId':{'$in':_[_0x1839('0x3c')](_0x309d1b,'id')},'ProjectId':_0x34d679[_0x1839('0x47')]['id']},'order':_0x1839('0x67')});}})[_0x1839('0x23')](handleEntityNotFound(_0x48665d,null))['then'](function(_0x247975){if(_0x247975){_0xabe8ab=_0x247975;var _0x488361={};for(var _0x2697ed=0x0,_0x57ae96=_0xabe8ab[_0x1839('0x35')];_0x2697ed<_0x57ae96;_0x2697ed++){if(!_0x488361[_0x1839('0x59')](_0xabe8ab[_0x2697ed][_0x1839('0x68')])){_0x488361[_0xabe8ab[_0x2697ed][_0x1839('0x68')]]=needsEncapsulation(_0xabe8ab[_0x2697ed][_0x1839('0x69')])?encapsulate(_0xabe8ab[_0x2697ed][_0x1839('0x69')]):_0xabe8ab[_0x2697ed][_0x1839('0x69')];}}var _0x310a52=[],_0x28d270={};for(var _0x589a0a=0x0,_0xdb8a0b=_0x309d1b[_0x1839('0x35')];_0x589a0a<_0xdb8a0b;_0x589a0a++){_0x28d270={'ProjectId':_0x34d679[_0x1839('0x47')]['id'],'SessionId':_0x309d1b[_0x589a0a]['id'],'StartTime':moment(_0x309d1b[_0x589a0a][_0x1839('0x64')])[_0x1839('0x6a')](_0x1839('0x6b'))};for(var _0x123b4b=0x0,_0x1d2cbe=_0xabe8ab[_0x1839('0x35')];_0x123b4b<_0x1d2cbe;_0x123b4b++){if(_0xabe8ab[_0x123b4b][_0x1839('0x6c')]==_0x309d1b[_0x589a0a]['id']&&_0x488361['hasOwnProperty'](_0xabe8ab[_0x123b4b][_0x1839('0x68')])){_0x28d270[_0x488361[_0xabe8ab[_0x123b4b][_0x1839('0x68')]]]=_0xabe8ab[_0x123b4b][_0x1839('0x6d')];}}for(var _0xbfcbe5 in _0x488361){if(!_0x28d270[_0x1839('0x59')](_0x488361[_0xbfcbe5])){_0x28d270[_0x488361[_0xbfcbe5]]=null;}}_0x310a52[_0x1839('0x6e')](_0x28d270);}return _0x310a52;}})[_0x1839('0x23')](function(_0x36ff5f){if(!_[_0x1839('0x6f')](_0x36ff5f)){var _0x3bcb4e=toCsv(_0x36ff5f);var _0x3260eb=Date[_0x1839('0x70')]();fs[_0x1839('0x71')](util[_0x1839('0x6a')](_0x1839('0x72'),_0x34d679['params']['id'],_0x3260eb),_0x3bcb4e);_0x48665d['setHeader'](_0x1839('0x73'),_0x1839('0x74')+util[_0x1839('0x6a')](_0x1839('0x75'),_0x34d679['params']['id'],_0x3260eb));_0x48665d[_0x1839('0x76')](_0x1839('0x77'),_0x1839('0x78'));return _0x48665d['download'](util[_0x1839('0x6a')](_0x1839('0x72'),_0x34d679[_0x1839('0x47')]['id'],_0x3260eb));}else{return _0x48665d['sendStatus'](0xcc);}})['catch'](handleError(_0x48665d,null));}; \ No newline at end of file +var _0x1900=['jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','Projects','end','sendStatus','name','send','index','JscriptyProject','rawAttributes','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','map','type','VIRTUAL','field','includeAll','include','findAll','rows','params','keys','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','catch','clone','options','omit','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','hasOwnProperty','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','pick','number','fromCharCode','indexOf','toString','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','crypto'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x1900,0x14b));var _0x0190=function(_0x31342e,_0x37f51e){_0x31342e=_0x31342e-0x0;var _0xc503e6=_0x1900[_0x31342e];return _0xc503e6;};'use strict';var pdf=require(_0x0190('0x0'));var emlformat=require(_0x0190('0x1'));var rimraf=require(_0x0190('0x2'));var zipdir=require(_0x0190('0x3'));var jsonpatch=require(_0x0190('0x4'));var rp=require('request-promise');var moment=require(_0x0190('0x5'));var BPromise=require(_0x0190('0x6'));var Mustache=require(_0x0190('0x7'));var util=require('util');var path=require(_0x0190('0x8'));var sox=require(_0x0190('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0190('0xa'));var jsforce=require(_0x0190('0xb'));var deskjs=require(_0x0190('0xc'));var toCsv=require(_0x0190('0xd'));var querystring=require('querystring');var Papa=require(_0x0190('0xe'));var Redis=require('ioredis');var authService=require(_0x0190('0xf'));var qs=require(_0x0190('0x10'));var hardwareService=require(_0x0190('0x11'));var logger=require(_0x0190('0x12'))(_0x0190('0x13'));var utils=require(_0x0190('0x14'));var config=require('../../config/environment');var db=require(_0x0190('0x15'))['db'];function respondWithStatusCode(_0x2e892d,_0x5b234d){_0x5b234d=_0x5b234d||0xcc;return function(_0x2c4c03){if(_0x2c4c03){return _0x2e892d['sendStatus'](_0x5b234d);}return _0x2e892d['status'](_0x5b234d)['end']();};}function respondWithResult(_0x5e547a,_0xf4901e){_0xf4901e=_0xf4901e||0xc8;return function(_0x7a787f){if(_0x7a787f){return _0x5e547a[_0x0190('0x16')](_0xf4901e)['json'](_0x7a787f);}};}function respondWithFilteredResult(_0x3cb133,_0x4bc1d9){return function(_0x494f91){if(_0x494f91){var _0x2df8d3=_0x494f91[_0x0190('0x17')],_0x3b8888=_0x4bc1d9[_0x0190('0x18')],_0x34de11=_0x4bc1d9[_0x0190('0x18')]+_0x4bc1d9[_0x0190('0x19')],_0xbcc311;if(_0x34de11>=_0x2df8d3){_0x34de11=_0x2df8d3;_0xbcc311=0xc8;}else{_0xbcc311=0xce;}_0x3cb133[_0x0190('0x16')](_0xbcc311);return _0x3cb133[_0x0190('0x1a')](_0x0190('0x1b'),_0x3b8888+'-'+_0x34de11+'/'+_0x2df8d3)[_0x0190('0x1c')](_0x494f91);}return null;};}function patchUpdates(_0x1c22b9){return function(_0x4908a6){try{jsonpatch[_0x0190('0x1d')](_0x4908a6,_0x1c22b9,!![]);}catch(_0x2a80af){return BPromise['reject'](_0x2a80af);}return _0x4908a6[_0x0190('0x1e')]();};}function saveUpdates(_0x5c809b,_0x2f9b5c){return function(_0x4293dd){if(_0x4293dd){return _0x4293dd[_0x0190('0x1f')](_0x5c809b)[_0x0190('0x20')](function(_0x1cf0b4){return _0x1cf0b4;});}return null;};}function removeEntity(_0x36e091,_0x5ac035){return function(_0x3695cd){if(_0x3695cd){return _0x3695cd[_0x0190('0x21')]()[_0x0190('0x20')](function(){var _0xb3d5bc=_0x3695cd[_0x0190('0x22')]({'plain':!![]});var _0x389cbe=_0x0190('0x23');return db['UserProfileResource'][_0x0190('0x21')]({'where':{'type':_0x389cbe,'resourceId':_0xb3d5bc['id']}})['then'](function(){return _0x3695cd;});})[_0x0190('0x20')](function(){_0x36e091[_0x0190('0x16')](0xcc)[_0x0190('0x24')]();});}};}function handleEntityNotFound(_0x389f4c,_0xa7af1a){return function(_0x59803f){if(!_0x59803f){_0x389f4c[_0x0190('0x25')](0x194);}return _0x59803f;};}function handleError(_0x18b3cb,_0x45d0e4){_0x45d0e4=_0x45d0e4||0x1f4;return function(_0x5816ed){logger['error'](_0x5816ed['stack']);if(_0x5816ed[_0x0190('0x26')]){delete _0x5816ed[_0x0190('0x26')];}_0x18b3cb[_0x0190('0x16')](_0x45d0e4)[_0x0190('0x27')](_0x5816ed);};}exports[_0x0190('0x28')]=function(_0x4040e0,_0x507ce1){var _0x803699={},_0x46aee1={},_0x2a3827={'count':0x0,'rows':[]};var _0x726796=db[_0x0190('0x29')][_0x0190('0x2a')];_0x46aee1['model']=_['keys'](_0x726796);_0x46aee1[_0x0190('0x2b')]=_['keys'](_0x4040e0[_0x0190('0x2b')]);_0x46aee1[_0x0190('0x2c')]=_['intersection'](_0x46aee1[_0x0190('0x2d')],_0x46aee1['query']);_0x803699[_0x0190('0x2e')]=_[_0x0190('0x2f')](_0x46aee1[_0x0190('0x2d')],qs['fields'](_0x4040e0[_0x0190('0x2b')][_0x0190('0x30')]));_0x803699[_0x0190('0x2e')]=_0x803699[_0x0190('0x2e')][_0x0190('0x31')]?_0x803699[_0x0190('0x2e')]:_0x46aee1[_0x0190('0x2d')];if(!_0x4040e0[_0x0190('0x2b')]['hasOwnProperty'](_0x0190('0x32'))){_0x803699[_0x0190('0x19')]=qs[_0x0190('0x19')](_0x4040e0['query'][_0x0190('0x19')]);_0x803699['offset']=qs[_0x0190('0x18')](_0x4040e0['query']['offset']);}_0x803699[_0x0190('0x33')]=qs[_0x0190('0x34')](_0x4040e0['query']['sort']);_0x803699[_0x0190('0x35')]=qs[_0x0190('0x2c')](_['pick'](_0x4040e0['query'],_0x46aee1[_0x0190('0x2c')]));if(_0x4040e0[_0x0190('0x2b')][_0x0190('0x36')]){_0x803699[_0x0190('0x35')]=_['merge'](_0x803699['where'],{'$or':_[_0x0190('0x37')](_0x726796,function(_0x3a5916){if(_0x3a5916[_0x0190('0x38')]['key']!==_0x0190('0x39')){var _0x542411={};_0x542411[_0x3a5916[_0x0190('0x3a')]]={'$like':'%'+_0x4040e0[_0x0190('0x2b')][_0x0190('0x36')]+'%'};return _0x542411;}})});}_0x803699=_['merge']({},_0x803699,_0x4040e0['options']);var _0x3952ab={'where':_0x803699[_0x0190('0x35')]};return db[_0x0190('0x29')][_0x0190('0x17')](_0x3952ab)[_0x0190('0x20')](function(_0x32ea7c){_0x2a3827[_0x0190('0x17')]=_0x32ea7c;if(_0x4040e0[_0x0190('0x2b')][_0x0190('0x3b')]){_0x803699[_0x0190('0x3c')]=[{'all':!![]}];}return db[_0x0190('0x29')][_0x0190('0x3d')](_0x803699);})[_0x0190('0x20')](function(_0x268b09){_0x2a3827[_0x0190('0x3e')]=_0x268b09;return _0x2a3827;})[_0x0190('0x20')](respondWithFilteredResult(_0x507ce1,_0x803699))['catch'](handleError(_0x507ce1,null));};exports['show']=function(_0x3b3c59,_0x178832){var _0x21945a={'raw':![],'where':{'id':_0x3b3c59[_0x0190('0x3f')]['id']}},_0x59dd26={};_0x59dd26[_0x0190('0x2d')]=_['keys'](db['JscriptyProject'][_0x0190('0x2a')]);_0x59dd26['query']=_[_0x0190('0x40')](_0x3b3c59['query']);_0x59dd26[_0x0190('0x2c')]=_[_0x0190('0x2f')](_0x59dd26[_0x0190('0x2d')],_0x59dd26['query']);_0x21945a[_0x0190('0x2e')]=_['intersection'](_0x59dd26[_0x0190('0x2d')],qs[_0x0190('0x30')](_0x3b3c59[_0x0190('0x2b')][_0x0190('0x30')]));_0x21945a[_0x0190('0x2e')]=_0x21945a[_0x0190('0x2e')]['length']?_0x21945a[_0x0190('0x2e')]:_0x59dd26[_0x0190('0x2d')];if(_0x3b3c59[_0x0190('0x2b')][_0x0190('0x3b')]){_0x21945a['include']=[{'all':!![]}];}_0x21945a=_[_0x0190('0x41')]({},_0x21945a,_0x3b3c59['options']);return db[_0x0190('0x29')][_0x0190('0x42')](_0x21945a)[_0x0190('0x20')](handleEntityNotFound(_0x178832,null))[_0x0190('0x20')](respondWithResult(_0x178832,null))['catch'](handleError(_0x178832,null));};exports[_0x0190('0x43')]=function(_0x984620,_0x2c5b04){return db['JscriptyProject'][_0x0190('0x43')](_0x984620[_0x0190('0x44')],{})['then'](function(_0x422a98){var _0x305035=_0x984620['user'][_0x0190('0x22')]({'plain':!![]});if(!_0x305035)throw new Error(_0x0190('0x45'));if(_0x305035['role']===_0x0190('0x46')){var _0x3c4b75=_0x422a98['get']({'plain':!![]});var _0x193809=_0x0190('0x23');return db[_0x0190('0x47')][_0x0190('0x42')]({'where':{'name':_0x193809,'userProfileId':_0x305035[_0x0190('0x48')]},'raw':!![]})[_0x0190('0x20')](function(_0x9e9e13){if(_0x9e9e13&&_0x9e9e13[_0x0190('0x49')]===0x0){return db[_0x0190('0x4a')][_0x0190('0x43')]({'name':_0x3c4b75['name'],'resourceId':_0x3c4b75['id'],'type':_0x9e9e13['name'],'sectionId':_0x9e9e13['id']},{})[_0x0190('0x20')](function(){return _0x422a98;});}else{return _0x422a98;}})['catch'](function(_0x4ee19a){logger[_0x0190('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ee19a);throw _0x4ee19a;});}return _0x422a98;})[_0x0190('0x20')](respondWithResult(_0x2c5b04,0xc9))[_0x0190('0x4c')](handleError(_0x2c5b04,null));};exports[_0x0190('0x4d')]=function(_0x307b9c,_0xe37c4d){var _0x3c6b87={'raw':![],'where':{'id':_0x307b9c[_0x0190('0x3f')]['id']}},_0x1727cc={};_0x1727cc[_0x0190('0x2d')]=_[_0x0190('0x40')](db[_0x0190('0x29')][_0x0190('0x2a')]);_0x3c6b87[_0x0190('0x2e')]=_[_0x0190('0x2f')](_0x1727cc[_0x0190('0x2d')],qs[_0x0190('0x30')](_0x307b9c[_0x0190('0x2b')][_0x0190('0x30')]));_0x3c6b87[_0x0190('0x2e')]=_0x3c6b87['attributes'][_0x0190('0x31')]?_0x3c6b87[_0x0190('0x2e')]:_0x1727cc['model'];if(_0x307b9c[_0x0190('0x2b')][_0x0190('0x3b')]){_0x3c6b87[_0x0190('0x3c')]=[{'all':!![]}];}_0x3c6b87=_['merge']({},_0x3c6b87,_0x307b9c[_0x0190('0x4e')]);return db['JscriptyProject'][_0x0190('0x42')](_0x3c6b87)['then'](handleEntityNotFound(_0xe37c4d,null))[_0x0190('0x20')](function(_0x66230){if(_0x66230){var _0x4891cf=_0x66230['get']({'plain':!![]});_0x4891cf=qs[_0x0190('0x4f')](_0x4891cf,['id','createdAt',_0x0190('0x50')]);_0x307b9c[_0x0190('0x44')]=_['omit'](_0x307b9c[_0x0190('0x44')],['id','createdAt',_0x0190('0x50')]);return db[_0x0190('0x29')][_0x0190('0x43')](_['merge'](_0x4891cf,_0x307b9c[_0x0190('0x44')]),{'include':_0x307b9c[_0x0190('0x2b')][_0x0190('0x3b')]?[{'all':!![]}]:undefined})[_0x0190('0x20')](function(_0x5429c8){var _0x38a79f=_0x307b9c[_0x0190('0x46')][_0x0190('0x22')]({'plain':!![]});if(!_0x38a79f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38a79f[_0x0190('0x51')]===_0x0190('0x46')){var _0x4ef1bd=_0x5429c8[_0x0190('0x22')]({'plain':!![]});var _0x2a878a=_0x0190('0x23');return db[_0x0190('0x47')]['find']({'where':{'name':_0x2a878a,'userProfileId':_0x38a79f['userProfileId']},'raw':!![]})[_0x0190('0x20')](function(_0x4105f4){if(_0x4105f4&&_0x4105f4[_0x0190('0x49')]===0x0){return db[_0x0190('0x4a')]['create']({'name':_0x4ef1bd[_0x0190('0x26')],'resourceId':_0x4ef1bd['id'],'type':_0x4105f4[_0x0190('0x26')],'sectionId':_0x4105f4['id']},{})[_0x0190('0x20')](function(){return _0x5429c8;});}else{return _0x5429c8;}})[_0x0190('0x4c')](function(_0xc58532){logger[_0x0190('0x4b')](_0x0190('0x52'),_0xc58532);throw _0xc58532;});}return _0x5429c8;});}})[_0x0190('0x20')](respondWithResult(_0xe37c4d,0xc9))[_0x0190('0x4c')](handleError(_0xe37c4d,null));};exports[_0x0190('0x1f')]=function(_0x227851,_0x3d0066){if(_0x227851[_0x0190('0x44')]['id']){delete _0x227851[_0x0190('0x44')]['id'];}return db[_0x0190('0x29')][_0x0190('0x42')]({'where':{'id':_0x227851[_0x0190('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3d0066,null))[_0x0190('0x20')](saveUpdates(_0x227851[_0x0190('0x44')],null))[_0x0190('0x20')](respondWithResult(_0x3d0066,null))[_0x0190('0x4c')](handleError(_0x3d0066,null));};exports['destroy']=function(_0x26ad93,_0x1f4331){return db['JscriptyProject'][_0x0190('0x42')]({'where':{'id':_0x26ad93[_0x0190('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1f4331,null))['then'](removeEntity(_0x1f4331,null))['catch'](handleError(_0x1f4331,null));};exports['getSessions']=function(_0x13deb1,_0x5425d0,_0x41dd77){var _0x4e58e6={'raw':!![],'where':{}};var _0x3dd6c2={};var _0x4e601d={'count':0x0,'rows':[]};return db[_0x0190('0x29')][_0x0190('0x53')]({'where':{'id':_0x13deb1[_0x0190('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5425d0,null))[_0x0190('0x20')](function(_0x3e64b2){if(_0x3e64b2){_0x3dd6c2[_0x0190('0x2d')]=_['keys'](db['JscriptySessionReport'][_0x0190('0x2a')]);_0x3dd6c2[_0x0190('0x2b')]=_[_0x0190('0x40')](_0x13deb1[_0x0190('0x2b')]);_0x3dd6c2[_0x0190('0x2c')]=_[_0x0190('0x2f')](_0x3dd6c2[_0x0190('0x2d')],_0x3dd6c2[_0x0190('0x2b')]);_0x4e58e6['attributes']=_[_0x0190('0x2f')](_0x3dd6c2[_0x0190('0x2d')],qs[_0x0190('0x30')](_0x13deb1[_0x0190('0x2b')][_0x0190('0x30')]));_0x4e58e6[_0x0190('0x2e')]=_0x4e58e6[_0x0190('0x2e')][_0x0190('0x31')]?_0x4e58e6[_0x0190('0x2e')]:_0x3dd6c2['model'];if(!_0x13deb1[_0x0190('0x2b')][_0x0190('0x54')](_0x0190('0x32'))){_0x4e58e6[_0x0190('0x19')]=qs[_0x0190('0x19')](_0x13deb1['query']['limit']);_0x4e58e6[_0x0190('0x18')]=qs[_0x0190('0x18')](_0x13deb1[_0x0190('0x2b')]['offset']);}_0x4e58e6[_0x0190('0x33')]=qs[_0x0190('0x34')](_0x13deb1['query'][_0x0190('0x34')]);_0x4e58e6['where']=qs[_0x0190('0x2c')](_['pick'](_0x13deb1[_0x0190('0x2b')],_0x3dd6c2['filters']));_0x4e58e6[_0x0190('0x35')][_0x0190('0x55')]=_0x3e64b2['id'];if(_0x13deb1[_0x0190('0x2b')][_0x0190('0x36')]){_0x4e58e6[_0x0190('0x35')]=_['merge'](_0x4e58e6[_0x0190('0x35')],{'$or':_['map'](_0x4e58e6[_0x0190('0x2e')],function(_0x17318b){var _0xa38066={};_0xa38066[_0x17318b]={'$like':'%'+_0x13deb1[_0x0190('0x2b')][_0x0190('0x36')]+'%'};return _0xa38066;})});}_0x4e58e6=_[_0x0190('0x41')]({},_0x4e58e6,_0x13deb1[_0x0190('0x4e')]);return db[_0x0190('0x56')][_0x0190('0x17')]({'where':_0x4e58e6[_0x0190('0x35')]})[_0x0190('0x20')](function(_0x41ec4c){_0x4e601d['count']=_0x41ec4c;if(_0x13deb1['query']['includeAll']){_0x4e58e6[_0x0190('0x3c')]=[{'all':!![]}];}return db[_0x0190('0x56')]['findAll'](_0x4e58e6);})['then'](function(_0x1e9e32){_0x4e601d[_0x0190('0x3e')]=_0x1e9e32;return _0x4e601d;});}})['then'](respondWithFilteredResult(_0x5425d0,_0x4e58e6))[_0x0190('0x4c')](handleError(_0x5425d0,null));};exports[_0x0190('0x57')]=function(_0x1c515b,_0x248112,_0x349d1f){var _0x354abb={'raw':!![],'where':{}};var _0x4ce5f6={};var _0x52b5d0={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x0190('0x53')]({'where':{'id':_0x1c515b['params']['id']}})[_0x0190('0x20')](handleEntityNotFound(_0x248112,null))['then'](function(_0x14a0c7){if(_0x14a0c7){_0x4ce5f6[_0x0190('0x2d')]=_['keys'](db[_0x0190('0x58')][_0x0190('0x2a')]);_0x4ce5f6['query']=_[_0x0190('0x40')](_0x1c515b[_0x0190('0x2b')]);_0x4ce5f6[_0x0190('0x2c')]=_[_0x0190('0x2f')](_0x4ce5f6[_0x0190('0x2d')],_0x4ce5f6['query']);_0x354abb[_0x0190('0x2e')]=_['intersection'](_0x4ce5f6[_0x0190('0x2d')],qs[_0x0190('0x30')](_0x1c515b[_0x0190('0x2b')][_0x0190('0x30')]));_0x354abb[_0x0190('0x2e')]=_0x354abb[_0x0190('0x2e')][_0x0190('0x31')]?_0x354abb[_0x0190('0x2e')]:_0x4ce5f6['model'];if(!_0x1c515b['query'][_0x0190('0x54')](_0x0190('0x32'))){_0x354abb[_0x0190('0x19')]=qs[_0x0190('0x19')](_0x1c515b[_0x0190('0x2b')][_0x0190('0x19')]);_0x354abb[_0x0190('0x18')]=qs[_0x0190('0x18')](_0x1c515b['query'][_0x0190('0x18')]);}_0x354abb[_0x0190('0x33')]=qs['sort'](_0x1c515b[_0x0190('0x2b')][_0x0190('0x34')]);_0x354abb['where']=qs['filters'](_[_0x0190('0x59')](_0x1c515b[_0x0190('0x2b')],_0x4ce5f6[_0x0190('0x2c')]));_0x354abb[_0x0190('0x35')]['ProjectId']=_0x14a0c7['id'];if(_0x1c515b['query'][_0x0190('0x36')]){_0x354abb[_0x0190('0x35')]=_[_0x0190('0x41')](_0x354abb[_0x0190('0x35')],{'$or':_['map'](_0x354abb[_0x0190('0x2e')],function(_0x2e72b6){var _0x1d2e1e={};_0x1d2e1e[_0x2e72b6]={'$like':'%'+_0x1c515b['query']['filter']+'%'};return _0x1d2e1e;})});}_0x354abb=_[_0x0190('0x41')]({},_0x354abb,_0x1c515b[_0x0190('0x4e')]);return db[_0x0190('0x58')][_0x0190('0x17')]({'where':_0x354abb[_0x0190('0x35')]})[_0x0190('0x20')](function(_0x341731){_0x52b5d0['count']=_0x341731;if(_0x1c515b[_0x0190('0x2b')]['includeAll']){_0x354abb['include']=[{'all':!![]}];}return db[_0x0190('0x58')]['findAll'](_0x354abb);})['then'](function(_0xddf82d){_0x52b5d0[_0x0190('0x3e')]=_0xddf82d;return _0x52b5d0;});}})[_0x0190('0x20')](respondWithFilteredResult(_0x248112,_0x354abb))['catch'](handleError(_0x248112,null));};function char(_0x364cbf){return _0x0190('0x5a')===typeof _0x364cbf?String[_0x0190('0x5b')][_0x0190('0x1d')](null,arguments):_0x364cbf;}function needsEncapsulation(_0x18fb5d){return!!_0x18fb5d&&(_0x18fb5d['toString']()[_0x0190('0x5c')](char(0xd))>=0x0||_0x18fb5d[_0x0190('0x5d')]()[_0x0190('0x5c')](char(0xa))>=0x0||_0x18fb5d[_0x0190('0x5d')]()[_0x0190('0x5c')](char(0x2c))>=0x0||_0x18fb5d[_0x0190('0x5d')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x3211ba){var _0x9cde9e=char(0x22),_0x1c3a94='\x5c'+char(0x22),_0x30e20d=_0x3211ba['toString']()[_0x0190('0x5e')](new RegExp(_0x9cde9e,'g'),_0x1c3a94);return _0x9cde9e+_0x30e20d+_0x9cde9e;}exports['getSummary']=function(_0x5784ae,_0x419c77,_0x2888c6){var _0x2191db,_0x78567c;var _0x1b314e={'where':{'ProjectId':_0x5784ae[_0x0190('0x3f')]['id']}};if(_0x5784ae[_0x0190('0x2b')]['startTime']){_0x1b314e['where'][_0x0190('0x5f')]=JSON[_0x0190('0x60')](_0x5784ae[_0x0190('0x2b')][_0x0190('0x61')]);}return db[_0x0190('0x56')][_0x0190('0x3d')](_0x1b314e)[_0x0190('0x20')](handleEntityNotFound(_0x419c77,null))['then'](function(_0x4b8b31){if(_0x4b8b31){_0x2191db=_0x4b8b31;return db[_0x0190('0x62')][_0x0190('0x3d')]({'where':{'SessionId':{'$in':_[_0x0190('0x37')](_0x2191db,'id')},'ProjectId':_0x5784ae[_0x0190('0x3f')]['id']},'order':_0x0190('0x63')});}})[_0x0190('0x20')](handleEntityNotFound(_0x419c77,null))[_0x0190('0x20')](function(_0x4bda7f){if(_0x4bda7f){_0x78567c=_0x4bda7f;var _0x520d33={};for(var _0x11fe34=0x0,_0x141629=_0x78567c[_0x0190('0x31')];_0x11fe34<_0x141629;_0x11fe34++){if(!_0x520d33[_0x0190('0x54')](_0x78567c[_0x11fe34][_0x0190('0x64')])){_0x520d33[_0x78567c[_0x11fe34][_0x0190('0x64')]]=needsEncapsulation(_0x78567c[_0x11fe34]['question'])?encapsulate(_0x78567c[_0x11fe34]['question']):_0x78567c[_0x11fe34][_0x0190('0x65')];}}var _0x43a2bf=[],_0x1caf3a={};for(var _0x1eb47e=0x0,_0x33a478=_0x2191db[_0x0190('0x31')];_0x1eb47e<_0x33a478;_0x1eb47e++){_0x1caf3a={'ProjectId':_0x5784ae[_0x0190('0x3f')]['id'],'SessionId':_0x2191db[_0x1eb47e]['id'],'StartTime':moment(_0x2191db[_0x1eb47e]['starttime'])[_0x0190('0x66')](_0x0190('0x67'))};for(var _0x356bb8=0x0,_0x12b683=_0x78567c[_0x0190('0x31')];_0x356bb8<_0x12b683;_0x356bb8++){if(_0x78567c[_0x356bb8][_0x0190('0x68')]==_0x2191db[_0x1eb47e]['id']&&_0x520d33[_0x0190('0x54')](_0x78567c[_0x356bb8][_0x0190('0x64')])){_0x1caf3a[_0x520d33[_0x78567c[_0x356bb8]['questionId']]]=_0x78567c[_0x356bb8][_0x0190('0x69')];}}for(var _0x7d12bd in _0x520d33){if(!_0x1caf3a[_0x0190('0x54')](_0x520d33[_0x7d12bd])){_0x1caf3a[_0x520d33[_0x7d12bd]]=null;}}_0x43a2bf['push'](_0x1caf3a);}return _0x43a2bf;}})[_0x0190('0x20')](function(_0xcac78a){if(!_['isEmpty'](_0xcac78a)){var _0x143b61=toCsv(_0xcac78a);var _0x1db781=Date[_0x0190('0x6a')]();fs[_0x0190('0x6b')](util[_0x0190('0x66')](_0x0190('0x6c'),_0x5784ae[_0x0190('0x3f')]['id'],_0x1db781),_0x143b61);_0x419c77['setHeader'](_0x0190('0x6d'),_0x0190('0x6e')+util[_0x0190('0x66')](_0x0190('0x6f'),_0x5784ae[_0x0190('0x3f')]['id'],_0x1db781));_0x419c77['setHeader'](_0x0190('0x70'),_0x0190('0x71'));return _0x419c77['download'](util['format'](_0x0190('0x6c'),_0x5784ae[_0x0190('0x3f')]['id'],_0x1db781));}else{return _0x419c77[_0x0190('0x25')](0xcc);}})[_0x0190('0x4c')](handleError(_0x419c77,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 500b59a..fe9eafa 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 _0xe144=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','../../config/logger','api','moment'];(function(_0xe679f9,_0x17dd5a){var _0x4b0ea2=function(_0x13fa3b){while(--_0x13fa3b){_0xe679f9['push'](_0xe679f9['shift']());}};_0x4b0ea2(++_0x17dd5a);}(_0xe144,0x168));var _0x4e14=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0xe144[_0x4de877];return _0xb2cfeb;};'use strict';var _=require(_0x4e14('0x0'));var util=require('util');var logger=require(_0x4e14('0x1'))(_0x4e14('0x2'));var moment=require(_0x4e14('0x3'));var BPromise=require(_0x4e14('0x4'));var rp=require(_0x4e14('0x5'));var fs=require('fs');var path=require(_0x4e14('0x6'));var rimraf=require(_0x4e14('0x7'));var config=require(_0x4e14('0x8'));var attributes=require(_0x4e14('0x9'));module[_0x4e14('0xa')]=function(_0x354ffd,_0x17645e){return _0x354ffd[_0x4e14('0xb')]('JscriptyProject',attributes,{'tableName':_0x4e14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7b=['moment','bluebird','request-promise','path','../../config/environment','exports','define','jscripty_projects','util','../../config/logger','api'];(function(_0xb82940,_0x530318){var _0x2e152a=function(_0x27bf29){while(--_0x27bf29){_0xb82940['push'](_0xb82940['shift']());}};_0x2e152a(++_0x530318);}(_0x6f7b,0x168));var _0xb6f7=function(_0x404450,_0x3de029){_0x404450=_0x404450-0x0;var _0x35309a=_0x6f7b[_0x404450];return _0x35309a;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var logger=require(_0xb6f7('0x1'))(_0xb6f7('0x2'));var moment=require(_0xb6f7('0x3'));var BPromise=require(_0xb6f7('0x4'));var rp=require(_0xb6f7('0x5'));var fs=require('fs');var path=require(_0xb6f7('0x6'));var rimraf=require('rimraf');var config=require(_0xb6f7('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0xb6f7('0x8')]=function(_0x25cec3,_0x59b2d9){return _0x25cec3[_0xb6f7('0x9')]('JscriptyProject',attributes,{'tableName':_0xb6f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index c40ede3..8590412 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 _0xbd23=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x501d94,_0x8832ed){var _0x27d9e2=function(_0x27b42e){while(--_0x27b42e){_0x501d94['push'](_0x501d94['shift']());}};_0x27d9e2(++_0x8832ed);}(_0xbd23,0x9d));var _0x3bd2=function(_0x1683a8,_0xdb4981){_0x1683a8=_0x1683a8-0x0;var _0x17f970=_0xbd23[_0x1683a8];return _0x17f970;};'use strict';var _=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var moment=require('moment');var BPromise=require(_0x3bd2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bd2('0x3'));var db=require(_0x3bd2('0x4'))['db'];var utils=require(_0x3bd2('0x5'));var logger=require(_0x3bd2('0x6'))(_0x3bd2('0x7'));var config=require(_0x3bd2('0x8'));var jayson=require(_0x3bd2('0x9'));var client=jayson[_0x3bd2('0xa')][_0x3bd2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26a33b,_0x4e65df,_0x2f5508){return new BPromise(function(_0x49be02,_0x25b5fa){return client[_0x3bd2('0xc')](_0x26a33b,_0x2f5508)[_0x3bd2('0xd')](function(_0x3ab6b4){logger[_0x3bd2('0xe')](_0x3bd2('0xf'),_0x4e65df,_0x3bd2('0x10'));logger[_0x3bd2('0x11')](_0x3bd2('0x12'),_0x4e65df,_0x3bd2('0x10'),JSON['stringify'](_0x3ab6b4));if(_0x3ab6b4['error']){if(_0x3ab6b4[_0x3bd2('0x13')]['code']===0x1f4){logger[_0x3bd2('0x13')](_0x3bd2('0xf'),_0x4e65df,_0x3ab6b4[_0x3bd2('0x13')]['message']);return _0x25b5fa(_0x3ab6b4[_0x3bd2('0x13')]['message']);}logger['error'](_0x3bd2('0xf'),_0x4e65df,_0x3ab6b4['error'][_0x3bd2('0x14')]);return _0x49be02(_0x3ab6b4[_0x3bd2('0x13')][_0x3bd2('0x14')]);}else{logger[_0x3bd2('0xe')](_0x3bd2('0xf'),_0x4e65df,'request\x20sent');_0x49be02(_0x3ab6b4[_0x3bd2('0x15')]['message']);}})[_0x3bd2('0x16')](function(_0x3cc788){logger[_0x3bd2('0x13')](_0x3bd2('0xf'),_0x4e65df,_0x3cc788);_0x25b5fa(_0x3cc788);});});} \ No newline at end of file +var _0x0429=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x36c96b,_0x50b97d){var _0x17465d=function(_0x100f42){while(--_0x100f42){_0x36c96b['push'](_0x36c96b['shift']());}};_0x17465d(++_0x50b97d);}(_0x0429,0x14d));var _0x9042=function(_0x4e6a4b,_0x3c2436){_0x4e6a4b=_0x4e6a4b-0x0;var _0x5d79cf=_0x0429[_0x4e6a4b];return _0x5d79cf;};'use strict';var _=require(_0x9042('0x0'));var util=require(_0x9042('0x1'));var moment=require(_0x9042('0x2'));var BPromise=require(_0x9042('0x3'));var rs=require(_0x9042('0x4'));var fs=require('fs');var Redis=require(_0x9042('0x5'));var db=require(_0x9042('0x6'))['db'];var utils=require(_0x9042('0x7'));var logger=require(_0x9042('0x8'))(_0x9042('0x9'));var config=require(_0x9042('0xa'));var jayson=require(_0x9042('0xb'));var client=jayson[_0x9042('0xc')][_0x9042('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x139884,_0x1916e4,_0x428e6d){return new BPromise(function(_0x1c0228,_0x221990){return client[_0x9042('0xe')](_0x139884,_0x428e6d)[_0x9042('0xf')](function(_0x2dacaf){logger[_0x9042('0x10')](_0x9042('0x11'),_0x1916e4,_0x9042('0x12'));logger[_0x9042('0x13')](_0x9042('0x14'),_0x1916e4,'request\x20sent',JSON[_0x9042('0x15')](_0x2dacaf));if(_0x2dacaf[_0x9042('0x16')]){if(_0x2dacaf[_0x9042('0x16')][_0x9042('0x17')]===0x1f4){logger[_0x9042('0x16')](_0x9042('0x11'),_0x1916e4,_0x2dacaf[_0x9042('0x16')][_0x9042('0x18')]);return _0x221990(_0x2dacaf['error'][_0x9042('0x18')]);}logger[_0x9042('0x16')](_0x9042('0x11'),_0x1916e4,_0x2dacaf[_0x9042('0x16')][_0x9042('0x18')]);return _0x1c0228(_0x2dacaf[_0x9042('0x16')][_0x9042('0x18')]);}else{logger[_0x9042('0x10')](_0x9042('0x11'),_0x1916e4,_0x9042('0x12'));_0x1c0228(_0x2dacaf[_0x9042('0x19')][_0x9042('0x18')]);}})['catch'](function(_0x33a994){logger[_0x9042('0x16')](_0x9042('0x11'),_0x1916e4,_0x33a994);_0x221990(_0x33a994);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index b39c27a..f203b7c 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 _0xd194=['update','delete','exports','multer','path','Router','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xd194,0x123));var _0x4d19=function(_0x5b7705,_0xb703cd){_0x5b7705=_0x5b7705-0x0;var _0x41caea=_0xd194[_0x5b7705];return _0x41caea;};'use strict';var multer=require(_0x4d19('0x0'));var util=require('util');var path=require(_0x4d19('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d19('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d19('0x3'));var controller=require(_0x4d19('0x4'));router[_0x4d19('0x5')]('/',auth[_0x4d19('0x6')](),controller[_0x4d19('0x7')]);router[_0x4d19('0x5')]('/describe',auth[_0x4d19('0x6')](),controller['describe']);router[_0x4d19('0x5')](_0x4d19('0x8'),auth[_0x4d19('0x6')](),controller[_0x4d19('0x9')]);router[_0x4d19('0xa')]('/',auth[_0x4d19('0x6')](),controller[_0x4d19('0xb')]);router[_0x4d19('0xc')](_0x4d19('0x8'),auth[_0x4d19('0x6')](),controller[_0x4d19('0xd')]);router[_0x4d19('0xe')](_0x4d19('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d19('0xf')]=router; \ No newline at end of file +var _0x3def=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id','show','post','isAuthenticated','create'];(function(_0x1514a2,_0x27a630){var _0x5d65a8=function(_0x96aa2c){while(--_0x96aa2c){_0x1514a2['push'](_0x1514a2['shift']());}};_0x5d65a8(++_0x27a630);}(_0x3def,0x101));var _0xf3de=function(_0x378aa9,_0x4efd69){_0x378aa9=_0x378aa9-0x0;var _0x4cfafe=_0x3def[_0x378aa9];return _0x4cfafe;};'use strict';var multer=require(_0xf3de('0x0'));var util=require(_0xf3de('0x1'));var path=require(_0xf3de('0x2'));var timeout=require(_0xf3de('0x3'));var express=require('express');var router=express[_0xf3de('0x4')]();var auth=require(_0xf3de('0x5'));var interaction=require(_0xf3de('0x6'));var config=require(_0xf3de('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xf3de('0x8')]('/',auth['isAuthenticated'](),controller[_0xf3de('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf3de('0xa')]);router[_0xf3de('0x8')](_0xf3de('0xb'),auth['isAuthenticated'](),controller[_0xf3de('0xc')]);router[_0xf3de('0xd')]('/',auth[_0xf3de('0xe')](),controller[_0xf3de('0xf')]);router[_0xf3de('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf3de('0x11')]);router[_0xf3de('0x12')](_0xf3de('0xb'),auth[_0xf3de('0xe')](),controller[_0xf3de('0x13')]);module[_0xf3de('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 6d176d4..42d7ee3 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 _0x10b8=['STRING','TEXT','long','sequelize','exports'];(function(_0x27c5e9,_0x23d409){var _0xf547f2=function(_0x154cc3){while(--_0x154cc3){_0x27c5e9['push'](_0x27c5e9['shift']());}};_0xf547f2(++_0x23d409);}(_0x10b8,0x166));var _0x810b=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x10b8[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0x810b('0x0'));module[_0x810b('0x1')]={'question':{'type':Sequelize[_0x810b('0x2')]},'answer':{'type':Sequelize[_0x810b('0x3')](_0x810b('0x4'))},'membername':{'type':Sequelize[_0x810b('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x810b('0x2')]},'uniqueid':{'type':Sequelize[_0x810b('0x2')]},'calleridname':{'type':Sequelize[_0x810b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x810b('0x2')]}}; \ No newline at end of file +var _0xd3d1=['long','STRING','sequelize','exports'];(function(_0x4fe7fb,_0xb577a7){var _0x348ab4=function(_0xf26c41){while(--_0xf26c41){_0x4fe7fb['push'](_0x4fe7fb['shift']());}};_0x348ab4(++_0xb577a7);}(_0xd3d1,0x172));var _0x1d3d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd3d1[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x1d3d('0x0'));module[_0x1d3d('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT'](_0x1d3d('0x2'))},'membername':{'type':Sequelize[_0x1d3d('0x3')]},'projectname':{'type':Sequelize[_0x1d3d('0x3')]},'queue':{'type':Sequelize[_0x1d3d('0x3')]},'uniqueid':{'type':Sequelize[_0x1d3d('0x3')]},'calleridname':{'type':Sequelize[_0x1d3d('0x3')]},'calleridnum':{'type':Sequelize[_0x1d3d('0x3')]},'questionId':{'type':Sequelize[_0x1d3d('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index e6ec797..5f129bd 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 _0x9829=['sendStatus','end','json','count','offset','status','set','apply','reject','update','then','destroy','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','include','rows','show','params','includeAll','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2f08c1,_0x45a9bd){var _0x3bd057=function(_0xca272e){while(--_0xca272e){_0x2f08c1['push'](_0x2f08c1['shift']());}};_0x3bd057(++_0x45a9bd);}(_0x9829,0xc4));var _0x9982=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x9829[_0x35007a];return _0x574f68;};'use strict';var pdf=require(_0x9982('0x0'));var emlformat=require(_0x9982('0x1'));var rimraf=require(_0x9982('0x2'));var zipdir=require(_0x9982('0x3'));var jsonpatch=require(_0x9982('0x4'));var rp=require('request-promise');var moment=require(_0x9982('0x5'));var BPromise=require(_0x9982('0x6'));var Mustache=require(_0x9982('0x7'));var util=require('util');var path=require(_0x9982('0x8'));var sox=require(_0x9982('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9982('0xa'));var squel=require(_0x9982('0xb'));var crypto=require('crypto');var jsforce=require(_0x9982('0xc'));var deskjs=require(_0x9982('0xd'));var toCsv=require(_0x9982('0xe'));var querystring=require(_0x9982('0xf'));var Papa=require(_0x9982('0x10'));var Redis=require(_0x9982('0x11'));var authService=require(_0x9982('0x12'));var qs=require(_0x9982('0x13'));var hardwareService=require(_0x9982('0x14'));var logger=require(_0x9982('0x15'))(_0x9982('0x16'));var utils=require(_0x9982('0x17'));var config=require(_0x9982('0x18'));var db=require(_0x9982('0x19'))['db'];function respondWithStatusCode(_0x19a09e,_0x2db668){_0x2db668=_0x2db668||0xcc;return function(_0x390539){if(_0x390539){return _0x19a09e[_0x9982('0x1a')](_0x2db668);}return _0x19a09e['status'](_0x2db668)[_0x9982('0x1b')]();};}function respondWithResult(_0x3c1ac2,_0x5ba2d3){_0x5ba2d3=_0x5ba2d3||0xc8;return function(_0x3ca506){if(_0x3ca506){return _0x3c1ac2['status'](_0x5ba2d3)[_0x9982('0x1c')](_0x3ca506);}};}function respondWithFilteredResult(_0xbf0d32,_0xca7c34){return function(_0x199688){if(_0x199688){var _0x128118=_0x199688[_0x9982('0x1d')],_0xcd1405=_0xca7c34['offset'],_0x2883f6=_0xca7c34[_0x9982('0x1e')]+_0xca7c34['limit'],_0xca588d;if(_0x2883f6>=_0x128118){_0x2883f6=_0x128118;_0xca588d=0xc8;}else{_0xca588d=0xce;}_0xbf0d32[_0x9982('0x1f')](_0xca588d);return _0xbf0d32[_0x9982('0x20')]('Content-Range',_0xcd1405+'-'+_0x2883f6+'/'+_0x128118)[_0x9982('0x1c')](_0x199688);}return null;};}function patchUpdates(_0xef3382){return function(_0x2fb603){try{jsonpatch[_0x9982('0x21')](_0x2fb603,_0xef3382,!![]);}catch(_0x1297d7){return BPromise[_0x9982('0x22')](_0x1297d7);}return _0x2fb603['save']();};}function saveUpdates(_0x243bd8,_0x3802d4){return function(_0x5ea55d){if(_0x5ea55d){return _0x5ea55d[_0x9982('0x23')](_0x243bd8)[_0x9982('0x24')](function(_0x6523c0){return _0x6523c0;});}return null;};}function removeEntity(_0x2928ec,_0x136a66){return function(_0x1eec90){if(_0x1eec90){return _0x1eec90[_0x9982('0x25')]()[_0x9982('0x24')](function(){_0x2928ec[_0x9982('0x1f')](0xcc)[_0x9982('0x1b')]();});}};}function handleEntityNotFound(_0x11a7e8,_0x37bb60){return function(_0x3797be){if(!_0x3797be){_0x11a7e8['sendStatus'](0x194);}return _0x3797be;};}function handleError(_0x865a6d,_0x5a5d57){_0x5a5d57=_0x5a5d57||0x1f4;return function(_0x1be0c2){logger[_0x9982('0x26')](_0x1be0c2[_0x9982('0x27')]);if(_0x1be0c2[_0x9982('0x28')]){delete _0x1be0c2[_0x9982('0x28')];}_0x865a6d[_0x9982('0x1f')](_0x5a5d57)[_0x9982('0x29')](_0x1be0c2);};}exports[_0x9982('0x2a')]=function(_0xe752e3,_0xef4608){var _0x1eab54={},_0x2dc1ba={},_0x14d49c={'count':0x0,'rows':[]};var _0x2c2b28=db[_0x9982('0x2b')][_0x9982('0x2c')];_0x2dc1ba['model']=_['keys'](_0x2c2b28);_0x2dc1ba[_0x9982('0x2d')]=_[_0x9982('0x2e')](_0xe752e3[_0x9982('0x2d')]);_0x2dc1ba[_0x9982('0x2f')]=_[_0x9982('0x30')](_0x2dc1ba[_0x9982('0x31')],_0x2dc1ba[_0x9982('0x2d')]);_0x1eab54[_0x9982('0x32')]=_[_0x9982('0x30')](_0x2dc1ba[_0x9982('0x31')],qs[_0x9982('0x33')](_0xe752e3[_0x9982('0x2d')]['fields']));_0x1eab54[_0x9982('0x32')]=_0x1eab54[_0x9982('0x32')][_0x9982('0x34')]?_0x1eab54[_0x9982('0x32')]:_0x2dc1ba[_0x9982('0x31')];if(!_0xe752e3[_0x9982('0x2d')]['hasOwnProperty'](_0x9982('0x35'))){_0x1eab54['limit']=qs[_0x9982('0x36')](_0xe752e3[_0x9982('0x2d')][_0x9982('0x36')]);_0x1eab54[_0x9982('0x1e')]=qs[_0x9982('0x1e')](_0xe752e3[_0x9982('0x2d')][_0x9982('0x1e')]);}_0x1eab54['order']=qs[_0x9982('0x37')](_0xe752e3[_0x9982('0x2d')][_0x9982('0x37')]);_0x1eab54[_0x9982('0x38')]=qs[_0x9982('0x2f')](_['pick'](_0xe752e3[_0x9982('0x2d')],_0x2dc1ba['filters']));if(_0xe752e3['query'][_0x9982('0x39')]){_0x1eab54[_0x9982('0x38')]=_['merge'](_0x1eab54[_0x9982('0x38')],{'$or':_[_0x9982('0x3a')](_0x2c2b28,function(_0x1db893){if(_0x1db893[_0x9982('0x3b')][_0x9982('0x3c')]!==_0x9982('0x3d')){var _0x1f4c86={};_0x1f4c86[_0x1db893[_0x9982('0x3e')]]={'$like':'%'+_0xe752e3[_0x9982('0x2d')][_0x9982('0x39')]+'%'};return _0x1f4c86;}})});}_0x1eab54=_[_0x9982('0x3f')]({},_0x1eab54,_0xe752e3[_0x9982('0x40')]);var _0x55d5c8={'where':_0x1eab54[_0x9982('0x38')]};return db[_0x9982('0x2b')][_0x9982('0x1d')](_0x55d5c8)[_0x9982('0x24')](function(_0x2a3647){_0x14d49c['count']=_0x2a3647;if(_0xe752e3['query']['includeAll']){_0x1eab54[_0x9982('0x41')]=[{'all':!![]}];}return db[_0x9982('0x2b')]['findAll'](_0x1eab54);})[_0x9982('0x24')](function(_0x39afc0){_0x14d49c[_0x9982('0x42')]=_0x39afc0;return _0x14d49c;})[_0x9982('0x24')](respondWithFilteredResult(_0xef4608,_0x1eab54))['catch'](handleError(_0xef4608,null));};exports[_0x9982('0x43')]=function(_0x1942a5,_0x100af8){var _0x1d6292={'raw':!![],'where':{'id':_0x1942a5[_0x9982('0x44')]['id']}},_0x1b2e3f={};_0x1b2e3f['model']=_['keys'](db[_0x9982('0x2b')][_0x9982('0x2c')]);_0x1b2e3f[_0x9982('0x2d')]=_['keys'](_0x1942a5[_0x9982('0x2d')]);_0x1b2e3f[_0x9982('0x2f')]=_[_0x9982('0x30')](_0x1b2e3f['model'],_0x1b2e3f['query']);_0x1d6292['attributes']=_['intersection'](_0x1b2e3f['model'],qs[_0x9982('0x33')](_0x1942a5['query'][_0x9982('0x33')]));_0x1d6292[_0x9982('0x32')]=_0x1d6292['attributes'][_0x9982('0x34')]?_0x1d6292[_0x9982('0x32')]:_0x1b2e3f[_0x9982('0x31')];if(_0x1942a5[_0x9982('0x2d')][_0x9982('0x45')]){_0x1d6292['include']=[{'all':!![]}];}_0x1d6292=_[_0x9982('0x3f')]({},_0x1d6292,_0x1942a5[_0x9982('0x40')]);return db[_0x9982('0x2b')][_0x9982('0x46')](_0x1d6292)[_0x9982('0x24')](handleEntityNotFound(_0x100af8,null))[_0x9982('0x24')](respondWithResult(_0x100af8,null))[_0x9982('0x47')](handleError(_0x100af8,null));};exports[_0x9982('0x48')]=function(_0xff38a5,_0x53f9c9){return db[_0x9982('0x2b')]['create'](_0xff38a5['body'],{})[_0x9982('0x24')](respondWithResult(_0x53f9c9,0xc9))[_0x9982('0x47')](handleError(_0x53f9c9,null));};exports['update']=function(_0x27b1d0,_0x1c8fde){if(_0x27b1d0[_0x9982('0x49')]['id']){delete _0x27b1d0[_0x9982('0x49')]['id'];}return db[_0x9982('0x2b')]['find']({'where':{'id':_0x27b1d0[_0x9982('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c8fde,null))[_0x9982('0x24')](saveUpdates(_0x27b1d0[_0x9982('0x49')],null))['then'](respondWithResult(_0x1c8fde,null))[_0x9982('0x47')](handleError(_0x1c8fde,null));};exports[_0x9982('0x25')]=function(_0x251996,_0x46cac4){return db[_0x9982('0x2b')]['find']({'where':{'id':_0x251996[_0x9982('0x44')]['id']}})[_0x9982('0x24')](handleEntityNotFound(_0x46cac4,null))[_0x9982('0x24')](removeEntity(_0x46cac4,null))['catch'](handleError(_0x46cac4,null));};exports['describe']=function(_0x52a2f2,_0x586a6f){return db[_0x9982('0x2b')]['describe']()[_0x9982('0x24')](respondWithResult(_0x586a6f,null))[_0x9982('0x47')](handleError(_0x586a6f,null));}; \ No newline at end of file +var _0xf417=['key','VIRTUAL','field','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','mustache','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','error','stack','send','index','JscriptyQuestionReport','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf417,0x8f));var _0x7f41=function(_0x1d5ad0,_0x40aeae){_0x1d5ad0=_0x1d5ad0-0x0;var _0x57a56b=_0xf417[_0x1d5ad0];return _0x57a56b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7f41('0x0'));var rimraf=require(_0x7f41('0x1'));var zipdir=require(_0x7f41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f41('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7f41('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7f41('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7f41('0x6'));var crypto=require(_0x7f41('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x7f41('0x8'));var toCsv=require('to-csv');var querystring=require(_0x7f41('0x9'));var Papa=require('papaparse');var Redis=require(_0x7f41('0xa'));var authService=require(_0x7f41('0xb'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f41('0xc'))('api');var utils=require('../../config/utils');var config=require(_0x7f41('0xd'));var db=require(_0x7f41('0xe'))['db'];function respondWithStatusCode(_0x45d9f8,_0x3407b2){_0x3407b2=_0x3407b2||0xcc;return function(_0x637b2d){if(_0x637b2d){return _0x45d9f8[_0x7f41('0xf')](_0x3407b2);}return _0x45d9f8[_0x7f41('0x10')](_0x3407b2)['end']();};}function respondWithResult(_0x513d36,_0x380ee0){_0x380ee0=_0x380ee0||0xc8;return function(_0x4f5b74){if(_0x4f5b74){return _0x513d36['status'](_0x380ee0)[_0x7f41('0x11')](_0x4f5b74);}};}function respondWithFilteredResult(_0x1ff483,_0x2d59af){return function(_0x5a517f){if(_0x5a517f){var _0x212b28=_0x5a517f[_0x7f41('0x12')],_0x5ef6a7=_0x2d59af['offset'],_0x27c0f6=_0x2d59af[_0x7f41('0x13')]+_0x2d59af[_0x7f41('0x14')],_0x51004d;if(_0x27c0f6>=_0x212b28){_0x27c0f6=_0x212b28;_0x51004d=0xc8;}else{_0x51004d=0xce;}_0x1ff483[_0x7f41('0x10')](_0x51004d);return _0x1ff483['set'](_0x7f41('0x15'),_0x5ef6a7+'-'+_0x27c0f6+'/'+_0x212b28)[_0x7f41('0x11')](_0x5a517f);}return null;};}function patchUpdates(_0x549ee8){return function(_0x98210f){try{jsonpatch[_0x7f41('0x16')](_0x98210f,_0x549ee8,!![]);}catch(_0x1f4af0){return BPromise['reject'](_0x1f4af0);}return _0x98210f[_0x7f41('0x17')]();};}function saveUpdates(_0x58c86e,_0x503239){return function(_0x3fe620){if(_0x3fe620){return _0x3fe620[_0x7f41('0x18')](_0x58c86e)[_0x7f41('0x19')](function(_0x21660b){return _0x21660b;});}return null;};}function removeEntity(_0x451efa,_0x3af3f7){return function(_0x5e0f8b){if(_0x5e0f8b){return _0x5e0f8b['destroy']()[_0x7f41('0x19')](function(){_0x451efa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb27d9c,_0x388946){return function(_0x4fdd78){if(!_0x4fdd78){_0xb27d9c[_0x7f41('0xf')](0x194);}return _0x4fdd78;};}function handleError(_0x2dae27,_0x43b936){_0x43b936=_0x43b936||0x1f4;return function(_0x39d287){logger[_0x7f41('0x1a')](_0x39d287[_0x7f41('0x1b')]);if(_0x39d287['name']){delete _0x39d287['name'];}_0x2dae27['status'](_0x43b936)[_0x7f41('0x1c')](_0x39d287);};}exports[_0x7f41('0x1d')]=function(_0x55a32a,_0xd0b56c){var _0x3d52f7={},_0x5b5610={},_0x4a814e={'count':0x0,'rows':[]};var _0x51a935=db[_0x7f41('0x1e')]['rawAttributes'];_0x5b5610['model']=_['keys'](_0x51a935);_0x5b5610[_0x7f41('0x1f')]=_[_0x7f41('0x20')](_0x55a32a['query']);_0x5b5610[_0x7f41('0x21')]=_[_0x7f41('0x22')](_0x5b5610['model'],_0x5b5610[_0x7f41('0x1f')]);_0x3d52f7[_0x7f41('0x23')]=_[_0x7f41('0x22')](_0x5b5610['model'],qs['fields'](_0x55a32a['query'][_0x7f41('0x24')]));_0x3d52f7[_0x7f41('0x23')]=_0x3d52f7[_0x7f41('0x23')][_0x7f41('0x25')]?_0x3d52f7[_0x7f41('0x23')]:_0x5b5610[_0x7f41('0x26')];if(!_0x55a32a['query'][_0x7f41('0x27')](_0x7f41('0x28'))){_0x3d52f7[_0x7f41('0x14')]=qs['limit'](_0x55a32a[_0x7f41('0x1f')]['limit']);_0x3d52f7[_0x7f41('0x13')]=qs[_0x7f41('0x13')](_0x55a32a[_0x7f41('0x1f')]['offset']);}_0x3d52f7[_0x7f41('0x29')]=qs[_0x7f41('0x2a')](_0x55a32a[_0x7f41('0x1f')][_0x7f41('0x2a')]);_0x3d52f7[_0x7f41('0x2b')]=qs[_0x7f41('0x21')](_[_0x7f41('0x2c')](_0x55a32a[_0x7f41('0x1f')],_0x5b5610['filters']));if(_0x55a32a[_0x7f41('0x1f')][_0x7f41('0x2d')]){_0x3d52f7[_0x7f41('0x2b')]=_[_0x7f41('0x2e')](_0x3d52f7[_0x7f41('0x2b')],{'$or':_[_0x7f41('0x2f')](_0x51a935,function(_0x3448ef){if(_0x3448ef[_0x7f41('0x30')][_0x7f41('0x31')]!==_0x7f41('0x32')){var _0x12bdd7={};_0x12bdd7[_0x3448ef[_0x7f41('0x33')]]={'$like':'%'+_0x55a32a['query'][_0x7f41('0x2d')]+'%'};return _0x12bdd7;}})});}_0x3d52f7=_[_0x7f41('0x2e')]({},_0x3d52f7,_0x55a32a['options']);var _0x46bbc7={'where':_0x3d52f7['where']};return db[_0x7f41('0x1e')][_0x7f41('0x12')](_0x46bbc7)[_0x7f41('0x19')](function(_0x540e91){_0x4a814e[_0x7f41('0x12')]=_0x540e91;if(_0x55a32a[_0x7f41('0x1f')]['includeAll']){_0x3d52f7['include']=[{'all':!![]}];}return db[_0x7f41('0x1e')][_0x7f41('0x34')](_0x3d52f7);})[_0x7f41('0x19')](function(_0x33f9d5){_0x4a814e[_0x7f41('0x35')]=_0x33f9d5;return _0x4a814e;})[_0x7f41('0x19')](respondWithFilteredResult(_0xd0b56c,_0x3d52f7))[_0x7f41('0x36')](handleError(_0xd0b56c,null));};exports[_0x7f41('0x37')]=function(_0x2ea20d,_0x50b389){var _0x3b1a0e={'raw':!![],'where':{'id':_0x2ea20d[_0x7f41('0x38')]['id']}},_0x40a7c8={};_0x40a7c8[_0x7f41('0x26')]=_[_0x7f41('0x20')](db[_0x7f41('0x1e')]['rawAttributes']);_0x40a7c8[_0x7f41('0x1f')]=_[_0x7f41('0x20')](_0x2ea20d[_0x7f41('0x1f')]);_0x40a7c8[_0x7f41('0x21')]=_['intersection'](_0x40a7c8['model'],_0x40a7c8[_0x7f41('0x1f')]);_0x3b1a0e[_0x7f41('0x23')]=_[_0x7f41('0x22')](_0x40a7c8['model'],qs[_0x7f41('0x24')](_0x2ea20d[_0x7f41('0x1f')]['fields']));_0x3b1a0e[_0x7f41('0x23')]=_0x3b1a0e[_0x7f41('0x23')][_0x7f41('0x25')]?_0x3b1a0e[_0x7f41('0x23')]:_0x40a7c8['model'];if(_0x2ea20d[_0x7f41('0x1f')]['includeAll']){_0x3b1a0e[_0x7f41('0x39')]=[{'all':!![]}];}_0x3b1a0e=_[_0x7f41('0x2e')]({},_0x3b1a0e,_0x2ea20d[_0x7f41('0x3a')]);return db[_0x7f41('0x1e')]['find'](_0x3b1a0e)[_0x7f41('0x19')](handleEntityNotFound(_0x50b389,null))[_0x7f41('0x19')](respondWithResult(_0x50b389,null))[_0x7f41('0x36')](handleError(_0x50b389,null));};exports['create']=function(_0x37b7,_0x4bc834){return db['JscriptyQuestionReport'][_0x7f41('0x3b')](_0x37b7[_0x7f41('0x3c')],{})[_0x7f41('0x19')](respondWithResult(_0x4bc834,0xc9))[_0x7f41('0x36')](handleError(_0x4bc834,null));};exports[_0x7f41('0x18')]=function(_0x234734,_0x3dbd75){if(_0x234734[_0x7f41('0x3c')]['id']){delete _0x234734[_0x7f41('0x3c')]['id'];}return db[_0x7f41('0x1e')][_0x7f41('0x3d')]({'where':{'id':_0x234734[_0x7f41('0x38')]['id']}})['then'](handleEntityNotFound(_0x3dbd75,null))[_0x7f41('0x19')](saveUpdates(_0x234734[_0x7f41('0x3c')],null))[_0x7f41('0x19')](respondWithResult(_0x3dbd75,null))[_0x7f41('0x36')](handleError(_0x3dbd75,null));};exports[_0x7f41('0x3e')]=function(_0x3a0b0a,_0x12ac2d){return db[_0x7f41('0x1e')][_0x7f41('0x3d')]({'where':{'id':_0x3a0b0a['params']['id']}})[_0x7f41('0x19')](handleEntityNotFound(_0x12ac2d,null))['then'](removeEntity(_0x12ac2d,null))['catch'](handleError(_0x12ac2d,null));};exports[_0x7f41('0x3f')]=function(_0x16d462,_0x3c8632){return db['JscriptyQuestionReport'][_0x7f41('0x3f')]()[_0x7f41('0x19')](respondWithResult(_0x3c8632,null))[_0x7f41('0x36')](handleError(_0x3c8632,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 379a251..3f9405a 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 _0xa254=['JscriptyQuestionReport','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','define'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa254,0x1eb));var _0x4a25=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xa254[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x4a25('0x0'));var util=require(_0x4a25('0x1'));var logger=require(_0x4a25('0x2'))(_0x4a25('0x3'));var moment=require('moment');var BPromise=require(_0x4a25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a25('0x5'));var rimraf=require(_0x4a25('0x6'));var config=require(_0x4a25('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x1a83e6,_0x467375){return _0x1a83e6[_0x4a25('0x8')](_0x4a25('0x9'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb61e=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb61e,0xda));var _0xeb61=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0xb61e[_0x562362];return _0x3a18ce;};'use strict';var _=require(_0xeb61('0x0'));var util=require(_0xeb61('0x1'));var logger=require(_0xeb61('0x2'))(_0xeb61('0x3'));var moment=require('moment');var BPromise=require(_0xeb61('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb61('0x5'));var config=require(_0xeb61('0x6'));var attributes=require(_0xeb61('0x7'));module[_0xeb61('0x8')]=function(_0x37575e,_0x53bc66){return _0x37575e[_0xeb61('0x9')](_0xeb61('0xa'),attributes,{'tableName':_0xeb61('0xb'),'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 db01efe..c0d8609 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 _0x8f2d=['rpc','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x8f2d,0x1f3));var _0xd8f2=function(_0x1b6f2f,_0x14af31){_0x1b6f2f=_0x1b6f2f-0x0;var _0x59dbe8=_0x8f2d[_0x1b6f2f];return _0x59dbe8;};'use strict';var _=require(_0xd8f2('0x0'));var util=require(_0xd8f2('0x1'));var moment=require('moment');var BPromise=require(_0xd8f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8f2('0x3'));var db=require(_0xd8f2('0x4'))['db'];var utils=require(_0xd8f2('0x5'));var logger=require(_0xd8f2('0x6'))(_0xd8f2('0x7'));var config=require('../../config/environment');var jayson=require(_0xd8f2('0x8'));var client=jayson[_0xd8f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239601,_0x18d5a3,_0x695ceb){return new BPromise(function(_0x2d10e1,_0x4ee340){return client[_0xd8f2('0xa')](_0x239601,_0x695ceb)[_0xd8f2('0xb')](function(_0x47cce6){logger[_0xd8f2('0xc')](_0xd8f2('0xd'),_0x18d5a3,_0xd8f2('0xe'));logger[_0xd8f2('0xf')](_0xd8f2('0x10'),_0x18d5a3,_0xd8f2('0xe'),JSON['stringify'](_0x47cce6));if(_0x47cce6[_0xd8f2('0x11')]){if(_0x47cce6[_0xd8f2('0x11')][_0xd8f2('0x12')]===0x1f4){logger[_0xd8f2('0x11')](_0xd8f2('0xd'),_0x18d5a3,_0x47cce6['error'][_0xd8f2('0x13')]);return _0x4ee340(_0x47cce6[_0xd8f2('0x11')][_0xd8f2('0x13')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x18d5a3,_0x47cce6[_0xd8f2('0x11')][_0xd8f2('0x13')]);return _0x2d10e1(_0x47cce6[_0xd8f2('0x11')]['message']);}else{logger[_0xd8f2('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x18d5a3,_0xd8f2('0xe'));_0x2d10e1(_0x47cce6[_0xd8f2('0x14')][_0xd8f2('0x13')]);}})[_0xd8f2('0x15')](function(_0x12a5ef){logger['error'](_0xd8f2('0xd'),_0x18d5a3,_0x12a5ef);_0x4ee340(_0x12a5ef);});});} \ No newline at end of file +var _0xd25b=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xd25b,0x6a));var _0xbd25=function(_0x1ff9c5,_0x42e45f){_0x1ff9c5=_0x1ff9c5-0x0;var _0x155a56=_0xd25b[_0x1ff9c5];return _0x155a56;};'use strict';var _=require(_0xbd25('0x0'));var util=require(_0xbd25('0x1'));var moment=require(_0xbd25('0x2'));var BPromise=require(_0xbd25('0x3'));var rs=require(_0xbd25('0x4'));var fs=require('fs');var Redis=require(_0xbd25('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbd25('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbd25('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x127ec9,_0x3f3dea,_0x57e0e1){return new BPromise(function(_0xd2fbe3,_0x5ad98d){return client['request'](_0x127ec9,_0x57e0e1)[_0xbd25('0x8')](function(_0x52253d){logger[_0xbd25('0x9')](_0xbd25('0xa'),_0x3f3dea,_0xbd25('0xb'));logger['debug'](_0xbd25('0xc'),_0x3f3dea,'request\x20sent',JSON['stringify'](_0x52253d));if(_0x52253d[_0xbd25('0xd')]){if(_0x52253d['error']['code']===0x1f4){logger[_0xbd25('0xd')](_0xbd25('0xa'),_0x3f3dea,_0x52253d[_0xbd25('0xd')]['message']);return _0x5ad98d(_0x52253d['error'][_0xbd25('0xe')]);}logger[_0xbd25('0xd')](_0xbd25('0xa'),_0x3f3dea,_0x52253d[_0xbd25('0xd')]['message']);return _0xd2fbe3(_0x52253d[_0xbd25('0xd')]['message']);}else{logger[_0xbd25('0x9')](_0xbd25('0xa'),_0x3f3dea,_0xbd25('0xb'));_0xd2fbe3(_0x52253d[_0xbd25('0xf')][_0xbd25('0xe')]);}})[_0xbd25('0x10')](function(_0x39f2f0){logger[_0xbd25('0xd')](_0xbd25('0xa'),_0x3f3dea,_0x39f2f0);_0x5ad98d(_0x39f2f0);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index e623e3e..217bb9b 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 _0xc8d8=['express','Router','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','post','put','exports','multer','util'];(function(_0x1817b0,_0x3aaaa1){var _0x5c10e6=function(_0x9b3a2d){while(--_0x9b3a2d){_0x1817b0['push'](_0x1817b0['shift']());}};_0x5c10e6(++_0x3aaaa1);}(_0xc8d8,0x1b8));var _0x8c8d=function(_0x53056a,_0x304edc){_0x53056a=_0x53056a-0x0;var _0x3f1e16=_0xc8d8[_0x53056a];return _0x3f1e16;};'use strict';var multer=require(_0x8c8d('0x0'));var util=require(_0x8c8d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8c8d('0x2'));var router=express[_0x8c8d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8c8d('0x4'));var config=require('../../config/environment');var controller=require(_0x8c8d('0x5'));router[_0x8c8d('0x6')]('/',auth[_0x8c8d('0x7')](),controller['index']);router[_0x8c8d('0x6')](_0x8c8d('0x8'),auth[_0x8c8d('0x7')](),controller[_0x8c8d('0x9')]);router[_0x8c8d('0x6')](_0x8c8d('0xa'),auth['isAuthenticated'](),controller[_0x8c8d('0xb')]);router[_0x8c8d('0x6')](_0x8c8d('0xc'),auth[_0x8c8d('0x7')](),controller[_0x8c8d('0xd')]);router[_0x8c8d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c8d('0xf')](_0x8c8d('0xa'),auth[_0x8c8d('0x7')](),controller['update']);router['delete'](_0x8c8d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x8c8d('0x10')]=router; \ No newline at end of file +var _0xa04c=['/:id','show','getQuestions','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe'];(function(_0x4e0836,_0x21b2f4){var _0xd5b650=function(_0x2d0eb9){while(--_0x2d0eb9){_0x4e0836['push'](_0x4e0836['shift']());}};_0xd5b650(++_0x21b2f4);}(_0xa04c,0x10d));var _0xca04=function(_0x103099,_0x9fcf28){_0x103099=_0x103099-0x0;var _0x2a3856=_0xa04c[_0x103099];return _0x2a3856;};'use strict';var multer=require(_0xca04('0x0'));var util=require(_0xca04('0x1'));var path=require(_0xca04('0x2'));var timeout=require(_0xca04('0x3'));var express=require(_0xca04('0x4'));var router=express['Router']();var auth=require(_0xca04('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca04('0x6'));var controller=require(_0xca04('0x7'));router[_0xca04('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xca04('0x9')](),controller[_0xca04('0xa')]);router[_0xca04('0x8')](_0xca04('0xb'),auth[_0xca04('0x9')](),controller[_0xca04('0xc')]);router[_0xca04('0x8')]('/:id/questions',auth[_0xca04('0x9')](),controller[_0xca04('0xd')]);router[_0xca04('0xe')]('/',auth['isAuthenticated'](),controller[_0xca04('0xf')]);router['put'](_0xca04('0xb'),auth[_0xca04('0x9')](),controller[_0xca04('0x10')]);router[_0xca04('0x11')](_0xca04('0xb'),auth[_0xca04('0x9')](),controller[_0xca04('0x12')]);module[_0xca04('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a9192ac..cf04e17 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 _0xe650=['DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe650,0xfd));var _0x0e65=function(_0x3e6b83,_0x224b71){_0x3e6b83=_0x3e6b83-0x0;var _0x599977=_0xe650[_0x3e6b83];return _0x599977;};'use strict';var moment=require(_0x0e65('0x0'));var Sequelize=require(_0x0e65('0x1'));module[_0x0e65('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x17ae8c){this[_0x0e65('0x3')](_0x0e65('0x4'),_0x17ae8c);this['setDataValue']('endtime',moment()[_0x0e65('0x5')](_0x0e65('0x6')));}},'endtime':{'type':Sequelize[_0x0e65('0x7')]},'membername':{'type':Sequelize[_0x0e65('0x8')]},'projectname':{'type':Sequelize[_0x0e65('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0e65('0x8')]},'calleridname':{'type':Sequelize[_0x0e65('0x8')]},'calleridnum':{'type':Sequelize[_0x0e65('0x8')]},'completed':{'type':Sequelize[_0x0e65('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xe30f=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xe30f,0xed));var _0xfe30=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe30f[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0xfe30('0x0'));var Sequelize=require(_0xfe30('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xfe30('0x2')],'set':function(_0x111f7f){this[_0xfe30('0x3')](_0xfe30('0x4'),_0x111f7f);this[_0xfe30('0x3')](_0xfe30('0x5'),moment()[_0xfe30('0x6')](_0xfe30('0x7')));}},'endtime':{'type':Sequelize[_0xfe30('0x2')]},'membername':{'type':Sequelize[_0xfe30('0x8')]},'projectname':{'type':Sequelize[_0xfe30('0x8')]},'queue':{'type':Sequelize[_0xfe30('0x8')]},'uniqueid':{'type':Sequelize[_0xfe30('0x8')]},'calleridname':{'type':Sequelize[_0xfe30('0x8')]},'calleridnum':{'type':Sequelize[_0xfe30('0x8')]},'completed':{'type':Sequelize[_0xfe30('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index b8d583a..ca8f281 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 _0xe0bf=['lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','limit','Content-Range','json','apply','save','update','then','stack','send','index','JscriptySessionReport','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','field','filter','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','getQuestions','JscriptyQuestionReport','order','SessionId','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x20b9eb,_0x20a6af){var _0x37a017=function(_0x3031e8){while(--_0x3031e8){_0x20b9eb['push'](_0x20b9eb['shift']());}};_0x37a017(++_0x20a6af);}(_0xe0bf,0x123));var _0xfe0b=function(_0x181322,_0x21ebc8){_0x181322=_0x181322-0x0;var _0x7e377c=_0xe0bf[_0x181322];return _0x7e377c;};'use strict';var pdf=require(_0xfe0b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfe0b('0x1'));var zipdir=require(_0xfe0b('0x2'));var jsonpatch=require(_0xfe0b('0x3'));var rp=require(_0xfe0b('0x4'));var moment=require(_0xfe0b('0x5'));var BPromise=require(_0xfe0b('0x6'));var Mustache=require(_0xfe0b('0x7'));var util=require(_0xfe0b('0x8'));var path=require(_0xfe0b('0x9'));var sox=require(_0xfe0b('0xa'));var csv=require(_0xfe0b('0xb'));var ejs=require(_0xfe0b('0xc'));var fs=require('fs');var _=require(_0xfe0b('0xd'));var squel=require(_0xfe0b('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfe0b('0xf'));var Papa=require(_0xfe0b('0x10'));var Redis=require(_0xfe0b('0x11'));var authService=require(_0xfe0b('0x12'));var qs=require(_0xfe0b('0x13'));var hardwareService=require(_0xfe0b('0x14'));var logger=require(_0xfe0b('0x15'))(_0xfe0b('0x16'));var utils=require(_0xfe0b('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cad9f,_0x371b3c){_0x371b3c=_0x371b3c||0xcc;return function(_0x332cf8){if(_0x332cf8){return _0x3cad9f[_0xfe0b('0x18')](_0x371b3c);}return _0x3cad9f[_0xfe0b('0x19')](_0x371b3c)[_0xfe0b('0x1a')]();};}function respondWithResult(_0x1c7c58,_0x4ddc19){_0x4ddc19=_0x4ddc19||0xc8;return function(_0x444521){if(_0x444521){return _0x1c7c58[_0xfe0b('0x19')](_0x4ddc19)['json'](_0x444521);}};}function respondWithFilteredResult(_0x217ffe,_0x4bab72){return function(_0x1be0d1){if(_0x1be0d1){var _0x225533=_0x1be0d1['count'],_0x4c0f1c=_0x4bab72['offset'],_0x9fe275=_0x4bab72[_0xfe0b('0x1b')]+_0x4bab72[_0xfe0b('0x1c')],_0x19e6b2;if(_0x9fe275>=_0x225533){_0x9fe275=_0x225533;_0x19e6b2=0xc8;}else{_0x19e6b2=0xce;}_0x217ffe[_0xfe0b('0x19')](_0x19e6b2);return _0x217ffe['set'](_0xfe0b('0x1d'),_0x4c0f1c+'-'+_0x9fe275+'/'+_0x225533)[_0xfe0b('0x1e')](_0x1be0d1);}return null;};}function patchUpdates(_0x292ba0){return function(_0x319045){try{jsonpatch[_0xfe0b('0x1f')](_0x319045,_0x292ba0,!![]);}catch(_0x5ba47d){return BPromise['reject'](_0x5ba47d);}return _0x319045[_0xfe0b('0x20')]();};}function saveUpdates(_0x391553,_0xb967e9){return function(_0x20f5fa){if(_0x20f5fa){return _0x20f5fa[_0xfe0b('0x21')](_0x391553)[_0xfe0b('0x22')](function(_0x4ff9be){return _0x4ff9be;});}return null;};}function removeEntity(_0x378715,_0xe0386b){return function(_0x405e04){if(_0x405e04){return _0x405e04['destroy']()[_0xfe0b('0x22')](function(){_0x378715[_0xfe0b('0x19')](0xcc)[_0xfe0b('0x1a')]();});}};}function handleEntityNotFound(_0x327fa5,_0x2cc762){return function(_0x4473b2){if(!_0x4473b2){_0x327fa5[_0xfe0b('0x18')](0x194);}return _0x4473b2;};}function handleError(_0xa2283d,_0x5b0882){_0x5b0882=_0x5b0882||0x1f4;return function(_0x1ec43c){logger['error'](_0x1ec43c[_0xfe0b('0x23')]);if(_0x1ec43c['name']){delete _0x1ec43c['name'];}_0xa2283d[_0xfe0b('0x19')](_0x5b0882)[_0xfe0b('0x24')](_0x1ec43c);};}exports[_0xfe0b('0x25')]=function(_0x2e7126,_0x11a385){var _0x47b953={},_0x147462={},_0x1a687e={'count':0x0,'rows':[]};var _0x19d086=db[_0xfe0b('0x26')][_0xfe0b('0x27')];_0x147462['model']=_[_0xfe0b('0x28')](_0x19d086);_0x147462[_0xfe0b('0x29')]=_[_0xfe0b('0x28')](_0x2e7126[_0xfe0b('0x29')]);_0x147462[_0xfe0b('0x2a')]=_[_0xfe0b('0x2b')](_0x147462[_0xfe0b('0x2c')],_0x147462[_0xfe0b('0x29')]);_0x47b953['attributes']=_[_0xfe0b('0x2b')](_0x147462[_0xfe0b('0x2c')],qs[_0xfe0b('0x2d')](_0x2e7126[_0xfe0b('0x29')][_0xfe0b('0x2d')]));_0x47b953[_0xfe0b('0x2e')]=_0x47b953[_0xfe0b('0x2e')][_0xfe0b('0x2f')]?_0x47b953[_0xfe0b('0x2e')]:_0x147462[_0xfe0b('0x2c')];if(!_0x2e7126[_0xfe0b('0x29')][_0xfe0b('0x30')](_0xfe0b('0x31'))){_0x47b953[_0xfe0b('0x1c')]=qs[_0xfe0b('0x1c')](_0x2e7126[_0xfe0b('0x29')][_0xfe0b('0x1c')]);_0x47b953[_0xfe0b('0x1b')]=qs[_0xfe0b('0x1b')](_0x2e7126[_0xfe0b('0x29')]['offset']);}_0x47b953['order']=qs[_0xfe0b('0x32')](_0x2e7126[_0xfe0b('0x29')][_0xfe0b('0x32')]);_0x47b953[_0xfe0b('0x33')]=qs[_0xfe0b('0x2a')](_[_0xfe0b('0x34')](_0x2e7126[_0xfe0b('0x29')],_0x147462[_0xfe0b('0x2a')]));if(_0x2e7126[_0xfe0b('0x29')]['filter']){_0x47b953[_0xfe0b('0x33')]=_[_0xfe0b('0x35')](_0x47b953['where'],{'$or':_[_0xfe0b('0x36')](_0x19d086,function(_0x1e67b8){if(_0x1e67b8[_0xfe0b('0x37')][_0xfe0b('0x38')]!=='VIRTUAL'){var _0x4710b6={};_0x4710b6[_0x1e67b8[_0xfe0b('0x39')]]={'$like':'%'+_0x2e7126[_0xfe0b('0x29')][_0xfe0b('0x3a')]+'%'};return _0x4710b6;}})});}_0x47b953=_[_0xfe0b('0x35')]({},_0x47b953,_0x2e7126[_0xfe0b('0x3b')]);var _0x3e17dc={'where':_0x47b953[_0xfe0b('0x33')]};return db[_0xfe0b('0x26')][_0xfe0b('0x3c')](_0x3e17dc)[_0xfe0b('0x22')](function(_0x5bbae0){_0x1a687e[_0xfe0b('0x3c')]=_0x5bbae0;if(_0x2e7126['query'][_0xfe0b('0x3d')]){_0x47b953[_0xfe0b('0x3e')]=[{'all':!![]}];}return db[_0xfe0b('0x26')][_0xfe0b('0x3f')](_0x47b953);})[_0xfe0b('0x22')](function(_0x5962c5){_0x1a687e[_0xfe0b('0x40')]=_0x5962c5;return _0x1a687e;})[_0xfe0b('0x22')](respondWithFilteredResult(_0x11a385,_0x47b953))[_0xfe0b('0x41')](handleError(_0x11a385,null));};exports['show']=function(_0xeb46ef,_0x3285fa){var _0x3269dc={'raw':!![],'where':{'id':_0xeb46ef[_0xfe0b('0x42')]['id']}},_0x45d19b={};_0x45d19b[_0xfe0b('0x2c')]=_[_0xfe0b('0x28')](db['JscriptySessionReport'][_0xfe0b('0x27')]);_0x45d19b[_0xfe0b('0x29')]=_[_0xfe0b('0x28')](_0xeb46ef[_0xfe0b('0x29')]);_0x45d19b['filters']=_[_0xfe0b('0x2b')](_0x45d19b['model'],_0x45d19b['query']);_0x3269dc[_0xfe0b('0x2e')]=_['intersection'](_0x45d19b['model'],qs['fields'](_0xeb46ef[_0xfe0b('0x29')][_0xfe0b('0x2d')]));_0x3269dc['attributes']=_0x3269dc[_0xfe0b('0x2e')][_0xfe0b('0x2f')]?_0x3269dc[_0xfe0b('0x2e')]:_0x45d19b['model'];if(_0xeb46ef['query'][_0xfe0b('0x3d')]){_0x3269dc['include']=[{'all':!![]}];}_0x3269dc=_[_0xfe0b('0x35')]({},_0x3269dc,_0xeb46ef['options']);return db[_0xfe0b('0x26')][_0xfe0b('0x43')](_0x3269dc)[_0xfe0b('0x22')](handleEntityNotFound(_0x3285fa,null))[_0xfe0b('0x22')](respondWithResult(_0x3285fa,null))['catch'](handleError(_0x3285fa,null));};exports[_0xfe0b('0x44')]=function(_0x12ee7f,_0x42b0e6){return db[_0xfe0b('0x26')][_0xfe0b('0x44')](_0x12ee7f[_0xfe0b('0x45')],{})[_0xfe0b('0x22')](respondWithResult(_0x42b0e6,0xc9))[_0xfe0b('0x41')](handleError(_0x42b0e6,null));};exports[_0xfe0b('0x21')]=function(_0x541c06,_0x3813ea){if(_0x541c06['body']['id']){delete _0x541c06['body']['id'];}return db[_0xfe0b('0x26')][_0xfe0b('0x43')]({'where':{'id':_0x541c06[_0xfe0b('0x42')]['id']}})['then'](handleEntityNotFound(_0x3813ea,null))[_0xfe0b('0x22')](saveUpdates(_0x541c06[_0xfe0b('0x45')],null))['then'](respondWithResult(_0x3813ea,null))['catch'](handleError(_0x3813ea,null));};exports[_0xfe0b('0x46')]=function(_0x3682c4,_0x2108c0){return db[_0xfe0b('0x26')][_0xfe0b('0x43')]({'where':{'id':_0x3682c4['params']['id']}})['then'](handleEntityNotFound(_0x2108c0,null))[_0xfe0b('0x22')](removeEntity(_0x2108c0,null))[_0xfe0b('0x41')](handleError(_0x2108c0,null));};exports[_0xfe0b('0x47')]=function(_0x2bf9a1,_0x1b0b4b){return db[_0xfe0b('0x26')][_0xfe0b('0x47')]()[_0xfe0b('0x22')](respondWithResult(_0x1b0b4b,null))[_0xfe0b('0x41')](handleError(_0x1b0b4b,null));};exports[_0xfe0b('0x48')]=function(_0x4ccc25,_0x4e0a71,_0x1a68eb){var _0x5a7068={'raw':!![],'where':{}};var _0x544239={};var _0x1a7313={'count':0x0,'rows':[]};return db[_0xfe0b('0x26')]['findOne']({'where':{'id':_0x4ccc25[_0xfe0b('0x42')]['id']}})[_0xfe0b('0x22')](handleEntityNotFound(_0x4e0a71,null))[_0xfe0b('0x22')](function(_0x2c752c){if(_0x2c752c){_0x544239[_0xfe0b('0x2c')]=_['keys'](db[_0xfe0b('0x49')][_0xfe0b('0x27')]);_0x544239[_0xfe0b('0x29')]=_['keys'](_0x4ccc25['query']);_0x544239[_0xfe0b('0x2a')]=_[_0xfe0b('0x2b')](_0x544239['model'],_0x544239[_0xfe0b('0x29')]);_0x5a7068['attributes']=_[_0xfe0b('0x2b')](_0x544239[_0xfe0b('0x2c')],qs[_0xfe0b('0x2d')](_0x4ccc25['query'][_0xfe0b('0x2d')]));_0x5a7068[_0xfe0b('0x2e')]=_0x5a7068['attributes'][_0xfe0b('0x2f')]?_0x5a7068[_0xfe0b('0x2e')]:_0x544239[_0xfe0b('0x2c')];if(!_0x4ccc25[_0xfe0b('0x29')]['hasOwnProperty']('nolimit')){_0x5a7068[_0xfe0b('0x1c')]=qs[_0xfe0b('0x1c')](_0x4ccc25[_0xfe0b('0x29')]['limit']);_0x5a7068[_0xfe0b('0x1b')]=qs[_0xfe0b('0x1b')](_0x4ccc25['query'][_0xfe0b('0x1b')]);}_0x5a7068[_0xfe0b('0x4a')]=qs[_0xfe0b('0x32')](_0x4ccc25['query'][_0xfe0b('0x32')]);_0x5a7068[_0xfe0b('0x33')]=qs[_0xfe0b('0x2a')](_[_0xfe0b('0x34')](_0x4ccc25[_0xfe0b('0x29')],_0x544239[_0xfe0b('0x2a')]));_0x5a7068[_0xfe0b('0x33')][_0xfe0b('0x4b')]=_0x2c752c['id'];if(_0x4ccc25[_0xfe0b('0x29')][_0xfe0b('0x3a')]){_0x5a7068[_0xfe0b('0x33')]=_[_0xfe0b('0x35')](_0x5a7068[_0xfe0b('0x33')],{'$or':_[_0xfe0b('0x36')](_0x5a7068['attributes'],function(_0x1dc680){var _0x485dfe={};_0x485dfe[_0x1dc680]={'$like':'%'+_0x4ccc25[_0xfe0b('0x29')][_0xfe0b('0x3a')]+'%'};return _0x485dfe;})});}_0x5a7068=_[_0xfe0b('0x35')]({},_0x5a7068,_0x4ccc25['options']);return db[_0xfe0b('0x49')]['count']({'where':_0x5a7068[_0xfe0b('0x33')]})[_0xfe0b('0x22')](function(_0x1fb64c){_0x1a7313[_0xfe0b('0x3c')]=_0x1fb64c;if(_0x4ccc25['query'][_0xfe0b('0x3d')]){_0x5a7068[_0xfe0b('0x3e')]=[{'all':!![]}];}return db[_0xfe0b('0x49')][_0xfe0b('0x3f')](_0x5a7068);})['then'](function(_0x53f491){_0x1a7313[_0xfe0b('0x40')]=_0x53f491;return _0x1a7313;});}})['then'](respondWithFilteredResult(_0x4e0a71,_0x5a7068))['catch'](handleError(_0x4e0a71,null));}; \ No newline at end of file +var _0x46af=['create','body','describe','getQuestions','findOne','hasOwnProperty','pick','SessionId','map','JscriptyQuestionReport','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','JscriptySessionReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','key','field','options','includeAll','findAll','rows','catch','show','params','include','find'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0x46af,0x1a9));var _0xf46a=function(_0x52a49c,_0x553997){_0x52a49c=_0x52a49c-0x0;var _0x56a7ca=_0x46af[_0x52a49c];return _0x56a7ca;};'use strict';var pdf=require(_0xf46a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf46a('0x1'));var zipdir=require(_0xf46a('0x2'));var jsonpatch=require(_0xf46a('0x3'));var rp=require(_0xf46a('0x4'));var moment=require(_0xf46a('0x5'));var BPromise=require(_0xf46a('0x6'));var Mustache=require(_0xf46a('0x7'));var util=require(_0xf46a('0x8'));var path=require(_0xf46a('0x9'));var sox=require(_0xf46a('0xa'));var csv=require(_0xf46a('0xb'));var ejs=require(_0xf46a('0xc'));var fs=require('fs');var _=require(_0xf46a('0xd'));var squel=require(_0xf46a('0xe'));var crypto=require(_0xf46a('0xf'));var jsforce=require(_0xf46a('0x10'));var deskjs=require(_0xf46a('0x11'));var toCsv=require(_0xf46a('0xb'));var querystring=require(_0xf46a('0x12'));var Papa=require('papaparse');var Redis=require(_0xf46a('0x13'));var authService=require(_0xf46a('0x14'));var qs=require(_0xf46a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf46a('0x16'))(_0xf46a('0x17'));var utils=require(_0xf46a('0x18'));var config=require(_0xf46a('0x19'));var db=require(_0xf46a('0x1a'))['db'];function respondWithStatusCode(_0x4dafa8,_0x5409e5){_0x5409e5=_0x5409e5||0xcc;return function(_0x2cabbd){if(_0x2cabbd){return _0x4dafa8[_0xf46a('0x1b')](_0x5409e5);}return _0x4dafa8[_0xf46a('0x1c')](_0x5409e5)[_0xf46a('0x1d')]();};}function respondWithResult(_0x929d7a,_0x76e500){_0x76e500=_0x76e500||0xc8;return function(_0x4b0272){if(_0x4b0272){return _0x929d7a[_0xf46a('0x1c')](_0x76e500)[_0xf46a('0x1e')](_0x4b0272);}};}function respondWithFilteredResult(_0x5333b0,_0x1884a4){return function(_0x16191f){if(_0x16191f){var _0x31caa4=_0x16191f[_0xf46a('0x1f')],_0x40905a=_0x1884a4[_0xf46a('0x20')],_0x1b5046=_0x1884a4[_0xf46a('0x20')]+_0x1884a4[_0xf46a('0x21')],_0x2fd114;if(_0x1b5046>=_0x31caa4){_0x1b5046=_0x31caa4;_0x2fd114=0xc8;}else{_0x2fd114=0xce;}_0x5333b0[_0xf46a('0x1c')](_0x2fd114);return _0x5333b0[_0xf46a('0x22')](_0xf46a('0x23'),_0x40905a+'-'+_0x1b5046+'/'+_0x31caa4)['json'](_0x16191f);}return null;};}function patchUpdates(_0x2ca2bc){return function(_0x2fe248){try{jsonpatch[_0xf46a('0x24')](_0x2fe248,_0x2ca2bc,!![]);}catch(_0x3e9f48){return BPromise[_0xf46a('0x25')](_0x3e9f48);}return _0x2fe248['save']();};}function saveUpdates(_0x5ec232,_0x378f09){return function(_0x3a9da7){if(_0x3a9da7){return _0x3a9da7[_0xf46a('0x26')](_0x5ec232)[_0xf46a('0x27')](function(_0x2d7a46){return _0x2d7a46;});}return null;};}function removeEntity(_0x33ddfd,_0x182da8){return function(_0x475099){if(_0x475099){return _0x475099[_0xf46a('0x28')]()[_0xf46a('0x27')](function(){_0x33ddfd[_0xf46a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2292,_0x7bd685){return function(_0x30a650){if(!_0x30a650){_0x5c2292[_0xf46a('0x1b')](0x194);}return _0x30a650;};}function handleError(_0x1254b3,_0x4a08f4){_0x4a08f4=_0x4a08f4||0x1f4;return function(_0x3d8df9){logger['error'](_0x3d8df9[_0xf46a('0x29')]);if(_0x3d8df9[_0xf46a('0x2a')]){delete _0x3d8df9[_0xf46a('0x2a')];}_0x1254b3[_0xf46a('0x1c')](_0x4a08f4)[_0xf46a('0x2b')](_0x3d8df9);};}exports[_0xf46a('0x2c')]=function(_0x4a3eb7,_0x507960){var _0x1e2efa={},_0x2e3081={},_0xb328fc={'count':0x0,'rows':[]};var _0x3390b8=db[_0xf46a('0x2d')][_0xf46a('0x2e')];_0x2e3081[_0xf46a('0x2f')]=_['keys'](_0x3390b8);_0x2e3081[_0xf46a('0x30')]=_[_0xf46a('0x31')](_0x4a3eb7[_0xf46a('0x30')]);_0x2e3081[_0xf46a('0x32')]=_[_0xf46a('0x33')](_0x2e3081[_0xf46a('0x2f')],_0x2e3081['query']);_0x1e2efa[_0xf46a('0x34')]=_[_0xf46a('0x33')](_0x2e3081['model'],qs[_0xf46a('0x35')](_0x4a3eb7['query'][_0xf46a('0x35')]));_0x1e2efa[_0xf46a('0x34')]=_0x1e2efa[_0xf46a('0x34')][_0xf46a('0x36')]?_0x1e2efa['attributes']:_0x2e3081['model'];if(!_0x4a3eb7[_0xf46a('0x30')]['hasOwnProperty'](_0xf46a('0x37'))){_0x1e2efa[_0xf46a('0x21')]=qs[_0xf46a('0x21')](_0x4a3eb7[_0xf46a('0x30')][_0xf46a('0x21')]);_0x1e2efa[_0xf46a('0x20')]=qs[_0xf46a('0x20')](_0x4a3eb7[_0xf46a('0x30')]['offset']);}_0x1e2efa[_0xf46a('0x38')]=qs[_0xf46a('0x39')](_0x4a3eb7[_0xf46a('0x30')][_0xf46a('0x39')]);_0x1e2efa[_0xf46a('0x3a')]=qs[_0xf46a('0x32')](_['pick'](_0x4a3eb7['query'],_0x2e3081['filters']));if(_0x4a3eb7[_0xf46a('0x30')][_0xf46a('0x3b')]){_0x1e2efa['where']=_[_0xf46a('0x3c')](_0x1e2efa[_0xf46a('0x3a')],{'$or':_['map'](_0x3390b8,function(_0x437eba){if(_0x437eba[_0xf46a('0x3d')][_0xf46a('0x3e')]!=='VIRTUAL'){var _0x49d3fe={};_0x49d3fe[_0x437eba[_0xf46a('0x3f')]]={'$like':'%'+_0x4a3eb7[_0xf46a('0x30')][_0xf46a('0x3b')]+'%'};return _0x49d3fe;}})});}_0x1e2efa=_[_0xf46a('0x3c')]({},_0x1e2efa,_0x4a3eb7[_0xf46a('0x40')]);var _0x9c4492={'where':_0x1e2efa['where']};return db[_0xf46a('0x2d')][_0xf46a('0x1f')](_0x9c4492)[_0xf46a('0x27')](function(_0x426ed4){_0xb328fc[_0xf46a('0x1f')]=_0x426ed4;if(_0x4a3eb7[_0xf46a('0x30')][_0xf46a('0x41')]){_0x1e2efa['include']=[{'all':!![]}];}return db[_0xf46a('0x2d')][_0xf46a('0x42')](_0x1e2efa);})[_0xf46a('0x27')](function(_0xc72de0){_0xb328fc[_0xf46a('0x43')]=_0xc72de0;return _0xb328fc;})['then'](respondWithFilteredResult(_0x507960,_0x1e2efa))[_0xf46a('0x44')](handleError(_0x507960,null));};exports[_0xf46a('0x45')]=function(_0x299392,_0x32df3d){var _0x4c21da={'raw':!![],'where':{'id':_0x299392[_0xf46a('0x46')]['id']}},_0x5a8cbf={};_0x5a8cbf[_0xf46a('0x2f')]=_['keys'](db[_0xf46a('0x2d')][_0xf46a('0x2e')]);_0x5a8cbf[_0xf46a('0x30')]=_[_0xf46a('0x31')](_0x299392[_0xf46a('0x30')]);_0x5a8cbf[_0xf46a('0x32')]=_[_0xf46a('0x33')](_0x5a8cbf[_0xf46a('0x2f')],_0x5a8cbf[_0xf46a('0x30')]);_0x4c21da[_0xf46a('0x34')]=_['intersection'](_0x5a8cbf['model'],qs[_0xf46a('0x35')](_0x299392[_0xf46a('0x30')][_0xf46a('0x35')]));_0x4c21da[_0xf46a('0x34')]=_0x4c21da[_0xf46a('0x34')][_0xf46a('0x36')]?_0x4c21da[_0xf46a('0x34')]:_0x5a8cbf[_0xf46a('0x2f')];if(_0x299392[_0xf46a('0x30')][_0xf46a('0x41')]){_0x4c21da[_0xf46a('0x47')]=[{'all':!![]}];}_0x4c21da=_[_0xf46a('0x3c')]({},_0x4c21da,_0x299392[_0xf46a('0x40')]);return db[_0xf46a('0x2d')][_0xf46a('0x48')](_0x4c21da)['then'](handleEntityNotFound(_0x32df3d,null))['then'](respondWithResult(_0x32df3d,null))[_0xf46a('0x44')](handleError(_0x32df3d,null));};exports[_0xf46a('0x49')]=function(_0x27d4df,_0x140ea1){return db[_0xf46a('0x2d')][_0xf46a('0x49')](_0x27d4df[_0xf46a('0x4a')],{})[_0xf46a('0x27')](respondWithResult(_0x140ea1,0xc9))[_0xf46a('0x44')](handleError(_0x140ea1,null));};exports['update']=function(_0x119b3c,_0x413943){if(_0x119b3c[_0xf46a('0x4a')]['id']){delete _0x119b3c[_0xf46a('0x4a')]['id'];}return db[_0xf46a('0x2d')][_0xf46a('0x48')]({'where':{'id':_0x119b3c[_0xf46a('0x46')]['id']}})[_0xf46a('0x27')](handleEntityNotFound(_0x413943,null))[_0xf46a('0x27')](saveUpdates(_0x119b3c[_0xf46a('0x4a')],null))['then'](respondWithResult(_0x413943,null))[_0xf46a('0x44')](handleError(_0x413943,null));};exports[_0xf46a('0x28')]=function(_0x5b8ad4,_0x5328c3){return db[_0xf46a('0x2d')][_0xf46a('0x48')]({'where':{'id':_0x5b8ad4[_0xf46a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5328c3,null))[_0xf46a('0x27')](removeEntity(_0x5328c3,null))[_0xf46a('0x44')](handleError(_0x5328c3,null));};exports[_0xf46a('0x4b')]=function(_0x8bc776,_0x471681){return db[_0xf46a('0x2d')]['describe']()[_0xf46a('0x27')](respondWithResult(_0x471681,null))[_0xf46a('0x44')](handleError(_0x471681,null));};exports[_0xf46a('0x4c')]=function(_0x1181e3,_0x184cfe,_0x106985){var _0xa05ca9={'raw':!![],'where':{}};var _0xba4f97={};var _0x6d684a={'count':0x0,'rows':[]};return db[_0xf46a('0x2d')][_0xf46a('0x4d')]({'where':{'id':_0x1181e3[_0xf46a('0x46')]['id']}})[_0xf46a('0x27')](handleEntityNotFound(_0x184cfe,null))[_0xf46a('0x27')](function(_0x4e7e8c){if(_0x4e7e8c){_0xba4f97[_0xf46a('0x2f')]=_[_0xf46a('0x31')](db['JscriptyQuestionReport']['rawAttributes']);_0xba4f97[_0xf46a('0x30')]=_[_0xf46a('0x31')](_0x1181e3[_0xf46a('0x30')]);_0xba4f97[_0xf46a('0x32')]=_['intersection'](_0xba4f97[_0xf46a('0x2f')],_0xba4f97['query']);_0xa05ca9[_0xf46a('0x34')]=_[_0xf46a('0x33')](_0xba4f97[_0xf46a('0x2f')],qs[_0xf46a('0x35')](_0x1181e3['query']['fields']));_0xa05ca9[_0xf46a('0x34')]=_0xa05ca9[_0xf46a('0x34')][_0xf46a('0x36')]?_0xa05ca9[_0xf46a('0x34')]:_0xba4f97[_0xf46a('0x2f')];if(!_0x1181e3['query'][_0xf46a('0x4e')](_0xf46a('0x37'))){_0xa05ca9['limit']=qs[_0xf46a('0x21')](_0x1181e3[_0xf46a('0x30')]['limit']);_0xa05ca9[_0xf46a('0x20')]=qs[_0xf46a('0x20')](_0x1181e3[_0xf46a('0x30')]['offset']);}_0xa05ca9[_0xf46a('0x38')]=qs[_0xf46a('0x39')](_0x1181e3['query'][_0xf46a('0x39')]);_0xa05ca9[_0xf46a('0x3a')]=qs[_0xf46a('0x32')](_[_0xf46a('0x4f')](_0x1181e3[_0xf46a('0x30')],_0xba4f97[_0xf46a('0x32')]));_0xa05ca9[_0xf46a('0x3a')][_0xf46a('0x50')]=_0x4e7e8c['id'];if(_0x1181e3[_0xf46a('0x30')][_0xf46a('0x3b')]){_0xa05ca9['where']=_['merge'](_0xa05ca9[_0xf46a('0x3a')],{'$or':_[_0xf46a('0x51')](_0xa05ca9[_0xf46a('0x34')],function(_0x2d8d6d){var _0x4503fc={};_0x4503fc[_0x2d8d6d]={'$like':'%'+_0x1181e3[_0xf46a('0x30')][_0xf46a('0x3b')]+'%'};return _0x4503fc;})});}_0xa05ca9=_['merge']({},_0xa05ca9,_0x1181e3['options']);return db['JscriptyQuestionReport']['count']({'where':_0xa05ca9[_0xf46a('0x3a')]})[_0xf46a('0x27')](function(_0x2a5870){_0x6d684a[_0xf46a('0x1f')]=_0x2a5870;if(_0x1181e3[_0xf46a('0x30')]['includeAll']){_0xa05ca9['include']=[{'all':!![]}];}return db[_0xf46a('0x52')][_0xf46a('0x42')](_0xa05ca9);})[_0xf46a('0x27')](function(_0x31fa41){_0x6d684a['rows']=_0x31fa41;return _0x6d684a;});}})[_0xf46a('0x27')](respondWithFilteredResult(_0x184cfe,_0xa05ca9))[_0xf46a('0x44')](handleError(_0x184cfe,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index b09800d..06c7815 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 _0x7190=['moment','request-promise','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','api'];(function(_0x9b57f0,_0xf8a0c6){var _0x4691e2=function(_0x565679){while(--_0x565679){_0x9b57f0['push'](_0x9b57f0['shift']());}};_0x4691e2(++_0xf8a0c6);}(_0x7190,0x147));var _0x0719=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x7190[_0x5e3bb1];return _0x4c1278;};'use strict';var _=require('lodash');var util=require(_0x0719('0x0'));var logger=require(_0x0719('0x1'))(_0x0719('0x2'));var moment=require(_0x0719('0x3'));var BPromise=require('bluebird');var rp=require(_0x0719('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0719('0x5'));var attributes=require(_0x0719('0x6'));module[_0x0719('0x7')]=function(_0x46d96b,_0x52ec79){return _0x46d96b[_0x0719('0x8')](_0x0719('0x9'),attributes,{'tableName':_0x0719('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b2f=['api','moment','path','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3b2f,0x165));var _0xf3b2=function(_0x6ed92b,_0x21fea8){_0x6ed92b=_0x6ed92b-0x0;var _0x443c72=_0x3b2f[_0x6ed92b];return _0x443c72;};'use strict';var _=require(_0xf3b2('0x0'));var util=require(_0xf3b2('0x1'));var logger=require(_0xf3b2('0x2'))(_0xf3b2('0x3'));var moment=require(_0xf3b2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3b2('0x5'));var rimraf=require('rimraf');var config=require(_0xf3b2('0x6'));var attributes=require(_0xf3b2('0x7'));module['exports']=function(_0x401a58,_0x9ac2ac){return _0x401a58[_0xf3b2('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xf3b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 8eb86df..4ae08f2 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 _0x7f94=['JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4d6e5a,_0xd03239){var _0x2e8074=function(_0x1d46a1){while(--_0x1d46a1){_0x4d6e5a['push'](_0x4d6e5a['shift']());}};_0x2e8074(++_0xd03239);}(_0x7f94,0x65));var _0x47f9=function(_0x4bfa93,_0x33a65f){_0x4bfa93=_0x4bfa93-0x0;var _0x2a6d30=_0x7f94[_0x4bfa93];return _0x2a6d30;};'use strict';var _=require(_0x47f9('0x0'));var util=require('util');var moment=require(_0x47f9('0x1'));var BPromise=require(_0x47f9('0x2'));var rs=require(_0x47f9('0x3'));var fs=require('fs');var Redis=require(_0x47f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47f9('0x5'));var logger=require(_0x47f9('0x6'))(_0x47f9('0x7'));var config=require(_0x47f9('0x8'));var jayson=require(_0x47f9('0x9'));var client=jayson[_0x47f9('0xa')][_0x47f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x572cab,_0x42fa6d,_0x4a8f54){return new BPromise(function(_0x23ab0b,_0x3240cf){return client[_0x47f9('0xc')](_0x572cab,_0x4a8f54)[_0x47f9('0xd')](function(_0x813b51){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x42fa6d,'request\x20sent');logger['debug'](_0x47f9('0xe'),_0x42fa6d,_0x47f9('0xf'),JSON[_0x47f9('0x10')](_0x813b51));if(_0x813b51[_0x47f9('0x11')]){if(_0x813b51[_0x47f9('0x11')][_0x47f9('0x12')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x42fa6d,_0x813b51[_0x47f9('0x11')]['message']);return _0x3240cf(_0x813b51['error']['message']);}logger[_0x47f9('0x11')](_0x47f9('0x13'),_0x42fa6d,_0x813b51['error'][_0x47f9('0x14')]);return _0x23ab0b(_0x813b51[_0x47f9('0x11')][_0x47f9('0x14')]);}else{logger[_0x47f9('0x15')]('JscriptySessionReport,\x20%s,\x20%s',_0x42fa6d,_0x47f9('0xf'));_0x23ab0b(_0x813b51[_0x47f9('0x16')][_0x47f9('0x14')]);}})[_0x47f9('0x17')](function(_0x27ad5e){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x42fa6d,_0x27ad5e);_0x3240cf(_0x27ad5e);});});} \ No newline at end of file +var _0x56b9=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5a0cb2,_0x43a6e4){var _0x32b526=function(_0x47de3c){while(--_0x47de3c){_0x5a0cb2['push'](_0x5a0cb2['shift']());}};_0x32b526(++_0x43a6e4);}(_0x56b9,0x196));var _0x956b=function(_0x2a3ffd,_0x17eb4f){_0x2a3ffd=_0x2a3ffd-0x0;var _0xc74f8d=_0x56b9[_0x2a3ffd];return _0xc74f8d;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var moment=require(_0x956b('0x2'));var BPromise=require(_0x956b('0x3'));var rs=require(_0x956b('0x4'));var fs=require('fs');var Redis=require(_0x956b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x956b('0x6'));var logger=require('../../config/logger')(_0x956b('0x7'));var config=require(_0x956b('0x8'));var jayson=require(_0x956b('0x9'));var client=jayson['client'][_0x956b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d40b0,_0x322012,_0x2683d8){return new BPromise(function(_0x222eae,_0x299c94){return client[_0x956b('0xb')](_0x3d40b0,_0x2683d8)[_0x956b('0xc')](function(_0x5e0388){logger[_0x956b('0xd')](_0x956b('0xe'),_0x322012,'request\x20sent');logger[_0x956b('0xf')](_0x956b('0x10'),_0x322012,_0x956b('0x11'),JSON[_0x956b('0x12')](_0x5e0388));if(_0x5e0388[_0x956b('0x13')]){if(_0x5e0388['error'][_0x956b('0x14')]===0x1f4){logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);return _0x299c94(_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);}logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);return _0x222eae(_0x5e0388['error'][_0x956b('0x15')]);}else{logger[_0x956b('0xd')](_0x956b('0xe'),_0x322012,'request\x20sent');_0x222eae(_0x5e0388[_0x956b('0x16')][_0x956b('0x15')]);}})[_0x956b('0x17')](function(_0x3cc1b7){logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x3cc1b7);_0x299c94(_0x3cc1b7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 73640fc..7d39dd9 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 _0xdc88=['update','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','isAuthenticated'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xdc88,0xc5));var _0x8dc8=function(_0x3a991f,_0x422a87){_0x3a991f=_0x3a991f-0x0;var _0x14f0d4=_0xdc88[_0x3a991f];return _0x14f0d4;};'use strict';var multer=require('multer');var util=require(_0x8dc8('0x0'));var path=require('path');var timeout=require(_0x8dc8('0x1'));var express=require(_0x8dc8('0x2'));var router=express[_0x8dc8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8dc8('0x4'));var config=require(_0x8dc8('0x5'));var controller=require(_0x8dc8('0x6'));router[_0x8dc8('0x7')]('/',controller[_0x8dc8('0x8')]);router[_0x8dc8('0x9')]('/:id',auth[_0x8dc8('0xa')](),controller[_0x8dc8('0xb')]);module[_0x8dc8('0xc')]=router; \ No newline at end of file +var _0x92fe=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','exports','multer','path'];(function(_0x35e4c6,_0x5973a4){var _0x1e15c4=function(_0x2f4b87){while(--_0x2f4b87){_0x35e4c6['push'](_0x35e4c6['shift']());}};_0x1e15c4(++_0x5973a4);}(_0x92fe,0x6a));var _0xe92f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe92f('0x0'));var util=require('util');var path=require(_0xe92f('0x1'));var timeout=require(_0xe92f('0x2'));var express=require(_0xe92f('0x3'));var router=express[_0xe92f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe92f('0x5'));var config=require(_0xe92f('0x6'));var controller=require('./license.controller');router['get']('/',controller['index']);router[_0xe92f('0x7')](_0xe92f('0x8'),auth[_0xe92f('0x9')](),controller[_0xe92f('0xa')]);module[_0xe92f('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 570f6ff..c277b95 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 _0x52fa=['sequelize','STRING','INTEGER'];(function(_0x2abf46,_0x1ce985){var _0x411e95=function(_0x5f14e8){while(--_0x5f14e8){_0x2abf46['push'](_0x2abf46['shift']());}};_0x411e95(++_0x1ce985);}(_0x52fa,0xa5));var _0xa52f=function(_0x543467,_0x4f24fd){_0x543467=_0x543467-0x0;var _0x20cae4=_0x52fa[_0x543467];return _0x20cae4;};'use strict';var Sequelize=require(_0xa52f('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xa52f('0x1')]},'data2':{'type':Sequelize[_0xa52f('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xa52f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcee5=['STRING'];(function(_0x212fc9,_0x292039){var _0x7ef0c1=function(_0x5d9cf2){while(--_0x5d9cf2){_0x212fc9['push'](_0x212fc9['shift']());}};_0x7ef0c1(++_0x292039);}(_0xcee5,0x1c7));var _0x5cee=function(_0x1edd5e,_0x4148de){_0x1edd5e=_0x1edd5e-0x0;var _0x1809b8=_0xcee5[_0x1edd5e];return _0x1809b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x5cee('0x0')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 35478b1..e2a82e6 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 _0x6a3b=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','name','send','../../config/license/util','model','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','catch','body','License','find','params','get','checkLicense','key','demo','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce'];(function(_0x2bac10,_0x486fe6){var _0x38096f=function(_0x341039){while(--_0x341039){_0x2bac10['push'](_0x2bac10['shift']());}};_0x38096f(++_0x486fe6);}(_0x6a3b,0x16b));var _0xb6a3=function(_0x43348a,_0x26daf2){_0x43348a=_0x43348a-0x0;var _0xab3e61=_0x6a3b[_0x43348a];return _0xab3e61;};'use strict';var pdf=require(_0xb6a3('0x0'));var emlformat=require(_0xb6a3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb6a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6a3('0x3'));var moment=require(_0xb6a3('0x4'));var BPromise=require(_0xb6a3('0x5'));var Mustache=require(_0xb6a3('0x6'));var util=require(_0xb6a3('0x7'));var path=require(_0xb6a3('0x8'));var sox=require(_0xb6a3('0x9'));var csv=require('to-csv');var ejs=require(_0xb6a3('0xa'));var fs=require('fs');var _=require(_0xb6a3('0xb'));var squel=require(_0xb6a3('0xc'));var crypto=require(_0xb6a3('0xd'));var jsforce=require(_0xb6a3('0xe'));var deskjs=require(_0xb6a3('0xf'));var toCsv=require(_0xb6a3('0x10'));var querystring=require(_0xb6a3('0x11'));var Papa=require(_0xb6a3('0x12'));var Redis=require(_0xb6a3('0x13'));var authService=require(_0xb6a3('0x14'));var qs=require(_0xb6a3('0x15'));var hardwareService=require(_0xb6a3('0x16'));var logger=require(_0xb6a3('0x17'))(_0xb6a3('0x18'));var utils=require(_0xb6a3('0x19'));var config=require(_0xb6a3('0x1a'));var db=require(_0xb6a3('0x1b'))['db'];function respondWithStatusCode(_0x67fd50,_0x199099){_0x199099=_0x199099||0xcc;return function(_0x5ddf90){if(_0x5ddf90){return _0x67fd50[_0xb6a3('0x1c')](_0x199099);}return _0x67fd50[_0xb6a3('0x1d')](_0x199099)[_0xb6a3('0x1e')]();};}function respondWithResult(_0x136785,_0x61c266){_0x61c266=_0x61c266||0xc8;return function(_0x2432cf){if(_0x2432cf){return _0x136785[_0xb6a3('0x1d')](_0x61c266)['json'](_0x2432cf);}};}function respondWithFilteredResult(_0xd6708b,_0x4dd24f){return function(_0x4bd362){if(_0x4bd362){var _0x452a59=_0x4bd362[_0xb6a3('0x1f')],_0x138f15=_0x4dd24f[_0xb6a3('0x20')],_0x240a0e=_0x4dd24f[_0xb6a3('0x20')]+_0x4dd24f[_0xb6a3('0x21')],_0x35e742;if(_0x240a0e>=_0x452a59){_0x240a0e=_0x452a59;_0x35e742=0xc8;}else{_0x35e742=0xce;}_0xd6708b[_0xb6a3('0x1d')](_0x35e742);return _0xd6708b['set'](_0xb6a3('0x22'),_0x138f15+'-'+_0x240a0e+'/'+_0x452a59)['json'](_0x4bd362);}return null;};}function patchUpdates(_0x30eabc){return function(_0x19b202){try{jsonpatch[_0xb6a3('0x23')](_0x19b202,_0x30eabc,!![]);}catch(_0x26abf0){return BPromise[_0xb6a3('0x24')](_0x26abf0);}return _0x19b202['save']();};}function saveUpdates(_0x4ed05d,_0x56aa26){return function(_0xc1913d){if(_0xc1913d){return _0xc1913d[_0xb6a3('0x25')](_0x4ed05d)[_0xb6a3('0x26')](function(_0x522d78){return _0x522d78;});}return null;};}function removeEntity(_0x4a0290,_0x2f85f7){return function(_0x2f3aaf){if(_0x2f3aaf){return _0x2f3aaf[_0xb6a3('0x27')]()[_0xb6a3('0x26')](function(){_0x4a0290[_0xb6a3('0x1d')](0xcc)[_0xb6a3('0x1e')]();});}};}function handleEntityNotFound(_0x1a5d1d,_0x346013){return function(_0x577c8c){if(!_0x577c8c){_0x1a5d1d['sendStatus'](0x194);}return _0x577c8c;};}function handleError(_0x3962d0,_0x3177e7){_0x3177e7=_0x3177e7||0x1f4;return function(_0x487a34){logger[_0xb6a3('0x28')](_0x487a34['stack']);if(_0x487a34['name']){delete _0x487a34[_0xb6a3('0x29')];}_0x3962d0[_0xb6a3('0x1d')](_0x3177e7)[_0xb6a3('0x2a')](_0x487a34);};}var utilLicense=require(_0xb6a3('0x2b'));exports['index']=function(_0x54aa52,_0x6fb4a){var _0x2f5b06={'raw':!![],'where':{'id':0x1}},_0x28ebf5={};_0x28ebf5[_0xb6a3('0x2c')]=_['keys'](db['License'][_0xb6a3('0x2d')]);_0x28ebf5[_0xb6a3('0x2e')]=_['keys'](_0x54aa52[_0xb6a3('0x2e')]);_0x28ebf5[_0xb6a3('0x2f')]=_[_0xb6a3('0x30')](_0x28ebf5['model'],_0x28ebf5['query']);_0x2f5b06[_0xb6a3('0x31')]=_[_0xb6a3('0x30')](_0x28ebf5[_0xb6a3('0x2c')],qs[_0xb6a3('0x32')](_0x54aa52[_0xb6a3('0x2e')]['fields']));_0x2f5b06[_0xb6a3('0x31')]=_0x2f5b06[_0xb6a3('0x31')][_0xb6a3('0x33')]?_0x2f5b06[_0xb6a3('0x31')]:_0x28ebf5[_0xb6a3('0x2c')];_0x2f5b06=_[_0xb6a3('0x34')]({},_0x2f5b06,_0x54aa52[_0xb6a3('0x35')]);return utilLicense['getLicense'](_0x2f5b06)['then'](respondWithResult(_0x6fb4a,null))[_0xb6a3('0x36')](handleError(_0x6fb4a,null));};exports[_0xb6a3('0x25')]=function(_0x3a46d6,_0xc52247){if(_0x3a46d6[_0xb6a3('0x37')]['id']){delete _0x3a46d6['body']['id'];}return db[_0xb6a3('0x38')][_0xb6a3('0x39')]({'where':{'id':_0x3a46d6[_0xb6a3('0x3a')]['id']}})[_0xb6a3('0x26')](handleEntityNotFound(_0xc52247,null))[_0xb6a3('0x26')](function(_0x210379){var _0x4f603b=_0x210379[_0xb6a3('0x3b')]({'plain':!![]});return utilLicense[_0xb6a3('0x3c')](_0x4f603b,_0x3a46d6[_0xb6a3('0x37')][_0xb6a3('0x3d')]);})[_0xb6a3('0x26')](function(_0x333b5c){if(!_0x333b5c[_0xb6a3('0x3e')]){return saveUpdates(_0x3a46d6['body'],null);}return _0x333b5c;})[_0xb6a3('0x26')](respondWithResult(_0xc52247,null))[_0xb6a3('0x36')](handleError(_0xc52247,null));}; \ No newline at end of file +var _0x1b94=['status','end','count','offset','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','intersection','fields','attributes','length','merge','body','find','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1b94,0x1f2));var _0x41b9=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x1b94[_0x344a3f];return _0x264712;};'use strict';var pdf=require(_0x41b9('0x0'));var emlformat=require(_0x41b9('0x1'));var rimraf=require(_0x41b9('0x2'));var zipdir=require(_0x41b9('0x3'));var jsonpatch=require(_0x41b9('0x4'));var rp=require('request-promise');var moment=require(_0x41b9('0x5'));var BPromise=require(_0x41b9('0x6'));var Mustache=require(_0x41b9('0x7'));var util=require('util');var path=require(_0x41b9('0x8'));var sox=require(_0x41b9('0x9'));var csv=require(_0x41b9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x41b9('0xb'));var squel=require(_0x41b9('0xc'));var crypto=require(_0x41b9('0xd'));var jsforce=require(_0x41b9('0xe'));var deskjs=require(_0x41b9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x41b9('0x10'));var Papa=require(_0x41b9('0x11'));var Redis=require('ioredis');var authService=require(_0x41b9('0x12'));var qs=require(_0x41b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x41b9('0x14'))(_0x41b9('0x15'));var utils=require('../../config/utils');var config=require(_0x41b9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4204cd,_0x478b82){_0x478b82=_0x478b82||0xcc;return function(_0x3f0b64){if(_0x3f0b64){return _0x4204cd[_0x41b9('0x17')](_0x478b82);}return _0x4204cd[_0x41b9('0x18')](_0x478b82)[_0x41b9('0x19')]();};}function respondWithResult(_0x1bc82c,_0x48be78){_0x48be78=_0x48be78||0xc8;return function(_0x428efe){if(_0x428efe){return _0x1bc82c[_0x41b9('0x18')](_0x48be78)['json'](_0x428efe);}};}function respondWithFilteredResult(_0x44ee18,_0x134902){return function(_0x303433){if(_0x303433){var _0x2200f7=_0x303433[_0x41b9('0x1a')],_0x4b38da=_0x134902[_0x41b9('0x1b')],_0x5849aa=_0x134902['offset']+_0x134902['limit'],_0x4a6357;if(_0x5849aa>=_0x2200f7){_0x5849aa=_0x2200f7;_0x4a6357=0xc8;}else{_0x4a6357=0xce;}_0x44ee18[_0x41b9('0x18')](_0x4a6357);return _0x44ee18[_0x41b9('0x1c')](_0x41b9('0x1d'),_0x4b38da+'-'+_0x5849aa+'/'+_0x2200f7)[_0x41b9('0x1e')](_0x303433);}return null;};}function patchUpdates(_0x45b813){return function(_0x475aa8){try{jsonpatch['apply'](_0x475aa8,_0x45b813,!![]);}catch(_0x10bfdf){return BPromise[_0x41b9('0x1f')](_0x10bfdf);}return _0x475aa8['save']();};}function saveUpdates(_0x155043,_0x2f6b69){return function(_0x2c205e){if(_0x2c205e){return _0x2c205e[_0x41b9('0x20')](_0x155043)[_0x41b9('0x21')](function(_0x1893ca){return _0x1893ca;});}return null;};}function removeEntity(_0x508039,_0x69eb43){return function(_0x5367b2){if(_0x5367b2){return _0x5367b2[_0x41b9('0x22')]()[_0x41b9('0x21')](function(){_0x508039[_0x41b9('0x18')](0xcc)[_0x41b9('0x19')]();});}};}function handleEntityNotFound(_0x2fe95,_0x5f2154){return function(_0x231f64){if(!_0x231f64){_0x2fe95['sendStatus'](0x194);}return _0x231f64;};}function handleError(_0x5553ca,_0x59f751){_0x59f751=_0x59f751||0x1f4;return function(_0x10bdbf){logger[_0x41b9('0x23')](_0x10bdbf[_0x41b9('0x24')]);if(_0x10bdbf[_0x41b9('0x25')]){delete _0x10bdbf[_0x41b9('0x25')];}_0x5553ca[_0x41b9('0x18')](_0x59f751)[_0x41b9('0x26')](_0x10bdbf);};}var utilLicense=require(_0x41b9('0x27'));exports[_0x41b9('0x28')]=function(_0x545ad5,_0x516845){var _0x1a3aee={'raw':!![],'where':{'id':0x1}},_0xe70b4d={};_0xe70b4d[_0x41b9('0x29')]=_[_0x41b9('0x2a')](db[_0x41b9('0x2b')][_0x41b9('0x2c')]);_0xe70b4d[_0x41b9('0x2d')]=_[_0x41b9('0x2a')](_0x545ad5['query']);_0xe70b4d['filters']=_[_0x41b9('0x2e')](_0xe70b4d['model'],_0xe70b4d[_0x41b9('0x2d')]);_0x1a3aee['attributes']=_[_0x41b9('0x2e')](_0xe70b4d[_0x41b9('0x29')],qs['fields'](_0x545ad5['query'][_0x41b9('0x2f')]));_0x1a3aee[_0x41b9('0x30')]=_0x1a3aee['attributes'][_0x41b9('0x31')]?_0x1a3aee[_0x41b9('0x30')]:_0xe70b4d['model'];_0x1a3aee=_[_0x41b9('0x32')]({},_0x1a3aee,_0x545ad5['options']);return utilLicense['getLicense'](_0x1a3aee)[_0x41b9('0x21')](respondWithResult(_0x516845,null))['catch'](handleError(_0x516845,null));};exports[_0x41b9('0x20')]=function(_0x1579e6,_0x11bc6f){if(_0x1579e6['body']['id']){delete _0x1579e6[_0x41b9('0x33')]['id'];}return db[_0x41b9('0x2b')][_0x41b9('0x34')]({'where':{'id':_0x1579e6[_0x41b9('0x35')]['id']}})[_0x41b9('0x21')](handleEntityNotFound(_0x11bc6f,null))[_0x41b9('0x21')](function(_0x411e26){var _0x395c1e=_0x411e26[_0x41b9('0x36')]({'plain':!![]});return utilLicense[_0x41b9('0x37')](_0x395c1e,_0x1579e6[_0x41b9('0x33')][_0x41b9('0x38')]);})['then'](function(_0x433b95){if(!_0x433b95[_0x41b9('0x39')]){return saveUpdates(_0x1579e6[_0x41b9('0x33')],null);}return _0x433b95;})[_0x41b9('0x21')](respondWithResult(_0x11bc6f,null))['catch'](handleError(_0x11bc6f,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 9b02fba..fc4feb0 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 _0x41bb=['bluebird','request-promise','path','rimraf','./license.attributes','exports','license','lodash','util','api'];(function(_0x248ad4,_0x26408c){var _0x24d3dd=function(_0x534e09){while(--_0x534e09){_0x248ad4['push'](_0x248ad4['shift']());}};_0x24d3dd(++_0x26408c);}(_0x41bb,0xc5));var _0xb41b=function(_0x86ea76,_0x23cfdd){_0x86ea76=_0x86ea76-0x0;var _0x12a78a=_0x41bb[_0x86ea76];return _0x12a78a;};'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']('License',attributes,{'tableName':_0xb41b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1e3=['exports','License','license','lodash','util','api','request-promise','rimraf','../../config/environment','./license.attributes'];(function(_0x50392,_0x5f2c41){var _0x11d87b=function(_0x1fe92b){while(--_0x1fe92b){_0x50392['push'](_0x50392['shift']());}};_0x11d87b(++_0x5f2c41);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0xe3a49d,_0x288b43){_0xe3a49d=_0xe3a49d-0x0;var _0x57703e=_0xe1e3[_0xe3a49d];return _0x57703e;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var logger=require('../../config/logger')(_0x3e1e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e1e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var attributes=require(_0x3e1e('0x6'));module[_0x3e1e('0x7')]=function(_0x40d6d8,_0x25701f){return _0x40d6d8['define'](_0x3e1e('0x8'),attributes,{'tableName':_0x3e1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 6e2ea55..1e74703 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 _0x0384=['../../mysqldb','../../config/logger','rpc','jayson/promise','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x808f95,_0x450d07){var _0x33dac8=function(_0x487f3d){while(--_0x487f3d){_0x808f95['push'](_0x808f95['shift']());}};_0x33dac8(++_0x450d07);}(_0x0384,0xa3));var _0x4038=function(_0x11a85b,_0x3e86bc){_0x11a85b=_0x11a85b-0x0;var _0x59a995=_0x0384[_0x11a85b];return _0x59a995;};'use strict';var _=require(_0x4038('0x0'));var util=require(_0x4038('0x1'));var moment=require(_0x4038('0x2'));var BPromise=require(_0x4038('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4038('0x4'));var db=require(_0x4038('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4038('0x6'))(_0x4038('0x7'));var config=require('../../config/environment');var jayson=require(_0x4038('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2aa22a,_0xa6a35c,_0x410bdb){return new BPromise(function(_0x52523d,_0x4ef819){return client['request'](_0x2aa22a,_0x410bdb)[_0x4038('0x9')](function(_0x42ca21){logger[_0x4038('0xa')]('License,\x20%s,\x20%s',_0xa6a35c,_0x4038('0xb'));logger[_0x4038('0xc')](_0x4038('0xd'),_0xa6a35c,'request\x20sent',JSON[_0x4038('0xe')](_0x42ca21));if(_0x42ca21[_0x4038('0xf')]){if(_0x42ca21[_0x4038('0xf')][_0x4038('0x10')]===0x1f4){logger['error'](_0x4038('0x11'),_0xa6a35c,_0x42ca21['error'][_0x4038('0x12')]);return _0x4ef819(_0x42ca21[_0x4038('0xf')][_0x4038('0x12')]);}logger['error']('License,\x20%s,\x20%s',_0xa6a35c,_0x42ca21['error']['message']);return _0x52523d(_0x42ca21['error'][_0x4038('0x12')]);}else{logger[_0x4038('0xa')](_0x4038('0x11'),_0xa6a35c,_0x4038('0xb'));_0x52523d(_0x42ca21[_0x4038('0x13')][_0x4038('0x12')]);}})[_0x4038('0x14')](function(_0xf7186f){logger['error'](_0x4038('0x11'),_0xa6a35c,_0xf7186f);_0x4ef819(_0xf7186f);});});} \ No newline at end of file +var _0x753d=['jayson/promise','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x753d,0x16e));var _0xd753=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x753d[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd753('0x0'));var util=require(_0xd753('0x1'));var moment=require(_0xd753('0x2'));var BPromise=require(_0xd753('0x3'));var rs=require(_0xd753('0x4'));var fs=require('fs');var Redis=require(_0xd753('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd753('0x6'));var config=require(_0xd753('0x7'));var jayson=require(_0xd753('0x8'));var client=jayson['client'][_0xd753('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12b808,_0x47fba0,_0x49e528){return new BPromise(function(_0x29fedd,_0x5a9365){return client['request'](_0x12b808,_0x49e528)[_0xd753('0xa')](function(_0x55f428){logger[_0xd753('0xb')](_0xd753('0xc'),_0x47fba0,'request\x20sent');logger[_0xd753('0xd')](_0xd753('0xe'),_0x47fba0,_0xd753('0xf'),JSON[_0xd753('0x10')](_0x55f428));if(_0x55f428[_0xd753('0x11')]){if(_0x55f428['error'][_0xd753('0x12')]===0x1f4){logger[_0xd753('0x11')](_0xd753('0xc'),_0x47fba0,_0x55f428[_0xd753('0x11')][_0xd753('0x13')]);return _0x5a9365(_0x55f428[_0xd753('0x11')][_0xd753('0x13')]);}logger[_0xd753('0x11')](_0xd753('0xc'),_0x47fba0,_0x55f428['error'][_0xd753('0x13')]);return _0x29fedd(_0x55f428[_0xd753('0x11')][_0xd753('0x13')]);}else{logger[_0xd753('0xb')](_0xd753('0xc'),_0x47fba0,_0xd753('0xf'));_0x29fedd(_0x55f428[_0xd753('0x14')][_0xd753('0x13')]);}})[_0xd753('0x15')](function(_0x1afb7c){logger['error']('License,\x20%s,\x20%s',_0x47fba0,_0x1afb7c);_0x5a9365(_0x1afb7c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 85df447..8399d59 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 _0xdc68=['/:id/interactions','addInteraction','/:id/send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addSmtp'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0xdc68,0x1a3));var _0x8dc6=function(_0x39e2ed,_0x49eb0e){_0x39e2ed=_0x39e2ed-0x0;var _0x428eaa=_0xdc68[_0x39e2ed];return _0x428eaa;};'use strict';var multer=require(_0x8dc6('0x0'));var util=require(_0x8dc6('0x1'));var path=require(_0x8dc6('0x2'));var timeout=require(_0x8dc6('0x3'));var express=require(_0x8dc6('0x4'));var router=express['Router']();var auth=require(_0x8dc6('0x5'));var interaction=require(_0x8dc6('0x6'));var config=require('../../config/environment');var controller=require(_0x8dc6('0x7'));router[_0x8dc6('0x8')]('/',auth[_0x8dc6('0x9')](),controller[_0x8dc6('0xa')]);router['get'](_0x8dc6('0xb'),auth[_0x8dc6('0x9')](),controller['describe']);router['get'](_0x8dc6('0xc'),auth[_0x8dc6('0x9')](),controller['show']);router[_0x8dc6('0x8')](_0x8dc6('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x8dc6('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8dc6('0xe')]);router[_0x8dc6('0x8')](_0x8dc6('0xf'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x10')]);router[_0x8dc6('0x8')](_0x8dc6('0x11'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x12')]);router[_0x8dc6('0x8')]('/:id/interactions',auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x13')]);router[_0x8dc6('0x8')](_0x8dc6('0x14'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x15')]);router[_0x8dc6('0x8')]('/:id/messages',auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x16')]);router[_0x8dc6('0x8')](_0x8dc6('0x17'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x18')]);router[_0x8dc6('0x8')]('/:id/users',auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x19')]);router[_0x8dc6('0x1a')]('/:id/dispositions',auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x1b')]);router[_0x8dc6('0x1a')](_0x8dc6('0x1c'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x1d')]);router[_0x8dc6('0x1a')]('/',auth[_0x8dc6('0x9')](),controller['create']);router[_0x8dc6('0x1a')]('/:id/in_servers',auth[_0x8dc6('0x9')](),controller['addImap']);router[_0x8dc6('0x1a')](_0x8dc6('0x11'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x1e')]);router[_0x8dc6('0x1a')](_0x8dc6('0x1f'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x20')]);router[_0x8dc6('0x1a')](_0x8dc6('0x14'),auth[_0x8dc6('0x9')](),controller['addApplications']);router[_0x8dc6('0x1a')](_0x8dc6('0x21'),auth[_0x8dc6('0x9')](),controller['send']);router[_0x8dc6('0x1a')](_0x8dc6('0x22'),auth[_0x8dc6('0x9')](),controller['addAgents']);router[_0x8dc6('0x23')](_0x8dc6('0xc'),auth['isAuthenticated'](),controller[_0x8dc6('0x24')]);router[_0x8dc6('0x25')](_0x8dc6('0xd'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x26')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8dc6('0x27')]);router['delete'](_0x8dc6('0xf'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x28')]);router[_0x8dc6('0x25')](_0x8dc6('0x11'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x29')]);router[_0x8dc6('0x25')](_0x8dc6('0xc'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x2a')]);router[_0x8dc6('0x25')](_0x8dc6('0x22'),auth[_0x8dc6('0x9')](),controller[_0x8dc6('0x2b')]);module[_0x8dc6('0x2c')]=router; \ No newline at end of file +var _0x65ef=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','addAnswer','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','express','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x6e2ab9,_0x38066b){var _0x4feaf1=function(_0x2654a0){while(--_0x2654a0){_0x6e2ab9['push'](_0x6e2ab9['shift']());}};_0x4feaf1(++_0x38066b);}(_0x65ef,0x1e3));var _0xf65e=function(_0x5217b8,_0x3ef73d){_0x5217b8=_0x5217b8-0x0;var _0x54dd3f=_0x65ef[_0x5217b8];return _0x54dd3f;};'use strict';var multer=require(_0xf65e('0x0'));var util=require(_0xf65e('0x1'));var path=require(_0xf65e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf65e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf65e('0x4'));var config=require(_0xf65e('0x5'));var controller=require('./mailAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf65e('0x6')]);router[_0xf65e('0x7')](_0xf65e('0x8'),auth[_0xf65e('0x9')](),controller[_0xf65e('0xa')]);router['get'](_0xf65e('0xb'),auth['isAuthenticated'](),controller[_0xf65e('0xc')]);router['get'](_0xf65e('0xd'),auth[_0xf65e('0x9')](),controller[_0xf65e('0xe')]);router[_0xf65e('0x7')](_0xf65e('0xf'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x10')]);router[_0xf65e('0x7')](_0xf65e('0x11'),auth[_0xf65e('0x9')](),controller['getImap']);router[_0xf65e('0x7')](_0xf65e('0x12'),auth[_0xf65e('0x9')](),controller['getSmtp']);router[_0xf65e('0x7')](_0xf65e('0x13'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x14')]);router[_0xf65e('0x7')](_0xf65e('0x15'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x16')]);router[_0xf65e('0x7')](_0xf65e('0x17'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x18')]);router[_0xf65e('0x7')](_0xf65e('0x19'),auth[_0xf65e('0x9')](),controller['verifySmtp']);router[_0xf65e('0x7')](_0xf65e('0x1a'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x1b')]);router['post'](_0xf65e('0xd'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x1c')]);router[_0xf65e('0x1d')](_0xf65e('0xf'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x1e')]);router[_0xf65e('0x1d')]('/',auth[_0xf65e('0x9')](),controller['create']);router['post']('/:id/in_servers',auth[_0xf65e('0x9')](),controller[_0xf65e('0x1f')]);router[_0xf65e('0x1d')](_0xf65e('0x12'),auth['isAuthenticated'](),controller[_0xf65e('0x20')]);router[_0xf65e('0x1d')](_0xf65e('0x13'),auth[_0xf65e('0x9')](),controller['addInteraction']);router[_0xf65e('0x1d')]('/:id/applications',auth['isAuthenticated'](),controller[_0xf65e('0x21')]);router[_0xf65e('0x1d')](_0xf65e('0x22'),auth['isAuthenticated'](),controller[_0xf65e('0x23')]);router[_0xf65e('0x1d')](_0xf65e('0x1a'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x24')]);router[_0xf65e('0x25')](_0xf65e('0xb'),auth['isAuthenticated'](),controller[_0xf65e('0x26')]);router[_0xf65e('0x27')](_0xf65e('0xd'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x28')]);router['delete']('/:id/canned_answers',auth[_0xf65e('0x9')](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth[_0xf65e('0x9')](),controller[_0xf65e('0x29')]);router[_0xf65e('0x27')](_0xf65e('0x12'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x2a')]);router[_0xf65e('0x27')](_0xf65e('0xb'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x2b')]);router[_0xf65e('0x27')](_0xf65e('0x1a'),auth[_0xf65e('0x9')](),controller[_0xf65e('0x2c')]);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 97da716..3fcadd6 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 _0x99ff=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x41e78c,_0x1ca349){var _0xaad526=function(_0x5179ce){while(--_0x5179ce){_0x41e78c['push'](_0x41e78c['shift']());}};_0xaad526(++_0x1ca349);}(_0x99ff,0xf6));var _0xf99f=function(_0x332ef9,_0x387cb2){_0x332ef9=_0x332ef9-0x0;var _0x64da7d=_0x99ff[_0x332ef9];return _0x64da7d;};'use strict';var Sequelize=require(_0xf99f('0x0'));module[_0xf99f('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf99f('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf99f('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf99f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xf99f('0x4')]},'markAsUnread':{'type':Sequelize[_0xf99f('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf99f('0x2')],'allowNull':![],'defaultValue':_0xf99f('0x5')},'fontSize':{'type':Sequelize[_0xf99f('0x6')](0x2)[_0xf99f('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf99f('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xf99f('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf99f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf99f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf99f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf99f('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf99f('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf99f('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x29b401){if(!_0x29b401)this[_0xf99f('0x9')](_0xf99f('0xa'),null);this[_0xf99f('0x9')](_0xf99f('0xb'),_0x29b401);}}}; \ No newline at end of file +var _0x63de=['sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x63de,0xd1));var _0xe63d=function(_0x5ee1bc,_0x2fc919){_0x5ee1bc=_0x5ee1bc-0x0;var _0x5800f1=_0x63de[_0x5ee1bc];return _0x5800f1;};'use strict';var Sequelize=require(_0xe63d('0x0'));module[_0xe63d('0x1')]={'description':{'type':Sequelize[_0xe63d('0x2')]},'name':{'type':Sequelize[_0xe63d('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xe63d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xe63d('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe63d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xe63d('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xe63d('0x4')]},'markAsUnread':{'type':Sequelize[_0xe63d('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe63d('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xe63d('0x5')](0x2)[_0xe63d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe63d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe63d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe63d('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'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['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xe63d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xe63d('0x3')],'defaultValue':![],'comment':_0xe63d('0x8'),'set':function(_0x5e1fc9){if(!_0x5e1fc9)this['setDataValue'](_0xe63d('0x9'),null);this['setDataValue'](_0xe63d('0xa'),_0x5e1fc9);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 04c3438..2de9e1f 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 _0x97da=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','update','get','MailAccounts','UserProfileResource','destroy','stack','name','MailServerIn','Imap','Smtp','Pause','rawAttributes','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','MailAccount','rows','catch','show','params','MailServerOut','mandatoryDispositionPause','includeAll','find','body','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','include','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','send','split','CmList','List','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','getAgents','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x2537cf,_0x24d9fc){var _0x95a8d5=function(_0x178dd4){while(--_0x178dd4){_0x2537cf['push'](_0x2537cf['shift']());}};_0x95a8d5(++_0x24d9fc);}(_0x97da,0x164));var _0xa97d=function(_0x535804,_0x5289e2){_0x535804=_0x535804-0x0;var _0x269d3f=_0x97da[_0x535804];return _0x269d3f;};'use strict';var pdf=require(_0xa97d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa97d('0x1'));var zipdir=require(_0xa97d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa97d('0x3'));var moment=require('moment');var BPromise=require(_0xa97d('0x4'));var Mustache=require(_0xa97d('0x5'));var util=require(_0xa97d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa97d('0x7'));var fs=require('fs');var _=require(_0xa97d('0x8'));var squel=require(_0xa97d('0x9'));var crypto=require(_0xa97d('0xa'));var jsforce=require(_0xa97d('0xb'));var deskjs=require(_0xa97d('0xc'));var toCsv=require(_0xa97d('0xd'));var querystring=require('querystring');var Papa=require(_0xa97d('0xe'));var Redis=require(_0xa97d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa97d('0x10'));var hardwareService=require(_0xa97d('0x11'));var logger=require(_0xa97d('0x12'))(_0xa97d('0x13'));var utils=require(_0xa97d('0x14'));var config=require('../../config/environment');var db=require(_0xa97d('0x15'))['db'];config[_0xa97d('0x16')]=_[_0xa97d('0x17')](config[_0xa97d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xa97d('0x18'))(new Redis(config[_0xa97d('0x16')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xa97d('0x19'));var client=jayson['client'][_0xa97d('0x1a')]({'port':0x232b});function checkPasswordPattern(_0x288811,_0x2527a1,_0xd23310){if(_0xd23310){var _0x2c94f6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c94f6[_0xa97d('0x1b')](_0x2527a1)){return _0x288811;}else{throw new Error(_0xa97d('0x1c'));}}else{return _0x288811;}}function respondWithRpcPromise(_0x168288,_0x1a261e,_0x4f73f3,_0x3dcdc8){return new BPromise(function(_0x633c44,_0xd3ade6){var _0x393229=_0x3dcdc8||client;return _0x393229[_0xa97d('0x1d')](_0x168288,_0x4f73f3)[_0xa97d('0x1e')](function(_0x84ea98){logger['info'](_0xa97d('0x1f'),_0x1a261e,_0xa97d('0x20'));logger[_0xa97d('0x21')](_0xa97d('0x22'),_0x1a261e,'request\x20sent',JSON[_0xa97d('0x23')](_0x84ea98));if(_0x84ea98[_0xa97d('0x24')]){if(_0x84ea98[_0xa97d('0x24')][_0xa97d('0x25')]===0x1f4){logger[_0xa97d('0x24')](_0xa97d('0x1f'),_0x1a261e,_0x84ea98[_0xa97d('0x24')][_0xa97d('0x26')]);return _0xd3ade6(_0x84ea98[_0xa97d('0x24')][_0xa97d('0x26')]);}logger[_0xa97d('0x24')](_0xa97d('0x1f'),_0x1a261e,_0x84ea98[_0xa97d('0x24')][_0xa97d('0x26')]);return _0x633c44(_0x84ea98[_0xa97d('0x24')][_0xa97d('0x26')]);}else{logger[_0xa97d('0x27')](_0xa97d('0x1f'),_0x1a261e,_0xa97d('0x20'));_0x633c44(_0x84ea98['result'][_0xa97d('0x26')]);}})['catch'](function(_0x37a495){logger[_0xa97d('0x24')](_0xa97d('0x1f'),_0x1a261e,_0x37a495);_0xd3ade6(_0x37a495);});});}function respondWithStatusCode(_0x4d9cce,_0x481160){_0x481160=_0x481160||0xcc;return function(_0x220127){if(_0x220127){return _0x4d9cce[_0xa97d('0x28')](_0x481160);}return _0x4d9cce['status'](_0x481160)[_0xa97d('0x29')]();};}function respondWithResult(_0x583f71,_0x11816b){_0x11816b=_0x11816b||0xc8;return function(_0x1e60c2){if(_0x1e60c2){return _0x583f71[_0xa97d('0x2a')](_0x11816b)['json'](_0x1e60c2);}};}function respondWithFilteredResult(_0x40a120,_0x49d67b){return function(_0xac5f0e){if(_0xac5f0e){var _0x351a98=_0xac5f0e[_0xa97d('0x2b')],_0x22e56d=_0x49d67b['offset'],_0x3f7581=_0x49d67b[_0xa97d('0x2c')]+_0x49d67b['limit'],_0x5e493d;if(_0x3f7581>=_0x351a98){_0x3f7581=_0x351a98;_0x5e493d=0xc8;}else{_0x5e493d=0xce;}_0x40a120[_0xa97d('0x2a')](_0x5e493d);return _0x40a120[_0xa97d('0x2d')](_0xa97d('0x2e'),_0x22e56d+'-'+_0x3f7581+'/'+_0x351a98)[_0xa97d('0x2f')](_0xac5f0e);}return null;};}function patchUpdates(_0xd63e8e){return function(_0x534d82){try{jsonpatch[_0xa97d('0x30')](_0x534d82,_0xd63e8e,!![]);}catch(_0x4fde70){return BPromise[_0xa97d('0x31')](_0x4fde70);}return _0x534d82['save']();};}function saveUpdates(_0x3127e7,_0x387450){return function(_0x491431){if(_0x491431){return _0x491431[_0xa97d('0x32')](_0x3127e7)[_0xa97d('0x1e')](function(_0x3917df){return _0x3917df;});}return null;};}function removeEntity(_0x157f93,_0x5e8046){return function(_0x24ef66){if(_0x24ef66){return _0x24ef66['destroy']()[_0xa97d('0x1e')](function(){var _0x278e2d=_0x24ef66[_0xa97d('0x33')]({'plain':!![]});var _0x5ca730=_0xa97d('0x34');return db[_0xa97d('0x35')][_0xa97d('0x36')]({'where':{'type':_0x5ca730,'resourceId':_0x278e2d['id']}})[_0xa97d('0x1e')](function(){return _0x24ef66;});})[_0xa97d('0x1e')](function(){_0x157f93[_0xa97d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48c106,_0x212af4){return function(_0x4a747c){if(!_0x4a747c){_0x48c106['sendStatus'](0x194);}return _0x4a747c;};}function handleError(_0x10f9ef,_0x30157c){_0x30157c=_0x30157c||0x1f4;return function(_0x1ad578){logger[_0xa97d('0x24')](_0x1ad578[_0xa97d('0x37')]);if(_0x1ad578[_0xa97d('0x38')]){delete _0x1ad578['name'];}_0x10f9ef[_0xa97d('0x2a')](_0x30157c)['send'](_0x1ad578);};}exports['index']=function(_0x3efaf4,_0x4d07d5){var _0x2b3241={'include':[{'model':db[_0xa97d('0x39')],'as':_0xa97d('0x3a')},{'model':db['MailServerOut'],'as':_0xa97d('0x3b')},{'model':db[_0xa97d('0x3c')],'as':'mandatoryDispositionPause'}]},_0x5ba8b0={},_0x53b2d6={'count':0x0,'rows':[]};var _0x447495=db['MailAccount'][_0xa97d('0x3d')];_0x5ba8b0[_0xa97d('0x3e')]=_[_0xa97d('0x3f')](_0x447495);_0x5ba8b0['query']=_[_0xa97d('0x3f')](_0x3efaf4['query']);_0x5ba8b0[_0xa97d('0x40')]=_[_0xa97d('0x41')](_0x5ba8b0[_0xa97d('0x3e')],_0x5ba8b0['query']);_0x2b3241[_0xa97d('0x42')]=_[_0xa97d('0x41')](_0x5ba8b0[_0xa97d('0x3e')],qs['fields'](_0x3efaf4[_0xa97d('0x43')][_0xa97d('0x44')]));_0x2b3241[_0xa97d('0x42')]=_0x2b3241[_0xa97d('0x42')][_0xa97d('0x45')]?_0x2b3241[_0xa97d('0x42')]:_0x5ba8b0[_0xa97d('0x3e')];if(!_0x3efaf4[_0xa97d('0x43')][_0xa97d('0x46')](_0xa97d('0x47'))){_0x2b3241[_0xa97d('0x48')]=qs['limit'](_0x3efaf4[_0xa97d('0x43')]['limit']);_0x2b3241['offset']=qs['offset'](_0x3efaf4[_0xa97d('0x43')][_0xa97d('0x2c')]);}_0x2b3241['order']=qs[_0xa97d('0x49')](_0x3efaf4[_0xa97d('0x43')]['sort']);_0x2b3241[_0xa97d('0x4a')]=qs['filters'](_[_0xa97d('0x4b')](_0x3efaf4[_0xa97d('0x43')],_0x5ba8b0[_0xa97d('0x40')]));if(_0x3efaf4[_0xa97d('0x43')][_0xa97d('0x4c')]){_0x2b3241[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x2b3241['where'],{'$or':_[_0xa97d('0x4e')](_0x447495,function(_0x1eac8f){if(_0x1eac8f[_0xa97d('0x4f')][_0xa97d('0x50')]!==_0xa97d('0x51')){var _0x3bf920={};_0x3bf920[_0x1eac8f[_0xa97d('0x52')]]={'$like':'%'+_0x3efaf4[_0xa97d('0x43')][_0xa97d('0x4c')]+'%'};return _0x3bf920;}})});}_0x2b3241=_[_0xa97d('0x4d')]({},_0x2b3241,_0x3efaf4[_0xa97d('0x53')]);var _0x16d6f7={'where':_0x2b3241['where']};return db[_0xa97d('0x54')]['count'](_0x16d6f7)[_0xa97d('0x1e')](function(_0xbed933){_0x53b2d6[_0xa97d('0x2b')]=_0xbed933;if(_0x3efaf4[_0xa97d('0x43')]['includeAll']){_0x2b3241['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x2b3241);})['then'](function(_0x35b2ee){_0x53b2d6[_0xa97d('0x55')]=_0x35b2ee;return _0x53b2d6;})[_0xa97d('0x1e')](respondWithFilteredResult(_0x4d07d5,_0x2b3241))[_0xa97d('0x56')](handleError(_0x4d07d5,null));};exports[_0xa97d('0x57')]=function(_0x4770f0,_0x4abe97){var _0x5df445={'raw':![],'where':{'id':_0x4770f0[_0xa97d('0x58')]['id']},'include':[{'model':db[_0xa97d('0x39')],'as':_0xa97d('0x3a')},{'model':db[_0xa97d('0x59')],'as':_0xa97d('0x3b')},{'model':db['Pause'],'as':_0xa97d('0x5a')}]},_0x4f6ddd={};_0x4f6ddd[_0xa97d('0x3e')]=_[_0xa97d('0x3f')](db['MailAccount']['rawAttributes']);_0x4f6ddd[_0xa97d('0x43')]=_[_0xa97d('0x3f')](_0x4770f0['query']);_0x4f6ddd[_0xa97d('0x40')]=_[_0xa97d('0x41')](_0x4f6ddd['model'],_0x4f6ddd[_0xa97d('0x43')]);_0x5df445[_0xa97d('0x42')]=_[_0xa97d('0x41')](_0x4f6ddd[_0xa97d('0x3e')],qs['fields'](_0x4770f0[_0xa97d('0x43')][_0xa97d('0x44')]));_0x5df445[_0xa97d('0x42')]=_0x5df445[_0xa97d('0x42')][_0xa97d('0x45')]?_0x5df445[_0xa97d('0x42')]:_0x4f6ddd[_0xa97d('0x3e')];if(_0x4770f0[_0xa97d('0x43')][_0xa97d('0x5b')]){_0x5df445['include']=[{'all':!![]}];}_0x5df445=_[_0xa97d('0x4d')]({},_0x5df445,_0x4770f0['options']);return db[_0xa97d('0x54')][_0xa97d('0x5c')](_0x5df445)[_0xa97d('0x1e')](handleEntityNotFound(_0x4abe97,null))[_0xa97d('0x1e')](respondWithResult(_0x4abe97,null))['catch'](handleError(_0x4abe97,null));};exports[_0xa97d('0x32')]=function(_0x1a2c84,_0x18f278){if(_0x1a2c84[_0xa97d('0x5d')]['id']){delete _0x1a2c84[_0xa97d('0x5d')]['id'];}return db[_0xa97d('0x54')][_0xa97d('0x5c')]({'where':{'id':_0x1a2c84[_0xa97d('0x58')]['id']},'include':[{'model':db[_0xa97d('0x39')],'as':_0xa97d('0x3a')},{'model':db[_0xa97d('0x59')],'as':_0xa97d('0x3b')},{'model':db[_0xa97d('0x3c')],'as':_0xa97d('0x5a')}]})[_0xa97d('0x1e')](handleEntityNotFound(_0x18f278,null))[_0xa97d('0x1e')](saveUpdates(_0x1a2c84[_0xa97d('0x5d')],null))[_0xa97d('0x1e')](function(_0x26ed2a){if(_0x26ed2a&&_0x1a2c84[_0xa97d('0x5d')]['Imap']){return db[_0xa97d('0x39')][_0xa97d('0x32')](_0x1a2c84[_0xa97d('0x5d')][_0xa97d('0x3a')],{'where':{'MailAccountId':_0x26ed2a['id']}})[_0xa97d('0x1e')](function(){return _0x26ed2a;});}return _0x26ed2a;})[_0xa97d('0x1e')](function(_0x1780bd){if(_0x1780bd&&_0x1a2c84['body'][_0xa97d('0x3b')]){return db[_0xa97d('0x59')][_0xa97d('0x32')](_0x1a2c84['body'][_0xa97d('0x3b')],{'where':{'MailAccountId':_0x1780bd['id']}})[_0xa97d('0x1e')](function(){return _0x1780bd;});}return _0x1780bd;})['then'](respondWithResult(_0x18f278,null))[_0xa97d('0x56')](handleError(_0x18f278,null));};exports['describe']=function(_0x132e01,_0x166bcb){return db['MailAccount']['describe']()[_0xa97d('0x1e')](respondWithResult(_0x166bcb,null))[_0xa97d('0x56')](handleError(_0x166bcb,null));};exports[_0xa97d('0x5e')]=function(_0x20481d,_0x5ad03a,_0x36f968){if(_0x20481d[_0xa97d('0x5d')]['id']){delete _0x20481d[_0xa97d('0x5d')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x20481d[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x5ad03a,null))['then'](function(_0x4b4b57){if(_0x4b4b57){_0x20481d['body'][_0xa97d('0x5f')]=_0x4b4b57['id'];return db[_0xa97d('0x60')][_0xa97d('0x61')](_0x20481d[_0xa97d('0x5d')]);}})[_0xa97d('0x1e')](respondWithResult(_0x5ad03a,null))[_0xa97d('0x56')](handleError(_0x5ad03a,null));};exports[_0xa97d('0x62')]=function(_0x6ead2b,_0x29152c,_0xfb27bb){var _0x175624={'raw':![],'where':{}};var _0x27df82={};var _0x453274={'count':0x0,'rows':[]};return db[_0xa97d('0x54')][_0xa97d('0x63')]({'where':{'id':_0x6ead2b[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x29152c,null))[_0xa97d('0x1e')](function(_0x3cb4e1){if(_0x3cb4e1){_0x27df82[_0xa97d('0x3e')]=_[_0xa97d('0x3f')](db[_0xa97d('0x60')]['rawAttributes']);_0x27df82[_0xa97d('0x43')]=_['keys'](_0x6ead2b[_0xa97d('0x43')]);_0x27df82[_0xa97d('0x40')]=_[_0xa97d('0x41')](_0x27df82[_0xa97d('0x3e')],_0x27df82['query']);_0x175624['attributes']=_['intersection'](_0x27df82['model'],qs[_0xa97d('0x44')](_0x6ead2b[_0xa97d('0x43')][_0xa97d('0x44')]));_0x175624[_0xa97d('0x42')]=_0x175624[_0xa97d('0x42')]['length']?_0x175624['attributes']:_0x27df82[_0xa97d('0x3e')];if(!_0x6ead2b[_0xa97d('0x43')][_0xa97d('0x46')](_0xa97d('0x47'))){_0x175624['limit']=qs[_0xa97d('0x48')](_0x6ead2b['query']['limit']);_0x175624['offset']=qs['offset'](_0x6ead2b[_0xa97d('0x43')]['offset']);}_0x175624[_0xa97d('0x64')]=qs[_0xa97d('0x49')](_0x6ead2b[_0xa97d('0x43')][_0xa97d('0x49')]);_0x175624[_0xa97d('0x4a')]=qs[_0xa97d('0x40')](_[_0xa97d('0x4b')](_0x6ead2b['query'],_0x27df82[_0xa97d('0x40')]));_0x175624['where'][_0xa97d('0x5f')]=_0x3cb4e1['id'];if(_0x6ead2b[_0xa97d('0x43')][_0xa97d('0x4c')]){_0x175624[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x175624[_0xa97d('0x4a')],{'$or':_[_0xa97d('0x4e')](_0x175624['attributes'],function(_0x176981){var _0xcca783={};_0xcca783[_0x176981]={'$like':'%'+_0x6ead2b['query'][_0xa97d('0x4c')]+'%'};return _0xcca783;})});}_0x175624=_['merge']({},_0x175624,_0x6ead2b['options']);return db[_0xa97d('0x60')][_0xa97d('0x2b')]({'where':_0x175624[_0xa97d('0x4a')]})[_0xa97d('0x1e')](function(_0x112740){_0x453274[_0xa97d('0x2b')]=_0x112740;if(_0x6ead2b[_0xa97d('0x43')][_0xa97d('0x5b')]){_0x175624[_0xa97d('0x65')]=[{'all':!![]}];}return db[_0xa97d('0x60')][_0xa97d('0x66')](_0x175624);})[_0xa97d('0x1e')](function(_0x4ae7b6){_0x453274[_0xa97d('0x55')]=_0x4ae7b6;return _0x453274;});}})[_0xa97d('0x1e')](respondWithFilteredResult(_0x29152c,_0x175624))[_0xa97d('0x56')](handleError(_0x29152c,null));};exports[_0xa97d('0x67')]=function(_0x59accd,_0x3c1ff7,_0x52c078){return db[_0xa97d('0x54')]['find']({'where':{'id':_0x59accd['params']['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x3c1ff7,null))[_0xa97d('0x1e')](function(_0x3fc816){if(_0x3fc816){return _0x3fc816['removeDispositions'](_0x59accd[_0xa97d('0x43')][_0xa97d('0x68')]);}})['then'](respondWithStatusCode(_0x3c1ff7,null))[_0xa97d('0x56')](handleError(_0x3c1ff7,null));};exports[_0xa97d('0x69')]=function(_0x5ecd76,_0x263150,_0x304f1c){if(_0x5ecd76['body']['id']){delete _0x5ecd76[_0xa97d('0x5d')]['id'];}return db[_0xa97d('0x54')][_0xa97d('0x5c')]({'where':{'id':_0x5ecd76[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x263150,null))[_0xa97d('0x1e')](function(_0x48b0bc){if(_0x48b0bc){_0x5ecd76[_0xa97d('0x5d')]['MailAccountId']=_0x48b0bc['id'];return db['CannedAnswer'][_0xa97d('0x61')](_0x5ecd76[_0xa97d('0x5d')]);}})[_0xa97d('0x1e')](respondWithResult(_0x263150,null))[_0xa97d('0x56')](handleError(_0x263150,null));};exports[_0xa97d('0x6a')]=function(_0xad7187,_0x2c081b,_0x239a15){var _0x198197={'raw':![],'where':{}};var _0x15ef0e={};var _0x49bc12={'count':0x0,'rows':[]};return db[_0xa97d('0x54')][_0xa97d('0x63')]({'where':{'id':_0xad7187[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x2c081b,null))[_0xa97d('0x1e')](function(_0x2808f8){if(_0x2808f8){_0x15ef0e['model']=_[_0xa97d('0x3f')](db[_0xa97d('0x6b')][_0xa97d('0x3d')]);_0x15ef0e[_0xa97d('0x43')]=_['keys'](_0xad7187['query']);_0x15ef0e['filters']=_[_0xa97d('0x41')](_0x15ef0e['model'],_0x15ef0e['query']);_0x198197[_0xa97d('0x42')]=_[_0xa97d('0x41')](_0x15ef0e[_0xa97d('0x3e')],qs['fields'](_0xad7187[_0xa97d('0x43')][_0xa97d('0x44')]));_0x198197[_0xa97d('0x42')]=_0x198197[_0xa97d('0x42')]['length']?_0x198197[_0xa97d('0x42')]:_0x15ef0e[_0xa97d('0x3e')];if(!_0xad7187[_0xa97d('0x43')]['hasOwnProperty']('nolimit')){_0x198197[_0xa97d('0x48')]=qs[_0xa97d('0x48')](_0xad7187[_0xa97d('0x43')][_0xa97d('0x48')]);_0x198197[_0xa97d('0x2c')]=qs[_0xa97d('0x2c')](_0xad7187['query'][_0xa97d('0x2c')]);}_0x198197[_0xa97d('0x64')]=qs[_0xa97d('0x49')](_0xad7187[_0xa97d('0x43')][_0xa97d('0x49')]);_0x198197[_0xa97d('0x4a')]=qs['filters'](_[_0xa97d('0x4b')](_0xad7187[_0xa97d('0x43')],_0x15ef0e[_0xa97d('0x40')]));_0x198197[_0xa97d('0x4a')]['MailAccountId']=_0x2808f8['id'];if(_0xad7187[_0xa97d('0x43')][_0xa97d('0x4c')]){_0x198197[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x198197[_0xa97d('0x4a')],{'$or':_[_0xa97d('0x4e')](_0x198197['attributes'],function(_0x2f513a){var _0xcd8529={};_0xcd8529[_0x2f513a]={'$like':'%'+_0xad7187['query'][_0xa97d('0x4c')]+'%'};return _0xcd8529;})});}_0x198197=_[_0xa97d('0x4d')]({},_0x198197,_0xad7187[_0xa97d('0x53')]);return db[_0xa97d('0x6b')][_0xa97d('0x2b')]({'where':_0x198197[_0xa97d('0x4a')]})[_0xa97d('0x1e')](function(_0x3ed88c){_0x49bc12['count']=_0x3ed88c;if(_0xad7187['query'][_0xa97d('0x5b')]){_0x198197[_0xa97d('0x65')]=[{'all':!![]}];}return db[_0xa97d('0x6b')][_0xa97d('0x66')](_0x198197);})[_0xa97d('0x1e')](function(_0x3460f8){_0x49bc12[_0xa97d('0x55')]=_0x3460f8;return _0x49bc12;});}})[_0xa97d('0x1e')](respondWithFilteredResult(_0x2c081b,_0x198197))['catch'](handleError(_0x2c081b,null));};exports[_0xa97d('0x6c')]=function(_0x137460,_0x2c21d4,_0x58e2bf){return db[_0xa97d('0x54')][_0xa97d('0x5c')]({'where':{'id':_0x137460[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x2c21d4,null))['then'](function(_0x5a2533){if(_0x5a2533){return _0x5a2533[_0xa97d('0x6c')](_0x137460['query'][_0xa97d('0x68')]);}})[_0xa97d('0x1e')](respondWithStatusCode(_0x2c21d4,null))[_0xa97d('0x56')](handleError(_0x2c21d4,null));};exports['create']=function(_0x48423e,_0x180b7d){var _0x559f19={'name':_0x48423e[_0xa97d('0x5d')][_0xa97d('0x38')],'key':_0x48423e['body']['key'],'email':_0x48423e[_0xa97d('0x5d')]['email'],'ListId':_0x48423e[_0xa97d('0x5d')][_0xa97d('0x6d')],'active':!_[_0xa97d('0x6e')](_0x48423e[_0xa97d('0x5d')][_0xa97d('0x6f')])?_0x48423e[_0xa97d('0x5d')][_0xa97d('0x6f')]:!![],'description':_0x48423e['body'][_0xa97d('0x70')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x48423e['body'][_0xa97d('0x71')])){if(_0x48423e[_0xa97d('0x5d')][_0xa97d('0x72')]){_0x559f19[_0xa97d('0x3a')]['user']=_0x559f19[_0xa97d('0x3b')][_0xa97d('0x73')]=_0x48423e['body'][_0xa97d('0x74')];_0x559f19[_0xa97d('0x3a')][_0xa97d('0x75')]=_0x559f19[_0xa97d('0x3b')][_0xa97d('0x76')]=_0x48423e[_0xa97d('0x5d')][_0xa97d('0x77')];}else{_0x559f19[_0xa97d('0x3a')]['authentication']=_0x559f19[_0xa97d('0x3b')][_0xa97d('0x78')]=![];}_0x559f19['Imap']['host']=_0x48423e[_0xa97d('0x5d')][_0xa97d('0x3a')][_0xa97d('0x79')];_0x559f19[_0xa97d('0x3a')][_0xa97d('0x7a')]=_0x48423e[_0xa97d('0x5d')][_0xa97d('0x3a')][_0xa97d('0x7a')];_0x559f19['Smtp'][_0xa97d('0x79')]=_0x48423e[_0xa97d('0x5d')][_0xa97d('0x3b')][_0xa97d('0x79')];_0x559f19['Smtp'][_0xa97d('0x7a')]=_0x48423e['body'][_0xa97d('0x3b')][_0xa97d('0x7a')];}else{_0x559f19[_0xa97d('0x3a')][_0xa97d('0x7b')]=_0x559f19[_0xa97d('0x3b')][_0xa97d('0x7b')]=_0x48423e[_0xa97d('0x5d')][_0xa97d('0x71')];_0x559f19[_0xa97d('0x3a')][_0xa97d('0x73')]=_0x559f19[_0xa97d('0x3b')][_0xa97d('0x73')]=_0x48423e['body']['cuser'];_0x559f19[_0xa97d('0x3a')][_0xa97d('0x75')]=_0x559f19[_0xa97d('0x3b')][_0xa97d('0x76')]=_0x48423e[_0xa97d('0x5d')][_0xa97d('0x77')];}return db[_0xa97d('0x54')]['create'](_0x559f19,{'include':[{'model':db[_0xa97d('0x59')],'as':_0xa97d('0x3b')},{'model':db[_0xa97d('0x39')],'as':_0xa97d('0x3a')}]})['then'](function(_0x3f9b44){var _0x13463c=_0x48423e[_0xa97d('0x73')][_0xa97d('0x33')]({'plain':!![]});if(!_0x13463c)throw new Error(_0xa97d('0x7c'));if(_0x13463c['role']===_0xa97d('0x73')){var _0x2dd051=_0x3f9b44[_0xa97d('0x33')]({'plain':!![]});return db[_0xa97d('0x7d')][_0xa97d('0x5c')]({'where':{'name':_0xa97d('0x34'),'userProfileId':_0x13463c['userProfileId']},'raw':!![]})[_0xa97d('0x1e')](function(_0x3dd853){if(_0x3dd853&&_0x3dd853[_0xa97d('0x7e')]===0x0){return db[_0xa97d('0x35')][_0xa97d('0x61')]({'name':_0x2dd051[_0xa97d('0x38')],'resourceId':_0x2dd051['id'],'type':_0x3dd853['name'],'sectionId':_0x3dd853['id']},{})[_0xa97d('0x1e')](function(){return _0x3f9b44;});}else{return _0x3f9b44;}})[_0xa97d('0x56')](function(_0x439432){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439432);throw _0x439432;});}return _0x3f9b44;})[_0xa97d('0x1e')](respondWithResult(_0x180b7d,0xc9))['catch'](handleError(_0x180b7d,null));};exports['getImap']=function(_0x1ea4de,_0xed7edc,_0xc25a34){return db[_0xa97d('0x54')][_0xa97d('0x63')]({'where':{'id':_0x1ea4de[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0xed7edc,null))[_0xa97d('0x1e')](function(_0x294c35){if(_0x294c35){return _0x294c35['getImap']();}return null;})['then'](respondWithResult(_0xed7edc,null))[_0xa97d('0x56')](handleError(_0xed7edc,null));};exports[_0xa97d('0x7f')]=function(_0x359a8f,_0x37fa89,_0x23c209){if(_0x359a8f[_0xa97d('0x5d')]['id']){delete _0x359a8f[_0xa97d('0x5d')]['id'];}return db[_0xa97d('0x54')][_0xa97d('0x5c')]({'where':{'id':_0x359a8f[_0xa97d('0x58')]['id']}})['then'](handleEntityNotFound(_0x37fa89,null))[_0xa97d('0x1e')](function(_0x5bda34){if(_0x5bda34){_0x359a8f['body'][_0xa97d('0x5f')]=_0x5bda34['id'];return db[_0xa97d('0x39')][_0xa97d('0x61')](_0x359a8f[_0xa97d('0x5d')]);}})[_0xa97d('0x1e')](respondWithResult(_0x37fa89,null))[_0xa97d('0x56')](handleError(_0x37fa89,null));};exports[_0xa97d('0x80')]=function(_0x29e2d1,_0x2680cc,_0x2c463c){return db['MailAccount']['findOne']({'where':{'id':_0x29e2d1['params']['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x2680cc,null))[_0xa97d('0x1e')](function(_0x3a7679){if(_0x3a7679){return _0x3a7679[_0xa97d('0x81')](null);}return null;})[_0xa97d('0x1e')](respondWithStatusCode(_0x2680cc,null))[_0xa97d('0x56')](handleError(_0x2680cc,null));};exports[_0xa97d('0x82')]=function(_0x296f5d,_0x271fcb,_0x2e1972){return db['MailAccount'][_0xa97d('0x63')]({'where':{'id':_0x296f5d[_0xa97d('0x58')]['id']}})['then'](handleEntityNotFound(_0x271fcb,null))[_0xa97d('0x1e')](function(_0x4b121c){if(_0x4b121c){return _0x4b121c[_0xa97d('0x82')]();}return null;})[_0xa97d('0x1e')](respondWithResult(_0x271fcb,null))[_0xa97d('0x56')](handleError(_0x271fcb,null));};exports['addSmtp']=function(_0x47bad4,_0x3580d8,_0x5a78b4){if(_0x47bad4[_0xa97d('0x5d')]['id']){delete _0x47bad4['body']['id'];}return db[_0xa97d('0x54')][_0xa97d('0x5c')]({'where':{'id':_0x47bad4[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x3580d8,null))[_0xa97d('0x1e')](function(_0x205af4){if(_0x205af4){_0x47bad4[_0xa97d('0x5d')][_0xa97d('0x5f')]=_0x205af4['id'];return db[_0xa97d('0x59')][_0xa97d('0x61')](_0x47bad4[_0xa97d('0x5d')]);}})[_0xa97d('0x1e')](respondWithResult(_0x3580d8,null))[_0xa97d('0x56')](handleError(_0x3580d8,null));};exports[_0xa97d('0x83')]=function(_0x93aaa9,_0x492dd1,_0x28487e){return db['MailAccount'][_0xa97d('0x63')]({'where':{'id':_0x93aaa9[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x492dd1,null))[_0xa97d('0x1e')](function(_0x9075e1){if(_0x9075e1){return _0x9075e1['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x492dd1,null))[_0xa97d('0x56')](handleError(_0x492dd1,null));};exports[_0xa97d('0x84')]=function(_0x5748ed,_0x1b75e3,_0x555846){return db[_0xa97d('0x85')][_0xa97d('0x5c')]({'where':{'id':_0x5748ed[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x1b75e3,null))['then'](function(_0x328cbf){if(_0x328cbf){return _0x328cbf[_0xa97d('0x84')](_0x5748ed['body'][_0xa97d('0x68')],_['omit'](_0x5748ed[_0xa97d('0x5d')],[_0xa97d('0x68'),'id'])||{});}})[_0xa97d('0x1e')](respondWithResult(_0x1b75e3,null))[_0xa97d('0x56')](handleError(_0x1b75e3,null));};exports['getInteractions']=function(_0x2a8057,_0x1a9056,_0x559197){var _0x11e68d={'raw':![],'where':{}};var _0x553ff5={};var _0x147fc1={'count':0x0,'rows':[]};return db[_0xa97d('0x54')][_0xa97d('0x63')]({'where':{'id':_0x2a8057[_0xa97d('0x58')]['id']}})['then'](handleEntityNotFound(_0x1a9056,null))[_0xa97d('0x1e')](function(_0x25858f){if(_0x25858f){_0x553ff5[_0xa97d('0x3e')]=_[_0xa97d('0x3f')](db[_0xa97d('0x85')][_0xa97d('0x3d')]);_0x553ff5[_0xa97d('0x43')]=_['keys'](_0x2a8057['query']);_0x553ff5[_0xa97d('0x40')]=_['intersection'](_0x553ff5[_0xa97d('0x3e')],_0x553ff5[_0xa97d('0x43')]);_0x11e68d[_0xa97d('0x42')]=_[_0xa97d('0x41')](_0x553ff5[_0xa97d('0x3e')],qs[_0xa97d('0x44')](_0x2a8057[_0xa97d('0x43')][_0xa97d('0x44')]));_0x11e68d[_0xa97d('0x42')]=_0x11e68d[_0xa97d('0x42')][_0xa97d('0x45')]?_0x11e68d[_0xa97d('0x42')]:_0x553ff5[_0xa97d('0x3e')];if(!_0x2a8057[_0xa97d('0x43')][_0xa97d('0x46')](_0xa97d('0x47'))){_0x11e68d[_0xa97d('0x48')]=qs[_0xa97d('0x48')](_0x2a8057['query']['limit']);_0x11e68d['offset']=qs[_0xa97d('0x2c')](_0x2a8057[_0xa97d('0x43')][_0xa97d('0x2c')]);}_0x11e68d[_0xa97d('0x64')]=qs[_0xa97d('0x49')](_0x2a8057[_0xa97d('0x43')][_0xa97d('0x49')]);_0x11e68d[_0xa97d('0x4a')]=qs['filters'](_[_0xa97d('0x4b')](_0x2a8057[_0xa97d('0x43')],_0x553ff5[_0xa97d('0x40')]));_0x11e68d['where']['MailAccountId']=_0x25858f['id'];if(_0x2a8057[_0xa97d('0x43')][_0xa97d('0x4c')]){_0x11e68d[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x11e68d[_0xa97d('0x4a')],{'$or':_[_0xa97d('0x4e')](_0x11e68d[_0xa97d('0x42')],function(_0x466b93){var _0x6b60aa={};_0x6b60aa[_0x466b93]={'$like':'%'+_0x2a8057[_0xa97d('0x43')][_0xa97d('0x4c')]+'%'};return _0x6b60aa;})});}_0x11e68d=_['merge']({},_0x11e68d,_0x2a8057[_0xa97d('0x53')]);return db[_0xa97d('0x85')]['count']({'where':_0x11e68d['where']})[_0xa97d('0x1e')](function(_0x591b68){_0x147fc1[_0xa97d('0x2b')]=_0x591b68;if(_0x2a8057[_0xa97d('0x43')][_0xa97d('0x5b')]){_0x11e68d['include']=[{'model':db[_0xa97d('0x86')],'as':'Contact','required':![]},{'model':db[_0xa97d('0x87')],'as':_0xa97d('0x88'),'attributes':[_0xa97d('0x38'),_0xa97d('0x89'),_0xa97d('0x8a')],'required':![]},{'model':db[_0xa97d('0x8b')],'as':_0xa97d('0x8c'),'attributes':['id',_0xa97d('0x38'),_0xa97d('0x8d')],'where':_0x2a8057['query'][_0xa97d('0x8e')]?{'id':_0x2a8057['query'][_0xa97d('0x8e')]}:undefined,'required':_0x2a8057['query'][_0xa97d('0x8e')]?!![]:![]}];}return db['MailInteraction'][_0xa97d('0x66')](_0x11e68d);})[_0xa97d('0x1e')](function(_0x5aa8ea){_0x147fc1[_0xa97d('0x55')]=_0x5aa8ea;return _0x147fc1;});}})[_0xa97d('0x1e')](respondWithFilteredResult(_0x1a9056,_0x11e68d))[_0xa97d('0x56')](handleError(_0x1a9056,null));};exports['addApplications']=function(_0x4aba79,_0xee0f7f,_0x17533f){return db['MailAccount'][_0xa97d('0x63')]({'where':{'id':_0x4aba79[_0xa97d('0x58')]['id']}})['then'](handleEntityNotFound(_0xee0f7f,null))[_0xa97d('0x1e')](function(_0xfd5852){if(_0xfd5852){return db['sequelize'][_0xa97d('0x8f')](function(_0x49b1e4){return db['MailApplication'][_0xa97d('0x36')]({'where':{'MailAccountId':_0x4aba79[_0xa97d('0x58')]['id']},'transaction':_0x49b1e4})[_0xa97d('0x1e')](function(_0x4efb86){var _0x568a0e=_['map'](_0x4aba79[_0xa97d('0x5d')],function(_0x410c19){_0x410c19['MailAccountId']=_0x4aba79[_0xa97d('0x58')]['id'];return _0x410c19;});return db[_0xa97d('0x90')][_0xa97d('0x91')](_0x568a0e,{'transaction':_0x49b1e4});});})[_0xa97d('0x1e')](function(){return db[_0xa97d('0x90')][_0xa97d('0x92')]({'where':{'MailAccountId':_0x4aba79[_0xa97d('0x58')]['id']},'order':_0xa97d('0x93')});});}})['then'](respondWithResult(_0xee0f7f,null))[_0xa97d('0x56')](handleError(_0xee0f7f,null));};exports[_0xa97d('0x94')]=function(_0x2e684a,_0x56baa3,_0x1dd41c){var _0x49ffa5={};var _0xf14a97={};var _0x276d42;var _0x22f547;return db[_0xa97d('0x54')][_0xa97d('0x63')]({'where':{'id':_0x2e684a[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x56baa3,null))[_0xa97d('0x1e')](function(_0x196c50){if(_0x196c50){_0x276d42=_0x196c50;_0xf14a97[_0xa97d('0x3e')]=_['keys'](db[_0xa97d('0x90')]['rawAttributes']);_0xf14a97[_0xa97d('0x43')]=_[_0xa97d('0x3f')](_0x2e684a[_0xa97d('0x43')]);_0xf14a97[_0xa97d('0x40')]=_[_0xa97d('0x41')](_0xf14a97[_0xa97d('0x3e')],_0xf14a97[_0xa97d('0x43')]);_0x49ffa5[_0xa97d('0x42')]=_[_0xa97d('0x41')](_0xf14a97[_0xa97d('0x3e')],qs['fields'](_0x2e684a['query'][_0xa97d('0x44')]));_0x49ffa5[_0xa97d('0x42')]=_0x49ffa5[_0xa97d('0x42')]['length']?_0x49ffa5['attributes']:_0xf14a97[_0xa97d('0x3e')];_0x49ffa5[_0xa97d('0x64')]=qs[_0xa97d('0x49')](_0x2e684a[_0xa97d('0x43')]['sort']);_0x49ffa5[_0xa97d('0x4a')]=qs[_0xa97d('0x40')](_['pick'](_0x2e684a['query'],_0xf14a97['filters']));if(_0x2e684a[_0xa97d('0x43')][_0xa97d('0x4c')]){_0x49ffa5[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x49ffa5['where'],{'$or':_[_0xa97d('0x4e')](_0x49ffa5[_0xa97d('0x42')],function(_0x26880b){var _0x31aaf5={};_0x31aaf5[_0x26880b]={'$like':'%'+_0x2e684a['query'][_0xa97d('0x4c')]+'%'};return _0x31aaf5;})});}_0x49ffa5=_[_0xa97d('0x4d')]({},_0x49ffa5,_0x2e684a[_0xa97d('0x53')]);return _0x276d42[_0xa97d('0x94')](_0x49ffa5);}})[_0xa97d('0x1e')](function(_0x1bf8cc){if(_0x1bf8cc){_0x22f547=_0x1bf8cc[_0xa97d('0x45')];if(!_0x2e684a['query'][_0xa97d('0x46')](_0xa97d('0x47'))){_0x49ffa5[_0xa97d('0x48')]=qs[_0xa97d('0x48')](_0x2e684a[_0xa97d('0x43')][_0xa97d('0x48')]);_0x49ffa5[_0xa97d('0x2c')]=qs[_0xa97d('0x2c')](_0x2e684a[_0xa97d('0x43')][_0xa97d('0x2c')]);}return _0x276d42['getApplications'](_0x49ffa5);}})[_0xa97d('0x1e')](function(_0x3b064d){if(_0x3b064d){return _0x3b064d?{'count':_0x22f547,'rows':_0x3b064d}:null;}})['then'](respondWithResult(_0x56baa3,null))[_0xa97d('0x56')](handleError(_0x56baa3,null));};exports[_0xa97d('0x95')]=function(_0x383c1c,_0x302214,_0x305d7f){var _0x351319={'raw':!![],'where':{}};var _0x3f7744={};var _0x5d5609={'count':0x0,'rows':[]};return db[_0xa97d('0x54')][_0xa97d('0x63')]({'where':{'id':_0x383c1c[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x302214,null))[_0xa97d('0x1e')](function(_0x194d4f){if(_0x194d4f){_0x3f7744['model']=_[_0xa97d('0x3f')](db['MailMessage'][_0xa97d('0x3d')]);_0x3f7744[_0xa97d('0x43')]=_['keys'](_0x383c1c[_0xa97d('0x43')]);_0x3f7744[_0xa97d('0x40')]=_[_0xa97d('0x41')](_0x3f7744[_0xa97d('0x3e')],_0x3f7744[_0xa97d('0x43')]);_0x351319[_0xa97d('0x42')]=_[_0xa97d('0x41')](_0x3f7744[_0xa97d('0x3e')],qs[_0xa97d('0x44')](_0x383c1c[_0xa97d('0x43')]['fields']));_0x351319['attributes']=_0x351319['attributes'][_0xa97d('0x45')]?_0x351319[_0xa97d('0x42')]:_0x3f7744['model'];if(!_0x383c1c[_0xa97d('0x43')][_0xa97d('0x46')](_0xa97d('0x47'))){_0x351319[_0xa97d('0x48')]=qs[_0xa97d('0x48')](_0x383c1c[_0xa97d('0x43')]['limit']);_0x351319[_0xa97d('0x2c')]=qs[_0xa97d('0x2c')](_0x383c1c['query'][_0xa97d('0x2c')]);}_0x351319[_0xa97d('0x64')]=qs[_0xa97d('0x49')](_0x383c1c[_0xa97d('0x43')]['sort']);_0x351319[_0xa97d('0x4a')]=qs[_0xa97d('0x40')](_['pick'](_0x383c1c[_0xa97d('0x43')],_0x3f7744[_0xa97d('0x40')]));_0x351319[_0xa97d('0x4a')][_0xa97d('0x5f')]=_0x194d4f['id'];if(_0x383c1c[_0xa97d('0x43')][_0xa97d('0x4c')]){_0x351319[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x351319[_0xa97d('0x4a')],{'$or':_[_0xa97d('0x4e')](_0x351319[_0xa97d('0x42')],function(_0x568e39){var _0x106da2={};_0x106da2[_0x568e39]={'$like':'%'+_0x383c1c['query'][_0xa97d('0x4c')]+'%'};return _0x106da2;})});}if(_0x383c1c[_0xa97d('0x43')]['$gte']){var _0x270964=_0x383c1c[_0xa97d('0x43')][_0xa97d('0x96')]['split'](',');var _0x595335={};_0x595335[_0x270964[0x0]]={'$gte':moment(_0x270964[0x1])[_0xa97d('0x97')](_0xa97d('0x98'))};_0x351319[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x351319[_0xa97d('0x4a')],_0x595335);}_0x351319=_['merge']({},_0x351319,_0x383c1c[_0xa97d('0x53')]);return db[_0xa97d('0x99')][_0xa97d('0x2b')]({'where':_0x351319[_0xa97d('0x4a')]})[_0xa97d('0x1e')](function(_0xd19ea0){_0x5d5609[_0xa97d('0x2b')]=_0xd19ea0;if(_0x383c1c['query'][_0xa97d('0x5b')]){_0x351319[_0xa97d('0x65')]=[{'all':!![]}];}return db[_0xa97d('0x99')][_0xa97d('0x66')](_0x351319);})[_0xa97d('0x1e')](function(_0x47eafc){_0x5d5609['rows']=_0x47eafc;return _0x5d5609;});}})[_0xa97d('0x1e')](respondWithFilteredResult(_0x302214,_0x351319))[_0xa97d('0x56')](handleError(_0x302214,null));};exports[_0xa97d('0x9a')]=function(_0x3e9e4e,_0x4ad5ad,_0x38109c){var _0x5984c6,_0x2433b8={},_0x18fade;if(_0x3e9e4e[_0xa97d('0x5d')]['to']){_0x18fade=_0x3e9e4e[_0xa97d('0x5d')]['to'][_0xa97d('0x9b')](',')[0x0];}return db[_0xa97d('0x54')]['find']({'where':{'id':_0x3e9e4e[_0xa97d('0x58')]['id']},'include':[{'model':db[_0xa97d('0x9c')],'as':_0xa97d('0x9d'),'include':[{'model':db[_0xa97d('0x86')],'as':_0xa97d('0x9e'),'where':{'email':_0x18fade},'limit':0x1,'order':[[_0xa97d('0x9f'),'DESC']]}]},{'model':db[_0xa97d('0x59')],'as':_0xa97d('0x3b'),'raw':!![]}]})[_0xa97d('0x1e')](handleEntityNotFound(_0x4ad5ad,null))[_0xa97d('0x1e')](function(_0x1984e9){if(_0x1984e9){_0x5984c6=_0x1984e9;if(_0x1984e9[_0xa97d('0x3b')]){if(_[_0xa97d('0x6e')](_0x3e9e4e['body'][_0xa97d('0xa0')])){_0x3e9e4e[_0xa97d('0x5d')]['from']=util['format'](_0xa97d('0xa1'),_0x1984e9[_0xa97d('0x38')],_0x1984e9['email']||_0x1984e9[_0xa97d('0x3b')][_0xa97d('0x73')]);}if(_0x3e9e4e[_0xa97d('0x5d')]['attachments']&&_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0xa2')]['length']){for(var _0x391694=0x0;_0x391694<_0x3e9e4e['body'][_0xa97d('0xa2')]['length'];_0x391694+=0x1){_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0xa2')][_0x391694]={'filename':_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0xa2')][_0x391694][_0xa97d('0x38')],'path':path[_0xa97d('0xa3')](config[_0xa97d('0xa4')],_0xa97d('0xa5'),_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0xa2')][_0x391694][_0xa97d('0xa6')])};}}var _0x239410={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1984e9['Smtp'][_0xa97d('0x7b')])){if(_0x1984e9['Smtp']['authentication']){_0x239410[_0xa97d('0xa7')]={'user':_0x1984e9[_0xa97d('0x3b')][_0xa97d('0x73')],'pass':_0x1984e9[_0xa97d('0x3b')][_0xa97d('0x76')]};}_0x239410[_0xa97d('0x79')]=_0x1984e9['Smtp'][_0xa97d('0x79')];_0x239410[_0xa97d('0x7a')]=_0x1984e9['Smtp'][_0xa97d('0x7a')];_0x239410[_0xa97d('0xa8')]=_0x1984e9[_0xa97d('0x3b')][_0xa97d('0xa8')];}else{_0x239410[_0xa97d('0x7b')]=_0x1984e9['Smtp'][_0xa97d('0x7b')];_0x239410[_0xa97d('0xa7')]={'user':_0x1984e9[_0xa97d('0x3b')][_0xa97d('0x73')],'pass':_0x1984e9[_0xa97d('0x3b')]['pass']};}return respondWithRpcPromise('SendMail',_0xa97d('0xa9'),{'account':_0x239410,'message':_0x3e9e4e[_0xa97d('0x5d')]});}else{throw new Error('List\x20not\x20found');}}})[_0xa97d('0x1e')](function(_0x2fb777){if(_0x2fb777){_0x2433b8=_0x2fb777;if(_0x5984c6[_0xa97d('0x9d')]){if(_0x5984c6['List']['Contacts']['length']){return _0x5984c6[_0xa97d('0x9d')]['Contacts'][0x0];}else{return db[_0xa97d('0x86')][_0xa97d('0x61')](_[_0xa97d('0x17')](_0x3e9e4e['body'],{'firstName':_0x3e9e4e[_0xa97d('0x5d')]['to'],'email':_0x3e9e4e[_0xa97d('0x5d')]['to'],'phone':_0x3e9e4e['body']['to'],'ListId':_0x5984c6[_0xa97d('0x6d')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xa97d('0x1e')](function(_0x5ab6be){if(_0x5ab6be){var _0x518754={'UserId':_0x3e9e4e['user']['id'],'ContactId':_0x5ab6be['id'],'MailAccountId':_0x5984c6['id'],'inReplyTo':_0x2433b8['messageId'],'to':_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0xa0')],'cc':_0x3e9e4e[_0xa97d('0x5d')]['cc'],'subject':_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0xaa')],'attach':_0x3e9e4e[_0xa97d('0x5d')]['attach'],'firstMsgDirection':_0xa97d('0xab'),'lastMsgAt':moment()[_0xa97d('0x97')](_0xa97d('0x98')),'lastMsgDirection':'out','lastMsgBody':_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0x5d')],'Messages':[_[_0xa97d('0x4d')](_0x3e9e4e[_0xa97d('0x5d')],{'messageId':_0x2433b8['messageId'],'sentAt':moment()[_0xa97d('0x97')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5984c6['id'],'UserId':_0x3e9e4e[_0xa97d('0x73')]['id'],'ContactId':_0x5ab6be['id']})]};if(_0x3e9e4e[_0xa97d('0x5d')][_0xa97d('0xac')]){_0x518754=_[_0xa97d('0x4d')](_0x518754,_0x3e9e4e['body']['Interaction']);}return db['MailInteraction'][_0xa97d('0x61')](_0x518754,{'include':[{'model':db[_0xa97d('0x99')],'as':_0xa97d('0xad')}]});}})['then'](respondWithResult(_0x4ad5ad,null))[_0xa97d('0x56')](handleError(_0x4ad5ad,null));};exports[_0xa97d('0xae')]=function(_0xcb2c6d,_0x4b39d1,_0x504cb7){return db[_0xa97d('0x54')][_0xa97d('0x5c')]({'where':{'id':_0xcb2c6d['params']['id']},'include':[{'model':db[_0xa97d('0x59')],'as':_0xa97d('0x3b'),'raw':!![]}]})[_0xa97d('0x1e')](handleEntityNotFound(_0x4b39d1,null))[_0xa97d('0x1e')](function(_0x1f9683){if(_0x1f9683&&_0x1f9683[_0xa97d('0x3b')]){var _0x24adbb={'id':_0x1f9683['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1f9683[_0xa97d('0x3b')][_0xa97d('0x7b')]){_0x24adbb[_0xa97d('0x7b')]=_0x1f9683[_0xa97d('0x3b')][_0xa97d('0x7b')];}else{_0x24adbb[_0xa97d('0x79')]=_0x1f9683[_0xa97d('0x3b')][_0xa97d('0x79')];_0x24adbb[_0xa97d('0x7a')]=_0x1f9683[_0xa97d('0x3b')][_0xa97d('0x7a')];_0x24adbb[_0xa97d('0xa8')]=_0x1f9683[_0xa97d('0x3b')]['secure'];}if(_0x1f9683[_0xa97d('0x3b')][_0xa97d('0x78')]){_0x24adbb[_0xa97d('0xa7')]={'user':_0x1f9683[_0xa97d('0x3b')][_0xa97d('0x73')],'pass':_0x1f9683['Smtp']['pass']};}return respondWithRpcPromise(_0xa97d('0xaf'),'verifySmtp',{'account':_0x24adbb});}})['then'](respondWithResult(_0x4b39d1,null))[_0xa97d('0x56')](handleError(_0x4b39d1,null));};exports['destroy']=function(_0xe0b7d0,_0x2e533f){return db[_0xa97d('0x54')]['find']({'where':{'id':_0xe0b7d0[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x2e533f,null))['then'](function(_0x4c0bf9){if(_0x4c0bf9&&_0x4c0bf9[_0xa97d('0x7b')]){throw new db[(_0xa97d('0xb0'))][(_0xa97d('0xb1'))](_0xa97d('0xb2'));}return _0x4c0bf9;})[_0xa97d('0x1e')](removeEntity(_0x2e533f,null))[_0xa97d('0x56')](handleError(_0x2e533f,null));};exports[_0xa97d('0xb3')]=function(_0x5083c8,_0x10ee36,_0x200ebf){return db['MailAccount'][_0xa97d('0x5c')]({'where':{'id':_0x5083c8['params']['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x10ee36,null))[_0xa97d('0x1e')](function(_0x353186){if(_0x353186){return _0x353186[_0xa97d('0xb3')](_0x5083c8[_0xa97d('0x5d')][_0xa97d('0x68')],_['omit'](_0x5083c8[_0xa97d('0x5d')],[_0xa97d('0x68'),'id'])||{})[_0xa97d('0xb4')](function(_0x1ffb99){for(var _0x588423=0x0;_0x588423<_0x5083c8[_0xa97d('0x5d')][_0xa97d('0x68')][_0xa97d('0x45')];_0x588423+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x5083c8[_0xa97d('0x5d')]['ids'][_0x588423],'MailAccountId':_0x5083c8[_0xa97d('0x58')]['id']});}return _0x1ffb99;});}})[_0xa97d('0x1e')](respondWithResult(_0x10ee36,null))[_0xa97d('0x56')](handleError(_0x10ee36,null));};exports['removeAgents']=function(_0x4c9f43,_0x3f1789,_0xb32bc9){return db[_0xa97d('0x54')][_0xa97d('0x5c')]({'where':{'id':_0x4c9f43[_0xa97d('0x58')]['id']}})[_0xa97d('0x1e')](handleEntityNotFound(_0x3f1789,null))['then'](function(_0x5e39dc){if(_0x5e39dc){return _0x5e39dc[_0xa97d('0xb5')](_0x4c9f43[_0xa97d('0x43')][_0xa97d('0x68')])['then'](function(){if(_[_0xa97d('0xb6')](_0x4c9f43[_0xa97d('0x43')][_0xa97d('0x68')])){for(var _0x8f9029=0x0;_0x8f9029<_0x4c9f43[_0xa97d('0x43')][_0xa97d('0x68')][_0xa97d('0x45')];_0x8f9029+=0x1){socket[_0xa97d('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x4c9f43['query'][_0xa97d('0x68')][_0x8f9029]),'MailAccountId':Number(_0x4c9f43[_0xa97d('0x58')]['id'])});}}else{socket[_0xa97d('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x4c9f43[_0xa97d('0x43')]['ids']),'MailAccountId':Number(_0x4c9f43[_0xa97d('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x3f1789,null))[_0xa97d('0x56')](handleError(_0x3f1789,null));};exports[_0xa97d('0xb8')]=function(_0x5dd408,_0x5dce43,_0x26c319){var _0x58458d={};var _0xac95b0={};var _0x12af71;var _0x32de40;return db[_0xa97d('0x54')]['findOne']({'where':{'id':_0x5dd408[_0xa97d('0x58')]['id']}})['then'](handleEntityNotFound(_0x5dce43,null))[_0xa97d('0x1e')](function(_0xbeb11d){if(_0xbeb11d){_0x12af71=_0xbeb11d;_0xac95b0[_0xa97d('0x3e')]=_[_0xa97d('0x3f')](db['User']['rawAttributes']);_0xac95b0[_0xa97d('0x43')]=_[_0xa97d('0x3f')](_0x5dd408[_0xa97d('0x43')]);_0xac95b0[_0xa97d('0x40')]=_[_0xa97d('0x41')](_0xac95b0[_0xa97d('0x3e')],_0xac95b0[_0xa97d('0x43')]);_0x58458d['attributes']=_[_0xa97d('0x41')](_0xac95b0['model'],qs[_0xa97d('0x44')](_0x5dd408[_0xa97d('0x43')][_0xa97d('0x44')]));_0x58458d[_0xa97d('0x42')]=_0x58458d['attributes'][_0xa97d('0x45')]?_0x58458d['attributes']:_0xac95b0[_0xa97d('0x3e')];_0x58458d['order']=qs[_0xa97d('0x49')](_0x5dd408[_0xa97d('0x43')]['sort']);_0x58458d[_0xa97d('0x4a')]=qs[_0xa97d('0x40')](_[_0xa97d('0x4b')](_0x5dd408[_0xa97d('0x43')],_0xac95b0[_0xa97d('0x40')]));if(_0x5dd408['query'][_0xa97d('0x4c')]){_0x58458d[_0xa97d('0x4a')]=_[_0xa97d('0x4d')](_0x58458d[_0xa97d('0x4a')],{'$or':_[_0xa97d('0x4e')](_0x58458d[_0xa97d('0x42')],function(_0x266a9d){var _0x59bccd={};_0x59bccd[_0x266a9d]={'$like':'%'+_0x5dd408[_0xa97d('0x43')][_0xa97d('0x4c')]+'%'};return _0x59bccd;})});}_0x58458d=_[_0xa97d('0x4d')]({},_0x58458d,_0x5dd408[_0xa97d('0x53')]);return _0x12af71[_0xa97d('0xb8')](_0x58458d);}})[_0xa97d('0x1e')](function(_0x12b55c){if(_0x12b55c){_0x32de40=_0x12b55c[_0xa97d('0x45')];if(!_0x5dd408['query'][_0xa97d('0x46')](_0xa97d('0x47'))){_0x58458d['limit']=qs[_0xa97d('0x48')](_0x5dd408[_0xa97d('0x43')][_0xa97d('0x48')]);_0x58458d[_0xa97d('0x2c')]=qs[_0xa97d('0x2c')](_0x5dd408[_0xa97d('0x43')]['offset']);}return _0x12af71[_0xa97d('0xb8')](_0x58458d);}})[_0xa97d('0x1e')](function(_0x136643){if(_0x136643){return _0x136643?{'count':_0x32de40,'rows':_0x136643}:null;}})[_0xa97d('0x1e')](respondWithResult(_0x5dce43,null))[_0xa97d('0x56')](handleError(_0x5dce43,null));}; \ No newline at end of file +var _0x4711=['port','service','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','from','format','attachments','join','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','emit','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','count','offset','set','Content-Range','json','reject','save','update','destroy','get','MailAccounts','UserProfileResource','name','send','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','show','Imap','fields','include','body','find','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','nolimit','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cservice','user','cuser','password','pass','cpassword','authentication','host'];(function(_0x77a0c1,_0x400923){var _0x1db8b8=function(_0x10d393){while(--_0x10d393){_0x77a0c1['push'](_0x77a0c1['shift']());}};_0x1db8b8(++_0x400923);}(_0x4711,0x10c));var _0x1471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4711[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x1471('0x0'));var emlformat=require(_0x1471('0x1'));var rimraf=require(_0x1471('0x2'));var zipdir=require(_0x1471('0x3'));var jsonpatch=require(_0x1471('0x4'));var rp=require(_0x1471('0x5'));var moment=require(_0x1471('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1471('0x7'));var util=require('util');var path=require(_0x1471('0x8'));var sox=require(_0x1471('0x9'));var csv=require(_0x1471('0xa'));var ejs=require(_0x1471('0xb'));var fs=require('fs');var _=require(_0x1471('0xc'));var squel=require('squel');var crypto=require(_0x1471('0xd'));var jsforce=require(_0x1471('0xe'));var deskjs=require(_0x1471('0xf'));var toCsv=require(_0x1471('0xa'));var querystring=require(_0x1471('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1471('0x11'));var qs=require(_0x1471('0x12'));var hardwareService=require(_0x1471('0x13'));var logger=require(_0x1471('0x14'))(_0x1471('0x15'));var utils=require(_0x1471('0x16'));var config=require(_0x1471('0x17'));var db=require(_0x1471('0x18'))['db'];config['redis']=_[_0x1471('0x19')](config[_0x1471('0x1a')],{'host':_0x1471('0x1b'),'port':0x18eb});var socket=require(_0x1471('0x1c'))(new Redis(config[_0x1471('0x1a')]));require('./mailAccount.socket')[_0x1471('0x1d')](socket);var jayson=require(_0x1471('0x1e'));var client=jayson[_0x1471('0x1f')]['http']({'port':0x232b});function checkPasswordPattern(_0x323f2c,_0x2bab8a,_0x16c18e){if(_0x16c18e){var _0x3f124e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f124e[_0x1471('0x20')](_0x2bab8a)){return _0x323f2c;}else{throw new Error(_0x1471('0x21'));}}else{return _0x323f2c;}}function respondWithRpcPromise(_0x33a6fc,_0x594cf2,_0x11ea35,_0x2a321b){return new BPromise(function(_0x13479e,_0x4e8282){var _0x10fdea=_0x2a321b||client;return _0x10fdea[_0x1471('0x22')](_0x33a6fc,_0x11ea35)[_0x1471('0x23')](function(_0x2c956a){logger[_0x1471('0x24')](_0x1471('0x25'),_0x594cf2,_0x1471('0x26'));logger[_0x1471('0x27')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x594cf2,_0x1471('0x26'),JSON[_0x1471('0x28')](_0x2c956a));if(_0x2c956a[_0x1471('0x29')]){if(_0x2c956a[_0x1471('0x29')][_0x1471('0x2a')]===0x1f4){logger[_0x1471('0x29')](_0x1471('0x25'),_0x594cf2,_0x2c956a[_0x1471('0x29')][_0x1471('0x2b')]);return _0x4e8282(_0x2c956a[_0x1471('0x29')][_0x1471('0x2b')]);}logger[_0x1471('0x29')](_0x1471('0x25'),_0x594cf2,_0x2c956a[_0x1471('0x29')]['message']);return _0x13479e(_0x2c956a[_0x1471('0x29')][_0x1471('0x2b')]);}else{logger['info'](_0x1471('0x25'),_0x594cf2,_0x1471('0x26'));_0x13479e(_0x2c956a[_0x1471('0x2c')][_0x1471('0x2b')]);}})['catch'](function(_0x53af2e){logger[_0x1471('0x29')](_0x1471('0x25'),_0x594cf2,_0x53af2e);_0x4e8282(_0x53af2e);});});}function respondWithStatusCode(_0x2a081e,_0x14b08f){_0x14b08f=_0x14b08f||0xcc;return function(_0xd34d36){if(_0xd34d36){return _0x2a081e[_0x1471('0x2d')](_0x14b08f);}return _0x2a081e['status'](_0x14b08f)[_0x1471('0x2e')]();};}function respondWithResult(_0x5158b2,_0x2da177){_0x2da177=_0x2da177||0xc8;return function(_0x2b90f8){if(_0x2b90f8){return _0x5158b2[_0x1471('0x2f')](_0x2da177)['json'](_0x2b90f8);}};}function respondWithFilteredResult(_0x4bde40,_0x2ebcf0){return function(_0x5e85fb){if(_0x5e85fb){var _0x49cc50=_0x5e85fb[_0x1471('0x30')],_0x3fbf7d=_0x2ebcf0[_0x1471('0x31')],_0x2758c3=_0x2ebcf0[_0x1471('0x31')]+_0x2ebcf0['limit'],_0x1fa8dd;if(_0x2758c3>=_0x49cc50){_0x2758c3=_0x49cc50;_0x1fa8dd=0xc8;}else{_0x1fa8dd=0xce;}_0x4bde40[_0x1471('0x2f')](_0x1fa8dd);return _0x4bde40[_0x1471('0x32')](_0x1471('0x33'),_0x3fbf7d+'-'+_0x2758c3+'/'+_0x49cc50)[_0x1471('0x34')](_0x5e85fb);}return null;};}function patchUpdates(_0x1b7a9d){return function(_0x1c9c66){try{jsonpatch['apply'](_0x1c9c66,_0x1b7a9d,!![]);}catch(_0x8d7f00){return BPromise[_0x1471('0x35')](_0x8d7f00);}return _0x1c9c66[_0x1471('0x36')]();};}function saveUpdates(_0x1a1bb8,_0x74647f){return function(_0x4bc8e1){if(_0x4bc8e1){return _0x4bc8e1[_0x1471('0x37')](_0x1a1bb8)[_0x1471('0x23')](function(_0x50d5ac){return _0x50d5ac;});}return null;};}function removeEntity(_0x2cd8b5,_0x620d26){return function(_0x1b5360){if(_0x1b5360){return _0x1b5360[_0x1471('0x38')]()[_0x1471('0x23')](function(){var _0x223413=_0x1b5360[_0x1471('0x39')]({'plain':!![]});var _0x533212=_0x1471('0x3a');return db[_0x1471('0x3b')]['destroy']({'where':{'type':_0x533212,'resourceId':_0x223413['id']}})[_0x1471('0x23')](function(){return _0x1b5360;});})['then'](function(){_0x2cd8b5[_0x1471('0x2f')](0xcc)[_0x1471('0x2e')]();});}};}function handleEntityNotFound(_0x1d2dcd,_0x41ada2){return function(_0x507723){if(!_0x507723){_0x1d2dcd[_0x1471('0x2d')](0x194);}return _0x507723;};}function handleError(_0x53401f,_0x1e7965){_0x1e7965=_0x1e7965||0x1f4;return function(_0x510b39){logger[_0x1471('0x29')](_0x510b39['stack']);if(_0x510b39[_0x1471('0x3c')]){delete _0x510b39[_0x1471('0x3c')];}_0x53401f[_0x1471('0x2f')](_0x1e7965)[_0x1471('0x3d')](_0x510b39);};}exports['index']=function(_0x4ff24b,_0x7bb807){var _0x4e78f6={'include':[{'model':db[_0x1471('0x3e')],'as':'Imap'},{'model':db[_0x1471('0x3f')],'as':_0x1471('0x40')},{'model':db[_0x1471('0x41')],'as':_0x1471('0x42')}]},_0x3fcec5={},_0x318f4b={'count':0x0,'rows':[]};var _0x4bee0b=db[_0x1471('0x43')][_0x1471('0x44')];_0x3fcec5[_0x1471('0x45')]=_[_0x1471('0x46')](_0x4bee0b);_0x3fcec5['query']=_['keys'](_0x4ff24b[_0x1471('0x47')]);_0x3fcec5[_0x1471('0x48')]=_[_0x1471('0x49')](_0x3fcec5['model'],_0x3fcec5[_0x1471('0x47')]);_0x4e78f6[_0x1471('0x4a')]=_[_0x1471('0x49')](_0x3fcec5[_0x1471('0x45')],qs['fields'](_0x4ff24b[_0x1471('0x47')]['fields']));_0x4e78f6[_0x1471('0x4a')]=_0x4e78f6[_0x1471('0x4a')][_0x1471('0x4b')]?_0x4e78f6[_0x1471('0x4a')]:_0x3fcec5[_0x1471('0x45')];if(!_0x4ff24b[_0x1471('0x47')][_0x1471('0x4c')]('nolimit')){_0x4e78f6['limit']=qs['limit'](_0x4ff24b['query'][_0x1471('0x4d')]);_0x4e78f6['offset']=qs[_0x1471('0x31')](_0x4ff24b['query'][_0x1471('0x31')]);}_0x4e78f6[_0x1471('0x4e')]=qs['sort'](_0x4ff24b[_0x1471('0x47')][_0x1471('0x4f')]);_0x4e78f6[_0x1471('0x50')]=qs[_0x1471('0x48')](_[_0x1471('0x51')](_0x4ff24b[_0x1471('0x47')],_0x3fcec5[_0x1471('0x48')]));if(_0x4ff24b[_0x1471('0x47')]['filter']){_0x4e78f6['where']=_[_0x1471('0x52')](_0x4e78f6[_0x1471('0x50')],{'$or':_[_0x1471('0x53')](_0x4bee0b,function(_0x1226d5){if(_0x1226d5[_0x1471('0x54')][_0x1471('0x55')]!==_0x1471('0x56')){var _0x5bb85a={};_0x5bb85a[_0x1226d5[_0x1471('0x57')]]={'$like':'%'+_0x4ff24b[_0x1471('0x47')][_0x1471('0x58')]+'%'};return _0x5bb85a;}})});}_0x4e78f6=_[_0x1471('0x52')]({},_0x4e78f6,_0x4ff24b[_0x1471('0x59')]);var _0x30d61b={'where':_0x4e78f6[_0x1471('0x50')]};return db[_0x1471('0x43')]['count'](_0x30d61b)[_0x1471('0x23')](function(_0x2449ed){_0x318f4b[_0x1471('0x30')]=_0x2449ed;if(_0x4ff24b[_0x1471('0x47')][_0x1471('0x5a')]){_0x4e78f6['include']=[{'all':!![]}];}return db[_0x1471('0x43')][_0x1471('0x5b')](_0x4e78f6);})[_0x1471('0x23')](function(_0x8f9554){_0x318f4b[_0x1471('0x5c')]=_0x8f9554;return _0x318f4b;})['then'](respondWithFilteredResult(_0x7bb807,_0x4e78f6))[_0x1471('0x5d')](handleError(_0x7bb807,null));};exports[_0x1471('0x5e')]=function(_0x32e4f3,_0x4e5e93){var _0x271678={'raw':![],'where':{'id':_0x32e4f3['params']['id']},'include':[{'model':db[_0x1471('0x3e')],'as':_0x1471('0x5f')},{'model':db[_0x1471('0x3f')],'as':_0x1471('0x40')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x41a985={};_0x41a985['model']=_[_0x1471('0x46')](db[_0x1471('0x43')][_0x1471('0x44')]);_0x41a985[_0x1471('0x47')]=_[_0x1471('0x46')](_0x32e4f3[_0x1471('0x47')]);_0x41a985['filters']=_[_0x1471('0x49')](_0x41a985['model'],_0x41a985[_0x1471('0x47')]);_0x271678[_0x1471('0x4a')]=_[_0x1471('0x49')](_0x41a985[_0x1471('0x45')],qs[_0x1471('0x60')](_0x32e4f3['query'][_0x1471('0x60')]));_0x271678[_0x1471('0x4a')]=_0x271678['attributes'][_0x1471('0x4b')]?_0x271678[_0x1471('0x4a')]:_0x41a985['model'];if(_0x32e4f3[_0x1471('0x47')][_0x1471('0x5a')]){_0x271678[_0x1471('0x61')]=[{'all':!![]}];}_0x271678=_[_0x1471('0x52')]({},_0x271678,_0x32e4f3[_0x1471('0x59')]);return db[_0x1471('0x43')]['find'](_0x271678)[_0x1471('0x23')](handleEntityNotFound(_0x4e5e93,null))['then'](respondWithResult(_0x4e5e93,null))['catch'](handleError(_0x4e5e93,null));};exports[_0x1471('0x37')]=function(_0x5ce453,_0x15621f){if(_0x5ce453[_0x1471('0x62')]['id']){delete _0x5ce453[_0x1471('0x62')]['id'];}return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x5ce453[_0x1471('0x64')]['id']},'include':[{'model':db[_0x1471('0x3e')],'as':_0x1471('0x5f')},{'model':db[_0x1471('0x3f')],'as':_0x1471('0x40')},{'model':db[_0x1471('0x41')],'as':'mandatoryDispositionPause'}]})[_0x1471('0x23')](handleEntityNotFound(_0x15621f,null))[_0x1471('0x23')](saveUpdates(_0x5ce453[_0x1471('0x62')],null))[_0x1471('0x23')](function(_0x4f3e68){if(_0x4f3e68&&_0x5ce453[_0x1471('0x62')][_0x1471('0x5f')]){return db[_0x1471('0x3e')][_0x1471('0x37')](_0x5ce453['body']['Imap'],{'where':{'MailAccountId':_0x4f3e68['id']}})['then'](function(){return _0x4f3e68;});}return _0x4f3e68;})[_0x1471('0x23')](function(_0x54db68){if(_0x54db68&&_0x5ce453['body'][_0x1471('0x40')]){return db[_0x1471('0x3f')][_0x1471('0x37')](_0x5ce453['body']['Smtp'],{'where':{'MailAccountId':_0x54db68['id']}})[_0x1471('0x23')](function(){return _0x54db68;});}return _0x54db68;})[_0x1471('0x23')](respondWithResult(_0x15621f,null))['catch'](handleError(_0x15621f,null));};exports[_0x1471('0x65')]=function(_0x305bc9,_0x22165d){return db[_0x1471('0x43')][_0x1471('0x65')]()['then'](respondWithResult(_0x22165d,null))[_0x1471('0x5d')](handleError(_0x22165d,null));};exports[_0x1471('0x66')]=function(_0x365a82,_0x18a392,_0x2bda3d){if(_0x365a82[_0x1471('0x62')]['id']){delete _0x365a82[_0x1471('0x62')]['id'];}return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x365a82['params']['id']}})['then'](handleEntityNotFound(_0x18a392,null))[_0x1471('0x23')](function(_0x1992fe){if(_0x1992fe){_0x365a82[_0x1471('0x62')][_0x1471('0x67')]=_0x1992fe['id'];return db[_0x1471('0x68')][_0x1471('0x69')](_0x365a82['body']);}})['then'](respondWithResult(_0x18a392,null))[_0x1471('0x5d')](handleError(_0x18a392,null));};exports[_0x1471('0x6a')]=function(_0x23c228,_0x4fc089,_0xc3bc07){var _0x42532f={'raw':![],'where':{}};var _0x42af88={};var _0x258033={'count':0x0,'rows':[]};return db[_0x1471('0x43')]['findOne']({'where':{'id':_0x23c228[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x4fc089,null))[_0x1471('0x23')](function(_0x350487){if(_0x350487){_0x42af88[_0x1471('0x45')]=_[_0x1471('0x46')](db[_0x1471('0x68')][_0x1471('0x44')]);_0x42af88[_0x1471('0x47')]=_[_0x1471('0x46')](_0x23c228[_0x1471('0x47')]);_0x42af88[_0x1471('0x48')]=_[_0x1471('0x49')](_0x42af88[_0x1471('0x45')],_0x42af88[_0x1471('0x47')]);_0x42532f[_0x1471('0x4a')]=_[_0x1471('0x49')](_0x42af88['model'],qs[_0x1471('0x60')](_0x23c228[_0x1471('0x47')]['fields']));_0x42532f[_0x1471('0x4a')]=_0x42532f[_0x1471('0x4a')][_0x1471('0x4b')]?_0x42532f[_0x1471('0x4a')]:_0x42af88[_0x1471('0x45')];if(!_0x23c228[_0x1471('0x47')][_0x1471('0x4c')](_0x1471('0x6b'))){_0x42532f[_0x1471('0x4d')]=qs['limit'](_0x23c228[_0x1471('0x47')]['limit']);_0x42532f[_0x1471('0x31')]=qs[_0x1471('0x31')](_0x23c228[_0x1471('0x47')][_0x1471('0x31')]);}_0x42532f[_0x1471('0x4e')]=qs['sort'](_0x23c228[_0x1471('0x47')]['sort']);_0x42532f[_0x1471('0x50')]=qs['filters'](_['pick'](_0x23c228[_0x1471('0x47')],_0x42af88[_0x1471('0x48')]));_0x42532f[_0x1471('0x50')]['MailAccountId']=_0x350487['id'];if(_0x23c228[_0x1471('0x47')][_0x1471('0x58')]){_0x42532f[_0x1471('0x50')]=_[_0x1471('0x52')](_0x42532f['where'],{'$or':_['map'](_0x42532f[_0x1471('0x4a')],function(_0x53a76e){var _0x21fd77={};_0x21fd77[_0x53a76e]={'$like':'%'+_0x23c228[_0x1471('0x47')][_0x1471('0x58')]+'%'};return _0x21fd77;})});}_0x42532f=_[_0x1471('0x52')]({},_0x42532f,_0x23c228[_0x1471('0x59')]);return db['Disposition'][_0x1471('0x30')]({'where':_0x42532f['where']})[_0x1471('0x23')](function(_0x20b249){_0x258033['count']=_0x20b249;if(_0x23c228[_0x1471('0x47')][_0x1471('0x5a')]){_0x42532f[_0x1471('0x61')]=[{'all':!![]}];}return db['Disposition'][_0x1471('0x5b')](_0x42532f);})[_0x1471('0x23')](function(_0x4a7c34){_0x258033[_0x1471('0x5c')]=_0x4a7c34;return _0x258033;});}})[_0x1471('0x23')](respondWithFilteredResult(_0x4fc089,_0x42532f))[_0x1471('0x5d')](handleError(_0x4fc089,null));};exports[_0x1471('0x6c')]=function(_0x1a0d9a,_0x17a223,_0x5664a3){return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x1a0d9a['params']['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x17a223,null))['then'](function(_0x597117){if(_0x597117){return _0x597117[_0x1471('0x6c')](_0x1a0d9a['query'][_0x1471('0x6d')]);}})[_0x1471('0x23')](respondWithStatusCode(_0x17a223,null))['catch'](handleError(_0x17a223,null));};exports[_0x1471('0x6e')]=function(_0x1ba4ba,_0x365992,_0x567bc9){if(_0x1ba4ba[_0x1471('0x62')]['id']){delete _0x1ba4ba['body']['id'];}return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x1ba4ba[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x365992,null))[_0x1471('0x23')](function(_0x49061d){if(_0x49061d){_0x1ba4ba[_0x1471('0x62')]['MailAccountId']=_0x49061d['id'];return db['CannedAnswer'][_0x1471('0x69')](_0x1ba4ba[_0x1471('0x62')]);}})[_0x1471('0x23')](respondWithResult(_0x365992,null))[_0x1471('0x5d')](handleError(_0x365992,null));};exports[_0x1471('0x6f')]=function(_0x5581aa,_0x15c3cd,_0x1e2967){var _0x36ae5a={'raw':![],'where':{}};var _0x55c4ad={};var _0x4ed392={'count':0x0,'rows':[]};return db[_0x1471('0x43')][_0x1471('0x70')]({'where':{'id':_0x5581aa['params']['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x15c3cd,null))[_0x1471('0x23')](function(_0x2cd747){if(_0x2cd747){_0x55c4ad['model']=_[_0x1471('0x46')](db['CannedAnswer']['rawAttributes']);_0x55c4ad['query']=_[_0x1471('0x46')](_0x5581aa[_0x1471('0x47')]);_0x55c4ad[_0x1471('0x48')]=_['intersection'](_0x55c4ad['model'],_0x55c4ad[_0x1471('0x47')]);_0x36ae5a[_0x1471('0x4a')]=_['intersection'](_0x55c4ad['model'],qs['fields'](_0x5581aa[_0x1471('0x47')][_0x1471('0x60')]));_0x36ae5a[_0x1471('0x4a')]=_0x36ae5a[_0x1471('0x4a')][_0x1471('0x4b')]?_0x36ae5a[_0x1471('0x4a')]:_0x55c4ad[_0x1471('0x45')];if(!_0x5581aa[_0x1471('0x47')]['hasOwnProperty'](_0x1471('0x6b'))){_0x36ae5a[_0x1471('0x4d')]=qs['limit'](_0x5581aa[_0x1471('0x47')][_0x1471('0x4d')]);_0x36ae5a[_0x1471('0x31')]=qs[_0x1471('0x31')](_0x5581aa[_0x1471('0x47')][_0x1471('0x31')]);}_0x36ae5a[_0x1471('0x4e')]=qs[_0x1471('0x4f')](_0x5581aa[_0x1471('0x47')][_0x1471('0x4f')]);_0x36ae5a[_0x1471('0x50')]=qs['filters'](_['pick'](_0x5581aa[_0x1471('0x47')],_0x55c4ad['filters']));_0x36ae5a[_0x1471('0x50')][_0x1471('0x67')]=_0x2cd747['id'];if(_0x5581aa[_0x1471('0x47')]['filter']){_0x36ae5a[_0x1471('0x50')]=_[_0x1471('0x52')](_0x36ae5a[_0x1471('0x50')],{'$or':_['map'](_0x36ae5a[_0x1471('0x4a')],function(_0x3a89f7){var _0x497cd8={};_0x497cd8[_0x3a89f7]={'$like':'%'+_0x5581aa[_0x1471('0x47')][_0x1471('0x58')]+'%'};return _0x497cd8;})});}_0x36ae5a=_[_0x1471('0x52')]({},_0x36ae5a,_0x5581aa['options']);return db[_0x1471('0x71')][_0x1471('0x30')]({'where':_0x36ae5a[_0x1471('0x50')]})[_0x1471('0x23')](function(_0x1f69bf){_0x4ed392['count']=_0x1f69bf;if(_0x5581aa[_0x1471('0x47')][_0x1471('0x5a')]){_0x36ae5a[_0x1471('0x61')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1471('0x5b')](_0x36ae5a);})[_0x1471('0x23')](function(_0x441cd4){_0x4ed392[_0x1471('0x5c')]=_0x441cd4;return _0x4ed392;});}})[_0x1471('0x23')](respondWithFilteredResult(_0x15c3cd,_0x36ae5a))[_0x1471('0x5d')](handleError(_0x15c3cd,null));};exports['removeAnswers']=function(_0x58261e,_0x7769ba,_0x4cec41){return db['MailAccount']['find']({'where':{'id':_0x58261e[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x7769ba,null))[_0x1471('0x23')](function(_0x1f8e11){if(_0x1f8e11){return _0x1f8e11[_0x1471('0x72')](_0x58261e[_0x1471('0x47')][_0x1471('0x6d')]);}})[_0x1471('0x23')](respondWithStatusCode(_0x7769ba,null))['catch'](handleError(_0x7769ba,null));};exports['create']=function(_0x4507f6,_0x2f33c2){var _0x16dccf={'name':_0x4507f6[_0x1471('0x62')]['name'],'key':_0x4507f6[_0x1471('0x62')][_0x1471('0x55')],'email':_0x4507f6['body'][_0x1471('0x73')],'ListId':_0x4507f6[_0x1471('0x62')][_0x1471('0x74')],'active':!_[_0x1471('0x75')](_0x4507f6[_0x1471('0x62')][_0x1471('0x76')])?_0x4507f6[_0x1471('0x62')]['active']:!![],'description':_0x4507f6[_0x1471('0x62')][_0x1471('0x77')]||null,'Imap':{},'Smtp':{}};if(_[_0x1471('0x75')](_0x4507f6[_0x1471('0x62')][_0x1471('0x78')])){if(_0x4507f6[_0x1471('0x62')]['cauthentication']){_0x16dccf[_0x1471('0x5f')][_0x1471('0x79')]=_0x16dccf[_0x1471('0x40')][_0x1471('0x79')]=_0x4507f6[_0x1471('0x62')][_0x1471('0x7a')];_0x16dccf[_0x1471('0x5f')][_0x1471('0x7b')]=_0x16dccf[_0x1471('0x40')][_0x1471('0x7c')]=_0x4507f6['body'][_0x1471('0x7d')];}else{_0x16dccf['Imap'][_0x1471('0x7e')]=_0x16dccf[_0x1471('0x40')][_0x1471('0x7e')]=![];}_0x16dccf[_0x1471('0x5f')][_0x1471('0x7f')]=_0x4507f6[_0x1471('0x62')][_0x1471('0x5f')][_0x1471('0x7f')];_0x16dccf[_0x1471('0x5f')][_0x1471('0x80')]=_0x4507f6[_0x1471('0x62')][_0x1471('0x5f')][_0x1471('0x80')];_0x16dccf[_0x1471('0x40')][_0x1471('0x7f')]=_0x4507f6[_0x1471('0x62')][_0x1471('0x40')][_0x1471('0x7f')];_0x16dccf[_0x1471('0x40')][_0x1471('0x80')]=_0x4507f6[_0x1471('0x62')][_0x1471('0x40')]['port'];}else{_0x16dccf['Imap'][_0x1471('0x81')]=_0x16dccf[_0x1471('0x40')][_0x1471('0x81')]=_0x4507f6[_0x1471('0x62')][_0x1471('0x78')];_0x16dccf['Imap'][_0x1471('0x79')]=_0x16dccf[_0x1471('0x40')][_0x1471('0x79')]=_0x4507f6[_0x1471('0x62')][_0x1471('0x7a')];_0x16dccf[_0x1471('0x5f')][_0x1471('0x7b')]=_0x16dccf[_0x1471('0x40')]['pass']=_0x4507f6[_0x1471('0x62')]['cpassword'];}return db['MailAccount'][_0x1471('0x69')](_0x16dccf,{'include':[{'model':db[_0x1471('0x3f')],'as':'Smtp'},{'model':db[_0x1471('0x3e')],'as':_0x1471('0x5f')}]})['then'](function(_0x4c7c0e){var _0x49d97a=_0x4507f6[_0x1471('0x79')][_0x1471('0x39')]({'plain':!![]});if(!_0x49d97a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49d97a[_0x1471('0x82')]===_0x1471('0x79')){var _0x2b3a00=_0x4c7c0e[_0x1471('0x39')]({'plain':!![]});return db[_0x1471('0x83')]['find']({'where':{'name':_0x1471('0x3a'),'userProfileId':_0x49d97a[_0x1471('0x84')]},'raw':!![]})[_0x1471('0x23')](function(_0x3adc0f){if(_0x3adc0f&&_0x3adc0f['autoAssociation']===0x0){return db[_0x1471('0x3b')]['create']({'name':_0x2b3a00['name'],'resourceId':_0x2b3a00['id'],'type':_0x3adc0f[_0x1471('0x3c')],'sectionId':_0x3adc0f['id']},{})[_0x1471('0x23')](function(){return _0x4c7c0e;});}else{return _0x4c7c0e;}})['catch'](function(_0x676834){logger[_0x1471('0x29')](_0x1471('0x85'),_0x676834);throw _0x676834;});}return _0x4c7c0e;})['then'](respondWithResult(_0x2f33c2,0xc9))[_0x1471('0x5d')](handleError(_0x2f33c2,null));};exports[_0x1471('0x86')]=function(_0x5caaac,_0x274e9a,_0x5bed51){return db[_0x1471('0x43')]['findOne']({'where':{'id':_0x5caaac[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x274e9a,null))[_0x1471('0x23')](function(_0x3d5493){if(_0x3d5493){return _0x3d5493[_0x1471('0x86')]();}return null;})[_0x1471('0x23')](respondWithResult(_0x274e9a,null))[_0x1471('0x5d')](handleError(_0x274e9a,null));};exports[_0x1471('0x87')]=function(_0x3ea704,_0x13e035,_0x422b97){if(_0x3ea704[_0x1471('0x62')]['id']){delete _0x3ea704[_0x1471('0x62')]['id'];}return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x3ea704[_0x1471('0x64')]['id']}})['then'](handleEntityNotFound(_0x13e035,null))['then'](function(_0x238c7f){if(_0x238c7f){_0x3ea704['body']['MailAccountId']=_0x238c7f['id'];return db[_0x1471('0x3e')]['create'](_0x3ea704[_0x1471('0x62')]);}})['then'](respondWithResult(_0x13e035,null))[_0x1471('0x5d')](handleError(_0x13e035,null));};exports[_0x1471('0x88')]=function(_0x5e28b8,_0x4fd173,_0x891be3){return db[_0x1471('0x43')][_0x1471('0x70')]({'where':{'id':_0x5e28b8[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x4fd173,null))[_0x1471('0x23')](function(_0x47a00e){if(_0x47a00e){return _0x47a00e[_0x1471('0x89')](null);}return null;})['then'](respondWithStatusCode(_0x4fd173,null))[_0x1471('0x5d')](handleError(_0x4fd173,null));};exports[_0x1471('0x8a')]=function(_0x548f04,_0x1f4fd5,_0x2d7bbb){return db[_0x1471('0x43')][_0x1471('0x70')]({'where':{'id':_0x548f04[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x1f4fd5,null))['then'](function(_0x3e8acf){if(_0x3e8acf){return _0x3e8acf[_0x1471('0x8a')]();}return null;})['then'](respondWithResult(_0x1f4fd5,null))[_0x1471('0x5d')](handleError(_0x1f4fd5,null));};exports[_0x1471('0x8b')]=function(_0x35cd39,_0x2fe52a,_0x4fbae1){if(_0x35cd39['body']['id']){delete _0x35cd39[_0x1471('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x35cd39[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x2fe52a,null))[_0x1471('0x23')](function(_0x4b14eb){if(_0x4b14eb){_0x35cd39[_0x1471('0x62')][_0x1471('0x67')]=_0x4b14eb['id'];return db[_0x1471('0x3f')][_0x1471('0x69')](_0x35cd39[_0x1471('0x62')]);}})[_0x1471('0x23')](respondWithResult(_0x2fe52a,null))[_0x1471('0x5d')](handleError(_0x2fe52a,null));};exports['removeSmtp']=function(_0xd37c2a,_0x3bcf75,_0x58bcc1){return db[_0x1471('0x43')]['findOne']({'where':{'id':_0xd37c2a[_0x1471('0x64')]['id']}})['then'](handleEntityNotFound(_0x3bcf75,null))[_0x1471('0x23')](function(_0xcbc0ba){if(_0xcbc0ba){return _0xcbc0ba[_0x1471('0x8c')](null);}return null;})[_0x1471('0x23')](respondWithStatusCode(_0x3bcf75,null))['catch'](handleError(_0x3bcf75,null));};exports[_0x1471('0x8d')]=function(_0x4a1920,_0x2f1320,_0xc1aa60){return db[_0x1471('0x8e')][_0x1471('0x63')]({'where':{'id':_0x4a1920[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x2f1320,null))[_0x1471('0x23')](function(_0x344c26){if(_0x344c26){return _0x344c26[_0x1471('0x8d')](_0x4a1920[_0x1471('0x62')][_0x1471('0x6d')],_[_0x1471('0x8f')](_0x4a1920[_0x1471('0x62')],[_0x1471('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x2f1320,null))[_0x1471('0x5d')](handleError(_0x2f1320,null));};exports[_0x1471('0x90')]=function(_0xdd4c39,_0x3706bd,_0x807c28){var _0x13635c={'raw':![],'where':{}};var _0x5a7c66={};var _0x464679={'count':0x0,'rows':[]};return db[_0x1471('0x43')][_0x1471('0x70')]({'where':{'id':_0xdd4c39[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x3706bd,null))[_0x1471('0x23')](function(_0x3ba537){if(_0x3ba537){_0x5a7c66[_0x1471('0x45')]=_[_0x1471('0x46')](db[_0x1471('0x8e')][_0x1471('0x44')]);_0x5a7c66['query']=_[_0x1471('0x46')](_0xdd4c39[_0x1471('0x47')]);_0x5a7c66[_0x1471('0x48')]=_['intersection'](_0x5a7c66['model'],_0x5a7c66[_0x1471('0x47')]);_0x13635c[_0x1471('0x4a')]=_[_0x1471('0x49')](_0x5a7c66[_0x1471('0x45')],qs[_0x1471('0x60')](_0xdd4c39[_0x1471('0x47')][_0x1471('0x60')]));_0x13635c[_0x1471('0x4a')]=_0x13635c[_0x1471('0x4a')][_0x1471('0x4b')]?_0x13635c[_0x1471('0x4a')]:_0x5a7c66[_0x1471('0x45')];if(!_0xdd4c39['query'][_0x1471('0x4c')]('nolimit')){_0x13635c['limit']=qs[_0x1471('0x4d')](_0xdd4c39['query']['limit']);_0x13635c[_0x1471('0x31')]=qs[_0x1471('0x31')](_0xdd4c39[_0x1471('0x47')][_0x1471('0x31')]);}_0x13635c[_0x1471('0x4e')]=qs['sort'](_0xdd4c39[_0x1471('0x47')][_0x1471('0x4f')]);_0x13635c[_0x1471('0x50')]=qs['filters'](_[_0x1471('0x51')](_0xdd4c39[_0x1471('0x47')],_0x5a7c66['filters']));_0x13635c[_0x1471('0x50')]['MailAccountId']=_0x3ba537['id'];if(_0xdd4c39[_0x1471('0x47')][_0x1471('0x58')]){_0x13635c['where']=_[_0x1471('0x52')](_0x13635c['where'],{'$or':_[_0x1471('0x53')](_0x13635c[_0x1471('0x4a')],function(_0x53c462){var _0x4116c6={};_0x4116c6[_0x53c462]={'$like':'%'+_0xdd4c39[_0x1471('0x47')][_0x1471('0x58')]+'%'};return _0x4116c6;})});}_0x13635c=_[_0x1471('0x52')]({},_0x13635c,_0xdd4c39['options']);return db['MailInteraction'][_0x1471('0x30')]({'where':_0x13635c[_0x1471('0x50')]})[_0x1471('0x23')](function(_0x3175fa){_0x464679[_0x1471('0x30')]=_0x3175fa;if(_0xdd4c39[_0x1471('0x47')][_0x1471('0x5a')]){_0x13635c[_0x1471('0x61')]=[{'model':db[_0x1471('0x91')],'as':_0x1471('0x92'),'required':![]},{'model':db['User'],'as':_0x1471('0x93'),'attributes':[_0x1471('0x3c'),'fullname',_0x1471('0x94')],'required':![]},{'model':db[_0x1471('0x95')],'as':'Tags','attributes':['id',_0x1471('0x3c'),_0x1471('0x96')],'where':_0xdd4c39[_0x1471('0x47')][_0x1471('0x97')]?{'id':_0xdd4c39['query']['tag']}:undefined,'required':_0xdd4c39[_0x1471('0x47')][_0x1471('0x97')]?!![]:![]}];}return db['MailInteraction'][_0x1471('0x5b')](_0x13635c);})[_0x1471('0x23')](function(_0x5b472c){_0x464679['rows']=_0x5b472c;return _0x464679;});}})[_0x1471('0x23')](respondWithFilteredResult(_0x3706bd,_0x13635c))['catch'](handleError(_0x3706bd,null));};exports[_0x1471('0x98')]=function(_0x5889a5,_0x45691b,_0x3ebda6){return db['MailAccount']['findOne']({'where':{'id':_0x5889a5[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x45691b,null))[_0x1471('0x23')](function(_0x1a2d11){if(_0x1a2d11){return db[_0x1471('0x99')][_0x1471('0x9a')](function(_0x304ce3){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x5889a5[_0x1471('0x64')]['id']},'transaction':_0x304ce3})[_0x1471('0x23')](function(_0x424844){var _0x11c860=_[_0x1471('0x53')](_0x5889a5[_0x1471('0x62')],function(_0x4ae289){_0x4ae289[_0x1471('0x67')]=_0x5889a5['params']['id'];return _0x4ae289;});return db[_0x1471('0x9b')][_0x1471('0x9c')](_0x11c860,{'transaction':_0x304ce3});});})[_0x1471('0x23')](function(){return db[_0x1471('0x9b')][_0x1471('0x9d')]({'where':{'MailAccountId':_0x5889a5[_0x1471('0x64')]['id']},'order':_0x1471('0x9e')});});}})[_0x1471('0x23')](respondWithResult(_0x45691b,null))[_0x1471('0x5d')](handleError(_0x45691b,null));};exports[_0x1471('0x9f')]=function(_0x1a2912,_0x3d34d9,_0x3ebf89){var _0x2f6cb2={};var _0x2eb0e9={};var _0x5f1f7d;var _0x114d3b;return db[_0x1471('0x43')][_0x1471('0x70')]({'where':{'id':_0x1a2912[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x3d34d9,null))[_0x1471('0x23')](function(_0x49caf7){if(_0x49caf7){_0x5f1f7d=_0x49caf7;_0x2eb0e9[_0x1471('0x45')]=_[_0x1471('0x46')](db['MailApplication'][_0x1471('0x44')]);_0x2eb0e9['query']=_[_0x1471('0x46')](_0x1a2912['query']);_0x2eb0e9[_0x1471('0x48')]=_[_0x1471('0x49')](_0x2eb0e9[_0x1471('0x45')],_0x2eb0e9[_0x1471('0x47')]);_0x2f6cb2[_0x1471('0x4a')]=_[_0x1471('0x49')](_0x2eb0e9['model'],qs[_0x1471('0x60')](_0x1a2912[_0x1471('0x47')]['fields']));_0x2f6cb2[_0x1471('0x4a')]=_0x2f6cb2[_0x1471('0x4a')][_0x1471('0x4b')]?_0x2f6cb2['attributes']:_0x2eb0e9[_0x1471('0x45')];_0x2f6cb2['order']=qs[_0x1471('0x4f')](_0x1a2912['query']['sort']);_0x2f6cb2[_0x1471('0x50')]=qs[_0x1471('0x48')](_[_0x1471('0x51')](_0x1a2912[_0x1471('0x47')],_0x2eb0e9['filters']));if(_0x1a2912[_0x1471('0x47')][_0x1471('0x58')]){_0x2f6cb2[_0x1471('0x50')]=_[_0x1471('0x52')](_0x2f6cb2['where'],{'$or':_['map'](_0x2f6cb2['attributes'],function(_0x3c75c9){var _0xd83edd={};_0xd83edd[_0x3c75c9]={'$like':'%'+_0x1a2912[_0x1471('0x47')][_0x1471('0x58')]+'%'};return _0xd83edd;})});}_0x2f6cb2=_[_0x1471('0x52')]({},_0x2f6cb2,_0x1a2912['options']);return _0x5f1f7d[_0x1471('0x9f')](_0x2f6cb2);}})[_0x1471('0x23')](function(_0x11d204){if(_0x11d204){_0x114d3b=_0x11d204[_0x1471('0x4b')];if(!_0x1a2912[_0x1471('0x47')][_0x1471('0x4c')](_0x1471('0x6b'))){_0x2f6cb2[_0x1471('0x4d')]=qs[_0x1471('0x4d')](_0x1a2912[_0x1471('0x47')]['limit']);_0x2f6cb2[_0x1471('0x31')]=qs[_0x1471('0x31')](_0x1a2912[_0x1471('0x47')][_0x1471('0x31')]);}return _0x5f1f7d['getApplications'](_0x2f6cb2);}})[_0x1471('0x23')](function(_0x5542a6){if(_0x5542a6){return _0x5542a6?{'count':_0x114d3b,'rows':_0x5542a6}:null;}})[_0x1471('0x23')](respondWithResult(_0x3d34d9,null))['catch'](handleError(_0x3d34d9,null));};exports[_0x1471('0xa0')]=function(_0x334896,_0x54b3b8,_0x190865){var _0x13341a={'raw':!![],'where':{}};var _0x68a97f={};var _0x49b4ae={'count':0x0,'rows':[]};return db[_0x1471('0x43')][_0x1471('0x70')]({'where':{'id':_0x334896[_0x1471('0x64')]['id']}})['then'](handleEntityNotFound(_0x54b3b8,null))[_0x1471('0x23')](function(_0x16cadb){if(_0x16cadb){_0x68a97f[_0x1471('0x45')]=_[_0x1471('0x46')](db[_0x1471('0xa1')][_0x1471('0x44')]);_0x68a97f[_0x1471('0x47')]=_[_0x1471('0x46')](_0x334896[_0x1471('0x47')]);_0x68a97f[_0x1471('0x48')]=_[_0x1471('0x49')](_0x68a97f[_0x1471('0x45')],_0x68a97f[_0x1471('0x47')]);_0x13341a['attributes']=_[_0x1471('0x49')](_0x68a97f[_0x1471('0x45')],qs['fields'](_0x334896[_0x1471('0x47')][_0x1471('0x60')]));_0x13341a[_0x1471('0x4a')]=_0x13341a[_0x1471('0x4a')][_0x1471('0x4b')]?_0x13341a['attributes']:_0x68a97f[_0x1471('0x45')];if(!_0x334896[_0x1471('0x47')][_0x1471('0x4c')](_0x1471('0x6b'))){_0x13341a[_0x1471('0x4d')]=qs[_0x1471('0x4d')](_0x334896[_0x1471('0x47')][_0x1471('0x4d')]);_0x13341a[_0x1471('0x31')]=qs['offset'](_0x334896[_0x1471('0x47')]['offset']);}_0x13341a[_0x1471('0x4e')]=qs['sort'](_0x334896[_0x1471('0x47')][_0x1471('0x4f')]);_0x13341a[_0x1471('0x50')]=qs[_0x1471('0x48')](_[_0x1471('0x51')](_0x334896[_0x1471('0x47')],_0x68a97f[_0x1471('0x48')]));_0x13341a[_0x1471('0x50')][_0x1471('0x67')]=_0x16cadb['id'];if(_0x334896[_0x1471('0x47')][_0x1471('0x58')]){_0x13341a['where']=_['merge'](_0x13341a[_0x1471('0x50')],{'$or':_[_0x1471('0x53')](_0x13341a[_0x1471('0x4a')],function(_0x5e2cf2){var _0x21a8d3={};_0x21a8d3[_0x5e2cf2]={'$like':'%'+_0x334896[_0x1471('0x47')][_0x1471('0x58')]+'%'};return _0x21a8d3;})});}if(_0x334896['query'][_0x1471('0xa2')]){var _0x6a6209=_0x334896[_0x1471('0x47')][_0x1471('0xa2')]['split'](',');var _0x2ebbff={};_0x2ebbff[_0x6a6209[0x0]]={'$gte':moment(_0x6a6209[0x1])['format'](_0x1471('0xa3'))};_0x13341a[_0x1471('0x50')]=_['merge'](_0x13341a[_0x1471('0x50')],_0x2ebbff);}_0x13341a=_['merge']({},_0x13341a,_0x334896[_0x1471('0x59')]);return db['MailMessage'][_0x1471('0x30')]({'where':_0x13341a[_0x1471('0x50')]})[_0x1471('0x23')](function(_0x5c24a1){_0x49b4ae[_0x1471('0x30')]=_0x5c24a1;if(_0x334896['query'][_0x1471('0x5a')]){_0x13341a['include']=[{'all':!![]}];}return db[_0x1471('0xa1')][_0x1471('0x5b')](_0x13341a);})[_0x1471('0x23')](function(_0x3fe47d){_0x49b4ae[_0x1471('0x5c')]=_0x3fe47d;return _0x49b4ae;});}})[_0x1471('0x23')](respondWithFilteredResult(_0x54b3b8,_0x13341a))[_0x1471('0x5d')](handleError(_0x54b3b8,null));};exports[_0x1471('0x3d')]=function(_0x3dff3c,_0xa97a86,_0x195898){var _0x2986bb,_0x30a5e5={},_0x412ed7;if(_0x3dff3c[_0x1471('0x62')]['to']){_0x412ed7=_0x3dff3c['body']['to']['split'](',')[0x0];}return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x3dff3c[_0x1471('0x64')]['id']},'include':[{'model':db[_0x1471('0xa4')],'as':'List','include':[{'model':db[_0x1471('0x91')],'as':_0x1471('0xa5'),'where':{'email':_0x412ed7},'limit':0x1,'order':[[_0x1471('0xa6'),'DESC']]}]},{'model':db[_0x1471('0x3f')],'as':_0x1471('0x40'),'raw':!![]}]})[_0x1471('0x23')](handleEntityNotFound(_0xa97a86,null))[_0x1471('0x23')](function(_0x406837){if(_0x406837){_0x2986bb=_0x406837;if(_0x406837[_0x1471('0x40')]){if(_[_0x1471('0x75')](_0x3dff3c[_0x1471('0x62')]['from'])){_0x3dff3c[_0x1471('0x62')][_0x1471('0xa7')]=util[_0x1471('0xa8')]('%s\x20<%s>',_0x406837['name'],_0x406837[_0x1471('0x73')]||_0x406837[_0x1471('0x40')][_0x1471('0x79')]);}if(_0x3dff3c['body'][_0x1471('0xa9')]&&_0x3dff3c[_0x1471('0x62')][_0x1471('0xa9')]['length']){for(var _0x1882e4=0x0;_0x1882e4<_0x3dff3c[_0x1471('0x62')][_0x1471('0xa9')]['length'];_0x1882e4+=0x1){_0x3dff3c[_0x1471('0x62')]['attachments'][_0x1882e4]={'filename':_0x3dff3c[_0x1471('0x62')]['attachments'][_0x1882e4]['name'],'path':path[_0x1471('0xaa')](config[_0x1471('0xab')],_0x1471('0xac'),_0x3dff3c[_0x1471('0x62')][_0x1471('0xa9')][_0x1882e4][_0x1471('0xad')])};}}var _0x5b699f={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x406837['Smtp']['service'])){if(_0x406837['Smtp'][_0x1471('0x7e')]){_0x5b699f['auth']={'user':_0x406837[_0x1471('0x40')][_0x1471('0x79')],'pass':_0x406837[_0x1471('0x40')][_0x1471('0x7c')]};}_0x5b699f[_0x1471('0x7f')]=_0x406837[_0x1471('0x40')][_0x1471('0x7f')];_0x5b699f[_0x1471('0x80')]=_0x406837[_0x1471('0x40')][_0x1471('0x80')];_0x5b699f[_0x1471('0xae')]=_0x406837[_0x1471('0x40')]['secure'];}else{_0x5b699f[_0x1471('0x81')]=_0x406837[_0x1471('0x40')][_0x1471('0x81')];_0x5b699f[_0x1471('0xaf')]={'user':_0x406837[_0x1471('0x40')][_0x1471('0x79')],'pass':_0x406837['Smtp']['pass']};}return respondWithRpcPromise(_0x1471('0xb0'),_0x1471('0xb1'),{'account':_0x5b699f,'message':_0x3dff3c['body']});}else{throw new Error(_0x1471('0xb2'));}}})[_0x1471('0x23')](function(_0x4c6c7b){if(_0x4c6c7b){_0x30a5e5=_0x4c6c7b;if(_0x2986bb[_0x1471('0xb3')]){if(_0x2986bb[_0x1471('0xb3')][_0x1471('0xa5')]['length']){return _0x2986bb[_0x1471('0xb3')][_0x1471('0xa5')][0x0];}else{return db['CmContact'][_0x1471('0x69')](_['defaults'](_0x3dff3c[_0x1471('0x62')],{'firstName':_0x3dff3c[_0x1471('0x62')]['to'],'email':_0x3dff3c[_0x1471('0x62')]['to'],'phone':_0x3dff3c[_0x1471('0x62')]['to'],'ListId':_0x2986bb['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0x1471('0x23')](function(_0x5b2c11){if(_0x5b2c11){var _0x31cd27={'UserId':_0x3dff3c[_0x1471('0x79')]['id'],'ContactId':_0x5b2c11['id'],'MailAccountId':_0x2986bb['id'],'inReplyTo':_0x30a5e5[_0x1471('0xb4')],'to':_0x3dff3c[_0x1471('0x62')][_0x1471('0xa7')],'cc':_0x3dff3c[_0x1471('0x62')]['cc'],'subject':_0x3dff3c['body'][_0x1471('0xb5')],'attach':_0x3dff3c[_0x1471('0x62')][_0x1471('0xb6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x1471('0xa8')](_0x1471('0xa3')),'lastMsgDirection':_0x1471('0xb7'),'lastMsgBody':_0x3dff3c['body']['body'],'Messages':[_[_0x1471('0x52')](_0x3dff3c['body'],{'messageId':_0x30a5e5['messageId'],'sentAt':moment()[_0x1471('0xa8')](_0x1471('0xa3')),'read':!![],'MailAccountId':_0x2986bb['id'],'UserId':_0x3dff3c[_0x1471('0x79')]['id'],'ContactId':_0x5b2c11['id']})]};if(_0x3dff3c['body']['Interaction']){_0x31cd27=_[_0x1471('0x52')](_0x31cd27,_0x3dff3c['body']['Interaction']);}return db[_0x1471('0x8e')][_0x1471('0x69')](_0x31cd27,{'include':[{'model':db[_0x1471('0xa1')],'as':_0x1471('0xb8')}]});}})[_0x1471('0x23')](respondWithResult(_0xa97a86,null))[_0x1471('0x5d')](handleError(_0xa97a86,null));};exports[_0x1471('0xb9')]=function(_0x53ef6e,_0x38c161,_0x4b0680){return db['MailAccount'][_0x1471('0x63')]({'where':{'id':_0x53ef6e[_0x1471('0x64')]['id']},'include':[{'model':db[_0x1471('0x3f')],'as':_0x1471('0x40'),'raw':!![]}]})[_0x1471('0x23')](handleEntityNotFound(_0x38c161,null))['then'](function(_0x4a6c30){if(_0x4a6c30&&_0x4a6c30[_0x1471('0x40')]){var _0x39d4e1={'id':_0x4a6c30['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4a6c30[_0x1471('0x40')][_0x1471('0x81')]){_0x39d4e1[_0x1471('0x81')]=_0x4a6c30[_0x1471('0x40')]['service'];}else{_0x39d4e1['host']=_0x4a6c30[_0x1471('0x40')][_0x1471('0x7f')];_0x39d4e1[_0x1471('0x80')]=_0x4a6c30[_0x1471('0x40')][_0x1471('0x80')];_0x39d4e1[_0x1471('0xae')]=_0x4a6c30[_0x1471('0x40')][_0x1471('0xae')];}if(_0x4a6c30[_0x1471('0x40')][_0x1471('0x7e')]){_0x39d4e1[_0x1471('0xaf')]={'user':_0x4a6c30[_0x1471('0x40')]['user'],'pass':_0x4a6c30['Smtp'][_0x1471('0x7c')]};}return respondWithRpcPromise(_0x1471('0xba'),_0x1471('0xb9'),{'account':_0x39d4e1});}})[_0x1471('0x23')](respondWithResult(_0x38c161,null))[_0x1471('0x5d')](handleError(_0x38c161,null));};exports[_0x1471('0x38')]=function(_0x52d3ab,_0x29ea96){return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x52d3ab[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x29ea96,null))['then'](function(_0x5e38b0){if(_0x5e38b0&&_0x5e38b0[_0x1471('0x81')]){throw new db[(_0x1471('0xbb'))][(_0x1471('0xbc'))](_0x1471('0xbd'));}return _0x5e38b0;})[_0x1471('0x23')](removeEntity(_0x29ea96,null))[_0x1471('0x5d')](handleError(_0x29ea96,null));};exports[_0x1471('0xbe')]=function(_0x41fc56,_0x433f57,_0x214cb3){return db[_0x1471('0x43')][_0x1471('0x63')]({'where':{'id':_0x41fc56[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x433f57,null))[_0x1471('0x23')](function(_0x3cd149){if(_0x3cd149){return _0x3cd149[_0x1471('0xbe')](_0x41fc56['body'][_0x1471('0x6d')],_['omit'](_0x41fc56[_0x1471('0x62')],['ids','id'])||{})[_0x1471('0xbf')](function(_0x53f0f4){for(var _0x202397=0x0;_0x202397<_0x41fc56['body'][_0x1471('0x6d')][_0x1471('0x4b')];_0x202397+=0x1){socket['emit'](_0x1471('0xc0'),{'UserId':_0x41fc56[_0x1471('0x62')]['ids'][_0x202397],'MailAccountId':_0x41fc56[_0x1471('0x64')]['id']});}return _0x53f0f4;});}})[_0x1471('0x23')](respondWithResult(_0x433f57,null))[_0x1471('0x5d')](handleError(_0x433f57,null));};exports[_0x1471('0xc1')]=function(_0x1ba212,_0x5d5c1c,_0x1beda8){return db[_0x1471('0x43')]['find']({'where':{'id':_0x1ba212[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x5d5c1c,null))[_0x1471('0x23')](function(_0x29121d){if(_0x29121d){return _0x29121d['removeAgents'](_0x1ba212[_0x1471('0x47')][_0x1471('0x6d')])[_0x1471('0x23')](function(){if(_[_0x1471('0xc2')](_0x1ba212['query']['ids'])){for(var _0x5599f2=0x0;_0x5599f2<_0x1ba212[_0x1471('0x47')][_0x1471('0x6d')][_0x1471('0x4b')];_0x5599f2+=0x1){socket['emit'](_0x1471('0xc3'),{'UserId':Number(_0x1ba212[_0x1471('0x47')][_0x1471('0x6d')][_0x5599f2]),'MailAccountId':Number(_0x1ba212['params']['id'])});}}else{socket[_0x1471('0xc4')](_0x1471('0xc3'),{'UserId':Number(_0x1ba212[_0x1471('0x47')]['ids']),'MailAccountId':Number(_0x1ba212[_0x1471('0x64')]['id'])});}});}})[_0x1471('0x23')](respondWithStatusCode(_0x5d5c1c,null))[_0x1471('0x5d')](handleError(_0x5d5c1c,null));};exports[_0x1471('0xc5')]=function(_0x2ff9c4,_0x459234,_0x8ae3af){var _0x37047d={};var _0xa88db9={};var _0x4e5b07;var _0x57e35c;return db[_0x1471('0x43')]['findOne']({'where':{'id':_0x2ff9c4[_0x1471('0x64')]['id']}})[_0x1471('0x23')](handleEntityNotFound(_0x459234,null))[_0x1471('0x23')](function(_0x4145a1){if(_0x4145a1){_0x4e5b07=_0x4145a1;_0xa88db9[_0x1471('0x45')]=_[_0x1471('0x46')](db['User']['rawAttributes']);_0xa88db9[_0x1471('0x47')]=_[_0x1471('0x46')](_0x2ff9c4[_0x1471('0x47')]);_0xa88db9[_0x1471('0x48')]=_[_0x1471('0x49')](_0xa88db9[_0x1471('0x45')],_0xa88db9['query']);_0x37047d[_0x1471('0x4a')]=_[_0x1471('0x49')](_0xa88db9[_0x1471('0x45')],qs[_0x1471('0x60')](_0x2ff9c4[_0x1471('0x47')][_0x1471('0x60')]));_0x37047d[_0x1471('0x4a')]=_0x37047d['attributes']['length']?_0x37047d[_0x1471('0x4a')]:_0xa88db9[_0x1471('0x45')];_0x37047d['order']=qs[_0x1471('0x4f')](_0x2ff9c4[_0x1471('0x47')][_0x1471('0x4f')]);_0x37047d['where']=qs[_0x1471('0x48')](_['pick'](_0x2ff9c4[_0x1471('0x47')],_0xa88db9[_0x1471('0x48')]));if(_0x2ff9c4[_0x1471('0x47')][_0x1471('0x58')]){_0x37047d[_0x1471('0x50')]=_[_0x1471('0x52')](_0x37047d[_0x1471('0x50')],{'$or':_['map'](_0x37047d[_0x1471('0x4a')],function(_0x4d8aba){var _0xeb0fc0={};_0xeb0fc0[_0x4d8aba]={'$like':'%'+_0x2ff9c4[_0x1471('0x47')][_0x1471('0x58')]+'%'};return _0xeb0fc0;})});}_0x37047d=_[_0x1471('0x52')]({},_0x37047d,_0x2ff9c4[_0x1471('0x59')]);return _0x4e5b07[_0x1471('0xc5')](_0x37047d);}})[_0x1471('0x23')](function(_0x4b41f3){if(_0x4b41f3){_0x57e35c=_0x4b41f3[_0x1471('0x4b')];if(!_0x2ff9c4[_0x1471('0x47')][_0x1471('0x4c')](_0x1471('0x6b'))){_0x37047d['limit']=qs[_0x1471('0x4d')](_0x2ff9c4[_0x1471('0x47')]['limit']);_0x37047d['offset']=qs[_0x1471('0x31')](_0x2ff9c4[_0x1471('0x47')][_0x1471('0x31')]);}return _0x4e5b07[_0x1471('0xc5')](_0x37047d);}})[_0x1471('0x23')](function(_0x4dff33){if(_0x4dff33){return _0x4dff33?{'count':_0x57e35c,'rows':_0x4dff33}:null;}})[_0x1471('0x23')](respondWithResult(_0x459234,null))['catch'](handleError(_0x459234,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 47c9043..ec35a9b 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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 79c34a6..642e393 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 _0x04d5=['moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','lodash','util','api'];(function(_0x21b235,_0x52c304){var _0x1b7769=function(_0x4401f4){while(--_0x4401f4){_0x21b235['push'](_0x21b235['shift']());}};_0x1b7769(++_0x52c304);}(_0x04d5,0xe1));var _0x504d=function(_0x1ea648,_0x284513){_0x1ea648=_0x1ea648-0x0;var _0x2559ee=_0x04d5[_0x1ea648];return _0x2559ee;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var logger=require('../../config/logger')(_0x504d('0x2'));var moment=require(_0x504d('0x3'));var BPromise=require(_0x504d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x504d('0x5'));var rimraf=require(_0x504d('0x6'));var config=require(_0x504d('0x7'));var attributes=require(_0x504d('0x8'));module[_0x504d('0x9')]=function(_0x535671,_0x289d44){return _0x535671[_0x504d('0xa')](_0x504d('0xb'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x056b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x5edc6a,_0x450363){var _0x11106b=function(_0x113d8b){while(--_0x113d8b){_0x5edc6a['push'](_0x5edc6a['shift']());}};_0x11106b(++_0x450363);}(_0x056b,0xb6));var _0xb056=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0x056b[_0x2867a6];return _0x4afc2b;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index ed2cd6f..2d4c1a6 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 _0x4a80=['length','close','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','update','interaction','created','originCc','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowMailAccount','MailAccount','find','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','get','omit','applications','priority','asc','autoclose'];(function(_0x2d9b5b,_0x5123f7){var _0x3cd8f6=function(_0x37923a){while(--_0x37923a){_0x2d9b5b['push'](_0x2d9b5b['shift']());}};_0x3cd8f6(++_0x5123f7);}(_0x4a80,0x82));var _0x04a8=function(_0x3fee30,_0x4e9b06){_0x3fee30=_0x3fee30-0x0;var _0x8befec=_0x4a80[_0x3fee30];return _0x8befec;};'use strict';var _=require(_0x04a8('0x0'));var util=require(_0x04a8('0x1'));var moment=require('moment');var BPromise=require(_0x04a8('0x2'));var rs=require(_0x04a8('0x3'));var fs=require('fs');var Redis=require(_0x04a8('0x4'));var db=require(_0x04a8('0x5'))['db'];var utils=require(_0x04a8('0x6'));var logger=require(_0x04a8('0x7'))(_0x04a8('0x8'));var config=require(_0x04a8('0x9'));var jayson=require(_0x04a8('0xa'));var client=jayson['client'][_0x04a8('0xb')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0x04a8('0xc'),'port':0x18eb});var socket=require(_0x04a8('0xd'))(new Redis(config[_0x04a8('0xe')]));require(_0x04a8('0xf'))[_0x04a8('0x10')](socket);function respondWithRpcPromise(_0x1c3f06,_0x50f578,_0x3b8b03){return new BPromise(function(_0x3ae409,_0x33d870){return client['request'](_0x1c3f06,_0x3b8b03)[_0x04a8('0x11')](function(_0x5528a2){logger[_0x04a8('0x12')](_0x04a8('0x13'),_0x50f578,_0x04a8('0x14'));logger[_0x04a8('0x15')](_0x04a8('0x16'),_0x50f578,'request\x20sent',JSON[_0x04a8('0x17')](_0x5528a2));if(_0x5528a2[_0x04a8('0x18')]){if(_0x5528a2[_0x04a8('0x18')][_0x04a8('0x19')]===0x1f4){logger['error'](_0x04a8('0x13'),_0x50f578,_0x5528a2[_0x04a8('0x18')]['message']);return _0x33d870(_0x5528a2[_0x04a8('0x18')][_0x04a8('0x1a')]);}logger['error'](_0x04a8('0x13'),_0x50f578,_0x5528a2[_0x04a8('0x18')]['message']);return _0x3ae409(_0x5528a2[_0x04a8('0x18')]['message']);}else{logger[_0x04a8('0x12')](_0x04a8('0x13'),_0x50f578,_0x04a8('0x14'));_0x3ae409(_0x5528a2[_0x04a8('0x1b')][_0x04a8('0x1a')]);}})['catch'](function(_0x5b63d2){logger[_0x04a8('0x18')](_0x04a8('0x13'),_0x50f578,_0x5b63d2);_0x33d870(_0x5b63d2);});});}exports[_0x04a8('0x1c')]=function(_0xb75996){var _0x1ffc0a=this;return new Promise(function(_0x482e5f,_0xb2b57f){return db['MailAccount'][_0x04a8('0x1d')]({'raw':_0xb75996['options']?_0xb75996[_0x04a8('0x1e')][_0x04a8('0x1f')]===undefined?!![]:![]:!![],'where':_0xb75996[_0x04a8('0x1e')]?_0xb75996[_0x04a8('0x1e')][_0x04a8('0x20')]||null:null,'attributes':_0xb75996['options']?_0xb75996[_0x04a8('0x1e')][_0x04a8('0x21')]||null:null,'limit':_0xb75996[_0x04a8('0x1e')]?_0xb75996['options'][_0x04a8('0x22')]||null:null,'include':_0xb75996[_0x04a8('0x1e')]?_0xb75996[_0x04a8('0x1e')]['include']?_['map'](_0xb75996[_0x04a8('0x1e')][_0x04a8('0x23')],function(_0x42f491){return{'model':db[_0x42f491[_0x04a8('0x24')]],'as':_0x42f491['as'],'attributes':_0x42f491[_0x04a8('0x21')],'include':_0x42f491[_0x04a8('0x23')]?_[_0x04a8('0x25')](_0x42f491[_0x04a8('0x23')],function(_0x38863c){return{'model':db[_0x38863c['model']],'as':_0x38863c['as'],'attributes':_0x38863c[_0x04a8('0x21')],'include':_0x38863c['include']?_[_0x04a8('0x25')](_0x38863c['include'],function(_0x2f67eb){return{'model':db[_0x2f67eb[_0x04a8('0x24')]],'as':_0x2f67eb['as'],'attributes':_0x2f67eb[_0x04a8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x04a8('0x11')](function(_0xb5cc05){logger[_0x04a8('0x12')](_0x04a8('0x1c'),_0xb75996);logger[_0x04a8('0x15')](_0x04a8('0x1c'),_0xb75996,JSON['stringify'](_0xb5cc05));_0x482e5f(_0xb5cc05);})[_0x04a8('0x26')](function(_0x4338b7){logger[_0x04a8('0x18')](_0x04a8('0x1c'),_0x4338b7[_0x04a8('0x1a')],_0xb75996);_0xb2b57f(_0x1ffc0a['error'](0x1f4,_0x4338b7[_0x04a8('0x1a')]));});});};exports[_0x04a8('0x27')]=function(_0x4ce009){var _0x38b4d6=this;return new Promise(function(_0x3359b6,_0x42b832){return db[_0x04a8('0x28')][_0x04a8('0x29')]({'raw':_0x4ce009[_0x04a8('0x1e')]?_0x4ce009[_0x04a8('0x1e')][_0x04a8('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ce009[_0x04a8('0x1e')]?_0x4ce009[_0x04a8('0x1e')][_0x04a8('0x20')]||null:null,'attributes':_0x4ce009[_0x04a8('0x1e')]?_0x4ce009['options'][_0x04a8('0x21')]||null:null,'include':_0x4ce009['options']?_0x4ce009[_0x04a8('0x1e')][_0x04a8('0x23')]?_['map'](_0x4ce009[_0x04a8('0x1e')][_0x04a8('0x23')],function(_0x2caa80){return{'model':db[_0x2caa80[_0x04a8('0x24')]],'as':_0x2caa80['as'],'attributes':_0x2caa80[_0x04a8('0x21')],'include':_0x2caa80[_0x04a8('0x23')]?_[_0x04a8('0x25')](_0x2caa80[_0x04a8('0x23')],function(_0x636375){return{'model':db[_0x636375[_0x04a8('0x24')]],'as':_0x636375['as'],'attributes':_0x636375[_0x04a8('0x21')],'include':_0x636375[_0x04a8('0x23')]?_[_0x04a8('0x25')](_0x636375[_0x04a8('0x23')],function(_0x4697af){return{'model':db[_0x4697af[_0x04a8('0x24')]],'as':_0x4697af['as'],'attributes':_0x4697af[_0x04a8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x04a8('0x11')](function(_0x36b4c8){logger[_0x04a8('0x12')](_0x04a8('0x27'),_0x4ce009);logger[_0x04a8('0x15')]('ShowMailAccount',_0x4ce009,JSON[_0x04a8('0x17')](_0x36b4c8));_0x3359b6(_0x36b4c8);})['catch'](function(_0x5d19bb){logger['error'](_0x04a8('0x27'),_0x5d19bb[_0x04a8('0x1a')],_0x4ce009);_0x42b832(_0x38b4d6[_0x04a8('0x18')](0x1f4,_0x5d19bb['message']));});});};exports[_0x04a8('0x2a')]=function(_0x25aea4){var _0x4ff8ab=this;return new Promise(function(_0x420291,_0x3e491a){var _0x185e44={'body':_0x25aea4['body'],'channel':_0x04a8('0x2b')};var _0x50e51d=_[_0x04a8('0x2c')](_[_0x04a8('0x2d')](db[_0x04a8('0x2e')][_0x04a8('0x2f')]),[_0x04a8('0x30'),_0x04a8('0x31'),_0x04a8('0x32'),_0x04a8('0x33')]);var _0x1758c8=![];if(_0x25aea4[_0x04a8('0x34')]['id']){delete _0x25aea4['body']['id'];}if(_[_0x04a8('0x35')](_0x25aea4[_0x04a8('0x34')][_0x04a8('0x36')])){return _0x3e491a(_0x4ff8ab[_0x04a8('0x18')](0x1f4,_0x04a8('0x37')));}if(_[_0x04a8('0x35')](_0x25aea4['body'][_0x04a8('0x34')])||_0x25aea4[_0x04a8('0x34')][_0x04a8('0x34')]===''){return _0x3e491a(_0x4ff8ab[_0x04a8('0x18')](0x1f4,_0x04a8('0x38')));}if(_[_0x04a8('0x35')](_0x25aea4[_0x04a8('0x34')][_0x04a8('0x39')])){return _0x3e491a(_0x4ff8ab[_0x04a8('0x18')](0x1f4,_0x04a8('0x3a')+_0x50e51d));}if(!_[_0x04a8('0x3b')](_0x50e51d,_0x25aea4[_0x04a8('0x34')][_0x04a8('0x39')])){return _0x3e491a(_0x4ff8ab[_0x04a8('0x18')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50e51d));}var _0xc814d0={};_0xc814d0[_0x25aea4[_0x04a8('0x34')][_0x04a8('0x39')]]=_0x25aea4[_0x04a8('0x34')]['from'];return db['MailAccount'][_0x04a8('0x29')]({'where':{'id':_0x25aea4[_0x04a8('0x3c')]['id']},'include':[{'model':db[_0x04a8('0x3d')],'as':_0x04a8('0x3e'),'include':[{'model':db[_0x04a8('0x2e')],'as':_0x04a8('0x3f'),'where':_0xc814d0,'limit':0x1,'order':[[_0x04a8('0x31'),_0x04a8('0x40')]]}]},{'model':db[_0x04a8('0x41')],'as':_0x04a8('0x42')},{'model':db['MailServerOut'],'as':_0x04a8('0x43')}]})[_0x04a8('0x11')](function(_0x2beda7){if(_0x2beda7&&_0x2beda7[_0x04a8('0x3e')]){var _0x2801b1=_0x2beda7[_0x04a8('0x44')]({'plain':!![]});_0x185e44[_0x04a8('0x3c')]=_[_0x04a8('0x45')](_0x2801b1,['Applications',_0x04a8('0x3e')]);_0x185e44[_0x04a8('0x46')]=_0x2801b1['Applications'];_0x185e44['list']=_0x2801b1[_0x04a8('0x3e')];_0x185e44[_0x04a8('0x46')]=_['orderBy'](_0x185e44[_0x04a8('0x46')],[_0x04a8('0x47')],[_0x04a8('0x48')]);if(_0x185e44[_0x04a8('0x3c')]&&_0x185e44[_0x04a8('0x3c')][_0x04a8('0x49')]){_0x185e44[_0x04a8('0x46')]['push']({'id':0x0,'priority':_0x185e44[_0x04a8('0x46')][_0x04a8('0x4a')]+0x1,'app':_0x04a8('0x4b'),'appdata':_0x04a8('0x49'),'interval':'*,*,*,*'});}if(_0x185e44[_0x04a8('0x3c')]['Applications']){delete _0x185e44[_0x04a8('0x3c')][_0x04a8('0x42')];}if(_0x185e44[_0x04a8('0x3c')][_0x04a8('0x3e')]){delete _0x185e44[_0x04a8('0x3c')]['List'];}if(_0x2801b1[_0x04a8('0x3e')][_0x04a8('0x3f')]['length']){return _0x2801b1['List'][_0x04a8('0x3f')][0x0];}var _0x64976f=_['defaults'](_0x25aea4[_0x04a8('0x34')],{'firstName':_0x25aea4['body'][_0x04a8('0x36')],'ListId':_0x2801b1[_0x04a8('0x33')]});_0x64976f[_0x25aea4[_0x04a8('0x34')][_0x04a8('0x39')]]=_0x25aea4[_0x04a8('0x34')][_0x04a8('0x36')];return db[_0x04a8('0x2e')][_0x04a8('0x4c')](_0x64976f);}else{throw new Error(_0x04a8('0x4d'));}})[_0x04a8('0x11')](function(_0x245b11){_0x185e44[_0x04a8('0x4e')]=_0x245b11;if(_0x245b11){if(!_0x25aea4[_0x04a8('0x34')]['message'][_0x04a8('0x4f')]){_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x4f')]=rs[_0x04a8('0x50')]()+'\x20'+_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x36')];}var _0x1f64f7={'ContactId':_0x245b11['id'],'MailAccountId':_0x25aea4[_0x04a8('0x3c')]['id'],'inReplyTo':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')]['messageId'],'to':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x36')],'cc':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')]['cc'],'subject':_0x25aea4['body'][_0x04a8('0x1a')][_0x04a8('0x51')],'attach':_0x25aea4['body']['message'][_0x04a8('0x52')],'lastMsgAt':moment()['format'](_0x04a8('0x53')),'lastMsgDirection':'in','lastMsgBody':_0x25aea4[_0x04a8('0x34')]['body']};return db[_0x04a8('0x54')]['find']({'where':{'closed':![],'MailAccountId':_0x25aea4[_0x04a8('0x3c')]['id']},'include':[{'model':db[_0x04a8('0x55')],'as':_0x04a8('0x56'),'attributes':[_0x04a8('0x4f')],'where':{'messageId':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x57')]}}]})['then'](function(_0x208e9c){if(_0x208e9c){return[_0x208e9c,![]];}return db[_0x04a8('0x54')][_0x04a8('0x4c')](_0x1f64f7)['then'](function(_0x32c33b){return[_0x32c33b,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x65c0e0,_0x35597b){if(_0x65c0e0){_0x1758c8=_0x35597b;if(!_0x35597b){return _0x65c0e0[_0x04a8('0x58')]({'inReplyTo':_0x25aea4[_0x04a8('0x34')]['message'][_0x04a8('0x4f')],'to':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x36')],'cc':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')]['cc'],'subject':_0x25aea4['body'][_0x04a8('0x1a')][_0x04a8('0x51')],'attach':_0x65c0e0[_0x04a8('0x52')]?_0x65c0e0[_0x04a8('0x52')]:_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x52')],'substatus':null,'substatusAt':moment()['format'](_0x04a8('0x53')),'lastMsgAt':moment()['format'](_0x04a8('0x53')),'lastMsgDirection':'in','lastMsgBody':_0x25aea4['body'][_0x04a8('0x34')]});}else{return _0x65c0e0;}}})[_0x04a8('0x11')](function(_0x1c80cf){_0x185e44[_0x04a8('0x59')]=_0x1c80cf['get']({'plain':!![]});_0x185e44[_0x04a8('0x59')][_0x04a8('0x5a')]=_0x1758c8;return db[_0x04a8('0x55')]['create']({'body':_0x25aea4[_0x04a8('0x34')]['body'],'MailAccountId':_0x25aea4[_0x04a8('0x3c')]['id'],'MailInteractionId':_0x1c80cf['id'],'direction':'in','ContactId':_0x185e44[_0x04a8('0x4e')]['id'],'messageId':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x4f')],'from':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x36')],'to':_0x25aea4[_0x04a8('0x34')]['message']['to'],'cc':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')]['cc'],'subject':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')][_0x04a8('0x51')],'attach':_0x25aea4['body'][_0x04a8('0x1a')][_0x04a8('0x52')],'Attachments':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')]['attachments'],'originTo':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')]['originTo'],'originCc':_0x25aea4[_0x04a8('0x34')]['message'][_0x04a8('0x5b')],'bcc':_0x25aea4[_0x04a8('0x34')][_0x04a8('0x1a')]['bcc']},{'include':[{'model':db['Attachment'],'as':_0x04a8('0x5c')}]});})[_0x04a8('0x11')](function(_0x1dabda){_0x185e44[_0x04a8('0x1a')]=_0x1dabda;if(_0x185e44['interaction'][_0x04a8('0x5d')]){return db[_0x04a8('0x5e')][_0x04a8('0x29')]({'attributes':['id',_0x04a8('0x5f')],'where':{'id':_0x185e44['interaction'][_0x04a8('0x5d')]}})[_0x04a8('0x11')](function(_0xb03239){if(_0xb03239){_0x185e44[_0x04a8('0x46')][_0x04a8('0x60')]({'id':0x0,'priority':0x0,'app':_0x04a8('0x61'),'appdata':_0xb03239[_0x04a8('0x5f')]+','+(_0x185e44['account'][_0x04a8('0x62')]||0xa),'interval':_0x04a8('0x63')});}return respondWithRpcPromise('Start',_0x04a8('0x64'),_0x185e44);});}return respondWithRpcPromise(_0x04a8('0x65'),_0x04a8('0x64'),_0x185e44);})[_0x04a8('0x11')](function(_0x3442d4){_0x420291(_0x3442d4);})[_0x04a8('0x26')](function(_0x4875ce){_0x3e491a(_0x4ff8ab[_0x04a8('0x18')](0x1f4,_0x4875ce[_0x04a8('0x1a')]));});});}; \ No newline at end of file +var _0x2d2a=['keys','CmContact','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','get','omit','applications','list','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','MailInteraction','spread','update','format','interaction','created','attachments','originTo','originCc','bcc','UserId','User','name','unshift','agent','Start','startRouting','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','debug','ShowMailAccount','find','body','mail','difference'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2d2a,0xfb));var _0xa2d2=function(_0x28196e,_0xe5468a){_0x28196e=_0x28196e-0x0;var _0x413a2d=_0x2d2a[_0x28196e];return _0x413a2d;};'use strict';var _=require('lodash');var util=require(_0xa2d2('0x0'));var moment=require(_0xa2d2('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2d2('0x2'));var fs=require('fs');var Redis=require(_0xa2d2('0x3'));var db=require(_0xa2d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa2d2('0x5'));var config=require(_0xa2d2('0x6'));var jayson=require(_0xa2d2('0x7'));var client=jayson[_0xa2d2('0x8')][_0xa2d2('0x9')]({'port':0x232c});config[_0xa2d2('0xa')]=_[_0xa2d2('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa2d2('0xc'))(new Redis(config[_0xa2d2('0xa')]));require(_0xa2d2('0xd'))[_0xa2d2('0xe')](socket);function respondWithRpcPromise(_0x145c06,_0x3fcb45,_0x2b06bd){return new BPromise(function(_0xd8be22,_0x4b6758){return client[_0xa2d2('0xf')](_0x145c06,_0x2b06bd)[_0xa2d2('0x10')](function(_0x4c25cb){logger[_0xa2d2('0x11')](_0xa2d2('0x12'),_0x3fcb45,_0xa2d2('0x13'));logger['debug'](_0xa2d2('0x14'),_0x3fcb45,_0xa2d2('0x13'),JSON[_0xa2d2('0x15')](_0x4c25cb));if(_0x4c25cb['error']){if(_0x4c25cb[_0xa2d2('0x16')][_0xa2d2('0x17')]===0x1f4){logger[_0xa2d2('0x16')]('MailAccount,\x20%s,\x20%s',_0x3fcb45,_0x4c25cb[_0xa2d2('0x16')][_0xa2d2('0x18')]);return _0x4b6758(_0x4c25cb[_0xa2d2('0x16')][_0xa2d2('0x18')]);}logger[_0xa2d2('0x16')](_0xa2d2('0x12'),_0x3fcb45,_0x4c25cb[_0xa2d2('0x16')][_0xa2d2('0x18')]);return _0xd8be22(_0x4c25cb[_0xa2d2('0x16')][_0xa2d2('0x18')]);}else{logger[_0xa2d2('0x11')]('MailAccount,\x20%s,\x20%s',_0x3fcb45,'request\x20sent');_0xd8be22(_0x4c25cb[_0xa2d2('0x19')][_0xa2d2('0x18')]);}})[_0xa2d2('0x1a')](function(_0x1b181f){logger['error'](_0xa2d2('0x12'),_0x3fcb45,_0x1b181f);_0x4b6758(_0x1b181f);});});}exports[_0xa2d2('0x1b')]=function(_0x5bed90){var _0x4a171c=this;return new Promise(function(_0x548ffe,_0x2497f4){return db[_0xa2d2('0x1c')][_0xa2d2('0x1d')]({'raw':_0x5bed90[_0xa2d2('0x1e')]?_0x5bed90[_0xa2d2('0x1e')][_0xa2d2('0x1f')]===undefined?!![]:![]:!![],'where':_0x5bed90[_0xa2d2('0x1e')]?_0x5bed90[_0xa2d2('0x1e')][_0xa2d2('0x20')]||null:null,'attributes':_0x5bed90[_0xa2d2('0x1e')]?_0x5bed90[_0xa2d2('0x1e')][_0xa2d2('0x21')]||null:null,'limit':_0x5bed90[_0xa2d2('0x1e')]?_0x5bed90[_0xa2d2('0x1e')]['limit']||null:null,'include':_0x5bed90[_0xa2d2('0x1e')]?_0x5bed90[_0xa2d2('0x1e')][_0xa2d2('0x22')]?_[_0xa2d2('0x23')](_0x5bed90[_0xa2d2('0x1e')]['include'],function(_0x43ecde){return{'model':db[_0x43ecde['model']],'as':_0x43ecde['as'],'attributes':_0x43ecde[_0xa2d2('0x21')],'include':_0x43ecde['include']?_['map'](_0x43ecde[_0xa2d2('0x22')],function(_0x53f5da){return{'model':db[_0x53f5da[_0xa2d2('0x24')]],'as':_0x53f5da['as'],'attributes':_0x53f5da[_0xa2d2('0x21')],'include':_0x53f5da['include']?_['map'](_0x53f5da['include'],function(_0x4995f2){return{'model':db[_0x4995f2[_0xa2d2('0x24')]],'as':_0x4995f2['as'],'attributes':_0x4995f2[_0xa2d2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa2d2('0x10')](function(_0x3a1eac){logger[_0xa2d2('0x11')](_0xa2d2('0x1b'),_0x5bed90);logger[_0xa2d2('0x25')](_0xa2d2('0x1b'),_0x5bed90,JSON['stringify'](_0x3a1eac));_0x548ffe(_0x3a1eac);})['catch'](function(_0x55015c){logger[_0xa2d2('0x16')]('GetMailAccount',_0x55015c[_0xa2d2('0x18')],_0x5bed90);_0x2497f4(_0x4a171c[_0xa2d2('0x16')](0x1f4,_0x55015c[_0xa2d2('0x18')]));});});};exports[_0xa2d2('0x26')]=function(_0x48be3d){var _0x30693c=this;return new Promise(function(_0x46c17b,_0x1417f7){return db[_0xa2d2('0x1c')][_0xa2d2('0x27')]({'raw':_0x48be3d[_0xa2d2('0x1e')]?_0x48be3d[_0xa2d2('0x1e')][_0xa2d2('0x1f')]===undefined?!![]:![]:!![],'where':_0x48be3d[_0xa2d2('0x1e')]?_0x48be3d[_0xa2d2('0x1e')]['where']||null:null,'attributes':_0x48be3d[_0xa2d2('0x1e')]?_0x48be3d[_0xa2d2('0x1e')][_0xa2d2('0x21')]||null:null,'include':_0x48be3d['options']?_0x48be3d[_0xa2d2('0x1e')]['include']?_[_0xa2d2('0x23')](_0x48be3d[_0xa2d2('0x1e')][_0xa2d2('0x22')],function(_0x210857){return{'model':db[_0x210857[_0xa2d2('0x24')]],'as':_0x210857['as'],'attributes':_0x210857[_0xa2d2('0x21')],'include':_0x210857[_0xa2d2('0x22')]?_[_0xa2d2('0x23')](_0x210857[_0xa2d2('0x22')],function(_0x3645d8){return{'model':db[_0x3645d8[_0xa2d2('0x24')]],'as':_0x3645d8['as'],'attributes':_0x3645d8[_0xa2d2('0x21')],'include':_0x3645d8[_0xa2d2('0x22')]?_[_0xa2d2('0x23')](_0x3645d8['include'],function(_0x37db6e){return{'model':db[_0x37db6e[_0xa2d2('0x24')]],'as':_0x37db6e['as'],'attributes':_0x37db6e[_0xa2d2('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x227337){logger['info']('ShowMailAccount',_0x48be3d);logger['debug'](_0xa2d2('0x26'),_0x48be3d,JSON[_0xa2d2('0x15')](_0x227337));_0x46c17b(_0x227337);})[_0xa2d2('0x1a')](function(_0x54ec1a){logger[_0xa2d2('0x16')](_0xa2d2('0x26'),_0x54ec1a[_0xa2d2('0x18')],_0x48be3d);_0x1417f7(_0x30693c[_0xa2d2('0x16')](0x1f4,_0x54ec1a[_0xa2d2('0x18')]));});});};exports['NotifyMailAccount']=function(_0x473065){var _0x38c7ea=this;return new Promise(function(_0x46baf5,_0x3b1edc){var _0x3c7c70={'body':_0x473065[_0xa2d2('0x28')],'channel':_0xa2d2('0x29')};var _0x13eae1=_[_0xa2d2('0x2a')](_[_0xa2d2('0x2b')](db[_0xa2d2('0x2c')]['rawAttributes']),['createdAt',_0xa2d2('0x2d'),_0xa2d2('0x2e'),_0xa2d2('0x2f')]);var _0xd5e6b4=![];if(_0x473065[_0xa2d2('0x28')]['id']){delete _0x473065['body']['id'];}if(_['isNil'](_0x473065[_0xa2d2('0x28')][_0xa2d2('0x30')])){return _0x3b1edc(_0x38c7ea[_0xa2d2('0x16')](0x1f4,_0xa2d2('0x31')));}if(_[_0xa2d2('0x32')](_0x473065[_0xa2d2('0x28')]['body'])||_0x473065[_0xa2d2('0x28')][_0xa2d2('0x28')]===''){return _0x3b1edc(_0x38c7ea[_0xa2d2('0x16')](0x1f4,_0xa2d2('0x33')));}if(_[_0xa2d2('0x32')](_0x473065[_0xa2d2('0x28')]['mapKey'])){return _0x3b1edc(_0x38c7ea[_0xa2d2('0x16')](0x1f4,_0xa2d2('0x34')+_0x13eae1));}if(!_[_0xa2d2('0x35')](_0x13eae1,_0x473065['body'][_0xa2d2('0x36')])){return _0x3b1edc(_0x38c7ea[_0xa2d2('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13eae1));}var _0x7f805a={};_0x7f805a[_0x473065[_0xa2d2('0x28')][_0xa2d2('0x36')]]=_0x473065[_0xa2d2('0x28')][_0xa2d2('0x30')];return db[_0xa2d2('0x1c')][_0xa2d2('0x27')]({'where':{'id':_0x473065[_0xa2d2('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xa2d2('0x38'),'include':[{'model':db[_0xa2d2('0x2c')],'as':_0xa2d2('0x39'),'where':_0x7f805a,'limit':0x1,'order':[[_0xa2d2('0x2d'),_0xa2d2('0x3a')]]}]},{'model':db[_0xa2d2('0x3b')],'as':_0xa2d2('0x3c')},{'model':db[_0xa2d2('0x3d')],'as':'Smtp'}]})[_0xa2d2('0x10')](function(_0x36c8f9){if(_0x36c8f9&&_0x36c8f9[_0xa2d2('0x38')]){var _0x465caa=_0x36c8f9[_0xa2d2('0x3e')]({'plain':!![]});_0x3c7c70[_0xa2d2('0x37')]=_[_0xa2d2('0x3f')](_0x465caa,[_0xa2d2('0x3c'),_0xa2d2('0x38')]);_0x3c7c70[_0xa2d2('0x40')]=_0x465caa[_0xa2d2('0x3c')];_0x3c7c70[_0xa2d2('0x41')]=_0x465caa[_0xa2d2('0x38')];_0x3c7c70[_0xa2d2('0x40')]=_['orderBy'](_0x3c7c70[_0xa2d2('0x40')],['priority'],[_0xa2d2('0x42')]);if(_0x3c7c70[_0xa2d2('0x37')]&&_0x3c7c70[_0xa2d2('0x37')][_0xa2d2('0x43')]){_0x3c7c70[_0xa2d2('0x40')][_0xa2d2('0x44')]({'id':0x0,'priority':_0x3c7c70[_0xa2d2('0x40')][_0xa2d2('0x45')]+0x1,'app':_0xa2d2('0x46'),'appdata':'autoclose','interval':_0xa2d2('0x47')});}if(_0x3c7c70[_0xa2d2('0x37')][_0xa2d2('0x3c')]){delete _0x3c7c70[_0xa2d2('0x37')]['Applications'];}if(_0x3c7c70[_0xa2d2('0x37')][_0xa2d2('0x38')]){delete _0x3c7c70[_0xa2d2('0x37')][_0xa2d2('0x38')];}if(_0x465caa[_0xa2d2('0x38')][_0xa2d2('0x39')][_0xa2d2('0x45')]){return _0x465caa[_0xa2d2('0x38')][_0xa2d2('0x39')][0x0];}var _0x6d5a54=_[_0xa2d2('0xb')](_0x473065['body'],{'firstName':_0x473065[_0xa2d2('0x28')]['from'],'ListId':_0x465caa[_0xa2d2('0x2f')]});_0x6d5a54[_0x473065[_0xa2d2('0x28')][_0xa2d2('0x36')]]=_0x473065['body'][_0xa2d2('0x30')];return db[_0xa2d2('0x2c')][_0xa2d2('0x48')](_0x6d5a54);}else{throw new Error(_0xa2d2('0x49'));}})[_0xa2d2('0x10')](function(_0x1bb560){_0x3c7c70[_0xa2d2('0x4a')]=_0x1bb560;if(_0x1bb560){if(!_0x473065['body'][_0xa2d2('0x18')][_0xa2d2('0x4b')]){_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x4b')]=rs['generate']()+'\x20'+_0x473065['body']['message'][_0xa2d2('0x30')];}var _0x1e22b4={'ContactId':_0x1bb560['id'],'MailAccountId':_0x473065[_0xa2d2('0x37')]['id'],'inReplyTo':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x4b')],'to':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')]['from'],'cc':_0x473065['body'][_0xa2d2('0x18')]['cc'],'subject':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x4c')],'attach':_0x473065[_0xa2d2('0x28')]['message'][_0xa2d2('0x4d')],'lastMsgAt':moment()['format'](_0xa2d2('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x473065['body']['body']};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x473065[_0xa2d2('0x37')]['id']},'include':[{'model':db[_0xa2d2('0x4f')],'as':'Messages','attributes':[_0xa2d2('0x4b')],'where':{'messageId':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x50')]}}]})['then'](function(_0x323603){if(_0x323603){return[_0x323603,![]];}return db[_0xa2d2('0x51')]['create'](_0x1e22b4)[_0xa2d2('0x10')](function(_0x36ed61){return[_0x36ed61,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa2d2('0x52')](function(_0x564a52,_0xc3cb47){if(_0x564a52){_0xd5e6b4=_0xc3cb47;if(!_0xc3cb47){return _0x564a52[_0xa2d2('0x53')]({'inReplyTo':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x4b')],'to':_0x473065['body'][_0xa2d2('0x18')]['from'],'cc':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')]['cc'],'subject':_0x473065[_0xa2d2('0x28')]['message']['subject'],'attach':_0x564a52[_0xa2d2('0x4d')]?_0x564a52[_0xa2d2('0x4d')]:_0x473065[_0xa2d2('0x28')]['message'][_0xa2d2('0x4d')],'substatus':null,'substatusAt':moment()[_0xa2d2('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xa2d2('0x54')](_0xa2d2('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x28')]});}else{return _0x564a52;}}})[_0xa2d2('0x10')](function(_0x3648ec){_0x3c7c70['interaction']=_0x3648ec['get']({'plain':!![]});_0x3c7c70[_0xa2d2('0x55')][_0xa2d2('0x56')]=_0xd5e6b4;return db[_0xa2d2('0x4f')][_0xa2d2('0x48')]({'body':_0x473065['body']['body'],'MailAccountId':_0x473065[_0xa2d2('0x37')]['id'],'MailInteractionId':_0x3648ec['id'],'direction':'in','ContactId':_0x3c7c70[_0xa2d2('0x4a')]['id'],'messageId':_0x473065[_0xa2d2('0x28')]['message'][_0xa2d2('0x4b')],'from':_0x473065['body'][_0xa2d2('0x18')][_0xa2d2('0x30')],'to':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')]['to'],'cc':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')]['cc'],'subject':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x4c')],'attach':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x4d')],'Attachments':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x57')],'originTo':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x58')],'originCc':_0x473065[_0xa2d2('0x28')][_0xa2d2('0x18')][_0xa2d2('0x59')],'bcc':_0x473065['body']['message'][_0xa2d2('0x5a')]},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0xa2d2('0x10')](function(_0x2878f5){_0x3c7c70[_0xa2d2('0x18')]=_0x2878f5;if(_0x3c7c70[_0xa2d2('0x55')][_0xa2d2('0x5b')]){return db[_0xa2d2('0x5c')][_0xa2d2('0x27')]({'attributes':['id',_0xa2d2('0x5d')],'where':{'id':_0x3c7c70[_0xa2d2('0x55')][_0xa2d2('0x5b')]}})['then'](function(_0x41374e){if(_0x41374e){_0x3c7c70['applications'][_0xa2d2('0x5e')]({'id':0x0,'priority':0x0,'app':_0xa2d2('0x5f'),'appdata':_0x41374e['name']+','+(_0x3c7c70[_0xa2d2('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0xa2d2('0x47')});}return respondWithRpcPromise(_0xa2d2('0x60'),_0xa2d2('0x61'),_0x3c7c70);});}return respondWithRpcPromise(_0xa2d2('0x60'),'startRouting',_0x3c7c70);})[_0xa2d2('0x10')](function(_0x180416){_0x46baf5(_0x180416);})['catch'](function(_0xc87e82){_0x3b1edc(_0x38c7ea['error'](0x1f4,_0xc87e82[_0xa2d2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index e3f6c0e..043c93f 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 _0xe7c2=['update','register','length','./mailAccount.events','save','remove'];(function(_0x3b2c1e,_0x3bb7ed){var _0x27aad9=function(_0x154748){while(--_0x154748){_0x3b2c1e['push'](_0x3b2c1e['shift']());}};_0x27aad9(++_0x3bb7ed);}(_0xe7c2,0xc3));var _0x2e7c=function(_0xc39025,_0x223fe7){_0xc39025=_0xc39025-0x0;var _0xc89759=_0xe7c2[_0xc39025];return _0xc89759;};'use strict';var MailAccountEvents=require(_0x2e7c('0x0'));var events=[_0x2e7c('0x1'),_0x2e7c('0x2'),_0x2e7c('0x3')];function createListener(_0x3af38e,_0x21de1d){return function(_0x41d671){_0x21de1d['emit'](_0x3af38e,_0x41d671);};}function removeListener(_0x2f501e,_0x40903d){return function(){MailAccountEvents['removeListener'](_0x2f501e,_0x40903d);};}exports[_0x2e7c('0x4')]=function(_0xfcaede){for(var _0x2cc6ad=0x0,_0x23f551=events[_0x2e7c('0x5')];_0x2cc6ad<_0x23f551;_0x2cc6ad++){var _0x40a7fb=events[_0x2cc6ad];var _0x2f8ca4=createListener('mailAccount:'+_0x40a7fb,_0xfcaede);MailAccountEvents['on'](_0x40a7fb,_0x2f8ca4);}}; \ No newline at end of file +var _0xa96a=['save','update','emit','register','mailAccount:','./mailAccount.events'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xa96a,0x12b));var _0xaa96=function(_0x40a908,_0x238723){_0x40a908=_0x40a908-0x0;var _0x4ec831=_0xa96a[_0x40a908];return _0x4ec831;};'use strict';var MailAccountEvents=require(_0xaa96('0x0'));var events=[_0xaa96('0x1'),'remove',_0xaa96('0x2')];function createListener(_0x26830f,_0x402532){return function(_0x2919dc){_0x402532[_0xaa96('0x3')](_0x26830f,_0x2919dc);};}function removeListener(_0x4193c4,_0x3e5924){return function(){MailAccountEvents['removeListener'](_0x4193c4,_0x3e5924);};}exports[_0xaa96('0x4')]=function(_0x10df04){for(var _0x252c9b=0x0,_0x29464e=events['length'];_0x252c9b<_0x29464e;_0x252c9b++){var _0x2ab872=events[_0x252c9b];var _0x21a9e1=createListener(_0xaa96('0x5')+_0x2ab872,_0x10df04);MailAccountEvents['on'](_0x2ab872,_0x21a9e1);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index eabf989..2ebcafa 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 _0x0a12=['../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','destroy','exports','util','Router','../../components/interaction/service'];(function(_0x135e70,_0x47b880){var _0xf995f0=function(_0x6e38c8){while(--_0x6e38c8){_0x135e70['push'](_0x135e70['shift']());}};_0xf995f0(++_0x47b880);}(_0x0a12,0xb8));var _0x20a1=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x0a12[_0x2faddb];return _0x273c05;};'use strict';var multer=require('multer');var util=require(_0x20a1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20a1('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x20a1('0x2'));var config=require(_0x20a1('0x3'));var controller=require(_0x20a1('0x4'));router[_0x20a1('0x5')](_0x20a1('0x6'),auth[_0x20a1('0x7')](),controller[_0x20a1('0x8')]);router['put']('/:id',auth[_0x20a1('0x7')](),controller['update']);router['delete'](_0x20a1('0x6'),auth[_0x20a1('0x7')](),controller[_0x20a1('0x9')]);module[_0x20a1('0xa')]=router; \ No newline at end of file +var _0x04de=['./mailApplication.controller','get','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xce50ab,_0x4c503b){var _0x9432bb=function(_0x4827e7){while(--_0x4827e7){_0xce50ab['push'](_0xce50ab['shift']());}};_0x9432bb(++_0x4c503b);}(_0x04de,0x107));var _0xe04d=function(_0x590bf2,_0x3ee368){_0x590bf2=_0x590bf2-0x0;var _0x17b617=_0x04de[_0x590bf2];return _0x17b617;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var auth=require(_0xe04d('0x6'));var interaction=require(_0xe04d('0x7'));var config=require(_0xe04d('0x8'));var controller=require(_0xe04d('0x9'));router[_0xe04d('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['put'](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0xd')]);router[_0xe04d('0xe')](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0xf')]);module[_0xe04d('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6b93558..362001b 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 _0xa456=['STRING','TEXT','sequelize','exports','INTEGER'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa456,0x142));var _0x6a45=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xa456[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'priority':{'type':Sequelize[_0x6a45('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6a45('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6a45('0x4')]()},'description':{'type':Sequelize[_0x6a45('0x3')]},'interval':{'type':Sequelize[_0x6a45('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x49c1=['INTEGER','STRING','noop','sequelize'];(function(_0x387ed1,_0x178f6d){var _0x3eab3c=function(_0x3ae565){while(--_0x3ae565){_0x387ed1['push'](_0x387ed1['shift']());}};_0x3eab3c(++_0x178f6d);}(_0x49c1,0xef));var _0x149c=function(_0x1e64ad,_0x25dbc5){_0x1e64ad=_0x1e64ad-0x0;var _0x544da6=_0x49c1[_0x1e64ad];return _0x544da6;};'use strict';var Sequelize=require(_0x149c('0x0'));module['exports']={'priority':{'type':Sequelize[_0x149c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x149c('0x2')],'allowNull':![],'defaultValue':_0x149c('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x149c('0x2')]},'interval':{'type':Sequelize[_0x149c('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 5349b9b..39ad922 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 _0x6737=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','show','params','model','MailApplication','rawAttributes','keys','query','filters','attributes','intersection','fields','length','includeAll','include','options','find','body','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x15430c,_0x156fdf){var _0x56994e=function(_0x2e34bf){while(--_0x2e34bf){_0x15430c['push'](_0x15430c['shift']());}};_0x56994e(++_0x156fdf);}(_0x6737,0x11b));var _0x7673=function(_0x400fd0,_0x5d1789){_0x400fd0=_0x400fd0-0x0;var _0x3043d3=_0x6737[_0x400fd0];return _0x3043d3;};'use strict';var pdf=require(_0x7673('0x0'));var emlformat=require(_0x7673('0x1'));var rimraf=require(_0x7673('0x2'));var zipdir=require(_0x7673('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7673('0x4'));var moment=require(_0x7673('0x5'));var BPromise=require(_0x7673('0x6'));var Mustache=require(_0x7673('0x7'));var util=require('util');var path=require(_0x7673('0x8'));var sox=require(_0x7673('0x9'));var csv=require(_0x7673('0xa'));var ejs=require(_0x7673('0xb'));var fs=require('fs');var _=require(_0x7673('0xc'));var squel=require(_0x7673('0xd'));var crypto=require(_0x7673('0xe'));var jsforce=require(_0x7673('0xf'));var deskjs=require(_0x7673('0x10'));var toCsv=require(_0x7673('0xa'));var querystring=require(_0x7673('0x11'));var Papa=require(_0x7673('0x12'));var Redis=require('ioredis');var authService=require(_0x7673('0x13'));var qs=require(_0x7673('0x14'));var hardwareService=require(_0x7673('0x15'));var logger=require(_0x7673('0x16'))(_0x7673('0x17'));var utils=require(_0x7673('0x18'));var config=require(_0x7673('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x200bbc,_0x2e328d){_0x2e328d=_0x2e328d||0xcc;return function(_0x555b72){if(_0x555b72){return _0x200bbc[_0x7673('0x1a')](_0x2e328d);}return _0x200bbc[_0x7673('0x1b')](_0x2e328d)[_0x7673('0x1c')]();};}function respondWithResult(_0x2c2305,_0x5bffb7){_0x5bffb7=_0x5bffb7||0xc8;return function(_0x228527){if(_0x228527){return _0x2c2305[_0x7673('0x1b')](_0x5bffb7)[_0x7673('0x1d')](_0x228527);}};}function respondWithFilteredResult(_0x5950b5,_0x57b586){return function(_0x49080d){if(_0x49080d){var _0x3bb944=_0x49080d[_0x7673('0x1e')],_0x3b679c=_0x57b586['offset'],_0x470005=_0x57b586['offset']+_0x57b586[_0x7673('0x1f')],_0x3c1afb;if(_0x470005>=_0x3bb944){_0x470005=_0x3bb944;_0x3c1afb=0xc8;}else{_0x3c1afb=0xce;}_0x5950b5[_0x7673('0x1b')](_0x3c1afb);return _0x5950b5[_0x7673('0x20')](_0x7673('0x21'),_0x3b679c+'-'+_0x470005+'/'+_0x3bb944)['json'](_0x49080d);}return null;};}function patchUpdates(_0x6a6b4f){return function(_0x1997ff){try{jsonpatch[_0x7673('0x22')](_0x1997ff,_0x6a6b4f,!![]);}catch(_0x756450){return BPromise[_0x7673('0x23')](_0x756450);}return _0x1997ff[_0x7673('0x24')]();};}function saveUpdates(_0x1c21ea,_0x50c772){return function(_0x4ae790){if(_0x4ae790){return _0x4ae790[_0x7673('0x25')](_0x1c21ea)['then'](function(_0x48d079){return _0x48d079;});}return null;};}function removeEntity(_0x5edec3,_0x2263f7){return function(_0x3931b0){if(_0x3931b0){return _0x3931b0[_0x7673('0x26')]()[_0x7673('0x27')](function(){_0x5edec3[_0x7673('0x1b')](0xcc)[_0x7673('0x1c')]();});}};}function handleEntityNotFound(_0x1057f2,_0x5c4aa6){return function(_0x386368){if(!_0x386368){_0x1057f2[_0x7673('0x1a')](0x194);}return _0x386368;};}function handleError(_0x2b4556,_0x3fa483){_0x3fa483=_0x3fa483||0x1f4;return function(_0x2dc77f){logger['error'](_0x2dc77f[_0x7673('0x28')]);if(_0x2dc77f[_0x7673('0x29')]){delete _0x2dc77f[_0x7673('0x29')];}_0x2b4556[_0x7673('0x1b')](_0x3fa483)[_0x7673('0x2a')](_0x2dc77f);};}exports[_0x7673('0x2b')]=function(_0x391f9c,_0x1053aa){var _0x146f2e={'raw':!![],'where':{'id':_0x391f9c[_0x7673('0x2c')]['id']}},_0x12915c={};_0x12915c[_0x7673('0x2d')]=_['keys'](db[_0x7673('0x2e')][_0x7673('0x2f')]);_0x12915c['query']=_[_0x7673('0x30')](_0x391f9c[_0x7673('0x31')]);_0x12915c[_0x7673('0x32')]=_['intersection'](_0x12915c[_0x7673('0x2d')],_0x12915c[_0x7673('0x31')]);_0x146f2e[_0x7673('0x33')]=_[_0x7673('0x34')](_0x12915c[_0x7673('0x2d')],qs[_0x7673('0x35')](_0x391f9c[_0x7673('0x31')][_0x7673('0x35')]));_0x146f2e['attributes']=_0x146f2e[_0x7673('0x33')][_0x7673('0x36')]?_0x146f2e[_0x7673('0x33')]:_0x12915c[_0x7673('0x2d')];if(_0x391f9c[_0x7673('0x31')][_0x7673('0x37')]){_0x146f2e[_0x7673('0x38')]=[{'all':!![]}];}_0x146f2e=_['merge']({},_0x146f2e,_0x391f9c[_0x7673('0x39')]);return db[_0x7673('0x2e')][_0x7673('0x3a')](_0x146f2e)['then'](handleEntityNotFound(_0x1053aa,null))[_0x7673('0x27')](respondWithResult(_0x1053aa,null))['catch'](handleError(_0x1053aa,null));};exports[_0x7673('0x25')]=function(_0x3070f5,_0x552a48){if(_0x3070f5[_0x7673('0x3b')]['id']){delete _0x3070f5[_0x7673('0x3b')]['id'];}return db[_0x7673('0x2e')]['find']({'where':{'id':_0x3070f5[_0x7673('0x2c')]['id']}})[_0x7673('0x27')](handleEntityNotFound(_0x552a48,null))[_0x7673('0x27')](saveUpdates(_0x3070f5[_0x7673('0x3b')],null))[_0x7673('0x27')](respondWithResult(_0x552a48,null))[_0x7673('0x3c')](handleError(_0x552a48,null));};exports[_0x7673('0x26')]=function(_0x590518,_0x507a8b){return db['MailApplication']['find']({'where':{'id':_0x590518[_0x7673('0x2c')]['id']}})[_0x7673('0x27')](handleEntityNotFound(_0x507a8b,null))['then'](removeEntity(_0x507a8b,null))[_0x7673('0x3c')](handleError(_0x507a8b,null));}; \ No newline at end of file +var _0xdb18=['fields','length','includeAll','options','find','catch','body','destroy','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','error','stack','name','show','params','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes'];(function(_0x57d4d6,_0x106268){var _0x167994=function(_0x2100ce){while(--_0x2100ce){_0x57d4d6['push'](_0x57d4d6['shift']());}};_0x167994(++_0x106268);}(_0xdb18,0x1e0));var _0x8db1=function(_0x4e7d68,_0x21dcc2){_0x4e7d68=_0x4e7d68-0x0;var _0x5e32e6=_0xdb18[_0x4e7d68];return _0x5e32e6;};'use strict';var pdf=require(_0x8db1('0x0'));var emlformat=require(_0x8db1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8db1('0x2'));var rp=require(_0x8db1('0x3'));var moment=require(_0x8db1('0x4'));var BPromise=require(_0x8db1('0x5'));var Mustache=require(_0x8db1('0x6'));var util=require(_0x8db1('0x7'));var path=require(_0x8db1('0x8'));var sox=require(_0x8db1('0x9'));var csv=require(_0x8db1('0xa'));var ejs=require(_0x8db1('0xb'));var fs=require('fs');var _=require(_0x8db1('0xc'));var squel=require(_0x8db1('0xd'));var crypto=require(_0x8db1('0xe'));var jsforce=require(_0x8db1('0xf'));var deskjs=require(_0x8db1('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8db1('0x11'));var Redis=require(_0x8db1('0x12'));var authService=require(_0x8db1('0x13'));var qs=require(_0x8db1('0x14'));var hardwareService=require(_0x8db1('0x15'));var logger=require(_0x8db1('0x16'))(_0x8db1('0x17'));var utils=require('../../config/utils');var config=require(_0x8db1('0x18'));var db=require(_0x8db1('0x19'))['db'];function respondWithStatusCode(_0x1f1af8,_0x18b8a6){_0x18b8a6=_0x18b8a6||0xcc;return function(_0x48d943){if(_0x48d943){return _0x1f1af8[_0x8db1('0x1a')](_0x18b8a6);}return _0x1f1af8[_0x8db1('0x1b')](_0x18b8a6)[_0x8db1('0x1c')]();};}function respondWithResult(_0x4c3faf,_0x1d5284){_0x1d5284=_0x1d5284||0xc8;return function(_0x2b977e){if(_0x2b977e){return _0x4c3faf[_0x8db1('0x1b')](_0x1d5284)[_0x8db1('0x1d')](_0x2b977e);}};}function respondWithFilteredResult(_0x546f66,_0x15d5c3){return function(_0x477615){if(_0x477615){var _0x479414=_0x477615[_0x8db1('0x1e')],_0x491ee9=_0x15d5c3[_0x8db1('0x1f')],_0x27cf72=_0x15d5c3[_0x8db1('0x1f')]+_0x15d5c3[_0x8db1('0x20')],_0x107512;if(_0x27cf72>=_0x479414){_0x27cf72=_0x479414;_0x107512=0xc8;}else{_0x107512=0xce;}_0x546f66[_0x8db1('0x1b')](_0x107512);return _0x546f66['set'](_0x8db1('0x21'),_0x491ee9+'-'+_0x27cf72+'/'+_0x479414)[_0x8db1('0x1d')](_0x477615);}return null;};}function patchUpdates(_0x4735fb){return function(_0x2c13b1){try{jsonpatch[_0x8db1('0x22')](_0x2c13b1,_0x4735fb,!![]);}catch(_0x2e9550){return BPromise['reject'](_0x2e9550);}return _0x2c13b1[_0x8db1('0x23')]();};}function saveUpdates(_0x238ab3,_0x536132){return function(_0x44f2e3){if(_0x44f2e3){return _0x44f2e3[_0x8db1('0x24')](_0x238ab3)[_0x8db1('0x25')](function(_0x308ded){return _0x308ded;});}return null;};}function removeEntity(_0x5f066d,_0x22dde1){return function(_0x7094c5){if(_0x7094c5){return _0x7094c5['destroy']()['then'](function(){_0x5f066d['status'](0xcc)[_0x8db1('0x1c')]();});}};}function handleEntityNotFound(_0x1b01c8,_0x48fc97){return function(_0x2d7aa2){if(!_0x2d7aa2){_0x1b01c8[_0x8db1('0x1a')](0x194);}return _0x2d7aa2;};}function handleError(_0x133887,_0x4555e4){_0x4555e4=_0x4555e4||0x1f4;return function(_0x3a57a0){logger[_0x8db1('0x26')](_0x3a57a0[_0x8db1('0x27')]);if(_0x3a57a0['name']){delete _0x3a57a0[_0x8db1('0x28')];}_0x133887['status'](_0x4555e4)['send'](_0x3a57a0);};}exports[_0x8db1('0x29')]=function(_0x1f6759,_0x284c49){var _0x59a1fa={'raw':!![],'where':{'id':_0x1f6759[_0x8db1('0x2a')]['id']}},_0x213966={};_0x213966[_0x8db1('0x2b')]=_[_0x8db1('0x2c')](db[_0x8db1('0x2d')][_0x8db1('0x2e')]);_0x213966['query']=_[_0x8db1('0x2c')](_0x1f6759[_0x8db1('0x2f')]);_0x213966[_0x8db1('0x30')]=_[_0x8db1('0x31')](_0x213966[_0x8db1('0x2b')],_0x213966[_0x8db1('0x2f')]);_0x59a1fa[_0x8db1('0x32')]=_['intersection'](_0x213966[_0x8db1('0x2b')],qs[_0x8db1('0x33')](_0x1f6759['query']['fields']));_0x59a1fa[_0x8db1('0x32')]=_0x59a1fa['attributes'][_0x8db1('0x34')]?_0x59a1fa[_0x8db1('0x32')]:_0x213966[_0x8db1('0x2b')];if(_0x1f6759['query'][_0x8db1('0x35')]){_0x59a1fa['include']=[{'all':!![]}];}_0x59a1fa=_['merge']({},_0x59a1fa,_0x1f6759[_0x8db1('0x36')]);return db[_0x8db1('0x2d')][_0x8db1('0x37')](_0x59a1fa)[_0x8db1('0x25')](handleEntityNotFound(_0x284c49,null))['then'](respondWithResult(_0x284c49,null))[_0x8db1('0x38')](handleError(_0x284c49,null));};exports[_0x8db1('0x24')]=function(_0x1fe009,_0x5ca4b3){if(_0x1fe009[_0x8db1('0x39')]['id']){delete _0x1fe009[_0x8db1('0x39')]['id'];}return db[_0x8db1('0x2d')][_0x8db1('0x37')]({'where':{'id':_0x1fe009[_0x8db1('0x2a')]['id']}})[_0x8db1('0x25')](handleEntityNotFound(_0x5ca4b3,null))[_0x8db1('0x25')](saveUpdates(_0x1fe009[_0x8db1('0x39')],null))[_0x8db1('0x25')](respondWithResult(_0x5ca4b3,null))[_0x8db1('0x38')](handleError(_0x5ca4b3,null));};exports[_0x8db1('0x3a')]=function(_0x1b10dd,_0x47440f){return db[_0x8db1('0x2d')]['find']({'where':{'id':_0x1b10dd[_0x8db1('0x2a')]['id']}})['then'](handleEntityNotFound(_0x47440f,null))['then'](removeEntity(_0x47440f,null))['catch'](handleError(_0x47440f,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 669f9d7..dd5c0da 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 _0xa600=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1f68dd,_0x40414e){var _0x5b72c9=function(_0x57ed35){while(--_0x57ed35){_0x1f68dd['push'](_0x1f68dd['shift']());}};_0x5b72c9(++_0x40414e);}(_0xa600,0xa6));var _0x0a60=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0xa600[_0x51ed62];return _0x34aee3;};'use strict';var _=require(_0x0a60('0x0'));var util=require(_0x0a60('0x1'));var logger=require(_0x0a60('0x2'))(_0x0a60('0x3'));var moment=require(_0x0a60('0x4'));var BPromise=require(_0x0a60('0x5'));var rp=require(_0x0a60('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a60('0x7'));var config=require(_0x0a60('0x8'));var attributes=require('./mailApplication.attributes');module[_0x0a60('0x9')]=function(_0x567613,_0x4109c5){return _0x567613[_0x0a60('0xa')](_0x0a60('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a60('0xc')});}; \ No newline at end of file +var _0x81e6=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2d5529,_0x5e5d3c){var _0x5de80d=function(_0x50740a){while(--_0x50740a){_0x2d5529['push'](_0x2d5529['shift']());}};_0x5de80d(++_0x5e5d3c);}(_0x81e6,0x68));var _0x681e=function(_0x695687,_0x259aa5){_0x695687=_0x695687-0x0;var _0x417c7a=_0x81e6[_0x695687];return _0x417c7a;};'use strict';var _=require(_0x681e('0x0'));var util=require(_0x681e('0x1'));var logger=require('../../config/logger')(_0x681e('0x2'));var moment=require('moment');var BPromise=require(_0x681e('0x3'));var rp=require(_0x681e('0x4'));var fs=require('fs');var path=require(_0x681e('0x5'));var rimraf=require(_0x681e('0x6'));var config=require(_0x681e('0x7'));var attributes=require('./mailApplication.attributes');module[_0x681e('0x8')]=function(_0x5a4061,_0xa2ea20){return _0x5a4061[_0x681e('0x9')]('MailApplication',attributes,{'tableName':_0x681e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x681e('0xb'),'collate':_0x681e('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 821110c..d8c6426 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 _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0x21eb46,_0x1a0ff3){var _0x190bf6=function(_0x1b092f){while(--_0x1b092f){_0x21eb46['push'](_0x21eb46['shift']());}};_0x190bf6(++_0x1a0ff3);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xebda1b,_0x4af710){var _0x38041e=function(_0xdce6c7){while(--_0xdce6c7){_0xebda1b['push'](_0xebda1b['shift']());}};_0x38041e(++_0x4af710);}(_0x7a54,0x106));var _0x47a5=function(_0x128983,_0x26cbca){_0x128983=_0x128983-0x0;var _0x8cfd71=_0x7a54[_0x128983];return _0x8cfd71;};'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')]('MailApplication,\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['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8d2dce8..bf0b265 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 _0x54ef=['post','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','delete','/:id','mailinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','/describe','isAuthenticated','show','/:id/messages','getMessages','download'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x54ef,0x112));var _0xf54e=function(_0x5e87c1,_0x56d70b){_0x5e87c1=_0x5e87c1-0x0;var _0x1b801c=_0x54ef[_0x5e87c1];return _0x1b801c;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['describe']);router[_0xf54e('0x9')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0xc')]);router['get'](_0xf54e('0xd'),auth[_0xf54e('0xb')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x9')]('/:id/download',auth[_0xf54e('0xb')](),controller[_0xf54e('0xf')]);router[_0xf54e('0x10')]('/',auth[_0xf54e('0xb')](),controller['create']);router[_0xf54e('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf54e('0x11')]);router[_0xf54e('0x10')](_0xf54e('0x12'),auth[_0xf54e('0xb')](),interaction['tracked'](_0xf54e('0x13'),_0xf54e('0x14')),controller[_0xf54e('0x15')]);router[_0xf54e('0x16')]('/:id',auth[_0xf54e('0xb')](),interaction[_0xf54e('0x17')](_0xf54e('0x13'),'mailinteraction:update'),controller['update']);router[_0xf54e('0x18')](_0xf54e('0x19'),auth[_0xf54e('0xb')](),interaction[_0xf54e('0x17')](_0xf54e('0x13'),_0xf54e('0x1a')),controller[_0xf54e('0x1b')]);router[_0xf54e('0x18')](_0xf54e('0x12'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x00bb=['../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','addTags','put','update','delete','destroy','removeTags','exports','multer','util','path','express'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x00bb[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0x7')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller['show']);router['get'](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xd')]);router[_0xb00b('0x7')](_0xb00b('0xe'),auth['isAuthenticated'](),controller[_0xb00b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb00b('0x10')](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0x11')]);router[_0xb00b('0x10')](_0xb00b('0x12'),auth['isAuthenticated'](),interaction[_0xb00b('0x13')](_0xb00b('0x14'),'mailinteraction:addtags'),controller[_0xb00b('0x15')]);router[_0xb00b('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0xb00b('0x13')]('mail','mailinteraction:update'),controller[_0xb00b('0x17')]);router[_0xb00b('0x18')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),interaction['tracked'](_0xb00b('0x14'),'mailinteraction:destroy'),controller[_0xb00b('0x19')]);router['delete'](_0xb00b('0x12'),auth['isAuthenticated'](),controller[_0xb00b('0x1a')]);module[_0xb00b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4bf10d7..ae678fd 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 _0xdef1=['sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long','out'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xdef1,0x98));var _0x1def=function(_0x53ae20,_0x59446a){_0x53ae20=_0x53ae20-0x0;var _0x5d2f60=_0xdef1[_0x53ae20];return _0x5d2f60;};'use strict';var Sequelize=require(_0x1def('0x0'));var iconv=require('iconv');module[_0x1def('0x1')]={'closed':{'type':Sequelize[_0x1def('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1def('0x3')]},'disposition':{'type':Sequelize[_0x1def('0x4')]},'note':{'type':Sequelize[_0x1def('0x4')]},'inReplyTo':{'type':Sequelize[_0x1def('0x4')](0x1fe)},'to':{'type':Sequelize[_0x1def('0x4')]},'cc':{'type':Sequelize[_0x1def('0x5')](_0x1def('0x6'))},'subject':{'type':Sequelize[_0x1def('0x5')]()},'attach':{'type':Sequelize[_0x1def('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1def('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x1def('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1def('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1def('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT']('long')},'lastMsgText':{'type':Sequelize[_0x1def('0x5')](_0x1def('0x6'))}}; \ No newline at end of file +var _0x0ab3=['long','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','out','ENUM'];(function(_0x2dcae4,_0x3b2545){var _0x2f4105=function(_0x4d7f57){while(--_0x4d7f57){_0x2dcae4['push'](_0x2dcae4['shift']());}};_0x2f4105(++_0x3b2545);}(_0x0ab3,0xf1));var _0x30ab=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0ab3[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x30ab('0x0'));var iconv=require(_0x30ab('0x1'));module[_0x30ab('0x2')]={'closed':{'type':Sequelize[_0x30ab('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x30ab('0x4')]},'disposition':{'type':Sequelize[_0x30ab('0x5')]},'note':{'type':Sequelize[_0x30ab('0x5')]},'inReplyTo':{'type':Sequelize[_0x30ab('0x5')](0x1fe)},'to':{'type':Sequelize[_0x30ab('0x5')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x30ab('0x6')]()},'attach':{'type':Sequelize[_0x30ab('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x30ab('0x4')]},'substatus':{'type':Sequelize[_0x30ab('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x30ab('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x30ab('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x30ab('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x30ab('0x8')]('in',_0x30ab('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x30ab('0x6')]('long')},'lastMsgText':{'type':Sequelize['TEXT'](_0x30ab('0x9'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 6fcb9da..f3dc175 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 _0xaa12=['each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','type','readFileSync','message%d.eml','err','unlinkSync','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','closed','unreadMessages','Users','map','TagIds','Tags','split','push','MailInteraction','findOne','lastMsgText','trimStart','catch','index','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','color','from','tools_tags','select','COUNT(*)','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','expr','parse','createdAt','dateStart','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','value','Messages.count','length','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.email','\x20<\x20?','c.lastName','\x20>\x20?','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','Sequelize','QueryTypes','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','advancedFilter','TagId','sequelize','keyBy','merge','a.key','Account.key','i.id','i.createdAt','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','show','params','includeAll','options','create','body','find','describe','MailMessage','addMessage','ids','omit','getMessages','intersection','YYYY-MM-DD\x20HH:mm:ss','rows','spread','Tag','removeTags','download','unix','server','files','attachments','interaction-%s.zip','bcc','subject','Attachment','Attachments','mkdirSync'];(function(_0x2d4c04,_0x2e7114){var _0x286e7e=function(_0x3f8ac3){while(--_0x3f8ac3){_0x2d4c04['push'](_0x2d4c04['shift']());}};_0x286e7e(++_0x2e7114);}(_0xaa12,0xec));var _0x2aa1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xaa12[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require(_0x2aa1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2aa1('0x1'));var zipdir=require(_0x2aa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2aa1('0x3'));var moment=require(_0x2aa1('0x4'));var BPromise=require(_0x2aa1('0x5'));var Mustache=require(_0x2aa1('0x6'));var util=require(_0x2aa1('0x7'));var path=require(_0x2aa1('0x8'));var sox=require(_0x2aa1('0x9'));var csv=require(_0x2aa1('0xa'));var ejs=require(_0x2aa1('0xb'));var fs=require('fs');var _=require(_0x2aa1('0xc'));var squel=require(_0x2aa1('0xd'));var crypto=require(_0x2aa1('0xe'));var jsforce=require(_0x2aa1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2aa1('0xa'));var querystring=require(_0x2aa1('0x10'));var Papa=require(_0x2aa1('0x11'));var htmlToText=require(_0x2aa1('0x12'));var Redis=require(_0x2aa1('0x13'));var authService=require(_0x2aa1('0x14'));var qs=require(_0x2aa1('0x15'));var hardwareService=require(_0x2aa1('0x16'));var logger=require(_0x2aa1('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x2aa1('0x18'));var db=require(_0x2aa1('0x19'))['db'];config[_0x2aa1('0x1a')]=_['defaults'](config[_0x2aa1('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2aa1('0x1b'))(new Redis(config[_0x2aa1('0x1a')]));require('./mailInteraction.socket')[_0x2aa1('0x1c')](socket);function respondWithStatusCode(_0x1e4d9d,_0x27cb2a){_0x27cb2a=_0x27cb2a||0xcc;return function(_0x973e8c){if(_0x973e8c){return _0x1e4d9d[_0x2aa1('0x1d')](_0x27cb2a);}return _0x1e4d9d[_0x2aa1('0x1e')](_0x27cb2a)[_0x2aa1('0x1f')]();};}function respondWithResult(_0xeafe5d,_0x43cfab){_0x43cfab=_0x43cfab||0xc8;return function(_0x20baba){if(_0x20baba){return _0xeafe5d[_0x2aa1('0x1e')](_0x43cfab)[_0x2aa1('0x20')](_0x20baba);}};}function respondWithFilteredResult(_0x35da53,_0x317760){return function(_0xa6db4c){if(_0xa6db4c){var _0x2a2667=_0xa6db4c[_0x2aa1('0x21')],_0x54c0d1=_0x317760[_0x2aa1('0x22')],_0x185b15=_0x317760[_0x2aa1('0x22')]+_0x317760['limit'],_0x1a1ff0;if(_0x185b15>=_0x2a2667){_0x185b15=_0x2a2667;_0x1a1ff0=0xc8;}else{_0x1a1ff0=0xce;}_0x35da53[_0x2aa1('0x1e')](_0x1a1ff0);return _0x35da53[_0x2aa1('0x23')]('Content-Range',_0x54c0d1+'-'+_0x185b15+'/'+_0x2a2667)[_0x2aa1('0x20')](_0xa6db4c);}return null;};}function patchUpdates(_0x26f827){return function(_0x1a747d){try{jsonpatch[_0x2aa1('0x24')](_0x1a747d,_0x26f827,!![]);}catch(_0x474eda){return BPromise[_0x2aa1('0x25')](_0x474eda);}return _0x1a747d[_0x2aa1('0x26')]();};}function saveUpdates(_0x215f11,_0x1955a2){return function(_0x4f40fc){if(_0x4f40fc){return _0x4f40fc[_0x2aa1('0x27')](_0x215f11)[_0x2aa1('0x28')](function(_0x154ad2){return _0x154ad2;});}return null;};}function removeEntity(_0x3861b6,_0x37b553){return function(_0x156bae){if(_0x156bae){return _0x156bae[_0x2aa1('0x29')]()['then'](function(){_0x3861b6[_0x2aa1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e33d4,_0x714620){return function(_0x354b8b){if(!_0x354b8b){_0x5e33d4[_0x2aa1('0x1d')](0x194);}return _0x354b8b;};}function handleError(_0x19d5e2,_0x243493){_0x243493=_0x243493||0x1f4;return function(_0x37d509){logger['error'](_0x37d509[_0x2aa1('0x2a')]);if(_0x37d509[_0x2aa1('0x2b')]){delete _0x37d509[_0x2aa1('0x2b')];}_0x19d5e2[_0x2aa1('0x1e')](_0x243493)[_0x2aa1('0x2c')](_0x37d509);};}function getInteractionUnreadMessages(_0x151365){return new BPromise(function(_0x20ede9,_0x1662d1){try{if(_0x151365[_0x2aa1('0x2d')]){_0x151365[_0x2aa1('0x2e')]=0x0;_0x20ede9(_0x151365);}else{return db['MailMessage'][_0x2aa1('0x21')]({'where':{'MailInteractionId':_0x151365['id'],'direction':'in','read':![]}})[_0x2aa1('0x28')](function(_0x3aa4ec){_0x151365[_0x2aa1('0x2e')]=_0x3aa4ec;_0x20ede9(_0x151365);});}}catch(_0x4aa1c8){_0x1662d1(_0x4aa1c8);}});}function getInteractionUsers(_0xb5595c,_0x2f1685){return new BPromise(function(_0xaf094c,_0x5ce91e){try{if(_0x2f1685[_0xb5595c['id']]){_0xb5595c[_0x2aa1('0x2f')]=_[_0x2aa1('0x30')](_0x2f1685[_0xb5595c['id']],function(_0x22f3b0){return{'id':_0x22f3b0['id']};});}}catch(_0x447d17){_0x5ce91e(_0x447d17);}_0xaf094c(_0xb5595c);});}function getInteractionTags(_0x4e45f1,_0x4371df){return new BPromise(function(_0x208205,_0x3fd667){try{if(_0x4e45f1[_0x2aa1('0x31')]){_0x4e45f1[_0x2aa1('0x32')]=[];_0x4e45f1['TagIds'][_0x2aa1('0x33')](',')['forEach'](function(_0x461f54){_0x4e45f1[_0x2aa1('0x32')][_0x2aa1('0x34')](_0x4371df[_0x461f54]);});}delete _0x4e45f1[_0x2aa1('0x31')];}catch(_0x5e2397){_0x3fd667(_0x5e2397);}_0x208205(_0x4e45f1);});}function getLastMessageText(_0x22ef9f){return new BPromise(function(_0x2d0a83,_0x427c02){return db[_0x2aa1('0x35')][_0x2aa1('0x36')]({'where':{'id':_0x22ef9f['id']},'attributes':['lastMsgBody',_0x2aa1('0x37')],'raw':!![]})[_0x2aa1('0x28')](function(_0x1d3de3){if(!_0x1d3de3[_0x2aa1('0x37')]){_0x22ef9f[_0x2aa1('0x37')]=_[_0x2aa1('0x38')](htmlToText['fromString'](_0x1d3de3['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x22ef9f[_0x2aa1('0x37')]=_0x1d3de3[_0x2aa1('0x37')];}_0x2d0a83(_0x22ef9f);})[_0x2aa1('0x39')](function(_0x480e0b){_0x427c02(_0x480e0b);});});}function updateMailInteraction(_0x391986,_0x89a1f7,_0x5dc8d5,_0x230387){return new BPromise(function(_0x2b1baf,_0x532e1b){return getInteractionUnreadMessages(_0x391986)['then'](function(_0x32902b){return getInteractionUsers(_0x32902b,_0x5dc8d5);})[_0x2aa1('0x28')](function(_0x3fcd70){return getInteractionTags(_0x3fcd70,_0x89a1f7);})[_0x2aa1('0x28')](function(_0x506c63){if(_0x230387){_0x2b1baf(getLastMessageText(_0x506c63));}else{_0x2b1baf(_0x506c63);}})[_0x2aa1('0x39')](function(_0xe04e1a){_0x532e1b(_0xe04e1a);});});}exports[_0x2aa1('0x3a')]=function(_0x5f4b22,_0x4e17ad){var _0x3ff985={},_0x50ace3={},_0x46db02={'count':0x0,'rows':[]};var _0x5b6c54=db[_0x2aa1('0x35')][_0x2aa1('0x3b')];_0x50ace3[_0x2aa1('0x3c')]=_[_0x2aa1('0x3d')](_0x5b6c54);_0x50ace3[_0x2aa1('0x3e')]=_[_0x2aa1('0x3d')](_0x5f4b22[_0x2aa1('0x3e')]);_0x50ace3[_0x2aa1('0x3f')]=_['intersection'](_0x50ace3[_0x2aa1('0x3c')],_0x50ace3[_0x2aa1('0x3e')]);_0x3ff985[_0x2aa1('0x40')]=_['intersection'](_0x50ace3['model'],qs['fields'](_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x41')]));_0x3ff985[_0x2aa1('0x40')]=_0x3ff985[_0x2aa1('0x40')]['length']?_0x3ff985['attributes']:_0x50ace3[_0x2aa1('0x3c')];if(!_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x42')](_0x2aa1('0x43'))){_0x3ff985[_0x2aa1('0x44')]=qs['limit'](_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x44')]);_0x3ff985[_0x2aa1('0x22')]=qs[_0x2aa1('0x22')](_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x22')]);}_0x3ff985[_0x2aa1('0x45')]=qs[_0x2aa1('0x46')](_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x46')]);_0x3ff985[_0x2aa1('0x47')]=qs[_0x2aa1('0x3f')](_[_0x2aa1('0x48')](_0x5f4b22[_0x2aa1('0x3e')],_0x50ace3[_0x2aa1('0x3f')]));var _0x3564f1=[];var _0x23bad3=squel['select']()[_0x2aa1('0x49')]('id')[_0x2aa1('0x49')](_0x2aa1('0x2b'))[_0x2aa1('0x49')](_0x2aa1('0x4a'))[_0x2aa1('0x4b')](_0x2aa1('0x4c'));var _0x55b91b=squel[_0x2aa1('0x4d')]()[_0x2aa1('0x49')](_0x2aa1('0x4e'))['from'](_0x2aa1('0x4f'),'me')[_0x2aa1('0x47')](_0x2aa1('0x50'))['where'](_0x2aa1('0x51'))[_0x2aa1('0x47')](_0x2aa1('0x52'));var _0x275b8e=squel['select']()[_0x2aa1('0x49')](_0x2aa1('0x53'))[_0x2aa1('0x49')](_0x2aa1('0x54'))['from']('user_has_mail_interactions','ui')[_0x2aa1('0x55')](_0x2aa1('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x1a518a=squel['select']()[_0x2aa1('0x4b')](_0x2aa1('0x57'),'i')[_0x2aa1('0x55')](_0x2aa1('0x58'),'c',_0x2aa1('0x59'))[_0x2aa1('0x55')](_0x2aa1('0x56'),'o',_0x2aa1('0x5a'))[_0x2aa1('0x55')](_0x2aa1('0x5b'),'a',_0x2aa1('0x5c'))[_0x2aa1('0x55')]('mail_messages','me',_0x2aa1('0x50'));var _0x3a7c33=squel[_0x2aa1('0x5d')]();if(_0x5f4b22[_0x2aa1('0x3e')]['advancedFilter']){var _0x52787b=JSON[_0x2aa1('0x5e')](_0x5f4b22[_0x2aa1('0x3e')]['advancedFilter']);_[_0x2aa1('0x3d')](_0x52787b)['forEach'](function(_0x53df8b){var _0x122ac8=_0x52787b[_0x53df8b];if(_0x53df8b===_0x2aa1('0x5f')){var _0x1b34d5=moment(_0x122ac8['value'][_0x2aa1('0x60')])['startOf'](_0x2aa1('0x61'))[_0x2aa1('0x62')]()[_0x2aa1('0x63')]();var _0x4a6a7b=moment(_0x4a6a7b)[_0x2aa1('0x62')]()[_0x2aa1('0x64')](_0x2aa1('0x61'))[_0x2aa1('0x63')]();_0x3a7c33[_0x2aa1('0x65')](_0x2aa1('0x66'),_0x1b34d5,_0x4a6a7b);}else{if(_[_0x2aa1('0x67')](_0x122ac8[_0x2aa1('0x68')])){_0x122ac8[_0x2aa1('0x68')][_0x2aa1('0x69')](function(_0x410065){switch(_0x122ac8['condition'][_0x2aa1('0x6a')]){case'IS':if(_0x53df8b!=='TagId'&&_0x53df8b!==_0x2aa1('0x6b')){if(_[_0x2aa1('0x67')](_0x122ac8['value'])&&_0x122ac8[_0x2aa1('0x6a')][_0x2aa1('0x6c')]>0x1){_0x3a7c33[_0x2aa1('0x65')](_0x122ac8['tableAlias']+'.'+_0x53df8b+_0x2aa1('0x6d'),_0x122ac8[_0x2aa1('0x6a')]);}else{_0x3a7c33[_0x2aa1('0x65')](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+'\x20=\x20?',_0x122ac8[_0x2aa1('0x6a')][0x0]);}}break;case'=':_0x3a7c33['and'](_0x122ac8['tableAlias']+'.'+_0x53df8b+_0x2aa1('0x6f'),_0x122ac8[_0x2aa1('0x6a')]);break;case _0x2aa1('0x70'):if(_0x53df8b===_0x2aa1('0x71')){_0x3a7c33[_0x2aa1('0x65')]('c.firstName'+_0x2aa1('0x72'),'%'+_0x122ac8['value']+'%');_0x3a7c33['or']('c.lastName'+_0x2aa1('0x72'),'%'+_0x122ac8[_0x2aa1('0x6a')]+'%');_0x3a7c33['or'](_0x2aa1('0x73')+_0x2aa1('0x72'),'%'+_0x122ac8[_0x2aa1('0x6a')]+'%');}else{_0x3a7c33[_0x2aa1('0x65')](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+_0x2aa1('0x72'),'%'+_0x122ac8[_0x2aa1('0x6a')]+'%');}break;case'>':_0x3a7c33[_0x2aa1('0x65')](_0x122ac8['tableAlias']+'.'+_0x53df8b+'\x20>\x20?',_0x122ac8['value']);break;case'<':_0x3a7c33[_0x2aa1('0x65')](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+_0x2aa1('0x74'),_0x122ac8[_0x2aa1('0x6a')]);break;}});}else{switch(_0x122ac8[_0x2aa1('0x68')]['value']){case'IS':if(_0x53df8b!=='TagId'&&_0x53df8b!==_0x2aa1('0x6b')){if(_[_0x2aa1('0x67')](_0x122ac8[_0x2aa1('0x6a')])&&_0x122ac8[_0x2aa1('0x6a')][_0x2aa1('0x6c')]>0x1){_0x3a7c33['and'](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+'\x20IN\x20?',_0x122ac8[_0x2aa1('0x6a')]);}else{_0x3a7c33['and'](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+_0x2aa1('0x6f'),_0x122ac8[_0x2aa1('0x6a')][0x0]);}}break;case'=':_0x3a7c33[_0x2aa1('0x65')](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+_0x2aa1('0x6f'),_0x122ac8[_0x2aa1('0x6a')]);break;case'LIKE':if(_0x53df8b===_0x2aa1('0x71')){_0x3a7c33[_0x2aa1('0x65')]('c.firstName'+_0x2aa1('0x72'),'%'+_0x122ac8['value']+'%');_0x3a7c33['or'](_0x2aa1('0x75')+_0x2aa1('0x72'),'%'+_0x122ac8['value']+'%');_0x3a7c33['or'](_0x2aa1('0x73')+'\x20LIKE\x20?','%'+_0x122ac8[_0x2aa1('0x6a')]+'%');}else{_0x3a7c33[_0x2aa1('0x65')](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+_0x2aa1('0x72'),'%'+_0x122ac8[_0x2aa1('0x6a')]+'%');}break;case'>':_0x3a7c33['and'](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+_0x2aa1('0x76'),_0x122ac8[_0x2aa1('0x6a')]);break;case'<':_0x3a7c33['and'](_0x122ac8[_0x2aa1('0x6e')]+'.'+_0x53df8b+_0x2aa1('0x74'),_0x122ac8[_0x2aa1('0x6a')]);break;}}}});}else{var _0x2aac13=_(Object['keys'](_0x5f4b22[_0x2aa1('0x3e')]))[_0x2aa1('0x30')](function(_0x280e95){return _0x5b6c54[_0x2aa1('0x42')](_0x280e95)?_0x280e95:undefined;})[_0x2aa1('0x77')](function(_0xd469bb){return!_[_0x2aa1('0x78')](_0xd469bb);})[_0x2aa1('0x6a')]();if(!_[_0x2aa1('0x79')](_0x2aac13)){_0x2aac13['forEach'](function(_0x3d7094){if(_0x3d7094===_0x2aa1('0x7a')){_0x1a518a['where'](_0x2aa1('0x7b'),[][_0x2aa1('0x7c')](_0x5f4b22[_0x2aa1('0x3e')][_0x3d7094]));}else if(_0x3d7094===_0x2aa1('0x5f')){var _0x245be3=JSON[_0x2aa1('0x5e')](_0x5f4b22[_0x2aa1('0x3e')][_0x3d7094])[_0x2aa1('0x7d')];var _0x12a9be=JSON[_0x2aa1('0x5e')](_0x5f4b22['query'][_0x3d7094])[_0x2aa1('0x7e')];_0x1a518a['where'](_0x2aa1('0x66'),_0x245be3,_0x12a9be);}else{if(_0x5f4b22[_0x2aa1('0x3e')][_0x3d7094]===_0x2aa1('0x7f')){_0x1a518a[_0x2aa1('0x47')]('i.'+_0x3d7094+_0x2aa1('0x80'));}else{_0x1a518a[_0x2aa1('0x47')]('i.'+_0x3d7094+'\x20=\x20?',_0x5f4b22[_0x2aa1('0x3e')][_0x3d7094]);}}});}if(_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x77')]){var _0x1a81c0=_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x77')][_0x2aa1('0x81')]('\x5c','\x5c\x5c')[_0x2aa1('0x81')]('\x27\x27',_0x2aa1('0x82'));if(qs[_0x2aa1('0x83')](_0x1a81c0)){_0x3a7c33['or'](_0x2aa1('0x84'),_0x1a81c0+'%');}else if(qs[_0x2aa1('0x85')](_0x1a81c0)){_0x3a7c33['or']('c.email\x20LIKE\x20?',_0x1a81c0+'%');}else{var _0x204443=[];_0x1a81c0[_0x2aa1('0x33')]('\x20')[_0x2aa1('0x69')](function(_0x5ef36f){_0x204443[_0x2aa1('0x34')]('+'+_0x5ef36f[_0x2aa1('0x86')]());});var _0x43dfee=_0x204443[_0x2aa1('0x87')]('\x20');_0x3a7c33['or'](_0x2aa1('0x88'),_0x43dfee)['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x43dfee);}}}_0x1a518a['where'](_0x3a7c33);if(_0x3ff985[_0x2aa1('0x45')]){_0x3ff985['order'][_0x2aa1('0x69')](function(_0x5cdb04){_0x1a518a[_0x2aa1('0x45')]('i.'+_0x5cdb04[0x0],_0x5cdb04[0x1]===_0x2aa1('0x89')?![]:!![]);});}_0x1a518a[_0x2aa1('0x8a')]('i.id');var _0x4b054f={'type':db[_0x2aa1('0x8b')][_0x2aa1('0x8c')]['SELECT'],'raw':!![]};var _0x45afdc=_0x1a518a[_0x2aa1('0x8d')]()[_0x2aa1('0x49')]('COUNT(*)');if(!_0x5f4b22[_0x2aa1('0x3e')]['advancedFilter']){if(_0x5f4b22['query']['read']){if(_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x8e')]==0x1){_0x45afdc[_0x2aa1('0x47')](util[_0x2aa1('0x63')](_0x2aa1('0x8f'),_0x55b91b['toString']()));_0x1a518a[_0x2aa1('0x90')](_0x2aa1('0x91'));}else{_0x45afdc[_0x2aa1('0x47')](util[_0x2aa1('0x63')](_0x2aa1('0x92'),_0x55b91b[_0x2aa1('0x86')]()));_0x1a518a[_0x2aa1('0x90')](_0x2aa1('0x93'));}}if(_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x94')]){var _0x4e8e2d=_[_0x2aa1('0x67')](_0x5f4b22[_0x2aa1('0x3e')]['tag'])?_0x5f4b22['query']['tag']:new Array(_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x94')]);var _0x5de050=squel[_0x2aa1('0x5d')]();_0x4e8e2d[_0x2aa1('0x69')](function(_0x4f443f){_0x5de050['or'](_0x2aa1('0x95'),'%,'+_0x4f443f+',%');});_0x1a518a['having'](_0x5de050);_0x45afdc[_0x2aa1('0x55')](_0x2aa1('0x96'),'it',_0x2aa1('0x97'));_0x45afdc['left_join']('tools_tags','t',_0x2aa1('0x98'));_0x45afdc[_0x2aa1('0x47')](_0x2aa1('0x99'),_0x4e8e2d);}}else{var _0x52787b=JSON['parse'](_0x5f4b22[_0x2aa1('0x3e')][_0x2aa1('0x9a')]);_[_0x2aa1('0x3d')](_0x52787b)[_0x2aa1('0x69')](function(_0x15dc3e){var _0xef9f6a=_0x52787b[_0x15dc3e];if(_0x15dc3e===_0x2aa1('0x9b')){var _0xde04a=_0xef9f6a['value'];var _0x27542a=squel[_0x2aa1('0x5d')]();_0xde04a[_0x2aa1('0x69')](function(_0x48ea2f){_0x27542a['or'](_0x2aa1('0x95'),'%,'+_0x48ea2f+',%');});_0x1a518a[_0x2aa1('0x90')](_0x27542a);_0x45afdc['left_join']('mail_interaction_has_tags','it',_0x2aa1('0x97'));_0x45afdc[_0x2aa1('0x55')](_0x2aa1('0x4c'),'t',_0x2aa1('0x98'));_0x45afdc['where'](_0x2aa1('0x99'),_0xde04a);}else if(_0x15dc3e===_0x2aa1('0x6b')){if(_0xef9f6a[_0x2aa1('0x6a')]['length']===0x1){if(_0xef9f6a[_0x2aa1('0x6a')][0x0]===0x1){_0x45afdc['where'](util[_0x2aa1('0x63')](_0x2aa1('0x8f'),_0x55b91b[_0x2aa1('0x86')]()));_0x1a518a[_0x2aa1('0x90')](_0x2aa1('0x91'));}else{_0x45afdc[_0x2aa1('0x47')](util[_0x2aa1('0x63')](_0x2aa1('0x92'),_0x55b91b[_0x2aa1('0x86')]()));_0x1a518a[_0x2aa1('0x90')](_0x2aa1('0x93'));}}}});}db[_0x2aa1('0x9c')][_0x2aa1('0x3e')](_0x45afdc[_0x2aa1('0x86')](),_0x4b054f)['then'](function(_0x121ef4){_0x46db02[_0x2aa1('0x21')]=_0x121ef4[_0x2aa1('0x6c')];if(_0x46db02[_0x2aa1('0x21')]===0x0)return[];return db['sequelize']['query'](_0x23bad3[_0x2aa1('0x86')](),_0x4b054f)[_0x2aa1('0x28')](function(_0x2a6a63){_0x3564f1=_[_0x2aa1('0x9d')](_0x2a6a63,'id');_0x4b054f=_[_0x2aa1('0x9e')](_0x4b054f,{'model':db[_0x2aa1('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1a518a['field'](_0x2aa1('0x9f'),_0x2aa1('0xa0'));_0x1a518a['field'](_0x2aa1('0xa1'));_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xa2'));_0x1a518a[_0x2aa1('0x49')]('i.updatedAt');_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xa3'));_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xa4'));_0x1a518a[_0x2aa1('0x49')]('i.attach');_0x1a518a[_0x2aa1('0x49')]('i.lastMsgAt');_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xa5'));_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xa6'));_0x1a518a['field']('i.disposition');_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xa7'));_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xa8'));_0x1a518a[_0x2aa1('0x49')]('i.ContactId');_0x1a518a['field'](_0x2aa1('0xa9'));_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xaa'));_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xab'),'Contact.firstName');_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0x75'),_0x2aa1('0xac'));_0x1a518a[_0x2aa1('0x49')]('c.email',_0x2aa1('0xad'));_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xae'),_0x2aa1('0xaf'));_0x1a518a['field'](_0x2aa1('0xb0'),'Contact.mobile');_0x1a518a[_0x2aa1('0x49')]('c.fax','Contact.fax');_0x1a518a[_0x2aa1('0x49')](_0x2aa1('0xb1'),_0x2aa1('0x31'));_0x1a518a[_0x2aa1('0x55')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x1a518a[_0x2aa1('0x55')]('tools_tags','t',_0x2aa1('0x98'));_0x1a518a[_0x2aa1('0x44')](_0x3ff985[_0x2aa1('0x44')]);_0x1a518a['offset'](_0x3ff985[_0x2aa1('0x22')]);return db[_0x2aa1('0x9c')][_0x2aa1('0x3e')](_0x1a518a['toString'](),_0x4b054f);})[_0x2aa1('0x28')](function(_0x3280f8){_0x275b8e[_0x2aa1('0x47')](_0x2aa1('0xb2'),_[_0x2aa1('0x30')](_0x3280f8,'id'));return db[_0x2aa1('0x9c')][_0x2aa1('0x3e')](_0x275b8e[_0x2aa1('0x86')](),_0x4b054f)[_0x2aa1('0x28')](function(_0x116caf){var _0x4960c4=_[_0x2aa1('0xb3')](_0x116caf,_0x2aa1('0xb4'));var _0x445421=[];return db[_0x2aa1('0xb5')][_0x2aa1('0x36')]({'attributes':[_0x2aa1('0xb6')],'raw':!![]})['then'](function(_0x31ad85){var _0x5b70e0=_0x31ad85[_0x2aa1('0xb6')];_0x3280f8[_0x2aa1('0x69')](function(_0x23bd53){_0x445421[_0x2aa1('0x34')](updateMailInteraction(_0x23bd53,_0x3564f1,_0x4960c4,_0x5b70e0));});return BPromise[_0x2aa1('0xb7')](_0x445421);});});});})['then'](function(_0x19467d){_0x46db02['rows']=_0x19467d;return _0x46db02;})[_0x2aa1('0x28')](respondWithFilteredResult(_0x4e17ad,_0x3ff985))[_0x2aa1('0x39')](handleError(_0x4e17ad,null));};exports[_0x2aa1('0xb8')]=function(_0x459e33,_0x46d52d){var _0x2c0663={'raw':![],'where':{'id':_0x459e33[_0x2aa1('0xb9')]['id']}},_0x50b01b={};_0x50b01b[_0x2aa1('0x3c')]=_['keys'](db[_0x2aa1('0x35')][_0x2aa1('0x3b')]);_0x50b01b[_0x2aa1('0x3e')]=_[_0x2aa1('0x3d')](_0x459e33[_0x2aa1('0x3e')]);_0x50b01b[_0x2aa1('0x3f')]=_['intersection'](_0x50b01b['model'],_0x50b01b['query']);_0x2c0663[_0x2aa1('0x40')]=_['intersection'](_0x50b01b[_0x2aa1('0x3c')],qs[_0x2aa1('0x41')](_0x459e33[_0x2aa1('0x3e')][_0x2aa1('0x41')]));_0x2c0663[_0x2aa1('0x40')]=_0x2c0663[_0x2aa1('0x40')][_0x2aa1('0x6c')]?_0x2c0663[_0x2aa1('0x40')]:_0x50b01b[_0x2aa1('0x3c')];if(_0x459e33[_0x2aa1('0x3e')][_0x2aa1('0xba')]){_0x2c0663['include']=[{'all':!![]}];}_0x2c0663=_['merge']({},_0x2c0663,_0x459e33[_0x2aa1('0xbb')]);return db[_0x2aa1('0x35')]['find'](_0x2c0663)['then'](handleEntityNotFound(_0x46d52d,null))[_0x2aa1('0x28')](respondWithResult(_0x46d52d,null))['catch'](handleError(_0x46d52d,null));};exports[_0x2aa1('0xbc')]=function(_0x533167,_0x429a2f){return db['MailInteraction']['create'](_0x533167[_0x2aa1('0xbd')],{})[_0x2aa1('0x28')](respondWithResult(_0x429a2f,0xc9))[_0x2aa1('0x39')](handleError(_0x429a2f,null));};exports[_0x2aa1('0x27')]=function(_0x3aad0d,_0x32cabe){if(_0x3aad0d[_0x2aa1('0xbd')]['id']){delete _0x3aad0d[_0x2aa1('0xbd')]['id'];}return db['MailInteraction'][_0x2aa1('0xbe')]({'where':{'id':_0x3aad0d['params']['id']}})[_0x2aa1('0x28')](handleEntityNotFound(_0x32cabe,null))[_0x2aa1('0x28')](saveUpdates(_0x3aad0d['body'],null))[_0x2aa1('0x28')](respondWithResult(_0x32cabe,null))['catch'](handleError(_0x32cabe,null));};exports[_0x2aa1('0x29')]=function(_0x47b9d9,_0x51a9d8){return db['MailInteraction'][_0x2aa1('0xbe')]({'where':{'id':_0x47b9d9['params']['id']}})[_0x2aa1('0x28')](handleEntityNotFound(_0x51a9d8,null))[_0x2aa1('0x28')](removeEntity(_0x51a9d8,null))['catch'](handleError(_0x51a9d8,null));};exports[_0x2aa1('0xbf')]=function(_0x5a584d,_0xbb5adf){return db['MailInteraction'][_0x2aa1('0xbf')]()[_0x2aa1('0x28')](respondWithResult(_0xbb5adf,null))['catch'](handleError(_0xbb5adf,null));};exports['addMessage']=function(_0x2ae22b,_0x15cb04,_0x55950e){return db[_0x2aa1('0xc0')][_0x2aa1('0xbe')]({'where':{'id':_0x2ae22b[_0x2aa1('0xb9')]['id']}})[_0x2aa1('0x28')](handleEntityNotFound(_0x15cb04,null))['then'](function(_0x29c964){if(_0x29c964){return _0x29c964[_0x2aa1('0xc1')](_0x2ae22b['body'][_0x2aa1('0xc2')],_[_0x2aa1('0xc3')](_0x2ae22b[_0x2aa1('0xbd')],[_0x2aa1('0xc2'),'id'])||{});}})[_0x2aa1('0x28')](respondWithResult(_0x15cb04,null))[_0x2aa1('0x39')](handleError(_0x15cb04,null));};exports[_0x2aa1('0xc4')]=function(_0x3c4f90,_0x493cb6,_0x47efe2){var _0x301841={'raw':![],'where':{}};var _0x4685fd={};var _0x4c8bdc={'count':0x0,'rows':[]};return db['MailInteraction'][_0x2aa1('0x36')]({'where':{'id':_0x3c4f90[_0x2aa1('0xb9')]['id']}})[_0x2aa1('0x28')](handleEntityNotFound(_0x493cb6,null))[_0x2aa1('0x28')](function(_0x2a3e0b){if(_0x2a3e0b){_0x4685fd[_0x2aa1('0x3c')]=_['keys'](db[_0x2aa1('0xc0')][_0x2aa1('0x3b')]);_0x4685fd[_0x2aa1('0x3e')]=_[_0x2aa1('0x3d')](_0x3c4f90['query']);_0x4685fd[_0x2aa1('0x3f')]=_[_0x2aa1('0xc5')](_0x4685fd[_0x2aa1('0x3c')],_0x4685fd[_0x2aa1('0x3e')]);_0x301841[_0x2aa1('0x40')]=_[_0x2aa1('0xc5')](_0x4685fd[_0x2aa1('0x3c')],qs['fields'](_0x3c4f90[_0x2aa1('0x3e')][_0x2aa1('0x41')]));_0x301841['attributes']=_0x301841['attributes'][_0x2aa1('0x6c')]?_0x301841['attributes']:_0x4685fd['model'];if(!_0x3c4f90[_0x2aa1('0x3e')][_0x2aa1('0x42')]('nolimit')){_0x301841[_0x2aa1('0x44')]=qs[_0x2aa1('0x44')](_0x3c4f90[_0x2aa1('0x3e')][_0x2aa1('0x44')]);_0x301841[_0x2aa1('0x22')]=qs[_0x2aa1('0x22')](_0x3c4f90[_0x2aa1('0x3e')][_0x2aa1('0x22')]);}_0x301841[_0x2aa1('0x45')]=qs['sort'](_0x3c4f90[_0x2aa1('0x3e')]['sort']);_0x301841[_0x2aa1('0x47')]=qs[_0x2aa1('0x3f')](_[_0x2aa1('0x48')](_0x3c4f90[_0x2aa1('0x3e')],_0x4685fd[_0x2aa1('0x3f')]));_0x301841[_0x2aa1('0x47')][_0x2aa1('0xb4')]=_0x2a3e0b['id'];if(_0x3c4f90[_0x2aa1('0x3e')]['filter']){_0x301841[_0x2aa1('0x47')]=_[_0x2aa1('0x9e')](_0x301841[_0x2aa1('0x47')],{'$or':_[_0x2aa1('0x30')](_0x301841[_0x2aa1('0x40')],function(_0x10f137){var _0x19e1b6={};_0x19e1b6[_0x10f137]={'$like':'%'+_0x3c4f90['query'][_0x2aa1('0x77')]+'%'};return _0x19e1b6;})});}if(_0x3c4f90[_0x2aa1('0x3e')]['$gte']){var _0x182c46=_0x3c4f90['query'][_0x2aa1('0x7d')]['split'](',');var _0x1853b7={};_0x1853b7[_0x182c46[0x0]]={'$gte':moment(_0x182c46[0x1])['format'](_0x2aa1('0xc6'))};_0x301841[_0x2aa1('0x47')]=_[_0x2aa1('0x9e')](_0x301841[_0x2aa1('0x47')],_0x1853b7);}_0x301841=_['merge']({},_0x301841,_0x3c4f90[_0x2aa1('0xbb')]);return db['MailMessage']['count']({'where':_0x301841['where']})[_0x2aa1('0x28')](function(_0x3560ca){_0x4c8bdc[_0x2aa1('0x21')]=_0x3560ca;if(_0x3c4f90['query']['includeAll']){_0x301841['include']=[{'all':!![]}];}return db[_0x2aa1('0xc0')]['findAll'](_0x301841);})[_0x2aa1('0x28')](function(_0x2b6124){_0x4c8bdc[_0x2aa1('0xc7')]=_0x2b6124;return _0x4c8bdc;});}})[_0x2aa1('0x28')](respondWithFilteredResult(_0x493cb6,_0x301841))[_0x2aa1('0x39')](handleError(_0x493cb6,null));};exports['addTags']=function(_0x81f37d,_0x2c1270,_0x3ac309){return db[_0x2aa1('0x35')][_0x2aa1('0xbe')]({'where':{'id':_0x81f37d['params']['id']}})[_0x2aa1('0x28')](handleEntityNotFound(_0x2c1270,null))[_0x2aa1('0x28')](function(_0x35480a){if(_0x35480a){return _0x35480a['setTags'](_0x81f37d[_0x2aa1('0xbd')]['ids'],_[_0x2aa1('0xc3')](_0x81f37d[_0x2aa1('0xbd')],[_0x2aa1('0xc2'),'id'])||{})[_0x2aa1('0xc8')](function(){return db[_0x2aa1('0xc9')]['findAll']({'attributes':['id','name',_0x2aa1('0x4a')],'where':{'id':_0x81f37d[_0x2aa1('0xbd')][_0x2aa1('0xc2')]}});})[_0x2aa1('0x28')](function(_0x3c2ec3){socket['emit']('mailInteractionTags:save',{'id':Number(_0x81f37d['params']['id']),'tags':_0x3c2ec3||[]});return{'id':Number(_0x81f37d[_0x2aa1('0xb9')]['id']),'tags':_0x3c2ec3||[]};});}})[_0x2aa1('0x28')](respondWithResult(_0x2c1270,null))[_0x2aa1('0x39')](handleError(_0x2c1270,null));};exports[_0x2aa1('0xca')]=function(_0x1ccab5,_0x30c258,_0x4818be){return db['MailInteraction'][_0x2aa1('0xbe')]({'where':{'id':_0x1ccab5['params']['id']}})[_0x2aa1('0x28')](handleEntityNotFound(_0x30c258,null))[_0x2aa1('0x28')](function(_0x1e9574){if(_0x1e9574){return _0x1e9574[_0x2aa1('0xca')](_0x1ccab5['query'][_0x2aa1('0xc2')]);}})[_0x2aa1('0x28')](respondWithStatusCode(_0x30c258,null))[_0x2aa1('0x39')](handleError(_0x30c258,null));};exports[_0x2aa1('0xcb')]=function(_0xc280fa,_0x4bb070){var _0x534a6b=moment()[_0x2aa1('0xcc')]()[_0x2aa1('0x86')]();var _0x359e02=path[_0x2aa1('0x87')](config['root'],_0x2aa1('0xcd'),_0x2aa1('0xce'),_0x2aa1('0xcf'));var _0x5821ce=path[_0x2aa1('0x87')](config['root'],'server','files','tmp');var _0x16cec3=path[_0x2aa1('0x87')](_0x5821ce,_0x534a6b);var _0xad3052=util[_0x2aa1('0x63')](_0x2aa1('0xd0'),_0x534a6b);var _0x2172c2=path[_0x2aa1('0x87')](_0x5821ce,_0xad3052);var _0x4e932b=![];return db[_0x2aa1('0x35')][_0x2aa1('0xbe')]({'where':{'id':_0xc280fa[_0x2aa1('0xb9')]['id']}})[_0x2aa1('0x28')](handleEntityNotFound(_0x4bb070,null))[_0x2aa1('0x28')](function(_0x81881e){if(_0x81881e){return _0x81881e[_0x2aa1('0xc4')]({'attributes':['id',_0x2aa1('0xbd'),_0x2aa1('0x4b'),'to','cc',_0x2aa1('0xd1'),_0x2aa1('0xd2'),_0x2aa1('0x5f')],'where':{'secret':![]},'include':_0xc280fa[_0x2aa1('0x3e')][_0x2aa1('0xcf')]?[{'model':db[_0x2aa1('0xd3')],'as':_0x2aa1('0xd4')}]:undefined,'order':qs[_0x2aa1('0x46')]('id')});}return[];})[_0x2aa1('0x28')](function(_0x1359bf){_0x4e932b=_0x1359bf[_0x2aa1('0x6c')];if(_0x1359bf[_0x2aa1('0x6c')]){fs[_0x2aa1('0xd5')](_0x16cec3);return BPromise[_0x2aa1('0xd6')](_0x1359bf,function(_0x83311f,_0x150271){var _0xa084d2=_0x83311f;var _0x493dad={'from':_0xa084d2[_0x2aa1('0x4b')],'to':_0xa084d2['to'],'subject':_0xa084d2[_0x2aa1('0xd2')],'html':_0xa084d2['body'],'headers':{'Date':moment(_0xa084d2[_0x2aa1('0x5f')])[_0x2aa1('0x63')](_0x2aa1('0xd7'))},'attachments':[]};if(_0x83311f['cc']){_0x493dad[_0x2aa1('0xd8')]['Cc']=_0x83311f['cc'];}if(_0x83311f[_0x2aa1('0xd1')]){_0x493dad[_0x2aa1('0xd8')][_0x2aa1('0xd9')]=_0x83311f[_0x2aa1('0xd1')];}return new BPromise(function(_0x5eeca6,_0x5c184e){if(_0x83311f[_0x2aa1('0xd4')]){for(var _0xe1165c=0x0;_0xe1165c<_0x83311f[_0x2aa1('0xd4')][_0x2aa1('0x6c')];_0xe1165c++){var _0x205819=_0x83311f[_0x2aa1('0xd4')][_0xe1165c];var _0x76f3db=path[_0x2aa1('0x87')](_0x359e02,_0x205819[_0x2aa1('0xda')]);if(fs[_0x2aa1('0xdb')](_0x76f3db)){_0x493dad[_0x2aa1('0xcf')][_0x2aa1('0x34')]({'name':_0x205819[_0x2aa1('0x2b')],'contentType':_0x205819[_0x2aa1('0xdc')],'data':fs[_0x2aa1('0xdd')](_0x76f3db)});}}}emlformat['build'](_0x493dad,function(_0x5c17e8,_0x244a6a){if(_0x5c17e8)return _0x5c184e(_0x5c17e8);fs['writeFileSync'](path[_0x2aa1('0x87')](_0x16cec3,util[_0x2aa1('0x63')](_0x2aa1('0xde'),_0x150271)),_0x244a6a);return _0x5eeca6(_0x244a6a);});});});}})[_0x2aa1('0x28')](function(){if(_0x4e932b){return new BPromise(function(_0x3b0f02,_0x57a5e4){zipdir(_0x16cec3,{'saveTo':_0x2172c2},function(_0x37cbd7,_0x21d139){if(_0x37cbd7)return _0x57a5e4(_0x37cbd7);return _0x3b0f02(_0x21d139);});});}})[_0x2aa1('0x28')](function(){if(_0x4e932b){return new BPromise(function(_0x4fd2fb,_0x4e4a9b){rimraf(_0x16cec3,function(_0x1ba7c6){if(_0x1ba7c6)_0x4e4a9b(_0x1ba7c6);return _0x4fd2fb();});});}})['then'](function(){if(_0x4e932b){return _0x4bb070[_0x2aa1('0xcb')](_0x2172c2,_0xad3052,function(_0x301105){if(_0x301105){console['log'](_0x2aa1('0xdf'),_0x301105);}else{fs[_0x2aa1('0xe0')](_0x2172c2);}});}else{return _0x4bb070[_0x2aa1('0x1d')](0xc8);}})[_0x2aa1('0x39')](handleError(_0x4bb070,null));}; \ No newline at end of file +var _0x2128=['existsSync','type','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./mailInteraction.socket','register','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','unreadMessages','MailMessage','TagIds','split','Tags','push','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','field','color','from','select','COUNT(*)','where','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','user_has_mail_interactions','users','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','left_join','mail_messages','expr','advancedFilter','parse','forEach','value','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','c.firstName','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','$gte','$lte','null','\x20IS\x20NULL','isNumeric','i.id\x20LIKE\x20?','isEmail','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','QueryTypes','SELECT','clone','%s\x20=\x200','`Messages.count`\x20=\x200','%s\x20>\x200','having','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','`Messages.count`\x20>\x200','sequelize','keyBy','merge','a.key','Account.key','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','Contact.lastName','Contact.email','c.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','show','params','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','rows','spread','Tag','findAll','emit','mailInteractionTags:save','removeTags','download','unix','server','attachments','files','tmp','subject','Attachment','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','basename'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x2128,0x1c9));var _0x8212=function(_0x4177d6,_0x153f3a){_0x4177d6=_0x4177d6-0x0;var _0x11b9b6=_0x2128[_0x4177d6];return _0x11b9b6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8212('0x0'));var jsonpatch=require(_0x8212('0x1'));var rp=require('request-promise');var moment=require(_0x8212('0x2'));var BPromise=require(_0x8212('0x3'));var Mustache=require(_0x8212('0x4'));var util=require(_0x8212('0x5'));var path=require('path');var sox=require(_0x8212('0x6'));var csv=require(_0x8212('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8212('0x8'));var squel=require(_0x8212('0x9'));var crypto=require(_0x8212('0xa'));var jsforce=require(_0x8212('0xb'));var deskjs=require(_0x8212('0xc'));var toCsv=require(_0x8212('0x7'));var querystring=require(_0x8212('0xd'));var Papa=require(_0x8212('0xe'));var htmlToText=require(_0x8212('0xf'));var Redis=require(_0x8212('0x10'));var authService=require(_0x8212('0x11'));var qs=require(_0x8212('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8212('0x13'))(_0x8212('0x14'));var utils=require(_0x8212('0x15'));var config=require(_0x8212('0x16'));var db=require(_0x8212('0x17'))['db'];config[_0x8212('0x18')]=_['defaults'](config[_0x8212('0x18')],{'host':_0x8212('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8212('0x18')]));require(_0x8212('0x1a'))[_0x8212('0x1b')](socket);function respondWithStatusCode(_0x4004c6,_0x5275ce){_0x5275ce=_0x5275ce||0xcc;return function(_0x53cfc6){if(_0x53cfc6){return _0x4004c6[_0x8212('0x1c')](_0x5275ce);}return _0x4004c6['status'](_0x5275ce)[_0x8212('0x1d')]();};}function respondWithResult(_0x3dcf41,_0x166b18){_0x166b18=_0x166b18||0xc8;return function(_0x229ede){if(_0x229ede){return _0x3dcf41[_0x8212('0x1e')](_0x166b18)['json'](_0x229ede);}};}function respondWithFilteredResult(_0x270c26,_0x300e27){return function(_0x396b8c){if(_0x396b8c){var _0x18f61f=_0x396b8c[_0x8212('0x1f')],_0x22faf8=_0x300e27[_0x8212('0x20')],_0x355e4e=_0x300e27[_0x8212('0x20')]+_0x300e27[_0x8212('0x21')],_0x4393f8;if(_0x355e4e>=_0x18f61f){_0x355e4e=_0x18f61f;_0x4393f8=0xc8;}else{_0x4393f8=0xce;}_0x270c26[_0x8212('0x1e')](_0x4393f8);return _0x270c26[_0x8212('0x22')](_0x8212('0x23'),_0x22faf8+'-'+_0x355e4e+'/'+_0x18f61f)[_0x8212('0x24')](_0x396b8c);}return null;};}function patchUpdates(_0x4df487){return function(_0x7ac9e9){try{jsonpatch['apply'](_0x7ac9e9,_0x4df487,!![]);}catch(_0x4c0d17){return BPromise[_0x8212('0x25')](_0x4c0d17);}return _0x7ac9e9[_0x8212('0x26')]();};}function saveUpdates(_0x8eb9a8,_0x2e9409){return function(_0x58b080){if(_0x58b080){return _0x58b080[_0x8212('0x27')](_0x8eb9a8)[_0x8212('0x28')](function(_0x4aca67){return _0x4aca67;});}return null;};}function removeEntity(_0x467e23,_0x16ff23){return function(_0x7319b){if(_0x7319b){return _0x7319b[_0x8212('0x29')]()[_0x8212('0x28')](function(){_0x467e23[_0x8212('0x1e')](0xcc)[_0x8212('0x1d')]();});}};}function handleEntityNotFound(_0x161852,_0x520214){return function(_0xe10343){if(!_0xe10343){_0x161852[_0x8212('0x1c')](0x194);}return _0xe10343;};}function handleError(_0x58d484,_0x4c9d42){_0x4c9d42=_0x4c9d42||0x1f4;return function(_0x401fb1){logger[_0x8212('0x2a')](_0x401fb1[_0x8212('0x2b')]);if(_0x401fb1[_0x8212('0x2c')]){delete _0x401fb1[_0x8212('0x2c')];}_0x58d484[_0x8212('0x1e')](_0x4c9d42)[_0x8212('0x2d')](_0x401fb1);};}function getInteractionUnreadMessages(_0x3503de){return new BPromise(function(_0x526e8b,_0x38ca2f){try{if(_0x3503de['closed']){_0x3503de[_0x8212('0x2e')]=0x0;_0x526e8b(_0x3503de);}else{return db[_0x8212('0x2f')]['count']({'where':{'MailInteractionId':_0x3503de['id'],'direction':'in','read':![]}})[_0x8212('0x28')](function(_0x37ae88){_0x3503de[_0x8212('0x2e')]=_0x37ae88;_0x526e8b(_0x3503de);});}}catch(_0x54f66e){_0x38ca2f(_0x54f66e);}});}function getInteractionUsers(_0x3e0387,_0x358591){return new BPromise(function(_0x30a3ad,_0x175d4e){try{if(_0x358591[_0x3e0387['id']]){_0x3e0387['Users']=_['map'](_0x358591[_0x3e0387['id']],function(_0x131283){return{'id':_0x131283['id']};});}}catch(_0x43ec8d){_0x175d4e(_0x43ec8d);}_0x30a3ad(_0x3e0387);});}function getInteractionTags(_0x1bcc4c,_0x48e173){return new BPromise(function(_0x4288e3,_0x2df4bd){try{if(_0x1bcc4c[_0x8212('0x30')]){_0x1bcc4c['Tags']=[];_0x1bcc4c[_0x8212('0x30')][_0x8212('0x31')](',')['forEach'](function(_0x329434){_0x1bcc4c[_0x8212('0x32')][_0x8212('0x33')](_0x48e173[_0x329434]);});}delete _0x1bcc4c[_0x8212('0x30')];}catch(_0x35629f){_0x2df4bd(_0x35629f);}_0x4288e3(_0x1bcc4c);});}function getLastMessageText(_0x58f8cc){return new BPromise(function(_0x22d155,_0xa40c81){return db[_0x8212('0x34')][_0x8212('0x35')]({'where':{'id':_0x58f8cc['id']},'attributes':['lastMsgBody',_0x8212('0x36')],'raw':!![]})[_0x8212('0x28')](function(_0x2363ac){if(!_0x2363ac[_0x8212('0x36')]){_0x58f8cc[_0x8212('0x36')]=_[_0x8212('0x37')](htmlToText[_0x8212('0x38')](_0x2363ac[_0x8212('0x39')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x58f8cc['lastMsgText']=_0x2363ac['lastMsgText'];}_0x22d155(_0x58f8cc);})['catch'](function(_0x4d450e){_0xa40c81(_0x4d450e);});});}function updateMailInteraction(_0x4f41c0,_0x194d3d,_0x4c31e5,_0x53b3bb){return new BPromise(function(_0x344d5b,_0x5610d3){return getInteractionUnreadMessages(_0x4f41c0)[_0x8212('0x28')](function(_0x364166){return getInteractionUsers(_0x364166,_0x4c31e5);})[_0x8212('0x28')](function(_0x1e38f7){return getInteractionTags(_0x1e38f7,_0x194d3d);})[_0x8212('0x28')](function(_0x390ad6){if(_0x53b3bb){_0x344d5b(getLastMessageText(_0x390ad6));}else{_0x344d5b(_0x390ad6);}})[_0x8212('0x3a')](function(_0x41ba1e){_0x5610d3(_0x41ba1e);});});}exports[_0x8212('0x3b')]=function(_0x45001b,_0x5631c5){var _0x4b4ade={},_0x13f138={},_0x56e4c2={'count':0x0,'rows':[]};var _0x55c0d6=db[_0x8212('0x34')][_0x8212('0x3c')];_0x13f138['model']=_['keys'](_0x55c0d6);_0x13f138[_0x8212('0x3d')]=_[_0x8212('0x3e')](_0x45001b[_0x8212('0x3d')]);_0x13f138['filters']=_[_0x8212('0x3f')](_0x13f138[_0x8212('0x40')],_0x13f138['query']);_0x4b4ade[_0x8212('0x41')]=_[_0x8212('0x3f')](_0x13f138[_0x8212('0x40')],qs[_0x8212('0x42')](_0x45001b[_0x8212('0x3d')]['fields']));_0x4b4ade['attributes']=_0x4b4ade[_0x8212('0x41')][_0x8212('0x43')]?_0x4b4ade['attributes']:_0x13f138[_0x8212('0x40')];if(!_0x45001b[_0x8212('0x3d')][_0x8212('0x44')](_0x8212('0x45'))){_0x4b4ade['limit']=qs['limit'](_0x45001b['query'][_0x8212('0x21')]);_0x4b4ade[_0x8212('0x20')]=qs[_0x8212('0x20')](_0x45001b[_0x8212('0x3d')][_0x8212('0x20')]);}_0x4b4ade[_0x8212('0x46')]=qs[_0x8212('0x47')](_0x45001b[_0x8212('0x3d')][_0x8212('0x47')]);_0x4b4ade['where']=qs[_0x8212('0x48')](_[_0x8212('0x49')](_0x45001b[_0x8212('0x3d')],_0x13f138['filters']));var _0x29fca2=[];var _0x22dc09=squel['select']()['field']('id')[_0x8212('0x4a')](_0x8212('0x2c'))[_0x8212('0x4a')](_0x8212('0x4b'))[_0x8212('0x4c')]('tools_tags');var _0x468bbc=squel[_0x8212('0x4d')]()[_0x8212('0x4a')](_0x8212('0x4e'))['from']('mail_messages','me')[_0x8212('0x4f')](_0x8212('0x50'))[_0x8212('0x4f')](_0x8212('0x51'))['where'](_0x8212('0x52'));var _0x1df966=squel[_0x8212('0x4d')]()[_0x8212('0x4a')](_0x8212('0x53'))[_0x8212('0x4a')](_0x8212('0x54'))[_0x8212('0x4c')](_0x8212('0x55'),'ui')['left_join'](_0x8212('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x5533e4=squel[_0x8212('0x4d')]()[_0x8212('0x4c')](_0x8212('0x57'),'i')['left_join'](_0x8212('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x8212('0x56'),'o',_0x8212('0x59'))['left_join'](_0x8212('0x5a'),'a',_0x8212('0x5b'))[_0x8212('0x5c')](_0x8212('0x5d'),'me',_0x8212('0x50'));var _0x1a27a3=squel[_0x8212('0x5e')]();if(_0x45001b[_0x8212('0x3d')][_0x8212('0x5f')]){var _0x4b9e13=JSON[_0x8212('0x60')](_0x45001b[_0x8212('0x3d')][_0x8212('0x5f')]);_[_0x8212('0x3e')](_0x4b9e13)[_0x8212('0x61')](function(_0x4fcf6a){var _0x14cc20=_0x4b9e13[_0x4fcf6a];if(_0x4fcf6a==='createdAt'){var _0x5f4e1a=moment(_0x14cc20[_0x8212('0x62')][_0x8212('0x63')])[_0x8212('0x64')](_0x8212('0x65'))[_0x8212('0x66')]()[_0x8212('0x67')]();var _0x17a88b=moment(_0x17a88b)[_0x8212('0x66')]()[_0x8212('0x68')](_0x8212('0x65'))[_0x8212('0x67')]();_0x1a27a3[_0x8212('0x69')](_0x8212('0x6a'),_0x5f4e1a,_0x17a88b);}else{if(_[_0x8212('0x6b')](_0x14cc20['condition'])){_0x14cc20[_0x8212('0x6c')][_0x8212('0x61')](function(_0x1fe712){switch(_0x14cc20['condition'][_0x8212('0x62')]){case'IS':if(_0x4fcf6a!==_0x8212('0x6d')&&_0x4fcf6a!==_0x8212('0x6e')){if(_['isArray'](_0x14cc20['value'])&&_0x14cc20[_0x8212('0x62')][_0x8212('0x43')]>0x1){_0x1a27a3[_0x8212('0x69')](_0x14cc20['tableAlias']+'.'+_0x4fcf6a+_0x8212('0x6f'),_0x14cc20[_0x8212('0x62')]);}else{_0x1a27a3[_0x8212('0x69')](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+_0x8212('0x71'),_0x14cc20[_0x8212('0x62')][0x0]);}}break;case'=':_0x1a27a3['and'](_0x14cc20['tableAlias']+'.'+_0x4fcf6a+_0x8212('0x71'),_0x14cc20['value']);break;case _0x8212('0x72'):if(_0x4fcf6a===_0x8212('0x73')){_0x1a27a3[_0x8212('0x69')]('c.firstName'+_0x8212('0x74'),'%'+_0x14cc20['value']+'%');_0x1a27a3['or'](_0x8212('0x75')+'\x20LIKE\x20?','%'+_0x14cc20['value']+'%');_0x1a27a3['or'](_0x8212('0x76')+'\x20LIKE\x20?','%'+_0x14cc20['value']+'%');}else{_0x1a27a3[_0x8212('0x69')](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+'\x20LIKE\x20?','%'+_0x14cc20[_0x8212('0x62')]+'%');}break;case'>':_0x1a27a3[_0x8212('0x69')](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+'\x20>\x20?',_0x14cc20['value']);break;case'<':_0x1a27a3[_0x8212('0x69')](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+'\x20<\x20?',_0x14cc20[_0x8212('0x62')]);break;}});}else{switch(_0x14cc20['condition'][_0x8212('0x62')]){case'IS':if(_0x4fcf6a!==_0x8212('0x6d')&&_0x4fcf6a!==_0x8212('0x6e')){if(_[_0x8212('0x6b')](_0x14cc20[_0x8212('0x62')])&&_0x14cc20['value'][_0x8212('0x43')]>0x1){_0x1a27a3['and'](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+_0x8212('0x6f'),_0x14cc20[_0x8212('0x62')]);}else{_0x1a27a3['and'](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+_0x8212('0x71'),_0x14cc20[_0x8212('0x62')][0x0]);}}break;case'=':_0x1a27a3[_0x8212('0x69')](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+_0x8212('0x71'),_0x14cc20['value']);break;case _0x8212('0x72'):if(_0x4fcf6a===_0x8212('0x73')){_0x1a27a3[_0x8212('0x69')](_0x8212('0x77')+_0x8212('0x74'),'%'+_0x14cc20[_0x8212('0x62')]+'%');_0x1a27a3['or'](_0x8212('0x75')+_0x8212('0x74'),'%'+_0x14cc20[_0x8212('0x62')]+'%');_0x1a27a3['or']('c.email'+_0x8212('0x74'),'%'+_0x14cc20['value']+'%');}else{_0x1a27a3[_0x8212('0x69')](_0x14cc20['tableAlias']+'.'+_0x4fcf6a+_0x8212('0x74'),'%'+_0x14cc20['value']+'%');}break;case'>':_0x1a27a3['and'](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+_0x8212('0x78'),_0x14cc20['value']);break;case'<':_0x1a27a3[_0x8212('0x69')](_0x14cc20[_0x8212('0x70')]+'.'+_0x4fcf6a+_0x8212('0x79'),_0x14cc20[_0x8212('0x62')]);break;}}}});}else{var _0xf0d12c=_(Object['keys'](_0x45001b[_0x8212('0x3d')]))[_0x8212('0x7a')](function(_0x15edda){return _0x55c0d6[_0x8212('0x44')](_0x15edda)?_0x15edda:undefined;})[_0x8212('0x7b')](function(_0x36001b){return!_[_0x8212('0x7c')](_0x36001b);})['value']();if(!_[_0x8212('0x7d')](_0xf0d12c)){_0xf0d12c['forEach'](function(_0xd7f9ec){if(_0xd7f9ec===_0x8212('0x7e')){_0x5533e4['where'](_0x8212('0x7f'),[]['concat'](_0x45001b['query'][_0xd7f9ec]));}else if(_0xd7f9ec===_0x8212('0x80')){var _0x450b9b=JSON[_0x8212('0x60')](_0x45001b[_0x8212('0x3d')][_0xd7f9ec])[_0x8212('0x81')];var _0x269fc4=JSON['parse'](_0x45001b['query'][_0xd7f9ec])[_0x8212('0x82')];_0x5533e4[_0x8212('0x4f')](_0x8212('0x6a'),_0x450b9b,_0x269fc4);}else{if(_0x45001b['query'][_0xd7f9ec]===_0x8212('0x83')){_0x5533e4[_0x8212('0x4f')]('i.'+_0xd7f9ec+_0x8212('0x84'));}else{_0x5533e4['where']('i.'+_0xd7f9ec+'\x20=\x20?',_0x45001b['query'][_0xd7f9ec]);}}});}if(_0x45001b['query']['filter']){var _0xc52ae=_0x45001b[_0x8212('0x3d')]['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x8212('0x85')](_0xc52ae)){_0x1a27a3['or'](_0x8212('0x86'),_0xc52ae+'%');}else if(qs[_0x8212('0x87')](_0xc52ae)){_0x1a27a3['or']('c.email\x20LIKE\x20?',_0xc52ae+'%');}else{var _0x5b75b6=[];_0xc52ae['split']('\x20')['forEach'](function(_0x5c2a25){_0x5b75b6[_0x8212('0x33')]('+'+_0x5c2a25[_0x8212('0x88')]());});var _0x38e101=_0x5b75b6[_0x8212('0x89')]('\x20');_0x1a27a3['or'](_0x8212('0x8a'),_0x38e101)['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x38e101);}}}_0x5533e4['where'](_0x1a27a3);if(_0x4b4ade[_0x8212('0x46')]){_0x4b4ade['order']['forEach'](function(_0x2b5438){_0x5533e4[_0x8212('0x46')]('i.'+_0x2b5438[0x0],_0x2b5438[0x1]===_0x8212('0x8b')?![]:!![]);});}_0x5533e4[_0x8212('0x8c')](_0x8212('0x8d'));var _0x391628={'type':db['Sequelize'][_0x8212('0x8e')][_0x8212('0x8f')],'raw':!![]};var _0x441e5a=_0x5533e4[_0x8212('0x90')]()[_0x8212('0x4a')](_0x8212('0x4e'));if(!_0x45001b['query'][_0x8212('0x5f')]){if(_0x45001b['query']['read']){if(_0x45001b[_0x8212('0x3d')]['read']==0x1){_0x441e5a[_0x8212('0x4f')](util['format'](_0x8212('0x91'),_0x468bbc['toString']()));_0x5533e4['having'](_0x8212('0x92'));}else{_0x441e5a['where'](util['format'](_0x8212('0x93'),_0x468bbc['toString']()));_0x5533e4[_0x8212('0x94')]('`Messages.count`\x20>\x200');}}if(_0x45001b['query'][_0x8212('0x95')]){var _0x2a7ac7=_[_0x8212('0x6b')](_0x45001b['query'][_0x8212('0x95')])?_0x45001b['query'][_0x8212('0x95')]:new Array(_0x45001b['query'][_0x8212('0x95')]);var _0x330112=squel[_0x8212('0x5e')]();_0x2a7ac7['forEach'](function(_0x1ac5c8){_0x330112['or'](_0x8212('0x96'),'%,'+_0x1ac5c8+',%');});_0x5533e4[_0x8212('0x94')](_0x330112);_0x441e5a[_0x8212('0x5c')](_0x8212('0x97'),'it',_0x8212('0x98'));_0x441e5a[_0x8212('0x5c')]('tools_tags','t',_0x8212('0x99'));_0x441e5a[_0x8212('0x4f')](_0x8212('0x9a'),_0x2a7ac7);}}else{var _0x4b9e13=JSON[_0x8212('0x60')](_0x45001b[_0x8212('0x3d')][_0x8212('0x5f')]);_['keys'](_0x4b9e13)[_0x8212('0x61')](function(_0x575b39){var _0xf48c2d=_0x4b9e13[_0x575b39];if(_0x575b39===_0x8212('0x6d')){var _0x522cdd=_0xf48c2d[_0x8212('0x62')];var _0x137712=squel[_0x8212('0x5e')]();_0x522cdd[_0x8212('0x61')](function(_0x31f0ad){_0x137712['or'](_0x8212('0x96'),'%,'+_0x31f0ad+',%');});_0x5533e4[_0x8212('0x94')](_0x137712);_0x441e5a[_0x8212('0x5c')]('mail_interaction_has_tags','it',_0x8212('0x98'));_0x441e5a[_0x8212('0x5c')]('tools_tags','t',_0x8212('0x99'));_0x441e5a[_0x8212('0x4f')]('t.id\x20IN\x20?',_0x522cdd);}else if(_0x575b39===_0x8212('0x6e')){if(_0xf48c2d[_0x8212('0x62')]['length']===0x1){if(_0xf48c2d['value'][0x0]===0x1){_0x441e5a['where'](util[_0x8212('0x67')]('%s\x20=\x200',_0x468bbc['toString']()));_0x5533e4['having'](_0x8212('0x92'));}else{_0x441e5a[_0x8212('0x4f')](util[_0x8212('0x67')](_0x8212('0x93'),_0x468bbc[_0x8212('0x88')]()));_0x5533e4[_0x8212('0x94')](_0x8212('0x9b'));}}}});}db[_0x8212('0x9c')]['query'](_0x441e5a[_0x8212('0x88')](),_0x391628)['then'](function(_0x25e9cf){_0x56e4c2[_0x8212('0x1f')]=_0x25e9cf[_0x8212('0x43')];if(_0x56e4c2[_0x8212('0x1f')]===0x0)return[];return db['sequelize'][_0x8212('0x3d')](_0x22dc09[_0x8212('0x88')](),_0x391628)[_0x8212('0x28')](function(_0x52e5d2){_0x29fca2=_[_0x8212('0x9d')](_0x52e5d2,'id');_0x391628=_[_0x8212('0x9e')](_0x391628,{'model':db[_0x8212('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5533e4[_0x8212('0x4a')](_0x8212('0x9f'),_0x8212('0xa0'));_0x5533e4[_0x8212('0x4a')](_0x8212('0x8d'));_0x5533e4[_0x8212('0x4a')](_0x8212('0xa1'));_0x5533e4['field']('i.updatedAt');_0x5533e4[_0x8212('0x4a')](_0x8212('0xa2'));_0x5533e4[_0x8212('0x4a')](_0x8212('0xa3'));_0x5533e4['field'](_0x8212('0xa4'));_0x5533e4[_0x8212('0x4a')](_0x8212('0xa5'));_0x5533e4[_0x8212('0x4a')]('i.lastMsgDirection');_0x5533e4[_0x8212('0x4a')]('i.subject');_0x5533e4[_0x8212('0x4a')]('i.disposition');_0x5533e4['field']('i.substatus');_0x5533e4[_0x8212('0x4a')](_0x8212('0xa6'));_0x5533e4[_0x8212('0x4a')](_0x8212('0xa7'));_0x5533e4['field'](_0x8212('0xa8'));_0x5533e4[_0x8212('0x4a')](_0x8212('0xa9'));_0x5533e4['field'](_0x8212('0x77'),_0x8212('0xaa'));_0x5533e4[_0x8212('0x4a')](_0x8212('0x75'),_0x8212('0xab'));_0x5533e4[_0x8212('0x4a')](_0x8212('0x76'),_0x8212('0xac'));_0x5533e4[_0x8212('0x4a')]('c.phone','Contact.phone');_0x5533e4['field'](_0x8212('0xad'),'Contact.mobile');_0x5533e4[_0x8212('0x4a')]('c.fax',_0x8212('0xae'));_0x5533e4[_0x8212('0x4a')](_0x8212('0xaf'),_0x8212('0x30'));_0x5533e4[_0x8212('0x5c')]('mail_interaction_has_tags','it',_0x8212('0x98'));_0x5533e4[_0x8212('0x5c')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x5533e4[_0x8212('0x21')](_0x4b4ade[_0x8212('0x21')]);_0x5533e4[_0x8212('0x20')](_0x4b4ade[_0x8212('0x20')]);return db[_0x8212('0x9c')][_0x8212('0x3d')](_0x5533e4['toString'](),_0x391628);})[_0x8212('0x28')](function(_0x420bc0){_0x1df966[_0x8212('0x4f')](_0x8212('0xb0'),_[_0x8212('0x7a')](_0x420bc0,'id'));return db[_0x8212('0x9c')][_0x8212('0x3d')](_0x1df966[_0x8212('0x88')](),_0x391628)[_0x8212('0x28')](function(_0x498c63){var _0x310056=_[_0x8212('0xb1')](_0x498c63,_0x8212('0xb2'));var _0x5b85e2=[];return db[_0x8212('0xb3')][_0x8212('0x35')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x8212('0x28')](function(_0xe6bffc){var _0xc4a4f4=_0xe6bffc[_0x8212('0xb4')];_0x420bc0[_0x8212('0x61')](function(_0x4b8e8f){_0x5b85e2['push'](updateMailInteraction(_0x4b8e8f,_0x29fca2,_0x310056,_0xc4a4f4));});return BPromise[_0x8212('0xb5')](_0x5b85e2);});});});})['then'](function(_0x2ce9a1){_0x56e4c2['rows']=_0x2ce9a1;return _0x56e4c2;})[_0x8212('0x28')](respondWithFilteredResult(_0x5631c5,_0x4b4ade))['catch'](handleError(_0x5631c5,null));};exports[_0x8212('0xb6')]=function(_0x47cce8,_0x4032f5){var _0x5461f0={'raw':![],'where':{'id':_0x47cce8[_0x8212('0xb7')]['id']}},_0x358c88={};_0x358c88['model']=_[_0x8212('0x3e')](db[_0x8212('0x34')]['rawAttributes']);_0x358c88[_0x8212('0x3d')]=_[_0x8212('0x3e')](_0x47cce8['query']);_0x358c88[_0x8212('0x48')]=_[_0x8212('0x3f')](_0x358c88['model'],_0x358c88['query']);_0x5461f0[_0x8212('0x41')]=_[_0x8212('0x3f')](_0x358c88['model'],qs[_0x8212('0x42')](_0x47cce8['query'][_0x8212('0x42')]));_0x5461f0[_0x8212('0x41')]=_0x5461f0['attributes'][_0x8212('0x43')]?_0x5461f0['attributes']:_0x358c88[_0x8212('0x40')];if(_0x47cce8[_0x8212('0x3d')][_0x8212('0xb8')]){_0x5461f0[_0x8212('0xb9')]=[{'all':!![]}];}_0x5461f0=_[_0x8212('0x9e')]({},_0x5461f0,_0x47cce8[_0x8212('0xba')]);return db['MailInteraction'][_0x8212('0xbb')](_0x5461f0)[_0x8212('0x28')](handleEntityNotFound(_0x4032f5,null))[_0x8212('0x28')](respondWithResult(_0x4032f5,null))[_0x8212('0x3a')](handleError(_0x4032f5,null));};exports[_0x8212('0xbc')]=function(_0x230e68,_0x58ed03){return db[_0x8212('0x34')][_0x8212('0xbc')](_0x230e68[_0x8212('0xbd')],{})[_0x8212('0x28')](respondWithResult(_0x58ed03,0xc9))['catch'](handleError(_0x58ed03,null));};exports[_0x8212('0x27')]=function(_0x13341f,_0x5594bc){if(_0x13341f[_0x8212('0xbd')]['id']){delete _0x13341f[_0x8212('0xbd')]['id'];}return db[_0x8212('0x34')][_0x8212('0xbb')]({'where':{'id':_0x13341f[_0x8212('0xb7')]['id']}})[_0x8212('0x28')](handleEntityNotFound(_0x5594bc,null))[_0x8212('0x28')](saveUpdates(_0x13341f[_0x8212('0xbd')],null))[_0x8212('0x28')](respondWithResult(_0x5594bc,null))[_0x8212('0x3a')](handleError(_0x5594bc,null));};exports['destroy']=function(_0x47bfff,_0x2028b2){return db['MailInteraction'][_0x8212('0xbb')]({'where':{'id':_0x47bfff[_0x8212('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2028b2,null))[_0x8212('0x28')](removeEntity(_0x2028b2,null))[_0x8212('0x3a')](handleError(_0x2028b2,null));};exports[_0x8212('0xbe')]=function(_0x2d0bd0,_0x5764bf){return db['MailInteraction']['describe']()[_0x8212('0x28')](respondWithResult(_0x5764bf,null))[_0x8212('0x3a')](handleError(_0x5764bf,null));};exports[_0x8212('0xbf')]=function(_0x51d1f6,_0x5eff29,_0x1d490f){return db['MailMessage'][_0x8212('0xbb')]({'where':{'id':_0x51d1f6[_0x8212('0xb7')]['id']}})[_0x8212('0x28')](handleEntityNotFound(_0x5eff29,null))[_0x8212('0x28')](function(_0x45bbce){if(_0x45bbce){return _0x45bbce[_0x8212('0xbf')](_0x51d1f6[_0x8212('0xbd')][_0x8212('0xc0')],_[_0x8212('0xc1')](_0x51d1f6['body'],[_0x8212('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x5eff29,null))['catch'](handleError(_0x5eff29,null));};exports[_0x8212('0xc2')]=function(_0x317ea9,_0x5e9e79,_0x871af2){var _0x415744={'raw':![],'where':{}};var _0x44b26e={};var _0x4079d1={'count':0x0,'rows':[]};return db[_0x8212('0x34')][_0x8212('0x35')]({'where':{'id':_0x317ea9['params']['id']}})[_0x8212('0x28')](handleEntityNotFound(_0x5e9e79,null))[_0x8212('0x28')](function(_0xb39b02){if(_0xb39b02){_0x44b26e[_0x8212('0x40')]=_[_0x8212('0x3e')](db[_0x8212('0x2f')][_0x8212('0x3c')]);_0x44b26e['query']=_[_0x8212('0x3e')](_0x317ea9[_0x8212('0x3d')]);_0x44b26e[_0x8212('0x48')]=_[_0x8212('0x3f')](_0x44b26e[_0x8212('0x40')],_0x44b26e[_0x8212('0x3d')]);_0x415744[_0x8212('0x41')]=_['intersection'](_0x44b26e[_0x8212('0x40')],qs[_0x8212('0x42')](_0x317ea9[_0x8212('0x3d')][_0x8212('0x42')]));_0x415744[_0x8212('0x41')]=_0x415744[_0x8212('0x41')][_0x8212('0x43')]?_0x415744[_0x8212('0x41')]:_0x44b26e[_0x8212('0x40')];if(!_0x317ea9[_0x8212('0x3d')][_0x8212('0x44')](_0x8212('0x45'))){_0x415744['limit']=qs['limit'](_0x317ea9[_0x8212('0x3d')]['limit']);_0x415744[_0x8212('0x20')]=qs[_0x8212('0x20')](_0x317ea9[_0x8212('0x3d')]['offset']);}_0x415744[_0x8212('0x46')]=qs[_0x8212('0x47')](_0x317ea9[_0x8212('0x3d')][_0x8212('0x47')]);_0x415744[_0x8212('0x4f')]=qs[_0x8212('0x48')](_['pick'](_0x317ea9['query'],_0x44b26e[_0x8212('0x48')]));_0x415744[_0x8212('0x4f')][_0x8212('0xb2')]=_0xb39b02['id'];if(_0x317ea9[_0x8212('0x3d')]['filter']){_0x415744[_0x8212('0x4f')]=_[_0x8212('0x9e')](_0x415744[_0x8212('0x4f')],{'$or':_['map'](_0x415744['attributes'],function(_0xdc4b30){var _0x12a616={};_0x12a616[_0xdc4b30]={'$like':'%'+_0x317ea9[_0x8212('0x3d')][_0x8212('0x7b')]+'%'};return _0x12a616;})});}if(_0x317ea9['query'][_0x8212('0x81')]){var _0x1479c1=_0x317ea9[_0x8212('0x3d')][_0x8212('0x81')]['split'](',');var _0x33c36d={};_0x33c36d[_0x1479c1[0x0]]={'$gte':moment(_0x1479c1[0x1])['format'](_0x8212('0xc3'))};_0x415744['where']=_[_0x8212('0x9e')](_0x415744[_0x8212('0x4f')],_0x33c36d);}_0x415744=_[_0x8212('0x9e')]({},_0x415744,_0x317ea9[_0x8212('0xba')]);return db[_0x8212('0x2f')][_0x8212('0x1f')]({'where':_0x415744[_0x8212('0x4f')]})[_0x8212('0x28')](function(_0x1f76fc){_0x4079d1[_0x8212('0x1f')]=_0x1f76fc;if(_0x317ea9[_0x8212('0x3d')]['includeAll']){_0x415744['include']=[{'all':!![]}];}return db[_0x8212('0x2f')]['findAll'](_0x415744);})[_0x8212('0x28')](function(_0x18aaff){_0x4079d1[_0x8212('0xc4')]=_0x18aaff;return _0x4079d1;});}})[_0x8212('0x28')](respondWithFilteredResult(_0x5e9e79,_0x415744))[_0x8212('0x3a')](handleError(_0x5e9e79,null));};exports['addTags']=function(_0x13840e,_0x4aa334,_0x475234){return db[_0x8212('0x34')][_0x8212('0xbb')]({'where':{'id':_0x13840e[_0x8212('0xb7')]['id']}})[_0x8212('0x28')](handleEntityNotFound(_0x4aa334,null))[_0x8212('0x28')](function(_0x569436){if(_0x569436){return _0x569436['setTags'](_0x13840e[_0x8212('0xbd')][_0x8212('0xc0')],_[_0x8212('0xc1')](_0x13840e[_0x8212('0xbd')],['ids','id'])||{})[_0x8212('0xc5')](function(){return db[_0x8212('0xc6')][_0x8212('0xc7')]({'attributes':['id',_0x8212('0x2c'),_0x8212('0x4b')],'where':{'id':_0x13840e[_0x8212('0xbd')][_0x8212('0xc0')]}});})[_0x8212('0x28')](function(_0x5b3444){socket[_0x8212('0xc8')](_0x8212('0xc9'),{'id':Number(_0x13840e[_0x8212('0xb7')]['id']),'tags':_0x5b3444||[]});return{'id':Number(_0x13840e[_0x8212('0xb7')]['id']),'tags':_0x5b3444||[]};});}})[_0x8212('0x28')](respondWithResult(_0x4aa334,null))['catch'](handleError(_0x4aa334,null));};exports['removeTags']=function(_0x562e23,_0x226b3a,_0x3358e6){return db[_0x8212('0x34')][_0x8212('0xbb')]({'where':{'id':_0x562e23[_0x8212('0xb7')]['id']}})[_0x8212('0x28')](handleEntityNotFound(_0x226b3a,null))[_0x8212('0x28')](function(_0x57c683){if(_0x57c683){return _0x57c683[_0x8212('0xca')](_0x562e23[_0x8212('0x3d')][_0x8212('0xc0')]);}})[_0x8212('0x28')](respondWithStatusCode(_0x226b3a,null))[_0x8212('0x3a')](handleError(_0x226b3a,null));};exports[_0x8212('0xcb')]=function(_0x40abc6,_0x5314be){var _0x209926=moment()[_0x8212('0xcc')]()[_0x8212('0x88')]();var _0xf1040d=path[_0x8212('0x89')](config['root'],_0x8212('0xcd'),'files',_0x8212('0xce'));var _0x107fbf=path[_0x8212('0x89')](config['root'],_0x8212('0xcd'),_0x8212('0xcf'),_0x8212('0xd0'));var _0xe9b29c=path[_0x8212('0x89')](_0x107fbf,_0x209926);var _0x55de7=util[_0x8212('0x67')]('interaction-%s.zip',_0x209926);var _0x17c139=path[_0x8212('0x89')](_0x107fbf,_0x55de7);var _0x3d7d30=![];return db['MailInteraction'][_0x8212('0xbb')]({'where':{'id':_0x40abc6[_0x8212('0xb7')]['id']}})[_0x8212('0x28')](handleEntityNotFound(_0x5314be,null))[_0x8212('0x28')](function(_0x2b4374){if(_0x2b4374){return _0x2b4374[_0x8212('0xc2')]({'attributes':['id',_0x8212('0xbd'),_0x8212('0x4c'),'to','cc','bcc',_0x8212('0xd1'),_0x8212('0x80')],'where':{'secret':![]},'include':_0x40abc6[_0x8212('0x3d')][_0x8212('0xce')]?[{'model':db[_0x8212('0xd2')],'as':'Attachments'}]:undefined,'order':qs[_0x8212('0x47')]('id')});}return[];})['then'](function(_0x4aa677){_0x3d7d30=_0x4aa677[_0x8212('0x43')];if(_0x4aa677[_0x8212('0x43')]){fs['mkdirSync'](_0xe9b29c);return BPromise[_0x8212('0xd3')](_0x4aa677,function(_0x1816af,_0x22bfc6){var _0x242f35=_0x1816af;var _0x4e8941={'from':_0x242f35['from'],'to':_0x242f35['to'],'subject':_0x242f35[_0x8212('0xd1')],'html':_0x242f35[_0x8212('0xbd')],'headers':{'Date':moment(_0x242f35[_0x8212('0x80')])[_0x8212('0x67')](_0x8212('0xd4'))},'attachments':[]};if(_0x1816af['cc']){_0x4e8941[_0x8212('0xd5')]['Cc']=_0x1816af['cc'];}if(_0x1816af[_0x8212('0xd6')]){_0x4e8941[_0x8212('0xd5')][_0x8212('0xd7')]=_0x1816af[_0x8212('0xd6')];}return new BPromise(function(_0x1c92da,_0x5efaf4){if(_0x1816af['Attachments']){for(var _0x31de2f=0x0;_0x31de2f<_0x1816af[_0x8212('0xd8')]['length'];_0x31de2f++){var _0x438dd1=_0x1816af['Attachments'][_0x31de2f];var _0x45a59f=path['join'](_0xf1040d,_0x438dd1[_0x8212('0xd9')]);if(fs[_0x8212('0xda')](_0x45a59f)){_0x4e8941[_0x8212('0xce')][_0x8212('0x33')]({'name':_0x438dd1[_0x8212('0x2c')],'contentType':_0x438dd1[_0x8212('0xdb')],'data':fs[_0x8212('0xdc')](_0x45a59f)});}}}emlformat[_0x8212('0xdd')](_0x4e8941,function(_0xbc9e83,_0x6e6f93){if(_0xbc9e83)return _0x5efaf4(_0xbc9e83);fs[_0x8212('0xde')](path['join'](_0xe9b29c,util[_0x8212('0x67')](_0x8212('0xdf'),_0x22bfc6)),_0x6e6f93);return _0x1c92da(_0x6e6f93);});});});}})[_0x8212('0x28')](function(){if(_0x3d7d30){return new BPromise(function(_0x1b2ba8,_0x169fb7){zipdir(_0xe9b29c,{'saveTo':_0x17c139},function(_0x4cdd8a,_0x5b13e0){if(_0x4cdd8a)return _0x169fb7(_0x4cdd8a);return _0x1b2ba8(_0x5b13e0);});});}})[_0x8212('0x28')](function(){if(_0x3d7d30){return new BPromise(function(_0x4c75f0,_0x1ca8aa){rimraf(_0xe9b29c,function(_0x2791fa){if(_0x2791fa)_0x1ca8aa(_0x2791fa);return _0x4c75f0();});});}})[_0x8212('0x28')](function(){if(_0x3d7d30){return _0x5314be[_0x8212('0xcb')](_0x17c139,_0x55de7,function(_0x1a3513){if(_0x1a3513){console['log']('err',_0x1a3513);}else{fs[_0x8212('0xe0')](_0x17c139);}});}else{return _0x5314be[_0x8212('0x1c')](0xc8);}})['catch'](handleError(_0x5314be,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 46ccb5c..3c489df 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 _0x6c9c=['findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove'];(function(_0x5e9318,_0x5339cb){var _0x2d3904=function(_0x128be5){while(--_0x128be5){_0x5e9318['push'](_0x5e9318['shift']());}};_0x2d3904(++_0x5339cb);}(_0x6c9c,0x12a));var _0xc6c9=function(_0x3e33bd,_0x4eaac3){_0x3e33bd=_0x3e33bd-0x0;var _0x481039=_0x6c9c[_0x3e33bd];return _0x481039;};'use strict';var EventEmitter=require(_0xc6c9('0x0'));var MailInteraction=require(_0xc6c9('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xc6c9('0x1'))['db'][_0xc6c9('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc6c9('0x3')](0x0);var events={'afterCreate':_0xc6c9('0x4'),'afterUpdate':'update','afterDestroy':_0xc6c9('0x5')};function emitEvent(_0x459e90){return function(_0x102361,_0x31e999,_0x422195){MailMessage[_0xc6c9('0x6')]({'where':{'MailInteractionId':_0x102361['id'],'direction':'in','read':![]},'raw':!![]})[_0xc6c9('0x7')](function(_0xd310e9){_0x102361[_0xc6c9('0x8')](_0xc6c9('0x9'),_0xd310e9[_0xc6c9('0xa')]);MailInteractionEvents[_0xc6c9('0xb')](_0x459e90+':'+_0x102361['id'],_0x102361);MailInteractionEvents[_0xc6c9('0xb')](_0x459e90,_0x102361);_0x422195(null);})[_0xc6c9('0xc')](_0x422195(null));};}for(var e in events){if(events[_0xc6c9('0xd')](e)){var event=events[e];MailInteraction[_0xc6c9('0xe')](e,emitEvent(event));}}module[_0xc6c9('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x3f40=['setDataValue','unreadMessages','emit','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','findAll','then'];(function(_0x2f80e7,_0x349c8d){var _0x5a7fa2=function(_0x307ca1){while(--_0x307ca1){_0x2f80e7['push'](_0x2f80e7['shift']());}};_0x5a7fa2(++_0x349c8d);}(_0x3f40,0xbb));var _0x03f4=function(_0x4f3ab8,_0x55500e){_0x4f3ab8=_0x4f3ab8-0x0;var _0x3a6f62=_0x3f40[_0x4f3ab8];return _0x3a6f62;};'use strict';var EventEmitter=require(_0x03f4('0x0'));var MailInteraction=require(_0x03f4('0x1'))['db'][_0x03f4('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x03f4('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x03f4('0x4'),'afterUpdate':_0x03f4('0x5'),'afterDestroy':_0x03f4('0x6')};function emitEvent(_0x2597fd){return function(_0x53e1db,_0x324af0,_0x3b42bb){MailMessage[_0x03f4('0x7')]({'where':{'MailInteractionId':_0x53e1db['id'],'direction':'in','read':![]},'raw':!![]})[_0x03f4('0x8')](function(_0x31cb26){_0x53e1db[_0x03f4('0x9')](_0x03f4('0xa'),_0x31cb26['length']);MailInteractionEvents[_0x03f4('0xb')](_0x2597fd+':'+_0x53e1db['id'],_0x53e1db);MailInteractionEvents[_0x03f4('0xb')](_0x2597fd,_0x53e1db);_0x3b42bb(null);})['catch'](_0x3b42bb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x03f4('0xc')](e,emitEvent(event));}}module[_0x03f4('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index eb96086..f0db655 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 _0x3c08=['substatusAt','YYYY-MM-DD\x20HH:mm:ss','models','get','MailMessage','update','then','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','format','closed','closedAt','changed'];(function(_0x5ce99d,_0xd461b){var _0x15e65b=function(_0x263752){while(--_0x263752){_0x5ce99d['push'](_0x5ce99d['shift']());}};_0x15e65b(++_0xd461b);}(_0x3c08,0xc5));var _0x83c0=function(_0x234143,_0x45d84c){_0x234143=_0x234143-0x0;var _0x3389ae=_0x3c08[_0x234143];return _0x3389ae;};'use strict';var _=require(_0x83c0('0x0'));var util=require(_0x83c0('0x1'));var logger=require(_0x83c0('0x2'))(_0x83c0('0x3'));var moment=require('moment');var BPromise=require(_0x83c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x83c0('0x5'));var rimraf=require(_0x83c0('0x6'));var config=require(_0x83c0('0x7'));var attributes=require(_0x83c0('0x8'));module['exports']=function(_0x4c44a5,_0x1af3d0){return _0x4c44a5[_0x83c0('0x9')](_0x83c0('0xa'),attributes,{'tableName':_0x83c0('0xb'),'paranoid':![],'indexes':[{'name':_0x83c0('0xc'),'fields':[_0x83c0('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x19542d,_0x13478d,_0x3b16bd){if(_0x19542d[_0x83c0('0xe')]){_0x19542d['substatusAt']=moment()[_0x83c0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x19542d[_0x83c0('0x10')]){_0x19542d[_0x83c0('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3b16bd(null,_0x13478d);},'beforeUpdate':function(_0x59951e,_0x477baa,_0x22881f){if(_0x59951e[_0x83c0('0x12')](_0x83c0('0xe'))){_0x59951e[_0x83c0('0x13')]=moment()[_0x83c0('0xf')](_0x83c0('0x14'));}if(_0x59951e[_0x83c0('0x12')]('closed')){_0x59951e['closedAt']=moment()['format'](_0x83c0('0x14'));}_0x22881f(null,_0x59951e);},'afterUpdate':function(_0x912698,_0x5cc5d8,_0x125c03){var _0x231132=_0x4c44a5[_0x83c0('0x15')];var _0x53058d=_0x912698[_0x83c0('0x16')]({'plain':!![]});if(_0x53058d[_0x83c0('0x10')]){return _0x231132[_0x83c0('0x17')][_0x83c0('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x53058d['id']}})[_0x83c0('0x19')](function(){_0x125c03();})['catch'](function(_0x1f2a35){_0x125c03(_0x1f2a35);});}else{_0x125c03();}}},'charset':'utf8mb4','collate':_0x83c0('0x1a')});}; \ No newline at end of file +var _0xf7f3=['subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','update','then','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions'];(function(_0x4659e9,_0xe7ae45){var _0x2580e3=function(_0x52b36f){while(--_0x52b36f){_0x4659e9['push'](_0x4659e9['shift']());}};_0x2580e3(++_0xe7ae45);}(_0xf7f3,0xdd));var _0x3f7f=function(_0x2fdeae,_0x1f30fe){_0x2fdeae=_0x2fdeae-0x0;var _0x572b3e=_0xf7f3[_0x2fdeae];return _0x572b3e;};'use strict';var _=require(_0x3f7f('0x0'));var util=require('util');var logger=require(_0x3f7f('0x1'))(_0x3f7f('0x2'));var moment=require(_0x3f7f('0x3'));var BPromise=require(_0x3f7f('0x4'));var rp=require(_0x3f7f('0x5'));var fs=require('fs');var path=require(_0x3f7f('0x6'));var rimraf=require(_0x3f7f('0x7'));var config=require(_0x3f7f('0x8'));var attributes=require(_0x3f7f('0x9'));module[_0x3f7f('0xa')]=function(_0x417952,_0x1dbec7){return _0x417952['define']('MailInteraction',attributes,{'tableName':_0x3f7f('0xb'),'paranoid':![],'indexes':[{'name':_0x3f7f('0xc'),'fields':[_0x3f7f('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25f8c8,_0x1b8e6e,_0x568f8d){if(_0x25f8c8[_0x3f7f('0xe')]){_0x25f8c8[_0x3f7f('0xf')]=moment()['format'](_0x3f7f('0x10'));}if(_0x25f8c8[_0x3f7f('0x11')]){_0x25f8c8[_0x3f7f('0x12')]=moment()[_0x3f7f('0x13')]('YYYY-MM-DD\x20HH:mm:ss');}_0x568f8d(null,_0x1b8e6e);},'beforeUpdate':function(_0x2c211d,_0x253e48,_0x3b1383){if(_0x2c211d[_0x3f7f('0x14')]('substatus')){_0x2c211d[_0x3f7f('0xf')]=moment()[_0x3f7f('0x13')](_0x3f7f('0x10'));}if(_0x2c211d[_0x3f7f('0x14')]('closed')){_0x2c211d[_0x3f7f('0x12')]=moment()[_0x3f7f('0x13')](_0x3f7f('0x10'));}_0x3b1383(null,_0x2c211d);},'afterUpdate':function(_0x50c4a,_0x1a4ce7,_0x218ce0){var _0x4a6e2b=_0x417952[_0x3f7f('0x15')];var _0x550e84=_0x50c4a[_0x3f7f('0x16')]({'plain':!![]});if(_0x550e84[_0x3f7f('0x11')]){return _0x4a6e2b['MailMessage'][_0x3f7f('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x550e84['id']}})[_0x3f7f('0x18')](function(){_0x218ce0();})['catch'](function(_0x8a273a){_0x218ce0(_0x8a273a);});}else{_0x218ce0();}}},'charset':'utf8mb4','collate':_0x3f7f('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index eafb6ec..b58083e 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 _0xe5e3=['limit','then','AddTagsToMailInteraction','addTags','body','ids','omit','spread','AddTags','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xe5e3,0x17a));var _0x3e5e=function(_0xa23d70,_0x53584f){_0xa23d70=_0xa23d70-0x0;var _0x992973=_0xe5e3[_0xa23d70];return _0x992973;};'use strict';var _=require('lodash');var util=require(_0x3e5e('0x0'));var moment=require(_0x3e5e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e5e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e5e('0x3'));var logger=require(_0x3e5e('0x4'))('rpc');var config=require(_0x3e5e('0x5'));var jayson=require(_0x3e5e('0x6'));var client=jayson['client'][_0x3e5e('0x7')]({'port':0x232a});config['redis']=_[_0x3e5e('0x8')](config['redis'],{'host':_0x3e5e('0x9'),'port':0x18eb});var socket=require(_0x3e5e('0xa'))(new Redis(config[_0x3e5e('0xb')]));require(_0x3e5e('0xc'))[_0x3e5e('0xd')](socket);function respondWithRpcPromise(_0x2921fc,_0x16f64b,_0x270567){return new BPromise(function(_0x19b93c,_0x135011){return client[_0x3e5e('0xe')](_0x2921fc,_0x270567)['then'](function(_0x83263a){logger[_0x3e5e('0xf')](_0x3e5e('0x10'),_0x16f64b,_0x3e5e('0x11'));logger[_0x3e5e('0x12')](_0x3e5e('0x13'),_0x16f64b,_0x3e5e('0x11'),JSON[_0x3e5e('0x14')](_0x83263a));if(_0x83263a[_0x3e5e('0x15')]){if(_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x16')]===0x1f4){logger[_0x3e5e('0x15')](_0x3e5e('0x10'),_0x16f64b,_0x83263a[_0x3e5e('0x15')]['message']);return _0x135011(_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x17')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x16f64b,_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x17')]);return _0x19b93c(_0x83263a[_0x3e5e('0x15')][_0x3e5e('0x17')]);}else{logger[_0x3e5e('0xf')](_0x3e5e('0x10'),_0x16f64b,_0x3e5e('0x11'));_0x19b93c(_0x83263a['result'][_0x3e5e('0x17')]);}})[_0x3e5e('0x18')](function(_0x295e8c){logger[_0x3e5e('0x15')](_0x3e5e('0x10'),_0x16f64b,_0x295e8c);_0x135011(_0x295e8c);});});}exports[_0x3e5e('0x19')]=function(_0x3d2d90){var _0x59b25a=this;return new Promise(function(_0x5be0ef,_0x4ea253){return db[_0x3e5e('0x1a')][_0x3e5e('0x1b')](_0x3d2d90['body'],{'raw':_0x3d2d90['options']?_0x3d2d90[_0x3e5e('0x1c')][_0x3e5e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d2d90[_0x3e5e('0x1c')]?_0x3d2d90[_0x3e5e('0x1c')][_0x3e5e('0x1e')]||null:null,'attributes':_0x3d2d90[_0x3e5e('0x1c')]?_0x3d2d90[_0x3e5e('0x1c')][_0x3e5e('0x1f')]||null:null,'limit':_0x3d2d90[_0x3e5e('0x1c')]?_0x3d2d90['options'][_0x3e5e('0x20')]||null:null})[_0x3e5e('0x21')](function(_0x1e90ac){logger[_0x3e5e('0xf')]('UpdateMailInteraction',_0x3d2d90);logger[_0x3e5e('0x12')](_0x3e5e('0x19'),_0x3d2d90,JSON[_0x3e5e('0x14')](_0x1e90ac));_0x5be0ef(_0x1e90ac);})[_0x3e5e('0x18')](function(_0x28af5e){logger[_0x3e5e('0x15')](_0x3e5e('0x19'),_0x28af5e[_0x3e5e('0x17')],_0x3d2d90);_0x4ea253(_0x59b25a['error'](0x1f4,_0x28af5e['message']));});});};exports[_0x3e5e('0x22')]=function(_0x2c4e88){return new Promise(function(_0x189ea1,_0x48cf5f){return db[_0x3e5e('0x1a')]['find']({'where':_0x2c4e88[_0x3e5e('0x1c')]?_0x2c4e88[_0x3e5e('0x1c')][_0x3e5e('0x1e')]||null:null})[_0x3e5e('0x21')](function(_0x377ca2){if(_0x377ca2){return _0x377ca2[_0x3e5e('0x23')](_0x2c4e88[_0x3e5e('0x24')][_0x3e5e('0x25')],_[_0x3e5e('0x26')](_0x2c4e88[_0x3e5e('0x24')],[_0x3e5e('0x25'),'id'])||{});}})[_0x3e5e('0x27')](function(_0x4be358){logger[_0x3e5e('0xf')](_0x3e5e('0x28'),_0x2c4e88);logger[_0x3e5e('0x12')](_0x3e5e('0x28'),_0x2c4e88,JSON['stringify'](_0x4be358));_0x189ea1(_0x4be358);})[_0x3e5e('0x18')](function(_0x406371){logger['error'](_0x3e5e('0x28'),_0x406371[_0x3e5e('0x17')],_0x2c4e88);_0x48cf5f(_this[_0x3e5e('0x15')](0x1f4,_0x406371[_0x3e5e('0x17')]));});});}; \ No newline at end of file +var _0xcf12=['register','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket'];(function(_0x15c1c9,_0x12aa91){var _0x3aab24=function(_0x4265ed){while(--_0x4265ed){_0x15c1c9['push'](_0x15c1c9['shift']());}};_0x3aab24(++_0x12aa91);}(_0xcf12,0x140));var _0x2cf1=function(_0x58775a,_0x34c02e){_0x58775a=_0x58775a-0x0;var _0x25c0b0=_0xcf12[_0x58775a];return _0x25c0b0;};'use strict';var _=require('lodash');var util=require(_0x2cf1('0x0'));var moment=require('moment');var BPromise=require(_0x2cf1('0x1'));var rs=require(_0x2cf1('0x2'));var fs=require('fs');var Redis=require(_0x2cf1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2cf1('0x4'));var logger=require(_0x2cf1('0x5'))(_0x2cf1('0x6'));var config=require(_0x2cf1('0x7'));var jayson=require(_0x2cf1('0x8'));var client=jayson[_0x2cf1('0x9')][_0x2cf1('0xa')]({'port':0x232a});config[_0x2cf1('0xb')]=_[_0x2cf1('0xc')](config['redis'],{'host':_0x2cf1('0xd'),'port':0x18eb});var socket=require(_0x2cf1('0xe'))(new Redis(config[_0x2cf1('0xb')]));require(_0x2cf1('0xf'))[_0x2cf1('0x10')](socket);function respondWithRpcPromise(_0x25b0af,_0x4c9779,_0x5458d7){return new BPromise(function(_0x4a4a08,_0x34a404){return client['request'](_0x25b0af,_0x5458d7)[_0x2cf1('0x11')](function(_0x25a814){logger[_0x2cf1('0x12')]('MailInteraction,\x20%s,\x20%s',_0x4c9779,_0x2cf1('0x13'));logger['debug'](_0x2cf1('0x14'),_0x4c9779,_0x2cf1('0x13'),JSON[_0x2cf1('0x15')](_0x25a814));if(_0x25a814[_0x2cf1('0x16')]){if(_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x17')]===0x1f4){logger[_0x2cf1('0x16')](_0x2cf1('0x18'),_0x4c9779,_0x25a814[_0x2cf1('0x16')]['message']);return _0x34a404(_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x19')]);}logger['error'](_0x2cf1('0x18'),_0x4c9779,_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x19')]);return _0x4a4a08(_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x19')]);}else{logger[_0x2cf1('0x12')](_0x2cf1('0x18'),_0x4c9779,_0x2cf1('0x13'));_0x4a4a08(_0x25a814[_0x2cf1('0x1a')][_0x2cf1('0x19')]);}})[_0x2cf1('0x1b')](function(_0x4a6dc3){logger[_0x2cf1('0x16')]('MailInteraction,\x20%s,\x20%s',_0x4c9779,_0x4a6dc3);_0x34a404(_0x4a6dc3);});});}exports[_0x2cf1('0x1c')]=function(_0x5845b){var _0x1e5dcf=this;return new Promise(function(_0x321afb,_0x16f681){return db[_0x2cf1('0x1d')][_0x2cf1('0x1e')](_0x5845b[_0x2cf1('0x1f')],{'raw':_0x5845b['options']?_0x5845b[_0x2cf1('0x20')][_0x2cf1('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5845b[_0x2cf1('0x20')]?_0x5845b['options'][_0x2cf1('0x22')]||null:null,'attributes':_0x5845b['options']?_0x5845b[_0x2cf1('0x20')][_0x2cf1('0x23')]||null:null,'limit':_0x5845b[_0x2cf1('0x20')]?_0x5845b[_0x2cf1('0x20')]['limit']||null:null})[_0x2cf1('0x11')](function(_0x3e5cae){logger[_0x2cf1('0x12')](_0x2cf1('0x1c'),_0x5845b);logger['debug'](_0x2cf1('0x1c'),_0x5845b,JSON['stringify'](_0x3e5cae));_0x321afb(_0x3e5cae);})['catch'](function(_0x208b70){logger['error'](_0x2cf1('0x1c'),_0x208b70[_0x2cf1('0x19')],_0x5845b);_0x16f681(_0x1e5dcf[_0x2cf1('0x16')](0x1f4,_0x208b70['message']));});});};exports[_0x2cf1('0x24')]=function(_0x4f143e){return new Promise(function(_0x4c564a,_0x9008af){return db[_0x2cf1('0x1d')][_0x2cf1('0x25')]({'where':_0x4f143e[_0x2cf1('0x20')]?_0x4f143e[_0x2cf1('0x20')][_0x2cf1('0x22')]||null:null})['then'](function(_0x4c18d7){if(_0x4c18d7){return _0x4c18d7[_0x2cf1('0x26')](_0x4f143e[_0x2cf1('0x1f')][_0x2cf1('0x27')],_[_0x2cf1('0x28')](_0x4f143e[_0x2cf1('0x1f')],[_0x2cf1('0x27'),'id'])||{});}})['spread'](function(_0x1bf9e6){logger['info'](_0x2cf1('0x29'),_0x4f143e);logger['debug'](_0x2cf1('0x29'),_0x4f143e,JSON[_0x2cf1('0x15')](_0x1bf9e6));_0x4c564a(_0x1bf9e6);})['catch'](function(_0x36504d){logger[_0x2cf1('0x16')](_0x2cf1('0x29'),_0x36504d[_0x2cf1('0x19')],_0x4f143e);_0x9008af(_this['error'](0x1f4,_0x36504d[_0x2cf1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0796a97..38ae2c5 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 _0x7fe9=['removeListener','register','mailInteraction:','save','remove','update'];(function(_0x1d8d65,_0x557f4c){var _0x28b0a5=function(_0x313efe){while(--_0x313efe){_0x1d8d65['push'](_0x1d8d65['shift']());}};_0x28b0a5(++_0x557f4c);}(_0x7fe9,0x135));var _0x97fe=function(_0x317e30,_0x32ad66){_0x317e30=_0x317e30-0x0;var _0x203788=_0x7fe9[_0x317e30];return _0x203788;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x97fe('0x0'),_0x97fe('0x1'),_0x97fe('0x2')];function createListener(_0x562607,_0x286c81){return function(_0x2fc99d){_0x286c81['emit'](_0x562607,_0x2fc99d);};}function removeListener(_0x16693f,_0xb18ef3){return function(){MailInteractionEvents[_0x97fe('0x3')](_0x16693f,_0xb18ef3);};}exports[_0x97fe('0x4')]=function(_0x3944a1){for(var _0x169adf=0x0,_0x294ccd=events['length'];_0x169adf<_0x294ccd;_0x169adf++){var _0x3663d2=events[_0x169adf];var _0x41ec51=createListener(_0x97fe('0x5')+_0x3663d2,_0x3944a1);MailInteractionEvents['on'](_0x3663d2,_0x41ec51);}}; \ No newline at end of file +var _0xcbe2=['remove','update','emit','removeListener','register','mailInteraction:','./mailInteraction.events','save'];(function(_0x50d265,_0x2ed848){var _0x18eca3=function(_0x45b7f2){while(--_0x45b7f2){_0x50d265['push'](_0x50d265['shift']());}};_0x18eca3(++_0x2ed848);}(_0xcbe2,0xf6));var _0x2cbe=function(_0x1d42aa,_0x271cf7){_0x1d42aa=_0x1d42aa-0x0;var _0x4e7c53=_0xcbe2[_0x1d42aa];return _0x4e7c53;};'use strict';var MailInteractionEvents=require(_0x2cbe('0x0'));var events=[_0x2cbe('0x1'),_0x2cbe('0x2'),_0x2cbe('0x3')];function createListener(_0x3d6aa7,_0x16bf49){return function(_0x14b1d0){_0x16bf49[_0x2cbe('0x4')](_0x3d6aa7,_0x14b1d0);};}function removeListener(_0x3ff7ef,_0x2d0949){return function(){MailInteractionEvents[_0x2cbe('0x5')](_0x3ff7ef,_0x2d0949);};}exports[_0x2cbe('0x6')]=function(_0x11fd73){for(var _0x14cabe=0x0,_0x420537=events['length'];_0x14cabe<_0x420537;_0x14cabe++){var _0x49be27=events[_0x14cabe];var _0x8213c5=createListener(_0x2cbe('0x7')+_0x49be27,_0x11fd73);MailInteractionEvents['on'](_0x49be27,_0x8213c5);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 118565d..63e773f 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 _0x46ed=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','express'];(function(_0x1191b3,_0x4da0c7){var _0x3fb66e=function(_0x499f9c){while(--_0x499f9c){_0x1191b3['push'](_0x1191b3['shift']());}};_0x3fb66e(++_0x4da0c7);}(_0x46ed,0x168));var _0xd46e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x46ed[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./mailMessage.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0x7')](_0xd46e('0xc'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router['get'](_0xd46e('0xe'),auth[_0xd46e('0x8')](),controller['download']);router[_0xd46e('0xf')]('/',auth[_0xd46e('0x8')](),interaction[_0xd46e('0x10')](_0xd46e('0x11'),_0xd46e('0x12')),controller[_0xd46e('0x13')]);router['put'](_0xd46e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd46e('0x14')](_0xd46e('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xd46e('0x14')](_0xd46e('0x16'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x17')]);router['delete'](_0xd46e('0xc'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x18')]);module[_0xd46e('0x19')]=router; \ No newline at end of file +var _0x5496=['create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailMessage.controller','get','/describe','describe','/:id','show','/:id/download','isAuthenticated','download','post','mail','mailmessage:create'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5496,0x175));var _0x6549=function(_0x42d2c6,_0x2a4ef6){_0x42d2c6=_0x42d2c6-0x0;var _0x2b8418=_0x5496[_0x42d2c6];return _0x2b8418;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var auth=require(_0x6549('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6549('0x6'));var controller=require(_0x6549('0x7'));router[_0x6549('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6549('0x8')](_0x6549('0x9'),auth['isAuthenticated'](),controller[_0x6549('0xa')]);router[_0x6549('0x8')](_0x6549('0xb'),auth['isAuthenticated'](),controller[_0x6549('0xc')]);router[_0x6549('0x8')](_0x6549('0xd'),auth[_0x6549('0xe')](),controller[_0x6549('0xf')]);router[_0x6549('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x6549('0x11'),_0x6549('0x12')),controller[_0x6549('0x13')]);router[_0x6549('0x14')](_0x6549('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6549('0x14')](_0x6549('0x15'),auth['isAuthenticated'](),controller[_0x6549('0x16')]);router[_0x6549('0x14')](_0x6549('0x17'),auth[_0x6549('0xe')](),controller[_0x6549('0x18')]);router[_0x6549('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x6549('0x1a')]);module[_0x6549('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 921c59b..f18a4e9 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 _0x7990=['TEXT','long','BOOLEAN','out','STRING','DATE','INTEGER','sequelize','lodash','exports'];(function(_0x4acb05,_0x29525f){var _0x2403e0=function(_0x579a44){while(--_0x579a44){_0x4acb05['push'](_0x4acb05['shift']());}};_0x2403e0(++_0x29525f);}(_0x7990,0xe3));var _0x0799=function(_0x3bcda2,_0xf8a87){_0x3bcda2=_0x3bcda2-0x0;var _0x49cd6d=_0x7990[_0x3bcda2];return _0x49cd6d;};'use strict';var Sequelize=require(_0x0799('0x0'));var _=require(_0x0799('0x1'));module[_0x0799('0x2')]={'body':{'type':Sequelize[_0x0799('0x3')](_0x0799('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0799('0x3')]('medium')},'read':{'type':Sequelize[_0x0799('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0799('0x6')),'defaultValue':_0x0799('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x0799('0x7')]},'to':{'type':Sequelize[_0x0799('0x3')]('long')},'cc':{'type':Sequelize[_0x0799('0x3')](_0x0799('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x0799('0x4'))},'subject':{'type':Sequelize[_0x0799('0x3')]},'sentAt':{'type':Sequelize[_0x0799('0x8')]},'attach':{'type':Sequelize[_0x0799('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0799('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x0799('0x3')](_0x0799('0x4'))},'originCc':{'type':Sequelize[_0x0799('0x3')]('long')}}; \ No newline at end of file +var _0xbec8=['long','medium','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','sequelize','lodash','TEXT'];(function(_0x3a2a33,_0x29372a){var _0x10d6d2=function(_0x2c63b7){while(--_0x2c63b7){_0x3a2a33['push'](_0x3a2a33['shift']());}};_0x10d6d2(++_0x29372a);}(_0xbec8,0x1cb));var _0x8bec=function(_0xa64531,_0x48c65f){_0xa64531=_0xa64531-0x0;var _0x1b1f42=_0xbec8[_0xa64531];return _0x1b1f42;};'use strict';var Sequelize=require(_0x8bec('0x0'));var _=require(_0x8bec('0x1'));module['exports']={'body':{'type':Sequelize[_0x8bec('0x2')](_0x8bec('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8bec('0x2')](_0x8bec('0x4'))},'read':{'type':Sequelize[_0x8bec('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8bec('0x6')]('in',_0x8bec('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x8bec('0x8')](0x1fe)},'from':{'type':Sequelize[_0x8bec('0x8')]},'to':{'type':Sequelize[_0x8bec('0x2')]('long')},'cc':{'type':Sequelize['TEXT'](_0x8bec('0x3'))},'bcc':{'type':Sequelize[_0x8bec('0x2')](_0x8bec('0x3'))},'subject':{'type':Sequelize[_0x8bec('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x8bec('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8bec('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8bec('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0x8bec('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x8bec('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index c23bf74..c4c1f3c 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 _0xe422=['rejectMessage','interface','SIP/%s','rejectmessage','download','unix','toString','server','files','tmp','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','MailMessage','rawAttributes','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','field','merge','options','include','findAll','catch','show','find','update','body','params','describe','create','direction','secret','MailAccount','findOne','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','length','join','root','server/files/attachments','basename','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','channel','event','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe422,0x15f));var _0x2e42=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xe422[_0x1a72f3];return _0x57ef47;};'use strict';var pdf=require(_0x2e42('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2e42('0x1'));var zipdir=require(_0x2e42('0x2'));var jsonpatch=require(_0x2e42('0x3'));var rp=require(_0x2e42('0x4'));var moment=require(_0x2e42('0x5'));var BPromise=require(_0x2e42('0x6'));var Mustache=require(_0x2e42('0x7'));var util=require(_0x2e42('0x8'));var path=require(_0x2e42('0x9'));var sox=require(_0x2e42('0xa'));var csv=require(_0x2e42('0xb'));var ejs=require(_0x2e42('0xc'));var fs=require('fs');var _=require(_0x2e42('0xd'));var squel=require(_0x2e42('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2e42('0xf'));var toCsv=require(_0x2e42('0xb'));var querystring=require(_0x2e42('0x10'));var Papa=require(_0x2e42('0x11'));var Redis=require(_0x2e42('0x12'));var authService=require(_0x2e42('0x13'));var qs=require(_0x2e42('0x14'));var hardwareService=require(_0x2e42('0x15'));var logger=require(_0x2e42('0x16'))(_0x2e42('0x17'));var utils=require(_0x2e42('0x18'));var config=require(_0x2e42('0x19'));var db=require('../../mysqldb')['db'];config[_0x2e42('0x1a')]=_[_0x2e42('0x1b')](config[_0x2e42('0x1a')],{'host':_0x2e42('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e42('0x1a')]));require(_0x2e42('0x1d'))[_0x2e42('0x1e')](socket);var jayson=require(_0x2e42('0x1f'));var client=jayson['client'][_0x2e42('0x20')]({'port':0x232c});var client9003=jayson[_0x2e42('0x21')][_0x2e42('0x20')]({'port':0x232b});var client9002=jayson['client'][_0x2e42('0x20')]({'port':0x232a});function checkPasswordPattern(_0x207f02,_0x5e49e2,_0x2e6a57){if(_0x2e6a57){var _0x505c02=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x505c02[_0x2e42('0x22')](_0x5e49e2)){return _0x207f02;}else{throw new Error(_0x2e42('0x23'));}}else{return _0x207f02;}}function respondWithRpcPromise(_0x202be4,_0x4aba9a,_0x2769de,_0x58f374){return new BPromise(function(_0x11ea98,_0x56f9c9){var _0x10c3f0=_0x58f374||client;return _0x10c3f0[_0x2e42('0x24')](_0x202be4,_0x2769de)['then'](function(_0x198176){logger[_0x2e42('0x25')](_0x2e42('0x26'),_0x4aba9a,_0x2e42('0x27'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x4aba9a,_0x2e42('0x27'),JSON[_0x2e42('0x28')](_0x198176));if(_0x198176['error']){if(_0x198176[_0x2e42('0x29')][_0x2e42('0x2a')]===0x1f4){logger['error'](_0x2e42('0x26'),_0x4aba9a,_0x198176[_0x2e42('0x29')][_0x2e42('0x2b')]);return _0x56f9c9(_0x198176[_0x2e42('0x29')][_0x2e42('0x2b')]);}logger[_0x2e42('0x29')](_0x2e42('0x26'),_0x4aba9a,_0x198176[_0x2e42('0x29')]['message']);return _0x11ea98(_0x198176['error']['message']);}else{logger[_0x2e42('0x25')](_0x2e42('0x26'),_0x4aba9a,_0x2e42('0x27'));_0x11ea98(_0x198176[_0x2e42('0x2c')]['message']);}})['catch'](function(_0xdb421c){logger[_0x2e42('0x29')](_0x2e42('0x26'),_0x4aba9a,_0xdb421c);_0x56f9c9(_0xdb421c);});});}function respondWithStatusCode(_0x4c8ce9,_0x586a4c){_0x586a4c=_0x586a4c||0xcc;return function(_0xed448b){if(_0xed448b){return _0x4c8ce9[_0x2e42('0x2d')](_0x586a4c);}return _0x4c8ce9[_0x2e42('0x2e')](_0x586a4c)[_0x2e42('0x2f')]();};}function respondWithResult(_0x16300e,_0x2f7eba){_0x2f7eba=_0x2f7eba||0xc8;return function(_0x12e4d2){if(_0x12e4d2){return _0x16300e['status'](_0x2f7eba)['json'](_0x12e4d2);}};}function respondWithFilteredResult(_0x28b18f,_0x43953c){return function(_0x3418e3){if(_0x3418e3){var _0x43d101=_0x3418e3[_0x2e42('0x30')],_0x45ff5d=_0x43953c[_0x2e42('0x31')],_0x3899cb=_0x43953c[_0x2e42('0x31')]+_0x43953c[_0x2e42('0x32')],_0x44108f;if(_0x3899cb>=_0x43d101){_0x3899cb=_0x43d101;_0x44108f=0xc8;}else{_0x44108f=0xce;}_0x28b18f['status'](_0x44108f);return _0x28b18f[_0x2e42('0x33')](_0x2e42('0x34'),_0x45ff5d+'-'+_0x3899cb+'/'+_0x43d101)[_0x2e42('0x35')](_0x3418e3);}return null;};}function patchUpdates(_0x18877e){return function(_0x2b61fc){try{jsonpatch[_0x2e42('0x36')](_0x2b61fc,_0x18877e,!![]);}catch(_0x2915ae){return BPromise[_0x2e42('0x37')](_0x2915ae);}return _0x2b61fc[_0x2e42('0x38')]();};}function saveUpdates(_0x32ca19,_0x15e6d9){return function(_0x4fa6c3){if(_0x4fa6c3){return _0x4fa6c3['update'](_0x32ca19)[_0x2e42('0x39')](function(_0x14780e){return _0x14780e;});}return null;};}function removeEntity(_0x3a6641,_0x4c834){return function(_0x256a02){if(_0x256a02){return _0x256a02[_0x2e42('0x3a')]()[_0x2e42('0x39')](function(){_0x3a6641['status'](0xcc)[_0x2e42('0x2f')]();});}};}function handleEntityNotFound(_0x456799,_0x281cce){return function(_0x3ec487){if(!_0x3ec487){_0x456799[_0x2e42('0x2d')](0x194);}return _0x3ec487;};}function handleError(_0x1fb073,_0x4a35e6){_0x4a35e6=_0x4a35e6||0x1f4;return function(_0x1bd17c){logger[_0x2e42('0x29')](_0x1bd17c[_0x2e42('0x3b')]);if(_0x1bd17c[_0x2e42('0x3c')]){delete _0x1bd17c['name'];}_0x1fb073['status'](_0x4a35e6)[_0x2e42('0x3d')](_0x1bd17c);};}exports[_0x2e42('0x3e')]=function(_0x1abd6a,_0x5aa840){var _0x2d5a05={},_0x2cbf4c={},_0x543657={'count':0x0,'rows':[]};var _0x2e5c2f=db[_0x2e42('0x3f')][_0x2e42('0x40')];_0x2cbf4c[_0x2e42('0x41')]=_[_0x2e42('0x42')](_0x2e5c2f);_0x2cbf4c['query']=_['keys'](_0x1abd6a['query']);_0x2cbf4c[_0x2e42('0x43')]=_[_0x2e42('0x44')](_0x2cbf4c[_0x2e42('0x41')],_0x2cbf4c['query']);_0x2d5a05[_0x2e42('0x45')]=_[_0x2e42('0x44')](_0x2cbf4c[_0x2e42('0x41')],qs[_0x2e42('0x46')](_0x1abd6a['query'][_0x2e42('0x46')]));_0x2d5a05[_0x2e42('0x45')]=_0x2d5a05[_0x2e42('0x45')]['length']?_0x2d5a05[_0x2e42('0x45')]:_0x2cbf4c[_0x2e42('0x41')];if(!_0x1abd6a[_0x2e42('0x47')][_0x2e42('0x48')](_0x2e42('0x49'))){_0x2d5a05[_0x2e42('0x32')]=qs['limit'](_0x1abd6a[_0x2e42('0x47')][_0x2e42('0x32')]);_0x2d5a05['offset']=qs[_0x2e42('0x31')](_0x1abd6a[_0x2e42('0x47')][_0x2e42('0x31')]);}_0x2d5a05[_0x2e42('0x4a')]=qs['sort'](_0x1abd6a['query'][_0x2e42('0x4b')]);_0x2d5a05[_0x2e42('0x4c')]=qs[_0x2e42('0x43')](_[_0x2e42('0x4d')](_0x1abd6a[_0x2e42('0x47')],_0x2cbf4c[_0x2e42('0x43')]));if(_0x1abd6a[_0x2e42('0x47')][_0x2e42('0x4e')]){_0x2d5a05[_0x2e42('0x4c')]=_['merge'](_0x2d5a05[_0x2e42('0x4c')],{'$or':_['map'](_0x2e5c2f,function(_0x2f2ae1){if(_0x2f2ae1[_0x2e42('0x4f')]['key']!==_0x2e42('0x50')){var _0x5a3539={};_0x5a3539[_0x2f2ae1[_0x2e42('0x51')]]={'$like':'%'+_0x1abd6a[_0x2e42('0x47')][_0x2e42('0x4e')]+'%'};return _0x5a3539;}})});}_0x2d5a05=_[_0x2e42('0x52')]({},_0x2d5a05,_0x1abd6a[_0x2e42('0x53')]);var _0x523600={'where':_0x2d5a05[_0x2e42('0x4c')]};return db['MailMessage'][_0x2e42('0x30')](_0x523600)['then'](function(_0x9ce95c){_0x543657[_0x2e42('0x30')]=_0x9ce95c;if(_0x1abd6a[_0x2e42('0x47')]['includeAll']){_0x2d5a05[_0x2e42('0x54')]=[{'all':!![]}];}return db['MailMessage'][_0x2e42('0x55')](_0x2d5a05);})[_0x2e42('0x39')](function(_0x55ccf5){_0x543657['rows']=_0x55ccf5;return _0x543657;})['then'](respondWithFilteredResult(_0x5aa840,_0x2d5a05))[_0x2e42('0x56')](handleError(_0x5aa840,null));};exports[_0x2e42('0x57')]=function(_0x446a33,_0x25c094){var _0x218553={'raw':!![],'where':{'id':_0x446a33['params']['id']}},_0x281e7d={};_0x281e7d[_0x2e42('0x41')]=_[_0x2e42('0x42')](db[_0x2e42('0x3f')][_0x2e42('0x40')]);_0x281e7d[_0x2e42('0x47')]=_[_0x2e42('0x42')](_0x446a33[_0x2e42('0x47')]);_0x281e7d[_0x2e42('0x43')]=_[_0x2e42('0x44')](_0x281e7d[_0x2e42('0x41')],_0x281e7d[_0x2e42('0x47')]);_0x218553[_0x2e42('0x45')]=_[_0x2e42('0x44')](_0x281e7d[_0x2e42('0x41')],qs['fields'](_0x446a33[_0x2e42('0x47')][_0x2e42('0x46')]));_0x218553[_0x2e42('0x45')]=_0x218553[_0x2e42('0x45')]['length']?_0x218553['attributes']:_0x281e7d[_0x2e42('0x41')];if(_0x446a33[_0x2e42('0x47')]['includeAll']){_0x218553[_0x2e42('0x54')]=[{'all':!![]}];}_0x218553=_['merge']({},_0x218553,_0x446a33[_0x2e42('0x53')]);return db[_0x2e42('0x3f')][_0x2e42('0x58')](_0x218553)[_0x2e42('0x39')](handleEntityNotFound(_0x25c094,null))[_0x2e42('0x39')](respondWithResult(_0x25c094,null))['catch'](handleError(_0x25c094,null));};exports[_0x2e42('0x59')]=function(_0x1ddeeb,_0x4488f7){if(_0x1ddeeb[_0x2e42('0x5a')]['id']){delete _0x1ddeeb[_0x2e42('0x5a')]['id'];}return db['MailMessage'][_0x2e42('0x58')]({'where':{'id':_0x1ddeeb[_0x2e42('0x5b')]['id']}})[_0x2e42('0x39')](handleEntityNotFound(_0x4488f7,null))[_0x2e42('0x39')](saveUpdates(_0x1ddeeb[_0x2e42('0x5a')],null))['then'](respondWithResult(_0x4488f7,null))[_0x2e42('0x56')](handleError(_0x4488f7,null));};exports[_0x2e42('0x3a')]=function(_0x2cf9c9,_0x42f11f){return db[_0x2e42('0x3f')][_0x2e42('0x58')]({'where':{'id':_0x2cf9c9[_0x2e42('0x5b')]['id']}})[_0x2e42('0x39')](handleEntityNotFound(_0x42f11f,null))['then'](removeEntity(_0x42f11f,null))[_0x2e42('0x56')](handleError(_0x42f11f,null));};exports[_0x2e42('0x5c')]=function(_0x4b9f3c,_0x9e8de2){return db[_0x2e42('0x3f')][_0x2e42('0x5c')]()[_0x2e42('0x39')](respondWithResult(_0x9e8de2,null))[_0x2e42('0x56')](handleError(_0x9e8de2,null));};exports[_0x2e42('0x5d')]=function(_0x349701,_0x1076a3){return db[_0x2e42('0x3f')][_0x2e42('0x5d')](_0x349701[_0x2e42('0x5a')])[_0x2e42('0x39')](function(_0x3c65bb){if(_0x3c65bb){if(_0x3c65bb[_0x2e42('0x5e')]==='out'&&!_0x3c65bb[_0x2e42('0x5f')]){return db[_0x2e42('0x60')][_0x2e42('0x61')]({'where':{'id':_0x3c65bb['MailAccountId']},'include':[{'model':db['MailServerOut'],'as':_0x2e42('0x62'),'raw':!![]}]})[_0x2e42('0x39')](function(_0x3b089c){if(_0x3b089c&&_0x3b089c[_0x2e42('0x62')]){var _0x6c27e4={'tls':{'rejectUnauthorized':![]}};if(_[_0x2e42('0x63')](_0x3b089c[_0x2e42('0x62')][_0x2e42('0x64')])){_0x6c27e4[_0x2e42('0x65')]=_0x3b089c['Smtp'][_0x2e42('0x65')];_0x6c27e4['port']=_0x3b089c[_0x2e42('0x62')][_0x2e42('0x66')];_0x6c27e4[_0x2e42('0x67')]=_0x3b089c[_0x2e42('0x62')][_0x2e42('0x67')];if(_0x3b089c['Smtp'][_0x2e42('0x68')]){_0x6c27e4[_0x2e42('0x69')]={'user':_0x3b089c[_0x2e42('0x62')][_0x2e42('0x6a')],'pass':_0x3b089c['Smtp'][_0x2e42('0x6b')]};}}else{_0x6c27e4['service']=_0x3b089c[_0x2e42('0x62')][_0x2e42('0x64')];_0x6c27e4[_0x2e42('0x69')]={'user':_0x3b089c[_0x2e42('0x62')]['user'],'pass':_0x3b089c[_0x2e42('0x62')][_0x2e42('0x6b')]};_0x6c27e4[_0x2e42('0x67')]=_0x3b089c[_0x2e42('0x62')][_0x2e42('0x67')];}if(_0x349701[_0x2e42('0x5a')]['attachments']&&_0x349701[_0x2e42('0x5a')][_0x2e42('0x6c')][_0x2e42('0x6d')]){for(var _0x202d81=0x0;_0x202d81<_0x349701[_0x2e42('0x5a')]['attachments'][_0x2e42('0x6d')];_0x202d81+=0x1){_0x349701[_0x2e42('0x5a')][_0x2e42('0x6c')][_0x202d81]={'filename':_0x349701[_0x2e42('0x5a')][_0x2e42('0x6c')][_0x202d81][_0x2e42('0x3c')],'path':path[_0x2e42('0x6e')](config[_0x2e42('0x6f')],_0x2e42('0x70'),_0x349701[_0x2e42('0x5a')][_0x2e42('0x6c')][_0x202d81][_0x2e42('0x71')])};}}return{'account':_0x6c27e4,'message':_0x349701['body']};}})[_0x2e42('0x39')](function(_0x5afd1a){if(_0x5afd1a){return respondWithRpcPromise('SendMail',_0x2e42('0x72'),_0x5afd1a,client9003)[_0x2e42('0x39')](function(_0x2f6ace){return _0x3c65bb[_0x2e42('0x59')]({'read':!![],'messageId':_0x2f6ace['messageId'],'sentAt':moment()[_0x2e42('0x73')](_0x2e42('0x74'))});})[_0x2e42('0x56')](function(_0x1a7962){logger[_0x2e42('0x29')]('%s',JSON[_0x2e42('0x28')](_0x1a7962));return _0x3c65bb;});}return _0x3c65bb;});}return _0x3c65bb;}})['then'](respondWithResult(_0x1076a3,0xc9))[_0x2e42('0x56')](handleError(_0x1076a3,null));};var interaction_log=require(_0x2e42('0x16'))(_0x2e42('0x75'));exports[_0x2e42('0x76')]=function(_0x13309c,_0x186a5f,_0xf0c812){var _0x14578c={'channel':_0x2e42('0x77')};if(_0x13309c[_0x2e42('0x5a')]['id']){delete _0x13309c[_0x2e42('0x5a')]['id'];}_0x13309c[_0x2e42('0x5a')][_0x2e42('0x78')]=!![];_0x13309c[_0x2e42('0x5a')][_0x2e42('0x79')]=moment()[_0x2e42('0x73')](_0x2e42('0x74'));_0x13309c[_0x2e42('0x5a')][_0x2e42('0x7a')]=_0x13309c[_0x2e42('0x5a')][_0x2e42('0x7a')]||_0x13309c[_0x2e42('0x6a')]['id'];return db[_0x2e42('0x3f')][_0x2e42('0x58')]({'where':{'id':_0x13309c[_0x2e42('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0x2e42('0x7b')],'as':_0x2e42('0x7c')}]})[_0x2e42('0x39')](handleEntityNotFound(_0x186a5f,null))[_0x2e42('0x39')](saveUpdates(_0x13309c['body'],null))[_0x2e42('0x39')](function(_0x48acb2){if(_0x48acb2){_0x14578c[_0x2e42('0x2b')]=_0x48acb2[_0x2e42('0x7d')]({'plain':!![]});return db[_0x2e42('0x7e')][_0x2e42('0x58')]({'where':{'id':_0x48acb2[_0x2e42('0x7f')]}});}return null;})[_0x2e42('0x39')](handleEntityNotFound(_0x186a5f,null))[_0x2e42('0x39')](function(_0x1a56d9){if(_0x1a56d9){return _0x1a56d9[_0x2e42('0x59')]({'UserId':_0x13309c[_0x2e42('0x5a')][_0x2e42('0x7a')],'read1stAt':_['isNil'](_0x1a56d9[_0x2e42('0x80')])?moment()['format'](_0x2e42('0x74')):undefined});}return null;})[_0x2e42('0x39')](function(_0x3e6568){if(_0x3e6568){_0x14578c[_0x2e42('0x81')]=_0x3e6568[_0x2e42('0x7d')]({'plain':!![]});interaction_log[_0x2e42('0x25')](_0x2e42('0x82'),_0x13309c[_0x2e42('0x6a')]['id'],_0x13309c[_0x2e42('0x6a')][_0x2e42('0x3c')],_0x13309c[_0x2e42('0x6a')][_0x2e42('0x83')],_0x14578c[_0x2e42('0x81')]['id'],_0x13309c['body']?JSON[_0x2e42('0x28')](_0x13309c[_0x2e42('0x5a')]):_0x2e42('0x84'));return respondWithRpcPromise('AcceptMessage',_0x2e42('0x85'),_0x14578c);}return null;})['then'](function(_0x521276){if(_0x521276){if(_0x13309c[_0x2e42('0x5a')]['manual']){_0x14578c[_0x2e42('0x2b')]['interface']=util[_0x2e42('0x73')]('SIP/%s',_0x13309c[_0x2e42('0x6a')]['name']);_0x14578c[_0x2e42('0x2b')][_0x2e42('0x86')]=_0x14578c[_0x2e42('0x86')];_0x14578c[_0x2e42('0x2b')][_0x2e42('0x87')]=_0x2e42('0x76');return respondWithRpcPromise('EventManager',_0x2e42('0x88'),{'event':_0x2e42('0x89'),'message':_0x14578c[_0x2e42('0x2b')]},client9002)[_0x2e42('0x39')](function(){return _0x14578c;});}return _0x14578c;}return null;})[_0x2e42('0x39')](respondWithResult(_0x186a5f,null))['catch'](handleError(_0x186a5f,null));};var interaction_log=require(_0x2e42('0x16'))(_0x2e42('0x75'));exports['reject']=function(_0x1b10cb,_0x5d2d74,_0x47e72e){var _0xc2f473={'agent':{},'channel':_0x2e42('0x77')};if(_0x1b10cb[_0x2e42('0x5a')]['id']){delete _0x1b10cb['body']['id'];}_0x1b10cb['body']['UserId']=_0x1b10cb['body']['UserId']||_0x1b10cb['user']['id'];_0xc2f473[_0x2e42('0x8a')]['id']=_0x1b10cb[_0x2e42('0x5a')]['UserId'];return db[_0x2e42('0x3f')]['find']({'where':{'id':_0x1b10cb[_0x2e42('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5d2d74,null))[_0x2e42('0x39')](function(_0xc46d94){if(_0xc46d94){_0xc2f473[_0x2e42('0x2b')]=_0xc46d94[_0x2e42('0x7d')]({'plain':!![]});return db[_0x2e42('0x7e')]['find']({'where':{'id':_0xc46d94[_0x2e42('0x7f')]}});}return null;})[_0x2e42('0x39')](handleEntityNotFound(_0x5d2d74,null))[_0x2e42('0x39')](function(_0xe4e18d){if(_0xe4e18d){_0xc2f473['interaction']=_0xe4e18d[_0x2e42('0x7d')]({'plain':!![]});interaction_log['info'](_0x2e42('0x8b'),_0x1b10cb[_0x2e42('0x6a')]['id'],_0x1b10cb[_0x2e42('0x6a')]['name'],_0x1b10cb[_0x2e42('0x6a')][_0x2e42('0x83')],_0xc2f473[_0x2e42('0x81')]['id'],_0x1b10cb['body']?JSON['stringify'](_0x1b10cb[_0x2e42('0x5a')]):'null');return respondWithRpcPromise(_0x2e42('0x8c'),_0x2e42('0x8d'),_0xc2f473);}return null;})['then'](function(_0x3e3bc7){if(_0x3e3bc7){_0x3e3bc7[_0x2e42('0x2b')][_0x2e42('0x8e')]=util[_0x2e42('0x73')](_0x2e42('0x8f'),_0x1b10cb[_0x2e42('0x6a')][_0x2e42('0x3c')]);_0x3e3bc7[_0x2e42('0x2b')][_0x2e42('0x86')]=_0xc2f473[_0x2e42('0x86')];_0x3e3bc7[_0x2e42('0x2b')]['event']=_0x2e42('0x37');respondWithRpcPromise('EventManager',_0x2e42('0x88'),{'event':_0x2e42('0x90'),'message':_0x3e3bc7['message']},client9002);return _0xc2f473;}return null;})[_0x2e42('0x39')](respondWithResult(_0x5d2d74,null))[_0x2e42('0x56')](handleError(_0x5d2d74,null));};exports[_0x2e42('0x91')]=function(_0x277296,_0x2e7dd8){var _0x22f083=moment()[_0x2e42('0x92')]()[_0x2e42('0x93')]();var _0x2cab1a=path[_0x2e42('0x6e')](config[_0x2e42('0x6f')],_0x2e42('0x94'),_0x2e42('0x95'),_0x2e42('0x96'));var _0x3b4b47=path[_0x2e42('0x6e')](config[_0x2e42('0x6f')],_0x2e42('0x94'),_0x2e42('0x95'),_0x2e42('0x6c'));var _0x1070cf=util[_0x2e42('0x73')]('message-%s.eml',_0x22f083);return db[_0x2e42('0x3f')][_0x2e42('0x58')]({'where':{'id':_0x277296['params']['id']},'attributes':['id',_0x2e42('0x5a'),'from','to','cc',_0x2e42('0x97'),_0x2e42('0x98'),_0x2e42('0x99')],'include':_0x277296[_0x2e42('0x47')][_0x2e42('0x6c')]?[{'model':db[_0x2e42('0x9a')],'as':_0x2e42('0x9b')}]:undefined})[_0x2e42('0x39')](handleEntityNotFound(_0x2e7dd8,null))[_0x2e42('0x39')](function(_0x5ace0e){if(_0x5ace0e){var _0x41f29e=_0x5ace0e;var _0x4ec4a9={'from':_0x41f29e['from'],'to':_0x41f29e['to'],'subject':_0x41f29e[_0x2e42('0x98')],'html':_0x41f29e[_0x2e42('0x5a')],'headers':{'Date':moment(_0x41f29e[_0x2e42('0x99')])['format'](_0x2e42('0x9c'))},'attachments':[]};if(_0x5ace0e['cc']){_0x4ec4a9[_0x2e42('0x9d')]['Cc']=_0x5ace0e['cc'];}if(_0x5ace0e[_0x2e42('0x97')]){_0x4ec4a9[_0x2e42('0x9d')]['Bcc']=_0x5ace0e[_0x2e42('0x97')];}return new BPromise(function(_0x2fd8d0,_0x19c356){if(_0x5ace0e[_0x2e42('0x9b')]){for(var _0x56cc47=0x0;_0x56cc47<_0x5ace0e['Attachments']['length'];_0x56cc47++){var _0x1fef79=_0x5ace0e[_0x2e42('0x9b')][_0x56cc47];var _0x5ba384=path[_0x2e42('0x6e')](_0x3b4b47,_0x1fef79['basename']);if(fs[_0x2e42('0x9e')](_0x5ba384)){_0x4ec4a9[_0x2e42('0x6c')][_0x2e42('0x9f')]({'name':_0x1fef79['name'],'contentType':_0x1fef79['type'],'data':fs['readFileSync'](_0x5ba384)});}}}emlformat[_0x2e42('0xa0')](_0x4ec4a9,function(_0xde6e10,_0x64ced){if(_0xde6e10)return _0x19c356(_0xde6e10);fs['writeFileSync'](path[_0x2e42('0x6e')](_0x2cab1a,_0x1070cf),_0x64ced);return _0x2fd8d0(_0x64ced);});});}})['then'](function(_0x53aa9f){if(_0x53aa9f){return _0x2e7dd8[_0x2e42('0x91')](path[_0x2e42('0x6e')](_0x2cab1a,_0x1070cf),_0x1070cf,function(_0x2f51db){if(_0x2f51db){console[_0x2e42('0xa1')](_0x2e42('0xa2'),_0x2f51db);}else{fs[_0x2e42('0xa3')](path['join'](_0x2cab1a,_0x1070cf));}});}})[_0x2e42('0x56')](handleError(_0x2e7dd8,null));}; \ No newline at end of file +var _0x1449=['Bcc','Attachments','push','type','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','sendStatus','name','index','MailMessage','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','options','include','rows','show','params','rawAttributes','includeAll','find','body','describe','create','out','findOne','MailAccountId','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','service','user','pass','attachments','join','root','server/files/attachments','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','readAt','UserId','Contact','MailInteractionId','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','rejectmessage','download','unix','toString','server','files','message-%s.eml','from','subject','Attachment','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x1449,0xa6));var _0x9144=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x1449[_0x1d94d1];return _0x23c397;};'use strict';var pdf=require(_0x9144('0x0'));var emlformat=require(_0x9144('0x1'));var rimraf=require(_0x9144('0x2'));var zipdir=require(_0x9144('0x3'));var jsonpatch=require(_0x9144('0x4'));var rp=require(_0x9144('0x5'));var moment=require(_0x9144('0x6'));var BPromise=require(_0x9144('0x7'));var Mustache=require(_0x9144('0x8'));var util=require(_0x9144('0x9'));var path=require(_0x9144('0xa'));var sox=require(_0x9144('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9144('0xc'));var crypto=require(_0x9144('0xd'));var jsforce=require(_0x9144('0xe'));var deskjs=require(_0x9144('0xf'));var toCsv=require(_0x9144('0x10'));var querystring=require('querystring');var Papa=require(_0x9144('0x11'));var Redis=require('ioredis');var authService=require(_0x9144('0x12'));var qs=require(_0x9144('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9144('0x14'))(_0x9144('0x15'));var utils=require(_0x9144('0x16'));var config=require(_0x9144('0x17'));var db=require('../../mysqldb')['db'];config[_0x9144('0x18')]=_[_0x9144('0x19')](config[_0x9144('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9144('0x1a'))[_0x9144('0x1b')](socket);var jayson=require(_0x9144('0x1c'));var client=jayson[_0x9144('0x1d')][_0x9144('0x1e')]({'port':0x232c});var client9003=jayson[_0x9144('0x1d')][_0x9144('0x1e')]({'port':0x232b});var client9002=jayson[_0x9144('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x2708cc,_0x76ce34,_0x40364f){if(_0x40364f){var _0xf03465=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf03465['test'](_0x76ce34)){return _0x2708cc;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2708cc;}}function respondWithRpcPromise(_0x2389d1,_0x308084,_0x28ff4e,_0x5c948d){return new BPromise(function(_0x3fb2e5,_0x77d45e){var _0x15a00c=_0x5c948d||client;return _0x15a00c[_0x9144('0x1f')](_0x2389d1,_0x28ff4e)[_0x9144('0x20')](function(_0x2d63c7){logger[_0x9144('0x21')](_0x9144('0x22'),_0x308084,_0x9144('0x23'));logger[_0x9144('0x24')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x308084,_0x9144('0x23'),JSON[_0x9144('0x25')](_0x2d63c7));if(_0x2d63c7[_0x9144('0x26')]){if(_0x2d63c7[_0x9144('0x26')]['code']===0x1f4){logger[_0x9144('0x26')]('MailMessage,\x20%s,\x20%s',_0x308084,_0x2d63c7[_0x9144('0x26')]['message']);return _0x77d45e(_0x2d63c7['error']['message']);}logger[_0x9144('0x26')](_0x9144('0x22'),_0x308084,_0x2d63c7[_0x9144('0x26')]['message']);return _0x3fb2e5(_0x2d63c7[_0x9144('0x26')][_0x9144('0x27')]);}else{logger['info'](_0x9144('0x22'),_0x308084,_0x9144('0x23'));_0x3fb2e5(_0x2d63c7[_0x9144('0x28')][_0x9144('0x27')]);}})[_0x9144('0x29')](function(_0x353c7d){logger[_0x9144('0x26')](_0x9144('0x22'),_0x308084,_0x353c7d);_0x77d45e(_0x353c7d);});});}function respondWithStatusCode(_0xe9b7a9,_0x1bcb19){_0x1bcb19=_0x1bcb19||0xcc;return function(_0x1c97e8){if(_0x1c97e8){return _0xe9b7a9['sendStatus'](_0x1bcb19);}return _0xe9b7a9[_0x9144('0x2a')](_0x1bcb19)[_0x9144('0x2b')]();};}function respondWithResult(_0xc1d19a,_0x355ba8){_0x355ba8=_0x355ba8||0xc8;return function(_0x123315){if(_0x123315){return _0xc1d19a['status'](_0x355ba8)[_0x9144('0x2c')](_0x123315);}};}function respondWithFilteredResult(_0x1e2ad3,_0x461406){return function(_0x31ed52){if(_0x31ed52){var _0x10c3b1=_0x31ed52[_0x9144('0x2d')],_0x28fe0d=_0x461406[_0x9144('0x2e')],_0x978cc=_0x461406['offset']+_0x461406[_0x9144('0x2f')],_0x511a93;if(_0x978cc>=_0x10c3b1){_0x978cc=_0x10c3b1;_0x511a93=0xc8;}else{_0x511a93=0xce;}_0x1e2ad3[_0x9144('0x2a')](_0x511a93);return _0x1e2ad3['set'](_0x9144('0x30'),_0x28fe0d+'-'+_0x978cc+'/'+_0x10c3b1)[_0x9144('0x2c')](_0x31ed52);}return null;};}function patchUpdates(_0x47bfb6){return function(_0x26f2a7){try{jsonpatch['apply'](_0x26f2a7,_0x47bfb6,!![]);}catch(_0x5241f5){return BPromise[_0x9144('0x31')](_0x5241f5);}return _0x26f2a7[_0x9144('0x32')]();};}function saveUpdates(_0x240f02,_0x1b4076){return function(_0x86849){if(_0x86849){return _0x86849[_0x9144('0x33')](_0x240f02)['then'](function(_0x1d2e53){return _0x1d2e53;});}return null;};}function removeEntity(_0x30a3a9,_0x41fd3a){return function(_0x57c4dd){if(_0x57c4dd){return _0x57c4dd[_0x9144('0x34')]()['then'](function(){_0x30a3a9[_0x9144('0x2a')](0xcc)[_0x9144('0x2b')]();});}};}function handleEntityNotFound(_0x3c45c2,_0x3cc15f){return function(_0x39e7cf){if(!_0x39e7cf){_0x3c45c2[_0x9144('0x35')](0x194);}return _0x39e7cf;};}function handleError(_0x33e5be,_0x2e51f2){_0x2e51f2=_0x2e51f2||0x1f4;return function(_0x362b32){logger[_0x9144('0x26')](_0x362b32['stack']);if(_0x362b32['name']){delete _0x362b32[_0x9144('0x36')];}_0x33e5be[_0x9144('0x2a')](_0x2e51f2)['send'](_0x362b32);};}exports[_0x9144('0x37')]=function(_0x4d6d2f,_0xfadc5d){var _0x3cb541={},_0x1273f7={},_0x387903={'count':0x0,'rows':[]};var _0x556b6c=db[_0x9144('0x38')]['rawAttributes'];_0x1273f7['model']=_[_0x9144('0x39')](_0x556b6c);_0x1273f7['query']=_[_0x9144('0x39')](_0x4d6d2f[_0x9144('0x3a')]);_0x1273f7[_0x9144('0x3b')]=_[_0x9144('0x3c')](_0x1273f7[_0x9144('0x3d')],_0x1273f7['query']);_0x3cb541[_0x9144('0x3e')]=_[_0x9144('0x3c')](_0x1273f7['model'],qs[_0x9144('0x3f')](_0x4d6d2f[_0x9144('0x3a')][_0x9144('0x3f')]));_0x3cb541[_0x9144('0x3e')]=_0x3cb541['attributes'][_0x9144('0x40')]?_0x3cb541[_0x9144('0x3e')]:_0x1273f7[_0x9144('0x3d')];if(!_0x4d6d2f[_0x9144('0x3a')][_0x9144('0x41')](_0x9144('0x42'))){_0x3cb541['limit']=qs[_0x9144('0x2f')](_0x4d6d2f[_0x9144('0x3a')][_0x9144('0x2f')]);_0x3cb541[_0x9144('0x2e')]=qs['offset'](_0x4d6d2f[_0x9144('0x3a')][_0x9144('0x2e')]);}_0x3cb541['order']=qs[_0x9144('0x43')](_0x4d6d2f['query']['sort']);_0x3cb541[_0x9144('0x44')]=qs[_0x9144('0x3b')](_[_0x9144('0x45')](_0x4d6d2f[_0x9144('0x3a')],_0x1273f7[_0x9144('0x3b')]));if(_0x4d6d2f['query'][_0x9144('0x46')]){_0x3cb541[_0x9144('0x44')]=_[_0x9144('0x47')](_0x3cb541[_0x9144('0x44')],{'$or':_[_0x9144('0x48')](_0x556b6c,function(_0x310d16){if(_0x310d16['type'][_0x9144('0x49')]!=='VIRTUAL'){var _0x140822={};_0x140822[_0x310d16['field']]={'$like':'%'+_0x4d6d2f['query'][_0x9144('0x46')]+'%'};return _0x140822;}})});}_0x3cb541=_[_0x9144('0x47')]({},_0x3cb541,_0x4d6d2f[_0x9144('0x4a')]);var _0x47f99b={'where':_0x3cb541['where']};return db[_0x9144('0x38')][_0x9144('0x2d')](_0x47f99b)[_0x9144('0x20')](function(_0x448bb9){_0x387903[_0x9144('0x2d')]=_0x448bb9;if(_0x4d6d2f['query']['includeAll']){_0x3cb541[_0x9144('0x4b')]=[{'all':!![]}];}return db[_0x9144('0x38')]['findAll'](_0x3cb541);})['then'](function(_0x1015b9){_0x387903[_0x9144('0x4c')]=_0x1015b9;return _0x387903;})[_0x9144('0x20')](respondWithFilteredResult(_0xfadc5d,_0x3cb541))[_0x9144('0x29')](handleError(_0xfadc5d,null));};exports[_0x9144('0x4d')]=function(_0x2946dd,_0x3af851){var _0x501044={'raw':!![],'where':{'id':_0x2946dd[_0x9144('0x4e')]['id']}},_0x410f76={};_0x410f76[_0x9144('0x3d')]=_[_0x9144('0x39')](db[_0x9144('0x38')][_0x9144('0x4f')]);_0x410f76[_0x9144('0x3a')]=_[_0x9144('0x39')](_0x2946dd[_0x9144('0x3a')]);_0x410f76[_0x9144('0x3b')]=_[_0x9144('0x3c')](_0x410f76[_0x9144('0x3d')],_0x410f76[_0x9144('0x3a')]);_0x501044[_0x9144('0x3e')]=_['intersection'](_0x410f76[_0x9144('0x3d')],qs[_0x9144('0x3f')](_0x2946dd[_0x9144('0x3a')]['fields']));_0x501044[_0x9144('0x3e')]=_0x501044[_0x9144('0x3e')]['length']?_0x501044[_0x9144('0x3e')]:_0x410f76[_0x9144('0x3d')];if(_0x2946dd[_0x9144('0x3a')][_0x9144('0x50')]){_0x501044['include']=[{'all':!![]}];}_0x501044=_[_0x9144('0x47')]({},_0x501044,_0x2946dd[_0x9144('0x4a')]);return db[_0x9144('0x38')][_0x9144('0x51')](_0x501044)['then'](handleEntityNotFound(_0x3af851,null))[_0x9144('0x20')](respondWithResult(_0x3af851,null))[_0x9144('0x29')](handleError(_0x3af851,null));};exports[_0x9144('0x33')]=function(_0x367e2e,_0x3da8e6){if(_0x367e2e[_0x9144('0x52')]['id']){delete _0x367e2e[_0x9144('0x52')]['id'];}return db['MailMessage'][_0x9144('0x51')]({'where':{'id':_0x367e2e[_0x9144('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3da8e6,null))[_0x9144('0x20')](saveUpdates(_0x367e2e[_0x9144('0x52')],null))['then'](respondWithResult(_0x3da8e6,null))[_0x9144('0x29')](handleError(_0x3da8e6,null));};exports[_0x9144('0x34')]=function(_0x534ce9,_0x424974){return db['MailMessage'][_0x9144('0x51')]({'where':{'id':_0x534ce9[_0x9144('0x4e')]['id']}})[_0x9144('0x20')](handleEntityNotFound(_0x424974,null))[_0x9144('0x20')](removeEntity(_0x424974,null))[_0x9144('0x29')](handleError(_0x424974,null));};exports[_0x9144('0x53')]=function(_0x2faa75,_0x1f5beb){return db[_0x9144('0x38')][_0x9144('0x53')]()[_0x9144('0x20')](respondWithResult(_0x1f5beb,null))[_0x9144('0x29')](handleError(_0x1f5beb,null));};exports['create']=function(_0x4e8d1e,_0x1b11a4){return db[_0x9144('0x38')][_0x9144('0x54')](_0x4e8d1e[_0x9144('0x52')])[_0x9144('0x20')](function(_0x34f97a){if(_0x34f97a){if(_0x34f97a['direction']===_0x9144('0x55')&&!_0x34f97a['secret']){return db['MailAccount'][_0x9144('0x56')]({'where':{'id':_0x34f97a[_0x9144('0x57')]},'include':[{'model':db[_0x9144('0x58')],'as':_0x9144('0x59'),'raw':!![]}]})[_0x9144('0x20')](function(_0x2c3043){if(_0x2c3043&&_0x2c3043[_0x9144('0x59')]){var _0x527e45={'tls':{'rejectUnauthorized':![]}};if(_[_0x9144('0x5a')](_0x2c3043[_0x9144('0x59')]['service'])){_0x527e45[_0x9144('0x5b')]=_0x2c3043[_0x9144('0x59')][_0x9144('0x5b')];_0x527e45[_0x9144('0x5c')]=_0x2c3043[_0x9144('0x59')]['port'];_0x527e45[_0x9144('0x5d')]=_0x2c3043[_0x9144('0x59')]['secure'];if(_0x2c3043['Smtp'][_0x9144('0x5e')]){_0x527e45[_0x9144('0x5f')]={'user':_0x2c3043[_0x9144('0x59')]['user'],'pass':_0x2c3043[_0x9144('0x59')]['pass']};}}else{_0x527e45['service']=_0x2c3043[_0x9144('0x59')][_0x9144('0x60')];_0x527e45[_0x9144('0x5f')]={'user':_0x2c3043[_0x9144('0x59')][_0x9144('0x61')],'pass':_0x2c3043[_0x9144('0x59')][_0x9144('0x62')]};_0x527e45[_0x9144('0x5d')]=_0x2c3043[_0x9144('0x59')][_0x9144('0x5d')];}if(_0x4e8d1e[_0x9144('0x52')][_0x9144('0x63')]&&_0x4e8d1e[_0x9144('0x52')]['attachments']['length']){for(var _0x12ce14=0x0;_0x12ce14<_0x4e8d1e[_0x9144('0x52')][_0x9144('0x63')]['length'];_0x12ce14+=0x1){_0x4e8d1e[_0x9144('0x52')][_0x9144('0x63')][_0x12ce14]={'filename':_0x4e8d1e[_0x9144('0x52')]['attachments'][_0x12ce14][_0x9144('0x36')],'path':path[_0x9144('0x64')](config[_0x9144('0x65')],_0x9144('0x66'),_0x4e8d1e[_0x9144('0x52')][_0x9144('0x63')][_0x12ce14]['basename'])};}}return{'account':_0x527e45,'message':_0x4e8d1e[_0x9144('0x52')]};}})[_0x9144('0x20')](function(_0x1175ec){if(_0x1175ec){return respondWithRpcPromise(_0x9144('0x67'),_0x9144('0x68'),_0x1175ec,client9003)[_0x9144('0x20')](function(_0x12d1f7){return _0x34f97a[_0x9144('0x33')]({'read':!![],'messageId':_0x12d1f7[_0x9144('0x69')],'sentAt':moment()[_0x9144('0x6a')](_0x9144('0x6b'))});})['catch'](function(_0x5b4601){logger[_0x9144('0x26')]('%s',JSON[_0x9144('0x25')](_0x5b4601));return _0x34f97a;});}return _0x34f97a;});}return _0x34f97a;}})[_0x9144('0x20')](respondWithResult(_0x1b11a4,0xc9))[_0x9144('0x29')](handleError(_0x1b11a4,null));};var interaction_log=require('../../config/logger')(_0x9144('0x6c'));exports[_0x9144('0x6d')]=function(_0x668c1b,_0x40061c,_0x3390d8){var _0x33d960={'channel':_0x9144('0x6e')};if(_0x668c1b[_0x9144('0x52')]['id']){delete _0x668c1b[_0x9144('0x52')]['id'];}_0x668c1b[_0x9144('0x52')]['read']=!![];_0x668c1b[_0x9144('0x52')][_0x9144('0x6f')]=moment()[_0x9144('0x6a')](_0x9144('0x6b'));_0x668c1b[_0x9144('0x52')][_0x9144('0x70')]=_0x668c1b[_0x9144('0x52')][_0x9144('0x70')]||_0x668c1b[_0x9144('0x61')]['id'];return db[_0x9144('0x38')]['find']({'where':{'id':_0x668c1b[_0x9144('0x4e')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x9144('0x71')}]})[_0x9144('0x20')](handleEntityNotFound(_0x40061c,null))['then'](saveUpdates(_0x668c1b['body'],null))[_0x9144('0x20')](function(_0x32891f){if(_0x32891f){_0x33d960['message']=_0x32891f['get']({'plain':!![]});return db['MailInteraction'][_0x9144('0x51')]({'where':{'id':_0x32891f[_0x9144('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x40061c,null))[_0x9144('0x20')](function(_0x1ed8c5){if(_0x1ed8c5){return _0x1ed8c5[_0x9144('0x33')]({'UserId':_0x668c1b[_0x9144('0x52')][_0x9144('0x70')],'read1stAt':_['isNil'](_0x1ed8c5[_0x9144('0x73')])?moment()[_0x9144('0x6a')](_0x9144('0x6b')):undefined});}return null;})[_0x9144('0x20')](function(_0x5f2b3f){if(_0x5f2b3f){_0x33d960[_0x9144('0x74')]=_0x5f2b3f[_0x9144('0x75')]({'plain':!![]});interaction_log[_0x9144('0x21')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x668c1b[_0x9144('0x61')]['id'],_0x668c1b[_0x9144('0x61')]['name'],_0x668c1b[_0x9144('0x61')][_0x9144('0x76')],_0x33d960[_0x9144('0x74')]['id'],_0x668c1b[_0x9144('0x52')]?JSON[_0x9144('0x25')](_0x668c1b['body']):_0x9144('0x77'));return respondWithRpcPromise(_0x9144('0x78'),_0x9144('0x79'),_0x33d960);}return null;})[_0x9144('0x20')](function(_0x6f6b0b){if(_0x6f6b0b){if(_0x668c1b[_0x9144('0x52')]['manual']){_0x33d960[_0x9144('0x27')]['interface']=util[_0x9144('0x6a')](_0x9144('0x7a'),_0x668c1b[_0x9144('0x61')][_0x9144('0x36')]);_0x33d960['message'][_0x9144('0x7b')]=_0x33d960[_0x9144('0x7b')];_0x33d960[_0x9144('0x27')][_0x9144('0x7c')]=_0x9144('0x6d');return respondWithRpcPromise(_0x9144('0x7d'),'EventManager',{'event':_0x9144('0x7e'),'message':_0x33d960[_0x9144('0x27')]},client9002)[_0x9144('0x20')](function(){return _0x33d960;});}return _0x33d960;}return null;})['then'](respondWithResult(_0x40061c,null))[_0x9144('0x29')](handleError(_0x40061c,null));};var interaction_log=require(_0x9144('0x14'))(_0x9144('0x6c'));exports[_0x9144('0x31')]=function(_0x39495b,_0x2e03ba,_0x26a15e){var _0x2d4e8f={'agent':{},'channel':_0x9144('0x6e')};if(_0x39495b[_0x9144('0x52')]['id']){delete _0x39495b[_0x9144('0x52')]['id'];}_0x39495b[_0x9144('0x52')][_0x9144('0x70')]=_0x39495b[_0x9144('0x52')][_0x9144('0x70')]||_0x39495b['user']['id'];_0x2d4e8f[_0x9144('0x7f')]['id']=_0x39495b['body']['UserId'];return db[_0x9144('0x38')][_0x9144('0x51')]({'where':{'id':_0x39495b[_0x9144('0x4e')]['id'],'UserId':null}})[_0x9144('0x20')](handleEntityNotFound(_0x2e03ba,null))[_0x9144('0x20')](function(_0x348776){if(_0x348776){_0x2d4e8f['message']=_0x348776['get']({'plain':!![]});return db[_0x9144('0x80')][_0x9144('0x51')]({'where':{'id':_0x348776['MailInteractionId']}});}return null;})[_0x9144('0x20')](handleEntityNotFound(_0x2e03ba,null))[_0x9144('0x20')](function(_0xe96cdf){if(_0xe96cdf){_0x2d4e8f[_0x9144('0x74')]=_0xe96cdf[_0x9144('0x75')]({'plain':!![]});interaction_log['info'](_0x9144('0x81'),_0x39495b['user']['id'],_0x39495b[_0x9144('0x61')][_0x9144('0x36')],_0x39495b[_0x9144('0x61')]['role'],_0x2d4e8f[_0x9144('0x74')]['id'],_0x39495b[_0x9144('0x52')]?JSON[_0x9144('0x25')](_0x39495b[_0x9144('0x52')]):'null');return respondWithRpcPromise('RejectMessage',_0x9144('0x82'),_0x2d4e8f);}return null;})[_0x9144('0x20')](function(_0x38016c){if(_0x38016c){_0x38016c[_0x9144('0x27')][_0x9144('0x83')]=util['format'](_0x9144('0x7a'),_0x39495b[_0x9144('0x61')][_0x9144('0x36')]);_0x38016c[_0x9144('0x27')]['channel']=_0x2d4e8f[_0x9144('0x7b')];_0x38016c['message'][_0x9144('0x7c')]=_0x9144('0x31');respondWithRpcPromise(_0x9144('0x7d'),_0x9144('0x7d'),{'event':_0x9144('0x84'),'message':_0x38016c[_0x9144('0x27')]},client9002);return _0x2d4e8f;}return null;})[_0x9144('0x20')](respondWithResult(_0x2e03ba,null))[_0x9144('0x29')](handleError(_0x2e03ba,null));};exports[_0x9144('0x85')]=function(_0x3130dc,_0x260dcd){var _0x41b209=moment()[_0x9144('0x86')]()[_0x9144('0x87')]();var _0xc55af4=path[_0x9144('0x64')](config['root'],_0x9144('0x88'),'files','tmp');var _0x416fb1=path['join'](config[_0x9144('0x65')],_0x9144('0x88'),_0x9144('0x89'),_0x9144('0x63'));var _0x2efbeb=util['format'](_0x9144('0x8a'),_0x41b209);return db['MailMessage'][_0x9144('0x51')]({'where':{'id':_0x3130dc['params']['id']},'attributes':['id','body',_0x9144('0x8b'),'to','cc','bcc',_0x9144('0x8c'),'createdAt'],'include':_0x3130dc['query']['attachments']?[{'model':db[_0x9144('0x8d')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x260dcd,null))['then'](function(_0x290655){if(_0x290655){var _0x3a1039=_0x290655;var _0x398a55={'from':_0x3a1039[_0x9144('0x8b')],'to':_0x3a1039['to'],'subject':_0x3a1039[_0x9144('0x8c')],'html':_0x3a1039['body'],'headers':{'Date':moment(_0x3a1039[_0x9144('0x8e')])['format'](_0x9144('0x8f'))},'attachments':[]};if(_0x290655['cc']){_0x398a55[_0x9144('0x90')]['Cc']=_0x290655['cc'];}if(_0x290655[_0x9144('0x91')]){_0x398a55[_0x9144('0x90')][_0x9144('0x92')]=_0x290655[_0x9144('0x91')];}return new BPromise(function(_0x8cc920,_0x5fbc6e){if(_0x290655['Attachments']){for(var _0x112033=0x0;_0x112033<_0x290655['Attachments'][_0x9144('0x40')];_0x112033++){var _0x130908=_0x290655[_0x9144('0x93')][_0x112033];var _0x20b283=path[_0x9144('0x64')](_0x416fb1,_0x130908['basename']);if(fs['existsSync'](_0x20b283)){_0x398a55[_0x9144('0x63')][_0x9144('0x94')]({'name':_0x130908[_0x9144('0x36')],'contentType':_0x130908[_0x9144('0x95')],'data':fs[_0x9144('0x96')](_0x20b283)});}}}emlformat[_0x9144('0x97')](_0x398a55,function(_0x2822f7,_0x322a9e){if(_0x2822f7)return _0x5fbc6e(_0x2822f7);fs[_0x9144('0x98')](path['join'](_0xc55af4,_0x2efbeb),_0x322a9e);return _0x8cc920(_0x322a9e);});});}})[_0x9144('0x20')](function(_0x38f58c){if(_0x38f58c){return _0x260dcd[_0x9144('0x85')](path['join'](_0xc55af4,_0x2efbeb),_0x2efbeb,function(_0x5726ca){if(_0x5726ca){console[_0x9144('0x99')](_0x9144('0x9a'),_0x5726ca);}else{fs[_0x9144('0x9b')](path[_0x9144('0x64')](_0xc55af4,_0x2efbeb));}});}})[_0x9144('0x29')](handleError(_0x260dcd,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index c74e094..cd9c44d 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 _0x057c=['exports','events','MailMessage','update','emit','hook'];(function(_0x4a0a13,_0x77c298){var _0x3b81f5=function(_0x5314e6){while(--_0x5314e6){_0x4a0a13['push'](_0x4a0a13['shift']());}};_0x3b81f5(++_0x77c298);}(_0x057c,0x1e7));var _0xc057=function(_0x1ccdd6,_0x569c4d){_0x1ccdd6=_0x1ccdd6-0x0;var _0x45b01a=_0x057c[_0x1ccdd6];return _0x45b01a;};'use strict';var EventEmitter=require(_0xc057('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xc057('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc057('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1add3f){return function(_0x3d5050,_0x1cbf10,_0x59d580){MailMessageEvents[_0xc057('0x3')](_0x1add3f+':'+_0x3d5050['id'],_0x3d5050);MailMessageEvents[_0xc057('0x3')](_0x1add3f,_0x3d5050);_0x59d580(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xc057('0x4')](e,emitEvent(event));}}module[_0xc057('0x5')]=MailMessageEvents; \ No newline at end of file +var _0x6c62=['update','emit','hook'];(function(_0x279224,_0x949076){var _0x401a4a=function(_0x4d5c3b){while(--_0x4d5c3b){_0x279224['push'](_0x279224['shift']());}};_0x401a4a(++_0x949076);}(_0x6c62,0x1ec));var _0x26c6=function(_0x2e9187,_0x3763f6){_0x2e9187=_0x2e9187-0x0;var _0x1fc3a8=_0x6c62[_0x2e9187];return _0x1fc3a8;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x26c6('0x0'),'afterDestroy':'remove'};function emitEvent(_0x4c5b35){return function(_0x56f471,_0x268b81,_0x1e5c2c){MailMessageEvents[_0x26c6('0x1')](_0x4c5b35+':'+_0x56f471['id'],_0x56f471);MailMessageEvents[_0x26c6('0x1')](_0x4c5b35,_0x56f471);_0x1e5c2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x26c6('0x2')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 4e7aad6..615162e 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 _0xb4ca=['direction','secret','UserId','MailInteraction','then','createdAt','catch','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get'];(function(_0x1a675c,_0x4648bc){var _0x4ee1dc=function(_0x4ab719){while(--_0x4ab719){_0x1a675c['push'](_0x1a675c['shift']());}};_0x4ee1dc(++_0x4648bc);}(_0xb4ca,0x10c));var _0xab4c=function(_0xcc5dd3,_0x4f4cc2){_0xcc5dd3=_0xcc5dd3-0x0;var _0xdb5e96=_0xb4ca[_0xcc5dd3];return _0xdb5e96;};'use strict';var _=require(_0xab4c('0x0'));var util=require(_0xab4c('0x1'));var logger=require(_0xab4c('0x2'))(_0xab4c('0x3'));var moment=require(_0xab4c('0x4'));var BPromise=require(_0xab4c('0x5'));var rp=require('request-promise');var htmlToText=require(_0xab4c('0x6'));var fs=require('fs');var path=require(_0xab4c('0x7'));var rimraf=require(_0xab4c('0x8'));var config=require(_0xab4c('0x9'));var attributes=require(_0xab4c('0xa'));module[_0xab4c('0xb')]=function(_0x488105,_0x249026){return _0x488105['define'](_0xab4c('0xc'),attributes,{'tableName':_0xab4c('0xd'),'paranoid':![],'indexes':[{'name':_0xab4c('0xe'),'fields':[_0xab4c('0xe')]},{'name':_0xab4c('0xf'),'fields':[_0xab4c('0x10'),'subject'],'type':_0xab4c('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5bc005,_0x2f9e49,_0x518029){if(_0x5bc005[_0xab4c('0x12')]){_0x5bc005['plainBody']=htmlToText[_0xab4c('0x13')](_0x5bc005['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x518029(null,_0x2f9e49);},'afterCreate':function(_0x182878,_0x404fd4,_0x41c040){var _0x517a0f=_0x488105[_0xab4c('0x14')];var _0xfd61e8=_0x182878[_0xab4c('0x15')]({'plain':!![]});if(_0xfd61e8[_0xab4c('0x16')]['toLowerCase']()==='in'||_0xfd61e8['direction']['toLowerCase']()==='out'&&!_0xfd61e8[_0xab4c('0x17')]&&!_['isNil'](_0xfd61e8[_0xab4c('0x18')])){_0x517a0f[_0xab4c('0x19')]['findOne']({'where':{'id':_0xfd61e8['MailInteractionId']}})[_0xab4c('0x1a')](function(_0x1fdb10){if(_0x1fdb10){_0x1fdb10['update']({'lastMsgAt':_0xfd61e8[_0xab4c('0x1b')],'lastMsgDirection':_0xfd61e8[_0xab4c('0x16')]['toLowerCase'](),'lastMsgBody':_0xfd61e8[_0xab4c('0x12')]});}})[_0xab4c('0x1c')](function(_0x16a5af){console['error'](_0x16a5af);});}_0x41c040();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1902=['messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get','direction','toLowerCase','secret','isNil','UserId','findOne','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages'];(function(_0x3b8899,_0x3e5cc5){var _0x513577=function(_0x33b3b3){while(--_0x33b3b3){_0x3b8899['push'](_0x3b8899['shift']());}};_0x513577(++_0x3e5cc5);}(_0x1902,0x15b));var _0x2190=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1902[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2190('0x0'));var util=require(_0x2190('0x1'));var logger=require(_0x2190('0x2'))(_0x2190('0x3'));var moment=require(_0x2190('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x2190('0x5'));var fs=require('fs');var path=require(_0x2190('0x6'));var rimraf=require(_0x2190('0x7'));var config=require('../../config/environment');var attributes=require(_0x2190('0x8'));module[_0x2190('0x9')]=function(_0x554f6,_0x36e178){return _0x554f6[_0x2190('0xa')](_0x2190('0xb'),attributes,{'tableName':_0x2190('0xc'),'paranoid':![],'indexes':[{'name':_0x2190('0xd'),'fields':['messageId']},{'name':_0x2190('0xe'),'fields':[_0x2190('0xf'),_0x2190('0x10')],'type':_0x2190('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52a2d8,_0x41554f,_0x571222){if(_0x52a2d8[_0x2190('0x12')]){_0x52a2d8[_0x2190('0xf')]=htmlToText[_0x2190('0x13')](_0x52a2d8[_0x2190('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x571222(null,_0x41554f);},'afterCreate':function(_0x26fff2,_0x17315d,_0x26a5e0){var _0x48a5f1=_0x554f6['models'];var _0x5db8e3=_0x26fff2[_0x2190('0x14')]({'plain':!![]});if(_0x5db8e3[_0x2190('0x15')]['toLowerCase']()==='in'||_0x5db8e3[_0x2190('0x15')][_0x2190('0x16')]()==='out'&&!_0x5db8e3[_0x2190('0x17')]&&!_[_0x2190('0x18')](_0x5db8e3[_0x2190('0x19')])){_0x48a5f1['MailInteraction'][_0x2190('0x1a')]({'where':{'id':_0x5db8e3['MailInteractionId']}})['then'](function(_0x23d494){if(_0x23d494){_0x23d494['update']({'lastMsgAt':_0x5db8e3[_0x2190('0x1b')],'lastMsgDirection':_0x5db8e3[_0x2190('0x15')][_0x2190('0x16')](),'lastMsgBody':_0x5db8e3[_0x2190('0x12')]});}})['catch'](function(_0x474766){console['error'](_0x474766);});}_0x26a5e0();}},'charset':_0x2190('0x1c'),'collate':_0x2190('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index bc5f96c..1cfa58d 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 _0x277c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./mailMessage.socket','register','request','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','moment'];(function(_0x2c85d4,_0x196197){var _0x5c1b31=function(_0x525ef3){while(--_0x525ef3){_0x2c85d4['push'](_0x2c85d4['shift']());}};_0x5c1b31(++_0x196197);}(_0x277c,0x153));var _0xc277=function(_0x226a40,_0x45eb4b){_0x226a40=_0x226a40-0x0;var _0x451168=_0x277c[_0x226a40];return _0x451168;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var moment=require(_0xc277('0x1'));var BPromise=require(_0xc277('0x2'));var rs=require(_0xc277('0x3'));var fs=require('fs');var Redis=require(_0xc277('0x4'));var db=require(_0xc277('0x5'))['db'];var utils=require(_0xc277('0x6'));var logger=require(_0xc277('0x7'))(_0xc277('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc277('0x9')]['http']({'port':0x232a});config[_0xc277('0xa')]=_['defaults'](config[_0xc277('0xa')],{'host':_0xc277('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc277('0xa')]));require(_0xc277('0xc'))[_0xc277('0xd')](socket);function respondWithRpcPromise(_0x1b1db0,_0x3f766f,_0x1e4087){return new BPromise(function(_0x4a4137,_0x58eb8b){return client[_0xc277('0xe')](_0x1b1db0,_0x1e4087)[_0xc277('0xf')](function(_0x2df373){logger[_0xc277('0x10')]('MailMessage,\x20%s,\x20%s',_0x3f766f,_0xc277('0x11'));logger['debug'](_0xc277('0x12'),_0x3f766f,_0xc277('0x11'),JSON[_0xc277('0x13')](_0x2df373));if(_0x2df373[_0xc277('0x14')]){if(_0x2df373['error'][_0xc277('0x15')]===0x1f4){logger[_0xc277('0x14')](_0xc277('0x16'),_0x3f766f,_0x2df373['error']['message']);return _0x58eb8b(_0x2df373[_0xc277('0x14')]['message']);}logger[_0xc277('0x14')]('MailMessage,\x20%s,\x20%s',_0x3f766f,_0x2df373[_0xc277('0x14')][_0xc277('0x17')]);return _0x4a4137(_0x2df373[_0xc277('0x14')]['message']);}else{logger['info'](_0xc277('0x16'),_0x3f766f,'request\x20sent');_0x4a4137(_0x2df373['result'][_0xc277('0x17')]);}})[_0xc277('0x18')](function(_0x3b247e){logger[_0xc277('0x14')](_0xc277('0x16'),_0x3f766f,_0x3b247e);_0x58eb8b(_0x3b247e);});});}exports[_0xc277('0x19')]=function(_0x391cc3){var _0x4a7a79=this;return new Promise(function(_0x51e828,_0x697d6f){return db[_0xc277('0x1a')][_0xc277('0x1b')](_0x391cc3[_0xc277('0x1c')],{'raw':_0x391cc3[_0xc277('0x1d')]?_0x391cc3[_0xc277('0x1d')][_0xc277('0x1e')]===undefined?!![]:![]:!![]})[_0xc277('0xf')](function(_0x1bc888){logger[_0xc277('0x10')](_0xc277('0x19'),_0x391cc3);logger['debug'](_0xc277('0x19'),_0x391cc3,JSON[_0xc277('0x13')](_0x1bc888));_0x51e828(_0x1bc888);})['catch'](function(_0x463fa6){logger['error']('CreateMailMessage',_0x463fa6[_0xc277('0x17')],_0x391cc3);_0x697d6f(_0x4a7a79[_0xc277('0x14')](0x1f4,_0x463fa6[_0xc277('0x17')]));});});}; \ No newline at end of file +var _0x8375=['code','message','catch','CreateMailMessage','body','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8375,0xa8));var _0x5837=function(_0x339bfe,_0x395c38){_0x339bfe=_0x339bfe-0x0;var _0x21aaea=_0x8375[_0x339bfe];return _0x21aaea;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var moment=require(_0x5837('0x2'));var BPromise=require('bluebird');var rs=require(_0x5837('0x3'));var fs=require('fs');var Redis=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];var utils=require(_0x5837('0x6'));var logger=require(_0x5837('0x7'))(_0x5837('0x8'));var config=require('../../config/environment');var jayson=require(_0x5837('0x9'));var client=jayson[_0x5837('0xa')][_0x5837('0xb')]({'port':0x232a});config[_0x5837('0xc')]=_[_0x5837('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5837('0xe'))(new Redis(config[_0x5837('0xc')]));require('./mailMessage.socket')[_0x5837('0xf')](socket);function respondWithRpcPromise(_0x4d0e3c,_0x4556fd,_0x383e5e){return new BPromise(function(_0x11cd29,_0xc6c6c9){return client[_0x5837('0x10')](_0x4d0e3c,_0x383e5e)[_0x5837('0x11')](function(_0x5ec2fe){logger[_0x5837('0x12')](_0x5837('0x13'),_0x4556fd,_0x5837('0x14'));logger[_0x5837('0x15')](_0x5837('0x16'),_0x4556fd,'request\x20sent',JSON['stringify'](_0x5ec2fe));if(_0x5ec2fe['error']){if(_0x5ec2fe[_0x5837('0x17')][_0x5837('0x18')]===0x1f4){logger[_0x5837('0x17')](_0x5837('0x13'),_0x4556fd,_0x5ec2fe[_0x5837('0x17')][_0x5837('0x19')]);return _0xc6c6c9(_0x5ec2fe[_0x5837('0x17')][_0x5837('0x19')]);}logger[_0x5837('0x17')]('MailMessage,\x20%s,\x20%s',_0x4556fd,_0x5ec2fe[_0x5837('0x17')][_0x5837('0x19')]);return _0x11cd29(_0x5ec2fe['error'][_0x5837('0x19')]);}else{logger[_0x5837('0x12')](_0x5837('0x13'),_0x4556fd,'request\x20sent');_0x11cd29(_0x5ec2fe['result']['message']);}})[_0x5837('0x1a')](function(_0x3a5386){logger[_0x5837('0x17')]('MailMessage,\x20%s,\x20%s',_0x4556fd,_0x3a5386);_0xc6c6c9(_0x3a5386);});});}exports[_0x5837('0x1b')]=function(_0x178c4c){var _0x316d43=this;return new Promise(function(_0x139111,_0x5881ff){return db['MailMessage']['create'](_0x178c4c[_0x5837('0x1c')],{'raw':_0x178c4c['options']?_0x178c4c[_0x5837('0x1d')][_0x5837('0x1e')]===undefined?!![]:![]:!![]})[_0x5837('0x11')](function(_0x3a7efe){logger['info']('CreateMailMessage',_0x178c4c);logger[_0x5837('0x15')](_0x5837('0x1b'),_0x178c4c,JSON[_0x5837('0x1f')](_0x3a7efe));_0x139111(_0x3a7efe);})['catch'](function(_0x7a6232){logger[_0x5837('0x17')](_0x5837('0x1b'),_0x7a6232['message'],_0x178c4c);_0x5881ff(_0x316d43[_0x5837('0x17')](0x1f4,_0x7a6232[_0x5837('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8c0149a..eae912a 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 _0x43bd=['update','emit','removeListener','register','length','./mailMessage.events','save','remove'];(function(_0x3d7315,_0x56ec93){var _0x59e915=function(_0x4db75d){while(--_0x4db75d){_0x3d7315['push'](_0x3d7315['shift']());}};_0x59e915(++_0x56ec93);}(_0x43bd,0x1dd));var _0xd43b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x43bd[_0x502c7d];return _0x30b7ed;};'use strict';var MailMessageEvents=require(_0xd43b('0x0'));var events=[_0xd43b('0x1'),_0xd43b('0x2'),_0xd43b('0x3')];function createListener(_0x248485,_0x3e73d1){return function(_0x4cb7f2){_0x3e73d1[_0xd43b('0x4')](_0x248485,_0x4cb7f2);};}function removeListener(_0x1901bb,_0x32eb30){return function(){MailMessageEvents[_0xd43b('0x5')](_0x1901bb,_0x32eb30);};}exports[_0xd43b('0x6')]=function(_0x51be28){for(var _0x40d0a0=0x0,_0xb724e8=events[_0xd43b('0x7')];_0x40d0a0<_0xb724e8;_0x40d0a0++){var _0x4c4cab=events[_0x40d0a0];var _0x541af7=createListener('mailMessage:'+_0x4c4cab,_0x51be28);MailMessageEvents['on'](_0x4c4cab,_0x541af7);}}; \ No newline at end of file +var _0x76b7=['length','mailMessage:','./mailMessage.events','save','emit','removeListener'];(function(_0x1d155b,_0x8b22d8){var _0x27eead=function(_0x3dc847){while(--_0x3dc847){_0x1d155b['push'](_0x1d155b['shift']());}};_0x27eead(++_0x8b22d8);}(_0x76b7,0x80));var _0x776b=function(_0x2d6e32,_0x307456){_0x2d6e32=_0x2d6e32-0x0;var _0x5e1cbf=_0x76b7[_0x2d6e32];return _0x5e1cbf;};'use strict';var MailMessageEvents=require(_0x776b('0x0'));var events=[_0x776b('0x1'),'remove','update'];function createListener(_0x887f11,_0x3fee36){return function(_0x4b3731){_0x3fee36[_0x776b('0x2')](_0x887f11,_0x4b3731);};}function removeListener(_0x4690e5,_0x16c2e4){return function(){MailMessageEvents[_0x776b('0x3')](_0x4690e5,_0x16c2e4);};}exports['register']=function(_0x4ecbec){for(var _0x2b7cb6=0x0,_0x1eabc5=events[_0x776b('0x4')];_0x2b7cb6<_0x1eabc5;_0x2b7cb6++){var _0x1900ca=events[_0x2b7cb6];var _0x3e3f87=createListener(_0x776b('0x5')+_0x1900ca,_0x4ecbec);MailMessageEvents['on'](_0x1900ca,_0x3e3f87);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index e046dec..247b8f8 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 _0xdcf7=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','/:id','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','show'];(function(_0x318bdf,_0x53513b){var _0x182f6a=function(_0x89961a){while(--_0x89961a){_0x318bdf['push'](_0x318bdf['shift']());}};_0x182f6a(++_0x53513b);}(_0xdcf7,0x1a5));var _0x7dcf=function(_0x1b19ee,_0x31837e){_0x1b19ee=_0x1b19ee-0x0;var _0xfde037=_0xdcf7[_0x1b19ee];return _0xfde037;};'use strict';var multer=require('multer');var util=require(_0x7dcf('0x0'));var path=require(_0x7dcf('0x1'));var timeout=require(_0x7dcf('0x2'));var express=require(_0x7dcf('0x3'));var router=express[_0x7dcf('0x4')]();var auth=require(_0x7dcf('0x5'));var interaction=require(_0x7dcf('0x6'));var config=require('../../config/environment');var controller=require(_0x7dcf('0x7'));router['get']('/',auth[_0x7dcf('0x8')](),controller[_0x7dcf('0x9')]);router[_0x7dcf('0xa')](_0x7dcf('0xb'),auth[_0x7dcf('0x8')](),controller[_0x7dcf('0xc')]);router['get']('/:id',auth[_0x7dcf('0x8')](),controller[_0x7dcf('0xd')]);router['get'](_0x7dcf('0xe'),auth['isAuthenticated'](),controller[_0x7dcf('0xf')]);router[_0x7dcf('0xa')](_0x7dcf('0x10'),auth['isAuthenticated'](),controller[_0x7dcf('0x11')]);router[_0x7dcf('0xa')](_0x7dcf('0x12'),auth[_0x7dcf('0x8')](),controller[_0x7dcf('0x13')]);router[_0x7dcf('0x14')]('/',auth[_0x7dcf('0x8')](),controller[_0x7dcf('0x15')]);router[_0x7dcf('0x14')](_0x7dcf('0x10'),auth[_0x7dcf('0x8')](),controller['addTeams']);router[_0x7dcf('0x14')](_0x7dcf('0x12'),auth['isAuthenticated'](),controller[_0x7dcf('0x16')]);router['put']('/:id',auth[_0x7dcf('0x8')](),controller[_0x7dcf('0x17')]);router[_0x7dcf('0x18')](_0x7dcf('0x19'),auth['isAuthenticated'](),controller[_0x7dcf('0x1a')]);router[_0x7dcf('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7dcf('0x1b')]);router[_0x7dcf('0x18')]('/:id/users',auth[_0x7dcf('0x8')](),controller[_0x7dcf('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x3dc5=['post','create','addTeams','addAgents','update','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x287785,_0xc49ede){var _0x4fb012=function(_0x568b72){while(--_0x568b72){_0x287785['push'](_0x287785['shift']());}};_0x4fb012(++_0xc49ede);}(_0x3dc5,0xda));var _0x53dc=function(_0xc93154,_0x4d0438){_0xc93154=_0xc93154-0x0;var _0x12a2ba=_0x3dc5[_0xc93154];return _0x12a2ba;};'use strict';var multer=require(_0x53dc('0x0'));var util=require(_0x53dc('0x1'));var path=require(_0x53dc('0x2'));var timeout=require(_0x53dc('0x3'));var express=require(_0x53dc('0x4'));var router=express[_0x53dc('0x5')]();var auth=require(_0x53dc('0x6'));var interaction=require(_0x53dc('0x7'));var config=require(_0x53dc('0x8'));var controller=require(_0x53dc('0x9'));router[_0x53dc('0xa')]('/',auth[_0x53dc('0xb')](),controller[_0x53dc('0xc')]);router['get'](_0x53dc('0xd'),auth[_0x53dc('0xb')](),controller[_0x53dc('0xe')]);router[_0x53dc('0xa')](_0x53dc('0xf'),auth[_0x53dc('0xb')](),controller[_0x53dc('0x10')]);router['get'](_0x53dc('0x11'),auth[_0x53dc('0xb')](),controller[_0x53dc('0x12')]);router[_0x53dc('0xa')](_0x53dc('0x13'),auth[_0x53dc('0xb')](),controller[_0x53dc('0x14')]);router[_0x53dc('0xa')](_0x53dc('0x15'),auth[_0x53dc('0xb')](),controller['getAgents']);router[_0x53dc('0x16')]('/',auth['isAuthenticated'](),controller[_0x53dc('0x17')]);router[_0x53dc('0x16')](_0x53dc('0x13'),auth[_0x53dc('0xb')](),controller[_0x53dc('0x18')]);router[_0x53dc('0x16')](_0x53dc('0x15'),auth[_0x53dc('0xb')](),controller[_0x53dc('0x19')]);router['put'](_0x53dc('0xf'),auth[_0x53dc('0xb')](),controller[_0x53dc('0x1a')]);router[_0x53dc('0x1b')](_0x53dc('0xf'),auth[_0x53dc('0xb')](),controller['destroy']);router[_0x53dc('0x1b')]('/:id/teams',auth[_0x53dc('0xb')](),controller[_0x53dc('0x1c')]);router[_0x53dc('0x1b')](_0x53dc('0x15'),auth[_0x53dc('0xb')](),controller['removeAgents']);module[_0x53dc('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 305a4e9..20c3c97 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 _0x3431=['beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x1ae22b,_0x5e5e99){var _0xdf76a5=function(_0x5b3549){while(--_0x5b3549){_0x1ae22b['push'](_0x1ae22b['shift']());}};_0xdf76a5(++_0x5e5e99);}(_0x3431,0x1be));var _0x1343=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x3431[_0x4709c8];return _0x478cdd;};'use strict';var Sequelize=require(_0x1343('0x0'));module['exports']={'name':{'type':Sequelize[_0x1343('0x1')],'unique':_0x1343('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1343('0x1')]},'timeout':{'type':Sequelize[_0x1343('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1343('0x4'),_0x1343('0x5'))}}; \ No newline at end of file +var _0xda98=['sequelize','STRING','name','ENUM','beepall'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xda98,0x186));var _0x8da9=function(_0x24c405,_0x56d6fb){_0x24c405=_0x24c405-0x0;var _0x383aef=_0xda98[_0x24c405];return _0x383aef;};'use strict';var Sequelize=require(_0x8da9('0x0'));module['exports']={'name':{'type':Sequelize[_0x8da9('0x1')],'unique':_0x8da9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8da9('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8da9('0x3')]('rrmemory',_0x8da9('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 949faeb..e2d2b39 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 _0x576c=['to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','count','offset','set','Content-Range','apply','update','destroy','then','get','end','error','stack','name','send','index','MailQueue','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','MailQueueId','map','User','UserId','agent','updatedAt','createdAt','rows','SIP','mailPause','findOne','Team','getTeams','addTeams','teams','online','voicePause','flatMap','Agents','sequelize','transaction','findOrCreate','userMailQueue:save','ids','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','TeamId','includes','all','compact','value','removeTeams','isEmpty','forEach','emit','userMailQueue:remove','addAgents','removeAgents','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x4e23de,_0x2960f5){var _0x13544d=function(_0x504a36){while(--_0x504a36){_0x4e23de['push'](_0x4e23de['shift']());}};_0x13544d(++_0x2960f5);}(_0x576c,0x7e));var _0xc576=function(_0x4546d7,_0x5bba6a){_0x4546d7=_0x4546d7-0x0;var _0x6572b=_0x576c[_0x4546d7];return _0x6572b;};'use strict';var pdf=require(_0xc576('0x0'));var emlformat=require(_0xc576('0x1'));var rimraf=require(_0xc576('0x2'));var zipdir=require(_0xc576('0x3'));var jsonpatch=require(_0xc576('0x4'));var rp=require(_0xc576('0x5'));var moment=require(_0xc576('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc576('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc576('0x8'));var ejs=require(_0xc576('0x9'));var fs=require('fs');var _=require(_0xc576('0xa'));var squel=require(_0xc576('0xb'));var crypto=require(_0xc576('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc576('0xd'));var toCsv=require(_0xc576('0x8'));var querystring=require('querystring');var Papa=require(_0xc576('0xe'));var Redis=require(_0xc576('0xf'));var authService=require(_0xc576('0x10'));var qs=require(_0xc576('0x11'));var hardwareService=require(_0xc576('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc576('0x13'));var db=require(_0xc576('0x14'))['db'];config[_0xc576('0x15')]=_[_0xc576('0x16')](config[_0xc576('0x15')],{'host':_0xc576('0x17'),'port':0x18eb});var socket=require(_0xc576('0x18'))(new Redis(config[_0xc576('0x15')]));require(_0xc576('0x19'))[_0xc576('0x1a')](socket);function respondWithStatusCode(_0x4da4c6,_0x51fbd1){_0x51fbd1=_0x51fbd1||0xcc;return function(_0x49c3d8){if(_0x49c3d8){return _0x4da4c6[_0xc576('0x1b')](_0x51fbd1);}return _0x4da4c6[_0xc576('0x1c')](_0x51fbd1)['end']();};}function respondWithResult(_0x142c2e,_0x565e75){_0x565e75=_0x565e75||0xc8;return function(_0x220991){if(_0x220991){return _0x142c2e[_0xc576('0x1c')](_0x565e75)[_0xc576('0x1d')](_0x220991);}};}function respondWithFilteredResult(_0x521ea3,_0x4d018e){return function(_0x3c8e75){if(_0x3c8e75){var _0x3200bd=_0x3c8e75[_0xc576('0x1e')],_0x54f117=_0x4d018e[_0xc576('0x1f')],_0x15e155=_0x4d018e[_0xc576('0x1f')]+_0x4d018e['limit'],_0x41d203;if(_0x15e155>=_0x3200bd){_0x15e155=_0x3200bd;_0x41d203=0xc8;}else{_0x41d203=0xce;}_0x521ea3[_0xc576('0x1c')](_0x41d203);return _0x521ea3[_0xc576('0x20')](_0xc576('0x21'),_0x54f117+'-'+_0x15e155+'/'+_0x3200bd)[_0xc576('0x1d')](_0x3c8e75);}return null;};}function patchUpdates(_0x39bb5d){return function(_0x2ed052){try{jsonpatch[_0xc576('0x22')](_0x2ed052,_0x39bb5d,!![]);}catch(_0x43cc4f){return BPromise['reject'](_0x43cc4f);}return _0x2ed052['save']();};}function saveUpdates(_0x1153f3,_0xd75355){return function(_0x374354){if(_0x374354){return _0x374354[_0xc576('0x23')](_0x1153f3)['then'](function(_0x3bbf14){return _0x3bbf14;});}return null;};}function removeEntity(_0x4d54a8,_0x546628){return function(_0x462a61){if(_0x462a61){return _0x462a61[_0xc576('0x24')]()[_0xc576('0x25')](function(){var _0x81f0e3=_0x462a61[_0xc576('0x26')]({'plain':!![]});var _0xf9f659='MailQueues';return db['UserProfileResource'][_0xc576('0x24')]({'where':{'type':_0xf9f659,'resourceId':_0x81f0e3['id']}})[_0xc576('0x25')](function(){return _0x462a61;});})[_0xc576('0x25')](function(){_0x4d54a8['status'](0xcc)[_0xc576('0x27')]();});}};}function handleEntityNotFound(_0x3f77c3,_0x409647){return function(_0x10300d){if(!_0x10300d){_0x3f77c3['sendStatus'](0x194);}return _0x10300d;};}function handleError(_0x2346f9,_0x25212a){_0x25212a=_0x25212a||0x1f4;return function(_0x2f44fc){logger[_0xc576('0x28')](_0x2f44fc[_0xc576('0x29')]);if(_0x2f44fc[_0xc576('0x2a')]){delete _0x2f44fc[_0xc576('0x2a')];}_0x2346f9[_0xc576('0x1c')](_0x25212a)[_0xc576('0x2b')](_0x2f44fc);};}exports[_0xc576('0x2c')]=function(_0xc652d,_0x533b42){var _0x51c88f={},_0x4ee342={},_0x138f62={'count':0x0,'rows':[]};var _0x147899=db[_0xc576('0x2d')][_0xc576('0x2e')];_0x4ee342[_0xc576('0x2f')]=_[_0xc576('0x30')](_0x147899);_0x4ee342[_0xc576('0x31')]=_['keys'](_0xc652d['query']);_0x4ee342[_0xc576('0x32')]=_['intersection'](_0x4ee342[_0xc576('0x2f')],_0x4ee342[_0xc576('0x31')]);_0x51c88f[_0xc576('0x33')]=_[_0xc576('0x34')](_0x4ee342[_0xc576('0x2f')],qs[_0xc576('0x35')](_0xc652d[_0xc576('0x31')][_0xc576('0x35')]));_0x51c88f[_0xc576('0x33')]=_0x51c88f[_0xc576('0x33')][_0xc576('0x36')]?_0x51c88f['attributes']:_0x4ee342[_0xc576('0x2f')];if(!_0xc652d['query'][_0xc576('0x37')](_0xc576('0x38'))){_0x51c88f[_0xc576('0x39')]=qs[_0xc576('0x39')](_0xc652d[_0xc576('0x31')]['limit']);_0x51c88f[_0xc576('0x1f')]=qs[_0xc576('0x1f')](_0xc652d['query'][_0xc576('0x1f')]);}_0x51c88f[_0xc576('0x3a')]=qs[_0xc576('0x3b')](_0xc652d['query'][_0xc576('0x3b')]);_0x51c88f[_0xc576('0x3c')]=qs[_0xc576('0x32')](_[_0xc576('0x3d')](_0xc652d[_0xc576('0x31')],_0x4ee342['filters']));if(_0xc652d[_0xc576('0x31')][_0xc576('0x3e')]){_0x51c88f[_0xc576('0x3c')]=_[_0xc576('0x3f')](_0x51c88f[_0xc576('0x3c')],{'$or':_['map'](_0x147899,function(_0x41f188){if(_0x41f188[_0xc576('0x40')][_0xc576('0x41')]!==_0xc576('0x42')){var _0x53a673={};_0x53a673[_0x41f188['field']]={'$like':'%'+_0xc652d['query'][_0xc576('0x3e')]+'%'};return _0x53a673;}})});}_0x51c88f=_[_0xc576('0x3f')]({},_0x51c88f,_0xc652d[_0xc576('0x43')]);var _0x51da40={'where':_0x51c88f['where']};return db['MailQueue'][_0xc576('0x1e')](_0x51da40)[_0xc576('0x25')](function(_0x390024){_0x138f62[_0xc576('0x1e')]=_0x390024;if(_0xc652d['query'][_0xc576('0x44')]){_0x51c88f[_0xc576('0x45')]=[{'all':!![]}];}return db[_0xc576('0x2d')][_0xc576('0x46')](_0x51c88f);})[_0xc576('0x25')](function(_0x329b64){_0x138f62['rows']=_0x329b64;return _0x138f62;})['then'](respondWithFilteredResult(_0x533b42,_0x51c88f))[_0xc576('0x47')](handleError(_0x533b42,null));};exports[_0xc576('0x48')]=function(_0xe6c23e,_0x3ea51e){var _0x369130={'raw':!![],'where':{'id':_0xe6c23e[_0xc576('0x49')]['id']}},_0x1226a7={};_0x1226a7['model']=_[_0xc576('0x30')](db[_0xc576('0x2d')]['rawAttributes']);_0x1226a7['query']=_[_0xc576('0x30')](_0xe6c23e[_0xc576('0x31')]);_0x1226a7[_0xc576('0x32')]=_[_0xc576('0x34')](_0x1226a7[_0xc576('0x2f')],_0x1226a7[_0xc576('0x31')]);_0x369130['attributes']=_['intersection'](_0x1226a7[_0xc576('0x2f')],qs[_0xc576('0x35')](_0xe6c23e[_0xc576('0x31')][_0xc576('0x35')]));_0x369130['attributes']=_0x369130['attributes'][_0xc576('0x36')]?_0x369130[_0xc576('0x33')]:_0x1226a7[_0xc576('0x2f')];if(_0xe6c23e['query'][_0xc576('0x44')]){_0x369130[_0xc576('0x45')]=[{'all':!![]}];}_0x369130=_[_0xc576('0x3f')]({},_0x369130,_0xe6c23e[_0xc576('0x43')]);return db[_0xc576('0x2d')][_0xc576('0x4a')](_0x369130)[_0xc576('0x25')](handleEntityNotFound(_0x3ea51e,null))[_0xc576('0x25')](respondWithResult(_0x3ea51e,null))['catch'](handleError(_0x3ea51e,null));};exports[_0xc576('0x4b')]=function(_0x274216,_0x195c6e){return db[_0xc576('0x2d')][_0xc576('0x4b')](_0x274216[_0xc576('0x4c')],{})[_0xc576('0x25')](function(_0x3b7fb9){var _0x12d969=_0x274216[_0xc576('0x4d')][_0xc576('0x26')]({'plain':!![]});if(!_0x12d969)throw new Error(_0xc576('0x4e'));if(_0x12d969[_0xc576('0x4f')]===_0xc576('0x4d')){var _0x1c9cf4=_0x3b7fb9[_0xc576('0x26')]({'plain':!![]});var _0xd2a1a1=_0xc576('0x50');return db['UserProfileSection'][_0xc576('0x4a')]({'where':{'name':_0xd2a1a1,'userProfileId':_0x12d969[_0xc576('0x51')]},'raw':!![]})[_0xc576('0x25')](function(_0x49fa3a){if(_0x49fa3a&&_0x49fa3a[_0xc576('0x52')]===0x0){return db[_0xc576('0x53')][_0xc576('0x4b')]({'name':_0x1c9cf4[_0xc576('0x2a')],'resourceId':_0x1c9cf4['id'],'type':_0x49fa3a[_0xc576('0x2a')],'sectionId':_0x49fa3a['id']},{})['then'](function(){return _0x3b7fb9;});}else{return _0x3b7fb9;}})[_0xc576('0x47')](function(_0x33492){logger[_0xc576('0x28')](_0xc576('0x54'),_0x33492);throw _0x33492;});}return _0x3b7fb9;})['then'](respondWithResult(_0x195c6e,0xc9))['catch'](handleError(_0x195c6e,null));};exports[_0xc576('0x23')]=function(_0xa5d8a9,_0x5b133a){if(_0xa5d8a9[_0xc576('0x4c')]['id']){delete _0xa5d8a9['body']['id'];}return db[_0xc576('0x2d')][_0xc576('0x4a')]({'where':{'id':_0xa5d8a9[_0xc576('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b133a,null))['then'](saveUpdates(_0xa5d8a9[_0xc576('0x4c')],null))[_0xc576('0x25')](respondWithResult(_0x5b133a,null))[_0xc576('0x47')](handleError(_0x5b133a,null));};exports[_0xc576('0x24')]=function(_0xc41e51,_0x1c1471){return db[_0xc576('0x2d')][_0xc576('0x4a')]({'where':{'id':_0xc41e51[_0xc576('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c1471,null))[_0xc576('0x25')](removeEntity(_0x1c1471,null))['catch'](handleError(_0x1c1471,null));};exports['describe']=function(_0x40bc3f,_0x56f46a){return db[_0xc576('0x2d')][_0xc576('0x55')]()[_0xc576('0x25')](respondWithResult(_0x56f46a,null))[_0xc576('0x47')](handleError(_0x56f46a,null));};exports[_0xc576('0x56')]=function(_0x5d1533,_0x4985e5,_0x240645){var _0x528349={'raw':!![],'where':{}},_0x325761={},_0x4e33dc;return db['MailQueue']['findOne']({'where':{'id':_0x5d1533[_0xc576('0x49')]['id']}})['then'](handleEntityNotFound(_0x4985e5,null))[_0xc576('0x25')](function(_0x2e5f98){if(_0x2e5f98){_0x4e33dc=_0x2e5f98['get']({'plain':!![]});_0x325761[_0xc576('0x2f')]=_[_0xc576('0x30')](db[_0xc576('0x57')]['rawAttributes']);_0x325761[_0xc576('0x31')]=_[_0xc576('0x30')](_0x5d1533[_0xc576('0x31')]);_0x325761[_0xc576('0x32')]=_[_0xc576('0x34')](_0x325761[_0xc576('0x2f')],_0x325761['query']);_0x528349[_0xc576('0x33')]=_['intersection'](_0x325761[_0xc576('0x2f')],qs['fields'](_0x5d1533[_0xc576('0x31')]['fields']));_0x528349[_0xc576('0x33')]=_0x528349[_0xc576('0x33')][_0xc576('0x36')]?_0x528349['attributes']:_0x325761[_0xc576('0x2f')];if(!_0x5d1533[_0xc576('0x31')][_0xc576('0x37')](_0xc576('0x38'))){_0x528349[_0xc576('0x39')]=qs[_0xc576('0x39')](_0x5d1533[_0xc576('0x31')][_0xc576('0x39')]);_0x528349[_0xc576('0x1f')]=qs[_0xc576('0x1f')](_0x5d1533['query'][_0xc576('0x1f')]);}_0x528349[_0xc576('0x3a')]=qs[_0xc576('0x3b')](_0x5d1533[_0xc576('0x31')][_0xc576('0x3b')]);_0x528349[_0xc576('0x3c')]=qs[_0xc576('0x32')](_['pick'](_0x5d1533[_0xc576('0x31')],_0x325761[_0xc576('0x32')]));_0x528349['where'][_0xc576('0x58')]=_0x2e5f98['id'];if(_0x5d1533[_0xc576('0x31')][_0xc576('0x3e')]){_0x528349['where']=_[_0xc576('0x3f')](_0x528349['where'],{'$or':_[_0xc576('0x59')](_0x528349[_0xc576('0x33')],function(_0xed07cc){var _0x9210b4={};_0x9210b4[_0xed07cc]={'$like':'%'+_0x5d1533['query'][_0xc576('0x3e')]+'%'};return _0x9210b4;})});}_0x528349=_['merge']({},_0x528349,_0x5d1533['options']);return db['UserMailQueue'][_0xc576('0x46')](_0x528349);}})[_0xc576('0x25')](function(_0x459f6d){if(_0x459f6d){return db[_0xc576('0x5a')]['findAndCountAll']({'where':{'id':_[_0xc576('0x59')](_0x459f6d,_0xc576('0x5b')),'role':_0xc576('0x5c')},'attributes':['id',_0xc576('0x2a'),'mailPause',_0xc576('0x5d'),_0xc576('0x5e')]});}})[_0xc576('0x25')](function(_0x2f5d91){if(_0x2f5d91){return{'count':_0x2f5d91[_0xc576('0x1e')],'rows':_[_0xc576('0x59')](_0x2f5d91[_0xc576('0x5f')],function(_0x57a13f){return{'membername':_0x57a13f['name'],'UserId':_0x57a13f['id'],'queue_name':_0x4e33dc[_0xc576('0x2a')],'MailQueueId':_0x4e33dc['id'],'interface':util['format']('%s/%s',_0xc576('0x60'),_0x57a13f[_0xc576('0x2a')]),'penalty':0x0,'paused':_0x57a13f[_0xc576('0x61')],'createdAt':_0x57a13f[_0xc576('0x5e')],'updatedAt':_0x57a13f[_0xc576('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc576('0x25')](respondWithFilteredResult(_0x4985e5,_0x528349))[_0xc576('0x47')](handleError(_0x4985e5,null));};exports['getTeams']=function(_0x3e9254,_0x365fdc,_0x337908){var _0x323367={};var _0x208dfe={};var _0x12dab8;var _0x192307;return db[_0xc576('0x2d')][_0xc576('0x62')]({'where':{'id':_0x3e9254[_0xc576('0x49')]['id']}})[_0xc576('0x25')](handleEntityNotFound(_0x365fdc,null))[_0xc576('0x25')](function(_0x1ee213){if(_0x1ee213){_0x12dab8=_0x1ee213;_0x208dfe['model']=_[_0xc576('0x30')](db[_0xc576('0x63')]['rawAttributes']);_0x208dfe[_0xc576('0x31')]=_[_0xc576('0x30')](_0x3e9254[_0xc576('0x31')]);_0x208dfe['filters']=_['intersection'](_0x208dfe[_0xc576('0x2f')],_0x208dfe[_0xc576('0x31')]);_0x323367[_0xc576('0x33')]=_[_0xc576('0x34')](_0x208dfe[_0xc576('0x2f')],qs[_0xc576('0x35')](_0x3e9254[_0xc576('0x31')][_0xc576('0x35')]));_0x323367[_0xc576('0x33')]=_0x323367[_0xc576('0x33')][_0xc576('0x36')]?_0x323367[_0xc576('0x33')]:_0x208dfe[_0xc576('0x2f')];_0x323367[_0xc576('0x3a')]=qs[_0xc576('0x3b')](_0x3e9254['query'][_0xc576('0x3b')]);_0x323367[_0xc576('0x3c')]=qs['filters'](_[_0xc576('0x3d')](_0x3e9254[_0xc576('0x31')],_0x208dfe[_0xc576('0x32')]));if(_0x3e9254['query'][_0xc576('0x3e')]){_0x323367[_0xc576('0x3c')]=_[_0xc576('0x3f')](_0x323367[_0xc576('0x3c')],{'$or':_[_0xc576('0x59')](_0x323367['attributes'],function(_0x1541b3){var _0x1cf2a5={};_0x1cf2a5[_0x1541b3]={'$like':'%'+_0x3e9254['query'][_0xc576('0x3e')]+'%'};return _0x1cf2a5;})});}_0x323367=_[_0xc576('0x3f')]({},_0x323367,_0x3e9254[_0xc576('0x43')]);return _0x12dab8['getTeams'](_0x323367);}})['then'](function(_0x3d5c16){if(_0x3d5c16){_0x192307=_0x3d5c16[_0xc576('0x36')];if(!_0x3e9254[_0xc576('0x31')][_0xc576('0x37')](_0xc576('0x38'))){_0x323367[_0xc576('0x39')]=qs[_0xc576('0x39')](_0x3e9254[_0xc576('0x31')][_0xc576('0x39')]);_0x323367['offset']=qs['offset'](_0x3e9254['query'][_0xc576('0x1f')]);}return _0x12dab8[_0xc576('0x64')](_0x323367);}})[_0xc576('0x25')](function(_0x30f653){if(_0x30f653){return _0x30f653?{'count':_0x192307,'rows':_0x30f653}:null;}})[_0xc576('0x25')](respondWithResult(_0x365fdc,null))[_0xc576('0x47')](handleError(_0x365fdc,null));};exports[_0xc576('0x65')]=function(_0x2b30ec,_0x1a76e4,_0x2613ff){var _0x4e7b01=_0x2b30ec['body'][_0xc576('0x66')];return db[_0xc576('0x63')][_0xc576('0x46')]({'where':{'id':_[_0xc576('0x59')](_0x4e7b01,'id')},'attributes':['id'],'include':[{'model':db[_0xc576('0x5a')],'as':'Agents','attributes':['id',_0xc576('0x2a'),_0xc576('0x67'),_0xc576('0x68'),'interface'],'raw':!![]}]})[_0xc576('0x25')](function(_0x412505){if(_0x412505){var _0x527dfc=_[_0xc576('0x69')](_0x412505,function(_0x29f1cf){var _0x4dea4a=_0x29f1cf['get']({'plain':!![]});return _0x4dea4a[_0xc576('0x6a')];});return db[_0xc576('0x2d')]['find']({'where':{'id':_0x2b30ec[_0xc576('0x49')]['id']}})['then'](function(_0x2cc99e){return db[_0xc576('0x6b')][_0xc576('0x6c')](function(_0x158df1){return _0x2cc99e[_0xc576('0x65')](_['map'](_0x4e7b01,'id'),{'transaction':_0x158df1})[_0xc576('0x25')](function(){return BPromise['each'](_0x527dfc,function(_0x2c0fcf){return db[_0xc576('0x57')][_0xc576('0x6d')]({'where':{'UserId':_0x2c0fcf['id'],'MailQueueId':_0x2b30ec[_0xc576('0x49')]['id']},'transaction':_0x158df1});});})['then'](function(){_0x527dfc['forEach'](function(_0x592299){socket['emit'](_0xc576('0x6e'),{'UserId':_0x592299['id'],'MailQueueId':_0x2cc99e['id']});});});});});}})[_0xc576('0x25')](respondWithStatusCode(_0x1a76e4,null))[_0xc576('0x47')](handleError(_0x1a76e4,null));};exports['removeTeams']=function(_0x5f2256,_0x16f543,_0x5b980a){return db['Team'][_0xc576('0x46')]({'where':{'id':_0x5f2256[_0xc576('0x31')][_0xc576('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xc576('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x16f543,null))['then'](function(_0x334d5a){var _0x26cba8=_[_0xc576('0x59')](_0x334d5a,'id');var _0x55e6b3=[];var _0xd70e4e=[];var _0xcf9ca8=squel[_0xc576('0x70')]();_0xcf9ca8[_0xc576('0x71')](_0xc576('0x72'))['from']('team_has_mail_queues','tq')['join'](_0xc576('0x73'),'ut',_0xc576('0x74'))['where'](_0xc576('0x75'),_0x5f2256[_0xc576('0x49')]['id']);for(var _0x4b9c53=0x0;_0x4b9c53<_0x334d5a[_0xc576('0x36')];_0x4b9c53+=0x1){let _0x3c9b2c=_0x334d5a[_0x4b9c53];for(var _0x9bbca6=0x0;_0x9bbca6<_0x3c9b2c['Agents'][_0xc576('0x36')];_0x9bbca6+=0x1){let _0x47dc88=_0x3c9b2c['Agents'][_0x9bbca6];var _0x1571af=_0xcf9ca8[_0xc576('0x76')]();_0x1571af[_0xc576('0x3c')](_0xc576('0x77'),_0x47dc88['id']);_0xd70e4e[_0xc576('0x78')](db[_0xc576('0x6b')][_0xc576('0x31')](_0x1571af['toString'](),{'type':db[_0xc576('0x6b')]['QueryTypes']['SELECT']})[_0xc576('0x25')](function(_0x366c41){if(_0x366c41['length']===0x1){return _0x47dc88['id'];}else{var _0x2640c2=_['every'](_[_0xc576('0x59')](_0x366c41,_0xc576('0x79')),function(_0x25b132){return _[_0xc576('0x7a')](_0x26cba8,_0x25b132);});if(_0x2640c2){return _0x47dc88['id'];}}}));}}return BPromise[_0xc576('0x7b')](_0xd70e4e)['then'](function(_0x276652){_0x55e6b3=_(_0x55e6b3)['union'](_0x276652)[_0xc576('0x7c')]()[_0xc576('0x7d')]();return db['MailQueue'][_0xc576('0x4a')]({'where':{'id':_0x5f2256[_0xc576('0x49')]['id']}})[_0xc576('0x25')](function(_0x35968b){return db['sequelize'][_0xc576('0x6c')](function(_0x5405a3){return _0x35968b[_0xc576('0x7e')](_0x5f2256['query'][_0xc576('0x6f')],{'transaction':_0x5405a3})['then'](function(){if(!_[_0xc576('0x7f')](_0x55e6b3)){return _0x35968b['removeAgents'](_0x55e6b3,{'transaction':_0x5405a3});}})[_0xc576('0x25')](function(){_0x55e6b3[_0xc576('0x80')](function(_0x2a3f75){socket[_0xc576('0x81')](_0xc576('0x82'),{'UserId':_0x2a3f75,'MailQueueId':_0x35968b['id']});});});});});});})[_0xc576('0x25')](respondWithStatusCode(_0x16f543,null))[_0xc576('0x47')](handleError(_0x16f543,null));};exports[_0xc576('0x83')]=function(_0x59d231,_0x329ae9,_0x5f274b){return db[_0xc576('0x2d')][_0xc576('0x4a')]({'where':{'id':_0x59d231['params']['id']}})[_0xc576('0x25')](handleEntityNotFound(_0x329ae9,null))[_0xc576('0x25')](function(_0x521b1a){if(_0x521b1a){return _0x521b1a[_0xc576('0x83')](_0x59d231['body'][_0xc576('0x6f')],_['omit'](_0x59d231[_0xc576('0x4c')],[_0xc576('0x6f'),'id'])||{})['spread'](function(_0x519197){for(var _0x2ba513=0x0;_0x2ba513<_0x59d231[_0xc576('0x4c')][_0xc576('0x6f')][_0xc576('0x36')];_0x2ba513+=0x1){socket[_0xc576('0x81')](_0xc576('0x6e'),{'UserId':_0x59d231[_0xc576('0x4c')][_0xc576('0x6f')][_0x2ba513],'MailQueueId':_0x59d231['params']['id']});}return _0x519197;});}})['then'](respondWithResult(_0x329ae9,null))['catch'](handleError(_0x329ae9,null));};exports[_0xc576('0x84')]=function(_0x2e78a6,_0xbcd270,_0x56ad01){return db['MailQueue'][_0xc576('0x4a')]({'where':{'id':_0x2e78a6['params']['id']}})[_0xc576('0x25')](handleEntityNotFound(_0xbcd270,null))[_0xc576('0x25')](function(_0x11476b){if(_0x11476b){return _0x11476b['removeAgents'](_0x2e78a6[_0xc576('0x31')][_0xc576('0x6f')])[_0xc576('0x25')](function(){if(_['isArray'](_0x2e78a6['query']['ids'])){for(var _0xc72054=0x0;_0xc72054<_0x2e78a6[_0xc576('0x31')][_0xc576('0x6f')][_0xc576('0x36')];_0xc72054+=0x1){socket[_0xc576('0x81')]('userMailQueue:remove',{'UserId':Number(_0x2e78a6['query']['ids'][_0xc72054]),'MailQueueId':Number(_0x2e78a6[_0xc576('0x49')]['id'])});}}else{socket[_0xc576('0x81')](_0xc576('0x82'),{'UserId':Number(_0x2e78a6[_0xc576('0x31')][_0xc576('0x6f')]),'MailQueueId':Number(_0x2e78a6[_0xc576('0x49')]['id'])});}});}})[_0xc576('0x25')](respondWithStatusCode(_0xbcd270,null))[_0xc576('0x47')](handleError(_0xbcd270,null));};exports[_0xc576('0x85')]=function(_0x2f3da4,_0x187c15,_0x429011){var _0x40a301={};var _0x26ff28={};var _0x34fa4e;var _0x8b73a5;return db[_0xc576('0x2d')]['findOne']({'where':{'id':_0x2f3da4['params']['id']}})[_0xc576('0x25')](handleEntityNotFound(_0x187c15,null))[_0xc576('0x25')](function(_0x996763){if(_0x996763){_0x34fa4e=_0x996763;_0x26ff28[_0xc576('0x2f')]=_['keys'](db[_0xc576('0x5a')][_0xc576('0x2e')]);_0x26ff28[_0xc576('0x31')]=_[_0xc576('0x30')](_0x2f3da4['query']);_0x26ff28['filters']=_[_0xc576('0x34')](_0x26ff28[_0xc576('0x2f')],_0x26ff28[_0xc576('0x31')]);_0x40a301[_0xc576('0x33')]=_[_0xc576('0x34')](_0x26ff28[_0xc576('0x2f')],qs['fields'](_0x2f3da4['query']['fields']));_0x40a301[_0xc576('0x33')]=_0x40a301[_0xc576('0x33')][_0xc576('0x36')]?_0x40a301[_0xc576('0x33')]:_0x26ff28[_0xc576('0x2f')];_0x40a301[_0xc576('0x3a')]=qs[_0xc576('0x3b')](_0x2f3da4[_0xc576('0x31')][_0xc576('0x3b')]);_0x40a301[_0xc576('0x3c')]=qs[_0xc576('0x32')](_[_0xc576('0x3d')](_0x2f3da4[_0xc576('0x31')],_0x26ff28[_0xc576('0x32')]));if(_0x2f3da4[_0xc576('0x31')][_0xc576('0x3e')]){_0x40a301['where']=_[_0xc576('0x3f')](_0x40a301['where'],{'$or':_[_0xc576('0x59')](_0x40a301[_0xc576('0x33')],function(_0x3ec477){var _0x42d5f6={};_0x42d5f6[_0x3ec477]={'$like':'%'+_0x2f3da4[_0xc576('0x31')]['filter']+'%'};return _0x42d5f6;})});}_0x40a301=_[_0xc576('0x3f')]({},_0x40a301,_0x2f3da4[_0xc576('0x43')]);return _0x34fa4e[_0xc576('0x85')](_0x40a301);}})[_0xc576('0x25')](function(_0x571cd3){if(_0x571cd3){_0x8b73a5=_0x571cd3[_0xc576('0x36')];if(!_0x2f3da4[_0xc576('0x31')][_0xc576('0x37')]('nolimit')){_0x40a301['limit']=qs[_0xc576('0x39')](_0x2f3da4[_0xc576('0x31')]['limit']);_0x40a301[_0xc576('0x1f')]=qs[_0xc576('0x1f')](_0x2f3da4[_0xc576('0x31')][_0xc576('0x1f')]);}return _0x34fa4e[_0xc576('0x85')](_0x40a301);}})[_0xc576('0x25')](function(_0x3711f6){if(_0x3711f6){return _0x3711f6?{'count':_0x8b73a5,'rows':_0x3711f6}:null;}})[_0xc576('0x25')](respondWithResult(_0x187c15,null))[_0xc576('0x47')](handleError(_0x187c15,null));}; \ No newline at end of file +var _0x906e=['save','update','then','destroy','MailQueues','UserProfileResource','sendStatus','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','MailQueue','includeAll','findAll','rows','catch','show','params','length','include','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','MailQueueId','UserMailQueue','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','teams','User','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','isEmpty','userMailQueue:remove','addAgents','ids','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x2943e1,_0x584ff8){var _0x2eb148=function(_0x32a10b){while(--_0x32a10b){_0x2943e1['push'](_0x2943e1['shift']());}};_0x2eb148(++_0x584ff8);}(_0x906e,0x66));var _0xe906=function(_0x25c044,_0xbd05f8){_0x25c044=_0x25c044-0x0;var _0x558ee5=_0x906e[_0x25c044];return _0x558ee5;};'use strict';var pdf=require(_0xe906('0x0'));var emlformat=require(_0xe906('0x1'));var rimraf=require(_0xe906('0x2'));var zipdir=require(_0xe906('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe906('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe906('0x5'));var util=require(_0xe906('0x6'));var path=require(_0xe906('0x7'));var sox=require('sox');var csv=require(_0xe906('0x8'));var ejs=require(_0xe906('0x9'));var fs=require('fs');var _=require(_0xe906('0xa'));var squel=require(_0xe906('0xb'));var crypto=require(_0xe906('0xc'));var jsforce=require(_0xe906('0xd'));var deskjs=require(_0xe906('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe906('0xf'));var Papa=require(_0xe906('0x10'));var Redis=require('ioredis');var authService=require(_0xe906('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe906('0x12'));var logger=require(_0xe906('0x13'))('api');var utils=require(_0xe906('0x14'));var config=require(_0xe906('0x15'));var db=require(_0xe906('0x16'))['db'];config[_0xe906('0x17')]=_[_0xe906('0x18')](config[_0xe906('0x17')],{'host':_0xe906('0x19'),'port':0x18eb});var socket=require(_0xe906('0x1a'))(new Redis(config[_0xe906('0x17')]));require(_0xe906('0x1b'))[_0xe906('0x1c')](socket);function respondWithStatusCode(_0x456b5f,_0x571b79){_0x571b79=_0x571b79||0xcc;return function(_0xd09184){if(_0xd09184){return _0x456b5f['sendStatus'](_0x571b79);}return _0x456b5f[_0xe906('0x1d')](_0x571b79)[_0xe906('0x1e')]();};}function respondWithResult(_0x84b5ae,_0x2f26a6){_0x2f26a6=_0x2f26a6||0xc8;return function(_0x172e2d){if(_0x172e2d){return _0x84b5ae[_0xe906('0x1d')](_0x2f26a6)[_0xe906('0x1f')](_0x172e2d);}};}function respondWithFilteredResult(_0x2b3fba,_0x4acc50){return function(_0x5f358c){if(_0x5f358c){var _0x5a9440=_0x5f358c[_0xe906('0x20')],_0x4904b8=_0x4acc50['offset'],_0x29b28d=_0x4acc50[_0xe906('0x21')]+_0x4acc50[_0xe906('0x22')],_0x4a3fa6;if(_0x29b28d>=_0x5a9440){_0x29b28d=_0x5a9440;_0x4a3fa6=0xc8;}else{_0x4a3fa6=0xce;}_0x2b3fba[_0xe906('0x1d')](_0x4a3fa6);return _0x2b3fba[_0xe906('0x23')](_0xe906('0x24'),_0x4904b8+'-'+_0x29b28d+'/'+_0x5a9440)[_0xe906('0x1f')](_0x5f358c);}return null;};}function patchUpdates(_0x359ff3){return function(_0x2254ce){try{jsonpatch[_0xe906('0x25')](_0x2254ce,_0x359ff3,!![]);}catch(_0x4d9e6a){return BPromise['reject'](_0x4d9e6a);}return _0x2254ce[_0xe906('0x26')]();};}function saveUpdates(_0x55ae56,_0x3b388f){return function(_0x47b1bd){if(_0x47b1bd){return _0x47b1bd[_0xe906('0x27')](_0x55ae56)[_0xe906('0x28')](function(_0xf1a965){return _0xf1a965;});}return null;};}function removeEntity(_0x52c90e,_0x938cee){return function(_0x5a97ab){if(_0x5a97ab){return _0x5a97ab[_0xe906('0x29')]()[_0xe906('0x28')](function(){var _0xac8cd6=_0x5a97ab['get']({'plain':!![]});var _0x1bc522=_0xe906('0x2a');return db[_0xe906('0x2b')][_0xe906('0x29')]({'where':{'type':_0x1bc522,'resourceId':_0xac8cd6['id']}})['then'](function(){return _0x5a97ab;});})[_0xe906('0x28')](function(){_0x52c90e[_0xe906('0x1d')](0xcc)[_0xe906('0x1e')]();});}};}function handleEntityNotFound(_0x1cdae3,_0x21eb5c){return function(_0x28ba60){if(!_0x28ba60){_0x1cdae3[_0xe906('0x2c')](0x194);}return _0x28ba60;};}function handleError(_0x27a8fa,_0x5a005a){_0x5a005a=_0x5a005a||0x1f4;return function(_0x39017d){logger[_0xe906('0x2d')](_0x39017d[_0xe906('0x2e')]);if(_0x39017d[_0xe906('0x2f')]){delete _0x39017d[_0xe906('0x2f')];}_0x27a8fa['status'](_0x5a005a)['send'](_0x39017d);};}exports[_0xe906('0x30')]=function(_0x610f1f,_0x4428fc){var _0x4c49f8={},_0x2021d6={},_0x3d3238={'count':0x0,'rows':[]};var _0x3b6888=db['MailQueue'][_0xe906('0x31')];_0x2021d6[_0xe906('0x32')]=_[_0xe906('0x33')](_0x3b6888);_0x2021d6['query']=_['keys'](_0x610f1f[_0xe906('0x34')]);_0x2021d6[_0xe906('0x35')]=_[_0xe906('0x36')](_0x2021d6[_0xe906('0x32')],_0x2021d6[_0xe906('0x34')]);_0x4c49f8[_0xe906('0x37')]=_[_0xe906('0x36')](_0x2021d6[_0xe906('0x32')],qs[_0xe906('0x38')](_0x610f1f[_0xe906('0x34')][_0xe906('0x38')]));_0x4c49f8[_0xe906('0x37')]=_0x4c49f8['attributes']['length']?_0x4c49f8[_0xe906('0x37')]:_0x2021d6['model'];if(!_0x610f1f[_0xe906('0x34')][_0xe906('0x39')](_0xe906('0x3a'))){_0x4c49f8[_0xe906('0x22')]=qs['limit'](_0x610f1f[_0xe906('0x34')][_0xe906('0x22')]);_0x4c49f8[_0xe906('0x21')]=qs['offset'](_0x610f1f[_0xe906('0x34')][_0xe906('0x21')]);}_0x4c49f8[_0xe906('0x3b')]=qs[_0xe906('0x3c')](_0x610f1f['query'][_0xe906('0x3c')]);_0x4c49f8[_0xe906('0x3d')]=qs[_0xe906('0x35')](_[_0xe906('0x3e')](_0x610f1f[_0xe906('0x34')],_0x2021d6[_0xe906('0x35')]));if(_0x610f1f[_0xe906('0x34')][_0xe906('0x3f')]){_0x4c49f8['where']=_[_0xe906('0x40')](_0x4c49f8[_0xe906('0x3d')],{'$or':_[_0xe906('0x41')](_0x3b6888,function(_0x519fa0){if(_0x519fa0[_0xe906('0x42')][_0xe906('0x43')]!==_0xe906('0x44')){var _0x2e222f={};_0x2e222f[_0x519fa0[_0xe906('0x45')]]={'$like':'%'+_0x610f1f['query'][_0xe906('0x3f')]+'%'};return _0x2e222f;}})});}_0x4c49f8=_[_0xe906('0x40')]({},_0x4c49f8,_0x610f1f[_0xe906('0x46')]);var _0xf10030={'where':_0x4c49f8[_0xe906('0x3d')]};return db[_0xe906('0x47')]['count'](_0xf10030)[_0xe906('0x28')](function(_0x2096aa){_0x3d3238[_0xe906('0x20')]=_0x2096aa;if(_0x610f1f[_0xe906('0x34')][_0xe906('0x48')]){_0x4c49f8['include']=[{'all':!![]}];}return db[_0xe906('0x47')][_0xe906('0x49')](_0x4c49f8);})['then'](function(_0x53db88){_0x3d3238[_0xe906('0x4a')]=_0x53db88;return _0x3d3238;})[_0xe906('0x28')](respondWithFilteredResult(_0x4428fc,_0x4c49f8))[_0xe906('0x4b')](handleError(_0x4428fc,null));};exports[_0xe906('0x4c')]=function(_0x181152,_0x496915){var _0xc9fec9={'raw':!![],'where':{'id':_0x181152[_0xe906('0x4d')]['id']}},_0x43bfac={};_0x43bfac[_0xe906('0x32')]=_[_0xe906('0x33')](db[_0xe906('0x47')][_0xe906('0x31')]);_0x43bfac['query']=_[_0xe906('0x33')](_0x181152[_0xe906('0x34')]);_0x43bfac[_0xe906('0x35')]=_[_0xe906('0x36')](_0x43bfac['model'],_0x43bfac['query']);_0xc9fec9[_0xe906('0x37')]=_[_0xe906('0x36')](_0x43bfac['model'],qs[_0xe906('0x38')](_0x181152[_0xe906('0x34')][_0xe906('0x38')]));_0xc9fec9[_0xe906('0x37')]=_0xc9fec9[_0xe906('0x37')][_0xe906('0x4e')]?_0xc9fec9['attributes']:_0x43bfac[_0xe906('0x32')];if(_0x181152['query'][_0xe906('0x48')]){_0xc9fec9[_0xe906('0x4f')]=[{'all':!![]}];}_0xc9fec9=_[_0xe906('0x40')]({},_0xc9fec9,_0x181152[_0xe906('0x46')]);return db[_0xe906('0x47')]['find'](_0xc9fec9)[_0xe906('0x28')](handleEntityNotFound(_0x496915,null))['then'](respondWithResult(_0x496915,null))[_0xe906('0x4b')](handleError(_0x496915,null));};exports['create']=function(_0x452cc5,_0x14301f){return db['MailQueue']['create'](_0x452cc5[_0xe906('0x50')],{})[_0xe906('0x28')](function(_0x17a448){var _0x74a49f=_0x452cc5[_0xe906('0x51')][_0xe906('0x52')]({'plain':!![]});if(!_0x74a49f)throw new Error(_0xe906('0x53'));if(_0x74a49f['role']==='user'){var _0x2e1a26=_0x17a448['get']({'plain':!![]});var _0x263e3c=_0xe906('0x2a');return db[_0xe906('0x54')][_0xe906('0x55')]({'where':{'name':_0x263e3c,'userProfileId':_0x74a49f[_0xe906('0x56')]},'raw':!![]})[_0xe906('0x28')](function(_0x4578f2){if(_0x4578f2&&_0x4578f2[_0xe906('0x57')]===0x0){return db['UserProfileResource'][_0xe906('0x58')]({'name':_0x2e1a26[_0xe906('0x2f')],'resourceId':_0x2e1a26['id'],'type':_0x4578f2[_0xe906('0x2f')],'sectionId':_0x4578f2['id']},{})[_0xe906('0x28')](function(){return _0x17a448;});}else{return _0x17a448;}})[_0xe906('0x4b')](function(_0x33606f){logger[_0xe906('0x2d')](_0xe906('0x59'),_0x33606f);throw _0x33606f;});}return _0x17a448;})['then'](respondWithResult(_0x14301f,0xc9))['catch'](handleError(_0x14301f,null));};exports['update']=function(_0x1060db,_0xf7c5ed){if(_0x1060db['body']['id']){delete _0x1060db[_0xe906('0x50')]['id'];}return db[_0xe906('0x47')][_0xe906('0x55')]({'where':{'id':_0x1060db[_0xe906('0x4d')]['id']}})[_0xe906('0x28')](handleEntityNotFound(_0xf7c5ed,null))[_0xe906('0x28')](saveUpdates(_0x1060db[_0xe906('0x50')],null))[_0xe906('0x28')](respondWithResult(_0xf7c5ed,null))['catch'](handleError(_0xf7c5ed,null));};exports['destroy']=function(_0x394534,_0x32ba1b){return db['MailQueue']['find']({'where':{'id':_0x394534[_0xe906('0x4d')]['id']}})[_0xe906('0x28')](handleEntityNotFound(_0x32ba1b,null))['then'](removeEntity(_0x32ba1b,null))[_0xe906('0x4b')](handleError(_0x32ba1b,null));};exports[_0xe906('0x5a')]=function(_0x5d03f6,_0x2442f7){return db[_0xe906('0x47')][_0xe906('0x5a')]()[_0xe906('0x28')](respondWithResult(_0x2442f7,null))[_0xe906('0x4b')](handleError(_0x2442f7,null));};exports['getMembers']=function(_0xf4f242,_0x5c7a74,_0x1e1360){var _0x3c28e4={'raw':!![],'where':{}},_0x23cf04={},_0xbc596a;return db[_0xe906('0x47')]['findOne']({'where':{'id':_0xf4f242[_0xe906('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5c7a74,null))[_0xe906('0x28')](function(_0x53598c){if(_0x53598c){_0xbc596a=_0x53598c[_0xe906('0x52')]({'plain':!![]});_0x23cf04[_0xe906('0x32')]=_[_0xe906('0x33')](db['UserMailQueue'][_0xe906('0x31')]);_0x23cf04[_0xe906('0x34')]=_[_0xe906('0x33')](_0xf4f242[_0xe906('0x34')]);_0x23cf04[_0xe906('0x35')]=_[_0xe906('0x36')](_0x23cf04[_0xe906('0x32')],_0x23cf04['query']);_0x3c28e4['attributes']=_[_0xe906('0x36')](_0x23cf04['model'],qs[_0xe906('0x38')](_0xf4f242['query'][_0xe906('0x38')]));_0x3c28e4[_0xe906('0x37')]=_0x3c28e4[_0xe906('0x37')]['length']?_0x3c28e4[_0xe906('0x37')]:_0x23cf04[_0xe906('0x32')];if(!_0xf4f242[_0xe906('0x34')][_0xe906('0x39')]('nolimit')){_0x3c28e4[_0xe906('0x22')]=qs[_0xe906('0x22')](_0xf4f242[_0xe906('0x34')]['limit']);_0x3c28e4[_0xe906('0x21')]=qs['offset'](_0xf4f242['query'][_0xe906('0x21')]);}_0x3c28e4[_0xe906('0x3b')]=qs[_0xe906('0x3c')](_0xf4f242['query'][_0xe906('0x3c')]);_0x3c28e4[_0xe906('0x3d')]=qs[_0xe906('0x35')](_[_0xe906('0x3e')](_0xf4f242[_0xe906('0x34')],_0x23cf04['filters']));_0x3c28e4['where'][_0xe906('0x5b')]=_0x53598c['id'];if(_0xf4f242[_0xe906('0x34')][_0xe906('0x3f')]){_0x3c28e4[_0xe906('0x3d')]=_[_0xe906('0x40')](_0x3c28e4['where'],{'$or':_['map'](_0x3c28e4[_0xe906('0x37')],function(_0x2de4b1){var _0x244e84={};_0x244e84[_0x2de4b1]={'$like':'%'+_0xf4f242[_0xe906('0x34')][_0xe906('0x3f')]+'%'};return _0x244e84;})});}_0x3c28e4=_['merge']({},_0x3c28e4,_0xf4f242['options']);return db[_0xe906('0x5c')][_0xe906('0x49')](_0x3c28e4);}})[_0xe906('0x28')](function(_0x326357){if(_0x326357){return db['User'][_0xe906('0x5d')]({'where':{'id':_['map'](_0x326357,_0xe906('0x5e')),'role':_0xe906('0x5f')},'attributes':['id',_0xe906('0x2f'),_0xe906('0x60'),_0xe906('0x61'),_0xe906('0x62')]});}})['then'](function(_0x5714f1){if(_0x5714f1){return{'count':_0x5714f1['count'],'rows':_['map'](_0x5714f1[_0xe906('0x4a')],function(_0x2be91c){return{'membername':_0x2be91c['name'],'UserId':_0x2be91c['id'],'queue_name':_0xbc596a[_0xe906('0x2f')],'MailQueueId':_0xbc596a['id'],'interface':util[_0xe906('0x63')](_0xe906('0x64'),_0xe906('0x65'),_0x2be91c['name']),'penalty':0x0,'paused':_0x2be91c[_0xe906('0x60')],'createdAt':_0x2be91c[_0xe906('0x62')],'updatedAt':_0x2be91c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe906('0x28')](respondWithFilteredResult(_0x5c7a74,_0x3c28e4))[_0xe906('0x4b')](handleError(_0x5c7a74,null));};exports[_0xe906('0x66')]=function(_0xbd0ac9,_0x18efbb,_0x73ba42){var _0x4d6b52={};var _0x3020f3={};var _0x560a9b;var _0x4aae4e;return db[_0xe906('0x47')][_0xe906('0x67')]({'where':{'id':_0xbd0ac9['params']['id']}})[_0xe906('0x28')](handleEntityNotFound(_0x18efbb,null))[_0xe906('0x28')](function(_0x5b7668){if(_0x5b7668){_0x560a9b=_0x5b7668;_0x3020f3['model']=_[_0xe906('0x33')](db[_0xe906('0x68')][_0xe906('0x31')]);_0x3020f3[_0xe906('0x34')]=_[_0xe906('0x33')](_0xbd0ac9[_0xe906('0x34')]);_0x3020f3[_0xe906('0x35')]=_[_0xe906('0x36')](_0x3020f3['model'],_0x3020f3['query']);_0x4d6b52['attributes']=_[_0xe906('0x36')](_0x3020f3[_0xe906('0x32')],qs[_0xe906('0x38')](_0xbd0ac9[_0xe906('0x34')][_0xe906('0x38')]));_0x4d6b52['attributes']=_0x4d6b52[_0xe906('0x37')][_0xe906('0x4e')]?_0x4d6b52['attributes']:_0x3020f3[_0xe906('0x32')];_0x4d6b52[_0xe906('0x3b')]=qs[_0xe906('0x3c')](_0xbd0ac9[_0xe906('0x34')]['sort']);_0x4d6b52[_0xe906('0x3d')]=qs['filters'](_['pick'](_0xbd0ac9[_0xe906('0x34')],_0x3020f3['filters']));if(_0xbd0ac9[_0xe906('0x34')][_0xe906('0x3f')]){_0x4d6b52[_0xe906('0x3d')]=_[_0xe906('0x40')](_0x4d6b52[_0xe906('0x3d')],{'$or':_['map'](_0x4d6b52[_0xe906('0x37')],function(_0x8fab41){var _0x497664={};_0x497664[_0x8fab41]={'$like':'%'+_0xbd0ac9[_0xe906('0x34')]['filter']+'%'};return _0x497664;})});}_0x4d6b52=_[_0xe906('0x40')]({},_0x4d6b52,_0xbd0ac9[_0xe906('0x46')]);return _0x560a9b[_0xe906('0x66')](_0x4d6b52);}})['then'](function(_0x5409f3){if(_0x5409f3){_0x4aae4e=_0x5409f3['length'];if(!_0xbd0ac9[_0xe906('0x34')][_0xe906('0x39')](_0xe906('0x3a'))){_0x4d6b52[_0xe906('0x22')]=qs[_0xe906('0x22')](_0xbd0ac9[_0xe906('0x34')][_0xe906('0x22')]);_0x4d6b52[_0xe906('0x21')]=qs[_0xe906('0x21')](_0xbd0ac9[_0xe906('0x34')][_0xe906('0x21')]);}return _0x560a9b['getTeams'](_0x4d6b52);}})[_0xe906('0x28')](function(_0x1ad1a1){if(_0x1ad1a1){return _0x1ad1a1?{'count':_0x4aae4e,'rows':_0x1ad1a1}:null;}})[_0xe906('0x28')](respondWithResult(_0x18efbb,null))[_0xe906('0x4b')](handleError(_0x18efbb,null));};exports['addTeams']=function(_0x30c3bc,_0x22400f,_0x15c105){var _0x5793ee=_0x30c3bc['body'][_0xe906('0x69')];return db['Team'][_0xe906('0x49')]({'where':{'id':_[_0xe906('0x41')](_0x5793ee,'id')},'attributes':['id'],'include':[{'model':db[_0xe906('0x6a')],'as':_0xe906('0x6b'),'attributes':['id',_0xe906('0x2f'),_0xe906('0x6c'),'voicePause',_0xe906('0x6d')],'raw':!![]}]})[_0xe906('0x28')](function(_0x1b0df6){if(_0x1b0df6){var _0x3d04c9=_[_0xe906('0x6e')](_0x1b0df6,function(_0x16ba75){var _0x410178=_0x16ba75['get']({'plain':!![]});return _0x410178[_0xe906('0x6b')];});return db[_0xe906('0x47')][_0xe906('0x55')]({'where':{'id':_0x30c3bc[_0xe906('0x4d')]['id']}})[_0xe906('0x28')](function(_0x2bf1d9){return db[_0xe906('0x6f')][_0xe906('0x70')](function(_0x6c94f5){return _0x2bf1d9[_0xe906('0x71')](_[_0xe906('0x41')](_0x5793ee,'id'),{'transaction':_0x6c94f5})[_0xe906('0x28')](function(){return BPromise[_0xe906('0x72')](_0x3d04c9,function(_0x5103e5){return db[_0xe906('0x5c')][_0xe906('0x73')]({'where':{'UserId':_0x5103e5['id'],'MailQueueId':_0x30c3bc[_0xe906('0x4d')]['id']},'transaction':_0x6c94f5});});})[_0xe906('0x28')](function(){_0x3d04c9[_0xe906('0x74')](function(_0x5b97f1){socket[_0xe906('0x75')]('userMailQueue:save',{'UserId':_0x5b97f1['id'],'MailQueueId':_0x2bf1d9['id']});});});});});}})['then'](respondWithStatusCode(_0x22400f,null))[_0xe906('0x4b')](handleError(_0x22400f,null));};exports[_0xe906('0x76')]=function(_0x4a6be2,_0x30ba7d,_0x5e4ecd){return db[_0xe906('0x68')][_0xe906('0x49')]({'where':{'id':_0x4a6be2[_0xe906('0x34')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe906('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xe906('0x28')](handleEntityNotFound(_0x30ba7d,null))[_0xe906('0x28')](function(_0x1989c2){var _0x19be56=_['map'](_0x1989c2,'id');var _0x266174=[];var _0x39dbe3=[];var _0x38b401=squel['select']();_0x38b401[_0xe906('0x45')](_0xe906('0x77'))[_0xe906('0x78')](_0xe906('0x79'),'tq')['join'](_0xe906('0x7a'),'ut',_0xe906('0x7b'))[_0xe906('0x3d')](_0xe906('0x7c'),_0x4a6be2[_0xe906('0x4d')]['id']);for(var _0x144994=0x0;_0x144994<_0x1989c2[_0xe906('0x4e')];_0x144994+=0x1){let _0xb7b56c=_0x1989c2[_0x144994];for(var _0x3ff1da=0x0;_0x3ff1da<_0xb7b56c[_0xe906('0x6b')]['length'];_0x3ff1da+=0x1){let _0x3b1a89=_0xb7b56c['Agents'][_0x3ff1da];var _0x37f097=_0x38b401['clone']();_0x37f097['where']('ut.UserId\x20=\x20?',_0x3b1a89['id']);_0x39dbe3['push'](db['sequelize'][_0xe906('0x34')](_0x37f097[_0xe906('0x7d')](),{'type':db[_0xe906('0x6f')][_0xe906('0x7e')][_0xe906('0x7f')]})['then'](function(_0x3767a1){if(_0x3767a1['length']===0x1){return _0x3b1a89['id'];}else{var _0x2cd47b=_[_0xe906('0x80')](_[_0xe906('0x41')](_0x3767a1,_0xe906('0x81')),function(_0x267876){return _[_0xe906('0x82')](_0x19be56,_0x267876);});if(_0x2cd47b){return _0x3b1a89['id'];}}}));}}return BPromise[_0xe906('0x83')](_0x39dbe3)[_0xe906('0x28')](function(_0x52b2e4){_0x266174=_(_0x266174)['union'](_0x52b2e4)['compact']()[_0xe906('0x84')]();return db['MailQueue'][_0xe906('0x55')]({'where':{'id':_0x4a6be2[_0xe906('0x4d')]['id']}})[_0xe906('0x28')](function(_0xb94dc4){return db[_0xe906('0x6f')]['transaction'](function(_0x1d8a55){return _0xb94dc4[_0xe906('0x76')](_0x4a6be2['query']['ids'],{'transaction':_0x1d8a55})[_0xe906('0x28')](function(){if(!_[_0xe906('0x85')](_0x266174)){return _0xb94dc4['removeAgents'](_0x266174,{'transaction':_0x1d8a55});}})['then'](function(){_0x266174[_0xe906('0x74')](function(_0x664f9a){socket[_0xe906('0x75')](_0xe906('0x86'),{'UserId':_0x664f9a,'MailQueueId':_0xb94dc4['id']});});});});});});})[_0xe906('0x28')](respondWithStatusCode(_0x30ba7d,null))['catch'](handleError(_0x30ba7d,null));};exports[_0xe906('0x87')]=function(_0x49d3e6,_0x4ab9e8,_0x2990e5){return db[_0xe906('0x47')][_0xe906('0x55')]({'where':{'id':_0x49d3e6[_0xe906('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ab9e8,null))[_0xe906('0x28')](function(_0xd9eafc){if(_0xd9eafc){return _0xd9eafc[_0xe906('0x87')](_0x49d3e6[_0xe906('0x50')][_0xe906('0x88')],_['omit'](_0x49d3e6[_0xe906('0x50')],[_0xe906('0x88'),'id'])||{})['spread'](function(_0x18fdf0){for(var _0x4523ac=0x0;_0x4523ac<_0x49d3e6[_0xe906('0x50')][_0xe906('0x88')][_0xe906('0x4e')];_0x4523ac+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x49d3e6[_0xe906('0x50')][_0xe906('0x88')][_0x4523ac],'MailQueueId':_0x49d3e6[_0xe906('0x4d')]['id']});}return _0x18fdf0;});}})[_0xe906('0x28')](respondWithResult(_0x4ab9e8,null))[_0xe906('0x4b')](handleError(_0x4ab9e8,null));};exports[_0xe906('0x89')]=function(_0x49bc2a,_0x398a33,_0x2ca59f){return db[_0xe906('0x47')][_0xe906('0x55')]({'where':{'id':_0x49bc2a['params']['id']}})['then'](handleEntityNotFound(_0x398a33,null))[_0xe906('0x28')](function(_0x3f0276){if(_0x3f0276){return _0x3f0276['removeAgents'](_0x49bc2a[_0xe906('0x34')][_0xe906('0x88')])[_0xe906('0x28')](function(){if(_[_0xe906('0x8a')](_0x49bc2a[_0xe906('0x34')][_0xe906('0x88')])){for(var _0x36ebf9=0x0;_0x36ebf9<_0x49bc2a[_0xe906('0x34')]['ids'][_0xe906('0x4e')];_0x36ebf9+=0x1){socket[_0xe906('0x75')](_0xe906('0x86'),{'UserId':Number(_0x49bc2a['query'][_0xe906('0x88')][_0x36ebf9]),'MailQueueId':Number(_0x49bc2a[_0xe906('0x4d')]['id'])});}}else{socket[_0xe906('0x75')](_0xe906('0x86'),{'UserId':Number(_0x49bc2a[_0xe906('0x34')][_0xe906('0x88')]),'MailQueueId':Number(_0x49bc2a[_0xe906('0x4d')]['id'])});}});}})[_0xe906('0x28')](respondWithStatusCode(_0x398a33,null))['catch'](handleError(_0x398a33,null));};exports[_0xe906('0x8b')]=function(_0x32e3b0,_0x4b95ee,_0x4f056d){var _0x2497e3={};var _0xf62b22={};var _0x3f75fd;var _0x44c546;return db['MailQueue']['findOne']({'where':{'id':_0x32e3b0[_0xe906('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4b95ee,null))['then'](function(_0x3ed206){if(_0x3ed206){_0x3f75fd=_0x3ed206;_0xf62b22[_0xe906('0x32')]=_[_0xe906('0x33')](db[_0xe906('0x6a')]['rawAttributes']);_0xf62b22[_0xe906('0x34')]=_['keys'](_0x32e3b0['query']);_0xf62b22['filters']=_[_0xe906('0x36')](_0xf62b22[_0xe906('0x32')],_0xf62b22[_0xe906('0x34')]);_0x2497e3[_0xe906('0x37')]=_[_0xe906('0x36')](_0xf62b22[_0xe906('0x32')],qs['fields'](_0x32e3b0['query']['fields']));_0x2497e3[_0xe906('0x37')]=_0x2497e3[_0xe906('0x37')][_0xe906('0x4e')]?_0x2497e3[_0xe906('0x37')]:_0xf62b22[_0xe906('0x32')];_0x2497e3[_0xe906('0x3b')]=qs[_0xe906('0x3c')](_0x32e3b0[_0xe906('0x34')][_0xe906('0x3c')]);_0x2497e3['where']=qs[_0xe906('0x35')](_['pick'](_0x32e3b0[_0xe906('0x34')],_0xf62b22[_0xe906('0x35')]));if(_0x32e3b0[_0xe906('0x34')][_0xe906('0x3f')]){_0x2497e3[_0xe906('0x3d')]=_[_0xe906('0x40')](_0x2497e3[_0xe906('0x3d')],{'$or':_[_0xe906('0x41')](_0x2497e3[_0xe906('0x37')],function(_0x330a5b){var _0x57391d={};_0x57391d[_0x330a5b]={'$like':'%'+_0x32e3b0['query'][_0xe906('0x3f')]+'%'};return _0x57391d;})});}_0x2497e3=_[_0xe906('0x40')]({},_0x2497e3,_0x32e3b0[_0xe906('0x46')]);return _0x3f75fd[_0xe906('0x8b')](_0x2497e3);}})[_0xe906('0x28')](function(_0x28d05a){if(_0x28d05a){_0x44c546=_0x28d05a[_0xe906('0x4e')];if(!_0x32e3b0[_0xe906('0x34')]['hasOwnProperty'](_0xe906('0x3a'))){_0x2497e3[_0xe906('0x22')]=qs[_0xe906('0x22')](_0x32e3b0[_0xe906('0x34')][_0xe906('0x22')]);_0x2497e3[_0xe906('0x21')]=qs[_0xe906('0x21')](_0x32e3b0['query'][_0xe906('0x21')]);}return _0x3f75fd[_0xe906('0x8b')](_0x2497e3);}})[_0xe906('0x28')](function(_0x2038a3){if(_0x2038a3){return _0x2038a3?{'count':_0x44c546,'rows':_0x2038a3}:null;}})[_0xe906('0x28')](respondWithResult(_0x4b95ee,null))[_0xe906('0x4b')](handleError(_0x4b95ee,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ebff68a..9a1735c 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 _0x49ae=['update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x13cfbe,_0x9218a9){var _0x4234c7=function(_0x577968){while(--_0x577968){_0x13cfbe['push'](_0x13cfbe['shift']());}};_0x4234c7(++_0x9218a9);}(_0x49ae,0x18e));var _0xe49a=function(_0x36b535,_0x116f4b){_0x36b535=_0x36b535-0x0;var _0x178c72=_0x49ae[_0x36b535];return _0x178c72;};'use strict';var EventEmitter=require(_0xe49a('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe49a('0x1'),'afterDestroy':_0xe49a('0x2')};function emitEvent(_0x492ea4){return function(_0x4c5dd2,_0x1a7d64,_0x443a02){MailQueueEvents[_0xe49a('0x3')](_0x492ea4+':'+_0x4c5dd2['id'],_0x4c5dd2);MailQueueEvents[_0xe49a('0x3')](_0x492ea4,_0x4c5dd2);_0x443a02(null);};}for(var e in events){if(events[_0xe49a('0x4')](e)){var event=events[e];MailQueue[_0xe49a('0x5')](e,emitEvent(event));}}module[_0xe49a('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x364f=['remove','emit','exports','MailQueue','setMaxListeners','update'];(function(_0x508c0a,_0x1bcd5e){var _0x1c19b7=function(_0x21300d){while(--_0x21300d){_0x508c0a['push'](_0x508c0a['shift']());}};_0x1c19b7(++_0x1bcd5e);}(_0x364f,0x147));var _0xf364=function(_0x1f4e09,_0x1fc591){_0x1f4e09=_0x1f4e09-0x0;var _0x10deec=_0x364f[_0x1f4e09];return _0x10deec;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xf364('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf364('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf364('0x2'),'afterDestroy':_0xf364('0x3')};function emitEvent(_0x1f259e){return function(_0x4f2e6d,_0x3f3587,_0x14d220){MailQueueEvents[_0xf364('0x4')](_0x1f259e+':'+_0x4f2e6d['id'],_0x4f2e6d);MailQueueEvents[_0xf364('0x4')](_0x1f259e,_0x4f2e6d);_0x14d220(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xf364('0x5')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index a139948..f088484 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 _0xbdb7=['request-promise','path','rimraf','./mailQueue.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3cb9eb,_0x3fd4b9){_0x3cb9eb=_0x3cb9eb-0x0;var _0x4d5970=_0xbdb7[_0x3cb9eb];return _0x4d5970;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['mail_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x320415,_0x1c3ced){var _0x3b0628=function(_0x4c9bca){while(--_0x4c9bca){_0x320415['push'](_0x320415['shift']());}};_0x3b0628(++_0x1c3ced);}(_0x70e0,0x17b));var _0x070e=function(_0x3ab0c8,_0x3edfe9){_0x3ab0c8=_0x3ab0c8-0x0;var _0x4ec50b=_0x70e0[_0x3ab0c8];return _0x4ec50b;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('MailQueue',attributes,{'tableName':_0x070e('0x8'),'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 8dae4b2..9bfa13d 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 _0x4c93=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','MailQueue','findAll','options','where','attributes','include','map','model','GetMailQueue','stringify','ShowMailQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x1834f0,_0x15d511){var _0x587275=function(_0x1891bd){while(--_0x1891bd){_0x1834f0['push'](_0x1834f0['shift']());}};_0x587275(++_0x15d511);}(_0x4c93,0x10c));var _0x34c9=function(_0x5aa130,_0x1287c1){_0x5aa130=_0x5aa130-0x0;var _0x2fd53e=_0x4c93[_0x5aa130];return _0x2fd53e;};'use strict';var _=require('lodash');var util=require(_0x34c9('0x0'));var moment=require(_0x34c9('0x1'));var BPromise=require(_0x34c9('0x2'));var rs=require(_0x34c9('0x3'));var fs=require('fs');var Redis=require(_0x34c9('0x4'));var db=require(_0x34c9('0x5'))['db'];var utils=require(_0x34c9('0x6'));var logger=require(_0x34c9('0x7'))(_0x34c9('0x8'));var config=require(_0x34c9('0x9'));var jayson=require(_0x34c9('0xa'));var client=jayson[_0x34c9('0xb')]['http']({'port':0x232a});config[_0x34c9('0xc')]=_[_0x34c9('0xd')](config['redis'],{'host':_0x34c9('0xe'),'port':0x18eb});var socket=require(_0x34c9('0xf'))(new Redis(config[_0x34c9('0xc')]));require('./mailQueue.socket')[_0x34c9('0x10')](socket);function respondWithRpcPromise(_0xa61e0b,_0x370aea,_0xc9cd3a){return new BPromise(function(_0xc65c59,_0x470925){return client[_0x34c9('0x11')](_0xa61e0b,_0xc9cd3a)[_0x34c9('0x12')](function(_0x4c9433){logger['info'](_0x34c9('0x13'),_0x370aea,_0x34c9('0x14'));logger[_0x34c9('0x15')](_0x34c9('0x16'),_0x370aea,'request\x20sent',JSON['stringify'](_0x4c9433));if(_0x4c9433[_0x34c9('0x17')]){if(_0x4c9433[_0x34c9('0x17')]['code']===0x1f4){logger[_0x34c9('0x17')](_0x34c9('0x13'),_0x370aea,_0x4c9433[_0x34c9('0x17')][_0x34c9('0x18')]);return _0x470925(_0x4c9433['error'][_0x34c9('0x18')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x370aea,_0x4c9433['error'][_0x34c9('0x18')]);return _0xc65c59(_0x4c9433[_0x34c9('0x17')][_0x34c9('0x18')]);}else{logger[_0x34c9('0x19')]('MailQueue,\x20%s,\x20%s',_0x370aea,_0x34c9('0x14'));_0xc65c59(_0x4c9433[_0x34c9('0x1a')]['message']);}})[_0x34c9('0x1b')](function(_0x4fdd29){logger[_0x34c9('0x17')]('MailQueue,\x20%s,\x20%s',_0x370aea,_0x4fdd29);_0x470925(_0x4fdd29);});});}exports['GetMailQueue']=function(_0x10ed70){var _0x5c9bf6=this;return new Promise(function(_0xf0c16b,_0x5832e3){return db[_0x34c9('0x1c')][_0x34c9('0x1d')]({'raw':_0x10ed70[_0x34c9('0x1e')]?_0x10ed70[_0x34c9('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x10ed70[_0x34c9('0x1e')]?_0x10ed70[_0x34c9('0x1e')][_0x34c9('0x1f')]||null:null,'attributes':_0x10ed70[_0x34c9('0x1e')]?_0x10ed70[_0x34c9('0x1e')][_0x34c9('0x20')]||null:null,'limit':_0x10ed70[_0x34c9('0x1e')]?_0x10ed70[_0x34c9('0x1e')]['limit']||null:null,'include':_0x10ed70[_0x34c9('0x1e')]?_0x10ed70[_0x34c9('0x1e')][_0x34c9('0x21')]?_['map'](_0x10ed70[_0x34c9('0x1e')][_0x34c9('0x21')],function(_0x3c8490){return{'model':db[_0x3c8490['model']],'as':_0x3c8490['as'],'attributes':_0x3c8490[_0x34c9('0x20')],'include':_0x3c8490[_0x34c9('0x21')]?_[_0x34c9('0x22')](_0x3c8490[_0x34c9('0x21')],function(_0x3e44a9){return{'model':db[_0x3e44a9[_0x34c9('0x23')]],'as':_0x3e44a9['as'],'attributes':_0x3e44a9[_0x34c9('0x20')],'include':_0x3e44a9[_0x34c9('0x21')]?_['map'](_0x3e44a9['include'],function(_0x491974){return{'model':db[_0x491974[_0x34c9('0x23')]],'as':_0x491974['as'],'attributes':_0x491974[_0x34c9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x34c9('0x12')](function(_0x2ada23){logger[_0x34c9('0x19')](_0x34c9('0x24'),_0x10ed70);logger['debug']('GetMailQueue',_0x10ed70,JSON[_0x34c9('0x25')](_0x2ada23));_0xf0c16b(_0x2ada23);})[_0x34c9('0x1b')](function(_0x2a19e4){logger['error'](_0x34c9('0x24'),_0x2a19e4[_0x34c9('0x18')],_0x10ed70);_0x5832e3(_0x5c9bf6[_0x34c9('0x17')](0x1f4,_0x2a19e4[_0x34c9('0x18')]));});});};exports[_0x34c9('0x26')]=function(_0x38fa2a){var _0x3ed7c8=this;return new Promise(function(_0x244882,_0x3b40c6){return db[_0x34c9('0x1c')][_0x34c9('0x27')]({'raw':_0x38fa2a[_0x34c9('0x1e')]?_0x38fa2a['options'][_0x34c9('0x28')]===undefined?!![]:![]:!![],'where':_0x38fa2a['options']?_0x38fa2a[_0x34c9('0x1e')][_0x34c9('0x1f')]||null:null,'attributes':_0x38fa2a[_0x34c9('0x1e')]?_0x38fa2a[_0x34c9('0x1e')][_0x34c9('0x20')]||null:null,'include':_0x38fa2a[_0x34c9('0x1e')]?_0x38fa2a['options'][_0x34c9('0x21')]?_['map'](_0x38fa2a[_0x34c9('0x1e')][_0x34c9('0x21')],function(_0x2827c9){return{'model':db[_0x2827c9[_0x34c9('0x23')]],'as':_0x2827c9['as'],'attributes':_0x2827c9['attributes'],'include':_0x2827c9[_0x34c9('0x21')]?_[_0x34c9('0x22')](_0x2827c9[_0x34c9('0x21')],function(_0x1d75c8){return{'model':db[_0x1d75c8[_0x34c9('0x23')]],'as':_0x1d75c8['as'],'attributes':_0x1d75c8[_0x34c9('0x20')],'include':_0x1d75c8[_0x34c9('0x21')]?_[_0x34c9('0x22')](_0x1d75c8[_0x34c9('0x21')],function(_0xd3bf4e){return{'model':db[_0xd3bf4e[_0x34c9('0x23')]],'as':_0xd3bf4e['as'],'attributes':_0xd3bf4e[_0x34c9('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f2de1){logger[_0x34c9('0x19')](_0x34c9('0x26'),_0x38fa2a);logger['debug'](_0x34c9('0x26'),_0x38fa2a,JSON[_0x34c9('0x25')](_0x1f2de1));_0x244882(_0x1f2de1);})[_0x34c9('0x1b')](function(_0x25ac42){logger['error']('ShowMailQueue',_0x25ac42['message'],_0x38fa2a);_0x3b40c6(_0x3ed7c8['error'](0x1f4,_0x25ac42['message']));});});}; \ No newline at end of file +var _0xdb4a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueue','options','raw','where','attributes','include','model','map','GetMailQueue','ShowMailQueue','find'];(function(_0x26aba7,_0x3ac82e){var _0x1a1bd5=function(_0x5426a9){while(--_0x5426a9){_0x26aba7['push'](_0x26aba7['shift']());}};_0x1a1bd5(++_0x3ac82e);}(_0xdb4a,0x168));var _0xadb4=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xdb4a[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xadb4('0x0'));var util=require(_0xadb4('0x1'));var moment=require(_0xadb4('0x2'));var BPromise=require(_0xadb4('0x3'));var rs=require(_0xadb4('0x4'));var fs=require('fs');var Redis=require(_0xadb4('0x5'));var db=require(_0xadb4('0x6'))['db'];var utils=require(_0xadb4('0x7'));var logger=require(_0xadb4('0x8'))(_0xadb4('0x9'));var config=require(_0xadb4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xadb4('0xb')][_0xadb4('0xc')]({'port':0x232a});config[_0xadb4('0xd')]=_['defaults'](config[_0xadb4('0xd')],{'host':_0xadb4('0xe'),'port':0x18eb});var socket=require(_0xadb4('0xf'))(new Redis(config[_0xadb4('0xd')]));require('./mailQueue.socket')[_0xadb4('0x10')](socket);function respondWithRpcPromise(_0x50c051,_0x54ef0a,_0x24fb0d){return new BPromise(function(_0x41bd9b,_0x4cf2cf){return client[_0xadb4('0x11')](_0x50c051,_0x24fb0d)[_0xadb4('0x12')](function(_0x5e3f0a){logger[_0xadb4('0x13')](_0xadb4('0x14'),_0x54ef0a,'request\x20sent');logger[_0xadb4('0x15')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x54ef0a,'request\x20sent',JSON[_0xadb4('0x16')](_0x5e3f0a));if(_0x5e3f0a[_0xadb4('0x17')]){if(_0x5e3f0a[_0xadb4('0x17')][_0xadb4('0x18')]===0x1f4){logger['error'](_0xadb4('0x14'),_0x54ef0a,_0x5e3f0a['error']['message']);return _0x4cf2cf(_0x5e3f0a[_0xadb4('0x17')][_0xadb4('0x19')]);}logger[_0xadb4('0x17')](_0xadb4('0x14'),_0x54ef0a,_0x5e3f0a['error'][_0xadb4('0x19')]);return _0x41bd9b(_0x5e3f0a[_0xadb4('0x17')]['message']);}else{logger[_0xadb4('0x13')](_0xadb4('0x14'),_0x54ef0a,_0xadb4('0x1a'));_0x41bd9b(_0x5e3f0a[_0xadb4('0x1b')][_0xadb4('0x19')]);}})[_0xadb4('0x1c')](function(_0x2ba742){logger[_0xadb4('0x17')]('MailQueue,\x20%s,\x20%s',_0x54ef0a,_0x2ba742);_0x4cf2cf(_0x2ba742);});});}exports['GetMailQueue']=function(_0x2bc5b8){var _0x4c6f51=this;return new Promise(function(_0x463ef9,_0x1f96a4){return db[_0xadb4('0x1d')]['findAll']({'raw':_0x2bc5b8[_0xadb4('0x1e')]?_0x2bc5b8[_0xadb4('0x1e')][_0xadb4('0x1f')]===undefined?!![]:![]:!![],'where':_0x2bc5b8[_0xadb4('0x1e')]?_0x2bc5b8['options'][_0xadb4('0x20')]||null:null,'attributes':_0x2bc5b8['options']?_0x2bc5b8[_0xadb4('0x1e')][_0xadb4('0x21')]||null:null,'limit':_0x2bc5b8[_0xadb4('0x1e')]?_0x2bc5b8[_0xadb4('0x1e')]['limit']||null:null,'include':_0x2bc5b8[_0xadb4('0x1e')]?_0x2bc5b8[_0xadb4('0x1e')][_0xadb4('0x22')]?_['map'](_0x2bc5b8[_0xadb4('0x1e')][_0xadb4('0x22')],function(_0x2fe0d6){return{'model':db[_0x2fe0d6[_0xadb4('0x23')]],'as':_0x2fe0d6['as'],'attributes':_0x2fe0d6['attributes'],'include':_0x2fe0d6['include']?_[_0xadb4('0x24')](_0x2fe0d6[_0xadb4('0x22')],function(_0x6dad7f){return{'model':db[_0x6dad7f[_0xadb4('0x23')]],'as':_0x6dad7f['as'],'attributes':_0x6dad7f[_0xadb4('0x21')],'include':_0x6dad7f['include']?_[_0xadb4('0x24')](_0x6dad7f[_0xadb4('0x22')],function(_0x327f74){return{'model':db[_0x327f74[_0xadb4('0x23')]],'as':_0x327f74['as'],'attributes':_0x327f74[_0xadb4('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e9e54){logger[_0xadb4('0x13')](_0xadb4('0x25'),_0x2bc5b8);logger[_0xadb4('0x15')](_0xadb4('0x25'),_0x2bc5b8,JSON['stringify'](_0x3e9e54));_0x463ef9(_0x3e9e54);})[_0xadb4('0x1c')](function(_0x48bb3c){logger[_0xadb4('0x17')](_0xadb4('0x25'),_0x48bb3c[_0xadb4('0x19')],_0x2bc5b8);_0x1f96a4(_0x4c6f51['error'](0x1f4,_0x48bb3c[_0xadb4('0x19')]));});});};exports[_0xadb4('0x26')]=function(_0x5c79e6){var _0x21c1e1=this;return new Promise(function(_0x41e85f,_0x391def){return db[_0xadb4('0x1d')][_0xadb4('0x27')]({'raw':_0x5c79e6['options']?_0x5c79e6[_0xadb4('0x1e')][_0xadb4('0x1f')]===undefined?!![]:![]:!![],'where':_0x5c79e6[_0xadb4('0x1e')]?_0x5c79e6[_0xadb4('0x1e')]['where']||null:null,'attributes':_0x5c79e6[_0xadb4('0x1e')]?_0x5c79e6['options'][_0xadb4('0x21')]||null:null,'include':_0x5c79e6[_0xadb4('0x1e')]?_0x5c79e6[_0xadb4('0x1e')][_0xadb4('0x22')]?_['map'](_0x5c79e6[_0xadb4('0x1e')][_0xadb4('0x22')],function(_0x1127df){return{'model':db[_0x1127df[_0xadb4('0x23')]],'as':_0x1127df['as'],'attributes':_0x1127df[_0xadb4('0x21')],'include':_0x1127df[_0xadb4('0x22')]?_[_0xadb4('0x24')](_0x1127df[_0xadb4('0x22')],function(_0x2afb04){return{'model':db[_0x2afb04['model']],'as':_0x2afb04['as'],'attributes':_0x2afb04['attributes'],'include':_0x2afb04[_0xadb4('0x22')]?_[_0xadb4('0x24')](_0x2afb04['include'],function(_0x5519dd){return{'model':db[_0x5519dd[_0xadb4('0x23')]],'as':_0x5519dd['as'],'attributes':_0x5519dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xadb4('0x12')](function(_0x569916){logger['info']('ShowMailQueue',_0x5c79e6);logger[_0xadb4('0x15')]('ShowMailQueue',_0x5c79e6,JSON[_0xadb4('0x16')](_0x569916));_0x41e85f(_0x569916);})[_0xadb4('0x1c')](function(_0x1ebb1a){logger[_0xadb4('0x17')]('ShowMailQueue',_0x1ebb1a[_0xadb4('0x19')],_0x5c79e6);_0x391def(_0x21c1e1['error'](0x1f4,_0x1ebb1a[_0xadb4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 820477b..d1c1808 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 _0x07e0=['register','length','mailQueue:','./mailQueue.events','save','remove','removeListener'];(function(_0x32f03d,_0x2d6df1){var _0x194ce1=function(_0x2a658f){while(--_0x2a658f){_0x32f03d['push'](_0x32f03d['shift']());}};_0x194ce1(++_0x2d6df1);}(_0x07e0,0xc0));var _0x007e=function(_0x5ecfa8,_0x31ffdc){_0x5ecfa8=_0x5ecfa8-0x0;var _0x436bd3=_0x07e0[_0x5ecfa8];return _0x436bd3;};'use strict';var MailQueueEvents=require(_0x007e('0x0'));var events=[_0x007e('0x1'),_0x007e('0x2'),'update'];function createListener(_0x367c17,_0x21c4a2){return function(_0xe9740){_0x21c4a2['emit'](_0x367c17,_0xe9740);};}function removeListener(_0x4aa125,_0x49b028){return function(){MailQueueEvents[_0x007e('0x3')](_0x4aa125,_0x49b028);};}exports[_0x007e('0x4')]=function(_0x4d0ba9){for(var _0xd463bb=0x0,_0x38eb09=events[_0x007e('0x5')];_0xd463bb<_0x38eb09;_0xd463bb++){var _0x43daa0=events[_0xd463bb];var _0x1ec3c5=createListener(_0x007e('0x6')+_0x43daa0,_0x4d0ba9);MailQueueEvents['on'](_0x43daa0,_0x1ec3c5);}}; \ No newline at end of file +var _0xc47b=['mailQueue:','save','remove','update','emit','removeListener'];(function(_0x16446a,_0x5e9140){var _0x2c7051=function(_0x2e6a25){while(--_0x2e6a25){_0x16446a['push'](_0x16446a['shift']());}};_0x2c7051(++_0x5e9140);}(_0xc47b,0x10f));var _0xbc47=function(_0x20f7d7,_0x5431b8){_0x20f7d7=_0x20f7d7-0x0;var _0x373410=_0xc47b[_0x20f7d7];return _0x373410;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xbc47('0x0'),_0xbc47('0x1'),_0xbc47('0x2')];function createListener(_0x45d8fb,_0x28cfbe){return function(_0x584a5c){_0x28cfbe[_0xbc47('0x3')](_0x45d8fb,_0x584a5c);};}function removeListener(_0x5f2dfd,_0x1c7377){return function(){MailQueueEvents[_0xbc47('0x4')](_0x5f2dfd,_0x1c7377);};}exports['register']=function(_0x27a411){for(var _0x6be861=0x0,_0x19a664=events['length'];_0x6be861<_0x19a664;_0x6be861++){var _0x325c47=events[_0x6be861];var _0x394a4b=createListener(_0xbc47('0x5')+_0x325c47,_0x27a411);MailQueueEvents['on'](_0x325c47,_0x394a4b);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 93bae6d..f9aca32 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 _0x8211=['../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8211,0x104));var _0x1821=function(_0x1a9282,_0x3e324d){_0x1a9282=_0x1a9282-0x0;var _0x422b2a=_0x8211[_0x1a9282];return _0x422b2a;};'use strict';var multer=require(_0x1821('0x0'));var util=require(_0x1821('0x1'));var path=require(_0x1821('0x2'));var timeout=require(_0x1821('0x3'));var express=require(_0x1821('0x4'));var router=express[_0x1821('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1821('0x6'));var config=require(_0x1821('0x7'));var controller=require(_0x1821('0x8'));router[_0x1821('0x9')]('/',auth['isAuthenticated'](),controller[_0x1821('0xa')]);router['get'](_0x1821('0xb'),auth[_0x1821('0xc')](),controller['describe']);router['get'](_0x1821('0xd'),auth[_0x1821('0xc')](),controller['show']);router[_0x1821('0xe')]('/',auth[_0x1821('0xc')](),controller[_0x1821('0xf')]);router[_0x1821('0x10')](_0x1821('0xd'),auth[_0x1821('0xc')](),controller[_0x1821('0x11')]);router['delete'](_0x1821('0xd'),auth[_0x1821('0xc')](),controller[_0x1821('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc3b0=['isAuthenticated','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','describe','/:id'];(function(_0x21c70b,_0x10d7a3){var _0x466e8c=function(_0x5f0682){while(--_0x5f0682){_0x21c70b['push'](_0x21c70b['shift']());}};_0x466e8c(++_0x10d7a3);}(_0xc3b0,0x6b));var _0x0c3b=function(_0x4e7318,_0x582141){_0x4e7318=_0x4e7318-0x0;var _0x2fca72=_0xc3b0[_0x4e7318];return _0x2fca72;};'use strict';var multer=require(_0x0c3b('0x0'));var util=require(_0x0c3b('0x1'));var path=require(_0x0c3b('0x2'));var timeout=require(_0x0c3b('0x3'));var express=require('express');var router=express[_0x0c3b('0x4')]();var auth=require(_0x0c3b('0x5'));var interaction=require(_0x0c3b('0x6'));var config=require(_0x0c3b('0x7'));var controller=require(_0x0c3b('0x8'));router[_0x0c3b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0c3b('0x9')](_0x0c3b('0xa'),auth['isAuthenticated'](),controller[_0x0c3b('0xb')]);router[_0x0c3b('0x9')](_0x0c3b('0xc'),auth[_0x0c3b('0xd')](),controller[_0x0c3b('0xe')]);router[_0x0c3b('0xf')]('/',auth[_0x0c3b('0xd')](),controller[_0x0c3b('0x10')]);router[_0x0c3b('0x11')](_0x0c3b('0xc'),auth[_0x0c3b('0xd')](),controller['update']);router[_0x0c3b('0x12')](_0x0c3b('0xc'),auth['isAuthenticated'](),controller[_0x0c3b('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index d9803b8..86e0df9 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 _0xf045=['STRING','DATE','moment','sequelize'];(function(_0x1eb60b,_0x21d6a3){var _0x289c45=function(_0x5cc065){while(--_0x5cc065){_0x1eb60b['push'](_0x1eb60b['shift']());}};_0x289c45(++_0x21d6a3);}(_0xf045,0x1c2));var _0x5f04=function(_0x4b8021,_0x11dd37){_0x4b8021=_0x4b8021-0x0;var _0x36d34d=_0xf045[_0x4b8021];return _0x36d34d;};'use strict';var moment=require(_0x5f04('0x0'));var Sequelize=require(_0x5f04('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5f04('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5f04('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5f04('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5f04('0x2')]}}; \ No newline at end of file +var _0x5e46=['STRING','DATE','moment','sequelize'];(function(_0x1eaa74,_0xcbbafc){var _0x2fd0e0=function(_0x14eafa){while(--_0x14eafa){_0x1eaa74['push'](_0x1eaa74['shift']());}};_0x2fd0e0(++_0xcbbafc);}(_0x5e46,0x7e));var _0x65e4=function(_0x26069a,_0x137a46){_0x26069a=_0x26069a-0x0;var _0x2c0c7d=_0x5e46[_0x26069a];return _0x2c0c7d;};'use strict';var moment=require(_0x65e4('0x0'));var Sequelize=require(_0x65e4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x65e4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x65e4('0x2')]},'joinAt':{'type':Sequelize[_0x65e4('0x3')]},'leaveAt':{'type':Sequelize[_0x65e4('0x3')]},'acceptAt':{'type':Sequelize[_0x65e4('0x3')]},'exitAt':{'type':Sequelize[_0x65e4('0x3')]},'reason':{'type':Sequelize[_0x65e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index a44e844..08aa6f2 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 _0x1bef=['type','key','VIRTUAL','filter','count','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','status','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','MailQueueReport','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','map'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x1bef,0xa5));var _0xf1be=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1bef[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xf1be('0x0'));var emlformat=require(_0xf1be('0x1'));var rimraf=require(_0xf1be('0x2'));var zipdir=require(_0xf1be('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1be('0x4'));var moment=require(_0xf1be('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf1be('0x6'));var util=require(_0xf1be('0x7'));var path=require(_0xf1be('0x8'));var sox=require(_0xf1be('0x9'));var csv=require(_0xf1be('0xa'));var ejs=require(_0xf1be('0xb'));var fs=require('fs');var _=require(_0xf1be('0xc'));var squel=require(_0xf1be('0xd'));var crypto=require('crypto');var jsforce=require(_0xf1be('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf1be('0xf'));var Papa=require(_0xf1be('0x10'));var Redis=require(_0xf1be('0x11'));var authService=require(_0xf1be('0x12'));var qs=require(_0xf1be('0x13'));var hardwareService=require(_0xf1be('0x14'));var logger=require('../../config/logger')(_0xf1be('0x15'));var utils=require(_0xf1be('0x16'));var config=require(_0xf1be('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x237b15,_0x5cab9a){_0x5cab9a=_0x5cab9a||0xcc;return function(_0x52d65e){if(_0x52d65e){return _0x237b15[_0xf1be('0x18')](_0x5cab9a);}return _0x237b15['status'](_0x5cab9a)[_0xf1be('0x19')]();};}function respondWithResult(_0x321155,_0x30224b){_0x30224b=_0x30224b||0xc8;return function(_0x759d28){if(_0x759d28){return _0x321155['status'](_0x30224b)[_0xf1be('0x1a')](_0x759d28);}};}function respondWithFilteredResult(_0x2c8acd,_0x526f99){return function(_0x4908ef){if(_0x4908ef){var _0x273a90=_0x4908ef['count'],_0x5d0c6c=_0x526f99[_0xf1be('0x1b')],_0x531ca9=_0x526f99[_0xf1be('0x1b')]+_0x526f99['limit'],_0x224f4c;if(_0x531ca9>=_0x273a90){_0x531ca9=_0x273a90;_0x224f4c=0xc8;}else{_0x224f4c=0xce;}_0x2c8acd[_0xf1be('0x1c')](_0x224f4c);return _0x2c8acd[_0xf1be('0x1d')](_0xf1be('0x1e'),_0x5d0c6c+'-'+_0x531ca9+'/'+_0x273a90)[_0xf1be('0x1a')](_0x4908ef);}return null;};}function patchUpdates(_0x2e8c2f){return function(_0x3608aa){try{jsonpatch[_0xf1be('0x1f')](_0x3608aa,_0x2e8c2f,!![]);}catch(_0x519edf){return BPromise['reject'](_0x519edf);}return _0x3608aa[_0xf1be('0x20')]();};}function saveUpdates(_0x3ad76d,_0x5aa908){return function(_0x44d7ce){if(_0x44d7ce){return _0x44d7ce[_0xf1be('0x21')](_0x3ad76d)['then'](function(_0x48db7e){return _0x48db7e;});}return null;};}function removeEntity(_0x282d56,_0x1becb4){return function(_0x1caca0){if(_0x1caca0){return _0x1caca0[_0xf1be('0x22')]()[_0xf1be('0x23')](function(){_0x282d56[_0xf1be('0x1c')](0xcc)[_0xf1be('0x19')]();});}};}function handleEntityNotFound(_0x58c526,_0x4a3468){return function(_0x436d81){if(!_0x436d81){_0x58c526[_0xf1be('0x18')](0x194);}return _0x436d81;};}function handleError(_0x55aaa9,_0x59650a){_0x59650a=_0x59650a||0x1f4;return function(_0x3194c3){logger[_0xf1be('0x24')](_0x3194c3[_0xf1be('0x25')]);if(_0x3194c3[_0xf1be('0x26')]){delete _0x3194c3['name'];}_0x55aaa9['status'](_0x59650a)[_0xf1be('0x27')](_0x3194c3);};}exports['index']=function(_0x59549c,_0x30697d){var _0x475183={},_0x4b5bd0={},_0x13cedf={'count':0x0,'rows':[]};var _0x250ee0=db[_0xf1be('0x28')]['rawAttributes'];_0x4b5bd0['model']=_[_0xf1be('0x29')](_0x250ee0);_0x4b5bd0['query']=_['keys'](_0x59549c[_0xf1be('0x2a')]);_0x4b5bd0[_0xf1be('0x2b')]=_[_0xf1be('0x2c')](_0x4b5bd0[_0xf1be('0x2d')],_0x4b5bd0[_0xf1be('0x2a')]);_0x475183['attributes']=_[_0xf1be('0x2c')](_0x4b5bd0[_0xf1be('0x2d')],qs[_0xf1be('0x2e')](_0x59549c[_0xf1be('0x2a')][_0xf1be('0x2e')]));_0x475183[_0xf1be('0x2f')]=_0x475183[_0xf1be('0x2f')][_0xf1be('0x30')]?_0x475183[_0xf1be('0x2f')]:_0x4b5bd0['model'];if(!_0x59549c['query'][_0xf1be('0x31')](_0xf1be('0x32'))){_0x475183[_0xf1be('0x33')]=qs[_0xf1be('0x33')](_0x59549c[_0xf1be('0x2a')][_0xf1be('0x33')]);_0x475183['offset']=qs[_0xf1be('0x1b')](_0x59549c[_0xf1be('0x2a')][_0xf1be('0x1b')]);}_0x475183[_0xf1be('0x34')]=qs[_0xf1be('0x35')](_0x59549c['query']['sort']);_0x475183[_0xf1be('0x36')]=qs[_0xf1be('0x2b')](_['pick'](_0x59549c[_0xf1be('0x2a')],_0x4b5bd0[_0xf1be('0x2b')]));if(_0x59549c[_0xf1be('0x2a')]['filter']){_0x475183['where']=_[_0xf1be('0x37')](_0x475183['where'],{'$or':_[_0xf1be('0x38')](_0x250ee0,function(_0xa38287){if(_0xa38287[_0xf1be('0x39')][_0xf1be('0x3a')]!==_0xf1be('0x3b')){var _0x163ad3={};_0x163ad3[_0xa38287['field']]={'$like':'%'+_0x59549c[_0xf1be('0x2a')][_0xf1be('0x3c')]+'%'};return _0x163ad3;}})});}_0x475183=_['merge']({},_0x475183,_0x59549c['options']);var _0xa18109={'where':_0x475183[_0xf1be('0x36')]};return db[_0xf1be('0x28')][_0xf1be('0x3d')](_0xa18109)[_0xf1be('0x23')](function(_0x11cc6c){_0x13cedf[_0xf1be('0x3d')]=_0x11cc6c;if(_0x59549c[_0xf1be('0x2a')]['includeAll']){_0x475183[_0xf1be('0x3e')]=[{'all':!![]}];}return db[_0xf1be('0x28')][_0xf1be('0x3f')](_0x475183);})[_0xf1be('0x23')](function(_0x39c10d){_0x13cedf[_0xf1be('0x40')]=_0x39c10d;return _0x13cedf;})['then'](respondWithFilteredResult(_0x30697d,_0x475183))[_0xf1be('0x41')](handleError(_0x30697d,null));};exports[_0xf1be('0x42')]=function(_0xba8c58,_0x730634){var _0x46eb7c={'raw':!![],'where':{'id':_0xba8c58[_0xf1be('0x43')]['id']}},_0x57b112={};_0x57b112[_0xf1be('0x2d')]=_[_0xf1be('0x29')](db['MailQueueReport'][_0xf1be('0x44')]);_0x57b112[_0xf1be('0x2a')]=_['keys'](_0xba8c58[_0xf1be('0x2a')]);_0x57b112[_0xf1be('0x2b')]=_[_0xf1be('0x2c')](_0x57b112[_0xf1be('0x2d')],_0x57b112['query']);_0x46eb7c[_0xf1be('0x2f')]=_[_0xf1be('0x2c')](_0x57b112[_0xf1be('0x2d')],qs[_0xf1be('0x2e')](_0xba8c58[_0xf1be('0x2a')][_0xf1be('0x2e')]));_0x46eb7c[_0xf1be('0x2f')]=_0x46eb7c[_0xf1be('0x2f')][_0xf1be('0x30')]?_0x46eb7c['attributes']:_0x57b112[_0xf1be('0x2d')];if(_0xba8c58[_0xf1be('0x2a')]['includeAll']){_0x46eb7c[_0xf1be('0x3e')]=[{'all':!![]}];}_0x46eb7c=_[_0xf1be('0x37')]({},_0x46eb7c,_0xba8c58[_0xf1be('0x45')]);return db[_0xf1be('0x28')]['find'](_0x46eb7c)[_0xf1be('0x23')](handleEntityNotFound(_0x730634,null))['then'](respondWithResult(_0x730634,null))['catch'](handleError(_0x730634,null));};exports[_0xf1be('0x46')]=function(_0x2f723f,_0x3b06f6){return db[_0xf1be('0x28')][_0xf1be('0x46')](_0x2f723f[_0xf1be('0x47')],{})[_0xf1be('0x23')](respondWithResult(_0x3b06f6,0xc9))['catch'](handleError(_0x3b06f6,null));};exports[_0xf1be('0x21')]=function(_0x439e28,_0x29195a){if(_0x439e28[_0xf1be('0x47')]['id']){delete _0x439e28[_0xf1be('0x47')]['id'];}return db[_0xf1be('0x28')][_0xf1be('0x48')]({'where':{'id':_0x439e28[_0xf1be('0x43')]['id']}})[_0xf1be('0x23')](handleEntityNotFound(_0x29195a,null))[_0xf1be('0x23')](saveUpdates(_0x439e28[_0xf1be('0x47')],null))[_0xf1be('0x23')](respondWithResult(_0x29195a,null))['catch'](handleError(_0x29195a,null));};exports[_0xf1be('0x22')]=function(_0x36afde,_0x14b7da){return db['MailQueueReport'][_0xf1be('0x48')]({'where':{'id':_0x36afde[_0xf1be('0x43')]['id']}})[_0xf1be('0x23')](handleEntityNotFound(_0x14b7da,null))['then'](removeEntity(_0x14b7da,null))[_0xf1be('0x41')](handleError(_0x14b7da,null));};exports[_0xf1be('0x49')]=function(_0x1a0f4c,_0x490a8b){return db['MailQueueReport'][_0xf1be('0x49')]()['then'](respondWithResult(_0x490a8b,null))['catch'](handleError(_0x490a8b,null));}; \ No newline at end of file +var _0x050a=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','field','options','MailQueueReport','count','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','index','model','keys','query','intersection'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x050a,0x179));var _0xa050=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x050a[_0x4b369d];return _0x571a98;};'use strict';var pdf=require(_0xa050('0x0'));var emlformat=require(_0xa050('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa050('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa050('0x3'));var moment=require(_0xa050('0x4'));var BPromise=require(_0xa050('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa050('0x6'));var sox=require(_0xa050('0x7'));var csv=require(_0xa050('0x8'));var ejs=require(_0xa050('0x9'));var fs=require('fs');var _=require(_0xa050('0xa'));var squel=require(_0xa050('0xb'));var crypto=require('crypto');var jsforce=require(_0xa050('0xc'));var deskjs=require(_0xa050('0xd'));var toCsv=require(_0xa050('0x8'));var querystring=require(_0xa050('0xe'));var Papa=require(_0xa050('0xf'));var Redis=require(_0xa050('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa050('0x11'));var hardwareService=require(_0xa050('0x12'));var logger=require(_0xa050('0x13'))(_0xa050('0x14'));var utils=require(_0xa050('0x15'));var config=require(_0xa050('0x16'));var db=require(_0xa050('0x17'))['db'];function respondWithStatusCode(_0x2eea3,_0x4016f5){_0x4016f5=_0x4016f5||0xcc;return function(_0x36c5be){if(_0x36c5be){return _0x2eea3[_0xa050('0x18')](_0x4016f5);}return _0x2eea3[_0xa050('0x19')](_0x4016f5)[_0xa050('0x1a')]();};}function respondWithResult(_0x33ae59,_0x4c8bf5){_0x4c8bf5=_0x4c8bf5||0xc8;return function(_0x3f481c){if(_0x3f481c){return _0x33ae59[_0xa050('0x19')](_0x4c8bf5)[_0xa050('0x1b')](_0x3f481c);}};}function respondWithFilteredResult(_0x59b22d,_0x2a7f20){return function(_0x420554){if(_0x420554){var _0xa83aca=_0x420554['count'],_0x18c70d=_0x2a7f20[_0xa050('0x1c')],_0x4bf67a=_0x2a7f20[_0xa050('0x1c')]+_0x2a7f20[_0xa050('0x1d')],_0x504f55;if(_0x4bf67a>=_0xa83aca){_0x4bf67a=_0xa83aca;_0x504f55=0xc8;}else{_0x504f55=0xce;}_0x59b22d[_0xa050('0x19')](_0x504f55);return _0x59b22d[_0xa050('0x1e')](_0xa050('0x1f'),_0x18c70d+'-'+_0x4bf67a+'/'+_0xa83aca)[_0xa050('0x1b')](_0x420554);}return null;};}function patchUpdates(_0x1df225){return function(_0x55b7ca){try{jsonpatch[_0xa050('0x20')](_0x55b7ca,_0x1df225,!![]);}catch(_0x391edd){return BPromise['reject'](_0x391edd);}return _0x55b7ca['save']();};}function saveUpdates(_0x5a419b,_0x36461e){return function(_0x6b3a8d){if(_0x6b3a8d){return _0x6b3a8d[_0xa050('0x21')](_0x5a419b)[_0xa050('0x22')](function(_0xcaa37b){return _0xcaa37b;});}return null;};}function removeEntity(_0x3bc74d,_0x3fb40d){return function(_0x31a530){if(_0x31a530){return _0x31a530[_0xa050('0x23')]()['then'](function(){_0x3bc74d[_0xa050('0x19')](0xcc)[_0xa050('0x1a')]();});}};}function handleEntityNotFound(_0x1c910b,_0x5146f8){return function(_0x3f445b){if(!_0x3f445b){_0x1c910b[_0xa050('0x18')](0x194);}return _0x3f445b;};}function handleError(_0x21bcd3,_0x431358){_0x431358=_0x431358||0x1f4;return function(_0x29d171){logger['error'](_0x29d171[_0xa050('0x24')]);if(_0x29d171[_0xa050('0x25')]){delete _0x29d171[_0xa050('0x25')];}_0x21bcd3[_0xa050('0x19')](_0x431358)['send'](_0x29d171);};}exports[_0xa050('0x26')]=function(_0x181d43,_0x1eca72){var _0x28e0f1={},_0xc848dd={},_0xf6d3c0={'count':0x0,'rows':[]};var _0xb9945d=db['MailQueueReport']['rawAttributes'];_0xc848dd[_0xa050('0x27')]=_[_0xa050('0x28')](_0xb9945d);_0xc848dd[_0xa050('0x29')]=_[_0xa050('0x28')](_0x181d43[_0xa050('0x29')]);_0xc848dd['filters']=_[_0xa050('0x2a')](_0xc848dd[_0xa050('0x27')],_0xc848dd['query']);_0x28e0f1[_0xa050('0x2b')]=_[_0xa050('0x2a')](_0xc848dd[_0xa050('0x27')],qs['fields'](_0x181d43[_0xa050('0x29')][_0xa050('0x2c')]));_0x28e0f1[_0xa050('0x2b')]=_0x28e0f1[_0xa050('0x2b')][_0xa050('0x2d')]?_0x28e0f1['attributes']:_0xc848dd[_0xa050('0x27')];if(!_0x181d43[_0xa050('0x29')][_0xa050('0x2e')]('nolimit')){_0x28e0f1[_0xa050('0x1d')]=qs[_0xa050('0x1d')](_0x181d43['query']['limit']);_0x28e0f1['offset']=qs[_0xa050('0x1c')](_0x181d43[_0xa050('0x29')]['offset']);}_0x28e0f1[_0xa050('0x2f')]=qs[_0xa050('0x30')](_0x181d43['query'][_0xa050('0x30')]);_0x28e0f1[_0xa050('0x31')]=qs['filters'](_[_0xa050('0x32')](_0x181d43[_0xa050('0x29')],_0xc848dd[_0xa050('0x33')]));if(_0x181d43[_0xa050('0x29')][_0xa050('0x34')]){_0x28e0f1[_0xa050('0x31')]=_[_0xa050('0x35')](_0x28e0f1[_0xa050('0x31')],{'$or':_['map'](_0xb9945d,function(_0x5370d1){if(_0x5370d1[_0xa050('0x36')]['key']!==_0xa050('0x37')){var _0x4625cb={};_0x4625cb[_0x5370d1[_0xa050('0x38')]]={'$like':'%'+_0x181d43['query'][_0xa050('0x34')]+'%'};return _0x4625cb;}})});}_0x28e0f1=_[_0xa050('0x35')]({},_0x28e0f1,_0x181d43[_0xa050('0x39')]);var _0x5b17b5={'where':_0x28e0f1[_0xa050('0x31')]};return db[_0xa050('0x3a')][_0xa050('0x3b')](_0x5b17b5)[_0xa050('0x22')](function(_0x35f208){_0xf6d3c0[_0xa050('0x3b')]=_0x35f208;if(_0x181d43[_0xa050('0x29')]['includeAll']){_0x28e0f1[_0xa050('0x3c')]=[{'all':!![]}];}return db['MailQueueReport'][_0xa050('0x3d')](_0x28e0f1);})[_0xa050('0x22')](function(_0x137df5){_0xf6d3c0[_0xa050('0x3e')]=_0x137df5;return _0xf6d3c0;})[_0xa050('0x22')](respondWithFilteredResult(_0x1eca72,_0x28e0f1))[_0xa050('0x3f')](handleError(_0x1eca72,null));};exports[_0xa050('0x40')]=function(_0x4679e9,_0x557777){var _0xa84a3a={'raw':!![],'where':{'id':_0x4679e9[_0xa050('0x41')]['id']}},_0x1cf316={};_0x1cf316['model']=_[_0xa050('0x28')](db['MailQueueReport']['rawAttributes']);_0x1cf316[_0xa050('0x29')]=_[_0xa050('0x28')](_0x4679e9[_0xa050('0x29')]);_0x1cf316[_0xa050('0x33')]=_[_0xa050('0x2a')](_0x1cf316[_0xa050('0x27')],_0x1cf316[_0xa050('0x29')]);_0xa84a3a['attributes']=_[_0xa050('0x2a')](_0x1cf316[_0xa050('0x27')],qs[_0xa050('0x2c')](_0x4679e9['query'][_0xa050('0x2c')]));_0xa84a3a[_0xa050('0x2b')]=_0xa84a3a[_0xa050('0x2b')][_0xa050('0x2d')]?_0xa84a3a[_0xa050('0x2b')]:_0x1cf316['model'];if(_0x4679e9['query']['includeAll']){_0xa84a3a[_0xa050('0x3c')]=[{'all':!![]}];}_0xa84a3a=_[_0xa050('0x35')]({},_0xa84a3a,_0x4679e9[_0xa050('0x39')]);return db[_0xa050('0x3a')][_0xa050('0x42')](_0xa84a3a)[_0xa050('0x22')](handleEntityNotFound(_0x557777,null))['then'](respondWithResult(_0x557777,null))[_0xa050('0x3f')](handleError(_0x557777,null));};exports['create']=function(_0xed7d41,_0x27306c){return db[_0xa050('0x3a')][_0xa050('0x43')](_0xed7d41[_0xa050('0x44')],{})['then'](respondWithResult(_0x27306c,0xc9))[_0xa050('0x3f')](handleError(_0x27306c,null));};exports[_0xa050('0x21')]=function(_0x3a3c70,_0x7f2d7d){if(_0x3a3c70['body']['id']){delete _0x3a3c70[_0xa050('0x44')]['id'];}return db[_0xa050('0x3a')]['find']({'where':{'id':_0x3a3c70[_0xa050('0x41')]['id']}})['then'](handleEntityNotFound(_0x7f2d7d,null))[_0xa050('0x22')](saveUpdates(_0x3a3c70[_0xa050('0x44')],null))['then'](respondWithResult(_0x7f2d7d,null))[_0xa050('0x3f')](handleError(_0x7f2d7d,null));};exports['destroy']=function(_0x3956cb,_0x386693){return db[_0xa050('0x3a')][_0xa050('0x42')]({'where':{'id':_0x3956cb[_0xa050('0x41')]['id']}})[_0xa050('0x22')](handleEntityNotFound(_0x386693,null))[_0xa050('0x22')](removeEntity(_0x386693,null))[_0xa050('0x3f')](handleError(_0x386693,null));};exports[_0xa050('0x45')]=function(_0x63e28d,_0x3200de){return db[_0xa050('0x3a')][_0xa050('0x45')]()[_0xa050('0x22')](respondWithResult(_0x3200de,null))[_0xa050('0x3f')](handleError(_0x3200de,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 7ecc497..9799b5e 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 _0xdb94=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','./mailQueueReport.attributes','MailQueueReport'];(function(_0x5b4018,_0x1fd4ba){var _0x531f0b=function(_0x481b91){while(--_0x481b91){_0x5b4018['push'](_0x5b4018['shift']());}};_0x531f0b(++_0x1fd4ba);}(_0xdb94,0xab));var _0x4db9=function(_0x4755e4,_0xe702a3){_0x4755e4=_0x4755e4-0x0;var _0x48ec95=_0xdb94[_0x4755e4];return _0x48ec95;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require(_0x4db9('0x2'))(_0x4db9('0x3'));var moment=require(_0x4db9('0x4'));var BPromise=require('bluebird');var rp=require(_0x4db9('0x5'));var fs=require('fs');var path=require(_0x4db9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4db9('0x7'));module['exports']=function(_0x47a3f5,_0x31dd9f){return _0x47a3f5['define'](_0x4db9('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x4db9('0x9'),'fields':[_0x4db9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0972=['uniqueid','util','api','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue'];(function(_0x178d24,_0x1f9676){var _0x1db6f9=function(_0x4443ba){while(--_0x4443ba){_0x178d24['push'](_0x178d24['shift']());}};_0x1db6f9(++_0x1f9676);}(_0x0972,0x64));var _0x2097=function(_0x55e57b,_0x24cbd7){_0x55e57b=_0x55e57b-0x0;var _0xf0a16=_0x0972[_0x55e57b];return _0xf0a16;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('MailQueueReport',attributes,{'tableName':_0x2097('0x9'),'paranoid':![],'indexes':[{'name':_0x2097('0xa'),'fields':[_0x2097('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index c239548..17552e3 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 _0x7284=['message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5cb112,_0x5951bd){var _0x462d92=function(_0x29c0d0){while(--_0x29c0d0){_0x5cb112['push'](_0x5cb112['shift']());}};_0x462d92(++_0x5951bd);}(_0x7284,0x183));var _0x4728=function(_0x29a3ab,_0x3d0293){_0x29a3ab=_0x29a3ab-0x0;var _0xd192ff=_0x7284[_0x29a3ab];return _0xd192ff;};'use strict';var _=require(_0x4728('0x0'));var util=require(_0x4728('0x1'));var moment=require(_0x4728('0x2'));var BPromise=require(_0x4728('0x3'));var rs=require(_0x4728('0x4'));var fs=require('fs');var Redis=require(_0x4728('0x5'));var db=require(_0x4728('0x6'))['db'];var utils=require(_0x4728('0x7'));var logger=require(_0x4728('0x8'))(_0x4728('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4728('0xa')][_0x4728('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3232ec,_0x216bf9,_0x3c31a4){return new BPromise(function(_0x39f12f,_0x540a77){return client[_0x4728('0xc')](_0x3232ec,_0x3c31a4)['then'](function(_0x1f0cc3){logger[_0x4728('0xd')](_0x4728('0xe'),_0x216bf9,_0x4728('0xf'));logger[_0x4728('0x10')](_0x4728('0x11'),_0x216bf9,_0x4728('0xf'),JSON[_0x4728('0x12')](_0x1f0cc3));if(_0x1f0cc3[_0x4728('0x13')]){if(_0x1f0cc3[_0x4728('0x13')][_0x4728('0x14')]===0x1f4){logger[_0x4728('0x13')](_0x4728('0xe'),_0x216bf9,_0x1f0cc3[_0x4728('0x13')][_0x4728('0x15')]);return _0x540a77(_0x1f0cc3['error'][_0x4728('0x15')]);}logger[_0x4728('0x13')](_0x4728('0xe'),_0x216bf9,_0x1f0cc3[_0x4728('0x13')][_0x4728('0x15')]);return _0x39f12f(_0x1f0cc3[_0x4728('0x13')]['message']);}else{logger[_0x4728('0xd')](_0x4728('0xe'),_0x216bf9,_0x4728('0xf'));_0x39f12f(_0x1f0cc3[_0x4728('0x16')][_0x4728('0x15')]);}})[_0x4728('0x17')](function(_0x3da3ed){logger[_0x4728('0x13')](_0x4728('0xe'),_0x216bf9,_0x3da3ed);_0x540a77(_0x3da3ed);});});}exports[_0x4728('0x18')]=function(_0x56aaa3){var _0x39e47e=this;return new Promise(function(_0x45a5f7,_0xc0cd4){return db[_0x4728('0x19')][_0x4728('0x1a')](_0x56aaa3[_0x4728('0x1b')],{'raw':_0x56aaa3[_0x4728('0x1c')]?_0x56aaa3['options'][_0x4728('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xebc4b7){logger[_0x4728('0xd')](_0x4728('0x18'),_0x56aaa3);logger[_0x4728('0x10')](_0x4728('0x18'),_0x56aaa3,JSON[_0x4728('0x12')](_0xebc4b7));_0x45a5f7(_0xebc4b7);})[_0x4728('0x17')](function(_0x3bfc6e){logger[_0x4728('0x13')](_0x4728('0x18'),_0x3bfc6e[_0x4728('0x15')],_0x56aaa3);_0xc0cd4(_0x39e47e[_0x4728('0x13')](0x1f4,_0x3bfc6e[_0x4728('0x15')]));});});};exports[_0x4728('0x1e')]=function(_0x400347){var _0x4c9ddc=this;return new Promise(function(_0x7fe0f5,_0x233629){return db['MailQueueReport'][_0x4728('0x1f')](_0x400347[_0x4728('0x1b')],{'raw':_0x400347[_0x4728('0x1c')]?_0x400347[_0x4728('0x1c')][_0x4728('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x400347['options']?_0x400347[_0x4728('0x1c')]['where']||null:null,'attributes':_0x400347[_0x4728('0x1c')]?_0x400347[_0x4728('0x1c')][_0x4728('0x20')]||null:null,'limit':_0x400347[_0x4728('0x1c')]?_0x400347[_0x4728('0x1c')]['limit']||null:null})[_0x4728('0x21')](function(_0x99e377){logger[_0x4728('0xd')](_0x4728('0x1e'),_0x400347);logger['debug'](_0x4728('0x1e'),_0x400347,JSON['stringify'](_0x99e377));_0x7fe0f5(_0x99e377);})[_0x4728('0x17')](function(_0x543124){logger[_0x4728('0x13')](_0x4728('0x1e'),_0x543124[_0x4728('0x15')],_0x400347);_0x233629(_0x4c9ddc[_0x4728('0x13')](0x1f4,_0x543124['message']));});});}; \ No newline at end of file +var _0x3b85=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','MailQueueReport','body','options','raw','CreateMailQueueReport','debug','update','attributes','then','UpdateMailQueueReport','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dd86b,_0x18a5c0){var _0x250064=function(_0x2d19cd){while(--_0x2d19cd){_0x2dd86b['push'](_0x2dd86b['shift']());}};_0x250064(++_0x18a5c0);}(_0x3b85,0x1c7));var _0x53b8=function(_0x250d03,_0x58bf35){_0x250d03=_0x250d03-0x0;var _0x44accb=_0x3b85[_0x250d03];return _0x44accb;};'use strict';var _=require(_0x53b8('0x0'));var util=require(_0x53b8('0x1'));var moment=require(_0x53b8('0x2'));var BPromise=require('bluebird');var rs=require(_0x53b8('0x3'));var fs=require('fs');var Redis=require(_0x53b8('0x4'));var db=require(_0x53b8('0x5'))['db'];var utils=require(_0x53b8('0x6'));var logger=require(_0x53b8('0x7'))(_0x53b8('0x8'));var config=require(_0x53b8('0x9'));var jayson=require(_0x53b8('0xa'));var client=jayson[_0x53b8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40c821,_0x4a5f22,_0x5a1c06){return new BPromise(function(_0x31d6eb,_0x2eabd0){return client[_0x53b8('0xc')](_0x40c821,_0x5a1c06)['then'](function(_0x14c869){logger[_0x53b8('0xd')](_0x53b8('0xe'),_0x4a5f22,_0x53b8('0xf'));logger['debug'](_0x53b8('0x10'),_0x4a5f22,_0x53b8('0xf'),JSON['stringify'](_0x14c869));if(_0x14c869[_0x53b8('0x11')]){if(_0x14c869['error'][_0x53b8('0x12')]===0x1f4){logger[_0x53b8('0x11')](_0x53b8('0xe'),_0x4a5f22,_0x14c869[_0x53b8('0x11')][_0x53b8('0x13')]);return _0x2eabd0(_0x14c869[_0x53b8('0x11')][_0x53b8('0x13')]);}logger[_0x53b8('0x11')](_0x53b8('0xe'),_0x4a5f22,_0x14c869[_0x53b8('0x11')][_0x53b8('0x13')]);return _0x31d6eb(_0x14c869[_0x53b8('0x11')][_0x53b8('0x13')]);}else{logger['info'](_0x53b8('0xe'),_0x4a5f22,_0x53b8('0xf'));_0x31d6eb(_0x14c869[_0x53b8('0x14')][_0x53b8('0x13')]);}})['catch'](function(_0x4acf95){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4a5f22,_0x4acf95);_0x2eabd0(_0x4acf95);});});}exports['CreateMailQueueReport']=function(_0x44e431){var _0x2f59d4=this;return new Promise(function(_0x9f36a8,_0x23053f){return db[_0x53b8('0x15')]['create'](_0x44e431[_0x53b8('0x16')],{'raw':_0x44e431[_0x53b8('0x17')]?_0x44e431[_0x53b8('0x17')][_0x53b8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5619ae){logger[_0x53b8('0xd')](_0x53b8('0x19'),_0x44e431);logger[_0x53b8('0x1a')]('CreateMailQueueReport',_0x44e431,JSON['stringify'](_0x5619ae));_0x9f36a8(_0x5619ae);})['catch'](function(_0x10c9dd){logger['error']('CreateMailQueueReport',_0x10c9dd[_0x53b8('0x13')],_0x44e431);_0x23053f(_0x2f59d4[_0x53b8('0x11')](0x1f4,_0x10c9dd[_0x53b8('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x25a2f9){var _0x1600f7=this;return new Promise(function(_0xe25a29,_0x5e608c){return db[_0x53b8('0x15')][_0x53b8('0x1b')](_0x25a2f9[_0x53b8('0x16')],{'raw':_0x25a2f9[_0x53b8('0x17')]?_0x25a2f9[_0x53b8('0x17')][_0x53b8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25a2f9[_0x53b8('0x17')]?_0x25a2f9['options']['where']||null:null,'attributes':_0x25a2f9[_0x53b8('0x17')]?_0x25a2f9['options'][_0x53b8('0x1c')]||null:null,'limit':_0x25a2f9[_0x53b8('0x17')]?_0x25a2f9[_0x53b8('0x17')]['limit']||null:null})[_0x53b8('0x1d')](function(_0x234eae){logger['info']('UpdateMailQueueReport',_0x25a2f9);logger[_0x53b8('0x1a')](_0x53b8('0x1e'),_0x25a2f9,JSON[_0x53b8('0x1f')](_0x234eae));_0xe25a29(_0x234eae);})[_0x53b8('0x20')](function(_0x1636e0){logger[_0x53b8('0x11')](_0x53b8('0x1e'),_0x1636e0[_0x53b8('0x13')],_0x25a2f9);_0x5e608c(_0x1600f7[_0x53b8('0x11')](0x1f4,_0x1636e0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 3aaa362..95be39b 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 _0x0a1c=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','exports'];(function(_0x2ad1ab,_0x444a29){var _0x5a48f3=function(_0x564f0c){while(--_0x564f0c){_0x2ad1ab['push'](_0x2ad1ab['shift']());}};_0x5a48f3(++_0x444a29);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x0a1c[_0x3042c5];return _0x7cd140;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc0a1('0x0'));var timeout=require(_0xc0a1('0x1'));var express=require(_0xc0a1('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc0a1('0x3'));var config=require(_0xc0a1('0x4'));module[_0xc0a1('0x5')]=router; \ No newline at end of file +var _0xdb70=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xdb70,0xa0));var _0x0db7=function(_0x16e50e,_0x396f34){_0x16e50e=_0x16e50e-0x0;var _0x56dd4a=_0xdb70[_0x16e50e];return _0x56dd4a;};'use strict';var multer=require(_0x0db7('0x0'));var util=require(_0x0db7('0x1'));var path=require(_0x0db7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0db7('0x3'));var router=express[_0x0db7('0x4')]();var auth=require(_0x0db7('0x5'));var interaction=require(_0x0db7('0x6'));var config=require(_0x0db7('0x7'));module[_0x0db7('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 96576a3..d1ab235 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 _0x9c00=['INTEGER','INBOX','sequelize','exports','BOOLEAN','STRING'];(function(_0x3333b9,_0x457add){var _0x2cd74e=function(_0x3c8456){while(--_0x3c8456){_0x3333b9['push'](_0x3333b9['shift']());}};_0x2cd74e(++_0x457add);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4ca3b4,_0x2450bc){_0x4ca3b4=_0x4ca3b4-0x0;var _0x51ea64=_0x9c00[_0x4ca3b4];return _0x51ea64;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x09c0('0x3')],'unique':'username'},'password':{'type':Sequelize[_0x09c0('0x3')]},'port':{'type':Sequelize[_0x09c0('0x4')]},'tls':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':_0x09c0('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x09c0('0x3')]}}; \ No newline at end of file +var _0xc901=['username','INTEGER','BOOLEAN','INBOX','sequelize','STRING'];(function(_0x26b1b8,_0x35bfd4){var _0x401762=function(_0x49b4f4){while(--_0x49b4f4){_0x26b1b8['push'](_0x26b1b8['shift']());}};_0x401762(++_0x35bfd4);}(_0xc901,0x142));var _0x1c90=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc901[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x1c90('0x1')],'unique':_0x1c90('0x2')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x1c90('0x3')]},'tls':{'type':Sequelize[_0x1c90('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1c90('0x1')],'defaultValue':_0x1c90('0x5')},'connTimeout':{'type':Sequelize[_0x1c90('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1c90('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1c90('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 97c42b0..a26bed7 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 _0x1e9c=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x3604c7,_0x1f01ef){var _0xf8a2aa=function(_0x20104b){while(--_0x20104b){_0x3604c7['push'](_0x3604c7['shift']());}};_0xf8a2aa(++_0x1f01ef);}(_0x1e9c,0x1d9));var _0xc1e9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1e9c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc1e9('0x0'));var util=require(_0xc1e9('0x1'));var logger=require(_0xc1e9('0x2'))(_0xc1e9('0x3'));var moment=require(_0xc1e9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1e9('0x5'));var rimraf=require(_0xc1e9('0x6'));var config=require(_0xc1e9('0x7'));var attributes=require(_0xc1e9('0x8'));module[_0xc1e9('0x9')]=function(_0x39a96e,_0x41bec2){return _0x39a96e[_0xc1e9('0xa')](_0xc1e9('0xb'),attributes,{'tableName':_0xc1e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb955=['exports','define','mail_servers_in','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x1322bd,_0x38fecf){var _0x9d9aff=function(_0x50dbef){while(--_0x50dbef){_0x1322bd['push'](_0x1322bd['shift']());}};_0x9d9aff(++_0x38fecf);}(_0xb955,0x123));var _0x5b95=function(_0x4e8bb8,_0x3d40f){_0x4e8bb8=_0x4e8bb8-0x0;var _0x96b8bf=_0xb955[_0x4e8bb8];return _0x96b8bf;};'use strict';var _=require(_0x5b95('0x0'));var util=require(_0x5b95('0x1'));var logger=require(_0x5b95('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5b95('0x3'));var rp=require(_0x5b95('0x4'));var fs=require('fs');var path=require(_0x5b95('0x5'));var rimraf=require(_0x5b95('0x6'));var config=require(_0x5b95('0x7'));var attributes=require(_0x5b95('0x8'));module[_0x5b95('0x9')]=function(_0x115f9a,_0x1d0d77){return _0x115f9a[_0x5b95('0xa')]('MailServerIn',attributes,{'tableName':_0x5b95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index d60360f..d27538d 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 _0x6f8a=['message','MailServerIn,\x20%s,\x20%s','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','debug','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error','code'];(function(_0x4cb6ab,_0x1e8f51){var _0x5b721e=function(_0x3c5f97){while(--_0x3c5f97){_0x4cb6ab['push'](_0x4cb6ab['shift']());}};_0x5b721e(++_0x1e8f51);}(_0x6f8a,0x146));var _0xa6f8=function(_0x154dac,_0x3e340f){_0x154dac=_0x154dac-0x0;var _0x14515d=_0x6f8a[_0x154dac];return _0x14515d;};'use strict';var _=require(_0xa6f8('0x0'));var util=require('util');var moment=require(_0xa6f8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6f8('0x3'));var logger=require(_0xa6f8('0x4'))(_0xa6f8('0x5'));var config=require(_0xa6f8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa6f8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51d818,_0x837756,_0x3c042d){return new BPromise(function(_0xa99f9a,_0x4decc6){return client[_0xa6f8('0x8')](_0x51d818,_0x3c042d)[_0xa6f8('0x9')](function(_0x23822d){logger[_0xa6f8('0xa')]('MailServerIn,\x20%s,\x20%s',_0x837756,_0xa6f8('0xb'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x837756,_0xa6f8('0xb'),JSON[_0xa6f8('0xc')](_0x23822d));if(_0x23822d[_0xa6f8('0xd')]){if(_0x23822d['error'][_0xa6f8('0xe')]===0x1f4){logger[_0xa6f8('0xd')]('MailServerIn,\x20%s,\x20%s',_0x837756,_0x23822d[_0xa6f8('0xd')]['message']);return _0x4decc6(_0x23822d[_0xa6f8('0xd')][_0xa6f8('0xf')]);}logger[_0xa6f8('0xd')]('MailServerIn,\x20%s,\x20%s',_0x837756,_0x23822d[_0xa6f8('0xd')]['message']);return _0xa99f9a(_0x23822d[_0xa6f8('0xd')]['message']);}else{logger[_0xa6f8('0xa')](_0xa6f8('0x10'),_0x837756,_0xa6f8('0xb'));_0xa99f9a(_0x23822d[_0xa6f8('0x11')][_0xa6f8('0xf')]);}})[_0xa6f8('0x12')](function(_0x17ec6b){logger[_0xa6f8('0xd')](_0xa6f8('0x10'),_0x837756,_0x17ec6b);_0x4decc6(_0x17ec6b);});});}exports[_0xa6f8('0x13')]=function(_0x4b53aa){var _0x51d8f7=this;return new Promise(function(_0x12f3b5,_0x2bf451){return db[_0xa6f8('0x14')][_0xa6f8('0x15')]({'raw':_0x4b53aa[_0xa6f8('0x16')]?_0x4b53aa[_0xa6f8('0x16')][_0xa6f8('0x17')]===undefined?!![]:![]:!![],'where':_0x4b53aa[_0xa6f8('0x16')]?_0x4b53aa[_0xa6f8('0x16')][_0xa6f8('0x18')]||null:null,'attributes':_0x4b53aa[_0xa6f8('0x16')]?_0x4b53aa[_0xa6f8('0x16')][_0xa6f8('0x19')]||null:null,'limit':_0x4b53aa[_0xa6f8('0x16')]?_0x4b53aa[_0xa6f8('0x16')][_0xa6f8('0x1a')]||null:null,'include':_0x4b53aa[_0xa6f8('0x16')]?_0x4b53aa[_0xa6f8('0x16')][_0xa6f8('0x1b')]?_[_0xa6f8('0x1c')](_0x4b53aa['options']['include'],function(_0x2efdce){return{'model':db[_0x2efdce[_0xa6f8('0x1d')]],'as':_0x2efdce['as'],'attributes':_0x2efdce[_0xa6f8('0x19')],'include':_0x2efdce['include']?_[_0xa6f8('0x1c')](_0x2efdce[_0xa6f8('0x1b')],function(_0x19cd6a){return{'model':db[_0x19cd6a['model']],'as':_0x19cd6a['as'],'attributes':_0x19cd6a[_0xa6f8('0x19')],'include':_0x19cd6a['include']?_[_0xa6f8('0x1c')](_0x19cd6a[_0xa6f8('0x1b')],function(_0xdd7c9f){return{'model':db[_0xdd7c9f[_0xa6f8('0x1d')]],'as':_0xdd7c9f['as'],'attributes':_0xdd7c9f[_0xa6f8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa6f8('0x9')](function(_0x564099){logger[_0xa6f8('0xa')](_0xa6f8('0x13'),_0x4b53aa);logger[_0xa6f8('0x1e')](_0xa6f8('0x13'),_0x4b53aa,JSON['stringify'](_0x564099));_0x12f3b5(_0x564099);})[_0xa6f8('0x12')](function(_0x5ac43d){logger[_0xa6f8('0xd')](_0xa6f8('0x13'),_0x5ac43d['message'],_0x4b53aa);_0x2bf451(_0x51d8f7[_0xa6f8('0xd')](0x1f4,_0x5ac43d[_0xa6f8('0xf')]));});});}; \ No newline at end of file +var _0xa91b=['debug','error','message','result','GetMailServerIn','MailServerIn','findAll','raw','options','where','attributes','limit','include','map','model','stringify','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x44fc3f,_0x4774d1){var _0x926ba3=function(_0x2af2a9){while(--_0x2af2a9){_0x44fc3f['push'](_0x44fc3f['shift']());}};_0x926ba3(++_0x4774d1);}(_0xa91b,0x1d1));var _0xba91=function(_0x459583,_0x130d93){_0x459583=_0x459583-0x0;var _0x1e086d=_0xa91b[_0x459583];return _0x1e086d;};'use strict';var _=require('lodash');var util=require(_0xba91('0x0'));var moment=require(_0xba91('0x1'));var BPromise=require(_0xba91('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba91('0x3'))['db'];var utils=require(_0xba91('0x4'));var logger=require(_0xba91('0x5'))(_0xba91('0x6'));var config=require(_0xba91('0x7'));var jayson=require(_0xba91('0x8'));var client=jayson['client'][_0xba91('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f0041,_0x3a0bea,_0x4ff620){return new BPromise(function(_0x201742,_0x2b188e){return client[_0xba91('0xa')](_0x1f0041,_0x4ff620)[_0xba91('0xb')](function(_0x1e5224){logger[_0xba91('0xc')](_0xba91('0xd'),_0x3a0bea,_0xba91('0xe'));logger[_0xba91('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x3a0bea,_0xba91('0xe'),JSON['stringify'](_0x1e5224));if(_0x1e5224[_0xba91('0x10')]){if(_0x1e5224[_0xba91('0x10')]['code']===0x1f4){logger[_0xba91('0x10')](_0xba91('0xd'),_0x3a0bea,_0x1e5224['error'][_0xba91('0x11')]);return _0x2b188e(_0x1e5224[_0xba91('0x10')][_0xba91('0x11')]);}logger[_0xba91('0x10')]('MailServerIn,\x20%s,\x20%s',_0x3a0bea,_0x1e5224[_0xba91('0x10')][_0xba91('0x11')]);return _0x201742(_0x1e5224[_0xba91('0x10')][_0xba91('0x11')]);}else{logger[_0xba91('0xc')]('MailServerIn,\x20%s,\x20%s',_0x3a0bea,_0xba91('0xe'));_0x201742(_0x1e5224[_0xba91('0x12')][_0xba91('0x11')]);}})['catch'](function(_0x32990c){logger[_0xba91('0x10')](_0xba91('0xd'),_0x3a0bea,_0x32990c);_0x2b188e(_0x32990c);});});}exports[_0xba91('0x13')]=function(_0x59fcd0){var _0x29502b=this;return new Promise(function(_0x49c2f8,_0x12ecf2){return db[_0xba91('0x14')][_0xba91('0x15')]({'raw':_0x59fcd0['options']?_0x59fcd0['options'][_0xba91('0x16')]===undefined?!![]:![]:!![],'where':_0x59fcd0['options']?_0x59fcd0[_0xba91('0x17')][_0xba91('0x18')]||null:null,'attributes':_0x59fcd0[_0xba91('0x17')]?_0x59fcd0['options'][_0xba91('0x19')]||null:null,'limit':_0x59fcd0[_0xba91('0x17')]?_0x59fcd0[_0xba91('0x17')][_0xba91('0x1a')]||null:null,'include':_0x59fcd0['options']?_0x59fcd0[_0xba91('0x17')][_0xba91('0x1b')]?_[_0xba91('0x1c')](_0x59fcd0[_0xba91('0x17')]['include'],function(_0xe77391){return{'model':db[_0xe77391[_0xba91('0x1d')]],'as':_0xe77391['as'],'attributes':_0xe77391[_0xba91('0x19')],'include':_0xe77391[_0xba91('0x1b')]?_[_0xba91('0x1c')](_0xe77391[_0xba91('0x1b')],function(_0x608e31){return{'model':db[_0x608e31[_0xba91('0x1d')]],'as':_0x608e31['as'],'attributes':_0x608e31[_0xba91('0x19')],'include':_0x608e31[_0xba91('0x1b')]?_[_0xba91('0x1c')](_0x608e31[_0xba91('0x1b')],function(_0x30bc3c){return{'model':db[_0x30bc3c['model']],'as':_0x30bc3c['as'],'attributes':_0x30bc3c[_0xba91('0x19')]};}):[]};}):[]};}):[]:[]})[_0xba91('0xb')](function(_0x22f57d){logger[_0xba91('0xc')](_0xba91('0x13'),_0x59fcd0);logger['debug'](_0xba91('0x13'),_0x59fcd0,JSON[_0xba91('0x1e')](_0x22f57d));_0x49c2f8(_0x22f57d);})[_0xba91('0x1f')](function(_0x59f195){logger[_0xba91('0x10')]('GetMailServerIn',_0x59f195[_0xba91('0x11')],_0x59fcd0);_0x12ecf2(_0x29502b[_0xba91('0x10')](0x1f4,_0x59f195[_0xba91('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 443c9b3..cf40f85 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 _0x9991=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id'];(function(_0x370705,_0x56d9a9){var _0x52aa3c=function(_0x5c0182){while(--_0x5c0182){_0x370705['push'](_0x370705['shift']());}};_0x52aa3c(++_0x56d9a9);}(_0x9991,0x14a));var _0x1999=function(_0x2f57c0,_0x6967be){_0x2f57c0=_0x2f57c0-0x0;var _0x520536=_0x9991[_0x2f57c0];return _0x520536;};'use strict';var multer=require(_0x1999('0x0'));var util=require(_0x1999('0x1'));var path=require(_0x1999('0x2'));var timeout=require(_0x1999('0x3'));var express=require(_0x1999('0x4'));var router=express['Router']();var auth=require(_0x1999('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1999('0x6'));var controller=require(_0x1999('0x7'));router[_0x1999('0x8')]('/',auth[_0x1999('0x9')](),controller[_0x1999('0xa')]);router[_0x1999('0x8')](_0x1999('0xb'),auth[_0x1999('0x9')](),controller['show']);router['post']('/',auth[_0x1999('0x9')](),controller[_0x1999('0xc')]);router[_0x1999('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1999('0xe')]);router[_0x1999('0xf')](_0x1999('0xb'),auth[_0x1999('0x9')](),controller[_0x1999('0x10')]);module[_0x1999('0x11')]=router; \ No newline at end of file +var _0xf503=['/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','./mailServerOut.controller','index','get','isAuthenticated','show','post','create'];(function(_0x3f0743,_0x19c784){var _0x291c35=function(_0x4da170){while(--_0x4da170){_0x3f0743['push'](_0x3f0743['shift']());}};_0x291c35(++_0x19c784);}(_0xf503,0x18b));var _0x3f50=function(_0x25c6d0,_0x29bed0){_0x25c6d0=_0x25c6d0-0x0;var _0x124118=_0xf503[_0x25c6d0];return _0x124118;};'use strict';var multer=require(_0x3f50('0x0'));var util=require(_0x3f50('0x1'));var path=require('path');var timeout=require(_0x3f50('0x2'));var express=require(_0x3f50('0x3'));var router=express[_0x3f50('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f50('0x5'));var controller=require(_0x3f50('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3f50('0x7')]);router[_0x3f50('0x8')]('/:id',auth[_0x3f50('0x9')](),controller[_0x3f50('0xa')]);router[_0x3f50('0xb')]('/',auth[_0x3f50('0x9')](),controller[_0x3f50('0xc')]);router['put'](_0x3f50('0xd'),auth[_0x3f50('0x9')](),controller[_0x3f50('0xe')]);router[_0x3f50('0xf')](_0x3f50('0xd'),auth[_0x3f50('0x9')](),controller['destroy']);module[_0x3f50('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 edf7e88..abc29dd 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 _0x3b99=['STRING','BOOLEAN','exports'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x3b99,0x167));var _0x93b9=function(_0xefb777,_0xc991c9){_0xefb777=_0xefb777-0x0;var _0x55d636=_0x3b99[_0xefb777];return _0x55d636;};'use strict';var Sequelize=require('sequelize');module[_0x93b9('0x0')]={'description':{'type':Sequelize[_0x93b9('0x1')]},'host':{'type':Sequelize[_0x93b9('0x1')]},'user':{'type':Sequelize[_0x93b9('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x93b9('0x1')]},'authentication':{'type':Sequelize[_0x93b9('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xaff9=['STRING','BOOLEAN','sequelize','exports'];(function(_0x246119,_0x30a4f3){var _0x59c74f=function(_0x313fb5){while(--_0x313fb5){_0x246119['push'](_0x246119['shift']());}};_0x59c74f(++_0x30a4f3);}(_0xaff9,0x82));var _0x9aff=function(_0x44e33b,_0x45b2c7){_0x44e33b=_0x44e33b-0x0;var _0x8358f9=_0xaff9[_0x44e33b];return _0x8358f9;};'use strict';var Sequelize=require(_0x9aff('0x0'));module[_0x9aff('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x9aff('0x2')]},'pass':{'type':Sequelize[_0x9aff('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x9aff('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x9aff('0x2')]},'authentication':{'type':Sequelize[_0x9aff('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 b788588..97442c3 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 _0x4875=['key','VIRTUAL','field','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','eml-format','zip-dir','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','set','json','apply','save','update','destroy','then','status','stack','name','send','index','MailServerOut','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4875,0x158));var _0x5487=function(_0x3e9787,_0x4b4cf6){_0x3e9787=_0x3e9787-0x0;var _0x3d33c7=_0x4875[_0x3e9787];return _0x3d33c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5487('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5487('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5487('0x2'));var Mustache=require(_0x5487('0x3'));var util=require('util');var path=require('path');var sox=require(_0x5487('0x4'));var csv=require(_0x5487('0x5'));var ejs=require(_0x5487('0x6'));var fs=require('fs');var _=require(_0x5487('0x7'));var squel=require(_0x5487('0x8'));var crypto=require(_0x5487('0x9'));var jsforce=require(_0x5487('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5487('0xb'));var Redis=require(_0x5487('0xc'));var authService=require(_0x5487('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5487('0xe'))(_0x5487('0xf'));var utils=require('../../config/utils');var config=require(_0x5487('0x10'));var db=require(_0x5487('0x11'))['db'];function respondWithStatusCode(_0x36fb3f,_0x3c7504){_0x3c7504=_0x3c7504||0xcc;return function(_0x27a869){if(_0x27a869){return _0x36fb3f[_0x5487('0x12')](_0x3c7504);}return _0x36fb3f['status'](_0x3c7504)[_0x5487('0x13')]();};}function respondWithResult(_0x41bb87,_0x4948a3){_0x4948a3=_0x4948a3||0xc8;return function(_0x17004b){if(_0x17004b){return _0x41bb87['status'](_0x4948a3)['json'](_0x17004b);}};}function respondWithFilteredResult(_0x1b2684,_0x5b706c){return function(_0x3826cb){if(_0x3826cb){var _0x4bd99c=_0x3826cb[_0x5487('0x14')],_0x34b7e6=_0x5b706c['offset'],_0x1d750d=_0x5b706c[_0x5487('0x15')]+_0x5b706c[_0x5487('0x16')],_0x576987;if(_0x1d750d>=_0x4bd99c){_0x1d750d=_0x4bd99c;_0x576987=0xc8;}else{_0x576987=0xce;}_0x1b2684['status'](_0x576987);return _0x1b2684[_0x5487('0x17')]('Content-Range',_0x34b7e6+'-'+_0x1d750d+'/'+_0x4bd99c)[_0x5487('0x18')](_0x3826cb);}return null;};}function patchUpdates(_0x5b44f8){return function(_0x34d477){try{jsonpatch[_0x5487('0x19')](_0x34d477,_0x5b44f8,!![]);}catch(_0x3c3e7e){return BPromise['reject'](_0x3c3e7e);}return _0x34d477[_0x5487('0x1a')]();};}function saveUpdates(_0x1bbba8,_0x194c0e){return function(_0x1ffa8b){if(_0x1ffa8b){return _0x1ffa8b[_0x5487('0x1b')](_0x1bbba8)['then'](function(_0x9eb002){return _0x9eb002;});}return null;};}function removeEntity(_0x15bed8,_0x1276a9){return function(_0x3cee25){if(_0x3cee25){return _0x3cee25[_0x5487('0x1c')]()[_0x5487('0x1d')](function(){_0x15bed8[_0x5487('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd457fc,_0x4094fb){return function(_0x5d27b6){if(!_0x5d27b6){_0xd457fc[_0x5487('0x12')](0x194);}return _0x5d27b6;};}function handleError(_0x5eaaab,_0x2653d1){_0x2653d1=_0x2653d1||0x1f4;return function(_0x2d64bd){logger['error'](_0x2d64bd[_0x5487('0x1f')]);if(_0x2d64bd[_0x5487('0x20')]){delete _0x2d64bd[_0x5487('0x20')];}_0x5eaaab['status'](_0x2653d1)[_0x5487('0x21')](_0x2d64bd);};}exports[_0x5487('0x22')]=function(_0x163d2d,_0xf429c1){var _0x33c5a9={},_0x585095={},_0x425fa5={'count':0x0,'rows':[]};var _0x385aaf=db[_0x5487('0x23')]['rawAttributes'];_0x585095[_0x5487('0x24')]=_['keys'](_0x385aaf);_0x585095[_0x5487('0x25')]=_[_0x5487('0x26')](_0x163d2d[_0x5487('0x25')]);_0x585095[_0x5487('0x27')]=_[_0x5487('0x28')](_0x585095[_0x5487('0x24')],_0x585095[_0x5487('0x25')]);_0x33c5a9[_0x5487('0x29')]=_['intersection'](_0x585095[_0x5487('0x24')],qs[_0x5487('0x2a')](_0x163d2d['query'][_0x5487('0x2a')]));_0x33c5a9[_0x5487('0x29')]=_0x33c5a9[_0x5487('0x29')][_0x5487('0x2b')]?_0x33c5a9[_0x5487('0x29')]:_0x585095[_0x5487('0x24')];if(!_0x163d2d[_0x5487('0x25')][_0x5487('0x2c')](_0x5487('0x2d'))){_0x33c5a9[_0x5487('0x16')]=qs[_0x5487('0x16')](_0x163d2d[_0x5487('0x25')][_0x5487('0x16')]);_0x33c5a9[_0x5487('0x15')]=qs['offset'](_0x163d2d['query']['offset']);}_0x33c5a9['order']=qs['sort'](_0x163d2d[_0x5487('0x25')][_0x5487('0x2e')]);_0x33c5a9['where']=qs[_0x5487('0x27')](_[_0x5487('0x2f')](_0x163d2d['query'],_0x585095['filters']));if(_0x163d2d[_0x5487('0x25')][_0x5487('0x30')]){_0x33c5a9[_0x5487('0x31')]=_[_0x5487('0x32')](_0x33c5a9[_0x5487('0x31')],{'$or':_['map'](_0x385aaf,function(_0x30c7d2){if(_0x30c7d2[_0x5487('0x33')][_0x5487('0x34')]!==_0x5487('0x35')){var _0x1a20b3={};_0x1a20b3[_0x30c7d2[_0x5487('0x36')]]={'$like':'%'+_0x163d2d[_0x5487('0x25')]['filter']+'%'};return _0x1a20b3;}})});}_0x33c5a9=_['merge']({},_0x33c5a9,_0x163d2d[_0x5487('0x37')]);var _0x177a61={'where':_0x33c5a9['where']};return db[_0x5487('0x23')][_0x5487('0x14')](_0x177a61)[_0x5487('0x1d')](function(_0x4384b2){_0x425fa5['count']=_0x4384b2;if(_0x163d2d[_0x5487('0x25')][_0x5487('0x38')]){_0x33c5a9[_0x5487('0x39')]=[{'all':!![]}];}return db[_0x5487('0x23')][_0x5487('0x3a')](_0x33c5a9);})[_0x5487('0x1d')](function(_0x3e938e){_0x425fa5['rows']=_0x3e938e;return _0x425fa5;})['then'](respondWithFilteredResult(_0xf429c1,_0x33c5a9))['catch'](handleError(_0xf429c1,null));};exports[_0x5487('0x3b')]=function(_0x59b367,_0x53afe9){var _0xa2d9cb={'raw':!![],'where':{'id':_0x59b367[_0x5487('0x3c')]['id']}},_0x15ac67={};_0x15ac67[_0x5487('0x24')]=_[_0x5487('0x26')](db['MailServerOut'][_0x5487('0x3d')]);_0x15ac67[_0x5487('0x25')]=_[_0x5487('0x26')](_0x59b367['query']);_0x15ac67['filters']=_[_0x5487('0x28')](_0x15ac67[_0x5487('0x24')],_0x15ac67[_0x5487('0x25')]);_0xa2d9cb[_0x5487('0x29')]=_['intersection'](_0x15ac67[_0x5487('0x24')],qs[_0x5487('0x2a')](_0x59b367[_0x5487('0x25')][_0x5487('0x2a')]));_0xa2d9cb[_0x5487('0x29')]=_0xa2d9cb[_0x5487('0x29')][_0x5487('0x2b')]?_0xa2d9cb[_0x5487('0x29')]:_0x15ac67[_0x5487('0x24')];if(_0x59b367[_0x5487('0x25')][_0x5487('0x38')]){_0xa2d9cb['include']=[{'all':!![]}];}_0xa2d9cb=_[_0x5487('0x32')]({},_0xa2d9cb,_0x59b367['options']);return db[_0x5487('0x23')][_0x5487('0x3e')](_0xa2d9cb)['then'](handleEntityNotFound(_0x53afe9,null))['then'](respondWithResult(_0x53afe9,null))[_0x5487('0x3f')](handleError(_0x53afe9,null));};exports[_0x5487('0x40')]=function(_0x939195,_0x1dbcfa){return db['MailServerOut'][_0x5487('0x40')](_0x939195[_0x5487('0x41')],{})[_0x5487('0x1d')](respondWithResult(_0x1dbcfa,0xc9))[_0x5487('0x3f')](handleError(_0x1dbcfa,null));};exports[_0x5487('0x1b')]=function(_0x22bd52,_0x58f476){if(_0x22bd52['body']['id']){delete _0x22bd52[_0x5487('0x41')]['id'];}return db[_0x5487('0x23')][_0x5487('0x3e')]({'where':{'id':_0x22bd52[_0x5487('0x3c')]['id']}})[_0x5487('0x1d')](handleEntityNotFound(_0x58f476,null))[_0x5487('0x1d')](saveUpdates(_0x22bd52[_0x5487('0x41')],null))[_0x5487('0x1d')](respondWithResult(_0x58f476,null))[_0x5487('0x3f')](handleError(_0x58f476,null));};exports[_0x5487('0x1c')]=function(_0x265a33,_0x137567){return db[_0x5487('0x23')]['find']({'where':{'id':_0x265a33[_0x5487('0x3c')]['id']}})[_0x5487('0x1d')](handleEntityNotFound(_0x137567,null))['then'](removeEntity(_0x137567,null))[_0x5487('0x3f')](handleError(_0x137567,null));}; \ No newline at end of file +var _0x98f4=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','MailServerOut','findAll','rows','catch','params','length','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x24f6cd,_0xfc477e){var _0x3e455c=function(_0x523fcc){while(--_0x523fcc){_0x24f6cd['push'](_0x24f6cd['shift']());}};_0x3e455c(++_0xfc477e);}(_0x98f4,0x109));var _0x498f=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0x98f4[_0x3213b7];return _0xb960bf;};'use strict';var pdf=require(_0x498f('0x0'));var emlformat=require(_0x498f('0x1'));var rimraf=require(_0x498f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x498f('0x3'));var rp=require(_0x498f('0x4'));var moment=require(_0x498f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x498f('0x6'));var util=require(_0x498f('0x7'));var path=require('path');var sox=require(_0x498f('0x8'));var csv=require(_0x498f('0x9'));var ejs=require(_0x498f('0xa'));var fs=require('fs');var _=require(_0x498f('0xb'));var squel=require(_0x498f('0xc'));var crypto=require('crypto');var jsforce=require(_0x498f('0xd'));var deskjs=require(_0x498f('0xe'));var toCsv=require(_0x498f('0x9'));var querystring=require(_0x498f('0xf'));var Papa=require('papaparse');var Redis=require(_0x498f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x498f('0x11'));var hardwareService=require(_0x498f('0x12'));var logger=require(_0x498f('0x13'))('api');var utils=require(_0x498f('0x14'));var config=require(_0x498f('0x15'));var db=require(_0x498f('0x16'))['db'];function respondWithStatusCode(_0x1f7fce,_0x2c654c){_0x2c654c=_0x2c654c||0xcc;return function(_0x35c094){if(_0x35c094){return _0x1f7fce[_0x498f('0x17')](_0x2c654c);}return _0x1f7fce['status'](_0x2c654c)[_0x498f('0x18')]();};}function respondWithResult(_0x32d84b,_0x1c968b){_0x1c968b=_0x1c968b||0xc8;return function(_0x29b6d0){if(_0x29b6d0){return _0x32d84b[_0x498f('0x19')](_0x1c968b)[_0x498f('0x1a')](_0x29b6d0);}};}function respondWithFilteredResult(_0x225dbc,_0x59e307){return function(_0x155a27){if(_0x155a27){var _0x1b5769=_0x155a27[_0x498f('0x1b')],_0x1a79fd=_0x59e307[_0x498f('0x1c')],_0x6bd22c=_0x59e307[_0x498f('0x1c')]+_0x59e307['limit'],_0x44d742;if(_0x6bd22c>=_0x1b5769){_0x6bd22c=_0x1b5769;_0x44d742=0xc8;}else{_0x44d742=0xce;}_0x225dbc[_0x498f('0x19')](_0x44d742);return _0x225dbc['set'](_0x498f('0x1d'),_0x1a79fd+'-'+_0x6bd22c+'/'+_0x1b5769)[_0x498f('0x1a')](_0x155a27);}return null;};}function patchUpdates(_0x58bc55){return function(_0x105c42){try{jsonpatch[_0x498f('0x1e')](_0x105c42,_0x58bc55,!![]);}catch(_0x27371d){return BPromise['reject'](_0x27371d);}return _0x105c42[_0x498f('0x1f')]();};}function saveUpdates(_0x1976b8,_0x581134){return function(_0x332a26){if(_0x332a26){return _0x332a26[_0x498f('0x20')](_0x1976b8)[_0x498f('0x21')](function(_0x525ff9){return _0x525ff9;});}return null;};}function removeEntity(_0x59f61e,_0x5d04c8){return function(_0x171463){if(_0x171463){return _0x171463[_0x498f('0x22')]()[_0x498f('0x21')](function(){_0x59f61e['status'](0xcc)[_0x498f('0x18')]();});}};}function handleEntityNotFound(_0x15b9d3,_0x4e3d6d){return function(_0x142a7){if(!_0x142a7){_0x15b9d3['sendStatus'](0x194);}return _0x142a7;};}function handleError(_0x4f5b71,_0x10e41a){_0x10e41a=_0x10e41a||0x1f4;return function(_0xb3c9d1){logger['error'](_0xb3c9d1[_0x498f('0x23')]);if(_0xb3c9d1[_0x498f('0x24')]){delete _0xb3c9d1['name'];}_0x4f5b71[_0x498f('0x19')](_0x10e41a)[_0x498f('0x25')](_0xb3c9d1);};}exports[_0x498f('0x26')]=function(_0x483cce,_0x1d2f77){var _0x581e1d={},_0x203fa7={},_0x4dc140={'count':0x0,'rows':[]};var _0x1d5ee4=db['MailServerOut'][_0x498f('0x27')];_0x203fa7[_0x498f('0x28')]=_['keys'](_0x1d5ee4);_0x203fa7[_0x498f('0x29')]=_[_0x498f('0x2a')](_0x483cce[_0x498f('0x29')]);_0x203fa7[_0x498f('0x2b')]=_[_0x498f('0x2c')](_0x203fa7[_0x498f('0x28')],_0x203fa7['query']);_0x581e1d[_0x498f('0x2d')]=_['intersection'](_0x203fa7[_0x498f('0x28')],qs[_0x498f('0x2e')](_0x483cce[_0x498f('0x29')][_0x498f('0x2e')]));_0x581e1d[_0x498f('0x2d')]=_0x581e1d[_0x498f('0x2d')]['length']?_0x581e1d[_0x498f('0x2d')]:_0x203fa7[_0x498f('0x28')];if(!_0x483cce['query'][_0x498f('0x2f')](_0x498f('0x30'))){_0x581e1d[_0x498f('0x31')]=qs[_0x498f('0x31')](_0x483cce[_0x498f('0x29')][_0x498f('0x31')]);_0x581e1d[_0x498f('0x1c')]=qs['offset'](_0x483cce['query']['offset']);}_0x581e1d[_0x498f('0x32')]=qs['sort'](_0x483cce[_0x498f('0x29')][_0x498f('0x33')]);_0x581e1d['where']=qs[_0x498f('0x2b')](_['pick'](_0x483cce[_0x498f('0x29')],_0x203fa7[_0x498f('0x2b')]));if(_0x483cce[_0x498f('0x29')][_0x498f('0x34')]){_0x581e1d[_0x498f('0x35')]=_[_0x498f('0x36')](_0x581e1d[_0x498f('0x35')],{'$or':_['map'](_0x1d5ee4,function(_0x6435c6){if(_0x6435c6[_0x498f('0x37')][_0x498f('0x38')]!==_0x498f('0x39')){var _0x54a7e0={};_0x54a7e0[_0x6435c6[_0x498f('0x3a')]]={'$like':'%'+_0x483cce[_0x498f('0x29')][_0x498f('0x34')]+'%'};return _0x54a7e0;}})});}_0x581e1d=_[_0x498f('0x36')]({},_0x581e1d,_0x483cce[_0x498f('0x3b')]);var _0x5821e1={'where':_0x581e1d[_0x498f('0x35')]};return db['MailServerOut'][_0x498f('0x1b')](_0x5821e1)[_0x498f('0x21')](function(_0x22a5d6){_0x4dc140[_0x498f('0x1b')]=_0x22a5d6;if(_0x483cce[_0x498f('0x29')][_0x498f('0x3c')]){_0x581e1d[_0x498f('0x3d')]=[{'all':!![]}];}return db[_0x498f('0x3e')][_0x498f('0x3f')](_0x581e1d);})[_0x498f('0x21')](function(_0x512b1a){_0x4dc140[_0x498f('0x40')]=_0x512b1a;return _0x4dc140;})['then'](respondWithFilteredResult(_0x1d2f77,_0x581e1d))[_0x498f('0x41')](handleError(_0x1d2f77,null));};exports['show']=function(_0x49ccbb,_0x4dfcca){var _0x228234={'raw':!![],'where':{'id':_0x49ccbb[_0x498f('0x42')]['id']}},_0x121df6={};_0x121df6[_0x498f('0x28')]=_[_0x498f('0x2a')](db[_0x498f('0x3e')][_0x498f('0x27')]);_0x121df6[_0x498f('0x29')]=_['keys'](_0x49ccbb[_0x498f('0x29')]);_0x121df6['filters']=_[_0x498f('0x2c')](_0x121df6[_0x498f('0x28')],_0x121df6[_0x498f('0x29')]);_0x228234[_0x498f('0x2d')]=_[_0x498f('0x2c')](_0x121df6[_0x498f('0x28')],qs[_0x498f('0x2e')](_0x49ccbb[_0x498f('0x29')][_0x498f('0x2e')]));_0x228234['attributes']=_0x228234[_0x498f('0x2d')][_0x498f('0x43')]?_0x228234[_0x498f('0x2d')]:_0x121df6['model'];if(_0x49ccbb['query'][_0x498f('0x3c')]){_0x228234[_0x498f('0x3d')]=[{'all':!![]}];}_0x228234=_['merge']({},_0x228234,_0x49ccbb[_0x498f('0x3b')]);return db[_0x498f('0x3e')][_0x498f('0x44')](_0x228234)['then'](handleEntityNotFound(_0x4dfcca,null))[_0x498f('0x21')](respondWithResult(_0x4dfcca,null))[_0x498f('0x41')](handleError(_0x4dfcca,null));};exports['create']=function(_0xd2102c,_0x288f2c){return db['MailServerOut'][_0x498f('0x45')](_0xd2102c[_0x498f('0x46')],{})['then'](respondWithResult(_0x288f2c,0xc9))[_0x498f('0x41')](handleError(_0x288f2c,null));};exports['update']=function(_0x1394c8,_0x15f988){if(_0x1394c8['body']['id']){delete _0x1394c8[_0x498f('0x46')]['id'];}return db[_0x498f('0x3e')][_0x498f('0x44')]({'where':{'id':_0x1394c8[_0x498f('0x42')]['id']}})['then'](handleEntityNotFound(_0x15f988,null))[_0x498f('0x21')](saveUpdates(_0x1394c8[_0x498f('0x46')],null))[_0x498f('0x21')](respondWithResult(_0x15f988,null))[_0x498f('0x41')](handleError(_0x15f988,null));};exports[_0x498f('0x22')]=function(_0x3ffb6b,_0x2617c1){return db['MailServerOut'][_0x498f('0x44')]({'where':{'id':_0x3ffb6b['params']['id']}})[_0x498f('0x21')](handleEntityNotFound(_0x2617c1,null))[_0x498f('0x21')](removeEntity(_0x2617c1,null))[_0x498f('0x41')](handleError(_0x2617c1,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6e46a09..bf628ae 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 _0x6324=['define','mail_servers_out','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x194630,_0x3d6b83){var _0x17f28=function(_0x3ea019){while(--_0x3ea019){_0x194630['push'](_0x194630['shift']());}};_0x17f28(++_0x3d6b83);}(_0x6324,0x142));var _0x4632=function(_0x57784b,_0x49a858){_0x57784b=_0x57784b-0x0;var _0x4505fa=_0x6324[_0x57784b];return _0x4505fa;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var moment=require('moment');var BPromise=require(_0x4632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4632('0x5'));var rimraf=require('rimraf');var config=require(_0x4632('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x4632('0x7')]=function(_0x24aba6,_0x1f3077){return _0x24aba6[_0x4632('0x8')]('MailServerOut',attributes,{'tableName':_0x4632('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96cc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out'];(function(_0x2fd71a,_0x3b7db6){var _0x497a1f=function(_0x4b7808){while(--_0x4b7808){_0x2fd71a['push'](_0x2fd71a['shift']());}};_0x497a1f(++_0x3b7db6);}(_0x96cc,0x16c));var _0xc96c=function(_0x1eff83,_0x598a1c){_0x1eff83=_0x1eff83-0x0;var _0x20f2fa=_0x96cc[_0x1eff83];return _0x20f2fa;};'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/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 055ca91..0ab9d62 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 _0x522a=['rpc','client','http','request','info','request\x20sent','debug','stringify','error','MailServerOut,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x22a36d,_0x446572){var _0x5e1b4b=function(_0x11928f){while(--_0x11928f){_0x22a36d['push'](_0x22a36d['shift']());}};_0x5e1b4b(++_0x446572);}(_0x522a,0xfa));var _0xa522=function(_0x8299df,_0x2887e1){_0x8299df=_0x8299df-0x0;var _0x4a707f=_0x522a[_0x8299df];return _0x4a707f;};'use strict';var _=require(_0xa522('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa522('0x1'));var rs=require(_0xa522('0x2'));var fs=require('fs');var Redis=require(_0xa522('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa522('0x4'))(_0xa522('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa522('0x6')][_0xa522('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x548e0f,_0x97ceae,_0x8a4336){return new BPromise(function(_0x3f4de9,_0x1b52e2){return client[_0xa522('0x8')](_0x548e0f,_0x8a4336)['then'](function(_0x29110b){logger[_0xa522('0x9')]('MailServerOut,\x20%s,\x20%s',_0x97ceae,_0xa522('0xa'));logger[_0xa522('0xb')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x97ceae,_0xa522('0xa'),JSON[_0xa522('0xc')](_0x29110b));if(_0x29110b[_0xa522('0xd')]){if(_0x29110b[_0xa522('0xd')]['code']===0x1f4){logger[_0xa522('0xd')](_0xa522('0xe'),_0x97ceae,_0x29110b[_0xa522('0xd')]['message']);return _0x1b52e2(_0x29110b['error'][_0xa522('0xf')]);}logger[_0xa522('0xd')](_0xa522('0xe'),_0x97ceae,_0x29110b[_0xa522('0xd')]['message']);return _0x3f4de9(_0x29110b['error'][_0xa522('0xf')]);}else{logger['info'](_0xa522('0xe'),_0x97ceae,'request\x20sent');_0x3f4de9(_0x29110b[_0xa522('0x10')][_0xa522('0xf')]);}})['catch'](function(_0x23d5bd){logger[_0xa522('0xd')](_0xa522('0xe'),_0x97ceae,_0x23d5bd);_0x1b52e2(_0x23d5bd);});});} \ No newline at end of file +var _0x755c=['error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x38f737,_0x54f685){var _0x7afda3=function(_0x1ac1d7){while(--_0x1ac1d7){_0x38f737['push'](_0x38f737['shift']());}};_0x7afda3(++_0x54f685);}(_0x755c,0xc4));var _0xc755=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x755c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xc755('0x0'));var moment=require('moment');var BPromise=require(_0xc755('0x1'));var rs=require(_0xc755('0x2'));var fs=require('fs');var Redis=require(_0xc755('0x3'));var db=require(_0xc755('0x4'))['db'];var utils=require(_0xc755('0x5'));var logger=require(_0xc755('0x6'))(_0xc755('0x7'));var config=require(_0xc755('0x8'));var jayson=require(_0xc755('0x9'));var client=jayson[_0xc755('0xa')][_0xc755('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3249c5,_0xf85d42,_0x2c368e){return new BPromise(function(_0x5101f8,_0x4e1f13){return client[_0xc755('0xc')](_0x3249c5,_0x2c368e)[_0xc755('0xd')](function(_0x4c0625){logger[_0xc755('0xe')](_0xc755('0xf'),_0xf85d42,_0xc755('0x10'));logger[_0xc755('0x11')](_0xc755('0x12'),_0xf85d42,'request\x20sent',JSON[_0xc755('0x13')](_0x4c0625));if(_0x4c0625[_0xc755('0x14')]){if(_0x4c0625[_0xc755('0x14')]['code']===0x1f4){logger[_0xc755('0x14')](_0xc755('0xf'),_0xf85d42,_0x4c0625['error']['message']);return _0x4e1f13(_0x4c0625[_0xc755('0x14')]['message']);}logger[_0xc755('0x14')](_0xc755('0xf'),_0xf85d42,_0x4c0625[_0xc755('0x14')][_0xc755('0x15')]);return _0x5101f8(_0x4c0625[_0xc755('0x14')][_0xc755('0x15')]);}else{logger[_0xc755('0xe')](_0xc755('0xf'),_0xf85d42,_0xc755('0x10'));_0x5101f8(_0x4c0625[_0xc755('0x16')][_0xc755('0x15')]);}})[_0xc755('0x17')](function(_0x56023b){logger[_0xc755('0x14')](_0xc755('0xf'),_0xf85d42,_0x56023b);_0x4e1f13(_0x56023b);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index da10a16..914e531 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 _0xd0ab=['/:id','show','create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x22b7fd,_0x6b33dd){var _0x44ffa6=function(_0x5f3b13){while(--_0x5f3b13){_0x22b7fd['push'](_0x22b7fd['shift']());}};_0x44ffa6(++_0x6b33dd);}(_0xd0ab,0x15d));var _0xbd0a=function(_0x4952de,_0x45c11e){_0x4952de=_0x4952de-0x0;var _0x3e8e5a=_0xd0ab[_0x4952de];return _0x3e8e5a;};'use strict';var multer=require('multer');var util=require(_0xbd0a('0x0'));var path=require(_0xbd0a('0x1'));var timeout=require(_0xbd0a('0x2'));var express=require(_0xbd0a('0x3'));var router=express['Router']();var auth=require(_0xbd0a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbd0a('0x5'));router[_0xbd0a('0x6')]('/',auth[_0xbd0a('0x7')](),controller[_0xbd0a('0x8')]);router['get'](_0xbd0a('0x9'),auth[_0xbd0a('0x7')](),controller[_0xbd0a('0xa')]);router[_0xbd0a('0x6')](_0xbd0a('0xb'),auth['isAuthenticated'](),controller[_0xbd0a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd0a('0xd')]);router[_0xbd0a('0xe')](_0xbd0a('0xb'),auth['isAuthenticated'](),controller[_0xbd0a('0xf')]);router['delete'](_0xbd0a('0xb'),auth[_0xbd0a('0x7')](),controller[_0xbd0a('0x10')]);module[_0xbd0a('0x11')]=router; \ No newline at end of file +var _0x0d9e=['show','post','put','update','delete','/:id','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated'];(function(_0x2e15ba,_0x55f7ef){var _0x19b155=function(_0x318dce){while(--_0x318dce){_0x2e15ba['push'](_0x2e15ba['shift']());}};_0x19b155(++_0x55f7ef);}(_0x0d9e,0x14c));var _0xe0d9=function(_0x2e7fd2,_0x17148c){_0x2e7fd2=_0x2e7fd2-0x0;var _0xb2af29=_0x0d9e[_0x2e7fd2];return _0xb2af29;};'use strict';var multer=require('multer');var util=require(_0xe0d9('0x0'));var path=require('path');var timeout=require(_0xe0d9('0x1'));var express=require('express');var router=express[_0xe0d9('0x2')]();var auth=require(_0xe0d9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe0d9('0x4'));var controller=require(_0xe0d9('0x5'));router[_0xe0d9('0x6')]('/',auth['isAuthenticated'](),controller[_0xe0d9('0x7')]);router[_0xe0d9('0x6')](_0xe0d9('0x8'),auth[_0xe0d9('0x9')](),controller['describe']);router['get']('/:id',auth[_0xe0d9('0x9')](),controller[_0xe0d9('0xa')]);router[_0xe0d9('0xb')]('/',auth[_0xe0d9('0x9')](),controller['create']);router[_0xe0d9('0xc')]('/:id',auth[_0xe0d9('0x9')](),controller[_0xe0d9('0xd')]);router[_0xe0d9('0xe')](_0xe0d9('0xf'),auth[_0xe0d9('0x9')](),controller[_0xe0d9('0x10')]);module[_0xe0d9('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 3b8133c..f39e804 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 _0x351d=['sequelize','STRING','name'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x351d,0x90));var _0xd351=function(_0x52aa80,_0x3eb719){_0x52aa80=_0x52aa80-0x0;var _0x4723bb=_0x351d[_0x52aa80];return _0x4723bb;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'name':{'type':Sequelize[_0xd351('0x1')],'unique':_0xd351('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd351('0x1')]}}; \ No newline at end of file +var _0x6146=['sequelize','STRING','name'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x6146,0xba));var _0x6614=function(_0x5bb6e1,_0x2ace5f){_0x5bb6e1=_0x5bb6e1-0x0;var _0x19eb6d=_0x6146[_0x5bb6e1];return _0x19eb6d;};'use strict';var Sequelize=require(_0x6614('0x0'));module['exports']={'name':{'type':Sequelize[_0x6614('0x1')],'unique':_0x6614('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6614('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index f1ed68e..2eddc53 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 _0x21ac=['../../config/utils','../../config/environment','sendStatus','status','end','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','MailSubstatus','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','intersection','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0x21ac,0x1a1));var _0xc21a=function(_0x3912d0,_0x4ebcbe){_0x3912d0=_0x3912d0-0x0;var _0x5c33fe=_0x21ac[_0x3912d0];return _0x5c33fe;};'use strict';var pdf=require(_0xc21a('0x0'));var emlformat=require(_0xc21a('0x1'));var rimraf=require(_0xc21a('0x2'));var zipdir=require(_0xc21a('0x3'));var jsonpatch=require(_0xc21a('0x4'));var rp=require(_0xc21a('0x5'));var moment=require('moment');var BPromise=require(_0xc21a('0x6'));var Mustache=require('mustache');var util=require(_0xc21a('0x7'));var path=require(_0xc21a('0x8'));var sox=require(_0xc21a('0x9'));var csv=require(_0xc21a('0xa'));var ejs=require(_0xc21a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc21a('0xc'));var crypto=require(_0xc21a('0xd'));var jsforce=require(_0xc21a('0xe'));var deskjs=require(_0xc21a('0xf'));var toCsv=require(_0xc21a('0xa'));var querystring=require(_0xc21a('0x10'));var Papa=require(_0xc21a('0x11'));var Redis=require('ioredis');var authService=require(_0xc21a('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc21a('0x13'))(_0xc21a('0x14'));var utils=require(_0xc21a('0x15'));var config=require(_0xc21a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x441f91,_0x9be929){_0x9be929=_0x9be929||0xcc;return function(_0x38f507){if(_0x38f507){return _0x441f91[_0xc21a('0x17')](_0x9be929);}return _0x441f91[_0xc21a('0x18')](_0x9be929)[_0xc21a('0x19')]();};}function respondWithResult(_0x1a2276,_0x13fec2){_0x13fec2=_0x13fec2||0xc8;return function(_0x4d7c43){if(_0x4d7c43){return _0x1a2276['status'](_0x13fec2)['json'](_0x4d7c43);}};}function respondWithFilteredResult(_0x45d010,_0x14e408){return function(_0x4e8df6){if(_0x4e8df6){var _0x4992fe=_0x4e8df6['count'],_0x2aa91e=_0x14e408[_0xc21a('0x1a')],_0x41863b=_0x14e408[_0xc21a('0x1a')]+_0x14e408['limit'],_0x5b9a5f;if(_0x41863b>=_0x4992fe){_0x41863b=_0x4992fe;_0x5b9a5f=0xc8;}else{_0x5b9a5f=0xce;}_0x45d010['status'](_0x5b9a5f);return _0x45d010[_0xc21a('0x1b')](_0xc21a('0x1c'),_0x2aa91e+'-'+_0x41863b+'/'+_0x4992fe)['json'](_0x4e8df6);}return null;};}function patchUpdates(_0x30cd51){return function(_0x52fe92){try{jsonpatch[_0xc21a('0x1d')](_0x52fe92,_0x30cd51,!![]);}catch(_0x19f8ff){return BPromise[_0xc21a('0x1e')](_0x19f8ff);}return _0x52fe92['save']();};}function saveUpdates(_0x5b68bd,_0xe60c3e){return function(_0x2b88b9){if(_0x2b88b9){return _0x2b88b9[_0xc21a('0x1f')](_0x5b68bd)['then'](function(_0x50b355){return _0x50b355;});}return null;};}function removeEntity(_0x26f36c,_0x19b163){return function(_0x4310af){if(_0x4310af){return _0x4310af[_0xc21a('0x20')]()[_0xc21a('0x21')](function(){_0x26f36c[_0xc21a('0x18')](0xcc)[_0xc21a('0x19')]();});}};}function handleEntityNotFound(_0x38f42a,_0x8ae619){return function(_0x8fa753){if(!_0x8fa753){_0x38f42a[_0xc21a('0x17')](0x194);}return _0x8fa753;};}function handleError(_0x182b65,_0x4407ca){_0x4407ca=_0x4407ca||0x1f4;return function(_0x144f16){logger[_0xc21a('0x22')](_0x144f16[_0xc21a('0x23')]);if(_0x144f16[_0xc21a('0x24')]){delete _0x144f16[_0xc21a('0x24')];}_0x182b65['status'](_0x4407ca)[_0xc21a('0x25')](_0x144f16);};}exports[_0xc21a('0x26')]=function(_0x31559b,_0x561b94){var _0xecd1a3={},_0x28d412={},_0xe56b25={'count':0x0,'rows':[]};var _0x51e8fe=db[_0xc21a('0x27')][_0xc21a('0x28')];_0x28d412[_0xc21a('0x29')]=_['keys'](_0x51e8fe);_0x28d412[_0xc21a('0x2a')]=_[_0xc21a('0x2b')](_0x31559b[_0xc21a('0x2a')]);_0x28d412[_0xc21a('0x2c')]=_['intersection'](_0x28d412[_0xc21a('0x29')],_0x28d412['query']);_0xecd1a3[_0xc21a('0x2d')]=_['intersection'](_0x28d412[_0xc21a('0x29')],qs[_0xc21a('0x2e')](_0x31559b['query'][_0xc21a('0x2e')]));_0xecd1a3[_0xc21a('0x2d')]=_0xecd1a3[_0xc21a('0x2d')][_0xc21a('0x2f')]?_0xecd1a3['attributes']:_0x28d412[_0xc21a('0x29')];if(!_0x31559b[_0xc21a('0x2a')][_0xc21a('0x30')](_0xc21a('0x31'))){_0xecd1a3[_0xc21a('0x32')]=qs[_0xc21a('0x32')](_0x31559b[_0xc21a('0x2a')][_0xc21a('0x32')]);_0xecd1a3['offset']=qs[_0xc21a('0x1a')](_0x31559b[_0xc21a('0x2a')][_0xc21a('0x1a')]);}_0xecd1a3[_0xc21a('0x33')]=qs['sort'](_0x31559b['query'][_0xc21a('0x34')]);_0xecd1a3[_0xc21a('0x35')]=qs[_0xc21a('0x2c')](_['pick'](_0x31559b[_0xc21a('0x2a')],_0x28d412[_0xc21a('0x2c')]));if(_0x31559b['query'][_0xc21a('0x36')]){_0xecd1a3['where']=_[_0xc21a('0x37')](_0xecd1a3[_0xc21a('0x35')],{'$or':_[_0xc21a('0x38')](_0x51e8fe,function(_0x1b9347){if(_0x1b9347[_0xc21a('0x39')]['key']!==_0xc21a('0x3a')){var _0x583e6d={};_0x583e6d[_0x1b9347['field']]={'$like':'%'+_0x31559b['query']['filter']+'%'};return _0x583e6d;}})});}_0xecd1a3=_['merge']({},_0xecd1a3,_0x31559b[_0xc21a('0x3b')]);var _0x4a4abc={'where':_0xecd1a3['where']};return db[_0xc21a('0x27')]['count'](_0x4a4abc)[_0xc21a('0x21')](function(_0x50aebe){_0xe56b25[_0xc21a('0x3c')]=_0x50aebe;if(_0x31559b[_0xc21a('0x2a')]['includeAll']){_0xecd1a3[_0xc21a('0x3d')]=[{'all':!![]}];}return db[_0xc21a('0x27')][_0xc21a('0x3e')](_0xecd1a3);})[_0xc21a('0x21')](function(_0x131235){_0xe56b25[_0xc21a('0x3f')]=_0x131235;return _0xe56b25;})[_0xc21a('0x21')](respondWithFilteredResult(_0x561b94,_0xecd1a3))[_0xc21a('0x40')](handleError(_0x561b94,null));};exports[_0xc21a('0x41')]=function(_0x261ba1,_0x2a3f37){var _0x4e3cae={'raw':!![],'where':{'id':_0x261ba1[_0xc21a('0x42')]['id']}},_0xabe0d5={};_0xabe0d5['model']=_[_0xc21a('0x2b')](db[_0xc21a('0x27')][_0xc21a('0x28')]);_0xabe0d5[_0xc21a('0x2a')]=_['keys'](_0x261ba1[_0xc21a('0x2a')]);_0xabe0d5[_0xc21a('0x2c')]=_[_0xc21a('0x43')](_0xabe0d5[_0xc21a('0x29')],_0xabe0d5[_0xc21a('0x2a')]);_0x4e3cae[_0xc21a('0x2d')]=_[_0xc21a('0x43')](_0xabe0d5[_0xc21a('0x29')],qs[_0xc21a('0x2e')](_0x261ba1[_0xc21a('0x2a')][_0xc21a('0x2e')]));_0x4e3cae['attributes']=_0x4e3cae[_0xc21a('0x2d')][_0xc21a('0x2f')]?_0x4e3cae[_0xc21a('0x2d')]:_0xabe0d5[_0xc21a('0x29')];if(_0x261ba1['query'][_0xc21a('0x44')]){_0x4e3cae[_0xc21a('0x3d')]=[{'all':!![]}];}_0x4e3cae=_[_0xc21a('0x37')]({},_0x4e3cae,_0x261ba1[_0xc21a('0x3b')]);return db[_0xc21a('0x27')]['find'](_0x4e3cae)[_0xc21a('0x21')](handleEntityNotFound(_0x2a3f37,null))[_0xc21a('0x21')](respondWithResult(_0x2a3f37,null))['catch'](handleError(_0x2a3f37,null));};exports[_0xc21a('0x45')]=function(_0xa318df,_0x337898){return db[_0xc21a('0x27')][_0xc21a('0x45')](_0xa318df[_0xc21a('0x46')],{})[_0xc21a('0x21')](respondWithResult(_0x337898,0xc9))[_0xc21a('0x40')](handleError(_0x337898,null));};exports['update']=function(_0x2ad48f,_0x1d8e08){if(_0x2ad48f[_0xc21a('0x46')]['id']){delete _0x2ad48f['body']['id'];}return db[_0xc21a('0x27')][_0xc21a('0x47')]({'where':{'id':_0x2ad48f['params']['id']}})[_0xc21a('0x21')](handleEntityNotFound(_0x1d8e08,null))['then'](saveUpdates(_0x2ad48f['body'],null))[_0xc21a('0x21')](respondWithResult(_0x1d8e08,null))[_0xc21a('0x40')](handleError(_0x1d8e08,null));};exports[_0xc21a('0x20')]=function(_0x2dc8b3,_0xd8f462){return db[_0xc21a('0x27')][_0xc21a('0x47')]({'where':{'id':_0x2dc8b3[_0xc21a('0x42')]['id']}})[_0xc21a('0x21')](handleEntityNotFound(_0xd8f462,null))[_0xc21a('0x21')](removeEntity(_0xd8f462,null))[_0xc21a('0x40')](handleError(_0xd8f462,null));};exports[_0xc21a('0x48')]=function(_0x5becc3,_0xcf026c){return db['MailSubstatus'][_0xc21a('0x48')]()[_0xc21a('0x21')](respondWithResult(_0xcf026c,null))[_0xc21a('0x40')](handleError(_0xcf026c,null));}; \ No newline at end of file +var _0xff71=['options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','then','destroy','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','MailSubstatus','findAll','rows','show','params','include'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0xff71,0x92));var _0x1ff7=function(_0x526119,_0x5c4b34){_0x526119=_0x526119-0x0;var _0x402da2=_0xff71[_0x526119];return _0x402da2;};'use strict';var pdf=require(_0x1ff7('0x0'));var emlformat=require(_0x1ff7('0x1'));var rimraf=require(_0x1ff7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ff7('0x3'));var rp=require('request-promise');var moment=require(_0x1ff7('0x4'));var BPromise=require(_0x1ff7('0x5'));var Mustache=require('mustache');var util=require(_0x1ff7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1ff7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ff7('0x8'));var squel=require(_0x1ff7('0x9'));var crypto=require(_0x1ff7('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ff7('0x7'));var querystring=require(_0x1ff7('0xb'));var Papa=require(_0x1ff7('0xc'));var Redis=require('ioredis');var authService=require(_0x1ff7('0xd'));var qs=require(_0x1ff7('0xe'));var hardwareService=require(_0x1ff7('0xf'));var logger=require(_0x1ff7('0x10'))('api');var utils=require(_0x1ff7('0x11'));var config=require(_0x1ff7('0x12'));var db=require(_0x1ff7('0x13'))['db'];function respondWithStatusCode(_0xbcebdf,_0x51c4f8){_0x51c4f8=_0x51c4f8||0xcc;return function(_0x5f3925){if(_0x5f3925){return _0xbcebdf[_0x1ff7('0x14')](_0x51c4f8);}return _0xbcebdf[_0x1ff7('0x15')](_0x51c4f8)['end']();};}function respondWithResult(_0x1b42b9,_0x5a3411){_0x5a3411=_0x5a3411||0xc8;return function(_0x1418b2){if(_0x1418b2){return _0x1b42b9['status'](_0x5a3411)[_0x1ff7('0x16')](_0x1418b2);}};}function respondWithFilteredResult(_0x1f4b0c,_0x111509){return function(_0x614a3e){if(_0x614a3e){var _0x12709e=_0x614a3e[_0x1ff7('0x17')],_0x3f166b=_0x111509[_0x1ff7('0x18')],_0x5e0c2e=_0x111509['offset']+_0x111509[_0x1ff7('0x19')],_0x56e897;if(_0x5e0c2e>=_0x12709e){_0x5e0c2e=_0x12709e;_0x56e897=0xc8;}else{_0x56e897=0xce;}_0x1f4b0c[_0x1ff7('0x15')](_0x56e897);return _0x1f4b0c[_0x1ff7('0x1a')]('Content-Range',_0x3f166b+'-'+_0x5e0c2e+'/'+_0x12709e)[_0x1ff7('0x16')](_0x614a3e);}return null;};}function patchUpdates(_0x7cc53b){return function(_0x3abd15){try{jsonpatch[_0x1ff7('0x1b')](_0x3abd15,_0x7cc53b,!![]);}catch(_0x296fbe){return BPromise['reject'](_0x296fbe);}return _0x3abd15[_0x1ff7('0x1c')]();};}function saveUpdates(_0xedc2a6,_0xa02166){return function(_0x477aeb){if(_0x477aeb){return _0x477aeb['update'](_0xedc2a6)[_0x1ff7('0x1d')](function(_0x229135){return _0x229135;});}return null;};}function removeEntity(_0x3cc7da,_0x3e9bdf){return function(_0x4e5c8a){if(_0x4e5c8a){return _0x4e5c8a[_0x1ff7('0x1e')]()[_0x1ff7('0x1d')](function(){_0x3cc7da[_0x1ff7('0x15')](0xcc)[_0x1ff7('0x1f')]();});}};}function handleEntityNotFound(_0x3c6295,_0x59ac8c){return function(_0x4b015b){if(!_0x4b015b){_0x3c6295['sendStatus'](0x194);}return _0x4b015b;};}function handleError(_0x25a602,_0x1d6a59){_0x1d6a59=_0x1d6a59||0x1f4;return function(_0x3e18e9){logger[_0x1ff7('0x20')](_0x3e18e9[_0x1ff7('0x21')]);if(_0x3e18e9['name']){delete _0x3e18e9[_0x1ff7('0x22')];}_0x25a602[_0x1ff7('0x15')](_0x1d6a59)[_0x1ff7('0x23')](_0x3e18e9);};}exports[_0x1ff7('0x24')]=function(_0x28a119,_0x4acf43){var _0x1231c4={},_0x5d7eb9={},_0x407a24={'count':0x0,'rows':[]};var _0x443f2b=db['MailSubstatus'][_0x1ff7('0x25')];_0x5d7eb9[_0x1ff7('0x26')]=_[_0x1ff7('0x27')](_0x443f2b);_0x5d7eb9[_0x1ff7('0x28')]=_[_0x1ff7('0x27')](_0x28a119['query']);_0x5d7eb9[_0x1ff7('0x29')]=_['intersection'](_0x5d7eb9['model'],_0x5d7eb9[_0x1ff7('0x28')]);_0x1231c4[_0x1ff7('0x2a')]=_[_0x1ff7('0x2b')](_0x5d7eb9[_0x1ff7('0x26')],qs[_0x1ff7('0x2c')](_0x28a119['query'][_0x1ff7('0x2c')]));_0x1231c4[_0x1ff7('0x2a')]=_0x1231c4[_0x1ff7('0x2a')][_0x1ff7('0x2d')]?_0x1231c4[_0x1ff7('0x2a')]:_0x5d7eb9[_0x1ff7('0x26')];if(!_0x28a119[_0x1ff7('0x28')][_0x1ff7('0x2e')](_0x1ff7('0x2f'))){_0x1231c4[_0x1ff7('0x19')]=qs[_0x1ff7('0x19')](_0x28a119['query']['limit']);_0x1231c4['offset']=qs[_0x1ff7('0x18')](_0x28a119[_0x1ff7('0x28')]['offset']);}_0x1231c4[_0x1ff7('0x30')]=qs[_0x1ff7('0x31')](_0x28a119[_0x1ff7('0x28')]['sort']);_0x1231c4[_0x1ff7('0x32')]=qs[_0x1ff7('0x29')](_[_0x1ff7('0x33')](_0x28a119[_0x1ff7('0x28')],_0x5d7eb9[_0x1ff7('0x29')]));if(_0x28a119['query'][_0x1ff7('0x34')]){_0x1231c4[_0x1ff7('0x32')]=_['merge'](_0x1231c4[_0x1ff7('0x32')],{'$or':_[_0x1ff7('0x35')](_0x443f2b,function(_0x396f89){if(_0x396f89[_0x1ff7('0x36')]['key']!==_0x1ff7('0x37')){var _0x382596={};_0x382596[_0x396f89[_0x1ff7('0x38')]]={'$like':'%'+_0x28a119['query'][_0x1ff7('0x34')]+'%'};return _0x382596;}})});}_0x1231c4=_[_0x1ff7('0x39')]({},_0x1231c4,_0x28a119['options']);var _0x510018={'where':_0x1231c4[_0x1ff7('0x32')]};return db[_0x1ff7('0x3a')][_0x1ff7('0x17')](_0x510018)[_0x1ff7('0x1d')](function(_0x4ed3e0){_0x407a24[_0x1ff7('0x17')]=_0x4ed3e0;if(_0x28a119[_0x1ff7('0x28')]['includeAll']){_0x1231c4['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x1ff7('0x3b')](_0x1231c4);})[_0x1ff7('0x1d')](function(_0x2be6ad){_0x407a24[_0x1ff7('0x3c')]=_0x2be6ad;return _0x407a24;})[_0x1ff7('0x1d')](respondWithFilteredResult(_0x4acf43,_0x1231c4))['catch'](handleError(_0x4acf43,null));};exports[_0x1ff7('0x3d')]=function(_0x1fa95b,_0x249ffa){var _0x4ebab2={'raw':!![],'where':{'id':_0x1fa95b[_0x1ff7('0x3e')]['id']}},_0x256571={};_0x256571[_0x1ff7('0x26')]=_['keys'](db[_0x1ff7('0x3a')][_0x1ff7('0x25')]);_0x256571[_0x1ff7('0x28')]=_[_0x1ff7('0x27')](_0x1fa95b[_0x1ff7('0x28')]);_0x256571[_0x1ff7('0x29')]=_[_0x1ff7('0x2b')](_0x256571[_0x1ff7('0x26')],_0x256571['query']);_0x4ebab2[_0x1ff7('0x2a')]=_['intersection'](_0x256571['model'],qs['fields'](_0x1fa95b['query'][_0x1ff7('0x2c')]));_0x4ebab2[_0x1ff7('0x2a')]=_0x4ebab2[_0x1ff7('0x2a')][_0x1ff7('0x2d')]?_0x4ebab2['attributes']:_0x256571['model'];if(_0x1fa95b[_0x1ff7('0x28')]['includeAll']){_0x4ebab2[_0x1ff7('0x3f')]=[{'all':!![]}];}_0x4ebab2=_[_0x1ff7('0x39')]({},_0x4ebab2,_0x1fa95b[_0x1ff7('0x40')]);return db[_0x1ff7('0x3a')][_0x1ff7('0x41')](_0x4ebab2)[_0x1ff7('0x1d')](handleEntityNotFound(_0x249ffa,null))[_0x1ff7('0x1d')](respondWithResult(_0x249ffa,null))[_0x1ff7('0x42')](handleError(_0x249ffa,null));};exports[_0x1ff7('0x43')]=function(_0x9968b1,_0xb1ce8c){return db[_0x1ff7('0x3a')][_0x1ff7('0x43')](_0x9968b1[_0x1ff7('0x44')],{})[_0x1ff7('0x1d')](respondWithResult(_0xb1ce8c,0xc9))[_0x1ff7('0x42')](handleError(_0xb1ce8c,null));};exports['update']=function(_0x5b4ecf,_0x1fb01c){if(_0x5b4ecf[_0x1ff7('0x44')]['id']){delete _0x5b4ecf[_0x1ff7('0x44')]['id'];}return db[_0x1ff7('0x3a')][_0x1ff7('0x41')]({'where':{'id':_0x5b4ecf[_0x1ff7('0x3e')]['id']}})[_0x1ff7('0x1d')](handleEntityNotFound(_0x1fb01c,null))[_0x1ff7('0x1d')](saveUpdates(_0x5b4ecf['body'],null))[_0x1ff7('0x1d')](respondWithResult(_0x1fb01c,null))[_0x1ff7('0x42')](handleError(_0x1fb01c,null));};exports[_0x1ff7('0x1e')]=function(_0x298b39,_0x4b073c){return db[_0x1ff7('0x3a')]['find']({'where':{'id':_0x298b39[_0x1ff7('0x3e')]['id']}})[_0x1ff7('0x1d')](handleEntityNotFound(_0x4b073c,null))[_0x1ff7('0x1d')](removeEntity(_0x4b073c,null))[_0x1ff7('0x42')](handleError(_0x4b073c,null));};exports['describe']=function(_0x10cc67,_0x5d2ef8){return db[_0x1ff7('0x3a')][_0x1ff7('0x45')]()[_0x1ff7('0x1d')](respondWithResult(_0x5d2ef8,null))[_0x1ff7('0x42')](handleError(_0x5d2ef8,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 74a871c..38470b2 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 _0x0aa9=['../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x487024,_0x3a8722){var _0x306f63=function(_0x2a3a12){while(--_0x2a3a12){_0x487024['push'](_0x487024['shift']());}};_0x306f63(++_0x3a8722);}(_0x0aa9,0x1a8));var _0x90aa=function(_0x4b48af,_0x4ad5b9){_0x4b48af=_0x4b48af-0x0;var _0x64ac44=_0x0aa9[_0x4b48af];return _0x64ac44;};'use strict';var _=require('lodash');var util=require(_0x90aa('0x0'));var logger=require(_0x90aa('0x1'))('api');var moment=require(_0x90aa('0x2'));var BPromise=require(_0x90aa('0x3'));var rp=require(_0x90aa('0x4'));var fs=require('fs');var path=require(_0x90aa('0x5'));var rimraf=require('rimraf');var config=require(_0x90aa('0x6'));var attributes=require(_0x90aa('0x7'));module['exports']=function(_0x163ebd,_0x335fd3){return _0x163ebd[_0x90aa('0x8')](_0x90aa('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa26=['rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','path'];(function(_0x4ef79e,_0x37e205){var _0x423558=function(_0xa8b7b6){while(--_0xa8b7b6){_0x4ef79e['push'](_0x4ef79e['shift']());}};_0x423558(++_0x37e205);}(_0xaa26,0x132));var _0x6aa2=function(_0x458f09,_0xf2ee90){_0x458f09=_0x458f09-0x0;var _0x1ca565=_0xaa26[_0x458f09];return _0x1ca565;};'use strict';var _=require(_0x6aa2('0x0'));var util=require(_0x6aa2('0x1'));var logger=require(_0x6aa2('0x2'))(_0x6aa2('0x3'));var moment=require(_0x6aa2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aa2('0x5'));var rimraf=require(_0x6aa2('0x6'));var config=require(_0x6aa2('0x7'));var attributes=require(_0x6aa2('0x8'));module['exports']=function(_0x5c5822,_0x572496){return _0x5c5822[_0x6aa2('0x9')](_0x6aa2('0xa'),attributes,{'tableName':_0x6aa2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 090e82c..190d2d5 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 _0x3aeb=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9a1159,_0x1f85c4){var _0x35e0f5=function(_0x3850b1){while(--_0x3850b1){_0x9a1159['push'](_0x9a1159['shift']());}};_0x35e0f5(++_0x1f85c4);}(_0x3aeb,0x15a));var _0xb3ae=function(_0x45d8b0,_0x42b4ea){_0x45d8b0=_0x45d8b0-0x0;var _0x4b04c8=_0x3aeb[_0x45d8b0];return _0x4b04c8;};'use strict';var _=require(_0xb3ae('0x0'));var util=require(_0xb3ae('0x1'));var moment=require(_0xb3ae('0x2'));var BPromise=require(_0xb3ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3ae('0x4'));var db=require(_0xb3ae('0x5'))['db'];var utils=require(_0xb3ae('0x6'));var logger=require(_0xb3ae('0x7'))(_0xb3ae('0x8'));var config=require(_0xb3ae('0x9'));var jayson=require(_0xb3ae('0xa'));var client=jayson[_0xb3ae('0xb')][_0xb3ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bb3d7,_0x4c4cb3,_0x1e8d9b){return new BPromise(function(_0x1ba3f9,_0x4183fe){return client[_0xb3ae('0xd')](_0x2bb3d7,_0x1e8d9b)[_0xb3ae('0xe')](function(_0x2ded78){logger['info'](_0xb3ae('0xf'),_0x4c4cb3,_0xb3ae('0x10'));logger[_0xb3ae('0x11')](_0xb3ae('0x12'),_0x4c4cb3,_0xb3ae('0x10'),JSON[_0xb3ae('0x13')](_0x2ded78));if(_0x2ded78[_0xb3ae('0x14')]){if(_0x2ded78['error'][_0xb3ae('0x15')]===0x1f4){logger[_0xb3ae('0x14')](_0xb3ae('0xf'),_0x4c4cb3,_0x2ded78['error']['message']);return _0x4183fe(_0x2ded78['error']['message']);}logger['error'](_0xb3ae('0xf'),_0x4c4cb3,_0x2ded78[_0xb3ae('0x14')]['message']);return _0x1ba3f9(_0x2ded78[_0xb3ae('0x14')]['message']);}else{logger[_0xb3ae('0x16')]('MailSubstatus,\x20%s,\x20%s',_0x4c4cb3,_0xb3ae('0x10'));_0x1ba3f9(_0x2ded78[_0xb3ae('0x17')][_0xb3ae('0x18')]);}})[_0xb3ae('0x19')](function(_0x50ced1){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x4c4cb3,_0x50ced1);_0x4183fe(_0x50ced1);});});} \ No newline at end of file +var _0xc70e=['rpc','../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x23eb08,_0x3e6bee){var _0x385be3=function(_0x206442){while(--_0x206442){_0x23eb08['push'](_0x23eb08['shift']());}};_0x385be3(++_0x3e6bee);}(_0xc70e,0xaf));var _0xec70=function(_0x4676b9,_0x55fcd1){_0x4676b9=_0x4676b9-0x0;var _0x3a6e12=_0xc70e[_0x4676b9];return _0x3a6e12;};'use strict';var _=require(_0xec70('0x0'));var util=require('util');var moment=require(_0xec70('0x1'));var BPromise=require(_0xec70('0x2'));var rs=require(_0xec70('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xec70('0x4'));var logger=require('../../config/logger')(_0xec70('0x5'));var config=require(_0xec70('0x6'));var jayson=require(_0xec70('0x7'));var client=jayson['client'][_0xec70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23fffb,_0x256d05,_0x583a57){return new BPromise(function(_0x49023b,_0x25e1b6){return client[_0xec70('0x9')](_0x23fffb,_0x583a57)[_0xec70('0xa')](function(_0x232571){logger[_0xec70('0xb')](_0xec70('0xc'),_0x256d05,_0xec70('0xd'));logger['debug'](_0xec70('0xe'),_0x256d05,'request\x20sent',JSON['stringify'](_0x232571));if(_0x232571[_0xec70('0xf')]){if(_0x232571[_0xec70('0xf')][_0xec70('0x10')]===0x1f4){logger[_0xec70('0xf')](_0xec70('0xc'),_0x256d05,_0x232571['error']['message']);return _0x25e1b6(_0x232571[_0xec70('0xf')]['message']);}logger['error'](_0xec70('0xc'),_0x256d05,_0x232571[_0xec70('0xf')][_0xec70('0x11')]);return _0x49023b(_0x232571['error'][_0xec70('0x11')]);}else{logger[_0xec70('0xb')](_0xec70('0xc'),_0x256d05,'request\x20sent');_0x49023b(_0x232571[_0xec70('0x12')][_0xec70('0x11')]);}})[_0xec70('0x13')](function(_0x317484){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x256d05,_0x317484);_0x25e1b6(_0x317484);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ecc9bad..6d5e788 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 _0xbacd=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0x35e305,_0x1d2487){var _0x324bca=function(_0xe2222d){while(--_0xe2222d){_0x35e305['push'](_0x35e305['shift']());}};_0x324bca(++_0x1d2487);}(_0xbacd,0x1c5));var _0xdbac=function(_0x5a70ea,_0x235523){_0x5a70ea=_0x5a70ea-0x0;var _0x38fee3=_0xbacd[_0x5a70ea];return _0x38fee3;};'use strict';var multer=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var path=require('path');var timeout=require(_0xdbac('0x2'));var express=require(_0xdbac('0x3'));var router=express[_0xdbac('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdbac('0x5'));var config=require(_0xdbac('0x6'));var controller=require(_0xdbac('0x7'));router[_0xdbac('0x8')]('/',auth[_0xdbac('0x9')](),controller[_0xdbac('0xa')]);router[_0xdbac('0x8')](_0xdbac('0xb'),auth[_0xdbac('0x9')](),controller[_0xdbac('0xc')]);router[_0xdbac('0x8')](_0xdbac('0xd'),auth[_0xdbac('0x9')](),controller[_0xdbac('0xe')]);router[_0xdbac('0xf')]('/',auth['isAuthenticated'](),controller[_0xdbac('0x10')]);router[_0xdbac('0x11')]('/:id',auth[_0xdbac('0x9')](),controller['update']);router[_0xdbac('0x12')](_0xdbac('0xd'),auth[_0xdbac('0x9')](),controller[_0xdbac('0x13')]);module[_0xdbac('0x14')]=router; \ No newline at end of file +var _0x2a07=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2a07,0x74));var _0x72a0=function(_0xf64500,_0x410815){_0xf64500=_0xf64500-0x0;var _0x58a6e0=_0x2a07[_0xf64500];return _0x58a6e0;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var auth=require(_0x72a0('0x5'));var interaction=require(_0x72a0('0x6'));var config=require(_0x72a0('0x7'));var controller=require(_0x72a0('0x8'));router[_0x72a0('0x9')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xb')]);router[_0x72a0('0x9')](_0x72a0('0xc'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xd')]);router[_0x72a0('0x9')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xf')]);router[_0x72a0('0x10')]('/',auth['isAuthenticated'](),controller[_0x72a0('0x11')]);router[_0x72a0('0x12')]('/:id',auth[_0x72a0('0xa')](),controller[_0x72a0('0x13')]);router[_0x72a0('0x14')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller['destroy']);module[_0x72a0('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index dbc87e4..8dbcfab 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 _0xf8d0=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','queue'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xf8d0,0xf5));var _0x0f8d=function(_0x3ab26c,_0x5037fe){_0x3ab26c=_0x3ab26c-0x0;var _0x2548a3=_0xf8d0[_0x3ab26c];return _0x2548a3;};'use strict';var moment=require(_0x0f8d('0x0'));var Sequelize=require(_0x0f8d('0x1'));module[_0x0f8d('0x2')]={'uniqueid':{'type':Sequelize[_0x0f8d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0f8d('0x4')](_0x0f8d('0x5'),'agent','queue'),'allowNull':![],'defaultValue':_0x0f8d('0x6')},'transferredAt':{'type':Sequelize[_0x0f8d('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x0f8d('0x8')]}}; \ No newline at end of file +var _0x55ee=['ENUM','account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x28094e,_0x177dea){var _0x391994=function(_0x5a9b1a){while(--_0x5a9b1a){_0x28094e['push'](_0x28094e['shift']());}};_0x391994(++_0x177dea);}(_0x55ee,0x15a));var _0xe55e=function(_0x52ff0a,_0x44590f){_0x52ff0a=_0x52ff0a-0x0;var _0x3f5b6a=_0x55ee[_0x52ff0a];return _0x3f5b6a;};'use strict';var moment=require(_0xe55e('0x0'));var Sequelize=require(_0xe55e('0x1'));module[_0xe55e('0x2')]={'uniqueid':{'type':Sequelize[_0xe55e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe55e('0x4')](_0xe55e('0x5'),_0xe55e('0x6'),_0xe55e('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xe55e('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xe55e('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 60b7aee..8113a14 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 _0xd8b0=['rawAttributes','keys','filters','model','attributes','intersection','length','query','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','key','VIRTUAL','options','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','stack','name','index'];(function(_0x338b71,_0x1ab120){var _0x35599c=function(_0x146ca6){while(--_0x146ca6){_0x338b71['push'](_0x338b71['shift']());}};_0x35599c(++_0x1ab120);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];function respondWithStatusCode(_0xc574a3,_0x340cc4){_0x340cc4=_0x340cc4||0xcc;return function(_0x92cdd8){if(_0x92cdd8){return _0xc574a3[_0x0d8b('0x15')](_0x340cc4);}return _0xc574a3[_0x0d8b('0x16')](_0x340cc4)[_0x0d8b('0x17')]();};}function respondWithResult(_0x31a8cc,_0x1d4bbc){_0x1d4bbc=_0x1d4bbc||0xc8;return function(_0x2ce75e){if(_0x2ce75e){return _0x31a8cc[_0x0d8b('0x16')](_0x1d4bbc)[_0x0d8b('0x18')](_0x2ce75e);}};}function respondWithFilteredResult(_0x1567ce,_0x2d4e1c){return function(_0x4f6f21){if(_0x4f6f21){var _0x23eb7b=_0x4f6f21[_0x0d8b('0x19')],_0xa86349=_0x2d4e1c['offset'],_0x17f7df=_0x2d4e1c[_0x0d8b('0x1a')]+_0x2d4e1c[_0x0d8b('0x1b')],_0xe2e167;if(_0x17f7df>=_0x23eb7b){_0x17f7df=_0x23eb7b;_0xe2e167=0xc8;}else{_0xe2e167=0xce;}_0x1567ce[_0x0d8b('0x16')](_0xe2e167);return _0x1567ce[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0xa86349+'-'+_0x17f7df+'/'+_0x23eb7b)[_0x0d8b('0x18')](_0x4f6f21);}return null;};}function patchUpdates(_0x264b39){return function(_0xa3612a){try{jsonpatch['apply'](_0xa3612a,_0x264b39,!![]);}catch(_0x27512e){return BPromise[_0x0d8b('0x1e')](_0x27512e);}return _0xa3612a[_0x0d8b('0x1f')]();};}function saveUpdates(_0x143372,_0x24e8ed){return function(_0x5b709c){if(_0x5b709c){return _0x5b709c[_0x0d8b('0x20')](_0x143372)[_0x0d8b('0x21')](function(_0x50ec1e){return _0x50ec1e;});}return null;};}function removeEntity(_0x4f0a1a,_0x33fb87){return function(_0x54a9a7){if(_0x54a9a7){return _0x54a9a7['destroy']()['then'](function(){_0x4f0a1a[_0x0d8b('0x16')](0xcc)[_0x0d8b('0x17')]();});}};}function handleEntityNotFound(_0x214778,_0x38efc8){return function(_0x221071){if(!_0x221071){_0x214778[_0x0d8b('0x15')](0x194);}return _0x221071;};}function handleError(_0x30980c,_0x4562cb){_0x4562cb=_0x4562cb||0x1f4;return function(_0x27b695){logger['error'](_0x27b695[_0x0d8b('0x22')]);if(_0x27b695[_0x0d8b('0x23')]){delete _0x27b695['name'];}_0x30980c[_0x0d8b('0x16')](_0x4562cb)['send'](_0x27b695);};}exports[_0x0d8b('0x24')]=function(_0x234bdd,_0xa2af02){var _0x4fe6f9={},_0x59a905={},_0x28f639={'count':0x0,'rows':[]};var _0x3ef745=db['MailTransferReport'][_0x0d8b('0x25')];_0x59a905['model']=_[_0x0d8b('0x26')](_0x3ef745);_0x59a905['query']=_[_0x0d8b('0x26')](_0x234bdd['query']);_0x59a905[_0x0d8b('0x27')]=_['intersection'](_0x59a905[_0x0d8b('0x28')],_0x59a905['query']);_0x4fe6f9[_0x0d8b('0x29')]=_[_0x0d8b('0x2a')](_0x59a905[_0x0d8b('0x28')],qs['fields'](_0x234bdd['query']['fields']));_0x4fe6f9[_0x0d8b('0x29')]=_0x4fe6f9['attributes'][_0x0d8b('0x2b')]?_0x4fe6f9['attributes']:_0x59a905['model'];if(!_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2d')](_0x0d8b('0x2e'))){_0x4fe6f9[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x4fe6f9[_0x0d8b('0x1a')]=qs['offset'](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x4fe6f9['order']=qs[_0x0d8b('0x2f')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2f')]);_0x4fe6f9['where']=qs[_0x0d8b('0x27')](_[_0x0d8b('0x30')](_0x234bdd[_0x0d8b('0x2c')],_0x59a905[_0x0d8b('0x27')]));if(_0x234bdd[_0x0d8b('0x2c')]['filter']){_0x4fe6f9[_0x0d8b('0x31')]=_[_0x0d8b('0x32')](_0x4fe6f9['where'],{'$or':_[_0x0d8b('0x33')](_0x3ef745,function(_0x3cc3ee){if(_0x3cc3ee[_0x0d8b('0x34')][_0x0d8b('0x35')]!==_0x0d8b('0x36')){var _0x519088={};_0x519088[_0x3cc3ee['field']]={'$like':'%'+_0x234bdd[_0x0d8b('0x2c')]['filter']+'%'};return _0x519088;}})});}_0x4fe6f9=_['merge']({},_0x4fe6f9,_0x234bdd[_0x0d8b('0x37')]);var _0x2e279c={'where':_0x4fe6f9[_0x0d8b('0x31')]};return db[_0x0d8b('0x38')][_0x0d8b('0x19')](_0x2e279c)[_0x0d8b('0x21')](function(_0x579324){_0x28f639[_0x0d8b('0x19')]=_0x579324;if(_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4fe6f9[_0x0d8b('0x3a')]=[{'all':!![]}];}return db[_0x0d8b('0x38')][_0x0d8b('0x3b')](_0x4fe6f9);})[_0x0d8b('0x21')](function(_0x5c980b){_0x28f639[_0x0d8b('0x3c')]=_0x5c980b;return _0x28f639;})[_0x0d8b('0x21')](respondWithFilteredResult(_0xa2af02,_0x4fe6f9))[_0x0d8b('0x3d')](handleError(_0xa2af02,null));};exports[_0x0d8b('0x3e')]=function(_0x59d3ad,_0xe0bf42){var _0x4b4bde={'raw':!![],'where':{'id':_0x59d3ad[_0x0d8b('0x3f')]['id']}},_0x37b26c={};_0x37b26c[_0x0d8b('0x28')]=_[_0x0d8b('0x26')](db[_0x0d8b('0x38')][_0x0d8b('0x25')]);_0x37b26c[_0x0d8b('0x2c')]=_[_0x0d8b('0x26')](_0x59d3ad[_0x0d8b('0x2c')]);_0x37b26c[_0x0d8b('0x27')]=_['intersection'](_0x37b26c['model'],_0x37b26c['query']);_0x4b4bde['attributes']=_['intersection'](_0x37b26c[_0x0d8b('0x28')],qs[_0x0d8b('0x40')](_0x59d3ad[_0x0d8b('0x2c')]['fields']));_0x4b4bde['attributes']=_0x4b4bde[_0x0d8b('0x29')][_0x0d8b('0x2b')]?_0x4b4bde[_0x0d8b('0x29')]:_0x37b26c['model'];if(_0x59d3ad[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4b4bde['include']=[{'all':!![]}];}_0x4b4bde=_['merge']({},_0x4b4bde,_0x59d3ad[_0x0d8b('0x37')]);return db['MailTransferReport'][_0x0d8b('0x41')](_0x4b4bde)['then'](handleEntityNotFound(_0xe0bf42,null))['then'](respondWithResult(_0xe0bf42,null))[_0x0d8b('0x3d')](handleError(_0xe0bf42,null));};exports[_0x0d8b('0x42')]=function(_0x5a75c7,_0x5ebe8a){return db['MailTransferReport']['create'](_0x5a75c7[_0x0d8b('0x43')],{})[_0x0d8b('0x21')](respondWithResult(_0x5ebe8a,0xc9))[_0x0d8b('0x3d')](handleError(_0x5ebe8a,null));};exports['update']=function(_0xb0910e,_0x1afe8a){if(_0xb0910e[_0x0d8b('0x43')]['id']){delete _0xb0910e[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0xb0910e[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x1afe8a,null))[_0x0d8b('0x21')](saveUpdates(_0xb0910e[_0x0d8b('0x43')],null))[_0x0d8b('0x21')](respondWithResult(_0x1afe8a,null))[_0x0d8b('0x3d')](handleError(_0x1afe8a,null));};exports[_0x0d8b('0x44')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0x3e569b[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x570af8,null))['then'](removeEntity(_0x570af8,null))[_0x0d8b('0x3d')](handleError(_0x570af8,null));};exports['describe']=function(_0x5d29ab,_0x39a31d){return db[_0x0d8b('0x38')][_0x0d8b('0x45')]()[_0x0d8b('0x21')](respondWithResult(_0x39a31d,null))['catch'](handleError(_0x39a31d,null));}; \ No newline at end of file +var _0xec56=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailTransferReport','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x10e11e,_0x4fde1f){var _0x347365=function(_0x17b790){while(--_0x17b790){_0x10e11e['push'](_0x10e11e['shift']());}};_0x347365(++_0x4fde1f);}(_0xec56,0x1bd));var _0x6ec5=function(_0x45de06,_0x47c876){_0x45de06=_0x45de06-0x0;var _0x186269=_0xec56[_0x45de06];return _0x186269;};'use strict';var pdf=require(_0x6ec5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ec5('0x1'));var jsonpatch=require(_0x6ec5('0x2'));var rp=require(_0x6ec5('0x3'));var moment=require(_0x6ec5('0x4'));var BPromise=require(_0x6ec5('0x5'));var Mustache=require(_0x6ec5('0x6'));var util=require(_0x6ec5('0x7'));var path=require(_0x6ec5('0x8'));var sox=require(_0x6ec5('0x9'));var csv=require(_0x6ec5('0xa'));var ejs=require(_0x6ec5('0xb'));var fs=require('fs');var _=require(_0x6ec5('0xc'));var squel=require(_0x6ec5('0xd'));var crypto=require(_0x6ec5('0xe'));var jsforce=require(_0x6ec5('0xf'));var deskjs=require(_0x6ec5('0x10'));var toCsv=require(_0x6ec5('0xa'));var querystring=require(_0x6ec5('0x11'));var Papa=require(_0x6ec5('0x12'));var Redis=require('ioredis');var authService=require(_0x6ec5('0x13'));var qs=require(_0x6ec5('0x14'));var hardwareService=require(_0x6ec5('0x15'));var logger=require(_0x6ec5('0x16'))(_0x6ec5('0x17'));var utils=require(_0x6ec5('0x18'));var config=require(_0x6ec5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d4eca,_0x1d7180){_0x1d7180=_0x1d7180||0xcc;return function(_0x2b1f61){if(_0x2b1f61){return _0x2d4eca[_0x6ec5('0x1a')](_0x1d7180);}return _0x2d4eca[_0x6ec5('0x1b')](_0x1d7180)[_0x6ec5('0x1c')]();};}function respondWithResult(_0x2f4c5d,_0x39125b){_0x39125b=_0x39125b||0xc8;return function(_0x5166ad){if(_0x5166ad){return _0x2f4c5d[_0x6ec5('0x1b')](_0x39125b)['json'](_0x5166ad);}};}function respondWithFilteredResult(_0x14e9dc,_0x287542){return function(_0x4a4e3c){if(_0x4a4e3c){var _0x9fc0e7=_0x4a4e3c[_0x6ec5('0x1d')],_0xdc0b10=_0x287542[_0x6ec5('0x1e')],_0x4d09fe=_0x287542[_0x6ec5('0x1e')]+_0x287542[_0x6ec5('0x1f')],_0x13b725;if(_0x4d09fe>=_0x9fc0e7){_0x4d09fe=_0x9fc0e7;_0x13b725=0xc8;}else{_0x13b725=0xce;}_0x14e9dc[_0x6ec5('0x1b')](_0x13b725);return _0x14e9dc[_0x6ec5('0x20')](_0x6ec5('0x21'),_0xdc0b10+'-'+_0x4d09fe+'/'+_0x9fc0e7)[_0x6ec5('0x22')](_0x4a4e3c);}return null;};}function patchUpdates(_0x3d5d45){return function(_0x17f7a2){try{jsonpatch[_0x6ec5('0x23')](_0x17f7a2,_0x3d5d45,!![]);}catch(_0x437f0f){return BPromise[_0x6ec5('0x24')](_0x437f0f);}return _0x17f7a2[_0x6ec5('0x25')]();};}function saveUpdates(_0x3d08e9,_0x12ba7f){return function(_0x4abd5d){if(_0x4abd5d){return _0x4abd5d[_0x6ec5('0x26')](_0x3d08e9)[_0x6ec5('0x27')](function(_0xd045b){return _0xd045b;});}return null;};}function removeEntity(_0x20f5a6,_0x3fc9d7){return function(_0x38a821){if(_0x38a821){return _0x38a821[_0x6ec5('0x28')]()['then'](function(){_0x20f5a6[_0x6ec5('0x1b')](0xcc)[_0x6ec5('0x1c')]();});}};}function handleEntityNotFound(_0x358d18,_0x1560c6){return function(_0x57060c){if(!_0x57060c){_0x358d18[_0x6ec5('0x1a')](0x194);}return _0x57060c;};}function handleError(_0x280748,_0x5be80f){_0x5be80f=_0x5be80f||0x1f4;return function(_0x2dc0a7){logger[_0x6ec5('0x29')](_0x2dc0a7[_0x6ec5('0x2a')]);if(_0x2dc0a7['name']){delete _0x2dc0a7[_0x6ec5('0x2b')];}_0x280748[_0x6ec5('0x1b')](_0x5be80f)[_0x6ec5('0x2c')](_0x2dc0a7);};}exports[_0x6ec5('0x2d')]=function(_0x425fac,_0x484847){var _0x171e2a={},_0x267a30={},_0x4a9860={'count':0x0,'rows':[]};var _0x2570c7=db[_0x6ec5('0x2e')]['rawAttributes'];_0x267a30[_0x6ec5('0x2f')]=_[_0x6ec5('0x30')](_0x2570c7);_0x267a30[_0x6ec5('0x31')]=_[_0x6ec5('0x30')](_0x425fac[_0x6ec5('0x31')]);_0x267a30['filters']=_[_0x6ec5('0x32')](_0x267a30[_0x6ec5('0x2f')],_0x267a30[_0x6ec5('0x31')]);_0x171e2a[_0x6ec5('0x33')]=_[_0x6ec5('0x32')](_0x267a30[_0x6ec5('0x2f')],qs[_0x6ec5('0x34')](_0x425fac['query'][_0x6ec5('0x34')]));_0x171e2a['attributes']=_0x171e2a[_0x6ec5('0x33')]['length']?_0x171e2a[_0x6ec5('0x33')]:_0x267a30[_0x6ec5('0x2f')];if(!_0x425fac['query']['hasOwnProperty'](_0x6ec5('0x35'))){_0x171e2a[_0x6ec5('0x1f')]=qs['limit'](_0x425fac[_0x6ec5('0x31')][_0x6ec5('0x1f')]);_0x171e2a['offset']=qs[_0x6ec5('0x1e')](_0x425fac[_0x6ec5('0x31')][_0x6ec5('0x1e')]);}_0x171e2a[_0x6ec5('0x36')]=qs[_0x6ec5('0x37')](_0x425fac[_0x6ec5('0x31')][_0x6ec5('0x37')]);_0x171e2a[_0x6ec5('0x38')]=qs['filters'](_[_0x6ec5('0x39')](_0x425fac['query'],_0x267a30[_0x6ec5('0x3a')]));if(_0x425fac[_0x6ec5('0x31')][_0x6ec5('0x3b')]){_0x171e2a[_0x6ec5('0x38')]=_[_0x6ec5('0x3c')](_0x171e2a[_0x6ec5('0x38')],{'$or':_[_0x6ec5('0x3d')](_0x2570c7,function(_0xab380e){if(_0xab380e[_0x6ec5('0x3e')][_0x6ec5('0x3f')]!==_0x6ec5('0x40')){var _0x496246={};_0x496246[_0xab380e['field']]={'$like':'%'+_0x425fac[_0x6ec5('0x31')]['filter']+'%'};return _0x496246;}})});}_0x171e2a=_[_0x6ec5('0x3c')]({},_0x171e2a,_0x425fac[_0x6ec5('0x41')]);var _0xfa8414={'where':_0x171e2a[_0x6ec5('0x38')]};return db[_0x6ec5('0x2e')][_0x6ec5('0x1d')](_0xfa8414)[_0x6ec5('0x27')](function(_0x5a0a8c){_0x4a9860[_0x6ec5('0x1d')]=_0x5a0a8c;if(_0x425fac[_0x6ec5('0x31')][_0x6ec5('0x42')]){_0x171e2a[_0x6ec5('0x43')]=[{'all':!![]}];}return db[_0x6ec5('0x2e')][_0x6ec5('0x44')](_0x171e2a);})[_0x6ec5('0x27')](function(_0x4354e4){_0x4a9860[_0x6ec5('0x45')]=_0x4354e4;return _0x4a9860;})['then'](respondWithFilteredResult(_0x484847,_0x171e2a))[_0x6ec5('0x46')](handleError(_0x484847,null));};exports['show']=function(_0x19ac12,_0x58bdd0){var _0x18b409={'raw':!![],'where':{'id':_0x19ac12['params']['id']}},_0x45de3c={};_0x45de3c[_0x6ec5('0x2f')]=_[_0x6ec5('0x30')](db[_0x6ec5('0x2e')]['rawAttributes']);_0x45de3c[_0x6ec5('0x31')]=_[_0x6ec5('0x30')](_0x19ac12['query']);_0x45de3c[_0x6ec5('0x3a')]=_[_0x6ec5('0x32')](_0x45de3c[_0x6ec5('0x2f')],_0x45de3c[_0x6ec5('0x31')]);_0x18b409[_0x6ec5('0x33')]=_[_0x6ec5('0x32')](_0x45de3c[_0x6ec5('0x2f')],qs[_0x6ec5('0x34')](_0x19ac12[_0x6ec5('0x31')][_0x6ec5('0x34')]));_0x18b409[_0x6ec5('0x33')]=_0x18b409['attributes'][_0x6ec5('0x47')]?_0x18b409[_0x6ec5('0x33')]:_0x45de3c[_0x6ec5('0x2f')];if(_0x19ac12[_0x6ec5('0x31')]['includeAll']){_0x18b409[_0x6ec5('0x43')]=[{'all':!![]}];}_0x18b409=_[_0x6ec5('0x3c')]({},_0x18b409,_0x19ac12['options']);return db[_0x6ec5('0x2e')]['find'](_0x18b409)[_0x6ec5('0x27')](handleEntityNotFound(_0x58bdd0,null))[_0x6ec5('0x27')](respondWithResult(_0x58bdd0,null))[_0x6ec5('0x46')](handleError(_0x58bdd0,null));};exports[_0x6ec5('0x48')]=function(_0x51f2ef,_0x5b0656){return db[_0x6ec5('0x2e')]['create'](_0x51f2ef[_0x6ec5('0x49')],{})[_0x6ec5('0x27')](respondWithResult(_0x5b0656,0xc9))[_0x6ec5('0x46')](handleError(_0x5b0656,null));};exports[_0x6ec5('0x26')]=function(_0x2cf8c7,_0x4d6733){if(_0x2cf8c7['body']['id']){delete _0x2cf8c7[_0x6ec5('0x49')]['id'];}return db[_0x6ec5('0x2e')][_0x6ec5('0x4a')]({'where':{'id':_0x2cf8c7[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x27')](handleEntityNotFound(_0x4d6733,null))[_0x6ec5('0x27')](saveUpdates(_0x2cf8c7[_0x6ec5('0x49')],null))[_0x6ec5('0x27')](respondWithResult(_0x4d6733,null))[_0x6ec5('0x46')](handleError(_0x4d6733,null));};exports[_0x6ec5('0x28')]=function(_0xd265c,_0x1c5e2f){return db[_0x6ec5('0x2e')][_0x6ec5('0x4a')]({'where':{'id':_0xd265c['params']['id']}})[_0x6ec5('0x27')](handleEntityNotFound(_0x1c5e2f,null))['then'](removeEntity(_0x1c5e2f,null))[_0x6ec5('0x46')](handleError(_0x1c5e2f,null));};exports[_0x6ec5('0x4c')]=function(_0x5295e4,_0x3f404c){return db[_0x6ec5('0x2e')]['describe']()[_0x6ec5('0x27')](respondWithResult(_0x3f404c,null))[_0x6ec5('0x46')](handleError(_0x3f404c,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index b0369eb..5b56e8a 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 _0x038b=['report_mail_transfer','util','../../config/logger','api','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x038b,0x114));var _0xb038=function(_0x5b05ff,_0x4983d2){_0x5b05ff=_0x5b05ff-0x0;var _0x51815c=_0x038b[_0x5b05ff];return _0x51815c;};'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':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','util','moment'];(function(_0x26a855,_0x845170){var _0x301785=function(_0x38d0f6){while(--_0x38d0f6){_0x26a855['push'](_0x26a855['shift']());}};_0x301785(++_0x845170);}(_0xe14b,0x93));var _0xbe14=function(_0x37231a,_0x1be277){_0x37231a=_0x37231a-0x0;var _0x254f89=_0xe14b[_0x37231a];return _0x254f89;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6bcfa7a..b3423ec 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 _0xe657=['../../config/logger','rpc','client','then','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x21af74,_0x1ceddf){var _0x262f1f=function(_0x561eec){while(--_0x561eec){_0x21af74['push'](_0x21af74['shift']());}};_0x262f1f(++_0x1ceddf);}(_0xe657,0x109));var _0x7e65=function(_0x391143,_0x33aef6){_0x391143=_0x391143-0x0;var _0x22f6e4=_0xe657[_0x391143];return _0x22f6e4;};'use strict';var _=require(_0x7e65('0x0'));var util=require(_0x7e65('0x1'));var moment=require(_0x7e65('0x2'));var BPromise=require(_0x7e65('0x3'));var rs=require(_0x7e65('0x4'));var fs=require('fs');var Redis=require(_0x7e65('0x5'));var db=require(_0x7e65('0x6'))['db'];var utils=require(_0x7e65('0x7'));var logger=require(_0x7e65('0x8'))(_0x7e65('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e65('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1789b0,_0xec560a,_0x57ecfc){return new BPromise(function(_0x1809d9,_0x2d4412){return client['request'](_0x1789b0,_0x57ecfc)[_0x7e65('0xb')](function(_0x369519){logger['info'](_0x7e65('0xc'),_0xec560a,'request\x20sent');logger[_0x7e65('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xec560a,_0x7e65('0xe'),JSON['stringify'](_0x369519));if(_0x369519['error']){if(_0x369519[_0x7e65('0xf')][_0x7e65('0x10')]===0x1f4){logger[_0x7e65('0xf')](_0x7e65('0xc'),_0xec560a,_0x369519[_0x7e65('0xf')][_0x7e65('0x11')]);return _0x2d4412(_0x369519[_0x7e65('0xf')][_0x7e65('0x11')]);}logger[_0x7e65('0xf')](_0x7e65('0xc'),_0xec560a,_0x369519[_0x7e65('0xf')][_0x7e65('0x11')]);return _0x1809d9(_0x369519[_0x7e65('0xf')][_0x7e65('0x11')]);}else{logger[_0x7e65('0x12')](_0x7e65('0xc'),_0xec560a,'request\x20sent');_0x1809d9(_0x369519[_0x7e65('0x13')]['message']);}})[_0x7e65('0x14')](function(_0x50bfaf){logger['error'](_0x7e65('0xc'),_0xec560a,_0x50bfaf);_0x2d4412(_0x50bfaf);});});} \ No newline at end of file +var _0x7c6b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x2ba295,_0x16b2b9){var _0x2cff3c=function(_0x326ba4){while(--_0x326ba4){_0x2ba295['push'](_0x2ba295['shift']());}};_0x2cff3c(++_0x16b2b9);}(_0x7c6b,0xcd));var _0xb7c6=function(_0x35aa37,_0x48d3df){_0x35aa37=_0x35aa37-0x0;var _0x3a1f43=_0x7c6b[_0x35aa37];return _0x3a1f43;};'use strict';var _=require(_0xb7c6('0x0'));var util=require(_0xb7c6('0x1'));var moment=require(_0xb7c6('0x2'));var BPromise=require(_0xb7c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7c6('0x4'));var db=require(_0xb7c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7c6('0x6'))(_0xb7c6('0x7'));var config=require(_0xb7c6('0x8'));var jayson=require(_0xb7c6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3444a2,_0x321f73,_0xf746a4){return new BPromise(function(_0x7e8207,_0x2fcc39){return client['request'](_0x3444a2,_0xf746a4)[_0xb7c6('0xa')](function(_0x301691){logger[_0xb7c6('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x321f73,'request\x20sent');logger['debug'](_0xb7c6('0xc'),_0x321f73,_0xb7c6('0xd'),JSON[_0xb7c6('0xe')](_0x301691));if(_0x301691[_0xb7c6('0xf')]){if(_0x301691[_0xb7c6('0xf')][_0xb7c6('0x10')]===0x1f4){logger[_0xb7c6('0xf')](_0xb7c6('0x11'),_0x321f73,_0x301691[_0xb7c6('0xf')][_0xb7c6('0x12')]);return _0x2fcc39(_0x301691['error']['message']);}logger[_0xb7c6('0xf')](_0xb7c6('0x11'),_0x321f73,_0x301691['error'][_0xb7c6('0x12')]);return _0x7e8207(_0x301691[_0xb7c6('0xf')][_0xb7c6('0x12')]);}else{logger[_0xb7c6('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x321f73,_0xb7c6('0xd'));_0x7e8207(_0x301691[_0xb7c6('0x13')][_0xb7c6('0x12')]);}})[_0xb7c6('0x14')](function(_0xd67aa4){logger[_0xb7c6('0xf')](_0xb7c6('0x11'),_0x321f73,_0xd67aa4);_0x2fcc39(_0xd67aa4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5309720..695249b 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 _0x6f9d=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete','/:id','destroy'];(function(_0x25d8ef,_0x2eb859){var _0x3409b4=function(_0x23b986){while(--_0x23b986){_0x25d8ef['push'](_0x25d8ef['shift']());}};_0x3409b4(++_0x2eb859);}(_0x6f9d,0x161));var _0xd6f9=function(_0x4d73d8,_0x3ee19d){_0x4d73d8=_0x4d73d8-0x0;var _0x9f83bd=_0x6f9d[_0x4d73d8];return _0x9f83bd;};'use strict';var multer=require(_0xd6f9('0x0'));var util=require(_0xd6f9('0x1'));var path=require('path');var timeout=require(_0xd6f9('0x2'));var express=require(_0xd6f9('0x3'));var router=express[_0xd6f9('0x4')]();var auth=require(_0xd6f9('0x5'));var interaction=require(_0xd6f9('0x6'));var config=require(_0xd6f9('0x7'));var controller=require(_0xd6f9('0x8'));router[_0xd6f9('0x9')]('/',auth[_0xd6f9('0xa')](),controller[_0xd6f9('0xb')]);router[_0xd6f9('0x9')](_0xd6f9('0xc'),auth[_0xd6f9('0xa')](),controller['describe']);router[_0xd6f9('0x9')]('/:id',auth[_0xd6f9('0xa')](),controller[_0xd6f9('0xd')]);router[_0xd6f9('0xe')]('/',auth[_0xd6f9('0xa')](),controller[_0xd6f9('0xf')]);router[_0xd6f9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd6f9('0x11')]);router[_0xd6f9('0x12')](_0xd6f9('0x13'),auth[_0xd6f9('0xa')](),controller[_0xd6f9('0x14')]);module[_0xd6f9('0x15')]=router; \ No newline at end of file +var _0x6b3f=['delete','destroy','exports','multer','util','path','express','../../components/auth/service','./memberReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put'];(function(_0x5e1f67,_0x7ea7f1){var _0x59136f=function(_0x131803){while(--_0x131803){_0x5e1f67['push'](_0x5e1f67['shift']());}};_0x59136f(++_0x7ea7f1);}(_0x6b3f,0x9c));var _0xf6b3=function(_0x5c06f8,_0x2ec76b){_0x5c06f8=_0x5c06f8-0x0;var _0x25e772=_0x6b3f[_0x5c06f8];return _0x25e772;};'use strict';var multer=require(_0xf6b3('0x0'));var util=require(_0xf6b3('0x1'));var path=require(_0xf6b3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf6b3('0x3'));var router=express['Router']();var auth=require(_0xf6b3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf6b3('0x5'));router[_0xf6b3('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b3('0x7')]);router['get']('/describe',auth[_0xf6b3('0x8')](),controller[_0xf6b3('0x9')]);router[_0xf6b3('0x6')](_0xf6b3('0xa'),auth[_0xf6b3('0x8')](),controller['show']);router[_0xf6b3('0xb')]('/',auth['isAuthenticated'](),controller[_0xf6b3('0xc')]);router[_0xf6b3('0xd')]('/:id',auth[_0xf6b3('0x8')](),controller['update']);router[_0xf6b3('0xe')](_0xf6b3('0xa'),auth[_0xf6b3('0x8')](),controller[_0xf6b3('0xf')]);module[_0xf6b3('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 130f4fa..4e619bf 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 _0x1a1e=['seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff'];(function(_0x44f52f,_0x452b88){var _0x566f79=function(_0xfbf7fa){while(--_0xfbf7fa){_0x44f52f['push'](_0x44f52f['shift']());}};_0x566f79(++_0x452b88);}(_0x1a1e,0xc3));var _0xe1a1=function(_0x2cb825,_0x2d6557){_0x2cb825=_0x2cb825-0x0;var _0x1eafef=_0x1a1e[_0x2cb825];return _0x1eafef;};'use strict';var Sequelize=require(_0xe1a1('0x0'));var moment=require(_0xe1a1('0x1'));module[_0xe1a1('0x2')]={'channel':{'type':Sequelize[_0xe1a1('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xe1a1('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe1a1('0x4')},'duration':{'type':Sequelize[_0xe1a1('0x5')]},'enterAt':{'type':Sequelize[_0xe1a1('0x6')]},'exitAt':{'type':Sequelize[_0xe1a1('0x6')],'set':function(_0x1b098b){var _0x196524=moment(_0x1b098b);var _0x51cae0=moment(this[_0xe1a1('0x7')]('enterAt'));var _0x10dd6c=_0x196524[_0xe1a1('0x8')](_0x51cae0,_0xe1a1('0x9'));this['setDataValue'](_0xe1a1('0xa'),_0x1b098b);this[_0xe1a1('0xb')](_0xe1a1('0xc'),_0x10dd6c||null);}},'data1':{'type':Sequelize[_0xe1a1('0x3')],'comment':_0xe1a1('0xd')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xe1a1('0x3')],'comment':_0xe1a1('0xe')},'data4':{'type':Sequelize[_0xe1a1('0x3')],'comment':_0xe1a1('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0xe1a1('0x10')},'role':{'type':Sequelize[_0xe1a1('0x3')]},'internal':{'type':Sequelize[_0xe1a1('0x5')]},'uniqueid':{'type':Sequelize[_0xe1a1('0x3')]}}; \ No newline at end of file +var _0x8497=['getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x5142f0,_0x2794ef){var _0xaa74de=function(_0x22bef2){while(--_0x22bef2){_0x5142f0['push'](_0x5142f0['shift']());}};_0xaa74de(++_0x2794ef);}(_0x8497,0x1d5));var _0x7849=function(_0x2d4b24,_0x1a0386){_0x2d4b24=_0x2d4b24-0x0;var _0x28f259=_0x8497[_0x2d4b24];return _0x28f259;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7849('0x0'));module[_0x7849('0x1')]={'channel':{'type':Sequelize[_0x7849('0x2')]},'membername':{'type':Sequelize[_0x7849('0x2')]},'interface':{'type':Sequelize[_0x7849('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x7849('0x3'),'comment':_0x7849('0x4')},'duration':{'type':Sequelize[_0x7849('0x5')]},'enterAt':{'type':Sequelize[_0x7849('0x6')]},'exitAt':{'type':Sequelize[_0x7849('0x6')],'set':function(_0x3dc650){var _0x3f7b09=moment(_0x3dc650);var _0x5987f5=moment(this[_0x7849('0x7')](_0x7849('0x8')));var _0x51bcbf=_0x3f7b09[_0x7849('0x9')](_0x5987f5,'seconds');this[_0x7849('0xa')](_0x7849('0xb'),_0x3dc650);this[_0x7849('0xa')](_0x7849('0xc'),_0x51bcbf||null);}},'data1':{'type':Sequelize[_0x7849('0x2')],'comment':_0x7849('0xd')},'data2':{'type':Sequelize[_0x7849('0x2')],'comment':_0x7849('0xe')},'data3':{'type':Sequelize[_0x7849('0x2')],'comment':_0x7849('0xf')},'data4':{'type':Sequelize[_0x7849('0x2')],'comment':_0x7849('0x10')},'data5':{'type':Sequelize[_0x7849('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x7849('0x5')]},'uniqueid':{'type':Sequelize[_0x7849('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 10e61e3..0362630 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 _0x1db6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','filter','merge','where','map','type','VIRTUAL','field','MemberReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x1db6,0x1f1));var _0x61db=function(_0x1838e2,_0x51463f){_0x1838e2=_0x1838e2-0x0;var _0x41e4b8=_0x1db6[_0x1838e2];return _0x41e4b8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x61db('0x0'));var rimraf=require(_0x61db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61db('0x2'));var rp=require(_0x61db('0x3'));var moment=require(_0x61db('0x4'));var BPromise=require(_0x61db('0x5'));var Mustache=require('mustache');var util=require(_0x61db('0x6'));var path=require(_0x61db('0x7'));var sox=require(_0x61db('0x8'));var csv=require(_0x61db('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x61db('0xa'));var squel=require('squel');var crypto=require(_0x61db('0xb'));var jsforce=require(_0x61db('0xc'));var deskjs=require(_0x61db('0xd'));var toCsv=require(_0x61db('0x9'));var querystring=require('querystring');var Papa=require(_0x61db('0xe'));var Redis=require(_0x61db('0xf'));var authService=require(_0x61db('0x10'));var qs=require(_0x61db('0x11'));var hardwareService=require(_0x61db('0x12'));var logger=require(_0x61db('0x13'))(_0x61db('0x14'));var utils=require(_0x61db('0x15'));var config=require(_0x61db('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ff6d7,_0x1e055a){_0x1e055a=_0x1e055a||0xcc;return function(_0x398660){if(_0x398660){return _0x3ff6d7[_0x61db('0x17')](_0x1e055a);}return _0x3ff6d7[_0x61db('0x18')](_0x1e055a)[_0x61db('0x19')]();};}function respondWithResult(_0x1241f4,_0x59f55b){_0x59f55b=_0x59f55b||0xc8;return function(_0x3cfd7a){if(_0x3cfd7a){return _0x1241f4[_0x61db('0x18')](_0x59f55b)[_0x61db('0x1a')](_0x3cfd7a);}};}function respondWithFilteredResult(_0x2cb08e,_0x4a4019){return function(_0x211812){if(_0x211812){var _0x5307d2=_0x211812[_0x61db('0x1b')],_0x4cfca8=_0x4a4019[_0x61db('0x1c')],_0x5e6658=_0x4a4019[_0x61db('0x1c')]+_0x4a4019[_0x61db('0x1d')],_0x11cfde;if(_0x5e6658>=_0x5307d2){_0x5e6658=_0x5307d2;_0x11cfde=0xc8;}else{_0x11cfde=0xce;}_0x2cb08e[_0x61db('0x18')](_0x11cfde);return _0x2cb08e['set'](_0x61db('0x1e'),_0x4cfca8+'-'+_0x5e6658+'/'+_0x5307d2)[_0x61db('0x1a')](_0x211812);}return null;};}function patchUpdates(_0x463d32){return function(_0x16038c){try{jsonpatch[_0x61db('0x1f')](_0x16038c,_0x463d32,!![]);}catch(_0x25ed2b){return BPromise[_0x61db('0x20')](_0x25ed2b);}return _0x16038c[_0x61db('0x21')]();};}function saveUpdates(_0x33b616,_0x8ad116){return function(_0x22b0bf){if(_0x22b0bf){return _0x22b0bf[_0x61db('0x22')](_0x33b616)['then'](function(_0x5d3924){return _0x5d3924;});}return null;};}function removeEntity(_0x114c7e,_0x1c7674){return function(_0x267900){if(_0x267900){return _0x267900[_0x61db('0x23')]()[_0x61db('0x24')](function(){_0x114c7e['status'](0xcc)[_0x61db('0x19')]();});}};}function handleEntityNotFound(_0x235602,_0x184ec0){return function(_0x28c9ce){if(!_0x28c9ce){_0x235602['sendStatus'](0x194);}return _0x28c9ce;};}function handleError(_0x563f5a,_0x396237){_0x396237=_0x396237||0x1f4;return function(_0x1d1ea6){logger[_0x61db('0x25')](_0x1d1ea6[_0x61db('0x26')]);if(_0x1d1ea6['name']){delete _0x1d1ea6['name'];}_0x563f5a[_0x61db('0x18')](_0x396237)[_0x61db('0x27')](_0x1d1ea6);};}exports[_0x61db('0x28')]=function(_0x5d383e,_0x4f68de){var _0x5b0ed0={},_0x2d4a45={},_0x76daf9={'count':0x0,'rows':[]};var _0x15d7c7=db['MemberReport'][_0x61db('0x29')];_0x2d4a45[_0x61db('0x2a')]=_[_0x61db('0x2b')](_0x15d7c7);_0x2d4a45[_0x61db('0x2c')]=_['keys'](_0x5d383e[_0x61db('0x2c')]);_0x2d4a45['filters']=_['intersection'](_0x2d4a45[_0x61db('0x2a')],_0x2d4a45['query']);_0x5b0ed0[_0x61db('0x2d')]=_[_0x61db('0x2e')](_0x2d4a45[_0x61db('0x2a')],qs[_0x61db('0x2f')](_0x5d383e[_0x61db('0x2c')]['fields']));_0x5b0ed0[_0x61db('0x2d')]=_0x5b0ed0[_0x61db('0x2d')][_0x61db('0x30')]?_0x5b0ed0['attributes']:_0x2d4a45[_0x61db('0x2a')];if(!_0x5d383e[_0x61db('0x2c')][_0x61db('0x31')](_0x61db('0x32'))){_0x5b0ed0[_0x61db('0x1d')]=qs['limit'](_0x5d383e[_0x61db('0x2c')]['limit']);_0x5b0ed0[_0x61db('0x1c')]=qs['offset'](_0x5d383e[_0x61db('0x2c')][_0x61db('0x1c')]);}_0x5b0ed0['order']=qs[_0x61db('0x33')](_0x5d383e[_0x61db('0x2c')]['sort']);_0x5b0ed0['where']=qs[_0x61db('0x34')](_['pick'](_0x5d383e[_0x61db('0x2c')],_0x2d4a45[_0x61db('0x34')]));if(_0x5d383e['query'][_0x61db('0x35')]){_0x5b0ed0['where']=_[_0x61db('0x36')](_0x5b0ed0[_0x61db('0x37')],{'$or':_[_0x61db('0x38')](_0x15d7c7,function(_0x4b8806){if(_0x4b8806[_0x61db('0x39')]['key']!==_0x61db('0x3a')){var _0x21c049={};_0x21c049[_0x4b8806[_0x61db('0x3b')]]={'$like':'%'+_0x5d383e['query'][_0x61db('0x35')]+'%'};return _0x21c049;}})});}_0x5b0ed0=_[_0x61db('0x36')]({},_0x5b0ed0,_0x5d383e['options']);var _0xcf3f00={'where':_0x5b0ed0[_0x61db('0x37')]};return db[_0x61db('0x3c')][_0x61db('0x1b')](_0xcf3f00)[_0x61db('0x24')](function(_0x318b62){_0x76daf9[_0x61db('0x1b')]=_0x318b62;if(_0x5d383e[_0x61db('0x2c')][_0x61db('0x3d')]){_0x5b0ed0[_0x61db('0x3e')]=[{'all':!![]}];}return db[_0x61db('0x3c')][_0x61db('0x3f')](_0x5b0ed0);})[_0x61db('0x24')](function(_0x2c97ef){_0x76daf9[_0x61db('0x40')]=_0x2c97ef;return _0x76daf9;})[_0x61db('0x24')](respondWithFilteredResult(_0x4f68de,_0x5b0ed0))[_0x61db('0x41')](handleError(_0x4f68de,null));};exports[_0x61db('0x42')]=function(_0x11e68e,_0x1b6f07){var _0x2cb3df={'raw':!![],'where':{'id':_0x11e68e[_0x61db('0x43')]['id']}},_0x97e320={};_0x97e320[_0x61db('0x2a')]=_[_0x61db('0x2b')](db[_0x61db('0x3c')]['rawAttributes']);_0x97e320['query']=_[_0x61db('0x2b')](_0x11e68e[_0x61db('0x2c')]);_0x97e320[_0x61db('0x34')]=_[_0x61db('0x2e')](_0x97e320[_0x61db('0x2a')],_0x97e320[_0x61db('0x2c')]);_0x2cb3df[_0x61db('0x2d')]=_[_0x61db('0x2e')](_0x97e320[_0x61db('0x2a')],qs[_0x61db('0x2f')](_0x11e68e[_0x61db('0x2c')][_0x61db('0x2f')]));_0x2cb3df[_0x61db('0x2d')]=_0x2cb3df['attributes']['length']?_0x2cb3df[_0x61db('0x2d')]:_0x97e320['model'];if(_0x11e68e['query']['includeAll']){_0x2cb3df['include']=[{'all':!![]}];}_0x2cb3df=_[_0x61db('0x36')]({},_0x2cb3df,_0x11e68e[_0x61db('0x44')]);return db[_0x61db('0x3c')][_0x61db('0x45')](_0x2cb3df)['then'](handleEntityNotFound(_0x1b6f07,null))[_0x61db('0x24')](respondWithResult(_0x1b6f07,null))[_0x61db('0x41')](handleError(_0x1b6f07,null));};exports['create']=function(_0x34c464,_0x5b061a){return db[_0x61db('0x3c')][_0x61db('0x46')](_0x34c464[_0x61db('0x47')],{})[_0x61db('0x24')](respondWithResult(_0x5b061a,0xc9))[_0x61db('0x41')](handleError(_0x5b061a,null));};exports['update']=function(_0x3966aa,_0x162678){if(_0x3966aa[_0x61db('0x47')]['id']){delete _0x3966aa[_0x61db('0x47')]['id'];}return db['MemberReport']['find']({'where':{'id':_0x3966aa[_0x61db('0x43')]['id']}})[_0x61db('0x24')](handleEntityNotFound(_0x162678,null))[_0x61db('0x24')](saveUpdates(_0x3966aa[_0x61db('0x47')],null))[_0x61db('0x24')](respondWithResult(_0x162678,null))['catch'](handleError(_0x162678,null));};exports[_0x61db('0x23')]=function(_0x415797,_0x4d2a06){return db['MemberReport']['find']({'where':{'id':_0x415797[_0x61db('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d2a06,null))[_0x61db('0x24')](removeEntity(_0x4d2a06,null))[_0x61db('0x41')](handleError(_0x4d2a06,null));};exports[_0x61db('0x48')]=function(_0x1e56ec,_0x5c09c8){return db[_0x61db('0x3c')][_0x61db('0x48')]()[_0x61db('0x24')](respondWithResult(_0x5c09c8,null))[_0x61db('0x41')](handleError(_0x5c09c8,null));}; \ No newline at end of file +var _0x4adf=['show','params','find','create','body','destroy','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','then','error','name','send','index','rawAttributes','keys','query','intersection','attributes','fields','length','model','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','MemberReport','count','includeAll','include','findAll','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4adf,0x1b1));var _0xf4ad=function(_0x1af400,_0x3d4cf6){_0x1af400=_0x1af400-0x0;var _0x4d988b=_0x4adf[_0x1af400];return _0x4d988b;};'use strict';var pdf=require(_0xf4ad('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf4ad('0x1'));var jsonpatch=require(_0xf4ad('0x2'));var rp=require(_0xf4ad('0x3'));var moment=require(_0xf4ad('0x4'));var BPromise=require(_0xf4ad('0x5'));var Mustache=require(_0xf4ad('0x6'));var util=require(_0xf4ad('0x7'));var path=require(_0xf4ad('0x8'));var sox=require(_0xf4ad('0x9'));var csv=require(_0xf4ad('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf4ad('0xb'));var squel=require(_0xf4ad('0xc'));var crypto=require(_0xf4ad('0xd'));var jsforce=require(_0xf4ad('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf4ad('0xa'));var querystring=require(_0xf4ad('0xf'));var Papa=require(_0xf4ad('0x10'));var Redis=require('ioredis');var authService=require(_0xf4ad('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf4ad('0x12'));var logger=require(_0xf4ad('0x13'))('api');var utils=require(_0xf4ad('0x14'));var config=require('../../config/environment');var db=require(_0xf4ad('0x15'))['db'];function respondWithStatusCode(_0x28c797,_0x52feb0){_0x52feb0=_0x52feb0||0xcc;return function(_0x1c8ae0){if(_0x1c8ae0){return _0x28c797[_0xf4ad('0x16')](_0x52feb0);}return _0x28c797['status'](_0x52feb0)[_0xf4ad('0x17')]();};}function respondWithResult(_0x7521d3,_0x147265){_0x147265=_0x147265||0xc8;return function(_0x2a3d28){if(_0x2a3d28){return _0x7521d3[_0xf4ad('0x18')](_0x147265)[_0xf4ad('0x19')](_0x2a3d28);}};}function respondWithFilteredResult(_0x53b599,_0x190ced){return function(_0x221cd5){if(_0x221cd5){var _0x5b7133=_0x221cd5['count'],_0x4a7008=_0x190ced[_0xf4ad('0x1a')],_0x361510=_0x190ced['offset']+_0x190ced[_0xf4ad('0x1b')],_0x5c37ce;if(_0x361510>=_0x5b7133){_0x361510=_0x5b7133;_0x5c37ce=0xc8;}else{_0x5c37ce=0xce;}_0x53b599['status'](_0x5c37ce);return _0x53b599[_0xf4ad('0x1c')](_0xf4ad('0x1d'),_0x4a7008+'-'+_0x361510+'/'+_0x5b7133)[_0xf4ad('0x19')](_0x221cd5);}return null;};}function patchUpdates(_0x3565ee){return function(_0x4d9d49){try{jsonpatch[_0xf4ad('0x1e')](_0x4d9d49,_0x3565ee,!![]);}catch(_0x4a09ea){return BPromise[_0xf4ad('0x1f')](_0x4a09ea);}return _0x4d9d49['save']();};}function saveUpdates(_0x494ea5,_0x41dc32){return function(_0x4f6711){if(_0x4f6711){return _0x4f6711['update'](_0x494ea5)['then'](function(_0x551eac){return _0x551eac;});}return null;};}function removeEntity(_0x10e8d5,_0x59580c){return function(_0x27aebe){if(_0x27aebe){return _0x27aebe['destroy']()[_0xf4ad('0x20')](function(){_0x10e8d5[_0xf4ad('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x185efa,_0xf03226){return function(_0x19c39d){if(!_0x19c39d){_0x185efa[_0xf4ad('0x16')](0x194);}return _0x19c39d;};}function handleError(_0x2279de,_0xbb3add){_0xbb3add=_0xbb3add||0x1f4;return function(_0x27511d){logger[_0xf4ad('0x21')](_0x27511d['stack']);if(_0x27511d[_0xf4ad('0x22')]){delete _0x27511d[_0xf4ad('0x22')];}_0x2279de['status'](_0xbb3add)[_0xf4ad('0x23')](_0x27511d);};}exports[_0xf4ad('0x24')]=function(_0x28763f,_0x19e2bc){var _0x18b0f2={},_0xe61654={},_0x440bca={'count':0x0,'rows':[]};var _0x3b86c6=db['MemberReport'][_0xf4ad('0x25')];_0xe61654['model']=_[_0xf4ad('0x26')](_0x3b86c6);_0xe61654[_0xf4ad('0x27')]=_[_0xf4ad('0x26')](_0x28763f['query']);_0xe61654['filters']=_[_0xf4ad('0x28')](_0xe61654['model'],_0xe61654[_0xf4ad('0x27')]);_0x18b0f2[_0xf4ad('0x29')]=_[_0xf4ad('0x28')](_0xe61654['model'],qs[_0xf4ad('0x2a')](_0x28763f[_0xf4ad('0x27')][_0xf4ad('0x2a')]));_0x18b0f2['attributes']=_0x18b0f2['attributes'][_0xf4ad('0x2b')]?_0x18b0f2[_0xf4ad('0x29')]:_0xe61654[_0xf4ad('0x2c')];if(!_0x28763f['query']['hasOwnProperty'](_0xf4ad('0x2d'))){_0x18b0f2['limit']=qs['limit'](_0x28763f['query'][_0xf4ad('0x1b')]);_0x18b0f2['offset']=qs['offset'](_0x28763f['query'][_0xf4ad('0x1a')]);}_0x18b0f2[_0xf4ad('0x2e')]=qs[_0xf4ad('0x2f')](_0x28763f[_0xf4ad('0x27')][_0xf4ad('0x2f')]);_0x18b0f2[_0xf4ad('0x30')]=qs[_0xf4ad('0x31')](_[_0xf4ad('0x32')](_0x28763f[_0xf4ad('0x27')],_0xe61654['filters']));if(_0x28763f[_0xf4ad('0x27')][_0xf4ad('0x33')]){_0x18b0f2[_0xf4ad('0x30')]=_[_0xf4ad('0x34')](_0x18b0f2['where'],{'$or':_[_0xf4ad('0x35')](_0x3b86c6,function(_0x3123ac){if(_0x3123ac[_0xf4ad('0x36')]['key']!==_0xf4ad('0x37')){var _0x1ca57b={};_0x1ca57b[_0x3123ac[_0xf4ad('0x38')]]={'$like':'%'+_0x28763f[_0xf4ad('0x27')][_0xf4ad('0x33')]+'%'};return _0x1ca57b;}})});}_0x18b0f2=_[_0xf4ad('0x34')]({},_0x18b0f2,_0x28763f[_0xf4ad('0x39')]);var _0x2854b5={'where':_0x18b0f2[_0xf4ad('0x30')]};return db[_0xf4ad('0x3a')][_0xf4ad('0x3b')](_0x2854b5)['then'](function(_0x334213){_0x440bca[_0xf4ad('0x3b')]=_0x334213;if(_0x28763f[_0xf4ad('0x27')][_0xf4ad('0x3c')]){_0x18b0f2[_0xf4ad('0x3d')]=[{'all':!![]}];}return db[_0xf4ad('0x3a')][_0xf4ad('0x3e')](_0x18b0f2);})[_0xf4ad('0x20')](function(_0x2dfa75){_0x440bca['rows']=_0x2dfa75;return _0x440bca;})[_0xf4ad('0x20')](respondWithFilteredResult(_0x19e2bc,_0x18b0f2))[_0xf4ad('0x3f')](handleError(_0x19e2bc,null));};exports[_0xf4ad('0x40')]=function(_0x432cd4,_0x5d85c8){var _0x2a54a3={'raw':!![],'where':{'id':_0x432cd4[_0xf4ad('0x41')]['id']}},_0xc736d8={};_0xc736d8[_0xf4ad('0x2c')]=_[_0xf4ad('0x26')](db[_0xf4ad('0x3a')][_0xf4ad('0x25')]);_0xc736d8[_0xf4ad('0x27')]=_[_0xf4ad('0x26')](_0x432cd4[_0xf4ad('0x27')]);_0xc736d8[_0xf4ad('0x31')]=_[_0xf4ad('0x28')](_0xc736d8[_0xf4ad('0x2c')],_0xc736d8[_0xf4ad('0x27')]);_0x2a54a3[_0xf4ad('0x29')]=_[_0xf4ad('0x28')](_0xc736d8[_0xf4ad('0x2c')],qs[_0xf4ad('0x2a')](_0x432cd4[_0xf4ad('0x27')][_0xf4ad('0x2a')]));_0x2a54a3[_0xf4ad('0x29')]=_0x2a54a3['attributes'][_0xf4ad('0x2b')]?_0x2a54a3[_0xf4ad('0x29')]:_0xc736d8[_0xf4ad('0x2c')];if(_0x432cd4[_0xf4ad('0x27')][_0xf4ad('0x3c')]){_0x2a54a3[_0xf4ad('0x3d')]=[{'all':!![]}];}_0x2a54a3=_[_0xf4ad('0x34')]({},_0x2a54a3,_0x432cd4[_0xf4ad('0x39')]);return db[_0xf4ad('0x3a')][_0xf4ad('0x42')](_0x2a54a3)[_0xf4ad('0x20')](handleEntityNotFound(_0x5d85c8,null))[_0xf4ad('0x20')](respondWithResult(_0x5d85c8,null))[_0xf4ad('0x3f')](handleError(_0x5d85c8,null));};exports[_0xf4ad('0x43')]=function(_0x2b9457,_0x4e2c13){return db[_0xf4ad('0x3a')][_0xf4ad('0x43')](_0x2b9457['body'],{})[_0xf4ad('0x20')](respondWithResult(_0x4e2c13,0xc9))[_0xf4ad('0x3f')](handleError(_0x4e2c13,null));};exports['update']=function(_0x117acf,_0x1642aa){if(_0x117acf[_0xf4ad('0x44')]['id']){delete _0x117acf[_0xf4ad('0x44')]['id'];}return db[_0xf4ad('0x3a')][_0xf4ad('0x42')]({'where':{'id':_0x117acf[_0xf4ad('0x41')]['id']}})[_0xf4ad('0x20')](handleEntityNotFound(_0x1642aa,null))[_0xf4ad('0x20')](saveUpdates(_0x117acf[_0xf4ad('0x44')],null))[_0xf4ad('0x20')](respondWithResult(_0x1642aa,null))[_0xf4ad('0x3f')](handleError(_0x1642aa,null));};exports[_0xf4ad('0x45')]=function(_0x5a0b2a,_0xe2a208){return db['MemberReport'][_0xf4ad('0x42')]({'where':{'id':_0x5a0b2a[_0xf4ad('0x41')]['id']}})['then'](handleEntityNotFound(_0xe2a208,null))[_0xf4ad('0x20')](removeEntity(_0xe2a208,null))[_0xf4ad('0x3f')](handleError(_0xe2a208,null));};exports[_0xf4ad('0x46')]=function(_0x302b71,_0xeb5246){return db['MemberReport']['describe']()[_0xf4ad('0x20')](respondWithResult(_0xeb5246,null))[_0xf4ad('0x3f')](handleError(_0xeb5246,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 795c9d6..4298321 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 _0x26c1=['membername_interface','membername','interface','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define'];(function(_0xd3de3c,_0x3d37c9){var _0x24c6f3=function(_0x44437b){while(--_0x44437b){_0xd3de3c['push'](_0xd3de3c['shift']());}};_0x24c6f3(++_0x3d37c9);}(_0x26c1,0x189));var _0x126c=function(_0x45ce90,_0x114609){_0x45ce90=_0x45ce90-0x0;var _0x313c45=_0x26c1[_0x45ce90];return _0x313c45;};'use strict';var _=require(_0x126c('0x0'));var util=require(_0x126c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x126c('0x2'));var BPromise=require(_0x126c('0x3'));var rp=require(_0x126c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x126c('0x5'));var config=require(_0x126c('0x6'));var attributes=require(_0x126c('0x7'));module[_0x126c('0x8')]=function(_0x3ffd5a,_0x256381){return _0x3ffd5a[_0x126c('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x126c('0xa'),'fields':[_0x126c('0xb'),_0x126c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc5a=['rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc5a,0x86));var _0xacc5=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0xcc5a[_0x1a595a];return _0x33f008;};'use strict';var _=require(_0xacc5('0x0'));var util=require(_0xacc5('0x1'));var logger=require(_0xacc5('0x2'))(_0xacc5('0x3'));var moment=require('moment');var BPromise=require(_0xacc5('0x4'));var rp=require(_0xacc5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacc5('0x6'));var config=require(_0xacc5('0x7'));var attributes=require(_0xacc5('0x8'));module[_0xacc5('0x9')]=function(_0x571525,_0x5ca964){return _0x571525['define'](_0xacc5('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xacc5('0xb'),'fields':[_0xacc5('0xc'),_0xacc5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 86434ea..7cc1704 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 _0xcd15=['randomstring','ioredis','../../mysqldb','rpc','../../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','catch','GetMemberReport','MemberReport','options','raw','attributes','include','map','model','CreateMemberReport','create','body','UpdateMemberReport','update','where','limit','util','moment','bluebird'];(function(_0x3aaef5,_0x16cdc8){var _0x4c0ed5=function(_0x4f7046){while(--_0x4f7046){_0x3aaef5['push'](_0x3aaef5['shift']());}};_0x4c0ed5(++_0x16cdc8);}(_0xcd15,0x95));var _0x5cd1=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0xcd15[_0x291d3f];return _0x242080;};'use strict';var _=require('lodash');var util=require(_0x5cd1('0x0'));var moment=require(_0x5cd1('0x1'));var BPromise=require(_0x5cd1('0x2'));var rs=require(_0x5cd1('0x3'));var fs=require('fs');var Redis=require(_0x5cd1('0x4'));var db=require(_0x5cd1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5cd1('0x6'));var config=require(_0x5cd1('0x7'));var jayson=require(_0x5cd1('0x8'));var client=jayson['client'][_0x5cd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41bafa,_0x8bbdad,_0x42cebb){return new BPromise(function(_0x2be1cb,_0x4e824f){return client[_0x5cd1('0xa')](_0x41bafa,_0x42cebb)[_0x5cd1('0xb')](function(_0x1c7d47){logger[_0x5cd1('0xc')](_0x5cd1('0xd'),_0x8bbdad,_0x5cd1('0xe'));logger[_0x5cd1('0xf')](_0x5cd1('0x10'),_0x8bbdad,_0x5cd1('0xe'),JSON[_0x5cd1('0x11')](_0x1c7d47));if(_0x1c7d47[_0x5cd1('0x12')]){if(_0x1c7d47[_0x5cd1('0x12')][_0x5cd1('0x13')]===0x1f4){logger[_0x5cd1('0x12')](_0x5cd1('0xd'),_0x8bbdad,_0x1c7d47[_0x5cd1('0x12')][_0x5cd1('0x14')]);return _0x4e824f(_0x1c7d47[_0x5cd1('0x12')][_0x5cd1('0x14')]);}logger['error'](_0x5cd1('0xd'),_0x8bbdad,_0x1c7d47[_0x5cd1('0x12')]['message']);return _0x2be1cb(_0x1c7d47['error'][_0x5cd1('0x14')]);}else{logger[_0x5cd1('0xc')]('MemberReport,\x20%s,\x20%s',_0x8bbdad,_0x5cd1('0xe'));_0x2be1cb(_0x1c7d47[_0x5cd1('0x15')][_0x5cd1('0x14')]);}})[_0x5cd1('0x16')](function(_0x339589){logger[_0x5cd1('0x12')](_0x5cd1('0xd'),_0x8bbdad,_0x339589);_0x4e824f(_0x339589);});});}exports[_0x5cd1('0x17')]=function(_0x5ae334){var _0x16debb=this;return new Promise(function(_0x2366dc,_0x19ce6f){return db[_0x5cd1('0x18')]['findAll']({'raw':_0x5ae334[_0x5cd1('0x19')]?_0x5ae334['options'][_0x5cd1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ae334[_0x5cd1('0x19')]?_0x5ae334[_0x5cd1('0x19')]['where']||null:null,'attributes':_0x5ae334['options']?_0x5ae334[_0x5cd1('0x19')][_0x5cd1('0x1b')]||null:null,'limit':_0x5ae334[_0x5cd1('0x19')]?_0x5ae334['options']['limit']||null:null,'include':_0x5ae334[_0x5cd1('0x19')]?_0x5ae334[_0x5cd1('0x19')][_0x5cd1('0x1c')]?_[_0x5cd1('0x1d')](_0x5ae334['options']['include'],function(_0x2f3b2b){return{'model':db[_0x2f3b2b[_0x5cd1('0x1e')]],'as':_0x2f3b2b['as'],'attributes':_0x2f3b2b[_0x5cd1('0x1b')],'include':_0x2f3b2b[_0x5cd1('0x1c')]?_[_0x5cd1('0x1d')](_0x2f3b2b[_0x5cd1('0x1c')],function(_0x5aaea6){return{'model':db[_0x5aaea6[_0x5cd1('0x1e')]],'as':_0x5aaea6['as'],'attributes':_0x5aaea6[_0x5cd1('0x1b')],'include':_0x5aaea6[_0x5cd1('0x1c')]?_[_0x5cd1('0x1d')](_0x5aaea6['include'],function(_0x33808a){return{'model':db[_0x33808a[_0x5cd1('0x1e')]],'as':_0x33808a['as'],'attributes':_0x33808a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cd1('0xb')](function(_0x549e0c){logger[_0x5cd1('0xc')](_0x5cd1('0x17'),_0x5ae334);logger['debug'](_0x5cd1('0x17'),_0x5ae334,JSON[_0x5cd1('0x11')](_0x549e0c));_0x2366dc(_0x549e0c);})[_0x5cd1('0x16')](function(_0xf043e2){logger[_0x5cd1('0x12')]('GetMemberReport',_0xf043e2[_0x5cd1('0x14')],_0x5ae334);_0x19ce6f(_0x16debb['error'](0x1f4,_0xf043e2[_0x5cd1('0x14')]));});});};exports[_0x5cd1('0x1f')]=function(_0xa673d6){var _0x79f4d2=this;return new Promise(function(_0xf8df12,_0x4fc605){return db['MemberReport'][_0x5cd1('0x20')](_0xa673d6[_0x5cd1('0x21')],{'raw':_0xa673d6[_0x5cd1('0x19')]?_0xa673d6[_0x5cd1('0x19')][_0x5cd1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5bbee3){logger[_0x5cd1('0xc')](_0x5cd1('0x1f'),_0xa673d6);logger['debug'](_0x5cd1('0x1f'),_0xa673d6,JSON['stringify'](_0x5bbee3));_0xf8df12(_0x5bbee3);})['catch'](function(_0x5c18cf){logger['error'](_0x5cd1('0x1f'),_0x5c18cf[_0x5cd1('0x14')],_0xa673d6);_0x4fc605(_0x79f4d2['error'](0x1f4,_0x5c18cf[_0x5cd1('0x14')]));});});};exports[_0x5cd1('0x22')]=function(_0x279e52){var _0x57bd12=this;return new Promise(function(_0xb5dff0,_0x27e6e5){return db[_0x5cd1('0x18')][_0x5cd1('0x23')](_0x279e52[_0x5cd1('0x21')],{'raw':_0x279e52['options']?_0x279e52['options'][_0x5cd1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x279e52[_0x5cd1('0x19')]?_0x279e52[_0x5cd1('0x19')][_0x5cd1('0x24')]||null:null,'attributes':_0x279e52['options']?_0x279e52['options'][_0x5cd1('0x1b')]||null:null,'limit':_0x279e52[_0x5cd1('0x19')]?_0x279e52[_0x5cd1('0x19')][_0x5cd1('0x25')]||null:null})[_0x5cd1('0xb')](function(_0x1677a3){logger[_0x5cd1('0xc')]('UpdateMemberReport',_0x279e52);logger[_0x5cd1('0xf')](_0x5cd1('0x22'),_0x279e52,JSON['stringify'](_0x1677a3));_0xb5dff0(_0x1677a3);})[_0x5cd1('0x16')](function(_0x2f1915){logger[_0x5cd1('0x12')]('UpdateMemberReport',_0x2f1915[_0x5cd1('0x14')],_0x279e52);_0x27e6e5(_0x57bd12['error'](0x1f4,_0x2f1915['message']));});});}; \ No newline at end of file +var _0xa899=['raw','where','attributes','limit','include','map','model','catch','create','CreateMemberReport','update','body','UpdateMemberReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','MemberReport','findAll','options'];(function(_0x2bd0f1,_0x44e670){var _0x5d5332=function(_0x57bfcc){while(--_0x57bfcc){_0x2bd0f1['push'](_0x2bd0f1['shift']());}};_0x5d5332(++_0x44e670);}(_0xa899,0x155));var _0x9a89=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0xa899[_0x1034bb];return _0x453fdb;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var moment=require(_0x9a89('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a89('0x3'));var fs=require('fs');var Redis=require(_0x9a89('0x4'));var db=require(_0x9a89('0x5'))['db'];var utils=require(_0x9a89('0x6'));var logger=require(_0x9a89('0x7'))(_0x9a89('0x8'));var config=require(_0x9a89('0x9'));var jayson=require(_0x9a89('0xa'));var client=jayson[_0x9a89('0xb')][_0x9a89('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10fe5e,_0x995cf7,_0x5e5454){return new BPromise(function(_0x5ab174,_0x4d2b72){return client[_0x9a89('0xd')](_0x10fe5e,_0x5e5454)[_0x9a89('0xe')](function(_0x569b37){logger[_0x9a89('0xf')]('MemberReport,\x20%s,\x20%s',_0x995cf7,_0x9a89('0x10'));logger[_0x9a89('0x11')](_0x9a89('0x12'),_0x995cf7,_0x9a89('0x10'),JSON[_0x9a89('0x13')](_0x569b37));if(_0x569b37[_0x9a89('0x14')]){if(_0x569b37[_0x9a89('0x14')]['code']===0x1f4){logger['error'](_0x9a89('0x15'),_0x995cf7,_0x569b37[_0x9a89('0x14')][_0x9a89('0x16')]);return _0x4d2b72(_0x569b37['error']['message']);}logger['error'](_0x9a89('0x15'),_0x995cf7,_0x569b37[_0x9a89('0x14')]['message']);return _0x5ab174(_0x569b37[_0x9a89('0x14')][_0x9a89('0x16')]);}else{logger[_0x9a89('0xf')](_0x9a89('0x15'),_0x995cf7,'request\x20sent');_0x5ab174(_0x569b37[_0x9a89('0x17')][_0x9a89('0x16')]);}})['catch'](function(_0x4fe73e){logger[_0x9a89('0x14')]('MemberReport,\x20%s,\x20%s',_0x995cf7,_0x4fe73e);_0x4d2b72(_0x4fe73e);});});}exports[_0x9a89('0x18')]=function(_0x334725){var _0x53db7f=this;return new Promise(function(_0xdbb337,_0x5d8a62){return db[_0x9a89('0x19')][_0x9a89('0x1a')]({'raw':_0x334725['options']?_0x334725[_0x9a89('0x1b')][_0x9a89('0x1c')]===undefined?!![]:![]:!![],'where':_0x334725[_0x9a89('0x1b')]?_0x334725[_0x9a89('0x1b')][_0x9a89('0x1d')]||null:null,'attributes':_0x334725[_0x9a89('0x1b')]?_0x334725[_0x9a89('0x1b')][_0x9a89('0x1e')]||null:null,'limit':_0x334725['options']?_0x334725['options'][_0x9a89('0x1f')]||null:null,'include':_0x334725[_0x9a89('0x1b')]?_0x334725[_0x9a89('0x1b')][_0x9a89('0x20')]?_[_0x9a89('0x21')](_0x334725[_0x9a89('0x1b')]['include'],function(_0x50adcf){return{'model':db[_0x50adcf[_0x9a89('0x22')]],'as':_0x50adcf['as'],'attributes':_0x50adcf['attributes'],'include':_0x50adcf[_0x9a89('0x20')]?_[_0x9a89('0x21')](_0x50adcf[_0x9a89('0x20')],function(_0x3b1807){return{'model':db[_0x3b1807[_0x9a89('0x22')]],'as':_0x3b1807['as'],'attributes':_0x3b1807[_0x9a89('0x1e')],'include':_0x3b1807[_0x9a89('0x20')]?_['map'](_0x3b1807[_0x9a89('0x20')],function(_0x5002a2){return{'model':db[_0x5002a2[_0x9a89('0x22')]],'as':_0x5002a2['as'],'attributes':_0x5002a2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x340999){logger[_0x9a89('0xf')]('GetMemberReport',_0x334725);logger[_0x9a89('0x11')]('GetMemberReport',_0x334725,JSON[_0x9a89('0x13')](_0x340999));_0xdbb337(_0x340999);})[_0x9a89('0x23')](function(_0x267512){logger[_0x9a89('0x14')](_0x9a89('0x18'),_0x267512[_0x9a89('0x16')],_0x334725);_0x5d8a62(_0x53db7f[_0x9a89('0x14')](0x1f4,_0x267512['message']));});});};exports['CreateMemberReport']=function(_0x48f05d){var _0x44e2fd=this;return new Promise(function(_0x5c57aa,_0x1d34b1){return db[_0x9a89('0x19')][_0x9a89('0x24')](_0x48f05d['body'],{'raw':_0x48f05d[_0x9a89('0x1b')]?_0x48f05d['options'][_0x9a89('0x1c')]===undefined?!![]:![]:!![]})[_0x9a89('0xe')](function(_0x48a9aa){logger[_0x9a89('0xf')](_0x9a89('0x25'),_0x48f05d);logger['debug'](_0x9a89('0x25'),_0x48f05d,JSON[_0x9a89('0x13')](_0x48a9aa));_0x5c57aa(_0x48a9aa);})[_0x9a89('0x23')](function(_0x264338){logger[_0x9a89('0x14')](_0x9a89('0x25'),_0x264338[_0x9a89('0x16')],_0x48f05d);_0x1d34b1(_0x44e2fd[_0x9a89('0x14')](0x1f4,_0x264338[_0x9a89('0x16')]));});});};exports['UpdateMemberReport']=function(_0x409b5e){var _0x1b36db=this;return new Promise(function(_0x265177,_0x711de4){return db[_0x9a89('0x19')][_0x9a89('0x26')](_0x409b5e[_0x9a89('0x27')],{'raw':_0x409b5e[_0x9a89('0x1b')]?_0x409b5e[_0x9a89('0x1b')][_0x9a89('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409b5e['options']?_0x409b5e[_0x9a89('0x1b')][_0x9a89('0x1d')]||null:null,'attributes':_0x409b5e[_0x9a89('0x1b')]?_0x409b5e[_0x9a89('0x1b')][_0x9a89('0x1e')]||null:null,'limit':_0x409b5e[_0x9a89('0x1b')]?_0x409b5e[_0x9a89('0x1b')][_0x9a89('0x1f')]||null:null})[_0x9a89('0xe')](function(_0x77fa47){logger[_0x9a89('0xf')](_0x9a89('0x28'),_0x409b5e);logger['debug'](_0x9a89('0x28'),_0x409b5e,JSON['stringify'](_0x77fa47));_0x265177(_0x77fa47);})[_0x9a89('0x23')](function(_0x2c9cff){logger[_0x9a89('0x14')](_0x9a89('0x28'),_0x2c9cff[_0x9a89('0x16')],_0x409b5e);_0x711de4(_0x1b36db[_0x9a89('0x14')](0x1f4,_0x2c9cff[_0x9a89('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 483e20d..3ba980c 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 _0x9097=['../../components/interaction/service','./migration.controller','get','index','exports','../../components/auth/service'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9097,0x13d));var _0x7909=function(_0x279937,_0x377474){_0x279937=_0x279937-0x0;var _0x3ef803=_0x9097[_0x279937];return _0x3ef803;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x7909('0x0'));var interaction=require(_0x7909('0x1'));var config=require('../../config/environment');var controller=require(_0x7909('0x2'));router[_0x7909('0x3')]('/',controller[_0x7909('0x4')]);module[_0x7909('0x5')]=router; \ No newline at end of file +var _0x218e=['path','express','../../components/interaction/service','../../config/environment','./migration.controller','get','index','multer','util'];(function(_0x28a598,_0x185138){var _0x2912bf=function(_0x50172b){while(--_0x50172b){_0x28a598['push'](_0x28a598['shift']());}};_0x2912bf(++_0x185138);}(_0x218e,0x1b7));var _0xe218=function(_0x2e35bc,_0x6619ec){_0x2e35bc=_0x2e35bc-0x0;var _0x2a372b=_0x218e[_0x2e35bc];return _0x2a372b;};'use strict';var multer=require(_0xe218('0x0'));var util=require(_0xe218('0x1'));var path=require(_0xe218('0x2'));var timeout=require('connect-timeout');var express=require(_0xe218('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe218('0x4'));var config=require(_0xe218('0x5'));var controller=require(_0xe218('0x6'));router[_0xe218('0x7')]('/',controller[_0xe218('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 47e1621..e77679f 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 _0xdc7d=['sequelize','version'];(function(_0x5b8e43,_0x5adc62){var _0x308eaf=function(_0x164f2c){while(--_0x164f2c){_0x5b8e43['push'](_0x5b8e43['shift']());}};_0x308eaf(++_0x5adc62);}(_0xdc7d,0xde));var _0xddc7=function(_0x4b352f,_0x36e96b){_0x4b352f=_0x4b352f-0x0;var _0x525069=_0xdc7d[_0x4b352f];return _0x525069;};'use strict';var Sequelize=require(_0xddc7('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xddc7('0x1')}}; \ No newline at end of file +var _0xf95e=['exports','STRING','version','sequelize'];(function(_0x15b09f,_0x300bb5){var _0x3a6fb8=function(_0x838198){while(--_0x838198){_0x15b09f['push'](_0x15b09f['shift']());}};_0x3a6fb8(++_0x300bb5);}(_0xf95e,0x1bb));var _0xef95=function(_0x512ca2,_0xc78ccf){_0x512ca2=_0x512ca2-0x0;var _0x520b6f=_0xf95e[_0x512ca2];return _0x520b6f;};'use strict';var Sequelize=require(_0xef95('0x0'));module[_0xef95('0x1')]={'version':{'type':Sequelize[_0xef95('0x2')],'unique':_0xef95('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 035dbfe..a131811 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 _0x67ad=['to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','merge','options','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox'];(function(_0x1e5812,_0x5dbe72){var _0x49da26=function(_0x2970dd){while(--_0x2970dd){_0x1e5812['push'](_0x1e5812['shift']());}};_0x49da26(++_0x5dbe72);}(_0x67ad,0x1bd));var _0xd67a=function(_0x488d61,_0x5ce679){_0x488d61=_0x488d61-0x0;var _0x20f436=_0x67ad[_0x488d61];return _0x20f436;};'use strict';var pdf=require(_0xd67a('0x0'));var emlformat=require(_0xd67a('0x1'));var rimraf=require(_0xd67a('0x2'));var zipdir=require(_0xd67a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd67a('0x4'));var moment=require(_0xd67a('0x5'));var BPromise=require(_0xd67a('0x6'));var Mustache=require('mustache');var util=require(_0xd67a('0x7'));var path=require(_0xd67a('0x8'));var sox=require(_0xd67a('0x9'));var csv=require(_0xd67a('0xa'));var ejs=require(_0xd67a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd67a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd67a('0xd'));var toCsv=require(_0xd67a('0xa'));var querystring=require(_0xd67a('0xe'));var Papa=require(_0xd67a('0xf'));var Redis=require('ioredis');var authService=require(_0xd67a('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd67a('0x11'));var logger=require(_0xd67a('0x12'))(_0xd67a('0x13'));var utils=require(_0xd67a('0x14'));var config=require(_0xd67a('0x15'));var db=require(_0xd67a('0x16'))['db'];function respondWithStatusCode(_0x257ab2,_0x4a6ea7){_0x4a6ea7=_0x4a6ea7||0xcc;return function(_0xce3b0){if(_0xce3b0){return _0x257ab2[_0xd67a('0x17')](_0x4a6ea7);}return _0x257ab2[_0xd67a('0x18')](_0x4a6ea7)[_0xd67a('0x19')]();};}function respondWithResult(_0x59955f,_0x2a20d2){_0x2a20d2=_0x2a20d2||0xc8;return function(_0x408de8){if(_0x408de8){return _0x59955f[_0xd67a('0x18')](_0x2a20d2)[_0xd67a('0x1a')](_0x408de8);}};}function respondWithFilteredResult(_0x671684,_0x4c6761){return function(_0x3e0ada){if(_0x3e0ada){var _0x3288f1=_0x3e0ada[_0xd67a('0x1b')],_0x5580cc=_0x4c6761['offset'],_0x140de5=_0x4c6761[_0xd67a('0x1c')]+_0x4c6761[_0xd67a('0x1d')],_0x421eeb;if(_0x140de5>=_0x3288f1){_0x140de5=_0x3288f1;_0x421eeb=0xc8;}else{_0x421eeb=0xce;}_0x671684[_0xd67a('0x18')](_0x421eeb);return _0x671684[_0xd67a('0x1e')](_0xd67a('0x1f'),_0x5580cc+'-'+_0x140de5+'/'+_0x3288f1)[_0xd67a('0x1a')](_0x3e0ada);}return null;};}function patchUpdates(_0x4bff65){return function(_0x39cc59){try{jsonpatch['apply'](_0x39cc59,_0x4bff65,!![]);}catch(_0x98e1cb){return BPromise['reject'](_0x98e1cb);}return _0x39cc59[_0xd67a('0x20')]();};}function saveUpdates(_0x457a2e,_0x1383f5){return function(_0x3697ac){if(_0x3697ac){return _0x3697ac[_0xd67a('0x21')](_0x457a2e)[_0xd67a('0x22')](function(_0x31b995){return _0x31b995;});}return null;};}function removeEntity(_0x1c012f,_0x51a570){return function(_0x269a4d){if(_0x269a4d){return _0x269a4d[_0xd67a('0x23')]()[_0xd67a('0x22')](function(){_0x1c012f[_0xd67a('0x18')](0xcc)[_0xd67a('0x19')]();});}};}function handleEntityNotFound(_0x1645f9,_0x1f80b8){return function(_0x33bb21){if(!_0x33bb21){_0x1645f9['sendStatus'](0x194);}return _0x33bb21;};}function handleError(_0x2a36c9,_0x222e0e){_0x222e0e=_0x222e0e||0x1f4;return function(_0x5b1ef8){logger[_0xd67a('0x24')](_0x5b1ef8[_0xd67a('0x25')]);if(_0x5b1ef8[_0xd67a('0x26')]){delete _0x5b1ef8['name'];}_0x2a36c9[_0xd67a('0x18')](_0x222e0e)[_0xd67a('0x27')](_0x5b1ef8);};}exports[_0xd67a('0x28')]=function(_0x14be31,_0x468b38){var _0x4b5c7a={},_0x19033c={},_0x1d9065={'count':0x0,'rows':[]};var _0x5832f3=db[_0xd67a('0x29')][_0xd67a('0x2a')];_0x19033c[_0xd67a('0x2b')]=_[_0xd67a('0x2c')](_0x5832f3);_0x19033c[_0xd67a('0x2d')]=_['keys'](_0x14be31[_0xd67a('0x2d')]);_0x19033c[_0xd67a('0x2e')]=_['intersection'](_0x19033c[_0xd67a('0x2b')],_0x19033c[_0xd67a('0x2d')]);_0x4b5c7a[_0xd67a('0x2f')]=_[_0xd67a('0x30')](_0x19033c['model'],qs[_0xd67a('0x31')](_0x14be31[_0xd67a('0x2d')]['fields']));_0x4b5c7a[_0xd67a('0x2f')]=_0x4b5c7a[_0xd67a('0x2f')]['length']?_0x4b5c7a[_0xd67a('0x2f')]:_0x19033c['model'];if(!_0x14be31[_0xd67a('0x2d')]['hasOwnProperty'](_0xd67a('0x32'))){_0x4b5c7a[_0xd67a('0x1d')]=qs[_0xd67a('0x1d')](_0x14be31[_0xd67a('0x2d')]['limit']);_0x4b5c7a[_0xd67a('0x1c')]=qs[_0xd67a('0x1c')](_0x14be31[_0xd67a('0x2d')][_0xd67a('0x1c')]);}_0x4b5c7a[_0xd67a('0x33')]=qs[_0xd67a('0x34')](_0x14be31[_0xd67a('0x2d')][_0xd67a('0x34')]);_0x4b5c7a[_0xd67a('0x35')]=qs[_0xd67a('0x2e')](_['pick'](_0x14be31['query'],_0x19033c[_0xd67a('0x2e')]));if(_0x14be31[_0xd67a('0x2d')][_0xd67a('0x36')]){_0x4b5c7a[_0xd67a('0x35')]=_['merge'](_0x4b5c7a[_0xd67a('0x35')],{'$or':_[_0xd67a('0x37')](_0x5832f3,function(_0x56dc1f){if(_0x56dc1f[_0xd67a('0x38')][_0xd67a('0x39')]!==_0xd67a('0x3a')){var _0x26703d={};_0x26703d[_0x56dc1f['field']]={'$like':'%'+_0x14be31[_0xd67a('0x2d')][_0xd67a('0x36')]+'%'};return _0x26703d;}})});}_0x4b5c7a=_[_0xd67a('0x3b')]({},_0x4b5c7a,_0x14be31[_0xd67a('0x3c')]);var _0x529ae2={'where':_0x4b5c7a[_0xd67a('0x35')]};return db[_0xd67a('0x29')][_0xd67a('0x1b')](_0x529ae2)['then'](function(_0x3ecdc0){_0x1d9065[_0xd67a('0x1b')]=_0x3ecdc0;if(_0x14be31[_0xd67a('0x2d')][_0xd67a('0x3d')]){_0x4b5c7a['include']=[{'all':!![]}];}return db[_0xd67a('0x29')][_0xd67a('0x3e')](_0x4b5c7a);})[_0xd67a('0x22')](function(_0x1673a1){_0x1d9065[_0xd67a('0x3f')]=_0x1673a1;return _0x1d9065;})['then'](respondWithFilteredResult(_0x468b38,_0x4b5c7a))[_0xd67a('0x40')](handleError(_0x468b38,null));}; \ No newline at end of file +var _0x030d=['includeAll','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Migration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options'];(function(_0x1bd230,_0x1da01e){var _0x19a3e3=function(_0x3cb9fa){while(--_0x3cb9fa){_0x1bd230['push'](_0x1bd230['shift']());}};_0x19a3e3(++_0x1da01e);}(_0x030d,0x1c9));var _0xd030=function(_0x221a9f,_0x2a5e1c){_0x221a9f=_0x221a9f-0x0;var _0x5976c7=_0x030d[_0x221a9f];return _0x5976c7;};'use strict';var pdf=require(_0xd030('0x0'));var emlformat=require(_0xd030('0x1'));var rimraf=require(_0xd030('0x2'));var zipdir=require(_0xd030('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd030('0x4'));var moment=require(_0xd030('0x5'));var BPromise=require(_0xd030('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd030('0x7'));var csv=require(_0xd030('0x8'));var ejs=require(_0xd030('0x9'));var fs=require('fs');var _=require(_0xd030('0xa'));var squel=require(_0xd030('0xb'));var crypto=require(_0xd030('0xc'));var jsforce=require(_0xd030('0xd'));var deskjs=require(_0xd030('0xe'));var toCsv=require(_0xd030('0x8'));var querystring=require(_0xd030('0xf'));var Papa=require('papaparse');var Redis=require(_0xd030('0x10'));var authService=require(_0xd030('0x11'));var qs=require(_0xd030('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd030('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd030('0x14'));var db=require(_0xd030('0x15'))['db'];function respondWithStatusCode(_0x961fbb,_0xea3bdd){_0xea3bdd=_0xea3bdd||0xcc;return function(_0x3e4d4f){if(_0x3e4d4f){return _0x961fbb[_0xd030('0x16')](_0xea3bdd);}return _0x961fbb[_0xd030('0x17')](_0xea3bdd)[_0xd030('0x18')]();};}function respondWithResult(_0x506090,_0x41deb8){_0x41deb8=_0x41deb8||0xc8;return function(_0x516401){if(_0x516401){return _0x506090[_0xd030('0x17')](_0x41deb8)[_0xd030('0x19')](_0x516401);}};}function respondWithFilteredResult(_0x56db4c,_0x42a0d8){return function(_0x3d4857){if(_0x3d4857){var _0x3a7f08=_0x3d4857[_0xd030('0x1a')],_0x2d0167=_0x42a0d8[_0xd030('0x1b')],_0x3e651b=_0x42a0d8[_0xd030('0x1b')]+_0x42a0d8[_0xd030('0x1c')],_0x1bb45f;if(_0x3e651b>=_0x3a7f08){_0x3e651b=_0x3a7f08;_0x1bb45f=0xc8;}else{_0x1bb45f=0xce;}_0x56db4c[_0xd030('0x17')](_0x1bb45f);return _0x56db4c['set'](_0xd030('0x1d'),_0x2d0167+'-'+_0x3e651b+'/'+_0x3a7f08)[_0xd030('0x19')](_0x3d4857);}return null;};}function patchUpdates(_0x27226e){return function(_0x5590f0){try{jsonpatch[_0xd030('0x1e')](_0x5590f0,_0x27226e,!![]);}catch(_0x4acb02){return BPromise[_0xd030('0x1f')](_0x4acb02);}return _0x5590f0[_0xd030('0x20')]();};}function saveUpdates(_0x11a818,_0x561eed){return function(_0x244fb3){if(_0x244fb3){return _0x244fb3[_0xd030('0x21')](_0x11a818)[_0xd030('0x22')](function(_0x33ca23){return _0x33ca23;});}return null;};}function removeEntity(_0x5c5d34,_0x2c5371){return function(_0x4e0eba){if(_0x4e0eba){return _0x4e0eba[_0xd030('0x23')]()[_0xd030('0x22')](function(){_0x5c5d34[_0xd030('0x17')](0xcc)[_0xd030('0x18')]();});}};}function handleEntityNotFound(_0x403197,_0x3a64ab){return function(_0x5a4a2f){if(!_0x5a4a2f){_0x403197['sendStatus'](0x194);}return _0x5a4a2f;};}function handleError(_0x5771da,_0x4b0447){_0x4b0447=_0x4b0447||0x1f4;return function(_0x49b0a8){logger[_0xd030('0x24')](_0x49b0a8[_0xd030('0x25')]);if(_0x49b0a8[_0xd030('0x26')]){delete _0x49b0a8[_0xd030('0x26')];}_0x5771da[_0xd030('0x17')](_0x4b0447)[_0xd030('0x27')](_0x49b0a8);};}exports['index']=function(_0x5cb6bb,_0x163ead){var _0x399702={},_0x1aaa22={},_0x4cbacf={'count':0x0,'rows':[]};var _0x5c5d6b=db[_0xd030('0x28')][_0xd030('0x29')];_0x1aaa22['model']=_[_0xd030('0x2a')](_0x5c5d6b);_0x1aaa22[_0xd030('0x2b')]=_[_0xd030('0x2a')](_0x5cb6bb[_0xd030('0x2b')]);_0x1aaa22[_0xd030('0x2c')]=_[_0xd030('0x2d')](_0x1aaa22[_0xd030('0x2e')],_0x1aaa22['query']);_0x399702[_0xd030('0x2f')]=_[_0xd030('0x2d')](_0x1aaa22[_0xd030('0x2e')],qs[_0xd030('0x30')](_0x5cb6bb[_0xd030('0x2b')]['fields']));_0x399702['attributes']=_0x399702[_0xd030('0x2f')][_0xd030('0x31')]?_0x399702[_0xd030('0x2f')]:_0x1aaa22[_0xd030('0x2e')];if(!_0x5cb6bb[_0xd030('0x2b')][_0xd030('0x32')](_0xd030('0x33'))){_0x399702[_0xd030('0x1c')]=qs['limit'](_0x5cb6bb[_0xd030('0x2b')][_0xd030('0x1c')]);_0x399702['offset']=qs[_0xd030('0x1b')](_0x5cb6bb[_0xd030('0x2b')][_0xd030('0x1b')]);}_0x399702[_0xd030('0x34')]=qs['sort'](_0x5cb6bb[_0xd030('0x2b')][_0xd030('0x35')]);_0x399702[_0xd030('0x36')]=qs[_0xd030('0x2c')](_[_0xd030('0x37')](_0x5cb6bb[_0xd030('0x2b')],_0x1aaa22[_0xd030('0x2c')]));if(_0x5cb6bb[_0xd030('0x2b')][_0xd030('0x38')]){_0x399702['where']=_['merge'](_0x399702[_0xd030('0x36')],{'$or':_[_0xd030('0x39')](_0x5c5d6b,function(_0x90bb39){if(_0x90bb39[_0xd030('0x3a')]['key']!==_0xd030('0x3b')){var _0x36c4c7={};_0x36c4c7[_0x90bb39[_0xd030('0x3c')]]={'$like':'%'+_0x5cb6bb[_0xd030('0x2b')][_0xd030('0x38')]+'%'};return _0x36c4c7;}})});}_0x399702=_[_0xd030('0x3d')]({},_0x399702,_0x5cb6bb[_0xd030('0x3e')]);var _0x3e3b4b={'where':_0x399702['where']};return db[_0xd030('0x28')][_0xd030('0x1a')](_0x3e3b4b)[_0xd030('0x22')](function(_0x1f807e){_0x4cbacf['count']=_0x1f807e;if(_0x5cb6bb[_0xd030('0x2b')][_0xd030('0x3f')]){_0x399702['include']=[{'all':!![]}];}return db[_0xd030('0x28')]['findAll'](_0x399702);})[_0xd030('0x22')](function(_0x507524){_0x4cbacf['rows']=_0x507524;return _0x4cbacf;})[_0xd030('0x22')](respondWithFilteredResult(_0x163ead,_0x399702))[_0xd030('0x40')](handleError(_0x163ead,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7e6223a..11b5b35 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 _0x1dcc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','util'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x1dcc,0xa8));var _0xc1dc=function(_0x202cc8,_0x4dc5e2){_0x202cc8=_0x202cc8-0x0;var _0x581593=_0x1dcc[_0x202cc8];return _0x581593;};'use strict';var _=require('lodash');var util=require(_0xc1dc('0x0'));var logger=require(_0xc1dc('0x1'))(_0xc1dc('0x2'));var moment=require(_0xc1dc('0x3'));var BPromise=require(_0xc1dc('0x4'));var rp=require(_0xc1dc('0x5'));var fs=require('fs');var path=require(_0xc1dc('0x6'));var rimraf=require(_0xc1dc('0x7'));var config=require(_0xc1dc('0x8'));var attributes=require(_0xc1dc('0x9'));module[_0xc1dc('0xa')]=function(_0x38b792,_0x5dc395){return _0x38b792[_0xc1dc('0xb')]('Migration',attributes,{'tableName':_0xc1dc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0342=['path','rimraf','./migration.attributes','define','Migration','migrations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x44e7b9,_0xf7f5cc){var _0x1de7ac=function(_0x307551){while(--_0x307551){_0x44e7b9['push'](_0x44e7b9['shift']());}};_0x1de7ac(++_0xf7f5cc);}(_0x0342,0x7e));var _0x2034=function(_0x26dfc5,_0x138166){_0x26dfc5=_0x26dfc5-0x0;var _0x566350=_0x0342[_0x26dfc5];return _0x566350;};'use strict';var _=require(_0x2034('0x0'));var util=require(_0x2034('0x1'));var logger=require(_0x2034('0x2'))('api');var moment=require(_0x2034('0x3'));var BPromise=require(_0x2034('0x4'));var rp=require(_0x2034('0x5'));var fs=require('fs');var path=require(_0x2034('0x6'));var rimraf=require(_0x2034('0x7'));var config=require('../../config/environment');var attributes=require(_0x2034('0x8'));module['exports']=function(_0x48426c,_0x42e2c2){return _0x48426c[_0x2034('0x9')](_0x2034('0xa'),attributes,{'tableName':_0x2034('0xb'),'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 402d74e..5072a34 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 _0x723e=['Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x4a5a01,_0x225785){var _0x518f32=function(_0x96fd45){while(--_0x96fd45){_0x4a5a01['push'](_0x4a5a01['shift']());}};_0x518f32(++_0x225785);}(_0x723e,0x179));var _0xe723=function(_0x388207,_0x4694a5){_0x388207=_0x388207-0x0;var _0x415584=_0x723e[_0x388207];return _0x415584;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var moment=require(_0xe723('0x1'));var BPromise=require(_0xe723('0x2'));var rs=require(_0xe723('0x3'));var fs=require('fs');var Redis=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];var utils=require(_0xe723('0x6'));var logger=require(_0xe723('0x7'))(_0xe723('0x8'));var config=require(_0xe723('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe723('0xa')][_0xe723('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1335cd,_0x3bf082,_0x2aebbd){return new BPromise(function(_0xe50f7,_0x1b46e0){return client[_0xe723('0xc')](_0x1335cd,_0x2aebbd)['then'](function(_0x380444){logger[_0xe723('0xd')](_0xe723('0xe'),_0x3bf082,'request\x20sent');logger[_0xe723('0xf')](_0xe723('0x10'),_0x3bf082,_0xe723('0x11'),JSON['stringify'](_0x380444));if(_0x380444[_0xe723('0x12')]){if(_0x380444[_0xe723('0x12')][_0xe723('0x13')]===0x1f4){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x380444['error'][_0xe723('0x14')]);return _0x1b46e0(_0x380444['error']['message']);}logger['error']('Migration,\x20%s,\x20%s',_0x3bf082,_0x380444[_0xe723('0x12')][_0xe723('0x14')]);return _0xe50f7(_0x380444[_0xe723('0x12')][_0xe723('0x14')]);}else{logger[_0xe723('0xd')]('Migration,\x20%s,\x20%s',_0x3bf082,_0xe723('0x11'));_0xe50f7(_0x380444[_0xe723('0x15')][_0xe723('0x14')]);}})[_0xe723('0x16')](function(_0x347fa0){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x347fa0);_0x1b46e0(_0x347fa0);});});} \ No newline at end of file +var _0x17ba=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8303d1,_0x3bd121){var _0x108cc7=function(_0x417f4a){while(--_0x417f4a){_0x8303d1['push'](_0x8303d1['shift']());}};_0x108cc7(++_0x3bd121);}(_0x17ba,0xab));var _0xa17b=function(_0x5e23c8,_0x4bf988){_0x5e23c8=_0x5e23c8-0x0;var _0x4cc907=_0x17ba[_0x5e23c8];return _0x4cc907;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('Migration,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('Migration,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e527043..fac5fef 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 _0xa994=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','get','/:id','show','post','create','put'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xa994,0x108));var _0x4a99=function(_0x1d5b5b,_0x32c425){_0x1d5b5b=_0x1d5b5b-0x0;var _0x3ad27c=_0xa994[_0x1d5b5b];return _0x3ad27c;};'use strict';var multer=require(_0x4a99('0x0'));var util=require(_0x4a99('0x1'));var path=require(_0x4a99('0x2'));var timeout=require(_0x4a99('0x3'));var express=require(_0x4a99('0x4'));var router=express[_0x4a99('0x5')]();var auth=require(_0x4a99('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4a99('0x7'));var controller=require(_0x4a99('0x8'));router['get']('/',auth[_0x4a99('0x9')](),controller['index']);router[_0x4a99('0xa')](_0x4a99('0xb'),auth[_0x4a99('0x9')](),controller[_0x4a99('0xc')]);router[_0x4a99('0xd')]('/',auth[_0x4a99('0x9')](),controller[_0x4a99('0xe')]);router[_0x4a99('0xf')](_0x4a99('0xb'),auth[_0x4a99('0x9')](),controller[_0x4a99('0x10')]);router[_0x4a99('0x11')](_0x4a99('0xb'),auth['isAuthenticated'](),controller[_0x4a99('0x12')]);module[_0x4a99('0x13')]=router; \ No newline at end of file +var _0xb04c=['update','delete','destroy','exports','util','path','express','Router','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0xb04c,0x1b7));var _0xcb04=function(_0x1f7557,_0x58f3d7){_0x1f7557=_0x1f7557-0x0;var _0x204248=_0xb04c[_0x1f7557];return _0x204248;};'use strict';var multer=require('multer');var util=require(_0xcb04('0x0'));var path=require(_0xcb04('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb04('0x2'));var router=express[_0xcb04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0xcb04('0x4')](),controller[_0xcb04('0x5')]);router['get'](_0xcb04('0x6'),auth[_0xcb04('0x4')](),controller[_0xcb04('0x7')]);router[_0xcb04('0x8')]('/',auth['isAuthenticated'](),controller[_0xcb04('0x9')]);router[_0xcb04('0xa')](_0xcb04('0x6'),auth['isAuthenticated'](),controller[_0xcb04('0xb')]);router[_0xcb04('0xc')](_0xcb04('0x6'),auth[_0xcb04('0x4')](),controller[_0xcb04('0xd')]);module[_0xcb04('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index f6069db..931e75e 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 _0x677c=['STRING','sequelize','exports'];(function(_0x3e4d9a,_0x449a9f){var _0x4124d3=function(_0x3dd192){while(--_0x3dd192){_0x3e4d9a['push'](_0x3e4d9a['shift']());}};_0x4124d3(++_0x449a9f);}(_0x677c,0x1c3));var _0xc677=function(_0x3f0f62,_0x40af2c){_0x3f0f62=_0x3f0f62-0x0;var _0x567f5e=_0x677c[_0x3f0f62];return _0x567f5e;};'use strict';var Sequelize=require(_0xc677('0x0'));module[_0xc677('0x1')]={'type':{'type':Sequelize['ENUM']('localnet','externip')},'value':{'type':Sequelize[_0xc677('0x2')]}}; \ No newline at end of file +var _0x83fc=['externip','STRING','sequelize','exports','ENUM'];(function(_0xac0e18,_0x1aa405){var _0x44d81f=function(_0x276279){while(--_0x276279){_0xac0e18['push'](_0xac0e18['shift']());}};_0x44d81f(++_0x1aa405);}(_0x83fc,0x70));var _0xc83f=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x83fc[_0x456fb1];return _0x4083d6;};'use strict';var Sequelize=require(_0xc83f('0x0'));module[_0xc83f('0x1')]={'type':{'type':Sequelize[_0xc83f('0x2')]('localnet',_0xc83f('0x3'))},'value':{'type':Sequelize[_0xc83f('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 28dfd4d..78f66eb 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 _0xadb5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','index','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','where','pick','filter','map','type','key','VIRTUAL','field','Network','count','includeAll','include','show','params','options','find','create','sequelize','transaction','body','findAll','readFileSync','join','server/files/templates/network.ejs','utf8','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','root','render','writeFileSync','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xadb5,0xad));var _0x5adb=function(_0x8d6691,_0x2ddccf){_0x8d6691=_0x8d6691-0x0;var _0x522554=_0xadb5[_0x8d6691];return _0x522554;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5adb('0x17'));var client=jayson['client'][_0x5adb('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5433bf,_0x8cfcc6,_0x39a0b3){if(_0x39a0b3){var _0x44abe3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44abe3['test'](_0x8cfcc6)){return _0x5433bf;}else{throw new Error(_0x5adb('0x19'));}}else{return _0x5433bf;}}function respondWithRpcPromise(_0x34af2c,_0xf82f72,_0x5263ec,_0x2312de){return new BPromise(function(_0x518823,_0x367d82){var _0x42a482=_0x2312de||client;return _0x42a482[_0x5adb('0x1a')](_0x34af2c,_0x5263ec)[_0x5adb('0x1b')](function(_0x1c0f97){logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));logger[_0x5adb('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0xf82f72,_0x5adb('0x1e'),JSON['stringify'](_0x1c0f97));if(_0x1c0f97[_0x5adb('0x20')]){if(_0x1c0f97['error'][_0x5adb('0x21')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);return _0x367d82(_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);}logger[_0x5adb('0x20')]('Network,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')]['message']);return _0x518823(_0x1c0f97['error'][_0x5adb('0x22')]);}else{logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));_0x518823(_0x1c0f97[_0x5adb('0x23')][_0x5adb('0x22')]);}})[_0x5adb('0x24')](function(_0x4ca150){logger[_0x5adb('0x20')](_0x5adb('0x1d'),_0xf82f72,_0x4ca150);_0x367d82(_0x4ca150);});});}function respondWithStatusCode(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0xcc;return function(_0xeb556c){if(_0xeb556c){return _0x3220cd['sendStatus'](_0x3839fb);}return _0x3220cd[_0x5adb('0x25')](_0x3839fb)[_0x5adb('0x26')]();};}function respondWithResult(_0x5aed76,_0x1feecf){_0x1feecf=_0x1feecf||0xc8;return function(_0x1ded9f){if(_0x1ded9f){return _0x5aed76[_0x5adb('0x25')](_0x1feecf)['json'](_0x1ded9f);}};}function respondWithFilteredResult(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(_0x3a4fca){var _0x2c64a3=_0x3a4fca['count'],_0x36459b=_0xbe21b1['offset'],_0x1c06c4=_0xbe21b1[_0x5adb('0x27')]+_0xbe21b1[_0x5adb('0x28')],_0x4a5d46;if(_0x1c06c4>=_0x2c64a3){_0x1c06c4=_0x2c64a3;_0x4a5d46=0xc8;}else{_0x4a5d46=0xce;}_0x13ad1d[_0x5adb('0x25')](_0x4a5d46);return _0x13ad1d[_0x5adb('0x29')](_0x5adb('0x2a'),_0x36459b+'-'+_0x1c06c4+'/'+_0x2c64a3)['json'](_0x3a4fca);}return null;};}function patchUpdates(_0x11ec2a){return function(_0x34b793){try{jsonpatch[_0x5adb('0x2b')](_0x34b793,_0x11ec2a,!![]);}catch(_0x3b1fed){return BPromise[_0x5adb('0x2c')](_0x3b1fed);}return _0x34b793[_0x5adb('0x2d')]();};}function saveUpdates(_0x28190d,_0x28bf1f){return function(_0x138bf6){if(_0x138bf6){return _0x138bf6[_0x5adb('0x2e')](_0x28190d)['then'](function(_0x2e46ce){return _0x2e46ce;});}return null;};}function removeEntity(_0x4c8b2e,_0x12424d){return function(_0x20cde6){if(_0x20cde6){return _0x20cde6['destroy']()[_0x5adb('0x1b')](function(){_0x4c8b2e[_0x5adb('0x25')](0xcc)[_0x5adb('0x26')]();});}};}function handleEntityNotFound(_0x4a3661,_0x173789){return function(_0x14cf00){if(!_0x14cf00){_0x4a3661['sendStatus'](0x194);}return _0x14cf00;};}function handleError(_0x5bb227,_0x1ed9ea){_0x1ed9ea=_0x1ed9ea||0x1f4;return function(_0x49dd03){logger[_0x5adb('0x20')](_0x49dd03[_0x5adb('0x2f')]);if(_0x49dd03[_0x5adb('0x30')]){delete _0x49dd03[_0x5adb('0x30')];}_0x5bb227[_0x5adb('0x25')](_0x1ed9ea)['send'](_0x49dd03);};}exports[_0x5adb('0x31')]=function(_0x215b88,_0x1c3a5c){var _0x54851b={},_0x4c8870={},_0x32eb69={'count':0x0,'rows':[]};var _0x5d1baa=db['Network'][_0x5adb('0x32')];_0x4c8870['model']=_[_0x5adb('0x33')](_0x5d1baa);_0x4c8870['query']=_[_0x5adb('0x33')](_0x215b88['query']);_0x4c8870[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4c8870['model'],_0x4c8870[_0x5adb('0x36')]);_0x54851b['attributes']=_[_0x5adb('0x35')](_0x4c8870[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0x215b88['query'][_0x5adb('0x38')]));_0x54851b[_0x5adb('0x39')]=_0x54851b[_0x5adb('0x39')][_0x5adb('0x3a')]?_0x54851b[_0x5adb('0x39')]:_0x4c8870['model'];if(!_0x215b88['query']['hasOwnProperty']('nolimit')){_0x54851b[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x28')]);_0x54851b[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x27')]);}_0x54851b['order']=qs['sort'](_0x215b88[_0x5adb('0x36')]['sort']);_0x54851b[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_[_0x5adb('0x3c')](_0x215b88[_0x5adb('0x36')],_0x4c8870[_0x5adb('0x34')]));if(_0x215b88['query'][_0x5adb('0x3d')]){_0x54851b[_0x5adb('0x3b')]=_['merge'](_0x54851b[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x5d1baa,function(_0x5833c8){if(_0x5833c8[_0x5adb('0x3f')][_0x5adb('0x40')]!==_0x5adb('0x41')){var _0x35c379={};_0x35c379[_0x5833c8[_0x5adb('0x42')]]={'$like':'%'+_0x215b88[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x35c379;}})});}_0x54851b=_['merge']({},_0x54851b,_0x215b88['options']);var _0x26a656={'where':_0x54851b[_0x5adb('0x3b')]};return db[_0x5adb('0x43')][_0x5adb('0x44')](_0x26a656)['then'](function(_0x507e48){_0x32eb69[_0x5adb('0x44')]=_0x507e48;if(_0x215b88[_0x5adb('0x36')][_0x5adb('0x45')]){_0x54851b[_0x5adb('0x46')]=[{'all':!![]}];}return db[_0x5adb('0x43')]['findAll'](_0x54851b);})[_0x5adb('0x1b')](function(_0x437f52){_0x32eb69['rows']=_0x437f52;return _0x32eb69;})[_0x5adb('0x1b')](respondWithFilteredResult(_0x1c3a5c,_0x54851b))[_0x5adb('0x24')](handleError(_0x1c3a5c,null));};exports[_0x5adb('0x47')]=function(_0x24758f,_0x186bd2){var _0x3a5409={'raw':!![],'where':{'id':_0x24758f[_0x5adb('0x48')]['id']}},_0x39840e={};_0x39840e['model']=_[_0x5adb('0x33')](db['Network']['rawAttributes']);_0x39840e['query']=_[_0x5adb('0x33')](_0x24758f[_0x5adb('0x36')]);_0x39840e[_0x5adb('0x34')]=_['intersection'](_0x39840e[_0x5adb('0x37')],_0x39840e['query']);_0x3a5409[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x39840e[_0x5adb('0x37')],qs['fields'](_0x24758f[_0x5adb('0x36')]['fields']));_0x3a5409[_0x5adb('0x39')]=_0x3a5409[_0x5adb('0x39')]['length']?_0x3a5409[_0x5adb('0x39')]:_0x39840e[_0x5adb('0x37')];if(_0x24758f[_0x5adb('0x36')][_0x5adb('0x45')]){_0x3a5409[_0x5adb('0x46')]=[{'all':!![]}];}_0x3a5409=_['merge']({},_0x3a5409,_0x24758f[_0x5adb('0x49')]);return db[_0x5adb('0x43')][_0x5adb('0x4a')](_0x3a5409)[_0x5adb('0x1b')](handleEntityNotFound(_0x186bd2,null))['then'](respondWithResult(_0x186bd2,null))[_0x5adb('0x24')](handleError(_0x186bd2,null));};exports[_0x5adb('0x4b')]=function(_0x3b4794,_0x4d98d0,_0x2b34a8){var _0xd0e5b7;return db[_0x5adb('0x4c')][_0x5adb('0x4d')](function(_0x4f2da9){return db[_0x5adb('0x43')][_0x5adb('0x4b')](_0x3b4794[_0x5adb('0x4e')],{'raw':!![]})[_0x5adb('0x1b')](function(_0xa25ac3){_0xd0e5b7=_0xa25ac3;return db['Network'][_0x5adb('0x4f')]({'where':{'type':_0x3b4794['body'][_0x5adb('0x3f')]},'raw':!![]});})['then'](function(_0x31ae72){var _0x35df22=fs[_0x5adb('0x50')](path[_0x5adb('0x51')](config['root'],_0x5adb('0x52')),_0x5adb('0x53'));var _0x24b1f1=ejs['render'](_0x35df22,{'networks':_0x31ae72||[]});fs['writeFileSync'](util['format'](_0x5adb('0x54'),_0x3b4794[_0x5adb('0x4e')][_0x5adb('0x3f')][_0x5adb('0x55')]()),_0x24b1f1);})[_0x5adb('0x1b')](function(){return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x4b'),{'module':_0x5adb('0x57')});})[_0x5adb('0x1b')](function(){return _0xd0e5b7;});})[_0x5adb('0x1b')](respondWithResult(_0x4d98d0,0xc9))[_0x5adb('0x24')](handleError(_0x4d98d0,null));};exports[_0x5adb('0x2e')]=function(_0x2c2357,_0x511746,_0x49f4c8){var _0x3d55c2;return db[_0x5adb('0x4c')][_0x5adb('0x4d')](function(_0xdb7d8f){return db['Network'][_0x5adb('0x4a')]({'where':{'id':_0x2c2357[_0x5adb('0x48')]['id']}})['then'](handleEntityNotFound(_0x511746,null))[_0x5adb('0x1b')](saveUpdates(_0x2c2357[_0x5adb('0x4e')],null))[_0x5adb('0x1b')](function(_0x5edd60){if(_0x5edd60){_0x3d55c2=_0x5edd60;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'type':_0x3d55c2[_0x5adb('0x3f')]},'raw':!![]});}return null;})[_0x5adb('0x1b')](function(_0x330290){if(_0x330290){var _0x428019=fs['readFileSync'](path[_0x5adb('0x51')](config[_0x5adb('0x58')],_0x5adb('0x52')),'utf8');var _0xcd71d2=ejs[_0x5adb('0x59')](_0x428019,{'networks':_0x330290||[]});fs[_0x5adb('0x5a')](util['format'](_0x5adb('0x54'),_0x3d55c2['type'][_0x5adb('0x55')]()),_0xcd71d2);return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x2e'),{'module':'chan_sip.so'});}return null;})[_0x5adb('0x1b')](function(_0x3627d1){if(_0x3627d1){return _0x3d55c2;}return null;});})['then'](respondWithResult(_0x511746,null))[_0x5adb('0x24')](handleError(_0x511746,null));};exports[_0x5adb('0x5b')]=function(_0x248739,_0x3fcad5,_0x55cd0a){var _0x4290bb;return db[_0x5adb('0x43')][_0x5adb('0x4a')]({'where':{'id':_0x248739[_0x5adb('0x48')]['id']}})['then'](function(_0x53a4bc){_0x4290bb=_0x53a4bc;return _0x53a4bc;})[_0x5adb('0x1b')](handleEntityNotFound(_0x3fcad5,null))['then'](removeEntity(_0x3fcad5,null))['then'](function(){if(_0x4290bb){return db['Network'][_0x5adb('0x4f')]({'where':{'type':_0x4290bb[_0x5adb('0x3f')]},'raw':!![]});}})['then'](function(_0x395350){if(_0x395350){var _0x91e023=fs[_0x5adb('0x50')](path[_0x5adb('0x51')](config[_0x5adb('0x58')],_0x5adb('0x52')),_0x5adb('0x53'));var _0x1ffcd3=ejs['render'](_0x91e023,{'networks':_0x395350||[]});fs['writeFileSync'](util['format'](_0x5adb('0x54'),_0x4290bb[_0x5adb('0x3f')][_0x5adb('0x55')]()),_0x1ffcd3);return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x5b'),{'module':_0x5adb('0x57')});}})[_0x5adb('0x24')](handleError(_0x3fcad5,null));}; \ No newline at end of file +var _0xadb5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','index','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','where','pick','filter','map','type','key','VIRTUAL','field','Network','count','includeAll','include','show','params','options','find','create','sequelize','transaction','body','findAll','readFileSync','join','server/files/templates/network.ejs','utf8','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','root','render','writeFileSync','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xadb5,0xad));var _0x5adb=function(_0x2a7ee4,_0x3a8511){_0x2a7ee4=_0x2a7ee4-0x0;var _0x509f93=_0xadb5[_0x2a7ee4];return _0x509f93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5adb('0x17'));var client=jayson['client'][_0x5adb('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5433bf,_0x8cfcc6,_0x39a0b3){if(_0x39a0b3){var _0x44abe3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44abe3['test'](_0x8cfcc6)){return _0x5433bf;}else{throw new Error(_0x5adb('0x19'));}}else{return _0x5433bf;}}function respondWithRpcPromise(_0x34af2c,_0xf82f72,_0x5263ec,_0x2312de){return new BPromise(function(_0x518823,_0x367d82){var _0x42a482=_0x2312de||client;return _0x42a482[_0x5adb('0x1a')](_0x34af2c,_0x5263ec)[_0x5adb('0x1b')](function(_0x1c0f97){logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));logger[_0x5adb('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0xf82f72,_0x5adb('0x1e'),JSON['stringify'](_0x1c0f97));if(_0x1c0f97[_0x5adb('0x20')]){if(_0x1c0f97['error'][_0x5adb('0x21')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);return _0x367d82(_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);}logger[_0x5adb('0x20')]('Network,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')]['message']);return _0x518823(_0x1c0f97['error'][_0x5adb('0x22')]);}else{logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));_0x518823(_0x1c0f97[_0x5adb('0x23')][_0x5adb('0x22')]);}})[_0x5adb('0x24')](function(_0x4ca150){logger[_0x5adb('0x20')](_0x5adb('0x1d'),_0xf82f72,_0x4ca150);_0x367d82(_0x4ca150);});});}function respondWithStatusCode(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0xcc;return function(_0xeb556c){if(_0xeb556c){return _0x3220cd['sendStatus'](_0x3839fb);}return _0x3220cd[_0x5adb('0x25')](_0x3839fb)[_0x5adb('0x26')]();};}function respondWithResult(_0x5aed76,_0x1feecf){_0x1feecf=_0x1feecf||0xc8;return function(_0x1ded9f){if(_0x1ded9f){return _0x5aed76[_0x5adb('0x25')](_0x1feecf)['json'](_0x1ded9f);}};}function respondWithFilteredResult(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(_0x3a4fca){var _0x2c64a3=_0x3a4fca['count'],_0x36459b=_0xbe21b1['offset'],_0x1c06c4=_0xbe21b1[_0x5adb('0x27')]+_0xbe21b1[_0x5adb('0x28')],_0x4a5d46;if(_0x1c06c4>=_0x2c64a3){_0x1c06c4=_0x2c64a3;_0x4a5d46=0xc8;}else{_0x4a5d46=0xce;}_0x13ad1d[_0x5adb('0x25')](_0x4a5d46);return _0x13ad1d[_0x5adb('0x29')](_0x5adb('0x2a'),_0x36459b+'-'+_0x1c06c4+'/'+_0x2c64a3)['json'](_0x3a4fca);}return null;};}function patchUpdates(_0x11ec2a){return function(_0x34b793){try{jsonpatch[_0x5adb('0x2b')](_0x34b793,_0x11ec2a,!![]);}catch(_0x3b1fed){return BPromise[_0x5adb('0x2c')](_0x3b1fed);}return _0x34b793[_0x5adb('0x2d')]();};}function saveUpdates(_0x28190d,_0x28bf1f){return function(_0x138bf6){if(_0x138bf6){return _0x138bf6[_0x5adb('0x2e')](_0x28190d)['then'](function(_0x2e46ce){return _0x2e46ce;});}return null;};}function removeEntity(_0x4c8b2e,_0x12424d){return function(_0x20cde6){if(_0x20cde6){return _0x20cde6['destroy']()[_0x5adb('0x1b')](function(){_0x4c8b2e[_0x5adb('0x25')](0xcc)[_0x5adb('0x26')]();});}};}function handleEntityNotFound(_0x4a3661,_0x173789){return function(_0x14cf00){if(!_0x14cf00){_0x4a3661['sendStatus'](0x194);}return _0x14cf00;};}function handleError(_0x5bb227,_0x1ed9ea){_0x1ed9ea=_0x1ed9ea||0x1f4;return function(_0x49dd03){logger[_0x5adb('0x20')](_0x49dd03[_0x5adb('0x2f')]);if(_0x49dd03[_0x5adb('0x30')]){delete _0x49dd03[_0x5adb('0x30')];}_0x5bb227[_0x5adb('0x25')](_0x1ed9ea)['send'](_0x49dd03);};}exports[_0x5adb('0x31')]=function(_0x215b88,_0x1c3a5c){var _0x54851b={},_0x4c8870={},_0x32eb69={'count':0x0,'rows':[]};var _0x5d1baa=db['Network'][_0x5adb('0x32')];_0x4c8870['model']=_[_0x5adb('0x33')](_0x5d1baa);_0x4c8870['query']=_[_0x5adb('0x33')](_0x215b88['query']);_0x4c8870[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4c8870['model'],_0x4c8870[_0x5adb('0x36')]);_0x54851b['attributes']=_[_0x5adb('0x35')](_0x4c8870[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0x215b88['query'][_0x5adb('0x38')]));_0x54851b[_0x5adb('0x39')]=_0x54851b[_0x5adb('0x39')][_0x5adb('0x3a')]?_0x54851b[_0x5adb('0x39')]:_0x4c8870['model'];if(!_0x215b88['query']['hasOwnProperty']('nolimit')){_0x54851b[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x28')]);_0x54851b[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x27')]);}_0x54851b['order']=qs['sort'](_0x215b88[_0x5adb('0x36')]['sort']);_0x54851b[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_[_0x5adb('0x3c')](_0x215b88[_0x5adb('0x36')],_0x4c8870[_0x5adb('0x34')]));if(_0x215b88['query'][_0x5adb('0x3d')]){_0x54851b[_0x5adb('0x3b')]=_['merge'](_0x54851b[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x5d1baa,function(_0x5833c8){if(_0x5833c8[_0x5adb('0x3f')][_0x5adb('0x40')]!==_0x5adb('0x41')){var _0x35c379={};_0x35c379[_0x5833c8[_0x5adb('0x42')]]={'$like':'%'+_0x215b88[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x35c379;}})});}_0x54851b=_['merge']({},_0x54851b,_0x215b88['options']);var _0x26a656={'where':_0x54851b[_0x5adb('0x3b')]};return db[_0x5adb('0x43')][_0x5adb('0x44')](_0x26a656)['then'](function(_0x507e48){_0x32eb69[_0x5adb('0x44')]=_0x507e48;if(_0x215b88[_0x5adb('0x36')][_0x5adb('0x45')]){_0x54851b[_0x5adb('0x46')]=[{'all':!![]}];}return db[_0x5adb('0x43')]['findAll'](_0x54851b);})[_0x5adb('0x1b')](function(_0x437f52){_0x32eb69['rows']=_0x437f52;return _0x32eb69;})[_0x5adb('0x1b')](respondWithFilteredResult(_0x1c3a5c,_0x54851b))[_0x5adb('0x24')](handleError(_0x1c3a5c,null));};exports[_0x5adb('0x47')]=function(_0x24758f,_0x186bd2){var _0x3a5409={'raw':!![],'where':{'id':_0x24758f[_0x5adb('0x48')]['id']}},_0x39840e={};_0x39840e['model']=_[_0x5adb('0x33')](db['Network']['rawAttributes']);_0x39840e['query']=_[_0x5adb('0x33')](_0x24758f[_0x5adb('0x36')]);_0x39840e[_0x5adb('0x34')]=_['intersection'](_0x39840e[_0x5adb('0x37')],_0x39840e['query']);_0x3a5409[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x39840e[_0x5adb('0x37')],qs['fields'](_0x24758f[_0x5adb('0x36')]['fields']));_0x3a5409[_0x5adb('0x39')]=_0x3a5409[_0x5adb('0x39')]['length']?_0x3a5409[_0x5adb('0x39')]:_0x39840e[_0x5adb('0x37')];if(_0x24758f[_0x5adb('0x36')][_0x5adb('0x45')]){_0x3a5409[_0x5adb('0x46')]=[{'all':!![]}];}_0x3a5409=_['merge']({},_0x3a5409,_0x24758f[_0x5adb('0x49')]);return db[_0x5adb('0x43')][_0x5adb('0x4a')](_0x3a5409)[_0x5adb('0x1b')](handleEntityNotFound(_0x186bd2,null))['then'](respondWithResult(_0x186bd2,null))[_0x5adb('0x24')](handleError(_0x186bd2,null));};exports[_0x5adb('0x4b')]=function(_0x3b4794,_0x4d98d0,_0x2b34a8){var _0xd0e5b7;return db[_0x5adb('0x4c')][_0x5adb('0x4d')](function(_0x4f2da9){return db[_0x5adb('0x43')][_0x5adb('0x4b')](_0x3b4794[_0x5adb('0x4e')],{'raw':!![]})[_0x5adb('0x1b')](function(_0xa25ac3){_0xd0e5b7=_0xa25ac3;return db['Network'][_0x5adb('0x4f')]({'where':{'type':_0x3b4794['body'][_0x5adb('0x3f')]},'raw':!![]});})['then'](function(_0x31ae72){var _0x35df22=fs[_0x5adb('0x50')](path[_0x5adb('0x51')](config['root'],_0x5adb('0x52')),_0x5adb('0x53'));var _0x24b1f1=ejs['render'](_0x35df22,{'networks':_0x31ae72||[]});fs['writeFileSync'](util['format'](_0x5adb('0x54'),_0x3b4794[_0x5adb('0x4e')][_0x5adb('0x3f')][_0x5adb('0x55')]()),_0x24b1f1);})[_0x5adb('0x1b')](function(){return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x4b'),{'module':_0x5adb('0x57')});})[_0x5adb('0x1b')](function(){return _0xd0e5b7;});})[_0x5adb('0x1b')](respondWithResult(_0x4d98d0,0xc9))[_0x5adb('0x24')](handleError(_0x4d98d0,null));};exports[_0x5adb('0x2e')]=function(_0x2c2357,_0x511746,_0x49f4c8){var _0x3d55c2;return db[_0x5adb('0x4c')][_0x5adb('0x4d')](function(_0xdb7d8f){return db['Network'][_0x5adb('0x4a')]({'where':{'id':_0x2c2357[_0x5adb('0x48')]['id']}})['then'](handleEntityNotFound(_0x511746,null))[_0x5adb('0x1b')](saveUpdates(_0x2c2357[_0x5adb('0x4e')],null))[_0x5adb('0x1b')](function(_0x5edd60){if(_0x5edd60){_0x3d55c2=_0x5edd60;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'type':_0x3d55c2[_0x5adb('0x3f')]},'raw':!![]});}return null;})[_0x5adb('0x1b')](function(_0x330290){if(_0x330290){var _0x428019=fs['readFileSync'](path[_0x5adb('0x51')](config[_0x5adb('0x58')],_0x5adb('0x52')),'utf8');var _0xcd71d2=ejs[_0x5adb('0x59')](_0x428019,{'networks':_0x330290||[]});fs[_0x5adb('0x5a')](util['format'](_0x5adb('0x54'),_0x3d55c2['type'][_0x5adb('0x55')]()),_0xcd71d2);return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x2e'),{'module':'chan_sip.so'});}return null;})[_0x5adb('0x1b')](function(_0x3627d1){if(_0x3627d1){return _0x3d55c2;}return null;});})['then'](respondWithResult(_0x511746,null))[_0x5adb('0x24')](handleError(_0x511746,null));};exports[_0x5adb('0x5b')]=function(_0x248739,_0x3fcad5,_0x55cd0a){var _0x4290bb;return db[_0x5adb('0x43')][_0x5adb('0x4a')]({'where':{'id':_0x248739[_0x5adb('0x48')]['id']}})['then'](function(_0x53a4bc){_0x4290bb=_0x53a4bc;return _0x53a4bc;})[_0x5adb('0x1b')](handleEntityNotFound(_0x3fcad5,null))['then'](removeEntity(_0x3fcad5,null))['then'](function(){if(_0x4290bb){return db['Network'][_0x5adb('0x4f')]({'where':{'type':_0x4290bb[_0x5adb('0x3f')]},'raw':!![]});}})['then'](function(_0x395350){if(_0x395350){var _0x91e023=fs[_0x5adb('0x50')](path[_0x5adb('0x51')](config[_0x5adb('0x58')],_0x5adb('0x52')),_0x5adb('0x53'));var _0x1ffcd3=ejs['render'](_0x91e023,{'networks':_0x395350||[]});fs['writeFileSync'](util['format'](_0x5adb('0x54'),_0x4290bb[_0x5adb('0x3f')][_0x5adb('0x55')]()),_0x1ffcd3);return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x5b'),{'module':_0x5adb('0x57')});}})[_0x5adb('0x24')](handleError(_0x3fcad5,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d2540a6..020c19b 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 _0x7a33=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0xaa37af,_0x9c97e7){var _0x56d335=function(_0x32ce3d){while(--_0x32ce3d){_0xaa37af['push'](_0xaa37af['shift']());}};_0x56d335(++_0x9c97e7);}(_0x7a33,0x138));var _0x37a3=function(_0xc35120,_0x3d809f){_0xc35120=_0xc35120-0x0;var _0x62bdb5=_0x7a33[_0xc35120];return _0x62bdb5;};'use strict';var _=require(_0x37a3('0x0'));var util=require(_0x37a3('0x1'));var logger=require(_0x37a3('0x2'))(_0x37a3('0x3'));var moment=require(_0x37a3('0x4'));var BPromise=require(_0x37a3('0x5'));var rp=require(_0x37a3('0x6'));var fs=require('fs');var path=require(_0x37a3('0x7'));var rimraf=require(_0x37a3('0x8'));var config=require(_0x37a3('0x9'));var attributes=require(_0x37a3('0xa'));module[_0x37a3('0xb')]=function(_0x46cdee,_0x2540b8){return _0x46cdee[_0x37a3('0xc')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8c1=['exports','Network','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./network.attributes'];(function(_0x5c5d03,_0x2cfb64){var _0xaac65d=function(_0x4da2a7){while(--_0x4da2a7){_0x5c5d03['push'](_0x5c5d03['shift']());}};_0xaac65d(++_0x2cfb64);}(_0xa8c1,0x70));var _0x1a8c=function(_0x4b33d1,_0x2414e1){_0x4b33d1=_0x4b33d1-0x0;var _0x9e7221=_0xa8c1[_0x4b33d1];return _0x9e7221;};'use strict';var _=require('lodash');var util=require(_0x1a8c('0x0'));var logger=require(_0x1a8c('0x1'))(_0x1a8c('0x2'));var moment=require(_0x1a8c('0x3'));var BPromise=require(_0x1a8c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a8c('0x5'));var rimraf=require(_0x1a8c('0x6'));var config=require(_0x1a8c('0x7'));var attributes=require(_0x1a8c('0x8'));module[_0x1a8c('0x9')]=function(_0x4f637d,_0x32dcfc){return _0x4f637d['define'](_0x1a8c('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 2442957..11c289e 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 _0xca9e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util'];(function(_0x13a219,_0x25acd3){var _0x50e371=function(_0x187aea){while(--_0x187aea){_0x13a219['push'](_0x13a219['shift']());}};_0x50e371(++_0x25acd3);}(_0xca9e,0x136));var _0xeca9=function(_0x5e6227,_0x3f791a){_0x5e6227=_0x5e6227-0x0;var _0x10a1c8=_0xca9e[_0x5e6227];return _0x10a1c8;};'use strict';var _=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var moment=require(_0xeca9('0x2'));var BPromise=require(_0xeca9('0x3'));var rs=require(_0xeca9('0x4'));var fs=require('fs');var Redis=require(_0xeca9('0x5'));var db=require(_0xeca9('0x6'))['db'];var utils=require(_0xeca9('0x7'));var logger=require(_0xeca9('0x8'))(_0xeca9('0x9'));var config=require(_0xeca9('0xa'));var jayson=require(_0xeca9('0xb'));var client=jayson[_0xeca9('0xc')][_0xeca9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x483e41,_0x369f5e,_0x1774f3){return new BPromise(function(_0x4d57ee,_0x4eaf49){return client[_0xeca9('0xe')](_0x483e41,_0x1774f3)[_0xeca9('0xf')](function(_0x1673b6){logger['info'](_0xeca9('0x10'),_0x369f5e,_0xeca9('0x11'));logger[_0xeca9('0x12')](_0xeca9('0x13'),_0x369f5e,_0xeca9('0x11'),JSON[_0xeca9('0x14')](_0x1673b6));if(_0x1673b6['error']){if(_0x1673b6[_0xeca9('0x15')][_0xeca9('0x16')]===0x1f4){logger['error'](_0xeca9('0x10'),_0x369f5e,_0x1673b6['error'][_0xeca9('0x17')]);return _0x4eaf49(_0x1673b6[_0xeca9('0x15')]['message']);}logger[_0xeca9('0x15')](_0xeca9('0x10'),_0x369f5e,_0x1673b6[_0xeca9('0x15')]['message']);return _0x4d57ee(_0x1673b6[_0xeca9('0x15')][_0xeca9('0x17')]);}else{logger[_0xeca9('0x18')](_0xeca9('0x10'),_0x369f5e,'request\x20sent');_0x4d57ee(_0x1673b6['result'][_0xeca9('0x17')]);}})[_0xeca9('0x19')](function(_0x553965){logger[_0xeca9('0x15')](_0xeca9('0x10'),_0x369f5e,_0x553965);_0x4eaf49(_0x553965);});});} \ No newline at end of file +var _0x814b=['info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\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(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x814b,0x1a2));var _0xb814=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0x814b[_0x1551af];return _0xd8eb82;};'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')]('Network,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 34231ad..6423de9 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 _0x205c=['send','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','Router','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','notify','addApplications','addAgents','/:id/send'];(function(_0x137b47,_0x300b3d){var _0x3c0aa6=function(_0x5e836a){while(--_0x5e836a){_0x137b47['push'](_0x137b47['shift']());}};_0x3c0aa6(++_0x300b3d);}(_0x205c,0x122));var _0xc205=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x205c[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0xc205('0x0'));var util=require('util');var path=require(_0xc205('0x1'));var timeout=require(_0xc205('0x2'));var express=require(_0xc205('0x3'));var router=express[_0xc205('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc205('0x5'));var controller=require(_0xc205('0x6'));router[_0xc205('0x7')]('/',auth['isAuthenticated'](),controller[_0xc205('0x8')]);router[_0xc205('0x7')](_0xc205('0x9'),auth[_0xc205('0xa')](),controller[_0xc205('0xb')]);router[_0xc205('0x7')](_0xc205('0xc'),auth['isAuthenticated'](),controller[_0xc205('0xd')]);router['get'](_0xc205('0xe'),auth[_0xc205('0xa')](),controller[_0xc205('0xf')]);router[_0xc205('0x7')]('/:id/canned_answers',auth[_0xc205('0xa')](),controller[_0xc205('0x10')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0xc205('0x11')]);router[_0xc205('0x7')](_0xc205('0x12'),auth['isAuthenticated'](),controller[_0xc205('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xc205('0x14')]);router[_0xc205('0x15')]('/',auth[_0xc205('0xa')](),controller[_0xc205('0x16')]);router[_0xc205('0x15')](_0xc205('0xe'),auth['isAuthenticated'](),controller[_0xc205('0x17')]);router[_0xc205('0x15')](_0xc205('0x18'),auth[_0xc205('0xa')](),controller[_0xc205('0x19')]);router[_0xc205('0x15')]('/:id/notify',controller[_0xc205('0x1a')]);router[_0xc205('0x15')]('/:id/applications',auth[_0xc205('0xa')](),controller[_0xc205('0x1b')]);router[_0xc205('0x15')]('/:id/users',auth[_0xc205('0xa')](),controller[_0xc205('0x1c')]);router[_0xc205('0x15')](_0xc205('0x1d'),auth[_0xc205('0xa')](),controller[_0xc205('0x1e')]);router[_0xc205('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xc205('0x20')]);router[_0xc205('0x21')](_0xc205('0xc'),auth['isAuthenticated'](),controller[_0xc205('0x22')]);router[_0xc205('0x21')](_0xc205('0xe'),auth[_0xc205('0xa')](),controller[_0xc205('0x23')]);router[_0xc205('0x21')](_0xc205('0x18'),auth[_0xc205('0xa')](),controller[_0xc205('0x24')]);router['delete'](_0xc205('0x25'),auth[_0xc205('0xa')](),controller[_0xc205('0x26')]);module[_0xc205('0x27')]=router; \ No newline at end of file +var _0x3a06=['put','update','destroy','delete','removeDispositions','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/users','/:id/send'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x3a06,0xfb));var _0x63a0=function(_0x3d6c76,_0x916dea){_0x3d6c76=_0x3d6c76-0x0;var _0x31b9e=_0x3a06[_0x3d6c76];return _0x31b9e;};'use strict';var multer=require('multer');var util=require(_0x63a0('0x0'));var path=require('path');var timeout=require(_0x63a0('0x1'));var express=require(_0x63a0('0x2'));var router=express['Router']();var auth=require(_0x63a0('0x3'));var interaction=require(_0x63a0('0x4'));var config=require(_0x63a0('0x5'));var controller=require(_0x63a0('0x6'));router['get']('/',auth[_0x63a0('0x7')](),controller[_0x63a0('0x8')]);router[_0x63a0('0x9')](_0x63a0('0xa'),auth[_0x63a0('0x7')](),controller[_0x63a0('0xb')]);router['get'](_0x63a0('0xc'),auth[_0x63a0('0x7')](),controller['show']);router[_0x63a0('0x9')](_0x63a0('0xd'),auth[_0x63a0('0x7')](),controller['getDispositions']);router[_0x63a0('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x63a0('0xe')]);router[_0x63a0('0x9')](_0x63a0('0xf'),auth['isAuthenticated'](),controller[_0x63a0('0x10')]);router['get'](_0x63a0('0x11'),auth['isAuthenticated'](),controller[_0x63a0('0x12')]);router[_0x63a0('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x63a0('0x13')]);router[_0x63a0('0x14')]('/',auth[_0x63a0('0x7')](),controller[_0x63a0('0x15')]);router[_0x63a0('0x14')](_0x63a0('0xd'),auth[_0x63a0('0x7')](),controller[_0x63a0('0x16')]);router[_0x63a0('0x14')](_0x63a0('0x17'),auth[_0x63a0('0x7')](),controller[_0x63a0('0x18')]);router[_0x63a0('0x14')](_0x63a0('0x19'),controller[_0x63a0('0x1a')]);router['post'](_0x63a0('0xf'),auth[_0x63a0('0x7')](),controller['addApplications']);router['post'](_0x63a0('0x1b'),auth[_0x63a0('0x7')](),controller['addAgents']);router[_0x63a0('0x14')](_0x63a0('0x1c'),auth[_0x63a0('0x7')](),controller['send']);router[_0x63a0('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x63a0('0x1e')]);router['delete']('/:id',auth[_0x63a0('0x7')](),controller[_0x63a0('0x1f')]);router[_0x63a0('0x20')]('/:id/dispositions',auth[_0x63a0('0x7')](),controller[_0x63a0('0x21')]);router[_0x63a0('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x63a0('0x20')](_0x63a0('0x1b'),auth[_0x63a0('0x7')](),controller['removeAgents']);module[_0x63a0('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0a2444b..52af9da 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 _0x7927=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7927,0x19b));var _0x7792=function(_0x1cc7a2,_0x16c5c6){_0x1cc7a2=_0x1cc7a2-0x0;var _0x17dcd2=_0x7927[_0x1cc7a2];return _0x17dcd2;};'use strict';var Sequelize=require(_0x7792('0x0'));var rs=require(_0x7792('0x1'));module[_0x7792('0x2')]={'name':{'type':Sequelize[_0x7792('0x3')],'unique':_0x7792('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x7792('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7792('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7792('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7792('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7792('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7792('0x3')]},'queueTransfer':{'type':Sequelize[_0x7792('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7792('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7792('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x7792('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7792('0x6')],'defaultValue':![],'comment':_0x7792('0x9'),'set':function(_0x3129f2){if(!_0x3129f2)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x7792('0xa')](_0x7792('0xb'),_0x3129f2);}}}; \ No newline at end of file +var _0xa7d3=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0xe93f4f,_0x33d7d1){var _0x34af82=function(_0x6bf6d2){while(--_0x6bf6d2){_0xe93f4f['push'](_0xe93f4f['shift']());}};_0x34af82(++_0x33d7d1);}(_0xa7d3,0x1ea));var _0x3a7d=function(_0x292360,_0x212e1c){_0x292360=_0x292360-0x0;var _0x4658d1=_0xa7d3[_0x292360];return _0x4658d1;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x3a7d('0x0')],'unique':_0x3a7d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x3a7d('0x0')]},'token':{'type':Sequelize[_0x3a7d('0x0')],'defaultValue':function(){return rs[_0x3a7d('0x2')]();}},'replyUri':{'type':Sequelize[_0x3a7d('0x0')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3a7d('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3a7d('0x3')],'defaultValue':function(){return _0x3a7d('0x4');}},'notificationSound':{'type':Sequelize[_0x3a7d('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3a7d('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3a7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x3a7d('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3a7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3a7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a7d('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x3a7d('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3a7d('0x8'),'set':function(_0x36bf35){if(!_0x36bf35)this[_0x3a7d('0x9')](_0x3a7d('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x36bf35);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 933baa3..f06ed2c 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 _0xca44=['includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','OpenchannelApplication','Applications','List','account','list','applications','orderBy','asc','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelAccount.socket','register','jayson/promise','http','client','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','OpenchannelAccount','includeAll','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','findOne','Disposition','rows','ids','addAnswer','OpenchannelAccountId','getAnswers','CannedAnswer','findAll','removeAnswers','notify','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xca44,0xfb));var _0x4ca4=function(_0xc86ff3,_0xad1646){_0xc86ff3=_0xc86ff3-0x0;var _0x3d6bf3=_0xca44[_0xc86ff3];return _0x3d6bf3;};'use strict';var pdf=require(_0x4ca4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ca4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ca4('0x2'));var moment=require(_0x4ca4('0x3'));var BPromise=require(_0x4ca4('0x4'));var Mustache=require(_0x4ca4('0x5'));var util=require(_0x4ca4('0x6'));var path=require('path');var sox=require(_0x4ca4('0x7'));var csv=require(_0x4ca4('0x8'));var ejs=require(_0x4ca4('0x9'));var fs=require('fs');var _=require(_0x4ca4('0xa'));var squel=require(_0x4ca4('0xb'));var crypto=require(_0x4ca4('0xc'));var jsforce=require(_0x4ca4('0xd'));var deskjs=require(_0x4ca4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4ca4('0xf'));var Papa=require(_0x4ca4('0x10'));var Redis=require('ioredis');var authService=require(_0x4ca4('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4ca4('0x12'));var logger=require(_0x4ca4('0x13'))(_0x4ca4('0x14'));var utils=require('../../config/utils');var config=require(_0x4ca4('0x15'));var db=require(_0x4ca4('0x16'))['db'];config['redis']=_[_0x4ca4('0x17')](config[_0x4ca4('0x18')],{'host':_0x4ca4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4ca4('0x1a'))[_0x4ca4('0x1b')](socket);var jayson=require(_0x4ca4('0x1c'));var client=jayson['client'][_0x4ca4('0x1d')]({'port':0x232c});var client9002=jayson[_0x4ca4('0x1e')][_0x4ca4('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x43e75d,_0x1a31f3,_0x21c302){if(_0x21c302){var _0x5a9cb1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a9cb1['test'](_0x1a31f3)){return _0x43e75d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x43e75d;}}function respondWithRpcPromise(_0x336a25,_0x2820a5,_0x42da84,_0x32a2da){return new BPromise(function(_0x4af884,_0x3d2c5e){var _0x55546d=_0x32a2da||client;return _0x55546d[_0x4ca4('0x1f')](_0x336a25,_0x42da84)['then'](function(_0x4715af){logger['info'](_0x4ca4('0x20'),_0x2820a5,_0x4ca4('0x21'));logger[_0x4ca4('0x22')](_0x4ca4('0x23'),_0x2820a5,'request\x20sent',JSON[_0x4ca4('0x24')](_0x4715af));if(_0x4715af[_0x4ca4('0x25')]){if(_0x4715af[_0x4ca4('0x25')][_0x4ca4('0x26')]===0x1f4){logger[_0x4ca4('0x25')](_0x4ca4('0x20'),_0x2820a5,_0x4715af[_0x4ca4('0x25')][_0x4ca4('0x27')]);return _0x3d2c5e(_0x4715af['error'][_0x4ca4('0x27')]);}logger[_0x4ca4('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x2820a5,_0x4715af[_0x4ca4('0x25')][_0x4ca4('0x27')]);return _0x4af884(_0x4715af[_0x4ca4('0x25')]['message']);}else{logger[_0x4ca4('0x28')](_0x4ca4('0x20'),_0x2820a5,_0x4ca4('0x21'));_0x4af884(_0x4715af[_0x4ca4('0x29')][_0x4ca4('0x27')]);}})['catch'](function(_0x56da85){logger['error'](_0x4ca4('0x20'),_0x2820a5,_0x56da85);_0x3d2c5e(_0x56da85);});});}function respondWithStatusCode(_0x5dec87,_0x28bbfe){_0x28bbfe=_0x28bbfe||0xcc;return function(_0x3f40dd){if(_0x3f40dd){return _0x5dec87['sendStatus'](_0x28bbfe);}return _0x5dec87[_0x4ca4('0x2a')](_0x28bbfe)[_0x4ca4('0x2b')]();};}function respondWithResult(_0x4eacc8,_0x2d04a2){_0x2d04a2=_0x2d04a2||0xc8;return function(_0x3ea6bc){if(_0x3ea6bc){return _0x4eacc8[_0x4ca4('0x2a')](_0x2d04a2)['json'](_0x3ea6bc);}};}function respondWithFilteredResult(_0x395c9b,_0x4d515f){return function(_0x53a109){if(_0x53a109){var _0x32a2dc=_0x53a109[_0x4ca4('0x2c')],_0x45cee2=_0x4d515f[_0x4ca4('0x2d')],_0x248063=_0x4d515f[_0x4ca4('0x2d')]+_0x4d515f[_0x4ca4('0x2e')],_0x381dc8;if(_0x248063>=_0x32a2dc){_0x248063=_0x32a2dc;_0x381dc8=0xc8;}else{_0x381dc8=0xce;}_0x395c9b[_0x4ca4('0x2a')](_0x381dc8);return _0x395c9b['set'](_0x4ca4('0x2f'),_0x45cee2+'-'+_0x248063+'/'+_0x32a2dc)[_0x4ca4('0x30')](_0x53a109);}return null;};}function patchUpdates(_0x30fc37){return function(_0x444d66){try{jsonpatch[_0x4ca4('0x31')](_0x444d66,_0x30fc37,!![]);}catch(_0x1c66b6){return BPromise[_0x4ca4('0x32')](_0x1c66b6);}return _0x444d66[_0x4ca4('0x33')]();};}function saveUpdates(_0x588ce4,_0x5edf03){return function(_0x1a5035){if(_0x1a5035){return _0x1a5035[_0x4ca4('0x34')](_0x588ce4)[_0x4ca4('0x35')](function(_0x28b9ce){return _0x28b9ce;});}return null;};}function removeEntity(_0x17bc1c,_0x4ce3da){return function(_0x3251d7){if(_0x3251d7){return _0x3251d7[_0x4ca4('0x36')]()['then'](function(){var _0x4b0242=_0x3251d7[_0x4ca4('0x37')]({'plain':!![]});var _0x1cfac3=_0x4ca4('0x38');return db[_0x4ca4('0x39')][_0x4ca4('0x36')]({'where':{'type':_0x1cfac3,'resourceId':_0x4b0242['id']}})[_0x4ca4('0x35')](function(){return _0x3251d7;});})[_0x4ca4('0x35')](function(){_0x17bc1c[_0x4ca4('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x343ed5,_0x5cefe3){return function(_0x336681){if(!_0x336681){_0x343ed5[_0x4ca4('0x3a')](0x194);}return _0x336681;};}function handleError(_0x4ea29f,_0x3eedb2){_0x3eedb2=_0x3eedb2||0x1f4;return function(_0x3b675b){logger[_0x4ca4('0x25')](_0x3b675b[_0x4ca4('0x3b')]);if(_0x3b675b['name']){delete _0x3b675b[_0x4ca4('0x3c')];}_0x4ea29f[_0x4ca4('0x2a')](_0x3eedb2)[_0x4ca4('0x3d')](_0x3b675b);};}exports[_0x4ca4('0x3e')]=function(_0x29ce9e,_0x2f6669){var _0x3b0283={'include':[{'model':db[_0x4ca4('0x3f')],'as':_0x4ca4('0x40')}]},_0x4191e1={},_0x2f575a={'count':0x0,'rows':[]};var _0x51ea92=db['OpenchannelAccount'][_0x4ca4('0x41')];_0x4191e1['model']=_['keys'](_0x51ea92);_0x4191e1['query']=_[_0x4ca4('0x42')](_0x29ce9e['query']);_0x4191e1[_0x4ca4('0x43')]=_[_0x4ca4('0x44')](_0x4191e1[_0x4ca4('0x45')],_0x4191e1[_0x4ca4('0x46')]);_0x3b0283[_0x4ca4('0x47')]=_[_0x4ca4('0x44')](_0x4191e1['model'],qs[_0x4ca4('0x48')](_0x29ce9e['query'][_0x4ca4('0x48')]));_0x3b0283[_0x4ca4('0x47')]=_0x3b0283[_0x4ca4('0x47')]['length']?_0x3b0283[_0x4ca4('0x47')]:_0x4191e1[_0x4ca4('0x45')];if(!_0x29ce9e[_0x4ca4('0x46')][_0x4ca4('0x49')](_0x4ca4('0x4a'))){_0x3b0283['limit']=qs['limit'](_0x29ce9e['query'][_0x4ca4('0x2e')]);_0x3b0283['offset']=qs[_0x4ca4('0x2d')](_0x29ce9e['query'][_0x4ca4('0x2d')]);}_0x3b0283[_0x4ca4('0x4b')]=qs[_0x4ca4('0x4c')](_0x29ce9e[_0x4ca4('0x46')][_0x4ca4('0x4c')]);_0x3b0283[_0x4ca4('0x4d')]=qs[_0x4ca4('0x43')](_[_0x4ca4('0x4e')](_0x29ce9e[_0x4ca4('0x46')],_0x4191e1['filters']));if(_0x29ce9e[_0x4ca4('0x46')][_0x4ca4('0x4f')]){_0x3b0283['where']=_[_0x4ca4('0x50')](_0x3b0283[_0x4ca4('0x4d')],{'$or':_[_0x4ca4('0x51')](_0x51ea92,function(_0x38c58a){if(_0x38c58a[_0x4ca4('0x52')][_0x4ca4('0x53')]!==_0x4ca4('0x54')){var _0x4f17d4={};_0x4f17d4[_0x38c58a['field']]={'$like':'%'+_0x29ce9e[_0x4ca4('0x46')][_0x4ca4('0x4f')]+'%'};return _0x4f17d4;}})});}_0x3b0283=_['merge']({},_0x3b0283,_0x29ce9e[_0x4ca4('0x55')]);var _0x3ff462={'where':_0x3b0283[_0x4ca4('0x4d')]};return db[_0x4ca4('0x56')][_0x4ca4('0x2c')](_0x3ff462)[_0x4ca4('0x35')](function(_0xb03ca4){_0x2f575a[_0x4ca4('0x2c')]=_0xb03ca4;if(_0x29ce9e[_0x4ca4('0x46')][_0x4ca4('0x57')]){_0x3b0283['include']=[{'all':!![]}];}return db[_0x4ca4('0x56')]['findAll'](_0x3b0283);})['then'](function(_0x441296){_0x2f575a['rows']=_0x441296;return _0x2f575a;})['then'](respondWithFilteredResult(_0x2f6669,_0x3b0283))[_0x4ca4('0x58')](handleError(_0x2f6669,null));};exports[_0x4ca4('0x59')]=function(_0x14c1b7,_0x369ec6){var _0x5ca36b={'raw':![],'where':{'id':_0x14c1b7[_0x4ca4('0x5a')]['id']},'include':[{'model':db[_0x4ca4('0x3f')],'as':_0x4ca4('0x40')}]},_0x48473d={};_0x48473d[_0x4ca4('0x45')]=_[_0x4ca4('0x42')](db[_0x4ca4('0x56')][_0x4ca4('0x41')]);_0x48473d[_0x4ca4('0x46')]=_['keys'](_0x14c1b7[_0x4ca4('0x46')]);_0x48473d['filters']=_[_0x4ca4('0x44')](_0x48473d[_0x4ca4('0x45')],_0x48473d['query']);_0x5ca36b[_0x4ca4('0x47')]=_[_0x4ca4('0x44')](_0x48473d[_0x4ca4('0x45')],qs[_0x4ca4('0x48')](_0x14c1b7[_0x4ca4('0x46')][_0x4ca4('0x48')]));_0x5ca36b['attributes']=_0x5ca36b[_0x4ca4('0x47')][_0x4ca4('0x5b')]?_0x5ca36b[_0x4ca4('0x47')]:_0x48473d['model'];if(_0x14c1b7['query']['includeAll']){_0x5ca36b[_0x4ca4('0x5c')]=[{'all':!![]}];}_0x5ca36b=_['merge']({},_0x5ca36b,_0x14c1b7[_0x4ca4('0x55')]);return db[_0x4ca4('0x56')][_0x4ca4('0x5d')](_0x5ca36b)[_0x4ca4('0x35')](handleEntityNotFound(_0x369ec6,null))[_0x4ca4('0x35')](respondWithResult(_0x369ec6,null))['catch'](handleError(_0x369ec6,null));};exports[_0x4ca4('0x5e')]=function(_0x491474,_0x1973f8){return db['OpenchannelAccount'][_0x4ca4('0x5e')](_0x491474[_0x4ca4('0x5f')],{})[_0x4ca4('0x35')](function(_0x32d314){var _0x56d883=_0x491474[_0x4ca4('0x60')][_0x4ca4('0x37')]({'plain':!![]});if(!_0x56d883)throw new Error(_0x4ca4('0x61'));if(_0x56d883[_0x4ca4('0x62')]===_0x4ca4('0x60')){var _0xe51a9d=_0x32d314[_0x4ca4('0x37')]({'plain':!![]});var _0x5aeadd='OpenchannelAccounts';return db[_0x4ca4('0x63')]['find']({'where':{'name':_0x5aeadd,'userProfileId':_0x56d883['userProfileId']},'raw':!![]})[_0x4ca4('0x35')](function(_0x431f9e){if(_0x431f9e&&_0x431f9e[_0x4ca4('0x64')]===0x0){return db[_0x4ca4('0x39')][_0x4ca4('0x5e')]({'name':_0xe51a9d['name'],'resourceId':_0xe51a9d['id'],'type':_0x431f9e[_0x4ca4('0x3c')],'sectionId':_0x431f9e['id']},{})[_0x4ca4('0x35')](function(){return _0x32d314;});}else{return _0x32d314;}})[_0x4ca4('0x58')](function(_0x35312d){logger[_0x4ca4('0x25')](_0x4ca4('0x65'),_0x35312d);throw _0x35312d;});}return _0x32d314;})['then'](respondWithResult(_0x1973f8,0xc9))['catch'](handleError(_0x1973f8,null));};exports[_0x4ca4('0x34')]=function(_0x3d8145,_0x3273b6){if(_0x3d8145[_0x4ca4('0x5f')]['id']){delete _0x3d8145[_0x4ca4('0x5f')]['id'];}return db[_0x4ca4('0x56')]['find']({'where':{'id':_0x3d8145[_0x4ca4('0x5a')]['id']},'include':[{'model':db[_0x4ca4('0x3f')],'as':_0x4ca4('0x40')}]})[_0x4ca4('0x35')](handleEntityNotFound(_0x3273b6,null))[_0x4ca4('0x35')](saveUpdates(_0x3d8145[_0x4ca4('0x5f')],null))[_0x4ca4('0x35')](respondWithResult(_0x3273b6,null))[_0x4ca4('0x58')](handleError(_0x3273b6,null));};exports[_0x4ca4('0x36')]=function(_0x3f2850,_0x362a92){return db[_0x4ca4('0x56')][_0x4ca4('0x5d')]({'where':{'id':_0x3f2850[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x362a92,null))[_0x4ca4('0x35')](removeEntity(_0x362a92,null))[_0x4ca4('0x58')](handleError(_0x362a92,null));};exports['describe']=function(_0x267a50,_0x4abcfe){return db[_0x4ca4('0x56')][_0x4ca4('0x66')]()[_0x4ca4('0x35')](respondWithResult(_0x4abcfe,null))[_0x4ca4('0x58')](handleError(_0x4abcfe,null));};exports[_0x4ca4('0x67')]=function(_0x1351d8,_0x3a4b2a,_0x7fd8a){if(_0x1351d8[_0x4ca4('0x5f')]['id']){delete _0x1351d8[_0x4ca4('0x5f')]['id'];}return db[_0x4ca4('0x56')][_0x4ca4('0x5d')]({'where':{'id':_0x1351d8[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x3a4b2a,null))['then'](function(_0x33ae6a){if(_0x33ae6a){_0x1351d8['body'][_0x4ca4('0x68')]=_0x33ae6a['id'];return db['Disposition'][_0x4ca4('0x5e')](_0x1351d8[_0x4ca4('0x5f')]);}})[_0x4ca4('0x35')](respondWithResult(_0x3a4b2a,null))[_0x4ca4('0x58')](handleError(_0x3a4b2a,null));};exports['getDispositions']=function(_0x10226f,_0x5a128f,_0xde6fec){var _0x18e32d={'raw':![],'where':{}};var _0x3baa8e={};var _0x28d3b9={'count':0x0,'rows':[]};return db[_0x4ca4('0x56')][_0x4ca4('0x69')]({'where':{'id':_0x10226f[_0x4ca4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5a128f,null))[_0x4ca4('0x35')](function(_0x4062c8){if(_0x4062c8){_0x3baa8e[_0x4ca4('0x45')]=_[_0x4ca4('0x42')](db[_0x4ca4('0x6a')][_0x4ca4('0x41')]);_0x3baa8e[_0x4ca4('0x46')]=_[_0x4ca4('0x42')](_0x10226f['query']);_0x3baa8e[_0x4ca4('0x43')]=_[_0x4ca4('0x44')](_0x3baa8e[_0x4ca4('0x45')],_0x3baa8e[_0x4ca4('0x46')]);_0x18e32d[_0x4ca4('0x47')]=_[_0x4ca4('0x44')](_0x3baa8e[_0x4ca4('0x45')],qs[_0x4ca4('0x48')](_0x10226f[_0x4ca4('0x46')][_0x4ca4('0x48')]));_0x18e32d[_0x4ca4('0x47')]=_0x18e32d[_0x4ca4('0x47')]['length']?_0x18e32d[_0x4ca4('0x47')]:_0x3baa8e['model'];if(!_0x10226f[_0x4ca4('0x46')][_0x4ca4('0x49')](_0x4ca4('0x4a'))){_0x18e32d[_0x4ca4('0x2e')]=qs[_0x4ca4('0x2e')](_0x10226f[_0x4ca4('0x46')]['limit']);_0x18e32d[_0x4ca4('0x2d')]=qs[_0x4ca4('0x2d')](_0x10226f[_0x4ca4('0x46')][_0x4ca4('0x2d')]);}_0x18e32d['order']=qs['sort'](_0x10226f[_0x4ca4('0x46')][_0x4ca4('0x4c')]);_0x18e32d['where']=qs[_0x4ca4('0x43')](_['pick'](_0x10226f[_0x4ca4('0x46')],_0x3baa8e[_0x4ca4('0x43')]));_0x18e32d[_0x4ca4('0x4d')]['OpenchannelAccountId']=_0x4062c8['id'];if(_0x10226f[_0x4ca4('0x46')][_0x4ca4('0x4f')]){_0x18e32d[_0x4ca4('0x4d')]=_[_0x4ca4('0x50')](_0x18e32d['where'],{'$or':_[_0x4ca4('0x51')](_0x18e32d[_0x4ca4('0x47')],function(_0x1c6c5b){var _0x53353a={};_0x53353a[_0x1c6c5b]={'$like':'%'+_0x10226f[_0x4ca4('0x46')][_0x4ca4('0x4f')]+'%'};return _0x53353a;})});}_0x18e32d=_[_0x4ca4('0x50')]({},_0x18e32d,_0x10226f[_0x4ca4('0x55')]);return db[_0x4ca4('0x6a')][_0x4ca4('0x2c')]({'where':_0x18e32d[_0x4ca4('0x4d')]})['then'](function(_0x426b82){_0x28d3b9[_0x4ca4('0x2c')]=_0x426b82;if(_0x10226f[_0x4ca4('0x46')][_0x4ca4('0x57')]){_0x18e32d[_0x4ca4('0x5c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x18e32d);})[_0x4ca4('0x35')](function(_0x46a36e){_0x28d3b9[_0x4ca4('0x6b')]=_0x46a36e;return _0x28d3b9;});}})['then'](respondWithFilteredResult(_0x5a128f,_0x18e32d))['catch'](handleError(_0x5a128f,null));};exports['removeDispositions']=function(_0xb6bb90,_0x120625,_0x532dea){return db[_0x4ca4('0x56')]['find']({'where':{'id':_0xb6bb90[_0x4ca4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x120625,null))[_0x4ca4('0x35')](function(_0x1fc043){if(_0x1fc043){return _0x1fc043['removeDispositions'](_0xb6bb90['query'][_0x4ca4('0x6c')]);}})['then'](respondWithStatusCode(_0x120625,null))[_0x4ca4('0x58')](handleError(_0x120625,null));};exports[_0x4ca4('0x6d')]=function(_0x529263,_0x1d76de,_0x4e300a){if(_0x529263[_0x4ca4('0x5f')]['id']){delete _0x529263[_0x4ca4('0x5f')]['id'];}return db[_0x4ca4('0x56')][_0x4ca4('0x5d')]({'where':{'id':_0x529263[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x1d76de,null))[_0x4ca4('0x35')](function(_0x68612a){if(_0x68612a){_0x529263['body'][_0x4ca4('0x6e')]=_0x68612a['id'];return db['CannedAnswer'][_0x4ca4('0x5e')](_0x529263[_0x4ca4('0x5f')]);}})[_0x4ca4('0x35')](respondWithResult(_0x1d76de,null))[_0x4ca4('0x58')](handleError(_0x1d76de,null));};exports[_0x4ca4('0x6f')]=function(_0x527de0,_0x1244d1,_0x15900c){var _0x1e328b={'raw':![],'where':{}};var _0x5fc100={};var _0x3d1b54={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4ca4('0x69')]({'where':{'id':_0x527de0[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x1244d1,null))[_0x4ca4('0x35')](function(_0x30723b){if(_0x30723b){_0x5fc100[_0x4ca4('0x45')]=_[_0x4ca4('0x42')](db[_0x4ca4('0x70')]['rawAttributes']);_0x5fc100[_0x4ca4('0x46')]=_['keys'](_0x527de0['query']);_0x5fc100[_0x4ca4('0x43')]=_['intersection'](_0x5fc100[_0x4ca4('0x45')],_0x5fc100[_0x4ca4('0x46')]);_0x1e328b[_0x4ca4('0x47')]=_[_0x4ca4('0x44')](_0x5fc100[_0x4ca4('0x45')],qs[_0x4ca4('0x48')](_0x527de0['query'][_0x4ca4('0x48')]));_0x1e328b[_0x4ca4('0x47')]=_0x1e328b[_0x4ca4('0x47')][_0x4ca4('0x5b')]?_0x1e328b[_0x4ca4('0x47')]:_0x5fc100[_0x4ca4('0x45')];if(!_0x527de0[_0x4ca4('0x46')][_0x4ca4('0x49')](_0x4ca4('0x4a'))){_0x1e328b[_0x4ca4('0x2e')]=qs[_0x4ca4('0x2e')](_0x527de0[_0x4ca4('0x46')]['limit']);_0x1e328b[_0x4ca4('0x2d')]=qs[_0x4ca4('0x2d')](_0x527de0['query'][_0x4ca4('0x2d')]);}_0x1e328b['order']=qs[_0x4ca4('0x4c')](_0x527de0[_0x4ca4('0x46')]['sort']);_0x1e328b['where']=qs[_0x4ca4('0x43')](_[_0x4ca4('0x4e')](_0x527de0[_0x4ca4('0x46')],_0x5fc100[_0x4ca4('0x43')]));_0x1e328b[_0x4ca4('0x4d')][_0x4ca4('0x6e')]=_0x30723b['id'];if(_0x527de0[_0x4ca4('0x46')]['filter']){_0x1e328b[_0x4ca4('0x4d')]=_[_0x4ca4('0x50')](_0x1e328b[_0x4ca4('0x4d')],{'$or':_[_0x4ca4('0x51')](_0x1e328b[_0x4ca4('0x47')],function(_0x744c37){var _0x1ef8c5={};_0x1ef8c5[_0x744c37]={'$like':'%'+_0x527de0[_0x4ca4('0x46')][_0x4ca4('0x4f')]+'%'};return _0x1ef8c5;})});}_0x1e328b=_[_0x4ca4('0x50')]({},_0x1e328b,_0x527de0[_0x4ca4('0x55')]);return db[_0x4ca4('0x70')][_0x4ca4('0x2c')]({'where':_0x1e328b['where']})['then'](function(_0xa4174d){_0x3d1b54[_0x4ca4('0x2c')]=_0xa4174d;if(_0x527de0[_0x4ca4('0x46')][_0x4ca4('0x57')]){_0x1e328b[_0x4ca4('0x5c')]=[{'all':!![]}];}return db[_0x4ca4('0x70')][_0x4ca4('0x71')](_0x1e328b);})['then'](function(_0x270ada){_0x3d1b54['rows']=_0x270ada;return _0x3d1b54;});}})[_0x4ca4('0x35')](respondWithFilteredResult(_0x1244d1,_0x1e328b))[_0x4ca4('0x58')](handleError(_0x1244d1,null));};exports[_0x4ca4('0x72')]=function(_0x1c99b3,_0xec0748,_0x3c604f){return db['OpenchannelAccount'][_0x4ca4('0x5d')]({'where':{'id':_0x1c99b3[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0xec0748,null))[_0x4ca4('0x35')](function(_0x562107){if(_0x562107){return _0x562107['removeAnswers'](_0x1c99b3['query'][_0x4ca4('0x6c')]);}})[_0x4ca4('0x35')](respondWithStatusCode(_0xec0748,null))[_0x4ca4('0x58')](handleError(_0xec0748,null));};exports[_0x4ca4('0x73')]=function(_0x5a1fe9,_0x5aff97,_0x1b8a23){var _0x4979c6={'body':_0x5a1fe9[_0x4ca4('0x5f')],'channel':'openchannel'};var _0x1447a7=[];var _0x100cf6=[];var _0x42cc63={};var _0x205969=![];return db['CmContact']['describe']()[_0x4ca4('0x35')](function(_0x46fb4d){if(!_0x46fb4d){throw new db['Sequelize'][(_0x4ca4('0x74'))](_0x4ca4('0x75'));}_0x1447a7=_['difference'](_[_0x4ca4('0x42')](_0x46fb4d),[_0x4ca4('0x76'),_0x4ca4('0x77')]);_0x100cf6=_[_0x4ca4('0x78')](_['keys'](_0x46fb4d),[_0x4ca4('0x76'),'updatedAt','CompanyId',_0x4ca4('0x79')]);if(_0x5a1fe9['body']['id']){delete _0x5a1fe9[_0x4ca4('0x5f')]['id'];}if(_[_0x4ca4('0x7a')](_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x7b')])){throw new db['Sequelize']['ValidationError'](_0x4ca4('0x7c'));}if(_[_0x4ca4('0x7a')](_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x5f')])||_0x5a1fe9['body'][_0x4ca4('0x5f')]===''){throw new db[(_0x4ca4('0x7d'))][(_0x4ca4('0x74'))](_0x4ca4('0x7e'));}if(_[_0x4ca4('0x7a')](_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x7f')])){throw new db[(_0x4ca4('0x7d'))][(_0x4ca4('0x74'))](_0x4ca4('0x80')+_0x100cf6);}if(!_[_0x4ca4('0x81')](_0x100cf6,_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x7f')])){throw new db[(_0x4ca4('0x7d'))][(_0x4ca4('0x74'))](_0x4ca4('0x82')+_0x100cf6);}_0x42cc63[_0x5a1fe9[_0x4ca4('0x5f')]['mapKey']]=_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x7b')];})['then'](function(){return db[_0x4ca4('0x56')]['find']({'where':{'id':_0x5a1fe9[_0x4ca4('0x5a')]['id']},'include':[{'model':db[_0x4ca4('0x83')],'as':'List','include':[{'model':db[_0x4ca4('0x84')],'as':'Contacts','where':_0x42cc63,'limit':0x1,'order':[[_0x4ca4('0x77'),'DESC']]}]},{'model':db[_0x4ca4('0x85')],'as':_0x4ca4('0x86')}]});})[_0x4ca4('0x35')](handleEntityNotFound(_0x5aff97,null))[_0x4ca4('0x35')](function(_0x412438){if(_0x412438&&_0x412438[_0x4ca4('0x87')]){_0x4979c6[_0x4ca4('0x88')]=_0x412438;_0x4979c6['applications']=_0x412438[_0x4ca4('0x86')];_0x4979c6[_0x4ca4('0x89')]=_0x412438[_0x4ca4('0x87')];_0x4979c6[_0x4ca4('0x8a')]=_[_0x4ca4('0x8b')](_0x4979c6['applications'],['priority'],[_0x4ca4('0x8c')]);if(_0x4979c6[_0x4ca4('0x88')][_0x4ca4('0x86')]){delete _0x4979c6['account'][_0x4ca4('0x86')];}if(_0x4979c6[_0x4ca4('0x88')][_0x4ca4('0x87')]&&_0x4979c6[_0x4ca4('0x88')][_0x4ca4('0x87')][_0x4ca4('0x8d')]['length']){return _0x4979c6[_0x4ca4('0x88')][_0x4ca4('0x87')][_0x4ca4('0x8d')][0x0];}var _0x3a06ae=_[_0x4ca4('0x17')](_0x5a1fe9[_0x4ca4('0x5f')],{'firstName':_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x7b')],'ListId':_0x412438[_0x4ca4('0x79')]});_0x3a06ae[_0x5a1fe9[_0x4ca4('0x5f')]['mapKey']]=_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x7b')];return db[_0x4ca4('0x84')][_0x4ca4('0x5e')](_0x3a06ae,{'fields':_0x1447a7,'raw':!![]});}})[_0x4ca4('0x35')](handleEntityNotFound(_0x5aff97,null))[_0x4ca4('0x35')](function(_0xde1ee2){_0x4979c6[_0x4ca4('0x8e')]=_0xde1ee2;if(_0xde1ee2){var _0x10b1ed={'ContactId':_0xde1ee2['id'],'OpenchannelAccountId':_0x5a1fe9[_0x4ca4('0x5a')]['id'],'from':(_0xde1ee2[_0x4ca4('0x8f')]||'')+'\x20'+(_0xde1ee2[_0x4ca4('0x90')]||'')};var _0x408305={'OpenchannelAccountId':_0x5a1fe9[_0x4ca4('0x5a')]['id'],'closed':![]};if(_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x91')]){_0x408305[_0x4ca4('0x91')]=_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x91')];return db[_0x4ca4('0x92')][_0x4ca4('0x5d')]({'where':_0x408305})['then'](function(_0x4f2c8c){if(_0x4f2c8c){return[_0x4f2c8c,![]];}_0x10b1ed[_0x4ca4('0x91')]=_0x5a1fe9[_0x4ca4('0x5f')]['threadId'];_0x10b1ed[_0x4ca4('0x93')]=_0x5a1fe9['body'][_0x4ca4('0x93')];return db[_0x4ca4('0x92')][_0x4ca4('0x5e')](_0x10b1ed)[_0x4ca4('0x35')](function(_0x4d32cc){return[_0x4d32cc,!![]];});});}else{_0x408305['threadId']=null;}_0x408305['ContactId']=_0xde1ee2['id'];return db[_0x4ca4('0x92')][_0x4ca4('0x5d')]({'where':_0x408305})[_0x4ca4('0x35')](function(_0x4897ee){if(_0x4897ee){return[_0x4897ee,![]];}return db[_0x4ca4('0x92')]['create'](_0x10b1ed)[_0x4ca4('0x35')](function(_0x1f0afa){return[_0x1f0afa,!![]];});});}})[_0x4ca4('0x94')](function(_0x57a2e2,_0x7660ca){if(_0x57a2e2){_0x205969=_0x7660ca;if(!_0x7660ca){var _0x5cc568={'from':(_0x4979c6[_0x4ca4('0x8e')][_0x4ca4('0x8f')]||'')+'\x20'+(_0x4979c6[_0x4ca4('0x8e')][_0x4ca4('0x90')]||'')};if(_0x5a1fe9['body']['threadId']&&_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x95')]&&_0x5a1fe9['body'][_0x4ca4('0x91')]!=_0x5a1fe9['body'][_0x4ca4('0x95')]){_0x5cc568[_0x4ca4('0x91')]=_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x95')];}return _0x57a2e2[_0x4ca4('0x34')](_0x5cc568);}else{return _0x57a2e2;}}})['then'](function(_0x528d82){_0x4979c6[_0x4ca4('0x96')]=_0x528d82['get']({'plain':!![]});_0x4979c6['interaction']['created']=_0x205969;if(_0x4979c6['interaction']['created']){if(_0x4979c6[_0x4ca4('0x88')][_0x4ca4('0x97')]){_0x4979c6[_0x4ca4('0x8a')][_0x4ca4('0x98')]({'id':0x0,'priority':_0x4979c6[_0x4ca4('0x8a')][_0x4ca4('0x5b')]+0x1,'app':_0x4ca4('0x99'),'appdata':_0x4ca4('0x9a'),'interval':'*,*,*,*'});}}return db[_0x4ca4('0x9b')][_0x4ca4('0x5e')]({'body':_0x5a1fe9[_0x4ca4('0x5f')]['body'],'OpenchannelAccountId':_0x5a1fe9[_0x4ca4('0x5a')]['id'],'OpenchannelInteractionId':_0x528d82['id'],'direction':'in','ContactId':_0x4979c6[_0x4ca4('0x8e')]['id'],'AttachmentId':_0x5a1fe9[_0x4ca4('0x5f')][_0x4ca4('0x9c')]});})[_0x4ca4('0x35')](function(_0x3163f4){_0x4979c6[_0x4ca4('0x27')]=_0x3163f4;if(_0x4979c6['interaction'][_0x4ca4('0x9d')]){return db[_0x4ca4('0x9e')]['find']({'attributes':['id',_0x4ca4('0x3c')],'where':{'id':_0x4979c6[_0x4ca4('0x96')][_0x4ca4('0x9d')]}})[_0x4ca4('0x35')](function(_0x12b9c7){if(_0x12b9c7){_0x4979c6[_0x4ca4('0x8a')][_0x4ca4('0x9f')]({'id':0x0,'priority':0x0,'app':_0x4ca4('0xa0'),'appdata':_0x12b9c7[_0x4ca4('0x3c')]+','+(_0x4979c6[_0x4ca4('0x88')]['waitForTheAssignedAgent']||0xa),'interval':_0x4ca4('0xa1')});_0x4979c6['forcedOwnership']=![];}return respondWithRpcPromise(_0x4ca4('0xa2'),_0x4ca4('0xa3'),_0x4979c6);});}return respondWithRpcPromise('Start',_0x4ca4('0xa3'),_0x4979c6);})[_0x4ca4('0x35')](function(_0x5af39f){respondWithRpcPromise(_0x4ca4('0xa4'),'EventManager',{'event':_0x4ca4('0x73'),'message':_0x5af39f},client9002);return _0x5af39f;})[_0x4ca4('0x35')](respondWithResult(_0x5aff97,null))[_0x4ca4('0x58')](handleError(_0x5aff97,null));};exports[_0x4ca4('0xa5')]=function(_0x5844e0,_0x329783,_0x50e5c4){return db[_0x4ca4('0x56')][_0x4ca4('0x69')]({'where':{'id':_0x5844e0[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x329783,null))[_0x4ca4('0x35')](function(_0x1e21cd){if(_0x1e21cd){return db['sequelize'][_0x4ca4('0xa6')](function(_0x245641){return db[_0x4ca4('0x85')]['destroy']({'where':{'OpenchannelAccountId':_0x5844e0['params']['id']},'transaction':_0x245641})[_0x4ca4('0x35')](function(_0x3134dd){var _0x3416df=_[_0x4ca4('0x51')](_0x5844e0['body'],function(_0x258e4a){_0x258e4a[_0x4ca4('0x6e')]=_0x5844e0['params']['id'];return _0x258e4a;});return db[_0x4ca4('0x85')][_0x4ca4('0xa7')](_0x3416df,{'transaction':_0x245641});});})[_0x4ca4('0x35')](function(){return db[_0x4ca4('0x85')][_0x4ca4('0xa8')]({'where':{'OpenchannelAccountId':_0x5844e0[_0x4ca4('0x5a')]['id']},'order':'priority'});});}})[_0x4ca4('0x35')](respondWithResult(_0x329783,null))['catch'](handleError(_0x329783,null));};exports[_0x4ca4('0xa9')]=function(_0x2f35e6,_0x25416e,_0x26db8d){var _0x105c15={};var _0x863ebe={};var _0x4e5324;var _0x2888ac;return db[_0x4ca4('0x56')][_0x4ca4('0x69')]({'where':{'id':_0x2f35e6['params']['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x25416e,null))[_0x4ca4('0x35')](function(_0x1241b1){if(_0x1241b1){_0x4e5324=_0x1241b1;_0x863ebe[_0x4ca4('0x45')]=_[_0x4ca4('0x42')](db[_0x4ca4('0x85')][_0x4ca4('0x41')]);_0x863ebe[_0x4ca4('0x46')]=_['keys'](_0x2f35e6[_0x4ca4('0x46')]);_0x863ebe['filters']=_[_0x4ca4('0x44')](_0x863ebe[_0x4ca4('0x45')],_0x863ebe[_0x4ca4('0x46')]);_0x105c15[_0x4ca4('0x47')]=_[_0x4ca4('0x44')](_0x863ebe[_0x4ca4('0x45')],qs['fields'](_0x2f35e6[_0x4ca4('0x46')]['fields']));_0x105c15['attributes']=_0x105c15[_0x4ca4('0x47')][_0x4ca4('0x5b')]?_0x105c15['attributes']:_0x863ebe[_0x4ca4('0x45')];_0x105c15[_0x4ca4('0x4b')]=qs['sort'](_0x2f35e6[_0x4ca4('0x46')]['sort']);_0x105c15[_0x4ca4('0x4d')]=qs[_0x4ca4('0x43')](_[_0x4ca4('0x4e')](_0x2f35e6[_0x4ca4('0x46')],_0x863ebe[_0x4ca4('0x43')]));if(_0x2f35e6['query']['filter']){_0x105c15[_0x4ca4('0x4d')]=_[_0x4ca4('0x50')](_0x105c15['where'],{'$or':_[_0x4ca4('0x51')](_0x105c15['attributes'],function(_0x169358){var _0xd4723d={};_0xd4723d[_0x169358]={'$like':'%'+_0x2f35e6['query'][_0x4ca4('0x4f')]+'%'};return _0xd4723d;})});}_0x105c15=_['merge']({},_0x105c15,_0x2f35e6[_0x4ca4('0x55')]);return _0x4e5324[_0x4ca4('0xa9')](_0x105c15);}})[_0x4ca4('0x35')](function(_0x27c588){if(_0x27c588){_0x2888ac=_0x27c588[_0x4ca4('0x5b')];if(!_0x2f35e6[_0x4ca4('0x46')][_0x4ca4('0x49')](_0x4ca4('0x4a'))){_0x105c15['limit']=qs[_0x4ca4('0x2e')](_0x2f35e6['query'][_0x4ca4('0x2e')]);_0x105c15[_0x4ca4('0x2d')]=qs[_0x4ca4('0x2d')](_0x2f35e6[_0x4ca4('0x46')][_0x4ca4('0x2d')]);}return _0x4e5324[_0x4ca4('0xa9')](_0x105c15);}})[_0x4ca4('0x35')](function(_0x208511){if(_0x208511){return _0x208511?{'count':_0x2888ac,'rows':_0x208511}:null;}})['then'](respondWithResult(_0x25416e,null))['catch'](handleError(_0x25416e,null));};exports[_0x4ca4('0xaa')]=function(_0x16150d,_0x99ccf,_0x13b4b5){var _0x4d0c27={'raw':![],'where':{}};var _0x36884a={};var _0x4c0d75={'count':0x0,'rows':[]};return db[_0x4ca4('0x56')]['findOne']({'where':{'id':_0x16150d[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x99ccf,null))['then'](function(_0x4577fe){if(_0x4577fe){_0x36884a[_0x4ca4('0x45')]=_['keys'](db['OpenchannelInteraction'][_0x4ca4('0x41')]);_0x36884a[_0x4ca4('0x46')]=_[_0x4ca4('0x42')](_0x16150d[_0x4ca4('0x46')]);_0x36884a[_0x4ca4('0x43')]=_[_0x4ca4('0x44')](_0x36884a[_0x4ca4('0x45')],_0x36884a[_0x4ca4('0x46')]);_0x4d0c27[_0x4ca4('0x47')]=_['intersection'](_0x36884a['model'],qs['fields'](_0x16150d[_0x4ca4('0x46')][_0x4ca4('0x48')]));_0x4d0c27[_0x4ca4('0x47')]=_0x4d0c27[_0x4ca4('0x47')][_0x4ca4('0x5b')]?_0x4d0c27[_0x4ca4('0x47')]:_0x36884a[_0x4ca4('0x45')];if(!_0x16150d[_0x4ca4('0x46')]['hasOwnProperty'](_0x4ca4('0x4a'))){_0x4d0c27['limit']=qs[_0x4ca4('0x2e')](_0x16150d[_0x4ca4('0x46')][_0x4ca4('0x2e')]);_0x4d0c27[_0x4ca4('0x2d')]=qs[_0x4ca4('0x2d')](_0x16150d[_0x4ca4('0x46')][_0x4ca4('0x2d')]);}_0x4d0c27[_0x4ca4('0x4b')]=qs[_0x4ca4('0x4c')](_0x16150d[_0x4ca4('0x46')][_0x4ca4('0x4c')]);_0x4d0c27[_0x4ca4('0x4d')]=qs[_0x4ca4('0x43')](_[_0x4ca4('0x4e')](_0x16150d[_0x4ca4('0x46')],_0x36884a[_0x4ca4('0x43')]));_0x4d0c27[_0x4ca4('0x4d')][_0x4ca4('0x6e')]=_0x4577fe['id'];if(_0x16150d[_0x4ca4('0x46')][_0x4ca4('0x4f')]){_0x4d0c27['where']=_[_0x4ca4('0x50')](_0x4d0c27[_0x4ca4('0x4d')],{'$or':_[_0x4ca4('0x51')](_0x4d0c27[_0x4ca4('0x47')],function(_0x20b0ff){var _0x21e16c={};_0x21e16c[_0x20b0ff]={'$like':'%'+_0x16150d[_0x4ca4('0x46')][_0x4ca4('0x4f')]+'%'};return _0x21e16c;})});}_0x4d0c27=_[_0x4ca4('0x50')]({},_0x4d0c27,_0x16150d[_0x4ca4('0x55')]);return db[_0x4ca4('0x92')][_0x4ca4('0x2c')]({'where':_0x4d0c27[_0x4ca4('0x4d')]})[_0x4ca4('0x35')](function(_0x102ab0){_0x4c0d75[_0x4ca4('0x2c')]=_0x102ab0;if(_0x16150d[_0x4ca4('0x46')][_0x4ca4('0x57')]){_0x4d0c27['include']=[{'model':db[_0x4ca4('0x84')],'as':_0x4ca4('0xab'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x4ca4('0x3c'),_0x4ca4('0xac'),_0x4ca4('0xad')],'required':![]},{'model':db[_0x4ca4('0xae')],'as':_0x4ca4('0xaf'),'attributes':['id',_0x4ca4('0x3c'),_0x4ca4('0xb0')],'where':_0x16150d[_0x4ca4('0x46')][_0x4ca4('0xb1')]?{'id':_0x16150d[_0x4ca4('0x46')][_0x4ca4('0xb1')]}:undefined,'required':_0x16150d['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0x4ca4('0x71')](_0x4d0c27);})[_0x4ca4('0x35')](function(_0x2e78ea){_0x4c0d75[_0x4ca4('0x6b')]=_0x2e78ea;return _0x4c0d75;});}})[_0x4ca4('0x35')](respondWithFilteredResult(_0x99ccf,_0x4d0c27))['catch'](handleError(_0x99ccf,null));};exports[_0x4ca4('0xb2')]=function(_0x41f543,_0x29723e,_0x2fa852){return db[_0x4ca4('0x56')][_0x4ca4('0x5d')]({'where':{'id':_0x41f543[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x29723e,null))[_0x4ca4('0x35')](function(_0x7f3c85){if(_0x7f3c85){return _0x7f3c85['addAgents'](_0x41f543[_0x4ca4('0x5f')]['ids'],_[_0x4ca4('0xb3')](_0x41f543[_0x4ca4('0x5f')],[_0x4ca4('0x6c'),'id'])||{})[_0x4ca4('0x94')](function(_0x278a03){for(var _0x20ea86=0x0;_0x20ea86<_0x41f543[_0x4ca4('0x5f')][_0x4ca4('0x6c')][_0x4ca4('0x5b')];_0x20ea86+=0x1){socket['emit'](_0x4ca4('0xb4'),{'UserId':_0x41f543['body'][_0x4ca4('0x6c')][_0x20ea86],'OpenchannelAccountId':_0x41f543[_0x4ca4('0x5a')]['id']});}return _0x278a03;});}})[_0x4ca4('0x35')](respondWithResult(_0x29723e,null))[_0x4ca4('0x58')](handleError(_0x29723e,null));};exports[_0x4ca4('0xb5')]=function(_0x4dc16e,_0x5ae915,_0x50dedc){return db[_0x4ca4('0x56')][_0x4ca4('0x5d')]({'where':{'id':_0x4dc16e[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x5ae915,null))['then'](function(_0x524a41){if(_0x524a41){return _0x524a41['removeAgents'](_0x4dc16e[_0x4ca4('0x46')]['ids'])[_0x4ca4('0x35')](function(){if(_[_0x4ca4('0xb6')](_0x4dc16e[_0x4ca4('0x46')]['ids'])){for(var _0x4db3a6=0x0;_0x4db3a6<_0x4dc16e[_0x4ca4('0x46')][_0x4ca4('0x6c')][_0x4ca4('0x5b')];_0x4db3a6+=0x1){socket[_0x4ca4('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4dc16e[_0x4ca4('0x46')]['ids'][_0x4db3a6]),'OpenchannelAccountId':Number(_0x4dc16e[_0x4ca4('0x5a')]['id'])});}}else{socket[_0x4ca4('0xb7')](_0x4ca4('0xb8'),{'UserId':Number(_0x4dc16e[_0x4ca4('0x46')]['ids']),'OpenchannelAccountId':Number(_0x4dc16e[_0x4ca4('0x5a')]['id'])});}});}})[_0x4ca4('0x35')](respondWithStatusCode(_0x5ae915,null))[_0x4ca4('0x58')](handleError(_0x5ae915,null));};exports['getAgents']=function(_0x31fc19,_0x39b2c6,_0x57778d){var _0x122af9={};var _0x24fb0c={};var _0x21c2cd;var _0x2f85fb;return db['OpenchannelAccount'][_0x4ca4('0x69')]({'where':{'id':_0x31fc19[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x39b2c6,null))[_0x4ca4('0x35')](function(_0x47796b){if(_0x47796b){_0x21c2cd=_0x47796b;_0x24fb0c[_0x4ca4('0x45')]=_[_0x4ca4('0x42')](db[_0x4ca4('0x9e')][_0x4ca4('0x41')]);_0x24fb0c[_0x4ca4('0x46')]=_[_0x4ca4('0x42')](_0x31fc19[_0x4ca4('0x46')]);_0x24fb0c[_0x4ca4('0x43')]=_['intersection'](_0x24fb0c['model'],_0x24fb0c[_0x4ca4('0x46')]);_0x122af9['attributes']=_[_0x4ca4('0x44')](_0x24fb0c[_0x4ca4('0x45')],qs[_0x4ca4('0x48')](_0x31fc19['query'][_0x4ca4('0x48')]));_0x122af9[_0x4ca4('0x47')]=_0x122af9[_0x4ca4('0x47')][_0x4ca4('0x5b')]?_0x122af9['attributes']:_0x24fb0c[_0x4ca4('0x45')];_0x122af9['order']=qs[_0x4ca4('0x4c')](_0x31fc19['query'][_0x4ca4('0x4c')]);_0x122af9[_0x4ca4('0x4d')]=qs[_0x4ca4('0x43')](_[_0x4ca4('0x4e')](_0x31fc19[_0x4ca4('0x46')],_0x24fb0c[_0x4ca4('0x43')]));if(_0x31fc19[_0x4ca4('0x46')][_0x4ca4('0x4f')]){_0x122af9[_0x4ca4('0x4d')]=_[_0x4ca4('0x50')](_0x122af9['where'],{'$or':_[_0x4ca4('0x51')](_0x122af9['attributes'],function(_0x3203c0){var _0x11e91b={};_0x11e91b[_0x3203c0]={'$like':'%'+_0x31fc19['query'][_0x4ca4('0x4f')]+'%'};return _0x11e91b;})});}_0x122af9=_[_0x4ca4('0x50')]({},_0x122af9,_0x31fc19[_0x4ca4('0x55')]);return _0x21c2cd[_0x4ca4('0xb9')](_0x122af9);}})[_0x4ca4('0x35')](function(_0x309215){if(_0x309215){_0x2f85fb=_0x309215['length'];if(!_0x31fc19[_0x4ca4('0x46')][_0x4ca4('0x49')](_0x4ca4('0x4a'))){_0x122af9[_0x4ca4('0x2e')]=qs[_0x4ca4('0x2e')](_0x31fc19[_0x4ca4('0x46')][_0x4ca4('0x2e')]);_0x122af9[_0x4ca4('0x2d')]=qs[_0x4ca4('0x2d')](_0x31fc19[_0x4ca4('0x46')][_0x4ca4('0x2d')]);}return _0x21c2cd[_0x4ca4('0xb9')](_0x122af9);}})[_0x4ca4('0x35')](function(_0x1f8c95){if(_0x1f8c95){return _0x1f8c95?{'count':_0x2f85fb,'rows':_0x1f8c95}:null;}})[_0x4ca4('0x35')](respondWithResult(_0x39b2c6,null))[_0x4ca4('0x58')](handleError(_0x39b2c6,null));};exports[_0x4ca4('0x3d')]=function(_0x34bab4,_0x30dbc6,_0x3b1928){var _0x38d112,_0x26aa3f,_0x36cbfa;if(_[_0x4ca4('0x7a')](_0x34bab4['body'][_0x4ca4('0x5f')])||_0x34bab4[_0x4ca4('0x5f')][_0x4ca4('0x5f')]===''){throw new db[(_0x4ca4('0x7d'))][(_0x4ca4('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x34bab4['body']['to'])){}_0x38d112=_0x34bab4[_0x4ca4('0x5f')]['to'];return db['OpenchannelAccount'][_0x4ca4('0x69')]({'where':{'id':_0x34bab4[_0x4ca4('0x5a')]['id']}})[_0x4ca4('0x35')](handleEntityNotFound(_0x30dbc6,null))[_0x4ca4('0x35')](function(_0x1104e4){if(_0x1104e4){return db[_0x4ca4('0x56')][_0x4ca4('0x5d')]({'where':{'id':_0x1104e4['id']},'include':[{'model':db[_0x4ca4('0x83')],'as':'List','include':[{'model':db[_0x4ca4('0x84')],'as':'Contacts','where':{[_0x1104e4['mapKey']]:_0x38d112},'limit':0x1,'order':[[_0x4ca4('0x77'),_0x4ca4('0xba')]]}]}]})[_0x4ca4('0x35')](handleEntityNotFound(_0x30dbc6,null))[_0x4ca4('0x35')](function(_0x334b13){if(_0x334b13&&_0x334b13[_0x4ca4('0x87')]){_0x26aa3f=_0x334b13[_0x4ca4('0x37')]({'plain':!![]});if(_0x26aa3f[_0x4ca4('0x87')]&&_0x26aa3f['List'][_0x4ca4('0x8d')][_0x4ca4('0x5b')]){return _0x26aa3f[_0x4ca4('0x87')]['Contacts'][0x0];}return db[_0x4ca4('0x84')][_0x4ca4('0x5e')](_['defaults'](_0x34bab4[_0x4ca4('0x5f')],{'firstName':_0x38d112,[_0x334b13['mapKey']]:_0x38d112,'phone':_0x38d112,'ListId':_0x26aa3f[_0x4ca4('0x79')]}));}})[_0x4ca4('0x35')](handleEntityNotFound(_0x30dbc6,null))[_0x4ca4('0x35')](function(_0x41a1ed){if(_0x41a1ed){_0x36cbfa=_0x41a1ed;return db[_0x4ca4('0x92')][_0x4ca4('0x5d')]({'where':{'ContactId':_0x36cbfa['id'],'closed':![],'OpenchannelAccountId':_0x26aa3f['id']}})['then'](function(_0x539b91){if(_0x539b91){return[_0x539b91,![]];}return db[_0x4ca4('0x92')]['create']({'UserId':_0x34bab4[_0x4ca4('0x60')]['id'],'ContactId':_0x36cbfa['id'],'OpenchannelAccountId':_0x26aa3f['id'],'lastMsgDirection':_0x4ca4('0xbb'),'Messages':[_[_0x4ca4('0x50')](_0x34bab4[_0x4ca4('0x5f')],{'read':![],'body':_0x34bab4[_0x4ca4('0x5f')]['body'],'OpenchannelAccountId':_0x26aa3f['id'],'UserId':_0x34bab4[_0x4ca4('0x60')]['id'],'ContactId':_0x36cbfa['id']})]},{'include':[{'model':db[_0x4ca4('0x9b')],'as':'Messages'}]})[_0x4ca4('0x35')](function(_0x3d173f){return[_0x3d173f,!![]];});});}})['spread'](function(_0x1e848f,_0x15370d){if(_0x15370d){return _0x1e848f;}return db[_0x4ca4('0x9b')]['create'](_[_0x4ca4('0x50')](_0x34bab4[_0x4ca4('0x5f')],{'read':![],'body':_0x34bab4[_0x4ca4('0x5f')][_0x4ca4('0x5f')],'OpenchannelAccountId':_0x26aa3f['id'],'OpenchannelInteractionId':_0x1e848f['id'],'UserId':_0x34bab4['user']['id'],'ContactId':_0x36cbfa['id']}))[_0x4ca4('0x35')](function(_0x4fa89d){_0x1e848f['dataValues'][_0x4ca4('0xbc')]=[];_0x1e848f['dataValues'][_0x4ca4('0xbc')]['push'](_0x4fa89d[_0x4ca4('0xbd')]);return _0x1e848f;});});}})[_0x4ca4('0x35')](respondWithResult(_0x30dbc6,null))[_0x4ca4('0x58')](handleError(_0x30dbc6,null));}; \ No newline at end of file +var _0xc980=['mandatoryDispositionPause','OpenchannelAccount','rawAttributes','keys','filters','intersection','query','attributes','model','nolimit','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','params','fields','length','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','OpenchannelAccountId','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','applications','Applications','orderBy','asc','account','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getInteractions','fullname','internal','Tags','tag','addAgents','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','limit','set','Content-Range','json','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','Pause'];(function(_0x3ad91f,_0x368edc){var _0x3d3167=function(_0x1e356f){while(--_0x1e356f){_0x3ad91f['push'](_0x3ad91f['shift']());}};_0x3d3167(++_0x368edc);}(_0xc980,0x7d));var _0x0c98=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0xc980[_0x11deef];return _0xe9ba85;};'use strict';var pdf=require(_0x0c98('0x0'));var emlformat=require(_0x0c98('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0c98('0x2'));var jsonpatch=require(_0x0c98('0x3'));var rp=require(_0x0c98('0x4'));var moment=require(_0x0c98('0x5'));var BPromise=require(_0x0c98('0x6'));var Mustache=require(_0x0c98('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0c98('0x8'));var fs=require('fs');var _=require(_0x0c98('0x9'));var squel=require(_0x0c98('0xa'));var crypto=require(_0x0c98('0xb'));var jsforce=require(_0x0c98('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0c98('0xd'));var querystring=require(_0x0c98('0xe'));var Papa=require(_0x0c98('0xf'));var Redis=require(_0x0c98('0x10'));var authService=require(_0x0c98('0x11'));var qs=require(_0x0c98('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c98('0x13'))(_0x0c98('0x14'));var utils=require(_0x0c98('0x15'));var config=require(_0x0c98('0x16'));var db=require('../../mysqldb')['db'];config[_0x0c98('0x17')]=_['defaults'](config[_0x0c98('0x17')],{'host':_0x0c98('0x18'),'port':0x18eb});var socket=require(_0x0c98('0x19'))(new Redis(config['redis']));require(_0x0c98('0x1a'))[_0x0c98('0x1b')](socket);var jayson=require(_0x0c98('0x1c'));var client=jayson[_0x0c98('0x1d')][_0x0c98('0x1e')]({'port':0x232c});var client9002=jayson[_0x0c98('0x1d')][_0x0c98('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x1f26ec,_0x20b920,_0x3680e8){if(_0x3680e8){var _0x3b320b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b320b[_0x0c98('0x1f')](_0x20b920)){return _0x1f26ec;}else{throw new Error(_0x0c98('0x20'));}}else{return _0x1f26ec;}}function respondWithRpcPromise(_0x46487a,_0x48ef55,_0x1e40a9,_0x306ddd){return new BPromise(function(_0x1b2732,_0x1a1133){var _0x487a18=_0x306ddd||client;return _0x487a18['request'](_0x46487a,_0x1e40a9)[_0x0c98('0x21')](function(_0x15d916){logger[_0x0c98('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x48ef55,_0x0c98('0x23'));logger[_0x0c98('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x48ef55,_0x0c98('0x23'),JSON['stringify'](_0x15d916));if(_0x15d916[_0x0c98('0x25')]){if(_0x15d916[_0x0c98('0x25')][_0x0c98('0x26')]===0x1f4){logger[_0x0c98('0x25')](_0x0c98('0x27'),_0x48ef55,_0x15d916[_0x0c98('0x25')][_0x0c98('0x28')]);return _0x1a1133(_0x15d916[_0x0c98('0x25')][_0x0c98('0x28')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x48ef55,_0x15d916['error']['message']);return _0x1b2732(_0x15d916['error'][_0x0c98('0x28')]);}else{logger[_0x0c98('0x22')](_0x0c98('0x27'),_0x48ef55,'request\x20sent');_0x1b2732(_0x15d916[_0x0c98('0x29')][_0x0c98('0x28')]);}})[_0x0c98('0x2a')](function(_0x4d2df6){logger['error'](_0x0c98('0x27'),_0x48ef55,_0x4d2df6);_0x1a1133(_0x4d2df6);});});}function respondWithStatusCode(_0x70f2e4,_0x133909){_0x133909=_0x133909||0xcc;return function(_0x41e08e){if(_0x41e08e){return _0x70f2e4[_0x0c98('0x2b')](_0x133909);}return _0x70f2e4['status'](_0x133909)['end']();};}function respondWithResult(_0x40153e,_0x940c77){_0x940c77=_0x940c77||0xc8;return function(_0x407bcc){if(_0x407bcc){return _0x40153e[_0x0c98('0x2c')](_0x940c77)['json'](_0x407bcc);}};}function respondWithFilteredResult(_0x2e4849,_0x4a1cc7){return function(_0x24d81d){if(_0x24d81d){var _0x5df2d3=_0x24d81d[_0x0c98('0x2d')],_0x52e47f=_0x4a1cc7['offset'],_0x18847f=_0x4a1cc7['offset']+_0x4a1cc7[_0x0c98('0x2e')],_0x4ed4b5;if(_0x18847f>=_0x5df2d3){_0x18847f=_0x5df2d3;_0x4ed4b5=0xc8;}else{_0x4ed4b5=0xce;}_0x2e4849[_0x0c98('0x2c')](_0x4ed4b5);return _0x2e4849[_0x0c98('0x2f')](_0x0c98('0x30'),_0x52e47f+'-'+_0x18847f+'/'+_0x5df2d3)[_0x0c98('0x31')](_0x24d81d);}return null;};}function patchUpdates(_0x5617e5){return function(_0x334e57){try{jsonpatch['apply'](_0x334e57,_0x5617e5,!![]);}catch(_0x34b04a){return BPromise[_0x0c98('0x32')](_0x34b04a);}return _0x334e57[_0x0c98('0x33')]();};}function saveUpdates(_0x3338f4,_0x1e8dd3){return function(_0x3c1e94){if(_0x3c1e94){return _0x3c1e94['update'](_0x3338f4)[_0x0c98('0x21')](function(_0xc357f4){return _0xc357f4;});}return null;};}function removeEntity(_0x1a4b84,_0x39bcd6){return function(_0x48cfe8){if(_0x48cfe8){return _0x48cfe8[_0x0c98('0x34')]()[_0x0c98('0x21')](function(){var _0x55da8c=_0x48cfe8[_0x0c98('0x35')]({'plain':!![]});var _0x360ed3=_0x0c98('0x36');return db[_0x0c98('0x37')][_0x0c98('0x34')]({'where':{'type':_0x360ed3,'resourceId':_0x55da8c['id']}})[_0x0c98('0x21')](function(){return _0x48cfe8;});})[_0x0c98('0x21')](function(){_0x1a4b84[_0x0c98('0x2c')](0xcc)[_0x0c98('0x38')]();});}};}function handleEntityNotFound(_0x3fbbb5,_0x445c9a){return function(_0x527fd6){if(!_0x527fd6){_0x3fbbb5[_0x0c98('0x2b')](0x194);}return _0x527fd6;};}function handleError(_0x245725,_0x1e4827){_0x1e4827=_0x1e4827||0x1f4;return function(_0x52d093){logger['error'](_0x52d093[_0x0c98('0x39')]);if(_0x52d093[_0x0c98('0x3a')]){delete _0x52d093[_0x0c98('0x3a')];}_0x245725[_0x0c98('0x2c')](_0x1e4827)[_0x0c98('0x3b')](_0x52d093);};}exports['index']=function(_0x1067c3,_0x35c715){var _0x3ee4b8={'include':[{'model':db[_0x0c98('0x3c')],'as':_0x0c98('0x3d')}]},_0x381e03={},_0x44cc2c={'count':0x0,'rows':[]};var _0x6ac6ea=db[_0x0c98('0x3e')][_0x0c98('0x3f')];_0x381e03['model']=_[_0x0c98('0x40')](_0x6ac6ea);_0x381e03['query']=_[_0x0c98('0x40')](_0x1067c3['query']);_0x381e03[_0x0c98('0x41')]=_[_0x0c98('0x42')](_0x381e03['model'],_0x381e03['query']);_0x3ee4b8['attributes']=_['intersection'](_0x381e03['model'],qs['fields'](_0x1067c3[_0x0c98('0x43')]['fields']));_0x3ee4b8['attributes']=_0x3ee4b8[_0x0c98('0x44')]['length']?_0x3ee4b8[_0x0c98('0x44')]:_0x381e03[_0x0c98('0x45')];if(!_0x1067c3['query']['hasOwnProperty'](_0x0c98('0x46'))){_0x3ee4b8[_0x0c98('0x2e')]=qs['limit'](_0x1067c3[_0x0c98('0x43')][_0x0c98('0x2e')]);_0x3ee4b8[_0x0c98('0x47')]=qs[_0x0c98('0x47')](_0x1067c3['query'][_0x0c98('0x47')]);}_0x3ee4b8['order']=qs[_0x0c98('0x48')](_0x1067c3[_0x0c98('0x43')][_0x0c98('0x48')]);_0x3ee4b8[_0x0c98('0x49')]=qs[_0x0c98('0x41')](_['pick'](_0x1067c3[_0x0c98('0x43')],_0x381e03[_0x0c98('0x41')]));if(_0x1067c3[_0x0c98('0x43')][_0x0c98('0x4a')]){_0x3ee4b8['where']=_[_0x0c98('0x4b')](_0x3ee4b8[_0x0c98('0x49')],{'$or':_[_0x0c98('0x4c')](_0x6ac6ea,function(_0x283332){if(_0x283332[_0x0c98('0x4d')][_0x0c98('0x4e')]!==_0x0c98('0x4f')){var _0x395b89={};_0x395b89[_0x283332[_0x0c98('0x50')]]={'$like':'%'+_0x1067c3['query'][_0x0c98('0x4a')]+'%'};return _0x395b89;}})});}_0x3ee4b8=_['merge']({},_0x3ee4b8,_0x1067c3[_0x0c98('0x51')]);var _0x446b5e={'where':_0x3ee4b8[_0x0c98('0x49')]};return db[_0x0c98('0x3e')][_0x0c98('0x2d')](_0x446b5e)[_0x0c98('0x21')](function(_0x3731e1){_0x44cc2c[_0x0c98('0x2d')]=_0x3731e1;if(_0x1067c3['query'][_0x0c98('0x52')]){_0x3ee4b8['include']=[{'all':!![]}];}return db[_0x0c98('0x3e')][_0x0c98('0x53')](_0x3ee4b8);})['then'](function(_0x1b1f02){_0x44cc2c[_0x0c98('0x54')]=_0x1b1f02;return _0x44cc2c;})['then'](respondWithFilteredResult(_0x35c715,_0x3ee4b8))[_0x0c98('0x2a')](handleError(_0x35c715,null));};exports[_0x0c98('0x55')]=function(_0x7cfc97,_0x4ffa6b){var _0x368b6b={'raw':![],'where':{'id':_0x7cfc97[_0x0c98('0x56')]['id']},'include':[{'model':db[_0x0c98('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4246ff={};_0x4246ff[_0x0c98('0x45')]=_[_0x0c98('0x40')](db[_0x0c98('0x3e')][_0x0c98('0x3f')]);_0x4246ff[_0x0c98('0x43')]=_[_0x0c98('0x40')](_0x7cfc97[_0x0c98('0x43')]);_0x4246ff[_0x0c98('0x41')]=_[_0x0c98('0x42')](_0x4246ff[_0x0c98('0x45')],_0x4246ff[_0x0c98('0x43')]);_0x368b6b[_0x0c98('0x44')]=_[_0x0c98('0x42')](_0x4246ff[_0x0c98('0x45')],qs[_0x0c98('0x57')](_0x7cfc97[_0x0c98('0x43')][_0x0c98('0x57')]));_0x368b6b[_0x0c98('0x44')]=_0x368b6b[_0x0c98('0x44')][_0x0c98('0x58')]?_0x368b6b['attributes']:_0x4246ff['model'];if(_0x7cfc97[_0x0c98('0x43')][_0x0c98('0x52')]){_0x368b6b['include']=[{'all':!![]}];}_0x368b6b=_[_0x0c98('0x4b')]({},_0x368b6b,_0x7cfc97[_0x0c98('0x51')]);return db[_0x0c98('0x3e')]['find'](_0x368b6b)[_0x0c98('0x21')](handleEntityNotFound(_0x4ffa6b,null))[_0x0c98('0x21')](respondWithResult(_0x4ffa6b,null))[_0x0c98('0x2a')](handleError(_0x4ffa6b,null));};exports[_0x0c98('0x59')]=function(_0xa8703c,_0x626107){return db[_0x0c98('0x3e')]['create'](_0xa8703c[_0x0c98('0x5a')],{})[_0x0c98('0x21')](function(_0x470bb1){var _0x578437=_0xa8703c[_0x0c98('0x5b')][_0x0c98('0x35')]({'plain':!![]});if(!_0x578437)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x578437[_0x0c98('0x5c')]===_0x0c98('0x5b')){var _0x2e3a8e=_0x470bb1[_0x0c98('0x35')]({'plain':!![]});var _0x3f8a96=_0x0c98('0x36');return db[_0x0c98('0x5d')][_0x0c98('0x5e')]({'where':{'name':_0x3f8a96,'userProfileId':_0x578437['userProfileId']},'raw':!![]})[_0x0c98('0x21')](function(_0x3381dd){if(_0x3381dd&&_0x3381dd[_0x0c98('0x5f')]===0x0){return db['UserProfileResource'][_0x0c98('0x59')]({'name':_0x2e3a8e[_0x0c98('0x3a')],'resourceId':_0x2e3a8e['id'],'type':_0x3381dd[_0x0c98('0x3a')],'sectionId':_0x3381dd['id']},{})[_0x0c98('0x21')](function(){return _0x470bb1;});}else{return _0x470bb1;}})['catch'](function(_0x46a43e){logger[_0x0c98('0x25')](_0x0c98('0x60'),_0x46a43e);throw _0x46a43e;});}return _0x470bb1;})['then'](respondWithResult(_0x626107,0xc9))[_0x0c98('0x2a')](handleError(_0x626107,null));};exports[_0x0c98('0x61')]=function(_0x2fcdca,_0x231b69){if(_0x2fcdca[_0x0c98('0x5a')]['id']){delete _0x2fcdca[_0x0c98('0x5a')]['id'];}return db[_0x0c98('0x3e')]['find']({'where':{'id':_0x2fcdca[_0x0c98('0x56')]['id']},'include':[{'model':db[_0x0c98('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x0c98('0x21')](handleEntityNotFound(_0x231b69,null))[_0x0c98('0x21')](saveUpdates(_0x2fcdca[_0x0c98('0x5a')],null))[_0x0c98('0x21')](respondWithResult(_0x231b69,null))[_0x0c98('0x2a')](handleError(_0x231b69,null));};exports[_0x0c98('0x34')]=function(_0xa72a07,_0x57f7c9){return db[_0x0c98('0x3e')][_0x0c98('0x5e')]({'where':{'id':_0xa72a07['params']['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x57f7c9,null))[_0x0c98('0x21')](removeEntity(_0x57f7c9,null))[_0x0c98('0x2a')](handleError(_0x57f7c9,null));};exports[_0x0c98('0x62')]=function(_0x28ab3a,_0x8ce74c){return db[_0x0c98('0x3e')][_0x0c98('0x62')]()['then'](respondWithResult(_0x8ce74c,null))['catch'](handleError(_0x8ce74c,null));};exports[_0x0c98('0x63')]=function(_0xac43fb,_0x570c74,_0x5305f0){if(_0xac43fb[_0x0c98('0x5a')]['id']){delete _0xac43fb[_0x0c98('0x5a')]['id'];}return db[_0x0c98('0x3e')][_0x0c98('0x5e')]({'where':{'id':_0xac43fb['params']['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x570c74,null))[_0x0c98('0x21')](function(_0x1bd85c){if(_0x1bd85c){_0xac43fb[_0x0c98('0x5a')][_0x0c98('0x64')]=_0x1bd85c['id'];return db[_0x0c98('0x65')][_0x0c98('0x59')](_0xac43fb['body']);}})[_0x0c98('0x21')](respondWithResult(_0x570c74,null))[_0x0c98('0x2a')](handleError(_0x570c74,null));};exports[_0x0c98('0x66')]=function(_0x4232f8,_0x20b931,_0x4337f8){var _0x386632={'raw':![],'where':{}};var _0x21a10e={};var _0x3229cf={'count':0x0,'rows':[]};return db[_0x0c98('0x3e')][_0x0c98('0x67')]({'where':{'id':_0x4232f8['params']['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x20b931,null))['then'](function(_0xdc19b9){if(_0xdc19b9){_0x21a10e[_0x0c98('0x45')]=_[_0x0c98('0x40')](db['Disposition'][_0x0c98('0x3f')]);_0x21a10e['query']=_[_0x0c98('0x40')](_0x4232f8['query']);_0x21a10e[_0x0c98('0x41')]=_[_0x0c98('0x42')](_0x21a10e[_0x0c98('0x45')],_0x21a10e['query']);_0x386632[_0x0c98('0x44')]=_[_0x0c98('0x42')](_0x21a10e[_0x0c98('0x45')],qs['fields'](_0x4232f8[_0x0c98('0x43')][_0x0c98('0x57')]));_0x386632['attributes']=_0x386632[_0x0c98('0x44')][_0x0c98('0x58')]?_0x386632[_0x0c98('0x44')]:_0x21a10e[_0x0c98('0x45')];if(!_0x4232f8['query'][_0x0c98('0x68')]('nolimit')){_0x386632[_0x0c98('0x2e')]=qs[_0x0c98('0x2e')](_0x4232f8[_0x0c98('0x43')][_0x0c98('0x2e')]);_0x386632['offset']=qs['offset'](_0x4232f8[_0x0c98('0x43')]['offset']);}_0x386632[_0x0c98('0x69')]=qs[_0x0c98('0x48')](_0x4232f8['query'][_0x0c98('0x48')]);_0x386632[_0x0c98('0x49')]=qs[_0x0c98('0x41')](_[_0x0c98('0x6a')](_0x4232f8[_0x0c98('0x43')],_0x21a10e[_0x0c98('0x41')]));_0x386632['where']['OpenchannelAccountId']=_0xdc19b9['id'];if(_0x4232f8[_0x0c98('0x43')]['filter']){_0x386632[_0x0c98('0x49')]=_[_0x0c98('0x4b')](_0x386632['where'],{'$or':_[_0x0c98('0x4c')](_0x386632['attributes'],function(_0x3847c4){var _0x5dfd49={};_0x5dfd49[_0x3847c4]={'$like':'%'+_0x4232f8[_0x0c98('0x43')][_0x0c98('0x4a')]+'%'};return _0x5dfd49;})});}_0x386632=_[_0x0c98('0x4b')]({},_0x386632,_0x4232f8['options']);return db['Disposition'][_0x0c98('0x2d')]({'where':_0x386632[_0x0c98('0x49')]})[_0x0c98('0x21')](function(_0xd1e61){_0x3229cf[_0x0c98('0x2d')]=_0xd1e61;if(_0x4232f8[_0x0c98('0x43')][_0x0c98('0x52')]){_0x386632[_0x0c98('0x6b')]=[{'all':!![]}];}return db[_0x0c98('0x65')]['findAll'](_0x386632);})[_0x0c98('0x21')](function(_0x42e7c4){_0x3229cf[_0x0c98('0x54')]=_0x42e7c4;return _0x3229cf;});}})['then'](respondWithFilteredResult(_0x20b931,_0x386632))[_0x0c98('0x2a')](handleError(_0x20b931,null));};exports[_0x0c98('0x6c')]=function(_0xfc0e66,_0x528bfb,_0x368c15){return db['OpenchannelAccount'][_0x0c98('0x5e')]({'where':{'id':_0xfc0e66[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x528bfb,null))['then'](function(_0x1f8d84){if(_0x1f8d84){return _0x1f8d84[_0x0c98('0x6c')](_0xfc0e66[_0x0c98('0x43')][_0x0c98('0x6d')]);}})[_0x0c98('0x21')](respondWithStatusCode(_0x528bfb,null))[_0x0c98('0x2a')](handleError(_0x528bfb,null));};exports[_0x0c98('0x6e')]=function(_0x20d3f0,_0x55b54a,_0x19aa84){if(_0x20d3f0[_0x0c98('0x5a')]['id']){delete _0x20d3f0[_0x0c98('0x5a')]['id'];}return db[_0x0c98('0x3e')][_0x0c98('0x5e')]({'where':{'id':_0x20d3f0[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x55b54a,null))[_0x0c98('0x21')](function(_0x109ced){if(_0x109ced){_0x20d3f0['body']['OpenchannelAccountId']=_0x109ced['id'];return db[_0x0c98('0x6f')][_0x0c98('0x59')](_0x20d3f0[_0x0c98('0x5a')]);}})[_0x0c98('0x21')](respondWithResult(_0x55b54a,null))[_0x0c98('0x2a')](handleError(_0x55b54a,null));};exports[_0x0c98('0x70')]=function(_0x25c02d,_0x103d46,_0x4f609e){var _0xc1270d={'raw':![],'where':{}};var _0x14b9be={};var _0x15c624={'count':0x0,'rows':[]};return db[_0x0c98('0x3e')]['findOne']({'where':{'id':_0x25c02d['params']['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x103d46,null))['then'](function(_0x469618){if(_0x469618){_0x14b9be[_0x0c98('0x45')]=_[_0x0c98('0x40')](db[_0x0c98('0x6f')]['rawAttributes']);_0x14b9be[_0x0c98('0x43')]=_[_0x0c98('0x40')](_0x25c02d[_0x0c98('0x43')]);_0x14b9be['filters']=_[_0x0c98('0x42')](_0x14b9be[_0x0c98('0x45')],_0x14b9be[_0x0c98('0x43')]);_0xc1270d[_0x0c98('0x44')]=_[_0x0c98('0x42')](_0x14b9be[_0x0c98('0x45')],qs[_0x0c98('0x57')](_0x25c02d[_0x0c98('0x43')][_0x0c98('0x57')]));_0xc1270d[_0x0c98('0x44')]=_0xc1270d[_0x0c98('0x44')][_0x0c98('0x58')]?_0xc1270d['attributes']:_0x14b9be[_0x0c98('0x45')];if(!_0x25c02d[_0x0c98('0x43')][_0x0c98('0x68')]('nolimit')){_0xc1270d[_0x0c98('0x2e')]=qs['limit'](_0x25c02d[_0x0c98('0x43')][_0x0c98('0x2e')]);_0xc1270d[_0x0c98('0x47')]=qs['offset'](_0x25c02d[_0x0c98('0x43')]['offset']);}_0xc1270d[_0x0c98('0x69')]=qs[_0x0c98('0x48')](_0x25c02d[_0x0c98('0x43')]['sort']);_0xc1270d[_0x0c98('0x49')]=qs['filters'](_[_0x0c98('0x6a')](_0x25c02d[_0x0c98('0x43')],_0x14b9be['filters']));_0xc1270d[_0x0c98('0x49')][_0x0c98('0x71')]=_0x469618['id'];if(_0x25c02d[_0x0c98('0x43')][_0x0c98('0x4a')]){_0xc1270d[_0x0c98('0x49')]=_[_0x0c98('0x4b')](_0xc1270d[_0x0c98('0x49')],{'$or':_[_0x0c98('0x4c')](_0xc1270d[_0x0c98('0x44')],function(_0x4f33e8){var _0xddb65c={};_0xddb65c[_0x4f33e8]={'$like':'%'+_0x25c02d[_0x0c98('0x43')]['filter']+'%'};return _0xddb65c;})});}_0xc1270d=_[_0x0c98('0x4b')]({},_0xc1270d,_0x25c02d[_0x0c98('0x51')]);return db['CannedAnswer'][_0x0c98('0x2d')]({'where':_0xc1270d[_0x0c98('0x49')]})['then'](function(_0x58d61b){_0x15c624['count']=_0x58d61b;if(_0x25c02d['query'][_0x0c98('0x52')]){_0xc1270d[_0x0c98('0x6b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0c98('0x53')](_0xc1270d);})[_0x0c98('0x21')](function(_0x8a3da0){_0x15c624[_0x0c98('0x54')]=_0x8a3da0;return _0x15c624;});}})[_0x0c98('0x21')](respondWithFilteredResult(_0x103d46,_0xc1270d))[_0x0c98('0x2a')](handleError(_0x103d46,null));};exports[_0x0c98('0x72')]=function(_0x3279de,_0x17ad9e,_0x3b35eb){return db[_0x0c98('0x3e')][_0x0c98('0x5e')]({'where':{'id':_0x3279de[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x17ad9e,null))[_0x0c98('0x21')](function(_0x459023){if(_0x459023){return _0x459023[_0x0c98('0x72')](_0x3279de[_0x0c98('0x43')]['ids']);}})[_0x0c98('0x21')](respondWithStatusCode(_0x17ad9e,null))[_0x0c98('0x2a')](handleError(_0x17ad9e,null));};exports['notify']=function(_0x37767d,_0x293941,_0x1f295f){var _0x44dcc4={'body':_0x37767d[_0x0c98('0x5a')],'channel':_0x0c98('0x73')};var _0x66d98a=[];var _0x3be534=[];var _0x5beb4a={};var _0x5aa011=![];return db[_0x0c98('0x74')][_0x0c98('0x62')]()[_0x0c98('0x21')](function(_0x262068){if(!_0x262068){throw new db[(_0x0c98('0x75'))][(_0x0c98('0x76'))]('no\x20available\x20attributes');}_0x66d98a=_[_0x0c98('0x77')](_[_0x0c98('0x40')](_0x262068),['createdAt',_0x0c98('0x78')]);_0x3be534=_[_0x0c98('0x77')](_[_0x0c98('0x40')](_0x262068),[_0x0c98('0x79'),_0x0c98('0x78'),_0x0c98('0x7a'),_0x0c98('0x7b')]);if(_0x37767d['body']['id']){delete _0x37767d[_0x0c98('0x5a')]['id'];}if(_[_0x0c98('0x7c')](_0x37767d['body']['from'])){throw new db[(_0x0c98('0x75'))][(_0x0c98('0x76'))](_0x0c98('0x7d'));}if(_[_0x0c98('0x7c')](_0x37767d[_0x0c98('0x5a')][_0x0c98('0x5a')])||_0x37767d[_0x0c98('0x5a')][_0x0c98('0x5a')]===''){throw new db[(_0x0c98('0x75'))]['ValidationError'](_0x0c98('0x7e'));}if(_[_0x0c98('0x7c')](_0x37767d['body'][_0x0c98('0x7f')])){throw new db[(_0x0c98('0x75'))][(_0x0c98('0x76'))](_0x0c98('0x80')+_0x3be534);}if(!_['includes'](_0x3be534,_0x37767d[_0x0c98('0x5a')][_0x0c98('0x7f')])){throw new db[(_0x0c98('0x75'))][(_0x0c98('0x76'))](_0x0c98('0x81')+_0x3be534);}_0x5beb4a[_0x37767d[_0x0c98('0x5a')][_0x0c98('0x7f')]]=_0x37767d[_0x0c98('0x5a')][_0x0c98('0x82')];})['then'](function(){return db[_0x0c98('0x3e')][_0x0c98('0x5e')]({'where':{'id':_0x37767d[_0x0c98('0x56')]['id']},'include':[{'model':db[_0x0c98('0x83')],'as':_0x0c98('0x84'),'include':[{'model':db['CmContact'],'as':_0x0c98('0x85'),'where':_0x5beb4a,'limit':0x1,'order':[[_0x0c98('0x78'),_0x0c98('0x86')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x293941,null))[_0x0c98('0x21')](function(_0x33de48){if(_0x33de48&&_0x33de48[_0x0c98('0x84')]){_0x44dcc4['account']=_0x33de48;_0x44dcc4[_0x0c98('0x87')]=_0x33de48[_0x0c98('0x88')];_0x44dcc4['list']=_0x33de48[_0x0c98('0x84')];_0x44dcc4['applications']=_[_0x0c98('0x89')](_0x44dcc4[_0x0c98('0x87')],['priority'],[_0x0c98('0x8a')]);if(_0x44dcc4[_0x0c98('0x8b')]['Applications']){delete _0x44dcc4['account'][_0x0c98('0x88')];}if(_0x44dcc4[_0x0c98('0x8b')][_0x0c98('0x84')]&&_0x44dcc4['account']['List'][_0x0c98('0x85')][_0x0c98('0x58')]){return _0x44dcc4['account'][_0x0c98('0x84')][_0x0c98('0x85')][0x0];}var _0x291d43=_[_0x0c98('0x8c')](_0x37767d['body'],{'firstName':_0x37767d[_0x0c98('0x5a')][_0x0c98('0x82')],'ListId':_0x33de48['ListId']});_0x291d43[_0x37767d[_0x0c98('0x5a')][_0x0c98('0x7f')]]=_0x37767d[_0x0c98('0x5a')][_0x0c98('0x82')];return db[_0x0c98('0x74')]['create'](_0x291d43,{'fields':_0x66d98a,'raw':!![]});}})[_0x0c98('0x21')](handleEntityNotFound(_0x293941,null))[_0x0c98('0x21')](function(_0x353a88){_0x44dcc4[_0x0c98('0x8d')]=_0x353a88;if(_0x353a88){var _0x2ea64c={'ContactId':_0x353a88['id'],'OpenchannelAccountId':_0x37767d[_0x0c98('0x56')]['id'],'from':(_0x353a88[_0x0c98('0x8e')]||'')+'\x20'+(_0x353a88[_0x0c98('0x8f')]||'')};var _0x3f028b={'OpenchannelAccountId':_0x37767d[_0x0c98('0x56')]['id'],'closed':![]};if(_0x37767d[_0x0c98('0x5a')][_0x0c98('0x90')]){_0x3f028b[_0x0c98('0x90')]=_0x37767d[_0x0c98('0x5a')][_0x0c98('0x90')];return db[_0x0c98('0x91')][_0x0c98('0x5e')]({'where':_0x3f028b})['then'](function(_0x970c79){if(_0x970c79){return[_0x970c79,![]];}_0x2ea64c[_0x0c98('0x90')]=_0x37767d['body'][_0x0c98('0x90')];_0x2ea64c[_0x0c98('0x92')]=_0x37767d[_0x0c98('0x5a')][_0x0c98('0x92')];return db['OpenchannelInteraction']['create'](_0x2ea64c)[_0x0c98('0x21')](function(_0x3ff965){return[_0x3ff965,!![]];});});}else{_0x3f028b[_0x0c98('0x90')]=null;}_0x3f028b[_0x0c98('0x93')]=_0x353a88['id'];return db[_0x0c98('0x91')][_0x0c98('0x5e')]({'where':_0x3f028b})['then'](function(_0x5706a8){if(_0x5706a8){return[_0x5706a8,![]];}return db[_0x0c98('0x91')][_0x0c98('0x59')](_0x2ea64c)[_0x0c98('0x21')](function(_0xa2e86b){return[_0xa2e86b,!![]];});});}})[_0x0c98('0x94')](function(_0x11899a,_0x5a1283){if(_0x11899a){_0x5aa011=_0x5a1283;if(!_0x5a1283){var _0x32e94a={'from':(_0x44dcc4[_0x0c98('0x8d')][_0x0c98('0x8e')]||'')+'\x20'+(_0x44dcc4[_0x0c98('0x8d')][_0x0c98('0x8f')]||'')};if(_0x37767d['body'][_0x0c98('0x90')]&&_0x37767d[_0x0c98('0x5a')][_0x0c98('0x95')]&&_0x37767d[_0x0c98('0x5a')][_0x0c98('0x90')]!=_0x37767d[_0x0c98('0x5a')]['messageId']){_0x32e94a[_0x0c98('0x90')]=_0x37767d['body'][_0x0c98('0x95')];}return _0x11899a[_0x0c98('0x61')](_0x32e94a);}else{return _0x11899a;}}})['then'](function(_0xc4d70a){_0x44dcc4[_0x0c98('0x96')]=_0xc4d70a[_0x0c98('0x35')]({'plain':!![]});_0x44dcc4[_0x0c98('0x96')]['created']=_0x5aa011;if(_0x44dcc4['interaction'][_0x0c98('0x97')]){if(_0x44dcc4[_0x0c98('0x8b')][_0x0c98('0x98')]){_0x44dcc4['applications'][_0x0c98('0x99')]({'id':0x0,'priority':_0x44dcc4['applications'][_0x0c98('0x58')]+0x1,'app':_0x0c98('0x9a'),'appdata':'unmanaged','interval':_0x0c98('0x9b')});}}return db[_0x0c98('0x9c')][_0x0c98('0x59')]({'body':_0x37767d[_0x0c98('0x5a')]['body'],'OpenchannelAccountId':_0x37767d[_0x0c98('0x56')]['id'],'OpenchannelInteractionId':_0xc4d70a['id'],'direction':'in','ContactId':_0x44dcc4[_0x0c98('0x8d')]['id'],'AttachmentId':_0x37767d[_0x0c98('0x5a')][_0x0c98('0x9d')]});})[_0x0c98('0x21')](function(_0x23577c){_0x44dcc4['message']=_0x23577c;if(_0x44dcc4[_0x0c98('0x96')]['UserId']){return db[_0x0c98('0x9e')][_0x0c98('0x5e')]({'attributes':['id','name'],'where':{'id':_0x44dcc4[_0x0c98('0x96')][_0x0c98('0x9f')]}})[_0x0c98('0x21')](function(_0x56da33){if(_0x56da33){_0x44dcc4[_0x0c98('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0c98('0xa0'),'appdata':_0x56da33[_0x0c98('0x3a')]+','+(_0x44dcc4['account'][_0x0c98('0xa1')]||0xa),'interval':_0x0c98('0x9b')});_0x44dcc4[_0x0c98('0xa2')]=![];}return respondWithRpcPromise(_0x0c98('0xa3'),_0x0c98('0xa4'),_0x44dcc4);});}return respondWithRpcPromise(_0x0c98('0xa3'),'startRouting',_0x44dcc4);})[_0x0c98('0x21')](function(_0x24df83){respondWithRpcPromise(_0x0c98('0xa5'),_0x0c98('0xa5'),{'event':_0x0c98('0xa6'),'message':_0x24df83},client9002);return _0x24df83;})[_0x0c98('0x21')](respondWithResult(_0x293941,null))[_0x0c98('0x2a')](handleError(_0x293941,null));};exports[_0x0c98('0xa7')]=function(_0x551155,_0xfea155,_0x24cf24){return db[_0x0c98('0x3e')]['findOne']({'where':{'id':_0x551155[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0xfea155,null))[_0x0c98('0x21')](function(_0x4e68b2){if(_0x4e68b2){return db[_0x0c98('0xa8')][_0x0c98('0xa9')](function(_0x20c549){return db[_0x0c98('0xaa')]['destroy']({'where':{'OpenchannelAccountId':_0x551155[_0x0c98('0x56')]['id']},'transaction':_0x20c549})[_0x0c98('0x21')](function(_0x1e1513){var _0x30d650=_[_0x0c98('0x4c')](_0x551155[_0x0c98('0x5a')],function(_0x2f668b){_0x2f668b[_0x0c98('0x71')]=_0x551155[_0x0c98('0x56')]['id'];return _0x2f668b;});return db[_0x0c98('0xaa')][_0x0c98('0xab')](_0x30d650,{'transaction':_0x20c549});});})[_0x0c98('0x21')](function(){return db['OpenchannelApplication'][_0x0c98('0xac')]({'where':{'OpenchannelAccountId':_0x551155[_0x0c98('0x56')]['id']},'order':'priority'});});}})[_0x0c98('0x21')](respondWithResult(_0xfea155,null))[_0x0c98('0x2a')](handleError(_0xfea155,null));};exports['getApplications']=function(_0x257b47,_0x3843e4,_0x29bc3e){var _0x1f7dae={};var _0x395b05={};var _0x14cd8c;var _0x560d52;return db[_0x0c98('0x3e')][_0x0c98('0x67')]({'where':{'id':_0x257b47[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x3843e4,null))[_0x0c98('0x21')](function(_0x1e7554){if(_0x1e7554){_0x14cd8c=_0x1e7554;_0x395b05[_0x0c98('0x45')]=_[_0x0c98('0x40')](db[_0x0c98('0xaa')][_0x0c98('0x3f')]);_0x395b05[_0x0c98('0x43')]=_[_0x0c98('0x40')](_0x257b47[_0x0c98('0x43')]);_0x395b05[_0x0c98('0x41')]=_[_0x0c98('0x42')](_0x395b05['model'],_0x395b05['query']);_0x1f7dae[_0x0c98('0x44')]=_[_0x0c98('0x42')](_0x395b05[_0x0c98('0x45')],qs[_0x0c98('0x57')](_0x257b47[_0x0c98('0x43')]['fields']));_0x1f7dae[_0x0c98('0x44')]=_0x1f7dae[_0x0c98('0x44')][_0x0c98('0x58')]?_0x1f7dae[_0x0c98('0x44')]:_0x395b05[_0x0c98('0x45')];_0x1f7dae[_0x0c98('0x69')]=qs[_0x0c98('0x48')](_0x257b47[_0x0c98('0x43')][_0x0c98('0x48')]);_0x1f7dae['where']=qs[_0x0c98('0x41')](_[_0x0c98('0x6a')](_0x257b47[_0x0c98('0x43')],_0x395b05['filters']));if(_0x257b47[_0x0c98('0x43')]['filter']){_0x1f7dae['where']=_[_0x0c98('0x4b')](_0x1f7dae['where'],{'$or':_[_0x0c98('0x4c')](_0x1f7dae['attributes'],function(_0x29d8a4){var _0x554fd9={};_0x554fd9[_0x29d8a4]={'$like':'%'+_0x257b47['query'][_0x0c98('0x4a')]+'%'};return _0x554fd9;})});}_0x1f7dae=_[_0x0c98('0x4b')]({},_0x1f7dae,_0x257b47[_0x0c98('0x51')]);return _0x14cd8c['getApplications'](_0x1f7dae);}})[_0x0c98('0x21')](function(_0x2611b8){if(_0x2611b8){_0x560d52=_0x2611b8[_0x0c98('0x58')];if(!_0x257b47[_0x0c98('0x43')][_0x0c98('0x68')](_0x0c98('0x46'))){_0x1f7dae[_0x0c98('0x2e')]=qs[_0x0c98('0x2e')](_0x257b47[_0x0c98('0x43')]['limit']);_0x1f7dae[_0x0c98('0x47')]=qs[_0x0c98('0x47')](_0x257b47[_0x0c98('0x43')][_0x0c98('0x47')]);}return _0x14cd8c['getApplications'](_0x1f7dae);}})['then'](function(_0x10b14d){if(_0x10b14d){return _0x10b14d?{'count':_0x560d52,'rows':_0x10b14d}:null;}})[_0x0c98('0x21')](respondWithResult(_0x3843e4,null))[_0x0c98('0x2a')](handleError(_0x3843e4,null));};exports[_0x0c98('0xad')]=function(_0x1643ee,_0x527f9e,_0x730ed7){var _0x2436d2={'raw':![],'where':{}};var _0x34904d={};var _0x2e1f51={'count':0x0,'rows':[]};return db[_0x0c98('0x3e')][_0x0c98('0x67')]({'where':{'id':_0x1643ee[_0x0c98('0x56')]['id']}})['then'](handleEntityNotFound(_0x527f9e,null))[_0x0c98('0x21')](function(_0x4a9c6d){if(_0x4a9c6d){_0x34904d[_0x0c98('0x45')]=_['keys'](db[_0x0c98('0x91')][_0x0c98('0x3f')]);_0x34904d[_0x0c98('0x43')]=_['keys'](_0x1643ee['query']);_0x34904d[_0x0c98('0x41')]=_[_0x0c98('0x42')](_0x34904d[_0x0c98('0x45')],_0x34904d[_0x0c98('0x43')]);_0x2436d2[_0x0c98('0x44')]=_['intersection'](_0x34904d[_0x0c98('0x45')],qs[_0x0c98('0x57')](_0x1643ee[_0x0c98('0x43')][_0x0c98('0x57')]));_0x2436d2[_0x0c98('0x44')]=_0x2436d2[_0x0c98('0x44')][_0x0c98('0x58')]?_0x2436d2[_0x0c98('0x44')]:_0x34904d['model'];if(!_0x1643ee['query']['hasOwnProperty'](_0x0c98('0x46'))){_0x2436d2['limit']=qs[_0x0c98('0x2e')](_0x1643ee[_0x0c98('0x43')]['limit']);_0x2436d2[_0x0c98('0x47')]=qs[_0x0c98('0x47')](_0x1643ee['query'][_0x0c98('0x47')]);}_0x2436d2[_0x0c98('0x69')]=qs['sort'](_0x1643ee['query'][_0x0c98('0x48')]);_0x2436d2[_0x0c98('0x49')]=qs['filters'](_[_0x0c98('0x6a')](_0x1643ee[_0x0c98('0x43')],_0x34904d[_0x0c98('0x41')]));_0x2436d2[_0x0c98('0x49')][_0x0c98('0x71')]=_0x4a9c6d['id'];if(_0x1643ee[_0x0c98('0x43')]['filter']){_0x2436d2[_0x0c98('0x49')]=_['merge'](_0x2436d2['where'],{'$or':_[_0x0c98('0x4c')](_0x2436d2[_0x0c98('0x44')],function(_0x2744f1){var _0x4dd573={};_0x4dd573[_0x2744f1]={'$like':'%'+_0x1643ee['query'][_0x0c98('0x4a')]+'%'};return _0x4dd573;})});}_0x2436d2=_[_0x0c98('0x4b')]({},_0x2436d2,_0x1643ee[_0x0c98('0x51')]);return db[_0x0c98('0x91')][_0x0c98('0x2d')]({'where':_0x2436d2[_0x0c98('0x49')]})[_0x0c98('0x21')](function(_0xc536ad){_0x2e1f51[_0x0c98('0x2d')]=_0xc536ad;if(_0x1643ee[_0x0c98('0x43')][_0x0c98('0x52')]){_0x2436d2['include']=[{'model':db[_0x0c98('0x74')],'as':'Contact','required':![]},{'model':db[_0x0c98('0x9e')],'as':'Owner','attributes':[_0x0c98('0x3a'),_0x0c98('0xae'),_0x0c98('0xaf')],'required':![]},{'model':db['Tag'],'as':_0x0c98('0xb0'),'attributes':['id','name','color'],'where':_0x1643ee[_0x0c98('0x43')][_0x0c98('0xb1')]?{'id':_0x1643ee['query'][_0x0c98('0xb1')]}:undefined,'required':_0x1643ee[_0x0c98('0x43')]['tag']?!![]:![]}];}return db[_0x0c98('0x91')][_0x0c98('0x53')](_0x2436d2);})[_0x0c98('0x21')](function(_0x272fb9){_0x2e1f51[_0x0c98('0x54')]=_0x272fb9;return _0x2e1f51;});}})[_0x0c98('0x21')](respondWithFilteredResult(_0x527f9e,_0x2436d2))[_0x0c98('0x2a')](handleError(_0x527f9e,null));};exports[_0x0c98('0xb2')]=function(_0x3800e2,_0x1dfa4a,_0x10ff39){return db[_0x0c98('0x3e')][_0x0c98('0x5e')]({'where':{'id':_0x3800e2[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x1dfa4a,null))[_0x0c98('0x21')](function(_0x20585d){if(_0x20585d){return _0x20585d[_0x0c98('0xb2')](_0x3800e2[_0x0c98('0x5a')][_0x0c98('0x6d')],_['omit'](_0x3800e2[_0x0c98('0x5a')],[_0x0c98('0x6d'),'id'])||{})[_0x0c98('0x94')](function(_0x430929){for(var _0x4c163c=0x0;_0x4c163c<_0x3800e2[_0x0c98('0x5a')][_0x0c98('0x6d')][_0x0c98('0x58')];_0x4c163c+=0x1){socket['emit'](_0x0c98('0xb3'),{'UserId':_0x3800e2['body'][_0x0c98('0x6d')][_0x4c163c],'OpenchannelAccountId':_0x3800e2['params']['id']});}return _0x430929;});}})['then'](respondWithResult(_0x1dfa4a,null))[_0x0c98('0x2a')](handleError(_0x1dfa4a,null));};exports['removeAgents']=function(_0x42e7f4,_0x40204f,_0x5cfc9a){return db[_0x0c98('0x3e')][_0x0c98('0x5e')]({'where':{'id':_0x42e7f4[_0x0c98('0x56')]['id']}})['then'](handleEntityNotFound(_0x40204f,null))[_0x0c98('0x21')](function(_0xf14a65){if(_0xf14a65){return _0xf14a65[_0x0c98('0xb4')](_0x42e7f4[_0x0c98('0x43')][_0x0c98('0x6d')])[_0x0c98('0x21')](function(){if(_['isArray'](_0x42e7f4['query'][_0x0c98('0x6d')])){for(var _0x841718=0x0;_0x841718<_0x42e7f4['query'][_0x0c98('0x6d')][_0x0c98('0x58')];_0x841718+=0x1){socket[_0x0c98('0xb5')](_0x0c98('0xb6'),{'UserId':Number(_0x42e7f4[_0x0c98('0x43')][_0x0c98('0x6d')][_0x841718]),'OpenchannelAccountId':Number(_0x42e7f4[_0x0c98('0x56')]['id'])});}}else{socket['emit'](_0x0c98('0xb6'),{'UserId':Number(_0x42e7f4['query'][_0x0c98('0x6d')]),'OpenchannelAccountId':Number(_0x42e7f4['params']['id'])});}});}})[_0x0c98('0x21')](respondWithStatusCode(_0x40204f,null))['catch'](handleError(_0x40204f,null));};exports['getAgents']=function(_0x4f0eb4,_0x7126e4,_0x2d4c0d){var _0x49d94a={};var _0x35af8d={};var _0x17b001;var _0x27bec8;return db['OpenchannelAccount'][_0x0c98('0x67')]({'where':{'id':_0x4f0eb4[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x7126e4,null))[_0x0c98('0x21')](function(_0x21769a){if(_0x21769a){_0x17b001=_0x21769a;_0x35af8d[_0x0c98('0x45')]=_[_0x0c98('0x40')](db[_0x0c98('0x9e')]['rawAttributes']);_0x35af8d['query']=_[_0x0c98('0x40')](_0x4f0eb4[_0x0c98('0x43')]);_0x35af8d[_0x0c98('0x41')]=_[_0x0c98('0x42')](_0x35af8d[_0x0c98('0x45')],_0x35af8d[_0x0c98('0x43')]);_0x49d94a['attributes']=_[_0x0c98('0x42')](_0x35af8d['model'],qs[_0x0c98('0x57')](_0x4f0eb4['query']['fields']));_0x49d94a['attributes']=_0x49d94a['attributes'][_0x0c98('0x58')]?_0x49d94a['attributes']:_0x35af8d[_0x0c98('0x45')];_0x49d94a[_0x0c98('0x69')]=qs[_0x0c98('0x48')](_0x4f0eb4['query'][_0x0c98('0x48')]);_0x49d94a['where']=qs['filters'](_[_0x0c98('0x6a')](_0x4f0eb4['query'],_0x35af8d[_0x0c98('0x41')]));if(_0x4f0eb4['query'][_0x0c98('0x4a')]){_0x49d94a[_0x0c98('0x49')]=_['merge'](_0x49d94a[_0x0c98('0x49')],{'$or':_[_0x0c98('0x4c')](_0x49d94a['attributes'],function(_0x21613d){var _0x54b9b9={};_0x54b9b9[_0x21613d]={'$like':'%'+_0x4f0eb4['query'][_0x0c98('0x4a')]+'%'};return _0x54b9b9;})});}_0x49d94a=_[_0x0c98('0x4b')]({},_0x49d94a,_0x4f0eb4[_0x0c98('0x51')]);return _0x17b001['getAgents'](_0x49d94a);}})['then'](function(_0x487147){if(_0x487147){_0x27bec8=_0x487147[_0x0c98('0x58')];if(!_0x4f0eb4[_0x0c98('0x43')][_0x0c98('0x68')](_0x0c98('0x46'))){_0x49d94a[_0x0c98('0x2e')]=qs[_0x0c98('0x2e')](_0x4f0eb4['query']['limit']);_0x49d94a[_0x0c98('0x47')]=qs[_0x0c98('0x47')](_0x4f0eb4[_0x0c98('0x43')]['offset']);}return _0x17b001[_0x0c98('0xb7')](_0x49d94a);}})['then'](function(_0x722a6){if(_0x722a6){return _0x722a6?{'count':_0x27bec8,'rows':_0x722a6}:null;}})['then'](respondWithResult(_0x7126e4,null))[_0x0c98('0x2a')](handleError(_0x7126e4,null));};exports[_0x0c98('0x3b')]=function(_0x2aa231,_0x5f1477,_0x496d34){var _0x287595,_0x27046c,_0x3850d9;if(_[_0x0c98('0x7c')](_0x2aa231[_0x0c98('0x5a')][_0x0c98('0x5a')])||_0x2aa231[_0x0c98('0x5a')]['body']===''){throw new db['Sequelize'][(_0x0c98('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0c98('0x7c')](_0x2aa231[_0x0c98('0x5a')]['to'])){}_0x287595=_0x2aa231[_0x0c98('0x5a')]['to'];return db['OpenchannelAccount'][_0x0c98('0x67')]({'where':{'id':_0x2aa231[_0x0c98('0x56')]['id']}})[_0x0c98('0x21')](handleEntityNotFound(_0x5f1477,null))[_0x0c98('0x21')](function(_0x9821c5){if(_0x9821c5){return db[_0x0c98('0x3e')]['find']({'where':{'id':_0x9821c5['id']},'include':[{'model':db['CmList'],'as':_0x0c98('0x84'),'include':[{'model':db[_0x0c98('0x74')],'as':_0x0c98('0x85'),'where':{[_0x9821c5[_0x0c98('0x7f')]]:_0x287595},'limit':0x1,'order':[['updatedAt',_0x0c98('0x86')]]}]}]})[_0x0c98('0x21')](handleEntityNotFound(_0x5f1477,null))[_0x0c98('0x21')](function(_0x4df4f0){if(_0x4df4f0&&_0x4df4f0[_0x0c98('0x84')]){_0x27046c=_0x4df4f0[_0x0c98('0x35')]({'plain':!![]});if(_0x27046c[_0x0c98('0x84')]&&_0x27046c[_0x0c98('0x84')][_0x0c98('0x85')]['length']){return _0x27046c[_0x0c98('0x84')][_0x0c98('0x85')][0x0];}return db[_0x0c98('0x74')][_0x0c98('0x59')](_[_0x0c98('0x8c')](_0x2aa231[_0x0c98('0x5a')],{'firstName':_0x287595,[_0x4df4f0[_0x0c98('0x7f')]]:_0x287595,'phone':_0x287595,'ListId':_0x27046c[_0x0c98('0x7b')]}));}})['then'](handleEntityNotFound(_0x5f1477,null))[_0x0c98('0x21')](function(_0x10e7dc){if(_0x10e7dc){_0x3850d9=_0x10e7dc;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x3850d9['id'],'closed':![],'OpenchannelAccountId':_0x27046c['id']}})['then'](function(_0x2600ed){if(_0x2600ed){return[_0x2600ed,![]];}return db[_0x0c98('0x91')][_0x0c98('0x59')]({'UserId':_0x2aa231[_0x0c98('0x5b')]['id'],'ContactId':_0x3850d9['id'],'OpenchannelAccountId':_0x27046c['id'],'lastMsgDirection':'out','Messages':[_[_0x0c98('0x4b')](_0x2aa231[_0x0c98('0x5a')],{'read':![],'body':_0x2aa231['body']['body'],'OpenchannelAccountId':_0x27046c['id'],'UserId':_0x2aa231['user']['id'],'ContactId':_0x3850d9['id']})]},{'include':[{'model':db[_0x0c98('0x9c')],'as':_0x0c98('0xb8')}]})[_0x0c98('0x21')](function(_0xda66f6){return[_0xda66f6,!![]];});});}})[_0x0c98('0x94')](function(_0x5f162f,_0x1f49d8){if(_0x1f49d8){return _0x5f162f;}return db['OpenchannelMessage'][_0x0c98('0x59')](_[_0x0c98('0x4b')](_0x2aa231[_0x0c98('0x5a')],{'read':![],'body':_0x2aa231[_0x0c98('0x5a')][_0x0c98('0x5a')],'OpenchannelAccountId':_0x27046c['id'],'OpenchannelInteractionId':_0x5f162f['id'],'UserId':_0x2aa231[_0x0c98('0x5b')]['id'],'ContactId':_0x3850d9['id']}))[_0x0c98('0x21')](function(_0x14c770){_0x5f162f['dataValues'][_0x0c98('0xb8')]=[];_0x5f162f[_0x0c98('0xb9')][_0x0c98('0xb8')][_0x0c98('0x99')](_0x14c770['dataValues']);return _0x5f162f;});});}})[_0x0c98('0x21')](respondWithResult(_0x5f1477,null))[_0x0c98('0x2a')](handleError(_0x5f1477,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ace1e41..3092904 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 _0x4a41=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x4a41,0x1b8));var _0x14a4=function(_0x3806b1,_0x425a11){_0x3806b1=_0x3806b1-0x0;var _0x2a0da2=_0x4a41[_0x3806b1];return _0x2a0da2;};'use strict';var EventEmitter=require(_0x14a4('0x0'));var OpenchannelAccount=require(_0x14a4('0x1'))['db'][_0x14a4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x14a4('0x3')](0x0);var events={'afterCreate':_0x14a4('0x4'),'afterUpdate':_0x14a4('0x5'),'afterDestroy':_0x14a4('0x6')};function emitEvent(_0x1d9e01){return function(_0x3a53ca,_0x3c7802,_0x4c2b43){OpenchannelAccountEvents[_0x14a4('0x7')](_0x1d9e01+':'+_0x3a53ca['id'],_0x3a53ca);OpenchannelAccountEvents['emit'](_0x1d9e01,_0x3a53ca);_0x4c2b43(null);};}for(var e in events){if(events[_0x14a4('0x8')](e)){var event=events[e];OpenchannelAccount[_0x14a4('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x19a7=['save','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners'];(function(_0x9e663f,_0x32dfb6){var _0x52a308=function(_0x269047){while(--_0x269047){_0x9e663f['push'](_0x9e663f['shift']());}};_0x52a308(++_0x32dfb6);}(_0x19a7,0x1a1));var _0x719a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x19a7[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require(_0x719a('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x719a('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x719a('0x2')](0x0);var events={'afterCreate':_0x719a('0x3'),'afterUpdate':_0x719a('0x4'),'afterDestroy':_0x719a('0x5')};function emitEvent(_0x7c88e4){return function(_0x100a3f,_0x2c55da,_0x1cb181){OpenchannelAccountEvents[_0x719a('0x6')](_0x7c88e4+':'+_0x100a3f['id'],_0x100a3f);OpenchannelAccountEvents['emit'](_0x7c88e4,_0x100a3f);_0x1cb181(null);};}for(var e in events){if(events[_0x719a('0x7')](e)){var event=events[e];OpenchannelAccount[_0x719a('0x8')](e,emitEvent(event));}}module[_0x719a('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 615c655..0397bcb 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 _0x1c08=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','OpenchannelAccount','openchannel_accounts','util','api'];(function(_0x44572e,_0x2d1dd9){var _0x43e84e=function(_0x486c3e){while(--_0x486c3e){_0x44572e['push'](_0x44572e['shift']());}};_0x43e84e(++_0x2d1dd9);}(_0x1c08,0x11c));var _0x81c0=function(_0x2a7fa8,_0x413c0e){_0x2a7fa8=_0x2a7fa8-0x0;var _0xf7e306=_0x1c08[_0x2a7fa8];return _0xf7e306;};'use strict';var _=require('lodash');var util=require(_0x81c0('0x0'));var logger=require('../../config/logger')(_0x81c0('0x1'));var moment=require(_0x81c0('0x2'));var BPromise=require(_0x81c0('0x3'));var rp=require(_0x81c0('0x4'));var fs=require('fs');var path=require(_0x81c0('0x5'));var rimraf=require(_0x81c0('0x6'));var config=require(_0x81c0('0x7'));var attributes=require(_0x81c0('0x8'));module['exports']=function(_0x427776,_0x1093db){return _0x427776['define'](_0x81c0('0x9'),attributes,{'tableName':_0x81c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46c9=['OpenchannelAccount','openchannel_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define'];(function(_0x160e75,_0x15158b){var _0x4d97c0=function(_0x50f003){while(--_0x50f003){_0x160e75['push'](_0x160e75['shift']());}};_0x4d97c0(++_0x15158b);}(_0x46c9,0x106));var _0x946c=function(_0xf7c208,_0x5cbc84){_0xf7c208=_0xf7c208-0x0;var _0x16992d=_0x46c9[_0xf7c208];return _0x16992d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x946c('0x0'))(_0x946c('0x1'));var moment=require(_0x946c('0x2'));var BPromise=require(_0x946c('0x3'));var rp=require(_0x946c('0x4'));var fs=require('fs');var path=require(_0x946c('0x5'));var rimraf=require(_0x946c('0x6'));var config=require(_0x946c('0x7'));var attributes=require(_0x946c('0x8'));module[_0x946c('0x9')]=function(_0x12b399,_0x17b983){return _0x12b399[_0x946c('0xa')](_0x946c('0xb'),attributes,{'tableName':_0x946c('0xc'),'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 1c2bf8a..a8c091a 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 _0x326f=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x3e8431,_0xbc6948){var _0x47d8a1=function(_0x4ee19c){while(--_0x4ee19c){_0x3e8431['push'](_0x3e8431['shift']());}};_0x47d8a1(++_0xbc6948);}(_0x326f,0xd1));var _0xf326=function(_0x456364,_0x163cbc){_0x456364=_0x456364-0x0;var _0x37f1eb=_0x326f[_0x456364];return _0x37f1eb;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});config[_0xf326('0xb')]=_[_0xf326('0xc')](config[_0xf326('0xb')],{'host':_0xf326('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf326('0xe')](socket);function respondWithRpcPromise(_0x1fc80e,_0x163416,_0x2686e1){return new BPromise(function(_0x1f3a33,_0x5db9d7){return client[_0xf326('0xf')](_0x1fc80e,_0x2686e1)['then'](function(_0x1cf441){logger['info'](_0xf326('0x10'),_0x163416,'request\x20sent');logger[_0xf326('0x11')](_0xf326('0x12'),_0x163416,'request\x20sent',JSON[_0xf326('0x13')](_0x1cf441));if(_0x1cf441[_0xf326('0x14')]){if(_0x1cf441[_0xf326('0x14')][_0xf326('0x15')]===0x1f4){logger['error'](_0xf326('0x10'),_0x163416,_0x1cf441['error']['message']);return _0x5db9d7(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}logger[_0xf326('0x14')](_0xf326('0x10'),_0x163416,_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);return _0x1f3a33(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}else{logger['info'](_0xf326('0x10'),_0x163416,_0xf326('0x17'));_0x1f3a33(_0x1cf441[_0xf326('0x18')][_0xf326('0x16')]);}})[_0xf326('0x19')](function(_0x311af0){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x163416,_0x311af0);_0x5db9d7(_0x311af0);});});} \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x26d678,_0x273258){var _0x4ad538=function(_0x7267eb){while(--_0x7267eb){_0x26d678['push'](_0x26d678['shift']());}};_0x4ad538(++_0x273258);}(_0xe14b,0x93));var _0xbe14=function(_0x3bfc23,_0x4886b0){_0x3bfc23=_0x3bfc23-0x0;var _0x22347b=_0xe14b[_0x3bfc23];return _0x22347b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3bb6c8f..c883ea7 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 _0x0fa7=['length','openchannelAccount:','./openchannelAccount.events','save','remove','update','removeListener','register'];(function(_0x3149fd,_0x1bfa85){var _0x5777b4=function(_0x519f4d){while(--_0x519f4d){_0x3149fd['push'](_0x3149fd['shift']());}};_0x5777b4(++_0x1bfa85);}(_0x0fa7,0x92));var _0x70fa=function(_0x12fa68,_0xf10f6c){_0x12fa68=_0x12fa68-0x0;var _0x51ee48=_0x0fa7[_0x12fa68];return _0x51ee48;};'use strict';var OpenchannelAccountEvents=require(_0x70fa('0x0'));var events=[_0x70fa('0x1'),_0x70fa('0x2'),_0x70fa('0x3')];function createListener(_0x4bf352,_0x4bb116){return function(_0x3b1924){_0x4bb116['emit'](_0x4bf352,_0x3b1924);};}function removeListener(_0xe7b33e,_0x5da257){return function(){OpenchannelAccountEvents[_0x70fa('0x4')](_0xe7b33e,_0x5da257);};}exports[_0x70fa('0x5')]=function(_0x993110){for(var _0x32284a=0x0,_0xe7ba45=events[_0x70fa('0x6')];_0x32284a<_0xe7ba45;_0x32284a++){var _0x24c7ed=events[_0x32284a];var _0x1b742b=createListener(_0x70fa('0x7')+_0x24c7ed,_0x993110);OpenchannelAccountEvents['on'](_0x24c7ed,_0x1b742b);}}; \ No newline at end of file +var _0xb3f5=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit'];(function(_0x4f6afc,_0x4dfa88){var _0x256eeb=function(_0x216559){while(--_0x216559){_0x4f6afc['push'](_0x4f6afc['shift']());}};_0x256eeb(++_0x4dfa88);}(_0xb3f5,0x1f4));var _0x5b3f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb3f5[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelAccountEvents=require(_0x5b3f('0x0'));var events=[_0x5b3f('0x1'),'remove',_0x5b3f('0x2')];function createListener(_0x5bb456,_0x8daab0){return function(_0x40ee77){_0x8daab0[_0x5b3f('0x3')](_0x5bb456,_0x40ee77);};}function removeListener(_0x314303,_0x26d48e){return function(){OpenchannelAccountEvents[_0x5b3f('0x4')](_0x314303,_0x26d48e);};}exports[_0x5b3f('0x5')]=function(_0x52656e){for(var _0x3e70cf=0x0,_0x4b11f7=events[_0x5b3f('0x6')];_0x3e70cf<_0x4b11f7;_0x3e70cf++){var _0x45c6d7=events[_0x3e70cf];var _0x45902f=createListener(_0x5b3f('0x7')+_0x45c6d7,_0x52656e);OpenchannelAccountEvents['on'](_0x45c6d7,_0x45902f);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8708f56..80dc805 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 _0x79cc=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x79cc,0x169));var _0xc79c=function(_0x19850e,_0x330d43){_0x19850e=_0x19850e-0x0;var _0x236982=_0x79cc[_0x19850e];return _0x236982;};'use strict';var multer=require(_0xc79c('0x0'));var util=require(_0xc79c('0x1'));var path=require(_0xc79c('0x2'));var timeout=require(_0xc79c('0x3'));var express=require(_0xc79c('0x4'));var router=express[_0xc79c('0x5')]();var auth=require(_0xc79c('0x6'));var interaction=require(_0xc79c('0x7'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xc79c('0x8')]('/',auth[_0xc79c('0x9')](),controller['index']);router[_0xc79c('0x8')](_0xc79c('0xa'),auth[_0xc79c('0x9')](),controller[_0xc79c('0xb')]);router[_0xc79c('0xc')]('/',auth['isAuthenticated'](),controller[_0xc79c('0xd')]);router[_0xc79c('0xe')](_0xc79c('0xa'),auth[_0xc79c('0x9')](),controller[_0xc79c('0xf')]);router[_0xc79c('0x10')](_0xc79c('0xa'),auth['isAuthenticated'](),controller[_0xc79c('0x11')]);module[_0xc79c('0x12')]=router; \ No newline at end of file +var _0xaf09=['exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','update','destroy'];(function(_0x5a7650,_0x454cd1){var _0x1b8bfc=function(_0x25c882){while(--_0x25c882){_0x5a7650['push'](_0x5a7650['shift']());}};_0x1b8bfc(++_0x454cd1);}(_0xaf09,0xf1));var _0x9af0=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0xaf09[_0x3a9635];return _0x10d08c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9af0('0x0'));var timeout=require(_0x9af0('0x1'));var express=require(_0x9af0('0x2'));var router=express['Router']();var auth=require(_0x9af0('0x3'));var interaction=require(_0x9af0('0x4'));var config=require(_0x9af0('0x5'));var controller=require(_0x9af0('0x6'));router[_0x9af0('0x7')]('/',auth[_0x9af0('0x8')](),controller[_0x9af0('0x9')]);router[_0x9af0('0x7')](_0x9af0('0xa'),auth[_0x9af0('0x8')](),controller[_0x9af0('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9af0('0xc')]);router['put'](_0x9af0('0xa'),auth[_0x9af0('0x8')](),controller[_0x9af0('0xd')]);router['delete']('/:id',auth[_0x9af0('0x8')](),controller[_0x9af0('0xe')]);module[_0x9af0('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index f3dab2c..172ef08 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 _0xc15b=['sequelize','noop','TEXT','STRING','*,*,*,*'];(function(_0x57441a,_0x5b3353){var _0x37a09a=function(_0x19d520){while(--_0x19d520){_0x57441a['push'](_0x57441a['shift']());}};_0x37a09a(++_0x5b3353);}(_0xc15b,0x159));var _0xbc15=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xc15b[_0x36c6eb];return _0x30675b;};'use strict';var Sequelize=require(_0xbc15('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc15('0x1')},'appdata':{'type':Sequelize[_0xbc15('0x2')]()},'description':{'type':Sequelize[_0xbc15('0x3')]},'interval':{'type':Sequelize[_0xbc15('0x3')],'defaultValue':_0xbc15('0x4')}}; \ No newline at end of file +var _0xc5e5=['INTEGER','noop','TEXT','STRING'];(function(_0x47af1b,_0x4cb20e){var _0x149364=function(_0x561b24){while(--_0x561b24){_0x47af1b['push'](_0x47af1b['shift']());}};_0x149364(++_0x4cb20e);}(_0xc5e5,0xdc));var _0x5c5e=function(_0x20e404,_0x1a48ce){_0x20e404=_0x20e404-0x0;var _0x155287=_0xc5e5[_0x20e404];return _0x155287;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x5c5e('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5c5e('0x1')},'appdata':{'type':Sequelize[_0x5c5e('0x2')]()},'description':{'type':Sequelize[_0x5c5e('0x3')]},'interval':{'type':Sequelize[_0x5c5e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e55f124..2fd809a 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 _0xc923=['rawAttributes','find','create','body','params','html-pdf','eml-format','rimraf','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show'];(function(_0x554039,_0x2b2c46){var _0x3e8845=function(_0x2850e9){while(--_0x2850e9){_0x554039['push'](_0x554039['shift']());}};_0x3e8845(++_0x2b2c46);}(_0xc923,0x1ef));var _0x3c92=function(_0xaeda4,_0x351b4a){_0xaeda4=_0xaeda4-0x0;var _0x2f8d77=_0xc923[_0xaeda4];return _0x2f8d77;};'use strict';var pdf=require(_0x3c92('0x0'));var emlformat=require(_0x3c92('0x1'));var rimraf=require(_0x3c92('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3c92('0x3'));var util=require(_0x3c92('0x4'));var path=require(_0x3c92('0x5'));var sox=require(_0x3c92('0x6'));var csv=require(_0x3c92('0x7'));var ejs=require(_0x3c92('0x8'));var fs=require('fs');var _=require(_0x3c92('0x9'));var squel=require(_0x3c92('0xa'));var crypto=require(_0x3c92('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3c92('0xc'));var toCsv=require(_0x3c92('0x7'));var querystring=require(_0x3c92('0xd'));var Papa=require(_0x3c92('0xe'));var Redis=require('ioredis');var authService=require(_0x3c92('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3c92('0x10'));var logger=require('../../config/logger')(_0x3c92('0x11'));var utils=require(_0x3c92('0x12'));var config=require(_0x3c92('0x13'));var db=require(_0x3c92('0x14'))['db'];function respondWithStatusCode(_0x1a0a41,_0x6ef24){_0x6ef24=_0x6ef24||0xcc;return function(_0x4eb55e){if(_0x4eb55e){return _0x1a0a41[_0x3c92('0x15')](_0x6ef24);}return _0x1a0a41[_0x3c92('0x16')](_0x6ef24)['end']();};}function respondWithResult(_0x3dd4a5,_0x822f68){_0x822f68=_0x822f68||0xc8;return function(_0x58c9cc){if(_0x58c9cc){return _0x3dd4a5['status'](_0x822f68)[_0x3c92('0x17')](_0x58c9cc);}};}function respondWithFilteredResult(_0x331721,_0x3ca28d){return function(_0x1a731a){if(_0x1a731a){var _0x1748c1=_0x1a731a[_0x3c92('0x18')],_0x436f9c=_0x3ca28d[_0x3c92('0x19')],_0x1761ed=_0x3ca28d['offset']+_0x3ca28d[_0x3c92('0x1a')],_0x5761ac;if(_0x1761ed>=_0x1748c1){_0x1761ed=_0x1748c1;_0x5761ac=0xc8;}else{_0x5761ac=0xce;}_0x331721[_0x3c92('0x16')](_0x5761ac);return _0x331721[_0x3c92('0x1b')](_0x3c92('0x1c'),_0x436f9c+'-'+_0x1761ed+'/'+_0x1748c1)['json'](_0x1a731a);}return null;};}function patchUpdates(_0xd123ef){return function(_0x6a6264){try{jsonpatch['apply'](_0x6a6264,_0xd123ef,!![]);}catch(_0x43a3cc){return BPromise[_0x3c92('0x1d')](_0x43a3cc);}return _0x6a6264[_0x3c92('0x1e')]();};}function saveUpdates(_0x33cff6,_0x320c39){return function(_0xe08910){if(_0xe08910){return _0xe08910[_0x3c92('0x1f')](_0x33cff6)[_0x3c92('0x20')](function(_0x5c506f){return _0x5c506f;});}return null;};}function removeEntity(_0x435522,_0x59be5d){return function(_0x343826){if(_0x343826){return _0x343826[_0x3c92('0x21')]()['then'](function(){_0x435522[_0x3c92('0x16')](0xcc)[_0x3c92('0x22')]();});}};}function handleEntityNotFound(_0x4ea4ac,_0x3510e3){return function(_0xb2920d){if(!_0xb2920d){_0x4ea4ac[_0x3c92('0x15')](0x194);}return _0xb2920d;};}function handleError(_0x4e5c6d,_0x2b0e02){_0x2b0e02=_0x2b0e02||0x1f4;return function(_0x3cb9da){logger[_0x3c92('0x23')](_0x3cb9da['stack']);if(_0x3cb9da[_0x3c92('0x24')]){delete _0x3cb9da[_0x3c92('0x24')];}_0x4e5c6d[_0x3c92('0x16')](_0x2b0e02)[_0x3c92('0x25')](_0x3cb9da);};}exports[_0x3c92('0x26')]=function(_0xe722bd,_0x104add){var _0x50b4c9={},_0x4e8f9c={},_0x1120f5={'count':0x0,'rows':[]};var _0x559d43=db['OpenchannelApplication']['rawAttributes'];_0x4e8f9c[_0x3c92('0x27')]=_[_0x3c92('0x28')](_0x559d43);_0x4e8f9c[_0x3c92('0x29')]=_['keys'](_0xe722bd[_0x3c92('0x29')]);_0x4e8f9c[_0x3c92('0x2a')]=_[_0x3c92('0x2b')](_0x4e8f9c[_0x3c92('0x27')],_0x4e8f9c[_0x3c92('0x29')]);_0x50b4c9[_0x3c92('0x2c')]=_['intersection'](_0x4e8f9c[_0x3c92('0x27')],qs[_0x3c92('0x2d')](_0xe722bd[_0x3c92('0x29')][_0x3c92('0x2d')]));_0x50b4c9[_0x3c92('0x2c')]=_0x50b4c9[_0x3c92('0x2c')][_0x3c92('0x2e')]?_0x50b4c9[_0x3c92('0x2c')]:_0x4e8f9c[_0x3c92('0x27')];if(!_0xe722bd['query'][_0x3c92('0x2f')]('nolimit')){_0x50b4c9['limit']=qs[_0x3c92('0x1a')](_0xe722bd[_0x3c92('0x29')][_0x3c92('0x1a')]);_0x50b4c9[_0x3c92('0x19')]=qs['offset'](_0xe722bd[_0x3c92('0x29')][_0x3c92('0x19')]);}_0x50b4c9[_0x3c92('0x30')]=qs[_0x3c92('0x31')](_0xe722bd[_0x3c92('0x29')][_0x3c92('0x31')]);_0x50b4c9[_0x3c92('0x32')]=qs[_0x3c92('0x2a')](_['pick'](_0xe722bd[_0x3c92('0x29')],_0x4e8f9c[_0x3c92('0x2a')]));if(_0xe722bd[_0x3c92('0x29')][_0x3c92('0x33')]){_0x50b4c9[_0x3c92('0x32')]=_[_0x3c92('0x34')](_0x50b4c9[_0x3c92('0x32')],{'$or':_['map'](_0x559d43,function(_0x382314){if(_0x382314[_0x3c92('0x35')][_0x3c92('0x36')]!==_0x3c92('0x37')){var _0x3f4a6f={};_0x3f4a6f[_0x382314[_0x3c92('0x38')]]={'$like':'%'+_0xe722bd[_0x3c92('0x29')]['filter']+'%'};return _0x3f4a6f;}})});}_0x50b4c9=_[_0x3c92('0x34')]({},_0x50b4c9,_0xe722bd[_0x3c92('0x39')]);var _0x4f144e={'where':_0x50b4c9[_0x3c92('0x32')]};return db[_0x3c92('0x3a')]['count'](_0x4f144e)[_0x3c92('0x20')](function(_0xd19961){_0x1120f5[_0x3c92('0x18')]=_0xd19961;if(_0xe722bd[_0x3c92('0x29')][_0x3c92('0x3b')]){_0x50b4c9[_0x3c92('0x3c')]=[{'all':!![]}];}return db[_0x3c92('0x3a')][_0x3c92('0x3d')](_0x50b4c9);})[_0x3c92('0x20')](function(_0x31528a){_0x1120f5[_0x3c92('0x3e')]=_0x31528a;return _0x1120f5;})['then'](respondWithFilteredResult(_0x104add,_0x50b4c9))[_0x3c92('0x3f')](handleError(_0x104add,null));};exports[_0x3c92('0x40')]=function(_0x21d87c,_0x41dcb8){var _0x544dfc={'raw':!![],'where':{'id':_0x21d87c['params']['id']}},_0x147634={};_0x147634['model']=_[_0x3c92('0x28')](db[_0x3c92('0x3a')][_0x3c92('0x41')]);_0x147634['query']=_[_0x3c92('0x28')](_0x21d87c[_0x3c92('0x29')]);_0x147634[_0x3c92('0x2a')]=_[_0x3c92('0x2b')](_0x147634['model'],_0x147634[_0x3c92('0x29')]);_0x544dfc[_0x3c92('0x2c')]=_['intersection'](_0x147634[_0x3c92('0x27')],qs[_0x3c92('0x2d')](_0x21d87c[_0x3c92('0x29')][_0x3c92('0x2d')]));_0x544dfc[_0x3c92('0x2c')]=_0x544dfc[_0x3c92('0x2c')][_0x3c92('0x2e')]?_0x544dfc['attributes']:_0x147634['model'];if(_0x21d87c[_0x3c92('0x29')][_0x3c92('0x3b')]){_0x544dfc['include']=[{'all':!![]}];}_0x544dfc=_['merge']({},_0x544dfc,_0x21d87c[_0x3c92('0x39')]);return db[_0x3c92('0x3a')][_0x3c92('0x42')](_0x544dfc)['then'](handleEntityNotFound(_0x41dcb8,null))[_0x3c92('0x20')](respondWithResult(_0x41dcb8,null))[_0x3c92('0x3f')](handleError(_0x41dcb8,null));};exports[_0x3c92('0x43')]=function(_0x32b68a,_0x49ca16){return db[_0x3c92('0x3a')][_0x3c92('0x43')](_0x32b68a[_0x3c92('0x44')],{})[_0x3c92('0x20')](respondWithResult(_0x49ca16,0xc9))['catch'](handleError(_0x49ca16,null));};exports[_0x3c92('0x1f')]=function(_0x43896f,_0x91c3b4){if(_0x43896f[_0x3c92('0x44')]['id']){delete _0x43896f[_0x3c92('0x44')]['id'];}return db[_0x3c92('0x3a')][_0x3c92('0x42')]({'where':{'id':_0x43896f['params']['id']}})[_0x3c92('0x20')](handleEntityNotFound(_0x91c3b4,null))['then'](saveUpdates(_0x43896f['body'],null))[_0x3c92('0x20')](respondWithResult(_0x91c3b4,null))[_0x3c92('0x3f')](handleError(_0x91c3b4,null));};exports[_0x3c92('0x21')]=function(_0xada438,_0x568980){return db[_0x3c92('0x3a')][_0x3c92('0x42')]({'where':{'id':_0xada438[_0x3c92('0x45')]['id']}})[_0x3c92('0x20')](handleEntityNotFound(_0x568980,null))[_0x3c92('0x20')](removeEntity(_0x568980,null))[_0x3c92('0x3f')](handleError(_0x568980,null));}; \ No newline at end of file +var _0x1403=['model','keys','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','params','length','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','OpenchannelApplication','rawAttributes'];(function(_0x4f2c70,_0x324cdb){var _0x53af01=function(_0x2aee62){while(--_0x2aee62){_0x4f2c70['push'](_0x4f2c70['shift']());}};_0x53af01(++_0x324cdb);}(_0x1403,0x153));var _0x3140=function(_0x1391a8,_0x5dae38){_0x1391a8=_0x1391a8-0x0;var _0x20aa05=_0x1403[_0x1391a8];return _0x20aa05;};'use strict';var pdf=require(_0x3140('0x0'));var emlformat=require(_0x3140('0x1'));var rimraf=require(_0x3140('0x2'));var zipdir=require(_0x3140('0x3'));var jsonpatch=require(_0x3140('0x4'));var rp=require(_0x3140('0x5'));var moment=require('moment');var BPromise=require(_0x3140('0x6'));var Mustache=require(_0x3140('0x7'));var util=require(_0x3140('0x8'));var path=require('path');var sox=require(_0x3140('0x9'));var csv=require(_0x3140('0xa'));var ejs=require(_0x3140('0xb'));var fs=require('fs');var _=require(_0x3140('0xc'));var squel=require(_0x3140('0xd'));var crypto=require('crypto');var jsforce=require(_0x3140('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3140('0xa'));var querystring=require(_0x3140('0xf'));var Papa=require(_0x3140('0x10'));var Redis=require(_0x3140('0x11'));var authService=require(_0x3140('0x12'));var qs=require(_0x3140('0x13'));var hardwareService=require(_0x3140('0x14'));var logger=require(_0x3140('0x15'))(_0x3140('0x16'));var utils=require(_0x3140('0x17'));var config=require(_0x3140('0x18'));var db=require(_0x3140('0x19'))['db'];function respondWithStatusCode(_0x4cad75,_0x20b73f){_0x20b73f=_0x20b73f||0xcc;return function(_0x27c7c4){if(_0x27c7c4){return _0x4cad75['sendStatus'](_0x20b73f);}return _0x4cad75[_0x3140('0x1a')](_0x20b73f)[_0x3140('0x1b')]();};}function respondWithResult(_0x319f2c,_0x5112ba){_0x5112ba=_0x5112ba||0xc8;return function(_0x2995c8){if(_0x2995c8){return _0x319f2c[_0x3140('0x1a')](_0x5112ba)['json'](_0x2995c8);}};}function respondWithFilteredResult(_0x5e86de,_0x49b3bf){return function(_0x253577){if(_0x253577){var _0x9162ff=_0x253577['count'],_0x74c9f1=_0x49b3bf[_0x3140('0x1c')],_0x49fdff=_0x49b3bf[_0x3140('0x1c')]+_0x49b3bf[_0x3140('0x1d')],_0x15ab70;if(_0x49fdff>=_0x9162ff){_0x49fdff=_0x9162ff;_0x15ab70=0xc8;}else{_0x15ab70=0xce;}_0x5e86de['status'](_0x15ab70);return _0x5e86de[_0x3140('0x1e')](_0x3140('0x1f'),_0x74c9f1+'-'+_0x49fdff+'/'+_0x9162ff)[_0x3140('0x20')](_0x253577);}return null;};}function patchUpdates(_0x1e72d8){return function(_0x369a5e){try{jsonpatch[_0x3140('0x21')](_0x369a5e,_0x1e72d8,!![]);}catch(_0x1640e2){return BPromise[_0x3140('0x22')](_0x1640e2);}return _0x369a5e[_0x3140('0x23')]();};}function saveUpdates(_0x1072b2,_0x39f25e){return function(_0x3d96cd){if(_0x3d96cd){return _0x3d96cd[_0x3140('0x24')](_0x1072b2)['then'](function(_0xc432f9){return _0xc432f9;});}return null;};}function removeEntity(_0x207f8b,_0xed0045){return function(_0x4b2ec9){if(_0x4b2ec9){return _0x4b2ec9['destroy']()[_0x3140('0x25')](function(){_0x207f8b[_0x3140('0x1a')](0xcc)[_0x3140('0x1b')]();});}};}function handleEntityNotFound(_0x5bc1cd,_0x36e313){return function(_0x8a6fe2){if(!_0x8a6fe2){_0x5bc1cd[_0x3140('0x26')](0x194);}return _0x8a6fe2;};}function handleError(_0x4bb1b0,_0x4a5e11){_0x4a5e11=_0x4a5e11||0x1f4;return function(_0x3825f9){logger[_0x3140('0x27')](_0x3825f9[_0x3140('0x28')]);if(_0x3825f9['name']){delete _0x3825f9[_0x3140('0x29')];}_0x4bb1b0[_0x3140('0x1a')](_0x4a5e11)[_0x3140('0x2a')](_0x3825f9);};}exports[_0x3140('0x2b')]=function(_0x904ce8,_0xc6f5a){var _0x534945={},_0x5199ad={},_0x1bb4d5={'count':0x0,'rows':[]};var _0x3c56ee=db[_0x3140('0x2c')][_0x3140('0x2d')];_0x5199ad[_0x3140('0x2e')]=_[_0x3140('0x2f')](_0x3c56ee);_0x5199ad['query']=_[_0x3140('0x2f')](_0x904ce8['query']);_0x5199ad['filters']=_[_0x3140('0x30')](_0x5199ad[_0x3140('0x2e')],_0x5199ad[_0x3140('0x31')]);_0x534945[_0x3140('0x32')]=_[_0x3140('0x30')](_0x5199ad[_0x3140('0x2e')],qs[_0x3140('0x33')](_0x904ce8[_0x3140('0x31')][_0x3140('0x33')]));_0x534945[_0x3140('0x32')]=_0x534945[_0x3140('0x32')]['length']?_0x534945[_0x3140('0x32')]:_0x5199ad[_0x3140('0x2e')];if(!_0x904ce8[_0x3140('0x31')][_0x3140('0x34')]('nolimit')){_0x534945[_0x3140('0x1d')]=qs[_0x3140('0x1d')](_0x904ce8['query'][_0x3140('0x1d')]);_0x534945[_0x3140('0x1c')]=qs[_0x3140('0x1c')](_0x904ce8[_0x3140('0x31')]['offset']);}_0x534945[_0x3140('0x35')]=qs[_0x3140('0x36')](_0x904ce8[_0x3140('0x31')][_0x3140('0x36')]);_0x534945[_0x3140('0x37')]=qs[_0x3140('0x38')](_[_0x3140('0x39')](_0x904ce8[_0x3140('0x31')],_0x5199ad[_0x3140('0x38')]));if(_0x904ce8[_0x3140('0x31')][_0x3140('0x3a')]){_0x534945[_0x3140('0x37')]=_[_0x3140('0x3b')](_0x534945[_0x3140('0x37')],{'$or':_[_0x3140('0x3c')](_0x3c56ee,function(_0x2934ce){if(_0x2934ce[_0x3140('0x3d')][_0x3140('0x3e')]!==_0x3140('0x3f')){var _0x34c4d0={};_0x34c4d0[_0x2934ce[_0x3140('0x40')]]={'$like':'%'+_0x904ce8[_0x3140('0x31')][_0x3140('0x3a')]+'%'};return _0x34c4d0;}})});}_0x534945=_[_0x3140('0x3b')]({},_0x534945,_0x904ce8[_0x3140('0x41')]);var _0x33712f={'where':_0x534945[_0x3140('0x37')]};return db[_0x3140('0x2c')][_0x3140('0x42')](_0x33712f)[_0x3140('0x25')](function(_0xa49598){_0x1bb4d5[_0x3140('0x42')]=_0xa49598;if(_0x904ce8[_0x3140('0x31')][_0x3140('0x43')]){_0x534945[_0x3140('0x44')]=[{'all':!![]}];}return db[_0x3140('0x2c')][_0x3140('0x45')](_0x534945);})['then'](function(_0x5a4149){_0x1bb4d5['rows']=_0x5a4149;return _0x1bb4d5;})[_0x3140('0x25')](respondWithFilteredResult(_0xc6f5a,_0x534945))[_0x3140('0x46')](handleError(_0xc6f5a,null));};exports['show']=function(_0x314157,_0x206051){var _0x596722={'raw':!![],'where':{'id':_0x314157[_0x3140('0x47')]['id']}},_0x30832d={};_0x30832d['model']=_[_0x3140('0x2f')](db[_0x3140('0x2c')][_0x3140('0x2d')]);_0x30832d[_0x3140('0x31')]=_[_0x3140('0x2f')](_0x314157[_0x3140('0x31')]);_0x30832d[_0x3140('0x38')]=_[_0x3140('0x30')](_0x30832d[_0x3140('0x2e')],_0x30832d[_0x3140('0x31')]);_0x596722[_0x3140('0x32')]=_['intersection'](_0x30832d[_0x3140('0x2e')],qs['fields'](_0x314157['query'][_0x3140('0x33')]));_0x596722['attributes']=_0x596722[_0x3140('0x32')][_0x3140('0x48')]?_0x596722['attributes']:_0x30832d[_0x3140('0x2e')];if(_0x314157[_0x3140('0x31')][_0x3140('0x43')]){_0x596722['include']=[{'all':!![]}];}_0x596722=_[_0x3140('0x3b')]({},_0x596722,_0x314157['options']);return db['OpenchannelApplication'][_0x3140('0x49')](_0x596722)[_0x3140('0x25')](handleEntityNotFound(_0x206051,null))['then'](respondWithResult(_0x206051,null))[_0x3140('0x46')](handleError(_0x206051,null));};exports[_0x3140('0x4a')]=function(_0x45c05f,_0x10c33c){return db['OpenchannelApplication']['create'](_0x45c05f[_0x3140('0x4b')],{})[_0x3140('0x25')](respondWithResult(_0x10c33c,0xc9))['catch'](handleError(_0x10c33c,null));};exports[_0x3140('0x24')]=function(_0x2fb36e,_0x19d1d7){if(_0x2fb36e[_0x3140('0x4b')]['id']){delete _0x2fb36e['body']['id'];}return db[_0x3140('0x2c')][_0x3140('0x49')]({'where':{'id':_0x2fb36e[_0x3140('0x47')]['id']}})[_0x3140('0x25')](handleEntityNotFound(_0x19d1d7,null))['then'](saveUpdates(_0x2fb36e[_0x3140('0x4b')],null))[_0x3140('0x25')](respondWithResult(_0x19d1d7,null))[_0x3140('0x46')](handleError(_0x19d1d7,null));};exports[_0x3140('0x4c')]=function(_0x36d305,_0x147a71){return db[_0x3140('0x2c')]['find']({'where':{'id':_0x36d305[_0x3140('0x47')]['id']}})[_0x3140('0x25')](handleEntityNotFound(_0x147a71,null))[_0x3140('0x25')](removeEntity(_0x147a71,null))[_0x3140('0x46')](handleError(_0x147a71,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 9f5f519..03bc974 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 _0x4410=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3872df,_0x1c56a3){var _0x43bf44=function(_0x1dca13){while(--_0x1dca13){_0x3872df['push'](_0x3872df['shift']());}};_0x43bf44(++_0x1c56a3);}(_0x4410,0x136));var _0x0441=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x4410[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x0441('0x0'));var util=require(_0x0441('0x1'));var logger=require(_0x0441('0x2'))(_0x0441('0x3'));var moment=require(_0x0441('0x4'));var BPromise=require(_0x0441('0x5'));var rp=require(_0x0441('0x6'));var fs=require('fs');var path=require(_0x0441('0x7'));var rimraf=require(_0x0441('0x8'));var config=require(_0x0441('0x9'));var attributes=require(_0x0441('0xa'));module[_0x0441('0xb')]=function(_0x3cab34,_0x240a1f){return _0x3cab34[_0x0441('0xc')]('OpenchannelApplication',attributes,{'tableName':_0x0441('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0441('0xe')});}; \ No newline at end of file +var _0xada2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xada2,0xfd));var _0x2ada=function(_0x305ea3,_0x1c6f1b){_0x305ea3=_0x305ea3-0x0;var _0x43ec31=_0xada2[_0x305ea3];return _0x43ec31;};'use strict';var _=require(_0x2ada('0x0'));var util=require(_0x2ada('0x1'));var logger=require(_0x2ada('0x2'))(_0x2ada('0x3'));var moment=require('moment');var BPromise=require(_0x2ada('0x4'));var rp=require(_0x2ada('0x5'));var fs=require('fs');var path=require(_0x2ada('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2ada('0x7'));module[_0x2ada('0x8')]=function(_0x3a53f3,_0x14ca49){return _0x3a53f3[_0x2ada('0x9')](_0x2ada('0xa'),attributes,{'tableName':_0x2ada('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2ada('0xc'),'collate':_0x2ada('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 27f122d..f05a6e0 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 _0x842e=['update','body','options','where','attributes','limit','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x32d92b,_0x36da65){var _0x2ead66=function(_0x6b2272){while(--_0x6b2272){_0x32d92b['push'](_0x32d92b['shift']());}};_0x2ead66(++_0x36da65);}(_0x842e,0x1c1));var _0xe842=function(_0x62b58e,_0x46fe1e){_0x62b58e=_0x62b58e-0x0;var _0x37fe84=_0x842e[_0x62b58e];return _0x37fe84;};'use strict';var _=require(_0xe842('0x0'));var util=require(_0xe842('0x1'));var moment=require('moment');var BPromise=require(_0xe842('0x2'));var rs=require(_0xe842('0x3'));var fs=require('fs');var Redis=require(_0xe842('0x4'));var db=require(_0xe842('0x5'))['db'];var utils=require(_0xe842('0x6'));var logger=require(_0xe842('0x7'))(_0xe842('0x8'));var config=require(_0xe842('0x9'));var jayson=require(_0xe842('0xa'));var client=jayson[_0xe842('0xb')][_0xe842('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48300f,_0x309502,_0x458aa4){return new BPromise(function(_0x3a6e21,_0x549d51){return client[_0xe842('0xd')](_0x48300f,_0x458aa4)['then'](function(_0x2d48e7){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x309502,'request\x20sent');logger[_0xe842('0xe')](_0xe842('0xf'),_0x309502,_0xe842('0x10'),JSON[_0xe842('0x11')](_0x2d48e7));if(_0x2d48e7[_0xe842('0x12')]){if(_0x2d48e7[_0xe842('0x12')][_0xe842('0x13')]===0x1f4){logger[_0xe842('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x309502,_0x2d48e7['error'][_0xe842('0x14')]);return _0x549d51(_0x2d48e7[_0xe842('0x12')][_0xe842('0x14')]);}logger[_0xe842('0x12')](_0xe842('0x15'),_0x309502,_0x2d48e7[_0xe842('0x12')][_0xe842('0x14')]);return _0x3a6e21(_0x2d48e7['error'][_0xe842('0x14')]);}else{logger[_0xe842('0x16')](_0xe842('0x15'),_0x309502,_0xe842('0x10'));_0x3a6e21(_0x2d48e7[_0xe842('0x17')][_0xe842('0x14')]);}})[_0xe842('0x18')](function(_0x2e16c6){logger[_0xe842('0x12')](_0xe842('0x15'),_0x309502,_0x2e16c6);_0x549d51(_0x2e16c6);});});}exports[_0xe842('0x19')]=function(_0x300833){var _0x368f1b=this;return new Promise(function(_0x3df4dc,_0x93b77){return db[_0xe842('0x1a')][_0xe842('0x1b')](_0x300833[_0xe842('0x1c')],{'raw':_0x300833[_0xe842('0x1d')]?_0x300833[_0xe842('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x300833[_0xe842('0x1d')]?_0x300833[_0xe842('0x1d')][_0xe842('0x1e')]||null:null,'attributes':_0x300833[_0xe842('0x1d')]?_0x300833[_0xe842('0x1d')][_0xe842('0x1f')]||null:null,'limit':_0x300833[_0xe842('0x1d')]?_0x300833[_0xe842('0x1d')][_0xe842('0x20')]||null:null})[_0xe842('0x21')](function(_0x5ceef0){logger[_0xe842('0x16')](_0xe842('0x19'),_0x300833);logger[_0xe842('0xe')]('UpdateOpenchannelApplication',_0x300833,JSON[_0xe842('0x11')](_0x5ceef0));_0x3df4dc(_0x5ceef0);})['catch'](function(_0x17a7cf){logger[_0xe842('0x12')](_0xe842('0x19'),_0x17a7cf[_0xe842('0x14')],_0x300833);_0x93b77(_0x368f1b[_0xe842('0x12')](0x1f4,_0x17a7cf[_0xe842('0x14')]));});});}; \ No newline at end of file +var _0xf31f=['client','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0xf31f,0x95));var _0xff31=function(_0x4a5316,_0xa64688){_0x4a5316=_0x4a5316-0x0;var _0x51826b=_0xf31f[_0x4a5316];return _0x51826b;};'use strict';var _=require(_0xff31('0x0'));var util=require(_0xff31('0x1'));var moment=require(_0xff31('0x2'));var BPromise=require(_0xff31('0x3'));var rs=require(_0xff31('0x4'));var fs=require('fs');var Redis=require(_0xff31('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xff31('0x6'));var logger=require(_0xff31('0x7'))(_0xff31('0x8'));var config=require(_0xff31('0x9'));var jayson=require(_0xff31('0xa'));var client=jayson[_0xff31('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15a73a,_0x378b54,_0x46f8e2){return new BPromise(function(_0x292121,_0x15649b){return client[_0xff31('0xc')](_0x15a73a,_0x46f8e2)[_0xff31('0xd')](function(_0x123e8a){logger[_0xff31('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x378b54,_0xff31('0xf'));logger[_0xff31('0x10')](_0xff31('0x11'),_0x378b54,'request\x20sent',JSON[_0xff31('0x12')](_0x123e8a));if(_0x123e8a['error']){if(_0x123e8a[_0xff31('0x13')][_0xff31('0x14')]===0x1f4){logger[_0xff31('0x13')](_0xff31('0x15'),_0x378b54,_0x123e8a[_0xff31('0x13')][_0xff31('0x16')]);return _0x15649b(_0x123e8a[_0xff31('0x13')][_0xff31('0x16')]);}logger[_0xff31('0x13')](_0xff31('0x15'),_0x378b54,_0x123e8a['error'][_0xff31('0x16')]);return _0x292121(_0x123e8a[_0xff31('0x13')][_0xff31('0x16')]);}else{logger[_0xff31('0xe')](_0xff31('0x15'),_0x378b54,_0xff31('0xf'));_0x292121(_0x123e8a['result'][_0xff31('0x16')]);}})[_0xff31('0x17')](function(_0x29696b){logger[_0xff31('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x378b54,_0x29696b);_0x15649b(_0x29696b);});});}exports[_0xff31('0x18')]=function(_0x10a49c){var _0x2323b7=this;return new Promise(function(_0x554e8a,_0x429f58){return db[_0xff31('0x19')]['update'](_0x10a49c[_0xff31('0x1a')],{'raw':_0x10a49c[_0xff31('0x1b')]?_0x10a49c['options'][_0xff31('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10a49c[_0xff31('0x1b')]?_0x10a49c['options'][_0xff31('0x1d')]||null:null,'attributes':_0x10a49c[_0xff31('0x1b')]?_0x10a49c[_0xff31('0x1b')][_0xff31('0x1e')]||null:null,'limit':_0x10a49c[_0xff31('0x1b')]?_0x10a49c[_0xff31('0x1b')][_0xff31('0x1f')]||null:null})['then'](function(_0x23f188){logger[_0xff31('0xe')](_0xff31('0x18'),_0x10a49c);logger[_0xff31('0x10')](_0xff31('0x18'),_0x10a49c,JSON[_0xff31('0x12')](_0x23f188));_0x554e8a(_0x23f188);})[_0xff31('0x17')](function(_0x180157){logger['error'](_0xff31('0x18'),_0x180157[_0xff31('0x16')],_0x10a49c);_0x429f58(_0x2323b7[_0xff31('0x13')](0x1f4,_0x180157[_0xff31('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 7c152ff..a8a8a47 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 _0x5ddc=['get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','openchannel','openchannelinteraction:addtags','put','tracked','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelInteraction.controller'];(function(_0x35f01b,_0x11e557){var _0x20f1f3=function(_0x2b255d){while(--_0x2b255d){_0x35f01b['push'](_0x35f01b['shift']());}};_0x20f1f3(++_0x11e557);}(_0x5ddc,0x14d));var _0xc5dd=function(_0x4546c8,_0x390910){_0x4546c8=_0x4546c8-0x0;var _0x3fb7aa=_0x5ddc[_0x4546c8];return _0x3fb7aa;};'use strict';var multer=require(_0xc5dd('0x0'));var util=require(_0xc5dd('0x1'));var path=require(_0xc5dd('0x2'));var timeout=require(_0xc5dd('0x3'));var express=require(_0xc5dd('0x4'));var router=express['Router']();var auth=require(_0xc5dd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc5dd('0x6'));var controller=require(_0xc5dd('0x7'));router[_0xc5dd('0x8')]('/',auth[_0xc5dd('0x9')](),controller[_0xc5dd('0xa')]);router[_0xc5dd('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc5dd('0xb')]);router[_0xc5dd('0x8')](_0xc5dd('0xc'),auth['isAuthenticated'](),controller[_0xc5dd('0xd')]);router['get']('/:id/messages',auth[_0xc5dd('0x9')](),controller[_0xc5dd('0xe')]);router['get'](_0xc5dd('0xf'),auth[_0xc5dd('0x9')](),controller[_0xc5dd('0x10')]);router[_0xc5dd('0x11')]('/',auth[_0xc5dd('0x9')](),controller[_0xc5dd('0x12')]);router[_0xc5dd('0x11')](_0xc5dd('0x13'),auth[_0xc5dd('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xc5dd('0x9')](),interaction['tracked'](_0xc5dd('0x14'),_0xc5dd('0x15')),controller['addTags']);router[_0xc5dd('0x16')](_0xc5dd('0xc'),auth[_0xc5dd('0x9')](),interaction[_0xc5dd('0x17')](_0xc5dd('0x14'),_0xc5dd('0x18')),controller['update']);router[_0xc5dd('0x19')](_0xc5dd('0xc'),auth[_0xc5dd('0x9')](),interaction[_0xc5dd('0x17')](_0xc5dd('0x14'),_0xc5dd('0x1a')),controller[_0xc5dd('0x1b')]);router[_0xc5dd('0x19')](_0xc5dd('0x1c'),auth[_0xc5dd('0x9')](),controller[_0xc5dd('0x1d')]);module[_0xc5dd('0x1e')]=router; \ No newline at end of file +var _0x03d7=['post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download'];(function(_0x3659e0,_0x364f9a){var _0x21d0ab=function(_0x2efd4f){while(--_0x2efd4f){_0x3659e0['push'](_0x3659e0['shift']());}};_0x21d0ab(++_0x364f9a);}(_0x03d7,0x97));var _0x703d=function(_0x5f2eff,_0x116519){_0x5f2eff=_0x5f2eff-0x0;var _0x120132=_0x03d7[_0x5f2eff];return _0x120132;};'use strict';var multer=require(_0x703d('0x0'));var util=require(_0x703d('0x1'));var path=require(_0x703d('0x2'));var timeout=require(_0x703d('0x3'));var express=require(_0x703d('0x4'));var router=express[_0x703d('0x5')]();var auth=require(_0x703d('0x6'));var interaction=require(_0x703d('0x7'));var config=require(_0x703d('0x8'));var controller=require(_0x703d('0x9'));router['get']('/',auth[_0x703d('0xa')](),controller[_0x703d('0xb')]);router[_0x703d('0xc')](_0x703d('0xd'),auth[_0x703d('0xa')](),controller[_0x703d('0xe')]);router[_0x703d('0xc')](_0x703d('0xf'),auth['isAuthenticated'](),controller[_0x703d('0x10')]);router['get']('/:id/messages',auth[_0x703d('0xa')](),controller['getMessages']);router[_0x703d('0xc')](_0x703d('0x11'),auth[_0x703d('0xa')](),controller[_0x703d('0x12')]);router[_0x703d('0x13')]('/',auth['isAuthenticated'](),controller[_0x703d('0x14')]);router['post'](_0x703d('0x15'),auth['isAuthenticated'](),controller[_0x703d('0x16')]);router['post'](_0x703d('0x17'),auth[_0x703d('0xa')](),interaction[_0x703d('0x18')](_0x703d('0x19'),_0x703d('0x1a')),controller['addTags']);router[_0x703d('0x1b')](_0x703d('0xf'),auth[_0x703d('0xa')](),interaction['tracked'](_0x703d('0x19'),_0x703d('0x1c')),controller[_0x703d('0x1d')]);router[_0x703d('0x1e')](_0x703d('0xf'),auth[_0x703d('0xa')](),interaction[_0x703d('0x18')]('openchannel',_0x703d('0x1f')),controller[_0x703d('0x20')]);router[_0x703d('0x1e')](_0x703d('0x17'),auth[_0x703d('0xa')](),controller[_0x703d('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 87fc250..63f58c6 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 _0x7d86=['ENUM','out','sequelize','BOOLEAN','DATE','STRING'];(function(_0x4efb36,_0x35a4ee){var _0x3b20f9=function(_0x146784){while(--_0x146784){_0x4efb36['push'](_0x4efb36['shift']());}};_0x3b20f9(++_0x35a4ee);}(_0x7d86,0x86));var _0x67d8=function(_0x352ee2,_0xb59add){_0x352ee2=_0x352ee2-0x0;var _0x277ed9=_0x7d86[_0x352ee2];return _0x277ed9;};'use strict';var Sequelize=require(_0x67d8('0x0'));module['exports']={'closed':{'type':Sequelize[_0x67d8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x67d8('0x2')]},'disposition':{'type':Sequelize[_0x67d8('0x3')]},'note':{'type':Sequelize[_0x67d8('0x3')]},'read1stAt':{'type':Sequelize[_0x67d8('0x2')]},'threadId':{'type':Sequelize[_0x67d8('0x3')]},'externalUrl':{'type':Sequelize[_0x67d8('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x67d8('0x4')]('in',_0x67d8('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x67d8('0x3')]}}; \ No newline at end of file +var _0xb790=['out','exports','STRING','DATE'];(function(_0x59195a,_0x5ebb63){var _0x2f9fb8=function(_0x280503){while(--_0x280503){_0x59195a['push'](_0x59195a['shift']());}};_0x2f9fb8(++_0x5ebb63);}(_0xb790,0xe5));var _0x0b79=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0xb790[_0x2272b5];return _0x110156;};'use strict';var Sequelize=require('sequelize');module[_0x0b79('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0b79('0x1')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x0b79('0x1')]},'lastMsgAt':{'type':Sequelize[_0x0b79('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0b79('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0b79('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a22a303..ab17d42 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 _0xe660=['openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','expr','advancedFilter','parse','createdAt','value','dateStart','startOf','day','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','\x20<\x20?','TagId','c.firstName','c.email','\x20>\x20?','filter','isNil','isEmpty','OpenchannelAccountId','concat','$gte','$lte','\x20IS\x20NULL','replace','isNumeric','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','i.id','Sequelize','QueryTypes','SELECT','clone','read','having','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','%s\x20=\x200','`Messages.count`\x20=\x200','sequelize','merge','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','find','create','body','catch','describe','ids','omit','getMessages','rawAttributes','pick','findAll','addTags','Tag','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','secret','User','fullname','Contact','firstName','lastName','Attachment','Account','Owner','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createWriteStream','out','System','direction','renderFile','views','downloadInteraction.html','transcript-','log','unlinkSync','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','limit','Content-Range','apply','update','then','destroy','error','name','send','unreadMessages','OpenchannelMessage','Users','map','TagIds','Tags','forEach','push','index','OpenchannelInteraction','model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','sort','where','select','field','from','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_openchannel_interactions','left_join','users'];(function(_0x57619a,_0xe16536){var _0xb177c8=function(_0x38bb63){while(--_0x38bb63){_0x57619a['push'](_0x57619a['shift']());}};_0xb177c8(++_0xe16536);}(_0xe660,0x179));var _0x0e66=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0xe660[_0x1d2bc8];return _0x1857e1;};'use strict';var pdf=require(_0x0e66('0x0'));var emlformat=require(_0x0e66('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e66('0x2'));var rp=require(_0x0e66('0x3'));var moment=require(_0x0e66('0x4'));var BPromise=require(_0x0e66('0x5'));var Mustache=require('mustache');var util=require(_0x0e66('0x6'));var path=require('path');var sox=require(_0x0e66('0x7'));var csv=require('to-csv');var ejs=require(_0x0e66('0x8'));var fs=require('fs');var _=require(_0x0e66('0x9'));var squel=require(_0x0e66('0xa'));var crypto=require(_0x0e66('0xb'));var jsforce=require(_0x0e66('0xc'));var deskjs=require(_0x0e66('0xd'));var toCsv=require(_0x0e66('0xe'));var querystring=require(_0x0e66('0xf'));var Papa=require(_0x0e66('0x10'));var Redis=require(_0x0e66('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0e66('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e66('0x13'))('api');var utils=require(_0x0e66('0x14'));var config=require(_0x0e66('0x15'));var db=require(_0x0e66('0x16'))['db'];config[_0x0e66('0x17')]=_[_0x0e66('0x18')](config[_0x0e66('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e66('0x19'))(new Redis(config[_0x0e66('0x17')]));require('./openchannelInteraction.socket')[_0x0e66('0x1a')](socket);function respondWithStatusCode(_0x371085,_0x35f68f){_0x35f68f=_0x35f68f||0xcc;return function(_0x50e515){if(_0x50e515){return _0x371085[_0x0e66('0x1b')](_0x35f68f);}return _0x371085[_0x0e66('0x1c')](_0x35f68f)[_0x0e66('0x1d')]();};}function respondWithResult(_0x4bba55,_0x1d6fe2){_0x1d6fe2=_0x1d6fe2||0xc8;return function(_0x34da6c){if(_0x34da6c){return _0x4bba55[_0x0e66('0x1c')](_0x1d6fe2)[_0x0e66('0x1e')](_0x34da6c);}};}function respondWithFilteredResult(_0x1e79bb,_0x4c1fcd){return function(_0x3d8bdb){if(_0x3d8bdb){var _0x3699e2=_0x3d8bdb[_0x0e66('0x1f')],_0xa66a21=_0x4c1fcd['offset'],_0x5ba129=_0x4c1fcd['offset']+_0x4c1fcd[_0x0e66('0x20')],_0x2a0788;if(_0x5ba129>=_0x3699e2){_0x5ba129=_0x3699e2;_0x2a0788=0xc8;}else{_0x2a0788=0xce;}_0x1e79bb['status'](_0x2a0788);return _0x1e79bb['set'](_0x0e66('0x21'),_0xa66a21+'-'+_0x5ba129+'/'+_0x3699e2)[_0x0e66('0x1e')](_0x3d8bdb);}return null;};}function patchUpdates(_0x5abc71){return function(_0x20d2d7){try{jsonpatch[_0x0e66('0x22')](_0x20d2d7,_0x5abc71,!![]);}catch(_0x512448){return BPromise['reject'](_0x512448);}return _0x20d2d7['save']();};}function saveUpdates(_0x5d1caa,_0x5cf8cc){return function(_0x133908){if(_0x133908){return _0x133908[_0x0e66('0x23')](_0x5d1caa)[_0x0e66('0x24')](function(_0x123ddf){return _0x123ddf;});}return null;};}function removeEntity(_0x3e1c22,_0x3ecb09){return function(_0x2d4217){if(_0x2d4217){return _0x2d4217[_0x0e66('0x25')]()[_0x0e66('0x24')](function(){_0x3e1c22[_0x0e66('0x1c')](0xcc)[_0x0e66('0x1d')]();});}};}function handleEntityNotFound(_0x7c3adb,_0x401bfb){return function(_0x7f5a7b){if(!_0x7f5a7b){_0x7c3adb[_0x0e66('0x1b')](0x194);}return _0x7f5a7b;};}function handleError(_0xb5404e,_0x5b29aa){_0x5b29aa=_0x5b29aa||0x1f4;return function(_0x23239a){logger[_0x0e66('0x26')](_0x23239a['stack']);if(_0x23239a[_0x0e66('0x27')]){delete _0x23239a[_0x0e66('0x27')];}_0xb5404e[_0x0e66('0x1c')](_0x5b29aa)[_0x0e66('0x28')](_0x23239a);};}function getInteractionUnreadMessages(_0x41081f){return new BPromise(function(_0x34a7cf,_0x32520f){try{if(_0x41081f['closed']){_0x41081f[_0x0e66('0x29')]=0x0;_0x34a7cf(_0x41081f);}else{return db[_0x0e66('0x2a')][_0x0e66('0x1f')]({'where':{'OpenchannelInteractionId':_0x41081f['id'],'direction':'in','read':![]}})[_0x0e66('0x24')](function(_0x10508a){_0x41081f['unreadMessages']=_0x10508a;_0x34a7cf(_0x41081f);});}}catch(_0x9f92bb){_0x32520f(_0x9f92bb);}});}function getInteractionUsers(_0x21f1c0,_0x79dce7){return new BPromise(function(_0x4ff4bf,_0x23c683){try{if(_0x79dce7[_0x21f1c0['id']]){_0x21f1c0[_0x0e66('0x2b')]=_[_0x0e66('0x2c')](_0x79dce7[_0x21f1c0['id']],function(_0xccc76){return{'id':_0xccc76['id']};});}}catch(_0x345752){_0x23c683(_0x345752);}_0x4ff4bf(_0x21f1c0);});}function getInteractionTags(_0x16443d,_0x1c35cd){return new BPromise(function(_0x4d2c36,_0x2c0874){try{if(_0x16443d[_0x0e66('0x2d')]){_0x16443d[_0x0e66('0x2e')]=[];_0x16443d[_0x0e66('0x2d')]['split'](',')[_0x0e66('0x2f')](function(_0x4279f8){_0x16443d[_0x0e66('0x2e')][_0x0e66('0x30')](_0x1c35cd[_0x4279f8]);});}delete _0x16443d['TagIds'];}catch(_0x2160a0){_0x2c0874(_0x2160a0);}_0x4d2c36(_0x16443d);});}function updateOpenchannelInteraction(_0x14bf39,_0x48b163,_0x5ce3f4){return new BPromise(function(_0x36d824,_0x2c4dba){return getInteractionUnreadMessages(_0x14bf39)[_0x0e66('0x24')](function(_0x12963e){return getInteractionUsers(_0x12963e,_0x5ce3f4);})[_0x0e66('0x24')](function(_0x423fca){return getInteractionTags(_0x423fca,_0x48b163);})[_0x0e66('0x24')](function(_0x33bea6){_0x36d824(_0x33bea6);})['catch'](function(_0x50c247){_0x2c4dba(_0x50c247);});});}exports[_0x0e66('0x31')]=function(_0x12ea81,_0x54e806){var _0x1b36a8={},_0x5d3868={},_0x19627d={'count':0x0,'rows':[]};var _0x23d391=db[_0x0e66('0x32')]['rawAttributes'];_0x5d3868[_0x0e66('0x33')]=_[_0x0e66('0x34')](_0x23d391);_0x5d3868[_0x0e66('0x35')]=_[_0x0e66('0x34')](_0x12ea81[_0x0e66('0x35')]);_0x5d3868[_0x0e66('0x36')]=_[_0x0e66('0x37')](_0x5d3868[_0x0e66('0x33')],_0x5d3868[_0x0e66('0x35')]);_0x1b36a8['attributes']=_[_0x0e66('0x37')](_0x5d3868['model'],qs[_0x0e66('0x38')](_0x12ea81['query'][_0x0e66('0x38')]));_0x1b36a8[_0x0e66('0x39')]=_0x1b36a8[_0x0e66('0x39')][_0x0e66('0x3a')]?_0x1b36a8['attributes']:_0x5d3868['model'];if(!_0x12ea81[_0x0e66('0x35')]['hasOwnProperty'](_0x0e66('0x3b'))){_0x1b36a8[_0x0e66('0x20')]=qs[_0x0e66('0x20')](_0x12ea81[_0x0e66('0x35')][_0x0e66('0x20')]);_0x1b36a8['offset']=qs[_0x0e66('0x3c')](_0x12ea81[_0x0e66('0x35')][_0x0e66('0x3c')]);}_0x1b36a8['order']=qs[_0x0e66('0x3d')](_0x12ea81['query']['sort']);_0x1b36a8[_0x0e66('0x3e')]=qs[_0x0e66('0x36')](_['pick'](_0x12ea81[_0x0e66('0x35')],_0x5d3868['filters']));var _0x413957=[];var _0x86e5dd=squel[_0x0e66('0x3f')]()[_0x0e66('0x40')]('id')[_0x0e66('0x40')]('name')[_0x0e66('0x40')]('color')[_0x0e66('0x41')]('tools_tags');var _0x3a26ac=squel[_0x0e66('0x3f')]()[_0x0e66('0x40')]('COUNT(*)')['from'](_0x0e66('0x42'),'me')[_0x0e66('0x3e')](_0x0e66('0x43'))[_0x0e66('0x3e')](_0x0e66('0x44'))[_0x0e66('0x3e')](_0x0e66('0x45'));var _0x1771c6=squel[_0x0e66('0x3f')]()[_0x0e66('0x40')]('u.id')[_0x0e66('0x40')]('ui.OpenchannelInteractionId')[_0x0e66('0x41')](_0x0e66('0x46'),'ui')[_0x0e66('0x47')](_0x0e66('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x2a9977=squel[_0x0e66('0x3f')]()['from'](_0x0e66('0x49'),'i')[_0x0e66('0x47')]('cm_contacts','c',_0x0e66('0x4a'))[_0x0e66('0x47')]('users','o',_0x0e66('0x4b'))[_0x0e66('0x47')](_0x0e66('0x4c'),'a',_0x0e66('0x4d'))[_0x0e66('0x47')](_0x0e66('0x42'),'me',_0x0e66('0x43'));var _0xf304fd=squel[_0x0e66('0x4e')]();if(_0x12ea81['query'][_0x0e66('0x4f')]){var _0x3cff07=JSON[_0x0e66('0x50')](_0x12ea81[_0x0e66('0x35')][_0x0e66('0x4f')]);_[_0x0e66('0x34')](_0x3cff07)[_0x0e66('0x2f')](function(_0x19c3fc){var _0xee790d=_0x3cff07[_0x19c3fc];if(_0x19c3fc===_0x0e66('0x51')){var _0x54fc59=moment(_0xee790d[_0x0e66('0x52')][_0x0e66('0x53')])[_0x0e66('0x54')](_0x0e66('0x55'))['utc']()[_0x0e66('0x56')]();var _0x3444f8=moment(_0x3444f8)['utc']()[_0x0e66('0x57')](_0x0e66('0x55'))[_0x0e66('0x56')]();_0xf304fd[_0x0e66('0x58')](_0x0e66('0x59'),_0x54fc59,_0x3444f8);}else{if(_[_0x0e66('0x5a')](_0xee790d[_0x0e66('0x5b')])){_0xee790d['condition'][_0x0e66('0x2f')](function(_0x2319fd){switch(_0xee790d['condition'][_0x0e66('0x52')]){case'IS':if(_0x19c3fc!=='TagId'&&_0x19c3fc!==_0x0e66('0x5c')){if(_['isArray'](_0xee790d['value'])&&_0xee790d[_0x0e66('0x52')][_0x0e66('0x3a')]>0x1){_0xf304fd[_0x0e66('0x58')](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+_0x0e66('0x5e'),_0xee790d[_0x0e66('0x52')]);}else{_0xf304fd['and'](_0xee790d['tableAlias']+'.'+_0x19c3fc+_0x0e66('0x5f'),_0xee790d[_0x0e66('0x52')][0x0]);}}break;case'=':_0xf304fd['and'](_0xee790d['tableAlias']+'.'+_0x19c3fc+_0x0e66('0x5f'),_0xee790d[_0x0e66('0x52')]);break;case _0x0e66('0x60'):if(_0x19c3fc===_0x0e66('0x61')){_0xf304fd['and']('c.firstName'+_0x0e66('0x62'),'%'+_0xee790d['value']+'%');_0xf304fd['or'](_0x0e66('0x63')+_0x0e66('0x62'),'%'+_0xee790d[_0x0e66('0x52')]+'%');_0xf304fd['or']('c.email'+'\x20LIKE\x20?','%'+_0xee790d['value']+'%');}else{_0xf304fd[_0x0e66('0x58')](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+_0x0e66('0x62'),'%'+_0xee790d[_0x0e66('0x52')]+'%');}break;case'>':_0xf304fd[_0x0e66('0x58')](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+'\x20>\x20?',_0xee790d[_0x0e66('0x52')]);break;case'<':_0xf304fd['and'](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+_0x0e66('0x64'),_0xee790d[_0x0e66('0x52')]);break;}});}else{switch(_0xee790d[_0x0e66('0x5b')]['value']){case'IS':if(_0x19c3fc!==_0x0e66('0x65')&&_0x19c3fc!==_0x0e66('0x5c')){if(_[_0x0e66('0x5a')](_0xee790d[_0x0e66('0x52')])&&_0xee790d[_0x0e66('0x52')][_0x0e66('0x3a')]>0x1){_0xf304fd[_0x0e66('0x58')](_0xee790d['tableAlias']+'.'+_0x19c3fc+_0x0e66('0x5e'),_0xee790d[_0x0e66('0x52')]);}else{_0xf304fd[_0x0e66('0x58')](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+_0x0e66('0x5f'),_0xee790d[_0x0e66('0x52')][0x0]);}}break;case'=':_0xf304fd[_0x0e66('0x58')](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+'\x20=\x20?',_0xee790d[_0x0e66('0x52')]);break;case _0x0e66('0x60'):if(_0x19c3fc===_0x0e66('0x61')){_0xf304fd[_0x0e66('0x58')](_0x0e66('0x66')+_0x0e66('0x62'),'%'+_0xee790d[_0x0e66('0x52')]+'%');_0xf304fd['or'](_0x0e66('0x63')+'\x20LIKE\x20?','%'+_0xee790d[_0x0e66('0x52')]+'%');_0xf304fd['or'](_0x0e66('0x67')+_0x0e66('0x62'),'%'+_0xee790d[_0x0e66('0x52')]+'%');}else{_0xf304fd[_0x0e66('0x58')](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+'\x20LIKE\x20?','%'+_0xee790d[_0x0e66('0x52')]+'%');}break;case'>':_0xf304fd['and'](_0xee790d[_0x0e66('0x5d')]+'.'+_0x19c3fc+_0x0e66('0x68'),_0xee790d['value']);break;case'<':_0xf304fd['and'](_0xee790d['tableAlias']+'.'+_0x19c3fc+_0x0e66('0x64'),_0xee790d[_0x0e66('0x52')]);break;}}}});}else{var _0x2c7789=_(Object['keys'](_0x12ea81[_0x0e66('0x35')]))[_0x0e66('0x2c')](function(_0x43ea4c){return _0x23d391['hasOwnProperty'](_0x43ea4c)?_0x43ea4c:undefined;})[_0x0e66('0x69')](function(_0x1e1105){return!_[_0x0e66('0x6a')](_0x1e1105);})[_0x0e66('0x52')]();if(!_[_0x0e66('0x6b')](_0x2c7789)){_0x2c7789[_0x0e66('0x2f')](function(_0x29dfbe){if(_0x29dfbe===_0x0e66('0x6c')){_0x2a9977[_0x0e66('0x3e')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x0e66('0x6d')](_0x12ea81[_0x0e66('0x35')][_0x29dfbe]));}else if(_0x29dfbe==='createdAt'){var _0x5f3e74=JSON[_0x0e66('0x50')](_0x12ea81[_0x0e66('0x35')][_0x29dfbe])[_0x0e66('0x6e')];var _0x492906=JSON[_0x0e66('0x50')](_0x12ea81[_0x0e66('0x35')][_0x29dfbe])[_0x0e66('0x6f')];_0x2a9977[_0x0e66('0x3e')](_0x0e66('0x59'),_0x5f3e74,_0x492906);}else{if(_0x12ea81[_0x0e66('0x35')][_0x29dfbe]==='null'){_0x2a9977[_0x0e66('0x3e')]('i.'+_0x29dfbe+_0x0e66('0x70'));}else{_0x2a9977[_0x0e66('0x3e')]('i.'+_0x29dfbe+_0x0e66('0x5f'),_0x12ea81[_0x0e66('0x35')][_0x29dfbe]);}}});}if(_0x12ea81[_0x0e66('0x35')][_0x0e66('0x69')]){var _0x3c4ddc=_0x12ea81[_0x0e66('0x35')][_0x0e66('0x69')][_0x0e66('0x71')]('\x5c','\x5c\x5c')[_0x0e66('0x71')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x0e66('0x72')](_0x3c4ddc)){_0xf304fd['or'](_0x0e66('0x73'),_0x3c4ddc+'%');}else{var _0x542ae6=[];_0x3c4ddc[_0x0e66('0x74')]('\x20')[_0x0e66('0x2f')](function(_0x324a59){_0x542ae6['push']('+'+_0x324a59[_0x0e66('0x75')]());});var _0x2bd17f=_0x542ae6[_0x0e66('0x76')]('\x20');_0xf304fd['or'](_0x0e66('0x77'),_0x2bd17f)['or']('i.from\x20LIKE\x20?',_0x3c4ddc+'%')['or'](_0x0e66('0x78'),_0x3c4ddc+'%');}}}_0x2a9977[_0x0e66('0x3e')](_0xf304fd);if(_0x1b36a8[_0x0e66('0x79')]){_0x1b36a8[_0x0e66('0x79')][_0x0e66('0x2f')](function(_0x160abe){_0x2a9977[_0x0e66('0x79')]('i.'+_0x160abe[0x0],_0x160abe[0x1]===_0x0e66('0x7a')?![]:!![]);});}_0x2a9977['group'](_0x0e66('0x7b'));var _0x4a8152={'type':db[_0x0e66('0x7c')][_0x0e66('0x7d')][_0x0e66('0x7e')],'raw':!![]};var _0x38b7c1=_0x2a9977[_0x0e66('0x7f')]()[_0x0e66('0x40')]('COUNT(*)');if(!_0x12ea81['query']['advancedFilter']){if(_0x12ea81['query']['read']){if(_0x12ea81[_0x0e66('0x35')][_0x0e66('0x80')]==0x1){_0x38b7c1[_0x0e66('0x3e')](util[_0x0e66('0x56')]('%s\x20=\x200',_0x3a26ac[_0x0e66('0x75')]()));_0x2a9977[_0x0e66('0x81')]('`Messages.count`\x20=\x200');}else{_0x38b7c1['where'](util['format'](_0x0e66('0x82'),_0x3a26ac[_0x0e66('0x75')]()));_0x2a9977[_0x0e66('0x81')](_0x0e66('0x83'));}}if(_0x12ea81[_0x0e66('0x35')][_0x0e66('0x84')]){var _0x196bfb=_['isArray'](_0x12ea81[_0x0e66('0x35')][_0x0e66('0x84')])?_0x12ea81[_0x0e66('0x35')][_0x0e66('0x84')]:new Array(_0x12ea81[_0x0e66('0x35')]['tag']);var _0x5f3caf=squel['expr']();_0x196bfb['forEach'](function(_0x31b2cb){_0x5f3caf['or'](_0x0e66('0x85'),'%,'+_0x31b2cb+',%');});_0x2a9977[_0x0e66('0x81')](_0x5f3caf);_0x38b7c1[_0x0e66('0x47')](_0x0e66('0x86'),'it',_0x0e66('0x87'));_0x38b7c1[_0x0e66('0x47')](_0x0e66('0x88'),'t',_0x0e66('0x89'));_0x38b7c1['where'](_0x0e66('0x8a'),_0x196bfb);}}else{var _0x3cff07=JSON['parse'](_0x12ea81['query']['advancedFilter']);_['keys'](_0x3cff07)['forEach'](function(_0x223dee){var _0x4e2677=_0x3cff07[_0x223dee];if(_0x223dee===_0x0e66('0x65')){var _0x2d3e44=_0x4e2677[_0x0e66('0x52')];var _0x30586a=squel[_0x0e66('0x4e')]();_0x2d3e44[_0x0e66('0x2f')](function(_0x26c727){_0x30586a['or'](_0x0e66('0x85'),'%,'+_0x26c727+',%');});_0x2a9977['having'](_0x30586a);_0x38b7c1['left_join']('mail_interaction_has_tags','it',_0x0e66('0x8b'));_0x38b7c1['left_join'](_0x0e66('0x88'),'t','t.id\x20=\x20it.TagId');_0x38b7c1[_0x0e66('0x3e')](_0x0e66('0x8a'),_0x2d3e44);}else if(_0x223dee==='Messages.count'){if(_0x4e2677[_0x0e66('0x52')][_0x0e66('0x3a')]===0x1){if(_0x4e2677[_0x0e66('0x52')][0x0]===0x1){_0x38b7c1[_0x0e66('0x3e')](util[_0x0e66('0x56')](_0x0e66('0x8c'),_0x3a26ac[_0x0e66('0x75')]()));_0x2a9977[_0x0e66('0x81')](_0x0e66('0x8d'));}else{_0x38b7c1[_0x0e66('0x3e')](util[_0x0e66('0x56')](_0x0e66('0x82'),_0x3a26ac[_0x0e66('0x75')]()));_0x2a9977[_0x0e66('0x81')]('`Messages.count`\x20>\x200');}}}});}db[_0x0e66('0x8e')][_0x0e66('0x35')](_0x38b7c1[_0x0e66('0x75')](),_0x4a8152)[_0x0e66('0x24')](function(_0x141283){_0x19627d[_0x0e66('0x1f')]=_0x141283[_0x0e66('0x3a')];if(_0x19627d['count']===0x0)return[];return db[_0x0e66('0x8e')]['query'](_0x86e5dd['toString'](),_0x4a8152)[_0x0e66('0x24')](function(_0x13db62){_0x413957=_['keyBy'](_0x13db62,'id');_0x4a8152=_[_0x0e66('0x8f')](_0x4a8152,{'model':db[_0x0e66('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2a9977['field']('a.key',_0x0e66('0x90'));_0x2a9977['field'](_0x0e66('0x91'));_0x2a9977[_0x0e66('0x40')](_0x0e66('0x66'),_0x0e66('0x92'));_0x2a9977[_0x0e66('0x40')](_0x0e66('0x63'),_0x0e66('0x93'));_0x2a9977[_0x0e66('0x40')](_0x0e66('0x67'),_0x0e66('0x94'));_0x2a9977[_0x0e66('0x40')](_0x0e66('0x95'),'Contact.phone');_0x2a9977[_0x0e66('0x40')](_0x0e66('0x96'),_0x0e66('0x97'));_0x2a9977[_0x0e66('0x40')](_0x0e66('0x98'),_0x0e66('0x99'));_0x2a9977[_0x0e66('0x40')](_0x0e66('0x9a'),'TagIds');_0x2a9977[_0x0e66('0x47')](_0x0e66('0x86'),'it',_0x0e66('0x87'));_0x2a9977[_0x0e66('0x47')](_0x0e66('0x88'),'t',_0x0e66('0x89'));_0x2a9977[_0x0e66('0x20')](_0x1b36a8[_0x0e66('0x20')]);_0x2a9977[_0x0e66('0x3c')](_0x1b36a8[_0x0e66('0x3c')]);return db[_0x0e66('0x8e')][_0x0e66('0x35')](_0x2a9977[_0x0e66('0x75')](),_0x4a8152);})['then'](function(_0x37362b){_0x1771c6[_0x0e66('0x3e')](_0x0e66('0x9b'),_[_0x0e66('0x2c')](_0x37362b,'id'));return db[_0x0e66('0x8e')][_0x0e66('0x35')](_0x1771c6['toString'](),_0x4a8152)['then'](function(_0x212297){var _0x3ef135=_[_0x0e66('0x9c')](_0x212297,_0x0e66('0x9d'));var _0x4a144d=[];_0x37362b[_0x0e66('0x2f')](function(_0x402b77){_0x4a144d[_0x0e66('0x30')](updateOpenchannelInteraction(_0x402b77,_0x413957,_0x3ef135));});return BPromise[_0x0e66('0x9e')](_0x4a144d);});});})[_0x0e66('0x24')](function(_0x3ffba0){_0x19627d[_0x0e66('0x9f')]=_0x3ffba0;return _0x19627d;})[_0x0e66('0x24')](respondWithFilteredResult(_0x54e806,_0x1b36a8))['catch'](handleError(_0x54e806,null));};exports[_0x0e66('0xa0')]=function(_0xbffbba,_0x4aa9cf){var _0x1cb2d6={'raw':![],'where':{'id':_0xbffbba[_0x0e66('0xa1')]['id']}},_0xbc3a0e={};_0xbc3a0e[_0x0e66('0x33')]=_[_0x0e66('0x34')](db[_0x0e66('0x32')]['rawAttributes']);_0xbc3a0e[_0x0e66('0x35')]=_['keys'](_0xbffbba[_0x0e66('0x35')]);_0xbc3a0e[_0x0e66('0x36')]=_[_0x0e66('0x37')](_0xbc3a0e[_0x0e66('0x33')],_0xbc3a0e['query']);_0x1cb2d6['attributes']=_['intersection'](_0xbc3a0e[_0x0e66('0x33')],qs[_0x0e66('0x38')](_0xbffbba[_0x0e66('0x35')][_0x0e66('0x38')]));_0x1cb2d6[_0x0e66('0x39')]=_0x1cb2d6[_0x0e66('0x39')]['length']?_0x1cb2d6[_0x0e66('0x39')]:_0xbc3a0e[_0x0e66('0x33')];if(_0xbffbba[_0x0e66('0x35')][_0x0e66('0xa2')]){_0x1cb2d6[_0x0e66('0xa3')]=[{'all':!![]}];}_0x1cb2d6=_[_0x0e66('0x8f')]({},_0x1cb2d6,_0xbffbba[_0x0e66('0xa4')]);return db[_0x0e66('0x32')][_0x0e66('0xa5')](_0x1cb2d6)[_0x0e66('0x24')](handleEntityNotFound(_0x4aa9cf,null))[_0x0e66('0x24')](respondWithResult(_0x4aa9cf,null))['catch'](handleError(_0x4aa9cf,null));};exports[_0x0e66('0xa6')]=function(_0x5422e2,_0x405056){return db[_0x0e66('0x32')]['create'](_0x5422e2[_0x0e66('0xa7')],{})[_0x0e66('0x24')](respondWithResult(_0x405056,0xc9))[_0x0e66('0xa8')](handleError(_0x405056,null));};exports[_0x0e66('0x23')]=function(_0x306e43,_0x154286){if(_0x306e43[_0x0e66('0xa7')]['id']){delete _0x306e43[_0x0e66('0xa7')]['id'];}return db[_0x0e66('0x32')][_0x0e66('0xa5')]({'where':{'id':_0x306e43[_0x0e66('0xa1')]['id']}})[_0x0e66('0x24')](handleEntityNotFound(_0x154286,null))['then'](saveUpdates(_0x306e43[_0x0e66('0xa7')],null))['then'](respondWithResult(_0x154286,null))[_0x0e66('0xa8')](handleError(_0x154286,null));};exports[_0x0e66('0x25')]=function(_0x390de8,_0x330bc3){return db['OpenchannelInteraction'][_0x0e66('0xa5')]({'where':{'id':_0x390de8[_0x0e66('0xa1')]['id']}})['then'](handleEntityNotFound(_0x330bc3,null))[_0x0e66('0x24')](removeEntity(_0x330bc3,null))[_0x0e66('0xa8')](handleError(_0x330bc3,null));};exports['describe']=function(_0x3d9cdd,_0xcc8355){return db['OpenchannelInteraction'][_0x0e66('0xa9')]()[_0x0e66('0x24')](respondWithResult(_0xcc8355,null))[_0x0e66('0xa8')](handleError(_0xcc8355,null));};exports['addMessage']=function(_0x51cc9b,_0x2a4b57,_0x2833c2){return db[_0x0e66('0x2a')][_0x0e66('0xa5')]({'where':{'id':_0x51cc9b['params']['id']}})[_0x0e66('0x24')](handleEntityNotFound(_0x2a4b57,null))[_0x0e66('0x24')](function(_0x37f58e){if(_0x37f58e){return _0x37f58e['addMessage'](_0x51cc9b[_0x0e66('0xa7')][_0x0e66('0xaa')],_[_0x0e66('0xab')](_0x51cc9b[_0x0e66('0xa7')],['ids','id'])||{});}})[_0x0e66('0x24')](respondWithResult(_0x2a4b57,null))['catch'](handleError(_0x2a4b57,null));};exports[_0x0e66('0xac')]=function(_0x4a4a6f,_0x4575cc,_0x29bb78){var _0x3b0fc6={'raw':![],'where':{}};var _0x187f15={};var _0x5d2fb8={'count':0x0,'rows':[]};return db[_0x0e66('0x32')]['findOne']({'where':{'id':_0x4a4a6f['params']['id']}})[_0x0e66('0x24')](handleEntityNotFound(_0x4575cc,null))[_0x0e66('0x24')](function(_0x53b59e){if(_0x53b59e){_0x187f15[_0x0e66('0x33')]=_['keys'](db['OpenchannelMessage'][_0x0e66('0xad')]);_0x187f15[_0x0e66('0x35')]=_[_0x0e66('0x34')](_0x4a4a6f[_0x0e66('0x35')]);_0x187f15[_0x0e66('0x36')]=_[_0x0e66('0x37')](_0x187f15[_0x0e66('0x33')],_0x187f15[_0x0e66('0x35')]);_0x3b0fc6[_0x0e66('0x39')]=_['intersection'](_0x187f15[_0x0e66('0x33')],qs['fields'](_0x4a4a6f[_0x0e66('0x35')][_0x0e66('0x38')]));_0x3b0fc6['attributes']=_0x3b0fc6[_0x0e66('0x39')]['length']?_0x3b0fc6['attributes']:_0x187f15[_0x0e66('0x33')];if(!_0x4a4a6f[_0x0e66('0x35')]['hasOwnProperty'](_0x0e66('0x3b'))){_0x3b0fc6[_0x0e66('0x20')]=qs[_0x0e66('0x20')](_0x4a4a6f[_0x0e66('0x35')][_0x0e66('0x20')]);_0x3b0fc6[_0x0e66('0x3c')]=qs['offset'](_0x4a4a6f['query']['offset']);}_0x3b0fc6[_0x0e66('0x79')]=qs['sort'](_0x4a4a6f[_0x0e66('0x35')][_0x0e66('0x3d')]);_0x3b0fc6['where']=qs[_0x0e66('0x36')](_[_0x0e66('0xae')](_0x4a4a6f[_0x0e66('0x35')],_0x187f15[_0x0e66('0x36')]));_0x3b0fc6[_0x0e66('0x3e')][_0x0e66('0x9d')]=_0x53b59e['id'];if(_0x4a4a6f['query'][_0x0e66('0x69')]){_0x3b0fc6[_0x0e66('0x3e')]=_[_0x0e66('0x8f')](_0x3b0fc6['where'],{'$or':_['map'](_0x3b0fc6[_0x0e66('0x39')],function(_0x52739a){var _0x18430c={};_0x18430c[_0x52739a]={'$like':'%'+_0x4a4a6f[_0x0e66('0x35')][_0x0e66('0x69')]+'%'};return _0x18430c;})});}if(_0x4a4a6f['query'][_0x0e66('0x6e')]){var _0x2577e7=_0x4a4a6f['query'][_0x0e66('0x6e')]['split'](',');var _0xefd7ec={};_0xefd7ec[_0x2577e7[0x0]]={'$gte':moment(_0x2577e7[0x1])[_0x0e66('0x56')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3b0fc6['where']=_[_0x0e66('0x8f')](_0x3b0fc6[_0x0e66('0x3e')],_0xefd7ec);}_0x3b0fc6=_[_0x0e66('0x8f')]({},_0x3b0fc6,_0x4a4a6f['options']);return db[_0x0e66('0x2a')]['count']({'where':_0x3b0fc6[_0x0e66('0x3e')]})[_0x0e66('0x24')](function(_0x1c4228){_0x5d2fb8[_0x0e66('0x1f')]=_0x1c4228;if(_0x4a4a6f[_0x0e66('0x35')]['includeAll']){_0x3b0fc6[_0x0e66('0xa3')]=[{'all':!![]}];}return db[_0x0e66('0x2a')][_0x0e66('0xaf')](_0x3b0fc6);})[_0x0e66('0x24')](function(_0x5979b8){_0x5d2fb8[_0x0e66('0x9f')]=_0x5979b8;return _0x5d2fb8;});}})[_0x0e66('0x24')](respondWithFilteredResult(_0x4575cc,_0x3b0fc6))[_0x0e66('0xa8')](handleError(_0x4575cc,null));};exports[_0x0e66('0xb0')]=function(_0x3c6bcc,_0x50c0e5,_0x28519d){return db[_0x0e66('0x32')][_0x0e66('0xa5')]({'where':{'id':_0x3c6bcc[_0x0e66('0xa1')]['id']}})['then'](handleEntityNotFound(_0x50c0e5,null))[_0x0e66('0x24')](function(_0x306520){if(_0x306520){return _0x306520['setTags'](_0x3c6bcc[_0x0e66('0xa7')][_0x0e66('0xaa')],_[_0x0e66('0xab')](_0x3c6bcc['body'],[_0x0e66('0xaa'),'id'])||{})['spread'](function(){return db[_0x0e66('0xb1')][_0x0e66('0xaf')]({'attributes':['id',_0x0e66('0x27'),'color'],'where':{'id':_0x3c6bcc['body'][_0x0e66('0xaa')]}});})['then'](function(_0x4d551f){socket['emit'](_0x0e66('0xb2'),{'id':Number(_0x3c6bcc['params']['id']),'tags':_0x4d551f||[]});return{'id':Number(_0x3c6bcc[_0x0e66('0xa1')]['id']),'tags':_0x4d551f||[]};});}})[_0x0e66('0x24')](respondWithResult(_0x50c0e5,null))['catch'](handleError(_0x50c0e5,null));};exports[_0x0e66('0xb3')]=function(_0x9f48f1,_0x394e99,_0x30b05a){return db[_0x0e66('0x32')][_0x0e66('0xa5')]({'where':{'id':_0x9f48f1[_0x0e66('0xa1')]['id']}})[_0x0e66('0x24')](handleEntityNotFound(_0x394e99,null))['then'](function(_0x4be509){if(_0x4be509){return _0x4be509[_0x0e66('0xb3')](_0x9f48f1[_0x0e66('0x35')]['ids']);}})[_0x0e66('0x24')](respondWithStatusCode(_0x394e99,null))[_0x0e66('0xa8')](handleError(_0x394e99,null));};exports[_0x0e66('0xb4')]=function(_0x18060e,_0xc2b47e){var _0x2db99e=moment()[_0x0e66('0xb5')]()[_0x0e66('0x75')]();var _0x318c77=path[_0x0e66('0x76')](config[_0x0e66('0xb6')],_0x0e66('0xb7'),_0x0e66('0xb8'),_0x0e66('0xb9'));var _0x14cddf=path[_0x0e66('0x76')](config[_0x0e66('0xb6')],_0x0e66('0xb7'),_0x0e66('0xb8'),_0x0e66('0xba'));var _0x42eebc=path['join'](_0x318c77,_0x2db99e);var _0x2b3682=util[_0x0e66('0x56')](_0x0e66('0xbb'),_0x18060e[_0x0e66('0xa1')]['id'],_0x2db99e);var _0x22a65b=path[_0x0e66('0x76')](_0x318c77,_0x2b3682);var _0x442312=![];return db['OpenchannelInteraction'][_0x0e66('0xa5')]({'where':{'id':_0x18060e[_0x0e66('0xa1')]['id']},'include':[{'model':db[_0x0e66('0x2a')],'as':_0x0e66('0xbc'),'attributes':['id',_0x0e66('0xa7'),'createdAt','direction',_0x0e66('0xbd')],'include':[{'model':db[_0x0e66('0xbe')],'as':'User','attributes':['id',_0x0e66('0xbf')],'raw':!![]},{'model':db['CmContact'],'as':_0x0e66('0xc0'),'attributes':['id',_0x0e66('0xc1'),_0x0e66('0xc2')],'raw':!![]},{'model':db[_0x0e66('0xc3')],'as':_0x0e66('0xc3'),'raw':!![]}]},{'model':db['OpenchannelAccount'],'as':_0x0e66('0xc4'),'attributes':['id',_0x0e66('0x27')]},{'model':db[_0x0e66('0xbe')],'as':_0x0e66('0xc5'),'attributes':['id','fullname']}]})[_0x0e66('0x24')](handleEntityNotFound(_0xc2b47e,null))[_0x0e66('0x24')](function(_0x4891cc){if(_0x4891cc){var _0x204784=_0x4891cc[_0x0e66('0xc6')]({'plain':!![]});_0x442312=!![];var _0x1b8145={'format':'A4','border':_0x0e66('0xc7'),'header':{'height':_0x0e66('0xc8'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x0e66('0xc9'),'contents':{'default':util[_0x0e66('0x56')](_0x0e66('0xca'),util[_0x0e66('0x56')]('%s\x20#%d',_0x0e66('0xcb'),_0x204784['id']),moment()[_0x0e66('0x56')](_0x0e66('0xcc'))['toString']())}}};fs['mkdirSync'](_0x42eebc);var _0x4c610a={'channel':_0x0e66('0xcb'),'account':_0x204784[_0x0e66('0xc4')]['name'],'agent':_0x204784[_0x0e66('0xc5')]?_0x204784['Owner']['fullname']:_0x0e66('0xcd'),'createdAt':moment(_0x204784[_0x0e66('0x51')])[_0x0e66('0x56')](_0x0e66('0xce'))[_0x0e66('0x75')](),'closedAt':_0x204784[_0x0e66('0xcf')]?moment(_0x204784[_0x0e66('0xd0')])['format'](_0x0e66('0xce'))['toString']():'','disposition':_0x204784[_0x0e66('0xd1')],'visibility':_0x204784[_0x0e66('0xd2')]?_0x0e66('0xd3'):_0x0e66('0xd4'),'messages':_(_0x204784[_0x0e66('0xbc')])['filter']({'secret':![]})[_0x0e66('0x2c')](function(_0x58c0cd){if(_0x58c0cd[_0x0e66('0xc3')]){var _0x597165=path[_0x0e66('0x76')](_0x14cddf,_0x58c0cd[_0x0e66('0xc3')][_0x0e66('0xd5')]);if(fs[_0x0e66('0xd6')](_0x597165)){fs['createReadStream'](_0x597165)['pipe'](fs[_0x0e66('0xd7')](path[_0x0e66('0x76')](_0x42eebc,_0x58c0cd[_0x0e66('0xc3')][_0x0e66('0xd5')])));}}return{'date':moment(_0x58c0cd['createdAt'])[_0x0e66('0x56')](_0x0e66('0xce'))[_0x0e66('0x75')](),'sender':_0x58c0cd['direction']===_0x0e66('0xd8')?_0x58c0cd[_0x0e66('0xbe')]?_0x58c0cd[_0x0e66('0xbe')][_0x0e66('0xbf')]:_0x0e66('0xd9'):_0x58c0cd[_0x0e66('0xc0')]['firstName']+(_0x58c0cd['Contact'][_0x0e66('0xc2')]?'\x20'+_0x58c0cd[_0x0e66('0xc0')][_0x0e66('0xc2')]:''),'body':_0x58c0cd[_0x0e66('0xc3')]?_0x58c0cd['Attachment'][_0x0e66('0xd5')]:_0x58c0cd[_0x0e66('0xa7')],'direction':_0x58c0cd[_0x0e66('0xda')]==='out'?'A':'C','secret':_0x58c0cd[_0x0e66('0xbd')],'attachment':_0x58c0cd['Attachment']};})[_0x0e66('0x52')]()};return ejs[_0x0e66('0xdb')](path[_0x0e66('0x76')](config[_0x0e66('0xb6')],'server',_0x0e66('0xdc'),_0x0e66('0xdd')),{'interaction':_0x4c610a})[_0x0e66('0x24')](function(_0x2a6a60){return new BPromise(function(_0x3e2dba,_0x3ce93b){pdf['create'](_0x2a6a60,_0x1b8145)['toFile'](path[_0x0e66('0x76')](_0x42eebc,_0x0e66('0xde')+_0x204784['id']+'-'+_0x2db99e+'.pdf'),function(_0x32011d,_0x196447){if(_0x32011d)return _0x3ce93b(_0x32011d);_0x3e2dba(_0x196447);});});});}})[_0x0e66('0x24')](function(){if(_0x442312){return new BPromise(function(_0x100562,_0xe75033){zipdir(_0x42eebc,{'saveTo':_0x22a65b},function(_0x4731ab,_0x1c613f){if(_0x4731ab)return _0xe75033(_0x4731ab);return _0x100562(_0x1c613f);});})['then'](function(){return new BPromise(function(_0x10374a,_0x293f2f){rimraf(_0x42eebc,function(_0x2795b6){if(_0x2795b6)_0x293f2f(_0x2795b6);return _0x10374a();});});})[_0x0e66('0x24')](function(){return _0xc2b47e[_0x0e66('0xb4')](_0x22a65b,_0x2b3682,function(_0x410c5f){if(_0x410c5f){console[_0x0e66('0xdf')]('err',_0x410c5f);}else{fs[_0x0e66('0xe0')](_0x22a65b);}});});}else{return _0xc2b47e[_0x0e66('0x1b')](0xc8);}})[_0x0e66('0xa8')](handleError(_0xc2b47e,null));}; \ No newline at end of file +var _0xfca3=['Users','map','TagIds','Tags','forEach','push','catch','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','from','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','advancedFilter','createdAt','value','dateStart','startOf','day','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','isArray','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','Messages.count','\x20IN\x20?','c.lastName','isNil','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','$gte','parse','null','\x20IS\x20NULL','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','SELECT','clone','read','format','%s\x20=\x200','having','`Messages.count`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','`Messages.count`\x20=\x200','%s\x20>\x200','sequelize','keyBy','OpenchannelInteraction','a.key','i.*','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','params','rawAttributes','includeAll','include','merge','options','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','files','tmp','server','attachments','transcript-%d-%s.zip','Messages','User','fullname','CmContact','Contact','lastName','Attachment','OpenchannelAccount','Account','Owner','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','closedAt','disposition','Public','Private','existsSync','pipe','createWriteStream','basename','direction','out','firstName','secret','renderFile','views','toFile','transcript-','.pdf','log','err','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','then','stack','name','send','closed','unreadMessages'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfca3,0x19c));var _0x3fca=function(_0x247844,_0x3ed02d){_0x247844=_0x247844-0x0;var _0x3e4156=_0xfca3[_0x247844];return _0x3e4156;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3fca('0x0'));var rimraf=require(_0x3fca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3fca('0x2'));var moment=require(_0x3fca('0x3'));var BPromise=require(_0x3fca('0x4'));var Mustache=require(_0x3fca('0x5'));var util=require('util');var path=require(_0x3fca('0x6'));var sox=require('sox');var csv=require(_0x3fca('0x7'));var ejs=require(_0x3fca('0x8'));var fs=require('fs');var _=require(_0x3fca('0x9'));var squel=require(_0x3fca('0xa'));var crypto=require(_0x3fca('0xb'));var jsforce=require(_0x3fca('0xc'));var deskjs=require(_0x3fca('0xd'));var toCsv=require(_0x3fca('0x7'));var querystring=require(_0x3fca('0xe'));var Papa=require(_0x3fca('0xf'));var Redis=require('ioredis');var authService=require(_0x3fca('0x10'));var qs=require(_0x3fca('0x11'));var hardwareService=require(_0x3fca('0x12'));var logger=require('../../config/logger')(_0x3fca('0x13'));var utils=require(_0x3fca('0x14'));var config=require(_0x3fca('0x15'));var db=require(_0x3fca('0x16'))['db'];config[_0x3fca('0x17')]=_['defaults'](config[_0x3fca('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fca('0x18'))(new Redis(config[_0x3fca('0x17')]));require(_0x3fca('0x19'))[_0x3fca('0x1a')](socket);function respondWithStatusCode(_0x1b0497,_0x5a7e14){_0x5a7e14=_0x5a7e14||0xcc;return function(_0x2d70f1){if(_0x2d70f1){return _0x1b0497['sendStatus'](_0x5a7e14);}return _0x1b0497[_0x3fca('0x1b')](_0x5a7e14)[_0x3fca('0x1c')]();};}function respondWithResult(_0x591cf6,_0x43fa5c){_0x43fa5c=_0x43fa5c||0xc8;return function(_0xe862ab){if(_0xe862ab){return _0x591cf6[_0x3fca('0x1b')](_0x43fa5c)[_0x3fca('0x1d')](_0xe862ab);}};}function respondWithFilteredResult(_0x3d6f51,_0x4750a5){return function(_0x27745b){if(_0x27745b){var _0x26e693=_0x27745b[_0x3fca('0x1e')],_0x2d9310=_0x4750a5[_0x3fca('0x1f')],_0x11108c=_0x4750a5[_0x3fca('0x1f')]+_0x4750a5['limit'],_0x20e138;if(_0x11108c>=_0x26e693){_0x11108c=_0x26e693;_0x20e138=0xc8;}else{_0x20e138=0xce;}_0x3d6f51['status'](_0x20e138);return _0x3d6f51[_0x3fca('0x20')](_0x3fca('0x21'),_0x2d9310+'-'+_0x11108c+'/'+_0x26e693)[_0x3fca('0x1d')](_0x27745b);}return null;};}function patchUpdates(_0x1c36f6){return function(_0x1d60a4){try{jsonpatch['apply'](_0x1d60a4,_0x1c36f6,!![]);}catch(_0x1acc75){return BPromise[_0x3fca('0x22')](_0x1acc75);}return _0x1d60a4[_0x3fca('0x23')]();};}function saveUpdates(_0x458466,_0x57452f){return function(_0x3b853b){if(_0x3b853b){return _0x3b853b[_0x3fca('0x24')](_0x458466)['then'](function(_0x2b5e1b){return _0x2b5e1b;});}return null;};}function removeEntity(_0xc87c2d,_0x55d81c){return function(_0x2f8133){if(_0x2f8133){return _0x2f8133[_0x3fca('0x25')]()[_0x3fca('0x26')](function(){_0xc87c2d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x62aa34,_0x558a2b){return function(_0x20874c){if(!_0x20874c){_0x62aa34['sendStatus'](0x194);}return _0x20874c;};}function handleError(_0x5c9ccf,_0x7a4772){_0x7a4772=_0x7a4772||0x1f4;return function(_0x291e5f){logger['error'](_0x291e5f[_0x3fca('0x27')]);if(_0x291e5f['name']){delete _0x291e5f[_0x3fca('0x28')];}_0x5c9ccf[_0x3fca('0x1b')](_0x7a4772)[_0x3fca('0x29')](_0x291e5f);};}function getInteractionUnreadMessages(_0x1071ae){return new BPromise(function(_0x4ba45b,_0xad8e16){try{if(_0x1071ae[_0x3fca('0x2a')]){_0x1071ae['unreadMessages']=0x0;_0x4ba45b(_0x1071ae);}else{return db['OpenchannelMessage'][_0x3fca('0x1e')]({'where':{'OpenchannelInteractionId':_0x1071ae['id'],'direction':'in','read':![]}})[_0x3fca('0x26')](function(_0x20fce4){_0x1071ae[_0x3fca('0x2b')]=_0x20fce4;_0x4ba45b(_0x1071ae);});}}catch(_0x29b8dd){_0xad8e16(_0x29b8dd);}});}function getInteractionUsers(_0x16eba6,_0x4a6e44){return new BPromise(function(_0xd89955,_0x4f9d4a){try{if(_0x4a6e44[_0x16eba6['id']]){_0x16eba6[_0x3fca('0x2c')]=_[_0x3fca('0x2d')](_0x4a6e44[_0x16eba6['id']],function(_0x191779){return{'id':_0x191779['id']};});}}catch(_0x4e5d66){_0x4f9d4a(_0x4e5d66);}_0xd89955(_0x16eba6);});}function getInteractionTags(_0xe1301b,_0x79ae5e){return new BPromise(function(_0x1142a8,_0x3efe3d){try{if(_0xe1301b[_0x3fca('0x2e')]){_0xe1301b[_0x3fca('0x2f')]=[];_0xe1301b[_0x3fca('0x2e')]['split'](',')[_0x3fca('0x30')](function(_0x553ec9){_0xe1301b[_0x3fca('0x2f')][_0x3fca('0x31')](_0x79ae5e[_0x553ec9]);});}delete _0xe1301b['TagIds'];}catch(_0x1f5d07){_0x3efe3d(_0x1f5d07);}_0x1142a8(_0xe1301b);});}function updateOpenchannelInteraction(_0x33bb85,_0x5af754,_0x368497){return new BPromise(function(_0x424a04,_0x4f04f6){return getInteractionUnreadMessages(_0x33bb85)['then'](function(_0x4ed621){return getInteractionUsers(_0x4ed621,_0x368497);})['then'](function(_0x261edc){return getInteractionTags(_0x261edc,_0x5af754);})[_0x3fca('0x26')](function(_0x1bf9a7){_0x424a04(_0x1bf9a7);})[_0x3fca('0x32')](function(_0xa0aaa2){_0x4f04f6(_0xa0aaa2);});});}exports[_0x3fca('0x33')]=function(_0x2704ce,_0x538182){var _0x76249c={},_0x492a80={},_0x20a06f={'count':0x0,'rows':[]};var _0x43c044=db['OpenchannelInteraction']['rawAttributes'];_0x492a80[_0x3fca('0x34')]=_[_0x3fca('0x35')](_0x43c044);_0x492a80[_0x3fca('0x36')]=_['keys'](_0x2704ce[_0x3fca('0x36')]);_0x492a80[_0x3fca('0x37')]=_[_0x3fca('0x38')](_0x492a80['model'],_0x492a80['query']);_0x76249c[_0x3fca('0x39')]=_[_0x3fca('0x38')](_0x492a80[_0x3fca('0x34')],qs['fields'](_0x2704ce['query'][_0x3fca('0x3a')]));_0x76249c['attributes']=_0x76249c[_0x3fca('0x39')][_0x3fca('0x3b')]?_0x76249c[_0x3fca('0x39')]:_0x492a80[_0x3fca('0x34')];if(!_0x2704ce[_0x3fca('0x36')][_0x3fca('0x3c')](_0x3fca('0x3d'))){_0x76249c['limit']=qs[_0x3fca('0x3e')](_0x2704ce['query'][_0x3fca('0x3e')]);_0x76249c[_0x3fca('0x1f')]=qs[_0x3fca('0x1f')](_0x2704ce[_0x3fca('0x36')][_0x3fca('0x1f')]);}_0x76249c[_0x3fca('0x3f')]=qs[_0x3fca('0x40')](_0x2704ce['query']['sort']);_0x76249c[_0x3fca('0x41')]=qs[_0x3fca('0x37')](_[_0x3fca('0x42')](_0x2704ce['query'],_0x492a80[_0x3fca('0x37')]));var _0x3e5de9=[];var _0xcfba30=squel[_0x3fca('0x43')]()['field']('id')[_0x3fca('0x44')]('name')['field']('color')[_0x3fca('0x45')]('tools_tags');var _0x2b131d=squel[_0x3fca('0x43')]()[_0x3fca('0x44')](_0x3fca('0x46'))['from'](_0x3fca('0x47'),'me')[_0x3fca('0x41')](_0x3fca('0x48'))[_0x3fca('0x41')]('me.direction\x20=\x20\x27in\x27')[_0x3fca('0x41')](_0x3fca('0x49'));var _0x2cf2e2=squel[_0x3fca('0x43')]()[_0x3fca('0x44')](_0x3fca('0x4a'))[_0x3fca('0x44')](_0x3fca('0x4b'))['from'](_0x3fca('0x4c'),'ui')['left_join'](_0x3fca('0x4d'),'u',_0x3fca('0x4e'));var _0x242d37=squel[_0x3fca('0x43')]()[_0x3fca('0x45')]('openchannel_interactions','i')[_0x3fca('0x4f')]('cm_contacts','c',_0x3fca('0x50'))['left_join'](_0x3fca('0x4d'),'o',_0x3fca('0x51'))[_0x3fca('0x4f')](_0x3fca('0x52'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x3fca('0x4f')](_0x3fca('0x47'),'me',_0x3fca('0x48'));var _0xdeacda=squel['expr']();if(_0x2704ce['query'][_0x3fca('0x53')]){var _0x55fa36=JSON['parse'](_0x2704ce[_0x3fca('0x36')][_0x3fca('0x53')]);_[_0x3fca('0x35')](_0x55fa36)[_0x3fca('0x30')](function(_0x3f8f15){var _0x1fa966=_0x55fa36[_0x3f8f15];if(_0x3f8f15===_0x3fca('0x54')){var _0x41e979=moment(_0x1fa966[_0x3fca('0x55')][_0x3fca('0x56')])[_0x3fca('0x57')](_0x3fca('0x58'))['utc']()['format']();var _0x38091a=moment(_0x38091a)['utc']()[_0x3fca('0x59')](_0x3fca('0x58'))['format']();_0xdeacda[_0x3fca('0x5a')](_0x3fca('0x5b'),_0x41e979,_0x38091a);}else{if(_['isArray'](_0x1fa966[_0x3fca('0x5c')])){_0x1fa966[_0x3fca('0x5c')][_0x3fca('0x30')](function(_0x3b7d47){switch(_0x1fa966[_0x3fca('0x5c')]['value']){case'IS':if(_0x3f8f15!==_0x3fca('0x5d')&&_0x3f8f15!=='Messages.count'){if(_[_0x3fca('0x5e')](_0x1fa966[_0x3fca('0x55')])&&_0x1fa966[_0x3fca('0x55')][_0x3fca('0x3b')]>0x1){_0xdeacda[_0x3fca('0x5a')](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+'\x20IN\x20?',_0x1fa966[_0x3fca('0x55')]);}else{_0xdeacda['and'](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x60'),_0x1fa966[_0x3fca('0x55')][0x0]);}}break;case'=':_0xdeacda[_0x3fca('0x5a')](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+'\x20=\x20?',_0x1fa966[_0x3fca('0x55')]);break;case _0x3fca('0x61'):if(_0x3f8f15===_0x3fca('0x62')){_0xdeacda[_0x3fca('0x5a')](_0x3fca('0x63')+'\x20LIKE\x20?','%'+_0x1fa966['value']+'%');_0xdeacda['or']('c.lastName'+_0x3fca('0x64'),'%'+_0x1fa966[_0x3fca('0x55')]+'%');_0xdeacda['or'](_0x3fca('0x65')+'\x20LIKE\x20?','%'+_0x1fa966[_0x3fca('0x55')]+'%');}else{_0xdeacda[_0x3fca('0x5a')](_0x1fa966['tableAlias']+'.'+_0x3f8f15+'\x20LIKE\x20?','%'+_0x1fa966[_0x3fca('0x55')]+'%');}break;case'>':_0xdeacda[_0x3fca('0x5a')](_0x1fa966['tableAlias']+'.'+_0x3f8f15+_0x3fca('0x66'),_0x1fa966[_0x3fca('0x55')]);break;case'<':_0xdeacda[_0x3fca('0x5a')](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x67'),_0x1fa966[_0x3fca('0x55')]);break;}});}else{switch(_0x1fa966[_0x3fca('0x5c')][_0x3fca('0x55')]){case'IS':if(_0x3f8f15!==_0x3fca('0x5d')&&_0x3f8f15!==_0x3fca('0x68')){if(_[_0x3fca('0x5e')](_0x1fa966[_0x3fca('0x55')])&&_0x1fa966[_0x3fca('0x55')][_0x3fca('0x3b')]>0x1){_0xdeacda['and'](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x69'),_0x1fa966[_0x3fca('0x55')]);}else{_0xdeacda['and'](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x60'),_0x1fa966['value'][0x0]);}}break;case'=':_0xdeacda[_0x3fca('0x5a')](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x60'),_0x1fa966['value']);break;case _0x3fca('0x61'):if(_0x3f8f15===_0x3fca('0x62')){_0xdeacda[_0x3fca('0x5a')](_0x3fca('0x63')+'\x20LIKE\x20?','%'+_0x1fa966[_0x3fca('0x55')]+'%');_0xdeacda['or'](_0x3fca('0x6a')+_0x3fca('0x64'),'%'+_0x1fa966[_0x3fca('0x55')]+'%');_0xdeacda['or'](_0x3fca('0x65')+_0x3fca('0x64'),'%'+_0x1fa966[_0x3fca('0x55')]+'%');}else{_0xdeacda[_0x3fca('0x5a')](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x64'),'%'+_0x1fa966[_0x3fca('0x55')]+'%');}break;case'>':_0xdeacda['and'](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x66'),_0x1fa966['value']);break;case'<':_0xdeacda[_0x3fca('0x5a')](_0x1fa966[_0x3fca('0x5f')]+'.'+_0x3f8f15+_0x3fca('0x67'),_0x1fa966['value']);break;}}}});}else{var _0x2a7073=_(Object[_0x3fca('0x35')](_0x2704ce['query']))[_0x3fca('0x2d')](function(_0x39c63a){return _0x43c044[_0x3fca('0x3c')](_0x39c63a)?_0x39c63a:undefined;})['filter'](function(_0x3c12e9){return!_[_0x3fca('0x6b')](_0x3c12e9);})[_0x3fca('0x55')]();if(!_[_0x3fca('0x6c')](_0x2a7073)){_0x2a7073[_0x3fca('0x30')](function(_0x3ef7f1){if(_0x3ef7f1===_0x3fca('0x6d')){_0x242d37[_0x3fca('0x41')](_0x3fca('0x6e'),[]['concat'](_0x2704ce['query'][_0x3ef7f1]));}else if(_0x3ef7f1===_0x3fca('0x54')){var _0x4564cb=JSON['parse'](_0x2704ce[_0x3fca('0x36')][_0x3ef7f1])[_0x3fca('0x6f')];var _0x553801=JSON[_0x3fca('0x70')](_0x2704ce[_0x3fca('0x36')][_0x3ef7f1])['$lte'];_0x242d37[_0x3fca('0x41')](_0x3fca('0x5b'),_0x4564cb,_0x553801);}else{if(_0x2704ce[_0x3fca('0x36')][_0x3ef7f1]===_0x3fca('0x71')){_0x242d37[_0x3fca('0x41')]('i.'+_0x3ef7f1+_0x3fca('0x72'));}else{_0x242d37[_0x3fca('0x41')]('i.'+_0x3ef7f1+_0x3fca('0x60'),_0x2704ce[_0x3fca('0x36')][_0x3ef7f1]);}}});}if(_0x2704ce[_0x3fca('0x36')]['filter']){var _0x5bf3c5=_0x2704ce[_0x3fca('0x36')][_0x3fca('0x73')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x3fca('0x74'));if(qs[_0x3fca('0x75')](_0x5bf3c5)){_0xdeacda['or'](_0x3fca('0x76'),_0x5bf3c5+'%');}else{var _0x428c95=[];_0x5bf3c5[_0x3fca('0x77')]('\x20')[_0x3fca('0x30')](function(_0x503587){_0x428c95['push']('+'+_0x503587[_0x3fca('0x78')]());});var _0xf7b23d=_0x428c95[_0x3fca('0x79')]('\x20');_0xdeacda['or'](_0x3fca('0x7a'),_0xf7b23d)['or'](_0x3fca('0x7b'),_0x5bf3c5+'%')['or'](_0x3fca('0x7c'),_0x5bf3c5+'%');}}}_0x242d37[_0x3fca('0x41')](_0xdeacda);if(_0x76249c[_0x3fca('0x3f')]){_0x76249c[_0x3fca('0x3f')][_0x3fca('0x30')](function(_0x4f2bea){_0x242d37[_0x3fca('0x3f')]('i.'+_0x4f2bea[0x0],_0x4f2bea[0x1]===_0x3fca('0x7d')?![]:!![]);});}_0x242d37[_0x3fca('0x7e')](_0x3fca('0x7f'));var _0x47150e={'type':db[_0x3fca('0x80')]['QueryTypes'][_0x3fca('0x81')],'raw':!![]};var _0x186d65=_0x242d37[_0x3fca('0x82')]()[_0x3fca('0x44')](_0x3fca('0x46'));if(!_0x2704ce[_0x3fca('0x36')][_0x3fca('0x53')]){if(_0x2704ce['query'][_0x3fca('0x83')]){if(_0x2704ce[_0x3fca('0x36')][_0x3fca('0x83')]==0x1){_0x186d65[_0x3fca('0x41')](util[_0x3fca('0x84')](_0x3fca('0x85'),_0x2b131d['toString']()));_0x242d37[_0x3fca('0x86')]('`Messages.count`\x20=\x200');}else{_0x186d65['where'](util[_0x3fca('0x84')]('%s\x20>\x200',_0x2b131d['toString']()));_0x242d37['having'](_0x3fca('0x87'));}}if(_0x2704ce[_0x3fca('0x36')][_0x3fca('0x88')]){var _0x34f189=_[_0x3fca('0x5e')](_0x2704ce[_0x3fca('0x36')][_0x3fca('0x88')])?_0x2704ce[_0x3fca('0x36')][_0x3fca('0x88')]:new Array(_0x2704ce[_0x3fca('0x36')][_0x3fca('0x88')]);var _0x10bc55=squel[_0x3fca('0x89')]();_0x34f189[_0x3fca('0x30')](function(_0x112ef6){_0x10bc55['or'](_0x3fca('0x8a'),'%,'+_0x112ef6+',%');});_0x242d37[_0x3fca('0x86')](_0x10bc55);_0x186d65[_0x3fca('0x4f')](_0x3fca('0x8b'),'it',_0x3fca('0x8c'));_0x186d65[_0x3fca('0x4f')](_0x3fca('0x8d'),'t',_0x3fca('0x8e'));_0x186d65[_0x3fca('0x41')](_0x3fca('0x8f'),_0x34f189);}}else{var _0x55fa36=JSON['parse'](_0x2704ce['query']['advancedFilter']);_['keys'](_0x55fa36)[_0x3fca('0x30')](function(_0x1e26b3){var _0x49b348=_0x55fa36[_0x1e26b3];if(_0x1e26b3===_0x3fca('0x5d')){var _0x72b279=_0x49b348[_0x3fca('0x55')];var _0x2a3085=squel[_0x3fca('0x89')]();_0x72b279[_0x3fca('0x30')](function(_0x3d306e){_0x2a3085['or'](_0x3fca('0x8a'),'%,'+_0x3d306e+',%');});_0x242d37[_0x3fca('0x86')](_0x2a3085);_0x186d65['left_join'](_0x3fca('0x90'),'it','it.MailInteractionId\x20=\x20i.id');_0x186d65[_0x3fca('0x4f')](_0x3fca('0x8d'),'t',_0x3fca('0x8e'));_0x186d65['where']('t.id\x20IN\x20?',_0x72b279);}else if(_0x1e26b3===_0x3fca('0x68')){if(_0x49b348[_0x3fca('0x55')][_0x3fca('0x3b')]===0x1){if(_0x49b348[_0x3fca('0x55')][0x0]===0x1){_0x186d65[_0x3fca('0x41')](util[_0x3fca('0x84')](_0x3fca('0x85'),_0x2b131d[_0x3fca('0x78')]()));_0x242d37['having'](_0x3fca('0x91'));}else{_0x186d65[_0x3fca('0x41')](util[_0x3fca('0x84')](_0x3fca('0x92'),_0x2b131d[_0x3fca('0x78')]()));_0x242d37['having'](_0x3fca('0x87'));}}}});}db[_0x3fca('0x93')]['query'](_0x186d65['toString'](),_0x47150e)[_0x3fca('0x26')](function(_0xf62a99){_0x20a06f['count']=_0xf62a99[_0x3fca('0x3b')];if(_0x20a06f[_0x3fca('0x1e')]===0x0)return[];return db[_0x3fca('0x93')]['query'](_0xcfba30[_0x3fca('0x78')](),_0x47150e)[_0x3fca('0x26')](function(_0x81937){_0x3e5de9=_[_0x3fca('0x94')](_0x81937,'id');_0x47150e=_['merge'](_0x47150e,{'model':db[_0x3fca('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x242d37[_0x3fca('0x44')](_0x3fca('0x96'),'Account.key');_0x242d37[_0x3fca('0x44')](_0x3fca('0x97'));_0x242d37['field'](_0x3fca('0x63'),'Contact.firstName');_0x242d37[_0x3fca('0x44')](_0x3fca('0x6a'),_0x3fca('0x98'));_0x242d37[_0x3fca('0x44')](_0x3fca('0x65'),_0x3fca('0x99'));_0x242d37[_0x3fca('0x44')](_0x3fca('0x9a'),_0x3fca('0x9b'));_0x242d37[_0x3fca('0x44')]('c.mobile',_0x3fca('0x9c'));_0x242d37[_0x3fca('0x44')](_0x3fca('0x9d'),'Contact.fax');_0x242d37[_0x3fca('0x44')](_0x3fca('0x9e'),_0x3fca('0x2e'));_0x242d37[_0x3fca('0x4f')](_0x3fca('0x8b'),'it',_0x3fca('0x8c'));_0x242d37[_0x3fca('0x4f')]('tools_tags','t',_0x3fca('0x8e'));_0x242d37[_0x3fca('0x3e')](_0x76249c[_0x3fca('0x3e')]);_0x242d37['offset'](_0x76249c[_0x3fca('0x1f')]);return db[_0x3fca('0x93')][_0x3fca('0x36')](_0x242d37[_0x3fca('0x78')](),_0x47150e);})[_0x3fca('0x26')](function(_0x58c987){_0x2cf2e2[_0x3fca('0x41')](_0x3fca('0x9f'),_[_0x3fca('0x2d')](_0x58c987,'id'));return db['sequelize'][_0x3fca('0x36')](_0x2cf2e2[_0x3fca('0x78')](),_0x47150e)[_0x3fca('0x26')](function(_0x3c464f){var _0x3910a8=_['groupBy'](_0x3c464f,_0x3fca('0xa0'));var _0x36ad33=[];_0x58c987[_0x3fca('0x30')](function(_0x2a9ed2){_0x36ad33['push'](updateOpenchannelInteraction(_0x2a9ed2,_0x3e5de9,_0x3910a8));});return BPromise[_0x3fca('0xa1')](_0x36ad33);});});})['then'](function(_0x4935c3){_0x20a06f['rows']=_0x4935c3;return _0x20a06f;})[_0x3fca('0x26')](respondWithFilteredResult(_0x538182,_0x76249c))[_0x3fca('0x32')](handleError(_0x538182,null));};exports['show']=function(_0x224529,_0x236667){var _0x4bcc5f={'raw':![],'where':{'id':_0x224529[_0x3fca('0xa2')]['id']}},_0x170342={};_0x170342[_0x3fca('0x34')]=_['keys'](db[_0x3fca('0x95')][_0x3fca('0xa3')]);_0x170342[_0x3fca('0x36')]=_[_0x3fca('0x35')](_0x224529[_0x3fca('0x36')]);_0x170342[_0x3fca('0x37')]=_[_0x3fca('0x38')](_0x170342[_0x3fca('0x34')],_0x170342[_0x3fca('0x36')]);_0x4bcc5f[_0x3fca('0x39')]=_['intersection'](_0x170342['model'],qs[_0x3fca('0x3a')](_0x224529['query']['fields']));_0x4bcc5f[_0x3fca('0x39')]=_0x4bcc5f['attributes'][_0x3fca('0x3b')]?_0x4bcc5f['attributes']:_0x170342['model'];if(_0x224529[_0x3fca('0x36')][_0x3fca('0xa4')]){_0x4bcc5f[_0x3fca('0xa5')]=[{'all':!![]}];}_0x4bcc5f=_[_0x3fca('0xa6')]({},_0x4bcc5f,_0x224529[_0x3fca('0xa7')]);return db[_0x3fca('0x95')]['find'](_0x4bcc5f)[_0x3fca('0x26')](handleEntityNotFound(_0x236667,null))[_0x3fca('0x26')](respondWithResult(_0x236667,null))[_0x3fca('0x32')](handleError(_0x236667,null));};exports[_0x3fca('0xa8')]=function(_0x23a714,_0x54f407){return db['OpenchannelInteraction'][_0x3fca('0xa8')](_0x23a714[_0x3fca('0xa9')],{})[_0x3fca('0x26')](respondWithResult(_0x54f407,0xc9))[_0x3fca('0x32')](handleError(_0x54f407,null));};exports[_0x3fca('0x24')]=function(_0x5b9d49,_0x3e3610){if(_0x5b9d49[_0x3fca('0xa9')]['id']){delete _0x5b9d49['body']['id'];}return db[_0x3fca('0x95')][_0x3fca('0xaa')]({'where':{'id':_0x5b9d49[_0x3fca('0xa2')]['id']}})['then'](handleEntityNotFound(_0x3e3610,null))[_0x3fca('0x26')](saveUpdates(_0x5b9d49[_0x3fca('0xa9')],null))['then'](respondWithResult(_0x3e3610,null))['catch'](handleError(_0x3e3610,null));};exports['destroy']=function(_0x141a3c,_0x573be8){return db[_0x3fca('0x95')][_0x3fca('0xaa')]({'where':{'id':_0x141a3c['params']['id']}})[_0x3fca('0x26')](handleEntityNotFound(_0x573be8,null))[_0x3fca('0x26')](removeEntity(_0x573be8,null))[_0x3fca('0x32')](handleError(_0x573be8,null));};exports[_0x3fca('0xab')]=function(_0x1dcc3d,_0xd6dece){return db[_0x3fca('0x95')][_0x3fca('0xab')]()[_0x3fca('0x26')](respondWithResult(_0xd6dece,null))[_0x3fca('0x32')](handleError(_0xd6dece,null));};exports[_0x3fca('0xac')]=function(_0x284b79,_0x34e3ed,_0x2cbb2e){return db[_0x3fca('0xad')][_0x3fca('0xaa')]({'where':{'id':_0x284b79[_0x3fca('0xa2')]['id']}})[_0x3fca('0x26')](handleEntityNotFound(_0x34e3ed,null))[_0x3fca('0x26')](function(_0x344591){if(_0x344591){return _0x344591[_0x3fca('0xac')](_0x284b79[_0x3fca('0xa9')][_0x3fca('0xae')],_[_0x3fca('0xaf')](_0x284b79[_0x3fca('0xa9')],[_0x3fca('0xae'),'id'])||{});}})[_0x3fca('0x26')](respondWithResult(_0x34e3ed,null))[_0x3fca('0x32')](handleError(_0x34e3ed,null));};exports['getMessages']=function(_0x709310,_0x50accb,_0x5a536d){var _0x578d0e={'raw':![],'where':{}};var _0x51d340={};var _0x3ed8c7={'count':0x0,'rows':[]};return db[_0x3fca('0x95')]['findOne']({'where':{'id':_0x709310[_0x3fca('0xa2')]['id']}})[_0x3fca('0x26')](handleEntityNotFound(_0x50accb,null))[_0x3fca('0x26')](function(_0x5f11a4){if(_0x5f11a4){_0x51d340[_0x3fca('0x34')]=_[_0x3fca('0x35')](db[_0x3fca('0xad')][_0x3fca('0xa3')]);_0x51d340[_0x3fca('0x36')]=_[_0x3fca('0x35')](_0x709310['query']);_0x51d340[_0x3fca('0x37')]=_['intersection'](_0x51d340[_0x3fca('0x34')],_0x51d340[_0x3fca('0x36')]);_0x578d0e[_0x3fca('0x39')]=_[_0x3fca('0x38')](_0x51d340[_0x3fca('0x34')],qs[_0x3fca('0x3a')](_0x709310[_0x3fca('0x36')][_0x3fca('0x3a')]));_0x578d0e[_0x3fca('0x39')]=_0x578d0e[_0x3fca('0x39')][_0x3fca('0x3b')]?_0x578d0e[_0x3fca('0x39')]:_0x51d340['model'];if(!_0x709310['query'][_0x3fca('0x3c')](_0x3fca('0x3d'))){_0x578d0e[_0x3fca('0x3e')]=qs[_0x3fca('0x3e')](_0x709310[_0x3fca('0x36')][_0x3fca('0x3e')]);_0x578d0e[_0x3fca('0x1f')]=qs['offset'](_0x709310[_0x3fca('0x36')][_0x3fca('0x1f')]);}_0x578d0e[_0x3fca('0x3f')]=qs[_0x3fca('0x40')](_0x709310[_0x3fca('0x36')][_0x3fca('0x40')]);_0x578d0e[_0x3fca('0x41')]=qs['filters'](_[_0x3fca('0x42')](_0x709310['query'],_0x51d340[_0x3fca('0x37')]));_0x578d0e[_0x3fca('0x41')]['OpenchannelInteractionId']=_0x5f11a4['id'];if(_0x709310['query'][_0x3fca('0x73')]){_0x578d0e[_0x3fca('0x41')]=_[_0x3fca('0xa6')](_0x578d0e[_0x3fca('0x41')],{'$or':_[_0x3fca('0x2d')](_0x578d0e[_0x3fca('0x39')],function(_0x2fc892){var _0x21606d={};_0x21606d[_0x2fc892]={'$like':'%'+_0x709310[_0x3fca('0x36')]['filter']+'%'};return _0x21606d;})});}if(_0x709310[_0x3fca('0x36')]['$gte']){var _0xedd471=_0x709310['query'][_0x3fca('0x6f')][_0x3fca('0x77')](',');var _0x49a253={};_0x49a253[_0xedd471[0x0]]={'$gte':moment(_0xedd471[0x1])[_0x3fca('0x84')](_0x3fca('0xb0'))};_0x578d0e[_0x3fca('0x41')]=_[_0x3fca('0xa6')](_0x578d0e[_0x3fca('0x41')],_0x49a253);}_0x578d0e=_[_0x3fca('0xa6')]({},_0x578d0e,_0x709310[_0x3fca('0xa7')]);return db['OpenchannelMessage'][_0x3fca('0x1e')]({'where':_0x578d0e[_0x3fca('0x41')]})['then'](function(_0x23d54e){_0x3ed8c7[_0x3fca('0x1e')]=_0x23d54e;if(_0x709310['query']['includeAll']){_0x578d0e[_0x3fca('0xa5')]=[{'all':!![]}];}return db[_0x3fca('0xad')][_0x3fca('0xb1')](_0x578d0e);})[_0x3fca('0x26')](function(_0x3db6c1){_0x3ed8c7[_0x3fca('0xb2')]=_0x3db6c1;return _0x3ed8c7;});}})['then'](respondWithFilteredResult(_0x50accb,_0x578d0e))[_0x3fca('0x32')](handleError(_0x50accb,null));};exports[_0x3fca('0xb3')]=function(_0x4e88c5,_0x2a0fb7,_0x14d36d){return db[_0x3fca('0x95')][_0x3fca('0xaa')]({'where':{'id':_0x4e88c5[_0x3fca('0xa2')]['id']}})[_0x3fca('0x26')](handleEntityNotFound(_0x2a0fb7,null))[_0x3fca('0x26')](function(_0x371d0a){if(_0x371d0a){return _0x371d0a['setTags'](_0x4e88c5[_0x3fca('0xa9')][_0x3fca('0xae')],_['omit'](_0x4e88c5[_0x3fca('0xa9')],[_0x3fca('0xae'),'id'])||{})[_0x3fca('0xb4')](function(){return db[_0x3fca('0xb5')][_0x3fca('0xb1')]({'attributes':['id',_0x3fca('0x28'),_0x3fca('0xb6')],'where':{'id':_0x4e88c5[_0x3fca('0xa9')]['ids']}});})['then'](function(_0x2fffb8){socket[_0x3fca('0xb7')](_0x3fca('0xb8'),{'id':Number(_0x4e88c5['params']['id']),'tags':_0x2fffb8||[]});return{'id':Number(_0x4e88c5[_0x3fca('0xa2')]['id']),'tags':_0x2fffb8||[]};});}})[_0x3fca('0x26')](respondWithResult(_0x2a0fb7,null))[_0x3fca('0x32')](handleError(_0x2a0fb7,null));};exports['removeTags']=function(_0x5ee72e,_0x59ca0e,_0x124af){return db[_0x3fca('0x95')][_0x3fca('0xaa')]({'where':{'id':_0x5ee72e['params']['id']}})['then'](handleEntityNotFound(_0x59ca0e,null))[_0x3fca('0x26')](function(_0x573f6a){if(_0x573f6a){return _0x573f6a[_0x3fca('0xb9')](_0x5ee72e[_0x3fca('0x36')]['ids']);}})[_0x3fca('0x26')](respondWithStatusCode(_0x59ca0e,null))[_0x3fca('0x32')](handleError(_0x59ca0e,null));};exports[_0x3fca('0xba')]=function(_0x1ac0e5,_0x12a9bc){var _0x155926=moment()[_0x3fca('0xbb')]()[_0x3fca('0x78')]();var _0x5bfbee=path['join'](config['root'],'server',_0x3fca('0xbc'),_0x3fca('0xbd'));var _0x1508ac=path['join'](config['root'],_0x3fca('0xbe'),'files',_0x3fca('0xbf'));var _0x994fe0=path['join'](_0x5bfbee,_0x155926);var _0x71efaa=util['format'](_0x3fca('0xc0'),_0x1ac0e5[_0x3fca('0xa2')]['id'],_0x155926);var _0x1d5bd9=path[_0x3fca('0x79')](_0x5bfbee,_0x71efaa);var _0x481ae9=![];return db['OpenchannelInteraction'][_0x3fca('0xaa')]({'where':{'id':_0x1ac0e5[_0x3fca('0xa2')]['id']},'include':[{'model':db[_0x3fca('0xad')],'as':_0x3fca('0xc1'),'attributes':['id','body','createdAt','direction','secret'],'include':[{'model':db[_0x3fca('0xc2')],'as':_0x3fca('0xc2'),'attributes':['id',_0x3fca('0xc3')],'raw':!![]},{'model':db[_0x3fca('0xc4')],'as':_0x3fca('0xc5'),'attributes':['id','firstName',_0x3fca('0xc6')],'raw':!![]},{'model':db['Attachment'],'as':_0x3fca('0xc7'),'raw':!![]}]},{'model':db[_0x3fca('0xc8')],'as':_0x3fca('0xc9'),'attributes':['id',_0x3fca('0x28')]},{'model':db[_0x3fca('0xc2')],'as':_0x3fca('0xca'),'attributes':['id',_0x3fca('0xc3')]}]})['then'](handleEntityNotFound(_0x12a9bc,null))[_0x3fca('0x26')](function(_0x17050f){if(_0x17050f){var _0x1acb04=_0x17050f['get']({'plain':!![]});_0x481ae9=!![];var _0xda8cae={'format':'A4','border':'10px','header':{'height':_0x3fca('0xcb'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x3fca('0xcc'),'contents':{'default':util['format'](_0x3fca('0xcd'),util['format'](_0x3fca('0xce'),_0x3fca('0xcf'),_0x1acb04['id']),moment()[_0x3fca('0x84')](_0x3fca('0xd0'))['toString']())}}};fs['mkdirSync'](_0x994fe0);var _0xa42b6={'channel':'Openchannel','account':_0x1acb04[_0x3fca('0xc9')][_0x3fca('0x28')],'agent':_0x1acb04[_0x3fca('0xca')]?_0x1acb04['Owner']['fullname']:'N.A.','createdAt':moment(_0x1acb04['createdAt'])['format'](_0x3fca('0xb0'))[_0x3fca('0x78')](),'closedAt':_0x1acb04[_0x3fca('0x2a')]?moment(_0x1acb04[_0x3fca('0xd1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3fca('0x78')]():'','disposition':_0x1acb04[_0x3fca('0xd2')],'visibility':_0x1acb04['threadId']?_0x3fca('0xd3'):_0x3fca('0xd4'),'messages':_(_0x1acb04[_0x3fca('0xc1')])[_0x3fca('0x73')]({'secret':![]})[_0x3fca('0x2d')](function(_0x41ea05){if(_0x41ea05[_0x3fca('0xc7')]){var _0x3640ba=path[_0x3fca('0x79')](_0x1508ac,_0x41ea05[_0x3fca('0xc7')]['basename']);if(fs[_0x3fca('0xd5')](_0x3640ba)){fs['createReadStream'](_0x3640ba)[_0x3fca('0xd6')](fs[_0x3fca('0xd7')](path[_0x3fca('0x79')](_0x994fe0,_0x41ea05[_0x3fca('0xc7')][_0x3fca('0xd8')])));}}return{'date':moment(_0x41ea05[_0x3fca('0x54')])['format'](_0x3fca('0xb0'))['toString'](),'sender':_0x41ea05[_0x3fca('0xd9')]===_0x3fca('0xda')?_0x41ea05['User']?_0x41ea05['User'][_0x3fca('0xc3')]:'System':_0x41ea05[_0x3fca('0xc5')][_0x3fca('0xdb')]+(_0x41ea05[_0x3fca('0xc5')][_0x3fca('0xc6')]?'\x20'+_0x41ea05[_0x3fca('0xc5')]['lastName']:''),'body':_0x41ea05[_0x3fca('0xc7')]?_0x41ea05[_0x3fca('0xc7')][_0x3fca('0xd8')]:_0x41ea05[_0x3fca('0xa9')],'direction':_0x41ea05[_0x3fca('0xd9')]==='out'?'A':'C','secret':_0x41ea05[_0x3fca('0xdc')],'attachment':_0x41ea05['Attachment']};})[_0x3fca('0x55')]()};return ejs[_0x3fca('0xdd')](path['join'](config['root'],_0x3fca('0xbe'),_0x3fca('0xde'),'downloadInteraction.html'),{'interaction':_0xa42b6})[_0x3fca('0x26')](function(_0x19503f){return new BPromise(function(_0x5b8920,_0x58b171){pdf[_0x3fca('0xa8')](_0x19503f,_0xda8cae)[_0x3fca('0xdf')](path[_0x3fca('0x79')](_0x994fe0,_0x3fca('0xe0')+_0x1acb04['id']+'-'+_0x155926+_0x3fca('0xe1')),function(_0x46658d,_0x27a076){if(_0x46658d)return _0x58b171(_0x46658d);_0x5b8920(_0x27a076);});});});}})[_0x3fca('0x26')](function(){if(_0x481ae9){return new BPromise(function(_0x4c5979,_0x166f37){zipdir(_0x994fe0,{'saveTo':_0x1d5bd9},function(_0x516210,_0x5a4145){if(_0x516210)return _0x166f37(_0x516210);return _0x4c5979(_0x5a4145);});})[_0x3fca('0x26')](function(){return new BPromise(function(_0x35e671,_0x27678d){rimraf(_0x994fe0,function(_0x466ab0){if(_0x466ab0)_0x27678d(_0x466ab0);return _0x35e671();});});})[_0x3fca('0x26')](function(){return _0x12a9bc[_0x3fca('0xba')](_0x1d5bd9,_0x71efaa,function(_0x22ce7a){if(_0x22ce7a){console[_0x3fca('0xe2')](_0x3fca('0xe3'),_0x22ce7a);}else{fs['unlinkSync'](_0x1d5bd9);}});});}else{return _0x12a9bc['sendStatus'](0xc8);}})[_0x3fca('0x32')](handleError(_0x12a9bc,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2f2ef29..068b9d7 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 _0xb959=['remove','then','setDataValue','unreadMessages','length','emit','catch','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x18a379,_0x27442b){var _0x2148ec=function(_0x12c21f){while(--_0x12c21f){_0x18a379['push'](_0x18a379['shift']());}};_0x2148ec(++_0x27442b);}(_0xb959,0x181));var _0x9b95=function(_0x24e27e,_0x4d17b9){_0x24e27e=_0x24e27e-0x0;var _0x24c6ba=_0xb959[_0x24e27e];return _0x24c6ba;};'use strict';var EventEmitter=require(_0x9b95('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x9b95('0x1')];var OpenchannelMessage=require(_0x9b95('0x2'))['db'][_0x9b95('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9b95('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9b95('0x5')};function emitEvent(_0x303ac8){return function(_0x3c7fad,_0x3ee2c7,_0x5eed6d){OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3c7fad['id'],'direction':'in','read':![]},'raw':!![]})[_0x9b95('0x6')](function(_0x1a42fd){_0x3c7fad[_0x9b95('0x7')](_0x9b95('0x8'),_0x1a42fd[_0x9b95('0x9')]);OpenchannelInteractionEvents['emit'](_0x303ac8+':'+_0x3c7fad['id'],_0x3c7fad);OpenchannelInteractionEvents[_0x9b95('0xa')](_0x303ac8,_0x3c7fad);_0x5eed6d(null);})[_0x9b95('0xb')](_0x5eed6d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x9b95('0xc')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xd332=['events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3e4fda,_0x3a2a54){var _0x39caeb=function(_0x38221e){while(--_0x38221e){_0x3e4fda['push'](_0x3e4fda['shift']());}};_0x39caeb(++_0x3a2a54);}(_0xd332,0x13b));var _0x2d33=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd332[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x2d33('0x0'));var OpenchannelInteraction=require(_0x2d33('0x1'))['db'][_0x2d33('0x2')];var OpenchannelMessage=require(_0x2d33('0x1'))['db'][_0x2d33('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2d33('0x4')](0x0);var events={'afterCreate':_0x2d33('0x5'),'afterUpdate':_0x2d33('0x6'),'afterDestroy':_0x2d33('0x7')};function emitEvent(_0x36cd08){return function(_0x3628eb,_0x4a7f05,_0x363b27){OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3628eb['id'],'direction':'in','read':![]},'raw':!![]})['then'](function(_0x45adb2){_0x3628eb[_0x2d33('0x8')](_0x2d33('0x9'),_0x45adb2[_0x2d33('0xa')]);OpenchannelInteractionEvents['emit'](_0x36cd08+':'+_0x3628eb['id'],_0x3628eb);OpenchannelInteractionEvents[_0x2d33('0xb')](_0x36cd08,_0x3628eb);_0x363b27(null);})[_0x2d33('0xc')](_0x363b27(null));};}for(var e in events){if(events[_0x2d33('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x2d33('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 213a83b..e728e14 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 _0xe64a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ebcc4,_0x24356a){var _0xff2552=function(_0x2f4f51){while(--_0x2f4f51){_0x5ebcc4['push'](_0x5ebcc4['shift']());}};_0xff2552(++_0x24356a);}(_0xe64a,0x1e0));var _0xae64=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe64a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var logger=require(_0xae64('0x2'))(_0xae64('0x3'));var moment=require(_0xae64('0x4'));var BPromise=require(_0xae64('0x5'));var rp=require(_0xae64('0x6'));var fs=require('fs');var path=require(_0xae64('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x2b1046,_0x896007){return _0x2b1046[_0xae64('0x8')](_0xae64('0x9'),attributes,{'tableName':_0xae64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x65a9d1,_0x385871,_0x164acf){if(_0x65a9d1[_0xae64('0xb')](_0xae64('0xc'))){_0x65a9d1[_0xae64('0xd')]=moment()['format'](_0xae64('0xe'));}_0x164acf(null,_0x65a9d1);}}});}; \ No newline at end of file +var _0x6737=['moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x2a2b4,_0xcc17b){var _0x16bec5=function(_0x5d5e08){while(--_0x5d5e08){_0x2a2b4['push'](_0x2a2b4['shift']());}};_0x16bec5(++_0xcc17b);}(_0x6737,0xe2));var _0x7673=function(_0x39ace1,_0x234ddf){_0x39ace1=_0x39ace1-0x0;var _0x52a7dd=_0x6737[_0x39ace1];return _0x52a7dd;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var logger=require(_0x7673('0x1'))('api');var moment=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var rp=require(_0x7673('0x4'));var fs=require('fs');var path=require(_0x7673('0x5'));var rimraf=require('rimraf');var config=require(_0x7673('0x6'));var attributes=require(_0x7673('0x7'));module['exports']=function(_0x2f5edc,_0x15230f){return _0x2f5edc['define']('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5292f7,_0x285c6d,_0x5bede8){if(_0x5292f7[_0x7673('0x8')](_0x7673('0x9'))){_0x5292f7['closedAt']=moment()[_0x7673('0xa')](_0x7673('0xb'));}_0x5bede8(null,_0x5292f7);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index ce8485b..36cc05a 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 _0x2d72=['socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','UpdateOpenchannelInteraction','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x108583,_0x4dc8d1){var _0x24a195=function(_0x7f85fd){while(--_0x7f85fd){_0x108583['push'](_0x108583['shift']());}};_0x24a195(++_0x4dc8d1);}(_0x2d72,0xa8));var _0x22d7=function(_0x1672e8,_0x245231){_0x1672e8=_0x1672e8-0x0;var _0x5846dd=_0x2d72[_0x1672e8];return _0x5846dd;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});config['redis']=_[_0x22d7('0xe')](config[_0x22d7('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x22d7('0x10'))(new Redis(config[_0x22d7('0xf')]));require(_0x22d7('0x11'))[_0x22d7('0x12')](socket);function respondWithRpcPromise(_0x49f7e1,_0x5f56eb,_0x1810b8){return new BPromise(function(_0x257c85,_0x233c0b){return client[_0x22d7('0x13')](_0x49f7e1,_0x1810b8)[_0x22d7('0x14')](function(_0x4db5dd){logger['info'](_0x22d7('0x15'),_0x5f56eb,'request\x20sent');logger[_0x22d7('0x16')](_0x22d7('0x17'),_0x5f56eb,'request\x20sent',JSON[_0x22d7('0x18')](_0x4db5dd));if(_0x4db5dd[_0x22d7('0x19')]){if(_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1a')]===0x1f4){logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1b')]);return _0x233c0b(_0x4db5dd['error'][_0x22d7('0x1b')]);}logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd['error']['message']);return _0x257c85(_0x4db5dd['error'][_0x22d7('0x1b')]);}else{logger[_0x22d7('0x1c')](_0x22d7('0x15'),_0x5f56eb,_0x22d7('0x1d'));_0x257c85(_0x4db5dd[_0x22d7('0x1e')]['message']);}})[_0x22d7('0x1f')](function(_0x75affd){logger[_0x22d7('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5f56eb,_0x75affd);_0x233c0b(_0x75affd);});});}exports[_0x22d7('0x20')]=function(_0x7f2905){var _0x3574e4=this;return new Promise(function(_0xcb35a8,_0x6be49e){return db['OpenchannelInteraction']['update'](_0x7f2905[_0x22d7('0x21')],{'raw':_0x7f2905[_0x22d7('0x22')]?_0x7f2905[_0x22d7('0x22')][_0x22d7('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7f2905['options']?_0x7f2905[_0x22d7('0x22')][_0x22d7('0x24')]||null:null,'attributes':_0x7f2905[_0x22d7('0x22')]?_0x7f2905['options'][_0x22d7('0x25')]||null:null,'limit':_0x7f2905['options']?_0x7f2905[_0x22d7('0x22')][_0x22d7('0x26')]||null:null})[_0x22d7('0x14')](function(_0x5db3aa){logger[_0x22d7('0x1c')]('UpdateOpenchannelInteraction',_0x7f2905);logger['debug'](_0x22d7('0x20'),_0x7f2905,JSON[_0x22d7('0x18')](_0x5db3aa));_0xcb35a8(_0x5db3aa);})[_0x22d7('0x1f')](function(_0x27998a){logger[_0x22d7('0x19')]('UpdateOpenchannelInteraction',_0x27998a[_0x22d7('0x1b')],_0x7f2905);_0x6be49e(_0x3574e4[_0x22d7('0x19')](0x1f4,_0x27998a[_0x22d7('0x1b')]));});});};exports[_0x22d7('0x27')]=function(_0x45dc29){return new Promise(function(_0x49199a,_0x2606bd){return db[_0x22d7('0x28')][_0x22d7('0x29')]({'where':_0x45dc29[_0x22d7('0x22')]?_0x45dc29['options'][_0x22d7('0x24')]||null:null})[_0x22d7('0x14')](function(_0x47ef72){if(_0x47ef72){return _0x47ef72['addTags'](_0x45dc29['body'][_0x22d7('0x2a')],_[_0x22d7('0x2b')](_0x45dc29[_0x22d7('0x21')],['ids','id'])||{});}})[_0x22d7('0x2c')](function(_0x5ef395){logger[_0x22d7('0x1c')](_0x22d7('0x2d'),_0x45dc29);logger[_0x22d7('0x16')](_0x22d7('0x2d'),_0x45dc29,JSON[_0x22d7('0x18')](_0x5ef395));_0x49199a(_0x5ef395);})[_0x22d7('0x1f')](function(_0x4ac16c){logger['error'](_0x22d7('0x2d'),_0x4ac16c['message'],_0x45dc29);_0x2606bd(_this[_0x22d7('0x19')](0x1f4,_0x4ac16c[_0x22d7('0x1b')]));});});}; \ No newline at end of file +var _0x90b1=['request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','raw','options','attributes','limit','catch','where','addTags','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x215b66,_0x2ed533){var _0x551d13=function(_0x17446b){while(--_0x17446b){_0x215b66['push'](_0x215b66['shift']());}};_0x551d13(++_0x2ed533);}(_0x90b1,0x1bb));var _0x190b=function(_0x223106,_0x499e32){_0x223106=_0x223106-0x0;var _0x18378c=_0x90b1[_0x223106];return _0x18378c;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});config[_0x190b('0x8')]=_[_0x190b('0x9')](config[_0x190b('0x8')],{'host':_0x190b('0xa'),'port':0x18eb});var socket=require(_0x190b('0xb'))(new Redis(config[_0x190b('0x8')]));require('./openchannelInteraction.socket')[_0x190b('0xc')](socket);function respondWithRpcPromise(_0x186101,_0x163966,_0x33fd04){return new BPromise(function(_0x41b788,_0x409aa3){return client[_0x190b('0xd')](_0x186101,_0x33fd04)[_0x190b('0xe')](function(_0x5d6497){logger[_0x190b('0xf')](_0x190b('0x10'),_0x163966,'request\x20sent');logger[_0x190b('0x11')](_0x190b('0x12'),_0x163966,_0x190b('0x13'),JSON[_0x190b('0x14')](_0x5d6497));if(_0x5d6497[_0x190b('0x15')]){if(_0x5d6497[_0x190b('0x15')][_0x190b('0x16')]===0x1f4){logger[_0x190b('0x15')](_0x190b('0x10'),_0x163966,_0x5d6497[_0x190b('0x15')][_0x190b('0x17')]);return _0x409aa3(_0x5d6497[_0x190b('0x15')][_0x190b('0x17')]);}logger[_0x190b('0x15')](_0x190b('0x10'),_0x163966,_0x5d6497[_0x190b('0x15')][_0x190b('0x17')]);return _0x41b788(_0x5d6497['error'][_0x190b('0x17')]);}else{logger['info'](_0x190b('0x10'),_0x163966,_0x190b('0x13'));_0x41b788(_0x5d6497[_0x190b('0x18')][_0x190b('0x17')]);}})['catch'](function(_0x298343){logger[_0x190b('0x15')](_0x190b('0x10'),_0x163966,_0x298343);_0x409aa3(_0x298343);});});}exports[_0x190b('0x19')]=function(_0x1b5427){var _0x177170=this;return new Promise(function(_0x47d704,_0x3ed24c){return db[_0x190b('0x1a')]['update'](_0x1b5427[_0x190b('0x1b')],{'raw':_0x1b5427['options']?_0x1b5427['options'][_0x190b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5427[_0x190b('0x1d')]?_0x1b5427[_0x190b('0x1d')]['where']||null:null,'attributes':_0x1b5427[_0x190b('0x1d')]?_0x1b5427[_0x190b('0x1d')][_0x190b('0x1e')]||null:null,'limit':_0x1b5427[_0x190b('0x1d')]?_0x1b5427[_0x190b('0x1d')][_0x190b('0x1f')]||null:null})[_0x190b('0xe')](function(_0x519a76){logger['info'](_0x190b('0x19'),_0x1b5427);logger[_0x190b('0x11')]('UpdateOpenchannelInteraction',_0x1b5427,JSON['stringify'](_0x519a76));_0x47d704(_0x519a76);})[_0x190b('0x20')](function(_0x4e2a93){logger[_0x190b('0x15')](_0x190b('0x19'),_0x4e2a93['message'],_0x1b5427);_0x3ed24c(_0x177170[_0x190b('0x15')](0x1f4,_0x4e2a93[_0x190b('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0xa9d6f7){return new Promise(function(_0x2c47ae,_0x359b4a){return db['OpenchannelInteraction']['find']({'where':_0xa9d6f7[_0x190b('0x1d')]?_0xa9d6f7['options'][_0x190b('0x21')]||null:null})[_0x190b('0xe')](function(_0x5b9cb6){if(_0x5b9cb6){return _0x5b9cb6[_0x190b('0x22')](_0xa9d6f7['body'][_0x190b('0x23')],_['omit'](_0xa9d6f7[_0x190b('0x1b')],['ids','id'])||{});}})[_0x190b('0x24')](function(_0x5c6ff3){logger['info'](_0x190b('0x25'),_0xa9d6f7);logger[_0x190b('0x11')](_0x190b('0x25'),_0xa9d6f7,JSON[_0x190b('0x14')](_0x5c6ff3));_0x2c47ae(_0x5c6ff3);})[_0x190b('0x20')](function(_0x360d04){logger[_0x190b('0x15')](_0x190b('0x25'),_0x360d04['message'],_0xa9d6f7);_0x359b4a(_this['error'](0x1f4,_0x360d04[_0x190b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index f5a4e5b..046e6eb 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 _0xff49=['openchannelInteraction:','./openchannelInteraction.events','save','update','emit','removeListener','register'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xff49,0x151));var _0x9ff4=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xff49[_0x599f41];return _0x2e4d58;};'use strict';var OpenchannelInteractionEvents=require(_0x9ff4('0x0'));var events=[_0x9ff4('0x1'),'remove',_0x9ff4('0x2')];function createListener(_0x167d0a,_0x5193df){return function(_0x40ea92){_0x5193df[_0x9ff4('0x3')](_0x167d0a,_0x40ea92);};}function removeListener(_0x42555c,_0x2084a3){return function(){OpenchannelInteractionEvents[_0x9ff4('0x4')](_0x42555c,_0x2084a3);};}exports[_0x9ff4('0x5')]=function(_0x1d7d96){for(var _0x496207=0x0,_0x5dff35=events['length'];_0x496207<_0x5dff35;_0x496207++){var _0xa9d6ea=events[_0x496207];var _0x542436=createListener(_0x9ff4('0x6')+_0xa9d6ea,_0x1d7d96);OpenchannelInteractionEvents['on'](_0xa9d6ea,_0x542436);}}; \ No newline at end of file +var _0x69cf=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','register'];(function(_0x36f074,_0x3357f2){var _0x286747=function(_0x4f29bc){while(--_0x4f29bc){_0x36f074['push'](_0x36f074['shift']());}};_0x286747(++_0x3357f2);}(_0x69cf,0x191));var _0xf69c=function(_0x4a3f10,_0x3373f1){_0x4a3f10=_0x4a3f10-0x0;var _0x1bcf08=_0x69cf[_0x4a3f10];return _0x1bcf08;};'use strict';var OpenchannelInteractionEvents=require(_0xf69c('0x0'));var events=[_0xf69c('0x1'),_0xf69c('0x2'),_0xf69c('0x3')];function createListener(_0x2f584f,_0x42f75f){return function(_0x49bc69){_0x42f75f['emit'](_0x2f584f,_0x49bc69);};}function removeListener(_0x2a6dd9,_0x463f3e){return function(){OpenchannelInteractionEvents['removeListener'](_0x2a6dd9,_0x463f3e);};}exports[_0xf69c('0x4')]=function(_0x69d06d){for(var _0x4c026f=0x0,_0x8a7b2b=events[_0xf69c('0x5')];_0x4c026f<_0x8a7b2b;_0x4c026f++){var _0x11df0a=events[_0x4c026f];var _0x441f0c=createListener(_0xf69c('0x6')+_0x11df0a,_0x69d06d);OpenchannelInteractionEvents['on'](_0x11df0a,_0x441f0c);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 159e297..cd721b5 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 _0x2445=['openchannel','openchannelmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x54bc16,_0x4428a5){var _0x8097fd=function(_0xc49294){while(--_0xc49294){_0x54bc16['push'](_0x54bc16['shift']());}};_0x8097fd(++_0x4428a5);}(_0x2445,0xfa));var _0x5244=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x2445[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0x5244('0x0'));var util=require(_0x5244('0x1'));var path=require(_0x5244('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5244('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5244('0x4'));var config=require('../../config/environment');var controller=require(_0x5244('0x5'));router['get']('/',auth[_0x5244('0x6')](),controller[_0x5244('0x7')]);router[_0x5244('0x8')](_0x5244('0x9'),auth[_0x5244('0x6')](),controller[_0x5244('0xa')]);router[_0x5244('0x8')](_0x5244('0xb'),auth['isAuthenticated'](),controller[_0x5244('0xc')]);router[_0x5244('0xd')]('/',auth[_0x5244('0x6')](),interaction['tracked'](_0x5244('0xe'),_0x5244('0xf')),controller[_0x5244('0x10')]);router[_0x5244('0x11')](_0x5244('0xb'),auth[_0x5244('0x6')](),controller[_0x5244('0x12')]);router[_0x5244('0x11')](_0x5244('0x13'),auth[_0x5244('0x6')](),controller['accept']);router[_0x5244('0x11')](_0x5244('0x14'),auth[_0x5244('0x6')](),controller[_0x5244('0x15')]);router[_0x5244('0x16')](_0x5244('0xb'),auth[_0x5244('0x6')](),controller[_0x5244('0x17')]);module['exports']=router; \ No newline at end of file +var _0x68c0=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/:id','show','post','tracked','openchannel','create','put','/:id/accept','reject','destroy'];(function(_0x16a95c,_0x519cd){var _0x28cfc0=function(_0x5f0b1a){while(--_0x5f0b1a){_0x16a95c['push'](_0x16a95c['shift']());}};_0x28cfc0(++_0x519cd);}(_0x68c0,0xe8));var _0x068c=function(_0x5dcac7,_0xf83b0f){_0x5dcac7=_0x5dcac7-0x0;var _0x1e20f1=_0x68c0[_0x5dcac7];return _0x1e20f1;};'use strict';var multer=require(_0x068c('0x0'));var util=require('util');var path=require(_0x068c('0x1'));var timeout=require(_0x068c('0x2'));var express=require(_0x068c('0x3'));var router=express['Router']();var auth=require(_0x068c('0x4'));var interaction=require(_0x068c('0x5'));var config=require(_0x068c('0x6'));var controller=require(_0x068c('0x7'));router[_0x068c('0x8')]('/',auth[_0x068c('0x9')](),controller['index']);router[_0x068c('0x8')]('/describe',auth[_0x068c('0x9')](),controller['describe']);router[_0x068c('0x8')](_0x068c('0xa'),auth[_0x068c('0x9')](),controller[_0x068c('0xb')]);router[_0x068c('0xc')]('/',auth['isAuthenticated'](),interaction[_0x068c('0xd')](_0x068c('0xe'),'openchannelmessage:create'),controller[_0x068c('0xf')]);router[_0x068c('0x10')]('/:id',auth[_0x068c('0x9')](),controller['update']);router[_0x068c('0x10')](_0x068c('0x11'),auth[_0x068c('0x9')](),controller['accept']);router[_0x068c('0x10')]('/:id/reject',auth[_0x068c('0x9')](),controller[_0x068c('0x12')]);router['delete']('/:id',auth[_0x068c('0x9')](),controller[_0x068c('0x13')]);module[_0x068c('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 4e439d6..c8a89cc 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 _0x0124=['BOOLEAN','ENUM','out','DATE','exports','TEXT','medium'];(function(_0x366293,_0xa215f){var _0x5c8f0b=function(_0x180959){while(--_0x180959){_0x366293['push'](_0x366293['shift']());}};_0x5c8f0b(++_0xa215f);}(_0x0124,0x89));var _0x4012=function(_0x3b726d,_0xb04b2e){_0x3b726d=_0x3b726d-0x0;var _0x2ffc8b=_0x0124[_0x3b726d];return _0x2ffc8b;};'use strict';var Sequelize=require('sequelize');module[_0x4012('0x0')]={'body':{'type':Sequelize[_0x4012('0x1')](_0x4012('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4012('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4012('0x4')]('in',_0x4012('0x5')),'defaultValue':_0x4012('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4012('0x6')]}}; \ No newline at end of file +var _0xf609=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x283291,_0x136c77){var _0x494f00=function(_0x11ae7b){while(--_0x11ae7b){_0x283291['push'](_0x283291['shift']());}};_0x494f00(++_0x136c77);}(_0xf609,0x1dc));var _0x9f60=function(_0x49daed,_0x3c8137){_0x49daed=_0x49daed-0x0;var _0x36134f=_0xf609[_0x49daed];return _0x36134f;};'use strict';var Sequelize=require(_0x9f60('0x0'));module[_0x9f60('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9f60('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9f60('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9f60('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9f60('0x4')]('in',_0x9f60('0x5')),'defaultValue':_0x9f60('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9f60('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 99c34f6..b730cb6 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 _0xc7b5=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','test','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','OpenchannelMessage','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','includeAll','include','rows','show','params','rawAttributes','intersection','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','OpenchannelInteractionId','UserId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','event','EventManager','acceptmessage','agent','get','OpenchannelInteraction','RejectMessage','channel','rejectmessage','html-pdf'];(function(_0x652145,_0x452f86){var _0x64d6d9=function(_0x16503a){while(--_0x16503a){_0x652145['push'](_0x652145['shift']());}};_0x64d6d9(++_0x452f86);}(_0xc7b5,0x72));var _0x5c7b=function(_0x1ee442,_0x515a15){_0x1ee442=_0x1ee442-0x0;var _0x55ce5b=_0xc7b5[_0x1ee442];return _0x55ce5b;};'use strict';var pdf=require(_0x5c7b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5c7b('0x1'));var zipdir=require(_0x5c7b('0x2'));var jsonpatch=require(_0x5c7b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5c7b('0x4'));var Mustache=require(_0x5c7b('0x5'));var util=require(_0x5c7b('0x6'));var path=require(_0x5c7b('0x7'));var sox=require(_0x5c7b('0x8'));var csv=require(_0x5c7b('0x9'));var ejs=require(_0x5c7b('0xa'));var fs=require('fs');var _=require(_0x5c7b('0xb'));var squel=require(_0x5c7b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5c7b('0xd'));var toCsv=require(_0x5c7b('0x9'));var querystring=require(_0x5c7b('0xe'));var Papa=require(_0x5c7b('0xf'));var Redis=require(_0x5c7b('0x10'));var authService=require(_0x5c7b('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5c7b('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5c7b('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5c7b('0x14')],{'host':_0x5c7b('0x15'),'port':0x18eb});var socket=require(_0x5c7b('0x16'))(new Redis(config['redis']));require(_0x5c7b('0x17'))[_0x5c7b('0x18')](socket);var jayson=require(_0x5c7b('0x19'));var client=jayson[_0x5c7b('0x1a')][_0x5c7b('0x1b')]({'port':0x232c});var client9002=jayson[_0x5c7b('0x1a')][_0x5c7b('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3f2a03,_0x5e9206,_0x1dc28b){if(_0x1dc28b){var _0x5741e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5741e0[_0x5c7b('0x1c')](_0x5e9206)){return _0x3f2a03;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3f2a03;}}function respondWithRpcPromise(_0x5421fb,_0x371ca5,_0x34a16b,_0x58dd2b){return new BPromise(function(_0x4fb242,_0x2e8a0d){var _0x90a686=_0x58dd2b||client;return _0x90a686[_0x5c7b('0x1d')](_0x5421fb,_0x34a16b)[_0x5c7b('0x1e')](function(_0x2d7467){logger[_0x5c7b('0x1f')](_0x5c7b('0x20'),_0x371ca5,_0x5c7b('0x21'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x371ca5,_0x5c7b('0x21'),JSON[_0x5c7b('0x22')](_0x2d7467));if(_0x2d7467[_0x5c7b('0x23')]){if(_0x2d7467[_0x5c7b('0x23')][_0x5c7b('0x24')]===0x1f4){logger[_0x5c7b('0x23')](_0x5c7b('0x20'),_0x371ca5,_0x2d7467[_0x5c7b('0x23')][_0x5c7b('0x25')]);return _0x2e8a0d(_0x2d7467['error']['message']);}logger['error'](_0x5c7b('0x20'),_0x371ca5,_0x2d7467[_0x5c7b('0x23')][_0x5c7b('0x25')]);return _0x4fb242(_0x2d7467[_0x5c7b('0x23')][_0x5c7b('0x25')]);}else{logger[_0x5c7b('0x1f')](_0x5c7b('0x20'),_0x371ca5,_0x5c7b('0x21'));_0x4fb242(_0x2d7467[_0x5c7b('0x26')][_0x5c7b('0x25')]);}})[_0x5c7b('0x27')](function(_0x518f3f){logger[_0x5c7b('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x371ca5,_0x518f3f);_0x2e8a0d(_0x518f3f);});});}function respondWithStatusCode(_0x3ea5df,_0x2142ca){_0x2142ca=_0x2142ca||0xcc;return function(_0x5cb0ef){if(_0x5cb0ef){return _0x3ea5df[_0x5c7b('0x28')](_0x2142ca);}return _0x3ea5df[_0x5c7b('0x29')](_0x2142ca)[_0x5c7b('0x2a')]();};}function respondWithResult(_0x50daf3,_0x235d97){_0x235d97=_0x235d97||0xc8;return function(_0x557dde){if(_0x557dde){return _0x50daf3[_0x5c7b('0x29')](_0x235d97)[_0x5c7b('0x2b')](_0x557dde);}};}function respondWithFilteredResult(_0x13c338,_0x240eb2){return function(_0x5bf463){if(_0x5bf463){var _0x433ce8=_0x5bf463[_0x5c7b('0x2c')],_0x582430=_0x240eb2[_0x5c7b('0x2d')],_0x46d4cd=_0x240eb2[_0x5c7b('0x2d')]+_0x240eb2[_0x5c7b('0x2e')],_0x1e6a52;if(_0x46d4cd>=_0x433ce8){_0x46d4cd=_0x433ce8;_0x1e6a52=0xc8;}else{_0x1e6a52=0xce;}_0x13c338['status'](_0x1e6a52);return _0x13c338[_0x5c7b('0x2f')](_0x5c7b('0x30'),_0x582430+'-'+_0x46d4cd+'/'+_0x433ce8)[_0x5c7b('0x2b')](_0x5bf463);}return null;};}function patchUpdates(_0x23e48e){return function(_0x411e7b){try{jsonpatch[_0x5c7b('0x31')](_0x411e7b,_0x23e48e,!![]);}catch(_0x526bec){return BPromise[_0x5c7b('0x32')](_0x526bec);}return _0x411e7b[_0x5c7b('0x33')]();};}function saveUpdates(_0x193364,_0x400430){return function(_0xc68079){if(_0xc68079){return _0xc68079[_0x5c7b('0x34')](_0x193364)['then'](function(_0x77dbfb){return _0x77dbfb;});}return null;};}function removeEntity(_0x359646,_0xa7be27){return function(_0x36db59){if(_0x36db59){return _0x36db59[_0x5c7b('0x35')]()[_0x5c7b('0x1e')](function(){_0x359646[_0x5c7b('0x29')](0xcc)[_0x5c7b('0x2a')]();});}};}function handleEntityNotFound(_0x5c4ae2,_0x560111){return function(_0x24145d){if(!_0x24145d){_0x5c4ae2[_0x5c7b('0x28')](0x194);}return _0x24145d;};}function handleError(_0x3a2ce8,_0xabd3f3){_0xabd3f3=_0xabd3f3||0x1f4;return function(_0x465f9b){logger['error'](_0x465f9b[_0x5c7b('0x36')]);if(_0x465f9b['name']){delete _0x465f9b[_0x5c7b('0x37')];}_0x3a2ce8[_0x5c7b('0x29')](_0xabd3f3)['send'](_0x465f9b);};}exports[_0x5c7b('0x38')]=function(_0x2f6776,_0x3a354a){var _0x2f92b5={},_0xe069d2={},_0x53e237={'count':0x0,'rows':[]};var _0x2dc18f=db[_0x5c7b('0x39')]['rawAttributes'];_0xe069d2['model']=_['keys'](_0x2dc18f);_0xe069d2['query']=_[_0x5c7b('0x3a')](_0x2f6776[_0x5c7b('0x3b')]);_0xe069d2[_0x5c7b('0x3c')]=_['intersection'](_0xe069d2[_0x5c7b('0x3d')],_0xe069d2['query']);_0x2f92b5[_0x5c7b('0x3e')]=_['intersection'](_0xe069d2['model'],qs['fields'](_0x2f6776[_0x5c7b('0x3b')][_0x5c7b('0x3f')]));_0x2f92b5['attributes']=_0x2f92b5['attributes'][_0x5c7b('0x40')]?_0x2f92b5[_0x5c7b('0x3e')]:_0xe069d2[_0x5c7b('0x3d')];if(!_0x2f6776[_0x5c7b('0x3b')][_0x5c7b('0x41')]('nolimit')){_0x2f92b5[_0x5c7b('0x2e')]=qs['limit'](_0x2f6776[_0x5c7b('0x3b')][_0x5c7b('0x2e')]);_0x2f92b5[_0x5c7b('0x2d')]=qs['offset'](_0x2f6776[_0x5c7b('0x3b')][_0x5c7b('0x2d')]);}_0x2f92b5[_0x5c7b('0x42')]=qs[_0x5c7b('0x43')](_0x2f6776[_0x5c7b('0x3b')][_0x5c7b('0x43')]);_0x2f92b5[_0x5c7b('0x44')]=qs[_0x5c7b('0x3c')](_['pick'](_0x2f6776['query'],_0xe069d2[_0x5c7b('0x3c')]));if(_0x2f6776['query'][_0x5c7b('0x45')]){_0x2f92b5[_0x5c7b('0x44')]=_[_0x5c7b('0x46')](_0x2f92b5[_0x5c7b('0x44')],{'$or':_[_0x5c7b('0x47')](_0x2dc18f,function(_0x17f130){if(_0x17f130[_0x5c7b('0x48')][_0x5c7b('0x49')]!=='VIRTUAL'){var _0x2e1166={};_0x2e1166[_0x17f130['field']]={'$like':'%'+_0x2f6776[_0x5c7b('0x3b')][_0x5c7b('0x45')]+'%'};return _0x2e1166;}})});}_0x2f92b5=_[_0x5c7b('0x46')]({},_0x2f92b5,_0x2f6776['options']);var _0x150362={'where':_0x2f92b5[_0x5c7b('0x44')]};return db[_0x5c7b('0x39')]['count'](_0x150362)[_0x5c7b('0x1e')](function(_0x4bebbd){_0x53e237['count']=_0x4bebbd;if(_0x2f6776['query'][_0x5c7b('0x4a')]){_0x2f92b5[_0x5c7b('0x4b')]=[{'all':!![]}];}return db[_0x5c7b('0x39')]['findAll'](_0x2f92b5);})[_0x5c7b('0x1e')](function(_0x5a6352){_0x53e237[_0x5c7b('0x4c')]=_0x5a6352;return _0x53e237;})[_0x5c7b('0x1e')](respondWithFilteredResult(_0x3a354a,_0x2f92b5))[_0x5c7b('0x27')](handleError(_0x3a354a,null));};exports[_0x5c7b('0x4d')]=function(_0x26112b,_0x554ec0){var _0x5f3dcd={'raw':!![],'where':{'id':_0x26112b[_0x5c7b('0x4e')]['id']}},_0x45a07a={};_0x45a07a[_0x5c7b('0x3d')]=_[_0x5c7b('0x3a')](db[_0x5c7b('0x39')][_0x5c7b('0x4f')]);_0x45a07a['query']=_[_0x5c7b('0x3a')](_0x26112b['query']);_0x45a07a[_0x5c7b('0x3c')]=_[_0x5c7b('0x50')](_0x45a07a['model'],_0x45a07a['query']);_0x5f3dcd['attributes']=_[_0x5c7b('0x50')](_0x45a07a[_0x5c7b('0x3d')],qs[_0x5c7b('0x3f')](_0x26112b[_0x5c7b('0x3b')][_0x5c7b('0x3f')]));_0x5f3dcd['attributes']=_0x5f3dcd[_0x5c7b('0x3e')][_0x5c7b('0x40')]?_0x5f3dcd[_0x5c7b('0x3e')]:_0x45a07a[_0x5c7b('0x3d')];if(_0x26112b[_0x5c7b('0x3b')][_0x5c7b('0x4a')]){_0x5f3dcd['include']=[{'all':!![]}];}_0x5f3dcd=_[_0x5c7b('0x46')]({},_0x5f3dcd,_0x26112b['options']);return db[_0x5c7b('0x39')]['find'](_0x5f3dcd)['then'](handleEntityNotFound(_0x554ec0,null))[_0x5c7b('0x1e')](respondWithResult(_0x554ec0,null))[_0x5c7b('0x27')](handleError(_0x554ec0,null));};exports[_0x5c7b('0x51')]=function(_0x1f9df6,_0x16da2c){return db['OpenchannelMessage'][_0x5c7b('0x51')](_0x1f9df6[_0x5c7b('0x52')],{})[_0x5c7b('0x1e')](respondWithResult(_0x16da2c,0xc9))['catch'](handleError(_0x16da2c,null));};exports['update']=function(_0x56017e,_0x3c74f3){if(_0x56017e['body']['id']){delete _0x56017e[_0x5c7b('0x52')]['id'];}return db[_0x5c7b('0x39')][_0x5c7b('0x53')]({'where':{'id':_0x56017e[_0x5c7b('0x4e')]['id']}})[_0x5c7b('0x1e')](handleEntityNotFound(_0x3c74f3,null))[_0x5c7b('0x1e')](saveUpdates(_0x56017e[_0x5c7b('0x52')],null))[_0x5c7b('0x1e')](respondWithResult(_0x3c74f3,null))[_0x5c7b('0x27')](handleError(_0x3c74f3,null));};exports[_0x5c7b('0x35')]=function(_0x2e38cc,_0x4a2ecc){return db[_0x5c7b('0x39')]['find']({'where':{'id':_0x2e38cc[_0x5c7b('0x4e')]['id']}})[_0x5c7b('0x1e')](handleEntityNotFound(_0x4a2ecc,null))['then'](removeEntity(_0x4a2ecc,null))[_0x5c7b('0x27')](handleError(_0x4a2ecc,null));};exports[_0x5c7b('0x54')]=function(_0x14a01c,_0x4354c1){return db[_0x5c7b('0x39')][_0x5c7b('0x54')]()['then'](respondWithResult(_0x4354c1,null))[_0x5c7b('0x27')](handleError(_0x4354c1,null));};var interaction_log=require(_0x5c7b('0x55'))(_0x5c7b('0x56'));exports[_0x5c7b('0x57')]=function(_0xc25ea,_0x363d3a,_0x2bebc3){var _0x3ea4c6={'channel':_0x5c7b('0x58')};if(_0xc25ea[_0x5c7b('0x52')]['id']){delete _0xc25ea[_0x5c7b('0x52')]['id'];}_0xc25ea[_0x5c7b('0x52')][_0x5c7b('0x59')]=!![];_0xc25ea[_0x5c7b('0x52')]['readAt']=moment()[_0x5c7b('0x5a')](_0x5c7b('0x5b'));_0xc25ea[_0x5c7b('0x52')]['UserId']=_0xc25ea[_0x5c7b('0x52')]['UserId']||_0xc25ea[_0x5c7b('0x5c')]['id'];return db['OpenchannelMessage'][_0x5c7b('0x53')]({'where':{'id':_0xc25ea[_0x5c7b('0x4e')]['id'],'UserId':null},'include':[{'model':db[_0x5c7b('0x5d')],'as':'Contact'}]})[_0x5c7b('0x1e')](handleEntityNotFound(_0x363d3a,null))[_0x5c7b('0x1e')](saveUpdates(_0xc25ea[_0x5c7b('0x52')],null))['then'](function(_0x4a5d72){if(_0x4a5d72){_0x3ea4c6[_0x5c7b('0x25')]=_0x4a5d72['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x5c7b('0x53')]({'where':{'id':_0x4a5d72[_0x5c7b('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x363d3a,null))[_0x5c7b('0x1e')](function(_0x3aea5f){if(_0x3aea5f){return _0x3aea5f['update']({'UserId':_0xc25ea['body'][_0x5c7b('0x5f')],'read1stAt':_[_0x5c7b('0x60')](_0x3aea5f[_0x5c7b('0x61')])?moment()[_0x5c7b('0x5a')](_0x5c7b('0x5b')):undefined});}return null;})[_0x5c7b('0x1e')](function(_0x3cf2be){if(_0x3cf2be){_0x3ea4c6[_0x5c7b('0x62')]=_0x3cf2be['get']({'plain':!![]});interaction_log[_0x5c7b('0x1f')](_0x5c7b('0x63'),_0xc25ea[_0x5c7b('0x5c')]['id'],_0xc25ea['user']['name'],_0xc25ea[_0x5c7b('0x5c')][_0x5c7b('0x64')],_0x3ea4c6[_0x5c7b('0x62')]['id'],_0xc25ea[_0x5c7b('0x52')]?JSON['stringify'](_0xc25ea[_0x5c7b('0x52')]):_0x5c7b('0x65'));return respondWithRpcPromise('AcceptMessage',_0x5c7b('0x66'),_0x3ea4c6);}return null;})[_0x5c7b('0x1e')](function(_0x4b1b91){if(_0x4b1b91){if(_0xc25ea[_0x5c7b('0x52')][_0x5c7b('0x67')]){_0x3ea4c6[_0x5c7b('0x25')][_0x5c7b('0x68')]=util[_0x5c7b('0x5a')](_0x5c7b('0x69'),_0xc25ea[_0x5c7b('0x5c')][_0x5c7b('0x37')]);_0x3ea4c6[_0x5c7b('0x25')]['channel']=_0x3ea4c6['channel'];_0x3ea4c6[_0x5c7b('0x25')][_0x5c7b('0x6a')]='accept';return respondWithRpcPromise(_0x5c7b('0x6b'),_0x5c7b('0x6b'),{'event':_0x5c7b('0x6c'),'message':_0x3ea4c6[_0x5c7b('0x25')]},client9002)[_0x5c7b('0x1e')](function(){return _0x3ea4c6;});}return _0x3ea4c6;}return null;})['then'](respondWithResult(_0x363d3a,null))[_0x5c7b('0x27')](handleError(_0x363d3a,null));};var interaction_log=require(_0x5c7b('0x55'))(_0x5c7b('0x56'));exports[_0x5c7b('0x32')]=function(_0x2dfc35,_0x262df4,_0x1eef66){var _0x31dd3b={'agent':{},'channel':_0x5c7b('0x58')};if(_0x2dfc35[_0x5c7b('0x52')]['id']){delete _0x2dfc35['body']['id'];}_0x2dfc35[_0x5c7b('0x52')][_0x5c7b('0x5f')]=_0x2dfc35[_0x5c7b('0x52')]['UserId']||_0x2dfc35[_0x5c7b('0x5c')]['id'];_0x31dd3b[_0x5c7b('0x6d')]['id']=_0x2dfc35[_0x5c7b('0x52')][_0x5c7b('0x5f')];return db[_0x5c7b('0x39')][_0x5c7b('0x53')]({'where':{'id':_0x2dfc35[_0x5c7b('0x4e')]['id'],'UserId':null}})[_0x5c7b('0x1e')](handleEntityNotFound(_0x262df4,null))[_0x5c7b('0x1e')](function(_0x3d6f50){if(_0x3d6f50){_0x31dd3b[_0x5c7b('0x25')]=_0x3d6f50[_0x5c7b('0x6e')]({'plain':!![]});return db[_0x5c7b('0x6f')]['find']({'where':{'id':_0x3d6f50[_0x5c7b('0x5e')]}});}return null;})[_0x5c7b('0x1e')](handleEntityNotFound(_0x262df4,null))[_0x5c7b('0x1e')](function(_0x592873){if(_0x592873){_0x31dd3b[_0x5c7b('0x62')]=_0x592873[_0x5c7b('0x6e')]({'plain':!![]});interaction_log[_0x5c7b('0x1f')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2dfc35[_0x5c7b('0x5c')]['id'],_0x2dfc35[_0x5c7b('0x5c')]['name'],_0x2dfc35[_0x5c7b('0x5c')][_0x5c7b('0x64')],_0x31dd3b[_0x5c7b('0x62')]['id'],_0x2dfc35[_0x5c7b('0x52')]?JSON[_0x5c7b('0x22')](_0x2dfc35[_0x5c7b('0x52')]):'null');return respondWithRpcPromise(_0x5c7b('0x70'),'rejectMessage',_0x31dd3b);}return null;})[_0x5c7b('0x1e')](function(_0x5cd298){if(_0x5cd298){_0x5cd298[_0x5c7b('0x25')][_0x5c7b('0x68')]=util[_0x5c7b('0x5a')](_0x5c7b('0x69'),_0x2dfc35[_0x5c7b('0x5c')]['name']);_0x5cd298['message']['channel']=_0x31dd3b[_0x5c7b('0x71')];_0x5cd298[_0x5c7b('0x25')][_0x5c7b('0x6a')]=_0x5c7b('0x32');respondWithRpcPromise('EventManager',_0x5c7b('0x6b'),{'event':_0x5c7b('0x72'),'message':_0x5cd298[_0x5c7b('0x25')]},client9002);return _0x31dd3b;}return null;})[_0x5c7b('0x1e')](respondWithResult(_0x262df4,null))[_0x5c7b('0x27')](handleError(_0x262df4,null));}; \ No newline at end of file +var _0x540f=['code','error','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','end','count','offset','limit','status','set','apply','reject','save','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','catch','create','body','update','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','OpenchannelInteraction','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','acceptMessage','manual','event','EventManager','acceptmessage','agent','interaction','role','null','RejectMessage','SIP/%s','channel','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x143a91,_0x235332){var _0x1906f5=function(_0xd27eeb){while(--_0xd27eeb){_0x143a91['push'](_0x143a91['shift']());}};_0x1906f5(++_0x235332);}(_0x540f,0x1a7));var _0xf540=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x540f[_0x4629ed];return _0x52ca04;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf540('0x0'));var zipdir=require(_0xf540('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf540('0x2'));var moment=require(_0xf540('0x3'));var BPromise=require(_0xf540('0x4'));var Mustache=require(_0xf540('0x5'));var util=require(_0xf540('0x6'));var path=require(_0xf540('0x7'));var sox=require('sox');var csv=require(_0xf540('0x8'));var ejs=require(_0xf540('0x9'));var fs=require('fs');var _=require(_0xf540('0xa'));var squel=require('squel');var crypto=require(_0xf540('0xb'));var jsforce=require(_0xf540('0xc'));var deskjs=require(_0xf540('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf540('0xe'));var Papa=require(_0xf540('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf540('0x10'))(_0xf540('0x11'));var utils=require(_0xf540('0x12'));var config=require(_0xf540('0x13'));var db=require('../../mysqldb')['db'];config[_0xf540('0x14')]=_[_0xf540('0x15')](config[_0xf540('0x14')],{'host':_0xf540('0x16'),'port':0x18eb});var socket=require(_0xf540('0x17'))(new Redis(config[_0xf540('0x14')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf540('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf540('0x19')]({'port':0x232a});function checkPasswordPattern(_0xacb8e8,_0x4a074a,_0x45fe29){if(_0x45fe29){var _0x33d309=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33d309['test'](_0x4a074a)){return _0xacb8e8;}else{throw new Error(_0xf540('0x1a'));}}else{return _0xacb8e8;}}function respondWithRpcPromise(_0x4dcaa8,_0x4122c3,_0x2e8f16,_0xdc9fbc){return new BPromise(function(_0x1556da,_0x38bef2){var _0x42a09a=_0xdc9fbc||client;return _0x42a09a['request'](_0x4dcaa8,_0x2e8f16)[_0xf540('0x1b')](function(_0x720caa){logger[_0xf540('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x4122c3,_0xf540('0x1d'));logger[_0xf540('0x1e')](_0xf540('0x1f'),_0x4122c3,'request\x20sent',JSON[_0xf540('0x20')](_0x720caa));if(_0x720caa['error']){if(_0x720caa['error'][_0xf540('0x21')]===0x1f4){logger[_0xf540('0x22')](_0xf540('0x23'),_0x4122c3,_0x720caa[_0xf540('0x22')][_0xf540('0x24')]);return _0x38bef2(_0x720caa[_0xf540('0x22')]['message']);}logger[_0xf540('0x22')](_0xf540('0x23'),_0x4122c3,_0x720caa[_0xf540('0x22')]['message']);return _0x1556da(_0x720caa[_0xf540('0x22')]['message']);}else{logger[_0xf540('0x1c')](_0xf540('0x23'),_0x4122c3,_0xf540('0x1d'));_0x1556da(_0x720caa[_0xf540('0x25')]['message']);}})['catch'](function(_0x473fb5){logger[_0xf540('0x22')](_0xf540('0x23'),_0x4122c3,_0x473fb5);_0x38bef2(_0x473fb5);});});}function respondWithStatusCode(_0x409149,_0x59a6f8){_0x59a6f8=_0x59a6f8||0xcc;return function(_0x2288bf){if(_0x2288bf){return _0x409149[_0xf540('0x26')](_0x59a6f8);}return _0x409149['status'](_0x59a6f8)[_0xf540('0x27')]();};}function respondWithResult(_0x1e6276,_0x403f15){_0x403f15=_0x403f15||0xc8;return function(_0x50e582){if(_0x50e582){return _0x1e6276['status'](_0x403f15)['json'](_0x50e582);}};}function respondWithFilteredResult(_0x2e4c44,_0x15e401){return function(_0x5d04bf){if(_0x5d04bf){var _0x3f100e=_0x5d04bf[_0xf540('0x28')],_0x48c683=_0x15e401['offset'],_0x5c01c5=_0x15e401[_0xf540('0x29')]+_0x15e401[_0xf540('0x2a')],_0x3a6931;if(_0x5c01c5>=_0x3f100e){_0x5c01c5=_0x3f100e;_0x3a6931=0xc8;}else{_0x3a6931=0xce;}_0x2e4c44[_0xf540('0x2b')](_0x3a6931);return _0x2e4c44[_0xf540('0x2c')]('Content-Range',_0x48c683+'-'+_0x5c01c5+'/'+_0x3f100e)['json'](_0x5d04bf);}return null;};}function patchUpdates(_0x37f3d4){return function(_0x2ff1be){try{jsonpatch[_0xf540('0x2d')](_0x2ff1be,_0x37f3d4,!![]);}catch(_0xf6abf3){return BPromise[_0xf540('0x2e')](_0xf6abf3);}return _0x2ff1be[_0xf540('0x2f')]();};}function saveUpdates(_0x4f8d68,_0x14a88d){return function(_0x34d150){if(_0x34d150){return _0x34d150['update'](_0x4f8d68)['then'](function(_0xe9aa26){return _0xe9aa26;});}return null;};}function removeEntity(_0x5723c1,_0x4b7819){return function(_0x17ac35){if(_0x17ac35){return _0x17ac35[_0xf540('0x30')]()[_0xf540('0x1b')](function(){_0x5723c1[_0xf540('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x286866,_0x17320f){return function(_0x4cfb3b){if(!_0x4cfb3b){_0x286866[_0xf540('0x26')](0x194);}return _0x4cfb3b;};}function handleError(_0x391af0,_0x516bbb){_0x516bbb=_0x516bbb||0x1f4;return function(_0x296ff2){logger['error'](_0x296ff2[_0xf540('0x31')]);if(_0x296ff2[_0xf540('0x32')]){delete _0x296ff2[_0xf540('0x32')];}_0x391af0['status'](_0x516bbb)[_0xf540('0x33')](_0x296ff2);};}exports[_0xf540('0x34')]=function(_0x5cc26c,_0x38653b){var _0x2dd9d2={},_0x1f2815={},_0x29a2ac={'count':0x0,'rows':[]};var _0x184d57=db[_0xf540('0x35')][_0xf540('0x36')];_0x1f2815['model']=_[_0xf540('0x37')](_0x184d57);_0x1f2815[_0xf540('0x38')]=_['keys'](_0x5cc26c[_0xf540('0x38')]);_0x1f2815[_0xf540('0x39')]=_[_0xf540('0x3a')](_0x1f2815[_0xf540('0x3b')],_0x1f2815[_0xf540('0x38')]);_0x2dd9d2[_0xf540('0x3c')]=_[_0xf540('0x3a')](_0x1f2815[_0xf540('0x3b')],qs[_0xf540('0x3d')](_0x5cc26c['query']['fields']));_0x2dd9d2[_0xf540('0x3c')]=_0x2dd9d2[_0xf540('0x3c')][_0xf540('0x3e')]?_0x2dd9d2[_0xf540('0x3c')]:_0x1f2815[_0xf540('0x3b')];if(!_0x5cc26c[_0xf540('0x38')][_0xf540('0x3f')]('nolimit')){_0x2dd9d2[_0xf540('0x2a')]=qs[_0xf540('0x2a')](_0x5cc26c['query'][_0xf540('0x2a')]);_0x2dd9d2[_0xf540('0x29')]=qs[_0xf540('0x29')](_0x5cc26c['query'][_0xf540('0x29')]);}_0x2dd9d2[_0xf540('0x40')]=qs[_0xf540('0x41')](_0x5cc26c['query'][_0xf540('0x41')]);_0x2dd9d2['where']=qs[_0xf540('0x39')](_[_0xf540('0x42')](_0x5cc26c['query'],_0x1f2815['filters']));if(_0x5cc26c['query'][_0xf540('0x43')]){_0x2dd9d2[_0xf540('0x44')]=_[_0xf540('0x45')](_0x2dd9d2[_0xf540('0x44')],{'$or':_[_0xf540('0x46')](_0x184d57,function(_0x13c699){if(_0x13c699[_0xf540('0x47')][_0xf540('0x48')]!==_0xf540('0x49')){var _0x298318={};_0x298318[_0x13c699[_0xf540('0x4a')]]={'$like':'%'+_0x5cc26c[_0xf540('0x38')]['filter']+'%'};return _0x298318;}})});}_0x2dd9d2=_[_0xf540('0x45')]({},_0x2dd9d2,_0x5cc26c[_0xf540('0x4b')]);var _0x17e88e={'where':_0x2dd9d2[_0xf540('0x44')]};return db[_0xf540('0x35')][_0xf540('0x28')](_0x17e88e)['then'](function(_0x474ec7){_0x29a2ac[_0xf540('0x28')]=_0x474ec7;if(_0x5cc26c[_0xf540('0x38')][_0xf540('0x4c')]){_0x2dd9d2[_0xf540('0x4d')]=[{'all':!![]}];}return db[_0xf540('0x35')][_0xf540('0x4e')](_0x2dd9d2);})[_0xf540('0x1b')](function(_0x26863a){_0x29a2ac[_0xf540('0x4f')]=_0x26863a;return _0x29a2ac;})[_0xf540('0x1b')](respondWithFilteredResult(_0x38653b,_0x2dd9d2))['catch'](handleError(_0x38653b,null));};exports['show']=function(_0x2d4122,_0x11ecfc){var _0x1cf71c={'raw':!![],'where':{'id':_0x2d4122[_0xf540('0x50')]['id']}},_0x139bf1={};_0x139bf1[_0xf540('0x3b')]=_[_0xf540('0x37')](db['OpenchannelMessage']['rawAttributes']);_0x139bf1[_0xf540('0x38')]=_['keys'](_0x2d4122[_0xf540('0x38')]);_0x139bf1[_0xf540('0x39')]=_[_0xf540('0x3a')](_0x139bf1[_0xf540('0x3b')],_0x139bf1[_0xf540('0x38')]);_0x1cf71c[_0xf540('0x3c')]=_['intersection'](_0x139bf1[_0xf540('0x3b')],qs[_0xf540('0x3d')](_0x2d4122[_0xf540('0x38')]['fields']));_0x1cf71c['attributes']=_0x1cf71c[_0xf540('0x3c')][_0xf540('0x3e')]?_0x1cf71c[_0xf540('0x3c')]:_0x139bf1['model'];if(_0x2d4122[_0xf540('0x38')][_0xf540('0x4c')]){_0x1cf71c[_0xf540('0x4d')]=[{'all':!![]}];}_0x1cf71c=_[_0xf540('0x45')]({},_0x1cf71c,_0x2d4122[_0xf540('0x4b')]);return db[_0xf540('0x35')][_0xf540('0x51')](_0x1cf71c)['then'](handleEntityNotFound(_0x11ecfc,null))[_0xf540('0x1b')](respondWithResult(_0x11ecfc,null))[_0xf540('0x52')](handleError(_0x11ecfc,null));};exports[_0xf540('0x53')]=function(_0x3c3768,_0x49f92c){return db[_0xf540('0x35')][_0xf540('0x53')](_0x3c3768[_0xf540('0x54')],{})['then'](respondWithResult(_0x49f92c,0xc9))[_0xf540('0x52')](handleError(_0x49f92c,null));};exports[_0xf540('0x55')]=function(_0xa7745e,_0x2323db){if(_0xa7745e[_0xf540('0x54')]['id']){delete _0xa7745e['body']['id'];}return db[_0xf540('0x35')][_0xf540('0x51')]({'where':{'id':_0xa7745e[_0xf540('0x50')]['id']}})[_0xf540('0x1b')](handleEntityNotFound(_0x2323db,null))[_0xf540('0x1b')](saveUpdates(_0xa7745e[_0xf540('0x54')],null))[_0xf540('0x1b')](respondWithResult(_0x2323db,null))['catch'](handleError(_0x2323db,null));};exports[_0xf540('0x30')]=function(_0x2bd8dc,_0x3ec730){return db[_0xf540('0x35')][_0xf540('0x51')]({'where':{'id':_0x2bd8dc['params']['id']}})['then'](handleEntityNotFound(_0x3ec730,null))[_0xf540('0x1b')](removeEntity(_0x3ec730,null))['catch'](handleError(_0x3ec730,null));};exports[_0xf540('0x56')]=function(_0x17cbec,_0x5ae568){return db[_0xf540('0x35')][_0xf540('0x56')]()[_0xf540('0x1b')](respondWithResult(_0x5ae568,null))[_0xf540('0x52')](handleError(_0x5ae568,null));};var interaction_log=require('../../config/logger')(_0xf540('0x57'));exports[_0xf540('0x58')]=function(_0x5de1d2,_0x3e78f2,_0x28a7b4){var _0x2835bf={'channel':_0xf540('0x59')};if(_0x5de1d2[_0xf540('0x54')]['id']){delete _0x5de1d2[_0xf540('0x54')]['id'];}_0x5de1d2['body'][_0xf540('0x5a')]=!![];_0x5de1d2[_0xf540('0x54')][_0xf540('0x5b')]=moment()[_0xf540('0x5c')](_0xf540('0x5d'));_0x5de1d2[_0xf540('0x54')][_0xf540('0x5e')]=_0x5de1d2[_0xf540('0x54')][_0xf540('0x5e')]||_0x5de1d2['user']['id'];return db[_0xf540('0x35')][_0xf540('0x51')]({'where':{'id':_0x5de1d2['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xf540('0x5f')}]})[_0xf540('0x1b')](handleEntityNotFound(_0x3e78f2,null))['then'](saveUpdates(_0x5de1d2[_0xf540('0x54')],null))['then'](function(_0x9c664a){if(_0x9c664a){_0x2835bf[_0xf540('0x24')]=_0x9c664a[_0xf540('0x60')]({'plain':!![]});return db[_0xf540('0x61')][_0xf540('0x51')]({'where':{'id':_0x9c664a['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3e78f2,null))['then'](function(_0x4d62f7){if(_0x4d62f7){return _0x4d62f7[_0xf540('0x55')]({'UserId':_0x5de1d2[_0xf540('0x54')][_0xf540('0x5e')],'read1stAt':_[_0xf540('0x62')](_0x4d62f7[_0xf540('0x63')])?moment()[_0xf540('0x5c')](_0xf540('0x5d')):undefined});}return null;})['then'](function(_0x16a349){if(_0x16a349){_0x2835bf['interaction']=_0x16a349[_0xf540('0x60')]({'plain':!![]});interaction_log['info'](_0xf540('0x64'),_0x5de1d2[_0xf540('0x65')]['id'],_0x5de1d2[_0xf540('0x65')][_0xf540('0x32')],_0x5de1d2[_0xf540('0x65')]['role'],_0x2835bf['interaction']['id'],_0x5de1d2['body']?JSON[_0xf540('0x20')](_0x5de1d2[_0xf540('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0xf540('0x66'),_0x2835bf);}return null;})[_0xf540('0x1b')](function(_0x284936){if(_0x284936){if(_0x5de1d2[_0xf540('0x54')][_0xf540('0x67')]){_0x2835bf[_0xf540('0x24')]['interface']=util[_0xf540('0x5c')]('SIP/%s',_0x5de1d2[_0xf540('0x65')]['name']);_0x2835bf[_0xf540('0x24')]['channel']=_0x2835bf['channel'];_0x2835bf[_0xf540('0x24')][_0xf540('0x68')]=_0xf540('0x58');return respondWithRpcPromise('EventManager',_0xf540('0x69'),{'event':_0xf540('0x6a'),'message':_0x2835bf[_0xf540('0x24')]},client9002)[_0xf540('0x1b')](function(){return _0x2835bf;});}return _0x2835bf;}return null;})[_0xf540('0x1b')](respondWithResult(_0x3e78f2,null))[_0xf540('0x52')](handleError(_0x3e78f2,null));};var interaction_log=require('../../config/logger')(_0xf540('0x57'));exports[_0xf540('0x2e')]=function(_0x1062a0,_0x2bd552,_0x143957){var _0x5ea89f={'agent':{},'channel':_0xf540('0x59')};if(_0x1062a0[_0xf540('0x54')]['id']){delete _0x1062a0[_0xf540('0x54')]['id'];}_0x1062a0[_0xf540('0x54')][_0xf540('0x5e')]=_0x1062a0[_0xf540('0x54')]['UserId']||_0x1062a0['user']['id'];_0x5ea89f[_0xf540('0x6b')]['id']=_0x1062a0['body'][_0xf540('0x5e')];return db[_0xf540('0x35')][_0xf540('0x51')]({'where':{'id':_0x1062a0[_0xf540('0x50')]['id'],'UserId':null}})[_0xf540('0x1b')](handleEntityNotFound(_0x2bd552,null))[_0xf540('0x1b')](function(_0x500b4c){if(_0x500b4c){_0x5ea89f[_0xf540('0x24')]=_0x500b4c['get']({'plain':!![]});return db[_0xf540('0x61')][_0xf540('0x51')]({'where':{'id':_0x500b4c['OpenchannelInteractionId']}});}return null;})[_0xf540('0x1b')](handleEntityNotFound(_0x2bd552,null))[_0xf540('0x1b')](function(_0x4bc75b){if(_0x4bc75b){_0x5ea89f[_0xf540('0x6c')]=_0x4bc75b[_0xf540('0x60')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1062a0[_0xf540('0x65')]['id'],_0x1062a0['user'][_0xf540('0x32')],_0x1062a0[_0xf540('0x65')][_0xf540('0x6d')],_0x5ea89f[_0xf540('0x6c')]['id'],_0x1062a0[_0xf540('0x54')]?JSON['stringify'](_0x1062a0[_0xf540('0x54')]):_0xf540('0x6e'));return respondWithRpcPromise(_0xf540('0x6f'),'rejectMessage',_0x5ea89f);}return null;})['then'](function(_0x21f6c6){if(_0x21f6c6){_0x21f6c6['message']['interface']=util[_0xf540('0x5c')](_0xf540('0x70'),_0x1062a0[_0xf540('0x65')][_0xf540('0x32')]);_0x21f6c6['message'][_0xf540('0x71')]=_0x5ea89f['channel'];_0x21f6c6[_0xf540('0x24')][_0xf540('0x68')]=_0xf540('0x2e');respondWithRpcPromise(_0xf540('0x69'),_0xf540('0x69'),{'event':'rejectmessage','message':_0x21f6c6[_0xf540('0x24')]},client9002);return _0x5ea89f;}return null;})[_0xf540('0x1b')](respondWithResult(_0x2bd552,null))[_0xf540('0x52')](handleError(_0x2bd552,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index a7e47a4..e11e477 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 _0x5e66=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x386f94,_0x83a1fd){var _0x95909b=function(_0xb0bd2c){while(--_0xb0bd2c){_0x386f94['push'](_0x386f94['shift']());}};_0x95909b(++_0x83a1fd);}(_0x5e66,0xd6));var _0x65e6=function(_0xf765b6,_0x2033e2){_0xf765b6=_0xf765b6-0x0;var _0x493102=_0x5e66[_0xf765b6];return _0x493102;};'use strict';var EventEmitter=require(_0x65e6('0x0'));var OpenchannelMessage=require(_0x65e6('0x1'))['db'][_0x65e6('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x65e6('0x3')](0x0);var events={'afterCreate':_0x65e6('0x4'),'afterUpdate':_0x65e6('0x5'),'afterDestroy':_0x65e6('0x6')};function emitEvent(_0x1b1761){return function(_0x3a2743,_0x43546b,_0x28b924){OpenchannelMessageEvents['emit'](_0x1b1761+':'+_0x3a2743['id'],_0x3a2743);OpenchannelMessageEvents[_0x65e6('0x7')](_0x1b1761,_0x3a2743);_0x28b924(null);};}for(var e in events){if(events[_0x65e6('0x8')](e)){var event=events[e];OpenchannelMessage[_0x65e6('0x9')](e,emitEvent(event));}}module[_0x65e6('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x9474=['exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x9474,0x164));var _0x4947=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x9474[_0x3054be];return _0x3df150;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x4947('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4947('0x1')](0x0);var events={'afterCreate':_0x4947('0x2'),'afterUpdate':_0x4947('0x3'),'afterDestroy':'remove'};function emitEvent(_0x30d905){return function(_0x2d0d2e,_0x162f4e,_0x358812){OpenchannelMessageEvents['emit'](_0x30d905+':'+_0x2d0d2e['id'],_0x2d0d2e);OpenchannelMessageEvents['emit'](_0x30d905,_0x2d0d2e);_0x358812(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x4947('0x4')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 51f36d9..a535539 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 _0xa7dd=['inspect','finally','utf8mb4','lodash','util','api','moment','request-promise','path','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteractionId','then','update','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','CmContact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Interactions','length','Interaction','Contact','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','OpenchannelInteraction'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa7dd,0xc7));var _0xda7d=function(_0x454c94,_0x39faf5){_0x454c94=_0x454c94-0x0;var _0xa64cbf=_0xa7dd[_0x454c94];return _0xa64cbf;};'use strict';var _=require(_0xda7d('0x0'));var util=require(_0xda7d('0x1'));var logger=require('../../config/logger')(_0xda7d('0x2'));var moment=require(_0xda7d('0x3'));var BPromise=require('bluebird');var rp=require(_0xda7d('0x4'));var fs=require('fs');var path=require(_0xda7d('0x5'));var rimraf=require('rimraf');var config=require(_0xda7d('0x6'));var attributes=require(_0xda7d('0x7'));module['exports']=function(_0x360b52,_0x5acf24){return _0x360b52[_0xda7d('0x8')](_0xda7d('0x9'),attributes,{'tableName':_0xda7d('0xa'),'paranoid':![],'indexes':[{'name':_0xda7d('0xb'),'fields':['body'],'type':_0xda7d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2159ca,_0x3f436e,_0x3f5628){var _0x49c078=_0x360b52[_0xda7d('0xd')];var _0x1bd8a8=_0x2159ca[_0xda7d('0xe')]({'plain':!![]});if(_0x1bd8a8[_0xda7d('0xf')][_0xda7d('0x10')]()==='in'||_0x1bd8a8[_0xda7d('0xf')][_0xda7d('0x10')]()===_0xda7d('0x11')&&!_0x1bd8a8[_0xda7d('0x12')]&&!_[_0xda7d('0x13')](_0x1bd8a8['UserId'])){_0x49c078['OpenchannelInteraction']['findOne']({'where':{'id':_0x1bd8a8[_0xda7d('0x14')]}})[_0xda7d('0x15')](function(_0x52dc1b){if(_0x52dc1b){_0x52dc1b[_0xda7d('0x16')]({'lastMsgAt':_0x1bd8a8[_0xda7d('0x17')],'lastMsgDirection':_0x1bd8a8[_0xda7d('0xf')][_0xda7d('0x10')]()});}})[_0xda7d('0x18')](function(_0x423c5a){console[_0xda7d('0x19')](_0x423c5a);});}if(_0x1bd8a8[_0xda7d('0xf')]===_0xda7d('0x11')&&!_0x1bd8a8['secret']){var _0x13f8c4;_0x49c078['CmContact']['describe']()['then'](function(_0x2ea549){return _0x49c078[_0xda7d('0x1a')][_0xda7d('0x1b')]({'where':{'id':_0x1bd8a8[_0xda7d('0x1c')]},'include':[{'model':_0x49c078['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x1bd8a8[_0xda7d('0x14')]},'limit':0x1,'include':[{'model':_0x49c078[_0xda7d('0x1d')],'as':'Contact','attributes':_['keys'](_0x2ea549)}]}]});})[_0xda7d('0x15')](function(_0x5b9170){_0x13f8c4=_0x5b9170['get']({'plain':!![]});if(_0x13f8c4&&_0x13f8c4[_0xda7d('0x1e')]){logger[_0xda7d('0x1f')](_0xda7d('0x20'),'afterCreate',util[_0xda7d('0x21')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x1bd8a8['id'],_0x13f8c4[_0xda7d('0x1e')]));if(_0x13f8c4[_0xda7d('0x22')]&&_0x13f8c4[_0xda7d('0x22')][_0xda7d('0x23')]){_0x1bd8a8[_0xda7d('0x24')]=_['omit'](_0x13f8c4['Interactions'][0x0],_0xda7d('0x25'));_0x1bd8a8[_0xda7d('0x25')]=_0x13f8c4[_0xda7d('0x22')][0x0][_0xda7d('0x25')];}var _0x3f436e={'method':_0xda7d('0x26'),'uri':encodeURI(_0x13f8c4[_0xda7d('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3f436e[_0xda7d('0x27')]){case _0xda7d('0x28'):_0x3f436e['qs']=_0x1bd8a8;break;case _0xda7d('0x26'):_0x3f436e['body']=_0x1bd8a8;break;}return rp(_0x3f436e)['then'](function(_0x396624){logger[_0xda7d('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0xda7d('0x29'),util[_0xda7d('0x21')](_0xda7d('0x2a'),_0x1bd8a8['id'],_0x13f8c4[_0xda7d('0x1e')]));if(_0x396624[_0xda7d('0x2b')][_0xda7d('0x2c')]&&_0x396624[_0xda7d('0x2b')][_0xda7d('0x2c')]!=_0x1bd8a8['Interaction'][_0xda7d('0x2c')]){return _0x49c078[_0xda7d('0x2d')][_0xda7d('0x16')]({'threadId':_0x396624[_0xda7d('0x2b')][_0xda7d('0x2c')]},{'logging':!![],'where':{'id':_0x1bd8a8[_0xda7d('0x24')]['id']}});}else{return;}})[_0xda7d('0x15')](function(){return _0x2159ca[_0xda7d('0x16')]({'read':!![]});})[_0xda7d('0x18')](function(_0x5cc6bd){logger[_0xda7d('0x19')](_0xda7d('0x20'),'afterCreate',util[_0xda7d('0x2e')](_0x5cc6bd,{'showHidden':![],'depth':null}));_0x3f5628();});}else{_0x3f5628();}})[_0xda7d('0x2f')](function(){_0x3f5628();});}else{_0x3f5628();}}},'charset':_0xda7d('0x30'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf748=['bluebird','path','rimraf','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','toLowerCase','direction','out','secret','UserId','OpenchannelInteraction','findOne','then','update','createdAt','error','CmContact','describe','find','OpenchannelAccountId','Interactions','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','Contact','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','lodash','util','../../config/logger','moment'];(function(_0x43cb34,_0x505cca){var _0x460ffa=function(_0x5ceb86){while(--_0x5ceb86){_0x43cb34['push'](_0x43cb34['shift']());}};_0x460ffa(++_0x505cca);}(_0xf748,0xa8));var _0x8f74=function(_0x29c3b9,_0x4adaf7){_0x29c3b9=_0x29c3b9-0x0;var _0x637286=_0xf748[_0x29c3b9];return _0x637286;};'use strict';var _=require(_0x8f74('0x0'));var util=require(_0x8f74('0x1'));var logger=require(_0x8f74('0x2'))('api');var moment=require(_0x8f74('0x3'));var BPromise=require(_0x8f74('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f74('0x5'));var rimraf=require(_0x8f74('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x1bd0a3,_0x2ccac0){return _0x1bd0a3['define'](_0x8f74('0x7'),attributes,{'tableName':_0x8f74('0x8'),'paranoid':![],'indexes':[{'name':_0x8f74('0x9'),'fields':[_0x8f74('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x167607,_0x19cf03,_0x546d60){var _0x33c2d5=_0x1bd0a3[_0x8f74('0xb')];var _0x48c238=_0x167607[_0x8f74('0xc')]({'plain':!![]});if(_0x48c238['direction'][_0x8f74('0xd')]()==='in'||_0x48c238[_0x8f74('0xe')]['toLowerCase']()===_0x8f74('0xf')&&!_0x48c238[_0x8f74('0x10')]&&!_['isNil'](_0x48c238[_0x8f74('0x11')])){_0x33c2d5[_0x8f74('0x12')][_0x8f74('0x13')]({'where':{'id':_0x48c238['OpenchannelInteractionId']}})[_0x8f74('0x14')](function(_0x1ce4b2){if(_0x1ce4b2){_0x1ce4b2[_0x8f74('0x15')]({'lastMsgAt':_0x48c238[_0x8f74('0x16')],'lastMsgDirection':_0x48c238[_0x8f74('0xe')][_0x8f74('0xd')]()});}})['catch'](function(_0x5fe120){console[_0x8f74('0x17')](_0x5fe120);});}if(_0x48c238[_0x8f74('0xe')]===_0x8f74('0xf')&&!_0x48c238[_0x8f74('0x10')]){var _0x52930a;_0x33c2d5[_0x8f74('0x18')][_0x8f74('0x19')]()[_0x8f74('0x14')](function(_0x5baf24){return _0x33c2d5['OpenchannelAccount'][_0x8f74('0x1a')]({'where':{'id':_0x48c238[_0x8f74('0x1b')]},'include':[{'model':_0x33c2d5[_0x8f74('0x12')],'as':_0x8f74('0x1c'),'where':{'id':_0x48c238['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x33c2d5[_0x8f74('0x18')],'as':'Contact','attributes':_[_0x8f74('0x1d')](_0x5baf24)}]}]});})[_0x8f74('0x14')](function(_0x3b3511){_0x52930a=_0x3b3511['get']({'plain':!![]});if(_0x52930a&&_0x52930a[_0x8f74('0x1e')]){logger['info'](_0x8f74('0x1f'),'afterCreate',util[_0x8f74('0x20')](_0x8f74('0x21'),_0x48c238['id'],_0x52930a[_0x8f74('0x1e')]));if(_0x52930a[_0x8f74('0x1c')]&&_0x52930a[_0x8f74('0x1c')]['length']){_0x48c238[_0x8f74('0x22')]=_['omit'](_0x52930a[_0x8f74('0x1c')][0x0],_0x8f74('0x23'));_0x48c238['Contact']=_0x52930a[_0x8f74('0x1c')][0x0][_0x8f74('0x23')];}var _0x19cf03={'method':_0x8f74('0x24'),'uri':encodeURI(_0x52930a[_0x8f74('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x19cf03[_0x8f74('0x25')]){case _0x8f74('0x26'):_0x19cf03['qs']=_0x48c238;break;case _0x8f74('0x24'):_0x19cf03['body']=_0x48c238;break;}return rp(_0x19cf03)['then'](function(_0xfd0f94){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8f74('0x27'),util[_0x8f74('0x20')](_0x8f74('0x28'),_0x48c238['id'],_0x52930a[_0x8f74('0x1e')]));if(_0xfd0f94[_0x8f74('0xa')][_0x8f74('0x29')]&&_0xfd0f94['body'][_0x8f74('0x29')]!=_0x48c238[_0x8f74('0x22')][_0x8f74('0x29')]){return _0x33c2d5['OpenchannelInteraction'][_0x8f74('0x15')]({'threadId':_0xfd0f94['body'][_0x8f74('0x29')]},{'logging':!![],'where':{'id':_0x48c238[_0x8f74('0x22')]['id']}});}else{return;}})['then'](function(){return _0x167607[_0x8f74('0x15')]({'read':!![]});})['catch'](function(_0x2c6bbf){logger[_0x8f74('0x17')](_0x8f74('0x1f'),_0x8f74('0x27'),util[_0x8f74('0x2a')](_0x2c6bbf,{'showHidden':![],'depth':null}));_0x546d60();});}else{_0x546d60();}})['finally'](function(){_0x546d60();});}else{_0x546d60();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 9485d2c..6d6f65f 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 _0xf326=['catch','create','body','options','raw','CreateOpenchannelMessage','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0x4d2938,_0x332d65){var _0x5e7d9b=function(_0x135e24){while(--_0x135e24){_0x4d2938['push'](_0x4d2938['shift']());}};_0x5e7d9b(++_0x332d65);}(_0xf326,0x17d));var _0x6f32=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0xf326[_0x64aff8];return _0x5488a3;};'use strict';var _=require('lodash');var util=require(_0x6f32('0x0'));var moment=require(_0x6f32('0x1'));var BPromise=require(_0x6f32('0x2'));var rs=require(_0x6f32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f32('0x4'))['db'];var utils=require(_0x6f32('0x5'));var logger=require(_0x6f32('0x6'))(_0x6f32('0x7'));var config=require(_0x6f32('0x8'));var jayson=require(_0x6f32('0x9'));var client=jayson[_0x6f32('0xa')][_0x6f32('0xb')]({'port':0x232a});config[_0x6f32('0xc')]=_['defaults'](config[_0x6f32('0xc')],{'host':_0x6f32('0xd'),'port':0x18eb});var socket=require(_0x6f32('0xe'))(new Redis(config[_0x6f32('0xc')]));require(_0x6f32('0xf'))[_0x6f32('0x10')](socket);function respondWithRpcPromise(_0x4fc31c,_0x3c240f,_0x58d673){return new BPromise(function(_0x320e6b,_0x160676){return client[_0x6f32('0x11')](_0x4fc31c,_0x58d673)[_0x6f32('0x12')](function(_0x391421){logger['info'](_0x6f32('0x13'),_0x3c240f,_0x6f32('0x14'));logger[_0x6f32('0x15')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3c240f,_0x6f32('0x14'),JSON['stringify'](_0x391421));if(_0x391421['error']){if(_0x391421[_0x6f32('0x16')][_0x6f32('0x17')]===0x1f4){logger[_0x6f32('0x16')](_0x6f32('0x13'),_0x3c240f,_0x391421[_0x6f32('0x16')][_0x6f32('0x18')]);return _0x160676(_0x391421[_0x6f32('0x16')][_0x6f32('0x18')]);}logger[_0x6f32('0x16')](_0x6f32('0x13'),_0x3c240f,_0x391421[_0x6f32('0x16')][_0x6f32('0x18')]);return _0x320e6b(_0x391421[_0x6f32('0x16')]['message']);}else{logger[_0x6f32('0x19')](_0x6f32('0x13'),_0x3c240f,'request\x20sent');_0x320e6b(_0x391421[_0x6f32('0x1a')][_0x6f32('0x18')]);}})[_0x6f32('0x1b')](function(_0x21cd25){logger[_0x6f32('0x16')](_0x6f32('0x13'),_0x3c240f,_0x21cd25);_0x160676(_0x21cd25);});});}exports['CreateOpenchannelMessage']=function(_0x25d9df){var _0x216b95=this;return new Promise(function(_0x1443d7,_0x5b3886){return db['OpenchannelMessage'][_0x6f32('0x1c')](_0x25d9df[_0x6f32('0x1d')],{'raw':_0x25d9df[_0x6f32('0x1e')]?_0x25d9df[_0x6f32('0x1e')][_0x6f32('0x1f')]===undefined?!![]:![]:!![]})[_0x6f32('0x12')](function(_0x515802){logger[_0x6f32('0x19')](_0x6f32('0x20'),_0x25d9df);logger['debug'](_0x6f32('0x20'),_0x25d9df,JSON[_0x6f32('0x21')](_0x515802));_0x1443d7(_0x515802);})[_0x6f32('0x1b')](function(_0x3aeabb){logger['error']('CreateOpenchannelMessage',_0x3aeabb[_0x6f32('0x18')],_0x25d9df);_0x5b3886(_0x216b95[_0x6f32('0x16')](0x1f4,_0x3aeabb[_0x6f32('0x18')]));});});}; \ No newline at end of file +var _0x3d30=['./openchannelMessage.socket','register','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','create','options','raw','then','CreateOpenchannelMessage','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x398d85,_0x2465d7){var _0x33c2bb=function(_0x4aa229){while(--_0x4aa229){_0x398d85['push'](_0x398d85['shift']());}};_0x33c2bb(++_0x2465d7);}(_0x3d30,0x6a));var _0x03d3=function(_0x43257,_0x47ef52){_0x43257=_0x43257-0x0;var _0x3c78df=_0x3d30[_0x43257];return _0x3c78df;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x03d3('0x0'));var BPromise=require('bluebird');var rs=require(_0x03d3('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x03d3('0x2'));var logger=require('../../config/logger')(_0x03d3('0x3'));var config=require(_0x03d3('0x4'));var jayson=require(_0x03d3('0x5'));var client=jayson[_0x03d3('0x6')][_0x03d3('0x7')]({'port':0x232a});config[_0x03d3('0x8')]=_['defaults'](config[_0x03d3('0x8')],{'host':_0x03d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03d3('0x8')]));require(_0x03d3('0xa'))[_0x03d3('0xb')](socket);function respondWithRpcPromise(_0x3b5148,_0x31c272,_0x11f4a3){return new BPromise(function(_0x3679a5,_0x18fb9b){return client[_0x03d3('0xc')](_0x3b5148,_0x11f4a3)['then'](function(_0x47c708){logger['info'](_0x03d3('0xd'),_0x31c272,_0x03d3('0xe'));logger[_0x03d3('0xf')](_0x03d3('0x10'),_0x31c272,_0x03d3('0xe'),JSON[_0x03d3('0x11')](_0x47c708));if(_0x47c708['error']){if(_0x47c708[_0x03d3('0x12')][_0x03d3('0x13')]===0x1f4){logger[_0x03d3('0x12')](_0x03d3('0xd'),_0x31c272,_0x47c708['error'][_0x03d3('0x14')]);return _0x18fb9b(_0x47c708[_0x03d3('0x12')]['message']);}logger[_0x03d3('0x12')](_0x03d3('0xd'),_0x31c272,_0x47c708[_0x03d3('0x12')][_0x03d3('0x14')]);return _0x3679a5(_0x47c708['error'][_0x03d3('0x14')]);}else{logger[_0x03d3('0x15')](_0x03d3('0xd'),_0x31c272,_0x03d3('0xe'));_0x3679a5(_0x47c708['result'][_0x03d3('0x14')]);}})[_0x03d3('0x16')](function(_0x4bed38){logger[_0x03d3('0x12')](_0x03d3('0xd'),_0x31c272,_0x4bed38);_0x18fb9b(_0x4bed38);});});}exports['CreateOpenchannelMessage']=function(_0x57e294){var _0x313b5c=this;return new Promise(function(_0x157632,_0x1f1cb9){return db[_0x03d3('0x17')][_0x03d3('0x18')](_0x57e294['body'],{'raw':_0x57e294[_0x03d3('0x19')]?_0x57e294[_0x03d3('0x19')][_0x03d3('0x1a')]===undefined?!![]:![]:!![]})[_0x03d3('0x1b')](function(_0x421660){logger[_0x03d3('0x15')](_0x03d3('0x1c'),_0x57e294);logger[_0x03d3('0xf')](_0x03d3('0x1c'),_0x57e294,JSON[_0x03d3('0x11')](_0x421660));_0x157632(_0x421660);})[_0x03d3('0x16')](function(_0x4c95a1){logger[_0x03d3('0x12')](_0x03d3('0x1c'),_0x4c95a1[_0x03d3('0x14')],_0x57e294);_0x1f1cb9(_0x313b5c[_0x03d3('0x12')](0x1f4,_0x4c95a1[_0x03d3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 9435767..3c6ca8c 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 _0x3248=['remove','update','removeListener','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x14915a,_0x222f6b){var _0x2f683c=function(_0x28e694){while(--_0x28e694){_0x14915a['push'](_0x14915a['shift']());}};_0x2f683c(++_0x222f6b);}(_0x3248,0x1b0));var _0x8324=function(_0x42513e,_0x5a90e2){_0x42513e=_0x42513e-0x0;var _0x5caeb7=_0x3248[_0x42513e];return _0x5caeb7;};'use strict';var OpenchannelMessageEvents=require(_0x8324('0x0'));var events=[_0x8324('0x1'),_0x8324('0x2'),_0x8324('0x3')];function createListener(_0x9b580,_0x23b671){return function(_0x3ab598){_0x23b671['emit'](_0x9b580,_0x3ab598);};}function removeListener(_0x4c565b,_0x2e46f3){return function(){OpenchannelMessageEvents[_0x8324('0x4')](_0x4c565b,_0x2e46f3);};}exports['register']=function(_0x18edd2){for(var _0x283f5f=0x0,_0x446423=events[_0x8324('0x5')];_0x283f5f<_0x446423;_0x283f5f++){var _0x215c15=events[_0x283f5f];var _0x5d5f01=createListener(_0x8324('0x6')+_0x215c15,_0x18edd2);OpenchannelMessageEvents['on'](_0x215c15,_0x5d5f01);}}; \ No newline at end of file +var _0x8375=['./openchannelMessage.events','save','remove','emit','register','length','openchannelMessage:'];(function(_0x2ba15d,_0x5d440e){var _0x14e27a=function(_0x2bb86d){while(--_0x2bb86d){_0x2ba15d['push'](_0x2ba15d['shift']());}};_0x14e27a(++_0x5d440e);}(_0x8375,0xa8));var _0x5837=function(_0x465db9,_0x24ce0d){_0x465db9=_0x465db9-0x0;var _0x5ee67d=_0x8375[_0x465db9];return _0x5ee67d;};'use strict';var OpenchannelMessageEvents=require(_0x5837('0x0'));var events=[_0x5837('0x1'),_0x5837('0x2'),'update'];function createListener(_0x24c393,_0x181ec3){return function(_0x86f16a){_0x181ec3[_0x5837('0x3')](_0x24c393,_0x86f16a);};}function removeListener(_0x317452,_0x1edfc5){return function(){OpenchannelMessageEvents['removeListener'](_0x317452,_0x1edfc5);};}exports[_0x5837('0x4')]=function(_0x19491e){for(var _0x365da3=0x0,_0x2e383c=events[_0x5837('0x5')];_0x365da3<_0x2e383c;_0x365da3++){var _0x5bc421=events[_0x365da3];var _0x508caf=createListener(_0x5837('0x6')+_0x5bc421,_0x19491e);OpenchannelMessageEvents['on'](_0x5bc421,_0x508caf);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5c1a1e2..815e9ba 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 _0xd460=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','update','delete','destroy','exports'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xd460,0x96));var _0x0d46=function(_0x1bfe44,_0x4e410e){_0x1bfe44=_0x1bfe44-0x0;var _0x1103cb=_0xd460[_0x1bfe44];return _0x1103cb;};'use strict';var multer=require(_0x0d46('0x0'));var util=require(_0x0d46('0x1'));var path=require(_0x0d46('0x2'));var timeout=require(_0x0d46('0x3'));var express=require(_0x0d46('0x4'));var router=express[_0x0d46('0x5')]();var auth=require(_0x0d46('0x6'));var interaction=require(_0x0d46('0x7'));var config=require(_0x0d46('0x8'));var controller=require(_0x0d46('0x9'));router[_0x0d46('0xa')]('/',auth[_0x0d46('0xb')](),controller[_0x0d46('0xc')]);router[_0x0d46('0xa')](_0x0d46('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x0d46('0xe'),auth['isAuthenticated'](),controller[_0x0d46('0xf')]);router[_0x0d46('0xa')](_0x0d46('0x10'),auth[_0x0d46('0xb')](),controller[_0x0d46('0x11')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x0d46('0x12')]);router[_0x0d46('0xa')](_0x0d46('0x13'),auth[_0x0d46('0xb')](),controller[_0x0d46('0x14')]);router[_0x0d46('0x15')]('/',auth[_0x0d46('0xb')](),controller[_0x0d46('0x16')]);router['post'](_0x0d46('0x17'),auth['isAuthenticated'](),controller[_0x0d46('0x18')]);router[_0x0d46('0x15')](_0x0d46('0x13'),auth[_0x0d46('0xb')](),controller['addAgents']);router[_0x0d46('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0d46('0x1a')]);router[_0x0d46('0x1b')](_0x0d46('0xe'),auth['isAuthenticated'](),controller[_0x0d46('0x1c')]);router[_0x0d46('0x1b')]('/:id/teams',auth[_0x0d46('0xb')](),controller['removeTeams']);router[_0x0d46('0x1b')](_0x0d46('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0d46('0x1d')]=router; \ No newline at end of file +var _0x1870=['addAgents','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x45882c,_0x4411e4){var _0x22f135=function(_0x53d159){while(--_0x53d159){_0x45882c['push'](_0x45882c['shift']());}};_0x22f135(++_0x4411e4);}(_0x1870,0x7e));var _0x0187=function(_0x17ba19,_0x145049){_0x17ba19=_0x17ba19-0x0;var _0x4730bf=_0x1870[_0x17ba19];return _0x4730bf;};'use strict';var multer=require(_0x0187('0x0'));var util=require(_0x0187('0x1'));var path=require(_0x0187('0x2'));var timeout=require('connect-timeout');var express=require(_0x0187('0x3'));var router=express[_0x0187('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0187('0x5'));var config=require(_0x0187('0x6'));var controller=require('./openchannelQueue.controller');router[_0x0187('0x7')]('/',auth[_0x0187('0x8')](),controller[_0x0187('0x9')]);router[_0x0187('0x7')](_0x0187('0xa'),auth[_0x0187('0x8')](),controller['describe']);router[_0x0187('0x7')]('/:id',auth[_0x0187('0x8')](),controller[_0x0187('0xb')]);router[_0x0187('0x7')]('/:id/members',auth[_0x0187('0x8')](),controller['getMembers']);router[_0x0187('0x7')](_0x0187('0xc'),auth[_0x0187('0x8')](),controller[_0x0187('0xd')]);router[_0x0187('0x7')](_0x0187('0xe'),auth[_0x0187('0x8')](),controller[_0x0187('0xf')]);router[_0x0187('0x10')]('/',auth[_0x0187('0x8')](),controller[_0x0187('0x11')]);router['post'](_0x0187('0xc'),auth[_0x0187('0x8')](),controller['addTeams']);router[_0x0187('0x10')](_0x0187('0xe'),auth['isAuthenticated'](),controller[_0x0187('0x12')]);router[_0x0187('0x13')](_0x0187('0x14'),auth[_0x0187('0x8')](),controller['update']);router[_0x0187('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x0187('0x16')]);router['delete']('/:id/teams',auth[_0x0187('0x8')](),controller['removeTeams']);router['delete'](_0x0187('0xe'),auth[_0x0187('0x8')](),controller['removeAgents']);module[_0x0187('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index b37e722..c8899af 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 _0x0688=['rrmemory','beepall','roundrobin','STRING','name','INTEGER'];(function(_0x36535a,_0x1648be){var _0x28d98d=function(_0x2c23fc){while(--_0x2c23fc){_0x36535a['push'](_0x36535a['shift']());}};_0x28d98d(++_0x1648be);}(_0x0688,0x75));var _0x8068=function(_0x544ad0,_0x21adfc){_0x544ad0=_0x544ad0-0x0;var _0x2f7173=_0x0688[_0x544ad0];return _0x2f7173;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8068('0x0')],'unique':_0x8068('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8068('0x0')]},'timeout':{'type':Sequelize[_0x8068('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8068('0x3'),_0x8068('0x4'),_0x8068('0x5'))}}; \ No newline at end of file +var _0xb15b=['STRING','name','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x104517,_0x1b5b48){var _0x1c48d1=function(_0x5c8cd9){while(--_0x5c8cd9){_0x104517['push'](_0x104517['shift']());}};_0x1c48d1(++_0x1b5b48);}(_0xb15b,0x75));var _0xbb15=function(_0x4b1f82,_0x4aecd6){_0x4b1f82=_0x4b1f82-0x0;var _0x44d603=_0xb15b[_0x4b1f82];return _0x44d603;};'use strict';var Sequelize=require(_0xbb15('0x0'));module[_0xbb15('0x1')]={'name':{'type':Sequelize[_0xbb15('0x2')],'unique':_0xbb15('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbb15('0x2')]},'timeout':{'type':Sequelize[_0xbb15('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xbb15('0x5'),_0xbb15('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 618eb2c..4514ea1 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 _0x070f=['end','json','offset','limit','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','OpenchannelQueue','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','UserId','agent','updatedAt','createdAt','SIP','openchannelPause','getTeams','addTeams','teams','Team','User','Agents','online','interface','flatMap','sequelize','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','options','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x070f,0xf3));var _0xf070=function(_0x8f7d60,_0x2f2617){_0x8f7d60=_0x8f7d60-0x0;var _0x4acfbb=_0x070f[_0x8f7d60];return _0x4acfbb;};'use strict';var pdf=require(_0xf070('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf070('0x1'));var jsonpatch=require(_0xf070('0x2'));var rp=require(_0xf070('0x3'));var moment=require(_0xf070('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf070('0x5'));var util=require(_0xf070('0x6'));var path=require(_0xf070('0x7'));var sox=require('sox');var csv=require(_0xf070('0x8'));var ejs=require(_0xf070('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf070('0xa'));var crypto=require(_0xf070('0xb'));var jsforce=require(_0xf070('0xc'));var deskjs=require(_0xf070('0xd'));var toCsv=require(_0xf070('0x8'));var querystring=require(_0xf070('0xe'));var Papa=require(_0xf070('0xf'));var Redis=require(_0xf070('0x10'));var authService=require(_0xf070('0x11'));var qs=require(_0xf070('0x12'));var hardwareService=require(_0xf070('0x13'));var logger=require(_0xf070('0x14'))(_0xf070('0x15'));var utils=require(_0xf070('0x16'));var config=require(_0xf070('0x17'));var db=require(_0xf070('0x18'))['db'];config[_0xf070('0x19')]=_[_0xf070('0x1a')](config[_0xf070('0x19')],{'host':_0xf070('0x1b'),'port':0x18eb});var socket=require(_0xf070('0x1c'))(new Redis(config[_0xf070('0x19')]));require(_0xf070('0x1d'))[_0xf070('0x1e')](socket);function respondWithStatusCode(_0x12e90f,_0x99d9a7){_0x99d9a7=_0x99d9a7||0xcc;return function(_0x1183e8){if(_0x1183e8){return _0x12e90f[_0xf070('0x1f')](_0x99d9a7);}return _0x12e90f[_0xf070('0x20')](_0x99d9a7)[_0xf070('0x21')]();};}function respondWithResult(_0x37bcbc,_0xbfc2df){_0xbfc2df=_0xbfc2df||0xc8;return function(_0xa62867){if(_0xa62867){return _0x37bcbc[_0xf070('0x20')](_0xbfc2df)[_0xf070('0x22')](_0xa62867);}};}function respondWithFilteredResult(_0x46a4c8,_0x31a94e){return function(_0x445786){if(_0x445786){var _0x12b0c4=_0x445786['count'],_0x1e3287=_0x31a94e[_0xf070('0x23')],_0xef4101=_0x31a94e[_0xf070('0x23')]+_0x31a94e[_0xf070('0x24')],_0x6e1814;if(_0xef4101>=_0x12b0c4){_0xef4101=_0x12b0c4;_0x6e1814=0xc8;}else{_0x6e1814=0xce;}_0x46a4c8[_0xf070('0x20')](_0x6e1814);return _0x46a4c8['set']('Content-Range',_0x1e3287+'-'+_0xef4101+'/'+_0x12b0c4)[_0xf070('0x22')](_0x445786);}return null;};}function patchUpdates(_0x18ffbc){return function(_0x5a8110){try{jsonpatch[_0xf070('0x25')](_0x5a8110,_0x18ffbc,!![]);}catch(_0x35a555){return BPromise[_0xf070('0x26')](_0x35a555);}return _0x5a8110[_0xf070('0x27')]();};}function saveUpdates(_0x21ba19,_0x1bb088){return function(_0x5792ea){if(_0x5792ea){return _0x5792ea[_0xf070('0x28')](_0x21ba19)[_0xf070('0x29')](function(_0x5f26f1){return _0x5f26f1;});}return null;};}function removeEntity(_0x13e866,_0x58cdbd){return function(_0x7adeed){if(_0x7adeed){return _0x7adeed[_0xf070('0x2a')]()[_0xf070('0x29')](function(){var _0x4737bb=_0x7adeed[_0xf070('0x2b')]({'plain':!![]});var _0x156057=_0xf070('0x2c');return db[_0xf070('0x2d')]['destroy']({'where':{'type':_0x156057,'resourceId':_0x4737bb['id']}})[_0xf070('0x29')](function(){return _0x7adeed;});})[_0xf070('0x29')](function(){_0x13e866[_0xf070('0x20')](0xcc)[_0xf070('0x21')]();});}};}function handleEntityNotFound(_0x14ad2a,_0x2dba60){return function(_0x5aecc1){if(!_0x5aecc1){_0x14ad2a[_0xf070('0x1f')](0x194);}return _0x5aecc1;};}function handleError(_0x4d8654,_0xa02051){_0xa02051=_0xa02051||0x1f4;return function(_0x211394){logger[_0xf070('0x2e')](_0x211394[_0xf070('0x2f')]);if(_0x211394['name']){delete _0x211394[_0xf070('0x30')];}_0x4d8654[_0xf070('0x20')](_0xa02051)[_0xf070('0x31')](_0x211394);};}exports['index']=function(_0x116165,_0x2af0b9){var _0x56fa1d={},_0x26c111={},_0x5756cb={'count':0x0,'rows':[]};var _0x4a53e8=db['OpenchannelQueue'][_0xf070('0x32')];_0x26c111[_0xf070('0x33')]=_[_0xf070('0x34')](_0x4a53e8);_0x26c111[_0xf070('0x35')]=_[_0xf070('0x34')](_0x116165['query']);_0x26c111[_0xf070('0x36')]=_[_0xf070('0x37')](_0x26c111[_0xf070('0x33')],_0x26c111['query']);_0x56fa1d[_0xf070('0x38')]=_[_0xf070('0x37')](_0x26c111[_0xf070('0x33')],qs[_0xf070('0x39')](_0x116165[_0xf070('0x35')][_0xf070('0x39')]));_0x56fa1d[_0xf070('0x38')]=_0x56fa1d[_0xf070('0x38')][_0xf070('0x3a')]?_0x56fa1d[_0xf070('0x38')]:_0x26c111[_0xf070('0x33')];if(!_0x116165[_0xf070('0x35')][_0xf070('0x3b')](_0xf070('0x3c'))){_0x56fa1d[_0xf070('0x24')]=qs[_0xf070('0x24')](_0x116165[_0xf070('0x35')]['limit']);_0x56fa1d[_0xf070('0x23')]=qs[_0xf070('0x23')](_0x116165[_0xf070('0x35')][_0xf070('0x23')]);}_0x56fa1d[_0xf070('0x3d')]=qs[_0xf070('0x3e')](_0x116165[_0xf070('0x35')][_0xf070('0x3e')]);_0x56fa1d[_0xf070('0x3f')]=qs[_0xf070('0x36')](_[_0xf070('0x40')](_0x116165[_0xf070('0x35')],_0x26c111[_0xf070('0x36')]));if(_0x116165['query'][_0xf070('0x41')]){_0x56fa1d[_0xf070('0x3f')]=_[_0xf070('0x42')](_0x56fa1d[_0xf070('0x3f')],{'$or':_[_0xf070('0x43')](_0x4a53e8,function(_0x1d9d98){if(_0x1d9d98[_0xf070('0x44')][_0xf070('0x45')]!==_0xf070('0x46')){var _0x44e91a={};_0x44e91a[_0x1d9d98['field']]={'$like':'%'+_0x116165[_0xf070('0x35')]['filter']+'%'};return _0x44e91a;}})});}_0x56fa1d=_[_0xf070('0x42')]({},_0x56fa1d,_0x116165['options']);var _0x10d243={'where':_0x56fa1d[_0xf070('0x3f')]};return db[_0xf070('0x47')][_0xf070('0x48')](_0x10d243)['then'](function(_0x56acc4){_0x5756cb['count']=_0x56acc4;if(_0x116165['query'][_0xf070('0x49')]){_0x56fa1d[_0xf070('0x4a')]=[{'all':!![]}];}return db[_0xf070('0x47')][_0xf070('0x4b')](_0x56fa1d);})[_0xf070('0x29')](function(_0x5680c5){_0x5756cb[_0xf070('0x4c')]=_0x5680c5;return _0x5756cb;})['then'](respondWithFilteredResult(_0x2af0b9,_0x56fa1d))[_0xf070('0x4d')](handleError(_0x2af0b9,null));};exports[_0xf070('0x4e')]=function(_0x17921a,_0x5a646d){var _0x519d51={'raw':!![],'where':{'id':_0x17921a[_0xf070('0x4f')]['id']}},_0x3aea60={};_0x3aea60['model']=_['keys'](db[_0xf070('0x47')][_0xf070('0x32')]);_0x3aea60['query']=_[_0xf070('0x34')](_0x17921a['query']);_0x3aea60['filters']=_[_0xf070('0x37')](_0x3aea60[_0xf070('0x33')],_0x3aea60['query']);_0x519d51['attributes']=_[_0xf070('0x37')](_0x3aea60[_0xf070('0x33')],qs[_0xf070('0x39')](_0x17921a[_0xf070('0x35')][_0xf070('0x39')]));_0x519d51[_0xf070('0x38')]=_0x519d51[_0xf070('0x38')][_0xf070('0x3a')]?_0x519d51[_0xf070('0x38')]:_0x3aea60[_0xf070('0x33')];if(_0x17921a[_0xf070('0x35')]['includeAll']){_0x519d51['include']=[{'all':!![]}];}_0x519d51=_[_0xf070('0x42')]({},_0x519d51,_0x17921a['options']);return db[_0xf070('0x47')][_0xf070('0x50')](_0x519d51)[_0xf070('0x29')](handleEntityNotFound(_0x5a646d,null))[_0xf070('0x29')](respondWithResult(_0x5a646d,null))[_0xf070('0x4d')](handleError(_0x5a646d,null));};exports['create']=function(_0x3ce350,_0x349ef3){return db[_0xf070('0x47')][_0xf070('0x51')](_0x3ce350[_0xf070('0x52')],{})[_0xf070('0x29')](function(_0x349c03){var _0x11668d=_0x3ce350['user'][_0xf070('0x2b')]({'plain':!![]});if(!_0x11668d)throw new Error(_0xf070('0x53'));if(_0x11668d['role']==='user'){var _0x23b96d=_0x349c03[_0xf070('0x2b')]({'plain':!![]});var _0x23d1ba=_0xf070('0x2c');return db[_0xf070('0x54')]['find']({'where':{'name':_0x23d1ba,'userProfileId':_0x11668d['userProfileId']},'raw':!![]})[_0xf070('0x29')](function(_0xc90f8d){if(_0xc90f8d&&_0xc90f8d[_0xf070('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x23b96d[_0xf070('0x30')],'resourceId':_0x23b96d['id'],'type':_0xc90f8d[_0xf070('0x30')],'sectionId':_0xc90f8d['id']},{})[_0xf070('0x29')](function(){return _0x349c03;});}else{return _0x349c03;}})['catch'](function(_0x2af4de){logger['error'](_0xf070('0x56'),_0x2af4de);throw _0x2af4de;});}return _0x349c03;})[_0xf070('0x29')](respondWithResult(_0x349ef3,0xc9))[_0xf070('0x4d')](handleError(_0x349ef3,null));};exports[_0xf070('0x28')]=function(_0x1973ce,_0x4ed7ec){if(_0x1973ce[_0xf070('0x52')]['id']){delete _0x1973ce[_0xf070('0x52')]['id'];}return db[_0xf070('0x47')][_0xf070('0x50')]({'where':{'id':_0x1973ce[_0xf070('0x4f')]['id']}})[_0xf070('0x29')](handleEntityNotFound(_0x4ed7ec,null))['then'](saveUpdates(_0x1973ce['body'],null))[_0xf070('0x29')](respondWithResult(_0x4ed7ec,null))[_0xf070('0x4d')](handleError(_0x4ed7ec,null));};exports[_0xf070('0x2a')]=function(_0x242c5b,_0x2a259f){return db[_0xf070('0x47')]['find']({'where':{'id':_0x242c5b['params']['id']}})[_0xf070('0x29')](handleEntityNotFound(_0x2a259f,null))[_0xf070('0x29')](removeEntity(_0x2a259f,null))[_0xf070('0x4d')](handleError(_0x2a259f,null));};exports[_0xf070('0x57')]=function(_0xedd1ad,_0x90b78b){return db['OpenchannelQueue'][_0xf070('0x57')]()[_0xf070('0x29')](respondWithResult(_0x90b78b,null))[_0xf070('0x4d')](handleError(_0x90b78b,null));};exports[_0xf070('0x58')]=function(_0x3c41bf,_0x4bd971,_0x2ce6e8){var _0x5a0a06={'raw':!![],'where':{}},_0x371694={},_0x243cab;return db[_0xf070('0x47')][_0xf070('0x59')]({'where':{'id':_0x3c41bf[_0xf070('0x4f')]['id']}})[_0xf070('0x29')](handleEntityNotFound(_0x4bd971,null))['then'](function(_0x3baaa8){if(_0x3baaa8){_0x243cab=_0x3baaa8[_0xf070('0x2b')]({'plain':!![]});_0x371694['model']=_[_0xf070('0x34')](db[_0xf070('0x5a')][_0xf070('0x32')]);_0x371694[_0xf070('0x35')]=_[_0xf070('0x34')](_0x3c41bf[_0xf070('0x35')]);_0x371694['filters']=_['intersection'](_0x371694['model'],_0x371694[_0xf070('0x35')]);_0x5a0a06[_0xf070('0x38')]=_[_0xf070('0x37')](_0x371694['model'],qs['fields'](_0x3c41bf[_0xf070('0x35')][_0xf070('0x39')]));_0x5a0a06['attributes']=_0x5a0a06[_0xf070('0x38')]['length']?_0x5a0a06[_0xf070('0x38')]:_0x371694['model'];if(!_0x3c41bf[_0xf070('0x35')][_0xf070('0x3b')](_0xf070('0x3c'))){_0x5a0a06[_0xf070('0x24')]=qs[_0xf070('0x24')](_0x3c41bf[_0xf070('0x35')][_0xf070('0x24')]);_0x5a0a06[_0xf070('0x23')]=qs['offset'](_0x3c41bf[_0xf070('0x35')][_0xf070('0x23')]);}_0x5a0a06[_0xf070('0x3d')]=qs[_0xf070('0x3e')](_0x3c41bf[_0xf070('0x35')][_0xf070('0x3e')]);_0x5a0a06[_0xf070('0x3f')]=qs['filters'](_['pick'](_0x3c41bf[_0xf070('0x35')],_0x371694[_0xf070('0x36')]));_0x5a0a06[_0xf070('0x3f')][_0xf070('0x5b')]=_0x3baaa8['id'];if(_0x3c41bf['query'][_0xf070('0x41')]){_0x5a0a06[_0xf070('0x3f')]=_[_0xf070('0x42')](_0x5a0a06[_0xf070('0x3f')],{'$or':_[_0xf070('0x43')](_0x5a0a06['attributes'],function(_0x53c4b9){var _0x2ab511={};_0x2ab511[_0x53c4b9]={'$like':'%'+_0x3c41bf[_0xf070('0x35')][_0xf070('0x41')]+'%'};return _0x2ab511;})});}_0x5a0a06=_[_0xf070('0x42')]({},_0x5a0a06,_0x3c41bf['options']);return db[_0xf070('0x5a')][_0xf070('0x4b')](_0x5a0a06);}})['then'](function(_0x35a848){if(_0x35a848){return db['User']['findAndCountAll']({'where':{'id':_[_0xf070('0x43')](_0x35a848,_0xf070('0x5c')),'role':_0xf070('0x5d')},'attributes':['id',_0xf070('0x30'),'openchannelPause',_0xf070('0x5e'),_0xf070('0x5f')]});}})[_0xf070('0x29')](function(_0x55f9fb){if(_0x55f9fb){return{'count':_0x55f9fb['count'],'rows':_[_0xf070('0x43')](_0x55f9fb[_0xf070('0x4c')],function(_0x320fd6){return{'membername':_0x320fd6[_0xf070('0x30')],'UserId':_0x320fd6['id'],'queue_name':_0x243cab[_0xf070('0x30')],'OpenchannelQueueId':_0x243cab['id'],'interface':util['format']('%s/%s',_0xf070('0x60'),_0x320fd6[_0xf070('0x30')]),'penalty':0x0,'paused':_0x320fd6[_0xf070('0x61')],'createdAt':_0x320fd6[_0xf070('0x5f')],'updatedAt':_0x320fd6[_0xf070('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4bd971,_0x5a0a06))[_0xf070('0x4d')](handleError(_0x4bd971,null));};exports['getTeams']=function(_0x6b881b,_0x34e953,_0x5edaba){var _0xf66921={};var _0x379bd1={};var _0x2f8554;var _0x9371ec;return db['OpenchannelQueue'][_0xf070('0x59')]({'where':{'id':_0x6b881b[_0xf070('0x4f')]['id']}})[_0xf070('0x29')](handleEntityNotFound(_0x34e953,null))[_0xf070('0x29')](function(_0x447b12){if(_0x447b12){_0x2f8554=_0x447b12;_0x379bd1[_0xf070('0x33')]=_[_0xf070('0x34')](db['Team'][_0xf070('0x32')]);_0x379bd1[_0xf070('0x35')]=_[_0xf070('0x34')](_0x6b881b[_0xf070('0x35')]);_0x379bd1[_0xf070('0x36')]=_['intersection'](_0x379bd1[_0xf070('0x33')],_0x379bd1[_0xf070('0x35')]);_0xf66921[_0xf070('0x38')]=_['intersection'](_0x379bd1['model'],qs[_0xf070('0x39')](_0x6b881b[_0xf070('0x35')][_0xf070('0x39')]));_0xf66921[_0xf070('0x38')]=_0xf66921[_0xf070('0x38')][_0xf070('0x3a')]?_0xf66921['attributes']:_0x379bd1['model'];_0xf66921[_0xf070('0x3d')]=qs[_0xf070('0x3e')](_0x6b881b[_0xf070('0x35')][_0xf070('0x3e')]);_0xf66921[_0xf070('0x3f')]=qs[_0xf070('0x36')](_[_0xf070('0x40')](_0x6b881b[_0xf070('0x35')],_0x379bd1[_0xf070('0x36')]));if(_0x6b881b[_0xf070('0x35')][_0xf070('0x41')]){_0xf66921['where']=_[_0xf070('0x42')](_0xf66921[_0xf070('0x3f')],{'$or':_[_0xf070('0x43')](_0xf66921[_0xf070('0x38')],function(_0x43c191){var _0x40778f={};_0x40778f[_0x43c191]={'$like':'%'+_0x6b881b[_0xf070('0x35')][_0xf070('0x41')]+'%'};return _0x40778f;})});}_0xf66921=_['merge']({},_0xf66921,_0x6b881b['options']);return _0x2f8554[_0xf070('0x62')](_0xf66921);}})[_0xf070('0x29')](function(_0x543dfb){if(_0x543dfb){_0x9371ec=_0x543dfb[_0xf070('0x3a')];if(!_0x6b881b[_0xf070('0x35')][_0xf070('0x3b')](_0xf070('0x3c'))){_0xf66921[_0xf070('0x24')]=qs[_0xf070('0x24')](_0x6b881b[_0xf070('0x35')]['limit']);_0xf66921['offset']=qs[_0xf070('0x23')](_0x6b881b['query'][_0xf070('0x23')]);}return _0x2f8554['getTeams'](_0xf66921);}})[_0xf070('0x29')](function(_0x47f3a6){if(_0x47f3a6){return _0x47f3a6?{'count':_0x9371ec,'rows':_0x47f3a6}:null;}})[_0xf070('0x29')](respondWithResult(_0x34e953,null))[_0xf070('0x4d')](handleError(_0x34e953,null));};exports[_0xf070('0x63')]=function(_0x3d5d7a,_0x227063,_0x557c0b){var _0x489755=_0x3d5d7a[_0xf070('0x52')][_0xf070('0x64')];return db[_0xf070('0x65')]['findAll']({'where':{'id':_[_0xf070('0x43')](_0x489755,'id')},'attributes':['id'],'include':[{'model':db[_0xf070('0x66')],'as':_0xf070('0x67'),'attributes':['id',_0xf070('0x30'),_0xf070('0x68'),'voicePause',_0xf070('0x69')],'raw':!![]}]})[_0xf070('0x29')](function(_0x85f8c6){if(_0x85f8c6){var _0x4248fe=_[_0xf070('0x6a')](_0x85f8c6,function(_0x1feb46){var _0x46fd4c=_0x1feb46[_0xf070('0x2b')]({'plain':!![]});return _0x46fd4c['Agents'];});return db['OpenchannelQueue']['find']({'where':{'id':_0x3d5d7a[_0xf070('0x4f')]['id']}})[_0xf070('0x29')](function(_0x55116c){return db[_0xf070('0x6b')]['transaction'](function(_0xca9ec2){return _0x55116c[_0xf070('0x63')](_[_0xf070('0x43')](_0x489755,'id'),{'transaction':_0xca9ec2})[_0xf070('0x29')](function(){return BPromise['each'](_0x4248fe,function(_0x5ab136){return db[_0xf070('0x5a')][_0xf070('0x6c')]({'where':{'UserId':_0x5ab136['id'],'OpenchannelQueueId':_0x3d5d7a[_0xf070('0x4f')]['id']},'transaction':_0xca9ec2});});})[_0xf070('0x29')](function(){_0x4248fe[_0xf070('0x6d')](function(_0x14e247){socket[_0xf070('0x6e')](_0xf070('0x6f'),{'UserId':_0x14e247['id'],'OpenchannelQueueId':_0x55116c['id']});});});});});}})[_0xf070('0x29')](respondWithStatusCode(_0x227063,null))[_0xf070('0x4d')](handleError(_0x227063,null));};exports[_0xf070('0x70')]=function(_0x212074,_0x583b92,_0x545cb3){return db[_0xf070('0x65')][_0xf070('0x4b')]({'where':{'id':_0x212074[_0xf070('0x35')][_0xf070('0x71')]},'attributes':['id'],'include':[{'model':db[_0xf070('0x66')],'as':_0xf070('0x67'),'attributes':['id'],'raw':!![]}]})[_0xf070('0x29')](handleEntityNotFound(_0x583b92,null))['then'](function(_0x3f86f6){var _0x5d1e5c=_['map'](_0x3f86f6,'id');var _0x1f7b82=[];var _0x1b88cf=[];var _0x4bf658=squel[_0xf070('0x72')]();_0x4bf658[_0xf070('0x73')]('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0xf070('0x74')](_0xf070('0x75'),'ut',_0xf070('0x76'))[_0xf070('0x3f')](_0xf070('0x77'),_0x212074[_0xf070('0x4f')]['id']);for(var _0x5aeb4a=0x0;_0x5aeb4a<_0x3f86f6[_0xf070('0x3a')];_0x5aeb4a+=0x1){let _0x4b186f=_0x3f86f6[_0x5aeb4a];for(var _0x1eabc1=0x0;_0x1eabc1<_0x4b186f['Agents'][_0xf070('0x3a')];_0x1eabc1+=0x1){let _0x3d1e0a=_0x4b186f[_0xf070('0x67')][_0x1eabc1];var _0x1f507b=_0x4bf658['clone']();_0x1f507b[_0xf070('0x3f')]('ut.UserId\x20=\x20?',_0x3d1e0a['id']);_0x1b88cf[_0xf070('0x78')](db[_0xf070('0x6b')][_0xf070('0x35')](_0x1f507b[_0xf070('0x79')](),{'type':db[_0xf070('0x6b')]['QueryTypes'][_0xf070('0x7a')]})[_0xf070('0x29')](function(_0x174ed0){if(_0x174ed0['length']===0x1){return _0x3d1e0a['id'];}else{var _0x195eca=_['every'](_['map'](_0x174ed0,_0xf070('0x7b')),function(_0x1792e2){return _[_0xf070('0x7c')](_0x5d1e5c,_0x1792e2);});if(_0x195eca){return _0x3d1e0a['id'];}}}));}}return BPromise[_0xf070('0x7d')](_0x1b88cf)[_0xf070('0x29')](function(_0x2f08f1){_0x1f7b82=_(_0x1f7b82)[_0xf070('0x7e')](_0x2f08f1)[_0xf070('0x7f')]()[_0xf070('0x80')]();return db[_0xf070('0x47')][_0xf070('0x50')]({'where':{'id':_0x212074[_0xf070('0x4f')]['id']}})[_0xf070('0x29')](function(_0x2a2f68){return db[_0xf070('0x6b')]['transaction'](function(_0x2fb628){return _0x2a2f68[_0xf070('0x70')](_0x212074['query'][_0xf070('0x71')],{'transaction':_0x2fb628})[_0xf070('0x29')](function(){if(!_[_0xf070('0x81')](_0x1f7b82)){return _0x2a2f68[_0xf070('0x82')](_0x1f7b82,{'transaction':_0x2fb628});}})['then'](function(){_0x1f7b82[_0xf070('0x6d')](function(_0x579afa){socket[_0xf070('0x6e')](_0xf070('0x83'),{'UserId':_0x579afa,'OpenchannelQueueId':_0x2a2f68['id']});});});});});});})[_0xf070('0x29')](respondWithStatusCode(_0x583b92,null))[_0xf070('0x4d')](handleError(_0x583b92,null));};exports[_0xf070('0x84')]=function(_0x25bab0,_0x57c82e,_0xa1ff12){return db[_0xf070('0x47')]['find']({'where':{'id':_0x25bab0[_0xf070('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57c82e,null))['then'](function(_0x3b9a1e){if(_0x3b9a1e){return _0x3b9a1e[_0xf070('0x84')](_0x25bab0[_0xf070('0x52')]['ids'],_[_0xf070('0x85')](_0x25bab0[_0xf070('0x52')],[_0xf070('0x71'),'id'])||{})[_0xf070('0x86')](function(_0x570930){for(var _0xc98909=0x0;_0xc98909<_0x25bab0[_0xf070('0x52')]['ids'][_0xf070('0x3a')];_0xc98909+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x25bab0[_0xf070('0x52')][_0xf070('0x71')][_0xc98909],'OpenchannelQueueId':_0x25bab0[_0xf070('0x4f')]['id']});}return _0x570930;});}})[_0xf070('0x29')](respondWithResult(_0x57c82e,null))['catch'](handleError(_0x57c82e,null));};exports[_0xf070('0x82')]=function(_0x2db133,_0x222789,_0x35e6cc){return db[_0xf070('0x47')]['find']({'where':{'id':_0x2db133[_0xf070('0x4f')]['id']}})[_0xf070('0x29')](handleEntityNotFound(_0x222789,null))[_0xf070('0x29')](function(_0x332b3f){if(_0x332b3f){return _0x332b3f[_0xf070('0x82')](_0x2db133[_0xf070('0x35')][_0xf070('0x71')])[_0xf070('0x29')](function(){if(_[_0xf070('0x87')](_0x2db133[_0xf070('0x35')][_0xf070('0x71')])){for(var _0x470223=0x0;_0x470223<_0x2db133['query'][_0xf070('0x71')][_0xf070('0x3a')];_0x470223+=0x1){socket[_0xf070('0x6e')](_0xf070('0x83'),{'UserId':Number(_0x2db133[_0xf070('0x35')][_0xf070('0x71')][_0x470223]),'OpenchannelQueueId':Number(_0x2db133['params']['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x2db133[_0xf070('0x35')][_0xf070('0x71')]),'OpenchannelQueueId':Number(_0x2db133[_0xf070('0x4f')]['id'])});}});}})[_0xf070('0x29')](respondWithStatusCode(_0x222789,null))[_0xf070('0x4d')](handleError(_0x222789,null));};exports[_0xf070('0x88')]=function(_0x559e19,_0x17b4f4,_0x2cb297){var _0x1c9fdb={};var _0x13e155={};var _0x52db65;var _0xa740a3;return db[_0xf070('0x47')][_0xf070('0x59')]({'where':{'id':_0x559e19[_0xf070('0x4f')]['id']}})[_0xf070('0x29')](handleEntityNotFound(_0x17b4f4,null))['then'](function(_0x9de5c1){if(_0x9de5c1){_0x52db65=_0x9de5c1;_0x13e155[_0xf070('0x33')]=_[_0xf070('0x34')](db[_0xf070('0x66')][_0xf070('0x32')]);_0x13e155['query']=_['keys'](_0x559e19[_0xf070('0x35')]);_0x13e155[_0xf070('0x36')]=_[_0xf070('0x37')](_0x13e155[_0xf070('0x33')],_0x13e155[_0xf070('0x35')]);_0x1c9fdb[_0xf070('0x38')]=_['intersection'](_0x13e155['model'],qs['fields'](_0x559e19['query'][_0xf070('0x39')]));_0x1c9fdb[_0xf070('0x38')]=_0x1c9fdb[_0xf070('0x38')][_0xf070('0x3a')]?_0x1c9fdb['attributes']:_0x13e155[_0xf070('0x33')];_0x1c9fdb['order']=qs[_0xf070('0x3e')](_0x559e19[_0xf070('0x35')][_0xf070('0x3e')]);_0x1c9fdb[_0xf070('0x3f')]=qs[_0xf070('0x36')](_[_0xf070('0x40')](_0x559e19[_0xf070('0x35')],_0x13e155[_0xf070('0x36')]));if(_0x559e19[_0xf070('0x35')][_0xf070('0x41')]){_0x1c9fdb[_0xf070('0x3f')]=_['merge'](_0x1c9fdb[_0xf070('0x3f')],{'$or':_['map'](_0x1c9fdb[_0xf070('0x38')],function(_0x2eb1cf){var _0x510116={};_0x510116[_0x2eb1cf]={'$like':'%'+_0x559e19['query'][_0xf070('0x41')]+'%'};return _0x510116;})});}_0x1c9fdb=_[_0xf070('0x42')]({},_0x1c9fdb,_0x559e19[_0xf070('0x89')]);return _0x52db65['getAgents'](_0x1c9fdb);}})[_0xf070('0x29')](function(_0x122ba5){if(_0x122ba5){_0xa740a3=_0x122ba5['length'];if(!_0x559e19[_0xf070('0x35')][_0xf070('0x3b')](_0xf070('0x3c'))){_0x1c9fdb[_0xf070('0x24')]=qs[_0xf070('0x24')](_0x559e19['query']['limit']);_0x1c9fdb[_0xf070('0x23')]=qs[_0xf070('0x23')](_0x559e19['query'][_0xf070('0x23')]);}return _0x52db65['getAgents'](_0x1c9fdb);}})[_0xf070('0x29')](function(_0x5b64a4){if(_0x5b64a4){return _0x5b64a4?{'count':_0xa740a3,'rows':_0x5b64a4}:null;}})[_0xf070('0x29')](respondWithResult(_0x17b4f4,null))[_0xf070('0x4d')](handleError(_0x17b4f4,null));}; \ No newline at end of file +var _0x23f5=['OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','union','compact','value','removeTeams','ids','isEmpty','removeAgents','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','findOne','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','path','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','destroy','get','error','stack','name','send','index','OpenchannelQueue','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','map','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','tq.TeamId','team_has_openchannel_queues','join','user_has_teams'];(function(_0x439dac,_0x415240){var _0x450f85=function(_0xa95b05){while(--_0xa95b05){_0x439dac['push'](_0x439dac['shift']());}};_0x450f85(++_0x415240);}(_0x23f5,0x95));var _0x523f=function(_0x430095,_0x122722){_0x430095=_0x430095-0x0;var _0x115f8a=_0x23f5[_0x430095];return _0x115f8a;};'use strict';var pdf=require(_0x523f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x523f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x523f('0x2'));var rp=require(_0x523f('0x3'));var moment=require('moment');var BPromise=require(_0x523f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x523f('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x523f('0x6'));var fs=require('fs');var _=require(_0x523f('0x7'));var squel=require(_0x523f('0x8'));var crypto=require(_0x523f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x523f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x523f('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x523f('0xc'));var qs=require(_0x523f('0xd'));var hardwareService=require(_0x523f('0xe'));var logger=require(_0x523f('0xf'))(_0x523f('0x10'));var utils=require(_0x523f('0x11'));var config=require('../../config/environment');var db=require(_0x523f('0x12'))['db'];config[_0x523f('0x13')]=_[_0x523f('0x14')](config[_0x523f('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x523f('0x15'))(new Redis(config[_0x523f('0x13')]));require(_0x523f('0x16'))[_0x523f('0x17')](socket);function respondWithStatusCode(_0x460c8b,_0x28a233){_0x28a233=_0x28a233||0xcc;return function(_0x34eee3){if(_0x34eee3){return _0x460c8b[_0x523f('0x18')](_0x28a233);}return _0x460c8b['status'](_0x28a233)[_0x523f('0x19')]();};}function respondWithResult(_0x3de6fe,_0x364e04){_0x364e04=_0x364e04||0xc8;return function(_0x21b432){if(_0x21b432){return _0x3de6fe[_0x523f('0x1a')](_0x364e04)[_0x523f('0x1b')](_0x21b432);}};}function respondWithFilteredResult(_0xc15912,_0x5ce89c){return function(_0xd4d878){if(_0xd4d878){var _0x4a5726=_0xd4d878[_0x523f('0x1c')],_0x3d4604=_0x5ce89c[_0x523f('0x1d')],_0x5630fb=_0x5ce89c[_0x523f('0x1d')]+_0x5ce89c[_0x523f('0x1e')],_0x272317;if(_0x5630fb>=_0x4a5726){_0x5630fb=_0x4a5726;_0x272317=0xc8;}else{_0x272317=0xce;}_0xc15912['status'](_0x272317);return _0xc15912[_0x523f('0x1f')]('Content-Range',_0x3d4604+'-'+_0x5630fb+'/'+_0x4a5726)[_0x523f('0x1b')](_0xd4d878);}return null;};}function patchUpdates(_0x3e07dd){return function(_0x7c62db){try{jsonpatch[_0x523f('0x20')](_0x7c62db,_0x3e07dd,!![]);}catch(_0x163005){return BPromise[_0x523f('0x21')](_0x163005);}return _0x7c62db[_0x523f('0x22')]();};}function saveUpdates(_0x5c68ab,_0x4a6b8a){return function(_0x486d3f){if(_0x486d3f){return _0x486d3f['update'](_0x5c68ab)[_0x523f('0x23')](function(_0x3f5c2a){return _0x3f5c2a;});}return null;};}function removeEntity(_0x2477d6,_0x1b1f71){return function(_0x1827df){if(_0x1827df){return _0x1827df[_0x523f('0x24')]()['then'](function(){var _0x3dc82a=_0x1827df[_0x523f('0x25')]({'plain':!![]});var _0x3bd36c='OpenchannelQueues';return db['UserProfileResource'][_0x523f('0x24')]({'where':{'type':_0x3bd36c,'resourceId':_0x3dc82a['id']}})['then'](function(){return _0x1827df;});})[_0x523f('0x23')](function(){_0x2477d6[_0x523f('0x1a')](0xcc)[_0x523f('0x19')]();});}};}function handleEntityNotFound(_0x17eaea,_0x5ac193){return function(_0x5eb7da){if(!_0x5eb7da){_0x17eaea['sendStatus'](0x194);}return _0x5eb7da;};}function handleError(_0xe08ca,_0x53a261){_0x53a261=_0x53a261||0x1f4;return function(_0x44da87){logger[_0x523f('0x26')](_0x44da87[_0x523f('0x27')]);if(_0x44da87[_0x523f('0x28')]){delete _0x44da87[_0x523f('0x28')];}_0xe08ca['status'](_0x53a261)[_0x523f('0x29')](_0x44da87);};}exports[_0x523f('0x2a')]=function(_0x46c40c,_0x78953e){var _0x529cf3={},_0x36f1cb={},_0x27b11d={'count':0x0,'rows':[]};var _0x4a8687=db[_0x523f('0x2b')][_0x523f('0x2c')];_0x36f1cb[_0x523f('0x2d')]=_['keys'](_0x4a8687);_0x36f1cb[_0x523f('0x2e')]=_[_0x523f('0x2f')](_0x46c40c[_0x523f('0x2e')]);_0x36f1cb['filters']=_['intersection'](_0x36f1cb[_0x523f('0x2d')],_0x36f1cb[_0x523f('0x2e')]);_0x529cf3[_0x523f('0x30')]=_[_0x523f('0x31')](_0x36f1cb[_0x523f('0x2d')],qs['fields'](_0x46c40c[_0x523f('0x2e')][_0x523f('0x32')]));_0x529cf3[_0x523f('0x30')]=_0x529cf3[_0x523f('0x30')][_0x523f('0x33')]?_0x529cf3['attributes']:_0x36f1cb[_0x523f('0x2d')];if(!_0x46c40c[_0x523f('0x2e')][_0x523f('0x34')](_0x523f('0x35'))){_0x529cf3[_0x523f('0x1e')]=qs['limit'](_0x46c40c[_0x523f('0x2e')][_0x523f('0x1e')]);_0x529cf3[_0x523f('0x1d')]=qs['offset'](_0x46c40c['query'][_0x523f('0x1d')]);}_0x529cf3[_0x523f('0x36')]=qs[_0x523f('0x37')](_0x46c40c[_0x523f('0x2e')][_0x523f('0x37')]);_0x529cf3[_0x523f('0x38')]=qs[_0x523f('0x39')](_[_0x523f('0x3a')](_0x46c40c['query'],_0x36f1cb[_0x523f('0x39')]));if(_0x46c40c['query'][_0x523f('0x3b')]){_0x529cf3['where']=_[_0x523f('0x3c')](_0x529cf3[_0x523f('0x38')],{'$or':_['map'](_0x4a8687,function(_0x58b207){if(_0x58b207[_0x523f('0x3d')]['key']!==_0x523f('0x3e')){var _0x164bee={};_0x164bee[_0x58b207[_0x523f('0x3f')]]={'$like':'%'+_0x46c40c[_0x523f('0x2e')][_0x523f('0x3b')]+'%'};return _0x164bee;}})});}_0x529cf3=_['merge']({},_0x529cf3,_0x46c40c[_0x523f('0x40')]);var _0x21ec66={'where':_0x529cf3[_0x523f('0x38')]};return db['OpenchannelQueue'][_0x523f('0x1c')](_0x21ec66)[_0x523f('0x23')](function(_0x5d773f){_0x27b11d['count']=_0x5d773f;if(_0x46c40c[_0x523f('0x2e')][_0x523f('0x41')]){_0x529cf3[_0x523f('0x42')]=[{'all':!![]}];}return db[_0x523f('0x2b')][_0x523f('0x43')](_0x529cf3);})[_0x523f('0x23')](function(_0x4dda58){_0x27b11d[_0x523f('0x44')]=_0x4dda58;return _0x27b11d;})[_0x523f('0x23')](respondWithFilteredResult(_0x78953e,_0x529cf3))[_0x523f('0x45')](handleError(_0x78953e,null));};exports[_0x523f('0x46')]=function(_0x32b774,_0x5d6a57){var _0x1913d4={'raw':!![],'where':{'id':_0x32b774[_0x523f('0x47')]['id']}},_0x26e9af={};_0x26e9af[_0x523f('0x2d')]=_[_0x523f('0x2f')](db[_0x523f('0x2b')][_0x523f('0x2c')]);_0x26e9af[_0x523f('0x2e')]=_['keys'](_0x32b774[_0x523f('0x2e')]);_0x26e9af['filters']=_[_0x523f('0x31')](_0x26e9af['model'],_0x26e9af[_0x523f('0x2e')]);_0x1913d4[_0x523f('0x30')]=_[_0x523f('0x31')](_0x26e9af[_0x523f('0x2d')],qs[_0x523f('0x32')](_0x32b774['query']['fields']));_0x1913d4['attributes']=_0x1913d4[_0x523f('0x30')][_0x523f('0x33')]?_0x1913d4[_0x523f('0x30')]:_0x26e9af['model'];if(_0x32b774[_0x523f('0x2e')][_0x523f('0x41')]){_0x1913d4['include']=[{'all':!![]}];}_0x1913d4=_[_0x523f('0x3c')]({},_0x1913d4,_0x32b774[_0x523f('0x40')]);return db['OpenchannelQueue']['find'](_0x1913d4)[_0x523f('0x23')](handleEntityNotFound(_0x5d6a57,null))[_0x523f('0x23')](respondWithResult(_0x5d6a57,null))[_0x523f('0x45')](handleError(_0x5d6a57,null));};exports['create']=function(_0x3f981c,_0x15ddd7){return db[_0x523f('0x2b')][_0x523f('0x48')](_0x3f981c[_0x523f('0x49')],{})[_0x523f('0x23')](function(_0x18969a){var _0x367db0=_0x3f981c[_0x523f('0x4a')]['get']({'plain':!![]});if(!_0x367db0)throw new Error(_0x523f('0x4b'));if(_0x367db0[_0x523f('0x4c')]===_0x523f('0x4a')){var _0x4cfc2b=_0x18969a['get']({'plain':!![]});var _0x337557=_0x523f('0x4d');return db['UserProfileSection'][_0x523f('0x4e')]({'where':{'name':_0x337557,'userProfileId':_0x367db0[_0x523f('0x4f')]},'raw':!![]})[_0x523f('0x23')](function(_0x4bc05a){if(_0x4bc05a&&_0x4bc05a[_0x523f('0x50')]===0x0){return db[_0x523f('0x51')][_0x523f('0x48')]({'name':_0x4cfc2b[_0x523f('0x28')],'resourceId':_0x4cfc2b['id'],'type':_0x4bc05a[_0x523f('0x28')],'sectionId':_0x4bc05a['id']},{})['then'](function(){return _0x18969a;});}else{return _0x18969a;}})[_0x523f('0x45')](function(_0x41cee2){logger[_0x523f('0x26')](_0x523f('0x52'),_0x41cee2);throw _0x41cee2;});}return _0x18969a;})[_0x523f('0x23')](respondWithResult(_0x15ddd7,0xc9))[_0x523f('0x45')](handleError(_0x15ddd7,null));};exports['update']=function(_0x3cc2bb,_0x70beb0){if(_0x3cc2bb[_0x523f('0x49')]['id']){delete _0x3cc2bb[_0x523f('0x49')]['id'];}return db[_0x523f('0x2b')][_0x523f('0x4e')]({'where':{'id':_0x3cc2bb['params']['id']}})[_0x523f('0x23')](handleEntityNotFound(_0x70beb0,null))['then'](saveUpdates(_0x3cc2bb[_0x523f('0x49')],null))['then'](respondWithResult(_0x70beb0,null))[_0x523f('0x45')](handleError(_0x70beb0,null));};exports['destroy']=function(_0x4d09c6,_0x11ddde){return db[_0x523f('0x2b')][_0x523f('0x4e')]({'where':{'id':_0x4d09c6[_0x523f('0x47')]['id']}})[_0x523f('0x23')](handleEntityNotFound(_0x11ddde,null))[_0x523f('0x23')](removeEntity(_0x11ddde,null))['catch'](handleError(_0x11ddde,null));};exports['describe']=function(_0x56db86,_0x3f3ba4){return db[_0x523f('0x2b')][_0x523f('0x53')]()[_0x523f('0x23')](respondWithResult(_0x3f3ba4,null))[_0x523f('0x45')](handleError(_0x3f3ba4,null));};exports['getMembers']=function(_0x28ff88,_0x2a7c24,_0x17ebd){var _0x72ff63={'raw':!![],'where':{}},_0x496cc9={},_0x50b6df;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x28ff88[_0x523f('0x47')]['id']}})[_0x523f('0x23')](handleEntityNotFound(_0x2a7c24,null))[_0x523f('0x23')](function(_0x53d1db){if(_0x53d1db){_0x50b6df=_0x53d1db[_0x523f('0x25')]({'plain':!![]});_0x496cc9[_0x523f('0x2d')]=_[_0x523f('0x2f')](db[_0x523f('0x54')][_0x523f('0x2c')]);_0x496cc9[_0x523f('0x2e')]=_['keys'](_0x28ff88['query']);_0x496cc9[_0x523f('0x39')]=_[_0x523f('0x31')](_0x496cc9['model'],_0x496cc9['query']);_0x72ff63[_0x523f('0x30')]=_[_0x523f('0x31')](_0x496cc9[_0x523f('0x2d')],qs['fields'](_0x28ff88[_0x523f('0x2e')][_0x523f('0x32')]));_0x72ff63[_0x523f('0x30')]=_0x72ff63['attributes'][_0x523f('0x33')]?_0x72ff63[_0x523f('0x30')]:_0x496cc9['model'];if(!_0x28ff88[_0x523f('0x2e')][_0x523f('0x34')]('nolimit')){_0x72ff63[_0x523f('0x1e')]=qs[_0x523f('0x1e')](_0x28ff88[_0x523f('0x2e')][_0x523f('0x1e')]);_0x72ff63[_0x523f('0x1d')]=qs[_0x523f('0x1d')](_0x28ff88['query'][_0x523f('0x1d')]);}_0x72ff63[_0x523f('0x36')]=qs[_0x523f('0x37')](_0x28ff88[_0x523f('0x2e')]['sort']);_0x72ff63[_0x523f('0x38')]=qs['filters'](_[_0x523f('0x3a')](_0x28ff88['query'],_0x496cc9[_0x523f('0x39')]));_0x72ff63[_0x523f('0x38')][_0x523f('0x55')]=_0x53d1db['id'];if(_0x28ff88[_0x523f('0x2e')][_0x523f('0x3b')]){_0x72ff63[_0x523f('0x38')]=_[_0x523f('0x3c')](_0x72ff63['where'],{'$or':_['map'](_0x72ff63['attributes'],function(_0x47b82b){var _0xc8a903={};_0xc8a903[_0x47b82b]={'$like':'%'+_0x28ff88['query'][_0x523f('0x3b')]+'%'};return _0xc8a903;})});}_0x72ff63=_[_0x523f('0x3c')]({},_0x72ff63,_0x28ff88[_0x523f('0x40')]);return db[_0x523f('0x54')][_0x523f('0x43')](_0x72ff63);}})[_0x523f('0x23')](function(_0x3e5aa8){if(_0x3e5aa8){return db[_0x523f('0x56')][_0x523f('0x57')]({'where':{'id':_[_0x523f('0x58')](_0x3e5aa8,'UserId'),'role':_0x523f('0x59')},'attributes':['id','name',_0x523f('0x5a'),_0x523f('0x5b'),_0x523f('0x5c')]});}})[_0x523f('0x23')](function(_0x57dfa3){if(_0x57dfa3){return{'count':_0x57dfa3[_0x523f('0x1c')],'rows':_[_0x523f('0x58')](_0x57dfa3['rows'],function(_0x5a713c){return{'membername':_0x5a713c['name'],'UserId':_0x5a713c['id'],'queue_name':_0x50b6df[_0x523f('0x28')],'OpenchannelQueueId':_0x50b6df['id'],'interface':util['format'](_0x523f('0x5d'),_0x523f('0x5e'),_0x5a713c[_0x523f('0x28')]),'penalty':0x0,'paused':_0x5a713c[_0x523f('0x5a')],'createdAt':_0x5a713c[_0x523f('0x5c')],'updatedAt':_0x5a713c[_0x523f('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x523f('0x23')](respondWithFilteredResult(_0x2a7c24,_0x72ff63))['catch'](handleError(_0x2a7c24,null));};exports[_0x523f('0x5f')]=function(_0x23ecd1,_0x410ba3,_0x1306fd){var _0x510d17={};var _0x2a4b84={};var _0x2990cb;var _0x1b6097;return db[_0x523f('0x2b')]['findOne']({'where':{'id':_0x23ecd1[_0x523f('0x47')]['id']}})[_0x523f('0x23')](handleEntityNotFound(_0x410ba3,null))[_0x523f('0x23')](function(_0x2de024){if(_0x2de024){_0x2990cb=_0x2de024;_0x2a4b84['model']=_[_0x523f('0x2f')](db[_0x523f('0x60')][_0x523f('0x2c')]);_0x2a4b84['query']=_[_0x523f('0x2f')](_0x23ecd1[_0x523f('0x2e')]);_0x2a4b84[_0x523f('0x39')]=_[_0x523f('0x31')](_0x2a4b84['model'],_0x2a4b84['query']);_0x510d17[_0x523f('0x30')]=_[_0x523f('0x31')](_0x2a4b84[_0x523f('0x2d')],qs[_0x523f('0x32')](_0x23ecd1['query']['fields']));_0x510d17['attributes']=_0x510d17[_0x523f('0x30')]['length']?_0x510d17[_0x523f('0x30')]:_0x2a4b84['model'];_0x510d17['order']=qs[_0x523f('0x37')](_0x23ecd1[_0x523f('0x2e')][_0x523f('0x37')]);_0x510d17['where']=qs['filters'](_[_0x523f('0x3a')](_0x23ecd1[_0x523f('0x2e')],_0x2a4b84[_0x523f('0x39')]));if(_0x23ecd1[_0x523f('0x2e')][_0x523f('0x3b')]){_0x510d17[_0x523f('0x38')]=_['merge'](_0x510d17[_0x523f('0x38')],{'$or':_[_0x523f('0x58')](_0x510d17[_0x523f('0x30')],function(_0x4492b8){var _0x303298={};_0x303298[_0x4492b8]={'$like':'%'+_0x23ecd1['query'][_0x523f('0x3b')]+'%'};return _0x303298;})});}_0x510d17=_[_0x523f('0x3c')]({},_0x510d17,_0x23ecd1['options']);return _0x2990cb['getTeams'](_0x510d17);}})[_0x523f('0x23')](function(_0x48981b){if(_0x48981b){_0x1b6097=_0x48981b[_0x523f('0x33')];if(!_0x23ecd1['query'][_0x523f('0x34')]('nolimit')){_0x510d17[_0x523f('0x1e')]=qs[_0x523f('0x1e')](_0x23ecd1[_0x523f('0x2e')]['limit']);_0x510d17[_0x523f('0x1d')]=qs[_0x523f('0x1d')](_0x23ecd1[_0x523f('0x2e')][_0x523f('0x1d')]);}return _0x2990cb['getTeams'](_0x510d17);}})[_0x523f('0x23')](function(_0x164b6d){if(_0x164b6d){return _0x164b6d?{'count':_0x1b6097,'rows':_0x164b6d}:null;}})['then'](respondWithResult(_0x410ba3,null))[_0x523f('0x45')](handleError(_0x410ba3,null));};exports[_0x523f('0x61')]=function(_0x248188,_0x18489f,_0x3e6112){var _0x4a516d=_0x248188[_0x523f('0x49')]['teams'];return db[_0x523f('0x60')][_0x523f('0x43')]({'where':{'id':_[_0x523f('0x58')](_0x4a516d,'id')},'attributes':['id'],'include':[{'model':db[_0x523f('0x56')],'as':_0x523f('0x62'),'attributes':['id',_0x523f('0x28'),_0x523f('0x63'),_0x523f('0x64'),_0x523f('0x65')],'raw':!![]}]})['then'](function(_0x4fcb90){if(_0x4fcb90){var _0xf35a03=_[_0x523f('0x66')](_0x4fcb90,function(_0x4212ab){var _0x36252a=_0x4212ab[_0x523f('0x25')]({'plain':!![]});return _0x36252a[_0x523f('0x62')];});return db[_0x523f('0x2b')]['find']({'where':{'id':_0x248188[_0x523f('0x47')]['id']}})[_0x523f('0x23')](function(_0x4b83e4){return db[_0x523f('0x67')][_0x523f('0x68')](function(_0x5cc33d){return _0x4b83e4[_0x523f('0x61')](_[_0x523f('0x58')](_0x4a516d,'id'),{'transaction':_0x5cc33d})[_0x523f('0x23')](function(){return BPromise[_0x523f('0x69')](_0xf35a03,function(_0x22c538){return db[_0x523f('0x54')][_0x523f('0x6a')]({'where':{'UserId':_0x22c538['id'],'OpenchannelQueueId':_0x248188[_0x523f('0x47')]['id']},'transaction':_0x5cc33d});});})['then'](function(){_0xf35a03[_0x523f('0x6b')](function(_0x140908){socket[_0x523f('0x6c')](_0x523f('0x6d'),{'UserId':_0x140908['id'],'OpenchannelQueueId':_0x4b83e4['id']});});});});});}})[_0x523f('0x23')](respondWithStatusCode(_0x18489f,null))['catch'](handleError(_0x18489f,null));};exports['removeTeams']=function(_0x5a0e6c,_0x1757d3,_0x41104c){return db[_0x523f('0x60')][_0x523f('0x43')]({'where':{'id':_0x5a0e6c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x523f('0x56')],'as':_0x523f('0x62'),'attributes':['id'],'raw':!![]}]})[_0x523f('0x23')](handleEntityNotFound(_0x1757d3,null))[_0x523f('0x23')](function(_0x452ba5){var _0x285427=_[_0x523f('0x58')](_0x452ba5,'id');var _0x3075d9=[];var _0x4f3494=[];var _0x437fb5=squel[_0x523f('0x6e')]();_0x437fb5['field'](_0x523f('0x6f'))['from'](_0x523f('0x70'),'tq')[_0x523f('0x71')](_0x523f('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x523f('0x38')](_0x523f('0x73'),_0x5a0e6c[_0x523f('0x47')]['id']);for(var _0x13b539=0x0;_0x13b539<_0x452ba5[_0x523f('0x33')];_0x13b539+=0x1){let _0x464623=_0x452ba5[_0x13b539];for(var _0x861682=0x0;_0x861682<_0x464623[_0x523f('0x62')][_0x523f('0x33')];_0x861682+=0x1){let _0x591024=_0x464623[_0x523f('0x62')][_0x861682];var _0x6d74bf=_0x437fb5['clone']();_0x6d74bf[_0x523f('0x38')](_0x523f('0x74'),_0x591024['id']);_0x4f3494['push'](db[_0x523f('0x67')][_0x523f('0x2e')](_0x6d74bf['toString'](),{'type':db[_0x523f('0x67')][_0x523f('0x75')][_0x523f('0x76')]})[_0x523f('0x23')](function(_0x3add16){if(_0x3add16['length']===0x1){return _0x591024['id'];}else{var _0xccbb7a=_['every'](_[_0x523f('0x58')](_0x3add16,'TeamId'),function(_0x242149){return _['includes'](_0x285427,_0x242149);});if(_0xccbb7a){return _0x591024['id'];}}}));}}return BPromise['all'](_0x4f3494)[_0x523f('0x23')](function(_0x5d940c){_0x3075d9=_(_0x3075d9)[_0x523f('0x77')](_0x5d940c)[_0x523f('0x78')]()[_0x523f('0x79')]();return db['OpenchannelQueue'][_0x523f('0x4e')]({'where':{'id':_0x5a0e6c[_0x523f('0x47')]['id']}})['then'](function(_0x500903){return db[_0x523f('0x67')]['transaction'](function(_0x2876c3){return _0x500903[_0x523f('0x7a')](_0x5a0e6c[_0x523f('0x2e')][_0x523f('0x7b')],{'transaction':_0x2876c3})['then'](function(){if(!_[_0x523f('0x7c')](_0x3075d9)){return _0x500903[_0x523f('0x7d')](_0x3075d9,{'transaction':_0x2876c3});}})[_0x523f('0x23')](function(){_0x3075d9[_0x523f('0x6b')](function(_0x753fbf){socket[_0x523f('0x6c')](_0x523f('0x7e'),{'UserId':_0x753fbf,'OpenchannelQueueId':_0x500903['id']});});});});});});})[_0x523f('0x23')](respondWithStatusCode(_0x1757d3,null))[_0x523f('0x45')](handleError(_0x1757d3,null));};exports['addAgents']=function(_0x3061a0,_0x246d6b,_0x56a5a1){return db[_0x523f('0x2b')][_0x523f('0x4e')]({'where':{'id':_0x3061a0[_0x523f('0x47')]['id']}})['then'](handleEntityNotFound(_0x246d6b,null))['then'](function(_0x1f098b){if(_0x1f098b){return _0x1f098b['addAgents'](_0x3061a0[_0x523f('0x49')]['ids'],_[_0x523f('0x7f')](_0x3061a0[_0x523f('0x49')],[_0x523f('0x7b'),'id'])||{})[_0x523f('0x80')](function(_0x2fbbc5){for(var _0x478462=0x0;_0x478462<_0x3061a0[_0x523f('0x49')][_0x523f('0x7b')][_0x523f('0x33')];_0x478462+=0x1){socket['emit'](_0x523f('0x6d'),{'UserId':_0x3061a0[_0x523f('0x49')][_0x523f('0x7b')][_0x478462],'OpenchannelQueueId':_0x3061a0[_0x523f('0x47')]['id']});}return _0x2fbbc5;});}})['then'](respondWithResult(_0x246d6b,null))[_0x523f('0x45')](handleError(_0x246d6b,null));};exports[_0x523f('0x7d')]=function(_0x2f4fc5,_0x3f9767,_0x31a6e1){return db[_0x523f('0x2b')][_0x523f('0x4e')]({'where':{'id':_0x2f4fc5[_0x523f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f9767,null))[_0x523f('0x23')](function(_0x2eb98e){if(_0x2eb98e){return _0x2eb98e[_0x523f('0x7d')](_0x2f4fc5[_0x523f('0x2e')][_0x523f('0x7b')])[_0x523f('0x23')](function(){if(_[_0x523f('0x81')](_0x2f4fc5[_0x523f('0x2e')][_0x523f('0x7b')])){for(var _0x27375e=0x0;_0x27375e<_0x2f4fc5['query'][_0x523f('0x7b')]['length'];_0x27375e+=0x1){socket[_0x523f('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2f4fc5[_0x523f('0x2e')]['ids'][_0x27375e]),'OpenchannelQueueId':Number(_0x2f4fc5['params']['id'])});}}else{socket[_0x523f('0x6c')](_0x523f('0x7e'),{'UserId':Number(_0x2f4fc5['query'][_0x523f('0x7b')]),'OpenchannelQueueId':Number(_0x2f4fc5[_0x523f('0x47')]['id'])});}});}})[_0x523f('0x23')](respondWithStatusCode(_0x3f9767,null))[_0x523f('0x45')](handleError(_0x3f9767,null));};exports[_0x523f('0x82')]=function(_0xe29705,_0x550a09,_0x30dc03){var _0x347da9={};var _0x2b0898={};var _0x28aa75;var _0x4a8716;return db[_0x523f('0x2b')][_0x523f('0x83')]({'where':{'id':_0xe29705[_0x523f('0x47')]['id']}})[_0x523f('0x23')](handleEntityNotFound(_0x550a09,null))[_0x523f('0x23')](function(_0xfcadbe){if(_0xfcadbe){_0x28aa75=_0xfcadbe;_0x2b0898[_0x523f('0x2d')]=_[_0x523f('0x2f')](db[_0x523f('0x56')][_0x523f('0x2c')]);_0x2b0898[_0x523f('0x2e')]=_['keys'](_0xe29705[_0x523f('0x2e')]);_0x2b0898[_0x523f('0x39')]=_['intersection'](_0x2b0898[_0x523f('0x2d')],_0x2b0898[_0x523f('0x2e')]);_0x347da9[_0x523f('0x30')]=_[_0x523f('0x31')](_0x2b0898[_0x523f('0x2d')],qs[_0x523f('0x32')](_0xe29705[_0x523f('0x2e')][_0x523f('0x32')]));_0x347da9[_0x523f('0x30')]=_0x347da9['attributes'][_0x523f('0x33')]?_0x347da9[_0x523f('0x30')]:_0x2b0898[_0x523f('0x2d')];_0x347da9[_0x523f('0x36')]=qs[_0x523f('0x37')](_0xe29705[_0x523f('0x2e')][_0x523f('0x37')]);_0x347da9[_0x523f('0x38')]=qs[_0x523f('0x39')](_[_0x523f('0x3a')](_0xe29705[_0x523f('0x2e')],_0x2b0898[_0x523f('0x39')]));if(_0xe29705[_0x523f('0x2e')]['filter']){_0x347da9[_0x523f('0x38')]=_['merge'](_0x347da9['where'],{'$or':_[_0x523f('0x58')](_0x347da9[_0x523f('0x30')],function(_0x31ac63){var _0xdbd6ba={};_0xdbd6ba[_0x31ac63]={'$like':'%'+_0xe29705['query'][_0x523f('0x3b')]+'%'};return _0xdbd6ba;})});}_0x347da9=_[_0x523f('0x3c')]({},_0x347da9,_0xe29705[_0x523f('0x40')]);return _0x28aa75[_0x523f('0x82')](_0x347da9);}})[_0x523f('0x23')](function(_0x5e785e){if(_0x5e785e){_0x4a8716=_0x5e785e['length'];if(!_0xe29705[_0x523f('0x2e')]['hasOwnProperty']('nolimit')){_0x347da9[_0x523f('0x1e')]=qs[_0x523f('0x1e')](_0xe29705[_0x523f('0x2e')][_0x523f('0x1e')]);_0x347da9[_0x523f('0x1d')]=qs['offset'](_0xe29705[_0x523f('0x2e')][_0x523f('0x1d')]);}return _0x28aa75[_0x523f('0x82')](_0x347da9);}})[_0x523f('0x23')](function(_0x40bf2d){if(_0x40bf2d){return _0x40bf2d?{'count':_0x4a8716,'rows':_0x40bf2d}:null;}})[_0x523f('0x23')](respondWithResult(_0x550a09,null))[_0x523f('0x45')](handleError(_0x550a09,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5823049..e24451a 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 _0xdbe3=['../../mysqldb','OpenchannelQueue','update','hasOwnProperty','exports','events'];(function(_0x1b745b,_0x3e2d40){var _0x120a9d=function(_0x882a6c){while(--_0x882a6c){_0x1b745b['push'](_0x1b745b['shift']());}};_0x120a9d(++_0x3e2d40);}(_0xdbe3,0xbf));var _0x3dbe=function(_0x44b15d,_0x13a93a){_0x44b15d=_0x44b15d-0x0;var _0x757328=_0xdbe3[_0x44b15d];return _0x757328;};'use strict';var EventEmitter=require(_0x3dbe('0x0'));var OpenchannelQueue=require(_0x3dbe('0x1'))['db'][_0x3dbe('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3dbe('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41b9da){return function(_0xe03040,_0x3ebe11,_0xd0c77){OpenchannelQueueEvents['emit'](_0x41b9da+':'+_0xe03040['id'],_0xe03040);OpenchannelQueueEvents['emit'](_0x41b9da,_0xe03040);_0xd0c77(null);};}for(var e in events){if(events[_0x3dbe('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x3dbe('0x5')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x310b=['hook','events','OpenchannelQueue','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x33fe87,_0x433c6e){var _0xfddde5=function(_0x2a5cc9){while(--_0x2a5cc9){_0x33fe87['push'](_0x33fe87['shift']());}};_0xfddde5(++_0x433c6e);}(_0x310b,0x19e));var _0xb310=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x310b[_0x16b9ed];return _0x66b1f8;};'use strict';var EventEmitter=require(_0xb310('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xb310('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb310('0x2')](0x0);var events={'afterCreate':_0xb310('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a09db){return function(_0x336739,_0xcc19a3,_0x4a5ba4){OpenchannelQueueEvents['emit'](_0x4a09db+':'+_0x336739['id'],_0x336739);OpenchannelQueueEvents[_0xb310('0x4')](_0x4a09db,_0x336739);_0x4a5ba4(null);};}for(var e in events){if(events[_0xb310('0x5')](e)){var event=events[e];OpenchannelQueue[_0xb310('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6634506..dc98234 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 _0x46b2=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','util','moment','request-promise'];(function(_0x507fca,_0x479b9b){var _0x5df203=function(_0x4ee223){while(--_0x4ee223){_0x507fca['push'](_0x507fca['shift']());}};_0x5df203(++_0x479b9b);}(_0x46b2,0xc5));var _0x246b=function(_0x30933a,_0x2f464d){_0x30933a=_0x30933a-0x0;var _0x481896=_0x46b2[_0x30933a];return _0x481896;};'use strict';var _=require('lodash');var util=require(_0x246b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x246b('0x1'));var BPromise=require('bluebird');var rp=require(_0x246b('0x2'));var fs=require('fs');var path=require(_0x246b('0x3'));var rimraf=require(_0x246b('0x4'));var config=require(_0x246b('0x5'));var attributes=require(_0x246b('0x6'));module[_0x246b('0x7')]=function(_0x2b4dcd,_0x156d85){return _0x2b4dcd[_0x246b('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x246b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad93=['bluebird','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api'];(function(_0x1892aa,_0x5e348e){var _0x3fa32e=function(_0x50fded){while(--_0x50fded){_0x1892aa['push'](_0x1892aa['shift']());}};_0x3fa32e(++_0x5e348e);}(_0xad93,0x1e6));var _0x3ad9=function(_0x57091a,_0x914cdd){_0x57091a=_0x57091a-0x0;var _0x5f2641=_0xad93[_0x57091a];return _0x5f2641;};'use strict';var _=require(_0x3ad9('0x0'));var util=require(_0x3ad9('0x1'));var logger=require(_0x3ad9('0x2'))(_0x3ad9('0x3'));var moment=require('moment');var BPromise=require(_0x3ad9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ad9('0x5'));var rimraf=require(_0x3ad9('0x6'));var config=require(_0x3ad9('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x3ad9('0x8')]=function(_0x8abafc,_0x3e0a88){return _0x8abafc[_0x3ad9('0x9')]('OpenchannelQueue',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 f3dfb76..88ee29e 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 _0xb0b9=['error','OpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','find','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelQueue.socket','register','request','then','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x61dae0,_0x5b5df4){_0x61dae0=_0x61dae0-0x0;var _0x5d4a78=_0xb0b9[_0x61dae0];return _0x5d4a78;};'use strict';var _=require(_0x9b0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b0b('0x1'));var rs=require(_0x9b0b('0x2'));var fs=require('fs');var Redis=require(_0x9b0b('0x3'));var db=require(_0x9b0b('0x4'))['db'];var utils=require(_0x9b0b('0x5'));var logger=require(_0x9b0b('0x6'))(_0x9b0b('0x7'));var config=require(_0x9b0b('0x8'));var jayson=require(_0x9b0b('0x9'));var client=jayson[_0x9b0b('0xa')][_0x9b0b('0xb')]({'port':0x232a});config[_0x9b0b('0xc')]=_[_0x9b0b('0xd')](config[_0x9b0b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b0b('0xc')]));require(_0x9b0b('0xe'))[_0x9b0b('0xf')](socket);function respondWithRpcPromise(_0x2b0384,_0x2b0fd2,_0xc07d94){return new BPromise(function(_0x5713db,_0x426bc4){return client[_0x9b0b('0x10')](_0x2b0384,_0xc07d94)[_0x9b0b('0x11')](function(_0x40c06b){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x2b0fd2,_0x9b0b('0x12'));logger['debug'](_0x9b0b('0x13'),_0x2b0fd2,'request\x20sent',JSON[_0x9b0b('0x14')](_0x40c06b));if(_0x40c06b[_0x9b0b('0x15')]){if(_0x40c06b['error']['code']===0x1f4){logger[_0x9b0b('0x15')](_0x9b0b('0x16'),_0x2b0fd2,_0x40c06b[_0x9b0b('0x15')]['message']);return _0x426bc4(_0x40c06b[_0x9b0b('0x15')][_0x9b0b('0x17')]);}logger[_0x9b0b('0x15')](_0x9b0b('0x16'),_0x2b0fd2,_0x40c06b[_0x9b0b('0x15')][_0x9b0b('0x17')]);return _0x5713db(_0x40c06b[_0x9b0b('0x15')][_0x9b0b('0x17')]);}else{logger[_0x9b0b('0x18')](_0x9b0b('0x16'),_0x2b0fd2,_0x9b0b('0x12'));_0x5713db(_0x40c06b[_0x9b0b('0x19')][_0x9b0b('0x17')]);}})[_0x9b0b('0x1a')](function(_0x51277a){logger[_0x9b0b('0x15')](_0x9b0b('0x16'),_0x2b0fd2,_0x51277a);_0x426bc4(_0x51277a);});});}exports[_0x9b0b('0x1b')]=function(_0x57117b){var _0x363dbc=this;return new Promise(function(_0x20df69,_0x4067d3){return db['OpenchannelQueue'][_0x9b0b('0x1c')]({'raw':_0x57117b[_0x9b0b('0x1d')]?_0x57117b[_0x9b0b('0x1d')][_0x9b0b('0x1e')]===undefined?!![]:![]:!![],'where':_0x57117b['options']?_0x57117b[_0x9b0b('0x1d')][_0x9b0b('0x1f')]||null:null,'attributes':_0x57117b['options']?_0x57117b[_0x9b0b('0x1d')][_0x9b0b('0x20')]||null:null,'limit':_0x57117b[_0x9b0b('0x1d')]?_0x57117b[_0x9b0b('0x1d')][_0x9b0b('0x21')]||null:null,'include':_0x57117b[_0x9b0b('0x1d')]?_0x57117b[_0x9b0b('0x1d')][_0x9b0b('0x22')]?_[_0x9b0b('0x23')](_0x57117b['options'][_0x9b0b('0x22')],function(_0x22a136){return{'model':db[_0x22a136[_0x9b0b('0x24')]],'as':_0x22a136['as'],'attributes':_0x22a136[_0x9b0b('0x20')],'include':_0x22a136['include']?_[_0x9b0b('0x23')](_0x22a136[_0x9b0b('0x22')],function(_0x5c9ec3){return{'model':db[_0x5c9ec3[_0x9b0b('0x24')]],'as':_0x5c9ec3['as'],'attributes':_0x5c9ec3[_0x9b0b('0x20')],'include':_0x5c9ec3[_0x9b0b('0x22')]?_['map'](_0x5c9ec3[_0x9b0b('0x22')],function(_0xa4f392){return{'model':db[_0xa4f392[_0x9b0b('0x24')]],'as':_0xa4f392['as'],'attributes':_0xa4f392['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b0b('0x11')](function(_0x32668d){logger[_0x9b0b('0x18')](_0x9b0b('0x1b'),_0x57117b);logger['debug'](_0x9b0b('0x1b'),_0x57117b,JSON[_0x9b0b('0x14')](_0x32668d));_0x20df69(_0x32668d);})['catch'](function(_0x272934){logger[_0x9b0b('0x15')](_0x9b0b('0x1b'),_0x272934[_0x9b0b('0x17')],_0x57117b);_0x4067d3(_0x363dbc[_0x9b0b('0x15')](0x1f4,_0x272934[_0x9b0b('0x17')]));});});};exports[_0x9b0b('0x25')]=function(_0xdd08df){var _0x4ef44d=this;return new Promise(function(_0x4afc53,_0x3fcf01){return db['OpenchannelQueue'][_0x9b0b('0x26')]({'raw':_0xdd08df['options']?_0xdd08df['options']['raw']===undefined?!![]:![]:!![],'where':_0xdd08df[_0x9b0b('0x1d')]?_0xdd08df[_0x9b0b('0x1d')][_0x9b0b('0x1f')]||null:null,'attributes':_0xdd08df[_0x9b0b('0x1d')]?_0xdd08df[_0x9b0b('0x1d')][_0x9b0b('0x20')]||null:null,'include':_0xdd08df[_0x9b0b('0x1d')]?_0xdd08df[_0x9b0b('0x1d')][_0x9b0b('0x22')]?_[_0x9b0b('0x23')](_0xdd08df[_0x9b0b('0x1d')][_0x9b0b('0x22')],function(_0x3b3d74){return{'model':db[_0x3b3d74['model']],'as':_0x3b3d74['as'],'attributes':_0x3b3d74[_0x9b0b('0x20')],'include':_0x3b3d74[_0x9b0b('0x22')]?_[_0x9b0b('0x23')](_0x3b3d74[_0x9b0b('0x22')],function(_0x32c96b){return{'model':db[_0x32c96b[_0x9b0b('0x24')]],'as':_0x32c96b['as'],'attributes':_0x32c96b[_0x9b0b('0x20')],'include':_0x32c96b[_0x9b0b('0x22')]?_[_0x9b0b('0x23')](_0x32c96b[_0x9b0b('0x22')],function(_0x37569e){return{'model':db[_0x37569e[_0x9b0b('0x24')]],'as':_0x37569e['as'],'attributes':_0x37569e[_0x9b0b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58cd7f){logger[_0x9b0b('0x18')](_0x9b0b('0x25'),_0xdd08df);logger[_0x9b0b('0x27')](_0x9b0b('0x25'),_0xdd08df,JSON[_0x9b0b('0x14')](_0x58cd7f));_0x4afc53(_0x58cd7f);})['catch'](function(_0x117f22){logger[_0x9b0b('0x15')](_0x9b0b('0x25'),_0x117f22[_0x9b0b('0x17')],_0xdd08df);_0x3fcf01(_0x4ef44d['error'](0x1f4,_0x117f22['message']));});});}; \ No newline at end of file +var _0xe14d=['GetOpenchannelQueue','ShowOpenchannelQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model'];(function(_0x1c2a42,_0x3efa0b){var _0x1ecda2=function(_0x3774af){while(--_0x3774af){_0x1c2a42['push'](_0x1c2a42['shift']());}};_0x1ecda2(++_0x3efa0b);}(_0xe14d,0x1ee));var _0xde14=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe14d[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xde14('0xc')],{'host':_0xde14('0xd'),'port':0x18eb});var socket=require(_0xde14('0xe'))(new Redis(config[_0xde14('0xc')]));require(_0xde14('0xf'))[_0xde14('0x10')](socket);function respondWithRpcPromise(_0xa17e8,_0x1ce0a2,_0x4b2b15){return new BPromise(function(_0x1a7167,_0xe785fb){return client[_0xde14('0x11')](_0xa17e8,_0x4b2b15)[_0xde14('0x12')](function(_0x8e0e){logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));logger[_0xde14('0x16')](_0xde14('0x17'),_0x1ce0a2,_0xde14('0x15'),JSON[_0xde14('0x18')](_0x8e0e));if(_0x8e0e[_0xde14('0x19')]){if(_0x8e0e[_0xde14('0x19')][_0xde14('0x1a')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0xe785fb(_0x8e0e[_0xde14('0x19')]['message']);}logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0x1a7167(_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);}else{logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));_0x1a7167(_0x8e0e[_0xde14('0x1c')]['message']);}})[_0xde14('0x1d')](function(_0x3bfc59){logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x3bfc59);_0xe785fb(_0x3bfc59);});});}exports['GetOpenchannelQueue']=function(_0x394de7){var _0x53e905=this;return new Promise(function(_0x45d101,_0x4c24a8){return db[_0xde14('0x1e')][_0xde14('0x1f')]({'raw':_0x394de7[_0xde14('0x20')]?_0x394de7[_0xde14('0x20')][_0xde14('0x21')]===undefined?!![]:![]:!![],'where':_0x394de7[_0xde14('0x20')]?_0x394de7[_0xde14('0x20')][_0xde14('0x22')]||null:null,'attributes':_0x394de7[_0xde14('0x20')]?_0x394de7[_0xde14('0x20')][_0xde14('0x23')]||null:null,'limit':_0x394de7[_0xde14('0x20')]?_0x394de7[_0xde14('0x20')]['limit']||null:null,'include':_0x394de7[_0xde14('0x20')]?_0x394de7[_0xde14('0x20')][_0xde14('0x24')]?_[_0xde14('0x25')](_0x394de7[_0xde14('0x20')][_0xde14('0x24')],function(_0x310d75){return{'model':db[_0x310d75[_0xde14('0x26')]],'as':_0x310d75['as'],'attributes':_0x310d75[_0xde14('0x23')],'include':_0x310d75[_0xde14('0x24')]?_['map'](_0x310d75[_0xde14('0x24')],function(_0x1696ee){return{'model':db[_0x1696ee[_0xde14('0x26')]],'as':_0x1696ee['as'],'attributes':_0x1696ee[_0xde14('0x23')],'include':_0x1696ee['include']?_[_0xde14('0x25')](_0x1696ee[_0xde14('0x24')],function(_0x30c4a8){return{'model':db[_0x30c4a8['model']],'as':_0x30c4a8['as'],'attributes':_0x30c4a8[_0xde14('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2760f9){logger[_0xde14('0x13')](_0xde14('0x27'),_0x394de7);logger[_0xde14('0x16')](_0xde14('0x27'),_0x394de7,JSON[_0xde14('0x18')](_0x2760f9));_0x45d101(_0x2760f9);})[_0xde14('0x1d')](function(_0x464666){logger['error'](_0xde14('0x27'),_0x464666[_0xde14('0x1b')],_0x394de7);_0x4c24a8(_0x53e905['error'](0x1f4,_0x464666[_0xde14('0x1b')]));});});};exports['ShowOpenchannelQueue']=function(_0x2e40ad){var _0x44e88a=this;return new Promise(function(_0x27da49,_0x21a916){return db[_0xde14('0x1e')]['find']({'raw':_0x2e40ad[_0xde14('0x20')]?_0x2e40ad[_0xde14('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2e40ad[_0xde14('0x20')]?_0x2e40ad[_0xde14('0x20')][_0xde14('0x22')]||null:null,'attributes':_0x2e40ad[_0xde14('0x20')]?_0x2e40ad[_0xde14('0x20')][_0xde14('0x23')]||null:null,'include':_0x2e40ad[_0xde14('0x20')]?_0x2e40ad[_0xde14('0x20')][_0xde14('0x24')]?_['map'](_0x2e40ad['options'][_0xde14('0x24')],function(_0x403007){return{'model':db[_0x403007[_0xde14('0x26')]],'as':_0x403007['as'],'attributes':_0x403007[_0xde14('0x23')],'include':_0x403007[_0xde14('0x24')]?_[_0xde14('0x25')](_0x403007[_0xde14('0x24')],function(_0x2b0bc4){return{'model':db[_0x2b0bc4[_0xde14('0x26')]],'as':_0x2b0bc4['as'],'attributes':_0x2b0bc4['attributes'],'include':_0x2b0bc4[_0xde14('0x24')]?_['map'](_0x2b0bc4['include'],function(_0x4c1e37){return{'model':db[_0x4c1e37[_0xde14('0x26')]],'as':_0x4c1e37['as'],'attributes':_0x4c1e37[_0xde14('0x23')]};}):[]};}):[]};}):[]:[]})[_0xde14('0x12')](function(_0x152dab){logger[_0xde14('0x13')](_0xde14('0x28'),_0x2e40ad);logger[_0xde14('0x16')](_0xde14('0x28'),_0x2e40ad,JSON['stringify'](_0x152dab));_0x27da49(_0x152dab);})[_0xde14('0x1d')](function(_0x3883b9){logger[_0xde14('0x19')](_0xde14('0x28'),_0x3883b9[_0xde14('0x1b')],_0x2e40ad);_0x21a916(_0x44e88a[_0xde14('0x19')](0x1f4,_0x3883b9[_0xde14('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 977e85f..3c03569 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 _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3567fe2..122976c 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b431bfe..0d10278 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 _0x82d1=['DATE','sequelize','exports','STRING'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x82d1,0x1c5));var _0x182d=function(_0x1dd581,_0x4c3820){_0x1dd581=_0x1dd581-0x0;var _0x1f5e30=_0x82d1[_0x1dd581];return _0x1f5e30;};'use strict';var moment=require('moment');var Sequelize=require(_0x182d('0x0'));module[_0x182d('0x1')]={'uniqueid':{'type':Sequelize[_0x182d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x182d('0x2')]},'joinAt':{'type':Sequelize[_0x182d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x182d('0x3')]},'exitAt':{'type':Sequelize[_0x182d('0x3')]},'reason':{'type':Sequelize[_0x182d('0x2')]}}; \ No newline at end of file +var _0x8b29=['DATE','exports','STRING'];(function(_0x14f7b7,_0x384246){var _0x207bc1=function(_0x1fe907){while(--_0x1fe907){_0x14f7b7['push'](_0x14f7b7['shift']());}};_0x207bc1(++_0x384246);}(_0x8b29,0xeb));var _0x98b2=function(_0x52922f,_0x518b4d){_0x52922f=_0x52922f-0x0;var _0x597a97=_0x8b29[_0x52922f];return _0x597a97;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x98b2('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x98b2('0x1')]},'joinAt':{'type':Sequelize[_0x98b2('0x2')]},'leaveAt':{'type':Sequelize[_0x98b2('0x2')]},'acceptAt':{'type':Sequelize[_0x98b2('0x2')]},'exitAt':{'type':Sequelize[_0x98b2('0x2')]},'reason':{'type':Sequelize[_0x98b2('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 46ad41e..4f66a8a 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 _0x0c11=['merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','destroy','describe','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','index','OpenchannelQueueReport','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL'];(function(_0x3c9afd,_0x8a5cf2){var _0x4a378a=function(_0x39a8a9){while(--_0x39a8a9){_0x3c9afd['push'](_0x3c9afd['shift']());}};_0x4a378a(++_0x8a5cf2);}(_0x0c11,0x162));var _0x10c1=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0x0c11[_0x3747ae];return _0x339035;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x10c1('0x0'));var rimraf=require(_0x10c1('0x1'));var zipdir=require(_0x10c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x10c1('0x3'));var Mustache=require(_0x10c1('0x4'));var util=require('util');var path=require(_0x10c1('0x5'));var sox=require(_0x10c1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x10c1('0x7'));var squel=require(_0x10c1('0x8'));var crypto=require('crypto');var jsforce=require(_0x10c1('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x10c1('0xa'));var Papa=require(_0x10c1('0xb'));var Redis=require(_0x10c1('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x10c1('0xd'));var logger=require(_0x10c1('0xe'))(_0x10c1('0xf'));var utils=require(_0x10c1('0x10'));var config=require(_0x10c1('0x11'));var db=require(_0x10c1('0x12'))['db'];function respondWithStatusCode(_0x484f2f,_0x2a93e4){_0x2a93e4=_0x2a93e4||0xcc;return function(_0x50a257){if(_0x50a257){return _0x484f2f['sendStatus'](_0x2a93e4);}return _0x484f2f['status'](_0x2a93e4)['end']();};}function respondWithResult(_0x2c5237,_0x5a5b1a){_0x5a5b1a=_0x5a5b1a||0xc8;return function(_0x32e8dc){if(_0x32e8dc){return _0x2c5237[_0x10c1('0x13')](_0x5a5b1a)['json'](_0x32e8dc);}};}function respondWithFilteredResult(_0x1fd558,_0x392cc5){return function(_0x22cec9){if(_0x22cec9){var _0x213ad9=_0x22cec9[_0x10c1('0x14')],_0x2aca89=_0x392cc5[_0x10c1('0x15')],_0x104eb1=_0x392cc5['offset']+_0x392cc5['limit'],_0x4b479e;if(_0x104eb1>=_0x213ad9){_0x104eb1=_0x213ad9;_0x4b479e=0xc8;}else{_0x4b479e=0xce;}_0x1fd558[_0x10c1('0x13')](_0x4b479e);return _0x1fd558['set'](_0x10c1('0x16'),_0x2aca89+'-'+_0x104eb1+'/'+_0x213ad9)['json'](_0x22cec9);}return null;};}function patchUpdates(_0x3efb8f){return function(_0x3bd5f1){try{jsonpatch[_0x10c1('0x17')](_0x3bd5f1,_0x3efb8f,!![]);}catch(_0x5a8215){return BPromise[_0x10c1('0x18')](_0x5a8215);}return _0x3bd5f1[_0x10c1('0x19')]();};}function saveUpdates(_0x20d361,_0x2319b8){return function(_0xe6b7cb){if(_0xe6b7cb){return _0xe6b7cb[_0x10c1('0x1a')](_0x20d361)[_0x10c1('0x1b')](function(_0x26871e){return _0x26871e;});}return null;};}function removeEntity(_0x119161,_0x14207c){return function(_0x2d10d0){if(_0x2d10d0){return _0x2d10d0['destroy']()['then'](function(){_0x119161[_0x10c1('0x13')](0xcc)[_0x10c1('0x1c')]();});}};}function handleEntityNotFound(_0x5a58dc,_0x1b5b0c){return function(_0x2eaace){if(!_0x2eaace){_0x5a58dc[_0x10c1('0x1d')](0x194);}return _0x2eaace;};}function handleError(_0x552d60,_0xe25986){_0xe25986=_0xe25986||0x1f4;return function(_0x272fcc){logger['error'](_0x272fcc[_0x10c1('0x1e')]);if(_0x272fcc[_0x10c1('0x1f')]){delete _0x272fcc[_0x10c1('0x1f')];}_0x552d60[_0x10c1('0x13')](_0xe25986)['send'](_0x272fcc);};}exports[_0x10c1('0x20')]=function(_0x494eb4,_0x396d1f){var _0x48256f={},_0x43dbeb={},_0x172c8f={'count':0x0,'rows':[]};var _0x136032=db[_0x10c1('0x21')]['rawAttributes'];_0x43dbeb[_0x10c1('0x22')]=_[_0x10c1('0x23')](_0x136032);_0x43dbeb[_0x10c1('0x24')]=_[_0x10c1('0x23')](_0x494eb4[_0x10c1('0x24')]);_0x43dbeb['filters']=_[_0x10c1('0x25')](_0x43dbeb[_0x10c1('0x22')],_0x43dbeb['query']);_0x48256f[_0x10c1('0x26')]=_[_0x10c1('0x25')](_0x43dbeb['model'],qs[_0x10c1('0x27')](_0x494eb4['query']['fields']));_0x48256f[_0x10c1('0x26')]=_0x48256f['attributes'][_0x10c1('0x28')]?_0x48256f[_0x10c1('0x26')]:_0x43dbeb[_0x10c1('0x22')];if(!_0x494eb4[_0x10c1('0x24')][_0x10c1('0x29')](_0x10c1('0x2a'))){_0x48256f[_0x10c1('0x2b')]=qs[_0x10c1('0x2b')](_0x494eb4[_0x10c1('0x24')]['limit']);_0x48256f[_0x10c1('0x15')]=qs['offset'](_0x494eb4[_0x10c1('0x24')][_0x10c1('0x15')]);}_0x48256f[_0x10c1('0x2c')]=qs['sort'](_0x494eb4[_0x10c1('0x24')][_0x10c1('0x2d')]);_0x48256f[_0x10c1('0x2e')]=qs[_0x10c1('0x2f')](_[_0x10c1('0x30')](_0x494eb4[_0x10c1('0x24')],_0x43dbeb[_0x10c1('0x2f')]));if(_0x494eb4[_0x10c1('0x24')][_0x10c1('0x31')]){_0x48256f['where']=_['merge'](_0x48256f[_0x10c1('0x2e')],{'$or':_[_0x10c1('0x32')](_0x136032,function(_0x43de1e){if(_0x43de1e[_0x10c1('0x33')][_0x10c1('0x34')]!==_0x10c1('0x35')){var _0x32e67f={};_0x32e67f[_0x43de1e['field']]={'$like':'%'+_0x494eb4[_0x10c1('0x24')][_0x10c1('0x31')]+'%'};return _0x32e67f;}})});}_0x48256f=_[_0x10c1('0x36')]({},_0x48256f,_0x494eb4[_0x10c1('0x37')]);var _0x14b0e={'where':_0x48256f[_0x10c1('0x2e')]};return db[_0x10c1('0x21')][_0x10c1('0x14')](_0x14b0e)['then'](function(_0x305fea){_0x172c8f[_0x10c1('0x14')]=_0x305fea;if(_0x494eb4[_0x10c1('0x24')][_0x10c1('0x38')]){_0x48256f[_0x10c1('0x39')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x10c1('0x3a')](_0x48256f);})[_0x10c1('0x1b')](function(_0x2f0e69){_0x172c8f[_0x10c1('0x3b')]=_0x2f0e69;return _0x172c8f;})['then'](respondWithFilteredResult(_0x396d1f,_0x48256f))[_0x10c1('0x3c')](handleError(_0x396d1f,null));};exports[_0x10c1('0x3d')]=function(_0x49ad19,_0x4c3b7d){var _0x308724={'raw':!![],'where':{'id':_0x49ad19[_0x10c1('0x3e')]['id']}},_0x39e22d={};_0x39e22d['model']=_['keys'](db[_0x10c1('0x21')][_0x10c1('0x3f')]);_0x39e22d[_0x10c1('0x24')]=_['keys'](_0x49ad19[_0x10c1('0x24')]);_0x39e22d[_0x10c1('0x2f')]=_[_0x10c1('0x25')](_0x39e22d[_0x10c1('0x22')],_0x39e22d[_0x10c1('0x24')]);_0x308724[_0x10c1('0x26')]=_[_0x10c1('0x25')](_0x39e22d['model'],qs[_0x10c1('0x27')](_0x49ad19['query'][_0x10c1('0x27')]));_0x308724[_0x10c1('0x26')]=_0x308724[_0x10c1('0x26')][_0x10c1('0x28')]?_0x308724['attributes']:_0x39e22d['model'];if(_0x49ad19[_0x10c1('0x24')][_0x10c1('0x38')]){_0x308724['include']=[{'all':!![]}];}_0x308724=_['merge']({},_0x308724,_0x49ad19[_0x10c1('0x37')]);return db[_0x10c1('0x21')][_0x10c1('0x40')](_0x308724)['then'](handleEntityNotFound(_0x4c3b7d,null))[_0x10c1('0x1b')](respondWithResult(_0x4c3b7d,null))['catch'](handleError(_0x4c3b7d,null));};exports['create']=function(_0x30e211,_0x382471){return db['OpenchannelQueueReport']['create'](_0x30e211[_0x10c1('0x41')],{})[_0x10c1('0x1b')](respondWithResult(_0x382471,0xc9))[_0x10c1('0x3c')](handleError(_0x382471,null));};exports[_0x10c1('0x1a')]=function(_0x2486ca,_0x1d05fa){if(_0x2486ca[_0x10c1('0x41')]['id']){delete _0x2486ca[_0x10c1('0x41')]['id'];}return db[_0x10c1('0x21')][_0x10c1('0x40')]({'where':{'id':_0x2486ca[_0x10c1('0x3e')]['id']}})[_0x10c1('0x1b')](handleEntityNotFound(_0x1d05fa,null))[_0x10c1('0x1b')](saveUpdates(_0x2486ca['body'],null))[_0x10c1('0x1b')](respondWithResult(_0x1d05fa,null))[_0x10c1('0x3c')](handleError(_0x1d05fa,null));};exports[_0x10c1('0x42')]=function(_0x5b8487,_0x5dc86b){return db[_0x10c1('0x21')][_0x10c1('0x40')]({'where':{'id':_0x5b8487[_0x10c1('0x3e')]['id']}})[_0x10c1('0x1b')](handleEntityNotFound(_0x5dc86b,null))[_0x10c1('0x1b')](removeEntity(_0x5dc86b,null))['catch'](handleError(_0x5dc86b,null));};exports[_0x10c1('0x43')]=function(_0x338d6c,_0x41a17f){return db[_0x10c1('0x21')][_0x10c1('0x43')]()[_0x10c1('0x1b')](respondWithResult(_0x41a17f,null))[_0x10c1('0x3c')](handleError(_0x41a17f,null));}; \ No newline at end of file +var _0xaaa2=['where','pick','filters','filter','map','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','OpenchannelQueueReport','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x157340,_0x4d6daa){var _0x283dec=function(_0x98eed5){while(--_0x98eed5){_0x157340['push'](_0x157340['shift']());}};_0x283dec(++_0x4d6daa);}(_0xaaa2,0x13d));var _0x2aaa=function(_0x53e562,_0x5f1503){_0x53e562=_0x53e562-0x0;var _0x5a660d=_0xaaa2[_0x53e562];return _0x5a660d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2aaa('0x0'));var rimraf=require(_0x2aaa('0x1'));var zipdir=require(_0x2aaa('0x2'));var jsonpatch=require(_0x2aaa('0x3'));var rp=require(_0x2aaa('0x4'));var moment=require(_0x2aaa('0x5'));var BPromise=require(_0x2aaa('0x6'));var Mustache=require(_0x2aaa('0x7'));var util=require(_0x2aaa('0x8'));var path=require(_0x2aaa('0x9'));var sox=require(_0x2aaa('0xa'));var csv=require(_0x2aaa('0xb'));var ejs=require(_0x2aaa('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2aaa('0xd'));var jsforce=require(_0x2aaa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2aaa('0xb'));var querystring=require(_0x2aaa('0xf'));var Papa=require(_0x2aaa('0x10'));var Redis=require(_0x2aaa('0x11'));var authService=require(_0x2aaa('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2aaa('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2aaa('0x14'));var db=require(_0x2aaa('0x15'))['db'];function respondWithStatusCode(_0x384392,_0x15fe29){_0x15fe29=_0x15fe29||0xcc;return function(_0x232e1c){if(_0x232e1c){return _0x384392['sendStatus'](_0x15fe29);}return _0x384392['status'](_0x15fe29)[_0x2aaa('0x16')]();};}function respondWithResult(_0x538e6a,_0x2e4d45){_0x2e4d45=_0x2e4d45||0xc8;return function(_0x5e11c6){if(_0x5e11c6){return _0x538e6a[_0x2aaa('0x17')](_0x2e4d45)[_0x2aaa('0x18')](_0x5e11c6);}};}function respondWithFilteredResult(_0x1c737e,_0x24be6e){return function(_0x3e9e4c){if(_0x3e9e4c){var _0x5519a5=_0x3e9e4c[_0x2aaa('0x19')],_0x397a87=_0x24be6e[_0x2aaa('0x1a')],_0x26ea23=_0x24be6e[_0x2aaa('0x1a')]+_0x24be6e[_0x2aaa('0x1b')],_0x5e857d;if(_0x26ea23>=_0x5519a5){_0x26ea23=_0x5519a5;_0x5e857d=0xc8;}else{_0x5e857d=0xce;}_0x1c737e['status'](_0x5e857d);return _0x1c737e[_0x2aaa('0x1c')](_0x2aaa('0x1d'),_0x397a87+'-'+_0x26ea23+'/'+_0x5519a5)[_0x2aaa('0x18')](_0x3e9e4c);}return null;};}function patchUpdates(_0x54dd3f){return function(_0xe67454){try{jsonpatch[_0x2aaa('0x1e')](_0xe67454,_0x54dd3f,!![]);}catch(_0x59aac8){return BPromise[_0x2aaa('0x1f')](_0x59aac8);}return _0xe67454[_0x2aaa('0x20')]();};}function saveUpdates(_0x136141,_0x14ed0e){return function(_0x904488){if(_0x904488){return _0x904488[_0x2aaa('0x21')](_0x136141)[_0x2aaa('0x22')](function(_0x12326c){return _0x12326c;});}return null;};}function removeEntity(_0x1be6c3,_0x4342e1){return function(_0x1de78f){if(_0x1de78f){return _0x1de78f[_0x2aaa('0x23')]()[_0x2aaa('0x22')](function(){_0x1be6c3[_0x2aaa('0x17')](0xcc)[_0x2aaa('0x16')]();});}};}function handleEntityNotFound(_0x518947,_0x526671){return function(_0x112ce5){if(!_0x112ce5){_0x518947[_0x2aaa('0x24')](0x194);}return _0x112ce5;};}function handleError(_0x27928d,_0x5b027b){_0x5b027b=_0x5b027b||0x1f4;return function(_0x349b77){logger['error'](_0x349b77[_0x2aaa('0x25')]);if(_0x349b77[_0x2aaa('0x26')]){delete _0x349b77['name'];}_0x27928d[_0x2aaa('0x17')](_0x5b027b)[_0x2aaa('0x27')](_0x349b77);};}exports['index']=function(_0x277ede,_0x488379){var _0x351ad4={},_0x3d6ced={},_0x23fc79={'count':0x0,'rows':[]};var _0x8cb0e4=db[_0x2aaa('0x28')][_0x2aaa('0x29')];_0x3d6ced[_0x2aaa('0x2a')]=_['keys'](_0x8cb0e4);_0x3d6ced['query']=_[_0x2aaa('0x2b')](_0x277ede[_0x2aaa('0x2c')]);_0x3d6ced['filters']=_['intersection'](_0x3d6ced['model'],_0x3d6ced[_0x2aaa('0x2c')]);_0x351ad4[_0x2aaa('0x2d')]=_[_0x2aaa('0x2e')](_0x3d6ced[_0x2aaa('0x2a')],qs[_0x2aaa('0x2f')](_0x277ede[_0x2aaa('0x2c')][_0x2aaa('0x2f')]));_0x351ad4[_0x2aaa('0x2d')]=_0x351ad4[_0x2aaa('0x2d')][_0x2aaa('0x30')]?_0x351ad4[_0x2aaa('0x2d')]:_0x3d6ced[_0x2aaa('0x2a')];if(!_0x277ede[_0x2aaa('0x2c')][_0x2aaa('0x31')](_0x2aaa('0x32'))){_0x351ad4[_0x2aaa('0x1b')]=qs[_0x2aaa('0x1b')](_0x277ede[_0x2aaa('0x2c')]['limit']);_0x351ad4[_0x2aaa('0x1a')]=qs[_0x2aaa('0x1a')](_0x277ede['query'][_0x2aaa('0x1a')]);}_0x351ad4[_0x2aaa('0x33')]=qs[_0x2aaa('0x34')](_0x277ede['query'][_0x2aaa('0x34')]);_0x351ad4[_0x2aaa('0x35')]=qs['filters'](_[_0x2aaa('0x36')](_0x277ede['query'],_0x3d6ced[_0x2aaa('0x37')]));if(_0x277ede['query'][_0x2aaa('0x38')]){_0x351ad4[_0x2aaa('0x35')]=_['merge'](_0x351ad4[_0x2aaa('0x35')],{'$or':_[_0x2aaa('0x39')](_0x8cb0e4,function(_0x4ebe10){if(_0x4ebe10['type'][_0x2aaa('0x3a')]!==_0x2aaa('0x3b')){var _0x3efaee={};_0x3efaee[_0x4ebe10[_0x2aaa('0x3c')]]={'$like':'%'+_0x277ede[_0x2aaa('0x2c')]['filter']+'%'};return _0x3efaee;}})});}_0x351ad4=_[_0x2aaa('0x3d')]({},_0x351ad4,_0x277ede['options']);var _0x1a5d14={'where':_0x351ad4['where']};return db['OpenchannelQueueReport']['count'](_0x1a5d14)['then'](function(_0x4daca6){_0x23fc79[_0x2aaa('0x19')]=_0x4daca6;if(_0x277ede['query'][_0x2aaa('0x3e')]){_0x351ad4[_0x2aaa('0x3f')]=[{'all':!![]}];}return db[_0x2aaa('0x28')][_0x2aaa('0x40')](_0x351ad4);})[_0x2aaa('0x22')](function(_0x52131f){_0x23fc79[_0x2aaa('0x41')]=_0x52131f;return _0x23fc79;})[_0x2aaa('0x22')](respondWithFilteredResult(_0x488379,_0x351ad4))[_0x2aaa('0x42')](handleError(_0x488379,null));};exports[_0x2aaa('0x43')]=function(_0xa234a3,_0x1f5b40){var _0xa732b1={'raw':!![],'where':{'id':_0xa234a3['params']['id']}},_0x5a21e0={};_0x5a21e0[_0x2aaa('0x2a')]=_[_0x2aaa('0x2b')](db[_0x2aaa('0x28')]['rawAttributes']);_0x5a21e0['query']=_[_0x2aaa('0x2b')](_0xa234a3[_0x2aaa('0x2c')]);_0x5a21e0[_0x2aaa('0x37')]=_[_0x2aaa('0x2e')](_0x5a21e0[_0x2aaa('0x2a')],_0x5a21e0[_0x2aaa('0x2c')]);_0xa732b1['attributes']=_[_0x2aaa('0x2e')](_0x5a21e0[_0x2aaa('0x2a')],qs[_0x2aaa('0x2f')](_0xa234a3[_0x2aaa('0x2c')][_0x2aaa('0x2f')]));_0xa732b1['attributes']=_0xa732b1[_0x2aaa('0x2d')]['length']?_0xa732b1[_0x2aaa('0x2d')]:_0x5a21e0[_0x2aaa('0x2a')];if(_0xa234a3[_0x2aaa('0x2c')][_0x2aaa('0x3e')]){_0xa732b1['include']=[{'all':!![]}];}_0xa732b1=_['merge']({},_0xa732b1,_0xa234a3[_0x2aaa('0x44')]);return db[_0x2aaa('0x28')][_0x2aaa('0x45')](_0xa732b1)['then'](handleEntityNotFound(_0x1f5b40,null))[_0x2aaa('0x22')](respondWithResult(_0x1f5b40,null))[_0x2aaa('0x42')](handleError(_0x1f5b40,null));};exports[_0x2aaa('0x46')]=function(_0x47be91,_0x427ec3){return db[_0x2aaa('0x28')]['create'](_0x47be91[_0x2aaa('0x47')],{})[_0x2aaa('0x22')](respondWithResult(_0x427ec3,0xc9))[_0x2aaa('0x42')](handleError(_0x427ec3,null));};exports['update']=function(_0x1e56c9,_0x2dd4a5){if(_0x1e56c9[_0x2aaa('0x47')]['id']){delete _0x1e56c9[_0x2aaa('0x47')]['id'];}return db[_0x2aaa('0x28')][_0x2aaa('0x45')]({'where':{'id':_0x1e56c9[_0x2aaa('0x48')]['id']}})['then'](handleEntityNotFound(_0x2dd4a5,null))[_0x2aaa('0x22')](saveUpdates(_0x1e56c9['body'],null))['then'](respondWithResult(_0x2dd4a5,null))[_0x2aaa('0x42')](handleError(_0x2dd4a5,null));};exports[_0x2aaa('0x23')]=function(_0x5d79f0,_0x42bd41){return db[_0x2aaa('0x28')][_0x2aaa('0x45')]({'where':{'id':_0x5d79f0['params']['id']}})[_0x2aaa('0x22')](handleEntityNotFound(_0x42bd41,null))[_0x2aaa('0x22')](removeEntity(_0x42bd41,null))['catch'](handleError(_0x42bd41,null));};exports['describe']=function(_0x2e1cee,_0x8e12ed){return db[_0x2aaa('0x28')][_0x2aaa('0x49')]()[_0x2aaa('0x22')](respondWithResult(_0x8e12ed,null))[_0x2aaa('0x42')](handleError(_0x8e12ed,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 17aa8e5..dfd3e9e 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 _0x1b73=['request-promise','rimraf','../../config/environment','exports','OpenchannelQueueReport','report_openchannel_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x3d38c3,_0x329903){var _0x3ea84d=function(_0x17e668){while(--_0x17e668){_0x3d38c3['push'](_0x3d38c3['shift']());}};_0x3ea84d(++_0x329903);}(_0x1b73,0x1d5));var _0x31b7=function(_0x3896b6,_0x4d98b9){_0x3896b6=_0x3896b6-0x0;var _0x5af17a=_0x1b73[_0x3896b6];return _0x5af17a;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var logger=require(_0x31b7('0x1'))(_0x31b7('0x2'));var moment=require(_0x31b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x31b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31b7('0x5'));var config=require(_0x31b7('0x6'));var attributes=require('./openchannelQueueReport.attributes');module[_0x31b7('0x7')]=function(_0x3d058f,_0x15c31e){return _0x3d058f['define'](_0x31b7('0x8'),attributes,{'tableName':_0x31b7('0x9'),'paranoid':![],'indexes':[{'name':_0x31b7('0xa'),'fields':[_0x31b7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc3b5=['rimraf','../../config/environment','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a9f01,_0x1791fc){var _0xf95660=function(_0x516b82){while(--_0x516b82){_0x5a9f01['push'](_0x5a9f01['shift']());}};_0xf95660(++_0x1791fc);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x3fecf2,_0x5d26c9){_0x3fecf2=_0x3fecf2-0x0;var _0x59aee0=_0xc3b5[_0x3fecf2];return _0x59aee0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./openchannelQueueReport.attributes');module[_0x5c3b('0x8')]=function(_0x6b8a1e,_0x56345e){return _0x6b8a1e[_0x5c3b('0x9')](_0x5c3b('0xa'),attributes,{'tableName':_0x5c3b('0xb'),'paranoid':![],'indexes':[{'name':_0x5c3b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index e943968..7c32af7 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 _0x9bbb=['body','options','raw','CreateOpenchannelQueueReport','stringify','catch','UpdateOpenchannelQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','OpenchannelQueueReport','create'];(function(_0xa7b166,_0x31c892){var _0x1bd3ef=function(_0x7ac9be){while(--_0x7ac9be){_0xa7b166['push'](_0xa7b166['shift']());}};_0x1bd3ef(++_0x31c892);}(_0x9bbb,0x180));var _0xb9bb=function(_0x31cbea,_0x32d29b){_0x31cbea=_0x31cbea-0x0;var _0x2883f2=_0x9bbb[_0x31cbea];return _0x2883f2;};'use strict';var _=require('lodash');var util=require(_0xb9bb('0x0'));var moment=require(_0xb9bb('0x1'));var BPromise=require(_0xb9bb('0x2'));var rs=require(_0xb9bb('0x3'));var fs=require('fs');var Redis=require(_0xb9bb('0x4'));var db=require(_0xb9bb('0x5'))['db'];var utils=require(_0xb9bb('0x6'));var logger=require(_0xb9bb('0x7'))(_0xb9bb('0x8'));var config=require(_0xb9bb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb9bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2efe79,_0x333518,_0x112849){return new BPromise(function(_0x3dcad3,_0x2b8afb){return client[_0xb9bb('0xb')](_0x2efe79,_0x112849)[_0xb9bb('0xc')](function(_0x260fb6){logger['info'](_0xb9bb('0xd'),_0x333518,'request\x20sent');logger[_0xb9bb('0xe')](_0xb9bb('0xf'),_0x333518,'request\x20sent',JSON['stringify'](_0x260fb6));if(_0x260fb6[_0xb9bb('0x10')]){if(_0x260fb6[_0xb9bb('0x10')][_0xb9bb('0x11')]===0x1f4){logger[_0xb9bb('0x10')](_0xb9bb('0xd'),_0x333518,_0x260fb6[_0xb9bb('0x10')]['message']);return _0x2b8afb(_0x260fb6['error'][_0xb9bb('0x12')]);}logger[_0xb9bb('0x10')](_0xb9bb('0xd'),_0x333518,_0x260fb6[_0xb9bb('0x10')][_0xb9bb('0x12')]);return _0x3dcad3(_0x260fb6['error'][_0xb9bb('0x12')]);}else{logger[_0xb9bb('0x13')](_0xb9bb('0xd'),_0x333518,_0xb9bb('0x14'));_0x3dcad3(_0x260fb6[_0xb9bb('0x15')]['message']);}})['catch'](function(_0x31dd2d){logger[_0xb9bb('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x333518,_0x31dd2d);_0x2b8afb(_0x31dd2d);});});}exports['CreateOpenchannelQueueReport']=function(_0x5ea4b2){var _0x4aed93=this;return new Promise(function(_0x5a1d0b,_0x67e024){return db[_0xb9bb('0x16')][_0xb9bb('0x17')](_0x5ea4b2[_0xb9bb('0x18')],{'raw':_0x5ea4b2['options']?_0x5ea4b2[_0xb9bb('0x19')][_0xb9bb('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x30a4ef){logger[_0xb9bb('0x13')]('CreateOpenchannelQueueReport',_0x5ea4b2);logger[_0xb9bb('0xe')](_0xb9bb('0x1b'),_0x5ea4b2,JSON[_0xb9bb('0x1c')](_0x30a4ef));_0x5a1d0b(_0x30a4ef);})[_0xb9bb('0x1d')](function(_0x442ea0){logger['error']('CreateOpenchannelQueueReport',_0x442ea0['message'],_0x5ea4b2);_0x67e024(_0x4aed93['error'](0x1f4,_0x442ea0[_0xb9bb('0x12')]));});});};exports[_0xb9bb('0x1e')]=function(_0x42a559){var _0x1d2fee=this;return new Promise(function(_0x1a011a,_0x1aa044){return db['OpenchannelQueueReport'][_0xb9bb('0x1f')](_0x42a559[_0xb9bb('0x18')],{'raw':_0x42a559[_0xb9bb('0x19')]?_0x42a559[_0xb9bb('0x19')][_0xb9bb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a559['options']?_0x42a559[_0xb9bb('0x19')]['where']||null:null,'attributes':_0x42a559['options']?_0x42a559[_0xb9bb('0x19')][_0xb9bb('0x20')]||null:null,'limit':_0x42a559[_0xb9bb('0x19')]?_0x42a559[_0xb9bb('0x19')][_0xb9bb('0x21')]||null:null})[_0xb9bb('0xc')](function(_0x40d106){logger['info'](_0xb9bb('0x1e'),_0x42a559);logger[_0xb9bb('0xe')](_0xb9bb('0x1e'),_0x42a559,JSON[_0xb9bb('0x1c')](_0x40d106));_0x1a011a(_0x40d106);})['catch'](function(_0x5e6885){logger[_0xb9bb('0x10')]('UpdateOpenchannelQueueReport',_0x5e6885[_0xb9bb('0x12')],_0x42a559);_0x1aa044(_0x1d2fee['error'](0x1f4,_0x5e6885[_0xb9bb('0x12')]));});});}; \ No newline at end of file +var _0xad8e=['OpenchannelQueueReport','create','options','raw','then','debug','UpdateOpenchannelQueueReport','update','body','where','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xad8e,0x1d2));var _0xead8=function(_0x1c1c55,_0x313def){_0x1c1c55=_0x1c1c55-0x0;var _0x26bb76=_0xad8e[_0x1c1c55];return _0x26bb76;};'use strict';var _=require(_0xead8('0x0'));var util=require('util');var moment=require(_0xead8('0x1'));var BPromise=require(_0xead8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xead8('0x3'));var db=require(_0xead8('0x4'))['db'];var utils=require(_0xead8('0x5'));var logger=require(_0xead8('0x6'))(_0xead8('0x7'));var config=require(_0xead8('0x8'));var jayson=require(_0xead8('0x9'));var client=jayson[_0xead8('0xa')][_0xead8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ddcd0,_0x387480,_0x32d0d1){return new BPromise(function(_0x724623,_0x5ca0ac){return client[_0xead8('0xc')](_0x4ddcd0,_0x32d0d1)['then'](function(_0x11ceeb){logger[_0xead8('0xd')](_0xead8('0xe'),_0x387480,_0xead8('0xf'));logger['debug'](_0xead8('0x10'),_0x387480,_0xead8('0xf'),JSON[_0xead8('0x11')](_0x11ceeb));if(_0x11ceeb['error']){if(_0x11ceeb[_0xead8('0x12')][_0xead8('0x13')]===0x1f4){logger[_0xead8('0x12')](_0xead8('0xe'),_0x387480,_0x11ceeb['error']['message']);return _0x5ca0ac(_0x11ceeb['error']['message']);}logger[_0xead8('0x12')](_0xead8('0xe'),_0x387480,_0x11ceeb['error']['message']);return _0x724623(_0x11ceeb['error'][_0xead8('0x14')]);}else{logger[_0xead8('0xd')](_0xead8('0xe'),_0x387480,_0xead8('0xf'));_0x724623(_0x11ceeb[_0xead8('0x15')][_0xead8('0x14')]);}})[_0xead8('0x16')](function(_0x4caa39){logger[_0xead8('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x387480,_0x4caa39);_0x5ca0ac(_0x4caa39);});});}exports[_0xead8('0x17')]=function(_0x262219){var _0x484d1c=this;return new Promise(function(_0x16fa6f,_0x3ad1f3){return db[_0xead8('0x18')][_0xead8('0x19')](_0x262219['body'],{'raw':_0x262219['options']?_0x262219[_0xead8('0x1a')][_0xead8('0x1b')]===undefined?!![]:![]:!![]})[_0xead8('0x1c')](function(_0x1cf057){logger['info']('CreateOpenchannelQueueReport',_0x262219);logger[_0xead8('0x1d')](_0xead8('0x17'),_0x262219,JSON[_0xead8('0x11')](_0x1cf057));_0x16fa6f(_0x1cf057);})['catch'](function(_0x2164bb){logger[_0xead8('0x12')](_0xead8('0x17'),_0x2164bb['message'],_0x262219);_0x3ad1f3(_0x484d1c['error'](0x1f4,_0x2164bb[_0xead8('0x14')]));});});};exports[_0xead8('0x1e')]=function(_0x27ec65){var _0x47d451=this;return new Promise(function(_0x427f6b,_0x21357b){return db[_0xead8('0x18')][_0xead8('0x1f')](_0x27ec65[_0xead8('0x20')],{'raw':_0x27ec65['options']?_0x27ec65[_0xead8('0x1a')][_0xead8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27ec65[_0xead8('0x1a')]?_0x27ec65['options'][_0xead8('0x21')]||null:null,'attributes':_0x27ec65['options']?_0x27ec65[_0xead8('0x1a')]['attributes']||null:null,'limit':_0x27ec65[_0xead8('0x1a')]?_0x27ec65[_0xead8('0x1a')][_0xead8('0x22')]||null:null})[_0xead8('0x1c')](function(_0x5b01c8){logger[_0xead8('0xd')](_0xead8('0x1e'),_0x27ec65);logger[_0xead8('0x1d')](_0xead8('0x1e'),_0x27ec65,JSON[_0xead8('0x11')](_0x5b01c8));_0x427f6b(_0x5b01c8);})['catch'](function(_0x2abe9c){logger[_0xead8('0x12')](_0xead8('0x1e'),_0x2abe9c[_0xead8('0x14')],_0x27ec65);_0x21357b(_0x47d451[_0xead8('0x12')](0x1f4,_0x2abe9c[_0xead8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ddb878a..6acb7a0 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 _0x311c=['describe','get','show','post','create','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe'];(function(_0x2e7ec8,_0x286bd5){var _0x43509d=function(_0x3a2fe7){while(--_0x3a2fe7){_0x2e7ec8['push'](_0x2e7ec8['shift']());}};_0x43509d(++_0x286bd5);}(_0x311c,0x14c));var _0xc311=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x311c[_0x560448];return _0x550276;};'use strict';var multer=require('multer');var util=require(_0xc311('0x0'));var path=require(_0xc311('0x1'));var timeout=require(_0xc311('0x2'));var express=require(_0xc311('0x3'));var router=express[_0xc311('0x4')]();var auth=require(_0xc311('0x5'));var interaction=require(_0xc311('0x6'));var config=require(_0xc311('0x7'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0xc311('0x8')](),controller['index']);router['get'](_0xc311('0x9'),auth[_0xc311('0x8')](),controller[_0xc311('0xa')]);router[_0xc311('0xb')]('/:id',auth[_0xc311('0x8')](),controller[_0xc311('0xc')]);router[_0xc311('0xd')]('/',auth[_0xc311('0x8')](),controller[_0xc311('0xe')]);router['put'](_0xc311('0xf'),auth[_0xc311('0x8')](),controller[_0xc311('0x10')]);router['delete']('/:id',auth[_0xc311('0x8')](),controller[_0xc311('0x11')]);module[_0xc311('0x12')]=router; \ No newline at end of file +var _0xe7c4=['create','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x2e5093,_0x516434){var _0x1062b6=function(_0x1dc0bd){while(--_0x1dc0bd){_0x2e5093['push'](_0x2e5093['shift']());}};_0x1062b6(++_0x516434);}(_0xe7c4,0x1a8));var _0x4e7c=function(_0x49681f,_0x191e91){_0x49681f=_0x49681f-0x0;var _0x6ba977=_0xe7c4[_0x49681f];return _0x6ba977;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4e7c('0x0'));var timeout=require('connect-timeout');var express=require(_0x4e7c('0x1'));var router=express[_0x4e7c('0x2')]();var auth=require(_0x4e7c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4e7c('0x4'));var controller=require(_0x4e7c('0x5'));router[_0x4e7c('0x6')]('/',auth[_0x4e7c('0x7')](),controller[_0x4e7c('0x8')]);router[_0x4e7c('0x6')](_0x4e7c('0x9'),auth[_0x4e7c('0x7')](),controller['describe']);router['get'](_0x4e7c('0xa'),auth[_0x4e7c('0x7')](),controller[_0x4e7c('0xb')]);router[_0x4e7c('0xc')]('/',auth[_0x4e7c('0x7')](),controller[_0x4e7c('0xd')]);router[_0x4e7c('0xe')](_0x4e7c('0xa'),auth[_0x4e7c('0x7')](),controller[_0x4e7c('0xf')]);router[_0x4e7c('0x10')]('/:id',auth[_0x4e7c('0x7')](),controller[_0x4e7c('0x11')]);module[_0x4e7c('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index ed3011a..7de8595 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 _0xf27b=['agent','queue','moment','STRING','account'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xf27b,0xde));var _0xbf27=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0xf27b[_0x507403];return _0x1327c;};'use strict';var moment=require(_0xbf27('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbf27('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf27('0x2'),_0xbf27('0x3'),_0xbf27('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x4359=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE','NOW','moment'];(function(_0x5aef81,_0x10d6d7){var _0x184f97=function(_0x5ab98d){while(--_0x5ab98d){_0x5aef81['push'](_0x5aef81['shift']());}};_0x184f97(++_0x10d6d7);}(_0x4359,0x18f));var _0x9435=function(_0x5f04,_0x33a1c2){_0x5f04=_0x5f04-0x0;var _0x33a8ce=_0x4359[_0x5f04];return _0x33a8ce;};'use strict';var moment=require(_0x9435('0x0'));var Sequelize=require(_0x9435('0x1'));module[_0x9435('0x2')]={'uniqueid':{'type':Sequelize[_0x9435('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9435('0x4')](_0x9435('0x5'),_0x9435('0x6'),_0x9435('0x7')),'allowNull':![],'defaultValue':_0x9435('0x7')},'transferredAt':{'type':Sequelize[_0x9435('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x9435('0x9')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 0be5048..c01640b 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 _0x074b=['create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','name','send','index','OpenchannelTransferReport','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','VIRTUAL','where','includeAll','findAll','rows','params','rawAttributes','options','find','catch'];(function(_0x28f922,_0x1302f8){var _0x4eceac=function(_0x2ce5a0){while(--_0x2ce5a0){_0x28f922['push'](_0x28f922['shift']());}};_0x4eceac(++_0x1302f8);}(_0x074b,0xd2));var _0xb074=function(_0x4711dc,_0x2b29dc){_0x4711dc=_0x4711dc-0x0;var _0x17b558=_0x074b[_0x4711dc];return _0x17b558;};'use strict';var pdf=require(_0xb074('0x0'));var emlformat=require(_0xb074('0x1'));var rimraf=require(_0xb074('0x2'));var zipdir=require(_0xb074('0x3'));var jsonpatch=require(_0xb074('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb074('0x5'));var Mustache=require('mustache');var util=require(_0xb074('0x6'));var path=require(_0xb074('0x7'));var sox=require(_0xb074('0x8'));var csv=require(_0xb074('0x9'));var ejs=require(_0xb074('0xa'));var fs=require('fs');var _=require(_0xb074('0xb'));var squel=require('squel');var crypto=require(_0xb074('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb074('0xd'));var Papa=require(_0xb074('0xe'));var Redis=require(_0xb074('0xf'));var authService=require(_0xb074('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb074('0x11'));var logger=require(_0xb074('0x12'))('api');var utils=require(_0xb074('0x13'));var config=require(_0xb074('0x14'));var db=require(_0xb074('0x15'))['db'];function respondWithStatusCode(_0x484158,_0xe87c2){_0xe87c2=_0xe87c2||0xcc;return function(_0xb04b64){if(_0xb04b64){return _0x484158[_0xb074('0x16')](_0xe87c2);}return _0x484158[_0xb074('0x17')](_0xe87c2)[_0xb074('0x18')]();};}function respondWithResult(_0x116df8,_0x45bf53){_0x45bf53=_0x45bf53||0xc8;return function(_0x476021){if(_0x476021){return _0x116df8['status'](_0x45bf53)[_0xb074('0x19')](_0x476021);}};}function respondWithFilteredResult(_0xd22020,_0x10eaa1){return function(_0x4bea52){if(_0x4bea52){var _0x23baec=_0x4bea52[_0xb074('0x1a')],_0xe798c2=_0x10eaa1[_0xb074('0x1b')],_0x1aaded=_0x10eaa1[_0xb074('0x1b')]+_0x10eaa1[_0xb074('0x1c')],_0x327c6b;if(_0x1aaded>=_0x23baec){_0x1aaded=_0x23baec;_0x327c6b=0xc8;}else{_0x327c6b=0xce;}_0xd22020[_0xb074('0x17')](_0x327c6b);return _0xd22020['set'](_0xb074('0x1d'),_0xe798c2+'-'+_0x1aaded+'/'+_0x23baec)['json'](_0x4bea52);}return null;};}function patchUpdates(_0x12c7a2){return function(_0x496649){try{jsonpatch[_0xb074('0x1e')](_0x496649,_0x12c7a2,!![]);}catch(_0x2d3be1){return BPromise[_0xb074('0x1f')](_0x2d3be1);}return _0x496649[_0xb074('0x20')]();};}function saveUpdates(_0x1e12f2,_0x380464){return function(_0x104c25){if(_0x104c25){return _0x104c25['update'](_0x1e12f2)['then'](function(_0x246530){return _0x246530;});}return null;};}function removeEntity(_0x524216,_0xc798c1){return function(_0x2296ee){if(_0x2296ee){return _0x2296ee[_0xb074('0x21')]()[_0xb074('0x22')](function(){_0x524216[_0xb074('0x17')](0xcc)[_0xb074('0x18')]();});}};}function handleEntityNotFound(_0x49c0a4,_0x2e65f3){return function(_0x47c992){if(!_0x47c992){_0x49c0a4[_0xb074('0x16')](0x194);}return _0x47c992;};}function handleError(_0x243655,_0x5727b9){_0x5727b9=_0x5727b9||0x1f4;return function(_0x12e0ed){logger[_0xb074('0x23')](_0x12e0ed['stack']);if(_0x12e0ed['name']){delete _0x12e0ed[_0xb074('0x24')];}_0x243655[_0xb074('0x17')](_0x5727b9)[_0xb074('0x25')](_0x12e0ed);};}exports[_0xb074('0x26')]=function(_0x43ebf1,_0x18449e){var _0x4c22c0={},_0x3e04fe={},_0x368680={'count':0x0,'rows':[]};var _0x4d2e3a=db[_0xb074('0x27')]['rawAttributes'];_0x3e04fe[_0xb074('0x28')]=_[_0xb074('0x29')](_0x4d2e3a);_0x3e04fe[_0xb074('0x2a')]=_[_0xb074('0x29')](_0x43ebf1[_0xb074('0x2a')]);_0x3e04fe[_0xb074('0x2b')]=_[_0xb074('0x2c')](_0x3e04fe[_0xb074('0x28')],_0x3e04fe[_0xb074('0x2a')]);_0x4c22c0[_0xb074('0x2d')]=_[_0xb074('0x2c')](_0x3e04fe[_0xb074('0x28')],qs[_0xb074('0x2e')](_0x43ebf1[_0xb074('0x2a')][_0xb074('0x2e')]));_0x4c22c0[_0xb074('0x2d')]=_0x4c22c0['attributes']['length']?_0x4c22c0['attributes']:_0x3e04fe[_0xb074('0x28')];if(!_0x43ebf1['query'][_0xb074('0x2f')](_0xb074('0x30'))){_0x4c22c0[_0xb074('0x1c')]=qs[_0xb074('0x1c')](_0x43ebf1[_0xb074('0x2a')][_0xb074('0x1c')]);_0x4c22c0[_0xb074('0x1b')]=qs[_0xb074('0x1b')](_0x43ebf1[_0xb074('0x2a')]['offset']);}_0x4c22c0[_0xb074('0x31')]=qs[_0xb074('0x32')](_0x43ebf1['query'][_0xb074('0x32')]);_0x4c22c0['where']=qs[_0xb074('0x2b')](_[_0xb074('0x33')](_0x43ebf1[_0xb074('0x2a')],_0x3e04fe[_0xb074('0x2b')]));if(_0x43ebf1[_0xb074('0x2a')][_0xb074('0x34')]){_0x4c22c0['where']=_[_0xb074('0x35')](_0x4c22c0['where'],{'$or':_[_0xb074('0x36')](_0x4d2e3a,function(_0xadbed4){if(_0xadbed4[_0xb074('0x37')]['key']!==_0xb074('0x38')){var _0x438412={};_0x438412[_0xadbed4['field']]={'$like':'%'+_0x43ebf1[_0xb074('0x2a')][_0xb074('0x34')]+'%'};return _0x438412;}})});}_0x4c22c0=_[_0xb074('0x35')]({},_0x4c22c0,_0x43ebf1['options']);var _0x42a7e4={'where':_0x4c22c0[_0xb074('0x39')]};return db['OpenchannelTransferReport'][_0xb074('0x1a')](_0x42a7e4)[_0xb074('0x22')](function(_0x4f2615){_0x368680['count']=_0x4f2615;if(_0x43ebf1[_0xb074('0x2a')][_0xb074('0x3a')]){_0x4c22c0['include']=[{'all':!![]}];}return db[_0xb074('0x27')][_0xb074('0x3b')](_0x4c22c0);})[_0xb074('0x22')](function(_0x19ba20){_0x368680[_0xb074('0x3c')]=_0x19ba20;return _0x368680;})['then'](respondWithFilteredResult(_0x18449e,_0x4c22c0))['catch'](handleError(_0x18449e,null));};exports['show']=function(_0x1371c2,_0x154501){var _0x3f4041={'raw':!![],'where':{'id':_0x1371c2[_0xb074('0x3d')]['id']}},_0x343fc6={};_0x343fc6['model']=_[_0xb074('0x29')](db[_0xb074('0x27')][_0xb074('0x3e')]);_0x343fc6[_0xb074('0x2a')]=_['keys'](_0x1371c2[_0xb074('0x2a')]);_0x343fc6[_0xb074('0x2b')]=_[_0xb074('0x2c')](_0x343fc6['model'],_0x343fc6[_0xb074('0x2a')]);_0x3f4041[_0xb074('0x2d')]=_[_0xb074('0x2c')](_0x343fc6['model'],qs['fields'](_0x1371c2['query']['fields']));_0x3f4041[_0xb074('0x2d')]=_0x3f4041['attributes']['length']?_0x3f4041[_0xb074('0x2d')]:_0x343fc6[_0xb074('0x28')];if(_0x1371c2[_0xb074('0x2a')][_0xb074('0x3a')]){_0x3f4041['include']=[{'all':!![]}];}_0x3f4041=_[_0xb074('0x35')]({},_0x3f4041,_0x1371c2[_0xb074('0x3f')]);return db[_0xb074('0x27')][_0xb074('0x40')](_0x3f4041)[_0xb074('0x22')](handleEntityNotFound(_0x154501,null))[_0xb074('0x22')](respondWithResult(_0x154501,null))[_0xb074('0x41')](handleError(_0x154501,null));};exports[_0xb074('0x42')]=function(_0x4904b1,_0x51dbc4){return db[_0xb074('0x27')][_0xb074('0x42')](_0x4904b1[_0xb074('0x43')],{})[_0xb074('0x22')](respondWithResult(_0x51dbc4,0xc9))['catch'](handleError(_0x51dbc4,null));};exports[_0xb074('0x44')]=function(_0x25a82d,_0x30667f){if(_0x25a82d['body']['id']){delete _0x25a82d['body']['id'];}return db[_0xb074('0x27')][_0xb074('0x40')]({'where':{'id':_0x25a82d[_0xb074('0x3d')]['id']}})[_0xb074('0x22')](handleEntityNotFound(_0x30667f,null))[_0xb074('0x22')](saveUpdates(_0x25a82d[_0xb074('0x43')],null))[_0xb074('0x22')](respondWithResult(_0x30667f,null))[_0xb074('0x41')](handleError(_0x30667f,null));};exports['destroy']=function(_0x361fbe,_0x8af14){return db[_0xb074('0x27')][_0xb074('0x40')]({'where':{'id':_0x361fbe[_0xb074('0x3d')]['id']}})[_0xb074('0x22')](handleEntityNotFound(_0x8af14,null))[_0xb074('0x22')](removeEntity(_0x8af14,null))[_0xb074('0x41')](handleError(_0x8af14,null));};exports['describe']=function(_0x3e8c99,_0x1f6ed6){return db[_0xb074('0x27')]['describe']()[_0xb074('0x22')](respondWithResult(_0x1f6ed6,null))[_0xb074('0x41')](handleError(_0x1f6ed6,null));}; \ No newline at end of file +var _0xf607=['to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','html-pdf','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0x227d2c,_0x44df82){var _0x5678fa=function(_0x2cdc5d){while(--_0x2cdc5d){_0x227d2c['push'](_0x227d2c['shift']());}};_0x5678fa(++_0x44df82);}(_0xf607,0x166));var _0x7f60=function(_0x50cce9,_0x55b5d1){_0x50cce9=_0x50cce9-0x0;var _0x59dd7a=_0xf607[_0x50cce9];return _0x59dd7a;};'use strict';var pdf=require(_0x7f60('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7f60('0x1'));var rp=require(_0x7f60('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7f60('0x3'));var util=require(_0x7f60('0x4'));var path=require(_0x7f60('0x5'));var sox=require(_0x7f60('0x6'));var csv=require(_0x7f60('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7f60('0x8'));var squel=require(_0x7f60('0x9'));var crypto=require('crypto');var jsforce=require(_0x7f60('0xa'));var deskjs=require(_0x7f60('0xb'));var toCsv=require(_0x7f60('0x7'));var querystring=require(_0x7f60('0xc'));var Papa=require(_0x7f60('0xd'));var Redis=require(_0x7f60('0xe'));var authService=require(_0x7f60('0xf'));var qs=require(_0x7f60('0x10'));var hardwareService=require(_0x7f60('0x11'));var logger=require('../../config/logger')(_0x7f60('0x12'));var utils=require(_0x7f60('0x13'));var config=require(_0x7f60('0x14'));var db=require(_0x7f60('0x15'))['db'];function respondWithStatusCode(_0x1c5147,_0x49a0cb){_0x49a0cb=_0x49a0cb||0xcc;return function(_0x105119){if(_0x105119){return _0x1c5147[_0x7f60('0x16')](_0x49a0cb);}return _0x1c5147[_0x7f60('0x17')](_0x49a0cb)[_0x7f60('0x18')]();};}function respondWithResult(_0x44dd65,_0x17a177){_0x17a177=_0x17a177||0xc8;return function(_0x4dd69c){if(_0x4dd69c){return _0x44dd65['status'](_0x17a177)[_0x7f60('0x19')](_0x4dd69c);}};}function respondWithFilteredResult(_0x266dc2,_0x33657d){return function(_0x47f40c){if(_0x47f40c){var _0x4272c2=_0x47f40c[_0x7f60('0x1a')],_0x4aa9d2=_0x33657d[_0x7f60('0x1b')],_0x3c4cf1=_0x33657d['offset']+_0x33657d['limit'],_0x13565f;if(_0x3c4cf1>=_0x4272c2){_0x3c4cf1=_0x4272c2;_0x13565f=0xc8;}else{_0x13565f=0xce;}_0x266dc2[_0x7f60('0x17')](_0x13565f);return _0x266dc2[_0x7f60('0x1c')](_0x7f60('0x1d'),_0x4aa9d2+'-'+_0x3c4cf1+'/'+_0x4272c2)[_0x7f60('0x19')](_0x47f40c);}return null;};}function patchUpdates(_0x5f45d9){return function(_0x88c0cc){try{jsonpatch['apply'](_0x88c0cc,_0x5f45d9,!![]);}catch(_0x1ba99d){return BPromise[_0x7f60('0x1e')](_0x1ba99d);}return _0x88c0cc[_0x7f60('0x1f')]();};}function saveUpdates(_0x1d0d43,_0x436e92){return function(_0x32dc38){if(_0x32dc38){return _0x32dc38[_0x7f60('0x20')](_0x1d0d43)[_0x7f60('0x21')](function(_0x559638){return _0x559638;});}return null;};}function removeEntity(_0x12187c,_0x35c328){return function(_0x3128d7){if(_0x3128d7){return _0x3128d7[_0x7f60('0x22')]()[_0x7f60('0x21')](function(){_0x12187c[_0x7f60('0x17')](0xcc)[_0x7f60('0x18')]();});}};}function handleEntityNotFound(_0x4b446a,_0x1fef12){return function(_0x387add){if(!_0x387add){_0x4b446a[_0x7f60('0x16')](0x194);}return _0x387add;};}function handleError(_0x20e744,_0x3073e3){_0x3073e3=_0x3073e3||0x1f4;return function(_0xd4dbb7){logger[_0x7f60('0x23')](_0xd4dbb7[_0x7f60('0x24')]);if(_0xd4dbb7[_0x7f60('0x25')]){delete _0xd4dbb7[_0x7f60('0x25')];}_0x20e744['status'](_0x3073e3)[_0x7f60('0x26')](_0xd4dbb7);};}exports[_0x7f60('0x27')]=function(_0xe5a88,_0x4debf1){var _0xcf8e7e={},_0x5d3167={},_0x44cc25={'count':0x0,'rows':[]};var _0x2cb0b7=db[_0x7f60('0x28')][_0x7f60('0x29')];_0x5d3167[_0x7f60('0x2a')]=_[_0x7f60('0x2b')](_0x2cb0b7);_0x5d3167[_0x7f60('0x2c')]=_[_0x7f60('0x2b')](_0xe5a88[_0x7f60('0x2c')]);_0x5d3167['filters']=_[_0x7f60('0x2d')](_0x5d3167['model'],_0x5d3167[_0x7f60('0x2c')]);_0xcf8e7e[_0x7f60('0x2e')]=_[_0x7f60('0x2d')](_0x5d3167[_0x7f60('0x2a')],qs['fields'](_0xe5a88[_0x7f60('0x2c')][_0x7f60('0x2f')]));_0xcf8e7e[_0x7f60('0x2e')]=_0xcf8e7e[_0x7f60('0x2e')][_0x7f60('0x30')]?_0xcf8e7e[_0x7f60('0x2e')]:_0x5d3167['model'];if(!_0xe5a88[_0x7f60('0x2c')][_0x7f60('0x31')]('nolimit')){_0xcf8e7e['limit']=qs[_0x7f60('0x32')](_0xe5a88[_0x7f60('0x2c')][_0x7f60('0x32')]);_0xcf8e7e[_0x7f60('0x1b')]=qs[_0x7f60('0x1b')](_0xe5a88[_0x7f60('0x2c')][_0x7f60('0x1b')]);}_0xcf8e7e[_0x7f60('0x33')]=qs[_0x7f60('0x34')](_0xe5a88[_0x7f60('0x2c')][_0x7f60('0x34')]);_0xcf8e7e[_0x7f60('0x35')]=qs[_0x7f60('0x36')](_[_0x7f60('0x37')](_0xe5a88[_0x7f60('0x2c')],_0x5d3167['filters']));if(_0xe5a88[_0x7f60('0x2c')][_0x7f60('0x38')]){_0xcf8e7e['where']=_[_0x7f60('0x39')](_0xcf8e7e['where'],{'$or':_[_0x7f60('0x3a')](_0x2cb0b7,function(_0xe6ebfb){if(_0xe6ebfb['type']['key']!==_0x7f60('0x3b')){var _0x243071={};_0x243071[_0xe6ebfb[_0x7f60('0x3c')]]={'$like':'%'+_0xe5a88[_0x7f60('0x2c')][_0x7f60('0x38')]+'%'};return _0x243071;}})});}_0xcf8e7e=_[_0x7f60('0x39')]({},_0xcf8e7e,_0xe5a88['options']);var _0x47ef94={'where':_0xcf8e7e[_0x7f60('0x35')]};return db[_0x7f60('0x28')][_0x7f60('0x1a')](_0x47ef94)[_0x7f60('0x21')](function(_0x15b08c){_0x44cc25[_0x7f60('0x1a')]=_0x15b08c;if(_0xe5a88['query'][_0x7f60('0x3d')]){_0xcf8e7e[_0x7f60('0x3e')]=[{'all':!![]}];}return db[_0x7f60('0x28')][_0x7f60('0x3f')](_0xcf8e7e);})[_0x7f60('0x21')](function(_0x29d179){_0x44cc25[_0x7f60('0x40')]=_0x29d179;return _0x44cc25;})[_0x7f60('0x21')](respondWithFilteredResult(_0x4debf1,_0xcf8e7e))[_0x7f60('0x41')](handleError(_0x4debf1,null));};exports[_0x7f60('0x42')]=function(_0x2bf2ab,_0x38a566){var _0x16f494={'raw':!![],'where':{'id':_0x2bf2ab['params']['id']}},_0x41d7d3={};_0x41d7d3[_0x7f60('0x2a')]=_[_0x7f60('0x2b')](db[_0x7f60('0x28')][_0x7f60('0x29')]);_0x41d7d3[_0x7f60('0x2c')]=_[_0x7f60('0x2b')](_0x2bf2ab[_0x7f60('0x2c')]);_0x41d7d3[_0x7f60('0x36')]=_[_0x7f60('0x2d')](_0x41d7d3['model'],_0x41d7d3[_0x7f60('0x2c')]);_0x16f494[_0x7f60('0x2e')]=_[_0x7f60('0x2d')](_0x41d7d3[_0x7f60('0x2a')],qs[_0x7f60('0x2f')](_0x2bf2ab['query'][_0x7f60('0x2f')]));_0x16f494[_0x7f60('0x2e')]=_0x16f494[_0x7f60('0x2e')][_0x7f60('0x30')]?_0x16f494[_0x7f60('0x2e')]:_0x41d7d3[_0x7f60('0x2a')];if(_0x2bf2ab[_0x7f60('0x2c')]['includeAll']){_0x16f494[_0x7f60('0x3e')]=[{'all':!![]}];}_0x16f494=_[_0x7f60('0x39')]({},_0x16f494,_0x2bf2ab[_0x7f60('0x43')]);return db[_0x7f60('0x28')][_0x7f60('0x44')](_0x16f494)['then'](handleEntityNotFound(_0x38a566,null))[_0x7f60('0x21')](respondWithResult(_0x38a566,null))['catch'](handleError(_0x38a566,null));};exports[_0x7f60('0x45')]=function(_0x288b3a,_0x586c20){return db[_0x7f60('0x28')]['create'](_0x288b3a['body'],{})[_0x7f60('0x21')](respondWithResult(_0x586c20,0xc9))[_0x7f60('0x41')](handleError(_0x586c20,null));};exports[_0x7f60('0x20')]=function(_0x713413,_0x1fdd86){if(_0x713413[_0x7f60('0x46')]['id']){delete _0x713413[_0x7f60('0x46')]['id'];}return db[_0x7f60('0x28')][_0x7f60('0x44')]({'where':{'id':_0x713413[_0x7f60('0x47')]['id']}})[_0x7f60('0x21')](handleEntityNotFound(_0x1fdd86,null))[_0x7f60('0x21')](saveUpdates(_0x713413[_0x7f60('0x46')],null))[_0x7f60('0x21')](respondWithResult(_0x1fdd86,null))[_0x7f60('0x41')](handleError(_0x1fdd86,null));};exports[_0x7f60('0x22')]=function(_0x1a0b3a,_0x55bf2e){return db[_0x7f60('0x28')]['find']({'where':{'id':_0x1a0b3a[_0x7f60('0x47')]['id']}})['then'](handleEntityNotFound(_0x55bf2e,null))[_0x7f60('0x21')](removeEntity(_0x55bf2e,null))[_0x7f60('0x41')](handleError(_0x55bf2e,null));};exports['describe']=function(_0x150fac,_0xb200e9){return db[_0x7f60('0x28')][_0x7f60('0x48')]()[_0x7f60('0x21')](respondWithResult(_0xb200e9,null))[_0x7f60('0x41')](handleError(_0xb200e9,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index dc07604..39e9172 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 _0x4d52=['exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','rimraf','./openchannelTransferReport.attributes'];(function(_0x21ac0d,_0x586d1d){var _0x54fa0b=function(_0x3f46e9){while(--_0x3f46e9){_0x21ac0d['push'](_0x21ac0d['shift']());}};_0x54fa0b(++_0x586d1d);}(_0x4d52,0x112));var _0x24d5=function(_0x432877,_0x29c992){_0x432877=_0x432877-0x0;var _0x2bd175=_0x4d52[_0x432877];return _0x2bd175;};'use strict';var _=require(_0x24d5('0x0'));var util=require('util');var logger=require(_0x24d5('0x1'))('api');var moment=require(_0x24d5('0x2'));var BPromise=require(_0x24d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x24d5('0x4'));var config=require('../../config/environment');var attributes=require(_0x24d5('0x5'));module[_0x24d5('0x6')]=function(_0x3b816c,_0x9619aa){return _0x3b816c['define'](_0x24d5('0x7'),attributes,{'tableName':_0x24d5('0x8'),'paranoid':![],'indexes':[{'name':_0x24d5('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6595=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6595,0x1d6));var _0x5659=function(_0x3fa0f7,_0x21136b){_0x3fa0f7=_0x3fa0f7-0x0;var _0x2f2ba7=_0x6595[_0x3fa0f7];return _0x2f2ba7;};'use strict';var _=require(_0x5659('0x0'));var util=require(_0x5659('0x1'));var logger=require(_0x5659('0x2'))(_0x5659('0x3'));var moment=require('moment');var BPromise=require(_0x5659('0x4'));var rp=require(_0x5659('0x5'));var fs=require('fs');var path=require(_0x5659('0x6'));var rimraf=require(_0x5659('0x7'));var config=require(_0x5659('0x8'));var attributes=require(_0x5659('0x9'));module[_0x5659('0xa')]=function(_0x1ea838,_0x456719){return _0x1ea838[_0x5659('0xb')](_0x5659('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x5659('0xd'),'fields':[_0x5659('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 48459b3..d9c6c20 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 _0xc30d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x3c33c3,_0x50d52e){var _0x4f6f43=function(_0xd77b34){while(--_0xd77b34){_0x3c33c3['push'](_0x3c33c3['shift']());}};_0x4f6f43(++_0x50d52e);}(_0xc30d,0x6e));var _0xdc30=function(_0x30e0b7,_0x41927){_0x30e0b7=_0x30e0b7-0x0;var _0x6eca1c=_0xc30d[_0x30e0b7];return _0x6eca1c;};'use strict';var _=require(_0xdc30('0x0'));var util=require('util');var moment=require(_0xdc30('0x1'));var BPromise=require(_0xdc30('0x2'));var rs=require(_0xdc30('0x3'));var fs=require('fs');var Redis=require(_0xdc30('0x4'));var db=require(_0xdc30('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc30('0x6'))('rpc');var config=require(_0xdc30('0x7'));var jayson=require(_0xdc30('0x8'));var client=jayson[_0xdc30('0x9')][_0xdc30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4011da,_0x2773c5,_0x4a0310){return new BPromise(function(_0x1cdfb4,_0x39c377){return client[_0xdc30('0xb')](_0x4011da,_0x4a0310)[_0xdc30('0xc')](function(_0x1a9c5f){logger[_0xdc30('0xd')](_0xdc30('0xe'),_0x2773c5,_0xdc30('0xf'));logger[_0xdc30('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2773c5,'request\x20sent',JSON['stringify'](_0x1a9c5f));if(_0x1a9c5f[_0xdc30('0x11')]){if(_0x1a9c5f[_0xdc30('0x11')][_0xdc30('0x12')]===0x1f4){logger[_0xdc30('0x11')](_0xdc30('0xe'),_0x2773c5,_0x1a9c5f[_0xdc30('0x11')][_0xdc30('0x13')]);return _0x39c377(_0x1a9c5f['error'][_0xdc30('0x13')]);}logger[_0xdc30('0x11')](_0xdc30('0xe'),_0x2773c5,_0x1a9c5f[_0xdc30('0x11')]['message']);return _0x1cdfb4(_0x1a9c5f[_0xdc30('0x11')][_0xdc30('0x13')]);}else{logger[_0xdc30('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2773c5,_0xdc30('0xf'));_0x1cdfb4(_0x1a9c5f[_0xdc30('0x14')][_0xdc30('0x13')]);}})[_0xdc30('0x15')](function(_0x358251){logger[_0xdc30('0x11')](_0xdc30('0xe'),_0x2773c5,_0x358251);_0x39c377(_0x358251);});});} \ No newline at end of file +var _0x9932=['request\x20sent','debug','OpenchannelTransferReport,\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','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x32db5c,_0x3a3d89){var _0xc569d6=function(_0x643445){while(--_0x643445){_0x32db5c['push'](_0x32db5c['shift']());}};_0xc569d6(++_0x3a3d89);}(_0x9932,0xc0));var _0x2993=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x9932[_0x55abd9];return _0x3e5669;};'use strict';var _=require('lodash');var util=require(_0x2993('0x0'));var moment=require(_0x2993('0x1'));var BPromise=require(_0x2993('0x2'));var rs=require(_0x2993('0x3'));var fs=require('fs');var Redis=require(_0x2993('0x4'));var db=require(_0x2993('0x5'))['db'];var utils=require(_0x2993('0x6'));var logger=require(_0x2993('0x7'))(_0x2993('0x8'));var config=require(_0x2993('0x9'));var jayson=require(_0x2993('0xa'));var client=jayson['client'][_0x2993('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26dd41,_0x1e6661,_0x3db3b2){return new BPromise(function(_0x3946fc,_0x4bba1d){return client['request'](_0x26dd41,_0x3db3b2)[_0x2993('0xc')](function(_0xc13cbd){logger[_0x2993('0xd')](_0x2993('0xe'),_0x1e6661,_0x2993('0xf'));logger[_0x2993('0x10')](_0x2993('0x11'),_0x1e6661,'request\x20sent',JSON[_0x2993('0x12')](_0xc13cbd));if(_0xc13cbd[_0x2993('0x13')]){if(_0xc13cbd[_0x2993('0x13')][_0x2993('0x14')]===0x1f4){logger[_0x2993('0x13')](_0x2993('0xe'),_0x1e6661,_0xc13cbd[_0x2993('0x13')]['message']);return _0x4bba1d(_0xc13cbd[_0x2993('0x13')][_0x2993('0x15')]);}logger[_0x2993('0x13')](_0x2993('0xe'),_0x1e6661,_0xc13cbd[_0x2993('0x13')][_0x2993('0x15')]);return _0x3946fc(_0xc13cbd['error'][_0x2993('0x15')]);}else{logger[_0x2993('0xd')](_0x2993('0xe'),_0x1e6661,_0x2993('0xf'));_0x3946fc(_0xc13cbd['result'][_0x2993('0x15')]);}})[_0x2993('0x16')](function(_0x21479c){logger[_0x2993('0x13')](_0x2993('0xe'),_0x1e6661,_0x21479c);_0x4bba1d(_0x21479c);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 61dacd4..40038d5 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 _0xb48d=['../../components/auth/service','../../components/interaction/service','./pause.controller','isAuthenticated','index','get','show','post','create','put','update','destroy','exports','multer','path','express','Router'];(function(_0x2ff1eb,_0x3039fc){var _0x3ff97b=function(_0x52ecf0){while(--_0x52ecf0){_0x2ff1eb['push'](_0x2ff1eb['shift']());}};_0x3ff97b(++_0x3039fc);}(_0xb48d,0x194));var _0xdb48=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xb48d[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0xdb48('0x0'));var util=require('util');var path=require(_0xdb48('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb48('0x2'));var router=express[_0xdb48('0x3')]();var auth=require(_0xdb48('0x4'));var interaction=require(_0xdb48('0x5'));var config=require('../../config/environment');var controller=require(_0xdb48('0x6'));router['get']('/',auth[_0xdb48('0x7')](),controller[_0xdb48('0x8')]);router[_0xdb48('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdb48('0xa')]);router[_0xdb48('0xb')]('/',auth['isAuthenticated'](),controller[_0xdb48('0xc')]);router[_0xdb48('0xd')]('/:id',auth[_0xdb48('0x7')](),controller[_0xdb48('0xe')]);router['delete']('/:id',auth[_0xdb48('0x7')](),controller[_0xdb48('0xf')]);module[_0xdb48('0x10')]=router; \ No newline at end of file +var _0xa769=['../../components/auth/service','./pause.controller','get','index','/:id','isAuthenticated','show','post','put','update','exports','multer','path','connect-timeout','express'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xa769,0xfb));var _0x9a76=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa769[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x9a76('0x0'));var util=require('util');var path=require(_0x9a76('0x1'));var timeout=require(_0x9a76('0x2'));var express=require(_0x9a76('0x3'));var router=express['Router']();var auth=require(_0x9a76('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a76('0x5'));router[_0x9a76('0x6')]('/',auth['isAuthenticated'](),controller[_0x9a76('0x7')]);router[_0x9a76('0x6')](_0x9a76('0x8'),auth[_0x9a76('0x9')](),controller[_0x9a76('0xa')]);router[_0x9a76('0xb')]('/',auth[_0x9a76('0x9')](),controller['create']);router[_0x9a76('0xc')](_0x9a76('0x8'),auth[_0x9a76('0x9')](),controller[_0x9a76('0xd')]);router['delete']('/:id',auth[_0x9a76('0x9')](),controller['destroy']);module[_0x9a76('0xe')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index c245fa5..af464c3 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 _0x9ec9=['exports','STRING','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ec9,0x75));var _0x99ec=function(_0x35d1c2,_0xad3a4){_0x35d1c2=_0x35d1c2-0x0;var _0x5174c1=_0x9ec9[_0x35d1c2];return _0x5174c1;};'use strict';var Sequelize=require('sequelize');module[_0x99ec('0x0')]={'name':{'type':Sequelize[_0x99ec('0x1')],'unique':_0x99ec('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x99ec('0x1')]}}; \ No newline at end of file +var _0xce15=['sequelize','name','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xce15,0x18c));var _0x5ce1=function(_0x4c15e7,_0x4ad7f5){_0x4c15e7=_0x4c15e7-0x0;var _0x1f119a=_0xce15[_0x4c15e7];return _0x1f119a;};'use strict';var Sequelize=require(_0x5ce1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5ce1('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x5ce1('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 46384e4..5a96e7e 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 _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Pause','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x1ca8dd,_0x4be579){var _0x27f071=function(_0x1f1e62){while(--_0x1f1e62){_0x1ca8dd['push'](_0x1ca8dd['shift']());}};_0x27f071(++_0x4be579);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Pauses';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Pause'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Pause']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Pause'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Pauses';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Pause'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));}; \ No newline at end of file +var _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Pause','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x12c24b,_0x40676a){var _0x419aab=function(_0x2920a2){while(--_0x2920a2){_0x12c24b['push'](_0x12c24b['shift']());}};_0x419aab(++_0x40676a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Pauses';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Pause'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Pause']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Pause'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Pauses';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Pause'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 414f2db..af2ef78 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 _0xdea9=['path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util','api','bluebird','request-promise'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0xdea9,0xeb));var _0x9dea=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdea9[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9dea('0x0'));var util=require(_0x9dea('0x1'));var logger=require('../../config/logger')(_0x9dea('0x2'));var moment=require('moment');var BPromise=require(_0x9dea('0x3'));var rp=require(_0x9dea('0x4'));var fs=require('fs');var path=require(_0x9dea('0x5'));var rimraf=require(_0x9dea('0x6'));var config=require(_0x9dea('0x7'));var attributes=require(_0x9dea('0x8'));module[_0x9dea('0x9')]=function(_0x4170f0,_0x17be6b){return _0x4170f0['define'](_0x9dea('0xa'),attributes,{'tableName':_0x9dea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad5e=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x503254,_0x29e551){var _0x383dcc=function(_0x3c27fb){while(--_0x3c27fb){_0x503254['push'](_0x503254['shift']());}};_0x383dcc(++_0x29e551);}(_0xad5e,0x117));var _0xead5=function(_0x47cfc9,_0x24fc3d){_0x47cfc9=_0x47cfc9-0x0;var _0x18fc41=_0xad5e[_0x47cfc9];return _0x18fc41;};'use strict';var _=require(_0xead5('0x0'));var util=require('util');var logger=require(_0xead5('0x1'))('api');var moment=require(_0xead5('0x2'));var BPromise=require(_0xead5('0x3'));var rp=require(_0xead5('0x4'));var fs=require('fs');var path=require(_0xead5('0x5'));var rimraf=require(_0xead5('0x6'));var config=require(_0xead5('0x7'));var attributes=require(_0xead5('0x8'));module[_0xead5('0x9')]=function(_0x589900,_0x2c141d){return _0x589900[_0xead5('0xa')](_0xead5('0xb'),attributes,{'tableName':_0xead5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 2dd77d3..e23f7bd 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 _0xcc19=['../../config/environment','jayson/promise','request','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowPause','Pause','find','options','where','attributes','include','map','model','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5344ce,_0x7e65ad){var _0x37dd22=function(_0x11cdd2){while(--_0x11cdd2){_0x5344ce['push'](_0x5344ce['shift']());}};_0x37dd22(++_0x7e65ad);}(_0xcc19,0xbd));var _0x9cc1=function(_0x34ae76,_0x4cd562){_0x34ae76=_0x34ae76-0x0;var _0x5325eb=_0xcc19[_0x34ae76];return _0x5325eb;};'use strict';var _=require(_0x9cc1('0x0'));var util=require(_0x9cc1('0x1'));var moment=require('moment');var BPromise=require(_0x9cc1('0x2'));var rs=require(_0x9cc1('0x3'));var fs=require('fs');var Redis=require(_0x9cc1('0x4'));var db=require(_0x9cc1('0x5'))['db'];var utils=require(_0x9cc1('0x6'));var logger=require(_0x9cc1('0x7'))(_0x9cc1('0x8'));var config=require(_0x9cc1('0x9'));var jayson=require(_0x9cc1('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29eebc,_0x1b6b0f,_0x3b8efc){return new BPromise(function(_0x3050ca,_0x17d405){return client[_0x9cc1('0xb')](_0x29eebc,_0x3b8efc)['then'](function(_0xc994dd){logger[_0x9cc1('0xc')](_0x9cc1('0xd'),_0x1b6b0f,_0x9cc1('0xe'));logger['debug'](_0x9cc1('0xf'),_0x1b6b0f,_0x9cc1('0xe'),JSON[_0x9cc1('0x10')](_0xc994dd));if(_0xc994dd[_0x9cc1('0x11')]){if(_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x12')]===0x1f4){logger[_0x9cc1('0x11')]('Pause,\x20%s,\x20%s',_0x1b6b0f,_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x13')]);return _0x17d405(_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x13')]);}logger[_0x9cc1('0x11')](_0x9cc1('0xd'),_0x1b6b0f,_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x13')]);return _0x3050ca(_0xc994dd[_0x9cc1('0x11')]['message']);}else{logger['info']('Pause,\x20%s,\x20%s',_0x1b6b0f,'request\x20sent');_0x3050ca(_0xc994dd[_0x9cc1('0x14')][_0x9cc1('0x13')]);}})[_0x9cc1('0x15')](function(_0x6ae4e3){logger['error']('Pause,\x20%s,\x20%s',_0x1b6b0f,_0x6ae4e3);_0x17d405(_0x6ae4e3);});});}exports[_0x9cc1('0x16')]=function(_0x3ca08d){var _0x32b27b=this;return new Promise(function(_0x31e625,_0x5908cd){return db[_0x9cc1('0x17')][_0x9cc1('0x18')]({'raw':_0x3ca08d[_0x9cc1('0x19')]?_0x3ca08d[_0x9cc1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3ca08d[_0x9cc1('0x19')]?_0x3ca08d[_0x9cc1('0x19')][_0x9cc1('0x1a')]||null:null,'attributes':_0x3ca08d[_0x9cc1('0x19')]?_0x3ca08d[_0x9cc1('0x19')][_0x9cc1('0x1b')]||null:null,'include':_0x3ca08d[_0x9cc1('0x19')]?_0x3ca08d['options'][_0x9cc1('0x1c')]?_[_0x9cc1('0x1d')](_0x3ca08d['options']['include'],function(_0x379b23){return{'model':db[_0x379b23[_0x9cc1('0x1e')]],'as':_0x379b23['as'],'attributes':_0x379b23['attributes'],'include':_0x379b23[_0x9cc1('0x1c')]?_[_0x9cc1('0x1d')](_0x379b23['include'],function(_0x340527){return{'model':db[_0x340527['model']],'as':_0x340527['as'],'attributes':_0x340527[_0x9cc1('0x1b')],'include':_0x340527['include']?_['map'](_0x340527[_0x9cc1('0x1c')],function(_0x5beeef){return{'model':db[_0x5beeef['model']],'as':_0x5beeef['as'],'attributes':_0x5beeef[_0x9cc1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9cc1('0x1f')](function(_0x2176fd){logger['info'](_0x9cc1('0x16'),_0x3ca08d);logger[_0x9cc1('0x20')](_0x9cc1('0x16'),_0x3ca08d,JSON[_0x9cc1('0x10')](_0x2176fd));_0x31e625(_0x2176fd);})[_0x9cc1('0x15')](function(_0x55e154){logger[_0x9cc1('0x11')](_0x9cc1('0x16'),_0x55e154['message'],_0x3ca08d);_0x5908cd(_0x32b27b[_0x9cc1('0x11')](0x1f4,_0x55e154[_0x9cc1('0x13')]));});});}; \ No newline at end of file +var _0x377e=['model','ShowPause','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','find','options','raw','where','attributes','include','map'];(function(_0x401d8b,_0x5db030){var _0x12b6e9=function(_0x2aeea8){while(--_0x2aeea8){_0x401d8b['push'](_0x401d8b['shift']());}};_0x12b6e9(++_0x5db030);}(_0x377e,0x1e2));var _0xe377=function(_0x319412,_0x3e5995){_0x319412=_0x319412-0x0;var _0x2d78b3=_0x377e[_0x319412];return _0x2d78b3;};'use strict';var _=require(_0xe377('0x0'));var util=require(_0xe377('0x1'));var moment=require('moment');var BPromise=require(_0xe377('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe377('0x3'));var db=require(_0xe377('0x4'))['db'];var utils=require(_0xe377('0x5'));var logger=require(_0xe377('0x6'))(_0xe377('0x7'));var config=require('../../config/environment');var jayson=require(_0xe377('0x8'));var client=jayson['client'][_0xe377('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fac41,_0x1d5365,_0x574da5){return new BPromise(function(_0x26fdf9,_0x4edb2d){return client[_0xe377('0xa')](_0x3fac41,_0x574da5)[_0xe377('0xb')](function(_0x37906e){logger[_0xe377('0xc')](_0xe377('0xd'),_0x1d5365,_0xe377('0xe'));logger['debug'](_0xe377('0xf'),_0x1d5365,_0xe377('0xe'),JSON[_0xe377('0x10')](_0x37906e));if(_0x37906e[_0xe377('0x11')]){if(_0x37906e['error'][_0xe377('0x12')]===0x1f4){logger['error'](_0xe377('0xd'),_0x1d5365,_0x37906e[_0xe377('0x11')][_0xe377('0x13')]);return _0x4edb2d(_0x37906e[_0xe377('0x11')]['message']);}logger[_0xe377('0x11')](_0xe377('0xd'),_0x1d5365,_0x37906e[_0xe377('0x11')][_0xe377('0x13')]);return _0x26fdf9(_0x37906e[_0xe377('0x11')][_0xe377('0x13')]);}else{logger[_0xe377('0xc')]('Pause,\x20%s,\x20%s',_0x1d5365,'request\x20sent');_0x26fdf9(_0x37906e['result'][_0xe377('0x13')]);}})[_0xe377('0x14')](function(_0x373853){logger[_0xe377('0x11')](_0xe377('0xd'),_0x1d5365,_0x373853);_0x4edb2d(_0x373853);});});}exports['ShowPause']=function(_0x47b899){var _0x16c1d2=this;return new Promise(function(_0x557d67,_0x20d236){return db['Pause'][_0xe377('0x15')]({'raw':_0x47b899[_0xe377('0x16')]?_0x47b899[_0xe377('0x16')][_0xe377('0x17')]===undefined?!![]:![]:!![],'where':_0x47b899[_0xe377('0x16')]?_0x47b899[_0xe377('0x16')][_0xe377('0x18')]||null:null,'attributes':_0x47b899['options']?_0x47b899[_0xe377('0x16')][_0xe377('0x19')]||null:null,'include':_0x47b899[_0xe377('0x16')]?_0x47b899[_0xe377('0x16')][_0xe377('0x1a')]?_[_0xe377('0x1b')](_0x47b899[_0xe377('0x16')]['include'],function(_0x45b4e5){return{'model':db[_0x45b4e5[_0xe377('0x1c')]],'as':_0x45b4e5['as'],'attributes':_0x45b4e5['attributes'],'include':_0x45b4e5[_0xe377('0x1a')]?_['map'](_0x45b4e5['include'],function(_0x19e75f){return{'model':db[_0x19e75f['model']],'as':_0x19e75f['as'],'attributes':_0x19e75f[_0xe377('0x19')],'include':_0x19e75f[_0xe377('0x1a')]?_[_0xe377('0x1b')](_0x19e75f[_0xe377('0x1a')],function(_0x3822bc){return{'model':db[_0x3822bc['model']],'as':_0x3822bc['as'],'attributes':_0x3822bc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11c9c1){logger[_0xe377('0xc')]('ShowPause',_0x47b899);logger['debug'](_0xe377('0x1d'),_0x47b899,JSON['stringify'](_0x11c9c1));_0x557d67(_0x11c9c1);})[_0xe377('0x14')](function(_0x216f47){logger['error'](_0xe377('0x1d'),_0x216f47[_0xe377('0x13')],_0x47b899);_0x20d236(_0x16c1d2[_0xe377('0x11')](0x1f4,_0x216f47[_0xe377('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index bc8930f..2b02ac2 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 _0x7c1e=['index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','single','upload','webhookPost','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c1e,0xa1));var _0xe7c1=function(_0x51e389,_0x180057){_0x51e389=_0x51e389-0x0;var _0x4fe128=_0x7c1e[_0x51e389];return _0x4fe128;};'use strict';var multer=require(_0xe7c1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe7c1('0x1'));var express=require('express');var router=express[_0xe7c1('0x2')]();var auth=require(_0xe7c1('0x3'));var interaction=require(_0xe7c1('0x4'));var config=require(_0xe7c1('0x5'));var controller=require(_0xe7c1('0x6'));router[_0xe7c1('0x7')]('/',auth[_0xe7c1('0x8')](),controller[_0xe7c1('0x9')]);router[_0xe7c1('0x7')](_0xe7c1('0xa'),controller[_0xe7c1('0xb')]);router[_0xe7c1('0x7')](_0xe7c1('0xc'),auth[_0xe7c1('0x8')](),controller[_0xe7c1('0xd')]);router[_0xe7c1('0x7')](_0xe7c1('0xe'),auth['isAuthenticated'](),controller[_0xe7c1('0xf')]);var upload=multer({'storage':multer[_0xe7c1('0x10')]({'destination':function(_0x31ab31,_0xbf6d62,_0x57089e){_0x57089e(null,path[_0xe7c1('0x11')](config[_0xe7c1('0x12')],_0xe7c1('0x13')));},'filename':function(_0x4437de,_0x52dad1,_0x267e1a){_0x52dad1[_0xe7c1('0x14')]=_0x52dad1[_0xe7c1('0x14')][_0xe7c1('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x267e1a(null,util[_0xe7c1('0x16')](_0xe7c1('0x17'),path[_0xe7c1('0x18')](_0x52dad1[_0xe7c1('0x14')],path['extname'](_0x52dad1[_0xe7c1('0x14')])),Date[_0xe7c1('0x19')](),path[_0xe7c1('0x1a')](_0x52dad1[_0xe7c1('0x14')])));}})});router['post']('/',upload[_0xe7c1('0x1b')]('file'),controller[_0xe7c1('0x1c')]);router['post'](_0xe7c1('0xa'),controller[_0xe7c1('0x1d')]);router[_0xe7c1('0x1e')](_0xe7c1('0xc'),auth[_0xe7c1('0x8')](),controller[_0xe7c1('0x1f')]);router[_0xe7c1('0x20')](_0xe7c1('0xc'),auth['isAuthenticated'](),controller[_0xe7c1('0x20')]);module[_0xe7c1('0x21')]=router; \ No newline at end of file +var _0xf68a=['/:id/download','isAuthenticated','download','diskStorage','join','root','originalname','replace','format','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','show'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xf68a,0x124));var _0xaf68=function(_0x25e9d0,_0x34a4d7){_0x25e9d0=_0x25e9d0-0x0;var _0x48a180=_0xf68a[_0x25e9d0];return _0x48a180;};'use strict';var multer=require(_0xaf68('0x0'));var util=require(_0xaf68('0x1'));var path=require(_0xaf68('0x2'));var timeout=require(_0xaf68('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xaf68('0x4'));var interaction=require(_0xaf68('0x5'));var config=require(_0xaf68('0x6'));var controller=require(_0xaf68('0x7'));router[_0xaf68('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf68('0x9')]);router[_0xaf68('0x8')](_0xaf68('0xa'),controller[_0xaf68('0xb')]);router[_0xaf68('0x8')](_0xaf68('0xc'),auth['isAuthenticated'](),controller[_0xaf68('0xd')]);router[_0xaf68('0x8')](_0xaf68('0xe'),auth[_0xaf68('0xf')](),controller[_0xaf68('0x10')]);var upload=multer({'storage':multer[_0xaf68('0x11')]({'destination':function(_0x1118fd,_0x565545,_0x16b9cf){_0x16b9cf(null,path[_0xaf68('0x12')](config[_0xaf68('0x13')],'server/files/plugins'));},'filename':function(_0xc80188,_0x4513e6,_0xcba32f){_0x4513e6[_0xaf68('0x14')]=_0x4513e6[_0xaf68('0x14')][_0xaf68('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xcba32f(null,util[_0xaf68('0x16')]('%s-%s%s',path[_0xaf68('0x17')](_0x4513e6[_0xaf68('0x14')],path[_0xaf68('0x18')](_0x4513e6[_0xaf68('0x14')])),Date[_0xaf68('0x19')](),path['extname'](_0x4513e6['originalname'])));}})});router['post']('/',upload[_0xaf68('0x1a')](_0xaf68('0x1b')),controller[_0xaf68('0x1c')]);router[_0xaf68('0x1d')](_0xaf68('0xa'),controller[_0xaf68('0x1e')]);router[_0xaf68('0x1f')](_0xaf68('0xc'),auth[_0xaf68('0xf')](),controller[_0xaf68('0x20')]);router['delete'](_0xaf68('0xc'),auth[_0xaf68('0xf')](),controller[_0xaf68('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 865adbf..7de77bd 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 _0x20e0=['html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM'];(function(_0x3e145d,_0x129818){var _0x189f34=function(_0x5c6a98){while(--_0x5c6a98){_0x3e145d['push'](_0x3e145d['shift']());}};_0x189f34(++_0x129818);}(_0x20e0,0x131));var _0x020e=function(_0x4cf98b,_0x243dd4){_0x4cf98b=_0x4cf98b-0x0;var _0x597fc7=_0x20e0[_0x4cf98b];return _0x597fc7;};'use strict';var Sequelize=require(_0x020e('0x0'));module[_0x020e('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x020e('0x2')](_0x020e('0x3'),_0x020e('0x4'))},'description':{'type':Sequelize[_0x020e('0x5')]},'version':{'type':Sequelize[_0x020e('0x5')]},'path':{'type':Sequelize[_0x020e('0x6')],'comment':_0x020e('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x020e('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x020e('0x9'),_0x020e('0xa'),_0x020e('0xb'),_0x020e('0xc')),'defaultValue':_0x020e('0xb'),'comment':_0x020e('0xd')},'icon':{'type':Sequelize[_0x020e('0x6')]},'adminUrl':{'type':Sequelize[_0x020e('0x6')]},'agentUrl':{'type':Sequelize[_0x020e('0x6')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x020e('0x6')]}}; \ No newline at end of file +var _0x9a0b=['never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly'];(function(_0x219806,_0x44ea29){var _0x338c2e=function(_0x4a05b5){while(--_0x4a05b5){_0x219806['push'](_0x219806['shift']());}};_0x338c2e(++_0x44ea29);}(_0x9a0b,0x7c));var _0xb9a0=function(_0x27183e,_0x1fdb8f){_0x27183e=_0x27183e-0x0;var _0xa88774=_0x9a0b[_0x27183e];return _0xa88774;};'use strict';var Sequelize=require('sequelize');module[_0xb9a0('0x0')]={'name':{'type':Sequelize[_0xb9a0('0x1')]},'type':{'type':Sequelize[_0xb9a0('0x2')]('html',_0xb9a0('0x3'))},'description':{'type':Sequelize[_0xb9a0('0x4')]},'version':{'type':Sequelize[_0xb9a0('0x4')]},'path':{'type':Sequelize[_0xb9a0('0x1')],'comment':_0xb9a0('0x5')},'active':{'type':Sequelize[_0xb9a0('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xb9a0('0x2')](_0xb9a0('0x7'),'agentOnly','always',_0xb9a0('0x8')),'defaultValue':_0xb9a0('0x9'),'comment':_0xb9a0('0xa')},'icon':{'type':Sequelize[_0xb9a0('0x1')]},'adminUrl':{'type':Sequelize[_0xb9a0('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xb9a0('0x1')]},'scriptPath':{'type':Sequelize[_0xb9a0('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index dd036b7..0f2d557 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 _0x66eb=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./plugin.socket','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','get','Plugins','sendStatus','name','send','index','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','Plugin','catch','rawAttributes','find','download','root','format','basename','createWriteStream','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','params','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','encoding','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x66eb,0xa3));var _0xb66e=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x66eb[_0x5cc8b9];return _0x58892e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb66e('0x0'));var rimraf=require(_0xb66e('0x1'));var zipdir=require(_0xb66e('0x2'));var jsonpatch=require(_0xb66e('0x3'));var rp=require(_0xb66e('0x4'));var moment=require(_0xb66e('0x5'));var BPromise=require(_0xb66e('0x6'));var Mustache=require('mustache');var util=require(_0xb66e('0x7'));var path=require(_0xb66e('0x8'));var sox=require(_0xb66e('0x9'));var csv=require(_0xb66e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb66e('0xb'));var squel=require(_0xb66e('0xc'));var crypto=require(_0xb66e('0xd'));var jsforce=require(_0xb66e('0xe'));var deskjs=require(_0xb66e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb66e('0x10'));var Papa=require(_0xb66e('0x11'));var extract=require(_0xb66e('0x12'));var rimraf=require(_0xb66e('0x1'));var archiver=require(_0xb66e('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb66e('0x14'));var hardwareService=require(_0xb66e('0x15'));var logger=require('../../config/logger')(_0xb66e('0x16'));var utils=require(_0xb66e('0x17'));var config=require(_0xb66e('0x18'));var db=require(_0xb66e('0x19'))['db'];config[_0xb66e('0x1a')]=_['defaults'](config[_0xb66e('0x1a')],{'host':_0xb66e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb66e('0x1a')]));require(_0xb66e('0x1c'))['register'](socket);function respondWithStatusCode(_0x2fcf8d,_0x529dcb){_0x529dcb=_0x529dcb||0xcc;return function(_0x525eb6){if(_0x525eb6){return _0x2fcf8d['sendStatus'](_0x529dcb);}return _0x2fcf8d[_0xb66e('0x1d')](_0x529dcb)[_0xb66e('0x1e')]();};}function respondWithResult(_0x3f60e7,_0x243678){_0x243678=_0x243678||0xc8;return function(_0x3b1d72){if(_0x3b1d72){return _0x3f60e7[_0xb66e('0x1d')](_0x243678)[_0xb66e('0x1f')](_0x3b1d72);}};}function respondWithFilteredResult(_0x29991e,_0x57fede){return function(_0x4c05cc){if(_0x4c05cc){var _0x375bc2=_0x4c05cc[_0xb66e('0x20')],_0x296668=_0x57fede['offset'],_0x28ebcd=_0x57fede[_0xb66e('0x21')]+_0x57fede[_0xb66e('0x22')],_0x31f8ef;if(_0x28ebcd>=_0x375bc2){_0x28ebcd=_0x375bc2;_0x31f8ef=0xc8;}else{_0x31f8ef=0xce;}_0x29991e[_0xb66e('0x1d')](_0x31f8ef);return _0x29991e['set'](_0xb66e('0x23'),_0x296668+'-'+_0x28ebcd+'/'+_0x375bc2)[_0xb66e('0x1f')](_0x4c05cc);}return null;};}function patchUpdates(_0x2b752f){return function(_0x564c6d){try{jsonpatch['apply'](_0x564c6d,_0x2b752f,!![]);}catch(_0x15a906){return BPromise[_0xb66e('0x24')](_0x15a906);}return _0x564c6d[_0xb66e('0x25')]();};}function saveUpdates(_0xaf688f,_0x4dc05b){return function(_0x20d511){if(_0x20d511){return _0x20d511['update'](_0xaf688f)[_0xb66e('0x26')](function(_0x5d057b){return _0x5d057b;});}return null;};}function removeEntity(_0x2e165a,_0xf748af){return function(_0xd7285a){if(_0xd7285a){return _0xd7285a[_0xb66e('0x27')]()['then'](function(){var _0xcd221e=_0xd7285a[_0xb66e('0x28')]({'plain':!![]});var _0x1e86d2=_0xb66e('0x29');return db['UserProfileResource'][_0xb66e('0x27')]({'where':{'type':_0x1e86d2,'resourceId':_0xcd221e['id']}})[_0xb66e('0x26')](function(){return _0xd7285a;});})[_0xb66e('0x26')](function(){_0x2e165a[_0xb66e('0x1d')](0xcc)[_0xb66e('0x1e')]();});}};}function handleEntityNotFound(_0x49c5a2,_0x3f1aa6){return function(_0x442d1b){if(!_0x442d1b){_0x49c5a2[_0xb66e('0x2a')](0x194);}return _0x442d1b;};}function handleError(_0x15f027,_0x249c58){_0x249c58=_0x249c58||0x1f4;return function(_0x2fbe91){logger['error'](_0x2fbe91['stack']);if(_0x2fbe91[_0xb66e('0x2b')]){delete _0x2fbe91[_0xb66e('0x2b')];}_0x15f027[_0xb66e('0x1d')](_0x249c58)[_0xb66e('0x2c')](_0x2fbe91);};}exports[_0xb66e('0x2d')]=function(_0x1add38,_0x27440a){var _0x3edbdb={},_0x66fc92={},_0x20c844={'count':0x0,'rows':[]};var _0x47b5f9=db['Plugin']['rawAttributes'];_0x66fc92['model']=_['keys'](_0x47b5f9);_0x66fc92[_0xb66e('0x2e')]=_[_0xb66e('0x2f')](_0x1add38[_0xb66e('0x2e')]);_0x66fc92[_0xb66e('0x30')]=_[_0xb66e('0x31')](_0x66fc92['model'],_0x66fc92[_0xb66e('0x2e')]);_0x3edbdb[_0xb66e('0x32')]=_[_0xb66e('0x31')](_0x66fc92['model'],qs[_0xb66e('0x33')](_0x1add38['query'][_0xb66e('0x33')]));_0x3edbdb[_0xb66e('0x32')]=_0x3edbdb[_0xb66e('0x32')][_0xb66e('0x34')]?_0x3edbdb[_0xb66e('0x32')]:_0x66fc92[_0xb66e('0x35')];if(!_0x1add38['query'][_0xb66e('0x36')](_0xb66e('0x37'))){_0x3edbdb[_0xb66e('0x22')]=qs[_0xb66e('0x22')](_0x1add38['query']['limit']);_0x3edbdb[_0xb66e('0x21')]=qs[_0xb66e('0x21')](_0x1add38[_0xb66e('0x2e')][_0xb66e('0x21')]);}_0x3edbdb[_0xb66e('0x38')]=qs[_0xb66e('0x39')](_0x1add38[_0xb66e('0x2e')][_0xb66e('0x39')]);_0x3edbdb['where']=qs[_0xb66e('0x30')](_[_0xb66e('0x3a')](_0x1add38[_0xb66e('0x2e')],_0x66fc92[_0xb66e('0x30')]));if(_0x1add38['query'][_0xb66e('0x3b')]){_0x3edbdb[_0xb66e('0x3c')]=_[_0xb66e('0x3d')](_0x3edbdb['where'],{'$or':_[_0xb66e('0x3e')](_0x47b5f9,function(_0x4c245c){if(_0x4c245c[_0xb66e('0x3f')][_0xb66e('0x40')]!==_0xb66e('0x41')){var _0x32ba29={};_0x32ba29[_0x4c245c[_0xb66e('0x42')]]={'$like':'%'+_0x1add38[_0xb66e('0x2e')]['filter']+'%'};return _0x32ba29;}})});}_0x3edbdb=_[_0xb66e('0x3d')]({},_0x3edbdb,_0x1add38[_0xb66e('0x43')]);var _0x4b19b8={'where':_0x3edbdb[_0xb66e('0x3c')]};return db['Plugin'][_0xb66e('0x20')](_0x4b19b8)[_0xb66e('0x26')](function(_0x4ea368){_0x20c844[_0xb66e('0x20')]=_0x4ea368;if(_0x1add38[_0xb66e('0x2e')][_0xb66e('0x44')]){_0x3edbdb[_0xb66e('0x45')]=[{'all':!![]}];}return db[_0xb66e('0x46')]['findAll'](_0x3edbdb);})[_0xb66e('0x26')](function(_0x1172e1){_0x20c844['rows']=_0x1172e1;return _0x20c844;})[_0xb66e('0x26')](respondWithFilteredResult(_0x27440a,_0x3edbdb))[_0xb66e('0x47')](handleError(_0x27440a,null));};exports['show']=function(_0x2742c5,_0x222323){var _0x18feb0={'raw':!![],'where':{'id':_0x2742c5['params']['id']}},_0xa607ca={};_0xa607ca['model']=_[_0xb66e('0x2f')](db[_0xb66e('0x46')][_0xb66e('0x48')]);_0xa607ca['query']=_[_0xb66e('0x2f')](_0x2742c5[_0xb66e('0x2e')]);_0xa607ca[_0xb66e('0x30')]=_[_0xb66e('0x31')](_0xa607ca['model'],_0xa607ca[_0xb66e('0x2e')]);_0x18feb0[_0xb66e('0x32')]=_[_0xb66e('0x31')](_0xa607ca[_0xb66e('0x35')],qs['fields'](_0x2742c5['query'][_0xb66e('0x33')]));_0x18feb0[_0xb66e('0x32')]=_0x18feb0['attributes'][_0xb66e('0x34')]?_0x18feb0[_0xb66e('0x32')]:_0xa607ca[_0xb66e('0x35')];if(_0x2742c5['query'][_0xb66e('0x44')]){_0x18feb0[_0xb66e('0x45')]=[{'all':!![]}];}_0x18feb0=_[_0xb66e('0x3d')]({},_0x18feb0,_0x2742c5[_0xb66e('0x43')]);return db[_0xb66e('0x46')][_0xb66e('0x49')](_0x18feb0)['then'](handleEntityNotFound(_0x222323,null))[_0xb66e('0x26')](respondWithResult(_0x222323,null))[_0xb66e('0x47')](handleError(_0x222323,null));};exports[_0xb66e('0x4a')]=function(_0x395593,_0x19ef20,_0x561f90){return db[_0xb66e('0x46')][_0xb66e('0x49')]({'where':{'id':_0x395593['params']['id']},'attributes':['name',_0xb66e('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x19ef20,null))[_0xb66e('0x26')](function(_0x321af0){if(_0x321af0){var _0x3cb073=path['join'](config[_0xb66e('0x4b')],'server/files/plugins',util[_0xb66e('0x4c')]('%s.zip',path[_0xb66e('0x4d')](_0x321af0[_0xb66e('0x8')])));var _0x537508=fs[_0xb66e('0x4e')](_0x3cb073);var _0x491fc0=archiver('zip',{'zlib':{'level':0x9}});_0x491fc0['on']('warning',function(_0x42ea6c){if(_0x42ea6c[_0xb66e('0x4f')]===_0xb66e('0x50')){logger[_0xb66e('0x51')](_0x42ea6c);}else{throw new db[(_0xb66e('0x52'))][(_0xb66e('0x53'))](_0xb66e('0x54'));}});_0x491fc0['on'](_0xb66e('0x51'),function(_0x268809){throw new db['Sequelize']['Error'](_0xb66e('0x54'));});_0x491fc0[_0xb66e('0x55')](_0x537508);_0x491fc0[_0xb66e('0x56')](_0xb66e('0x57'),{'cwd':path[_0xb66e('0x58')](config[_0xb66e('0x4b')],_0xb66e('0x59'),path[_0xb66e('0x5a')](_0x321af0[_0xb66e('0x8')])),'ignore':[path[_0xb66e('0x58')](path[_0xb66e('0x4d')](_0x321af0['path']),_0xb66e('0x5b')),path[_0xb66e('0x58')](path[_0xb66e('0x4d')](_0x321af0['path']),_0xb66e('0x5c'))],'nodir':!![]})[_0xb66e('0x5d')]();_0x537508['on'](_0xb66e('0x5e'),function(){if(!fs[_0xb66e('0x5f')](_0x3cb073)){throw new db[(_0xb66e('0x52'))][(_0xb66e('0x53'))]('Plugin\x20not\x20found');}return _0x19ef20[_0xb66e('0x4a')](_0x3cb073,util[_0xb66e('0x4c')](_0xb66e('0x60'),path[_0xb66e('0x4d')](_0x321af0[_0xb66e('0x8')])),function(_0xf47cdf){if(_0xf47cdf){throw new db[(_0xb66e('0x52'))][(_0xb66e('0x53'))](_0xb66e('0x61'));}fs[_0xb66e('0x62')](_0x3cb073);logger['info'](_0xb66e('0x63'));logger[_0xb66e('0x64')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x19ef20,null));};exports['upload']=function(_0x4ecc43,_0x19b679,_0x397561){var _0x4ec233=path[_0xb66e('0x4d')](_0x4ecc43[_0xb66e('0x65')]['filename'],path[_0xb66e('0x66')](_0x4ecc43[_0xb66e('0x65')][_0xb66e('0x67')]));var _0x279e3a=path[_0xb66e('0x58')](config['root'],_0xb66e('0x59'),_0x4ecc43[_0xb66e('0x65')][_0xb66e('0x67')]);var _0x26b1e4=path['join'](config[_0xb66e('0x4b')],'server/files/plugins',_0x4ec233);logger[_0xb66e('0x64')](_0xb66e('0x68'),_0x279e3a);logger['info'](_0xb66e('0x69'),_0x26b1e4);try{fs[_0xb66e('0x6a')](_0x279e3a,parseInt(_0xb66e('0x6b'),0x8));extract(_0x279e3a,{'dir':_0x26b1e4},function(_0x13bae5){if(_0x13bae5){logger['error'](_0x13bae5);handleError(_0x13bae5,!![]);};var _0x56b4e3=fs[_0xb66e('0x6c')](_0x26b1e4);if(_0x56b4e3['length']>0x1){removeReferences(_0x279e3a,_0x26b1e4);logger['error'](_0xb66e('0x6d'));return _0x397561(new Error('Invalid\x20plugin\x20structure'));}var _0x538af1=fs[_0xb66e('0x6e')](path[_0xb66e('0x58')](_0x26b1e4,_0x56b4e3[0x0]));if(_0x538af1[_0xb66e('0x6f')]()){removeReferences(_0x279e3a,_0x26b1e4);logger[_0xb66e('0x51')](_0xb66e('0x6d'));return _0x397561(new Error(_0xb66e('0x6d')));}if(_0x538af1['isDirectory']()){var _0x37f841=fs[_0xb66e('0x6c')](path[_0xb66e('0x58')](_0x26b1e4,_0x56b4e3[0x0]));if(_0x37f841[_0xb66e('0x34')]===0x0){removeReferences(_0x279e3a,_0x26b1e4);logger[_0xb66e('0x51')](_0xb66e('0x6d'));return _0x397561(new Error(_0xb66e('0x6d')));}var _0x427861=_0x37f841[_0xb66e('0x70')](function(_0x2586f1){return _0x2586f1===_0xb66e('0x71');});if(!_0x427861){return _0x397561(new Error(_0xb66e('0x72')));}var _0x567aa6=fs[_0xb66e('0x73')](path['join'](_0x26b1e4,_0x56b4e3[0x0],_0xb66e('0x71')));var _0x2faa86=JSON[_0xb66e('0x74')](_0x567aa6);if(_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x2b')]){return _0x397561(new Error(_0xb66e('0x76')));}if(_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x3f')]){return _0x397561(new Error(_0xb66e('0x77')));}if(_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x78')]){return _0x397561(new Error(_0xb66e('0x79')));}if(_0xb66e('0x75')==typeof _0x2faa86['parameters']){return _0x397561(new Error(_0xb66e('0x7a')));}if(_0x2faa86[_0xb66e('0x3f')]===_0xb66e('0x7b')){if(_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x7c')][_0xb66e('0x7d')]){return _0x397561(new Error(_0xb66e('0x7e')));}if(_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x7c')][_0xb66e('0x7d')][_0xb66e('0x7f')]&&_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x7c')]['views'][_0xb66e('0x80')]){return _0x397561(new Error(_0xb66e('0x81')));}}else if(_0x2faa86[_0xb66e('0x3f')]==='script'){if(_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x7c')][_0xb66e('0x82')]){return _0x397561(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xb66e('0x75')==typeof _0x2faa86[_0xb66e('0x7c')][_0xb66e('0x83')]){return _0x397561(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x397561(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x26bdd0=_0x2faa86[_0xb66e('0x2b')];var _0x254734=_0x2faa86['description'];var _0x117eed=_0x2faa86[_0xb66e('0x3f')];var _0x483692=_0x2faa86[_0xb66e('0x84')]?_0x2faa86[_0xb66e('0x84')]:_0xb66e('0x85');var _0x272edd=_0x2faa86[_0xb66e('0x86')]?_0x2faa86['icon']:_0xb66e('0x87');var _0x2b78cd='';var _0x231754='';var _0xccd746='';var _0x32cc48='';var _0x4b972d=_0x2faa86[_0xb66e('0x78')];if(_0x117eed===_0xb66e('0x7b')){if(_0xb66e('0x75')!=typeof _0x2faa86[_0xb66e('0x7c')][_0xb66e('0x7d')][_0xb66e('0x7f')]){var _0x31e5b1=_0x2faa86[_0xb66e('0x7c')][_0xb66e('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xb66e('0x88')](_0x31e5b1)){_0x2b78cd=path[_0xb66e('0x58')](_0xb66e('0x89'),_0x4ec233,_0x56b4e3[0x0],_0x31e5b1);}else{_0x2b78cd=_0x31e5b1;}}else{logger['info'](_0xb66e('0x8a'));}if(_0xb66e('0x75')!=typeof _0x2faa86[_0xb66e('0x7c')]['views'][_0xb66e('0x80')]){var _0x52aa2c=_0x2faa86['parameters']['views'][_0xb66e('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xb66e('0x88')](_0x52aa2c)){_0x231754=path['join']('plugins',_0x4ec233,_0x56b4e3[0x0],_0x52aa2c);}else{_0x231754=_0x52aa2c;}}else{logger[_0xb66e('0x64')](_0xb66e('0x8b'));}}else if(_0x117eed==='script'){_0xccd746=_0x2faa86['parameters'][_0xb66e('0x82')];_0x32cc48=_0x2faa86[_0xb66e('0x7c')][_0xb66e('0x83')];if(_0xb66e('0x75')!=typeof _0x2faa86[_0xb66e('0x7c')][_0xb66e('0x7d')]){if(_0xb66e('0x75')!=typeof _0x2faa86['parameters']['views']['admin']){var _0x31e5b1=_0x2faa86['parameters'][_0xb66e('0x7d')][_0xb66e('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xb66e('0x88')](_0x31e5b1)){_0x2b78cd=path['join'](_0xb66e('0x89'),_0x4ec233,_0x56b4e3[0x0],_0x31e5b1);}else{_0x2b78cd=_0x31e5b1;}}if('undefined'!=typeof _0x2faa86[_0xb66e('0x7c')][_0xb66e('0x7d')][_0xb66e('0x80')]){var _0x52aa2c=_0x2faa86[_0xb66e('0x7c')][_0xb66e('0x7d')][_0xb66e('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xb66e('0x88')](_0x52aa2c)){_0x231754=path[_0xb66e('0x58')](_0xb66e('0x89'),_0x4ec233,_0x56b4e3[0x0],_0x52aa2c);}else{_0x231754=_0x52aa2c;}}}}var _0x2aed27={'name':_0x26bdd0,'description':_0x254734,'path':path[_0xb66e('0x58')](_0x4ec233,_0x56b4e3[0x0]),'type':_0x117eed,'sidebar':_0x483692,'icon':_0x272edd,'adminUrl':_0x2b78cd,'agentUrl':_0x231754,'scriptName':_0xccd746,'scriptPath':_0x32cc48,'version':_0x4b972d};removeReferences(_0x279e3a,null);return db[_0xb66e('0x46')][_0xb66e('0x8c')](_0x2aed27)[_0xb66e('0x26')](function(_0x3be2aa){var _0x9ea0b1={'role':_0x4ecc43[_0xb66e('0x8d')][_0xb66e('0x8e')],'userProfileId':_0x4ecc43['body'][_0xb66e('0x8f')]};if(!_0x9ea0b1)throw new Error(_0xb66e('0x90'));if(_0x9ea0b1[_0xb66e('0x8e')]===_0xb66e('0x91')){var _0x4b68b4=_0x3be2aa[_0xb66e('0x28')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xb66e('0x29'),'userProfileId':_0x9ea0b1['userProfileId']},'raw':!![]})[_0xb66e('0x26')](function(_0x7ad3c2){if(_0x7ad3c2&&_0x7ad3c2[_0xb66e('0x92')]===0x0){return db[_0xb66e('0x93')][_0xb66e('0x8c')]({'name':_0x4b68b4[_0xb66e('0x2b')],'resourceId':_0x4b68b4['id'],'type':_0x7ad3c2[_0xb66e('0x2b')],'sectionId':_0x7ad3c2['id']},{})[_0xb66e('0x26')](function(){return _0x3be2aa;});}else{return _0x3be2aa;}})[_0xb66e('0x47')](function(_0x298dcb){logger['error'](_0xb66e('0x94'),_0x298dcb);throw _0x298dcb;});}return _0x3be2aa;})[_0xb66e('0x26')](respondWithResult(_0x19b679,null))['catch'](handleError(_0x19b679,null));}});}catch(_0x6205dd){_0x19b679['status'](0x1f4)[_0xb66e('0x2c')](_0x6205dd);}};function removeReferences(_0x3688d2,_0x459d06){try{if(_0x3688d2){fs[_0xb66e('0x62')](_0x3688d2);logger[_0xb66e('0x64')](_0xb66e('0x95'));}if(_0x459d06){rimraf(_0x459d06,function(){});logger['info'](_0xb66e('0x96'));}}catch(_0xafad1){logger[_0xb66e('0x51')](_0xafad1);}}exports[_0xb66e('0x97')]=function(_0x3e9901,_0x33a6b8,_0x21c35f){return db[_0xb66e('0x46')][_0xb66e('0x49')]({'where':{'id':_0x3e9901[_0xb66e('0x98')]['id']}})[_0xb66e('0x26')](handleEntityNotFound(_0x33a6b8,null))[_0xb66e('0x26')](saveUpdates(_0x3e9901[_0xb66e('0x8d')],null))[_0xb66e('0x26')](respondWithResult(_0x33a6b8,null))[_0xb66e('0x47')](handleError(_0x33a6b8,null));};exports[_0xb66e('0x99')]=function(_0x5365d2,_0xf39410,_0x3c5f20){return db['Plugin'][_0xb66e('0x49')]({'where':{'id':_0x5365d2[_0xb66e('0x98')]['id']}})[_0xb66e('0x26')](function(_0x354f68){if(_0x354f68){return _0x354f68['destroy']();}})[_0xb66e('0x26')](function(_0x182dc6){rimraf(path[_0xb66e('0x58')](config[_0xb66e('0x4b')],_0xb66e('0x59'),path[_0xb66e('0x5a')](_0x182dc6['path'])),function(){});return _0x182dc6;})[_0xb66e('0x26')](handleEntityNotFound(_0xf39410,null))[_0xb66e('0x26')](respondWithStatusCode(_0xf39410,null))[_0xb66e('0x47')](handleError(_0xf39410,null));};exports[_0xb66e('0x9a')]=function(_0x3f14e0,_0x49f98f,_0x426653){return BPromise[_0xb66e('0x9b')]()[_0xb66e('0x26')](function(){if(!_0x3f14e0[_0xb66e('0x2e')]['path']){throw new Error(_0xb66e('0x9c'));}if(!_0x3f14e0[_0xb66e('0x2e')][_0xb66e('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0xc7423c=_0x3f14e0['query']['hostname']?_0x3f14e0[_0xb66e('0x2e')]['hostname']+':'+_0x3f14e0['query'][_0xb66e('0x9d')]:'http://localhost:'+_0x3f14e0[_0xb66e('0x2e')][_0xb66e('0x9d')];var _0x44dd16=_0x3f14e0[_0xb66e('0x2e')][_0xb66e('0x1f')]?_0x3f14e0[_0xb66e('0x2e')][_0xb66e('0x1f')]:!![];var _0x2e2c2b=_0x3f14e0['query']['encoding']?_0x3f14e0[_0xb66e('0x2e')][_0xb66e('0x9e')]:null;var _0x167653={'method':_0x3f14e0['method'],'uri':util[_0xb66e('0x4c')](_0xb66e('0x9f'),_0xc7423c,_0x3f14e0[_0xb66e('0x2e')][_0xb66e('0x8')]),'json':_0x44dd16,'resolveWithFullResponse':!![],'encoding':_0x2e2c2b,'qs':_0x3f14e0[_0xb66e('0x2e')]};if(_0x3f14e0['headers']){_0x167653[_0xb66e('0xa0')]=_0x3f14e0[_0xb66e('0xa0')];if(_0x167653[_0xb66e('0xa0')][_0xb66e('0xa1')]){delete _0x167653[_0xb66e('0xa0')]['content-length'];}}if(_0x167653[_0xb66e('0xa0')][_0xb66e('0xa2')]){delete _0x167653[_0xb66e('0xa0')][_0xb66e('0xa2')];}return rp(_0x167653);})[_0xb66e('0x26')](function(_0x5cb9f1){if(_0x5cb9f1){_0x49f98f[_0xb66e('0xa3')](_0x5cb9f1[_0xb66e('0xa0')]);logger['info'](_0x5cb9f1[_0xb66e('0x8d')]);if(_[_0xb66e('0xa4')](_0x3f14e0[_0xb66e('0x2e')][_0xb66e('0x8')],_0xb66e('0x4a'))&&_0x5cb9f1[_0xb66e('0xa5')]==0x1f4){return _0x49f98f[_0xb66e('0x2a')](_0x5cb9f1[_0xb66e('0xa5')]);}else{return _0x49f98f['status'](_0x5cb9f1[_0xb66e('0xa5')])[_0xb66e('0x2c')](_0x5cb9f1[_0xb66e('0x8d')]);}}else{return _0x49f98f[_0xb66e('0x2a')](0xc8);}})[_0xb66e('0x47')](handleError(_0x49f98f,null));};exports[_0xb66e('0xa6')]=function(_0x3ed051,_0x56a432,_0xd65bcb){return BPromise[_0xb66e('0x9b')]()[_0xb66e('0x26')](function(){if(!_0x3ed051['query'][_0xb66e('0x8')]){throw new Error(_0xb66e('0x9c'));}if(!_0x3ed051['query'][_0xb66e('0x9d')]){throw new Error(_0xb66e('0xa7'));}var _0x233973=_0x3ed051[_0xb66e('0x2e')][_0xb66e('0xa8')]?_0x3ed051[_0xb66e('0x2e')]['hostname']+':'+_0x3ed051[_0xb66e('0x2e')][_0xb66e('0x9d')]:_0xb66e('0xa9')+_0x3ed051[_0xb66e('0x2e')][_0xb66e('0x9d')];var _0x474545=_0x3ed051[_0xb66e('0x2e')][_0xb66e('0x1f')]?_0x3ed051['query'][_0xb66e('0x1f')]:!![];var _0xbd9add=_0x3ed051['query']['encoding']?_0x3ed051[_0xb66e('0x2e')]['encoding']:null;var _0xf67997={'method':_0x3ed051['method'],'uri':util[_0xb66e('0x4c')](_0xb66e('0x9f'),_0x233973,_0x3ed051[_0xb66e('0x2e')][_0xb66e('0x8')]),'json':_0x474545,'resolveWithFullResponse':!![],'encoding':_0xbd9add,'body':_0x3ed051[_0xb66e('0x8d')]};if(_0x3ed051[_0xb66e('0xa0')]){_0xf67997[_0xb66e('0xa0')]=_0x3ed051[_0xb66e('0xa0')];if(_0xf67997[_0xb66e('0xa0')][_0xb66e('0xa1')]){delete _0xf67997[_0xb66e('0xa0')]['content-length'];}}if(_0xf67997['headers'][_0xb66e('0xa2')]){delete _0xf67997[_0xb66e('0xa0')][_0xb66e('0xa2')];}return rp(_0xf67997);})['then'](function(_0x2f9d79){if(_0x2f9d79){_0x56a432[_0xb66e('0xa3')](_0x2f9d79[_0xb66e('0xa0')]);logger[_0xb66e('0x64')](_0x2f9d79[_0xb66e('0x8d')]);return _0x56a432['status'](_0x2f9d79[_0xb66e('0xa5')])['send'](_0x2f9d79[_0xb66e('0x8d')]);}else{return _0x56a432[_0xb66e('0x2a')](0xc8);}})['catch'](handleError(_0x56a432,null));}; \ No newline at end of file +var _0x9edc=['admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Zip\x20archive\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','stack','name','send','index','Plugin','model','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','key','field','options','includeAll','include','rows','show','rawAttributes','find','catch','params','server/files/plugins','%s.zip','basename','createWriteStream','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','root','dirname','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','download','format','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','lstatSync','Invalid\x20plugin\x20structure','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','views'];(function(_0x2b5ad1,_0x4c6c24){var _0x55dd63=function(_0x4909a4){while(--_0x4909a4){_0x2b5ad1['push'](_0x2b5ad1['shift']());}};_0x55dd63(++_0x4c6c24);}(_0x9edc,0x16d));var _0xc9ed=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x9edc[_0x1e6db3];return _0x1de886;};'use strict';var pdf=require(_0xc9ed('0x0'));var emlformat=require(_0xc9ed('0x1'));var rimraf=require(_0xc9ed('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9ed('0x3'));var rp=require(_0xc9ed('0x4'));var moment=require(_0xc9ed('0x5'));var BPromise=require(_0xc9ed('0x6'));var Mustache=require(_0xc9ed('0x7'));var util=require('util');var path=require(_0xc9ed('0x8'));var sox=require(_0xc9ed('0x9'));var csv=require('to-csv');var ejs=require(_0xc9ed('0xa'));var fs=require('fs');var _=require(_0xc9ed('0xb'));var squel=require(_0xc9ed('0xc'));var crypto=require(_0xc9ed('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc9ed('0xe'));var toCsv=require(_0xc9ed('0xf'));var querystring=require(_0xc9ed('0x10'));var Papa=require(_0xc9ed('0x11'));var extract=require(_0xc9ed('0x12'));var rimraf=require(_0xc9ed('0x2'));var archiver=require(_0xc9ed('0x13'));var Redis=require(_0xc9ed('0x14'));var authService=require(_0xc9ed('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc9ed('0x16'));var logger=require(_0xc9ed('0x17'))(_0xc9ed('0x18'));var utils=require('../../config/utils');var config=require(_0xc9ed('0x19'));var db=require('../../mysqldb')['db'];config[_0xc9ed('0x1a')]=_['defaults'](config[_0xc9ed('0x1a')],{'host':_0xc9ed('0x1b'),'port':0x18eb});var socket=require(_0xc9ed('0x1c'))(new Redis(config[_0xc9ed('0x1a')]));require(_0xc9ed('0x1d'))[_0xc9ed('0x1e')](socket);function respondWithStatusCode(_0x5f0e56,_0x2929ae){_0x2929ae=_0x2929ae||0xcc;return function(_0x531a30){if(_0x531a30){return _0x5f0e56[_0xc9ed('0x1f')](_0x2929ae);}return _0x5f0e56[_0xc9ed('0x20')](_0x2929ae)[_0xc9ed('0x21')]();};}function respondWithResult(_0x1392db,_0x3d72de){_0x3d72de=_0x3d72de||0xc8;return function(_0x26b5e0){if(_0x26b5e0){return _0x1392db[_0xc9ed('0x20')](_0x3d72de)[_0xc9ed('0x22')](_0x26b5e0);}};}function respondWithFilteredResult(_0xc88952,_0x356794){return function(_0xc6e168){if(_0xc6e168){var _0x3e8012=_0xc6e168[_0xc9ed('0x23')],_0x55aef0=_0x356794[_0xc9ed('0x24')],_0x21b2a2=_0x356794[_0xc9ed('0x24')]+_0x356794[_0xc9ed('0x25')],_0x36acdf;if(_0x21b2a2>=_0x3e8012){_0x21b2a2=_0x3e8012;_0x36acdf=0xc8;}else{_0x36acdf=0xce;}_0xc88952['status'](_0x36acdf);return _0xc88952[_0xc9ed('0x26')](_0xc9ed('0x27'),_0x55aef0+'-'+_0x21b2a2+'/'+_0x3e8012)['json'](_0xc6e168);}return null;};}function patchUpdates(_0x30b7){return function(_0x398de3){try{jsonpatch[_0xc9ed('0x28')](_0x398de3,_0x30b7,!![]);}catch(_0x40ea3d){return BPromise[_0xc9ed('0x29')](_0x40ea3d);}return _0x398de3['save']();};}function saveUpdates(_0x305628,_0x4d7b00){return function(_0x370928){if(_0x370928){return _0x370928[_0xc9ed('0x2a')](_0x305628)[_0xc9ed('0x2b')](function(_0x56bb7d){return _0x56bb7d;});}return null;};}function removeEntity(_0x254770,_0x3c6ea5){return function(_0x5715c3){if(_0x5715c3){return _0x5715c3[_0xc9ed('0x2c')]()[_0xc9ed('0x2b')](function(){var _0x5c4010=_0x5715c3[_0xc9ed('0x2d')]({'plain':!![]});var _0x3798a0=_0xc9ed('0x2e');return db[_0xc9ed('0x2f')][_0xc9ed('0x2c')]({'where':{'type':_0x3798a0,'resourceId':_0x5c4010['id']}})[_0xc9ed('0x2b')](function(){return _0x5715c3;});})[_0xc9ed('0x2b')](function(){_0x254770['status'](0xcc)[_0xc9ed('0x21')]();});}};}function handleEntityNotFound(_0x8c69fe,_0x4c25f8){return function(_0x5e2554){if(!_0x5e2554){_0x8c69fe[_0xc9ed('0x1f')](0x194);}return _0x5e2554;};}function handleError(_0x155d3a,_0x5a01e7){_0x5a01e7=_0x5a01e7||0x1f4;return function(_0x534b1a){logger['error'](_0x534b1a[_0xc9ed('0x30')]);if(_0x534b1a['name']){delete _0x534b1a[_0xc9ed('0x31')];}_0x155d3a[_0xc9ed('0x20')](_0x5a01e7)[_0xc9ed('0x32')](_0x534b1a);};}exports[_0xc9ed('0x33')]=function(_0x5d90f4,_0x3f030d){var _0x3e7571={},_0x5204e4={},_0x136cf3={'count':0x0,'rows':[]};var _0x53fc99=db[_0xc9ed('0x34')]['rawAttributes'];_0x5204e4[_0xc9ed('0x35')]=_[_0xc9ed('0x36')](_0x53fc99);_0x5204e4[_0xc9ed('0x37')]=_['keys'](_0x5d90f4[_0xc9ed('0x37')]);_0x5204e4['filters']=_[_0xc9ed('0x38')](_0x5204e4[_0xc9ed('0x35')],_0x5204e4[_0xc9ed('0x37')]);_0x3e7571[_0xc9ed('0x39')]=_['intersection'](_0x5204e4[_0xc9ed('0x35')],qs[_0xc9ed('0x3a')](_0x5d90f4['query'][_0xc9ed('0x3a')]));_0x3e7571['attributes']=_0x3e7571[_0xc9ed('0x39')][_0xc9ed('0x3b')]?_0x3e7571[_0xc9ed('0x39')]:_0x5204e4['model'];if(!_0x5d90f4[_0xc9ed('0x37')]['hasOwnProperty']('nolimit')){_0x3e7571['limit']=qs[_0xc9ed('0x25')](_0x5d90f4[_0xc9ed('0x37')][_0xc9ed('0x25')]);_0x3e7571[_0xc9ed('0x24')]=qs[_0xc9ed('0x24')](_0x5d90f4['query']['offset']);}_0x3e7571[_0xc9ed('0x3c')]=qs[_0xc9ed('0x3d')](_0x5d90f4[_0xc9ed('0x37')][_0xc9ed('0x3d')]);_0x3e7571[_0xc9ed('0x3e')]=qs[_0xc9ed('0x3f')](_[_0xc9ed('0x40')](_0x5d90f4[_0xc9ed('0x37')],_0x5204e4[_0xc9ed('0x3f')]));if(_0x5d90f4[_0xc9ed('0x37')][_0xc9ed('0x41')]){_0x3e7571[_0xc9ed('0x3e')]=_[_0xc9ed('0x42')](_0x3e7571[_0xc9ed('0x3e')],{'$or':_['map'](_0x53fc99,function(_0x50189f){if(_0x50189f[_0xc9ed('0x43')][_0xc9ed('0x44')]!=='VIRTUAL'){var _0x25b274={};_0x25b274[_0x50189f[_0xc9ed('0x45')]]={'$like':'%'+_0x5d90f4[_0xc9ed('0x37')][_0xc9ed('0x41')]+'%'};return _0x25b274;}})});}_0x3e7571=_[_0xc9ed('0x42')]({},_0x3e7571,_0x5d90f4[_0xc9ed('0x46')]);var _0x5cb9f0={'where':_0x3e7571['where']};return db['Plugin']['count'](_0x5cb9f0)[_0xc9ed('0x2b')](function(_0x7739d0){_0x136cf3[_0xc9ed('0x23')]=_0x7739d0;if(_0x5d90f4['query'][_0xc9ed('0x47')]){_0x3e7571[_0xc9ed('0x48')]=[{'all':!![]}];}return db[_0xc9ed('0x34')]['findAll'](_0x3e7571);})['then'](function(_0x34e894){_0x136cf3[_0xc9ed('0x49')]=_0x34e894;return _0x136cf3;})[_0xc9ed('0x2b')](respondWithFilteredResult(_0x3f030d,_0x3e7571))['catch'](handleError(_0x3f030d,null));};exports[_0xc9ed('0x4a')]=function(_0x710160,_0xf6f40c){var _0x1ca764={'raw':!![],'where':{'id':_0x710160['params']['id']}},_0x4b99d2={};_0x4b99d2['model']=_['keys'](db[_0xc9ed('0x34')][_0xc9ed('0x4b')]);_0x4b99d2[_0xc9ed('0x37')]=_['keys'](_0x710160['query']);_0x4b99d2[_0xc9ed('0x3f')]=_[_0xc9ed('0x38')](_0x4b99d2[_0xc9ed('0x35')],_0x4b99d2[_0xc9ed('0x37')]);_0x1ca764[_0xc9ed('0x39')]=_[_0xc9ed('0x38')](_0x4b99d2[_0xc9ed('0x35')],qs[_0xc9ed('0x3a')](_0x710160[_0xc9ed('0x37')][_0xc9ed('0x3a')]));_0x1ca764[_0xc9ed('0x39')]=_0x1ca764[_0xc9ed('0x39')][_0xc9ed('0x3b')]?_0x1ca764['attributes']:_0x4b99d2['model'];if(_0x710160[_0xc9ed('0x37')][_0xc9ed('0x47')]){_0x1ca764[_0xc9ed('0x48')]=[{'all':!![]}];}_0x1ca764=_[_0xc9ed('0x42')]({},_0x1ca764,_0x710160[_0xc9ed('0x46')]);return db[_0xc9ed('0x34')][_0xc9ed('0x4c')](_0x1ca764)[_0xc9ed('0x2b')](handleEntityNotFound(_0xf6f40c,null))[_0xc9ed('0x2b')](respondWithResult(_0xf6f40c,null))[_0xc9ed('0x4d')](handleError(_0xf6f40c,null));};exports['download']=function(_0x352eb1,_0xb7b85d,_0x372b9e){return db['Plugin'][_0xc9ed('0x4c')]({'where':{'id':_0x352eb1[_0xc9ed('0x4e')]['id']},'attributes':[_0xc9ed('0x31'),_0xc9ed('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0xb7b85d,null))['then'](function(_0x5450fb){if(_0x5450fb){var _0x1379a1=path['join'](config['root'],_0xc9ed('0x4f'),util['format'](_0xc9ed('0x50'),path[_0xc9ed('0x51')](_0x5450fb['path'])));var _0x1a5d45=fs[_0xc9ed('0x52')](_0x1379a1);var _0x2c771a=archiver('zip',{'zlib':{'level':0x9}});_0x2c771a['on'](_0xc9ed('0x53'),function(_0x35cd27){if(_0x35cd27['code']===_0xc9ed('0x54')){logger['error'](_0x35cd27);}else{throw new db[(_0xc9ed('0x55'))][(_0xc9ed('0x56'))](_0xc9ed('0x57'));}});_0x2c771a['on'](_0xc9ed('0x58'),function(_0x533915){throw new db[(_0xc9ed('0x55'))][(_0xc9ed('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2c771a['pipe'](_0x1a5d45);_0x2c771a['glob']('**/*',{'cwd':path['join'](config[_0xc9ed('0x59')],'server/files/plugins',path[_0xc9ed('0x5a')](_0x5450fb[_0xc9ed('0x8')])),'ignore':[path[_0xc9ed('0x5b')](path[_0xc9ed('0x51')](_0x5450fb[_0xc9ed('0x8')]),_0xc9ed('0x5c')),path['join'](path[_0xc9ed('0x51')](_0x5450fb[_0xc9ed('0x8')]),_0xc9ed('0x5d'))],'nodir':!![]})[_0xc9ed('0x5e')]();_0x1a5d45['on'](_0xc9ed('0x5f'),function(){if(!fs[_0xc9ed('0x60')](_0x1379a1)){throw new db[(_0xc9ed('0x55'))][(_0xc9ed('0x56'))]('Plugin\x20not\x20found');}return _0xb7b85d[_0xc9ed('0x61')](_0x1379a1,util[_0xc9ed('0x62')](_0xc9ed('0x50'),path['basename'](_0x5450fb[_0xc9ed('0x8')])),function(_0x27af80){if(_0x27af80){throw new db['Sequelize'][(_0xc9ed('0x56'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xc9ed('0x63')](_0x1379a1);logger['info'](_0xc9ed('0x64'));logger['info'](_0xc9ed('0x65'));});});}return null;})[_0xc9ed('0x4d')](handleError(_0xb7b85d,null));};exports[_0xc9ed('0x66')]=function(_0x381946,_0x4f5fe1,_0x5a8bee){var _0xb4081a=path[_0xc9ed('0x51')](_0x381946[_0xc9ed('0x67')]['filename'],path[_0xc9ed('0x68')](_0x381946[_0xc9ed('0x67')][_0xc9ed('0x69')]));var _0x2bac94=path['join'](config[_0xc9ed('0x59')],_0xc9ed('0x4f'),_0x381946['file'][_0xc9ed('0x69')]);var _0x1378a8=path['join'](config[_0xc9ed('0x59')],_0xc9ed('0x4f'),_0xb4081a);logger[_0xc9ed('0x6a')](_0xc9ed('0x6b'),_0x2bac94);logger['info'](_0xc9ed('0x6c'),_0x1378a8);try{fs[_0xc9ed('0x6d')](_0x2bac94,parseInt(_0xc9ed('0x6e'),0x8));extract(_0x2bac94,{'dir':_0x1378a8},function(_0x48316b){if(_0x48316b){logger[_0xc9ed('0x58')](_0x48316b);handleError(_0x48316b,!![]);};var _0x39b2c4=fs['readdirSync'](_0x1378a8);if(_0x39b2c4[_0xc9ed('0x3b')]>0x1){removeReferences(_0x2bac94,_0x1378a8);logger[_0xc9ed('0x58')]('Invalid\x20plugin\x20structure');return _0x5a8bee(new Error('Invalid\x20plugin\x20structure'));}var _0x2d9a7b=fs[_0xc9ed('0x6f')](path[_0xc9ed('0x5b')](_0x1378a8,_0x39b2c4[0x0]));if(_0x2d9a7b['isFile']()){removeReferences(_0x2bac94,_0x1378a8);logger['error'](_0xc9ed('0x70'));return _0x5a8bee(new Error(_0xc9ed('0x70')));}if(_0x2d9a7b[_0xc9ed('0x71')]()){var _0x1ea8ac=fs[_0xc9ed('0x72')](path['join'](_0x1378a8,_0x39b2c4[0x0]));if(_0x1ea8ac['length']===0x0){removeReferences(_0x2bac94,_0x1378a8);logger[_0xc9ed('0x58')](_0xc9ed('0x70'));return _0x5a8bee(new Error(_0xc9ed('0x70')));}var _0x2e787f=_0x1ea8ac[_0xc9ed('0x73')](function(_0x2616a0){return _0x2616a0===_0xc9ed('0x74');});if(!_0x2e787f){return _0x5a8bee(new Error(_0xc9ed('0x75')));}var _0x49cf07=fs[_0xc9ed('0x76')](path[_0xc9ed('0x5b')](_0x1378a8,_0x39b2c4[0x0],_0xc9ed('0x74')));var _0xbd529=JSON[_0xc9ed('0x77')](_0x49cf07);if(_0xc9ed('0x78')==typeof _0xbd529[_0xc9ed('0x31')]){return _0x5a8bee(new Error(_0xc9ed('0x79')));}if(_0xc9ed('0x78')==typeof _0xbd529['type']){return _0x5a8bee(new Error(_0xc9ed('0x7a')));}if(_0xc9ed('0x78')==typeof _0xbd529[_0xc9ed('0x7b')]){return _0x5a8bee(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0xbd529[_0xc9ed('0x7c')]){return _0x5a8bee(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0xbd529[_0xc9ed('0x43')]===_0xc9ed('0x7d')){if('undefined'==typeof _0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')]){return _0x5a8bee(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xc9ed('0x78')==typeof _0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')][_0xc9ed('0x7f')]&&_0xc9ed('0x78')==typeof _0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')][_0xc9ed('0x80')]){return _0x5a8bee(new Error(_0xc9ed('0x81')));}}else if(_0xbd529['type']==='script'){if(_0xc9ed('0x78')==typeof _0xbd529['parameters'][_0xc9ed('0x82')]){return _0x5a8bee(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0xbd529['parameters'][_0xc9ed('0x83')]){return _0x5a8bee(new Error(_0xc9ed('0x84')));}}else{return _0x5a8bee(new Error(_0xc9ed('0x85')));}var _0x382f70=_0xbd529[_0xc9ed('0x31')];var _0x23f38f=_0xbd529[_0xc9ed('0x86')];var _0x3c62f0=_0xbd529[_0xc9ed('0x43')];var _0xebb684=_0xbd529[_0xc9ed('0x87')]?_0xbd529[_0xc9ed('0x87')]:'always';var _0xa327ce=_0xbd529['icon']?_0xbd529[_0xc9ed('0x88')]:_0xc9ed('0x89');var _0x44e179='';var _0x364707='';var _0x5218ec='';var _0x579a1f='';var _0x248f3f=_0xbd529['version'];if(_0x3c62f0===_0xc9ed('0x7d')){if(_0xc9ed('0x78')!=typeof _0xbd529['parameters'][_0xc9ed('0x7e')][_0xc9ed('0x7f')]){var _0x2ae6db=_0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ae6db)){_0x44e179=path[_0xc9ed('0x5b')](_0xc9ed('0x8a'),_0xb4081a,_0x39b2c4[0x0],_0x2ae6db);}else{_0x44e179=_0x2ae6db;}}else{logger[_0xc9ed('0x6a')](_0xc9ed('0x8b'));}if(_0xc9ed('0x78')!=typeof _0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')]['agent']){var _0x37137b=_0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xc9ed('0x8c')](_0x37137b)){_0x364707=path[_0xc9ed('0x5b')](_0xc9ed('0x8a'),_0xb4081a,_0x39b2c4[0x0],_0x37137b);}else{_0x364707=_0x37137b;}}else{logger[_0xc9ed('0x6a')](_0xc9ed('0x8d'));}}else if(_0x3c62f0===_0xc9ed('0x8e')){_0x5218ec=_0xbd529['parameters']['scriptName'];_0x579a1f=_0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x83')];if(_0xc9ed('0x78')!=typeof _0xbd529['parameters'][_0xc9ed('0x7e')]){if(_0xc9ed('0x78')!=typeof _0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')][_0xc9ed('0x7f')]){var _0x2ae6db=_0xbd529[_0xc9ed('0x7c')]['views'][_0xc9ed('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ae6db)){_0x44e179=path[_0xc9ed('0x5b')](_0xc9ed('0x8a'),_0xb4081a,_0x39b2c4[0x0],_0x2ae6db);}else{_0x44e179=_0x2ae6db;}}if(_0xc9ed('0x78')!=typeof _0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')][_0xc9ed('0x80')]){var _0x37137b=_0xbd529[_0xc9ed('0x7c')][_0xc9ed('0x7e')][_0xc9ed('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xc9ed('0x8c')](_0x37137b)){_0x364707=path[_0xc9ed('0x5b')](_0xc9ed('0x8a'),_0xb4081a,_0x39b2c4[0x0],_0x37137b);}else{_0x364707=_0x37137b;}}}}var _0x45ef7b={'name':_0x382f70,'description':_0x23f38f,'path':path[_0xc9ed('0x5b')](_0xb4081a,_0x39b2c4[0x0]),'type':_0x3c62f0,'sidebar':_0xebb684,'icon':_0xa327ce,'adminUrl':_0x44e179,'agentUrl':_0x364707,'scriptName':_0x5218ec,'scriptPath':_0x579a1f,'version':_0x248f3f};removeReferences(_0x2bac94,null);return db[_0xc9ed('0x34')][_0xc9ed('0x8f')](_0x45ef7b)[_0xc9ed('0x2b')](function(_0x112347){var _0xed31d2={'role':_0x381946[_0xc9ed('0x90')][_0xc9ed('0x91')],'userProfileId':_0x381946['body']['userProfileId']};if(!_0xed31d2)throw new Error(_0xc9ed('0x92'));if(_0xed31d2[_0xc9ed('0x91')]==='user'){var _0x51036b=_0x112347[_0xc9ed('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0xc9ed('0x4c')]({'where':{'name':'Plugins','userProfileId':_0xed31d2['userProfileId']},'raw':!![]})['then'](function(_0x2f94c4){if(_0x2f94c4&&_0x2f94c4[_0xc9ed('0x93')]===0x0){return db[_0xc9ed('0x2f')][_0xc9ed('0x8f')]({'name':_0x51036b[_0xc9ed('0x31')],'resourceId':_0x51036b['id'],'type':_0x2f94c4[_0xc9ed('0x31')],'sectionId':_0x2f94c4['id']},{})[_0xc9ed('0x2b')](function(){return _0x112347;});}else{return _0x112347;}})[_0xc9ed('0x4d')](function(_0x5c036a){logger[_0xc9ed('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c036a);throw _0x5c036a;});}return _0x112347;})[_0xc9ed('0x2b')](respondWithResult(_0x4f5fe1,null))[_0xc9ed('0x4d')](handleError(_0x4f5fe1,null));}});}catch(_0xc7bc3f){_0x4f5fe1[_0xc9ed('0x20')](0x1f4)[_0xc9ed('0x32')](_0xc7bc3f);}};function removeReferences(_0x18cc17,_0x200cf9){try{if(_0x18cc17){fs[_0xc9ed('0x63')](_0x18cc17);logger[_0xc9ed('0x6a')](_0xc9ed('0x94'));}if(_0x200cf9){rimraf(_0x200cf9,function(){});logger[_0xc9ed('0x6a')]('Extracted\x20folder\x20removed');}}catch(_0x11adb1){logger['error'](_0x11adb1);}}exports['update']=function(_0xd52caa,_0x33403d,_0x1df99d){return db[_0xc9ed('0x34')][_0xc9ed('0x4c')]({'where':{'id':_0xd52caa[_0xc9ed('0x4e')]['id']}})['then'](handleEntityNotFound(_0x33403d,null))[_0xc9ed('0x2b')](saveUpdates(_0xd52caa[_0xc9ed('0x90')],null))['then'](respondWithResult(_0x33403d,null))[_0xc9ed('0x4d')](handleError(_0x33403d,null));};exports[_0xc9ed('0x95')]=function(_0x5d8006,_0x46861a,_0x55a2cc){return db[_0xc9ed('0x34')][_0xc9ed('0x4c')]({'where':{'id':_0x5d8006['params']['id']}})[_0xc9ed('0x2b')](function(_0x1d3f81){if(_0x1d3f81){return _0x1d3f81[_0xc9ed('0x2c')]();}})[_0xc9ed('0x2b')](function(_0x5ad465){rimraf(path[_0xc9ed('0x5b')](config[_0xc9ed('0x59')],'server/files/plugins',path[_0xc9ed('0x5a')](_0x5ad465[_0xc9ed('0x8')])),function(){});return _0x5ad465;})['then'](handleEntityNotFound(_0x46861a,null))['then'](respondWithStatusCode(_0x46861a,null))[_0xc9ed('0x4d')](handleError(_0x46861a,null));};exports['webhookGet']=function(_0x44037f,_0x3c9585,_0x315e8d){return BPromise[_0xc9ed('0x96')]()[_0xc9ed('0x2b')](function(){if(!_0x44037f['query'][_0xc9ed('0x8')]){throw new Error(_0xc9ed('0x97'));}if(!_0x44037f[_0xc9ed('0x37')][_0xc9ed('0x98')]){throw new Error(_0xc9ed('0x99'));}var _0x7e6268=_0x44037f[_0xc9ed('0x37')][_0xc9ed('0x9a')]?_0x44037f['query']['hostname']+':'+_0x44037f[_0xc9ed('0x37')][_0xc9ed('0x98')]:'http://localhost:'+_0x44037f[_0xc9ed('0x37')][_0xc9ed('0x98')];var _0x24a8a0=_0x44037f[_0xc9ed('0x37')]['json']?_0x44037f[_0xc9ed('0x37')]['json']:!![];var _0x4bdf43=_0x44037f['query']['encoding']?_0x44037f[_0xc9ed('0x37')][_0xc9ed('0x9b')]:null;var _0x3c2603={'method':_0x44037f[_0xc9ed('0x9c')],'uri':util[_0xc9ed('0x62')](_0xc9ed('0x9d'),_0x7e6268,_0x44037f['query'][_0xc9ed('0x8')]),'json':_0x24a8a0,'resolveWithFullResponse':!![],'encoding':_0x4bdf43,'qs':_0x44037f[_0xc9ed('0x37')]};if(_0x44037f['headers']){_0x3c2603[_0xc9ed('0x9e')]=_0x44037f[_0xc9ed('0x9e')];if(_0x3c2603['headers'][_0xc9ed('0x9f')]){delete _0x3c2603['headers'][_0xc9ed('0x9f')];}}if(_0x3c2603[_0xc9ed('0x9e')][_0xc9ed('0xa0')]){delete _0x3c2603['headers']['content-type'];}return rp(_0x3c2603);})[_0xc9ed('0x2b')](function(_0xebf00){if(_0xebf00){_0x3c9585[_0xc9ed('0x26')](_0xebf00[_0xc9ed('0x9e')]);logger[_0xc9ed('0x6a')](_0xebf00['body']);if(_[_0xc9ed('0xa1')](_0x44037f['query'][_0xc9ed('0x8')],_0xc9ed('0x61'))&&_0xebf00[_0xc9ed('0xa2')]==0x1f4){return _0x3c9585[_0xc9ed('0x1f')](_0xebf00['statusCode']);}else{return _0x3c9585[_0xc9ed('0x20')](_0xebf00[_0xc9ed('0xa2')])[_0xc9ed('0x32')](_0xebf00[_0xc9ed('0x90')]);}}else{return _0x3c9585[_0xc9ed('0x1f')](0xc8);}})[_0xc9ed('0x4d')](handleError(_0x3c9585,null));};exports[_0xc9ed('0xa3')]=function(_0x51b30e,_0x43cb99,_0x283172){return BPromise[_0xc9ed('0x96')]()['then'](function(){if(!_0x51b30e['query']['path']){throw new Error(_0xc9ed('0x97'));}if(!_0x51b30e[_0xc9ed('0x37')][_0xc9ed('0x98')]){throw new Error(_0xc9ed('0x99'));}var _0x523ba2=_0x51b30e['query'][_0xc9ed('0x9a')]?_0x51b30e['query']['hostname']+':'+_0x51b30e[_0xc9ed('0x37')][_0xc9ed('0x98')]:'http://localhost:'+_0x51b30e[_0xc9ed('0x37')][_0xc9ed('0x98')];var _0x43d788=_0x51b30e[_0xc9ed('0x37')][_0xc9ed('0x22')]?_0x51b30e[_0xc9ed('0x37')]['json']:!![];var _0x2207ca=_0x51b30e['query'][_0xc9ed('0x9b')]?_0x51b30e[_0xc9ed('0x37')][_0xc9ed('0x9b')]:null;var _0x4d8b43={'method':_0x51b30e[_0xc9ed('0x9c')],'uri':util[_0xc9ed('0x62')]('%s%s',_0x523ba2,_0x51b30e[_0xc9ed('0x37')]['path']),'json':_0x43d788,'resolveWithFullResponse':!![],'encoding':_0x2207ca,'body':_0x51b30e[_0xc9ed('0x90')]};if(_0x51b30e[_0xc9ed('0x9e')]){_0x4d8b43['headers']=_0x51b30e['headers'];if(_0x4d8b43[_0xc9ed('0x9e')][_0xc9ed('0x9f')]){delete _0x4d8b43[_0xc9ed('0x9e')][_0xc9ed('0x9f')];}}if(_0x4d8b43[_0xc9ed('0x9e')]['content-type']){delete _0x4d8b43[_0xc9ed('0x9e')][_0xc9ed('0xa0')];}return rp(_0x4d8b43);})[_0xc9ed('0x2b')](function(_0x29efaa){if(_0x29efaa){_0x43cb99[_0xc9ed('0x26')](_0x29efaa[_0xc9ed('0x9e')]);logger[_0xc9ed('0x6a')](_0x29efaa[_0xc9ed('0x90')]);return _0x43cb99[_0xc9ed('0x20')](_0x29efaa['statusCode'])[_0xc9ed('0x32')](_0x29efaa[_0xc9ed('0x90')]);}else{return _0x43cb99[_0xc9ed('0x1f')](0xc8);}})['catch'](handleError(_0x43cb99,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0afa60c..9733ce7 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 _0xc7ee=['remove','emit','exports','events','Plugin','setMaxListeners','save','update'];(function(_0x5be3ba,_0x15c27e){var _0x514d56=function(_0x364c0d){while(--_0x364c0d){_0x5be3ba['push'](_0x5be3ba['shift']());}};_0x514d56(++_0x15c27e);}(_0xc7ee,0x17b));var _0xec7e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc7ee[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0xec7e('0x0'));var Plugin=require('../../mysqldb')['db'][_0xec7e('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xec7e('0x2')](0x0);var events={'afterCreate':_0xec7e('0x3'),'afterUpdate':_0xec7e('0x4'),'afterDestroy':_0xec7e('0x5')};function emitEvent(_0x2117f6){return function(_0x523180,_0x372331,_0x31db50){PluginEvents[_0xec7e('0x6')](_0x2117f6+':'+_0x523180['id'],_0x523180);PluginEvents['emit'](_0x2117f6,_0x523180);_0x31db50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xec7e('0x7')]=PluginEvents; \ No newline at end of file +var _0xb046=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0xcc3081,_0x12ce55){var _0x118e1b=function(_0x549dfe){while(--_0x549dfe){_0xcc3081['push'](_0xcc3081['shift']());}};_0x118e1b(++_0x12ce55);}(_0xb046,0x1a1));var _0x6b04=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0xb046[_0x4c184d];return _0x23d997;};'use strict';var EventEmitter=require(_0x6b04('0x0'));var Plugin=require(_0x6b04('0x1'))['db'][_0x6b04('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b04('0x3'),'afterUpdate':_0x6b04('0x4'),'afterDestroy':_0x6b04('0x5')};function emitEvent(_0x16ea27){return function(_0x5885a6,_0x53044b,_0x515492){PluginEvents[_0x6b04('0x6')](_0x16ea27+':'+_0x5885a6['id'],_0x5885a6);PluginEvents['emit'](_0x16ea27,_0x5885a6);_0x515492(null);};}for(var e in events){if(events[_0x6b04('0x7')](e)){var event=events[e];Plugin[_0x6b04('0x8')](e,emitEvent(event));}}module[_0x6b04('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 a3a2b00..e7c9fee 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 _0x35a6=['Plugin','plugins','../../config/logger','api','moment','bluebird','request-promise','path','define'];(function(_0x2ffd05,_0x1840e3){var _0x5038bf=function(_0xe7e075){while(--_0xe7e075){_0x2ffd05['push'](_0x2ffd05['shift']());}};_0x5038bf(++_0x1840e3);}(_0x35a6,0x122));var _0x635a=function(_0x16ca8e,_0x60f267){_0x16ca8e=_0x16ca8e-0x0;var _0x4c560e=_0x35a6[_0x16ca8e];return _0x4c560e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x635a('0x0'))(_0x635a('0x1'));var moment=require(_0x635a('0x2'));var BPromise=require(_0x635a('0x3'));var rp=require(_0x635a('0x4'));var fs=require('fs');var path=require(_0x635a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x376476,_0x2b3e59){return _0x376476[_0x635a('0x6')](_0x635a('0x7'),attributes,{'tableName':_0x635a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b5f=['bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','../../config/logger','api'];(function(_0x2e5a19,_0x332650){var _0xb2cee8=function(_0xef797d){while(--_0xef797d){_0x2e5a19['push'](_0x2e5a19['shift']());}};_0xb2cee8(++_0x332650);}(_0x8b5f,0x106));var _0xf8b5=function(_0x37c391,_0x2684ab){_0x37c391=_0x37c391-0x0;var _0x291f8c=_0x8b5f[_0x37c391];return _0x291f8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf8b5('0x0'))(_0xf8b5('0x1'));var moment=require('moment');var BPromise=require(_0xf8b5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8b5('0x3'));var rimraf=require(_0xf8b5('0x4'));var config=require(_0xf8b5('0x5'));var attributes=require(_0xf8b5('0x6'));module[_0xf8b5('0x7')]=function(_0x4716c8,_0x24da59){return _0x4716c8[_0xf8b5('0x8')](_0xf8b5('0x9'),attributes,{'tableName':_0xf8b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 2104913..0cd09e2 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 _0xce45=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','./plugin.socket','register','request','info','request\x20sent','debug','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','body','options','raw','then'];(function(_0x203d97,_0x220143){var _0x57cafc=function(_0x445603){while(--_0x445603){_0x203d97['push'](_0x203d97['shift']());}};_0x57cafc(++_0x220143);}(_0xce45,0x7d));var _0x5ce4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xce45[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x5ce4('0x0'));var util=require(_0x5ce4('0x1'));var moment=require(_0x5ce4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ce4('0x3'));var db=require(_0x5ce4('0x4'))['db'];var utils=require(_0x5ce4('0x5'));var logger=require('../../config/logger')(_0x5ce4('0x6'));var config=require(_0x5ce4('0x7'));var jayson=require(_0x5ce4('0x8'));var client=jayson['client'][_0x5ce4('0x9')]({'port':0x232a});config['redis']=_[_0x5ce4('0xa')](config[_0x5ce4('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ce4('0xb')]));require(_0x5ce4('0xc'))[_0x5ce4('0xd')](socket);function respondWithRpcPromise(_0x5ee8c6,_0x52cf8f,_0x164809){return new BPromise(function(_0x379640,_0x1e9a01){return client[_0x5ce4('0xe')](_0x5ee8c6,_0x164809)['then'](function(_0x2d14a6){logger[_0x5ce4('0xf')]('Plugin,\x20%s,\x20%s',_0x52cf8f,_0x5ce4('0x10'));logger[_0x5ce4('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x52cf8f,_0x5ce4('0x10'),JSON[_0x5ce4('0x12')](_0x2d14a6));if(_0x2d14a6[_0x5ce4('0x13')]){if(_0x2d14a6[_0x5ce4('0x13')][_0x5ce4('0x14')]===0x1f4){logger[_0x5ce4('0x13')](_0x5ce4('0x15'),_0x52cf8f,_0x2d14a6[_0x5ce4('0x13')][_0x5ce4('0x16')]);return _0x1e9a01(_0x2d14a6[_0x5ce4('0x13')]['message']);}logger['error'](_0x5ce4('0x15'),_0x52cf8f,_0x2d14a6['error']['message']);return _0x379640(_0x2d14a6[_0x5ce4('0x13')][_0x5ce4('0x16')]);}else{logger[_0x5ce4('0xf')](_0x5ce4('0x15'),_0x52cf8f,_0x5ce4('0x10'));_0x379640(_0x2d14a6[_0x5ce4('0x17')]['message']);}})['catch'](function(_0x3984b9){logger[_0x5ce4('0x13')](_0x5ce4('0x15'),_0x52cf8f,_0x3984b9);_0x1e9a01(_0x3984b9);});});}exports[_0x5ce4('0x18')]=function(_0x4d0b20){var _0x34a07d=this;return new Promise(function(_0x209182,_0x290ef4){return db[_0x5ce4('0x19')]['create'](_0x4d0b20[_0x5ce4('0x1a')],{'raw':_0x4d0b20[_0x5ce4('0x1b')]?_0x4d0b20[_0x5ce4('0x1b')][_0x5ce4('0x1c')]===undefined?!![]:![]:!![]})[_0x5ce4('0x1d')](function(_0x271047){logger[_0x5ce4('0xf')]('CreatePlugin',_0x4d0b20);logger[_0x5ce4('0x11')](_0x5ce4('0x18'),_0x4d0b20,JSON[_0x5ce4('0x12')](_0x271047));_0x209182(_0x271047);})[_0x5ce4('0x1e')](function(_0x113f8e){logger[_0x5ce4('0x13')]('CreatePlugin',_0x113f8e[_0x5ce4('0x16')],_0x4d0b20);_0x290ef4(_0x34a07d[_0x5ce4('0x13')](0x1f4,_0x113f8e['message']));});});}; \ No newline at end of file +var _0x641d=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','Plugin','create','options','CreatePlugin','stringify','catch','lodash','util'];(function(_0x16c5b7,_0x1c94ec){var _0x2c3f14=function(_0x4e2a5c){while(--_0x4e2a5c){_0x16c5b7['push'](_0x16c5b7['shift']());}};_0x2c3f14(++_0x1c94ec);}(_0x641d,0x166));var _0xd641=function(_0x204178,_0x5d30a7){_0x204178=_0x204178-0x0;var _0x460ba5=_0x641d[_0x204178];return _0x460ba5;};'use strict';var _=require(_0xd641('0x0'));var util=require(_0xd641('0x1'));var moment=require(_0xd641('0x2'));var BPromise=require(_0xd641('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd641('0x4'))['db'];var utils=require(_0xd641('0x5'));var logger=require(_0xd641('0x6'))('rpc');var config=require(_0xd641('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd641('0x8')][_0xd641('0x9')]({'port':0x232a});config[_0xd641('0xa')]=_[_0xd641('0xb')](config[_0xd641('0xa')],{'host':_0xd641('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd641('0xa')]));require('./plugin.socket')[_0xd641('0xd')](socket);function respondWithRpcPromise(_0x3b11d2,_0x16eba3,_0x3f7a0e){return new BPromise(function(_0x5efa3d,_0x2cb45e){return client[_0xd641('0xe')](_0x3b11d2,_0x3f7a0e)[_0xd641('0xf')](function(_0x3a526b){logger[_0xd641('0x10')](_0xd641('0x11'),_0x16eba3,_0xd641('0x12'));logger[_0xd641('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x16eba3,_0xd641('0x12'),JSON['stringify'](_0x3a526b));if(_0x3a526b[_0xd641('0x14')]){if(_0x3a526b[_0xd641('0x14')][_0xd641('0x15')]===0x1f4){logger['error'](_0xd641('0x11'),_0x16eba3,_0x3a526b[_0xd641('0x14')]['message']);return _0x2cb45e(_0x3a526b[_0xd641('0x14')][_0xd641('0x16')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x16eba3,_0x3a526b[_0xd641('0x14')][_0xd641('0x16')]);return _0x5efa3d(_0x3a526b['error'][_0xd641('0x16')]);}else{logger[_0xd641('0x10')](_0xd641('0x11'),_0x16eba3,_0xd641('0x12'));_0x5efa3d(_0x3a526b[_0xd641('0x17')][_0xd641('0x16')]);}})['catch'](function(_0xede909){logger[_0xd641('0x14')]('Plugin,\x20%s,\x20%s',_0x16eba3,_0xede909);_0x2cb45e(_0xede909);});});}exports['CreatePlugin']=function(_0x15ef09){var _0x2dc40b=this;return new Promise(function(_0x5eb6a8,_0x53c670){return db[_0xd641('0x18')][_0xd641('0x19')](_0x15ef09['body'],{'raw':_0x15ef09[_0xd641('0x1a')]?_0x15ef09[_0xd641('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xd641('0xf')](function(_0x22d9ae){logger[_0xd641('0x10')](_0xd641('0x1b'),_0x15ef09);logger['debug']('CreatePlugin',_0x15ef09,JSON[_0xd641('0x1c')](_0x22d9ae));_0x5eb6a8(_0x22d9ae);})[_0xd641('0x1d')](function(_0x1ea3af){logger[_0xd641('0x14')](_0xd641('0x1b'),_0x1ea3af[_0xd641('0x16')],_0x15ef09);_0x53c670(_0x2dc40b[_0xd641('0x14')](0x1f4,_0x1ea3af[_0xd641('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index a080d91..e26f203 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 _0xd351=['update','emit','removeListener','length','plugin:','./plugin.events','save','remove'];(function(_0x1416a2,_0x12ac36){var _0x1953a2=function(_0xf44d6f){while(--_0xf44d6f){_0x1416a2['push'](_0x1416a2['shift']());}};_0x1953a2(++_0x12ac36);}(_0xd351,0x14d));var _0x1d35=function(_0x423342,_0x38eaa6){_0x423342=_0x423342-0x0;var _0x44defb=_0xd351[_0x423342];return _0x44defb;};'use strict';var PluginEvents=require(_0x1d35('0x0'));var events=[_0x1d35('0x1'),_0x1d35('0x2'),_0x1d35('0x3')];function createListener(_0x2f0218,_0x3373be){return function(_0x3363ea){_0x3373be[_0x1d35('0x4')](_0x2f0218,_0x3363ea);};}function removeListener(_0x14d1b5,_0x3d24f5){return function(){PluginEvents[_0x1d35('0x5')](_0x14d1b5,_0x3d24f5);};}exports['register']=function(_0x3d634d){for(var _0x296781=0x0,_0x5bc7ce=events[_0x1d35('0x6')];_0x296781<_0x5bc7ce;_0x296781++){var _0x40a6cc=events[_0x296781];var _0x125046=createListener(_0x1d35('0x7')+_0x40a6cc,_0x3d634d);PluginEvents['on'](_0x40a6cc,_0x125046);}}; \ No newline at end of file +var _0x6e0d=['./plugin.events','save','remove','removeListener','register','length'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6e0d,0x1d4));var _0xd6e0=function(_0x57263f,_0x196580){_0x57263f=_0x57263f-0x0;var _0x25929b=_0x6e0d[_0x57263f];return _0x25929b;};'use strict';var PluginEvents=require(_0xd6e0('0x0'));var events=[_0xd6e0('0x1'),_0xd6e0('0x2'),'update'];function createListener(_0x333e2a,_0xeefd65){return function(_0x15ec59){_0xeefd65['emit'](_0x333e2a,_0x15ec59);};}function removeListener(_0x239015,_0x3e3c56){return function(){PluginEvents[_0xd6e0('0x3')](_0x239015,_0x3e3c56);};}exports[_0xd6e0('0x4')]=function(_0x531f3a){for(var _0x17061d=0x0,_0x19e133=events[_0xd6e0('0x5')];_0x17061d<_0x19e133;_0x17061d++){var _0x4e4d6=events[_0x17061d];var _0x1f3f86=createListener('plugin:'+_0x4e4d6,_0x531f3a);PluginEvents['on'](_0x4e4d6,_0x1f3f86);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 09d83b4..ff0167b 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(_0x3a304a,_0x93bbf9){var _0x1757a3=function(_0x3b0b6d){while(--_0x3b0b6d){_0x3a304a['push'](_0x3a304a['shift']());}};_0x1757a3(++_0x93bbf9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x4b9f31,_0x550e6f){var _0x5b9597=function(_0x1642eb){while(--_0x1642eb){_0x4b9f31['push'](_0x4b9f31['shift']());}};_0x5b9597(++_0x550e6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 f254816..beac37e 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 _0x9b12=['../../config/pm2','api','child_process','sendStatus','status','error','stack','name','send','info','index','then','express','motion2','catch','show','params','create','body','script','join','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','delete','lodash'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0x9b12,0x83));var _0x29b1=function(_0x2daeb6,_0x53ec17){_0x2daeb6=_0x2daeb6-0x0;var _0x3a0c8d=_0x9b12[_0x2daeb6];return _0x3a0c8d;};'use strict';var _=require(_0x29b1('0x0'));var pm2=require(_0x29b1('0x1'));var logger=require('../../config/logger')(_0x29b1('0x2'));var path=require('path');var exec=require(_0x29b1('0x3'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x45a1fe,_0x26a172){return function(_0xe4fb09){if(!_0xe4fb09){_0x45a1fe[_0x29b1('0x4')](0x194);;}return _0xe4fb09;};}function respondWithResult(_0x42af9b,_0x1a17c4){_0x1a17c4=_0x1a17c4||0xc8;return function(_0x5085e6){if(_0x5085e6){return _0x42af9b[_0x29b1('0x5')](_0x1a17c4)['json'](_0x5085e6);}return null;};}function handleError(_0x21dbee,_0x296b84){_0x296b84=_0x296b84||0x1f4;return function(_0x22be68){logger[_0x29b1('0x6')](_0x22be68[_0x29b1('0x7')]);if(_0x22be68[_0x29b1('0x8')]){delete _0x22be68[_0x29b1('0x8')];}_0x21dbee['status'](_0x296b84)[_0x29b1('0x9')](_0x22be68);};}function execChildProcess(){return new BPromise(function(_0x2552d7,_0x24bf4b){exec('npm\x20install',function(_0x4c5170,_0x540070,_0x5309aa){logger[_0x29b1('0xa')](_0x540070);logger[_0x29b1('0xa')](_0x5309aa);if(_0x4c5170){logger[_0x29b1('0x6')](_0x4c5170);return _0x24bf4b(_0x4c5170);}return _0x2552d7(_0x540070);});});}exports[_0x29b1('0xb')]=function(_0x35b81f,_0x3cc941){return pm2['list']()[_0x29b1('0xc')](function(_0x562fe2){if(_0x562fe2){var _0x3c3d15=_['reject'](_0x562fe2,function(_0xfb4829){return _0xfb4829[_0x29b1('0x8')]===_0x29b1('0xd')||_0xfb4829[_0x29b1('0x8')]===_0x29b1('0xe');});return{'rows':_0x3c3d15,'count':_0x3c3d15['length']};}return null;})[_0x29b1('0xc')](respondWithResult(_0x3cc941,null))[_0x29b1('0xf')](handleError(_0x3cc941,null));};exports[_0x29b1('0x10')]=function(_0x162003,_0x1ca56c){return pm2['describe'](_0x162003[_0x29b1('0x11')]['id'])[_0x29b1('0xc')](respondWithResult(_0x1ca56c,null))[_0x29b1('0xc')](handleEntityNotFound(_0x1ca56c,null))['catch'](handleError(_0x1ca56c,null));};exports[_0x29b1('0x12')]=function(_0x5b528b,_0x32d8e8){if(_0x5b528b['body']['name']&&_0x5b528b[_0x29b1('0x13')][_0x29b1('0x14')]){var _0x448d32=path[_0x29b1('0x15')](__dirname,'../../files/plugins',_0x5b528b['body'][_0x29b1('0x14')]);var _0x1284ff=process['cwd']();process[_0x29b1('0x16')](path[_0x29b1('0x17')](_0x448d32));return execChildProcess()[_0x29b1('0xc')](function(_0x11a56d){process[_0x29b1('0x16')](_0x1284ff);return pm2[_0x29b1('0x18')]({'name':_0x5b528b[_0x29b1('0x13')]['name'],'script':_0x448d32});})[_0x29b1('0xc')](function(_0x26e254){pm2[_0x29b1('0x19')]();return _0x26e254[0x0];})[_0x29b1('0xc')](respondWithResult(_0x32d8e8,0xc9))['catch'](handleError(_0x32d8e8,null));}else{return _0x32d8e8['status'](0x1f4)[_0x29b1('0x9')]({'message':_0x29b1('0x1a')});}};exports[_0x29b1('0x1b')]=function(_0x39c5bb,_0xcadd86){if(_0x39c5bb[_0x29b1('0x13')]['id']){delete _0x39c5bb[_0x29b1('0x13')]['id'];}var _0x2b72a8={'online':_0x29b1('0x1c'),'stopped':_0x29b1('0x1d')};if(_0x2b72a8[_0x29b1('0x1e')](_0x39c5bb['body'][_0x29b1('0x5')])){return pm2[_0x2b72a8[_0x39c5bb['body'][_0x29b1('0x5')]]](_0x39c5bb[_0x29b1('0x11')]['id'])['then'](respondWithResult(_0xcadd86,0xc8))[_0x29b1('0xf')](handleError(_0xcadd86,null));}else{return _0xcadd86['status'](0x1f4)['send']({'message':_0x29b1('0x1f')});}};exports['destroy']=function(_0x229384,_0x14b226){if(_0x229384[_0x29b1('0x13')]['id']){delete _0x229384[_0x29b1('0x13')]['id'];}if(_0x229384[_0x29b1('0x11')]['id']){return pm2[_0x29b1('0x20')](_0x229384['params']['id'])[_0x29b1('0xc')](function(_0x3ddb51){pm2[_0x29b1('0x19')]();return _0x3ddb51[0x0];})[_0x29b1('0xc')](respondWithResult(_0x14b226,null))['catch'](handleError(_0x14b226,null));}else{return _0x14b226[_0x29b1('0x5')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x36e8=['info','index','list','then','express','motion2','length','catch','show','body','script','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','bluebird','status','json','error','name','send','npm\x20install'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x36e8,0x16a));var _0x836e=function(_0x11ada3,_0x1af701){_0x11ada3=_0x11ada3-0x0;var _0x204127=_0x36e8[_0x11ada3];return _0x204127;};'use strict';var _=require('lodash');var pm2=require(_0x836e('0x0'));var logger=require(_0x836e('0x1'))(_0x836e('0x2'));var path=require(_0x836e('0x3'));var exec=require(_0x836e('0x4'))['exec'];var BPromise=require(_0x836e('0x5'));function handleEntityNotFound(_0x13b2d8,_0x5766c3){return function(_0x42cc42){if(!_0x42cc42){_0x13b2d8['sendStatus'](0x194);;}return _0x42cc42;};}function respondWithResult(_0x1802a8,_0x35f88c){_0x35f88c=_0x35f88c||0xc8;return function(_0x148362){if(_0x148362){return _0x1802a8[_0x836e('0x6')](_0x35f88c)[_0x836e('0x7')](_0x148362);}return null;};}function handleError(_0x39ec18,_0x55218b){_0x55218b=_0x55218b||0x1f4;return function(_0x3720ae){logger[_0x836e('0x8')](_0x3720ae['stack']);if(_0x3720ae[_0x836e('0x9')]){delete _0x3720ae[_0x836e('0x9')];}_0x39ec18[_0x836e('0x6')](_0x55218b)[_0x836e('0xa')](_0x3720ae);};}function execChildProcess(){return new BPromise(function(_0x223d5c,_0x10ddb5){exec(_0x836e('0xb'),function(_0x2ed1a5,_0x2662d7,_0x2d72e3){logger[_0x836e('0xc')](_0x2662d7);logger[_0x836e('0xc')](_0x2d72e3);if(_0x2ed1a5){logger[_0x836e('0x8')](_0x2ed1a5);return _0x10ddb5(_0x2ed1a5);}return _0x223d5c(_0x2662d7);});});}exports[_0x836e('0xd')]=function(_0x58ab20,_0x2a5805){return pm2[_0x836e('0xe')]()[_0x836e('0xf')](function(_0x332719){if(_0x332719){var _0x18e5c3=_['reject'](_0x332719,function(_0xe34ab2){return _0xe34ab2[_0x836e('0x9')]===_0x836e('0x10')||_0xe34ab2[_0x836e('0x9')]===_0x836e('0x11');});return{'rows':_0x18e5c3,'count':_0x18e5c3[_0x836e('0x12')]};}return null;})[_0x836e('0xf')](respondWithResult(_0x2a5805,null))[_0x836e('0x13')](handleError(_0x2a5805,null));};exports[_0x836e('0x14')]=function(_0x3d799e,_0x35a420){return pm2['describe'](_0x3d799e['params']['id'])[_0x836e('0xf')](respondWithResult(_0x35a420,null))['then'](handleEntityNotFound(_0x35a420,null))[_0x836e('0x13')](handleError(_0x35a420,null));};exports['create']=function(_0x271c19,_0x4a680c){if(_0x271c19[_0x836e('0x15')][_0x836e('0x9')]&&_0x271c19[_0x836e('0x15')][_0x836e('0x16')]){var _0x295bb1=path['join'](__dirname,_0x836e('0x17'),_0x271c19['body'][_0x836e('0x16')]);var _0xcb9c37=process['cwd']();process[_0x836e('0x18')](path[_0x836e('0x19')](_0x295bb1));return execChildProcess()[_0x836e('0xf')](function(_0x12cb61){process[_0x836e('0x18')](_0xcb9c37);return pm2[_0x836e('0x1a')]({'name':_0x271c19[_0x836e('0x15')][_0x836e('0x9')],'script':_0x295bb1});})[_0x836e('0xf')](function(_0x6ea50a){pm2[_0x836e('0x1b')]();return _0x6ea50a[0x0];})[_0x836e('0xf')](respondWithResult(_0x4a680c,0xc9))[_0x836e('0x13')](handleError(_0x4a680c,null));}else{return _0x4a680c[_0x836e('0x6')](0x1f4)[_0x836e('0xa')]({'message':_0x836e('0x1c')});}};exports['update']=function(_0x433859,_0x3d8d01){if(_0x433859[_0x836e('0x15')]['id']){delete _0x433859[_0x836e('0x15')]['id'];}var _0x5cbeb5={'online':'restart','stopped':_0x836e('0x1d')};if(_0x5cbeb5[_0x836e('0x1e')](_0x433859[_0x836e('0x15')][_0x836e('0x6')])){return pm2[_0x5cbeb5[_0x433859[_0x836e('0x15')][_0x836e('0x6')]]](_0x433859[_0x836e('0x1f')]['id'])[_0x836e('0xf')](respondWithResult(_0x3d8d01,0xc8))[_0x836e('0x13')](handleError(_0x3d8d01,null));}else{return _0x3d8d01['status'](0x1f4)[_0x836e('0xa')]({'message':_0x836e('0x20')});}};exports['destroy']=function(_0xd35f74,_0x10a69f){if(_0xd35f74[_0x836e('0x15')]['id']){delete _0xd35f74[_0x836e('0x15')]['id'];}if(_0xd35f74[_0x836e('0x1f')]['id']){return pm2['delete'](_0xd35f74[_0x836e('0x1f')]['id'])[_0x836e('0xf')](function(_0x16a0cd){pm2[_0x836e('0x1b')]();return _0x16a0cd[0x0];})[_0x836e('0xf')](respondWithResult(_0x10a69f,null))[_0x836e('0x13')](handleError(_0x10a69f,null));}else{return _0x10a69f[_0x836e('0x6')](0x1f4)[_0x836e('0xa')]({'message':_0x836e('0x21')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6ae7e36..4d7d109 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 _0xaa37=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x28cf83,_0x569536){var _0x1e5567=function(_0x7fc8f0){while(--_0x7fc8f0){_0x28cf83['push'](_0x28cf83['shift']());}};_0x1e5567(++_0x569536);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xaa37[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var auth=require(_0x7aa3('0x5'));var interaction=require(_0x7aa3('0x6'));var config=require(_0x7aa3('0x7'));module[_0x7aa3('0x8')]=router; \ No newline at end of file +var _0xdded=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x16b8eb,_0x1ed49d){var _0xbbe4e8=function(_0x43f660){while(--_0x43f660){_0x16b8eb['push'](_0x16b8eb['shift']());}};_0xbbe4e8(++_0x1ed49d);}(_0xdded,0x17a));var _0xddde=function(_0x33c102,_0x22faa7){_0x33c102=_0x33c102-0x0;var _0x5921e9=_0xdded[_0x33c102];return _0x5921e9;};'use strict';var multer=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var path=require(_0xddde('0x2'));var timeout=require(_0xddde('0x3'));var express=require(_0xddde('0x4'));var router=express[_0xddde('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xddde('0x6'));var config=require(_0xddde('0x7'));module[_0xddde('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 536df8d..3beca51 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 _0x9aac=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9aac,0x159));var _0xc9aa=function(_0x28e31c,_0x19e958){_0x28e31c=_0x28e31c-0x0;var _0x34bb18=_0x9aac[_0x28e31c];return _0x34bb18;};'use strict';var Sequelize=require(_0xc9aa('0x0'));module[_0xc9aa('0x1')]={'state':{'type':Sequelize[_0xc9aa('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc9aa('0x3')]},'scheduledat':{'type':Sequelize[_0xc9aa('0x4')]},'uniqueid':{'type':Sequelize[_0xc9aa('0x3')]},'starttime':{'type':Sequelize[_0xc9aa('0x4')]},'responsetime':{'type':Sequelize[_0xc9aa('0x4')]},'ringtime':{'type':Sequelize[_0xc9aa('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc9aa('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9782=['INTEGER','exports','STRING','DATE'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0x9782,0x189));var _0x2978=function(_0x3bece3,_0x10a102){_0x3bece3=_0x3bece3-0x0;var _0x4f033c=_0x9782[_0x3bece3];return _0x4f033c;};'use strict';var Sequelize=require('sequelize');module[_0x2978('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2978('0x1')]},'scheduledat':{'type':Sequelize[_0x2978('0x2')]},'uniqueid':{'type':Sequelize[_0x2978('0x1')]},'starttime':{'type':Sequelize[_0x2978('0x2')]},'responsetime':{'type':Sequelize[_0x2978('0x2')]},'ringtime':{'type':Sequelize[_0x2978('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x2978('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2978('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 4e437c8..44adab9 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 _0x36f3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','lodash','../../config/logger','api'];(function(_0x1a799a,_0x21edab){var _0x395491=function(_0x4917cc){while(--_0x4917cc){_0x1a799a['push'](_0x1a799a['shift']());}};_0x395491(++_0x21edab);}(_0x36f3,0x17e));var _0x336f=function(_0x1e1267,_0x4e7653){_0x1e1267=_0x1e1267-0x0;var _0x34ba0b=_0x36f3[_0x1e1267];return _0x34ba0b;};'use strict';var _=require(_0x336f('0x0'));var util=require('util');var logger=require(_0x336f('0x1'))(_0x336f('0x2'));var moment=require(_0x336f('0x3'));var BPromise=require(_0x336f('0x4'));var rp=require(_0x336f('0x5'));var fs=require('fs');var path=require(_0x336f('0x6'));var rimraf=require(_0x336f('0x7'));var config=require(_0x336f('0x8'));var attributes=require(_0x336f('0x9'));module['exports']=function(_0x113146,_0x456a7d){return _0x113146[_0x336f('0xa')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbd6=['ReportAgentPreview','report_agent_preview','util','api','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x38e738,_0x424496){var _0x45ed28=function(_0x75bf3b){while(--_0x75bf3b){_0x38e738['push'](_0x38e738['shift']());}};_0x45ed28(++_0x424496);}(_0xcbd6,0x7b));var _0x6cbd=function(_0x3400cd,_0x2c37db){_0x3400cd=_0x3400cd-0x0;var _0x4f7859=_0xcbd6[_0x3400cd];return _0x4f7859;};'use strict';var _=require('lodash');var util=require(_0x6cbd('0x0'));var logger=require('../../config/logger')(_0x6cbd('0x1'));var moment=require('moment');var BPromise=require(_0x6cbd('0x2'));var rp=require(_0x6cbd('0x3'));var fs=require('fs');var path=require(_0x6cbd('0x4'));var rimraf=require('rimraf');var config=require(_0x6cbd('0x5'));var attributes=require(_0x6cbd('0x6'));module[_0x6cbd('0x7')]=function(_0x40b239,_0x4d5669){return _0x40b239[_0x6cbd('0x8')](_0x6cbd('0x9'),attributes,{'tableName':_0x6cbd('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 5fb71d1..10f6461 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 _0x0639=['message','info','result','catch','CreateReportAgentPreview','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error'];(function(_0xb25c97,_0x510486){var _0x49aae9=function(_0x4e7fe6){while(--_0x4e7fe6){_0xb25c97['push'](_0xb25c97['shift']());}};_0x49aae9(++_0x510486);}(_0x0639,0x15c));var _0x9063=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0639[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x9063('0x0'));var util=require(_0x9063('0x1'));var moment=require(_0x9063('0x2'));var BPromise=require(_0x9063('0x3'));var rs=require(_0x9063('0x4'));var fs=require('fs');var Redis=require(_0x9063('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9063('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9063('0x7')][_0x9063('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x334aed,_0x2f7cc7,_0x24efd9){return new BPromise(function(_0x54c082,_0x12f0b9){return client[_0x9063('0x9')](_0x334aed,_0x24efd9)[_0x9063('0xa')](function(_0x16984d){logger['info'](_0x9063('0xb'),_0x2f7cc7,_0x9063('0xc'));logger[_0x9063('0xd')](_0x9063('0xe'),_0x2f7cc7,_0x9063('0xc'),JSON['stringify'](_0x16984d));if(_0x16984d['error']){if(_0x16984d[_0x9063('0xf')]['code']===0x1f4){logger[_0x9063('0xf')](_0x9063('0xb'),_0x2f7cc7,_0x16984d[_0x9063('0xf')][_0x9063('0x10')]);return _0x12f0b9(_0x16984d[_0x9063('0xf')]['message']);}logger['error'](_0x9063('0xb'),_0x2f7cc7,_0x16984d[_0x9063('0xf')][_0x9063('0x10')]);return _0x54c082(_0x16984d['error']['message']);}else{logger[_0x9063('0x11')](_0x9063('0xb'),_0x2f7cc7,_0x9063('0xc'));_0x54c082(_0x16984d[_0x9063('0x12')][_0x9063('0x10')]);}})[_0x9063('0x13')](function(_0x4a1418){logger[_0x9063('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x2f7cc7,_0x4a1418);_0x12f0b9(_0x4a1418);});});}exports[_0x9063('0x14')]=function(_0x39089d){var _0x31110b=this;return new Promise(function(_0x4476a7,_0x22ec8a){return db['ReportAgentPreview'][_0x9063('0x15')](_0x39089d[_0x9063('0x16')],{'raw':_0x39089d['options']?_0x39089d[_0x9063('0x17')][_0x9063('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x23506a){logger[_0x9063('0x11')](_0x9063('0x14'),_0x39089d);logger[_0x9063('0xd')](_0x9063('0x14'),_0x39089d,JSON[_0x9063('0x19')](_0x23506a));_0x4476a7(_0x23506a);})[_0x9063('0x13')](function(_0xcc57bf){logger['error'](_0x9063('0x14'),_0xcc57bf[_0x9063('0x10')],_0x39089d);_0x22ec8a(_0x31110b[_0x9063('0xf')](0x1f4,_0xcc57bf[_0x9063('0x10')]));});});}; \ No newline at end of file +var _0x6bb1=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','info'];(function(_0xcad94,_0xc1decb){var _0x685c5a=function(_0x278006){while(--_0x278006){_0xcad94['push'](_0xcad94['shift']());}};_0x685c5a(++_0xc1decb);}(_0x6bb1,0x17a));var _0x16bb=function(_0x1af72d,_0x5e252f){_0x1af72d=_0x1af72d-0x0;var _0x7714b9=_0x6bb1[_0x1af72d];return _0x7714b9;};'use strict';var _=require(_0x16bb('0x0'));var util=require(_0x16bb('0x1'));var moment=require(_0x16bb('0x2'));var BPromise=require(_0x16bb('0x3'));var rs=require(_0x16bb('0x4'));var fs=require('fs');var Redis=require(_0x16bb('0x5'));var db=require(_0x16bb('0x6'))['db'];var utils=require(_0x16bb('0x7'));var logger=require(_0x16bb('0x8'))(_0x16bb('0x9'));var config=require(_0x16bb('0xa'));var jayson=require(_0x16bb('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4fa327,_0x3cea65,_0x3cbfa2){return new BPromise(function(_0xf456d6,_0x5764a0){return client['request'](_0x4fa327,_0x3cbfa2)['then'](function(_0x384fd4){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x3cea65,_0x16bb('0xc'));logger[_0x16bb('0xd')](_0x16bb('0xe'),_0x3cea65,'request\x20sent',JSON[_0x16bb('0xf')](_0x384fd4));if(_0x384fd4[_0x16bb('0x10')]){if(_0x384fd4['error'][_0x16bb('0x11')]===0x1f4){logger[_0x16bb('0x10')](_0x16bb('0x12'),_0x3cea65,_0x384fd4[_0x16bb('0x10')][_0x16bb('0x13')]);return _0x5764a0(_0x384fd4[_0x16bb('0x10')][_0x16bb('0x13')]);}logger['error'](_0x16bb('0x12'),_0x3cea65,_0x384fd4['error'][_0x16bb('0x13')]);return _0xf456d6(_0x384fd4['error'][_0x16bb('0x13')]);}else{logger['info'](_0x16bb('0x12'),_0x3cea65,_0x16bb('0xc'));_0xf456d6(_0x384fd4['result'][_0x16bb('0x13')]);}})['catch'](function(_0x307ac1){logger[_0x16bb('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x3cea65,_0x307ac1);_0x5764a0(_0x307ac1);});});}exports[_0x16bb('0x14')]=function(_0x2ce8c7){var _0x3764d1=this;return new Promise(function(_0x26c730,_0x54eca5){return db[_0x16bb('0x15')][_0x16bb('0x16')](_0x2ce8c7[_0x16bb('0x17')],{'raw':_0x2ce8c7['options']?_0x2ce8c7[_0x16bb('0x18')][_0x16bb('0x19')]===undefined?!![]:![]:!![]})[_0x16bb('0x1a')](function(_0x18034e){logger[_0x16bb('0x1b')](_0x16bb('0x14'),_0x2ce8c7);logger[_0x16bb('0xd')](_0x16bb('0x14'),_0x2ce8c7,JSON['stringify'](_0x18034e));_0x26c730(_0x18034e);})[_0x16bb('0x1c')](function(_0x3d960f){logger[_0x16bb('0x10')]('CreateReportAgentPreview',_0x3d960f[_0x16bb('0x13')],_0x2ce8c7);_0x54eca5(_0x3764d1['error'](0x1f4,_0x3d960f['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 494fe9d..8ef2aaf 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 _0xa3d8=['/voice/queues','voiceQueues','/mail/queues','mailQueues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','voiceChannels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor'];(function(_0x4c7036,_0x3a443b){var _0x467b82=function(_0x29103f){while(--_0x29103f){_0x4c7036['push'](_0x4c7036['shift']());}};_0x467b82(++_0x3a443b);}(_0xa3d8,0xd2));var _0x8a3d=function(_0x1627fa,_0x27744e){_0x1627fa=_0x1627fa-0x0;var _0x139069=_0xa3d8[_0x1627fa];return _0x139069;};'use strict';var multer=require(_0x8a3d('0x0'));var util=require(_0x8a3d('0x1'));var path=require('path');var express=require(_0x8a3d('0x2'));var router=express[_0x8a3d('0x3')]();var auth=require(_0x8a3d('0x4'));var controller=require(_0x8a3d('0x5'));router[_0x8a3d('0x6')]('/voice/channels',auth['isAuthenticated'](),controller[_0x8a3d('0x7')]);router[_0x8a3d('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x9')]);router[_0x8a3d('0x6')](_0x8a3d('0xa'),auth['isAuthenticated'](),controller[_0x8a3d('0xb')]);router[_0x8a3d('0x6')](_0x8a3d('0xc'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0xd')]);router[_0x8a3d('0x6')]('/chat/queues',auth['isAuthenticated'](),controller['chatQueues']);router[_0x8a3d('0x6')](_0x8a3d('0xe'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0xf')]);router[_0x8a3d('0x6')](_0x8a3d('0x10'),auth[_0x8a3d('0x8')](),controller['mailAccounts']);router[_0x8a3d('0x6')]('/openchannel/queues',auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x11')]);router[_0x8a3d('0x6')](_0x8a3d('0x12'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x13')]);router[_0x8a3d('0x6')](_0x8a3d('0x14'),auth[_0x8a3d('0x8')](),controller['faxQueues']);router[_0x8a3d('0x6')](_0x8a3d('0x15'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x16')]);router[_0x8a3d('0x6')](_0x8a3d('0x17'),auth['isAuthenticated'](),controller[_0x8a3d('0x18')]);router['get'](_0x8a3d('0x19'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x1a')]);router['get'](_0x8a3d('0x1b'),auth['isAuthenticated'](),controller[_0x8a3d('0x1c')]);router[_0x8a3d('0x6')](_0x8a3d('0x1d'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x1e')]);router[_0x8a3d('0x6')](_0x8a3d('0x1f'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x20')]);router[_0x8a3d('0x6')](_0x8a3d('0x21'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x22')]);router[_0x8a3d('0x6')](_0x8a3d('0x23'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0x8a3d('0x6')](_0x8a3d('0x24'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x25')]);router['put'](_0x8a3d('0x26'),auth['isAuthenticated'](),controller[_0x8a3d('0x27')]);router[_0x8a3d('0x6')]('/telephones',auth['isAuthenticated'](),controller[_0x8a3d('0x28')]);router[_0x8a3d('0x6')]('/trunks',auth[_0x8a3d('0x8')](),controller['trunks']);router[_0x8a3d('0x6')]('/campaigns',auth['isAuthenticated'](),controller[_0x8a3d('0x29')]);router['get'](_0x8a3d('0x2a'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x2b')]);router[_0x8a3d('0x6')](_0x8a3d('0x2c'),auth[_0x8a3d('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0x8a3d('0x6')](_0x8a3d('0x2d'),auth[_0x8a3d('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0x8a3d('0x6')](_0x8a3d('0x2e'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x2f')]);router[_0x8a3d('0x6')](_0x8a3d('0x30'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x31')]);router[_0x8a3d('0x6')](_0x8a3d('0x32'),auth['isAuthenticated'](),controller[_0x8a3d('0x33')]);router[_0x8a3d('0x34')](_0x8a3d('0x35'),auth['isAuthenticated'](),controller[_0x8a3d('0x36')](_0x8a3d('0x37')));router[_0x8a3d('0x6')](_0x8a3d('0x38'),auth['isAuthenticated'](),controller[_0x8a3d('0x39')]);router[_0x8a3d('0x34')](_0x8a3d('0x3a'),auth['isAuthenticated'](),controller['queueNotify'](_0x8a3d('0x3b')));router['get'](_0x8a3d('0x3c'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x3d')]);router[_0x8a3d('0x34')](_0x8a3d('0x3e'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x36')]('fax'));router[_0x8a3d('0x6')](_0x8a3d('0x3f'),auth['isAuthenticated'](),controller[_0x8a3d('0x40')]);router['post'](_0x8a3d('0x41'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x36')](_0x8a3d('0x42')));router[_0x8a3d('0x6')]('/openchannel/queues/:id',auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x43')]);router[_0x8a3d('0x34')](_0x8a3d('0x44'),auth[_0x8a3d('0x8')](),controller['queueNotify'](_0x8a3d('0x45')));router[_0x8a3d('0x6')](_0x8a3d('0x46'),auth[_0x8a3d('0x8')](),controller[_0x8a3d('0x47')]);router['post'](_0x8a3d('0x48'),auth['isAuthenticated'](),controller[_0x8a3d('0x49')]);module['exports']=router; \ No newline at end of file +var _0x6a0b=['/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','queueNotify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','agentNotify','multer','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x54a2f4,_0x47fb9b){_0x54a2f4=_0x54a2f4-0x0;var _0x1a4e8e=_0x6a0b[_0x54a2f4];return _0x1a4e8e;};'use strict';var multer=require(_0xb6a0('0x0'));var util=require('util');var path=require('path');var express=require(_0xb6a0('0x1'));var router=express[_0xb6a0('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0xb6a0('0x3'));router[_0xb6a0('0x4')](_0xb6a0('0x5'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x7')]);router['get'](_0xb6a0('0x8'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x9')]);router[_0xb6a0('0x4')](_0xb6a0('0xa'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0xb')]);router[_0xb6a0('0x4')](_0xb6a0('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0xb6a0('0xd')]);router['get'](_0xb6a0('0xe'),auth[_0xb6a0('0x6')](),controller['mailQueues']);router[_0xb6a0('0x4')](_0xb6a0('0xf'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x10')]);router[_0xb6a0('0x4')](_0xb6a0('0x11'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x12')]);router[_0xb6a0('0x4')](_0xb6a0('0x13'),auth['isAuthenticated'](),controller[_0xb6a0('0x14')]);router[_0xb6a0('0x4')](_0xb6a0('0x15'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x16')]);router[_0xb6a0('0x4')](_0xb6a0('0x17'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x18')]);router['get'](_0xb6a0('0x19'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x1a')]);router['get'](_0xb6a0('0x1b'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x1c')]);router[_0xb6a0('0x4')](_0xb6a0('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xb6a0('0x4')](_0xb6a0('0x1e'),auth['isAuthenticated'](),controller[_0xb6a0('0x1f')]);router['get'](_0xb6a0('0x20'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x21')]);router['get'](_0xb6a0('0x22'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x23')]);router['get'](_0xb6a0('0x24'),auth[_0xb6a0('0x6')](),controller['outboundChannels']);router[_0xb6a0('0x4')]('/agents',auth['isAuthenticated'](),controller[_0xb6a0('0x25')]);router['put'](_0xb6a0('0x26'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x27')]);router[_0xb6a0('0x4')](_0xb6a0('0x28'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x29')]);router['get'](_0xb6a0('0x2a'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x2b')]);router[_0xb6a0('0x4')](_0xb6a0('0x2c'),auth['isAuthenticated'](),controller[_0xb6a0('0x2d')]);router['get'](_0xb6a0('0x2e'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x2f')]);router[_0xb6a0('0x4')](_0xb6a0('0x30'),auth[_0xb6a0('0x6')](),controller['chatQueuesWaitingInteractions']);router['get'](_0xb6a0('0x31'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x32')]);router[_0xb6a0('0x4')](_0xb6a0('0x33'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xb6a0('0x4')](_0xb6a0('0x34'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x35')]);router['get']('/fax/queues/waitinginteractions',auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x36')]);router[_0xb6a0('0x37')](_0xb6a0('0x38'),auth[_0xb6a0('0x6')](),controller['queueNotify']('mail'));router[_0xb6a0('0x4')](_0xb6a0('0x39'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x3a')]);router[_0xb6a0('0x37')](_0xb6a0('0x3b'),auth[_0xb6a0('0x6')](),controller['queueNotify'](_0xb6a0('0x3c')));router[_0xb6a0('0x4')](_0xb6a0('0x3d'),auth['isAuthenticated'](),controller[_0xb6a0('0x3e')]);router[_0xb6a0('0x37')]('/fax/queues/:id/notify',auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x3f')](_0xb6a0('0x40')));router[_0xb6a0('0x4')](_0xb6a0('0x41'),auth[_0xb6a0('0x6')](),controller['showFaxQueues']);router[_0xb6a0('0x37')](_0xb6a0('0x42'),auth[_0xb6a0('0x6')](),controller['queueNotify']('openchannel'));router[_0xb6a0('0x4')](_0xb6a0('0x43'),auth[_0xb6a0('0x6')](),controller[_0xb6a0('0x44')]);router[_0xb6a0('0x37')](_0xb6a0('0x45'),auth[_0xb6a0('0x6')](),controller['queueNotify'](_0xb6a0('0x46')));router['get'](_0xb6a0('0x47'),auth[_0xb6a0('0x6')](),controller['showSmsQueues']);router[_0xb6a0('0x37')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0xb6a0('0x48')]);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 1b7fa02..76ce9c3 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 _0xa32c=['format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','FaxQueues','FaxAccounts','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','InteractionId','From','TransferReport','Start','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','MessageId','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','stack','name','isNil','find','rows','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','query','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','findAll','INTERACTION'];(function(_0x3ac9b0,_0x474ac5){var _0x366321=function(_0x9883d){while(--_0x9883d){_0x3ac9b0['push'](_0x3ac9b0['shift']());}};_0x366321(++_0x474ac5);}(_0xa32c,0xa6));var _0xca32=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa32c[_0x397e5f];return _0x5302b8;};'use strict';var BPromise=require(_0xca32('0x0'));var moment=require(_0xca32('0x1'));var _=require(_0xca32('0x2'));var util=require(_0xca32('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xca32('0x4'))(_0xca32('0x5'));var jayson=require(_0xca32('0x6'));var amiClient=jayson[_0xca32('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xca32('0x7')][_0xca32('0x8')]({'port':0x232b});var routingClient=jayson['client'][_0xca32('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x4d47d1,_0x28a348,_0x280aee){return new BPromise(function(_0x2cbccd,_0x4f8124){var _0x1a4832=_0x280aee?_0x280aee:amiClient;return _0x1a4832[_0xca32('0x9')](_0x4d47d1,_0x28a348)[_0xca32('0xa')](function(_0x4ffa11){if(_0x4ffa11['error']){if(_0x4ffa11[_0xca32('0xb')]['code']===0x1f4){return _0x4f8124(_0x4ffa11[_0xca32('0xb')][_0xca32('0xc')]);}return _0x2cbccd(_0x4ffa11[_0xca32('0xb')]['message']);}else{_0x2cbccd(_0x4ffa11[_0xca32('0xd')]);}})[_0xca32('0xe')](function(_0x2db4ac){_0x4f8124(_0x2db4ac);});});}function respondWithResult(_0x2267cf,_0x1ae0e6){_0x1ae0e6=_0x1ae0e6||0xc8;return function(_0x22fd87){if(_0x22fd87){return _0x2267cf[_0xca32('0xf')](_0x1ae0e6)[_0xca32('0x10')](_0x22fd87);}return _0x2267cf[_0xca32('0x11')](0x194);};}function handleError(_0x6a78e9,_0x306c3d){_0x306c3d=_0x306c3d||0x1f4;return function(_0xf0542){logger[_0xca32('0xb')](_0xf0542[_0xca32('0x12')]);if(_0xf0542[_0xca32('0x13')]){delete _0xf0542[_0xca32('0x13')];}_0x6a78e9[_0xca32('0xf')](_0x306c3d)['send'](_0xf0542);};}function findById(_0x5ac7bf){return function(_0x4f3dbe){if(!_[_0xca32('0x14')](_0x5ac7bf)&&!_[_0xca32('0x14')](_0x4f3dbe)&&!_[_0xca32('0x14')](_0x4f3dbe['rows'])){return _[_0xca32('0x15')](_0x4f3dbe[_0xca32('0x16')],function(_0x2cd289){return _0x2cd289['id']==_0x5ac7bf;});}return null;};}exports['voiceChannels']=function(_0x56014c,_0x2dd2a2){return respondWithRpcPromise('VoiceChannels',_0x56014c['query'])[_0xca32('0xa')](respondWithResult(_0x2dd2a2,null))[_0xca32('0xe')](handleError(_0x2dd2a2,null));};exports[_0xca32('0x17')]=function(_0x4b726f,_0x21c649){return respondWithRpcPromise(_0xca32('0x18'),_['merge'](_0x4b726f['query'],_0x4b726f[_0xca32('0x19')]))[_0xca32('0xa')](respondWithResult(_0x21c649,null))['catch'](handleError(_0x21c649,null));};exports['voiceChannelStopMixMonitor']=function(_0x4d4629,_0x3e521d){return respondWithRpcPromise(_0xca32('0x1a'),_[_0xca32('0x1b')](_0x4d4629[_0xca32('0x1c')],_0x4d4629[_0xca32('0x19')]))[_0xca32('0xa')](respondWithResult(_0x3e521d,null))[_0xca32('0xe')](handleError(_0x3e521d,null));};exports[_0xca32('0x1d')]=function(_0x31373e,_0x1ccbef){return respondWithRpcPromise(_0xca32('0x1e'),_0x31373e[_0xca32('0x1c')])[_0xca32('0xa')](respondWithResult(_0x1ccbef,null))[_0xca32('0xe')](handleError(_0x1ccbef,null));};exports['showVoiceQueues']=function(_0xf944de,_0x4dad01){return respondWithRpcPromise(_0xca32('0x1e'),_0xf944de[_0xca32('0x1c')])['then'](findById(_0xf944de[_0xca32('0x19')]['id']))[_0xca32('0xa')](respondWithResult(_0x4dad01,null))[_0xca32('0xe')](handleError(_0x4dad01,null));};exports[_0xca32('0x1f')]=function(_0x4aac38,_0x3ffb75){return respondWithRpcPromise(_0xca32('0x20'),_[_0xca32('0x1b')](_0x4aac38[_0xca32('0x1c')],_0x4aac38[_0xca32('0x19')]))['then'](respondWithResult(_0x3ffb75,null))['catch'](handleError(_0x3ffb75,null));};exports[_0xca32('0x21')]=function(_0x1095ba,_0x587e29){return respondWithRpcPromise(_0xca32('0x22'),_0x1095ba[_0xca32('0x1c')])[_0xca32('0xa')](respondWithResult(_0x587e29,null))[_0xca32('0xe')](handleError(_0x587e29,null));};exports[_0xca32('0x23')]=function(_0x299f46,_0x459c97){return respondWithRpcPromise(_0xca32('0x24'),_[_0xca32('0x1b')](_0x299f46[_0xca32('0x1c')],_0x299f46['params']))[_0xca32('0xa')](respondWithResult(_0x459c97,null))[_0xca32('0xe')](handleError(_0x459c97,null));};exports[_0xca32('0x25')]=function(_0xc018e0,_0x4401ef){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xca32('0x1b')](_0xc018e0[_0xca32('0x1c')],_0xc018e0[_0xca32('0x19')]))[_0xca32('0xa')](respondWithResult(_0x4401ef,null))[_0xca32('0xe')](handleError(_0x4401ef,null));};exports['voiceQueuesChannelRedirect']=function(_0x2ef597,_0x4e8207){return respondWithRpcPromise(_0xca32('0x26'),_[_0xca32('0x1b')](_0x2ef597[_0xca32('0x1c')],_0x2ef597[_0xca32('0x19')]))[_0xca32('0xa')](respondWithResult(_0x4e8207,null))[_0xca32('0xe')](handleError(_0x4e8207,null));};exports[_0xca32('0x27')]=function(_0x1b6a1d,_0x193143){return respondWithRpcPromise(_0xca32('0x28'),_0x1b6a1d[_0xca32('0x1c')])[_0xca32('0xa')](respondWithResult(_0x193143,null))[_0xca32('0xe')](handleError(_0x193143,null));};exports[_0xca32('0x29')]=function(_0x4617cd,_0x292215){return respondWithRpcPromise(_0xca32('0x2a'),_0x4617cd['query'])[_0xca32('0xa')](respondWithResult(_0x292215,null))[_0xca32('0xe')](handleError(_0x292215,null));};exports[_0xca32('0x2b')]=function(_0xad67e8,_0x6145bd){var _0x52caf1;return respondWithRpcPromise(_0xca32('0x2c'),_0xad67e8[_0xca32('0x1c')])[_0xca32('0xa')](function(_0x8fb1f1){_0x52caf1=_0x8fb1f1;return respondWithRpcPromise(_0xca32('0x2c'),_0xad67e8[_0xca32('0x1c')],routingClient);})[_0xca32('0xa')](function(_0x3861a0){return _[_0xca32('0x1b')]({},_0x3861a0,_0x52caf1);})[_0xca32('0xa')](respondWithResult(_0x6145bd,null))[_0xca32('0xe')](handleError(_0x6145bd,null));};exports[_0xca32('0x2d')]=function(_0xef8740,_0x558def){if(_0xef8740[_0xca32('0x2e')]&&_0xef8740[_0xca32('0x2e')]['interaction']&&_0xef8740[_0xca32('0x2f')]&&_0xef8740['user'][_0xca32('0x13')]){for(var _0x455d72 in _0xef8740[_0xca32('0x2e')][_0xca32('0x30')]){if(_0xef8740['body']['interaction'][_0xca32('0x31')](_0x455d72)){db['MemberReport'][_0xca32('0x32')]({'where':{'channel':_0x455d72,'membername':_0xef8740[_0xca32('0x2f')][_0xca32('0x13')],'type':_0xca32('0x33'),'exitAt':null,'uniqueid':_0xef8740[_0xca32('0x2e')]['interaction'][_0x455d72]&&_0xef8740[_0xca32('0x2e')][_0xca32('0x30')][_0x455d72]['length']?{'$notIn':_0xef8740[_0xca32('0x2e')][_0xca32('0x30')][_0x455d72]}:{'$ne':null}}})[_0xca32('0xa')](function(_0x54f235){var _0x4ad7f5=moment()[_0xca32('0x34')](_0xca32('0x35'));for(var _0x21e3b4=0x0,_0x16031d=_0x54f235[_0xca32('0x36')];_0x21e3b4<_0x16031d;_0x21e3b4+=0x1){_0x54f235[_0x21e3b4][_0xca32('0x37')]({'exitAt':_0x4ad7f5});}});for(var _0xef9c17=0x0;_0xef9c17<_0xef8740[_0xca32('0x2e')][_0xca32('0x30')][_0x455d72][_0xca32('0x36')];_0xef9c17+=0x1){db[_0xca32('0x38')][_0xca32('0x39')]({'where':{'channel':_0x455d72,'membername':_0xef8740[_0xca32('0x2f')]['name'],'type':_0xca32('0x33'),'uniqueid':_0xef8740[_0xca32('0x2e')][_0xca32('0x30')][_0x455d72][_0xef9c17],'exitAt':null},'defaults':{'channel':_0x455d72,'membername':_0xef8740[_0xca32('0x2f')][_0xca32('0x13')],'interface':_[_0xca32('0x14')](_0xef8740[_0xca32('0x2f')][_0xca32('0x3a')])?util[_0xca32('0x34')](_0xca32('0x3b'),_0xef8740[_0xca32('0x2f')][_0xca32('0x13')]):_0xef8740[_0xca32('0x2f')][_0xca32('0x3a')],'type':'INTERACTION','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xca32('0x3c'),'internal':_0xef8740['user'][_0xca32('0x3d')],'uniqueid':_0xef8740[_0xca32('0x2e')][_0xca32('0x30')][_0x455d72][_0xef9c17]}});}}}}return respondWithRpcPromise(_0xca32('0x3e'),{'id':_0xef8740['params']['id'],'capacity':_0xef8740[_0xca32('0x2e')][_0xca32('0x3f')]},routingClient)['then'](respondWithResult(_0x558def,null))['catch'](handleError(_0x558def,null));};exports['telephones']=function(_0x26c66b,_0x537252){return respondWithRpcPromise(_0xca32('0x40'),_0x26c66b[_0xca32('0x1c')])[_0xca32('0xa')](respondWithResult(_0x537252,null))[_0xca32('0xe')](handleError(_0x537252,null));};exports['trunks']=function(_0x844ab9,_0x5b1d4a){return respondWithRpcPromise(_0xca32('0x41'),_0x844ab9[_0xca32('0x1c')])[_0xca32('0xa')](respondWithResult(_0x5b1d4a,null))[_0xca32('0xe')](handleError(_0x5b1d4a,null));};exports[_0xca32('0x42')]=function(_0xeced9b,_0x34b3c7){return respondWithRpcPromise(_0xca32('0x43'),_0xeced9b[_0xca32('0x1c')])[_0xca32('0xa')](respondWithResult(_0x34b3c7,null))['catch'](handleError(_0x34b3c7,null));};exports[_0xca32('0x44')]=function(_0x320704,_0x1017f8){return respondWithRpcPromise('ChatQueues',_0x320704[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](respondWithResult(_0x1017f8,null))[_0xca32('0xe')](handleError(_0x1017f8,null));};exports[_0xca32('0x45')]=function(_0x2be1c7,_0xbd75a2){return respondWithRpcPromise(_0xca32('0x46'),_0x2be1c7[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](findById(_0x2be1c7[_0xca32('0x19')]['id']))[_0xca32('0xa')](respondWithResult(_0xbd75a2,null))['catch'](handleError(_0xbd75a2,null));};exports[_0xca32('0x47')]=function(_0x49ff47,_0x1c580c){return respondWithRpcPromise(_0xca32('0x48'),_0x49ff47['query'],routingClient)[_0xca32('0xa')](respondWithResult(_0x1c580c,null))[_0xca32('0xe')](handleError(_0x1c580c,null));};exports[_0xca32('0x49')]=function(_0x341a18,_0x473b2a){return respondWithRpcPromise('MailQueues',_0x341a18['query'],routingClient)[_0xca32('0xa')](findById(_0x341a18['params']['id']))[_0xca32('0xa')](respondWithResult(_0x473b2a,null))['catch'](handleError(_0x473b2a,null));};exports[_0xca32('0x4a')]=function(_0x4cf11a,_0x18db89){return respondWithRpcPromise('MailAccounts',_0x4cf11a[_0xca32('0x1c')],mailClient)['then'](respondWithResult(_0x18db89,null))[_0xca32('0xe')](handleError(_0x18db89,null));};exports[_0xca32('0x4b')]=function(_0x4902c5,_0x5c1bbd){return respondWithRpcPromise(_0xca32('0x4c'),_0x4902c5[_0xca32('0x1c')],routingClient)['then'](respondWithResult(_0x5c1bbd,null))[_0xca32('0xe')](handleError(_0x5c1bbd,null));};exports[_0xca32('0x4d')]=function(_0x5642ee,_0x197911){return respondWithRpcPromise(_0xca32('0x4c'),_0x5642ee['query'],routingClient)[_0xca32('0xa')](findById(_0x5642ee[_0xca32('0x19')]['id']))[_0xca32('0xa')](respondWithResult(_0x197911,null))[_0xca32('0xe')](handleError(_0x197911,null));};exports['smsQueues']=function(_0x217d93,_0x16ede7){return respondWithRpcPromise(_0xca32('0x4e'),_0x217d93['query'],routingClient)['then'](respondWithResult(_0x16ede7,null))[_0xca32('0xe')](handleError(_0x16ede7,null));};exports[_0xca32('0x4f')]=function(_0x313697,_0x59a1dd){return respondWithRpcPromise(_0xca32('0x4e'),_0x313697[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](findById(_0x313697[_0xca32('0x19')]['id']))[_0xca32('0xa')](respondWithResult(_0x59a1dd,null))['catch'](handleError(_0x59a1dd,null));};exports['faxQueues']=function(_0x1ac840,_0x164cb8){return respondWithRpcPromise('FaxQueues',_0x1ac840['query'],routingClient)[_0xca32('0xa')](respondWithResult(_0x164cb8,null))[_0xca32('0xe')](handleError(_0x164cb8,null));};exports['showFaxQueues']=function(_0x1a21ae,_0xf0103a){return respondWithRpcPromise(_0xca32('0x50'),_0x1a21ae[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](findById(_0x1a21ae[_0xca32('0x19')]['id']))[_0xca32('0xa')](respondWithResult(_0xf0103a,null))[_0xca32('0xe')](handleError(_0xf0103a,null));};exports['faxAccounts']=function(_0x59ad93,_0x3fd363){return respondWithRpcPromise(_0xca32('0x51'),_0x59ad93[_0xca32('0x1c')])[_0xca32('0xa')](respondWithResult(_0x3fd363,null))['catch'](handleError(_0x3fd363,null));};exports['chatQueuesWaitingInteractions']=function(_0x54fb3a,_0x2bc4ec){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x54fb3a[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](respondWithResult(_0x2bc4ec,null))[_0xca32('0xe')](handleError(_0x2bc4ec,null));};exports[_0xca32('0x52')]=function(_0xaf5a4a,_0x59f8a7){return respondWithRpcPromise(_0xca32('0x53'),_0xaf5a4a[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](respondWithResult(_0x59f8a7,null))[_0xca32('0xe')](handleError(_0x59f8a7,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x196ed7,_0x28c18c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x196ed7[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](respondWithResult(_0x28c18c,null))['catch'](handleError(_0x28c18c,null));};exports[_0xca32('0x54')]=function(_0x4fca9e,_0xaa1da){return respondWithRpcPromise(_0xca32('0x55'),_0x4fca9e['query'],routingClient)[_0xca32('0xa')](respondWithResult(_0xaa1da,null))[_0xca32('0xe')](handleError(_0xaa1da,null));};exports['faxQueuesWaitingInteractions']=function(_0xf69878,_0x4511d5){return respondWithRpcPromise(_0xca32('0x56'),_0xf69878[_0xca32('0x1c')],routingClient)[_0xca32('0xa')](respondWithResult(_0x4511d5,null))[_0xca32('0xe')](handleError(_0x4511d5,null));};exports[_0xca32('0x57')]=function(_0x41e14d){return function(_0x2a28d2,_0x235242){var _0x519b8d,_0x9fbb32;var _0x1e213e=_['capitalize'](_0x41e14d);var _0x3f6772=_0x41e14d===_0xca32('0x58')?'Website':'Account';return db[_0x1e213e+'Queue'][_0xca32('0x59')]({'raw':!![],'where':{'id':_0x2a28d2[_0xca32('0x19')]['id']}})['then'](function(_0x33c8e3){if(_[_0xca32('0x14')](_0x33c8e3)){throw new Error(_0x1e213e+_0xca32('0x5a'));}_0x519b8d=_0x33c8e3;return db[_0x1e213e+_0xca32('0x5b')][_0xca32('0x59')]({'where':{'id':_0x2a28d2[_0xca32('0x2e')][_0xca32('0x5c')]},'include':[{'model':db[_0x1e213e+_0xca32('0x5d')],'as':_0xca32('0x5d')},{'model':db[_0x1e213e+_0x3f6772],'as':_0xca32('0x5e')}]});})[_0xca32('0xa')](function(_0x532966){if(_[_0xca32('0x14')](_0x532966)){throw new Error(_0x1e213e+_0xca32('0x5f'));}_0x9fbb32=_0x532966;return _0x532966['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x53951f={'uniqueid':_0x41e14d+'.'+_0x9fbb32['id']+'.'+_0x9fbb32['Interaction']['id'],'FromUserId':_0x2a28d2[_0xca32('0x2f')]['id'],'type':_0xca32('0x60')};_0x53951f[_0x1e213e+'MessageId']=_0x9fbb32['id'];_0x53951f[_0x1e213e+_0xca32('0x61')]=_0x9fbb32['Interaction']['id'];_0x53951f[_0xca32('0x62')+_0x1e213e+_0x3f6772+'Id']=_0x9fbb32[_0xca32('0x5e')]['id'];_0x53951f['To'+_0x1e213e+'QueueId']=_0x519b8d['id'];return db[_0x1e213e+_0xca32('0x63')]['create'](_0x53951f);})[_0xca32('0xa')](function(){return respondWithRpcPromise(_0xca32('0x64'),{'channel':_0x41e14d,'interaction':_0x9fbb32['Interaction'],'message':_0x9fbb32,'account':_0x9fbb32[_0xca32('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0xca32('0x60'),'appdata':_0x519b8d[_0xca32('0x13')]+','+(_0x9fbb32[_0xca32('0x5e')][_0xca32('0x65')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x235242,null))['catch'](handleError(_0x235242,null));};};exports[_0xca32('0x66')]=function(_0x7cd558,_0x350b80){var _0x13b536,_0x472408;if(_[_0xca32('0x14')](_0x7cd558[_0xca32('0x2e')]['channel'])){throw new Error(_0xca32('0x67'));}var _0x2fbb5f=_0x7cd558['body']['channel'];var _0x1c7ae4=_[_0xca32('0x68')](_0x2fbb5f);var _0x566ed6=_0x2fbb5f===_0xca32('0x58')?'Website':_0xca32('0x5e');return db[_0xca32('0x69')][_0xca32('0x59')]({'raw':!![],'where':{'id':_0x7cd558[_0xca32('0x19')]['id'],'role':_0xca32('0x3c')}})['then'](function(_0x155914){if(_['isNil'](_0x155914)){throw new Error(_0xca32('0x6a'));}_0x13b536=_0x155914;return db[_0x1c7ae4+'Message'][_0xca32('0x59')]({'where':{'id':_0x7cd558[_0xca32('0x2e')]['messageId']},'include':[{'model':db[_0x1c7ae4+'Interaction'],'as':'Interaction'},{'model':db[_0x1c7ae4+_0x566ed6],'as':'Account'}]});})[_0xca32('0xa')](function(_0xd2bc9b){if(_['isNil'](_0xd2bc9b)){throw new Error(_0x1c7ae4+_0xca32('0x5f'));}_0x472408=_0xd2bc9b;return _0xd2bc9b['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xca32('0xa')](function(){var _0x2eadc3={'uniqueid':_0x2fbb5f+'.'+_0x472408['id']+'.'+_0x472408[_0xca32('0x5d')]['id'],'FromUserId':_0x7cd558[_0xca32('0x2f')]['id'],'type':_0xca32('0x60'),'ToUserId':_0x13b536['id']};_0x2eadc3[_0x1c7ae4+_0xca32('0x6b')]=_0x472408['id'];_0x2eadc3[_0x1c7ae4+_0xca32('0x61')]=_0x472408[_0xca32('0x5d')]['id'];_0x2eadc3['From'+_0x1c7ae4+_0x566ed6+'Id']=_0x472408[_0xca32('0x5e')]['id'];return db[_0x1c7ae4+_0xca32('0x63')]['create'](_0x2eadc3);})[_0xca32('0xa')](function(){return respondWithRpcPromise(_0xca32('0x64'),{'channel':_0x2fbb5f,'interaction':_0x472408['Interaction'],'message':_0x472408,'account':_0x472408[_0xca32('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0xca32('0x3c'),'appdata':_0x13b536[_0xca32('0x13')]+','+(_0x472408[_0xca32('0x5e')][_0xca32('0x6c')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xca32('0xa')](respondWithResult(_0x350b80,null))['catch'](handleError(_0x350b80,null));}; \ No newline at end of file +var _0xab86=['body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','updateAttributes','findOrCreate','interface','format','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','create','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','TransferReport','agentTransferTimeout','*,*,*,*','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','code','error','message','result','status','json','sendStatus','stack','name','send','isNil','voiceChannels','query','catch','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity'];(function(_0x538976,_0x50df82){var _0x54870f=function(_0x2b1853){while(--_0x2b1853){_0x538976['push'](_0x538976['shift']());}};_0x54870f(++_0x50df82);}(_0xab86,0x134));var _0x6ab8=function(_0xce5f67,_0x505608){_0xce5f67=_0xce5f67-0x0;var _0x59e21e=_0xab86[_0xce5f67];return _0x59e21e;};'use strict';var BPromise=require('bluebird');var moment=require(_0x6ab8('0x0'));var _=require(_0x6ab8('0x1'));var util=require(_0x6ab8('0x2'));var db=require(_0x6ab8('0x3'))['db'];var logger=require(_0x6ab8('0x4'))(_0x6ab8('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x6ab8('0x6')][_0x6ab8('0x7')]({'port':0x232a});var mailClient=jayson[_0x6ab8('0x6')][_0x6ab8('0x7')]({'port':0x232b});var routingClient=jayson[_0x6ab8('0x6')][_0x6ab8('0x7')]({'port':0x232c});function respondWithRpcPromise(_0xa33499,_0x3d39ca,_0x3b2dd0){return new BPromise(function(_0x17b451,_0x3fc446){var _0x2f0ec4=_0x3b2dd0?_0x3b2dd0:amiClient;return _0x2f0ec4[_0x6ab8('0x8')](_0xa33499,_0x3d39ca)[_0x6ab8('0x9')](function(_0x3b08b5){if(_0x3b08b5['error']){if(_0x3b08b5['error'][_0x6ab8('0xa')]===0x1f4){return _0x3fc446(_0x3b08b5[_0x6ab8('0xb')][_0x6ab8('0xc')]);}return _0x17b451(_0x3b08b5[_0x6ab8('0xb')]['message']);}else{_0x17b451(_0x3b08b5[_0x6ab8('0xd')]);}})['catch'](function(_0x5dd228){_0x3fc446(_0x5dd228);});});}function respondWithResult(_0x2ddf1e,_0x58a19b){_0x58a19b=_0x58a19b||0xc8;return function(_0xad61fe){if(_0xad61fe){return _0x2ddf1e[_0x6ab8('0xe')](_0x58a19b)[_0x6ab8('0xf')](_0xad61fe);}return _0x2ddf1e[_0x6ab8('0x10')](0x194);};}function handleError(_0x2a0577,_0x1d2540){_0x1d2540=_0x1d2540||0x1f4;return function(_0x486879){logger[_0x6ab8('0xb')](_0x486879[_0x6ab8('0x11')]);if(_0x486879[_0x6ab8('0x12')]){delete _0x486879[_0x6ab8('0x12')];}_0x2a0577[_0x6ab8('0xe')](_0x1d2540)[_0x6ab8('0x13')](_0x486879);};}function findById(_0x2cf78d){return function(_0x4e04f5){if(!_[_0x6ab8('0x14')](_0x2cf78d)&&!_[_0x6ab8('0x14')](_0x4e04f5)&&!_[_0x6ab8('0x14')](_0x4e04f5['rows'])){return _['find'](_0x4e04f5['rows'],function(_0x4fe5bb){return _0x4fe5bb['id']==_0x2cf78d;});}return null;};}exports[_0x6ab8('0x15')]=function(_0x4c562e,_0x134b17){return respondWithRpcPromise('VoiceChannels',_0x4c562e[_0x6ab8('0x16')])['then'](respondWithResult(_0x134b17,null))[_0x6ab8('0x17')](handleError(_0x134b17,null));};exports['voiceChannelMixMonitor']=function(_0x24daa0,_0x437a67){return respondWithRpcPromise(_0x6ab8('0x18'),_[_0x6ab8('0x19')](_0x24daa0[_0x6ab8('0x16')],_0x24daa0[_0x6ab8('0x1a')]))[_0x6ab8('0x9')](respondWithResult(_0x437a67,null))[_0x6ab8('0x17')](handleError(_0x437a67,null));};exports[_0x6ab8('0x1b')]=function(_0x13a9d5,_0x14a775){return respondWithRpcPromise(_0x6ab8('0x1c'),_[_0x6ab8('0x19')](_0x13a9d5[_0x6ab8('0x16')],_0x13a9d5[_0x6ab8('0x1a')]))[_0x6ab8('0x9')](respondWithResult(_0x14a775,null))[_0x6ab8('0x17')](handleError(_0x14a775,null));};exports[_0x6ab8('0x1d')]=function(_0x4e532e,_0x316252){return respondWithRpcPromise(_0x6ab8('0x1e'),_0x4e532e[_0x6ab8('0x16')])['then'](respondWithResult(_0x316252,null))[_0x6ab8('0x17')](handleError(_0x316252,null));};exports['showVoiceQueues']=function(_0x33f830,_0x19816b){return respondWithRpcPromise('VoiceQueues',_0x33f830[_0x6ab8('0x16')])[_0x6ab8('0x9')](findById(_0x33f830[_0x6ab8('0x1a')]['id']))[_0x6ab8('0x9')](respondWithResult(_0x19816b,null))[_0x6ab8('0x17')](handleError(_0x19816b,null));};exports[_0x6ab8('0x1f')]=function(_0xd0f767,_0x477a7e){return respondWithRpcPromise(_0x6ab8('0x20'),_['merge'](_0xd0f767[_0x6ab8('0x16')],_0xd0f767[_0x6ab8('0x1a')]))[_0x6ab8('0x9')](respondWithResult(_0x477a7e,null))[_0x6ab8('0x17')](handleError(_0x477a7e,null));};exports[_0x6ab8('0x21')]=function(_0x74f085,_0x3be4e4){return respondWithRpcPromise(_0x6ab8('0x22'),_0x74f085['query'])[_0x6ab8('0x9')](respondWithResult(_0x3be4e4,null))[_0x6ab8('0x17')](handleError(_0x3be4e4,null));};exports[_0x6ab8('0x23')]=function(_0x56712a,_0x32c3a6){return respondWithRpcPromise(_0x6ab8('0x24'),_[_0x6ab8('0x19')](_0x56712a['query'],_0x56712a[_0x6ab8('0x1a')]))['then'](respondWithResult(_0x32c3a6,null))['catch'](handleError(_0x32c3a6,null));};exports['voiceQueuesChannelHangup']=function(_0x15bc80,_0x5cdc06){return respondWithRpcPromise(_0x6ab8('0x25'),_[_0x6ab8('0x19')](_0x15bc80[_0x6ab8('0x16')],_0x15bc80[_0x6ab8('0x1a')]))[_0x6ab8('0x9')](respondWithResult(_0x5cdc06,null))['catch'](handleError(_0x5cdc06,null));};exports[_0x6ab8('0x26')]=function(_0x411a31,_0xf5091){return respondWithRpcPromise(_0x6ab8('0x27'),_['merge'](_0x411a31[_0x6ab8('0x16')],_0x411a31['params']))[_0x6ab8('0x9')](respondWithResult(_0xf5091,null))[_0x6ab8('0x17')](handleError(_0xf5091,null));};exports[_0x6ab8('0x28')]=function(_0x39db6b,_0x75dfd5){return respondWithRpcPromise(_0x6ab8('0x29'),_0x39db6b['query'])['then'](respondWithResult(_0x75dfd5,null))[_0x6ab8('0x17')](handleError(_0x75dfd5,null));};exports[_0x6ab8('0x2a')]=function(_0x419cc7,_0x5b2aa5){return respondWithRpcPromise('OutboundChannels',_0x419cc7['query'])[_0x6ab8('0x9')](respondWithResult(_0x5b2aa5,null))[_0x6ab8('0x17')](handleError(_0x5b2aa5,null));};exports[_0x6ab8('0x2b')]=function(_0x194641,_0x1eea8a){var _0x440ae5;return respondWithRpcPromise('Agents',_0x194641[_0x6ab8('0x16')])['then'](function(_0x411cfa){_0x440ae5=_0x411cfa;return respondWithRpcPromise(_0x6ab8('0x2c'),_0x194641[_0x6ab8('0x16')],routingClient);})[_0x6ab8('0x9')](function(_0x5c5cf4){return _[_0x6ab8('0x19')]({},_0x5c5cf4,_0x440ae5);})[_0x6ab8('0x9')](respondWithResult(_0x1eea8a,null))['catch'](handleError(_0x1eea8a,null));};exports[_0x6ab8('0x2d')]=function(_0x5206bd,_0x3ddf06){if(_0x5206bd[_0x6ab8('0x2e')]&&_0x5206bd['body'][_0x6ab8('0x2f')]&&_0x5206bd[_0x6ab8('0x30')]&&_0x5206bd['user'][_0x6ab8('0x12')]){for(var _0x19062f in _0x5206bd[_0x6ab8('0x2e')][_0x6ab8('0x2f')]){if(_0x5206bd['body'][_0x6ab8('0x2f')][_0x6ab8('0x31')](_0x19062f)){db[_0x6ab8('0x32')][_0x6ab8('0x33')]({'where':{'channel':_0x19062f,'membername':_0x5206bd[_0x6ab8('0x30')]['name'],'type':_0x6ab8('0x34'),'exitAt':null,'uniqueid':_0x5206bd['body'][_0x6ab8('0x2f')][_0x19062f]&&_0x5206bd['body'][_0x6ab8('0x2f')][_0x19062f][_0x6ab8('0x35')]?{'$notIn':_0x5206bd['body']['interaction'][_0x19062f]}:{'$ne':null}}})['then'](function(_0x1285ae){var _0x2ce4a7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2ee0bf=0x0,_0xe291b7=_0x1285ae[_0x6ab8('0x35')];_0x2ee0bf<_0xe291b7;_0x2ee0bf+=0x1){_0x1285ae[_0x2ee0bf][_0x6ab8('0x36')]({'exitAt':_0x2ce4a7});}});for(var _0x54e9f7=0x0;_0x54e9f7<_0x5206bd[_0x6ab8('0x2e')][_0x6ab8('0x2f')][_0x19062f][_0x6ab8('0x35')];_0x54e9f7+=0x1){db[_0x6ab8('0x32')][_0x6ab8('0x37')]({'where':{'channel':_0x19062f,'membername':_0x5206bd[_0x6ab8('0x30')][_0x6ab8('0x12')],'type':_0x6ab8('0x34'),'uniqueid':_0x5206bd['body'][_0x6ab8('0x2f')][_0x19062f][_0x54e9f7],'exitAt':null},'defaults':{'channel':_0x19062f,'membername':_0x5206bd[_0x6ab8('0x30')][_0x6ab8('0x12')],'interface':_[_0x6ab8('0x14')](_0x5206bd[_0x6ab8('0x30')][_0x6ab8('0x38')])?util[_0x6ab8('0x39')](_0x6ab8('0x3a'),_0x5206bd[_0x6ab8('0x30')]['name']):_0x5206bd[_0x6ab8('0x30')]['interface'],'type':_0x6ab8('0x34'),'enterAt':moment()['format'](_0x6ab8('0x3b')),'role':_0x6ab8('0x3c'),'internal':_0x5206bd['user'][_0x6ab8('0x3d')],'uniqueid':_0x5206bd[_0x6ab8('0x2e')][_0x6ab8('0x2f')][_0x19062f][_0x54e9f7]}});}}}}return respondWithRpcPromise(_0x6ab8('0x3e'),{'id':_0x5206bd['params']['id'],'capacity':_0x5206bd[_0x6ab8('0x2e')][_0x6ab8('0x3f')]},routingClient)['then'](respondWithResult(_0x3ddf06,null))[_0x6ab8('0x17')](handleError(_0x3ddf06,null));};exports['telephones']=function(_0x540bca,_0x4cce15){return respondWithRpcPromise('Telephones',_0x540bca[_0x6ab8('0x16')])[_0x6ab8('0x9')](respondWithResult(_0x4cce15,null))[_0x6ab8('0x17')](handleError(_0x4cce15,null));};exports[_0x6ab8('0x40')]=function(_0x36c098,_0xb2a04b){return respondWithRpcPromise(_0x6ab8('0x41'),_0x36c098['query'])['then'](respondWithResult(_0xb2a04b,null))['catch'](handleError(_0xb2a04b,null));};exports[_0x6ab8('0x42')]=function(_0x398835,_0x485ad2){return respondWithRpcPromise(_0x6ab8('0x43'),_0x398835[_0x6ab8('0x16')])['then'](respondWithResult(_0x485ad2,null))['catch'](handleError(_0x485ad2,null));};exports[_0x6ab8('0x44')]=function(_0x6b0516,_0x1f87ba){return respondWithRpcPromise('ChatQueues',_0x6b0516[_0x6ab8('0x16')],routingClient)['then'](respondWithResult(_0x1f87ba,null))[_0x6ab8('0x17')](handleError(_0x1f87ba,null));};exports[_0x6ab8('0x45')]=function(_0x58ee5f,_0x4ad12f){return respondWithRpcPromise('ChatQueues',_0x58ee5f['query'],routingClient)[_0x6ab8('0x9')](findById(_0x58ee5f['params']['id']))[_0x6ab8('0x9')](respondWithResult(_0x4ad12f,null))[_0x6ab8('0x17')](handleError(_0x4ad12f,null));};exports[_0x6ab8('0x46')]=function(_0x2b7ed5,_0x2166f8){return respondWithRpcPromise(_0x6ab8('0x47'),_0x2b7ed5[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](respondWithResult(_0x2166f8,null))[_0x6ab8('0x17')](handleError(_0x2166f8,null));};exports[_0x6ab8('0x48')]=function(_0x4e7670,_0x2c8abc){return respondWithRpcPromise(_0x6ab8('0x47'),_0x4e7670[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](findById(_0x4e7670[_0x6ab8('0x1a')]['id']))[_0x6ab8('0x9')](respondWithResult(_0x2c8abc,null))[_0x6ab8('0x17')](handleError(_0x2c8abc,null));};exports[_0x6ab8('0x49')]=function(_0x25191e,_0x183704){return respondWithRpcPromise(_0x6ab8('0x4a'),_0x25191e['query'],mailClient)[_0x6ab8('0x9')](respondWithResult(_0x183704,null))['catch'](handleError(_0x183704,null));};exports[_0x6ab8('0x4b')]=function(_0x419b0a,_0x18ade3){return respondWithRpcPromise('OpenchannelQueues',_0x419b0a[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](respondWithResult(_0x18ade3,null))[_0x6ab8('0x17')](handleError(_0x18ade3,null));};exports[_0x6ab8('0x4c')]=function(_0x12c565,_0x172398){return respondWithRpcPromise(_0x6ab8('0x4d'),_0x12c565[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](findById(_0x12c565['params']['id']))[_0x6ab8('0x9')](respondWithResult(_0x172398,null))[_0x6ab8('0x17')](handleError(_0x172398,null));};exports['smsQueues']=function(_0x33df7e,_0x41a2e1){return respondWithRpcPromise(_0x6ab8('0x4e'),_0x33df7e[_0x6ab8('0x16')],routingClient)['then'](respondWithResult(_0x41a2e1,null))[_0x6ab8('0x17')](handleError(_0x41a2e1,null));};exports[_0x6ab8('0x4f')]=function(_0x34806b,_0x2372b8){return respondWithRpcPromise(_0x6ab8('0x4e'),_0x34806b['query'],routingClient)['then'](findById(_0x34806b[_0x6ab8('0x1a')]['id']))[_0x6ab8('0x9')](respondWithResult(_0x2372b8,null))[_0x6ab8('0x17')](handleError(_0x2372b8,null));};exports['faxQueues']=function(_0x43aaa5,_0x1727a7){return respondWithRpcPromise(_0x6ab8('0x50'),_0x43aaa5['query'],routingClient)[_0x6ab8('0x9')](respondWithResult(_0x1727a7,null))[_0x6ab8('0x17')](handleError(_0x1727a7,null));};exports[_0x6ab8('0x51')]=function(_0xdfd271,_0xc0a666){return respondWithRpcPromise(_0x6ab8('0x50'),_0xdfd271[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](findById(_0xdfd271['params']['id']))[_0x6ab8('0x9')](respondWithResult(_0xc0a666,null))[_0x6ab8('0x17')](handleError(_0xc0a666,null));};exports[_0x6ab8('0x52')]=function(_0x45355d,_0x4f79f6){return respondWithRpcPromise(_0x6ab8('0x53'),_0x45355d['query'])['then'](respondWithResult(_0x4f79f6,null))[_0x6ab8('0x17')](handleError(_0x4f79f6,null));};exports['chatQueuesWaitingInteractions']=function(_0x3efe7f,_0x533ac2){return respondWithRpcPromise(_0x6ab8('0x54'),_0x3efe7f['query'],routingClient)[_0x6ab8('0x9')](respondWithResult(_0x533ac2,null))['catch'](handleError(_0x533ac2,null));};exports[_0x6ab8('0x55')]=function(_0x51fd33,_0x2474bf){return respondWithRpcPromise(_0x6ab8('0x56'),_0x51fd33[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](respondWithResult(_0x2474bf,null))[_0x6ab8('0x17')](handleError(_0x2474bf,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x10397b,_0x2c3992){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x10397b[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](respondWithResult(_0x2c3992,null))[_0x6ab8('0x17')](handleError(_0x2c3992,null));};exports[_0x6ab8('0x57')]=function(_0x1a35f9,_0x2c1f8c){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1a35f9[_0x6ab8('0x16')],routingClient)['then'](respondWithResult(_0x2c1f8c,null))[_0x6ab8('0x17')](handleError(_0x2c1f8c,null));};exports[_0x6ab8('0x58')]=function(_0x1bee32,_0x490138){return respondWithRpcPromise(_0x6ab8('0x59'),_0x1bee32[_0x6ab8('0x16')],routingClient)[_0x6ab8('0x9')](respondWithResult(_0x490138,null))[_0x6ab8('0x17')](handleError(_0x490138,null));};exports[_0x6ab8('0x5a')]=function(_0x565c5b){return function(_0x30d38c,_0x3155cb){var _0x149c22,_0x393a72;var _0x28fec8=_[_0x6ab8('0x5b')](_0x565c5b);var _0x11ad8a=_0x565c5b===_0x6ab8('0x5c')?_0x6ab8('0x5d'):_0x6ab8('0x5e');return db[_0x28fec8+_0x6ab8('0x5f')][_0x6ab8('0x60')]({'raw':!![],'where':{'id':_0x30d38c[_0x6ab8('0x1a')]['id']}})[_0x6ab8('0x9')](function(_0x5bce29){if(_['isNil'](_0x5bce29)){throw new Error(_0x28fec8+_0x6ab8('0x61'));}_0x149c22=_0x5bce29;return db[_0x28fec8+_0x6ab8('0x62')][_0x6ab8('0x60')]({'where':{'id':_0x30d38c['body'][_0x6ab8('0x63')]},'include':[{'model':db[_0x28fec8+_0x6ab8('0x64')],'as':_0x6ab8('0x64')},{'model':db[_0x28fec8+_0x11ad8a],'as':_0x6ab8('0x5e')}]});})[_0x6ab8('0x9')](function(_0x56eb40){if(_[_0x6ab8('0x14')](_0x56eb40)){throw new Error(_0x28fec8+_0x6ab8('0x65'));}_0x393a72=_0x56eb40;return _0x56eb40[_0x6ab8('0x66')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6ab8('0x9')](function(){var _0x61b4e1={'uniqueid':_0x565c5b+'.'+_0x393a72['id']+'.'+_0x393a72[_0x6ab8('0x64')]['id'],'FromUserId':_0x30d38c[_0x6ab8('0x30')]['id'],'type':_0x6ab8('0x67')};_0x61b4e1[_0x28fec8+_0x6ab8('0x68')]=_0x393a72['id'];_0x61b4e1[_0x28fec8+_0x6ab8('0x69')]=_0x393a72[_0x6ab8('0x64')]['id'];_0x61b4e1[_0x6ab8('0x6a')+_0x28fec8+_0x11ad8a+'Id']=_0x393a72[_0x6ab8('0x5e')]['id'];_0x61b4e1['To'+_0x28fec8+_0x6ab8('0x6b')]=_0x149c22['id'];return db[_0x28fec8+'TransferReport'][_0x6ab8('0x6c')](_0x61b4e1);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x565c5b,'interaction':_0x393a72[_0x6ab8('0x64')],'message':_0x393a72,'account':_0x393a72[_0x6ab8('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6ab8('0x67'),'appdata':_0x149c22[_0x6ab8('0x12')]+','+(_0x393a72[_0x6ab8('0x5e')][_0x6ab8('0x6d')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6ab8('0x9')](respondWithResult(_0x3155cb,null))['catch'](handleError(_0x3155cb,null));};};exports[_0x6ab8('0x6e')]=function(_0x519b6b,_0x2818c7){var _0x4fb9b9,_0x4d0207;if(_['isNil'](_0x519b6b[_0x6ab8('0x2e')][_0x6ab8('0x6f')])){throw new Error(_0x6ab8('0x70'));}var _0x2a6e1a=_0x519b6b[_0x6ab8('0x2e')][_0x6ab8('0x6f')];var _0x533961=_[_0x6ab8('0x5b')](_0x2a6e1a);var _0xf77add=_0x2a6e1a===_0x6ab8('0x5c')?_0x6ab8('0x5d'):_0x6ab8('0x5e');return db[_0x6ab8('0x71')][_0x6ab8('0x60')]({'raw':!![],'where':{'id':_0x519b6b[_0x6ab8('0x1a')]['id'],'role':_0x6ab8('0x3c')}})[_0x6ab8('0x9')](function(_0x4c5012){if(_[_0x6ab8('0x14')](_0x4c5012)){throw new Error(_0x6ab8('0x72'));}_0x4fb9b9=_0x4c5012;return db[_0x533961+'Message']['findOne']({'where':{'id':_0x519b6b[_0x6ab8('0x2e')][_0x6ab8('0x63')]},'include':[{'model':db[_0x533961+'Interaction'],'as':'Interaction'},{'model':db[_0x533961+_0xf77add],'as':_0x6ab8('0x5e')}]});})[_0x6ab8('0x9')](function(_0x12d368){if(_['isNil'](_0x12d368)){throw new Error(_0x533961+_0x6ab8('0x65'));}_0x4d0207=_0x12d368;return _0x12d368['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x6ab8('0x9')](function(){var _0x21f329={'uniqueid':_0x2a6e1a+'.'+_0x4d0207['id']+'.'+_0x4d0207['Interaction']['id'],'FromUserId':_0x519b6b[_0x6ab8('0x30')]['id'],'type':_0x6ab8('0x67'),'ToUserId':_0x4fb9b9['id']};_0x21f329[_0x533961+_0x6ab8('0x68')]=_0x4d0207['id'];_0x21f329[_0x533961+'InteractionId']=_0x4d0207[_0x6ab8('0x64')]['id'];_0x21f329['From'+_0x533961+_0xf77add+'Id']=_0x4d0207['Account']['id'];return db[_0x533961+_0x6ab8('0x73')][_0x6ab8('0x6c')](_0x21f329);})[_0x6ab8('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x2a6e1a,'interaction':_0x4d0207[_0x6ab8('0x64')],'message':_0x4d0207,'account':_0x4d0207[_0x6ab8('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6ab8('0x3c'),'appdata':_0x4fb9b9[_0x6ab8('0x12')]+','+(_0x4d0207['Account'][_0x6ab8('0x74')]||0x12c),'interval':_0x6ab8('0x75')}]},routingClient);})[_0x6ab8('0x9')](respondWithResult(_0x2818c7,null))['catch'](handleError(_0x2818c7,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 16a96e6..0af4d24 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 _0x62d1=['index','/:id','/:id/run','post','create','put','delete','destroy','exports','util','path','Router','../../config/environment','get','isAuthenticated'];(function(_0x356ef6,_0x4f30fc){var _0x2aa413=function(_0x5ed7d2){while(--_0x5ed7d2){_0x356ef6['push'](_0x356ef6['shift']());}};_0x2aa413(++_0x4f30fc);}(_0x62d1,0x90));var _0x162d=function(_0x328fe8,_0x3959b4){_0x328fe8=_0x328fe8-0x0;var _0x28eab1=_0x62d1[_0x328fe8];return _0x28eab1;};'use strict';var multer=require('multer');var util=require(_0x162d('0x0'));var path=require(_0x162d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x162d('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x162d('0x3'));var controller=require('./schedule.controller');router[_0x162d('0x4')]('/',auth[_0x162d('0x5')](),controller[_0x162d('0x6')]);router['get'](_0x162d('0x7'),auth[_0x162d('0x5')](),controller['show']);router[_0x162d('0x4')](_0x162d('0x8'),auth[_0x162d('0x5')](),controller['run']);router[_0x162d('0x9')]('/',auth[_0x162d('0x5')](),controller[_0x162d('0xa')]);router[_0x162d('0xb')]('/:id',auth[_0x162d('0x5')](),controller['update']);router[_0x162d('0xc')]('/:id',auth[_0x162d('0x5')](),controller[_0x162d('0xd')]);module[_0x162d('0xe')]=router; \ No newline at end of file +var _0x0013=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','get','/:id','show','run','put','update','delete'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0x0013,0xb6));var _0x3001=function(_0x5dd2db,_0x28b1f2){_0x5dd2db=_0x5dd2db-0x0;var _0x157a7b=_0x0013[_0x5dd2db];return _0x157a7b;};'use strict';var multer=require(_0x3001('0x0'));var util=require(_0x3001('0x1'));var path=require(_0x3001('0x2'));var timeout=require('connect-timeout');var express=require(_0x3001('0x3'));var router=express['Router']();var auth=require(_0x3001('0x4'));var interaction=require(_0x3001('0x5'));var config=require(_0x3001('0x6'));var controller=require(_0x3001('0x7'));router['get']('/',auth[_0x3001('0x8')](),controller['index']);router[_0x3001('0x9')](_0x3001('0xa'),auth[_0x3001('0x8')](),controller[_0x3001('0xb')]);router[_0x3001('0x9')]('/:id/run',auth[_0x3001('0x8')](),controller[_0x3001('0xc')]);router['post']('/',auth[_0x3001('0x8')](),controller['create']);router[_0x3001('0xd')]('/:id',auth[_0x3001('0x8')](),controller[_0x3001('0xe')]);router[_0x3001('0xf')](_0x3001('0xa'),auth[_0x3001('0x8')](),controller[_0x3001('0x10')]);module[_0x3001('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 86f35b3..080b23b 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 _0xc439=['TEXT','sequelize','exports','STRING','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','BOOLEAN'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0xc439,0xac));var _0x9c43=function(_0xd74ac,_0x1ddd7a){_0xd74ac=_0xd74ac-0x0;var _0x591d71=_0xc439[_0xd74ac];return _0x591d71;};'use strict';var Sequelize=require(_0x9c43('0x0'));module[_0x9c43('0x1')]={'name':{'type':Sequelize[_0x9c43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9c43('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x9c43('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9c43('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9c43('0x5')]('years',_0x9c43('0x6'),_0x9c43('0x7'),_0x9c43('0x8'),_0x9c43('0x9'),_0x9c43('0xa'),_0x9c43('0xb')),'allowNull':![],'defaultValue':_0x9c43('0x9')},'output':{'type':Sequelize[_0x9c43('0x5')](_0x9c43('0xc'),_0x9c43('0xd'),_0x9c43('0xe')),'allowNull':![],'defaultValue':_0x9c43('0xc')},'type':{'type':Sequelize[_0x9c43('0x5')](_0x9c43('0xf'),_0x9c43('0x10')),'allowNull':![],'defaultValue':_0x9c43('0xf')},'sendMail':{'type':Sequelize[_0x9c43('0x11')],'defaultValue':![]},'email':{'type':Sequelize[_0x9c43('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x9c43('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x9c43('0x11')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6f0f=['weeks','days','minutes','pdf','xlsx','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','ENUM','months'];(function(_0x57411a,_0x59328f){var _0xd487ba=function(_0x2fb456){while(--_0x2fb456){_0x57411a['push'](_0x57411a['shift']());}};_0xd487ba(++_0x59328f);}(_0x6f0f,0xaf));var _0xf6f0=function(_0x51e347,_0x1b565a){_0x51e347=_0x51e347-0x0;var _0x49ab46=_0x6f0f[_0x51e347];return _0x49ab46;};'use strict';var Sequelize=require(_0xf6f0('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6f0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf6f0('0x1')]},'active':{'type':Sequelize[_0xf6f0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf6f0('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xf6f0('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf6f0('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf6f0('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf6f0('0x5')]('years','quarters',_0xf6f0('0x6'),_0xf6f0('0x7'),_0xf6f0('0x8'),'hours',_0xf6f0('0x9')),'allowNull':![],'defaultValue':_0xf6f0('0x8')},'output':{'type':Sequelize[_0xf6f0('0x5')]('csv',_0xf6f0('0xa'),_0xf6f0('0xb')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xf6f0('0x5')](_0xf6f0('0xc'),'default'),'allowNull':![],'defaultValue':_0xf6f0('0xc')},'sendMail':{'type':Sequelize[_0xf6f0('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf6f0('0xd')]},'bcc':{'type':Sequelize[_0xf6f0('0xd')]},'sendIfEmpty':{'type':Sequelize[_0xf6f0('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 14f35eb..5765c51 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 _0xbaa7=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Schedule','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','rows','show','params','length','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Scheduler','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x3c6f21,_0x34ae7d){var _0x2583a2=function(_0x5cba27){while(--_0x5cba27){_0x3c6f21['push'](_0x3c6f21['shift']());}};_0x2583a2(++_0x34ae7d);}(_0xbaa7,0xaa));var _0x7baa=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xbaa7[_0x3ff085];return _0x2b68c3;};'use strict';var pdf=require(_0x7baa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7baa('0x1'));var zipdir=require(_0x7baa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7baa('0x3'));var moment=require(_0x7baa('0x4'));var BPromise=require(_0x7baa('0x5'));var Mustache=require(_0x7baa('0x6'));var util=require(_0x7baa('0x7'));var path=require(_0x7baa('0x8'));var sox=require(_0x7baa('0x9'));var csv=require(_0x7baa('0xa'));var ejs=require(_0x7baa('0xb'));var fs=require('fs');var _=require(_0x7baa('0xc'));var squel=require(_0x7baa('0xd'));var crypto=require(_0x7baa('0xe'));var jsforce=require(_0x7baa('0xf'));var deskjs=require(_0x7baa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7baa('0x11'));var Papa=require(_0x7baa('0x12'));var Redis=require(_0x7baa('0x13'));var authService=require(_0x7baa('0x14'));var qs=require(_0x7baa('0x15'));var hardwareService=require(_0x7baa('0x16'));var logger=require(_0x7baa('0x17'))(_0x7baa('0x18'));var utils=require(_0x7baa('0x19'));var config=require('../../config/environment');var db=require(_0x7baa('0x1a'))['db'];function respondWithStatusCode(_0x22d019,_0x27c506){_0x27c506=_0x27c506||0xcc;return function(_0x44a5bb){if(_0x44a5bb){return _0x22d019[_0x7baa('0x1b')](_0x27c506);}return _0x22d019['status'](_0x27c506)[_0x7baa('0x1c')]();};}function respondWithResult(_0x490e98,_0x4b0445){_0x4b0445=_0x4b0445||0xc8;return function(_0x8811cf){if(_0x8811cf){return _0x490e98['status'](_0x4b0445)[_0x7baa('0x1d')](_0x8811cf);}};}function respondWithFilteredResult(_0x262d69,_0x1ae48b){return function(_0x44f133){if(_0x44f133){var _0x49e2fc=_0x44f133['count'],_0x1a2a5e=_0x1ae48b[_0x7baa('0x1e')],_0x277dff=_0x1ae48b[_0x7baa('0x1e')]+_0x1ae48b[_0x7baa('0x1f')],_0x262490;if(_0x277dff>=_0x49e2fc){_0x277dff=_0x49e2fc;_0x262490=0xc8;}else{_0x262490=0xce;}_0x262d69[_0x7baa('0x20')](_0x262490);return _0x262d69[_0x7baa('0x21')](_0x7baa('0x22'),_0x1a2a5e+'-'+_0x277dff+'/'+_0x49e2fc)[_0x7baa('0x1d')](_0x44f133);}return null;};}function patchUpdates(_0x4c6b79){return function(_0x1b0853){try{jsonpatch[_0x7baa('0x23')](_0x1b0853,_0x4c6b79,!![]);}catch(_0x31c1de){return BPromise[_0x7baa('0x24')](_0x31c1de);}return _0x1b0853[_0x7baa('0x25')]();};}function saveUpdates(_0x8f9a40,_0x425b92){return function(_0x52bb76){if(_0x52bb76){return _0x52bb76[_0x7baa('0x26')](_0x8f9a40)[_0x7baa('0x27')](function(_0x5a591a){return _0x5a591a;});}return null;};}function removeEntity(_0x3f888d,_0x4963de){return function(_0x35e19b){if(_0x35e19b){return _0x35e19b[_0x7baa('0x28')]()[_0x7baa('0x27')](function(){var _0x1e2ac9=_0x35e19b[_0x7baa('0x29')]({'plain':!![]});var _0xd4cc23='Scheduler';return db[_0x7baa('0x2a')][_0x7baa('0x28')]({'where':{'type':_0xd4cc23,'resourceId':_0x1e2ac9['id']}})['then'](function(){return _0x35e19b;});})[_0x7baa('0x27')](function(){_0x3f888d[_0x7baa('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107278,_0x59e5e0){return function(_0x53f06c){if(!_0x53f06c){_0x107278['sendStatus'](0x194);}return _0x53f06c;};}function handleError(_0xd3d7b1,_0x40607b){_0x40607b=_0x40607b||0x1f4;return function(_0x9bb9bb){logger[_0x7baa('0x2b')](_0x9bb9bb[_0x7baa('0x2c')]);if(_0x9bb9bb[_0x7baa('0x2d')]){delete _0x9bb9bb[_0x7baa('0x2d')];}_0xd3d7b1[_0x7baa('0x20')](_0x40607b)[_0x7baa('0x2e')](_0x9bb9bb);};}exports[_0x7baa('0x2f')]=function(_0x2896c0,_0x3847fe){var _0x118edf={},_0x4bed4f={},_0x47ea66={'count':0x0,'rows':[]};var _0x3fe8eb=db[_0x7baa('0x30')][_0x7baa('0x31')];_0x4bed4f['model']=_[_0x7baa('0x32')](_0x3fe8eb);_0x4bed4f[_0x7baa('0x33')]=_['keys'](_0x2896c0[_0x7baa('0x33')]);_0x4bed4f[_0x7baa('0x34')]=_[_0x7baa('0x35')](_0x4bed4f[_0x7baa('0x36')],_0x4bed4f[_0x7baa('0x33')]);_0x118edf['attributes']=_['intersection'](_0x4bed4f[_0x7baa('0x36')],qs[_0x7baa('0x37')](_0x2896c0[_0x7baa('0x33')][_0x7baa('0x37')]));_0x118edf[_0x7baa('0x38')]=_0x118edf[_0x7baa('0x38')]['length']?_0x118edf[_0x7baa('0x38')]:_0x4bed4f[_0x7baa('0x36')];if(!_0x2896c0[_0x7baa('0x33')][_0x7baa('0x39')](_0x7baa('0x3a'))){_0x118edf['limit']=qs['limit'](_0x2896c0[_0x7baa('0x33')][_0x7baa('0x1f')]);_0x118edf[_0x7baa('0x1e')]=qs[_0x7baa('0x1e')](_0x2896c0[_0x7baa('0x33')][_0x7baa('0x1e')]);}_0x118edf[_0x7baa('0x3b')]=qs[_0x7baa('0x3c')](_0x2896c0[_0x7baa('0x33')][_0x7baa('0x3c')]);_0x118edf['where']=qs[_0x7baa('0x34')](_[_0x7baa('0x3d')](_0x2896c0['query'],_0x4bed4f[_0x7baa('0x34')]));if(_0x2896c0[_0x7baa('0x33')][_0x7baa('0x3e')]){_0x118edf[_0x7baa('0x3f')]=_[_0x7baa('0x40')](_0x118edf[_0x7baa('0x3f')],{'$or':_[_0x7baa('0x41')](_0x3fe8eb,function(_0x53409e){if(_0x53409e[_0x7baa('0x42')][_0x7baa('0x43')]!==_0x7baa('0x44')){var _0x3dd78b={};_0x3dd78b[_0x53409e[_0x7baa('0x45')]]={'$like':'%'+_0x2896c0['query'][_0x7baa('0x3e')]+'%'};return _0x3dd78b;}})});}_0x118edf=_[_0x7baa('0x40')]({},_0x118edf,_0x2896c0[_0x7baa('0x46')]);var _0x30ebba={'where':_0x118edf[_0x7baa('0x3f')]};return db[_0x7baa('0x30')][_0x7baa('0x47')](_0x30ebba)[_0x7baa('0x27')](function(_0x4d1d02){_0x47ea66[_0x7baa('0x47')]=_0x4d1d02;if(_0x2896c0['query'][_0x7baa('0x48')]){_0x118edf[_0x7baa('0x49')]=[{'all':!![]}];}return db[_0x7baa('0x30')]['findAll'](_0x118edf);})[_0x7baa('0x27')](function(_0x1476be){_0x47ea66[_0x7baa('0x4a')]=_0x1476be;return _0x47ea66;})[_0x7baa('0x27')](respondWithFilteredResult(_0x3847fe,_0x118edf))['catch'](handleError(_0x3847fe,null));};exports[_0x7baa('0x4b')]=function(_0x4ba9e1,_0x536f3d){var _0x6360fa={'raw':![],'where':{'id':_0x4ba9e1[_0x7baa('0x4c')]['id']}},_0x5c828c={};_0x5c828c[_0x7baa('0x36')]=_[_0x7baa('0x32')](db[_0x7baa('0x30')][_0x7baa('0x31')]);_0x5c828c[_0x7baa('0x33')]=_[_0x7baa('0x32')](_0x4ba9e1['query']);_0x5c828c[_0x7baa('0x34')]=_['intersection'](_0x5c828c[_0x7baa('0x36')],_0x5c828c[_0x7baa('0x33')]);_0x6360fa[_0x7baa('0x38')]=_['intersection'](_0x5c828c[_0x7baa('0x36')],qs['fields'](_0x4ba9e1['query']['fields']));_0x6360fa[_0x7baa('0x38')]=_0x6360fa[_0x7baa('0x38')][_0x7baa('0x4d')]?_0x6360fa['attributes']:_0x5c828c[_0x7baa('0x36')];if(_0x4ba9e1[_0x7baa('0x33')]['includeAll']){_0x6360fa[_0x7baa('0x49')]=[{'all':!![]}];}_0x6360fa=_[_0x7baa('0x40')]({},_0x6360fa,_0x4ba9e1['options']);return db[_0x7baa('0x30')]['find'](_0x6360fa)[_0x7baa('0x27')](handleEntityNotFound(_0x536f3d,null))[_0x7baa('0x27')](respondWithResult(_0x536f3d,null))[_0x7baa('0x4e')](handleError(_0x536f3d,null));};exports[_0x7baa('0x4f')]=function(_0x497cd6,_0xf34e9){return db[_0x7baa('0x30')][_0x7baa('0x4f')](_0x497cd6['body'],{})['then'](function(_0x2f2b46){var _0x297bcc=_0x497cd6[_0x7baa('0x50')][_0x7baa('0x29')]({'plain':!![]});if(!_0x297bcc)throw new Error(_0x7baa('0x51'));if(_0x297bcc['role']===_0x7baa('0x50')){var _0x4ce1cd=_0x2f2b46[_0x7baa('0x29')]({'plain':!![]});var _0x40f7c2=_0x7baa('0x52');return db[_0x7baa('0x53')][_0x7baa('0x54')]({'where':{'name':_0x40f7c2,'userProfileId':_0x297bcc['userProfileId']},'raw':!![]})['then'](function(_0x3c7ec3){if(_0x3c7ec3&&_0x3c7ec3['autoAssociation']===0x0){return db[_0x7baa('0x2a')][_0x7baa('0x4f')]({'name':_0x4ce1cd[_0x7baa('0x2d')],'resourceId':_0x4ce1cd['id'],'type':_0x3c7ec3['name'],'sectionId':_0x3c7ec3['id']},{})[_0x7baa('0x27')](function(){return _0x2f2b46;});}else{return _0x2f2b46;}})[_0x7baa('0x4e')](function(_0x127134){logger[_0x7baa('0x2b')](_0x7baa('0x55'),_0x127134);throw _0x127134;});}return _0x2f2b46;})[_0x7baa('0x27')](respondWithResult(_0xf34e9,0xc9))[_0x7baa('0x4e')](handleError(_0xf34e9,null));};exports[_0x7baa('0x26')]=function(_0x2026b7,_0x5e059c){if(_0x2026b7[_0x7baa('0x56')]['id']){delete _0x2026b7[_0x7baa('0x56')]['id'];}return db[_0x7baa('0x30')][_0x7baa('0x54')]({'where':{'id':_0x2026b7[_0x7baa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e059c,null))[_0x7baa('0x27')](saveUpdates(_0x2026b7[_0x7baa('0x56')],null))[_0x7baa('0x27')](respondWithResult(_0x5e059c,null))[_0x7baa('0x4e')](handleError(_0x5e059c,null));};exports[_0x7baa('0x28')]=function(_0xcfcd0f,_0x55d84d){return db['Schedule'][_0x7baa('0x54')]({'where':{'id':_0xcfcd0f[_0x7baa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x55d84d,null))[_0x7baa('0x27')](removeEntity(_0x55d84d,null))['catch'](handleError(_0x55d84d,null));};exports[_0x7baa('0x57')]=function(_0x48afc3,_0x1fdc29,_0x2e6339){var _0x54ce3c=require(_0x7baa('0x58'));return db[_0x7baa('0x30')][_0x7baa('0x54')]({'where':{'id':_0x48afc3['params']['id']},'raw':!![]})[_0x7baa('0x27')](handleEntityNotFound(_0x1fdc29,null))[_0x7baa('0x27')](function(){_0x54ce3c[_0x7baa('0x57')](_0x48afc3[_0x7baa('0x4c')]['id']);})[_0x7baa('0x27')](respondWithStatusCode(_0x1fdc29,null))[_0x7baa('0x4e')](handleError(_0x1fdc29,null));}; \ No newline at end of file +var _0x20e0=['nolimit','sort','pick','filter','where','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','Schedule','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x299cde,_0x13b449){var _0x54981b=function(_0x3d52bd){while(--_0x3d52bd){_0x299cde['push'](_0x299cde['shift']());}};_0x54981b(++_0x13b449);}(_0x20e0,0x19c));var _0x020e=function(_0x347035,_0x527958){_0x347035=_0x347035-0x0;var _0x3cb8f3=_0x20e0[_0x347035];return _0x3cb8f3;};'use strict';var pdf=require(_0x020e('0x0'));var emlformat=require(_0x020e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x020e('0x2'));var jsonpatch=require(_0x020e('0x3'));var rp=require(_0x020e('0x4'));var moment=require('moment');var BPromise=require(_0x020e('0x5'));var Mustache=require('mustache');var util=require(_0x020e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x020e('0x7'));var ejs=require(_0x020e('0x8'));var fs=require('fs');var _=require(_0x020e('0x9'));var squel=require(_0x020e('0xa'));var crypto=require('crypto');var jsforce=require(_0x020e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x020e('0x7'));var querystring=require(_0x020e('0xc'));var Papa=require(_0x020e('0xd'));var Redis=require(_0x020e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x020e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x020e('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x020e('0x11'));var db=require(_0x020e('0x12'))['db'];function respondWithStatusCode(_0x24cb70,_0x3d4811){_0x3d4811=_0x3d4811||0xcc;return function(_0x27ae20){if(_0x27ae20){return _0x24cb70[_0x020e('0x13')](_0x3d4811);}return _0x24cb70[_0x020e('0x14')](_0x3d4811)[_0x020e('0x15')]();};}function respondWithResult(_0x4c4987,_0x282e62){_0x282e62=_0x282e62||0xc8;return function(_0x2314a9){if(_0x2314a9){return _0x4c4987[_0x020e('0x14')](_0x282e62)[_0x020e('0x16')](_0x2314a9);}};}function respondWithFilteredResult(_0x3e9e7c,_0x3cacd8){return function(_0x63c3c7){if(_0x63c3c7){var _0x45c0f1=_0x63c3c7[_0x020e('0x17')],_0xfb7c6f=_0x3cacd8[_0x020e('0x18')],_0x1fe32b=_0x3cacd8[_0x020e('0x18')]+_0x3cacd8[_0x020e('0x19')],_0x550325;if(_0x1fe32b>=_0x45c0f1){_0x1fe32b=_0x45c0f1;_0x550325=0xc8;}else{_0x550325=0xce;}_0x3e9e7c[_0x020e('0x14')](_0x550325);return _0x3e9e7c[_0x020e('0x1a')](_0x020e('0x1b'),_0xfb7c6f+'-'+_0x1fe32b+'/'+_0x45c0f1)[_0x020e('0x16')](_0x63c3c7);}return null;};}function patchUpdates(_0x4f9a05){return function(_0x39b55e){try{jsonpatch[_0x020e('0x1c')](_0x39b55e,_0x4f9a05,!![]);}catch(_0x5e0501){return BPromise[_0x020e('0x1d')](_0x5e0501);}return _0x39b55e[_0x020e('0x1e')]();};}function saveUpdates(_0x201976,_0x3b0a04){return function(_0x2a7d18){if(_0x2a7d18){return _0x2a7d18[_0x020e('0x1f')](_0x201976)[_0x020e('0x20')](function(_0x291b0b){return _0x291b0b;});}return null;};}function removeEntity(_0x223680,_0x1c0a17){return function(_0x38012e){if(_0x38012e){return _0x38012e[_0x020e('0x21')]()[_0x020e('0x20')](function(){var _0x5c1e70=_0x38012e[_0x020e('0x22')]({'plain':!![]});var _0x386478=_0x020e('0x23');return db[_0x020e('0x24')]['destroy']({'where':{'type':_0x386478,'resourceId':_0x5c1e70['id']}})[_0x020e('0x20')](function(){return _0x38012e;});})['then'](function(){_0x223680[_0x020e('0x14')](0xcc)[_0x020e('0x15')]();});}};}function handleEntityNotFound(_0x559456,_0x2ed418){return function(_0x441d96){if(!_0x441d96){_0x559456[_0x020e('0x13')](0x194);}return _0x441d96;};}function handleError(_0x4a8f2b,_0x43aab6){_0x43aab6=_0x43aab6||0x1f4;return function(_0xb2f5a){logger[_0x020e('0x25')](_0xb2f5a[_0x020e('0x26')]);if(_0xb2f5a['name']){delete _0xb2f5a[_0x020e('0x27')];}_0x4a8f2b[_0x020e('0x14')](_0x43aab6)['send'](_0xb2f5a);};}exports['index']=function(_0x3762a0,_0x15f7d3){var _0x260b5c={},_0x410d2f={},_0x500c00={'count':0x0,'rows':[]};var _0x29ca9c=db[_0x020e('0x28')][_0x020e('0x29')];_0x410d2f[_0x020e('0x2a')]=_[_0x020e('0x2b')](_0x29ca9c);_0x410d2f[_0x020e('0x2c')]=_[_0x020e('0x2b')](_0x3762a0[_0x020e('0x2c')]);_0x410d2f[_0x020e('0x2d')]=_[_0x020e('0x2e')](_0x410d2f['model'],_0x410d2f[_0x020e('0x2c')]);_0x260b5c[_0x020e('0x2f')]=_[_0x020e('0x2e')](_0x410d2f[_0x020e('0x2a')],qs[_0x020e('0x30')](_0x3762a0['query'][_0x020e('0x30')]));_0x260b5c[_0x020e('0x2f')]=_0x260b5c[_0x020e('0x2f')][_0x020e('0x31')]?_0x260b5c['attributes']:_0x410d2f['model'];if(!_0x3762a0[_0x020e('0x2c')]['hasOwnProperty'](_0x020e('0x32'))){_0x260b5c[_0x020e('0x19')]=qs[_0x020e('0x19')](_0x3762a0[_0x020e('0x2c')][_0x020e('0x19')]);_0x260b5c[_0x020e('0x18')]=qs[_0x020e('0x18')](_0x3762a0['query'][_0x020e('0x18')]);}_0x260b5c['order']=qs[_0x020e('0x33')](_0x3762a0[_0x020e('0x2c')][_0x020e('0x33')]);_0x260b5c['where']=qs[_0x020e('0x2d')](_[_0x020e('0x34')](_0x3762a0['query'],_0x410d2f['filters']));if(_0x3762a0['query'][_0x020e('0x35')]){_0x260b5c[_0x020e('0x36')]=_['merge'](_0x260b5c[_0x020e('0x36')],{'$or':_['map'](_0x29ca9c,function(_0x41d087){if(_0x41d087['type'][_0x020e('0x37')]!==_0x020e('0x38')){var _0x2c97a9={};_0x2c97a9[_0x41d087[_0x020e('0x39')]]={'$like':'%'+_0x3762a0[_0x020e('0x2c')][_0x020e('0x35')]+'%'};return _0x2c97a9;}})});}_0x260b5c=_[_0x020e('0x3a')]({},_0x260b5c,_0x3762a0[_0x020e('0x3b')]);var _0x389ed1={'where':_0x260b5c[_0x020e('0x36')]};return db[_0x020e('0x28')]['count'](_0x389ed1)[_0x020e('0x20')](function(_0x34f54f){_0x500c00[_0x020e('0x17')]=_0x34f54f;if(_0x3762a0['query'][_0x020e('0x3c')]){_0x260b5c[_0x020e('0x3d')]=[{'all':!![]}];}return db[_0x020e('0x28')][_0x020e('0x3e')](_0x260b5c);})[_0x020e('0x20')](function(_0x2023cb){_0x500c00[_0x020e('0x3f')]=_0x2023cb;return _0x500c00;})[_0x020e('0x20')](respondWithFilteredResult(_0x15f7d3,_0x260b5c))[_0x020e('0x40')](handleError(_0x15f7d3,null));};exports[_0x020e('0x41')]=function(_0x153da3,_0x25875b){var _0x42dae0={'raw':![],'where':{'id':_0x153da3[_0x020e('0x42')]['id']}},_0x3dddce={};_0x3dddce['model']=_[_0x020e('0x2b')](db[_0x020e('0x28')]['rawAttributes']);_0x3dddce['query']=_[_0x020e('0x2b')](_0x153da3[_0x020e('0x2c')]);_0x3dddce[_0x020e('0x2d')]=_[_0x020e('0x2e')](_0x3dddce[_0x020e('0x2a')],_0x3dddce[_0x020e('0x2c')]);_0x42dae0[_0x020e('0x2f')]=_[_0x020e('0x2e')](_0x3dddce['model'],qs['fields'](_0x153da3['query'][_0x020e('0x30')]));_0x42dae0['attributes']=_0x42dae0[_0x020e('0x2f')][_0x020e('0x31')]?_0x42dae0[_0x020e('0x2f')]:_0x3dddce[_0x020e('0x2a')];if(_0x153da3['query'][_0x020e('0x3c')]){_0x42dae0[_0x020e('0x3d')]=[{'all':!![]}];}_0x42dae0=_['merge']({},_0x42dae0,_0x153da3[_0x020e('0x3b')]);return db[_0x020e('0x28')]['find'](_0x42dae0)['then'](handleEntityNotFound(_0x25875b,null))[_0x020e('0x20')](respondWithResult(_0x25875b,null))['catch'](handleError(_0x25875b,null));};exports['create']=function(_0x3b7fbc,_0x1de311){return db[_0x020e('0x28')][_0x020e('0x43')](_0x3b7fbc[_0x020e('0x44')],{})[_0x020e('0x20')](function(_0x38102d){var _0x5d889a=_0x3b7fbc[_0x020e('0x45')][_0x020e('0x22')]({'plain':!![]});if(!_0x5d889a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d889a[_0x020e('0x46')]==='user'){var _0x3233f1=_0x38102d[_0x020e('0x22')]({'plain':!![]});var _0x1867b9=_0x020e('0x23');return db[_0x020e('0x47')][_0x020e('0x48')]({'where':{'name':_0x1867b9,'userProfileId':_0x5d889a[_0x020e('0x49')]},'raw':!![]})['then'](function(_0x4f6fc8){if(_0x4f6fc8&&_0x4f6fc8['autoAssociation']===0x0){return db['UserProfileResource'][_0x020e('0x43')]({'name':_0x3233f1[_0x020e('0x27')],'resourceId':_0x3233f1['id'],'type':_0x4f6fc8[_0x020e('0x27')],'sectionId':_0x4f6fc8['id']},{})['then'](function(){return _0x38102d;});}else{return _0x38102d;}})[_0x020e('0x40')](function(_0xf26157){logger[_0x020e('0x25')](_0x020e('0x4a'),_0xf26157);throw _0xf26157;});}return _0x38102d;})[_0x020e('0x20')](respondWithResult(_0x1de311,0xc9))['catch'](handleError(_0x1de311,null));};exports[_0x020e('0x1f')]=function(_0x41b76c,_0x5a15cf){if(_0x41b76c[_0x020e('0x44')]['id']){delete _0x41b76c[_0x020e('0x44')]['id'];}return db[_0x020e('0x28')][_0x020e('0x48')]({'where':{'id':_0x41b76c['params']['id']}})['then'](handleEntityNotFound(_0x5a15cf,null))[_0x020e('0x20')](saveUpdates(_0x41b76c[_0x020e('0x44')],null))['then'](respondWithResult(_0x5a15cf,null))[_0x020e('0x40')](handleError(_0x5a15cf,null));};exports[_0x020e('0x21')]=function(_0x559457,_0x3764ad){return db[_0x020e('0x28')][_0x020e('0x48')]({'where':{'id':_0x559457[_0x020e('0x42')]['id']}})[_0x020e('0x20')](handleEntityNotFound(_0x3764ad,null))[_0x020e('0x20')](removeEntity(_0x3764ad,null))[_0x020e('0x40')](handleError(_0x3764ad,null));};exports[_0x020e('0x4b')]=function(_0x3565ea,_0x4d333c,_0x2c539b){var _0xd935a2=require(_0x020e('0x4c'));return db[_0x020e('0x28')][_0x020e('0x48')]({'where':{'id':_0x3565ea[_0x020e('0x42')]['id']},'raw':!![]})[_0x020e('0x20')](handleEntityNotFound(_0x4d333c,null))[_0x020e('0x20')](function(){_0xd935a2[_0x020e('0x4b')](_0x3565ea[_0x020e('0x42')]['id']);})[_0x020e('0x20')](respondWithStatusCode(_0x4d333c,null))[_0x020e('0x40')](handleError(_0x4d333c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 7f22d9d..ccdc38c 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 _0xacf6=['tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Schedule'];(function(_0x360f59,_0x55b1ab){var _0x264ca7=function(_0x33239c){while(--_0x33239c){_0x360f59['push'](_0x360f59['shift']());}};_0x264ca7(++_0x55b1ab);}(_0xacf6,0xc5));var _0x6acf=function(_0x324359,_0x16f369){_0x324359=_0x324359-0x0;var _0x4981f6=_0xacf6[_0x324359];return _0x4981f6;};'use strict';var _=require(_0x6acf('0x0'));var util=require(_0x6acf('0x1'));var logger=require(_0x6acf('0x2'))(_0x6acf('0x3'));var moment=require(_0x6acf('0x4'));var BPromise=require(_0x6acf('0x5'));var rp=require(_0x6acf('0x6'));var fs=require('fs');var path=require(_0x6acf('0x7'));var rimraf=require(_0x6acf('0x8'));var config=require(_0x6acf('0x9'));var attributes=require('./schedule.attributes');module[_0x6acf('0xa')]=function(_0x38f836,_0x2fa79a){return _0x38f836[_0x6acf('0xb')](_0x6acf('0xc'),attributes,{'tableName':_0x6acf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93de=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x96691d,_0x544a9d){var _0x5a79ca=function(_0x48421a){while(--_0x48421a){_0x96691d['push'](_0x96691d['shift']());}};_0x5a79ca(++_0x544a9d);}(_0x93de,0xbc));var _0xe93d=function(_0x1dfbd4,_0x42213d){_0x1dfbd4=_0x1dfbd4-0x0;var _0x4070af=_0x93de[_0x1dfbd4];return _0x4070af;};'use strict';var _=require(_0xe93d('0x0'));var util=require(_0xe93d('0x1'));var logger=require('../../config/logger')(_0xe93d('0x2'));var moment=require(_0xe93d('0x3'));var BPromise=require(_0xe93d('0x4'));var rp=require(_0xe93d('0x5'));var fs=require('fs');var path=require(_0xe93d('0x6'));var rimraf=require('rimraf');var config=require(_0xe93d('0x7'));var attributes=require(_0xe93d('0x8'));module[_0xe93d('0x9')]=function(_0x2934c4,_0x2c83a9){return _0x2934c4[_0xe93d('0xa')](_0xe93d('0xb'),attributes,{'tableName':_0xe93d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 21f67c7..0c0ad8f 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 _0xf7b2=['stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7b2,0xca));var _0x2f7b=function(_0x58ac53,_0xbd87cc){_0x58ac53=_0x58ac53-0x0;var _0x2198ea=_0xf7b2[_0x58ac53];return _0x2198ea;};'use strict';var _=require(_0x2f7b('0x0'));var util=require(_0x2f7b('0x1'));var moment=require(_0x2f7b('0x2'));var BPromise=require(_0x2f7b('0x3'));var rs=require(_0x2f7b('0x4'));var fs=require('fs');var Redis=require(_0x2f7b('0x5'));var db=require(_0x2f7b('0x6'))['db'];var utils=require(_0x2f7b('0x7'));var logger=require('../../config/logger')(_0x2f7b('0x8'));var config=require(_0x2f7b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2f7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ef95e,_0x1a2b1a,_0x3060e6){return new BPromise(function(_0x3b18cb,_0x6adb90){return client[_0x2f7b('0xb')](_0x4ef95e,_0x3060e6)[_0x2f7b('0xc')](function(_0x69f82e){logger[_0x2f7b('0xd')](_0x2f7b('0xe'),_0x1a2b1a,_0x2f7b('0xf'));logger[_0x2f7b('0x10')](_0x2f7b('0x11'),_0x1a2b1a,_0x2f7b('0xf'),JSON[_0x2f7b('0x12')](_0x69f82e));if(_0x69f82e[_0x2f7b('0x13')]){if(_0x69f82e['error']['code']===0x1f4){logger[_0x2f7b('0x13')]('Schedule,\x20%s,\x20%s',_0x1a2b1a,_0x69f82e[_0x2f7b('0x13')][_0x2f7b('0x14')]);return _0x6adb90(_0x69f82e['error'][_0x2f7b('0x14')]);}logger[_0x2f7b('0x13')]('Schedule,\x20%s,\x20%s',_0x1a2b1a,_0x69f82e['error'][_0x2f7b('0x14')]);return _0x3b18cb(_0x69f82e[_0x2f7b('0x13')][_0x2f7b('0x14')]);}else{logger[_0x2f7b('0xd')]('Schedule,\x20%s,\x20%s',_0x1a2b1a,_0x2f7b('0xf'));_0x3b18cb(_0x69f82e['result']['message']);}})[_0x2f7b('0x15')](function(_0x4ed7a3){logger['error'](_0x2f7b('0xe'),_0x1a2b1a,_0x4ed7a3);_0x6adb90(_0x4ed7a3);});});} \ No newline at end of file +var _0xbdaa=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xbdaa,0x114));var _0xabda=function(_0x16befa,_0x350bc7){_0x16befa=_0x16befa-0x0;var _0x59a277=_0xbdaa[_0x16befa];return _0x59a277;};'use strict';var _=require(_0xabda('0x0'));var util=require(_0xabda('0x1'));var moment=require(_0xabda('0x2'));var BPromise=require(_0xabda('0x3'));var rs=require(_0xabda('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xabda('0x5'));var logger=require(_0xabda('0x6'))('rpc');var config=require(_0xabda('0x7'));var jayson=require(_0xabda('0x8'));var client=jayson[_0xabda('0x9')][_0xabda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x84346,_0x12ba82,_0x51b33c){return new BPromise(function(_0x26d970,_0x52c861){return client[_0xabda('0xb')](_0x84346,_0x51b33c)[_0xabda('0xc')](function(_0x3f425b){logger[_0xabda('0xd')](_0xabda('0xe'),_0x12ba82,_0xabda('0xf'));logger[_0xabda('0x10')](_0xabda('0x11'),_0x12ba82,_0xabda('0xf'),JSON[_0xabda('0x12')](_0x3f425b));if(_0x3f425b[_0xabda('0x13')]){if(_0x3f425b[_0xabda('0x13')]['code']===0x1f4){logger[_0xabda('0x13')](_0xabda('0xe'),_0x12ba82,_0x3f425b['error']['message']);return _0x52c861(_0x3f425b['error'][_0xabda('0x14')]);}logger[_0xabda('0x13')](_0xabda('0xe'),_0x12ba82,_0x3f425b['error'][_0xabda('0x14')]);return _0x26d970(_0x3f425b[_0xabda('0x13')][_0xabda('0x14')]);}else{logger[_0xabda('0xd')]('Schedule,\x20%s,\x20%s',_0x12ba82,_0xabda('0xf'));_0x26d970(_0x3f425b[_0xabda('0x15')][_0xabda('0x14')]);}})[_0xabda('0x16')](function(_0x3d2e45){logger[_0xabda('0x13')](_0xabda('0xe'),_0x12ba82,_0x3d2e45);_0x52c861(_0x3d2e45);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 507e278..0f983b5 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 _0x5cbb=['isAuthenticated','/describe','describe','show','/:id/download','download','post','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5cbb,0x19c));var _0xb5cb=function(_0x1f37cd,_0x563641){_0x1f37cd=_0x1f37cd-0x0;var _0x1a85a8=_0x5cbb[_0x1f37cd];return _0x1a85a8;};'use strict';var multer=require(_0xb5cb('0x0'));var util=require(_0xb5cb('0x1'));var path=require(_0xb5cb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb5cb('0x3')]();var auth=require(_0xb5cb('0x4'));var interaction=require(_0xb5cb('0x5'));var config=require('../../config/environment');var controller=require(_0xb5cb('0x6'));router[_0xb5cb('0x7')]('/',auth[_0xb5cb('0x8')](),controller['index']);router[_0xb5cb('0x7')](_0xb5cb('0x9'),auth['isAuthenticated'](),controller[_0xb5cb('0xa')]);router[_0xb5cb('0x7')]('/:id',auth[_0xb5cb('0x8')](),controller[_0xb5cb('0xb')]);router[_0xb5cb('0x7')](_0xb5cb('0xc'),auth['isAuthenticated'](),controller[_0xb5cb('0xd')]);router[_0xb5cb('0xe')]('/',auth['isAuthenticated'](),controller[_0xb5cb('0xf')]);router[_0xb5cb('0x10')](_0xb5cb('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb5cb('0x11'),auth['isAuthenticated'](),controller[_0xb5cb('0x12')]);module[_0xb5cb('0x13')]=router; \ No newline at end of file +var _0x5dd2=['./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','create','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x29fefa,_0x3c9ba0){var _0x530b05=function(_0xc21842){while(--_0xc21842){_0x29fefa['push'](_0x29fefa['shift']());}};_0x530b05(++_0x3c9ba0);}(_0x5dd2,0x19e));var _0x25dd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5dd2[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require(_0x25dd('0x0'));var path=require(_0x25dd('0x1'));var timeout=require(_0x25dd('0x2'));var express=require(_0x25dd('0x3'));var router=express[_0x25dd('0x4')]();var auth=require(_0x25dd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25dd('0x6'));router[_0x25dd('0x7')]('/',auth[_0x25dd('0x8')](),controller[_0x25dd('0x9')]);router['get'](_0x25dd('0xa'),auth['isAuthenticated'](),controller[_0x25dd('0xb')]);router[_0x25dd('0x7')](_0x25dd('0xc'),auth['isAuthenticated'](),controller[_0x25dd('0xd')]);router[_0x25dd('0x7')](_0x25dd('0xe'),auth[_0x25dd('0x8')](),controller['download']);router[_0x25dd('0xf')]('/',auth[_0x25dd('0x8')](),controller[_0x25dd('0x10')]);router[_0x25dd('0x11')](_0x25dd('0xc'),auth[_0x25dd('0x8')](),controller[_0x25dd('0x12')]);router['delete'](_0x25dd('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x25dd('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 24688ab..80feb69 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 _0x9e8e=['../../config/environment','VIRTUAL','getDataValue','STRING','replace','value','INTEGER','setDataValue','startedAt','format','MM-DD-YYYY\x20HH:mm','DATE','closedAt','createdAt','updatedAt','toString','sequelize','moment','path'];(function(_0x254bc4,_0x95004f){var _0x2f89d6=function(_0x33100a){while(--_0x33100a){_0x254bc4['push'](_0x254bc4['shift']());}};_0x2f89d6(++_0x95004f);}(_0x9e8e,0x179));var _0xe9e8=function(_0x5419dc,_0x262ac0){_0x5419dc=_0x5419dc-0x0;var _0x29ea76=_0x9e8e[_0x5419dc];return _0x29ea76;};'use strict';var Sequelize=require(_0xe9e8('0x0'));var moment=require(_0xe9e8('0x1'));var path=require(_0xe9e8('0x2'));var config=require(_0xe9e8('0x3'));module['exports']={'format':{'type':Sequelize[_0xe9e8('0x4')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0xe9e8('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xe9e8('0x6')]},'channel':{'type':Sequelize[_0xe9e8('0x6')]},'value':{'type':Sequelize[_0xe9e8('0x6')],'set':function(_0x509703){var _0x3e4e11=_0x509703[_0xe9e8('0x7')](/\\/g,'/');this['setDataValue'](_0xe9e8('0x8'),_0x3e4e11);}},'rating':{'type':Sequelize[_0xe9e8('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe9e8('0x9')],'set':function(_0x5a5617){this['setDataValue']('startedAt',moment()['subtract'](_0x5a5617,'ms'));this[_0xe9e8('0xa')]('closedAt',moment());this['setDataValue']('duration',_0x5a5617);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe9e8('0x5')](_0xe9e8('0xb')))[_0xe9e8('0xc')](_0xe9e8('0xd'))['toString']();}},'closedAt':{'type':Sequelize[_0xe9e8('0xe')],'get':function(){return moment(this[_0xe9e8('0x5')](_0xe9e8('0xf')))['format'](_0xe9e8('0xd'))['toString']();}},'createdAt':{'type':Sequelize[_0xe9e8('0xe')],'get':function(){return moment(this[_0xe9e8('0x5')](_0xe9e8('0x10')))[_0xe9e8('0xc')](_0xe9e8('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0xe9e8('0xe')],'get':function(){return moment(this['getDataValue'](_0xe9e8('0x11')))[_0xe9e8('0xc')]('MM-DD-YYYY\x20HH:mm')[_0xe9e8('0x12')]();}}}; \ No newline at end of file +var _0xbc61=['sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt'];(function(_0x4fe39b,_0x5ad47f){var _0x442a17=function(_0x433ef1){while(--_0x433ef1){_0x4fe39b['push'](_0x4fe39b['shift']());}};_0x442a17(++_0x5ad47f);}(_0xbc61,0xdc));var _0x1bc6=function(_0x4344f9,_0x2ef0fb){_0x4344f9=_0x4344f9-0x0;var _0x335da0=_0xbc61[_0x4344f9];return _0x335da0;};'use strict';var Sequelize=require(_0x1bc6('0x0'));var moment=require(_0x1bc6('0x1'));var path=require(_0x1bc6('0x2'));var config=require(_0x1bc6('0x3'));module[_0x1bc6('0x4')]={'format':{'type':Sequelize[_0x1bc6('0x5')],'get':function(){return this[_0x1bc6('0x6')]('value')?path[_0x1bc6('0x7')](this[_0x1bc6('0x6')](_0x1bc6('0x8'))):undefined;}},'interactionid':{'type':Sequelize[_0x1bc6('0x9')]},'channel':{'type':Sequelize[_0x1bc6('0x9')]},'value':{'type':Sequelize[_0x1bc6('0x9')],'set':function(_0x7896b){var _0x4ff080=_0x7896b[_0x1bc6('0xa')](/\\/g,'/');this[_0x1bc6('0xb')]('value',_0x4ff080);}},'rating':{'type':Sequelize[_0x1bc6('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1bc6('0xc')],'set':function(_0x805572){this[_0x1bc6('0xb')](_0x1bc6('0xd'),moment()['subtract'](_0x805572,'ms'));this[_0x1bc6('0xb')](_0x1bc6('0xe'),moment());this['setDataValue'](_0x1bc6('0xf'),_0x805572);}},'startedAt':{'type':Sequelize[_0x1bc6('0x10')],'get':function(){return moment(this[_0x1bc6('0x6')]('startedAt'))[_0x1bc6('0x11')](_0x1bc6('0x12'))['toString']();}},'closedAt':{'type':Sequelize[_0x1bc6('0x10')],'get':function(){return moment(this[_0x1bc6('0x6')](_0x1bc6('0xe')))[_0x1bc6('0x11')](_0x1bc6('0x12'))[_0x1bc6('0x13')]();}},'createdAt':{'type':Sequelize[_0x1bc6('0x10')],'get':function(){return moment(this[_0x1bc6('0x6')](_0x1bc6('0x14')))[_0x1bc6('0x11')](_0x1bc6('0x12'))[_0x1bc6('0x13')]();}},'updatedAt':{'type':Sequelize[_0x1bc6('0x10')],'get':function(){return moment(this[_0x1bc6('0x6')](_0x1bc6('0x15')))[_0x1bc6('0x11')](_0x1bc6('0x12'))[_0x1bc6('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 39584d2..66e4e2b 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 _0x3deb=['filter','merge','map','VIRTUAL','field','options','count','include','findAll','rows','catch','show','ScreenRecording','find','create','body','duration','createdAt','closedAt','value','params','describe','download','type','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x13dcf9,_0x20012e){var _0x2667b7=function(_0x1e0ca5){while(--_0x1e0ca5){_0x13dcf9['push'](_0x13dcf9['shift']());}};_0x2667b7(++_0x20012e);}(_0x3deb,0x1a8));var _0xb3de=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x3deb[_0x5d2803];return _0xdcad2c;};'use strict';var pdf=require(_0xb3de('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb3de('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3de('0x2'));var moment=require(_0xb3de('0x3'));var BPromise=require(_0xb3de('0x4'));var Mustache=require(_0xb3de('0x5'));var util=require(_0xb3de('0x6'));var path=require(_0xb3de('0x7'));var sox=require(_0xb3de('0x8'));var csv=require(_0xb3de('0x9'));var ejs=require(_0xb3de('0xa'));var fs=require('fs');var _=require(_0xb3de('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb3de('0xc'));var deskjs=require(_0xb3de('0xd'));var toCsv=require(_0xb3de('0x9'));var querystring=require(_0xb3de('0xe'));var Papa=require(_0xb3de('0xf'));var Redis=require(_0xb3de('0x10'));var authService=require(_0xb3de('0x11'));var qs=require(_0xb3de('0x12'));var hardwareService=require(_0xb3de('0x13'));var logger=require(_0xb3de('0x14'))(_0xb3de('0x15'));var utils=require(_0xb3de('0x16'));var config=require(_0xb3de('0x17'));var db=require(_0xb3de('0x18'))['db'];function respondWithStatusCode(_0x34b48e,_0x4de2bf){_0x4de2bf=_0x4de2bf||0xcc;return function(_0x114193){if(_0x114193){return _0x34b48e[_0xb3de('0x19')](_0x4de2bf);}return _0x34b48e[_0xb3de('0x1a')](_0x4de2bf)[_0xb3de('0x1b')]();};}function respondWithResult(_0x27478b,_0x4c3b8a){_0x4c3b8a=_0x4c3b8a||0xc8;return function(_0xe98448){if(_0xe98448){return _0x27478b['status'](_0x4c3b8a)['json'](_0xe98448);}};}function respondWithFilteredResult(_0x5d7b70,_0x427f5f){return function(_0x4547ae){if(_0x4547ae){var _0xd020e0=_0x4547ae['count'],_0x3515e8=_0x427f5f[_0xb3de('0x1c')],_0x353546=_0x427f5f['offset']+_0x427f5f['limit'],_0x3ad131;if(_0x353546>=_0xd020e0){_0x353546=_0xd020e0;_0x3ad131=0xc8;}else{_0x3ad131=0xce;}_0x5d7b70[_0xb3de('0x1a')](_0x3ad131);return _0x5d7b70[_0xb3de('0x1d')](_0xb3de('0x1e'),_0x3515e8+'-'+_0x353546+'/'+_0xd020e0)['json'](_0x4547ae);}return null;};}function patchUpdates(_0x16b485){return function(_0x3a3e14){try{jsonpatch[_0xb3de('0x1f')](_0x3a3e14,_0x16b485,!![]);}catch(_0x2a84de){return BPromise[_0xb3de('0x20')](_0x2a84de);}return _0x3a3e14['save']();};}function saveUpdates(_0x3f489f,_0x1ca565){return function(_0x30fc38){if(_0x30fc38){return _0x30fc38[_0xb3de('0x21')](_0x3f489f)[_0xb3de('0x22')](function(_0xdc9b75){return _0xdc9b75;});}return null;};}function removeEntity(_0x23528f,_0x2430d4){return function(_0x5b4b46){if(_0x5b4b46){return _0x5b4b46[_0xb3de('0x23')]()[_0xb3de('0x22')](function(){_0x23528f['status'](0xcc)[_0xb3de('0x1b')]();});}};}function handleEntityNotFound(_0xd08864,_0x73b9f6){return function(_0x1313a1){if(!_0x1313a1){_0xd08864[_0xb3de('0x19')](0x194);}return _0x1313a1;};}function handleError(_0x4da9d1,_0x5863d2){_0x5863d2=_0x5863d2||0x1f4;return function(_0x28c46a){logger[_0xb3de('0x24')](_0x28c46a[_0xb3de('0x25')]);if(_0x28c46a[_0xb3de('0x26')]){delete _0x28c46a[_0xb3de('0x26')];}_0x4da9d1[_0xb3de('0x1a')](_0x5863d2)[_0xb3de('0x27')](_0x28c46a);};}exports['index']=function(_0x1923d6,_0x3aa5ae){var _0x54d341={},_0x4ed962={},_0x257bce={'count':0x0,'rows':[]};var _0x130683=db['ScreenRecording'][_0xb3de('0x28')];_0x4ed962[_0xb3de('0x29')]=_[_0xb3de('0x2a')](_[_0xb3de('0x2b')](_0x130683),['format']);_0x4ed962[_0xb3de('0x2c')]=_[_0xb3de('0x2b')](_0x1923d6[_0xb3de('0x2c')]);_0x4ed962[_0xb3de('0x2d')]=_[_0xb3de('0x2e')](_0x4ed962[_0xb3de('0x29')],_0x4ed962[_0xb3de('0x2c')]);_0x54d341['attributes']=_[_0xb3de('0x2e')](_0x4ed962[_0xb3de('0x29')],qs['fields'](_0x1923d6[_0xb3de('0x2c')][_0xb3de('0x2f')]));_0x54d341[_0xb3de('0x30')]=_0x54d341['attributes'][_0xb3de('0x31')]?_0x54d341['attributes']:_0x4ed962['model'];if(!_0x1923d6[_0xb3de('0x2c')][_0xb3de('0x32')](_0xb3de('0x33'))){_0x54d341[_0xb3de('0x34')]=qs[_0xb3de('0x34')](_0x1923d6[_0xb3de('0x2c')][_0xb3de('0x34')]);_0x54d341[_0xb3de('0x1c')]=qs[_0xb3de('0x1c')](_0x1923d6[_0xb3de('0x2c')][_0xb3de('0x1c')]);}_0x54d341[_0xb3de('0x35')]=qs['sort'](_0x1923d6[_0xb3de('0x2c')][_0xb3de('0x36')]);_0x54d341[_0xb3de('0x37')]=qs[_0xb3de('0x2d')](_['pick'](_0x1923d6[_0xb3de('0x2c')],_0x4ed962['filters']));if(_0x1923d6[_0xb3de('0x2c')][_0xb3de('0x38')]){_0x54d341[_0xb3de('0x37')]=_[_0xb3de('0x39')](_0x54d341[_0xb3de('0x37')],{'$or':_[_0xb3de('0x3a')](_0x130683,function(_0xad2e2d){if(_0xad2e2d['type']['key']!==_0xb3de('0x3b')){var _0x35aee2={};_0x35aee2[_0xad2e2d[_0xb3de('0x3c')]]={'$like':'%'+_0x1923d6[_0xb3de('0x2c')][_0xb3de('0x38')]+'%'};return _0x35aee2;}})});}_0x54d341=_['merge']({},_0x54d341,_0x1923d6[_0xb3de('0x3d')]);var _0x3dce93={'where':_0x54d341['where']};return db['ScreenRecording'][_0xb3de('0x3e')](_0x3dce93)[_0xb3de('0x22')](function(_0x5e86bf){_0x257bce[_0xb3de('0x3e')]=_0x5e86bf;if(_0x1923d6[_0xb3de('0x2c')]['includeAll']){_0x54d341[_0xb3de('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0xb3de('0x40')](_0x54d341);})[_0xb3de('0x22')](function(_0x45bedc){_0x257bce[_0xb3de('0x41')]=_0x45bedc;return _0x257bce;})[_0xb3de('0x22')](respondWithFilteredResult(_0x3aa5ae,_0x54d341))[_0xb3de('0x42')](handleError(_0x3aa5ae,null));};exports[_0xb3de('0x43')]=function(_0x402040,_0x204ed9){var _0x2348a3={'raw':![],'where':{'id':_0x402040['params']['id']}},_0x28f914={};_0x28f914[_0xb3de('0x29')]=_[_0xb3de('0x2b')](db['ScreenRecording'][_0xb3de('0x28')]);_0x28f914[_0xb3de('0x2c')]=_[_0xb3de('0x2b')](_0x402040[_0xb3de('0x2c')]);_0x28f914[_0xb3de('0x2d')]=_[_0xb3de('0x2e')](_0x28f914[_0xb3de('0x29')],_0x28f914['query']);_0x2348a3[_0xb3de('0x30')]=_[_0xb3de('0x2e')](_0x28f914[_0xb3de('0x29')],qs[_0xb3de('0x2f')](_0x402040['query'][_0xb3de('0x2f')]));_0x2348a3[_0xb3de('0x30')]=_0x2348a3[_0xb3de('0x30')][_0xb3de('0x31')]?_0x2348a3[_0xb3de('0x30')]:_0x28f914[_0xb3de('0x29')];if(_0x402040[_0xb3de('0x2c')]['includeAll']){_0x2348a3[_0xb3de('0x3f')]=[{'all':!![]}];}_0x2348a3=_[_0xb3de('0x39')]({},_0x2348a3,_0x402040[_0xb3de('0x3d')]);return db[_0xb3de('0x44')][_0xb3de('0x45')](_0x2348a3)['then'](handleEntityNotFound(_0x204ed9,null))[_0xb3de('0x22')](respondWithResult(_0x204ed9,null))[_0xb3de('0x42')](handleError(_0x204ed9,null));};exports['create']=function(_0x24c718,_0x155d5a){return db[_0xb3de('0x44')][_0xb3de('0x46')](_0x24c718[_0xb3de('0x47')],{})[_0xb3de('0x22')](respondWithResult(_0x155d5a,0xc9))['catch'](handleError(_0x155d5a,null));};exports[_0xb3de('0x21')]=function(_0x2a639b,_0x2f319a){if(_0x2a639b['body']['id']){delete _0x2a639b[_0xb3de('0x47')]['id'];}delete _0x2a639b[_0xb3de('0x47')][_0xb3de('0x48')];delete _0x2a639b[_0xb3de('0x47')][_0xb3de('0x49')];delete _0x2a639b[_0xb3de('0x47')][_0xb3de('0x4a')];delete _0x2a639b[_0xb3de('0x47')][_0xb3de('0x4b')];return db[_0xb3de('0x44')]['find']({'where':{'id':_0x2a639b[_0xb3de('0x4c')]['id']}})[_0xb3de('0x22')](handleEntityNotFound(_0x2f319a,null))[_0xb3de('0x22')](saveUpdates(_0x2a639b[_0xb3de('0x47')],null))[_0xb3de('0x22')](respondWithResult(_0x2f319a,null))[_0xb3de('0x42')](handleError(_0x2f319a,null));};exports[_0xb3de('0x23')]=function(_0x3f34fc,_0x6649d7){return db[_0xb3de('0x44')][_0xb3de('0x45')]({'where':{'id':_0x3f34fc['params']['id']}})[_0xb3de('0x22')](handleEntityNotFound(_0x6649d7,null))['then'](removeEntity(_0x6649d7,null))['catch'](handleError(_0x6649d7,null));};exports['describe']=function(_0x1455d4,_0x59c8ac){return db['ScreenRecording'][_0xb3de('0x4d')]()[_0xb3de('0x22')](respondWithResult(_0x59c8ac,null))[_0xb3de('0x42')](handleError(_0x59c8ac,null));};exports[_0xb3de('0x4e')]=function(_0x257667,_0x2938d4,_0x1b3038){var _0x4d814a=require('../../components/encryptor');var _0x17d5ee=![];var _0x585f24={};if(_0x257667[_0xb3de('0x2c')][_0xb3de('0x4f')]&&_0x257667[_0xb3de('0x2c')][_0xb3de('0x4f')]===_0xb3de('0x50')){_0x585f24[_0xb3de('0x50')]=_0x257667[_0xb3de('0x4c')]['id'];}else{_0x585f24['id']=_0x257667[_0xb3de('0x4c')]['id'];}return db[_0xb3de('0x44')][_0xb3de('0x45')]({'where':_0x585f24,'attributes':['id',_0xb3de('0x4b')],'raw':!![]})[_0xb3de('0x22')](handleEntityNotFound(_0x2938d4,null))['then'](function(_0x1bff40){if(_0x1bff40){var _0x5c7bb8=path[_0xb3de('0x51')](config[_0xb3de('0x52')],_0xb3de('0x53'),_0x1bff40[_0xb3de('0x4b')]);var _0x5d03cc=util[_0xb3de('0x54')](_0xb3de('0x55'),_0x5c7bb8);if(fs[_0xb3de('0x56')](_0x5d03cc)){_0x17d5ee=!![];return _0x4d814a[_0xb3de('0x57')](_0x5d03cc,_0x5c7bb8,config['secrets'][_0xb3de('0x58')])[_0xb3de('0x22')](function(){return _0x1bff40;});}return _0x1bff40;}})['then'](function(_0x5f119c){if(_0x5f119c){var _0x41c993=path[_0xb3de('0x51')](config[_0xb3de('0x52')],_0xb3de('0x53'),_0x5f119c['value']);if(!fs[_0xb3de('0x56')](_0x41c993)){throw new db['Sequelize'][(_0xb3de('0x59'))](_0xb3de('0x5a'));}if(_0x5f119c[_0xb3de('0x5b')]){return _0x2938d4[_0xb3de('0x4e')](_0x41c993,_0x5f119c[_0xb3de('0x5b')]+path[_0xb3de('0x5c')](_0x41c993),function(){if(_0x17d5ee){fs[_0xb3de('0x5d')](_0x41c993);}});}else{return _0x2938d4[_0xb3de('0x4e')](_0x41c993,function(_0x257204){if(_0x17d5ee){fs['unlink'](_0x41c993);}});}}})[_0xb3de('0x42')](function(_0xe3bd81){if(_0xe3bd81[_0xb3de('0x5e')]===_0xb3de('0x5a')){_0x2938d4[_0xb3de('0x1a')](0x194)[_0xb3de('0x27')](_0xb3de('0x5f'));}else{return handleError(_0x2938d4,null);}});}; \ No newline at end of file +var _0x63f5=['download','../../components/encryptor','type','uniqueid','join','root','server/files/screen_recordings','existsSync','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','reject','save','update','then','destroy','error','name','send','rawAttributes','model','keys','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','ScreenRecording','findAll','rows','catch','show','params','includeAll','find','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0x63f5,0x1d3));var _0x563f=function(_0x170eb7,_0x1ac59b){_0x170eb7=_0x170eb7-0x0;var _0x4dfeac=_0x63f5[_0x170eb7];return _0x4dfeac;};'use strict';var pdf=require(_0x563f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x563f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x563f('0x2'));var rp=require(_0x563f('0x3'));var moment=require(_0x563f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x563f('0x5'));var path=require(_0x563f('0x6'));var sox=require(_0x563f('0x7'));var csv=require(_0x563f('0x8'));var ejs=require(_0x563f('0x9'));var fs=require('fs');var _=require(_0x563f('0xa'));var squel=require(_0x563f('0xb'));var crypto=require(_0x563f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x563f('0xd'));var Papa=require('papaparse');var Redis=require(_0x563f('0xe'));var authService=require(_0x563f('0xf'));var qs=require(_0x563f('0x10'));var hardwareService=require(_0x563f('0x11'));var logger=require(_0x563f('0x12'))(_0x563f('0x13'));var utils=require(_0x563f('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x507c0f,_0x364fc8){_0x364fc8=_0x364fc8||0xcc;return function(_0x1af3fc){if(_0x1af3fc){return _0x507c0f[_0x563f('0x15')](_0x364fc8);}return _0x507c0f['status'](_0x364fc8)[_0x563f('0x16')]();};}function respondWithResult(_0xe8a2f1,_0x4ef2cd){_0x4ef2cd=_0x4ef2cd||0xc8;return function(_0x57bf1b){if(_0x57bf1b){return _0xe8a2f1[_0x563f('0x17')](_0x4ef2cd)[_0x563f('0x18')](_0x57bf1b);}};}function respondWithFilteredResult(_0x284669,_0x34bca3){return function(_0xe6995){if(_0xe6995){var _0x4646d2=_0xe6995[_0x563f('0x19')],_0x2a6dfe=_0x34bca3['offset'],_0x466355=_0x34bca3[_0x563f('0x1a')]+_0x34bca3[_0x563f('0x1b')],_0x2f16ab;if(_0x466355>=_0x4646d2){_0x466355=_0x4646d2;_0x2f16ab=0xc8;}else{_0x2f16ab=0xce;}_0x284669['status'](_0x2f16ab);return _0x284669[_0x563f('0x1c')]('Content-Range',_0x2a6dfe+'-'+_0x466355+'/'+_0x4646d2)['json'](_0xe6995);}return null;};}function patchUpdates(_0xf80027){return function(_0x597b4c){try{jsonpatch['apply'](_0x597b4c,_0xf80027,!![]);}catch(_0x3d78b4){return BPromise[_0x563f('0x1d')](_0x3d78b4);}return _0x597b4c[_0x563f('0x1e')]();};}function saveUpdates(_0x582d6a,_0x95fb72){return function(_0x4aea4a){if(_0x4aea4a){return _0x4aea4a[_0x563f('0x1f')](_0x582d6a)[_0x563f('0x20')](function(_0x3df32b){return _0x3df32b;});}return null;};}function removeEntity(_0x286665,_0x39fa47){return function(_0x2796f6){if(_0x2796f6){return _0x2796f6[_0x563f('0x21')]()[_0x563f('0x20')](function(){_0x286665[_0x563f('0x17')](0xcc)[_0x563f('0x16')]();});}};}function handleEntityNotFound(_0x4080f2,_0x52548b){return function(_0x320016){if(!_0x320016){_0x4080f2[_0x563f('0x15')](0x194);}return _0x320016;};}function handleError(_0xf36fbf,_0x255298){_0x255298=_0x255298||0x1f4;return function(_0x3bb174){logger[_0x563f('0x22')](_0x3bb174['stack']);if(_0x3bb174[_0x563f('0x23')]){delete _0x3bb174[_0x563f('0x23')];}_0xf36fbf[_0x563f('0x17')](_0x255298)[_0x563f('0x24')](_0x3bb174);};}exports['index']=function(_0x288ed5,_0x56a52e){var _0x49dc3b={},_0x2a9987={},_0x4d06ed={'count':0x0,'rows':[]};var _0x5ccdb2=db['ScreenRecording'][_0x563f('0x25')];_0x2a9987[_0x563f('0x26')]=_['differenceBy'](_[_0x563f('0x27')](_0x5ccdb2),[_0x563f('0x28')]);_0x2a9987[_0x563f('0x29')]=_[_0x563f('0x27')](_0x288ed5['query']);_0x2a9987[_0x563f('0x2a')]=_[_0x563f('0x2b')](_0x2a9987[_0x563f('0x26')],_0x2a9987['query']);_0x49dc3b[_0x563f('0x2c')]=_[_0x563f('0x2b')](_0x2a9987['model'],qs[_0x563f('0x2d')](_0x288ed5['query'][_0x563f('0x2d')]));_0x49dc3b['attributes']=_0x49dc3b[_0x563f('0x2c')][_0x563f('0x2e')]?_0x49dc3b[_0x563f('0x2c')]:_0x2a9987[_0x563f('0x26')];if(!_0x288ed5[_0x563f('0x29')][_0x563f('0x2f')](_0x563f('0x30'))){_0x49dc3b[_0x563f('0x1b')]=qs[_0x563f('0x1b')](_0x288ed5['query']['limit']);_0x49dc3b['offset']=qs[_0x563f('0x1a')](_0x288ed5[_0x563f('0x29')][_0x563f('0x1a')]);}_0x49dc3b[_0x563f('0x31')]=qs[_0x563f('0x32')](_0x288ed5[_0x563f('0x29')][_0x563f('0x32')]);_0x49dc3b[_0x563f('0x33')]=qs[_0x563f('0x2a')](_[_0x563f('0x34')](_0x288ed5['query'],_0x2a9987[_0x563f('0x2a')]));if(_0x288ed5['query']['filter']){_0x49dc3b['where']=_[_0x563f('0x35')](_0x49dc3b['where'],{'$or':_['map'](_0x5ccdb2,function(_0x139ea4){if(_0x139ea4['type']['key']!==_0x563f('0x36')){var _0x200fab={};_0x200fab[_0x139ea4['field']]={'$like':'%'+_0x288ed5[_0x563f('0x29')][_0x563f('0x37')]+'%'};return _0x200fab;}})});}_0x49dc3b=_['merge']({},_0x49dc3b,_0x288ed5[_0x563f('0x38')]);var _0x4cbcb2={'where':_0x49dc3b['where']};return db['ScreenRecording']['count'](_0x4cbcb2)[_0x563f('0x20')](function(_0x3db3d1){_0x4d06ed[_0x563f('0x19')]=_0x3db3d1;if(_0x288ed5['query']['includeAll']){_0x49dc3b[_0x563f('0x39')]=[{'all':!![]}];}return db[_0x563f('0x3a')][_0x563f('0x3b')](_0x49dc3b);})[_0x563f('0x20')](function(_0x112768){_0x4d06ed[_0x563f('0x3c')]=_0x112768;return _0x4d06ed;})[_0x563f('0x20')](respondWithFilteredResult(_0x56a52e,_0x49dc3b))[_0x563f('0x3d')](handleError(_0x56a52e,null));};exports[_0x563f('0x3e')]=function(_0x5b7d10,_0x2f1a81){var _0x1ce6e9={'raw':![],'where':{'id':_0x5b7d10[_0x563f('0x3f')]['id']}},_0x41c303={};_0x41c303[_0x563f('0x26')]=_[_0x563f('0x27')](db[_0x563f('0x3a')]['rawAttributes']);_0x41c303[_0x563f('0x29')]=_[_0x563f('0x27')](_0x5b7d10[_0x563f('0x29')]);_0x41c303[_0x563f('0x2a')]=_[_0x563f('0x2b')](_0x41c303[_0x563f('0x26')],_0x41c303[_0x563f('0x29')]);_0x1ce6e9['attributes']=_[_0x563f('0x2b')](_0x41c303['model'],qs['fields'](_0x5b7d10['query'][_0x563f('0x2d')]));_0x1ce6e9[_0x563f('0x2c')]=_0x1ce6e9[_0x563f('0x2c')][_0x563f('0x2e')]?_0x1ce6e9[_0x563f('0x2c')]:_0x41c303['model'];if(_0x5b7d10[_0x563f('0x29')][_0x563f('0x40')]){_0x1ce6e9['include']=[{'all':!![]}];}_0x1ce6e9=_[_0x563f('0x35')]({},_0x1ce6e9,_0x5b7d10[_0x563f('0x38')]);return db[_0x563f('0x3a')][_0x563f('0x41')](_0x1ce6e9)[_0x563f('0x20')](handleEntityNotFound(_0x2f1a81,null))[_0x563f('0x20')](respondWithResult(_0x2f1a81,null))[_0x563f('0x3d')](handleError(_0x2f1a81,null));};exports['create']=function(_0x4fd093,_0x297a2a){return db[_0x563f('0x3a')][_0x563f('0x42')](_0x4fd093[_0x563f('0x43')],{})['then'](respondWithResult(_0x297a2a,0xc9))[_0x563f('0x3d')](handleError(_0x297a2a,null));};exports[_0x563f('0x1f')]=function(_0x1fc131,_0x382dff){if(_0x1fc131[_0x563f('0x43')]['id']){delete _0x1fc131[_0x563f('0x43')]['id'];}delete _0x1fc131['body'][_0x563f('0x44')];delete _0x1fc131[_0x563f('0x43')][_0x563f('0x45')];delete _0x1fc131[_0x563f('0x43')][_0x563f('0x46')];delete _0x1fc131[_0x563f('0x43')][_0x563f('0x47')];return db[_0x563f('0x3a')][_0x563f('0x41')]({'where':{'id':_0x1fc131[_0x563f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x382dff,null))[_0x563f('0x20')](saveUpdates(_0x1fc131[_0x563f('0x43')],null))['then'](respondWithResult(_0x382dff,null))[_0x563f('0x3d')](handleError(_0x382dff,null));};exports[_0x563f('0x21')]=function(_0x429af9,_0x5b12fa){return db[_0x563f('0x3a')][_0x563f('0x41')]({'where':{'id':_0x429af9['params']['id']}})[_0x563f('0x20')](handleEntityNotFound(_0x5b12fa,null))[_0x563f('0x20')](removeEntity(_0x5b12fa,null))[_0x563f('0x3d')](handleError(_0x5b12fa,null));};exports['describe']=function(_0x51f742,_0x44aaa6){return db[_0x563f('0x3a')][_0x563f('0x48')]()[_0x563f('0x20')](respondWithResult(_0x44aaa6,null))[_0x563f('0x3d')](handleError(_0x44aaa6,null));};exports[_0x563f('0x49')]=function(_0x1c0f6f,_0x10ef95,_0x32e99f){var _0x2df097=require(_0x563f('0x4a'));var _0x51852d=![];var _0x55f63a={};if(_0x1c0f6f[_0x563f('0x29')][_0x563f('0x4b')]&&_0x1c0f6f['query'][_0x563f('0x4b')]===_0x563f('0x4c')){_0x55f63a[_0x563f('0x4c')]=_0x1c0f6f[_0x563f('0x3f')]['id'];}else{_0x55f63a['id']=_0x1c0f6f[_0x563f('0x3f')]['id'];}return db[_0x563f('0x3a')][_0x563f('0x41')]({'where':_0x55f63a,'attributes':['id',_0x563f('0x47')],'raw':!![]})[_0x563f('0x20')](handleEntityNotFound(_0x10ef95,null))[_0x563f('0x20')](function(_0x3c018e){if(_0x3c018e){var _0x37f3ef=path[_0x563f('0x4d')](config[_0x563f('0x4e')],_0x563f('0x4f'),_0x3c018e[_0x563f('0x47')]);var _0x59a6b9=util[_0x563f('0x28')]('%s.cypher',_0x37f3ef);if(fs[_0x563f('0x50')](_0x59a6b9)){_0x51852d=!![];return _0x2df097['decryptFile'](_0x59a6b9,_0x37f3ef,config[_0x563f('0x51')][_0x563f('0x52')])[_0x563f('0x20')](function(){return _0x3c018e;});}return _0x3c018e;}})[_0x563f('0x20')](function(_0x1ebd49){if(_0x1ebd49){var _0x5f4346=path[_0x563f('0x4d')](config[_0x563f('0x4e')],'server/files/screen_recordings',_0x1ebd49[_0x563f('0x47')]);if(!fs['existsSync'](_0x5f4346)){throw new db['Sequelize'][(_0x563f('0x53'))](_0x563f('0x54'));}if(_0x1ebd49[_0x563f('0x55')]){return _0x10ef95[_0x563f('0x49')](_0x5f4346,_0x1ebd49['filename']+path[_0x563f('0x56')](_0x5f4346),function(){if(_0x51852d){fs[_0x563f('0x57')](_0x5f4346);}});}else{return _0x10ef95[_0x563f('0x49')](_0x5f4346,function(_0x2425e4){if(_0x51852d){fs[_0x563f('0x57')](_0x5f4346);}});}}})['catch'](function(_0x2971cd){if(_0x2971cd[_0x563f('0x58')]==='ScreenRecording\x20not\x20found'){_0x10ef95[_0x563f('0x17')](0x194)[_0x563f('0x24')](_0x563f('0x59'));}else{return handleError(_0x10ef95,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5562f2f..7a47362 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 _0x183c=['root','files','value','existsSync','log','resolve','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','join'];(function(_0xa12e0b,_0x4f7379){var _0xd71996=function(_0x2259de){while(--_0x2259de){_0xa12e0b['push'](_0xa12e0b['shift']());}};_0xd71996(++_0x4f7379);}(_0x183c,0x187));var _0xc183=function(_0x4221e6,_0x185c14){_0x4221e6=_0x4221e6-0x0;var _0x767b81=_0x183c[_0x4221e6];return _0x767b81;};'use strict';var _=require(_0xc183('0x0'));var util=require(_0xc183('0x1'));var logger=require(_0xc183('0x2'))(_0xc183('0x3'));var moment=require(_0xc183('0x4'));var BPromise=require(_0xc183('0x5'));var rp=require(_0xc183('0x6'));var fs=require('fs');var path=require(_0xc183('0x7'));var rimraf=require(_0xc183('0x8'));var config=require(_0xc183('0x9'));var attributes=require(_0xc183('0xa'));module[_0xc183('0xb')]=function(_0xe3d6bf,_0x59ffad){return _0xe3d6bf[_0xc183('0xc')](_0xc183('0xd'),attributes,{'tableName':_0xc183('0xe'),'paranoid':![],'indexes':[{'name':_0xc183('0xf'),'fields':[_0xc183('0xf')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x46b111,_0xd7403c,_0x3bea42){return new BPromise(function(_0x10b176,_0x4dcca4){if(!_['isNil'](_0x46b111['value'])){var _0x298bc5=path[_0xc183('0x10')](config[_0xc183('0x11')],'server',_0xc183('0x12'),_0xc183('0xe'),_0x46b111[_0xc183('0x13')]);if(fs[_0xc183('0x14')](_0x298bc5)){rimraf(_0x298bc5,function(_0x3f55e6){if(_0x3f55e6){console[_0xc183('0x15')](_0x3f55e6);}});}}_0x10b176();})['catch'](function(_0x202121){BPromise[_0xc183('0x16')]();})[_0xc183('0x17')](function(){_0x3bea42();});}}});}; \ No newline at end of file +var _0x014f=['catch','resolve','finally','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','screen_recordings','interactionid','isNil','value','join','root','server','files','existsSync','log'];(function(_0x49d7c8,_0x52d9a3){var _0x450089=function(_0x1ed0d7){while(--_0x1ed0d7){_0x49d7c8['push'](_0x49d7c8['shift']());}};_0x450089(++_0x52d9a3);}(_0x014f,0x1e3));var _0xf014=function(_0x4ac58a,_0x9e8807){_0x4ac58a=_0x4ac58a-0x0;var _0x525340=_0x014f[_0x4ac58a];return _0x525340;};'use strict';var _=require(_0xf014('0x0'));var util=require(_0xf014('0x1'));var logger=require(_0xf014('0x2'))(_0xf014('0x3'));var moment=require(_0xf014('0x4'));var BPromise=require(_0xf014('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf014('0x6'));var rimraf=require(_0xf014('0x7'));var config=require(_0xf014('0x8'));var attributes=require('./screenRecording.attributes');module[_0xf014('0x9')]=function(_0x3400d8,_0x402d7e){return _0x3400d8[_0xf014('0xa')]('ScreenRecording',attributes,{'tableName':_0xf014('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xf014('0xc')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x3c80ff,_0x27db90,_0x5dc97a){return new BPromise(function(_0xa6115,_0x41783a){if(!_[_0xf014('0xd')](_0x3c80ff[_0xf014('0xe')])){var _0x40af5d=path[_0xf014('0xf')](config[_0xf014('0x10')],_0xf014('0x11'),_0xf014('0x12'),_0xf014('0xb'),_0x3c80ff[_0xf014('0xe')]);if(fs[_0xf014('0x13')](_0x40af5d)){rimraf(_0x40af5d,function(_0x418842){if(_0x418842){console[_0xf014('0x14')](_0x418842);}});}}_0xa6115();})[_0xf014('0x15')](function(_0x4b9b59){BPromise[_0xf014('0x16')]();})[_0xf014('0x17')](function(){_0x5dc97a();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index e2dc50c..fb3fc7d 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 _0x303a=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x303a,0x1a0));var _0xa303=function(_0x55e9e9,_0x1afc74){_0x55e9e9=_0x55e9e9-0x0;var _0x39cb0c=_0x303a[_0x55e9e9];return _0x39cb0c;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});} \ No newline at end of file +var _0x50a6=['../../config/environment','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d3cea,_0x2d2135){var _0x81a5d5=function(_0x3a7c5a){while(--_0x3a7c5a){_0x1d3cea['push'](_0x1d3cea['shift']());}};_0x81a5d5(++_0x2d2135);}(_0x50a6,0xa4));var _0x650a=function(_0x4738b7,_0x9096f0){_0x4738b7=_0x4738b7-0x0;var _0x47cb9e=_0x50a6[_0x4738b7];return _0x47cb9e;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 698a849..fd1f15d 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 _0x4680=['originalname','post','single','file','addLogoLogin','preferred','put','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname'];(function(_0x5665e9,_0x5cd2db){var _0x6e6a80=function(_0x1d6c84){while(--_0x1d6c84){_0x5665e9['push'](_0x5665e9['shift']());}};_0x6e6a80(++_0x5cd2db);}(_0x4680,0x106));var _0x0468=function(_0x469964,_0xff19e4){_0x469964=_0x469964-0x0;var _0x3d1bcf=_0x4680[_0x469964];return _0x3d1bcf;};'use strict';var multer=require(_0x0468('0x0'));var util=require(_0x0468('0x1'));var path=require(_0x0468('0x2'));var timeout=require(_0x0468('0x3'));var express=require('express');var router=express[_0x0468('0x4')]();var auth=require(_0x0468('0x5'));var interaction=require(_0x0468('0x6'));var config=require(_0x0468('0x7'));var controller=require(_0x0468('0x8'));router[_0x0468('0x9')]('/',auth[_0x0468('0xa')](),controller[_0x0468('0xb')]);router[_0x0468('0x9')]('/:id',controller[_0x0468('0xc')]);router[_0x0468('0x9')](_0x0468('0xd'),controller['getLogo']);router[_0x0468('0x9')](_0x0468('0xe'),controller[_0x0468('0xf')]);router[_0x0468('0x9')](_0x0468('0x10'),controller['gdpr']);router[_0x0468('0x9')](_0x0468('0x11'),controller['getPreferred']);var upload=multer({'storage':multer[_0x0468('0x12')]({'destination':function(_0x4fef6a,_0x5fd5d4,_0x573dc1){_0x573dc1(null,path[_0x0468('0x13')](config[_0x0468('0x14')],_0x0468('0x15')));},'filename':function(_0x290c4d,_0x20c3fa,_0x3fee51){_0x3fee51(null,util[_0x0468('0x16')](_0x0468('0x17'),_0x0468('0x18'),path[_0x0468('0x19')](_0x20c3fa[_0x0468('0x1a')])));}})});router[_0x0468('0x1b')]('/:id/logo',upload[_0x0468('0x1c')](_0x0468('0x1d')),controller['addLogo']);var upload=multer({'storage':multer[_0x0468('0x12')]({'destination':function(_0x3c7ace,_0x307ca2,_0x3a3001){_0x3a3001(null,path['join'](config[_0x0468('0x14')],_0x0468('0x15')));},'filename':function(_0x204cb5,_0xf34b81,_0x2d3437){_0x2d3437(null,util[_0x0468('0x16')](_0x0468('0x17'),'logologin',path[_0x0468('0x19')](_0xf34b81[_0x0468('0x1a')])));}})});router[_0x0468('0x1b')](_0x0468('0xe'),upload[_0x0468('0x1c')](_0x0468('0x1d')),controller[_0x0468('0x1e')]);var upload=multer({'storage':multer[_0x0468('0x12')]({'destination':function(_0x57c1a3,_0x5e087e,_0x1f8d9a){_0x1f8d9a(null,path[_0x0468('0x13')](config[_0x0468('0x14')],_0x0468('0x15')));},'filename':function(_0x146edb,_0x24fbe7,_0x5d9330){_0x5d9330(null,util['format']('%s%s',_0x0468('0x1f'),path[_0x0468('0x19')](_0x24fbe7[_0x0468('0x1a')])));}})});router[_0x0468('0x1b')](_0x0468('0x11'),upload[_0x0468('0x1c')]('file'),controller['addPreferred']);router[_0x0468('0x20')](_0x0468('0x21'),auth['isAuthenticated'](),controller[_0x0468('0x22')]);module[_0x0468('0x23')]=router; \ No newline at end of file +var _0x8199=['extname','originalname','post','single','file','addLogo','server/files/images/logos/','logologin','addLogoLogin','preferred','addPreferred','/:id','update','exports','multer','path','connect-timeout','express','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','diskStorage','join','root','format','%s%s','logo'];(function(_0x386e4e,_0x320d58){var _0x488863=function(_0x5ef1be){while(--_0x5ef1be){_0x386e4e['push'](_0x386e4e['shift']());}};_0x488863(++_0x320d58);}(_0x8199,0x1b2));var _0x9819=function(_0x146c3f,_0xf3ad48){_0x146c3f=_0x146c3f-0x0;var _0x316c56=_0x8199[_0x146c3f];return _0x316c56;};'use strict';var multer=require(_0x9819('0x0'));var util=require('util');var path=require(_0x9819('0x1'));var timeout=require(_0x9819('0x2'));var express=require(_0x9819('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9819('0x4'));var controller=require(_0x9819('0x5'));router[_0x9819('0x6')]('/',auth[_0x9819('0x7')](),controller[_0x9819('0x8')]);router['get']('/:id',controller['show']);router[_0x9819('0x6')](_0x9819('0x9'),controller['getLogo']);router[_0x9819('0x6')](_0x9819('0xa'),controller[_0x9819('0xb')]);router[_0x9819('0x6')](_0x9819('0xc'),controller['gdpr']);router[_0x9819('0x6')](_0x9819('0xd'),controller[_0x9819('0xe')]);var upload=multer({'storage':multer[_0x9819('0xf')]({'destination':function(_0xc01aea,_0x4f866c,_0x304c64){_0x304c64(null,path[_0x9819('0x10')](config[_0x9819('0x11')],'server/files/images/logos/'));},'filename':function(_0x3b59d7,_0x25ef28,_0x3e3b52){_0x3e3b52(null,util[_0x9819('0x12')](_0x9819('0x13'),_0x9819('0x14'),path[_0x9819('0x15')](_0x25ef28[_0x9819('0x16')])));}})});router[_0x9819('0x17')](_0x9819('0x9'),upload[_0x9819('0x18')](_0x9819('0x19')),controller[_0x9819('0x1a')]);var upload=multer({'storage':multer[_0x9819('0xf')]({'destination':function(_0x506d5e,_0xb55220,_0x10aa3b){_0x10aa3b(null,path[_0x9819('0x10')](config['root'],_0x9819('0x1b')));},'filename':function(_0x5e9fc5,_0x287a84,_0x4d46aa){_0x4d46aa(null,util[_0x9819('0x12')](_0x9819('0x13'),_0x9819('0x1c'),path[_0x9819('0x15')](_0x287a84[_0x9819('0x16')])));}})});router[_0x9819('0x17')]('/:id/logo_login',upload[_0x9819('0x18')](_0x9819('0x19')),controller[_0x9819('0x1d')]);var upload=multer({'storage':multer[_0x9819('0xf')]({'destination':function(_0x49a598,_0x574867,_0x20bd71){_0x20bd71(null,path[_0x9819('0x10')](config[_0x9819('0x11')],_0x9819('0x1b')));},'filename':function(_0x11bbc5,_0x48c2d0,_0x1ac4cd){_0x1ac4cd(null,util['format'](_0x9819('0x13'),_0x9819('0x1e'),path[_0x9819('0x15')](_0x48c2d0[_0x9819('0x16')])));}})});router['post'](_0x9819('0xd'),upload[_0x9819('0x18')](_0x9819('0x19')),controller[_0x9819('0x1f')]);router['put'](_0x9819('0x20'),auth[_0x9819('0x7')](),controller[_0x9819('0x21')]);module[_0x9819('0x22')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 92da388..5a0ed13 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 _0xefe3=['sequelize','INTEGER','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xefe3,0xf5));var _0x3efe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xefe3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3efe('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x3efe('0x1')](0xb),'unique':_0x3efe('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x3efe('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x3efe('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x3efe('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x3efe('0x3')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x3efe('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x3efe('0x3')]},'turnaddr':{'type':Sequelize[_0x3efe('0x3')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x3efe('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x3efe('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x3efe('0x3')],'defaultValue':_0x3efe('0x5')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x3efe('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x3efe('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x3efe('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x3efe('0x3')],'defaultValue':_0x3efe('0x6')},'chatTimeout':{'type':Sequelize[_0x3efe('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x3efe('0x3')]},'defaultPreferred':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x3efe('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x3efe('0x3')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x3efe('0x1')],'defaultValue':0xa}}; \ No newline at end of file +var _0xfc75=['alternate','sequelize','exports','INTEGER','min_internal','STRING','BOOLEAN'];(function(_0x4c82aa,_0x439b02){var _0x4a1500=function(_0x3f87b6){while(--_0x3f87b6){_0x4c82aa['push'](_0x4c82aa['shift']());}};_0x4a1500(++_0x439b02);}(_0xfc75,0xe1));var _0x5fc7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfc75[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x5fc7('0x0'));module[_0x5fc7('0x1')]={'min_internal':{'type':Sequelize[_0x5fc7('0x2')](0xb),'unique':_0x5fc7('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5fc7('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5fc7('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x5fc7('0x4')]},'defaultLogo':{'type':Sequelize[_0x5fc7('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5fc7('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5fc7('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5fc7('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5fc7('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5fc7('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x5fc7('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x5fc7('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5fc7('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x5fc7('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x5fc7('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x5fc7('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x5fc7('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x5fc7('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x5fc7('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5fc7('0x4')],'defaultValue':_0x5fc7('0x6')},'chatTimeout':{'type':Sequelize[_0x5fc7('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5fc7('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5fc7('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x5fc7('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 69cf02c..f1dd879 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 _0xa9e0=['find','params','body','readFileSync','join','server/files/templates/stun.ejs','utf8','root','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','logo','filename','catch','addLogoLogin','loginLogo','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.png','default','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','Setting','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys','length'];(function(_0x5847c0,_0x2a4703){var _0x30c80f=function(_0x1cdd27){while(--_0x1cdd27){_0x5847c0['push'](_0x5847c0['shift']());}};_0x30c80f(++_0x2a4703);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('Setting,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['update']=function(_0x53975a,_0x39d77d,_0x204173){var _0x14d602;return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x50')],null))['then'](function(_0x443e72){if(_0x443e72){_0x14d602=_0x443e72['get']({'plain':!![]});var _0x2e5e62=fs[_0x0a9e('0x51')](path[_0x0a9e('0x52')](config['root'],_0x0a9e('0x53')),_0x0a9e('0x54'));var _0x508b47=ejs['render'](_0x2e5e62,_0x14d602);var _0x128aa6=fs[_0x0a9e('0x51')](path['join'](config[_0x0a9e('0x55')],'server/files/templates/turn.ejs'),_0x0a9e('0x54'));var _0x523cd2=ejs[_0x0a9e('0x56')](_0x128aa6,_0x14d602);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x508b47);fs['writeFileSync'](_0x0a9e('0x57'),_0x523cd2);return respondWithRpcPromise('Reload',_0x0a9e('0x2b'),{'module':_0x0a9e('0x58')});}})[_0x0a9e('0x2c')](function(){return respondWithRpcPromise(_0x0a9e('0x59'),_0x0a9e('0x2b'),{'module':_0x0a9e('0x5a')});})[_0x0a9e('0x2c')](function(){return _0x14d602||null;})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,null))['catch'](handleError(_0x39d77d,null));};exports[_0x0a9e('0x5b')]=function(_0x121cef,_0x2642bb,_0x30c491){if(_0x121cef[_0x0a9e('0x5c')]&&_0x121cef[_0x0a9e('0x5c')]['filename']){_0x121cef[_0x0a9e('0x50')][_0x0a9e('0x5d')]=_0x121cef['file'][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x121cef['params']['id']}})['then'](handleEntityNotFound(_0x2642bb,null))['then'](saveUpdates(_0x121cef[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x2642bb,null))[_0x0a9e('0x5f')](handleError(_0x2642bb,null));};exports[_0x0a9e('0x60')]=function(_0x261adb,_0x7be420,_0x1cca9f){if(_0x261adb[_0x0a9e('0x5c')]&&_0x261adb['file'][_0x0a9e('0x5e')]){_0x261adb['body'][_0x0a9e('0x61')]=_0x261adb[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x261adb[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7be420,null))[_0x0a9e('0x2c')](saveUpdates(_0x261adb['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x7be420,null))[_0x0a9e('0x5f')](handleError(_0x7be420,null));};var utilLicense=require('../../config/license/util');exports[_0x0a9e('0x62')]=function(_0x17e88c,_0x88dcbf,_0x409b29){var _0x401837='server/files/images/logos';var _0x176840={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x47bb43){if(_0x47bb43){_0x176840=_0x47bb43;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x17e88c['params']['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x2c')](function(_0x2d7205){if(_0x2d7205){var _0x1cc4f3=_0x2d7205[_0x0a9e('0x5d')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_[_0x0a9e('0x69')](_0x2d7205[_0x0a9e('0x5d')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x2d7205[_0x0a9e('0x5d')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x0a9e('0x6a')));var _0x30944e='default'+_[_0x0a9e('0x6b')](_0x0a9e('0x5d'));if(_0x2d7205[_0x30944e]||!_0x176840[_0x0a9e('0x6c')]){_0x1cc4f3=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower']('default_logo.png'));}if(!fs['existsSync'](_0x1cc4f3)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x88dcbf[_0x0a9e('0x70')](_0x1cc4f3);}})[_0x0a9e('0x5f')](handleError(_0x88dcbf,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x72')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2=_0x0a9e('0x73');var _0x4a4fc7={'custom':![]};return utilLicense[_0x0a9e('0x63')]()['then'](function(_0x4437ff){if(_0x4437ff){_0x4a4fc7=_0x4437ff;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1a0677[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),'defaultLogo',_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x2c')](function(_0x5b7fc3){if(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[_0x0a9e('0x61')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config['root'],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x0a9e('0x74')));var _0xc4c230=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x61'));if(_0x5b7fc3[_0xc4c230]||!_0x4a4fc7['custom']){_0x109ccb=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')]('default_loginLogo.png'));}if(!fs[_0x0a9e('0x68')](_0x109ccb)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x5512d1['download'](_0x109ccb);}})['catch'](handleError(_0x5512d1,null));};exports[_0x0a9e('0x76')]=function(_0x2bbdb5,_0x4c54fa){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x2bbdb5[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x77')]})['then'](respondWithResult(_0x4c54fa,null))[_0x0a9e('0x5f')](handleError(_0x4c54fa,null));};exports[_0x0a9e('0x78')]=function(_0x2d2286,_0x42b959,_0x3755fe){if(_0x2d2286[_0x0a9e('0x5c')]&&_0x2d2286[_0x0a9e('0x5c')]['filename']){_0x2d2286[_0x0a9e('0x50')][_0x0a9e('0x64')]=_0x2d2286[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x2d2286[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42b959,null))[_0x0a9e('0x2c')](saveUpdates(_0x2d2286['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x42b959,null))[_0x0a9e('0x5f')](handleError(_0x42b959,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x79')]=function(_0x5af453,_0x51ccd7,_0x353384){var _0x2b9c01=_0x0a9e('0x73');var _0x5ac73d={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x524e38){if(_0x524e38){_0x5ac73d=_0x524e38;}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x5af453['params']['id']},'attributes':['logo','loginLogo',_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x51ccd7,null))[_0x0a9e('0x2c')](function(_0x5a8854){if(_0x5a8854){var _0x5fd5db=_0x5a8854['preferred']&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));var _0x255e49=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x64'));if(_0x5a8854[_0x255e49]||!_0x5ac73d['custom']||!_0x5ac73d[_0x0a9e('0x64')]){_0x5fd5db=path[_0x0a9e('0x52')](config['root'],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));}if(!fs[_0x0a9e('0x68')](_0x5fd5db)){throw new db['Sequelize'][(_0x0a9e('0x6e'))]('Logo\x20not\x20found');}return _0x51ccd7[_0x0a9e('0x70')](_0x5fd5db);}})[_0x0a9e('0x5f')](handleError(_0x51ccd7,null));}; \ No newline at end of file +var _0xa9e0=['find','params','body','readFileSync','join','server/files/templates/stun.ejs','utf8','root','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','logo','filename','catch','addLogoLogin','loginLogo','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.png','default','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','Setting','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys','length'];(function(_0x44d593,_0x39cebf){var _0x406b93=function(_0x3b4c94){while(--_0x3b4c94){_0x44d593['push'](_0x44d593['shift']());}};_0x406b93(++_0x39cebf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('Setting,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['update']=function(_0x53975a,_0x39d77d,_0x204173){var _0x14d602;return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x50')],null))['then'](function(_0x443e72){if(_0x443e72){_0x14d602=_0x443e72['get']({'plain':!![]});var _0x2e5e62=fs[_0x0a9e('0x51')](path[_0x0a9e('0x52')](config['root'],_0x0a9e('0x53')),_0x0a9e('0x54'));var _0x508b47=ejs['render'](_0x2e5e62,_0x14d602);var _0x128aa6=fs[_0x0a9e('0x51')](path['join'](config[_0x0a9e('0x55')],'server/files/templates/turn.ejs'),_0x0a9e('0x54'));var _0x523cd2=ejs[_0x0a9e('0x56')](_0x128aa6,_0x14d602);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x508b47);fs['writeFileSync'](_0x0a9e('0x57'),_0x523cd2);return respondWithRpcPromise('Reload',_0x0a9e('0x2b'),{'module':_0x0a9e('0x58')});}})[_0x0a9e('0x2c')](function(){return respondWithRpcPromise(_0x0a9e('0x59'),_0x0a9e('0x2b'),{'module':_0x0a9e('0x5a')});})[_0x0a9e('0x2c')](function(){return _0x14d602||null;})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,null))['catch'](handleError(_0x39d77d,null));};exports[_0x0a9e('0x5b')]=function(_0x121cef,_0x2642bb,_0x30c491){if(_0x121cef[_0x0a9e('0x5c')]&&_0x121cef[_0x0a9e('0x5c')]['filename']){_0x121cef[_0x0a9e('0x50')][_0x0a9e('0x5d')]=_0x121cef['file'][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x121cef['params']['id']}})['then'](handleEntityNotFound(_0x2642bb,null))['then'](saveUpdates(_0x121cef[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x2642bb,null))[_0x0a9e('0x5f')](handleError(_0x2642bb,null));};exports[_0x0a9e('0x60')]=function(_0x261adb,_0x7be420,_0x1cca9f){if(_0x261adb[_0x0a9e('0x5c')]&&_0x261adb['file'][_0x0a9e('0x5e')]){_0x261adb['body'][_0x0a9e('0x61')]=_0x261adb[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x261adb[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7be420,null))[_0x0a9e('0x2c')](saveUpdates(_0x261adb['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x7be420,null))[_0x0a9e('0x5f')](handleError(_0x7be420,null));};var utilLicense=require('../../config/license/util');exports[_0x0a9e('0x62')]=function(_0x17e88c,_0x88dcbf,_0x409b29){var _0x401837='server/files/images/logos';var _0x176840={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x47bb43){if(_0x47bb43){_0x176840=_0x47bb43;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x17e88c['params']['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x2c')](function(_0x2d7205){if(_0x2d7205){var _0x1cc4f3=_0x2d7205[_0x0a9e('0x5d')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_[_0x0a9e('0x69')](_0x2d7205[_0x0a9e('0x5d')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x2d7205[_0x0a9e('0x5d')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x0a9e('0x6a')));var _0x30944e='default'+_[_0x0a9e('0x6b')](_0x0a9e('0x5d'));if(_0x2d7205[_0x30944e]||!_0x176840[_0x0a9e('0x6c')]){_0x1cc4f3=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower']('default_logo.png'));}if(!fs['existsSync'](_0x1cc4f3)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x88dcbf[_0x0a9e('0x70')](_0x1cc4f3);}})[_0x0a9e('0x5f')](handleError(_0x88dcbf,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x72')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2=_0x0a9e('0x73');var _0x4a4fc7={'custom':![]};return utilLicense[_0x0a9e('0x63')]()['then'](function(_0x4437ff){if(_0x4437ff){_0x4a4fc7=_0x4437ff;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1a0677[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),'defaultLogo',_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x2c')](function(_0x5b7fc3){if(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[_0x0a9e('0x61')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config['root'],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x0a9e('0x74')));var _0xc4c230=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x61'));if(_0x5b7fc3[_0xc4c230]||!_0x4a4fc7['custom']){_0x109ccb=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')]('default_loginLogo.png'));}if(!fs[_0x0a9e('0x68')](_0x109ccb)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x5512d1['download'](_0x109ccb);}})['catch'](handleError(_0x5512d1,null));};exports[_0x0a9e('0x76')]=function(_0x2bbdb5,_0x4c54fa){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x2bbdb5[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x77')]})['then'](respondWithResult(_0x4c54fa,null))[_0x0a9e('0x5f')](handleError(_0x4c54fa,null));};exports[_0x0a9e('0x78')]=function(_0x2d2286,_0x42b959,_0x3755fe){if(_0x2d2286[_0x0a9e('0x5c')]&&_0x2d2286[_0x0a9e('0x5c')]['filename']){_0x2d2286[_0x0a9e('0x50')][_0x0a9e('0x64')]=_0x2d2286[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x2d2286[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42b959,null))[_0x0a9e('0x2c')](saveUpdates(_0x2d2286['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x42b959,null))[_0x0a9e('0x5f')](handleError(_0x42b959,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x79')]=function(_0x5af453,_0x51ccd7,_0x353384){var _0x2b9c01=_0x0a9e('0x73');var _0x5ac73d={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x524e38){if(_0x524e38){_0x5ac73d=_0x524e38;}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x5af453['params']['id']},'attributes':['logo','loginLogo',_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x51ccd7,null))[_0x0a9e('0x2c')](function(_0x5a8854){if(_0x5a8854){var _0x5fd5db=_0x5a8854['preferred']&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));var _0x255e49=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x64'));if(_0x5a8854[_0x255e49]||!_0x5ac73d['custom']||!_0x5ac73d[_0x0a9e('0x64')]){_0x5fd5db=path[_0x0a9e('0x52')](config['root'],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));}if(!fs[_0x0a9e('0x68')](_0x5fd5db)){throw new db['Sequelize'][(_0x0a9e('0x6e'))]('Logo\x20not\x20found');}return _0x51ccd7[_0x0a9e('0x70')](_0x5fd5db);}})[_0x0a9e('0x5f')](handleError(_0x51ccd7,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4cd11ec..88c9d80 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 _0xfcae=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','Setting','settings'];(function(_0x419e17,_0x7fe78c){var _0x1f2044=function(_0x3723e6){while(--_0x3723e6){_0x419e17['push'](_0x419e17['shift']());}};_0x1f2044(++_0x7fe78c);}(_0xfcae,0xf2));var _0xefca=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xfcae[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xefca('0x0'));var util=require(_0xefca('0x1'));var logger=require(_0xefca('0x2'))(_0xefca('0x3'));var moment=require('moment');var BPromise=require(_0xefca('0x4'));var rp=require(_0xefca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xefca('0x6'));var attributes=require('./setting.attributes');module[_0xefca('0x7')]=function(_0xa237df,_0x1f7b9c){return _0xa237df[_0xefca('0x8')](_0xefca('0x9'),attributes,{'tableName':_0xefca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5575=['path','rimraf','../../config/environment','./setting.attributes','exports','define','settings','util','../../config/logger','bluebird'];(function(_0x5da8e9,_0x3beb32){var _0x24a605=function(_0x284ab3){while(--_0x284ab3){_0x5da8e9['push'](_0x5da8e9['shift']());}};_0x24a605(++_0x3beb32);}(_0x5575,0x165));var _0x5557=function(_0x4b2a4f,_0x16435f){_0x4b2a4f=_0x4b2a4f-0x0;var _0x5d3f60=_0x5575[_0x4b2a4f];return _0x5d3f60;};'use strict';var _=require('lodash');var util=require(_0x5557('0x0'));var logger=require(_0x5557('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5557('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5557('0x3'));var rimraf=require(_0x5557('0x4'));var config=require(_0x5557('0x5'));var attributes=require(_0x5557('0x6'));module[_0x5557('0x7')]=function(_0x38b162,_0x557c0c){return _0x38b162[_0x5557('0x8')]('Setting',attributes,{'tableName':_0x5557('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 0b36a1c..27f37fb 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 _0x5d28=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5d28,0xdd));var _0x85d2=function(_0x247bac,_0xe40d86){_0x247bac=_0x247bac-0x0;var _0xe7a328=_0x5d28[_0x247bac];return _0xe7a328;};'use strict';var _=require(_0x85d2('0x0'));var util=require(_0x85d2('0x1'));var moment=require(_0x85d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x85d2('0x3'));var fs=require('fs');var Redis=require(_0x85d2('0x4'));var db=require(_0x85d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85d2('0x6'));var config=require(_0x85d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x85d2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54d1b7,_0x372297,_0x327493){return new BPromise(function(_0x4dda35,_0x3c155d){return client['request'](_0x54d1b7,_0x327493)[_0x85d2('0x9')](function(_0x3bcd4b){logger['info'](_0x85d2('0xa'),_0x372297,_0x85d2('0xb'));logger[_0x85d2('0xc')](_0x85d2('0xd'),_0x372297,_0x85d2('0xb'),JSON[_0x85d2('0xe')](_0x3bcd4b));if(_0x3bcd4b['error']){if(_0x3bcd4b[_0x85d2('0xf')]['code']===0x1f4){logger[_0x85d2('0xf')]('Setting,\x20%s,\x20%s',_0x372297,_0x3bcd4b[_0x85d2('0xf')][_0x85d2('0x10')]);return _0x3c155d(_0x3bcd4b[_0x85d2('0xf')][_0x85d2('0x10')]);}logger[_0x85d2('0xf')](_0x85d2('0xa'),_0x372297,_0x3bcd4b[_0x85d2('0xf')][_0x85d2('0x10')]);return _0x4dda35(_0x3bcd4b[_0x85d2('0xf')][_0x85d2('0x10')]);}else{logger[_0x85d2('0x11')](_0x85d2('0xa'),_0x372297,_0x85d2('0xb'));_0x4dda35(_0x3bcd4b[_0x85d2('0x12')]['message']);}})[_0x85d2('0x13')](function(_0x24f6a8){logger[_0x85d2('0xf')]('Setting,\x20%s,\x20%s',_0x372297,_0x24f6a8);_0x3c155d(_0x24f6a8);});});} \ No newline at end of file +var _0x1d5f=['client','request','then','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1d5f,0x8a));var _0xf1d5=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x1d5f[_0x59f0dc];return _0x5b5445;};'use strict';var _=require('lodash');var util=require(_0xf1d5('0x0'));var moment=require(_0xf1d5('0x1'));var BPromise=require('bluebird');var rs=require(_0xf1d5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1d5('0x3'))['db'];var utils=require(_0xf1d5('0x4'));var logger=require(_0xf1d5('0x5'))(_0xf1d5('0x6'));var config=require(_0xf1d5('0x7'));var jayson=require(_0xf1d5('0x8'));var client=jayson[_0xf1d5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b37d2,_0x2aa190,_0x564103){return new BPromise(function(_0x36d7bb,_0x2d75a9){return client[_0xf1d5('0xa')](_0x4b37d2,_0x564103)[_0xf1d5('0xb')](function(_0x32b778){logger[_0xf1d5('0xc')]('Setting,\x20%s,\x20%s',_0x2aa190,_0xf1d5('0xd'));logger[_0xf1d5('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x2aa190,_0xf1d5('0xd'),JSON[_0xf1d5('0xf')](_0x32b778));if(_0x32b778[_0xf1d5('0x10')]){if(_0x32b778['error'][_0xf1d5('0x11')]===0x1f4){logger['error'](_0xf1d5('0x12'),_0x2aa190,_0x32b778[_0xf1d5('0x10')][_0xf1d5('0x13')]);return _0x2d75a9(_0x32b778[_0xf1d5('0x10')]['message']);}logger['error'](_0xf1d5('0x12'),_0x2aa190,_0x32b778[_0xf1d5('0x10')][_0xf1d5('0x13')]);return _0x36d7bb(_0x32b778[_0xf1d5('0x10')][_0xf1d5('0x13')]);}else{logger[_0xf1d5('0xc')](_0xf1d5('0x12'),_0x2aa190,_0xf1d5('0xd'));_0x36d7bb(_0x32b778['result'][_0xf1d5('0x13')]);}})[_0xf1d5('0x14')](function(_0x2725e8){logger[_0xf1d5('0x10')](_0xf1d5('0x12'),_0x2aa190,_0x2725e8);_0x2d75a9(_0x2725e8);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8a26ffa..c6f413f 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 _0xb2de=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','delete','destroy','removeAnswers','removeAgents'];(function(_0x2f96f8,_0x2540b5){var _0x152afe=function(_0x398713){while(--_0x398713){_0x2f96f8['push'](_0x2f96f8['shift']());}};_0x152afe(++_0x2540b5);}(_0xb2de,0x130));var _0xeb2d=function(_0x36ef0d,_0x2b01f5){_0x36ef0d=_0x36ef0d-0x0;var _0x191d74=_0xb2de[_0x36ef0d];return _0x191d74;};'use strict';var multer=require(_0xeb2d('0x0'));var util=require('util');var path=require(_0xeb2d('0x1'));var timeout=require(_0xeb2d('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xeb2d('0x3'));var interaction=require(_0xeb2d('0x4'));var config=require(_0xeb2d('0x5'));var controller=require(_0xeb2d('0x6'));router['get']('/',auth[_0xeb2d('0x7')](),controller['index']);router[_0xeb2d('0x8')](_0xeb2d('0x9'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0xa')]);router[_0xeb2d('0x8')](_0xeb2d('0xb'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0xc')]);router[_0xeb2d('0x8')]('/:id/dispositions',auth[_0xeb2d('0x7')](),controller[_0xeb2d('0xd')]);router[_0xeb2d('0x8')](_0xeb2d('0xe'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0xf')]);router[_0xeb2d('0x8')](_0xeb2d('0x10'),auth['isAuthenticated'](),controller[_0xeb2d('0x11')]);router[_0xeb2d('0x8')](_0xeb2d('0x12'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x13')]);router['get'](_0xeb2d('0x14'),controller['statusGet']);router[_0xeb2d('0x8')](_0xeb2d('0x15'),auth['isAuthenticated'](),controller[_0xeb2d('0x16')]);router[_0xeb2d('0x17')]('/',auth[_0xeb2d('0x7')](),controller['create']);router[_0xeb2d('0x17')](_0xeb2d('0x18'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x19')]);router['post'](_0xeb2d('0xe'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x1a')]);router['post'](_0xeb2d('0x1b'),controller[_0xeb2d('0x1c')]);router['post'](_0xeb2d('0x10'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x1d')]);router[_0xeb2d('0x17')]('/:id/send',auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x1e')]);router[_0xeb2d('0x17')](_0xeb2d('0x14'),controller[_0xeb2d('0x1f')]);router[_0xeb2d('0x17')](_0xeb2d('0x15'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x20')]);router[_0xeb2d('0x21')](_0xeb2d('0xb'),auth[_0xeb2d('0x7')](),controller['update']);router[_0xeb2d('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xeb2d('0x23')]);router[_0xeb2d('0x22')](_0xeb2d('0x18'),auth[_0xeb2d('0x7')](),controller['removeDispositions']);router['delete'](_0xeb2d('0xe'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x24')]);router[_0xeb2d('0x22')](_0xeb2d('0x15'),auth[_0xeb2d('0x7')](),controller[_0xeb2d('0x25')]);module['exports']=router; \ No newline at end of file +var _0x7a33=['addApplications','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x7a33,0x1d8));var _0x37a3=function(_0x3a738a,_0x218638){_0x3a738a=_0x3a738a-0x0;var _0x1b1bd2=_0x7a33[_0x3a738a];return _0x1b1bd2;};'use strict';var multer=require(_0x37a3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x37a3('0x1'));var express=require(_0x37a3('0x2'));var router=express[_0x37a3('0x3')]();var auth=require(_0x37a3('0x4'));var interaction=require(_0x37a3('0x5'));var config=require(_0x37a3('0x6'));var controller=require(_0x37a3('0x7'));router[_0x37a3('0x8')]('/',auth['isAuthenticated'](),controller[_0x37a3('0x9')]);router[_0x37a3('0x8')](_0x37a3('0xa'),auth[_0x37a3('0xb')](),controller[_0x37a3('0xc')]);router[_0x37a3('0x8')](_0x37a3('0xd'),auth[_0x37a3('0xb')](),controller[_0x37a3('0xe')]);router['get'](_0x37a3('0xf'),auth[_0x37a3('0xb')](),controller['getDispositions']);router[_0x37a3('0x8')]('/:id/canned_answers',auth[_0x37a3('0xb')](),controller[_0x37a3('0x10')]);router[_0x37a3('0x8')](_0x37a3('0x11'),auth[_0x37a3('0xb')](),controller[_0x37a3('0x12')]);router[_0x37a3('0x8')](_0x37a3('0x13'),auth[_0x37a3('0xb')](),controller[_0x37a3('0x14')]);router[_0x37a3('0x8')](_0x37a3('0x15'),controller[_0x37a3('0x16')]);router[_0x37a3('0x8')](_0x37a3('0x17'),auth[_0x37a3('0xb')](),controller[_0x37a3('0x18')]);router[_0x37a3('0x19')]('/',auth['isAuthenticated'](),controller[_0x37a3('0x1a')]);router[_0x37a3('0x19')](_0x37a3('0xf'),auth[_0x37a3('0xb')](),controller[_0x37a3('0x1b')]);router['post'](_0x37a3('0x1c'),auth[_0x37a3('0xb')](),controller[_0x37a3('0x1d')]);router[_0x37a3('0x19')](_0x37a3('0x1e'),controller[_0x37a3('0x1f')]);router[_0x37a3('0x19')](_0x37a3('0x11'),auth[_0x37a3('0xb')](),controller[_0x37a3('0x20')]);router[_0x37a3('0x19')](_0x37a3('0x21'),auth[_0x37a3('0xb')](),controller[_0x37a3('0x22')]);router[_0x37a3('0x19')]('/:id/status',controller['status']);router[_0x37a3('0x19')](_0x37a3('0x17'),auth[_0x37a3('0xb')](),controller['addAgents']);router['put'](_0x37a3('0xd'),auth['isAuthenticated'](),controller[_0x37a3('0x23')]);router[_0x37a3('0x24')]('/:id',auth[_0x37a3('0xb')](),controller[_0x37a3('0x25')]);router[_0x37a3('0x24')]('/:id/dispositions',auth[_0x37a3('0xb')](),controller[_0x37a3('0x26')]);router[_0x37a3('0x24')]('/:id/canned_answers',auth[_0x37a3('0xb')](),controller[_0x37a3('0x27')]);router[_0x37a3('0x24')]('/:id/users',auth[_0x37a3('0xb')](),controller[_0x37a3('0x28')]);module[_0x37a3('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 9cc1c1e..a876403 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 _0x80b2=['randomstring','exports','name','STRING','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x44450c,_0x52138c){var _0x413419=function(_0x48c81a){while(--_0x48c81a){_0x44450c['push'](_0x44450c['shift']());}};_0x413419(++_0x52138c);}(_0x80b2,0x158));var _0x280b=function(_0x236af4,_0x1d1aef){_0x236af4=_0x236af4-0x0;var _0x20c76c=_0x80b2[_0x236af4];return _0x20c76c;};'use strict';var Sequelize=require(_0x280b('0x0'));var rs=require(_0x280b('0x1'));module[_0x280b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x280b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x280b('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x280b('0x4')]},'type':{'type':Sequelize[_0x280b('0x5')](_0x280b('0x6'),_0x280b('0x7'),_0x280b('0x8'),_0x280b('0x9'),_0x280b('0xa'),_0x280b('0xb'),_0x280b('0xc'),_0x280b('0xd'),_0x280b('0xe'))},'accountSid':{'type':Sequelize[_0x280b('0x4')]},'authId':{'type':Sequelize[_0x280b('0x4')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x280b('0x4')]},'password':{'type':Sequelize[_0x280b('0x4')]},'apiKey':{'type':Sequelize[_0x280b('0x4')]},'senderString':{'type':Sequelize[_0x280b('0x4')]},'deliveryReport':{'type':Sequelize[_0x280b('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x280b('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x280b('0x10');}},'notificationSound':{'type':Sequelize[_0x280b('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x280b('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x280b('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x280b('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x280b('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x280b('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x280b('0xf')],'defaultValue':![],'comment':_0x280b('0x13'),'set':function(_0x4d2e66){if(!_0x4d2e66)this[_0x280b('0x14')](_0x280b('0x15'),null);this[_0x280b('0x14')](_0x280b('0x16'),_0x4d2e66);}}}; \ No newline at end of file +var _0x53d1=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','csc','intelepeer','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x14ad77,_0xb5c484){var _0x47d4a6=function(_0xd2b7c4){while(--_0xd2b7c4){_0x14ad77['push'](_0x14ad77['shift']());}};_0x47d4a6(++_0xb5c484);}(_0x53d1,0x153));var _0x153d=function(_0x47ea9f,_0x5d05a5){_0x47ea9f=_0x47ea9f-0x0;var _0x41af29=_0x53d1[_0x47ea9f];return _0x41af29;};'use strict';var Sequelize=require(_0x153d('0x0'));var rs=require(_0x153d('0x1'));module[_0x153d('0x2')]={'name':{'type':Sequelize[_0x153d('0x3')],'unique':_0x153d('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x153d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x153d('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x153d('0x5')]();}},'phone':{'type':Sequelize[_0x153d('0x3')]},'type':{'type':Sequelize[_0x153d('0x6')](_0x153d('0x7'),_0x153d('0x8'),'connectel',_0x153d('0x9'),_0x153d('0xa'),_0x153d('0xb'),_0x153d('0xc'),'infobip',_0x153d('0xd'))},'accountSid':{'type':Sequelize[_0x153d('0x3')]},'authId':{'type':Sequelize[_0x153d('0x3')]},'authToken':{'type':Sequelize[_0x153d('0x3')]},'smsMethod':{'type':Sequelize[_0x153d('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x153d('0x3')]},'password':{'type':Sequelize[_0x153d('0x3')]},'apiKey':{'type':Sequelize[_0x153d('0x3')]},'senderString':{'type':Sequelize[_0x153d('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x153d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x153d('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x153d('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x153d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x153d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x153d('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x153d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x153d('0xf')],'defaultValue':![],'comment':_0x153d('0x11'),'set':function(_0x10251e){if(!_0x10251e)this[_0x153d('0x12')](_0x153d('0x13'),null);this[_0x153d('0x12')](_0x153d('0x14'),_0x10251e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 8631acb..045c93c 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 _0x1fd5=['ContactId','AttachmentId','UserId','User','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','transaction','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','inspect','skebby_dispatch_id','requestid','statusInt','infobip','groupName','redif','DELIVERED','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','client','http','test','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','SmsAccount','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rawAttributes','length','order','map','removeDispositions','ids','CannedAnswer','hasOwnProperty','pick','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','list','defaults','SmsInteraction','spread','created','autoclose','push','close','interaction','SmsMessage'];(function(_0x4a1e7a,_0x5b0cba){var _0x55bb68=function(_0x3d8ebf){while(--_0x3d8ebf){_0x4a1e7a['push'](_0x4a1e7a['shift']());}};_0x55bb68(++_0x5b0cba);}(_0x1fd5,0x1e7));var _0x51fd=function(_0x2c30ab,_0x5398c6){_0x2c30ab=_0x2c30ab-0x0;var _0x20bb75=_0x1fd5[_0x2c30ab];return _0x20bb75;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51fd('0x0'));var rimraf=require(_0x51fd('0x1'));var zipdir=require(_0x51fd('0x2'));var jsonpatch=require(_0x51fd('0x3'));var rp=require('request-promise');var moment=require(_0x51fd('0x4'));var BPromise=require(_0x51fd('0x5'));var Mustache=require(_0x51fd('0x6'));var util=require(_0x51fd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x51fd('0x8'));var ejs=require(_0x51fd('0x9'));var fs=require('fs');var _=require(_0x51fd('0xa'));var squel=require('squel');var crypto=require(_0x51fd('0xb'));var jsforce=require(_0x51fd('0xc'));var deskjs=require(_0x51fd('0xd'));var toCsv=require(_0x51fd('0x8'));var querystring=require(_0x51fd('0xe'));var Papa=require(_0x51fd('0xf'));var Redis=require('ioredis');var authService=require(_0x51fd('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x51fd('0x11'));var logger=require(_0x51fd('0x12'))(_0x51fd('0x13'));var utils=require(_0x51fd('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x51fd('0x15')]=_['defaults'](config[_0x51fd('0x15')],{'host':_0x51fd('0x16'),'port':0x18eb});var socket=require(_0x51fd('0x17'))(new Redis(config[_0x51fd('0x15')]));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x51fd('0x18')][_0x51fd('0x19')]({'port':0x232c});function checkPasswordPattern(_0x2a66f5,_0x986003,_0x4ed82b){if(_0x4ed82b){var _0x4d4fa6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d4fa6[_0x51fd('0x1a')](_0x986003)){return _0x2a66f5;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2a66f5;}}function respondWithRpcPromise(_0x3283f4,_0x50fb93,_0x2aca3f,_0x59ba77){return new BPromise(function(_0x2cbdd0,_0x54a33d){var _0x1828eb=_0x59ba77||client;return _0x1828eb[_0x51fd('0x1b')](_0x3283f4,_0x2aca3f)[_0x51fd('0x1c')](function(_0x4bf2fc){logger[_0x51fd('0x1d')](_0x51fd('0x1e'),_0x50fb93,_0x51fd('0x1f'));logger[_0x51fd('0x20')](_0x51fd('0x21'),_0x50fb93,_0x51fd('0x1f'),JSON[_0x51fd('0x22')](_0x4bf2fc));if(_0x4bf2fc[_0x51fd('0x23')]){if(_0x4bf2fc['error'][_0x51fd('0x24')]===0x1f4){logger[_0x51fd('0x23')](_0x51fd('0x1e'),_0x50fb93,_0x4bf2fc[_0x51fd('0x23')]['message']);return _0x54a33d(_0x4bf2fc[_0x51fd('0x23')]['message']);}logger[_0x51fd('0x23')](_0x51fd('0x1e'),_0x50fb93,_0x4bf2fc[_0x51fd('0x23')]['message']);return _0x2cbdd0(_0x4bf2fc[_0x51fd('0x23')][_0x51fd('0x25')]);}else{logger[_0x51fd('0x1d')](_0x51fd('0x1e'),_0x50fb93,_0x51fd('0x1f'));_0x2cbdd0(_0x4bf2fc[_0x51fd('0x26')][_0x51fd('0x25')]);}})[_0x51fd('0x27')](function(_0x591d55){logger[_0x51fd('0x23')](_0x51fd('0x1e'),_0x50fb93,_0x591d55);_0x54a33d(_0x591d55);});});}function respondWithStatusCode(_0x338ce7,_0x560a3c){_0x560a3c=_0x560a3c||0xcc;return function(_0x328d4a){if(_0x328d4a){return _0x338ce7[_0x51fd('0x28')](_0x560a3c);}return _0x338ce7[_0x51fd('0x29')](_0x560a3c)[_0x51fd('0x2a')]();};}function respondWithResult(_0x293b90,_0x411f4a){_0x411f4a=_0x411f4a||0xc8;return function(_0xe602be){if(_0xe602be){return _0x293b90['status'](_0x411f4a)['json'](_0xe602be);}};}function respondWithFilteredResult(_0x4e8957,_0x5b7952){return function(_0x4b65de){if(_0x4b65de){var _0x4f8ce6=_0x4b65de[_0x51fd('0x2b')],_0x10dbc8=_0x5b7952[_0x51fd('0x2c')],_0x4d330d=_0x5b7952[_0x51fd('0x2c')]+_0x5b7952[_0x51fd('0x2d')],_0x102f58;if(_0x4d330d>=_0x4f8ce6){_0x4d330d=_0x4f8ce6;_0x102f58=0xc8;}else{_0x102f58=0xce;}_0x4e8957[_0x51fd('0x29')](_0x102f58);return _0x4e8957['set'](_0x51fd('0x2e'),_0x10dbc8+'-'+_0x4d330d+'/'+_0x4f8ce6)[_0x51fd('0x2f')](_0x4b65de);}return null;};}function patchUpdates(_0x40aafb){return function(_0x3acf2a){try{jsonpatch[_0x51fd('0x30')](_0x3acf2a,_0x40aafb,!![]);}catch(_0x2bcd7d){return BPromise[_0x51fd('0x31')](_0x2bcd7d);}return _0x3acf2a[_0x51fd('0x32')]();};}function saveUpdates(_0x2767a6,_0x29ff94){return function(_0x46368e){if(_0x46368e){return _0x46368e[_0x51fd('0x33')](_0x2767a6)[_0x51fd('0x1c')](function(_0x5ceef9){return _0x5ceef9;});}return null;};}function removeEntity(_0x40346a,_0x210640){return function(_0x56cdb1){if(_0x56cdb1){return _0x56cdb1[_0x51fd('0x34')]()[_0x51fd('0x1c')](function(){var _0x419f73=_0x56cdb1[_0x51fd('0x35')]({'plain':!![]});var _0x3a54bc=_0x51fd('0x36');return db[_0x51fd('0x37')][_0x51fd('0x34')]({'where':{'type':_0x3a54bc,'resourceId':_0x419f73['id']}})['then'](function(){return _0x56cdb1;});})[_0x51fd('0x1c')](function(){_0x40346a[_0x51fd('0x29')](0xcc)[_0x51fd('0x2a')]();});}};}function handleEntityNotFound(_0x4c4943,_0x42c3ff){return function(_0xb6eb1d){if(!_0xb6eb1d){_0x4c4943[_0x51fd('0x28')](0x194);}return _0xb6eb1d;};}function handleError(_0x5d2004,_0x5ceeb5){_0x5ceeb5=_0x5ceeb5||0x1f4;return function(_0x535916){logger[_0x51fd('0x23')](_0x535916[_0x51fd('0x38')]);if(_0x535916[_0x51fd('0x39')]){delete _0x535916[_0x51fd('0x39')];}_0x5d2004[_0x51fd('0x29')](_0x5ceeb5)[_0x51fd('0x3a')](_0x535916);};}exports['index']=function(_0x34cfe7,_0x59fc6d){var _0x260403={'include':[{'model':db[_0x51fd('0x3b')],'as':'mandatoryDispositionPause'}]},_0x8608b9={},_0x289e74={'count':0x0,'rows':[]};var _0x5c2f6a=db[_0x51fd('0x3c')]['rawAttributes'];_0x8608b9[_0x51fd('0x3d')]=_[_0x51fd('0x3e')](_0x5c2f6a);_0x8608b9['query']=_[_0x51fd('0x3e')](_0x34cfe7[_0x51fd('0x3f')]);_0x8608b9['filters']=_[_0x51fd('0x40')](_0x8608b9[_0x51fd('0x3d')],_0x8608b9[_0x51fd('0x3f')]);_0x260403[_0x51fd('0x41')]=_[_0x51fd('0x40')](_0x8608b9[_0x51fd('0x3d')],qs[_0x51fd('0x42')](_0x34cfe7[_0x51fd('0x3f')][_0x51fd('0x42')]));_0x260403[_0x51fd('0x41')]=_0x260403[_0x51fd('0x41')]['length']?_0x260403[_0x51fd('0x41')]:_0x8608b9[_0x51fd('0x3d')];if(!_0x34cfe7['query']['hasOwnProperty'](_0x51fd('0x43'))){_0x260403[_0x51fd('0x2d')]=qs['limit'](_0x34cfe7['query'][_0x51fd('0x2d')]);_0x260403['offset']=qs['offset'](_0x34cfe7[_0x51fd('0x3f')][_0x51fd('0x2c')]);}_0x260403['order']=qs[_0x51fd('0x44')](_0x34cfe7[_0x51fd('0x3f')][_0x51fd('0x44')]);_0x260403[_0x51fd('0x45')]=qs[_0x51fd('0x46')](_['pick'](_0x34cfe7[_0x51fd('0x3f')],_0x8608b9[_0x51fd('0x46')]));if(_0x34cfe7[_0x51fd('0x3f')][_0x51fd('0x47')]){_0x260403[_0x51fd('0x45')]=_[_0x51fd('0x48')](_0x260403[_0x51fd('0x45')],{'$or':_['map'](_0x5c2f6a,function(_0x3ce3c0){if(_0x3ce3c0[_0x51fd('0x49')]['key']!==_0x51fd('0x4a')){var _0x3907ce={};_0x3907ce[_0x3ce3c0[_0x51fd('0x4b')]]={'$like':'%'+_0x34cfe7[_0x51fd('0x3f')]['filter']+'%'};return _0x3907ce;}})});}_0x260403=_[_0x51fd('0x48')]({},_0x260403,_0x34cfe7[_0x51fd('0x4c')]);var _0x3b2b70={'where':_0x260403[_0x51fd('0x45')]};return db[_0x51fd('0x3c')]['count'](_0x3b2b70)['then'](function(_0x36fdbc){_0x289e74[_0x51fd('0x2b')]=_0x36fdbc;if(_0x34cfe7[_0x51fd('0x3f')][_0x51fd('0x4d')]){_0x260403[_0x51fd('0x4e')]=[{'all':!![]}];}return db['SmsAccount'][_0x51fd('0x4f')](_0x260403);})[_0x51fd('0x1c')](function(_0x171f5b){_0x289e74[_0x51fd('0x50')]=_0x171f5b;return _0x289e74;})['then'](respondWithFilteredResult(_0x59fc6d,_0x260403))[_0x51fd('0x27')](handleError(_0x59fc6d,null));};exports[_0x51fd('0x51')]=function(_0xcc2ff5,_0x1e91f4){var _0x5c4da0={'raw':![],'where':{'id':_0xcc2ff5[_0x51fd('0x52')]['id']},'include':[{'model':db[_0x51fd('0x3b')],'as':_0x51fd('0x53')}]},_0x404052={};_0x404052[_0x51fd('0x3d')]=_['keys'](db[_0x51fd('0x3c')]['rawAttributes']);_0x404052[_0x51fd('0x3f')]=_['keys'](_0xcc2ff5[_0x51fd('0x3f')]);_0x404052[_0x51fd('0x46')]=_['intersection'](_0x404052['model'],_0x404052['query']);_0x5c4da0[_0x51fd('0x41')]=_[_0x51fd('0x40')](_0x404052[_0x51fd('0x3d')],qs['fields'](_0xcc2ff5[_0x51fd('0x3f')][_0x51fd('0x42')]));_0x5c4da0['attributes']=_0x5c4da0[_0x51fd('0x41')]['length']?_0x5c4da0[_0x51fd('0x41')]:_0x404052['model'];if(_0xcc2ff5[_0x51fd('0x3f')][_0x51fd('0x4d')]){_0x5c4da0['include']=[{'all':!![]}];}_0x5c4da0=_['merge']({},_0x5c4da0,_0xcc2ff5['options']);return db[_0x51fd('0x3c')]['find'](_0x5c4da0)[_0x51fd('0x1c')](handleEntityNotFound(_0x1e91f4,null))[_0x51fd('0x1c')](respondWithResult(_0x1e91f4,null))[_0x51fd('0x27')](handleError(_0x1e91f4,null));};exports[_0x51fd('0x54')]=function(_0x3fe562,_0x6f8fbf){return db[_0x51fd('0x3c')][_0x51fd('0x54')](_0x3fe562[_0x51fd('0x55')],{})[_0x51fd('0x1c')](function(_0x16f3d4){var _0x30342d=_0x3fe562[_0x51fd('0x56')][_0x51fd('0x35')]({'plain':!![]});if(!_0x30342d)throw new Error(_0x51fd('0x57'));if(_0x30342d[_0x51fd('0x58')]===_0x51fd('0x56')){var _0x45f85c=_0x16f3d4[_0x51fd('0x35')]({'plain':!![]});var _0x589fb9=_0x51fd('0x36');return db[_0x51fd('0x59')]['find']({'where':{'name':_0x589fb9,'userProfileId':_0x30342d[_0x51fd('0x5a')]},'raw':!![]})[_0x51fd('0x1c')](function(_0x5c5570){if(_0x5c5570&&_0x5c5570[_0x51fd('0x5b')]===0x0){return db[_0x51fd('0x37')][_0x51fd('0x54')]({'name':_0x45f85c['name'],'resourceId':_0x45f85c['id'],'type':_0x5c5570['name'],'sectionId':_0x5c5570['id']},{})[_0x51fd('0x1c')](function(){return _0x16f3d4;});}else{return _0x16f3d4;}})['catch'](function(_0x1633cd){logger[_0x51fd('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1633cd);throw _0x1633cd;});}return _0x16f3d4;})[_0x51fd('0x1c')](respondWithResult(_0x6f8fbf,0xc9))['catch'](handleError(_0x6f8fbf,null));};exports['update']=function(_0x566e88,_0x545bdb){if(_0x566e88[_0x51fd('0x55')]['id']){delete _0x566e88[_0x51fd('0x55')]['id'];}return db['SmsAccount'][_0x51fd('0x5c')]({'where':{'id':_0x566e88['params']['id']},'include':[{'model':db[_0x51fd('0x3b')],'as':_0x51fd('0x53')}]})[_0x51fd('0x1c')](handleEntityNotFound(_0x545bdb,null))[_0x51fd('0x1c')](saveUpdates(_0x566e88[_0x51fd('0x55')],null))[_0x51fd('0x1c')](respondWithResult(_0x545bdb,null))[_0x51fd('0x27')](handleError(_0x545bdb,null));};exports['destroy']=function(_0xa3f4ef,_0x8c4db8){return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0xa3f4ef['params']['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x8c4db8,null))[_0x51fd('0x1c')](removeEntity(_0x8c4db8,null))[_0x51fd('0x27')](handleError(_0x8c4db8,null));};exports[_0x51fd('0x5d')]=function(_0x7e8426,_0x5e6332){return db[_0x51fd('0x3c')]['describe']()[_0x51fd('0x1c')](respondWithResult(_0x5e6332,null))[_0x51fd('0x27')](handleError(_0x5e6332,null));};exports[_0x51fd('0x5e')]=function(_0x179f2a,_0x40702a,_0x136c5f){if(_0x179f2a[_0x51fd('0x55')]['id']){delete _0x179f2a[_0x51fd('0x55')]['id'];}return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x179f2a['params']['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x40702a,null))[_0x51fd('0x1c')](function(_0x429142){if(_0x429142){_0x179f2a[_0x51fd('0x55')][_0x51fd('0x5f')]=_0x429142['id'];return db[_0x51fd('0x60')]['create'](_0x179f2a[_0x51fd('0x55')]);}})['then'](respondWithResult(_0x40702a,null))[_0x51fd('0x27')](handleError(_0x40702a,null));};exports[_0x51fd('0x61')]=function(_0x27eb65,_0x202759,_0x3585d8){var _0x2ebb0a={'raw':![],'where':{}};var _0x4b0c67={};var _0x30c876={'count':0x0,'rows':[]};return db['SmsAccount'][_0x51fd('0x62')]({'where':{'id':_0x27eb65[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x202759,null))[_0x51fd('0x1c')](function(_0x225ae9){if(_0x225ae9){_0x4b0c67[_0x51fd('0x3d')]=_[_0x51fd('0x3e')](db['Disposition'][_0x51fd('0x63')]);_0x4b0c67['query']=_[_0x51fd('0x3e')](_0x27eb65[_0x51fd('0x3f')]);_0x4b0c67['filters']=_[_0x51fd('0x40')](_0x4b0c67['model'],_0x4b0c67[_0x51fd('0x3f')]);_0x2ebb0a['attributes']=_[_0x51fd('0x40')](_0x4b0c67[_0x51fd('0x3d')],qs[_0x51fd('0x42')](_0x27eb65[_0x51fd('0x3f')][_0x51fd('0x42')]));_0x2ebb0a['attributes']=_0x2ebb0a[_0x51fd('0x41')][_0x51fd('0x64')]?_0x2ebb0a[_0x51fd('0x41')]:_0x4b0c67[_0x51fd('0x3d')];if(!_0x27eb65[_0x51fd('0x3f')]['hasOwnProperty'](_0x51fd('0x43'))){_0x2ebb0a[_0x51fd('0x2d')]=qs['limit'](_0x27eb65[_0x51fd('0x3f')][_0x51fd('0x2d')]);_0x2ebb0a[_0x51fd('0x2c')]=qs[_0x51fd('0x2c')](_0x27eb65[_0x51fd('0x3f')]['offset']);}_0x2ebb0a[_0x51fd('0x65')]=qs['sort'](_0x27eb65['query'][_0x51fd('0x44')]);_0x2ebb0a[_0x51fd('0x45')]=qs[_0x51fd('0x46')](_['pick'](_0x27eb65[_0x51fd('0x3f')],_0x4b0c67[_0x51fd('0x46')]));_0x2ebb0a[_0x51fd('0x45')]['SmsAccountId']=_0x225ae9['id'];if(_0x27eb65[_0x51fd('0x3f')][_0x51fd('0x47')]){_0x2ebb0a['where']=_['merge'](_0x2ebb0a[_0x51fd('0x45')],{'$or':_[_0x51fd('0x66')](_0x2ebb0a[_0x51fd('0x41')],function(_0x57f032){var _0x5bc681={};_0x5bc681[_0x57f032]={'$like':'%'+_0x27eb65[_0x51fd('0x3f')][_0x51fd('0x47')]+'%'};return _0x5bc681;})});}_0x2ebb0a=_[_0x51fd('0x48')]({},_0x2ebb0a,_0x27eb65[_0x51fd('0x4c')]);return db[_0x51fd('0x60')][_0x51fd('0x2b')]({'where':_0x2ebb0a[_0x51fd('0x45')]})['then'](function(_0x565b27){_0x30c876['count']=_0x565b27;if(_0x27eb65[_0x51fd('0x3f')]['includeAll']){_0x2ebb0a['include']=[{'all':!![]}];}return db[_0x51fd('0x60')][_0x51fd('0x4f')](_0x2ebb0a);})[_0x51fd('0x1c')](function(_0x1c2862){_0x30c876['rows']=_0x1c2862;return _0x30c876;});}})[_0x51fd('0x1c')](respondWithFilteredResult(_0x202759,_0x2ebb0a))[_0x51fd('0x27')](handleError(_0x202759,null));};exports[_0x51fd('0x67')]=function(_0x140db9,_0x439ea4,_0x342f21){return db[_0x51fd('0x3c')]['find']({'where':{'id':_0x140db9[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x439ea4,null))[_0x51fd('0x1c')](function(_0xc6576e){if(_0xc6576e){return _0xc6576e[_0x51fd('0x67')](_0x140db9[_0x51fd('0x3f')][_0x51fd('0x68')]);}})[_0x51fd('0x1c')](respondWithStatusCode(_0x439ea4,null))['catch'](handleError(_0x439ea4,null));};exports['addAnswer']=function(_0x586168,_0x2187d4,_0x447873){if(_0x586168[_0x51fd('0x55')]['id']){delete _0x586168[_0x51fd('0x55')]['id'];}return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x586168['params']['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x2187d4,null))[_0x51fd('0x1c')](function(_0x464250){if(_0x464250){_0x586168[_0x51fd('0x55')][_0x51fd('0x5f')]=_0x464250['id'];return db[_0x51fd('0x69')][_0x51fd('0x54')](_0x586168['body']);}})['then'](respondWithResult(_0x2187d4,null))[_0x51fd('0x27')](handleError(_0x2187d4,null));};exports['getAnswers']=function(_0x330c5f,_0x58728b,_0x12c6ae){var _0x118563={'raw':![],'where':{}};var _0x295a3d={};var _0xe7fc5a={'count':0x0,'rows':[]};return db[_0x51fd('0x3c')]['findOne']({'where':{'id':_0x330c5f[_0x51fd('0x52')]['id']}})['then'](handleEntityNotFound(_0x58728b,null))['then'](function(_0x5e7018){if(_0x5e7018){_0x295a3d[_0x51fd('0x3d')]=_[_0x51fd('0x3e')](db['CannedAnswer'][_0x51fd('0x63')]);_0x295a3d[_0x51fd('0x3f')]=_[_0x51fd('0x3e')](_0x330c5f[_0x51fd('0x3f')]);_0x295a3d[_0x51fd('0x46')]=_[_0x51fd('0x40')](_0x295a3d[_0x51fd('0x3d')],_0x295a3d[_0x51fd('0x3f')]);_0x118563[_0x51fd('0x41')]=_[_0x51fd('0x40')](_0x295a3d['model'],qs[_0x51fd('0x42')](_0x330c5f['query'][_0x51fd('0x42')]));_0x118563[_0x51fd('0x41')]=_0x118563[_0x51fd('0x41')][_0x51fd('0x64')]?_0x118563[_0x51fd('0x41')]:_0x295a3d[_0x51fd('0x3d')];if(!_0x330c5f[_0x51fd('0x3f')][_0x51fd('0x6a')]('nolimit')){_0x118563[_0x51fd('0x2d')]=qs['limit'](_0x330c5f[_0x51fd('0x3f')]['limit']);_0x118563[_0x51fd('0x2c')]=qs[_0x51fd('0x2c')](_0x330c5f[_0x51fd('0x3f')]['offset']);}_0x118563[_0x51fd('0x65')]=qs['sort'](_0x330c5f[_0x51fd('0x3f')][_0x51fd('0x44')]);_0x118563[_0x51fd('0x45')]=qs[_0x51fd('0x46')](_[_0x51fd('0x6b')](_0x330c5f[_0x51fd('0x3f')],_0x295a3d[_0x51fd('0x46')]));_0x118563[_0x51fd('0x45')][_0x51fd('0x5f')]=_0x5e7018['id'];if(_0x330c5f[_0x51fd('0x3f')][_0x51fd('0x47')]){_0x118563[_0x51fd('0x45')]=_[_0x51fd('0x48')](_0x118563['where'],{'$or':_[_0x51fd('0x66')](_0x118563[_0x51fd('0x41')],function(_0x113120){var _0x2857e3={};_0x2857e3[_0x113120]={'$like':'%'+_0x330c5f[_0x51fd('0x3f')][_0x51fd('0x47')]+'%'};return _0x2857e3;})});}_0x118563=_['merge']({},_0x118563,_0x330c5f[_0x51fd('0x4c')]);return db[_0x51fd('0x69')]['count']({'where':_0x118563['where']})[_0x51fd('0x1c')](function(_0x411e6e){_0xe7fc5a[_0x51fd('0x2b')]=_0x411e6e;if(_0x330c5f[_0x51fd('0x3f')][_0x51fd('0x4d')]){_0x118563[_0x51fd('0x4e')]=[{'all':!![]}];}return db[_0x51fd('0x69')]['findAll'](_0x118563);})['then'](function(_0x553672){_0xe7fc5a[_0x51fd('0x50')]=_0x553672;return _0xe7fc5a;});}})[_0x51fd('0x1c')](respondWithFilteredResult(_0x58728b,_0x118563))[_0x51fd('0x27')](handleError(_0x58728b,null));};exports[_0x51fd('0x6c')]=function(_0x148be8,_0x5c31a8,_0x4b22c3){return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x148be8['params']['id']}})['then'](handleEntityNotFound(_0x5c31a8,null))['then'](function(_0x418a21){if(_0x418a21){return _0x418a21['removeAnswers'](_0x148be8[_0x51fd('0x3f')][_0x51fd('0x68')]);}})[_0x51fd('0x1c')](respondWithStatusCode(_0x5c31a8,null))[_0x51fd('0x27')](handleError(_0x5c31a8,null));};exports[_0x51fd('0x6d')]=function(_0x18ada1,_0x300bc1,_0x3e8533){var _0x51cc49={'channel':_0x51fd('0x6e')};var _0x387f94=[];var _0x5e4dae=[];var _0x388f9={};return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x18ada1[_0x51fd('0x52')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x51fd('0x6f')}]})[_0x51fd('0x1c')](handleEntityNotFound(_0x300bc1,null))['then'](function(_0x1085f7){_0x51cc49[_0x51fd('0x70')]=_0x1085f7;_0x51cc49[_0x51fd('0x71')]=_[_0x51fd('0x72')](_0x1085f7['Applications'],[_0x51fd('0x73')],[_0x51fd('0x74')]);if(_0x51cc49[_0x51fd('0x70')][_0x51fd('0x6f')]){delete _0x51cc49[_0x51fd('0x70')]['Applications'];}return db[_0x51fd('0x75')]['describe']();})[_0x51fd('0x1c')](function(_0x2f5598){if(!_0x2f5598){throw new db[(_0x51fd('0x76'))][(_0x51fd('0x77'))]('no\x20available\x20attributes');}_0x387f94=_[_0x51fd('0x78')](_['keys'](_0x2f5598),[_0x51fd('0x79'),_0x51fd('0x7a')]);_0x5e4dae=_[_0x51fd('0x78')](_[_0x51fd('0x3e')](_0x2f5598),[_0x51fd('0x79'),_0x51fd('0x7a'),_0x51fd('0x7b'),_0x51fd('0x7c')]);_0x51cc49[_0x51fd('0x55')]={'mapKey':_0x51fd('0x7d')};if(_0x51cc49[_0x51fd('0x70')][_0x51fd('0x49')]){switch(_0x51cc49[_0x51fd('0x70')]['type']){case _0x51fd('0x7e'):_0x51cc49['body'][_0x51fd('0x7f')]=_0x18ada1['body'][_0x51fd('0x80')];_0x51cc49['body'][_0x51fd('0x55')]=_0x18ada1['body'][_0x51fd('0x81')];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x82')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x83')];break;case _0x51fd('0x84'):_0x51cc49['body'][_0x51fd('0x7f')]='+'+_0x18ada1[_0x51fd('0x55')]['sender'];_0x51cc49['body'][_0x51fd('0x55')]=_0x18ada1['body'][_0x51fd('0x85')];break;case _0x51fd('0x86'):_0x51cc49[_0x51fd('0x55')][_0x51fd('0x7f')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x7f')];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x55')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x25')];break;case _0x51fd('0x87'):_0x51cc49[_0x51fd('0x55')]['from']=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x7f')];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x55')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x55')];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x82')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x88')];break;case _0x51fd('0x89'):_0x51cc49['body'][_0x51fd('0x7f')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x80')];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x55')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x8a')];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x82')]=_0x18ada1[_0x51fd('0x55')]['MessageUUID'];break;case'infobip':_0x51cc49[_0x51fd('0x55')]['from']='+'+_0x18ada1[_0x51fd('0x55')][_0x51fd('0x8b')][0x0][_0x51fd('0x7f')];_0x51cc49[_0x51fd('0x55')]['body']=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x8b')][0x0][_0x51fd('0x85')];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x82')]=_0x18ada1['body'][_0x51fd('0x8b')][0x0][_0x51fd('0x82')];break;case _0x51fd('0x8c'):_0x51cc49[_0x51fd('0x55')]['from']=_0x18ada1[_0x51fd('0x55')]['originatingAddress'];_0x51cc49['body'][_0x51fd('0x55')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x8d')][_0x51fd('0x25')];break;case _0x51fd('0x8e'):_0x51cc49[_0x51fd('0x55')]['from']=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x8f')];_0x51cc49['body'][_0x51fd('0x55')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x85')];_0x51cc49['body'][_0x51fd('0x82')]=_0x18ada1[_0x51fd('0x55')][_0x51fd('0x90')];break;case _0x51fd('0x91'):_0x51cc49[_0x51fd('0x55')][_0x51fd('0x7f')]=_0x18ada1['body']['from'];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x55')]=_0x18ada1['body']['message'];_0x51cc49[_0x51fd('0x55')][_0x51fd('0x82')]=_0x18ada1['body']['refid'];break;}}if(_0x51cc49[_0x51fd('0x55')]['id']){delete _0x51cc49[_0x51fd('0x55')]['id'];}if(_[_0x51fd('0x92')](_0x51cc49['body'][_0x51fd('0x7f')])){throw new db[(_0x51fd('0x76'))][(_0x51fd('0x77'))](_0x51fd('0x93'));}if(_['isNil'](_0x51cc49[_0x51fd('0x55')][_0x51fd('0x55')])||_0x51cc49[_0x51fd('0x55')][_0x51fd('0x55')]===''){throw new db[(_0x51fd('0x76'))][(_0x51fd('0x77'))](_0x51fd('0x94'));}if(_[_0x51fd('0x92')](_0x51cc49[_0x51fd('0x55')][_0x51fd('0x95')])){throw new db['Sequelize'][(_0x51fd('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e4dae);}if(!_[_0x51fd('0x96')](_0x5e4dae,_0x51cc49['body'][_0x51fd('0x95')])){throw new db['Sequelize'][(_0x51fd('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e4dae);}_0x388f9[_0x51cc49['body'][_0x51fd('0x95')]]=_0x51cc49['body']['from'];return db[_0x51fd('0x97')][_0x51fd('0x5c')]({'where':{'id':_0x51cc49[_0x51fd('0x70')][_0x51fd('0x7c')]},'include':[{'model':db[_0x51fd('0x75')],'as':_0x51fd('0x98'),'where':_0x388f9,'limit':0x1,'order':[['updatedAt',_0x51fd('0x99')]]}]});})[_0x51fd('0x1c')](handleEntityNotFound(_0x300bc1,null))[_0x51fd('0x1c')](function(_0x45fb88){if(_0x45fb88){_0x51cc49[_0x51fd('0x9a')]=_['omit'](_0x45fb88,['Contacts']);if(_0x45fb88['Contacts'][_0x51fd('0x64')]){return _0x45fb88[_0x51fd('0x98')][0x0];}var _0x48a661=_[_0x51fd('0x9b')](_0x51cc49[_0x51fd('0x55')],{'firstName':_0x51cc49['body'][_0x51fd('0x7f')],'ListId':_0x45fb88['id']});_0x48a661[_0x51cc49[_0x51fd('0x55')][_0x51fd('0x95')]]=_0x51cc49[_0x51fd('0x55')][_0x51fd('0x7f')];return db[_0x51fd('0x75')]['create'](_0x48a661,{'fields':_0x387f94,'raw':!![]});}})[_0x51fd('0x1c')](handleEntityNotFound(_0x300bc1,null))[_0x51fd('0x1c')](function(_0x3b2857){if(_0x3b2857){_0x51cc49['contact']=_0x3b2857;var _0x1ed81a={'ContactId':_0x3b2857['id'],'phone':_0x51cc49['body'][_0x51fd('0x7f')],'SmsAccountId':_0x18ada1[_0x51fd('0x52')]['id']};var _0x38b790={'ContactId':_0x3b2857['id'],'SmsAccountId':_0x18ada1[_0x51fd('0x52')]['id'],'closed':![]};return db[_0x51fd('0x9c')][_0x51fd('0x5c')]({'where':_0x38b790})['then'](function(_0x31a87c){if(_0x31a87c){return[_0x31a87c,![]];}return db[_0x51fd('0x9c')][_0x51fd('0x54')](_0x1ed81a)[_0x51fd('0x1c')](function(_0x3b6587){return[_0x3b6587,!![]];});});}})[_0x51fd('0x9d')](function(_0x2ed0d4,_0x43a84f){_0x51cc49['interaction']=_0x2ed0d4['get']({'plain':!![]});_0x51cc49['interaction'][_0x51fd('0x9e')]=![];if(_0x43a84f){if(_0x51cc49[_0x51fd('0x70')][_0x51fd('0x9f')]){_0x51cc49['applications'][_0x51fd('0xa0')]({'id':0x0,'priority':_0x51cc49[_0x51fd('0x71')]['length']+0x1,'app':_0x51fd('0xa1'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x51cc49[_0x51fd('0xa2')][_0x51fd('0x9e')]=!![];}return db[_0x51fd('0xa3')][_0x51fd('0x54')]({'phone':_0x51cc49[_0x51fd('0x55')][_0x51fd('0x7f')],'messageId':_0x51cc49['body'][_0x51fd('0x82')],'body':_0x51cc49[_0x51fd('0x55')]['body'],'SmsAccountId':_0x18ada1[_0x51fd('0x52')]['id'],'SmsInteractionId':_0x2ed0d4['id'],'direction':'in','ContactId':_0x2ed0d4[_0x51fd('0xa4')],'AttachmentId':_0x51cc49[_0x51fd('0x55')][_0x51fd('0xa5')]});})[_0x51fd('0x1c')](function(_0x522f1a){_0x51cc49[_0x51fd('0x25')]=_0x522f1a;if(_0x51cc49[_0x51fd('0xa2')][_0x51fd('0xa6')]){return db[_0x51fd('0xa7')][_0x51fd('0x5c')]({'attributes':['id',_0x51fd('0x39')],'where':{'id':_0x51cc49[_0x51fd('0xa2')][_0x51fd('0xa6')]}})[_0x51fd('0x1c')](function(_0x3b1810){if(_0x3b1810){_0x51cc49[_0x51fd('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b1810[_0x51fd('0x39')]+','+(_0x51cc49[_0x51fd('0x70')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x51fd('0xa8'),_0x51cc49);});}return respondWithRpcPromise(_0x51fd('0xa9'),'startRouting',_0x51cc49);})[_0x51fd('0x1c')](function(_0x4bec7c){if(_0x4bec7c){var _0x51285b=0xc8;var _0x12e97f=_0x51fd('0xaa');logger[_0x51fd('0x1d')](_0x51fd('0x21'),_0x12e97f,_0x51285b,_0x51fd('0xab'));logger['debug'](_0x51fd('0xac'),_0x12e97f,_0x51285b,_0x51fd('0xab'),JSON[_0x51fd('0x22')](_0x4bec7c));if(_0x51cc49[_0x51fd('0x70')][_0x51fd('0x49')]==='twilio'){return _0x300bc1[_0x51fd('0x29')](_0x51285b)[_0x51fd('0xad')](_0x51fd('0xae'),_0x51fd('0xaf'))['send']('\x0a');}else{return _0x300bc1[_0x51fd('0x29')](_0x51285b)[_0x51fd('0x2f')](_0x4bec7c);}}})['catch'](handleError(_0x300bc1,null));};exports['addApplications']=function(_0x58f186,_0x2864ac,_0x5379c5){return db[_0x51fd('0x3c')][_0x51fd('0x62')]({'where':{'id':_0x58f186[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x2864ac,null))['then'](function(_0x12552e){if(_0x12552e){return db['sequelize'][_0x51fd('0xb0')](function(_0x26863f){return db[_0x51fd('0xb1')][_0x51fd('0x34')]({'where':{'SmsAccountId':_0x58f186[_0x51fd('0x52')]['id']},'transaction':_0x26863f})['then'](function(_0x15d456){var _0x5d1e89=_[_0x51fd('0x66')](_0x58f186['body'],function(_0x85714b){_0x85714b[_0x51fd('0x5f')]=_0x58f186['params']['id'];return _0x85714b;});return db[_0x51fd('0xb1')][_0x51fd('0xb2')](_0x5d1e89,{'transaction':_0x26863f});});})[_0x51fd('0x1c')](function(){return db[_0x51fd('0xb1')][_0x51fd('0xb3')]({'where':{'SmsAccountId':_0x58f186[_0x51fd('0x52')]['id']},'order':_0x51fd('0x73')});});}})['then'](respondWithResult(_0x2864ac,null))[_0x51fd('0x27')](handleError(_0x2864ac,null));};exports[_0x51fd('0xb4')]=function(_0x42d9ed,_0x588e91,_0x2f053f){var _0x3cd09e={};var _0x403172={};var _0x3d4245;var _0x1ec610;return db[_0x51fd('0x3c')][_0x51fd('0x62')]({'where':{'id':_0x42d9ed[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x588e91,null))['then'](function(_0x369a60){if(_0x369a60){_0x3d4245=_0x369a60;_0x403172[_0x51fd('0x3d')]=_[_0x51fd('0x3e')](db[_0x51fd('0xb1')]['rawAttributes']);_0x403172[_0x51fd('0x3f')]=_[_0x51fd('0x3e')](_0x42d9ed['query']);_0x403172[_0x51fd('0x46')]=_[_0x51fd('0x40')](_0x403172[_0x51fd('0x3d')],_0x403172[_0x51fd('0x3f')]);_0x3cd09e[_0x51fd('0x41')]=_[_0x51fd('0x40')](_0x403172[_0x51fd('0x3d')],qs['fields'](_0x42d9ed[_0x51fd('0x3f')][_0x51fd('0x42')]));_0x3cd09e[_0x51fd('0x41')]=_0x3cd09e[_0x51fd('0x41')][_0x51fd('0x64')]?_0x3cd09e[_0x51fd('0x41')]:_0x403172[_0x51fd('0x3d')];_0x3cd09e[_0x51fd('0x65')]=qs['sort'](_0x42d9ed[_0x51fd('0x3f')][_0x51fd('0x44')]);_0x3cd09e[_0x51fd('0x45')]=qs[_0x51fd('0x46')](_[_0x51fd('0x6b')](_0x42d9ed['query'],_0x403172[_0x51fd('0x46')]));if(_0x42d9ed[_0x51fd('0x3f')][_0x51fd('0x47')]){_0x3cd09e['where']=_[_0x51fd('0x48')](_0x3cd09e[_0x51fd('0x45')],{'$or':_[_0x51fd('0x66')](_0x3cd09e[_0x51fd('0x41')],function(_0x2fef60){var _0x1065ab={};_0x1065ab[_0x2fef60]={'$like':'%'+_0x42d9ed[_0x51fd('0x3f')][_0x51fd('0x47')]+'%'};return _0x1065ab;})});}_0x3cd09e=_[_0x51fd('0x48')]({},_0x3cd09e,_0x42d9ed[_0x51fd('0x4c')]);return _0x3d4245[_0x51fd('0xb4')](_0x3cd09e);}})['then'](function(_0x590c83){if(_0x590c83){_0x1ec610=_0x590c83['length'];if(!_0x42d9ed['query']['hasOwnProperty'](_0x51fd('0x43'))){_0x3cd09e[_0x51fd('0x2d')]=qs[_0x51fd('0x2d')](_0x42d9ed[_0x51fd('0x3f')][_0x51fd('0x2d')]);_0x3cd09e[_0x51fd('0x2c')]=qs[_0x51fd('0x2c')](_0x42d9ed[_0x51fd('0x3f')][_0x51fd('0x2c')]);}return _0x3d4245[_0x51fd('0xb4')](_0x3cd09e);}})['then'](function(_0xeefcfa){if(_0xeefcfa){return _0xeefcfa?{'count':_0x1ec610,'rows':_0xeefcfa}:null;}})[_0x51fd('0x1c')](respondWithResult(_0x588e91,null))[_0x51fd('0x27')](handleError(_0x588e91,null));};exports[_0x51fd('0xb5')]=function(_0x1967a4,_0x54812a,_0x466584){var _0x36a903={'raw':![],'where':{}};var _0x55da34={};var _0x43a7d9={'count':0x0,'rows':[]};return db['SmsAccount'][_0x51fd('0x62')]({'where':{'id':_0x1967a4[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x54812a,null))[_0x51fd('0x1c')](function(_0x529483){if(_0x529483){_0x55da34['model']=_['keys'](db[_0x51fd('0x9c')][_0x51fd('0x63')]);_0x55da34[_0x51fd('0x3f')]=_['keys'](_0x1967a4[_0x51fd('0x3f')]);_0x55da34[_0x51fd('0x46')]=_[_0x51fd('0x40')](_0x55da34[_0x51fd('0x3d')],_0x55da34[_0x51fd('0x3f')]);_0x36a903[_0x51fd('0x41')]=_[_0x51fd('0x40')](_0x55da34[_0x51fd('0x3d')],qs[_0x51fd('0x42')](_0x1967a4['query'][_0x51fd('0x42')]));_0x36a903[_0x51fd('0x41')]=_0x36a903[_0x51fd('0x41')][_0x51fd('0x64')]?_0x36a903[_0x51fd('0x41')]:_0x55da34['model'];if(!_0x1967a4[_0x51fd('0x3f')][_0x51fd('0x6a')]('nolimit')){_0x36a903[_0x51fd('0x2d')]=qs[_0x51fd('0x2d')](_0x1967a4[_0x51fd('0x3f')][_0x51fd('0x2d')]);_0x36a903[_0x51fd('0x2c')]=qs['offset'](_0x1967a4[_0x51fd('0x3f')][_0x51fd('0x2c')]);}_0x36a903[_0x51fd('0x65')]=qs[_0x51fd('0x44')](_0x1967a4[_0x51fd('0x3f')][_0x51fd('0x44')]);_0x36a903[_0x51fd('0x45')]=qs[_0x51fd('0x46')](_['pick'](_0x1967a4['query'],_0x55da34[_0x51fd('0x46')]));_0x36a903[_0x51fd('0x45')]['SmsAccountId']=_0x529483['id'];if(_0x1967a4[_0x51fd('0x3f')][_0x51fd('0x47')]){_0x36a903[_0x51fd('0x45')]=_[_0x51fd('0x48')](_0x36a903['where'],{'$or':_[_0x51fd('0x66')](_0x36a903[_0x51fd('0x41')],function(_0x376472){var _0x459acc={};_0x459acc[_0x376472]={'$like':'%'+_0x1967a4[_0x51fd('0x3f')][_0x51fd('0x47')]+'%'};return _0x459acc;})});}_0x36a903=_[_0x51fd('0x48')]({},_0x36a903,_0x1967a4[_0x51fd('0x4c')]);return db['SmsInteraction'][_0x51fd('0x2b')]({'where':_0x36a903[_0x51fd('0x45')]})[_0x51fd('0x1c')](function(_0x2f28df){_0x43a7d9['count']=_0x2f28df;if(_0x1967a4['query']['includeAll']){_0x36a903[_0x51fd('0x4e')]=[{'model':db[_0x51fd('0x75')],'as':_0x51fd('0xb6'),'required':![]},{'model':db[_0x51fd('0xa7')],'as':_0x51fd('0xb7'),'attributes':[_0x51fd('0x39'),_0x51fd('0xb8'),_0x51fd('0xb9')],'required':![]},{'model':db[_0x51fd('0xba')],'as':'Tags','attributes':['id','name','color'],'where':_0x1967a4['query'][_0x51fd('0xbb')]?{'id':_0x1967a4[_0x51fd('0x3f')][_0x51fd('0xbb')]}:undefined,'required':_0x1967a4[_0x51fd('0x3f')][_0x51fd('0xbb')]?!![]:![]}];}return db[_0x51fd('0x9c')][_0x51fd('0x4f')](_0x36a903);})[_0x51fd('0x1c')](function(_0x2321b5){_0x43a7d9[_0x51fd('0x50')]=_0x2321b5;return _0x43a7d9;});}})[_0x51fd('0x1c')](respondWithFilteredResult(_0x54812a,_0x36a903))['catch'](handleError(_0x54812a,null));};exports['send']=function(_0x4aacbf,_0x3aa078,_0x9317aa){var _0x425dc5,_0x56641d,_0x1e0e10;if(_[_0x51fd('0x92')](_0x4aacbf['body'][_0x51fd('0x55')])||_0x4aacbf['body'][_0x51fd('0x55')]===''){throw new db[(_0x51fd('0x76'))]['ValidationError'](_0x51fd('0x94'));}if(_['isNil'](_0x4aacbf['body']['to'])){throw new db[(_0x51fd('0x76'))][(_0x51fd('0x77'))](_0x51fd('0xbc'));}_0x425dc5=_0x4aacbf[_0x51fd('0x55')]['to'];return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x4aacbf[_0x51fd('0x52')]['id']},'include':[{'model':db[_0x51fd('0x97')],'as':_0x51fd('0xbd'),'include':[{'model':db[_0x51fd('0x75')],'as':_0x51fd('0x98'),'where':{'mobile':_0x425dc5},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x51fd('0x1c')](handleEntityNotFound(_0x3aa078,null))[_0x51fd('0x1c')](function(_0x37f0cf){if(_0x37f0cf&&_0x37f0cf[_0x51fd('0xbd')]){_0x56641d=_0x37f0cf[_0x51fd('0x35')]({'plain':!![]});if(_0x56641d[_0x51fd('0xbd')]&&_0x56641d[_0x51fd('0xbd')][_0x51fd('0x98')][_0x51fd('0x64')]){return _0x56641d[_0x51fd('0xbd')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x51fd('0x9b')](_0x4aacbf[_0x51fd('0x55')],{'firstName':_0x425dc5,'mobile':_0x425dc5,'phone':_0x425dc5,'ListId':_0x56641d['ListId']}));}})['then'](handleEntityNotFound(_0x3aa078,null))['then'](function(_0x19a580){if(_0x19a580){_0x1e0e10=_0x19a580;return db[_0x51fd('0x9c')][_0x51fd('0x5c')]({'where':{'ContactId':_0x1e0e10['id'],'closed':![],'SmsAccountId':_0x56641d['id']}})[_0x51fd('0x1c')](function(_0x320061){if(_0x320061){return[_0x320061,![]];}return db[_0x51fd('0x9c')][_0x51fd('0x54')]({'UserId':_0x4aacbf[_0x51fd('0x56')]['id'],'ContactId':_0x1e0e10['id'],'SmsAccountId':_0x56641d['id'],'phone':_0x425dc5,'firstMsgDirection':_0x51fd('0xbe'),'Messages':[_[_0x51fd('0x48')](_0x4aacbf[_0x51fd('0x55')],{'read':![],'body':_0x4aacbf[_0x51fd('0x55')]['body'],'phone':_0x425dc5,'SmsAccountId':_0x56641d['id'],'UserId':_0x4aacbf[_0x51fd('0x56')]['id'],'ContactId':_0x1e0e10['id']})]},{'include':[{'model':db[_0x51fd('0xa3')],'as':_0x51fd('0xbf')}]})[_0x51fd('0x1c')](function(_0x14f6a5){return[_0x14f6a5,!![]];});});}})[_0x51fd('0x9d')](function(_0x3b879b,_0x892bc){if(_0x892bc){return _0x3b879b;}return db['SmsMessage'][_0x51fd('0x54')](_['merge'](_0x4aacbf['body'],{'read':![],'body':_0x4aacbf['body']['body'],'phone':_0x425dc5,'SmsAccountId':_0x56641d['id'],'SmsInteractionId':_0x3b879b['id'],'UserId':_0x4aacbf[_0x51fd('0x56')]['id'],'ContactId':_0x1e0e10['id']}))[_0x51fd('0x1c')](function(_0x585374){_0x3b879b[_0x51fd('0xc0')]['Messages']=[];_0x3b879b[_0x51fd('0xc0')]['Messages'][_0x51fd('0xa0')](_0x585374[_0x51fd('0xc0')]);return _0x3b879b;});})[_0x51fd('0x1c')](respondWithResult(_0x3aa078,null))[_0x51fd('0x27')](handleError(_0x3aa078,null));};exports['status']=function(_0x201fc0,_0x3cdbd9,_0x4b56c1){if(_0x201fc0[_0x51fd('0x55')]['id']){delete _0x201fc0[_0x51fd('0x55')]['id'];}console[_0x51fd('0xc1')](_0x51fd('0xc2'),_0x201fc0[_0x51fd('0x55')]);var _0x502a59,_0x237a77,_0x55b670;return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x201fc0[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x3cdbd9,null))['then'](function(_0x21af59){if(_0x21af59){_0x55b670=_0x21af59;logger[_0x51fd('0x20')](_0x51fd('0x21'),'status','received\x20delivery\x20report\x20from',_0x21af59[_0x51fd('0x49')],util[_0x51fd('0xc3')](_0x201fc0['body'],{'showHidden':![],'depth':null}));switch(_0x21af59[_0x51fd('0x49')]){case _0x51fd('0x84'):if(_0x201fc0[_0x51fd('0x55')][_0x51fd('0xc4')]&&_0x201fc0[_0x51fd('0x55')]['status']){_0x237a77=_0x201fc0['body']['status'];return db['SmsMessage'][_0x51fd('0x5c')]({'where':{'messageId':_0x201fc0[_0x51fd('0x55')][_0x51fd('0xc4')]}});}break;case'connectel':if(_0x201fc0[_0x51fd('0x55')][_0x51fd('0xc5')]&&_0x201fc0['body'][_0x51fd('0xc6')]){_0x237a77=_0x201fc0[_0x51fd('0x55')][_0x51fd('0xc6')];return db['SmsMessage']['find']({'where':{'messageId':_0x201fc0[_0x51fd('0x55')]['requestid']}});}break;case _0x51fd('0x87'):if(_0x201fc0[_0x51fd('0x55')]['message_id']&&_0x201fc0[_0x51fd('0x55')]['status_code']){_0x237a77=_0x201fc0[_0x51fd('0x55')]['status_code'];return db[_0x51fd('0xa3')][_0x51fd('0x5c')]({'where':{'messageId':_0x201fc0[_0x51fd('0x55')][_0x51fd('0x88')]}});}break;case _0x51fd('0xc7'):var _0x2e1ac9=_0x201fc0['body'][_0x51fd('0x8b')][0x0];if(_0x2e1ac9[_0x51fd('0x82')]&&_0x2e1ac9['status'][_0x51fd('0xc8')]==='DELIVERED'){_0x237a77=_0x2e1ac9['status']['groupName'];return db[_0x51fd('0xa3')][_0x51fd('0x5c')]({'where':{'messageId':_0x2e1ac9[_0x51fd('0x82')]}});}break;case'clickatell':if(_0x201fc0[_0x51fd('0x55')][_0x51fd('0x82')]&&_0x201fc0[_0x51fd('0x55')]['status']){_0x237a77=_0x201fc0['body'][_0x51fd('0x29')];return db[_0x51fd('0xa3')][_0x51fd('0x5c')]({'where':{'messageId':_0x201fc0[_0x51fd('0x55')][_0x51fd('0x82')]}});}break;case _0x51fd('0x91'):if(_0x201fc0[_0x51fd('0x55')][_0x51fd('0xc9')]&&_0x201fc0[_0x51fd('0x55')][_0x51fd('0x29')]){_0x237a77=_0x201fc0[_0x51fd('0x55')][_0x51fd('0x29')];return db[_0x51fd('0xa3')][_0x51fd('0x5c')]({'where':{'messageId':_0x201fc0[_0x51fd('0x55')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x3cdbd9,null))['then'](function(_0x55a23c){if(_0x55a23c){_0x502a59=_0x55a23c;switch(_0x55b670[_0x51fd('0x49')]){case'skebby':if(_0x237a77===_0x51fd('0xca')){return _0x502a59[_0x51fd('0x33')]({'read':!![]});}else{logger[_0x51fd('0x23')](_0x51fd('0x21'),_0x51fd('0x29'),_0x51fd('0x84'),util[_0x51fd('0xc3')](_0x201fc0[_0x51fd('0x55')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x237a77==='1'){return _0x502a59[_0x51fd('0x33')]({'read':!![]});}else{logger[_0x51fd('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x51fd('0x84'),util['inspect'](_0x201fc0[_0x51fd('0x55')],{'showHidden':![],'depth':null}));}break;case _0x51fd('0x87'):if(!_0x201fc0[_0x51fd('0x55')][_0x51fd('0xcb')]&&_0x237a77>=0xc8&&_0x237a77<=0xce){return _0x502a59[_0x51fd('0x33')]({'read':!![]});}else{logger[_0x51fd('0x23')](_0x51fd('0x21'),_0x51fd('0x29'),_0x51fd('0x87'),util[_0x51fd('0xc3')](_0x201fc0[_0x51fd('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5c84a2=_0x201fc0[_0x51fd('0x55')][_0x51fd('0x8b')][0x0];if(_0x5c84a2['status']['groupName']===_0x51fd('0xca')){return _0x502a59[_0x51fd('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x51fd('0xc3')](_0x201fc0[_0x51fd('0x55')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x237a77=='DELIVERED_TO_GATEWAY'||_0x237a77==_0x51fd('0xcc')){return _0x502a59[_0x51fd('0x33')]({'read':!![]});}else{logger[_0x51fd('0x23')](_0x51fd('0x21'),_0x51fd('0x29'),_0x51fd('0x8e'),util[_0x51fd('0xc3')](_0x201fc0[_0x51fd('0x55')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x237a77===_0x51fd('0xcd')||_0x237a77===_0x51fd('0xce')){return _0x502a59[_0x51fd('0x33')]({'read':!![]});}else{logger[_0x51fd('0x23')](_0x51fd('0x21'),_0x51fd('0x29'),_0x51fd('0x91'),util['inspect'](_0x201fc0[_0x51fd('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x502a59;}})[_0x51fd('0x1c')](respondWithResult(_0x3cdbd9,null))[_0x51fd('0x27')](handleError(_0x3cdbd9,null));};exports[_0x51fd('0xcf')]=function(_0xb9cfa5,_0x5e7bf7,_0xe2c315){var _0xfbb2d0,_0x3f1cd5,_0x3e5563;return db[_0x51fd('0x3c')]['find']({'where':{'id':_0xb9cfa5[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x5e7bf7,null))[_0x51fd('0x1c')](function(_0x850ed0){if(_0x850ed0){_0x3e5563=_0x850ed0;logger[_0x51fd('0x20')](_0x51fd('0x21'),_0x51fd('0x29'),_0x51fd('0xd0'),_0x850ed0[_0x51fd('0x49')],util['inspect'](_0xb9cfa5[_0x51fd('0x3f')],{'showHidden':![],'depth':null}));switch(_0x850ed0['type']){case _0x51fd('0x8c'):if(_0xb9cfa5[_0x51fd('0x3f')]['message-id']&&_0xb9cfa5[_0x51fd('0x3f')][_0x51fd('0xd1')]){_0x3f1cd5=_0xb9cfa5[_0x51fd('0x3f')][_0x51fd('0xd1')];return db[_0x51fd('0xa3')][_0x51fd('0x5c')]({'where':{'messageId':_0xb9cfa5[_0x51fd('0x3f')][_0x51fd('0xd2')]}});}break;}}})[_0x51fd('0x1c')](handleEntityNotFound(_0x5e7bf7,null))['then'](function(_0x2d4cdb){if(_0x2d4cdb){_0xfbb2d0=_0x2d4cdb;switch(_0x3e5563[_0x51fd('0x49')]){case _0x51fd('0x8c'):if(_0x3f1cd5==='2'||_0x3f1cd5==='6'){return _0xfbb2d0[_0x51fd('0x33')]({'read':!![]});}else{logger['error'](_0x51fd('0x21'),_0x51fd('0x29'),_0x51fd('0x8c'),util['inspect'](_0xb9cfa5[_0x51fd('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0xfbb2d0;}})['then'](respondWithResult(_0x5e7bf7,null))[_0x51fd('0x27')](handleError(_0x5e7bf7,null));};exports[_0x51fd('0xd3')]=function(_0x1b6729,_0x280d93,_0x14255c){return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x1b6729[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x280d93,null))[_0x51fd('0x1c')](function(_0x1c4509){if(_0x1c4509){return _0x1c4509[_0x51fd('0xd3')](_0x1b6729['body'][_0x51fd('0x68')],_['omit'](_0x1b6729[_0x51fd('0x55')],[_0x51fd('0x68'),'id'])||{})['spread'](function(_0x273123){for(var _0x12402b=0x0;_0x12402b<_0x1b6729[_0x51fd('0x55')][_0x51fd('0x68')][_0x51fd('0x64')];_0x12402b+=0x1){socket[_0x51fd('0xd4')]('userSmsAccount:save',{'UserId':_0x1b6729['body']['ids'][_0x12402b],'SmsAccountId':_0x1b6729['params']['id']});}return _0x273123;});}})[_0x51fd('0x1c')](respondWithResult(_0x280d93,null))[_0x51fd('0x27')](handleError(_0x280d93,null));};exports[_0x51fd('0xd5')]=function(_0x5e08f3,_0x2864fe,_0x3c14cc){return db[_0x51fd('0x3c')][_0x51fd('0x5c')]({'where':{'id':_0x5e08f3[_0x51fd('0x52')]['id']}})[_0x51fd('0x1c')](handleEntityNotFound(_0x2864fe,null))[_0x51fd('0x1c')](function(_0x4a9408){if(_0x4a9408){return _0x4a9408['removeAgents'](_0x5e08f3[_0x51fd('0x3f')][_0x51fd('0x68')])[_0x51fd('0x1c')](function(){if(_[_0x51fd('0xd6')](_0x5e08f3[_0x51fd('0x3f')][_0x51fd('0x68')])){for(var _0x1aaed8=0x0;_0x1aaed8<_0x5e08f3[_0x51fd('0x3f')][_0x51fd('0x68')][_0x51fd('0x64')];_0x1aaed8+=0x1){socket[_0x51fd('0xd4')](_0x51fd('0xd7'),{'UserId':Number(_0x5e08f3[_0x51fd('0x3f')][_0x51fd('0x68')][_0x1aaed8]),'SmsAccountId':Number(_0x5e08f3['params']['id'])});}}else{socket[_0x51fd('0xd4')](_0x51fd('0xd7'),{'UserId':Number(_0x5e08f3['query'][_0x51fd('0x68')]),'SmsAccountId':Number(_0x5e08f3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2864fe,null))[_0x51fd('0x27')](handleError(_0x2864fe,null));};exports[_0x51fd('0xd8')]=function(_0x1ecf36,_0x2924bb,_0x393a2d){var _0x33eb4c={};var _0x2c70f4={};var _0xbc0059;var _0x27eca6;return db[_0x51fd('0x3c')][_0x51fd('0x62')]({'where':{'id':_0x1ecf36[_0x51fd('0x52')]['id']}})['then'](handleEntityNotFound(_0x2924bb,null))['then'](function(_0xe58009){if(_0xe58009){_0xbc0059=_0xe58009;_0x2c70f4[_0x51fd('0x3d')]=_[_0x51fd('0x3e')](db[_0x51fd('0xa7')][_0x51fd('0x63')]);_0x2c70f4[_0x51fd('0x3f')]=_[_0x51fd('0x3e')](_0x1ecf36[_0x51fd('0x3f')]);_0x2c70f4[_0x51fd('0x46')]=_['intersection'](_0x2c70f4['model'],_0x2c70f4[_0x51fd('0x3f')]);_0x33eb4c['attributes']=_[_0x51fd('0x40')](_0x2c70f4['model'],qs[_0x51fd('0x42')](_0x1ecf36[_0x51fd('0x3f')][_0x51fd('0x42')]));_0x33eb4c[_0x51fd('0x41')]=_0x33eb4c[_0x51fd('0x41')][_0x51fd('0x64')]?_0x33eb4c['attributes']:_0x2c70f4[_0x51fd('0x3d')];_0x33eb4c[_0x51fd('0x65')]=qs[_0x51fd('0x44')](_0x1ecf36[_0x51fd('0x3f')]['sort']);_0x33eb4c['where']=qs[_0x51fd('0x46')](_[_0x51fd('0x6b')](_0x1ecf36[_0x51fd('0x3f')],_0x2c70f4[_0x51fd('0x46')]));if(_0x1ecf36[_0x51fd('0x3f')][_0x51fd('0x47')]){_0x33eb4c['where']=_[_0x51fd('0x48')](_0x33eb4c[_0x51fd('0x45')],{'$or':_[_0x51fd('0x66')](_0x33eb4c[_0x51fd('0x41')],function(_0x2daa66){var _0x26a09d={};_0x26a09d[_0x2daa66]={'$like':'%'+_0x1ecf36[_0x51fd('0x3f')]['filter']+'%'};return _0x26a09d;})});}_0x33eb4c=_[_0x51fd('0x48')]({},_0x33eb4c,_0x1ecf36['options']);return _0xbc0059[_0x51fd('0xd8')](_0x33eb4c);}})['then'](function(_0x42da14){if(_0x42da14){_0x27eca6=_0x42da14[_0x51fd('0x64')];if(!_0x1ecf36[_0x51fd('0x3f')][_0x51fd('0x6a')](_0x51fd('0x43'))){_0x33eb4c['limit']=qs['limit'](_0x1ecf36['query'][_0x51fd('0x2d')]);_0x33eb4c['offset']=qs['offset'](_0x1ecf36[_0x51fd('0x3f')]['offset']);}return _0xbc0059[_0x51fd('0xd8')](_0x33eb4c);}})[_0x51fd('0x1c')](function(_0x205b84){if(_0x205b84){return _0x205b84?{'count':_0x27eca6,'rows':_0x205b84}:null;}})['then'](respondWithResult(_0x2924bb,null))[_0x51fd('0x27')](handleError(_0x2924bb,null));}; \ No newline at end of file +var _0xd3e4=['SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','MessageSid','sender','messageId','message_id','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','text','replyMessageId','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','SmsInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','addApplications','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','Messages','spread','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','clicksend','status_code','infobip','groupName','redif','inspect','connectel','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','./smsAccount.socket','register','jayson/promise','client','http','test','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','count','limit','set','Content-Range','save','update','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','offset','where','pick','filter','merge','map','type','key','field','options','SmsAccount','includeAll','include','findAll','rows','show','params','filters','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','SmsAccountId','Disposition','findOne','order','sort','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms'];(function(_0x3261c5,_0x26a8f0){var _0x2dca16=function(_0xd73787){while(--_0xd73787){_0x3261c5['push'](_0x3261c5['shift']());}};_0x2dca16(++_0x26a8f0);}(_0xd3e4,0x14c));var _0x4d3e=function(_0x1a33bc,_0x53cb68){_0x1a33bc=_0x1a33bc-0x0;var _0x4e9dfa=_0xd3e4[_0x1a33bc];return _0x4e9dfa;};'use strict';var pdf=require(_0x4d3e('0x0'));var emlformat=require(_0x4d3e('0x1'));var rimraf=require(_0x4d3e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d3e('0x3'));var rp=require('request-promise');var moment=require(_0x4d3e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4d3e('0x5'));var util=require(_0x4d3e('0x6'));var path=require(_0x4d3e('0x7'));var sox=require(_0x4d3e('0x8'));var csv=require('to-csv');var ejs=require(_0x4d3e('0x9'));var fs=require('fs');var _=require(_0x4d3e('0xa'));var squel=require(_0x4d3e('0xb'));var crypto=require(_0x4d3e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4d3e('0xd'));var toCsv=require(_0x4d3e('0xe'));var querystring=require('querystring');var Papa=require(_0x4d3e('0xf'));var Redis=require(_0x4d3e('0x10'));var authService=require(_0x4d3e('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4d3e('0x12'));var logger=require(_0x4d3e('0x13'))('api');var utils=require(_0x4d3e('0x14'));var config=require('../../config/environment');var db=require(_0x4d3e('0x15'))['db'];config[_0x4d3e('0x16')]=_[_0x4d3e('0x17')](config[_0x4d3e('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d3e('0x16')]));require(_0x4d3e('0x18'))[_0x4d3e('0x19')](socket);var jayson=require(_0x4d3e('0x1a'));var client=jayson[_0x4d3e('0x1b')][_0x4d3e('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x2ebc0d,_0x21c531,_0x149664){if(_0x149664){var _0x19f208=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19f208[_0x4d3e('0x1d')](_0x21c531)){return _0x2ebc0d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2ebc0d;}}function respondWithRpcPromise(_0x163b45,_0xc1189d,_0x4c9675,_0x578f10){return new BPromise(function(_0x330897,_0x2c22ed){var _0x533533=_0x578f10||client;return _0x533533[_0x4d3e('0x1e')](_0x163b45,_0x4c9675)[_0x4d3e('0x1f')](function(_0x1b72a5){logger[_0x4d3e('0x20')](_0x4d3e('0x21'),_0xc1189d,_0x4d3e('0x22'));logger[_0x4d3e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc1189d,_0x4d3e('0x22'),JSON[_0x4d3e('0x24')](_0x1b72a5));if(_0x1b72a5[_0x4d3e('0x25')]){if(_0x1b72a5[_0x4d3e('0x25')]['code']===0x1f4){logger[_0x4d3e('0x25')]('SmsAccount,\x20%s,\x20%s',_0xc1189d,_0x1b72a5[_0x4d3e('0x25')]['message']);return _0x2c22ed(_0x1b72a5[_0x4d3e('0x25')]['message']);}logger[_0x4d3e('0x25')](_0x4d3e('0x21'),_0xc1189d,_0x1b72a5[_0x4d3e('0x25')][_0x4d3e('0x26')]);return _0x330897(_0x1b72a5[_0x4d3e('0x25')][_0x4d3e('0x26')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0xc1189d,_0x4d3e('0x22'));_0x330897(_0x1b72a5['result'][_0x4d3e('0x26')]);}})[_0x4d3e('0x27')](function(_0x27b8ba){logger[_0x4d3e('0x25')](_0x4d3e('0x21'),_0xc1189d,_0x27b8ba);_0x2c22ed(_0x27b8ba);});});}function respondWithStatusCode(_0x791d62,_0x18ece2){_0x18ece2=_0x18ece2||0xcc;return function(_0x356ff8){if(_0x356ff8){return _0x791d62[_0x4d3e('0x28')](_0x18ece2);}return _0x791d62[_0x4d3e('0x29')](_0x18ece2)[_0x4d3e('0x2a')]();};}function respondWithResult(_0x4dd6eb,_0xe1b7de){_0xe1b7de=_0xe1b7de||0xc8;return function(_0x3a1018){if(_0x3a1018){return _0x4dd6eb['status'](_0xe1b7de)[_0x4d3e('0x2b')](_0x3a1018);}};}function respondWithFilteredResult(_0x55708a,_0x2ff765){return function(_0x1e367b){if(_0x1e367b){var _0x25b967=_0x1e367b[_0x4d3e('0x2c')],_0x3817eb=_0x2ff765['offset'],_0x4b20c4=_0x2ff765['offset']+_0x2ff765[_0x4d3e('0x2d')],_0x339194;if(_0x4b20c4>=_0x25b967){_0x4b20c4=_0x25b967;_0x339194=0xc8;}else{_0x339194=0xce;}_0x55708a[_0x4d3e('0x29')](_0x339194);return _0x55708a[_0x4d3e('0x2e')](_0x4d3e('0x2f'),_0x3817eb+'-'+_0x4b20c4+'/'+_0x25b967)[_0x4d3e('0x2b')](_0x1e367b);}return null;};}function patchUpdates(_0x17c3e0){return function(_0x49cdcd){try{jsonpatch['apply'](_0x49cdcd,_0x17c3e0,!![]);}catch(_0x118717){return BPromise['reject'](_0x118717);}return _0x49cdcd[_0x4d3e('0x30')]();};}function saveUpdates(_0x2d47ba,_0x2b07ae){return function(_0x601e3a){if(_0x601e3a){return _0x601e3a[_0x4d3e('0x31')](_0x2d47ba)['then'](function(_0x571a99){return _0x571a99;});}return null;};}function removeEntity(_0x175af3,_0x4d64b4){return function(_0x8eaa70){if(_0x8eaa70){return _0x8eaa70['destroy']()['then'](function(){var _0x3bdfdc=_0x8eaa70[_0x4d3e('0x32')]({'plain':!![]});var _0x1a086b=_0x4d3e('0x33');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a086b,'resourceId':_0x3bdfdc['id']}})[_0x4d3e('0x1f')](function(){return _0x8eaa70;});})[_0x4d3e('0x1f')](function(){_0x175af3[_0x4d3e('0x29')](0xcc)[_0x4d3e('0x2a')]();});}};}function handleEntityNotFound(_0x28498b,_0x46f74a){return function(_0x161b9c){if(!_0x161b9c){_0x28498b[_0x4d3e('0x28')](0x194);}return _0x161b9c;};}function handleError(_0x51f007,_0x4f4639){_0x4f4639=_0x4f4639||0x1f4;return function(_0x580823){logger['error'](_0x580823[_0x4d3e('0x34')]);if(_0x580823[_0x4d3e('0x35')]){delete _0x580823[_0x4d3e('0x35')];}_0x51f007[_0x4d3e('0x29')](_0x4f4639)[_0x4d3e('0x36')](_0x580823);};}exports[_0x4d3e('0x37')]=function(_0x2f1311,_0x162921){var _0x5b4230={'include':[{'model':db[_0x4d3e('0x38')],'as':_0x4d3e('0x39')}]},_0x5e39fa={},_0x307f38={'count':0x0,'rows':[]};var _0x1d1928=db['SmsAccount'][_0x4d3e('0x3a')];_0x5e39fa[_0x4d3e('0x3b')]=_[_0x4d3e('0x3c')](_0x1d1928);_0x5e39fa[_0x4d3e('0x3d')]=_[_0x4d3e('0x3c')](_0x2f1311[_0x4d3e('0x3d')]);_0x5e39fa['filters']=_[_0x4d3e('0x3e')](_0x5e39fa[_0x4d3e('0x3b')],_0x5e39fa[_0x4d3e('0x3d')]);_0x5b4230[_0x4d3e('0x3f')]=_[_0x4d3e('0x3e')](_0x5e39fa[_0x4d3e('0x3b')],qs['fields'](_0x2f1311[_0x4d3e('0x3d')]['fields']));_0x5b4230['attributes']=_0x5b4230['attributes'][_0x4d3e('0x40')]?_0x5b4230[_0x4d3e('0x3f')]:_0x5e39fa[_0x4d3e('0x3b')];if(!_0x2f1311[_0x4d3e('0x3d')][_0x4d3e('0x41')](_0x4d3e('0x42'))){_0x5b4230[_0x4d3e('0x2d')]=qs[_0x4d3e('0x2d')](_0x2f1311['query'][_0x4d3e('0x2d')]);_0x5b4230[_0x4d3e('0x43')]=qs['offset'](_0x2f1311[_0x4d3e('0x3d')][_0x4d3e('0x43')]);}_0x5b4230['order']=qs['sort'](_0x2f1311[_0x4d3e('0x3d')]['sort']);_0x5b4230[_0x4d3e('0x44')]=qs['filters'](_[_0x4d3e('0x45')](_0x2f1311[_0x4d3e('0x3d')],_0x5e39fa['filters']));if(_0x2f1311[_0x4d3e('0x3d')][_0x4d3e('0x46')]){_0x5b4230[_0x4d3e('0x44')]=_[_0x4d3e('0x47')](_0x5b4230[_0x4d3e('0x44')],{'$or':_[_0x4d3e('0x48')](_0x1d1928,function(_0x1a77fa){if(_0x1a77fa[_0x4d3e('0x49')][_0x4d3e('0x4a')]!=='VIRTUAL'){var _0x14583e={};_0x14583e[_0x1a77fa[_0x4d3e('0x4b')]]={'$like':'%'+_0x2f1311[_0x4d3e('0x3d')][_0x4d3e('0x46')]+'%'};return _0x14583e;}})});}_0x5b4230=_['merge']({},_0x5b4230,_0x2f1311[_0x4d3e('0x4c')]);var _0x13f893={'where':_0x5b4230[_0x4d3e('0x44')]};return db[_0x4d3e('0x4d')][_0x4d3e('0x2c')](_0x13f893)[_0x4d3e('0x1f')](function(_0x170dbe){_0x307f38['count']=_0x170dbe;if(_0x2f1311['query'][_0x4d3e('0x4e')]){_0x5b4230[_0x4d3e('0x4f')]=[{'all':!![]}];}return db[_0x4d3e('0x4d')][_0x4d3e('0x50')](_0x5b4230);})[_0x4d3e('0x1f')](function(_0x15273d){_0x307f38[_0x4d3e('0x51')]=_0x15273d;return _0x307f38;})[_0x4d3e('0x1f')](respondWithFilteredResult(_0x162921,_0x5b4230))[_0x4d3e('0x27')](handleError(_0x162921,null));};exports[_0x4d3e('0x52')]=function(_0x525b92,_0x567de8){var _0x374b72={'raw':![],'where':{'id':_0x525b92[_0x4d3e('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x4d3e('0x39')}]},_0xb4dccd={};_0xb4dccd[_0x4d3e('0x3b')]=_['keys'](db[_0x4d3e('0x4d')][_0x4d3e('0x3a')]);_0xb4dccd[_0x4d3e('0x3d')]=_[_0x4d3e('0x3c')](_0x525b92['query']);_0xb4dccd[_0x4d3e('0x54')]=_['intersection'](_0xb4dccd[_0x4d3e('0x3b')],_0xb4dccd[_0x4d3e('0x3d')]);_0x374b72[_0x4d3e('0x3f')]=_[_0x4d3e('0x3e')](_0xb4dccd[_0x4d3e('0x3b')],qs[_0x4d3e('0x55')](_0x525b92[_0x4d3e('0x3d')][_0x4d3e('0x55')]));_0x374b72['attributes']=_0x374b72[_0x4d3e('0x3f')][_0x4d3e('0x40')]?_0x374b72[_0x4d3e('0x3f')]:_0xb4dccd[_0x4d3e('0x3b')];if(_0x525b92[_0x4d3e('0x3d')]['includeAll']){_0x374b72[_0x4d3e('0x4f')]=[{'all':!![]}];}_0x374b72=_[_0x4d3e('0x47')]({},_0x374b72,_0x525b92[_0x4d3e('0x4c')]);return db['SmsAccount'][_0x4d3e('0x56')](_0x374b72)['then'](handleEntityNotFound(_0x567de8,null))[_0x4d3e('0x1f')](respondWithResult(_0x567de8,null))[_0x4d3e('0x27')](handleError(_0x567de8,null));};exports[_0x4d3e('0x57')]=function(_0x413dfa,_0x361196){return db[_0x4d3e('0x4d')][_0x4d3e('0x57')](_0x413dfa[_0x4d3e('0x58')],{})[_0x4d3e('0x1f')](function(_0x3fa10c){var _0x37d228=_0x413dfa[_0x4d3e('0x59')][_0x4d3e('0x32')]({'plain':!![]});if(!_0x37d228)throw new Error(_0x4d3e('0x5a'));if(_0x37d228[_0x4d3e('0x5b')]===_0x4d3e('0x59')){var _0x1c1e72=_0x3fa10c[_0x4d3e('0x32')]({'plain':!![]});var _0x4d7fc9='SmsAccounts';return db[_0x4d3e('0x5c')]['find']({'where':{'name':_0x4d7fc9,'userProfileId':_0x37d228['userProfileId']},'raw':!![]})[_0x4d3e('0x1f')](function(_0x2fe920){if(_0x2fe920&&_0x2fe920['autoAssociation']===0x0){return db[_0x4d3e('0x5d')]['create']({'name':_0x1c1e72[_0x4d3e('0x35')],'resourceId':_0x1c1e72['id'],'type':_0x2fe920[_0x4d3e('0x35')],'sectionId':_0x2fe920['id']},{})[_0x4d3e('0x1f')](function(){return _0x3fa10c;});}else{return _0x3fa10c;}})['catch'](function(_0x5371e0){logger[_0x4d3e('0x25')](_0x4d3e('0x5e'),_0x5371e0);throw _0x5371e0;});}return _0x3fa10c;})[_0x4d3e('0x1f')](respondWithResult(_0x361196,0xc9))[_0x4d3e('0x27')](handleError(_0x361196,null));};exports['update']=function(_0x3c6313,_0x27c88b){if(_0x3c6313[_0x4d3e('0x58')]['id']){delete _0x3c6313[_0x4d3e('0x58')]['id'];}return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x3c6313[_0x4d3e('0x53')]['id']},'include':[{'model':db[_0x4d3e('0x38')],'as':_0x4d3e('0x39')}]})[_0x4d3e('0x1f')](handleEntityNotFound(_0x27c88b,null))[_0x4d3e('0x1f')](saveUpdates(_0x3c6313[_0x4d3e('0x58')],null))[_0x4d3e('0x1f')](respondWithResult(_0x27c88b,null))['catch'](handleError(_0x27c88b,null));};exports[_0x4d3e('0x5f')]=function(_0x224e1f,_0x961b0){return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x224e1f[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x961b0,null))[_0x4d3e('0x1f')](removeEntity(_0x961b0,null))[_0x4d3e('0x27')](handleError(_0x961b0,null));};exports[_0x4d3e('0x60')]=function(_0x33d5b7,_0xf75c7){return db['SmsAccount'][_0x4d3e('0x60')]()['then'](respondWithResult(_0xf75c7,null))['catch'](handleError(_0xf75c7,null));};exports[_0x4d3e('0x61')]=function(_0x52130b,_0x1f494f,_0x4747f6){if(_0x52130b[_0x4d3e('0x58')]['id']){delete _0x52130b[_0x4d3e('0x58')]['id'];}return db[_0x4d3e('0x4d')]['find']({'where':{'id':_0x52130b[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x1f494f,null))[_0x4d3e('0x1f')](function(_0x58888a){if(_0x58888a){_0x52130b[_0x4d3e('0x58')][_0x4d3e('0x62')]=_0x58888a['id'];return db[_0x4d3e('0x63')]['create'](_0x52130b[_0x4d3e('0x58')]);}})[_0x4d3e('0x1f')](respondWithResult(_0x1f494f,null))[_0x4d3e('0x27')](handleError(_0x1f494f,null));};exports['getDispositions']=function(_0x327322,_0x24cfae,_0x24fad4){var _0x572354={'raw':![],'where':{}};var _0x456767={};var _0x1d55a1={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4d3e('0x64')]({'where':{'id':_0x327322[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x24cfae,null))[_0x4d3e('0x1f')](function(_0x88676c){if(_0x88676c){_0x456767[_0x4d3e('0x3b')]=_['keys'](db[_0x4d3e('0x63')]['rawAttributes']);_0x456767['query']=_[_0x4d3e('0x3c')](_0x327322[_0x4d3e('0x3d')]);_0x456767[_0x4d3e('0x54')]=_['intersection'](_0x456767[_0x4d3e('0x3b')],_0x456767[_0x4d3e('0x3d')]);_0x572354[_0x4d3e('0x3f')]=_[_0x4d3e('0x3e')](_0x456767[_0x4d3e('0x3b')],qs[_0x4d3e('0x55')](_0x327322[_0x4d3e('0x3d')][_0x4d3e('0x55')]));_0x572354[_0x4d3e('0x3f')]=_0x572354[_0x4d3e('0x3f')][_0x4d3e('0x40')]?_0x572354[_0x4d3e('0x3f')]:_0x456767['model'];if(!_0x327322[_0x4d3e('0x3d')][_0x4d3e('0x41')](_0x4d3e('0x42'))){_0x572354[_0x4d3e('0x2d')]=qs[_0x4d3e('0x2d')](_0x327322['query'][_0x4d3e('0x2d')]);_0x572354[_0x4d3e('0x43')]=qs['offset'](_0x327322[_0x4d3e('0x3d')][_0x4d3e('0x43')]);}_0x572354[_0x4d3e('0x65')]=qs[_0x4d3e('0x66')](_0x327322[_0x4d3e('0x3d')][_0x4d3e('0x66')]);_0x572354['where']=qs[_0x4d3e('0x54')](_[_0x4d3e('0x45')](_0x327322[_0x4d3e('0x3d')],_0x456767['filters']));_0x572354[_0x4d3e('0x44')][_0x4d3e('0x62')]=_0x88676c['id'];if(_0x327322['query'][_0x4d3e('0x46')]){_0x572354[_0x4d3e('0x44')]=_['merge'](_0x572354[_0x4d3e('0x44')],{'$or':_[_0x4d3e('0x48')](_0x572354['attributes'],function(_0xc6bc16){var _0x23770c={};_0x23770c[_0xc6bc16]={'$like':'%'+_0x327322[_0x4d3e('0x3d')][_0x4d3e('0x46')]+'%'};return _0x23770c;})});}_0x572354=_[_0x4d3e('0x47')]({},_0x572354,_0x327322[_0x4d3e('0x4c')]);return db[_0x4d3e('0x63')][_0x4d3e('0x2c')]({'where':_0x572354['where']})[_0x4d3e('0x1f')](function(_0x341cb7){_0x1d55a1[_0x4d3e('0x2c')]=_0x341cb7;if(_0x327322[_0x4d3e('0x3d')]['includeAll']){_0x572354[_0x4d3e('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x4d3e('0x50')](_0x572354);})[_0x4d3e('0x1f')](function(_0x282ab8){_0x1d55a1[_0x4d3e('0x51')]=_0x282ab8;return _0x1d55a1;});}})[_0x4d3e('0x1f')](respondWithFilteredResult(_0x24cfae,_0x572354))['catch'](handleError(_0x24cfae,null));};exports[_0x4d3e('0x67')]=function(_0x2738b1,_0x442fe9,_0x73025e){return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x2738b1[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x442fe9,null))[_0x4d3e('0x1f')](function(_0x4ac572){if(_0x4ac572){return _0x4ac572[_0x4d3e('0x67')](_0x2738b1['query'][_0x4d3e('0x68')]);}})[_0x4d3e('0x1f')](respondWithStatusCode(_0x442fe9,null))[_0x4d3e('0x27')](handleError(_0x442fe9,null));};exports['addAnswer']=function(_0x27da5e,_0x2df90b,_0x1fa733){if(_0x27da5e[_0x4d3e('0x58')]['id']){delete _0x27da5e['body']['id'];}return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x27da5e[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x2df90b,null))[_0x4d3e('0x1f')](function(_0x46240d){if(_0x46240d){_0x27da5e[_0x4d3e('0x58')][_0x4d3e('0x62')]=_0x46240d['id'];return db[_0x4d3e('0x69')][_0x4d3e('0x57')](_0x27da5e[_0x4d3e('0x58')]);}})[_0x4d3e('0x1f')](respondWithResult(_0x2df90b,null))[_0x4d3e('0x27')](handleError(_0x2df90b,null));};exports[_0x4d3e('0x6a')]=function(_0x5bb20f,_0x40ad09,_0x4d6848){var _0x39fcf2={'raw':![],'where':{}};var _0x2832ef={};var _0x5e0e7f={'count':0x0,'rows':[]};return db[_0x4d3e('0x4d')][_0x4d3e('0x64')]({'where':{'id':_0x5bb20f[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x40ad09,null))[_0x4d3e('0x1f')](function(_0x379210){if(_0x379210){_0x2832ef[_0x4d3e('0x3b')]=_[_0x4d3e('0x3c')](db[_0x4d3e('0x69')][_0x4d3e('0x3a')]);_0x2832ef[_0x4d3e('0x3d')]=_[_0x4d3e('0x3c')](_0x5bb20f[_0x4d3e('0x3d')]);_0x2832ef[_0x4d3e('0x54')]=_[_0x4d3e('0x3e')](_0x2832ef['model'],_0x2832ef[_0x4d3e('0x3d')]);_0x39fcf2[_0x4d3e('0x3f')]=_['intersection'](_0x2832ef[_0x4d3e('0x3b')],qs[_0x4d3e('0x55')](_0x5bb20f['query'][_0x4d3e('0x55')]));_0x39fcf2[_0x4d3e('0x3f')]=_0x39fcf2[_0x4d3e('0x3f')]['length']?_0x39fcf2['attributes']:_0x2832ef[_0x4d3e('0x3b')];if(!_0x5bb20f[_0x4d3e('0x3d')][_0x4d3e('0x41')]('nolimit')){_0x39fcf2[_0x4d3e('0x2d')]=qs[_0x4d3e('0x2d')](_0x5bb20f[_0x4d3e('0x3d')][_0x4d3e('0x2d')]);_0x39fcf2[_0x4d3e('0x43')]=qs[_0x4d3e('0x43')](_0x5bb20f['query'][_0x4d3e('0x43')]);}_0x39fcf2[_0x4d3e('0x65')]=qs[_0x4d3e('0x66')](_0x5bb20f[_0x4d3e('0x3d')]['sort']);_0x39fcf2['where']=qs[_0x4d3e('0x54')](_[_0x4d3e('0x45')](_0x5bb20f[_0x4d3e('0x3d')],_0x2832ef[_0x4d3e('0x54')]));_0x39fcf2[_0x4d3e('0x44')][_0x4d3e('0x62')]=_0x379210['id'];if(_0x5bb20f[_0x4d3e('0x3d')][_0x4d3e('0x46')]){_0x39fcf2['where']=_[_0x4d3e('0x47')](_0x39fcf2[_0x4d3e('0x44')],{'$or':_[_0x4d3e('0x48')](_0x39fcf2[_0x4d3e('0x3f')],function(_0x5a7408){var _0x5907fe={};_0x5907fe[_0x5a7408]={'$like':'%'+_0x5bb20f[_0x4d3e('0x3d')][_0x4d3e('0x46')]+'%'};return _0x5907fe;})});}_0x39fcf2=_[_0x4d3e('0x47')]({},_0x39fcf2,_0x5bb20f[_0x4d3e('0x4c')]);return db[_0x4d3e('0x69')][_0x4d3e('0x2c')]({'where':_0x39fcf2[_0x4d3e('0x44')]})['then'](function(_0x1bcf80){_0x5e0e7f[_0x4d3e('0x2c')]=_0x1bcf80;if(_0x5bb20f['query']['includeAll']){_0x39fcf2[_0x4d3e('0x4f')]=[{'all':!![]}];}return db[_0x4d3e('0x69')]['findAll'](_0x39fcf2);})['then'](function(_0x1fd707){_0x5e0e7f[_0x4d3e('0x51')]=_0x1fd707;return _0x5e0e7f;});}})['then'](respondWithFilteredResult(_0x40ad09,_0x39fcf2))[_0x4d3e('0x27')](handleError(_0x40ad09,null));};exports[_0x4d3e('0x6b')]=function(_0x4085f7,_0x4f9b6d,_0x35f695){return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x4085f7[_0x4d3e('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f9b6d,null))['then'](function(_0x34beb3){if(_0x34beb3){return _0x34beb3[_0x4d3e('0x6b')](_0x4085f7[_0x4d3e('0x3d')][_0x4d3e('0x68')]);}})[_0x4d3e('0x1f')](respondWithStatusCode(_0x4f9b6d,null))[_0x4d3e('0x27')](handleError(_0x4f9b6d,null));};exports[_0x4d3e('0x6c')]=function(_0x598277,_0x4941ad,_0x227bb9){var _0x4a114d={'channel':_0x4d3e('0x6d')};var _0x45525e=[];var _0x326336=[];var _0x3d790e={};return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x598277['params']['id']},'include':[{'model':db[_0x4d3e('0x6e')],'as':_0x4d3e('0x6f')}]})['then'](handleEntityNotFound(_0x4941ad,null))['then'](function(_0x19efc8){_0x4a114d[_0x4d3e('0x70')]=_0x19efc8;_0x4a114d[_0x4d3e('0x71')]=_[_0x4d3e('0x72')](_0x19efc8[_0x4d3e('0x6f')],[_0x4d3e('0x73')],[_0x4d3e('0x74')]);if(_0x4a114d['account'][_0x4d3e('0x6f')]){delete _0x4a114d['account'][_0x4d3e('0x6f')];}return db[_0x4d3e('0x75')][_0x4d3e('0x60')]();})['then'](function(_0x279d23){if(!_0x279d23){throw new db['Sequelize'][(_0x4d3e('0x76'))]('no\x20available\x20attributes');}_0x45525e=_[_0x4d3e('0x77')](_[_0x4d3e('0x3c')](_0x279d23),[_0x4d3e('0x78'),'updatedAt']);_0x326336=_[_0x4d3e('0x77')](_[_0x4d3e('0x3c')](_0x279d23),[_0x4d3e('0x78'),_0x4d3e('0x79'),_0x4d3e('0x7a'),_0x4d3e('0x7b')]);_0x4a114d[_0x4d3e('0x58')]={'mapKey':_0x4d3e('0x7c')};if(_0x4a114d[_0x4d3e('0x70')][_0x4d3e('0x49')]){switch(_0x4a114d[_0x4d3e('0x70')][_0x4d3e('0x49')]){case _0x4d3e('0x7d'):_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')]=_0x598277[_0x4d3e('0x58')]['From'];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x7f')];_0x4a114d[_0x4d3e('0x58')]['messageId']=_0x598277['body'][_0x4d3e('0x80')];break;case'skebby':_0x4a114d[_0x4d3e('0x58')]['from']='+'+_0x598277[_0x4d3e('0x58')][_0x4d3e('0x81')];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')]['text'];break;case'connectel':_0x4a114d['body'][_0x4d3e('0x7e')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x7e')];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x26')];break;case'clicksend':_0x4a114d['body'][_0x4d3e('0x7e')]=_0x598277[_0x4d3e('0x58')]['from'];_0x4a114d[_0x4d3e('0x58')]['body']=_0x598277[_0x4d3e('0x58')]['body'];_0x4a114d['body'][_0x4d3e('0x82')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x83')];break;case'plivo':_0x4a114d['body'][_0x4d3e('0x7e')]=_0x598277[_0x4d3e('0x58')]['From'];_0x4a114d['body'][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x84')];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x82')]=_0x598277['body'][_0x4d3e('0x85')];break;case'infobip':_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')]='+'+_0x598277[_0x4d3e('0x58')][_0x4d3e('0x86')][0x0][_0x4d3e('0x7e')];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')]['results'][0x0]['text'];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x82')]=_0x598277['body']['results'][0x0][_0x4d3e('0x82')];break;case _0x4d3e('0x87'):_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')]=_0x598277['body'][_0x4d3e('0x88')];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x89')][_0x4d3e('0x26')];break;case _0x4d3e('0x8a'):_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')]=_0x598277[_0x4d3e('0x58')]['fromNumber'];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x8b')];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x82')]=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x8c')];break;case _0x4d3e('0x8d'):_0x4a114d[_0x4d3e('0x58')]['from']=_0x598277[_0x4d3e('0x58')]['from'];_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')]=_0x598277[_0x4d3e('0x58')]['message'];_0x4a114d[_0x4d3e('0x58')]['messageId']=_0x598277[_0x4d3e('0x58')][_0x4d3e('0x8e')];break;}}if(_0x4a114d[_0x4d3e('0x58')]['id']){delete _0x4a114d['body']['id'];}if(_[_0x4d3e('0x8f')](_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')])){throw new db[(_0x4d3e('0x90'))]['ValidationError'](_0x4d3e('0x91'));}if(_[_0x4d3e('0x8f')](_0x4a114d[_0x4d3e('0x58')]['body'])||_0x4a114d[_0x4d3e('0x58')]['body']===''){throw new db['Sequelize'][(_0x4d3e('0x76'))](_0x4d3e('0x92'));}if(_[_0x4d3e('0x8f')](_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x93')])){throw new db[(_0x4d3e('0x90'))][(_0x4d3e('0x76'))](_0x4d3e('0x94')+_0x326336);}if(!_[_0x4d3e('0x95')](_0x326336,_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x93')])){throw new db[(_0x4d3e('0x90'))][(_0x4d3e('0x76'))](_0x4d3e('0x96')+_0x326336);}_0x3d790e[_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x93')]]=_0x4a114d[_0x4d3e('0x58')]['from'];return db[_0x4d3e('0x97')][_0x4d3e('0x56')]({'where':{'id':_0x4a114d['account']['ListId']},'include':[{'model':db[_0x4d3e('0x75')],'as':_0x4d3e('0x98'),'where':_0x3d790e,'limit':0x1,'order':[[_0x4d3e('0x79'),'DESC']]}]});})[_0x4d3e('0x1f')](handleEntityNotFound(_0x4941ad,null))[_0x4d3e('0x1f')](function(_0x1a5a1e){if(_0x1a5a1e){_0x4a114d[_0x4d3e('0x99')]=_[_0x4d3e('0x9a')](_0x1a5a1e,['Contacts']);if(_0x1a5a1e[_0x4d3e('0x98')]['length']){return _0x1a5a1e[_0x4d3e('0x98')][0x0];}var _0x1931fc=_[_0x4d3e('0x17')](_0x4a114d[_0x4d3e('0x58')],{'firstName':_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')],'ListId':_0x1a5a1e['id']});_0x1931fc[_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x93')]]=_0x4a114d[_0x4d3e('0x58')]['from'];return db[_0x4d3e('0x75')][_0x4d3e('0x57')](_0x1931fc,{'fields':_0x45525e,'raw':!![]});}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x4941ad,null))['then'](function(_0x9129cb){if(_0x9129cb){_0x4a114d['contact']=_0x9129cb;var _0x35d557={'ContactId':_0x9129cb['id'],'phone':_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')],'SmsAccountId':_0x598277['params']['id']};var _0xfe7701={'ContactId':_0x9129cb['id'],'SmsAccountId':_0x598277[_0x4d3e('0x53')]['id'],'closed':![]};return db[_0x4d3e('0x9b')][_0x4d3e('0x56')]({'where':_0xfe7701})[_0x4d3e('0x1f')](function(_0x5e8d54){if(_0x5e8d54){return[_0x5e8d54,![]];}return db[_0x4d3e('0x9b')][_0x4d3e('0x57')](_0x35d557)[_0x4d3e('0x1f')](function(_0x1c6024){return[_0x1c6024,!![]];});});}})['spread'](function(_0x3a8b22,_0x1fac2a){_0x4a114d[_0x4d3e('0x9c')]=_0x3a8b22['get']({'plain':!![]});_0x4a114d[_0x4d3e('0x9c')]['created']=![];if(_0x1fac2a){if(_0x4a114d['account'][_0x4d3e('0x9d')]){_0x4a114d[_0x4d3e('0x71')][_0x4d3e('0x9e')]({'id':0x0,'priority':_0x4a114d['applications'][_0x4d3e('0x40')]+0x1,'app':_0x4d3e('0x9f'),'appdata':_0x4d3e('0xa0'),'interval':_0x4d3e('0xa1')});}_0x4a114d['interaction'][_0x4d3e('0xa2')]=!![];}return db[_0x4d3e('0xa3')][_0x4d3e('0x57')]({'phone':_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x7e')],'messageId':_0x4a114d[_0x4d3e('0x58')]['messageId'],'body':_0x4a114d[_0x4d3e('0x58')][_0x4d3e('0x58')],'SmsAccountId':_0x598277[_0x4d3e('0x53')]['id'],'SmsInteractionId':_0x3a8b22['id'],'direction':'in','ContactId':_0x3a8b22['ContactId'],'AttachmentId':_0x4a114d['body'][_0x4d3e('0xa4')]});})['then'](function(_0x5c9fe2){_0x4a114d[_0x4d3e('0x26')]=_0x5c9fe2;if(_0x4a114d[_0x4d3e('0x9c')][_0x4d3e('0xa5')]){return db[_0x4d3e('0xa6')]['find']({'attributes':['id',_0x4d3e('0x35')],'where':{'id':_0x4a114d[_0x4d3e('0x9c')]['UserId']}})['then'](function(_0x10b523){if(_0x10b523){_0x4a114d[_0x4d3e('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4d3e('0xa7'),'appdata':_0x10b523[_0x4d3e('0x35')]+','+(_0x4a114d[_0x4d3e('0x70')][_0x4d3e('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x4d3e('0xa9'),_0x4a114d);});}return respondWithRpcPromise('Start',_0x4d3e('0xa9'),_0x4a114d);})[_0x4d3e('0x1f')](function(_0x4eeecb){if(_0x4eeecb){var _0x1963d1=0xc8;var _0x2c406f='receiveMessage';logger['info'](_0x4d3e('0xaa'),_0x2c406f,_0x1963d1,_0x4d3e('0xab'));logger[_0x4d3e('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2c406f,_0x1963d1,_0x4d3e('0xab'),JSON['stringify'](_0x4eeecb));if(_0x4a114d[_0x4d3e('0x70')][_0x4d3e('0x49')]==='twilio'){return _0x4941ad[_0x4d3e('0x29')](_0x1963d1)[_0x4d3e('0x2e')](_0x4d3e('0xac'),_0x4d3e('0xad'))[_0x4d3e('0x36')](_0x4d3e('0xae'));}else{return _0x4941ad[_0x4d3e('0x29')](_0x1963d1)[_0x4d3e('0x2b')](_0x4eeecb);}}})[_0x4d3e('0x27')](handleError(_0x4941ad,null));};exports[_0x4d3e('0xaf')]=function(_0x2cc829,_0x2f4bc0,_0x33babe){return db[_0x4d3e('0x4d')][_0x4d3e('0x64')]({'where':{'id':_0x2cc829['params']['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x2f4bc0,null))[_0x4d3e('0x1f')](function(_0x45dbb7){if(_0x45dbb7){return db['sequelize']['transaction'](function(_0x52a42a){return db[_0x4d3e('0x6e')][_0x4d3e('0x5f')]({'where':{'SmsAccountId':_0x2cc829['params']['id']},'transaction':_0x52a42a})[_0x4d3e('0x1f')](function(_0x397a85){var _0x40b5e2=_[_0x4d3e('0x48')](_0x2cc829[_0x4d3e('0x58')],function(_0x3b370d){_0x3b370d[_0x4d3e('0x62')]=_0x2cc829['params']['id'];return _0x3b370d;});return db[_0x4d3e('0x6e')]['bulkCreate'](_0x40b5e2,{'transaction':_0x52a42a});});})[_0x4d3e('0x1f')](function(){return db[_0x4d3e('0x6e')][_0x4d3e('0xb0')]({'where':{'SmsAccountId':_0x2cc829[_0x4d3e('0x53')]['id']},'order':_0x4d3e('0x73')});});}})[_0x4d3e('0x1f')](respondWithResult(_0x2f4bc0,null))[_0x4d3e('0x27')](handleError(_0x2f4bc0,null));};exports['getApplications']=function(_0x18cf40,_0x1fc88c,_0x385830){var _0x3a2408={};var _0x7b53c={};var _0x229468;var _0x1b427e;return db['SmsAccount'][_0x4d3e('0x64')]({'where':{'id':_0x18cf40['params']['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x1fc88c,null))[_0x4d3e('0x1f')](function(_0x34207d){if(_0x34207d){_0x229468=_0x34207d;_0x7b53c[_0x4d3e('0x3b')]=_['keys'](db['SmsApplication'][_0x4d3e('0x3a')]);_0x7b53c[_0x4d3e('0x3d')]=_[_0x4d3e('0x3c')](_0x18cf40[_0x4d3e('0x3d')]);_0x7b53c[_0x4d3e('0x54')]=_['intersection'](_0x7b53c[_0x4d3e('0x3b')],_0x7b53c[_0x4d3e('0x3d')]);_0x3a2408[_0x4d3e('0x3f')]=_[_0x4d3e('0x3e')](_0x7b53c['model'],qs[_0x4d3e('0x55')](_0x18cf40[_0x4d3e('0x3d')][_0x4d3e('0x55')]));_0x3a2408[_0x4d3e('0x3f')]=_0x3a2408[_0x4d3e('0x3f')]['length']?_0x3a2408[_0x4d3e('0x3f')]:_0x7b53c[_0x4d3e('0x3b')];_0x3a2408[_0x4d3e('0x65')]=qs[_0x4d3e('0x66')](_0x18cf40['query'][_0x4d3e('0x66')]);_0x3a2408[_0x4d3e('0x44')]=qs[_0x4d3e('0x54')](_['pick'](_0x18cf40[_0x4d3e('0x3d')],_0x7b53c[_0x4d3e('0x54')]));if(_0x18cf40[_0x4d3e('0x3d')][_0x4d3e('0x46')]){_0x3a2408[_0x4d3e('0x44')]=_[_0x4d3e('0x47')](_0x3a2408['where'],{'$or':_[_0x4d3e('0x48')](_0x3a2408[_0x4d3e('0x3f')],function(_0x57a58d){var _0x23bdc7={};_0x23bdc7[_0x57a58d]={'$like':'%'+_0x18cf40['query'][_0x4d3e('0x46')]+'%'};return _0x23bdc7;})});}_0x3a2408=_[_0x4d3e('0x47')]({},_0x3a2408,_0x18cf40['options']);return _0x229468[_0x4d3e('0xb1')](_0x3a2408);}})[_0x4d3e('0x1f')](function(_0x4abb44){if(_0x4abb44){_0x1b427e=_0x4abb44[_0x4d3e('0x40')];if(!_0x18cf40[_0x4d3e('0x3d')]['hasOwnProperty']('nolimit')){_0x3a2408['limit']=qs[_0x4d3e('0x2d')](_0x18cf40[_0x4d3e('0x3d')][_0x4d3e('0x2d')]);_0x3a2408[_0x4d3e('0x43')]=qs[_0x4d3e('0x43')](_0x18cf40['query'][_0x4d3e('0x43')]);}return _0x229468[_0x4d3e('0xb1')](_0x3a2408);}})[_0x4d3e('0x1f')](function(_0x4e515b){if(_0x4e515b){return _0x4e515b?{'count':_0x1b427e,'rows':_0x4e515b}:null;}})[_0x4d3e('0x1f')](respondWithResult(_0x1fc88c,null))[_0x4d3e('0x27')](handleError(_0x1fc88c,null));};exports[_0x4d3e('0xb2')]=function(_0x16ac2e,_0x21ddcb,_0x39cfc0){var _0x3e2b40={'raw':![],'where':{}};var _0xbff6f2={};var _0x53af48={'count':0x0,'rows':[]};return db[_0x4d3e('0x4d')]['findOne']({'where':{'id':_0x16ac2e[_0x4d3e('0x53')]['id']}})['then'](handleEntityNotFound(_0x21ddcb,null))[_0x4d3e('0x1f')](function(_0x586fa8){if(_0x586fa8){_0xbff6f2[_0x4d3e('0x3b')]=_[_0x4d3e('0x3c')](db[_0x4d3e('0x9b')][_0x4d3e('0x3a')]);_0xbff6f2['query']=_[_0x4d3e('0x3c')](_0x16ac2e[_0x4d3e('0x3d')]);_0xbff6f2[_0x4d3e('0x54')]=_[_0x4d3e('0x3e')](_0xbff6f2['model'],_0xbff6f2[_0x4d3e('0x3d')]);_0x3e2b40[_0x4d3e('0x3f')]=_[_0x4d3e('0x3e')](_0xbff6f2[_0x4d3e('0x3b')],qs['fields'](_0x16ac2e[_0x4d3e('0x3d')]['fields']));_0x3e2b40['attributes']=_0x3e2b40[_0x4d3e('0x3f')][_0x4d3e('0x40')]?_0x3e2b40[_0x4d3e('0x3f')]:_0xbff6f2['model'];if(!_0x16ac2e['query']['hasOwnProperty'](_0x4d3e('0x42'))){_0x3e2b40['limit']=qs[_0x4d3e('0x2d')](_0x16ac2e[_0x4d3e('0x3d')][_0x4d3e('0x2d')]);_0x3e2b40[_0x4d3e('0x43')]=qs[_0x4d3e('0x43')](_0x16ac2e['query'][_0x4d3e('0x43')]);}_0x3e2b40[_0x4d3e('0x65')]=qs['sort'](_0x16ac2e['query'][_0x4d3e('0x66')]);_0x3e2b40[_0x4d3e('0x44')]=qs[_0x4d3e('0x54')](_[_0x4d3e('0x45')](_0x16ac2e['query'],_0xbff6f2[_0x4d3e('0x54')]));_0x3e2b40[_0x4d3e('0x44')][_0x4d3e('0x62')]=_0x586fa8['id'];if(_0x16ac2e[_0x4d3e('0x3d')][_0x4d3e('0x46')]){_0x3e2b40[_0x4d3e('0x44')]=_[_0x4d3e('0x47')](_0x3e2b40[_0x4d3e('0x44')],{'$or':_[_0x4d3e('0x48')](_0x3e2b40[_0x4d3e('0x3f')],function(_0x191a14){var _0x5b913a={};_0x5b913a[_0x191a14]={'$like':'%'+_0x16ac2e[_0x4d3e('0x3d')][_0x4d3e('0x46')]+'%'};return _0x5b913a;})});}_0x3e2b40=_['merge']({},_0x3e2b40,_0x16ac2e[_0x4d3e('0x4c')]);return db[_0x4d3e('0x9b')][_0x4d3e('0x2c')]({'where':_0x3e2b40[_0x4d3e('0x44')]})['then'](function(_0x25724b){_0x53af48[_0x4d3e('0x2c')]=_0x25724b;if(_0x16ac2e[_0x4d3e('0x3d')][_0x4d3e('0x4e')]){_0x3e2b40[_0x4d3e('0x4f')]=[{'model':db['CmContact'],'as':_0x4d3e('0xb3'),'required':![]},{'model':db[_0x4d3e('0xa6')],'as':_0x4d3e('0xb4'),'attributes':[_0x4d3e('0x35'),_0x4d3e('0xb5'),_0x4d3e('0xb6')],'required':![]},{'model':db[_0x4d3e('0xb7')],'as':_0x4d3e('0xb8'),'attributes':['id',_0x4d3e('0x35'),_0x4d3e('0xb9')],'where':_0x16ac2e[_0x4d3e('0x3d')][_0x4d3e('0xba')]?{'id':_0x16ac2e[_0x4d3e('0x3d')][_0x4d3e('0xba')]}:undefined,'required':_0x16ac2e['query'][_0x4d3e('0xba')]?!![]:![]}];}return db[_0x4d3e('0x9b')]['findAll'](_0x3e2b40);})['then'](function(_0x1875d8){_0x53af48[_0x4d3e('0x51')]=_0x1875d8;return _0x53af48;});}})[_0x4d3e('0x1f')](respondWithFilteredResult(_0x21ddcb,_0x3e2b40))[_0x4d3e('0x27')](handleError(_0x21ddcb,null));};exports[_0x4d3e('0x36')]=function(_0x158cfa,_0x1f839d,_0x1fd586){var _0xbe0221,_0x15d0e1,_0x4a9944;if(_[_0x4d3e('0x8f')](_0x158cfa[_0x4d3e('0x58')][_0x4d3e('0x58')])||_0x158cfa[_0x4d3e('0x58')][_0x4d3e('0x58')]===''){throw new db[(_0x4d3e('0x90'))][(_0x4d3e('0x76'))](_0x4d3e('0x92'));}if(_[_0x4d3e('0x8f')](_0x158cfa[_0x4d3e('0x58')]['to'])){throw new db[(_0x4d3e('0x90'))][(_0x4d3e('0x76'))](_0x4d3e('0xbb'));}_0xbe0221=_0x158cfa[_0x4d3e('0x58')]['to'];return db[_0x4d3e('0x4d')]['find']({'where':{'id':_0x158cfa[_0x4d3e('0x53')]['id']},'include':[{'model':db[_0x4d3e('0x97')],'as':_0x4d3e('0xbc'),'include':[{'model':db[_0x4d3e('0x75')],'as':'Contacts','where':{'mobile':_0xbe0221},'limit':0x1,'order':[['updatedAt',_0x4d3e('0xbd')]]}]}]})[_0x4d3e('0x1f')](handleEntityNotFound(_0x1f839d,null))[_0x4d3e('0x1f')](function(_0x17b5c5){if(_0x17b5c5&&_0x17b5c5[_0x4d3e('0xbc')]){_0x15d0e1=_0x17b5c5['get']({'plain':!![]});if(_0x15d0e1[_0x4d3e('0xbc')]&&_0x15d0e1[_0x4d3e('0xbc')][_0x4d3e('0x98')][_0x4d3e('0x40')]){return _0x15d0e1['List'][_0x4d3e('0x98')][0x0];}return db['CmContact']['create'](_[_0x4d3e('0x17')](_0x158cfa[_0x4d3e('0x58')],{'firstName':_0xbe0221,'mobile':_0xbe0221,'phone':_0xbe0221,'ListId':_0x15d0e1[_0x4d3e('0x7b')]}));}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x1f839d,null))[_0x4d3e('0x1f')](function(_0x46bbc3){if(_0x46bbc3){_0x4a9944=_0x46bbc3;return db[_0x4d3e('0x9b')][_0x4d3e('0x56')]({'where':{'ContactId':_0x4a9944['id'],'closed':![],'SmsAccountId':_0x15d0e1['id']}})[_0x4d3e('0x1f')](function(_0x27e7e4){if(_0x27e7e4){return[_0x27e7e4,![]];}return db[_0x4d3e('0x9b')][_0x4d3e('0x57')]({'UserId':_0x158cfa[_0x4d3e('0x59')]['id'],'ContactId':_0x4a9944['id'],'SmsAccountId':_0x15d0e1['id'],'phone':_0xbe0221,'firstMsgDirection':'out','Messages':[_[_0x4d3e('0x47')](_0x158cfa[_0x4d3e('0x58')],{'read':![],'body':_0x158cfa[_0x4d3e('0x58')]['body'],'phone':_0xbe0221,'SmsAccountId':_0x15d0e1['id'],'UserId':_0x158cfa[_0x4d3e('0x59')]['id'],'ContactId':_0x4a9944['id']})]},{'include':[{'model':db[_0x4d3e('0xa3')],'as':_0x4d3e('0xbe')}]})[_0x4d3e('0x1f')](function(_0x220715){return[_0x220715,!![]];});});}})[_0x4d3e('0xbf')](function(_0x3b353e,_0x53220d){if(_0x53220d){return _0x3b353e;}return db[_0x4d3e('0xa3')][_0x4d3e('0x57')](_['merge'](_0x158cfa[_0x4d3e('0x58')],{'read':![],'body':_0x158cfa[_0x4d3e('0x58')]['body'],'phone':_0xbe0221,'SmsAccountId':_0x15d0e1['id'],'SmsInteractionId':_0x3b353e['id'],'UserId':_0x158cfa[_0x4d3e('0x59')]['id'],'ContactId':_0x4a9944['id']}))['then'](function(_0x37511d){_0x3b353e[_0x4d3e('0xc0')][_0x4d3e('0xbe')]=[];_0x3b353e[_0x4d3e('0xc0')][_0x4d3e('0xbe')][_0x4d3e('0x9e')](_0x37511d['dataValues']);return _0x3b353e;});})[_0x4d3e('0x1f')](respondWithResult(_0x1f839d,null))['catch'](handleError(_0x1f839d,null));};exports['status']=function(_0x549179,_0x5a2ad6,_0x34ace3){if(_0x549179['body']['id']){delete _0x549179['body']['id'];}console['log'](_0x4d3e('0xc1'),_0x549179[_0x4d3e('0x58')]);var _0x1859bc,_0x18f9ab,_0x30c213;return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x549179[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x5a2ad6,null))['then'](function(_0x10892f){if(_0x10892f){_0x30c213=_0x10892f;logger[_0x4d3e('0x23')](_0x4d3e('0xaa'),_0x4d3e('0x29'),_0x4d3e('0xc2'),_0x10892f[_0x4d3e('0x49')],util['inspect'](_0x549179[_0x4d3e('0x58')],{'showHidden':![],'depth':null}));switch(_0x10892f[_0x4d3e('0x49')]){case _0x4d3e('0xc3'):if(_0x549179[_0x4d3e('0x58')][_0x4d3e('0xc4')]&&_0x549179[_0x4d3e('0x58')]['status']){_0x18f9ab=_0x549179[_0x4d3e('0x58')][_0x4d3e('0x29')];return db[_0x4d3e('0xa3')][_0x4d3e('0x56')]({'where':{'messageId':_0x549179[_0x4d3e('0x58')][_0x4d3e('0xc4')]}});}break;case'connectel':if(_0x549179[_0x4d3e('0x58')]['requestid']&&_0x549179[_0x4d3e('0x58')]['statusInt']){_0x18f9ab=_0x549179['body']['statusInt'];return db[_0x4d3e('0xa3')][_0x4d3e('0x56')]({'where':{'messageId':_0x549179[_0x4d3e('0x58')][_0x4d3e('0xc5')]}});}break;case _0x4d3e('0xc6'):if(_0x549179['body']['message_id']&&_0x549179[_0x4d3e('0x58')][_0x4d3e('0xc7')]){_0x18f9ab=_0x549179[_0x4d3e('0x58')]['status_code'];return db[_0x4d3e('0xa3')][_0x4d3e('0x56')]({'where':{'messageId':_0x549179['body']['message_id']}});}break;case _0x4d3e('0xc8'):var _0x49caa9=_0x549179[_0x4d3e('0x58')]['results'][0x0];if(_0x49caa9[_0x4d3e('0x82')]&&_0x49caa9['status'][_0x4d3e('0xc9')]==='DELIVERED'){_0x18f9ab=_0x49caa9[_0x4d3e('0x29')]['groupName'];return db[_0x4d3e('0xa3')]['find']({'where':{'messageId':_0x49caa9[_0x4d3e('0x82')]}});}break;case _0x4d3e('0x8a'):if(_0x549179[_0x4d3e('0x58')][_0x4d3e('0x82')]&&_0x549179[_0x4d3e('0x58')][_0x4d3e('0x29')]){_0x18f9ab=_0x549179[_0x4d3e('0x58')][_0x4d3e('0x29')];return db[_0x4d3e('0xa3')][_0x4d3e('0x56')]({'where':{'messageId':_0x549179[_0x4d3e('0x58')][_0x4d3e('0x82')]}});}break;case _0x4d3e('0x8d'):if(_0x549179[_0x4d3e('0x58')][_0x4d3e('0xca')]&&_0x549179[_0x4d3e('0x58')][_0x4d3e('0x29')]){_0x18f9ab=_0x549179[_0x4d3e('0x58')][_0x4d3e('0x29')];return db[_0x4d3e('0xa3')][_0x4d3e('0x56')]({'where':{'messageId':_0x549179['body']['redif']}});}break;}}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x5a2ad6,null))[_0x4d3e('0x1f')](function(_0x1e837d){if(_0x1e837d){_0x1859bc=_0x1e837d;switch(_0x30c213[_0x4d3e('0x49')]){case _0x4d3e('0xc3'):if(_0x18f9ab==='DELIVERED'){return _0x1859bc[_0x4d3e('0x31')]({'read':!![]});}else{logger[_0x4d3e('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4d3e('0xc3'),util[_0x4d3e('0xcb')](_0x549179[_0x4d3e('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4d3e('0xcc'):if(_0x18f9ab==='1'){return _0x1859bc[_0x4d3e('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d3e('0x29'),_0x4d3e('0xc3'),util['inspect'](_0x549179[_0x4d3e('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4d3e('0xc6'):if(!_0x549179[_0x4d3e('0x58')][_0x4d3e('0xcd')]&&_0x18f9ab>=0xc8&&_0x18f9ab<=0xce){return _0x1859bc[_0x4d3e('0x31')]({'read':!![]});}else{logger[_0x4d3e('0x25')](_0x4d3e('0xaa'),_0x4d3e('0x29'),_0x4d3e('0xc6'),util[_0x4d3e('0xcb')](_0x549179['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x340475=_0x549179[_0x4d3e('0x58')][_0x4d3e('0x86')][0x0];if(_0x340475['status'][_0x4d3e('0xc9')]===_0x4d3e('0xce')){return _0x1859bc[_0x4d3e('0x31')]({'read':!![]});}else{logger[_0x4d3e('0x25')](_0x4d3e('0xaa'),_0x4d3e('0x29'),'infobip',util[_0x4d3e('0xcb')](_0x549179[_0x4d3e('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4d3e('0x8a'):if(_0x18f9ab==_0x4d3e('0xcf')||_0x18f9ab==_0x4d3e('0xd0')){return _0x1859bc[_0x4d3e('0x31')]({'read':!![]});}else{logger['error'](_0x4d3e('0xaa'),_0x4d3e('0x29'),_0x4d3e('0x8a'),util[_0x4d3e('0xcb')](_0x549179[_0x4d3e('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4d3e('0x8d'):if(_0x18f9ab===_0x4d3e('0xd1')||_0x18f9ab===_0x4d3e('0xd2')){return _0x1859bc[_0x4d3e('0x31')]({'read':!![]});}else{logger[_0x4d3e('0x25')](_0x4d3e('0xaa'),'status','intelepeer',util[_0x4d3e('0xcb')](_0x549179['body'],{'showHidden':![],'depth':null}));}break;}return _0x1859bc;}})[_0x4d3e('0x1f')](respondWithResult(_0x5a2ad6,null))[_0x4d3e('0x27')](handleError(_0x5a2ad6,null));};exports[_0x4d3e('0xd3')]=function(_0xbbb463,_0x1bb941,_0x1ad0b6){var _0x23a41c,_0x13a9e9,_0x1cf623;return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0xbbb463[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x1bb941,null))[_0x4d3e('0x1f')](function(_0x4aefbd){if(_0x4aefbd){_0x1cf623=_0x4aefbd;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4d3e('0xc2'),_0x4aefbd['type'],util['inspect'](_0xbbb463['query'],{'showHidden':![],'depth':null}));switch(_0x4aefbd[_0x4d3e('0x49')]){case _0x4d3e('0x87'):if(_0xbbb463[_0x4d3e('0x3d')][_0x4d3e('0xd4')]&&_0xbbb463[_0x4d3e('0x3d')][_0x4d3e('0xd5')]){_0x13a9e9=_0xbbb463['query']['state'];return db['SmsMessage'][_0x4d3e('0x56')]({'where':{'messageId':_0xbbb463[_0x4d3e('0x3d')][_0x4d3e('0xd4')]}});}break;}}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x1bb941,null))['then'](function(_0x548cf0){if(_0x548cf0){_0x23a41c=_0x548cf0;switch(_0x1cf623[_0x4d3e('0x49')]){case _0x4d3e('0x87'):if(_0x13a9e9==='2'||_0x13a9e9==='6'){return _0x23a41c[_0x4d3e('0x31')]({'read':!![]});}else{logger[_0x4d3e('0x25')](_0x4d3e('0xaa'),'status','csc',util['inspect'](_0xbbb463[_0x4d3e('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x23a41c;}})[_0x4d3e('0x1f')](respondWithResult(_0x1bb941,null))['catch'](handleError(_0x1bb941,null));};exports[_0x4d3e('0xd6')]=function(_0x116bfc,_0x31549d,_0x580009){return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x116bfc[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x31549d,null))[_0x4d3e('0x1f')](function(_0x2b7f34){if(_0x2b7f34){return _0x2b7f34[_0x4d3e('0xd6')](_0x116bfc[_0x4d3e('0x58')]['ids'],_[_0x4d3e('0x9a')](_0x116bfc[_0x4d3e('0x58')],[_0x4d3e('0x68'),'id'])||{})[_0x4d3e('0xbf')](function(_0x171f6e){for(var _0x106b5e=0x0;_0x106b5e<_0x116bfc['body'][_0x4d3e('0x68')]['length'];_0x106b5e+=0x1){socket[_0x4d3e('0xd7')](_0x4d3e('0xd8'),{'UserId':_0x116bfc['body'][_0x4d3e('0x68')][_0x106b5e],'SmsAccountId':_0x116bfc[_0x4d3e('0x53')]['id']});}return _0x171f6e;});}})[_0x4d3e('0x1f')](respondWithResult(_0x31549d,null))['catch'](handleError(_0x31549d,null));};exports[_0x4d3e('0xd9')]=function(_0x2ba72e,_0x545e4f,_0x5d39a9){return db[_0x4d3e('0x4d')][_0x4d3e('0x56')]({'where':{'id':_0x2ba72e[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x545e4f,null))[_0x4d3e('0x1f')](function(_0x48dc25){if(_0x48dc25){return _0x48dc25[_0x4d3e('0xd9')](_0x2ba72e[_0x4d3e('0x3d')]['ids'])['then'](function(){if(_[_0x4d3e('0xda')](_0x2ba72e[_0x4d3e('0x3d')][_0x4d3e('0x68')])){for(var _0x4c85ac=0x0;_0x4c85ac<_0x2ba72e[_0x4d3e('0x3d')]['ids'][_0x4d3e('0x40')];_0x4c85ac+=0x1){socket['emit'](_0x4d3e('0xdb'),{'UserId':Number(_0x2ba72e[_0x4d3e('0x3d')][_0x4d3e('0x68')][_0x4c85ac]),'SmsAccountId':Number(_0x2ba72e[_0x4d3e('0x53')]['id'])});}}else{socket[_0x4d3e('0xd7')]('userSmsAccount:remove',{'UserId':Number(_0x2ba72e['query'][_0x4d3e('0x68')]),'SmsAccountId':Number(_0x2ba72e[_0x4d3e('0x53')]['id'])});}});}})[_0x4d3e('0x1f')](respondWithStatusCode(_0x545e4f,null))['catch'](handleError(_0x545e4f,null));};exports[_0x4d3e('0xdc')]=function(_0x3b399a,_0x50ce52,_0x3966cf){var _0x116b58={};var _0x32bb0f={};var _0x116c18;var _0x1df908;return db['SmsAccount']['findOne']({'where':{'id':_0x3b399a[_0x4d3e('0x53')]['id']}})[_0x4d3e('0x1f')](handleEntityNotFound(_0x50ce52,null))[_0x4d3e('0x1f')](function(_0x4543fb){if(_0x4543fb){_0x116c18=_0x4543fb;_0x32bb0f[_0x4d3e('0x3b')]=_[_0x4d3e('0x3c')](db[_0x4d3e('0xa6')][_0x4d3e('0x3a')]);_0x32bb0f[_0x4d3e('0x3d')]=_[_0x4d3e('0x3c')](_0x3b399a[_0x4d3e('0x3d')]);_0x32bb0f[_0x4d3e('0x54')]=_[_0x4d3e('0x3e')](_0x32bb0f['model'],_0x32bb0f['query']);_0x116b58[_0x4d3e('0x3f')]=_[_0x4d3e('0x3e')](_0x32bb0f[_0x4d3e('0x3b')],qs['fields'](_0x3b399a[_0x4d3e('0x3d')][_0x4d3e('0x55')]));_0x116b58[_0x4d3e('0x3f')]=_0x116b58[_0x4d3e('0x3f')][_0x4d3e('0x40')]?_0x116b58[_0x4d3e('0x3f')]:_0x32bb0f[_0x4d3e('0x3b')];_0x116b58['order']=qs['sort'](_0x3b399a[_0x4d3e('0x3d')][_0x4d3e('0x66')]);_0x116b58[_0x4d3e('0x44')]=qs[_0x4d3e('0x54')](_[_0x4d3e('0x45')](_0x3b399a[_0x4d3e('0x3d')],_0x32bb0f['filters']));if(_0x3b399a[_0x4d3e('0x3d')][_0x4d3e('0x46')]){_0x116b58[_0x4d3e('0x44')]=_[_0x4d3e('0x47')](_0x116b58['where'],{'$or':_[_0x4d3e('0x48')](_0x116b58[_0x4d3e('0x3f')],function(_0x59c7d9){var _0x97b0f3={};_0x97b0f3[_0x59c7d9]={'$like':'%'+_0x3b399a[_0x4d3e('0x3d')][_0x4d3e('0x46')]+'%'};return _0x97b0f3;})});}_0x116b58=_[_0x4d3e('0x47')]({},_0x116b58,_0x3b399a['options']);return _0x116c18[_0x4d3e('0xdc')](_0x116b58);}})['then'](function(_0x4c5a17){if(_0x4c5a17){_0x1df908=_0x4c5a17[_0x4d3e('0x40')];if(!_0x3b399a[_0x4d3e('0x3d')][_0x4d3e('0x41')](_0x4d3e('0x42'))){_0x116b58[_0x4d3e('0x2d')]=qs['limit'](_0x3b399a[_0x4d3e('0x3d')]['limit']);_0x116b58['offset']=qs[_0x4d3e('0x43')](_0x3b399a['query'][_0x4d3e('0x43')]);}return _0x116c18['getAgents'](_0x116b58);}})['then'](function(_0x1b3f43){if(_0x1b3f43){return _0x1b3f43?{'count':_0x1df908,'rows':_0x1b3f43}:null;}})[_0x4d3e('0x1f')](respondWithResult(_0x50ce52,null))['catch'](handleError(_0x50ce52,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index b00dde2..a6e0e61 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 _0x004c=['SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x40b7fc,_0x51c685){var _0xe7387a=function(_0x3a9c1d){while(--_0x3a9c1d){_0x40b7fc['push'](_0x40b7fc['shift']());}};_0xe7387a(++_0x51c685);}(_0x004c,0x85));var _0xc004=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x004c[_0x56916d];return _0x2b7f1f;};'use strict';var EventEmitter=require(_0xc004('0x0'));var SmsAccount=require(_0xc004('0x1'))['db'][_0xc004('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc004('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc004('0x4'),'afterDestroy':_0xc004('0x5')};function emitEvent(_0x3ea262){return function(_0x38a8b9,_0x571646,_0xfce2b7){SmsAccountEvents['emit'](_0x3ea262+':'+_0x38a8b9['id'],_0x38a8b9);SmsAccountEvents[_0xc004('0x6')](_0x3ea262,_0x38a8b9);_0xfce2b7(null);};}for(var e in events){if(events[_0xc004('0x7')](e)){var event=events[e];SmsAccount[_0xc004('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x142c=['setMaxListeners','save','remove','emit','hook','exports','events','SmsAccount'];(function(_0x2fa11e,_0x57a5c4){var _0x2b445c=function(_0x1179c4){while(--_0x1179c4){_0x2fa11e['push'](_0x2fa11e['shift']());}};_0x2b445c(++_0x57a5c4);}(_0x142c,0x86));var _0xc142=function(_0x10c966,_0x4bdd64){_0x10c966=_0x10c966-0x0;var _0x54b533=_0x142c[_0x10c966];return _0x54b533;};'use strict';var EventEmitter=require(_0xc142('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xc142('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc142('0x2')](0x0);var events={'afterCreate':_0xc142('0x3'),'afterUpdate':'update','afterDestroy':_0xc142('0x4')};function emitEvent(_0x3d66ef){return function(_0x4fa56e,_0x47e43a,_0x110b14){SmsAccountEvents['emit'](_0x3d66ef+':'+_0x4fa56e['id'],_0x4fa56e);SmsAccountEvents[_0xc142('0x5')](_0x3d66ef,_0x4fa56e);_0x110b14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xc142('0x6')](e,emitEvent(event));}}module[_0xc142('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index bf0d99d..42d3621 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 _0xaac5=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','sms_accounts','util','api','moment'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xaac5,0x101));var _0x5aac=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xaac5[_0x9df060];return _0x338dfe;};'use strict';var _=require('lodash');var util=require(_0x5aac('0x0'));var logger=require('../../config/logger')(_0x5aac('0x1'));var moment=require(_0x5aac('0x2'));var BPromise=require('bluebird');var rp=require(_0x5aac('0x3'));var fs=require('fs');var path=require(_0x5aac('0x4'));var rimraf=require(_0x5aac('0x5'));var config=require(_0x5aac('0x6'));var attributes=require(_0x5aac('0x7'));module['exports']=function(_0x55ae04,_0x752f6d){return _0x55ae04[_0x5aac('0x8')]('SmsAccount',attributes,{'tableName':_0x5aac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32cc=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','api','bluebird','request-promise'];(function(_0x4e8efd,_0x46bc20){var _0x31e442=function(_0x4c6c00){while(--_0x4c6c00){_0x4e8efd['push'](_0x4e8efd['shift']());}};_0x31e442(++_0x46bc20);}(_0x32cc,0x181));var _0xc32c=function(_0x468c03,_0x190103){_0x468c03=_0x468c03-0x0;var _0x5b12ba=_0x32cc[_0x468c03];return _0x5b12ba;};'use strict';var _=require(_0xc32c('0x0'));var util=require(_0xc32c('0x1'));var logger=require('../../config/logger')(_0xc32c('0x2'));var moment=require('moment');var BPromise=require(_0xc32c('0x3'));var rp=require(_0xc32c('0x4'));var fs=require('fs');var path=require(_0xc32c('0x5'));var rimraf=require(_0xc32c('0x6'));var config=require(_0xc32c('0x7'));var attributes=require(_0xc32c('0x8'));module[_0xc32c('0x9')]=function(_0x27eb15,_0xe23fb9){return _0x27eb15[_0xc32c('0xa')](_0xc32c('0xb'),attributes,{'tableName':_0xc32c('0xc'),'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 effee02..2c66fe4 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 _0x2c70=['code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','model','map','then','stringify','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x2c70,0xcd));var _0x02c7=function(_0x2c6ba7,_0x2dea69){_0x2c6ba7=_0x2c6ba7-0x0;var _0x259085=_0x2c70[_0x2c6ba7];return _0x259085;};'use strict';var _=require(_0x02c7('0x0'));var util=require(_0x02c7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x02c7('0x2'));var fs=require('fs');var Redis=require(_0x02c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x02c7('0x4'));var logger=require(_0x02c7('0x5'))(_0x02c7('0x6'));var config=require(_0x02c7('0x7'));var jayson=require(_0x02c7('0x8'));var client=jayson[_0x02c7('0x9')][_0x02c7('0xa')]({'port':0x232a});config['redis']=_[_0x02c7('0xb')](config[_0x02c7('0xc')],{'host':_0x02c7('0xd'),'port':0x18eb});var socket=require(_0x02c7('0xe'))(new Redis(config['redis']));require(_0x02c7('0xf'))['register'](socket);function respondWithRpcPromise(_0x254275,_0x20326c,_0x8db091){return new BPromise(function(_0x4eaee1,_0x5ab86e){return client[_0x02c7('0x10')](_0x254275,_0x8db091)['then'](function(_0x2b8d11){logger[_0x02c7('0x11')](_0x02c7('0x12'),_0x20326c,_0x02c7('0x13'));logger[_0x02c7('0x14')](_0x02c7('0x15'),_0x20326c,_0x02c7('0x13'),JSON['stringify'](_0x2b8d11));if(_0x2b8d11[_0x02c7('0x16')]){if(_0x2b8d11[_0x02c7('0x16')][_0x02c7('0x17')]===0x1f4){logger[_0x02c7('0x16')](_0x02c7('0x12'),_0x20326c,_0x2b8d11[_0x02c7('0x16')][_0x02c7('0x18')]);return _0x5ab86e(_0x2b8d11[_0x02c7('0x16')][_0x02c7('0x18')]);}logger['error'](_0x02c7('0x12'),_0x20326c,_0x2b8d11[_0x02c7('0x16')][_0x02c7('0x18')]);return _0x4eaee1(_0x2b8d11[_0x02c7('0x16')][_0x02c7('0x18')]);}else{logger[_0x02c7('0x11')](_0x02c7('0x12'),_0x20326c,'request\x20sent');_0x4eaee1(_0x2b8d11[_0x02c7('0x19')][_0x02c7('0x18')]);}})[_0x02c7('0x1a')](function(_0x97751){logger[_0x02c7('0x16')](_0x02c7('0x12'),_0x20326c,_0x97751);_0x5ab86e(_0x97751);});});}exports[_0x02c7('0x1b')]=function(_0x4fee41){var _0x1ee86c=this;return new Promise(function(_0x20bf09,_0x150f43){return db[_0x02c7('0x1c')]['find']({'raw':_0x4fee41[_0x02c7('0x1d')]?_0x4fee41[_0x02c7('0x1d')][_0x02c7('0x1e')]===undefined?!![]:![]:!![],'where':_0x4fee41[_0x02c7('0x1d')]?_0x4fee41['options'][_0x02c7('0x1f')]||null:null,'attributes':_0x4fee41[_0x02c7('0x1d')]?_0x4fee41['options'][_0x02c7('0x20')]||null:null,'include':_0x4fee41['options']?_0x4fee41[_0x02c7('0x1d')][_0x02c7('0x21')]?_['map'](_0x4fee41[_0x02c7('0x1d')]['include'],function(_0x4ee849){return{'model':db[_0x4ee849[_0x02c7('0x22')]],'as':_0x4ee849['as'],'attributes':_0x4ee849[_0x02c7('0x20')],'include':_0x4ee849['include']?_['map'](_0x4ee849[_0x02c7('0x21')],function(_0x3fe743){return{'model':db[_0x3fe743['model']],'as':_0x3fe743['as'],'attributes':_0x3fe743[_0x02c7('0x20')],'include':_0x3fe743[_0x02c7('0x21')]?_[_0x02c7('0x23')](_0x3fe743[_0x02c7('0x21')],function(_0x2c52ef){return{'model':db[_0x2c52ef['model']],'as':_0x2c52ef['as'],'attributes':_0x2c52ef[_0x02c7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x02c7('0x24')](function(_0x4812f0){logger[_0x02c7('0x11')](_0x02c7('0x1b'),_0x4fee41);logger[_0x02c7('0x14')](_0x02c7('0x1b'),_0x4fee41,JSON[_0x02c7('0x25')](_0x4812f0));_0x20bf09(_0x4812f0);})[_0x02c7('0x1a')](function(_0x252d8e){logger['error'](_0x02c7('0x1b'),_0x252d8e['message'],_0x4fee41);_0x150f43(_0x1ee86c[_0x02c7('0x16')](0x1f4,_0x252d8e[_0x02c7('0x18')]));});});}; \ No newline at end of file +var _0x9abf=['attributes','include','map','model','ShowSmsAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','options','raw','where'];(function(_0x2d937a,_0x35b1f5){var _0x4d7de5=function(_0x5a08af){while(--_0x5a08af){_0x2d937a['push'](_0x2d937a['shift']());}};_0x4d7de5(++_0x35b1f5);}(_0x9abf,0x89));var _0xf9ab=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9abf[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf9ab('0x0'));var util=require('util');var moment=require(_0xf9ab('0x1'));var BPromise=require(_0xf9ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9ab('0x3'));var db=require(_0xf9ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9ab('0x5'))('rpc');var config=require(_0xf9ab('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf9ab('0x7')][_0xf9ab('0x8')]({'port':0x232a});config[_0xf9ab('0x9')]=_[_0xf9ab('0xa')](config['redis'],{'host':_0xf9ab('0xb'),'port':0x18eb});var socket=require(_0xf9ab('0xc'))(new Redis(config['redis']));require(_0xf9ab('0xd'))['register'](socket);function respondWithRpcPromise(_0x39ca59,_0x597778,_0x195cb4){return new BPromise(function(_0x103014,_0x565c9d){return client[_0xf9ab('0xe')](_0x39ca59,_0x195cb4)[_0xf9ab('0xf')](function(_0x4bd611){logger[_0xf9ab('0x10')](_0xf9ab('0x11'),_0x597778,_0xf9ab('0x12'));logger[_0xf9ab('0x13')](_0xf9ab('0x14'),_0x597778,_0xf9ab('0x12'),JSON[_0xf9ab('0x15')](_0x4bd611));if(_0x4bd611[_0xf9ab('0x16')]){if(_0x4bd611[_0xf9ab('0x16')]['code']===0x1f4){logger[_0xf9ab('0x16')]('SmsAccount,\x20%s,\x20%s',_0x597778,_0x4bd611['error'][_0xf9ab('0x17')]);return _0x565c9d(_0x4bd611[_0xf9ab('0x16')][_0xf9ab('0x17')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x597778,_0x4bd611[_0xf9ab('0x16')][_0xf9ab('0x17')]);return _0x103014(_0x4bd611[_0xf9ab('0x16')][_0xf9ab('0x17')]);}else{logger['info'](_0xf9ab('0x11'),_0x597778,_0xf9ab('0x12'));_0x103014(_0x4bd611['result'][_0xf9ab('0x17')]);}})[_0xf9ab('0x18')](function(_0x208d2e){logger[_0xf9ab('0x16')](_0xf9ab('0x11'),_0x597778,_0x208d2e);_0x565c9d(_0x208d2e);});});}exports['ShowSmsAccount']=function(_0x9f34d8){var _0x384c63=this;return new Promise(function(_0x46d470,_0x3d7e09){return db['SmsAccount']['find']({'raw':_0x9f34d8[_0xf9ab('0x19')]?_0x9f34d8['options'][_0xf9ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x9f34d8[_0xf9ab('0x19')]?_0x9f34d8[_0xf9ab('0x19')][_0xf9ab('0x1b')]||null:null,'attributes':_0x9f34d8[_0xf9ab('0x19')]?_0x9f34d8[_0xf9ab('0x19')][_0xf9ab('0x1c')]||null:null,'include':_0x9f34d8[_0xf9ab('0x19')]?_0x9f34d8[_0xf9ab('0x19')][_0xf9ab('0x1d')]?_[_0xf9ab('0x1e')](_0x9f34d8['options'][_0xf9ab('0x1d')],function(_0x1eb2a7){return{'model':db[_0x1eb2a7[_0xf9ab('0x1f')]],'as':_0x1eb2a7['as'],'attributes':_0x1eb2a7[_0xf9ab('0x1c')],'include':_0x1eb2a7[_0xf9ab('0x1d')]?_['map'](_0x1eb2a7['include'],function(_0x52a072){return{'model':db[_0x52a072['model']],'as':_0x52a072['as'],'attributes':_0x52a072['attributes'],'include':_0x52a072[_0xf9ab('0x1d')]?_[_0xf9ab('0x1e')](_0x52a072['include'],function(_0x4b9e43){return{'model':db[_0x4b9e43[_0xf9ab('0x1f')]],'as':_0x4b9e43['as'],'attributes':_0x4b9e43[_0xf9ab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf9ab('0xf')](function(_0x5aa7d5){logger['info'](_0xf9ab('0x20'),_0x9f34d8);logger[_0xf9ab('0x13')](_0xf9ab('0x20'),_0x9f34d8,JSON['stringify'](_0x5aa7d5));_0x46d470(_0x5aa7d5);})['catch'](function(_0x248f74){logger['error'](_0xf9ab('0x20'),_0x248f74[_0xf9ab('0x17')],_0x9f34d8);_0x3d7e09(_0x384c63[_0xf9ab('0x16')](0x1f4,_0x248f74[_0xf9ab('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 6fe4bda..c8b3d31 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 _0x3c67=['save','remove','emit','register','length','smsAccount:','./smsAccount.events'];(function(_0x3958cf,_0x4e7dac){var _0x224675=function(_0x59c088){while(--_0x59c088){_0x3958cf['push'](_0x3958cf['shift']());}};_0x224675(++_0x4e7dac);}(_0x3c67,0x110));var _0x73c6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3c67[_0x2641f9];return _0x585741;};'use strict';var SmsAccountEvents=require(_0x73c6('0x0'));var events=[_0x73c6('0x1'),_0x73c6('0x2'),'update'];function createListener(_0x5b363d,_0x45d455){return function(_0x2989a5){_0x45d455[_0x73c6('0x3')](_0x5b363d,_0x2989a5);};}function removeListener(_0x242c49,_0x491f98){return function(){SmsAccountEvents['removeListener'](_0x242c49,_0x491f98);};}exports[_0x73c6('0x4')]=function(_0x515990){for(var _0x561e32=0x0,_0x3cfdc9=events[_0x73c6('0x5')];_0x561e32<_0x3cfdc9;_0x561e32++){var _0x4eb274=events[_0x561e32];var _0x424e04=createListener(_0x73c6('0x6')+_0x4eb274,_0x515990);SmsAccountEvents['on'](_0x4eb274,_0x424e04);}}; \ No newline at end of file +var _0x1835=['remove','update','emit','removeListener','length','./smsAccount.events','save'];(function(_0x14db11,_0x111202){var _0x61bfda=function(_0x508471){while(--_0x508471){_0x14db11['push'](_0x14db11['shift']());}};_0x61bfda(++_0x111202);}(_0x1835,0x108));var _0x5183=function(_0x5a242c,_0x3bdffb){_0x5a242c=_0x5a242c-0x0;var _0xf7071b=_0x1835[_0x5a242c];return _0xf7071b;};'use strict';var SmsAccountEvents=require(_0x5183('0x0'));var events=[_0x5183('0x1'),_0x5183('0x2'),_0x5183('0x3')];function createListener(_0x4f1c35,_0x2d3b1a){return function(_0x2f8215){_0x2d3b1a[_0x5183('0x4')](_0x4f1c35,_0x2f8215);};}function removeListener(_0x578ab4,_0x86a9f1){return function(){SmsAccountEvents[_0x5183('0x5')](_0x578ab4,_0x86a9f1);};}exports['register']=function(_0x3b0a2d){for(var _0x4e3792=0x0,_0x558d7d=events[_0x5183('0x6')];_0x4e3792<_0x558d7d;_0x4e3792++){var _0x38c129=events[_0x4e3792];var _0x405473=createListener('smsAccount:'+_0x38c129,_0x3b0a2d);SmsAccountEvents['on'](_0x38c129,_0x405473);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 4adcdc0..03f442b 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 _0xccf2=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xff6317,_0x4e03a5){var _0x98f7e6=function(_0x4029bb){while(--_0x4029bb){_0xff6317['push'](_0xff6317['shift']());}};_0x98f7e6(++_0x4e03a5);}(_0xccf2,0x1e5));var _0x2ccf=function(_0x121cad,_0x3ed0ae){_0x121cad=_0x121cad-0x0;var _0x302c37=_0xccf2[_0x121cad];return _0x302c37;};'use strict';var multer=require(_0x2ccf('0x0'));var util=require(_0x2ccf('0x1'));var path=require('path');var timeout=require(_0x2ccf('0x2'));var express=require(_0x2ccf('0x3'));var router=express['Router']();var auth=require(_0x2ccf('0x4'));var interaction=require(_0x2ccf('0x5'));var config=require(_0x2ccf('0x6'));var controller=require('./smsApplication.controller');router[_0x2ccf('0x7')]('/',auth[_0x2ccf('0x8')](),controller[_0x2ccf('0x9')]);router[_0x2ccf('0x7')](_0x2ccf('0xa'),auth[_0x2ccf('0x8')](),controller[_0x2ccf('0xb')]);router[_0x2ccf('0xc')]('/',auth[_0x2ccf('0x8')](),controller[_0x2ccf('0xd')]);router[_0x2ccf('0xe')](_0x2ccf('0xa'),auth[_0x2ccf('0x8')](),controller[_0x2ccf('0xf')]);router[_0x2ccf('0x10')](_0x2ccf('0xa'),auth[_0x2ccf('0x8')](),controller[_0x2ccf('0x11')]);module[_0x2ccf('0x12')]=router; \ No newline at end of file +var _0x26c2=['get','/:id','isAuthenticated','show','post','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x23debc,_0x300d47){var _0x3a227b=function(_0x328dd7){while(--_0x328dd7){_0x23debc['push'](_0x23debc['shift']());}};_0x3a227b(++_0x300d47);}(_0x26c2,0x88));var _0x226c=function(_0x38a63d,_0x5186b1){_0x38a63d=_0x38a63d-0x0;var _0x181f4e=_0x26c2[_0x38a63d];return _0x181f4e;};'use strict';var multer=require(_0x226c('0x0'));var util=require('util');var path=require(_0x226c('0x1'));var timeout=require(_0x226c('0x2'));var express=require(_0x226c('0x3'));var router=express[_0x226c('0x4')]();var auth=require(_0x226c('0x5'));var interaction=require(_0x226c('0x6'));var config=require(_0x226c('0x7'));var controller=require('./smsApplication.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x226c('0x8')](_0x226c('0x9'),auth[_0x226c('0xa')](),controller[_0x226c('0xb')]);router[_0x226c('0xc')]('/',auth[_0x226c('0xa')](),controller['create']);router['put'](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xd')]);router[_0x226c('0xe')](_0x226c('0x9'),auth[_0x226c('0xa')](),controller[_0x226c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 40c7461..a4549a4 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 _0x5458=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0x5458,0x1c7));var _0x8545=function(_0x61b469,_0x414a00){_0x61b469=_0x61b469-0x0;var _0x461bdd=_0x5458[_0x61b469];return _0x461bdd;};'use strict';var Sequelize=require(_0x8545('0x0'));module[_0x8545('0x1')]={'priority':{'type':Sequelize[_0x8545('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8545('0x3')},'appdata':{'type':Sequelize[_0x8545('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8545('0x5')],'defaultValue':_0x8545('0x6')}}; \ No newline at end of file +var _0xef0a=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x2c6a60,_0x5f4462){var _0x4ee6b1=function(_0x9d447b){while(--_0x9d447b){_0x2c6a60['push'](_0x2c6a60['shift']());}};_0x4ee6b1(++_0x5f4462);}(_0xef0a,0xdd));var _0xaef0=function(_0x33fef0,_0x32fac3){_0x33fef0=_0x33fef0-0x0;var _0xcb55ab=_0xef0a[_0x33fef0];return _0xcb55ab;};'use strict';var Sequelize=require(_0xaef0('0x0'));module[_0xaef0('0x1')]={'priority':{'type':Sequelize[_0xaef0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaef0('0x3')],'allowNull':![],'defaultValue':_0xaef0('0x4')},'appdata':{'type':Sequelize[_0xaef0('0x5')]()},'description':{'type':Sequelize[_0xaef0('0x3')]},'interval':{'type':Sequelize[_0xaef0('0x3')],'defaultValue':_0xaef0('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index d6cacac..e3e8a73 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 _0xf6d8=['reject','update','then','destroy','sendStatus','error','stack','name','send','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','SmsApplication','includeAll','include','rows','catch','show','params','keys','find','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','end','json','count','limit','status','set','Content-Range','apply'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0xf6d8,0x1bb));var _0x8f6d=function(_0x15525e,_0x154656){_0x15525e=_0x15525e-0x0;var _0x2f3ad7=_0xf6d8[_0x15525e];return _0x2f3ad7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8f6d('0x0'));var rimraf=require(_0x8f6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f6d('0x2'));var rp=require('request-promise');var moment=require(_0x8f6d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8f6d('0x4'));var util=require(_0x8f6d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8f6d('0x6'));var ejs=require(_0x8f6d('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8f6d('0x8'));var crypto=require(_0x8f6d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8f6d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8f6d('0xb'));var Papa=require(_0x8f6d('0xc'));var Redis=require(_0x8f6d('0xd'));var authService=require(_0x8f6d('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f6d('0xf'))(_0x8f6d('0x10'));var utils=require(_0x8f6d('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ac4c9,_0x318235){_0x318235=_0x318235||0xcc;return function(_0x330dd0){if(_0x330dd0){return _0x5ac4c9['sendStatus'](_0x318235);}return _0x5ac4c9['status'](_0x318235)[_0x8f6d('0x12')]();};}function respondWithResult(_0x48ab12,_0x2c328e){_0x2c328e=_0x2c328e||0xc8;return function(_0xa8d3f2){if(_0xa8d3f2){return _0x48ab12['status'](_0x2c328e)[_0x8f6d('0x13')](_0xa8d3f2);}};}function respondWithFilteredResult(_0x160b0b,_0x24d4e5){return function(_0x7bd6c7){if(_0x7bd6c7){var _0x20b8c9=_0x7bd6c7[_0x8f6d('0x14')],_0x10e1b9=_0x24d4e5['offset'],_0x4a01be=_0x24d4e5['offset']+_0x24d4e5[_0x8f6d('0x15')],_0xfd1641;if(_0x4a01be>=_0x20b8c9){_0x4a01be=_0x20b8c9;_0xfd1641=0xc8;}else{_0xfd1641=0xce;}_0x160b0b[_0x8f6d('0x16')](_0xfd1641);return _0x160b0b[_0x8f6d('0x17')](_0x8f6d('0x18'),_0x10e1b9+'-'+_0x4a01be+'/'+_0x20b8c9)['json'](_0x7bd6c7);}return null;};}function patchUpdates(_0x51117a){return function(_0x2d10ce){try{jsonpatch[_0x8f6d('0x19')](_0x2d10ce,_0x51117a,!![]);}catch(_0x3e9ef0){return BPromise[_0x8f6d('0x1a')](_0x3e9ef0);}return _0x2d10ce['save']();};}function saveUpdates(_0x253c03,_0x258043){return function(_0x47f88b){if(_0x47f88b){return _0x47f88b[_0x8f6d('0x1b')](_0x253c03)[_0x8f6d('0x1c')](function(_0x122063){return _0x122063;});}return null;};}function removeEntity(_0x4cf51a,_0x26a1b7){return function(_0x523110){if(_0x523110){return _0x523110[_0x8f6d('0x1d')]()[_0x8f6d('0x1c')](function(){_0x4cf51a[_0x8f6d('0x16')](0xcc)[_0x8f6d('0x12')]();});}};}function handleEntityNotFound(_0x36c19d,_0x3696a4){return function(_0x4292a8){if(!_0x4292a8){_0x36c19d[_0x8f6d('0x1e')](0x194);}return _0x4292a8;};}function handleError(_0x3f7213,_0x5ccc5c){_0x5ccc5c=_0x5ccc5c||0x1f4;return function(_0x2b98f6){logger[_0x8f6d('0x1f')](_0x2b98f6[_0x8f6d('0x20')]);if(_0x2b98f6['name']){delete _0x2b98f6[_0x8f6d('0x21')];}_0x3f7213[_0x8f6d('0x16')](_0x5ccc5c)[_0x8f6d('0x22')](_0x2b98f6);};}exports['index']=function(_0x32466b,_0x53c5c4){var _0x59f1b5={},_0x4661b7={},_0x46f195={'count':0x0,'rows':[]};var _0x3e2470=db['SmsApplication'][_0x8f6d('0x23')];_0x4661b7['model']=_['keys'](_0x3e2470);_0x4661b7[_0x8f6d('0x24')]=_['keys'](_0x32466b[_0x8f6d('0x24')]);_0x4661b7[_0x8f6d('0x25')]=_[_0x8f6d('0x26')](_0x4661b7[_0x8f6d('0x27')],_0x4661b7['query']);_0x59f1b5[_0x8f6d('0x28')]=_[_0x8f6d('0x26')](_0x4661b7[_0x8f6d('0x27')],qs[_0x8f6d('0x29')](_0x32466b['query'][_0x8f6d('0x29')]));_0x59f1b5[_0x8f6d('0x28')]=_0x59f1b5[_0x8f6d('0x28')][_0x8f6d('0x2a')]?_0x59f1b5[_0x8f6d('0x28')]:_0x4661b7['model'];if(!_0x32466b[_0x8f6d('0x24')][_0x8f6d('0x2b')](_0x8f6d('0x2c'))){_0x59f1b5[_0x8f6d('0x15')]=qs['limit'](_0x32466b[_0x8f6d('0x24')][_0x8f6d('0x15')]);_0x59f1b5[_0x8f6d('0x2d')]=qs[_0x8f6d('0x2d')](_0x32466b['query'][_0x8f6d('0x2d')]);}_0x59f1b5[_0x8f6d('0x2e')]=qs[_0x8f6d('0x2f')](_0x32466b[_0x8f6d('0x24')][_0x8f6d('0x2f')]);_0x59f1b5[_0x8f6d('0x30')]=qs['filters'](_[_0x8f6d('0x31')](_0x32466b[_0x8f6d('0x24')],_0x4661b7[_0x8f6d('0x25')]));if(_0x32466b[_0x8f6d('0x24')]['filter']){_0x59f1b5[_0x8f6d('0x30')]=_[_0x8f6d('0x32')](_0x59f1b5[_0x8f6d('0x30')],{'$or':_[_0x8f6d('0x33')](_0x3e2470,function(_0x454381){if(_0x454381[_0x8f6d('0x34')]['key']!==_0x8f6d('0x35')){var _0x12b0cc={};_0x12b0cc[_0x454381[_0x8f6d('0x36')]]={'$like':'%'+_0x32466b['query'][_0x8f6d('0x37')]+'%'};return _0x12b0cc;}})});}_0x59f1b5=_[_0x8f6d('0x32')]({},_0x59f1b5,_0x32466b[_0x8f6d('0x38')]);var _0x55e7c2={'where':_0x59f1b5[_0x8f6d('0x30')]};return db[_0x8f6d('0x39')][_0x8f6d('0x14')](_0x55e7c2)[_0x8f6d('0x1c')](function(_0x335305){_0x46f195[_0x8f6d('0x14')]=_0x335305;if(_0x32466b[_0x8f6d('0x24')][_0x8f6d('0x3a')]){_0x59f1b5[_0x8f6d('0x3b')]=[{'all':!![]}];}return db[_0x8f6d('0x39')]['findAll'](_0x59f1b5);})[_0x8f6d('0x1c')](function(_0x59568f){_0x46f195[_0x8f6d('0x3c')]=_0x59568f;return _0x46f195;})[_0x8f6d('0x1c')](respondWithFilteredResult(_0x53c5c4,_0x59f1b5))[_0x8f6d('0x3d')](handleError(_0x53c5c4,null));};exports[_0x8f6d('0x3e')]=function(_0x2066a4,_0x547928){var _0x2f13ea={'raw':!![],'where':{'id':_0x2066a4[_0x8f6d('0x3f')]['id']}},_0x366dc8={};_0x366dc8[_0x8f6d('0x27')]=_[_0x8f6d('0x40')](db['SmsApplication'][_0x8f6d('0x23')]);_0x366dc8[_0x8f6d('0x24')]=_['keys'](_0x2066a4[_0x8f6d('0x24')]);_0x366dc8['filters']=_[_0x8f6d('0x26')](_0x366dc8[_0x8f6d('0x27')],_0x366dc8['query']);_0x2f13ea[_0x8f6d('0x28')]=_['intersection'](_0x366dc8[_0x8f6d('0x27')],qs[_0x8f6d('0x29')](_0x2066a4[_0x8f6d('0x24')][_0x8f6d('0x29')]));_0x2f13ea[_0x8f6d('0x28')]=_0x2f13ea[_0x8f6d('0x28')][_0x8f6d('0x2a')]?_0x2f13ea[_0x8f6d('0x28')]:_0x366dc8[_0x8f6d('0x27')];if(_0x2066a4[_0x8f6d('0x24')][_0x8f6d('0x3a')]){_0x2f13ea[_0x8f6d('0x3b')]=[{'all':!![]}];}_0x2f13ea=_[_0x8f6d('0x32')]({},_0x2f13ea,_0x2066a4[_0x8f6d('0x38')]);return db[_0x8f6d('0x39')][_0x8f6d('0x41')](_0x2f13ea)[_0x8f6d('0x1c')](handleEntityNotFound(_0x547928,null))[_0x8f6d('0x1c')](respondWithResult(_0x547928,null))[_0x8f6d('0x3d')](handleError(_0x547928,null));};exports['create']=function(_0x30d110,_0xce29f6){return db[_0x8f6d('0x39')]['create'](_0x30d110[_0x8f6d('0x42')],{})[_0x8f6d('0x1c')](respondWithResult(_0xce29f6,0xc9))[_0x8f6d('0x3d')](handleError(_0xce29f6,null));};exports[_0x8f6d('0x1b')]=function(_0x248723,_0x1993f4){if(_0x248723[_0x8f6d('0x42')]['id']){delete _0x248723[_0x8f6d('0x42')]['id'];}return db[_0x8f6d('0x39')][_0x8f6d('0x41')]({'where':{'id':_0x248723['params']['id']}})[_0x8f6d('0x1c')](handleEntityNotFound(_0x1993f4,null))[_0x8f6d('0x1c')](saveUpdates(_0x248723[_0x8f6d('0x42')],null))['then'](respondWithResult(_0x1993f4,null))[_0x8f6d('0x3d')](handleError(_0x1993f4,null));};exports['destroy']=function(_0x41c858,_0x15c018){return db['SmsApplication'][_0x8f6d('0x41')]({'where':{'id':_0x41c858[_0x8f6d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x15c018,null))[_0x8f6d('0x1c')](removeEntity(_0x15c018,null))[_0x8f6d('0x3d')](handleError(_0x15c018,null));}; \ No newline at end of file +var _0x947b=['api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','SmsApplication','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','includeAll','findAll','rows','params','rawAttributes','include','find','catch','create','body','update','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x45e179,_0xfcaec7){var _0x54322b=function(_0x258f3b){while(--_0x258f3b){_0x45e179['push'](_0x45e179['shift']());}};_0x54322b(++_0xfcaec7);}(_0x947b,0x15a));var _0xb947=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x947b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb947('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb947('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb947('0x2'));var rp=require(_0xb947('0x3'));var moment=require(_0xb947('0x4'));var BPromise=require(_0xb947('0x5'));var Mustache=require(_0xb947('0x6'));var util=require(_0xb947('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb947('0x8'));var ejs=require(_0xb947('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb947('0xa'));var jsforce=require(_0xb947('0xb'));var deskjs=require(_0xb947('0xc'));var toCsv=require(_0xb947('0x8'));var querystring=require(_0xb947('0xd'));var Papa=require(_0xb947('0xe'));var Redis=require(_0xb947('0xf'));var authService=require(_0xb947('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb947('0x11'));var logger=require(_0xb947('0x12'))(_0xb947('0x13'));var utils=require(_0xb947('0x14'));var config=require(_0xb947('0x15'));var db=require(_0xb947('0x16'))['db'];function respondWithStatusCode(_0x5ebeee,_0x12261e){_0x12261e=_0x12261e||0xcc;return function(_0x5b2af3){if(_0x5b2af3){return _0x5ebeee['sendStatus'](_0x12261e);}return _0x5ebeee['status'](_0x12261e)[_0xb947('0x17')]();};}function respondWithResult(_0x1a266d,_0xa7f85a){_0xa7f85a=_0xa7f85a||0xc8;return function(_0x4ac638){if(_0x4ac638){return _0x1a266d[_0xb947('0x18')](_0xa7f85a)[_0xb947('0x19')](_0x4ac638);}};}function respondWithFilteredResult(_0x1990f0,_0x34249b){return function(_0x511709){if(_0x511709){var _0x3b19b2=_0x511709[_0xb947('0x1a')],_0x4e8552=_0x34249b[_0xb947('0x1b')],_0x2558dd=_0x34249b['offset']+_0x34249b[_0xb947('0x1c')],_0xa71710;if(_0x2558dd>=_0x3b19b2){_0x2558dd=_0x3b19b2;_0xa71710=0xc8;}else{_0xa71710=0xce;}_0x1990f0[_0xb947('0x18')](_0xa71710);return _0x1990f0['set'](_0xb947('0x1d'),_0x4e8552+'-'+_0x2558dd+'/'+_0x3b19b2)['json'](_0x511709);}return null;};}function patchUpdates(_0x2b3969){return function(_0x2c696e){try{jsonpatch[_0xb947('0x1e')](_0x2c696e,_0x2b3969,!![]);}catch(_0x210110){return BPromise[_0xb947('0x1f')](_0x210110);}return _0x2c696e[_0xb947('0x20')]();};}function saveUpdates(_0x5b022e,_0x1ac101){return function(_0x348834){if(_0x348834){return _0x348834['update'](_0x5b022e)[_0xb947('0x21')](function(_0x5e19b5){return _0x5e19b5;});}return null;};}function removeEntity(_0x1a2737,_0x10f4bc){return function(_0x1829ee){if(_0x1829ee){return _0x1829ee[_0xb947('0x22')]()[_0xb947('0x21')](function(){_0x1a2737['status'](0xcc)[_0xb947('0x17')]();});}};}function handleEntityNotFound(_0x5d8845,_0x50960d){return function(_0x201d0d){if(!_0x201d0d){_0x5d8845[_0xb947('0x23')](0x194);}return _0x201d0d;};}function handleError(_0x59d1ac,_0x428523){_0x428523=_0x428523||0x1f4;return function(_0x14b45f){logger[_0xb947('0x24')](_0x14b45f[_0xb947('0x25')]);if(_0x14b45f[_0xb947('0x26')]){delete _0x14b45f[_0xb947('0x26')];}_0x59d1ac[_0xb947('0x18')](_0x428523)[_0xb947('0x27')](_0x14b45f);};}exports[_0xb947('0x28')]=function(_0xa0c50,_0x48e47e){var _0x4bde04={},_0x3684ec={},_0x5b9ab8={'count':0x0,'rows':[]};var _0x3f9846=db[_0xb947('0x29')]['rawAttributes'];_0x3684ec[_0xb947('0x2a')]=_[_0xb947('0x2b')](_0x3f9846);_0x3684ec[_0xb947('0x2c')]=_[_0xb947('0x2b')](_0xa0c50[_0xb947('0x2c')]);_0x3684ec[_0xb947('0x2d')]=_[_0xb947('0x2e')](_0x3684ec[_0xb947('0x2a')],_0x3684ec['query']);_0x4bde04[_0xb947('0x2f')]=_['intersection'](_0x3684ec[_0xb947('0x2a')],qs[_0xb947('0x30')](_0xa0c50[_0xb947('0x2c')][_0xb947('0x30')]));_0x4bde04[_0xb947('0x2f')]=_0x4bde04[_0xb947('0x2f')][_0xb947('0x31')]?_0x4bde04[_0xb947('0x2f')]:_0x3684ec['model'];if(!_0xa0c50[_0xb947('0x2c')][_0xb947('0x32')](_0xb947('0x33'))){_0x4bde04['limit']=qs[_0xb947('0x1c')](_0xa0c50[_0xb947('0x2c')]['limit']);_0x4bde04['offset']=qs[_0xb947('0x1b')](_0xa0c50[_0xb947('0x2c')][_0xb947('0x1b')]);}_0x4bde04[_0xb947('0x34')]=qs[_0xb947('0x35')](_0xa0c50['query']['sort']);_0x4bde04[_0xb947('0x36')]=qs[_0xb947('0x2d')](_[_0xb947('0x37')](_0xa0c50['query'],_0x3684ec[_0xb947('0x2d')]));if(_0xa0c50[_0xb947('0x2c')][_0xb947('0x38')]){_0x4bde04[_0xb947('0x36')]=_['merge'](_0x4bde04[_0xb947('0x36')],{'$or':_[_0xb947('0x39')](_0x3f9846,function(_0x54fcca){if(_0x54fcca[_0xb947('0x3a')][_0xb947('0x3b')]!==_0xb947('0x3c')){var _0x5d2706={};_0x5d2706[_0x54fcca['field']]={'$like':'%'+_0xa0c50[_0xb947('0x2c')]['filter']+'%'};return _0x5d2706;}})});}_0x4bde04=_[_0xb947('0x3d')]({},_0x4bde04,_0xa0c50['options']);var _0x16dfd6={'where':_0x4bde04['where']};return db['SmsApplication'][_0xb947('0x1a')](_0x16dfd6)[_0xb947('0x21')](function(_0xddafdd){_0x5b9ab8['count']=_0xddafdd;if(_0xa0c50[_0xb947('0x2c')][_0xb947('0x3e')]){_0x4bde04['include']=[{'all':!![]}];}return db['SmsApplication'][_0xb947('0x3f')](_0x4bde04);})[_0xb947('0x21')](function(_0x5ef88e){_0x5b9ab8[_0xb947('0x40')]=_0x5ef88e;return _0x5b9ab8;})[_0xb947('0x21')](respondWithFilteredResult(_0x48e47e,_0x4bde04))['catch'](handleError(_0x48e47e,null));};exports['show']=function(_0x49411e,_0x29a089){var _0x150891={'raw':!![],'where':{'id':_0x49411e[_0xb947('0x41')]['id']}},_0x7b3a27={};_0x7b3a27['model']=_[_0xb947('0x2b')](db[_0xb947('0x29')][_0xb947('0x42')]);_0x7b3a27[_0xb947('0x2c')]=_[_0xb947('0x2b')](_0x49411e[_0xb947('0x2c')]);_0x7b3a27[_0xb947('0x2d')]=_[_0xb947('0x2e')](_0x7b3a27[_0xb947('0x2a')],_0x7b3a27[_0xb947('0x2c')]);_0x150891[_0xb947('0x2f')]=_[_0xb947('0x2e')](_0x7b3a27[_0xb947('0x2a')],qs['fields'](_0x49411e[_0xb947('0x2c')][_0xb947('0x30')]));_0x150891['attributes']=_0x150891['attributes'][_0xb947('0x31')]?_0x150891[_0xb947('0x2f')]:_0x7b3a27[_0xb947('0x2a')];if(_0x49411e[_0xb947('0x2c')]['includeAll']){_0x150891[_0xb947('0x43')]=[{'all':!![]}];}_0x150891=_['merge']({},_0x150891,_0x49411e['options']);return db[_0xb947('0x29')][_0xb947('0x44')](_0x150891)[_0xb947('0x21')](handleEntityNotFound(_0x29a089,null))['then'](respondWithResult(_0x29a089,null))[_0xb947('0x45')](handleError(_0x29a089,null));};exports['create']=function(_0x478275,_0x3df6c3){return db['SmsApplication'][_0xb947('0x46')](_0x478275[_0xb947('0x47')],{})[_0xb947('0x21')](respondWithResult(_0x3df6c3,0xc9))[_0xb947('0x45')](handleError(_0x3df6c3,null));};exports[_0xb947('0x48')]=function(_0x412997,_0x3d11d5){if(_0x412997[_0xb947('0x47')]['id']){delete _0x412997[_0xb947('0x47')]['id'];}return db[_0xb947('0x29')][_0xb947('0x44')]({'where':{'id':_0x412997[_0xb947('0x41')]['id']}})[_0xb947('0x21')](handleEntityNotFound(_0x3d11d5,null))[_0xb947('0x21')](saveUpdates(_0x412997[_0xb947('0x47')],null))[_0xb947('0x21')](respondWithResult(_0x3d11d5,null))[_0xb947('0x45')](handleError(_0x3d11d5,null));};exports['destroy']=function(_0x15bba2,_0x19877b){return db[_0xb947('0x29')]['find']({'where':{'id':_0x15bba2[_0xb947('0x41')]['id']}})[_0xb947('0x21')](handleEntityNotFound(_0x19877b,null))['then'](removeEntity(_0x19877b,null))['catch'](handleError(_0x19877b,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e679fcf..7d567a2 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 _0x7a54=['sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication'];(function(_0x2d19e4,_0x59bfab){var _0x5959a4=function(_0x34ef35){while(--_0x34ef35){_0x2d19e4['push'](_0x2d19e4['shift']());}};_0x5959a4(++_0x59bfab);}(_0x7a54,0x106));var _0x47a5=function(_0x46ee9b,_0x5258bc){_0x46ee9b=_0x46ee9b-0x0;var _0x25ba91=_0x7a54[_0x46ee9b];return _0x25ba91;};'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':!![],'charset':'utf8mb4','collate':_0x47a5('0xc')});}; \ No newline at end of file +var _0xf494=['../../config/environment','./smsApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4eac81,_0x3b2016){var _0x493af9=function(_0x3f2331){while(--_0x3f2331){_0x4eac81['push'](_0x4eac81['shift']());}};_0x493af9(++_0x3b2016);}(_0xf494,0x1c6));var _0x4f49=function(_0x5441b3,_0xb43824){_0x5441b3=_0x5441b3-0x0;var _0x1d436a=_0xf494[_0x5441b3];return _0x1d436a;};'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')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f49('0xc'),'collate':_0x4f49('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2f44185..0e57497 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 _0xc432=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x1880f7,_0x2d7741){var _0x2078c7=function(_0x440a62){while(--_0x440a62){_0x1880f7['push'](_0x1880f7['shift']());}};_0x2078c7(++_0x2d7741);}(_0xc432,0xcd));var _0x2c43=function(_0x5f4b8d,_0x4e3d44){_0x5f4b8d=_0x5f4b8d-0x0;var _0x35dc3f=_0xc432[_0x5f4b8d];return _0x35dc3f;};'use strict';var _=require(_0x2c43('0x0'));var util=require(_0x2c43('0x1'));var moment=require(_0x2c43('0x2'));var BPromise=require(_0x2c43('0x3'));var rs=require(_0x2c43('0x4'));var fs=require('fs');var Redis=require(_0x2c43('0x5'));var db=require(_0x2c43('0x6'))['db'];var utils=require(_0x2c43('0x7'));var logger=require(_0x2c43('0x8'))(_0x2c43('0x9'));var config=require(_0x2c43('0xa'));var jayson=require(_0x2c43('0xb'));var client=jayson[_0x2c43('0xc')][_0x2c43('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x208e28,_0x4a37a9,_0x499349){return new BPromise(function(_0xf4cc0d,_0x23c112){return client[_0x2c43('0xe')](_0x208e28,_0x499349)[_0x2c43('0xf')](function(_0x5df1bf){logger[_0x2c43('0x10')](_0x2c43('0x11'),_0x4a37a9,_0x2c43('0x12'));logger[_0x2c43('0x13')](_0x2c43('0x14'),_0x4a37a9,'request\x20sent',JSON[_0x2c43('0x15')](_0x5df1bf));if(_0x5df1bf[_0x2c43('0x16')]){if(_0x5df1bf['error'][_0x2c43('0x17')]===0x1f4){logger[_0x2c43('0x16')](_0x2c43('0x11'),_0x4a37a9,_0x5df1bf['error'][_0x2c43('0x18')]);return _0x23c112(_0x5df1bf[_0x2c43('0x16')]['message']);}logger[_0x2c43('0x16')]('SmsApplication,\x20%s,\x20%s',_0x4a37a9,_0x5df1bf['error'][_0x2c43('0x18')]);return _0xf4cc0d(_0x5df1bf['error']['message']);}else{logger['info'](_0x2c43('0x11'),_0x4a37a9,_0x2c43('0x12'));_0xf4cc0d(_0x5df1bf[_0x2c43('0x19')][_0x2c43('0x18')]);}})['catch'](function(_0x1bdf50){logger[_0x2c43('0x16')](_0x2c43('0x11'),_0x4a37a9,_0x1bdf50);_0x23c112(_0x1bdf50);});});} \ No newline at end of file +var _0x5b01=['http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsApplication,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x3d3ee0,_0x212a0a){var _0x716609=function(_0x3a020a){while(--_0x3a020a){_0x3d3ee0['push'](_0x3d3ee0['shift']());}};_0x716609(++_0x212a0a);}(_0x5b01,0xdd));var _0x15b0=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x5b01[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x15b0('0x0'));var util=require(_0x15b0('0x1'));var moment=require(_0x15b0('0x2'));var BPromise=require(_0x15b0('0x3'));var rs=require(_0x15b0('0x4'));var fs=require('fs');var Redis=require(_0x15b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x15b0('0x6'))(_0x15b0('0x7'));var config=require(_0x15b0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x15b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b68f,_0x50084d,_0x439ef2){return new BPromise(function(_0x489e08,_0x844663){return client[_0x15b0('0xa')](_0x36b68f,_0x439ef2)[_0x15b0('0xb')](function(_0x57f960){logger[_0x15b0('0xc')]('SmsApplication,\x20%s,\x20%s',_0x50084d,_0x15b0('0xd'));logger[_0x15b0('0xe')](_0x15b0('0xf'),_0x50084d,_0x15b0('0xd'),JSON[_0x15b0('0x10')](_0x57f960));if(_0x57f960[_0x15b0('0x11')]){if(_0x57f960[_0x15b0('0x11')][_0x15b0('0x12')]===0x1f4){logger[_0x15b0('0x11')]('SmsApplication,\x20%s,\x20%s',_0x50084d,_0x57f960[_0x15b0('0x11')][_0x15b0('0x13')]);return _0x844663(_0x57f960[_0x15b0('0x11')][_0x15b0('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x50084d,_0x57f960[_0x15b0('0x11')]['message']);return _0x489e08(_0x57f960[_0x15b0('0x11')][_0x15b0('0x13')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x50084d,'request\x20sent');_0x489e08(_0x57f960[_0x15b0('0x14')][_0x15b0('0x13')]);}})[_0x15b0('0x15')](function(_0x10bd35){logger[_0x15b0('0x11')](_0x15b0('0x16'),_0x50084d,_0x10bd35);_0x844663(_0x10bd35);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 27a2f73..017ad22 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 _0xac79=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','sms','destroy','exports','multer','util','path','connect-timeout'];(function(_0x11d8f0,_0x4610a6){var _0xeb5d4c=function(_0x30217b){while(--_0x30217b){_0x11d8f0['push'](_0x11d8f0['shift']());}};_0xeb5d4c(++_0x4610a6);}(_0xac79,0x1eb));var _0x9ac7=function(_0x419bd1,_0x9b80db){_0x419bd1=_0x419bd1-0x0;var _0x1846b1=_0xac79[_0x419bd1];return _0x1846b1;};'use strict';var multer=require(_0x9ac7('0x0'));var util=require(_0x9ac7('0x1'));var path=require(_0x9ac7('0x2'));var timeout=require(_0x9ac7('0x3'));var express=require('express');var router=express[_0x9ac7('0x4')]();var auth=require(_0x9ac7('0x5'));var interaction=require(_0x9ac7('0x6'));var config=require(_0x9ac7('0x7'));var controller=require(_0x9ac7('0x8'));router[_0x9ac7('0x9')]('/',auth[_0x9ac7('0xa')](),controller[_0x9ac7('0xb')]);router['get'](_0x9ac7('0xc'),auth[_0x9ac7('0xa')](),controller[_0x9ac7('0xd')]);router[_0x9ac7('0x9')]('/:id',auth[_0x9ac7('0xa')](),controller[_0x9ac7('0xe')]);router[_0x9ac7('0x9')](_0x9ac7('0xf'),auth[_0x9ac7('0xa')](),controller['getMessages']);router[_0x9ac7('0x9')](_0x9ac7('0x10'),auth[_0x9ac7('0xa')](),controller[_0x9ac7('0x11')]);router['post']('/',auth[_0x9ac7('0xa')](),controller[_0x9ac7('0x12')]);router[_0x9ac7('0x13')]('/:id/messages',auth[_0x9ac7('0xa')](),controller[_0x9ac7('0x14')]);router[_0x9ac7('0x13')](_0x9ac7('0x15'),auth['isAuthenticated'](),interaction[_0x9ac7('0x16')]('sms',_0x9ac7('0x17')),controller[_0x9ac7('0x18')]);router[_0x9ac7('0x19')](_0x9ac7('0x1a'),auth['isAuthenticated'](),interaction[_0x9ac7('0x16')]('sms',_0x9ac7('0x1b')),controller[_0x9ac7('0x1c')]);router[_0x9ac7('0x1d')](_0x9ac7('0x1a'),auth['isAuthenticated'](),interaction[_0x9ac7('0x16')](_0x9ac7('0x1e'),'smsinteraction:destroy'),controller[_0x9ac7('0x1f')]);router['delete']('/:id/tags',auth[_0x9ac7('0xa')](),controller['removeTags']);module[_0x9ac7('0x20')]=router; \ No newline at end of file +var _0x6dc5=['getMessages','/:id/download','download','post','create','addMessage','sms','addTags','smsinteraction:update','update','tracked','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','Router','../../components/auth/service','./smsInteraction.controller','get','/describe','isAuthenticated','describe','/:id','/:id/messages'];(function(_0x4f019d,_0x1e1c2b){var _0x2a487f=function(_0x1a9537){while(--_0x1a9537){_0x4f019d['push'](_0x4f019d['shift']());}};_0x2a487f(++_0x1e1c2b);}(_0x6dc5,0x1bf));var _0x56dc=function(_0x2b453f,_0x758df3){_0x2b453f=_0x2b453f-0x0;var _0x29d474=_0x6dc5[_0x2b453f];return _0x29d474;};'use strict';var multer=require(_0x56dc('0x0'));var util=require(_0x56dc('0x1'));var path=require('path');var timeout=require(_0x56dc('0x2'));var express=require('express');var router=express[_0x56dc('0x3')]();var auth=require(_0x56dc('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x56dc('0x5'));router[_0x56dc('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x56dc('0x7'),auth[_0x56dc('0x8')](),controller[_0x56dc('0x9')]);router[_0x56dc('0x6')](_0x56dc('0xa'),auth[_0x56dc('0x8')](),controller['show']);router[_0x56dc('0x6')](_0x56dc('0xb'),auth['isAuthenticated'](),controller[_0x56dc('0xc')]);router['get'](_0x56dc('0xd'),auth[_0x56dc('0x8')](),controller[_0x56dc('0xe')]);router[_0x56dc('0xf')]('/',auth[_0x56dc('0x8')](),controller[_0x56dc('0x10')]);router[_0x56dc('0xf')](_0x56dc('0xb'),auth[_0x56dc('0x8')](),controller[_0x56dc('0x11')]);router[_0x56dc('0xf')]('/:id/tags',auth[_0x56dc('0x8')](),interaction['tracked'](_0x56dc('0x12'),'smsinteraction:addtags'),controller[_0x56dc('0x13')]);router['put'](_0x56dc('0xa'),auth[_0x56dc('0x8')](),interaction['tracked']('sms',_0x56dc('0x14')),controller[_0x56dc('0x15')]);router['delete'](_0x56dc('0xa'),auth[_0x56dc('0x8')](),interaction[_0x56dc('0x16')](_0x56dc('0x12'),_0x56dc('0x17')),controller['destroy']);router['delete'](_0x56dc('0x18'),auth[_0x56dc('0x8')](),controller[_0x56dc('0x19')]);module[_0x56dc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 382954b..2b696c6 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 _0x06a6=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x57d886,_0x31dc6e){var _0x43c44d=function(_0x4beb0f){while(--_0x4beb0f){_0x57d886['push'](_0x57d886['shift']());}};_0x43c44d(++_0x31dc6e);}(_0x06a6,0x113));var _0x606a=function(_0x46f65d,_0xa89c08){_0x46f65d=_0x46f65d-0x0;var _0xc5c974=_0x06a6[_0x46f65d];return _0xc5c974;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x606a('0x0')]={'closed':{'type':Sequelize[_0x606a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x606a('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x606a('0x3')]},'phone':{'type':Sequelize[_0x606a('0x3')]},'read1stAt':{'type':Sequelize[_0x606a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x606a('0x4')]('in',_0x606a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x606a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x606a('0x4')]('in',_0x606a('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x3bc4=['exports','DATE','STRING','ENUM','moment'];(function(_0x3c42c2,_0x2b2b58){var _0x16c789=function(_0x335e98){while(--_0x335e98){_0x3c42c2['push'](_0x3c42c2['shift']());}};_0x16c789(++_0x2b2b58);}(_0x3bc4,0xa9));var _0x43bc=function(_0x36d5d5,_0x1c1590){_0x36d5d5=_0x36d5d5-0x0;var _0x4eaa56=_0x3bc4[_0x36d5d5];return _0x4eaa56;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x43bc('0x0'));module[_0x43bc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x43bc('0x2')]},'disposition':{'type':Sequelize[_0x43bc('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x43bc('0x3')]},'read1stAt':{'type':Sequelize[_0x43bc('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x43bc('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x43bc('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b90c633..0a754c7 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 _0xfe17=['Sequelize','QueryTypes','SELECT','clone','read','having','%s\x20>\x200','toString','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','%s\x20=\x200','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','sequelize','keyBy','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','catch','show','params','options','find','body','describe','addMessage','ids','getMessages','nolimit','includeAll','include','findAll','setTags','spread','emit','removeTags','download','unix','server','files','tmp','root','attachments','transcript-%d-%s.zip','Messages','direction','User','fullname','CmContact','firstName','lastName','SmsAccount','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','out','System','Contact','renderFile','views','downloadInteraction.html','create','toFile','transcript-','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','closed','SmsMessage','unreadMessages','Users','map','Tags','TagIds','split','forEach','push','index','SmsInteraction','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','sms_messages','me.read\x20=\x20false','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','expr','advancedFilter','parse','createdAt','dateStart','startOf','format','utc','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','\x20IN\x20?','tableAlias','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','Messages.count','\x20=\x20?','ContactId','hasOwnProperty','filter','isNil','isEmpty','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','group','i.id'];(function(_0x5400a1,_0x2275aa){var _0x4006c7=function(_0x5002dc){while(--_0x5002dc){_0x5400a1['push'](_0x5400a1['shift']());}};_0x4006c7(++_0x2275aa);}(_0xfe17,0x147));var _0x7fe1=function(_0x5c8579,_0x589e9d){_0x5c8579=_0x5c8579-0x0;var _0x2ec68b=_0xfe17[_0x5c8579];return _0x2ec68b;};'use strict';var pdf=require(_0x7fe1('0x0'));var emlformat=require(_0x7fe1('0x1'));var rimraf=require(_0x7fe1('0x2'));var zipdir=require(_0x7fe1('0x3'));var jsonpatch=require(_0x7fe1('0x4'));var rp=require(_0x7fe1('0x5'));var moment=require(_0x7fe1('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7fe1('0x7'));var util=require(_0x7fe1('0x8'));var path=require(_0x7fe1('0x9'));var sox=require(_0x7fe1('0xa'));var csv=require(_0x7fe1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fe1('0xc'));var squel=require(_0x7fe1('0xd'));var crypto=require(_0x7fe1('0xe'));var jsforce=require(_0x7fe1('0xf'));var deskjs=require(_0x7fe1('0x10'));var toCsv=require(_0x7fe1('0xb'));var querystring=require(_0x7fe1('0x11'));var Papa=require(_0x7fe1('0x12'));var Redis=require(_0x7fe1('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7fe1('0x14'));var logger=require(_0x7fe1('0x15'))(_0x7fe1('0x16'));var utils=require(_0x7fe1('0x17'));var config=require(_0x7fe1('0x18'));var db=require(_0x7fe1('0x19'))['db'];config['redis']=_[_0x7fe1('0x1a')](config[_0x7fe1('0x1b')],{'host':_0x7fe1('0x1c'),'port':0x18eb});var socket=require(_0x7fe1('0x1d'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x7fe1('0x1e')](socket);function respondWithStatusCode(_0x539c16,_0x4d30a3){_0x4d30a3=_0x4d30a3||0xcc;return function(_0x4df588){if(_0x4df588){return _0x539c16['sendStatus'](_0x4d30a3);}return _0x539c16[_0x7fe1('0x1f')](_0x4d30a3)['end']();};}function respondWithResult(_0x2a544d,_0x208ca2){_0x208ca2=_0x208ca2||0xc8;return function(_0x42a49b){if(_0x42a49b){return _0x2a544d[_0x7fe1('0x1f')](_0x208ca2)[_0x7fe1('0x20')](_0x42a49b);}};}function respondWithFilteredResult(_0x241029,_0x1866f6){return function(_0x2ad9dc){if(_0x2ad9dc){var _0x2debed=_0x2ad9dc[_0x7fe1('0x21')],_0x344842=_0x1866f6[_0x7fe1('0x22')],_0x1296ff=_0x1866f6[_0x7fe1('0x22')]+_0x1866f6[_0x7fe1('0x23')],_0x5d941b;if(_0x1296ff>=_0x2debed){_0x1296ff=_0x2debed;_0x5d941b=0xc8;}else{_0x5d941b=0xce;}_0x241029[_0x7fe1('0x1f')](_0x5d941b);return _0x241029[_0x7fe1('0x24')](_0x7fe1('0x25'),_0x344842+'-'+_0x1296ff+'/'+_0x2debed)[_0x7fe1('0x20')](_0x2ad9dc);}return null;};}function patchUpdates(_0xff32db){return function(_0x286a0f){try{jsonpatch[_0x7fe1('0x26')](_0x286a0f,_0xff32db,!![]);}catch(_0x571fd6){return BPromise[_0x7fe1('0x27')](_0x571fd6);}return _0x286a0f[_0x7fe1('0x28')]();};}function saveUpdates(_0x363617,_0x248a65){return function(_0x18af2e){if(_0x18af2e){return _0x18af2e[_0x7fe1('0x29')](_0x363617)[_0x7fe1('0x2a')](function(_0x936c18){return _0x936c18;});}return null;};}function removeEntity(_0x2d021a,_0x4814cb){return function(_0x29a099){if(_0x29a099){return _0x29a099[_0x7fe1('0x2b')]()[_0x7fe1('0x2a')](function(){_0x2d021a['status'](0xcc)[_0x7fe1('0x2c')]();});}};}function handleEntityNotFound(_0x25920d,_0x4380df){return function(_0x37e8f0){if(!_0x37e8f0){_0x25920d[_0x7fe1('0x2d')](0x194);}return _0x37e8f0;};}function handleError(_0x703ba8,_0x410e13){_0x410e13=_0x410e13||0x1f4;return function(_0x311c88){logger[_0x7fe1('0x2e')](_0x311c88[_0x7fe1('0x2f')]);if(_0x311c88[_0x7fe1('0x30')]){delete _0x311c88[_0x7fe1('0x30')];}_0x703ba8['status'](_0x410e13)['send'](_0x311c88);};}function getInteractionUnreadMessages(_0x3e53eb){return new BPromise(function(_0x5784b8,_0x44616b){try{if(_0x3e53eb[_0x7fe1('0x31')]){_0x3e53eb['unreadMessages']=0x0;_0x5784b8(_0x3e53eb);}else{return db[_0x7fe1('0x32')][_0x7fe1('0x21')]({'where':{'SmsInteractionId':_0x3e53eb['id'],'direction':'in','read':![]}})[_0x7fe1('0x2a')](function(_0x3e5427){_0x3e53eb[_0x7fe1('0x33')]=_0x3e5427;_0x5784b8(_0x3e53eb);});}}catch(_0x329718){_0x44616b(_0x329718);}});}function getInteractionUsers(_0x1ba493,_0x73f620){return new BPromise(function(_0x109b23,_0x5b5175){try{if(_0x73f620[_0x1ba493['id']]){_0x1ba493[_0x7fe1('0x34')]=_[_0x7fe1('0x35')](_0x73f620[_0x1ba493['id']],function(_0x38622b){return{'id':_0x38622b['id']};});}}catch(_0x1495e3){_0x5b5175(_0x1495e3);}_0x109b23(_0x1ba493);});}function getInteractionTags(_0xd6dc3f,_0x44939f){return new BPromise(function(_0x107e57,_0x3025d0){try{if(_0xd6dc3f['TagIds']){_0xd6dc3f[_0x7fe1('0x36')]=[];_0xd6dc3f[_0x7fe1('0x37')][_0x7fe1('0x38')](',')[_0x7fe1('0x39')](function(_0x1b1232){_0xd6dc3f[_0x7fe1('0x36')][_0x7fe1('0x3a')](_0x44939f[_0x1b1232]);});}delete _0xd6dc3f[_0x7fe1('0x37')];}catch(_0x349da2){_0x3025d0(_0x349da2);}_0x107e57(_0xd6dc3f);});}function updateSmsInteraction(_0x5a3fd5,_0x3a7168,_0x4d1225){return new BPromise(function(_0x23cae7,_0x275120){return getInteractionUnreadMessages(_0x5a3fd5)[_0x7fe1('0x2a')](function(_0x10f69b){return getInteractionUsers(_0x10f69b,_0x4d1225);})['then'](function(_0x17ab7c){return getInteractionTags(_0x17ab7c,_0x3a7168);})[_0x7fe1('0x2a')](function(_0x1834b3){_0x23cae7(_0x1834b3);})['catch'](function(_0x6f11b1){_0x275120(_0x6f11b1);});});}exports[_0x7fe1('0x3b')]=function(_0x500c7a,_0x41d0b6){var _0x446de6={},_0x5d957e={},_0x28d96a={'count':0x0,'rows':[]};var _0x12510a=db[_0x7fe1('0x3c')][_0x7fe1('0x3d')];_0x5d957e['model']=_['keys'](_0x12510a);_0x5d957e[_0x7fe1('0x3e')]=_[_0x7fe1('0x3f')](_0x500c7a[_0x7fe1('0x3e')]);_0x5d957e[_0x7fe1('0x40')]=_[_0x7fe1('0x41')](_0x5d957e[_0x7fe1('0x42')],_0x5d957e[_0x7fe1('0x3e')]);_0x446de6[_0x7fe1('0x43')]=_[_0x7fe1('0x41')](_0x5d957e['model'],qs[_0x7fe1('0x44')](_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x44')]));_0x446de6[_0x7fe1('0x43')]=_0x446de6['attributes'][_0x7fe1('0x45')]?_0x446de6[_0x7fe1('0x43')]:_0x5d957e[_0x7fe1('0x42')];if(!_0x500c7a['query']['hasOwnProperty']('nolimit')){_0x446de6['limit']=qs[_0x7fe1('0x23')](_0x500c7a[_0x7fe1('0x3e')]['limit']);_0x446de6[_0x7fe1('0x22')]=qs[_0x7fe1('0x22')](_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x22')]);}_0x446de6['order']=qs[_0x7fe1('0x46')](_0x500c7a[_0x7fe1('0x3e')]['sort']);_0x446de6[_0x7fe1('0x47')]=qs[_0x7fe1('0x40')](_[_0x7fe1('0x48')](_0x500c7a[_0x7fe1('0x3e')],_0x5d957e['filters']));var _0x5c6024=[];var _0x46bcfd=squel[_0x7fe1('0x49')]()['field']('id')[_0x7fe1('0x4a')](_0x7fe1('0x30'))[_0x7fe1('0x4a')](_0x7fe1('0x4b'))[_0x7fe1('0x4c')](_0x7fe1('0x4d'));var _0x4b9a84=squel[_0x7fe1('0x49')]()[_0x7fe1('0x4a')](_0x7fe1('0x4e'))[_0x7fe1('0x4c')](_0x7fe1('0x4f'),'me')[_0x7fe1('0x47')]('me.SmsInteractionId\x20=\x20i.id')[_0x7fe1('0x47')]('me.direction\x20=\x20\x27in\x27')[_0x7fe1('0x47')](_0x7fe1('0x50'));var _0x17a432=squel[_0x7fe1('0x49')]()[_0x7fe1('0x4a')]('u.id')['field'](_0x7fe1('0x51'))['from'](_0x7fe1('0x52'),'ui')[_0x7fe1('0x53')]('users','u',_0x7fe1('0x54'));var _0x5007cd=squel[_0x7fe1('0x49')]()[_0x7fe1('0x4c')](_0x7fe1('0x55'),'i')[_0x7fe1('0x53')](_0x7fe1('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x7fe1('0x53')](_0x7fe1('0x57'),'o',_0x7fe1('0x58'))[_0x7fe1('0x53')](_0x7fe1('0x59'),'a',_0x7fe1('0x5a'))['left_join'](_0x7fe1('0x4f'),'me','me.SmsInteractionId\x20=\x20i.id');var _0x477b92=squel[_0x7fe1('0x5b')]();if(_0x500c7a['query'][_0x7fe1('0x5c')]){var _0x4bfc41=JSON[_0x7fe1('0x5d')](_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x5c')]);_[_0x7fe1('0x3f')](_0x4bfc41)[_0x7fe1('0x39')](function(_0x3697a0){var _0x25d123=_0x4bfc41[_0x3697a0];if(_0x3697a0===_0x7fe1('0x5e')){var _0x14cb28=moment(_0x25d123['value'][_0x7fe1('0x5f')])[_0x7fe1('0x60')]('day')['utc']()[_0x7fe1('0x61')]();var _0x16711=moment(_0x16711)[_0x7fe1('0x62')]()[_0x7fe1('0x63')]('day')['format']();_0x477b92[_0x7fe1('0x64')](_0x7fe1('0x65'),_0x14cb28,_0x16711);}else{if(_[_0x7fe1('0x66')](_0x25d123[_0x7fe1('0x67')])){_0x25d123[_0x7fe1('0x67')][_0x7fe1('0x39')](function(_0x519952){switch(_0x25d123[_0x7fe1('0x67')][_0x7fe1('0x68')]){case'IS':if(_0x3697a0!=='TagId'&&_0x3697a0!=='Messages.count'){if(_['isArray'](_0x25d123[_0x7fe1('0x68')])&&_0x25d123['value'][_0x7fe1('0x45')]>0x1){_0x477b92['and'](_0x25d123['tableAlias']+'.'+_0x3697a0+_0x7fe1('0x69'),_0x25d123[_0x7fe1('0x68')]);}else{_0x477b92['and'](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+'\x20=\x20?',_0x25d123[_0x7fe1('0x68')][0x0]);}}break;case'=':_0x477b92[_0x7fe1('0x64')](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+'\x20=\x20?',_0x25d123[_0x7fe1('0x68')]);break;case _0x7fe1('0x6b'):if(_0x3697a0==='ContactId'){_0x477b92['and'](_0x7fe1('0x6c')+_0x7fe1('0x6d'),'%'+_0x25d123[_0x7fe1('0x68')]+'%');_0x477b92['or'](_0x7fe1('0x6e')+_0x7fe1('0x6d'),'%'+_0x25d123[_0x7fe1('0x68')]+'%');_0x477b92['or'](_0x7fe1('0x6f')+_0x7fe1('0x6d'),'%'+_0x25d123[_0x7fe1('0x68')]+'%');}else{_0x477b92['and'](_0x25d123['tableAlias']+'.'+_0x3697a0+_0x7fe1('0x6d'),'%'+_0x25d123[_0x7fe1('0x68')]+'%');}break;case'>':_0x477b92[_0x7fe1('0x64')](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+_0x7fe1('0x70'),_0x25d123[_0x7fe1('0x68')]);break;case'<':_0x477b92['and'](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+_0x7fe1('0x71'),_0x25d123[_0x7fe1('0x68')]);break;}});}else{switch(_0x25d123[_0x7fe1('0x67')]['value']){case'IS':if(_0x3697a0!=='TagId'&&_0x3697a0!==_0x7fe1('0x72')){if(_['isArray'](_0x25d123[_0x7fe1('0x68')])&&_0x25d123['value'][_0x7fe1('0x45')]>0x1){_0x477b92[_0x7fe1('0x64')](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+_0x7fe1('0x69'),_0x25d123[_0x7fe1('0x68')]);}else{_0x477b92[_0x7fe1('0x64')](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+_0x7fe1('0x73'),_0x25d123[_0x7fe1('0x68')][0x0]);}}break;case'=':_0x477b92['and'](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+_0x7fe1('0x73'),_0x25d123['value']);break;case _0x7fe1('0x6b'):if(_0x3697a0===_0x7fe1('0x74')){_0x477b92[_0x7fe1('0x64')](_0x7fe1('0x6c')+_0x7fe1('0x6d'),'%'+_0x25d123[_0x7fe1('0x68')]+'%');_0x477b92['or'](_0x7fe1('0x6e')+'\x20LIKE\x20?','%'+_0x25d123['value']+'%');_0x477b92['or'](_0x7fe1('0x6f')+_0x7fe1('0x6d'),'%'+_0x25d123[_0x7fe1('0x68')]+'%');}else{_0x477b92['and'](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+_0x7fe1('0x6d'),'%'+_0x25d123[_0x7fe1('0x68')]+'%');}break;case'>':_0x477b92[_0x7fe1('0x64')](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+_0x7fe1('0x70'),_0x25d123[_0x7fe1('0x68')]);break;case'<':_0x477b92[_0x7fe1('0x64')](_0x25d123[_0x7fe1('0x6a')]+'.'+_0x3697a0+'\x20<\x20?',_0x25d123[_0x7fe1('0x68')]);break;}}}});}else{var _0x337490=_(Object[_0x7fe1('0x3f')](_0x500c7a[_0x7fe1('0x3e')]))[_0x7fe1('0x35')](function(_0x19f44){return _0x12510a[_0x7fe1('0x75')](_0x19f44)?_0x19f44:undefined;})[_0x7fe1('0x76')](function(_0x3ceb78){return!_[_0x7fe1('0x77')](_0x3ceb78);})[_0x7fe1('0x68')]();if(!_[_0x7fe1('0x78')](_0x337490)){_0x337490[_0x7fe1('0x39')](function(_0x261b91){if(_0x261b91==='SmsAccountId'){_0x5007cd[_0x7fe1('0x47')](_0x7fe1('0x79'),[][_0x7fe1('0x7a')](_0x500c7a[_0x7fe1('0x3e')][_0x261b91]));}else if(_0x261b91===_0x7fe1('0x5e')){var _0x44f4eb=JSON[_0x7fe1('0x5d')](_0x500c7a[_0x7fe1('0x3e')][_0x261b91])[_0x7fe1('0x7b')];var _0x1fb2c2=JSON[_0x7fe1('0x5d')](_0x500c7a[_0x7fe1('0x3e')][_0x261b91])[_0x7fe1('0x7c')];_0x5007cd[_0x7fe1('0x47')](_0x7fe1('0x65'),_0x44f4eb,_0x1fb2c2);}else{if(_0x500c7a['query'][_0x261b91]==='null'){_0x5007cd[_0x7fe1('0x47')]('i.'+_0x261b91+'\x20IS\x20NULL');}else{_0x5007cd[_0x7fe1('0x47')]('i.'+_0x261b91+_0x7fe1('0x73'),_0x500c7a[_0x7fe1('0x3e')][_0x261b91]);}}});}if(_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x76')]){var _0x54fedc=_0x500c7a[_0x7fe1('0x3e')]['filter']['replace']('\x5c','\x5c\x5c')[_0x7fe1('0x7d')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x7fe1('0x7e')](_0x54fedc)){_0x477b92['or'](_0x7fe1('0x7f'),_0x54fedc+'%')['or'](_0x7fe1('0x80'),_0x54fedc+'%');}else{var _0x599786=[];_0x54fedc['split']('\x20')[_0x7fe1('0x39')](function(_0x1fc695){_0x599786['push']('+'+_0x1fc695['toString']());});var _0x2e53c5=_0x599786[_0x7fe1('0x81')]('\x20');_0x477b92['or'](_0x7fe1('0x82'),_0x2e53c5)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x54fedc+'%');}}}_0x5007cd[_0x7fe1('0x47')](_0x477b92);if(_0x446de6['order']){_0x446de6['order'][_0x7fe1('0x39')](function(_0x1594d1){_0x5007cd[_0x7fe1('0x83')]('i.'+_0x1594d1[0x0],_0x1594d1[0x1]===_0x7fe1('0x84')?![]:!![]);});}_0x5007cd[_0x7fe1('0x85')](_0x7fe1('0x86'));var _0x3dc43a={'type':db[_0x7fe1('0x87')][_0x7fe1('0x88')][_0x7fe1('0x89')],'raw':!![]};var _0x16afff=_0x5007cd[_0x7fe1('0x8a')]()[_0x7fe1('0x4a')](_0x7fe1('0x4e'));if(!_0x500c7a[_0x7fe1('0x3e')]['advancedFilter']){if(_0x500c7a['query'][_0x7fe1('0x8b')]){if(_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x8b')]==0x1){_0x16afff[_0x7fe1('0x47')](util[_0x7fe1('0x61')]('%s\x20=\x200',_0x4b9a84['toString']()));_0x5007cd[_0x7fe1('0x8c')]('`Messages.count`\x20=\x200');}else{_0x16afff[_0x7fe1('0x47')](util[_0x7fe1('0x61')](_0x7fe1('0x8d'),_0x4b9a84[_0x7fe1('0x8e')]()));_0x5007cd[_0x7fe1('0x8c')]('`Messages.count`\x20>\x200');}}if(_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x8f')]){var _0x58ff63=_[_0x7fe1('0x66')](_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x8f')])?_0x500c7a['query'][_0x7fe1('0x8f')]:new Array(_0x500c7a['query'][_0x7fe1('0x8f')]);var _0x4543e0=squel[_0x7fe1('0x5b')]();_0x58ff63['forEach'](function(_0x5d8159){_0x4543e0['or'](_0x7fe1('0x90'),'%,'+_0x5d8159+',%');});_0x5007cd['having'](_0x4543e0);_0x16afff[_0x7fe1('0x53')](_0x7fe1('0x91'),'it',_0x7fe1('0x92'));_0x16afff[_0x7fe1('0x53')](_0x7fe1('0x4d'),'t',_0x7fe1('0x93'));_0x16afff[_0x7fe1('0x47')](_0x7fe1('0x94'),_0x58ff63);}}else{var _0x4bfc41=JSON[_0x7fe1('0x5d')](_0x500c7a[_0x7fe1('0x3e')][_0x7fe1('0x5c')]);_[_0x7fe1('0x3f')](_0x4bfc41)[_0x7fe1('0x39')](function(_0x9985f4){var _0x311257=_0x4bfc41[_0x9985f4];if(_0x9985f4==='TagId'){var _0x17df11=_0x311257[_0x7fe1('0x68')];var _0x56c858=squel[_0x7fe1('0x5b')]();_0x17df11[_0x7fe1('0x39')](function(_0x4867ba){_0x56c858['or'](_0x7fe1('0x90'),'%,'+_0x4867ba+',%');});_0x5007cd[_0x7fe1('0x8c')](_0x56c858);_0x16afff['left_join'](_0x7fe1('0x95'),'it',_0x7fe1('0x96'));_0x16afff[_0x7fe1('0x53')]('tools_tags','t',_0x7fe1('0x93'));_0x16afff['where'](_0x7fe1('0x94'),_0x17df11);}else if(_0x9985f4===_0x7fe1('0x72')){if(_0x311257[_0x7fe1('0x68')][_0x7fe1('0x45')]===0x1){if(_0x311257[_0x7fe1('0x68')][0x0]===0x1){_0x16afff[_0x7fe1('0x47')](util['format'](_0x7fe1('0x97'),_0x4b9a84[_0x7fe1('0x8e')]()));_0x5007cd[_0x7fe1('0x8c')](_0x7fe1('0x98'));}else{_0x16afff[_0x7fe1('0x47')](util[_0x7fe1('0x61')](_0x7fe1('0x8d'),_0x4b9a84['toString']()));_0x5007cd[_0x7fe1('0x8c')](_0x7fe1('0x99'));}}}});}db[_0x7fe1('0x9a')]['query'](_0x16afff[_0x7fe1('0x8e')](),_0x3dc43a)[_0x7fe1('0x2a')](function(_0x29753b){_0x28d96a[_0x7fe1('0x21')]=_0x29753b[_0x7fe1('0x45')];if(_0x28d96a['count']===0x0)return[];return db[_0x7fe1('0x9a')][_0x7fe1('0x3e')](_0x46bcfd['toString'](),_0x3dc43a)[_0x7fe1('0x2a')](function(_0x275203){_0x5c6024=_[_0x7fe1('0x9b')](_0x275203,'id');_0x3dc43a=_[_0x7fe1('0x9c')](_0x3dc43a,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5007cd[_0x7fe1('0x4a')](_0x7fe1('0x9d'),_0x7fe1('0x9e'));_0x5007cd['field'](_0x7fe1('0x9f'));_0x5007cd[_0x7fe1('0x4a')](_0x7fe1('0x6c'),_0x7fe1('0xa0'));_0x5007cd[_0x7fe1('0x4a')](_0x7fe1('0x6e'),_0x7fe1('0xa1'));_0x5007cd[_0x7fe1('0x4a')]('c.email',_0x7fe1('0xa2'));_0x5007cd[_0x7fe1('0x4a')](_0x7fe1('0xa3'),_0x7fe1('0xa4'));_0x5007cd['field'](_0x7fe1('0xa5'),_0x7fe1('0xa6'));_0x5007cd['field'](_0x7fe1('0xa7'),'Contact.fax');_0x5007cd[_0x7fe1('0x4a')](_0x7fe1('0xa8'),'TagIds');_0x5007cd[_0x7fe1('0x53')](_0x7fe1('0x91'),'it','it.SmsInteractionId\x20=\x20i.id');_0x5007cd['left_join'](_0x7fe1('0x4d'),'t',_0x7fe1('0x93'));_0x5007cd[_0x7fe1('0x23')](_0x446de6['limit']);_0x5007cd['offset'](_0x446de6[_0x7fe1('0x22')]);return db[_0x7fe1('0x9a')][_0x7fe1('0x3e')](_0x5007cd['toString'](),_0x3dc43a);})['then'](function(_0x29ffdd){_0x17a432[_0x7fe1('0x47')](_0x7fe1('0xa9'),_[_0x7fe1('0x35')](_0x29ffdd,'id'));return db[_0x7fe1('0x9a')]['query'](_0x17a432[_0x7fe1('0x8e')](),_0x3dc43a)[_0x7fe1('0x2a')](function(_0x57dbd0){var _0x21902d=_[_0x7fe1('0xaa')](_0x57dbd0,_0x7fe1('0xab'));var _0x4c0d79=[];_0x29ffdd[_0x7fe1('0x39')](function(_0x47c221){_0x4c0d79[_0x7fe1('0x3a')](updateSmsInteraction(_0x47c221,_0x5c6024,_0x21902d));});return BPromise[_0x7fe1('0xac')](_0x4c0d79);});});})[_0x7fe1('0x2a')](function(_0x1f14ca){_0x28d96a['rows']=_0x1f14ca;return _0x28d96a;})[_0x7fe1('0x2a')](respondWithFilteredResult(_0x41d0b6,_0x446de6))[_0x7fe1('0xad')](handleError(_0x41d0b6,null));};exports[_0x7fe1('0xae')]=function(_0x4386d6,_0x17f5fd){var _0x562954={'raw':![],'where':{'id':_0x4386d6[_0x7fe1('0xaf')]['id']}},_0x906fb8={};_0x906fb8[_0x7fe1('0x42')]=_['keys'](db[_0x7fe1('0x3c')][_0x7fe1('0x3d')]);_0x906fb8[_0x7fe1('0x3e')]=_[_0x7fe1('0x3f')](_0x4386d6[_0x7fe1('0x3e')]);_0x906fb8[_0x7fe1('0x40')]=_['intersection'](_0x906fb8[_0x7fe1('0x42')],_0x906fb8[_0x7fe1('0x3e')]);_0x562954[_0x7fe1('0x43')]=_['intersection'](_0x906fb8[_0x7fe1('0x42')],qs[_0x7fe1('0x44')](_0x4386d6[_0x7fe1('0x3e')]['fields']));_0x562954['attributes']=_0x562954[_0x7fe1('0x43')]['length']?_0x562954['attributes']:_0x906fb8[_0x7fe1('0x42')];if(_0x4386d6[_0x7fe1('0x3e')]['includeAll']){_0x562954['include']=[{'all':!![]}];}_0x562954=_[_0x7fe1('0x9c')]({},_0x562954,_0x4386d6[_0x7fe1('0xb0')]);return db[_0x7fe1('0x3c')][_0x7fe1('0xb1')](_0x562954)[_0x7fe1('0x2a')](handleEntityNotFound(_0x17f5fd,null))['then'](respondWithResult(_0x17f5fd,null))[_0x7fe1('0xad')](handleError(_0x17f5fd,null));};exports['create']=function(_0x1e5829,_0x29dc7a){return db['SmsInteraction']['create'](_0x1e5829[_0x7fe1('0xb2')],{})[_0x7fe1('0x2a')](respondWithResult(_0x29dc7a,0xc9))[_0x7fe1('0xad')](handleError(_0x29dc7a,null));};exports['update']=function(_0xe774c,_0x328e0d){if(_0xe774c['body']['id']){delete _0xe774c[_0x7fe1('0xb2')]['id'];}return db['SmsInteraction'][_0x7fe1('0xb1')]({'where':{'id':_0xe774c[_0x7fe1('0xaf')]['id']}})['then'](handleEntityNotFound(_0x328e0d,null))[_0x7fe1('0x2a')](saveUpdates(_0xe774c[_0x7fe1('0xb2')],null))[_0x7fe1('0x2a')](respondWithResult(_0x328e0d,null))[_0x7fe1('0xad')](handleError(_0x328e0d,null));};exports[_0x7fe1('0x2b')]=function(_0x6cb2a2,_0x273e01){return db[_0x7fe1('0x3c')][_0x7fe1('0xb1')]({'where':{'id':_0x6cb2a2[_0x7fe1('0xaf')]['id']}})[_0x7fe1('0x2a')](handleEntityNotFound(_0x273e01,null))[_0x7fe1('0x2a')](removeEntity(_0x273e01,null))['catch'](handleError(_0x273e01,null));};exports[_0x7fe1('0xb3')]=function(_0x334181,_0x115d9d){return db['SmsInteraction'][_0x7fe1('0xb3')]()[_0x7fe1('0x2a')](respondWithResult(_0x115d9d,null))['catch'](handleError(_0x115d9d,null));};exports[_0x7fe1('0xb4')]=function(_0x2fe64a,_0x2a4304,_0x44558a){return db[_0x7fe1('0x32')][_0x7fe1('0xb1')]({'where':{'id':_0x2fe64a['params']['id']}})[_0x7fe1('0x2a')](handleEntityNotFound(_0x2a4304,null))[_0x7fe1('0x2a')](function(_0x4068c){if(_0x4068c){return _0x4068c[_0x7fe1('0xb4')](_0x2fe64a[_0x7fe1('0xb2')][_0x7fe1('0xb5')],_['omit'](_0x2fe64a[_0x7fe1('0xb2')],[_0x7fe1('0xb5'),'id'])||{});}})['then'](respondWithResult(_0x2a4304,null))['catch'](handleError(_0x2a4304,null));};exports[_0x7fe1('0xb6')]=function(_0x22bc83,_0x30d5c2,_0x2f2f9c){var _0x1eb679={'raw':![],'where':{}};var _0x112f66={};var _0x4bd6d0={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x22bc83[_0x7fe1('0xaf')]['id']}})[_0x7fe1('0x2a')](handleEntityNotFound(_0x30d5c2,null))[_0x7fe1('0x2a')](function(_0x3873c5){if(_0x3873c5){_0x112f66[_0x7fe1('0x42')]=_[_0x7fe1('0x3f')](db[_0x7fe1('0x32')][_0x7fe1('0x3d')]);_0x112f66[_0x7fe1('0x3e')]=_['keys'](_0x22bc83[_0x7fe1('0x3e')]);_0x112f66[_0x7fe1('0x40')]=_['intersection'](_0x112f66[_0x7fe1('0x42')],_0x112f66['query']);_0x1eb679[_0x7fe1('0x43')]=_[_0x7fe1('0x41')](_0x112f66[_0x7fe1('0x42')],qs['fields'](_0x22bc83[_0x7fe1('0x3e')][_0x7fe1('0x44')]));_0x1eb679['attributes']=_0x1eb679[_0x7fe1('0x43')][_0x7fe1('0x45')]?_0x1eb679[_0x7fe1('0x43')]:_0x112f66[_0x7fe1('0x42')];if(!_0x22bc83[_0x7fe1('0x3e')]['hasOwnProperty'](_0x7fe1('0xb7'))){_0x1eb679['limit']=qs[_0x7fe1('0x23')](_0x22bc83[_0x7fe1('0x3e')][_0x7fe1('0x23')]);_0x1eb679[_0x7fe1('0x22')]=qs['offset'](_0x22bc83[_0x7fe1('0x3e')]['offset']);}_0x1eb679['order']=qs[_0x7fe1('0x46')](_0x22bc83[_0x7fe1('0x3e')][_0x7fe1('0x46')]);_0x1eb679[_0x7fe1('0x47')]=qs['filters'](_[_0x7fe1('0x48')](_0x22bc83[_0x7fe1('0x3e')],_0x112f66[_0x7fe1('0x40')]));_0x1eb679[_0x7fe1('0x47')][_0x7fe1('0xab')]=_0x3873c5['id'];if(_0x22bc83[_0x7fe1('0x3e')][_0x7fe1('0x76')]){_0x1eb679[_0x7fe1('0x47')]=_[_0x7fe1('0x9c')](_0x1eb679['where'],{'$or':_[_0x7fe1('0x35')](_0x1eb679[_0x7fe1('0x43')],function(_0x1c5ffd){var _0x9f08e7={};_0x9f08e7[_0x1c5ffd]={'$like':'%'+_0x22bc83[_0x7fe1('0x3e')][_0x7fe1('0x76')]+'%'};return _0x9f08e7;})});}if(_0x22bc83[_0x7fe1('0x3e')][_0x7fe1('0x7b')]){var _0x43c665=_0x22bc83[_0x7fe1('0x3e')][_0x7fe1('0x7b')][_0x7fe1('0x38')](',');var _0x18aed7={};_0x18aed7[_0x43c665[0x0]]={'$gte':moment(_0x43c665[0x1])[_0x7fe1('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1eb679[_0x7fe1('0x47')]=_[_0x7fe1('0x9c')](_0x1eb679['where'],_0x18aed7);}_0x1eb679=_[_0x7fe1('0x9c')]({},_0x1eb679,_0x22bc83[_0x7fe1('0xb0')]);return db['SmsMessage'][_0x7fe1('0x21')]({'where':_0x1eb679['where']})['then'](function(_0x4eeb65){_0x4bd6d0[_0x7fe1('0x21')]=_0x4eeb65;if(_0x22bc83['query'][_0x7fe1('0xb8')]){_0x1eb679[_0x7fe1('0xb9')]=[{'all':!![]}];}return db['SmsMessage'][_0x7fe1('0xba')](_0x1eb679);})['then'](function(_0x498c00){_0x4bd6d0['rows']=_0x498c00;return _0x4bd6d0;});}})[_0x7fe1('0x2a')](respondWithFilteredResult(_0x30d5c2,_0x1eb679))[_0x7fe1('0xad')](handleError(_0x30d5c2,null));};exports['addTags']=function(_0x39e53c,_0x2d2df6,_0x125221){return db[_0x7fe1('0x3c')][_0x7fe1('0xb1')]({'where':{'id':_0x39e53c['params']['id']}})[_0x7fe1('0x2a')](handleEntityNotFound(_0x2d2df6,null))[_0x7fe1('0x2a')](function(_0x4de434){if(_0x4de434){return _0x4de434[_0x7fe1('0xbb')](_0x39e53c['body']['ids'],_['omit'](_0x39e53c[_0x7fe1('0xb2')],[_0x7fe1('0xb5'),'id'])||{})[_0x7fe1('0xbc')](function(){return db['Tag']['findAll']({'attributes':['id',_0x7fe1('0x30'),_0x7fe1('0x4b')],'where':{'id':_0x39e53c[_0x7fe1('0xb2')][_0x7fe1('0xb5')]}});})[_0x7fe1('0x2a')](function(_0x4ae1ae){socket[_0x7fe1('0xbd')]('smsInteractionTags:save',{'id':Number(_0x39e53c[_0x7fe1('0xaf')]['id']),'tags':_0x4ae1ae||[]});return{'id':Number(_0x39e53c['params']['id']),'tags':_0x4ae1ae||[]};});}})[_0x7fe1('0x2a')](respondWithResult(_0x2d2df6,null))[_0x7fe1('0xad')](handleError(_0x2d2df6,null));};exports[_0x7fe1('0xbe')]=function(_0x5ddc35,_0x4df3cc,_0x2e96c1){return db[_0x7fe1('0x3c')]['find']({'where':{'id':_0x5ddc35[_0x7fe1('0xaf')]['id']}})[_0x7fe1('0x2a')](handleEntityNotFound(_0x4df3cc,null))['then'](function(_0x5b1073){if(_0x5b1073){return _0x5b1073[_0x7fe1('0xbe')](_0x5ddc35[_0x7fe1('0x3e')][_0x7fe1('0xb5')]);}})[_0x7fe1('0x2a')](respondWithStatusCode(_0x4df3cc,null))[_0x7fe1('0xad')](handleError(_0x4df3cc,null));};exports[_0x7fe1('0xbf')]=function(_0x5a3797,_0x711fe){var _0x258cae=moment()[_0x7fe1('0xc0')]()[_0x7fe1('0x8e')]();var _0x542f04=path[_0x7fe1('0x81')](config['root'],_0x7fe1('0xc1'),_0x7fe1('0xc2'),_0x7fe1('0xc3'));var _0xe97162=path[_0x7fe1('0x81')](config[_0x7fe1('0xc4')],_0x7fe1('0xc1'),_0x7fe1('0xc2'),_0x7fe1('0xc5'));var _0x3eb2cb=path[_0x7fe1('0x81')](_0x542f04,_0x258cae);var _0x5d3d30=util['format'](_0x7fe1('0xc6'),_0x5a3797[_0x7fe1('0xaf')]['id'],_0x258cae);var _0x3ba8da=path[_0x7fe1('0x81')](_0x542f04,_0x5d3d30);var _0x55979e=![];return db['SmsInteraction'][_0x7fe1('0xb1')]({'where':{'id':_0x5a3797[_0x7fe1('0xaf')]['id']},'include':[{'model':db[_0x7fe1('0x32')],'as':_0x7fe1('0xc7'),'attributes':['id',_0x7fe1('0xb2'),'createdAt',_0x7fe1('0xc8'),'secret'],'include':[{'model':db[_0x7fe1('0xc9')],'as':_0x7fe1('0xc9'),'attributes':['id',_0x7fe1('0xca')],'raw':!![]},{'model':db[_0x7fe1('0xcb')],'as':'Contact','attributes':['id',_0x7fe1('0xcc'),_0x7fe1('0xcd')],'raw':!![]}]},{'model':db[_0x7fe1('0xce')],'as':'Account','attributes':['id',_0x7fe1('0x30')]},{'model':db[_0x7fe1('0xc9')],'as':_0x7fe1('0xcf'),'attributes':['id',_0x7fe1('0xca')]}]})[_0x7fe1('0x2a')](handleEntityNotFound(_0x711fe,null))[_0x7fe1('0x2a')](function(_0xf7d804){if(_0xf7d804){var _0x2a37c9=_0xf7d804[_0x7fe1('0xd0')]({'plain':!![]});_0x55979e=!![];var _0x2032c7={'format':'A4','border':_0x7fe1('0xd1'),'header':{'height':_0x7fe1('0xd2'),'contents':{'first':_0x7fe1('0xd3')}},'footer':{'height':_0x7fe1('0xd4'),'contents':{'default':util[_0x7fe1('0x61')](_0x7fe1('0xd5'),util[_0x7fe1('0x61')](_0x7fe1('0xd6'),_0x7fe1('0xd7'),_0x2a37c9['id']),moment()[_0x7fe1('0x61')]('YYYY-MM-DD')[_0x7fe1('0x8e')]())}}};fs[_0x7fe1('0xd8')](_0x3eb2cb);var _0x4ae05d={'channel':_0x7fe1('0xd7'),'account':_0x2a37c9['Account'][_0x7fe1('0x30')],'agent':_0x2a37c9[_0x7fe1('0xcf')]?_0x2a37c9[_0x7fe1('0xcf')][_0x7fe1('0xca')]:_0x7fe1('0xd9'),'createdAt':moment(_0x2a37c9['createdAt'])['format'](_0x7fe1('0xda'))[_0x7fe1('0x8e')](),'closedAt':_0x2a37c9['closed']?moment(_0x2a37c9[_0x7fe1('0xdb')])[_0x7fe1('0x61')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2a37c9['disposition'],'messages':_(_0x2a37c9[_0x7fe1('0xc7')])[_0x7fe1('0x76')]({'secret':![]})[_0x7fe1('0x35')](function(_0x43ce4b){return{'date':moment(_0x43ce4b[_0x7fe1('0x5e')])['format'](_0x7fe1('0xda'))['toString'](),'sender':_0x43ce4b[_0x7fe1('0xc8')]===_0x7fe1('0xdc')?_0x43ce4b[_0x7fe1('0xc9')]?_0x43ce4b[_0x7fe1('0xc9')]['fullname']:_0x7fe1('0xdd'):_0x43ce4b[_0x7fe1('0xde')][_0x7fe1('0xcc')]+(_0x43ce4b[_0x7fe1('0xde')][_0x7fe1('0xcd')]?'\x20'+_0x43ce4b[_0x7fe1('0xde')][_0x7fe1('0xcd')]:''),'body':_0x43ce4b['body'],'direction':_0x43ce4b[_0x7fe1('0xc8')]===_0x7fe1('0xdc')?'A':'C','secret':_0x43ce4b['secret']};})[_0x7fe1('0x68')]()};return ejs[_0x7fe1('0xdf')](path[_0x7fe1('0x81')](config['root'],'server',_0x7fe1('0xe0'),_0x7fe1('0xe1')),{'interaction':_0x4ae05d})[_0x7fe1('0x2a')](function(_0x21074a){return new BPromise(function(_0x341bb3,_0x5e8a79){pdf[_0x7fe1('0xe2')](_0x21074a,_0x2032c7)[_0x7fe1('0xe3')](path[_0x7fe1('0x81')](_0x3eb2cb,_0x7fe1('0xe4')+_0x2a37c9['id']+'-'+_0x258cae+'.pdf'),function(_0x2c8447,_0x135de8){if(_0x2c8447)return _0x5e8a79(_0x2c8447);_0x341bb3(_0x135de8);});});});}})['then'](function(){if(_0x55979e){return new BPromise(function(_0x4e90c3,_0x9cec9d){zipdir(_0x3eb2cb,{'saveTo':_0x3ba8da},function(_0x329a69,_0x1411d3){if(_0x329a69)return _0x9cec9d(_0x329a69);return _0x4e90c3(_0x1411d3);});})[_0x7fe1('0x2a')](function(){return new BPromise(function(_0x14174b,_0x4bdce1){rimraf(_0x3eb2cb,function(_0x2426d3){if(_0x2426d3)_0x4bdce1(_0x2426d3);return _0x14174b();});});})[_0x7fe1('0x2a')](function(){return _0x711fe[_0x7fe1('0xbf')](_0x3ba8da,_0x5d3d30,function(_0x4099aa){if(_0x4099aa){console[_0x7fe1('0xe5')]('err',_0x4099aa);}else{fs[_0x7fe1('0xe6')](_0x3ba8da);}});});}else{return _0x711fe[_0x7fe1('0x2d')](0xc8);}})['catch'](handleError(_0x711fe,null));}; \ No newline at end of file +var _0x0fd1=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','localhost','redis','./smsInteraction.socket','sendStatus','status','end','json','count','limit','set','reject','save','update','then','destroy','stack','name','closed','unreadMessages','SmsMessage','Users','map','TagIds','split','forEach','Tags','push','catch','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','select','field','COUNT(*)','from','where','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','expr','advancedFilter','parse','createdAt','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','LIKE','isNil','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$lte','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','QueryTypes','SELECT','clone','read','having','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20IN\x20?','%s\x20=\x200','%s\x20>\x200','sequelize','keyBy','merge','SmsInteraction','a.key','i.*','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','sms_interaction_has_tags','t.id\x20=\x20it.TagId','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','find','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','Tag','findAll','color','emit','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','CmContact','Contact','firstName','lastName','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','YYYY-MM-DD','mkdirSync','Sms','N.A.','closedAt','disposition','out','System','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4e97f8,_0x2d3126){var _0x1ea4b0=function(_0x1f8d38){while(--_0x1f8d38){_0x4e97f8['push'](_0x4e97f8['shift']());}};_0x1ea4b0(++_0x2d3126);}(_0x0fd1,0xd3));var _0x10fd=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x0fd1[_0x187ee1];return _0x388160;};'use strict';var pdf=require(_0x10fd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x10fd('0x1'));var zipdir=require(_0x10fd('0x2'));var jsonpatch=require(_0x10fd('0x3'));var rp=require('request-promise');var moment=require(_0x10fd('0x4'));var BPromise=require(_0x10fd('0x5'));var Mustache=require('mustache');var util=require(_0x10fd('0x6'));var path=require('path');var sox=require(_0x10fd('0x7'));var csv=require(_0x10fd('0x8'));var ejs=require(_0x10fd('0x9'));var fs=require('fs');var _=require(_0x10fd('0xa'));var squel=require(_0x10fd('0xb'));var crypto=require(_0x10fd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x10fd('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x10fd('0xe'));var authService=require(_0x10fd('0xf'));var qs=require(_0x10fd('0x10'));var hardwareService=require(_0x10fd('0x11'));var logger=require(_0x10fd('0x12'))(_0x10fd('0x13'));var utils=require(_0x10fd('0x14'));var config=require(_0x10fd('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x10fd('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10fd('0x17')]));require(_0x10fd('0x18'))['register'](socket);function respondWithStatusCode(_0x32dafb,_0x4d634a){_0x4d634a=_0x4d634a||0xcc;return function(_0x3e338a){if(_0x3e338a){return _0x32dafb[_0x10fd('0x19')](_0x4d634a);}return _0x32dafb[_0x10fd('0x1a')](_0x4d634a)[_0x10fd('0x1b')]();};}function respondWithResult(_0x241910,_0x10277f){_0x10277f=_0x10277f||0xc8;return function(_0x1bc7f1){if(_0x1bc7f1){return _0x241910['status'](_0x10277f)[_0x10fd('0x1c')](_0x1bc7f1);}};}function respondWithFilteredResult(_0x3facb4,_0x5c9744){return function(_0x1259aa){if(_0x1259aa){var _0x56e996=_0x1259aa[_0x10fd('0x1d')],_0x57c8b6=_0x5c9744['offset'],_0x425174=_0x5c9744['offset']+_0x5c9744[_0x10fd('0x1e')],_0x5b0a84;if(_0x425174>=_0x56e996){_0x425174=_0x56e996;_0x5b0a84=0xc8;}else{_0x5b0a84=0xce;}_0x3facb4[_0x10fd('0x1a')](_0x5b0a84);return _0x3facb4[_0x10fd('0x1f')]('Content-Range',_0x57c8b6+'-'+_0x425174+'/'+_0x56e996)['json'](_0x1259aa);}return null;};}function patchUpdates(_0x30cf63){return function(_0x22a44c){try{jsonpatch['apply'](_0x22a44c,_0x30cf63,!![]);}catch(_0x312964){return BPromise[_0x10fd('0x20')](_0x312964);}return _0x22a44c[_0x10fd('0x21')]();};}function saveUpdates(_0x302900,_0x1fac1b){return function(_0x251117){if(_0x251117){return _0x251117[_0x10fd('0x22')](_0x302900)[_0x10fd('0x23')](function(_0x250e70){return _0x250e70;});}return null;};}function removeEntity(_0x566907,_0x1e7941){return function(_0x2e281d){if(_0x2e281d){return _0x2e281d[_0x10fd('0x24')]()['then'](function(){_0x566907[_0x10fd('0x1a')](0xcc)[_0x10fd('0x1b')]();});}};}function handleEntityNotFound(_0x483a0a,_0x12fcb1){return function(_0x5ca79c){if(!_0x5ca79c){_0x483a0a[_0x10fd('0x19')](0x194);}return _0x5ca79c;};}function handleError(_0x363c02,_0x2a8c63){_0x2a8c63=_0x2a8c63||0x1f4;return function(_0x42a8cb){logger['error'](_0x42a8cb[_0x10fd('0x25')]);if(_0x42a8cb[_0x10fd('0x26')]){delete _0x42a8cb[_0x10fd('0x26')];}_0x363c02[_0x10fd('0x1a')](_0x2a8c63)['send'](_0x42a8cb);};}function getInteractionUnreadMessages(_0x59813b){return new BPromise(function(_0x47a9ff,_0x372b85){try{if(_0x59813b[_0x10fd('0x27')]){_0x59813b[_0x10fd('0x28')]=0x0;_0x47a9ff(_0x59813b);}else{return db[_0x10fd('0x29')][_0x10fd('0x1d')]({'where':{'SmsInteractionId':_0x59813b['id'],'direction':'in','read':![]}})[_0x10fd('0x23')](function(_0xbc2270){_0x59813b[_0x10fd('0x28')]=_0xbc2270;_0x47a9ff(_0x59813b);});}}catch(_0x2209c3){_0x372b85(_0x2209c3);}});}function getInteractionUsers(_0x1b327a,_0x2937c6){return new BPromise(function(_0x2efbe8,_0xf871e1){try{if(_0x2937c6[_0x1b327a['id']]){_0x1b327a[_0x10fd('0x2a')]=_[_0x10fd('0x2b')](_0x2937c6[_0x1b327a['id']],function(_0x53923f){return{'id':_0x53923f['id']};});}}catch(_0x277fea){_0xf871e1(_0x277fea);}_0x2efbe8(_0x1b327a);});}function getInteractionTags(_0x221d3d,_0x38da76){return new BPromise(function(_0x1b8fea,_0x200f43){try{if(_0x221d3d[_0x10fd('0x2c')]){_0x221d3d['Tags']=[];_0x221d3d[_0x10fd('0x2c')][_0x10fd('0x2d')](',')[_0x10fd('0x2e')](function(_0x349ae6){_0x221d3d[_0x10fd('0x2f')][_0x10fd('0x30')](_0x38da76[_0x349ae6]);});}delete _0x221d3d[_0x10fd('0x2c')];}catch(_0x1953ee){_0x200f43(_0x1953ee);}_0x1b8fea(_0x221d3d);});}function updateSmsInteraction(_0x14b6d2,_0x316f9f,_0x50d9ef){return new BPromise(function(_0x5163a8,_0x5e4c6c){return getInteractionUnreadMessages(_0x14b6d2)['then'](function(_0x4aff68){return getInteractionUsers(_0x4aff68,_0x50d9ef);})[_0x10fd('0x23')](function(_0xce983c){return getInteractionTags(_0xce983c,_0x316f9f);})[_0x10fd('0x23')](function(_0x514f54){_0x5163a8(_0x514f54);})[_0x10fd('0x31')](function(_0x566a4d){_0x5e4c6c(_0x566a4d);});});}exports[_0x10fd('0x32')]=function(_0x1539cd,_0x198281){var _0xac23d5={},_0x4001c2={},_0x94f49e={'count':0x0,'rows':[]};var _0x59541d=db['SmsInteraction'][_0x10fd('0x33')];_0x4001c2[_0x10fd('0x34')]=_['keys'](_0x59541d);_0x4001c2[_0x10fd('0x35')]=_[_0x10fd('0x36')](_0x1539cd[_0x10fd('0x35')]);_0x4001c2[_0x10fd('0x37')]=_[_0x10fd('0x38')](_0x4001c2[_0x10fd('0x34')],_0x4001c2[_0x10fd('0x35')]);_0xac23d5[_0x10fd('0x39')]=_['intersection'](_0x4001c2[_0x10fd('0x34')],qs['fields'](_0x1539cd[_0x10fd('0x35')][_0x10fd('0x3a')]));_0xac23d5[_0x10fd('0x39')]=_0xac23d5[_0x10fd('0x39')][_0x10fd('0x3b')]?_0xac23d5[_0x10fd('0x39')]:_0x4001c2[_0x10fd('0x34')];if(!_0x1539cd[_0x10fd('0x35')][_0x10fd('0x3c')]('nolimit')){_0xac23d5[_0x10fd('0x1e')]=qs[_0x10fd('0x1e')](_0x1539cd[_0x10fd('0x35')][_0x10fd('0x1e')]);_0xac23d5[_0x10fd('0x3d')]=qs[_0x10fd('0x3d')](_0x1539cd[_0x10fd('0x35')][_0x10fd('0x3d')]);}_0xac23d5['order']=qs['sort'](_0x1539cd[_0x10fd('0x35')][_0x10fd('0x3e')]);_0xac23d5['where']=qs[_0x10fd('0x37')](_[_0x10fd('0x3f')](_0x1539cd[_0x10fd('0x35')],_0x4001c2[_0x10fd('0x37')]));var _0x395dde=[];var _0xf5f99b=squel[_0x10fd('0x40')]()[_0x10fd('0x41')]('id')[_0x10fd('0x41')]('name')[_0x10fd('0x41')]('color')['from']('tools_tags');var _0x7bc1ac=squel[_0x10fd('0x40')]()[_0x10fd('0x41')](_0x10fd('0x42'))[_0x10fd('0x43')]('sms_messages','me')[_0x10fd('0x44')](_0x10fd('0x45'))[_0x10fd('0x44')](_0x10fd('0x46'))[_0x10fd('0x44')]('me.read\x20=\x20false');var _0x447eb4=squel[_0x10fd('0x40')]()['field'](_0x10fd('0x47'))[_0x10fd('0x41')](_0x10fd('0x48'))[_0x10fd('0x43')](_0x10fd('0x49'),'ui')[_0x10fd('0x4a')](_0x10fd('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x51a237=squel['select']()['from'](_0x10fd('0x4c'),'i')[_0x10fd('0x4a')]('cm_contacts','c',_0x10fd('0x4d'))[_0x10fd('0x4a')](_0x10fd('0x4b'),'o',_0x10fd('0x4e'))[_0x10fd('0x4a')](_0x10fd('0x4f'),'a',_0x10fd('0x50'))[_0x10fd('0x4a')](_0x10fd('0x51'),'me',_0x10fd('0x45'));var _0x392747=squel[_0x10fd('0x52')]();if(_0x1539cd['query'][_0x10fd('0x53')]){var _0x21938b=JSON[_0x10fd('0x54')](_0x1539cd[_0x10fd('0x35')]['advancedFilter']);_[_0x10fd('0x36')](_0x21938b)[_0x10fd('0x2e')](function(_0x41834a){var _0x1b52c6=_0x21938b[_0x41834a];if(_0x41834a===_0x10fd('0x55')){var _0x5638b8=moment(_0x1b52c6['value'][_0x10fd('0x56')])[_0x10fd('0x57')](_0x10fd('0x58'))[_0x10fd('0x59')]()[_0x10fd('0x5a')]();var _0x541eb2=moment(_0x541eb2)[_0x10fd('0x59')]()[_0x10fd('0x5b')](_0x10fd('0x58'))['format']();_0x392747[_0x10fd('0x5c')](_0x10fd('0x5d'),_0x5638b8,_0x541eb2);}else{if(_[_0x10fd('0x5e')](_0x1b52c6[_0x10fd('0x5f')])){_0x1b52c6[_0x10fd('0x5f')][_0x10fd('0x2e')](function(_0x5d4546){switch(_0x1b52c6[_0x10fd('0x5f')][_0x10fd('0x60')]){case'IS':if(_0x41834a!==_0x10fd('0x61')&&_0x41834a!==_0x10fd('0x62')){if(_[_0x10fd('0x5e')](_0x1b52c6['value'])&&_0x1b52c6[_0x10fd('0x60')][_0x10fd('0x3b')]>0x1){_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+_0x10fd('0x64'),_0x1b52c6['value']);}else{_0x392747[_0x10fd('0x5c')](_0x1b52c6['tableAlias']+'.'+_0x41834a+_0x10fd('0x65'),_0x1b52c6[_0x10fd('0x60')][0x0]);}}break;case'=':_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+_0x10fd('0x65'),_0x1b52c6[_0x10fd('0x60')]);break;case'LIKE':if(_0x41834a===_0x10fd('0x66')){_0x392747[_0x10fd('0x5c')](_0x10fd('0x67')+_0x10fd('0x68'),'%'+_0x1b52c6[_0x10fd('0x60')]+'%');_0x392747['or'](_0x10fd('0x69')+'\x20LIKE\x20?','%'+_0x1b52c6[_0x10fd('0x60')]+'%');_0x392747['or'](_0x10fd('0x6a')+_0x10fd('0x68'),'%'+_0x1b52c6[_0x10fd('0x60')]+'%');}else{_0x392747[_0x10fd('0x5c')](_0x1b52c6['tableAlias']+'.'+_0x41834a+_0x10fd('0x68'),'%'+_0x1b52c6[_0x10fd('0x60')]+'%');}break;case'>':_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+_0x10fd('0x6b'),_0x1b52c6[_0x10fd('0x60')]);break;case'<':_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+_0x10fd('0x6c'),_0x1b52c6[_0x10fd('0x60')]);break;}});}else{switch(_0x1b52c6['condition'][_0x10fd('0x60')]){case'IS':if(_0x41834a!==_0x10fd('0x61')&&_0x41834a!=='Messages.count'){if(_[_0x10fd('0x5e')](_0x1b52c6[_0x10fd('0x60')])&&_0x1b52c6[_0x10fd('0x60')]['length']>0x1){_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+'\x20IN\x20?',_0x1b52c6[_0x10fd('0x60')]);}else{_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+_0x10fd('0x65'),_0x1b52c6[_0x10fd('0x60')][0x0]);}}break;case'=':_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+_0x10fd('0x65'),_0x1b52c6['value']);break;case _0x10fd('0x6d'):if(_0x41834a===_0x10fd('0x66')){_0x392747['and'](_0x10fd('0x67')+'\x20LIKE\x20?','%'+_0x1b52c6[_0x10fd('0x60')]+'%');_0x392747['or']('c.lastName'+_0x10fd('0x68'),'%'+_0x1b52c6[_0x10fd('0x60')]+'%');_0x392747['or'](_0x10fd('0x6a')+_0x10fd('0x68'),'%'+_0x1b52c6['value']+'%');}else{_0x392747[_0x10fd('0x5c')](_0x1b52c6['tableAlias']+'.'+_0x41834a+_0x10fd('0x68'),'%'+_0x1b52c6['value']+'%');}break;case'>':_0x392747['and'](_0x1b52c6['tableAlias']+'.'+_0x41834a+_0x10fd('0x6b'),_0x1b52c6[_0x10fd('0x60')]);break;case'<':_0x392747[_0x10fd('0x5c')](_0x1b52c6[_0x10fd('0x63')]+'.'+_0x41834a+_0x10fd('0x6c'),_0x1b52c6[_0x10fd('0x60')]);break;}}}});}else{var _0x45b838=_(Object[_0x10fd('0x36')](_0x1539cd[_0x10fd('0x35')]))[_0x10fd('0x2b')](function(_0x3afc28){return _0x59541d[_0x10fd('0x3c')](_0x3afc28)?_0x3afc28:undefined;})['filter'](function(_0x54d246){return!_[_0x10fd('0x6e')](_0x54d246);})['value']();if(!_[_0x10fd('0x6f')](_0x45b838)){_0x45b838[_0x10fd('0x2e')](function(_0x14e168){if(_0x14e168===_0x10fd('0x70')){_0x51a237[_0x10fd('0x44')](_0x10fd('0x71'),[][_0x10fd('0x72')](_0x1539cd[_0x10fd('0x35')][_0x14e168]));}else if(_0x14e168===_0x10fd('0x55')){var _0x1b2cfc=JSON[_0x10fd('0x54')](_0x1539cd['query'][_0x14e168])['$gte'];var _0xdebec7=JSON[_0x10fd('0x54')](_0x1539cd['query'][_0x14e168])[_0x10fd('0x73')];_0x51a237['where'](_0x10fd('0x5d'),_0x1b2cfc,_0xdebec7);}else{if(_0x1539cd[_0x10fd('0x35')][_0x14e168]===_0x10fd('0x74')){_0x51a237[_0x10fd('0x44')]('i.'+_0x14e168+_0x10fd('0x75'));}else{_0x51a237[_0x10fd('0x44')]('i.'+_0x14e168+'\x20=\x20?',_0x1539cd[_0x10fd('0x35')][_0x14e168]);}}});}if(_0x1539cd[_0x10fd('0x35')]['filter']){var _0x132feb=_0x1539cd[_0x10fd('0x35')][_0x10fd('0x76')][_0x10fd('0x77')]('\x5c','\x5c\x5c')[_0x10fd('0x77')]('\x27\x27',_0x10fd('0x78'));if(qs[_0x10fd('0x79')](_0x132feb)){_0x392747['or'](_0x10fd('0x7a'),_0x132feb+'%')['or'](_0x10fd('0x7b'),_0x132feb+'%');}else{var _0x3aa6da=[];_0x132feb['split']('\x20')[_0x10fd('0x2e')](function(_0x1884f4){_0x3aa6da[_0x10fd('0x30')]('+'+_0x1884f4[_0x10fd('0x7c')]());});var _0x1e6ed8=_0x3aa6da['join']('\x20');_0x392747['or'](_0x10fd('0x7d'),_0x1e6ed8)['or'](_0x10fd('0x7e'),_0x132feb+'%');}}}_0x51a237[_0x10fd('0x44')](_0x392747);if(_0xac23d5[_0x10fd('0x7f')]){_0xac23d5[_0x10fd('0x7f')][_0x10fd('0x2e')](function(_0x3786f8){_0x51a237[_0x10fd('0x7f')]('i.'+_0x3786f8[0x0],_0x3786f8[0x1]===_0x10fd('0x80')?![]:!![]);});}_0x51a237[_0x10fd('0x81')]('i.id');var _0x3e25bd={'type':db[_0x10fd('0x82')][_0x10fd('0x83')][_0x10fd('0x84')],'raw':!![]};var _0x33201b=_0x51a237[_0x10fd('0x85')]()['field'](_0x10fd('0x42'));if(!_0x1539cd['query'][_0x10fd('0x53')]){if(_0x1539cd[_0x10fd('0x35')][_0x10fd('0x86')]){if(_0x1539cd[_0x10fd('0x35')][_0x10fd('0x86')]==0x1){_0x33201b[_0x10fd('0x44')](util['format']('%s\x20=\x200',_0x7bc1ac[_0x10fd('0x7c')]()));_0x51a237[_0x10fd('0x87')](_0x10fd('0x88'));}else{_0x33201b[_0x10fd('0x44')](util[_0x10fd('0x5a')]('%s\x20>\x200',_0x7bc1ac['toString']()));_0x51a237[_0x10fd('0x87')](_0x10fd('0x89'));}}if(_0x1539cd[_0x10fd('0x35')][_0x10fd('0x8a')]){var _0x168cfb=_['isArray'](_0x1539cd[_0x10fd('0x35')]['tag'])?_0x1539cd[_0x10fd('0x35')][_0x10fd('0x8a')]:new Array(_0x1539cd[_0x10fd('0x35')]['tag']);var _0x237d19=squel[_0x10fd('0x52')]();_0x168cfb['forEach'](function(_0x34af5e){_0x237d19['or'](_0x10fd('0x8b'),'%,'+_0x34af5e+',%');});_0x51a237['having'](_0x237d19);_0x33201b['left_join']('sms_interaction_has_tags','it',_0x10fd('0x8c'));_0x33201b[_0x10fd('0x4a')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x33201b['where']('t.id\x20IN\x20?',_0x168cfb);}}else{var _0x21938b=JSON[_0x10fd('0x54')](_0x1539cd[_0x10fd('0x35')][_0x10fd('0x53')]);_[_0x10fd('0x36')](_0x21938b)[_0x10fd('0x2e')](function(_0x20bfb9){var _0x449ed8=_0x21938b[_0x20bfb9];if(_0x20bfb9===_0x10fd('0x61')){var _0x2f515e=_0x449ed8[_0x10fd('0x60')];var _0x4866c5=squel[_0x10fd('0x52')]();_0x2f515e[_0x10fd('0x2e')](function(_0x31d62f){_0x4866c5['or'](_0x10fd('0x8b'),'%,'+_0x31d62f+',%');});_0x51a237['having'](_0x4866c5);_0x33201b[_0x10fd('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x33201b[_0x10fd('0x4a')](_0x10fd('0x8d'),'t','t.id\x20=\x20it.TagId');_0x33201b[_0x10fd('0x44')](_0x10fd('0x8e'),_0x2f515e);}else if(_0x20bfb9===_0x10fd('0x62')){if(_0x449ed8[_0x10fd('0x60')][_0x10fd('0x3b')]===0x1){if(_0x449ed8[_0x10fd('0x60')][0x0]===0x1){_0x33201b['where'](util[_0x10fd('0x5a')](_0x10fd('0x8f'),_0x7bc1ac[_0x10fd('0x7c')]()));_0x51a237[_0x10fd('0x87')](_0x10fd('0x88'));}else{_0x33201b[_0x10fd('0x44')](util[_0x10fd('0x5a')](_0x10fd('0x90'),_0x7bc1ac[_0x10fd('0x7c')]()));_0x51a237['having'](_0x10fd('0x89'));}}}});}db[_0x10fd('0x91')][_0x10fd('0x35')](_0x33201b[_0x10fd('0x7c')](),_0x3e25bd)[_0x10fd('0x23')](function(_0x4efd76){_0x94f49e[_0x10fd('0x1d')]=_0x4efd76[_0x10fd('0x3b')];if(_0x94f49e[_0x10fd('0x1d')]===0x0)return[];return db[_0x10fd('0x91')]['query'](_0xf5f99b[_0x10fd('0x7c')](),_0x3e25bd)['then'](function(_0x274d10){_0x395dde=_[_0x10fd('0x92')](_0x274d10,'id');_0x3e25bd=_[_0x10fd('0x93')](_0x3e25bd,{'model':db[_0x10fd('0x94')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x51a237[_0x10fd('0x41')](_0x10fd('0x95'),'Account.key');_0x51a237['field'](_0x10fd('0x96'));_0x51a237[_0x10fd('0x41')]('c.firstName','Contact.firstName');_0x51a237[_0x10fd('0x41')](_0x10fd('0x69'),_0x10fd('0x97'));_0x51a237['field'](_0x10fd('0x6a'),_0x10fd('0x98'));_0x51a237[_0x10fd('0x41')]('c.phone',_0x10fd('0x99'));_0x51a237[_0x10fd('0x41')](_0x10fd('0x9a'),_0x10fd('0x9b'));_0x51a237[_0x10fd('0x41')](_0x10fd('0x9c'),'Contact.fax');_0x51a237[_0x10fd('0x41')](_0x10fd('0x9d'),'TagIds');_0x51a237[_0x10fd('0x4a')](_0x10fd('0x9e'),'it',_0x10fd('0x8c'));_0x51a237['left_join'](_0x10fd('0x8d'),'t',_0x10fd('0x9f'));_0x51a237[_0x10fd('0x1e')](_0xac23d5[_0x10fd('0x1e')]);_0x51a237['offset'](_0xac23d5[_0x10fd('0x3d')]);return db[_0x10fd('0x91')][_0x10fd('0x35')](_0x51a237['toString'](),_0x3e25bd);})['then'](function(_0x17e951){_0x447eb4[_0x10fd('0x44')](_0x10fd('0xa0'),_['map'](_0x17e951,'id'));return db[_0x10fd('0x91')][_0x10fd('0x35')](_0x447eb4['toString'](),_0x3e25bd)[_0x10fd('0x23')](function(_0x23962a){var _0x5c548a=_[_0x10fd('0xa1')](_0x23962a,'SmsInteractionId');var _0x2e4190=[];_0x17e951[_0x10fd('0x2e')](function(_0xb6340b){_0x2e4190[_0x10fd('0x30')](updateSmsInteraction(_0xb6340b,_0x395dde,_0x5c548a));});return BPromise[_0x10fd('0xa2')](_0x2e4190);});});})[_0x10fd('0x23')](function(_0x49f39f){_0x94f49e[_0x10fd('0xa3')]=_0x49f39f;return _0x94f49e;})[_0x10fd('0x23')](respondWithFilteredResult(_0x198281,_0xac23d5))[_0x10fd('0x31')](handleError(_0x198281,null));};exports[_0x10fd('0xa4')]=function(_0x3b2599,_0x4a2a8b){var _0x477b61={'raw':![],'where':{'id':_0x3b2599['params']['id']}},_0x70b1b6={};_0x70b1b6[_0x10fd('0x34')]=_[_0x10fd('0x36')](db[_0x10fd('0x94')][_0x10fd('0x33')]);_0x70b1b6['query']=_[_0x10fd('0x36')](_0x3b2599[_0x10fd('0x35')]);_0x70b1b6['filters']=_[_0x10fd('0x38')](_0x70b1b6['model'],_0x70b1b6[_0x10fd('0x35')]);_0x477b61[_0x10fd('0x39')]=_['intersection'](_0x70b1b6['model'],qs[_0x10fd('0x3a')](_0x3b2599['query'][_0x10fd('0x3a')]));_0x477b61[_0x10fd('0x39')]=_0x477b61[_0x10fd('0x39')][_0x10fd('0x3b')]?_0x477b61[_0x10fd('0x39')]:_0x70b1b6[_0x10fd('0x34')];if(_0x3b2599[_0x10fd('0x35')][_0x10fd('0xa5')]){_0x477b61[_0x10fd('0xa6')]=[{'all':!![]}];}_0x477b61=_[_0x10fd('0x93')]({},_0x477b61,_0x3b2599[_0x10fd('0xa7')]);return db[_0x10fd('0x94')][_0x10fd('0xa8')](_0x477b61)[_0x10fd('0x23')](handleEntityNotFound(_0x4a2a8b,null))['then'](respondWithResult(_0x4a2a8b,null))[_0x10fd('0x31')](handleError(_0x4a2a8b,null));};exports['create']=function(_0x18ee2b,_0x52b770){return db[_0x10fd('0x94')][_0x10fd('0xa9')](_0x18ee2b['body'],{})['then'](respondWithResult(_0x52b770,0xc9))[_0x10fd('0x31')](handleError(_0x52b770,null));};exports[_0x10fd('0x22')]=function(_0x4aca70,_0x39f40d){if(_0x4aca70[_0x10fd('0xaa')]['id']){delete _0x4aca70[_0x10fd('0xaa')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x4aca70['params']['id']}})[_0x10fd('0x23')](handleEntityNotFound(_0x39f40d,null))[_0x10fd('0x23')](saveUpdates(_0x4aca70['body'],null))[_0x10fd('0x23')](respondWithResult(_0x39f40d,null))[_0x10fd('0x31')](handleError(_0x39f40d,null));};exports[_0x10fd('0x24')]=function(_0x53208d,_0x244a4){return db[_0x10fd('0x94')][_0x10fd('0xa8')]({'where':{'id':_0x53208d[_0x10fd('0xab')]['id']}})[_0x10fd('0x23')](handleEntityNotFound(_0x244a4,null))[_0x10fd('0x23')](removeEntity(_0x244a4,null))['catch'](handleError(_0x244a4,null));};exports['describe']=function(_0x4c8d00,_0x4bc37b){return db[_0x10fd('0x94')][_0x10fd('0xac')]()[_0x10fd('0x23')](respondWithResult(_0x4bc37b,null))[_0x10fd('0x31')](handleError(_0x4bc37b,null));};exports[_0x10fd('0xad')]=function(_0x40cf1e,_0xf7cb93,_0x47301e){return db['SmsMessage'][_0x10fd('0xa8')]({'where':{'id':_0x40cf1e[_0x10fd('0xab')]['id']}})[_0x10fd('0x23')](handleEntityNotFound(_0xf7cb93,null))['then'](function(_0x4bd947){if(_0x4bd947){return _0x4bd947[_0x10fd('0xad')](_0x40cf1e[_0x10fd('0xaa')][_0x10fd('0xae')],_[_0x10fd('0xaf')](_0x40cf1e[_0x10fd('0xaa')],[_0x10fd('0xae'),'id'])||{});}})[_0x10fd('0x23')](respondWithResult(_0xf7cb93,null))[_0x10fd('0x31')](handleError(_0xf7cb93,null));};exports[_0x10fd('0xb0')]=function(_0x3d7566,_0x3f1193,_0x2f947b){var _0x2bc5f6={'raw':![],'where':{}};var _0x47ff21={};var _0x149a2f={'count':0x0,'rows':[]};return db[_0x10fd('0x94')][_0x10fd('0xb1')]({'where':{'id':_0x3d7566[_0x10fd('0xab')]['id']}})[_0x10fd('0x23')](handleEntityNotFound(_0x3f1193,null))['then'](function(_0x56755c){if(_0x56755c){_0x47ff21[_0x10fd('0x34')]=_[_0x10fd('0x36')](db[_0x10fd('0x29')][_0x10fd('0x33')]);_0x47ff21['query']=_[_0x10fd('0x36')](_0x3d7566[_0x10fd('0x35')]);_0x47ff21['filters']=_[_0x10fd('0x38')](_0x47ff21[_0x10fd('0x34')],_0x47ff21[_0x10fd('0x35')]);_0x2bc5f6[_0x10fd('0x39')]=_[_0x10fd('0x38')](_0x47ff21[_0x10fd('0x34')],qs[_0x10fd('0x3a')](_0x3d7566[_0x10fd('0x35')][_0x10fd('0x3a')]));_0x2bc5f6[_0x10fd('0x39')]=_0x2bc5f6['attributes'][_0x10fd('0x3b')]?_0x2bc5f6['attributes']:_0x47ff21[_0x10fd('0x34')];if(!_0x3d7566[_0x10fd('0x35')][_0x10fd('0x3c')]('nolimit')){_0x2bc5f6['limit']=qs[_0x10fd('0x1e')](_0x3d7566['query'][_0x10fd('0x1e')]);_0x2bc5f6[_0x10fd('0x3d')]=qs[_0x10fd('0x3d')](_0x3d7566['query']['offset']);}_0x2bc5f6[_0x10fd('0x7f')]=qs[_0x10fd('0x3e')](_0x3d7566[_0x10fd('0x35')][_0x10fd('0x3e')]);_0x2bc5f6[_0x10fd('0x44')]=qs[_0x10fd('0x37')](_['pick'](_0x3d7566[_0x10fd('0x35')],_0x47ff21[_0x10fd('0x37')]));_0x2bc5f6[_0x10fd('0x44')]['SmsInteractionId']=_0x56755c['id'];if(_0x3d7566[_0x10fd('0x35')][_0x10fd('0x76')]){_0x2bc5f6['where']=_[_0x10fd('0x93')](_0x2bc5f6[_0x10fd('0x44')],{'$or':_[_0x10fd('0x2b')](_0x2bc5f6[_0x10fd('0x39')],function(_0x45b85f){var _0x45f4f7={};_0x45f4f7[_0x45b85f]={'$like':'%'+_0x3d7566[_0x10fd('0x35')]['filter']+'%'};return _0x45f4f7;})});}if(_0x3d7566[_0x10fd('0x35')][_0x10fd('0xb2')]){var _0x1ce908=_0x3d7566['query']['$gte'][_0x10fd('0x2d')](',');var _0x5a36bf={};_0x5a36bf[_0x1ce908[0x0]]={'$gte':moment(_0x1ce908[0x1])[_0x10fd('0x5a')](_0x10fd('0xb3'))};_0x2bc5f6[_0x10fd('0x44')]=_[_0x10fd('0x93')](_0x2bc5f6[_0x10fd('0x44')],_0x5a36bf);}_0x2bc5f6=_[_0x10fd('0x93')]({},_0x2bc5f6,_0x3d7566[_0x10fd('0xa7')]);return db['SmsMessage'][_0x10fd('0x1d')]({'where':_0x2bc5f6[_0x10fd('0x44')]})[_0x10fd('0x23')](function(_0x463904){_0x149a2f[_0x10fd('0x1d')]=_0x463904;if(_0x3d7566[_0x10fd('0x35')]['includeAll']){_0x2bc5f6[_0x10fd('0xa6')]=[{'all':!![]}];}return db[_0x10fd('0x29')]['findAll'](_0x2bc5f6);})[_0x10fd('0x23')](function(_0x2214f3){_0x149a2f[_0x10fd('0xa3')]=_0x2214f3;return _0x149a2f;});}})[_0x10fd('0x23')](respondWithFilteredResult(_0x3f1193,_0x2bc5f6))[_0x10fd('0x31')](handleError(_0x3f1193,null));};exports[_0x10fd('0xb4')]=function(_0x5605ca,_0x5e88a7,_0x5a4a7c){return db['SmsInteraction'][_0x10fd('0xa8')]({'where':{'id':_0x5605ca[_0x10fd('0xab')]['id']}})[_0x10fd('0x23')](handleEntityNotFound(_0x5e88a7,null))[_0x10fd('0x23')](function(_0x3e9220){if(_0x3e9220){return _0x3e9220['setTags'](_0x5605ca['body'][_0x10fd('0xae')],_[_0x10fd('0xaf')](_0x5605ca[_0x10fd('0xaa')],[_0x10fd('0xae'),'id'])||{})[_0x10fd('0xb5')](function(){return db[_0x10fd('0xb6')][_0x10fd('0xb7')]({'attributes':['id',_0x10fd('0x26'),_0x10fd('0xb8')],'where':{'id':_0x5605ca[_0x10fd('0xaa')][_0x10fd('0xae')]}});})[_0x10fd('0x23')](function(_0x3e86be){socket[_0x10fd('0xb9')](_0x10fd('0xba'),{'id':Number(_0x5605ca[_0x10fd('0xab')]['id']),'tags':_0x3e86be||[]});return{'id':Number(_0x5605ca[_0x10fd('0xab')]['id']),'tags':_0x3e86be||[]};});}})[_0x10fd('0x23')](respondWithResult(_0x5e88a7,null))['catch'](handleError(_0x5e88a7,null));};exports['removeTags']=function(_0x5e8a94,_0x954de5,_0x2fd77c){return db[_0x10fd('0x94')][_0x10fd('0xa8')]({'where':{'id':_0x5e8a94[_0x10fd('0xab')]['id']}})['then'](handleEntityNotFound(_0x954de5,null))[_0x10fd('0x23')](function(_0x453a7a){if(_0x453a7a){return _0x453a7a[_0x10fd('0xbb')](_0x5e8a94[_0x10fd('0x35')]['ids']);}})[_0x10fd('0x23')](respondWithStatusCode(_0x954de5,null))[_0x10fd('0x31')](handleError(_0x954de5,null));};exports[_0x10fd('0xbc')]=function(_0x104b28,_0x2e7cb7){var _0x4b9b94=moment()['unix']()[_0x10fd('0x7c')]();var _0x126e7b=path[_0x10fd('0xbd')](config[_0x10fd('0xbe')],_0x10fd('0xbf'),_0x10fd('0xc0'),_0x10fd('0xc1'));var _0x303b0f=path['join'](config['root'],_0x10fd('0xbf'),_0x10fd('0xc0'),_0x10fd('0xc2'));var _0xeb3d4=path[_0x10fd('0xbd')](_0x126e7b,_0x4b9b94);var _0x438a5b=util['format'](_0x10fd('0xc3'),_0x104b28[_0x10fd('0xab')]['id'],_0x4b9b94);var _0x445518=path['join'](_0x126e7b,_0x438a5b);var _0x12a8ea=![];return db[_0x10fd('0x94')][_0x10fd('0xa8')]({'where':{'id':_0x104b28[_0x10fd('0xab')]['id']},'include':[{'model':db['SmsMessage'],'as':_0x10fd('0xc4'),'attributes':['id','body',_0x10fd('0x55'),_0x10fd('0xc5'),_0x10fd('0xc6')],'include':[{'model':db[_0x10fd('0xc7')],'as':_0x10fd('0xc7'),'attributes':['id',_0x10fd('0xc8')],'raw':!![]},{'model':db[_0x10fd('0xc9')],'as':_0x10fd('0xca'),'attributes':['id',_0x10fd('0xcb'),_0x10fd('0xcc')],'raw':!![]}]},{'model':db['SmsAccount'],'as':_0x10fd('0xcd'),'attributes':['id',_0x10fd('0x26')]},{'model':db[_0x10fd('0xc7')],'as':_0x10fd('0xce'),'attributes':['id',_0x10fd('0xc8')]}]})[_0x10fd('0x23')](handleEntityNotFound(_0x2e7cb7,null))['then'](function(_0x55f1dc){if(_0x55f1dc){var _0x55fb21=_0x55f1dc[_0x10fd('0xcf')]({'plain':!![]});_0x12a8ea=!![];var _0x5188fb={'format':'A4','border':_0x10fd('0xd0'),'header':{'height':_0x10fd('0xd1'),'contents':{'first':_0x10fd('0xd2')}},'footer':{'height':_0x10fd('0xd3'),'contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x10fd('0x5a')](_0x10fd('0xd4'),'Sms',_0x55fb21['id']),moment()['format'](_0x10fd('0xd5'))['toString']())}}};fs[_0x10fd('0xd6')](_0xeb3d4);var _0x5e0c1f={'channel':_0x10fd('0xd7'),'account':_0x55fb21['Account']['name'],'agent':_0x55fb21[_0x10fd('0xce')]?_0x55fb21['Owner'][_0x10fd('0xc8')]:_0x10fd('0xd8'),'createdAt':moment(_0x55fb21[_0x10fd('0x55')])['format'](_0x10fd('0xb3'))[_0x10fd('0x7c')](),'closedAt':_0x55fb21[_0x10fd('0x27')]?moment(_0x55fb21[_0x10fd('0xd9')])[_0x10fd('0x5a')](_0x10fd('0xb3'))[_0x10fd('0x7c')]():'','disposition':_0x55fb21[_0x10fd('0xda')],'messages':_(_0x55fb21['Messages'])[_0x10fd('0x76')]({'secret':![]})[_0x10fd('0x2b')](function(_0x52739b){return{'date':moment(_0x52739b[_0x10fd('0x55')])[_0x10fd('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x10fd('0x7c')](),'sender':_0x52739b['direction']===_0x10fd('0xdb')?_0x52739b[_0x10fd('0xc7')]?_0x52739b['User'][_0x10fd('0xc8')]:_0x10fd('0xdc'):_0x52739b[_0x10fd('0xca')][_0x10fd('0xcb')]+(_0x52739b[_0x10fd('0xca')][_0x10fd('0xcc')]?'\x20'+_0x52739b['Contact'][_0x10fd('0xcc')]:''),'body':_0x52739b[_0x10fd('0xaa')],'direction':_0x52739b['direction']==='out'?'A':'C','secret':_0x52739b[_0x10fd('0xc6')]};})[_0x10fd('0x60')]()};return ejs['renderFile'](path[_0x10fd('0xbd')](config[_0x10fd('0xbe')],_0x10fd('0xbf'),_0x10fd('0xdd'),_0x10fd('0xde')),{'interaction':_0x5e0c1f})[_0x10fd('0x23')](function(_0x2e5bfb){return new BPromise(function(_0x845768,_0x1ba00b){pdf[_0x10fd('0xa9')](_0x2e5bfb,_0x5188fb)[_0x10fd('0xdf')](path[_0x10fd('0xbd')](_0xeb3d4,_0x10fd('0xe0')+_0x55fb21['id']+'-'+_0x4b9b94+_0x10fd('0xe1')),function(_0xa4b2e3,_0x24f62d){if(_0xa4b2e3)return _0x1ba00b(_0xa4b2e3);_0x845768(_0x24f62d);});});});}})['then'](function(){if(_0x12a8ea){return new BPromise(function(_0x216925,_0x3229ab){zipdir(_0xeb3d4,{'saveTo':_0x445518},function(_0x57e509,_0x2b16bd){if(_0x57e509)return _0x3229ab(_0x57e509);return _0x216925(_0x2b16bd);});})[_0x10fd('0x23')](function(){return new BPromise(function(_0x437a4c,_0x2b1780){rimraf(_0xeb3d4,function(_0x5f2ca5){if(_0x5f2ca5)_0x2b1780(_0x5f2ca5);return _0x437a4c();});});})[_0x10fd('0x23')](function(){return _0x2e7cb7[_0x10fd('0xbc')](_0x445518,_0x438a5b,function(_0x2bf5d5){if(_0x2bf5d5){console['log'](_0x10fd('0xe2'),_0x2bf5d5);}else{fs[_0x10fd('0xe3')](_0x445518);}});});}else{return _0x2e7cb7[_0x10fd('0x19')](0xc8);}})[_0x10fd('0x31')](handleError(_0x2e7cb7,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index defee02..b58b373 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 _0xaf66=['SmsMessage','save','update','then','setDataValue','unreadMessages','length','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction'];(function(_0x572eea,_0x853014){var _0x3c8359=function(_0x5bc54b){while(--_0x5bc54b){_0x572eea['push'](_0x572eea['shift']());}};_0x3c8359(++_0x853014);}(_0xaf66,0x7f));var _0x6af6=function(_0x121b1a,_0x42fdb7){_0x121b1a=_0x121b1a-0x0;var _0x2d89a6=_0xaf66[_0x121b1a];return _0x2d89a6;};'use strict';var EventEmitter=require(_0x6af6('0x0'));var SmsInteraction=require(_0x6af6('0x1'))['db'][_0x6af6('0x2')];var SmsMessage=require(_0x6af6('0x1'))['db'][_0x6af6('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6af6('0x4'),'afterUpdate':_0x6af6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x13ba75){return function(_0x24beab,_0x220ab5,_0x2c5ecd){SmsMessage['findAll']({'where':{'SmsInteractionId':_0x24beab['id'],'direction':'in','read':![]},'raw':!![]})[_0x6af6('0x6')](function(_0xbe04fb){_0x24beab[_0x6af6('0x7')](_0x6af6('0x8'),_0xbe04fb[_0x6af6('0x9')]);SmsInteractionEvents['emit'](_0x13ba75+':'+_0x24beab['id'],_0x24beab);SmsInteractionEvents['emit'](_0x13ba75,_0x24beab);_0x2c5ecd(null);})[_0x6af6('0xa')](_0x2c5ecd(null));};}for(var e in events){if(events[_0x6af6('0xb')](e)){var event=events[e];SmsInteraction[_0x6af6('0xc')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x9290=['hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x4ca966,_0x6fdc8){var _0x2312b4=function(_0x495b5d){while(--_0x495b5d){_0x4ca966['push'](_0x4ca966['shift']());}};_0x2312b4(++_0x6fdc8);}(_0x9290,0x79));var _0x0929=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x9290[_0xa6cb09];return _0x12b437;};'use strict';var EventEmitter=require(_0x0929('0x0'));var SmsInteraction=require(_0x0929('0x1'))['db'][_0x0929('0x2')];var SmsMessage=require(_0x0929('0x1'))['db'][_0x0929('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0929('0x4')](0x0);var events={'afterCreate':_0x0929('0x5'),'afterUpdate':_0x0929('0x6'),'afterDestroy':_0x0929('0x7')};function emitEvent(_0x545938){return function(_0x34d723,_0x7a8915,_0x54b97e){SmsMessage['findAll']({'where':{'SmsInteractionId':_0x34d723['id'],'direction':'in','read':![]},'raw':!![]})[_0x0929('0x8')](function(_0x33da67){_0x34d723[_0x0929('0x9')](_0x0929('0xa'),_0x33da67[_0x0929('0xb')]);SmsInteractionEvents[_0x0929('0xc')](_0x545938+':'+_0x34d723['id'],_0x34d723);SmsInteractionEvents[_0x0929('0xc')](_0x545938,_0x34d723);_0x54b97e(null);})[_0x0929('0xd')](_0x54b97e(null));};}for(var e in events){if(events[_0x0929('0xe')](e)){var event=events[e];SmsInteraction[_0x0929('0xf')](e,emitEvent(event));}}module[_0x0929('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index da219be..a8a181e 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 _0x6076=['api','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x1c1890,_0x509e4f){var _0x2da9bc=function(_0x307389){while(--_0x307389){_0x1c1890['push'](_0x1c1890['shift']());}};_0x2da9bc(++_0x509e4f);}(_0x6076,0x178));var _0x6607=function(_0x192bbc,_0x1db64a){_0x192bbc=_0x192bbc-0x0;var _0x629da4=_0x6076[_0x192bbc];return _0x629da4;};'use strict';var _=require('lodash');var util=require(_0x6607('0x0'));var logger=require(_0x6607('0x1'))(_0x6607('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6607('0x3'));var rimraf=require(_0x6607('0x4'));var config=require('../../config/environment');var attributes=require(_0x6607('0x5'));module[_0x6607('0x6')]=function(_0x8e6439,_0x5841eb){return _0x8e6439[_0x6607('0x7')](_0x6607('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x72c902,_0x2d44a9,_0x2acecb){if(_0x72c902[_0x6607('0x9')](_0x6607('0xa'))){_0x72c902[_0x6607('0xb')]=moment()[_0x6607('0xc')](_0x6607('0xd'));}_0x2acecb(null,_0x72c902);}}});}; \ No newline at end of file +var _0x4762=['api','moment','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x281602,_0x3217ec){var _0x199e21=function(_0xa6d7e){while(--_0xa6d7e){_0x281602['push'](_0x281602['shift']());}};_0x199e21(++_0x3217ec);}(_0x4762,0x17e));var _0x2476=function(_0x16f3bf,_0x36f9d7){_0x16f3bf=_0x16f3bf-0x0;var _0x13583f=_0x4762[_0x16f3bf];return _0x13583f;};'use strict';var _=require('lodash');var util=require(_0x2476('0x0'));var logger=require(_0x2476('0x1'))(_0x2476('0x2'));var moment=require(_0x2476('0x3'));var BPromise=require('bluebird');var rp=require(_0x2476('0x4'));var fs=require('fs');var path=require(_0x2476('0x5'));var rimraf=require(_0x2476('0x6'));var config=require('../../config/environment');var attributes=require(_0x2476('0x7'));module[_0x2476('0x8')]=function(_0x12e5be,_0x226153){return _0x12e5be[_0x2476('0x9')](_0x2476('0xa'),attributes,{'tableName':_0x2476('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44a393,_0x3fcf6f,_0x27bccf){if(_0x44a393[_0x2476('0xc')](_0x2476('0xd'))){_0x44a393['closedAt']=moment()[_0x2476('0xe')](_0x2476('0xf'));}_0x27bccf(null,_0x44a393);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2241e1f..656cb7d 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 _0x33ef=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','omit','ids','spread','debug','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x37ba11,_0x34ff25){var _0x3c445d=function(_0xb2dc3c){while(--_0xb2dc3c){_0x37ba11['push'](_0x37ba11['shift']());}};_0x3c445d(++_0x34ff25);}(_0x33ef,0x11a));var _0xf33e=function(_0x30bf81,_0x4c00c5){_0x30bf81=_0x30bf81-0x0;var _0x148a30=_0x33ef[_0x30bf81];return _0x148a30;};'use strict';var _=require(_0xf33e('0x0'));var util=require(_0xf33e('0x1'));var moment=require(_0xf33e('0x2'));var BPromise=require(_0xf33e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf33e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf33e('0x5'));var logger=require(_0xf33e('0x6'))(_0xf33e('0x7'));var config=require('../../config/environment');var jayson=require(_0xf33e('0x8'));var client=jayson[_0xf33e('0x9')][_0xf33e('0xa')]({'port':0x232a});config[_0xf33e('0xb')]=_[_0xf33e('0xc')](config['redis'],{'host':_0xf33e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf33e('0xb')]));require(_0xf33e('0xe'))['register'](socket);function respondWithRpcPromise(_0x1c06c8,_0x845cc1,_0x567908){return new BPromise(function(_0x314d13,_0x5b6b45){return client[_0xf33e('0xf')](_0x1c06c8,_0x567908)['then'](function(_0xa97c23){logger[_0xf33e('0x10')](_0xf33e('0x11'),_0x845cc1,_0xf33e('0x12'));logger['debug'](_0xf33e('0x13'),_0x845cc1,'request\x20sent',JSON[_0xf33e('0x14')](_0xa97c23));if(_0xa97c23['error']){if(_0xa97c23[_0xf33e('0x15')][_0xf33e('0x16')]===0x1f4){logger[_0xf33e('0x15')](_0xf33e('0x11'),_0x845cc1,_0xa97c23[_0xf33e('0x15')][_0xf33e('0x17')]);return _0x5b6b45(_0xa97c23[_0xf33e('0x15')][_0xf33e('0x17')]);}logger[_0xf33e('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x845cc1,_0xa97c23[_0xf33e('0x15')][_0xf33e('0x17')]);return _0x314d13(_0xa97c23[_0xf33e('0x15')][_0xf33e('0x17')]);}else{logger[_0xf33e('0x10')](_0xf33e('0x11'),_0x845cc1,'request\x20sent');_0x314d13(_0xa97c23[_0xf33e('0x18')][_0xf33e('0x17')]);}})[_0xf33e('0x19')](function(_0xc6648e){logger[_0xf33e('0x15')](_0xf33e('0x11'),_0x845cc1,_0xc6648e);_0x5b6b45(_0xc6648e);});});}exports[_0xf33e('0x1a')]=function(_0xf46828){var _0x21f1a9=this;return new Promise(function(_0x390a2c,_0x236dbd){return db[_0xf33e('0x1b')]['update'](_0xf46828[_0xf33e('0x1c')],{'raw':_0xf46828[_0xf33e('0x1d')]?_0xf46828['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf46828[_0xf33e('0x1d')]?_0xf46828['options']['where']||null:null,'attributes':_0xf46828[_0xf33e('0x1d')]?_0xf46828[_0xf33e('0x1d')][_0xf33e('0x1e')]||null:null,'limit':_0xf46828[_0xf33e('0x1d')]?_0xf46828[_0xf33e('0x1d')][_0xf33e('0x1f')]||null:null})[_0xf33e('0x20')](function(_0x577406){logger[_0xf33e('0x10')](_0xf33e('0x1a'),_0xf46828);logger['debug']('UpdateSmsInteraction',_0xf46828,JSON[_0xf33e('0x14')](_0x577406));_0x390a2c(_0x577406);})[_0xf33e('0x19')](function(_0x472399){logger['error'](_0xf33e('0x1a'),_0x472399[_0xf33e('0x17')],_0xf46828);_0x236dbd(_0x21f1a9[_0xf33e('0x15')](0x1f4,_0x472399[_0xf33e('0x17')]));});});};exports[_0xf33e('0x21')]=function(_0x5c7670){return new Promise(function(_0x1437ec,_0x4f3fc2){return db[_0xf33e('0x1b')][_0xf33e('0x22')]({'where':_0x5c7670[_0xf33e('0x1d')]?_0x5c7670[_0xf33e('0x1d')]['where']||null:null})[_0xf33e('0x20')](function(_0x34506c){if(_0x34506c){return _0x34506c[_0xf33e('0x23')](_0x5c7670['body']['ids'],_[_0xf33e('0x24')](_0x5c7670[_0xf33e('0x1c')],[_0xf33e('0x25'),'id'])||{});}})[_0xf33e('0x26')](function(_0x55e638){logger[_0xf33e('0x10')]('AddTags',_0x5c7670);logger[_0xf33e('0x27')](_0xf33e('0x28'),_0x5c7670,JSON[_0xf33e('0x14')](_0x55e638));_0x1437ec(_0x55e638);})['catch'](function(_0x6f575f){logger[_0xf33e('0x15')](_0xf33e('0x28'),_0x6f575f[_0xf33e('0x17')],_0x5c7670);_0x4f3fc2(_this[_0xf33e('0x15')](0x1f4,_0x6f575f[_0xf33e('0x17')]));});});}; \ No newline at end of file +var _0x0fe6=['http','redis','defaults','localhost','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','debug','AddTagsToSmsInteraction','find','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0x0fe6,0x1d5));var _0x60fe=function(_0x175e99,_0x12c4a1){_0x175e99=_0x175e99-0x0;var _0x2f71cd=_0x0fe6[_0x175e99];return _0x2f71cd;};'use strict';var _=require(_0x60fe('0x0'));var util=require(_0x60fe('0x1'));var moment=require('moment');var BPromise=require(_0x60fe('0x2'));var rs=require(_0x60fe('0x3'));var fs=require('fs');var Redis=require(_0x60fe('0x4'));var db=require(_0x60fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x60fe('0x6'))(_0x60fe('0x7'));var config=require(_0x60fe('0x8'));var jayson=require(_0x60fe('0x9'));var client=jayson[_0x60fe('0xa')][_0x60fe('0xb')]({'port':0x232a});config[_0x60fe('0xc')]=_[_0x60fe('0xd')](config['redis'],{'host':_0x60fe('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x60fe('0xc')]));require(_0x60fe('0xf'))[_0x60fe('0x10')](socket);function respondWithRpcPromise(_0x4d4e83,_0x5904e2,_0x1c7d24){return new BPromise(function(_0x1b3789,_0x47b984){return client['request'](_0x4d4e83,_0x1c7d24)[_0x60fe('0x11')](function(_0xda011d){logger[_0x60fe('0x12')](_0x60fe('0x13'),_0x5904e2,_0x60fe('0x14'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x5904e2,_0x60fe('0x14'),JSON[_0x60fe('0x15')](_0xda011d));if(_0xda011d[_0x60fe('0x16')]){if(_0xda011d['error']['code']===0x1f4){logger['error'](_0x60fe('0x13'),_0x5904e2,_0xda011d[_0x60fe('0x16')][_0x60fe('0x17')]);return _0x47b984(_0xda011d[_0x60fe('0x16')][_0x60fe('0x17')]);}logger[_0x60fe('0x16')](_0x60fe('0x13'),_0x5904e2,_0xda011d['error']['message']);return _0x1b3789(_0xda011d[_0x60fe('0x16')][_0x60fe('0x17')]);}else{logger[_0x60fe('0x12')](_0x60fe('0x13'),_0x5904e2,_0x60fe('0x14'));_0x1b3789(_0xda011d[_0x60fe('0x18')][_0x60fe('0x17')]);}})[_0x60fe('0x19')](function(_0x4eaaa5){logger['error'](_0x60fe('0x13'),_0x5904e2,_0x4eaaa5);_0x47b984(_0x4eaaa5);});});}exports[_0x60fe('0x1a')]=function(_0x24b04b){var _0x2ad53e=this;return new Promise(function(_0x42ee13,_0x1048b7){return db[_0x60fe('0x1b')]['update'](_0x24b04b[_0x60fe('0x1c')],{'raw':_0x24b04b[_0x60fe('0x1d')]?_0x24b04b[_0x60fe('0x1d')][_0x60fe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24b04b[_0x60fe('0x1d')]?_0x24b04b[_0x60fe('0x1d')][_0x60fe('0x1f')]||null:null,'attributes':_0x24b04b[_0x60fe('0x1d')]?_0x24b04b[_0x60fe('0x1d')][_0x60fe('0x20')]||null:null,'limit':_0x24b04b[_0x60fe('0x1d')]?_0x24b04b[_0x60fe('0x1d')][_0x60fe('0x21')]||null:null})[_0x60fe('0x11')](function(_0xd8d531){logger[_0x60fe('0x12')](_0x60fe('0x1a'),_0x24b04b);logger[_0x60fe('0x22')]('UpdateSmsInteraction',_0x24b04b,JSON[_0x60fe('0x15')](_0xd8d531));_0x42ee13(_0xd8d531);})[_0x60fe('0x19')](function(_0xf60ed){logger[_0x60fe('0x16')]('UpdateSmsInteraction',_0xf60ed['message'],_0x24b04b);_0x1048b7(_0x2ad53e['error'](0x1f4,_0xf60ed[_0x60fe('0x17')]));});});};exports[_0x60fe('0x23')]=function(_0x58f8f0){return new Promise(function(_0x2b4b6f,_0x2c5f0f){return db[_0x60fe('0x1b')][_0x60fe('0x24')]({'where':_0x58f8f0['options']?_0x58f8f0[_0x60fe('0x1d')]['where']||null:null})['then'](function(_0x2be4a4){if(_0x2be4a4){return _0x2be4a4['addTags'](_0x58f8f0[_0x60fe('0x1c')][_0x60fe('0x25')],_['omit'](_0x58f8f0[_0x60fe('0x1c')],[_0x60fe('0x25'),'id'])||{});}})[_0x60fe('0x26')](function(_0x5530ae){logger[_0x60fe('0x12')](_0x60fe('0x27'),_0x58f8f0);logger[_0x60fe('0x22')](_0x60fe('0x27'),_0x58f8f0,JSON[_0x60fe('0x15')](_0x5530ae));_0x2b4b6f(_0x5530ae);})[_0x60fe('0x19')](function(_0x2cbca7){logger['error'](_0x60fe('0x27'),_0x2cbca7['message'],_0x58f8f0);_0x2c5f0f(_this[_0x60fe('0x16')](0x1f4,_0x2cbca7[_0x60fe('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 2ec16a2..32ae2c7 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 _0x76ba=['smsInteraction:','./smsInteraction.events','save','remove','removeListener','register'];(function(_0x31ed6a,_0x1b307a){var _0x5775e4=function(_0x10cde7){while(--_0x10cde7){_0x31ed6a['push'](_0x31ed6a['shift']());}};_0x5775e4(++_0x1b307a);}(_0x76ba,0x1ab));var _0xa76b=function(_0x376db4,_0x957804){_0x376db4=_0x376db4-0x0;var _0x5ab213=_0x76ba[_0x376db4];return _0x5ab213;};'use strict';var SmsInteractionEvents=require(_0xa76b('0x0'));var events=[_0xa76b('0x1'),_0xa76b('0x2'),'update'];function createListener(_0x1d9448,_0x48676f){return function(_0x3d6411){_0x48676f['emit'](_0x1d9448,_0x3d6411);};}function removeListener(_0x590fd4,_0x9a3c83){return function(){SmsInteractionEvents[_0xa76b('0x3')](_0x590fd4,_0x9a3c83);};}exports[_0xa76b('0x4')]=function(_0x44dba4){for(var _0x3476b0=0x0,_0x3cbba4=events['length'];_0x3476b0<_0x3cbba4;_0x3476b0++){var _0x434fd3=events[_0x3476b0];var _0x465465=createListener(_0xa76b('0x5')+_0x434fd3,_0x44dba4);SmsInteractionEvents['on'](_0x434fd3,_0x465465);}}; \ No newline at end of file +var _0x74e5=['./smsInteraction.events','remove','emit','removeListener','register'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x74e5,0x172));var _0x574e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x74e5[_0x47e7cb];return _0x2a8874;};'use strict';var SmsInteractionEvents=require(_0x574e('0x0'));var events=['save',_0x574e('0x1'),'update'];function createListener(_0xfe24dd,_0x42224d){return function(_0x111b9d){_0x42224d[_0x574e('0x2')](_0xfe24dd,_0x111b9d);};}function removeListener(_0x5cc6a7,_0x2d3abd){return function(){SmsInteractionEvents[_0x574e('0x3')](_0x5cc6a7,_0x2d3abd);};}exports[_0x574e('0x4')]=function(_0x477d7c){for(var _0x4d2d58=0x0,_0x58be00=events['length'];_0x4d2d58<_0x58be00;_0x4d2d58++){var _0x533dcf=events[_0x4d2d58];var _0x5a9c39=createListener('smsInteraction:'+_0x533dcf,_0x477d7c);SmsInteractionEvents['on'](_0x533dcf,_0x5a9c39);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 14b8ff8..ef46802 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 _0xe5c7=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','accept','delete','destroy','multer','util','path','connect-timeout'];(function(_0x23713a,_0x36a010){var _0x53c393=function(_0x512deb){while(--_0x512deb){_0x23713a['push'](_0x23713a['shift']());}};_0x53c393(++_0x36a010);}(_0xe5c7,0x1d8));var _0x7e5c=function(_0x345457,_0x365822){_0x345457=_0x345457-0x0;var _0x4a32e2=_0xe5c7[_0x345457];return _0x4a32e2;};'use strict';var multer=require(_0x7e5c('0x0'));var util=require(_0x7e5c('0x1'));var path=require(_0x7e5c('0x2'));var timeout=require(_0x7e5c('0x3'));var express=require(_0x7e5c('0x4'));var router=express['Router']();var auth=require(_0x7e5c('0x5'));var interaction=require(_0x7e5c('0x6'));var config=require(_0x7e5c('0x7'));var controller=require(_0x7e5c('0x8'));router[_0x7e5c('0x9')]('/',auth[_0x7e5c('0xa')](),controller[_0x7e5c('0xb')]);router[_0x7e5c('0x9')](_0x7e5c('0xc'),auth[_0x7e5c('0xa')](),controller[_0x7e5c('0xd')]);router[_0x7e5c('0x9')](_0x7e5c('0xe'),auth[_0x7e5c('0xa')](),controller[_0x7e5c('0xf')]);router[_0x7e5c('0x10')]('/',auth[_0x7e5c('0xa')](),interaction[_0x7e5c('0x11')](_0x7e5c('0x12'),_0x7e5c('0x13')),controller[_0x7e5c('0x14')]);router[_0x7e5c('0x10')](_0x7e5c('0x15'),controller[_0x7e5c('0x16')]);router[_0x7e5c('0x17')](_0x7e5c('0xe'),auth['isAuthenticated'](),controller[_0x7e5c('0x18')]);router[_0x7e5c('0x17')]('/:id/accept',auth[_0x7e5c('0xa')](),controller[_0x7e5c('0x19')]);router[_0x7e5c('0x17')]('/:id/reject',auth[_0x7e5c('0xa')](),controller['reject']);router[_0x7e5c('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x7e5c('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xeb7f=['../../config/environment','./smsMessage.controller','get','index','/describe','/:id','show','isAuthenticated','sms','create','/:id/status','status','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x44e083,_0x12dec9){var _0x3a7d20=function(_0x1fbc32){while(--_0x1fbc32){_0x44e083['push'](_0x44e083['shift']());}};_0x3a7d20(++_0x12dec9);}(_0xeb7f,0x80));var _0xfeb7=function(_0x257544,_0x524c55){_0x257544=_0x257544-0x0;var _0x589d7d=_0xeb7f[_0x257544];return _0x589d7d;};'use strict';var multer=require(_0xfeb7('0x0'));var util=require(_0xfeb7('0x1'));var path=require(_0xfeb7('0x2'));var timeout=require(_0xfeb7('0x3'));var express=require('express');var router=express[_0xfeb7('0x4')]();var auth=require(_0xfeb7('0x5'));var interaction=require(_0xfeb7('0x6'));var config=require(_0xfeb7('0x7'));var controller=require(_0xfeb7('0x8'));router[_0xfeb7('0x9')]('/',auth['isAuthenticated'](),controller[_0xfeb7('0xa')]);router[_0xfeb7('0x9')](_0xfeb7('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xfeb7('0x9')](_0xfeb7('0xc'),auth['isAuthenticated'](),controller[_0xfeb7('0xd')]);router['post']('/',auth[_0xfeb7('0xe')](),interaction['tracked'](_0xfeb7('0xf'),'smsmessage:create'),controller[_0xfeb7('0x10')]);router['post'](_0xfeb7('0x11'),controller[_0xfeb7('0x12')]);router['put']('/:id',auth[_0xfeb7('0xe')](),controller['update']);router['put'](_0xfeb7('0x13'),auth['isAuthenticated'](),controller[_0xfeb7('0x14')]);router[_0xfeb7('0x15')](_0xfeb7('0x16'),auth[_0xfeb7('0xe')](),controller[_0xfeb7('0x17')]);router[_0xfeb7('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xfeb7('0x19')]);module[_0xfeb7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 21b2133..738803c 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 _0xbdb9=['TEXT','medium','BOOLEAN','out','sequelize','exports'];(function(_0x3ea234,_0x33a724){var _0x292ea3=function(_0x402a3c){while(--_0x402a3c){_0x3ea234['push'](_0x3ea234['shift']());}};_0x292ea3(++_0x33a724);}(_0xbdb9,0xac));var _0x9bdb=function(_0x15e455,_0x67f656){_0x15e455=_0x15e455-0x0;var _0x1175f9=_0xbdb9[_0x15e455];return _0x1175f9;};'use strict';var Sequelize=require(_0x9bdb('0x0'));module[_0x9bdb('0x1')]={'body':{'type':Sequelize[_0x9bdb('0x2')](_0x9bdb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9bdb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9bdb('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x9bdb('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x308a=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','STRING'];(function(_0x157712,_0xc29e01){var _0x23e9d9=function(_0x492bf5){while(--_0x492bf5){_0x157712['push'](_0x157712['shift']());}};_0x23e9d9(++_0xc29e01);}(_0x308a,0x71));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa308('0x0'));module['exports']={'body':{'type':Sequelize[_0xa308('0x1')](_0xa308('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa308('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa308('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa308('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa308('0x5')]},'readAt':{'type':Sequelize[_0xa308('0x6')]},'secret':{'type':Sequelize[_0xa308('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 87558a3..00f0bfe 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 _0x26cd=['send','index','SmsMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','show','params','find','create','body','destroy','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','interface','SIP/%s','channel','EventManager','acceptmessage','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','event','rejectmessage','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','request-promise','moment','mustache','path','ejs','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','name'];(function(_0x3872da,_0x3cb966){var _0x1f0e78=function(_0x49b5d9){while(--_0x49b5d9){_0x3872da['push'](_0x3872da['shift']());}};_0x1f0e78(++_0x3cb966);}(_0x26cd,0x1cc));var _0xd26c=function(_0x150e39,_0x467ceb){_0x150e39=_0x150e39-0x0;var _0x3a855d=_0x26cd[_0x150e39];return _0x3a855d;};'use strict';var pdf=require(_0xd26c('0x0'));var emlformat=require(_0xd26c('0x1'));var rimraf=require(_0xd26c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd26c('0x3'));var moment=require(_0xd26c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd26c('0x5'));var util=require('util');var path=require(_0xd26c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd26c('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd26c('0x8'));var jsforce=require(_0xd26c('0x9'));var deskjs=require(_0xd26c('0xa'));var toCsv=require(_0xd26c('0xb'));var querystring=require('querystring');var Papa=require(_0xd26c('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd26c('0xd'));var hardwareService=require(_0xd26c('0xe'));var logger=require(_0xd26c('0xf'))(_0xd26c('0x10'));var utils=require(_0xd26c('0x11'));var config=require('../../config/environment');var db=require(_0xd26c('0x12'))['db'];config[_0xd26c('0x13')]=_[_0xd26c('0x14')](config[_0xd26c('0x13')],{'host':_0xd26c('0x15'),'port':0x18eb});var socket=require(_0xd26c('0x16'))(new Redis(config[_0xd26c('0x13')]));require('./smsMessage.socket')[_0xd26c('0x17')](socket);var jayson=require(_0xd26c('0x18'));var client=jayson[_0xd26c('0x19')][_0xd26c('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xd26c('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3d3d08,_0x594012,_0x3166fa){if(_0x3166fa){var _0x4aaedc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4aaedc[_0xd26c('0x1b')](_0x594012)){return _0x3d3d08;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3d3d08;}}function respondWithRpcPromise(_0x786ef1,_0xc39f0b,_0x1427c1,_0x51f5f8){return new BPromise(function(_0x5de94c,_0x48d37c){var _0x1ebec9=_0x51f5f8||client;return _0x1ebec9['request'](_0x786ef1,_0x1427c1)[_0xd26c('0x1c')](function(_0x7a57a7){logger[_0xd26c('0x1d')](_0xd26c('0x1e'),_0xc39f0b,'request\x20sent');logger[_0xd26c('0x1f')](_0xd26c('0x20'),_0xc39f0b,_0xd26c('0x21'),JSON[_0xd26c('0x22')](_0x7a57a7));if(_0x7a57a7[_0xd26c('0x23')]){if(_0x7a57a7[_0xd26c('0x23')][_0xd26c('0x24')]===0x1f4){logger[_0xd26c('0x23')](_0xd26c('0x1e'),_0xc39f0b,_0x7a57a7[_0xd26c('0x23')][_0xd26c('0x25')]);return _0x48d37c(_0x7a57a7[_0xd26c('0x23')][_0xd26c('0x25')]);}logger[_0xd26c('0x23')](_0xd26c('0x1e'),_0xc39f0b,_0x7a57a7[_0xd26c('0x23')][_0xd26c('0x25')]);return _0x5de94c(_0x7a57a7['error'][_0xd26c('0x25')]);}else{logger[_0xd26c('0x1d')]('SmsMessage,\x20%s,\x20%s',_0xc39f0b,_0xd26c('0x21'));_0x5de94c(_0x7a57a7[_0xd26c('0x26')][_0xd26c('0x25')]);}})[_0xd26c('0x27')](function(_0x37a672){logger[_0xd26c('0x23')](_0xd26c('0x1e'),_0xc39f0b,_0x37a672);_0x48d37c(_0x37a672);});});}function respondWithStatusCode(_0x1fb40a,_0x5e5923){_0x5e5923=_0x5e5923||0xcc;return function(_0x1ea3a1){if(_0x1ea3a1){return _0x1fb40a[_0xd26c('0x28')](_0x5e5923);}return _0x1fb40a[_0xd26c('0x29')](_0x5e5923)[_0xd26c('0x2a')]();};}function respondWithResult(_0xf7ac6a,_0x188082){_0x188082=_0x188082||0xc8;return function(_0x10a2f1){if(_0x10a2f1){return _0xf7ac6a['status'](_0x188082)[_0xd26c('0x2b')](_0x10a2f1);}};}function respondWithFilteredResult(_0x25eaad,_0x230b9f){return function(_0x13dc53){if(_0x13dc53){var _0x167f1a=_0x13dc53[_0xd26c('0x2c')],_0x115e92=_0x230b9f[_0xd26c('0x2d')],_0x2e53c6=_0x230b9f[_0xd26c('0x2d')]+_0x230b9f['limit'],_0x4840cf;if(_0x2e53c6>=_0x167f1a){_0x2e53c6=_0x167f1a;_0x4840cf=0xc8;}else{_0x4840cf=0xce;}_0x25eaad[_0xd26c('0x29')](_0x4840cf);return _0x25eaad[_0xd26c('0x2e')]('Content-Range',_0x115e92+'-'+_0x2e53c6+'/'+_0x167f1a)[_0xd26c('0x2b')](_0x13dc53);}return null;};}function patchUpdates(_0x5cd35e){return function(_0x2549e0){try{jsonpatch[_0xd26c('0x2f')](_0x2549e0,_0x5cd35e,!![]);}catch(_0x247201){return BPromise[_0xd26c('0x30')](_0x247201);}return _0x2549e0[_0xd26c('0x31')]();};}function saveUpdates(_0xeff8e1,_0x4cf936){return function(_0x1bc491){if(_0x1bc491){return _0x1bc491[_0xd26c('0x32')](_0xeff8e1)[_0xd26c('0x1c')](function(_0x1757eb){return _0x1757eb;});}return null;};}function removeEntity(_0x10573b,_0x28cf01){return function(_0xeac91a){if(_0xeac91a){return _0xeac91a['destroy']()['then'](function(){_0x10573b[_0xd26c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x130f6c,_0x53e02a){return function(_0x575820){if(!_0x575820){_0x130f6c['sendStatus'](0x194);}return _0x575820;};}function handleError(_0x287d3d,_0x192df3){_0x192df3=_0x192df3||0x1f4;return function(_0x331bac){logger['error'](_0x331bac['stack']);if(_0x331bac[_0xd26c('0x33')]){delete _0x331bac[_0xd26c('0x33')];}_0x287d3d[_0xd26c('0x29')](_0x192df3)[_0xd26c('0x34')](_0x331bac);};}exports[_0xd26c('0x35')]=function(_0x5b8669,_0x127708){var _0x1dd390={},_0x167942={},_0x58c42b={'count':0x0,'rows':[]};var _0x5d0658=db[_0xd26c('0x36')][_0xd26c('0x37')];_0x167942[_0xd26c('0x38')]=_[_0xd26c('0x39')](_0x5d0658);_0x167942[_0xd26c('0x3a')]=_[_0xd26c('0x39')](_0x5b8669[_0xd26c('0x3a')]);_0x167942[_0xd26c('0x3b')]=_[_0xd26c('0x3c')](_0x167942[_0xd26c('0x38')],_0x167942[_0xd26c('0x3a')]);_0x1dd390[_0xd26c('0x3d')]=_[_0xd26c('0x3c')](_0x167942['model'],qs[_0xd26c('0x3e')](_0x5b8669['query'][_0xd26c('0x3e')]));_0x1dd390[_0xd26c('0x3d')]=_0x1dd390[_0xd26c('0x3d')][_0xd26c('0x3f')]?_0x1dd390['attributes']:_0x167942[_0xd26c('0x38')];if(!_0x5b8669[_0xd26c('0x3a')][_0xd26c('0x40')]('nolimit')){_0x1dd390['limit']=qs[_0xd26c('0x41')](_0x5b8669[_0xd26c('0x3a')][_0xd26c('0x41')]);_0x1dd390[_0xd26c('0x2d')]=qs[_0xd26c('0x2d')](_0x5b8669[_0xd26c('0x3a')]['offset']);}_0x1dd390['order']=qs[_0xd26c('0x42')](_0x5b8669['query'][_0xd26c('0x42')]);_0x1dd390[_0xd26c('0x43')]=qs[_0xd26c('0x3b')](_['pick'](_0x5b8669[_0xd26c('0x3a')],_0x167942[_0xd26c('0x3b')]));if(_0x5b8669['query']['filter']){_0x1dd390['where']=_[_0xd26c('0x44')](_0x1dd390[_0xd26c('0x43')],{'$or':_[_0xd26c('0x45')](_0x5d0658,function(_0x115067){if(_0x115067[_0xd26c('0x46')][_0xd26c('0x47')]!==_0xd26c('0x48')){var _0x3e6cae={};_0x3e6cae[_0x115067[_0xd26c('0x49')]]={'$like':'%'+_0x5b8669['query']['filter']+'%'};return _0x3e6cae;}})});}_0x1dd390=_[_0xd26c('0x44')]({},_0x1dd390,_0x5b8669[_0xd26c('0x4a')]);var _0xf4fa14={'where':_0x1dd390[_0xd26c('0x43')]};return db[_0xd26c('0x36')]['count'](_0xf4fa14)[_0xd26c('0x1c')](function(_0x32f4d6){_0x58c42b[_0xd26c('0x2c')]=_0x32f4d6;if(_0x5b8669[_0xd26c('0x3a')][_0xd26c('0x4b')]){_0x1dd390[_0xd26c('0x4c')]=[{'all':!![]}];}return db[_0xd26c('0x36')]['findAll'](_0x1dd390);})[_0xd26c('0x1c')](function(_0x22f421){_0x58c42b[_0xd26c('0x4d')]=_0x22f421;return _0x58c42b;})[_0xd26c('0x1c')](respondWithFilteredResult(_0x127708,_0x1dd390))['catch'](handleError(_0x127708,null));};exports[_0xd26c('0x4e')]=function(_0x171fe9,_0x56af9e){var _0x2703f7={'raw':!![],'where':{'id':_0x171fe9[_0xd26c('0x4f')]['id']}},_0x5e917d={};_0x5e917d['model']=_[_0xd26c('0x39')](db[_0xd26c('0x36')]['rawAttributes']);_0x5e917d['query']=_[_0xd26c('0x39')](_0x171fe9[_0xd26c('0x3a')]);_0x5e917d[_0xd26c('0x3b')]=_['intersection'](_0x5e917d['model'],_0x5e917d[_0xd26c('0x3a')]);_0x2703f7[_0xd26c('0x3d')]=_[_0xd26c('0x3c')](_0x5e917d[_0xd26c('0x38')],qs[_0xd26c('0x3e')](_0x171fe9[_0xd26c('0x3a')][_0xd26c('0x3e')]));_0x2703f7[_0xd26c('0x3d')]=_0x2703f7[_0xd26c('0x3d')][_0xd26c('0x3f')]?_0x2703f7[_0xd26c('0x3d')]:_0x5e917d[_0xd26c('0x38')];if(_0x171fe9[_0xd26c('0x3a')][_0xd26c('0x4b')]){_0x2703f7[_0xd26c('0x4c')]=[{'all':!![]}];}_0x2703f7=_[_0xd26c('0x44')]({},_0x2703f7,_0x171fe9[_0xd26c('0x4a')]);return db['SmsMessage'][_0xd26c('0x50')](_0x2703f7)[_0xd26c('0x1c')](handleEntityNotFound(_0x56af9e,null))[_0xd26c('0x1c')](respondWithResult(_0x56af9e,null))['catch'](handleError(_0x56af9e,null));};exports['create']=function(_0x2a0309,_0x299db5){return db[_0xd26c('0x36')][_0xd26c('0x51')](_0x2a0309[_0xd26c('0x52')],{})[_0xd26c('0x1c')](respondWithResult(_0x299db5,0xc9))[_0xd26c('0x27')](handleError(_0x299db5,null));};exports[_0xd26c('0x32')]=function(_0x4ad79f,_0x313c4e){if(_0x4ad79f[_0xd26c('0x52')]['id']){delete _0x4ad79f[_0xd26c('0x52')]['id'];}return db[_0xd26c('0x36')][_0xd26c('0x50')]({'where':{'id':_0x4ad79f[_0xd26c('0x4f')]['id']}})[_0xd26c('0x1c')](handleEntityNotFound(_0x313c4e,null))['then'](saveUpdates(_0x4ad79f['body'],null))[_0xd26c('0x1c')](respondWithResult(_0x313c4e,null))['catch'](handleError(_0x313c4e,null));};exports[_0xd26c('0x53')]=function(_0x384946,_0x29ad74){return db['SmsMessage'][_0xd26c('0x50')]({'where':{'id':_0x384946[_0xd26c('0x4f')]['id']}})[_0xd26c('0x1c')](handleEntityNotFound(_0x29ad74,null))[_0xd26c('0x1c')](removeEntity(_0x29ad74,null))[_0xd26c('0x27')](handleError(_0x29ad74,null));};exports[_0xd26c('0x54')]=function(_0x27b8bc,_0x1ee3f7){return db[_0xd26c('0x36')]['describe']()['then'](respondWithResult(_0x1ee3f7,null))[_0xd26c('0x27')](handleError(_0x1ee3f7,null));};var interaction_log=require(_0xd26c('0xf'))(_0xd26c('0x55'));exports[_0xd26c('0x56')]=function(_0x28d206,_0x297abb,_0xa8eb96){var _0x188a15={'channel':_0xd26c('0x57')};if(_0x28d206[_0xd26c('0x52')]['id']){delete _0x28d206['body']['id'];}_0x28d206[_0xd26c('0x52')][_0xd26c('0x58')]=!![];_0x28d206[_0xd26c('0x52')]['readAt']=moment()[_0xd26c('0x59')](_0xd26c('0x5a'));_0x28d206[_0xd26c('0x52')]['UserId']=_0x28d206['body'][_0xd26c('0x5b')]||_0x28d206[_0xd26c('0x5c')]['id'];return db[_0xd26c('0x36')]['find']({'where':{'id':_0x28d206['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xd26c('0x1c')](handleEntityNotFound(_0x297abb,null))[_0xd26c('0x1c')](saveUpdates(_0x28d206['body'],null))['then'](function(_0x2fe2e7){if(_0x2fe2e7){_0x188a15[_0xd26c('0x25')]=_0x2fe2e7[_0xd26c('0x5d')]({'plain':!![]});return db[_0xd26c('0x5e')][_0xd26c('0x50')]({'where':{'id':_0x2fe2e7['SmsInteractionId']}});}return null;})[_0xd26c('0x1c')](handleEntityNotFound(_0x297abb,null))['then'](function(_0x1c2185){if(_0x1c2185){return _0x1c2185[_0xd26c('0x32')]({'UserId':_0x28d206[_0xd26c('0x52')]['UserId'],'read1stAt':_[_0xd26c('0x5f')](_0x1c2185[_0xd26c('0x60')])?moment()[_0xd26c('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd26c('0x1c')](function(_0x419c8f){if(_0x419c8f){_0x188a15['interaction']=_0x419c8f[_0xd26c('0x5d')]({'plain':!![]});interaction_log[_0xd26c('0x1d')](_0xd26c('0x61'),_0x28d206[_0xd26c('0x5c')]['id'],_0x28d206[_0xd26c('0x5c')][_0xd26c('0x33')],_0x28d206['user'][_0xd26c('0x62')],_0x188a15[_0xd26c('0x63')]['id'],_0x28d206['body']?JSON[_0xd26c('0x22')](_0x28d206[_0xd26c('0x52')]):'null');return respondWithRpcPromise('AcceptMessage',_0xd26c('0x64'),_0x188a15);}return null;})[_0xd26c('0x1c')](function(_0x14d22b){if(_0x14d22b){if(_0x28d206[_0xd26c('0x52')]['manual']){_0x188a15['message'][_0xd26c('0x65')]=util[_0xd26c('0x59')](_0xd26c('0x66'),_0x28d206[_0xd26c('0x5c')]['name']);_0x188a15[_0xd26c('0x25')][_0xd26c('0x67')]=_0x188a15[_0xd26c('0x67')];_0x188a15[_0xd26c('0x25')]['event']=_0xd26c('0x56');return respondWithRpcPromise(_0xd26c('0x68'),_0xd26c('0x68'),{'event':_0xd26c('0x69'),'message':_0x188a15[_0xd26c('0x25')]},client9002)['then'](function(){return _0x188a15;});}return _0x188a15;}return null;})[_0xd26c('0x1c')](respondWithResult(_0x297abb,null))['catch'](handleError(_0x297abb,null));};var interaction_log=require('../../config/logger')(_0xd26c('0x55'));exports[_0xd26c('0x30')]=function(_0x528ec9,_0x1e5c59,_0x3d0f73){var _0x309933={'agent':{},'channel':_0xd26c('0x57')};if(_0x528ec9[_0xd26c('0x52')]['id']){delete _0x528ec9[_0xd26c('0x52')]['id'];}_0x528ec9['body'][_0xd26c('0x5b')]=_0x528ec9[_0xd26c('0x52')][_0xd26c('0x5b')]||_0x528ec9[_0xd26c('0x5c')]['id'];_0x309933[_0xd26c('0x6a')]['id']=_0x528ec9['body'][_0xd26c('0x5b')];return db['SmsMessage'][_0xd26c('0x50')]({'where':{'id':_0x528ec9['params']['id'],'UserId':null}})[_0xd26c('0x1c')](handleEntityNotFound(_0x1e5c59,null))[_0xd26c('0x1c')](function(_0x78779b){if(_0x78779b){_0x309933['message']=_0x78779b['get']({'plain':!![]});return db[_0xd26c('0x5e')][_0xd26c('0x50')]({'where':{'id':_0x78779b[_0xd26c('0x6b')]}});}return null;})[_0xd26c('0x1c')](handleEntityNotFound(_0x1e5c59,null))[_0xd26c('0x1c')](function(_0x3d2217){if(_0x3d2217){_0x309933[_0xd26c('0x63')]=_0x3d2217[_0xd26c('0x5d')]({'plain':!![]});interaction_log['info'](_0xd26c('0x6c'),_0x528ec9[_0xd26c('0x5c')]['id'],_0x528ec9[_0xd26c('0x5c')][_0xd26c('0x33')],_0x528ec9[_0xd26c('0x5c')][_0xd26c('0x62')],_0x309933[_0xd26c('0x63')]['id'],_0x528ec9['body']?JSON['stringify'](_0x528ec9[_0xd26c('0x52')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x309933);}return null;})[_0xd26c('0x1c')](function(_0x287cc9){if(_0x287cc9){_0x287cc9[_0xd26c('0x25')][_0xd26c('0x65')]=util['format'](_0xd26c('0x66'),_0x528ec9[_0xd26c('0x5c')][_0xd26c('0x33')]);_0x287cc9[_0xd26c('0x25')][_0xd26c('0x67')]=_0x309933['channel'];_0x287cc9[_0xd26c('0x25')][_0xd26c('0x6d')]=_0xd26c('0x30');respondWithRpcPromise(_0xd26c('0x68'),_0xd26c('0x68'),{'event':_0xd26c('0x6e'),'message':_0x287cc9[_0xd26c('0x25')]},client9002);return _0x309933;}return null;})[_0xd26c('0x1c')](respondWithResult(_0x1e5c59,null))[_0xd26c('0x27')](handleError(_0x1e5c59,null));};exports[_0xd26c('0x29')]=function(_0x2c2719,_0x52efa5,_0x4e704f){if(_0x2c2719[_0xd26c('0x52')]['id']){delete _0x2c2719['body']['id'];}var _0x4f944c;return db['SmsMessage']['find']({'where':{'id':_0x2c2719[_0xd26c('0x4f')]['id']}})[_0xd26c('0x1c')](handleEntityNotFound(_0x52efa5,null))[_0xd26c('0x1c')](function(_0x2f9ae1){if(_0x2f9ae1){_0x4f944c=_0x2f9ae1;return db['SmsAccount']['find']({'where':{'id':_0x2f9ae1[_0xd26c('0x6f')]}});}})['then'](handleEntityNotFound(_0x52efa5,null))[_0xd26c('0x1c')](function(_0x56a49e){if(_0x56a49e){logger[_0xd26c('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd26c('0x29'),'received\x20delivery\x20report\x20from',_0x56a49e[_0xd26c('0x46')],util[_0xd26c('0x70')](_0x2c2719['body'],{'showHidden':![],'depth':null}));switch(_0x56a49e[_0xd26c('0x46')]){case _0xd26c('0x71'):if(_0x2c2719[_0xd26c('0x52')][_0xd26c('0x72')]&&_0x2c2719['body'][_0xd26c('0x72')]===_0x4f944c[_0xd26c('0x73')]){return _0x4f944c[_0xd26c('0x32')]({'read':!![]});}else{logger[_0xd26c('0x23')](_0xd26c('0x74'),_0xd26c('0x29'),_0xd26c('0x71'),util[_0xd26c('0x70')](_0x2c2719['body'],{'showHidden':![],'depth':null}));}break;case _0xd26c('0x75'):if(_0x2c2719[_0xd26c('0x52')][_0xd26c('0x76')]&&_0x2c2719[_0xd26c('0x52')][_0xd26c('0x76')]===_0x4f944c['messageId']&&_[_0xd26c('0x77')]([_0xd26c('0x78'),_0xd26c('0x79')],_0x2c2719[_0xd26c('0x52')][_0xd26c('0x7a')])>=0x0){return _0x4f944c['update']({'read':!![]});}else{logger[_0xd26c('0x23')](_0xd26c('0x74'),_0xd26c('0x29'),_0xd26c('0x7b'),util[_0xd26c('0x70')](_0x2c2719['body'],{'showHidden':![],'depth':null}));}break;case _0xd26c('0x7c'):var _0x1b6ead=_0x2c2719[_0xd26c('0x52')][_0xd26c('0x7d')][0x0];if(_0x1b6ead[_0xd26c('0x29')][_0xd26c('0x7e')]===_0xd26c('0x7f')){return _0x4f944c[_0xd26c('0x32')]({'read':!![]});}else{logger[_0xd26c('0x23')](_0xd26c('0x74'),_0xd26c('0x29'),_0xd26c('0x7c'),util[_0xd26c('0x70')](_0x2c2719['body'],{'showHidden':![],'depth':null}));}break;}return _0x4f944c;}})[_0xd26c('0x1c')](respondWithResult(_0x52efa5,null))[_0xd26c('0x27')](handleError(_0x52efa5,null));}; \ No newline at end of file +var _0xe787=['MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','infobip','results','DELIVERED','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','test','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','reject','save','update','destroy','name','SmsMessage','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','SmsInteraction','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','interface','channel','event','EventManager','acceptmessage','sms','agent','info','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe787,0x109));var _0x7e78=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xe787[_0x576d8a];return _0x3dc3ef;};'use strict';var pdf=require(_0x7e78('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7e78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e78('0x2'));var rp=require('request-promise');var moment=require(_0x7e78('0x3'));var BPromise=require(_0x7e78('0x4'));var Mustache=require(_0x7e78('0x5'));var util=require(_0x7e78('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7e78('0x7'));var crypto=require(_0x7e78('0x8'));var jsforce=require(_0x7e78('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x7e78('0xa'));var querystring=require(_0x7e78('0xb'));var Papa=require('papaparse');var Redis=require(_0x7e78('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7e78('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e78('0xe'))(_0x7e78('0xf'));var utils=require(_0x7e78('0x10'));var config=require(_0x7e78('0x11'));var db=require(_0x7e78('0x12'))['db'];config[_0x7e78('0x13')]=_[_0x7e78('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e78('0x15'))(new Redis(config[_0x7e78('0x13')]));require(_0x7e78('0x16'))[_0x7e78('0x17')](socket);var jayson=require(_0x7e78('0x18'));var client=jayson['client'][_0x7e78('0x19')]({'port':0x232c});var client9002=jayson[_0x7e78('0x1a')][_0x7e78('0x19')]({'port':0x232a});function checkPasswordPattern(_0xa826ec,_0x356569,_0x40127c){if(_0x40127c){var _0x1409f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1409f0[_0x7e78('0x1b')](_0x356569)){return _0xa826ec;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xa826ec;}}function respondWithRpcPromise(_0x97a9b5,_0x447f00,_0x430634,_0x3909fd){return new BPromise(function(_0x26f49b,_0x335981){var _0x4e6abc=_0x3909fd||client;return _0x4e6abc[_0x7e78('0x1c')](_0x97a9b5,_0x430634)[_0x7e78('0x1d')](function(_0x3dd315){logger['info'](_0x7e78('0x1e'),_0x447f00,'request\x20sent');logger[_0x7e78('0x1f')](_0x7e78('0x20'),_0x447f00,_0x7e78('0x21'),JSON[_0x7e78('0x22')](_0x3dd315));if(_0x3dd315[_0x7e78('0x23')]){if(_0x3dd315[_0x7e78('0x23')][_0x7e78('0x24')]===0x1f4){logger[_0x7e78('0x23')]('SmsMessage,\x20%s,\x20%s',_0x447f00,_0x3dd315['error'][_0x7e78('0x25')]);return _0x335981(_0x3dd315['error'][_0x7e78('0x25')]);}logger[_0x7e78('0x23')](_0x7e78('0x1e'),_0x447f00,_0x3dd315[_0x7e78('0x23')][_0x7e78('0x25')]);return _0x26f49b(_0x3dd315['error']['message']);}else{logger['info'](_0x7e78('0x1e'),_0x447f00,'request\x20sent');_0x26f49b(_0x3dd315[_0x7e78('0x26')]['message']);}})[_0x7e78('0x27')](function(_0x369789){logger[_0x7e78('0x23')](_0x7e78('0x1e'),_0x447f00,_0x369789);_0x335981(_0x369789);});});}function respondWithStatusCode(_0x241834,_0x22a9e3){_0x22a9e3=_0x22a9e3||0xcc;return function(_0xdc49be){if(_0xdc49be){return _0x241834[_0x7e78('0x28')](_0x22a9e3);}return _0x241834[_0x7e78('0x29')](_0x22a9e3)[_0x7e78('0x2a')]();};}function respondWithResult(_0xb64cee,_0xb80fbb){_0xb80fbb=_0xb80fbb||0xc8;return function(_0x47b4bb){if(_0x47b4bb){return _0xb64cee['status'](_0xb80fbb)[_0x7e78('0x2b')](_0x47b4bb);}};}function respondWithFilteredResult(_0xbeb6f5,_0x4747f9){return function(_0x1820e6){if(_0x1820e6){var _0x161265=_0x1820e6[_0x7e78('0x2c')],_0x1690dd=_0x4747f9[_0x7e78('0x2d')],_0x33b476=_0x4747f9[_0x7e78('0x2d')]+_0x4747f9[_0x7e78('0x2e')],_0x39c676;if(_0x33b476>=_0x161265){_0x33b476=_0x161265;_0x39c676=0xc8;}else{_0x39c676=0xce;}_0xbeb6f5[_0x7e78('0x29')](_0x39c676);return _0xbeb6f5['set']('Content-Range',_0x1690dd+'-'+_0x33b476+'/'+_0x161265)[_0x7e78('0x2b')](_0x1820e6);}return null;};}function patchUpdates(_0x10ae49){return function(_0x166adb){try{jsonpatch['apply'](_0x166adb,_0x10ae49,!![]);}catch(_0x12019e){return BPromise[_0x7e78('0x2f')](_0x12019e);}return _0x166adb[_0x7e78('0x30')]();};}function saveUpdates(_0x48a1c9,_0x323ca5){return function(_0x2738ca){if(_0x2738ca){return _0x2738ca[_0x7e78('0x31')](_0x48a1c9)[_0x7e78('0x1d')](function(_0xaea738){return _0xaea738;});}return null;};}function removeEntity(_0x15bb5d,_0x3bb436){return function(_0x139629){if(_0x139629){return _0x139629[_0x7e78('0x32')]()[_0x7e78('0x1d')](function(){_0x15bb5d[_0x7e78('0x29')](0xcc)[_0x7e78('0x2a')]();});}};}function handleEntityNotFound(_0x7516c8,_0x7aa731){return function(_0x11c52d){if(!_0x11c52d){_0x7516c8['sendStatus'](0x194);}return _0x11c52d;};}function handleError(_0x5b3fd2,_0xb2b64){_0xb2b64=_0xb2b64||0x1f4;return function(_0x1abd87){logger[_0x7e78('0x23')](_0x1abd87['stack']);if(_0x1abd87[_0x7e78('0x33')]){delete _0x1abd87[_0x7e78('0x33')];}_0x5b3fd2[_0x7e78('0x29')](_0xb2b64)['send'](_0x1abd87);};}exports['index']=function(_0xe43bb2,_0x3e047a){var _0x556f6d={},_0x24a201={},_0x571b42={'count':0x0,'rows':[]};var _0x3329bd=db[_0x7e78('0x34')]['rawAttributes'];_0x24a201[_0x7e78('0x35')]=_['keys'](_0x3329bd);_0x24a201[_0x7e78('0x36')]=_[_0x7e78('0x37')](_0xe43bb2[_0x7e78('0x36')]);_0x24a201[_0x7e78('0x38')]=_[_0x7e78('0x39')](_0x24a201[_0x7e78('0x35')],_0x24a201['query']);_0x556f6d[_0x7e78('0x3a')]=_['intersection'](_0x24a201[_0x7e78('0x35')],qs[_0x7e78('0x3b')](_0xe43bb2[_0x7e78('0x36')][_0x7e78('0x3b')]));_0x556f6d[_0x7e78('0x3a')]=_0x556f6d['attributes'][_0x7e78('0x3c')]?_0x556f6d[_0x7e78('0x3a')]:_0x24a201[_0x7e78('0x35')];if(!_0xe43bb2[_0x7e78('0x36')][_0x7e78('0x3d')]('nolimit')){_0x556f6d[_0x7e78('0x2e')]=qs[_0x7e78('0x2e')](_0xe43bb2[_0x7e78('0x36')][_0x7e78('0x2e')]);_0x556f6d[_0x7e78('0x2d')]=qs[_0x7e78('0x2d')](_0xe43bb2[_0x7e78('0x36')][_0x7e78('0x2d')]);}_0x556f6d[_0x7e78('0x3e')]=qs[_0x7e78('0x3f')](_0xe43bb2[_0x7e78('0x36')][_0x7e78('0x3f')]);_0x556f6d[_0x7e78('0x40')]=qs[_0x7e78('0x38')](_[_0x7e78('0x41')](_0xe43bb2[_0x7e78('0x36')],_0x24a201[_0x7e78('0x38')]));if(_0xe43bb2[_0x7e78('0x36')][_0x7e78('0x42')]){_0x556f6d[_0x7e78('0x40')]=_[_0x7e78('0x43')](_0x556f6d['where'],{'$or':_['map'](_0x3329bd,function(_0x58f60d){if(_0x58f60d[_0x7e78('0x44')]['key']!==_0x7e78('0x45')){var _0x321ee8={};_0x321ee8[_0x58f60d[_0x7e78('0x46')]]={'$like':'%'+_0xe43bb2['query']['filter']+'%'};return _0x321ee8;}})});}_0x556f6d=_['merge']({},_0x556f6d,_0xe43bb2[_0x7e78('0x47')]);var _0x1a8a34={'where':_0x556f6d['where']};return db[_0x7e78('0x34')][_0x7e78('0x2c')](_0x1a8a34)['then'](function(_0x1ccd73){_0x571b42[_0x7e78('0x2c')]=_0x1ccd73;if(_0xe43bb2['query']['includeAll']){_0x556f6d[_0x7e78('0x48')]=[{'all':!![]}];}return db[_0x7e78('0x34')][_0x7e78('0x49')](_0x556f6d);})['then'](function(_0x1dc663){_0x571b42[_0x7e78('0x4a')]=_0x1dc663;return _0x571b42;})[_0x7e78('0x1d')](respondWithFilteredResult(_0x3e047a,_0x556f6d))[_0x7e78('0x27')](handleError(_0x3e047a,null));};exports[_0x7e78('0x4b')]=function(_0x4503fb,_0x295d28){var _0x1868f1={'raw':!![],'where':{'id':_0x4503fb[_0x7e78('0x4c')]['id']}},_0xe53bb7={};_0xe53bb7[_0x7e78('0x35')]=_['keys'](db['SmsMessage'][_0x7e78('0x4d')]);_0xe53bb7['query']=_[_0x7e78('0x37')](_0x4503fb[_0x7e78('0x36')]);_0xe53bb7['filters']=_[_0x7e78('0x39')](_0xe53bb7[_0x7e78('0x35')],_0xe53bb7[_0x7e78('0x36')]);_0x1868f1[_0x7e78('0x3a')]=_[_0x7e78('0x39')](_0xe53bb7['model'],qs[_0x7e78('0x3b')](_0x4503fb[_0x7e78('0x36')][_0x7e78('0x3b')]));_0x1868f1[_0x7e78('0x3a')]=_0x1868f1[_0x7e78('0x3a')]['length']?_0x1868f1[_0x7e78('0x3a')]:_0xe53bb7[_0x7e78('0x35')];if(_0x4503fb['query'][_0x7e78('0x4e')]){_0x1868f1['include']=[{'all':!![]}];}_0x1868f1=_[_0x7e78('0x43')]({},_0x1868f1,_0x4503fb['options']);return db[_0x7e78('0x34')][_0x7e78('0x4f')](_0x1868f1)[_0x7e78('0x1d')](handleEntityNotFound(_0x295d28,null))['then'](respondWithResult(_0x295d28,null))[_0x7e78('0x27')](handleError(_0x295d28,null));};exports[_0x7e78('0x50')]=function(_0x1846c6,_0x5d4f30){return db[_0x7e78('0x34')][_0x7e78('0x50')](_0x1846c6[_0x7e78('0x51')],{})[_0x7e78('0x1d')](respondWithResult(_0x5d4f30,0xc9))[_0x7e78('0x27')](handleError(_0x5d4f30,null));};exports[_0x7e78('0x31')]=function(_0x284618,_0x37fa52){if(_0x284618[_0x7e78('0x51')]['id']){delete _0x284618[_0x7e78('0x51')]['id'];}return db[_0x7e78('0x34')][_0x7e78('0x4f')]({'where':{'id':_0x284618[_0x7e78('0x4c')]['id']}})[_0x7e78('0x1d')](handleEntityNotFound(_0x37fa52,null))[_0x7e78('0x1d')](saveUpdates(_0x284618[_0x7e78('0x51')],null))[_0x7e78('0x1d')](respondWithResult(_0x37fa52,null))['catch'](handleError(_0x37fa52,null));};exports[_0x7e78('0x32')]=function(_0x32ae0b,_0x37e066){return db[_0x7e78('0x34')][_0x7e78('0x4f')]({'where':{'id':_0x32ae0b[_0x7e78('0x4c')]['id']}})[_0x7e78('0x1d')](handleEntityNotFound(_0x37e066,null))[_0x7e78('0x1d')](removeEntity(_0x37e066,null))[_0x7e78('0x27')](handleError(_0x37e066,null));};exports['describe']=function(_0x537982,_0x3cb935){return db[_0x7e78('0x34')][_0x7e78('0x52')]()[_0x7e78('0x1d')](respondWithResult(_0x3cb935,null))[_0x7e78('0x27')](handleError(_0x3cb935,null));};var interaction_log=require(_0x7e78('0xe'))(_0x7e78('0x53'));exports[_0x7e78('0x54')]=function(_0x1329da,_0x438c3f,_0x366a62){var _0xd54437={'channel':'sms'};if(_0x1329da['body']['id']){delete _0x1329da['body']['id'];}_0x1329da['body'][_0x7e78('0x55')]=!![];_0x1329da[_0x7e78('0x51')][_0x7e78('0x56')]=moment()[_0x7e78('0x57')](_0x7e78('0x58'));_0x1329da[_0x7e78('0x51')][_0x7e78('0x59')]=_0x1329da[_0x7e78('0x51')][_0x7e78('0x59')]||_0x1329da[_0x7e78('0x5a')]['id'];return db[_0x7e78('0x34')]['find']({'where':{'id':_0x1329da[_0x7e78('0x4c')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x7e78('0x5b')}]})[_0x7e78('0x1d')](handleEntityNotFound(_0x438c3f,null))['then'](saveUpdates(_0x1329da[_0x7e78('0x51')],null))['then'](function(_0x32a1b7){if(_0x32a1b7){_0xd54437[_0x7e78('0x25')]=_0x32a1b7[_0x7e78('0x5c')]({'plain':!![]});return db[_0x7e78('0x5d')][_0x7e78('0x4f')]({'where':{'id':_0x32a1b7['SmsInteractionId']}});}return null;})[_0x7e78('0x1d')](handleEntityNotFound(_0x438c3f,null))[_0x7e78('0x1d')](function(_0x476e96){if(_0x476e96){return _0x476e96[_0x7e78('0x31')]({'UserId':_0x1329da['body']['UserId'],'read1stAt':_['isNil'](_0x476e96[_0x7e78('0x5e')])?moment()['format'](_0x7e78('0x58')):undefined});}return null;})[_0x7e78('0x1d')](function(_0xdab762){if(_0xdab762){_0xd54437[_0x7e78('0x5f')]=_0xdab762[_0x7e78('0x5c')]({'plain':!![]});interaction_log['info'](_0x7e78('0x60'),_0x1329da[_0x7e78('0x5a')]['id'],_0x1329da['user'][_0x7e78('0x33')],_0x1329da[_0x7e78('0x5a')][_0x7e78('0x61')],_0xd54437[_0x7e78('0x5f')]['id'],_0x1329da['body']?JSON[_0x7e78('0x22')](_0x1329da[_0x7e78('0x51')]):'null');return respondWithRpcPromise('AcceptMessage',_0x7e78('0x62'),_0xd54437);}return null;})[_0x7e78('0x1d')](function(_0x19962d){if(_0x19962d){if(_0x1329da['body']['manual']){_0xd54437[_0x7e78('0x25')][_0x7e78('0x63')]=util[_0x7e78('0x57')]('SIP/%s',_0x1329da[_0x7e78('0x5a')]['name']);_0xd54437[_0x7e78('0x25')][_0x7e78('0x64')]=_0xd54437[_0x7e78('0x64')];_0xd54437[_0x7e78('0x25')][_0x7e78('0x65')]='accept';return respondWithRpcPromise(_0x7e78('0x66'),'EventManager',{'event':_0x7e78('0x67'),'message':_0xd54437['message']},client9002)[_0x7e78('0x1d')](function(){return _0xd54437;});}return _0xd54437;}return null;})[_0x7e78('0x1d')](respondWithResult(_0x438c3f,null))[_0x7e78('0x27')](handleError(_0x438c3f,null));};var interaction_log=require('../../config/logger')(_0x7e78('0x53'));exports['reject']=function(_0x4e615d,_0x17c8ec,_0x561ef8){var _0xa1bcd9={'agent':{},'channel':_0x7e78('0x68')};if(_0x4e615d[_0x7e78('0x51')]['id']){delete _0x4e615d[_0x7e78('0x51')]['id'];}_0x4e615d['body'][_0x7e78('0x59')]=_0x4e615d[_0x7e78('0x51')]['UserId']||_0x4e615d['user']['id'];_0xa1bcd9[_0x7e78('0x69')]['id']=_0x4e615d[_0x7e78('0x51')][_0x7e78('0x59')];return db[_0x7e78('0x34')]['find']({'where':{'id':_0x4e615d[_0x7e78('0x4c')]['id'],'UserId':null}})[_0x7e78('0x1d')](handleEntityNotFound(_0x17c8ec,null))[_0x7e78('0x1d')](function(_0x530517){if(_0x530517){_0xa1bcd9[_0x7e78('0x25')]=_0x530517[_0x7e78('0x5c')]({'plain':!![]});return db[_0x7e78('0x5d')][_0x7e78('0x4f')]({'where':{'id':_0x530517['SmsInteractionId']}});}return null;})[_0x7e78('0x1d')](handleEntityNotFound(_0x17c8ec,null))[_0x7e78('0x1d')](function(_0x3e2aff){if(_0x3e2aff){_0xa1bcd9[_0x7e78('0x5f')]=_0x3e2aff[_0x7e78('0x5c')]({'plain':!![]});interaction_log[_0x7e78('0x6a')](_0x7e78('0x6b'),_0x4e615d[_0x7e78('0x5a')]['id'],_0x4e615d[_0x7e78('0x5a')]['name'],_0x4e615d[_0x7e78('0x5a')][_0x7e78('0x61')],_0xa1bcd9[_0x7e78('0x5f')]['id'],_0x4e615d[_0x7e78('0x51')]?JSON[_0x7e78('0x22')](_0x4e615d['body']):'null');return respondWithRpcPromise(_0x7e78('0x6c'),_0x7e78('0x6d'),_0xa1bcd9);}return null;})[_0x7e78('0x1d')](function(_0x45f698){if(_0x45f698){_0x45f698['message'][_0x7e78('0x63')]=util['format'](_0x7e78('0x6e'),_0x4e615d['user']['name']);_0x45f698[_0x7e78('0x25')][_0x7e78('0x64')]=_0xa1bcd9[_0x7e78('0x64')];_0x45f698[_0x7e78('0x25')][_0x7e78('0x65')]='reject';respondWithRpcPromise(_0x7e78('0x66'),_0x7e78('0x66'),{'event':_0x7e78('0x6f'),'message':_0x45f698[_0x7e78('0x25')]},client9002);return _0xa1bcd9;}return null;})[_0x7e78('0x1d')](respondWithResult(_0x17c8ec,null))[_0x7e78('0x27')](handleError(_0x17c8ec,null));};exports[_0x7e78('0x29')]=function(_0x5e63b4,_0x264efe,_0x26352b){if(_0x5e63b4[_0x7e78('0x51')]['id']){delete _0x5e63b4[_0x7e78('0x51')]['id'];}var _0x47b13b;return db[_0x7e78('0x34')][_0x7e78('0x4f')]({'where':{'id':_0x5e63b4[_0x7e78('0x4c')]['id']}})[_0x7e78('0x1d')](handleEntityNotFound(_0x264efe,null))['then'](function(_0x1f9c27){if(_0x1f9c27){_0x47b13b=_0x1f9c27;return db[_0x7e78('0x70')][_0x7e78('0x4f')]({'where':{'id':_0x1f9c27[_0x7e78('0x71')]}});}})[_0x7e78('0x1d')](handleEntityNotFound(_0x264efe,null))['then'](function(_0x1b195c){if(_0x1b195c){logger[_0x7e78('0x1f')](_0x7e78('0x20'),_0x7e78('0x29'),'received\x20delivery\x20report\x20from',_0x1b195c[_0x7e78('0x44')],util[_0x7e78('0x72')](_0x5e63b4['body'],{'showHidden':![],'depth':null}));switch(_0x1b195c['type']){case _0x7e78('0x73'):if(_0x5e63b4[_0x7e78('0x51')][_0x7e78('0x74')]&&_0x5e63b4[_0x7e78('0x51')][_0x7e78('0x74')]===_0x47b13b[_0x7e78('0x75')]){return _0x47b13b[_0x7e78('0x31')]({'read':!![]});}else{logger['error'](_0x7e78('0x76'),'status','twilio',util[_0x7e78('0x72')](_0x5e63b4[_0x7e78('0x51')],{'showHidden':![],'depth':null}));}break;case _0x7e78('0x77'):if(_0x5e63b4['body'][_0x7e78('0x78')]&&_0x5e63b4['body'][_0x7e78('0x78')]===_0x47b13b[_0x7e78('0x75')]&&_['indexOf']([_0x7e78('0x79'),_0x7e78('0x7a')],_0x5e63b4[_0x7e78('0x51')][_0x7e78('0x7b')])>=0x0){return _0x47b13b[_0x7e78('0x31')]({'read':!![]});}else{logger[_0x7e78('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','plivio',util[_0x7e78('0x72')](_0x5e63b4['body'],{'showHidden':![],'depth':null}));}break;case _0x7e78('0x7c'):var _0xa87a2b=_0x5e63b4[_0x7e78('0x51')][_0x7e78('0x7d')][0x0];if(_0xa87a2b[_0x7e78('0x29')]['groupName']===_0x7e78('0x7e')){return _0x47b13b[_0x7e78('0x31')]({'read':!![]});}else{logger[_0x7e78('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7e78('0x29'),_0x7e78('0x7c'),util['inspect'](_0x5e63b4[_0x7e78('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x47b13b;}})['then'](respondWithResult(_0x264efe,null))[_0x7e78('0x27')](handleError(_0x264efe,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 9dd95d8..64f6fd7 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 _0x878f=['hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x131c78,_0x48a763){var _0x277d4c=function(_0x6515c5){while(--_0x6515c5){_0x131c78['push'](_0x131c78['shift']());}};_0x277d4c(++_0x48a763);}(_0x878f,0x173));var _0xf878=function(_0x29af5a,_0x521563){_0x29af5a=_0x29af5a-0x0;var _0x1ae9ae=_0x878f[_0x29af5a];return _0x1ae9ae;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xf878('0x0'))['db'][_0xf878('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf878('0x2')](0x0);var events={'afterCreate':_0xf878('0x3'),'afterUpdate':_0xf878('0x4'),'afterDestroy':_0xf878('0x5')};function emitEvent(_0x9e6783){return function(_0x45a37b,_0x240b48,_0xcf1927){SmsMessageEvents[_0xf878('0x6')](_0x9e6783+':'+_0x45a37b['id'],_0x45a37b);SmsMessageEvents['emit'](_0x9e6783,_0x45a37b);_0xcf1927(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xf878('0x7')](e,emitEvent(event));}}module[_0xf878('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x6215=['events','../../mysqldb','SmsMessage','save','update','remove','hook','exports'];(function(_0x4f35d8,_0x110b9c){var _0x54c499=function(_0x39ef6f){while(--_0x39ef6f){_0x4f35d8['push'](_0x4f35d8['shift']());}};_0x54c499(++_0x110b9c);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5621('0x0'));var SmsMessage=require(_0x5621('0x1'))['db'][_0x5621('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5621('0x3'),'afterUpdate':_0x5621('0x4'),'afterDestroy':_0x5621('0x5')};function emitEvent(_0x173213){return function(_0x204284,_0x13397a,_0x492c6d){SmsMessageEvents['emit'](_0x173213+':'+_0x204284['id'],_0x204284);SmsMessageEvents['emit'](_0x173213,_0x204284);_0x492c6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x5621('0x6')](e,emitEvent(event));}}module[_0x5621('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 47a83ad..633936f 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 _0x7cc7=['https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','utf8mb4','api','moment','bluebird','path','rimraf','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','findOne','SmsInteractionId','update','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','create','remote','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','username','password','body','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','connectel','https://smsapi.connectel.se/api/send/','requestid','clicksend','xCALLY\x20Motion','%s:%s','format','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','senderString','token','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','text','timestamp','keys','sort','length','apiKey','createHash','md5','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code'];(function(_0x25bb72,_0x922fef){var _0x2652b2=function(_0x131c21){while(--_0x131c21){_0x25bb72['push'](_0x25bb72['shift']());}};_0x2652b2(++_0x922fef);}(_0x7cc7,0xf2));var _0x77cc=function(_0x3c0a94,_0x43d12d){_0x3c0a94=_0x3c0a94-0x0;var _0x56e0a2=_0x7cc7[_0x3c0a94];return _0x56e0a2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x77cc('0x0'));var moment=require(_0x77cc('0x1'));var BPromise=require(_0x77cc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x77cc('0x3'));var rimraf=require(_0x77cc('0x4'));var config=require('../../config/environment');var attributes=require(_0x77cc('0x5'));module['exports']=function(_0x120b77,_0x19977d){return _0x120b77[_0x77cc('0x6')](_0x77cc('0x7'),attributes,{'tableName':_0x77cc('0x8'),'paranoid':![],'indexes':[{'name':_0x77cc('0x9'),'fields':[_0x77cc('0x9')]},{'name':_0x77cc('0xa'),'fields':['body'],'type':_0x77cc('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x428ed0,_0x11eb8e,_0x1d4606){var _0x3ef8f0=_0x120b77[_0x77cc('0xc')];var _0x17a1a9=_0x428ed0['get']({'plain':!![]});if(_0x17a1a9[_0x77cc('0xd')][_0x77cc('0xe')]()==='in'||_0x17a1a9[_0x77cc('0xd')][_0x77cc('0xe')]()==='out'&&!_0x17a1a9[_0x77cc('0xf')]&&!_[_0x77cc('0x10')](_0x17a1a9['UserId'])){_0x3ef8f0['SmsInteraction'][_0x77cc('0x11')]({'where':{'id':_0x17a1a9[_0x77cc('0x12')]}})['then'](function(_0x380def){if(_0x380def){_0x380def[_0x77cc('0x13')]({'lastMsgAt':_0x17a1a9[_0x77cc('0x14')],'lastMsgDirection':_0x17a1a9[_0x77cc('0xd')][_0x77cc('0xe')]()});}})[_0x77cc('0x15')](function(_0x5b1085){console[_0x77cc('0x16')](_0x5b1085);});}if(_0x17a1a9[_0x77cc('0xd')]===_0x77cc('0x17')&&!_0x17a1a9['secret']){var _0x46ca34;_0x3ef8f0[_0x77cc('0x18')][_0x77cc('0x19')]({'where':{'id':_0x17a1a9[_0x77cc('0x1a')]},'raw':!![]})[_0x77cc('0x1b')](function(_0x57f204){_0x46ca34=_0x57f204;if(_0x46ca34&&_0x46ca34[_0x77cc('0x1c')]){switch(_0x46ca34[_0x77cc('0x1c')]){case _0x77cc('0x1d'):var _0x50324c=require('twilio');if(_0x46ca34[_0x77cc('0x1e')]&&_0x46ca34[_0x77cc('0x1f')]&&_0x46ca34[_0x77cc('0x20')]){var _0x1a001d=new _0x50324c(_0x46ca34[_0x77cc('0x1e')],_0x46ca34[_0x77cc('0x1f')]);_0x1a001d['messages'][_0x77cc('0x21')]({'body':_0x17a1a9['body'],'to':_0x17a1a9['phone'],'from':_0x46ca34[_0x77cc('0x20')],'statusCallback':_0x46ca34[_0x77cc('0x22')]+'/api/sms/messages/'+_0x17a1a9['id']+_0x77cc('0x23')+_0x46ca34['token']})[_0x77cc('0x1b')](function(_0x93cf59){if(_0x93cf59[_0x77cc('0x24')]){return _0x428ed0[_0x77cc('0x13')]({'messageId':_0x93cf59[_0x77cc('0x24')]});}})['catch'](function(_0x530d8b){logger['error'](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x1d'),util[_0x77cc('0x27')](_0x530d8b,{'showHidden':![],'depth':null}));});}else{logger[_0x77cc('0x16')](_0x77cc('0x25'),'afterCreate',_0x77cc('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x77cc('0x28'):var _0xda85e6='https://api.skebby.it/API/v1.0/REST/';if(_0x46ca34[_0x77cc('0x29')]&&_0x46ca34[_0x77cc('0x2a')]){var _0x188ed7={'recipient':[_0x17a1a9[_0x77cc('0x20')]],'message':_0x17a1a9[_0x77cc('0x2b')],'message_type':_0x46ca34[_0x77cc('0x2c')]};if(_0x46ca34[_0x77cc('0x2c')]&&_0x46ca34['smsMethod']!=='SI'){_0x188ed7[_0x77cc('0x2d')]=_0x46ca34[_0x77cc('0x20')];}var _0x4543ae={'url':_0xda85e6+_0x77cc('0x2e')+_0x46ca34[_0x77cc('0x29')]+_0x77cc('0x2f')+_0x46ca34[_0x77cc('0x2a')],'method':_0x77cc('0x30')};rp(_0x4543ae)[_0x77cc('0x1b')](function(_0x11fd42){var _0x3995e3=_0x11fd42[_0x77cc('0x31')](';');var _0x916c83={'user_key':_0x3995e3[0x0],'session_key':_0x3995e3[0x1]};_0x4543ae={'url':_0xda85e6+_0x77cc('0x32'),'method':_0x77cc('0x33'),'headers':{'user_key':_0x916c83[_0x77cc('0x34')],'Session_key':_0x916c83[_0x77cc('0x35')]},'json':!![],'body':_0x188ed7};return rp(_0x4543ae);})['then'](function(_0x5db21c){if(_0x5db21c[_0x77cc('0x36')]>=0x1){var _0x2b1486={'messageId':_0x5db21c['internal_order_id']};if(_0x46ca34['smsMethod']!=='GP'||!_0x46ca34[_0x77cc('0x37')]){_0x2b1486[_0x77cc('0x38')]=!![];}return _0x428ed0['update'](_0x2b1486);}else{return logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x28'),util[_0x77cc('0x27')](_0x5db21c,{'showHidden':![],'depth':null}));}})[_0x77cc('0x15')](function(_0x4761eb){return logger[_0x77cc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77cc('0x26'),_0x77cc('0x28'),util[_0x77cc('0x27')](_0x4761eb,{'showHidden':![],'depth':null}));});}else{logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x28'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x77cc('0x39'):if(_0x46ca34[_0x77cc('0x1f')]){var _0x5d5682={'recipient':_0x17a1a9[_0x77cc('0x20')],'message':_0x17a1a9[_0x77cc('0x2b')],'sender':_0x46ca34['senderString']||_0x46ca34[_0x77cc('0x20')],'authorization':_0x46ca34[_0x77cc('0x1f')]};var _0x11eb8e={'method':'POST','uri':_0x77cc('0x3a'),'body':_0x5d5682,'json':!![]};rp(_0x11eb8e)['then'](function(_0xed9247){var _0x4cff71={'messageId':_0xed9247[_0x77cc('0x3b')]};if(!_0x46ca34[_0x77cc('0x37')]){_0x4cff71[_0x77cc('0x38')]=!![];}return _0x428ed0[_0x77cc('0x13')](_0x4cff71);})[_0x77cc('0x15')](function(_0x1ed73c){logger[_0x77cc('0x16')](_0x77cc('0x25'),'afterCreate',_0x77cc('0x39'),util[_0x77cc('0x27')](_0x1ed73c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x39'),'Missing\x20parameters:\x20authToken');}break;case _0x77cc('0x3c'):if(_0x46ca34[_0x77cc('0x29')]&&_0x46ca34[_0x77cc('0x2a')]){var _0x5d5682={'messages':[{'source':_0x77cc('0x3d'),'to':_0x17a1a9['phone'],'body':_0x17a1a9[_0x77cc('0x2b')],'from':_0x46ca34['senderString']||_0x46ca34['phone']}]};var _0x9317ef=util['format'](_0x77cc('0x3e'),_0x46ca34[_0x77cc('0x29')],_0x46ca34[_0x77cc('0x2a')]);var _0x11eb8e={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x5d5682,'headers':{'Authorization':util[_0x77cc('0x3f')]('Basic\x20%s',new Buffer(_0x9317ef)[_0x77cc('0x40')](_0x77cc('0x41')))},'json':!![]};rp(_0x11eb8e)[_0x77cc('0x1b')](function(_0x48d5d0){if(_0x48d5d0[_0x77cc('0x42')]>=0xc8&&_0x48d5d0['http_code']<=0xce){if(_0x48d5d0[_0x77cc('0x43')]&&_0x48d5d0['data'][_0x77cc('0x44')]>0x0){var _0x1355ac=_[_0x77cc('0x45')](_0x48d5d0[_0x77cc('0x43')][_0x77cc('0x46')]);var _0x5e9fd5={'messageId':_0x1355ac[_0x77cc('0x47')]};if(!_0x46ca34[_0x77cc('0x37')]){_0x5e9fd5[_0x77cc('0x38')]=!![];}return _0x428ed0[_0x77cc('0x13')](_0x5e9fd5);}else{logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x48'),util['inspect'](_0x48d5d0,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x48'),util[_0x77cc('0x27')](_0x48d5d0,{'showHidden':![],'depth':null}));}})[_0x77cc('0x15')](function(_0x59a1df){logger[_0x77cc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77cc('0x26'),_0x77cc('0x48'),util[_0x77cc('0x27')](_0x59a1df,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x77cc('0x49'):if(_0x46ca34[_0x77cc('0x4a')]&&_0x46ca34['authToken']){var _0x5d5682={'dst':_0x17a1a9[_0x77cc('0x20')],'text':_0x17a1a9[_0x77cc('0x2b')],'src':_0x46ca34[_0x77cc('0x4b')]||_0x46ca34[_0x77cc('0x20')],'url':_0x46ca34[_0x77cc('0x22')]+'/api/sms/messages/'+_0x17a1a9['id']+_0x77cc('0x23')+_0x46ca34[_0x77cc('0x4c')]};var _0x9317ef=util[_0x77cc('0x3f')](_0x77cc('0x3e'),_0x46ca34[_0x77cc('0x4a')],_0x46ca34[_0x77cc('0x1f')]);var _0x11eb8e={'method':_0x77cc('0x33'),'uri':util[_0x77cc('0x3f')]('https://api.plivo.com/v1/Account/%s/Message/',_0x46ca34[_0x77cc('0x4a')]),'body':_0x5d5682,'headers':{'Authorization':util[_0x77cc('0x3f')]('Basic\x20%s',new Buffer(_0x9317ef)['toString']('base64'))},'json':!![]};rp(_0x11eb8e)[_0x77cc('0x1b')](function(_0x87ad71){var _0xf5d360={'messageId':_0x87ad71[_0x77cc('0x4d')][0x0]};return _0x428ed0[_0x77cc('0x13')](_0xf5d360);})[_0x77cc('0x15')](function(_0x5c0f9f){logger[_0x77cc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x77cc('0x49'),util[_0x77cc('0x27')](_0x5c0f9f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x77cc('0x25'),_0x77cc('0x26'),'plivo',_0x77cc('0x4e'));}break;case _0x77cc('0x4f'):if(_0x46ca34['username']&&_0x46ca34[_0x77cc('0x2a')]){if(_0x46ca34[_0x77cc('0x50')]){var _0x89be1b={'method':_0x77cc('0x33'),'uri':_0x46ca34[_0x77cc('0x50')]+_0x77cc('0x51'),'body':{'username':_0x46ca34[_0x77cc('0x29')],'password':_0x46ca34[_0x77cc('0x2a')]},'json':!![]};return rp(_0x89be1b)[_0x77cc('0x1b')](function(_0x10ef94){var _0x48f105={'method':_0x77cc('0x33'),'uri':_0x46ca34[_0x77cc('0x50')]+_0x77cc('0x52'),'body':{'messages':[{'from':_0x46ca34['phone'],'destinations':[{'to':_0x17a1a9[_0x77cc('0x20')]}],'text':_0x17a1a9[_0x77cc('0x2b')],'notifyUrl':_0x46ca34[_0x77cc('0x22')]+_0x77cc('0x53')+_0x17a1a9['id']+_0x77cc('0x23')+_0x46ca34[_0x77cc('0x4c')],'notifyContentType':'application/json','callbackData':_0x46ca34[_0x77cc('0x20')]+';'+_0x17a1a9[_0x77cc('0x2b')]}]},'headers':{'Authorization':_0x77cc('0x54')+_0x10ef94[_0x77cc('0x4c')]},'json':!![]};return rp(_0x48f105)[_0x77cc('0x1b')](function(_0x58e503){if(_0x58e503[_0x77cc('0x46')]){var _0x5c5ab5={'messageId':_0x58e503[_0x77cc('0x46')][0x0][_0x77cc('0x9')]};if(!_0x46ca34[_0x77cc('0x37')]){_0x5c5ab5['read']=!![];}return _0x428ed0[_0x77cc('0x13')](_0x5c5ab5);}else{return logger[_0x77cc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77cc('0x26'),_0x77cc('0x4f'),util[_0x77cc('0x27')](_0x58e503,{'showHidden':![],'depth':null}));}});})[_0x77cc('0x15')](function(_0xf4c738){return logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x4f'),util[_0x77cc('0x27')](_0xf4c738,{'showHidden':![],'depth':null}));});}else{logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x4f'),_0x77cc('0x55'));}}else{logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x2c6e5f=require(_0x77cc('0x56'));if(_0x46ca34['apiKey']){var _0x3cbac1={};_0x3cbac1[_0x77cc('0x57')]=_0x46ca34['username'];_0x3cbac1[_0x77cc('0x20')]=_0x17a1a9[_0x77cc('0x20')];_0x3cbac1[_0x77cc('0x2d')]=_0x46ca34[_0x77cc('0x20')];_0x3cbac1[_0x77cc('0x58')]=_0x17a1a9['body'];_0x3cbac1[_0x77cc('0x59')]=+new Date();var _0xe5d701='';var _0x5d0585='';var _0x140fae=Object[_0x77cc('0x5a')](_0x3cbac1);_0x140fae[_0x77cc('0x5b')]();for(var _0x36130d=0x0;_0x36130d<_0x140fae[_0x77cc('0x5c')];_0x36130d++){if(_0xe5d701!=''){_0xe5d701+='&';}_0xe5d701+=_0x140fae[_0x36130d]+'='+encodeURIComponent(_0x3cbac1[_0x140fae[_0x36130d]]);_0x5d0585+=_0x3cbac1[_0x140fae[_0x36130d]];}_0x5d0585+=_0x46ca34[_0x77cc('0x5d')];_0x5d0585=_0x2c6e5f[_0x77cc('0x5e')](_0x77cc('0x5f'))[_0x77cc('0x13')](_0x5d0585)['digest'](_0x77cc('0x60'));if(_0xe5d701!==''){_0xe5d701+='&';}_0xe5d701+=_0x77cc('0x61')+_0x5d0585;var _0x4543ae={'method':_0x77cc('0x30'),'uri':_0x77cc('0x62')+_0xe5d701,'json':!![]};return rp(_0x4543ae)['then'](function(_0x178911){var _0x37055f=Object[_0x77cc('0x5a')](_0x178911);if(_0x178911[_0x37055f[0x0]][_0x77cc('0x16')]&&parseInt(_0x178911[_0x37055f[0x0]][_0x77cc('0x16')])===0x0){var _0x276c6f={'messageId':_0x178911[_0x37055f[0x0]][_0x77cc('0x63')]};if(!_0x46ca34[_0x77cc('0x37')]){_0x276c6f[_0x77cc('0x38')]=!![];}return _0x428ed0[_0x77cc('0x13')](_0x276c6f);}else{return logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x64'),util['inspect'](_0x178911[_0x77cc('0x16')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x137f82){return logger['error'](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x64'),util[_0x77cc('0x27')](_0x137f82,{'showHidden':![],'depth':null}));});}else{logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x64'),_0x77cc('0x65'));}break;case'clickatell':if(_0x46ca34[_0x77cc('0x5d')]){var _0xe1a479={'method':_0x77cc('0x33'),'uri':_0x77cc('0x66'),'headers':{'Authorization':_0x46ca34[_0x77cc('0x5d')]},'body':{'content':_0x17a1a9[_0x77cc('0x2b')],'to':[_0x17a1a9[_0x77cc('0x20')]],'from':_0x46ca34[_0x77cc('0x20')],'binary':![],'clientMessageId':_0x77cc('0x67'),'charset':_0x77cc('0x68')},'json':!![]};rp(_0xe1a479)[_0x77cc('0x1b')](function(_0x2334fc){if(!_0x2334fc[_0x77cc('0x16')]){var _0x8c655d={'messageId':_0x2334fc[_0x77cc('0x46')][0x0][_0x77cc('0x69')]};if(!_0x46ca34[_0x77cc('0x37')]){_0x8c655d['read']=!![];}return _0x428ed0[_0x77cc('0x13')](_0x8c655d);}else{return logger[_0x77cc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77cc('0x26'),_0x77cc('0x6a'),util[_0x77cc('0x27')](_0x2334fc['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x31e51e){return logger[_0x77cc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77cc('0x26'),_0x77cc('0x6a'),util['inspect'](_0x31e51e,{'showHidden':![],'depth':null}));});}else{logger[_0x77cc('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x77cc('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case _0x77cc('0x6b'):if(_0x46ca34[_0x77cc('0x5d')]){var _0x297aab={};var _0x4543ae={'method':_0x77cc('0x33'),'uri':_0x77cc('0x6c'),'headers':{'Authorization':_0x77cc('0x6d')+_0x46ca34[_0x77cc('0x5d')],'Content-Type':_0x77cc('0x6e')},'body':{'from':_0x46ca34[_0x77cc('0x20')],'to':_0x17a1a9[_0x77cc('0x20')],'text':_0x17a1a9[_0x77cc('0x2b')]},'json':!![]};return rp(_0x4543ae)[_0x77cc('0x1b')](function(_0x4df063){if(_0x4df063[_0x77cc('0x6f')]==0xca){_0x297aab['message']=_0x4df063;var _0x5c90ef={'method':_0x77cc('0x33'),'uri':_0x77cc('0x70'),'headers':{'Authorization':_0x77cc('0x6d')+_0x46ca34[_0x77cc('0x5d')],'Content-Type':'application/json'},'body':{'refid':_0x297aab[_0x77cc('0x71')][_0x77cc('0x72')]},'json':!![]};return rp(_0x5c90ef)['then'](function(_0x192a07){_0x297aab[_0x77cc('0x73')]=_0x192a07;var _0x43607c={'messageId':_0x297aab[_0x77cc('0x71')][_0x77cc('0x72')],'read':!![]};return _0x428ed0[_0x77cc('0x13')](_0x43607c);});}else{return logger['error'](_0x77cc('0x25'),'afterCreate',_0x77cc('0x6b'),util['inspect'](_0x4df063,{'showHidden':![],'depth':null}));}})['catch'](function(_0x55a56f){return logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),'intelepeer',util[_0x77cc('0x27')](_0x55a56f,{'showHidden':![],'depth':null}));});}else{return logger[_0x77cc('0x16')](_0x77cc('0x25'),_0x77cc('0x26'),_0x77cc('0x6b'),_0x77cc('0x74'));}break;}}})['finally'](function(){_0x1d4606();});}else{_0x1d4606();}}},'charset':_0x77cc('0x75'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x57eb=['refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','createdAt','error','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','messages','create','/api/sms/messages/','/status?token=','token','sid','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','remote','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20username,\x20password','csc','crypto','login','text','timestamp','keys','sort','digest','signature=','GET','https://sms.csc.lv/external/get/send.php?','Missing\x20parameters:\x20apiKey','apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr'];(function(_0x535117,_0x1c4270){var _0x37f99c=function(_0x3bf04c){while(--_0x3bf04c){_0x535117['push'](_0x535117['shift']());}};_0x37f99c(++_0x1c4270);}(_0x57eb,0x16e));var _0xb57e=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x57eb[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0xb57e('0x0'));var util=require('util');var logger=require(_0xb57e('0x1'))(_0xb57e('0x2'));var moment=require('moment');var BPromise=require(_0xb57e('0x3'));var rp=require(_0xb57e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb57e('0x5'));var config=require(_0xb57e('0x6'));var attributes=require(_0xb57e('0x7'));module[_0xb57e('0x8')]=function(_0x173be1,_0x4784e7){return _0x173be1[_0xb57e('0x9')](_0xb57e('0xa'),attributes,{'tableName':_0xb57e('0xb'),'paranoid':![],'indexes':[{'name':_0xb57e('0xc'),'fields':[_0xb57e('0xc')]},{'name':_0xb57e('0xd'),'fields':[_0xb57e('0xe')],'type':_0xb57e('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x95ad32,_0x553ded,_0x37fa90){var _0xe69936=_0x173be1[_0xb57e('0x10')];var _0x48551a=_0x95ad32[_0xb57e('0x11')]({'plain':!![]});if(_0x48551a[_0xb57e('0x12')][_0xb57e('0x13')]()==='in'||_0x48551a[_0xb57e('0x12')][_0xb57e('0x13')]()===_0xb57e('0x14')&&!_0x48551a[_0xb57e('0x15')]&&!_['isNil'](_0x48551a[_0xb57e('0x16')])){_0xe69936[_0xb57e('0x17')][_0xb57e('0x18')]({'where':{'id':_0x48551a[_0xb57e('0x19')]}})['then'](function(_0x382500){if(_0x382500){_0x382500['update']({'lastMsgAt':_0x48551a[_0xb57e('0x1a')],'lastMsgDirection':_0x48551a[_0xb57e('0x12')][_0xb57e('0x13')]()});}})['catch'](function(_0x2ee7da){console[_0xb57e('0x1b')](_0x2ee7da);});}if(_0x48551a[_0xb57e('0x12')]===_0xb57e('0x14')&&!_0x48551a['secret']){var _0x4860cc;_0xe69936['SmsAccount'][_0xb57e('0x1c')]({'where':{'id':_0x48551a[_0xb57e('0x1d')]},'raw':!![]})[_0xb57e('0x1e')](function(_0x5ed7d7){_0x4860cc=_0x5ed7d7;if(_0x4860cc&&_0x4860cc[_0xb57e('0x1f')]){switch(_0x4860cc[_0xb57e('0x1f')]){case _0xb57e('0x20'):var _0x50dd1e=require(_0xb57e('0x20'));if(_0x4860cc[_0xb57e('0x21')]&&_0x4860cc['authToken']&&_0x4860cc[_0xb57e('0x22')]){var _0xf8fe9e=new _0x50dd1e(_0x4860cc[_0xb57e('0x21')],_0x4860cc[_0xb57e('0x23')]);_0xf8fe9e[_0xb57e('0x24')][_0xb57e('0x25')]({'body':_0x48551a[_0xb57e('0xe')],'to':_0x48551a['phone'],'from':_0x4860cc[_0xb57e('0x22')],'statusCallback':_0x4860cc['remote']+_0xb57e('0x26')+_0x48551a['id']+_0xb57e('0x27')+_0x4860cc[_0xb57e('0x28')]})[_0xb57e('0x1e')](function(_0x4231cf){if(_0x4231cf[_0xb57e('0x29')]){return _0x95ad32[_0xb57e('0x2a')]({'messageId':_0x4231cf[_0xb57e('0x29')]});}})[_0xb57e('0x2b')](function(_0x381c5d){logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x20'),util[_0xb57e('0x2e')](_0x381c5d,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),'afterCreate',_0xb57e('0x20'),_0xb57e('0x2f'));}break;case _0xb57e('0x30'):var _0x3f81c3=_0xb57e('0x31');if(_0x4860cc[_0xb57e('0x32')]&&_0x4860cc[_0xb57e('0x33')]){var _0x208d94={'recipient':[_0x48551a['phone']],'message':_0x48551a[_0xb57e('0xe')],'message_type':_0x4860cc[_0xb57e('0x34')]};if(_0x4860cc[_0xb57e('0x34')]&&_0x4860cc['smsMethod']!=='SI'){_0x208d94[_0xb57e('0x35')]=_0x4860cc[_0xb57e('0x22')];}var _0xf9cd43={'url':_0x3f81c3+'login?username='+_0x4860cc['username']+_0xb57e('0x36')+_0x4860cc[_0xb57e('0x33')],'method':'GET'};rp(_0xf9cd43)['then'](function(_0x4a88b4){var _0x2ed066=_0x4a88b4[_0xb57e('0x37')](';');var _0x1bce0a={'user_key':_0x2ed066[0x0],'session_key':_0x2ed066[0x1]};_0xf9cd43={'url':_0x3f81c3+_0xb57e('0x38'),'method':_0xb57e('0x39'),'headers':{'user_key':_0x1bce0a[_0xb57e('0x3a')],'Session_key':_0x1bce0a[_0xb57e('0x3b')]},'json':!![],'body':_0x208d94};return rp(_0xf9cd43);})[_0xb57e('0x1e')](function(_0x253900){if(_0x253900[_0xb57e('0x3c')]>=0x1){var _0x499f70={'messageId':_0x253900[_0xb57e('0x3d')]};if(_0x4860cc[_0xb57e('0x34')]!=='GP'||!_0x4860cc[_0xb57e('0x3e')]){_0x499f70[_0xb57e('0x3f')]=!![];}return _0x95ad32[_0xb57e('0x2a')](_0x499f70);}else{return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x30'),util[_0xb57e('0x2e')](_0x253900,{'showHidden':![],'depth':null}));}})[_0xb57e('0x2b')](function(_0x354b08){return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x30'),util['inspect'](_0x354b08,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x30'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb57e('0x40'):if(_0x4860cc[_0xb57e('0x23')]){var _0x4d7426={'recipient':_0x48551a[_0xb57e('0x22')],'message':_0x48551a[_0xb57e('0xe')],'sender':_0x4860cc[_0xb57e('0x41')]||_0x4860cc[_0xb57e('0x22')],'authorization':_0x4860cc[_0xb57e('0x23')]};var _0x553ded={'method':_0xb57e('0x39'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x4d7426,'json':!![]};rp(_0x553ded)['then'](function(_0x4a85b7){var _0x5acfb0={'messageId':_0x4a85b7['requestid']};if(!_0x4860cc[_0xb57e('0x3e')]){_0x5acfb0[_0xb57e('0x3f')]=!![];}return _0x95ad32[_0xb57e('0x2a')](_0x5acfb0);})['catch'](function(_0x366949){logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x40'),util['inspect'](_0x366949,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),'connectel',_0xb57e('0x42'));}break;case _0xb57e('0x43'):if(_0x4860cc[_0xb57e('0x32')]&&_0x4860cc[_0xb57e('0x33')]){var _0x4d7426={'messages':[{'source':'xCALLY\x20Motion','to':_0x48551a[_0xb57e('0x22')],'body':_0x48551a[_0xb57e('0xe')],'from':_0x4860cc[_0xb57e('0x41')]||_0x4860cc[_0xb57e('0x22')]}]};var _0x4fd98f=util[_0xb57e('0x44')](_0xb57e('0x45'),_0x4860cc[_0xb57e('0x32')],_0x4860cc[_0xb57e('0x33')]);var _0x553ded={'method':_0xb57e('0x39'),'uri':_0xb57e('0x46'),'body':_0x4d7426,'headers':{'Authorization':util[_0xb57e('0x44')](_0xb57e('0x47'),new Buffer(_0x4fd98f)[_0xb57e('0x48')](_0xb57e('0x49')))},'json':!![]};rp(_0x553ded)['then'](function(_0x4febaf){if(_0x4febaf[_0xb57e('0x4a')]>=0xc8&&_0x4febaf['http_code']<=0xce){if(_0x4febaf[_0xb57e('0x4b')]&&_0x4febaf[_0xb57e('0x4b')][_0xb57e('0x4c')]>0x0){var _0x5aa474=_[_0xb57e('0x4d')](_0x4febaf[_0xb57e('0x4b')][_0xb57e('0x24')]);var _0x5d319e={'messageId':_0x5aa474[_0xb57e('0x4e')]};if(!_0x4860cc[_0xb57e('0x3e')]){_0x5d319e[_0xb57e('0x3f')]=!![];}return _0x95ad32[_0xb57e('0x2a')](_0x5d319e);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb57e('0x2d'),_0xb57e('0x4f'),util['inspect'](_0x4febaf,{'showHidden':![],'depth':null}));}}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x4f'),util[_0xb57e('0x2e')](_0x4febaf,{'showHidden':![],'depth':null}));}})[_0xb57e('0x2b')](function(_0x39ddf6){logger['error'](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x4f'),util['inspect'](_0x39ddf6,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x4860cc[_0xb57e('0x50')]&&_0x4860cc[_0xb57e('0x23')]){var _0x4d7426={'dst':_0x48551a[_0xb57e('0x22')],'text':_0x48551a[_0xb57e('0xe')],'src':_0x4860cc[_0xb57e('0x41')]||_0x4860cc['phone'],'url':_0x4860cc[_0xb57e('0x51')]+'/api/sms/messages/'+_0x48551a['id']+_0xb57e('0x27')+_0x4860cc[_0xb57e('0x28')]};var _0x4fd98f=util['format']('%s:%s',_0x4860cc[_0xb57e('0x50')],_0x4860cc[_0xb57e('0x23')]);var _0x553ded={'method':_0xb57e('0x39'),'uri':util[_0xb57e('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4860cc[_0xb57e('0x50')]),'body':_0x4d7426,'headers':{'Authorization':util['format'](_0xb57e('0x47'),new Buffer(_0x4fd98f)[_0xb57e('0x48')](_0xb57e('0x49')))},'json':!![]};rp(_0x553ded)['then'](function(_0x5cdd52){var _0x1513b9={'messageId':_0x5cdd52[_0xb57e('0x52')][0x0]};return _0x95ad32[_0xb57e('0x2a')](_0x1513b9);})[_0xb57e('0x2b')](function(_0x26b14b){logger['error'](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x53'),util[_0xb57e('0x2e')](_0x26b14b,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),'afterCreate',_0xb57e('0x53'),_0xb57e('0x54'));}break;case'infobip':if(_0x4860cc['username']&&_0x4860cc[_0xb57e('0x33')]){if(_0x4860cc[_0xb57e('0x55')]){var _0x24379e={'method':_0xb57e('0x39'),'uri':_0x4860cc[_0xb57e('0x55')]+_0xb57e('0x56'),'body':{'username':_0x4860cc[_0xb57e('0x32')],'password':_0x4860cc['password']},'json':!![]};return rp(_0x24379e)['then'](function(_0x52043b){var _0x571288={'method':_0xb57e('0x39'),'uri':_0x4860cc[_0xb57e('0x55')]+_0xb57e('0x57'),'body':{'messages':[{'from':_0x4860cc[_0xb57e('0x22')],'destinations':[{'to':_0x48551a[_0xb57e('0x22')]}],'text':_0x48551a[_0xb57e('0xe')],'notifyUrl':_0x4860cc[_0xb57e('0x51')]+_0xb57e('0x26')+_0x48551a['id']+_0xb57e('0x27')+_0x4860cc[_0xb57e('0x28')],'notifyContentType':_0xb57e('0x58'),'callbackData':_0x4860cc[_0xb57e('0x22')]+';'+_0x48551a[_0xb57e('0xe')]}]},'headers':{'Authorization':_0xb57e('0x59')+_0x52043b[_0xb57e('0x28')]},'json':!![]};return rp(_0x571288)[_0xb57e('0x1e')](function(_0x31f273){if(_0x31f273[_0xb57e('0x24')]){var _0x3ff02d={'messageId':_0x31f273[_0xb57e('0x24')][0x0][_0xb57e('0xc')]};if(!_0x4860cc[_0xb57e('0x3e')]){_0x3ff02d[_0xb57e('0x3f')]=!![];}return _0x95ad32['update'](_0x3ff02d);}else{return logger['error'](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x5a'),util[_0xb57e('0x2e')](_0x31f273,{'showHidden':![],'depth':null}));}});})[_0xb57e('0x2b')](function(_0x2e9f23){return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x5a'),util[_0xb57e('0x2e')](_0x2e9f23,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x5a'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xb57e('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb57e('0x2d'),'infobip',_0xb57e('0x5b'));}break;case _0xb57e('0x5c'):var _0x5c397e=require(_0xb57e('0x5d'));if(_0x4860cc['apiKey']){var _0x2fa63a={};_0x2fa63a[_0xb57e('0x5e')]=_0x4860cc[_0xb57e('0x32')];_0x2fa63a[_0xb57e('0x22')]=_0x48551a[_0xb57e('0x22')];_0x2fa63a['sender']=_0x4860cc[_0xb57e('0x22')];_0x2fa63a[_0xb57e('0x5f')]=_0x48551a[_0xb57e('0xe')];_0x2fa63a[_0xb57e('0x60')]=+new Date();var _0xd88e72='';var _0x15f7a7='';var _0x51ba44=Object[_0xb57e('0x61')](_0x2fa63a);_0x51ba44[_0xb57e('0x62')]();for(var _0xde086b=0x0;_0xde086b<_0x51ba44['length'];_0xde086b++){if(_0xd88e72!=''){_0xd88e72+='&';}_0xd88e72+=_0x51ba44[_0xde086b]+'='+encodeURIComponent(_0x2fa63a[_0x51ba44[_0xde086b]]);_0x15f7a7+=_0x2fa63a[_0x51ba44[_0xde086b]];}_0x15f7a7+=_0x4860cc['apiKey'];_0x15f7a7=_0x5c397e['createHash']('md5')[_0xb57e('0x2a')](_0x15f7a7)[_0xb57e('0x63')]('hex');if(_0xd88e72!==''){_0xd88e72+='&';}_0xd88e72+=_0xb57e('0x64')+_0x15f7a7;var _0xf9cd43={'method':_0xb57e('0x65'),'uri':_0xb57e('0x66')+_0xd88e72,'json':!![]};return rp(_0xf9cd43)[_0xb57e('0x1e')](function(_0x1d7666){var _0xb578=Object[_0xb57e('0x61')](_0x1d7666);if(_0x1d7666[_0xb578[0x0]][_0xb57e('0x1b')]&&parseInt(_0x1d7666[_0xb578[0x0]][_0xb57e('0x1b')])===0x0){var _0x3c9eba={'messageId':_0x1d7666[_0xb578[0x0]]['id_sms']};if(!_0x4860cc[_0xb57e('0x3e')]){_0x3c9eba['read']=!![];}return _0x95ad32[_0xb57e('0x2a')](_0x3c9eba);}else{return logger[_0xb57e('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util['inspect'](_0x1d7666[_0xb57e('0x1b')],{'showHidden':![],'depth':null}));}})[_0xb57e('0x2b')](function(_0x1a2dbc){return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x5c'),util[_0xb57e('0x2e')](_0x1a2dbc,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x5c'),_0xb57e('0x67'));}break;case'clickatell':if(_0x4860cc[_0xb57e('0x68')]){var _0x434890={'method':_0xb57e('0x39'),'uri':_0xb57e('0x69'),'headers':{'Authorization':_0x4860cc[_0xb57e('0x68')]},'body':{'content':_0x48551a[_0xb57e('0xe')],'to':[_0x48551a['phone']],'from':_0x4860cc[_0xb57e('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0xb57e('0x6a')},'json':!![]};rp(_0x434890)['then'](function(_0x4411cb){if(!_0x4411cb['error']){var _0x4efaaa={'messageId':_0x4411cb['messages'][0x0][_0xb57e('0x6b')]};if(!_0x4860cc[_0xb57e('0x3e')]){_0x4efaaa[_0xb57e('0x3f')]=!![];}return _0x95ad32[_0xb57e('0x2a')](_0x4efaaa);}else{return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x6c'),util[_0xb57e('0x2e')](_0x4411cb[_0xb57e('0x1b')],{'showHidden':![],'depth':null}));}})[_0xb57e('0x2b')](function(_0x30a8a3){return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x6c'),util[_0xb57e('0x2e')](_0x30a8a3,{'showHidden':![],'depth':null}));});}else{logger[_0xb57e('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb57e('0x2d'),'clickatell',_0xb57e('0x67'));}break;case'intelepeer':if(_0x4860cc[_0xb57e('0x68')]){var _0x7569f7={};var _0xf9cd43={'method':'POST','uri':_0xb57e('0x6d'),'headers':{'Authorization':_0xb57e('0x6e')+_0x4860cc[_0xb57e('0x68')],'Content-Type':'application/json'},'body':{'from':_0x4860cc[_0xb57e('0x22')],'to':_0x48551a[_0xb57e('0x22')],'text':_0x48551a['body']},'json':!![]};return rp(_0xf9cd43)[_0xb57e('0x1e')](function(_0x28bab2){if(_0x28bab2[_0xb57e('0x6f')]==0xca){_0x7569f7[_0xb57e('0x70')]=_0x28bab2;var _0x23bc82={'method':_0xb57e('0x39'),'uri':_0xb57e('0x71'),'headers':{'Authorization':'Bearer\x20'+_0x4860cc['apiKey'],'Content-Type':_0xb57e('0x58')},'body':{'refid':_0x7569f7[_0xb57e('0x70')][_0xb57e('0x72')]},'json':!![]};return rp(_0x23bc82)[_0xb57e('0x1e')](function(_0x5a84c5){_0x7569f7['status']=_0x5a84c5;var _0x38e7fa={'messageId':_0x7569f7[_0xb57e('0x70')]['refid'],'read':!![]};return _0x95ad32[_0xb57e('0x2a')](_0x38e7fa);});}else{return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),'afterCreate',_0xb57e('0x73'),util[_0xb57e('0x2e')](_0x28bab2,{'showHidden':![],'depth':null}));}})[_0xb57e('0x2b')](function(_0x1689f5){return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),'intelepeer',util[_0xb57e('0x2e')](_0x1689f5,{'showHidden':![],'depth':null}));});}else{return logger[_0xb57e('0x1b')](_0xb57e('0x2c'),_0xb57e('0x2d'),_0xb57e('0x73'),_0xb57e('0x74'));}break;}}})[_0xb57e('0x75')](function(){_0x37fa90();});}else{_0x37fa90();}}},'charset':_0xb57e('0x76'),'collate':_0xb57e('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index b6d10c2..327e3ee 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 _0x9ab7=['request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','message','info','result','CreateSmsMessage','SmsMessage','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','SmsMessage,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9ab7,0xc7));var _0x79ab=function(_0x33e313,_0x1fc39c){_0x33e313=_0x33e313-0x0;var _0x2005da=_0x9ab7[_0x33e313];return _0x2005da;};'use strict';var _=require(_0x79ab('0x0'));var util=require(_0x79ab('0x1'));var moment=require(_0x79ab('0x2'));var BPromise=require(_0x79ab('0x3'));var rs=require(_0x79ab('0x4'));var fs=require('fs');var Redis=require(_0x79ab('0x5'));var db=require(_0x79ab('0x6'))['db'];var utils=require(_0x79ab('0x7'));var logger=require('../../config/logger')(_0x79ab('0x8'));var config=require(_0x79ab('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x79ab('0xa')]({'port':0x232a});config[_0x79ab('0xb')]=_[_0x79ab('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x79ab('0xd'))(new Redis(config[_0x79ab('0xb')]));require('./smsMessage.socket')[_0x79ab('0xe')](socket);function respondWithRpcPromise(_0xb3d46e,_0xd011da,_0x522322){return new BPromise(function(_0x37d440,_0x549292){return client[_0x79ab('0xf')](_0xb3d46e,_0x522322)[_0x79ab('0x10')](function(_0x4a6536){logger['info'](_0x79ab('0x11'),_0xd011da,_0x79ab('0x12'));logger['debug'](_0x79ab('0x13'),_0xd011da,_0x79ab('0x12'),JSON['stringify'](_0x4a6536));if(_0x4a6536['error']){if(_0x4a6536['error'][_0x79ab('0x14')]===0x1f4){logger[_0x79ab('0x15')]('SmsMessage,\x20%s,\x20%s',_0xd011da,_0x4a6536[_0x79ab('0x15')]['message']);return _0x549292(_0x4a6536['error'][_0x79ab('0x16')]);}logger[_0x79ab('0x15')]('SmsMessage,\x20%s,\x20%s',_0xd011da,_0x4a6536[_0x79ab('0x15')]['message']);return _0x37d440(_0x4a6536['error'][_0x79ab('0x16')]);}else{logger[_0x79ab('0x17')](_0x79ab('0x11'),_0xd011da,_0x79ab('0x12'));_0x37d440(_0x4a6536[_0x79ab('0x18')][_0x79ab('0x16')]);}})['catch'](function(_0x26d12d){logger[_0x79ab('0x15')](_0x79ab('0x11'),_0xd011da,_0x26d12d);_0x549292(_0x26d12d);});});}exports[_0x79ab('0x19')]=function(_0x53a6e7){var _0x2e5c9c=this;return new Promise(function(_0x158d42,_0x3c0371){return db[_0x79ab('0x1a')]['create'](_0x53a6e7['body'],{'raw':_0x53a6e7[_0x79ab('0x1b')]?_0x53a6e7[_0x79ab('0x1b')][_0x79ab('0x1c')]===undefined?!![]:![]:!![]})[_0x79ab('0x10')](function(_0x73743b){logger['info'](_0x79ab('0x19'),_0x53a6e7);logger[_0x79ab('0x1d')](_0x79ab('0x19'),_0x53a6e7,JSON[_0x79ab('0x1e')](_0x73743b));_0x158d42(_0x73743b);})['catch'](function(_0x25c9c1){logger[_0x79ab('0x15')](_0x79ab('0x19'),_0x25c9c1[_0x79ab('0x16')],_0x53a6e7);_0x3c0371(_0x2e5c9c[_0x79ab('0x15')](0x1f4,_0x25c9c1[_0x79ab('0x16')]));});});}; \ No newline at end of file +var _0x26a1=['CreateSmsMessage','SmsMessage','create','body','options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x1efb4a,_0x46acc8){var _0x30c4b9=function(_0x28f547){while(--_0x28f547){_0x1efb4a['push'](_0x1efb4a['shift']());}};_0x30c4b9(++_0x46acc8);}(_0x26a1,0xfd));var _0x126a=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x26a1[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x126a('0x0'));var util=require('util');var moment=require(_0x126a('0x1'));var BPromise=require(_0x126a('0x2'));var rs=require(_0x126a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x126a('0x4'))['db'];var utils=require(_0x126a('0x5'));var logger=require(_0x126a('0x6'))(_0x126a('0x7'));var config=require(_0x126a('0x8'));var jayson=require(_0x126a('0x9'));var client=jayson['client'][_0x126a('0xa')]({'port':0x232a});config[_0x126a('0xb')]=_['defaults'](config[_0x126a('0xb')],{'host':_0x126a('0xc'),'port':0x18eb});var socket=require(_0x126a('0xd'))(new Redis(config[_0x126a('0xb')]));require('./smsMessage.socket')[_0x126a('0xe')](socket);function respondWithRpcPromise(_0xe5e6e0,_0x12e590,_0x4925da){return new BPromise(function(_0x38123d,_0x267b4d){return client[_0x126a('0xf')](_0xe5e6e0,_0x4925da)[_0x126a('0x10')](function(_0x189209){logger[_0x126a('0x11')]('SmsMessage,\x20%s,\x20%s',_0x12e590,_0x126a('0x12'));logger[_0x126a('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x12e590,_0x126a('0x12'),JSON[_0x126a('0x14')](_0x189209));if(_0x189209['error']){if(_0x189209[_0x126a('0x15')]['code']===0x1f4){logger[_0x126a('0x15')](_0x126a('0x16'),_0x12e590,_0x189209['error'][_0x126a('0x17')]);return _0x267b4d(_0x189209[_0x126a('0x15')][_0x126a('0x17')]);}logger[_0x126a('0x15')](_0x126a('0x16'),_0x12e590,_0x189209[_0x126a('0x15')]['message']);return _0x38123d(_0x189209[_0x126a('0x15')][_0x126a('0x17')]);}else{logger[_0x126a('0x11')](_0x126a('0x16'),_0x12e590,_0x126a('0x12'));_0x38123d(_0x189209[_0x126a('0x18')][_0x126a('0x17')]);}})[_0x126a('0x19')](function(_0x13d60b){logger['error'](_0x126a('0x16'),_0x12e590,_0x13d60b);_0x267b4d(_0x13d60b);});});}exports[_0x126a('0x1a')]=function(_0x5a4fe7){var _0x5d2884=this;return new Promise(function(_0x30cb62,_0x58fa0c){return db[_0x126a('0x1b')][_0x126a('0x1c')](_0x5a4fe7[_0x126a('0x1d')],{'raw':_0x5a4fe7['options']?_0x5a4fe7[_0x126a('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3f8797){logger[_0x126a('0x11')](_0x126a('0x1a'),_0x5a4fe7);logger[_0x126a('0x13')]('CreateSmsMessage',_0x5a4fe7,JSON[_0x126a('0x14')](_0x3f8797));_0x30cb62(_0x3f8797);})[_0x126a('0x19')](function(_0xad5ef){logger['error'](_0x126a('0x1a'),_0xad5ef['message'],_0x5a4fe7);_0x58fa0c(_0x5d2884['error'](0x1f4,_0xad5ef['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c6cf816..ac16332 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 _0x5326=['./smsMessage.events','save','update','emit','length','smsMessage:'];(function(_0x44303a,_0x52df10){var _0x50af17=function(_0x2f5cdf){while(--_0x2f5cdf){_0x44303a['push'](_0x44303a['shift']());}};_0x50af17(++_0x52df10);}(_0x5326,0x19e));var _0x6532=function(_0x39628c,_0x2eb8c4){_0x39628c=_0x39628c-0x0;var _0x2b0532=_0x5326[_0x39628c];return _0x2b0532;};'use strict';var SmsMessageEvents=require(_0x6532('0x0'));var events=[_0x6532('0x1'),'remove',_0x6532('0x2')];function createListener(_0x5911fa,_0x2c4370){return function(_0x5da944){_0x2c4370[_0x6532('0x3')](_0x5911fa,_0x5da944);};}function removeListener(_0x109610,_0x33c6af){return function(){SmsMessageEvents['removeListener'](_0x109610,_0x33c6af);};}exports['register']=function(_0x4afc40){for(var _0x53c775=0x0,_0x3ae503=events[_0x6532('0x4')];_0x53c775<_0x3ae503;_0x53c775++){var _0x291b89=events[_0x53c775];var _0x276fa4=createListener(_0x6532('0x5')+_0x291b89,_0x4afc40);SmsMessageEvents['on'](_0x291b89,_0x276fa4);}}; \ No newline at end of file +var _0xf036=['length','smsMessage:','./smsMessage.events','remove','update','emit','removeListener','register'];(function(_0xddd211,_0x2be8b7){var _0x34a550=function(_0x33fa40){while(--_0x33fa40){_0xddd211['push'](_0xddd211['shift']());}};_0x34a550(++_0x2be8b7);}(_0xf036,0x1e2));var _0x6f03=function(_0x4b9859,_0x527496){_0x4b9859=_0x4b9859-0x0;var _0x3d3228=_0xf036[_0x4b9859];return _0x3d3228;};'use strict';var SmsMessageEvents=require(_0x6f03('0x0'));var events=['save',_0x6f03('0x1'),_0x6f03('0x2')];function createListener(_0x353477,_0x245972){return function(_0x20f5dc){_0x245972[_0x6f03('0x3')](_0x353477,_0x20f5dc);};}function removeListener(_0x35f2f2,_0x1fb9e5){return function(){SmsMessageEvents[_0x6f03('0x4')](_0x35f2f2,_0x1fb9e5);};}exports[_0x6f03('0x5')]=function(_0x5aa17e){for(var _0x3cd71d=0x0,_0x2ba79b=events[_0x6f03('0x6')];_0x3cd71d<_0x2ba79b;_0x3cd71d++){var _0x25d962=events[_0x3cd71d];var _0x13400b=createListener(_0x6f03('0x7')+_0x25d962,_0x5aa17e);SmsMessageEvents['on'](_0x25d962,_0x13400b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9677d12..c84f2b1 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 _0x5544=['getAgents','create','post','addTeams','put','update','delete','destroy','/:id/teams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getMembers','/:id/users'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x5544,0x1cd));var _0x4554=function(_0x56f440,_0x507d71){_0x56f440=_0x56f440-0x0;var _0x1f6fdd=_0x5544[_0x56f440];return _0x1f6fdd;};'use strict';var multer=require(_0x4554('0x0'));var util=require('util');var path=require(_0x4554('0x1'));var timeout=require(_0x4554('0x2'));var express=require(_0x4554('0x3'));var router=express[_0x4554('0x4')]();var auth=require(_0x4554('0x5'));var interaction=require(_0x4554('0x6'));var config=require(_0x4554('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x4554('0x8')](),controller[_0x4554('0x9')]);router[_0x4554('0xa')]('/describe',auth[_0x4554('0x8')](),controller['describe']);router[_0x4554('0xa')](_0x4554('0xb'),auth[_0x4554('0x8')](),controller['show']);router['get']('/:id/members',auth[_0x4554('0x8')](),controller[_0x4554('0xc')]);router[_0x4554('0xa')]('/:id/teams',auth[_0x4554('0x8')](),controller['getTeams']);router[_0x4554('0xa')](_0x4554('0xd'),auth[_0x4554('0x8')](),controller[_0x4554('0xe')]);router['post']('/',auth[_0x4554('0x8')](),controller[_0x4554('0xf')]);router[_0x4554('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4554('0x11')]);router[_0x4554('0x10')](_0x4554('0xd'),auth[_0x4554('0x8')](),controller['addAgents']);router[_0x4554('0x12')](_0x4554('0xb'),auth[_0x4554('0x8')](),controller[_0x4554('0x13')]);router[_0x4554('0x14')](_0x4554('0xb'),auth[_0x4554('0x8')](),controller[_0x4554('0x15')]);router[_0x4554('0x14')](_0x4554('0x16'),auth[_0x4554('0x8')](),controller['removeTeams']);router[_0x4554('0x14')](_0x4554('0xd'),auth[_0x4554('0x8')](),controller[_0x4554('0x17')]);module[_0x4554('0x18')]=router; \ No newline at end of file +var _0xe591=['/describe','describe','/:id','isAuthenticated','show','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get'];(function(_0x1823e8,_0x5cb5b5){var _0x49c58b=function(_0x145672){while(--_0x145672){_0x1823e8['push'](_0x1823e8['shift']());}};_0x49c58b(++_0x5cb5b5);}(_0xe591,0x1c6));var _0x1e59=function(_0x1d077d,_0x4d058a){_0x1d077d=_0x1d077d-0x0;var _0x4414d8=_0xe591[_0x1d077d];return _0x4414d8;};'use strict';var multer=require(_0x1e59('0x0'));var util=require('util');var path=require(_0x1e59('0x1'));var timeout=require('connect-timeout');var express=require(_0x1e59('0x2'));var router=express[_0x1e59('0x3')]();var auth=require(_0x1e59('0x4'));var interaction=require(_0x1e59('0x5'));var config=require(_0x1e59('0x6'));var controller=require(_0x1e59('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e59('0x8')]);router[_0x1e59('0x9')](_0x1e59('0xa'),auth['isAuthenticated'](),controller[_0x1e59('0xb')]);router[_0x1e59('0x9')](_0x1e59('0xc'),auth[_0x1e59('0xd')](),controller[_0x1e59('0xe')]);router[_0x1e59('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0x1e59('0xf')]);router[_0x1e59('0x9')]('/:id/teams',auth[_0x1e59('0xd')](),controller[_0x1e59('0x10')]);router[_0x1e59('0x9')](_0x1e59('0x11'),auth[_0x1e59('0xd')](),controller['getAgents']);router[_0x1e59('0x12')]('/',auth[_0x1e59('0xd')](),controller[_0x1e59('0x13')]);router['post'](_0x1e59('0x14'),auth[_0x1e59('0xd')](),controller[_0x1e59('0x15')]);router[_0x1e59('0x12')](_0x1e59('0x11'),auth[_0x1e59('0xd')](),controller[_0x1e59('0x16')]);router[_0x1e59('0x17')](_0x1e59('0xc'),auth[_0x1e59('0xd')](),controller[_0x1e59('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1e59('0x19')]);router[_0x1e59('0x1a')]('/:id/teams',auth[_0x1e59('0xd')](),controller[_0x1e59('0x1b')]);router['delete']('/:id/users',auth[_0x1e59('0xd')](),controller[_0x1e59('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index d10d2da..18b7ade 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 _0xfed7=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xfed7,0xdc));var _0x7fed=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xfed7[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require('sequelize');module[_0x7fed('0x0')]={'name':{'type':Sequelize[_0x7fed('0x1')],'unique':_0x7fed('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7fed('0x1')]},'timeout':{'type':Sequelize[_0x7fed('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7fed('0x4')](_0x7fed('0x5'),_0x7fed('0x6'),_0x7fed('0x7'))}}; \ No newline at end of file +var _0x297a=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x297a,0xaa));var _0xa297=function(_0x5d6852,_0x514578){_0x5d6852=_0x5d6852-0x0;var _0x565d03=_0x297a[_0x5d6852];return _0x565d03;};'use strict';var Sequelize=require(_0xa297('0x0'));module['exports']={'name':{'type':Sequelize[_0xa297('0x1')],'unique':_0xa297('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa297('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa297('0x4')](_0xa297('0x5'),_0xa297('0x6'),_0xa297('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2ee6675..a24f5fc 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 _0xc9a1=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','end','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','hasOwnProperty','order','SmsQueueId','User','UserId','smsPause','updatedAt','%s/%s','createdAt','findOne','Team','getTeams','addTeams','teams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','omit','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4c1d9a,_0x5a59f9){var _0x1ba68d=function(_0x3f6889){while(--_0x3f6889){_0x4c1d9a['push'](_0x4c1d9a['shift']());}};_0x1ba68d(++_0x5a59f9);}(_0xc9a1,0x77));var _0x1c9a=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xc9a1[_0x485b5a];return _0xd2b34d;};'use strict';var pdf=require(_0x1c9a('0x0'));var emlformat=require(_0x1c9a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1c9a('0x2'));var jsonpatch=require(_0x1c9a('0x3'));var rp=require(_0x1c9a('0x4'));var moment=require(_0x1c9a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1c9a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1c9a('0x7'));var ejs=require(_0x1c9a('0x8'));var fs=require('fs');var _=require(_0x1c9a('0x9'));var squel=require('squel');var crypto=require(_0x1c9a('0xa'));var jsforce=require(_0x1c9a('0xb'));var deskjs=require(_0x1c9a('0xc'));var toCsv=require(_0x1c9a('0x7'));var querystring=require(_0x1c9a('0xd'));var Papa=require(_0x1c9a('0xe'));var Redis=require(_0x1c9a('0xf'));var authService=require(_0x1c9a('0x10'));var qs=require(_0x1c9a('0x11'));var hardwareService=require(_0x1c9a('0x12'));var logger=require(_0x1c9a('0x13'))('api');var utils=require(_0x1c9a('0x14'));var config=require(_0x1c9a('0x15'));var db=require(_0x1c9a('0x16'))['db'];config[_0x1c9a('0x17')]=_[_0x1c9a('0x18')](config[_0x1c9a('0x17')],{'host':_0x1c9a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c9a('0x17')]));require(_0x1c9a('0x1a'))[_0x1c9a('0x1b')](socket);function respondWithStatusCode(_0x424cf9,_0x225a27){_0x225a27=_0x225a27||0xcc;return function(_0x29a957){if(_0x29a957){return _0x424cf9[_0x1c9a('0x1c')](_0x225a27);}return _0x424cf9['status'](_0x225a27)[_0x1c9a('0x1d')]();};}function respondWithResult(_0x1ac175,_0x3d6ba4){_0x3d6ba4=_0x3d6ba4||0xc8;return function(_0x694f38){if(_0x694f38){return _0x1ac175[_0x1c9a('0x1e')](_0x3d6ba4)['json'](_0x694f38);}};}function respondWithFilteredResult(_0x4ceb6f,_0x1174f3){return function(_0x172efb){if(_0x172efb){var _0x5dc35a=_0x172efb[_0x1c9a('0x1f')],_0x11e166=_0x1174f3[_0x1c9a('0x20')],_0x61dae6=_0x1174f3[_0x1c9a('0x20')]+_0x1174f3[_0x1c9a('0x21')],_0xf858ad;if(_0x61dae6>=_0x5dc35a){_0x61dae6=_0x5dc35a;_0xf858ad=0xc8;}else{_0xf858ad=0xce;}_0x4ceb6f['status'](_0xf858ad);return _0x4ceb6f['set'](_0x1c9a('0x22'),_0x11e166+'-'+_0x61dae6+'/'+_0x5dc35a)[_0x1c9a('0x23')](_0x172efb);}return null;};}function patchUpdates(_0x9d2303){return function(_0x50730f){try{jsonpatch['apply'](_0x50730f,_0x9d2303,!![]);}catch(_0x45c446){return BPromise[_0x1c9a('0x24')](_0x45c446);}return _0x50730f[_0x1c9a('0x25')]();};}function saveUpdates(_0x3dcdd7,_0x37fbbe){return function(_0x1443ba){if(_0x1443ba){return _0x1443ba[_0x1c9a('0x26')](_0x3dcdd7)[_0x1c9a('0x27')](function(_0x2ea5bd){return _0x2ea5bd;});}return null;};}function removeEntity(_0x272463,_0x1aa125){return function(_0x17eaad){if(_0x17eaad){return _0x17eaad[_0x1c9a('0x28')]()['then'](function(){var _0x11f3a7=_0x17eaad[_0x1c9a('0x29')]({'plain':!![]});var _0x340b11=_0x1c9a('0x2a');return db[_0x1c9a('0x2b')][_0x1c9a('0x28')]({'where':{'type':_0x340b11,'resourceId':_0x11f3a7['id']}})['then'](function(){return _0x17eaad;});})['then'](function(){_0x272463[_0x1c9a('0x1e')](0xcc)[_0x1c9a('0x1d')]();});}};}function handleEntityNotFound(_0xb0c555,_0x983c97){return function(_0x40696d){if(!_0x40696d){_0xb0c555['sendStatus'](0x194);}return _0x40696d;};}function handleError(_0x13e451,_0x2298de){_0x2298de=_0x2298de||0x1f4;return function(_0x1b7afa){logger['error'](_0x1b7afa[_0x1c9a('0x2c')]);if(_0x1b7afa[_0x1c9a('0x2d')]){delete _0x1b7afa[_0x1c9a('0x2d')];}_0x13e451['status'](_0x2298de)[_0x1c9a('0x2e')](_0x1b7afa);};}exports[_0x1c9a('0x2f')]=function(_0x47e6cb,_0x3ee677){var _0xfa50b2={},_0x4ce5a6={},_0x31025c={'count':0x0,'rows':[]};var _0x4ef728=db[_0x1c9a('0x30')][_0x1c9a('0x31')];_0x4ce5a6[_0x1c9a('0x32')]=_['keys'](_0x4ef728);_0x4ce5a6['query']=_[_0x1c9a('0x33')](_0x47e6cb[_0x1c9a('0x34')]);_0x4ce5a6[_0x1c9a('0x35')]=_[_0x1c9a('0x36')](_0x4ce5a6['model'],_0x4ce5a6[_0x1c9a('0x34')]);_0xfa50b2[_0x1c9a('0x37')]=_['intersection'](_0x4ce5a6['model'],qs[_0x1c9a('0x38')](_0x47e6cb[_0x1c9a('0x34')][_0x1c9a('0x38')]));_0xfa50b2[_0x1c9a('0x37')]=_0xfa50b2[_0x1c9a('0x37')][_0x1c9a('0x39')]?_0xfa50b2[_0x1c9a('0x37')]:_0x4ce5a6['model'];if(!_0x47e6cb['query']['hasOwnProperty'](_0x1c9a('0x3a'))){_0xfa50b2[_0x1c9a('0x21')]=qs[_0x1c9a('0x21')](_0x47e6cb[_0x1c9a('0x34')][_0x1c9a('0x21')]);_0xfa50b2[_0x1c9a('0x20')]=qs[_0x1c9a('0x20')](_0x47e6cb[_0x1c9a('0x34')]['offset']);}_0xfa50b2['order']=qs[_0x1c9a('0x3b')](_0x47e6cb[_0x1c9a('0x34')][_0x1c9a('0x3b')]);_0xfa50b2['where']=qs[_0x1c9a('0x35')](_[_0x1c9a('0x3c')](_0x47e6cb[_0x1c9a('0x34')],_0x4ce5a6[_0x1c9a('0x35')]));if(_0x47e6cb[_0x1c9a('0x34')][_0x1c9a('0x3d')]){_0xfa50b2[_0x1c9a('0x3e')]=_[_0x1c9a('0x3f')](_0xfa50b2[_0x1c9a('0x3e')],{'$or':_[_0x1c9a('0x40')](_0x4ef728,function(_0x51c794){if(_0x51c794[_0x1c9a('0x41')]['key']!==_0x1c9a('0x42')){var _0x3c754e={};_0x3c754e[_0x51c794[_0x1c9a('0x43')]]={'$like':'%'+_0x47e6cb[_0x1c9a('0x34')][_0x1c9a('0x3d')]+'%'};return _0x3c754e;}})});}_0xfa50b2=_['merge']({},_0xfa50b2,_0x47e6cb[_0x1c9a('0x44')]);var _0x386eaa={'where':_0xfa50b2[_0x1c9a('0x3e')]};return db[_0x1c9a('0x30')]['count'](_0x386eaa)['then'](function(_0x5a6d7f){_0x31025c['count']=_0x5a6d7f;if(_0x47e6cb[_0x1c9a('0x34')]['includeAll']){_0xfa50b2[_0x1c9a('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0x1c9a('0x46')](_0xfa50b2);})[_0x1c9a('0x27')](function(_0x5384b0){_0x31025c[_0x1c9a('0x47')]=_0x5384b0;return _0x31025c;})['then'](respondWithFilteredResult(_0x3ee677,_0xfa50b2))[_0x1c9a('0x48')](handleError(_0x3ee677,null));};exports['show']=function(_0x2da4ac,_0x28e673){var _0x4357ec={'raw':!![],'where':{'id':_0x2da4ac[_0x1c9a('0x49')]['id']}},_0x47daf1={};_0x47daf1[_0x1c9a('0x32')]=_['keys'](db[_0x1c9a('0x30')][_0x1c9a('0x31')]);_0x47daf1[_0x1c9a('0x34')]=_[_0x1c9a('0x33')](_0x2da4ac[_0x1c9a('0x34')]);_0x47daf1[_0x1c9a('0x35')]=_[_0x1c9a('0x36')](_0x47daf1[_0x1c9a('0x32')],_0x47daf1[_0x1c9a('0x34')]);_0x4357ec[_0x1c9a('0x37')]=_[_0x1c9a('0x36')](_0x47daf1[_0x1c9a('0x32')],qs['fields'](_0x2da4ac[_0x1c9a('0x34')][_0x1c9a('0x38')]));_0x4357ec[_0x1c9a('0x37')]=_0x4357ec[_0x1c9a('0x37')][_0x1c9a('0x39')]?_0x4357ec['attributes']:_0x47daf1[_0x1c9a('0x32')];if(_0x2da4ac[_0x1c9a('0x34')][_0x1c9a('0x4a')]){_0x4357ec[_0x1c9a('0x45')]=[{'all':!![]}];}_0x4357ec=_[_0x1c9a('0x3f')]({},_0x4357ec,_0x2da4ac['options']);return db[_0x1c9a('0x30')][_0x1c9a('0x4b')](_0x4357ec)[_0x1c9a('0x27')](handleEntityNotFound(_0x28e673,null))[_0x1c9a('0x27')](respondWithResult(_0x28e673,null))[_0x1c9a('0x48')](handleError(_0x28e673,null));};exports[_0x1c9a('0x4c')]=function(_0x4a0cee,_0x1611d8){return db['SmsQueue'][_0x1c9a('0x4c')](_0x4a0cee[_0x1c9a('0x4d')],{})[_0x1c9a('0x27')](function(_0x304cdd){var _0x208704=_0x4a0cee[_0x1c9a('0x4e')][_0x1c9a('0x29')]({'plain':!![]});if(!_0x208704)throw new Error(_0x1c9a('0x4f'));if(_0x208704[_0x1c9a('0x50')]==='user'){var _0x1903cc=_0x304cdd[_0x1c9a('0x29')]({'plain':!![]});var _0x1d892b='SmsQueues';return db[_0x1c9a('0x51')][_0x1c9a('0x4b')]({'where':{'name':_0x1d892b,'userProfileId':_0x208704[_0x1c9a('0x52')]},'raw':!![]})['then'](function(_0x391bac){if(_0x391bac&&_0x391bac[_0x1c9a('0x53')]===0x0){return db[_0x1c9a('0x2b')][_0x1c9a('0x4c')]({'name':_0x1903cc[_0x1c9a('0x2d')],'resourceId':_0x1903cc['id'],'type':_0x391bac[_0x1c9a('0x2d')],'sectionId':_0x391bac['id']},{})[_0x1c9a('0x27')](function(){return _0x304cdd;});}else{return _0x304cdd;}})['catch'](function(_0x109e48){logger[_0x1c9a('0x54')](_0x1c9a('0x55'),_0x109e48);throw _0x109e48;});}return _0x304cdd;})[_0x1c9a('0x27')](respondWithResult(_0x1611d8,0xc9))[_0x1c9a('0x48')](handleError(_0x1611d8,null));};exports[_0x1c9a('0x26')]=function(_0x40cb3a,_0x1c1c75){if(_0x40cb3a[_0x1c9a('0x4d')]['id']){delete _0x40cb3a[_0x1c9a('0x4d')]['id'];}return db[_0x1c9a('0x30')][_0x1c9a('0x4b')]({'where':{'id':_0x40cb3a[_0x1c9a('0x49')]['id']}})[_0x1c9a('0x27')](handleEntityNotFound(_0x1c1c75,null))[_0x1c9a('0x27')](saveUpdates(_0x40cb3a['body'],null))['then'](respondWithResult(_0x1c1c75,null))[_0x1c9a('0x48')](handleError(_0x1c1c75,null));};exports[_0x1c9a('0x28')]=function(_0x548f12,_0x5a0798){return db[_0x1c9a('0x30')][_0x1c9a('0x4b')]({'where':{'id':_0x548f12['params']['id']}})[_0x1c9a('0x27')](handleEntityNotFound(_0x5a0798,null))[_0x1c9a('0x27')](removeEntity(_0x5a0798,null))['catch'](handleError(_0x5a0798,null));};exports[_0x1c9a('0x56')]=function(_0x457894,_0x6e7667){return db['SmsQueue'][_0x1c9a('0x56')]()[_0x1c9a('0x27')](respondWithResult(_0x6e7667,null))[_0x1c9a('0x48')](handleError(_0x6e7667,null));};exports[_0x1c9a('0x57')]=function(_0x164571,_0x4d2f01,_0x38cc9d){var _0x59f87b={'raw':!![],'where':{}},_0x26eed9={},_0x5b3d94;return db[_0x1c9a('0x30')]['findOne']({'where':{'id':_0x164571['params']['id']}})[_0x1c9a('0x27')](handleEntityNotFound(_0x4d2f01,null))['then'](function(_0x3fed00){if(_0x3fed00){_0x5b3d94=_0x3fed00[_0x1c9a('0x29')]({'plain':!![]});_0x26eed9[_0x1c9a('0x32')]=_[_0x1c9a('0x33')](db[_0x1c9a('0x58')][_0x1c9a('0x31')]);_0x26eed9[_0x1c9a('0x34')]=_[_0x1c9a('0x33')](_0x164571[_0x1c9a('0x34')]);_0x26eed9[_0x1c9a('0x35')]=_[_0x1c9a('0x36')](_0x26eed9[_0x1c9a('0x32')],_0x26eed9['query']);_0x59f87b[_0x1c9a('0x37')]=_[_0x1c9a('0x36')](_0x26eed9[_0x1c9a('0x32')],qs[_0x1c9a('0x38')](_0x164571['query'][_0x1c9a('0x38')]));_0x59f87b[_0x1c9a('0x37')]=_0x59f87b[_0x1c9a('0x37')]['length']?_0x59f87b[_0x1c9a('0x37')]:_0x26eed9[_0x1c9a('0x32')];if(!_0x164571['query'][_0x1c9a('0x59')](_0x1c9a('0x3a'))){_0x59f87b[_0x1c9a('0x21')]=qs['limit'](_0x164571[_0x1c9a('0x34')][_0x1c9a('0x21')]);_0x59f87b[_0x1c9a('0x20')]=qs[_0x1c9a('0x20')](_0x164571[_0x1c9a('0x34')]['offset']);}_0x59f87b[_0x1c9a('0x5a')]=qs['sort'](_0x164571[_0x1c9a('0x34')][_0x1c9a('0x3b')]);_0x59f87b[_0x1c9a('0x3e')]=qs[_0x1c9a('0x35')](_['pick'](_0x164571[_0x1c9a('0x34')],_0x26eed9[_0x1c9a('0x35')]));_0x59f87b[_0x1c9a('0x3e')][_0x1c9a('0x5b')]=_0x3fed00['id'];if(_0x164571[_0x1c9a('0x34')]['filter']){_0x59f87b[_0x1c9a('0x3e')]=_[_0x1c9a('0x3f')](_0x59f87b[_0x1c9a('0x3e')],{'$or':_[_0x1c9a('0x40')](_0x59f87b[_0x1c9a('0x37')],function(_0x43f845){var _0x5a615a={};_0x5a615a[_0x43f845]={'$like':'%'+_0x164571[_0x1c9a('0x34')][_0x1c9a('0x3d')]+'%'};return _0x5a615a;})});}_0x59f87b=_[_0x1c9a('0x3f')]({},_0x59f87b,_0x164571['options']);return db['UserSmsQueue']['findAll'](_0x59f87b);}})[_0x1c9a('0x27')](function(_0x43aa0f){if(_0x43aa0f){return db[_0x1c9a('0x5c')]['findAndCountAll']({'where':{'id':_[_0x1c9a('0x40')](_0x43aa0f,_0x1c9a('0x5d')),'role':'agent'},'attributes':['id',_0x1c9a('0x2d'),_0x1c9a('0x5e'),_0x1c9a('0x5f'),'createdAt']});}})[_0x1c9a('0x27')](function(_0x583bd9){if(_0x583bd9){return{'count':_0x583bd9[_0x1c9a('0x1f')],'rows':_[_0x1c9a('0x40')](_0x583bd9[_0x1c9a('0x47')],function(_0x4dfa0f){return{'membername':_0x4dfa0f[_0x1c9a('0x2d')],'UserId':_0x4dfa0f['id'],'queue_name':_0x5b3d94[_0x1c9a('0x2d')],'SmsQueueId':_0x5b3d94['id'],'interface':util['format'](_0x1c9a('0x60'),'SIP',_0x4dfa0f[_0x1c9a('0x2d')]),'penalty':0x0,'paused':_0x4dfa0f['smsPause'],'createdAt':_0x4dfa0f[_0x1c9a('0x61')],'updatedAt':_0x4dfa0f[_0x1c9a('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1c9a('0x27')](respondWithFilteredResult(_0x4d2f01,_0x59f87b))[_0x1c9a('0x48')](handleError(_0x4d2f01,null));};exports['getTeams']=function(_0x2a1b63,_0x26f4a4,_0x1b969b){var _0x2f4e95={};var _0x59495f={};var _0x3c8f53;var _0x97697e;return db['SmsQueue'][_0x1c9a('0x62')]({'where':{'id':_0x2a1b63['params']['id']}})[_0x1c9a('0x27')](handleEntityNotFound(_0x26f4a4,null))['then'](function(_0x2b579a){if(_0x2b579a){_0x3c8f53=_0x2b579a;_0x59495f['model']=_[_0x1c9a('0x33')](db[_0x1c9a('0x63')]['rawAttributes']);_0x59495f[_0x1c9a('0x34')]=_[_0x1c9a('0x33')](_0x2a1b63['query']);_0x59495f[_0x1c9a('0x35')]=_[_0x1c9a('0x36')](_0x59495f[_0x1c9a('0x32')],_0x59495f['query']);_0x2f4e95['attributes']=_[_0x1c9a('0x36')](_0x59495f['model'],qs[_0x1c9a('0x38')](_0x2a1b63[_0x1c9a('0x34')]['fields']));_0x2f4e95['attributes']=_0x2f4e95[_0x1c9a('0x37')]['length']?_0x2f4e95[_0x1c9a('0x37')]:_0x59495f[_0x1c9a('0x32')];_0x2f4e95[_0x1c9a('0x5a')]=qs[_0x1c9a('0x3b')](_0x2a1b63['query'][_0x1c9a('0x3b')]);_0x2f4e95['where']=qs['filters'](_['pick'](_0x2a1b63[_0x1c9a('0x34')],_0x59495f[_0x1c9a('0x35')]));if(_0x2a1b63[_0x1c9a('0x34')][_0x1c9a('0x3d')]){_0x2f4e95[_0x1c9a('0x3e')]=_[_0x1c9a('0x3f')](_0x2f4e95[_0x1c9a('0x3e')],{'$or':_[_0x1c9a('0x40')](_0x2f4e95[_0x1c9a('0x37')],function(_0x1c9e86){var _0x24cfe5={};_0x24cfe5[_0x1c9e86]={'$like':'%'+_0x2a1b63[_0x1c9a('0x34')][_0x1c9a('0x3d')]+'%'};return _0x24cfe5;})});}_0x2f4e95=_[_0x1c9a('0x3f')]({},_0x2f4e95,_0x2a1b63['options']);return _0x3c8f53[_0x1c9a('0x64')](_0x2f4e95);}})[_0x1c9a('0x27')](function(_0x17d9d7){if(_0x17d9d7){_0x97697e=_0x17d9d7[_0x1c9a('0x39')];if(!_0x2a1b63[_0x1c9a('0x34')][_0x1c9a('0x59')](_0x1c9a('0x3a'))){_0x2f4e95['limit']=qs[_0x1c9a('0x21')](_0x2a1b63[_0x1c9a('0x34')]['limit']);_0x2f4e95['offset']=qs['offset'](_0x2a1b63[_0x1c9a('0x34')]['offset']);}return _0x3c8f53['getTeams'](_0x2f4e95);}})[_0x1c9a('0x27')](function(_0x28f8cd){if(_0x28f8cd){return _0x28f8cd?{'count':_0x97697e,'rows':_0x28f8cd}:null;}})['then'](respondWithResult(_0x26f4a4,null))[_0x1c9a('0x48')](handleError(_0x26f4a4,null));};exports[_0x1c9a('0x65')]=function(_0x583e44,_0x1369ba,_0x268f68){var _0xc34c60=_0x583e44[_0x1c9a('0x4d')][_0x1c9a('0x66')];return db[_0x1c9a('0x63')][_0x1c9a('0x46')]({'where':{'id':_[_0x1c9a('0x40')](_0xc34c60,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1c9a('0x67'),'attributes':['id',_0x1c9a('0x2d'),_0x1c9a('0x68'),_0x1c9a('0x69'),_0x1c9a('0x6a')],'raw':!![]}]})[_0x1c9a('0x27')](function(_0x47b9ee){if(_0x47b9ee){var _0x2c55cc=_['flatMap'](_0x47b9ee,function(_0x2973ac){var _0xdeefe9=_0x2973ac[_0x1c9a('0x29')]({'plain':!![]});return _0xdeefe9[_0x1c9a('0x67')];});return db[_0x1c9a('0x30')]['find']({'where':{'id':_0x583e44['params']['id']}})[_0x1c9a('0x27')](function(_0xad140e){return db[_0x1c9a('0x6b')][_0x1c9a('0x6c')](function(_0x43b344){return _0xad140e[_0x1c9a('0x65')](_[_0x1c9a('0x40')](_0xc34c60,'id'),{'transaction':_0x43b344})[_0x1c9a('0x27')](function(){return BPromise[_0x1c9a('0x6d')](_0x2c55cc,function(_0x35c28a){return db[_0x1c9a('0x58')][_0x1c9a('0x6e')]({'where':{'UserId':_0x35c28a['id'],'SmsQueueId':_0x583e44[_0x1c9a('0x49')]['id']},'transaction':_0x43b344});});})[_0x1c9a('0x27')](function(){_0x2c55cc[_0x1c9a('0x6f')](function(_0x12fb5e){socket[_0x1c9a('0x70')](_0x1c9a('0x71'),{'UserId':_0x12fb5e['id'],'SmsQueueId':_0xad140e['id']});});});});});}})[_0x1c9a('0x27')](respondWithStatusCode(_0x1369ba,null))[_0x1c9a('0x48')](handleError(_0x1369ba,null));};exports[_0x1c9a('0x72')]=function(_0x597538,_0x2449e0,_0x5296af){return db[_0x1c9a('0x63')]['findAll']({'where':{'id':_0x597538[_0x1c9a('0x34')][_0x1c9a('0x73')]},'attributes':['id'],'include':[{'model':db[_0x1c9a('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1c9a('0x27')](handleEntityNotFound(_0x2449e0,null))[_0x1c9a('0x27')](function(_0x12f6ed){var _0x3063eb=_[_0x1c9a('0x40')](_0x12f6ed,'id');var _0xf67fbe=[];var _0x5e75fb=[];var _0x324b9e=squel[_0x1c9a('0x74')]();_0x324b9e['field'](_0x1c9a('0x75'))['from'](_0x1c9a('0x76'),'tq')[_0x1c9a('0x77')](_0x1c9a('0x78'),'ut',_0x1c9a('0x79'))['where']('SmsQueueId\x20=\x20?',_0x597538['params']['id']);for(var _0x3fc229=0x0;_0x3fc229<_0x12f6ed[_0x1c9a('0x39')];_0x3fc229+=0x1){let _0x3a831d=_0x12f6ed[_0x3fc229];for(var _0x1a7f4d=0x0;_0x1a7f4d<_0x3a831d[_0x1c9a('0x67')][_0x1c9a('0x39')];_0x1a7f4d+=0x1){let _0x39467f=_0x3a831d[_0x1c9a('0x67')][_0x1a7f4d];var _0x104a99=_0x324b9e[_0x1c9a('0x7a')]();_0x104a99['where'](_0x1c9a('0x7b'),_0x39467f['id']);_0x5e75fb[_0x1c9a('0x7c')](db[_0x1c9a('0x6b')][_0x1c9a('0x34')](_0x104a99[_0x1c9a('0x7d')](),{'type':db['sequelize'][_0x1c9a('0x7e')][_0x1c9a('0x7f')]})[_0x1c9a('0x27')](function(_0x1bec50){if(_0x1bec50[_0x1c9a('0x39')]===0x1){return _0x39467f['id'];}else{var _0x2bbd63=_['every'](_[_0x1c9a('0x40')](_0x1bec50,_0x1c9a('0x80')),function(_0x1bde13){return _[_0x1c9a('0x81')](_0x3063eb,_0x1bde13);});if(_0x2bbd63){return _0x39467f['id'];}}}));}}return BPromise[_0x1c9a('0x82')](_0x5e75fb)[_0x1c9a('0x27')](function(_0x48d173){_0xf67fbe=_(_0xf67fbe)[_0x1c9a('0x83')](_0x48d173)[_0x1c9a('0x84')]()[_0x1c9a('0x85')]();return db[_0x1c9a('0x30')][_0x1c9a('0x4b')]({'where':{'id':_0x597538['params']['id']}})[_0x1c9a('0x27')](function(_0x5da20d){return db[_0x1c9a('0x6b')][_0x1c9a('0x6c')](function(_0x30a819){return _0x5da20d[_0x1c9a('0x72')](_0x597538['query'][_0x1c9a('0x73')],{'transaction':_0x30a819})[_0x1c9a('0x27')](function(){if(!_[_0x1c9a('0x86')](_0xf67fbe)){return _0x5da20d[_0x1c9a('0x87')](_0xf67fbe,{'transaction':_0x30a819});}})[_0x1c9a('0x27')](function(){_0xf67fbe[_0x1c9a('0x6f')](function(_0x117165){socket['emit'](_0x1c9a('0x88'),{'UserId':_0x117165,'SmsQueueId':_0x5da20d['id']});});});});});});})['then'](respondWithStatusCode(_0x2449e0,null))[_0x1c9a('0x48')](handleError(_0x2449e0,null));};exports['addAgents']=function(_0x53e923,_0x1ad8e7,_0x171573){return db['SmsQueue'][_0x1c9a('0x4b')]({'where':{'id':_0x53e923['params']['id']}})[_0x1c9a('0x27')](handleEntityNotFound(_0x1ad8e7,null))['then'](function(_0x1a2162){if(_0x1a2162){return _0x1a2162['addAgents'](_0x53e923[_0x1c9a('0x4d')]['ids'],_[_0x1c9a('0x89')](_0x53e923[_0x1c9a('0x4d')],[_0x1c9a('0x73'),'id'])||{})['spread'](function(_0x2c737b){for(var _0x4487e2=0x0;_0x4487e2<_0x53e923[_0x1c9a('0x4d')][_0x1c9a('0x73')]['length'];_0x4487e2+=0x1){socket['emit']('userSmsQueue:save',{'UserId':_0x53e923[_0x1c9a('0x4d')][_0x1c9a('0x73')][_0x4487e2],'SmsQueueId':_0x53e923[_0x1c9a('0x49')]['id']});}return _0x2c737b;});}})['then'](respondWithResult(_0x1ad8e7,null))['catch'](handleError(_0x1ad8e7,null));};exports[_0x1c9a('0x87')]=function(_0x537ec9,_0x1cdd0c,_0x382d42){return db[_0x1c9a('0x30')][_0x1c9a('0x4b')]({'where':{'id':_0x537ec9[_0x1c9a('0x49')]['id']}})[_0x1c9a('0x27')](handleEntityNotFound(_0x1cdd0c,null))[_0x1c9a('0x27')](function(_0x28c43b){if(_0x28c43b){return _0x28c43b[_0x1c9a('0x87')](_0x537ec9[_0x1c9a('0x34')][_0x1c9a('0x73')])[_0x1c9a('0x27')](function(){if(_['isArray'](_0x537ec9[_0x1c9a('0x34')][_0x1c9a('0x73')])){for(var _0x2112fc=0x0;_0x2112fc<_0x537ec9['query'][_0x1c9a('0x73')][_0x1c9a('0x39')];_0x2112fc+=0x1){socket[_0x1c9a('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x537ec9[_0x1c9a('0x34')][_0x1c9a('0x73')][_0x2112fc]),'SmsQueueId':Number(_0x537ec9[_0x1c9a('0x49')]['id'])});}}else{socket[_0x1c9a('0x70')](_0x1c9a('0x88'),{'UserId':Number(_0x537ec9[_0x1c9a('0x34')][_0x1c9a('0x73')]),'SmsQueueId':Number(_0x537ec9[_0x1c9a('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x1cdd0c,null))[_0x1c9a('0x48')](handleError(_0x1cdd0c,null));};exports[_0x1c9a('0x8a')]=function(_0x2e3ed0,_0x20820d,_0x3f0fba){var _0x56e83f={};var _0x401df={};var _0xf0b032;var _0x4134fb;return db[_0x1c9a('0x30')]['findOne']({'where':{'id':_0x2e3ed0['params']['id']}})[_0x1c9a('0x27')](handleEntityNotFound(_0x20820d,null))[_0x1c9a('0x27')](function(_0x26bc1c){if(_0x26bc1c){_0xf0b032=_0x26bc1c;_0x401df[_0x1c9a('0x32')]=_[_0x1c9a('0x33')](db[_0x1c9a('0x5c')][_0x1c9a('0x31')]);_0x401df['query']=_['keys'](_0x2e3ed0['query']);_0x401df[_0x1c9a('0x35')]=_[_0x1c9a('0x36')](_0x401df['model'],_0x401df['query']);_0x56e83f[_0x1c9a('0x37')]=_[_0x1c9a('0x36')](_0x401df[_0x1c9a('0x32')],qs[_0x1c9a('0x38')](_0x2e3ed0[_0x1c9a('0x34')][_0x1c9a('0x38')]));_0x56e83f[_0x1c9a('0x37')]=_0x56e83f[_0x1c9a('0x37')][_0x1c9a('0x39')]?_0x56e83f[_0x1c9a('0x37')]:_0x401df[_0x1c9a('0x32')];_0x56e83f['order']=qs[_0x1c9a('0x3b')](_0x2e3ed0[_0x1c9a('0x34')]['sort']);_0x56e83f[_0x1c9a('0x3e')]=qs[_0x1c9a('0x35')](_[_0x1c9a('0x3c')](_0x2e3ed0[_0x1c9a('0x34')],_0x401df[_0x1c9a('0x35')]));if(_0x2e3ed0['query'][_0x1c9a('0x3d')]){_0x56e83f['where']=_[_0x1c9a('0x3f')](_0x56e83f['where'],{'$or':_['map'](_0x56e83f[_0x1c9a('0x37')],function(_0x498ad7){var _0x52168c={};_0x52168c[_0x498ad7]={'$like':'%'+_0x2e3ed0[_0x1c9a('0x34')][_0x1c9a('0x3d')]+'%'};return _0x52168c;})});}_0x56e83f=_[_0x1c9a('0x3f')]({},_0x56e83f,_0x2e3ed0[_0x1c9a('0x44')]);return _0xf0b032['getAgents'](_0x56e83f);}})['then'](function(_0x53e424){if(_0x53e424){_0x4134fb=_0x53e424[_0x1c9a('0x39')];if(!_0x2e3ed0['query'][_0x1c9a('0x59')](_0x1c9a('0x3a'))){_0x56e83f['limit']=qs[_0x1c9a('0x21')](_0x2e3ed0[_0x1c9a('0x34')][_0x1c9a('0x21')]);_0x56e83f[_0x1c9a('0x20')]=qs[_0x1c9a('0x20')](_0x2e3ed0[_0x1c9a('0x34')][_0x1c9a('0x20')]);}return _0xf0b032[_0x1c9a('0x8a')](_0x56e83f);}})[_0x1c9a('0x27')](function(_0x10b997){if(_0x10b997){return _0x10b997?{'count':_0x4134fb,'rows':_0x10b997}:null;}})[_0x1c9a('0x27')](respondWithResult(_0x20820d,null))[_0x1c9a('0x48')](handleError(_0x20820d,null));}; \ No newline at end of file +var _0x1a66=['../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','offset','set','Content-Range','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','map','key','VIRTUAL','field','options','count','includeAll','include','SmsQueue','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','sort','SmsQueueId','filter','findAll','User','UserId','agent','createdAt','rows','format','%s/%s','smsPause','updatedAt','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','select','from','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x1a66,0x102));var _0x61a6=function(_0x3824ac,_0x985e2d){_0x3824ac=_0x3824ac-0x0;var _0x2965e2=_0x1a66[_0x3824ac];return _0x2965e2;};'use strict';var pdf=require(_0x61a6('0x0'));var emlformat=require(_0x61a6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x61a6('0x2'));var rp=require(_0x61a6('0x3'));var moment=require('moment');var BPromise=require(_0x61a6('0x4'));var Mustache=require('mustache');var util=require(_0x61a6('0x5'));var path=require(_0x61a6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x61a6('0x7'));var fs=require('fs');var _=require(_0x61a6('0x8'));var squel=require(_0x61a6('0x9'));var crypto=require(_0x61a6('0xa'));var jsforce=require(_0x61a6('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x61a6('0xc'));var Papa=require(_0x61a6('0xd'));var Redis=require(_0x61a6('0xe'));var authService=require(_0x61a6('0xf'));var qs=require(_0x61a6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61a6('0x11'))(_0x61a6('0x12'));var utils=require(_0x61a6('0x13'));var config=require(_0x61a6('0x14'));var db=require(_0x61a6('0x15'))['db'];config[_0x61a6('0x16')]=_['defaults'](config[_0x61a6('0x16')],{'host':_0x61a6('0x17'),'port':0x18eb});var socket=require(_0x61a6('0x18'))(new Redis(config[_0x61a6('0x16')]));require(_0x61a6('0x19'))[_0x61a6('0x1a')](socket);function respondWithStatusCode(_0x12677b,_0x1e9931){_0x1e9931=_0x1e9931||0xcc;return function(_0x53a79c){if(_0x53a79c){return _0x12677b[_0x61a6('0x1b')](_0x1e9931);}return _0x12677b[_0x61a6('0x1c')](_0x1e9931)['end']();};}function respondWithResult(_0x1dac1f,_0x4459d7){_0x4459d7=_0x4459d7||0xc8;return function(_0x24b2a3){if(_0x24b2a3){return _0x1dac1f[_0x61a6('0x1c')](_0x4459d7)['json'](_0x24b2a3);}};}function respondWithFilteredResult(_0x147933,_0x3f94fc){return function(_0x5cf8ee){if(_0x5cf8ee){var _0x350998=_0x5cf8ee['count'],_0x4a625e=_0x3f94fc[_0x61a6('0x1d')],_0x25f455=_0x3f94fc[_0x61a6('0x1d')]+_0x3f94fc['limit'],_0x3cce09;if(_0x25f455>=_0x350998){_0x25f455=_0x350998;_0x3cce09=0xc8;}else{_0x3cce09=0xce;}_0x147933['status'](_0x3cce09);return _0x147933[_0x61a6('0x1e')](_0x61a6('0x1f'),_0x4a625e+'-'+_0x25f455+'/'+_0x350998)['json'](_0x5cf8ee);}return null;};}function patchUpdates(_0x340561){return function(_0x50b5f9){try{jsonpatch[_0x61a6('0x20')](_0x50b5f9,_0x340561,!![]);}catch(_0x26d106){return BPromise[_0x61a6('0x21')](_0x26d106);}return _0x50b5f9['save']();};}function saveUpdates(_0x2e31dc,_0x3d7db3){return function(_0x37a325){if(_0x37a325){return _0x37a325[_0x61a6('0x22')](_0x2e31dc)[_0x61a6('0x23')](function(_0x499a80){return _0x499a80;});}return null;};}function removeEntity(_0x1932e7,_0x56180f){return function(_0x53c2f3){if(_0x53c2f3){return _0x53c2f3[_0x61a6('0x24')]()[_0x61a6('0x23')](function(){var _0x210d75=_0x53c2f3[_0x61a6('0x25')]({'plain':!![]});var _0x14aef7=_0x61a6('0x26');return db[_0x61a6('0x27')][_0x61a6('0x24')]({'where':{'type':_0x14aef7,'resourceId':_0x210d75['id']}})[_0x61a6('0x23')](function(){return _0x53c2f3;});})[_0x61a6('0x23')](function(){_0x1932e7['status'](0xcc)[_0x61a6('0x28')]();});}};}function handleEntityNotFound(_0x4f4bf5,_0x3d11f4){return function(_0x24d808){if(!_0x24d808){_0x4f4bf5[_0x61a6('0x1b')](0x194);}return _0x24d808;};}function handleError(_0x317876,_0x8b7b69){_0x8b7b69=_0x8b7b69||0x1f4;return function(_0x228703){logger[_0x61a6('0x29')](_0x228703[_0x61a6('0x2a')]);if(_0x228703[_0x61a6('0x2b')]){delete _0x228703[_0x61a6('0x2b')];}_0x317876[_0x61a6('0x1c')](_0x8b7b69)[_0x61a6('0x2c')](_0x228703);};}exports[_0x61a6('0x2d')]=function(_0x5af12f,_0x459bea){var _0x3195e2={},_0x1c74a7={},_0x15ac42={'count':0x0,'rows':[]};var _0x582b11=db['SmsQueue'][_0x61a6('0x2e')];_0x1c74a7[_0x61a6('0x2f')]=_[_0x61a6('0x30')](_0x582b11);_0x1c74a7[_0x61a6('0x31')]=_[_0x61a6('0x30')](_0x5af12f[_0x61a6('0x31')]);_0x1c74a7[_0x61a6('0x32')]=_[_0x61a6('0x33')](_0x1c74a7['model'],_0x1c74a7['query']);_0x3195e2['attributes']=_[_0x61a6('0x33')](_0x1c74a7[_0x61a6('0x2f')],qs[_0x61a6('0x34')](_0x5af12f[_0x61a6('0x31')][_0x61a6('0x34')]));_0x3195e2[_0x61a6('0x35')]=_0x3195e2['attributes'][_0x61a6('0x36')]?_0x3195e2[_0x61a6('0x35')]:_0x1c74a7[_0x61a6('0x2f')];if(!_0x5af12f[_0x61a6('0x31')][_0x61a6('0x37')](_0x61a6('0x38'))){_0x3195e2[_0x61a6('0x39')]=qs[_0x61a6('0x39')](_0x5af12f[_0x61a6('0x31')][_0x61a6('0x39')]);_0x3195e2[_0x61a6('0x1d')]=qs[_0x61a6('0x1d')](_0x5af12f[_0x61a6('0x31')][_0x61a6('0x1d')]);}_0x3195e2[_0x61a6('0x3a')]=qs['sort'](_0x5af12f['query']['sort']);_0x3195e2[_0x61a6('0x3b')]=qs[_0x61a6('0x32')](_[_0x61a6('0x3c')](_0x5af12f[_0x61a6('0x31')],_0x1c74a7[_0x61a6('0x32')]));if(_0x5af12f['query']['filter']){_0x3195e2[_0x61a6('0x3b')]=_[_0x61a6('0x3d')](_0x3195e2[_0x61a6('0x3b')],{'$or':_[_0x61a6('0x3e')](_0x582b11,function(_0xaf95ce){if(_0xaf95ce['type'][_0x61a6('0x3f')]!==_0x61a6('0x40')){var _0x21e918={};_0x21e918[_0xaf95ce[_0x61a6('0x41')]]={'$like':'%'+_0x5af12f[_0x61a6('0x31')]['filter']+'%'};return _0x21e918;}})});}_0x3195e2=_[_0x61a6('0x3d')]({},_0x3195e2,_0x5af12f[_0x61a6('0x42')]);var _0xf86582={'where':_0x3195e2[_0x61a6('0x3b')]};return db['SmsQueue'][_0x61a6('0x43')](_0xf86582)[_0x61a6('0x23')](function(_0x44f416){_0x15ac42[_0x61a6('0x43')]=_0x44f416;if(_0x5af12f[_0x61a6('0x31')][_0x61a6('0x44')]){_0x3195e2[_0x61a6('0x45')]=[{'all':!![]}];}return db[_0x61a6('0x46')]['findAll'](_0x3195e2);})[_0x61a6('0x23')](function(_0x3a448f){_0x15ac42['rows']=_0x3a448f;return _0x15ac42;})[_0x61a6('0x23')](respondWithFilteredResult(_0x459bea,_0x3195e2))['catch'](handleError(_0x459bea,null));};exports[_0x61a6('0x47')]=function(_0x38d1df,_0x1ad288){var _0x29f95f={'raw':!![],'where':{'id':_0x38d1df[_0x61a6('0x48')]['id']}},_0x48fdff={};_0x48fdff['model']=_[_0x61a6('0x30')](db['SmsQueue']['rawAttributes']);_0x48fdff[_0x61a6('0x31')]=_['keys'](_0x38d1df[_0x61a6('0x31')]);_0x48fdff[_0x61a6('0x32')]=_['intersection'](_0x48fdff[_0x61a6('0x2f')],_0x48fdff[_0x61a6('0x31')]);_0x29f95f[_0x61a6('0x35')]=_['intersection'](_0x48fdff[_0x61a6('0x2f')],qs[_0x61a6('0x34')](_0x38d1df[_0x61a6('0x31')]['fields']));_0x29f95f[_0x61a6('0x35')]=_0x29f95f['attributes']['length']?_0x29f95f[_0x61a6('0x35')]:_0x48fdff[_0x61a6('0x2f')];if(_0x38d1df[_0x61a6('0x31')][_0x61a6('0x44')]){_0x29f95f[_0x61a6('0x45')]=[{'all':!![]}];}_0x29f95f=_['merge']({},_0x29f95f,_0x38d1df[_0x61a6('0x42')]);return db[_0x61a6('0x46')][_0x61a6('0x49')](_0x29f95f)['then'](handleEntityNotFound(_0x1ad288,null))['then'](respondWithResult(_0x1ad288,null))[_0x61a6('0x4a')](handleError(_0x1ad288,null));};exports[_0x61a6('0x4b')]=function(_0x4fd0c4,_0xf7b97a){return db[_0x61a6('0x46')][_0x61a6('0x4b')](_0x4fd0c4[_0x61a6('0x4c')],{})[_0x61a6('0x23')](function(_0x580d74){var _0x25ce76=_0x4fd0c4[_0x61a6('0x4d')][_0x61a6('0x25')]({'plain':!![]});if(!_0x25ce76)throw new Error(_0x61a6('0x4e'));if(_0x25ce76['role']==='user'){var _0x50c016=_0x580d74[_0x61a6('0x25')]({'plain':!![]});var _0x8780f2=_0x61a6('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x8780f2,'userProfileId':_0x25ce76['userProfileId']},'raw':!![]})[_0x61a6('0x23')](function(_0x3494ac){if(_0x3494ac&&_0x3494ac[_0x61a6('0x4f')]===0x0){return db[_0x61a6('0x27')][_0x61a6('0x4b')]({'name':_0x50c016['name'],'resourceId':_0x50c016['id'],'type':_0x3494ac['name'],'sectionId':_0x3494ac['id']},{})['then'](function(){return _0x580d74;});}else{return _0x580d74;}})[_0x61a6('0x4a')](function(_0xb5a05d){logger[_0x61a6('0x29')](_0x61a6('0x50'),_0xb5a05d);throw _0xb5a05d;});}return _0x580d74;})[_0x61a6('0x23')](respondWithResult(_0xf7b97a,0xc9))[_0x61a6('0x4a')](handleError(_0xf7b97a,null));};exports['update']=function(_0x39f02f,_0x1e4c30){if(_0x39f02f[_0x61a6('0x4c')]['id']){delete _0x39f02f[_0x61a6('0x4c')]['id'];}return db[_0x61a6('0x46')][_0x61a6('0x49')]({'where':{'id':_0x39f02f['params']['id']}})['then'](handleEntityNotFound(_0x1e4c30,null))['then'](saveUpdates(_0x39f02f['body'],null))['then'](respondWithResult(_0x1e4c30,null))[_0x61a6('0x4a')](handleError(_0x1e4c30,null));};exports[_0x61a6('0x24')]=function(_0x4663c4,_0x1af208){return db['SmsQueue'][_0x61a6('0x49')]({'where':{'id':_0x4663c4['params']['id']}})[_0x61a6('0x23')](handleEntityNotFound(_0x1af208,null))['then'](removeEntity(_0x1af208,null))['catch'](handleError(_0x1af208,null));};exports[_0x61a6('0x51')]=function(_0x446c13,_0x20bb1b){return db['SmsQueue'][_0x61a6('0x51')]()[_0x61a6('0x23')](respondWithResult(_0x20bb1b,null))[_0x61a6('0x4a')](handleError(_0x20bb1b,null));};exports[_0x61a6('0x52')]=function(_0x26b43f,_0x5c58d1,_0x237a19){var _0x24dd29={'raw':!![],'where':{}},_0x701cb5={},_0x5e1565;return db[_0x61a6('0x46')][_0x61a6('0x53')]({'where':{'id':_0x26b43f[_0x61a6('0x48')]['id']}})[_0x61a6('0x23')](handleEntityNotFound(_0x5c58d1,null))[_0x61a6('0x23')](function(_0x3b2303){if(_0x3b2303){_0x5e1565=_0x3b2303[_0x61a6('0x25')]({'plain':!![]});_0x701cb5[_0x61a6('0x2f')]=_['keys'](db[_0x61a6('0x54')]['rawAttributes']);_0x701cb5[_0x61a6('0x31')]=_[_0x61a6('0x30')](_0x26b43f[_0x61a6('0x31')]);_0x701cb5[_0x61a6('0x32')]=_[_0x61a6('0x33')](_0x701cb5['model'],_0x701cb5[_0x61a6('0x31')]);_0x24dd29[_0x61a6('0x35')]=_[_0x61a6('0x33')](_0x701cb5[_0x61a6('0x2f')],qs[_0x61a6('0x34')](_0x26b43f['query'][_0x61a6('0x34')]));_0x24dd29[_0x61a6('0x35')]=_0x24dd29[_0x61a6('0x35')][_0x61a6('0x36')]?_0x24dd29[_0x61a6('0x35')]:_0x701cb5[_0x61a6('0x2f')];if(!_0x26b43f[_0x61a6('0x31')]['hasOwnProperty'](_0x61a6('0x38'))){_0x24dd29['limit']=qs['limit'](_0x26b43f[_0x61a6('0x31')][_0x61a6('0x39')]);_0x24dd29[_0x61a6('0x1d')]=qs[_0x61a6('0x1d')](_0x26b43f[_0x61a6('0x31')][_0x61a6('0x1d')]);}_0x24dd29[_0x61a6('0x3a')]=qs[_0x61a6('0x55')](_0x26b43f[_0x61a6('0x31')]['sort']);_0x24dd29[_0x61a6('0x3b')]=qs[_0x61a6('0x32')](_['pick'](_0x26b43f[_0x61a6('0x31')],_0x701cb5[_0x61a6('0x32')]));_0x24dd29[_0x61a6('0x3b')][_0x61a6('0x56')]=_0x3b2303['id'];if(_0x26b43f['query'][_0x61a6('0x57')]){_0x24dd29[_0x61a6('0x3b')]=_[_0x61a6('0x3d')](_0x24dd29[_0x61a6('0x3b')],{'$or':_[_0x61a6('0x3e')](_0x24dd29[_0x61a6('0x35')],function(_0x527889){var _0x3473dd={};_0x3473dd[_0x527889]={'$like':'%'+_0x26b43f[_0x61a6('0x31')]['filter']+'%'};return _0x3473dd;})});}_0x24dd29=_[_0x61a6('0x3d')]({},_0x24dd29,_0x26b43f['options']);return db[_0x61a6('0x54')][_0x61a6('0x58')](_0x24dd29);}})['then'](function(_0x5c8a24){if(_0x5c8a24){return db[_0x61a6('0x59')]['findAndCountAll']({'where':{'id':_[_0x61a6('0x3e')](_0x5c8a24,_0x61a6('0x5a')),'role':_0x61a6('0x5b')},'attributes':['id',_0x61a6('0x2b'),'smsPause','updatedAt',_0x61a6('0x5c')]});}})[_0x61a6('0x23')](function(_0x48ff50){if(_0x48ff50){return{'count':_0x48ff50['count'],'rows':_[_0x61a6('0x3e')](_0x48ff50[_0x61a6('0x5d')],function(_0x5bbb38){return{'membername':_0x5bbb38[_0x61a6('0x2b')],'UserId':_0x5bbb38['id'],'queue_name':_0x5e1565[_0x61a6('0x2b')],'SmsQueueId':_0x5e1565['id'],'interface':util[_0x61a6('0x5e')](_0x61a6('0x5f'),'SIP',_0x5bbb38[_0x61a6('0x2b')]),'penalty':0x0,'paused':_0x5bbb38[_0x61a6('0x60')],'createdAt':_0x5bbb38[_0x61a6('0x5c')],'updatedAt':_0x5bbb38[_0x61a6('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x61a6('0x23')](respondWithFilteredResult(_0x5c58d1,_0x24dd29))[_0x61a6('0x4a')](handleError(_0x5c58d1,null));};exports[_0x61a6('0x62')]=function(_0x4dfdb8,_0x23a822,_0x4c674c){var _0x19f329={};var _0x1f92af={};var _0xa6ed3d;var _0x3ec0ab;return db[_0x61a6('0x46')][_0x61a6('0x53')]({'where':{'id':_0x4dfdb8['params']['id']}})[_0x61a6('0x23')](handleEntityNotFound(_0x23a822,null))['then'](function(_0x219723){if(_0x219723){_0xa6ed3d=_0x219723;_0x1f92af[_0x61a6('0x2f')]=_[_0x61a6('0x30')](db[_0x61a6('0x63')][_0x61a6('0x2e')]);_0x1f92af[_0x61a6('0x31')]=_['keys'](_0x4dfdb8['query']);_0x1f92af[_0x61a6('0x32')]=_[_0x61a6('0x33')](_0x1f92af[_0x61a6('0x2f')],_0x1f92af[_0x61a6('0x31')]);_0x19f329[_0x61a6('0x35')]=_[_0x61a6('0x33')](_0x1f92af[_0x61a6('0x2f')],qs[_0x61a6('0x34')](_0x4dfdb8[_0x61a6('0x31')][_0x61a6('0x34')]));_0x19f329[_0x61a6('0x35')]=_0x19f329[_0x61a6('0x35')][_0x61a6('0x36')]?_0x19f329[_0x61a6('0x35')]:_0x1f92af[_0x61a6('0x2f')];_0x19f329['order']=qs[_0x61a6('0x55')](_0x4dfdb8[_0x61a6('0x31')][_0x61a6('0x55')]);_0x19f329[_0x61a6('0x3b')]=qs[_0x61a6('0x32')](_[_0x61a6('0x3c')](_0x4dfdb8[_0x61a6('0x31')],_0x1f92af[_0x61a6('0x32')]));if(_0x4dfdb8[_0x61a6('0x31')][_0x61a6('0x57')]){_0x19f329[_0x61a6('0x3b')]=_[_0x61a6('0x3d')](_0x19f329[_0x61a6('0x3b')],{'$or':_[_0x61a6('0x3e')](_0x19f329[_0x61a6('0x35')],function(_0x36e3d7){var _0x2bf71f={};_0x2bf71f[_0x36e3d7]={'$like':'%'+_0x4dfdb8[_0x61a6('0x31')]['filter']+'%'};return _0x2bf71f;})});}_0x19f329=_[_0x61a6('0x3d')]({},_0x19f329,_0x4dfdb8[_0x61a6('0x42')]);return _0xa6ed3d[_0x61a6('0x62')](_0x19f329);}})[_0x61a6('0x23')](function(_0x57c4cf){if(_0x57c4cf){_0x3ec0ab=_0x57c4cf['length'];if(!_0x4dfdb8[_0x61a6('0x31')][_0x61a6('0x37')](_0x61a6('0x38'))){_0x19f329[_0x61a6('0x39')]=qs['limit'](_0x4dfdb8[_0x61a6('0x31')]['limit']);_0x19f329['offset']=qs[_0x61a6('0x1d')](_0x4dfdb8[_0x61a6('0x31')][_0x61a6('0x1d')]);}return _0xa6ed3d[_0x61a6('0x62')](_0x19f329);}})[_0x61a6('0x23')](function(_0x290383){if(_0x290383){return _0x290383?{'count':_0x3ec0ab,'rows':_0x290383}:null;}})[_0x61a6('0x23')](respondWithResult(_0x23a822,null))[_0x61a6('0x4a')](handleError(_0x23a822,null));};exports[_0x61a6('0x64')]=function(_0x1e6b07,_0x342044,_0x2c1500){var _0x5130ac=_0x1e6b07[_0x61a6('0x4c')][_0x61a6('0x65')];return db[_0x61a6('0x63')][_0x61a6('0x58')]({'where':{'id':_[_0x61a6('0x3e')](_0x5130ac,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x61a6('0x2b'),_0x61a6('0x66'),_0x61a6('0x67'),_0x61a6('0x68')],'raw':!![]}]})[_0x61a6('0x23')](function(_0x1d622c){if(_0x1d622c){var _0xf01c03=_[_0x61a6('0x69')](_0x1d622c,function(_0xde6aab){var _0x94975e=_0xde6aab[_0x61a6('0x25')]({'plain':!![]});return _0x94975e[_0x61a6('0x6a')];});return db['SmsQueue'][_0x61a6('0x49')]({'where':{'id':_0x1e6b07['params']['id']}})[_0x61a6('0x23')](function(_0x482882){return db[_0x61a6('0x6b')][_0x61a6('0x6c')](function(_0x29ef02){return _0x482882[_0x61a6('0x64')](_['map'](_0x5130ac,'id'),{'transaction':_0x29ef02})[_0x61a6('0x23')](function(){return BPromise[_0x61a6('0x6d')](_0xf01c03,function(_0x44976d){return db[_0x61a6('0x54')]['findOrCreate']({'where':{'UserId':_0x44976d['id'],'SmsQueueId':_0x1e6b07['params']['id']},'transaction':_0x29ef02});});})[_0x61a6('0x23')](function(){_0xf01c03[_0x61a6('0x6e')](function(_0x5a5b53){socket[_0x61a6('0x6f')](_0x61a6('0x70'),{'UserId':_0x5a5b53['id'],'SmsQueueId':_0x482882['id']});});});});});}})[_0x61a6('0x23')](respondWithStatusCode(_0x342044,null))[_0x61a6('0x4a')](handleError(_0x342044,null));};exports[_0x61a6('0x71')]=function(_0x4f4f37,_0x596295,_0x471e5a){return db['Team'][_0x61a6('0x58')]({'where':{'id':_0x4f4f37[_0x61a6('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x61a6('0x59')],'as':_0x61a6('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x61a6('0x23')](handleEntityNotFound(_0x596295,null))['then'](function(_0x3015a1){var _0x538034=_['map'](_0x3015a1,'id');var _0x3ad8de=[];var _0x9c73f8=[];var _0x28814f=squel[_0x61a6('0x72')]();_0x28814f['field']('tq.TeamId')[_0x61a6('0x73')](_0x61a6('0x74'),'tq')[_0x61a6('0x75')](_0x61a6('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x4f4f37[_0x61a6('0x48')]['id']);for(var _0x2d0717=0x0;_0x2d0717<_0x3015a1[_0x61a6('0x36')];_0x2d0717+=0x1){let _0xfdbbd8=_0x3015a1[_0x2d0717];for(var _0x54fe6d=0x0;_0x54fe6d<_0xfdbbd8[_0x61a6('0x6a')][_0x61a6('0x36')];_0x54fe6d+=0x1){let _0x5ea4ba=_0xfdbbd8[_0x61a6('0x6a')][_0x54fe6d];var _0x41e274=_0x28814f[_0x61a6('0x77')]();_0x41e274['where'](_0x61a6('0x78'),_0x5ea4ba['id']);_0x9c73f8[_0x61a6('0x79')](db[_0x61a6('0x6b')][_0x61a6('0x31')](_0x41e274[_0x61a6('0x7a')](),{'type':db['sequelize'][_0x61a6('0x7b')][_0x61a6('0x7c')]})[_0x61a6('0x23')](function(_0x2caa04){if(_0x2caa04[_0x61a6('0x36')]===0x1){return _0x5ea4ba['id'];}else{var _0x46fdbb=_['every'](_[_0x61a6('0x3e')](_0x2caa04,_0x61a6('0x7d')),function(_0x45df70){return _[_0x61a6('0x7e')](_0x538034,_0x45df70);});if(_0x46fdbb){return _0x5ea4ba['id'];}}}));}}return BPromise[_0x61a6('0x7f')](_0x9c73f8)[_0x61a6('0x23')](function(_0x133cd4){_0x3ad8de=_(_0x3ad8de)[_0x61a6('0x80')](_0x133cd4)[_0x61a6('0x81')]()[_0x61a6('0x82')]();return db['SmsQueue'][_0x61a6('0x49')]({'where':{'id':_0x4f4f37[_0x61a6('0x48')]['id']}})['then'](function(_0x799b72){return db[_0x61a6('0x6b')][_0x61a6('0x6c')](function(_0x30fc74){return _0x799b72[_0x61a6('0x71')](_0x4f4f37[_0x61a6('0x31')][_0x61a6('0x83')],{'transaction':_0x30fc74})[_0x61a6('0x23')](function(){if(!_[_0x61a6('0x84')](_0x3ad8de)){return _0x799b72[_0x61a6('0x85')](_0x3ad8de,{'transaction':_0x30fc74});}})['then'](function(){_0x3ad8de[_0x61a6('0x6e')](function(_0x481db4){socket['emit'](_0x61a6('0x86'),{'UserId':_0x481db4,'SmsQueueId':_0x799b72['id']});});});});});});})[_0x61a6('0x23')](respondWithStatusCode(_0x596295,null))['catch'](handleError(_0x596295,null));};exports[_0x61a6('0x87')]=function(_0x922e04,_0xb3eab,_0x2927a6){return db[_0x61a6('0x46')][_0x61a6('0x49')]({'where':{'id':_0x922e04[_0x61a6('0x48')]['id']}})[_0x61a6('0x23')](handleEntityNotFound(_0xb3eab,null))[_0x61a6('0x23')](function(_0x2880df){if(_0x2880df){return _0x2880df['addAgents'](_0x922e04['body']['ids'],_[_0x61a6('0x88')](_0x922e04[_0x61a6('0x4c')],[_0x61a6('0x83'),'id'])||{})[_0x61a6('0x89')](function(_0x234003){for(var _0x323937=0x0;_0x323937<_0x922e04[_0x61a6('0x4c')]['ids'][_0x61a6('0x36')];_0x323937+=0x1){socket[_0x61a6('0x6f')](_0x61a6('0x70'),{'UserId':_0x922e04[_0x61a6('0x4c')]['ids'][_0x323937],'SmsQueueId':_0x922e04['params']['id']});}return _0x234003;});}})['then'](respondWithResult(_0xb3eab,null))[_0x61a6('0x4a')](handleError(_0xb3eab,null));};exports[_0x61a6('0x85')]=function(_0x1ac5d6,_0x3ab471,_0x338156){return db[_0x61a6('0x46')][_0x61a6('0x49')]({'where':{'id':_0x1ac5d6[_0x61a6('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ab471,null))[_0x61a6('0x23')](function(_0x441faf){if(_0x441faf){return _0x441faf[_0x61a6('0x85')](_0x1ac5d6[_0x61a6('0x31')][_0x61a6('0x83')])['then'](function(){if(_['isArray'](_0x1ac5d6['query'][_0x61a6('0x83')])){for(var _0x48f260=0x0;_0x48f260<_0x1ac5d6[_0x61a6('0x31')][_0x61a6('0x83')]['length'];_0x48f260+=0x1){socket[_0x61a6('0x6f')]('userSmsQueue:remove',{'UserId':Number(_0x1ac5d6[_0x61a6('0x31')][_0x61a6('0x83')][_0x48f260]),'SmsQueueId':Number(_0x1ac5d6[_0x61a6('0x48')]['id'])});}}else{socket['emit'](_0x61a6('0x86'),{'UserId':Number(_0x1ac5d6['query']['ids']),'SmsQueueId':Number(_0x1ac5d6[_0x61a6('0x48')]['id'])});}});}})[_0x61a6('0x23')](respondWithStatusCode(_0x3ab471,null))[_0x61a6('0x4a')](handleError(_0x3ab471,null));};exports[_0x61a6('0x8a')]=function(_0x260ab7,_0x49e286,_0x295133){var _0x2961cf={};var _0x220be6={};var _0x2b63af;var _0x37f3e1;return db['SmsQueue'][_0x61a6('0x53')]({'where':{'id':_0x260ab7[_0x61a6('0x48')]['id']}})[_0x61a6('0x23')](handleEntityNotFound(_0x49e286,null))[_0x61a6('0x23')](function(_0x18bd8b){if(_0x18bd8b){_0x2b63af=_0x18bd8b;_0x220be6[_0x61a6('0x2f')]=_[_0x61a6('0x30')](db[_0x61a6('0x59')][_0x61a6('0x2e')]);_0x220be6[_0x61a6('0x31')]=_['keys'](_0x260ab7[_0x61a6('0x31')]);_0x220be6['filters']=_[_0x61a6('0x33')](_0x220be6[_0x61a6('0x2f')],_0x220be6[_0x61a6('0x31')]);_0x2961cf[_0x61a6('0x35')]=_[_0x61a6('0x33')](_0x220be6['model'],qs[_0x61a6('0x34')](_0x260ab7['query']['fields']));_0x2961cf['attributes']=_0x2961cf['attributes']['length']?_0x2961cf[_0x61a6('0x35')]:_0x220be6[_0x61a6('0x2f')];_0x2961cf[_0x61a6('0x3a')]=qs[_0x61a6('0x55')](_0x260ab7[_0x61a6('0x31')][_0x61a6('0x55')]);_0x2961cf['where']=qs[_0x61a6('0x32')](_[_0x61a6('0x3c')](_0x260ab7[_0x61a6('0x31')],_0x220be6[_0x61a6('0x32')]));if(_0x260ab7[_0x61a6('0x31')][_0x61a6('0x57')]){_0x2961cf[_0x61a6('0x3b')]=_[_0x61a6('0x3d')](_0x2961cf[_0x61a6('0x3b')],{'$or':_['map'](_0x2961cf['attributes'],function(_0x41c24d){var _0x49edb3={};_0x49edb3[_0x41c24d]={'$like':'%'+_0x260ab7[_0x61a6('0x31')]['filter']+'%'};return _0x49edb3;})});}_0x2961cf=_[_0x61a6('0x3d')]({},_0x2961cf,_0x260ab7[_0x61a6('0x42')]);return _0x2b63af[_0x61a6('0x8a')](_0x2961cf);}})['then'](function(_0x179369){if(_0x179369){_0x37f3e1=_0x179369['length'];if(!_0x260ab7[_0x61a6('0x31')][_0x61a6('0x37')](_0x61a6('0x38'))){_0x2961cf[_0x61a6('0x39')]=qs['limit'](_0x260ab7[_0x61a6('0x31')]['limit']);_0x2961cf[_0x61a6('0x1d')]=qs['offset'](_0x260ab7[_0x61a6('0x31')]['offset']);}return _0x2b63af[_0x61a6('0x8a')](_0x2961cf);}})[_0x61a6('0x23')](function(_0x5cafed){if(_0x5cafed){return _0x5cafed?{'count':_0x37f3e1,'rows':_0x5cafed}:null;}})[_0x61a6('0x23')](respondWithResult(_0x49e286,null))[_0x61a6('0x4a')](handleError(_0x49e286,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 508aece..d316578 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 _0x5b67=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x22dd80,_0x3e1535){var _0x3dd515=function(_0xa80595){while(--_0xa80595){_0x22dd80['push'](_0x22dd80['shift']());}};_0x3dd515(++_0x3e1535);}(_0x5b67,0x11a));var _0x75b6=function(_0x58ec20,_0x45fc3b){_0x58ec20=_0x58ec20-0x0;var _0x2812c0=_0x5b67[_0x58ec20];return _0x2812c0;};'use strict';var EventEmitter=require(_0x75b6('0x0'));var SmsQueue=require(_0x75b6('0x1'))['db'][_0x75b6('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x75b6('0x3')](0x0);var events={'afterCreate':_0x75b6('0x4'),'afterUpdate':_0x75b6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3ce127){return function(_0x1367e5,_0x547ccf,_0x104fa1){SmsQueueEvents[_0x75b6('0x6')](_0x3ce127+':'+_0x1367e5['id'],_0x1367e5);SmsQueueEvents[_0x75b6('0x6')](_0x3ce127,_0x1367e5);_0x104fa1(null);};}for(var e in events){if(events[_0x75b6('0x7')](e)){var event=events[e];SmsQueue[_0x75b6('0x8')](e,emitEvent(event));}}module[_0x75b6('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x0b52=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x0b52,0x1c6));var _0x20b5=function(_0x588ad7,_0x515953){_0x588ad7=_0x588ad7-0x0;var _0x262a83=_0x0b52[_0x588ad7];return _0x262a83;};'use strict';var EventEmitter=require(_0x20b5('0x0'));var SmsQueue=require(_0x20b5('0x1'))['db'][_0x20b5('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x20b5('0x3')](0x0);var events={'afterCreate':_0x20b5('0x4'),'afterUpdate':_0x20b5('0x5'),'afterDestroy':_0x20b5('0x6')};function emitEvent(_0x3c186e){return function(_0x3f4e37,_0x4e1f5e,_0x41ffdb){SmsQueueEvents[_0x20b5('0x7')](_0x3c186e+':'+_0x3f4e37['id'],_0x3f4e37);SmsQueueEvents[_0x20b5('0x7')](_0x3c186e,_0x3f4e37);_0x41ffdb(null);};}for(var e in events){if(events[_0x20b5('0x8')](e)){var event=events[e];SmsQueue[_0x20b5('0x9')](e,emitEvent(event));}}module[_0x20b5('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 d0e1fe5..acd3c6b 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 _0x741c=['../../config/logger','api','moment','bluebird','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x7ec3d6,_0x33d91b){var _0x1b9e86=function(_0x2d8b47){while(--_0x2d8b47){_0x7ec3d6['push'](_0x7ec3d6['shift']());}};_0x1b9e86(++_0x33d91b);}(_0x741c,0x196));var _0xc741=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x741c[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var logger=require(_0xc741('0x2'))(_0xc741('0x3'));var moment=require(_0xc741('0x4'));var BPromise=require(_0xc741('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc741('0x6'));var config=require('../../config/environment');var attributes=require(_0xc741('0x7'));module[_0xc741('0x8')]=function(_0x3708ae,_0x133bc4){return _0x3708ae[_0xc741('0x9')](_0xc741('0xa'),attributes,{'tableName':_0xc741('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['exports','define','SmsQueue','sms_queues','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x46e59f,_0x57c43e){var _0xda4ea7=function(_0x13ede4){while(--_0x13ede4){_0x46e59f['push'](_0x46e59f['shift']());}};_0xda4ea7(++_0x57c43e);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('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 3b9b075..2375219 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 _0xd6ec=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','GetSmsQueue','SmsQueue','options','raw','map','include','model','attributes','catch','ShowSmsQueue','find','then','debug','util'];(function(_0x1117e2,_0x4cdfcf){var _0x17d8a2=function(_0x25aa71){while(--_0x25aa71){_0x1117e2['push'](_0x1117e2['shift']());}};_0x17d8a2(++_0x4cdfcf);}(_0xd6ec,0x6e));var _0xcd6e=function(_0x17d414,_0x333205){_0x17d414=_0x17d414-0x0;var _0x4ecc97=_0xd6ec[_0x17d414];return _0x4ecc97;};'use strict';var _=require('lodash');var util=require(_0xcd6e('0x0'));var moment=require(_0xcd6e('0x1'));var BPromise=require(_0xcd6e('0x2'));var rs=require(_0xcd6e('0x3'));var fs=require('fs');var Redis=require(_0xcd6e('0x4'));var db=require(_0xcd6e('0x5'))['db'];var utils=require(_0xcd6e('0x6'));var logger=require(_0xcd6e('0x7'))(_0xcd6e('0x8'));var config=require(_0xcd6e('0x9'));var jayson=require(_0xcd6e('0xa'));var client=jayson[_0xcd6e('0xb')][_0xcd6e('0xc')]({'port':0x232a});config[_0xcd6e('0xd')]=_[_0xcd6e('0xe')](config[_0xcd6e('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd6e('0xf'))(new Redis(config[_0xcd6e('0xd')]));require('./smsQueue.socket')[_0xcd6e('0x10')](socket);function respondWithRpcPromise(_0x32fb3f,_0x459968,_0x114140){return new BPromise(function(_0x462358,_0x3feabb){return client['request'](_0x32fb3f,_0x114140)['then'](function(_0x197a72){logger['info']('SmsQueue,\x20%s,\x20%s',_0x459968,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x459968,_0xcd6e('0x11'),JSON[_0xcd6e('0x12')](_0x197a72));if(_0x197a72[_0xcd6e('0x13')]){if(_0x197a72[_0xcd6e('0x13')][_0xcd6e('0x14')]===0x1f4){logger[_0xcd6e('0x13')](_0xcd6e('0x15'),_0x459968,_0x197a72[_0xcd6e('0x13')][_0xcd6e('0x16')]);return _0x3feabb(_0x197a72[_0xcd6e('0x13')][_0xcd6e('0x16')]);}logger[_0xcd6e('0x13')]('SmsQueue,\x20%s,\x20%s',_0x459968,_0x197a72[_0xcd6e('0x13')][_0xcd6e('0x16')]);return _0x462358(_0x197a72[_0xcd6e('0x13')][_0xcd6e('0x16')]);}else{logger[_0xcd6e('0x17')]('SmsQueue,\x20%s,\x20%s',_0x459968,'request\x20sent');_0x462358(_0x197a72['result'][_0xcd6e('0x16')]);}})['catch'](function(_0x1a1850){logger['error']('SmsQueue,\x20%s,\x20%s',_0x459968,_0x1a1850);_0x3feabb(_0x1a1850);});});}exports[_0xcd6e('0x18')]=function(_0x2fe263){var _0x359eb2=this;return new Promise(function(_0x564855,_0x1ac183){return db[_0xcd6e('0x19')]['findAll']({'raw':_0x2fe263['options']?_0x2fe263[_0xcd6e('0x1a')][_0xcd6e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2fe263[_0xcd6e('0x1a')]?_0x2fe263[_0xcd6e('0x1a')]['where']||null:null,'attributes':_0x2fe263['options']?_0x2fe263['options']['attributes']||null:null,'limit':_0x2fe263['options']?_0x2fe263[_0xcd6e('0x1a')]['limit']||null:null,'include':_0x2fe263[_0xcd6e('0x1a')]?_0x2fe263[_0xcd6e('0x1a')]['include']?_[_0xcd6e('0x1c')](_0x2fe263[_0xcd6e('0x1a')][_0xcd6e('0x1d')],function(_0x34f0d7){return{'model':db[_0x34f0d7[_0xcd6e('0x1e')]],'as':_0x34f0d7['as'],'attributes':_0x34f0d7['attributes'],'include':_0x34f0d7[_0xcd6e('0x1d')]?_[_0xcd6e('0x1c')](_0x34f0d7[_0xcd6e('0x1d')],function(_0x33cfa4){return{'model':db[_0x33cfa4[_0xcd6e('0x1e')]],'as':_0x33cfa4['as'],'attributes':_0x33cfa4[_0xcd6e('0x1f')],'include':_0x33cfa4[_0xcd6e('0x1d')]?_[_0xcd6e('0x1c')](_0x33cfa4['include'],function(_0x99fe9c){return{'model':db[_0x99fe9c[_0xcd6e('0x1e')]],'as':_0x99fe9c['as'],'attributes':_0x99fe9c[_0xcd6e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x154719){logger[_0xcd6e('0x17')](_0xcd6e('0x18'),_0x2fe263);logger['debug'](_0xcd6e('0x18'),_0x2fe263,JSON[_0xcd6e('0x12')](_0x154719));_0x564855(_0x154719);})[_0xcd6e('0x20')](function(_0x963069){logger[_0xcd6e('0x13')](_0xcd6e('0x18'),_0x963069['message'],_0x2fe263);_0x1ac183(_0x359eb2['error'](0x1f4,_0x963069[_0xcd6e('0x16')]));});});};exports[_0xcd6e('0x21')]=function(_0x363d2a){var _0x442926=this;return new Promise(function(_0xa17c8,_0xbde947){return db[_0xcd6e('0x19')][_0xcd6e('0x22')]({'raw':_0x363d2a[_0xcd6e('0x1a')]?_0x363d2a[_0xcd6e('0x1a')][_0xcd6e('0x1b')]===undefined?!![]:![]:!![],'where':_0x363d2a[_0xcd6e('0x1a')]?_0x363d2a['options']['where']||null:null,'attributes':_0x363d2a[_0xcd6e('0x1a')]?_0x363d2a[_0xcd6e('0x1a')]['attributes']||null:null,'include':_0x363d2a[_0xcd6e('0x1a')]?_0x363d2a[_0xcd6e('0x1a')]['include']?_[_0xcd6e('0x1c')](_0x363d2a[_0xcd6e('0x1a')][_0xcd6e('0x1d')],function(_0x244b24){return{'model':db[_0x244b24[_0xcd6e('0x1e')]],'as':_0x244b24['as'],'attributes':_0x244b24[_0xcd6e('0x1f')],'include':_0x244b24[_0xcd6e('0x1d')]?_[_0xcd6e('0x1c')](_0x244b24[_0xcd6e('0x1d')],function(_0x3563f1){return{'model':db[_0x3563f1[_0xcd6e('0x1e')]],'as':_0x3563f1['as'],'attributes':_0x3563f1[_0xcd6e('0x1f')],'include':_0x3563f1[_0xcd6e('0x1d')]?_['map'](_0x3563f1[_0xcd6e('0x1d')],function(_0x53c1b7){return{'model':db[_0x53c1b7[_0xcd6e('0x1e')]],'as':_0x53c1b7['as'],'attributes':_0x53c1b7[_0xcd6e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcd6e('0x23')](function(_0x349abe){logger[_0xcd6e('0x17')](_0xcd6e('0x21'),_0x363d2a);logger[_0xcd6e('0x24')]('ShowSmsQueue',_0x363d2a,JSON['stringify'](_0x349abe));_0xa17c8(_0x349abe);})[_0xcd6e('0x20')](function(_0xff4516){logger[_0xcd6e('0x13')]('ShowSmsQueue',_0xff4516[_0xcd6e('0x16')],_0x363d2a);_0xbde947(_0x442926[_0xcd6e('0x13')](0x1f4,_0xff4516[_0xcd6e('0x16')]));});});}; \ No newline at end of file +var _0xfd0f=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','raw','options','attributes','limit','include','map','model','then','stringify','where','ShowSmsQueue'];(function(_0x3e6a06,_0x5ddcd6){var _0xcdc571=function(_0x5b0d06){while(--_0x5b0d06){_0x3e6a06['push'](_0x3e6a06['shift']());}};_0xcdc571(++_0x5ddcd6);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x1093bf,_0x458aea){_0x1093bf=_0x1093bf-0x0;var _0x4739a7=_0xfd0f[_0x1093bf];return _0x4739a7;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var moment=require('moment');var BPromise=require(_0xffd0('0x2'));var rs=require(_0xffd0('0x3'));var fs=require('fs');var Redis=require(_0xffd0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffd0('0x5'));var logger=require('../../config/logger')(_0xffd0('0x6'));var config=require(_0xffd0('0x7'));var jayson=require(_0xffd0('0x8'));var client=jayson[_0xffd0('0x9')][_0xffd0('0xa')]({'port':0x232a});config[_0xffd0('0xb')]=_[_0xffd0('0xc')](config[_0xffd0('0xb')],{'host':_0xffd0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffd0('0xb')]));require(_0xffd0('0xe'))[_0xffd0('0xf')](socket);function respondWithRpcPromise(_0xd8f72e,_0x56f03a,_0x5947d2){return new BPromise(function(_0x2c343c,_0x3f0441){return client[_0xffd0('0x10')](_0xd8f72e,_0x5947d2)['then'](function(_0x4e7a4e){logger[_0xffd0('0x11')](_0xffd0('0x12'),_0x56f03a,'request\x20sent');logger[_0xffd0('0x13')](_0xffd0('0x14'),_0x56f03a,_0xffd0('0x15'),JSON['stringify'](_0x4e7a4e));if(_0x4e7a4e[_0xffd0('0x16')]){if(_0x4e7a4e[_0xffd0('0x16')]['code']===0x1f4){logger[_0xffd0('0x16')]('SmsQueue,\x20%s,\x20%s',_0x56f03a,_0x4e7a4e['error'][_0xffd0('0x17')]);return _0x3f0441(_0x4e7a4e['error'][_0xffd0('0x17')]);}logger[_0xffd0('0x16')](_0xffd0('0x12'),_0x56f03a,_0x4e7a4e[_0xffd0('0x16')][_0xffd0('0x17')]);return _0x2c343c(_0x4e7a4e['error']['message']);}else{logger[_0xffd0('0x11')](_0xffd0('0x12'),_0x56f03a,_0xffd0('0x15'));_0x2c343c(_0x4e7a4e[_0xffd0('0x18')][_0xffd0('0x17')]);}})[_0xffd0('0x19')](function(_0x29868b){logger[_0xffd0('0x16')](_0xffd0('0x12'),_0x56f03a,_0x29868b);_0x3f0441(_0x29868b);});});}exports[_0xffd0('0x1a')]=function(_0x34c0fe){var _0x10714e=this;return new Promise(function(_0xd1b482,_0x19c523){return db[_0xffd0('0x1b')][_0xffd0('0x1c')]({'raw':_0x34c0fe['options']?_0x34c0fe['options'][_0xffd0('0x1d')]===undefined?!![]:![]:!![],'where':_0x34c0fe[_0xffd0('0x1e')]?_0x34c0fe[_0xffd0('0x1e')]['where']||null:null,'attributes':_0x34c0fe[_0xffd0('0x1e')]?_0x34c0fe['options'][_0xffd0('0x1f')]||null:null,'limit':_0x34c0fe[_0xffd0('0x1e')]?_0x34c0fe[_0xffd0('0x1e')][_0xffd0('0x20')]||null:null,'include':_0x34c0fe[_0xffd0('0x1e')]?_0x34c0fe[_0xffd0('0x1e')][_0xffd0('0x21')]?_[_0xffd0('0x22')](_0x34c0fe[_0xffd0('0x1e')][_0xffd0('0x21')],function(_0x278ba8){return{'model':db[_0x278ba8[_0xffd0('0x23')]],'as':_0x278ba8['as'],'attributes':_0x278ba8[_0xffd0('0x1f')],'include':_0x278ba8['include']?_['map'](_0x278ba8[_0xffd0('0x21')],function(_0x4928ea){return{'model':db[_0x4928ea['model']],'as':_0x4928ea['as'],'attributes':_0x4928ea[_0xffd0('0x1f')],'include':_0x4928ea[_0xffd0('0x21')]?_[_0xffd0('0x22')](_0x4928ea[_0xffd0('0x21')],function(_0x3f5423){return{'model':db[_0x3f5423[_0xffd0('0x23')]],'as':_0x3f5423['as'],'attributes':_0x3f5423['attributes']};}):[]};}):[]};}):[]:[]})[_0xffd0('0x24')](function(_0x4e7367){logger['info']('GetSmsQueue',_0x34c0fe);logger[_0xffd0('0x13')](_0xffd0('0x1a'),_0x34c0fe,JSON[_0xffd0('0x25')](_0x4e7367));_0xd1b482(_0x4e7367);})[_0xffd0('0x19')](function(_0x3bb309){logger[_0xffd0('0x16')]('GetSmsQueue',_0x3bb309['message'],_0x34c0fe);_0x19c523(_0x10714e['error'](0x1f4,_0x3bb309[_0xffd0('0x17')]));});});};exports['ShowSmsQueue']=function(_0x1f7dff){var _0x31a339=this;return new Promise(function(_0x48ffc4,_0x37e523){return db['SmsQueue']['find']({'raw':_0x1f7dff['options']?_0x1f7dff[_0xffd0('0x1e')][_0xffd0('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f7dff[_0xffd0('0x1e')]?_0x1f7dff[_0xffd0('0x1e')][_0xffd0('0x26')]||null:null,'attributes':_0x1f7dff['options']?_0x1f7dff[_0xffd0('0x1e')][_0xffd0('0x1f')]||null:null,'include':_0x1f7dff['options']?_0x1f7dff[_0xffd0('0x1e')][_0xffd0('0x21')]?_[_0xffd0('0x22')](_0x1f7dff[_0xffd0('0x1e')][_0xffd0('0x21')],function(_0x43f392){return{'model':db[_0x43f392['model']],'as':_0x43f392['as'],'attributes':_0x43f392[_0xffd0('0x1f')],'include':_0x43f392[_0xffd0('0x21')]?_['map'](_0x43f392[_0xffd0('0x21')],function(_0x3dd045){return{'model':db[_0x3dd045['model']],'as':_0x3dd045['as'],'attributes':_0x3dd045[_0xffd0('0x1f')],'include':_0x3dd045[_0xffd0('0x21')]?_['map'](_0x3dd045[_0xffd0('0x21')],function(_0x553be4){return{'model':db[_0x553be4[_0xffd0('0x23')]],'as':_0x553be4['as'],'attributes':_0x553be4[_0xffd0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e83fa){logger[_0xffd0('0x11')](_0xffd0('0x27'),_0x1f7dff);logger[_0xffd0('0x13')](_0xffd0('0x27'),_0x1f7dff,JSON[_0xffd0('0x25')](_0x3e83fa));_0x48ffc4(_0x3e83fa);})[_0xffd0('0x19')](function(_0x1c719d){logger[_0xffd0('0x16')](_0xffd0('0x27'),_0x1c719d[_0xffd0('0x17')],_0x1f7dff);_0x37e523(_0x31a339[_0xffd0('0x16')](0x1f4,_0x1c719d[_0xffd0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 011dff7..a53148f 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 _0xbc1c=['update','emit','removeListener','register','length','smsQueue:','save'];(function(_0x766c02,_0x3bc135){var _0x2450a3=function(_0x35f2b0){while(--_0x35f2b0){_0x766c02['push'](_0x766c02['shift']());}};_0x2450a3(++_0x3bc135);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0xbc1c[_0x4de9e8];return _0x4db0de;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xcbc1('0x0'),'remove',_0xcbc1('0x1')];function createListener(_0x520b06,_0x4566f7){return function(_0x4108fb){_0x4566f7[_0xcbc1('0x2')](_0x520b06,_0x4108fb);};}function removeListener(_0x2d19b9,_0x55e7ed){return function(){SmsQueueEvents[_0xcbc1('0x3')](_0x2d19b9,_0x55e7ed);};}exports[_0xcbc1('0x4')]=function(_0x54c13c){for(var _0x27da8d=0x0,_0x39cb56=events[_0xcbc1('0x5')];_0x27da8d<_0x39cb56;_0x27da8d++){var _0x4837b7=events[_0x27da8d];var _0x40fa2d=createListener(_0xcbc1('0x6')+_0x4837b7,_0x54c13c);SmsQueueEvents['on'](_0x4837b7,_0x40fa2d);}}; \ No newline at end of file +var _0x9efe=['remove','update','emit','removeListener','register','smsQueue:','save'];(function(_0x4ba1e5,_0x2af8d9){var _0xe99006=function(_0x561dff){while(--_0x561dff){_0x4ba1e5['push'](_0x4ba1e5['shift']());}};_0xe99006(++_0x2af8d9);}(_0x9efe,0xca));var _0xe9ef=function(_0x247583,_0x1c9c28){_0x247583=_0x247583-0x0;var _0x4af33e=_0x9efe[_0x247583];return _0x4af33e;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xe9ef('0x0'),_0xe9ef('0x1'),_0xe9ef('0x2')];function createListener(_0x24c094,_0x41a87c){return function(_0x50b614){_0x41a87c[_0xe9ef('0x3')](_0x24c094,_0x50b614);};}function removeListener(_0x186a70,_0x3deea3){return function(){SmsQueueEvents[_0xe9ef('0x4')](_0x186a70,_0x3deea3);};}exports[_0xe9ef('0x5')]=function(_0x2cc202){for(var _0x466baf=0x0,_0x58d664=events['length'];_0x466baf<_0x58d664;_0x466baf++){var _0x590cea=events[_0x466baf];var _0x40ffdc=createListener(_0xe9ef('0x6')+_0x590cea,_0x2cc202);SmsQueueEvents['on'](_0x590cea,_0x40ffdc);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f04a828..dbe9b87 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 _0xbe2a=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put','exports','multer','util','path'];(function(_0x39c997,_0x541370){var _0x34387b=function(_0x3c160d){while(--_0x3c160d){_0x39c997['push'](_0x39c997['shift']());}};_0x34387b(++_0x541370);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x416b42,_0x53bde8){_0x416b42=_0x416b42-0x0;var _0x5bb09f=_0xbe2a[_0x416b42];return _0x5bb09f;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require(_0xabe2('0x2'));var timeout=require(_0xabe2('0x3'));var express=require(_0xabe2('0x4'));var router=express[_0xabe2('0x5')]();var auth=require(_0xabe2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xabe2('0x7'));var controller=require('./smsQueueReport.controller');router[_0xabe2('0x8')]('/',auth[_0xabe2('0x9')](),controller[_0xabe2('0xa')]);router[_0xabe2('0x8')](_0xabe2('0xb'),auth[_0xabe2('0x9')](),controller['describe']);router[_0xabe2('0x8')](_0xabe2('0xc'),auth[_0xabe2('0x9')](),controller[_0xabe2('0xd')]);router[_0xabe2('0xe')]('/',auth[_0xabe2('0x9')](),controller['create']);router[_0xabe2('0xf')](_0xabe2('0xc'),auth[_0xabe2('0x9')](),controller['update']);router['delete']('/:id',auth[_0xabe2('0x9')](),controller['destroy']);module[_0xabe2('0x10')]=router; \ No newline at end of file +var _0x446c=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','index','get','describe','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x510663,_0x50cab0){var _0x29409f=function(_0x5310d3){while(--_0x5310d3){_0x510663['push'](_0x510663['shift']());}};_0x29409f(++_0x50cab0);}(_0x446c,0x156));var _0xc446=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x446c[_0x39bc44];return _0x2916d8;};'use strict';var multer=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var path=require(_0xc446('0x2'));var timeout=require(_0xc446('0x3'));var express=require('express');var router=express[_0xc446('0x4')]();var auth=require(_0xc446('0x5'));var interaction=require(_0xc446('0x6'));var config=require('../../config/environment');var controller=require(_0xc446('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc446('0x8')]);router[_0xc446('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc446('0xa')]);router[_0xc446('0x9')](_0xc446('0xb'),auth[_0xc446('0xc')](),controller[_0xc446('0xd')]);router['post']('/',auth[_0xc446('0xc')](),controller[_0xc446('0xe')]);router[_0xc446('0xf')](_0xc446('0xb'),auth['isAuthenticated'](),controller[_0xc446('0x10')]);router[_0xc446('0x11')](_0xc446('0xb'),auth[_0xc446('0xc')](),controller[_0xc446('0x12')]);module[_0xc446('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index d24773b..d98249f 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 _0xc49b=['sequelize','STRING','DATE'];(function(_0x334262,_0x2c7232){var _0x25ab56=function(_0x4ae0eb){while(--_0x4ae0eb){_0x334262['push'](_0x334262['shift']());}};_0x25ab56(++_0x2c7232);}(_0xc49b,0x108));var _0xbc49=function(_0x1fe635,_0xabe600){_0x1fe635=_0x1fe635-0x0;var _0x5423ce=_0xc49b[_0x1fe635];return _0x5423ce;};'use strict';var moment=require('moment');var Sequelize=require(_0xbc49('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbc49('0x1')]},'joinAt':{'type':Sequelize[_0xbc49('0x2')]},'leaveAt':{'type':Sequelize[_0xbc49('0x2')]},'acceptAt':{'type':Sequelize[_0xbc49('0x2')]},'exitAt':{'type':Sequelize[_0xbc49('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc919=['STRING','DATE','moment','sequelize','exports'];(function(_0x572fa4,_0x2ddac9){var _0x21f131=function(_0x17c14a){while(--_0x17c14a){_0x572fa4['push'](_0x572fa4['shift']());}};_0x21f131(++_0x2ddac9);}(_0xc919,0x10b));var _0x9c91=function(_0x44d0fa,_0x52e054){_0x44d0fa=_0x44d0fa-0x0;var _0x58a8eb=_0xc919[_0x44d0fa];return _0x58a8eb;};'use strict';var moment=require(_0x9c91('0x0'));var Sequelize=require(_0x9c91('0x1'));module[_0x9c91('0x2')]={'uniqueid':{'type':Sequelize[_0x9c91('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9c91('0x3')]},'joinAt':{'type':Sequelize[_0x9c91('0x4')]},'leaveAt':{'type':Sequelize[_0x9c91('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9c91('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 3bacd04..a310c55 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 _0x6778=['update','then','destroy','error','name','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','SmsQueueReport','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','json','apply','save'];(function(_0x4c0155,_0x5b20db){var _0x1276db=function(_0x3ff813){while(--_0x3ff813){_0x4c0155['push'](_0x4c0155['shift']());}};_0x1276db(++_0x5b20db);}(_0x6778,0xb3));var _0x8677=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x6778[_0xcfd89f];return _0x59acd4;};'use strict';var pdf=require(_0x8677('0x0'));var emlformat=require(_0x8677('0x1'));var rimraf=require(_0x8677('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8677('0x3'));var rp=require(_0x8677('0x4'));var moment=require(_0x8677('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8677('0x6'));var util=require('util');var path=require(_0x8677('0x7'));var sox=require(_0x8677('0x8'));var csv=require(_0x8677('0x9'));var ejs=require(_0x8677('0xa'));var fs=require('fs');var _=require(_0x8677('0xb'));var squel=require(_0x8677('0xc'));var crypto=require(_0x8677('0xd'));var jsforce=require(_0x8677('0xe'));var deskjs=require(_0x8677('0xf'));var toCsv=require(_0x8677('0x9'));var querystring=require(_0x8677('0x10'));var Papa=require('papaparse');var Redis=require(_0x8677('0x11'));var authService=require(_0x8677('0x12'));var qs=require(_0x8677('0x13'));var hardwareService=require(_0x8677('0x14'));var logger=require('../../config/logger')(_0x8677('0x15'));var utils=require(_0x8677('0x16'));var config=require(_0x8677('0x17'));var db=require(_0x8677('0x18'))['db'];function respondWithStatusCode(_0x5ed98f,_0x3c4e93){_0x3c4e93=_0x3c4e93||0xcc;return function(_0x9fbe9f){if(_0x9fbe9f){return _0x5ed98f['sendStatus'](_0x3c4e93);}return _0x5ed98f[_0x8677('0x19')](_0x3c4e93)[_0x8677('0x1a')]();};}function respondWithResult(_0x2492a4,_0x8368ac){_0x8368ac=_0x8368ac||0xc8;return function(_0x506866){if(_0x506866){return _0x2492a4[_0x8677('0x19')](_0x8368ac)['json'](_0x506866);}};}function respondWithFilteredResult(_0x34efe5,_0x32423b){return function(_0x37f4e5){if(_0x37f4e5){var _0x511c8f=_0x37f4e5[_0x8677('0x1b')],_0x5023e8=_0x32423b['offset'],_0x54169a=_0x32423b[_0x8677('0x1c')]+_0x32423b[_0x8677('0x1d')],_0x3009b0;if(_0x54169a>=_0x511c8f){_0x54169a=_0x511c8f;_0x3009b0=0xc8;}else{_0x3009b0=0xce;}_0x34efe5[_0x8677('0x19')](_0x3009b0);return _0x34efe5['set'](_0x8677('0x1e'),_0x5023e8+'-'+_0x54169a+'/'+_0x511c8f)[_0x8677('0x1f')](_0x37f4e5);}return null;};}function patchUpdates(_0x5a8e7a){return function(_0x2ec4cc){try{jsonpatch[_0x8677('0x20')](_0x2ec4cc,_0x5a8e7a,!![]);}catch(_0x3621dc){return BPromise['reject'](_0x3621dc);}return _0x2ec4cc[_0x8677('0x21')]();};}function saveUpdates(_0x233dd5,_0x255436){return function(_0x2b8bbf){if(_0x2b8bbf){return _0x2b8bbf[_0x8677('0x22')](_0x233dd5)[_0x8677('0x23')](function(_0x3b546a){return _0x3b546a;});}return null;};}function removeEntity(_0x3675d4,_0x5214a9){return function(_0x5644ab){if(_0x5644ab){return _0x5644ab[_0x8677('0x24')]()[_0x8677('0x23')](function(){_0x3675d4[_0x8677('0x19')](0xcc)[_0x8677('0x1a')]();});}};}function handleEntityNotFound(_0x252244,_0x160405){return function(_0x171e51){if(!_0x171e51){_0x252244['sendStatus'](0x194);}return _0x171e51;};}function handleError(_0x437d57,_0x20da1f){_0x20da1f=_0x20da1f||0x1f4;return function(_0x3a8551){logger[_0x8677('0x25')](_0x3a8551['stack']);if(_0x3a8551['name']){delete _0x3a8551[_0x8677('0x26')];}_0x437d57['status'](_0x20da1f)['send'](_0x3a8551);};}exports[_0x8677('0x27')]=function(_0x90fcb6,_0x2032b3){var _0x1c8946={},_0x1015b6={},_0x476325={'count':0x0,'rows':[]};var _0x4bd597=db['SmsQueueReport']['rawAttributes'];_0x1015b6[_0x8677('0x28')]=_[_0x8677('0x29')](_0x4bd597);_0x1015b6[_0x8677('0x2a')]=_['keys'](_0x90fcb6[_0x8677('0x2a')]);_0x1015b6[_0x8677('0x2b')]=_[_0x8677('0x2c')](_0x1015b6['model'],_0x1015b6[_0x8677('0x2a')]);_0x1c8946[_0x8677('0x2d')]=_[_0x8677('0x2c')](_0x1015b6['model'],qs[_0x8677('0x2e')](_0x90fcb6['query'][_0x8677('0x2e')]));_0x1c8946[_0x8677('0x2d')]=_0x1c8946[_0x8677('0x2d')][_0x8677('0x2f')]?_0x1c8946[_0x8677('0x2d')]:_0x1015b6['model'];if(!_0x90fcb6[_0x8677('0x2a')]['hasOwnProperty'](_0x8677('0x30'))){_0x1c8946[_0x8677('0x1d')]=qs['limit'](_0x90fcb6['query']['limit']);_0x1c8946[_0x8677('0x1c')]=qs[_0x8677('0x1c')](_0x90fcb6['query']['offset']);}_0x1c8946[_0x8677('0x31')]=qs['sort'](_0x90fcb6[_0x8677('0x2a')][_0x8677('0x32')]);_0x1c8946[_0x8677('0x33')]=qs[_0x8677('0x2b')](_[_0x8677('0x34')](_0x90fcb6[_0x8677('0x2a')],_0x1015b6[_0x8677('0x2b')]));if(_0x90fcb6[_0x8677('0x2a')][_0x8677('0x35')]){_0x1c8946[_0x8677('0x33')]=_[_0x8677('0x36')](_0x1c8946[_0x8677('0x33')],{'$or':_[_0x8677('0x37')](_0x4bd597,function(_0x44ee9e){if(_0x44ee9e['type'][_0x8677('0x38')]!==_0x8677('0x39')){var _0x271b0a={};_0x271b0a[_0x44ee9e['field']]={'$like':'%'+_0x90fcb6[_0x8677('0x2a')][_0x8677('0x35')]+'%'};return _0x271b0a;}})});}_0x1c8946=_[_0x8677('0x36')]({},_0x1c8946,_0x90fcb6[_0x8677('0x3a')]);var _0x5845cd={'where':_0x1c8946[_0x8677('0x33')]};return db[_0x8677('0x3b')][_0x8677('0x1b')](_0x5845cd)['then'](function(_0x5b3eb4){_0x476325[_0x8677('0x1b')]=_0x5b3eb4;if(_0x90fcb6['query'][_0x8677('0x3c')]){_0x1c8946[_0x8677('0x3d')]=[{'all':!![]}];}return db[_0x8677('0x3b')][_0x8677('0x3e')](_0x1c8946);})['then'](function(_0x51263e){_0x476325[_0x8677('0x3f')]=_0x51263e;return _0x476325;})[_0x8677('0x23')](respondWithFilteredResult(_0x2032b3,_0x1c8946))[_0x8677('0x40')](handleError(_0x2032b3,null));};exports['show']=function(_0x171141,_0x206d7f){var _0x4a912a={'raw':!![],'where':{'id':_0x171141[_0x8677('0x41')]['id']}},_0x4b5d0c={};_0x4b5d0c[_0x8677('0x28')]=_[_0x8677('0x29')](db[_0x8677('0x3b')][_0x8677('0x42')]);_0x4b5d0c[_0x8677('0x2a')]=_[_0x8677('0x29')](_0x171141[_0x8677('0x2a')]);_0x4b5d0c['filters']=_[_0x8677('0x2c')](_0x4b5d0c[_0x8677('0x28')],_0x4b5d0c[_0x8677('0x2a')]);_0x4a912a['attributes']=_[_0x8677('0x2c')](_0x4b5d0c[_0x8677('0x28')],qs[_0x8677('0x2e')](_0x171141[_0x8677('0x2a')][_0x8677('0x2e')]));_0x4a912a['attributes']=_0x4a912a[_0x8677('0x2d')][_0x8677('0x2f')]?_0x4a912a['attributes']:_0x4b5d0c[_0x8677('0x28')];if(_0x171141[_0x8677('0x2a')][_0x8677('0x3c')]){_0x4a912a[_0x8677('0x3d')]=[{'all':!![]}];}_0x4a912a=_[_0x8677('0x36')]({},_0x4a912a,_0x171141[_0x8677('0x3a')]);return db[_0x8677('0x3b')][_0x8677('0x43')](_0x4a912a)[_0x8677('0x23')](handleEntityNotFound(_0x206d7f,null))['then'](respondWithResult(_0x206d7f,null))['catch'](handleError(_0x206d7f,null));};exports[_0x8677('0x44')]=function(_0x8652e4,_0x58fdf4){return db[_0x8677('0x3b')][_0x8677('0x44')](_0x8652e4['body'],{})[_0x8677('0x23')](respondWithResult(_0x58fdf4,0xc9))['catch'](handleError(_0x58fdf4,null));};exports[_0x8677('0x22')]=function(_0x5e3bff,_0x415fef){if(_0x5e3bff['body']['id']){delete _0x5e3bff[_0x8677('0x45')]['id'];}return db[_0x8677('0x3b')][_0x8677('0x43')]({'where':{'id':_0x5e3bff[_0x8677('0x41')]['id']}})[_0x8677('0x23')](handleEntityNotFound(_0x415fef,null))[_0x8677('0x23')](saveUpdates(_0x5e3bff['body'],null))['then'](respondWithResult(_0x415fef,null))[_0x8677('0x40')](handleError(_0x415fef,null));};exports[_0x8677('0x24')]=function(_0x468d8d,_0x53d2d9){return db[_0x8677('0x3b')][_0x8677('0x43')]({'where':{'id':_0x468d8d['params']['id']}})[_0x8677('0x23')](handleEntityNotFound(_0x53d2d9,null))[_0x8677('0x23')](removeEntity(_0x53d2d9,null))[_0x8677('0x40')](handleError(_0x53d2d9,null));};exports[_0x8677('0x46')]=function(_0x428259,_0x2a85bc){return db[_0x8677('0x3b')][_0x8677('0x46')]()[_0x8677('0x23')](respondWithResult(_0x2a85bc,null))[_0x8677('0x40')](handleError(_0x2a85bc,null));}; \ No newline at end of file +var _0xa9f9=['save','update','destroy','then','error','stack','name','status','send','SmsQueueReport','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','options','findAll','rows','params','keys','include','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x2c6cec,_0x1b1fc7){var _0x32de96=function(_0x50cde6){while(--_0x50cde6){_0x2c6cec['push'](_0x2c6cec['shift']());}};_0x32de96(++_0x1b1fc7);}(_0xa9f9,0x109));var _0x9a9f=function(_0x49a521,_0x2a2246){_0x49a521=_0x49a521-0x0;var _0x4ae0f3=_0xa9f9[_0x49a521];return _0x4ae0f3;};'use strict';var pdf=require(_0x9a9f('0x0'));var emlformat=require(_0x9a9f('0x1'));var rimraf=require(_0x9a9f('0x2'));var zipdir=require(_0x9a9f('0x3'));var jsonpatch=require(_0x9a9f('0x4'));var rp=require('request-promise');var moment=require(_0x9a9f('0x5'));var BPromise=require(_0x9a9f('0x6'));var Mustache=require('mustache');var util=require(_0x9a9f('0x7'));var path=require(_0x9a9f('0x8'));var sox=require(_0x9a9f('0x9'));var csv=require(_0x9a9f('0xa'));var ejs=require(_0x9a9f('0xb'));var fs=require('fs');var _=require(_0x9a9f('0xc'));var squel=require(_0x9a9f('0xd'));var crypto=require(_0x9a9f('0xe'));var jsforce=require(_0x9a9f('0xf'));var deskjs=require(_0x9a9f('0x10'));var toCsv=require(_0x9a9f('0xa'));var querystring=require(_0x9a9f('0x11'));var Papa=require(_0x9a9f('0x12'));var Redis=require(_0x9a9f('0x13'));var authService=require(_0x9a9f('0x14'));var qs=require(_0x9a9f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a9f('0x16'))(_0x9a9f('0x17'));var utils=require(_0x9a9f('0x18'));var config=require('../../config/environment');var db=require(_0x9a9f('0x19'))['db'];function respondWithStatusCode(_0x161618,_0x141a32){_0x141a32=_0x141a32||0xcc;return function(_0x4b71f4){if(_0x4b71f4){return _0x161618[_0x9a9f('0x1a')](_0x141a32);}return _0x161618['status'](_0x141a32)[_0x9a9f('0x1b')]();};}function respondWithResult(_0x54b30a,_0x102cf8){_0x102cf8=_0x102cf8||0xc8;return function(_0xbd4b1b){if(_0xbd4b1b){return _0x54b30a['status'](_0x102cf8)[_0x9a9f('0x1c')](_0xbd4b1b);}};}function respondWithFilteredResult(_0x1305a5,_0x1024d0){return function(_0x1b120a){if(_0x1b120a){var _0x26c787=_0x1b120a[_0x9a9f('0x1d')],_0x2db128=_0x1024d0[_0x9a9f('0x1e')],_0x5204e3=_0x1024d0[_0x9a9f('0x1e')]+_0x1024d0[_0x9a9f('0x1f')],_0x2be15e;if(_0x5204e3>=_0x26c787){_0x5204e3=_0x26c787;_0x2be15e=0xc8;}else{_0x2be15e=0xce;}_0x1305a5['status'](_0x2be15e);return _0x1305a5['set'](_0x9a9f('0x20'),_0x2db128+'-'+_0x5204e3+'/'+_0x26c787)[_0x9a9f('0x1c')](_0x1b120a);}return null;};}function patchUpdates(_0x4cc62c){return function(_0x280233){try{jsonpatch[_0x9a9f('0x21')](_0x280233,_0x4cc62c,!![]);}catch(_0x1e5470){return BPromise[_0x9a9f('0x22')](_0x1e5470);}return _0x280233[_0x9a9f('0x23')]();};}function saveUpdates(_0x15fed9,_0x337b09){return function(_0x2424a7){if(_0x2424a7){return _0x2424a7[_0x9a9f('0x24')](_0x15fed9)['then'](function(_0x8e9c1f){return _0x8e9c1f;});}return null;};}function removeEntity(_0x27ed13,_0x443aaf){return function(_0x442fe5){if(_0x442fe5){return _0x442fe5[_0x9a9f('0x25')]()[_0x9a9f('0x26')](function(){_0x27ed13['status'](0xcc)[_0x9a9f('0x1b')]();});}};}function handleEntityNotFound(_0x64a487,_0x36d0c0){return function(_0x8367dc){if(!_0x8367dc){_0x64a487['sendStatus'](0x194);}return _0x8367dc;};}function handleError(_0x2646e0,_0x14247f){_0x14247f=_0x14247f||0x1f4;return function(_0x8366b5){logger[_0x9a9f('0x27')](_0x8366b5[_0x9a9f('0x28')]);if(_0x8366b5[_0x9a9f('0x29')]){delete _0x8366b5[_0x9a9f('0x29')];}_0x2646e0[_0x9a9f('0x2a')](_0x14247f)[_0x9a9f('0x2b')](_0x8366b5);};}exports['index']=function(_0x4547c2,_0x413b26){var _0xe0aed3={},_0x39a872={},_0x1e22e2={'count':0x0,'rows':[]};var _0xb3b067=db[_0x9a9f('0x2c')][_0x9a9f('0x2d')];_0x39a872['model']=_['keys'](_0xb3b067);_0x39a872[_0x9a9f('0x2e')]=_['keys'](_0x4547c2[_0x9a9f('0x2e')]);_0x39a872[_0x9a9f('0x2f')]=_[_0x9a9f('0x30')](_0x39a872[_0x9a9f('0x31')],_0x39a872['query']);_0xe0aed3[_0x9a9f('0x32')]=_[_0x9a9f('0x30')](_0x39a872[_0x9a9f('0x31')],qs[_0x9a9f('0x33')](_0x4547c2[_0x9a9f('0x2e')][_0x9a9f('0x33')]));_0xe0aed3[_0x9a9f('0x32')]=_0xe0aed3[_0x9a9f('0x32')][_0x9a9f('0x34')]?_0xe0aed3['attributes']:_0x39a872[_0x9a9f('0x31')];if(!_0x4547c2[_0x9a9f('0x2e')][_0x9a9f('0x35')](_0x9a9f('0x36'))){_0xe0aed3[_0x9a9f('0x1f')]=qs[_0x9a9f('0x1f')](_0x4547c2['query'][_0x9a9f('0x1f')]);_0xe0aed3[_0x9a9f('0x1e')]=qs[_0x9a9f('0x1e')](_0x4547c2[_0x9a9f('0x2e')][_0x9a9f('0x1e')]);}_0xe0aed3[_0x9a9f('0x37')]=qs[_0x9a9f('0x38')](_0x4547c2[_0x9a9f('0x2e')][_0x9a9f('0x38')]);_0xe0aed3[_0x9a9f('0x39')]=qs[_0x9a9f('0x2f')](_[_0x9a9f('0x3a')](_0x4547c2[_0x9a9f('0x2e')],_0x39a872[_0x9a9f('0x2f')]));if(_0x4547c2[_0x9a9f('0x2e')][_0x9a9f('0x3b')]){_0xe0aed3[_0x9a9f('0x39')]=_[_0x9a9f('0x3c')](_0xe0aed3[_0x9a9f('0x39')],{'$or':_[_0x9a9f('0x3d')](_0xb3b067,function(_0xca6d6f){if(_0xca6d6f[_0x9a9f('0x3e')][_0x9a9f('0x3f')]!=='VIRTUAL'){var _0x3f22cc={};_0x3f22cc[_0xca6d6f['field']]={'$like':'%'+_0x4547c2[_0x9a9f('0x2e')][_0x9a9f('0x3b')]+'%'};return _0x3f22cc;}})});}_0xe0aed3=_['merge']({},_0xe0aed3,_0x4547c2[_0x9a9f('0x40')]);var _0x4d72c5={'where':_0xe0aed3['where']};return db['SmsQueueReport'][_0x9a9f('0x1d')](_0x4d72c5)[_0x9a9f('0x26')](function(_0x4c0373){_0x1e22e2[_0x9a9f('0x1d')]=_0x4c0373;if(_0x4547c2[_0x9a9f('0x2e')]['includeAll']){_0xe0aed3['include']=[{'all':!![]}];}return db[_0x9a9f('0x2c')][_0x9a9f('0x41')](_0xe0aed3);})[_0x9a9f('0x26')](function(_0x504b34){_0x1e22e2[_0x9a9f('0x42')]=_0x504b34;return _0x1e22e2;})[_0x9a9f('0x26')](respondWithFilteredResult(_0x413b26,_0xe0aed3))['catch'](handleError(_0x413b26,null));};exports['show']=function(_0x49796c,_0x16fcf1){var _0x5e9fa0={'raw':!![],'where':{'id':_0x49796c[_0x9a9f('0x43')]['id']}},_0x4b9f1d={};_0x4b9f1d[_0x9a9f('0x31')]=_[_0x9a9f('0x44')](db['SmsQueueReport'][_0x9a9f('0x2d')]);_0x4b9f1d[_0x9a9f('0x2e')]=_['keys'](_0x49796c[_0x9a9f('0x2e')]);_0x4b9f1d[_0x9a9f('0x2f')]=_[_0x9a9f('0x30')](_0x4b9f1d['model'],_0x4b9f1d[_0x9a9f('0x2e')]);_0x5e9fa0[_0x9a9f('0x32')]=_['intersection'](_0x4b9f1d['model'],qs['fields'](_0x49796c[_0x9a9f('0x2e')][_0x9a9f('0x33')]));_0x5e9fa0[_0x9a9f('0x32')]=_0x5e9fa0[_0x9a9f('0x32')][_0x9a9f('0x34')]?_0x5e9fa0['attributes']:_0x4b9f1d['model'];if(_0x49796c[_0x9a9f('0x2e')]['includeAll']){_0x5e9fa0[_0x9a9f('0x45')]=[{'all':!![]}];}_0x5e9fa0=_[_0x9a9f('0x3c')]({},_0x5e9fa0,_0x49796c['options']);return db['SmsQueueReport']['find'](_0x5e9fa0)[_0x9a9f('0x26')](handleEntityNotFound(_0x16fcf1,null))[_0x9a9f('0x26')](respondWithResult(_0x16fcf1,null))[_0x9a9f('0x46')](handleError(_0x16fcf1,null));};exports['create']=function(_0x26dbd3,_0x4ad872){return db[_0x9a9f('0x2c')][_0x9a9f('0x47')](_0x26dbd3[_0x9a9f('0x48')],{})['then'](respondWithResult(_0x4ad872,0xc9))[_0x9a9f('0x46')](handleError(_0x4ad872,null));};exports[_0x9a9f('0x24')]=function(_0x2b1fe7,_0x4f6480){if(_0x2b1fe7[_0x9a9f('0x48')]['id']){delete _0x2b1fe7['body']['id'];}return db[_0x9a9f('0x2c')]['find']({'where':{'id':_0x2b1fe7[_0x9a9f('0x43')]['id']}})[_0x9a9f('0x26')](handleEntityNotFound(_0x4f6480,null))['then'](saveUpdates(_0x2b1fe7[_0x9a9f('0x48')],null))[_0x9a9f('0x26')](respondWithResult(_0x4f6480,null))['catch'](handleError(_0x4f6480,null));};exports[_0x9a9f('0x25')]=function(_0x3c0c3e,_0xfb4b48){return db[_0x9a9f('0x2c')][_0x9a9f('0x49')]({'where':{'id':_0x3c0c3e[_0x9a9f('0x43')]['id']}})[_0x9a9f('0x26')](handleEntityNotFound(_0xfb4b48,null))['then'](removeEntity(_0xfb4b48,null))[_0x9a9f('0x46')](handleError(_0xfb4b48,null));};exports[_0x9a9f('0x4a')]=function(_0x5043c2,_0x3627a8){return db[_0x9a9f('0x2c')][_0x9a9f('0x4a')]()[_0x9a9f('0x26')](respondWithResult(_0x3627a8,null))[_0x9a9f('0x46')](handleError(_0x3627a8,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index a4f8a93..fda151b 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 _0x7192=['../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3a085f,_0x2740fd){var _0x572785=function(_0x52a816){while(--_0x52a816){_0x3a085f['push'](_0x3a085f['shift']());}};_0x572785(++_0x2740fd);}(_0x7192,0x1da));var _0x2719=function(_0x44664d,_0x336531){_0x44664d=_0x44664d-0x0;var _0x52afbb=_0x7192[_0x44664d];return _0x52afbb;};'use strict';var _=require(_0x2719('0x0'));var util=require('util');var logger=require(_0x2719('0x1'))(_0x2719('0x2'));var moment=require(_0x2719('0x3'));var BPromise=require('bluebird');var rp=require(_0x2719('0x4'));var fs=require('fs');var path=require(_0x2719('0x5'));var rimraf=require(_0x2719('0x6'));var config=require(_0x2719('0x7'));var attributes=require(_0x2719('0x8'));module[_0x2719('0x9')]=function(_0x8f2a1,_0x46a637){return _0x8f2a1[_0x2719('0xa')](_0x2719('0xb'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x2719('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7eba=['bluebird','request-promise','path','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x7eba,0x1d0));var _0xa7eb=function(_0x181506,_0x2c370c){_0x181506=_0x181506-0x0;var _0xd403d1=_0x7eba[_0x181506];return _0xd403d1;};'use strict';var _=require(_0xa7eb('0x0'));var util=require(_0xa7eb('0x1'));var logger=require(_0xa7eb('0x2'))(_0xa7eb('0x3'));var moment=require('moment');var BPromise=require(_0xa7eb('0x4'));var rp=require(_0xa7eb('0x5'));var fs=require('fs');var path=require(_0xa7eb('0x6'));var rimraf=require('rimraf');var config=require(_0xa7eb('0x7'));var attributes=require(_0xa7eb('0x8'));module[_0xa7eb('0x9')]=function(_0x1a37e4,_0x227ae1){return _0x1a37e4[_0xa7eb('0xa')](_0xa7eb('0xb'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0xa7eb('0xc'),'fields':[_0xa7eb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 686c43b..3782821 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 _0xb893=['SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','CreateSmsQueueReport','SmsQueueReport','create','body','debug','catch','UpdateSmsQueueReport','options','where','attributes','limit','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x188f9f,_0x1b8b97){var _0x52621c=function(_0x32934b){while(--_0x32934b){_0x188f9f['push'](_0x188f9f['shift']());}};_0x52621c(++_0x1b8b97);}(_0xb893,0x15c));var _0x3b89=function(_0x4bd5c5,_0x2f05ec){_0x4bd5c5=_0x4bd5c5-0x0;var _0x113850=_0xb893[_0x4bd5c5];return _0x113850;};'use strict';var _=require(_0x3b89('0x0'));var util=require(_0x3b89('0x1'));var moment=require('moment');var BPromise=require(_0x3b89('0x2'));var rs=require(_0x3b89('0x3'));var fs=require('fs');var Redis=require(_0x3b89('0x4'));var db=require(_0x3b89('0x5'))['db'];var utils=require(_0x3b89('0x6'));var logger=require(_0x3b89('0x7'))(_0x3b89('0x8'));var config=require(_0x3b89('0x9'));var jayson=require(_0x3b89('0xa'));var client=jayson[_0x3b89('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30de22,_0x57b3b0,_0x3d2cba){return new BPromise(function(_0x5f310c,_0x24308a){return client[_0x3b89('0xc')](_0x30de22,_0x3d2cba)[_0x3b89('0xd')](function(_0x4bb14a){logger[_0x3b89('0xe')](_0x3b89('0xf'),_0x57b3b0,'request\x20sent');logger['debug'](_0x3b89('0x10'),_0x57b3b0,_0x3b89('0x11'),JSON['stringify'](_0x4bb14a));if(_0x4bb14a[_0x3b89('0x12')]){if(_0x4bb14a[_0x3b89('0x12')][_0x3b89('0x13')]===0x1f4){logger[_0x3b89('0x12')](_0x3b89('0xf'),_0x57b3b0,_0x4bb14a['error'][_0x3b89('0x14')]);return _0x24308a(_0x4bb14a[_0x3b89('0x12')][_0x3b89('0x14')]);}logger[_0x3b89('0x12')](_0x3b89('0xf'),_0x57b3b0,_0x4bb14a['error'][_0x3b89('0x14')]);return _0x5f310c(_0x4bb14a[_0x3b89('0x12')]['message']);}else{logger[_0x3b89('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x57b3b0,_0x3b89('0x11'));_0x5f310c(_0x4bb14a['result']['message']);}})['catch'](function(_0x3b83b8){logger[_0x3b89('0x12')](_0x3b89('0xf'),_0x57b3b0,_0x3b83b8);_0x24308a(_0x3b83b8);});});}exports[_0x3b89('0x15')]=function(_0x528394){var _0x1d3ef4=this;return new Promise(function(_0x1ba889,_0x535f0c){return db[_0x3b89('0x16')][_0x3b89('0x17')](_0x528394[_0x3b89('0x18')],{'raw':_0x528394['options']?_0x528394['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x249e45){logger[_0x3b89('0xe')](_0x3b89('0x15'),_0x528394);logger[_0x3b89('0x19')](_0x3b89('0x15'),_0x528394,JSON['stringify'](_0x249e45));_0x1ba889(_0x249e45);})[_0x3b89('0x1a')](function(_0x58026d){logger[_0x3b89('0x12')]('CreateSmsQueueReport',_0x58026d[_0x3b89('0x14')],_0x528394);_0x535f0c(_0x1d3ef4[_0x3b89('0x12')](0x1f4,_0x58026d[_0x3b89('0x14')]));});});};exports[_0x3b89('0x1b')]=function(_0x1b535a){var _0x1cfa83=this;return new Promise(function(_0x437639,_0x55a495){return db[_0x3b89('0x16')]['update'](_0x1b535a['body'],{'raw':_0x1b535a['options']?_0x1b535a[_0x3b89('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b535a[_0x3b89('0x1c')]?_0x1b535a[_0x3b89('0x1c')][_0x3b89('0x1d')]||null:null,'attributes':_0x1b535a[_0x3b89('0x1c')]?_0x1b535a[_0x3b89('0x1c')][_0x3b89('0x1e')]||null:null,'limit':_0x1b535a[_0x3b89('0x1c')]?_0x1b535a['options'][_0x3b89('0x1f')]||null:null})[_0x3b89('0xd')](function(_0x5eb9fa){logger[_0x3b89('0xe')](_0x3b89('0x1b'),_0x1b535a);logger['debug'](_0x3b89('0x1b'),_0x1b535a,JSON[_0x3b89('0x20')](_0x5eb9fa));_0x437639(_0x5eb9fa);})['catch'](function(_0x187063){logger[_0x3b89('0x12')](_0x3b89('0x1b'),_0x187063[_0x3b89('0x14')],_0x1b535a);_0x55a495(_0x1cfa83[_0x3b89('0x12')](0x1f4,_0x187063[_0x3b89('0x14')]));});});}; \ No newline at end of file +var _0xc5e7=['../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x38eca6,_0x137a7f){var _0x21c78f=function(_0x500572){while(--_0x500572){_0x38eca6['push'](_0x38eca6['shift']());}};_0x21c78f(++_0x137a7f);}(_0xc5e7,0x9e));var _0x7c5e=function(_0xd15d19,_0xafd5b8){_0xd15d19=_0xd15d19-0x0;var _0xa0439f=_0xc5e7[_0xd15d19];return _0xa0439f;};'use strict';var _=require('lodash');var util=require(_0x7c5e('0x0'));var moment=require(_0x7c5e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c5e('0x2'));var db=require(_0x7c5e('0x3'))['db'];var utils=require(_0x7c5e('0x4'));var logger=require(_0x7c5e('0x5'))(_0x7c5e('0x6'));var config=require(_0x7c5e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7c5e('0x8')][_0x7c5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35b7b5,_0x2a6fe7,_0x3a1723){return new BPromise(function(_0xd8fb6b,_0x19ce1d){return client[_0x7c5e('0xa')](_0x35b7b5,_0x3a1723)[_0x7c5e('0xb')](function(_0x4868e8){logger[_0x7c5e('0xc')](_0x7c5e('0xd'),_0x2a6fe7,_0x7c5e('0xe'));logger[_0x7c5e('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2a6fe7,_0x7c5e('0xe'),JSON[_0x7c5e('0x10')](_0x4868e8));if(_0x4868e8[_0x7c5e('0x11')]){if(_0x4868e8[_0x7c5e('0x11')][_0x7c5e('0x12')]===0x1f4){logger[_0x7c5e('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x2a6fe7,_0x4868e8[_0x7c5e('0x11')]['message']);return _0x19ce1d(_0x4868e8['error'][_0x7c5e('0x13')]);}logger[_0x7c5e('0x11')](_0x7c5e('0xd'),_0x2a6fe7,_0x4868e8[_0x7c5e('0x11')][_0x7c5e('0x13')]);return _0xd8fb6b(_0x4868e8['error'][_0x7c5e('0x13')]);}else{logger[_0x7c5e('0xc')](_0x7c5e('0xd'),_0x2a6fe7,_0x7c5e('0xe'));_0xd8fb6b(_0x4868e8[_0x7c5e('0x14')][_0x7c5e('0x13')]);}})[_0x7c5e('0x15')](function(_0xafdc4){logger['error'](_0x7c5e('0xd'),_0x2a6fe7,_0xafdc4);_0x19ce1d(_0xafdc4);});});}exports['CreateSmsQueueReport']=function(_0x125741){var _0xbc5631=this;return new Promise(function(_0x1c0e61,_0x3b1f7b){return db[_0x7c5e('0x16')][_0x7c5e('0x17')](_0x125741[_0x7c5e('0x18')],{'raw':_0x125741['options']?_0x125741[_0x7c5e('0x19')][_0x7c5e('0x1a')]===undefined?!![]:![]:!![]})[_0x7c5e('0xb')](function(_0x277440){logger['info'](_0x7c5e('0x1b'),_0x125741);logger[_0x7c5e('0xf')]('CreateSmsQueueReport',_0x125741,JSON['stringify'](_0x277440));_0x1c0e61(_0x277440);})[_0x7c5e('0x15')](function(_0x535b67){logger[_0x7c5e('0x11')](_0x7c5e('0x1b'),_0x535b67[_0x7c5e('0x13')],_0x125741);_0x3b1f7b(_0xbc5631[_0x7c5e('0x11')](0x1f4,_0x535b67[_0x7c5e('0x13')]));});});};exports[_0x7c5e('0x1c')]=function(_0x2d447b){var _0x1cbefc=this;return new Promise(function(_0x492783,_0x569aef){return db[_0x7c5e('0x16')][_0x7c5e('0x1d')](_0x2d447b[_0x7c5e('0x18')],{'raw':_0x2d447b[_0x7c5e('0x19')]?_0x2d447b[_0x7c5e('0x19')][_0x7c5e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d447b['options']?_0x2d447b[_0x7c5e('0x19')][_0x7c5e('0x1e')]||null:null,'attributes':_0x2d447b[_0x7c5e('0x19')]?_0x2d447b['options'][_0x7c5e('0x1f')]||null:null,'limit':_0x2d447b['options']?_0x2d447b[_0x7c5e('0x19')][_0x7c5e('0x20')]||null:null})[_0x7c5e('0xb')](function(_0xd4f701){logger['info']('UpdateSmsQueueReport',_0x2d447b);logger[_0x7c5e('0xf')](_0x7c5e('0x1c'),_0x2d447b,JSON[_0x7c5e('0x10')](_0xd4f701));_0x492783(_0xd4f701);})[_0x7c5e('0x15')](function(_0x1b9b36){logger[_0x7c5e('0x11')](_0x7c5e('0x1c'),_0x1b9b36[_0x7c5e('0x13')],_0x2d447b);_0x569aef(_0x1cbefc[_0x7c5e('0x11')](0x1f4,_0x1b9b36[_0x7c5e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 2be8f26..81c2cdf 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 _0x1f91=['update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','isAuthenticated','index','get','/:id','post','put'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x1f91,0x1d3));var _0x11f9=function(_0x22159e,_0x511c61){_0x22159e=_0x22159e-0x0;var _0x3a80db=_0x1f91[_0x22159e];return _0x3a80db;};'use strict';var multer=require(_0x11f9('0x0'));var util=require(_0x11f9('0x1'));var path=require(_0x11f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x11f9('0x3'));var router=express['Router']();var auth=require(_0x11f9('0x4'));var interaction=require(_0x11f9('0x5'));var config=require('../../config/environment');var controller=require(_0x11f9('0x6'));router['get']('/',auth[_0x11f9('0x7')](),controller[_0x11f9('0x8')]);router['get']('/describe',auth[_0x11f9('0x7')](),controller['describe']);router[_0x11f9('0x9')](_0x11f9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x11f9('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x11f9('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x11f9('0xd')]);router[_0x11f9('0xe')](_0x11f9('0xa'),auth[_0x11f9('0x7')](),controller['destroy']);module[_0x11f9('0xf')]=router; \ No newline at end of file +var _0x7851=['path','connect-timeout','express','Router','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7851,0x90));var _0x1785=function(_0x253e5e,_0x5e4f05){_0x253e5e=_0x253e5e-0x0;var _0x560308=_0x7851[_0x253e5e];return _0x560308;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1785('0x0'));var timeout=require(_0x1785('0x1'));var express=require(_0x1785('0x2'));var router=express[_0x1785('0x3')]();var auth=require(_0x1785('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1785('0x5'));router[_0x1785('0x6')]('/',auth[_0x1785('0x7')](),controller[_0x1785('0x8')]);router[_0x1785('0x6')](_0x1785('0x9'),auth[_0x1785('0x7')](),controller[_0x1785('0xa')]);router[_0x1785('0x6')](_0x1785('0xb'),auth[_0x1785('0x7')](),controller[_0x1785('0xc')]);router[_0x1785('0xd')]('/',auth['isAuthenticated'](),controller[_0x1785('0xe')]);router['put'](_0x1785('0xb'),auth[_0x1785('0x7')](),controller[_0x1785('0xf')]);router[_0x1785('0x10')](_0x1785('0xb'),auth[_0x1785('0x7')](),controller['destroy']);module[_0x1785('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 503efff..8380d92 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 _0xdc3b=['NOW','moment','sequelize','STRING','ENUM','account','agent','queue','DATE'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xdc3b,0xd9));var _0xbdc3=function(_0x7b3cf2,_0x72e0f3){_0x7b3cf2=_0x7b3cf2-0x0;var _0x4a960c=_0xdc3b[_0x7b3cf2];return _0x4a960c;};'use strict';var moment=require(_0xbdc3('0x0'));var Sequelize=require(_0xbdc3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbdc3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbdc3('0x3')](_0xbdc3('0x4'),_0xbdc3('0x5'),'queue'),'allowNull':![],'defaultValue':_0xbdc3('0x6')},'transferredAt':{'type':Sequelize[_0xbdc3('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xbdc3('0x8')]}}; \ No newline at end of file +var _0x6476=['DATE','NOW','exports','STRING','ENUM','account','agent','queue'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6476,0x102));var _0x6647=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6476[_0x5b78e8];return _0xf2c321;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6647('0x0')]={'uniqueid':{'type':Sequelize[_0x6647('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6647('0x2')](_0x6647('0x3'),_0x6647('0x4'),_0x6647('0x5')),'allowNull':![],'defaultValue':_0x6647('0x5')},'transferredAt':{'type':Sequelize[_0x6647('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x6647('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 19aa896..18d7ab4 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 _0xaba6=['type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','html-pdf','eml-format','moment','bluebird','util','path','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SmsTransferReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','map'];(function(_0x67e9ca,_0x419250){var _0x1b81d6=function(_0x483973){while(--_0x483973){_0x67e9ca['push'](_0x67e9ca['shift']());}};_0x1b81d6(++_0x419250);}(_0xaba6,0xe2));var _0x6aba=function(_0x37d317,_0x46dcc1){_0x37d317=_0x37d317-0x0;var _0x2c757f=_0xaba6[_0x37d317];return _0x2c757f;};'use strict';var pdf=require(_0x6aba('0x0'));var emlformat=require(_0x6aba('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6aba('0x2'));var BPromise=require(_0x6aba('0x3'));var Mustache=require('mustache');var util=require(_0x6aba('0x4'));var path=require(_0x6aba('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6aba('0x6'));var squel=require('squel');var crypto=require(_0x6aba('0x7'));var jsforce=require(_0x6aba('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x6aba('0x9'));var querystring=require(_0x6aba('0xa'));var Papa=require('papaparse');var Redis=require(_0x6aba('0xb'));var authService=require(_0x6aba('0xc'));var qs=require(_0x6aba('0xd'));var hardwareService=require(_0x6aba('0xe'));var logger=require(_0x6aba('0xf'))(_0x6aba('0x10'));var utils=require(_0x6aba('0x11'));var config=require('../../config/environment');var db=require(_0x6aba('0x12'))['db'];function respondWithStatusCode(_0x158935,_0x43867b){_0x43867b=_0x43867b||0xcc;return function(_0x254007){if(_0x254007){return _0x158935['sendStatus'](_0x43867b);}return _0x158935[_0x6aba('0x13')](_0x43867b)[_0x6aba('0x14')]();};}function respondWithResult(_0x4cad26,_0x123575){_0x123575=_0x123575||0xc8;return function(_0x2934c3){if(_0x2934c3){return _0x4cad26[_0x6aba('0x13')](_0x123575)['json'](_0x2934c3);}};}function respondWithFilteredResult(_0x1cf9d9,_0x1f3035){return function(_0x15d236){if(_0x15d236){var _0x4ae616=_0x15d236[_0x6aba('0x15')],_0x117235=_0x1f3035[_0x6aba('0x16')],_0xe0c63f=_0x1f3035[_0x6aba('0x16')]+_0x1f3035[_0x6aba('0x17')],_0xa3cb32;if(_0xe0c63f>=_0x4ae616){_0xe0c63f=_0x4ae616;_0xa3cb32=0xc8;}else{_0xa3cb32=0xce;}_0x1cf9d9['status'](_0xa3cb32);return _0x1cf9d9[_0x6aba('0x18')](_0x6aba('0x19'),_0x117235+'-'+_0xe0c63f+'/'+_0x4ae616)[_0x6aba('0x1a')](_0x15d236);}return null;};}function patchUpdates(_0x5ca5b2){return function(_0x1d6ad4){try{jsonpatch['apply'](_0x1d6ad4,_0x5ca5b2,!![]);}catch(_0x4dd600){return BPromise[_0x6aba('0x1b')](_0x4dd600);}return _0x1d6ad4['save']();};}function saveUpdates(_0x1f4a95,_0x1881ae){return function(_0x37b275){if(_0x37b275){return _0x37b275[_0x6aba('0x1c')](_0x1f4a95)[_0x6aba('0x1d')](function(_0x41a3d2){return _0x41a3d2;});}return null;};}function removeEntity(_0x362a10,_0x5953f2){return function(_0x2e5f65){if(_0x2e5f65){return _0x2e5f65[_0x6aba('0x1e')]()[_0x6aba('0x1d')](function(){_0x362a10[_0x6aba('0x13')](0xcc)[_0x6aba('0x14')]();});}};}function handleEntityNotFound(_0x43eef9,_0x44f723){return function(_0x67ba6e){if(!_0x67ba6e){_0x43eef9[_0x6aba('0x1f')](0x194);}return _0x67ba6e;};}function handleError(_0x222ad8,_0x31ec71){_0x31ec71=_0x31ec71||0x1f4;return function(_0x3e18e3){logger[_0x6aba('0x20')](_0x3e18e3[_0x6aba('0x21')]);if(_0x3e18e3[_0x6aba('0x22')]){delete _0x3e18e3[_0x6aba('0x22')];}_0x222ad8[_0x6aba('0x13')](_0x31ec71)[_0x6aba('0x23')](_0x3e18e3);};}exports[_0x6aba('0x24')]=function(_0x5dc72b,_0x50e864){var _0x335e82={},_0x5b0845={},_0x30ecf9={'count':0x0,'rows':[]};var _0x108ff1=db[_0x6aba('0x25')][_0x6aba('0x26')];_0x5b0845['model']=_[_0x6aba('0x27')](_0x108ff1);_0x5b0845[_0x6aba('0x28')]=_[_0x6aba('0x27')](_0x5dc72b[_0x6aba('0x28')]);_0x5b0845[_0x6aba('0x29')]=_['intersection'](_0x5b0845[_0x6aba('0x2a')],_0x5b0845['query']);_0x335e82[_0x6aba('0x2b')]=_[_0x6aba('0x2c')](_0x5b0845['model'],qs['fields'](_0x5dc72b[_0x6aba('0x28')][_0x6aba('0x2d')]));_0x335e82[_0x6aba('0x2b')]=_0x335e82[_0x6aba('0x2b')][_0x6aba('0x2e')]?_0x335e82[_0x6aba('0x2b')]:_0x5b0845[_0x6aba('0x2a')];if(!_0x5dc72b['query'][_0x6aba('0x2f')](_0x6aba('0x30'))){_0x335e82[_0x6aba('0x17')]=qs['limit'](_0x5dc72b[_0x6aba('0x28')][_0x6aba('0x17')]);_0x335e82[_0x6aba('0x16')]=qs['offset'](_0x5dc72b[_0x6aba('0x28')][_0x6aba('0x16')]);}_0x335e82['order']=qs[_0x6aba('0x31')](_0x5dc72b['query'][_0x6aba('0x31')]);_0x335e82['where']=qs[_0x6aba('0x29')](_[_0x6aba('0x32')](_0x5dc72b['query'],_0x5b0845['filters']));if(_0x5dc72b[_0x6aba('0x28')]['filter']){_0x335e82[_0x6aba('0x33')]=_[_0x6aba('0x34')](_0x335e82['where'],{'$or':_[_0x6aba('0x35')](_0x108ff1,function(_0x46d695){if(_0x46d695[_0x6aba('0x36')][_0x6aba('0x37')]!==_0x6aba('0x38')){var _0x19478e={};_0x19478e[_0x46d695[_0x6aba('0x39')]]={'$like':'%'+_0x5dc72b['query']['filter']+'%'};return _0x19478e;}})});}_0x335e82=_[_0x6aba('0x34')]({},_0x335e82,_0x5dc72b['options']);var _0x270af2={'where':_0x335e82[_0x6aba('0x33')]};return db[_0x6aba('0x25')]['count'](_0x270af2)[_0x6aba('0x1d')](function(_0x267d5c){_0x30ecf9[_0x6aba('0x15')]=_0x267d5c;if(_0x5dc72b[_0x6aba('0x28')][_0x6aba('0x3a')]){_0x335e82[_0x6aba('0x3b')]=[{'all':!![]}];}return db[_0x6aba('0x25')][_0x6aba('0x3c')](_0x335e82);})[_0x6aba('0x1d')](function(_0x550d00){_0x30ecf9[_0x6aba('0x3d')]=_0x550d00;return _0x30ecf9;})[_0x6aba('0x1d')](respondWithFilteredResult(_0x50e864,_0x335e82))[_0x6aba('0x3e')](handleError(_0x50e864,null));};exports[_0x6aba('0x3f')]=function(_0x4c485b,_0x1990d5){var _0x4abf0e={'raw':!![],'where':{'id':_0x4c485b['params']['id']}},_0x34f899={};_0x34f899['model']=_['keys'](db[_0x6aba('0x25')]['rawAttributes']);_0x34f899[_0x6aba('0x28')]=_[_0x6aba('0x27')](_0x4c485b[_0x6aba('0x28')]);_0x34f899[_0x6aba('0x29')]=_[_0x6aba('0x2c')](_0x34f899[_0x6aba('0x2a')],_0x34f899[_0x6aba('0x28')]);_0x4abf0e['attributes']=_[_0x6aba('0x2c')](_0x34f899[_0x6aba('0x2a')],qs[_0x6aba('0x2d')](_0x4c485b['query']['fields']));_0x4abf0e[_0x6aba('0x2b')]=_0x4abf0e[_0x6aba('0x2b')][_0x6aba('0x2e')]?_0x4abf0e[_0x6aba('0x2b')]:_0x34f899[_0x6aba('0x2a')];if(_0x4c485b['query'][_0x6aba('0x3a')]){_0x4abf0e[_0x6aba('0x3b')]=[{'all':!![]}];}_0x4abf0e=_[_0x6aba('0x34')]({},_0x4abf0e,_0x4c485b[_0x6aba('0x40')]);return db[_0x6aba('0x25')][_0x6aba('0x41')](_0x4abf0e)[_0x6aba('0x1d')](handleEntityNotFound(_0x1990d5,null))['then'](respondWithResult(_0x1990d5,null))[_0x6aba('0x3e')](handleError(_0x1990d5,null));};exports[_0x6aba('0x42')]=function(_0x293cb6,_0x38e888){return db[_0x6aba('0x25')][_0x6aba('0x42')](_0x293cb6['body'],{})[_0x6aba('0x1d')](respondWithResult(_0x38e888,0xc9))['catch'](handleError(_0x38e888,null));};exports['update']=function(_0x2609d4,_0x25d6a4){if(_0x2609d4[_0x6aba('0x43')]['id']){delete _0x2609d4[_0x6aba('0x43')]['id'];}return db[_0x6aba('0x25')][_0x6aba('0x41')]({'where':{'id':_0x2609d4[_0x6aba('0x44')]['id']}})[_0x6aba('0x1d')](handleEntityNotFound(_0x25d6a4,null))[_0x6aba('0x1d')](saveUpdates(_0x2609d4[_0x6aba('0x43')],null))['then'](respondWithResult(_0x25d6a4,null))[_0x6aba('0x3e')](handleError(_0x25d6a4,null));};exports[_0x6aba('0x1e')]=function(_0xbb902,_0xee64df){return db[_0x6aba('0x25')][_0x6aba('0x41')]({'where':{'id':_0xbb902[_0x6aba('0x44')]['id']}})[_0x6aba('0x1d')](handleEntityNotFound(_0xee64df,null))[_0x6aba('0x1d')](removeEntity(_0xee64df,null))[_0x6aba('0x3e')](handleError(_0xee64df,null));};exports[_0x6aba('0x45')]=function(_0xd4afa2,_0x3f7003){return db['SmsTransferReport'][_0x6aba('0x45')]()[_0x6aba('0x1d')](respondWithResult(_0x3f7003,null))[_0x6aba('0x3e')](handleError(_0x3f7003,null));}; \ No newline at end of file +var _0x277c=['bluebird','mustache','util','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','SmsTransferReport','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x43f4be,_0x32ab4c){var _0x5812b5=function(_0x2d08ed){while(--_0x2d08ed){_0x43f4be['push'](_0x43f4be['shift']());}};_0x5812b5(++_0x32ab4c);}(_0x277c,0x153));var _0xc277=function(_0x3831d2,_0x16a222){_0x3831d2=_0x3831d2-0x0;var _0x48bf83=_0x277c[_0x3831d2];return _0x48bf83;};'use strict';var pdf=require(_0xc277('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc277('0x1'));var zipdir=require(_0xc277('0x2'));var jsonpatch=require(_0xc277('0x3'));var rp=require(_0xc277('0x4'));var moment=require(_0xc277('0x5'));var BPromise=require(_0xc277('0x6'));var Mustache=require(_0xc277('0x7'));var util=require(_0xc277('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc277('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0x9'));var querystring=require(_0xc277('0xd'));var Papa=require(_0xc277('0xe'));var Redis=require(_0xc277('0xf'));var authService=require(_0xc277('0x10'));var qs=require(_0xc277('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc277('0x12'));var utils=require(_0xc277('0x13'));var config=require(_0xc277('0x14'));var db=require(_0xc277('0x15'))['db'];function respondWithStatusCode(_0x4e1719,_0x4713da){_0x4713da=_0x4713da||0xcc;return function(_0x4a7700){if(_0x4a7700){return _0x4e1719[_0xc277('0x16')](_0x4713da);}return _0x4e1719[_0xc277('0x17')](_0x4713da)[_0xc277('0x18')]();};}function respondWithResult(_0x30ecc3,_0x4bced3){_0x4bced3=_0x4bced3||0xc8;return function(_0x222bc8){if(_0x222bc8){return _0x30ecc3[_0xc277('0x17')](_0x4bced3)[_0xc277('0x19')](_0x222bc8);}};}function respondWithFilteredResult(_0x4de960,_0x5283ac){return function(_0x178e6d){if(_0x178e6d){var _0x5c212c=_0x178e6d[_0xc277('0x1a')],_0x46d20c=_0x5283ac[_0xc277('0x1b')],_0x5d73f8=_0x5283ac['offset']+_0x5283ac['limit'],_0x306046;if(_0x5d73f8>=_0x5c212c){_0x5d73f8=_0x5c212c;_0x306046=0xc8;}else{_0x306046=0xce;}_0x4de960[_0xc277('0x17')](_0x306046);return _0x4de960['set']('Content-Range',_0x46d20c+'-'+_0x5d73f8+'/'+_0x5c212c)[_0xc277('0x19')](_0x178e6d);}return null;};}function patchUpdates(_0xba31f6){return function(_0x3b247e){try{jsonpatch[_0xc277('0x1c')](_0x3b247e,_0xba31f6,!![]);}catch(_0xe2b7c1){return BPromise[_0xc277('0x1d')](_0xe2b7c1);}return _0x3b247e[_0xc277('0x1e')]();};}function saveUpdates(_0x4a7a79,_0x51e828){return function(_0x697d6f){if(_0x697d6f){return _0x697d6f[_0xc277('0x1f')](_0x4a7a79)[_0xc277('0x20')](function(_0x28b7b1){return _0x28b7b1;});}return null;};}function removeEntity(_0x2c79ca,_0xa3f62e){return function(_0xb4685f){if(_0xb4685f){return _0xb4685f[_0xc277('0x21')]()[_0xc277('0x20')](function(){_0x2c79ca[_0xc277('0x17')](0xcc)[_0xc277('0x18')]();});}};}function handleEntityNotFound(_0x57a198,_0x2b9936){return function(_0x21af1b){if(!_0x21af1b){_0x57a198['sendStatus'](0x194);}return _0x21af1b;};}function handleError(_0x463fa6,_0x4820e1){_0x4820e1=_0x4820e1||0x1f4;return function(_0x48124d){logger[_0xc277('0x22')](_0x48124d[_0xc277('0x23')]);if(_0x48124d[_0xc277('0x24')]){delete _0x48124d[_0xc277('0x24')];}_0x463fa6[_0xc277('0x17')](_0x4820e1)[_0xc277('0x25')](_0x48124d);};}exports[_0xc277('0x26')]=function(_0x9ad1c5,_0xf903ea){var _0x3e04cb={},_0x40d17a={},_0x5e480e={'count':0x0,'rows':[]};var _0x5f3933=db[_0xc277('0x27')][_0xc277('0x28')];_0x40d17a['model']=_['keys'](_0x5f3933);_0x40d17a[_0xc277('0x29')]=_[_0xc277('0x2a')](_0x9ad1c5[_0xc277('0x29')]);_0x40d17a[_0xc277('0x2b')]=_[_0xc277('0x2c')](_0x40d17a['model'],_0x40d17a[_0xc277('0x29')]);_0x3e04cb['attributes']=_[_0xc277('0x2c')](_0x40d17a[_0xc277('0x2d')],qs[_0xc277('0x2e')](_0x9ad1c5[_0xc277('0x29')]['fields']));_0x3e04cb[_0xc277('0x2f')]=_0x3e04cb['attributes'][_0xc277('0x30')]?_0x3e04cb[_0xc277('0x2f')]:_0x40d17a[_0xc277('0x2d')];if(!_0x9ad1c5[_0xc277('0x29')]['hasOwnProperty'](_0xc277('0x31'))){_0x3e04cb[_0xc277('0x32')]=qs['limit'](_0x9ad1c5[_0xc277('0x29')]['limit']);_0x3e04cb[_0xc277('0x1b')]=qs[_0xc277('0x1b')](_0x9ad1c5[_0xc277('0x29')][_0xc277('0x1b')]);}_0x3e04cb[_0xc277('0x33')]=qs[_0xc277('0x34')](_0x9ad1c5[_0xc277('0x29')][_0xc277('0x34')]);_0x3e04cb[_0xc277('0x35')]=qs[_0xc277('0x2b')](_[_0xc277('0x36')](_0x9ad1c5['query'],_0x40d17a[_0xc277('0x2b')]));if(_0x9ad1c5[_0xc277('0x29')][_0xc277('0x37')]){_0x3e04cb['where']=_[_0xc277('0x38')](_0x3e04cb[_0xc277('0x35')],{'$or':_[_0xc277('0x39')](_0x5f3933,function(_0x3e9701){if(_0x3e9701[_0xc277('0x3a')]['key']!=='VIRTUAL'){var _0x2d9fa5={};_0x2d9fa5[_0x3e9701['field']]={'$like':'%'+_0x9ad1c5[_0xc277('0x29')][_0xc277('0x37')]+'%'};return _0x2d9fa5;}})});}_0x3e04cb=_[_0xc277('0x38')]({},_0x3e04cb,_0x9ad1c5[_0xc277('0x3b')]);var _0x3ed643={'where':_0x3e04cb[_0xc277('0x35')]};return db[_0xc277('0x27')][_0xc277('0x1a')](_0x3ed643)[_0xc277('0x20')](function(_0x1a805a){_0x5e480e[_0xc277('0x1a')]=_0x1a805a;if(_0x9ad1c5['query'][_0xc277('0x3c')]){_0x3e04cb[_0xc277('0x3d')]=[{'all':!![]}];}return db[_0xc277('0x27')]['findAll'](_0x3e04cb);})[_0xc277('0x20')](function(_0x278a92){_0x5e480e['rows']=_0x278a92;return _0x5e480e;})['then'](respondWithFilteredResult(_0xf903ea,_0x3e04cb))[_0xc277('0x3e')](handleError(_0xf903ea,null));};exports[_0xc277('0x3f')]=function(_0x22c5b3,_0x1ca33a){var _0x114eec={'raw':!![],'where':{'id':_0x22c5b3[_0xc277('0x40')]['id']}},_0x3d1975={};_0x3d1975['model']=_[_0xc277('0x2a')](db[_0xc277('0x27')][_0xc277('0x28')]);_0x3d1975['query']=_['keys'](_0x22c5b3['query']);_0x3d1975['filters']=_['intersection'](_0x3d1975[_0xc277('0x2d')],_0x3d1975['query']);_0x114eec[_0xc277('0x2f')]=_[_0xc277('0x2c')](_0x3d1975[_0xc277('0x2d')],qs['fields'](_0x22c5b3[_0xc277('0x29')][_0xc277('0x2e')]));_0x114eec[_0xc277('0x2f')]=_0x114eec[_0xc277('0x2f')]['length']?_0x114eec[_0xc277('0x2f')]:_0x3d1975[_0xc277('0x2d')];if(_0x22c5b3['query'][_0xc277('0x3c')]){_0x114eec[_0xc277('0x3d')]=[{'all':!![]}];}_0x114eec=_[_0xc277('0x38')]({},_0x114eec,_0x22c5b3[_0xc277('0x3b')]);return db[_0xc277('0x27')][_0xc277('0x41')](_0x114eec)[_0xc277('0x20')](handleEntityNotFound(_0x1ca33a,null))[_0xc277('0x20')](respondWithResult(_0x1ca33a,null))[_0xc277('0x3e')](handleError(_0x1ca33a,null));};exports[_0xc277('0x42')]=function(_0x26cc4e,_0x55e691){return db[_0xc277('0x27')][_0xc277('0x42')](_0x26cc4e[_0xc277('0x43')],{})[_0xc277('0x20')](respondWithResult(_0x55e691,0xc9))['catch'](handleError(_0x55e691,null));};exports[_0xc277('0x1f')]=function(_0x4d7702,_0x2376f7){if(_0x4d7702[_0xc277('0x43')]['id']){delete _0x4d7702[_0xc277('0x43')]['id'];}return db[_0xc277('0x27')][_0xc277('0x41')]({'where':{'id':_0x4d7702['params']['id']}})[_0xc277('0x20')](handleEntityNotFound(_0x2376f7,null))[_0xc277('0x20')](saveUpdates(_0x4d7702[_0xc277('0x43')],null))[_0xc277('0x20')](respondWithResult(_0x2376f7,null))['catch'](handleError(_0x2376f7,null));};exports[_0xc277('0x21')]=function(_0x9c910a,_0x150876){return db['SmsTransferReport'][_0xc277('0x41')]({'where':{'id':_0x9c910a['params']['id']}})[_0xc277('0x20')](handleEntityNotFound(_0x150876,null))[_0xc277('0x20')](removeEntity(_0x150876,null))[_0xc277('0x3e')](handleError(_0x150876,null));};exports[_0xc277('0x44')]=function(_0x2ad6ed,_0x387225){return db[_0xc277('0x27')][_0xc277('0x44')]()[_0xc277('0x20')](respondWithResult(_0x387225,null))[_0xc277('0x3e')](handleError(_0x387225,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 8099b83..77511e2 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 _0x78d7=['../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x26b367,_0x158299){var _0x5a7c9f=function(_0x260466){while(--_0x260466){_0x26b367['push'](_0x26b367['shift']());}};_0x5a7c9f(++_0x158299);}(_0x78d7,0x17d));var _0x778d=function(_0xf3bcd6,_0x36970e){_0xf3bcd6=_0xf3bcd6-0x0;var _0x22126e=_0x78d7[_0xf3bcd6];return _0x22126e;};'use strict';var _=require(_0x778d('0x0'));var util=require(_0x778d('0x1'));var logger=require(_0x778d('0x2'))(_0x778d('0x3'));var moment=require(_0x778d('0x4'));var BPromise=require(_0x778d('0x5'));var rp=require(_0x778d('0x6'));var fs=require('fs');var path=require(_0x778d('0x7'));var rimraf=require(_0x778d('0x8'));var config=require(_0x778d('0x9'));var attributes=require(_0x778d('0xa'));module[_0x778d('0xb')]=function(_0xe1c8a,_0x335778){return _0xe1c8a['define'](_0x778d('0xc'),attributes,{'tableName':_0x778d('0xd'),'paranoid':![],'indexes':[{'name':_0x778d('0xe'),'fields':[_0x778d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x83b9=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','report_sms_transfer'];(function(_0xe8a7df,_0x21915c){var _0x22b8ed=function(_0x5acdf9){while(--_0x5acdf9){_0xe8a7df['push'](_0xe8a7df['shift']());}};_0x22b8ed(++_0x21915c);}(_0x83b9,0x1d5));var _0x983b=function(_0x385ceb,_0xd899de){_0x385ceb=_0x385ceb-0x0;var _0xd6310c=_0x83b9[_0x385ceb];return _0xd6310c;};'use strict';var _=require(_0x983b('0x0'));var util=require(_0x983b('0x1'));var logger=require(_0x983b('0x2'))(_0x983b('0x3'));var moment=require(_0x983b('0x4'));var BPromise=require(_0x983b('0x5'));var rp=require(_0x983b('0x6'));var fs=require('fs');var path=require(_0x983b('0x7'));var rimraf=require(_0x983b('0x8'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x33d4c2,_0x46051e){return _0x33d4c2[_0x983b('0x9')]('SmsTransferReport',attributes,{'tableName':_0x983b('0xa'),'paranoid':![],'indexes':[{'name':_0x983b('0xb'),'fields':[_0x983b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index ad4e3a4..41e96e2 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 _0x0447=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4c4bbe,_0x59819e){var _0x28c911=function(_0x3fed6e){while(--_0x3fed6e){_0x4c4bbe['push'](_0x4c4bbe['shift']());}};_0x28c911(++_0x59819e);}(_0x0447,0x8b));var _0x7044=function(_0x5590a7,_0x24f509){_0x5590a7=_0x5590a7-0x0;var _0x522a21=_0x0447[_0x5590a7];return _0x522a21;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var moment=require(_0x7044('0x2'));var BPromise=require(_0x7044('0x3'));var rs=require(_0x7044('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7044('0x5'))['db'];var utils=require(_0x7044('0x6'));var logger=require(_0x7044('0x7'))(_0x7044('0x8'));var config=require(_0x7044('0x9'));var jayson=require(_0x7044('0xa'));var client=jayson[_0x7044('0xb')][_0x7044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x66b8cb,_0x51de50,_0x72d341){return new BPromise(function(_0x42d53b,_0x2a2b36){return client[_0x7044('0xd')](_0x66b8cb,_0x72d341)['then'](function(_0x41616d){logger[_0x7044('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x51de50,_0x7044('0xf'));logger[_0x7044('0x10')](_0x7044('0x11'),_0x51de50,_0x7044('0xf'),JSON['stringify'](_0x41616d));if(_0x41616d[_0x7044('0x12')]){if(_0x41616d['error']['code']===0x1f4){logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')][_0x7044('0x14')]);return _0x2a2b36(_0x41616d[_0x7044('0x12')]['message']);}logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')]['message']);return _0x42d53b(_0x41616d['error'][_0x7044('0x14')]);}else{logger[_0x7044('0xe')](_0x7044('0x13'),_0x51de50,_0x7044('0xf'));_0x42d53b(_0x41616d[_0x7044('0x15')][_0x7044('0x14')]);}})['catch'](function(_0xdae8a){logger[_0x7044('0x12')](_0x7044('0x13'),_0x51de50,_0xdae8a);_0x2a2b36(_0xdae8a);});});} \ No newline at end of file +var _0xd916=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x39b86c,_0x5a8b64){var _0x120b7a=function(_0x3478f7){while(--_0x3478f7){_0x39b86c['push'](_0x39b86c['shift']());}};_0x120b7a(++_0x5a8b64);}(_0xd916,0x18a));var _0x6d91=function(_0x360f7c,_0x30176c){_0x360f7c=_0x360f7c-0x0;var _0x2e4f89=_0xd916[_0x360f7c];return _0x2e4f89;};'use strict';var _=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var moment=require(_0x6d91('0x2'));var BPromise=require(_0x6d91('0x3'));var rs=require(_0x6d91('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d91('0x5'))['db'];var utils=require(_0x6d91('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d91('0x7'));var jayson=require(_0x6d91('0x8'));var client=jayson['client'][_0x6d91('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fcd82,_0x1fd876,_0x418357){return new BPromise(function(_0x3b7135,_0x215018){return client[_0x6d91('0xa')](_0x3fcd82,_0x418357)['then'](function(_0x574d9e){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x1fd876,_0x6d91('0xb'));logger[_0x6d91('0xc')](_0x6d91('0xd'),_0x1fd876,_0x6d91('0xb'),JSON[_0x6d91('0xe')](_0x574d9e));if(_0x574d9e['error']){if(_0x574d9e[_0x6d91('0xf')][_0x6d91('0x10')]===0x1f4){logger[_0x6d91('0xf')](_0x6d91('0x11'),_0x1fd876,_0x574d9e[_0x6d91('0xf')][_0x6d91('0x12')]);return _0x215018(_0x574d9e[_0x6d91('0xf')][_0x6d91('0x12')]);}logger[_0x6d91('0xf')](_0x6d91('0x11'),_0x1fd876,_0x574d9e[_0x6d91('0xf')][_0x6d91('0x12')]);return _0x3b7135(_0x574d9e[_0x6d91('0xf')][_0x6d91('0x12')]);}else{logger[_0x6d91('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x1fd876,_0x6d91('0xb'));_0x3b7135(_0x574d9e[_0x6d91('0x14')][_0x6d91('0x12')]);}})[_0x6d91('0x15')](function(_0x3602f3){logger[_0x6d91('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x1fd876,_0x3602f3);_0x215018(_0x3602f3);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d8a4d4a..7b70709 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 _0xbd61=['get','isAuthenticated','index','/:id','show','/:id/download','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','single','file','put','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xbd61,0x11a));var _0x1bd6=function(_0x154e63,_0x29d3cc){_0x154e63=_0x154e63-0x0;var _0x1c967d=_0xbd61[_0x154e63];return _0x1c967d;};'use strict';var multer=require('multer');var util=require(_0x1bd6('0x0'));var path=require(_0x1bd6('0x1'));var timeout=require(_0x1bd6('0x2'));var express=require('express');var router=express[_0x1bd6('0x3')]();var auth=require(_0x1bd6('0x4'));var interaction=require(_0x1bd6('0x5'));var config=require(_0x1bd6('0x6'));var controller=require(_0x1bd6('0x7'));router[_0x1bd6('0x8')]('/',auth[_0x1bd6('0x9')](),controller[_0x1bd6('0xa')]);router['get'](_0x1bd6('0xb'),auth[_0x1bd6('0x9')](),controller[_0x1bd6('0xc')]);router[_0x1bd6('0x8')](_0x1bd6('0xd'),auth[_0x1bd6('0x9')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bb2e8,_0x5880a0,_0x1c1fd3){_0x1c1fd3(null,path[_0x1bd6('0xe')](config[_0x1bd6('0xf')],_0x1bd6('0x10')));},'filename':function(_0x1dc50c,_0x5756bc,_0xde57c3){_0x5756bc[_0x1bd6('0x11')]=_0x5756bc['originalname'][_0x1bd6('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xde57c3(null,util[_0x1bd6('0x13')]('%s-%s%s',path[_0x1bd6('0x14')](_0x5756bc[_0x1bd6('0x11')],path[_0x1bd6('0x15')](_0x5756bc[_0x1bd6('0x11')])),Date[_0x1bd6('0x16')](),path[_0x1bd6('0x15')](_0x5756bc[_0x1bd6('0x11')])));}})});router[_0x1bd6('0x17')]('/',upload[_0x1bd6('0x18')](_0x1bd6('0x19')),controller['create']);router[_0x1bd6('0x1a')](_0x1bd6('0xb'),auth[_0x1bd6('0x9')](),controller['update']);router[_0x1bd6('0x1b')](_0x1bd6('0xb'),auth[_0x1bd6('0x9')](),controller['delete']);module[_0x1bd6('0x1c')]=router; \ No newline at end of file +var _0x5dfa=['diskStorage','join','server/files/sounds/original/','originalname','replace','%s-%s%s','now','extname','post','single','file','put','update','delete','exports','multer','util','path','connect-timeout','express','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download'];(function(_0x2a61b8,_0x5a63ad){var _0x5b52d5=function(_0x468f8b){while(--_0x468f8b){_0x2a61b8['push'](_0x2a61b8['shift']());}};_0x5b52d5(++_0x5a63ad);}(_0x5dfa,0xd3));var _0xa5df=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5dfa[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xa5df('0x0'));var util=require(_0xa5df('0x1'));var path=require(_0xa5df('0x2'));var timeout=require(_0xa5df('0x3'));var express=require(_0xa5df('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa5df('0x5'));router[_0xa5df('0x6')]('/',auth[_0xa5df('0x7')](),controller[_0xa5df('0x8')]);router[_0xa5df('0x6')](_0xa5df('0x9'),auth['isAuthenticated'](),controller[_0xa5df('0xa')]);router[_0xa5df('0x6')](_0xa5df('0xb'),auth[_0xa5df('0x7')](),controller[_0xa5df('0xc')]);var upload=multer({'storage':multer[_0xa5df('0xd')]({'destination':function(_0x11e990,_0x3dc50a,_0x5837ef){_0x5837ef(null,path[_0xa5df('0xe')](config['root'],_0xa5df('0xf')));},'filename':function(_0x368c35,_0x250e38,_0x2071b1){_0x250e38[_0xa5df('0x10')]=_0x250e38[_0xa5df('0x10')][_0xa5df('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2071b1(null,util['format'](_0xa5df('0x12'),path['basename'](_0x250e38[_0xa5df('0x10')],path['extname'](_0x250e38[_0xa5df('0x10')])),Date[_0xa5df('0x13')](),path[_0xa5df('0x14')](_0x250e38[_0xa5df('0x10')])));}})});router[_0xa5df('0x15')]('/',upload[_0xa5df('0x16')](_0xa5df('0x17')),controller['create']);router[_0xa5df('0x18')]('/:id',auth[_0xa5df('0x7')](),controller[_0xa5df('0x19')]);router['delete']('/:id',auth[_0xa5df('0x7')](),controller[_0xa5df('0x1a')]);module[_0xa5df('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index f56cb12..5541352 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 _0x8e99=['STRING','name','BIGINT','INTEGER','FLOAT','sequelize'];(function(_0x19d31d,_0x356dda){var _0x44c979=function(_0x582d76){while(--_0x582d76){_0x19d31d['push'](_0x19d31d['shift']());}};_0x44c979(++_0x356dda);}(_0x8e99,0x161));var _0x98e9=function(_0x2c3103,_0xc2197d){_0x2c3103=_0x2c3103-0x0;var _0x4cabae=_0x8e99[_0x2c3103];return _0x4cabae;};'use strict';var Sequelize=require(_0x98e9('0x0'));module['exports']={'name':{'type':Sequelize[_0x98e9('0x1')],'unique':_0x98e9('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x98e9('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x98e9('0x1')]},'original_format':{'type':Sequelize[_0x98e9('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x98e9('0x3')]},'original_channelCount':{'type':Sequelize[_0x98e9('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x98e9('0x1')]},'converted_duration':{'type':Sequelize[_0x98e9('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x98e9('0x3')]},'converted_channelCount':{'type':Sequelize[_0x98e9('0x4')]},'converted_bitRate':{'type':Sequelize[_0x98e9('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x98e9('0x4')]}}; \ No newline at end of file +var _0xb659=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x2c4949,_0x2476d2){var _0x5e9161=function(_0x436268){while(--_0x436268){_0x2c4949['push'](_0x2c4949['shift']());}};_0x5e9161(++_0x2476d2);}(_0xb659,0xfb));var _0x9b65=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0xb659[_0x5c2cd5];return _0x5180e9;};'use strict';var Sequelize=require(_0x9b65('0x0'));module[_0x9b65('0x1')]={'name':{'type':Sequelize[_0x9b65('0x2')],'unique':_0x9b65('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x9b65('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x9b65('0x2')]},'original_duration':{'type':Sequelize[_0x9b65('0x4')]},'original_sampleCount':{'type':Sequelize[_0x9b65('0x5')]},'original_channelCount':{'type':Sequelize[_0x9b65('0x6')]},'original_bitRate':{'type':Sequelize[_0x9b65('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x9b65('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x9b65('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x9b65('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index cd21946..aa79f80 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 _0x91ab=['findAll','rows','catch','show','params','find','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','root','%s.%s','save_name','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Sounds','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','description','original_format','format','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','count','offset','set','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','index','Sound','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','include'];(function(_0x174eba,_0xe438a1){var _0x54a741=function(_0x5a0955){while(--_0x5a0955){_0x174eba['push'](_0x174eba['shift']());}};_0x54a741(++_0xe438a1);}(_0x91ab,0x131));var _0xb91a=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x91ab[_0x487b0c];return _0x1adbdc;};'use strict';var pdf=require(_0xb91a('0x0'));var emlformat=require(_0xb91a('0x1'));var rimraf=require(_0xb91a('0x2'));var zipdir=require(_0xb91a('0x3'));var jsonpatch=require(_0xb91a('0x4'));var rp=require(_0xb91a('0x5'));var moment=require(_0xb91a('0x6'));var BPromise=require(_0xb91a('0x7'));var Mustache=require(_0xb91a('0x8'));var util=require('util');var path=require(_0xb91a('0x9'));var sox=require(_0xb91a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb91a('0xb'));var squel=require(_0xb91a('0xc'));var crypto=require(_0xb91a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb91a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb91a('0xf'));var Papa=require(_0xb91a('0x10'));var Redis=require('ioredis');var authService=require(_0xb91a('0x11'));var qs=require(_0xb91a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb91a('0x13'))(_0xb91a('0x14'));var utils=require(_0xb91a('0x15'));var config=require(_0xb91a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x104233,_0x544a2c){_0x544a2c=_0x544a2c||0xcc;return function(_0x3992c6){if(_0x3992c6){return _0x104233['sendStatus'](_0x544a2c);}return _0x104233[_0xb91a('0x17')](_0x544a2c)['end']();};}function respondWithResult(_0x57a117,_0x5a4290){_0x5a4290=_0x5a4290||0xc8;return function(_0x11d9f3){if(_0x11d9f3){return _0x57a117[_0xb91a('0x17')](_0x5a4290)['json'](_0x11d9f3);}};}function respondWithFilteredResult(_0x45da3c,_0x63271e){return function(_0x5d4175){if(_0x5d4175){var _0x55ad87=_0x5d4175[_0xb91a('0x18')],_0x284c74=_0x63271e[_0xb91a('0x19')],_0x43e13c=_0x63271e[_0xb91a('0x19')]+_0x63271e['limit'],_0x250613;if(_0x43e13c>=_0x55ad87){_0x43e13c=_0x55ad87;_0x250613=0xc8;}else{_0x250613=0xce;}_0x45da3c[_0xb91a('0x17')](_0x250613);return _0x45da3c[_0xb91a('0x1a')]('Content-Range',_0x284c74+'-'+_0x43e13c+'/'+_0x55ad87)['json'](_0x5d4175);}return null;};}function patchUpdates(_0x27d8da){return function(_0x4ef81b){try{jsonpatch['apply'](_0x4ef81b,_0x27d8da,!![]);}catch(_0xf7847f){return BPromise[_0xb91a('0x1b')](_0xf7847f);}return _0x4ef81b[_0xb91a('0x1c')]();};}function saveUpdates(_0x486658,_0x4d35dd){return function(_0xb96e8a){if(_0xb96e8a){return _0xb96e8a[_0xb91a('0x1d')](_0x486658)[_0xb91a('0x1e')](function(_0x54de14){return _0x54de14;});}return null;};}function removeEntity(_0x5ec6d8,_0x593abf){return function(_0x56e85a){if(_0x56e85a){return _0x56e85a[_0xb91a('0x1f')]()[_0xb91a('0x1e')](function(){var _0x14a99a=_0x56e85a['get']({'plain':!![]});var _0x5f30c9='Sounds';return db[_0xb91a('0x20')][_0xb91a('0x1f')]({'where':{'type':_0x5f30c9,'resourceId':_0x14a99a['id']}})[_0xb91a('0x1e')](function(){return _0x56e85a;});})[_0xb91a('0x1e')](function(){_0x5ec6d8['status'](0xcc)[_0xb91a('0x21')]();});}};}function handleEntityNotFound(_0x47a9d7,_0x5743b9){return function(_0x26c02e){if(!_0x26c02e){_0x47a9d7['sendStatus'](0x194);}return _0x26c02e;};}function handleError(_0x2787fb,_0x1958f8){_0x1958f8=_0x1958f8||0x1f4;return function(_0x592d55){logger[_0xb91a('0x22')](_0x592d55[_0xb91a('0x23')]);if(_0x592d55[_0xb91a('0x24')]){delete _0x592d55[_0xb91a('0x24')];}_0x2787fb[_0xb91a('0x17')](_0x1958f8)['send'](_0x592d55);};}exports[_0xb91a('0x25')]=function(_0x2cc0c0,_0x14af3a){var _0x3db54d={},_0x3d10fc={},_0x45c0d3={'count':0x0,'rows':[]};var _0x2e456f=db[_0xb91a('0x26')][_0xb91a('0x27')];_0x3d10fc[_0xb91a('0x28')]=_['keys'](_0x2e456f);_0x3d10fc[_0xb91a('0x29')]=_[_0xb91a('0x2a')](_0x2cc0c0[_0xb91a('0x29')]);_0x3d10fc[_0xb91a('0x2b')]=_[_0xb91a('0x2c')](_0x3d10fc[_0xb91a('0x28')],_0x3d10fc[_0xb91a('0x29')]);_0x3db54d[_0xb91a('0x2d')]=_[_0xb91a('0x2c')](_0x3d10fc[_0xb91a('0x28')],qs[_0xb91a('0x2e')](_0x2cc0c0[_0xb91a('0x29')][_0xb91a('0x2e')]));_0x3db54d[_0xb91a('0x2d')]=_0x3db54d[_0xb91a('0x2d')][_0xb91a('0x2f')]?_0x3db54d[_0xb91a('0x2d')]:_0x3d10fc[_0xb91a('0x28')];if(!_0x2cc0c0[_0xb91a('0x29')]['hasOwnProperty']('nolimit')){_0x3db54d[_0xb91a('0x30')]=qs['limit'](_0x2cc0c0[_0xb91a('0x29')][_0xb91a('0x30')]);_0x3db54d['offset']=qs[_0xb91a('0x19')](_0x2cc0c0['query'][_0xb91a('0x19')]);}_0x3db54d[_0xb91a('0x31')]=qs[_0xb91a('0x32')](_0x2cc0c0[_0xb91a('0x29')]['sort']);_0x3db54d[_0xb91a('0x33')]=qs[_0xb91a('0x2b')](_[_0xb91a('0x34')](_0x2cc0c0[_0xb91a('0x29')],_0x3d10fc[_0xb91a('0x2b')]));if(_0x2cc0c0['query'][_0xb91a('0x35')]){_0x3db54d[_0xb91a('0x33')]=_[_0xb91a('0x36')](_0x3db54d[_0xb91a('0x33')],{'$or':_[_0xb91a('0x37')](_0x2e456f,function(_0x255022){if(_0x255022[_0xb91a('0x38')][_0xb91a('0x39')]!=='VIRTUAL'){var _0x32ff73={};_0x32ff73[_0x255022[_0xb91a('0x3a')]]={'$like':'%'+_0x2cc0c0[_0xb91a('0x29')][_0xb91a('0x35')]+'%'};return _0x32ff73;}})});}_0x3db54d=_[_0xb91a('0x36')]({},_0x3db54d,_0x2cc0c0[_0xb91a('0x3b')]);var _0x2f2c7e={'where':_0x3db54d[_0xb91a('0x33')]};return db['Sound'][_0xb91a('0x18')](_0x2f2c7e)[_0xb91a('0x1e')](function(_0x48adb5){_0x45c0d3[_0xb91a('0x18')]=_0x48adb5;if(_0x2cc0c0[_0xb91a('0x29')]['includeAll']){_0x3db54d[_0xb91a('0x3c')]=[{'all':!![]}];}return db[_0xb91a('0x26')][_0xb91a('0x3d')](_0x3db54d);})[_0xb91a('0x1e')](function(_0x470ef1){_0x45c0d3[_0xb91a('0x3e')]=_0x470ef1;return _0x45c0d3;})[_0xb91a('0x1e')](respondWithFilteredResult(_0x14af3a,_0x3db54d))[_0xb91a('0x3f')](handleError(_0x14af3a,null));};exports[_0xb91a('0x40')]=function(_0x3dcf36,_0x93bd50){var _0x3c0bae={'raw':!![],'where':{'id':_0x3dcf36[_0xb91a('0x41')]['id']}},_0x5e12e4={};_0x5e12e4[_0xb91a('0x28')]=_['keys'](db[_0xb91a('0x26')][_0xb91a('0x27')]);_0x5e12e4['query']=_[_0xb91a('0x2a')](_0x3dcf36[_0xb91a('0x29')]);_0x5e12e4[_0xb91a('0x2b')]=_[_0xb91a('0x2c')](_0x5e12e4[_0xb91a('0x28')],_0x5e12e4[_0xb91a('0x29')]);_0x3c0bae['attributes']=_[_0xb91a('0x2c')](_0x5e12e4['model'],qs[_0xb91a('0x2e')](_0x3dcf36[_0xb91a('0x29')][_0xb91a('0x2e')]));_0x3c0bae[_0xb91a('0x2d')]=_0x3c0bae[_0xb91a('0x2d')][_0xb91a('0x2f')]?_0x3c0bae['attributes']:_0x5e12e4[_0xb91a('0x28')];if(_0x3dcf36[_0xb91a('0x29')]['includeAll']){_0x3c0bae[_0xb91a('0x3c')]=[{'all':!![]}];}_0x3c0bae=_[_0xb91a('0x36')]({},_0x3c0bae,_0x3dcf36[_0xb91a('0x3b')]);return db[_0xb91a('0x26')][_0xb91a('0x42')](_0x3c0bae)[_0xb91a('0x1e')](handleEntityNotFound(_0x93bd50,null))[_0xb91a('0x1e')](respondWithResult(_0x93bd50,null))[_0xb91a('0x3f')](handleError(_0x93bd50,null));};exports['download']=function(_0x59f68f,_0x2c426a,_0x244d92){return db[_0xb91a('0x26')][_0xb91a('0x42')]({'where':{'id':_0x59f68f['params']['id']},'attributes':[_0xb91a('0x24'),'save_name',_0xb91a('0x43')],'raw':!![]})[_0xb91a('0x1e')](handleEntityNotFound(_0x2c426a,null))['then'](function(_0x299fc0){if(_0x299fc0){if(!fs[_0xb91a('0x44')](path[_0xb91a('0x45')](config['root'],_0xb91a('0x46'),_0x299fc0['save_name']+'.'+_0x299fc0['converted_format']))){throw new db[(_0xb91a('0x47'))][(_0xb91a('0x48'))](_0xb91a('0x49'));}return _0x2c426a[_0xb91a('0x4a')](path[_0xb91a('0x45')](config[_0xb91a('0x4b')],_0xb91a('0x46'),util['format'](_0xb91a('0x4c'),_0x299fc0[_0xb91a('0x4d')],_0x299fc0[_0xb91a('0x43')])),util['format']('%s.%s',_0x299fc0[_0xb91a('0x24')],_0x299fc0['converted_format']));}return null;})[_0xb91a('0x3f')](handleError(_0x2c426a,null));};exports['create']=function(_0x418cd1,_0x4c3173,_0x25444a){var _0x92c481={'name':path[_0xb91a('0x4e')](_0x418cd1[_0xb91a('0x4f')][_0xb91a('0x50')],path[_0xb91a('0x51')](_0x418cd1['file'][_0xb91a('0x50')])),'save_name':path[_0xb91a('0x4e')](_0x418cd1[_0xb91a('0x4f')][_0xb91a('0x52')],path[_0xb91a('0x51')](_0x418cd1[_0xb91a('0x4f')][_0xb91a('0x52')])),'original_format':path['extname'](_0x418cd1['file'][_0xb91a('0x50')])[_0xb91a('0x53')](0x1),'converted_format':'wav'};var _0x7281c7=path[_0xb91a('0x45')](config[_0xb91a('0x4b')],_0xb91a('0x54'),_0x418cd1['file'][_0xb91a('0x52')]);var _0x3c06b5=path[_0xb91a('0x45')](config[_0xb91a('0x4b')],_0xb91a('0x46'),util['format'](_0xb91a('0x4c'),path['basename'](_0x418cd1['file'][_0xb91a('0x52')],path['extname'](_0x418cd1[_0xb91a('0x4f')]['filename'])),_0x92c481[_0xb91a('0x43')]));logger[_0xb91a('0x55')](_0xb91a('0x56'),_0x7281c7);logger[_0xb91a('0x55')](_0xb91a('0x57'),_0x3c06b5);try{fs[_0xb91a('0x58')](_0x7281c7,parseInt(_0xb91a('0x59'),0x8));var _0x17084d=sox[_0xb91a('0x5a')](_0x7281c7,_0x3c06b5,{'sampleRate':0x1f40,'format':_0xb91a('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x17084d['on'](_0xb91a('0x22'),function(_0x3f02d9){fs['unlinkSync'](_0x7281c7);_0x4c3173[_0xb91a('0x17')](0x1f4)['send'](_0x3f02d9);});_0x17084d['on']('src',function(_0x1f4d08){_0x92c481[_0xb91a('0x5c')]=isNaN(_0x1f4d08[_0xb91a('0x5d')])?null:_0x1f4d08[_0xb91a('0x5d')]*0x3e8;_0x92c481['original_sampleCount']=isNaN(_0x1f4d08[_0xb91a('0x5e')])?null:_0x1f4d08[_0xb91a('0x5e')];_0x92c481[_0xb91a('0x5f')]=isNaN(_0x1f4d08[_0xb91a('0x60')])?null:_0x1f4d08[_0xb91a('0x60')];_0x92c481['original_bitRate']=isNaN(_0x1f4d08[_0xb91a('0x61')])?null:_0x1f4d08['bitRate'];_0x92c481[_0xb91a('0x62')]=isNaN(_0x1f4d08['sampleRate'])?null:_0x1f4d08[_0xb91a('0x63')];});_0x17084d['on'](_0xb91a('0x64'),function(_0x2cd2f2){_0x92c481[_0xb91a('0x65')]=isNaN(_0x2cd2f2[_0xb91a('0x5d')])?null:_0x2cd2f2[_0xb91a('0x5d')]*0x3e8;_0x92c481[_0xb91a('0x66')]=isNaN(_0x2cd2f2[_0xb91a('0x5e')])?null:_0x2cd2f2['sampleCount'];_0x92c481[_0xb91a('0x67')]=isNaN(_0x2cd2f2[_0xb91a('0x60')])?null:_0x2cd2f2['channelCount'];_0x92c481[_0xb91a('0x68')]=isNaN(_0x2cd2f2['bitRate'])?null:_0x2cd2f2[_0xb91a('0x61')];_0x92c481[_0xb91a('0x69')]=isNaN(_0x2cd2f2[_0xb91a('0x63')])?null:_0x2cd2f2[_0xb91a('0x63')];});_0x17084d['on']('end',function(){fs[_0xb91a('0x58')](_0x3c06b5,parseInt('0777',0x8));return db['Sound']['create'](_0x92c481)[_0xb91a('0x1e')](function(_0x1e6489){var _0x209206={'role':_0x418cd1['body'][_0xb91a('0x6a')],'userProfileId':_0x418cd1[_0xb91a('0x6b')][_0xb91a('0x6c')]};if(!_0x209206)throw new Error(_0xb91a('0x6d'));if(_0x209206[_0xb91a('0x6a')]===_0xb91a('0x6e')){var _0x1bd309=_0x1e6489[_0xb91a('0x6f')]({'plain':!![]});return db[_0xb91a('0x70')]['find']({'where':{'name':_0xb91a('0x71'),'userProfileId':_0x209206[_0xb91a('0x6c')]},'raw':!![]})[_0xb91a('0x1e')](function(_0x1b2178){if(_0x1b2178&&_0x1b2178['autoAssociation']===0x0){return db[_0xb91a('0x20')][_0xb91a('0x72')]({'name':_0x1bd309[_0xb91a('0x24')],'resourceId':_0x1bd309['id'],'type':_0x1b2178[_0xb91a('0x24')],'sectionId':_0x1b2178['id']},{})['then'](function(){return _0x1e6489;});}else{return _0x1e6489;}})[_0xb91a('0x3f')](function(_0x2ad78b){logger[_0xb91a('0x22')](_0xb91a('0x73'),_0x2ad78b);throw _0x2ad78b;});}return _0x1e6489;})[_0xb91a('0x1e')](respondWithResult(_0x4c3173,null))[_0xb91a('0x3f')](handleError(_0x4c3173,null));});_0x17084d[_0xb91a('0x74')]();}catch(_0x536ad2){_0x4c3173[_0xb91a('0x17')](0x1f4)[_0xb91a('0x75')](_0x536ad2);}};exports[_0xb91a('0x1d')]=function(_0x557e2b,_0x2c5b67,_0xe37b6f){return db[_0xb91a('0x26')][_0xb91a('0x42')]({'where':{'id':_0x557e2b['params']['id']}})[_0xb91a('0x1e')](handleEntityNotFound(_0x2c5b67,null))[_0xb91a('0x1e')](saveUpdates(_[_0xb91a('0x34')](_0x557e2b[_0xb91a('0x6b')],['name',_0xb91a('0x76')]),null))[_0xb91a('0x1e')](respondWithResult(_0x2c5b67,null))['catch'](handleError(_0x2c5b67,null));};exports['delete']=function(_0x22928e,_0x38b35d,_0x502fd4){return db[_0xb91a('0x26')][_0xb91a('0x42')]({'where':{'id':_0x22928e[_0xb91a('0x41')]['id']}})['then'](function(_0x2cc1cc){if(_0x2cc1cc){return _0x2cc1cc[_0xb91a('0x1f')]();}})[_0xb91a('0x1e')](function(_0x3c9f98){var _0x2a9dd3=path[_0xb91a('0x45')](config['root'],'server/files/sounds/original',util['format'](_0xb91a('0x4c'),_0x3c9f98[_0xb91a('0x4d')],_0x3c9f98[_0xb91a('0x77')]));var _0x3e21a8=path['join'](config[_0xb91a('0x4b')],_0xb91a('0x46'),util[_0xb91a('0x78')]('%s.%s',_0x3c9f98[_0xb91a('0x4d')],_0x3c9f98[_0xb91a('0x43')]));fs[_0xb91a('0x79')](_0x2a9dd3);fs[_0xb91a('0x79')](_0x3e21a8);return _0x3c9f98;})[_0xb91a('0x1e')](function(_0x27743c){if(_0x27743c){return _0x38b35d['status'](0xcc)[_0xb91a('0x21')]();}})[_0xb91a('0x1e')](handleEntityNotFound(_0x38b35d,null))[_0xb91a('0x3f')](handleError(_0x38b35d,null));}; \ No newline at end of file +var _0x298d=['length','hasOwnProperty','offset','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','rows','show','params','fields','find','catch','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','download','name','file','basename','filename','extname','originalname','substring','server/files/sounds/original','format','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','wav','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','start','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','update','then','get','Sounds','destroy','error','send','Sound','keys','query','filters','intersection','model','attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x298d,0xbf));var _0xd298=function(_0x417010,_0x122d00){_0x417010=_0x417010-0x0;var _0x34fcf7=_0x298d[_0x417010];return _0x34fcf7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd298('0x0'));var rimraf=require(_0xd298('0x1'));var zipdir=require(_0xd298('0x2'));var jsonpatch=require(_0xd298('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd298('0x4'));var Mustache=require(_0xd298('0x5'));var util=require(_0xd298('0x6'));var path=require(_0xd298('0x7'));var sox=require(_0xd298('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd298('0x9'));var crypto=require(_0xd298('0xa'));var jsforce=require(_0xd298('0xb'));var deskjs=require(_0xd298('0xc'));var toCsv=require(_0xd298('0xd'));var querystring=require(_0xd298('0xe'));var Papa=require(_0xd298('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd298('0x10'));var hardwareService=require(_0xd298('0x11'));var logger=require(_0xd298('0x12'))('api');var utils=require(_0xd298('0x13'));var config=require('../../config/environment');var db=require(_0xd298('0x14'))['db'];function respondWithStatusCode(_0xe2e3,_0x4a0673){_0x4a0673=_0x4a0673||0xcc;return function(_0xa4ad6e){if(_0xa4ad6e){return _0xe2e3[_0xd298('0x15')](_0x4a0673);}return _0xe2e3[_0xd298('0x16')](_0x4a0673)[_0xd298('0x17')]();};}function respondWithResult(_0x1978e8,_0x1b4358){_0x1b4358=_0x1b4358||0xc8;return function(_0x12f93f){if(_0x12f93f){return _0x1978e8[_0xd298('0x16')](_0x1b4358)[_0xd298('0x18')](_0x12f93f);}};}function respondWithFilteredResult(_0x56fbe8,_0x3a01c5){return function(_0x608d1e){if(_0x608d1e){var _0x47c5a8=_0x608d1e[_0xd298('0x19')],_0x494b46=_0x3a01c5['offset'],_0x4cb1ab=_0x3a01c5['offset']+_0x3a01c5[_0xd298('0x1a')],_0x12f114;if(_0x4cb1ab>=_0x47c5a8){_0x4cb1ab=_0x47c5a8;_0x12f114=0xc8;}else{_0x12f114=0xce;}_0x56fbe8[_0xd298('0x16')](_0x12f114);return _0x56fbe8[_0xd298('0x1b')](_0xd298('0x1c'),_0x494b46+'-'+_0x4cb1ab+'/'+_0x47c5a8)[_0xd298('0x18')](_0x608d1e);}return null;};}function patchUpdates(_0x3262bf){return function(_0x485f6c){try{jsonpatch[_0xd298('0x1d')](_0x485f6c,_0x3262bf,!![]);}catch(_0x40e795){return BPromise['reject'](_0x40e795);}return _0x485f6c[_0xd298('0x1e')]();};}function saveUpdates(_0x29f040,_0x457ccb){return function(_0x327dea){if(_0x327dea){return _0x327dea[_0xd298('0x1f')](_0x29f040)['then'](function(_0x162520){return _0x162520;});}return null;};}function removeEntity(_0x80d5c0,_0x5f2dfe){return function(_0x1ca2b7){if(_0x1ca2b7){return _0x1ca2b7['destroy']()[_0xd298('0x20')](function(){var _0x4d296f=_0x1ca2b7[_0xd298('0x21')]({'plain':!![]});var _0x291c44=_0xd298('0x22');return db['UserProfileResource'][_0xd298('0x23')]({'where':{'type':_0x291c44,'resourceId':_0x4d296f['id']}})['then'](function(){return _0x1ca2b7;});})['then'](function(){_0x80d5c0[_0xd298('0x16')](0xcc)[_0xd298('0x17')]();});}};}function handleEntityNotFound(_0x14f506,_0x27e008){return function(_0xe57911){if(!_0xe57911){_0x14f506[_0xd298('0x15')](0x194);}return _0xe57911;};}function handleError(_0x589d2c,_0x2289ba){_0x2289ba=_0x2289ba||0x1f4;return function(_0x3db422){logger[_0xd298('0x24')](_0x3db422['stack']);if(_0x3db422['name']){delete _0x3db422['name'];}_0x589d2c['status'](_0x2289ba)[_0xd298('0x25')](_0x3db422);};}exports['index']=function(_0x3ac227,_0x4beda2){var _0x34ba49={},_0x509f71={},_0x4daff2={'count':0x0,'rows':[]};var _0x3c788c=db[_0xd298('0x26')]['rawAttributes'];_0x509f71['model']=_[_0xd298('0x27')](_0x3c788c);_0x509f71[_0xd298('0x28')]=_[_0xd298('0x27')](_0x3ac227[_0xd298('0x28')]);_0x509f71[_0xd298('0x29')]=_[_0xd298('0x2a')](_0x509f71[_0xd298('0x2b')],_0x509f71[_0xd298('0x28')]);_0x34ba49[_0xd298('0x2c')]=_[_0xd298('0x2a')](_0x509f71['model'],qs['fields'](_0x3ac227[_0xd298('0x28')]['fields']));_0x34ba49[_0xd298('0x2c')]=_0x34ba49[_0xd298('0x2c')][_0xd298('0x2d')]?_0x34ba49[_0xd298('0x2c')]:_0x509f71[_0xd298('0x2b')];if(!_0x3ac227['query'][_0xd298('0x2e')]('nolimit')){_0x34ba49[_0xd298('0x1a')]=qs[_0xd298('0x1a')](_0x3ac227[_0xd298('0x28')][_0xd298('0x1a')]);_0x34ba49[_0xd298('0x2f')]=qs[_0xd298('0x2f')](_0x3ac227[_0xd298('0x28')]['offset']);}_0x34ba49['order']=qs[_0xd298('0x30')](_0x3ac227[_0xd298('0x28')]['sort']);_0x34ba49[_0xd298('0x31')]=qs[_0xd298('0x29')](_[_0xd298('0x32')](_0x3ac227[_0xd298('0x28')],_0x509f71[_0xd298('0x29')]));if(_0x3ac227['query'][_0xd298('0x33')]){_0x34ba49[_0xd298('0x31')]=_[_0xd298('0x34')](_0x34ba49[_0xd298('0x31')],{'$or':_['map'](_0x3c788c,function(_0x387fd5){if(_0x387fd5[_0xd298('0x35')][_0xd298('0x36')]!==_0xd298('0x37')){var _0x3edb1c={};_0x3edb1c[_0x387fd5['field']]={'$like':'%'+_0x3ac227[_0xd298('0x28')][_0xd298('0x33')]+'%'};return _0x3edb1c;}})});}_0x34ba49=_[_0xd298('0x34')]({},_0x34ba49,_0x3ac227[_0xd298('0x38')]);var _0xe2c409={'where':_0x34ba49[_0xd298('0x31')]};return db[_0xd298('0x26')][_0xd298('0x19')](_0xe2c409)[_0xd298('0x20')](function(_0x31ed68){_0x4daff2[_0xd298('0x19')]=_0x31ed68;if(_0x3ac227[_0xd298('0x28')][_0xd298('0x39')]){_0x34ba49[_0xd298('0x3a')]=[{'all':!![]}];}return db[_0xd298('0x26')]['findAll'](_0x34ba49);})['then'](function(_0x512d59){_0x4daff2[_0xd298('0x3b')]=_0x512d59;return _0x4daff2;})[_0xd298('0x20')](respondWithFilteredResult(_0x4beda2,_0x34ba49))['catch'](handleError(_0x4beda2,null));};exports[_0xd298('0x3c')]=function(_0x20e81a,_0x26db6e){var _0x24c0e6={'raw':!![],'where':{'id':_0x20e81a[_0xd298('0x3d')]['id']}},_0x5700b5={};_0x5700b5['model']=_[_0xd298('0x27')](db['Sound']['rawAttributes']);_0x5700b5[_0xd298('0x28')]=_[_0xd298('0x27')](_0x20e81a[_0xd298('0x28')]);_0x5700b5[_0xd298('0x29')]=_[_0xd298('0x2a')](_0x5700b5[_0xd298('0x2b')],_0x5700b5[_0xd298('0x28')]);_0x24c0e6[_0xd298('0x2c')]=_[_0xd298('0x2a')](_0x5700b5['model'],qs[_0xd298('0x3e')](_0x20e81a[_0xd298('0x28')][_0xd298('0x3e')]));_0x24c0e6[_0xd298('0x2c')]=_0x24c0e6[_0xd298('0x2c')][_0xd298('0x2d')]?_0x24c0e6[_0xd298('0x2c')]:_0x5700b5[_0xd298('0x2b')];if(_0x20e81a['query']['includeAll']){_0x24c0e6[_0xd298('0x3a')]=[{'all':!![]}];}_0x24c0e6=_[_0xd298('0x34')]({},_0x24c0e6,_0x20e81a[_0xd298('0x38')]);return db[_0xd298('0x26')][_0xd298('0x3f')](_0x24c0e6)[_0xd298('0x20')](handleEntityNotFound(_0x26db6e,null))[_0xd298('0x20')](respondWithResult(_0x26db6e,null))[_0xd298('0x40')](handleError(_0x26db6e,null));};exports['download']=function(_0x903e44,_0x1cebc9,_0x50b863){return db['Sound'][_0xd298('0x3f')]({'where':{'id':_0x903e44[_0xd298('0x3d')]['id']},'attributes':['name','save_name',_0xd298('0x41')],'raw':!![]})[_0xd298('0x20')](handleEntityNotFound(_0x1cebc9,null))[_0xd298('0x20')](function(_0x255497){if(_0x255497){if(!fs[_0xd298('0x42')](path[_0xd298('0x43')](config[_0xd298('0x44')],_0xd298('0x45'),_0x255497[_0xd298('0x46')]+'.'+_0x255497['converted_format']))){throw new db[(_0xd298('0x47'))][(_0xd298('0x48'))]('Sound\x20not\x20found');}return _0x1cebc9[_0xd298('0x49')](path[_0xd298('0x43')](config[_0xd298('0x44')],_0xd298('0x45'),util['format']('%s.%s',_0x255497['save_name'],_0x255497[_0xd298('0x41')])),util['format']('%s.%s',_0x255497[_0xd298('0x4a')],_0x255497[_0xd298('0x41')]));}return null;})[_0xd298('0x40')](handleError(_0x1cebc9,null));};exports['create']=function(_0x5cbae6,_0x5234a6,_0x2f5db8){var _0xd1335c={'name':path['basename'](_0x5cbae6[_0xd298('0x4b')]['originalname'],path['extname'](_0x5cbae6['file']['originalname'])),'save_name':path[_0xd298('0x4c')](_0x5cbae6[_0xd298('0x4b')][_0xd298('0x4d')],path[_0xd298('0x4e')](_0x5cbae6[_0xd298('0x4b')][_0xd298('0x4d')])),'original_format':path['extname'](_0x5cbae6[_0xd298('0x4b')][_0xd298('0x4f')])[_0xd298('0x50')](0x1),'converted_format':'wav'};var _0x20ef61=path[_0xd298('0x43')](config[_0xd298('0x44')],_0xd298('0x51'),_0x5cbae6['file'][_0xd298('0x4d')]);var _0xf69b12=path[_0xd298('0x43')](config['root'],_0xd298('0x45'),util[_0xd298('0x52')](_0xd298('0x53'),path[_0xd298('0x4c')](_0x5cbae6[_0xd298('0x4b')][_0xd298('0x4d')],path[_0xd298('0x4e')](_0x5cbae6[_0xd298('0x4b')][_0xd298('0x4d')])),_0xd1335c[_0xd298('0x41')]));logger[_0xd298('0x54')](_0xd298('0x55'),_0x20ef61);logger['info'](_0xd298('0x56'),_0xf69b12);try{fs['chmodSync'](_0x20ef61,parseInt(_0xd298('0x57'),0x8));var _0x334988=sox['transcode'](_0x20ef61,_0xf69b12,{'sampleRate':0x1f40,'format':_0xd298('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x334988['on'](_0xd298('0x24'),function(_0x56b6a8){fs[_0xd298('0x59')](_0x20ef61);_0x5234a6[_0xd298('0x16')](0x1f4)['send'](_0x56b6a8);});_0x334988['on'](_0xd298('0x5a'),function(_0x50186b){_0xd1335c['original_duration']=isNaN(_0x50186b[_0xd298('0x5b')])?null:_0x50186b[_0xd298('0x5b')]*0x3e8;_0xd1335c[_0xd298('0x5c')]=isNaN(_0x50186b[_0xd298('0x5d')])?null:_0x50186b[_0xd298('0x5d')];_0xd1335c[_0xd298('0x5e')]=isNaN(_0x50186b[_0xd298('0x5f')])?null:_0x50186b[_0xd298('0x5f')];_0xd1335c[_0xd298('0x60')]=isNaN(_0x50186b[_0xd298('0x61')])?null:_0x50186b[_0xd298('0x61')];_0xd1335c[_0xd298('0x62')]=isNaN(_0x50186b[_0xd298('0x63')])?null:_0x50186b[_0xd298('0x63')];});_0x334988['on'](_0xd298('0x64'),function(_0x5ae430){_0xd1335c[_0xd298('0x65')]=isNaN(_0x5ae430['duration'])?null:_0x5ae430[_0xd298('0x5b')]*0x3e8;_0xd1335c[_0xd298('0x66')]=isNaN(_0x5ae430[_0xd298('0x5d')])?null:_0x5ae430[_0xd298('0x5d')];_0xd1335c[_0xd298('0x67')]=isNaN(_0x5ae430[_0xd298('0x5f')])?null:_0x5ae430['channelCount'];_0xd1335c[_0xd298('0x68')]=isNaN(_0x5ae430['bitRate'])?null:_0x5ae430[_0xd298('0x61')];_0xd1335c[_0xd298('0x69')]=isNaN(_0x5ae430[_0xd298('0x63')])?null:_0x5ae430[_0xd298('0x63')];});_0x334988['on'](_0xd298('0x17'),function(){fs['chmodSync'](_0xf69b12,parseInt(_0xd298('0x57'),0x8));return db[_0xd298('0x26')][_0xd298('0x6a')](_0xd1335c)[_0xd298('0x20')](function(_0x31faa9){var _0x39fc7b={'role':_0x5cbae6[_0xd298('0x6b')][_0xd298('0x6c')],'userProfileId':_0x5cbae6[_0xd298('0x6b')][_0xd298('0x6d')]};if(!_0x39fc7b)throw new Error(_0xd298('0x6e'));if(_0x39fc7b[_0xd298('0x6c')]===_0xd298('0x6f')){var _0x1813df=_0x31faa9[_0xd298('0x21')]({'plain':!![]});return db[_0xd298('0x70')]['find']({'where':{'name':_0xd298('0x22'),'userProfileId':_0x39fc7b[_0xd298('0x6d')]},'raw':!![]})[_0xd298('0x20')](function(_0x131fc9){if(_0x131fc9&&_0x131fc9[_0xd298('0x71')]===0x0){return db[_0xd298('0x72')][_0xd298('0x6a')]({'name':_0x1813df[_0xd298('0x4a')],'resourceId':_0x1813df['id'],'type':_0x131fc9['name'],'sectionId':_0x131fc9['id']},{})[_0xd298('0x20')](function(){return _0x31faa9;});}else{return _0x31faa9;}})[_0xd298('0x40')](function(_0x554f7e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x554f7e);throw _0x554f7e;});}return _0x31faa9;})['then'](respondWithResult(_0x5234a6,null))[_0xd298('0x40')](handleError(_0x5234a6,null));});_0x334988[_0xd298('0x73')]();}catch(_0x4920e8){_0x5234a6['status'](0x1f4)[_0xd298('0x25')](_0x4920e8);}};exports[_0xd298('0x1f')]=function(_0x5e23cf,_0x5ea0ba,_0x51b5f1){return db[_0xd298('0x26')][_0xd298('0x3f')]({'where':{'id':_0x5e23cf[_0xd298('0x3d')]['id']}})[_0xd298('0x20')](handleEntityNotFound(_0x5ea0ba,null))['then'](saveUpdates(_[_0xd298('0x32')](_0x5e23cf[_0xd298('0x6b')],[_0xd298('0x4a'),'description']),null))[_0xd298('0x20')](respondWithResult(_0x5ea0ba,null))[_0xd298('0x40')](handleError(_0x5ea0ba,null));};exports[_0xd298('0x74')]=function(_0x2bda91,_0x84618a,_0x155cbc){return db['Sound'][_0xd298('0x3f')]({'where':{'id':_0x2bda91[_0xd298('0x3d')]['id']}})[_0xd298('0x20')](function(_0x31a4c5){if(_0x31a4c5){return _0x31a4c5[_0xd298('0x23')]();}})['then'](function(_0x25994c){var _0x3625ee=path[_0xd298('0x43')](config[_0xd298('0x44')],'server/files/sounds/original',util[_0xd298('0x52')]('%s.%s',_0x25994c[_0xd298('0x46')],_0x25994c[_0xd298('0x75')]));var _0x358735=path[_0xd298('0x43')](config[_0xd298('0x44')],'server/files/sounds/converted',util[_0xd298('0x52')](_0xd298('0x53'),_0x25994c[_0xd298('0x46')],_0x25994c[_0xd298('0x41')]));fs[_0xd298('0x59')](_0x3625ee);fs[_0xd298('0x59')](_0x358735);return _0x25994c;})[_0xd298('0x20')](function(_0x57ebc6){if(_0x57ebc6){return _0x84618a[_0xd298('0x16')](0xcc)['end']();}})[_0xd298('0x20')](handleEntityNotFound(_0x84618a,null))[_0xd298('0x40')](handleError(_0x84618a,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a30aae3..9e5ac4f 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 _0x8b55=['./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x270d40,_0x42b960){var _0x327bb3=function(_0x4e0522){while(--_0x4e0522){_0x270d40['push'](_0x270d40['shift']());}};_0x327bb3(++_0x42b960);}(_0x8b55,0x13d));var _0x58b5=function(_0x53f73b,_0x40fdb2){_0x53f73b=_0x53f73b-0x0;var _0x1c4266=_0x8b55[_0x53f73b];return _0x1c4266;};'use strict';var _=require('lodash');var util=require(_0x58b5('0x0'));var logger=require(_0x58b5('0x1'))('api');var moment=require(_0x58b5('0x2'));var BPromise=require(_0x58b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58b5('0x4'));var rimraf=require(_0x58b5('0x5'));var config=require(_0x58b5('0x6'));var attributes=require(_0x58b5('0x7'));module[_0x58b5('0x8')]=function(_0x42de95,_0x50bff7){return _0x42de95[_0x58b5('0x9')](_0x58b5('0xa'),attributes,{'tableName':_0x58b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf08=['lodash','util','../../config/logger','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x3dcfef,_0x236adb){var _0x5c27c9=function(_0x608e2f){while(--_0x608e2f){_0x3dcfef['push'](_0x3dcfef['shift']());}};_0x5c27c9(++_0x236adb);}(_0xaf08,0x8f));var _0x8af0=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0xaf08[_0x1fcaf1];return _0x55f464;};'use strict';var _=require(_0x8af0('0x0'));var util=require(_0x8af0('0x1'));var logger=require(_0x8af0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8af0('0x3'));var fs=require('fs');var path=require(_0x8af0('0x4'));var rimraf=require(_0x8af0('0x5'));var config=require('../../config/environment');var attributes=require(_0x8af0('0x6'));module[_0x8af0('0x7')]=function(_0x182203,_0x4783e0){return _0x182203[_0x8af0('0x8')](_0x8af0('0x9'),attributes,{'tableName':_0x8af0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index cb4f7a1..2526ba1 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 _0xa9e0=['then','stringify','ShowSound','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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['ShowSound']=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,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowSound',_0x459eb1);logger[_0x0a9e('0xd')]('ShowSound',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x3e85a0,_0x28c9a1){var _0x4497e5=function(_0x2f0609){while(--_0x2f0609){_0x3e85a0['push'](_0x3e85a0['shift']());}};_0x4497e5(++_0x28c9a1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a9c2db1..668f468 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 _0xa788=['./squareMessage.controller','get','/:id','post','put','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x532dd8,_0x47c36b){var _0x57fb41=function(_0x11c441){while(--_0x11c441){_0x532dd8['push'](_0x532dd8['shift']());}};_0x57fb41(++_0x47c36b);}(_0xa788,0x70));var _0x8a78=function(_0x414c98,_0x100cab){_0x414c98=_0x414c98-0x0;var _0x1e8d20=_0xa788[_0x414c98];return _0x1e8d20;};'use strict';var multer=require(_0x8a78('0x0'));var util=require(_0x8a78('0x1'));var path=require(_0x8a78('0x2'));var timeout=require(_0x8a78('0x3'));var express=require('express');var router=express[_0x8a78('0x4')]();var auth=require(_0x8a78('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a78('0x6'));var controller=require(_0x8a78('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8a78('0x8')](_0x8a78('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8a78('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8a78('0xb')](_0x8a78('0x9'),auth['isAuthenticated'](),controller[_0x8a78('0xc')]);router[_0x8a78('0xd')](_0x8a78('0x9'),auth[_0x8a78('0xe')](),controller[_0x8a78('0xf')]);module[_0x8a78('0x10')]=router; \ No newline at end of file +var _0x6f7a=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','create','put','exports','multer','util'];(function(_0x258dd9,_0x2af38d){var _0x8536d1=function(_0x347ad4){while(--_0x347ad4){_0x258dd9['push'](_0x258dd9['shift']());}};_0x8536d1(++_0x2af38d);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x299173,_0x2ac8f9){_0x299173=_0x299173-0x0;var _0x2e2b8c=_0x6f7a[_0x299173];return _0x2e2b8c;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var auth=require(_0xa6f7('0x5'));var interaction=require(_0xa6f7('0x6'));var config=require(_0xa6f7('0x7'));var controller=require(_0xa6f7('0x8'));router[_0xa6f7('0x9')]('/',auth[_0xa6f7('0xa')](),controller[_0xa6f7('0xb')]);router[_0xa6f7('0x9')](_0xa6f7('0xc'),auth[_0xa6f7('0xa')](),controller['show']);router['post']('/',auth[_0xa6f7('0xa')](),controller[_0xa6f7('0xd')]);router[_0xa6f7('0xe')](_0xa6f7('0xc'),auth[_0xa6f7('0xa')](),controller['update']);router['delete'](_0xa6f7('0xc'),auth[_0xa6f7('0xa')](),controller['destroy']);module[_0xa6f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c1fe21b..d7d43a3 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 _0xe9c5=['out','sequelize','exports','STRING'];(function(_0x5037e3,_0x69a547){var _0x517d59=function(_0x21d029){while(--_0x21d029){_0x5037e3['push'](_0x5037e3['shift']());}};_0x517d59(++_0x69a547);}(_0xe9c5,0x191));var _0x5e9c=function(_0xb2377a,_0x3af676){_0xb2377a=_0xb2377a-0x0;var _0x4e39e3=_0xe9c5[_0xb2377a];return _0x4e39e3;};'use strict';var Sequelize=require(_0x5e9c('0x0'));module[_0x5e9c('0x1')]={'uniqueid':{'type':Sequelize[_0x5e9c('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5e9c('0x3')),'defaultValue':_0x5e9c('0x3'),'allowNull':![]}}; \ No newline at end of file +var _0x6079=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6079,0x149));var _0x9607=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x6079[_0x5519a9];return _0x32f2cc;};'use strict';var Sequelize=require(_0x9607('0x0'));module[_0x9607('0x1')]={'uniqueid':{'type':Sequelize[_0x9607('0x2')]},'body':{'type':Sequelize[_0x9607('0x3')](_0x9607('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x9607('0x5')]('in',_0x9607('0x6')),'defaultValue':_0x9607('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 9b99326..e368a98 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 _0xe284=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','SquareMessage','findAll','rows','catch','params','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3cacdc,_0x18f792){var _0x46daa4=function(_0x4c9923){while(--_0x4c9923){_0x3cacdc['push'](_0x3cacdc['shift']());}};_0x46daa4(++_0x18f792);}(_0xe284,0x1c8));var _0x4e28=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0xe284[_0x1778e1];return _0x2bc4c6;};'use strict';var pdf=require(_0x4e28('0x0'));var emlformat=require(_0x4e28('0x1'));var rimraf=require(_0x4e28('0x2'));var zipdir=require(_0x4e28('0x3'));var jsonpatch=require(_0x4e28('0x4'));var rp=require(_0x4e28('0x5'));var moment=require(_0x4e28('0x6'));var BPromise=require(_0x4e28('0x7'));var Mustache=require('mustache');var util=require(_0x4e28('0x8'));var path=require(_0x4e28('0x9'));var sox=require(_0x4e28('0xa'));var csv=require(_0x4e28('0xb'));var ejs=require(_0x4e28('0xc'));var fs=require('fs');var _=require(_0x4e28('0xd'));var squel=require(_0x4e28('0xe'));var crypto=require(_0x4e28('0xf'));var jsforce=require(_0x4e28('0x10'));var deskjs=require(_0x4e28('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4e28('0x12'));var Papa=require(_0x4e28('0x13'));var Redis=require(_0x4e28('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4e28('0x15'));var hardwareService=require(_0x4e28('0x16'));var logger=require(_0x4e28('0x17'))(_0x4e28('0x18'));var utils=require(_0x4e28('0x19'));var config=require(_0x4e28('0x1a'));var db=require(_0x4e28('0x1b'))['db'];function respondWithStatusCode(_0x142400,_0x1320d5){_0x1320d5=_0x1320d5||0xcc;return function(_0x5a3775){if(_0x5a3775){return _0x142400[_0x4e28('0x1c')](_0x1320d5);}return _0x142400[_0x4e28('0x1d')](_0x1320d5)[_0x4e28('0x1e')]();};}function respondWithResult(_0x261661,_0x388732){_0x388732=_0x388732||0xc8;return function(_0x1384e3){if(_0x1384e3){return _0x261661[_0x4e28('0x1d')](_0x388732)[_0x4e28('0x1f')](_0x1384e3);}};}function respondWithFilteredResult(_0x15fef3,_0x4479a3){return function(_0x168d65){if(_0x168d65){var _0x39fad5=_0x168d65[_0x4e28('0x20')],_0x2dc87a=_0x4479a3[_0x4e28('0x21')],_0xfa59b4=_0x4479a3[_0x4e28('0x21')]+_0x4479a3[_0x4e28('0x22')],_0x4f442f;if(_0xfa59b4>=_0x39fad5){_0xfa59b4=_0x39fad5;_0x4f442f=0xc8;}else{_0x4f442f=0xce;}_0x15fef3[_0x4e28('0x1d')](_0x4f442f);return _0x15fef3[_0x4e28('0x23')]('Content-Range',_0x2dc87a+'-'+_0xfa59b4+'/'+_0x39fad5)[_0x4e28('0x1f')](_0x168d65);}return null;};}function patchUpdates(_0x583111){return function(_0x2ad9ef){try{jsonpatch['apply'](_0x2ad9ef,_0x583111,!![]);}catch(_0x25d33a){return BPromise[_0x4e28('0x24')](_0x25d33a);}return _0x2ad9ef[_0x4e28('0x25')]();};}function saveUpdates(_0x3f3b2d,_0x1a60b5){return function(_0x3f617e){if(_0x3f617e){return _0x3f617e[_0x4e28('0x26')](_0x3f3b2d)['then'](function(_0x2f5819){return _0x2f5819;});}return null;};}function removeEntity(_0x496b9f,_0x4435e9){return function(_0x1c1a56){if(_0x1c1a56){return _0x1c1a56['destroy']()[_0x4e28('0x27')](function(){_0x496b9f[_0x4e28('0x1d')](0xcc)[_0x4e28('0x1e')]();});}};}function handleEntityNotFound(_0x415a84,_0x20313b){return function(_0x5315c4){if(!_0x5315c4){_0x415a84[_0x4e28('0x1c')](0x194);}return _0x5315c4;};}function handleError(_0x19f42e,_0xb79d51){_0xb79d51=_0xb79d51||0x1f4;return function(_0x4d594a){logger[_0x4e28('0x28')](_0x4d594a[_0x4e28('0x29')]);if(_0x4d594a[_0x4e28('0x2a')]){delete _0x4d594a[_0x4e28('0x2a')];}_0x19f42e[_0x4e28('0x1d')](_0xb79d51)[_0x4e28('0x2b')](_0x4d594a);};}exports[_0x4e28('0x2c')]=function(_0x367fd5,_0x5506a5){var _0x25f1a1={},_0x47a3b2={},_0x247e63={'count':0x0,'rows':[]};var _0x1555af=db['SquareMessage'][_0x4e28('0x2d')];_0x47a3b2[_0x4e28('0x2e')]=_['keys'](_0x1555af);_0x47a3b2[_0x4e28('0x2f')]=_[_0x4e28('0x30')](_0x367fd5['query']);_0x47a3b2[_0x4e28('0x31')]=_[_0x4e28('0x32')](_0x47a3b2[_0x4e28('0x2e')],_0x47a3b2['query']);_0x25f1a1[_0x4e28('0x33')]=_[_0x4e28('0x32')](_0x47a3b2[_0x4e28('0x2e')],qs[_0x4e28('0x34')](_0x367fd5[_0x4e28('0x2f')][_0x4e28('0x34')]));_0x25f1a1[_0x4e28('0x33')]=_0x25f1a1[_0x4e28('0x33')][_0x4e28('0x35')]?_0x25f1a1['attributes']:_0x47a3b2[_0x4e28('0x2e')];if(!_0x367fd5[_0x4e28('0x2f')][_0x4e28('0x36')](_0x4e28('0x37'))){_0x25f1a1[_0x4e28('0x22')]=qs[_0x4e28('0x22')](_0x367fd5[_0x4e28('0x2f')][_0x4e28('0x22')]);_0x25f1a1[_0x4e28('0x21')]=qs[_0x4e28('0x21')](_0x367fd5[_0x4e28('0x2f')][_0x4e28('0x21')]);}_0x25f1a1[_0x4e28('0x38')]=qs[_0x4e28('0x39')](_0x367fd5[_0x4e28('0x2f')]['sort']);_0x25f1a1[_0x4e28('0x3a')]=qs[_0x4e28('0x31')](_[_0x4e28('0x3b')](_0x367fd5[_0x4e28('0x2f')],_0x47a3b2[_0x4e28('0x31')]));if(_0x367fd5['query'][_0x4e28('0x3c')]){_0x25f1a1[_0x4e28('0x3a')]=_['merge'](_0x25f1a1[_0x4e28('0x3a')],{'$or':_[_0x4e28('0x3d')](_0x1555af,function(_0x5e6aea){if(_0x5e6aea[_0x4e28('0x3e')][_0x4e28('0x3f')]!==_0x4e28('0x40')){var _0x1ec914={};_0x1ec914[_0x5e6aea[_0x4e28('0x41')]]={'$like':'%'+_0x367fd5[_0x4e28('0x2f')][_0x4e28('0x3c')]+'%'};return _0x1ec914;}})});}_0x25f1a1=_[_0x4e28('0x42')]({},_0x25f1a1,_0x367fd5[_0x4e28('0x43')]);var _0x2f3b42={'where':_0x25f1a1[_0x4e28('0x3a')]};return db['SquareMessage'][_0x4e28('0x20')](_0x2f3b42)['then'](function(_0x29760d){_0x247e63[_0x4e28('0x20')]=_0x29760d;if(_0x367fd5[_0x4e28('0x2f')][_0x4e28('0x44')]){_0x25f1a1[_0x4e28('0x45')]=[{'all':!![]}];}return db[_0x4e28('0x46')][_0x4e28('0x47')](_0x25f1a1);})['then'](function(_0x3cd195){_0x247e63[_0x4e28('0x48')]=_0x3cd195;return _0x247e63;})['then'](respondWithFilteredResult(_0x5506a5,_0x25f1a1))[_0x4e28('0x49')](handleError(_0x5506a5,null));};exports['show']=function(_0x3bde5b,_0x2c9b05){var _0x473a41={'raw':!![],'where':{'id':_0x3bde5b[_0x4e28('0x4a')]['id']}},_0x311c85={};_0x311c85[_0x4e28('0x2e')]=_[_0x4e28('0x30')](db[_0x4e28('0x46')][_0x4e28('0x2d')]);_0x311c85[_0x4e28('0x2f')]=_[_0x4e28('0x30')](_0x3bde5b[_0x4e28('0x2f')]);_0x311c85[_0x4e28('0x31')]=_[_0x4e28('0x32')](_0x311c85[_0x4e28('0x2e')],_0x311c85[_0x4e28('0x2f')]);_0x473a41['attributes']=_[_0x4e28('0x32')](_0x311c85[_0x4e28('0x2e')],qs[_0x4e28('0x34')](_0x3bde5b[_0x4e28('0x2f')][_0x4e28('0x34')]));_0x473a41['attributes']=_0x473a41[_0x4e28('0x33')][_0x4e28('0x35')]?_0x473a41[_0x4e28('0x33')]:_0x311c85['model'];if(_0x3bde5b[_0x4e28('0x2f')][_0x4e28('0x44')]){_0x473a41[_0x4e28('0x45')]=[{'all':!![]}];}_0x473a41=_[_0x4e28('0x42')]({},_0x473a41,_0x3bde5b['options']);return db[_0x4e28('0x46')]['find'](_0x473a41)[_0x4e28('0x27')](handleEntityNotFound(_0x2c9b05,null))[_0x4e28('0x27')](respondWithResult(_0x2c9b05,null))[_0x4e28('0x49')](handleError(_0x2c9b05,null));};exports[_0x4e28('0x4b')]=function(_0xb650bc,_0x36e68a){return db[_0x4e28('0x46')][_0x4e28('0x4b')](_0xb650bc[_0x4e28('0x4c')],{})[_0x4e28('0x27')](respondWithResult(_0x36e68a,0xc9))[_0x4e28('0x49')](handleError(_0x36e68a,null));};exports['update']=function(_0x28f5de,_0x267596){if(_0x28f5de[_0x4e28('0x4c')]['id']){delete _0x28f5de[_0x4e28('0x4c')]['id'];}return db['SquareMessage'][_0x4e28('0x4d')]({'where':{'id':_0x28f5de[_0x4e28('0x4a')]['id']}})['then'](handleEntityNotFound(_0x267596,null))[_0x4e28('0x27')](saveUpdates(_0x28f5de['body'],null))[_0x4e28('0x27')](respondWithResult(_0x267596,null))[_0x4e28('0x49')](handleError(_0x267596,null));};exports[_0x4e28('0x4e')]=function(_0x2a178f,_0x5264a3){return db[_0x4e28('0x46')][_0x4e28('0x4d')]({'where':{'id':_0x2a178f[_0x4e28('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5264a3,null))[_0x4e28('0x27')](removeEntity(_0x5264a3,null))[_0x4e28('0x49')](handleError(_0x5264a3,null));}; \ No newline at end of file +var _0x552c=['name','send','index','SquareMessage','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','map','key','field','merge','options','count','include','rows','catch','show','params','rawAttributes','length','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','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','status','json','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x1bfa18,_0x3f5042){var _0x3fe812=function(_0x104cac){while(--_0x104cac){_0x1bfa18['push'](_0x1bfa18['shift']());}};_0x3fe812(++_0x3f5042);}(_0x552c,0x66));var _0xc552=function(_0x4e84d5,_0x8d87fe){_0x4e84d5=_0x4e84d5-0x0;var _0x4b1852=_0x552c[_0x4e84d5];return _0x4b1852;};'use strict';var pdf=require(_0xc552('0x0'));var emlformat=require(_0xc552('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc552('0x2'));var rp=require(_0xc552('0x3'));var moment=require(_0xc552('0x4'));var BPromise=require(_0xc552('0x5'));var Mustache=require(_0xc552('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc552('0x7'));var csv=require(_0xc552('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc552('0x9'));var squel=require(_0xc552('0xa'));var crypto=require(_0xc552('0xb'));var jsforce=require(_0xc552('0xc'));var deskjs=require(_0xc552('0xd'));var toCsv=require(_0xc552('0x8'));var querystring=require(_0xc552('0xe'));var Papa=require(_0xc552('0xf'));var Redis=require(_0xc552('0x10'));var authService=require(_0xc552('0x11'));var qs=require(_0xc552('0x12'));var hardwareService=require(_0xc552('0x13'));var logger=require(_0xc552('0x14'))(_0xc552('0x15'));var utils=require(_0xc552('0x16'));var config=require(_0xc552('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b8968,_0x1874e7){_0x1874e7=_0x1874e7||0xcc;return function(_0x1ae384){if(_0x1ae384){return _0x1b8968['sendStatus'](_0x1874e7);}return _0x1b8968[_0xc552('0x18')](_0x1874e7)['end']();};}function respondWithResult(_0x4d7cbc,_0x437012){_0x437012=_0x437012||0xc8;return function(_0xe96461){if(_0xe96461){return _0x4d7cbc[_0xc552('0x18')](_0x437012)[_0xc552('0x19')](_0xe96461);}};}function respondWithFilteredResult(_0x4e11c3,_0x3cdfd4){return function(_0x3eb9b6){if(_0x3eb9b6){var _0xd19966=_0x3eb9b6['count'],_0x48d30a=_0x3cdfd4['offset'],_0x15e6c7=_0x3cdfd4[_0xc552('0x1a')]+_0x3cdfd4[_0xc552('0x1b')],_0x4d4c93;if(_0x15e6c7>=_0xd19966){_0x15e6c7=_0xd19966;_0x4d4c93=0xc8;}else{_0x4d4c93=0xce;}_0x4e11c3[_0xc552('0x18')](_0x4d4c93);return _0x4e11c3[_0xc552('0x1c')]('Content-Range',_0x48d30a+'-'+_0x15e6c7+'/'+_0xd19966)[_0xc552('0x19')](_0x3eb9b6);}return null;};}function patchUpdates(_0x1fbfa9){return function(_0x52f050){try{jsonpatch[_0xc552('0x1d')](_0x52f050,_0x1fbfa9,!![]);}catch(_0x51ebd6){return BPromise[_0xc552('0x1e')](_0x51ebd6);}return _0x52f050[_0xc552('0x1f')]();};}function saveUpdates(_0xc4d0f3,_0x50cbfe){return function(_0xffe0e8){if(_0xffe0e8){return _0xffe0e8[_0xc552('0x20')](_0xc4d0f3)[_0xc552('0x21')](function(_0x34eb18){return _0x34eb18;});}return null;};}function removeEntity(_0x2bbe4b,_0x203e9d){return function(_0x4138ee){if(_0x4138ee){return _0x4138ee[_0xc552('0x22')]()['then'](function(){_0x2bbe4b[_0xc552('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f853f,_0x51fb8f){return function(_0x21e491){if(!_0x21e491){_0x3f853f[_0xc552('0x23')](0x194);}return _0x21e491;};}function handleError(_0x2d53cf,_0x24efd3){_0x24efd3=_0x24efd3||0x1f4;return function(_0x5047f5){logger[_0xc552('0x24')](_0x5047f5[_0xc552('0x25')]);if(_0x5047f5['name']){delete _0x5047f5[_0xc552('0x26')];}_0x2d53cf[_0xc552('0x18')](_0x24efd3)[_0xc552('0x27')](_0x5047f5);};}exports[_0xc552('0x28')]=function(_0xb85b16,_0x421c00){var _0xb8e2f8={},_0x57cb93={},_0x5a706c={'count':0x0,'rows':[]};var _0x4508d5=db[_0xc552('0x29')]['rawAttributes'];_0x57cb93[_0xc552('0x2a')]=_['keys'](_0x4508d5);_0x57cb93[_0xc552('0x2b')]=_[_0xc552('0x2c')](_0xb85b16['query']);_0x57cb93[_0xc552('0x2d')]=_[_0xc552('0x2e')](_0x57cb93[_0xc552('0x2a')],_0x57cb93[_0xc552('0x2b')]);_0xb8e2f8[_0xc552('0x2f')]=_[_0xc552('0x2e')](_0x57cb93['model'],qs[_0xc552('0x30')](_0xb85b16[_0xc552('0x2b')][_0xc552('0x30')]));_0xb8e2f8[_0xc552('0x2f')]=_0xb8e2f8['attributes']['length']?_0xb8e2f8['attributes']:_0x57cb93[_0xc552('0x2a')];if(!_0xb85b16[_0xc552('0x2b')]['hasOwnProperty'](_0xc552('0x31'))){_0xb8e2f8[_0xc552('0x1b')]=qs['limit'](_0xb85b16[_0xc552('0x2b')][_0xc552('0x1b')]);_0xb8e2f8[_0xc552('0x1a')]=qs['offset'](_0xb85b16[_0xc552('0x2b')][_0xc552('0x1a')]);}_0xb8e2f8[_0xc552('0x32')]=qs[_0xc552('0x33')](_0xb85b16[_0xc552('0x2b')]['sort']);_0xb8e2f8[_0xc552('0x34')]=qs[_0xc552('0x2d')](_['pick'](_0xb85b16[_0xc552('0x2b')],_0x57cb93['filters']));if(_0xb85b16['query'][_0xc552('0x35')]){_0xb8e2f8[_0xc552('0x34')]=_['merge'](_0xb8e2f8[_0xc552('0x34')],{'$or':_[_0xc552('0x36')](_0x4508d5,function(_0x5a7ff1){if(_0x5a7ff1['type'][_0xc552('0x37')]!=='VIRTUAL'){var _0x248cb7={};_0x248cb7[_0x5a7ff1[_0xc552('0x38')]]={'$like':'%'+_0xb85b16[_0xc552('0x2b')][_0xc552('0x35')]+'%'};return _0x248cb7;}})});}_0xb8e2f8=_[_0xc552('0x39')]({},_0xb8e2f8,_0xb85b16[_0xc552('0x3a')]);var _0xd54521={'where':_0xb8e2f8[_0xc552('0x34')]};return db['SquareMessage'][_0xc552('0x3b')](_0xd54521)[_0xc552('0x21')](function(_0x26a20c){_0x5a706c['count']=_0x26a20c;if(_0xb85b16['query']['includeAll']){_0xb8e2f8[_0xc552('0x3c')]=[{'all':!![]}];}return db[_0xc552('0x29')]['findAll'](_0xb8e2f8);})[_0xc552('0x21')](function(_0x220863){_0x5a706c[_0xc552('0x3d')]=_0x220863;return _0x5a706c;})['then'](respondWithFilteredResult(_0x421c00,_0xb8e2f8))[_0xc552('0x3e')](handleError(_0x421c00,null));};exports[_0xc552('0x3f')]=function(_0x3e8eae,_0x229795){var _0x2a4783={'raw':!![],'where':{'id':_0x3e8eae[_0xc552('0x40')]['id']}},_0x2fad6a={};_0x2fad6a['model']=_[_0xc552('0x2c')](db[_0xc552('0x29')][_0xc552('0x41')]);_0x2fad6a['query']=_[_0xc552('0x2c')](_0x3e8eae[_0xc552('0x2b')]);_0x2fad6a['filters']=_['intersection'](_0x2fad6a[_0xc552('0x2a')],_0x2fad6a[_0xc552('0x2b')]);_0x2a4783[_0xc552('0x2f')]=_[_0xc552('0x2e')](_0x2fad6a['model'],qs[_0xc552('0x30')](_0x3e8eae[_0xc552('0x2b')][_0xc552('0x30')]));_0x2a4783[_0xc552('0x2f')]=_0x2a4783['attributes'][_0xc552('0x42')]?_0x2a4783[_0xc552('0x2f')]:_0x2fad6a['model'];if(_0x3e8eae[_0xc552('0x2b')]['includeAll']){_0x2a4783[_0xc552('0x3c')]=[{'all':!![]}];}_0x2a4783=_[_0xc552('0x39')]({},_0x2a4783,_0x3e8eae[_0xc552('0x3a')]);return db[_0xc552('0x29')][_0xc552('0x43')](_0x2a4783)['then'](handleEntityNotFound(_0x229795,null))[_0xc552('0x21')](respondWithResult(_0x229795,null))[_0xc552('0x3e')](handleError(_0x229795,null));};exports[_0xc552('0x44')]=function(_0x1d8383,_0x521b7a){return db[_0xc552('0x29')][_0xc552('0x44')](_0x1d8383[_0xc552('0x45')],{})[_0xc552('0x21')](respondWithResult(_0x521b7a,0xc9))['catch'](handleError(_0x521b7a,null));};exports['update']=function(_0x2d1ab7,_0x6998ab){if(_0x2d1ab7[_0xc552('0x45')]['id']){delete _0x2d1ab7[_0xc552('0x45')]['id'];}return db[_0xc552('0x29')][_0xc552('0x43')]({'where':{'id':_0x2d1ab7[_0xc552('0x40')]['id']}})[_0xc552('0x21')](handleEntityNotFound(_0x6998ab,null))[_0xc552('0x21')](saveUpdates(_0x2d1ab7['body'],null))[_0xc552('0x21')](respondWithResult(_0x6998ab,null))[_0xc552('0x3e')](handleError(_0x6998ab,null));};exports[_0xc552('0x22')]=function(_0x2b3ace,_0x682da6){return db['SquareMessage'][_0xc552('0x43')]({'where':{'id':_0x2b3ace[_0xc552('0x40')]['id']}})[_0xc552('0x21')](handleEntityNotFound(_0x682da6,null))[_0xc552('0x21')](removeEntity(_0x682da6,null))[_0xc552('0x3e')](handleError(_0x682da6,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 020c4bc..702340c 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 _0xf8e5=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util'];(function(_0x599a33,_0x5a002e){var _0x512182=function(_0x25edf9){while(--_0x25edf9){_0x599a33['push'](_0x599a33['shift']());}};_0x512182(++_0x5a002e);}(_0xf8e5,0xc1));var _0x5f8e=function(_0x1464db,_0x570000){_0x1464db=_0x1464db-0x0;var _0x31f03e=_0xf8e5[_0x1464db];return _0x31f03e;};'use strict';var _=require(_0x5f8e('0x0'));var util=require(_0x5f8e('0x1'));var logger=require(_0x5f8e('0x2'))(_0x5f8e('0x3'));var moment=require(_0x5f8e('0x4'));var BPromise=require('bluebird');var rp=require(_0x5f8e('0x5'));var fs=require('fs');var path=require(_0x5f8e('0x6'));var rimraf=require(_0x5f8e('0x7'));var config=require(_0x5f8e('0x8'));var attributes=require(_0x5f8e('0x9'));module[_0x5f8e('0xa')]=function(_0x11ea82,_0x22eef5){return _0x11ea82['define'](_0x5f8e('0xb'),attributes,{'tableName':_0x5f8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfac1=['exports','define','SquareMessage','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0xfac1,0xed));var _0x1fac=function(_0x58b5f9,_0x10a310){_0x58b5f9=_0x58b5f9-0x0;var _0x40f816=_0xfac1[_0x58b5f9];return _0x40f816;};'use strict';var _=require(_0x1fac('0x0'));var util=require(_0x1fac('0x1'));var logger=require(_0x1fac('0x2'))('api');var moment=require(_0x1fac('0x3'));var BPromise=require(_0x1fac('0x4'));var rp=require(_0x1fac('0x5'));var fs=require('fs');var path=require(_0x1fac('0x6'));var rimraf=require(_0x1fac('0x7'));var config=require(_0x1fac('0x8'));var attributes=require(_0x1fac('0x9'));module[_0x1fac('0xa')]=function(_0x97d014,_0x16024){return _0x97d014[_0x1fac('0xb')](_0x1fac('0xc'),attributes,{'tableName':'square_messages','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 86f8796..1c15d0d 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 _0x4b4c=['rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSquareMessage','SquareMessage','create','body','options','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x11d684,_0x4d4123){var _0x78a301=function(_0x1a1966){while(--_0x1a1966){_0x11d684['push'](_0x11d684['shift']());}};_0x78a301(++_0x4d4123);}(_0x4b4c,0x6c));var _0xc4b4=function(_0x1242b7,_0x7113bd){_0x1242b7=_0x1242b7-0x0;var _0x5a2f98=_0x4b4c[_0x1242b7];return _0x5a2f98;};'use strict';var _=require(_0xc4b4('0x0'));var util=require(_0xc4b4('0x1'));var moment=require(_0xc4b4('0x2'));var BPromise=require(_0xc4b4('0x3'));var rs=require(_0xc4b4('0x4'));var fs=require('fs');var Redis=require(_0xc4b4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4b4('0x6'));var logger=require(_0xc4b4('0x7'))(_0xc4b4('0x8'));var config=require(_0xc4b4('0x9'));var jayson=require(_0xc4b4('0xa'));var client=jayson[_0xc4b4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e17b6,_0x643008,_0x4c20e4){return new BPromise(function(_0x2e12fd,_0x3046b6){return client[_0xc4b4('0xc')](_0x3e17b6,_0x4c20e4)[_0xc4b4('0xd')](function(_0x472f90){logger[_0xc4b4('0xe')](_0xc4b4('0xf'),_0x643008,_0xc4b4('0x10'));logger[_0xc4b4('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x643008,_0xc4b4('0x10'),JSON[_0xc4b4('0x12')](_0x472f90));if(_0x472f90[_0xc4b4('0x13')]){if(_0x472f90[_0xc4b4('0x13')][_0xc4b4('0x14')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x643008,_0x472f90['error'][_0xc4b4('0x15')]);return _0x3046b6(_0x472f90[_0xc4b4('0x13')][_0xc4b4('0x15')]);}logger[_0xc4b4('0x13')](_0xc4b4('0xf'),_0x643008,_0x472f90['error'][_0xc4b4('0x15')]);return _0x2e12fd(_0x472f90[_0xc4b4('0x13')][_0xc4b4('0x15')]);}else{logger[_0xc4b4('0xe')](_0xc4b4('0xf'),_0x643008,_0xc4b4('0x10'));_0x2e12fd(_0x472f90[_0xc4b4('0x16')][_0xc4b4('0x15')]);}})['catch'](function(_0x44e38f){logger[_0xc4b4('0x13')]('SquareMessage,\x20%s,\x20%s',_0x643008,_0x44e38f);_0x3046b6(_0x44e38f);});});}exports[_0xc4b4('0x17')]=function(_0x5af69d){var _0x5f50d4=this;return new Promise(function(_0x4a953f,_0x57633a){return db[_0xc4b4('0x18')][_0xc4b4('0x19')](_0x5af69d[_0xc4b4('0x1a')],{'raw':_0x5af69d[_0xc4b4('0x1b')]?_0x5af69d[_0xc4b4('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xc4b4('0xd')](function(_0x14757b){logger[_0xc4b4('0xe')](_0xc4b4('0x17'),_0x5af69d);logger[_0xc4b4('0x11')]('CreateSquareMessage',_0x5af69d,JSON['stringify'](_0x14757b));_0x4a953f(_0x14757b);})[_0xc4b4('0x1c')](function(_0x477762){logger[_0xc4b4('0x13')](_0xc4b4('0x17'),_0x477762['message'],_0x5af69d);_0x57633a(_0x5f50d4[_0xc4b4('0x13')](0x1f4,_0x477762[_0xc4b4('0x15')]));});});}; \ No newline at end of file +var _0x8afd=['SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSquareMessage','SquareMessage','body','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','SquareMessage,\x20%s,\x20%s'];(function(_0x221303,_0x42c2b0){var _0x413428=function(_0x58f5db){while(--_0x58f5db){_0x221303['push'](_0x221303['shift']());}};_0x413428(++_0x42c2b0);}(_0x8afd,0x11f));var _0xd8af=function(_0x107a48,_0x2d6559){_0x107a48=_0x107a48-0x0;var _0xbf90c0=_0x8afd[_0x107a48];return _0xbf90c0;};'use strict';var _=require('lodash');var util=require(_0xd8af('0x0'));var moment=require(_0xd8af('0x1'));var BPromise=require(_0xd8af('0x2'));var rs=require(_0xd8af('0x3'));var fs=require('fs');var Redis=require(_0xd8af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8af('0x5'));var logger=require(_0xd8af('0x6'))(_0xd8af('0x7'));var config=require(_0xd8af('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd8af('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331bb3,_0x11ddee,_0x1a3599){return new BPromise(function(_0x343d11,_0x42c6b1){return client[_0xd8af('0xa')](_0x331bb3,_0x1a3599)[_0xd8af('0xb')](function(_0x371380){logger['info'](_0xd8af('0xc'),_0x11ddee,'request\x20sent');logger['debug'](_0xd8af('0xd'),_0x11ddee,_0xd8af('0xe'),JSON['stringify'](_0x371380));if(_0x371380[_0xd8af('0xf')]){if(_0x371380[_0xd8af('0xf')][_0xd8af('0x10')]===0x1f4){logger[_0xd8af('0xf')](_0xd8af('0xc'),_0x11ddee,_0x371380[_0xd8af('0xf')]['message']);return _0x42c6b1(_0x371380[_0xd8af('0xf')][_0xd8af('0x11')]);}logger['error'](_0xd8af('0xc'),_0x11ddee,_0x371380['error']['message']);return _0x343d11(_0x371380[_0xd8af('0xf')]['message']);}else{logger['info'](_0xd8af('0xc'),_0x11ddee,_0xd8af('0xe'));_0x343d11(_0x371380['result']['message']);}})[_0xd8af('0x12')](function(_0xb4a481){logger['error'](_0xd8af('0xc'),_0x11ddee,_0xb4a481);_0x42c6b1(_0xb4a481);});});}exports[_0xd8af('0x13')]=function(_0x332cb3){var _0xf2874=this;return new Promise(function(_0x3cf2cb,_0x2cef23){return db[_0xd8af('0x14')]['create'](_0x332cb3[_0xd8af('0x15')],{'raw':_0x332cb3[_0xd8af('0x16')]?_0x332cb3['options'][_0xd8af('0x17')]===undefined?!![]:![]:!![]})[_0xd8af('0xb')](function(_0x633620){logger['info'](_0xd8af('0x13'),_0x332cb3);logger[_0xd8af('0x18')](_0xd8af('0x13'),_0x332cb3,JSON['stringify'](_0x633620));_0x3cf2cb(_0x633620);})['catch'](function(_0xd81fe3){logger['error'](_0xd8af('0x13'),_0xd81fe3[_0xd8af('0x11')],_0x332cb3);_0x2cef23(_0xf2874[_0xd8af('0xf')](0x1f4,_0xd81fe3[_0xd8af('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 3552697..98f6d06 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 _0xc524=['get','/:id','/:id/test','15s','test','create','put','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x2de93c,_0x35c822){var _0x29cd34=function(_0x1e2f93){while(--_0x1e2f93){_0x2de93c['push'](_0x2de93c['shift']());}};_0x29cd34(++_0x35c822);}(_0xc524,0x1bf));var _0x4c52=function(_0x33712e,_0xed092){_0x33712e=_0x33712e-0x0;var _0x58ff6a=_0xc524[_0x33712e];return _0x58ff6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4c52('0x0'));var timeout=require(_0x4c52('0x1'));var express=require(_0x4c52('0x2'));var router=express[_0x4c52('0x3')]();var auth=require(_0x4c52('0x4'));var interaction=require(_0x4c52('0x5'));var config=require(_0x4c52('0x6'));var controller=require('./squareOdbc.controller');router['get']('/',auth[_0x4c52('0x7')](),controller[_0x4c52('0x8')]);router[_0x4c52('0x9')](_0x4c52('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4c52('0x9')](_0x4c52('0xb'),auth['isAuthenticated'](),timeout(_0x4c52('0xc')),controller[_0x4c52('0xd')]);router['post']('/',auth[_0x4c52('0x7')](),controller[_0x4c52('0xe')]);router[_0x4c52('0xf')](_0x4c52('0xa'),auth[_0x4c52('0x7')](),controller[_0x4c52('0x10')]);router[_0x4c52('0x11')](_0x4c52('0xa'),auth[_0x4c52('0x7')](),controller['destroy']);module[_0x4c52('0x12')]=router; \ No newline at end of file +var _0x0531=['15s','post','create','update','destroy','exports','multer','util','express','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test'];(function(_0x9487e8,_0x38e499){var _0x2012cc=function(_0x5341c1){while(--_0x5341c1){_0x9487e8['push'](_0x9487e8['shift']());}};_0x2012cc(++_0x38e499);}(_0x0531,0xde));var _0x1053=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x0531[_0x385eb1];return _0x5d40eb;};'use strict';var multer=require(_0x1053('0x0'));var util=require(_0x1053('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1053('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1053('0x3'));var config=require(_0x1053('0x4'));var controller=require(_0x1053('0x5'));router[_0x1053('0x6')]('/',auth[_0x1053('0x7')](),controller[_0x1053('0x8')]);router[_0x1053('0x6')](_0x1053('0x9'),auth[_0x1053('0x7')](),controller[_0x1053('0xa')]);router['get'](_0x1053('0xb'),auth[_0x1053('0x7')](),timeout(_0x1053('0xc')),controller['test']);router[_0x1053('0xd')]('/',auth[_0x1053('0x7')](),controller[_0x1053('0xe')]);router['put']('/:id',auth[_0x1053('0x7')](),controller[_0x1053('0xf')]);router['delete'](_0x1053('0x9'),auth[_0x1053('0x7')](),controller[_0x1053('0x10')]);module[_0x1053('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 3ba1929..637080a 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 _0xc4da=['STRING','sequelize','exports','name'];(function(_0x32db0a,_0x3c285c){var _0x28e089=function(_0xb5d251){while(--_0xb5d251){_0x32db0a['push'](_0x32db0a['shift']());}};_0x28e089(++_0x3c285c);}(_0xc4da,0x91));var _0xac4d=function(_0x410ce7,_0x9e3095){_0x410ce7=_0x410ce7-0x0;var _0xee25ec=_0xc4da[_0x410ce7];return _0xee25ec;};'use strict';var Sequelize=require(_0xac4d('0x0'));module[_0xac4d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xac4d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xac4d('0x3')]},'description':{'type':Sequelize[_0xac4d('0x3')]}}; \ No newline at end of file +var _0x0014=['exports','name','STRING','sequelize'];(function(_0x283ad9,_0xdafb86){var _0x670816=function(_0x455136){while(--_0x455136){_0x283ad9['push'](_0x283ad9['shift']());}};_0x670816(++_0xdafb86);}(_0x0014,0x1db));var _0x4001=function(_0x3a72f4,_0x23f6cb){_0x3a72f4=_0x3a72f4-0x0;var _0x4e354b=_0x0014[_0x3a72f4];return _0x4e354b;};'use strict';var Sequelize=require(_0x4001('0x0'));module[_0x4001('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4001('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x4001('0x3')]},'description':{'type':Sequelize[_0x4001('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e1ca744..03e5fa7 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 _0x3243=['path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','error','name','send','index','SquareOdbc','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','field','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','openSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x3243,0x154));var _0x3324=function(_0x3e4a46,_0x301d96){_0x3e4a46=_0x3e4a46-0x0;var _0x54742f=_0x3243[_0x3e4a46];return _0x54742f;};'use strict';var pdf=require(_0x3324('0x0'));var emlformat=require(_0x3324('0x1'));var rimraf=require(_0x3324('0x2'));var zipdir=require(_0x3324('0x3'));var jsonpatch=require(_0x3324('0x4'));var rp=require(_0x3324('0x5'));var moment=require('moment');var BPromise=require(_0x3324('0x6'));var Mustache=require('mustache');var util=require(_0x3324('0x7'));var path=require(_0x3324('0x8'));var sox=require(_0x3324('0x9'));var csv=require(_0x3324('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3324('0xb'));var crypto=require(_0x3324('0xc'));var jsforce=require(_0x3324('0xd'));var deskjs=require(_0x3324('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3324('0xf'));var Papa=require(_0x3324('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3324('0x11'));var hardwareService=require(_0x3324('0x12'));var logger=require(_0x3324('0x13'))(_0x3324('0x14'));var utils=require(_0x3324('0x15'));var config=require(_0x3324('0x16'));var db=require(_0x3324('0x17'))['db'];function respondWithStatusCode(_0x149657,_0x22f9ba){_0x22f9ba=_0x22f9ba||0xcc;return function(_0x4b1488){if(_0x4b1488){return _0x149657[_0x3324('0x18')](_0x22f9ba);}return _0x149657[_0x3324('0x19')](_0x22f9ba)[_0x3324('0x1a')]();};}function respondWithResult(_0x42a129,_0x48bf73){_0x48bf73=_0x48bf73||0xc8;return function(_0x3e0186){if(_0x3e0186){return _0x42a129[_0x3324('0x19')](_0x48bf73)[_0x3324('0x1b')](_0x3e0186);}};}function respondWithFilteredResult(_0x4aa5fb,_0x5960ea){return function(_0xc0210e){if(_0xc0210e){var _0x49f7ab=_0xc0210e[_0x3324('0x1c')],_0x605458=_0x5960ea[_0x3324('0x1d')],_0x593294=_0x5960ea[_0x3324('0x1d')]+_0x5960ea[_0x3324('0x1e')],_0x30afa9;if(_0x593294>=_0x49f7ab){_0x593294=_0x49f7ab;_0x30afa9=0xc8;}else{_0x30afa9=0xce;}_0x4aa5fb[_0x3324('0x19')](_0x30afa9);return _0x4aa5fb[_0x3324('0x1f')](_0x3324('0x20'),_0x605458+'-'+_0x593294+'/'+_0x49f7ab)[_0x3324('0x1b')](_0xc0210e);}return null;};}function patchUpdates(_0x20c128){return function(_0x418e95){try{jsonpatch[_0x3324('0x21')](_0x418e95,_0x20c128,!![]);}catch(_0x33495a){return BPromise[_0x3324('0x22')](_0x33495a);}return _0x418e95[_0x3324('0x23')]();};}function saveUpdates(_0x1aea1e,_0x32dcce){return function(_0x2bf1ab){if(_0x2bf1ab){return _0x2bf1ab['update'](_0x1aea1e)[_0x3324('0x24')](function(_0xadc28){return _0xadc28;});}return null;};}function removeEntity(_0x2a79f9,_0x5b2f10){return function(_0x2ab5ed){if(_0x2ab5ed){return _0x2ab5ed['destroy']()[_0x3324('0x24')](function(){var _0x2c33fd=_0x2ab5ed[_0x3324('0x25')]({'plain':!![]});var _0x4a9997=_0x3324('0x26');return db[_0x3324('0x27')][_0x3324('0x28')]({'where':{'type':_0x4a9997,'resourceId':_0x2c33fd['id']}})['then'](function(){return _0x2ab5ed;});})[_0x3324('0x24')](function(){_0x2a79f9[_0x3324('0x19')](0xcc)[_0x3324('0x1a')]();});}};}function handleEntityNotFound(_0x58e530,_0x544d42){return function(_0x4cdb29){if(!_0x4cdb29){_0x58e530[_0x3324('0x18')](0x194);}return _0x4cdb29;};}function handleError(_0x44fa07,_0x19c086){_0x19c086=_0x19c086||0x1f4;return function(_0x11c26b){logger[_0x3324('0x29')](_0x11c26b['stack']);if(_0x11c26b[_0x3324('0x2a')]){delete _0x11c26b[_0x3324('0x2a')];}_0x44fa07[_0x3324('0x19')](_0x19c086)[_0x3324('0x2b')](_0x11c26b);};}exports[_0x3324('0x2c')]=function(_0x4f3c8e,_0x4baa16){var _0x1e1ed2={},_0x21325d={},_0x1670e8={'count':0x0,'rows':[]};var _0x1c205d=db[_0x3324('0x2d')][_0x3324('0x2e')];_0x21325d[_0x3324('0x2f')]=_[_0x3324('0x30')](_0x1c205d);_0x21325d[_0x3324('0x31')]=_['keys'](_0x4f3c8e[_0x3324('0x31')]);_0x21325d[_0x3324('0x32')]=_[_0x3324('0x33')](_0x21325d['model'],_0x21325d[_0x3324('0x31')]);_0x1e1ed2[_0x3324('0x34')]=_['intersection'](_0x21325d[_0x3324('0x2f')],qs[_0x3324('0x35')](_0x4f3c8e[_0x3324('0x31')]['fields']));_0x1e1ed2['attributes']=_0x1e1ed2[_0x3324('0x34')][_0x3324('0x36')]?_0x1e1ed2['attributes']:_0x21325d[_0x3324('0x2f')];if(!_0x4f3c8e[_0x3324('0x31')][_0x3324('0x37')](_0x3324('0x38'))){_0x1e1ed2[_0x3324('0x1e')]=qs[_0x3324('0x1e')](_0x4f3c8e[_0x3324('0x31')][_0x3324('0x1e')]);_0x1e1ed2[_0x3324('0x1d')]=qs['offset'](_0x4f3c8e[_0x3324('0x31')][_0x3324('0x1d')]);}_0x1e1ed2[_0x3324('0x39')]=qs[_0x3324('0x3a')](_0x4f3c8e[_0x3324('0x31')][_0x3324('0x3a')]);_0x1e1ed2[_0x3324('0x3b')]=qs[_0x3324('0x32')](_[_0x3324('0x3c')](_0x4f3c8e[_0x3324('0x31')],_0x21325d[_0x3324('0x32')]));if(_0x4f3c8e[_0x3324('0x31')]['filter']){_0x1e1ed2[_0x3324('0x3b')]=_['merge'](_0x1e1ed2[_0x3324('0x3b')],{'$or':_[_0x3324('0x3d')](_0x1c205d,function(_0x17d93d){if(_0x17d93d[_0x3324('0x3e')]['key']!=='VIRTUAL'){var _0x414f44={};_0x414f44[_0x17d93d[_0x3324('0x3f')]]={'$like':'%'+_0x4f3c8e[_0x3324('0x31')][_0x3324('0x40')]+'%'};return _0x414f44;}})});}_0x1e1ed2=_[_0x3324('0x41')]({},_0x1e1ed2,_0x4f3c8e[_0x3324('0x42')]);var _0x49535b={'where':_0x1e1ed2[_0x3324('0x3b')]};return db[_0x3324('0x2d')][_0x3324('0x1c')](_0x49535b)[_0x3324('0x24')](function(_0x20ddaa){_0x1670e8[_0x3324('0x1c')]=_0x20ddaa;if(_0x4f3c8e[_0x3324('0x31')][_0x3324('0x43')]){_0x1e1ed2[_0x3324('0x44')]=[{'all':!![]}];}return db[_0x3324('0x2d')][_0x3324('0x45')](_0x1e1ed2);})[_0x3324('0x24')](function(_0xa23594){_0x1670e8[_0x3324('0x46')]=_0xa23594;return _0x1670e8;})[_0x3324('0x24')](respondWithFilteredResult(_0x4baa16,_0x1e1ed2))[_0x3324('0x47')](handleError(_0x4baa16,null));};exports['show']=function(_0x38ec51,_0xb9e44e){var _0x1fec3b={'raw':!![],'where':{'id':_0x38ec51[_0x3324('0x48')]['id']}},_0x239e7f={};_0x239e7f[_0x3324('0x2f')]=_['keys'](db[_0x3324('0x2d')][_0x3324('0x2e')]);_0x239e7f[_0x3324('0x31')]=_[_0x3324('0x30')](_0x38ec51[_0x3324('0x31')]);_0x239e7f[_0x3324('0x32')]=_[_0x3324('0x33')](_0x239e7f[_0x3324('0x2f')],_0x239e7f[_0x3324('0x31')]);_0x1fec3b[_0x3324('0x34')]=_[_0x3324('0x33')](_0x239e7f[_0x3324('0x2f')],qs[_0x3324('0x35')](_0x38ec51['query'][_0x3324('0x35')]));_0x1fec3b[_0x3324('0x34')]=_0x1fec3b[_0x3324('0x34')][_0x3324('0x36')]?_0x1fec3b['attributes']:_0x239e7f['model'];if(_0x38ec51[_0x3324('0x31')][_0x3324('0x43')]){_0x1fec3b[_0x3324('0x44')]=[{'all':!![]}];}_0x1fec3b=_[_0x3324('0x41')]({},_0x1fec3b,_0x38ec51['options']);return db[_0x3324('0x2d')][_0x3324('0x49')](_0x1fec3b)[_0x3324('0x24')](handleEntityNotFound(_0xb9e44e,null))[_0x3324('0x24')](respondWithResult(_0xb9e44e,null))[_0x3324('0x47')](handleError(_0xb9e44e,null));};exports[_0x3324('0x4a')]=function(_0x1be9b1,_0x4c8cc5){return db['SquareOdbc'][_0x3324('0x4a')](_0x1be9b1[_0x3324('0x4b')],{})[_0x3324('0x24')](function(_0x4adc07){var _0xf3ab2c=_0x1be9b1[_0x3324('0x4c')][_0x3324('0x25')]({'plain':!![]});if(!_0xf3ab2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf3ab2c[_0x3324('0x4d')]==='user'){var _0x45bd25=_0x4adc07['get']({'plain':!![]});var _0x4f0d04=_0x3324('0x26');return db[_0x3324('0x4e')][_0x3324('0x49')]({'where':{'name':_0x4f0d04,'userProfileId':_0xf3ab2c[_0x3324('0x4f')]},'raw':!![]})[_0x3324('0x24')](function(_0x362494){if(_0x362494&&_0x362494[_0x3324('0x50')]===0x0){return db[_0x3324('0x27')][_0x3324('0x4a')]({'name':_0x45bd25['name'],'resourceId':_0x45bd25['id'],'type':_0x362494[_0x3324('0x2a')],'sectionId':_0x362494['id']},{})[_0x3324('0x24')](function(){return _0x4adc07;});}else{return _0x4adc07;}})[_0x3324('0x47')](function(_0x2c84a7){logger['error'](_0x3324('0x51'),_0x2c84a7);throw _0x2c84a7;});}return _0x4adc07;})['then'](respondWithResult(_0x4c8cc5,0xc9))[_0x3324('0x47')](handleError(_0x4c8cc5,null));};exports[_0x3324('0x52')]=function(_0x56904a,_0x34af3f){if(_0x56904a['body']['id']){delete _0x56904a['body']['id'];}return db[_0x3324('0x2d')][_0x3324('0x49')]({'where':{'id':_0x56904a[_0x3324('0x48')]['id']}})['then'](handleEntityNotFound(_0x34af3f,null))[_0x3324('0x24')](saveUpdates(_0x56904a[_0x3324('0x4b')],null))[_0x3324('0x24')](respondWithResult(_0x34af3f,null))['catch'](handleError(_0x34af3f,null));};exports[_0x3324('0x28')]=function(_0x3058d0,_0x3c9ddb){return db[_0x3324('0x2d')][_0x3324('0x49')]({'where':{'id':_0x3058d0['params']['id']}})[_0x3324('0x24')](handleEntityNotFound(_0x3c9ddb,null))[_0x3324('0x24')](removeEntity(_0x3c9ddb,null))[_0x3324('0x47')](handleError(_0x3c9ddb,null));};exports[_0x3324('0x53')]=function(_0x1b7c1c,_0x2e0b1b,_0xef9a33){var _0x1ba1da;return db[_0x3324('0x2d')][_0x3324('0x49')]({'where':{'id':_0x1b7c1c[_0x3324('0x48')]['id']},'attributes':['id',_0x3324('0x54')]})['then'](handleEntityNotFound(_0x2e0b1b,null))[_0x3324('0x24')](function(_0x503869){if(_0x503869){var _0x563851=require(_0x3324('0x55'))();_0x563851[_0x3324('0x56')](_0x503869[_0x3324('0x54')]);_0x563851['closeSync']();return _0x503869;}})['then'](respondWithResult(_0x2e0b1b,null))[_0x3324('0x47')](handleError(_0x2e0b1b,null));}; \ No newline at end of file +var _0xbbee=['util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','update','destroy','then','get','ODBC','UserProfileResource','stack','name','send','index','rawAttributes','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','SquareOdbc','includeAll','include','findAll','rows','catch','params','model','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','closeSync','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xbbee,0x194));var _0xebbe=function(_0x1f84c6,_0x646a88){_0x1f84c6=_0x1f84c6-0x0;var _0x9aad74=_0xbbee[_0x1f84c6];return _0x9aad74;};'use strict';var pdf=require(_0xebbe('0x0'));var emlformat=require(_0xebbe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xebbe('0x2'));var jsonpatch=require(_0xebbe('0x3'));var rp=require('request-promise');var moment=require(_0xebbe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xebbe('0x5'));var util=require(_0xebbe('0x6'));var path=require('path');var sox=require(_0xebbe('0x7'));var csv=require(_0xebbe('0x8'));var ejs=require(_0xebbe('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xebbe('0xa'));var crypto=require(_0xebbe('0xb'));var jsforce=require(_0xebbe('0xc'));var deskjs=require(_0xebbe('0xd'));var toCsv=require('to-csv');var querystring=require(_0xebbe('0xe'));var Papa=require('papaparse');var Redis=require(_0xebbe('0xf'));var authService=require(_0xebbe('0x10'));var qs=require(_0xebbe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebbe('0x12'))(_0xebbe('0x13'));var utils=require(_0xebbe('0x14'));var config=require(_0xebbe('0x15'));var db=require(_0xebbe('0x16'))['db'];function respondWithStatusCode(_0x3c915f,_0x5d4564){_0x5d4564=_0x5d4564||0xcc;return function(_0x8806c8){if(_0x8806c8){return _0x3c915f[_0xebbe('0x17')](_0x5d4564);}return _0x3c915f[_0xebbe('0x18')](_0x5d4564)[_0xebbe('0x19')]();};}function respondWithResult(_0xb025e0,_0x2cefd2){_0x2cefd2=_0x2cefd2||0xc8;return function(_0x2924d5){if(_0x2924d5){return _0xb025e0[_0xebbe('0x18')](_0x2cefd2)[_0xebbe('0x1a')](_0x2924d5);}};}function respondWithFilteredResult(_0xbf21a8,_0x4b2ad7){return function(_0x33c911){if(_0x33c911){var _0x36a081=_0x33c911[_0xebbe('0x1b')],_0x45aa0b=_0x4b2ad7[_0xebbe('0x1c')],_0x29dcf7=_0x4b2ad7[_0xebbe('0x1c')]+_0x4b2ad7['limit'],_0x251547;if(_0x29dcf7>=_0x36a081){_0x29dcf7=_0x36a081;_0x251547=0xc8;}else{_0x251547=0xce;}_0xbf21a8[_0xebbe('0x18')](_0x251547);return _0xbf21a8[_0xebbe('0x1d')](_0xebbe('0x1e'),_0x45aa0b+'-'+_0x29dcf7+'/'+_0x36a081)[_0xebbe('0x1a')](_0x33c911);}return null;};}function patchUpdates(_0x3bacbc){return function(_0x110beb){try{jsonpatch['apply'](_0x110beb,_0x3bacbc,!![]);}catch(_0x16d506){return BPromise['reject'](_0x16d506);}return _0x110beb['save']();};}function saveUpdates(_0x5c4f4b,_0x10b940){return function(_0x279348){if(_0x279348){return _0x279348[_0xebbe('0x1f')](_0x5c4f4b)['then'](function(_0x2d8f4d){return _0x2d8f4d;});}return null;};}function removeEntity(_0x2412dd,_0x2972ca){return function(_0x1059dd){if(_0x1059dd){return _0x1059dd[_0xebbe('0x20')]()[_0xebbe('0x21')](function(){var _0x4e8bc8=_0x1059dd[_0xebbe('0x22')]({'plain':!![]});var _0x4eedd3=_0xebbe('0x23');return db[_0xebbe('0x24')][_0xebbe('0x20')]({'where':{'type':_0x4eedd3,'resourceId':_0x4e8bc8['id']}})[_0xebbe('0x21')](function(){return _0x1059dd;});})['then'](function(){_0x2412dd['status'](0xcc)[_0xebbe('0x19')]();});}};}function handleEntityNotFound(_0x5a91cb,_0x683abe){return function(_0xc554d7){if(!_0xc554d7){_0x5a91cb[_0xebbe('0x17')](0x194);}return _0xc554d7;};}function handleError(_0x4cd03f,_0x1e2508){_0x1e2508=_0x1e2508||0x1f4;return function(_0x3919f2){logger['error'](_0x3919f2[_0xebbe('0x25')]);if(_0x3919f2[_0xebbe('0x26')]){delete _0x3919f2[_0xebbe('0x26')];}_0x4cd03f[_0xebbe('0x18')](_0x1e2508)[_0xebbe('0x27')](_0x3919f2);};}exports[_0xebbe('0x28')]=function(_0xb3ce74,_0x2deb8b){var _0x586069={},_0x3aec41={},_0x4c79af={'count':0x0,'rows':[]};var _0x34eab0=db['SquareOdbc'][_0xebbe('0x29')];_0x3aec41['model']=_['keys'](_0x34eab0);_0x3aec41[_0xebbe('0x2a')]=_[_0xebbe('0x2b')](_0xb3ce74[_0xebbe('0x2a')]);_0x3aec41[_0xebbe('0x2c')]=_[_0xebbe('0x2d')](_0x3aec41['model'],_0x3aec41[_0xebbe('0x2a')]);_0x586069['attributes']=_[_0xebbe('0x2d')](_0x3aec41['model'],qs[_0xebbe('0x2e')](_0xb3ce74[_0xebbe('0x2a')][_0xebbe('0x2e')]));_0x586069[_0xebbe('0x2f')]=_0x586069['attributes'][_0xebbe('0x30')]?_0x586069[_0xebbe('0x2f')]:_0x3aec41['model'];if(!_0xb3ce74['query'][_0xebbe('0x31')]('nolimit')){_0x586069[_0xebbe('0x32')]=qs[_0xebbe('0x32')](_0xb3ce74[_0xebbe('0x2a')][_0xebbe('0x32')]);_0x586069['offset']=qs['offset'](_0xb3ce74['query']['offset']);}_0x586069[_0xebbe('0x33')]=qs[_0xebbe('0x34')](_0xb3ce74[_0xebbe('0x2a')][_0xebbe('0x34')]);_0x586069[_0xebbe('0x35')]=qs[_0xebbe('0x2c')](_[_0xebbe('0x36')](_0xb3ce74[_0xebbe('0x2a')],_0x3aec41['filters']));if(_0xb3ce74['query'][_0xebbe('0x37')]){_0x586069[_0xebbe('0x35')]=_[_0xebbe('0x38')](_0x586069[_0xebbe('0x35')],{'$or':_[_0xebbe('0x39')](_0x34eab0,function(_0x440886){if(_0x440886['type'][_0xebbe('0x3a')]!==_0xebbe('0x3b')){var _0x50e7b6={};_0x50e7b6[_0x440886[_0xebbe('0x3c')]]={'$like':'%'+_0xb3ce74['query'][_0xebbe('0x37')]+'%'};return _0x50e7b6;}})});}_0x586069=_[_0xebbe('0x38')]({},_0x586069,_0xb3ce74['options']);var _0x7a5a67={'where':_0x586069['where']};return db[_0xebbe('0x3d')][_0xebbe('0x1b')](_0x7a5a67)['then'](function(_0x263d39){_0x4c79af[_0xebbe('0x1b')]=_0x263d39;if(_0xb3ce74[_0xebbe('0x2a')][_0xebbe('0x3e')]){_0x586069[_0xebbe('0x3f')]=[{'all':!![]}];}return db['SquareOdbc'][_0xebbe('0x40')](_0x586069);})[_0xebbe('0x21')](function(_0x4f71c3){_0x4c79af[_0xebbe('0x41')]=_0x4f71c3;return _0x4c79af;})[_0xebbe('0x21')](respondWithFilteredResult(_0x2deb8b,_0x586069))[_0xebbe('0x42')](handleError(_0x2deb8b,null));};exports['show']=function(_0xf78937,_0x481fa7){var _0x27ea5e={'raw':!![],'where':{'id':_0xf78937[_0xebbe('0x43')]['id']}},_0x399021={};_0x399021['model']=_[_0xebbe('0x2b')](db[_0xebbe('0x3d')][_0xebbe('0x29')]);_0x399021[_0xebbe('0x2a')]=_[_0xebbe('0x2b')](_0xf78937[_0xebbe('0x2a')]);_0x399021[_0xebbe('0x2c')]=_['intersection'](_0x399021[_0xebbe('0x44')],_0x399021[_0xebbe('0x2a')]);_0x27ea5e[_0xebbe('0x2f')]=_[_0xebbe('0x2d')](_0x399021['model'],qs['fields'](_0xf78937['query']['fields']));_0x27ea5e[_0xebbe('0x2f')]=_0x27ea5e[_0xebbe('0x2f')]['length']?_0x27ea5e[_0xebbe('0x2f')]:_0x399021[_0xebbe('0x44')];if(_0xf78937[_0xebbe('0x2a')][_0xebbe('0x3e')]){_0x27ea5e[_0xebbe('0x3f')]=[{'all':!![]}];}_0x27ea5e=_[_0xebbe('0x38')]({},_0x27ea5e,_0xf78937[_0xebbe('0x45')]);return db['SquareOdbc'][_0xebbe('0x46')](_0x27ea5e)[_0xebbe('0x21')](handleEntityNotFound(_0x481fa7,null))['then'](respondWithResult(_0x481fa7,null))['catch'](handleError(_0x481fa7,null));};exports['create']=function(_0x24907a,_0x1e3210){return db[_0xebbe('0x3d')][_0xebbe('0x47')](_0x24907a[_0xebbe('0x48')],{})[_0xebbe('0x21')](function(_0x4845a5){var _0x5763cb=_0x24907a[_0xebbe('0x49')][_0xebbe('0x22')]({'plain':!![]});if(!_0x5763cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5763cb[_0xebbe('0x4a')]===_0xebbe('0x49')){var _0xc984d9=_0x4845a5[_0xebbe('0x22')]({'plain':!![]});var _0x2ebfa6=_0xebbe('0x23');return db[_0xebbe('0x4b')][_0xebbe('0x46')]({'where':{'name':_0x2ebfa6,'userProfileId':_0x5763cb[_0xebbe('0x4c')]},'raw':!![]})[_0xebbe('0x21')](function(_0x27ab50){if(_0x27ab50&&_0x27ab50[_0xebbe('0x4d')]===0x0){return db[_0xebbe('0x24')][_0xebbe('0x47')]({'name':_0xc984d9[_0xebbe('0x26')],'resourceId':_0xc984d9['id'],'type':_0x27ab50[_0xebbe('0x26')],'sectionId':_0x27ab50['id']},{})[_0xebbe('0x21')](function(){return _0x4845a5;});}else{return _0x4845a5;}})['catch'](function(_0x139333){logger['error'](_0xebbe('0x4e'),_0x139333);throw _0x139333;});}return _0x4845a5;})[_0xebbe('0x21')](respondWithResult(_0x1e3210,0xc9))[_0xebbe('0x42')](handleError(_0x1e3210,null));};exports[_0xebbe('0x1f')]=function(_0x424852,_0xd30bbb){if(_0x424852[_0xebbe('0x48')]['id']){delete _0x424852[_0xebbe('0x48')]['id'];}return db[_0xebbe('0x3d')][_0xebbe('0x46')]({'where':{'id':_0x424852['params']['id']}})[_0xebbe('0x21')](handleEntityNotFound(_0xd30bbb,null))['then'](saveUpdates(_0x424852[_0xebbe('0x48')],null))[_0xebbe('0x21')](respondWithResult(_0xd30bbb,null))[_0xebbe('0x42')](handleError(_0xd30bbb,null));};exports[_0xebbe('0x20')]=function(_0x5267eb,_0x265fcd){return db[_0xebbe('0x3d')][_0xebbe('0x46')]({'where':{'id':_0x5267eb[_0xebbe('0x43')]['id']}})[_0xebbe('0x21')](handleEntityNotFound(_0x265fcd,null))[_0xebbe('0x21')](removeEntity(_0x265fcd,null))['catch'](handleError(_0x265fcd,null));};exports[_0xebbe('0x4f')]=function(_0xb58330,_0x2a1c6c,_0x45faf8){var _0x1a7fee;return db[_0xebbe('0x3d')][_0xebbe('0x46')]({'where':{'id':_0xb58330[_0xebbe('0x43')]['id']},'attributes':['id',_0xebbe('0x50')]})[_0xebbe('0x21')](handleEntityNotFound(_0x2a1c6c,null))[_0xebbe('0x21')](function(_0x988fc3){if(_0x988fc3){var _0x52caf3=require('odbc')();_0x52caf3['openSync'](_0x988fc3[_0xebbe('0x50')]);_0x52caf3[_0xebbe('0x51')]();return _0x988fc3;}})['then'](respondWithResult(_0x2a1c6c,null))[_0xebbe('0x42')](handleError(_0x2a1c6c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 60401d0..38fea3a 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 _0x9b1f=['SquareOdbc','square_odbc','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x1c78dd,_0x117d6e){var _0x927903=function(_0x464012){while(--_0x464012){_0x1c78dd['push'](_0x1c78dd['shift']());}};_0x927903(++_0x117d6e);}(_0x9b1f,0x77));var _0xf9b1=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x9b1f[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xf9b1('0x0'));var util=require(_0xf9b1('0x1'));var logger=require('../../config/logger')(_0xf9b1('0x2'));var moment=require(_0xf9b1('0x3'));var BPromise=require('bluebird');var rp=require(_0xf9b1('0x4'));var fs=require('fs');var path=require(_0xf9b1('0x5'));var rimraf=require(_0xf9b1('0x6'));var config=require(_0xf9b1('0x7'));var attributes=require(_0xf9b1('0x8'));module[_0xf9b1('0x9')]=function(_0xb40ee1,_0x4b6ffd){return _0xb40ee1[_0xf9b1('0xa')](_0xf9b1('0xb'),attributes,{'tableName':_0xf9b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb08e=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','square_odbc','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb08e,0x6c));var _0xeb08=function(_0x49dcee,_0x326efc){_0x49dcee=_0x49dcee-0x0;var _0x4d2af4=_0xb08e[_0x49dcee];return _0x4d2af4;};'use strict';var _=require(_0xeb08('0x0'));var util=require(_0xeb08('0x1'));var logger=require(_0xeb08('0x2'))(_0xeb08('0x3'));var moment=require(_0xeb08('0x4'));var BPromise=require('bluebird');var rp=require(_0xeb08('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb08('0x6'));var config=require(_0xeb08('0x7'));var attributes=require('./squareOdbc.attributes');module[_0xeb08('0x8')]=function(_0x5be019,_0x2477a3){return _0x5be019[_0xeb08('0x9')]('SquareOdbc',attributes,{'tableName':_0xeb08('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 3849719..3c0acd2 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 _0x5d24=['attributes','include','map','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareOdbc,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where'];(function(_0x3bc4d5,_0x179bc9){var _0x48147a=function(_0x5adcfb){while(--_0x5adcfb){_0x3bc4d5['push'](_0x3bc4d5['shift']());}};_0x48147a(++_0x179bc9);}(_0x5d24,0x9a));var _0x45d2=function(_0x3138a2,_0x812bd){_0x3138a2=_0x3138a2-0x0;var _0x3a8c5b=_0x5d24[_0x3138a2];return _0x3a8c5b;};'use strict';var _=require('lodash');var util=require(_0x45d2('0x0'));var moment=require('moment');var BPromise=require(_0x45d2('0x1'));var rs=require(_0x45d2('0x2'));var fs=require('fs');var Redis=require(_0x45d2('0x3'));var db=require(_0x45d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x45d2('0x5'))(_0x45d2('0x6'));var config=require(_0x45d2('0x7'));var jayson=require(_0x45d2('0x8'));var client=jayson[_0x45d2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58b07b,_0x829d08,_0x17a575){return new BPromise(function(_0x5191e7,_0x72763f){return client[_0x45d2('0xa')](_0x58b07b,_0x17a575)['then'](function(_0x3c3d03){logger[_0x45d2('0xb')](_0x45d2('0xc'),_0x829d08,'request\x20sent');logger[_0x45d2('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x829d08,_0x45d2('0xe'),JSON[_0x45d2('0xf')](_0x3c3d03));if(_0x3c3d03[_0x45d2('0x10')]){if(_0x3c3d03[_0x45d2('0x10')][_0x45d2('0x11')]===0x1f4){logger[_0x45d2('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x829d08,_0x3c3d03['error'][_0x45d2('0x12')]);return _0x72763f(_0x3c3d03[_0x45d2('0x10')][_0x45d2('0x12')]);}logger[_0x45d2('0x10')](_0x45d2('0xc'),_0x829d08,_0x3c3d03['error'][_0x45d2('0x12')]);return _0x5191e7(_0x3c3d03['error'][_0x45d2('0x12')]);}else{logger[_0x45d2('0xb')](_0x45d2('0xc'),_0x829d08,'request\x20sent');_0x5191e7(_0x3c3d03[_0x45d2('0x13')][_0x45d2('0x12')]);}})[_0x45d2('0x14')](function(_0x31ca4b){logger['error'](_0x45d2('0xc'),_0x829d08,_0x31ca4b);_0x72763f(_0x31ca4b);});});}exports[_0x45d2('0x15')]=function(_0x381c82){var _0x1c88c5=this;return new Promise(function(_0x478573,_0xaedcfd){return db[_0x45d2('0x16')]['find']({'raw':_0x381c82['options']?_0x381c82[_0x45d2('0x17')][_0x45d2('0x18')]===undefined?!![]:![]:!![],'where':_0x381c82[_0x45d2('0x17')]?_0x381c82['options'][_0x45d2('0x19')]||null:null,'attributes':_0x381c82[_0x45d2('0x17')]?_0x381c82[_0x45d2('0x17')][_0x45d2('0x1a')]||null:null,'include':_0x381c82[_0x45d2('0x17')]?_0x381c82[_0x45d2('0x17')][_0x45d2('0x1b')]?_[_0x45d2('0x1c')](_0x381c82[_0x45d2('0x17')][_0x45d2('0x1b')],function(_0x5e5004){return{'model':db[_0x5e5004[_0x45d2('0x1d')]],'as':_0x5e5004['as'],'attributes':_0x5e5004[_0x45d2('0x1a')],'include':_0x5e5004['include']?_[_0x45d2('0x1c')](_0x5e5004[_0x45d2('0x1b')],function(_0x56bb0e){return{'model':db[_0x56bb0e[_0x45d2('0x1d')]],'as':_0x56bb0e['as'],'attributes':_0x56bb0e[_0x45d2('0x1a')],'include':_0x56bb0e['include']?_['map'](_0x56bb0e['include'],function(_0x2b82ab){return{'model':db[_0x2b82ab[_0x45d2('0x1d')]],'as':_0x2b82ab['as'],'attributes':_0x2b82ab[_0x45d2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5eae14){logger['info'](_0x45d2('0x15'),_0x381c82);logger['debug'](_0x45d2('0x15'),_0x381c82,JSON[_0x45d2('0xf')](_0x5eae14));_0x478573(_0x5eae14);})[_0x45d2('0x14')](function(_0x2ebdb8){logger[_0x45d2('0x10')](_0x45d2('0x15'),_0x2ebdb8['message'],_0x381c82);_0xaedcfd(_0x1c88c5[_0x45d2('0x10')](0x1f4,_0x2ebdb8['message']));});});}; \ No newline at end of file +var _0x8dee=['then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','map','include','model','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x42a5fa,_0x20f303){var _0x4fcc25=function(_0x4e5e57){while(--_0x4e5e57){_0x42a5fa['push'](_0x42a5fa['shift']());}};_0x4fcc25(++_0x20f303);}(_0x8dee,0xb9));var _0xe8de=function(_0x55a219,_0xa8bed2){_0x55a219=_0x55a219-0x0;var _0x56cb21=_0x8dee[_0x55a219];return _0x56cb21;};'use strict';var _=require('lodash');var util=require(_0xe8de('0x0'));var moment=require(_0xe8de('0x1'));var BPromise=require(_0xe8de('0x2'));var rs=require(_0xe8de('0x3'));var fs=require('fs');var Redis=require(_0xe8de('0x4'));var db=require(_0xe8de('0x5'))['db'];var utils=require(_0xe8de('0x6'));var logger=require(_0xe8de('0x7'))('rpc');var config=require(_0xe8de('0x8'));var jayson=require(_0xe8de('0x9'));var client=jayson[_0xe8de('0xa')][_0xe8de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13ab9d,_0x5bd64d,_0x2db261){return new BPromise(function(_0x5c60af,_0x435b2a){return client[_0xe8de('0xc')](_0x13ab9d,_0x2db261)[_0xe8de('0xd')](function(_0xc64696){logger[_0xe8de('0xe')](_0xe8de('0xf'),_0x5bd64d,_0xe8de('0x10'));logger[_0xe8de('0x11')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x5bd64d,_0xe8de('0x10'),JSON[_0xe8de('0x12')](_0xc64696));if(_0xc64696[_0xe8de('0x13')]){if(_0xc64696['error'][_0xe8de('0x14')]===0x1f4){logger[_0xe8de('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x5bd64d,_0xc64696[_0xe8de('0x13')][_0xe8de('0x15')]);return _0x435b2a(_0xc64696[_0xe8de('0x13')]['message']);}logger['error'](_0xe8de('0xf'),_0x5bd64d,_0xc64696[_0xe8de('0x13')][_0xe8de('0x15')]);return _0x5c60af(_0xc64696[_0xe8de('0x13')][_0xe8de('0x15')]);}else{logger[_0xe8de('0xe')](_0xe8de('0xf'),_0x5bd64d,_0xe8de('0x10'));_0x5c60af(_0xc64696[_0xe8de('0x16')]['message']);}})['catch'](function(_0x41d8ca){logger[_0xe8de('0x13')](_0xe8de('0xf'),_0x5bd64d,_0x41d8ca);_0x435b2a(_0x41d8ca);});});}exports[_0xe8de('0x17')]=function(_0x5b25c1){var _0x457119=this;return new Promise(function(_0x5d35f1,_0x531470){return db[_0xe8de('0x18')][_0xe8de('0x19')]({'raw':_0x5b25c1[_0xe8de('0x1a')]?_0x5b25c1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b25c1[_0xe8de('0x1a')]?_0x5b25c1[_0xe8de('0x1a')][_0xe8de('0x1b')]||null:null,'attributes':_0x5b25c1[_0xe8de('0x1a')]?_0x5b25c1[_0xe8de('0x1a')][_0xe8de('0x1c')]||null:null,'include':_0x5b25c1['options']?_0x5b25c1[_0xe8de('0x1a')]['include']?_[_0xe8de('0x1d')](_0x5b25c1[_0xe8de('0x1a')][_0xe8de('0x1e')],function(_0x231da4){return{'model':db[_0x231da4[_0xe8de('0x1f')]],'as':_0x231da4['as'],'attributes':_0x231da4[_0xe8de('0x1c')],'include':_0x231da4[_0xe8de('0x1e')]?_[_0xe8de('0x1d')](_0x231da4[_0xe8de('0x1e')],function(_0x3b2e4c){return{'model':db[_0x3b2e4c['model']],'as':_0x3b2e4c['as'],'attributes':_0x3b2e4c[_0xe8de('0x1c')],'include':_0x3b2e4c['include']?_[_0xe8de('0x1d')](_0x3b2e4c[_0xe8de('0x1e')],function(_0x5b6d71){return{'model':db[_0x5b6d71[_0xe8de('0x1f')]],'as':_0x5b6d71['as'],'attributes':_0x5b6d71['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8de('0xd')](function(_0x5c527b){logger[_0xe8de('0xe')](_0xe8de('0x17'),_0x5b25c1);logger[_0xe8de('0x11')](_0xe8de('0x17'),_0x5b25c1,JSON[_0xe8de('0x12')](_0x5c527b));_0x5d35f1(_0x5c527b);})[_0xe8de('0x20')](function(_0xd03d4){logger[_0xe8de('0x13')](_0xe8de('0x17'),_0xd03d4[_0xe8de('0x15')],_0x5b25c1);_0x531470(_0x457119[_0xe8de('0x13')](0x1f4,_0xd03d4['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index ecd7904..90262c3 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 _0xa75d=['show','/:id/users','getUsers','create','post','addUsers','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','/:id'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xa75d,0xc7));var _0xda75=function(_0x2bf1b1,_0x2655b4){_0x2bf1b1=_0x2bf1b1-0x0;var _0x1ca4de=_0xa75d[_0x2bf1b1];return _0x1ca4de;};'use strict';var multer=require(_0xda75('0x0'));var util=require(_0xda75('0x1'));var path=require(_0xda75('0x2'));var timeout=require('connect-timeout');var express=require(_0xda75('0x3'));var router=express[_0xda75('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xda75('0x5'));var config=require(_0xda75('0x6'));var controller=require(_0xda75('0x7'));router['get']('/',auth[_0xda75('0x8')](),controller['index']);router[_0xda75('0x9')](_0xda75('0xa'),auth[_0xda75('0x8')](),controller[_0xda75('0xb')]);router[_0xda75('0x9')](_0xda75('0xc'),auth[_0xda75('0x8')](),controller[_0xda75('0xd')]);router['post']('/',auth[_0xda75('0x8')](),controller[_0xda75('0xe')]);router[_0xda75('0xf')](_0xda75('0xc'),auth[_0xda75('0x8')](),controller[_0xda75('0x10')]);router[_0xda75('0x11')](_0xda75('0xa'),auth[_0xda75('0x8')](),controller[_0xda75('0x12')]);router[_0xda75('0x13')](_0xda75('0xa'),auth[_0xda75('0x8')](),controller['destroy']);router[_0xda75('0x13')]('/:id/users',auth[_0xda75('0x8')](),controller['removeUsers']);module[_0xda75('0x14')]=router; \ No newline at end of file +var _0xf2ff=['../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','create','post','addUsers','put','update','delete','destroy','removeUsers','exports','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x47ba83,_0x2873f7){var _0x2d8e4c=function(_0x3c137e){while(--_0x3c137e){_0x47ba83['push'](_0x47ba83['shift']());}};_0x2d8e4c(++_0x2873f7);}(_0xf2ff,0x103));var _0xff2f=function(_0x212a46,_0x39f8e2){_0x212a46=_0x212a46-0x0;var _0x33dacc=_0xf2ff[_0x212a46];return _0x33dacc;};'use strict';var multer=require('multer');var util=require(_0xff2f('0x0'));var path=require(_0xff2f('0x1'));var timeout=require('connect-timeout');var express=require(_0xff2f('0x2'));var router=express['Router']();var auth=require(_0xff2f('0x3'));var interaction=require(_0xff2f('0x4'));var config=require(_0xff2f('0x5'));var controller=require(_0xff2f('0x6'));router[_0xff2f('0x7')]('/',auth[_0xff2f('0x8')](),controller[_0xff2f('0x9')]);router['get'](_0xff2f('0xa'),auth[_0xff2f('0x8')](),controller[_0xff2f('0xb')]);router[_0xff2f('0x7')](_0xff2f('0xc'),auth[_0xff2f('0x8')](),controller['getUsers']);router['post']('/',auth[_0xff2f('0x8')](),controller[_0xff2f('0xd')]);router[_0xff2f('0xe')](_0xff2f('0xc'),auth[_0xff2f('0x8')](),controller[_0xff2f('0xf')]);router[_0xff2f('0x10')]('/:id',auth[_0xff2f('0x8')](),controller[_0xff2f('0x11')]);router[_0xff2f('0x12')](_0xff2f('0xa'),auth['isAuthenticated'](),controller[_0xff2f('0x13')]);router[_0xff2f('0x12')](_0xff2f('0xc'),auth[_0xff2f('0x8')](),controller[_0xff2f('0x14')]);module[_0xff2f('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7edb994..a13e283 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 _0xa6b0=['exports','STRING','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','sequelize'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x35e8ea,_0x49b50c){_0x35e8ea=_0x35e8ea-0x0;var _0x1281b4=_0xa6b0[_0x35e8ea];return _0x1281b4;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0a6b('0x2')]},'notes':{'type':Sequelize[_0x0a6b('0x3')]},'preproduction':{'type':Sequelize[_0x0a6b('0x4')]('long'),'get':function(){if(this[_0x0a6b('0x5')](_0x0a6b('0x6'))){return this[_0x0a6b('0x5')](_0x0a6b('0x6'))[_0x0a6b('0x7')](_0x0a6b('0x8'));}}},'production':{'type':Sequelize[_0x0a6b('0x4')](_0x0a6b('0x9')),'get':function(){if(this[_0x0a6b('0x5')](_0x0a6b('0xa'))){return this[_0x0a6b('0x5')](_0x0a6b('0xa'))['toString']('utf8');}}}}; \ No newline at end of file +var _0xefce=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','exports','STRING'];(function(_0x347a26,_0x285e33){var _0x11a2a7=function(_0xa522e4){while(--_0xa522e4){_0x347a26['push'](_0x347a26['shift']());}};_0x11a2a7(++_0x285e33);}(_0xefce,0x1e8));var _0xeefc=function(_0x4d1d2c,_0x44f4d8){_0x4d1d2c=_0x4d1d2c-0x0;var _0x2c4cb9=_0xefce[_0x4d1d2c];return _0x2c4cb9;};'use strict';var Sequelize=require('sequelize');module[_0xeefc('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xeefc('0x1')]},'notes':{'type':Sequelize[_0xeefc('0x2')]},'preproduction':{'type':Sequelize[_0xeefc('0x3')](_0xeefc('0x4')),'get':function(){if(this[_0xeefc('0x5')](_0xeefc('0x6'))){return this[_0xeefc('0x5')](_0xeefc('0x6'))[_0xeefc('0x7')](_0xeefc('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xeefc('0x5')](_0xeefc('0x9'))){return this[_0xeefc('0x5')](_0xeefc('0x9'))['toString']('utf8');}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 771318e..5b2753f 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 _0x896e=['type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','name','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','pick','map','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','SquareProjects','UserProfileResource','error','stack','SquareProject','rawAttributes','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x896e,0x1e9));var _0xe896=function(_0x59cf5b,_0x4dece0){_0x59cf5b=_0x59cf5b-0x0;var _0x3bfd54=_0x896e[_0x59cf5b];return _0x3bfd54;};'use strict';var pdf=require(_0xe896('0x0'));var emlformat=require(_0xe896('0x1'));var rimraf=require(_0xe896('0x2'));var zipdir=require(_0xe896('0x3'));var jsonpatch=require(_0xe896('0x4'));var rp=require(_0xe896('0x5'));var moment=require(_0xe896('0x6'));var BPromise=require(_0xe896('0x7'));var Mustache=require(_0xe896('0x8'));var util=require(_0xe896('0x9'));var path=require(_0xe896('0xa'));var sox=require(_0xe896('0xb'));var csv=require('to-csv');var ejs=require(_0xe896('0xc'));var fs=require('fs');var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0x11'));var querystring=require(_0xe896('0x12'));var Papa=require(_0xe896('0x13'));var Redis=require('ioredis');var authService=require(_0xe896('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe896('0x15'));var logger=require('../../config/logger')(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require(_0xe896('0x18'));var db=require('../../mysqldb')['db'];config[_0xe896('0x19')]=_[_0xe896('0x1a')](config[_0xe896('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe896('0x1b'))(new Redis(config[_0xe896('0x19')]));require(_0xe896('0x1c'))['register'](socket);function respondWithStatusCode(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xcc;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['sendStatus'](_0x7dcf8a);}return _0x2d0e46['status'](_0x7dcf8a)[_0xe896('0x1d')]();};}function respondWithResult(_0x25606b,_0x51e7b7){_0x51e7b7=_0x51e7b7||0xc8;return function(_0x5e78d6){if(_0x5e78d6){return _0x25606b[_0xe896('0x1e')](_0x51e7b7)[_0xe896('0x1f')](_0x5e78d6);}};}function respondWithFilteredResult(_0x57f04b,_0x50d224){return function(_0x4e062a){if(_0x4e062a){var _0x41cbd7=_0x4e062a[_0xe896('0x20')],_0x32f86d=_0x50d224[_0xe896('0x21')],_0x2d4cf0=_0x50d224[_0xe896('0x21')]+_0x50d224[_0xe896('0x22')],_0x5dc89d;if(_0x2d4cf0>=_0x41cbd7){_0x2d4cf0=_0x41cbd7;_0x5dc89d=0xc8;}else{_0x5dc89d=0xce;}_0x57f04b[_0xe896('0x1e')](_0x5dc89d);return _0x57f04b[_0xe896('0x23')](_0xe896('0x24'),_0x32f86d+'-'+_0x2d4cf0+'/'+_0x41cbd7)[_0xe896('0x1f')](_0x4e062a);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x25')](_0x5d2c8d);}return _0x180d46[_0xe896('0x26')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x27')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x28')]()[_0xe896('0x29')](function(){var _0x4d9f03=_0x1e952a[_0xe896('0x2a')]({'plain':!![]});var _0x4b71cc=_0xe896('0x2b');return db[_0xe896('0x2c')][_0xe896('0x28')]({'where':{'type':_0x4b71cc,'resourceId':_0x4d9f03['id']}})['then'](function(){return _0x1e952a;});})[_0xe896('0x29')](function(){_0x45dd49[_0xe896('0x1e')](0xcc)[_0xe896('0x1d')]();});}};}function handleEntityNotFound(_0xe93aa0,_0x2d8a7b){return function(_0x3f8ceb){if(!_0x3f8ceb){_0xe93aa0['sendStatus'](0x194);}return _0x3f8ceb;};}function handleError(_0x10adad,_0x34ccfd){_0x34ccfd=_0x34ccfd||0x1f4;return function(_0x201653){logger[_0xe896('0x2d')](_0x201653[_0xe896('0x2e')]);if(_0x201653['name']){delete _0x201653['name'];}_0x10adad['status'](_0x34ccfd)['send'](_0x201653);};}exports['index']=function(_0x291290,_0x29a18e){var _0x10fd26={},_0x76c781={},_0x3cd88e={'count':0x0,'rows':[]};var _0x1a6090=db[_0xe896('0x2f')][_0xe896('0x30')];_0x76c781['model']=_['keys'](_0x1a6090);_0x76c781[_0xe896('0x31')]=_[_0xe896('0x32')](_0x291290[_0xe896('0x31')]);_0x76c781[_0xe896('0x33')]=_['intersection'](_0x76c781[_0xe896('0x34')],_0x76c781['query']);_0x10fd26['attributes']=_[_0xe896('0x35')](_0x76c781[_0xe896('0x34')],qs[_0xe896('0x36')](_0x291290['query']['fields']));_0x10fd26['attributes']=_0x10fd26[_0xe896('0x37')][_0xe896('0x38')]?_0x10fd26[_0xe896('0x37')]:_0x76c781[_0xe896('0x34')];if(!_0x291290[_0xe896('0x31')]['hasOwnProperty'](_0xe896('0x39'))){_0x10fd26[_0xe896('0x22')]=qs[_0xe896('0x22')](_0x291290[_0xe896('0x31')][_0xe896('0x22')]);_0x10fd26[_0xe896('0x21')]=qs[_0xe896('0x21')](_0x291290[_0xe896('0x31')]['offset']);}_0x10fd26[_0xe896('0x3a')]=qs[_0xe896('0x3b')](_0x291290['query'][_0xe896('0x3b')]);_0x10fd26['where']=qs[_0xe896('0x33')](_['pick'](_0x291290[_0xe896('0x31')],_0x76c781['filters']));if(_0x291290[_0xe896('0x31')][_0xe896('0x3c')]){_0x10fd26[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0x10fd26[_0xe896('0x3d')],{'$or':_['map'](_0x1a6090,function(_0x480b8a){if(_0x480b8a[_0xe896('0x3f')][_0xe896('0x40')]!==_0xe896('0x41')){var _0x15b6c5={};_0x15b6c5[_0x480b8a[_0xe896('0x42')]]={'$like':'%'+_0x291290['query']['filter']+'%'};return _0x15b6c5;}})});}_0x10fd26=_[_0xe896('0x3e')]({},_0x10fd26,_0x291290[_0xe896('0x43')]);var _0x5890b1={'where':_0x10fd26['where']};return db[_0xe896('0x2f')][_0xe896('0x20')](_0x5890b1)[_0xe896('0x29')](function(_0x2ab0ac){_0x3cd88e[_0xe896('0x20')]=_0x2ab0ac;if(_0x291290[_0xe896('0x31')][_0xe896('0x44')]){_0x10fd26[_0xe896('0x45')]=[{'all':!![]}];}return db[_0xe896('0x2f')][_0xe896('0x46')](_0x10fd26);})[_0xe896('0x29')](function(_0x1bc76a){_0x3cd88e['rows']=_0x1bc76a;return _0x3cd88e;})[_0xe896('0x29')](respondWithFilteredResult(_0x29a18e,_0x10fd26))[_0xe896('0x47')](handleError(_0x29a18e,null));};exports['show']=function(_0x57366b,_0x5cd5a3){var _0x36449e={'raw':![],'where':{'id':_0x57366b[_0xe896('0x48')]['id']}},_0x2a354f={};_0x2a354f['model']=_[_0xe896('0x32')](db[_0xe896('0x2f')]['rawAttributes']);_0x2a354f['query']=_['keys'](_0x57366b[_0xe896('0x31')]);_0x2a354f[_0xe896('0x33')]=_[_0xe896('0x35')](_0x2a354f[_0xe896('0x34')],_0x2a354f[_0xe896('0x31')]);_0x36449e[_0xe896('0x37')]=_['intersection'](_0x2a354f[_0xe896('0x34')],qs[_0xe896('0x36')](_0x57366b['query'][_0xe896('0x36')]));_0x36449e[_0xe896('0x37')]=_0x36449e[_0xe896('0x37')][_0xe896('0x38')]?_0x36449e['attributes']:_0x2a354f[_0xe896('0x34')];if(_0x57366b[_0xe896('0x31')][_0xe896('0x44')]){_0x36449e[_0xe896('0x45')]=[{'all':!![]}];}_0x36449e=_[_0xe896('0x3e')]({},_0x36449e,_0x57366b[_0xe896('0x43')]);return db['SquareProject'][_0xe896('0x49')](_0x36449e)['then'](handleEntityNotFound(_0x5cd5a3,null))[_0xe896('0x29')](respondWithResult(_0x5cd5a3,null))[_0xe896('0x47')](handleError(_0x5cd5a3,null));};exports[_0xe896('0x4a')]=function(_0x24b4f0,_0x252c27){return db[_0xe896('0x2f')]['create'](_0x24b4f0[_0xe896('0x4b')],{})[_0xe896('0x29')](function(_0x4818cd){var _0x3373dc=_0x24b4f0[_0xe896('0x4c')]['get']({'plain':!![]});if(!_0x3373dc)throw new Error(_0xe896('0x4d'));if(_0x3373dc['role']===_0xe896('0x4c')){var _0xb90690=_0x4818cd[_0xe896('0x2a')]({'plain':!![]});var _0x22424d=_0xe896('0x2b');return db['UserProfileSection'][_0xe896('0x49')]({'where':{'name':_0x22424d,'userProfileId':_0x3373dc[_0xe896('0x4e')]},'raw':!![]})[_0xe896('0x29')](function(_0x5e9ea6){if(_0x5e9ea6&&_0x5e9ea6[_0xe896('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0xb90690[_0xe896('0x50')],'resourceId':_0xb90690['id'],'type':_0x5e9ea6[_0xe896('0x50')],'sectionId':_0x5e9ea6['id']},{})['then'](function(){return _0x4818cd;});}else{return _0x4818cd;}})[_0xe896('0x47')](function(_0x3d137b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d137b);throw _0x3d137b;});}return _0x4818cd;})[_0xe896('0x29')](respondWithResult(_0x252c27,0xc9))[_0xe896('0x47')](handleError(_0x252c27,null));};exports['update']=function(_0x1d18f6,_0x2f1f1b){if(_0x1d18f6[_0xe896('0x4b')]['id']){delete _0x1d18f6[_0xe896('0x4b')]['id'];}return db[_0xe896('0x2f')][_0xe896('0x49')]({'where':{'id':_0x1d18f6[_0xe896('0x48')]['id']}})[_0xe896('0x29')](handleEntityNotFound(_0x2f1f1b,null))[_0xe896('0x29')](saveUpdates(_0x1d18f6[_0xe896('0x4b')],null))[_0xe896('0x29')](respondWithResult(_0x2f1f1b,null))['catch'](handleError(_0x2f1f1b,null));};exports[_0xe896('0x28')]=function(_0x2a23a2,_0x131c1c){return db[_0xe896('0x2f')][_0xe896('0x49')]({'where':{'id':_0x2a23a2[_0xe896('0x48')]['id']}})[_0xe896('0x29')](handleEntityNotFound(_0x131c1c,null))[_0xe896('0x29')](removeEntity(_0x131c1c,null))[_0xe896('0x47')](handleError(_0x131c1c,null));};exports[_0xe896('0x51')]=function(_0x3faf52,_0x26b78e,_0x5d8265){return db[_0xe896('0x2f')][_0xe896('0x49')]({'where':{'id':_0x3faf52[_0xe896('0x48')]['id']}})['then'](handleEntityNotFound(_0x26b78e,null))['then'](function(_0x4bf8d6){if(_0x4bf8d6){return _0x4bf8d6[_0xe896('0x51')](_0x3faf52[_0xe896('0x4b')][_0xe896('0x52')],_[_0xe896('0x53')](_0x3faf52['body'],[_0xe896('0x52'),'id'])||{});}})[_0xe896('0x29')](respondWithResult(_0x26b78e,null))[_0xe896('0x47')](handleError(_0x26b78e,null));};exports[_0xe896('0x54')]=function(_0x5d6c1c,_0x1d227a,_0x18d29a){return db['SquareProject'][_0xe896('0x49')]({'where':{'id':_0x5d6c1c[_0xe896('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d227a,null))['then'](function(_0x2a5e68){if(_0x2a5e68){return _0x2a5e68[_0xe896('0x54')](_0x5d6c1c[_0xe896('0x31')][_0xe896('0x52')])[_0xe896('0x29')](function(){if(_['isArray'](_0x5d6c1c[_0xe896('0x31')][_0xe896('0x52')])){for(var _0x113b00=0x0;_0x113b00<_0x5d6c1c[_0xe896('0x31')]['ids']['length'];_0x113b00+=0x1){socket[_0xe896('0x55')](_0xe896('0x56'),{'UserId':Number(_0x5d6c1c['query'][_0xe896('0x52')][_0x113b00]),'SquareProjectId':Number(_0x5d6c1c['params']['id'])});}}else{socket[_0xe896('0x55')](_0xe896('0x56'),{'UserId':Number(_0x5d6c1c[_0xe896('0x31')][_0xe896('0x52')]),'SquareProjectId':Number(_0x5d6c1c[_0xe896('0x48')]['id'])});}});}})[_0xe896('0x29')](respondWithStatusCode(_0x1d227a,null))[_0xe896('0x47')](handleError(_0x1d227a,null));};exports[_0xe896('0x57')]=function(_0x1d780a,_0x14b2b9,_0xcb329a){var _0x3248e6={};var _0x41ec26={};var _0x14d88e;var _0x468fd7;return db[_0xe896('0x2f')][_0xe896('0x58')]({'where':{'id':_0x1d780a[_0xe896('0x48')]['id']}})[_0xe896('0x29')](handleEntityNotFound(_0x14b2b9,null))[_0xe896('0x29')](function(_0x216ff0){if(_0x216ff0){_0x14d88e=_0x216ff0;_0x41ec26[_0xe896('0x34')]=_['keys'](db['User'][_0xe896('0x30')]);_0x41ec26[_0xe896('0x31')]=_['keys'](_0x1d780a[_0xe896('0x31')]);_0x41ec26[_0xe896('0x33')]=_[_0xe896('0x35')](_0x41ec26[_0xe896('0x34')],_0x41ec26[_0xe896('0x31')]);_0x3248e6[_0xe896('0x37')]=_[_0xe896('0x35')](_0x41ec26[_0xe896('0x34')],qs[_0xe896('0x36')](_0x1d780a[_0xe896('0x31')][_0xe896('0x36')]));_0x3248e6['attributes']=_0x3248e6[_0xe896('0x37')][_0xe896('0x38')]?_0x3248e6['attributes']:_0x41ec26[_0xe896('0x34')];_0x3248e6['order']=qs['sort'](_0x1d780a[_0xe896('0x31')][_0xe896('0x3b')]);_0x3248e6['where']=qs['filters'](_[_0xe896('0x59')](_0x1d780a['query'],_0x41ec26['filters']));if(_0x1d780a[_0xe896('0x31')][_0xe896('0x3c')]){_0x3248e6[_0xe896('0x3d')]=_['merge'](_0x3248e6[_0xe896('0x3d')],{'$or':_[_0xe896('0x5a')](_0x3248e6[_0xe896('0x37')],function(_0x565349){var _0x1c118e={};_0x1c118e[_0x565349]={'$like':'%'+_0x1d780a[_0xe896('0x31')][_0xe896('0x3c')]+'%'};return _0x1c118e;})});}_0x3248e6=_[_0xe896('0x3e')]({},_0x3248e6,_0x1d780a['options']);return _0x14d88e[_0xe896('0x57')](_0x3248e6);}})[_0xe896('0x29')](function(_0x3b51f1){if(_0x3b51f1){_0x468fd7=_0x3b51f1[_0xe896('0x38')];if(!_0x1d780a['query'][_0xe896('0x5b')](_0xe896('0x39'))){_0x3248e6['limit']=qs[_0xe896('0x22')](_0x1d780a[_0xe896('0x31')][_0xe896('0x22')]);_0x3248e6[_0xe896('0x21')]=qs['offset'](_0x1d780a[_0xe896('0x31')][_0xe896('0x21')]);}return _0x14d88e[_0xe896('0x57')](_0x3248e6);}})[_0xe896('0x29')](function(_0x2d219f){if(_0x2d219f){return _0x2d219f?{'count':_0x468fd7,'rows':_0x2d219f}:null;}})[_0xe896('0x29')](respondWithResult(_0x14b2b9,null))['catch'](handleError(_0x14b2b9,null));}; \ No newline at end of file +var _0xffd6=['SquareProjects','sendStatus','stack','name','send','index','SquareProject','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','field','options','count','includeAll','include','findAll','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get'];(function(_0x41d133,_0x368e4f){var _0x491af4=function(_0x198a2f){while(--_0x198a2f){_0x41d133['push'](_0x41d133['shift']());}};_0x491af4(++_0x368e4f);}(_0xffd6,0x97));var _0x6ffd=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xffd6[_0x5037ab];return _0x512adb;};'use strict';var pdf=require(_0x6ffd('0x0'));var emlformat=require(_0x6ffd('0x1'));var rimraf=require(_0x6ffd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ffd('0x3'));var moment=require(_0x6ffd('0x4'));var BPromise=require(_0x6ffd('0x5'));var Mustache=require('mustache');var util=require(_0x6ffd('0x6'));var path=require(_0x6ffd('0x7'));var sox=require(_0x6ffd('0x8'));var csv=require(_0x6ffd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6ffd('0xa'));var squel=require(_0x6ffd('0xb'));var crypto=require(_0x6ffd('0xc'));var jsforce=require(_0x6ffd('0xd'));var deskjs=require(_0x6ffd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ffd('0xf'));var Papa=require(_0x6ffd('0x10'));var Redis=require('ioredis');var authService=require(_0x6ffd('0x11'));var qs=require(_0x6ffd('0x12'));var hardwareService=require(_0x6ffd('0x13'));var logger=require(_0x6ffd('0x14'))(_0x6ffd('0x15'));var utils=require(_0x6ffd('0x16'));var config=require(_0x6ffd('0x17'));var db=require('../../mysqldb')['db'];config[_0x6ffd('0x18')]=_[_0x6ffd('0x19')](config['redis'],{'host':_0x6ffd('0x1a'),'port':0x18eb});var socket=require(_0x6ffd('0x1b'))(new Redis(config[_0x6ffd('0x18')]));require(_0x6ffd('0x1c'))['register'](socket);function respondWithStatusCode(_0x259235,_0x594cb3){_0x594cb3=_0x594cb3||0xcc;return function(_0x468ecc){if(_0x468ecc){return _0x259235['sendStatus'](_0x594cb3);}return _0x259235[_0x6ffd('0x1d')](_0x594cb3)[_0x6ffd('0x1e')]();};}function respondWithResult(_0x45db49,_0x5d8aff){_0x5d8aff=_0x5d8aff||0xc8;return function(_0x15fca6){if(_0x15fca6){return _0x45db49[_0x6ffd('0x1d')](_0x5d8aff)[_0x6ffd('0x1f')](_0x15fca6);}};}function respondWithFilteredResult(_0x3394b2,_0x29293a){return function(_0x19a772){if(_0x19a772){var _0x3f38e7=_0x19a772['count'],_0x889a4b=_0x29293a['offset'],_0x545576=_0x29293a[_0x6ffd('0x20')]+_0x29293a[_0x6ffd('0x21')],_0x11a609;if(_0x545576>=_0x3f38e7){_0x545576=_0x3f38e7;_0x11a609=0xc8;}else{_0x11a609=0xce;}_0x3394b2['status'](_0x11a609);return _0x3394b2[_0x6ffd('0x22')](_0x6ffd('0x23'),_0x889a4b+'-'+_0x545576+'/'+_0x3f38e7)['json'](_0x19a772);}return null;};}function patchUpdates(_0x564a11){return function(_0x465971){try{jsonpatch[_0x6ffd('0x24')](_0x465971,_0x564a11,!![]);}catch(_0x4dcc50){return BPromise[_0x6ffd('0x25')](_0x4dcc50);}return _0x465971[_0x6ffd('0x26')]();};}function saveUpdates(_0x327fee,_0x53128a){return function(_0x3ba429){if(_0x3ba429){return _0x3ba429[_0x6ffd('0x27')](_0x327fee)['then'](function(_0x356c9c){return _0x356c9c;});}return null;};}function removeEntity(_0x438d1a,_0x50c19a){return function(_0x31fb22){if(_0x31fb22){return _0x31fb22[_0x6ffd('0x28')]()[_0x6ffd('0x29')](function(){var _0x5d353a=_0x31fb22[_0x6ffd('0x2a')]({'plain':!![]});var _0x3e5726=_0x6ffd('0x2b');return db['UserProfileResource'][_0x6ffd('0x28')]({'where':{'type':_0x3e5726,'resourceId':_0x5d353a['id']}})['then'](function(){return _0x31fb22;});})[_0x6ffd('0x29')](function(){_0x438d1a[_0x6ffd('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520258,_0x252201){return function(_0x2a0391){if(!_0x2a0391){_0x520258[_0x6ffd('0x2c')](0x194);}return _0x2a0391;};}function handleError(_0x5e24de,_0x534139){_0x534139=_0x534139||0x1f4;return function(_0x32c399){logger['error'](_0x32c399[_0x6ffd('0x2d')]);if(_0x32c399[_0x6ffd('0x2e')]){delete _0x32c399['name'];}_0x5e24de[_0x6ffd('0x1d')](_0x534139)[_0x6ffd('0x2f')](_0x32c399);};}exports[_0x6ffd('0x30')]=function(_0x11a5cb,_0x235735){var _0x31c609={},_0x225c66={},_0xccb8c={'count':0x0,'rows':[]};var _0x17f627=db[_0x6ffd('0x31')][_0x6ffd('0x32')];_0x225c66[_0x6ffd('0x33')]=_[_0x6ffd('0x34')](_0x17f627);_0x225c66['query']=_['keys'](_0x11a5cb['query']);_0x225c66[_0x6ffd('0x35')]=_[_0x6ffd('0x36')](_0x225c66[_0x6ffd('0x33')],_0x225c66[_0x6ffd('0x37')]);_0x31c609[_0x6ffd('0x38')]=_[_0x6ffd('0x36')](_0x225c66[_0x6ffd('0x33')],qs[_0x6ffd('0x39')](_0x11a5cb[_0x6ffd('0x37')][_0x6ffd('0x39')]));_0x31c609[_0x6ffd('0x38')]=_0x31c609[_0x6ffd('0x38')][_0x6ffd('0x3a')]?_0x31c609['attributes']:_0x225c66[_0x6ffd('0x33')];if(!_0x11a5cb[_0x6ffd('0x37')][_0x6ffd('0x3b')](_0x6ffd('0x3c'))){_0x31c609['limit']=qs[_0x6ffd('0x21')](_0x11a5cb['query']['limit']);_0x31c609[_0x6ffd('0x20')]=qs[_0x6ffd('0x20')](_0x11a5cb[_0x6ffd('0x37')][_0x6ffd('0x20')]);}_0x31c609['order']=qs[_0x6ffd('0x3d')](_0x11a5cb['query'][_0x6ffd('0x3d')]);_0x31c609[_0x6ffd('0x3e')]=qs[_0x6ffd('0x35')](_[_0x6ffd('0x3f')](_0x11a5cb[_0x6ffd('0x37')],_0x225c66['filters']));if(_0x11a5cb['query'][_0x6ffd('0x40')]){_0x31c609['where']=_[_0x6ffd('0x41')](_0x31c609[_0x6ffd('0x3e')],{'$or':_[_0x6ffd('0x42')](_0x17f627,function(_0x65cb97){if(_0x65cb97[_0x6ffd('0x43')][_0x6ffd('0x44')]!=='VIRTUAL'){var _0x32d62b={};_0x32d62b[_0x65cb97[_0x6ffd('0x45')]]={'$like':'%'+_0x11a5cb[_0x6ffd('0x37')][_0x6ffd('0x40')]+'%'};return _0x32d62b;}})});}_0x31c609=_['merge']({},_0x31c609,_0x11a5cb[_0x6ffd('0x46')]);var _0x552bbf={'where':_0x31c609[_0x6ffd('0x3e')]};return db[_0x6ffd('0x31')][_0x6ffd('0x47')](_0x552bbf)['then'](function(_0x2cecc2){_0xccb8c[_0x6ffd('0x47')]=_0x2cecc2;if(_0x11a5cb[_0x6ffd('0x37')][_0x6ffd('0x48')]){_0x31c609[_0x6ffd('0x49')]=[{'all':!![]}];}return db[_0x6ffd('0x31')][_0x6ffd('0x4a')](_0x31c609);})['then'](function(_0x5ca86f){_0xccb8c['rows']=_0x5ca86f;return _0xccb8c;})[_0x6ffd('0x29')](respondWithFilteredResult(_0x235735,_0x31c609))[_0x6ffd('0x4b')](handleError(_0x235735,null));};exports['show']=function(_0x3d5193,_0x2ace8b){var _0x390001={'raw':![],'where':{'id':_0x3d5193['params']['id']}},_0x1041eb={};_0x1041eb[_0x6ffd('0x33')]=_[_0x6ffd('0x34')](db[_0x6ffd('0x31')][_0x6ffd('0x32')]);_0x1041eb[_0x6ffd('0x37')]=_[_0x6ffd('0x34')](_0x3d5193[_0x6ffd('0x37')]);_0x1041eb[_0x6ffd('0x35')]=_[_0x6ffd('0x36')](_0x1041eb[_0x6ffd('0x33')],_0x1041eb[_0x6ffd('0x37')]);_0x390001['attributes']=_['intersection'](_0x1041eb['model'],qs[_0x6ffd('0x39')](_0x3d5193[_0x6ffd('0x37')]['fields']));_0x390001[_0x6ffd('0x38')]=_0x390001[_0x6ffd('0x38')][_0x6ffd('0x3a')]?_0x390001[_0x6ffd('0x38')]:_0x1041eb[_0x6ffd('0x33')];if(_0x3d5193['query'][_0x6ffd('0x48')]){_0x390001[_0x6ffd('0x49')]=[{'all':!![]}];}_0x390001=_[_0x6ffd('0x41')]({},_0x390001,_0x3d5193['options']);return db[_0x6ffd('0x31')][_0x6ffd('0x4c')](_0x390001)[_0x6ffd('0x29')](handleEntityNotFound(_0x2ace8b,null))[_0x6ffd('0x29')](respondWithResult(_0x2ace8b,null))[_0x6ffd('0x4b')](handleError(_0x2ace8b,null));};exports[_0x6ffd('0x4d')]=function(_0x563f20,_0x41e064){return db[_0x6ffd('0x31')][_0x6ffd('0x4d')](_0x563f20[_0x6ffd('0x4e')],{})[_0x6ffd('0x29')](function(_0x3d6221){var _0x25394b=_0x563f20['user'][_0x6ffd('0x2a')]({'plain':!![]});if(!_0x25394b)throw new Error(_0x6ffd('0x4f'));if(_0x25394b['role']==='user'){var _0x5aea31=_0x3d6221[_0x6ffd('0x2a')]({'plain':!![]});var _0x58a3d5=_0x6ffd('0x2b');return db[_0x6ffd('0x50')][_0x6ffd('0x4c')]({'where':{'name':_0x58a3d5,'userProfileId':_0x25394b[_0x6ffd('0x51')]},'raw':!![]})['then'](function(_0x3583f0){if(_0x3583f0&&_0x3583f0[_0x6ffd('0x52')]===0x0){return db[_0x6ffd('0x53')]['create']({'name':_0x5aea31[_0x6ffd('0x2e')],'resourceId':_0x5aea31['id'],'type':_0x3583f0[_0x6ffd('0x2e')],'sectionId':_0x3583f0['id']},{})['then'](function(){return _0x3d6221;});}else{return _0x3d6221;}})['catch'](function(_0x5fd130){logger[_0x6ffd('0x54')](_0x6ffd('0x55'),_0x5fd130);throw _0x5fd130;});}return _0x3d6221;})[_0x6ffd('0x29')](respondWithResult(_0x41e064,0xc9))[_0x6ffd('0x4b')](handleError(_0x41e064,null));};exports[_0x6ffd('0x27')]=function(_0x22302b,_0x49665d){if(_0x22302b[_0x6ffd('0x4e')]['id']){delete _0x22302b[_0x6ffd('0x4e')]['id'];}return db[_0x6ffd('0x31')]['find']({'where':{'id':_0x22302b['params']['id']}})[_0x6ffd('0x29')](handleEntityNotFound(_0x49665d,null))[_0x6ffd('0x29')](saveUpdates(_0x22302b[_0x6ffd('0x4e')],null))[_0x6ffd('0x29')](respondWithResult(_0x49665d,null))['catch'](handleError(_0x49665d,null));};exports[_0x6ffd('0x28')]=function(_0x3fc72f,_0x3cf462){return db[_0x6ffd('0x31')][_0x6ffd('0x4c')]({'where':{'id':_0x3fc72f[_0x6ffd('0x56')]['id']}})['then'](handleEntityNotFound(_0x3cf462,null))[_0x6ffd('0x29')](removeEntity(_0x3cf462,null))[_0x6ffd('0x4b')](handleError(_0x3cf462,null));};exports[_0x6ffd('0x57')]=function(_0x40a764,_0x246828,_0x4b87fc){return db[_0x6ffd('0x31')][_0x6ffd('0x4c')]({'where':{'id':_0x40a764[_0x6ffd('0x56')]['id']}})[_0x6ffd('0x29')](handleEntityNotFound(_0x246828,null))[_0x6ffd('0x29')](function(_0x495d4a){if(_0x495d4a){return _0x495d4a[_0x6ffd('0x57')](_0x40a764[_0x6ffd('0x4e')][_0x6ffd('0x58')],_['omit'](_0x40a764[_0x6ffd('0x4e')],[_0x6ffd('0x58'),'id'])||{});}})['then'](respondWithResult(_0x246828,null))[_0x6ffd('0x4b')](handleError(_0x246828,null));};exports['removeUsers']=function(_0x1c060a,_0x4352ea,_0x5017b2){return db[_0x6ffd('0x31')]['find']({'where':{'id':_0x1c060a[_0x6ffd('0x56')]['id']}})[_0x6ffd('0x29')](handleEntityNotFound(_0x4352ea,null))[_0x6ffd('0x29')](function(_0x2c460b){if(_0x2c460b){return _0x2c460b[_0x6ffd('0x59')](_0x1c060a['query'][_0x6ffd('0x58')])[_0x6ffd('0x29')](function(){if(_[_0x6ffd('0x5a')](_0x1c060a[_0x6ffd('0x37')]['ids'])){for(var _0x38a627=0x0;_0x38a627<_0x1c060a[_0x6ffd('0x37')][_0x6ffd('0x58')]['length'];_0x38a627+=0x1){socket[_0x6ffd('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x1c060a[_0x6ffd('0x37')]['ids'][_0x38a627]),'SquareProjectId':Number(_0x1c060a[_0x6ffd('0x56')]['id'])});}}else{socket[_0x6ffd('0x5b')](_0x6ffd('0x5c'),{'UserId':Number(_0x1c060a[_0x6ffd('0x37')]['ids']),'SquareProjectId':Number(_0x1c060a[_0x6ffd('0x56')]['id'])});}});}})[_0x6ffd('0x29')](respondWithStatusCode(_0x4352ea,null))[_0x6ffd('0x4b')](handleError(_0x4352ea,null));};exports[_0x6ffd('0x5d')]=function(_0x1cd7a9,_0xe2ddf1,_0x256a03){var _0x255432={};var _0x3c9f20={};var _0x302db8;var _0x46f58d;return db[_0x6ffd('0x31')][_0x6ffd('0x5e')]({'where':{'id':_0x1cd7a9[_0x6ffd('0x56')]['id']}})[_0x6ffd('0x29')](handleEntityNotFound(_0xe2ddf1,null))[_0x6ffd('0x29')](function(_0x3d7d9d){if(_0x3d7d9d){_0x302db8=_0x3d7d9d;_0x3c9f20[_0x6ffd('0x33')]=_[_0x6ffd('0x34')](db[_0x6ffd('0x5f')][_0x6ffd('0x32')]);_0x3c9f20[_0x6ffd('0x37')]=_[_0x6ffd('0x34')](_0x1cd7a9[_0x6ffd('0x37')]);_0x3c9f20[_0x6ffd('0x35')]=_['intersection'](_0x3c9f20[_0x6ffd('0x33')],_0x3c9f20['query']);_0x255432[_0x6ffd('0x38')]=_[_0x6ffd('0x36')](_0x3c9f20[_0x6ffd('0x33')],qs[_0x6ffd('0x39')](_0x1cd7a9[_0x6ffd('0x37')][_0x6ffd('0x39')]));_0x255432[_0x6ffd('0x38')]=_0x255432['attributes'][_0x6ffd('0x3a')]?_0x255432[_0x6ffd('0x38')]:_0x3c9f20[_0x6ffd('0x33')];_0x255432[_0x6ffd('0x60')]=qs[_0x6ffd('0x3d')](_0x1cd7a9[_0x6ffd('0x37')][_0x6ffd('0x3d')]);_0x255432[_0x6ffd('0x3e')]=qs[_0x6ffd('0x35')](_[_0x6ffd('0x3f')](_0x1cd7a9['query'],_0x3c9f20[_0x6ffd('0x35')]));if(_0x1cd7a9[_0x6ffd('0x37')][_0x6ffd('0x40')]){_0x255432[_0x6ffd('0x3e')]=_[_0x6ffd('0x41')](_0x255432[_0x6ffd('0x3e')],{'$or':_['map'](_0x255432['attributes'],function(_0x1bca62){var _0x193e8e={};_0x193e8e[_0x1bca62]={'$like':'%'+_0x1cd7a9['query'][_0x6ffd('0x40')]+'%'};return _0x193e8e;})});}_0x255432=_['merge']({},_0x255432,_0x1cd7a9[_0x6ffd('0x46')]);return _0x302db8['getUsers'](_0x255432);}})[_0x6ffd('0x29')](function(_0x41b939){if(_0x41b939){_0x46f58d=_0x41b939['length'];if(!_0x1cd7a9[_0x6ffd('0x37')]['hasOwnProperty'](_0x6ffd('0x3c'))){_0x255432[_0x6ffd('0x21')]=qs['limit'](_0x1cd7a9[_0x6ffd('0x37')][_0x6ffd('0x21')]);_0x255432[_0x6ffd('0x20')]=qs['offset'](_0x1cd7a9[_0x6ffd('0x37')][_0x6ffd('0x20')]);}return _0x302db8[_0x6ffd('0x5d')](_0x255432);}})[_0x6ffd('0x29')](function(_0x214023){if(_0x214023){return _0x214023?{'count':_0x46f58d,'rows':_0x214023}:null;}})[_0x6ffd('0x29')](respondWithResult(_0xe2ddf1,null))[_0x6ffd('0x4b')](handleError(_0xe2ddf1,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a0b4bf1..ecfc352 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 _0x281a=['setMaxListeners','update','remove','emit','hook','exports','events','SquareProject'];(function(_0x219806,_0x44ea29){var _0x338c2e=function(_0x4a05b5){while(--_0x4a05b5){_0x219806['push'](_0x219806['shift']());}};_0x338c2e(++_0x44ea29);}(_0x281a,0x1d6));var _0xa281=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x281a[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require(_0xa281('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xa281('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa281('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa281('0x3'),'afterDestroy':_0xa281('0x4')};function emitEvent(_0x217556){return function(_0x3b11d7,_0x3d6ad1,_0x223e20){SquareProjectEvents[_0xa281('0x5')](_0x217556+':'+_0x3b11d7['id'],_0x3b11d7);SquareProjectEvents[_0xa281('0x5')](_0x217556,_0x3b11d7);_0x223e20(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xa281('0x6')](e,emitEvent(event));}}module[_0xa281('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x02fc=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0x02fc,0x189));var _0xc02f=function(_0x16d245,_0x4f42bb){_0x16d245=_0x16d245-0x0;var _0x3e0436=_0x02fc[_0x16d245];return _0x3e0436;};'use strict';var EventEmitter=require(_0xc02f('0x0'));var SquareProject=require(_0xc02f('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc02f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc02f('0x3'),'afterDestroy':_0xc02f('0x4')};function emitEvent(_0x527d20){return function(_0x43319f,_0xff5e29,_0x541f42){SquareProjectEvents[_0xc02f('0x5')](_0x527d20+':'+_0x43319f['id'],_0x43319f);SquareProjectEvents[_0xc02f('0x5')](_0x527d20,_0x43319f);_0x541f42(null);};}for(var e in events){if(events[_0xc02f('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xc02f('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c0eb51f..61b83f0 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 _0xfa7d=['square_projects','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareProject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfa7d,0x169));var _0xdfa7=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xfa7d[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0xdfa7('0x0'));var util=require('util');var logger=require(_0xdfa7('0x1'))('api');var moment=require(_0xdfa7('0x2'));var BPromise=require(_0xdfa7('0x3'));var rp=require(_0xdfa7('0x4'));var fs=require('fs');var path=require(_0xdfa7('0x5'));var rimraf=require(_0xdfa7('0x6'));var config=require(_0xdfa7('0x7'));var attributes=require('./squareProject.attributes');module[_0xdfa7('0x8')]=function(_0x4a96d8,_0x342947){return _0x4a96d8[_0xdfa7('0x9')](_0xdfa7('0xa'),attributes,{'tableName':_0xdfa7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe773=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xe773,0xdc));var _0x3e77=function(_0x5b8fad,_0x3d6698){_0x5b8fad=_0x5b8fad-0x0;var _0x52bb81=_0xe773[_0x5b8fad];return _0x52bb81;};'use strict';var _=require(_0x3e77('0x0'));var util=require(_0x3e77('0x1'));var logger=require(_0x3e77('0x2'))(_0x3e77('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e77('0x4'));var fs=require('fs');var path=require(_0x3e77('0x5'));var rimraf=require('rimraf');var config=require(_0x3e77('0x6'));var attributes=require(_0x3e77('0x7'));module[_0x3e77('0x8')]=function(_0x15b7ff,_0x3d9c8d){return _0x15b7ff[_0x3e77('0x9')](_0x3e77('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4b5470e..20a1c08 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 _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x308d7a,_0x2b7931){var _0x4694df=function(_0x350bc7){while(--_0x350bc7){_0x308d7a['push'](_0x308d7a['shift']());}};_0x4694df(++_0x2b7931);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x46045d,_0x49d45a){var _0x35a9c2=function(_0x1c9ea9){while(--_0x1c9ea9){_0x46045d['push'](_0x46045d['shift']());}};_0x35a9c2(++_0x49d45a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index b379219..f03c4a2 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 _0x777f=['save','remove','update','emit','removeListener','length','squareProject:','./squareProject.events'];(function(_0x2c3000,_0x414590){var _0x4846df=function(_0x100a06){while(--_0x100a06){_0x2c3000['push'](_0x2c3000['shift']());}};_0x4846df(++_0x414590);}(_0x777f,0x9f));var _0xf777=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0x777f[_0x45346d];return _0x5ce7ca;};'use strict';var SquareProjectEvents=require(_0xf777('0x0'));var events=[_0xf777('0x1'),_0xf777('0x2'),_0xf777('0x3')];function createListener(_0xfd8f38,_0x43f439){return function(_0x13e74d){_0x43f439[_0xf777('0x4')](_0xfd8f38,_0x13e74d);};}function removeListener(_0x508470,_0x3caeaa){return function(){SquareProjectEvents[_0xf777('0x5')](_0x508470,_0x3caeaa);};}exports['register']=function(_0x5b7903){for(var _0x5df5dc=0x0,_0xa78a3=events[_0xf777('0x6')];_0x5df5dc<_0xa78a3;_0x5df5dc++){var _0x3cbcaa=events[_0x5df5dc];var _0x4582bd=createListener(_0xf777('0x7')+_0x3cbcaa,_0x5b7903);SquareProjectEvents['on'](_0x3cbcaa,_0x4582bd);}}; \ No newline at end of file +var _0x4f29=['emit','removeListener','register','length','squareProject:','save','remove','update'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4f29,0xfd));var _0x94f2=function(_0x244f1e,_0x22ef37){_0x244f1e=_0x244f1e-0x0;var _0xf7cd1e=_0x4f29[_0x244f1e];return _0xf7cd1e;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x94f2('0x0'),_0x94f2('0x1'),_0x94f2('0x2')];function createListener(_0x2a6804,_0xc16ee3){return function(_0x36e06e){_0xc16ee3[_0x94f2('0x3')](_0x2a6804,_0x36e06e);};}function removeListener(_0x2a6535,_0x106798){return function(){SquareProjectEvents[_0x94f2('0x4')](_0x2a6535,_0x106798);};}exports[_0x94f2('0x5')]=function(_0x493302){for(var _0x5e9216=0x0,_0xe14ba5=events[_0x94f2('0x6')];_0x5e9216<_0xe14ba5;_0x5e9216++){var _0x1d1910=events[_0x5e9216];var _0x224a93=createListener(_0x94f2('0x7')+_0x1d1910,_0x493302);SquareProjectEvents['on'](_0x1d1910,_0x224a93);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index f0232e9..8871128 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 _0xec2f=['download','post','create','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download'];(function(_0x20c5e8,_0xc8d236){var _0x5a24e7=function(_0x4ff3db){while(--_0x4ff3db){_0x20c5e8['push'](_0x20c5e8['shift']());}};_0x5a24e7(++_0xc8d236);}(_0xec2f,0xa8));var _0xfec2=function(_0x507597,_0x412525){_0x507597=_0x507597-0x0;var _0x110a0f=_0xec2f[_0x507597];return _0x110a0f;};'use strict';var multer=require(_0xfec2('0x0'));var util=require(_0xfec2('0x1'));var path=require(_0xfec2('0x2'));var timeout=require('connect-timeout');var express=require(_0xfec2('0x3'));var router=express[_0xfec2('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfec2('0x5'));var controller=require(_0xfec2('0x6'));router['get']('/',auth[_0xfec2('0x7')](),controller['index']);router[_0xfec2('0x8')](_0xfec2('0x9'),auth['isAuthenticated'](),controller[_0xfec2('0xa')]);router[_0xfec2('0x8')](_0xfec2('0xb'),auth['isAuthenticated'](),controller[_0xfec2('0xc')]);router[_0xfec2('0xd')]('/',auth['isAuthenticated'](),controller[_0xfec2('0xe')]);router['put']('/:id',auth[_0xfec2('0x7')](),controller['update']);router[_0xfec2('0xf')](_0xfec2('0x9'),auth['isAuthenticated'](),controller[_0xfec2('0x10')]);module[_0xfec2('0x11')]=router; \ No newline at end of file +var _0x6c8b=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','isAuthenticated','download','create','/:id','update','delete','exports','multer'];(function(_0x28642b,_0x474f8f){var _0x325187=function(_0x2facbf){while(--_0x2facbf){_0x28642b['push'](_0x28642b['shift']());}};_0x325187(++_0x474f8f);}(_0x6c8b,0xa9));var _0xb6c8=function(_0x41ac1c,_0x559002){_0x41ac1c=_0x41ac1c-0x0;var _0x36bfdc=_0x6c8b[_0x41ac1c];return _0x36bfdc;};'use strict';var multer=require(_0xb6c8('0x0'));var util=require(_0xb6c8('0x1'));var path=require(_0xb6c8('0x2'));var timeout=require(_0xb6c8('0x3'));var express=require('express');var router=express[_0xb6c8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb6c8('0x5'));var config=require(_0xb6c8('0x6'));var controller=require(_0xb6c8('0x7'));router[_0xb6c8('0x8')]('/',auth['isAuthenticated'](),controller[_0xb6c8('0x9')]);router[_0xb6c8('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0xb6c8('0xa')](),controller[_0xb6c8('0xb')]);router['post']('/',auth[_0xb6c8('0xa')](),controller[_0xb6c8('0xc')]);router['put'](_0xb6c8('0xd'),auth[_0xb6c8('0xa')](),controller[_0xb6c8('0xe')]);router[_0xb6c8('0xf')](_0xb6c8('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb6c8('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 1756afb..97c71aa 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 _0x350b=['STRING','sequelize','exports'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x350b,0x1cf));var _0xb350=function(_0x14fca9,_0x24556f){_0x14fca9=_0x14fca9-0x0;var _0x371089=_0x350b[_0x14fca9];return _0x371089;};'use strict';var Sequelize=require(_0xb350('0x0'));module[_0xb350('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb350('0x2')]},'calleridname':{'type':Sequelize[_0xb350('0x2')]},'context':{'type':Sequelize[_0xb350('0x2')]},'extension':{'type':Sequelize[_0xb350('0x2')]},'priority':{'type':Sequelize[_0xb350('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xb350('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xb350('0x2')]},'savePath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2840=['exports','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x2840,0x14c));var _0x0284=function(_0x3b9b2e,_0x1d3afe){_0x3b9b2e=_0x3b9b2e-0x0;var _0x3e1a74=_0x2840[_0x3b9b2e];return _0x3e1a74;};'use strict';var Sequelize=require('sequelize');module[_0x0284('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0284('0x1')]},'calleridname':{'type':Sequelize[_0x0284('0x1')]},'context':{'type':Sequelize[_0x0284('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0284('0x1')]},'accountcode':{'type':Sequelize[_0x0284('0x1')]},'dnid':{'type':Sequelize[_0x0284('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x0284('0x1')]},'filename':{'type':Sequelize[_0x0284('0x1')]},'savePath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index e7f7bc9..459b555 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 _0x9700=['send','SquareRecording','rawAttributes','model','keys','query','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','merge','map','type','key','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','params','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','Sequelize','download','unlink','message','SquareRecording\x20not\x20found','Not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x47533b,_0x134204){var _0x5911b9=function(_0x41a238){while(--_0x41a238){_0x47533b['push'](_0x47533b['shift']());}};_0x5911b9(++_0x134204);}(_0x9700,0x179));var _0x0970=function(_0x29b67a,_0x45b0f0){_0x29b67a=_0x29b67a-0x0;var _0x575714=_0x9700[_0x29b67a];return _0x575714;};'use strict';var pdf=require(_0x0970('0x0'));var emlformat=require(_0x0970('0x1'));var rimraf=require(_0x0970('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0970('0x3'));var rp=require(_0x0970('0x4'));var moment=require(_0x0970('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0970('0x6'));var util=require(_0x0970('0x7'));var path=require(_0x0970('0x8'));var sox=require('sox');var csv=require(_0x0970('0x9'));var ejs=require(_0x0970('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0970('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0970('0xc'));var toCsv=require(_0x0970('0x9'));var querystring=require(_0x0970('0xd'));var Papa=require('papaparse');var Redis=require(_0x0970('0xe'));var authService=require(_0x0970('0xf'));var qs=require(_0x0970('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0970('0x11'))(_0x0970('0x12'));var utils=require('../../config/utils');var config=require(_0x0970('0x13'));var db=require(_0x0970('0x14'))['db'];function respondWithStatusCode(_0xcd7e91,_0x2b6518){_0x2b6518=_0x2b6518||0xcc;return function(_0x4cd0ce){if(_0x4cd0ce){return _0xcd7e91[_0x0970('0x15')](_0x2b6518);}return _0xcd7e91[_0x0970('0x16')](_0x2b6518)['end']();};}function respondWithResult(_0x420356,_0x876d03){_0x876d03=_0x876d03||0xc8;return function(_0x117fb4){if(_0x117fb4){return _0x420356[_0x0970('0x16')](_0x876d03)['json'](_0x117fb4);}};}function respondWithFilteredResult(_0x4276fd,_0x9f749e){return function(_0x406d11){if(_0x406d11){var _0x5af464=_0x406d11[_0x0970('0x17')],_0x210f12=_0x9f749e[_0x0970('0x18')],_0x1151e0=_0x9f749e[_0x0970('0x18')]+_0x9f749e[_0x0970('0x19')],_0x357092;if(_0x1151e0>=_0x5af464){_0x1151e0=_0x5af464;_0x357092=0xc8;}else{_0x357092=0xce;}_0x4276fd['status'](_0x357092);return _0x4276fd[_0x0970('0x1a')](_0x0970('0x1b'),_0x210f12+'-'+_0x1151e0+'/'+_0x5af464)['json'](_0x406d11);}return null;};}function patchUpdates(_0x4f4968){return function(_0x6475ae){try{jsonpatch[_0x0970('0x1c')](_0x6475ae,_0x4f4968,!![]);}catch(_0x1dc22c){return BPromise[_0x0970('0x1d')](_0x1dc22c);}return _0x6475ae[_0x0970('0x1e')]();};}function saveUpdates(_0x334076,_0x321959){return function(_0x54c30f){if(_0x54c30f){return _0x54c30f[_0x0970('0x1f')](_0x334076)[_0x0970('0x20')](function(_0x202fe8){return _0x202fe8;});}return null;};}function removeEntity(_0x10960a,_0x5298c1){return function(_0x3173d3){if(_0x3173d3){return _0x3173d3[_0x0970('0x21')]()[_0x0970('0x20')](function(){_0x10960a[_0x0970('0x16')](0xcc)[_0x0970('0x22')]();});}};}function handleEntityNotFound(_0x37f7ca,_0xfa77b6){return function(_0x55df6b){if(!_0x55df6b){_0x37f7ca['sendStatus'](0x194);}return _0x55df6b;};}function handleError(_0x1d0468,_0x4c27d9){_0x4c27d9=_0x4c27d9||0x1f4;return function(_0x1ff672){logger[_0x0970('0x23')](_0x1ff672[_0x0970('0x24')]);if(_0x1ff672[_0x0970('0x25')]){delete _0x1ff672['name'];}_0x1d0468[_0x0970('0x16')](_0x4c27d9)[_0x0970('0x26')](_0x1ff672);};}exports['index']=function(_0xae1d78,_0x535747){var _0xb41a8d={},_0x46e5f2={},_0x2a64c1={'count':0x0,'rows':[]};var _0x486acf=db[_0x0970('0x27')][_0x0970('0x28')];_0x46e5f2[_0x0970('0x29')]=_[_0x0970('0x2a')](_0x486acf);_0x46e5f2[_0x0970('0x2b')]=_[_0x0970('0x2a')](_0xae1d78[_0x0970('0x2b')]);_0x46e5f2['filters']=_[_0x0970('0x2c')](_0x46e5f2[_0x0970('0x29')],_0x46e5f2[_0x0970('0x2b')]);_0xb41a8d[_0x0970('0x2d')]=_[_0x0970('0x2c')](_0x46e5f2[_0x0970('0x29')],qs[_0x0970('0x2e')](_0xae1d78['query'][_0x0970('0x2e')]));_0xb41a8d['attributes']=_0xb41a8d[_0x0970('0x2d')][_0x0970('0x2f')]?_0xb41a8d[_0x0970('0x2d')]:_0x46e5f2[_0x0970('0x29')];if(!_0xae1d78['query']['hasOwnProperty']('nolimit')){_0xb41a8d[_0x0970('0x19')]=qs['limit'](_0xae1d78['query'][_0x0970('0x19')]);_0xb41a8d[_0x0970('0x18')]=qs['offset'](_0xae1d78['query'][_0x0970('0x18')]);}_0xb41a8d[_0x0970('0x30')]=qs[_0x0970('0x31')](_0xae1d78[_0x0970('0x2b')]['sort']);_0xb41a8d['where']=qs['filters'](_[_0x0970('0x32')](_0xae1d78[_0x0970('0x2b')],_0x46e5f2[_0x0970('0x33')]));if(_0xae1d78[_0x0970('0x2b')][_0x0970('0x34')]){_0xb41a8d[_0x0970('0x35')]=_[_0x0970('0x36')](_0xb41a8d[_0x0970('0x35')],{'$or':_[_0x0970('0x37')](_0x486acf,function(_0x2f4cce){if(_0x2f4cce[_0x0970('0x38')][_0x0970('0x39')]!==_0x0970('0x3a')){var _0x3ec29f={};_0x3ec29f[_0x2f4cce['field']]={'$like':'%'+_0xae1d78[_0x0970('0x2b')]['filter']+'%'};return _0x3ec29f;}})});}_0xb41a8d=_[_0x0970('0x36')]({},_0xb41a8d,_0xae1d78[_0x0970('0x3b')]);var _0x5909bf={'where':_0xb41a8d[_0x0970('0x35')]};return db[_0x0970('0x27')][_0x0970('0x17')](_0x5909bf)['then'](function(_0x507044){_0x2a64c1['count']=_0x507044;if(_0xae1d78[_0x0970('0x2b')]['includeAll']){_0xb41a8d[_0x0970('0x3c')]=[{'all':!![]}];}return db[_0x0970('0x27')]['findAll'](_0xb41a8d);})[_0x0970('0x20')](function(_0x524967){_0x2a64c1[_0x0970('0x3d')]=_0x524967;return _0x2a64c1;})[_0x0970('0x20')](respondWithFilteredResult(_0x535747,_0xb41a8d))[_0x0970('0x3e')](handleError(_0x535747,null));};exports[_0x0970('0x3f')]=function(_0x25a0e4,_0x3581a4){var _0x2b7056={'raw':!![],'where':{'id':_0x25a0e4['params']['id']}},_0x365892={};_0x365892[_0x0970('0x29')]=_[_0x0970('0x2a')](db[_0x0970('0x27')][_0x0970('0x28')]);_0x365892[_0x0970('0x2b')]=_[_0x0970('0x2a')](_0x25a0e4[_0x0970('0x2b')]);_0x365892['filters']=_[_0x0970('0x2c')](_0x365892[_0x0970('0x29')],_0x365892['query']);_0x2b7056[_0x0970('0x2d')]=_['intersection'](_0x365892[_0x0970('0x29')],qs[_0x0970('0x2e')](_0x25a0e4[_0x0970('0x2b')][_0x0970('0x2e')]));_0x2b7056[_0x0970('0x2d')]=_0x2b7056['attributes']['length']?_0x2b7056[_0x0970('0x2d')]:_0x365892['model'];if(_0x25a0e4[_0x0970('0x2b')][_0x0970('0x40')]){_0x2b7056[_0x0970('0x3c')]=[{'all':!![]}];}_0x2b7056=_[_0x0970('0x36')]({},_0x2b7056,_0x25a0e4[_0x0970('0x3b')]);return db[_0x0970('0x27')][_0x0970('0x41')](_0x2b7056)[_0x0970('0x20')](handleEntityNotFound(_0x3581a4,null))['then'](respondWithResult(_0x3581a4,null))['catch'](handleError(_0x3581a4,null));};exports[_0x0970('0x42')]=function(_0x54231a,_0x1baef9){return db[_0x0970('0x27')][_0x0970('0x42')](_0x54231a[_0x0970('0x43')],{})[_0x0970('0x20')](respondWithResult(_0x1baef9,0xc9))['catch'](handleError(_0x1baef9,null));};exports['update']=function(_0x4faa90,_0x543f2f){if(_0x4faa90[_0x0970('0x43')]['id']){delete _0x4faa90[_0x0970('0x43')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x4faa90[_0x0970('0x44')]['id']}})[_0x0970('0x20')](handleEntityNotFound(_0x543f2f,null))[_0x0970('0x20')](saveUpdates(_0x4faa90[_0x0970('0x43')],null))[_0x0970('0x20')](respondWithResult(_0x543f2f,null))[_0x0970('0x3e')](handleError(_0x543f2f,null));};exports[_0x0970('0x21')]=function(_0x409ce0,_0x4997d7){return db['SquareRecording']['find']({'where':{'id':_0x409ce0['params']['id']}})[_0x0970('0x20')](handleEntityNotFound(_0x4997d7,null))[_0x0970('0x20')](removeEntity(_0x4997d7,null))[_0x0970('0x3e')](handleError(_0x4997d7,null));};exports['download']=function(_0x1d6324,_0x5cf66f,_0x5f56f4){var _0x27b2f9=require('../../components/encryptor');var _0x4d3a5c=![];var _0x54d657={};if(_0x1d6324[_0x0970('0x2b')][_0x0970('0x38')]&&_0x1d6324[_0x0970('0x2b')]['type']===_0x0970('0x45')){_0x54d657[_0x0970('0x45')]=_0x1d6324[_0x0970('0x44')]['id'];}else{_0x54d657['id']=_0x1d6324['params']['id'];}return db[_0x0970('0x27')]['find']({'where':_0x54d657,'attributes':['id',_0x0970('0x46'),_0x0970('0x47')],'raw':!![]})[_0x0970('0x20')](handleEntityNotFound(_0x5cf66f,null))[_0x0970('0x20')](function(_0x59ed94){if(_0x59ed94){var _0xad09cb=_0x59ed94['savePath'];var _0x57c492=util[_0x0970('0x48')](_0x0970('0x49'),_0xad09cb);if(fs[_0x0970('0x4a')](_0x57c492)){_0x4d3a5c=!![];return _0x27b2f9['decryptFile'](_0x57c492,_0xad09cb,config[_0x0970('0x4b')][_0x0970('0x4c')])['then'](function(){return _0x59ed94;});}return _0x59ed94;}})['then'](function(_0xb15ed4){if(_0xb15ed4){var _0x2ee094=_0xb15ed4['savePath'];if(!fs[_0x0970('0x4a')](_0x2ee094)){throw new db[(_0x0970('0x4d'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0xb15ed4['filename']){return _0x5cf66f[_0x0970('0x4e')](_0x2ee094,_0xb15ed4[_0x0970('0x47')]+path['extname'](_0x2ee094),function(){if(_0x4d3a5c){fs[_0x0970('0x4f')](_0x2ee094);}});}else{return _0x5cf66f['download'](_0x2ee094,function(_0x396ec2){if(_0x4d3a5c){fs[_0x0970('0x4f')](_0x2ee094);}});}}})[_0x0970('0x3e')](function(_0x3838cb){if(_0x3838cb[_0x0970('0x50')]===_0x0970('0x51')){_0x5cf66f[_0x0970('0x16')](0x194)[_0x0970('0x26')](_0x0970('0x52'));}else{return handleError(_0x5cf66f,null);}});}; \ No newline at end of file +var _0x8d5f=['key','VIRTUAL','field','options','SquareRecording','includeAll','include','findAll','catch','show','params','create','body','update','find','destroy','../../components/encryptor','uniqueid','savePath','format','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','send','Not\x20found','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','then','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type'];(function(_0x343dab,_0x134185){var _0xa7e52d=function(_0x37a2b8){while(--_0x37a2b8){_0x343dab['push'](_0x343dab['shift']());}};_0xa7e52d(++_0x134185);}(_0x8d5f,0x1d3));var _0xf8d5=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x8d5f[_0x3792e6];return _0x441e44;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf8d5('0x0'));var rimraf=require(_0xf8d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8d5('0x2'));var rp=require(_0xf8d5('0x3'));var moment=require(_0xf8d5('0x4'));var BPromise=require(_0xf8d5('0x5'));var Mustache=require(_0xf8d5('0x6'));var util=require(_0xf8d5('0x7'));var path=require(_0xf8d5('0x8'));var sox=require(_0xf8d5('0x9'));var csv=require(_0xf8d5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf8d5('0xb'));var squel=require('squel');var crypto=require(_0xf8d5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf8d5('0xd'));var toCsv=require(_0xf8d5('0xa'));var querystring=require(_0xf8d5('0xe'));var Papa=require(_0xf8d5('0xf'));var Redis=require(_0xf8d5('0x10'));var authService=require(_0xf8d5('0x11'));var qs=require(_0xf8d5('0x12'));var hardwareService=require(_0xf8d5('0x13'));var logger=require('../../config/logger')(_0xf8d5('0x14'));var utils=require(_0xf8d5('0x15'));var config=require(_0xf8d5('0x16'));var db=require(_0xf8d5('0x17'))['db'];function respondWithStatusCode(_0x593da6,_0x3eefbd){_0x3eefbd=_0x3eefbd||0xcc;return function(_0x23fcb9){if(_0x23fcb9){return _0x593da6[_0xf8d5('0x18')](_0x3eefbd);}return _0x593da6[_0xf8d5('0x19')](_0x3eefbd)[_0xf8d5('0x1a')]();};}function respondWithResult(_0x15d372,_0x1bb72e){_0x1bb72e=_0x1bb72e||0xc8;return function(_0x22a7f7){if(_0x22a7f7){return _0x15d372['status'](_0x1bb72e)['json'](_0x22a7f7);}};}function respondWithFilteredResult(_0x46cdcf,_0x520d21){return function(_0xf9e633){if(_0xf9e633){var _0x246d54=_0xf9e633[_0xf8d5('0x1b')],_0x3be5fe=_0x520d21[_0xf8d5('0x1c')],_0xe8677f=_0x520d21['offset']+_0x520d21[_0xf8d5('0x1d')],_0x2f5788;if(_0xe8677f>=_0x246d54){_0xe8677f=_0x246d54;_0x2f5788=0xc8;}else{_0x2f5788=0xce;}_0x46cdcf[_0xf8d5('0x19')](_0x2f5788);return _0x46cdcf['set'](_0xf8d5('0x1e'),_0x3be5fe+'-'+_0xe8677f+'/'+_0x246d54)['json'](_0xf9e633);}return null;};}function patchUpdates(_0x20b2a7){return function(_0x191fec){try{jsonpatch[_0xf8d5('0x1f')](_0x191fec,_0x20b2a7,!![]);}catch(_0x469402){return BPromise[_0xf8d5('0x20')](_0x469402);}return _0x191fec['save']();};}function saveUpdates(_0x328c0e,_0x375f05){return function(_0x2a9ad0){if(_0x2a9ad0){return _0x2a9ad0['update'](_0x328c0e)[_0xf8d5('0x21')](function(_0x459df0){return _0x459df0;});}return null;};}function removeEntity(_0x24d46,_0xac9f25){return function(_0x23b74d){if(_0x23b74d){return _0x23b74d['destroy']()[_0xf8d5('0x21')](function(){_0x24d46['status'](0xcc)[_0xf8d5('0x1a')]();});}};}function handleEntityNotFound(_0x1eb62c,_0x3b3594){return function(_0x52eece){if(!_0x52eece){_0x1eb62c[_0xf8d5('0x18')](0x194);}return _0x52eece;};}function handleError(_0x20852a,_0x383cb5){_0x383cb5=_0x383cb5||0x1f4;return function(_0x1e796d){logger[_0xf8d5('0x22')](_0x1e796d[_0xf8d5('0x23')]);if(_0x1e796d[_0xf8d5('0x24')]){delete _0x1e796d[_0xf8d5('0x24')];}_0x20852a['status'](_0x383cb5)['send'](_0x1e796d);};}exports[_0xf8d5('0x25')]=function(_0x1827f5,_0x6a37d5){var _0x11f889={},_0x47e998={},_0x4f0e56={'count':0x0,'rows':[]};var _0x2692dd=db['SquareRecording'][_0xf8d5('0x26')];_0x47e998[_0xf8d5('0x27')]=_[_0xf8d5('0x28')](_0x2692dd);_0x47e998[_0xf8d5('0x29')]=_[_0xf8d5('0x28')](_0x1827f5[_0xf8d5('0x29')]);_0x47e998[_0xf8d5('0x2a')]=_[_0xf8d5('0x2b')](_0x47e998[_0xf8d5('0x27')],_0x47e998[_0xf8d5('0x29')]);_0x11f889[_0xf8d5('0x2c')]=_['intersection'](_0x47e998['model'],qs[_0xf8d5('0x2d')](_0x1827f5[_0xf8d5('0x29')][_0xf8d5('0x2d')]));_0x11f889['attributes']=_0x11f889[_0xf8d5('0x2c')][_0xf8d5('0x2e')]?_0x11f889['attributes']:_0x47e998[_0xf8d5('0x27')];if(!_0x1827f5[_0xf8d5('0x29')][_0xf8d5('0x2f')](_0xf8d5('0x30'))){_0x11f889[_0xf8d5('0x1d')]=qs[_0xf8d5('0x1d')](_0x1827f5[_0xf8d5('0x29')][_0xf8d5('0x1d')]);_0x11f889[_0xf8d5('0x1c')]=qs[_0xf8d5('0x1c')](_0x1827f5[_0xf8d5('0x29')][_0xf8d5('0x1c')]);}_0x11f889[_0xf8d5('0x31')]=qs[_0xf8d5('0x32')](_0x1827f5[_0xf8d5('0x29')][_0xf8d5('0x32')]);_0x11f889[_0xf8d5('0x33')]=qs['filters'](_['pick'](_0x1827f5[_0xf8d5('0x29')],_0x47e998['filters']));if(_0x1827f5['query'][_0xf8d5('0x34')]){_0x11f889[_0xf8d5('0x33')]=_[_0xf8d5('0x35')](_0x11f889[_0xf8d5('0x33')],{'$or':_['map'](_0x2692dd,function(_0x192b47){if(_0x192b47[_0xf8d5('0x36')][_0xf8d5('0x37')]!==_0xf8d5('0x38')){var _0x5ec3c7={};_0x5ec3c7[_0x192b47[_0xf8d5('0x39')]]={'$like':'%'+_0x1827f5['query'][_0xf8d5('0x34')]+'%'};return _0x5ec3c7;}})});}_0x11f889=_['merge']({},_0x11f889,_0x1827f5[_0xf8d5('0x3a')]);var _0x41cd82={'where':_0x11f889[_0xf8d5('0x33')]};return db[_0xf8d5('0x3b')][_0xf8d5('0x1b')](_0x41cd82)[_0xf8d5('0x21')](function(_0x44d935){_0x4f0e56[_0xf8d5('0x1b')]=_0x44d935;if(_0x1827f5[_0xf8d5('0x29')][_0xf8d5('0x3c')]){_0x11f889[_0xf8d5('0x3d')]=[{'all':!![]}];}return db[_0xf8d5('0x3b')][_0xf8d5('0x3e')](_0x11f889);})[_0xf8d5('0x21')](function(_0x1f71a7){_0x4f0e56['rows']=_0x1f71a7;return _0x4f0e56;})['then'](respondWithFilteredResult(_0x6a37d5,_0x11f889))[_0xf8d5('0x3f')](handleError(_0x6a37d5,null));};exports[_0xf8d5('0x40')]=function(_0x2ff3d2,_0x24657a){var _0x329612={'raw':!![],'where':{'id':_0x2ff3d2[_0xf8d5('0x41')]['id']}},_0xaf6c93={};_0xaf6c93[_0xf8d5('0x27')]=_[_0xf8d5('0x28')](db['SquareRecording'][_0xf8d5('0x26')]);_0xaf6c93[_0xf8d5('0x29')]=_['keys'](_0x2ff3d2['query']);_0xaf6c93['filters']=_[_0xf8d5('0x2b')](_0xaf6c93[_0xf8d5('0x27')],_0xaf6c93[_0xf8d5('0x29')]);_0x329612[_0xf8d5('0x2c')]=_[_0xf8d5('0x2b')](_0xaf6c93[_0xf8d5('0x27')],qs[_0xf8d5('0x2d')](_0x2ff3d2[_0xf8d5('0x29')][_0xf8d5('0x2d')]));_0x329612[_0xf8d5('0x2c')]=_0x329612[_0xf8d5('0x2c')][_0xf8d5('0x2e')]?_0x329612[_0xf8d5('0x2c')]:_0xaf6c93[_0xf8d5('0x27')];if(_0x2ff3d2[_0xf8d5('0x29')][_0xf8d5('0x3c')]){_0x329612[_0xf8d5('0x3d')]=[{'all':!![]}];}_0x329612=_[_0xf8d5('0x35')]({},_0x329612,_0x2ff3d2['options']);return db[_0xf8d5('0x3b')]['find'](_0x329612)[_0xf8d5('0x21')](handleEntityNotFound(_0x24657a,null))[_0xf8d5('0x21')](respondWithResult(_0x24657a,null))[_0xf8d5('0x3f')](handleError(_0x24657a,null));};exports[_0xf8d5('0x42')]=function(_0x26fedd,_0x4af092){return db['SquareRecording']['create'](_0x26fedd[_0xf8d5('0x43')],{})[_0xf8d5('0x21')](respondWithResult(_0x4af092,0xc9))[_0xf8d5('0x3f')](handleError(_0x4af092,null));};exports[_0xf8d5('0x44')]=function(_0x3501f,_0x13b6a5){if(_0x3501f[_0xf8d5('0x43')]['id']){delete _0x3501f['body']['id'];}return db['SquareRecording'][_0xf8d5('0x45')]({'where':{'id':_0x3501f[_0xf8d5('0x41')]['id']}})[_0xf8d5('0x21')](handleEntityNotFound(_0x13b6a5,null))[_0xf8d5('0x21')](saveUpdates(_0x3501f[_0xf8d5('0x43')],null))['then'](respondWithResult(_0x13b6a5,null))[_0xf8d5('0x3f')](handleError(_0x13b6a5,null));};exports[_0xf8d5('0x46')]=function(_0x44310c,_0x120309){return db[_0xf8d5('0x3b')]['find']({'where':{'id':_0x44310c[_0xf8d5('0x41')]['id']}})['then'](handleEntityNotFound(_0x120309,null))[_0xf8d5('0x21')](removeEntity(_0x120309,null))['catch'](handleError(_0x120309,null));};exports['download']=function(_0x28101f,_0xa6ce1c,_0x3c23ec){var _0x326243=require(_0xf8d5('0x47'));var _0x8f1c35=![];var _0xf6ce30={};if(_0x28101f[_0xf8d5('0x29')][_0xf8d5('0x36')]&&_0x28101f[_0xf8d5('0x29')][_0xf8d5('0x36')]===_0xf8d5('0x48')){_0xf6ce30[_0xf8d5('0x48')]=_0x28101f[_0xf8d5('0x41')]['id'];}else{_0xf6ce30['id']=_0x28101f['params']['id'];}return db[_0xf8d5('0x3b')]['find']({'where':_0xf6ce30,'attributes':['id',_0xf8d5('0x49'),'filename'],'raw':!![]})[_0xf8d5('0x21')](handleEntityNotFound(_0xa6ce1c,null))[_0xf8d5('0x21')](function(_0x102be8){if(_0x102be8){var _0x20e4d2=_0x102be8[_0xf8d5('0x49')];var _0x369e93=util[_0xf8d5('0x4a')]('%s.cypher',_0x20e4d2);if(fs[_0xf8d5('0x4b')](_0x369e93)){_0x8f1c35=!![];return _0x326243[_0xf8d5('0x4c')](_0x369e93,_0x20e4d2,config[_0xf8d5('0x4d')][_0xf8d5('0x4e')])[_0xf8d5('0x21')](function(){return _0x102be8;});}return _0x102be8;}})[_0xf8d5('0x21')](function(_0x508e8b){if(_0x508e8b){var _0x5d2809=_0x508e8b[_0xf8d5('0x49')];if(!fs[_0xf8d5('0x4b')](_0x5d2809)){throw new db['Sequelize'][(_0xf8d5('0x4f'))](_0xf8d5('0x50'));}if(_0x508e8b[_0xf8d5('0x51')]){return _0xa6ce1c[_0xf8d5('0x52')](_0x5d2809,_0x508e8b[_0xf8d5('0x51')]+path[_0xf8d5('0x53')](_0x5d2809),function(){if(_0x8f1c35){fs[_0xf8d5('0x54')](_0x5d2809);}});}else{return _0xa6ce1c[_0xf8d5('0x52')](_0x5d2809,function(_0x502ac5){if(_0x8f1c35){fs['unlink'](_0x5d2809);}});}}})[_0xf8d5('0x3f')](function(_0x41f1d5){if(_0x41f1d5['message']===_0xf8d5('0x50')){_0xa6ce1c[_0xf8d5('0x19')](0x194)[_0xf8d5('0x55')](_0xf8d5('0x56'));}else{return handleError(_0xa6ce1c,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 5fa2631..de05e3f 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 _0x64d4=['rimraf','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1d3554,_0x4be5e6){var _0x5b8f5e=function(_0x29271b){while(--_0x29271b){_0x1d3554['push'](_0x1d3554['shift']());}};_0x5b8f5e(++_0x4be5e6);}(_0x64d4,0xa2));var _0x464d=function(_0x4efc03,_0x4c17a8){_0x4efc03=_0x4efc03-0x0;var _0x40f091=_0x64d4[_0x4efc03];return _0x40f091;};'use strict';var _=require('lodash');var util=require(_0x464d('0x0'));var logger=require(_0x464d('0x1'))('api');var moment=require(_0x464d('0x2'));var BPromise=require(_0x464d('0x3'));var rp=require(_0x464d('0x4'));var fs=require('fs');var path=require(_0x464d('0x5'));var rimraf=require(_0x464d('0x6'));var config=require('../../config/environment');var attributes=require(_0x464d('0x7'));module[_0x464d('0x8')]=function(_0x159304,_0x8e4488){return _0x159304[_0x464d('0x9')](_0x464d('0xa'),attributes,{'tableName':_0x464d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d86=['rimraf','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','path'];(function(_0xbd4737,_0x374f57){var _0x4d7729=function(_0xda4d34){while(--_0xda4d34){_0xbd4737['push'](_0xbd4737['shift']());}};_0x4d7729(++_0x374f57);}(_0x6d86,0x171));var _0x66d8=function(_0x594bf8,_0x5b0e2e){_0x594bf8=_0x594bf8-0x0;var _0x8430c8=_0x6d86[_0x594bf8];return _0x8430c8;};'use strict';var _=require(_0x66d8('0x0'));var util=require(_0x66d8('0x1'));var logger=require(_0x66d8('0x2'))(_0x66d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x66d8('0x4'));var rimraf=require(_0x66d8('0x5'));var config=require('../../config/environment');var attributes=require(_0x66d8('0x6'));module[_0x66d8('0x7')]=function(_0x2eabf3,_0xa5ecb1){return _0x2eabf3[_0x66d8('0x8')](_0x66d8('0x9'),attributes,{'tableName':_0x66d8('0xa'),'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 a50e407..37ba503 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 _0x891c=['stringify','error','message','result','catch','CreateSquareRecording','SquareRecording','create','body','raw','info','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x891c,0x77));var _0xc891=function(_0xe5e892,_0x15e147){_0xe5e892=_0xe5e892-0x0;var _0x525d3c=_0x891c[_0xe5e892];return _0x525d3c;};'use strict';var _=require(_0xc891('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc891('0x1'));var rs=require(_0xc891('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc891('0x3'))['db'];var utils=require(_0xc891('0x4'));var logger=require(_0xc891('0x5'))(_0xc891('0x6'));var config=require(_0xc891('0x7'));var jayson=require(_0xc891('0x8'));var client=jayson[_0xc891('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3808c2,_0x212894,_0x2e90f8){return new BPromise(function(_0x559ad1,_0x4258a6){return client[_0xc891('0xa')](_0x3808c2,_0x2e90f8)[_0xc891('0xb')](function(_0x5a39dd){logger['info'](_0xc891('0xc'),_0x212894,_0xc891('0xd'));logger[_0xc891('0xe')](_0xc891('0xf'),_0x212894,_0xc891('0xd'),JSON[_0xc891('0x10')](_0x5a39dd));if(_0x5a39dd[_0xc891('0x11')]){if(_0x5a39dd['error']['code']===0x1f4){logger[_0xc891('0x11')](_0xc891('0xc'),_0x212894,_0x5a39dd[_0xc891('0x11')][_0xc891('0x12')]);return _0x4258a6(_0x5a39dd['error']['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x212894,_0x5a39dd[_0xc891('0x11')][_0xc891('0x12')]);return _0x559ad1(_0x5a39dd[_0xc891('0x11')][_0xc891('0x12')]);}else{logger['info'](_0xc891('0xc'),_0x212894,'request\x20sent');_0x559ad1(_0x5a39dd[_0xc891('0x13')][_0xc891('0x12')]);}})[_0xc891('0x14')](function(_0x4f91ab){logger[_0xc891('0x11')](_0xc891('0xc'),_0x212894,_0x4f91ab);_0x4258a6(_0x4f91ab);});});}exports[_0xc891('0x15')]=function(_0x510006){var _0x5ed058=this;return new Promise(function(_0x2571f0,_0x2e9d6f){return db[_0xc891('0x16')][_0xc891('0x17')](_0x510006[_0xc891('0x18')],{'raw':_0x510006['options']?_0x510006['options'][_0xc891('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1e81a2){logger[_0xc891('0x1a')](_0xc891('0x15'),_0x510006);logger['debug'](_0xc891('0x15'),_0x510006,JSON[_0xc891('0x10')](_0x1e81a2));_0x2571f0(_0x1e81a2);})[_0xc891('0x14')](function(_0x262a49){logger['error']('CreateSquareRecording',_0x262a49[_0xc891('0x12')],_0x510006);_0x2e9d6f(_0x5ed058[_0xc891('0x11')](0x1f4,_0x262a49[_0xc891('0x12')]));});});}; \ No newline at end of file +var _0x9a45=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','error','code','message','CreateSquareRecording','SquareRecording','body','options','raw','stringify','catch'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9a45,0x11e));var _0x59a4=function(_0x3a259d,_0x313102){_0x3a259d=_0x3a259d-0x0;var _0x2e03e6=_0x9a45[_0x3a259d];return _0x2e03e6;};'use strict';var _=require(_0x59a4('0x0'));var util=require(_0x59a4('0x1'));var moment=require(_0x59a4('0x2'));var BPromise=require(_0x59a4('0x3'));var rs=require(_0x59a4('0x4'));var fs=require('fs');var Redis=require(_0x59a4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x59a4('0x6'));var logger=require(_0x59a4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x59a4('0x8'));var client=jayson['client'][_0x59a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8212,_0x55e940,_0x40f88a){return new BPromise(function(_0x298fa0,_0x386909){return client[_0x59a4('0xa')](_0x5c8212,_0x40f88a)[_0x59a4('0xb')](function(_0x51d4ae){logger[_0x59a4('0xc')](_0x59a4('0xd'),_0x55e940,'request\x20sent');logger[_0x59a4('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x55e940,_0x59a4('0xf'),JSON['stringify'](_0x51d4ae));if(_0x51d4ae[_0x59a4('0x10')]){if(_0x51d4ae[_0x59a4('0x10')][_0x59a4('0x11')]===0x1f4){logger['error'](_0x59a4('0xd'),_0x55e940,_0x51d4ae[_0x59a4('0x10')][_0x59a4('0x12')]);return _0x386909(_0x51d4ae[_0x59a4('0x10')]['message']);}logger['error'](_0x59a4('0xd'),_0x55e940,_0x51d4ae[_0x59a4('0x10')][_0x59a4('0x12')]);return _0x298fa0(_0x51d4ae[_0x59a4('0x10')][_0x59a4('0x12')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x55e940,_0x59a4('0xf'));_0x298fa0(_0x51d4ae['result'][_0x59a4('0x12')]);}})['catch'](function(_0x375af9){logger[_0x59a4('0x10')](_0x59a4('0xd'),_0x55e940,_0x375af9);_0x386909(_0x375af9);});});}exports[_0x59a4('0x13')]=function(_0x49d4bc){var _0x2c88a0=this;return new Promise(function(_0xdb8d52,_0x338533){return db[_0x59a4('0x14')]['create'](_0x49d4bc[_0x59a4('0x15')],{'raw':_0x49d4bc[_0x59a4('0x16')]?_0x49d4bc['options'][_0x59a4('0x17')]===undefined?!![]:![]:!![]})[_0x59a4('0xb')](function(_0x1ab3be){logger[_0x59a4('0xc')]('CreateSquareRecording',_0x49d4bc);logger['debug']('CreateSquareRecording',_0x49d4bc,JSON[_0x59a4('0x18')](_0x1ab3be));_0xdb8d52(_0x1ab3be);})[_0x59a4('0x19')](function(_0x64154a){logger['error'](_0x59a4('0x13'),_0x64154a[_0x59a4('0x12')],_0x49d4bc);_0x338533(_0x2c88a0[_0x59a4('0x10')](0x1f4,_0x64154a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 5766ef0..5360b60 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 _0x2666=['isAuthenticated','/describe','describe','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2666,0xe6));var _0x6266=function(_0x1fd5ae,_0x1cd96c){_0x1fd5ae=_0x1fd5ae-0x0;var _0x5173a5=_0x2666[_0x1fd5ae];return _0x5173a5;};'use strict';var multer=require(_0x6266('0x0'));var util=require(_0x6266('0x1'));var path=require(_0x6266('0x2'));var timeout=require(_0x6266('0x3'));var express=require(_0x6266('0x4'));var router=express['Router']();var auth=require(_0x6266('0x5'));var interaction=require(_0x6266('0x6'));var config=require(_0x6266('0x7'));var controller=require(_0x6266('0x8'));router[_0x6266('0x9')]('/',auth[_0x6266('0xa')](),controller['index']);router[_0x6266('0x9')](_0x6266('0xb'),auth[_0x6266('0xa')](),controller[_0x6266('0xc')]);router[_0x6266('0x9')]('/:id',auth[_0x6266('0xa')](),controller[_0x6266('0xd')]);router[_0x6266('0xe')]('/',auth['isAuthenticated'](),controller[_0x6266('0xf')]);router['put'](_0x6266('0x10'),auth[_0x6266('0xa')](),controller[_0x6266('0x11')]);router[_0x6266('0x12')](_0x6266('0x10'),auth['isAuthenticated'](),controller[_0x6266('0x13')]);module['exports']=router; \ No newline at end of file +var _0x35d3=['index','describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./squareReport.controller','get','isAuthenticated'];(function(_0x541a7d,_0xbfbb8d){var _0x3c7f70=function(_0x3a887b){while(--_0x3a887b){_0x541a7d['push'](_0x541a7d['shift']());}};_0x3c7f70(++_0xbfbb8d);}(_0x35d3,0x99));var _0x335d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35d3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x335d('0x0'));var util=require(_0x335d('0x1'));var path=require('path');var timeout=require(_0x335d('0x2'));var express=require(_0x335d('0x3'));var router=express[_0x335d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x335d('0x5'));var config=require('../../config/environment');var controller=require(_0x335d('0x6'));router[_0x335d('0x7')]('/',auth[_0x335d('0x8')](),controller[_0x335d('0x9')]);router[_0x335d('0x7')]('/describe',auth[_0x335d('0x8')](),controller[_0x335d('0xa')]);router[_0x335d('0x7')](_0x335d('0xb'),auth['isAuthenticated'](),controller[_0x335d('0xc')]);router['post']('/',auth[_0x335d('0x8')](),controller['create']);router[_0x335d('0xd')](_0x335d('0xb'),auth[_0x335d('0x8')](),controller[_0x335d('0xe')]);router[_0x335d('0xf')](_0x335d('0xb'),auth['isAuthenticated'](),controller[_0x335d('0x10')]);module[_0x335d('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9f60031..919d758 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 _0xf9bc=['exports','STRING','DATE'];(function(_0x2a89a1,_0x36fecc){var _0x49f6d8=function(_0x3d93fe){while(--_0x3d93fe){_0x2a89a1['push'](_0x2a89a1['shift']());}};_0x49f6d8(++_0x36fecc);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x487c07,_0x103d4e){_0x487c07=_0x487c07-0x0;var _0x7a4a89=_0xf9bc[_0x487c07];return _0x7a4a89;};'use strict';var Sequelize=require('sequelize');module[_0xcf9b('0x0')]={'network':{'type':Sequelize[_0xcf9b('0x1')]},'network_script':{'type':Sequelize[_0xcf9b('0x1')]},'request':{'type':Sequelize[_0xcf9b('0x1')]},'channel':{'type':Sequelize[_0xcf9b('0x1')]},'language':{'type':Sequelize[_0xcf9b('0x1')]},'type':{'type':Sequelize[_0xcf9b('0x1')]},'uniqueid':{'type':Sequelize[_0xcf9b('0x1')]},'version':{'type':Sequelize[_0xcf9b('0x1')]},'callerid':{'type':Sequelize[_0xcf9b('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xcf9b('0x1')]},'callington':{'type':Sequelize[_0xcf9b('0x1')]},'callingtns':{'type':Sequelize[_0xcf9b('0x1')]},'dnid':{'type':Sequelize[_0xcf9b('0x1')]},'rdnis':{'type':Sequelize[_0xcf9b('0x1')]},'context':{'type':Sequelize[_0xcf9b('0x1')]},'extension':{'type':Sequelize[_0xcf9b('0x1')]},'priority':{'type':Sequelize[_0xcf9b('0x1')]},'enhanced':{'type':Sequelize[_0xcf9b('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xcf9b('0x1')]},'project_name':{'type':Sequelize[_0xcf9b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xcf9b('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8fed=['DATE','BOOLEAN','STRING'];(function(_0x5be61a,_0x20918f){var _0x414b21=function(_0x54cae8){while(--_0x54cae8){_0x5be61a['push'](_0x5be61a['shift']());}};_0x414b21(++_0x20918f);}(_0x8fed,0xf5));var _0xd8fe=function(_0x554d81,_0xbd190f){_0x554d81=_0x554d81-0x0;var _0xfb6371=_0x8fed[_0x554d81];return _0xfb6371;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0xd8fe('0x0')]},'network_script':{'type':Sequelize[_0xd8fe('0x0')]},'request':{'type':Sequelize[_0xd8fe('0x0')]},'channel':{'type':Sequelize[_0xd8fe('0x0')]},'language':{'type':Sequelize[_0xd8fe('0x0')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd8fe('0x0')]},'version':{'type':Sequelize[_0xd8fe('0x0')]},'callerid':{'type':Sequelize[_0xd8fe('0x0')]},'calleridname':{'type':Sequelize[_0xd8fe('0x0')]},'callingpres':{'type':Sequelize[_0xd8fe('0x0')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xd8fe('0x0')]},'callingtns':{'type':Sequelize[_0xd8fe('0x0')]},'dnid':{'type':Sequelize[_0xd8fe('0x0')]},'rdnis':{'type':Sequelize[_0xd8fe('0x0')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xd8fe('0x0')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xd8fe('0x0')]},'accountcode':{'type':Sequelize[_0xd8fe('0x0')]},'threadid':{'type':Sequelize[_0xd8fe('0x0')]},'project_name':{'type':Sequelize[_0xd8fe('0x0')]},'joinAt':{'type':Sequelize[_0xd8fe('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xd8fe('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 5aaa1e0..1908350 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 _0x008e=['includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','SquareReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','field'];(function(_0x5ab7e6,_0x188f7b){var _0x48ac13=function(_0x7ac56b){while(--_0x7ac56b){_0x5ab7e6['push'](_0x5ab7e6['shift']());}};_0x48ac13(++_0x188f7b);}(_0x008e,0x1b6));var _0xe008=function(_0x3b1f0b,_0x6a7832){_0x3b1f0b=_0x3b1f0b-0x0;var _0x577dd8=_0x008e[_0x3b1f0b];return _0x577dd8;};'use strict';var pdf=require(_0xe008('0x0'));var emlformat=require(_0xe008('0x1'));var rimraf=require(_0xe008('0x2'));var zipdir=require(_0xe008('0x3'));var jsonpatch=require(_0xe008('0x4'));var rp=require(_0xe008('0x5'));var moment=require(_0xe008('0x6'));var BPromise=require(_0xe008('0x7'));var Mustache=require(_0xe008('0x8'));var util=require(_0xe008('0x9'));var path=require(_0xe008('0xa'));var sox=require(_0xe008('0xb'));var csv=require(_0xe008('0xc'));var ejs=require(_0xe008('0xd'));var fs=require('fs');var _=require(_0xe008('0xe'));var squel=require(_0xe008('0xf'));var crypto=require(_0xe008('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xe008('0x11'));var toCsv=require(_0xe008('0xc'));var querystring=require(_0xe008('0x12'));var Papa=require('papaparse');var Redis=require(_0xe008('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe008('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe008('0x15'));var config=require('../../config/environment');var db=require(_0xe008('0x16'))['db'];function respondWithStatusCode(_0x347cd6,_0x5aa228){_0x5aa228=_0x5aa228||0xcc;return function(_0x3fad17){if(_0x3fad17){return _0x347cd6[_0xe008('0x17')](_0x5aa228);}return _0x347cd6[_0xe008('0x18')](_0x5aa228)['end']();};}function respondWithResult(_0x1be4d8,_0x301c85){_0x301c85=_0x301c85||0xc8;return function(_0x5dd220){if(_0x5dd220){return _0x1be4d8[_0xe008('0x18')](_0x301c85)[_0xe008('0x19')](_0x5dd220);}};}function respondWithFilteredResult(_0x58843c,_0x45e0a0){return function(_0x2623c9){if(_0x2623c9){var _0x231ba4=_0x2623c9[_0xe008('0x1a')],_0x285b0e=_0x45e0a0[_0xe008('0x1b')],_0x4b8de2=_0x45e0a0[_0xe008('0x1b')]+_0x45e0a0[_0xe008('0x1c')],_0x2c0ec4;if(_0x4b8de2>=_0x231ba4){_0x4b8de2=_0x231ba4;_0x2c0ec4=0xc8;}else{_0x2c0ec4=0xce;}_0x58843c[_0xe008('0x18')](_0x2c0ec4);return _0x58843c[_0xe008('0x1d')](_0xe008('0x1e'),_0x285b0e+'-'+_0x4b8de2+'/'+_0x231ba4)[_0xe008('0x19')](_0x2623c9);}return null;};}function patchUpdates(_0x41f5cd){return function(_0x3a676a){try{jsonpatch[_0xe008('0x1f')](_0x3a676a,_0x41f5cd,!![]);}catch(_0x25eb5b){return BPromise[_0xe008('0x20')](_0x25eb5b);}return _0x3a676a[_0xe008('0x21')]();};}function saveUpdates(_0x5a3f30,_0x3de516){return function(_0x5668c7){if(_0x5668c7){return _0x5668c7['update'](_0x5a3f30)[_0xe008('0x22')](function(_0x6fc2a4){return _0x6fc2a4;});}return null;};}function removeEntity(_0x2a6d62,_0x281ff1){return function(_0x21a956){if(_0x21a956){return _0x21a956[_0xe008('0x23')]()[_0xe008('0x22')](function(){_0x2a6d62['status'](0xcc)[_0xe008('0x24')]();});}};}function handleEntityNotFound(_0x405f5d,_0x357e3f){return function(_0x40eb38){if(!_0x40eb38){_0x405f5d[_0xe008('0x17')](0x194);}return _0x40eb38;};}function handleError(_0x5ebcfb,_0x3a3fba){_0x3a3fba=_0x3a3fba||0x1f4;return function(_0x3d4421){logger['error'](_0x3d4421['stack']);if(_0x3d4421['name']){delete _0x3d4421[_0xe008('0x25')];}_0x5ebcfb[_0xe008('0x18')](_0x3a3fba)[_0xe008('0x26')](_0x3d4421);};}exports[_0xe008('0x27')]=function(_0x42e69d,_0x2d35f7){var _0x55fee0={},_0x2cec7b={},_0x37003c={'count':0x0,'rows':[]};var _0x7974fd=db[_0xe008('0x28')][_0xe008('0x29')];_0x2cec7b[_0xe008('0x2a')]=_[_0xe008('0x2b')](_0x7974fd);_0x2cec7b[_0xe008('0x2c')]=_[_0xe008('0x2b')](_0x42e69d['query']);_0x2cec7b[_0xe008('0x2d')]=_['intersection'](_0x2cec7b[_0xe008('0x2a')],_0x2cec7b[_0xe008('0x2c')]);_0x55fee0[_0xe008('0x2e')]=_[_0xe008('0x2f')](_0x2cec7b['model'],qs['fields'](_0x42e69d[_0xe008('0x2c')][_0xe008('0x30')]));_0x55fee0[_0xe008('0x2e')]=_0x55fee0[_0xe008('0x2e')][_0xe008('0x31')]?_0x55fee0[_0xe008('0x2e')]:_0x2cec7b[_0xe008('0x2a')];if(!_0x42e69d['query'][_0xe008('0x32')]('nolimit')){_0x55fee0[_0xe008('0x1c')]=qs['limit'](_0x42e69d[_0xe008('0x2c')]['limit']);_0x55fee0[_0xe008('0x1b')]=qs[_0xe008('0x1b')](_0x42e69d['query']['offset']);}_0x55fee0[_0xe008('0x33')]=qs[_0xe008('0x34')](_0x42e69d['query']['sort']);_0x55fee0[_0xe008('0x35')]=qs[_0xe008('0x2d')](_['pick'](_0x42e69d[_0xe008('0x2c')],_0x2cec7b['filters']));if(_0x42e69d[_0xe008('0x2c')][_0xe008('0x36')]){_0x55fee0[_0xe008('0x35')]=_[_0xe008('0x37')](_0x55fee0[_0xe008('0x35')],{'$or':_[_0xe008('0x38')](_0x7974fd,function(_0x2a6354){if(_0x2a6354[_0xe008('0x39')]['key']!=='VIRTUAL'){var _0xaad74f={};_0xaad74f[_0x2a6354[_0xe008('0x3a')]]={'$like':'%'+_0x42e69d['query'][_0xe008('0x36')]+'%'};return _0xaad74f;}})});}_0x55fee0=_[_0xe008('0x37')]({},_0x55fee0,_0x42e69d['options']);var _0xe41d2d={'where':_0x55fee0[_0xe008('0x35')]};return db[_0xe008('0x28')][_0xe008('0x1a')](_0xe41d2d)[_0xe008('0x22')](function(_0xc1808f){_0x37003c[_0xe008('0x1a')]=_0xc1808f;if(_0x42e69d[_0xe008('0x2c')][_0xe008('0x3b')]){_0x55fee0[_0xe008('0x3c')]=[{'all':!![]}];}return db[_0xe008('0x28')][_0xe008('0x3d')](_0x55fee0);})[_0xe008('0x22')](function(_0x76febe){_0x37003c[_0xe008('0x3e')]=_0x76febe;return _0x37003c;})[_0xe008('0x22')](respondWithFilteredResult(_0x2d35f7,_0x55fee0))[_0xe008('0x3f')](handleError(_0x2d35f7,null));};exports[_0xe008('0x40')]=function(_0x171537,_0x1a2ead){var _0xcc23e9={'raw':!![],'where':{'id':_0x171537[_0xe008('0x41')]['id']}},_0x11a976={};_0x11a976[_0xe008('0x2a')]=_[_0xe008('0x2b')](db['SquareReport']['rawAttributes']);_0x11a976[_0xe008('0x2c')]=_[_0xe008('0x2b')](_0x171537[_0xe008('0x2c')]);_0x11a976['filters']=_['intersection'](_0x11a976['model'],_0x11a976[_0xe008('0x2c')]);_0xcc23e9['attributes']=_[_0xe008('0x2f')](_0x11a976[_0xe008('0x2a')],qs[_0xe008('0x30')](_0x171537[_0xe008('0x2c')][_0xe008('0x30')]));_0xcc23e9[_0xe008('0x2e')]=_0xcc23e9['attributes'][_0xe008('0x31')]?_0xcc23e9[_0xe008('0x2e')]:_0x11a976[_0xe008('0x2a')];if(_0x171537['query'][_0xe008('0x3b')]){_0xcc23e9['include']=[{'all':!![]}];}_0xcc23e9=_[_0xe008('0x37')]({},_0xcc23e9,_0x171537['options']);return db[_0xe008('0x28')][_0xe008('0x42')](_0xcc23e9)[_0xe008('0x22')](handleEntityNotFound(_0x1a2ead,null))[_0xe008('0x22')](respondWithResult(_0x1a2ead,null))['catch'](handleError(_0x1a2ead,null));};exports[_0xe008('0x43')]=function(_0x96a780,_0x10536a){return db['SquareReport'][_0xe008('0x43')](_0x96a780[_0xe008('0x44')],{})[_0xe008('0x22')](respondWithResult(_0x10536a,0xc9))[_0xe008('0x3f')](handleError(_0x10536a,null));};exports[_0xe008('0x45')]=function(_0x5e7dd2,_0x53244d){if(_0x5e7dd2[_0xe008('0x44')]['id']){delete _0x5e7dd2[_0xe008('0x44')]['id'];}return db['SquareReport'][_0xe008('0x42')]({'where':{'id':_0x5e7dd2[_0xe008('0x41')]['id']}})[_0xe008('0x22')](handleEntityNotFound(_0x53244d,null))[_0xe008('0x22')](saveUpdates(_0x5e7dd2[_0xe008('0x44')],null))[_0xe008('0x22')](respondWithResult(_0x53244d,null))[_0xe008('0x3f')](handleError(_0x53244d,null));};exports[_0xe008('0x23')]=function(_0x3c9f3d,_0x170395){return db['SquareReport'][_0xe008('0x42')]({'where':{'id':_0x3c9f3d[_0xe008('0x41')]['id']}})['then'](handleEntityNotFound(_0x170395,null))[_0xe008('0x22')](removeEntity(_0x170395,null))[_0xe008('0x3f')](handleError(_0x170395,null));};exports[_0xe008('0x46')]=function(_0xf48ff3,_0x53f974){return db['SquareReport'][_0xe008('0x46')]()[_0xe008('0x22')](respondWithResult(_0x53f974,null))[_0xe008('0x3f')](handleError(_0x53f974,null));}; \ No newline at end of file +var _0xce67=['set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','SquareReport','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','rawAttributes','fields','length','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit'];(function(_0x1976e3,_0x5a8367){var _0x3e4880=function(_0x535873){while(--_0x535873){_0x1976e3['push'](_0x1976e3['shift']());}};_0x3e4880(++_0x5a8367);}(_0xce67,0x1c8));var _0x7ce6=function(_0x5cc64b,_0xd2c45c){_0x5cc64b=_0x5cc64b-0x0;var _0x11e265=_0xce67[_0x5cc64b];return _0x11e265;};'use strict';var pdf=require(_0x7ce6('0x0'));var emlformat=require(_0x7ce6('0x1'));var rimraf=require(_0x7ce6('0x2'));var zipdir=require(_0x7ce6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ce6('0x4'));var moment=require('moment');var BPromise=require(_0x7ce6('0x5'));var Mustache=require(_0x7ce6('0x6'));var util=require(_0x7ce6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7ce6('0x8'));var ejs=require(_0x7ce6('0x9'));var fs=require('fs');var _=require(_0x7ce6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7ce6('0xb'));var toCsv=require(_0x7ce6('0x8'));var querystring=require(_0x7ce6('0xc'));var Papa=require(_0x7ce6('0xd'));var Redis=require(_0x7ce6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7ce6('0xf'));var hardwareService=require(_0x7ce6('0x10'));var logger=require(_0x7ce6('0x11'))(_0x7ce6('0x12'));var utils=require(_0x7ce6('0x13'));var config=require('../../config/environment');var db=require(_0x7ce6('0x14'))['db'];function respondWithStatusCode(_0x34f143,_0x34b05e){_0x34b05e=_0x34b05e||0xcc;return function(_0x4d4ae9){if(_0x4d4ae9){return _0x34f143['sendStatus'](_0x34b05e);}return _0x34f143[_0x7ce6('0x15')](_0x34b05e)[_0x7ce6('0x16')]();};}function respondWithResult(_0x28250a,_0x3ae13e){_0x3ae13e=_0x3ae13e||0xc8;return function(_0x5b3946){if(_0x5b3946){return _0x28250a['status'](_0x3ae13e)[_0x7ce6('0x17')](_0x5b3946);}};}function respondWithFilteredResult(_0x3fc5f6,_0x41a1e1){return function(_0x18b63c){if(_0x18b63c){var _0x2f5158=_0x18b63c[_0x7ce6('0x18')],_0x1cbc4a=_0x41a1e1[_0x7ce6('0x19')],_0x2890de=_0x41a1e1[_0x7ce6('0x19')]+_0x41a1e1[_0x7ce6('0x1a')],_0x17505d;if(_0x2890de>=_0x2f5158){_0x2890de=_0x2f5158;_0x17505d=0xc8;}else{_0x17505d=0xce;}_0x3fc5f6[_0x7ce6('0x15')](_0x17505d);return _0x3fc5f6[_0x7ce6('0x1b')](_0x7ce6('0x1c'),_0x1cbc4a+'-'+_0x2890de+'/'+_0x2f5158)[_0x7ce6('0x17')](_0x18b63c);}return null;};}function patchUpdates(_0x4f30b7){return function(_0x5ab8bf){try{jsonpatch[_0x7ce6('0x1d')](_0x5ab8bf,_0x4f30b7,!![]);}catch(_0xa73604){return BPromise[_0x7ce6('0x1e')](_0xa73604);}return _0x5ab8bf[_0x7ce6('0x1f')]();};}function saveUpdates(_0x18d3ff,_0x5e8ac1){return function(_0x1266f7){if(_0x1266f7){return _0x1266f7[_0x7ce6('0x20')](_0x18d3ff)[_0x7ce6('0x21')](function(_0x5e936b){return _0x5e936b;});}return null;};}function removeEntity(_0x2fb700,_0x4ee49a){return function(_0x5b1b7f){if(_0x5b1b7f){return _0x5b1b7f['destroy']()['then'](function(){_0x2fb700[_0x7ce6('0x15')](0xcc)[_0x7ce6('0x16')]();});}};}function handleEntityNotFound(_0x18c92b,_0x10bb21){return function(_0x5e4cbd){if(!_0x5e4cbd){_0x18c92b[_0x7ce6('0x22')](0x194);}return _0x5e4cbd;};}function handleError(_0x2ff99d,_0x4cdd7f){_0x4cdd7f=_0x4cdd7f||0x1f4;return function(_0x1c38f1){logger[_0x7ce6('0x23')](_0x1c38f1[_0x7ce6('0x24')]);if(_0x1c38f1['name']){delete _0x1c38f1[_0x7ce6('0x25')];}_0x2ff99d[_0x7ce6('0x15')](_0x4cdd7f)['send'](_0x1c38f1);};}exports['index']=function(_0xb9d892,_0x1f8999){var _0xad4cf3={},_0x92d368={},_0xcb86fe={'count':0x0,'rows':[]};var _0x170439=db[_0x7ce6('0x26')]['rawAttributes'];_0x92d368[_0x7ce6('0x27')]=_[_0x7ce6('0x28')](_0x170439);_0x92d368[_0x7ce6('0x29')]=_[_0x7ce6('0x28')](_0xb9d892[_0x7ce6('0x29')]);_0x92d368[_0x7ce6('0x2a')]=_[_0x7ce6('0x2b')](_0x92d368['model'],_0x92d368[_0x7ce6('0x29')]);_0xad4cf3['attributes']=_['intersection'](_0x92d368[_0x7ce6('0x27')],qs['fields'](_0xb9d892[_0x7ce6('0x29')]['fields']));_0xad4cf3['attributes']=_0xad4cf3[_0x7ce6('0x2c')]['length']?_0xad4cf3['attributes']:_0x92d368['model'];if(!_0xb9d892[_0x7ce6('0x29')][_0x7ce6('0x2d')](_0x7ce6('0x2e'))){_0xad4cf3[_0x7ce6('0x1a')]=qs['limit'](_0xb9d892[_0x7ce6('0x29')][_0x7ce6('0x1a')]);_0xad4cf3[_0x7ce6('0x19')]=qs[_0x7ce6('0x19')](_0xb9d892[_0x7ce6('0x29')]['offset']);}_0xad4cf3[_0x7ce6('0x2f')]=qs['sort'](_0xb9d892['query']['sort']);_0xad4cf3[_0x7ce6('0x30')]=qs[_0x7ce6('0x2a')](_['pick'](_0xb9d892[_0x7ce6('0x29')],_0x92d368[_0x7ce6('0x2a')]));if(_0xb9d892[_0x7ce6('0x29')][_0x7ce6('0x31')]){_0xad4cf3['where']=_[_0x7ce6('0x32')](_0xad4cf3['where'],{'$or':_[_0x7ce6('0x33')](_0x170439,function(_0x41ebc5){if(_0x41ebc5['type'][_0x7ce6('0x34')]!==_0x7ce6('0x35')){var _0x13683f={};_0x13683f[_0x41ebc5[_0x7ce6('0x36')]]={'$like':'%'+_0xb9d892[_0x7ce6('0x29')][_0x7ce6('0x31')]+'%'};return _0x13683f;}})});}_0xad4cf3=_[_0x7ce6('0x32')]({},_0xad4cf3,_0xb9d892[_0x7ce6('0x37')]);var _0x7ba362={'where':_0xad4cf3['where']};return db[_0x7ce6('0x26')][_0x7ce6('0x18')](_0x7ba362)[_0x7ce6('0x21')](function(_0x139b7a){_0xcb86fe['count']=_0x139b7a;if(_0xb9d892['query'][_0x7ce6('0x38')]){_0xad4cf3[_0x7ce6('0x39')]=[{'all':!![]}];}return db[_0x7ce6('0x26')][_0x7ce6('0x3a')](_0xad4cf3);})[_0x7ce6('0x21')](function(_0x17c16c){_0xcb86fe[_0x7ce6('0x3b')]=_0x17c16c;return _0xcb86fe;})['then'](respondWithFilteredResult(_0x1f8999,_0xad4cf3))[_0x7ce6('0x3c')](handleError(_0x1f8999,null));};exports['show']=function(_0x1e2a0d,_0x30d830){var _0x293d31={'raw':!![],'where':{'id':_0x1e2a0d['params']['id']}},_0x51f1bf={};_0x51f1bf['model']=_[_0x7ce6('0x28')](db[_0x7ce6('0x26')][_0x7ce6('0x3d')]);_0x51f1bf[_0x7ce6('0x29')]=_[_0x7ce6('0x28')](_0x1e2a0d[_0x7ce6('0x29')]);_0x51f1bf[_0x7ce6('0x2a')]=_[_0x7ce6('0x2b')](_0x51f1bf[_0x7ce6('0x27')],_0x51f1bf[_0x7ce6('0x29')]);_0x293d31[_0x7ce6('0x2c')]=_[_0x7ce6('0x2b')](_0x51f1bf[_0x7ce6('0x27')],qs[_0x7ce6('0x3e')](_0x1e2a0d[_0x7ce6('0x29')][_0x7ce6('0x3e')]));_0x293d31[_0x7ce6('0x2c')]=_0x293d31[_0x7ce6('0x2c')][_0x7ce6('0x3f')]?_0x293d31[_0x7ce6('0x2c')]:_0x51f1bf[_0x7ce6('0x27')];if(_0x1e2a0d[_0x7ce6('0x29')][_0x7ce6('0x38')]){_0x293d31[_0x7ce6('0x39')]=[{'all':!![]}];}_0x293d31=_[_0x7ce6('0x32')]({},_0x293d31,_0x1e2a0d[_0x7ce6('0x37')]);return db[_0x7ce6('0x26')][_0x7ce6('0x40')](_0x293d31)[_0x7ce6('0x21')](handleEntityNotFound(_0x30d830,null))[_0x7ce6('0x21')](respondWithResult(_0x30d830,null))[_0x7ce6('0x3c')](handleError(_0x30d830,null));};exports[_0x7ce6('0x41')]=function(_0x237d90,_0x810828){return db[_0x7ce6('0x26')][_0x7ce6('0x41')](_0x237d90[_0x7ce6('0x42')],{})[_0x7ce6('0x21')](respondWithResult(_0x810828,0xc9))[_0x7ce6('0x3c')](handleError(_0x810828,null));};exports[_0x7ce6('0x20')]=function(_0x92a69c,_0x467825){if(_0x92a69c[_0x7ce6('0x42')]['id']){delete _0x92a69c[_0x7ce6('0x42')]['id'];}return db[_0x7ce6('0x26')][_0x7ce6('0x40')]({'where':{'id':_0x92a69c['params']['id']}})['then'](handleEntityNotFound(_0x467825,null))[_0x7ce6('0x21')](saveUpdates(_0x92a69c[_0x7ce6('0x42')],null))[_0x7ce6('0x21')](respondWithResult(_0x467825,null))['catch'](handleError(_0x467825,null));};exports[_0x7ce6('0x43')]=function(_0x5c3582,_0x3ffef8){return db[_0x7ce6('0x26')][_0x7ce6('0x40')]({'where':{'id':_0x5c3582['params']['id']}})[_0x7ce6('0x21')](handleEntityNotFound(_0x3ffef8,null))[_0x7ce6('0x21')](removeEntity(_0x3ffef8,null))[_0x7ce6('0x3c')](handleError(_0x3ffef8,null));};exports[_0x7ce6('0x44')]=function(_0x258ad2,_0x255e16){return db[_0x7ce6('0x26')][_0x7ce6('0x44')]()[_0x7ce6('0x21')](respondWithResult(_0x255e16,null))[_0x7ce6('0x3c')](handleError(_0x255e16,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5d7c2e1..89532a0 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 _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x1c8217,_0x3fae2c){var _0x24ede2=function(_0x401420){while(--_0x401420){_0x1c8217['push'](_0x1c8217['shift']());}};_0x24ede2(++_0x3fae2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x486281,_0x482a8e){var _0x1662c2=function(_0x47803c){while(--_0x47803c){_0x486281['push'](_0x486281['shift']());}};_0x1662c2(++_0x482a8e);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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':'report_square','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'project_name']},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index df7fe06..45f45bd 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 _0xa6f9=['catch','CreateSquareReport','SquareReport','body','options','then','debug','stringify','UpdateSquareReport','raw','where','limit','util','moment','bluebird','ioredis','rpc','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x45e85d,_0x2dd5d8){var _0x1c964f=function(_0x5267c3){while(--_0x5267c3){_0x45e85d['push'](_0x45e85d['shift']());}};_0x1c964f(++_0x2dd5d8);}(_0xa6f9,0x11a));var _0x9a6f=function(_0x2d5749,_0x5b1d53){_0x2d5749=_0x2d5749-0x0;var _0x44e0b5=_0xa6f9[_0x2d5749];return _0x44e0b5;};'use strict';var _=require('lodash');var util=require(_0x9a6f('0x0'));var moment=require(_0x9a6f('0x1'));var BPromise=require(_0x9a6f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a6f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a6f('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a6f('0x5')][_0x9a6f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9f6053,_0x84e11b,_0x3d9efb){return new BPromise(function(_0x18b7b8,_0x425668){return client[_0x9a6f('0x7')](_0x9f6053,_0x3d9efb)['then'](function(_0x569164){logger[_0x9a6f('0x8')](_0x9a6f('0x9'),_0x84e11b,_0x9a6f('0xa'));logger['debug'](_0x9a6f('0xb'),_0x84e11b,_0x9a6f('0xa'),JSON['stringify'](_0x569164));if(_0x569164[_0x9a6f('0xc')]){if(_0x569164[_0x9a6f('0xc')]['code']===0x1f4){logger[_0x9a6f('0xc')](_0x9a6f('0x9'),_0x84e11b,_0x569164[_0x9a6f('0xc')][_0x9a6f('0xd')]);return _0x425668(_0x569164[_0x9a6f('0xc')]['message']);}logger['error'](_0x9a6f('0x9'),_0x84e11b,_0x569164[_0x9a6f('0xc')][_0x9a6f('0xd')]);return _0x18b7b8(_0x569164['error'][_0x9a6f('0xd')]);}else{logger[_0x9a6f('0x8')](_0x9a6f('0x9'),_0x84e11b,_0x9a6f('0xa'));_0x18b7b8(_0x569164[_0x9a6f('0xe')][_0x9a6f('0xd')]);}})[_0x9a6f('0xf')](function(_0x27e4c2){logger[_0x9a6f('0xc')](_0x9a6f('0x9'),_0x84e11b,_0x27e4c2);_0x425668(_0x27e4c2);});});}exports[_0x9a6f('0x10')]=function(_0x354052){var _0x448336=this;return new Promise(function(_0x40fd78,_0x447279){return db[_0x9a6f('0x11')]['create'](_0x354052[_0x9a6f('0x12')],{'raw':_0x354052[_0x9a6f('0x13')]?_0x354052['options']['raw']===undefined?!![]:![]:!![]})[_0x9a6f('0x14')](function(_0x39ae08){logger[_0x9a6f('0x8')](_0x9a6f('0x10'),_0x354052);logger[_0x9a6f('0x15')](_0x9a6f('0x10'),_0x354052,JSON[_0x9a6f('0x16')](_0x39ae08));_0x40fd78(_0x39ae08);})[_0x9a6f('0xf')](function(_0x271991){logger[_0x9a6f('0xc')](_0x9a6f('0x10'),_0x271991[_0x9a6f('0xd')],_0x354052);_0x447279(_0x448336[_0x9a6f('0xc')](0x1f4,_0x271991[_0x9a6f('0xd')]));});});};exports[_0x9a6f('0x17')]=function(_0x2cd927){var _0x57ad26=this;return new Promise(function(_0x578e34,_0x55903c){return db[_0x9a6f('0x11')]['update'](_0x2cd927[_0x9a6f('0x12')],{'raw':_0x2cd927[_0x9a6f('0x13')]?_0x2cd927['options'][_0x9a6f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cd927[_0x9a6f('0x13')]?_0x2cd927[_0x9a6f('0x13')][_0x9a6f('0x19')]||null:null,'attributes':_0x2cd927[_0x9a6f('0x13')]?_0x2cd927[_0x9a6f('0x13')]['attributes']||null:null,'limit':_0x2cd927[_0x9a6f('0x13')]?_0x2cd927[_0x9a6f('0x13')][_0x9a6f('0x1a')]||null:null})[_0x9a6f('0x14')](function(_0x72c4eb){logger['info']('UpdateSquareReport',_0x2cd927);logger[_0x9a6f('0x15')](_0x9a6f('0x17'),_0x2cd927,JSON[_0x9a6f('0x16')](_0x72c4eb));_0x578e34(_0x72c4eb);})[_0x9a6f('0xf')](function(_0x4b73fa){logger[_0x9a6f('0xc')](_0x9a6f('0x17'),_0x4b73fa[_0x9a6f('0xd')],_0x2cd927);_0x55903c(_0x57ad26[_0x9a6f('0xc')](0x1f4,_0x4b73fa[_0x9a6f('0xd')]));});});}; \ No newline at end of file +var _0x56d1=['ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareReport','options','CreateSquareReport','UpdateSquareReport','body','raw','attributes','lodash','util','moment','randomstring'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x56d1,0x1ac));var _0x156d=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x56d1[_0x28669c];return _0x4a3af6;};'use strict';var _=require(_0x156d('0x0'));var util=require(_0x156d('0x1'));var moment=require(_0x156d('0x2'));var BPromise=require('bluebird');var rs=require(_0x156d('0x3'));var fs=require('fs');var Redis=require(_0x156d('0x4'));var db=require(_0x156d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x156d('0x6'));var jayson=require(_0x156d('0x7'));var client=jayson[_0x156d('0x8')][_0x156d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a1337,_0x224012,_0x7070fa){return new BPromise(function(_0x142613,_0x2917ec){return client['request'](_0x1a1337,_0x7070fa)[_0x156d('0xa')](function(_0x1baf5b){logger[_0x156d('0xb')](_0x156d('0xc'),_0x224012,_0x156d('0xd'));logger['debug'](_0x156d('0xe'),_0x224012,_0x156d('0xd'),JSON[_0x156d('0xf')](_0x1baf5b));if(_0x1baf5b['error']){if(_0x1baf5b[_0x156d('0x10')]['code']===0x1f4){logger[_0x156d('0x10')](_0x156d('0xc'),_0x224012,_0x1baf5b[_0x156d('0x10')][_0x156d('0x11')]);return _0x2917ec(_0x1baf5b[_0x156d('0x10')][_0x156d('0x11')]);}logger[_0x156d('0x10')](_0x156d('0xc'),_0x224012,_0x1baf5b[_0x156d('0x10')]['message']);return _0x142613(_0x1baf5b[_0x156d('0x10')]['message']);}else{logger[_0x156d('0xb')](_0x156d('0xc'),_0x224012,_0x156d('0xd'));_0x142613(_0x1baf5b[_0x156d('0x12')][_0x156d('0x11')]);}})[_0x156d('0x13')](function(_0x18589c){logger['error'](_0x156d('0xc'),_0x224012,_0x18589c);_0x2917ec(_0x18589c);});});}exports['CreateSquareReport']=function(_0xdbe874){var _0x5043bd=this;return new Promise(function(_0x1c9ef0,_0x499805){return db[_0x156d('0x14')]['create'](_0xdbe874['body'],{'raw':_0xdbe874[_0x156d('0x15')]?_0xdbe874[_0x156d('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x156d('0xa')](function(_0x27d8a3){logger[_0x156d('0xb')](_0x156d('0x16'),_0xdbe874);logger['debug'](_0x156d('0x16'),_0xdbe874,JSON[_0x156d('0xf')](_0x27d8a3));_0x1c9ef0(_0x27d8a3);})[_0x156d('0x13')](function(_0x1016d1){logger[_0x156d('0x10')]('CreateSquareReport',_0x1016d1[_0x156d('0x11')],_0xdbe874);_0x499805(_0x5043bd[_0x156d('0x10')](0x1f4,_0x1016d1[_0x156d('0x11')]));});});};exports[_0x156d('0x17')]=function(_0x378167){var _0x418cf1=this;return new Promise(function(_0x388ab0,_0x58f4f3){return db['SquareReport']['update'](_0x378167[_0x156d('0x18')],{'raw':_0x378167[_0x156d('0x15')]?_0x378167[_0x156d('0x15')][_0x156d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378167[_0x156d('0x15')]?_0x378167[_0x156d('0x15')]['where']||null:null,'attributes':_0x378167['options']?_0x378167[_0x156d('0x15')][_0x156d('0x1a')]||null:null,'limit':_0x378167['options']?_0x378167['options']['limit']||null:null})[_0x156d('0xa')](function(_0xf96cb2){logger[_0x156d('0xb')](_0x156d('0x17'),_0x378167);logger['debug'](_0x156d('0x17'),_0x378167,JSON['stringify'](_0xf96cb2));_0x388ab0(_0xf96cb2);})[_0x156d('0x13')](function(_0x50fec7){logger[_0x156d('0x10')](_0x156d('0x17'),_0x50fec7[_0x156d('0x11')],_0x378167);_0x58f4f3(_0x418cf1[_0x156d('0x10')](0x1f4,_0x50fec7['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 785ce45..9629163 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 _0x8904=['path','connect-timeout','express','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','create','delete','destroy','exports','util'];(function(_0x5993de,_0x5de78d){var _0x2c8036=function(_0x502e12){while(--_0x502e12){_0x5993de['push'](_0x5993de['shift']());}};_0x2c8036(++_0x5de78d);}(_0x8904,0xbf));var _0x4890=function(_0x4cb773,_0x4ff47a){_0x4cb773=_0x4cb773-0x0;var _0x38b88f=_0x8904[_0x4cb773];return _0x38b88f;};'use strict';var multer=require('multer');var util=require(_0x4890('0x0'));var path=require(_0x4890('0x1'));var timeout=require(_0x4890('0x2'));var express=require(_0x4890('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4890('0x4'));var config=require('../../config/environment');var controller=require(_0x4890('0x5'));router[_0x4890('0x6')]('/',auth[_0x4890('0x7')](),controller[_0x4890('0x8')]);router[_0x4890('0x6')](_0x4890('0x9'),auth[_0x4890('0x7')](),controller['describe']);router[_0x4890('0x6')](_0x4890('0xa'),auth[_0x4890('0x7')](),controller['show']);router[_0x4890('0xb')]('/',auth[_0x4890('0x7')](),controller[_0x4890('0xc')]);router['put'](_0x4890('0xa'),auth[_0x4890('0x7')](),controller['update']);router[_0x4890('0xd')](_0x4890('0xa'),auth[_0x4890('0x7')](),controller[_0x4890('0xe')]);module[_0x4890('0xf')]=router; \ No newline at end of file +var _0x3e8e=['show','post','create','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id'];(function(_0x316b61,_0x395d65){var _0x945283=function(_0x22d8cd){while(--_0x22d8cd){_0x316b61['push'](_0x316b61['shift']());}};_0x945283(++_0x395d65);}(_0x3e8e,0x79));var _0xe3e8=function(_0x5d590c,_0x1fe1d8){_0x5d590c=_0x5d590c-0x0;var _0x57832a=_0x3e8e[_0x5d590c];return _0x57832a;};'use strict';var multer=require('multer');var util=require(_0xe3e8('0x0'));var path=require(_0xe3e8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe3e8('0x2'));var router=express[_0xe3e8('0x3')]();var auth=require(_0xe3e8('0x4'));var interaction=require(_0xe3e8('0x5'));var config=require(_0xe3e8('0x6'));var controller=require('./squareReportDetail.controller');router[_0xe3e8('0x7')]('/',auth['isAuthenticated'](),controller[_0xe3e8('0x8')]);router[_0xe3e8('0x7')](_0xe3e8('0x9'),auth[_0xe3e8('0xa')](),controller['describe']);router['get'](_0xe3e8('0xb'),auth[_0xe3e8('0xa')](),controller[_0xe3e8('0xc')]);router[_0xe3e8('0xd')]('/',auth['isAuthenticated'](),controller[_0xe3e8('0xe')]);router['put']('/:id',auth[_0xe3e8('0xa')](),controller[_0xe3e8('0xf')]);router[_0xe3e8('0x10')]('/:id',auth[_0xe3e8('0xa')](),controller[_0xe3e8('0x11')]);module[_0xe3e8('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ddf2e79..a56e44f 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 _0x18b2=['sequelize','exports','STRING'];(function(_0xbdd2f7,_0x3daf90){var _0x1d2528=function(_0x1fd936){while(--_0x1fd936){_0xbdd2f7['push'](_0xbdd2f7['shift']());}};_0x1d2528(++_0x3daf90);}(_0x18b2,0x1d4));var _0x218b=function(_0x53377e,_0x2213d1){_0x53377e=_0x53377e-0x0;var _0x5823c4=_0x18b2[_0x53377e];return _0x5823c4;};'use strict';var Sequelize=require(_0x218b('0x0'));module[_0x218b('0x1')]={'uniqueid':{'type':Sequelize[_0x218b('0x2')]},'node':{'type':Sequelize[_0x218b('0x2')]},'application':{'type':Sequelize[_0x218b('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x218b('0x2')]},'callerid':{'type':Sequelize[_0x218b('0x2')]}}; \ No newline at end of file +var _0x8706=['STRING','TEXT','sequelize','exports'];(function(_0x3bb96d,_0x231361){var _0x193fdf=function(_0x426fb1){while(--_0x426fb1){_0x3bb96d['push'](_0x3bb96d['shift']());}};_0x193fdf(++_0x231361);}(_0x8706,0xf6));var _0x6870=function(_0x4af5d9,_0x1198c8){_0x4af5d9=_0x4af5d9-0x0;var _0xf6a1fd=_0x8706[_0x4af5d9];return _0xf6a1fd;};'use strict';var Sequelize=require(_0x6870('0x0'));module[_0x6870('0x1')]={'uniqueid':{'type':Sequelize[_0x6870('0x2')]},'node':{'type':Sequelize[_0x6870('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x6870('0x3')]},'project_name':{'type':Sequelize[_0x6870('0x2')]},'callerid':{'type':Sequelize[_0x6870('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index d7ef55e..3e796c8 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 _0x6290=['map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','index','SquareDetailsReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x287eb6,_0x5e26c9){var _0x759a6c=function(_0x3e48e6){while(--_0x3e48e6){_0x287eb6['push'](_0x287eb6['shift']());}};_0x759a6c(++_0x5e26c9);}(_0x6290,0x16d));var _0x0629=function(_0x54224e,_0x11ba92){_0x54224e=_0x54224e-0x0;var _0x1ab9c6=_0x6290[_0x54224e];return _0x1ab9c6;};'use strict';var pdf=require(_0x0629('0x0'));var emlformat=require(_0x0629('0x1'));var rimraf=require(_0x0629('0x2'));var zipdir=require(_0x0629('0x3'));var jsonpatch=require(_0x0629('0x4'));var rp=require(_0x0629('0x5'));var moment=require(_0x0629('0x6'));var BPromise=require(_0x0629('0x7'));var Mustache=require(_0x0629('0x8'));var util=require(_0x0629('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0629('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0629('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0629('0xc'));var Papa=require(_0x0629('0xd'));var Redis=require('ioredis');var authService=require(_0x0629('0xe'));var qs=require(_0x0629('0xf'));var hardwareService=require(_0x0629('0x10'));var logger=require(_0x0629('0x11'))(_0x0629('0x12'));var utils=require(_0x0629('0x13'));var config=require('../../config/environment');var db=require(_0x0629('0x14'))['db'];function respondWithStatusCode(_0x31346e,_0xa29ba9){_0xa29ba9=_0xa29ba9||0xcc;return function(_0x567450){if(_0x567450){return _0x31346e['sendStatus'](_0xa29ba9);}return _0x31346e[_0x0629('0x15')](_0xa29ba9)[_0x0629('0x16')]();};}function respondWithResult(_0x488eb5,_0x81a298){_0x81a298=_0x81a298||0xc8;return function(_0xe18830){if(_0xe18830){return _0x488eb5[_0x0629('0x15')](_0x81a298)[_0x0629('0x17')](_0xe18830);}};}function respondWithFilteredResult(_0x57d46e,_0xd42787){return function(_0x1bebd6){if(_0x1bebd6){var _0x3569ae=_0x1bebd6[_0x0629('0x18')],_0x5e991f=_0xd42787[_0x0629('0x19')],_0x4288a0=_0xd42787[_0x0629('0x19')]+_0xd42787[_0x0629('0x1a')],_0x496e76;if(_0x4288a0>=_0x3569ae){_0x4288a0=_0x3569ae;_0x496e76=0xc8;}else{_0x496e76=0xce;}_0x57d46e[_0x0629('0x15')](_0x496e76);return _0x57d46e[_0x0629('0x1b')](_0x0629('0x1c'),_0x5e991f+'-'+_0x4288a0+'/'+_0x3569ae)[_0x0629('0x17')](_0x1bebd6);}return null;};}function patchUpdates(_0x2bbe44){return function(_0x510e23){try{jsonpatch[_0x0629('0x1d')](_0x510e23,_0x2bbe44,!![]);}catch(_0xdcdee5){return BPromise['reject'](_0xdcdee5);}return _0x510e23['save']();};}function saveUpdates(_0x5132c6,_0x355f97){return function(_0x201df8){if(_0x201df8){return _0x201df8[_0x0629('0x1e')](_0x5132c6)[_0x0629('0x1f')](function(_0x391b93){return _0x391b93;});}return null;};}function removeEntity(_0x25e224,_0x164761){return function(_0x22871d){if(_0x22871d){return _0x22871d[_0x0629('0x20')]()[_0x0629('0x1f')](function(){_0x25e224[_0x0629('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b203d,_0x1504e0){return function(_0x1001a3){if(!_0x1001a3){_0x3b203d[_0x0629('0x21')](0x194);}return _0x1001a3;};}function handleError(_0x1f4347,_0x5077ec){_0x5077ec=_0x5077ec||0x1f4;return function(_0x5906fa){logger['error'](_0x5906fa[_0x0629('0x22')]);if(_0x5906fa[_0x0629('0x23')]){delete _0x5906fa['name'];}_0x1f4347[_0x0629('0x15')](_0x5077ec)[_0x0629('0x24')](_0x5906fa);};}exports[_0x0629('0x25')]=function(_0x592d72,_0xb437e1){var _0x527595={},_0x381500={},_0x474376={'count':0x0,'rows':[]};var _0x59a13e=db[_0x0629('0x26')][_0x0629('0x27')];_0x381500[_0x0629('0x28')]=_[_0x0629('0x29')](_0x59a13e);_0x381500[_0x0629('0x2a')]=_[_0x0629('0x29')](_0x592d72[_0x0629('0x2a')]);_0x381500[_0x0629('0x2b')]=_[_0x0629('0x2c')](_0x381500[_0x0629('0x28')],_0x381500['query']);_0x527595[_0x0629('0x2d')]=_[_0x0629('0x2c')](_0x381500[_0x0629('0x28')],qs[_0x0629('0x2e')](_0x592d72[_0x0629('0x2a')][_0x0629('0x2e')]));_0x527595[_0x0629('0x2d')]=_0x527595[_0x0629('0x2d')][_0x0629('0x2f')]?_0x527595[_0x0629('0x2d')]:_0x381500[_0x0629('0x28')];if(!_0x592d72[_0x0629('0x2a')][_0x0629('0x30')](_0x0629('0x31'))){_0x527595[_0x0629('0x1a')]=qs[_0x0629('0x1a')](_0x592d72['query'][_0x0629('0x1a')]);_0x527595[_0x0629('0x19')]=qs[_0x0629('0x19')](_0x592d72['query'][_0x0629('0x19')]);}_0x527595['order']=qs[_0x0629('0x32')](_0x592d72[_0x0629('0x2a')][_0x0629('0x32')]);_0x527595[_0x0629('0x33')]=qs['filters'](_[_0x0629('0x34')](_0x592d72[_0x0629('0x2a')],_0x381500[_0x0629('0x2b')]));if(_0x592d72[_0x0629('0x2a')][_0x0629('0x35')]){_0x527595[_0x0629('0x33')]=_[_0x0629('0x36')](_0x527595[_0x0629('0x33')],{'$or':_[_0x0629('0x37')](_0x59a13e,function(_0x3adbbd){if(_0x3adbbd[_0x0629('0x38')]['key']!==_0x0629('0x39')){var _0x77f46e={};_0x77f46e[_0x3adbbd[_0x0629('0x3a')]]={'$like':'%'+_0x592d72[_0x0629('0x2a')][_0x0629('0x35')]+'%'};return _0x77f46e;}})});}_0x527595=_[_0x0629('0x36')]({},_0x527595,_0x592d72[_0x0629('0x3b')]);var _0x162ce0={'where':_0x527595[_0x0629('0x33')]};return db[_0x0629('0x26')][_0x0629('0x18')](_0x162ce0)[_0x0629('0x1f')](function(_0x24a47c){_0x474376[_0x0629('0x18')]=_0x24a47c;if(_0x592d72['query'][_0x0629('0x3c')]){_0x527595[_0x0629('0x3d')]=[{'all':!![]}];}return db[_0x0629('0x26')]['findAll'](_0x527595);})[_0x0629('0x1f')](function(_0x19dd25){_0x474376[_0x0629('0x3e')]=_0x19dd25;return _0x474376;})['then'](respondWithFilteredResult(_0xb437e1,_0x527595))[_0x0629('0x3f')](handleError(_0xb437e1,null));};exports[_0x0629('0x40')]=function(_0x5a9610,_0x23e3fc){var _0x4a0949={'raw':!![],'where':{'id':_0x5a9610['params']['id']}},_0x432912={};_0x432912['model']=_[_0x0629('0x29')](db[_0x0629('0x26')][_0x0629('0x27')]);_0x432912['query']=_[_0x0629('0x29')](_0x5a9610['query']);_0x432912[_0x0629('0x2b')]=_['intersection'](_0x432912[_0x0629('0x28')],_0x432912[_0x0629('0x2a')]);_0x4a0949[_0x0629('0x2d')]=_['intersection'](_0x432912[_0x0629('0x28')],qs[_0x0629('0x2e')](_0x5a9610[_0x0629('0x2a')][_0x0629('0x2e')]));_0x4a0949['attributes']=_0x4a0949[_0x0629('0x2d')][_0x0629('0x2f')]?_0x4a0949['attributes']:_0x432912[_0x0629('0x28')];if(_0x5a9610[_0x0629('0x2a')]['includeAll']){_0x4a0949['include']=[{'all':!![]}];}_0x4a0949=_[_0x0629('0x36')]({},_0x4a0949,_0x5a9610[_0x0629('0x3b')]);return db[_0x0629('0x26')][_0x0629('0x41')](_0x4a0949)[_0x0629('0x1f')](handleEntityNotFound(_0x23e3fc,null))[_0x0629('0x1f')](respondWithResult(_0x23e3fc,null))[_0x0629('0x3f')](handleError(_0x23e3fc,null));};exports[_0x0629('0x42')]=function(_0x3f9386,_0x57585b){return db['SquareDetailsReport'][_0x0629('0x42')](_0x3f9386[_0x0629('0x43')],{})['then'](respondWithResult(_0x57585b,0xc9))['catch'](handleError(_0x57585b,null));};exports[_0x0629('0x1e')]=function(_0x19cadc,_0x27891c){if(_0x19cadc[_0x0629('0x43')]['id']){delete _0x19cadc['body']['id'];}return db[_0x0629('0x26')][_0x0629('0x41')]({'where':{'id':_0x19cadc['params']['id']}})[_0x0629('0x1f')](handleEntityNotFound(_0x27891c,null))[_0x0629('0x1f')](saveUpdates(_0x19cadc[_0x0629('0x43')],null))['then'](respondWithResult(_0x27891c,null))[_0x0629('0x3f')](handleError(_0x27891c,null));};exports[_0x0629('0x20')]=function(_0x2aa21e,_0x21a87d){return db[_0x0629('0x26')][_0x0629('0x41')]({'where':{'id':_0x2aa21e[_0x0629('0x44')]['id']}})[_0x0629('0x1f')](handleEntityNotFound(_0x21a87d,null))['then'](removeEntity(_0x21a87d,null))[_0x0629('0x3f')](handleError(_0x21a87d,null));};exports[_0x0629('0x45')]=function(_0x1c5b69,_0x151375){return db[_0x0629('0x26')][_0x0629('0x45')]()[_0x0629('0x1f')](respondWithResult(_0x151375,null))[_0x0629('0x3f')](handleError(_0x151375,null));}; \ No newline at end of file +var _0x2259=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','where','filter','merge','map','type','key','VIRTUAL','field','options','SquareDetailsReport','findAll','catch','params','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x403484,_0x33b8ba){var _0x55b2bc=function(_0x1f9b3a){while(--_0x1f9b3a){_0x403484['push'](_0x403484['shift']());}};_0x55b2bc(++_0x33b8ba);}(_0x2259,0xfc));var _0x9225=function(_0x12f676,_0x5013ea){_0x12f676=_0x12f676-0x0;var _0x5b264a=_0x2259[_0x12f676];return _0x5b264a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9225('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9225('0x1'));var jsonpatch=require(_0x9225('0x2'));var rp=require('request-promise');var moment=require(_0x9225('0x3'));var BPromise=require(_0x9225('0x4'));var Mustache=require(_0x9225('0x5'));var util=require(_0x9225('0x6'));var path=require(_0x9225('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9225('0x8'));var fs=require('fs');var _=require(_0x9225('0x9'));var squel=require('squel');var crypto=require(_0x9225('0xa'));var jsforce=require(_0x9225('0xb'));var deskjs=require(_0x9225('0xc'));var toCsv=require(_0x9225('0xd'));var querystring=require(_0x9225('0xe'));var Papa=require(_0x9225('0xf'));var Redis=require(_0x9225('0x10'));var authService=require(_0x9225('0x11'));var qs=require(_0x9225('0x12'));var hardwareService=require(_0x9225('0x13'));var logger=require('../../config/logger')(_0x9225('0x14'));var utils=require(_0x9225('0x15'));var config=require(_0x9225('0x16'));var db=require(_0x9225('0x17'))['db'];function respondWithStatusCode(_0x513fe6,_0x3c29ad){_0x3c29ad=_0x3c29ad||0xcc;return function(_0x1702ba){if(_0x1702ba){return _0x513fe6[_0x9225('0x18')](_0x3c29ad);}return _0x513fe6[_0x9225('0x19')](_0x3c29ad)[_0x9225('0x1a')]();};}function respondWithResult(_0x23f7c8,_0x4275d0){_0x4275d0=_0x4275d0||0xc8;return function(_0x1b9c55){if(_0x1b9c55){return _0x23f7c8[_0x9225('0x19')](_0x4275d0)[_0x9225('0x1b')](_0x1b9c55);}};}function respondWithFilteredResult(_0x3a03aa,_0x1460ba){return function(_0x4f81a1){if(_0x4f81a1){var _0x186af3=_0x4f81a1[_0x9225('0x1c')],_0xa6faf7=_0x1460ba[_0x9225('0x1d')],_0x18c543=_0x1460ba['offset']+_0x1460ba[_0x9225('0x1e')],_0x46cd67;if(_0x18c543>=_0x186af3){_0x18c543=_0x186af3;_0x46cd67=0xc8;}else{_0x46cd67=0xce;}_0x3a03aa[_0x9225('0x19')](_0x46cd67);return _0x3a03aa[_0x9225('0x1f')](_0x9225('0x20'),_0xa6faf7+'-'+_0x18c543+'/'+_0x186af3)[_0x9225('0x1b')](_0x4f81a1);}return null;};}function patchUpdates(_0x284431){return function(_0x525fab){try{jsonpatch[_0x9225('0x21')](_0x525fab,_0x284431,!![]);}catch(_0xbfac78){return BPromise[_0x9225('0x22')](_0xbfac78);}return _0x525fab[_0x9225('0x23')]();};}function saveUpdates(_0x2637e3,_0x487642){return function(_0x748764){if(_0x748764){return _0x748764[_0x9225('0x24')](_0x2637e3)[_0x9225('0x25')](function(_0x16490f){return _0x16490f;});}return null;};}function removeEntity(_0x35e4b5,_0x12ada0){return function(_0x198f57){if(_0x198f57){return _0x198f57[_0x9225('0x26')]()[_0x9225('0x25')](function(){_0x35e4b5['status'](0xcc)[_0x9225('0x1a')]();});}};}function handleEntityNotFound(_0x2f1538,_0x40e4f7){return function(_0x22937c){if(!_0x22937c){_0x2f1538[_0x9225('0x18')](0x194);}return _0x22937c;};}function handleError(_0x1f136c,_0x21134a){_0x21134a=_0x21134a||0x1f4;return function(_0x1baa29){logger['error'](_0x1baa29[_0x9225('0x27')]);if(_0x1baa29['name']){delete _0x1baa29[_0x9225('0x28')];}_0x1f136c[_0x9225('0x19')](_0x21134a)[_0x9225('0x29')](_0x1baa29);};}exports['index']=function(_0x1e702d,_0x15ced9){var _0x4685eb={},_0xc2102e={},_0x4fdbe6={'count':0x0,'rows':[]};var _0x3c3682=db['SquareDetailsReport'][_0x9225('0x2a')];_0xc2102e[_0x9225('0x2b')]=_['keys'](_0x3c3682);_0xc2102e[_0x9225('0x2c')]=_[_0x9225('0x2d')](_0x1e702d[_0x9225('0x2c')]);_0xc2102e[_0x9225('0x2e')]=_[_0x9225('0x2f')](_0xc2102e[_0x9225('0x2b')],_0xc2102e['query']);_0x4685eb['attributes']=_[_0x9225('0x2f')](_0xc2102e[_0x9225('0x2b')],qs['fields'](_0x1e702d[_0x9225('0x2c')][_0x9225('0x30')]));_0x4685eb['attributes']=_0x4685eb[_0x9225('0x31')]['length']?_0x4685eb[_0x9225('0x31')]:_0xc2102e[_0x9225('0x2b')];if(!_0x1e702d[_0x9225('0x2c')][_0x9225('0x32')]('nolimit')){_0x4685eb[_0x9225('0x1e')]=qs[_0x9225('0x1e')](_0x1e702d[_0x9225('0x2c')][_0x9225('0x1e')]);_0x4685eb[_0x9225('0x1d')]=qs[_0x9225('0x1d')](_0x1e702d[_0x9225('0x2c')][_0x9225('0x1d')]);}_0x4685eb['order']=qs['sort'](_0x1e702d[_0x9225('0x2c')]['sort']);_0x4685eb[_0x9225('0x33')]=qs[_0x9225('0x2e')](_['pick'](_0x1e702d[_0x9225('0x2c')],_0xc2102e[_0x9225('0x2e')]));if(_0x1e702d['query'][_0x9225('0x34')]){_0x4685eb[_0x9225('0x33')]=_[_0x9225('0x35')](_0x4685eb[_0x9225('0x33')],{'$or':_[_0x9225('0x36')](_0x3c3682,function(_0x7124e3){if(_0x7124e3[_0x9225('0x37')][_0x9225('0x38')]!==_0x9225('0x39')){var _0x1cc015={};_0x1cc015[_0x7124e3[_0x9225('0x3a')]]={'$like':'%'+_0x1e702d[_0x9225('0x2c')][_0x9225('0x34')]+'%'};return _0x1cc015;}})});}_0x4685eb=_[_0x9225('0x35')]({},_0x4685eb,_0x1e702d[_0x9225('0x3b')]);var _0x2c6063={'where':_0x4685eb['where']};return db[_0x9225('0x3c')]['count'](_0x2c6063)['then'](function(_0x23e75d){_0x4fdbe6[_0x9225('0x1c')]=_0x23e75d;if(_0x1e702d[_0x9225('0x2c')]['includeAll']){_0x4685eb['include']=[{'all':!![]}];}return db[_0x9225('0x3c')][_0x9225('0x3d')](_0x4685eb);})[_0x9225('0x25')](function(_0x4a10a1){_0x4fdbe6['rows']=_0x4a10a1;return _0x4fdbe6;})[_0x9225('0x25')](respondWithFilteredResult(_0x15ced9,_0x4685eb))[_0x9225('0x3e')](handleError(_0x15ced9,null));};exports['show']=function(_0x480b64,_0x518ff0){var _0x47844f={'raw':!![],'where':{'id':_0x480b64[_0x9225('0x3f')]['id']}},_0x483594={};_0x483594[_0x9225('0x2b')]=_[_0x9225('0x2d')](db[_0x9225('0x3c')][_0x9225('0x2a')]);_0x483594[_0x9225('0x2c')]=_[_0x9225('0x2d')](_0x480b64[_0x9225('0x2c')]);_0x483594[_0x9225('0x2e')]=_[_0x9225('0x2f')](_0x483594['model'],_0x483594[_0x9225('0x2c')]);_0x47844f[_0x9225('0x31')]=_['intersection'](_0x483594[_0x9225('0x2b')],qs[_0x9225('0x30')](_0x480b64[_0x9225('0x2c')][_0x9225('0x30')]));_0x47844f[_0x9225('0x31')]=_0x47844f[_0x9225('0x31')]['length']?_0x47844f[_0x9225('0x31')]:_0x483594[_0x9225('0x2b')];if(_0x480b64[_0x9225('0x2c')][_0x9225('0x40')]){_0x47844f['include']=[{'all':!![]}];}_0x47844f=_[_0x9225('0x35')]({},_0x47844f,_0x480b64[_0x9225('0x3b')]);return db['SquareDetailsReport'][_0x9225('0x41')](_0x47844f)[_0x9225('0x25')](handleEntityNotFound(_0x518ff0,null))[_0x9225('0x25')](respondWithResult(_0x518ff0,null))['catch'](handleError(_0x518ff0,null));};exports[_0x9225('0x42')]=function(_0x359797,_0x37b49f){return db['SquareDetailsReport'][_0x9225('0x42')](_0x359797[_0x9225('0x43')],{})[_0x9225('0x25')](respondWithResult(_0x37b49f,0xc9))[_0x9225('0x3e')](handleError(_0x37b49f,null));};exports[_0x9225('0x24')]=function(_0x3bc90e,_0xa19ecc){if(_0x3bc90e['body']['id']){delete _0x3bc90e['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x3bc90e['params']['id']}})['then'](handleEntityNotFound(_0xa19ecc,null))[_0x9225('0x25')](saveUpdates(_0x3bc90e[_0x9225('0x43')],null))[_0x9225('0x25')](respondWithResult(_0xa19ecc,null))[_0x9225('0x3e')](handleError(_0xa19ecc,null));};exports[_0x9225('0x26')]=function(_0x3c4f5f,_0x20a19b){return db[_0x9225('0x3c')]['find']({'where':{'id':_0x3c4f5f['params']['id']}})[_0x9225('0x25')](handleEntityNotFound(_0x20a19b,null))[_0x9225('0x25')](removeEntity(_0x20a19b,null))['catch'](handleError(_0x20a19b,null));};exports['describe']=function(_0x5f016d,_0x5c6825){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x5c6825,null))[_0x9225('0x3e')](handleError(_0x5c6825,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 608fef6..c38440f 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 _0x7a3e=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util'];(function(_0x619434,_0x57d965){var _0x195c6c=function(_0x34d083){while(--_0x34d083){_0x619434['push'](_0x619434['shift']());}};_0x195c6c(++_0x57d965);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x476335,_0x366d8c){_0x476335=_0x476335-0x0;var _0x57f0de=_0x7a3e[_0x476335];return _0x57f0de;};'use strict';var _=require(_0xe7a3('0x0'));var util=require(_0xe7a3('0x1'));var logger=require(_0xe7a3('0x2'))('api');var moment=require(_0xe7a3('0x3'));var BPromise=require(_0xe7a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe7a3('0x5'));var config=require(_0xe7a3('0x6'));var attributes=require(_0xe7a3('0x7'));module['exports']=function(_0x401117,_0x45b019){return _0x401117[_0xe7a3('0x8')](_0xe7a3('0x9'),attributes,{'tableName':_0xe7a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d2c=['../../config/logger','api','moment','bluebird','path','../../config/environment','./squareReportDetail.attributes','exports','report_square_details','lodash','util'];(function(_0x1477f8,_0x53621b){var _0x4ca0e9=function(_0x497c19){while(--_0x497c19){_0x1477f8['push'](_0x1477f8['shift']());}};_0x4ca0e9(++_0x53621b);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x32c9b9,_0x21a0cf){_0x32c9b9=_0x32c9b9-0x0;var _0x239eab=_0x2d2c[_0x32c9b9];return _0x239eab;};'use strict';var _=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var logger=require(_0xc2d2('0x2'))(_0xc2d2('0x3'));var moment=require(_0xc2d2('0x4'));var BPromise=require(_0xc2d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2d2('0x6'));var rimraf=require('rimraf');var config=require(_0xc2d2('0x7'));var attributes=require(_0xc2d2('0x8'));module[_0xc2d2('0x9')]=function(_0x45ad0c,_0xe9cf0e){return _0x45ad0c['define']('SquareDetailsReport',attributes,{'tableName':_0xc2d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 25cccaa..866d2cb 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 _0xa631=['ioredis','../../config/logger','rpc','../../config/environment','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','options','debug','util','moment','bluebird'];(function(_0x37fc7c,_0x516442){var _0x49bdf6=function(_0xbf1b20){while(--_0xbf1b20){_0x37fc7c['push'](_0x37fc7c['shift']());}};_0x49bdf6(++_0x516442);}(_0xa631,0xe4));var _0x1a63=function(_0x167cb1,_0x596e2e){_0x167cb1=_0x167cb1-0x0;var _0x3e58ba=_0xa631[_0x167cb1];return _0x3e58ba;};'use strict';var _=require('lodash');var util=require(_0x1a63('0x0'));var moment=require(_0x1a63('0x1'));var BPromise=require(_0x1a63('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a63('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a63('0x4'))(_0x1a63('0x5'));var config=require(_0x1a63('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5df65f,_0x2a8dd9,_0xf1cb96){return new BPromise(function(_0xd81213,_0x58f178){return client['request'](_0x5df65f,_0xf1cb96)[_0x1a63('0x7')](function(_0x403dc5){logger[_0x1a63('0x8')](_0x1a63('0x9'),_0x2a8dd9,_0x1a63('0xa'));logger['debug'](_0x1a63('0xb'),_0x2a8dd9,_0x1a63('0xa'),JSON[_0x1a63('0xc')](_0x403dc5));if(_0x403dc5[_0x1a63('0xd')]){if(_0x403dc5['error'][_0x1a63('0xe')]===0x1f4){logger[_0x1a63('0xd')](_0x1a63('0x9'),_0x2a8dd9,_0x403dc5['error'][_0x1a63('0xf')]);return _0x58f178(_0x403dc5['error'][_0x1a63('0xf')]);}logger[_0x1a63('0xd')](_0x1a63('0x9'),_0x2a8dd9,_0x403dc5['error']['message']);return _0xd81213(_0x403dc5[_0x1a63('0xd')][_0x1a63('0xf')]);}else{logger[_0x1a63('0x8')](_0x1a63('0x9'),_0x2a8dd9,_0x1a63('0xa'));_0xd81213(_0x403dc5['result'][_0x1a63('0xf')]);}})['catch'](function(_0x2711c7){logger[_0x1a63('0xd')](_0x1a63('0x9'),_0x2a8dd9,_0x2711c7);_0x58f178(_0x2711c7);});});}exports[_0x1a63('0x10')]=function(_0x52fdd1){var _0x24996e=this;return new Promise(function(_0x365ab8,_0x41c13e){return db[_0x1a63('0x11')][_0x1a63('0x12')](_0x52fdd1['body'],{'raw':_0x52fdd1[_0x1a63('0x13')]?_0x52fdd1[_0x1a63('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x1a63('0x7')](function(_0x444406){logger[_0x1a63('0x8')](_0x1a63('0x10'),_0x52fdd1);logger[_0x1a63('0x14')](_0x1a63('0x10'),_0x52fdd1,JSON[_0x1a63('0xc')](_0x444406));_0x365ab8(_0x444406);})['catch'](function(_0x3e4b57){logger['error'](_0x1a63('0x10'),_0x3e4b57[_0x1a63('0xf')],_0x52fdd1);_0x41c13e(_0x24996e['error'](0x1f4,_0x3e4b57['message']));});});}; \ No newline at end of file +var _0x8ef6=['raw','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','options'];(function(_0x3f4114,_0x17492f){var _0x162e97=function(_0x43b729){while(--_0x43b729){_0x3f4114['push'](_0x3f4114['shift']());}};_0x162e97(++_0x17492f);}(_0x8ef6,0xf2));var _0x68ef=function(_0x44b0e1,_0x4b62da){_0x44b0e1=_0x44b0e1-0x0;var _0x287417=_0x8ef6[_0x44b0e1];return _0x287417;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['CreateSquareDetailsReport']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')](_0x2633c1[_0x68ef('0x1a')],{'raw':_0x2633c1['options']?_0x2633c1[_0x68ef('0x1b')][_0x68ef('0x1c')]===undefined?!![]:![]:!![]})[_0x68ef('0xc')](function(_0x5b246b){logger[_0x68ef('0xd')](_0x68ef('0x1d'),_0x2633c1);logger['debug'](_0x68ef('0x1d'),_0x2633c1,JSON[_0x68ef('0x12')](_0x5b246b));_0x4ade0d(_0x5b246b);})[_0x68ef('0x17')](function(_0x5ddec7){logger['error']('CreateSquareDetailsReport',_0x5ddec7[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x5ddec7[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c3a0594..bcbdeef 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 _0x5f22=['isAuthenticated','index','get','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x2f48cf,_0x36d00d){var _0xa4ca3a=function(_0x5bba1a){while(--_0x5bba1a){_0x2f48cf['push'](_0x2f48cf['shift']());}};_0xa4ca3a(++_0x36d00d);}(_0x5f22,0x17f));var _0x25f2=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0x5f22[_0x2842b4];return _0x2b9521;};'use strict';var express=require(_0x25f2('0x0'));var router=express[_0x25f2('0x1')]();var auth=require(_0x25f2('0x2'));var controller=require(_0x25f2('0x3'));router['get']('/',auth[_0x25f2('0x4')](),controller[_0x25f2('0x5')]);router[_0x25f2('0x6')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x25f2('0x7')]);module[_0x25f2('0x8')]=router; \ No newline at end of file +var _0x3a65=['isAuthenticated','index','/process/:pid/kill','exports','express','Router','get'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3a65,0xb3));var _0x53a6=function(_0x3ec0b6,_0x3a31f8){_0x3ec0b6=_0x3ec0b6-0x0;var _0x1eb5b4=_0x3a65[_0x3ec0b6];return _0x1eb5b4;};'use strict';var express=require(_0x53a6('0x0'));var router=express[_0x53a6('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x53a6('0x2')]('/',auth[_0x53a6('0x3')](),controller[_0x53a6('0x4')]);router[_0x53a6('0x2')](_0x53a6('0x5'),auth[_0x53a6('0x3')](),controller['killProcess']);module[_0x53a6('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 5d2988b..9689014 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 _0xcefa=['send','index','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status'];(function(_0x15a0b9,_0x2f4234){var _0xa19586=function(_0x497665){while(--_0x497665){_0x15a0b9['push'](_0x15a0b9['shift']());}};_0xa19586(++_0x2f4234);}(_0xcefa,0x148));var _0xacef=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0xcefa[_0xd816e2];return _0x1f5924;};'use strict';var info=require(_0xacef('0x0'));var exec=require(_0xacef('0x1'))[_0xacef('0x2')];var logger=require(_0xacef('0x3'))('api');var util=require(_0xacef('0x4'));var BPromise=require(_0xacef('0x5'));var _=require(_0xacef('0x6'));function handleError(_0x547255,_0x372498,_0x158264){_0x372498=_0x372498||0x1f4;return function(_0x400d6e){logger['error'](_0xacef('0x7'),_0x158264,_0x372498,util[_0xacef('0x8')](_0x400d6e,{'showHidden':![],'depth':null}));delete _0x400d6e['name'];_0x547255[_0xacef('0x9')](_0x372498)[_0xacef('0xa')](_0x400d6e);};}exports[_0xacef('0xb')]=function(_0xedc2ed,_0x239bbf){return info['getAllData']()[_0xacef('0xc')](function(_0x31401b){return _0x239bbf['status'](0xc8)[_0xacef('0xd')](_0x31401b);})['catch'](function(_0x45cba1){return _0x239bbf[_0xacef('0x9')](0x1f4)['json'](_0x45cba1);});};exports[_0xacef('0xe')]=function(_0x3be0d7,_0x3f489a){var _0x36668d=[_0xacef('0xf')];return new BPromise(function(_0x58ad36,_0x4dbc83){return exec(util[_0xacef('0x10')](_0xacef('0x11'),_0x3be0d7[_0xacef('0x12')]['pid']),function(_0x17947f,_0x312cbe,_0x2c6d5b){if(_0x17947f){return _0x4dbc83(_0x17947f);}return _0x58ad36(_0x312cbe);});})['then'](function(_0x18190c){var _0x3ff98d=![];var _0x5ab6d6=_0x18190c[_0xacef('0x13')](/\n/);for(var _0x1467d0=0x0,_0x2137f7=_0x36668d[_0xacef('0x14')];_0x1467d0<_0x2137f7,_0x3ff98d===![];_0x1467d0+=0x1){if(_0x18190c['indexOf'](_0x36668d[_0x1467d0])>=0x0){_0x3ff98d=!![];}}if(!_0x3ff98d){throw new Error(util[_0xacef('0x10')](_0xacef('0x15'),_0x3be0d7['params'][_0xacef('0x16')]));}process['kill'](_0x3be0d7['params']['pid'],_0xacef('0x17'));return _0x3f489a[_0xacef('0x9')](0xc8)[_0xacef('0xd')]({'message':util[_0xacef('0x10')](_0xacef('0x18'),_0x3be0d7[_0xacef('0x12')][_0xacef('0x16')])});})[_0xacef('0x19')](handleError(_0x3f489a,null,_0xacef('0xe')));}; \ No newline at end of file +var _0x8404=['indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','then','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length'];(function(_0x5a05b1,_0x453f32){var _0xcd1ad8=function(_0x2fe187){while(--_0x2fe187){_0x5a05b1['push'](_0x5a05b1['shift']());}};_0xcd1ad8(++_0x453f32);}(_0x8404,0x14c));var _0x4840=function(_0x6a05f9,_0x3d846b){_0x6a05f9=_0x6a05f9-0x0;var _0xb6a58e=_0x8404[_0x6a05f9];return _0xb6a58e;};'use strict';var info=require(_0x4840('0x0'));var exec=require(_0x4840('0x1'))['exec'];var logger=require(_0x4840('0x2'))('api');var util=require(_0x4840('0x3'));var BPromise=require(_0x4840('0x4'));var _=require(_0x4840('0x5'));function handleError(_0x484d74,_0x21687c,_0x4c1769){_0x21687c=_0x21687c||0x1f4;return function(_0x586105){logger['error'](_0x4840('0x6'),_0x4c1769,_0x21687c,util['inspect'](_0x586105,{'showHidden':![],'depth':null}));delete _0x586105[_0x4840('0x7')];_0x484d74[_0x4840('0x8')](_0x21687c)[_0x4840('0x9')](_0x586105);};}exports['index']=function(_0x302cf6,_0xc294a){return info['getAllData']()[_0x4840('0xa')](function(_0xfac738){return _0xc294a[_0x4840('0x8')](0xc8)['json'](_0xfac738);})[_0x4840('0xb')](function(_0x50d1e9){return _0xc294a[_0x4840('0x8')](0x1f4)['json'](_0x50d1e9);});};exports['killProcess']=function(_0x2bb07f,_0x3e73c9){var _0x51e5d3=[_0x4840('0xc')];return new BPromise(function(_0x36a011,_0x499279){return exec(util[_0x4840('0xd')](_0x4840('0xe'),_0x2bb07f['params'][_0x4840('0xf')]),function(_0x355525,_0xee06e9,_0x1a175c){if(_0x355525){return _0x499279(_0x355525);}return _0x36a011(_0xee06e9);});})['then'](function(_0x30cb96){var _0x427d1c=![];var _0xbe1dca=_0x30cb96[_0x4840('0x10')](/\n/);for(var _0x563a7f=0x0,_0x240ae0=_0x51e5d3[_0x4840('0x11')];_0x563a7f<_0x240ae0,_0x427d1c===![];_0x563a7f+=0x1){if(_0x30cb96[_0x4840('0x12')](_0x51e5d3[_0x563a7f])>=0x0){_0x427d1c=!![];}}if(!_0x427d1c){throw new Error(util[_0x4840('0xd')](_0x4840('0x13'),_0x2bb07f[_0x4840('0x14')][_0x4840('0xf')]));}process[_0x4840('0x15')](_0x2bb07f[_0x4840('0x14')]['pid'],'SIGINT');return _0x3e73c9[_0x4840('0x8')](0xc8)[_0x4840('0x16')]({'message':util['format'](_0x4840('0x17'),_0x2bb07f['params'][_0x4840('0xf')])});})[_0x4840('0xb')](handleError(_0x3e73c9,null,_0x4840('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 04d0c85..5b1fb2a 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 _0x5f2f=['create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4bdcee,_0x213603){_0x4bdcee=_0x4bdcee-0x0;var _0x3f9e03=_0x5f2f[_0x4bdcee];return _0x3f9e03;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xc')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xd')]);router['put'](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['delete'](_0xf5f2('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xf5f2('0xf')]=router; \ No newline at end of file +var _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x30994d,_0x2cc269){var _0x4554df=function(_0x125125){while(--_0x125125){_0x30994d['push'](_0x30994d['shift']());}};_0x4554df(++_0x2cc269);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4c1b76,_0x2cdc2d){_0x4c1b76=_0x4c1b76-0x0;var _0x3ace6b=_0x5eb8[_0x4c1b76];return _0x3ace6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x85eb('0xd')]);router['put'](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x11')]);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 876f578..1592ec8 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 _0xf689=['exports','STRING','#0091EA','sequelize'];(function(_0x5f1cae,_0x2cf92d){var _0x29745b=function(_0x5b782d){while(--_0x5b782d){_0x5f1cae['push'](_0x5f1cae['shift']());}};_0x29745b(++_0x2cf92d);}(_0xf689,0x1bb));var _0x9f68=function(_0x4f45cb,_0x45a004){_0x4f45cb=_0x4f45cb-0x0;var _0x2dced1=_0xf689[_0x4f45cb];return _0x2dced1;};'use strict';var Sequelize=require(_0x9f68('0x0'));module[_0x9f68('0x1')]={'name':{'type':Sequelize[_0x9f68('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9f68('0x2')],'defaultValue':_0x9f68('0x3')},'description':{'type':Sequelize[_0x9f68('0x2')]}}; \ No newline at end of file +var _0x70ae=['sequelize','STRING','name','#0091EA'];(function(_0x3377b6,_0x4e17e0){var _0x41bf7d=function(_0x342cf1){while(--_0x342cf1){_0x3377b6['push'](_0x3377b6['shift']());}};_0x41bf7d(++_0x4e17e0);}(_0x70ae,0x1cc));var _0xe70a=function(_0xa7fb1f,_0x1c49bc){_0xa7fb1f=_0xa7fb1f-0x0;var _0x32e057=_0x70ae[_0xa7fb1f];return _0x32e057;};'use strict';var Sequelize=require(_0xe70a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe70a('0x1')],'unique':_0xe70a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe70a('0x1')],'defaultValue':_0xe70a('0x3')},'description':{'type':Sequelize[_0xe70a('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index ecd0012..c8a0a37 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 _0x4c60=['error','stack','name','index','Tag','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','key','field','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','then','destroy','get','sendStatus'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x4c60,0xc1));var _0x04c6=function(_0xc6f056,_0x402596){_0xc6f056=_0xc6f056-0x0;var _0x544cfe=_0x4c60[_0xc6f056];return _0x544cfe;};'use strict';var pdf=require(_0x04c6('0x0'));var emlformat=require(_0x04c6('0x1'));var rimraf=require(_0x04c6('0x2'));var zipdir=require(_0x04c6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04c6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x04c6('0x5'));var sox=require(_0x04c6('0x6'));var csv=require(_0x04c6('0x7'));var ejs=require(_0x04c6('0x8'));var fs=require('fs');var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x7'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x04c6('0xf'));var logger=require('../../config/logger')(_0x04c6('0x10'));var utils=require(_0x04c6('0x11'));var config=require('../../config/environment');var db=require(_0x04c6('0x12'))['db'];function respondWithStatusCode(_0x19eb01,_0x119187){_0x119187=_0x119187||0xcc;return function(_0x4e5e6){if(_0x4e5e6){return _0x19eb01['sendStatus'](_0x119187);}return _0x19eb01[_0x04c6('0x13')](_0x119187)[_0x04c6('0x14')]();};}function respondWithResult(_0x4384ad,_0x56422a){_0x56422a=_0x56422a||0xc8;return function(_0x12d1c5){if(_0x12d1c5){return _0x4384ad[_0x04c6('0x13')](_0x56422a)[_0x04c6('0x15')](_0x12d1c5);}};}function respondWithFilteredResult(_0x3e80a6,_0x4760f8){return function(_0x19a26f){if(_0x19a26f){var _0x1cd963=_0x19a26f[_0x04c6('0x16')],_0x3d46a9=_0x4760f8[_0x04c6('0x17')],_0x5a5a66=_0x4760f8[_0x04c6('0x17')]+_0x4760f8[_0x04c6('0x18')],_0x31edf9;if(_0x5a5a66>=_0x1cd963){_0x5a5a66=_0x1cd963;_0x31edf9=0xc8;}else{_0x31edf9=0xce;}_0x3e80a6[_0x04c6('0x13')](_0x31edf9);return _0x3e80a6[_0x04c6('0x19')](_0x04c6('0x1a'),_0x3d46a9+'-'+_0x5a5a66+'/'+_0x1cd963)['json'](_0x19a26f);}return null;};}function patchUpdates(_0x142065){return function(_0x13e472){try{jsonpatch[_0x04c6('0x1b')](_0x13e472,_0x142065,!![]);}catch(_0x558b43){return BPromise['reject'](_0x558b43);}return _0x13e472['save']();};}function saveUpdates(_0x41ad4f,_0xb997e0){return function(_0x50dd61){if(_0x50dd61){return _0x50dd61['update'](_0x41ad4f)[_0x04c6('0x1c')](function(_0x2eed94){return _0x2eed94;});}return null;};}function removeEntity(_0x3cd448,_0x5daa22){return function(_0x33a0f7){if(_0x33a0f7){return _0x33a0f7[_0x04c6('0x1d')]()[_0x04c6('0x1c')](function(){var _0x49c179=_0x33a0f7[_0x04c6('0x1e')]({'plain':!![]});var _0x41e29f='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x41e29f,'resourceId':_0x49c179['id']}})[_0x04c6('0x1c')](function(){return _0x33a0f7;});})[_0x04c6('0x1c')](function(){_0x3cd448[_0x04c6('0x13')](0xcc)[_0x04c6('0x14')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x1f')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x20')](_0x3233d7[_0x04c6('0x21')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x22')];}_0x2ab1d2[_0x04c6('0x13')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x23')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=db[_0x04c6('0x24')][_0x04c6('0x25')];_0x115d84[_0x04c6('0x26')]=_['keys'](_0x2a191f);_0x115d84['query']=_['keys'](_0x1cd16a[_0x04c6('0x27')]);_0x115d84['filters']=_[_0x04c6('0x28')](_0x115d84[_0x04c6('0x26')],_0x115d84['query']);_0x5c9003[_0x04c6('0x29')]=_[_0x04c6('0x28')](_0x115d84[_0x04c6('0x26')],qs[_0x04c6('0x2a')](_0x1cd16a['query'][_0x04c6('0x2a')]));_0x5c9003[_0x04c6('0x29')]=_0x5c9003[_0x04c6('0x29')][_0x04c6('0x2b')]?_0x5c9003[_0x04c6('0x29')]:_0x115d84[_0x04c6('0x26')];if(!_0x1cd16a[_0x04c6('0x27')][_0x04c6('0x2c')](_0x04c6('0x2d'))){_0x5c9003[_0x04c6('0x18')]=qs[_0x04c6('0x18')](_0x1cd16a[_0x04c6('0x27')][_0x04c6('0x18')]);_0x5c9003[_0x04c6('0x17')]=qs[_0x04c6('0x17')](_0x1cd16a['query'][_0x04c6('0x17')]);}_0x5c9003[_0x04c6('0x2e')]=qs[_0x04c6('0x2f')](_0x1cd16a[_0x04c6('0x27')]['sort']);_0x5c9003[_0x04c6('0x30')]=qs[_0x04c6('0x31')](_['pick'](_0x1cd16a['query'],_0x115d84['filters']));if(_0x1cd16a[_0x04c6('0x27')][_0x04c6('0x32')]){_0x5c9003['where']=_[_0x04c6('0x33')](_0x5c9003['where'],{'$or':_[_0x04c6('0x34')](_0x2a191f,function(_0x1373ca){if(_0x1373ca[_0x04c6('0x35')][_0x04c6('0x36')]!=='VIRTUAL'){var _0x57ce4b={};_0x57ce4b[_0x1373ca[_0x04c6('0x37')]]={'$like':'%'+_0x1cd16a[_0x04c6('0x27')]['filter']+'%'};return _0x57ce4b;}})});}_0x5c9003=_[_0x04c6('0x33')]({},_0x5c9003,_0x1cd16a['options']);var _0x501d7d={'where':_0x5c9003[_0x04c6('0x30')]};return db['Tag'][_0x04c6('0x16')](_0x501d7d)[_0x04c6('0x1c')](function(_0x59ca18){_0x3a6d92[_0x04c6('0x16')]=_0x59ca18;if(_0x1cd16a['query'][_0x04c6('0x38')]){_0x5c9003[_0x04c6('0x39')]=[{'all':!![]}];}return db[_0x04c6('0x24')][_0x04c6('0x3a')](_0x5c9003);})[_0x04c6('0x1c')](function(_0x57ed53){_0x3a6d92[_0x04c6('0x3b')]=_0x57ed53;return _0x3a6d92;})['then'](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3c')](handleError(_0x5f1331,null));};exports['show']=function(_0x1f7ead,_0xc31731){var _0x132bd0={'raw':!![],'where':{'id':_0x1f7ead[_0x04c6('0x3d')]['id']}},_0x447b54={};_0x447b54[_0x04c6('0x26')]=_[_0x04c6('0x3e')](db['Tag'][_0x04c6('0x25')]);_0x447b54['query']=_[_0x04c6('0x3e')](_0x1f7ead['query']);_0x447b54['filters']=_[_0x04c6('0x28')](_0x447b54['model'],_0x447b54[_0x04c6('0x27')]);_0x132bd0[_0x04c6('0x29')]=_[_0x04c6('0x28')](_0x447b54['model'],qs[_0x04c6('0x2a')](_0x1f7ead[_0x04c6('0x27')][_0x04c6('0x2a')]));_0x132bd0[_0x04c6('0x29')]=_0x132bd0[_0x04c6('0x29')][_0x04c6('0x2b')]?_0x132bd0[_0x04c6('0x29')]:_0x447b54['model'];if(_0x1f7ead['query'][_0x04c6('0x38')]){_0x132bd0[_0x04c6('0x39')]=[{'all':!![]}];}_0x132bd0=_[_0x04c6('0x33')]({},_0x132bd0,_0x1f7ead['options']);return db[_0x04c6('0x24')][_0x04c6('0x3f')](_0x132bd0)[_0x04c6('0x1c')](handleEntityNotFound(_0xc31731,null))['then'](respondWithResult(_0xc31731,null))['catch'](handleError(_0xc31731,null));};exports['create']=function(_0x39dcef,_0x25c185){return db['Tag'][_0x04c6('0x40')](_0x39dcef[_0x04c6('0x41')],{})[_0x04c6('0x1c')](function(_0x4ef366){var _0x392983=_0x39dcef[_0x04c6('0x42')]['get']({'plain':!![]});if(!_0x392983)throw new Error(_0x04c6('0x43'));if(_0x392983[_0x04c6('0x44')]===_0x04c6('0x42')){var _0xee2822=_0x4ef366['get']({'plain':!![]});var _0x46f0ac=_0x04c6('0x45');return db[_0x04c6('0x46')][_0x04c6('0x3f')]({'where':{'name':_0x46f0ac,'userProfileId':_0x392983['userProfileId']},'raw':!![]})[_0x04c6('0x1c')](function(_0x17824f){if(_0x17824f&&_0x17824f[_0x04c6('0x47')]===0x0){return db[_0x04c6('0x48')]['create']({'name':_0xee2822[_0x04c6('0x22')],'resourceId':_0xee2822['id'],'type':_0x17824f[_0x04c6('0x22')],'sectionId':_0x17824f['id']},{})[_0x04c6('0x1c')](function(){return _0x4ef366;});}else{return _0x4ef366;}})['catch'](function(_0x3119f0){logger[_0x04c6('0x20')](_0x04c6('0x49'),_0x3119f0);throw _0x3119f0;});}return _0x4ef366;})[_0x04c6('0x1c')](respondWithResult(_0x25c185,0xc9))[_0x04c6('0x3c')](handleError(_0x25c185,null));};exports[_0x04c6('0x4a')]=function(_0x1b8fa4,_0x160f91){if(_0x1b8fa4[_0x04c6('0x41')]['id']){delete _0x1b8fa4[_0x04c6('0x41')]['id'];}return db[_0x04c6('0x24')][_0x04c6('0x3f')]({'where':{'id':_0x1b8fa4[_0x04c6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x160f91,null))[_0x04c6('0x1c')](saveUpdates(_0x1b8fa4[_0x04c6('0x41')],null))[_0x04c6('0x1c')](respondWithResult(_0x160f91,null))[_0x04c6('0x3c')](handleError(_0x160f91,null));};exports[_0x04c6('0x1d')]=function(_0x48124f,_0x3bac84){return db[_0x04c6('0x24')][_0x04c6('0x3f')]({'where':{'id':_0x48124f[_0x04c6('0x3d')]['id']}})[_0x04c6('0x1c')](handleEntityNotFound(_0x3bac84,null))[_0x04c6('0x1c')](removeEntity(_0x3bac84,null))[_0x04c6('0x3c')](handleError(_0x3bac84,null));}; \ No newline at end of file +var _0xacf4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','limit','set','apply','reject','save','update','destroy','get','Tags','then','error','stack','name','send','index','Tag','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','where','filter','merge','map','type','field','options','includeAll','include','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2a7c2a,_0x37cc9e){var _0x195732=function(_0x4d3902){while(--_0x4d3902){_0x2a7c2a['push'](_0x2a7c2a['shift']());}};_0x195732(++_0x37cc9e);}(_0xacf4,0xe7));var _0x4acf=function(_0x17c1da,_0x36ecce){_0x17c1da=_0x17c1da-0x0;var _0x5552f5=_0xacf4[_0x17c1da];return _0x5552f5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4acf('0x0'));var zipdir=require(_0x4acf('0x1'));var jsonpatch=require(_0x4acf('0x2'));var rp=require(_0x4acf('0x3'));var moment=require(_0x4acf('0x4'));var BPromise=require(_0x4acf('0x5'));var Mustache=require(_0x4acf('0x6'));var util=require('util');var path=require(_0x4acf('0x7'));var sox=require(_0x4acf('0x8'));var csv=require('to-csv');var ejs=require(_0x4acf('0x9'));var fs=require('fs');var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4acf('0x12'))(_0x4acf('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4acf('0x14'))['db'];function respondWithStatusCode(_0x540c8f,_0x5bca4e){_0x5bca4e=_0x5bca4e||0xcc;return function(_0x1783d2){if(_0x1783d2){return _0x540c8f[_0x4acf('0x15')](_0x5bca4e);}return _0x540c8f[_0x4acf('0x16')](_0x5bca4e)[_0x4acf('0x17')]();};}function respondWithResult(_0x18629e,_0x1a9949){_0x1a9949=_0x1a9949||0xc8;return function(_0x7ab3ea){if(_0x7ab3ea){return _0x18629e[_0x4acf('0x16')](_0x1a9949)[_0x4acf('0x18')](_0x7ab3ea);}};}function respondWithFilteredResult(_0x312bb5,_0x2741d3){return function(_0x5f0260){if(_0x5f0260){var _0x1b584a=_0x5f0260[_0x4acf('0x19')],_0x57d8e0=_0x2741d3['offset'],_0x34cec1=_0x2741d3['offset']+_0x2741d3[_0x4acf('0x1a')],_0x4041c8;if(_0x34cec1>=_0x1b584a){_0x34cec1=_0x1b584a;_0x4041c8=0xc8;}else{_0x4041c8=0xce;}_0x312bb5[_0x4acf('0x16')](_0x4041c8);return _0x312bb5[_0x4acf('0x1b')]('Content-Range',_0x57d8e0+'-'+_0x34cec1+'/'+_0x1b584a)[_0x4acf('0x18')](_0x5f0260);}return null;};}function patchUpdates(_0x137302){return function(_0x30d289){try{jsonpatch[_0x4acf('0x1c')](_0x30d289,_0x137302,!![]);}catch(_0x2f0cec){return BPromise[_0x4acf('0x1d')](_0x2f0cec);}return _0x30d289[_0x4acf('0x1e')]();};}function saveUpdates(_0x16ae40,_0x130647){return function(_0x2feb89){if(_0x2feb89){return _0x2feb89[_0x4acf('0x1f')](_0x16ae40)['then'](function(_0x28d698){return _0x28d698;});}return null;};}function removeEntity(_0x6bd89,_0x57ea46){return function(_0x41e5d2){if(_0x41e5d2){return _0x41e5d2[_0x4acf('0x20')]()['then'](function(){var _0x3b26ac=_0x41e5d2[_0x4acf('0x21')]({'plain':!![]});var _0x433b7a=_0x4acf('0x22');return db['UserProfileResource'][_0x4acf('0x20')]({'where':{'type':_0x433b7a,'resourceId':_0x3b26ac['id']}})[_0x4acf('0x23')](function(){return _0x41e5d2;});})['then'](function(){_0x6bd89[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x24')](_0x50236d[_0x4acf('0x25')]);if(_0x50236d[_0x4acf('0x26')]){delete _0x50236d[_0x4acf('0x26')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x27')](_0x50236d);};}exports[_0x4acf('0x28')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=db[_0x4acf('0x29')][_0x4acf('0x2a')];_0x57989e[_0x4acf('0x2b')]=_[_0x4acf('0x2c')](_0x3f5614);_0x57989e[_0x4acf('0x2d')]=_['keys'](_0x7a1e79[_0x4acf('0x2d')]);_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x57989e['model'],_0x57989e[_0x4acf('0x2d')]);_0x2a3830[_0x4acf('0x30')]=_[_0x4acf('0x2f')](_0x57989e[_0x4acf('0x2b')],qs['fields'](_0x7a1e79[_0x4acf('0x2d')][_0x4acf('0x31')]));_0x2a3830[_0x4acf('0x30')]=_0x2a3830['attributes'][_0x4acf('0x32')]?_0x2a3830[_0x4acf('0x30')]:_0x57989e[_0x4acf('0x2b')];if(!_0x7a1e79[_0x4acf('0x2d')][_0x4acf('0x33')](_0x4acf('0x34'))){_0x2a3830['limit']=qs[_0x4acf('0x1a')](_0x7a1e79[_0x4acf('0x2d')]['limit']);_0x2a3830[_0x4acf('0x35')]=qs['offset'](_0x7a1e79['query']['offset']);}_0x2a3830['order']=qs['sort'](_0x7a1e79['query']['sort']);_0x2a3830[_0x4acf('0x36')]=qs[_0x4acf('0x2e')](_['pick'](_0x7a1e79[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]));if(_0x7a1e79[_0x4acf('0x2d')][_0x4acf('0x37')]){_0x2a3830[_0x4acf('0x36')]=_[_0x4acf('0x38')](_0x2a3830[_0x4acf('0x36')],{'$or':_[_0x4acf('0x39')](_0x3f5614,function(_0x24465b){if(_0x24465b[_0x4acf('0x3a')]['key']!=='VIRTUAL'){var _0x3afe1e={};_0x3afe1e[_0x24465b[_0x4acf('0x3b')]]={'$like':'%'+_0x7a1e79['query'][_0x4acf('0x37')]+'%'};return _0x3afe1e;}})});}_0x2a3830=_[_0x4acf('0x38')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3c')]);var _0x3e5d98={'where':_0x2a3830['where']};return db['Tag'][_0x4acf('0x19')](_0x3e5d98)[_0x4acf('0x23')](function(_0x3d5529){_0x3521c2[_0x4acf('0x19')]=_0x3d5529;if(_0x7a1e79['query'][_0x4acf('0x3d')]){_0x2a3830[_0x4acf('0x3e')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2a3830);})['then'](function(_0x544fe9){_0x3521c2[_0x4acf('0x3f')]=_0x544fe9;return _0x3521c2;})[_0x4acf('0x23')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x40')](handleError(_0x382c41,null));};exports['show']=function(_0x1015e3,_0x3b6574){var _0x19e94a={'raw':!![],'where':{'id':_0x1015e3[_0x4acf('0x41')]['id']}},_0x3dc9e2={};_0x3dc9e2[_0x4acf('0x2b')]=_[_0x4acf('0x2c')](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x3dc9e2[_0x4acf('0x2d')]=_[_0x4acf('0x2c')](_0x1015e3['query']);_0x3dc9e2[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x3dc9e2[_0x4acf('0x2b')],_0x3dc9e2[_0x4acf('0x2d')]);_0x19e94a[_0x4acf('0x30')]=_['intersection'](_0x3dc9e2['model'],qs[_0x4acf('0x31')](_0x1015e3[_0x4acf('0x2d')][_0x4acf('0x31')]));_0x19e94a[_0x4acf('0x30')]=_0x19e94a[_0x4acf('0x30')][_0x4acf('0x32')]?_0x19e94a['attributes']:_0x3dc9e2[_0x4acf('0x2b')];if(_0x1015e3['query'][_0x4acf('0x3d')]){_0x19e94a[_0x4acf('0x3e')]=[{'all':!![]}];}_0x19e94a=_['merge']({},_0x19e94a,_0x1015e3['options']);return db[_0x4acf('0x29')][_0x4acf('0x42')](_0x19e94a)[_0x4acf('0x23')](handleEntityNotFound(_0x3b6574,null))[_0x4acf('0x23')](respondWithResult(_0x3b6574,null))['catch'](handleError(_0x3b6574,null));};exports[_0x4acf('0x43')]=function(_0x13fac4,_0x2378c6){return db[_0x4acf('0x29')][_0x4acf('0x43')](_0x13fac4[_0x4acf('0x44')],{})[_0x4acf('0x23')](function(_0x2d946c){var _0x51e931=_0x13fac4['user'][_0x4acf('0x21')]({'plain':!![]});if(!_0x51e931)throw new Error(_0x4acf('0x45'));if(_0x51e931[_0x4acf('0x46')]===_0x4acf('0x47')){var _0x287406=_0x2d946c[_0x4acf('0x21')]({'plain':!![]});var _0x39306a=_0x4acf('0x22');return db[_0x4acf('0x48')][_0x4acf('0x42')]({'where':{'name':_0x39306a,'userProfileId':_0x51e931[_0x4acf('0x49')]},'raw':!![]})[_0x4acf('0x23')](function(_0x47de36){if(_0x47de36&&_0x47de36[_0x4acf('0x4a')]===0x0){return db[_0x4acf('0x4b')][_0x4acf('0x43')]({'name':_0x287406[_0x4acf('0x26')],'resourceId':_0x287406['id'],'type':_0x47de36[_0x4acf('0x26')],'sectionId':_0x47de36['id']},{})[_0x4acf('0x23')](function(){return _0x2d946c;});}else{return _0x2d946c;}})[_0x4acf('0x40')](function(_0x2d0561){logger[_0x4acf('0x24')](_0x4acf('0x4c'),_0x2d0561);throw _0x2d0561;});}return _0x2d946c;})[_0x4acf('0x23')](respondWithResult(_0x2378c6,0xc9))[_0x4acf('0x40')](handleError(_0x2378c6,null));};exports[_0x4acf('0x1f')]=function(_0x2b62bc,_0x113425){if(_0x2b62bc[_0x4acf('0x44')]['id']){delete _0x2b62bc['body']['id'];}return db[_0x4acf('0x29')][_0x4acf('0x42')]({'where':{'id':_0x2b62bc[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x113425,null))[_0x4acf('0x23')](saveUpdates(_0x2b62bc[_0x4acf('0x44')],null))[_0x4acf('0x23')](respondWithResult(_0x113425,null))[_0x4acf('0x40')](handleError(_0x113425,null));};exports['destroy']=function(_0x51557d,_0x49a34c){return db[_0x4acf('0x29')][_0x4acf('0x42')]({'where':{'id':_0x51557d[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x49a34c,null))[_0x4acf('0x23')](removeEntity(_0x49a34c,null))[_0x4acf('0x40')](handleError(_0x49a34c,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 864fe3a..14ba649 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 _0x79ca=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','define','tools_tags','lodash','util','../../config/logger'];(function(_0x5bbc12,_0x543dfa){var _0x6f27a5=function(_0x17450b){while(--_0x17450b){_0x5bbc12['push'](_0x5bbc12['shift']());}};_0x6f27a5(++_0x543dfa);}(_0x79ca,0x10e));var _0xa79c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x79ca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa79c('0x0'));var util=require(_0xa79c('0x1'));var logger=require(_0xa79c('0x2'))(_0xa79c('0x3'));var moment=require(_0xa79c('0x4'));var BPromise=require(_0xa79c('0x5'));var rp=require(_0xa79c('0x6'));var fs=require('fs');var path=require(_0xa79c('0x7'));var rimraf=require(_0xa79c('0x8'));var config=require(_0xa79c('0x9'));var attributes=require(_0xa79c('0xa'));module['exports']=function(_0x14e792,_0x368bcf){return _0x14e792[_0xa79c('0xb')]('Tag',attributes,{'tableName':_0xa79c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b9b=['moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','api'];(function(_0x552e0e,_0x55786b){var _0x291970=function(_0x2037ec){while(--_0x2037ec){_0x552e0e['push'](_0x552e0e['shift']());}};_0x291970(++_0x55786b);}(_0x1b9b,0x169));var _0xb1b9=function(_0x165633,_0x414060){_0x165633=_0x165633-0x0;var _0x77082c=_0x1b9b[_0x165633];return _0x77082c;};'use strict';var _=require(_0xb1b9('0x0'));var util=require(_0xb1b9('0x1'));var logger=require('../../config/logger')(_0xb1b9('0x2'));var moment=require(_0xb1b9('0x3'));var BPromise=require(_0xb1b9('0x4'));var rp=require(_0xb1b9('0x5'));var fs=require('fs');var path=require(_0xb1b9('0x6'));var rimraf=require('rimraf');var config=require(_0xb1b9('0x7'));var attributes=require(_0xb1b9('0x8'));module[_0xb1b9('0x9')]=function(_0x51acde,_0x2fc371){return _0x51acde[_0xb1b9('0xa')](_0xb1b9('0xb'),attributes,{'tableName':_0xb1b9('0xc'),'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 d16a8de..6086782 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 _0x8fa0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x26d018,_0xedb83d){var _0x296c00=function(_0x1471d2){while(--_0x1471d2){_0x26d018['push'](_0x26d018['shift']());}};_0x296c00(++_0xedb83d);}(_0x8fa0,0x177));var _0x08fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8fa0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x08fa('0x0'));var util=require(_0x08fa('0x1'));var moment=require(_0x08fa('0x2'));var BPromise=require(_0x08fa('0x3'));var rs=require(_0x08fa('0x4'));var fs=require('fs');var Redis=require(_0x08fa('0x5'));var db=require(_0x08fa('0x6'))['db'];var utils=require(_0x08fa('0x7'));var logger=require(_0x08fa('0x8'))('rpc');var config=require(_0x08fa('0x9'));var jayson=require(_0x08fa('0xa'));var client=jayson['client'][_0x08fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2248bc,_0x347c1f,_0x190181){return new BPromise(function(_0x13930e,_0x1e5d00){return client[_0x08fa('0xc')](_0x2248bc,_0x190181)[_0x08fa('0xd')](function(_0x1b20e5){logger[_0x08fa('0xe')](_0x08fa('0xf'),_0x347c1f,'request\x20sent');logger[_0x08fa('0x10')](_0x08fa('0x11'),_0x347c1f,_0x08fa('0x12'),JSON[_0x08fa('0x13')](_0x1b20e5));if(_0x1b20e5[_0x08fa('0x14')]){if(_0x1b20e5[_0x08fa('0x14')][_0x08fa('0x15')]===0x1f4){logger[_0x08fa('0x14')](_0x08fa('0xf'),_0x347c1f,_0x1b20e5['error'][_0x08fa('0x16')]);return _0x1e5d00(_0x1b20e5[_0x08fa('0x14')]['message']);}logger[_0x08fa('0x14')]('Tag,\x20%s,\x20%s',_0x347c1f,_0x1b20e5[_0x08fa('0x14')][_0x08fa('0x16')]);return _0x13930e(_0x1b20e5[_0x08fa('0x14')]['message']);}else{logger[_0x08fa('0xe')](_0x08fa('0xf'),_0x347c1f,'request\x20sent');_0x13930e(_0x1b20e5[_0x08fa('0x17')]['message']);}})[_0x08fa('0x18')](function(_0x5e7f94){logger['error']('Tag,\x20%s,\x20%s',_0x347c1f,_0x5e7f94);_0x1e5d00(_0x5e7f94);});});} \ No newline at end of file +var _0xe9af=['Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0xe9af,0xec));var _0xfe9a=function(_0x1e264d,_0x51e0c3){_0x1e264d=_0x1e264d-0x0;var _0x26f0b6=_0xe9af[_0x1e264d];return _0x26f0b6;};'use strict';var _=require(_0xfe9a('0x0'));var util=require('util');var moment=require(_0xfe9a('0x1'));var BPromise=require(_0xfe9a('0x2'));var rs=require(_0xfe9a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe9a('0x4'))(_0xfe9a('0x5'));var config=require(_0xfe9a('0x6'));var jayson=require(_0xfe9a('0x7'));var client=jayson[_0xfe9a('0x8')][_0xfe9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a04b5,_0x5fd905,_0x220af2){return new BPromise(function(_0x13a919,_0x4a3ad2){return client['request'](_0x4a04b5,_0x220af2)['then'](function(_0x2d75fe){logger[_0xfe9a('0xa')](_0xfe9a('0xb'),_0x5fd905,_0xfe9a('0xc'));logger[_0xfe9a('0xd')](_0xfe9a('0xe'),_0x5fd905,_0xfe9a('0xc'),JSON['stringify'](_0x2d75fe));if(_0x2d75fe['error']){if(_0x2d75fe[_0xfe9a('0xf')][_0xfe9a('0x10')]===0x1f4){logger[_0xfe9a('0xf')](_0xfe9a('0xb'),_0x5fd905,_0x2d75fe[_0xfe9a('0xf')][_0xfe9a('0x11')]);return _0x4a3ad2(_0x2d75fe[_0xfe9a('0xf')]['message']);}logger[_0xfe9a('0xf')](_0xfe9a('0xb'),_0x5fd905,_0x2d75fe[_0xfe9a('0xf')][_0xfe9a('0x11')]);return _0x13a919(_0x2d75fe[_0xfe9a('0xf')][_0xfe9a('0x11')]);}else{logger[_0xfe9a('0xa')](_0xfe9a('0xb'),_0x5fd905,_0xfe9a('0xc'));_0x13a919(_0x2d75fe[_0xfe9a('0x12')][_0xfe9a('0x11')]);}})['catch'](function(_0x44d618){logger[_0xfe9a('0xf')](_0xfe9a('0xb'),_0x5fd905,_0x44d618);_0x4a3ad2(_0x44d618);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 12f1a94..b870f3a 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 _0xb420=['get','isAuthenticated','index','/:id','/:id/queues','getQueues','getAgents','post','addQueues','/:id/users','update','delete','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./team.controller'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xb420,0xe9));var _0x0b42=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb420[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0b42('0x0'));var util=require(_0x0b42('0x1'));var path=require(_0x0b42('0x2'));var timeout=require(_0x0b42('0x3'));var express=require(_0x0b42('0x4'));var router=express[_0x0b42('0x5')]();var auth=require(_0x0b42('0x6'));var interaction=require(_0x0b42('0x7'));var config=require('../../config/environment');var controller=require(_0x0b42('0x8'));router[_0x0b42('0x9')]('/',auth[_0x0b42('0xa')](),controller[_0x0b42('0xb')]);router[_0x0b42('0x9')](_0x0b42('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0b42('0x9')](_0x0b42('0xd'),auth[_0x0b42('0xa')](),controller[_0x0b42('0xe')]);router[_0x0b42('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x0b42('0xf')]);router[_0x0b42('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0b42('0x10')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0b42('0x11')]);router['post'](_0x0b42('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x0b42('0xc'),auth[_0x0b42('0xa')](),controller[_0x0b42('0x13')]);router[_0x0b42('0x14')](_0x0b42('0xc'),auth[_0x0b42('0xa')](),controller['destroy']);router[_0x0b42('0x14')](_0x0b42('0xd'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x0b42('0x14')](_0x0b42('0x12'),auth[_0x0b42('0xa')](),controller[_0x0b42('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe119=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','isAuthenticated','index','/:id','show','get','/:id/users','getAgents','post','create','addAgents','put','update','delete','/:id/queues','removeQueues','removeAgents','exports','multer','path'];(function(_0x5916c0,_0x116b70){var _0x3d840c=function(_0x400651){while(--_0x400651){_0x5916c0['push'](_0x5916c0['shift']());}};_0x3d840c(++_0x116b70);}(_0xe119,0x1b8));var _0x9e11=function(_0x1674c4,_0x1d4d1e){_0x1674c4=_0x1674c4-0x0;var _0x8045f0=_0xe119[_0x1674c4];return _0x8045f0;};'use strict';var multer=require(_0x9e11('0x0'));var util=require('util');var path=require(_0x9e11('0x1'));var timeout=require(_0x9e11('0x2'));var express=require(_0x9e11('0x3'));var router=express[_0x9e11('0x4')]();var auth=require(_0x9e11('0x5'));var interaction=require(_0x9e11('0x6'));var config=require(_0x9e11('0x7'));var controller=require(_0x9e11('0x8'));router['get']('/',auth[_0x9e11('0x9')](),controller[_0x9e11('0xa')]);router['get'](_0x9e11('0xb'),auth[_0x9e11('0x9')](),controller[_0x9e11('0xc')]);router[_0x9e11('0xd')]('/:id/queues',auth[_0x9e11('0x9')](),controller['getQueues']);router['get'](_0x9e11('0xe'),auth['isAuthenticated'](),controller[_0x9e11('0xf')]);router[_0x9e11('0x10')]('/',auth[_0x9e11('0x9')](),controller[_0x9e11('0x11')]);router[_0x9e11('0x10')]('/:id/queues',auth[_0x9e11('0x9')](),controller['addQueues']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x9e11('0x12')]);router[_0x9e11('0x13')](_0x9e11('0xb'),auth[_0x9e11('0x9')](),controller[_0x9e11('0x14')]);router[_0x9e11('0x15')](_0x9e11('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x9e11('0x15')](_0x9e11('0x16'),auth['isAuthenticated'](),controller[_0x9e11('0x17')]);router[_0x9e11('0x15')](_0x9e11('0xe'),auth[_0x9e11('0x9')](),controller[_0x9e11('0x18')]);module[_0x9e11('0x19')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index d553b78..2569e0d 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 _0x59e8=['sequelize','exports','STRING','name'];(function(_0xb86d3b,_0x46c54d){var _0x2c5179=function(_0x16b606){while(--_0x16b606){_0xb86d3b['push'](_0xb86d3b['shift']());}};_0x2c5179(++_0x46c54d);}(_0x59e8,0x160));var _0x859e=function(_0x2621b1,_0x52c4c1){_0x2621b1=_0x2621b1-0x0;var _0x5e7aec=_0x59e8[_0x2621b1];return _0x5e7aec;};'use strict';var Sequelize=require(_0x859e('0x0'));module[_0x859e('0x1')]={'name':{'type':Sequelize[_0x859e('0x2')],'allowNull':![],'unique':_0x859e('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfb05=['sequelize','STRING','name'];(function(_0x4b075e,_0x57874c){var _0x31385c=function(_0x3ab6ef){while(--_0x3ab6ef){_0x4b075e['push'](_0x4b075e['shift']());}};_0x31385c(++_0x57874c);}(_0xfb05,0x114));var _0x5fb0=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xfb05[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x5fb0('0x0'));module['exports']={'name':{'type':Sequelize[_0x5fb0('0x1')],'allowNull':![],'unique':_0x5fb0('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index c1ccc11..fb9d45c 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 _0xa9e0=['addQueues','findOne','add','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','User','findAll','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','voice','chat','mail','sms','openchannel','removeAgents','isArray','emit','userTeam:remove','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues'];(function(_0x22327c,_0x555652){var _0x292823=function(_0x169c65){while(--_0x169c65){_0x22327c['push'](_0x22327c['shift']());}};_0x292823(++_0x555652);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){var _0x4abc8f=[_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')];return BPromise[_0x0a9e('0x66')](_0x4abc8f,function(_0x3df0e3){return _0x361b21[_0x0a9e('0x25')+_0x3df0e3+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x3df0e3===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]})[_0x0a9e('0x23')](function(_0x53a6a1){return BPromise[_0x0a9e('0x66')](_[_0x0a9e('0x37')](_0x53a6a1,{'online':0x1}),function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x81d748,null))['then'](function(_0x5fd5db){if(_0x5fd5db){return BPromise['each']([_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),'fax',_0x0a9e('0x78')],function(_0x32f761){return _0x5fd5db[_0x0a9e('0x25')+_['capitalize'](_0x32f761)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x22063c){return BPromise[_0x0a9e('0x66')](_0x22063c,function(_0x1910bf){return _0x1910bf[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')]['ids'])[_0x0a9e('0x23')](function(){if(_0x32f761===_0x0a9e('0x74')){return db['UserVoiceQueueRt'][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x1910bf['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]}});}});});})['then'](function(){return _0x5fd5db;});})[_0x0a9e('0x23')](function(){return _0x5fd5db;});}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){return _0x8c8fbe[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x7a')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])){for(var _0x501050=0x0;_0x501050<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x501050+=0x1){socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x501050]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}}else{socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x7d')]=function(_0x12843d,_0x2ed526,_0xb0599a){var _0x5d9ddb={};var _0x3afc8c={};var _0x1756c7;var _0x5ce99d;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x12843d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2ed526,null))[_0x0a9e('0x23')](function(_0xf8c6c4){if(_0xf8c6c4){_0x1756c7=_0xf8c6c4;_0x3afc8c['model']=_[_0x0a9e('0x2d')](db['User'][_0x0a9e('0x2b')]);_0x3afc8c[_0x0a9e('0x2e')]=_['keys'](_0x12843d[_0x0a9e('0x2e')]);_0x3afc8c[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3afc8c['model'],_0x3afc8c['query']);_0x5d9ddb[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3afc8c[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5d9ddb[_0x0a9e('0x30')]=_0x5d9ddb[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5d9ddb['attributes']:_0x3afc8c[_0x0a9e('0x2c')];_0x5d9ddb['order']=qs[_0x0a9e('0x35')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5d9ddb[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_['pick'](_0x12843d[_0x0a9e('0x2e')],_0x3afc8c[_0x0a9e('0x36')]));if(_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x5d9ddb[_0x0a9e('0x39')]=_['merge'](_0x5d9ddb['where'],{'$or':_[_0x0a9e('0x3a')](_0x5d9ddb['attributes'],function(_0x25eae0){var _0x4658df={};_0x4658df[_0x25eae0]={'$like':'%'+_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4658df;})});}_0x5d9ddb=_[_0x0a9e('0x38')]({},_0x5d9ddb,_0x12843d[_0x0a9e('0x3e')]);return _0x1756c7['getAgents'](_0x5d9ddb);}})['then'](function(_0x1889ed){if(_0x1889ed){_0x5ce99d=_0x1889ed['length'];if(!_0x12843d[_0x0a9e('0x2e')]['hasOwnProperty'](_0x0a9e('0x7e'))){_0x5d9ddb['limit']=qs['limit'](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5d9ddb['offset']=qs[_0x0a9e('0x1c')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x1756c7[_0x0a9e('0x7d')](_0x5d9ddb);}})[_0x0a9e('0x23')](function(_0x5ab0bc){if(_0x5ab0bc){return _0x5ab0bc?{'count':_0x5ce99d,'rows':_0x5ab0bc}:null;}})['then'](respondWithResult(_0x2ed526,null))[_0x0a9e('0x42')](handleError(_0x2ed526,null));}; \ No newline at end of file +var _0xa9e0=['addQueues','findOne','add','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','User','findAll','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','voice','chat','mail','sms','openchannel','removeAgents','isArray','emit','userTeam:remove','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues'];(function(_0x47744e,_0x53b5e9){var _0x5d7850=function(_0x3c1929){while(--_0x3c1929){_0x47744e['push'](_0x47744e['shift']());}};_0x5d7850(++_0x53b5e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){var _0x4abc8f=[_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')];return BPromise[_0x0a9e('0x66')](_0x4abc8f,function(_0x3df0e3){return _0x361b21[_0x0a9e('0x25')+_0x3df0e3+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x3df0e3===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]})[_0x0a9e('0x23')](function(_0x53a6a1){return BPromise[_0x0a9e('0x66')](_[_0x0a9e('0x37')](_0x53a6a1,{'online':0x1}),function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x81d748,null))['then'](function(_0x5fd5db){if(_0x5fd5db){return BPromise['each']([_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),'fax',_0x0a9e('0x78')],function(_0x32f761){return _0x5fd5db[_0x0a9e('0x25')+_['capitalize'](_0x32f761)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x22063c){return BPromise[_0x0a9e('0x66')](_0x22063c,function(_0x1910bf){return _0x1910bf[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')]['ids'])[_0x0a9e('0x23')](function(){if(_0x32f761===_0x0a9e('0x74')){return db['UserVoiceQueueRt'][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x1910bf['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]}});}});});})['then'](function(){return _0x5fd5db;});})[_0x0a9e('0x23')](function(){return _0x5fd5db;});}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){return _0x8c8fbe[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x7a')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])){for(var _0x501050=0x0;_0x501050<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x501050+=0x1){socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x501050]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}}else{socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x7d')]=function(_0x12843d,_0x2ed526,_0xb0599a){var _0x5d9ddb={};var _0x3afc8c={};var _0x1756c7;var _0x5ce99d;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x12843d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2ed526,null))[_0x0a9e('0x23')](function(_0xf8c6c4){if(_0xf8c6c4){_0x1756c7=_0xf8c6c4;_0x3afc8c['model']=_[_0x0a9e('0x2d')](db['User'][_0x0a9e('0x2b')]);_0x3afc8c[_0x0a9e('0x2e')]=_['keys'](_0x12843d[_0x0a9e('0x2e')]);_0x3afc8c[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3afc8c['model'],_0x3afc8c['query']);_0x5d9ddb[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3afc8c[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5d9ddb[_0x0a9e('0x30')]=_0x5d9ddb[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5d9ddb['attributes']:_0x3afc8c[_0x0a9e('0x2c')];_0x5d9ddb['order']=qs[_0x0a9e('0x35')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5d9ddb[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_['pick'](_0x12843d[_0x0a9e('0x2e')],_0x3afc8c[_0x0a9e('0x36')]));if(_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x5d9ddb[_0x0a9e('0x39')]=_['merge'](_0x5d9ddb['where'],{'$or':_[_0x0a9e('0x3a')](_0x5d9ddb['attributes'],function(_0x25eae0){var _0x4658df={};_0x4658df[_0x25eae0]={'$like':'%'+_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4658df;})});}_0x5d9ddb=_[_0x0a9e('0x38')]({},_0x5d9ddb,_0x12843d[_0x0a9e('0x3e')]);return _0x1756c7['getAgents'](_0x5d9ddb);}})['then'](function(_0x1889ed){if(_0x1889ed){_0x5ce99d=_0x1889ed['length'];if(!_0x12843d[_0x0a9e('0x2e')]['hasOwnProperty'](_0x0a9e('0x7e'))){_0x5d9ddb['limit']=qs['limit'](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5d9ddb['offset']=qs[_0x0a9e('0x1c')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x1756c7[_0x0a9e('0x7d')](_0x5d9ddb);}})[_0x0a9e('0x23')](function(_0x5ab0bc){if(_0x5ab0bc){return _0x5ab0bc?{'count':_0x5ce99d,'rows':_0x5ab0bc}:null;}})['then'](respondWithResult(_0x2ed526,null))[_0x0a9e('0x42')](handleError(_0x2ed526,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 931bf14..f395eed 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 _0x5d0a=['emit','hasOwnProperty','hook','exports','events','Team','save','update','remove'];(function(_0x3c135d,_0x2e81dd){var _0x359dc0=function(_0x60393){while(--_0x60393){_0x3c135d['push'](_0x3c135d['shift']());}};_0x359dc0(++_0x2e81dd);}(_0x5d0a,0x175));var _0xa5d0=function(_0x15a022,_0x573aed){_0x15a022=_0x15a022-0x0;var _0x45049e=_0x5d0a[_0x15a022];return _0x45049e;};'use strict';var EventEmitter=require(_0xa5d0('0x0'));var Team=require('../../mysqldb')['db'][_0xa5d0('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa5d0('0x2'),'afterUpdate':_0xa5d0('0x3'),'afterDestroy':_0xa5d0('0x4')};function emitEvent(_0x12f4cf){return function(_0x5b4b98,_0x24b2b5,_0x81c8f7){TeamEvents[_0xa5d0('0x5')](_0x12f4cf+':'+_0x5b4b98['id'],_0x5b4b98);TeamEvents[_0xa5d0('0x5')](_0x12f4cf,_0x5b4b98);_0x81c8f7(null);};}for(var e in events){if(events[_0xa5d0('0x6')](e)){var event=events[e];Team[_0xa5d0('0x7')](e,emitEvent(event));}}module[_0xa5d0('0x8')]=TeamEvents; \ No newline at end of file +var _0x2ace=['emit','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','update','remove'];(function(_0x1d7e6b,_0x158768){var _0x34b9e0=function(_0xc68e4c){while(--_0xc68e4c){_0x1d7e6b['push'](_0x1d7e6b['shift']());}};_0x34b9e0(++_0x158768);}(_0x2ace,0x17e));var _0xe2ac=function(_0x24f870,_0x2c8a88){_0x24f870=_0x24f870-0x0;var _0x5d065b=_0x2ace[_0x24f870];return _0x5d065b;};'use strict';var EventEmitter=require('events');var Team=require(_0xe2ac('0x0'))['db'][_0xe2ac('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe2ac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe2ac('0x3'),'afterDestroy':_0xe2ac('0x4')};function emitEvent(_0x47c3a2){return function(_0x171092,_0x464ec4,_0x240663){TeamEvents[_0xe2ac('0x5')](_0x47c3a2+':'+_0x171092['id'],_0x171092);TeamEvents[_0xe2ac('0x5')](_0x47c3a2,_0x171092);_0x240663(null);};}for(var e in events){if(events[_0xe2ac('0x6')](e)){var event=events[e];Team[_0xe2ac('0x7')](e,emitEvent(event));}}module[_0xe2ac('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index e839a1a..df820c1 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 _0xefa9=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./team.attributes','exports','teams','lodash'];(function(_0x1760f3,_0x6f17b9){var _0x52139b=function(_0x1e7f32){while(--_0x1e7f32){_0x1760f3['push'](_0x1760f3['shift']());}};_0x52139b(++_0x6f17b9);}(_0xefa9,0x131));var _0x9efa=function(_0x1fbe54,_0x1cd333){_0x1fbe54=_0x1fbe54-0x0;var _0x2b6665=_0xefa9[_0x1fbe54];return _0x2b6665;};'use strict';var _=require(_0x9efa('0x0'));var util=require('util');var logger=require(_0x9efa('0x1'))('api');var moment=require(_0x9efa('0x2'));var BPromise=require(_0x9efa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9efa('0x4'));var config=require(_0x9efa('0x5'));var attributes=require(_0x9efa('0x6'));module[_0x9efa('0x7')]=function(_0x5ddf11,_0x293c42){return _0x5ddf11['define']('Team',attributes,{'tableName':_0x9efa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d4b=['api','moment','bluebird','request-promise','path','rimraf','exports','Team','teams','lodash','util','../../config/logger'];(function(_0x53e5af,_0xc1a089){var _0x288ea9=function(_0x21731a){while(--_0x21731a){_0x53e5af['push'](_0x53e5af['shift']());}};_0x288ea9(++_0xc1a089);}(_0x2d4b,0x195));var _0xb2d4=function(_0x47a14b,_0x6f8c0){_0x47a14b=_0x47a14b-0x0;var _0x52cf12=_0x2d4b[_0x47a14b];return _0x52cf12;};'use strict';var _=require(_0xb2d4('0x0'));var util=require(_0xb2d4('0x1'));var logger=require(_0xb2d4('0x2'))(_0xb2d4('0x3'));var moment=require(_0xb2d4('0x4'));var BPromise=require(_0xb2d4('0x5'));var rp=require(_0xb2d4('0x6'));var fs=require('fs');var path=require(_0xb2d4('0x7'));var rimraf=require(_0xb2d4('0x8'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xb2d4('0x9')]=function(_0x40c7d5,_0x4e6eb1){return _0x40c7d5['define'](_0xb2d4('0xa'),attributes,{'tableName':_0xb2d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index b30c4a5..8025553 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 _0x4b2a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x393a64,_0x1d93fb){var _0x271593=function(_0x539b19){while(--_0x539b19){_0x393a64['push'](_0x393a64['shift']());}};_0x271593(++_0x1d93fb);}(_0x4b2a,0x80));var _0xa4b2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4b2a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa4b2('0x0'));var util=require(_0xa4b2('0x1'));var moment=require('moment');var BPromise=require(_0xa4b2('0x2'));var rs=require(_0xa4b2('0x3'));var fs=require('fs');var Redis=require(_0xa4b2('0x4'));var db=require(_0xa4b2('0x5'))['db'];var utils=require(_0xa4b2('0x6'));var logger=require('../../config/logger')(_0xa4b2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa4b2('0x8')][_0xa4b2('0x9')]({'port':0x232a});config[_0xa4b2('0xa')]=_['defaults'](config[_0xa4b2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa4b2('0xb'))(new Redis(config[_0xa4b2('0xa')]));require(_0xa4b2('0xc'))[_0xa4b2('0xd')](socket);function respondWithRpcPromise(_0x8f7827,_0x4d18d8,_0x4c95fe){return new BPromise(function(_0x567ced,_0x5bb4c6){return client[_0xa4b2('0xe')](_0x8f7827,_0x4c95fe)[_0xa4b2('0xf')](function(_0x47cac5){logger[_0xa4b2('0x10')](_0xa4b2('0x11'),_0x4d18d8,_0xa4b2('0x12'));logger[_0xa4b2('0x13')](_0xa4b2('0x14'),_0x4d18d8,'request\x20sent',JSON[_0xa4b2('0x15')](_0x47cac5));if(_0x47cac5[_0xa4b2('0x16')]){if(_0x47cac5[_0xa4b2('0x16')][_0xa4b2('0x17')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x4d18d8,_0x47cac5[_0xa4b2('0x16')][_0xa4b2('0x18')]);return _0x5bb4c6(_0x47cac5[_0xa4b2('0x16')][_0xa4b2('0x18')]);}logger[_0xa4b2('0x16')](_0xa4b2('0x11'),_0x4d18d8,_0x47cac5[_0xa4b2('0x16')][_0xa4b2('0x18')]);return _0x567ced(_0x47cac5[_0xa4b2('0x16')][_0xa4b2('0x18')]);}else{logger[_0xa4b2('0x10')](_0xa4b2('0x11'),_0x4d18d8,_0xa4b2('0x12'));_0x567ced(_0x47cac5[_0xa4b2('0x19')][_0xa4b2('0x18')]);}})['catch'](function(_0x535322){logger[_0xa4b2('0x16')]('Team,\x20%s,\x20%s',_0x4d18d8,_0x535322);_0x5bb4c6(_0x535322);});});} \ No newline at end of file +var _0x26ba=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x26ba,0x176));var _0xa26b=function(_0x4cb819,_0x382986){_0x4cb819=_0x4cb819-0x0;var _0x33fb18=_0x26ba[_0x4cb819];return _0x33fb18;};'use strict';var _=require('lodash');var util=require(_0xa26b('0x0'));var moment=require(_0xa26b('0x1'));var BPromise=require(_0xa26b('0x2'));var rs=require(_0xa26b('0x3'));var fs=require('fs');var Redis=require(_0xa26b('0x4'));var db=require(_0xa26b('0x5'))['db'];var utils=require(_0xa26b('0x6'));var logger=require('../../config/logger')(_0xa26b('0x7'));var config=require(_0xa26b('0x8'));var jayson=require(_0xa26b('0x9'));var client=jayson[_0xa26b('0xa')]['http']({'port':0x232a});config[_0xa26b('0xb')]=_[_0xa26b('0xc')](config['redis'],{'host':_0xa26b('0xd'),'port':0x18eb});var socket=require(_0xa26b('0xe'))(new Redis(config[_0xa26b('0xb')]));require(_0xa26b('0xf'))['register'](socket);function respondWithRpcPromise(_0x843c9f,_0x5382f8,_0x2feec5){return new BPromise(function(_0x3a09ab,_0x516b9b){return client[_0xa26b('0x10')](_0x843c9f,_0x2feec5)['then'](function(_0x29a35f){logger['info'](_0xa26b('0x11'),_0x5382f8,_0xa26b('0x12'));logger[_0xa26b('0x13')](_0xa26b('0x14'),_0x5382f8,_0xa26b('0x12'),JSON[_0xa26b('0x15')](_0x29a35f));if(_0x29a35f[_0xa26b('0x16')]){if(_0x29a35f['error'][_0xa26b('0x17')]===0x1f4){logger['error'](_0xa26b('0x11'),_0x5382f8,_0x29a35f[_0xa26b('0x16')][_0xa26b('0x18')]);return _0x516b9b(_0x29a35f[_0xa26b('0x16')]['message']);}logger[_0xa26b('0x16')](_0xa26b('0x11'),_0x5382f8,_0x29a35f[_0xa26b('0x16')]['message']);return _0x3a09ab(_0x29a35f['error'][_0xa26b('0x18')]);}else{logger['info'](_0xa26b('0x11'),_0x5382f8,'request\x20sent');_0x3a09ab(_0x29a35f[_0xa26b('0x19')][_0xa26b('0x18')]);}})[_0xa26b('0x1a')](function(_0x308733){logger[_0xa26b('0x16')](_0xa26b('0x11'),_0x5382f8,_0x308733);_0x516b9b(_0x308733);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 140a1d6..ff80b0e 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 _0x17d0=['update','emit','removeListener','register','length','team:','./team.events','remove'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x17d0,0x1be));var _0x017d=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0x17d0[_0x1139d0];return _0xcc01a6;};'use strict';var TeamEvents=require(_0x017d('0x0'));var events=['save',_0x017d('0x1'),_0x017d('0x2')];function createListener(_0xee2015,_0x27bc14){return function(_0x47adbb){_0x27bc14[_0x017d('0x3')](_0xee2015,_0x47adbb);};}function removeListener(_0x457e07,_0x14053f){return function(){TeamEvents[_0x017d('0x4')](_0x457e07,_0x14053f);};}exports[_0x017d('0x5')]=function(_0x54ee5b){for(var _0x1d45ab=0x0,_0x402f72=events[_0x017d('0x6')];_0x1d45ab<_0x402f72;_0x1d45ab++){var _0x151ed9=events[_0x1d45ab];var _0x57471e=createListener(_0x017d('0x7')+_0x151ed9,_0x54ee5b);TeamEvents['on'](_0x151ed9,_0x57471e);}}; \ No newline at end of file +var _0x2a8d=['removeListener','register','length','team:','./team.events','update'];(function(_0x57ce8d,_0x1fde89){var _0x5ca8d5=function(_0x27c653){while(--_0x27c653){_0x57ce8d['push'](_0x57ce8d['shift']());}};_0x5ca8d5(++_0x1fde89);}(_0x2a8d,0xf4));var _0xd2a8=function(_0xa223ad,_0x5a574b){_0xa223ad=_0xa223ad-0x0;var _0x306d47=_0x2a8d[_0xa223ad];return _0x306d47;};'use strict';var TeamEvents=require(_0xd2a8('0x0'));var events=['save','remove',_0xd2a8('0x1')];function createListener(_0x1c8173,_0x137488){return function(_0x4c92b0){_0x137488['emit'](_0x1c8173,_0x4c92b0);};}function removeListener(_0x580d2c,_0x587223){return function(){TeamEvents[_0xd2a8('0x2')](_0x580d2c,_0x587223);};}exports[_0xd2a8('0x3')]=function(_0x42c0c0){for(var _0x2fb292=0x0,_0xe93529=events[_0xd2a8('0x4')];_0x2fb292<_0xe93529;_0x2fb292++){var _0x310bed=events[_0x2fb292];var _0x27523e=createListener(_0xd2a8('0x5')+_0x310bed,_0x42c0c0);TeamEvents['on'](_0x310bed,_0x27523e);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index fc57a20..4c4c098 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 _0xda4f=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','post','create','/:id','update','delete'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xda4f,0x158));var _0xfda4=function(_0x498865,_0x30bd0a){_0x498865=_0x498865-0x0;var _0x2f7f0f=_0xda4f[_0x498865];return _0x2f7f0f;};'use strict';var multer=require(_0xfda4('0x0'));var util=require('util');var path=require(_0xfda4('0x1'));var timeout=require(_0xfda4('0x2'));var express=require(_0xfda4('0x3'));var router=express[_0xfda4('0x4')]();var auth=require(_0xfda4('0x5'));var interaction=require(_0xfda4('0x6'));var config=require(_0xfda4('0x7'));var controller=require(_0xfda4('0x8'));router[_0xfda4('0x9')]('/',auth[_0xfda4('0xa')](),controller['index']);router['get']('/:id',auth[_0xfda4('0xa')](),controller['show']);router[_0xfda4('0xb')]('/',auth[_0xfda4('0xa')](),controller[_0xfda4('0xc')]);router['put'](_0xfda4('0xd'),auth['isAuthenticated'](),controller[_0xfda4('0xe')]);router[_0xfda4('0xf')]('/:id',auth[_0xfda4('0xa')](),controller[_0xfda4('0x10')]);module[_0xfda4('0x11')]=router; \ No newline at end of file +var _0xa3cc=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports'];(function(_0x32cbf2,_0x51acfa){var _0x1e7479=function(_0x4dc335){while(--_0x4dc335){_0x32cbf2['push'](_0x32cbf2['shift']());}};_0x1e7479(++_0x51acfa);}(_0xa3cc,0x100));var _0xca3c=function(_0x129d8e,_0x3c5473){_0x129d8e=_0x129d8e-0x0;var _0x10f09c=_0xa3cc[_0x129d8e];return _0x10f09c;};'use strict';var multer=require(_0xca3c('0x0'));var util=require('util');var path=require(_0xca3c('0x1'));var timeout=require(_0xca3c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xca3c('0x3'));var interaction=require(_0xca3c('0x4'));var config=require(_0xca3c('0x5'));var controller=require('./template.controller');router[_0xca3c('0x6')]('/',auth[_0xca3c('0x7')](),controller[_0xca3c('0x8')]);router[_0xca3c('0x6')](_0xca3c('0x9'),auth['isAuthenticated'](),controller[_0xca3c('0xa')]);router[_0xca3c('0xb')]('/',auth[_0xca3c('0x7')](),controller[_0xca3c('0xc')]);router[_0xca3c('0xd')](_0xca3c('0x9'),auth[_0xca3c('0x7')](),controller['update']);router[_0xca3c('0xe')]('/:id',auth[_0xca3c('0x7')](),controller['destroy']);module[_0xca3c('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 512223a..0c865b2 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 _0x1585=['sequelize','STRING','TEXT'];(function(_0x12183b,_0x15954b){var _0x946ae9=function(_0x40c649){while(--_0x40c649){_0x12183b['push'](_0x12183b['shift']());}};_0x946ae9(++_0x15954b);}(_0x1585,0x123));var _0x5158=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1585[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x5158('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5158('0x1')]},'html':{'type':Sequelize[_0x5158('0x2')]}}; \ No newline at end of file +var _0x1b1f=['TEXT','exports','STRING'];(function(_0x55e1dc,_0x12c56c){var _0x5ec76c=function(_0x209062){while(--_0x209062){_0x55e1dc['push'](_0x55e1dc['shift']());}};_0x5ec76c(++_0x12c56c);}(_0x1b1f,0xfa));var _0xf1b1=function(_0x5a4af5,_0x36eec8){_0x5a4af5=_0x5a4af5-0x0;var _0x4cf27f=_0x1b1f[_0x5a4af5];return _0x4cf27f;};'use strict';var Sequelize=require('sequelize');module[_0xf1b1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf1b1('0x1')]},'html':{'type':Sequelize[_0xf1b1('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b33f974..cf95d00 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 _0x416a=['sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','then','Templates','UserProfileResource','destroy','error','stack','name','send','index','Template','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','key','field','include','findAll','rows','catch','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x416a,0xeb));var _0xa416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x416a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xa416('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa416('0x1'));var zipdir=require(_0xa416('0x2'));var jsonpatch=require(_0xa416('0x3'));var rp=require(_0xa416('0x4'));var moment=require(_0xa416('0x5'));var BPromise=require(_0xa416('0x6'));var Mustache=require(_0xa416('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa416('0x8'));var csv=require(_0xa416('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa416('0xa'));var crypto=require(_0xa416('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa416('0xc'));var toCsv=require(_0xa416('0x9'));var querystring=require(_0xa416('0xd'));var Papa=require(_0xa416('0xe'));var Redis=require(_0xa416('0xf'));var authService=require(_0xa416('0x10'));var qs=require(_0xa416('0x11'));var hardwareService=require(_0xa416('0x12'));var logger=require(_0xa416('0x13'))(_0xa416('0x14'));var utils=require(_0xa416('0x15'));var config=require('../../config/environment');var db=require(_0xa416('0x16'))['db'];function respondWithStatusCode(_0x11298c,_0x2e2c74){_0x2e2c74=_0x2e2c74||0xcc;return function(_0x462195){if(_0x462195){return _0x11298c[_0xa416('0x17')](_0x2e2c74);}return _0x11298c[_0xa416('0x18')](_0x2e2c74)[_0xa416('0x19')]();};}function respondWithResult(_0xd95c8,_0x11d2e7){_0x11d2e7=_0x11d2e7||0xc8;return function(_0x4afe01){if(_0x4afe01){return _0xd95c8[_0xa416('0x18')](_0x11d2e7)['json'](_0x4afe01);}};}function respondWithFilteredResult(_0x941b9e,_0x3e6494){return function(_0x5ad910){if(_0x5ad910){var _0x5f22b0=_0x5ad910[_0xa416('0x1a')],_0x44e549=_0x3e6494[_0xa416('0x1b')],_0x1eb7ac=_0x3e6494[_0xa416('0x1b')]+_0x3e6494['limit'],_0x8738cc;if(_0x1eb7ac>=_0x5f22b0){_0x1eb7ac=_0x5f22b0;_0x8738cc=0xc8;}else{_0x8738cc=0xce;}_0x941b9e[_0xa416('0x18')](_0x8738cc);return _0x941b9e[_0xa416('0x1c')](_0xa416('0x1d'),_0x44e549+'-'+_0x1eb7ac+'/'+_0x5f22b0)[_0xa416('0x1e')](_0x5ad910);}return null;};}function patchUpdates(_0x1541b6){return function(_0xc743df){try{jsonpatch[_0xa416('0x1f')](_0xc743df,_0x1541b6,!![]);}catch(_0x485cc3){return BPromise[_0xa416('0x20')](_0x485cc3);}return _0xc743df['save']();};}function saveUpdates(_0x5a2e16,_0x23f41d){return function(_0x247088){if(_0x247088){return _0x247088[_0xa416('0x21')](_0x5a2e16)[_0xa416('0x22')](function(_0x9e63d8){return _0x9e63d8;});}return null;};}function removeEntity(_0x5ca874,_0x33b9cf){return function(_0x4e23cc){if(_0x4e23cc){return _0x4e23cc['destroy']()[_0xa416('0x22')](function(){var _0x47db8e=_0x4e23cc['get']({'plain':!![]});var _0x3689e1=_0xa416('0x23');return db[_0xa416('0x24')][_0xa416('0x25')]({'where':{'type':_0x3689e1,'resourceId':_0x47db8e['id']}})[_0xa416('0x22')](function(){return _0x4e23cc;});})[_0xa416('0x22')](function(){_0x5ca874['status'](0xcc)[_0xa416('0x19')]();});}};}function handleEntityNotFound(_0x550717,_0x3f7e7c){return function(_0x15ecfe){if(!_0x15ecfe){_0x550717['sendStatus'](0x194);}return _0x15ecfe;};}function handleError(_0x5a01a2,_0x3791ae){_0x3791ae=_0x3791ae||0x1f4;return function(_0x533879){logger[_0xa416('0x26')](_0x533879[_0xa416('0x27')]);if(_0x533879[_0xa416('0x28')]){delete _0x533879['name'];}_0x5a01a2[_0xa416('0x18')](_0x3791ae)[_0xa416('0x29')](_0x533879);};}exports[_0xa416('0x2a')]=function(_0x1f6c10,_0x43ad58){var _0x46bb6c={},_0x55c94c={},_0x2168bf={'count':0x0,'rows':[]};var _0x49007f=db[_0xa416('0x2b')][_0xa416('0x2c')];_0x55c94c[_0xa416('0x2d')]=_[_0xa416('0x2e')](_0x49007f);_0x55c94c['query']=_['keys'](_0x1f6c10['query']);_0x55c94c[_0xa416('0x2f')]=_[_0xa416('0x30')](_0x55c94c[_0xa416('0x2d')],_0x55c94c[_0xa416('0x31')]);_0x46bb6c[_0xa416('0x32')]=_[_0xa416('0x30')](_0x55c94c[_0xa416('0x2d')],qs['fields'](_0x1f6c10[_0xa416('0x31')][_0xa416('0x33')]));_0x46bb6c[_0xa416('0x32')]=_0x46bb6c[_0xa416('0x32')][_0xa416('0x34')]?_0x46bb6c[_0xa416('0x32')]:_0x55c94c[_0xa416('0x2d')];if(!_0x1f6c10['query'][_0xa416('0x35')]('nolimit')){_0x46bb6c[_0xa416('0x36')]=qs['limit'](_0x1f6c10[_0xa416('0x31')][_0xa416('0x36')]);_0x46bb6c[_0xa416('0x1b')]=qs[_0xa416('0x1b')](_0x1f6c10[_0xa416('0x31')][_0xa416('0x1b')]);}_0x46bb6c[_0xa416('0x37')]=qs[_0xa416('0x38')](_0x1f6c10['query'][_0xa416('0x38')]);_0x46bb6c['where']=qs[_0xa416('0x2f')](_[_0xa416('0x39')](_0x1f6c10['query'],_0x55c94c[_0xa416('0x2f')]));if(_0x1f6c10['query'][_0xa416('0x3a')]){_0x46bb6c[_0xa416('0x3b')]=_[_0xa416('0x3c')](_0x46bb6c[_0xa416('0x3b')],{'$or':_[_0xa416('0x3d')](_0x49007f,function(_0x2eaef3){if(_0x2eaef3['type'][_0xa416('0x3e')]!=='VIRTUAL'){var _0x1148ef={};_0x1148ef[_0x2eaef3[_0xa416('0x3f')]]={'$like':'%'+_0x1f6c10[_0xa416('0x31')]['filter']+'%'};return _0x1148ef;}})});}_0x46bb6c=_[_0xa416('0x3c')]({},_0x46bb6c,_0x1f6c10['options']);var _0x1b9e9a={'where':_0x46bb6c[_0xa416('0x3b')]};return db[_0xa416('0x2b')]['count'](_0x1b9e9a)[_0xa416('0x22')](function(_0x3cacee){_0x2168bf[_0xa416('0x1a')]=_0x3cacee;if(_0x1f6c10[_0xa416('0x31')]['includeAll']){_0x46bb6c[_0xa416('0x40')]=[{'all':!![]}];}return db[_0xa416('0x2b')][_0xa416('0x41')](_0x46bb6c);})[_0xa416('0x22')](function(_0x985495){_0x2168bf[_0xa416('0x42')]=_0x985495;return _0x2168bf;})[_0xa416('0x22')](respondWithFilteredResult(_0x43ad58,_0x46bb6c))[_0xa416('0x43')](handleError(_0x43ad58,null));};exports[_0xa416('0x44')]=function(_0x1f0a28,_0x562fca){var _0x1d97df={'raw':!![],'where':{'id':_0x1f0a28[_0xa416('0x45')]['id']}},_0x5be3e2={};_0x5be3e2[_0xa416('0x2d')]=_[_0xa416('0x2e')](db[_0xa416('0x2b')][_0xa416('0x2c')]);_0x5be3e2[_0xa416('0x31')]=_[_0xa416('0x2e')](_0x1f0a28[_0xa416('0x31')]);_0x5be3e2['filters']=_[_0xa416('0x30')](_0x5be3e2['model'],_0x5be3e2[_0xa416('0x31')]);_0x1d97df[_0xa416('0x32')]=_[_0xa416('0x30')](_0x5be3e2['model'],qs[_0xa416('0x33')](_0x1f0a28[_0xa416('0x31')][_0xa416('0x33')]));_0x1d97df[_0xa416('0x32')]=_0x1d97df[_0xa416('0x32')][_0xa416('0x34')]?_0x1d97df[_0xa416('0x32')]:_0x5be3e2[_0xa416('0x2d')];if(_0x1f0a28[_0xa416('0x31')]['includeAll']){_0x1d97df['include']=[{'all':!![]}];}_0x1d97df=_[_0xa416('0x3c')]({},_0x1d97df,_0x1f0a28[_0xa416('0x46')]);return db[_0xa416('0x2b')][_0xa416('0x47')](_0x1d97df)[_0xa416('0x22')](handleEntityNotFound(_0x562fca,null))[_0xa416('0x22')](respondWithResult(_0x562fca,null))[_0xa416('0x43')](handleError(_0x562fca,null));};exports['create']=function(_0x5c12f7,_0x245e18){return db[_0xa416('0x2b')][_0xa416('0x48')](_0x5c12f7['body'],{})[_0xa416('0x22')](function(_0x5aaf3a){var _0x29768a=_0x5c12f7[_0xa416('0x49')][_0xa416('0x4a')]({'plain':!![]});if(!_0x29768a)throw new Error(_0xa416('0x4b'));if(_0x29768a['role']==='user'){var _0x3d0b9b=_0x5aaf3a['get']({'plain':!![]});var _0x2492fc='Templates';return db[_0xa416('0x4c')]['find']({'where':{'name':_0x2492fc,'userProfileId':_0x29768a[_0xa416('0x4d')]},'raw':!![]})['then'](function(_0x4271f0){if(_0x4271f0&&_0x4271f0[_0xa416('0x4e')]===0x0){return db[_0xa416('0x24')][_0xa416('0x48')]({'name':_0x3d0b9b[_0xa416('0x28')],'resourceId':_0x3d0b9b['id'],'type':_0x4271f0[_0xa416('0x28')],'sectionId':_0x4271f0['id']},{})[_0xa416('0x22')](function(){return _0x5aaf3a;});}else{return _0x5aaf3a;}})[_0xa416('0x43')](function(_0x11e461){logger[_0xa416('0x26')](_0xa416('0x4f'),_0x11e461);throw _0x11e461;});}return _0x5aaf3a;})['then'](respondWithResult(_0x245e18,0xc9))[_0xa416('0x43')](handleError(_0x245e18,null));};exports[_0xa416('0x21')]=function(_0x37e1e3,_0x32e732){if(_0x37e1e3['body']['id']){delete _0x37e1e3[_0xa416('0x50')]['id'];}return db[_0xa416('0x2b')]['find']({'where':{'id':_0x37e1e3[_0xa416('0x45')]['id']}})[_0xa416('0x22')](handleEntityNotFound(_0x32e732,null))[_0xa416('0x22')](saveUpdates(_0x37e1e3[_0xa416('0x50')],null))[_0xa416('0x22')](respondWithResult(_0x32e732,null))[_0xa416('0x43')](handleError(_0x32e732,null));};exports[_0xa416('0x25')]=function(_0x19a510,_0x216e30){return db[_0xa416('0x2b')][_0xa416('0x47')]({'where':{'id':_0x19a510['params']['id']}})[_0xa416('0x22')](handleEntityNotFound(_0x216e30,null))[_0xa416('0x22')](removeEntity(_0x216e30,null))['catch'](handleError(_0x216e30,null));}; \ No newline at end of file +var _0x3943=['offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','Template','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','field','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x13f0f2,_0x2b3566){var _0xe733ed=function(_0x2c64e4){while(--_0x2c64e4){_0x13f0f2['push'](_0x13f0f2['shift']());}};_0xe733ed(++_0x2b3566);}(_0x3943,0x127));var _0x3394=function(_0x1925f4,_0x446dc9){_0x1925f4=_0x1925f4-0x0;var _0x3ae899=_0x3943[_0x1925f4];return _0x3ae899;};'use strict';var pdf=require(_0x3394('0x0'));var emlformat=require(_0x3394('0x1'));var rimraf=require(_0x3394('0x2'));var zipdir=require(_0x3394('0x3'));var jsonpatch=require(_0x3394('0x4'));var rp=require(_0x3394('0x5'));var moment=require(_0x3394('0x6'));var BPromise=require(_0x3394('0x7'));var Mustache=require(_0x3394('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3394('0x9'));var ejs=require(_0x3394('0xa'));var fs=require('fs');var _=require(_0x3394('0xb'));var squel=require(_0x3394('0xc'));var crypto=require('crypto');var jsforce=require(_0x3394('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3394('0xe'));var Papa=require(_0x3394('0xf'));var Redis=require(_0x3394('0x10'));var authService=require(_0x3394('0x11'));var qs=require(_0x3394('0x12'));var hardwareService=require(_0x3394('0x13'));var logger=require(_0x3394('0x14'))(_0x3394('0x15'));var utils=require(_0x3394('0x16'));var config=require('../../config/environment');var db=require(_0x3394('0x17'))['db'];function respondWithStatusCode(_0x55f279,_0x1dd97e){_0x1dd97e=_0x1dd97e||0xcc;return function(_0x4b4dba){if(_0x4b4dba){return _0x55f279[_0x3394('0x18')](_0x1dd97e);}return _0x55f279[_0x3394('0x19')](_0x1dd97e)[_0x3394('0x1a')]();};}function respondWithResult(_0x3d77c1,_0xf433ff){_0xf433ff=_0xf433ff||0xc8;return function(_0x6c61c1){if(_0x6c61c1){return _0x3d77c1[_0x3394('0x19')](_0xf433ff)[_0x3394('0x1b')](_0x6c61c1);}};}function respondWithFilteredResult(_0x17cce1,_0x2cfb38){return function(_0x1319aa){if(_0x1319aa){var _0x9a2c21=_0x1319aa[_0x3394('0x1c')],_0x16399b=_0x2cfb38['offset'],_0x4af5d1=_0x2cfb38[_0x3394('0x1d')]+_0x2cfb38[_0x3394('0x1e')],_0x407e4d;if(_0x4af5d1>=_0x9a2c21){_0x4af5d1=_0x9a2c21;_0x407e4d=0xc8;}else{_0x407e4d=0xce;}_0x17cce1[_0x3394('0x19')](_0x407e4d);return _0x17cce1['set'](_0x3394('0x1f'),_0x16399b+'-'+_0x4af5d1+'/'+_0x9a2c21)[_0x3394('0x1b')](_0x1319aa);}return null;};}function patchUpdates(_0x3a5f28){return function(_0x1b8b1e){try{jsonpatch[_0x3394('0x20')](_0x1b8b1e,_0x3a5f28,!![]);}catch(_0x57a14b){return BPromise[_0x3394('0x21')](_0x57a14b);}return _0x1b8b1e[_0x3394('0x22')]();};}function saveUpdates(_0x4ed2b6,_0x31643d){return function(_0x37e4d2){if(_0x37e4d2){return _0x37e4d2[_0x3394('0x23')](_0x4ed2b6)[_0x3394('0x24')](function(_0x57bb0c){return _0x57bb0c;});}return null;};}function removeEntity(_0xfb0363,_0x57f3cd){return function(_0x4b31d9){if(_0x4b31d9){return _0x4b31d9[_0x3394('0x25')]()['then'](function(){var _0x13b927=_0x4b31d9[_0x3394('0x26')]({'plain':!![]});var _0x27df3e=_0x3394('0x27');return db[_0x3394('0x28')][_0x3394('0x25')]({'where':{'type':_0x27df3e,'resourceId':_0x13b927['id']}})[_0x3394('0x24')](function(){return _0x4b31d9;});})[_0x3394('0x24')](function(){_0xfb0363['status'](0xcc)[_0x3394('0x1a')]();});}};}function handleEntityNotFound(_0x58d244,_0x209757){return function(_0x2a657e){if(!_0x2a657e){_0x58d244[_0x3394('0x18')](0x194);}return _0x2a657e;};}function handleError(_0x2d0627,_0x56bc02){_0x56bc02=_0x56bc02||0x1f4;return function(_0x4403c1){logger[_0x3394('0x29')](_0x4403c1[_0x3394('0x2a')]);if(_0x4403c1['name']){delete _0x4403c1[_0x3394('0x2b')];}_0x2d0627[_0x3394('0x19')](_0x56bc02)['send'](_0x4403c1);};}exports[_0x3394('0x2c')]=function(_0x15a1bc,_0x4d08bd){var _0x1a46f4={},_0x4147a6={},_0x24322c={'count':0x0,'rows':[]};var _0x10a0a9=db[_0x3394('0x2d')]['rawAttributes'];_0x4147a6[_0x3394('0x2e')]=_[_0x3394('0x2f')](_0x10a0a9);_0x4147a6['query']=_[_0x3394('0x2f')](_0x15a1bc[_0x3394('0x30')]);_0x4147a6[_0x3394('0x31')]=_[_0x3394('0x32')](_0x4147a6[_0x3394('0x2e')],_0x4147a6[_0x3394('0x30')]);_0x1a46f4[_0x3394('0x33')]=_[_0x3394('0x32')](_0x4147a6[_0x3394('0x2e')],qs[_0x3394('0x34')](_0x15a1bc[_0x3394('0x30')]['fields']));_0x1a46f4[_0x3394('0x33')]=_0x1a46f4[_0x3394('0x33')]['length']?_0x1a46f4[_0x3394('0x33')]:_0x4147a6[_0x3394('0x2e')];if(!_0x15a1bc[_0x3394('0x30')][_0x3394('0x35')]('nolimit')){_0x1a46f4[_0x3394('0x1e')]=qs[_0x3394('0x1e')](_0x15a1bc['query'][_0x3394('0x1e')]);_0x1a46f4[_0x3394('0x1d')]=qs[_0x3394('0x1d')](_0x15a1bc[_0x3394('0x30')][_0x3394('0x1d')]);}_0x1a46f4[_0x3394('0x36')]=qs[_0x3394('0x37')](_0x15a1bc[_0x3394('0x30')]['sort']);_0x1a46f4[_0x3394('0x38')]=qs[_0x3394('0x31')](_[_0x3394('0x39')](_0x15a1bc['query'],_0x4147a6['filters']));if(_0x15a1bc[_0x3394('0x30')][_0x3394('0x3a')]){_0x1a46f4[_0x3394('0x38')]=_[_0x3394('0x3b')](_0x1a46f4[_0x3394('0x38')],{'$or':_[_0x3394('0x3c')](_0x10a0a9,function(_0xd9b2d7){if(_0xd9b2d7[_0x3394('0x3d')]['key']!=='VIRTUAL'){var _0x8d3211={};_0x8d3211[_0xd9b2d7[_0x3394('0x3e')]]={'$like':'%'+_0x15a1bc[_0x3394('0x30')][_0x3394('0x3a')]+'%'};return _0x8d3211;}})});}_0x1a46f4=_['merge']({},_0x1a46f4,_0x15a1bc['options']);var _0x49ade3={'where':_0x1a46f4[_0x3394('0x38')]};return db[_0x3394('0x2d')][_0x3394('0x1c')](_0x49ade3)[_0x3394('0x24')](function(_0x5cdd5b){_0x24322c[_0x3394('0x1c')]=_0x5cdd5b;if(_0x15a1bc[_0x3394('0x30')][_0x3394('0x3f')]){_0x1a46f4[_0x3394('0x40')]=[{'all':!![]}];}return db[_0x3394('0x2d')][_0x3394('0x41')](_0x1a46f4);})[_0x3394('0x24')](function(_0x5e7646){_0x24322c[_0x3394('0x42')]=_0x5e7646;return _0x24322c;})[_0x3394('0x24')](respondWithFilteredResult(_0x4d08bd,_0x1a46f4))[_0x3394('0x43')](handleError(_0x4d08bd,null));};exports[_0x3394('0x44')]=function(_0x38bcdd,_0x343575){var _0x466daf={'raw':!![],'where':{'id':_0x38bcdd[_0x3394('0x45')]['id']}},_0x25e9dd={};_0x25e9dd[_0x3394('0x2e')]=_[_0x3394('0x2f')](db[_0x3394('0x2d')][_0x3394('0x46')]);_0x25e9dd[_0x3394('0x30')]=_['keys'](_0x38bcdd[_0x3394('0x30')]);_0x25e9dd[_0x3394('0x31')]=_[_0x3394('0x32')](_0x25e9dd[_0x3394('0x2e')],_0x25e9dd[_0x3394('0x30')]);_0x466daf['attributes']=_[_0x3394('0x32')](_0x25e9dd[_0x3394('0x2e')],qs['fields'](_0x38bcdd['query']['fields']));_0x466daf[_0x3394('0x33')]=_0x466daf[_0x3394('0x33')][_0x3394('0x47')]?_0x466daf[_0x3394('0x33')]:_0x25e9dd[_0x3394('0x2e')];if(_0x38bcdd[_0x3394('0x30')][_0x3394('0x3f')]){_0x466daf[_0x3394('0x40')]=[{'all':!![]}];}_0x466daf=_[_0x3394('0x3b')]({},_0x466daf,_0x38bcdd['options']);return db[_0x3394('0x2d')][_0x3394('0x48')](_0x466daf)[_0x3394('0x24')](handleEntityNotFound(_0x343575,null))[_0x3394('0x24')](respondWithResult(_0x343575,null))[_0x3394('0x43')](handleError(_0x343575,null));};exports[_0x3394('0x49')]=function(_0x13dfc0,_0x32bb74){return db['Template']['create'](_0x13dfc0[_0x3394('0x4a')],{})['then'](function(_0xf2276){var _0x102cd7=_0x13dfc0[_0x3394('0x4b')]['get']({'plain':!![]});if(!_0x102cd7)throw new Error(_0x3394('0x4c'));if(_0x102cd7[_0x3394('0x4d')]===_0x3394('0x4b')){var _0x474e47=_0xf2276['get']({'plain':!![]});var _0x14bba5=_0x3394('0x27');return db[_0x3394('0x4e')]['find']({'where':{'name':_0x14bba5,'userProfileId':_0x102cd7[_0x3394('0x4f')]},'raw':!![]})['then'](function(_0x5f36b5){if(_0x5f36b5&&_0x5f36b5[_0x3394('0x50')]===0x0){return db[_0x3394('0x28')][_0x3394('0x49')]({'name':_0x474e47[_0x3394('0x2b')],'resourceId':_0x474e47['id'],'type':_0x5f36b5['name'],'sectionId':_0x5f36b5['id']},{})[_0x3394('0x24')](function(){return _0xf2276;});}else{return _0xf2276;}})[_0x3394('0x43')](function(_0x4c1e87){logger[_0x3394('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c1e87);throw _0x4c1e87;});}return _0xf2276;})[_0x3394('0x24')](respondWithResult(_0x32bb74,0xc9))['catch'](handleError(_0x32bb74,null));};exports[_0x3394('0x23')]=function(_0x43405c,_0x4689d4){if(_0x43405c[_0x3394('0x4a')]['id']){delete _0x43405c[_0x3394('0x4a')]['id'];}return db[_0x3394('0x2d')][_0x3394('0x48')]({'where':{'id':_0x43405c[_0x3394('0x45')]['id']}})[_0x3394('0x24')](handleEntityNotFound(_0x4689d4,null))[_0x3394('0x24')](saveUpdates(_0x43405c['body'],null))[_0x3394('0x24')](respondWithResult(_0x4689d4,null))[_0x3394('0x43')](handleError(_0x4689d4,null));};exports['destroy']=function(_0x214b98,_0x2fadaa){return db[_0x3394('0x2d')]['find']({'where':{'id':_0x214b98[_0x3394('0x45')]['id']}})[_0x3394('0x24')](handleEntityNotFound(_0x2fadaa,null))[_0x3394('0x24')](removeEntity(_0x2fadaa,null))[_0x3394('0x43')](handleError(_0x2fadaa,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1ad7983..90cd69d 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 _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','tools_templates','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62e,0x1de));var _0xeb62=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb62e[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('Template',attributes,{'tableName':_0xeb62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed3c=['util','../../config/logger','api','bluebird','request-promise','path','./template.attributes','exports','lodash'];(function(_0x31df66,_0x1acb34){var _0x1f7770=function(_0x1b9db7){while(--_0x1b9db7){_0x31df66['push'](_0x31df66['shift']());}};_0x1f7770(++_0x1acb34);}(_0xed3c,0x1a6));var _0xced3=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0xed3c[_0x492221];return _0x398bf9;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('Template',attributes,{'tableName':'tools_templates','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 671e3c0..0d716bb 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 _0xfc9b=['model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','options','where','include','map','attributes'];(function(_0x4f60e9,_0x255fce){var _0x52416e=function(_0x15092a){while(--_0x15092a){_0x4f60e9['push'](_0x4f60e9['shift']());}};_0x52416e(++_0x255fce);}(_0xfc9b,0x156));var _0xbfc9=function(_0xa77a48,_0x4d2b22){_0xa77a48=_0xa77a48-0x0;var _0x1b0fbc=_0xfc9b[_0xa77a48];return _0x1b0fbc;};'use strict';var _=require(_0xbfc9('0x0'));var util=require(_0xbfc9('0x1'));var moment=require(_0xbfc9('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfc9('0x4'))['db'];var utils=require(_0xbfc9('0x5'));var logger=require(_0xbfc9('0x6'))(_0xbfc9('0x7'));var config=require(_0xbfc9('0x8'));var jayson=require(_0xbfc9('0x9'));var client=jayson[_0xbfc9('0xa')][_0xbfc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fd273,_0x4902e7,_0x58cd4c){return new BPromise(function(_0x569476,_0x1bea12){return client[_0xbfc9('0xc')](_0x2fd273,_0x58cd4c)[_0xbfc9('0xd')](function(_0x720369){logger[_0xbfc9('0xe')]('Template,\x20%s,\x20%s',_0x4902e7,'request\x20sent');logger[_0xbfc9('0xf')](_0xbfc9('0x10'),_0x4902e7,_0xbfc9('0x11'),JSON[_0xbfc9('0x12')](_0x720369));if(_0x720369[_0xbfc9('0x13')]){if(_0x720369[_0xbfc9('0x13')]['code']===0x1f4){logger[_0xbfc9('0x13')](_0xbfc9('0x14'),_0x4902e7,_0x720369[_0xbfc9('0x13')][_0xbfc9('0x15')]);return _0x1bea12(_0x720369['error'][_0xbfc9('0x15')]);}logger[_0xbfc9('0x13')](_0xbfc9('0x14'),_0x4902e7,_0x720369[_0xbfc9('0x13')][_0xbfc9('0x15')]);return _0x569476(_0x720369[_0xbfc9('0x13')][_0xbfc9('0x15')]);}else{logger[_0xbfc9('0xe')](_0xbfc9('0x14'),_0x4902e7,'request\x20sent');_0x569476(_0x720369[_0xbfc9('0x16')][_0xbfc9('0x15')]);}})[_0xbfc9('0x17')](function(_0xbf6d08){logger[_0xbfc9('0x13')](_0xbfc9('0x14'),_0x4902e7,_0xbf6d08);_0x1bea12(_0xbf6d08);});});}exports[_0xbfc9('0x18')]=function(_0x26bc39){var _0x24a344=this;return new Promise(function(_0x528454,_0xbf07fd){return db['Template']['findAll']({'raw':_0x26bc39['options']?_0x26bc39[_0xbfc9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26bc39['options']?_0x26bc39['options'][_0xbfc9('0x1a')]||null:null,'attributes':_0x26bc39[_0xbfc9('0x19')]?_0x26bc39[_0xbfc9('0x19')]['attributes']||null:null,'limit':_0x26bc39[_0xbfc9('0x19')]?_0x26bc39[_0xbfc9('0x19')]['limit']||null:null,'include':_0x26bc39[_0xbfc9('0x19')]?_0x26bc39[_0xbfc9('0x19')][_0xbfc9('0x1b')]?_[_0xbfc9('0x1c')](_0x26bc39[_0xbfc9('0x19')]['include'],function(_0x82c9dc){return{'model':db[_0x82c9dc['model']],'as':_0x82c9dc['as'],'attributes':_0x82c9dc[_0xbfc9('0x1d')],'include':_0x82c9dc[_0xbfc9('0x1b')]?_['map'](_0x82c9dc[_0xbfc9('0x1b')],function(_0x45137a){return{'model':db[_0x45137a[_0xbfc9('0x1e')]],'as':_0x45137a['as'],'attributes':_0x45137a[_0xbfc9('0x1d')],'include':_0x45137a['include']?_['map'](_0x45137a[_0xbfc9('0x1b')],function(_0x417b85){return{'model':db[_0x417b85[_0xbfc9('0x1e')]],'as':_0x417b85['as'],'attributes':_0x417b85['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c9742){logger[_0xbfc9('0xe')](_0xbfc9('0x18'),_0x26bc39);logger[_0xbfc9('0xf')](_0xbfc9('0x18'),_0x26bc39,JSON[_0xbfc9('0x12')](_0x5c9742));_0x528454(_0x5c9742);})[_0xbfc9('0x17')](function(_0x5cb2a5){logger[_0xbfc9('0x13')](_0xbfc9('0x18'),_0x5cb2a5[_0xbfc9('0x15')],_0x26bc39);_0xbf07fd(_0x24a344[_0xbfc9('0x13')](0x1f4,_0x5cb2a5[_0xbfc9('0x15')]));});});}; \ No newline at end of file +var _0xbc8f=['attributes','debug','GetTemplate','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','Template','findAll','options','limit','map','include','model'];(function(_0x757612,_0x51ff17){var _0x3a3c40=function(_0x1e9e0d){while(--_0x1e9e0d){_0x757612['push'](_0x757612['shift']());}};_0x3a3c40(++_0x51ff17);}(_0xbc8f,0x159));var _0xfbc8=function(_0x435e9a,_0x300ff5){_0x435e9a=_0x435e9a-0x0;var _0x173381=_0xbc8f[_0x435e9a];return _0x173381;};'use strict';var _=require(_0xfbc8('0x0'));var util=require('util');var moment=require(_0xfbc8('0x1'));var BPromise=require(_0xfbc8('0x2'));var rs=require(_0xfbc8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbc8('0x4'));var logger=require(_0xfbc8('0x5'))(_0xfbc8('0x6'));var config=require(_0xfbc8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfbc8('0x8')][_0xfbc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x298cf8,_0x12f308,_0x1695d2){return new BPromise(function(_0x1666f0,_0x20c52e){return client[_0xfbc8('0xa')](_0x298cf8,_0x1695d2)[_0xfbc8('0xb')](function(_0x21506a){logger[_0xfbc8('0xc')](_0xfbc8('0xd'),_0x12f308,_0xfbc8('0xe'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x12f308,_0xfbc8('0xe'),JSON[_0xfbc8('0xf')](_0x21506a));if(_0x21506a[_0xfbc8('0x10')]){if(_0x21506a[_0xfbc8('0x10')][_0xfbc8('0x11')]===0x1f4){logger[_0xfbc8('0x10')](_0xfbc8('0xd'),_0x12f308,_0x21506a[_0xfbc8('0x10')][_0xfbc8('0x12')]);return _0x20c52e(_0x21506a['error'][_0xfbc8('0x12')]);}logger[_0xfbc8('0x10')](_0xfbc8('0xd'),_0x12f308,_0x21506a[_0xfbc8('0x10')]['message']);return _0x1666f0(_0x21506a[_0xfbc8('0x10')][_0xfbc8('0x12')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x12f308,_0xfbc8('0xe'));_0x1666f0(_0x21506a[_0xfbc8('0x13')][_0xfbc8('0x12')]);}})['catch'](function(_0x585d49){logger[_0xfbc8('0x10')]('Template,\x20%s,\x20%s',_0x12f308,_0x585d49);_0x20c52e(_0x585d49);});});}exports['GetTemplate']=function(_0x4cdfca){var _0x47ea2b=this;return new Promise(function(_0x54e201,_0x1bec74){return db[_0xfbc8('0x14')][_0xfbc8('0x15')]({'raw':_0x4cdfca['options']?_0x4cdfca['options']['raw']===undefined?!![]:![]:!![],'where':_0x4cdfca[_0xfbc8('0x16')]?_0x4cdfca[_0xfbc8('0x16')]['where']||null:null,'attributes':_0x4cdfca[_0xfbc8('0x16')]?_0x4cdfca[_0xfbc8('0x16')]['attributes']||null:null,'limit':_0x4cdfca['options']?_0x4cdfca[_0xfbc8('0x16')][_0xfbc8('0x17')]||null:null,'include':_0x4cdfca[_0xfbc8('0x16')]?_0x4cdfca['options']['include']?_[_0xfbc8('0x18')](_0x4cdfca['options'][_0xfbc8('0x19')],function(_0x27b570){return{'model':db[_0x27b570[_0xfbc8('0x1a')]],'as':_0x27b570['as'],'attributes':_0x27b570['attributes'],'include':_0x27b570[_0xfbc8('0x19')]?_[_0xfbc8('0x18')](_0x27b570['include'],function(_0x4f70aa){return{'model':db[_0x4f70aa[_0xfbc8('0x1a')]],'as':_0x4f70aa['as'],'attributes':_0x4f70aa[_0xfbc8('0x1b')],'include':_0x4f70aa[_0xfbc8('0x19')]?_['map'](_0x4f70aa[_0xfbc8('0x19')],function(_0x2049aa){return{'model':db[_0x2049aa[_0xfbc8('0x1a')]],'as':_0x2049aa['as'],'attributes':_0x2049aa[_0xfbc8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550e83){logger[_0xfbc8('0xc')]('GetTemplate',_0x4cdfca);logger[_0xfbc8('0x1c')](_0xfbc8('0x1d'),_0x4cdfca,JSON['stringify'](_0x550e83));_0x54e201(_0x550e83);})[_0xfbc8('0x1e')](function(_0x3456c9){logger['error'](_0xfbc8('0x1d'),_0x3456c9[_0xfbc8('0x12')],_0x4cdfca);_0x1bec74(_0x47ea2b[_0xfbc8('0x10')](0x1f4,_0x3456c9[_0xfbc8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1eeabf7..45f6a6d 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 _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x1f80e1,_0x4d97fb){var _0x4a63d7=function(_0x5bb7e6){while(--_0x5bb7e6){_0x1f80e1['push'](_0x1f80e1['shift']());}};_0x4a63d7(++_0x4d97fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x1efdf9,_0x19f946){var _0x4855ab=function(_0x19a44f){while(--_0x19a44f){_0x1efdf9['push'](_0x1efdf9['shift']());}};_0x4855ab(++_0x19f946);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ccb2c49..e6e5d5d 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 _0xeb6c=['STRING'];(function(_0x353cba,_0x31c170){var _0x309ac8=function(_0x2dbcf2){while(--_0x2dbcf2){_0x353cba['push'](_0x353cba['shift']());}};_0x309ac8(++_0x31c170);}(_0xeb6c,0xb2));var _0xceb6=function(_0x2e52e0,_0x517c31){_0x2e52e0=_0x2e52e0-0x0;var _0x54918d=_0xeb6c[_0x2e52e0];return _0x54918d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xceb6('0x0')]},'channel':{'type':Sequelize[_0xceb6('0x0')]},'description':{'type':Sequelize[_0xceb6('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3e05=['BOOLEAN','sequelize','exports','STRING'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x3e05,0x149));var _0x53e0=function(_0x44141f,_0x2ca0aa){_0x44141f=_0x44141f-0x0;var _0x37c37c=_0x3e05[_0x44141f];return _0x37c37c;};'use strict';var Sequelize=require(_0x53e0('0x0'));module[_0x53e0('0x1')]={'name':{'type':Sequelize[_0x53e0('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x53e0('0x2')]},'status':{'type':Sequelize[_0x53e0('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 82cb589..01cd100 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 _0x0ca5=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Triggers','error','stack','name','index','Trigger','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','key','field','options','count','includeAll','include','findAll','rows','catch','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','map','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils'];(function(_0x3cb41d,_0x2d7f6d){var _0x4dc372=function(_0x2e7351){while(--_0x2e7351){_0x3cb41d['push'](_0x3cb41d['shift']());}};_0x4dc372(++_0x2d7f6d);}(_0x0ca5,0xfc));var _0x50ca=function(_0x5ced79,_0x2616a5){_0x5ced79=_0x5ced79-0x0;var _0x5849bd=_0x0ca5[_0x5ced79];return _0x5849bd;};'use strict';var pdf=require(_0x50ca('0x0'));var emlformat=require(_0x50ca('0x1'));var rimraf=require(_0x50ca('0x2'));var zipdir=require(_0x50ca('0x3'));var jsonpatch=require(_0x50ca('0x4'));var rp=require(_0x50ca('0x5'));var moment=require(_0x50ca('0x6'));var BPromise=require(_0x50ca('0x7'));var Mustache=require('mustache');var util=require(_0x50ca('0x8'));var path=require(_0x50ca('0x9'));var sox=require(_0x50ca('0xa'));var csv=require(_0x50ca('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x50ca('0xc'));var squel=require(_0x50ca('0xd'));var crypto=require('crypto');var jsforce=require(_0x50ca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x50ca('0xb'));var querystring=require('querystring');var Papa=require(_0x50ca('0xf'));var Redis=require(_0x50ca('0x10'));var authService=require(_0x50ca('0x11'));var qs=require(_0x50ca('0x12'));var hardwareService=require(_0x50ca('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x50ca('0x14'));var config=require(_0x50ca('0x15'));var db=require(_0x50ca('0x16'))['db'];function respondWithStatusCode(_0x144525,_0x97e3ed){_0x97e3ed=_0x97e3ed||0xcc;return function(_0x26797d){if(_0x26797d){return _0x144525[_0x50ca('0x17')](_0x97e3ed);}return _0x144525[_0x50ca('0x18')](_0x97e3ed)[_0x50ca('0x19')]();};}function respondWithResult(_0x27bf3a,_0x2dd081){_0x2dd081=_0x2dd081||0xc8;return function(_0x41cb54){if(_0x41cb54){return _0x27bf3a[_0x50ca('0x18')](_0x2dd081)[_0x50ca('0x1a')](_0x41cb54);}};}function respondWithFilteredResult(_0x3653b9,_0x512344){return function(_0x168436){if(_0x168436){var _0x5729e1=_0x168436['count'],_0x708d02=_0x512344[_0x50ca('0x1b')],_0x3035e5=_0x512344['offset']+_0x512344[_0x50ca('0x1c')],_0x1b9e58;if(_0x3035e5>=_0x5729e1){_0x3035e5=_0x5729e1;_0x1b9e58=0xc8;}else{_0x1b9e58=0xce;}_0x3653b9[_0x50ca('0x18')](_0x1b9e58);return _0x3653b9[_0x50ca('0x1d')](_0x50ca('0x1e'),_0x708d02+'-'+_0x3035e5+'/'+_0x5729e1)['json'](_0x168436);}return null;};}function patchUpdates(_0x32f613){return function(_0x9f19a9){try{jsonpatch[_0x50ca('0x1f')](_0x9f19a9,_0x32f613,!![]);}catch(_0x4bc6b9){return BPromise['reject'](_0x4bc6b9);}return _0x9f19a9[_0x50ca('0x20')]();};}function saveUpdates(_0x3bf173,_0x1e2ae7){return function(_0x346406){if(_0x346406){return _0x346406[_0x50ca('0x21')](_0x3bf173)[_0x50ca('0x22')](function(_0x48203d){return _0x48203d;});}return null;};}function removeEntity(_0x52027a,_0x5b15eb){return function(_0x2e522f){if(_0x2e522f){return _0x2e522f[_0x50ca('0x23')]()[_0x50ca('0x22')](function(){var _0x1f2c49=_0x2e522f[_0x50ca('0x24')]({'plain':!![]});var _0x7e6bad=_0x50ca('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x7e6bad,'resourceId':_0x1f2c49['id']}})[_0x50ca('0x22')](function(){return _0x2e522f;});})['then'](function(){_0x52027a[_0x50ca('0x18')](0xcc)[_0x50ca('0x19')]();});}};}function handleEntityNotFound(_0x4a4b6e,_0x41f5a5){return function(_0x177a4d){if(!_0x177a4d){_0x4a4b6e[_0x50ca('0x17')](0x194);}return _0x177a4d;};}function handleError(_0x5a5f19,_0x32cd92){_0x32cd92=_0x32cd92||0x1f4;return function(_0x50e3e6){logger[_0x50ca('0x26')](_0x50e3e6[_0x50ca('0x27')]);if(_0x50e3e6[_0x50ca('0x28')]){delete _0x50e3e6[_0x50ca('0x28')];}_0x5a5f19[_0x50ca('0x18')](_0x32cd92)['send'](_0x50e3e6);};}exports[_0x50ca('0x29')]=function(_0x44fc76,_0x1ead52){var _0x2707d5={},_0xf262a8={},_0x119d1f={'count':0x0,'rows':[]};var _0x386d03=db[_0x50ca('0x2a')][_0x50ca('0x2b')];_0xf262a8[_0x50ca('0x2c')]=_[_0x50ca('0x2d')](_0x386d03);_0xf262a8['query']=_[_0x50ca('0x2d')](_0x44fc76[_0x50ca('0x2e')]);_0xf262a8[_0x50ca('0x2f')]=_[_0x50ca('0x30')](_0xf262a8[_0x50ca('0x2c')],_0xf262a8[_0x50ca('0x2e')]);_0x2707d5[_0x50ca('0x31')]=_[_0x50ca('0x30')](_0xf262a8['model'],qs[_0x50ca('0x32')](_0x44fc76[_0x50ca('0x2e')][_0x50ca('0x32')]));_0x2707d5[_0x50ca('0x31')]=_0x2707d5[_0x50ca('0x31')]['length']?_0x2707d5[_0x50ca('0x31')]:_0xf262a8['model'];if(!_0x44fc76[_0x50ca('0x2e')][_0x50ca('0x33')](_0x50ca('0x34'))){_0x2707d5[_0x50ca('0x1c')]=qs[_0x50ca('0x1c')](_0x44fc76['query'][_0x50ca('0x1c')]);_0x2707d5[_0x50ca('0x1b')]=qs[_0x50ca('0x1b')](_0x44fc76[_0x50ca('0x2e')][_0x50ca('0x1b')]);}_0x2707d5['order']=qs[_0x50ca('0x35')](_0x44fc76[_0x50ca('0x2e')]['sort']);_0x2707d5[_0x50ca('0x36')]=qs[_0x50ca('0x2f')](_[_0x50ca('0x37')](_0x44fc76[_0x50ca('0x2e')],_0xf262a8[_0x50ca('0x2f')]));if(_0x44fc76['query'][_0x50ca('0x38')]){_0x2707d5[_0x50ca('0x36')]=_[_0x50ca('0x39')](_0x2707d5['where'],{'$or':_['map'](_0x386d03,function(_0x5470f4){if(_0x5470f4['type'][_0x50ca('0x3a')]!=='VIRTUAL'){var _0x6c23a0={};_0x6c23a0[_0x5470f4[_0x50ca('0x3b')]]={'$like':'%'+_0x44fc76[_0x50ca('0x2e')][_0x50ca('0x38')]+'%'};return _0x6c23a0;}})});}_0x2707d5=_[_0x50ca('0x39')]({},_0x2707d5,_0x44fc76[_0x50ca('0x3c')]);var _0x12782e={'where':_0x2707d5[_0x50ca('0x36')]};return db[_0x50ca('0x2a')][_0x50ca('0x3d')](_0x12782e)['then'](function(_0x14b7c3){_0x119d1f[_0x50ca('0x3d')]=_0x14b7c3;if(_0x44fc76['query'][_0x50ca('0x3e')]){_0x2707d5[_0x50ca('0x3f')]=[{'all':!![]}];}return db[_0x50ca('0x2a')][_0x50ca('0x40')](_0x2707d5);})[_0x50ca('0x22')](function(_0x222382){_0x119d1f[_0x50ca('0x41')]=_0x222382;return _0x119d1f;})[_0x50ca('0x22')](respondWithFilteredResult(_0x1ead52,_0x2707d5))[_0x50ca('0x42')](handleError(_0x1ead52,null));};exports['show']=function(_0x570535,_0x7a261b){var _0x3d49d7={'raw':![],'where':{'id':_0x570535[_0x50ca('0x43')]['id']}},_0x1230cf={};_0x1230cf[_0x50ca('0x2c')]=_[_0x50ca('0x2d')](db['Trigger']['rawAttributes']);_0x1230cf['query']=_[_0x50ca('0x2d')](_0x570535['query']);_0x1230cf[_0x50ca('0x2f')]=_[_0x50ca('0x30')](_0x1230cf[_0x50ca('0x2c')],_0x1230cf[_0x50ca('0x2e')]);_0x3d49d7[_0x50ca('0x31')]=_[_0x50ca('0x30')](_0x1230cf[_0x50ca('0x2c')],qs[_0x50ca('0x32')](_0x570535[_0x50ca('0x2e')]['fields']));_0x3d49d7[_0x50ca('0x31')]=_0x3d49d7[_0x50ca('0x31')][_0x50ca('0x44')]?_0x3d49d7[_0x50ca('0x31')]:_0x1230cf[_0x50ca('0x2c')];if(_0x570535['query'][_0x50ca('0x3e')]){_0x3d49d7[_0x50ca('0x3f')]=[{'all':!![]}];}_0x3d49d7=_[_0x50ca('0x39')]({},_0x3d49d7,_0x570535[_0x50ca('0x3c')]);return db[_0x50ca('0x2a')]['find'](_0x3d49d7)[_0x50ca('0x22')](handleEntityNotFound(_0x7a261b,null))[_0x50ca('0x22')](respondWithResult(_0x7a261b,null))[_0x50ca('0x42')](handleError(_0x7a261b,null));};exports[_0x50ca('0x45')]=function(_0x4b27cf,_0x2008be){return db[_0x50ca('0x2a')]['create'](_0x4b27cf[_0x50ca('0x46')],{})[_0x50ca('0x22')](function(_0xd7d644){var _0x1ce2a3=_0x4b27cf[_0x50ca('0x47')][_0x50ca('0x24')]({'plain':!![]});if(!_0x1ce2a3)throw new Error(_0x50ca('0x48'));if(_0x1ce2a3[_0x50ca('0x49')]===_0x50ca('0x47')){var _0x2c6f55=_0xd7d644[_0x50ca('0x24')]({'plain':!![]});var _0x287b3f=_0x50ca('0x25');return db[_0x50ca('0x4a')][_0x50ca('0x4b')]({'where':{'name':_0x287b3f,'userProfileId':_0x1ce2a3[_0x50ca('0x4c')]},'raw':!![]})[_0x50ca('0x22')](function(_0x198d12){if(_0x198d12&&_0x198d12['autoAssociation']===0x0){return db[_0x50ca('0x4d')][_0x50ca('0x45')]({'name':_0x2c6f55['name'],'resourceId':_0x2c6f55['id'],'type':_0x198d12[_0x50ca('0x28')],'sectionId':_0x198d12['id']},{})[_0x50ca('0x22')](function(){return _0xd7d644;});}else{return _0xd7d644;}})[_0x50ca('0x42')](function(_0xef2d0d){logger[_0x50ca('0x26')](_0x50ca('0x4e'),_0xef2d0d);throw _0xef2d0d;});}return _0xd7d644;})[_0x50ca('0x22')](respondWithResult(_0x2008be,0xc9))[_0x50ca('0x42')](handleError(_0x2008be,null));};exports['update']=function(_0x3e7552,_0x2cbd3b){if(_0x3e7552['body']['id']){delete _0x3e7552[_0x50ca('0x46')]['id'];}return db[_0x50ca('0x2a')]['find']({'where':{'id':_0x3e7552[_0x50ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cbd3b,null))[_0x50ca('0x22')](saveUpdates(_0x3e7552[_0x50ca('0x46')],null))['then'](respondWithResult(_0x2cbd3b,null))['catch'](handleError(_0x2cbd3b,null));};exports[_0x50ca('0x23')]=function(_0x1c75aa,_0x4b9e77){return db[_0x50ca('0x2a')][_0x50ca('0x4b')]({'where':{'id':_0x1c75aa[_0x50ca('0x43')]['id']}})[_0x50ca('0x22')](handleEntityNotFound(_0x4b9e77,null))['then'](removeEntity(_0x4b9e77,null))[_0x50ca('0x42')](handleError(_0x4b9e77,null));};exports[_0x50ca('0x4f')]=function(_0x10080c,_0x1dd75a,_0x477fd2){if(_0x10080c[_0x50ca('0x46')]['id']){delete _0x10080c[_0x50ca('0x46')]['id'];}return db[_0x50ca('0x2a')][_0x50ca('0x4b')]({'where':{'id':_0x10080c[_0x50ca('0x43')]['id']}})[_0x50ca('0x22')](handleEntityNotFound(_0x1dd75a,null))[_0x50ca('0x22')](function(_0x5175e4){if(_0x5175e4){_0x10080c[_0x50ca('0x46')]['TriggerAllId']=_0x5175e4['id'];return db[_0x50ca('0x50')][_0x50ca('0x45')](_0x10080c[_0x50ca('0x46')]);}})['then'](respondWithResult(_0x1dd75a,null))[_0x50ca('0x42')](handleError(_0x1dd75a,null));};exports[_0x50ca('0x51')]=function(_0x3ef38d,_0x3a84eb,_0x15e08e){if(_0x3ef38d['body']['id']){delete _0x3ef38d[_0x50ca('0x46')]['id'];}return db[_0x50ca('0x2a')][_0x50ca('0x4b')]({'where':{'id':_0x3ef38d[_0x50ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a84eb,null))[_0x50ca('0x22')](function(_0x1cc2f7){if(_0x1cc2f7){_0x3ef38d[_0x50ca('0x46')][_0x50ca('0x52')]=_0x1cc2f7['id'];return db[_0x50ca('0x50')][_0x50ca('0x45')](_0x3ef38d['body']);}})[_0x50ca('0x22')](respondWithResult(_0x3a84eb,null))[_0x50ca('0x42')](handleError(_0x3a84eb,null));};exports['getAllConditions']=function(_0x2a5174,_0xfaa5ae,_0x522832){var _0x7ae92d={};var _0xebf496={};var _0x4aad9a;var _0x523c9a;return db['Trigger'][_0x50ca('0x53')]({'where':{'id':_0x2a5174[_0x50ca('0x43')]['id']}})['then'](handleEntityNotFound(_0xfaa5ae,null))['then'](function(_0x176ee8){if(_0x176ee8){_0x4aad9a=_0x176ee8;_0xebf496[_0x50ca('0x2c')]=_[_0x50ca('0x2d')](db[_0x50ca('0x50')][_0x50ca('0x2b')]);_0xebf496[_0x50ca('0x2e')]=_[_0x50ca('0x2d')](_0x2a5174[_0x50ca('0x2e')]);_0xebf496['filters']=_[_0x50ca('0x30')](_0xebf496[_0x50ca('0x2c')],_0xebf496[_0x50ca('0x2e')]);_0x7ae92d[_0x50ca('0x31')]=_[_0x50ca('0x30')](_0xebf496['model'],qs[_0x50ca('0x32')](_0x2a5174['query'][_0x50ca('0x32')]));_0x7ae92d['attributes']=_0x7ae92d[_0x50ca('0x31')]['length']?_0x7ae92d[_0x50ca('0x31')]:_0xebf496[_0x50ca('0x2c')];_0x7ae92d['order']=qs['sort'](_0x2a5174[_0x50ca('0x2e')][_0x50ca('0x35')]);_0x7ae92d['where']=qs[_0x50ca('0x2f')](_[_0x50ca('0x37')](_0x2a5174[_0x50ca('0x2e')],_0xebf496[_0x50ca('0x2f')]));if(_0x2a5174['query'][_0x50ca('0x38')]){_0x7ae92d[_0x50ca('0x36')]=_[_0x50ca('0x39')](_0x7ae92d[_0x50ca('0x36')],{'$or':_['map'](_0x7ae92d['attributes'],function(_0x1e7eb5){var _0x1ea533={};_0x1ea533[_0x1e7eb5]={'$like':'%'+_0x2a5174[_0x50ca('0x2e')]['filter']+'%'};return _0x1ea533;})});}_0x7ae92d=_[_0x50ca('0x39')]({},_0x7ae92d,_0x2a5174['options']);return _0x4aad9a[_0x50ca('0x54')](_0x7ae92d);}})[_0x50ca('0x22')](function(_0x16227c){if(_0x16227c){_0x523c9a=_0x16227c[_0x50ca('0x44')];if(!_0x2a5174[_0x50ca('0x2e')][_0x50ca('0x33')](_0x50ca('0x34'))){_0x7ae92d['limit']=qs[_0x50ca('0x1c')](_0x2a5174['query']['limit']);_0x7ae92d[_0x50ca('0x1b')]=qs[_0x50ca('0x1b')](_0x2a5174[_0x50ca('0x2e')][_0x50ca('0x1b')]);}return _0x4aad9a[_0x50ca('0x54')](_0x7ae92d);}})[_0x50ca('0x22')](function(_0x2e69f3){if(_0x2e69f3){return _0x2e69f3?{'count':_0x523c9a,'rows':_0x2e69f3}:null;}})[_0x50ca('0x22')](respondWithResult(_0xfaa5ae,null))['catch'](handleError(_0xfaa5ae,null));};exports[_0x50ca('0x55')]=function(_0x360c30,_0x522bcd,_0x4b9e78){var _0x5ab10d={};var _0x2b446c={};var _0x6f8d1d;var _0x1fcc83;return db[_0x50ca('0x2a')][_0x50ca('0x53')]({'where':{'id':_0x360c30[_0x50ca('0x43')]['id']}})[_0x50ca('0x22')](handleEntityNotFound(_0x522bcd,null))[_0x50ca('0x22')](function(_0x39ef40){if(_0x39ef40){_0x6f8d1d=_0x39ef40;_0x2b446c[_0x50ca('0x2c')]=_[_0x50ca('0x2d')](db[_0x50ca('0x50')][_0x50ca('0x2b')]);_0x2b446c[_0x50ca('0x2e')]=_[_0x50ca('0x2d')](_0x360c30['query']);_0x2b446c['filters']=_[_0x50ca('0x30')](_0x2b446c[_0x50ca('0x2c')],_0x2b446c[_0x50ca('0x2e')]);_0x5ab10d[_0x50ca('0x31')]=_[_0x50ca('0x30')](_0x2b446c[_0x50ca('0x2c')],qs[_0x50ca('0x32')](_0x360c30['query'][_0x50ca('0x32')]));_0x5ab10d['attributes']=_0x5ab10d[_0x50ca('0x31')][_0x50ca('0x44')]?_0x5ab10d[_0x50ca('0x31')]:_0x2b446c[_0x50ca('0x2c')];_0x5ab10d['order']=qs['sort'](_0x360c30[_0x50ca('0x2e')]['sort']);_0x5ab10d[_0x50ca('0x36')]=qs[_0x50ca('0x2f')](_[_0x50ca('0x37')](_0x360c30['query'],_0x2b446c[_0x50ca('0x2f')]));if(_0x360c30['query'][_0x50ca('0x38')]){_0x5ab10d[_0x50ca('0x36')]=_[_0x50ca('0x39')](_0x5ab10d[_0x50ca('0x36')],{'$or':_[_0x50ca('0x56')](_0x5ab10d[_0x50ca('0x31')],function(_0x46170b){var _0x33be41={};_0x33be41[_0x46170b]={'$like':'%'+_0x360c30[_0x50ca('0x2e')][_0x50ca('0x38')]+'%'};return _0x33be41;})});}_0x5ab10d=_[_0x50ca('0x39')]({},_0x5ab10d,_0x360c30[_0x50ca('0x3c')]);return _0x6f8d1d['getAnyConditions'](_0x5ab10d);}})[_0x50ca('0x22')](function(_0x7f5c59){if(_0x7f5c59){_0x1fcc83=_0x7f5c59[_0x50ca('0x44')];if(!_0x360c30[_0x50ca('0x2e')][_0x50ca('0x33')](_0x50ca('0x34'))){_0x5ab10d[_0x50ca('0x1c')]=qs['limit'](_0x360c30[_0x50ca('0x2e')][_0x50ca('0x1c')]);_0x5ab10d['offset']=qs[_0x50ca('0x1b')](_0x360c30[_0x50ca('0x2e')]['offset']);}return _0x6f8d1d[_0x50ca('0x55')](_0x5ab10d);}})[_0x50ca('0x22')](function(_0x109908){if(_0x109908){return _0x109908?{'count':_0x1fcc83,'rows':_0x109908}:null;}})[_0x50ca('0x22')](respondWithResult(_0x522bcd,null))[_0x50ca('0x42')](handleError(_0x522bcd,null));};exports[_0x50ca('0x57')]=function(_0xa8f7ed,_0x3ed693,_0x4b20de){if(_0xa8f7ed[_0x50ca('0x46')]['id']){delete _0xa8f7ed[_0x50ca('0x46')]['id'];}return db[_0x50ca('0x2a')][_0x50ca('0x4b')]({'where':{'id':_0xa8f7ed['params']['id']}})[_0x50ca('0x22')](handleEntityNotFound(_0x3ed693,null))[_0x50ca('0x22')](function(_0x275775){if(_0x275775){_0xa8f7ed['body'][_0x50ca('0x58')]=_0x275775['id'];return db[_0x50ca('0x59')][_0x50ca('0x45')](_0xa8f7ed[_0x50ca('0x46')]);}})[_0x50ca('0x22')](respondWithResult(_0x3ed693,null))[_0x50ca('0x42')](handleError(_0x3ed693,null));};exports[_0x50ca('0x5a')]=function(_0x333a43,_0x191b7d,_0x483934){var _0x45fe3d={};var _0xf360eb={};var _0x5e879c;var _0x21fa1b;return db[_0x50ca('0x2a')]['findOne']({'where':{'id':_0x333a43['params']['id']}})['then'](handleEntityNotFound(_0x191b7d,null))[_0x50ca('0x22')](function(_0x1f3495){if(_0x1f3495){_0x5e879c=_0x1f3495;_0xf360eb[_0x50ca('0x2c')]=_['keys'](db['Action'][_0x50ca('0x2b')]);_0xf360eb[_0x50ca('0x2e')]=_[_0x50ca('0x2d')](_0x333a43[_0x50ca('0x2e')]);_0xf360eb[_0x50ca('0x2f')]=_['intersection'](_0xf360eb[_0x50ca('0x2c')],_0xf360eb[_0x50ca('0x2e')]);_0x45fe3d[_0x50ca('0x31')]=_[_0x50ca('0x30')](_0xf360eb[_0x50ca('0x2c')],qs[_0x50ca('0x32')](_0x333a43[_0x50ca('0x2e')][_0x50ca('0x32')]));_0x45fe3d['attributes']=_0x45fe3d[_0x50ca('0x31')]['length']?_0x45fe3d[_0x50ca('0x31')]:_0xf360eb[_0x50ca('0x2c')];_0x45fe3d['order']=qs[_0x50ca('0x35')](_0x333a43[_0x50ca('0x2e')][_0x50ca('0x35')]);_0x45fe3d[_0x50ca('0x36')]=qs[_0x50ca('0x2f')](_[_0x50ca('0x37')](_0x333a43[_0x50ca('0x2e')],_0xf360eb['filters']));if(_0x333a43[_0x50ca('0x2e')][_0x50ca('0x38')]){_0x45fe3d[_0x50ca('0x36')]=_[_0x50ca('0x39')](_0x45fe3d['where'],{'$or':_[_0x50ca('0x56')](_0x45fe3d[_0x50ca('0x31')],function(_0x481d06){var _0x96ce95={};_0x96ce95[_0x481d06]={'$like':'%'+_0x333a43['query']['filter']+'%'};return _0x96ce95;})});}_0x45fe3d=_[_0x50ca('0x39')]({},_0x45fe3d,_0x333a43['options']);return _0x5e879c['getActions'](_0x45fe3d);}})[_0x50ca('0x22')](function(_0x3f4c40){if(_0x3f4c40){_0x21fa1b=_0x3f4c40[_0x50ca('0x44')];if(!_0x333a43[_0x50ca('0x2e')]['hasOwnProperty'](_0x50ca('0x34'))){_0x45fe3d[_0x50ca('0x1c')]=qs[_0x50ca('0x1c')](_0x333a43['query']['limit']);_0x45fe3d[_0x50ca('0x1b')]=qs[_0x50ca('0x1b')](_0x333a43['query']['offset']);}return _0x5e879c['getActions'](_0x45fe3d);}})[_0x50ca('0x22')](function(_0x5d13de){if(_0x5d13de){return _0x5d13de?{'count':_0x21fa1b,'rows':_0x5d13de}:null;}})['then'](respondWithResult(_0x191b7d,null))[_0x50ca('0x42')](handleError(_0x191b7d,null));}; \ No newline at end of file +var _0xe605=['model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','map','key','VIRTUAL','field','merge','options','count','findAll','rows','catch','show','params','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','TriggerAnyId','getAllConditions','findOne','Condition','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','index','Trigger','rawAttributes'];(function(_0x4c0539,_0x3e7a31){var _0x8287c8=function(_0x485649){while(--_0x485649){_0x4c0539['push'](_0x4c0539['shift']());}};_0x8287c8(++_0x3e7a31);}(_0xe605,0x92));var _0x5e60=function(_0x301013,_0x2e17c0){_0x301013=_0x301013-0x0;var _0x24656c=_0xe605[_0x301013];return _0x24656c;};'use strict';var pdf=require(_0x5e60('0x0'));var emlformat=require(_0x5e60('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5e60('0x2'));var jsonpatch=require(_0x5e60('0x3'));var rp=require(_0x5e60('0x4'));var moment=require(_0x5e60('0x5'));var BPromise=require(_0x5e60('0x6'));var Mustache=require(_0x5e60('0x7'));var util=require(_0x5e60('0x8'));var path=require(_0x5e60('0x9'));var sox=require(_0x5e60('0xa'));var csv=require(_0x5e60('0xb'));var ejs=require(_0x5e60('0xc'));var fs=require('fs');var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var hardwareService=require(_0x5e60('0x14'));var logger=require('../../config/logger')(_0x5e60('0x15'));var utils=require('../../config/utils');var config=require(_0x5e60('0x16'));var db=require(_0x5e60('0x17'))['db'];function respondWithStatusCode(_0xcf1188,_0x51e7f6){_0x51e7f6=_0x51e7f6||0xcc;return function(_0x371df7){if(_0x371df7){return _0xcf1188[_0x5e60('0x18')](_0x51e7f6);}return _0xcf1188[_0x5e60('0x19')](_0x51e7f6)[_0x5e60('0x1a')]();};}function respondWithResult(_0x2874c4,_0xe124cd){_0xe124cd=_0xe124cd||0xc8;return function(_0x4fd10e){if(_0x4fd10e){return _0x2874c4[_0x5e60('0x19')](_0xe124cd)[_0x5e60('0x1b')](_0x4fd10e);}};}function respondWithFilteredResult(_0x21e3c8,_0x2a1c55){return function(_0x5b028f){if(_0x5b028f){var _0x20af5f=_0x5b028f['count'],_0x529ffe=_0x2a1c55[_0x5e60('0x1c')],_0x1ffd77=_0x2a1c55[_0x5e60('0x1c')]+_0x2a1c55[_0x5e60('0x1d')],_0x3bc7d8;if(_0x1ffd77>=_0x20af5f){_0x1ffd77=_0x20af5f;_0x3bc7d8=0xc8;}else{_0x3bc7d8=0xce;}_0x21e3c8[_0x5e60('0x19')](_0x3bc7d8);return _0x21e3c8['set'](_0x5e60('0x1e'),_0x529ffe+'-'+_0x1ffd77+'/'+_0x20af5f)[_0x5e60('0x1b')](_0x5b028f);}return null;};}function patchUpdates(_0x52cc15){return function(_0x1fa0f8){try{jsonpatch[_0x5e60('0x1f')](_0x1fa0f8,_0x52cc15,!![]);}catch(_0x17c630){return BPromise[_0x5e60('0x20')](_0x17c630);}return _0x1fa0f8[_0x5e60('0x21')]();};}function saveUpdates(_0x3c8e47,_0x41294f){return function(_0x524c93){if(_0x524c93){return _0x524c93[_0x5e60('0x22')](_0x3c8e47)[_0x5e60('0x23')](function(_0x228f13){return _0x228f13;});}return null;};}function removeEntity(_0x578437,_0x15e738){return function(_0x5d77dd){if(_0x5d77dd){return _0x5d77dd[_0x5e60('0x24')]()[_0x5e60('0x23')](function(){var _0x2b0bae=_0x5d77dd[_0x5e60('0x25')]({'plain':!![]});var _0x34e98d=_0x5e60('0x26');return db[_0x5e60('0x27')]['destroy']({'where':{'type':_0x34e98d,'resourceId':_0x2b0bae['id']}})[_0x5e60('0x23')](function(){return _0x5d77dd;});})[_0x5e60('0x23')](function(){_0x578437[_0x5e60('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cb62,_0x56e3a5){return function(_0x2d8aac){if(!_0x2d8aac){_0x45cb62[_0x5e60('0x18')](0x194);}return _0x2d8aac;};}function handleError(_0x4a0dbc,_0x3bedea){_0x3bedea=_0x3bedea||0x1f4;return function(_0x5712f7){logger[_0x5e60('0x28')](_0x5712f7[_0x5e60('0x29')]);if(_0x5712f7['name']){delete _0x5712f7[_0x5e60('0x2a')];}_0x4a0dbc[_0x5e60('0x19')](_0x3bedea)['send'](_0x5712f7);};}exports[_0x5e60('0x2b')]=function(_0xac9c7a,_0x52c97c){var _0x5431a8={},_0x52f668={},_0xf25956={'count':0x0,'rows':[]};var _0x235cc7=db[_0x5e60('0x2c')][_0x5e60('0x2d')];_0x52f668[_0x5e60('0x2e')]=_['keys'](_0x235cc7);_0x52f668[_0x5e60('0x2f')]=_[_0x5e60('0x30')](_0xac9c7a['query']);_0x52f668[_0x5e60('0x31')]=_['intersection'](_0x52f668['model'],_0x52f668[_0x5e60('0x2f')]);_0x5431a8[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0x52f668[_0x5e60('0x2e')],qs[_0x5e60('0x34')](_0xac9c7a[_0x5e60('0x2f')][_0x5e60('0x34')]));_0x5431a8[_0x5e60('0x32')]=_0x5431a8[_0x5e60('0x32')][_0x5e60('0x35')]?_0x5431a8['attributes']:_0x52f668[_0x5e60('0x2e')];if(!_0xac9c7a['query']['hasOwnProperty'](_0x5e60('0x36'))){_0x5431a8[_0x5e60('0x1d')]=qs['limit'](_0xac9c7a[_0x5e60('0x2f')]['limit']);_0x5431a8[_0x5e60('0x1c')]=qs[_0x5e60('0x1c')](_0xac9c7a[_0x5e60('0x2f')][_0x5e60('0x1c')]);}_0x5431a8[_0x5e60('0x37')]=qs[_0x5e60('0x38')](_0xac9c7a[_0x5e60('0x2f')][_0x5e60('0x38')]);_0x5431a8['where']=qs[_0x5e60('0x31')](_[_0x5e60('0x39')](_0xac9c7a[_0x5e60('0x2f')],_0x52f668[_0x5e60('0x31')]));if(_0xac9c7a[_0x5e60('0x2f')][_0x5e60('0x3a')]){_0x5431a8[_0x5e60('0x3b')]=_['merge'](_0x5431a8[_0x5e60('0x3b')],{'$or':_[_0x5e60('0x3c')](_0x235cc7,function(_0x4cba18){if(_0x4cba18['type'][_0x5e60('0x3d')]!==_0x5e60('0x3e')){var _0x1ae294={};_0x1ae294[_0x4cba18[_0x5e60('0x3f')]]={'$like':'%'+_0xac9c7a[_0x5e60('0x2f')]['filter']+'%'};return _0x1ae294;}})});}_0x5431a8=_[_0x5e60('0x40')]({},_0x5431a8,_0xac9c7a[_0x5e60('0x41')]);var _0x415208={'where':_0x5431a8[_0x5e60('0x3b')]};return db[_0x5e60('0x2c')][_0x5e60('0x42')](_0x415208)[_0x5e60('0x23')](function(_0x54022a){_0xf25956[_0x5e60('0x42')]=_0x54022a;if(_0xac9c7a[_0x5e60('0x2f')]['includeAll']){_0x5431a8['include']=[{'all':!![]}];}return db['Trigger'][_0x5e60('0x43')](_0x5431a8);})[_0x5e60('0x23')](function(_0x2c6d5b){_0xf25956[_0x5e60('0x44')]=_0x2c6d5b;return _0xf25956;})['then'](respondWithFilteredResult(_0x52c97c,_0x5431a8))[_0x5e60('0x45')](handleError(_0x52c97c,null));};exports[_0x5e60('0x46')]=function(_0x4b6192,_0x5bda22){var _0x1bf6e4={'raw':![],'where':{'id':_0x4b6192[_0x5e60('0x47')]['id']}},_0x42b9b0={};_0x42b9b0[_0x5e60('0x2e')]=_[_0x5e60('0x30')](db[_0x5e60('0x2c')][_0x5e60('0x2d')]);_0x42b9b0[_0x5e60('0x2f')]=_[_0x5e60('0x30')](_0x4b6192['query']);_0x42b9b0[_0x5e60('0x31')]=_[_0x5e60('0x33')](_0x42b9b0['model'],_0x42b9b0[_0x5e60('0x2f')]);_0x1bf6e4[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0x42b9b0[_0x5e60('0x2e')],qs[_0x5e60('0x34')](_0x4b6192['query'][_0x5e60('0x34')]));_0x1bf6e4[_0x5e60('0x32')]=_0x1bf6e4[_0x5e60('0x32')][_0x5e60('0x35')]?_0x1bf6e4['attributes']:_0x42b9b0['model'];if(_0x4b6192['query'][_0x5e60('0x48')]){_0x1bf6e4[_0x5e60('0x49')]=[{'all':!![]}];}_0x1bf6e4=_[_0x5e60('0x40')]({},_0x1bf6e4,_0x4b6192[_0x5e60('0x41')]);return db[_0x5e60('0x2c')][_0x5e60('0x4a')](_0x1bf6e4)['then'](handleEntityNotFound(_0x5bda22,null))[_0x5e60('0x23')](respondWithResult(_0x5bda22,null))[_0x5e60('0x45')](handleError(_0x5bda22,null));};exports[_0x5e60('0x4b')]=function(_0x2a7604,_0x3c7d04){return db[_0x5e60('0x2c')][_0x5e60('0x4b')](_0x2a7604['body'],{})[_0x5e60('0x23')](function(_0x3ed45d){var _0x21a116=_0x2a7604[_0x5e60('0x4c')][_0x5e60('0x25')]({'plain':!![]});if(!_0x21a116)throw new Error(_0x5e60('0x4d'));if(_0x21a116[_0x5e60('0x4e')]===_0x5e60('0x4c')){var _0x1518bd=_0x3ed45d[_0x5e60('0x25')]({'plain':!![]});var _0xe5e675=_0x5e60('0x26');return db[_0x5e60('0x4f')][_0x5e60('0x4a')]({'where':{'name':_0xe5e675,'userProfileId':_0x21a116[_0x5e60('0x50')]},'raw':!![]})[_0x5e60('0x23')](function(_0x1800b7){if(_0x1800b7&&_0x1800b7[_0x5e60('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x1518bd[_0x5e60('0x2a')],'resourceId':_0x1518bd['id'],'type':_0x1800b7['name'],'sectionId':_0x1800b7['id']},{})[_0x5e60('0x23')](function(){return _0x3ed45d;});}else{return _0x3ed45d;}})[_0x5e60('0x45')](function(_0x20d6e6){logger[_0x5e60('0x28')](_0x5e60('0x52'),_0x20d6e6);throw _0x20d6e6;});}return _0x3ed45d;})[_0x5e60('0x23')](respondWithResult(_0x3c7d04,0xc9))['catch'](handleError(_0x3c7d04,null));};exports['update']=function(_0xd7d32c,_0x1e4e41){if(_0xd7d32c[_0x5e60('0x53')]['id']){delete _0xd7d32c['body']['id'];}return db['Trigger'][_0x5e60('0x4a')]({'where':{'id':_0xd7d32c[_0x5e60('0x47')]['id']}})[_0x5e60('0x23')](handleEntityNotFound(_0x1e4e41,null))['then'](saveUpdates(_0xd7d32c[_0x5e60('0x53')],null))[_0x5e60('0x23')](respondWithResult(_0x1e4e41,null))[_0x5e60('0x45')](handleError(_0x1e4e41,null));};exports[_0x5e60('0x24')]=function(_0x17d002,_0x148204){return db['Trigger'][_0x5e60('0x4a')]({'where':{'id':_0x17d002[_0x5e60('0x47')]['id']}})['then'](handleEntityNotFound(_0x148204,null))[_0x5e60('0x23')](removeEntity(_0x148204,null))[_0x5e60('0x45')](handleError(_0x148204,null));};exports[_0x5e60('0x54')]=function(_0x5b3b99,_0xbe0bd5,_0x17429d){if(_0x5b3b99['body']['id']){delete _0x5b3b99[_0x5e60('0x53')]['id'];}return db[_0x5e60('0x2c')][_0x5e60('0x4a')]({'where':{'id':_0x5b3b99[_0x5e60('0x47')]['id']}})['then'](handleEntityNotFound(_0xbe0bd5,null))[_0x5e60('0x23')](function(_0x1abc43){if(_0x1abc43){_0x5b3b99['body'][_0x5e60('0x55')]=_0x1abc43['id'];return db['Condition'][_0x5e60('0x4b')](_0x5b3b99['body']);}})[_0x5e60('0x23')](respondWithResult(_0xbe0bd5,null))[_0x5e60('0x45')](handleError(_0xbe0bd5,null));};exports['addAnyCondition']=function(_0x28eb8c,_0x4b52d1,_0x1a2094){if(_0x28eb8c['body']['id']){delete _0x28eb8c[_0x5e60('0x53')]['id'];}return db['Trigger'][_0x5e60('0x4a')]({'where':{'id':_0x28eb8c[_0x5e60('0x47')]['id']}})[_0x5e60('0x23')](handleEntityNotFound(_0x4b52d1,null))[_0x5e60('0x23')](function(_0x252fa3){if(_0x252fa3){_0x28eb8c[_0x5e60('0x53')][_0x5e60('0x56')]=_0x252fa3['id'];return db['Condition'][_0x5e60('0x4b')](_0x28eb8c[_0x5e60('0x53')]);}})[_0x5e60('0x23')](respondWithResult(_0x4b52d1,null))[_0x5e60('0x45')](handleError(_0x4b52d1,null));};exports[_0x5e60('0x57')]=function(_0x35aad7,_0x4a59bd,_0x5d4717){var _0x58e5ef={};var _0x378a66={};var _0x10f0bc;var _0x5a2cb4;return db[_0x5e60('0x2c')][_0x5e60('0x58')]({'where':{'id':_0x35aad7['params']['id']}})[_0x5e60('0x23')](handleEntityNotFound(_0x4a59bd,null))[_0x5e60('0x23')](function(_0xfa108b){if(_0xfa108b){_0x10f0bc=_0xfa108b;_0x378a66[_0x5e60('0x2e')]=_[_0x5e60('0x30')](db[_0x5e60('0x59')][_0x5e60('0x2d')]);_0x378a66[_0x5e60('0x2f')]=_[_0x5e60('0x30')](_0x35aad7[_0x5e60('0x2f')]);_0x378a66[_0x5e60('0x31')]=_[_0x5e60('0x33')](_0x378a66[_0x5e60('0x2e')],_0x378a66[_0x5e60('0x2f')]);_0x58e5ef[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0x378a66[_0x5e60('0x2e')],qs['fields'](_0x35aad7[_0x5e60('0x2f')][_0x5e60('0x34')]));_0x58e5ef[_0x5e60('0x32')]=_0x58e5ef['attributes'][_0x5e60('0x35')]?_0x58e5ef[_0x5e60('0x32')]:_0x378a66['model'];_0x58e5ef[_0x5e60('0x37')]=qs[_0x5e60('0x38')](_0x35aad7['query'][_0x5e60('0x38')]);_0x58e5ef[_0x5e60('0x3b')]=qs[_0x5e60('0x31')](_[_0x5e60('0x39')](_0x35aad7[_0x5e60('0x2f')],_0x378a66[_0x5e60('0x31')]));if(_0x35aad7[_0x5e60('0x2f')][_0x5e60('0x3a')]){_0x58e5ef[_0x5e60('0x3b')]=_['merge'](_0x58e5ef[_0x5e60('0x3b')],{'$or':_[_0x5e60('0x3c')](_0x58e5ef[_0x5e60('0x32')],function(_0x4d79e2){var _0x27065d={};_0x27065d[_0x4d79e2]={'$like':'%'+_0x35aad7[_0x5e60('0x2f')][_0x5e60('0x3a')]+'%'};return _0x27065d;})});}_0x58e5ef=_[_0x5e60('0x40')]({},_0x58e5ef,_0x35aad7[_0x5e60('0x41')]);return _0x10f0bc['getAllConditions'](_0x58e5ef);}})[_0x5e60('0x23')](function(_0x213c7e){if(_0x213c7e){_0x5a2cb4=_0x213c7e[_0x5e60('0x35')];if(!_0x35aad7['query']['hasOwnProperty'](_0x5e60('0x36'))){_0x58e5ef[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x35aad7[_0x5e60('0x2f')][_0x5e60('0x1d')]);_0x58e5ef[_0x5e60('0x1c')]=qs[_0x5e60('0x1c')](_0x35aad7['query'][_0x5e60('0x1c')]);}return _0x10f0bc[_0x5e60('0x57')](_0x58e5ef);}})[_0x5e60('0x23')](function(_0x4d3ed3){if(_0x4d3ed3){return _0x4d3ed3?{'count':_0x5a2cb4,'rows':_0x4d3ed3}:null;}})['then'](respondWithResult(_0x4a59bd,null))[_0x5e60('0x45')](handleError(_0x4a59bd,null));};exports[_0x5e60('0x5a')]=function(_0x3e8e56,_0x574f2b,_0x4aa61e){var _0x3dcf3d={};var _0x45cc9c={};var _0x2269d8;var _0x24549a;return db[_0x5e60('0x2c')][_0x5e60('0x58')]({'where':{'id':_0x3e8e56['params']['id']}})[_0x5e60('0x23')](handleEntityNotFound(_0x574f2b,null))[_0x5e60('0x23')](function(_0x1210e8){if(_0x1210e8){_0x2269d8=_0x1210e8;_0x45cc9c[_0x5e60('0x2e')]=_[_0x5e60('0x30')](db[_0x5e60('0x59')][_0x5e60('0x2d')]);_0x45cc9c[_0x5e60('0x2f')]=_[_0x5e60('0x30')](_0x3e8e56['query']);_0x45cc9c[_0x5e60('0x31')]=_[_0x5e60('0x33')](_0x45cc9c['model'],_0x45cc9c[_0x5e60('0x2f')]);_0x3dcf3d[_0x5e60('0x32')]=_['intersection'](_0x45cc9c[_0x5e60('0x2e')],qs[_0x5e60('0x34')](_0x3e8e56[_0x5e60('0x2f')][_0x5e60('0x34')]));_0x3dcf3d[_0x5e60('0x32')]=_0x3dcf3d[_0x5e60('0x32')]['length']?_0x3dcf3d[_0x5e60('0x32')]:_0x45cc9c[_0x5e60('0x2e')];_0x3dcf3d[_0x5e60('0x37')]=qs[_0x5e60('0x38')](_0x3e8e56[_0x5e60('0x2f')][_0x5e60('0x38')]);_0x3dcf3d[_0x5e60('0x3b')]=qs[_0x5e60('0x31')](_[_0x5e60('0x39')](_0x3e8e56['query'],_0x45cc9c[_0x5e60('0x31')]));if(_0x3e8e56[_0x5e60('0x2f')][_0x5e60('0x3a')]){_0x3dcf3d[_0x5e60('0x3b')]=_[_0x5e60('0x40')](_0x3dcf3d[_0x5e60('0x3b')],{'$or':_[_0x5e60('0x3c')](_0x3dcf3d[_0x5e60('0x32')],function(_0x29ed96){var _0x161bb0={};_0x161bb0[_0x29ed96]={'$like':'%'+_0x3e8e56['query']['filter']+'%'};return _0x161bb0;})});}_0x3dcf3d=_['merge']({},_0x3dcf3d,_0x3e8e56[_0x5e60('0x41')]);return _0x2269d8[_0x5e60('0x5a')](_0x3dcf3d);}})[_0x5e60('0x23')](function(_0x1a911a){if(_0x1a911a){_0x24549a=_0x1a911a[_0x5e60('0x35')];if(!_0x3e8e56[_0x5e60('0x2f')][_0x5e60('0x5b')](_0x5e60('0x36'))){_0x3dcf3d[_0x5e60('0x1d')]=qs['limit'](_0x3e8e56[_0x5e60('0x2f')][_0x5e60('0x1d')]);_0x3dcf3d[_0x5e60('0x1c')]=qs['offset'](_0x3e8e56[_0x5e60('0x2f')]['offset']);}return _0x2269d8['getAnyConditions'](_0x3dcf3d);}})['then'](function(_0x337491){if(_0x337491){return _0x337491?{'count':_0x24549a,'rows':_0x337491}:null;}})[_0x5e60('0x23')](respondWithResult(_0x574f2b,null))[_0x5e60('0x45')](handleError(_0x574f2b,null));};exports[_0x5e60('0x5c')]=function(_0x445e6a,_0x1a721b,_0x386ccc){if(_0x445e6a[_0x5e60('0x53')]['id']){delete _0x445e6a[_0x5e60('0x53')]['id'];}return db['Trigger'][_0x5e60('0x4a')]({'where':{'id':_0x445e6a[_0x5e60('0x47')]['id']}})[_0x5e60('0x23')](handleEntityNotFound(_0x1a721b,null))[_0x5e60('0x23')](function(_0x388bec){if(_0x388bec){_0x445e6a[_0x5e60('0x53')][_0x5e60('0x5d')]=_0x388bec['id'];return db[_0x5e60('0x5e')][_0x5e60('0x4b')](_0x445e6a[_0x5e60('0x53')]);}})[_0x5e60('0x23')](respondWithResult(_0x1a721b,null))[_0x5e60('0x45')](handleError(_0x1a721b,null));};exports['getActions']=function(_0x1b39c7,_0xa440a9,_0x26a524){var _0x113871={};var _0x2b52a9={};var _0x353101;var _0x329409;return db[_0x5e60('0x2c')][_0x5e60('0x58')]({'where':{'id':_0x1b39c7[_0x5e60('0x47')]['id']}})[_0x5e60('0x23')](handleEntityNotFound(_0xa440a9,null))[_0x5e60('0x23')](function(_0x2dd77c){if(_0x2dd77c){_0x353101=_0x2dd77c;_0x2b52a9[_0x5e60('0x2e')]=_[_0x5e60('0x30')](db[_0x5e60('0x5e')][_0x5e60('0x2d')]);_0x2b52a9[_0x5e60('0x2f')]=_[_0x5e60('0x30')](_0x1b39c7[_0x5e60('0x2f')]);_0x2b52a9['filters']=_[_0x5e60('0x33')](_0x2b52a9[_0x5e60('0x2e')],_0x2b52a9[_0x5e60('0x2f')]);_0x113871['attributes']=_['intersection'](_0x2b52a9[_0x5e60('0x2e')],qs[_0x5e60('0x34')](_0x1b39c7[_0x5e60('0x2f')][_0x5e60('0x34')]));_0x113871[_0x5e60('0x32')]=_0x113871[_0x5e60('0x32')][_0x5e60('0x35')]?_0x113871[_0x5e60('0x32')]:_0x2b52a9[_0x5e60('0x2e')];_0x113871[_0x5e60('0x37')]=qs[_0x5e60('0x38')](_0x1b39c7[_0x5e60('0x2f')][_0x5e60('0x38')]);_0x113871[_0x5e60('0x3b')]=qs[_0x5e60('0x31')](_[_0x5e60('0x39')](_0x1b39c7[_0x5e60('0x2f')],_0x2b52a9['filters']));if(_0x1b39c7[_0x5e60('0x2f')][_0x5e60('0x3a')]){_0x113871[_0x5e60('0x3b')]=_[_0x5e60('0x40')](_0x113871['where'],{'$or':_[_0x5e60('0x3c')](_0x113871[_0x5e60('0x32')],function(_0x3799de){var _0x4eef85={};_0x4eef85[_0x3799de]={'$like':'%'+_0x1b39c7['query'][_0x5e60('0x3a')]+'%'};return _0x4eef85;})});}_0x113871=_[_0x5e60('0x40')]({},_0x113871,_0x1b39c7[_0x5e60('0x41')]);return _0x353101[_0x5e60('0x5f')](_0x113871);}})['then'](function(_0x1518e7){if(_0x1518e7){_0x329409=_0x1518e7[_0x5e60('0x35')];if(!_0x1b39c7['query']['hasOwnProperty'](_0x5e60('0x36'))){_0x113871[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x1b39c7['query']['limit']);_0x113871['offset']=qs[_0x5e60('0x1c')](_0x1b39c7[_0x5e60('0x2f')][_0x5e60('0x1c')]);}return _0x353101[_0x5e60('0x5f')](_0x113871);}})['then'](function(_0x430bd2){if(_0x430bd2){return _0x430bd2?{'count':_0x329409,'rows':_0x430bd2}:null;}})[_0x5e60('0x23')](respondWithResult(_0xa440a9,null))[_0x5e60('0x45')](handleError(_0xa440a9,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 9a55854..03b093c 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util'];(function(_0x4a7edd,_0x3986f0){var _0x45a251=function(_0x343b45){while(--_0x343b45){_0x4a7edd['push'](_0x4a7edd['shift']());}};_0x45a251(++_0x3986f0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['define','tools_triggers','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x1fa274,_0x27a51f){var _0x5601e0=function(_0x146c2c){while(--_0x146c2c){_0x1fa274['push'](_0x1fa274['shift']());}};_0x5601e0(++_0x27a51f);}(_0x757a,0xde));var _0xa757=function(_0x19ab20,_0xae081){_0x19ab20=_0x19ab20-0x0;var _0x284c7b=_0x757a[_0x19ab20];return _0x284c7b;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('Trigger',attributes,{'tableName':_0xa757('0x9'),'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 d74b49f..1f568be 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 _0xf7a6=['GetTrigger','findAll','options','where','attributes','limit','include','map','model','ShowTrigger','Trigger','find','raw','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7a6,0x1d4));var _0x6f7a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xf7a6[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x6f7a('0x0'));var util=require(_0x6f7a('0x1'));var moment=require('moment');var BPromise=require(_0x6f7a('0x2'));var rs=require(_0x6f7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6f7a('0x4'))(_0x6f7a('0x5'));var config=require(_0x6f7a('0x6'));var jayson=require(_0x6f7a('0x7'));var client=jayson[_0x6f7a('0x8')][_0x6f7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x200adc,_0x53924a,_0x2d060d){return new BPromise(function(_0x2d8b71,_0x4f5ee0){return client[_0x6f7a('0xa')](_0x200adc,_0x2d060d)[_0x6f7a('0xb')](function(_0x4eeead){logger[_0x6f7a('0xc')](_0x6f7a('0xd'),_0x53924a,_0x6f7a('0xe'));logger[_0x6f7a('0xf')](_0x6f7a('0x10'),_0x53924a,'request\x20sent',JSON[_0x6f7a('0x11')](_0x4eeead));if(_0x4eeead[_0x6f7a('0x12')]){if(_0x4eeead[_0x6f7a('0x12')][_0x6f7a('0x13')]===0x1f4){logger[_0x6f7a('0x12')](_0x6f7a('0xd'),_0x53924a,_0x4eeead[_0x6f7a('0x12')][_0x6f7a('0x14')]);return _0x4f5ee0(_0x4eeead[_0x6f7a('0x12')]['message']);}logger['error'](_0x6f7a('0xd'),_0x53924a,_0x4eeead[_0x6f7a('0x12')][_0x6f7a('0x14')]);return _0x2d8b71(_0x4eeead['error'][_0x6f7a('0x14')]);}else{logger[_0x6f7a('0xc')](_0x6f7a('0xd'),_0x53924a,'request\x20sent');_0x2d8b71(_0x4eeead['result'][_0x6f7a('0x14')]);}})[_0x6f7a('0x15')](function(_0x31dbee){logger[_0x6f7a('0x12')](_0x6f7a('0xd'),_0x53924a,_0x31dbee);_0x4f5ee0(_0x31dbee);});});}exports[_0x6f7a('0x16')]=function(_0x3f0b47){var _0xc5cf76=this;return new Promise(function(_0x1d40fd,_0x1a7d34){return db['Trigger'][_0x6f7a('0x17')]({'raw':_0x3f0b47[_0x6f7a('0x18')]?_0x3f0b47['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f0b47[_0x6f7a('0x18')]?_0x3f0b47[_0x6f7a('0x18')][_0x6f7a('0x19')]||null:null,'attributes':_0x3f0b47[_0x6f7a('0x18')]?_0x3f0b47[_0x6f7a('0x18')][_0x6f7a('0x1a')]||null:null,'limit':_0x3f0b47[_0x6f7a('0x18')]?_0x3f0b47['options'][_0x6f7a('0x1b')]||null:null,'include':_0x3f0b47[_0x6f7a('0x18')]?_0x3f0b47[_0x6f7a('0x18')][_0x6f7a('0x1c')]?_[_0x6f7a('0x1d')](_0x3f0b47[_0x6f7a('0x18')]['include'],function(_0x3ba47b){return{'model':db[_0x3ba47b['model']],'as':_0x3ba47b['as'],'attributes':_0x3ba47b['attributes'],'include':_0x3ba47b[_0x6f7a('0x1c')]?_[_0x6f7a('0x1d')](_0x3ba47b[_0x6f7a('0x1c')],function(_0x55238a){return{'model':db[_0x55238a[_0x6f7a('0x1e')]],'as':_0x55238a['as'],'attributes':_0x55238a[_0x6f7a('0x1a')],'include':_0x55238a[_0x6f7a('0x1c')]?_[_0x6f7a('0x1d')](_0x55238a['include'],function(_0x576006){return{'model':db[_0x576006[_0x6f7a('0x1e')]],'as':_0x576006['as'],'attributes':_0x576006['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f7a('0xb')](function(_0xe7a7c2){logger['info'](_0x6f7a('0x16'),_0x3f0b47);logger[_0x6f7a('0xf')]('GetTrigger',_0x3f0b47,JSON['stringify'](_0xe7a7c2));_0x1d40fd(_0xe7a7c2);})[_0x6f7a('0x15')](function(_0x11e338){logger['error'](_0x6f7a('0x16'),_0x11e338[_0x6f7a('0x14')],_0x3f0b47);_0x1a7d34(_0xc5cf76[_0x6f7a('0x12')](0x1f4,_0x11e338[_0x6f7a('0x14')]));});});};exports[_0x6f7a('0x1f')]=function(_0x25e13f){var _0x3fd86a=this;return new Promise(function(_0x1c658c,_0x198c1e){return db[_0x6f7a('0x20')][_0x6f7a('0x21')]({'raw':_0x25e13f[_0x6f7a('0x18')]?_0x25e13f[_0x6f7a('0x18')][_0x6f7a('0x22')]===undefined?!![]:![]:!![],'where':_0x25e13f[_0x6f7a('0x18')]?_0x25e13f[_0x6f7a('0x18')][_0x6f7a('0x19')]||null:null,'attributes':_0x25e13f[_0x6f7a('0x18')]?_0x25e13f[_0x6f7a('0x18')]['attributes']||null:null,'include':_0x25e13f[_0x6f7a('0x18')]?_0x25e13f['options'][_0x6f7a('0x1c')]?_[_0x6f7a('0x1d')](_0x25e13f[_0x6f7a('0x18')][_0x6f7a('0x1c')],function(_0x343149){return{'model':db[_0x343149[_0x6f7a('0x1e')]],'as':_0x343149['as'],'attributes':_0x343149[_0x6f7a('0x1a')],'include':_0x343149[_0x6f7a('0x1c')]?_['map'](_0x343149[_0x6f7a('0x1c')],function(_0x35301c){return{'model':db[_0x35301c['model']],'as':_0x35301c['as'],'attributes':_0x35301c[_0x6f7a('0x1a')],'include':_0x35301c['include']?_[_0x6f7a('0x1d')](_0x35301c['include'],function(_0x4a9dde){return{'model':db[_0x4a9dde[_0x6f7a('0x1e')]],'as':_0x4a9dde['as'],'attributes':_0x4a9dde[_0x6f7a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6f7a('0xb')](function(_0x280f95){logger[_0x6f7a('0xc')]('ShowTrigger',_0x25e13f);logger['debug'](_0x6f7a('0x1f'),_0x25e13f,JSON['stringify'](_0x280f95));_0x1c658c(_0x280f95);})[_0x6f7a('0x15')](function(_0x57470a){logger[_0x6f7a('0x12')]('ShowTrigger',_0x57470a[_0x6f7a('0x14')],_0x25e13f);_0x198c1e(_0x3fd86a[_0x6f7a('0x12')](0x1f4,_0x57470a[_0x6f7a('0x14')]));});});}; \ No newline at end of file +var _0x76bf=['GetTrigger','Trigger','findAll','options','raw','where','limit','include','model','attributes','map','find','ShowTrigger','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','error','Trigger,\x20%s,\x20%s','message','info','result','catch'];(function(_0xca043c,_0x1035ba){var _0x35dbd4=function(_0x24a981){while(--_0x24a981){_0xca043c['push'](_0xca043c['shift']());}};_0x35dbd4(++_0x1035ba);}(_0x76bf,0x115));var _0xf76b=function(_0x22f88b,_0x4f8e24){_0x22f88b=_0x22f88b-0x0;var _0x178de1=_0x76bf[_0x22f88b];return _0x178de1;};'use strict';var _=require(_0xf76b('0x0'));var util=require(_0xf76b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf76b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf76b('0x3'))['db'];var utils=require(_0xf76b('0x4'));var logger=require(_0xf76b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf76b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x68abc7,_0x228e2a,_0x1479f5){return new BPromise(function(_0x2fdc2e,_0x48ea59){return client[_0xf76b('0x7')](_0x68abc7,_0x1479f5)[_0xf76b('0x8')](function(_0xeeb53e){logger['info']('Trigger,\x20%s,\x20%s',_0x228e2a,_0xf76b('0x9'));logger[_0xf76b('0xa')](_0xf76b('0xb'),_0x228e2a,_0xf76b('0x9'),JSON[_0xf76b('0xc')](_0xeeb53e));if(_0xeeb53e['error']){if(_0xeeb53e['error'][_0xf76b('0xd')]===0x1f4){logger[_0xf76b('0xe')](_0xf76b('0xf'),_0x228e2a,_0xeeb53e[_0xf76b('0xe')][_0xf76b('0x10')]);return _0x48ea59(_0xeeb53e[_0xf76b('0xe')]['message']);}logger['error'](_0xf76b('0xf'),_0x228e2a,_0xeeb53e[_0xf76b('0xe')]['message']);return _0x2fdc2e(_0xeeb53e['error'][_0xf76b('0x10')]);}else{logger[_0xf76b('0x11')](_0xf76b('0xf'),_0x228e2a,'request\x20sent');_0x2fdc2e(_0xeeb53e[_0xf76b('0x12')][_0xf76b('0x10')]);}})[_0xf76b('0x13')](function(_0x3151e8){logger[_0xf76b('0xe')]('Trigger,\x20%s,\x20%s',_0x228e2a,_0x3151e8);_0x48ea59(_0x3151e8);});});}exports[_0xf76b('0x14')]=function(_0x2d846d){var _0x235c6b=this;return new Promise(function(_0x403449,_0x5b4c93){return db[_0xf76b('0x15')][_0xf76b('0x16')]({'raw':_0x2d846d['options']?_0x2d846d[_0xf76b('0x17')][_0xf76b('0x18')]===undefined?!![]:![]:!![],'where':_0x2d846d[_0xf76b('0x17')]?_0x2d846d[_0xf76b('0x17')][_0xf76b('0x19')]||null:null,'attributes':_0x2d846d[_0xf76b('0x17')]?_0x2d846d[_0xf76b('0x17')]['attributes']||null:null,'limit':_0x2d846d[_0xf76b('0x17')]?_0x2d846d[_0xf76b('0x17')][_0xf76b('0x1a')]||null:null,'include':_0x2d846d['options']?_0x2d846d['options'][_0xf76b('0x1b')]?_['map'](_0x2d846d[_0xf76b('0x17')][_0xf76b('0x1b')],function(_0x225b4d){return{'model':db[_0x225b4d[_0xf76b('0x1c')]],'as':_0x225b4d['as'],'attributes':_0x225b4d[_0xf76b('0x1d')],'include':_0x225b4d['include']?_[_0xf76b('0x1e')](_0x225b4d[_0xf76b('0x1b')],function(_0x1b9d02){return{'model':db[_0x1b9d02[_0xf76b('0x1c')]],'as':_0x1b9d02['as'],'attributes':_0x1b9d02[_0xf76b('0x1d')],'include':_0x1b9d02[_0xf76b('0x1b')]?_['map'](_0x1b9d02[_0xf76b('0x1b')],function(_0x36ca21){return{'model':db[_0x36ca21[_0xf76b('0x1c')]],'as':_0x36ca21['as'],'attributes':_0x36ca21[_0xf76b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf76b('0x8')](function(_0x5a0e6a){logger[_0xf76b('0x11')](_0xf76b('0x14'),_0x2d846d);logger[_0xf76b('0xa')]('GetTrigger',_0x2d846d,JSON[_0xf76b('0xc')](_0x5a0e6a));_0x403449(_0x5a0e6a);})['catch'](function(_0x2ec06b){logger['error'](_0xf76b('0x14'),_0x2ec06b[_0xf76b('0x10')],_0x2d846d);_0x5b4c93(_0x235c6b['error'](0x1f4,_0x2ec06b[_0xf76b('0x10')]));});});};exports['ShowTrigger']=function(_0x58502c){var _0x57eba3=this;return new Promise(function(_0x25717a,_0x200342){return db['Trigger'][_0xf76b('0x1f')]({'raw':_0x58502c[_0xf76b('0x17')]?_0x58502c['options'][_0xf76b('0x18')]===undefined?!![]:![]:!![],'where':_0x58502c[_0xf76b('0x17')]?_0x58502c['options'][_0xf76b('0x19')]||null:null,'attributes':_0x58502c[_0xf76b('0x17')]?_0x58502c[_0xf76b('0x17')]['attributes']||null:null,'include':_0x58502c[_0xf76b('0x17')]?_0x58502c['options'][_0xf76b('0x1b')]?_['map'](_0x58502c[_0xf76b('0x17')][_0xf76b('0x1b')],function(_0x2c3dfe){return{'model':db[_0x2c3dfe['model']],'as':_0x2c3dfe['as'],'attributes':_0x2c3dfe[_0xf76b('0x1d')],'include':_0x2c3dfe[_0xf76b('0x1b')]?_[_0xf76b('0x1e')](_0x2c3dfe[_0xf76b('0x1b')],function(_0x432620){return{'model':db[_0x432620['model']],'as':_0x432620['as'],'attributes':_0x432620[_0xf76b('0x1d')],'include':_0x432620[_0xf76b('0x1b')]?_[_0xf76b('0x1e')](_0x432620[_0xf76b('0x1b')],function(_0x80a07b){return{'model':db[_0x80a07b[_0xf76b('0x1c')]],'as':_0x80a07b['as'],'attributes':_0x80a07b[_0xf76b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf76b('0x8')](function(_0xb9ad14){logger[_0xf76b('0x11')](_0xf76b('0x20'),_0x58502c);logger[_0xf76b('0xa')]('ShowTrigger',_0x58502c,JSON[_0xf76b('0xc')](_0xb9ad14));_0x25717a(_0xb9ad14);})['catch'](function(_0x3e42a0){logger['error']('ShowTrigger',_0x3e42a0['message'],_0x58502c);_0x200342(_0x57eba3[_0xf76b('0xe')](0x1f4,_0x3e42a0[_0xf76b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 25c591d..6751e27 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 _0xffe7=['../../config/environment','./trunk.controller','get','isAuthenticated','index','show','post','create','/:id','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x416218,_0xe70e6){var _0x55e15e=function(_0x443854){while(--_0x443854){_0x416218['push'](_0x416218['shift']());}};_0x55e15e(++_0xe70e6);}(_0xffe7,0x93));var _0x7ffe=function(_0x4da9d5,_0x12b3b0){_0x4da9d5=_0x4da9d5-0x0;var _0x2ce224=_0xffe7[_0x4da9d5];return _0x2ce224;};'use strict';var multer=require(_0x7ffe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7ffe('0x1'));var express=require(_0x7ffe('0x2'));var router=express[_0x7ffe('0x3')]();var auth=require(_0x7ffe('0x4'));var interaction=require(_0x7ffe('0x5'));var config=require(_0x7ffe('0x6'));var controller=require(_0x7ffe('0x7'));router[_0x7ffe('0x8')]('/',auth[_0x7ffe('0x9')](),controller[_0x7ffe('0xa')]);router[_0x7ffe('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7ffe('0xb')]);router[_0x7ffe('0xc')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x7ffe('0xc')]('/',auth[_0x7ffe('0x9')](),controller[_0x7ffe('0xd')]);router['put'](_0x7ffe('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x7ffe('0xf')]('/:id',auth[_0x7ffe('0x9')](),controller['destroy']);module[_0x7ffe('0x10')]=router; \ No newline at end of file +var _0x3951=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','create','put','update','destroy','exports','util','path','express','Router'];(function(_0x1116cd,_0x41a0b7){var _0x52974a=function(_0x3c4e70){while(--_0x3c4e70){_0x1116cd['push'](_0x1116cd['shift']());}};_0x52974a(++_0x41a0b7);}(_0x3951,0x1ea));var _0x1395=function(_0x4f9eb5,_0x220c2a){_0x4f9eb5=_0x4f9eb5-0x0;var _0x3189f4=_0x3951[_0x4f9eb5];return _0x3189f4;};'use strict';var multer=require('multer');var util=require(_0x1395('0x0'));var path=require(_0x1395('0x1'));var timeout=require('connect-timeout');var express=require(_0x1395('0x2'));var router=express[_0x1395('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1395('0x4'));var config=require(_0x1395('0x5'));var controller=require(_0x1395('0x6'));router[_0x1395('0x7')]('/',auth[_0x1395('0x8')](),controller[_0x1395('0x9')]);router[_0x1395('0x7')](_0x1395('0xa'),auth[_0x1395('0x8')](),controller[_0x1395('0xb')]);router[_0x1395('0xc')](_0x1395('0xd'),auth[_0x1395('0x8')](),controller['clone']);router[_0x1395('0xc')]('/',auth[_0x1395('0x8')](),controller[_0x1395('0xe')]);router[_0x1395('0xf')](_0x1395('0xa'),auth[_0x1395('0x8')](),controller[_0x1395('0x10')]);router['delete'](_0x1395('0xa'),auth[_0x1395('0x8')](),controller[_0x1395('0x11')]);module[_0x1395('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index edcaafc..e6e95e4 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 _0x0b0e=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','insecure','yes','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','active','passive','dynamic','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3f4568,_0x9eb0ee){_0x3f4568=_0x3f4568-0x0;var _0xee2340=_0x0b0e[_0x3f4568];return _0xee2340;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5')),'allowNull':![],'defaultValue':_0xe0b0('0x3')},'context':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':_0xe0b0('0x6')},'callingpres':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'))},'deny':{'type':Sequelize[_0xe0b0('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xe0b0('0x1')]},'md5secret':{'type':Sequelize[_0xe0b0('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0xd'),'set':function(_0x574d96){this[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x574d96?_0x574d96[_0xe0b0('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xe0b0('0xf'))?this[_0xe0b0('0x11')](_0xe0b0('0xf'))[_0xe0b0('0x12')](','):null;},'comment':_0xe0b0('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe0b0('0x14'),_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),_0xe0b0('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe0b0('0x2')]('yes','no',_0xe0b0('0x19'),_0xe0b0('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe0b0('0x1')]},'directmediadeny':{'type':Sequelize[_0xe0b0('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x46bb44){this['setDataValue']('nat',_0x46bb44?_0x46bb44['join'](','):null);},'get':function(){return this[_0xe0b0('0x11')]('nat')?this['getDataValue'](_0xe0b0('0x1b'))['split'](','):null;},'comment':_0xe0b0('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe0b0('0x1')]},'pickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'language':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12b260){this[_0xe0b0('0xe')]('allow',_0x12b260?_0x12b260[_0xe0b0('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe0b0('0x11')]('allow')?this[_0xe0b0('0x11')]('allow')[_0xe0b0('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'port,invite','set':function(_0x362aba){this[_0xe0b0('0xe')](_0xe0b0('0x1d'),_0x362aba?_0x362aba[_0xe0b0('0x10')](','):null);},'get':function(){return this[_0xe0b0('0x11')](_0xe0b0('0x1d'))?this['getDataValue'](_0xe0b0('0x1d'))[_0xe0b0('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x1f'))},'promiscredir':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no')},'useclientcode':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xe0b0('0x1')]},'callerid':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x20')},'amaflags':{'type':Sequelize[_0xe0b0('0x1')]},'callcounter':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':_0xe0b0('0x1e')},'busylevel':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'allowsubscribe':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribecontext':{'type':Sequelize[_0xe0b0('0x1')]},'template':{'type':Sequelize[_0xe0b0('0x1')]},'videosupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'session_timers':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x23'),'refuse',_0xe0b0('0x24'))},'session_expires':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x25'),_0xe0b0('0x26')),'defaultValue':_0xe0b0('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe0b0('0x21')](0x5)},'qualify':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xe0b0('0x1')]},'defaultuser':{'type':Sequelize[_0xe0b0('0x1')]},'rtptimeout':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe0b0('0x1')]},'callbackextension':{'type':Sequelize[_0xe0b0('0x1')]},'timert1':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'timerb':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe0b0('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'use_q850_reason':{'type':Sequelize[_0xe0b0('0x1')]},'maxforwards':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'encryption':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'force_avp':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'icesupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsenable':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscapath':{'type':Sequelize[_0xe0b0('0x1')]},'dtlssetup':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x29'),_0xe0b0('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe0b0('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xe0b0('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribemwi':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xe0b0('0x1')]},'parkinglot':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize[_0xe0b0('0x1')]},'host':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xe0b0('0x1')]},'active':{'type':Sequelize[_0xe0b0('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb10b=['udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','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','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x518d11,_0x4af8e9){var _0xdd60d1=function(_0x297d1c){while(--_0x297d1c){_0x518d11['push'](_0x518d11['shift']());}};_0xdd60d1(++_0x4af8e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x2782db,_0x2a516f){_0x2782db=_0x2782db-0x0;var _0x4af4e4=_0xb10b[_0x2782db];return _0x4af4e4;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('friend',_0xbb10('0x4'),_0xbb10('0x5')),'allowNull':![],'defaultValue':_0xbb10('0x6')},'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x7')},'callingpres':{'type':Sequelize[_0xbb10('0x3')]('ALLOWED_NOT_SCREENED',_0xbb10('0x8'),_0xbb10('0x9'),'ALLOWED',_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc'),_0xbb10('0xd'))},'deny':{'type':Sequelize[_0xbb10('0x1')]},'permit':{'type':Sequelize[_0xbb10('0x1')]},'secret':{'type':Sequelize[_0xbb10('0x1')]},'md5secret':{'type':Sequelize[_0xbb10('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xe'),'set':function(_0x118a74){this[_0xbb10('0xf')]('transport',_0x118a74?_0x118a74[_0xbb10('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x11'))?this[_0xbb10('0x12')](_0xbb10('0x11'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x14')},'dtmfmode':{'type':Sequelize[_0xbb10('0x3')]('rfc2833',_0xbb10('0x15'),_0xbb10('0x16'),_0xbb10('0x17'),_0xbb10('0x18')),'defaultValue':_0xbb10('0x19')},'directmedia':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb10('0x1')]},'nat':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x1e'),'set':function(_0x1682a4){this[_0xbb10('0xf')](_0xbb10('0x1f'),_0x1682a4?_0x1682a4[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')]('nat')?this[_0xbb10('0x12')](_0xbb10('0x1f'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x20')},'callgroup':{'type':Sequelize[_0xbb10('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb10('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x1')]},'language':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x21')},'allow':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x22'),'set':function(_0x317da4){this[_0xbb10('0xf')](_0xbb10('0x23'),_0x317da4?_0x317da4[_0xbb10('0x10')](';'):_0xbb10('0x22'));},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x23'))?this[_0xbb10('0x12')](_0xbb10('0x23'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'insecure':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x24'),'set':function(_0x4e25ff){this[_0xbb10('0xf')](_0xbb10('0x25'),_0x4e25ff?_0x4e25ff[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x25'))?this[_0xbb10('0x12')](_0xbb10('0x25'))['split'](','):null;},'comment':_0xbb10('0x26')},'trustrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbb10('0x28')](0xb)},'setvar':{'type':Sequelize[_0xbb10('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbb10('0x1')]},'callcounter':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':_0xbb10('0x1a')},'busylevel':{'type':Sequelize[_0xbb10('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbb10('0x1')]},'template':{'type':Sequelize[_0xbb10('0x1')]},'videosupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbb10('0x1')]},'session_timers':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2a'),_0xbb10('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xbb10('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbb10('0x2c'),_0xbb10('0x2d')),'defaultValue':_0xbb10('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x1')]},'regexten':{'type':Sequelize[_0xbb10('0x1')]},'fromdomain':{'type':Sequelize[_0xbb10('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb10('0x1')]},'defaultuser':{'type':Sequelize[_0xbb10('0x1')]},'rtptimeout':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x1')]},'callbackextension':{'type':Sequelize[_0xbb10('0x1')]},'timert1':{'type':Sequelize[_0xbb10('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbb10('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbb10('0x1')]},'contactdeny':{'type':Sequelize[_0xbb10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbb10('0x1')]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x1')]},'maxforwards':{'type':Sequelize[_0xbb10('0x28')](0xb)},'encryption':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xbb10('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbb10('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbb10('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2f'),'passive',_0xbb10('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x1')]},'usereqphone':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb10('0x1')]},'call_limit':{'type':Sequelize[_0xbb10('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbb10('0x1')]},'mohinterpret':{'type':Sequelize[_0xbb10('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb10('0x1')]},'parkinglot':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x31')},'canreinvite':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb10('0x1')]},'otherFields':{'type':Sequelize[_0xbb10('0x1')]},'active':{'type':Sequelize[_0xbb10('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb10('0x1')],'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 b07fa53..2bddfd7 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 _0xe85f=['update','destroy','get','stack','name','send','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','Trunk','includeAll','include','findAll','params','find','catch','clone','options','omit','createdAt','updatedAt','body','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','Trunks','server/files/templates/trunk.ejs','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x2ff971,_0x4daf17){var _0x4c170d=function(_0x108e6d){while(--_0x108e6d){_0x2ff971['push'](_0x2ff971['shift']());}};_0x4c170d(++_0x4daf17);}(_0xe85f,0x116));var _0xfe85=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xe85f[_0x20a558];return _0x53d3f7;};'use strict';var pdf=require(_0xfe85('0x0'));var emlformat=require(_0xfe85('0x1'));var rimraf=require(_0xfe85('0x2'));var zipdir=require(_0xfe85('0x3'));var jsonpatch=require(_0xfe85('0x4'));var rp=require(_0xfe85('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfe85('0x6'));var util=require('util');var path=require('path');var sox=require(_0xfe85('0x7'));var csv=require(_0xfe85('0x8'));var ejs=require(_0xfe85('0x9'));var fs=require('fs');var _=require(_0xfe85('0xa'));var squel=require(_0xfe85('0xb'));var crypto=require(_0xfe85('0xc'));var jsforce=require(_0xfe85('0xd'));var deskjs=require(_0xfe85('0xe'));var toCsv=require(_0xfe85('0x8'));var querystring=require('querystring');var Papa=require(_0xfe85('0xf'));var Redis=require(_0xfe85('0x10'));var authService=require(_0xfe85('0x11'));var qs=require(_0xfe85('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe85('0x13'))(_0xfe85('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfe85('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfe85('0x16')][_0xfe85('0x17')]({'port':0x232a});function checkPasswordPattern(_0x28eb3b,_0xe20fd2,_0x5a2f1c){if(_0x5a2f1c){var _0x295d40=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x295d40['test'](_0xe20fd2)){return _0x28eb3b;}else{throw new Error(_0xfe85('0x18'));}}else{return _0x28eb3b;}}function respondWithRpcPromise(_0x51a6df,_0x4b06a8,_0xb1bf4e,_0x49fd14){return new BPromise(function(_0x522518,_0x2cd058){var _0x30f9d0=_0x49fd14||client;return _0x30f9d0[_0xfe85('0x19')](_0x51a6df,_0xb1bf4e)[_0xfe85('0x1a')](function(_0x5702a9){logger[_0xfe85('0x1b')]('Trunk,\x20%s,\x20%s',_0x4b06a8,_0xfe85('0x1c'));logger[_0xfe85('0x1d')](_0xfe85('0x1e'),_0x4b06a8,'request\x20sent',JSON[_0xfe85('0x1f')](_0x5702a9));if(_0x5702a9[_0xfe85('0x20')]){if(_0x5702a9[_0xfe85('0x20')][_0xfe85('0x21')]===0x1f4){logger[_0xfe85('0x20')](_0xfe85('0x22'),_0x4b06a8,_0x5702a9[_0xfe85('0x20')][_0xfe85('0x23')]);return _0x2cd058(_0x5702a9[_0xfe85('0x20')][_0xfe85('0x23')]);}logger[_0xfe85('0x20')]('Trunk,\x20%s,\x20%s',_0x4b06a8,_0x5702a9[_0xfe85('0x20')]['message']);return _0x522518(_0x5702a9[_0xfe85('0x20')][_0xfe85('0x23')]);}else{logger['info'](_0xfe85('0x22'),_0x4b06a8,_0xfe85('0x1c'));_0x522518(_0x5702a9[_0xfe85('0x24')]['message']);}})['catch'](function(_0x1f3c1b){logger['error']('Trunk,\x20%s,\x20%s',_0x4b06a8,_0x1f3c1b);_0x2cd058(_0x1f3c1b);});});}function respondWithStatusCode(_0x453144,_0x419e39){_0x419e39=_0x419e39||0xcc;return function(_0x5b644c){if(_0x5b644c){return _0x453144['sendStatus'](_0x419e39);}return _0x453144[_0xfe85('0x25')](_0x419e39)[_0xfe85('0x26')]();};}function respondWithResult(_0x231fe7,_0x10d165){_0x10d165=_0x10d165||0xc8;return function(_0x9e3904){if(_0x9e3904){return _0x231fe7['status'](_0x10d165)[_0xfe85('0x27')](_0x9e3904);}};}function respondWithFilteredResult(_0x286588,_0x347c56){return function(_0x52a00f){if(_0x52a00f){var _0x5b4bd2=_0x52a00f[_0xfe85('0x28')],_0x5ec059=_0x347c56[_0xfe85('0x29')],_0x4a3003=_0x347c56[_0xfe85('0x29')]+_0x347c56[_0xfe85('0x2a')],_0x3146d3;if(_0x4a3003>=_0x5b4bd2){_0x4a3003=_0x5b4bd2;_0x3146d3=0xc8;}else{_0x3146d3=0xce;}_0x286588[_0xfe85('0x25')](_0x3146d3);return _0x286588[_0xfe85('0x2b')](_0xfe85('0x2c'),_0x5ec059+'-'+_0x4a3003+'/'+_0x5b4bd2)['json'](_0x52a00f);}return null;};}function patchUpdates(_0x3639bd){return function(_0x56230f){try{jsonpatch[_0xfe85('0x2d')](_0x56230f,_0x3639bd,!![]);}catch(_0x2274af){return BPromise['reject'](_0x2274af);}return _0x56230f['save']();};}function saveUpdates(_0x4cb737,_0x2a7c2a){return function(_0x4e4df3){if(_0x4e4df3){return _0x4e4df3[_0xfe85('0x2e')](_0x4cb737)[_0xfe85('0x1a')](function(_0x7e359){return _0x7e359;});}return null;};}function removeEntity(_0x170399,_0x5b386c){return function(_0x4850fd){if(_0x4850fd){return _0x4850fd[_0xfe85('0x2f')]()[_0xfe85('0x1a')](function(){var _0x371ad3=_0x4850fd[_0xfe85('0x30')]({'plain':!![]});var _0x2f5445='Trunks';return db['UserProfileResource']['destroy']({'where':{'type':_0x2f5445,'resourceId':_0x371ad3['id']}})['then'](function(){return _0x4850fd;});})[_0xfe85('0x1a')](function(){_0x170399['status'](0xcc)[_0xfe85('0x26')]();});}};}function handleEntityNotFound(_0x44d964,_0xbe321){return function(_0x2cf760){if(!_0x2cf760){_0x44d964['sendStatus'](0x194);}return _0x2cf760;};}function handleError(_0x3edaff,_0x33ebc9){_0x33ebc9=_0x33ebc9||0x1f4;return function(_0x3145c7){logger[_0xfe85('0x20')](_0x3145c7[_0xfe85('0x31')]);if(_0x3145c7[_0xfe85('0x32')]){delete _0x3145c7[_0xfe85('0x32')];}_0x3edaff[_0xfe85('0x25')](_0x33ebc9)[_0xfe85('0x33')](_0x3145c7);};}exports['index']=function(_0x32d7ef,_0x581bed){var _0x4c0cdc={},_0x1ef912={},_0x1886b4={'count':0x0,'rows':[]};var _0x3f8043=db['Trunk'][_0xfe85('0x34')];_0x1ef912[_0xfe85('0x35')]=_['keys'](_0x3f8043);_0x1ef912[_0xfe85('0x36')]=_[_0xfe85('0x37')](_0x32d7ef[_0xfe85('0x36')]);_0x1ef912[_0xfe85('0x38')]=_['intersection'](_0x1ef912[_0xfe85('0x35')],_0x1ef912[_0xfe85('0x36')]);_0x4c0cdc['attributes']=_[_0xfe85('0x39')](_0x1ef912[_0xfe85('0x35')],qs['fields'](_0x32d7ef[_0xfe85('0x36')][_0xfe85('0x3a')]));_0x4c0cdc[_0xfe85('0x3b')]=_0x4c0cdc['attributes'][_0xfe85('0x3c')]?_0x4c0cdc[_0xfe85('0x3b')]:_0x1ef912[_0xfe85('0x35')];if(!_0x32d7ef['query']['hasOwnProperty'](_0xfe85('0x3d'))){_0x4c0cdc[_0xfe85('0x2a')]=qs[_0xfe85('0x2a')](_0x32d7ef[_0xfe85('0x36')][_0xfe85('0x2a')]);_0x4c0cdc['offset']=qs[_0xfe85('0x29')](_0x32d7ef[_0xfe85('0x36')]['offset']);}_0x4c0cdc[_0xfe85('0x3e')]=qs[_0xfe85('0x3f')](_0x32d7ef['query']['sort']);_0x4c0cdc['where']=qs[_0xfe85('0x38')](_[_0xfe85('0x40')](_0x32d7ef['query'],_0x1ef912[_0xfe85('0x38')]));if(_0x32d7ef[_0xfe85('0x36')][_0xfe85('0x41')]){_0x4c0cdc[_0xfe85('0x42')]=_[_0xfe85('0x43')](_0x4c0cdc['where'],{'$or':_[_0xfe85('0x44')](_0x3f8043,function(_0x3aeb6f){if(_0x3aeb6f[_0xfe85('0x45')]['key']!==_0xfe85('0x46')){var _0x32e6c0={};_0x32e6c0[_0x3aeb6f[_0xfe85('0x47')]]={'$like':'%'+_0x32d7ef[_0xfe85('0x36')]['filter']+'%'};return _0x32e6c0;}})});}_0x4c0cdc=_['merge']({},_0x4c0cdc,_0x32d7ef['options']);var _0x9a628={'where':_0x4c0cdc[_0xfe85('0x42')]};return db[_0xfe85('0x48')]['count'](_0x9a628)[_0xfe85('0x1a')](function(_0x25c213){_0x1886b4[_0xfe85('0x28')]=_0x25c213;if(_0x32d7ef[_0xfe85('0x36')][_0xfe85('0x49')]){_0x4c0cdc[_0xfe85('0x4a')]=[{'all':!![]}];}return db[_0xfe85('0x48')][_0xfe85('0x4b')](_0x4c0cdc);})[_0xfe85('0x1a')](function(_0x3b9544){_0x1886b4['rows']=_0x3b9544;return _0x1886b4;})[_0xfe85('0x1a')](respondWithFilteredResult(_0x581bed,_0x4c0cdc))['catch'](handleError(_0x581bed,null));};exports['show']=function(_0x35a1dc,_0x25af8e){var _0x5f5037={'raw':![],'where':{'id':_0x35a1dc[_0xfe85('0x4c')]['id']}},_0x328cbc={};_0x328cbc[_0xfe85('0x35')]=_[_0xfe85('0x37')](db[_0xfe85('0x48')][_0xfe85('0x34')]);_0x328cbc[_0xfe85('0x36')]=_[_0xfe85('0x37')](_0x35a1dc[_0xfe85('0x36')]);_0x328cbc[_0xfe85('0x38')]=_[_0xfe85('0x39')](_0x328cbc[_0xfe85('0x35')],_0x328cbc['query']);_0x5f5037['attributes']=_['intersection'](_0x328cbc[_0xfe85('0x35')],qs[_0xfe85('0x3a')](_0x35a1dc[_0xfe85('0x36')][_0xfe85('0x3a')]));_0x5f5037[_0xfe85('0x3b')]=_0x5f5037[_0xfe85('0x3b')][_0xfe85('0x3c')]?_0x5f5037['attributes']:_0x328cbc[_0xfe85('0x35')];if(_0x35a1dc[_0xfe85('0x36')][_0xfe85('0x49')]){_0x5f5037['include']=[{'all':!![]}];}_0x5f5037=_[_0xfe85('0x43')]({},_0x5f5037,_0x35a1dc['options']);return db[_0xfe85('0x48')][_0xfe85('0x4d')](_0x5f5037)[_0xfe85('0x1a')](handleEntityNotFound(_0x25af8e,null))[_0xfe85('0x1a')](respondWithResult(_0x25af8e,null))[_0xfe85('0x4e')](handleError(_0x25af8e,null));};exports[_0xfe85('0x4f')]=function(_0x2c242c,_0x38ec4b){var _0x4bb00d={'raw':![],'where':{'id':_0x2c242c['params']['id']}},_0x574aa4={};_0x574aa4[_0xfe85('0x35')]=_[_0xfe85('0x37')](db[_0xfe85('0x48')][_0xfe85('0x34')]);_0x4bb00d[_0xfe85('0x3b')]=_[_0xfe85('0x39')](_0x574aa4[_0xfe85('0x35')],qs['fields'](_0x2c242c[_0xfe85('0x36')]['fields']));_0x4bb00d[_0xfe85('0x3b')]=_0x4bb00d[_0xfe85('0x3b')][_0xfe85('0x3c')]?_0x4bb00d['attributes']:_0x574aa4[_0xfe85('0x35')];if(_0x2c242c['query'][_0xfe85('0x49')]){_0x4bb00d[_0xfe85('0x4a')]=[{'all':!![]}];}_0x4bb00d=_['merge']({},_0x4bb00d,_0x2c242c[_0xfe85('0x50')]);return db[_0xfe85('0x48')]['find'](_0x4bb00d)[_0xfe85('0x1a')](handleEntityNotFound(_0x38ec4b,null))['then'](function(_0x47d2a6){if(_0x47d2a6){var _0x3451e7=_0x47d2a6['get']({'plain':!![]});_0x3451e7=qs[_0xfe85('0x51')](_0x3451e7,['id',_0xfe85('0x52'),_0xfe85('0x53')]);_0x2c242c[_0xfe85('0x54')]=_['omit'](_0x2c242c['body'],['id',_0xfe85('0x52'),_0xfe85('0x53')]);return db['Trunk'][_0xfe85('0x55')](_[_0xfe85('0x43')](_0x3451e7,_0x2c242c['body']),{'include':_0x2c242c[_0xfe85('0x36')][_0xfe85('0x49')]?[{'all':!![]}]:undefined})[_0xfe85('0x1a')](function(_0x23ebf4){var _0x1cc6c7=_0x2c242c[_0xfe85('0x56')][_0xfe85('0x30')]({'plain':!![]});if(!_0x1cc6c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cc6c7[_0xfe85('0x57')]==='user'){var _0x2c2e9b=_0x23ebf4[_0xfe85('0x30')]({'plain':!![]});var _0x1adf12='Trunks';return db[_0xfe85('0x58')][_0xfe85('0x4d')]({'where':{'name':_0x1adf12,'userProfileId':_0x1cc6c7[_0xfe85('0x59')]},'raw':!![]})[_0xfe85('0x1a')](function(_0x2461bc){if(_0x2461bc&&_0x2461bc[_0xfe85('0x5a')]===0x0){return db[_0xfe85('0x5b')][_0xfe85('0x55')]({'name':_0x2c2e9b[_0xfe85('0x32')],'resourceId':_0x2c2e9b['id'],'type':_0x2461bc['name'],'sectionId':_0x2461bc['id']},{})[_0xfe85('0x1a')](function(){return _0x23ebf4;});}else{return _0x23ebf4;}})['catch'](function(_0x279540){logger[_0xfe85('0x20')](_0xfe85('0x5c'),_0x279540);throw _0x279540;});}return _0x23ebf4;});}})[_0xfe85('0x1a')](respondWithResult(_0x38ec4b,0xc9))['catch'](handleError(_0x38ec4b,null));};exports['create']=function(_0x5361a8,_0x4352d8,_0x5e7815){var _0x24baef;return db['Trunk'][_0xfe85('0x55')](_0x5361a8[_0xfe85('0x54')],{'raw':!![]})['then'](function(_0x23e79a){_0x24baef=_0x23e79a;return db['Trunk'][_0xfe85('0x4b')]({'raw':!![]});})['then'](function(_0x197fb5){var _0x2f5890=fs[_0xfe85('0x5d')](path['join'](config[_0xfe85('0x5e')],'server/files/templates/trunk.ejs'),_0xfe85('0x5f'));var _0x19b12b=fs['readFileSync'](path[_0xfe85('0x60')](config['root'],_0xfe85('0x61')),'utf8');var _0x6dfe13=ejs[_0xfe85('0x62')](_0x2f5890,{'trunks':_0x197fb5||[]});fs[_0xfe85('0x63')](_0xfe85('0x64'),_0x6dfe13);if(_0x24baef[_0xfe85('0x65')]){var _0x32bfcd=ejs[_0xfe85('0x62')](_0x19b12b,{'trunks':_0x197fb5||[]});fs[_0xfe85('0x63')](_0xfe85('0x66'),_0x32bfcd);}})[_0xfe85('0x1a')](function(){return respondWithRpcPromise(_0xfe85('0x67'),_0xfe85('0x55'),{'module':_0xfe85('0x68')});})[_0xfe85('0x1a')](function(){var _0x52578a=_0x5361a8[_0xfe85('0x56')][_0xfe85('0x30')]({'plain':!![]});if(!_0x52578a)throw new Error(_0xfe85('0x69'));if(_0x52578a[_0xfe85('0x57')]==='user'){var _0x11bd49=_0x24baef[_0xfe85('0x30')]({'plain':!![]});return db[_0xfe85('0x58')]['find']({'where':{'name':_0xfe85('0x6a'),'userProfileId':_0x52578a['userProfileId']},'raw':!![]})['then'](function(_0x572461){if(_0x572461&&_0x572461[_0xfe85('0x5a')]===0x0){return db[_0xfe85('0x5b')][_0xfe85('0x55')]({'name':_0x11bd49[_0xfe85('0x32')],'resourceId':_0x11bd49['id'],'type':_0x572461[_0xfe85('0x32')],'sectionId':_0x572461['id']},{})[_0xfe85('0x1a')](function(){return _0x24baef;});}else{return _0x24baef;}})[_0xfe85('0x4e')](function(_0x7d9ca1){logger[_0xfe85('0x20')](_0xfe85('0x5c'),_0x7d9ca1);throw _0x7d9ca1;});}return _0x24baef;})['then'](respondWithResult(_0x4352d8,0xc9))['catch'](handleError(_0x4352d8,null));};exports[_0xfe85('0x2e')]=function(_0x494ad0,_0x5a93be,_0x537923){var _0x2ef4c9;return db[_0xfe85('0x48')][_0xfe85('0x4d')]({'where':{'id':_0x494ad0['params']['id']}})['then'](handleEntityNotFound(_0x5a93be,null))[_0xfe85('0x1a')](saveUpdates(_0x494ad0[_0xfe85('0x54')],null))['then'](function(_0x5ee737){if(_0x5ee737){_0x2ef4c9=_0x5ee737;return db[_0xfe85('0x48')]['findAll']({'raw':!![]});}})[_0xfe85('0x1a')](function(_0x36364f){if(_0x36364f){var _0x20dc39=fs[_0xfe85('0x5d')](path[_0xfe85('0x60')](config[_0xfe85('0x5e')],_0xfe85('0x6b')),_0xfe85('0x5f'));var _0x34cbe8=fs[_0xfe85('0x5d')](path[_0xfe85('0x60')](config[_0xfe85('0x5e')],_0xfe85('0x61')),_0xfe85('0x5f'));var _0x14ae2f=ejs['render'](_0x20dc39,{'trunks':_0x36364f||[]});fs[_0xfe85('0x63')](_0xfe85('0x64'),_0x14ae2f);var _0x257bea=ejs['render'](_0x34cbe8,{'trunks':_0x36364f||[]});fs[_0xfe85('0x63')](_0xfe85('0x66'),_0x257bea);return respondWithRpcPromise(_0xfe85('0x67'),'update',{'module':_0xfe85('0x68')});}return null;})[_0xfe85('0x1a')](function(_0x5aa0b9){if(_0x5aa0b9){return _0x2ef4c9;}})[_0xfe85('0x1a')](respondWithResult(_0x5a93be,null))[_0xfe85('0x4e')](handleError(_0x5a93be,null));};exports['destroy']=function(_0x38fe31,_0x109ac0,_0xa02b37){var _0x402370;return db[_0xfe85('0x48')][_0xfe85('0x4d')]({'where':{'id':_0x38fe31[_0xfe85('0x4c')]['id']}})[_0xfe85('0x1a')](handleEntityNotFound(_0x109ac0,null))[_0xfe85('0x1a')](removeEntity(_0x109ac0,null))[_0xfe85('0x1a')](function(){return db['Trunk'][_0xfe85('0x4b')]({'raw':!![]});})[_0xfe85('0x1a')](function(_0x48b14c){var _0x416100=fs['readFileSync'](path[_0xfe85('0x60')](config[_0xfe85('0x5e')],'server/files/templates/trunk.ejs'),'utf8');var _0x621b70=fs['readFileSync'](path[_0xfe85('0x60')](config[_0xfe85('0x5e')],_0xfe85('0x61')),_0xfe85('0x5f'));var _0xd9fddc=ejs[_0xfe85('0x62')](_0x416100,{'trunks':_0x48b14c});var _0x423fa2=ejs[_0xfe85('0x62')](_0x621b70,{'trunks':_0x48b14c});fs[_0xfe85('0x63')]('/etc/asterisk/sip_xcally_trunks.conf',_0xd9fddc);fs[_0xfe85('0x63')](_0xfe85('0x66'),_0x423fa2);return respondWithRpcPromise('Reload',_0xfe85('0x2f'),{'module':_0xfe85('0x68')});})[_0xfe85('0x4e')](handleError(_0x109ac0,null));}; \ No newline at end of file +var _0x39f6=['render','/etc/asterisk/sip_xcally_registers.conf','Reload','role','params','readFileSync','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','update','chan_sip.so','eml-format','rimraf','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','field','filter','options','include','findAll','show','includeAll','find','clone','omit','createdAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','registry'];(function(_0x1bf391,_0x2b760d){var _0x11d09c=function(_0x3e2c0f){while(--_0x3e2c0f){_0x1bf391['push'](_0x1bf391['shift']());}};_0x11d09c(++_0x2b760d);}(_0x39f6,0x1ae));var _0x639f=function(_0x518742,_0x489242){_0x518742=_0x518742-0x0;var _0x2cb163=_0x39f6[_0x518742];return _0x2cb163;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x639f('0x0'));var rimraf=require(_0x639f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x639f('0x2'));var moment=require(_0x639f('0x3'));var BPromise=require(_0x639f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x639f('0x5'));var sox=require(_0x639f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x639f('0x7'));var squel=require(_0x639f('0x8'));var crypto=require(_0x639f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x639f('0xa'));var toCsv=require(_0x639f('0xb'));var querystring=require(_0x639f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x639f('0xd'));var qs=require(_0x639f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x639f('0xf'))(_0x639f('0x10'));var utils=require(_0x639f('0x11'));var config=require('../../config/environment');var db=require(_0x639f('0x12'))['db'];var jayson=require(_0x639f('0x13'));var client=jayson['client'][_0x639f('0x14')]({'port':0x232a});function checkPasswordPattern(_0x4381bb,_0x321dfe,_0x335928){if(_0x335928){var _0x69f77e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x69f77e[_0x639f('0x15')](_0x321dfe)){return _0x4381bb;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4381bb;}}function respondWithRpcPromise(_0x14711d,_0x2fee07,_0x1b7120,_0x5708d6){return new BPromise(function(_0x54ff95,_0xeb2a99){var _0x50aa59=_0x5708d6||client;return _0x50aa59[_0x639f('0x16')](_0x14711d,_0x1b7120)[_0x639f('0x17')](function(_0xba864d){logger['info']('Trunk,\x20%s,\x20%s',_0x2fee07,_0x639f('0x18'));logger[_0x639f('0x19')](_0x639f('0x1a'),_0x2fee07,_0x639f('0x18'),JSON[_0x639f('0x1b')](_0xba864d));if(_0xba864d[_0x639f('0x1c')]){if(_0xba864d['error']['code']===0x1f4){logger[_0x639f('0x1c')](_0x639f('0x1d'),_0x2fee07,_0xba864d[_0x639f('0x1c')]['message']);return _0xeb2a99(_0xba864d[_0x639f('0x1c')][_0x639f('0x1e')]);}logger[_0x639f('0x1c')]('Trunk,\x20%s,\x20%s',_0x2fee07,_0xba864d[_0x639f('0x1c')]['message']);return _0x54ff95(_0xba864d[_0x639f('0x1c')][_0x639f('0x1e')]);}else{logger[_0x639f('0x1f')](_0x639f('0x1d'),_0x2fee07,_0x639f('0x18'));_0x54ff95(_0xba864d['result'][_0x639f('0x1e')]);}})[_0x639f('0x20')](function(_0x46f353){logger[_0x639f('0x1c')](_0x639f('0x1d'),_0x2fee07,_0x46f353);_0xeb2a99(_0x46f353);});});}function respondWithStatusCode(_0xba3a79,_0x41e9ed){_0x41e9ed=_0x41e9ed||0xcc;return function(_0x51bb4c){if(_0x51bb4c){return _0xba3a79[_0x639f('0x21')](_0x41e9ed);}return _0xba3a79[_0x639f('0x22')](_0x41e9ed)[_0x639f('0x23')]();};}function respondWithResult(_0x966244,_0x3c61b9){_0x3c61b9=_0x3c61b9||0xc8;return function(_0x573569){if(_0x573569){return _0x966244['status'](_0x3c61b9)['json'](_0x573569);}};}function respondWithFilteredResult(_0x19f56f,_0x1ba514){return function(_0x211ee9){if(_0x211ee9){var _0x415032=_0x211ee9[_0x639f('0x24')],_0x3b1e33=_0x1ba514[_0x639f('0x25')],_0x16f535=_0x1ba514[_0x639f('0x25')]+_0x1ba514[_0x639f('0x26')],_0x1dacc9;if(_0x16f535>=_0x415032){_0x16f535=_0x415032;_0x1dacc9=0xc8;}else{_0x1dacc9=0xce;}_0x19f56f['status'](_0x1dacc9);return _0x19f56f['set'](_0x639f('0x27'),_0x3b1e33+'-'+_0x16f535+'/'+_0x415032)['json'](_0x211ee9);}return null;};}function patchUpdates(_0xb5eb43){return function(_0x933013){try{jsonpatch[_0x639f('0x28')](_0x933013,_0xb5eb43,!![]);}catch(_0x508288){return BPromise[_0x639f('0x29')](_0x508288);}return _0x933013[_0x639f('0x2a')]();};}function saveUpdates(_0x1ffe5,_0x1bc718){return function(_0x478ca6){if(_0x478ca6){return _0x478ca6['update'](_0x1ffe5)['then'](function(_0x3b3075){return _0x3b3075;});}return null;};}function removeEntity(_0x351004,_0x57529e){return function(_0x27215a){if(_0x27215a){return _0x27215a[_0x639f('0x2b')]()[_0x639f('0x17')](function(){var _0x4ed3fc=_0x27215a[_0x639f('0x2c')]({'plain':!![]});var _0x3cd17e=_0x639f('0x2d');return db[_0x639f('0x2e')]['destroy']({'where':{'type':_0x3cd17e,'resourceId':_0x4ed3fc['id']}})[_0x639f('0x17')](function(){return _0x27215a;});})['then'](function(){_0x351004[_0x639f('0x22')](0xcc)[_0x639f('0x23')]();});}};}function handleEntityNotFound(_0x39f874,_0x37f63e){return function(_0x412d7d){if(!_0x412d7d){_0x39f874['sendStatus'](0x194);}return _0x412d7d;};}function handleError(_0x2b1017,_0x220916){_0x220916=_0x220916||0x1f4;return function(_0x257100){logger[_0x639f('0x1c')](_0x257100[_0x639f('0x2f')]);if(_0x257100[_0x639f('0x30')]){delete _0x257100[_0x639f('0x30')];}_0x2b1017[_0x639f('0x22')](_0x220916)[_0x639f('0x31')](_0x257100);};}exports[_0x639f('0x32')]=function(_0x2232f8,_0x2bcad8){var _0x22462d={},_0x1ac083={},_0x249a64={'count':0x0,'rows':[]};var _0x2d619d=db[_0x639f('0x33')][_0x639f('0x34')];_0x1ac083[_0x639f('0x35')]=_[_0x639f('0x36')](_0x2d619d);_0x1ac083['query']=_[_0x639f('0x36')](_0x2232f8['query']);_0x1ac083[_0x639f('0x37')]=_[_0x639f('0x38')](_0x1ac083[_0x639f('0x35')],_0x1ac083[_0x639f('0x39')]);_0x22462d['attributes']=_[_0x639f('0x38')](_0x1ac083['model'],qs[_0x639f('0x3a')](_0x2232f8[_0x639f('0x39')][_0x639f('0x3a')]));_0x22462d[_0x639f('0x3b')]=_0x22462d['attributes'][_0x639f('0x3c')]?_0x22462d['attributes']:_0x1ac083['model'];if(!_0x2232f8[_0x639f('0x39')][_0x639f('0x3d')](_0x639f('0x3e'))){_0x22462d[_0x639f('0x26')]=qs[_0x639f('0x26')](_0x2232f8[_0x639f('0x39')][_0x639f('0x26')]);_0x22462d[_0x639f('0x25')]=qs[_0x639f('0x25')](_0x2232f8[_0x639f('0x39')][_0x639f('0x25')]);}_0x22462d[_0x639f('0x3f')]=qs[_0x639f('0x40')](_0x2232f8[_0x639f('0x39')][_0x639f('0x40')]);_0x22462d[_0x639f('0x41')]=qs[_0x639f('0x37')](_[_0x639f('0x42')](_0x2232f8['query'],_0x1ac083[_0x639f('0x37')]));if(_0x2232f8[_0x639f('0x39')]['filter']){_0x22462d['where']=_[_0x639f('0x43')](_0x22462d[_0x639f('0x41')],{'$or':_[_0x639f('0x44')](_0x2d619d,function(_0x34324e){if(_0x34324e['type'][_0x639f('0x45')]!=='VIRTUAL'){var _0x1ee3e2={};_0x1ee3e2[_0x34324e[_0x639f('0x46')]]={'$like':'%'+_0x2232f8['query'][_0x639f('0x47')]+'%'};return _0x1ee3e2;}})});}_0x22462d=_[_0x639f('0x43')]({},_0x22462d,_0x2232f8[_0x639f('0x48')]);var _0x387ac2={'where':_0x22462d[_0x639f('0x41')]};return db[_0x639f('0x33')][_0x639f('0x24')](_0x387ac2)[_0x639f('0x17')](function(_0x5d15a8){_0x249a64[_0x639f('0x24')]=_0x5d15a8;if(_0x2232f8[_0x639f('0x39')]['includeAll']){_0x22462d[_0x639f('0x49')]=[{'all':!![]}];}return db[_0x639f('0x33')][_0x639f('0x4a')](_0x22462d);})[_0x639f('0x17')](function(_0x3344f4){_0x249a64['rows']=_0x3344f4;return _0x249a64;})[_0x639f('0x17')](respondWithFilteredResult(_0x2bcad8,_0x22462d))['catch'](handleError(_0x2bcad8,null));};exports[_0x639f('0x4b')]=function(_0x51ac19,_0x725f2f){var _0x37fa15={'raw':![],'where':{'id':_0x51ac19['params']['id']}},_0x4e56c2={};_0x4e56c2['model']=_[_0x639f('0x36')](db[_0x639f('0x33')][_0x639f('0x34')]);_0x4e56c2['query']=_[_0x639f('0x36')](_0x51ac19[_0x639f('0x39')]);_0x4e56c2[_0x639f('0x37')]=_[_0x639f('0x38')](_0x4e56c2[_0x639f('0x35')],_0x4e56c2['query']);_0x37fa15['attributes']=_[_0x639f('0x38')](_0x4e56c2['model'],qs['fields'](_0x51ac19['query']['fields']));_0x37fa15[_0x639f('0x3b')]=_0x37fa15[_0x639f('0x3b')][_0x639f('0x3c')]?_0x37fa15[_0x639f('0x3b')]:_0x4e56c2[_0x639f('0x35')];if(_0x51ac19[_0x639f('0x39')][_0x639f('0x4c')]){_0x37fa15[_0x639f('0x49')]=[{'all':!![]}];}_0x37fa15=_[_0x639f('0x43')]({},_0x37fa15,_0x51ac19[_0x639f('0x48')]);return db[_0x639f('0x33')][_0x639f('0x4d')](_0x37fa15)[_0x639f('0x17')](handleEntityNotFound(_0x725f2f,null))[_0x639f('0x17')](respondWithResult(_0x725f2f,null))['catch'](handleError(_0x725f2f,null));};exports[_0x639f('0x4e')]=function(_0x311145,_0x4614ab){var _0x4e5bc6={'raw':![],'where':{'id':_0x311145['params']['id']}},_0x3dcf56={};_0x3dcf56[_0x639f('0x35')]=_['keys'](db['Trunk']['rawAttributes']);_0x4e5bc6[_0x639f('0x3b')]=_[_0x639f('0x38')](_0x3dcf56[_0x639f('0x35')],qs[_0x639f('0x3a')](_0x311145[_0x639f('0x39')][_0x639f('0x3a')]));_0x4e5bc6[_0x639f('0x3b')]=_0x4e5bc6['attributes'][_0x639f('0x3c')]?_0x4e5bc6['attributes']:_0x3dcf56[_0x639f('0x35')];if(_0x311145['query'][_0x639f('0x4c')]){_0x4e5bc6['include']=[{'all':!![]}];}_0x4e5bc6=_['merge']({},_0x4e5bc6,_0x311145[_0x639f('0x48')]);return db[_0x639f('0x33')][_0x639f('0x4d')](_0x4e5bc6)[_0x639f('0x17')](handleEntityNotFound(_0x4614ab,null))[_0x639f('0x17')](function(_0x18efd0){if(_0x18efd0){var _0x4d1951=_0x18efd0[_0x639f('0x2c')]({'plain':!![]});_0x4d1951=qs[_0x639f('0x4f')](_0x4d1951,['id',_0x639f('0x50'),'updatedAt']);_0x311145[_0x639f('0x51')]=_[_0x639f('0x4f')](_0x311145[_0x639f('0x51')],['id','createdAt','updatedAt']);return db[_0x639f('0x33')]['create'](_[_0x639f('0x43')](_0x4d1951,_0x311145[_0x639f('0x51')]),{'include':_0x311145['query'][_0x639f('0x4c')]?[{'all':!![]}]:undefined})[_0x639f('0x17')](function(_0xe4b7ed){var _0x4ddde9=_0x311145[_0x639f('0x52')][_0x639f('0x2c')]({'plain':!![]});if(!_0x4ddde9)throw new Error(_0x639f('0x53'));if(_0x4ddde9['role']===_0x639f('0x52')){var _0x204f94=_0xe4b7ed[_0x639f('0x2c')]({'plain':!![]});var _0x34d82b=_0x639f('0x2d');return db[_0x639f('0x54')][_0x639f('0x4d')]({'where':{'name':_0x34d82b,'userProfileId':_0x4ddde9[_0x639f('0x55')]},'raw':!![]})['then'](function(_0x943101){if(_0x943101&&_0x943101[_0x639f('0x56')]===0x0){return db[_0x639f('0x2e')][_0x639f('0x57')]({'name':_0x204f94[_0x639f('0x30')],'resourceId':_0x204f94['id'],'type':_0x943101[_0x639f('0x30')],'sectionId':_0x943101['id']},{})[_0x639f('0x17')](function(){return _0xe4b7ed;});}else{return _0xe4b7ed;}})[_0x639f('0x20')](function(_0xc60a49){logger[_0x639f('0x1c')](_0x639f('0x58'),_0xc60a49);throw _0xc60a49;});}return _0xe4b7ed;});}})[_0x639f('0x17')](respondWithResult(_0x4614ab,0xc9))[_0x639f('0x20')](handleError(_0x4614ab,null));};exports[_0x639f('0x57')]=function(_0x5df4ee,_0x5f59e1,_0x3fa2c4){var _0x520fd1;return db[_0x639f('0x33')][_0x639f('0x57')](_0x5df4ee['body'],{'raw':!![]})[_0x639f('0x17')](function(_0x2dc1f5){_0x520fd1=_0x2dc1f5;return db[_0x639f('0x33')][_0x639f('0x4a')]({'raw':!![]});})['then'](function(_0x482aa8){var _0xf2e2fd=fs['readFileSync'](path[_0x639f('0x59')](config[_0x639f('0x5a')],_0x639f('0x5b')),'utf8');var _0x3ff21c=fs['readFileSync'](path['join'](config['root'],_0x639f('0x5c')),_0x639f('0x5d'));var _0x2a5173=ejs['render'](_0xf2e2fd,{'trunks':_0x482aa8||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x2a5173);if(_0x520fd1[_0x639f('0x5e')]){var _0x22a5a4=ejs[_0x639f('0x5f')](_0x3ff21c,{'trunks':_0x482aa8||[]});fs['writeFileSync'](_0x639f('0x60'),_0x22a5a4);}})['then'](function(){return respondWithRpcPromise(_0x639f('0x61'),'create',{'module':'chan_sip.so'});})[_0x639f('0x17')](function(){var _0x17fadc=_0x5df4ee['user']['get']({'plain':!![]});if(!_0x17fadc)throw new Error(_0x639f('0x53'));if(_0x17fadc[_0x639f('0x62')]==='user'){var _0x19a652=_0x520fd1[_0x639f('0x2c')]({'plain':!![]});return db['UserProfileSection'][_0x639f('0x4d')]({'where':{'name':_0x639f('0x2d'),'userProfileId':_0x17fadc['userProfileId']},'raw':!![]})[_0x639f('0x17')](function(_0x3a8e1f){if(_0x3a8e1f&&_0x3a8e1f[_0x639f('0x56')]===0x0){return db['UserProfileResource'][_0x639f('0x57')]({'name':_0x19a652[_0x639f('0x30')],'resourceId':_0x19a652['id'],'type':_0x3a8e1f[_0x639f('0x30')],'sectionId':_0x3a8e1f['id']},{})['then'](function(){return _0x520fd1;});}else{return _0x520fd1;}})[_0x639f('0x20')](function(_0x137bf4){logger[_0x639f('0x1c')](_0x639f('0x58'),_0x137bf4);throw _0x137bf4;});}return _0x520fd1;})['then'](respondWithResult(_0x5f59e1,0xc9))[_0x639f('0x20')](handleError(_0x5f59e1,null));};exports['update']=function(_0x3e6045,_0x207a9c,_0x56abe8){var _0x8651b;return db[_0x639f('0x33')][_0x639f('0x4d')]({'where':{'id':_0x3e6045[_0x639f('0x63')]['id']}})[_0x639f('0x17')](handleEntityNotFound(_0x207a9c,null))[_0x639f('0x17')](saveUpdates(_0x3e6045[_0x639f('0x51')],null))[_0x639f('0x17')](function(_0x23cef2){if(_0x23cef2){_0x8651b=_0x23cef2;return db[_0x639f('0x33')][_0x639f('0x4a')]({'raw':!![]});}})[_0x639f('0x17')](function(_0x16061b){if(_0x16061b){var _0x5b6230=fs[_0x639f('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0x639f('0x5d'));var _0x15660a=fs['readFileSync'](path[_0x639f('0x59')](config[_0x639f('0x5a')],_0x639f('0x5c')),_0x639f('0x5d'));var _0x4ca6a9=ejs[_0x639f('0x5f')](_0x5b6230,{'trunks':_0x16061b||[]});fs[_0x639f('0x65')](_0x639f('0x66'),_0x4ca6a9);var _0x283650=ejs['render'](_0x15660a,{'trunks':_0x16061b||[]});fs[_0x639f('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x283650);return respondWithRpcPromise('Reload',_0x639f('0x67'),{'module':_0x639f('0x68')});}return null;})[_0x639f('0x17')](function(_0x33793c){if(_0x33793c){return _0x8651b;}})['then'](respondWithResult(_0x207a9c,null))[_0x639f('0x20')](handleError(_0x207a9c,null));};exports[_0x639f('0x2b')]=function(_0x4c0679,_0xe79a1a,_0xf1c6c7){var _0x44d322;return db['Trunk'][_0x639f('0x4d')]({'where':{'id':_0x4c0679[_0x639f('0x63')]['id']}})[_0x639f('0x17')](handleEntityNotFound(_0xe79a1a,null))['then'](removeEntity(_0xe79a1a,null))[_0x639f('0x17')](function(){return db[_0x639f('0x33')][_0x639f('0x4a')]({'raw':!![]});})[_0x639f('0x17')](function(_0x49a438){var _0x154b40=fs[_0x639f('0x64')](path[_0x639f('0x59')](config[_0x639f('0x5a')],'server/files/templates/trunk.ejs'),_0x639f('0x5d'));var _0x4c0574=fs[_0x639f('0x64')](path['join'](config['root'],_0x639f('0x5c')),'utf8');var _0x360d11=ejs[_0x639f('0x5f')](_0x154b40,{'trunks':_0x49a438});var _0x43b299=ejs[_0x639f('0x5f')](_0x4c0574,{'trunks':_0x49a438});fs[_0x639f('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x360d11);fs[_0x639f('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x43b299);return respondWithRpcPromise(_0x639f('0x61'),'destroy',{'module':_0x639f('0x68')});})['catch'](handleError(_0xe79a1a,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index bc71e38..a679b5f 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 _0x0207=['Trunk','tools_trunks','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x0207,0x162));var _0x7020=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0x0207[_0x3725ee];return _0x399c71;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7020('0x1'));var BPromise=require(_0x7020('0x2'));var rp=require(_0x7020('0x3'));var fs=require('fs');var path=require(_0x7020('0x4'));var rimraf=require(_0x7020('0x5'));var config=require(_0x7020('0x6'));var attributes=require(_0x7020('0x7'));module['exports']=function(_0x5074d7,_0x38c320){return _0x5074d7[_0x7020('0x8')](_0x7020('0x9'),attributes,{'tableName':_0x7020('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc090=['tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define'];(function(_0x262acd,_0x1c5487){var _0x25016c=function(_0x95551f){while(--_0x95551f){_0x262acd['push'](_0x262acd['shift']());}};_0x25016c(++_0x1c5487);}(_0xc090,0x112));var _0x0c09=function(_0xcd9db5,_0x2451da){_0xcd9db5=_0xcd9db5-0x0;var _0x536c9f=_0xc090[_0xcd9db5];return _0x536c9f;};'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')]('Trunk',attributes,{'tableName':_0x0c09('0xc'),'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 a7b4c33..a6b272f 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 _0x8dc6=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include','model','info','debug','where','map','then','ShowTrunk','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x510d53,_0x22854d){var _0x3e49c4=function(_0x1e19a5){while(--_0x1e19a5){_0x510d53['push'](_0x510d53['shift']());}};_0x3e49c4(++_0x22854d);}(_0x8dc6,0x1f2));var _0x68dc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8dc6[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x68dc('0x0'));var moment=require('moment');var BPromise=require(_0x68dc('0x1'));var rs=require(_0x68dc('0x2'));var fs=require('fs');var Redis=require(_0x68dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x68dc('0x4'));var config=require(_0x68dc('0x5'));var jayson=require(_0x68dc('0x6'));var client=jayson[_0x68dc('0x7')][_0x68dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3511d1,_0x235d09,_0x199e3f){return new BPromise(function(_0x576ebe,_0xeded66){return client[_0x68dc('0x9')](_0x3511d1,_0x199e3f)['then'](function(_0x583287){logger['info'](_0x68dc('0xa'),_0x235d09,_0x68dc('0xb'));logger['debug'](_0x68dc('0xc'),_0x235d09,'request\x20sent',JSON[_0x68dc('0xd')](_0x583287));if(_0x583287[_0x68dc('0xe')]){if(_0x583287[_0x68dc('0xe')][_0x68dc('0xf')]===0x1f4){logger[_0x68dc('0xe')](_0x68dc('0xa'),_0x235d09,_0x583287[_0x68dc('0xe')][_0x68dc('0x10')]);return _0xeded66(_0x583287[_0x68dc('0xe')][_0x68dc('0x10')]);}logger[_0x68dc('0xe')]('Trunk,\x20%s,\x20%s',_0x235d09,_0x583287[_0x68dc('0xe')][_0x68dc('0x10')]);return _0x576ebe(_0x583287[_0x68dc('0xe')][_0x68dc('0x10')]);}else{logger['info'](_0x68dc('0xa'),_0x235d09,'request\x20sent');_0x576ebe(_0x583287[_0x68dc('0x11')][_0x68dc('0x10')]);}})[_0x68dc('0x12')](function(_0x2a5655){logger[_0x68dc('0xe')](_0x68dc('0xa'),_0x235d09,_0x2a5655);_0xeded66(_0x2a5655);});});}exports[_0x68dc('0x13')]=function(_0x9b9c6a){var _0x26c97f=this;return new Promise(function(_0x51994b,_0x1767e2){return db[_0x68dc('0x14')][_0x68dc('0x15')]({'raw':_0x9b9c6a[_0x68dc('0x16')]?_0x9b9c6a[_0x68dc('0x16')][_0x68dc('0x17')]===undefined?!![]:![]:!![],'where':_0x9b9c6a[_0x68dc('0x16')]?_0x9b9c6a[_0x68dc('0x16')]['where']||null:null,'attributes':_0x9b9c6a[_0x68dc('0x16')]?_0x9b9c6a[_0x68dc('0x16')][_0x68dc('0x18')]||null:null,'limit':_0x9b9c6a['options']?_0x9b9c6a[_0x68dc('0x16')][_0x68dc('0x19')]||null:null,'include':_0x9b9c6a[_0x68dc('0x16')]?_0x9b9c6a['options'][_0x68dc('0x1a')]?_['map'](_0x9b9c6a[_0x68dc('0x16')]['include'],function(_0x36f6f5){return{'model':db[_0x36f6f5[_0x68dc('0x1b')]],'as':_0x36f6f5['as'],'attributes':_0x36f6f5[_0x68dc('0x18')],'include':_0x36f6f5[_0x68dc('0x1a')]?_['map'](_0x36f6f5['include'],function(_0x55a296){return{'model':db[_0x55a296[_0x68dc('0x1b')]],'as':_0x55a296['as'],'attributes':_0x55a296[_0x68dc('0x18')],'include':_0x55a296['include']?_['map'](_0x55a296[_0x68dc('0x1a')],function(_0x25291d){return{'model':db[_0x25291d[_0x68dc('0x1b')]],'as':_0x25291d['as'],'attributes':_0x25291d[_0x68dc('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe45080){logger[_0x68dc('0x1c')]('GetTrunk',_0x9b9c6a);logger[_0x68dc('0x1d')]('GetTrunk',_0x9b9c6a,JSON[_0x68dc('0xd')](_0xe45080));_0x51994b(_0xe45080);})[_0x68dc('0x12')](function(_0x35f3a2){logger[_0x68dc('0xe')](_0x68dc('0x13'),_0x35f3a2['message'],_0x9b9c6a);_0x1767e2(_0x26c97f['error'](0x1f4,_0x35f3a2['message']));});});};exports['ShowTrunk']=function(_0xaaa012){var _0x40ad8c=this;return new Promise(function(_0x1f5e7a,_0x146810){return db[_0x68dc('0x14')]['find']({'raw':_0xaaa012[_0x68dc('0x16')]?_0xaaa012['options'][_0x68dc('0x17')]===undefined?!![]:![]:!![],'where':_0xaaa012[_0x68dc('0x16')]?_0xaaa012['options'][_0x68dc('0x1e')]||null:null,'attributes':_0xaaa012[_0x68dc('0x16')]?_0xaaa012[_0x68dc('0x16')]['attributes']||null:null,'include':_0xaaa012[_0x68dc('0x16')]?_0xaaa012['options'][_0x68dc('0x1a')]?_[_0x68dc('0x1f')](_0xaaa012[_0x68dc('0x16')][_0x68dc('0x1a')],function(_0x4efd82){return{'model':db[_0x4efd82[_0x68dc('0x1b')]],'as':_0x4efd82['as'],'attributes':_0x4efd82[_0x68dc('0x18')],'include':_0x4efd82[_0x68dc('0x1a')]?_[_0x68dc('0x1f')](_0x4efd82[_0x68dc('0x1a')],function(_0x44e16f){return{'model':db[_0x44e16f[_0x68dc('0x1b')]],'as':_0x44e16f['as'],'attributes':_0x44e16f['attributes'],'include':_0x44e16f[_0x68dc('0x1a')]?_['map'](_0x44e16f['include'],function(_0x514bff){return{'model':db[_0x514bff[_0x68dc('0x1b')]],'as':_0x514bff['as'],'attributes':_0x514bff['attributes']};}):[]};}):[]};}):[]:[]})[_0x68dc('0x20')](function(_0x1db043){logger[_0x68dc('0x1c')]('ShowTrunk',_0xaaa012);logger[_0x68dc('0x1d')](_0x68dc('0x21'),_0xaaa012,JSON[_0x68dc('0xd')](_0x1db043));_0x1f5e7a(_0x1db043);})[_0x68dc('0x12')](function(_0x154635){logger[_0x68dc('0xe')](_0x68dc('0x21'),_0x154635[_0x68dc('0x10')],_0xaaa012);_0x146810(_0x40ad8c[_0x68dc('0xe')](0x1f4,_0x154635['message']));});});}; \ No newline at end of file +var _0x0488=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trunk','findAll','options','raw','where','attributes','map','model','include','GetTrunk','ShowTrunk','find','lodash','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0488,0x196));var _0x8048=function(_0x44119e,_0x31cdec){_0x44119e=_0x44119e-0x0;var _0x333f74=_0x0488[_0x44119e];return _0x333f74;};'use strict';var _=require(_0x8048('0x0'));var util=require(_0x8048('0x1'));var moment=require(_0x8048('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8048('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8048('0x4'));var logger=require(_0x8048('0x5'))(_0x8048('0x6'));var config=require(_0x8048('0x7'));var jayson=require(_0x8048('0x8'));var client=jayson[_0x8048('0x9')][_0x8048('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3957df,_0x3aeab0,_0x1244be){return new BPromise(function(_0x5ee4bc,_0x3df34f){return client['request'](_0x3957df,_0x1244be)[_0x8048('0xb')](function(_0xf27d1b){logger[_0x8048('0xc')](_0x8048('0xd'),_0x3aeab0,_0x8048('0xe'));logger[_0x8048('0xf')](_0x8048('0x10'),_0x3aeab0,_0x8048('0xe'),JSON[_0x8048('0x11')](_0xf27d1b));if(_0xf27d1b[_0x8048('0x12')]){if(_0xf27d1b[_0x8048('0x12')][_0x8048('0x13')]===0x1f4){logger[_0x8048('0x12')]('Trunk,\x20%s,\x20%s',_0x3aeab0,_0xf27d1b[_0x8048('0x12')][_0x8048('0x14')]);return _0x3df34f(_0xf27d1b[_0x8048('0x12')][_0x8048('0x14')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x3aeab0,_0xf27d1b['error'][_0x8048('0x14')]);return _0x5ee4bc(_0xf27d1b['error'][_0x8048('0x14')]);}else{logger['info'](_0x8048('0xd'),_0x3aeab0,_0x8048('0xe'));_0x5ee4bc(_0xf27d1b['result'][_0x8048('0x14')]);}})[_0x8048('0x15')](function(_0x594beb){logger[_0x8048('0x12')]('Trunk,\x20%s,\x20%s',_0x3aeab0,_0x594beb);_0x3df34f(_0x594beb);});});}exports['GetTrunk']=function(_0x509a6b){var _0x1d0015=this;return new Promise(function(_0x2baff1,_0x47ecc6){return db[_0x8048('0x16')][_0x8048('0x17')]({'raw':_0x509a6b[_0x8048('0x18')]?_0x509a6b[_0x8048('0x18')][_0x8048('0x19')]===undefined?!![]:![]:!![],'where':_0x509a6b[_0x8048('0x18')]?_0x509a6b[_0x8048('0x18')][_0x8048('0x1a')]||null:null,'attributes':_0x509a6b[_0x8048('0x18')]?_0x509a6b[_0x8048('0x18')][_0x8048('0x1b')]||null:null,'limit':_0x509a6b[_0x8048('0x18')]?_0x509a6b[_0x8048('0x18')]['limit']||null:null,'include':_0x509a6b[_0x8048('0x18')]?_0x509a6b[_0x8048('0x18')]['include']?_[_0x8048('0x1c')](_0x509a6b[_0x8048('0x18')]['include'],function(_0xa97945){return{'model':db[_0xa97945[_0x8048('0x1d')]],'as':_0xa97945['as'],'attributes':_0xa97945['attributes'],'include':_0xa97945[_0x8048('0x1e')]?_[_0x8048('0x1c')](_0xa97945['include'],function(_0x3dabf1){return{'model':db[_0x3dabf1[_0x8048('0x1d')]],'as':_0x3dabf1['as'],'attributes':_0x3dabf1[_0x8048('0x1b')],'include':_0x3dabf1[_0x8048('0x1e')]?_[_0x8048('0x1c')](_0x3dabf1[_0x8048('0x1e')],function(_0xf42cab){return{'model':db[_0xf42cab[_0x8048('0x1d')]],'as':_0xf42cab['as'],'attributes':_0xf42cab[_0x8048('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8048('0xb')](function(_0x5f3f8d){logger['info'](_0x8048('0x1f'),_0x509a6b);logger[_0x8048('0xf')](_0x8048('0x1f'),_0x509a6b,JSON[_0x8048('0x11')](_0x5f3f8d));_0x2baff1(_0x5f3f8d);})[_0x8048('0x15')](function(_0x35b4f2){logger[_0x8048('0x12')](_0x8048('0x1f'),_0x35b4f2[_0x8048('0x14')],_0x509a6b);_0x47ecc6(_0x1d0015['error'](0x1f4,_0x35b4f2[_0x8048('0x14')]));});});};exports[_0x8048('0x20')]=function(_0x4b482f){var _0x56ac2b=this;return new Promise(function(_0xd36d0c,_0x5db2a3){return db[_0x8048('0x16')][_0x8048('0x21')]({'raw':_0x4b482f[_0x8048('0x18')]?_0x4b482f['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b482f[_0x8048('0x18')]?_0x4b482f[_0x8048('0x18')][_0x8048('0x1a')]||null:null,'attributes':_0x4b482f[_0x8048('0x18')]?_0x4b482f[_0x8048('0x18')][_0x8048('0x1b')]||null:null,'include':_0x4b482f[_0x8048('0x18')]?_0x4b482f[_0x8048('0x18')][_0x8048('0x1e')]?_[_0x8048('0x1c')](_0x4b482f[_0x8048('0x18')][_0x8048('0x1e')],function(_0x1d9d8f){return{'model':db[_0x1d9d8f[_0x8048('0x1d')]],'as':_0x1d9d8f['as'],'attributes':_0x1d9d8f['attributes'],'include':_0x1d9d8f[_0x8048('0x1e')]?_[_0x8048('0x1c')](_0x1d9d8f[_0x8048('0x1e')],function(_0x2c1fd0){return{'model':db[_0x2c1fd0[_0x8048('0x1d')]],'as':_0x2c1fd0['as'],'attributes':_0x2c1fd0['attributes'],'include':_0x2c1fd0['include']?_[_0x8048('0x1c')](_0x2c1fd0['include'],function(_0x102a3b){return{'model':db[_0x102a3b['model']],'as':_0x102a3b['as'],'attributes':_0x102a3b[_0x8048('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8048('0xb')](function(_0x1ac1b3){logger[_0x8048('0xc')](_0x8048('0x20'),_0x4b482f);logger[_0x8048('0xf')](_0x8048('0x20'),_0x4b482f,JSON['stringify'](_0x1ac1b3));_0xd36d0c(_0x1ac1b3);})['catch'](function(_0x1938cb){logger[_0x8048('0x12')](_0x8048('0x20'),_0x1938cb[_0x8048('0x14')],_0x4b482f);_0x5db2a3(_0x56ac2b[_0x8048('0x12')](0x1f4,_0x1938cb[_0x8048('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9498ee6..7190d6f 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 _0xe806=['/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','create','addQueues','diskStorage','server/files/images/','%s-%s','now','originalname','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','/:id/chat_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites'];(function(_0x3effd4,_0x367601){var _0x5da087=function(_0x373b63){while(--_0x373b63){_0x3effd4['push'](_0x3effd4['shift']());}};_0x5da087(++_0x367601);}(_0xe806,0x1bd));var _0x6e80=function(_0x56d9e2,_0x1ef5f2){_0x56d9e2=_0x56d9e2-0x0;var _0x7ae3e8=_0xe806[_0x56d9e2];return _0x7ae3e8;};'use strict';var multer=require(_0x6e80('0x0'));var util=require(_0x6e80('0x1'));var path=require(_0x6e80('0x2'));var timeout=require(_0x6e80('0x3'));var express=require(_0x6e80('0x4'));var router=express[_0x6e80('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e80('0x6'));var config=require(_0x6e80('0x7'));var controller=require(_0x6e80('0x8'));router[_0x6e80('0x9')]('/',auth[_0x6e80('0xa')](),controller[_0x6e80('0xb')]);router[_0x6e80('0x9')]('/describe',auth[_0x6e80('0xa')](),controller[_0x6e80('0xc')]);router[_0x6e80('0x9')](_0x6e80('0xd'),auth['isAuthenticated'](),controller[_0x6e80('0xe')]);router[_0x6e80('0x9')]('/:id/avatar',controller[_0x6e80('0xf')]);router[_0x6e80('0x9')](_0x6e80('0x10'),auth['isAuthenticated'](),controller[_0x6e80('0x11')]);router[_0x6e80('0x9')](_0x6e80('0x12'),auth['isAuthenticated'](),controller[_0x6e80('0x13')]);router[_0x6e80('0x9')](_0x6e80('0x14'),auth['isAuthenticated'](),controller[_0x6e80('0x15')]);router[_0x6e80('0x9')](_0x6e80('0x16'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x17')]);router[_0x6e80('0x9')]('/:id/recordings',auth[_0x6e80('0xa')](),controller[_0x6e80('0x18')]);router[_0x6e80('0x9')](_0x6e80('0x19'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x1a')]);router[_0x6e80('0x9')](_0x6e80('0x1b'),auth[_0x6e80('0xa')](),controller['getChatInteractions']);router[_0x6e80('0x9')]('/:id/openchannel/interactions',auth[_0x6e80('0xa')](),controller['getOpenchannelInteractions']);router[_0x6e80('0x9')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x6e80('0x1c')]);router['get'](_0x6e80('0x1d'),auth[_0x6e80('0xa')](),controller['getSmsInteractions']);router[_0x6e80('0x9')](_0x6e80('0x1e'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x1f')]);router['get']('/:id/teams',auth[_0x6e80('0xa')](),controller[_0x6e80('0x20')]);router[_0x6e80('0x9')](_0x6e80('0x21'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x22')]);router[_0x6e80('0x9')](_0x6e80('0x23'),auth['isAuthenticated'](),controller[_0x6e80('0x24')]);router[_0x6e80('0x9')](_0x6e80('0x25'),auth['isAuthenticated'](),controller[_0x6e80('0x26')]);router[_0x6e80('0x9')](_0x6e80('0x27'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x6e80('0x9')](_0x6e80('0x28'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x29')]);router[_0x6e80('0x9')](_0x6e80('0x2a'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x2b')]);router['get']('/:id/sms_accounts',auth[_0x6e80('0xa')](),controller['getSmsAccounts']);router[_0x6e80('0x9')](_0x6e80('0x2c'),auth[_0x6e80('0xa')](),controller['getChatWebsites']);router['get'](_0x6e80('0x2d'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x2e')]);router[_0x6e80('0x9')](_0x6e80('0x2f'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x30')]);router[_0x6e80('0x9')](_0x6e80('0x31'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x32')]);router[_0x6e80('0x33')](_0x6e80('0x34'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x35')]);router['post'](_0x6e80('0x10'),auth[_0x6e80('0xa')](),controller['addContacts']);router['post']('/',auth[_0x6e80('0xa')](),controller[_0x6e80('0x36')]);router['post'](_0x6e80('0x12'),auth['isAuthenticated'](),controller[_0x6e80('0x37')]);var upload=multer({'storage':multer[_0x6e80('0x38')]({'destination':function(_0x5603a4,_0x364658,_0x254792){_0x254792(null,path['join'](config['root'],_0x6e80('0x39')));},'filename':function(_0xbbb517,_0x36a99b,_0x524361){_0x524361(null,util['format'](_0x6e80('0x3a'),Date[_0x6e80('0x3b')](),_0x36a99b[_0x6e80('0x3c')]));}})});router[_0x6e80('0x33')]('/:id/avatar',upload['single']('file'),controller[_0x6e80('0x3d')]);router[_0x6e80('0x33')](_0x6e80('0x3e'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x3f')]);router['post']('/:id/logout',auth[_0x6e80('0xa')](),controller[_0x6e80('0x40')]);router['post'](_0x6e80('0x41'),auth['isAuthenticated'](),controller[_0x6e80('0x42')]);router[_0x6e80('0x33')](_0x6e80('0x43'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x44')]);router[_0x6e80('0x33')](_0x6e80('0x45'),auth[_0x6e80('0xa')](),controller['addTeams']);router['post'](_0x6e80('0x46'),auth[_0x6e80('0xa')](),controller['addChatInteractions']);router[_0x6e80('0x33')]('/:id/mail_interactions',auth[_0x6e80('0xa')](),controller['addMailInteractions']);router[_0x6e80('0x33')](_0x6e80('0x47'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x48')]);router[_0x6e80('0x33')](_0x6e80('0x49'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x4a')]);router[_0x6e80('0x33')]('/:id/openchannel_interactions',auth[_0x6e80('0xa')](),controller[_0x6e80('0x4b')]);router[_0x6e80('0x33')](_0x6e80('0x27'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x4c')]);router[_0x6e80('0x33')](_0x6e80('0x28'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x4d')]);router[_0x6e80('0x33')](_0x6e80('0x2a'),auth[_0x6e80('0xa')](),controller['addOpenchannelAccounts']);router[_0x6e80('0x33')](_0x6e80('0x4e'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x4f')]);router['post'](_0x6e80('0x2c'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x50')]);router[_0x6e80('0x33')](_0x6e80('0x2d'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x51')]);router[_0x6e80('0x33')](_0x6e80('0x31'),auth['isAuthenticated'](),controller[_0x6e80('0x52')]);router[_0x6e80('0x53')](_0x6e80('0xd'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x54')]);router[_0x6e80('0x53')]('/:id/password',auth[_0x6e80('0xa')](),controller[_0x6e80('0x55')]);router[_0x6e80('0x56')](_0x6e80('0x12'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x57')]);router[_0x6e80('0x56')](_0x6e80('0x45'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x58')]);router[_0x6e80('0x56')](_0x6e80('0xd'),auth['isAuthenticated'](),controller[_0x6e80('0x59')]);router[_0x6e80('0x56')](_0x6e80('0x46'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x5a')]);router[_0x6e80('0x56')]('/:id/mail_interactions',auth[_0x6e80('0xa')](),controller['removeMailInteractions']);router['delete']('/:id/fax_interactions',auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x6e80('0x56')](_0x6e80('0x49'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0x6e80('0x56')](_0x6e80('0x5b'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x5c')]);router[_0x6e80('0x56')](_0x6e80('0x27'),auth[_0x6e80('0xa')](),controller[_0x6e80('0x5d')]);router[_0x6e80('0x56')]('/:id/mail_accounts',auth[_0x6e80('0xa')](),controller[_0x6e80('0x5e')]);router['delete'](_0x6e80('0x2a'),auth[_0x6e80('0xa')](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth[_0x6e80('0xa')](),controller[_0x6e80('0x5f')]);router['delete'](_0x6e80('0x2c'),auth['isAuthenticated'](),controller[_0x6e80('0x60')]);router[_0x6e80('0x56')](_0x6e80('0x2d'),auth['isAuthenticated'](),controller[_0x6e80('0x61')]);router[_0x6e80('0x56')]('/:id/api_key',auth['isAuthenticated'](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file +var _0xceab=['unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','root','%s-%s','now','originalname','/:id/avatar','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause'];(function(_0x27c326,_0x254b35){var _0x1a87a6=function(_0x4c63bf){while(--_0x4c63bf){_0x27c326['push'](_0x27c326['shift']());}};_0x1a87a6(++_0x254b35);}(_0xceab,0x106));var _0xbcea=function(_0x5d871a,_0x32449b){_0x5d871a=_0x5d871a-0x0;var _0x257bdc=_0xceab[_0x5d871a];return _0x257bdc;};'use strict';var multer=require(_0xbcea('0x0'));var util=require('util');var path=require(_0xbcea('0x1'));var timeout=require(_0xbcea('0x2'));var express=require('express');var router=express[_0xbcea('0x3')]();var auth=require(_0xbcea('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbcea('0x5'));var controller=require(_0xbcea('0x6'));router['get']('/',auth[_0xbcea('0x7')](),controller[_0xbcea('0x8')]);router[_0xbcea('0x9')](_0xbcea('0xa'),auth[_0xbcea('0x7')](),controller['describe']);router[_0xbcea('0x9')](_0xbcea('0xb'),auth[_0xbcea('0x7')](),controller[_0xbcea('0xc')]);router[_0xbcea('0x9')]('/:id/avatar',controller[_0xbcea('0xd')]);router['get'](_0xbcea('0xe'),auth[_0xbcea('0x7')](),controller[_0xbcea('0xf')]);router[_0xbcea('0x9')](_0xbcea('0x10'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x11')]);router['get'](_0xbcea('0x12'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x13')]);router['get'](_0xbcea('0x14'),auth['isAuthenticated'](),controller['getGroups']);router[_0xbcea('0x9')](_0xbcea('0x15'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x16')]);router[_0xbcea('0x9')](_0xbcea('0x17'),auth['isAuthenticated'](),controller[_0xbcea('0x18')]);router['get']('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0xbcea('0x19')]);router[_0xbcea('0x9')]('/:id/openchannel/interactions',auth[_0xbcea('0x7')](),controller[_0xbcea('0x1a')]);router[_0xbcea('0x9')](_0xbcea('0x1b'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x1c')]);router[_0xbcea('0x9')](_0xbcea('0x1d'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x1e')]);router[_0xbcea('0x9')](_0xbcea('0x1f'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x20')]);router['get'](_0xbcea('0x21'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x22')]);router[_0xbcea('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbcea('0x23')]);router[_0xbcea('0x9')](_0xbcea('0x24'),auth['isAuthenticated'](),controller[_0xbcea('0x25')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller[_0xbcea('0x26')]);router[_0xbcea('0x9')](_0xbcea('0x27'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x28')]);router[_0xbcea('0x9')](_0xbcea('0x29'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x2a')]);router['get'](_0xbcea('0x2b'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x2c')]);router['get']('/:id/sms_accounts',auth[_0xbcea('0x7')](),controller[_0xbcea('0x2d')]);router[_0xbcea('0x9')]('/:id/chat_websites',auth[_0xbcea('0x7')](),controller[_0xbcea('0x2e')]);router[_0xbcea('0x9')](_0xbcea('0x2f'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x30')]);router[_0xbcea('0x9')](_0xbcea('0x31'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x32')]);router['get']('/:id/api_key',auth[_0xbcea('0x7')](),controller[_0xbcea('0x33')]);router[_0xbcea('0x34')](_0xbcea('0x35'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x36')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xbcea('0x37')]);router[_0xbcea('0x34')]('/',auth[_0xbcea('0x7')](),controller[_0xbcea('0x38')]);router[_0xbcea('0x34')](_0xbcea('0x10'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5657cd,_0x5f123a,_0x15d645){_0x15d645(null,path['join'](config[_0xbcea('0x3a')],'server/files/images/'));},'filename':function(_0x58426c,_0xe26f1e,_0x2e47af){_0x2e47af(null,util['format'](_0xbcea('0x3b'),Date[_0xbcea('0x3c')](),_0xe26f1e[_0xbcea('0x3d')]));}})});router['post'](_0xbcea('0x3e'),upload['single'](_0xbcea('0x3f')),controller[_0xbcea('0x40')]);router[_0xbcea('0x34')](_0xbcea('0x41'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x42')]);router[_0xbcea('0x34')]('/:id/logout',auth['isAuthenticated'](),controller[_0xbcea('0x43')]);router['post'](_0xbcea('0x44'),auth['isAuthenticated'](),controller[_0xbcea('0x45')]);router[_0xbcea('0x34')](_0xbcea('0x46'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x47')]);router[_0xbcea('0x34')]('/:id/teams',auth[_0xbcea('0x7')](),controller[_0xbcea('0x48')]);router[_0xbcea('0x34')](_0xbcea('0x49'),auth['isAuthenticated'](),controller[_0xbcea('0x4a')]);router['post'](_0xbcea('0x4b'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x4c')]);router['post'](_0xbcea('0x4d'),auth['isAuthenticated'](),controller[_0xbcea('0x4e')]);router[_0xbcea('0x34')](_0xbcea('0x4f'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x50')]);router['post']('/:id/openchannel_interactions',auth[_0xbcea('0x7')](),controller['addOpenchannelInteractions']);router[_0xbcea('0x34')](_0xbcea('0x27'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x51')]);router[_0xbcea('0x34')](_0xbcea('0x29'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x52')]);router[_0xbcea('0x34')](_0xbcea('0x2b'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x53')]);router[_0xbcea('0x34')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xbcea('0x54')]);router[_0xbcea('0x34')](_0xbcea('0x55'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x56')]);router[_0xbcea('0x34')](_0xbcea('0x2f'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x57')]);router[_0xbcea('0x34')](_0xbcea('0x58'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x59')]);router[_0xbcea('0x5a')](_0xbcea('0xb'),auth['isAuthenticated'](),controller[_0xbcea('0x5b')]);router[_0xbcea('0x5a')]('/:id/password',auth['isAuthenticated'](),controller[_0xbcea('0x5c')]);router[_0xbcea('0x5d')]('/:id/queues',auth[_0xbcea('0x7')](),controller[_0xbcea('0x5e')]);router['delete'](_0xbcea('0x21'),auth['isAuthenticated'](),controller[_0xbcea('0x5f')]);router[_0xbcea('0x5d')](_0xbcea('0xb'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x60')]);router['delete']('/:id/chat_interactions',auth[_0xbcea('0x7')](),controller[_0xbcea('0x61')]);router['delete'](_0xbcea('0x4b'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x62')]);router[_0xbcea('0x5d')](_0xbcea('0x4d'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x63')]);router['delete']('/:id/sms_interactions',auth[_0xbcea('0x7')](),controller[_0xbcea('0x64')]);router['delete'](_0xbcea('0x65'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x66')]);router[_0xbcea('0x5d')](_0xbcea('0x27'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x67')]);router['delete'](_0xbcea('0x29'),auth['isAuthenticated'](),controller[_0xbcea('0x68')]);router[_0xbcea('0x5d')]('/:id/openchannel_accounts',auth[_0xbcea('0x7')](),controller[_0xbcea('0x69')]);router[_0xbcea('0x5d')](_0xbcea('0x6a'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x6b')]);router['delete'](_0xbcea('0x55'),auth[_0xbcea('0x7')](),controller['removeChatWebsites']);router[_0xbcea('0x5d')](_0xbcea('0x2f'),auth['isAuthenticated'](),controller[_0xbcea('0x6c')]);router['delete'](_0xbcea('0x58'),auth[_0xbcea('0x7')](),controller[_0xbcea('0x6d')]);module[_0xbcea('0x6e')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 0883851..0cbd696 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 _0x9219=['format','email','toLowerCase','ENUM','admin','agent','local','internal','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','friend','user','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','\x22\x22\x20<>','refuse','originate','uac','uas','fingerprint','certificate','actpass','nonat','update,nonat','showWebBar','get','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','encryption','icesupport','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','exports','setDataValue','defaultuser','STRING','fullname','callerid'];(function(_0x1d3b3a,_0x3b263e){var _0xe17009=function(_0x1954d3){while(--_0x1954d3){_0x1d3b3a['push'](_0x1d3b3a['shift']());}};_0xe17009(++_0x3b263e);}(_0x9219,0x19e));var _0x9921=function(_0x3b0652,_0x44c314){_0x3b0652=_0x3b0652-0x0;var _0x3b01f9=_0x9219[_0x3b0652];return _0x3b01f9;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require('util');var _=require('lodash');module[_0x9921('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x30647c){this['setDataValue']('name',_0x30647c);this[_0x9921('0x1')](_0x9921('0x2'),_0x30647c);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x9921('0x3')],'allowNull':![],'set':function(_0x26d1db){this[_0x9921('0x1')](_0x9921('0x4'),_0x26d1db);this[_0x9921('0x1')](_0x9921('0x5'),util[_0x9921('0x6')]('\x22%s\x22\x20<%s>',_0x26d1db,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0x9921('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9921('0x7'),'validate':{'isEmail':!![]},'set':function(_0x591e9a){if(_0x591e9a){this['setDataValue'](_0x9921('0x7'),_0x591e9a[_0x9921('0x8')]());}}},'role':{'type':Sequelize[_0x9921('0x9')](_0x9921('0xa'),'user',_0x9921('0xb'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9921('0x3')],'defaultValue':_0x9921('0xc')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9921('0xd'),'set':function(_0x3840eb){this['setDataValue'](_0x9921('0xd'),_0x3840eb);this[_0x9921('0x1')](_0x9921('0xe'),_0x3840eb);this['setDataValue'](_0x9921('0x5'),util[_0x9921('0x6')](_0x9921('0xf'),this['getDataValue'](_0x9921('0x4')),_0x3840eb));}},'salt':{'type':Sequelize[_0x9921('0x3')]},'phone':{'type':Sequelize[_0x9921('0x3')]},'mobile':{'type':Sequelize[_0x9921('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x9921('0x3')]},'userpic':{'type':Sequelize[_0x9921('0x3')]},'city':{'type':Sequelize[_0x9921('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9921('0x11')]},'voicePause':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9921('0x3')],'defaultValue':_0x9921('0x12')},'lastPauseAt':{'type':Sequelize[_0x9921('0x11')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9921('0x10')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9921('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9921('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x9921('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x14'),_0x9921('0x15'),'peer'),'allowNull':!![],'defaultValue':_0x9921('0x14')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9921('0x16')},'callingpres':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x17'),'ALLOWED_PASSED_SCREEN',_0x9921('0x18'),_0x9921('0x19'),'PROHIB_NOT_SCREENED',_0x9921('0x1a'),_0x9921('0x1b'),_0x9921('0x1c')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9921('0x1d'),'set':function(_0x2da5a8){this['setDataValue'](_0x9921('0x1e'),_0x2da5a8?_0x2da5a8[_0x9921('0x1f')](','):null);},'get':function(){return this[_0x9921('0x20')](_0x9921('0x1e'))?this[_0x9921('0x20')](_0x9921('0x1e'))[_0x9921('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x22'),_0x9921('0x23'),_0x9921('0x24'),_0x9921('0x25'),_0x9921('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9921('0x9')]('yes','no','nonat',_0x9921('0x27'),_0x9921('0x28')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9921('0x9')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x50bfa7){this[_0x9921('0x1')](_0x9921('0x29'),_0x50bfa7?_0x50bfa7[_0x9921('0x1f')](','):null);},'get':function(){return this[_0x9921('0x20')](_0x9921('0x29'))?this[_0x9921('0x20')](_0x9921('0x29'))[_0x9921('0x21')](','):null;},'comment':_0x9921('0x2a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9921('0x3')]},'pickupgroup':{'type':Sequelize[_0x9921('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x9921('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9921('0x3')]},'disallow':{'type':Sequelize[_0x9921('0x3')],'allowNull':![],'defaultValue':_0x9921('0x2b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9921('0x2c'),'set':function(_0x45d3c6){this[_0x9921('0x1')]('allow',_0x45d3c6?_0x45d3c6[_0x9921('0x1f')](';'):_0x9921('0x2c'));},'get':function(){return this[_0x9921('0x20')]('allow')?this[_0x9921('0x20')](_0x9921('0x2d'))['split'](';'):null;},'comment':_0x9921('0x2e')},'autoframing':{'type':Sequelize[_0x9921('0x9')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![],'set':function(_0x15a8af){this[_0x9921('0x1')](_0x9921('0x2f'),_0x15a8af?_0x15a8af[_0x9921('0x1f')](','):null);},'get':function(){return this[_0x9921('0x20')](_0x9921('0x2f'))?this[_0x9921('0x20')]('insecure')['split'](','):null;},'comment':_0x9921('0x30')},'trustrpid':{'type':Sequelize['ENUM'](_0x9921('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![],'defaultValue':_0x9921('0x32')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![],'defaultValue':_0x9921('0x31')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9921('0x9')]('accept',_0x9921('0x33'),_0x9921('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x9921('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9921('0x31'),'no'),'allowNull':!![],'defaultValue':_0x9921('0x31')},'keepalive':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9921('0x31'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no',_0x9921('0x37'),_0x9921('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9921('0x9')]('active','passive',_0x9921('0x39')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x9921('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9921('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9921('0x31'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no',_0x9921('0x3a'),_0x9921('0x27'),_0x9921('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x9921('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x9921('0x11')]},'showWebBar':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x0,'set':function(_0x2082a7){this['setDataValue'](_0x9921('0x3c'),_0x2082a7);var _0x4186cd=this[_0x9921('0x3d')]({'plain':!![]});switch(_0x2082a7){case 0x0:case 0x1:var _0x4a7d8f=_0x4186cd[_0x9921('0x1e')]?_['isArray'](_0x4186cd[_0x9921('0x1e')])?_0x4186cd[_0x9921('0x1e')][_0x9921('0x1f')]():_0x4186cd['transport']:_0x9921('0x1d');if(_0x4a7d8f===_0x9921('0x3e')){_0x4a7d8f='udp';}this[_0x9921('0x1')](_0x9921('0x1e'),_0x4a7d8f);this['setDataValue']('encryption','no');this[_0x9921('0x1')](_0x9921('0x3f'),null);this[_0x9921('0x1')](_0x9921('0x40'),null);this[_0x9921('0x1')]('icesupport',null);this[_0x9921('0x1')](_0x9921('0x41'),null);this[_0x9921('0x1')](_0x9921('0x42'),null);this[_0x9921('0x1')](_0x9921('0x43'),null);this[_0x9921('0x1')]('dtlscertfile',null);this[_0x9921('0x1')](_0x9921('0x44'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x9921('0x1e'),'wss');this[_0x9921('0x1')](_0x9921('0x45'),_0x9921('0x31'));this[_0x9921('0x1')](_0x9921('0x3f'),_0x9921('0x31'));this[_0x9921('0x1')](_0x9921('0x40'),'yes');this['setDataValue'](_0x9921('0x46'),_0x9921('0x31'));this[_0x9921('0x1')](_0x9921('0x41'),_0x9921('0x31'));this['setDataValue'](_0x9921('0x42'),'no');this['setDataValue']('dtlssetup',_0x9921('0x39'));this['setDataValue'](_0x9921('0x47'),_0x4186cd[_0x9921('0x47')]||'/etc/pki/tls/certs/motion.crt');this[_0x9921('0x1')](_0x9921('0x44'),_0x4186cd['dtlsprivatekey']||_0x9921('0x48'));this['setDataValue'](_0x9921('0x49'),_0x9921('0x31'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x58b592){this['setDataValue'](_0x9921('0x4a'),_0x58b592?_0x58b592[_0x9921('0x1f')](','):[]);},'get':function(){return this['getDataValue'](_0x9921('0x4a'))?_[_0x9921('0x4b')](this[_0x9921('0x20')](_0x9921('0x4a'))[_0x9921('0x21')](','),function(_0x5186f6){return parseInt(_0x5186f6,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9921('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9921('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9921('0x10')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9921('0x10')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9921('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9921('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9921('0x9')](_0x9921('0x31'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9921('0x10')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9921('0x3')]},'passwordResetAt':{'type':Sequelize[_0x9921('0x11')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9921('0x4c')],'get':function(){return this['getDataValue'](_0x9921('0x4d'))?this['getDataValue'](_0x9921('0x4d')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9921('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9921('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x45ef90){if(typeof _0x45ef90===_0x9921('0x4e')){var _0x4ebd12=_0x45ef90==='1'?!![]:_0x45ef90==='0'?![]:_0x45ef90==='true'?!![]:_0x45ef90===_0x9921('0x4f')?![]:![];this[_0x9921('0x1')](_0x9921('0x50'),_0x4ebd12);}else{this[_0x9921('0x1')]('screenrecording',_0x45ef90);}}},'blocked':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![],'set':function(_0x1f37ef){this[_0x9921('0x1')](_0x9921('0x51'),_0x1f37ef);if(_0x1f37ef===!![]){this[_0x9921('0x1')](_0x9921('0x52'),moment());this[_0x9921('0x1')](_0x9921('0x53'),0x0);}else{this[_0x9921('0x1')](_0x9921('0x52'),null);}}},'blockedAt':{'type':Sequelize[_0x9921('0x11')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9921('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x015f=['user','agent','telephone','INTEGER','accountcode','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','rfc2833','info','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','isArray','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','encryption','icesupport','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','moment','lodash','exports','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','admin'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x015f,0x14d));var _0xf015=function(_0x1c46c5,_0x41bc70){_0x1c46c5=_0x1c46c5-0x0;var _0x4e403c=_0x015f[_0x1c46c5];return _0x4e403c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf015('0x0'));var util=require('util');var _=require(_0xf015('0x1'));module[_0xf015('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xf94a55){this[_0xf015('0x3')](_0xf015('0x4'),_0xf94a55);this[_0xf015('0x3')](_0xf015('0x5'),_0xf94a55);},'comment':_0xf015('0x6')},'fullname':{'type':Sequelize[_0xf015('0x7')],'allowNull':![],'set':function(_0x3ae89a){this[_0xf015('0x3')](_0xf015('0x8'),_0x3ae89a);this[_0xf015('0x3')](_0xf015('0x9'),util[_0xf015('0xa')](_0xf015('0xb'),_0x3ae89a,this['getDataValue'](_0xf015('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf015('0x7')],'allowNull':![],'unique':_0xf015('0xd'),'validate':{'isEmail':!![]},'set':function(_0x8bd5b9){if(_0x8bd5b9){this[_0xf015('0x3')]('email',_0x8bd5b9['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0xf015('0xe'),_0xf015('0xf'),_0xf015('0x10'),_0xf015('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0xf015('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf015('0x7')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4d983f){this[_0xf015('0x3')](_0xf015('0xc'),_0x4d983f);this['setDataValue'](_0xf015('0x13'),_0x4d983f);this[_0xf015('0x3')](_0xf015('0x9'),util[_0xf015('0xa')](_0xf015('0xb'),this[_0xf015('0x14')]('fullname'),_0x4d983f));}},'salt':{'type':Sequelize[_0xf015('0x7')]},'phone':{'type':Sequelize[_0xf015('0x7')]},'mobile':{'type':Sequelize[_0xf015('0x7')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xf015('0x7')]},'city':{'type':Sequelize[_0xf015('0x7')]},'country':{'type':Sequelize[_0xf015('0x7')]},'online':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf015('0x16')]},'voicePause':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf015('0x7')],'defaultValue':_0xf015('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xf015('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf015('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf015('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf015('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf015('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf015('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf015('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'host':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![],'defaultValue':_0xf015('0x18')},'ipaddr':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0xf015('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x1a'),_0xf015('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xf015('0x1a')},'context':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![],'defaultValue':_0xf015('0x1b')},'callingpres':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x1c'),_0xf015('0x1d'),_0xf015('0x1e'),_0xf015('0x1f'),_0xf015('0x20'),'PROHIB_PASSED_SCREEN',_0xf015('0x21'),_0xf015('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![],'defaultValue':_0xf015('0x23'),'set':function(_0x220e7e){this[_0xf015('0x3')](_0xf015('0x24'),_0x220e7e?_0x220e7e[_0xf015('0x25')](','):null);},'get':function(){return this[_0xf015('0x14')](_0xf015('0x24'))?this['getDataValue'](_0xf015('0x24'))[_0xf015('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xf015('0x27'),_0xf015('0x28'),'shortinfo','inband',_0xf015('0x29')),'allowNull':!![],'defaultValue':_0xf015('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0xf015('0x2a'),'no','nonat',_0xf015('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x3b3d00){this['setDataValue'](_0xf015('0x2c'),_0x3b3d00?_0x3b3d00[_0xf015('0x25')](','):null);},'get':function(){return this[_0xf015('0x14')](_0xf015('0x2c'))?this[_0xf015('0x14')](_0xf015('0x2c'))[_0xf015('0x26')](','):null;},'comment':_0xf015('0x2d')},'callgroup':{'type':Sequelize[_0xf015('0x7')]},'namedcallgroup':{'type':Sequelize[_0xf015('0x7')]},'pickupgroup':{'type':Sequelize[_0xf015('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xf015('0x7')]},'language':{'type':Sequelize[_0xf015('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xf015('0x7')],'allowNull':![],'defaultValue':_0xf015('0x2e')},'allow':{'type':Sequelize[_0xf015('0x7')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1b4340){this[_0xf015('0x3')](_0xf015('0x2f'),_0x1b4340?_0x1b4340[_0xf015('0x25')](';'):_0xf015('0x30'));},'get':function(){return this['getDataValue'](_0xf015('0x2f'))?this[_0xf015('0x14')](_0xf015('0x2f'))[_0xf015('0x26')](';'):null;},'comment':_0xf015('0x31')},'autoframing':{'type':Sequelize[_0xf015('0x19')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![],'set':function(_0x45ab1d){this[_0xf015('0x3')](_0xf015('0x32'),_0x45ab1d?_0x45ab1d[_0xf015('0x25')](','):null);},'get':function(){return this['getDataValue'](_0xf015('0x32'))?this[_0xf015('0x14')](_0xf015('0x32'))[_0xf015('0x26')](','):null;},'comment':_0xf015('0x33')},'trustrpid':{'type':Sequelize[_0xf015('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xf015('0x2a'),'no',_0xf015('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![],'defaultValue':_0xf015('0x35')},'amaflags':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf015('0x2a')},'busylevel':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xf015('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf015('0x19')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x36'),_0xf015('0x37'),_0xf015('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf015('0x19')]('uac',_0xf015('0x39')),'allowNull':!![],'defaultValue':_0xf015('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xf015('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf015('0x2a')},'keepalive':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xf015('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf015('0x19')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xf015('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no',_0xf015('0x3a'),_0xf015('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf015('0x3c'),_0xf015('0x3d'),_0xf015('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf015('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no','nonat',_0xf015('0x2b'),_0xf015('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf015('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0xf015('0x16')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x43c79a){this['setDataValue']('showWebBar',_0x43c79a);var _0x6f2f63=this['get']({'plain':!![]});switch(_0x43c79a){case 0x0:case 0x1:var _0x509872=_0x6f2f63['transport']?_[_0xf015('0x40')](_0x6f2f63['transport'])?_0x6f2f63[_0xf015('0x24')][_0xf015('0x25')]():_0x6f2f63[_0xf015('0x24')]:_0xf015('0x23');if(_0x509872===_0xf015('0x41')){_0x509872=_0xf015('0x23');}this[_0xf015('0x3')](_0xf015('0x24'),_0x509872);this[_0xf015('0x3')]('encryption','no');this[_0xf015('0x3')](_0xf015('0x42'),null);this[_0xf015('0x3')](_0xf015('0x43'),null);this[_0xf015('0x3')]('icesupport',null);this['setDataValue'](_0xf015('0x44'),null);this[_0xf015('0x3')](_0xf015('0x45'),null);this[_0xf015('0x3')](_0xf015('0x46'),null);this[_0xf015('0x3')]('dtlscertfile',null);this[_0xf015('0x3')](_0xf015('0x47'),null);this[_0xf015('0x3')]('rtcp_mux','no');break;case 0x2:this[_0xf015('0x3')]('transport',_0xf015('0x41'));this[_0xf015('0x3')](_0xf015('0x48'),_0xf015('0x2a'));this[_0xf015('0x3')]('avpf','yes');this[_0xf015('0x3')](_0xf015('0x43'),'yes');this[_0xf015('0x3')](_0xf015('0x49'),_0xf015('0x2a'));this[_0xf015('0x3')]('dtlsenable','yes');this[_0xf015('0x3')]('dtlsverify','no');this[_0xf015('0x3')]('dtlssetup',_0xf015('0x3e'));this['setDataValue']('dtlscertfile',_0x6f2f63[_0xf015('0x4a')]||_0xf015('0x4b'));this['setDataValue'](_0xf015('0x47'),_0x6f2f63['dtlsprivatekey']||_0xf015('0x4c'));this[_0xf015('0x3')](_0xf015('0x4d'),_0xf015('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xf015('0x4e')],'set':function(_0xe96ccb){this['setDataValue'](_0xf015('0x4f'),_0xe96ccb?_0xe96ccb['join'](','):[]);},'get':function(){return this[_0xf015('0x14')](_0xf015('0x4f'))?_['map'](this[_0xf015('0x14')](_0xf015('0x4f'))[_0xf015('0x26')](','),function(_0x2a1797){return parseInt(_0x2a1797,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf015('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf015('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf015('0x7')]},'phoneBarUnconditional':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf015('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf015('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf015('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf015('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf015('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf015('0x19')](_0xf015('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf015('0x7')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf015('0x14')](_0xf015('0x50'))?this[_0xf015('0x14')](_0xf015('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xf015('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf015('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x2c1146){if(typeof _0x2c1146===_0xf015('0x51')){var _0xd69688=_0x2c1146==='1'?!![]:_0x2c1146==='0'?![]:_0x2c1146===_0xf015('0x52')?!![]:_0x2c1146==='false'?![]:![];this[_0xf015('0x3')]('screenrecording',_0xd69688);}else{this[_0xf015('0x3')](_0xf015('0x53'),_0x2c1146);}}},'blocked':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![],'set':function(_0x25bd7a){this[_0xf015('0x3')](_0xf015('0x54'),_0x25bd7a);if(_0x25bd7a===!![]){this['setDataValue'](_0xf015('0x55'),moment());this[_0xf015('0x3')](_0xf015('0x56'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xf015('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xf015('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf015('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 78902b3..a8bd888 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 _0x4ccc=['addTeams','removeTeams','getLists','getAgents','addChatInteractions','user_has_chat_interactions:save','isArray','user_has_chat_interactions:remove','addMailInteractions','spread','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gt','$lt','$between','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','firstName','Contact','getApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','apiKeyNonce','apiKeyIat','removeApiKey','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','request','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Users','user','Agents','agent','Telephones','telephone','filter','map','value','role','find','name','UserProfileResource','stack','send','index','User','model','differenceBy','keys','password','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','key','VIRTUAL','sequelize','lower','col','field','merge','options','includeAll','include','findAll','rows','show','salt','length','bulkCreate','body','params','describe','addContacts','ids','omit','agent\x20role','admin','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','mailbox','email','permissions','110','105','108','109','100','111','VoiceMail','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','penalty','QueueId','Queue:save','voice','VoiceQueue','push','SIP/%s','each','UserVoiceQueueRt','removeQueues','remove','Queues','emit','Queue:remove','addAvatar','filename','join','root','server/files/images/logos/default_profile.png','userpic','download','server/files/images/','getContacts','CmContact','rawAttributes','CmList','List','Tags','color','tag','getQueues','isValidChannel','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','concat','YYYY-MM-DD\x20HH:mm:ss','isMiddleware','resolve','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','manual','mail','chat','fax','sms','%s%s','Pause','getTeams'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0x4ccc,0x193));var _0xc4cc=function(_0xc297bc,_0x2aed50){_0xc297bc=_0xc297bc-0x0;var _0xed03d3=_0x4ccc[_0xc297bc];return _0xed03d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc4cc('0x0'));var rimraf=require(_0xc4cc('0x1'));var zipdir=require(_0xc4cc('0x2'));var jsonpatch=require(_0xc4cc('0x3'));var rp=require(_0xc4cc('0x4'));var moment=require(_0xc4cc('0x5'));var BPromise=require(_0xc4cc('0x6'));var Mustache=require('mustache');var util=require(_0xc4cc('0x7'));var path=require(_0xc4cc('0x8'));var sox=require(_0xc4cc('0x9'));var csv=require(_0xc4cc('0xa'));var ejs=require(_0xc4cc('0xb'));var fs=require('fs');var _=require(_0xc4cc('0xc'));var squel=require(_0xc4cc('0xd'));var crypto=require(_0xc4cc('0xe'));var jsforce=require(_0xc4cc('0xf'));var deskjs=require(_0xc4cc('0x10'));var toCsv=require(_0xc4cc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc4cc('0x11'));var qs=require(_0xc4cc('0x12'));var hardwareService=require(_0xc4cc('0x13'));var logger=require(_0xc4cc('0x14'))(_0xc4cc('0x15'));var utils=require(_0xc4cc('0x16'));var config=require(_0xc4cc('0x17'));var db=require('../../mysqldb')['db'];config[_0xc4cc('0x18')]=_['defaults'](config[_0xc4cc('0x18')],{'host':_0xc4cc('0x19'),'port':0x18eb});var socket=require(_0xc4cc('0x1a'))(new Redis(config[_0xc4cc('0x18')]));require('./user.socket')[_0xc4cc('0x1b')](socket);var jayson=require(_0xc4cc('0x1c'));var client=jayson[_0xc4cc('0x1d')][_0xc4cc('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x5d14f4,_0x2336d4,_0xefc2c){if(_0xefc2c){var _0xdab77f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xdab77f[_0xc4cc('0x1f')](_0x2336d4)){return _0x5d14f4;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d14f4;}}function respondWithRpcPromise(_0x2013b5,_0x2460b9,_0x28b559,_0x22f445){return new BPromise(function(_0x594cfb,_0x2c7d0d){var _0x1a048b=_0x22f445||client;return _0x1a048b[_0xc4cc('0x20')](_0x2013b5,_0x28b559)['then'](function(_0x381b59){logger['info'](_0xc4cc('0x21'),_0x2460b9,_0xc4cc('0x22'));logger['debug'](_0xc4cc('0x23'),_0x2460b9,_0xc4cc('0x22'),JSON[_0xc4cc('0x24')](_0x381b59));if(_0x381b59[_0xc4cc('0x25')]){if(_0x381b59['error'][_0xc4cc('0x26')]===0x1f4){logger[_0xc4cc('0x25')]('User,\x20%s,\x20%s',_0x2460b9,_0x381b59[_0xc4cc('0x25')][_0xc4cc('0x27')]);return _0x2c7d0d(_0x381b59[_0xc4cc('0x25')]['message']);}logger[_0xc4cc('0x25')]('User,\x20%s,\x20%s',_0x2460b9,_0x381b59[_0xc4cc('0x25')][_0xc4cc('0x27')]);return _0x594cfb(_0x381b59['error']['message']);}else{logger[_0xc4cc('0x28')](_0xc4cc('0x21'),_0x2460b9,_0xc4cc('0x22'));_0x594cfb(_0x381b59[_0xc4cc('0x29')][_0xc4cc('0x27')]);}})[_0xc4cc('0x2a')](function(_0x44c8e5){logger[_0xc4cc('0x25')]('User,\x20%s,\x20%s',_0x2460b9,_0x44c8e5);_0x2c7d0d(_0x44c8e5);});});}function respondWithStatusCode(_0x1ba4df,_0x853a01){_0x853a01=_0x853a01||0xcc;return function(_0x278d3e){if(_0x278d3e){return _0x1ba4df[_0xc4cc('0x2b')](_0x853a01);}return _0x1ba4df[_0xc4cc('0x2c')](_0x853a01)[_0xc4cc('0x2d')]();};}function respondWithResult(_0x1c42ad,_0x3c6a76){_0x3c6a76=_0x3c6a76||0xc8;return function(_0x547e2d){if(_0x547e2d){return _0x1c42ad[_0xc4cc('0x2c')](_0x3c6a76)[_0xc4cc('0x2e')](_0x547e2d);}};}function respondWithFilteredResult(_0x49aabb,_0x23c675){return function(_0x2edaea){if(_0x2edaea){var _0x4c4acb=_0x2edaea[_0xc4cc('0x2f')],_0x2301d8=_0x23c675[_0xc4cc('0x30')],_0x48f0b6=_0x23c675[_0xc4cc('0x30')]+_0x23c675[_0xc4cc('0x31')],_0x38da5b;if(_0x48f0b6>=_0x4c4acb){_0x48f0b6=_0x4c4acb;_0x38da5b=0xc8;}else{_0x38da5b=0xce;}_0x49aabb['status'](_0x38da5b);return _0x49aabb[_0xc4cc('0x32')](_0xc4cc('0x33'),_0x2301d8+'-'+_0x48f0b6+'/'+_0x4c4acb)[_0xc4cc('0x2e')](_0x2edaea);}return null;};}function patchUpdates(_0x170f63){return function(_0x472bce){try{jsonpatch[_0xc4cc('0x34')](_0x472bce,_0x170f63,!![]);}catch(_0xdc16f0){return BPromise[_0xc4cc('0x35')](_0xdc16f0);}return _0x472bce[_0xc4cc('0x36')]();};}function saveUpdates(_0x5de438,_0x357156){return function(_0x5a6c4a){if(_0x5a6c4a){return _0x5a6c4a[_0xc4cc('0x37')](_0x5de438)[_0xc4cc('0x38')](function(_0x39ae35){return _0x39ae35;});}return null;};}function removeEntity(_0x2446d9,_0x69091c){return function(_0x2f19e6){if(_0x2f19e6){return _0x2f19e6[_0xc4cc('0x39')]()[_0xc4cc('0x38')](function(){var _0x334469=_0x2f19e6['get']({'plain':!![]});var _0x5937e0=[{'name':_0xc4cc('0x3a'),'value':_0xc4cc('0x3b'),'ignore':!![]},{'name':_0xc4cc('0x3c'),'value':_0xc4cc('0x3d'),'ignore':![]},{'name':_0xc4cc('0x3e'),'value':_0xc4cc('0x3f'),'ignore':![]}];var _0x17692f=_(_0x5937e0)[_0xc4cc('0x40')]('ignore')[_0xc4cc('0x41')]('value')[_0xc4cc('0x42')]();if(_['includes'](_0x17692f,_0x334469[_0xc4cc('0x43')])){return;}var _0x1f0c4f=_[_0xc4cc('0x44')](_0x5937e0,['value',_0x334469[_0xc4cc('0x43')]])[_0xc4cc('0x45')];return db[_0xc4cc('0x46')][_0xc4cc('0x39')]({'where':{'type':_0x1f0c4f,'resourceId':_0x334469['id']}})['then'](function(){return _0x2f19e6;});})[_0xc4cc('0x38')](function(){_0x2446d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f66f9,_0x5550fd){return function(_0x31b5b3){if(!_0x31b5b3){_0x1f66f9[_0xc4cc('0x2b')](0x194);}return _0x31b5b3;};}function handleError(_0x1305c0,_0x5341a6){_0x5341a6=_0x5341a6||0x1f4;return function(_0x290f8c){logger[_0xc4cc('0x25')](_0x290f8c[_0xc4cc('0x47')]);if(_0x290f8c[_0xc4cc('0x45')]){delete _0x290f8c[_0xc4cc('0x45')];}_0x1305c0[_0xc4cc('0x2c')](_0x5341a6)[_0xc4cc('0x48')](_0x290f8c);};}exports[_0xc4cc('0x49')]=function(_0x306c2d,_0x434e4d){var _0x4a15b6={},_0x9de418={},_0xcdc66d={'count':0x0,'rows':[]};var _0x37ea05=db[_0xc4cc('0x4a')]['rawAttributes'];_0x9de418[_0xc4cc('0x4b')]=_[_0xc4cc('0x4c')](_[_0xc4cc('0x4d')](_0x37ea05),[_0xc4cc('0x4e'),'salt']);_0x9de418[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x306c2d[_0xc4cc('0x4f')]);_0x9de418[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0x9de418[_0xc4cc('0x4b')],_0x9de418[_0xc4cc('0x4f')]);_0x4a15b6[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x9de418['model'],qs[_0xc4cc('0x53')](_0x306c2d[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x4a15b6['attributes']=_0x4a15b6['attributes']['length']?_0x4a15b6['attributes']:_0x9de418[_0xc4cc('0x4b')];if(!_0x306c2d[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x4a15b6[_0xc4cc('0x31')]=qs['limit'](_0x306c2d[_0xc4cc('0x4f')]['limit']);_0x4a15b6[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x306c2d[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}_0x4a15b6[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x306c2d[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x4a15b6[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x306c2d[_0xc4cc('0x4f')],_0x9de418[_0xc4cc('0x50')]));if(_0x306c2d[_0xc4cc('0x4f')][_0xc4cc('0x40')]){_0x4a15b6[_0xc4cc('0x58')]=_['merge'](_0x4a15b6[_0xc4cc('0x58')],{'$or':_[_0xc4cc('0x41')](_0x37ea05,function(_0x481390){if(_0x481390[_0xc4cc('0x5a')][_0xc4cc('0x5b')]!==_0xc4cc('0x5c')){return db[_0xc4cc('0x5d')][_0xc4cc('0x58')](db[_0xc4cc('0x5d')]['fn'](_0xc4cc('0x5e'),db[_0xc4cc('0x5d')][_0xc4cc('0x5f')](_0x481390[_0xc4cc('0x60')])),{'$like':db['sequelize']['fn'](_0xc4cc('0x5e'),'%'+_0x306c2d[_0xc4cc('0x4f')]['filter']+'%')});}})});}_0x4a15b6=_[_0xc4cc('0x61')]({},_0x4a15b6,_0x306c2d[_0xc4cc('0x62')]);var _0x48b8c9={'where':_0x4a15b6['where']};return db[_0xc4cc('0x4a')][_0xc4cc('0x2f')](_0x48b8c9)['then'](function(_0x5d2b5e){_0xcdc66d[_0xc4cc('0x2f')]=_0x5d2b5e;if(_0x306c2d[_0xc4cc('0x4f')][_0xc4cc('0x63')]){_0x4a15b6[_0xc4cc('0x64')]=[{'all':!![]}];}return db[_0xc4cc('0x4a')][_0xc4cc('0x65')](_0x4a15b6);})['then'](function(_0x14cdf9){_0xcdc66d[_0xc4cc('0x66')]=_0x14cdf9;return _0xcdc66d;})[_0xc4cc('0x38')](respondWithFilteredResult(_0x434e4d,_0x4a15b6))['catch'](handleError(_0x434e4d,null));};exports[_0xc4cc('0x67')]=function(_0x38a5dd,_0xb5c698){var _0xcce089={'raw':![],'where':{'id':_0x38a5dd['params']['id']}},_0x9bb648={};_0x9bb648[_0xc4cc('0x4b')]=_[_0xc4cc('0x4c')](_[_0xc4cc('0x4d')](db[_0xc4cc('0x4a')]['rawAttributes']),['password',_0xc4cc('0x68')]);_0x9bb648[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x38a5dd[_0xc4cc('0x4f')]);_0x9bb648[_0xc4cc('0x50')]=_['intersection'](_0x9bb648[_0xc4cc('0x4b')],_0x9bb648[_0xc4cc('0x4f')]);_0xcce089[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x9bb648[_0xc4cc('0x4b')],qs[_0xc4cc('0x53')](_0x38a5dd[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0xcce089[_0xc4cc('0x52')]=_0xcce089['attributes'][_0xc4cc('0x69')]?_0xcce089[_0xc4cc('0x52')]:_0x9bb648['model'];if(_0x38a5dd[_0xc4cc('0x4f')]['includeAll']){_0xcce089[_0xc4cc('0x64')]=[{'all':!![]}];}_0xcce089=_[_0xc4cc('0x61')]({},_0xcce089,_0x38a5dd[_0xc4cc('0x62')]);return db[_0xc4cc('0x4a')][_0xc4cc('0x44')](_0xcce089)[_0xc4cc('0x38')](handleEntityNotFound(_0xb5c698,null))[_0xc4cc('0x38')](respondWithResult(_0xb5c698,null))[_0xc4cc('0x2a')](handleError(_0xb5c698,null));};exports[_0xc4cc('0x6a')]=function(_0x59fad9,_0x10a016){return db[_0xc4cc('0x4a')]['bulkCreate'](_0x59fad9[_0xc4cc('0x6b')],{'raw':![],'individualHooks':!![]})[_0xc4cc('0x38')](respondWithResult(_0x10a016,0xc9))[_0xc4cc('0x2a')](handleError(_0x10a016,null));};exports[_0xc4cc('0x37')]=function(_0x44e8a5,_0x565d1a){if(_0x44e8a5['body']['id']){delete _0x44e8a5[_0xc4cc('0x6b')]['id'];}delete _0x44e8a5[_0xc4cc('0x6b')][_0xc4cc('0x43')];return db['User']['find']({'where':{'id':_0x44e8a5[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x565d1a,null))[_0xc4cc('0x38')](saveUpdates(_0x44e8a5['body'],null))['then'](respondWithResult(_0x565d1a,null))[_0xc4cc('0x2a')](handleError(_0x565d1a,null));};exports[_0xc4cc('0x6d')]=function(_0x5f5016,_0x100d5f){return db[_0xc4cc('0x4a')][_0xc4cc('0x6d')]()[_0xc4cc('0x38')](respondWithResult(_0x100d5f,null))[_0xc4cc('0x2a')](handleError(_0x100d5f,null));};exports[_0xc4cc('0x6e')]=function(_0x2f68e4,_0x3b70fa,_0xa22e6a){return db[_0xc4cc('0x4a')][_0xc4cc('0x44')]({'where':{'id':_0x2f68e4[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x3b70fa,null))[_0xc4cc('0x38')](function(_0x4872be){if(_0x4872be){return _0x4872be[_0xc4cc('0x6e')](_0x2f68e4[_0xc4cc('0x6b')][_0xc4cc('0x6f')],_[_0xc4cc('0x70')](_0x2f68e4[_0xc4cc('0x6b')],[_0xc4cc('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x3b70fa,null))['catch'](handleError(_0x3b70fa,null));};var getLicense=function(_0x55b4d5){return new BPromise(function(_0x18d6a4,_0x785841){var _0xee114f=0x0;_0x55b4d5[_0xc4cc('0x6b')]['role']==='agent'&&_0x18d6a4(_0xc4cc('0x71'));return db['User']['count']({'where':{'$or':[{'role':_0x55b4d5[_0xc4cc('0x6b')][_0xc4cc('0x43')]===_0xc4cc('0x3f')?_0xc4cc('0x3f'):[_0xc4cc('0x72'),_0xc4cc('0x3b')]}]}})[_0xc4cc('0x38')](function(_0x38e83c){_0xee114f=_0x38e83c;return require('../../config/license/util')['getLicense']();})['then'](function(_0x22441f){var _0x5e96e9=_0x55b4d5[_0xc4cc('0x6b')]['role']===_0xc4cc('0x3f')?_0xc4cc('0x73'):_0xc4cc('0x74');if(!_[_0xc4cc('0x75')](_0x22441f[_0x5e96e9])&&_0xee114f>=_0x22441f[_0x5e96e9]){return _0x785841({'message':_0xc4cc('0x76')});}return _0x18d6a4(util[_0xc4cc('0x77')](_0xc4cc('0x78'),_0x5e96e9,_0xee114f));})[_0xc4cc('0x2a')](function(_0x4f97e4){return _0x785841(_0x4f97e4);});});};exports[_0xc4cc('0x79')]=function(_0xd65c2,_0x21c396){return getLicense(_0xd65c2)[_0xc4cc('0x38')](function(_0xaf08b0){if(!_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x7a')]){var _0xd83546;return db[_0xc4cc('0x7b')][_0xc4cc('0x7c')](0x1)[_0xc4cc('0x38')](function(_0x5bd01c){_0x5bd01c[_0xc4cc('0x7d')]=!![];return checkPasswordPattern(_0x5bd01c,_0xd65c2['body'][_0xc4cc('0x4e')],_0x5bd01c['securePassword']);})[_0xc4cc('0x38')](function(_0x18d553){_0xd83546=_0x18d553[_0xc4cc('0x7e')];return db['User'][_0xc4cc('0x7f')](_0xc4cc('0x7a'));})['then'](function(_0x495e7f){if(_['isNil'](_0x495e7f)){if(_0xd83546){_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x7a')]=_0xd83546;}else{_0xd65c2[_0xc4cc('0x6b')]['internal']=0x1;}}else{if(_[_0xc4cc('0x75')](_0xd83546)||_0xd83546==_0x495e7f){_0xd65c2[_0xc4cc('0x6b')]['internal']=_0x495e7f+0x1;}else if(_0xd83546>_0x495e7f){_0xd65c2[_0xc4cc('0x6b')]['internal']=_0xd83546;}else{return db[_0xc4cc('0x5d')][_0xc4cc('0x4f')](_0xc4cc('0x80'),{'type':db[_0xc4cc('0x5d')][_0xc4cc('0x81')]['SELECT']})[_0xc4cc('0x38')](function(_0x303319){if(_0x303319&&_0x303319['length']){for(var _0x25f3ec=0x0,_0x3d9805=_0x303319[_0xc4cc('0x69')];_0x25f3ec<_0x3d9805&&_[_0xc4cc('0x75')](_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x7a')]);_0x25f3ec++){if(_0xd83546<=_0x303319[_0x25f3ec][_0xc4cc('0x82')]){_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x7a')]=_0x303319[_0x25f3ec]['from'];}else if(_0xd83546>_0x303319[_0x25f3ec][_0xc4cc('0x82')]&&_0xd83546<=_0x303319[_0x25f3ec]['to']){_0xd65c2['body'][_0xc4cc('0x7a')]=_0xd83546;}}}if(_['isNil'](_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x7a')])){_0xd65c2['body'][_0xc4cc('0x7a')]=_0x495e7f+0x1;}});}}});}})[_0xc4cc('0x38')](function(){if(_0xd65c2['body']['voicemail']){_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x83')]=_0xd65c2['body'][_0xc4cc('0x7a')];_0xd65c2[_0xc4cc('0x6b')]['VoiceMail']={'mailbox':_0xd65c2[_0xc4cc('0x6b')]['internal'],'password':_0xd65c2['body'][_0xc4cc('0x4e')],'fullname':_0xd65c2['body']['fullname'],'email':_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x84')]};}if(_0xd65c2[_0xc4cc('0x6b')]&&_0xd65c2['body']['role']===_0xc4cc('0x3d')){_0xd65c2[_0xc4cc('0x6b')][_0xc4cc('0x85')]=['101','102','103',_0xc4cc('0x86'),'104',_0xc4cc('0x87'),'106','107',_0xc4cc('0x88'),_0xc4cc('0x89'),_0xc4cc('0x8a'),_0xc4cc('0x8b')];}return db[_0xc4cc('0x4a')][_0xc4cc('0x79')](_0xd65c2[_0xc4cc('0x6b')],{'include':[{'model':db['VoiceMail'],'as':_0xc4cc('0x8c')}]});})[_0xc4cc('0x38')](function(_0x87aac3){if(_0xd65c2['body'][_0xc4cc('0x43')]===_0xc4cc('0x3b'))return _0x87aac3;var _0x20a6e4=_0xd65c2[_0xc4cc('0x3b')][_0xc4cc('0x8d')]({'plain':!![]});if(!_0x20a6e4)throw new Error(_0xc4cc('0x8e'));if(_0x20a6e4['role']===_0xc4cc('0x3b')){var _0x4f0a98=_0x87aac3[_0xc4cc('0x8d')]({'plain':!![]});var _0x157bf8=[{'name':_0xc4cc('0x3c'),'value':_0xc4cc('0x3d')},{'name':_0xc4cc('0x3e'),'value':_0xc4cc('0x3f')}];var _0x45920e=_[_0xc4cc('0x44')](_0x157bf8,['value',_0x4f0a98[_0xc4cc('0x43')]])[_0xc4cc('0x45')];return db['UserProfileSection'][_0xc4cc('0x44')]({'where':{'name':_0x45920e,'userProfileId':_0x20a6e4[_0xc4cc('0x8f')]},'raw':!![]})['then'](function(_0x25a1d7){if(_0x25a1d7&&_0x25a1d7['autoAssociation']===0x0){return db[_0xc4cc('0x46')]['create']({'name':_0x4f0a98['name'],'resourceId':_0x4f0a98['id'],'type':_0x25a1d7[_0xc4cc('0x45')],'sectionId':_0x25a1d7['id']},{})[_0xc4cc('0x38')](function(){return _0x87aac3;});}else{return _0x87aac3;}})[_0xc4cc('0x2a')](function(_0x16c217){logger['error'](_0xc4cc('0x90'),_0x16c217);throw _0x16c217;});}return _0x87aac3;})[_0xc4cc('0x38')](respondWithResult(_0x21c396,0xc9))[_0xc4cc('0x2a')](handleError(_0x21c396,null));};exports['changePassword']=function(_0x4fa844,_0x544ef0,_0x428753){var _0x2327ef=![];if(_0x4fa844[_0xc4cc('0x6b')]['id']){delete _0x4fa844[_0xc4cc('0x6b')]['id'];}if(!_[_0xc4cc('0x75')](_0x4fa844[_0xc4cc('0x6b')]['oldPassword'])){if(_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x91')]===_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x92')]){throw new Error(_0xc4cc('0x93'));}}return db[_0xc4cc('0x4a')]['find']({'where':{'id':_0x4fa844[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](function(_0x4e5dec){if(_0x4e5dec){if(_0x4e5dec['id']==_0x4fa844[_0xc4cc('0x3b')]['id']){if(!_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x91')]||!_0x4fa844['body'][_0xc4cc('0x92')]){throw new db[(_0xc4cc('0x94'))]['ValidationError'](_0xc4cc('0x95'));}if(!_0x4e5dec[_0xc4cc('0x96')](_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x91')])){throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))](_0xc4cc('0x98'));}if(_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x91')]==_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x92')]){throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x4e5dec;}else if(_0x4fa844['user'][_0xc4cc('0x43')]=='admin'){if(!_0x4fa844['body']['newPassword']){throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))](_0xc4cc('0x99'));}return _0x4e5dec;}else if(_0x4fa844['user'][_0xc4cc('0x43')]==_0xc4cc('0x3b')){if(!_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x92')]){throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))](_0xc4cc('0x99'));}if(_0x4e5dec[_0xc4cc('0x43')]!=_0xc4cc('0x3d')){throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))](_0xc4cc('0x9a'));}return _0x4e5dec;}else{throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))](_0xc4cc('0x9a'));}}return null;})[_0xc4cc('0x38')](handleEntityNotFound(_0x544ef0,null))[_0xc4cc('0x38')](function(_0x334fb1){return db[_0xc4cc('0x7b')][_0xc4cc('0x9b')]({'attributes':['id',_0xc4cc('0x7d')]})[_0xc4cc('0x38')](function(_0x5173c1){_0x2327ef=_0x5173c1['securePassword'];return checkPasswordPattern(_0x334fb1,_0x4fa844['body'][_0xc4cc('0x92')],_0x2327ef);});})[_0xc4cc('0x38')](saveUpdates({'password':_0x4fa844[_0xc4cc('0x6b')][_0xc4cc('0x92')],'passwordResetAt':_0x4fa844[_0xc4cc('0x3b')]['id']==_0x4fa844['params']['id']?moment():null},null))['then'](respondWithResult(_0x544ef0,null))[_0xc4cc('0x2a')](handleError(_0x544ef0,null));};exports[_0xc4cc('0x9c')]=function(_0x2e3a48,_0x1b396a,_0xe094e1){var _0x17c348=_0x2e3a48[_0xc4cc('0x6b')][_0xc4cc('0x9d')];return db[_0xc4cc('0x4a')][_0xc4cc('0x44')]({'where':{'id':_0x2e3a48[_0xc4cc('0x6c')]['id']},'attributes':['id','name','role',_0xc4cc('0x9e'),_0xc4cc('0x9f'),_0xc4cc('0xa0'),_0xc4cc('0xa1')]})['then'](handleEntityNotFound(_0x1b396a,null))[_0xc4cc('0x38')](function(_0x4ad858){if(_0x4ad858){if(!utils['isValidChannel'](_0x17c348)){throw new db[(_0xc4cc('0x94'))]['ValidationError'](_0xc4cc('0xa2'));}return _0x4ad858[_0xc4cc('0xa3')+_[_0xc4cc('0xa4')](_0x17c348[_0xc4cc('0xa5')]())+'Queues'](_0x2e3a48[_0xc4cc('0x6b')]['ids'],{'penalty':_0x2e3a48['body'][_0xc4cc('0xa6')]||0x0})['spread'](function(_0x570e29){for(var _0x33fd25=0x0;_0x33fd25<_0x2e3a48[_0xc4cc('0x6b')]['ids'][_0xc4cc('0x69')];_0x33fd25+=0x1){var _0xa806f6={'UserId':_0x2e3a48[_0xc4cc('0x6c')]['id']};_0xa806f6[_['capitalize'](_0x17c348[_0xc4cc('0xa5')]())+_0xc4cc('0xa7')]=_0x2e3a48[_0xc4cc('0x6b')][_0xc4cc('0x6f')][_0x33fd25];socket['emit'](_0xc4cc('0x3b')+_[_0xc4cc('0xa4')](_0x17c348['toLowerCase']())+_0xc4cc('0xa8'),_0xa806f6);}return _0x570e29;})[_0xc4cc('0x38')](function(){if(_0x17c348===_0xc4cc('0xa9')){return db[_0xc4cc('0xaa')]['findAll']({'where':{'id':_0x2e3a48[_0xc4cc('0x6b')]['ids']||[]},'raw':!![],'attributes':['id',_0xc4cc('0x45')]});}})[_0xc4cc('0x38')](function(_0x293fa8){var _0x97c2f0=_0x4ad858[_0xc4cc('0x8d')]({'plain':!![]});var _0x567015=[];if(_0x17c348===_0xc4cc('0xa9')&&_0x97c2f0[_0xc4cc('0x43')]===_0xc4cc('0x3d')&&_0x97c2f0[_0xc4cc('0x9e')]){for(var _0x32ece3=0x0;_0x32ece3<_0x293fa8['length'];_0x32ece3+=0x1){_0x567015[_0xc4cc('0xab')]({'membername':_0x97c2f0[_0xc4cc('0x45')],'UserId':_0x97c2f0['id'],'queue_name':_0x293fa8[_0x32ece3][_0xc4cc('0x45')],'VoiceQueueId':_0x293fa8[_0x32ece3]['id'],'interface':_[_0xc4cc('0x75')](_0x97c2f0[_0xc4cc('0xa1')])?util[_0xc4cc('0x77')](_0xc4cc('0xac'),_0x97c2f0['name']):_0x97c2f0[_0xc4cc('0xa1')],'paused':_0x97c2f0[_0xc4cc('0xa0')]||![],'penalty':_0x2e3a48['body'][_0xc4cc('0xa6')]||0x0});}return BPromise[_0xc4cc('0xad')](_0x567015,function(_0x1fbc85){return db[_0xc4cc('0xae')]['upsert'](_0x1fbc85);});}return _0x4ad858;});}})[_0xc4cc('0x38')](respondWithStatusCode(_0x1b396a,null))[_0xc4cc('0x2a')](handleError(_0x1b396a,null));};exports[_0xc4cc('0xaf')]=function(_0x32e690,_0x5a7c10,_0x5bf615){var _0x15f0a0;return db[_0xc4cc('0x4a')][_0xc4cc('0x44')]({'where':{'id':_0x32e690['params']['id']},'attributes':['id',_0xc4cc('0x45'),_0xc4cc('0x43')]})[_0xc4cc('0x38')](handleEntityNotFound(_0x5a7c10,null))[_0xc4cc('0x38')](function(_0x3cb518){if(_0x3cb518){_0x15f0a0=_0x3cb518;if(!_0x32e690[_0xc4cc('0x4f')]['channel']||!utils['isValidChannel'](_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x9d')])){throw new db['Sequelize'][(_0xc4cc('0x97'))](_0xc4cc('0xa2'));}return _0x3cb518[_0xc4cc('0xb0')+_[_0xc4cc('0xa4')](_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x9d')][_0xc4cc('0xa5')]())+_0xc4cc('0xb1')](_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x6f')]);}})[_0xc4cc('0x38')](function(_0x631c0c){for(var _0x4510c2=0x0;_0x4510c2<_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x6f')]['length'];_0x4510c2+=0x1){var _0x4c8b5d={'UserId':_0x32e690[_0xc4cc('0x6c')]['id']};_0x4c8b5d[_['capitalize'](_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x9d')]['toLowerCase']())+_0xc4cc('0xa7')]=_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x6f')][_0x4510c2];socket[_0xc4cc('0xb2')](_0xc4cc('0x3b')+_[_0xc4cc('0xa4')](_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x9d')][_0xc4cc('0xa5')]())+_0xc4cc('0xb3'),_0x4c8b5d);}return _0x631c0c;})[_0xc4cc('0x38')](function(){if(_0x32e690[_0xc4cc('0x4f')]['channel']===_0xc4cc('0xa9')){return db[_0xc4cc('0xae')]['destroy']({'where':{'UserId':_0x32e690[_0xc4cc('0x6c')]['id'],'VoiceQueueId':_0x32e690[_0xc4cc('0x4f')][_0xc4cc('0x6f')]},'individualHooks':!![]})['then'](function(){return _0x15f0a0;});}return _0x15f0a0;})[_0xc4cc('0x38')](respondWithStatusCode(_0x5a7c10,null))[_0xc4cc('0x2a')](handleError(_0x5a7c10,null));};exports[_0xc4cc('0xb4')]=function(_0x38903b,_0x4362c1,_0x34f646){_0x38903b[_0xc4cc('0x6b')]['userpic']=_0x38903b['file'][_0xc4cc('0xb5')];return db[_0xc4cc('0x4a')]['find']({'where':{'id':_0x38903b[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x4362c1,null))[_0xc4cc('0x38')](saveUpdates(_0x38903b[_0xc4cc('0x6b')],null))[_0xc4cc('0x38')](respondWithResult(_0x4362c1,null))[_0xc4cc('0x2a')](handleError(_0x4362c1,null));};exports['getAvatar']=function(_0x388173,_0x3e793d,_0x460a23){var _0x146587=path[_0xc4cc('0xb6')](config[_0xc4cc('0xb7')],_0xc4cc('0xb8'));return db[_0xc4cc('0x4a')][_0xc4cc('0x44')]({'where':{'id':_0x388173[_0xc4cc('0x6c')]['id']},'attributes':['id',_0xc4cc('0xb9')],'raw':!![]})[_0xc4cc('0x38')](handleEntityNotFound(_0x3e793d,null))[_0xc4cc('0x38')](function(_0x9a88c6){if(_0x9a88c6){if(_[_0xc4cc('0x75')](_0x9a88c6[_0xc4cc('0xb9')])){return _0x3e793d[_0xc4cc('0xba')](_0x146587);}else{if(!fs['existsSync'](path[_0xc4cc('0xb6')](config['root'],_0xc4cc('0xbb'),_0x9a88c6['userpic']))){return _0x3e793d[_0xc4cc('0xba')](_0x146587);}return _0x3e793d[_0xc4cc('0xba')](path[_0xc4cc('0xb6')](config['root'],_0xc4cc('0xbb'),_0x9a88c6[_0xc4cc('0xb9')]));}}})[_0xc4cc('0x2a')](handleError(_0x3e793d,null));};exports[_0xc4cc('0xbc')]=function(_0x36f055,_0x410101,_0x4f987a){var _0x1d62e9={};var _0x45a8f8={};var _0x133c34;var _0x4dadaa;return db[_0xc4cc('0x4a')]['findOne']({'where':{'id':_0x36f055['params']['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x410101,null))['then'](function(_0x49f369){if(_0x49f369){_0x133c34=_0x49f369;_0x45a8f8[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db[_0xc4cc('0xbd')][_0xc4cc('0xbe')]);_0x45a8f8[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x36f055['query']);_0x45a8f8[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0x45a8f8[_0xc4cc('0x4b')],_0x45a8f8['query']);_0x1d62e9[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x45a8f8[_0xc4cc('0x4b')],qs[_0xc4cc('0x53')](_0x36f055['query'][_0xc4cc('0x53')]));_0x1d62e9[_0xc4cc('0x52')]=_0x1d62e9[_0xc4cc('0x52')][_0xc4cc('0x69')]?_0x1d62e9[_0xc4cc('0x52')]:_0x45a8f8[_0xc4cc('0x4b')];_0x1d62e9[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x36f055['query'][_0xc4cc('0x57')]);_0x1d62e9['where']=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x36f055['query'],_0x45a8f8['filters']));if(_0x36f055[_0xc4cc('0x4f')][_0xc4cc('0x40')]){_0x1d62e9[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x1d62e9['where'],{'$or':_[_0xc4cc('0x41')](_0x1d62e9[_0xc4cc('0x52')],function(_0x2855a0){var _0x4637d6={};_0x4637d6[_0x2855a0]={'$like':'%'+_0x36f055[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0x4637d6;})});}_0x1d62e9=_[_0xc4cc('0x61')]({},_0x1d62e9,_0x36f055[_0xc4cc('0x62')]);return _0x133c34[_0xc4cc('0xbc')](_0x1d62e9);}})['then'](function(_0x7946cf){if(_0x7946cf){_0x4dadaa=_0x7946cf['length'];if(_0x36f055[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x63'))){_0x1d62e9[_0xc4cc('0x64')]=[{'model':db[_0xc4cc('0xbf')],'as':_0xc4cc('0xc0'),'required':![]},{'model':db['Tag'],'as':_0xc4cc('0xc1'),'attributes':['id',_0xc4cc('0x45'),_0xc4cc('0xc2')],'where':_0x36f055[_0xc4cc('0x4f')]['tag']?{'id':_0x36f055['query'][_0xc4cc('0xc3')]}:undefined,'required':_0x36f055[_0xc4cc('0x4f')]['tag']?!![]:![]}];}if(!_0x36f055[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x1d62e9['limit']=qs[_0xc4cc('0x31')](_0x36f055['query'][_0xc4cc('0x31')]);_0x1d62e9[_0xc4cc('0x30')]=qs['offset'](_0x36f055[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}return _0x133c34[_0xc4cc('0xbc')](_0x1d62e9);}})[_0xc4cc('0x38')](function(_0x345e32){if(_0x345e32){return _0x345e32?{'count':_0x4dadaa,'rows':_0x345e32}:null;}})['then'](respondWithResult(_0x410101,null))[_0xc4cc('0x2a')](handleError(_0x410101,null));};exports[_0xc4cc('0xc4')]=function(_0x3f8039,_0x544df2,_0x16afcc){var _0x39d821;var _0x11a45f;var _0x4f1cde={};var _0x280f22;return db[_0xc4cc('0x4a')]['findOne']({'where':{'id':_0x3f8039[_0xc4cc('0x6c')]['id']},'attributes':['id',_0xc4cc('0x45'),_0xc4cc('0x43')]})[_0xc4cc('0x38')](handleEntityNotFound(_0x544df2,null))[_0xc4cc('0x38')](function(_0x3a417a){if(!utils[_0xc4cc('0xc5')](_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x9d')])){throw new db['Sequelize'][(_0xc4cc('0x97'))](_0xc4cc('0xa2'));}_0x39d821=_0x3a417a;var _0xaadbae={};_0xaadbae['model']=_['keys'](db[_[_0xc4cc('0xa4')](_0x3f8039[_0xc4cc('0x4f')]['channel'])+_0xc4cc('0xc6')][_0xc4cc('0xbe')]);_0xaadbae['query']=_[_0xc4cc('0x4d')](_0x3f8039['query']);_0xaadbae[_0xc4cc('0x50')]=_['intersection'](_0xaadbae['model'],_0xaadbae[_0xc4cc('0x4f')]);_0x4f1cde['attributes']=_[_0xc4cc('0x51')](_0xaadbae['model'],qs[_0xc4cc('0x53')](_0x3f8039['query'][_0xc4cc('0x53')]));_0x4f1cde['attributes']=_0x4f1cde[_0xc4cc('0x52')]['length']?_0x4f1cde[_0xc4cc('0x52')]:_0xaadbae[_0xc4cc('0x4b')];_0x4f1cde[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x4f1cde[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x3f8039[_0xc4cc('0x4f')],_0xaadbae[_0xc4cc('0x50')]));if(_0x3f8039[_0xc4cc('0x4f')]['filter']){_0x4f1cde[_0xc4cc('0x58')]=_['merge'](_0x4f1cde['where'],{'$or':_[_0xc4cc('0x41')](_0x4f1cde[_0xc4cc('0x52')],function(_0x34ed4a){var _0xf73593={};_0xf73593[_0x34ed4a]={'$like':'%'+_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0xf73593;})});}_0x4f1cde=_['merge']({},_0x4f1cde,_0x3f8039['options']);switch(_0x39d821['role']){case'admin':return db[_[_0xc4cc('0xa4')](_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x9d')])+_0xc4cc('0xc6')]['findAll'](_0x4f1cde);case'user':case _0xc4cc('0x3d'):return _0x39d821['get'+_[_0xc4cc('0xa4')](_0x3f8039[_0xc4cc('0x4f')]['channel'])+_0xc4cc('0xb1')](_0x4f1cde);default:throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))]('Unknown\x20role');}})[_0xc4cc('0x38')](function(_0x5b3afe){_0x280f22=_0x5b3afe[_0xc4cc('0x69')];if(!_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x4f1cde[_0xc4cc('0x31')]=qs['limit'](_0x3f8039['query'][_0xc4cc('0x31')]);_0x4f1cde[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}switch(_0x39d821[_0xc4cc('0x43')]){case _0xc4cc('0x72'):return db[_[_0xc4cc('0xa4')](_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x9d')])+_0xc4cc('0xc6')][_0xc4cc('0x65')](_0x4f1cde);case _0xc4cc('0x3b'):case'agent':return _0x39d821['get'+_[_0xc4cc('0xa4')](_0x3f8039[_0xc4cc('0x4f')][_0xc4cc('0x9d')])+_0xc4cc('0xb1')](_0x4f1cde);}})[_0xc4cc('0x38')](function(_0x75cdbd){return{'count':_0x280f22,'rows':_0x75cdbd};})[_0xc4cc('0x38')](respondWithResult(_0x544df2,null))[_0xc4cc('0x2a')](handleError(_0x544df2,null));};exports[_0xc4cc('0xc7')]=function(_0x5a5257,_0x2e3807,_0x5c84d7){var _0x306915={};var _0x31081d={};var _0x2d2b05;var _0xce3cf9;return db['User']['findOne']({'where':{'id':_0x5a5257[_0xc4cc('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2e3807,null))[_0xc4cc('0x38')](function(_0x408f09){if(_0x408f09){_0x2d2b05=_0x408f09;_0x31081d[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db[_0xc4cc('0xae')][_0xc4cc('0xbe')]);_0x31081d[_0xc4cc('0x4f')]=_['keys'](_0x5a5257[_0xc4cc('0x4f')]);_0x31081d['filters']=_[_0xc4cc('0x51')](_0x31081d[_0xc4cc('0x4b')],_0x31081d[_0xc4cc('0x4f')]);_0x306915[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x31081d['model'],qs[_0xc4cc('0x53')](_0x5a5257[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x306915['attributes']=_0x306915['attributes'][_0xc4cc('0x69')]?_0x306915[_0xc4cc('0x52')]:_0x31081d[_0xc4cc('0x4b')];_0x306915[_0xc4cc('0x56')]=qs['sort'](_0x5a5257[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x306915[_0xc4cc('0x58')]=qs['filters'](_[_0xc4cc('0x59')](_0x5a5257[_0xc4cc('0x4f')],_0x31081d[_0xc4cc('0x50')]));if(_0x5a5257[_0xc4cc('0x4f')][_0xc4cc('0x40')]){_0x306915[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x306915[_0xc4cc('0x58')],{'$or':_['map'](_0x306915[_0xc4cc('0x52')],function(_0x520628){var _0x4d9c3c={};_0x4d9c3c[_0x520628]={'$like':'%'+_0x5a5257[_0xc4cc('0x4f')]['filter']+'%'};return _0x4d9c3c;})});}_0x306915=_[_0xc4cc('0x61')]({},_0x306915,_0x5a5257['options']);return _0x2d2b05[_0xc4cc('0xc7')](_0x306915);}})[_0xc4cc('0x38')](function(_0x4648b9){if(_0x4648b9){_0xce3cf9=_0x4648b9[_0xc4cc('0x69')];if(!_0x5a5257[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x306915['limit']=qs[_0xc4cc('0x31')](_0x5a5257[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x306915[_0xc4cc('0x30')]=qs['offset'](_0x5a5257[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}return _0x2d2b05[_0xc4cc('0xc7')](_0x306915);}})[_0xc4cc('0x38')](function(_0x3e039e){if(_0x3e039e){return _0x3e039e?{'count':_0xce3cf9,'rows':_0x3e039e}:null;}})[_0xc4cc('0x38')](respondWithResult(_0x2e3807,null))[_0xc4cc('0x2a')](handleError(_0x2e3807,null));};exports[_0xc4cc('0xc8')]=function(_0x38d690,_0x59b28a,_0x4d4d53){var _0x53a238={};var _0xb8273f={};var _0x4fcc7b;var _0x2e4529;return db[_0xc4cc('0x4a')][_0xc4cc('0x9b')]({'where':{'id':_0x38d690[_0xc4cc('0x6c')]['id']}})['then'](handleEntityNotFound(_0x59b28a,null))[_0xc4cc('0x38')](function(_0x2a54f3){if(_0x2a54f3){_0x4fcc7b=_0x2a54f3;_0xb8273f[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db[_0xc4cc('0xc9')][_0xc4cc('0xbe')]);_0xb8273f[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x38d690[_0xc4cc('0x4f')]);_0xb8273f[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0xb8273f['model'],_0xb8273f[_0xc4cc('0x4f')]);_0x53a238['attributes']=_['intersection'](_0xb8273f['model'],qs[_0xc4cc('0x53')](_0x38d690[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x53a238['attributes']=_0x53a238[_0xc4cc('0x52')]['length']?_0x53a238['attributes']:_0xb8273f[_0xc4cc('0x4b')];_0x53a238[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x38d690['query'][_0xc4cc('0x57')]);_0x53a238['where']=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x38d690['query'],_0xb8273f['filters']));if(_0x38d690[_0xc4cc('0x4f')]['filter']){_0x53a238[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x53a238[_0xc4cc('0x58')],{'$or':_['map'](_0x53a238[_0xc4cc('0x52')],function(_0x19813d){var _0x3a91ec={};_0x3a91ec[_0x19813d]={'$like':'%'+_0x38d690[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0x3a91ec;})});}_0x53a238=_['merge']({},_0x53a238,_0x38d690['options']);return _0x4fcc7b['getGroups'](_0x53a238);}})[_0xc4cc('0x38')](function(_0x61e54d){if(_0x61e54d){_0x2e4529=_0x61e54d[_0xc4cc('0x69')];if(!_0x38d690[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x53a238[_0xc4cc('0x31')]=qs[_0xc4cc('0x31')](_0x38d690[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x53a238[_0xc4cc('0x30')]=qs['offset'](_0x38d690[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}return _0x4fcc7b[_0xc4cc('0xc8')](_0x53a238);}})[_0xc4cc('0x38')](function(_0x22bb63){if(_0x22bb63){return _0x22bb63?{'count':_0x2e4529,'rows':_0x22bb63}:null;}})[_0xc4cc('0x38')](respondWithResult(_0x59b28a,null))['catch'](handleError(_0x59b28a,null));};exports[_0xc4cc('0xca')]=function(_0x55f2a9,_0x4497ef,_0x3d6320){var _0x5e5802={'raw':!![],'where':{}};var _0x57f9d4={};var _0x39650f={'count':0x0,'rows':[]};return db[_0xc4cc('0x4a')][_0xc4cc('0x9b')]({'where':{'id':_0x55f2a9[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x4497ef,null))[_0xc4cc('0x38')](function(_0x24ee11){if(_0x24ee11){_0x57f9d4['model']=_[_0xc4cc('0x4d')](db['VoiceRecording']['rawAttributes']);_0x57f9d4[_0xc4cc('0x4f')]=_['keys'](_0x55f2a9[_0xc4cc('0x4f')]);_0x57f9d4['filters']=_[_0xc4cc('0x51')](_0x57f9d4[_0xc4cc('0x4b')],_0x57f9d4[_0xc4cc('0x4f')]);_0x5e5802['attributes']=_[_0xc4cc('0x51')](_0x57f9d4[_0xc4cc('0x4b')],qs['fields'](_0x55f2a9[_0xc4cc('0x4f')]['fields']));_0x5e5802[_0xc4cc('0x52')]=_0x5e5802[_0xc4cc('0x52')][_0xc4cc('0x69')]?_0x5e5802[_0xc4cc('0x52')]:_0x57f9d4[_0xc4cc('0x4b')];if(!_0x55f2a9[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x5e5802[_0xc4cc('0x31')]=qs[_0xc4cc('0x31')](_0x55f2a9[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x5e5802[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x55f2a9[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}_0x5e5802[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x55f2a9[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x5e5802[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x55f2a9[_0xc4cc('0x4f')],_0x57f9d4[_0xc4cc('0x50')]));_0x5e5802[_0xc4cc('0x58')][_0xc4cc('0xcb')]=_0x24ee11['id'];if(_0x55f2a9[_0xc4cc('0x4f')][_0xc4cc('0x40')]){_0x5e5802[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x5e5802[_0xc4cc('0x58')],{'$or':_[_0xc4cc('0x41')](_0x5e5802[_0xc4cc('0x52')],function(_0x3c2b49){var _0x38e773={};_0x38e773[_0x3c2b49]={'$like':'%'+_0x55f2a9['query'][_0xc4cc('0x40')]+'%'};return _0x38e773;})});}_0x5e5802=_[_0xc4cc('0x61')]({},_0x5e5802,_0x55f2a9['options']);return db[_0xc4cc('0xcc')][_0xc4cc('0x2f')]({'where':_0x5e5802[_0xc4cc('0x58')]})['then'](function(_0x11c1ba){_0x39650f[_0xc4cc('0x2f')]=_0x11c1ba;if(_0x55f2a9[_0xc4cc('0x4f')][_0xc4cc('0x63')]){_0x5e5802['include']=[{'all':!![]}];}return db[_0xc4cc('0xcc')][_0xc4cc('0x65')](_0x5e5802);})[_0xc4cc('0x38')](function(_0x4c2cc5){_0x39650f[_0xc4cc('0x66')]=_0x4c2cc5;return _0x39650f;});}})['then'](respondWithFilteredResult(_0x4497ef,_0x5e5802))[_0xc4cc('0x2a')](handleError(_0x4497ef,null));};exports[_0xc4cc('0xcd')]=function(_0x4dcf79,_0x23d911,_0x9deed5){var _0x4c54bf={'raw':!![],'where':{}};var _0xdf79c4={};var _0x5901a4={'count':0x0,'rows':[]};return db[_0xc4cc('0x4a')]['findOne']({'where':{'id':_0x4dcf79[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x23d911,null))[_0xc4cc('0x38')](function(_0x3fc363){if(_0x3fc363){_0xdf79c4[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db['ScreenRecording'][_0xc4cc('0xbe')]);_0xdf79c4[_0xc4cc('0x4f')]=_['keys'](_0x4dcf79[_0xc4cc('0x4f')]);_0xdf79c4['filters']=_[_0xc4cc('0x51')](_0xdf79c4['model'],_0xdf79c4[_0xc4cc('0x4f')]);_0x4c54bf[_0xc4cc('0x52')]=_['intersection'](_0xdf79c4[_0xc4cc('0x4b')],qs[_0xc4cc('0x53')](_0x4dcf79[_0xc4cc('0x4f')]['fields']));_0x4c54bf[_0xc4cc('0x52')]=_0x4c54bf[_0xc4cc('0x52')]['length']?_0x4c54bf['attributes']:_0xdf79c4[_0xc4cc('0x4b')];if(!_0x4dcf79[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x4c54bf[_0xc4cc('0x31')]=qs[_0xc4cc('0x31')](_0x4dcf79[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x4c54bf[_0xc4cc('0x30')]=qs['offset'](_0x4dcf79[_0xc4cc('0x4f')]['offset']);}_0x4c54bf['order']=qs[_0xc4cc('0x57')](_0x4dcf79['query']['sort']);_0x4c54bf['where']=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x4dcf79[_0xc4cc('0x4f')],_0xdf79c4[_0xc4cc('0x50')]));_0x4c54bf[_0xc4cc('0x58')][_0xc4cc('0xcb')]=_0x3fc363['id'];if(_0x4dcf79[_0xc4cc('0x4f')][_0xc4cc('0x40')]){_0x4c54bf[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x4c54bf[_0xc4cc('0x58')],{'$or':_['map'](_0x4c54bf[_0xc4cc('0x52')],function(_0x41faac){var _0x2f9613={};_0x2f9613[_0x41faac]={'$like':'%'+_0x4dcf79[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0x2f9613;})});}_0x4c54bf=_[_0xc4cc('0x61')]({},_0x4c54bf,_0x4dcf79[_0xc4cc('0x62')]);return db[_0xc4cc('0xce')]['count']({'where':_0x4c54bf[_0xc4cc('0x58')]})[_0xc4cc('0x38')](function(_0x316753){_0x5901a4['count']=_0x316753;if(_0x4dcf79[_0xc4cc('0x4f')][_0xc4cc('0x63')]){_0x4c54bf[_0xc4cc('0x64')]=[{'all':!![]}];}return db[_0xc4cc('0xce')][_0xc4cc('0x65')](_0x4c54bf);})['then'](function(_0x510d42){_0x5901a4[_0xc4cc('0x66')]=_0x510d42;return _0x5901a4;});}})[_0xc4cc('0x38')](respondWithFilteredResult(_0x23d911,_0x4c54bf))[_0xc4cc('0x2a')](handleError(_0x23d911,null));};exports['getChatInteractions']=function(_0x2534bc,_0x11e101,_0x39c233){var _0x582383={};var _0x3a1c56={};var _0x26de17;var _0x4154f2;return db['User'][_0xc4cc('0x9b')]({'where':{'id':_0x2534bc[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x11e101,null))[_0xc4cc('0x38')](function(_0x138ef1){if(_0x138ef1){_0x26de17=_0x138ef1;_0x3a1c56[_0xc4cc('0x4b')]=_['keys'](db[_0xc4cc('0xcf')][_0xc4cc('0xbe')]);_0x3a1c56[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x2534bc['query']);_0x3a1c56[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0x3a1c56[_0xc4cc('0x4b')],_0x3a1c56[_0xc4cc('0x4f')]);_0x582383[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x3a1c56[_0xc4cc('0x4b')],qs[_0xc4cc('0x53')](_0x2534bc[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x582383['attributes']=_0x582383[_0xc4cc('0x52')]['length']?_0x582383['attributes']:_0x3a1c56[_0xc4cc('0x4b')];_0x582383[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x2534bc[_0xc4cc('0x4f')]['sort']);_0x582383['where']=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x2534bc[_0xc4cc('0x4f')],_0x3a1c56['filters']));if(_0x2534bc['query']['filter']){_0x582383[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x582383[_0xc4cc('0x58')],{'$or':_[_0xc4cc('0x41')](_0x582383[_0xc4cc('0x52')],function(_0x5bcf2f){var _0xb77748={};_0xb77748[_0x5bcf2f]={'$like':'%'+_0x2534bc[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0xb77748;})});}_0x582383=_[_0xc4cc('0x61')]({},_0x582383,_0x2534bc[_0xc4cc('0x62')]);return _0x26de17[_0xc4cc('0xd0')](_0x582383);}})[_0xc4cc('0x38')](function(_0x38010a){if(_0x38010a){_0x4154f2=_0x38010a['length'];if(!_0x2534bc[_0xc4cc('0x4f')][_0xc4cc('0x54')]('nolimit')){_0x582383['limit']=qs[_0xc4cc('0x31')](_0x2534bc[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x582383[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x2534bc[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}return _0x26de17['getChatInteractions'](_0x582383);}})[_0xc4cc('0x38')](function(_0x35a4eb){if(_0x35a4eb){return _0x35a4eb?{'count':_0x4154f2,'rows':_0x35a4eb}:null;}})[_0xc4cc('0x38')](respondWithResult(_0x11e101,null))[_0xc4cc('0x2a')](handleError(_0x11e101,null));};exports[_0xc4cc('0xd1')]=function(_0x49c06a,_0x1a4cbc,_0x9933be){var _0x2435a4={};var _0xa00a60={};var _0x54ad5a;var _0x1b55fc;return db[_0xc4cc('0x4a')][_0xc4cc('0x9b')]({'where':{'id':_0x49c06a[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x1a4cbc,null))[_0xc4cc('0x38')](function(_0x35be49){if(_0x35be49){_0x54ad5a=_0x35be49;_0xa00a60[_0xc4cc('0x4b')]=_['keys'](db[_0xc4cc('0xd2')][_0xc4cc('0xbe')]);_0xa00a60['query']=_[_0xc4cc('0x4d')](_0x49c06a['query']);_0xa00a60[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0xa00a60[_0xc4cc('0x4b')],_0xa00a60[_0xc4cc('0x4f')]);_0x2435a4[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0xa00a60[_0xc4cc('0x4b')],qs['fields'](_0x49c06a[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x2435a4[_0xc4cc('0x52')]=_0x2435a4[_0xc4cc('0x52')][_0xc4cc('0x69')]?_0x2435a4[_0xc4cc('0x52')]:_0xa00a60[_0xc4cc('0x4b')];_0x2435a4[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x49c06a[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x2435a4[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_['pick'](_0x49c06a[_0xc4cc('0x4f')],_0xa00a60['filters']));if(_0x49c06a[_0xc4cc('0x4f')]['filter']){_0x2435a4[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x2435a4['where'],{'$or':_['map'](_0x2435a4['attributes'],function(_0x575387){var _0xe24f12={};_0xe24f12[_0x575387]={'$like':'%'+_0x49c06a['query']['filter']+'%'};return _0xe24f12;})});}_0x2435a4=_[_0xc4cc('0x61')]({},_0x2435a4,_0x49c06a[_0xc4cc('0x62')]);return _0x54ad5a[_0xc4cc('0xd1')](_0x2435a4);}})[_0xc4cc('0x38')](function(_0x501a90){if(_0x501a90){_0x1b55fc=_0x501a90['length'];if(!_0x49c06a[_0xc4cc('0x4f')][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x2435a4['limit']=qs[_0xc4cc('0x31')](_0x49c06a[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x2435a4[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x49c06a['query']['offset']);}return _0x54ad5a['getOpenchannelInteractions'](_0x2435a4);}})['then'](function(_0x41f97a){if(_0x41f97a){return _0x41f97a?{'count':_0x1b55fc,'rows':_0x41f97a}:null;}})[_0xc4cc('0x38')](respondWithResult(_0x1a4cbc,null))[_0xc4cc('0x2a')](handleError(_0x1a4cbc,null));};exports[_0xc4cc('0xd3')]=function(_0x2acaf4,_0x4add33,_0x2a8002){var _0x1449fd={'raw':!![],'where':{}};var _0x3f49f1={};var _0x360fb8={'count':0x0,'rows':[]};return db[_0xc4cc('0x4a')]['findOne']({'where':{'id':_0x2acaf4[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x4add33,null))[_0xc4cc('0x38')](function(_0x2644e5){if(_0x2644e5){_0x3f49f1[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db['MailInteraction'][_0xc4cc('0xbe')]);_0x3f49f1[_0xc4cc('0x4f')]=_['keys'](_0x2acaf4['query']);_0x3f49f1[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0x3f49f1['model'],_0x3f49f1[_0xc4cc('0x4f')]);_0x1449fd[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x3f49f1[_0xc4cc('0x4b')],qs['fields'](_0x2acaf4[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x1449fd['attributes']=_0x1449fd['attributes'][_0xc4cc('0x69')]?_0x1449fd[_0xc4cc('0x52')]:_0x3f49f1[_0xc4cc('0x4b')];if(!_0x2acaf4['query']['hasOwnProperty'](_0xc4cc('0x55'))){_0x1449fd[_0xc4cc('0x31')]=qs[_0xc4cc('0x31')](_0x2acaf4[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x1449fd[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x2acaf4['query'][_0xc4cc('0x30')]);}_0x1449fd['order']=qs['sort'](_0x2acaf4[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x1449fd[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x2acaf4[_0xc4cc('0x4f')],_0x3f49f1[_0xc4cc('0x50')]));_0x1449fd['where'][_0xc4cc('0xcb')]=_0x2644e5['id'];if(_0x2acaf4['query'][_0xc4cc('0x40')]){_0x1449fd[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x1449fd[_0xc4cc('0x58')],{'$or':_['map'](_0x1449fd[_0xc4cc('0x52')],function(_0x4129c6){var _0xa7886b={};_0xa7886b[_0x4129c6]={'$like':'%'+_0x2acaf4[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0xa7886b;})});}_0x1449fd=_[_0xc4cc('0x61')]({},_0x1449fd,_0x2acaf4['options']);return db['MailInteraction'][_0xc4cc('0x2f')]({'where':_0x1449fd[_0xc4cc('0x58')]})[_0xc4cc('0x38')](function(_0x31848c){_0x360fb8[_0xc4cc('0x2f')]=_0x31848c;if(_0x2acaf4[_0xc4cc('0x4f')][_0xc4cc('0x63')]){_0x1449fd[_0xc4cc('0x64')]=[{'all':!![]}];}return db[_0xc4cc('0xd4')][_0xc4cc('0x65')](_0x1449fd);})[_0xc4cc('0x38')](function(_0x3513c3){_0x360fb8[_0xc4cc('0x66')]=_0x3513c3;return _0x360fb8;});}})[_0xc4cc('0x38')](respondWithFilteredResult(_0x4add33,_0x1449fd))[_0xc4cc('0x2a')](handleError(_0x4add33,null));};exports['getSmsInteractions']=function(_0x58a59c,_0xa5a727,_0x4295e0){var _0x32afd9={};var _0x3fadd3={};var _0x5c7793;var _0x391911;return db['User'][_0xc4cc('0x9b')]({'where':{'id':_0x58a59c['params']['id']}})['then'](handleEntityNotFound(_0xa5a727,null))[_0xc4cc('0x38')](function(_0x3bd970){if(_0x3bd970){_0x5c7793=_0x3bd970;_0x3fadd3['model']=_[_0xc4cc('0x4d')](db[_0xc4cc('0xd5')]['rawAttributes']);_0x3fadd3[_0xc4cc('0x4f')]=_['keys'](_0x58a59c['query']);_0x3fadd3[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0x3fadd3[_0xc4cc('0x4b')],_0x3fadd3[_0xc4cc('0x4f')]);_0x32afd9['attributes']=_[_0xc4cc('0x51')](_0x3fadd3[_0xc4cc('0x4b')],qs['fields'](_0x58a59c[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x32afd9['attributes']=_0x32afd9[_0xc4cc('0x52')][_0xc4cc('0x69')]?_0x32afd9['attributes']:_0x3fadd3[_0xc4cc('0x4b')];_0x32afd9[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x58a59c[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x32afd9[_0xc4cc('0x58')]=qs['filters'](_[_0xc4cc('0x59')](_0x58a59c[_0xc4cc('0x4f')],_0x3fadd3['filters']));if(_0x58a59c[_0xc4cc('0x4f')][_0xc4cc('0x40')]){_0x32afd9[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x32afd9[_0xc4cc('0x58')],{'$or':_['map'](_0x32afd9[_0xc4cc('0x52')],function(_0x2d41f2){var _0x458bf4={};_0x458bf4[_0x2d41f2]={'$like':'%'+_0x58a59c[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0x458bf4;})});}_0x32afd9=_[_0xc4cc('0x61')]({},_0x32afd9,_0x58a59c[_0xc4cc('0x62')]);return _0x5c7793[_0xc4cc('0xd6')](_0x32afd9);}})[_0xc4cc('0x38')](function(_0x4b687a){if(_0x4b687a){_0x391911=_0x4b687a[_0xc4cc('0x69')];if(!_0x58a59c['query'][_0xc4cc('0x54')]('nolimit')){_0x32afd9['limit']=qs[_0xc4cc('0x31')](_0x58a59c[_0xc4cc('0x4f')]['limit']);_0x32afd9[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x58a59c['query']['offset']);}return _0x5c7793['getSmsInteractions'](_0x32afd9);}})[_0xc4cc('0x38')](function(_0x52872f){if(_0x52872f){return _0x52872f?{'count':_0x391911,'rows':_0x52872f}:null;}})[_0xc4cc('0x38')](respondWithResult(_0xa5a727,null))[_0xc4cc('0x2a')](handleError(_0xa5a727,null));};exports[_0xc4cc('0xd7')]=function(_0x3b2bc1,_0x3b1e26,_0x54960c){var _0x46fccf={};var _0xa52a09={};var _0x1b6176;var _0x21f2b7;return db[_0xc4cc('0x4a')][_0xc4cc('0x9b')]({'where':{'id':_0x3b2bc1[_0xc4cc('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3b1e26,null))[_0xc4cc('0x38')](function(_0x31adff){if(_0x31adff){_0x1b6176=_0x31adff;_0xa52a09[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db['FaxInteraction']['rawAttributes']);_0xa52a09[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x3b2bc1[_0xc4cc('0x4f')]);_0xa52a09[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0xa52a09[_0xc4cc('0x4b')],_0xa52a09[_0xc4cc('0x4f')]);_0x46fccf[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0xa52a09[_0xc4cc('0x4b')],qs[_0xc4cc('0x53')](_0x3b2bc1[_0xc4cc('0x4f')]['fields']));_0x46fccf[_0xc4cc('0x52')]=_0x46fccf[_0xc4cc('0x52')][_0xc4cc('0x69')]?_0x46fccf[_0xc4cc('0x52')]:_0xa52a09[_0xc4cc('0x4b')];_0x46fccf[_0xc4cc('0x56')]=qs['sort'](_0x3b2bc1[_0xc4cc('0x4f')]['sort']);_0x46fccf['where']=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x3b2bc1['query'],_0xa52a09[_0xc4cc('0x50')]));if(_0x3b2bc1[_0xc4cc('0x4f')]['filter']){_0x46fccf[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x46fccf[_0xc4cc('0x58')],{'$or':_[_0xc4cc('0x41')](_0x46fccf[_0xc4cc('0x52')],function(_0xcb30d){var _0x463ec1={};_0x463ec1[_0xcb30d]={'$like':'%'+_0x3b2bc1[_0xc4cc('0x4f')]['filter']+'%'};return _0x463ec1;})});}_0x46fccf=_[_0xc4cc('0x61')]({},_0x46fccf,_0x3b2bc1[_0xc4cc('0x62')]);return _0x1b6176['getFaxInteractions'](_0x46fccf);}})[_0xc4cc('0x38')](function(_0x59d673){if(_0x59d673){_0x21f2b7=_0x59d673[_0xc4cc('0x69')];if(!_0x3b2bc1[_0xc4cc('0x4f')][_0xc4cc('0x54')]('nolimit')){_0x46fccf[_0xc4cc('0x31')]=qs[_0xc4cc('0x31')](_0x3b2bc1[_0xc4cc('0x4f')]['limit']);_0x46fccf[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x3b2bc1['query'][_0xc4cc('0x30')]);}return _0x1b6176[_0xc4cc('0xd7')](_0x46fccf);}})[_0xc4cc('0x38')](function(_0x2fab3a){if(_0x2fab3a){return _0x2fab3a?{'count':_0x21f2b7,'rows':_0x2fab3a}:null;}})[_0xc4cc('0x38')](respondWithResult(_0x3b1e26,null))[_0xc4cc('0x2a')](handleError(_0x3b1e26,null));};exports[_0xc4cc('0xd8')]=function(_0x3e6664,_0x28fd9e,_0x3d47da){var _0x5baf27;var _0x2a89e8;var _0x4ca29f;var _0x345fec=!_[_0xc4cc('0x75')](_0x3e6664['params']['id'])?_0x3e6664[_0xc4cc('0x6c')]['id']:!_[_0xc4cc('0x75')](_0x3e6664[_0xc4cc('0x3b')]['id'])?_0x3e6664[_0xc4cc('0x3b')]['id']:null;return db[_0xc4cc('0x4a')]['find']({'where':{'id':_0x345fec,'role':'agent'},'attributes':['id',_0xc4cc('0x45'),_0xc4cc('0xd9'),_0xc4cc('0xda'),'role','internal',_0xc4cc('0x9f')]})[_0xc4cc('0x38')](handleEntityNotFound(_0x28fd9e,null))['then'](function(_0x2ce937){if(_0x2ce937){_0x5baf27=_0x2ce937;if(_0x3e6664[_0xc4cc('0x6b')][_0xc4cc('0xa1')]){_0x4ca29f=util[_0xc4cc('0x77')](_0xc4cc('0xdb'),_0x5baf27[_0x3e6664[_0xc4cc('0x6b')][_0xc4cc('0xa1')]]);}else if(_0x3e6664['body']['intrf']){_0x4ca29f=util[_0xc4cc('0x77')](_0xc4cc('0xac'),_0x3e6664['body'][_0xc4cc('0xdc')]);}else{_0x4ca29f=util[_0xc4cc('0x77')](_0xc4cc('0xac'),_0x5baf27[_0xc4cc('0x45')]);}socket['to'](util[_0xc4cc('0x77')](_0xc4cc('0xdd'),_0x5baf27['name']))[_0xc4cc('0xb2')](_0xc4cc('0xde'),{'ip':_0x3e6664['headers']['x-forwarded-for']||_0x3e6664[_0xc4cc('0xdf')][_0xc4cc('0xe0')]||_0x3e6664['socket'][_0xc4cc('0xe0')]||_0x3e6664[_0xc4cc('0xdf')][_0xc4cc('0xe1')][_0xc4cc('0xe0')]});return db['UserVoiceQueueRt'][_0xc4cc('0x39')]({'where':{'membername':_0x5baf27[_0xc4cc('0x45')]},'individualHooks':!![]});}})['then'](function(_0x20ed7b){if(_0x5baf27){return _0x5baf27[_0xc4cc('0xe2')]({'raw':!![]});}})[_0xc4cc('0x38')](function(_0x153af2){var _0x4a9c07=[];if(_0x153af2){_0x2a89e8=_0x153af2;if(_0x2a89e8[_0xc4cc('0x69')]){for(var _0x481e71=0x0;_0x481e71<_0x2a89e8[_0xc4cc('0x69')];_0x481e71++){_0x4a9c07[_0xc4cc('0xab')]({'membername':_0x5baf27[_0xc4cc('0x45')],'UserId':_0x5baf27['id'],'queue_name':_0x2a89e8[_0x481e71][_0xc4cc('0x45')],'VoiceQueueId':_0x2a89e8[_0x481e71]['id'],'interface':_0x4ca29f,'paused':_0x5baf27[_0xc4cc('0x9f')]||![],'penalty':_0x2a89e8[_0x481e71][_0xc4cc('0xe3')]||0x0});}return BPromise['each'](_0x4a9c07,function(_0x3807a4){return db[_0xc4cc('0xae')][_0xc4cc('0xe4')](_0x3807a4);});}}})['then'](function(){return db[_0xc4cc('0xe5')][_0xc4cc('0x65')]({'where':{'membername':_0x5baf27[_0xc4cc('0x45')],'exitAt':null}});})[_0xc4cc('0x38')](function(_0x5bdcc2){var _0x46c4f8=[];_0x5bdcc2[_0xc4cc('0xe6')](function(_0x1918f8){_0x46c4f8['push'](_0x1918f8[_0xc4cc('0x37')]({'exitAt':moment()[_0xc4cc('0x77')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc4cc('0xe7')](_0x46c4f8);})['then'](function(){var _0x18a27a=[];var _0xd47109=[];var _0x305894=utils[_0xc4cc('0xe8')]();var _0x3f2387={'membername':_0x5baf27[_0xc4cc('0x45')],'interface':_0x4ca29f,'enterAt':moment()[_0xc4cc('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5baf27[_0xc4cc('0x43')],'internal':_0x5baf27[_0xc4cc('0x7a')]};_0x305894[_0xc4cc('0xe6')](function(_0x2794d1){_0x18a27a['push'](_[_0xc4cc('0x61')]({'channel':_0x2794d1,'type':_0xc4cc('0xe9'),'data1':_0x3e6664[_0xc4cc('0x6b')][_0xc4cc('0xea')],'data2':_0x4ca29f},_0x3f2387));if(_0x5baf27[_0xc4cc('0x9f')]){_0xd47109[_0xc4cc('0xab')](_[_0xc4cc('0x61')]({'channel':_0x2794d1,'type':_0xc4cc('0xeb'),'data1':_0xc4cc('0xec')},_0x3f2387));}});return db['MemberReport'][_0xc4cc('0x6a')](_0x18a27a[_0xc4cc('0xed')](_0xd47109),{'individualHooks':!![]});})[_0xc4cc('0x38')](function(){return _0x5baf27['update']({'online':!![],'lastLoginAt':moment()['format'](_0xc4cc('0xee')),'voicePause':_0x5baf27['loginInPause']||![],'mailPause':_0x5baf27[_0xc4cc('0x9f')]||![],'chatPause':_0x5baf27[_0xc4cc('0x9f')]||![],'faxPause':_0x5baf27['loginInPause']||![],'smsPause':_0x5baf27['loginInPause']||![],'openchannelPause':_0x5baf27['loginInPause']||![],'pauseType':_0x5baf27[_0xc4cc('0x9f')]?'LOGININPAUSE':null,'interface':_0x4ca29f,'lastPauseAt':moment()[_0xc4cc('0x77')](_0xc4cc('0xee'))});})[_0xc4cc('0x38')](function(_0x4a49ea){if(_0x3e6664[_0xc4cc('0xef')]){return _0x3d47da();}else{return BPromise[_0xc4cc('0xf0')](_0x4a49ea)[_0xc4cc('0x38')](respondWithResult(_0x28fd9e,null));}})['catch'](handleError(_0x28fd9e,null));};exports['logout']=function(_0x1386a1,_0x4bb44b,_0x487b34){var _0x2488b2;return db[_0xc4cc('0x4a')]['find']({'where':{'id':_0x1386a1['params']['id'],'role':_0xc4cc('0x3d')},'attributes':['id',_0xc4cc('0x45'),_0xc4cc('0x43')]})['then'](handleEntityNotFound(_0x4bb44b,null))[_0xc4cc('0x38')](function(_0x3856f0){if(_0x3856f0){_0x2488b2=_0x3856f0;return db['UserVoiceQueueRt'][_0xc4cc('0x39')]({'where':{'membername':_0x2488b2['name']},'individualHooks':!![]});}})[_0xc4cc('0x38')](function(){return db[_0xc4cc('0xe5')]['findAll']({'where':{'membername':_0x2488b2['name'],'exitAt':null}});})[_0xc4cc('0x38')](function(_0x2ced48){var _0x283a07=[];_0x2ced48['forEach'](function(_0x43cd42){_0x283a07[_0xc4cc('0xab')](_0x43cd42[_0xc4cc('0x37')]({'exitAt':moment()[_0xc4cc('0x77')](_0xc4cc('0xee'))}));});return BPromise[_0xc4cc('0xe7')](_0x283a07);})[_0xc4cc('0x38')](function(){return _0x2488b2[_0xc4cc('0x37')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xc4cc('0x38')](respondWithResult(_0x4bb44b,null))[_0xc4cc('0x2a')](handleError(_0x4bb44b,null));};exports[_0xc4cc('0xf1')]=function(_0x1368d7,_0x5708db,_0x18f309){var _0xdf5082;return db['UserVoiceQueueRt'][_0xc4cc('0x37')]({'paused':0x1},{'where':{'UserId':_0x1368d7[_0xc4cc('0x6c')]['id']},'individualHooks':!![]})[_0xc4cc('0x38')](function(){return db[_0xc4cc('0x4a')][_0xc4cc('0x44')]({'where':{'id':_0x1368d7[_0xc4cc('0x6c')]['id'],'role':_0xc4cc('0x3d')},'attributes':['id',_0xc4cc('0x45'),_0xc4cc('0x43'),'internal','interface']});})['then'](handleEntityNotFound(_0x5708db,null))[_0xc4cc('0x38')](function(_0x1d7343){if(_0x1d7343){_0xdf5082=_0x1d7343;return respondWithRpcPromise(_0xc4cc('0xf2'),_0xc4cc('0xf1'),{'id':_0xdf5082['id'],'name':_0xdf5082[_0xc4cc('0x45')],'pause':!![]});}})[_0xc4cc('0x38')](function(){if(_0xdf5082){return db[_0xc4cc('0xe5')]['findAll']({'where':{'membername':_0xdf5082[_0xc4cc('0x45')],'type':_0xc4cc('0xeb'),'exitAt':null}});}})[_0xc4cc('0x38')](function(_0x47c159){if(_0x47c159[_0xc4cc('0x69')]){var _0x3f3287=moment()[_0xc4cc('0x77')](_0xc4cc('0xee'));for(var _0x118244=0x0,_0x3d3138=_0x47c159[_0xc4cc('0x69')];_0x118244<_0x3d3138;_0x118244++){_0x47c159[_0x118244][_0xc4cc('0xf3')]({'exitAt':_0x3f3287});}}})[_0xc4cc('0x38')](function(){var _0x462cd3=[];var _0x3e4ccc=utils['getChannels']();_0x3e4ccc['forEach'](function(_0x2c068e){_0x462cd3[_0xc4cc('0xab')]({'channel':_0x2c068e,'membername':_0xdf5082[_0xc4cc('0x45')],'interface':_[_0xc4cc('0x75')](_0xdf5082['interface'])?util[_0xc4cc('0x77')](_0xc4cc('0xac'),_0xdf5082[_0xc4cc('0x45')]):_0xdf5082['interface'],'type':'PAUSE','enterAt':moment()[_0xc4cc('0x77')](_0xc4cc('0xee')),'data1':_0x1368d7['body'][_0xc4cc('0x5a')]||_0xc4cc('0xf4'),'role':_0xdf5082[_0xc4cc('0x43')],'internal':_0xdf5082['internal']});});return db[_0xc4cc('0xe5')][_0xc4cc('0x6a')](_0x462cd3,{'individualHooks':!![]});})[_0xc4cc('0x38')](function(){return _0xdf5082['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1368d7[_0xc4cc('0x6b')][_0xc4cc('0x5a')]||_0xc4cc('0xf4'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xc4cc('0x38')](respondWithResult(_0x5708db,null))['catch'](handleError(_0x5708db,null));};exports[_0xc4cc('0xf5')]=function(_0x7390fd,_0x572228,_0x2e54c5){var _0x329716;return db['User'][_0xc4cc('0x44')]({'where':{'id':_0x7390fd[_0xc4cc('0x6c')]['id']},'attributes':['id','name',_0xc4cc('0x43'),_0xc4cc('0xa0'),_0xc4cc('0xf6'),_0xc4cc('0xf7'),_0xc4cc('0xf8'),_0xc4cc('0xf9'),_0xc4cc('0xfa'),_0xc4cc('0xfb'),_0xc4cc('0xfc')]})[_0xc4cc('0x38')](handleEntityNotFound(_0x572228,null))['then'](function(_0x2af063){if(_0x2af063){_0x329716=_0x2af063;if(_0x7390fd[_0xc4cc('0x6b')][_0xc4cc('0x9d')]&&!utils['isValidChannel'](_0x7390fd[_0xc4cc('0x6b')][_0xc4cc('0x9d')])){throw new db[(_0xc4cc('0x94'))][(_0xc4cc('0x97'))](_0xc4cc('0xa2'));}switch(_0x7390fd['body']['channel']){case'voice':return respondWithRpcPromise('QueuePause',_0xc4cc('0xf5'),{'id':_0x329716['id'],'name':_0x329716[_0xc4cc('0x45')],'pause':![]})['then'](function(){return db[_0xc4cc('0xae')]['update']({'paused':0x0},{'where':{'UserId':_0x329716['id']},'individualHooks':!![]});})['then'](function(){return db[_0xc4cc('0xe5')][_0xc4cc('0x44')]({'where':{'channel':_0x7390fd[_0xc4cc('0x6b')][_0xc4cc('0x9d')],'membername':_0x329716[_0xc4cc('0x45')],'type':'PAUSE','exitAt':null}});})[_0xc4cc('0x38')](function(_0x1fe47a){if(_0x1fe47a){return _0x1fe47a['update']({'exitAt':moment()[_0xc4cc('0x77')](_0xc4cc('0xee')),'data2':_0xc4cc('0xfd')},{'individualHooks':!![]});}return null;})[_0xc4cc('0x38')](function(){return _0x329716[_0xc4cc('0x37')]({'voicePause':![]});});case _0xc4cc('0xfe'):case _0xc4cc('0xff'):case _0xc4cc('0x100'):case _0xc4cc('0x101'):case'openchannel':return db[_0xc4cc('0xe5')][_0xc4cc('0x44')]({'where':{'channel':_0x7390fd[_0xc4cc('0x6b')][_0xc4cc('0x9d')],'membername':_0x329716['name'],'type':'PAUSE','exitAt':null}})[_0xc4cc('0x38')](function(_0x4d6e5f){if(_0x4d6e5f){return _0x4d6e5f['update']({'exitAt':moment()['format'](_0xc4cc('0xee')),'data2':_0xc4cc('0xfd')},{'individualHooks':!![]});}return null;})[_0xc4cc('0x38')](function(){var _0x4413d4={};_[_0xc4cc('0x32')](_0x4413d4,util[_0xc4cc('0x77')](_0xc4cc('0x102'),_0x7390fd[_0xc4cc('0x6b')]['channel'],_0xc4cc('0x103')),![]);return _0x329716[_0xc4cc('0x37')](_0x4413d4);});default:return respondWithRpcPromise(_0xc4cc('0xf2'),_0xc4cc('0xf5'),{'id':_0x329716['id'],'name':_0x329716['name'],'pause':![]})[_0xc4cc('0x38')](function(){return db[_0xc4cc('0xae')][_0xc4cc('0x37')]({'paused':0x0},{'where':{'UserId':_0x329716['id']}});})['then'](function(){return db[_0xc4cc('0xe5')][_0xc4cc('0x65')]({'where':{'membername':_0x329716[_0xc4cc('0x45')],'type':_0xc4cc('0xeb'),'exitAt':null}});})['then'](function(_0x97f68b){var _0x21f1dd=[];_0x97f68b['forEach'](function(_0xeacdff){_0x21f1dd['push'](_0xeacdff[_0xc4cc('0x37')]({'exitAt':moment()[_0xc4cc('0x77')](_0xc4cc('0xee')),'data2':_0xc4cc('0xfd')}));});return BPromise['all'](_0x21f1dd);})[_0xc4cc('0x38')](function(){return _0x329716[_0xc4cc('0x37')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xc4cc('0x38')](respondWithResult(_0x572228,null))[_0xc4cc('0x2a')](handleError(_0x572228,null));};exports[_0xc4cc('0x104')]=function(_0x3d1bc9,_0x58a4c5,_0x47da2c){var _0x24de10={};var _0x926c84={};var _0x35f29b;var _0x4c5e26;return db[_0xc4cc('0x4a')][_0xc4cc('0x9b')]({'where':{'id':_0x3d1bc9[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x58a4c5,null))[_0xc4cc('0x38')](function(_0x2f72d2){if(_0x2f72d2){_0x35f29b=_0x2f72d2;_0x926c84[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db['Team'][_0xc4cc('0xbe')]);_0x926c84['query']=_[_0xc4cc('0x4d')](_0x3d1bc9[_0xc4cc('0x4f')]);_0x926c84[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0x926c84[_0xc4cc('0x4b')],_0x926c84[_0xc4cc('0x4f')]);_0x24de10[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x926c84['model'],qs[_0xc4cc('0x53')](_0x3d1bc9[_0xc4cc('0x4f')][_0xc4cc('0x53')]));_0x24de10[_0xc4cc('0x52')]=_0x24de10[_0xc4cc('0x52')][_0xc4cc('0x69')]?_0x24de10[_0xc4cc('0x52')]:_0x926c84[_0xc4cc('0x4b')];_0x24de10[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x3d1bc9['query']['sort']);_0x24de10[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x3d1bc9['query'],_0x926c84['filters']));if(_0x3d1bc9[_0xc4cc('0x4f')]['filter']){_0x24de10['where']=_['merge'](_0x24de10[_0xc4cc('0x58')],{'$or':_[_0xc4cc('0x41')](_0x24de10[_0xc4cc('0x52')],function(_0xb151a3){var _0x2677cb={};_0x2677cb[_0xb151a3]={'$like':'%'+_0x3d1bc9[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0x2677cb;})});}_0x24de10=_['merge']({},_0x24de10,_0x3d1bc9[_0xc4cc('0x62')]);return _0x35f29b[_0xc4cc('0x104')](_0x24de10);}})['then'](function(_0x42dba6){if(_0x42dba6){_0x4c5e26=_0x42dba6[_0xc4cc('0x69')];if(!_0x3d1bc9['query'][_0xc4cc('0x54')](_0xc4cc('0x55'))){_0x24de10[_0xc4cc('0x31')]=qs[_0xc4cc('0x31')](_0x3d1bc9[_0xc4cc('0x4f')][_0xc4cc('0x31')]);_0x24de10[_0xc4cc('0x30')]=qs['offset'](_0x3d1bc9[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}return _0x35f29b[_0xc4cc('0x104')](_0x24de10);}})['then'](function(_0x9b98ad){if(_0x9b98ad){return _0x9b98ad?{'count':_0x4c5e26,'rows':_0x9b98ad}:null;}})[_0xc4cc('0x38')](respondWithResult(_0x58a4c5,null))[_0xc4cc('0x2a')](handleError(_0x58a4c5,null));};exports[_0xc4cc('0x105')]=function(_0x52be55,_0x55ed66,_0xc6ea0b){return db['User'][_0xc4cc('0x44')]({'where':{'id':_0x52be55['params']['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x55ed66,null))['then'](function(_0xdc5eba){if(_0xdc5eba){return _0xdc5eba[_0xc4cc('0x105')](_0x52be55['body'][_0xc4cc('0x6f')],_[_0xc4cc('0x70')](_0x52be55[_0xc4cc('0x6b')],[_0xc4cc('0x6f'),'id'])||{});}})[_0xc4cc('0x38')](respondWithResult(_0x55ed66,null))[_0xc4cc('0x2a')](handleError(_0x55ed66,null));};exports[_0xc4cc('0x106')]=function(_0x37a847,_0x5c46f9,_0x1412b2){return db['User'][_0xc4cc('0x44')]({'where':{'id':_0x37a847[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x5c46f9,null))[_0xc4cc('0x38')](function(_0x468d76){if(_0x468d76){return _0x468d76['removeTeams'](_0x37a847[_0xc4cc('0x4f')][_0xc4cc('0x6f')]);}})['then'](respondWithStatusCode(_0x5c46f9,null))[_0xc4cc('0x2a')](handleError(_0x5c46f9,null));};exports[_0xc4cc('0x107')]=function(_0x56e242,_0x1ce93b,_0x384e9a){var _0x481283={};var _0x2734be={};var _0x507621;var _0x44e0b2;return db[_0xc4cc('0x4a')][_0xc4cc('0x9b')]({'where':{'id':_0x56e242[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0x1ce93b,null))[_0xc4cc('0x38')](function(_0x532580){if(_0x532580){_0x507621=_0x532580;_0x2734be[_0xc4cc('0x4b')]=_[_0xc4cc('0x4d')](db['CmList'][_0xc4cc('0xbe')]);_0x2734be[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x56e242[_0xc4cc('0x4f')]);_0x2734be[_0xc4cc('0x50')]=_[_0xc4cc('0x51')](_0x2734be['model'],_0x2734be[_0xc4cc('0x4f')]);_0x481283['attributes']=_['intersection'](_0x2734be['model'],qs[_0xc4cc('0x53')](_0x56e242['query'][_0xc4cc('0x53')]));_0x481283[_0xc4cc('0x52')]=_0x481283[_0xc4cc('0x52')]['length']?_0x481283[_0xc4cc('0x52')]:_0x2734be[_0xc4cc('0x4b')];_0x481283[_0xc4cc('0x56')]=qs[_0xc4cc('0x57')](_0x56e242[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x481283[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_['pick'](_0x56e242[_0xc4cc('0x4f')],_0x2734be[_0xc4cc('0x50')]));if(_0x56e242[_0xc4cc('0x4f')][_0xc4cc('0x40')]){_0x481283[_0xc4cc('0x58')]=_[_0xc4cc('0x61')](_0x481283['where'],{'$or':_[_0xc4cc('0x41')](_0x481283[_0xc4cc('0x52')],function(_0x30e5f6){var _0x2dcc95={};_0x2dcc95[_0x30e5f6]={'$like':'%'+_0x56e242[_0xc4cc('0x4f')]['filter']+'%'};return _0x2dcc95;})});}_0x481283=_[_0xc4cc('0x61')]({},_0x481283,_0x56e242[_0xc4cc('0x62')]);return _0x507621[_0xc4cc('0x107')](_0x481283);}})[_0xc4cc('0x38')](function(_0x53c421){if(_0x53c421){_0x44e0b2=_0x53c421[_0xc4cc('0x69')];if(!_0x56e242[_0xc4cc('0x4f')]['hasOwnProperty']('nolimit')){_0x481283[_0xc4cc('0x31')]=qs[_0xc4cc('0x31')](_0x56e242['query'][_0xc4cc('0x31')]);_0x481283[_0xc4cc('0x30')]=qs[_0xc4cc('0x30')](_0x56e242[_0xc4cc('0x4f')][_0xc4cc('0x30')]);}return _0x507621[_0xc4cc('0x107')](_0x481283);}})[_0xc4cc('0x38')](function(_0x1b0402){if(_0x1b0402){return _0x1b0402?{'count':_0x44e0b2,'rows':_0x1b0402}:null;}})['then'](respondWithResult(_0x1ce93b,null))[_0xc4cc('0x2a')](handleError(_0x1ce93b,null));};exports[_0xc4cc('0x108')]=function(_0x4fa7d2,_0xc9bbf8,_0x28672b){var _0x550a29={};var _0x30c6c5={};var _0x3b67ef;var _0x4aab72;return db[_0xc4cc('0x4a')][_0xc4cc('0x9b')]({'where':{'id':_0x4fa7d2[_0xc4cc('0x6c')]['id']}})[_0xc4cc('0x38')](handleEntityNotFound(_0xc9bbf8,null))['then'](function(_0x3457a4){if(_0x3457a4){_0x3b67ef=_0x3457a4;_0x30c6c5['model']=_[_0xc4cc('0x4d')](db[_0xc4cc('0x4a')][_0xc4cc('0xbe')]);_0x30c6c5[_0xc4cc('0x4f')]=_[_0xc4cc('0x4d')](_0x4fa7d2['query']);_0x30c6c5[_0xc4cc('0x50')]=_['intersection'](_0x30c6c5['model'],_0x30c6c5[_0xc4cc('0x4f')]);_0x550a29[_0xc4cc('0x52')]=_[_0xc4cc('0x51')](_0x30c6c5['model'],qs['fields'](_0x4fa7d2[_0xc4cc('0x4f')]['fields']));_0x550a29[_0xc4cc('0x52')]=_0x550a29[_0xc4cc('0x52')]['length']?_0x550a29['attributes']:_0x30c6c5[_0xc4cc('0x4b')];_0x550a29[_0xc4cc('0x56')]=qs['sort'](_0x4fa7d2[_0xc4cc('0x4f')][_0xc4cc('0x57')]);_0x550a29[_0xc4cc('0x58')]=qs[_0xc4cc('0x50')](_[_0xc4cc('0x59')](_0x4fa7d2[_0xc4cc('0x4f')],_0x30c6c5[_0xc4cc('0x50')]));if(_0x4fa7d2['query'][_0xc4cc('0x40')]){_0x550a29[_0xc4cc('0x58')]=_['merge'](_0x550a29[_0xc4cc('0x58')],{'$or':_[_0xc4cc('0x41')](_0x550a29[_0xc4cc('0x52')],function(_0xa09570){var _0x6ef8e1={};_0x6ef8e1[_0xa09570]={'$like':'%'+_0x4fa7d2[_0xc4cc('0x4f')][_0xc4cc('0x40')]+'%'};return _0x6ef8e1;})});}_0x550a29[_0xc4cc('0x4b')]=db[_0xc4cc('0x4a')];_0x550a29['as']=_0xc4cc('0x3c');_0x550a29=_[_0xc4cc('0x61')]({},_0x550a29,_0x4fa7d2[_0xc4cc('0x62')]);return _0x3b67ef[_0xc4cc('0xe2')]({'include':[_0x550a29]});}})['then'](function(_0x7cab91){if(_0x7cab91){var _0x273bb2={},_0x55ab3f=[],_0x2803e3=0x0;for(var _0x3da7a9=0x0;_0x3da7a9<_0x7cab91[_0xc4cc('0x69')];_0x3da7a9+=0x1){for(var _0x2f446a=0x0,_0x3d299f;_0x2f446a<_0x7cab91[_0x3da7a9][_0xc4cc('0x3c')][_0xc4cc('0x69')];_0x2f446a+=0x1){_0x3d299f=_0x7cab91[_0x3da7a9][_0xc4cc('0x3c')][_0x2f446a][_0xc4cc('0x8d')]({'plain':!![]});_0x273bb2[_0x3d299f['id']]=_0x3d299f;}}_0x273bb2=_['values'](_0x273bb2);for(var _0x1c179f=qs[_0xc4cc('0x30')](_0x4fa7d2[_0xc4cc('0x4f')][_0xc4cc('0x30')]);_0x1c179f<_0x273bb2['length']&&_0x55ab3f['length']=_0xab589f){_0x850cdf=_0xab589f;_0x69b683=0xc8;}else{_0x69b683=0xce;}_0x3b9664[_0x7d7a('0x2a')](_0x69b683);return _0x3b9664['set'](_0x7d7a('0x30'),_0x341107+'-'+_0x850cdf+'/'+_0xab589f)[_0x7d7a('0x2c')](_0x11d45c);}return null;};}function patchUpdates(_0x4783ac){return function(_0x32d9c5){try{jsonpatch[_0x7d7a('0x31')](_0x32d9c5,_0x4783ac,!![]);}catch(_0x1d1c5c){return BPromise['reject'](_0x1d1c5c);}return _0x32d9c5[_0x7d7a('0x32')]();};}function saveUpdates(_0x233fdd,_0x5c1da9){return function(_0x1c4228){if(_0x1c4228){return _0x1c4228[_0x7d7a('0x33')](_0x233fdd)['then'](function(_0x40e6d8){return _0x40e6d8;});}return null;};}function removeEntity(_0x3e17c1,_0x491087){return function(_0x1f4f71){if(_0x1f4f71){return _0x1f4f71[_0x7d7a('0x34')]()['then'](function(){var _0x1bc7d9=_0x1f4f71[_0x7d7a('0x35')]({'plain':!![]});var _0x5c2307=[{'name':_0x7d7a('0x36'),'value':_0x7d7a('0x37'),'ignore':!![]},{'name':_0x7d7a('0x38'),'value':_0x7d7a('0x39'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0xef3253=_(_0x5c2307)['filter']('ignore')[_0x7d7a('0x3a')](_0x7d7a('0x3b'))[_0x7d7a('0x3b')]();if(_[_0x7d7a('0x3c')](_0xef3253,_0x1bc7d9[_0x7d7a('0x3d')])){return;}var _0x5d8113=_['find'](_0x5c2307,[_0x7d7a('0x3b'),_0x1bc7d9[_0x7d7a('0x3d')]])[_0x7d7a('0x3e')];return db[_0x7d7a('0x3f')][_0x7d7a('0x34')]({'where':{'type':_0x5d8113,'resourceId':_0x1bc7d9['id']}})[_0x7d7a('0x1e')](function(){return _0x1f4f71;});})[_0x7d7a('0x1e')](function(){_0x3e17c1[_0x7d7a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530254,_0x3025ce){return function(_0x5b4b78){if(!_0x5b4b78){_0x530254[_0x7d7a('0x29')](0x194);}return _0x5b4b78;};}function handleError(_0xa98ec6,_0x31a4c6){_0x31a4c6=_0x31a4c6||0x1f4;return function(_0x529e2d){logger[_0x7d7a('0x23')](_0x529e2d['stack']);if(_0x529e2d[_0x7d7a('0x3e')]){delete _0x529e2d[_0x7d7a('0x3e')];}_0xa98ec6[_0x7d7a('0x2a')](_0x31a4c6)[_0x7d7a('0x40')](_0x529e2d);};}exports['index']=function(_0x4c67ba,_0x1422cb){var _0x5353bb={},_0x1e98c7={},_0x506166={'count':0x0,'rows':[]};var _0x359e1d=db['User']['rawAttributes'];_0x1e98c7[_0x7d7a('0x41')]=_[_0x7d7a('0x42')](_['keys'](_0x359e1d),[_0x7d7a('0x43'),'salt']);_0x1e98c7[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x4c67ba[_0x7d7a('0x44')]);_0x1e98c7[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0x1e98c7[_0x7d7a('0x41')],_0x1e98c7[_0x7d7a('0x44')]);_0x5353bb['attributes']=_[_0x7d7a('0x47')](_0x1e98c7[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x4c67ba['query'][_0x7d7a('0x48')]));_0x5353bb[_0x7d7a('0x49')]=_0x5353bb[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x5353bb[_0x7d7a('0x49')]:_0x1e98c7[_0x7d7a('0x41')];if(!_0x4c67ba['query'][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x5353bb['limit']=qs[_0x7d7a('0x2f')](_0x4c67ba[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x5353bb[_0x7d7a('0x2e')]=qs['offset'](_0x4c67ba['query']['offset']);}_0x5353bb[_0x7d7a('0x4d')]=qs[_0x7d7a('0x4e')](_0x4c67ba[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x5353bb[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x4c67ba['query'],_0x1e98c7['filters']));if(_0x4c67ba[_0x7d7a('0x44')][_0x7d7a('0x51')]){_0x5353bb[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x5353bb[_0x7d7a('0x4f')],{'$or':_['map'](_0x359e1d,function(_0x5c4c10){if(_0x5c4c10[_0x7d7a('0x53')][_0x7d7a('0x54')]!==_0x7d7a('0x55')){return db[_0x7d7a('0x56')][_0x7d7a('0x4f')](db[_0x7d7a('0x56')]['fn'](_0x7d7a('0x57'),db['sequelize'][_0x7d7a('0x58')](_0x5c4c10[_0x7d7a('0x59')])),{'$like':db[_0x7d7a('0x56')]['fn'](_0x7d7a('0x57'),'%'+_0x4c67ba[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%')});}})});}_0x5353bb=_[_0x7d7a('0x52')]({},_0x5353bb,_0x4c67ba[_0x7d7a('0x5a')]);var _0x49fa73={'where':_0x5353bb['where']};return db['User']['count'](_0x49fa73)[_0x7d7a('0x1e')](function(_0x506a57){_0x506166[_0x7d7a('0x2d')]=_0x506a57;if(_0x4c67ba['query'][_0x7d7a('0x5b')]){_0x5353bb[_0x7d7a('0x5c')]=[{'all':!![]}];}return db[_0x7d7a('0x5d')][_0x7d7a('0x5e')](_0x5353bb);})[_0x7d7a('0x1e')](function(_0x3da9eb){_0x506166[_0x7d7a('0x5f')]=_0x3da9eb;return _0x506166;})[_0x7d7a('0x1e')](respondWithFilteredResult(_0x1422cb,_0x5353bb))[_0x7d7a('0x28')](handleError(_0x1422cb,null));};exports[_0x7d7a('0x60')]=function(_0x3a900d,_0x1daf9f){var _0x42840c={'raw':![],'where':{'id':_0x3a900d[_0x7d7a('0x61')]['id']}},_0x4e46e2={};_0x4e46e2[_0x7d7a('0x41')]=_[_0x7d7a('0x42')](_[_0x7d7a('0x45')](db['User'][_0x7d7a('0x62')]),[_0x7d7a('0x43'),'salt']);_0x4e46e2['query']=_[_0x7d7a('0x45')](_0x3a900d[_0x7d7a('0x44')]);_0x4e46e2[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0x4e46e2[_0x7d7a('0x41')],_0x4e46e2['query']);_0x42840c['attributes']=_[_0x7d7a('0x47')](_0x4e46e2['model'],qs[_0x7d7a('0x48')](_0x3a900d[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x42840c['attributes']=_0x42840c[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x42840c['attributes']:_0x4e46e2['model'];if(_0x3a900d[_0x7d7a('0x44')][_0x7d7a('0x5b')]){_0x42840c[_0x7d7a('0x5c')]=[{'all':!![]}];}_0x42840c=_[_0x7d7a('0x52')]({},_0x42840c,_0x3a900d['options']);return db[_0x7d7a('0x5d')][_0x7d7a('0x63')](_0x42840c)['then'](handleEntityNotFound(_0x1daf9f,null))[_0x7d7a('0x1e')](respondWithResult(_0x1daf9f,null))[_0x7d7a('0x28')](handleError(_0x1daf9f,null));};exports[_0x7d7a('0x64')]=function(_0x5753ab,_0x190d6f){return db['User']['bulkCreate'](_0x5753ab['body'],{'raw':![],'individualHooks':!![]})[_0x7d7a('0x1e')](respondWithResult(_0x190d6f,0xc9))[_0x7d7a('0x28')](handleError(_0x190d6f,null));};exports[_0x7d7a('0x33')]=function(_0x4e6739,_0x11f027){if(_0x4e6739[_0x7d7a('0x65')]['id']){delete _0x4e6739['body']['id'];}delete _0x4e6739[_0x7d7a('0x65')][_0x7d7a('0x3d')];return db[_0x7d7a('0x5d')]['find']({'where':{'id':_0x4e6739['params']['id']}})['then'](handleEntityNotFound(_0x11f027,null))['then'](saveUpdates(_0x4e6739[_0x7d7a('0x65')],null))[_0x7d7a('0x1e')](respondWithResult(_0x11f027,null))[_0x7d7a('0x28')](handleError(_0x11f027,null));};exports[_0x7d7a('0x66')]=function(_0x48a999,_0x3fcd5c){return db['User'][_0x7d7a('0x66')]()[_0x7d7a('0x1e')](respondWithResult(_0x3fcd5c,null))['catch'](handleError(_0x3fcd5c,null));};exports[_0x7d7a('0x67')]=function(_0x388b8d,_0x2ce60e,_0x1eb62e){return db[_0x7d7a('0x5d')][_0x7d7a('0x63')]({'where':{'id':_0x388b8d[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x2ce60e,null))[_0x7d7a('0x1e')](function(_0x2d99ba){if(_0x2d99ba){return _0x2d99ba['addContacts'](_0x388b8d[_0x7d7a('0x65')]['ids'],_[_0x7d7a('0x68')](_0x388b8d[_0x7d7a('0x65')],[_0x7d7a('0x69'),'id'])||{});}})['then'](respondWithResult(_0x2ce60e,null))[_0x7d7a('0x28')](handleError(_0x2ce60e,null));};var getLicense=function(_0x43e950){return new BPromise(function(_0x712ac5,_0x22c6fe){var _0x380a51=0x0;_0x43e950[_0x7d7a('0x65')][_0x7d7a('0x3d')]==='agent'&&_0x712ac5('agent\x20role');return db[_0x7d7a('0x5d')]['count']({'where':{'$or':[{'role':_0x43e950['body'][_0x7d7a('0x3d')]===_0x7d7a('0x6a')?'telephone':[_0x7d7a('0x6b'),_0x7d7a('0x37')]}]}})[_0x7d7a('0x1e')](function(_0x394988){_0x380a51=_0x394988;return require(_0x7d7a('0x6c'))[_0x7d7a('0x6d')]();})[_0x7d7a('0x1e')](function(_0x6ed5df){var _0x230e96=_0x43e950[_0x7d7a('0x65')]['role']===_0x7d7a('0x6a')?_0x7d7a('0x6e'):'users';if(!_[_0x7d7a('0x6f')](_0x6ed5df[_0x230e96])&&_0x380a51>=_0x6ed5df[_0x230e96]){return _0x22c6fe({'message':'License\x20limit\x20reached'});}return _0x712ac5(util[_0x7d7a('0x70')]('count\x20%s:\x20%s',_0x230e96,_0x380a51));})[_0x7d7a('0x28')](function(_0x1b27eb){return _0x22c6fe(_0x1b27eb);});});};exports['create']=function(_0x23bcf6,_0x33629d){return getLicense(_0x23bcf6)[_0x7d7a('0x1e')](function(_0x2df49e){if(!_0x23bcf6[_0x7d7a('0x65')]['internal']){var _0x459c2e;return db['Setting'][_0x7d7a('0x71')](0x1)['then'](function(_0x10e205){_0x10e205[_0x7d7a('0x72')]=!![];return checkPasswordPattern(_0x10e205,_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x43')],_0x10e205['securePassword']);})[_0x7d7a('0x1e')](function(_0x2c7765){_0x459c2e=_0x2c7765[_0x7d7a('0x73')];return db[_0x7d7a('0x5d')][_0x7d7a('0x74')](_0x7d7a('0x75'));})[_0x7d7a('0x1e')](function(_0x588c5b){if(_[_0x7d7a('0x6f')](_0x588c5b)){if(_0x459c2e){_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x75')]=_0x459c2e;}else{_0x23bcf6['body']['internal']=0x1;}}else{if(_[_0x7d7a('0x6f')](_0x459c2e)||_0x459c2e==_0x588c5b){_0x23bcf6[_0x7d7a('0x65')]['internal']=_0x588c5b+0x1;}else if(_0x459c2e>_0x588c5b){_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x75')]=_0x459c2e;}else{return db[_0x7d7a('0x56')][_0x7d7a('0x44')](_0x7d7a('0x76'),{'type':db[_0x7d7a('0x56')][_0x7d7a('0x77')][_0x7d7a('0x78')]})[_0x7d7a('0x1e')](function(_0x3851d5){if(_0x3851d5&&_0x3851d5[_0x7d7a('0x4a')]){for(var _0x5034fe=0x0,_0x494d11=_0x3851d5[_0x7d7a('0x4a')];_0x5034fe<_0x494d11&&_[_0x7d7a('0x6f')](_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x75')]);_0x5034fe++){if(_0x459c2e<=_0x3851d5[_0x5034fe][_0x7d7a('0x79')]){_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x75')]=_0x3851d5[_0x5034fe][_0x7d7a('0x79')];}else if(_0x459c2e>_0x3851d5[_0x5034fe][_0x7d7a('0x79')]&&_0x459c2e<=_0x3851d5[_0x5034fe]['to']){_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x75')]=_0x459c2e;}}}if(_[_0x7d7a('0x6f')](_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x75')])){_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x75')]=_0x588c5b+0x1;}});}}});}})[_0x7d7a('0x1e')](function(){if(_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x7a')]){_0x23bcf6['body'][_0x7d7a('0x7b')]=_0x23bcf6['body'][_0x7d7a('0x75')];_0x23bcf6['body'][_0x7d7a('0x7c')]={'mailbox':_0x23bcf6[_0x7d7a('0x65')]['internal'],'password':_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x43')],'fullname':_0x23bcf6[_0x7d7a('0x65')]['fullname'],'email':_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x7d')]};}if(_0x23bcf6[_0x7d7a('0x65')]&&_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x3d')]===_0x7d7a('0x39')){_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x7e')]=['101',_0x7d7a('0x7f'),'103',_0x7d7a('0x80'),_0x7d7a('0x81'),_0x7d7a('0x82'),_0x7d7a('0x83'),'107','108','109','100',_0x7d7a('0x84')];}return db[_0x7d7a('0x5d')][_0x7d7a('0x85')](_0x23bcf6['body'],{'include':[{'model':db[_0x7d7a('0x7c')],'as':_0x7d7a('0x7c')}]});})[_0x7d7a('0x1e')](function(_0x11730e){if(_0x23bcf6[_0x7d7a('0x65')][_0x7d7a('0x3d')]==='user')return _0x11730e;var _0x3d8c16=_0x23bcf6['user'][_0x7d7a('0x35')]({'plain':!![]});if(!_0x3d8c16)throw new Error(_0x7d7a('0x86'));if(_0x3d8c16[_0x7d7a('0x3d')]===_0x7d7a('0x37')){var _0x11b6c7=_0x11730e[_0x7d7a('0x35')]({'plain':!![]});var _0x27d003=[{'name':_0x7d7a('0x38'),'value':_0x7d7a('0x39')},{'name':_0x7d7a('0x87'),'value':'telephone'}];var _0x35acad=_['find'](_0x27d003,[_0x7d7a('0x3b'),_0x11b6c7[_0x7d7a('0x3d')]])[_0x7d7a('0x3e')];return db[_0x7d7a('0x88')]['find']({'where':{'name':_0x35acad,'userProfileId':_0x3d8c16[_0x7d7a('0x89')]},'raw':!![]})[_0x7d7a('0x1e')](function(_0x3fea73){if(_0x3fea73&&_0x3fea73[_0x7d7a('0x8a')]===0x0){return db[_0x7d7a('0x3f')][_0x7d7a('0x85')]({'name':_0x11b6c7[_0x7d7a('0x3e')],'resourceId':_0x11b6c7['id'],'type':_0x3fea73[_0x7d7a('0x3e')],'sectionId':_0x3fea73['id']},{})[_0x7d7a('0x1e')](function(){return _0x11730e;});}else{return _0x11730e;}})['catch'](function(_0x3c7c0d){logger[_0x7d7a('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c7c0d);throw _0x3c7c0d;});}return _0x11730e;})[_0x7d7a('0x1e')](respondWithResult(_0x33629d,0xc9))[_0x7d7a('0x28')](handleError(_0x33629d,null));};exports[_0x7d7a('0x8b')]=function(_0x8f13a0,_0x4bc34c,_0x188735){var _0x35c340=![];if(_0x8f13a0['body']['id']){delete _0x8f13a0[_0x7d7a('0x65')]['id'];}if(!_['isNil'](_0x8f13a0[_0x7d7a('0x65')]['oldPassword'])){if(_0x8f13a0[_0x7d7a('0x65')][_0x7d7a('0x8c')]===_0x8f13a0[_0x7d7a('0x65')]['newPassword']){throw new Error(_0x7d7a('0x8d'));}}return db['User']['find']({'where':{'id':_0x8f13a0[_0x7d7a('0x61')]['id']}})['then'](function(_0x4192a3){if(_0x4192a3){if(_0x4192a3['id']==_0x8f13a0['user']['id']){if(!_0x8f13a0[_0x7d7a('0x65')]['oldPassword']||!_0x8f13a0[_0x7d7a('0x65')][_0x7d7a('0x8e')]){throw new db['Sequelize']['ValidationError'](_0x7d7a('0x8f'));}if(!_0x4192a3[_0x7d7a('0x90')](_0x8f13a0[_0x7d7a('0x65')]['oldPassword'])){throw new db[(_0x7d7a('0x91'))]['ValidationError'](_0x7d7a('0x92'));}if(_0x8f13a0[_0x7d7a('0x65')][_0x7d7a('0x8c')]==_0x8f13a0[_0x7d7a('0x65')][_0x7d7a('0x8e')]){throw new db['Sequelize'][(_0x7d7a('0x93'))](_0x7d7a('0x94'));}return _0x4192a3;}else if(_0x8f13a0[_0x7d7a('0x37')][_0x7d7a('0x3d')]==_0x7d7a('0x6b')){if(!_0x8f13a0['body'][_0x7d7a('0x8e')]){throw new db[(_0x7d7a('0x91'))][(_0x7d7a('0x93'))](_0x7d7a('0x95'));}return _0x4192a3;}else if(_0x8f13a0[_0x7d7a('0x37')][_0x7d7a('0x3d')]==_0x7d7a('0x37')){if(!_0x8f13a0[_0x7d7a('0x65')][_0x7d7a('0x8e')]){throw new db[(_0x7d7a('0x91'))][(_0x7d7a('0x93'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x4192a3[_0x7d7a('0x3d')]!=_0x7d7a('0x39')){throw new db[(_0x7d7a('0x91'))][(_0x7d7a('0x93'))](_0x7d7a('0x96'));}return _0x4192a3;}else{throw new db[(_0x7d7a('0x91'))]['ValidationError'](_0x7d7a('0x96'));}}return null;})['then'](handleEntityNotFound(_0x4bc34c,null))[_0x7d7a('0x1e')](function(_0x29a502){return db[_0x7d7a('0x97')][_0x7d7a('0x98')]({'attributes':['id',_0x7d7a('0x72')]})[_0x7d7a('0x1e')](function(_0x507959){_0x35c340=_0x507959[_0x7d7a('0x72')];return checkPasswordPattern(_0x29a502,_0x8f13a0[_0x7d7a('0x65')][_0x7d7a('0x8e')],_0x35c340);});})[_0x7d7a('0x1e')](saveUpdates({'password':_0x8f13a0[_0x7d7a('0x65')][_0x7d7a('0x8e')],'passwordResetAt':_0x8f13a0[_0x7d7a('0x37')]['id']==_0x8f13a0[_0x7d7a('0x61')]['id']?moment():null},null))[_0x7d7a('0x1e')](respondWithResult(_0x4bc34c,null))['catch'](handleError(_0x4bc34c,null));};exports[_0x7d7a('0x99')]=function(_0x3c0530,_0xbced1,_0x15e420){var _0x10f6ed=_0x3c0530[_0x7d7a('0x65')][_0x7d7a('0x9a')];return db['User'][_0x7d7a('0x63')]({'where':{'id':_0x3c0530[_0x7d7a('0x61')]['id']},'attributes':['id',_0x7d7a('0x3e'),'role',_0x7d7a('0x9b'),_0x7d7a('0x9c'),'voicePause','interface']})[_0x7d7a('0x1e')](handleEntityNotFound(_0xbced1,null))['then'](function(_0x2e979f){if(_0x2e979f){if(!utils['isValidChannel'](_0x10f6ed)){throw new db['Sequelize']['ValidationError'](_0x7d7a('0x9d'));}return _0x2e979f[_0x7d7a('0x9e')+_[_0x7d7a('0x9f')](_0x10f6ed[_0x7d7a('0xa0')]())+'Queues'](_0x3c0530[_0x7d7a('0x65')]['ids'],{'penalty':_0x3c0530[_0x7d7a('0x65')]['penalty']||0x0})['spread'](function(_0x528be2){for(var _0x2211d2=0x0;_0x2211d2<_0x3c0530[_0x7d7a('0x65')]['ids'][_0x7d7a('0x4a')];_0x2211d2+=0x1){var _0x5cc62e={'UserId':_0x3c0530['params']['id']};_0x5cc62e[_[_0x7d7a('0x9f')](_0x10f6ed[_0x7d7a('0xa0')]())+_0x7d7a('0xa1')]=_0x3c0530['body'][_0x7d7a('0x69')][_0x2211d2];socket[_0x7d7a('0xa2')](_0x7d7a('0x37')+_[_0x7d7a('0x9f')](_0x10f6ed[_0x7d7a('0xa0')]())+_0x7d7a('0xa3'),_0x5cc62e);}return _0x528be2;})[_0x7d7a('0x1e')](function(){if(_0x10f6ed===_0x7d7a('0xa4')){return db[_0x7d7a('0xa5')][_0x7d7a('0x5e')]({'where':{'id':_0x3c0530[_0x7d7a('0x65')][_0x7d7a('0x69')]||[]},'raw':!![],'attributes':['id',_0x7d7a('0x3e')]});}})['then'](function(_0xe38b4a){var _0x40712e=_0x2e979f[_0x7d7a('0x35')]({'plain':!![]});var _0x5d3d2a=[];if(_0x10f6ed===_0x7d7a('0xa4')&&_0x40712e[_0x7d7a('0x3d')]==='agent'&&_0x40712e['online']){for(var _0x4fd2ef=0x0;_0x4fd2ef<_0xe38b4a[_0x7d7a('0x4a')];_0x4fd2ef+=0x1){_0x5d3d2a[_0x7d7a('0xa6')]({'membername':_0x40712e[_0x7d7a('0x3e')],'UserId':_0x40712e['id'],'queue_name':_0xe38b4a[_0x4fd2ef][_0x7d7a('0x3e')],'VoiceQueueId':_0xe38b4a[_0x4fd2ef]['id'],'interface':_[_0x7d7a('0x6f')](_0x40712e[_0x7d7a('0xa7')])?util['format'](_0x7d7a('0xa8'),_0x40712e['name']):_0x40712e[_0x7d7a('0xa7')],'paused':_0x40712e['voicePause']||![],'penalty':_0x3c0530[_0x7d7a('0x65')]['penalty']||0x0});}return BPromise[_0x7d7a('0xa9')](_0x5d3d2a,function(_0x3b7741){return db[_0x7d7a('0xaa')][_0x7d7a('0xab')](_0x3b7741);});}return _0x2e979f;});}})['then'](respondWithStatusCode(_0xbced1,null))['catch'](handleError(_0xbced1,null));};exports['removeQueues']=function(_0x16ce18,_0x145b9c,_0x2876b5){var _0x684c6d;return db[_0x7d7a('0x5d')][_0x7d7a('0x63')]({'where':{'id':_0x16ce18['params']['id']},'attributes':['id',_0x7d7a('0x3e'),_0x7d7a('0x3d')]})[_0x7d7a('0x1e')](handleEntityNotFound(_0x145b9c,null))[_0x7d7a('0x1e')](function(_0x1d740f){if(_0x1d740f){_0x684c6d=_0x1d740f;if(!_0x16ce18['query'][_0x7d7a('0x9a')]||!utils[_0x7d7a('0xac')](_0x16ce18[_0x7d7a('0x44')][_0x7d7a('0x9a')])){throw new db[(_0x7d7a('0x91'))][(_0x7d7a('0x93'))](_0x7d7a('0x9d'));}return _0x1d740f['remove'+_[_0x7d7a('0x9f')](_0x16ce18['query'][_0x7d7a('0x9a')]['toLowerCase']())+'Queues'](_0x16ce18[_0x7d7a('0x44')][_0x7d7a('0x69')]);}})[_0x7d7a('0x1e')](function(_0x1e20ac){for(var _0x4839cb=0x0;_0x4839cb<_0x16ce18[_0x7d7a('0x44')]['ids'][_0x7d7a('0x4a')];_0x4839cb+=0x1){var _0x38f11e={'UserId':_0x16ce18[_0x7d7a('0x61')]['id']};_0x38f11e[_[_0x7d7a('0x9f')](_0x16ce18[_0x7d7a('0x44')][_0x7d7a('0x9a')]['toLowerCase']())+_0x7d7a('0xa1')]=_0x16ce18[_0x7d7a('0x44')][_0x7d7a('0x69')][_0x4839cb];socket[_0x7d7a('0xa2')](_0x7d7a('0x37')+_['capitalize'](_0x16ce18[_0x7d7a('0x44')][_0x7d7a('0x9a')]['toLowerCase']())+'Queue:remove',_0x38f11e);}return _0x1e20ac;})[_0x7d7a('0x1e')](function(){if(_0x16ce18[_0x7d7a('0x44')]['channel']===_0x7d7a('0xa4')){return db[_0x7d7a('0xaa')][_0x7d7a('0x34')]({'where':{'UserId':_0x16ce18[_0x7d7a('0x61')]['id'],'VoiceQueueId':_0x16ce18[_0x7d7a('0x44')][_0x7d7a('0x69')]},'individualHooks':!![]})[_0x7d7a('0x1e')](function(){return _0x684c6d;});}return _0x684c6d;})['then'](respondWithStatusCode(_0x145b9c,null))[_0x7d7a('0x28')](handleError(_0x145b9c,null));};exports[_0x7d7a('0xad')]=function(_0x4c3cbe,_0x24f12f,_0x215889){_0x4c3cbe[_0x7d7a('0x65')][_0x7d7a('0xae')]=_0x4c3cbe[_0x7d7a('0xaf')][_0x7d7a('0xb0')];return db['User'][_0x7d7a('0x63')]({'where':{'id':_0x4c3cbe[_0x7d7a('0x61')]['id']}})['then'](handleEntityNotFound(_0x24f12f,null))[_0x7d7a('0x1e')](saveUpdates(_0x4c3cbe[_0x7d7a('0x65')],null))['then'](respondWithResult(_0x24f12f,null))[_0x7d7a('0x28')](handleError(_0x24f12f,null));};exports[_0x7d7a('0xb1')]=function(_0x27481d,_0x5ec7be,_0x577287){var _0xf36fbd=path['join'](config[_0x7d7a('0xb2')],_0x7d7a('0xb3'));return db[_0x7d7a('0x5d')][_0x7d7a('0x63')]({'where':{'id':_0x27481d[_0x7d7a('0x61')]['id']},'attributes':['id',_0x7d7a('0xae')],'raw':!![]})[_0x7d7a('0x1e')](handleEntityNotFound(_0x5ec7be,null))[_0x7d7a('0x1e')](function(_0x228cbb){if(_0x228cbb){if(_['isNil'](_0x228cbb[_0x7d7a('0xae')])){return _0x5ec7be[_0x7d7a('0xb4')](_0xf36fbd);}else{if(!fs[_0x7d7a('0xb5')](path['join'](config[_0x7d7a('0xb2')],_0x7d7a('0xb6'),_0x228cbb[_0x7d7a('0xae')]))){return _0x5ec7be['download'](_0xf36fbd);}return _0x5ec7be['download'](path[_0x7d7a('0xb7')](config[_0x7d7a('0xb2')],_0x7d7a('0xb6'),_0x228cbb[_0x7d7a('0xae')]));}}})[_0x7d7a('0x28')](handleError(_0x5ec7be,null));};exports[_0x7d7a('0xb8')]=function(_0x47bbf9,_0x50a43d,_0xc71cf0){var _0x107221={};var _0x581c76={};var _0x310864;var _0x296b86;return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x47bbf9['params']['id']}})['then'](handleEntityNotFound(_0x50a43d,null))[_0x7d7a('0x1e')](function(_0xaf09fd){if(_0xaf09fd){_0x310864=_0xaf09fd;_0x581c76[_0x7d7a('0x41')]=_['keys'](db[_0x7d7a('0xb9')]['rawAttributes']);_0x581c76[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x47bbf9[_0x7d7a('0x44')]);_0x581c76['filters']=_[_0x7d7a('0x47')](_0x581c76[_0x7d7a('0x41')],_0x581c76[_0x7d7a('0x44')]);_0x107221['attributes']=_[_0x7d7a('0x47')](_0x581c76[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x47bbf9[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x107221[_0x7d7a('0x49')]=_0x107221[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x107221[_0x7d7a('0x49')]:_0x581c76[_0x7d7a('0x41')];_0x107221[_0x7d7a('0x4d')]=qs['sort'](_0x47bbf9[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x107221[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x47bbf9[_0x7d7a('0x44')],_0x581c76[_0x7d7a('0x46')]));if(_0x47bbf9[_0x7d7a('0x44')][_0x7d7a('0x51')]){_0x107221[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x107221['where'],{'$or':_[_0x7d7a('0x3a')](_0x107221[_0x7d7a('0x49')],function(_0x29ab71){var _0x45ff4b={};_0x45ff4b[_0x29ab71]={'$like':'%'+_0x47bbf9[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x45ff4b;})});}_0x107221=_[_0x7d7a('0x52')]({},_0x107221,_0x47bbf9[_0x7d7a('0x5a')]);return _0x310864['getContacts'](_0x107221);}})[_0x7d7a('0x1e')](function(_0xfff81b){if(_0xfff81b){_0x296b86=_0xfff81b[_0x7d7a('0x4a')];if(_0x47bbf9['query']['hasOwnProperty'](_0x7d7a('0x5b'))){_0x107221[_0x7d7a('0x5c')]=[{'model':db[_0x7d7a('0xba')],'as':_0x7d7a('0xbb'),'required':![]},{'model':db[_0x7d7a('0xbc')],'as':_0x7d7a('0xbd'),'attributes':['id',_0x7d7a('0x3e'),_0x7d7a('0xbe')],'where':_0x47bbf9['query'][_0x7d7a('0xbf')]?{'id':_0x47bbf9[_0x7d7a('0x44')]['tag']}:undefined,'required':_0x47bbf9[_0x7d7a('0x44')][_0x7d7a('0xbf')]?!![]:![]}];}if(!_0x47bbf9[_0x7d7a('0x44')]['hasOwnProperty'](_0x7d7a('0x4c'))){_0x107221[_0x7d7a('0x2f')]=qs['limit'](_0x47bbf9[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x107221[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x47bbf9['query'][_0x7d7a('0x2e')]);}return _0x310864['getContacts'](_0x107221);}})[_0x7d7a('0x1e')](function(_0x42e679){if(_0x42e679){return _0x42e679?{'count':_0x296b86,'rows':_0x42e679}:null;}})['then'](respondWithResult(_0x50a43d,null))[_0x7d7a('0x28')](handleError(_0x50a43d,null));};exports[_0x7d7a('0xc0')]=function(_0x1526e8,_0x232a0c,_0x34e359){var _0x3ebf03;var _0xb18c02;var _0x5a8c09={};var _0x5c67af;return db['User']['findOne']({'where':{'id':_0x1526e8[_0x7d7a('0x61')]['id']},'attributes':['id','name',_0x7d7a('0x3d')]})['then'](handleEntityNotFound(_0x232a0c,null))[_0x7d7a('0x1e')](function(_0x74bfe0){if(!utils[_0x7d7a('0xac')](_0x1526e8['query'][_0x7d7a('0x9a')])){throw new db[(_0x7d7a('0x91'))][(_0x7d7a('0x93'))](_0x7d7a('0x9d'));}_0x3ebf03=_0x74bfe0;var _0x2e7298={};_0x2e7298[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_[_0x7d7a('0x9f')](_0x1526e8[_0x7d7a('0x44')][_0x7d7a('0x9a')])+_0x7d7a('0xc1')][_0x7d7a('0x62')]);_0x2e7298['query']=_['keys'](_0x1526e8[_0x7d7a('0x44')]);_0x2e7298[_0x7d7a('0x46')]=_['intersection'](_0x2e7298[_0x7d7a('0x41')],_0x2e7298[_0x7d7a('0x44')]);_0x5a8c09['attributes']=_[_0x7d7a('0x47')](_0x2e7298[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x1526e8['query']['fields']));_0x5a8c09[_0x7d7a('0x49')]=_0x5a8c09[_0x7d7a('0x49')]['length']?_0x5a8c09[_0x7d7a('0x49')]:_0x2e7298[_0x7d7a('0x41')];_0x5a8c09[_0x7d7a('0x4d')]=qs[_0x7d7a('0x4e')](_0x1526e8[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x5a8c09[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x1526e8[_0x7d7a('0x44')],_0x2e7298[_0x7d7a('0x46')]));if(_0x1526e8[_0x7d7a('0x44')]['filter']){_0x5a8c09[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x5a8c09[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x5a8c09[_0x7d7a('0x49')],function(_0x3842e1){var _0x49837f={};_0x49837f[_0x3842e1]={'$like':'%'+_0x1526e8[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x49837f;})});}_0x5a8c09=_[_0x7d7a('0x52')]({},_0x5a8c09,_0x1526e8[_0x7d7a('0x5a')]);switch(_0x3ebf03[_0x7d7a('0x3d')]){case _0x7d7a('0x6b'):return db[_[_0x7d7a('0x9f')](_0x1526e8[_0x7d7a('0x44')][_0x7d7a('0x9a')])+'Queue'][_0x7d7a('0x5e')](_0x5a8c09);case _0x7d7a('0x37'):case _0x7d7a('0x39'):return _0x3ebf03[_0x7d7a('0x35')+_[_0x7d7a('0x9f')](_0x1526e8['query']['channel'])+_0x7d7a('0xc2')](_0x5a8c09);default:throw new db['Sequelize'][(_0x7d7a('0x93'))](_0x7d7a('0xc3'));}})[_0x7d7a('0x1e')](function(_0x1d0f20){_0x5c67af=_0x1d0f20[_0x7d7a('0x4a')];if(!_0x1526e8['query'][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x5a8c09[_0x7d7a('0x2f')]=qs[_0x7d7a('0x2f')](_0x1526e8['query']['limit']);_0x5a8c09[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x1526e8[_0x7d7a('0x44')]['offset']);}switch(_0x3ebf03[_0x7d7a('0x3d')]){case _0x7d7a('0x6b'):return db[_[_0x7d7a('0x9f')](_0x1526e8[_0x7d7a('0x44')]['channel'])+'Queue'][_0x7d7a('0x5e')](_0x5a8c09);case _0x7d7a('0x37'):case _0x7d7a('0x39'):return _0x3ebf03[_0x7d7a('0x35')+_[_0x7d7a('0x9f')](_0x1526e8[_0x7d7a('0x44')][_0x7d7a('0x9a')])+'Queues'](_0x5a8c09);}})[_0x7d7a('0x1e')](function(_0x463413){return{'count':_0x5c67af,'rows':_0x463413};})['then'](respondWithResult(_0x232a0c,null))[_0x7d7a('0x28')](handleError(_0x232a0c,null));};exports[_0x7d7a('0xc4')]=function(_0x58a671,_0x10a393,_0x147632){var _0x2042b0={};var _0x220b54={};var _0x27dc35;var _0xb6e210;return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x58a671[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x10a393,null))[_0x7d7a('0x1e')](function(_0x29aea0){if(_0x29aea0){_0x27dc35=_0x29aea0;_0x220b54[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xaa')][_0x7d7a('0x62')]);_0x220b54[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x58a671[_0x7d7a('0x44')]);_0x220b54['filters']=_[_0x7d7a('0x47')](_0x220b54['model'],_0x220b54[_0x7d7a('0x44')]);_0x2042b0[_0x7d7a('0x49')]=_[_0x7d7a('0x47')](_0x220b54[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x58a671['query'][_0x7d7a('0x48')]));_0x2042b0[_0x7d7a('0x49')]=_0x2042b0[_0x7d7a('0x49')]['length']?_0x2042b0[_0x7d7a('0x49')]:_0x220b54['model'];_0x2042b0[_0x7d7a('0x4d')]=qs['sort'](_0x58a671[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x2042b0[_0x7d7a('0x4f')]=qs['filters'](_[_0x7d7a('0x50')](_0x58a671['query'],_0x220b54[_0x7d7a('0x46')]));if(_0x58a671[_0x7d7a('0x44')][_0x7d7a('0x51')]){_0x2042b0[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x2042b0[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x2042b0[_0x7d7a('0x49')],function(_0x30ee6b){var _0xbc5a51={};_0xbc5a51[_0x30ee6b]={'$like':'%'+_0x58a671[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0xbc5a51;})});}_0x2042b0=_['merge']({},_0x2042b0,_0x58a671[_0x7d7a('0x5a')]);return _0x27dc35[_0x7d7a('0xc4')](_0x2042b0);}})[_0x7d7a('0x1e')](function(_0x564f44){if(_0x564f44){_0xb6e210=_0x564f44[_0x7d7a('0x4a')];if(!_0x58a671[_0x7d7a('0x44')][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x2042b0[_0x7d7a('0x2f')]=qs[_0x7d7a('0x2f')](_0x58a671[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x2042b0[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x58a671[_0x7d7a('0x44')][_0x7d7a('0x2e')]);}return _0x27dc35['getVoiceQueuesRt'](_0x2042b0);}})[_0x7d7a('0x1e')](function(_0x4aaaa8){if(_0x4aaaa8){return _0x4aaaa8?{'count':_0xb6e210,'rows':_0x4aaaa8}:null;}})[_0x7d7a('0x1e')](respondWithResult(_0x10a393,null))[_0x7d7a('0x28')](handleError(_0x10a393,null));};exports['getGroups']=function(_0x47b200,_0x247dbf,_0x3e73be){var _0x39f7a8={};var _0x3962f5={};var _0x245e56;var _0x2f5030;return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x47b200[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x247dbf,null))['then'](function(_0x12113a){if(_0x12113a){_0x245e56=_0x12113a;_0x3962f5[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xc5')][_0x7d7a('0x62')]);_0x3962f5[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x47b200[_0x7d7a('0x44')]);_0x3962f5[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0x3962f5[_0x7d7a('0x41')],_0x3962f5[_0x7d7a('0x44')]);_0x39f7a8[_0x7d7a('0x49')]=_[_0x7d7a('0x47')](_0x3962f5['model'],qs[_0x7d7a('0x48')](_0x47b200[_0x7d7a('0x44')]['fields']));_0x39f7a8['attributes']=_0x39f7a8[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x39f7a8[_0x7d7a('0x49')]:_0x3962f5[_0x7d7a('0x41')];_0x39f7a8[_0x7d7a('0x4d')]=qs['sort'](_0x47b200[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x39f7a8[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x47b200[_0x7d7a('0x44')],_0x3962f5[_0x7d7a('0x46')]));if(_0x47b200[_0x7d7a('0x44')]['filter']){_0x39f7a8[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x39f7a8[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x39f7a8[_0x7d7a('0x49')],function(_0x241b6b){var _0x226470={};_0x226470[_0x241b6b]={'$like':'%'+_0x47b200[_0x7d7a('0x44')]['filter']+'%'};return _0x226470;})});}_0x39f7a8=_['merge']({},_0x39f7a8,_0x47b200[_0x7d7a('0x5a')]);return _0x245e56[_0x7d7a('0xc6')](_0x39f7a8);}})[_0x7d7a('0x1e')](function(_0x2f14b7){if(_0x2f14b7){_0x2f5030=_0x2f14b7[_0x7d7a('0x4a')];if(!_0x47b200[_0x7d7a('0x44')][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x39f7a8[_0x7d7a('0x2f')]=qs['limit'](_0x47b200[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x39f7a8[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x47b200[_0x7d7a('0x44')][_0x7d7a('0x2e')]);}return _0x245e56[_0x7d7a('0xc6')](_0x39f7a8);}})['then'](function(_0x1917ac){if(_0x1917ac){return _0x1917ac?{'count':_0x2f5030,'rows':_0x1917ac}:null;}})['then'](respondWithResult(_0x247dbf,null))[_0x7d7a('0x28')](handleError(_0x247dbf,null));};exports[_0x7d7a('0xc7')]=function(_0x22c618,_0x53108f,_0x20aad5){var _0x562e0c={'raw':!![],'where':{}};var _0xf87e69={};var _0x3d0e4c={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x22c618[_0x7d7a('0x61')]['id']}})['then'](handleEntityNotFound(_0x53108f,null))[_0x7d7a('0x1e')](function(_0x316640){if(_0x316640){_0xf87e69['model']=_[_0x7d7a('0x45')](db['VoiceRecording'][_0x7d7a('0x62')]);_0xf87e69['query']=_[_0x7d7a('0x45')](_0x22c618[_0x7d7a('0x44')]);_0xf87e69[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0xf87e69[_0x7d7a('0x41')],_0xf87e69[_0x7d7a('0x44')]);_0x562e0c[_0x7d7a('0x49')]=_[_0x7d7a('0x47')](_0xf87e69[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x22c618[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x562e0c[_0x7d7a('0x49')]=_0x562e0c[_0x7d7a('0x49')]['length']?_0x562e0c[_0x7d7a('0x49')]:_0xf87e69[_0x7d7a('0x41')];if(!_0x22c618[_0x7d7a('0x44')][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x562e0c['limit']=qs['limit'](_0x22c618[_0x7d7a('0x44')]['limit']);_0x562e0c['offset']=qs[_0x7d7a('0x2e')](_0x22c618[_0x7d7a('0x44')]['offset']);}_0x562e0c[_0x7d7a('0x4d')]=qs[_0x7d7a('0x4e')](_0x22c618[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x562e0c[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x22c618['query'],_0xf87e69['filters']));_0x562e0c[_0x7d7a('0x4f')][_0x7d7a('0xc8')]=_0x316640['id'];if(_0x22c618[_0x7d7a('0x44')]['filter']){_0x562e0c[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x562e0c[_0x7d7a('0x4f')],{'$or':_['map'](_0x562e0c['attributes'],function(_0x495afe){var _0x290fd7={};_0x290fd7[_0x495afe]={'$like':'%'+_0x22c618[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x290fd7;})});}_0x562e0c=_[_0x7d7a('0x52')]({},_0x562e0c,_0x22c618[_0x7d7a('0x5a')]);return db[_0x7d7a('0xc9')][_0x7d7a('0x2d')]({'where':_0x562e0c[_0x7d7a('0x4f')]})[_0x7d7a('0x1e')](function(_0x1ed069){_0x3d0e4c[_0x7d7a('0x2d')]=_0x1ed069;if(_0x22c618[_0x7d7a('0x44')][_0x7d7a('0x5b')]){_0x562e0c['include']=[{'all':!![]}];}return db[_0x7d7a('0xc9')][_0x7d7a('0x5e')](_0x562e0c);})[_0x7d7a('0x1e')](function(_0x2cbef4){_0x3d0e4c[_0x7d7a('0x5f')]=_0x2cbef4;return _0x3d0e4c;});}})[_0x7d7a('0x1e')](respondWithFilteredResult(_0x53108f,_0x562e0c))[_0x7d7a('0x28')](handleError(_0x53108f,null));};exports['getScreenRecordings']=function(_0x48755d,_0x2296a1,_0x5e94d9){var _0x2d71c0={'raw':!![],'where':{}};var _0x36076b={};var _0x50f856={'count':0x0,'rows':[]};return db['User'][_0x7d7a('0x98')]({'where':{'id':_0x48755d[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x2296a1,null))[_0x7d7a('0x1e')](function(_0x441004){if(_0x441004){_0x36076b[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xca')][_0x7d7a('0x62')]);_0x36076b[_0x7d7a('0x44')]=_['keys'](_0x48755d[_0x7d7a('0x44')]);_0x36076b['filters']=_[_0x7d7a('0x47')](_0x36076b[_0x7d7a('0x41')],_0x36076b[_0x7d7a('0x44')]);_0x2d71c0[_0x7d7a('0x49')]=_[_0x7d7a('0x47')](_0x36076b[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x48755d[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x2d71c0['attributes']=_0x2d71c0[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x2d71c0['attributes']:_0x36076b[_0x7d7a('0x41')];if(!_0x48755d[_0x7d7a('0x44')][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x2d71c0[_0x7d7a('0x2f')]=qs[_0x7d7a('0x2f')](_0x48755d[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x2d71c0['offset']=qs[_0x7d7a('0x2e')](_0x48755d[_0x7d7a('0x44')]['offset']);}_0x2d71c0[_0x7d7a('0x4d')]=qs[_0x7d7a('0x4e')](_0x48755d[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x2d71c0[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x48755d['query'],_0x36076b[_0x7d7a('0x46')]));_0x2d71c0[_0x7d7a('0x4f')][_0x7d7a('0xc8')]=_0x441004['id'];if(_0x48755d['query'][_0x7d7a('0x51')]){_0x2d71c0['where']=_[_0x7d7a('0x52')](_0x2d71c0[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x2d71c0[_0x7d7a('0x49')],function(_0x358feb){var _0x338fc={};_0x338fc[_0x358feb]={'$like':'%'+_0x48755d[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x338fc;})});}_0x2d71c0=_['merge']({},_0x2d71c0,_0x48755d[_0x7d7a('0x5a')]);return db[_0x7d7a('0xca')][_0x7d7a('0x2d')]({'where':_0x2d71c0[_0x7d7a('0x4f')]})[_0x7d7a('0x1e')](function(_0x1f97b5){_0x50f856[_0x7d7a('0x2d')]=_0x1f97b5;if(_0x48755d['query'][_0x7d7a('0x5b')]){_0x2d71c0['include']=[{'all':!![]}];}return db[_0x7d7a('0xca')]['findAll'](_0x2d71c0);})[_0x7d7a('0x1e')](function(_0x84cb4e){_0x50f856[_0x7d7a('0x5f')]=_0x84cb4e;return _0x50f856;});}})[_0x7d7a('0x1e')](respondWithFilteredResult(_0x2296a1,_0x2d71c0))['catch'](handleError(_0x2296a1,null));};exports[_0x7d7a('0xcb')]=function(_0x40c05e,_0x4ca7e0,_0x25ca4f){var _0x47232={};var _0x59eafc={};var _0x25e5d1;var _0x8c50e0;return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x40c05e[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x4ca7e0,null))[_0x7d7a('0x1e')](function(_0x32806c){if(_0x32806c){_0x25e5d1=_0x32806c;_0x59eafc[_0x7d7a('0x41')]=_['keys'](db['ChatInteraction'][_0x7d7a('0x62')]);_0x59eafc[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x40c05e[_0x7d7a('0x44')]);_0x59eafc['filters']=_['intersection'](_0x59eafc[_0x7d7a('0x41')],_0x59eafc[_0x7d7a('0x44')]);_0x47232['attributes']=_[_0x7d7a('0x47')](_0x59eafc[_0x7d7a('0x41')],qs['fields'](_0x40c05e[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x47232[_0x7d7a('0x49')]=_0x47232[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x47232[_0x7d7a('0x49')]:_0x59eafc[_0x7d7a('0x41')];_0x47232[_0x7d7a('0x4d')]=qs['sort'](_0x40c05e[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x47232['where']=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x40c05e[_0x7d7a('0x44')],_0x59eafc['filters']));if(_0x40c05e['query']['filter']){_0x47232[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x47232[_0x7d7a('0x4f')],{'$or':_['map'](_0x47232[_0x7d7a('0x49')],function(_0x32ef6d){var _0x2b8471={};_0x2b8471[_0x32ef6d]={'$like':'%'+_0x40c05e[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x2b8471;})});}_0x47232=_['merge']({},_0x47232,_0x40c05e[_0x7d7a('0x5a')]);return _0x25e5d1[_0x7d7a('0xcb')](_0x47232);}})[_0x7d7a('0x1e')](function(_0x508553){if(_0x508553){_0x8c50e0=_0x508553[_0x7d7a('0x4a')];if(!_0x40c05e['query'][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x47232['limit']=qs[_0x7d7a('0x2f')](_0x40c05e[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x47232[_0x7d7a('0x2e')]=qs['offset'](_0x40c05e[_0x7d7a('0x44')]['offset']);}return _0x25e5d1[_0x7d7a('0xcb')](_0x47232);}})[_0x7d7a('0x1e')](function(_0x3cffce){if(_0x3cffce){return _0x3cffce?{'count':_0x8c50e0,'rows':_0x3cffce}:null;}})['then'](respondWithResult(_0x4ca7e0,null))['catch'](handleError(_0x4ca7e0,null));};exports[_0x7d7a('0xcc')]=function(_0x50c973,_0xd55813,_0x5d35f9){var _0x4823dd={};var _0x5d16cd={};var _0x4eb1db;var _0x13526f;return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x50c973[_0x7d7a('0x61')]['id']}})['then'](handleEntityNotFound(_0xd55813,null))[_0x7d7a('0x1e')](function(_0x26670d){if(_0x26670d){_0x4eb1db=_0x26670d;_0x5d16cd[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xcd')][_0x7d7a('0x62')]);_0x5d16cd[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x50c973[_0x7d7a('0x44')]);_0x5d16cd[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0x5d16cd[_0x7d7a('0x41')],_0x5d16cd['query']);_0x4823dd[_0x7d7a('0x49')]=_[_0x7d7a('0x47')](_0x5d16cd[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x50c973[_0x7d7a('0x44')]['fields']));_0x4823dd[_0x7d7a('0x49')]=_0x4823dd[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x4823dd['attributes']:_0x5d16cd[_0x7d7a('0x41')];_0x4823dd[_0x7d7a('0x4d')]=qs[_0x7d7a('0x4e')](_0x50c973['query'][_0x7d7a('0x4e')]);_0x4823dd[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_['pick'](_0x50c973['query'],_0x5d16cd[_0x7d7a('0x46')]));if(_0x50c973[_0x7d7a('0x44')][_0x7d7a('0x51')]){_0x4823dd[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x4823dd[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x4823dd[_0x7d7a('0x49')],function(_0x8b1692){var _0x2dbbad={};_0x2dbbad[_0x8b1692]={'$like':'%'+_0x50c973[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x2dbbad;})});}_0x4823dd=_[_0x7d7a('0x52')]({},_0x4823dd,_0x50c973['options']);return _0x4eb1db[_0x7d7a('0xcc')](_0x4823dd);}})['then'](function(_0x509a97){if(_0x509a97){_0x13526f=_0x509a97[_0x7d7a('0x4a')];if(!_0x50c973[_0x7d7a('0x44')][_0x7d7a('0x4b')]('nolimit')){_0x4823dd['limit']=qs['limit'](_0x50c973[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x4823dd[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x50c973['query'][_0x7d7a('0x2e')]);}return _0x4eb1db['getOpenchannelInteractions'](_0x4823dd);}})[_0x7d7a('0x1e')](function(_0x53d6bc){if(_0x53d6bc){return _0x53d6bc?{'count':_0x13526f,'rows':_0x53d6bc}:null;}})[_0x7d7a('0x1e')](respondWithResult(_0xd55813,null))[_0x7d7a('0x28')](handleError(_0xd55813,null));};exports[_0x7d7a('0xce')]=function(_0x449955,_0x10a18e,_0xa802bb){var _0x26bcd8={'raw':!![],'where':{}};var _0x2c3fd5={};var _0x11cffd={'count':0x0,'rows':[]};return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x449955[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x10a18e,null))[_0x7d7a('0x1e')](function(_0x2c8607){if(_0x2c8607){_0x2c3fd5[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xcf')][_0x7d7a('0x62')]);_0x2c3fd5['query']=_[_0x7d7a('0x45')](_0x449955[_0x7d7a('0x44')]);_0x2c3fd5['filters']=_['intersection'](_0x2c3fd5[_0x7d7a('0x41')],_0x2c3fd5['query']);_0x26bcd8[_0x7d7a('0x49')]=_['intersection'](_0x2c3fd5[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x449955[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x26bcd8[_0x7d7a('0x49')]=_0x26bcd8[_0x7d7a('0x49')]['length']?_0x26bcd8[_0x7d7a('0x49')]:_0x2c3fd5[_0x7d7a('0x41')];if(!_0x449955['query'][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x26bcd8[_0x7d7a('0x2f')]=qs[_0x7d7a('0x2f')](_0x449955['query'][_0x7d7a('0x2f')]);_0x26bcd8['offset']=qs[_0x7d7a('0x2e')](_0x449955[_0x7d7a('0x44')]['offset']);}_0x26bcd8['order']=qs[_0x7d7a('0x4e')](_0x449955['query'][_0x7d7a('0x4e')]);_0x26bcd8[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x449955['query'],_0x2c3fd5['filters']));_0x26bcd8[_0x7d7a('0x4f')][_0x7d7a('0xc8')]=_0x2c8607['id'];if(_0x449955['query'][_0x7d7a('0x51')]){_0x26bcd8[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x26bcd8[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x26bcd8[_0x7d7a('0x49')],function(_0x55a591){var _0x4a5a51={};_0x4a5a51[_0x55a591]={'$like':'%'+_0x449955[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x4a5a51;})});}_0x26bcd8=_[_0x7d7a('0x52')]({},_0x26bcd8,_0x449955[_0x7d7a('0x5a')]);return db['MailInteraction'][_0x7d7a('0x2d')]({'where':_0x26bcd8['where']})['then'](function(_0x2fc80a){_0x11cffd[_0x7d7a('0x2d')]=_0x2fc80a;if(_0x449955['query'][_0x7d7a('0x5b')]){_0x26bcd8[_0x7d7a('0x5c')]=[{'all':!![]}];}return db['MailInteraction'][_0x7d7a('0x5e')](_0x26bcd8);})[_0x7d7a('0x1e')](function(_0x2bd425){_0x11cffd[_0x7d7a('0x5f')]=_0x2bd425;return _0x11cffd;});}})[_0x7d7a('0x1e')](respondWithFilteredResult(_0x10a18e,_0x26bcd8))[_0x7d7a('0x28')](handleError(_0x10a18e,null));};exports[_0x7d7a('0xd0')]=function(_0x16ae7a,_0x5c4abb,_0x5d5962){var _0x26434b={};var _0x367ebe={};var _0x353b59;var _0x5570a6;return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x16ae7a['params']['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x5c4abb,null))['then'](function(_0x4d34a2){if(_0x4d34a2){_0x353b59=_0x4d34a2;_0x367ebe[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xd1')][_0x7d7a('0x62')]);_0x367ebe[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x16ae7a[_0x7d7a('0x44')]);_0x367ebe[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0x367ebe[_0x7d7a('0x41')],_0x367ebe[_0x7d7a('0x44')]);_0x26434b[_0x7d7a('0x49')]=_['intersection'](_0x367ebe[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x16ae7a[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x26434b[_0x7d7a('0x49')]=_0x26434b[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x26434b[_0x7d7a('0x49')]:_0x367ebe[_0x7d7a('0x41')];_0x26434b[_0x7d7a('0x4d')]=qs[_0x7d7a('0x4e')](_0x16ae7a['query']['sort']);_0x26434b[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x16ae7a[_0x7d7a('0x44')],_0x367ebe[_0x7d7a('0x46')]));if(_0x16ae7a['query']['filter']){_0x26434b[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x26434b['where'],{'$or':_[_0x7d7a('0x3a')](_0x26434b['attributes'],function(_0x2b0009){var _0x370b96={};_0x370b96[_0x2b0009]={'$like':'%'+_0x16ae7a['query'][_0x7d7a('0x51')]+'%'};return _0x370b96;})});}_0x26434b=_['merge']({},_0x26434b,_0x16ae7a['options']);return _0x353b59[_0x7d7a('0xd0')](_0x26434b);}})[_0x7d7a('0x1e')](function(_0x2aac7c){if(_0x2aac7c){_0x5570a6=_0x2aac7c['length'];if(!_0x16ae7a[_0x7d7a('0x44')][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x26434b[_0x7d7a('0x2f')]=qs[_0x7d7a('0x2f')](_0x16ae7a[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x26434b[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x16ae7a['query'][_0x7d7a('0x2e')]);}return _0x353b59[_0x7d7a('0xd0')](_0x26434b);}})[_0x7d7a('0x1e')](function(_0x5b2775){if(_0x5b2775){return _0x5b2775?{'count':_0x5570a6,'rows':_0x5b2775}:null;}})[_0x7d7a('0x1e')](respondWithResult(_0x5c4abb,null))[_0x7d7a('0x28')](handleError(_0x5c4abb,null));};exports['getFaxInteractions']=function(_0x58b73f,_0x584636,_0x3ac96d){var _0x5ef947={};var _0x588fe9={};var _0x8db5e;var _0x105d09;return db['User'][_0x7d7a('0x98')]({'where':{'id':_0x58b73f[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x584636,null))[_0x7d7a('0x1e')](function(_0x15aa57){if(_0x15aa57){_0x8db5e=_0x15aa57;_0x588fe9[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xd2')][_0x7d7a('0x62')]);_0x588fe9[_0x7d7a('0x44')]=_[_0x7d7a('0x45')](_0x58b73f[_0x7d7a('0x44')]);_0x588fe9[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0x588fe9[_0x7d7a('0x41')],_0x588fe9[_0x7d7a('0x44')]);_0x5ef947['attributes']=_['intersection'](_0x588fe9[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x58b73f[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x5ef947[_0x7d7a('0x49')]=_0x5ef947[_0x7d7a('0x49')]['length']?_0x5ef947[_0x7d7a('0x49')]:_0x588fe9[_0x7d7a('0x41')];_0x5ef947[_0x7d7a('0x4d')]=qs[_0x7d7a('0x4e')](_0x58b73f[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x5ef947['where']=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x58b73f[_0x7d7a('0x44')],_0x588fe9[_0x7d7a('0x46')]));if(_0x58b73f[_0x7d7a('0x44')][_0x7d7a('0x51')]){_0x5ef947[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x5ef947[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x5ef947['attributes'],function(_0x2e50a2){var _0x10d3fe={};_0x10d3fe[_0x2e50a2]={'$like':'%'+_0x58b73f[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x10d3fe;})});}_0x5ef947=_[_0x7d7a('0x52')]({},_0x5ef947,_0x58b73f['options']);return _0x8db5e[_0x7d7a('0xd3')](_0x5ef947);}})['then'](function(_0x459864){if(_0x459864){_0x105d09=_0x459864['length'];if(!_0x58b73f[_0x7d7a('0x44')][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x5ef947[_0x7d7a('0x2f')]=qs[_0x7d7a('0x2f')](_0x58b73f[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x5ef947[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x58b73f[_0x7d7a('0x44')][_0x7d7a('0x2e')]);}return _0x8db5e[_0x7d7a('0xd3')](_0x5ef947);}})[_0x7d7a('0x1e')](function(_0x5221ca){if(_0x5221ca){return _0x5221ca?{'count':_0x105d09,'rows':_0x5221ca}:null;}})[_0x7d7a('0x1e')](respondWithResult(_0x584636,null))[_0x7d7a('0x28')](handleError(_0x584636,null));};exports['login']=function(_0x288ca6,_0x41a280,_0x38033d){var _0x3bbef7;var _0x371395;var _0x25e553;var _0x2debb0=!_['isNil'](_0x288ca6['params']['id'])?_0x288ca6['params']['id']:!_[_0x7d7a('0x6f')](_0x288ca6[_0x7d7a('0x37')]['id'])?_0x288ca6[_0x7d7a('0x37')]['id']:null;return db[_0x7d7a('0x5d')][_0x7d7a('0x63')]({'where':{'id':_0x2debb0,'role':'agent'},'attributes':['id',_0x7d7a('0x3e'),_0x7d7a('0xd4'),_0x7d7a('0xd5'),_0x7d7a('0x3d'),_0x7d7a('0x75'),_0x7d7a('0x9c')]})[_0x7d7a('0x1e')](handleEntityNotFound(_0x41a280,null))['then'](function(_0xcdd80a){if(_0xcdd80a){_0x3bbef7=_0xcdd80a;if(_0x288ca6[_0x7d7a('0x65')][_0x7d7a('0xa7')]){_0x25e553=util['format'](_0x7d7a('0xd6'),_0x3bbef7[_0x288ca6[_0x7d7a('0x65')][_0x7d7a('0xa7')]]);}else if(_0x288ca6['body'][_0x7d7a('0xd7')]){_0x25e553=util[_0x7d7a('0x70')](_0x7d7a('0xa8'),_0x288ca6[_0x7d7a('0x65')][_0x7d7a('0xd7')]);}else{_0x25e553=util[_0x7d7a('0x70')](_0x7d7a('0xa8'),_0x3bbef7[_0x7d7a('0x3e')]);}socket['to'](util[_0x7d7a('0x70')](_0x7d7a('0xd8'),_0x3bbef7[_0x7d7a('0x3e')]))[_0x7d7a('0xa2')]('user:forcelogout',{'ip':_0x288ca6['headers'][_0x7d7a('0xd9')]||_0x288ca6[_0x7d7a('0xda')][_0x7d7a('0xdb')]||_0x288ca6['socket']['remoteAddress']||_0x288ca6[_0x7d7a('0xda')]['socket'][_0x7d7a('0xdb')]});return db[_0x7d7a('0xaa')][_0x7d7a('0x34')]({'where':{'membername':_0x3bbef7[_0x7d7a('0x3e')]},'individualHooks':!![]});}})['then'](function(_0x418729){if(_0x3bbef7){return _0x3bbef7['getVoiceQueues']({'raw':!![]});}})[_0x7d7a('0x1e')](function(_0x538936){var _0x359d1c=[];if(_0x538936){_0x371395=_0x538936;if(_0x371395[_0x7d7a('0x4a')]){for(var _0x2840c9=0x0;_0x2840c9<_0x371395[_0x7d7a('0x4a')];_0x2840c9++){_0x359d1c['push']({'membername':_0x3bbef7['name'],'UserId':_0x3bbef7['id'],'queue_name':_0x371395[_0x2840c9][_0x7d7a('0x3e')],'VoiceQueueId':_0x371395[_0x2840c9]['id'],'interface':_0x25e553,'paused':_0x3bbef7['loginInPause']||![],'penalty':_0x371395[_0x2840c9][_0x7d7a('0xdc')]||0x0});}return BPromise['each'](_0x359d1c,function(_0x3a196d){return db[_0x7d7a('0xaa')][_0x7d7a('0xab')](_0x3a196d);});}}})['then'](function(){return db[_0x7d7a('0xdd')][_0x7d7a('0x5e')]({'where':{'membername':_0x3bbef7[_0x7d7a('0x3e')],'exitAt':null}});})[_0x7d7a('0x1e')](function(_0x5e93a1){var _0x5cf6c7=[];_0x5e93a1[_0x7d7a('0xde')](function(_0x5a90a3){_0x5cf6c7['push'](_0x5a90a3[_0x7d7a('0x33')]({'exitAt':moment()[_0x7d7a('0x70')](_0x7d7a('0xdf'))}));});return BPromise[_0x7d7a('0xe0')](_0x5cf6c7);})[_0x7d7a('0x1e')](function(){var _0x1fb5f1=[];var _0x5ca501=[];var _0x20e192=utils[_0x7d7a('0xe1')]();var _0x5d9e12={'membername':_0x3bbef7[_0x7d7a('0x3e')],'interface':_0x25e553,'enterAt':moment()[_0x7d7a('0x70')](_0x7d7a('0xdf')),'role':_0x3bbef7['role'],'internal':_0x3bbef7['internal']};_0x20e192['forEach'](function(_0xccf4ab){_0x1fb5f1[_0x7d7a('0xa6')](_[_0x7d7a('0x52')]({'channel':_0xccf4ab,'type':_0x7d7a('0xe2'),'data1':_0x288ca6[_0x7d7a('0x65')][_0x7d7a('0xe3')],'data2':_0x25e553},_0x5d9e12));if(_0x3bbef7[_0x7d7a('0x9c')]){_0x5ca501[_0x7d7a('0xa6')](_['merge']({'channel':_0xccf4ab,'type':'PAUSE','data1':_0x7d7a('0xe4')},_0x5d9e12));}});return db[_0x7d7a('0xdd')][_0x7d7a('0x64')](_0x1fb5f1[_0x7d7a('0xe5')](_0x5ca501),{'individualHooks':!![]});})[_0x7d7a('0x1e')](function(){return _0x3bbef7[_0x7d7a('0x33')]({'online':!![],'lastLoginAt':moment()[_0x7d7a('0x70')](_0x7d7a('0xdf')),'voicePause':_0x3bbef7['loginInPause']||![],'mailPause':_0x3bbef7[_0x7d7a('0x9c')]||![],'chatPause':_0x3bbef7[_0x7d7a('0x9c')]||![],'faxPause':_0x3bbef7[_0x7d7a('0x9c')]||![],'smsPause':_0x3bbef7[_0x7d7a('0x9c')]||![],'openchannelPause':_0x3bbef7[_0x7d7a('0x9c')]||![],'pauseType':_0x3bbef7[_0x7d7a('0x9c')]?_0x7d7a('0xe4'):null,'interface':_0x25e553,'lastPauseAt':moment()[_0x7d7a('0x70')](_0x7d7a('0xdf'))});})[_0x7d7a('0x1e')](function(_0x3613e0){if(_0x288ca6['isMiddleware']){return _0x38033d();}else{return BPromise['resolve'](_0x3613e0)[_0x7d7a('0x1e')](respondWithResult(_0x41a280,null));}})[_0x7d7a('0x28')](handleError(_0x41a280,null));};exports[_0x7d7a('0xe6')]=function(_0x93afcc,_0x200f3b,_0x4f73a5){var _0x49b524;return db[_0x7d7a('0x5d')][_0x7d7a('0x63')]({'where':{'id':_0x93afcc[_0x7d7a('0x61')]['id'],'role':_0x7d7a('0x39')},'attributes':['id',_0x7d7a('0x3e'),'role']})['then'](handleEntityNotFound(_0x200f3b,null))[_0x7d7a('0x1e')](function(_0x49d4b2){if(_0x49d4b2){_0x49b524=_0x49d4b2;return db['UserVoiceQueueRt'][_0x7d7a('0x34')]({'where':{'membername':_0x49b524[_0x7d7a('0x3e')]},'individualHooks':!![]});}})[_0x7d7a('0x1e')](function(){return db[_0x7d7a('0xdd')][_0x7d7a('0x5e')]({'where':{'membername':_0x49b524[_0x7d7a('0x3e')],'exitAt':null}});})['then'](function(_0x27f19c){var _0x3d6a03=[];_0x27f19c[_0x7d7a('0xde')](function(_0x56a4ee){_0x3d6a03[_0x7d7a('0xa6')](_0x56a4ee['update']({'exitAt':moment()[_0x7d7a('0x70')](_0x7d7a('0xdf'))}));});return BPromise['all'](_0x3d6a03);})[_0x7d7a('0x1e')](function(){return _0x49b524[_0x7d7a('0x33')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x200f3b,null))['catch'](handleError(_0x200f3b,null));};exports[_0x7d7a('0xe7')]=function(_0x210ad7,_0x53287e,_0x41af73){var _0x357e79;return db[_0x7d7a('0xaa')][_0x7d7a('0x33')]({'paused':0x1},{'where':{'UserId':_0x210ad7['params']['id']},'individualHooks':!![]})[_0x7d7a('0x1e')](function(){return db[_0x7d7a('0x5d')]['find']({'where':{'id':_0x210ad7[_0x7d7a('0x61')]['id'],'role':_0x7d7a('0x39')},'attributes':['id','name','role',_0x7d7a('0x75'),'interface']});})[_0x7d7a('0x1e')](handleEntityNotFound(_0x53287e,null))['then'](function(_0x4415ee){if(_0x4415ee){_0x357e79=_0x4415ee;return respondWithRpcPromise(_0x7d7a('0xe8'),_0x7d7a('0xe7'),{'id':_0x357e79['id'],'name':_0x357e79['name'],'pause':!![]});}})['then'](function(){if(_0x357e79){return db[_0x7d7a('0xdd')][_0x7d7a('0x5e')]({'where':{'membername':_0x357e79[_0x7d7a('0x3e')],'type':_0x7d7a('0xe9'),'exitAt':null}});}})[_0x7d7a('0x1e')](function(_0x1622f6){if(_0x1622f6[_0x7d7a('0x4a')]){var _0x646c1e=moment()[_0x7d7a('0x70')](_0x7d7a('0xdf'));for(var _0x561688=0x0,_0x1fc8e5=_0x1622f6['length'];_0x561688<_0x1fc8e5;_0x561688++){_0x1622f6[_0x561688][_0x7d7a('0xea')]({'exitAt':_0x646c1e});}}})[_0x7d7a('0x1e')](function(){var _0x1f175c=[];var _0x3267fe=utils['getChannels']();_0x3267fe[_0x7d7a('0xde')](function(_0x260c17){_0x1f175c[_0x7d7a('0xa6')]({'channel':_0x260c17,'membername':_0x357e79[_0x7d7a('0x3e')],'interface':_['isNil'](_0x357e79[_0x7d7a('0xa7')])?util[_0x7d7a('0x70')]('SIP/%s',_0x357e79['name']):_0x357e79['interface'],'type':'PAUSE','enterAt':moment()[_0x7d7a('0x70')](_0x7d7a('0xdf')),'data1':_0x210ad7[_0x7d7a('0x65')][_0x7d7a('0x53')]||_0x7d7a('0xeb'),'role':_0x357e79[_0x7d7a('0x3d')],'internal':_0x357e79[_0x7d7a('0x75')]});});return db[_0x7d7a('0xdd')][_0x7d7a('0x64')](_0x1f175c,{'individualHooks':!![]});})['then'](function(){return _0x357e79[_0x7d7a('0x33')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x210ad7[_0x7d7a('0x65')][_0x7d7a('0x53')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x7d7a('0x70')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7d7a('0x1e')](respondWithResult(_0x53287e,null))['catch'](handleError(_0x53287e,null));};exports[_0x7d7a('0xec')]=function(_0x16a19f,_0x5bb0c1,_0x454455){var _0x593cf0;return db[_0x7d7a('0x5d')][_0x7d7a('0x63')]({'where':{'id':_0x16a19f['params']['id']},'attributes':['id',_0x7d7a('0x3e'),_0x7d7a('0x3d'),_0x7d7a('0xed'),_0x7d7a('0xee'),_0x7d7a('0xef'),_0x7d7a('0xf0'),_0x7d7a('0xf1'),_0x7d7a('0xf2'),_0x7d7a('0xf3'),'lastPauseAt']})[_0x7d7a('0x1e')](handleEntityNotFound(_0x5bb0c1,null))[_0x7d7a('0x1e')](function(_0x298961){if(_0x298961){_0x593cf0=_0x298961;if(_0x16a19f[_0x7d7a('0x65')][_0x7d7a('0x9a')]&&!utils[_0x7d7a('0xac')](_0x16a19f[_0x7d7a('0x65')]['channel'])){throw new db[(_0x7d7a('0x91'))][(_0x7d7a('0x93'))](_0x7d7a('0x9d'));}switch(_0x16a19f[_0x7d7a('0x65')][_0x7d7a('0x9a')]){case _0x7d7a('0xa4'):return respondWithRpcPromise(_0x7d7a('0xe8'),_0x7d7a('0xec'),{'id':_0x593cf0['id'],'name':_0x593cf0[_0x7d7a('0x3e')],'pause':![]})[_0x7d7a('0x1e')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x593cf0['id']},'individualHooks':!![]});})[_0x7d7a('0x1e')](function(){return db[_0x7d7a('0xdd')][_0x7d7a('0x63')]({'where':{'channel':_0x16a19f[_0x7d7a('0x65')][_0x7d7a('0x9a')],'membername':_0x593cf0[_0x7d7a('0x3e')],'type':_0x7d7a('0xe9'),'exitAt':null}});})[_0x7d7a('0x1e')](function(_0x2d8de6){if(_0x2d8de6){return _0x2d8de6['update']({'exitAt':moment()[_0x7d7a('0x70')](_0x7d7a('0xdf')),'data2':_0x7d7a('0xf4')},{'individualHooks':!![]});}return null;})[_0x7d7a('0x1e')](function(){return _0x593cf0['update']({'voicePause':![]});});case _0x7d7a('0xf5'):case _0x7d7a('0xf6'):case'fax':case _0x7d7a('0xf7'):case'openchannel':return db['MemberReport']['find']({'where':{'channel':_0x16a19f[_0x7d7a('0x65')][_0x7d7a('0x9a')],'membername':_0x593cf0['name'],'type':'PAUSE','exitAt':null}})[_0x7d7a('0x1e')](function(_0x2f8019){if(_0x2f8019){return _0x2f8019[_0x7d7a('0x33')]({'exitAt':moment()['format'](_0x7d7a('0xdf')),'data2':_0x7d7a('0xf4')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x204fa9={};_[_0x7d7a('0xf8')](_0x204fa9,util[_0x7d7a('0x70')](_0x7d7a('0xf9'),_0x16a19f[_0x7d7a('0x65')][_0x7d7a('0x9a')],_0x7d7a('0xfa')),![]);return _0x593cf0[_0x7d7a('0x33')](_0x204fa9);});default:return respondWithRpcPromise(_0x7d7a('0xe8'),_0x7d7a('0xec'),{'id':_0x593cf0['id'],'name':_0x593cf0['name'],'pause':![]})[_0x7d7a('0x1e')](function(){return db['UserVoiceQueueRt'][_0x7d7a('0x33')]({'paused':0x0},{'where':{'UserId':_0x593cf0['id']}});})[_0x7d7a('0x1e')](function(){return db[_0x7d7a('0xdd')]['findAll']({'where':{'membername':_0x593cf0[_0x7d7a('0x3e')],'type':_0x7d7a('0xe9'),'exitAt':null}});})[_0x7d7a('0x1e')](function(_0x2961a5){var _0x4abb4a=[];_0x2961a5[_0x7d7a('0xde')](function(_0x4944e3){_0x4abb4a[_0x7d7a('0xa6')](_0x4944e3[_0x7d7a('0x33')]({'exitAt':moment()[_0x7d7a('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise[_0x7d7a('0xe0')](_0x4abb4a);})[_0x7d7a('0x1e')](function(){return _0x593cf0[_0x7d7a('0x33')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x7d7a('0x1e')](respondWithResult(_0x5bb0c1,null))['catch'](handleError(_0x5bb0c1,null));};exports[_0x7d7a('0xfb')]=function(_0x3bbc9a,_0x2aa864,_0x3fa67d){var _0x1cd0cf={};var _0x2d32f8={};var _0x38b6f0;var _0xa07e32;return db[_0x7d7a('0x5d')][_0x7d7a('0x98')]({'where':{'id':_0x3bbc9a['params']['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x2aa864,null))[_0x7d7a('0x1e')](function(_0x256b56){if(_0x256b56){_0x38b6f0=_0x256b56;_0x2d32f8[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xfc')][_0x7d7a('0x62')]);_0x2d32f8[_0x7d7a('0x44')]=_['keys'](_0x3bbc9a[_0x7d7a('0x44')]);_0x2d32f8[_0x7d7a('0x46')]=_['intersection'](_0x2d32f8['model'],_0x2d32f8['query']);_0x1cd0cf[_0x7d7a('0x49')]=_[_0x7d7a('0x47')](_0x2d32f8['model'],qs['fields'](_0x3bbc9a[_0x7d7a('0x44')][_0x7d7a('0x48')]));_0x1cd0cf[_0x7d7a('0x49')]=_0x1cd0cf['attributes']['length']?_0x1cd0cf['attributes']:_0x2d32f8[_0x7d7a('0x41')];_0x1cd0cf['order']=qs[_0x7d7a('0x4e')](_0x3bbc9a[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x1cd0cf['where']=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x3bbc9a[_0x7d7a('0x44')],_0x2d32f8[_0x7d7a('0x46')]));if(_0x3bbc9a['query']['filter']){_0x1cd0cf[_0x7d7a('0x4f')]=_['merge'](_0x1cd0cf[_0x7d7a('0x4f')],{'$or':_['map'](_0x1cd0cf[_0x7d7a('0x49')],function(_0x18158d){var _0x4255d1={};_0x4255d1[_0x18158d]={'$like':'%'+_0x3bbc9a[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x4255d1;})});}_0x1cd0cf=_['merge']({},_0x1cd0cf,_0x3bbc9a[_0x7d7a('0x5a')]);return _0x38b6f0[_0x7d7a('0xfb')](_0x1cd0cf);}})[_0x7d7a('0x1e')](function(_0x2fca3b){if(_0x2fca3b){_0xa07e32=_0x2fca3b[_0x7d7a('0x4a')];if(!_0x3bbc9a[_0x7d7a('0x44')][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x1cd0cf[_0x7d7a('0x2f')]=qs['limit'](_0x3bbc9a[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x1cd0cf['offset']=qs[_0x7d7a('0x2e')](_0x3bbc9a[_0x7d7a('0x44')][_0x7d7a('0x2e')]);}return _0x38b6f0['getTeams'](_0x1cd0cf);}})['then'](function(_0x46702e){if(_0x46702e){return _0x46702e?{'count':_0xa07e32,'rows':_0x46702e}:null;}})[_0x7d7a('0x1e')](respondWithResult(_0x2aa864,null))[_0x7d7a('0x28')](handleError(_0x2aa864,null));};exports['addTeams']=function(_0x586162,_0x47cd6a,_0x2a9f7d){return db[_0x7d7a('0x5d')][_0x7d7a('0x63')]({'where':{'id':_0x586162['params']['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x47cd6a,null))['then'](function(_0x298482){if(_0x298482){return _0x298482['addTeams'](_0x586162['body'][_0x7d7a('0x69')],_[_0x7d7a('0x68')](_0x586162[_0x7d7a('0x65')],['ids','id'])||{});}})[_0x7d7a('0x1e')](respondWithResult(_0x47cd6a,null))[_0x7d7a('0x28')](handleError(_0x47cd6a,null));};exports['removeTeams']=function(_0x3f3974,_0x3fe766,_0x597727){return db[_0x7d7a('0x5d')]['find']({'where':{'id':_0x3f3974[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0x3fe766,null))[_0x7d7a('0x1e')](function(_0x18ad6a){if(_0x18ad6a){return _0x18ad6a[_0x7d7a('0xfd')](_0x3f3974[_0x7d7a('0x44')]['ids']);}})[_0x7d7a('0x1e')](respondWithStatusCode(_0x3fe766,null))[_0x7d7a('0x28')](handleError(_0x3fe766,null));};exports[_0x7d7a('0xfe')]=function(_0x18bdc0,_0x2f4782,_0xc0cb8e){var _0x5386ea={};var _0x5f0515={};var _0x1141bf;var _0x301132;return db[_0x7d7a('0x5d')]['findOne']({'where':{'id':_0x18bdc0[_0x7d7a('0x61')]['id']}})['then'](handleEntityNotFound(_0x2f4782,null))[_0x7d7a('0x1e')](function(_0x2680c8){if(_0x2680c8){_0x1141bf=_0x2680c8;_0x5f0515[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0xba')][_0x7d7a('0x62')]);_0x5f0515['query']=_[_0x7d7a('0x45')](_0x18bdc0[_0x7d7a('0x44')]);_0x5f0515['filters']=_[_0x7d7a('0x47')](_0x5f0515[_0x7d7a('0x41')],_0x5f0515[_0x7d7a('0x44')]);_0x5386ea[_0x7d7a('0x49')]=_['intersection'](_0x5f0515['model'],qs[_0x7d7a('0x48')](_0x18bdc0[_0x7d7a('0x44')]['fields']));_0x5386ea[_0x7d7a('0x49')]=_0x5386ea['attributes'][_0x7d7a('0x4a')]?_0x5386ea[_0x7d7a('0x49')]:_0x5f0515[_0x7d7a('0x41')];_0x5386ea['order']=qs[_0x7d7a('0x4e')](_0x18bdc0[_0x7d7a('0x44')]['sort']);_0x5386ea[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x18bdc0['query'],_0x5f0515[_0x7d7a('0x46')]));if(_0x18bdc0[_0x7d7a('0x44')][_0x7d7a('0x51')]){_0x5386ea['where']=_[_0x7d7a('0x52')](_0x5386ea[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x5386ea[_0x7d7a('0x49')],function(_0x1fe13b){var _0x2d2b21={};_0x2d2b21[_0x1fe13b]={'$like':'%'+_0x18bdc0[_0x7d7a('0x44')][_0x7d7a('0x51')]+'%'};return _0x2d2b21;})});}_0x5386ea=_[_0x7d7a('0x52')]({},_0x5386ea,_0x18bdc0[_0x7d7a('0x5a')]);return _0x1141bf[_0x7d7a('0xfe')](_0x5386ea);}})[_0x7d7a('0x1e')](function(_0x310eca){if(_0x310eca){_0x301132=_0x310eca['length'];if(!_0x18bdc0['query'][_0x7d7a('0x4b')](_0x7d7a('0x4c'))){_0x5386ea[_0x7d7a('0x2f')]=qs['limit'](_0x18bdc0[_0x7d7a('0x44')][_0x7d7a('0x2f')]);_0x5386ea[_0x7d7a('0x2e')]=qs[_0x7d7a('0x2e')](_0x18bdc0[_0x7d7a('0x44')]['offset']);}return _0x1141bf[_0x7d7a('0xfe')](_0x5386ea);}})[_0x7d7a('0x1e')](function(_0x55ab50){if(_0x55ab50){return _0x55ab50?{'count':_0x301132,'rows':_0x55ab50}:null;}})[_0x7d7a('0x1e')](respondWithResult(_0x2f4782,null))[_0x7d7a('0x28')](handleError(_0x2f4782,null));};exports[_0x7d7a('0xff')]=function(_0x8536b0,_0xd701f6,_0x155319){var _0x1d9d5b={};var _0x4aeb38={};var _0x3edc40;var _0x459915;return db[_0x7d7a('0x5d')]['findOne']({'where':{'id':_0x8536b0[_0x7d7a('0x61')]['id']}})[_0x7d7a('0x1e')](handleEntityNotFound(_0xd701f6,null))[_0x7d7a('0x1e')](function(_0xd8cc0c){if(_0xd8cc0c){_0x3edc40=_0xd8cc0c;_0x4aeb38[_0x7d7a('0x41')]=_[_0x7d7a('0x45')](db[_0x7d7a('0x5d')][_0x7d7a('0x62')]);_0x4aeb38['query']=_[_0x7d7a('0x45')](_0x8536b0[_0x7d7a('0x44')]);_0x4aeb38[_0x7d7a('0x46')]=_[_0x7d7a('0x47')](_0x4aeb38[_0x7d7a('0x41')],_0x4aeb38['query']);_0x1d9d5b['attributes']=_[_0x7d7a('0x47')](_0x4aeb38[_0x7d7a('0x41')],qs[_0x7d7a('0x48')](_0x8536b0['query'][_0x7d7a('0x48')]));_0x1d9d5b[_0x7d7a('0x49')]=_0x1d9d5b[_0x7d7a('0x49')][_0x7d7a('0x4a')]?_0x1d9d5b['attributes']:_0x4aeb38[_0x7d7a('0x41')];_0x1d9d5b['order']=qs[_0x7d7a('0x4e')](_0x8536b0[_0x7d7a('0x44')][_0x7d7a('0x4e')]);_0x1d9d5b[_0x7d7a('0x4f')]=qs[_0x7d7a('0x46')](_[_0x7d7a('0x50')](_0x8536b0[_0x7d7a('0x44')],_0x4aeb38[_0x7d7a('0x46')]));if(_0x8536b0[_0x7d7a('0x44')][_0x7d7a('0x51')]){_0x1d9d5b[_0x7d7a('0x4f')]=_[_0x7d7a('0x52')](_0x1d9d5b[_0x7d7a('0x4f')],{'$or':_[_0x7d7a('0x3a')](_0x1d9d5b[_0x7d7a('0x49')],function(_0x30c864){var _0x3b0750={};_0x3b0750[_0x30c864]={'$like':'%'+_0x8536b0[_0x7d7a('0x44')]['filter']+'%'};return _0x3b0750;})});}_0x1d9d5b[_0x7d7a('0x41')]=db['User'];_0x1d9d5b['as']=_0x7d7a('0x38');_0x1d9d5b=_[_0x7d7a('0x52')]({},_0x1d9d5b,_0x8536b0[_0x7d7a('0x5a')]);return _0x3edc40['getVoiceQueues']({'include':[_0x1d9d5b]});}})['then'](function(_0x1c145a){if(_0x1c145a){var _0x5e050f={},_0x476d52=[],_0x48585b=0x0;for(var _0x170e01=0x0;_0x170e01<_0x1c145a[_0x7d7a('0x4a')];_0x170e01+=0x1){for(var _0x12d932=0x0,_0x2d1c8f;_0x12d932<_0x1c145a[_0x170e01][_0x7d7a('0x38')][_0x7d7a('0x4a')];_0x12d932+=0x1){_0x2d1c8f=_0x1c145a[_0x170e01]['Agents'][_0x12d932][_0x7d7a('0x35')]({'plain':!![]});_0x5e050f[_0x2d1c8f['id']]=_0x2d1c8f;}}_0x5e050f=_[_0x7d7a('0x100')](_0x5e050f);for(var _0x5bfe33=qs[_0x7d7a('0x2e')](_0x8536b0[_0x7d7a('0x44')][_0x7d7a('0x2e')]);_0x5bfe33<_0x5e050f[_0x7d7a('0x4a')]&&_0x476d52['length']=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ No newline at end of file +var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x37ff43,_0x2fc97c){var _0x221a41=function(_0x1727df){while(--_0x1727df){_0x37ff43['push'](_0x37ff43['shift']());}};_0x221a41(++_0x2fc97c);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e0f5e,_0x4168c4){_0x4e0f5e=_0x4e0f5e-0x0;var _0x45de30=_0xb10b[_0x4e0f5e];return _0x45de30;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 62dc373..5725914 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 _0xb262=['removeListener','register','length','user:','./user.events','save','update','emit'];(function(_0x258037,_0x17a9f0){var _0x1cb720=function(_0x52f313){while(--_0x52f313){_0x258037['push'](_0x258037['shift']());}};_0x1cb720(++_0x17a9f0);}(_0xb262,0x1cc));var _0x2b26=function(_0x36b843,_0x3dcad7){_0x36b843=_0x36b843-0x0;var _0x492e07=_0xb262[_0x36b843];return _0x492e07;};'use strict';var UserEvents=require(_0x2b26('0x0'));var events=[_0x2b26('0x1'),'remove',_0x2b26('0x2')];function createListener(_0x264c6b,_0x1a69b0){return function(_0x4d61d8){_0x1a69b0[_0x2b26('0x3')](_0x264c6b,_0x4d61d8);};}function removeListener(_0x12a738,_0x1c22cc){return function(){UserEvents[_0x2b26('0x4')](_0x12a738,_0x1c22cc);};}exports[_0x2b26('0x5')]=function(_0x2e7c5b){for(var _0x389b73=0x0,_0x5b6ed0=events[_0x2b26('0x6')];_0x389b73<_0x5b6ed0;_0x389b73++){var _0x4b053f=events[_0x389b73];var _0x5aed1d=createListener(_0x2b26('0x7')+_0x4b053f,_0x2e7c5b);UserEvents['on'](_0x4b053f,_0x5aed1d);}}; \ No newline at end of file +var _0x6e12=['save','update','emit','removeListener','register','user:','./user.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e12,0x1bf));var _0x26e1=function(_0x562999,_0x39b239){_0x562999=_0x562999-0x0;var _0x43437a=_0x6e12[_0x562999];return _0x43437a;};'use strict';var UserEvents=require(_0x26e1('0x0'));var events=[_0x26e1('0x1'),'remove',_0x26e1('0x2')];function createListener(_0x2d366f,_0x4dd426){return function(_0xe5ef30){_0x4dd426[_0x26e1('0x3')](_0x2d366f,_0xe5ef30);};}function removeListener(_0x20e13b,_0x255d32){return function(){UserEvents[_0x26e1('0x4')](_0x20e13b,_0x255d32);};}exports[_0x26e1('0x5')]=function(_0x38f841){for(var _0x456774=0x0,_0x5a31e7=events['length'];_0x456774<_0x5a31e7;_0x456774++){var _0x1a92d6=events[_0x456774];var _0x3b02b=createListener(_0x26e1('0x6')+_0x1a92d6,_0x38f841);UserEvents['on'](_0x1a92d6,_0x3b02b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index a5a5444..542d735 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 _0x9a5a=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x9a5a,0x194));var _0xa9a5=function(_0x17b337,_0xe3e13c){_0x17b337=_0x17b337-0x0;var _0x3257e1=_0x9a5a[_0x17b337];return _0x3257e1;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var auth=require(_0xa9a5('0x5'));var interaction=require(_0xa9a5('0x6'));var config=require(_0xa9a5('0x7'));module[_0xa9a5('0x8')]=router; \ No newline at end of file +var _0xdf98=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf98,0xcf));var _0x8df9=function(_0x2edb9f,_0x36fad0){_0x2edb9f=_0x2edb9f-0x0;var _0x4e5979=_0xdf98[_0x2edb9f];return _0x4e5979;};'use strict';var multer=require(_0x8df9('0x0'));var util=require('util');var path=require(_0x8df9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8df9('0x2')]();var auth=require(_0x8df9('0x3'));var interaction=require(_0x8df9('0x4'));var config=require(_0x8df9('0x5'));module[_0x8df9('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 110ec86..99399f2 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 _0xcf4e=['INTEGER','sequelize','exports'];(function(_0x7404bb,_0x3249a1){var _0x2d9af1=function(_0x29e3aa){while(--_0x29e3aa){_0x7404bb['push'](_0x7404bb['shift']());}};_0x2d9af1(++_0x3249a1);}(_0xcf4e,0x19c));var _0xecf4=function(_0xf6ca44,_0x57b565){_0xf6ca44=_0xf6ca44-0x0;var _0x5d5659=_0xcf4e[_0xf6ca44];return _0x5d5659;};'use strict';var Sequelize=require(_0xecf4('0x0'));module[_0xecf4('0x1')]={'penalty':{'type':Sequelize[_0xecf4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5df7=['INTEGER','sequelize','exports'];(function(_0x261832,_0x5a24e6){var _0x186143=function(_0x54e5d8){while(--_0x54e5d8){_0x261832['push'](_0x261832['shift']());}};_0x186143(++_0x5a24e6);}(_0x5df7,0x11b));var _0x75df=function(_0x37f073,_0x3e088e){_0x37f073=_0x37f073-0x0;var _0xea49d=_0x5df7[_0x37f073];return _0xea49d;};'use strict';var Sequelize=require(_0x75df('0x0'));module[_0x75df('0x1')]={'penalty':{'type':Sequelize[_0x75df('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 2ac23de..cb46dbc 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 _0x44b4=['../../config/logger','moment','request-promise','path','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x534d22,_0xaa1267){var _0x23cfb3=function(_0x41961e){while(--_0x41961e){_0x534d22['push'](_0x534d22['shift']());}};_0x23cfb3(++_0xaa1267);}(_0x44b4,0x170));var _0x444b=function(_0x534af5,_0xc8141){_0x534af5=_0x534af5-0x0;var _0x45a55d=_0x44b4[_0x534af5];return _0x45a55d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x444b('0x0'))('api');var moment=require(_0x444b('0x1'));var BPromise=require('bluebird');var rp=require(_0x444b('0x2'));var fs=require('fs');var path=require(_0x444b('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x444b('0x4'));module[_0x444b('0x5')]=function(_0x1291ef,_0x58cf9d){return _0x1291ef[_0x444b('0x6')](_0x444b('0x7'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04b8=['define','UserChatQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x3a3dc8,_0x57e984){var _0x340520=function(_0x2301f4){while(--_0x2301f4){_0x3a3dc8['push'](_0x3a3dc8['shift']());}};_0x340520(++_0x57e984);}(_0x04b8,0x1af));var _0x804b=function(_0x5c1bc8,_0x500318){_0x5c1bc8=_0x5c1bc8-0x0;var _0x3f2d28=_0x04b8[_0x5c1bc8];return _0x3f2d28;};'use strict';var _=require(_0x804b('0x0'));var util=require(_0x804b('0x1'));var logger=require(_0x804b('0x2'))('api');var moment=require(_0x804b('0x3'));var BPromise=require(_0x804b('0x4'));var rp=require(_0x804b('0x5'));var fs=require('fs');var path=require(_0x804b('0x6'));var rimraf=require(_0x804b('0x7'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x804b('0x8')]=function(_0x2939b0,_0x303fec){return _0x2939b0[_0x804b('0x9')](_0x804b('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index e7da350..e896a1a 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 _0xc03e=['catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0xc03e,0x15a));var _0xec03=function(_0x536068,_0x3de52c){_0x536068=_0x536068-0x0;var _0x4a5db2=_0xc03e[_0x536068];return _0x4a5db2;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec03('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xec03('0x3'));var logger=require(_0xec03('0x4'))(_0xec03('0x5'));var config=require(_0xec03('0x6'));var jayson=require(_0xec03('0x7'));var client=jayson[_0xec03('0x8')][_0xec03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcaaf03,_0x278f90,_0x529ebd){return new BPromise(function(_0x4205e9,_0xb0638e){return client[_0xec03('0xa')](_0xcaaf03,_0x529ebd)[_0xec03('0xb')](function(_0x4d7e09){logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));logger[_0xec03('0xf')](_0xec03('0x10'),_0x278f90,_0xec03('0xe'),JSON[_0xec03('0x11')](_0x4d7e09));if(_0x4d7e09[_0xec03('0x12')]){if(_0x4d7e09['error'][_0xec03('0x13')]===0x1f4){logger[_0xec03('0x12')](_0xec03('0xd'),_0x278f90,_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);return _0xb0638e(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}logger[_0xec03('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x278f90,_0x4d7e09['error']['message']);return _0x4205e9(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}else{logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));_0x4205e9(_0x4d7e09[_0xec03('0x15')][_0xec03('0x14')]);}})[_0xec03('0x16')](function(_0x5c2f1a){logger[_0xec03('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x278f90,_0x5c2f1a);_0xb0638e(_0x5c2f1a);});});} \ No newline at end of file +var _0x7531=['error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x7531,0x69));var _0x1753=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7531[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1753('0x0'));var util=require(_0x1753('0x1'));var moment=require(_0x1753('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1753('0x3'))['db'];var utils=require(_0x1753('0x4'));var logger=require('../../config/logger')(_0x1753('0x5'));var config=require(_0x1753('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1753('0x7')][_0x1753('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b7da1,_0x3e4f3c,_0xce3a0b){return new BPromise(function(_0x41533a,_0x61e45e){return client['request'](_0x2b7da1,_0xce3a0b)[_0x1753('0x9')](function(_0x3a264b){logger[_0x1753('0xa')](_0x1753('0xb'),_0x3e4f3c,_0x1753('0xc'));logger[_0x1753('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3e4f3c,'request\x20sent',JSON[_0x1753('0xe')](_0x3a264b));if(_0x3a264b[_0x1753('0xf')]){if(_0x3a264b[_0x1753('0xf')][_0x1753('0x10')]===0x1f4){logger[_0x1753('0xf')](_0x1753('0xb'),_0x3e4f3c,_0x3a264b[_0x1753('0xf')][_0x1753('0x11')]);return _0x61e45e(_0x3a264b[_0x1753('0xf')]['message']);}logger[_0x1753('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x3e4f3c,_0x3a264b['error'][_0x1753('0x11')]);return _0x41533a(_0x3a264b[_0x1753('0xf')][_0x1753('0x11')]);}else{logger['info'](_0x1753('0xb'),_0x3e4f3c,_0x1753('0xc'));_0x41533a(_0x3a264b[_0x1753('0x12')][_0x1753('0x11')]);}})[_0x1753('0x13')](function(_0x12cb42){logger[_0x1753('0xf')](_0x1753('0xb'),_0x3e4f3c,_0x12cb42);_0x61e45e(_0x12cb42);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 37052c8..6f1b722 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 _0x7dee=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7dee,0xb0));var _0xe7de=function(_0x2290d5,_0x521e8a){_0x2290d5=_0x2290d5-0x0;var _0x18974b=_0x7dee[_0x2290d5];return _0x18974b;};'use strict';var multer=require(_0xe7de('0x0'));var util=require('util');var path=require(_0xe7de('0x1'));var timeout=require('connect-timeout');var express=require(_0xe7de('0x2'));var router=express[_0xe7de('0x3')]();var auth=require(_0xe7de('0x4'));var interaction=require(_0xe7de('0x5'));var config=require('../../config/environment');module[_0xe7de('0x6')]=router; \ No newline at end of file +var _0xac6a=['../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x45a244,_0x12f982){var _0x57edbc=function(_0x2182b2){while(--_0x2182b2){_0x45a244['push'](_0x45a244['shift']());}};_0x57edbc(++_0x12f982);}(_0xac6a,0xc2));var _0xaac6=function(_0x4ad100,_0x1a78ea){_0x4ad100=_0x4ad100-0x0;var _0x5767e4=_0xac6a[_0x4ad100];return _0x5767e4;};'use strict';var multer=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var path=require(_0xaac6('0x2'));var timeout=require(_0xaac6('0x3'));var express=require(_0xaac6('0x4'));var router=express['Router']();var auth=require(_0xaac6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaac6('0x6'));module[_0xaac6('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 799e0d7..428d1c0 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 _0x39cb=['STRING','exports','INTEGER'];(function(_0x3a24d6,_0x13fd27){var _0x38fb37=function(_0x10ea63){while(--_0x10ea63){_0x3a24d6['push'](_0x3a24d6['shift']());}};_0x38fb37(++_0x13fd27);}(_0x39cb,0x1bd));var _0xb39c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x39cb[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0xb39c('0x0')]={'penalty':{'type':Sequelize[_0xb39c('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb39c('0x2')]}}; \ No newline at end of file +var _0x8155=['INTEGER','STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8155,0x1f2));var _0x5815=function(_0xa230c7,_0x571d11){_0xa230c7=_0xa230c7-0x0;var _0x2a786d=_0x8155[_0xa230c7];return _0x2a786d;};'use strict';var Sequelize=require(_0x5815('0x0'));module[_0x5815('0x1')]={'penalty':{'type':Sequelize[_0x5815('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5815('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x5815('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 5aa0373..8437258 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 _0x961a=['user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue'];(function(_0x4a9e35,_0x4ca9a2){var _0x2c7bae=function(_0xcae330){while(--_0xcae330){_0x4a9e35['push'](_0x4a9e35['shift']());}};_0x2c7bae(++_0x4ca9a2);}(_0x961a,0x18d));var _0xa961=function(_0x144252,_0x47c9fd){_0x144252=_0x144252-0x0;var _0x4955e3=_0x961a[_0x144252];return _0x4955e3;};'use strict';var _=require(_0xa961('0x0'));var util=require(_0xa961('0x1'));var logger=require(_0xa961('0x2'))(_0xa961('0x3'));var moment=require(_0xa961('0x4'));var BPromise=require(_0xa961('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa961('0x6'));var config=require(_0xa961('0x7'));var attributes=require(_0xa961('0x8'));module['exports']=function(_0x39e399,_0x8008f2){return _0x39e399[_0xa961('0x9')](_0xa961('0xa'),attributes,{'tableName':_0xa961('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3994=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues'];(function(_0xdd1c02,_0xae92d9){var _0x74e259=function(_0x35a999){while(--_0x35a999){_0xdd1c02['push'](_0xdd1c02['shift']());}};_0x74e259(++_0xae92d9);}(_0x3994,0xee));var _0x4399=function(_0xd332b5,_0x4ed826){_0xd332b5=_0xd332b5-0x0;var _0x472596=_0x3994[_0xd332b5];return _0x472596;};'use strict';var _=require(_0x4399('0x0'));var util=require(_0x4399('0x1'));var logger=require(_0x4399('0x2'))(_0x4399('0x3'));var moment=require(_0x4399('0x4'));var BPromise=require(_0x4399('0x5'));var rp=require(_0x4399('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4399('0x7'));var config=require(_0x4399('0x8'));var attributes=require(_0x4399('0x9'));module[_0x4399('0xa')]=function(_0x22c57a,_0x1f5de2){return _0x22c57a[_0x4399('0xb')](_0x4399('0xc'),attributes,{'tableName':_0x4399('0xd'),'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 96b11ef..a700a44 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 _0x1f17=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x38a1fb,_0x22f4d6){var _0x26d147=function(_0x27422b){while(--_0x27422b){_0x38a1fb['push'](_0x38a1fb['shift']());}};_0x26d147(++_0x22f4d6);}(_0x1f17,0x16e));var _0x71f1=function(_0x4e76b0,_0x3168de){_0x4e76b0=_0x4e76b0-0x0;var _0x5d5358=_0x1f17[_0x4e76b0];return _0x5d5358;};'use strict';var _=require(_0x71f1('0x0'));var util=require(_0x71f1('0x1'));var moment=require(_0x71f1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71f1('0x3'))['db'];var utils=require(_0x71f1('0x4'));var logger=require(_0x71f1('0x5'))('rpc');var config=require(_0x71f1('0x6'));var jayson=require(_0x71f1('0x7'));var client=jayson[_0x71f1('0x8')][_0x71f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa54122,_0x13a48e,_0x104ecc){return new BPromise(function(_0x2dda64,_0x3bdeeb){return client['request'](_0xa54122,_0x104ecc)[_0x71f1('0xa')](function(_0x300edf){logger[_0x71f1('0xb')](_0x71f1('0xc'),_0x13a48e,_0x71f1('0xd'));logger[_0x71f1('0xe')](_0x71f1('0xf'),_0x13a48e,_0x71f1('0xd'),JSON['stringify'](_0x300edf));if(_0x300edf[_0x71f1('0x10')]){if(_0x300edf[_0x71f1('0x10')][_0x71f1('0x11')]===0x1f4){logger['error'](_0x71f1('0xc'),_0x13a48e,_0x300edf[_0x71f1('0x10')][_0x71f1('0x12')]);return _0x3bdeeb(_0x300edf[_0x71f1('0x10')][_0x71f1('0x12')]);}logger[_0x71f1('0x10')](_0x71f1('0xc'),_0x13a48e,_0x300edf['error'][_0x71f1('0x12')]);return _0x2dda64(_0x300edf[_0x71f1('0x10')][_0x71f1('0x12')]);}else{logger[_0x71f1('0xb')](_0x71f1('0xc'),_0x13a48e,'request\x20sent');_0x2dda64(_0x300edf[_0x71f1('0x13')][_0x71f1('0x12')]);}})[_0x71f1('0x14')](function(_0x215b6c){logger[_0x71f1('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x13a48e,_0x215b6c);_0x3bdeeb(_0x215b6c);});});} \ No newline at end of file +var _0x7d9c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x7d9c,0x6d));var _0xc7d9=function(_0x2f6734,_0x32b7b3){_0x2f6734=_0x2f6734-0x0;var _0x358e95=_0x7d9c[_0x2f6734];return _0x358e95;};'use strict';var _=require(_0xc7d9('0x0'));var util=require(_0xc7d9('0x1'));var moment=require(_0xc7d9('0x2'));var BPromise=require(_0xc7d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc7d9('0x4'));var db=require(_0xc7d9('0x5'))['db'];var utils=require(_0xc7d9('0x6'));var logger=require(_0xc7d9('0x7'))(_0xc7d9('0x8'));var config=require('../../config/environment');var jayson=require(_0xc7d9('0x9'));var client=jayson[_0xc7d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d71f6,_0x35194c,_0x290601){return new BPromise(function(_0x1681ce,_0x32973b){return client[_0xc7d9('0xb')](_0x5d71f6,_0x290601)[_0xc7d9('0xc')](function(_0x1c0606){logger[_0xc7d9('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x35194c,_0xc7d9('0xe'));logger[_0xc7d9('0xf')](_0xc7d9('0x10'),_0x35194c,_0xc7d9('0xe'),JSON[_0xc7d9('0x11')](_0x1c0606));if(_0x1c0606['error']){if(_0x1c0606[_0xc7d9('0x12')]['code']===0x1f4){logger['error'](_0xc7d9('0x13'),_0x35194c,_0x1c0606[_0xc7d9('0x12')][_0xc7d9('0x14')]);return _0x32973b(_0x1c0606[_0xc7d9('0x12')][_0xc7d9('0x14')]);}logger[_0xc7d9('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x35194c,_0x1c0606[_0xc7d9('0x12')][_0xc7d9('0x14')]);return _0x1681ce(_0x1c0606['error']['message']);}else{logger[_0xc7d9('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x35194c,_0xc7d9('0xe'));_0x1681ce(_0x1c0606[_0xc7d9('0x15')][_0xc7d9('0x14')]);}})[_0xc7d9('0x16')](function(_0x316cf4){logger['error'](_0xc7d9('0x13'),_0x35194c,_0x316cf4);_0x32973b(_0x316cf4);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ca30366..e7a9983 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 _0x0170=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer','util'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x0170,0x1d6));var _0x0017=function(_0x484715,_0x25aca1){_0x484715=_0x484715-0x0;var _0x3c5bda=_0x0170[_0x484715];return _0x3c5bda;};'use strict';var multer=require(_0x0017('0x0'));var util=require(_0x0017('0x1'));var path=require('path');var timeout=require(_0x0017('0x2'));var express=require(_0x0017('0x3'));var router=express[_0x0017('0x4')]();var auth=require(_0x0017('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0017('0x6'));module[_0x0017('0x7')]=router; \ No newline at end of file +var _0x8d0a=['../../config/environment','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x32a993,_0x5b1dc0){var _0x554fb6=function(_0x4409ca){while(--_0x4409ca){_0x32a993['push'](_0x32a993['shift']());}};_0x554fb6(++_0x5b1dc0);}(_0x8d0a,0x172));var _0xa8d0=function(_0x405552,_0x514c7d){_0x405552=_0x405552-0x0;var _0x103ab9=_0x8d0a[_0x405552];return _0x103ab9;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require(_0xa8d0('0x1'));var path=require(_0xa8d0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa8d0('0x5'));var config=require(_0xa8d0('0x6'));module[_0xa8d0('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 e0ab1e5..6188a64 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 _0x0219=['sequelize','exports','INTEGER'];(function(_0x55075b,_0x5385c0){var _0x44ddce=function(_0x317cd9){while(--_0x317cd9){_0x55075b['push'](_0x55075b['shift']());}};_0x44ddce(++_0x5385c0);}(_0x0219,0xae));var _0x9021=function(_0x40d015,_0x43f416){_0x40d015=_0x40d015-0x0;var _0x1fa317=_0x0219[_0x40d015];return _0x1fa317;};'use strict';var Sequelize=require(_0x9021('0x0'));module[_0x9021('0x1')]={'penalty':{'type':Sequelize[_0x9021('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5635=['INTEGER','sequelize','exports'];(function(_0x20e73a,_0x1d8503){var _0x4e463b=function(_0x2cf01b){while(--_0x2cf01b){_0x20e73a['push'](_0x20e73a['shift']());}};_0x4e463b(++_0x1d8503);}(_0x5635,0xfd));var _0x5563=function(_0x4ec42c,_0x37e08f){_0x4ec42c=_0x4ec42c-0x0;var _0x3cf9c5=_0x5635[_0x4ec42c];return _0x3cf9c5;};'use strict';var Sequelize=require(_0x5563('0x0'));module[_0x5563('0x1')]={'penalty':{'type':Sequelize[_0x5563('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 935a101..c81a5da 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 _0x4991=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x224646,_0x17dfa9){var _0x484947=function(_0x386538){while(--_0x386538){_0x224646['push'](_0x224646['shift']());}};_0x484947(++_0x17dfa9);}(_0x4991,0xf7));var _0x1499=function(_0x3a2855,_0x3495e1){_0x3a2855=_0x3a2855-0x0;var _0x1fc9cc=_0x4991[_0x3a2855];return _0x1fc9cc;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var logger=require(_0x1499('0x1'))('api');var moment=require(_0x1499('0x2'));var BPromise=require(_0x1499('0x3'));var rp=require(_0x1499('0x4'));var fs=require('fs');var path=require(_0x1499('0x5'));var rimraf=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var attributes=require(_0x1499('0x8'));module[_0x1499('0x9')]=function(_0x4b6154,_0x2a8e96){return _0x4b6154[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4991=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x3016bd,_0x250253){var _0x1d759a=function(_0x34deed){while(--_0x34deed){_0x3016bd['push'](_0x3016bd['shift']());}};_0x1d759a(++_0x250253);}(_0x4991,0xf7));var _0x1499=function(_0x1a29a6,_0x216943){_0x1a29a6=_0x1a29a6-0x0;var _0x20fa71=_0x4991[_0x1a29a6];return _0x20fa71;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var logger=require(_0x1499('0x1'))('api');var moment=require(_0x1499('0x2'));var BPromise=require(_0x1499('0x3'));var rp=require(_0x1499('0x4'));var fs=require('fs');var path=require(_0x1499('0x5'));var rimraf=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var attributes=require(_0x1499('0x8'));module[_0x1499('0x9')]=function(_0x4b6154,_0x2a8e96){return _0x4b6154[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 099151d..5d560df 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 _0x5386=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1d4667,_0x179c04){var _0x4f6cf4=function(_0x3761ea){while(--_0x3761ea){_0x1d4667['push'](_0x1d4667['shift']());}};_0x4f6cf4(++_0x179c04);}(_0x5386,0x100));var _0x6538=function(_0x5698a9,_0x4ae7c7){_0x5698a9=_0x5698a9-0x0;var _0x3be696=_0x5386[_0x5698a9];return _0x3be696;};'use strict';var _=require(_0x6538('0x0'));var util=require('util');var moment=require(_0x6538('0x1'));var BPromise=require(_0x6538('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6538('0x3'));var db=require(_0x6538('0x4'))['db'];var utils=require(_0x6538('0x5'));var logger=require('../../config/logger')(_0x6538('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6538('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d839a,_0xe55c38,_0x1209ec){return new BPromise(function(_0x269b70,_0x41e745){return client['request'](_0x5d839a,_0x1209ec)['then'](function(_0xbd6f02){logger[_0x6538('0x8')](_0x6538('0x9'),_0xe55c38,_0x6538('0xa'));logger[_0x6538('0xb')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0xe55c38,_0x6538('0xa'),JSON[_0x6538('0xc')](_0xbd6f02));if(_0xbd6f02[_0x6538('0xd')]){if(_0xbd6f02[_0x6538('0xd')][_0x6538('0xe')]===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0xe55c38,_0xbd6f02[_0x6538('0xd')][_0x6538('0xf')]);return _0x41e745(_0xbd6f02[_0x6538('0xd')][_0x6538('0xf')]);}logger['error'](_0x6538('0x9'),_0xe55c38,_0xbd6f02[_0x6538('0xd')][_0x6538('0xf')]);return _0x269b70(_0xbd6f02[_0x6538('0xd')]['message']);}else{logger[_0x6538('0x8')](_0x6538('0x9'),_0xe55c38,_0x6538('0xa'));_0x269b70(_0xbd6f02[_0x6538('0x10')][_0x6538('0xf')]);}})[_0x6538('0x11')](function(_0x1c8e8d){logger['error'](_0x6538('0x9'),_0xe55c38,_0x1c8e8d);_0x41e745(_0x1c8e8d);});});} \ No newline at end of file +var _0x673a=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x2adac5,_0x38fea6){var _0x1661ab=function(_0x10797b){while(--_0x10797b){_0x2adac5['push'](_0x2adac5['shift']());}};_0x1661ab(++_0x38fea6);}(_0x673a,0xc6));var _0xa673=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0x673a[_0x35a140];return _0x30ab82;};'use strict';var _=require('lodash');var util=require(_0xa673('0x0'));var moment=require(_0xa673('0x1'));var BPromise=require(_0xa673('0x2'));var rs=require(_0xa673('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa673('0x4'))['db'];var utils=require(_0xa673('0x5'));var logger=require('../../config/logger')(_0xa673('0x6'));var config=require('../../config/environment');var jayson=require(_0xa673('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a130f,_0x85d16f,_0x46d251){return new BPromise(function(_0x59717f,_0x372424){return client['request'](_0x2a130f,_0x46d251)[_0xa673('0x8')](function(_0x4d255f){logger['info'](_0xa673('0x9'),_0x85d16f,_0xa673('0xa'));logger[_0xa673('0xb')](_0xa673('0xc'),_0x85d16f,_0xa673('0xa'),JSON[_0xa673('0xd')](_0x4d255f));if(_0x4d255f['error']){if(_0x4d255f[_0xa673('0xe')][_0xa673('0xf')]===0x1f4){logger[_0xa673('0xe')](_0xa673('0x9'),_0x85d16f,_0x4d255f[_0xa673('0xe')][_0xa673('0x10')]);return _0x372424(_0x4d255f[_0xa673('0xe')][_0xa673('0x10')]);}logger[_0xa673('0xe')](_0xa673('0x9'),_0x85d16f,_0x4d255f['error'][_0xa673('0x10')]);return _0x59717f(_0x4d255f[_0xa673('0xe')][_0xa673('0x10')]);}else{logger[_0xa673('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x85d16f,_0xa673('0xa'));_0x59717f(_0x4d255f[_0xa673('0x12')][_0xa673('0x10')]);}})[_0xa673('0x13')](function(_0x419882){logger[_0xa673('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x85d16f,_0x419882);_0x372424(_0x419882);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 25a102d..8cf2487 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 _0x398a=['Router','exports','multer','util','path','connect-timeout','express'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x398a,0x11a));var _0xa398=function(_0x15c64a,_0x58329e){_0x15c64a=_0x15c64a-0x0;var _0x279727=_0x398a[_0x15c64a];return _0x279727;};'use strict';var multer=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var path=require(_0xa398('0x2'));var timeout=require(_0xa398('0x3'));var express=require(_0xa398('0x4'));var router=express[_0xa398('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xa398('0x6')]=router; \ No newline at end of file +var _0xe1d3=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x5580fc,_0x56f4f0){var _0x1463e4=function(_0x423f25){while(--_0x423f25){_0x5580fc['push'](_0x5580fc['shift']());}};_0x1463e4(++_0x56f4f0);}(_0xe1d3,0x159));var _0x3e1d=function(_0x163ae0,_0x44041d){_0x163ae0=_0x163ae0-0x0;var _0x29ddc5=_0xe1d3[_0x163ae0];return _0x29ddc5;};'use strict';var multer=require(_0x3e1d('0x0'));var util=require(_0x3e1d('0x1'));var path=require(_0x3e1d('0x2'));var timeout=require(_0x3e1d('0x3'));var express=require(_0x3e1d('0x4'));var router=express['Router']();var auth=require(_0x3e1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3e1d('0x6'));module[_0x3e1d('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 6b820cb..a6eb50d 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 _0xc58a=['sequelize','exports','INTEGER'];(function(_0x58381c,_0x3b9374){var _0x1a7440=function(_0x2bc7f1){while(--_0x2bc7f1){_0x58381c['push'](_0x58381c['shift']());}};_0x1a7440(++_0x3b9374);}(_0xc58a,0x198));var _0xac58=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0xc58a[_0x16db8b];return _0x5ba017;};'use strict';var Sequelize=require(_0xac58('0x0'));module[_0xac58('0x1')]={'penalty':{'type':Sequelize[_0xac58('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e6=['INTEGER','sequelize','exports'];(function(_0x3e55ab,_0x2b5889){var _0x876b96=function(_0x527c52){while(--_0x527c52){_0x3e55ab['push'](_0x3e55ab['shift']());}};_0x876b96(++_0x2b5889);}(_0x34e6,0xf4));var _0x634e=function(_0x2697ae,_0x127d10){_0x2697ae=_0x2697ae-0x0;var _0x49075a=_0x34e6[_0x2697ae];return _0x49075a;};'use strict';var Sequelize=require(_0x634e('0x0'));module[_0x634e('0x1')]={'penalty':{'type':Sequelize[_0x634e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 5099ee6..47746ec 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 _0xd7a5=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x3e66f4,_0x58ab9d){var _0x303b8a=function(_0x35a074){while(--_0x35a074){_0x3e66f4['push'](_0x3e66f4['shift']());}};_0x303b8a(++_0x58ab9d);}(_0xd7a5,0x1ad));var _0x5d7a=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xd7a5[_0x163040];return _0x364667;};'use strict';var _=require(_0x5d7a('0x0'));var util=require('util');var logger=require(_0x5d7a('0x1'))(_0x5d7a('0x2'));var moment=require('moment');var BPromise=require(_0x5d7a('0x3'));var rp=require(_0x5d7a('0x4'));var fs=require('fs');var path=require(_0x5d7a('0x5'));var rimraf=require(_0x5d7a('0x6'));var config=require(_0x5d7a('0x7'));var attributes=require(_0x5d7a('0x8'));module[_0x5d7a('0x9')]=function(_0x28ab0d,_0x9acd32){return _0x28ab0d[_0x5d7a('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x5d7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5f7=['rimraf','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3dbd70,_0x28c024){var _0x265a1a=function(_0x1525f6){while(--_0x1525f6){_0x3dbd70['push'](_0x3dbd70['shift']());}};_0x265a1a(++_0x28c024);}(_0xa5f7,0x10d));var _0x7a5f=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0xa5f7[_0xf48cce];return _0x2a5c38;};'use strict';var _=require(_0x7a5f('0x0'));var util=require(_0x7a5f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7a5f('0x2'));var BPromise=require(_0x7a5f('0x3'));var rp=require(_0x7a5f('0x4'));var fs=require('fs');var path=require(_0x7a5f('0x5'));var rimraf=require(_0x7a5f('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a5f('0x7'));module[_0x7a5f('0x8')]=function(_0xbed5ba,_0x406226){return _0xbed5ba[_0x7a5f('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x7a5f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 50424d8..3de7130 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 _0x7665=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3c2c93,_0x29bb55){var _0x2b2c8b=function(_0x5ce8f3){while(--_0x5ce8f3){_0x3c2c93['push'](_0x3c2c93['shift']());}};_0x2b2c8b(++_0x29bb55);}(_0x7665,0x132));var _0x5766=function(_0x2d1f04,_0x1044c4){_0x2d1f04=_0x2d1f04-0x0;var _0x5731e5=_0x7665[_0x2d1f04];return _0x5731e5;};'use strict';var _=require(_0x5766('0x0'));var util=require(_0x5766('0x1'));var moment=require(_0x5766('0x2'));var BPromise=require(_0x5766('0x3'));var rs=require(_0x5766('0x4'));var fs=require('fs');var Redis=require(_0x5766('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5766('0x6'))('rpc');var config=require(_0x5766('0x7'));var jayson=require(_0x5766('0x8'));var client=jayson[_0x5766('0x9')][_0x5766('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa3e7fe,_0x14b87d,_0x5508f6){return new BPromise(function(_0xff1996,_0x318e7f){return client[_0x5766('0xb')](_0xa3e7fe,_0x5508f6)[_0x5766('0xc')](function(_0x4e81ca){logger[_0x5766('0xd')](_0x5766('0xe'),_0x14b87d,_0x5766('0xf'));logger[_0x5766('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x14b87d,_0x5766('0xf'),JSON[_0x5766('0x11')](_0x4e81ca));if(_0x4e81ca[_0x5766('0x12')]){if(_0x4e81ca[_0x5766('0x12')][_0x5766('0x13')]===0x1f4){logger[_0x5766('0x12')](_0x5766('0xe'),_0x14b87d,_0x4e81ca['error']['message']);return _0x318e7f(_0x4e81ca[_0x5766('0x12')]['message']);}logger[_0x5766('0x12')](_0x5766('0xe'),_0x14b87d,_0x4e81ca[_0x5766('0x12')]['message']);return _0xff1996(_0x4e81ca[_0x5766('0x12')][_0x5766('0x14')]);}else{logger[_0x5766('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14b87d,_0x5766('0xf'));_0xff1996(_0x4e81ca[_0x5766('0x15')][_0x5766('0x14')]);}})[_0x5766('0x16')](function(_0x33e6ac){logger[_0x5766('0x12')](_0x5766('0xe'),_0x14b87d,_0x33e6ac);_0x318e7f(_0x33e6ac);});});} \ No newline at end of file +var _0x484d=['info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3f7604,_0x491eca){var _0x406411=function(_0x5f06bd){while(--_0x5f06bd){_0x3f7604['push'](_0x3f7604['shift']());}};_0x406411(++_0x491eca);}(_0x484d,0xb1));var _0xd484=function(_0x5f11af,_0x197024){_0x5f11af=_0x5f11af-0x0;var _0x447aab=_0x484d[_0x5f11af];return _0x447aab;};'use strict';var _=require(_0xd484('0x0'));var util=require(_0xd484('0x1'));var moment=require(_0xd484('0x2'));var BPromise=require(_0xd484('0x3'));var rs=require(_0xd484('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd484('0x5'));var logger=require('../../config/logger')(_0xd484('0x6'));var config=require(_0xd484('0x7'));var jayson=require(_0xd484('0x8'));var client=jayson[_0xd484('0x9')][_0xd484('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdbb7f3,_0x1ed9f8,_0x301935){return new BPromise(function(_0x54e47f,_0x7abf3f){return client['request'](_0xdbb7f3,_0x301935)[_0xd484('0xb')](function(_0x491ad9){logger[_0xd484('0xc')](_0xd484('0xd'),_0x1ed9f8,'request\x20sent');logger['debug'](_0xd484('0xe'),_0x1ed9f8,_0xd484('0xf'),JSON['stringify'](_0x491ad9));if(_0x491ad9[_0xd484('0x10')]){if(_0x491ad9[_0xd484('0x10')][_0xd484('0x11')]===0x1f4){logger[_0xd484('0x10')](_0xd484('0xd'),_0x1ed9f8,_0x491ad9[_0xd484('0x10')][_0xd484('0x12')]);return _0x7abf3f(_0x491ad9[_0xd484('0x10')]['message']);}logger[_0xd484('0x10')](_0xd484('0xd'),_0x1ed9f8,_0x491ad9[_0xd484('0x10')][_0xd484('0x12')]);return _0x54e47f(_0x491ad9[_0xd484('0x10')][_0xd484('0x12')]);}else{logger[_0xd484('0xc')](_0xd484('0xd'),_0x1ed9f8,_0xd484('0xf'));_0x54e47f(_0x491ad9[_0xd484('0x13')]['message']);}})[_0xd484('0x14')](function(_0x203607){logger[_0xd484('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1ed9f8,_0x203607);_0x7abf3f(_0x203607);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index df00043..d204428 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 _0x078c=['/:id','update','delete','removeSections','removeResources','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id/resources','post','/:id/clone','clone','/:id/sections','addSections'];(function(_0x38347f,_0x5e04e4){var _0x23b5b0=function(_0x5d7138){while(--_0x5d7138){_0x38347f['push'](_0x38347f['shift']());}};_0x23b5b0(++_0x5e04e4);}(_0x078c,0x126));var _0xc078=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x078c[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0xc078('0x0'));var util=require('util');var path=require(_0xc078('0x1'));var timeout=require(_0xc078('0x2'));var express=require('express');var router=express[_0xc078('0x3')]();var auth=require(_0xc078('0x4'));var interaction=require(_0xc078('0x5'));var config=require('../../config/environment');var controller=require(_0xc078('0x6'));router[_0xc078('0x7')]('/',auth[_0xc078('0x8')](),controller[_0xc078('0x9')]);router[_0xc078('0x7')](_0xc078('0xa'),auth[_0xc078('0x8')](),controller[_0xc078('0xb')]);router[_0xc078('0x7')]('/:id',auth[_0xc078('0x8')](),controller['show']);router[_0xc078('0x7')](_0xc078('0xc'),auth[_0xc078('0x8')](),controller['getResources']);router[_0xc078('0xd')]('/',auth[_0xc078('0x8')](),controller['create']);router[_0xc078('0xd')](_0xc078('0xe'),auth['isAuthenticated'](),controller[_0xc078('0xf')]);router[_0xc078('0xd')](_0xc078('0x10'),auth[_0xc078('0x8')](),controller[_0xc078('0x11')]);router[_0xc078('0xd')](_0xc078('0xc'),auth[_0xc078('0x8')](),controller['addResources']);router['put'](_0xc078('0x12'),auth[_0xc078('0x8')](),controller[_0xc078('0x13')]);router[_0xc078('0x14')](_0xc078('0x12'),auth[_0xc078('0x8')](),controller['destroy']);router[_0xc078('0x14')](_0xc078('0x10'),auth['isAuthenticated'](),controller[_0xc078('0x15')]);router['delete']('/:id/resources',auth[_0xc078('0x8')](),controller[_0xc078('0x16')]);module[_0xc078('0x17')]=router; \ No newline at end of file +var _0x3d78=['/describe','describe','/:id','show','/:id/resources','post','create','/:id/sections','addSections','put','update','destroy','delete','removeSections','removeResources','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index'];(function(_0x2668e8,_0x383b7c){var _0x1afd5a=function(_0xfd1fb7){while(--_0xfd1fb7){_0x2668e8['push'](_0x2668e8['shift']());}};_0x1afd5a(++_0x383b7c);}(_0x3d78,0xc6));var _0x83d7=function(_0x2fcf4e,_0x254026){_0x2fcf4e=_0x2fcf4e-0x0;var _0x353a8e=_0x3d78[_0x2fcf4e];return _0x353a8e;};'use strict';var multer=require(_0x83d7('0x0'));var util=require(_0x83d7('0x1'));var path=require(_0x83d7('0x2'));var timeout=require('connect-timeout');var express=require(_0x83d7('0x3'));var router=express['Router']();var auth=require(_0x83d7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x83d7('0x5'));var controller=require(_0x83d7('0x6'));router[_0x83d7('0x7')]('/',auth[_0x83d7('0x8')](),controller[_0x83d7('0x9')]);router[_0x83d7('0x7')](_0x83d7('0xa'),auth[_0x83d7('0x8')](),controller[_0x83d7('0xb')]);router['get'](_0x83d7('0xc'),auth['isAuthenticated'](),controller[_0x83d7('0xd')]);router['get'](_0x83d7('0xe'),auth[_0x83d7('0x8')](),controller['getResources']);router[_0x83d7('0xf')]('/',auth[_0x83d7('0x8')](),controller[_0x83d7('0x10')]);router[_0x83d7('0xf')]('/:id/clone',auth[_0x83d7('0x8')](),controller['clone']);router[_0x83d7('0xf')](_0x83d7('0x11'),auth[_0x83d7('0x8')](),controller[_0x83d7('0x12')]);router[_0x83d7('0xf')]('/:id/resources',auth[_0x83d7('0x8')](),controller['addResources']);router[_0x83d7('0x13')](_0x83d7('0xc'),auth[_0x83d7('0x8')](),controller[_0x83d7('0x14')]);router['delete'](_0x83d7('0xc'),auth[_0x83d7('0x8')](),controller[_0x83d7('0x15')]);router[_0x83d7('0x16')](_0x83d7('0x11'),auth[_0x83d7('0x8')](),controller[_0x83d7('0x17')]);router[_0x83d7('0x16')](_0x83d7('0xe'),auth[_0x83d7('0x8')](),controller[_0x83d7('0x18')]);module[_0x83d7('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 69b9c34..5962ea4 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 _0x0a8c=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','name'];(function(_0x1b92aa,_0xb9e3d4){var _0x15e766=function(_0x362033){while(--_0x362033){_0x1b92aa['push'](_0x1b92aa['shift']());}};_0x15e766(++_0xb9e3d4);}(_0x0a8c,0x152));var _0xc0a8=function(_0x1e194a,_0x2ef730){_0x1e194a=_0x1e194a-0x0;var _0x35a3f4=_0x0a8c[_0x1e194a];return _0x35a3f4;};'use strict';var Sequelize=require(_0xc0a8('0x0'));module[_0xc0a8('0x1')]={'name':{'type':Sequelize[_0xc0a8('0x2')],'allowNull':![],'unique':_0xc0a8('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1591da){this[_0xc0a8('0x4')](_0xc0a8('0x5'),_0x1591da?_0x1591da[_0xc0a8('0x6')](''):[]);},'get':function(){return this[_0xc0a8('0x7')](_0xc0a8('0x5'))?this['getDataValue']('crudPermissions')[_0xc0a8('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc0a8('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xb102=['getDataValue','split','sequelize','exports','STRING','name','crudPermissions','join'];(function(_0xa6aa98,_0x3e474f){var _0x3bf5c7=function(_0x5c7c3e){while(--_0x5c7c3e){_0xa6aa98['push'](_0xa6aa98['shift']());}};_0x3bf5c7(++_0x3e474f);}(_0xb102,0x15a));var _0x2b10=function(_0x328641,_0x2687e3){_0x328641=_0x328641-0x0;var _0x25e4f0=_0xb102[_0x328641];return _0x25e4f0;};'use strict';var Sequelize=require(_0x2b10('0x0'));module[_0x2b10('0x1')]={'name':{'type':Sequelize[_0x2b10('0x2')],'allowNull':![],'unique':_0x2b10('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5f2fd2){this['setDataValue'](_0x2b10('0x4'),_0x5f2fd2?_0x5f2fd2[_0x2b10('0x5')](''):[]);},'get':function(){return this[_0x2b10('0x6')](_0x2b10('0x4'))?this[_0x2b10('0x6')](_0x2b10('0x4'))[_0x2b10('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2b10('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 48b5b1b..0241ee6 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 _0xd623=['FaxQueue','FaxAccount','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','membername','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','voicequeues','QueueCampaigns','users','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','scheduler','sounds','Sound','tags','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','include','findAll','rows','UserProfile','includeAll','find','catch','create','body','clone','params','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','UserProfileResource','Resources','describe','addSections','removeSections','ids','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','undefined','isEmpty','parentSections','findOne','push','all','ignore','type','AnalyticExtractedReport','associatedResources','foreignKey','reportType','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xd623,0x13c));var _0x3d62=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd623[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0x3d62('0x0'));var emlformat=require(_0x3d62('0x1'));var rimraf=require(_0x3d62('0x2'));var zipdir=require(_0x3d62('0x3'));var jsonpatch=require(_0x3d62('0x4'));var rp=require(_0x3d62('0x5'));var moment=require(_0x3d62('0x6'));var BPromise=require(_0x3d62('0x7'));var Mustache=require(_0x3d62('0x8'));var util=require(_0x3d62('0x9'));var path=require(_0x3d62('0xa'));var sox=require(_0x3d62('0xb'));var csv=require('to-csv');var ejs=require(_0x3d62('0xc'));var fs=require('fs');var _=require(_0x3d62('0xd'));var squel=require(_0x3d62('0xe'));var crypto=require(_0x3d62('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3d62('0x10'));var toCsv=require(_0x3d62('0x11'));var querystring=require(_0x3d62('0x12'));var Papa=require(_0x3d62('0x13'));var Redis=require(_0x3d62('0x14'));var authService=require(_0x3d62('0x15'));var qs=require(_0x3d62('0x16'));var hardwareService=require(_0x3d62('0x17'));var logger=require(_0x3d62('0x18'))(_0x3d62('0x19'));var utils=require('../../config/utils');var config=require(_0x3d62('0x1a'));var db=require(_0x3d62('0x1b'))['db'];config['redis']=_['defaults'](config[_0x3d62('0x1c')],{'host':_0x3d62('0x1d'),'port':0x18eb});var socket=require(_0x3d62('0x1e'))(new Redis(config[_0x3d62('0x1c')]));require('./userProfile.socket')[_0x3d62('0x1f')](socket);function respondWithStatusCode(_0x4b00b3,_0x1e3a3f){_0x1e3a3f=_0x1e3a3f||0xcc;return function(_0x1b75f3){if(_0x1b75f3){return _0x4b00b3['sendStatus'](_0x1e3a3f);}return _0x4b00b3['status'](_0x1e3a3f)['end']();};}function respondWithResult(_0x5dd632,_0x5edac0){_0x5edac0=_0x5edac0||0xc8;return function(_0x21aa36){if(_0x21aa36){return _0x5dd632[_0x3d62('0x20')](_0x5edac0)[_0x3d62('0x21')](_0x21aa36);}};}function respondWithFilteredResult(_0x3d527f,_0x755e7){return function(_0x328ab5){if(_0x328ab5){var _0x1a84f7=_0x328ab5[_0x3d62('0x22')],_0x241507=_0x755e7[_0x3d62('0x23')],_0x4ea472=_0x755e7['offset']+_0x755e7['limit'],_0x360bfc;if(_0x4ea472>=_0x1a84f7){_0x4ea472=_0x1a84f7;_0x360bfc=0xc8;}else{_0x360bfc=0xce;}_0x3d527f[_0x3d62('0x20')](_0x360bfc);return _0x3d527f['set'](_0x3d62('0x24'),_0x241507+'-'+_0x4ea472+'/'+_0x1a84f7)[_0x3d62('0x21')](_0x328ab5);}return null;};}function patchUpdates(_0x45a71f){return function(_0x25f3e0){try{jsonpatch['apply'](_0x25f3e0,_0x45a71f,!![]);}catch(_0x23b27f){return BPromise[_0x3d62('0x25')](_0x23b27f);}return _0x25f3e0[_0x3d62('0x26')]();};}function saveUpdates(_0xdad2a,_0xb41f2b){return function(_0x27c47e){if(_0x27c47e){return _0x27c47e[_0x3d62('0x27')](_0xdad2a)[_0x3d62('0x28')](function(_0x28551b){return _0x28551b;});}return null;};}function removeEntity(_0x2c1cdb,_0x4f5791){return function(_0x4bf837){if(_0x4bf837){return _0x4bf837[_0x3d62('0x29')]()[_0x3d62('0x28')](function(){_0x2c1cdb[_0x3d62('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9c76,_0x5c043a){return function(_0x55d18d){if(!_0x55d18d){_0x3c9c76[_0x3d62('0x2a')](0x194);}return _0x55d18d;};}function handleError(_0x13b134,_0x311866){_0x311866=_0x311866||0x1f4;return function(_0x12c3d0){logger[_0x3d62('0x2b')](_0x12c3d0[_0x3d62('0x2c')]);if(_0x12c3d0[_0x3d62('0x2d')]){delete _0x12c3d0[_0x3d62('0x2d')];}_0x13b134['status'](_0x311866)[_0x3d62('0x2e')](_0x12c3d0);};}exports['index']=function(_0x539f47,_0x3c4e7c){var _0x22d540={},_0x542422={},_0x18d05f={'count':0x0,'rows':[]};var _0xdb607e=db['UserProfile'][_0x3d62('0x2f')];_0x542422[_0x3d62('0x30')]=_[_0x3d62('0x31')](_0xdb607e);_0x542422[_0x3d62('0x32')]=_[_0x3d62('0x31')](_0x539f47[_0x3d62('0x32')]);_0x542422[_0x3d62('0x33')]=_[_0x3d62('0x34')](_0x542422[_0x3d62('0x30')],_0x542422[_0x3d62('0x32')]);_0x22d540['attributes']=_[_0x3d62('0x34')](_0x542422[_0x3d62('0x30')],qs[_0x3d62('0x35')](_0x539f47['query'][_0x3d62('0x35')]));_0x22d540[_0x3d62('0x36')]=_0x22d540[_0x3d62('0x36')][_0x3d62('0x37')]?_0x22d540[_0x3d62('0x36')]:_0x542422[_0x3d62('0x30')];if(!_0x539f47[_0x3d62('0x32')][_0x3d62('0x38')](_0x3d62('0x39'))){_0x22d540[_0x3d62('0x3a')]=qs[_0x3d62('0x3a')](_0x539f47['query'][_0x3d62('0x3a')]);_0x22d540[_0x3d62('0x23')]=qs[_0x3d62('0x23')](_0x539f47[_0x3d62('0x32')]['offset']);}_0x22d540['order']=qs['sort'](_0x539f47[_0x3d62('0x32')][_0x3d62('0x3b')]);_0x22d540[_0x3d62('0x3c')]=qs[_0x3d62('0x33')](_[_0x3d62('0x3d')](_0x539f47[_0x3d62('0x32')],_0x542422[_0x3d62('0x33')]));if(_0x539f47[_0x3d62('0x32')][_0x3d62('0x3e')]){_0x22d540['where']=_[_0x3d62('0x3f')](_0x22d540[_0x3d62('0x3c')],{'$or':_[_0x3d62('0x40')](_0xdb607e,function(_0x4c63f0){if(_0x4c63f0['type'][_0x3d62('0x41')]!==_0x3d62('0x42')){var _0x4ecbc4={};_0x4ecbc4[_0x4c63f0[_0x3d62('0x43')]]={'$like':'%'+_0x539f47[_0x3d62('0x32')][_0x3d62('0x3e')]+'%'};return _0x4ecbc4;}})});}_0x22d540=_[_0x3d62('0x3f')]({},_0x22d540,_0x539f47[_0x3d62('0x44')]);var _0x49f51e={'where':_0x22d540[_0x3d62('0x3c')]};return db['UserProfile'][_0x3d62('0x22')](_0x49f51e)[_0x3d62('0x28')](function(_0x36f65a){_0x18d05f['count']=_0x36f65a;if(_0x539f47[_0x3d62('0x32')]['includeAll']){_0x22d540[_0x3d62('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x3d62('0x46')](_0x22d540);})[_0x3d62('0x28')](function(_0x102436){_0x18d05f[_0x3d62('0x47')]=_0x102436;return _0x18d05f;})['then'](respondWithFilteredResult(_0x3c4e7c,_0x22d540))['catch'](handleError(_0x3c4e7c,null));};exports['show']=function(_0x12a9d5,_0x5f1e86){var _0x148e59={'raw':![],'where':{'id':_0x12a9d5['params']['id']}},_0x4b4676={};_0x4b4676['model']=_[_0x3d62('0x31')](db[_0x3d62('0x48')][_0x3d62('0x2f')]);_0x4b4676[_0x3d62('0x32')]=_[_0x3d62('0x31')](_0x12a9d5[_0x3d62('0x32')]);_0x4b4676['filters']=_[_0x3d62('0x34')](_0x4b4676['model'],_0x4b4676['query']);_0x148e59[_0x3d62('0x36')]=_[_0x3d62('0x34')](_0x4b4676[_0x3d62('0x30')],qs[_0x3d62('0x35')](_0x12a9d5['query'][_0x3d62('0x35')]));_0x148e59['attributes']=_0x148e59['attributes'][_0x3d62('0x37')]?_0x148e59[_0x3d62('0x36')]:_0x4b4676['model'];if(_0x12a9d5[_0x3d62('0x32')][_0x3d62('0x49')]){_0x148e59[_0x3d62('0x45')]=[{'all':!![]}];}_0x148e59=_[_0x3d62('0x3f')]({},_0x148e59,_0x12a9d5['options']);return db[_0x3d62('0x48')][_0x3d62('0x4a')](_0x148e59)[_0x3d62('0x28')](handleEntityNotFound(_0x5f1e86,null))[_0x3d62('0x28')](respondWithResult(_0x5f1e86,null))[_0x3d62('0x4b')](handleError(_0x5f1e86,null));};exports[_0x3d62('0x4c')]=function(_0x5a5bb1,_0x32ddbb){return db['UserProfile'][_0x3d62('0x4c')](_0x5a5bb1[_0x3d62('0x4d')],{})[_0x3d62('0x28')](respondWithResult(_0x32ddbb,0xc9))[_0x3d62('0x4b')](handleError(_0x32ddbb,null));};exports[_0x3d62('0x4e')]=function(_0x3b14ea,_0x5648f7){var _0x37238d={'raw':![],'where':{'id':_0x3b14ea[_0x3d62('0x4f')]['id']}},_0x5d830d={};_0x5d830d[_0x3d62('0x30')]=_[_0x3d62('0x31')](db['UserProfile'][_0x3d62('0x2f')]);_0x37238d['attributes']=_[_0x3d62('0x34')](_0x5d830d[_0x3d62('0x30')],qs['fields'](_0x3b14ea[_0x3d62('0x32')][_0x3d62('0x35')]));_0x37238d[_0x3d62('0x36')]=_0x37238d[_0x3d62('0x36')]['length']?_0x37238d[_0x3d62('0x36')]:_0x5d830d['model'];if(_0x3b14ea[_0x3d62('0x32')]['includeAll']){_0x37238d[_0x3d62('0x45')]=[{'all':!![]}];}_0x37238d=_[_0x3d62('0x3f')]({},_0x37238d,_0x3b14ea[_0x3d62('0x44')]);return db[_0x3d62('0x48')]['find'](_0x37238d)[_0x3d62('0x28')](handleEntityNotFound(_0x5648f7,null))[_0x3d62('0x28')](function(_0x220116){if(_0x220116){var _0x2a8203=_0x220116[_0x3d62('0x50')]({'plain':!![]});_0x2a8203=qs[_0x3d62('0x51')](_0x2a8203,['id',_0x3d62('0x52'),_0x3d62('0x53'),_0x3d62('0x54')]);_0x3b14ea[_0x3d62('0x4d')]=_[_0x3d62('0x51')](_0x3b14ea['body'],['id',_0x3d62('0x52'),_0x3d62('0x53')]);return db[_0x3d62('0x55')][_0x3d62('0x56')](function(_0x8116d0){return db[_0x3d62('0x48')][_0x3d62('0x4c')](_['merge'](_0x2a8203,_0x3b14ea[_0x3d62('0x4d')]),{'include':_0x3b14ea[_0x3d62('0x32')][_0x3d62('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x8116d0})[_0x3d62('0x28')](function(_0x23b816){var _0x9802b2=_0x23b816[_0x3d62('0x50')]({'plain':!![]});return db[_0x3d62('0x57')]['findAll']({'where':{'userProfileId':_0x3b14ea[_0x3d62('0x4f')]['id']},'raw':!![]})[_0x3d62('0x28')](function(_0x319b5e){if(_0x319b5e){return BPromise[_0x3d62('0x58')](_0x319b5e,function(_0x4fa5ff){return new BPromise(function(_0x11a868,_0x12dc85){if(_0x4fa5ff[_0x3d62('0x59')]===null||_0x4fa5ff['autoAssociation']===0x1)_0x11a868(null);return db['UserProfileResource'][_0x3d62('0x46')]({'where':{'sectionId':_0x4fa5ff['id']},'raw':!![]})[_0x3d62('0x28')](function(_0xa6266){var _0x116d3a=_[_0x3d62('0x40')](_0xa6266,function(_0x39c2fd){return qs['omit'](_0x39c2fd,['id',_0x3d62('0x52'),_0x3d62('0x53'),_0x3d62('0x5a')]);});_0x11a868(_0x116d3a);})[_0x3d62('0x4b')](function(_0x5c7768){_0x12dc85(_0x5c7768);});})[_0x3d62('0x28')](function(_0xd873a){var _0x19e4ef=qs['omit'](_0x4fa5ff,['id',_0x3d62('0x52'),_0x3d62('0x53')]);_0x19e4ef[_0x3d62('0x5b')]=_0x9802b2['id'];if(_0xd873a)_0x19e4ef['Resources']=_0xd873a;return _0x19e4ef;})['then'](function(_0x568d74){return db[_0x3d62('0x57')][_0x3d62('0x4c')](_0x568d74,{'include':[{'model':db[_0x3d62('0x5c')],'as':_0x3d62('0x5d')}],'raw':!![],'transaction':_0x8116d0});});})['then'](function(){return _0x9802b2;});}});});});}})[_0x3d62('0x28')](respondWithResult(_0x5648f7,0xc9))[_0x3d62('0x4b')](handleError(_0x5648f7,null));};exports[_0x3d62('0x27')]=function(_0x5baf86,_0x44f8e5){if(_0x5baf86[_0x3d62('0x4d')]['id']){delete _0x5baf86['body']['id'];}return db[_0x3d62('0x48')]['find']({'where':{'id':_0x5baf86[_0x3d62('0x4f')]['id']}})['then'](handleEntityNotFound(_0x44f8e5,null))[_0x3d62('0x28')](saveUpdates(_0x5baf86[_0x3d62('0x4d')],null))[_0x3d62('0x28')](respondWithResult(_0x44f8e5,null))[_0x3d62('0x4b')](handleError(_0x44f8e5,null));};exports[_0x3d62('0x29')]=function(_0x39ba72,_0x50a96a){return db[_0x3d62('0x48')][_0x3d62('0x4a')]({'where':{'id':_0x39ba72[_0x3d62('0x4f')]['id']}})[_0x3d62('0x28')](handleEntityNotFound(_0x50a96a,null))['then'](removeEntity(_0x50a96a,null))[_0x3d62('0x4b')](handleError(_0x50a96a,null));};exports[_0x3d62('0x5e')]=function(_0x109588,_0x3264c9){return db[_0x3d62('0x48')][_0x3d62('0x5e')]()['then'](respondWithResult(_0x3264c9,null))[_0x3d62('0x4b')](handleError(_0x3264c9,null));};exports[_0x3d62('0x5f')]=function(_0x3a9374,_0x386f3d){var _0x43dd7e=_0x3a9374[_0x3d62('0x4d')];return db[_0x3d62('0x48')][_0x3d62('0x4a')]({'where':{'id':_0x3a9374['params']['id']}})[_0x3d62('0x28')](handleEntityNotFound(_0x386f3d,null))[_0x3d62('0x28')](function(_0x23e225){if(_0x23e225){return db[_0x3d62('0x55')][_0x3d62('0x56')](function(_0x42d14b){return db['UserProfileSection'][_0x3d62('0x29')]({'where':{'userProfileId':_0x3a9374[_0x3d62('0x4f')]['id'],'sectionId':_[_0x3d62('0x40')](_0x43dd7e,function(_0x14dc93){return _0x14dc93[_0x3d62('0x5a')];})},'transaction':_0x42d14b})['then'](function(){var _0x2da889=_[_0x3d62('0x40')](_0x43dd7e,function(_0x25057a){_0x25057a[_0x3d62('0x5b')]=_0x3a9374['params']['id'];return _0x25057a;});var _0x23e10b=[];return BPromise['each'](_0x2da889,function(_0x3644af){return db['UserProfileSection'][_0x3d62('0x4c')](_0x3644af,{'include':[{'model':db[_0x3d62('0x5c')],'as':_0x3d62('0x5d')}],'raw':!![],'transaction':_0x42d14b})['then'](function(_0x35a590){_0x23e10b['push'](_0x35a590[_0x3d62('0x50')]({'plain':!![]}));});})['then'](function(){return _0x23e10b;});});});}})[_0x3d62('0x28')](function(_0x354ff3){return _0x354ff3;})['then'](respondWithResult(_0x386f3d,null))['catch'](handleError(_0x386f3d,null));};exports[_0x3d62('0x60')]=function(_0x41a4e8,_0x5b9d06){var _0x5dd4e5;return db[_0x3d62('0x48')][_0x3d62('0x4a')]({'where':{'id':_0x41a4e8[_0x3d62('0x4f')]['id']},'attributes':['id',_0x3d62('0x2d')]})[_0x3d62('0x28')](handleEntityNotFound(_0x5b9d06,null))['then'](function(_0x53afc){if(_0x53afc){_0x5dd4e5=_0x53afc;return db[_0x3d62('0x57')]['destroy']({'where':{'userProfileId':_0x41a4e8[_0x3d62('0x4f')]['id'],'sectionId':_0x41a4e8[_0x3d62('0x32')][_0x3d62('0x61')]}});}})[_0x3d62('0x28')](function(){return _0x5dd4e5;})[_0x3d62('0x28')](respondWithStatusCode(_0x5b9d06,null))[_0x3d62('0x4b')](handleError(_0x5b9d06,null));};exports[_0x3d62('0x62')]=function(_0x48b497,_0xacad2a){return db[_0x3d62('0x48')]['find']({'where':{'id':_0x48b497[_0x3d62('0x4f')]['id']}})[_0x3d62('0x28')](handleEntityNotFound(_0xacad2a,null))['then'](function(_0x3e01dd){if(_0x3e01dd){return db['sequelize'][_0x3d62('0x56')](function(_0x32db2e){return db[_0x3d62('0x57')]['findAll']({'where':{'userProfileId':_0x48b497[_0x3d62('0x4f')]['id']},'attributes':['id'],'raw':!![]})[_0x3d62('0x28')](function(_0x3ce89d){if(_0x3ce89d){return db[_0x3d62('0x57')][_0x3d62('0x29')]({'where':{'userProfileId':_0x48b497[_0x3d62('0x4f')]['id'],'id':_[_0x3d62('0x40')](_0x3ce89d,function(_0x1db49f){return _0x1db49f['id'];})},'transaction':_0x32db2e});}})['then'](function(_0x25c1b1){var _0x73f340=_['map'](_0x48b497[_0x3d62('0x4d')],function(_0x5a3703){_0x5a3703['userProfileId']=_0x48b497[_0x3d62('0x4f')]['id'];return _0x5a3703;});return db[_0x3d62('0x57')][_0x3d62('0x63')](_0x73f340,{'raw':!![],'transaction':_0x32db2e});})[_0x3d62('0x28')](function(_0x2fd002){var _0x48591f=_[_0x3d62('0x3e')](_['map'](_0x2fd002,function(_0x4842b1){return _0x4842b1[_0x3d62('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x48591f){return db[_0x3d62('0x57')][_0x3d62('0x46')]({'where':{'userProfileId':_0x48b497['params']['id'],'sectionId':_[_0x3d62('0x40')](_0x48591f,function(_0x3f2ef2){return _0x3f2ef2[_0x3d62('0x5a')];})},'attributes':['id',_0x3d62('0x5a')],'raw':!![]})[_0x3d62('0x28')](function(_0x49e5f1){var _0x4dc5c5=_[_0x3d62('0x40')](_0x48b497['body'],function(_0x196165){_0x196165[_0x3d62('0x5b')]=_0x48b497[_0x3d62('0x4f')]['id'];return _0x196165;});return db[_0x3d62('0x5c')][_0x3d62('0x63')](_0x4dc5c5,{'raw':!![],'transaction':_0x32db2e});});}})['catch'](handleError(_0xacad2a,null));});}})[_0x3d62('0x28')](function(_0x7a899a){var _0x5628af=_[_0x3d62('0x40')](_0x7a899a,function(_0x42b99c){return _0x42b99c[_0x3d62('0x50')]({'plain':!![]});});})[_0x3d62('0x28')](respondWithResult(_0xacad2a,null))['catch'](handleError(_0xacad2a,null));};exports[_0x3d62('0x64')]=function(_0x4d8e27,_0x49d160,_0x495390){return db['UserProfile'][_0x3d62('0x4a')]({'where':{'id':_0x4d8e27[_0x3d62('0x4f')]['id']}})[_0x3d62('0x28')](handleEntityNotFound(_0x49d160,null))[_0x3d62('0x28')](function(_0x13eb9b){if(_0x13eb9b){return _0x13eb9b[_0x3d62('0x64')](_0x4d8e27[_0x3d62('0x32')][_0x3d62('0x61')]);}})[_0x3d62('0x28')](respondWithStatusCode(_0x49d160,null))[_0x3d62('0x4b')](handleError(_0x49d160,null));};exports[_0x3d62('0x65')]=function(_0xf09900,_0x1ec7df){var _0xea0df8={'raw':![],'where':{}};var _0x3ed22b={};var _0x1a4bd4={'count':0x0,'rows':[]};var _0xbe0be1=_0xf09900[_0x3d62('0x32')][_0x3d62('0x66')];if(typeof _0xbe0be1==='undefined'){throw new db[(_0x3d62('0x67'))][(_0x3d62('0x68'))](_0x3d62('0x69'));}var _0x358a0c=_0xf09900[_0x3d62('0x32')][_0x3d62('0x6a')]||![];var _0x102559=getQueryModels(_0xbe0be1,_0x358a0c);if(typeof _0x102559[_0x3d62('0x6b')]===_0x3d62('0x6c')){throw new db[(_0x3d62('0x67'))][(_0x3d62('0x68'))]('Invalid\x20section\x20\x27'+_0xbe0be1+'\x27');}var _0x209ee2=[];if(!_[_0x3d62('0x6d')](_0x102559[_0x3d62('0x6e')])){_0x209ee2=_0x102559[_0x3d62('0x6e')];}else{_0x209ee2=[{'name':_0xbe0be1}];}return db[_0x3d62('0x48')][_0x3d62('0x6f')]({'where':{'id':_0xf09900[_0x3d62('0x4f')]['id']}})[_0x3d62('0x28')](handleEntityNotFound(_0x1ec7df,null))['then'](function(_0x4627a8){if(_0x4627a8){var _0x1fb491=[];for(var _0x56861c=0x0;_0x56861c<_0x209ee2['length'];_0x56861c++){_0x1fb491[_0x3d62('0x70')](db[_0x3d62('0x57')][_0x3d62('0x6f')]({'where':{'userProfileId':_0x4627a8['id'],'name':_0x209ee2[_0x56861c][_0x3d62('0x2d')]},'raw':!![]}));}return BPromise[_0x3d62('0x71')](_0x1fb491);}})[_0x3d62('0x28')](function(_0x1ecc38){var _0x40fd6c=_[_0x3d62('0x3e')](_0x1ecc38,function(_0xa9e0ac){return _0xa9e0ac?_0xa9e0ac:undefined;});var _0x5eaa41=_[_0x3d62('0x3e')](_0x209ee2,[_0x3d62('0x72'),!![]]);var _0x3bb7c8=_[_0x3d62('0x6d')](_0x40fd6c)&&_[_0x3d62('0x6d')](_0x5eaa41)?null:_['union'](_0x5eaa41,_0x40fd6c);if(_0x3bb7c8){var _0x4c1174=[];for(var _0x35922a=0x0;_0x35922a<_0x3bb7c8[_0x3d62('0x37')];_0x35922a++){var _0x3e7adf=_['find'](_0x209ee2,function(_0x4bed8d){return _0x3bb7c8[_0x35922a]?_0x4bed8d[_0x3d62('0x2d')]===_0x3bb7c8[_0x35922a][_0x3d62('0x2d')]:null;});if(_0x3e7adf){if(_0x3bb7c8[_0x35922a][_0x3d62('0x72')]){_0x4c1174[_0x3d62('0x70')](getAllResources(_0x102559['childModel'],_0x3bb7c8[_0x35922a]));}else{if(!_0x3bb7c8[_0x35922a][_0x3d62('0x59')]){_0x4c1174[_0x3d62('0x70')](getAllowedResources(_0x3e7adf,_0x3bb7c8[_0x35922a],_0x102559['childModel']));}else{if(_0x3e7adf[_0x3d62('0x30')]){_0x4c1174['push'](getAllFilteredResources(_0x3e7adf,_0x3bb7c8[_0x35922a]));}}}}}return BPromise[_0x3d62('0x71')](_0x4c1174);}else{return null;}})[_0x3d62('0x28')](function(_0x525eef){var _0x1bd707=_0x525eef;var _0x163dbc=null;if(_0x1bd707){_0x163dbc=_0x1bd707[_0x3d62('0x37')]===0x1?_0x1bd707[0x0]:null;}if(_0x163dbc||_0x1bd707){var _0x5d3403=db[_0x102559[_0x3d62('0x6b')]][_0x3d62('0x2f')];_0x3ed22b[_0x3d62('0x30')]=_[_0x3d62('0x31')](_0x5d3403);_0x3ed22b[_0x3d62('0x32')]=_[_0x3d62('0x31')](_0xf09900[_0x3d62('0x32')]);_0x3ed22b['filters']=_['intersection'](_0x3ed22b[_0x3d62('0x30')],_0x3ed22b[_0x3d62('0x32')]);_0xea0df8[_0x3d62('0x36')]=_[_0x3d62('0x34')](_0x3ed22b[_0x3d62('0x30')],qs[_0x3d62('0x35')](_0xf09900[_0x3d62('0x32')][_0x3d62('0x35')]));_0xea0df8[_0x3d62('0x36')]=_0xea0df8[_0x3d62('0x36')]['length']?_0xea0df8[_0x3d62('0x36')]:_0x3ed22b[_0x3d62('0x30')];if(!_0xf09900[_0x3d62('0x32')]['hasOwnProperty']('nolimit')){_0xea0df8[_0x3d62('0x3a')]=qs['limit'](_0xf09900['query']['limit']);_0xea0df8['offset']=qs[_0x3d62('0x23')](_0xf09900[_0x3d62('0x32')][_0x3d62('0x23')]);}_0xea0df8['order']=qs[_0x3d62('0x3b')](_0xf09900[_0x3d62('0x32')]['sort']);_0xea0df8[_0x3d62('0x3c')]=qs[_0x3d62('0x33')](_[_0x3d62('0x3d')](_0xf09900['query'],_0x3ed22b[_0x3d62('0x33')]));if(_0xf09900['query'][_0x3d62('0x3e')]){_0xea0df8[_0x3d62('0x3c')]=_['merge'](_0xea0df8[_0x3d62('0x3c')],{'$or':_[_0x3d62('0x40')](_0x5d3403,function(_0x28f287){if(_0x28f287[_0x3d62('0x73')]['key']!==_0x3d62('0x42')){var _0x1d2cf9={};_0x1d2cf9[_0x28f287[_0x3d62('0x43')]]={'$like':'%'+_0xf09900[_0x3d62('0x32')][_0x3d62('0x3e')]+'%'};return _0x1d2cf9;}})});}var _0x22a18a=[];if(_0x163dbc){var _0x28db0e=_[_0x3d62('0x4a')](_0x209ee2,[_0x3d62('0x2d'),_0x163dbc[_0x3d62('0x2d')]]);if(_0x28db0e[_0x3d62('0x43')]){var _0x470f37={};if(_0x102559[_0x3d62('0x6b')]===_0x3d62('0x74')){_0x470f37[_0x28db0e['foreignKey']]=_['map'](_0x163dbc[_0x3d62('0x75')],'id');}else{_0x470f37[_0x28db0e[_0x3d62('0x76')]]=_0x163dbc['associatedResources'];}_0x22a18a[_0x3d62('0x70')](_0x470f37);}else{_0xea0df8[_0x3d62('0x3c')]['id']=_0x163dbc[_0x3d62('0x75')];}}else{for(var _0x33741b=0x0;_0x33741b<_0x1bd707[_0x3d62('0x37')];_0x33741b++){var _0x28db0e=_[_0x3d62('0x4a')](_0x209ee2,['name',_0x1bd707[_0x33741b][_0x3d62('0x2d')]]);if(_0x28db0e[_0x3d62('0x43')]){var _0x470f37={};_0x470f37[_0x28db0e[_0x3d62('0x76')]]=_0x1bd707[_0x33741b]['associatedResources'];_0x22a18a[_0x3d62('0x70')](_0x470f37);}else{if(!_0xea0df8[_0x3d62('0x3c')]['id'])_0xea0df8[_0x3d62('0x3c')]['id']=[];_0x1bd707[_0x33741b]['associatedResources']['forEach'](function(_0xc8fcde){_0xea0df8[_0x3d62('0x3c')]['id'][_0x3d62('0x70')](_0xc8fcde);});}}}if(!_['isEmpty'](_0x22a18a)){_0xea0df8[_0x3d62('0x3c')]=_['merge'](_0xea0df8['where'],{'$and':{'$or':_0x22a18a}});}_0xea0df8=_[_0x3d62('0x3f')]({},_0xea0df8,_0xf09900['options']);if(_0x163dbc&&!_0x163dbc[_0x3d62('0x59')]&&_0x102559[_0x3d62('0x6b')]===_0x3d62('0x74')){if(_0xf09900[_0x3d62('0x32')][_0x3d62('0x49')]){_0xea0df8['include']=[{'all':!![]}];}return db[_0x102559['childModel']][_0x3d62('0x46')](_0xea0df8)['then'](function(_0x456372){var _0x5d67e6=[];_0x456372['forEach'](function(_0x30dfca){var _0x418156;switch(_0x30dfca[_0x3d62('0x77')]){case'default':_0x418156=_[_0x3d62('0x4a')](_0x163dbc[_0x3d62('0x75')],function(_0x5074ad){return _0x5074ad['id']===_0x30dfca[_0x3d62('0x78')]&&_0x5074ad[_0x3d62('0x73')]===_0x3d62('0x79');});break;case _0x3d62('0x7a'):_0x418156=_[_0x3d62('0x4a')](_0x163dbc[_0x3d62('0x75')],function(_0x44406f){return _0x44406f['id']===_0x30dfca['reportId']&&_0x44406f['type']===_0x3d62('0x7b');});break;}if(_0x418156)_0x5d67e6[_0x3d62('0x70')](_0x30dfca);});_0x1a4bd4[_0x3d62('0x22')]=_0x5d67e6['length'];_0x1a4bd4[_0x3d62('0x47')]=_0x5d67e6;return _0x1a4bd4;});}else{return db[_0x102559[_0x3d62('0x6b')]][_0x3d62('0x22')]({'where':_0xea0df8['where']})[_0x3d62('0x28')](function(_0x445ec9){_0x1a4bd4[_0x3d62('0x22')]=_0x445ec9;if(_0xf09900[_0x3d62('0x32')]['includeAll']){if(_0x102559['childModel']===_0x3d62('0x7c')){_0xea0df8[_0x3d62('0x45')]=[{'model':db[_0x3d62('0x7d')],'as':_0x3d62('0x7e'),'attributes':['id','name',_0x3d62('0x7f')],'required':_0xf09900['query'][_0x3d62('0x80')]?!![]:![]},{'model':db[_0x3d62('0x7d')],'as':_0x3d62('0x81'),'attributes':['id',_0x3d62('0x2d'),_0x3d62('0x7f')],'through':_0xf09900[_0x3d62('0x32')]['tag']?{'attributes':[],'where':{'TagId':_0xf09900['query'][_0x3d62('0x80')]||undefined}}:{},'required':_0xf09900[_0x3d62('0x32')][_0x3d62('0x80')]?!![]:![]}];}else{_0xea0df8['include']=[{'all':!![]}];}}return db[_0x102559[_0x3d62('0x6b')]][_0x3d62('0x46')](_0xea0df8);})[_0x3d62('0x28')](function(_0x492633){_0x1a4bd4[_0x3d62('0x47')]=_0x492633;return _0x1a4bd4;});}}else{return _0x1a4bd4;}})['then'](respondWithFilteredResult(_0x1ec7df,_0xea0df8))[_0x3d62('0x4b')](handleError(_0x1ec7df,null));};function getAllResources(_0x44064a,_0x4cd163){return new BPromise(function(_0x3869f4,_0x5d3375){if(_0x4cd163){var _0x2a21d8=_0x4cd163[_0x3d62('0x3e')]?{[_0x4cd163[_0x3d62('0x3e')][_0x3d62('0x43')]]:_0x4cd163[_0x3d62('0x3e')]['value']}:undefined;return db[_0x44064a][_0x3d62('0x46')]({'where':_0x2a21d8,'raw':!![]})[_0x3d62('0x28')](function(_0x2d98ff){_0x4cd163[_0x3d62('0x75')]=_[_0x3d62('0x40')](_0x2d98ff,'id');_0x3869f4(_0x4cd163);})[_0x3d62('0x4b')](function(_0x29ee7f){_0x5d3375(_0x29ee7f);});}else{_0x3869f4(null);}});}function getAllFilteredResources(_0x32e4f8,_0xd5a618){return new BPromise(function(_0x3bc1aa,_0x329f9d){var _0x44c964=_0x32e4f8[_0x3d62('0x3e')]?{[_0x32e4f8[_0x3d62('0x3e')]['field']]:_0x32e4f8[_0x3d62('0x3e')][_0x3d62('0x82')]}:undefined;return db[_0x32e4f8[_0x3d62('0x30')]][_0x3d62('0x46')]({'where':_0x44c964,'raw':!![]})['then'](function(_0x313457){_0xd5a618['associatedResources']=_[_0x3d62('0x40')](_0x313457,function(_0x3d633d){return _0x3d633d[_0x3d62('0x2d')];});_0x3bc1aa(_0xd5a618);})[_0x3d62('0x4b')](function(_0x411905){_0x329f9d(_0x411905);});});}function getAllowedResources(_0x5e2353,_0x2babac,_0x4467d8){return new BPromise(function(_0xdff874,_0x7fc821){if(_0x2babac){return db['UserProfileResource'][_0x3d62('0x46')]({'where':{'sectionId':_0x2babac['id']},'raw':!![]})['then'](function(_0x49ed39){if(_0x5e2353['field']&&_0x5e2353['field']!=='id'){_0x2babac['associatedResources']=_[_0x3d62('0x40')](_0x49ed39,function(_0x49d7ea){return _0x49d7ea[_0x5e2353[_0x3d62('0x43')]];});}else{if(_0x4467d8===_0x3d62('0x74')){_0x2babac[_0x3d62('0x75')]=_[_0x3d62('0x40')](_0x49ed39,function(_0xa4adb9){return{'id':_0xa4adb9[_0x3d62('0x83')],'type':_0xa4adb9['type']};});}else{_0x2babac['associatedResources']=_[_0x3d62('0x40')](_0x49ed39,function(_0x827b91){return _0x827b91[_0x3d62('0x83')];});}}_0xdff874(_0x2babac);})[_0x3d62('0x4b')](function(_0x2dfb2d){_0x7fc821(_0x2dfb2d);});}else{_0xdff874(null);}});}function getQueryModels(_0x373610,_0x2d6c2a){var _0x5069c4=_0x373610[_0x3d62('0x84')]();var _0x3917fc={'childModel':undefined,'parentSections':[]};switch(_0x5069c4){case _0x3d62('0x85'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x86');break;case _0x3d62('0x87'):_0x3917fc[_0x3d62('0x6b')]='SquareOdbc';break;case _0x3d62('0x88'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x89');_0x3917fc[_0x3d62('0x6e')]=[{'name':_0x3d62('0x8a'),'field':'name','foreignKey':_0x3d62('0x8b')}];break;case'projects':_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x8c');break;case'contacts':_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x7c');_0x3917fc[_0x3d62('0x6e')]=[{'name':_0x3d62('0x8d'),'field':'id','foreignKey':_0x3d62('0x8e')}];break;case _0x3d62('0x8f'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x90');break;case'companies':_0x3917fc[_0x3d62('0x6b')]='CmCompany';break;case _0x3d62('0x91'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x92');break;case'chatqueues':_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x93');break;case _0x3d62('0x94'):_0x3917fc['childModel']=_0x3d62('0x95');break;case'faxqueues':_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x96');break;case'faxaccounts':_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x97');break;case'inboundroutes':case _0x3d62('0x98'):case _0x3d62('0x99'):_0x3917fc['childModel']='VoiceExtension';break;case _0x3d62('0x9a'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x9b');break;case _0x3d62('0x9c'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x9d');break;case _0x3d62('0x9e'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x9f');_0x3917fc[_0x3d62('0x6e')]=[{'name':_0x3d62('0xa0'),'field':_0x3d62('0x2d'),'foreignKey':'membername','model':_0x3d62('0xa1'),'filter':{'field':_0x3d62('0xa2'),'value':[_0x3d62('0xa3')]}},{'name':'Telephones','field':_0x3d62('0x2d'),'foreignKey':_0x3d62('0xa4'),'model':'User','filter':{'field':_0x3d62('0xa2'),'value':['telephone']}},{'name':'VoiceQueues','field':_0x3d62('0x2d'),'foreignKey':_0x3d62('0xa5'),'model':_0x3d62('0xa6'),'filter':{'field':_0x3d62('0x73'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0x3d62('0x2d'),'foreignKey':_0x3d62('0xa5'),'model':'VoiceQueue','filter':{'field':_0x3d62('0x73'),'value':[_0x3d62('0xa7')]}}];break;case _0x3d62('0xa8'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xa9');break;case _0x3d62('0xaa'):_0x3917fc['childModel']=_0x3d62('0xab');break;case _0x3d62('0xac'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xad');break;case'ivrcampaigns':_0x3917fc['childModel']=_0x3d62('0xae');break;case _0x3d62('0xaf'):_0x3917fc['childModel']=_0x3d62('0xb0');break;case _0x3d62('0xb1'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xb2');break;case'mailsubstatuses':_0x3917fc['childModel']=_0x3d62('0xb3');break;case _0x3d62('0xb4'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xb5');break;case _0x3d62('0xb6'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xb7');break;case _0x3d62('0xb8'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xb9');break;case _0x3d62('0xba'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xbb');break;case _0x3d62('0xbc'):_0x3917fc[_0x3d62('0x6b')]='Team';break;case _0x3d62('0xbd'):case'queuecampaigns':_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xa6');if(_0x2d6c2a){_0x3917fc['parentSections']=[{'name':'VoiceQueues'},{'name':_0x3d62('0xbe')}];}break;case _0x3d62('0xbf'):case _0x3d62('0xc0'):case _0x3d62('0xc1'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xa1');if(_0x2d6c2a){_0x3917fc[_0x3d62('0x6e')]=[{'name':_0x3d62('0xc2'),'filter':{'field':_0x3d62('0xa2'),'value':[_0x3d62('0xc3'),_0x3d62('0xc4')]},'ignore':!![]},{'name':'Agents'},{'name':_0x3d62('0xc5')}];}break;case _0x3d62('0xc6'):_0x3917fc['childModel']=_0x3d62('0xc7');break;case _0x3d62('0xc8'):_0x3917fc['childModel']=_0x3d62('0xc9');break;case _0x3d62('0xca'):_0x3917fc[_0x3d62('0x6b')]='FreshdeskAccount';break;case _0x3d62('0xcb'):_0x3917fc[_0x3d62('0x6b')]='SugarcrmAccount';break;case _0x3d62('0xcc'):_0x3917fc['childModel']=_0x3d62('0xcd');break;case _0x3d62('0xce'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xcf');break;case _0x3d62('0xd0'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xa1');break;case _0x3d62('0xd1'):_0x3917fc['childModel']='CannedAnswer';break;case _0x3d62('0xd2'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xd3');break;case _0x3d62('0xd4'):_0x3917fc['childModel']=_0x3d62('0xd5');break;case _0x3d62('0xd6'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xd7');break;case'pauses':_0x3917fc[_0x3d62('0x6b')]='Pause';break;case _0x3d62('0xd8'):_0x3917fc[_0x3d62('0x6b')]='Schedule';break;case _0x3d62('0xd9'):_0x3917fc['childModel']=_0x3d62('0xda');break;case _0x3d62('0xdb'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0x7d');break;case'templates':_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xdc');break;case _0x3d62('0xdd'):_0x3917fc['childModel']=_0x3d62('0xde');break;case _0x3d62('0xdf'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xe0');break;case _0x3d62('0xe1'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xe2');break;case _0x3d62('0xe3'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xe4');break;case _0x3d62('0xe5'):_0x3917fc['childModel']=_0x3d62('0x74');_0x3917fc[_0x3d62('0x6e')]=[{'name':_0x3d62('0xe6'),'field':'id','foreignKey':_0x3d62('0x78')}];break;case _0x3d62('0xe7'):_0x3917fc[_0x3d62('0x6b')]=_0x3d62('0xe8');break;default:return _0x3917fc;}return _0x3917fc;} \ No newline at end of file +var _0x0f69=['destroy','end','error','stack','name','send','UserProfile','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','map','type','key','field','merge','findAll','rows','catch','show','params','rawAttributes','includeAll','options','create','body','clone','include','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','find','describe','addSections','userProfileId','push','removeSections','ids','addResources','sequelize','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','ignore','isEmpty','union','nolimit','sort','associatedResources','foreignKey','forEach','AnalyticExtractedReport','default','reportId','DefaultReports','CmContact','Tag','Tags','tag','color','value','resourceId','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareProjects','projectName','projects','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','sounds','tags','templates','Template','triggers','Trigger','Trunk','variables','Plugin','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','then'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x0f69,0xbd));var _0x90f6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0f69[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0x90f6('0x0'));var emlformat=require(_0x90f6('0x1'));var rimraf=require(_0x90f6('0x2'));var zipdir=require(_0x90f6('0x3'));var jsonpatch=require(_0x90f6('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x90f6('0x5'));var Mustache=require('mustache');var util=require(_0x90f6('0x6'));var path=require(_0x90f6('0x7'));var sox=require(_0x90f6('0x8'));var csv=require(_0x90f6('0x9'));var ejs=require(_0x90f6('0xa'));var fs=require('fs');var _=require(_0x90f6('0xb'));var squel=require(_0x90f6('0xc'));var crypto=require(_0x90f6('0xd'));var jsforce=require(_0x90f6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x90f6('0x9'));var querystring=require(_0x90f6('0xf'));var Papa=require(_0x90f6('0x10'));var Redis=require(_0x90f6('0x11'));var authService=require(_0x90f6('0x12'));var qs=require(_0x90f6('0x13'));var hardwareService=require(_0x90f6('0x14'));var logger=require(_0x90f6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x90f6('0x16'));var db=require(_0x90f6('0x17'))['db'];config[_0x90f6('0x18')]=_[_0x90f6('0x19')](config['redis'],{'host':_0x90f6('0x1a'),'port':0x18eb});var socket=require(_0x90f6('0x1b'))(new Redis(config[_0x90f6('0x18')]));require(_0x90f6('0x1c'))['register'](socket);function respondWithStatusCode(_0x267014,_0x5c8cfb){_0x5c8cfb=_0x5c8cfb||0xcc;return function(_0x3d4655){if(_0x3d4655){return _0x267014[_0x90f6('0x1d')](_0x5c8cfb);}return _0x267014[_0x90f6('0x1e')](_0x5c8cfb)['end']();};}function respondWithResult(_0x529c51,_0x23257c){_0x23257c=_0x23257c||0xc8;return function(_0x1cdd0a){if(_0x1cdd0a){return _0x529c51['status'](_0x23257c)['json'](_0x1cdd0a);}};}function respondWithFilteredResult(_0x325933,_0x18ced9){return function(_0x210a76){if(_0x210a76){var _0x5e8372=_0x210a76[_0x90f6('0x1f')],_0x1e5704=_0x18ced9[_0x90f6('0x20')],_0x47e8b4=_0x18ced9['offset']+_0x18ced9[_0x90f6('0x21')],_0x454438;if(_0x47e8b4>=_0x5e8372){_0x47e8b4=_0x5e8372;_0x454438=0xc8;}else{_0x454438=0xce;}_0x325933['status'](_0x454438);return _0x325933[_0x90f6('0x22')](_0x90f6('0x23'),_0x1e5704+'-'+_0x47e8b4+'/'+_0x5e8372)[_0x90f6('0x24')](_0x210a76);}return null;};}function patchUpdates(_0x51129f){return function(_0x44cba5){try{jsonpatch[_0x90f6('0x25')](_0x44cba5,_0x51129f,!![]);}catch(_0x467f63){return BPromise['reject'](_0x467f63);}return _0x44cba5[_0x90f6('0x26')]();};}function saveUpdates(_0x545ba8,_0x2d16f4){return function(_0x54c9b4){if(_0x54c9b4){return _0x54c9b4[_0x90f6('0x27')](_0x545ba8)[_0x90f6('0x28')](function(_0x303d84){return _0x303d84;});}return null;};}function removeEntity(_0x2768f0,_0x176660){return function(_0x16852a){if(_0x16852a){return _0x16852a[_0x90f6('0x29')]()[_0x90f6('0x28')](function(){_0x2768f0[_0x90f6('0x1e')](0xcc)[_0x90f6('0x2a')]();});}};}function handleEntityNotFound(_0x398549,_0x328a90){return function(_0xe520bd){if(!_0xe520bd){_0x398549['sendStatus'](0x194);}return _0xe520bd;};}function handleError(_0x34f603,_0x293564){_0x293564=_0x293564||0x1f4;return function(_0xf60839){logger[_0x90f6('0x2b')](_0xf60839[_0x90f6('0x2c')]);if(_0xf60839[_0x90f6('0x2d')]){delete _0xf60839[_0x90f6('0x2d')];}_0x34f603[_0x90f6('0x1e')](_0x293564)[_0x90f6('0x2e')](_0xf60839);};}exports['index']=function(_0x4c16e6,_0x5eac5b){var _0x1620d2={},_0x5d4142={},_0x4365f7={'count':0x0,'rows':[]};var _0x154852=db[_0x90f6('0x2f')]['rawAttributes'];_0x5d4142['model']=_[_0x90f6('0x30')](_0x154852);_0x5d4142[_0x90f6('0x31')]=_[_0x90f6('0x30')](_0x4c16e6['query']);_0x5d4142[_0x90f6('0x32')]=_[_0x90f6('0x33')](_0x5d4142[_0x90f6('0x34')],_0x5d4142[_0x90f6('0x31')]);_0x1620d2[_0x90f6('0x35')]=_[_0x90f6('0x33')](_0x5d4142[_0x90f6('0x34')],qs[_0x90f6('0x36')](_0x4c16e6[_0x90f6('0x31')][_0x90f6('0x36')]));_0x1620d2['attributes']=_0x1620d2[_0x90f6('0x35')][_0x90f6('0x37')]?_0x1620d2[_0x90f6('0x35')]:_0x5d4142[_0x90f6('0x34')];if(!_0x4c16e6['query'][_0x90f6('0x38')]('nolimit')){_0x1620d2[_0x90f6('0x21')]=qs['limit'](_0x4c16e6[_0x90f6('0x31')][_0x90f6('0x21')]);_0x1620d2['offset']=qs[_0x90f6('0x20')](_0x4c16e6[_0x90f6('0x31')][_0x90f6('0x20')]);}_0x1620d2[_0x90f6('0x39')]=qs['sort'](_0x4c16e6[_0x90f6('0x31')]['sort']);_0x1620d2[_0x90f6('0x3a')]=qs[_0x90f6('0x32')](_[_0x90f6('0x3b')](_0x4c16e6[_0x90f6('0x31')],_0x5d4142['filters']));if(_0x4c16e6['query'][_0x90f6('0x3c')]){_0x1620d2[_0x90f6('0x3a')]=_['merge'](_0x1620d2['where'],{'$or':_[_0x90f6('0x3d')](_0x154852,function(_0x335ae0){if(_0x335ae0[_0x90f6('0x3e')][_0x90f6('0x3f')]!=='VIRTUAL'){var _0x34e815={};_0x34e815[_0x335ae0[_0x90f6('0x40')]]={'$like':'%'+_0x4c16e6['query'][_0x90f6('0x3c')]+'%'};return _0x34e815;}})});}_0x1620d2=_[_0x90f6('0x41')]({},_0x1620d2,_0x4c16e6['options']);var _0x66f6c6={'where':_0x1620d2[_0x90f6('0x3a')]};return db[_0x90f6('0x2f')][_0x90f6('0x1f')](_0x66f6c6)[_0x90f6('0x28')](function(_0x4318ac){_0x4365f7[_0x90f6('0x1f')]=_0x4318ac;if(_0x4c16e6['query']['includeAll']){_0x1620d2['include']=[{'all':!![]}];}return db[_0x90f6('0x2f')][_0x90f6('0x42')](_0x1620d2);})[_0x90f6('0x28')](function(_0x31b82a){_0x4365f7[_0x90f6('0x43')]=_0x31b82a;return _0x4365f7;})[_0x90f6('0x28')](respondWithFilteredResult(_0x5eac5b,_0x1620d2))[_0x90f6('0x44')](handleError(_0x5eac5b,null));};exports[_0x90f6('0x45')]=function(_0x2c3774,_0x3c43db){var _0x5a0513={'raw':![],'where':{'id':_0x2c3774[_0x90f6('0x46')]['id']}},_0x4709ea={};_0x4709ea[_0x90f6('0x34')]=_['keys'](db[_0x90f6('0x2f')][_0x90f6('0x47')]);_0x4709ea['query']=_[_0x90f6('0x30')](_0x2c3774[_0x90f6('0x31')]);_0x4709ea[_0x90f6('0x32')]=_[_0x90f6('0x33')](_0x4709ea[_0x90f6('0x34')],_0x4709ea['query']);_0x5a0513[_0x90f6('0x35')]=_[_0x90f6('0x33')](_0x4709ea[_0x90f6('0x34')],qs['fields'](_0x2c3774['query'][_0x90f6('0x36')]));_0x5a0513['attributes']=_0x5a0513[_0x90f6('0x35')]['length']?_0x5a0513[_0x90f6('0x35')]:_0x4709ea[_0x90f6('0x34')];if(_0x2c3774[_0x90f6('0x31')][_0x90f6('0x48')]){_0x5a0513['include']=[{'all':!![]}];}_0x5a0513=_['merge']({},_0x5a0513,_0x2c3774[_0x90f6('0x49')]);return db[_0x90f6('0x2f')]['find'](_0x5a0513)[_0x90f6('0x28')](handleEntityNotFound(_0x3c43db,null))[_0x90f6('0x28')](respondWithResult(_0x3c43db,null))[_0x90f6('0x44')](handleError(_0x3c43db,null));};exports['create']=function(_0x2a0594,_0x1f99ee){return db[_0x90f6('0x2f')][_0x90f6('0x4a')](_0x2a0594[_0x90f6('0x4b')],{})[_0x90f6('0x28')](respondWithResult(_0x1f99ee,0xc9))[_0x90f6('0x44')](handleError(_0x1f99ee,null));};exports[_0x90f6('0x4c')]=function(_0x466c81,_0x35a3dd){var _0x25f88a={'raw':![],'where':{'id':_0x466c81['params']['id']}},_0x127a4b={};_0x127a4b['model']=_[_0x90f6('0x30')](db[_0x90f6('0x2f')][_0x90f6('0x47')]);_0x25f88a[_0x90f6('0x35')]=_[_0x90f6('0x33')](_0x127a4b[_0x90f6('0x34')],qs[_0x90f6('0x36')](_0x466c81[_0x90f6('0x31')][_0x90f6('0x36')]));_0x25f88a[_0x90f6('0x35')]=_0x25f88a['attributes'][_0x90f6('0x37')]?_0x25f88a[_0x90f6('0x35')]:_0x127a4b[_0x90f6('0x34')];if(_0x466c81[_0x90f6('0x31')]['includeAll']){_0x25f88a[_0x90f6('0x4d')]=[{'all':!![]}];}_0x25f88a=_[_0x90f6('0x41')]({},_0x25f88a,_0x466c81[_0x90f6('0x49')]);return db[_0x90f6('0x2f')]['find'](_0x25f88a)[_0x90f6('0x28')](handleEntityNotFound(_0x35a3dd,null))[_0x90f6('0x28')](function(_0x59825f){if(_0x59825f){var _0xd4552e=_0x59825f[_0x90f6('0x4e')]({'plain':!![]});_0xd4552e=qs[_0x90f6('0x4f')](_0xd4552e,['id',_0x90f6('0x50'),_0x90f6('0x51'),_0x90f6('0x52')]);_0x466c81[_0x90f6('0x4b')]=_[_0x90f6('0x4f')](_0x466c81[_0x90f6('0x4b')],['id','createdAt',_0x90f6('0x51')]);return db['sequelize'][_0x90f6('0x53')](function(_0x3e2710){return db['UserProfile'][_0x90f6('0x4a')](_[_0x90f6('0x41')](_0xd4552e,_0x466c81[_0x90f6('0x4b')]),{'include':_0x466c81[_0x90f6('0x31')][_0x90f6('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x3e2710})['then'](function(_0x5cdc9a){var _0x344feb=_0x5cdc9a[_0x90f6('0x4e')]({'plain':!![]});return db[_0x90f6('0x54')][_0x90f6('0x42')]({'where':{'userProfileId':_0x466c81[_0x90f6('0x46')]['id']},'raw':!![]})[_0x90f6('0x28')](function(_0x1325a1){if(_0x1325a1){return BPromise[_0x90f6('0x55')](_0x1325a1,function(_0x2e377f){return new BPromise(function(_0x49d7f0,_0x32a6db){if(_0x2e377f[_0x90f6('0x56')]===null||_0x2e377f[_0x90f6('0x56')]===0x1)_0x49d7f0(null);return db[_0x90f6('0x57')][_0x90f6('0x42')]({'where':{'sectionId':_0x2e377f['id']},'raw':!![]})[_0x90f6('0x28')](function(_0x577713){var _0x257da1=_[_0x90f6('0x3d')](_0x577713,function(_0x470f20){return qs[_0x90f6('0x4f')](_0x470f20,['id','createdAt','updatedAt',_0x90f6('0x58')]);});_0x49d7f0(_0x257da1);})[_0x90f6('0x44')](function(_0x1f5012){_0x32a6db(_0x1f5012);});})[_0x90f6('0x28')](function(_0x59bede){var _0x54d617=qs['omit'](_0x2e377f,['id',_0x90f6('0x50'),_0x90f6('0x51')]);_0x54d617['userProfileId']=_0x344feb['id'];if(_0x59bede)_0x54d617[_0x90f6('0x59')]=_0x59bede;return _0x54d617;})['then'](function(_0x390940){return db['UserProfileSection'][_0x90f6('0x4a')](_0x390940,{'include':[{'model':db['UserProfileResource'],'as':_0x90f6('0x59')}],'raw':!![],'transaction':_0x3e2710});});})['then'](function(){return _0x344feb;});}});});});}})[_0x90f6('0x28')](respondWithResult(_0x35a3dd,0xc9))[_0x90f6('0x44')](handleError(_0x35a3dd,null));};exports[_0x90f6('0x27')]=function(_0x157b20,_0x2c9cfe){if(_0x157b20['body']['id']){delete _0x157b20['body']['id'];}return db[_0x90f6('0x2f')][_0x90f6('0x5a')]({'where':{'id':_0x157b20[_0x90f6('0x46')]['id']}})[_0x90f6('0x28')](handleEntityNotFound(_0x2c9cfe,null))[_0x90f6('0x28')](saveUpdates(_0x157b20[_0x90f6('0x4b')],null))[_0x90f6('0x28')](respondWithResult(_0x2c9cfe,null))[_0x90f6('0x44')](handleError(_0x2c9cfe,null));};exports[_0x90f6('0x29')]=function(_0x50c2ed,_0x58528b){return db[_0x90f6('0x2f')][_0x90f6('0x5a')]({'where':{'id':_0x50c2ed[_0x90f6('0x46')]['id']}})[_0x90f6('0x28')](handleEntityNotFound(_0x58528b,null))[_0x90f6('0x28')](removeEntity(_0x58528b,null))[_0x90f6('0x44')](handleError(_0x58528b,null));};exports['describe']=function(_0x4e0626,_0x2c69ae){return db[_0x90f6('0x2f')][_0x90f6('0x5b')]()[_0x90f6('0x28')](respondWithResult(_0x2c69ae,null))[_0x90f6('0x44')](handleError(_0x2c69ae,null));};exports[_0x90f6('0x5c')]=function(_0x43c2b1,_0x5cfe74){var _0x2f034c=_0x43c2b1[_0x90f6('0x4b')];return db[_0x90f6('0x2f')][_0x90f6('0x5a')]({'where':{'id':_0x43c2b1[_0x90f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x5cfe74,null))[_0x90f6('0x28')](function(_0x13be60){if(_0x13be60){return db['sequelize'][_0x90f6('0x53')](function(_0x304af0){return db['UserProfileSection'][_0x90f6('0x29')]({'where':{'userProfileId':_0x43c2b1[_0x90f6('0x46')]['id'],'sectionId':_[_0x90f6('0x3d')](_0x2f034c,function(_0x37a9ec){return _0x37a9ec[_0x90f6('0x58')];})},'transaction':_0x304af0})[_0x90f6('0x28')](function(){var _0x5e2663=_['map'](_0x2f034c,function(_0x5ac217){_0x5ac217[_0x90f6('0x5d')]=_0x43c2b1['params']['id'];return _0x5ac217;});var _0x12d8a8=[];return BPromise[_0x90f6('0x55')](_0x5e2663,function(_0x25740b){return db['UserProfileSection'][_0x90f6('0x4a')](_0x25740b,{'include':[{'model':db['UserProfileResource'],'as':_0x90f6('0x59')}],'raw':!![],'transaction':_0x304af0})['then'](function(_0x487c23){_0x12d8a8[_0x90f6('0x5e')](_0x487c23['get']({'plain':!![]}));});})[_0x90f6('0x28')](function(){return _0x12d8a8;});});});}})[_0x90f6('0x28')](function(_0x5a984a){return _0x5a984a;})['then'](respondWithResult(_0x5cfe74,null))[_0x90f6('0x44')](handleError(_0x5cfe74,null));};exports[_0x90f6('0x5f')]=function(_0x3bf4b9,_0x3c549f){var _0x2b7003;return db[_0x90f6('0x2f')][_0x90f6('0x5a')]({'where':{'id':_0x3bf4b9['params']['id']},'attributes':['id','name']})[_0x90f6('0x28')](handleEntityNotFound(_0x3c549f,null))[_0x90f6('0x28')](function(_0x3546ae){if(_0x3546ae){_0x2b7003=_0x3546ae;return db[_0x90f6('0x54')][_0x90f6('0x29')]({'where':{'userProfileId':_0x3bf4b9['params']['id'],'sectionId':_0x3bf4b9[_0x90f6('0x31')][_0x90f6('0x60')]}});}})[_0x90f6('0x28')](function(){return _0x2b7003;})[_0x90f6('0x28')](respondWithStatusCode(_0x3c549f,null))['catch'](handleError(_0x3c549f,null));};exports[_0x90f6('0x61')]=function(_0x3d1d9c,_0x1a6a89){return db[_0x90f6('0x2f')][_0x90f6('0x5a')]({'where':{'id':_0x3d1d9c[_0x90f6('0x46')]['id']}})[_0x90f6('0x28')](handleEntityNotFound(_0x1a6a89,null))[_0x90f6('0x28')](function(_0x404bcf){if(_0x404bcf){return db[_0x90f6('0x62')][_0x90f6('0x53')](function(_0x4be2e9){return db['UserProfileSection'][_0x90f6('0x42')]({'where':{'userProfileId':_0x3d1d9c[_0x90f6('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x90f6('0x28')](function(_0x4a0c9b){if(_0x4a0c9b){return db[_0x90f6('0x54')][_0x90f6('0x29')]({'where':{'userProfileId':_0x3d1d9c[_0x90f6('0x46')]['id'],'id':_['map'](_0x4a0c9b,function(_0xfac1fa){return _0xfac1fa['id'];})},'transaction':_0x4be2e9});}})['then'](function(_0x409572){var _0x2a2a06=_[_0x90f6('0x3d')](_0x3d1d9c[_0x90f6('0x4b')],function(_0x59e1fb){_0x59e1fb[_0x90f6('0x5d')]=_0x3d1d9c['params']['id'];return _0x59e1fb;});return db[_0x90f6('0x54')][_0x90f6('0x63')](_0x2a2a06,{'raw':!![],'transaction':_0x4be2e9});})['then'](function(_0xdff2ec){var _0x426a09=_['filter'](_[_0x90f6('0x3d')](_0xdff2ec,function(_0x37aebb){return _0x37aebb[_0x90f6('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x426a09){return db[_0x90f6('0x54')][_0x90f6('0x42')]({'where':{'userProfileId':_0x3d1d9c[_0x90f6('0x46')]['id'],'sectionId':_[_0x90f6('0x3d')](_0x426a09,function(_0x177a70){return _0x177a70[_0x90f6('0x58')];})},'attributes':['id',_0x90f6('0x58')],'raw':!![]})['then'](function(_0xb25b8a){var _0x4100de=_[_0x90f6('0x3d')](_0x3d1d9c[_0x90f6('0x4b')],function(_0x5f1d14){_0x5f1d14[_0x90f6('0x5d')]=_0x3d1d9c[_0x90f6('0x46')]['id'];return _0x5f1d14;});return db[_0x90f6('0x57')][_0x90f6('0x63')](_0x4100de,{'raw':!![],'transaction':_0x4be2e9});});}})['catch'](handleError(_0x1a6a89,null));});}})[_0x90f6('0x28')](function(_0x34758d){var _0x5a2632=_['map'](_0x34758d,function(_0x247a98){return _0x247a98['get']({'plain':!![]});});})[_0x90f6('0x28')](respondWithResult(_0x1a6a89,null))['catch'](handleError(_0x1a6a89,null));};exports[_0x90f6('0x64')]=function(_0x3879a2,_0x57aa31,_0x1ae60c){return db['UserProfile'][_0x90f6('0x5a')]({'where':{'id':_0x3879a2[_0x90f6('0x46')]['id']}})[_0x90f6('0x28')](handleEntityNotFound(_0x57aa31,null))['then'](function(_0x5801a5){if(_0x5801a5){return _0x5801a5['removeResources'](_0x3879a2[_0x90f6('0x31')][_0x90f6('0x60')]);}})[_0x90f6('0x28')](respondWithStatusCode(_0x57aa31,null))[_0x90f6('0x44')](handleError(_0x57aa31,null));};exports[_0x90f6('0x65')]=function(_0x3bcbab,_0x3bf788){var _0x398d4c={'raw':![],'where':{}};var _0x492164={};var _0x5dc3c5={'count':0x0,'rows':[]};var _0xf16259=_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x66')];if(typeof _0xf16259===_0x90f6('0x67')){throw new db[(_0x90f6('0x68'))][(_0x90f6('0x69'))](_0x90f6('0x6a'));}var _0xbf9e85=_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x6b')]||![];var _0x4ddede=getQueryModels(_0xf16259,_0xbf9e85);if(typeof _0x4ddede[_0x90f6('0x6c')]==='undefined'){throw new db[(_0x90f6('0x68'))]['ValidationError'](_0x90f6('0x6d')+_0xf16259+'\x27');}var _0x3a240b=[];if(!_['isEmpty'](_0x4ddede[_0x90f6('0x6e')])){_0x3a240b=_0x4ddede[_0x90f6('0x6e')];}else{_0x3a240b=[{'name':_0xf16259}];}return db[_0x90f6('0x2f')][_0x90f6('0x6f')]({'where':{'id':_0x3bcbab[_0x90f6('0x46')]['id']}})[_0x90f6('0x28')](handleEntityNotFound(_0x3bf788,null))['then'](function(_0x7fdf1d){if(_0x7fdf1d){var _0x347dee=[];for(var _0x3091e9=0x0;_0x3091e9<_0x3a240b[_0x90f6('0x37')];_0x3091e9++){_0x347dee[_0x90f6('0x5e')](db[_0x90f6('0x54')][_0x90f6('0x6f')]({'where':{'userProfileId':_0x7fdf1d['id'],'name':_0x3a240b[_0x3091e9][_0x90f6('0x2d')]},'raw':!![]}));}return BPromise['all'](_0x347dee);}})['then'](function(_0x4fb8a7){var _0x446ebf=_['filter'](_0x4fb8a7,function(_0x1f690e){return _0x1f690e?_0x1f690e:undefined;});var _0x532c38=_[_0x90f6('0x3c')](_0x3a240b,[_0x90f6('0x70'),!![]]);var _0x293d7b=_[_0x90f6('0x71')](_0x446ebf)&&_[_0x90f6('0x71')](_0x532c38)?null:_[_0x90f6('0x72')](_0x532c38,_0x446ebf);if(_0x293d7b){var _0x10d5a4=[];for(var _0x579b7b=0x0;_0x579b7b<_0x293d7b[_0x90f6('0x37')];_0x579b7b++){var _0x2d4b16=_['find'](_0x3a240b,function(_0x2dfd33){return _0x293d7b[_0x579b7b]?_0x2dfd33[_0x90f6('0x2d')]===_0x293d7b[_0x579b7b][_0x90f6('0x2d')]:null;});if(_0x2d4b16){if(_0x293d7b[_0x579b7b][_0x90f6('0x70')]){_0x10d5a4[_0x90f6('0x5e')](getAllResources(_0x4ddede[_0x90f6('0x6c')],_0x293d7b[_0x579b7b]));}else{if(!_0x293d7b[_0x579b7b][_0x90f6('0x56')]){_0x10d5a4['push'](getAllowedResources(_0x2d4b16,_0x293d7b[_0x579b7b],_0x4ddede[_0x90f6('0x6c')]));}else{if(_0x2d4b16[_0x90f6('0x34')]){_0x10d5a4[_0x90f6('0x5e')](getAllFilteredResources(_0x2d4b16,_0x293d7b[_0x579b7b]));}}}}}return BPromise['all'](_0x10d5a4);}else{return null;}})[_0x90f6('0x28')](function(_0x5f39e0){var _0x1197d8=_0x5f39e0;var _0x2bf9fa=null;if(_0x1197d8){_0x2bf9fa=_0x1197d8['length']===0x1?_0x1197d8[0x0]:null;}if(_0x2bf9fa||_0x1197d8){var _0x9fc5b=db[_0x4ddede[_0x90f6('0x6c')]][_0x90f6('0x47')];_0x492164[_0x90f6('0x34')]=_[_0x90f6('0x30')](_0x9fc5b);_0x492164[_0x90f6('0x31')]=_[_0x90f6('0x30')](_0x3bcbab[_0x90f6('0x31')]);_0x492164[_0x90f6('0x32')]=_['intersection'](_0x492164[_0x90f6('0x34')],_0x492164['query']);_0x398d4c[_0x90f6('0x35')]=_['intersection'](_0x492164[_0x90f6('0x34')],qs[_0x90f6('0x36')](_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x36')]));_0x398d4c[_0x90f6('0x35')]=_0x398d4c[_0x90f6('0x35')][_0x90f6('0x37')]?_0x398d4c[_0x90f6('0x35')]:_0x492164[_0x90f6('0x34')];if(!_0x3bcbab[_0x90f6('0x31')]['hasOwnProperty'](_0x90f6('0x73'))){_0x398d4c['limit']=qs[_0x90f6('0x21')](_0x3bcbab['query']['limit']);_0x398d4c[_0x90f6('0x20')]=qs[_0x90f6('0x20')](_0x3bcbab['query'][_0x90f6('0x20')]);}_0x398d4c['order']=qs[_0x90f6('0x74')](_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x74')]);_0x398d4c[_0x90f6('0x3a')]=qs[_0x90f6('0x32')](_[_0x90f6('0x3b')](_0x3bcbab[_0x90f6('0x31')],_0x492164[_0x90f6('0x32')]));if(_0x3bcbab['query'][_0x90f6('0x3c')]){_0x398d4c[_0x90f6('0x3a')]=_[_0x90f6('0x41')](_0x398d4c[_0x90f6('0x3a')],{'$or':_[_0x90f6('0x3d')](_0x9fc5b,function(_0x6eeb6e){if(_0x6eeb6e[_0x90f6('0x3e')][_0x90f6('0x3f')]!=='VIRTUAL'){var _0x3a1032={};_0x3a1032[_0x6eeb6e[_0x90f6('0x40')]]={'$like':'%'+_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x3c')]+'%'};return _0x3a1032;}})});}var _0x4df5e6=[];if(_0x2bf9fa){var _0x1c9d88=_['find'](_0x3a240b,[_0x90f6('0x2d'),_0x2bf9fa[_0x90f6('0x2d')]]);if(_0x1c9d88[_0x90f6('0x40')]){var _0x3c63d6={};if(_0x4ddede['childModel']==='AnalyticExtractedReport'){_0x3c63d6[_0x1c9d88['foreignKey']]=_[_0x90f6('0x3d')](_0x2bf9fa[_0x90f6('0x75')],'id');}else{_0x3c63d6[_0x1c9d88[_0x90f6('0x76')]]=_0x2bf9fa['associatedResources'];}_0x4df5e6[_0x90f6('0x5e')](_0x3c63d6);}else{_0x398d4c[_0x90f6('0x3a')]['id']=_0x2bf9fa[_0x90f6('0x75')];}}else{for(var _0x17c86e=0x0;_0x17c86e<_0x1197d8['length'];_0x17c86e++){var _0x1c9d88=_['find'](_0x3a240b,[_0x90f6('0x2d'),_0x1197d8[_0x17c86e][_0x90f6('0x2d')]]);if(_0x1c9d88['field']){var _0x3c63d6={};_0x3c63d6[_0x1c9d88[_0x90f6('0x76')]]=_0x1197d8[_0x17c86e][_0x90f6('0x75')];_0x4df5e6[_0x90f6('0x5e')](_0x3c63d6);}else{if(!_0x398d4c['where']['id'])_0x398d4c['where']['id']=[];_0x1197d8[_0x17c86e]['associatedResources'][_0x90f6('0x77')](function(_0x1a7ccc){_0x398d4c['where']['id'][_0x90f6('0x5e')](_0x1a7ccc);});}}}if(!_[_0x90f6('0x71')](_0x4df5e6)){_0x398d4c[_0x90f6('0x3a')]=_[_0x90f6('0x41')](_0x398d4c[_0x90f6('0x3a')],{'$and':{'$or':_0x4df5e6}});}_0x398d4c=_[_0x90f6('0x41')]({},_0x398d4c,_0x3bcbab[_0x90f6('0x49')]);if(_0x2bf9fa&&!_0x2bf9fa[_0x90f6('0x56')]&&_0x4ddede['childModel']===_0x90f6('0x78')){if(_0x3bcbab['query']['includeAll']){_0x398d4c['include']=[{'all':!![]}];}return db[_0x4ddede[_0x90f6('0x6c')]][_0x90f6('0x42')](_0x398d4c)[_0x90f6('0x28')](function(_0x12c23a){var _0x3173bf=[];_0x12c23a[_0x90f6('0x77')](function(_0x164a19){var _0x1fb43e;switch(_0x164a19['reportType']){case _0x90f6('0x79'):_0x1fb43e=_[_0x90f6('0x5a')](_0x2bf9fa[_0x90f6('0x75')],function(_0x12976a){return _0x12976a['id']===_0x164a19[_0x90f6('0x7a')]&&_0x12976a[_0x90f6('0x3e')]===_0x90f6('0x7b');});break;case'custom':_0x1fb43e=_[_0x90f6('0x5a')](_0x2bf9fa['associatedResources'],function(_0x471773){return _0x471773['id']===_0x164a19[_0x90f6('0x7a')]&&_0x471773['type']==='CustomReports';});break;}if(_0x1fb43e)_0x3173bf[_0x90f6('0x5e')](_0x164a19);});_0x5dc3c5['count']=_0x3173bf[_0x90f6('0x37')];_0x5dc3c5['rows']=_0x3173bf;return _0x5dc3c5;});}else{return db[_0x4ddede[_0x90f6('0x6c')]]['count']({'where':_0x398d4c['where']})[_0x90f6('0x28')](function(_0xb2d97a){_0x5dc3c5[_0x90f6('0x1f')]=_0xb2d97a;if(_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x48')]){if(_0x4ddede[_0x90f6('0x6c')]===_0x90f6('0x7c')){_0x398d4c[_0x90f6('0x4d')]=[{'model':db[_0x90f6('0x7d')],'as':_0x90f6('0x7e'),'attributes':['id',_0x90f6('0x2d'),'color'],'required':_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x7f')]?!![]:![]},{'model':db[_0x90f6('0x7d')],'as':'ThroughTags','attributes':['id',_0x90f6('0x2d'),_0x90f6('0x80')],'through':_0x3bcbab[_0x90f6('0x31')]['tag']?{'attributes':[],'where':{'TagId':_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x7f')]||undefined}}:{},'required':_0x3bcbab[_0x90f6('0x31')][_0x90f6('0x7f')]?!![]:![]}];}else{_0x398d4c[_0x90f6('0x4d')]=[{'all':!![]}];}}return db[_0x4ddede[_0x90f6('0x6c')]][_0x90f6('0x42')](_0x398d4c);})[_0x90f6('0x28')](function(_0x45f788){_0x5dc3c5[_0x90f6('0x43')]=_0x45f788;return _0x5dc3c5;});}}else{return _0x5dc3c5;}})[_0x90f6('0x28')](respondWithFilteredResult(_0x3bf788,_0x398d4c))[_0x90f6('0x44')](handleError(_0x3bf788,null));};function getAllResources(_0x2e64a5,_0x59eb2a){return new BPromise(function(_0x387195,_0xb7be57){if(_0x59eb2a){var _0x34ca0d=_0x59eb2a['filter']?{[_0x59eb2a['filter'][_0x90f6('0x40')]]:_0x59eb2a[_0x90f6('0x3c')][_0x90f6('0x81')]}:undefined;return db[_0x2e64a5]['findAll']({'where':_0x34ca0d,'raw':!![]})[_0x90f6('0x28')](function(_0xa10c6){_0x59eb2a[_0x90f6('0x75')]=_[_0x90f6('0x3d')](_0xa10c6,'id');_0x387195(_0x59eb2a);})[_0x90f6('0x44')](function(_0x322163){_0xb7be57(_0x322163);});}else{_0x387195(null);}});}function getAllFilteredResources(_0x2f1389,_0x64483f){return new BPromise(function(_0xb9d095,_0x320790){var _0x3e929d=_0x2f1389['filter']?{[_0x2f1389['filter'][_0x90f6('0x40')]]:_0x2f1389['filter'][_0x90f6('0x81')]}:undefined;return db[_0x2f1389['model']][_0x90f6('0x42')]({'where':_0x3e929d,'raw':!![]})['then'](function(_0x3e22d9){_0x64483f[_0x90f6('0x75')]=_[_0x90f6('0x3d')](_0x3e22d9,function(_0x37a7e){return _0x37a7e[_0x90f6('0x2d')];});_0xb9d095(_0x64483f);})[_0x90f6('0x44')](function(_0x261f8e){_0x320790(_0x261f8e);});});}function getAllowedResources(_0x12676b,_0xb2f410,_0x1f6273){return new BPromise(function(_0x541c67,_0x5a9cd3){if(_0xb2f410){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0xb2f410['id']},'raw':!![]})['then'](function(_0x2e87fb){if(_0x12676b['field']&&_0x12676b[_0x90f6('0x40')]!=='id'){_0xb2f410[_0x90f6('0x75')]=_[_0x90f6('0x3d')](_0x2e87fb,function(_0x259288){return _0x259288[_0x12676b['field']];});}else{if(_0x1f6273==='AnalyticExtractedReport'){_0xb2f410[_0x90f6('0x75')]=_['map'](_0x2e87fb,function(_0x52f53c){return{'id':_0x52f53c[_0x90f6('0x82')],'type':_0x52f53c[_0x90f6('0x3e')]};});}else{_0xb2f410[_0x90f6('0x75')]=_[_0x90f6('0x3d')](_0x2e87fb,function(_0x1649b9){return _0x1649b9[_0x90f6('0x82')];});}}_0x541c67(_0xb2f410);})[_0x90f6('0x44')](function(_0x173e1){_0x5a9cd3(_0x173e1);});}else{_0x541c67(null);}});}function getQueryModels(_0x4685d4,_0x4b8cb5){var _0x322950=_0x4685d4['toLowerCase']();var _0x473d8e={'childModel':undefined,'parentSections':[]};switch(_0x322950){case _0x90f6('0x83'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x84');break;case _0x90f6('0x85'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x86');break;case _0x90f6('0x87'):_0x473d8e['childModel']='SquareRecording';_0x473d8e[_0x90f6('0x6e')]=[{'name':_0x90f6('0x88'),'field':_0x90f6('0x2d'),'foreignKey':_0x90f6('0x89')}];break;case _0x90f6('0x8a'):_0x473d8e[_0x90f6('0x6c')]='JscriptyProject';break;case _0x90f6('0x8b'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x7c');_0x473d8e['parentSections']=[{'name':_0x90f6('0x8c'),'field':'id','foreignKey':'ListId'}];break;case _0x90f6('0x8d'):_0x473d8e['childModel']=_0x90f6('0x8e');break;case _0x90f6('0x8f'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x90');break;case _0x90f6('0x91'):_0x473d8e[_0x90f6('0x6c')]='CmCustomField';break;case _0x90f6('0x92'):_0x473d8e[_0x90f6('0x6c')]='ChatQueue';break;case _0x90f6('0x93'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x94');break;case _0x90f6('0x95'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x96');break;case _0x90f6('0x97'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x98');break;case _0x90f6('0x99'):case'internalroutes':case _0x90f6('0x9a'):_0x473d8e[_0x90f6('0x6c')]='VoiceExtension';break;case _0x90f6('0x9b'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0x9c');break;case _0x90f6('0x9d'):_0x473d8e['childModel']=_0x90f6('0x9e');break;case _0x90f6('0x9f'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xa0');_0x473d8e[_0x90f6('0x6e')]=[{'name':_0x90f6('0xa1'),'field':'name','foreignKey':_0x90f6('0xa2'),'model':_0x90f6('0xa3'),'filter':{'field':_0x90f6('0xa4'),'value':[_0x90f6('0xa5')]}},{'name':_0x90f6('0xa6'),'field':_0x90f6('0x2d'),'foreignKey':_0x90f6('0xa2'),'model':_0x90f6('0xa3'),'filter':{'field':_0x90f6('0xa4'),'value':['telephone']}},{'name':_0x90f6('0xa7'),'field':_0x90f6('0x2d'),'foreignKey':_0x90f6('0xa8'),'model':_0x90f6('0xa9'),'filter':{'field':'type','value':[_0x90f6('0xaa')]}},{'name':_0x90f6('0xab'),'field':_0x90f6('0x2d'),'foreignKey':_0x90f6('0xa8'),'model':'VoiceQueue','filter':{'field':_0x90f6('0x3e'),'value':[_0x90f6('0xac')]}}];break;case _0x90f6('0xad'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xae');break;case _0x90f6('0xaf'):_0x473d8e['childModel']=_0x90f6('0xb0');break;case _0x90f6('0xb1'):_0x473d8e[_0x90f6('0x6c')]='VoicePrefix';break;case _0x90f6('0xb2'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xb3');break;case _0x90f6('0xb4'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xb5');break;case _0x90f6('0xb6'):_0x473d8e[_0x90f6('0x6c')]='MailAccount';break;case _0x90f6('0xb7'):_0x473d8e['childModel']='MailSubstatus';break;case _0x90f6('0xb8'):_0x473d8e[_0x90f6('0x6c')]='OpenchannelQueue';break;case _0x90f6('0xb9'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xba');break;case _0x90f6('0xbb'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xbc');break;case'smsaccounts':_0x473d8e[_0x90f6('0x6c')]='SmsAccount';break;case _0x90f6('0xbd'):_0x473d8e['childModel']=_0x90f6('0xbe');break;case _0x90f6('0xbf'):case _0x90f6('0xc0'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xa9');if(_0x4b8cb5){_0x473d8e[_0x90f6('0x6e')]=[{'name':_0x90f6('0xa7')},{'name':_0x90f6('0xab')}];}break;case _0x90f6('0xc1'):case _0x90f6('0xc2'):case _0x90f6('0xc3'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xa3');if(_0x4b8cb5){_0x473d8e[_0x90f6('0x6e')]=[{'name':_0x90f6('0xc4'),'filter':{'field':_0x90f6('0xa4'),'value':[_0x90f6('0xc5'),_0x90f6('0xc6')]},'ignore':!![]},{'name':'Agents'},{'name':_0x90f6('0xa6')}];}break;case _0x90f6('0xc7'):_0x473d8e[_0x90f6('0x6c')]='ZendeskAccount';break;case _0x90f6('0xc8'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xc9');break;case _0x90f6('0xca'):_0x473d8e['childModel']=_0x90f6('0xcb');break;case _0x90f6('0xcc'):_0x473d8e[_0x90f6('0x6c')]='SugarcrmAccount';break;case _0x90f6('0xcd'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xce');break;case _0x90f6('0xcf'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xd0');break;case _0x90f6('0xd1'):_0x473d8e['childModel']=_0x90f6('0xa3');break;case'cannedanswers':_0x473d8e[_0x90f6('0x6c')]='CannedAnswer';break;case _0x90f6('0xd2'):_0x473d8e['childModel']=_0x90f6('0xd3');break;case _0x90f6('0xd4'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xd5');break;case _0x90f6('0xd6'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xd7');break;case'pauses':_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xd8');break;case _0x90f6('0xd9'):_0x473d8e[_0x90f6('0x6c')]='Schedule';break;case _0x90f6('0xda'):_0x473d8e[_0x90f6('0x6c')]='Sound';break;case _0x90f6('0xdb'):_0x473d8e['childModel']=_0x90f6('0x7d');break;case _0x90f6('0xdc'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xdd');break;case _0x90f6('0xde'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xdf');break;case'trunks':_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xe0');break;case _0x90f6('0xe1'):_0x473d8e[_0x90f6('0x6c')]='Variable';break;case'plugins':_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xe2');break;case'extractedreports':_0x473d8e[_0x90f6('0x6c')]='AnalyticExtractedReport';_0x473d8e[_0x90f6('0x6e')]=[{'name':_0x90f6('0xe3'),'field':'id','foreignKey':_0x90f6('0x7a')}];break;case _0x90f6('0xe4'):_0x473d8e[_0x90f6('0x6c')]=_0x90f6('0xe5');break;default:return _0x473d8e;}return _0x473d8e;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 1aae5f8..ecf9174 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 _0xa8ac=['hook','../../mysqldb','UserProfile','save','update','emit'];(function(_0x3f392a,_0x5208e2){var _0x3d1980=function(_0x387e0f){while(--_0x387e0f){_0x3f392a['push'](_0x3f392a['shift']());}};_0x3d1980(++_0x5208e2);}(_0xa8ac,0xd9));var _0xca8a=function(_0x14bd2e,_0x44a3a3){_0x14bd2e=_0x14bd2e-0x0;var _0x5c6f93=_0xa8ac[_0x14bd2e];return _0x5c6f93;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xca8a('0x0'))['db'][_0xca8a('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca8a('0x2'),'afterUpdate':_0xca8a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5921cc){return function(_0x27e804,_0x4ca2e3,_0x1e5128){UserProfileEvents['emit'](_0x5921cc+':'+_0x27e804['id'],_0x27e804);UserProfileEvents[_0xca8a('0x4')](_0x5921cc,_0x27e804);_0x1e5128(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xca8a('0x5')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xb2d7=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','UserProfile'];(function(_0x5e8602,_0x2ce012){var _0x4434fb=function(_0x5ea1cb){while(--_0x5ea1cb){_0x5e8602['push'](_0x5e8602['shift']());}};_0x4434fb(++_0x2ce012);}(_0xb2d7,0x8e));var _0x7b2d=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0xb2d7[_0x389832];return _0x59429e;};'use strict';var EventEmitter=require(_0x7b2d('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x7b2d('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7b2d('0x2')](0x0);var events={'afterCreate':_0x7b2d('0x3'),'afterUpdate':'update','afterDestroy':_0x7b2d('0x4')};function emitEvent(_0x1ec94d){return function(_0x415596,_0x3b21b7,_0xbafcbe){UserProfileEvents[_0x7b2d('0x5')](_0x1ec94d+':'+_0x415596['id'],_0x415596);UserProfileEvents[_0x7b2d('0x5')](_0x1ec94d,_0x415596);_0xbafcbe(null);};}for(var e in events){if(events[_0x7b2d('0x6')](e)){var event=events[e];UserProfile[_0x7b2d('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index cbfe7c0..b94c80a 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 _0xba1d=['bluebird','request-promise','../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles','lodash','util','api','moment'];(function(_0x5c1ae4,_0x1465cc){var _0x4bca53=function(_0x374ec8){while(--_0x374ec8){_0x5c1ae4['push'](_0x5c1ae4['shift']());}};_0x4bca53(++_0x1465cc);}(_0xba1d,0x11c));var _0xdba1=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xba1d[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xdba1('0x0'));var util=require(_0xdba1('0x1'));var logger=require('../../config/logger')(_0xdba1('0x2'));var moment=require(_0xdba1('0x3'));var BPromise=require(_0xdba1('0x4'));var rp=require(_0xdba1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdba1('0x6'));var attributes=require(_0xdba1('0x7'));module[_0xdba1('0x8')]=function(_0x1b690d,_0x1a9250){return _0x1b690d[_0xdba1('0x9')](_0xdba1('0xa'),attributes,{'tableName':_0xdba1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43ea=['request-promise','path','rimraf','../../config/environment','user_profiles','util','../../config/logger','moment','bluebird'];(function(_0x59ea56,_0xf88a3){var _0x4ee981=function(_0x35afd7){while(--_0x35afd7){_0x59ea56['push'](_0x59ea56['shift']());}};_0x4ee981(++_0xf88a3);}(_0x43ea,0xd4));var _0xa43e=function(_0x1ba219,_0xfcf6c8){_0x1ba219=_0x1ba219-0x0;var _0x28f6cc=_0x43ea[_0x1ba219];return _0x28f6cc;};'use strict';var _=require('lodash');var util=require(_0xa43e('0x0'));var logger=require(_0xa43e('0x1'))('api');var moment=require(_0xa43e('0x2'));var BPromise=require(_0xa43e('0x3'));var rp=require(_0xa43e('0x4'));var fs=require('fs');var path=require(_0xa43e('0x5'));var rimraf=require(_0xa43e('0x6'));var config=require(_0xa43e('0x7'));var attributes=require('./userProfile.attributes');module['exports']=function(_0x5e4ce8,_0x50e970){return _0x5e4ce8['define']('UserProfile',attributes,{'tableName':_0xa43e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f51dd76..f51c753 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 _0x7b3d=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7b3d,0x6c));var _0xd7b3=function(_0x4ce2c3,_0x37c43a){_0x4ce2c3=_0x4ce2c3-0x0;var _0xdbd5e2=_0x7b3d[_0x4ce2c3];return _0xdbd5e2;};'use strict';var _=require(_0xd7b3('0x0'));var util=require('util');var moment=require(_0xd7b3('0x1'));var BPromise=require(_0xd7b3('0x2'));var rs=require(_0xd7b3('0x3'));var fs=require('fs');var Redis=require(_0xd7b3('0x4'));var db=require(_0xd7b3('0x5'))['db'];var utils=require(_0xd7b3('0x6'));var logger=require('../../config/logger')(_0xd7b3('0x7'));var config=require('../../config/environment');var jayson=require(_0xd7b3('0x8'));var client=jayson[_0xd7b3('0x9')][_0xd7b3('0xa')]({'port':0x232a});config['redis']=_[_0xd7b3('0xb')](config[_0xd7b3('0xc')],{'host':_0xd7b3('0xd'),'port':0x18eb});var socket=require(_0xd7b3('0xe'))(new Redis(config[_0xd7b3('0xc')]));require(_0xd7b3('0xf'))[_0xd7b3('0x10')](socket);function respondWithRpcPromise(_0x14a018,_0x53126a,_0xffd45f){return new BPromise(function(_0x2f07d8,_0x54569a){return client[_0xd7b3('0x11')](_0x14a018,_0xffd45f)[_0xd7b3('0x12')](function(_0x325460){logger[_0xd7b3('0x13')](_0xd7b3('0x14'),_0x53126a,_0xd7b3('0x15'));logger[_0xd7b3('0x16')](_0xd7b3('0x17'),_0x53126a,_0xd7b3('0x15'),JSON[_0xd7b3('0x18')](_0x325460));if(_0x325460[_0xd7b3('0x19')]){if(_0x325460[_0xd7b3('0x19')]['code']===0x1f4){logger['error'](_0xd7b3('0x14'),_0x53126a,_0x325460[_0xd7b3('0x19')]['message']);return _0x54569a(_0x325460[_0xd7b3('0x19')][_0xd7b3('0x1a')]);}logger[_0xd7b3('0x19')]('UserProfile,\x20%s,\x20%s',_0x53126a,_0x325460[_0xd7b3('0x19')][_0xd7b3('0x1a')]);return _0x2f07d8(_0x325460['error']['message']);}else{logger[_0xd7b3('0x13')](_0xd7b3('0x14'),_0x53126a,_0xd7b3('0x15'));_0x2f07d8(_0x325460[_0xd7b3('0x1b')]['message']);}})[_0xd7b3('0x1c')](function(_0x237c9d){logger[_0xd7b3('0x19')](_0xd7b3('0x14'),_0x53126a,_0x237c9d);_0x54569a(_0x237c9d);});});} \ No newline at end of file +var _0xf17f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x14a169,_0x232f74){var _0x35c76a=function(_0x244504){while(--_0x244504){_0x14a169['push'](_0x14a169['shift']());}};_0x35c76a(++_0x232f74);}(_0xf17f,0x14a));var _0xff17=function(_0x5d6238,_0xe6992b){_0x5d6238=_0x5d6238-0x0;var _0x46ac6b=_0xf17f[_0x5d6238];return _0x46ac6b;};'use strict';var _=require(_0xff17('0x0'));var util=require(_0xff17('0x1'));var moment=require(_0xff17('0x2'));var BPromise=require(_0xff17('0x3'));var rs=require(_0xff17('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff17('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff17('0x6'))(_0xff17('0x7'));var config=require(_0xff17('0x8'));var jayson=require(_0xff17('0x9'));var client=jayson[_0xff17('0xa')]['http']({'port':0x232a});config['redis']=_[_0xff17('0xb')](config[_0xff17('0xc')],{'host':_0xff17('0xd'),'port':0x18eb});var socket=require(_0xff17('0xe'))(new Redis(config['redis']));require(_0xff17('0xf'))[_0xff17('0x10')](socket);function respondWithRpcPromise(_0x4705e1,_0x48b9c4,_0x539709){return new BPromise(function(_0xa136fb,_0x2a0966){return client[_0xff17('0x11')](_0x4705e1,_0x539709)['then'](function(_0x4e23a5){logger[_0xff17('0x12')]('UserProfile,\x20%s,\x20%s',_0x48b9c4,_0xff17('0x13'));logger['debug'](_0xff17('0x14'),_0x48b9c4,_0xff17('0x13'),JSON[_0xff17('0x15')](_0x4e23a5));if(_0x4e23a5[_0xff17('0x16')]){if(_0x4e23a5[_0xff17('0x16')][_0xff17('0x17')]===0x1f4){logger[_0xff17('0x16')](_0xff17('0x18'),_0x48b9c4,_0x4e23a5[_0xff17('0x16')][_0xff17('0x19')]);return _0x2a0966(_0x4e23a5[_0xff17('0x16')][_0xff17('0x19')]);}logger[_0xff17('0x16')](_0xff17('0x18'),_0x48b9c4,_0x4e23a5[_0xff17('0x16')][_0xff17('0x19')]);return _0xa136fb(_0x4e23a5[_0xff17('0x16')][_0xff17('0x19')]);}else{logger[_0xff17('0x12')](_0xff17('0x18'),_0x48b9c4,'request\x20sent');_0xa136fb(_0x4e23a5[_0xff17('0x1a')][_0xff17('0x19')]);}})[_0xff17('0x1b')](function(_0x3c57c3){logger[_0xff17('0x16')](_0xff17('0x18'),_0x48b9c4,_0x3c57c3);_0x2a0966(_0x3c57c3);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 408b7a0..c65fbae 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 _0x448a=['removeListener','register','length','save','remove','emit'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x448a,0x1ef));var _0xa448=function(_0xb37d84,_0x2dfee4){_0xb37d84=_0xb37d84-0x0;var _0x149567=_0x448a[_0xb37d84];return _0x149567;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xa448('0x0'),_0xa448('0x1'),'update'];function createListener(_0x3f08b0,_0x47909c){return function(_0x5ea7f4){_0x47909c[_0xa448('0x2')](_0x3f08b0,_0x5ea7f4);};}function removeListener(_0x3206fd,_0x57e1ea){return function(){UserProfileEvents[_0xa448('0x3')](_0x3206fd,_0x57e1ea);};}exports[_0xa448('0x4')]=function(_0x343b79){for(var _0x2c16e3=0x0,_0x12b0e2=events[_0xa448('0x5')];_0x2c16e3<_0x12b0e2;_0x2c16e3++){var _0x1ec2d8=events[_0x2c16e3];var _0x54bdb0=createListener('userProfile:'+_0x1ec2d8,_0x343b79);UserProfileEvents['on'](_0x1ec2d8,_0x54bdb0);}}; \ No newline at end of file +var _0xdc0d=['register','length','userProfile:','./userProfile.events','save','update','emit','removeListener'];(function(_0x4a2b18,_0x1335e6){var _0x1282a5=function(_0x9478cf){while(--_0x9478cf){_0x4a2b18['push'](_0x4a2b18['shift']());}};_0x1282a5(++_0x1335e6);}(_0xdc0d,0x1db));var _0xddc0=function(_0xc23b59,_0x305ebd){_0xc23b59=_0xc23b59-0x0;var _0x28b343=_0xdc0d[_0xc23b59];return _0x28b343;};'use strict';var UserProfileEvents=require(_0xddc0('0x0'));var events=[_0xddc0('0x1'),'remove',_0xddc0('0x2')];function createListener(_0x558a1a,_0x223e0f){return function(_0xac8cc5){_0x223e0f[_0xddc0('0x3')](_0x558a1a,_0xac8cc5);};}function removeListener(_0x32ad85,_0xb4e3f){return function(){UserProfileEvents[_0xddc0('0x4')](_0x32ad85,_0xb4e3f);};}exports[_0xddc0('0x5')]=function(_0x39a8da){for(var _0x20f5a9=0x0,_0x5dca02=events[_0xddc0('0x6')];_0x20f5a9<_0x5dca02;_0x20f5a9++){var _0x36760a=events[_0x20f5a9];var _0x3fde68=createListener(_0xddc0('0x7')+_0x36760a,_0x39a8da);UserProfileEvents['on'](_0x36760a,_0x3fde68);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 7f57987..b331970 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 _0x50a8=['express','Router','../../components/auth/service','get','isAuthenticated','describe','show','post','put','/:id','update','destroy','exports','util','connect-timeout'];(function(_0x24b9bb,_0x14a9bf){var _0x2cc588=function(_0x844001){while(--_0x844001){_0x24b9bb['push'](_0x24b9bb['shift']());}};_0x2cc588(++_0x14a9bf);}(_0x50a8,0x193));var _0x850a=function(_0x37b9ad,_0x179adf){_0x37b9ad=_0x37b9ad-0x0;var _0x6264e2=_0x50a8[_0x37b9ad];return _0x6264e2;};'use strict';var multer=require('multer');var util=require(_0x850a('0x0'));var path=require('path');var timeout=require(_0x850a('0x1'));var express=require(_0x850a('0x2'));var router=express[_0x850a('0x3')]();var auth=require(_0x850a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x850a('0x5')]('/',auth[_0x850a('0x6')](),controller['index']);router[_0x850a('0x5')]('/describe',auth[_0x850a('0x6')](),controller[_0x850a('0x7')]);router[_0x850a('0x5')]('/:id',auth[_0x850a('0x6')](),controller[_0x850a('0x8')]);router[_0x850a('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x850a('0xa')](_0x850a('0xb'),auth['isAuthenticated'](),controller[_0x850a('0xc')]);router['delete'](_0x850a('0xb'),auth[_0x850a('0x6')](),controller[_0x850a('0xd')]);module[_0x850a('0xe')]=router; \ No newline at end of file +var _0x4e7b=['show','post','put','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x1611cf,_0x44381b){var _0x4ec671=function(_0x2707a7){while(--_0x2707a7){_0x1611cf['push'](_0x1611cf['shift']());}};_0x4ec671(++_0x44381b);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x3c5f0e,_0x248a1e){_0x3c5f0e=_0x3c5f0e-0x0;var _0x43e608=_0x4e7b[_0x3c5f0e];return _0x43e608;};'use strict';var multer=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var path=require('path');var timeout=require(_0xb4e7('0x2'));var express=require('express');var router=express[_0xb4e7('0x3')]();var auth=require(_0xb4e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb4e7('0x5'));var controller=require(_0xb4e7('0x6'));router['get']('/',auth[_0xb4e7('0x7')](),controller[_0xb4e7('0x8')]);router[_0xb4e7('0x9')](_0xb4e7('0xa'),auth[_0xb4e7('0x7')](),controller['describe']);router[_0xb4e7('0x9')](_0xb4e7('0xb'),auth['isAuthenticated'](),controller[_0xb4e7('0xc')]);router[_0xb4e7('0xd')]('/',auth[_0xb4e7('0x7')](),controller['create']);router[_0xb4e7('0xe')](_0xb4e7('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xb4e7('0x7')](),controller[_0xb4e7('0xf')]);module[_0xb4e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index c7cb764..54186f8 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 _0x9237=['STRING'];(function(_0x302ee4,_0x45ae67){var _0x55641f=function(_0x4253b9){while(--_0x4253b9){_0x302ee4['push'](_0x302ee4['shift']());}};_0x55641f(++_0x45ae67);}(_0x9237,0x159));var _0x7923=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x9237[_0x1cbcf1];return _0x3a06f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7923('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x7923('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x6bcf=['STRING'];(function(_0x5a7ce3,_0x15fbe7){var _0x1cc994=function(_0x1a3c2e){while(--_0x1a3c2e){_0x5a7ce3['push'](_0x5a7ce3['shift']());}};_0x1cc994(++_0x15fbe7);}(_0x6bcf,0x1d2));var _0xf6bc=function(_0x4b8af7,_0x3c98d5){_0x4b8af7=_0x4b8af7-0x0;var _0x273377=_0x6bcf[_0x4b8af7];return _0x273377;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf6bc('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xf6bc('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ba577ea..64c2cab 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 _0x55ca=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','key','filter','merge','include','catch','show','params','includeAll','options','create','body','find','describe','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','UserProfileResource','rawAttributes','model','query','keys','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ca,0x126));var _0xa55c=function(_0x4a8072,_0x435bab){_0x4a8072=_0x4a8072-0x0;var _0x11a4fe=_0x55ca[_0x4a8072];return _0x11a4fe;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];function respondWithStatusCode(_0x3998f7,_0x15eec8){_0x15eec8=_0x15eec8||0xcc;return function(_0x5d47ff){if(_0x5d47ff){return _0x3998f7['sendStatus'](_0x15eec8);}return _0x3998f7[_0xa55c('0x16')](_0x15eec8)['end']();};}function respondWithResult(_0x5a3672,_0x59ea8d){_0x59ea8d=_0x59ea8d||0xc8;return function(_0x18ee85){if(_0x18ee85){return _0x5a3672[_0xa55c('0x16')](_0x59ea8d)[_0xa55c('0x17')](_0x18ee85);}};}function respondWithFilteredResult(_0x938bd6,_0x458480){return function(_0x247e77){if(_0x247e77){var _0x4e0b2f=_0x247e77[_0xa55c('0x18')],_0x3ccf65=_0x458480[_0xa55c('0x19')],_0x3dcf4f=_0x458480[_0xa55c('0x19')]+_0x458480[_0xa55c('0x1a')],_0x25934f;if(_0x3dcf4f>=_0x4e0b2f){_0x3dcf4f=_0x4e0b2f;_0x25934f=0xc8;}else{_0x25934f=0xce;}_0x938bd6[_0xa55c('0x16')](_0x25934f);return _0x938bd6[_0xa55c('0x1b')]('Content-Range',_0x3ccf65+'-'+_0x3dcf4f+'/'+_0x4e0b2f)[_0xa55c('0x17')](_0x247e77);}return null;};}function patchUpdates(_0x104a99){return function(_0x461284){try{jsonpatch[_0xa55c('0x1c')](_0x461284,_0x104a99,!![]);}catch(_0x23a1ae){return BPromise[_0xa55c('0x1d')](_0x23a1ae);}return _0x461284['save']();};}function saveUpdates(_0x5f5158,_0xd643cc){return function(_0x3776ac){if(_0x3776ac){return _0x3776ac[_0xa55c('0x1e')](_0x5f5158)['then'](function(_0x383d92){return _0x383d92;});}return null;};}function removeEntity(_0x2fcb90,_0x54945a){return function(_0x187a87){if(_0x187a87){return _0x187a87[_0xa55c('0x1f')]()[_0xa55c('0x20')](function(){_0x2fcb90[_0xa55c('0x16')](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x49ed04,_0x1fc828){return function(_0x504c24){if(!_0x504c24){_0x49ed04['sendStatus'](0x194);}return _0x504c24;};}function handleError(_0x59d89a,_0x19ae88){_0x19ae88=_0x19ae88||0x1f4;return function(_0x54b038){logger[_0xa55c('0x22')](_0x54b038[_0xa55c('0x23')]);if(_0x54b038[_0xa55c('0x24')]){delete _0x54b038[_0xa55c('0x24')];}_0x59d89a[_0xa55c('0x16')](_0x19ae88)[_0xa55c('0x25')](_0x54b038);};}exports[_0xa55c('0x26')]=function(_0x11e7f7,_0x192df2){var _0x3cd152={},_0x1273d7={},_0x57f271={'count':0x0,'rows':[]};var _0x430d55=db[_0xa55c('0x27')][_0xa55c('0x28')];_0x1273d7[_0xa55c('0x29')]=_['keys'](_0x430d55);_0x1273d7[_0xa55c('0x2a')]=_[_0xa55c('0x2b')](_0x11e7f7[_0xa55c('0x2a')]);_0x1273d7[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x1273d7[_0xa55c('0x29')],_0x1273d7['query']);_0x3cd152[_0xa55c('0x2e')]=_['intersection'](_0x1273d7[_0xa55c('0x29')],qs[_0xa55c('0x2f')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x3cd152['attributes']=_0x3cd152[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x3cd152[_0xa55c('0x2e')]:_0x1273d7[_0xa55c('0x29')];if(!_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x31')](_0xa55c('0x32'))){_0x3cd152[_0xa55c('0x1a')]=qs[_0xa55c('0x1a')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x1a')]);_0x3cd152['offset']=qs['offset'](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x19')]);}_0x3cd152['order']=qs[_0xa55c('0x33')](_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x33')]);_0x3cd152[_0xa55c('0x34')]=qs[_0xa55c('0x2c')](_[_0xa55c('0x35')](_0x11e7f7[_0xa55c('0x2a')],_0x1273d7[_0xa55c('0x2c')]));if(_0x11e7f7[_0xa55c('0x2a')]['filter']){_0x3cd152['where']=_['merge'](_0x3cd152[_0xa55c('0x34')],{'$or':_[_0xa55c('0x36')](_0x430d55,function(_0x2bb4f0){if(_0x2bb4f0['type'][_0xa55c('0x37')]!=='VIRTUAL'){var _0x119220={};_0x119220[_0x2bb4f0['field']]={'$like':'%'+_0x11e7f7[_0xa55c('0x2a')][_0xa55c('0x38')]+'%'};return _0x119220;}})});}_0x3cd152=_[_0xa55c('0x39')]({},_0x3cd152,_0x11e7f7['options']);var _0x7c4a47={'where':_0x3cd152[_0xa55c('0x34')]};return db['UserProfileResource'][_0xa55c('0x18')](_0x7c4a47)[_0xa55c('0x20')](function(_0x4d9083){_0x57f271['count']=_0x4d9083;if(_0x11e7f7[_0xa55c('0x2a')]['includeAll']){_0x3cd152[_0xa55c('0x3a')]=[{'all':!![]}];}return db[_0xa55c('0x27')]['findAll'](_0x3cd152);})['then'](function(_0x5e50b6){_0x57f271['rows']=_0x5e50b6;return _0x57f271;})[_0xa55c('0x20')](respondWithFilteredResult(_0x192df2,_0x3cd152))[_0xa55c('0x3b')](handleError(_0x192df2,null));};exports[_0xa55c('0x3c')]=function(_0x99c4f8,_0x2d8cbf){var _0x56d17c={'raw':![],'where':{'id':_0x99c4f8[_0xa55c('0x3d')]['id']}},_0x3d52d8={};_0x3d52d8[_0xa55c('0x29')]=_[_0xa55c('0x2b')](db[_0xa55c('0x27')][_0xa55c('0x28')]);_0x3d52d8['query']=_[_0xa55c('0x2b')](_0x99c4f8['query']);_0x3d52d8['filters']=_[_0xa55c('0x2d')](_0x3d52d8[_0xa55c('0x29')],_0x3d52d8['query']);_0x56d17c[_0xa55c('0x2e')]=_['intersection'](_0x3d52d8['model'],qs[_0xa55c('0x2f')](_0x99c4f8[_0xa55c('0x2a')][_0xa55c('0x2f')]));_0x56d17c['attributes']=_0x56d17c[_0xa55c('0x2e')][_0xa55c('0x30')]?_0x56d17c['attributes']:_0x3d52d8[_0xa55c('0x29')];if(_0x99c4f8['query'][_0xa55c('0x3e')]){_0x56d17c[_0xa55c('0x3a')]=[{'all':!![]}];}_0x56d17c=_['merge']({},_0x56d17c,_0x99c4f8[_0xa55c('0x3f')]);return db[_0xa55c('0x27')]['find'](_0x56d17c)[_0xa55c('0x20')](handleEntityNotFound(_0x2d8cbf,null))[_0xa55c('0x20')](respondWithResult(_0x2d8cbf,null))[_0xa55c('0x3b')](handleError(_0x2d8cbf,null));};exports['create']=function(_0x334f52,_0x582901){return db[_0xa55c('0x27')][_0xa55c('0x40')](_0x334f52[_0xa55c('0x41')],{})['then'](respondWithResult(_0x582901,0xc9))[_0xa55c('0x3b')](handleError(_0x582901,null));};exports[_0xa55c('0x1e')]=function(_0x592429,_0x3d19f5){if(_0x592429[_0xa55c('0x41')]['id']){delete _0x592429['body']['id'];}return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x592429['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x3d19f5,null))[_0xa55c('0x20')](saveUpdates(_0x592429[_0xa55c('0x41')],null))[_0xa55c('0x20')](respondWithResult(_0x3d19f5,null))['catch'](handleError(_0x3d19f5,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x27')][_0xa55c('0x42')]({'where':{'id':_0x58a7ea['params']['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](removeEntity(_0x2157d6,null))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x43')]=function(_0x34de95,_0x3822b7){return db[_0xa55c('0x27')][_0xa55c('0x43')]()[_0xa55c('0x20')](respondWithResult(_0x3822b7,null))[_0xa55c('0x3b')](handleError(_0x3822b7,null));}; \ No newline at end of file +var _0x70e0=['model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','sort','where','filter','merge','map','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','UserProfileResource','rawAttributes'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x70e0,0x17b));var _0x070e=function(_0x2755ff,_0x5575e3){_0x2755ff=_0x2755ff-0x0;var _0x55db19=_0x70e0[_0x2755ff];return _0x55db19;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x070e('0xf'));var logger=require(_0x070e('0x10'))(_0x070e('0x11'));var utils=require(_0x070e('0x12'));var config=require(_0x070e('0x13'));var db=require(_0x070e('0x14'))['db'];function respondWithStatusCode(_0x25cfe1,_0x1baa12){_0x1baa12=_0x1baa12||0xcc;return function(_0x39d2b9){if(_0x39d2b9){return _0x25cfe1[_0x070e('0x15')](_0x1baa12);}return _0x25cfe1[_0x070e('0x16')](_0x1baa12)['end']();};}function respondWithResult(_0x5dca0f,_0x24baba){_0x24baba=_0x24baba||0xc8;return function(_0x56c7ba){if(_0x56c7ba){return _0x5dca0f['status'](_0x24baba)['json'](_0x56c7ba);}};}function respondWithFilteredResult(_0x11d2ce,_0x14c3fd){return function(_0x51d14d){if(_0x51d14d){var _0x5d3a38=_0x51d14d[_0x070e('0x17')],_0x373d86=_0x14c3fd['offset'],_0xeae1a5=_0x14c3fd['offset']+_0x14c3fd[_0x070e('0x18')],_0x180897;if(_0xeae1a5>=_0x5d3a38){_0xeae1a5=_0x5d3a38;_0x180897=0xc8;}else{_0x180897=0xce;}_0x11d2ce[_0x070e('0x16')](_0x180897);return _0x11d2ce[_0x070e('0x19')](_0x070e('0x1a'),_0x373d86+'-'+_0xeae1a5+'/'+_0x5d3a38)[_0x070e('0x1b')](_0x51d14d);}return null;};}function patchUpdates(_0x5037eb){return function(_0x3938b5){try{jsonpatch[_0x070e('0x1c')](_0x3938b5,_0x5037eb,!![]);}catch(_0x1ad3de){return BPromise[_0x070e('0x1d')](_0x1ad3de);}return _0x3938b5[_0x070e('0x1e')]();};}function saveUpdates(_0x5c16fd,_0x5b2f48){return function(_0x4e958f){if(_0x4e958f){return _0x4e958f[_0x070e('0x1f')](_0x5c16fd)[_0x070e('0x20')](function(_0x20dc60){return _0x20dc60;});}return null;};}function removeEntity(_0x4be0d7,_0x5b184){return function(_0x5dc5d2){if(_0x5dc5d2){return _0x5dc5d2[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x4be0d7[_0x070e('0x16')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0x28a1c3,_0xa86797){return function(_0xe405e){if(!_0xe405e){_0x28a1c3[_0x070e('0x15')](0x194);}return _0xe405e;};}function handleError(_0x595c7e,_0x2f8055){_0x2f8055=_0x2f8055||0x1f4;return function(_0x270061){logger[_0x070e('0x23')](_0x270061['stack']);if(_0x270061[_0x070e('0x24')]){delete _0x270061['name'];}_0x595c7e['status'](_0x2f8055)[_0x070e('0x25')](_0x270061);};}exports[_0x070e('0x26')]=function(_0x41deb1,_0x1743cc){var _0x4763c6={},_0x497f58={},_0x374c54={'count':0x0,'rows':[]};var _0x219e48=db[_0x070e('0x27')][_0x070e('0x28')];_0x497f58[_0x070e('0x29')]=_[_0x070e('0x2a')](_0x219e48);_0x497f58[_0x070e('0x2b')]=_[_0x070e('0x2a')](_0x41deb1['query']);_0x497f58[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x497f58[_0x070e('0x29')],_0x497f58['query']);_0x4763c6['attributes']=_[_0x070e('0x2d')](_0x497f58[_0x070e('0x29')],qs[_0x070e('0x2e')](_0x41deb1['query'][_0x070e('0x2e')]));_0x4763c6[_0x070e('0x2f')]=_0x4763c6[_0x070e('0x2f')][_0x070e('0x30')]?_0x4763c6['attributes']:_0x497f58['model'];if(!_0x41deb1['query']['hasOwnProperty'](_0x070e('0x31'))){_0x4763c6['limit']=qs[_0x070e('0x18')](_0x41deb1[_0x070e('0x2b')]['limit']);_0x4763c6['offset']=qs[_0x070e('0x32')](_0x41deb1[_0x070e('0x2b')]['offset']);}_0x4763c6['order']=qs[_0x070e('0x33')](_0x41deb1[_0x070e('0x2b')][_0x070e('0x33')]);_0x4763c6[_0x070e('0x34')]=qs[_0x070e('0x2c')](_['pick'](_0x41deb1['query'],_0x497f58[_0x070e('0x2c')]));if(_0x41deb1[_0x070e('0x2b')][_0x070e('0x35')]){_0x4763c6[_0x070e('0x34')]=_[_0x070e('0x36')](_0x4763c6['where'],{'$or':_[_0x070e('0x37')](_0x219e48,function(_0x1927f4){if(_0x1927f4['type'][_0x070e('0x38')]!==_0x070e('0x39')){var _0x4ba6f0={};_0x4ba6f0[_0x1927f4['field']]={'$like':'%'+_0x41deb1['query'][_0x070e('0x35')]+'%'};return _0x4ba6f0;}})});}_0x4763c6=_[_0x070e('0x36')]({},_0x4763c6,_0x41deb1[_0x070e('0x3a')]);var _0x334733={'where':_0x4763c6[_0x070e('0x34')]};return db['UserProfileResource'][_0x070e('0x17')](_0x334733)[_0x070e('0x20')](function(_0xb53332){_0x374c54['count']=_0xb53332;if(_0x41deb1[_0x070e('0x2b')][_0x070e('0x3b')]){_0x4763c6[_0x070e('0x3c')]=[{'all':!![]}];}return db['UserProfileResource'][_0x070e('0x3d')](_0x4763c6);})[_0x070e('0x20')](function(_0x4800a9){_0x374c54[_0x070e('0x3e')]=_0x4800a9;return _0x374c54;})['then'](respondWithFilteredResult(_0x1743cc,_0x4763c6))[_0x070e('0x3f')](handleError(_0x1743cc,null));};exports[_0x070e('0x40')]=function(_0x3462d3,_0x30319c){var _0xd03404={'raw':![],'where':{'id':_0x3462d3[_0x070e('0x41')]['id']}},_0x47b929={};_0x47b929['model']=_['keys'](db[_0x070e('0x27')][_0x070e('0x28')]);_0x47b929[_0x070e('0x2b')]=_['keys'](_0x3462d3[_0x070e('0x2b')]);_0x47b929[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x47b929[_0x070e('0x29')],_0x47b929['query']);_0xd03404[_0x070e('0x2f')]=_['intersection'](_0x47b929['model'],qs['fields'](_0x3462d3[_0x070e('0x2b')][_0x070e('0x2e')]));_0xd03404[_0x070e('0x2f')]=_0xd03404[_0x070e('0x2f')][_0x070e('0x30')]?_0xd03404['attributes']:_0x47b929[_0x070e('0x29')];if(_0x3462d3['query'][_0x070e('0x3b')]){_0xd03404[_0x070e('0x3c')]=[{'all':!![]}];}_0xd03404=_[_0x070e('0x36')]({},_0xd03404,_0x3462d3['options']);return db['UserProfileResource'][_0x070e('0x42')](_0xd03404)['then'](handleEntityNotFound(_0x30319c,null))[_0x070e('0x20')](respondWithResult(_0x30319c,null))[_0x070e('0x3f')](handleError(_0x30319c,null));};exports[_0x070e('0x43')]=function(_0x5f5675,_0x7c15f9){return db[_0x070e('0x27')]['create'](_0x5f5675['body'],{})[_0x070e('0x20')](respondWithResult(_0x7c15f9,0xc9))[_0x070e('0x3f')](handleError(_0x7c15f9,null));};exports[_0x070e('0x1f')]=function(_0x1fc7c4,_0x253e11){if(_0x1fc7c4['body']['id']){delete _0x1fc7c4[_0x070e('0x44')]['id'];}return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x1fc7c4[_0x070e('0x41')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x253e11,null))[_0x070e('0x20')](saveUpdates(_0x1fc7c4[_0x070e('0x44')],null))[_0x070e('0x20')](respondWithResult(_0x253e11,null))[_0x070e('0x3f')](handleError(_0x253e11,null));};exports[_0x070e('0x21')]=function(_0x210c4d,_0x3be553){return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x210c4d[_0x070e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3be553,null))[_0x070e('0x20')](removeEntity(_0x3be553,null))[_0x070e('0x3f')](handleError(_0x3be553,null));};exports[_0x070e('0x45')]=function(_0x249e3f,_0x2760fc){return db[_0x070e('0x27')][_0x070e('0x45')]()[_0x070e('0x20')](respondWithResult(_0x2760fc,null))[_0x070e('0x3f')](handleError(_0x2760fc,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6ae5a27..d76f29b 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 _0x9e88=['user_profile_has_resources','compositeIndex','sectionId','util','api','bluebird','request-promise','path','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x4f7801,_0x1d2362){var _0x1d1ca=function(_0x2e86b4){while(--_0x2e86b4){_0x4f7801['push'](_0x4f7801['shift']());}};_0x1d1ca(++_0x1d2362);}(_0x9e88,0x6f));var _0x89e8=function(_0x177d6f,_0x1d287d){_0x177d6f=_0x177d6f-0x0;var _0x571d38=_0x9e88[_0x177d6f];return _0x571d38;};'use strict';var _=require('lodash');var util=require(_0x89e8('0x0'));var logger=require('../../config/logger')(_0x89e8('0x1'));var moment=require('moment');var BPromise=require(_0x89e8('0x2'));var rp=require(_0x89e8('0x3'));var fs=require('fs');var path=require(_0x89e8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x89e8('0x5'));module[_0x89e8('0x6')]=function(_0x1a6c69,_0x103bb0){return _0x1a6c69[_0x89e8('0x7')](_0x89e8('0x8'),attributes,{'tableName':_0x89e8('0x9'),'paranoid':![],'indexes':[{'name':_0x89e8('0xa'),'fields':['resourceId',_0x89e8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4670=['compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','define','UserProfileResource','user_profile_has_resources'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4670,0xed));var _0x0467=function(_0x2802e0,_0x593fcc){_0x2802e0=_0x2802e0-0x0;var _0x5d2585=_0x4670[_0x2802e0];return _0x5d2585;};'use strict';var _=require(_0x0467('0x0'));var util=require(_0x0467('0x1'));var logger=require(_0x0467('0x2'))(_0x0467('0x3'));var moment=require(_0x0467('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0467('0x5'));var config=require(_0x0467('0x6'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x112253,_0x287087){return _0x112253[_0x0467('0x7')](_0x0467('0x8'),attributes,{'tableName':_0x0467('0x9'),'paranoid':![],'indexes':[{'name':_0x0467('0xa'),'fields':[_0x0467('0xb'),_0x0467('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e5488f4..567e88d 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 _0x0309=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x28b69c,_0x356adb){var _0x41dce1=function(_0xb3f631){while(--_0xb3f631){_0x28b69c['push'](_0x28b69c['shift']());}};_0x41dce1(++_0x356adb);}(_0x0309,0x165));var _0x9030=function(_0x42507d,_0x13155e){_0x42507d=_0x42507d-0x0;var _0x20a4d1=_0x0309[_0x42507d];return _0x20a4d1;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105c15,_0x4f2d84,_0xb53eb4){return new BPromise(function(_0x4e6c7b,_0x1e2360){return client[_0x9030('0xa')](_0x105c15,_0xb53eb4)[_0x9030('0xb')](function(_0x5711b4){logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));logger['debug'](_0x9030('0xf'),_0x4f2d84,_0x9030('0xe'),JSON[_0x9030('0x10')](_0x5711b4));if(_0x5711b4[_0x9030('0x11')]){if(_0x5711b4[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x1e2360(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}logger['error'](_0x9030('0xd'),_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x4e6c7b(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}else{logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));_0x4e6c7b(_0x5711b4[_0x9030('0x14')]['message']);}})[_0x9030('0x15')](function(_0x17e80d){logger[_0x9030('0x11')](_0x9030('0xd'),_0x4f2d84,_0x17e80d);_0x1e2360(_0x17e80d);});});} \ No newline at end of file +var _0xb145=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileResource,\x20%s,\x20%s','message'];(function(_0x329c9e,_0x377952){var _0x48ed1e=function(_0x1f7a85){while(--_0x1f7a85){_0x329c9e['push'](_0x329c9e['shift']());}};_0x48ed1e(++_0x377952);}(_0xb145,0xa3));var _0x5b14=function(_0x36cc1c,_0x5bf49b){_0x36cc1c=_0x36cc1c-0x0;var _0x13de34=_0xb145[_0x36cc1c];return _0x13de34;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index e27174e..13a2985 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 _0x9d21=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d21,0xf9));var _0x19d2=function(_0x1f5236,_0xea7afc){_0x1f5236=_0x1f5236-0x0;var _0x2efe18=_0x9d21[_0x1f5236];return _0x2efe18;};'use strict';var multer=require(_0x19d2('0x0'));var util=require(_0x19d2('0x1'));var path=require(_0x19d2('0x2'));var timeout=require(_0x19d2('0x3'));var express=require(_0x19d2('0x4'));var router=express[_0x19d2('0x5')]();var auth=require(_0x19d2('0x6'));var interaction=require(_0x19d2('0x7'));var config=require(_0x19d2('0x8'));var controller=require('./userProfileSection.controller');router[_0x19d2('0x9')]('/',auth[_0x19d2('0xa')](),controller[_0x19d2('0xb')]);router['get'](_0x19d2('0xc'),auth[_0x19d2('0xa')](),controller[_0x19d2('0xd')]);router[_0x19d2('0x9')](_0x19d2('0xe'),auth[_0x19d2('0xa')](),controller['show']);router[_0x19d2('0xf')]('/',auth[_0x19d2('0xa')](),controller['create']);router[_0x19d2('0x10')](_0x19d2('0xe'),auth[_0x19d2('0xa')](),controller[_0x19d2('0x11')]);router['delete'](_0x19d2('0xe'),auth[_0x19d2('0xa')](),controller['destroy']);module[_0x19d2('0x12')]=router; \ No newline at end of file +var _0x5836=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x260320,_0x549425){var _0x458bf8=function(_0x296a8b){while(--_0x296a8b){_0x260320['push'](_0x260320['shift']());}};_0x458bf8(++_0x549425);}(_0x5836,0x158));var _0x6583=function(_0x4144c0,_0x253e2b){_0x4144c0=_0x4144c0-0x0;var _0x424d45=_0x5836[_0x4144c0];return _0x424d45;};'use strict';var multer=require(_0x6583('0x0'));var util=require(_0x6583('0x1'));var path=require('path');var timeout=require(_0x6583('0x2'));var express=require('express');var router=express[_0x6583('0x3')]();var auth=require(_0x6583('0x4'));var interaction=require(_0x6583('0x5'));var config=require(_0x6583('0x6'));var controller=require(_0x6583('0x7'));router[_0x6583('0x8')]('/',auth['isAuthenticated'](),controller[_0x6583('0x9')]);router[_0x6583('0x8')]('/describe',auth[_0x6583('0xa')](),controller[_0x6583('0xb')]);router[_0x6583('0x8')](_0x6583('0xc'),auth[_0x6583('0xa')](),controller[_0x6583('0xd')]);router['post']('/',auth[_0x6583('0xa')](),controller['create']);router[_0x6583('0xe')](_0x6583('0xc'),auth[_0x6583('0xa')](),controller[_0x6583('0xf')]);router[_0x6583('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6583('0x11')]);module[_0x6583('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index df749e1..f698256 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 _0x9c44=['BOOLEAN','crudPermissions','getDataValue','split','STRING','INTEGER'];(function(_0x41119,_0x40012b){var _0x267edf=function(_0x5d842f){while(--_0x5d842f){_0x41119['push'](_0x41119['shift']());}};_0x267edf(++_0x40012b);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x49c4('0x0')],'set':function(_0x4e0313){this['setDataValue'](_0x49c4('0x3'),_0x4e0313?_0x4e0313['join'](''):[]);},'get':function(){return this[_0x49c4('0x4')](_0x49c4('0x3'))?this[_0x49c4('0x4')](_0x49c4('0x3'))[_0x49c4('0x5')](''):[];}}}; \ No newline at end of file +var _0x3e74=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0x3e74,0x175));var _0x43e7=function(_0xde701e,_0x1b42fb){_0xde701e=_0xde701e-0x0;var _0x49ee7f=_0x3e74[_0xde701e];return _0x49ee7f;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x43e7('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x43e7('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x43e7('0x1')],'set':function(_0x4f9bbe){this[_0x43e7('0x3')](_0x43e7('0x4'),_0x4f9bbe?_0x4f9bbe[_0x43e7('0x5')](''):[]);},'get':function(){return this[_0x43e7('0x6')](_0x43e7('0x4'))?this['getDataValue'](_0x43e7('0x4'))[_0x43e7('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a27bb3b..da4ac6b 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 _0x7d8a=['attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','then','show','params','rawAttributes','length','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','update','destroy','error','stack','name','send','UserProfileSection','model','keys','query','filters','intersection'];(function(_0x4cf8bb,_0x12c8fe){var _0x555be3=function(_0x31c2e8){while(--_0x31c2e8){_0x4cf8bb['push'](_0x4cf8bb['shift']());}};_0x555be3(++_0x12c8fe);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7d8a[_0x1d1779];return _0x2377e9;};'use strict';var pdf=require(_0xa7d8('0x0'));var emlformat=require(_0xa7d8('0x1'));var rimraf=require(_0xa7d8('0x2'));var zipdir=require(_0xa7d8('0x3'));var jsonpatch=require(_0xa7d8('0x4'));var rp=require(_0xa7d8('0x5'));var moment=require(_0xa7d8('0x6'));var BPromise=require(_0xa7d8('0x7'));var Mustache=require(_0xa7d8('0x8'));var util=require(_0xa7d8('0x9'));var path=require(_0xa7d8('0xa'));var sox=require(_0xa7d8('0xb'));var csv=require(_0xa7d8('0xc'));var ejs=require(_0xa7d8('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa7d8('0xe'));var crypto=require(_0xa7d8('0xf'));var jsforce=require(_0xa7d8('0x10'));var deskjs=require(_0xa7d8('0x11'));var toCsv=require(_0xa7d8('0xc'));var querystring=require('querystring');var Papa=require(_0xa7d8('0x12'));var Redis=require('ioredis');var authService=require(_0xa7d8('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa7d8('0x14'));var logger=require('../../config/logger')(_0xa7d8('0x15'));var utils=require(_0xa7d8('0x16'));var config=require('../../config/environment');var db=require(_0xa7d8('0x17'))['db'];function respondWithStatusCode(_0x486f93,_0x3c1d5d){_0x3c1d5d=_0x3c1d5d||0xcc;return function(_0x161829){if(_0x161829){return _0x486f93[_0xa7d8('0x18')](_0x3c1d5d);}return _0x486f93['status'](_0x3c1d5d)[_0xa7d8('0x19')]();};}function respondWithResult(_0x137919,_0x5c8151){_0x5c8151=_0x5c8151||0xc8;return function(_0x5bfb1a){if(_0x5bfb1a){return _0x137919['status'](_0x5c8151)[_0xa7d8('0x1a')](_0x5bfb1a);}};}function respondWithFilteredResult(_0x1121d,_0x4835e9){return function(_0x2d126b){if(_0x2d126b){var _0x3452d0=_0x2d126b[_0xa7d8('0x1b')],_0x2ae530=_0x4835e9[_0xa7d8('0x1c')],_0x2bbaf4=_0x4835e9[_0xa7d8('0x1c')]+_0x4835e9[_0xa7d8('0x1d')],_0x21bc56;if(_0x2bbaf4>=_0x3452d0){_0x2bbaf4=_0x3452d0;_0x21bc56=0xc8;}else{_0x21bc56=0xce;}_0x1121d[_0xa7d8('0x1e')](_0x21bc56);return _0x1121d['set'](_0xa7d8('0x1f'),_0x2ae530+'-'+_0x2bbaf4+'/'+_0x3452d0)[_0xa7d8('0x1a')](_0x2d126b);}return null;};}function patchUpdates(_0x50dd47){return function(_0x7c59b4){try{jsonpatch[_0xa7d8('0x20')](_0x7c59b4,_0x50dd47,!![]);}catch(_0x1236d9){return BPromise[_0xa7d8('0x21')](_0x1236d9);}return _0x7c59b4['save']();};}function saveUpdates(_0x41d587,_0x5ec4d4){return function(_0x33f117){if(_0x33f117){return _0x33f117[_0xa7d8('0x22')](_0x41d587)['then'](function(_0x381fca){return _0x381fca;});}return null;};}function removeEntity(_0x108a6d,_0x34b1ba){return function(_0x426a20){if(_0x426a20){return _0x426a20[_0xa7d8('0x23')]()['then'](function(){_0x108a6d[_0xa7d8('0x1e')](0xcc)[_0xa7d8('0x19')]();});}};}function handleEntityNotFound(_0x5e8acb,_0x2c33f8){return function(_0x31afb8){if(!_0x31afb8){_0x5e8acb['sendStatus'](0x194);}return _0x31afb8;};}function handleError(_0xd09e17,_0x3f02a5){_0x3f02a5=_0x3f02a5||0x1f4;return function(_0xac9707){logger[_0xa7d8('0x24')](_0xac9707[_0xa7d8('0x25')]);if(_0xac9707[_0xa7d8('0x26')]){delete _0xac9707[_0xa7d8('0x26')];}_0xd09e17['status'](_0x3f02a5)[_0xa7d8('0x27')](_0xac9707);};}exports['index']=function(_0x1dcb71,_0x529df7){var _0x53c475={},_0x5d3fef={},_0x491fa0={'count':0x0,'rows':[]};var _0x45b800=db[_0xa7d8('0x28')]['rawAttributes'];_0x5d3fef[_0xa7d8('0x29')]=_[_0xa7d8('0x2a')](_0x45b800);_0x5d3fef[_0xa7d8('0x2b')]=_['keys'](_0x1dcb71[_0xa7d8('0x2b')]);_0x5d3fef[_0xa7d8('0x2c')]=_[_0xa7d8('0x2d')](_0x5d3fef['model'],_0x5d3fef[_0xa7d8('0x2b')]);_0x53c475[_0xa7d8('0x2e')]=_['intersection'](_0x5d3fef['model'],qs[_0xa7d8('0x2f')](_0x1dcb71[_0xa7d8('0x2b')][_0xa7d8('0x2f')]));_0x53c475['attributes']=_0x53c475['attributes']['length']?_0x53c475[_0xa7d8('0x2e')]:_0x5d3fef[_0xa7d8('0x29')];if(!_0x1dcb71['query'][_0xa7d8('0x30')]('nolimit')){_0x53c475[_0xa7d8('0x1d')]=qs['limit'](_0x1dcb71[_0xa7d8('0x2b')][_0xa7d8('0x1d')]);_0x53c475[_0xa7d8('0x1c')]=qs['offset'](_0x1dcb71[_0xa7d8('0x2b')][_0xa7d8('0x1c')]);}_0x53c475[_0xa7d8('0x31')]=qs[_0xa7d8('0x32')](_0x1dcb71[_0xa7d8('0x2b')][_0xa7d8('0x32')]);_0x53c475[_0xa7d8('0x33')]=qs[_0xa7d8('0x2c')](_[_0xa7d8('0x34')](_0x1dcb71[_0xa7d8('0x2b')],_0x5d3fef[_0xa7d8('0x2c')]));if(_0x1dcb71['query'][_0xa7d8('0x35')]){_0x53c475[_0xa7d8('0x33')]=_[_0xa7d8('0x36')](_0x53c475[_0xa7d8('0x33')],{'$or':_[_0xa7d8('0x37')](_0x45b800,function(_0x4bd5bd){if(_0x4bd5bd[_0xa7d8('0x38')][_0xa7d8('0x39')]!==_0xa7d8('0x3a')){var _0x3fcd98={};_0x3fcd98[_0x4bd5bd[_0xa7d8('0x3b')]]={'$like':'%'+_0x1dcb71[_0xa7d8('0x2b')][_0xa7d8('0x35')]+'%'};return _0x3fcd98;}})});}_0x53c475=_[_0xa7d8('0x36')]({},_0x53c475,_0x1dcb71[_0xa7d8('0x3c')]);var _0x168478={'where':_0x53c475[_0xa7d8('0x33')]};return db[_0xa7d8('0x28')]['count'](_0x168478)['then'](function(_0x145e6d){_0x491fa0['count']=_0x145e6d;if(_0x1dcb71[_0xa7d8('0x2b')]['includeAll']){_0x53c475[_0xa7d8('0x3d')]=[{'all':!![]}];}return db[_0xa7d8('0x28')][_0xa7d8('0x3e')](_0x53c475);})[_0xa7d8('0x3f')](function(_0x177164){_0x491fa0['rows']=_0x177164;return _0x491fa0;})[_0xa7d8('0x3f')](respondWithFilteredResult(_0x529df7,_0x53c475))['catch'](handleError(_0x529df7,null));};exports[_0xa7d8('0x40')]=function(_0x53c436,_0x107e80){var _0x2d8699={'raw':![],'where':{'id':_0x53c436[_0xa7d8('0x41')]['id']}},_0x130d2f={};_0x130d2f[_0xa7d8('0x29')]=_[_0xa7d8('0x2a')](db[_0xa7d8('0x28')][_0xa7d8('0x42')]);_0x130d2f[_0xa7d8('0x2b')]=_[_0xa7d8('0x2a')](_0x53c436[_0xa7d8('0x2b')]);_0x130d2f[_0xa7d8('0x2c')]=_[_0xa7d8('0x2d')](_0x130d2f['model'],_0x130d2f['query']);_0x2d8699[_0xa7d8('0x2e')]=_[_0xa7d8('0x2d')](_0x130d2f[_0xa7d8('0x29')],qs[_0xa7d8('0x2f')](_0x53c436[_0xa7d8('0x2b')]['fields']));_0x2d8699[_0xa7d8('0x2e')]=_0x2d8699[_0xa7d8('0x2e')][_0xa7d8('0x43')]?_0x2d8699[_0xa7d8('0x2e')]:_0x130d2f['model'];if(_0x53c436['query']['includeAll']){_0x2d8699[_0xa7d8('0x3d')]=[{'all':!![]}];}_0x2d8699=_['merge']({},_0x2d8699,_0x53c436[_0xa7d8('0x3c')]);return db[_0xa7d8('0x28')][_0xa7d8('0x44')](_0x2d8699)['then'](handleEntityNotFound(_0x107e80,null))['then'](respondWithResult(_0x107e80,null))[_0xa7d8('0x45')](handleError(_0x107e80,null));};exports[_0xa7d8('0x46')]=function(_0x197491,_0x27e40f){return db[_0xa7d8('0x28')][_0xa7d8('0x46')](_0x197491[_0xa7d8('0x47')],{})[_0xa7d8('0x3f')](respondWithResult(_0x27e40f,0xc9))[_0xa7d8('0x45')](handleError(_0x27e40f,null));};exports[_0xa7d8('0x22')]=function(_0x141f47,_0x430297){if(_0x141f47['body']['id']){delete _0x141f47[_0xa7d8('0x47')]['id'];}return db['UserProfileSection'][_0xa7d8('0x44')]({'where':{'id':_0x141f47['params']['id']}})[_0xa7d8('0x3f')](handleEntityNotFound(_0x430297,null))[_0xa7d8('0x3f')](saveUpdates(_0x141f47[_0xa7d8('0x47')],null))[_0xa7d8('0x3f')](respondWithResult(_0x430297,null))[_0xa7d8('0x45')](handleError(_0x430297,null));};exports[_0xa7d8('0x23')]=function(_0x5e1f8d,_0x193e54){return db[_0xa7d8('0x28')]['find']({'where':{'id':_0x5e1f8d['params']['id']}})['then'](handleEntityNotFound(_0x193e54,null))['then'](removeEntity(_0x193e54,null))[_0xa7d8('0x45')](handleError(_0x193e54,null));};exports['describe']=function(_0x3ece59,_0x356289){return db[_0xa7d8('0x28')]['describe']()['then'](respondWithResult(_0x356289,null))['catch'](handleError(_0x356289,null));}; \ No newline at end of file +var _0xdb44=['bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','UserProfileSection','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','key','VIRTUAL','field','include','findAll','rows','params','includeAll','find','catch','body','describe','rimraf','fast-json-patch'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xdb44,0x10e));var _0x4db4=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xdb44[_0x36eaaa];return _0x461349;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4db4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4db4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4db4('0x2'));var Mustache=require(_0x4db4('0x3'));var util=require(_0x4db4('0x4'));var path=require('path');var sox=require(_0x4db4('0x5'));var csv=require(_0x4db4('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4db4('0x7'));var squel=require(_0x4db4('0x8'));var crypto=require('crypto');var jsforce=require(_0x4db4('0x9'));var deskjs=require(_0x4db4('0xa'));var toCsv=require(_0x4db4('0x6'));var querystring=require(_0x4db4('0xb'));var Papa=require(_0x4db4('0xc'));var Redis=require('ioredis');var authService=require(_0x4db4('0xd'));var qs=require(_0x4db4('0xe'));var hardwareService=require(_0x4db4('0xf'));var logger=require(_0x4db4('0x10'))('api');var utils=require(_0x4db4('0x11'));var config=require(_0x4db4('0x12'));var db=require(_0x4db4('0x13'))['db'];function respondWithStatusCode(_0x29fe26,_0x26ee3d){_0x26ee3d=_0x26ee3d||0xcc;return function(_0x1ec359){if(_0x1ec359){return _0x29fe26[_0x4db4('0x14')](_0x26ee3d);}return _0x29fe26[_0x4db4('0x15')](_0x26ee3d)[_0x4db4('0x16')]();};}function respondWithResult(_0x5ec03e,_0x25a3d6){_0x25a3d6=_0x25a3d6||0xc8;return function(_0x9f884d){if(_0x9f884d){return _0x5ec03e[_0x4db4('0x15')](_0x25a3d6)['json'](_0x9f884d);}};}function respondWithFilteredResult(_0x16dc02,_0xe0ef8b){return function(_0x233e22){if(_0x233e22){var _0x167106=_0x233e22[_0x4db4('0x17')],_0x273ef5=_0xe0ef8b[_0x4db4('0x18')],_0x4044ea=_0xe0ef8b[_0x4db4('0x18')]+_0xe0ef8b[_0x4db4('0x19')],_0x3d0f5b;if(_0x4044ea>=_0x167106){_0x4044ea=_0x167106;_0x3d0f5b=0xc8;}else{_0x3d0f5b=0xce;}_0x16dc02['status'](_0x3d0f5b);return _0x16dc02[_0x4db4('0x1a')](_0x4db4('0x1b'),_0x273ef5+'-'+_0x4044ea+'/'+_0x167106)[_0x4db4('0x1c')](_0x233e22);}return null;};}function patchUpdates(_0xf69556){return function(_0x4d59ef){try{jsonpatch[_0x4db4('0x1d')](_0x4d59ef,_0xf69556,!![]);}catch(_0x36db09){return BPromise[_0x4db4('0x1e')](_0x36db09);}return _0x4d59ef[_0x4db4('0x1f')]();};}function saveUpdates(_0x46bad6,_0x2a5f66){return function(_0x4e210e){if(_0x4e210e){return _0x4e210e[_0x4db4('0x20')](_0x46bad6)[_0x4db4('0x21')](function(_0x1d6bd3){return _0x1d6bd3;});}return null;};}function removeEntity(_0x1f350f,_0x572136){return function(_0x451319){if(_0x451319){return _0x451319[_0x4db4('0x22')]()[_0x4db4('0x21')](function(){_0x1f350f[_0x4db4('0x15')](0xcc)[_0x4db4('0x16')]();});}};}function handleEntityNotFound(_0x514802,_0x4b4d04){return function(_0x3c8273){if(!_0x3c8273){_0x514802[_0x4db4('0x14')](0x194);}return _0x3c8273;};}function handleError(_0x33cc22,_0x56e264){_0x56e264=_0x56e264||0x1f4;return function(_0x108e47){logger[_0x4db4('0x23')](_0x108e47[_0x4db4('0x24')]);if(_0x108e47['name']){delete _0x108e47[_0x4db4('0x25')];}_0x33cc22[_0x4db4('0x15')](_0x56e264)[_0x4db4('0x26')](_0x108e47);};}exports['index']=function(_0x375286,_0x57e244){var _0x35cde2={},_0x110dfa={},_0x5eb2af={'count':0x0,'rows':[]};var _0x3d9ab4=db[_0x4db4('0x27')][_0x4db4('0x28')];_0x110dfa[_0x4db4('0x29')]=_[_0x4db4('0x2a')](_0x3d9ab4);_0x110dfa[_0x4db4('0x2b')]=_[_0x4db4('0x2a')](_0x375286[_0x4db4('0x2b')]);_0x110dfa[_0x4db4('0x2c')]=_[_0x4db4('0x2d')](_0x110dfa[_0x4db4('0x29')],_0x110dfa['query']);_0x35cde2['attributes']=_[_0x4db4('0x2d')](_0x110dfa['model'],qs[_0x4db4('0x2e')](_0x375286['query'][_0x4db4('0x2e')]));_0x35cde2['attributes']=_0x35cde2['attributes'][_0x4db4('0x2f')]?_0x35cde2[_0x4db4('0x30')]:_0x110dfa['model'];if(!_0x375286['query'][_0x4db4('0x31')](_0x4db4('0x32'))){_0x35cde2['limit']=qs[_0x4db4('0x19')](_0x375286[_0x4db4('0x2b')][_0x4db4('0x19')]);_0x35cde2[_0x4db4('0x18')]=qs[_0x4db4('0x18')](_0x375286[_0x4db4('0x2b')][_0x4db4('0x18')]);}_0x35cde2['order']=qs[_0x4db4('0x33')](_0x375286[_0x4db4('0x2b')][_0x4db4('0x33')]);_0x35cde2['where']=qs[_0x4db4('0x2c')](_[_0x4db4('0x34')](_0x375286[_0x4db4('0x2b')],_0x110dfa[_0x4db4('0x2c')]));if(_0x375286['query'][_0x4db4('0x35')]){_0x35cde2[_0x4db4('0x36')]=_[_0x4db4('0x37')](_0x35cde2[_0x4db4('0x36')],{'$or':_['map'](_0x3d9ab4,function(_0x82263f){if(_0x82263f['type'][_0x4db4('0x38')]!==_0x4db4('0x39')){var _0x5541b3={};_0x5541b3[_0x82263f[_0x4db4('0x3a')]]={'$like':'%'+_0x375286[_0x4db4('0x2b')][_0x4db4('0x35')]+'%'};return _0x5541b3;}})});}_0x35cde2=_[_0x4db4('0x37')]({},_0x35cde2,_0x375286['options']);var _0x4a9038={'where':_0x35cde2['where']};return db[_0x4db4('0x27')][_0x4db4('0x17')](_0x4a9038)['then'](function(_0x1c15dc){_0x5eb2af[_0x4db4('0x17')]=_0x1c15dc;if(_0x375286[_0x4db4('0x2b')]['includeAll']){_0x35cde2[_0x4db4('0x3b')]=[{'all':!![]}];}return db[_0x4db4('0x27')][_0x4db4('0x3c')](_0x35cde2);})[_0x4db4('0x21')](function(_0x45aeff){_0x5eb2af[_0x4db4('0x3d')]=_0x45aeff;return _0x5eb2af;})[_0x4db4('0x21')](respondWithFilteredResult(_0x57e244,_0x35cde2))['catch'](handleError(_0x57e244,null));};exports['show']=function(_0x1d2655,_0x4dd167){var _0x5d5c7d={'raw':![],'where':{'id':_0x1d2655[_0x4db4('0x3e')]['id']}},_0x45f735={};_0x45f735[_0x4db4('0x29')]=_[_0x4db4('0x2a')](db[_0x4db4('0x27')][_0x4db4('0x28')]);_0x45f735[_0x4db4('0x2b')]=_['keys'](_0x1d2655['query']);_0x45f735[_0x4db4('0x2c')]=_[_0x4db4('0x2d')](_0x45f735[_0x4db4('0x29')],_0x45f735[_0x4db4('0x2b')]);_0x5d5c7d[_0x4db4('0x30')]=_[_0x4db4('0x2d')](_0x45f735['model'],qs[_0x4db4('0x2e')](_0x1d2655[_0x4db4('0x2b')][_0x4db4('0x2e')]));_0x5d5c7d[_0x4db4('0x30')]=_0x5d5c7d['attributes'][_0x4db4('0x2f')]?_0x5d5c7d[_0x4db4('0x30')]:_0x45f735[_0x4db4('0x29')];if(_0x1d2655[_0x4db4('0x2b')][_0x4db4('0x3f')]){_0x5d5c7d[_0x4db4('0x3b')]=[{'all':!![]}];}_0x5d5c7d=_[_0x4db4('0x37')]({},_0x5d5c7d,_0x1d2655['options']);return db[_0x4db4('0x27')][_0x4db4('0x40')](_0x5d5c7d)[_0x4db4('0x21')](handleEntityNotFound(_0x4dd167,null))[_0x4db4('0x21')](respondWithResult(_0x4dd167,null))[_0x4db4('0x41')](handleError(_0x4dd167,null));};exports['create']=function(_0x2811c3,_0x4e8b9d){return db[_0x4db4('0x27')]['create'](_0x2811c3[_0x4db4('0x42')],{})[_0x4db4('0x21')](respondWithResult(_0x4e8b9d,0xc9))['catch'](handleError(_0x4e8b9d,null));};exports[_0x4db4('0x20')]=function(_0xcd04da,_0x18e253){if(_0xcd04da[_0x4db4('0x42')]['id']){delete _0xcd04da[_0x4db4('0x42')]['id'];}return db[_0x4db4('0x27')][_0x4db4('0x40')]({'where':{'id':_0xcd04da[_0x4db4('0x3e')]['id']}})[_0x4db4('0x21')](handleEntityNotFound(_0x18e253,null))[_0x4db4('0x21')](saveUpdates(_0xcd04da[_0x4db4('0x42')],null))[_0x4db4('0x21')](respondWithResult(_0x18e253,null))['catch'](handleError(_0x18e253,null));};exports[_0x4db4('0x22')]=function(_0x3c94da,_0x101b3a){return db[_0x4db4('0x27')][_0x4db4('0x40')]({'where':{'id':_0x3c94da[_0x4db4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x101b3a,null))[_0x4db4('0x21')](removeEntity(_0x101b3a,null))[_0x4db4('0x41')](handleError(_0x101b3a,null));};exports[_0x4db4('0x43')]=function(_0x12cadc,_0x1e8aba){return db['UserProfileSection'][_0x4db4('0x43')]()[_0x4db4('0x21')](respondWithResult(_0x1e8aba,null))[_0x4db4('0x41')](handleError(_0x1e8aba,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 9d3ff46..2bebd9d 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 _0x34d8=['path','rimraf','../../config/environment','./userProfileSection.attributes','define','user_profile_has_sections','sectionId','lodash','util','../../config/logger','request-promise'];(function(_0x408719,_0x44c832){var _0x56fa67=function(_0x531690){while(--_0x531690){_0x408719['push'](_0x408719['shift']());}};_0x56fa67(++_0x44c832);}(_0x34d8,0x167));var _0x834d=function(_0x8b8d3,_0x29d29f){_0x8b8d3=_0x8b8d3-0x0;var _0x132ec5=_0x34d8[_0x8b8d3];return _0x132ec5;};'use strict';var _=require(_0x834d('0x0'));var util=require(_0x834d('0x1'));var logger=require(_0x834d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x834d('0x3'));var fs=require('fs');var path=require(_0x834d('0x4'));var rimraf=require(_0x834d('0x5'));var config=require(_0x834d('0x6'));var attributes=require(_0x834d('0x7'));module['exports']=function(_0x1ca2d7,_0x13b441){return _0x1ca2d7[_0x834d('0x8')]('UserProfileSection',attributes,{'tableName':_0x834d('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x834d('0xa'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x61e6=['userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId'];(function(_0x191b35,_0x1f3287){var _0x54d18f=function(_0x253fcb){while(--_0x253fcb){_0x191b35['push'](_0x191b35['shift']());}};_0x54d18f(++_0x1f3287);}(_0x61e6,0x9a));var _0x661e=function(_0x3a1bab,_0x550951){_0x3a1bab=_0x3a1bab-0x0;var _0x1ceeb5=_0x61e6[_0x3a1bab];return _0x1ceeb5;};'use strict';var _=require(_0x661e('0x0'));var util=require(_0x661e('0x1'));var logger=require(_0x661e('0x2'))('api');var moment=require(_0x661e('0x3'));var BPromise=require(_0x661e('0x4'));var rp=require(_0x661e('0x5'));var fs=require('fs');var path=require(_0x661e('0x6'));var rimraf=require(_0x661e('0x7'));var config=require(_0x661e('0x8'));var attributes=require(_0x661e('0x9'));module[_0x661e('0xa')]=function(_0x185cad,_0x381403){return _0x185cad[_0x661e('0xb')](_0x661e('0xc'),attributes,{'tableName':_0x661e('0xd'),'paranoid':![],'indexes':[{'name':_0x661e('0xe'),'fields':[_0x661e('0xf'),_0x661e('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 6ccdb9e..9fb55ba 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 _0xd08c=['rpc','../../config/environment','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0xd08c,0x13b));var _0xcd08=function(_0x4c488c,_0x1ea1ae){_0x4c488c=_0x4c488c-0x0;var _0x3af05e=_0xd08c[_0x4c488c];return _0x3af05e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcd08('0x0'));var BPromise=require('bluebird');var rs=require(_0xcd08('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd08('0x2'))['db'];var utils=require(_0xcd08('0x3'));var logger=require(_0xcd08('0x4'))(_0xcd08('0x5'));var config=require(_0xcd08('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcd08('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x381b51,_0x2a9158,_0x2cc3c5){return new BPromise(function(_0x126e77,_0x1e4829){return client['request'](_0x381b51,_0x2cc3c5)[_0xcd08('0x8')](function(_0x4e4d67){logger[_0xcd08('0x9')](_0xcd08('0xa'),_0x2a9158,'request\x20sent');logger[_0xcd08('0xb')](_0xcd08('0xc'),_0x2a9158,_0xcd08('0xd'),JSON[_0xcd08('0xe')](_0x4e4d67));if(_0x4e4d67[_0xcd08('0xf')]){if(_0x4e4d67['error'][_0xcd08('0x10')]===0x1f4){logger[_0xcd08('0xf')](_0xcd08('0xa'),_0x2a9158,_0x4e4d67[_0xcd08('0xf')]['message']);return _0x1e4829(_0x4e4d67[_0xcd08('0xf')][_0xcd08('0x11')]);}logger[_0xcd08('0xf')](_0xcd08('0xa'),_0x2a9158,_0x4e4d67[_0xcd08('0xf')][_0xcd08('0x11')]);return _0x126e77(_0x4e4d67[_0xcd08('0xf')]['message']);}else{logger[_0xcd08('0x9')](_0xcd08('0xa'),_0x2a9158,'request\x20sent');_0x126e77(_0x4e4d67[_0xcd08('0x12')][_0xcd08('0x11')]);}})[_0xcd08('0x13')](function(_0x3f7eaa){logger['error'](_0xcd08('0xa'),_0x2a9158,_0x3f7eaa);_0x1e4829(_0x3f7eaa);});});} \ No newline at end of file +var _0x779d=['client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x779d,0x16c));var _0xd779=function(_0xf6bf57,_0x1170ad){_0xf6bf57=_0xf6bf57-0x0;var _0x3e473e=_0x779d[_0xf6bf57];return _0x3e473e;};'use strict';var _=require(_0xd779('0x0'));var util=require(_0xd779('0x1'));var moment=require('moment');var BPromise=require(_0xd779('0x2'));var rs=require(_0xd779('0x3'));var fs=require('fs');var Redis=require(_0xd779('0x4'));var db=require(_0xd779('0x5'))['db'];var utils=require(_0xd779('0x6'));var logger=require(_0xd779('0x7'))(_0xd779('0x8'));var config=require(_0xd779('0x9'));var jayson=require(_0xd779('0xa'));var client=jayson[_0xd779('0xb')][_0xd779('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22e5c2,_0x20cf96,_0x4ed109){return new BPromise(function(_0x7d17af,_0x158b17){return client[_0xd779('0xd')](_0x22e5c2,_0x4ed109)[_0xd779('0xe')](function(_0x43b945){logger[_0xd779('0xf')](_0xd779('0x10'),_0x20cf96,_0xd779('0x11'));logger[_0xd779('0x12')](_0xd779('0x13'),_0x20cf96,_0xd779('0x11'),JSON[_0xd779('0x14')](_0x43b945));if(_0x43b945[_0xd779('0x15')]){if(_0x43b945[_0xd779('0x15')][_0xd779('0x16')]===0x1f4){logger['error'](_0xd779('0x10'),_0x20cf96,_0x43b945[_0xd779('0x15')][_0xd779('0x17')]);return _0x158b17(_0x43b945[_0xd779('0x15')][_0xd779('0x17')]);}logger[_0xd779('0x15')](_0xd779('0x10'),_0x20cf96,_0x43b945[_0xd779('0x15')][_0xd779('0x17')]);return _0x7d17af(_0x43b945[_0xd779('0x15')][_0xd779('0x17')]);}else{logger[_0xd779('0xf')](_0xd779('0x10'),_0x20cf96,_0xd779('0x11'));_0x7d17af(_0x43b945[_0xd779('0x18')][_0xd779('0x17')]);}})['catch'](function(_0x5cf45b){logger['error'](_0xd779('0x10'),_0x20cf96,_0x5cf45b);_0x158b17(_0x5cf45b);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index deea080..9b448a6 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 _0x7278=['../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x18e55e,_0x4818f8){var _0x388553=function(_0x16eea0){while(--_0x16eea0){_0x18e55e['push'](_0x18e55e['shift']());}};_0x388553(++_0x4818f8);}(_0x7278,0x161));var _0x8727=function(_0x42b748,_0x2242fd){_0x42b748=_0x42b748-0x0;var _0x36671a=_0x7278[_0x42b748];return _0x36671a;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var auth=require(_0x8727('0x5'));var interaction=require(_0x8727('0x6'));var config=require(_0x8727('0x7'));module[_0x8727('0x8')]=router; \ No newline at end of file +var _0xdbf5=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','express','Router'];(function(_0x4fef15,_0x52a623){var _0x5f1984=function(_0x31da77){while(--_0x31da77){_0x4fef15['push'](_0x4fef15['shift']());}};_0x5f1984(++_0x52a623);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x16751d,_0x2e04c7){_0x16751d=_0x16751d-0x0;var _0x5f3776=_0xdbf5[_0x16751d];return _0x5f3776;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));module[_0x5dbf('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ba507d5..4860416 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 _0x4230=['INTEGER'];(function(_0x51f620,_0x4609e7){var _0x3b73c2=function(_0xdfb5a4){while(--_0xdfb5a4){_0x51f620['push'](_0x51f620['shift']());}};_0x3b73c2(++_0x4609e7);}(_0x4230,0xda));var _0x0423=function(_0x4ed257,_0x1f5c4c){_0x4ed257=_0x4ed257-0x0;var _0x3fbe35=_0x4230[_0x4ed257];return _0x3fbe35;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x0423('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2719=['INTEGER','sequelize','exports'];(function(_0x4915af,_0x1071cc){var _0x4581fe=function(_0x519b57){while(--_0x519b57){_0x4915af['push'](_0x4915af['shift']());}};_0x4581fe(++_0x1071cc);}(_0x2719,0xfa));var _0x9271=function(_0x553a8e,_0x22f669){_0x553a8e=_0x553a8e-0x0;var _0x378498=_0x2719[_0x553a8e];return _0x378498;};'use strict';var Sequelize=require(_0x9271('0x0'));module[_0x9271('0x1')]={'penalty':{'type':Sequelize[_0x9271('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 b45997d..debac61 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 _0x323f=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x444126,_0x5213a3){var _0x38024e=function(_0x14da8b){while(--_0x14da8b){_0x444126['push'](_0x444126['shift']());}};_0x38024e(++_0x5213a3);}(_0x323f,0x1ee));var _0xf323=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x323f[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));module[_0xf323('0x9')]=function(_0x371707,_0x5d7d60){return _0x371707[_0xf323('0xa')](_0xf323('0xb'),attributes,{'tableName':_0xf323('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb93=['./userSmsQueue.attributes','exports','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x553113,_0x3fc055){var _0x15ce31=function(_0x18a6f3){while(--_0x18a6f3){_0x553113['push'](_0x553113['shift']());}};_0x15ce31(++_0x3fc055);}(_0xfb93,0x111));var _0x3fb9=function(_0x35a49d,_0x36c478){_0x35a49d=_0x35a49d-0x0;var _0x589665=_0xfb93[_0x35a49d];return _0x589665;};'use strict';var _=require(_0x3fb9('0x0'));var util=require(_0x3fb9('0x1'));var logger=require(_0x3fb9('0x2'))(_0x3fb9('0x3'));var moment=require('moment');var BPromise=require(_0x3fb9('0x4'));var rp=require(_0x3fb9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fb9('0x6'));module[_0x3fb9('0x7')]=function(_0x498b6b,_0x118c1f){return _0x498b6b['define']('UserSmsQueue',attributes,{'tableName':_0x3fb9('0x8'),'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 5da7597..ee895d1 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 _0xa1cb=['UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0xa1cb,0x8d));var _0xba1c=function(_0x7194de,_0x45376e){_0x7194de=_0x7194de-0x0;var _0x4d30f9=_0xa1cb[_0x7194de];return _0x4d30f9;};'use strict';var _=require(_0xba1c('0x0'));var util=require(_0xba1c('0x1'));var moment=require(_0xba1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xba1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba1c('0x4'))['db'];var utils=require(_0xba1c('0x5'));var logger=require('../../config/logger')(_0xba1c('0x6'));var config=require(_0xba1c('0x7'));var jayson=require(_0xba1c('0x8'));var client=jayson[_0xba1c('0x9')][_0xba1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cc4c7,_0x42a899,_0x21881b){return new BPromise(function(_0x2578d9,_0x35b048){return client[_0xba1c('0xb')](_0x1cc4c7,_0x21881b)[_0xba1c('0xc')](function(_0x44a3b6){logger[_0xba1c('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x42a899,_0xba1c('0xe'));logger[_0xba1c('0xf')](_0xba1c('0x10'),_0x42a899,_0xba1c('0xe'),JSON[_0xba1c('0x11')](_0x44a3b6));if(_0x44a3b6['error']){if(_0x44a3b6[_0xba1c('0x12')][_0xba1c('0x13')]===0x1f4){logger[_0xba1c('0x12')](_0xba1c('0x14'),_0x42a899,_0x44a3b6[_0xba1c('0x12')]['message']);return _0x35b048(_0x44a3b6[_0xba1c('0x12')]['message']);}logger[_0xba1c('0x12')](_0xba1c('0x14'),_0x42a899,_0x44a3b6['error']['message']);return _0x2578d9(_0x44a3b6[_0xba1c('0x12')][_0xba1c('0x15')]);}else{logger[_0xba1c('0xd')](_0xba1c('0x14'),_0x42a899,'request\x20sent');_0x2578d9(_0x44a3b6['result'][_0xba1c('0x15')]);}})[_0xba1c('0x16')](function(_0x19add8){logger['error'](_0xba1c('0x14'),_0x42a899,_0x19add8);_0x35b048(_0x19add8);});});} \ No newline at end of file +var _0x2bc1=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x44b834,_0x39ee90){var _0x3e68d1=function(_0x2f46ce){while(--_0x2f46ce){_0x44b834['push'](_0x44b834['shift']());}};_0x3e68d1(++_0x39ee90);}(_0x2bc1,0x1a3));var _0x12bc=function(_0x51d05a,_0xc72106){_0x51d05a=_0x51d05a-0x0;var _0x1b1549=_0x2bc1[_0x51d05a];return _0x1b1549;};'use strict';var _=require(_0x12bc('0x0'));var util=require(_0x12bc('0x1'));var moment=require(_0x12bc('0x2'));var BPromise=require(_0x12bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x12bc('0x5'));var logger=require('../../config/logger')(_0x12bc('0x6'));var config=require('../../config/environment');var jayson=require(_0x12bc('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3720,_0x5f35c2,_0x308965){return new BPromise(function(_0x53a3cf,_0x124e45){return client['request'](_0x4a3720,_0x308965)[_0x12bc('0x8')](function(_0x4f387f){logger[_0x12bc('0x9')](_0x12bc('0xa'),_0x5f35c2,_0x12bc('0xb'));logger['debug'](_0x12bc('0xc'),_0x5f35c2,_0x12bc('0xb'),JSON['stringify'](_0x4f387f));if(_0x4f387f[_0x12bc('0xd')]){if(_0x4f387f[_0x12bc('0xd')][_0x12bc('0xe')]===0x1f4){logger[_0x12bc('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x5f35c2,_0x4f387f['error'][_0x12bc('0xf')]);return _0x124e45(_0x4f387f[_0x12bc('0xd')][_0x12bc('0xf')]);}logger[_0x12bc('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x5f35c2,_0x4f387f[_0x12bc('0xd')][_0x12bc('0xf')]);return _0x53a3cf(_0x4f387f[_0x12bc('0xd')][_0x12bc('0xf')]);}else{logger[_0x12bc('0x9')](_0x12bc('0xa'),_0x5f35c2,'request\x20sent');_0x53a3cf(_0x4f387f[_0x12bc('0x10')][_0x12bc('0xf')]);}})[_0x12bc('0x11')](function(_0x56f03f){logger[_0x12bc('0xd')](_0x12bc('0xa'),_0x5f35c2,_0x56f03f);_0x124e45(_0x56f03f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index c3df06e..ae4756e 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 _0x6dc0=['path','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x5014ab,_0x33d328){var _0x150f46=function(_0x50aee4){while(--_0x50aee4){_0x5014ab['push'](_0x5014ab['shift']());}};_0x150f46(++_0x33d328);}(_0x6dc0,0xb6));var _0x06dc=function(_0x170add,_0x206e45){_0x170add=_0x170add-0x0;var _0x1249f1=_0x6dc0[_0x170add];return _0x1249f1;};'use strict';var multer=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var path=require(_0x06dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x06dc('0x3'));var router=express[_0x06dc('0x4')]();var auth=require(_0x06dc('0x5'));var interaction=require(_0x06dc('0x6'));var config=require('../../config/environment');module[_0x06dc('0x7')]=router; \ No newline at end of file +var _0x1c3b=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x41ba26,_0x563658){var _0x45ef28=function(_0x167a9b){while(--_0x167a9b){_0x41ba26['push'](_0x41ba26['shift']());}};_0x45ef28(++_0x563658);}(_0x1c3b,0xab));var _0xb1c3=function(_0xe5ceb8,_0x7a48ad){_0xe5ceb8=_0xe5ceb8-0x0;var _0x1b5b97=_0x1c3b[_0xe5ceb8];return _0x1b5b97;};'use strict';var multer=require(_0xb1c3('0x0'));var util=require(_0xb1c3('0x1'));var path=require(_0xb1c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1c3('0x3')]();var auth=require(_0xb1c3('0x4'));var interaction=require(_0xb1c3('0x5'));var config=require(_0xb1c3('0x6'));module[_0xb1c3('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 d0aeb5d..02d82c6 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 _0x8610=['sequelize','exports','INTEGER'];(function(_0x579c8d,_0x1cedb4){var _0x1b121f=function(_0x51ed64){while(--_0x51ed64){_0x579c8d['push'](_0x579c8d['shift']());}};_0x1b121f(++_0x1cedb4);}(_0x8610,0x123));var _0x0861=function(_0x882416,_0xab4bc){_0x882416=_0x882416-0x0;var _0x4d5211=_0x8610[_0x882416];return _0x4d5211;};'use strict';var Sequelize=require(_0x0861('0x0'));module[_0x0861('0x1')]={'penalty':{'type':Sequelize[_0x0861('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x71fd=['exports','INTEGER','sequelize'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0x71fd,0xc2));var _0xd71f=function(_0x361933,_0x22b5b7){_0x361933=_0x361933-0x0;var _0x1d1b30=_0x71fd[_0x361933];return _0x1d1b30;};'use strict';var Sequelize=require(_0xd71f('0x0'));module[_0xd71f('0x1')]={'penalty':{'type':Sequelize[_0xd71f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 874f60d..ac72687 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 _0xad1d=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0xa12849,_0x4c938d){var _0x58c237=function(_0x513b72){while(--_0x513b72){_0xa12849['push'](_0xa12849['shift']());}};_0x58c237(++_0x4c938d);}(_0xad1d,0x132));var _0xdad1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xad1d[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xdad1('0x0'));var util=require(_0xdad1('0x1'));var logger=require(_0xdad1('0x2'))(_0xdad1('0x3'));var moment=require('moment');var BPromise=require(_0xdad1('0x4'));var rp=require(_0xdad1('0x5'));var fs=require('fs');var path=require(_0xdad1('0x6'));var rimraf=require('rimraf');var config=require(_0xdad1('0x7'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0xca2f82,_0x496c33){return _0xca2f82[_0xdad1('0x8')](_0xdad1('0x9'),attributes,{'tableName':_0xdad1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x855f=['define','user_has_voice_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','./userVoiceQueue.attributes'];(function(_0x5797f7,_0x44d71c){var _0x1bc507=function(_0x5e218e){while(--_0x5e218e){_0x5797f7['push'](_0x5797f7['shift']());}};_0x1bc507(++_0x44d71c);}(_0x855f,0xfc));var _0xf855=function(_0x43f5b4,_0x536b30){_0x43f5b4=_0x43f5b4-0x0;var _0x3c0480=_0x855f[_0x43f5b4];return _0x3c0480;};'use strict';var _=require('lodash');var util=require(_0xf855('0x0'));var logger=require(_0xf855('0x1'))(_0xf855('0x2'));var moment=require(_0xf855('0x3'));var BPromise=require('bluebird');var rp=require(_0xf855('0x4'));var fs=require('fs');var path=require(_0xf855('0x5'));var rimraf=require(_0xf855('0x6'));var config=require('../../config/environment');var attributes=require(_0xf855('0x7'));module['exports']=function(_0x1666ff,_0x38dd10){return _0x1666ff[_0xf855('0x8')]('UserVoiceQueue',attributes,{'tableName':_0xf855('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 3259067..1cdf568 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 _0x7f56=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UserVoiceQueue,\x20%s,\x20%s','catch','util'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x7f56,0x99));var _0x67f5=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0x7f56[_0x113a6c];return _0x1ac632;};'use strict';var _=require('lodash');var util=require(_0x67f5('0x0'));var moment=require(_0x67f5('0x1'));var BPromise=require('bluebird');var rs=require(_0x67f5('0x2'));var fs=require('fs');var Redis=require(_0x67f5('0x3'));var db=require(_0x67f5('0x4'))['db'];var utils=require(_0x67f5('0x5'));var logger=require('../../config/logger')(_0x67f5('0x6'));var config=require(_0x67f5('0x7'));var jayson=require(_0x67f5('0x8'));var client=jayson[_0x67f5('0x9')][_0x67f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3259e5,_0x479143,_0x3ac2fd){return new BPromise(function(_0x1de55b,_0x489a41){return client['request'](_0x3259e5,_0x3ac2fd)[_0x67f5('0xb')](function(_0x236bfa){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x479143,_0x67f5('0xc'));logger[_0x67f5('0xd')](_0x67f5('0xe'),_0x479143,_0x67f5('0xc'),JSON[_0x67f5('0xf')](_0x236bfa));if(_0x236bfa[_0x67f5('0x10')]){if(_0x236bfa['error'][_0x67f5('0x11')]===0x1f4){logger[_0x67f5('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x479143,_0x236bfa['error'][_0x67f5('0x12')]);return _0x489a41(_0x236bfa['error'][_0x67f5('0x12')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x479143,_0x236bfa['error'][_0x67f5('0x12')]);return _0x1de55b(_0x236bfa[_0x67f5('0x10')][_0x67f5('0x12')]);}else{logger[_0x67f5('0x13')](_0x67f5('0x14'),_0x479143,_0x67f5('0xc'));_0x1de55b(_0x236bfa['result']['message']);}})[_0x67f5('0x15')](function(_0x42fa53){logger['error'](_0x67f5('0x14'),_0x479143,_0x42fa53);_0x489a41(_0x42fa53);});});} \ No newline at end of file +var _0xb0be=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x44dfd5,_0x53c433){var _0x35b7e3=function(_0x444ea5){while(--_0x444ea5){_0x44dfd5['push'](_0x44dfd5['shift']());}};_0x35b7e3(++_0x53c433);}(_0xb0be,0xdc));var _0xeb0b=function(_0x4106bd,_0x2ca0b0){_0x4106bd=_0x4106bd-0x0;var _0x13757f=_0xb0be[_0x4106bd];return _0x13757f;};'use strict';var _=require(_0xeb0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeb0b('0x1'));var rs=require(_0xeb0b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb0b('0x3'))['db'];var utils=require(_0xeb0b('0x4'));var logger=require('../../config/logger')(_0xeb0b('0x5'));var config=require('../../config/environment');var jayson=require(_0xeb0b('0x6'));var client=jayson[_0xeb0b('0x7')][_0xeb0b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ca7e6,_0x4c0625,_0x3592bc){return new BPromise(function(_0x15df49,_0x2dd3e7){return client[_0xeb0b('0x9')](_0x5ca7e6,_0x3592bc)[_0xeb0b('0xa')](function(_0x5e2ebf){logger[_0xeb0b('0xb')](_0xeb0b('0xc'),_0x4c0625,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4c0625,_0xeb0b('0xd'),JSON[_0xeb0b('0xe')](_0x5e2ebf));if(_0x5e2ebf['error']){if(_0x5e2ebf[_0xeb0b('0xf')][_0xeb0b('0x10')]===0x1f4){logger['error'](_0xeb0b('0xc'),_0x4c0625,_0x5e2ebf[_0xeb0b('0xf')][_0xeb0b('0x11')]);return _0x2dd3e7(_0x5e2ebf[_0xeb0b('0xf')]['message']);}logger[_0xeb0b('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4c0625,_0x5e2ebf[_0xeb0b('0xf')][_0xeb0b('0x11')]);return _0x15df49(_0x5e2ebf[_0xeb0b('0xf')]['message']);}else{logger[_0xeb0b('0xb')](_0xeb0b('0xc'),_0x4c0625,_0xeb0b('0xd'));_0x15df49(_0x5e2ebf['result'][_0xeb0b('0x11')]);}})[_0xeb0b('0x12')](function(_0x5a7a95){logger[_0xeb0b('0xf')](_0xeb0b('0xc'),_0x4c0625,_0x5a7a95);_0x2dd3e7(_0x5a7a95);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index d56ade4..338f924 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 _0xed54=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1136e8,_0x1bc9cf){var _0x4afbe4=function(_0x77f25c){while(--_0x77f25c){_0x1136e8['push'](_0x1136e8['shift']());}};_0x4afbe4(++_0x1bc9cf);}(_0xed54,0xfc));var _0x4ed5=function(_0x1ad1b9,_0x4a851f){_0x1ad1b9=_0x1ad1b9-0x0;var _0x54fd0d=_0xed54[_0x1ad1b9];return _0x54fd0d;};'use strict';var multer=require('multer');var util=require(_0x4ed5('0x0'));var path=require(_0x4ed5('0x1'));var timeout=require(_0x4ed5('0x2'));var express=require(_0x4ed5('0x3'));var router=express['Router']();var auth=require(_0x4ed5('0x4'));var interaction=require(_0x4ed5('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x0a1c=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','exports'];(function(_0x1d06ae,_0x1c19f9){var _0x10d5f2=function(_0x486fc7){while(--_0x486fc7){_0x1d06ae['push'](_0x1d06ae['shift']());}};_0x10d5f2(++_0x1c19f9);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x0a1c[_0x5a7e3c];return _0x59252b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc0a1('0x0'));var timeout=require(_0xc0a1('0x1'));var express=require(_0xc0a1('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc0a1('0x3'));var config=require(_0xc0a1('0x4'));module[_0xc0a1('0x5')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e0b58c5..313370c 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 _0x34ef=['INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x764d2,_0x1f887d){var _0x55a4a0=function(_0x47316b){while(--_0x47316b){_0x764d2['push'](_0x764d2['shift']());}};_0x55a4a0(++_0x1f887d);}(_0x34ef,0x7c));var _0xf34e=function(_0x13fd52,_0x246fff){_0x13fd52=_0x13fd52-0x0;var _0x3899e9=_0x34ef[_0x13fd52];return _0x3899e9;};'use strict';var Sequelize=require(_0xf34e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf34e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xf34e('0x2')],'allowNull':![],'comment':_0xf34e('0x3')},'UserId':{'type':Sequelize[_0xf34e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf34e('0x2')],'allowNull':![],'unique':_0xf34e('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xf34e('0x2')],'allowNull':![],'unique':_0xf34e('0x4'),'comment':_0xf34e('0x3')},'penalty':{'type':Sequelize[_0xf34e('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xf34e('0x1')](0xb),'defaultValue':0x0,'comment':_0xf34e('0x3')}}; \ No newline at end of file +var _0x3283=['STRING','INTEGER','exports','Required\x20by\x20Asterisk'];(function(_0x3acf88,_0x3d0323){var _0x209e37=function(_0x5ef9bd){while(--_0x5ef9bd){_0x3acf88['push'](_0x3acf88['shift']());}};_0x209e37(++_0x3d0323);}(_0x3283,0xba));var _0x3328=function(_0x4fd4c7,_0x32cb3c){_0x4fd4c7=_0x4fd4c7-0x0;var _0x560ec0=_0x3283[_0x4fd4c7];return _0x560ec0;};'use strict';var Sequelize=require('sequelize');module[_0x3328('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3328('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x3328('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3328('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x3328('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x3328('0x3')](0xb),'defaultValue':0x0,'comment':_0x3328('0x1')},'paused':{'type':Sequelize[_0x3328('0x3')](0xb),'defaultValue':0x0,'comment':_0x3328('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ee9bdb0..06fbda0 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 _0x36ee=['UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xe36e('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe36e('0x1'),'afterUpdate':_0xe36e('0x2'),'afterDestroy':_0xe36e('0x3')};function emitEvent(_0xe3bee0){return function(_0x567a84,_0x1118af,_0x29e692){UserVoiceQueueRtEvents[_0xe36e('0x4')](_0xe3bee0+':'+_0x567a84['id'],_0x567a84);UserVoiceQueueRtEvents[_0xe36e('0x4')](_0xe3bee0,_0x567a84);_0x29e692(null);};}for(var e in events){if(events[_0xe36e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xe36e('0x6')](e,emitEvent(event));}}module[_0xe36e('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd7d1=['update','remove','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x144e22,_0x41beda){_0x144e22=_0x144e22-0x0;var _0x1458d3=_0xd7d1[_0x144e22];return _0x1458d3;};'use strict';var EventEmitter=require(_0x1d7d('0x0'));var UserVoiceQueueRt=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x1d7d('0x3')](0x0);var events={'afterCreate':_0x1d7d('0x4'),'afterUpdate':_0x1d7d('0x5'),'afterDestroy':_0x1d7d('0x6')};function emitEvent(_0x27b5d8){return function(_0x1ac097,_0x1adb6b,_0x3c0839){UserVoiceQueueRtEvents[_0x1d7d('0x7')](_0x27b5d8+':'+_0x1ac097['id'],_0x1ac097);UserVoiceQueueRtEvents[_0x1d7d('0x7')](_0x27b5d8,_0x1ac097);_0x3c0839(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x1d7d('0x8')](e,emitEvent(event));}}module[_0x1d7d('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 8aa13bc..6295acc 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 _0x91c6=['api','moment','../../config/environment','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x3579ed,_0x4f153f){var _0x2a6abe=function(_0x4b5d78){while(--_0x4b5d78){_0x3579ed['push'](_0x3579ed['shift']());}};_0x2a6abe(++_0x4f153f);}(_0x91c6,0x1da));var _0x691c=function(_0x55e3a2,_0x3b0585){_0x55e3a2=_0x55e3a2-0x0;var _0x360cd6=_0x91c6[_0x55e3a2];return _0x360cd6;};'use strict';var _=require(_0x691c('0x0'));var util=require(_0x691c('0x1'));var logger=require(_0x691c('0x2'))(_0x691c('0x3'));var moment=require(_0x691c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x691c('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x691c('0x6')]=function(_0x137cdd,_0x8b64df){return _0x137cdd['define'](_0x691c('0x7'),attributes,{'tableName':_0x691c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8f3=['../../config/logger','moment','bluebird','request-promise','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x2b82e3,_0x3db02f){var _0x1f2f3b=function(_0x536be4){while(--_0x536be4){_0x2b82e3['push'](_0x2b82e3['shift']());}};_0x1f2f3b(++_0x3db02f);}(_0xb8f3,0x196));var _0x3b8f=function(_0x4ec119,_0x5e20f7){_0x4ec119=_0x4ec119-0x0;var _0x1f45a9=_0xb8f3[_0x4ec119];return _0x1f45a9;};'use strict';var _=require(_0x3b8f('0x0'));var util=require('util');var logger=require(_0x3b8f('0x1'))('api');var moment=require(_0x3b8f('0x2'));var BPromise=require(_0x3b8f('0x3'));var rp=require(_0x3b8f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b8f('0x5'));var config=require('../../config/environment');var attributes=require(_0x3b8f('0x6'));module[_0x3b8f('0x7')]=function(_0x2d2ee7,_0x14b20f){return _0x2d2ee7[_0x3b8f('0x8')](_0x3b8f('0x9'),attributes,{'tableName':_0x3b8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 3c1a035..6397362 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 _0x3c24=['info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./userVoiceQueueRt.socket','register','then'];(function(_0xb0e169,_0x4da4f2){var _0x463537=function(_0xfd3e89){while(--_0xfd3e89){_0xb0e169['push'](_0xb0e169['shift']());}};_0x463537(++_0x4da4f2);}(_0x3c24,0x17c));var _0x43c2=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x3c24[_0x30b0d8];return _0x459c09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43c2('0x0'));var BPromise=require(_0x43c2('0x1'));var rs=require(_0x43c2('0x2'));var fs=require('fs');var Redis=require(_0x43c2('0x3'));var db=require(_0x43c2('0x4'))['db'];var utils=require(_0x43c2('0x5'));var logger=require(_0x43c2('0x6'))(_0x43c2('0x7'));var config=require(_0x43c2('0x8'));var jayson=require(_0x43c2('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x43c2('0xa')]=_[_0x43c2('0xb')](config[_0x43c2('0xa')],{'host':_0x43c2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43c2('0xa')]));require(_0x43c2('0xd'))[_0x43c2('0xe')](socket);function respondWithRpcPromise(_0x222bfa,_0x322ed1,_0x16302b){return new BPromise(function(_0x22e2c8,_0x27a151){return client['request'](_0x222bfa,_0x16302b)[_0x43c2('0xf')](function(_0x601448){logger[_0x43c2('0x10')](_0x43c2('0x11'),_0x322ed1,'request\x20sent');logger[_0x43c2('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x322ed1,_0x43c2('0x13'),JSON[_0x43c2('0x14')](_0x601448));if(_0x601448['error']){if(_0x601448[_0x43c2('0x15')][_0x43c2('0x16')]===0x1f4){logger['error'](_0x43c2('0x11'),_0x322ed1,_0x601448[_0x43c2('0x15')][_0x43c2('0x17')]);return _0x27a151(_0x601448[_0x43c2('0x15')][_0x43c2('0x17')]);}logger[_0x43c2('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x322ed1,_0x601448[_0x43c2('0x15')][_0x43c2('0x17')]);return _0x22e2c8(_0x601448['error'][_0x43c2('0x17')]);}else{logger[_0x43c2('0x10')](_0x43c2('0x11'),_0x322ed1,_0x43c2('0x13'));_0x22e2c8(_0x601448[_0x43c2('0x18')][_0x43c2('0x17')]);}})[_0x43c2('0x19')](function(_0x47fc2f){logger[_0x43c2('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x322ed1,_0x47fc2f);_0x27a151(_0x47fc2f);});});}exports[_0x43c2('0x1a')]=function(_0x2a3cde){var _0x12d368=this;return new Promise(function(_0x25d5fe,_0x5c88b8){return db[_0x43c2('0x1b')][_0x43c2('0x1c')]({'raw':_0x2a3cde[_0x43c2('0x1d')]?_0x2a3cde[_0x43c2('0x1d')][_0x43c2('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a3cde[_0x43c2('0x1d')]?_0x2a3cde['options'][_0x43c2('0x1f')]||null:null,'attributes':[[db[_0x43c2('0x20')]['fn'](_0x43c2('0x21'),db[_0x43c2('0x20')]['fn']('IF',db[_0x43c2('0x20')]['literal'](_0x43c2('0x22')))),_0x43c2('0x23')]]})['then'](function(_0x55ba5f){logger[_0x43c2('0x10')](_0x43c2('0x1a'),_0x2a3cde);logger[_0x43c2('0x12')]('GetVoiceQueueRtPauses',_0x2a3cde,JSON[_0x43c2('0x14')](_0x55ba5f));_0x25d5fe(_0x55ba5f);})[_0x43c2('0x19')](function(_0xc1563){logger['error'](_0x43c2('0x1a'),_0xc1563[_0x43c2('0x17')],_0x2a3cde);_0x5c88b8(_0x12d368[_0x43c2('0x15')](0x1f4,_0xc1563[_0x43c2('0x17')]));});});}; \ No newline at end of file +var _0x31e3=['debug','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x1412b2,_0x120508){var _0x4f6057=function(_0x29d7b7){while(--_0x29d7b7){_0x1412b2['push'](_0x1412b2['shift']());}};_0x4f6057(++_0x120508);}(_0x31e3,0x92));var _0x331e=function(_0x39338d,_0x19b64b){_0x39338d=_0x39338d-0x0;var _0x273a6a=_0x31e3[_0x39338d];return _0x273a6a;};'use strict';var _=require(_0x331e('0x0'));var util=require(_0x331e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x331e('0x2'));var fs=require('fs');var Redis=require(_0x331e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x331e('0x4'))(_0x331e('0x5'));var config=require(_0x331e('0x6'));var jayson=require(_0x331e('0x7'));var client=jayson[_0x331e('0x8')][_0x331e('0x9')]({'port':0x232a});config[_0x331e('0xa')]=_[_0x331e('0xb')](config[_0x331e('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x331e('0xa')]));require(_0x331e('0xc'))[_0x331e('0xd')](socket);function respondWithRpcPromise(_0x3dbd9f,_0x3e8de1,_0x43d81d){return new BPromise(function(_0x130b6f,_0x11f678){return client[_0x331e('0xe')](_0x3dbd9f,_0x43d81d)[_0x331e('0xf')](function(_0x1723ef){logger[_0x331e('0x10')](_0x331e('0x11'),_0x3e8de1,_0x331e('0x12'));logger[_0x331e('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3e8de1,_0x331e('0x12'),JSON[_0x331e('0x14')](_0x1723ef));if(_0x1723ef[_0x331e('0x15')]){if(_0x1723ef['error'][_0x331e('0x16')]===0x1f4){logger[_0x331e('0x15')](_0x331e('0x11'),_0x3e8de1,_0x1723ef['error'][_0x331e('0x17')]);return _0x11f678(_0x1723ef[_0x331e('0x15')]['message']);}logger['error'](_0x331e('0x11'),_0x3e8de1,_0x1723ef[_0x331e('0x15')][_0x331e('0x17')]);return _0x130b6f(_0x1723ef['error']['message']);}else{logger[_0x331e('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3e8de1,_0x331e('0x12'));_0x130b6f(_0x1723ef[_0x331e('0x18')][_0x331e('0x17')]);}})[_0x331e('0x19')](function(_0x1f8531){logger[_0x331e('0x15')](_0x331e('0x11'),_0x3e8de1,_0x1f8531);_0x11f678(_0x1f8531);});});}exports[_0x331e('0x1a')]=function(_0xe5cd15){var _0xa122fe=this;return new Promise(function(_0x529e97,_0x4868ae){return db[_0x331e('0x1b')]['findAll']({'raw':_0xe5cd15[_0x331e('0x1c')]?_0xe5cd15['options'][_0x331e('0x1d')]===undefined?!![]:![]:!![],'where':_0xe5cd15['options']?_0xe5cd15[_0x331e('0x1c')]['where']||null:null,'attributes':[[db[_0x331e('0x1e')]['fn'](_0x331e('0x1f'),db[_0x331e('0x1e')]['fn']('IF',db[_0x331e('0x1e')]['literal'](_0x331e('0x20')))),'outboundQueuePauses']]})['then'](function(_0x5a6b0e){logger[_0x331e('0x10')](_0x331e('0x1a'),_0xe5cd15);logger[_0x331e('0x13')]('GetVoiceQueueRtPauses',_0xe5cd15,JSON['stringify'](_0x5a6b0e));_0x529e97(_0x5a6b0e);})[_0x331e('0x19')](function(_0x388f52){logger['error'](_0x331e('0x1a'),_0x388f52[_0x331e('0x17')],_0xe5cd15);_0x4868ae(_0xa122fe[_0x331e('0x15')](0x1f4,_0x388f52[_0x331e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 07d2f2e..755c05f 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 _0x81bd=['save','remove','update','removeListener','./userVoiceQueueRt.events'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x81bd,0x7c));var _0xd81b=function(_0x39d38e,_0x3da1f7){_0x39d38e=_0x39d38e-0x0;var _0x18e737=_0x81bd[_0x39d38e];return _0x18e737;};'use strict';var UserVoiceQueueRtEvents=require(_0xd81b('0x0'));var events=[_0xd81b('0x1'),_0xd81b('0x2'),_0xd81b('0x3')];function createListener(_0x2d27cb,_0x2ec03a){return function(_0x111a9c){_0x2ec03a['emit'](_0x2d27cb,_0x111a9c);};}function removeListener(_0x16e8de,_0x2c3d9e){return function(){UserVoiceQueueRtEvents[_0xd81b('0x4')](_0x16e8de,_0x2c3d9e);};}exports['register']=function(_0x42a0aa){for(var _0x34eb73=0x0,_0x1f3f2c=events['length'];_0x34eb73<_0x1f3f2c;_0x34eb73++){var _0x5e14e8=events[_0x34eb73];var _0xa4cf97=createListener('userVoiceQueueRt:'+_0x5e14e8,_0x42a0aa);UserVoiceQueueRtEvents['on'](_0x5e14e8,_0xa4cf97);}}; \ No newline at end of file +var _0x9fd4=['./userVoiceQueueRt.events','save','remove','update','emit','register','userVoiceQueueRt:'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x9fd4,0x16c));var _0x49fd=function(_0x43af6f,_0x3af2f3){_0x43af6f=_0x43af6f-0x0;var _0x263537=_0x9fd4[_0x43af6f];return _0x263537;};'use strict';var UserVoiceQueueRtEvents=require(_0x49fd('0x0'));var events=[_0x49fd('0x1'),_0x49fd('0x2'),_0x49fd('0x3')];function createListener(_0x1f329d,_0xe1e23f){return function(_0x32d855){_0xe1e23f[_0x49fd('0x4')](_0x1f329d,_0x32d855);};}function removeListener(_0x3f149e,_0x55dda5){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3f149e,_0x55dda5);};}exports[_0x49fd('0x5')]=function(_0x42fdc7){for(var _0x1bc16e=0x0,_0x9353cd=events['length'];_0x1bc16e<_0x9353cd;_0x1bc16e++){var _0x14bb94=events[_0x1bc16e];var _0x461ac1=createListener(_0x49fd('0x6')+_0x14bb94,_0x42fdc7);UserVoiceQueueRtEvents['on'](_0x14bb94,_0x461ac1);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 98578c4..27f5e21 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 _0xb62e=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer','util'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0xb62e,0x1de));var _0xeb62=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb62e[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var auth=require(_0xeb62('0x5'));var interaction=require(_0xeb62('0x6'));var config=require(_0xeb62('0x7'));var controller=require(_0xeb62('0x8'));router[_0xeb62('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb62('0xa')]);router[_0xeb62('0x9')](_0xeb62('0xb'),auth['isAuthenticated'](),controller[_0xeb62('0xc')]);router[_0xeb62('0xd')]('/',auth[_0xeb62('0xe')](),controller[_0xeb62('0xf')]);router['put']('/:id',auth[_0xeb62('0xe')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xb'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0x567d20,_0x4441fc){var _0x130e48=function(_0x1b1bc6){while(--_0x1b1bc6){_0x567d20['push'](_0x567d20['shift']());}};_0x130e48(++_0x4441fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);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 a440399..268bf8f 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 _0xf01a=['sequelize','exports','STRING'];(function(_0x1d726e,_0x2ae1af){var _0x428459=function(_0xc3ff63){while(--_0xc3ff63){_0x1d726e['push'](_0x1d726e['shift']());}};_0x428459(++_0x2ae1af);}(_0xf01a,0x1da));var _0xaf01=function(_0x3105f5,_0x4c2538){_0x3105f5=_0x3105f5-0x0;var _0x104db8=_0xf01a[_0x3105f5];return _0x104db8;};'use strict';var Sequelize=require(_0xaf01('0x0'));module[_0xaf01('0x1')]={'name':{'type':Sequelize[_0xaf01('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdb4d=['STRING','sequelize'];(function(_0x2c3169,_0x2fd431){var _0x3d0062=function(_0x438147){while(--_0x438147){_0x2c3169['push'](_0x2c3169['shift']());}};_0x3d0062(++_0x2fd431);}(_0xdb4d,0x77));var _0xddb4=function(_0x301568,_0x3b8e3c){_0x301568=_0x301568-0x0;var _0x36591a=_0xdb4d[_0x301568];return _0x36591a;};'use strict';var Sequelize=require(_0xddb4('0x0'));module['exports']={'name':{'type':Sequelize[_0xddb4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xddb4('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 4a30517..85cdc74 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 _0xc8f9=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','name','index','Variable','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','pick','filter','where','merge','map','key','field','includeAll','include','findAll','catch','show','find'];(function(_0x45d2fc,_0x28570e){var _0x3a0f06=function(_0x11b529){while(--_0x11b529){_0x45d2fc['push'](_0x45d2fc['shift']());}};_0x3a0f06(++_0x28570e);}(_0xc8f9,0xa1));var _0x9c8f=function(_0x2fef1e,_0x5e55eb){_0x2fef1e=_0x2fef1e-0x0;var _0x1b93ca=_0xc8f9[_0x2fef1e];return _0x1b93ca;};'use strict';var pdf=require(_0x9c8f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c8f('0x1'));var zipdir=require(_0x9c8f('0x2'));var jsonpatch=require(_0x9c8f('0x3'));var rp=require('request-promise');var moment=require(_0x9c8f('0x4'));var BPromise=require(_0x9c8f('0x5'));var Mustache=require('mustache');var util=require(_0x9c8f('0x6'));var path=require(_0x9c8f('0x7'));var sox=require(_0x9c8f('0x8'));var csv=require(_0x9c8f('0x9'));var ejs=require(_0x9c8f('0xa'));var fs=require('fs');var _=require(_0x9c8f('0xb'));var squel=require(_0x9c8f('0xc'));var crypto=require(_0x9c8f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c8f('0x9'));var querystring=require(_0x9c8f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9c8f('0xf'));var qs=require(_0x9c8f('0x10'));var hardwareService=require(_0x9c8f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x9c8f('0x12'));var config=require(_0x9c8f('0x13'));var db=require(_0x9c8f('0x14'))['db'];function respondWithStatusCode(_0x2bef9a,_0x546c73){_0x546c73=_0x546c73||0xcc;return function(_0x45d4bd){if(_0x45d4bd){return _0x2bef9a[_0x9c8f('0x15')](_0x546c73);}return _0x2bef9a[_0x9c8f('0x16')](_0x546c73)[_0x9c8f('0x17')]();};}function respondWithResult(_0x211058,_0x50a0bb){_0x50a0bb=_0x50a0bb||0xc8;return function(_0x54517f){if(_0x54517f){return _0x211058[_0x9c8f('0x16')](_0x50a0bb)[_0x9c8f('0x18')](_0x54517f);}};}function respondWithFilteredResult(_0x265ebd,_0x38f79e){return function(_0x3e75b7){if(_0x3e75b7){var _0x5a4dbc=_0x3e75b7[_0x9c8f('0x19')],_0x2d4e1b=_0x38f79e[_0x9c8f('0x1a')],_0x511988=_0x38f79e[_0x9c8f('0x1a')]+_0x38f79e['limit'],_0x3d4630;if(_0x511988>=_0x5a4dbc){_0x511988=_0x5a4dbc;_0x3d4630=0xc8;}else{_0x3d4630=0xce;}_0x265ebd[_0x9c8f('0x16')](_0x3d4630);return _0x265ebd[_0x9c8f('0x1b')](_0x9c8f('0x1c'),_0x2d4e1b+'-'+_0x511988+'/'+_0x5a4dbc)[_0x9c8f('0x18')](_0x3e75b7);}return null;};}function patchUpdates(_0xf58ce0){return function(_0x2f58a0){try{jsonpatch[_0x9c8f('0x1d')](_0x2f58a0,_0xf58ce0,!![]);}catch(_0x3d7d93){return BPromise[_0x9c8f('0x1e')](_0x3d7d93);}return _0x2f58a0[_0x9c8f('0x1f')]();};}function saveUpdates(_0xdd9cba,_0x3627f7){return function(_0x30cbac){if(_0x30cbac){return _0x30cbac[_0x9c8f('0x20')](_0xdd9cba)[_0x9c8f('0x21')](function(_0x4ae373){return _0x4ae373;});}return null;};}function removeEntity(_0x3e15b0,_0x71c4d0){return function(_0x3d8a04){if(_0x3d8a04){return _0x3d8a04[_0x9c8f('0x22')]()['then'](function(){var _0x4e5555=_0x3d8a04[_0x9c8f('0x23')]({'plain':!![]});var _0x4c6356=_0x9c8f('0x24');return db[_0x9c8f('0x25')][_0x9c8f('0x22')]({'where':{'type':_0x4c6356,'resourceId':_0x4e5555['id']}})[_0x9c8f('0x21')](function(){return _0x3d8a04;});})[_0x9c8f('0x21')](function(){_0x3e15b0[_0x9c8f('0x16')](0xcc)[_0x9c8f('0x17')]();});}};}function handleEntityNotFound(_0x287765,_0x6ce355){return function(_0x43af1a){if(!_0x43af1a){_0x287765['sendStatus'](0x194);}return _0x43af1a;};}function handleError(_0x4b12c4,_0x158171){_0x158171=_0x158171||0x1f4;return function(_0x4121d0){logger[_0x9c8f('0x26')](_0x4121d0['stack']);if(_0x4121d0[_0x9c8f('0x27')]){delete _0x4121d0[_0x9c8f('0x27')];}_0x4b12c4[_0x9c8f('0x16')](_0x158171)['send'](_0x4121d0);};}exports[_0x9c8f('0x28')]=function(_0x1f92a5,_0x5475f5){var _0x5b081d={},_0x44ed06={},_0x114460={'count':0x0,'rows':[]};var _0x3b229e=db[_0x9c8f('0x29')][_0x9c8f('0x2a')];_0x44ed06[_0x9c8f('0x2b')]=_[_0x9c8f('0x2c')](_0x3b229e);_0x44ed06[_0x9c8f('0x2d')]=_[_0x9c8f('0x2c')](_0x1f92a5[_0x9c8f('0x2d')]);_0x44ed06[_0x9c8f('0x2e')]=_[_0x9c8f('0x2f')](_0x44ed06['model'],_0x44ed06[_0x9c8f('0x2d')]);_0x5b081d[_0x9c8f('0x30')]=_['intersection'](_0x44ed06['model'],qs[_0x9c8f('0x31')](_0x1f92a5['query']['fields']));_0x5b081d[_0x9c8f('0x30')]=_0x5b081d[_0x9c8f('0x30')][_0x9c8f('0x32')]?_0x5b081d['attributes']:_0x44ed06['model'];if(!_0x1f92a5[_0x9c8f('0x2d')]['hasOwnProperty']('nolimit')){_0x5b081d[_0x9c8f('0x33')]=qs[_0x9c8f('0x33')](_0x1f92a5['query'][_0x9c8f('0x33')]);_0x5b081d['offset']=qs[_0x9c8f('0x1a')](_0x1f92a5[_0x9c8f('0x2d')][_0x9c8f('0x1a')]);}_0x5b081d[_0x9c8f('0x34')]=qs['sort'](_0x1f92a5[_0x9c8f('0x2d')][_0x9c8f('0x35')]);_0x5b081d['where']=qs[_0x9c8f('0x2e')](_[_0x9c8f('0x36')](_0x1f92a5[_0x9c8f('0x2d')],_0x44ed06[_0x9c8f('0x2e')]));if(_0x1f92a5[_0x9c8f('0x2d')][_0x9c8f('0x37')]){_0x5b081d[_0x9c8f('0x38')]=_[_0x9c8f('0x39')](_0x5b081d[_0x9c8f('0x38')],{'$or':_[_0x9c8f('0x3a')](_0x3b229e,function(_0x11a5dd){if(_0x11a5dd['type'][_0x9c8f('0x3b')]!=='VIRTUAL'){var _0x67f91b={};_0x67f91b[_0x11a5dd[_0x9c8f('0x3c')]]={'$like':'%'+_0x1f92a5['query'][_0x9c8f('0x37')]+'%'};return _0x67f91b;}})});}_0x5b081d=_['merge']({},_0x5b081d,_0x1f92a5['options']);var _0x3297c0={'where':_0x5b081d[_0x9c8f('0x38')]};return db['Variable']['count'](_0x3297c0)[_0x9c8f('0x21')](function(_0x55e509){_0x114460[_0x9c8f('0x19')]=_0x55e509;if(_0x1f92a5[_0x9c8f('0x2d')][_0x9c8f('0x3d')]){_0x5b081d[_0x9c8f('0x3e')]=[{'all':!![]}];}return db['Variable'][_0x9c8f('0x3f')](_0x5b081d);})[_0x9c8f('0x21')](function(_0x34c606){_0x114460['rows']=_0x34c606;return _0x114460;})['then'](respondWithFilteredResult(_0x5475f5,_0x5b081d))[_0x9c8f('0x40')](handleError(_0x5475f5,null));};exports[_0x9c8f('0x41')]=function(_0x35735d,_0x4d3bc0){var _0x59db1a={'raw':!![],'where':{'id':_0x35735d['params']['id']}},_0x38a5d2={};_0x38a5d2[_0x9c8f('0x2b')]=_[_0x9c8f('0x2c')](db['Variable'][_0x9c8f('0x2a')]);_0x38a5d2['query']=_['keys'](_0x35735d[_0x9c8f('0x2d')]);_0x38a5d2['filters']=_[_0x9c8f('0x2f')](_0x38a5d2[_0x9c8f('0x2b')],_0x38a5d2['query']);_0x59db1a[_0x9c8f('0x30')]=_[_0x9c8f('0x2f')](_0x38a5d2[_0x9c8f('0x2b')],qs[_0x9c8f('0x31')](_0x35735d[_0x9c8f('0x2d')][_0x9c8f('0x31')]));_0x59db1a[_0x9c8f('0x30')]=_0x59db1a['attributes'][_0x9c8f('0x32')]?_0x59db1a[_0x9c8f('0x30')]:_0x38a5d2[_0x9c8f('0x2b')];if(_0x35735d[_0x9c8f('0x2d')][_0x9c8f('0x3d')]){_0x59db1a[_0x9c8f('0x3e')]=[{'all':!![]}];}_0x59db1a=_['merge']({},_0x59db1a,_0x35735d['options']);return db[_0x9c8f('0x29')][_0x9c8f('0x42')](_0x59db1a)[_0x9c8f('0x21')](handleEntityNotFound(_0x4d3bc0,null))[_0x9c8f('0x21')](respondWithResult(_0x4d3bc0,null))[_0x9c8f('0x40')](handleError(_0x4d3bc0,null));};exports['create']=function(_0x221a2d,_0x31193f){return db[_0x9c8f('0x29')][_0x9c8f('0x43')](_0x221a2d[_0x9c8f('0x44')],{})['then'](function(_0x3dab5e){var _0x1ec6af=_0x221a2d['user'][_0x9c8f('0x23')]({'plain':!![]});if(!_0x1ec6af)throw new Error(_0x9c8f('0x45'));if(_0x1ec6af['role']===_0x9c8f('0x46')){var _0x53fe1d=_0x3dab5e[_0x9c8f('0x23')]({'plain':!![]});var _0x556c06=_0x9c8f('0x24');return db[_0x9c8f('0x47')][_0x9c8f('0x42')]({'where':{'name':_0x556c06,'userProfileId':_0x1ec6af[_0x9c8f('0x48')]},'raw':!![]})[_0x9c8f('0x21')](function(_0xabcfa8){if(_0xabcfa8&&_0xabcfa8[_0x9c8f('0x49')]===0x0){return db[_0x9c8f('0x25')][_0x9c8f('0x43')]({'name':_0x53fe1d['name'],'resourceId':_0x53fe1d['id'],'type':_0xabcfa8[_0x9c8f('0x27')],'sectionId':_0xabcfa8['id']},{})[_0x9c8f('0x21')](function(){return _0x3dab5e;});}else{return _0x3dab5e;}})['catch'](function(_0x3d1198){logger['error'](_0x9c8f('0x4a'),_0x3d1198);throw _0x3d1198;});}return _0x3dab5e;})[_0x9c8f('0x21')](respondWithResult(_0x31193f,0xc9))[_0x9c8f('0x40')](handleError(_0x31193f,null));};exports[_0x9c8f('0x20')]=function(_0x3534c1,_0x2d2825){if(_0x3534c1[_0x9c8f('0x44')]['id']){delete _0x3534c1['body']['id'];}return db[_0x9c8f('0x29')]['find']({'where':{'id':_0x3534c1['params']['id']}})[_0x9c8f('0x21')](handleEntityNotFound(_0x2d2825,null))[_0x9c8f('0x21')](saveUpdates(_0x3534c1['body'],null))[_0x9c8f('0x21')](respondWithResult(_0x2d2825,null))[_0x9c8f('0x40')](handleError(_0x2d2825,null));};exports[_0x9c8f('0x22')]=function(_0x2f54eb,_0x1e17b8){return db[_0x9c8f('0x29')][_0x9c8f('0x42')]({'where':{'id':_0x2f54eb[_0x9c8f('0x4b')]['id']}})[_0x9c8f('0x21')](handleEntityNotFound(_0x1e17b8,null))[_0x9c8f('0x21')](removeEntity(_0x1e17b8,null))[_0x9c8f('0x40')](handleError(_0x1e17b8,null));}; \ No newline at end of file +var _0xe7dc=['error','name','index','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','key','VIRTUAL','field','where','Variable','includeAll','findAll','rows','catch','show','params','rawAttributes','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','zip-dir','moment','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource'];(function(_0x42c7cb,_0x5dece9){var _0x143efe=function(_0x4f88c5){while(--_0x4f88c5){_0x42c7cb['push'](_0x42c7cb['shift']());}};_0x143efe(++_0x5dece9);}(_0xe7dc,0x112));var _0xce7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe7dc[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xce7d('0x0'));var emlformat=require(_0xce7d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xce7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xce7d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xce7d('0x4'));var util=require(_0xce7d('0x5'));var path=require(_0xce7d('0x6'));var sox=require('sox');var csv=require(_0xce7d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xce7d('0x8'));var squel=require(_0xce7d('0x9'));var crypto=require(_0xce7d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xce7d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xce7d('0xc'));var Papa=require(_0xce7d('0xd'));var Redis=require(_0xce7d('0xe'));var authService=require(_0xce7d('0xf'));var qs=require(_0xce7d('0x10'));var hardwareService=require(_0xce7d('0x11'));var logger=require('../../config/logger')(_0xce7d('0x12'));var utils=require(_0xce7d('0x13'));var config=require(_0xce7d('0x14'));var db=require(_0xce7d('0x15'))['db'];function respondWithStatusCode(_0x5d8b59,_0x3de6bb){_0x3de6bb=_0x3de6bb||0xcc;return function(_0x34b50d){if(_0x34b50d){return _0x5d8b59[_0xce7d('0x16')](_0x3de6bb);}return _0x5d8b59[_0xce7d('0x17')](_0x3de6bb)[_0xce7d('0x18')]();};}function respondWithResult(_0x5bbbea,_0x5c09be){_0x5c09be=_0x5c09be||0xc8;return function(_0x92ab61){if(_0x92ab61){return _0x5bbbea[_0xce7d('0x17')](_0x5c09be)[_0xce7d('0x19')](_0x92ab61);}};}function respondWithFilteredResult(_0x4eb226,_0x421713){return function(_0x2fd5b6){if(_0x2fd5b6){var _0x3818ce=_0x2fd5b6[_0xce7d('0x1a')],_0x3f7e72=_0x421713[_0xce7d('0x1b')],_0x365636=_0x421713['offset']+_0x421713[_0xce7d('0x1c')],_0x23cd61;if(_0x365636>=_0x3818ce){_0x365636=_0x3818ce;_0x23cd61=0xc8;}else{_0x23cd61=0xce;}_0x4eb226[_0xce7d('0x17')](_0x23cd61);return _0x4eb226['set'](_0xce7d('0x1d'),_0x3f7e72+'-'+_0x365636+'/'+_0x3818ce)[_0xce7d('0x19')](_0x2fd5b6);}return null;};}function patchUpdates(_0x462d2c){return function(_0x3c18c0){try{jsonpatch[_0xce7d('0x1e')](_0x3c18c0,_0x462d2c,!![]);}catch(_0x32b7f2){return BPromise['reject'](_0x32b7f2);}return _0x3c18c0[_0xce7d('0x1f')]();};}function saveUpdates(_0x1dc54a,_0x53197c){return function(_0x2d1475){if(_0x2d1475){return _0x2d1475[_0xce7d('0x20')](_0x1dc54a)[_0xce7d('0x21')](function(_0x3ef471){return _0x3ef471;});}return null;};}function removeEntity(_0x2ac096,_0x3ebb1f){return function(_0x1278b5){if(_0x1278b5){return _0x1278b5[_0xce7d('0x22')]()[_0xce7d('0x21')](function(){var _0x14b16f=_0x1278b5[_0xce7d('0x23')]({'plain':!![]});var _0x1ed921=_0xce7d('0x24');return db[_0xce7d('0x25')]['destroy']({'where':{'type':_0x1ed921,'resourceId':_0x14b16f['id']}})[_0xce7d('0x21')](function(){return _0x1278b5;});})['then'](function(){_0x2ac096['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a5283,_0x379790){return function(_0x42b754){if(!_0x42b754){_0x3a5283[_0xce7d('0x16')](0x194);}return _0x42b754;};}function handleError(_0xc7a803,_0x465a11){_0x465a11=_0x465a11||0x1f4;return function(_0x5c60a5){logger[_0xce7d('0x26')](_0x5c60a5['stack']);if(_0x5c60a5[_0xce7d('0x27')]){delete _0x5c60a5[_0xce7d('0x27')];}_0xc7a803['status'](_0x465a11)['send'](_0x5c60a5);};}exports[_0xce7d('0x28')]=function(_0x4304f1,_0x5494a9){var _0x6231fa={},_0xceb294={},_0x299320={'count':0x0,'rows':[]};var _0x573e0a=db['Variable']['rawAttributes'];_0xceb294['model']=_[_0xce7d('0x29')](_0x573e0a);_0xceb294[_0xce7d('0x2a')]=_['keys'](_0x4304f1[_0xce7d('0x2a')]);_0xceb294[_0xce7d('0x2b')]=_[_0xce7d('0x2c')](_0xceb294[_0xce7d('0x2d')],_0xceb294[_0xce7d('0x2a')]);_0x6231fa[_0xce7d('0x2e')]=_[_0xce7d('0x2c')](_0xceb294['model'],qs['fields'](_0x4304f1['query'][_0xce7d('0x2f')]));_0x6231fa[_0xce7d('0x2e')]=_0x6231fa['attributes']['length']?_0x6231fa[_0xce7d('0x2e')]:_0xceb294['model'];if(!_0x4304f1[_0xce7d('0x2a')][_0xce7d('0x30')](_0xce7d('0x31'))){_0x6231fa[_0xce7d('0x1c')]=qs[_0xce7d('0x1c')](_0x4304f1[_0xce7d('0x2a')][_0xce7d('0x1c')]);_0x6231fa[_0xce7d('0x1b')]=qs['offset'](_0x4304f1[_0xce7d('0x2a')][_0xce7d('0x1b')]);}_0x6231fa[_0xce7d('0x32')]=qs[_0xce7d('0x33')](_0x4304f1[_0xce7d('0x2a')][_0xce7d('0x33')]);_0x6231fa['where']=qs[_0xce7d('0x2b')](_[_0xce7d('0x34')](_0x4304f1[_0xce7d('0x2a')],_0xceb294[_0xce7d('0x2b')]));if(_0x4304f1['query'][_0xce7d('0x35')]){_0x6231fa['where']=_['merge'](_0x6231fa['where'],{'$or':_['map'](_0x573e0a,function(_0xbf348c){if(_0xbf348c['type'][_0xce7d('0x36')]!==_0xce7d('0x37')){var _0x51e67b={};_0x51e67b[_0xbf348c[_0xce7d('0x38')]]={'$like':'%'+_0x4304f1[_0xce7d('0x2a')][_0xce7d('0x35')]+'%'};return _0x51e67b;}})});}_0x6231fa=_['merge']({},_0x6231fa,_0x4304f1['options']);var _0xc5bef0={'where':_0x6231fa[_0xce7d('0x39')]};return db[_0xce7d('0x3a')][_0xce7d('0x1a')](_0xc5bef0)[_0xce7d('0x21')](function(_0x51b346){_0x299320[_0xce7d('0x1a')]=_0x51b346;if(_0x4304f1[_0xce7d('0x2a')][_0xce7d('0x3b')]){_0x6231fa['include']=[{'all':!![]}];}return db['Variable'][_0xce7d('0x3c')](_0x6231fa);})[_0xce7d('0x21')](function(_0x4084b4){_0x299320[_0xce7d('0x3d')]=_0x4084b4;return _0x299320;})[_0xce7d('0x21')](respondWithFilteredResult(_0x5494a9,_0x6231fa))[_0xce7d('0x3e')](handleError(_0x5494a9,null));};exports[_0xce7d('0x3f')]=function(_0xfb3ea3,_0x48bbaa){var _0x26c5b7={'raw':!![],'where':{'id':_0xfb3ea3[_0xce7d('0x40')]['id']}},_0x516fc8={};_0x516fc8[_0xce7d('0x2d')]=_[_0xce7d('0x29')](db[_0xce7d('0x3a')][_0xce7d('0x41')]);_0x516fc8[_0xce7d('0x2a')]=_['keys'](_0xfb3ea3[_0xce7d('0x2a')]);_0x516fc8[_0xce7d('0x2b')]=_[_0xce7d('0x2c')](_0x516fc8[_0xce7d('0x2d')],_0x516fc8[_0xce7d('0x2a')]);_0x26c5b7['attributes']=_['intersection'](_0x516fc8[_0xce7d('0x2d')],qs['fields'](_0xfb3ea3[_0xce7d('0x2a')][_0xce7d('0x2f')]));_0x26c5b7['attributes']=_0x26c5b7[_0xce7d('0x2e')][_0xce7d('0x42')]?_0x26c5b7[_0xce7d('0x2e')]:_0x516fc8[_0xce7d('0x2d')];if(_0xfb3ea3[_0xce7d('0x2a')][_0xce7d('0x3b')]){_0x26c5b7['include']=[{'all':!![]}];}_0x26c5b7=_[_0xce7d('0x43')]({},_0x26c5b7,_0xfb3ea3[_0xce7d('0x44')]);return db['Variable']['find'](_0x26c5b7)['then'](handleEntityNotFound(_0x48bbaa,null))[_0xce7d('0x21')](respondWithResult(_0x48bbaa,null))[_0xce7d('0x3e')](handleError(_0x48bbaa,null));};exports[_0xce7d('0x45')]=function(_0x2c64af,_0x161c53){return db[_0xce7d('0x3a')][_0xce7d('0x45')](_0x2c64af[_0xce7d('0x46')],{})['then'](function(_0xad4fba){var _0x399f13=_0x2c64af[_0xce7d('0x47')][_0xce7d('0x23')]({'plain':!![]});if(!_0x399f13)throw new Error(_0xce7d('0x48'));if(_0x399f13['role']===_0xce7d('0x47')){var _0x2e598b=_0xad4fba['get']({'plain':!![]});var _0x3144b5='Variables';return db[_0xce7d('0x49')]['find']({'where':{'name':_0x3144b5,'userProfileId':_0x399f13[_0xce7d('0x4a')]},'raw':!![]})[_0xce7d('0x21')](function(_0x176df8){if(_0x176df8&&_0x176df8[_0xce7d('0x4b')]===0x0){return db[_0xce7d('0x25')][_0xce7d('0x45')]({'name':_0x2e598b[_0xce7d('0x27')],'resourceId':_0x2e598b['id'],'type':_0x176df8['name'],'sectionId':_0x176df8['id']},{})['then'](function(){return _0xad4fba;});}else{return _0xad4fba;}})['catch'](function(_0x21c17d){logger[_0xce7d('0x26')](_0xce7d('0x4c'),_0x21c17d);throw _0x21c17d;});}return _0xad4fba;})[_0xce7d('0x21')](respondWithResult(_0x161c53,0xc9))[_0xce7d('0x3e')](handleError(_0x161c53,null));};exports[_0xce7d('0x20')]=function(_0x25e048,_0x13a6cf){if(_0x25e048[_0xce7d('0x46')]['id']){delete _0x25e048[_0xce7d('0x46')]['id'];}return db[_0xce7d('0x3a')][_0xce7d('0x4d')]({'where':{'id':_0x25e048['params']['id']}})[_0xce7d('0x21')](handleEntityNotFound(_0x13a6cf,null))[_0xce7d('0x21')](saveUpdates(_0x25e048['body'],null))[_0xce7d('0x21')](respondWithResult(_0x13a6cf,null))['catch'](handleError(_0x13a6cf,null));};exports[_0xce7d('0x22')]=function(_0x22576c,_0x59c683){return db[_0xce7d('0x3a')][_0xce7d('0x4d')]({'where':{'id':_0x22576c['params']['id']}})[_0xce7d('0x21')](handleEntityNotFound(_0x59c683,null))['then'](removeEntity(_0x59c683,null))[_0xce7d('0x3e')](handleError(_0x59c683,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 459fece..24a908b 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 _0x3646=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x1ed613,_0xcdca41){var _0x109947=function(_0xf20250){while(--_0xf20250){_0x1ed613['push'](_0x1ed613['shift']());}};_0x109947(++_0xcdca41);}(_0x3646,0x15f));var _0x6364=function(_0x2f9419,_0x576e5b){_0x2f9419=_0x2f9419-0x0;var _0x4575ba=_0x3646[_0x2f9419];return _0x4575ba;};'use strict';var _=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var logger=require(_0x6364('0x2'))(_0x6364('0x3'));var moment=require('moment');var BPromise=require(_0x6364('0x4'));var rp=require(_0x6364('0x5'));var fs=require('fs');var path=require(_0x6364('0x6'));var rimraf=require(_0x6364('0x7'));var config=require(_0x6364('0x8'));var attributes=require(_0x6364('0x9'));module[_0x6364('0xa')]=function(_0x31f514,_0x165164){return _0x31f514[_0x6364('0xb')](_0x6364('0xc'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d14=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','tools_variables','lodash'];(function(_0x1d3b9d,_0xdd459c){var _0x5caef6=function(_0x43283b){while(--_0x43283b){_0x1d3b9d['push'](_0x1d3b9d['shift']());}};_0x5caef6(++_0xdd459c);}(_0x7d14,0x6d));var _0x47d1=function(_0x5cb1b9,_0x26838a){_0x5cb1b9=_0x5cb1b9-0x0;var _0x37317d=_0x7d14[_0x5cb1b9];return _0x37317d;};'use strict';var _=require(_0x47d1('0x0'));var util=require(_0x47d1('0x1'));var logger=require('../../config/logger')(_0x47d1('0x2'));var moment=require(_0x47d1('0x3'));var BPromise=require(_0x47d1('0x4'));var rp=require(_0x47d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47d1('0x6'));var config=require(_0x47d1('0x7'));var attributes=require(_0x47d1('0x8'));module[_0x47d1('0x9')]=function(_0x1b2f47,_0x550ee2){return _0x1b2f47['define']('Variable',attributes,{'tableName':_0x47d1('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 0329101..e7da477 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 _0x01ed=['request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','Variable,\x20%s,\x20%s','message','result','catch','ShowVariable','Variable','find','options','raw','attributes','map','include','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x271110,_0x4430c2){var _0x482d1f=function(_0xbf478e){while(--_0xbf478e){_0x271110['push'](_0x271110['shift']());}};_0x482d1f(++_0x4430c2);}(_0x01ed,0x79));var _0xd01e=function(_0x4f7418,_0x1755cc){_0x4f7418=_0x4f7418-0x0;var _0x4afe7e=_0x01ed[_0x4f7418];return _0x4afe7e;};'use strict';var _=require(_0xd01e('0x0'));var util=require(_0xd01e('0x1'));var moment=require(_0xd01e('0x2'));var BPromise=require(_0xd01e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd01e('0x4'));var db=require(_0xd01e('0x5'))['db'];var utils=require(_0xd01e('0x6'));var logger=require(_0xd01e('0x7'))(_0xd01e('0x8'));var config=require(_0xd01e('0x9'));var jayson=require(_0xd01e('0xa'));var client=jayson[_0xd01e('0xb')][_0xd01e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44be78,_0x1c091d,_0x1e7f26){return new BPromise(function(_0x15ff60,_0x5387aa){return client[_0xd01e('0xd')](_0x44be78,_0x1e7f26)['then'](function(_0x1eeac6){logger[_0xd01e('0xe')]('Variable,\x20%s,\x20%s',_0x1c091d,_0xd01e('0xf'));logger['debug'](_0xd01e('0x10'),_0x1c091d,'request\x20sent',JSON[_0xd01e('0x11')](_0x1eeac6));if(_0x1eeac6[_0xd01e('0x12')]){if(_0x1eeac6['error'][_0xd01e('0x13')]===0x1f4){logger['error'](_0xd01e('0x14'),_0x1c091d,_0x1eeac6[_0xd01e('0x12')][_0xd01e('0x15')]);return _0x5387aa(_0x1eeac6[_0xd01e('0x12')][_0xd01e('0x15')]);}logger[_0xd01e('0x12')]('Variable,\x20%s,\x20%s',_0x1c091d,_0x1eeac6[_0xd01e('0x12')][_0xd01e('0x15')]);return _0x15ff60(_0x1eeac6[_0xd01e('0x12')][_0xd01e('0x15')]);}else{logger[_0xd01e('0xe')](_0xd01e('0x14'),_0x1c091d,_0xd01e('0xf'));_0x15ff60(_0x1eeac6[_0xd01e('0x16')][_0xd01e('0x15')]);}})[_0xd01e('0x17')](function(_0x382005){logger[_0xd01e('0x12')](_0xd01e('0x14'),_0x1c091d,_0x382005);_0x5387aa(_0x382005);});});}exports[_0xd01e('0x18')]=function(_0x1b96a8){var _0x10a77=this;return new Promise(function(_0x4fd6ce,_0x4d033d){return db[_0xd01e('0x19')][_0xd01e('0x1a')]({'raw':_0x1b96a8['options']?_0x1b96a8[_0xd01e('0x1b')][_0xd01e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b96a8[_0xd01e('0x1b')]?_0x1b96a8[_0xd01e('0x1b')]['where']||null:null,'attributes':_0x1b96a8[_0xd01e('0x1b')]?_0x1b96a8[_0xd01e('0x1b')][_0xd01e('0x1d')]||null:null,'include':_0x1b96a8[_0xd01e('0x1b')]?_0x1b96a8[_0xd01e('0x1b')]['include']?_[_0xd01e('0x1e')](_0x1b96a8[_0xd01e('0x1b')][_0xd01e('0x1f')],function(_0x459146){return{'model':db[_0x459146[_0xd01e('0x20')]],'as':_0x459146['as'],'attributes':_0x459146[_0xd01e('0x1d')],'include':_0x459146[_0xd01e('0x1f')]?_[_0xd01e('0x1e')](_0x459146[_0xd01e('0x1f')],function(_0xb929a1){return{'model':db[_0xb929a1['model']],'as':_0xb929a1['as'],'attributes':_0xb929a1['attributes'],'include':_0xb929a1[_0xd01e('0x1f')]?_['map'](_0xb929a1[_0xd01e('0x1f')],function(_0x3b20bb){return{'model':db[_0x3b20bb[_0xd01e('0x20')]],'as':_0x3b20bb['as'],'attributes':_0x3b20bb['attributes']};}):[]};}):[]};}):[]:[]})[_0xd01e('0x21')](function(_0x931834){logger['info'](_0xd01e('0x18'),_0x1b96a8);logger['debug']('ShowVariable',_0x1b96a8,JSON[_0xd01e('0x11')](_0x931834));_0x4fd6ce(_0x931834);})[_0xd01e('0x17')](function(_0x1ba98f){logger[_0xd01e('0x12')](_0xd01e('0x18'),_0x1ba98f[_0xd01e('0x15')],_0x1b96a8);_0x4d033d(_0x10a77[_0xd01e('0x12')](0x1f4,_0x1ba98f[_0xd01e('0x15')]));});});}; \ No newline at end of file +var _0x99e3=['where','attributes','include','model','map','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','ShowVariable','find','options'];(function(_0x21cea5,_0x2a6f95){var _0x5c0257=function(_0x372de2){while(--_0x372de2){_0x21cea5['push'](_0x21cea5['shift']());}};_0x5c0257(++_0x2a6f95);}(_0x99e3,0x1c7));var _0x399e=function(_0x35a168,_0x1bccf0){_0x35a168=_0x35a168-0x0;var _0x3eb098=_0x99e3[_0x35a168];return _0x3eb098;};'use strict';var _=require(_0x399e('0x0'));var util=require(_0x399e('0x1'));var moment=require(_0x399e('0x2'));var BPromise=require(_0x399e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x399e('0x4'))['db'];var utils=require(_0x399e('0x5'));var logger=require(_0x399e('0x6'))(_0x399e('0x7'));var config=require(_0x399e('0x8'));var jayson=require(_0x399e('0x9'));var client=jayson[_0x399e('0xa')][_0x399e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x206175,_0x459ace,_0x2abbc1){return new BPromise(function(_0x3db831,_0x1198b9){return client[_0x399e('0xc')](_0x206175,_0x2abbc1)[_0x399e('0xd')](function(_0x34c0a2){logger[_0x399e('0xe')](_0x399e('0xf'),_0x459ace,_0x399e('0x10'));logger[_0x399e('0x11')](_0x399e('0x12'),_0x459ace,_0x399e('0x10'),JSON[_0x399e('0x13')](_0x34c0a2));if(_0x34c0a2['error']){if(_0x34c0a2[_0x399e('0x14')]['code']===0x1f4){logger['error'](_0x399e('0xf'),_0x459ace,_0x34c0a2['error'][_0x399e('0x15')]);return _0x1198b9(_0x34c0a2[_0x399e('0x14')][_0x399e('0x15')]);}logger[_0x399e('0x14')](_0x399e('0xf'),_0x459ace,_0x34c0a2[_0x399e('0x14')]['message']);return _0x3db831(_0x34c0a2[_0x399e('0x14')][_0x399e('0x15')]);}else{logger[_0x399e('0xe')](_0x399e('0xf'),_0x459ace,_0x399e('0x10'));_0x3db831(_0x34c0a2['result']['message']);}})['catch'](function(_0x587339){logger[_0x399e('0x14')]('Variable,\x20%s,\x20%s',_0x459ace,_0x587339);_0x1198b9(_0x587339);});});}exports[_0x399e('0x16')]=function(_0xad43bf){var _0x5ed596=this;return new Promise(function(_0x1661a1,_0xadf838){return db['Variable'][_0x399e('0x17')]({'raw':_0xad43bf[_0x399e('0x18')]?_0xad43bf['options']['raw']===undefined?!![]:![]:!![],'where':_0xad43bf['options']?_0xad43bf[_0x399e('0x18')][_0x399e('0x19')]||null:null,'attributes':_0xad43bf[_0x399e('0x18')]?_0xad43bf['options'][_0x399e('0x1a')]||null:null,'include':_0xad43bf[_0x399e('0x18')]?_0xad43bf[_0x399e('0x18')][_0x399e('0x1b')]?_['map'](_0xad43bf['options'][_0x399e('0x1b')],function(_0xa08b37){return{'model':db[_0xa08b37[_0x399e('0x1c')]],'as':_0xa08b37['as'],'attributes':_0xa08b37[_0x399e('0x1a')],'include':_0xa08b37['include']?_[_0x399e('0x1d')](_0xa08b37['include'],function(_0x44b4b1){return{'model':db[_0x44b4b1[_0x399e('0x1c')]],'as':_0x44b4b1['as'],'attributes':_0x44b4b1[_0x399e('0x1a')],'include':_0x44b4b1[_0x399e('0x1b')]?_[_0x399e('0x1d')](_0x44b4b1[_0x399e('0x1b')],function(_0x276e16){return{'model':db[_0x276e16[_0x399e('0x1c')]],'as':_0x276e16['as'],'attributes':_0x276e16['attributes']};}):[]};}):[]};}):[]:[]})[_0x399e('0xd')](function(_0x86ab6b){logger['info'](_0x399e('0x16'),_0xad43bf);logger[_0x399e('0x11')](_0x399e('0x16'),_0xad43bf,JSON[_0x399e('0x13')](_0x86ab6b));_0x1661a1(_0x86ab6b);})['catch'](function(_0x2cde6f){logger['error'](_0x399e('0x16'),_0x2cde6f[_0x399e('0x15')],_0xad43bf);_0xadf838(_0x5ed596['error'](0x1f4,_0x2cde6f['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index b76d4bf..da942ea 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 _0x65a7=['/fetch','canUpdate','/reset','isAuthenticated','/pull','pull','restart','migrations','exports','Router','../../components/auth/service','./version.controller','get','index'];(function(_0x311f10,_0x2a726d){var _0x1030c0=function(_0x346748){while(--_0x346748){_0x311f10['push'](_0x311f10['shift']());}};_0x1030c0(++_0x2a726d);}(_0x65a7,0x105));var _0x765a=function(_0x19109d,_0x46548c){_0x19109d=_0x19109d-0x0;var _0xcb726a=_0x65a7[_0x19109d];return _0xcb726a;};'use strict';var express=require('express');var router=express[_0x765a('0x0')]();var auth=require(_0x765a('0x1'));var controller=require(_0x765a('0x2'));router[_0x765a('0x3')]('/',controller[_0x765a('0x4')]);router['get'](_0x765a('0x5'),auth['isAuthenticated'](),auth[_0x765a('0x6')](),controller['fetch']);router[_0x765a('0x3')](_0x765a('0x7'),auth[_0x765a('0x8')](),auth[_0x765a('0x6')](),controller['reset']);router[_0x765a('0x3')](_0x765a('0x9'),auth[_0x765a('0x8')](),auth[_0x765a('0x6')](),controller[_0x765a('0xa')]);router['get']('/restart',auth[_0x765a('0x8')](),controller[_0x765a('0xb')]);router['get']('/migrations',controller[_0x765a('0xc')]);module[_0x765a('0xd')]=router; \ No newline at end of file +var _0x8d3b=['./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','pull','restart','exports','express','Router','../../components/auth/service'];(function(_0x3ce2ba,_0x22c8f9){var _0x1e75df=function(_0x1d41c7){while(--_0x1d41c7){_0x3ce2ba['push'](_0x3ce2ba['shift']());}};_0x1e75df(++_0x22c8f9);}(_0x8d3b,0x107));var _0xb8d3=function(_0x5f0609,_0x4a4bc9){_0x5f0609=_0x5f0609-0x0;var _0xa53dd0=_0x8d3b[_0x5f0609];return _0xa53dd0;};'use strict';var express=require(_0xb8d3('0x0'));var router=express[_0xb8d3('0x1')]();var auth=require(_0xb8d3('0x2'));var controller=require(_0xb8d3('0x3'));router[_0xb8d3('0x4')]('/',controller[_0xb8d3('0x5')]);router[_0xb8d3('0x4')](_0xb8d3('0x6'),auth[_0xb8d3('0x7')](),auth[_0xb8d3('0x8')](),controller[_0xb8d3('0x9')]);router[_0xb8d3('0x4')]('/reset',auth[_0xb8d3('0x7')](),auth[_0xb8d3('0x8')](),controller[_0xb8d3('0xa')]);router[_0xb8d3('0x4')]('/pull',auth['isAuthenticated'](),auth[_0xb8d3('0x8')](),controller[_0xb8d3('0xb')]);router['get']('/restart',auth[_0xb8d3('0x7')](),controller[_0xb8d3('0xc')]);router['get']('/migrations',controller['migrations']);module[_0xb8d3('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 7d04657..35fbffc 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 _0xde80=['info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','catch','migrations','readdirSync','join','replace','push','length','Migration','getQueryInterface','sequelize','constructor','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD'];(function(_0x36b705,_0x4018fe){var _0x3e0978=function(_0x4a1807){while(--_0x4a1807){_0x36b705['push'](_0x36b705['shift']());}};_0x3e0978(++_0x4018fe);}(_0xde80,0x84));var _0x0de8=function(_0x2046d1,_0x4e7b0f){_0x2046d1=_0x2046d1-0x0;var _0x53899b=_0xde80[_0x2046d1];return _0x53899b;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x0de8('0x0'));var pkginfo=require('pkginfo')(module,_0x0de8('0x1'));var compareVersions=require(_0x0de8('0x2'));var exec=require(_0x0de8('0x3'))[_0x0de8('0x4')];var db=require(_0x0de8('0x5'))['db'];var config=require(_0x0de8('0x6'));var pm2=require(_0x0de8('0x7'));var logger=require(_0x0de8('0x8'))('update');var git=require(_0x0de8('0x9'))(config[_0x0de8('0xa')]);exports[_0x0de8('0xb')]=function(_0x19333f,_0x47dd3d){var _0x54e517={'current':module[_0x0de8('0xc')][_0x0de8('0x1')],'phonebar':0x2};if(_0x19333f[_0x0de8('0xd')]&&_0x19333f[_0x0de8('0xd')][_0x0de8('0xe')]){return git[_0x0de8('0xf')]()[_0x0de8('0x10')](function(_0x3615f8,_0x1caf03){_0x54e517[_0x0de8('0xe')]=(_0x3615f8?module[_0x0de8('0xc')][_0x0de8('0x1')]:_0x1caf03[_0x0de8('0xe')])||_0x0de8('0x11');return _0x47dd3d['status'](0xc8)[_0x0de8('0x12')](_0x54e517);});}else{return _0x47dd3d[_0x0de8('0x13')](0xc8)['json'](_0x54e517);}};exports['fetch']=function(_0x42fbf4,_0x25a5f3){return git[_0x0de8('0xf')]([_0x0de8('0x14'),'master'],function(_0x51575a){if(_0x51575a){logger[_0x0de8('0x15')](_0x51575a);return _0x25a5f3[_0x0de8('0x13')](0x1f4)['json'](_0x51575a);}logger['info'](_0x0de8('0x16'));return _0x25a5f3[_0x0de8('0x13')](0xc8)[_0x0de8('0x12')]({'output':_0x0de8('0x17')});});};exports[_0x0de8('0x18')]=function(_0xd8daf3,_0x4c16fe){return git[_0x0de8('0x18')]([_0x0de8('0x19'),_0x0de8('0x1a')],function(_0x2cde87){if(_0x2cde87){logger[_0x0de8('0x15')](_0x2cde87);return _0x4c16fe[_0x0de8('0x13')](0x1f4)['json'](_0x2cde87);}logger[_0x0de8('0x1b')](_0x0de8('0x1c'));return _0x4c16fe[_0x0de8('0x13')](0xc8)[_0x0de8('0x12')]({'output':_0x0de8('0x1d')});});};exports[_0x0de8('0x1e')]=function(_0x3167c3,_0xef487b){exec(_0x0de8('0x1f'),function(_0x395d9c,_0x310eb7,_0x41c28a){logger[_0x0de8('0x1b')](_0x310eb7);logger[_0x0de8('0x1b')](_0x41c28a);if(_0x395d9c){logger[_0x0de8('0x15')](_0x395d9c);return _0xef487b['status'](0x1f4)[_0x0de8('0x12')](_0x395d9c);}return _0xef487b[_0x0de8('0x13')](0xc8)[_0x0de8('0x12')]({'output':_0x310eb7});});};exports[_0x0de8('0x20')]=function(_0x4bd5d5,_0x43e92c){return pm2[_0x0de8('0x20')](_0x0de8('0x21'))[_0x0de8('0x22')](function(_0x26d9ce){logger[_0x0de8('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x26d9ce);return _0x43e92c[_0x0de8('0x13')](0xc8)[_0x0de8('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x0de8('0x23')](function(_0x24fd63){logger[_0x0de8('0x15')](_0x24fd63);return _0x43e92c[_0x0de8('0x13')](0x1f4)['json'](_0x24fd63);});};exports[_0x0de8('0x24')]=function(_0x253a94,_0x1bf613){var _0x282baf=fs[_0x0de8('0x25')](path[_0x0de8('0x26')](config[_0x0de8('0xa')],'server',_0x0de8('0x24')));var _0x4b3085=[];for(var _0x27e561=0x0;_0x27e561<_0x282baf['length'];_0x27e561++){var _0x3001e0=_0x282baf[_0x27e561][_0x0de8('0x27')]('.js','');if(compareVersions(module[_0x0de8('0xc')]['version'],_0x3001e0)===-0x1){_0x4b3085[_0x0de8('0x28')](_0x3001e0);}}if(_0x4b3085[_0x0de8('0x29')]){var _0x47d998=_0x4b3085['sort'](compareVersions);var _0x1b7206=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x0de8('0x2a'),'columnName':_0x0de8('0x1')},'migrations':{'params':[db['sequelize'][_0x0de8('0x2b')](),db[_0x0de8('0x2c')][_0x0de8('0x2d')],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[_0x0de8('0x26')](config[_0x0de8('0xa')],_0x0de8('0x2e'),'migrations'),'pattern':/\.js$/}});_0x1b7206['up']({'migrations':_[_0x0de8('0x2f')](_0x47d998,function(_0x32f2a7){return _0x32f2a7+_0x0de8('0x30');})})[_0x0de8('0x22')](function(){return _0x1bf613['status'](0xc8)[_0x0de8('0x12')]({'output':_0x0de8('0x31')+module[_0x0de8('0xc')][_0x0de8('0x1')]+'\x20to\x20'+_[_0x0de8('0x32')](_0x47d998),'migrations':_[_0x0de8('0x26')](_0x47d998)});})[_0x0de8('0x23')](function(_0x4ece02){if(_0x4ece02 instanceof db[_0x0de8('0x2c')][_0x0de8('0x33')]){return _0x1bf613[_0x0de8('0x13')](0xc8)[_0x0de8('0x12')]({'output':_0x0de8('0x34')});}else{return _0x1bf613[_0x0de8('0x13')](0x1f4)[_0x0de8('0x12')](_0x4ece02);}});}else{return _0x1bf613[_0x0de8('0x13')](0xc8)[_0x0de8('0x12')]({'output':_0x0de8('0x34')});}}; \ No newline at end of file +var _0x670b=['git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','version','child_process','../../mysqldb','../../config/environment','../../config/logger','update','root','index','latest','tags','exports','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD'];(function(_0x594689,_0x41e85f){var _0xd1ffbf=function(_0x4a4bc6){while(--_0x4a4bc6){_0x594689['push'](_0x594689['shift']());}};_0xd1ffbf(++_0x41e85f);}(_0x670b,0x130));var _0xb670=function(_0x51b69c,_0x36a1d9){_0x51b69c=_0x51b69c-0x0;var _0x9ec223=_0x670b[_0x51b69c];return _0x9ec223;};'use strict';var Umzug=require(_0xb670('0x0'));var path=require(_0xb670('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0xb670('0x2'));var compareVersions=require('compare-versions');var exec=require(_0xb670('0x3'))['exec'];var db=require(_0xb670('0x4'))['db'];var config=require(_0xb670('0x5'));var pm2=require('../../config/pm2');var logger=require(_0xb670('0x6'))(_0xb670('0x7'));var git=require('simple-git')(config[_0xb670('0x8')]);exports[_0xb670('0x9')]=function(_0x391690,_0x2b68f6){var _0x5aa138={'current':module['exports'][_0xb670('0x2')],'phonebar':0x2};if(_0x391690['query']&&_0x391690['query'][_0xb670('0xa')]){return git['fetch']()[_0xb670('0xb')](function(_0x4f495,_0x84925b){_0x5aa138[_0xb670('0xa')]=(_0x4f495?module[_0xb670('0xc')][_0xb670('0x2')]:_0x84925b[_0xb670('0xa')])||_0xb670('0xd');return _0x2b68f6[_0xb670('0xe')](0xc8)['json'](_0x5aa138);});}else{return _0x2b68f6[_0xb670('0xe')](0xc8)[_0xb670('0xf')](_0x5aa138);}};exports['fetch']=function(_0x5ad3f6,_0x57e19e){return git[_0xb670('0x10')]([_0xb670('0x11'),_0xb670('0x12')],function(_0x24cf61){if(_0x24cf61){logger[_0xb670('0x13')](_0x24cf61);return _0x57e19e[_0xb670('0xe')](0x1f4)[_0xb670('0xf')](_0x24cf61);}logger[_0xb670('0x14')]('git\x20fetch');return _0x57e19e[_0xb670('0xe')](0xc8)[_0xb670('0xf')]({'output':_0xb670('0x15')});});};exports[_0xb670('0x16')]=function(_0x1d5ddd,_0x2a1074){return git[_0xb670('0x16')]([_0xb670('0x17'),_0xb670('0x18')],function(_0x4eef6b){if(_0x4eef6b){logger[_0xb670('0x13')](_0x4eef6b);return _0x2a1074['status'](0x1f4)['json'](_0x4eef6b);}logger[_0xb670('0x14')](_0xb670('0x19'));return _0x2a1074[_0xb670('0xe')](0xc8)[_0xb670('0xf')]({'output':_0xb670('0x1a')});});};exports[_0xb670('0x1b')]=function(_0x3e36c7,_0x46bd02){exec('npm\x20install\x20--production',function(_0x136be2,_0x48b32e,_0x3df4b3){logger['info'](_0x48b32e);logger[_0xb670('0x14')](_0x3df4b3);if(_0x136be2){logger[_0xb670('0x13')](_0x136be2);return _0x46bd02[_0xb670('0xe')](0x1f4)[_0xb670('0xf')](_0x136be2);}return _0x46bd02[_0xb670('0xe')](0xc8)['json']({'output':_0x48b32e});});};exports[_0xb670('0x1c')]=function(_0x45e4c4,_0x40e52f){return pm2['restart']('motion2')[_0xb670('0x1d')](function(_0x1859ff){logger[_0xb670('0x14')](_0xb670('0x1e'),_0x1859ff);return _0x40e52f[_0xb670('0xe')](0xc8)['json']({'output':_0xb670('0x1f')});})[_0xb670('0x20')](function(_0x2678ec){logger[_0xb670('0x13')](_0x2678ec);return _0x40e52f[_0xb670('0xe')](0x1f4)[_0xb670('0xf')](_0x2678ec);});};exports[_0xb670('0x21')]=function(_0x47c591,_0x56fa77){var _0x504513=fs['readdirSync'](path[_0xb670('0x22')](config['root'],_0xb670('0x23'),'migrations'));var _0x2d9979=[];for(var _0x423106=0x0;_0x423106<_0x504513[_0xb670('0x24')];_0x423106++){var _0x6806fd=_0x504513[_0x423106][_0xb670('0x25')](_0xb670('0x26'),'');if(compareVersions(module[_0xb670('0xc')][_0xb670('0x2')],_0x6806fd)===-0x1){_0x2d9979[_0xb670('0x27')](_0x6806fd);}}if(_0x2d9979[_0xb670('0x24')]){var _0x4194c2=_0x2d9979['sort'](compareVersions);var _0x289a1e=new Umzug({'storage':_0xb670('0x28'),'storageOptions':{'model':db[_0xb670('0x29')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xb670('0x28')][_0xb670('0x2a')](),db[_0xb670('0x28')][_0xb670('0x2b')],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[_0xb670('0x22')](config['root'],_0xb670('0x23'),_0xb670('0x21')),'pattern':/\.js$/}});_0x289a1e['up']({'migrations':_['map'](_0x4194c2,function(_0x30200f){return _0x30200f+_0xb670('0x26');})})[_0xb670('0x1d')](function(){return _0x56fa77[_0xb670('0xe')](0xc8)[_0xb670('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xb670('0xc')][_0xb670('0x2')]+_0xb670('0x2c')+_[_0xb670('0x2d')](_0x4194c2),'migrations':_[_0xb670('0x22')](_0x4194c2)});})[_0xb670('0x20')](function(_0x1bcfd4){if(_0x1bcfd4 instanceof db[_0xb670('0x28')]['UniqueConstraintError']){return _0x56fa77['status'](0xc8)['json']({'output':_0xb670('0x2e')});}else{return _0x56fa77['status'](0x1f4)[_0xb670('0xf')](_0x1bcfd4);}});}else{return _0x56fa77['status'](0xc8)[_0xb670('0xf')]({'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 06e088c..94ed5cd 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 _0x583c=['get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./voiceAgentReport.controller'];(function(_0x5b7c53,_0xe7b13b){var _0x32c38a=function(_0x4b6937){while(--_0x4b6937){_0x5b7c53['push'](_0x5b7c53['shift']());}};_0x32c38a(++_0xe7b13b);}(_0x583c,0x12b));var _0xc583=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0x583c[_0x55d829];return _0x52163b;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var auth=require(_0xc583('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc583('0x6'));router[_0xc583('0x7')]('/',auth['isAuthenticated'](),controller[_0xc583('0x8')]);router[_0xc583('0x7')](_0xc583('0x9'),auth[_0xc583('0xa')](),controller['describe']);router[_0xc583('0x7')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xd')]('/',auth[_0xc583('0xa')](),controller[_0xc583('0xe')]);router[_0xc583('0xf')]('/:id',auth[_0xc583('0xa')](),controller[_0xc583('0x10')]);router['delete'](_0xc583('0xb'),auth[_0xc583('0xa')](),controller['destroy']);module[_0xc583('0x11')]=router; \ No newline at end of file +var _0x6d38=['delete','exports','util','path','connect-timeout','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','/:id','show','create','put','update'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x6d38,0x1ef));var _0x86d3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6d38[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['describe']);router['get'](_0x86d3('0xa'),auth[_0x86d3('0x9')](),controller[_0x86d3('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);router[_0x86d3('0xf')]('/:id',auth[_0x86d3('0x9')](),controller['destroy']);module[_0x86d3('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index a8be0a2..b8f5a2f 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 _0xc1d5=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x51a182,_0x5639a7){var _0x46aa3e=function(_0x287abb){while(--_0x287abb){_0x51a182['push'](_0x51a182['shift']());}};_0x46aa3e(++_0x5639a7);}(_0xc1d5,0x1e0));var _0x5c1d=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xc1d5[_0x50a004];return _0x5e9992;};'use strict';var Sequelize=require(_0x5c1d('0x0'));module['exports']={'type':{'type':Sequelize[_0x5c1d('0x1')]},'uniqueid':{'type':Sequelize[_0x5c1d('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5c1d('0x1')]},'queue':{'type':Sequelize[_0x5c1d('0x1')]},'interface':{'type':Sequelize[_0x5c1d('0x1')]},'membername':{'type':Sequelize[_0x5c1d('0x1')]},'agentcalledAt':{'type':Sequelize[_0x5c1d('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x5c1d('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x5c1d('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5c1d('0x3')]},'agentcomplete':{'type':Sequelize[_0x5c1d('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x5c1d('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5c1d('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5c1d('0x3')]},'agentacw':{'type':Sequelize[_0x5c1d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5c1d('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x5c1d('0x1')]},'channel':{'type':Sequelize[_0x5c1d('0x1')]},'channelstate':{'type':Sequelize[_0x5c1d('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5c1d('0x1')]},'accountcode':{'type':Sequelize[_0x5c1d('0x1')]},'context':{'type':Sequelize[_0x5c1d('0x1')]},'exten':{'type':Sequelize[_0x5c1d('0x1')]},'priority':{'type':Sequelize[_0x5c1d('0x1')]},'destchannel':{'type':Sequelize[_0x5c1d('0x1')]},'destchannelstate':{'type':Sequelize[_0x5c1d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5c1d('0x1')]},'destcalleridnum':{'type':Sequelize[_0x5c1d('0x1')]},'destcalleridname':{'type':Sequelize[_0x5c1d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x5c1d('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x5c1d('0x1')]},'destlanguage':{'type':Sequelize[_0x5c1d('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5c1d('0x1')]},'destexten':{'type':Sequelize[_0x5c1d('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x5c1d('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5c1d('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x5c1d('0x1')]},'transfer':{'type':Sequelize[_0x5c1d('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5c1d('0x1')],'comment':_0x5c1d('0x5')},'transferexten':{'type':Sequelize[_0x5c1d('0x1')]},'transferuniqueid':{'type':Sequelize[_0x5c1d('0x1')]},'agententerreason':{'type':Sequelize[_0x5c1d('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfb03=['INTEGER','BOOLEAN','sequelize','STRING','DATE'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xfb03,0xa2));var _0x3fb0=function(_0x447969,_0x52ece0){_0x447969=_0x447969-0x0;var _0x326297=_0xfb03[_0x447969];return _0x326297;};'use strict';var Sequelize=require(_0x3fb0('0x0'));module['exports']={'type':{'type':Sequelize[_0x3fb0('0x1')]},'uniqueid':{'type':Sequelize[_0x3fb0('0x1')]},'calleridnum':{'type':Sequelize[_0x3fb0('0x1')]},'calleridname':{'type':Sequelize[_0x3fb0('0x1')]},'queue':{'type':Sequelize[_0x3fb0('0x1')]},'interface':{'type':Sequelize[_0x3fb0('0x1')]},'membername':{'type':Sequelize[_0x3fb0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x3fb0('0x2')]},'agentconnectAt':{'type':Sequelize[_0x3fb0('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x3fb0('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x3fb0('0x2')]},'agentdumpAt':{'type':Sequelize[_0x3fb0('0x2')]},'holdtime':{'type':Sequelize[_0x3fb0('0x3')]},'agentcomplete':{'type':Sequelize[_0x3fb0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3fb0('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3fb0('0x3')]},'reason':{'type':Sequelize[_0x3fb0('0x1')]},'lastevent':{'type':Sequelize[_0x3fb0('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3fb0('0x3')]},'channelstatedesc':{'type':Sequelize[_0x3fb0('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3fb0('0x1')]},'connectedlinename':{'type':Sequelize[_0x3fb0('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3fb0('0x1')]},'context':{'type':Sequelize[_0x3fb0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3fb0('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x3fb0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3fb0('0x1')]},'destcalleridnum':{'type':Sequelize[_0x3fb0('0x1')]},'destcalleridname':{'type':Sequelize[_0x3fb0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x3fb0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3fb0('0x1')]},'destlanguage':{'type':Sequelize[_0x3fb0('0x1')]},'destaccountcode':{'type':Sequelize[_0x3fb0('0x1')]},'destcontext':{'type':Sequelize[_0x3fb0('0x1')]},'destexten':{'type':Sequelize[_0x3fb0('0x1')]},'destpriority':{'type':Sequelize[_0x3fb0('0x1')]},'destuniqueid':{'type':Sequelize[_0x3fb0('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3fb0('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3fb0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x3fb0('0x1')]},'transferuniqueid':{'type':Sequelize[_0x3fb0('0x1')]},'agententerreason':{'type':Sequelize[_0x3fb0('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index b3ce6d9..52ed374 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 _0x83e3=['html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','reject','save','update','then','end','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','catch','show','params','intersection','options','find','create','body','destroy','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x83e3,0x8c));var _0x383e=function(_0x773434,_0x1b3cdf){_0x773434=_0x773434-0x0;var _0xc0fb94=_0x83e3[_0x773434];return _0xc0fb94;};'use strict';var pdf=require(_0x383e('0x0'));var emlformat=require(_0x383e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x383e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x383e('0x3'));var moment=require(_0x383e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x383e('0x5'));var util=require(_0x383e('0x6'));var path=require(_0x383e('0x7'));var sox=require('sox');var csv=require(_0x383e('0x8'));var ejs=require(_0x383e('0x9'));var fs=require('fs');var _=require(_0x383e('0xa'));var squel=require(_0x383e('0xb'));var crypto=require('crypto');var jsforce=require(_0x383e('0xc'));var deskjs=require(_0x383e('0xd'));var toCsv=require(_0x383e('0x8'));var querystring=require(_0x383e('0xe'));var Papa=require(_0x383e('0xf'));var Redis=require(_0x383e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x383e('0x11'));var logger=require(_0x383e('0x12'))(_0x383e('0x13'));var utils=require(_0x383e('0x14'));var config=require(_0x383e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23cd1b,_0x53db99){_0x53db99=_0x53db99||0xcc;return function(_0x547cf4){if(_0x547cf4){return _0x23cd1b[_0x383e('0x16')](_0x53db99);}return _0x23cd1b['status'](_0x53db99)['end']();};}function respondWithResult(_0x2a2399,_0x2c4412){_0x2c4412=_0x2c4412||0xc8;return function(_0x31e5b4){if(_0x31e5b4){return _0x2a2399[_0x383e('0x17')](_0x2c4412)['json'](_0x31e5b4);}};}function respondWithFilteredResult(_0x4ea57d,_0x343d82){return function(_0xc00ba0){if(_0xc00ba0){var _0x544f32=_0xc00ba0[_0x383e('0x18')],_0x451d7e=_0x343d82[_0x383e('0x19')],_0x1f9fae=_0x343d82[_0x383e('0x19')]+_0x343d82[_0x383e('0x1a')],_0xa9ea36;if(_0x1f9fae>=_0x544f32){_0x1f9fae=_0x544f32;_0xa9ea36=0xc8;}else{_0xa9ea36=0xce;}_0x4ea57d['status'](_0xa9ea36);return _0x4ea57d['set']('Content-Range',_0x451d7e+'-'+_0x1f9fae+'/'+_0x544f32)['json'](_0xc00ba0);}return null;};}function patchUpdates(_0x2f068d){return function(_0x3affff){try{jsonpatch['apply'](_0x3affff,_0x2f068d,!![]);}catch(_0x428a7c){return BPromise[_0x383e('0x1b')](_0x428a7c);}return _0x3affff[_0x383e('0x1c')]();};}function saveUpdates(_0x22b937,_0x554270){return function(_0x2c635b){if(_0x2c635b){return _0x2c635b[_0x383e('0x1d')](_0x22b937)['then'](function(_0x40b445){return _0x40b445;});}return null;};}function removeEntity(_0x4e3bb5,_0x556144){return function(_0x466438){if(_0x466438){return _0x466438['destroy']()[_0x383e('0x1e')](function(){_0x4e3bb5[_0x383e('0x17')](0xcc)[_0x383e('0x1f')]();});}};}function handleEntityNotFound(_0x1b97e6,_0x458a38){return function(_0x53c631){if(!_0x53c631){_0x1b97e6['sendStatus'](0x194);}return _0x53c631;};}function handleError(_0x6e616,_0x32bbaf){_0x32bbaf=_0x32bbaf||0x1f4;return function(_0xc9dd0f){logger[_0x383e('0x20')](_0xc9dd0f[_0x383e('0x21')]);if(_0xc9dd0f[_0x383e('0x22')]){delete _0xc9dd0f[_0x383e('0x22')];}_0x6e616['status'](_0x32bbaf)[_0x383e('0x23')](_0xc9dd0f);};}exports[_0x383e('0x24')]=function(_0x27e366,_0x298f15){var _0xaacf2a={},_0x5b4a09={},_0x534dbc={'count':0x0,'rows':[]};var _0x1799ac=db[_0x383e('0x25')][_0x383e('0x26')];_0x5b4a09[_0x383e('0x27')]=_[_0x383e('0x28')](_0x1799ac);_0x5b4a09[_0x383e('0x29')]=_[_0x383e('0x28')](_0x27e366['query']);_0x5b4a09['filters']=_['intersection'](_0x5b4a09[_0x383e('0x27')],_0x5b4a09[_0x383e('0x29')]);_0xaacf2a[_0x383e('0x2a')]=_['intersection'](_0x5b4a09[_0x383e('0x27')],qs[_0x383e('0x2b')](_0x27e366[_0x383e('0x29')]['fields']));_0xaacf2a[_0x383e('0x2a')]=_0xaacf2a[_0x383e('0x2a')][_0x383e('0x2c')]?_0xaacf2a[_0x383e('0x2a')]:_0x5b4a09[_0x383e('0x27')];if(!_0x27e366[_0x383e('0x29')]['hasOwnProperty'](_0x383e('0x2d'))){_0xaacf2a[_0x383e('0x1a')]=qs[_0x383e('0x1a')](_0x27e366['query'][_0x383e('0x1a')]);_0xaacf2a['offset']=qs[_0x383e('0x19')](_0x27e366[_0x383e('0x29')][_0x383e('0x19')]);}_0xaacf2a[_0x383e('0x2e')]=qs[_0x383e('0x2f')](_0x27e366[_0x383e('0x29')][_0x383e('0x2f')]);_0xaacf2a[_0x383e('0x30')]=qs[_0x383e('0x31')](_['pick'](_0x27e366[_0x383e('0x29')],_0x5b4a09['filters']));if(_0x27e366['query'][_0x383e('0x32')]){_0xaacf2a['where']=_[_0x383e('0x33')](_0xaacf2a[_0x383e('0x30')],{'$or':_[_0x383e('0x34')](_0x1799ac,function(_0x1a977d){if(_0x1a977d[_0x383e('0x35')][_0x383e('0x36')]!==_0x383e('0x37')){var _0x36f5b0={};_0x36f5b0[_0x1a977d[_0x383e('0x38')]]={'$like':'%'+_0x27e366[_0x383e('0x29')]['filter']+'%'};return _0x36f5b0;}})});}_0xaacf2a=_[_0x383e('0x33')]({},_0xaacf2a,_0x27e366['options']);var _0x552c64={'where':_0xaacf2a[_0x383e('0x30')]};return db[_0x383e('0x25')]['count'](_0x552c64)[_0x383e('0x1e')](function(_0x3b09e0){_0x534dbc[_0x383e('0x18')]=_0x3b09e0;if(_0x27e366[_0x383e('0x29')][_0x383e('0x39')]){_0xaacf2a[_0x383e('0x3a')]=[{'all':!![]}];}return db[_0x383e('0x25')][_0x383e('0x3b')](_0xaacf2a);})[_0x383e('0x1e')](function(_0x5b1d8b){_0x534dbc['rows']=_0x5b1d8b;return _0x534dbc;})[_0x383e('0x1e')](respondWithFilteredResult(_0x298f15,_0xaacf2a))[_0x383e('0x3c')](handleError(_0x298f15,null));};exports[_0x383e('0x3d')]=function(_0x4efe3f,_0x1769e9){var _0x28bb65={'raw':![],'where':{'id':_0x4efe3f[_0x383e('0x3e')]['id']}},_0x1594f0={};_0x1594f0['model']=_['keys'](db[_0x383e('0x25')][_0x383e('0x26')]);_0x1594f0[_0x383e('0x29')]=_['keys'](_0x4efe3f['query']);_0x1594f0[_0x383e('0x31')]=_[_0x383e('0x3f')](_0x1594f0[_0x383e('0x27')],_0x1594f0['query']);_0x28bb65['attributes']=_[_0x383e('0x3f')](_0x1594f0[_0x383e('0x27')],qs[_0x383e('0x2b')](_0x4efe3f['query'][_0x383e('0x2b')]));_0x28bb65[_0x383e('0x2a')]=_0x28bb65[_0x383e('0x2a')]['length']?_0x28bb65[_0x383e('0x2a')]:_0x1594f0[_0x383e('0x27')];if(_0x4efe3f[_0x383e('0x29')]['includeAll']){_0x28bb65[_0x383e('0x3a')]=[{'all':!![]}];}_0x28bb65=_[_0x383e('0x33')]({},_0x28bb65,_0x4efe3f[_0x383e('0x40')]);return db[_0x383e('0x25')][_0x383e('0x41')](_0x28bb65)[_0x383e('0x1e')](handleEntityNotFound(_0x1769e9,null))[_0x383e('0x1e')](respondWithResult(_0x1769e9,null))[_0x383e('0x3c')](handleError(_0x1769e9,null));};exports[_0x383e('0x42')]=function(_0x752c5f,_0x3867a7){return db[_0x383e('0x25')][_0x383e('0x42')](_0x752c5f[_0x383e('0x43')],{})[_0x383e('0x1e')](respondWithResult(_0x3867a7,0xc9))[_0x383e('0x3c')](handleError(_0x3867a7,null));};exports['update']=function(_0x516ef4,_0x571d7c){if(_0x516ef4['body']['id']){delete _0x516ef4[_0x383e('0x43')]['id'];}return db['VoiceAgentReport'][_0x383e('0x41')]({'where':{'id':_0x516ef4[_0x383e('0x3e')]['id']}})[_0x383e('0x1e')](handleEntityNotFound(_0x571d7c,null))[_0x383e('0x1e')](saveUpdates(_0x516ef4[_0x383e('0x43')],null))['then'](respondWithResult(_0x571d7c,null))['catch'](handleError(_0x571d7c,null));};exports[_0x383e('0x44')]=function(_0x898a59,_0x598bca){return db[_0x383e('0x25')]['find']({'where':{'id':_0x898a59[_0x383e('0x3e')]['id']}})[_0x383e('0x1e')](handleEntityNotFound(_0x598bca,null))[_0x383e('0x1e')](removeEntity(_0x598bca,null))[_0x383e('0x3c')](handleError(_0x598bca,null));};exports[_0x383e('0x45')]=function(_0x2cdd6c,_0x5cb6b5){return db[_0x383e('0x25')][_0x383e('0x45')]()[_0x383e('0x1e')](respondWithResult(_0x5cb6b5,null))[_0x383e('0x3c')](handleError(_0x5cb6b5,null));}; \ No newline at end of file +var _0xd6d5=['sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','destroy','then','end','error','stack','name','send','index','VoiceAgentReport','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util'];(function(_0x44f892,_0x3865cb){var _0xb81382=function(_0x2d02b7){while(--_0x2d02b7){_0x44f892['push'](_0x44f892['shift']());}};_0xb81382(++_0x3865cb);}(_0xd6d5,0xd7));var _0x5d6d=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0xd6d5[_0xf4666e];return _0x1853f1;};'use strict';var pdf=require(_0x5d6d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5d6d('0x1'));var zipdir=require(_0x5d6d('0x2'));var jsonpatch=require(_0x5d6d('0x3'));var rp=require('request-promise');var moment=require(_0x5d6d('0x4'));var BPromise=require(_0x5d6d('0x5'));var Mustache=require('mustache');var util=require(_0x5d6d('0x6'));var path=require('path');var sox=require(_0x5d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x5d6d('0x8'));var fs=require('fs');var _=require(_0x5d6d('0x9'));var squel=require(_0x5d6d('0xa'));var crypto=require(_0x5d6d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d6d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5d6d('0xd'));var Papa=require(_0x5d6d('0xe'));var Redis=require(_0x5d6d('0xf'));var authService=require(_0x5d6d('0x10'));var qs=require(_0x5d6d('0x11'));var hardwareService=require(_0x5d6d('0x12'));var logger=require(_0x5d6d('0x13'))('api');var utils=require(_0x5d6d('0x14'));var config=require('../../config/environment');var db=require(_0x5d6d('0x15'))['db'];function respondWithStatusCode(_0xdcd6bc,_0x59a8d7){_0x59a8d7=_0x59a8d7||0xcc;return function(_0x57c437){if(_0x57c437){return _0xdcd6bc[_0x5d6d('0x16')](_0x59a8d7);}return _0xdcd6bc['status'](_0x59a8d7)['end']();};}function respondWithResult(_0x6c8f36,_0x4adbbe){_0x4adbbe=_0x4adbbe||0xc8;return function(_0x129d30){if(_0x129d30){return _0x6c8f36[_0x5d6d('0x17')](_0x4adbbe)[_0x5d6d('0x18')](_0x129d30);}};}function respondWithFilteredResult(_0x1ab036,_0x1f954e){return function(_0x3a4e4e){if(_0x3a4e4e){var _0x47387a=_0x3a4e4e[_0x5d6d('0x19')],_0x5f5870=_0x1f954e[_0x5d6d('0x1a')],_0x5ca883=_0x1f954e[_0x5d6d('0x1a')]+_0x1f954e[_0x5d6d('0x1b')],_0x54dda3;if(_0x5ca883>=_0x47387a){_0x5ca883=_0x47387a;_0x54dda3=0xc8;}else{_0x54dda3=0xce;}_0x1ab036[_0x5d6d('0x17')](_0x54dda3);return _0x1ab036['set'](_0x5d6d('0x1c'),_0x5f5870+'-'+_0x5ca883+'/'+_0x47387a)[_0x5d6d('0x18')](_0x3a4e4e);}return null;};}function patchUpdates(_0x57cb0b){return function(_0x382e4f){try{jsonpatch[_0x5d6d('0x1d')](_0x382e4f,_0x57cb0b,!![]);}catch(_0xec0ee6){return BPromise[_0x5d6d('0x1e')](_0xec0ee6);}return _0x382e4f['save']();};}function saveUpdates(_0x3f5c68,_0x1119a5){return function(_0x273b46){if(_0x273b46){return _0x273b46['update'](_0x3f5c68)['then'](function(_0x10bd60){return _0x10bd60;});}return null;};}function removeEntity(_0x203da8,_0x20629f){return function(_0x4cbe79){if(_0x4cbe79){return _0x4cbe79[_0x5d6d('0x1f')]()[_0x5d6d('0x20')](function(){_0x203da8['status'](0xcc)[_0x5d6d('0x21')]();});}};}function handleEntityNotFound(_0x19acdb,_0x1b5d65){return function(_0x9493bf){if(!_0x9493bf){_0x19acdb[_0x5d6d('0x16')](0x194);}return _0x9493bf;};}function handleError(_0x369d55,_0x10ac14){_0x10ac14=_0x10ac14||0x1f4;return function(_0xeec3a3){logger[_0x5d6d('0x22')](_0xeec3a3[_0x5d6d('0x23')]);if(_0xeec3a3[_0x5d6d('0x24')]){delete _0xeec3a3[_0x5d6d('0x24')];}_0x369d55['status'](_0x10ac14)[_0x5d6d('0x25')](_0xeec3a3);};}exports[_0x5d6d('0x26')]=function(_0x3d14c6,_0x11ae6f){var _0x8d03d={},_0x2b1acf={},_0x1c3685={'count':0x0,'rows':[]};var _0x4cdf81=db[_0x5d6d('0x27')]['rawAttributes'];_0x2b1acf['model']=_['keys'](_0x4cdf81);_0x2b1acf['query']=_[_0x5d6d('0x28')](_0x3d14c6[_0x5d6d('0x29')]);_0x2b1acf[_0x5d6d('0x2a')]=_[_0x5d6d('0x2b')](_0x2b1acf[_0x5d6d('0x2c')],_0x2b1acf[_0x5d6d('0x29')]);_0x8d03d[_0x5d6d('0x2d')]=_[_0x5d6d('0x2b')](_0x2b1acf[_0x5d6d('0x2c')],qs[_0x5d6d('0x2e')](_0x3d14c6[_0x5d6d('0x29')][_0x5d6d('0x2e')]));_0x8d03d['attributes']=_0x8d03d[_0x5d6d('0x2d')][_0x5d6d('0x2f')]?_0x8d03d[_0x5d6d('0x2d')]:_0x2b1acf[_0x5d6d('0x2c')];if(!_0x3d14c6[_0x5d6d('0x29')][_0x5d6d('0x30')](_0x5d6d('0x31'))){_0x8d03d[_0x5d6d('0x1b')]=qs['limit'](_0x3d14c6[_0x5d6d('0x29')][_0x5d6d('0x1b')]);_0x8d03d[_0x5d6d('0x1a')]=qs[_0x5d6d('0x1a')](_0x3d14c6[_0x5d6d('0x29')]['offset']);}_0x8d03d[_0x5d6d('0x32')]=qs['sort'](_0x3d14c6[_0x5d6d('0x29')][_0x5d6d('0x33')]);_0x8d03d[_0x5d6d('0x34')]=qs['filters'](_[_0x5d6d('0x35')](_0x3d14c6[_0x5d6d('0x29')],_0x2b1acf[_0x5d6d('0x2a')]));if(_0x3d14c6['query'][_0x5d6d('0x36')]){_0x8d03d['where']=_[_0x5d6d('0x37')](_0x8d03d[_0x5d6d('0x34')],{'$or':_[_0x5d6d('0x38')](_0x4cdf81,function(_0x1db7e2){if(_0x1db7e2[_0x5d6d('0x39')]['key']!==_0x5d6d('0x3a')){var _0x4724ab={};_0x4724ab[_0x1db7e2[_0x5d6d('0x3b')]]={'$like':'%'+_0x3d14c6[_0x5d6d('0x29')][_0x5d6d('0x36')]+'%'};return _0x4724ab;}})});}_0x8d03d=_[_0x5d6d('0x37')]({},_0x8d03d,_0x3d14c6['options']);var _0x551e81={'where':_0x8d03d[_0x5d6d('0x34')]};return db['VoiceAgentReport']['count'](_0x551e81)[_0x5d6d('0x20')](function(_0x243fed){_0x1c3685[_0x5d6d('0x19')]=_0x243fed;if(_0x3d14c6['query']['includeAll']){_0x8d03d[_0x5d6d('0x3c')]=[{'all':!![]}];}return db[_0x5d6d('0x27')][_0x5d6d('0x3d')](_0x8d03d);})['then'](function(_0x2f09e4){_0x1c3685[_0x5d6d('0x3e')]=_0x2f09e4;return _0x1c3685;})[_0x5d6d('0x20')](respondWithFilteredResult(_0x11ae6f,_0x8d03d))[_0x5d6d('0x3f')](handleError(_0x11ae6f,null));};exports[_0x5d6d('0x40')]=function(_0x2bce44,_0x992042){var _0x29249c={'raw':![],'where':{'id':_0x2bce44[_0x5d6d('0x41')]['id']}},_0x1ea1dd={};_0x1ea1dd['model']=_[_0x5d6d('0x28')](db[_0x5d6d('0x27')][_0x5d6d('0x42')]);_0x1ea1dd[_0x5d6d('0x29')]=_[_0x5d6d('0x28')](_0x2bce44[_0x5d6d('0x29')]);_0x1ea1dd['filters']=_[_0x5d6d('0x2b')](_0x1ea1dd[_0x5d6d('0x2c')],_0x1ea1dd[_0x5d6d('0x29')]);_0x29249c[_0x5d6d('0x2d')]=_[_0x5d6d('0x2b')](_0x1ea1dd[_0x5d6d('0x2c')],qs['fields'](_0x2bce44[_0x5d6d('0x29')][_0x5d6d('0x2e')]));_0x29249c[_0x5d6d('0x2d')]=_0x29249c[_0x5d6d('0x2d')][_0x5d6d('0x2f')]?_0x29249c[_0x5d6d('0x2d')]:_0x1ea1dd[_0x5d6d('0x2c')];if(_0x2bce44[_0x5d6d('0x29')][_0x5d6d('0x43')]){_0x29249c[_0x5d6d('0x3c')]=[{'all':!![]}];}_0x29249c=_['merge']({},_0x29249c,_0x2bce44[_0x5d6d('0x44')]);return db[_0x5d6d('0x27')][_0x5d6d('0x45')](_0x29249c)[_0x5d6d('0x20')](handleEntityNotFound(_0x992042,null))[_0x5d6d('0x20')](respondWithResult(_0x992042,null))[_0x5d6d('0x3f')](handleError(_0x992042,null));};exports[_0x5d6d('0x46')]=function(_0x365f3f,_0x236633){return db[_0x5d6d('0x27')][_0x5d6d('0x46')](_0x365f3f[_0x5d6d('0x47')],{})[_0x5d6d('0x20')](respondWithResult(_0x236633,0xc9))['catch'](handleError(_0x236633,null));};exports[_0x5d6d('0x48')]=function(_0x265242,_0x19b56f){if(_0x265242[_0x5d6d('0x47')]['id']){delete _0x265242[_0x5d6d('0x47')]['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x265242[_0x5d6d('0x41')]['id']}})[_0x5d6d('0x20')](handleEntityNotFound(_0x19b56f,null))['then'](saveUpdates(_0x265242[_0x5d6d('0x47')],null))[_0x5d6d('0x20')](respondWithResult(_0x19b56f,null))[_0x5d6d('0x3f')](handleError(_0x19b56f,null));};exports[_0x5d6d('0x1f')]=function(_0x5e8ec1,_0x189ec0){return db['VoiceAgentReport'][_0x5d6d('0x45')]({'where':{'id':_0x5e8ec1[_0x5d6d('0x41')]['id']}})[_0x5d6d('0x20')](handleEntityNotFound(_0x189ec0,null))[_0x5d6d('0x20')](removeEntity(_0x189ec0,null))[_0x5d6d('0x3f')](handleError(_0x189ec0,null));};exports[_0x5d6d('0x49')]=function(_0xaf3e7b,_0xa262f1){return db[_0x5d6d('0x27')][_0x5d6d('0x49')]()[_0x5d6d('0x20')](respondWithResult(_0xa262f1,null))[_0x5d6d('0x3f')](handleError(_0xa262f1,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index f5a21af..4300932 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 _0x56f3=['VoiceAgentReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define'];(function(_0x5f0b26,_0x5407c9){var _0x2b55bf=function(_0x146b01){while(--_0x146b01){_0x5f0b26['push'](_0x5f0b26['shift']());}};_0x2b55bf(++_0x5407c9);}(_0x56f3,0x1ec));var _0x356f=function(_0x2d38ba,_0xd0f026){_0x2d38ba=_0x2d38ba-0x0;var _0x35da5d=_0x56f3[_0x2d38ba];return _0x35da5d;};'use strict';var _=require(_0x356f('0x0'));var util=require(_0x356f('0x1'));var logger=require(_0x356f('0x2'))(_0x356f('0x3'));var moment=require(_0x356f('0x4'));var BPromise=require(_0x356f('0x5'));var rp=require(_0x356f('0x6'));var fs=require('fs');var path=require(_0x356f('0x7'));var rimraf=require(_0x356f('0x8'));var config=require('../../config/environment');var attributes=require(_0x356f('0x9'));module[_0x356f('0xa')]=function(_0x3cf269,_0x349187){return _0x3cf269[_0x356f('0xb')](_0x356f('0xc'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x356f('0xd'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c97=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x9e8dd8,_0x57c0c1){var _0x5db774=function(_0x16b298){while(--_0x16b298){_0x9e8dd8['push'](_0x9e8dd8['shift']());}};_0x5db774(++_0x57c0c1);}(_0x0c97,0x9f));var _0x70c9=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x0c97[_0x4f0e62];return _0x117ab8;};'use strict';var _=require(_0x70c9('0x0'));var util=require(_0x70c9('0x1'));var logger=require(_0x70c9('0x2'))(_0x70c9('0x3'));var moment=require(_0x70c9('0x4'));var BPromise=require('bluebird');var rp=require(_0x70c9('0x5'));var fs=require('fs');var path=require(_0x70c9('0x6'));var rimraf=require(_0x70c9('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x70c9('0x8')]=function(_0x2ff16e,_0x27f87d){return _0x2ff16e['define']('VoiceAgentReport',attributes,{'tableName':_0x70c9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x70c9('0xa'),_0x70c9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 809cba9..ee6fc04 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 _0x9957=['catch','CreateVoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1e54fd,_0x58314b){var _0x3e3d32=function(_0x19916f){while(--_0x19916f){_0x1e54fd['push'](_0x1e54fd['shift']());}};_0x3e3d32(++_0x58314b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['VoiceAgentReport'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3a9b54){logger['info']('CreateVoiceAgentReport',_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x3a9b54));_0x37a7d4(_0x3a9b54);})[_0x7995('0x17')](function(_0x460924){logger[_0x7995('0x13')]('CreateVoiceAgentReport',_0x460924[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x460924[_0x7995('0x15')]));});});};exports[_0x7995('0x1c')]=function(_0x563799){var _0x13bc35=this;return new Promise(function(_0x475351,_0x472195){return db['VoiceAgentReport'][_0x7995('0x1d')](_0x563799[_0x7995('0x1e')],{'raw':_0x563799[_0x7995('0x1a')]?_0x563799[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x563799[_0x7995('0x1a')]?_0x563799['options'][_0x7995('0x1f')]||null:null,'attributes':_0x563799['options']?_0x563799[_0x7995('0x1a')][_0x7995('0x20')]||null:null,'limit':_0x563799[_0x7995('0x1a')]?_0x563799[_0x7995('0x1a')][_0x7995('0x21')]||null:null})['then'](function(_0x9b2a15){logger['info'](_0x7995('0x1c'),_0x563799);logger[_0x7995('0x10')](_0x7995('0x1c'),_0x563799,JSON['stringify'](_0x9b2a15));_0x475351(_0x9b2a15);})['catch'](function(_0x48e573){logger[_0x7995('0x13')](_0x7995('0x1c'),_0x48e573[_0x7995('0x15')],_0x563799);_0x472195(_0x13bc35[_0x7995('0x13')](0x1f4,_0x48e573[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x211d4a,_0x9d4244){var _0x208576=function(_0x24a891){while(--_0x24a891){_0x211d4a['push'](_0x211d4a['shift']());}};_0x208576(++_0x9d4244);}(_0x814b,0x1a2));var _0xb814=function(_0x38080e,_0x95512d){_0x38080e=_0x38080e-0x0;var _0x4e4c87=_0x814b[_0x38080e];return _0x4e4c87;};'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')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index df1726f..dc2d6ab 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 _0xd94f=['/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x15ad95,_0x566009){var _0x439717=function(_0x5b73a1){while(--_0x5b73a1){_0x15ad95['push'](_0x15ad95['shift']());}};_0x439717(++_0x566009);}(_0xd94f,0x113));var _0xfd94=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xd94f[_0x450bf9];return _0x268350;};'use strict';var multer=require(_0xfd94('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfd94('0x1'));var express=require(_0xfd94('0x2'));var router=express['Router']();var auth=require(_0xfd94('0x3'));var interaction=require(_0xfd94('0x4'));var config=require(_0xfd94('0x5'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0xfd94('0x6')](),controller[_0xfd94('0x7')]);router[_0xfd94('0x8')](_0xfd94('0x9'),auth[_0xfd94('0x6')](),controller['describe']);router['get'](_0xfd94('0xa'),auth[_0xfd94('0x6')](),controller[_0xfd94('0xb')]);router[_0xfd94('0xc')]('/',auth['isAuthenticated'](),controller[_0xfd94('0xd')]);router[_0xfd94('0xe')](_0xfd94('0xa'),auth['isAuthenticated'](),controller[_0xfd94('0xf')]);router[_0xfd94('0x10')](_0xfd94('0xa'),auth[_0xfd94('0x6')](),controller[_0xfd94('0x11')]);module[_0xfd94('0x12')]=router; \ No newline at end of file +var _0x4a73=['put','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x390ab8,_0x4d859d){var _0x487fcd=function(_0x49ff9f){while(--_0x49ff9f){_0x390ab8['push'](_0x390ab8['shift']());}};_0x487fcd(++_0x4d859d);}(_0x4a73,0x17e));var _0x34a7=function(_0x589f8d,_0x5ec07a){_0x589f8d=_0x589f8d-0x0;var _0x1beb18=_0x4a73[_0x589f8d];return _0x1beb18;};'use strict';var multer=require(_0x34a7('0x0'));var util=require(_0x34a7('0x1'));var path=require(_0x34a7('0x2'));var timeout=require(_0x34a7('0x3'));var express=require(_0x34a7('0x4'));var router=express[_0x34a7('0x5')]();var auth=require(_0x34a7('0x6'));var interaction=require(_0x34a7('0x7'));var config=require('../../config/environment');var controller=require(_0x34a7('0x8'));router[_0x34a7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x34a7('0xa'),auth[_0x34a7('0xb')](),controller[_0x34a7('0xc')]);router[_0x34a7('0x9')](_0x34a7('0xd'),auth[_0x34a7('0xb')](),controller[_0x34a7('0xe')]);router[_0x34a7('0xf')]('/',auth[_0x34a7('0xb')](),controller[_0x34a7('0x10')]);router[_0x34a7('0x11')](_0x34a7('0xd'),auth[_0x34a7('0xb')](),controller['update']);router['delete'](_0x34a7('0xd'),auth[_0x34a7('0xb')](),controller[_0x34a7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 2682372..cd38749 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 _0x255b=['STRING','DATE','INTEGER','exports','ENUM','internal','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x255b,0x16b));var _0xb255=function(_0x4d4216,_0x3c238d){_0x4d4216=_0x4d4216-0x0;var _0x1062b9=_0x255b[_0x4d4216];return _0x1062b9;};'use strict';var Sequelize=require('sequelize');module[_0xb255('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb255('0x1')]('inbound',_0xb255('0x2'),_0xb255('0x3'),_0xb255('0x4'),_0xb255('0x5'),_0xb255('0x6'))},'tag':{'type':Sequelize[_0xb255('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xb255('0x7')]},'destination':{'type':Sequelize[_0xb255('0x7')]},'destinationcontext':{'type':Sequelize[_0xb255('0x7')]},'callerid':{'type':Sequelize[_0xb255('0x7')]},'channel':{'type':Sequelize[_0xb255('0x7')]},'destinationchannel':{'type':Sequelize[_0xb255('0x7')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xb255('0x8')]},'answertime':{'type':Sequelize[_0xb255('0x8')]},'endtime':{'type':Sequelize[_0xb255('0x8')]},'duration':{'type':Sequelize[_0xb255('0x9')]},'billableseconds':{'type':Sequelize[_0xb255('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb255('0x7')]},'amaflags':{'type':Sequelize[_0xb255('0x7')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xb255('0x7')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb255('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xb255('0x7')]}}; \ No newline at end of file +var _0x75c7=['inbound','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x51963d,_0x140dc0){var _0x275a5b=function(_0x429d0e){while(--_0x429d0e){_0x51963d['push'](_0x51963d['shift']());}};_0x275a5b(++_0x140dc0);}(_0x75c7,0xc4));var _0x775c=function(_0x43452c,_0x35730c){_0x43452c=_0x43452c-0x0;var _0x4b7304=_0x75c7[_0x43452c];return _0x4b7304;};'use strict';var Sequelize=require(_0x775c('0x0'));module[_0x775c('0x1')]={'uniqueid':{'type':Sequelize[_0x775c('0x2')]},'type':{'type':Sequelize[_0x775c('0x3')](_0x775c('0x4'),'internal',_0x775c('0x5'),_0x775c('0x6'),_0x775c('0x7'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x775c('0x2')]},'source':{'type':Sequelize[_0x775c('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x775c('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x775c('0x2')]},'lastapplication':{'type':Sequelize[_0x775c('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x775c('0x8')]},'systemanswertime':{'type':Sequelize[_0x775c('0x8')]},'answertime':{'type':Sequelize[_0x775c('0x8')]},'endtime':{'type':Sequelize[_0x775c('0x8')]},'duration':{'type':Sequelize[_0x775c('0x9')]},'billableseconds':{'type':Sequelize[_0x775c('0x9')]},'mohtime':{'type':Sequelize[_0x775c('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x775c('0x2')]},'amaflags':{'type':Sequelize[_0x775c('0x2')]},'userfield':{'type':Sequelize[_0x775c('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x775c('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x775c('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index edd15d5..576090d 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 _0xe706=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VoiceCallReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','fullname','alias','User','findAll','rows','catch','params','find','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0xe706,0xa3));var _0x6e70=function(_0x4c586e,_0x2571ae){_0x4c586e=_0x4c586e-0x0;var _0x40d9a5=_0xe706[_0x4c586e];return _0x40d9a5;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var hardwareService=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];function respondWithStatusCode(_0x15a1a5,_0x18cf27){_0x18cf27=_0x18cf27||0xcc;return function(_0x27dd9b){if(_0x27dd9b){return _0x15a1a5[_0x6e70('0x1b')](_0x18cf27);}return _0x15a1a5[_0x6e70('0x1c')](_0x18cf27)[_0x6e70('0x1d')]();};}function respondWithResult(_0x181005,_0x5dfbaa){_0x5dfbaa=_0x5dfbaa||0xc8;return function(_0x52737e){if(_0x52737e){return _0x181005['status'](_0x5dfbaa)[_0x6e70('0x1e')](_0x52737e);}};}function respondWithFilteredResult(_0x5a37a6,_0x53aed0){return function(_0x304716){if(_0x304716){var _0x22c50c=_0x304716[_0x6e70('0x1f')],_0x5d9263=_0x53aed0[_0x6e70('0x20')],_0x24f3ac=_0x53aed0['offset']+_0x53aed0['limit'],_0x5c3fe7;if(_0x24f3ac>=_0x22c50c){_0x24f3ac=_0x22c50c;_0x5c3fe7=0xc8;}else{_0x5c3fe7=0xce;}_0x5a37a6[_0x6e70('0x1c')](_0x5c3fe7);return _0x5a37a6['set'](_0x6e70('0x21'),_0x5d9263+'-'+_0x24f3ac+'/'+_0x22c50c)[_0x6e70('0x1e')](_0x304716);}return null;};}function patchUpdates(_0x53acdc){return function(_0x497d61){try{jsonpatch[_0x6e70('0x22')](_0x497d61,_0x53acdc,!![]);}catch(_0x208e21){return BPromise[_0x6e70('0x23')](_0x208e21);}return _0x497d61[_0x6e70('0x24')]();};}function saveUpdates(_0x3af484,_0xcdf9f2){return function(_0x1b2453){if(_0x1b2453){return _0x1b2453[_0x6e70('0x25')](_0x3af484)[_0x6e70('0x26')](function(_0xb29a2a){return _0xb29a2a;});}return null;};}function removeEntity(_0x4a0cfe,_0x228350){return function(_0x344b65){if(_0x344b65){return _0x344b65[_0x6e70('0x27')]()['then'](function(){_0x4a0cfe[_0x6e70('0x1c')](0xcc)[_0x6e70('0x1d')]();});}};}function handleEntityNotFound(_0x3337a6,_0x50da2c){return function(_0x10fc91){if(!_0x10fc91){_0x3337a6['sendStatus'](0x194);}return _0x10fc91;};}function handleError(_0x50aec2,_0x4e97c7){_0x4e97c7=_0x4e97c7||0x1f4;return function(_0x41e352){logger[_0x6e70('0x28')](_0x41e352['stack']);if(_0x41e352[_0x6e70('0x29')]){delete _0x41e352[_0x6e70('0x29')];}_0x50aec2['status'](_0x4e97c7)[_0x6e70('0x2a')](_0x41e352);};}exports[_0x6e70('0x2b')]=function(_0x2bb231,_0x4a67ac){var _0x54a5fe={},_0x2c4d37={},_0x3af17f={'count':0x0,'rows':[]};var _0x83c836=db[_0x6e70('0x2c')][_0x6e70('0x2d')];_0x2c4d37['model']=_[_0x6e70('0x2e')](_0x83c836);_0x2c4d37[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x2bb231[_0x6e70('0x2f')]);_0x2c4d37[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x2c4d37[_0x6e70('0x32')],_0x2c4d37[_0x6e70('0x2f')]);_0x54a5fe[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2c4d37['model'],qs[_0x6e70('0x34')](_0x2bb231['query'][_0x6e70('0x34')]));_0x54a5fe['attributes']=_0x54a5fe[_0x6e70('0x33')][_0x6e70('0x35')]?_0x54a5fe[_0x6e70('0x33')]:_0x2c4d37['model'];if(!_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x36')]('nolimit')){_0x54a5fe[_0x6e70('0x37')]=qs[_0x6e70('0x37')](_0x2bb231['query'][_0x6e70('0x37')]);_0x54a5fe[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x20')]);}_0x54a5fe[_0x6e70('0x38')]=qs[_0x6e70('0x39')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x39')]);_0x54a5fe[_0x6e70('0x3a')]=qs['filters'](_[_0x6e70('0x3b')](_0x2bb231['query'],_0x2c4d37[_0x6e70('0x30')]));if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x3c')]){_0x54a5fe[_0x6e70('0x3a')]=_[_0x6e70('0x3d')](_0x54a5fe[_0x6e70('0x3a')],{'$or':_[_0x6e70('0x3e')](_0x83c836,function(_0xdd0bee){if(_0xdd0bee[_0x6e70('0x3f')][_0x6e70('0x40')]!==_0x6e70('0x41')){var _0x23d5e2={};_0x23d5e2[_0xdd0bee[_0x6e70('0x42')]]={'$like':'%'+_0x2bb231['query']['filter']+'%'};return _0x23d5e2;}})});}_0x54a5fe=_['merge']({},_0x54a5fe,_0x2bb231[_0x6e70('0x43')]);var _0x3841a0={'where':_0x54a5fe[_0x6e70('0x3a')]};return db[_0x6e70('0x2c')][_0x6e70('0x1f')](_0x3841a0)[_0x6e70('0x26')](function(_0x572a71){_0x3af17f[_0x6e70('0x1f')]=_0x572a71;if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x44')]){_0x54a5fe[_0x6e70('0x45')]=[{'attributes':['id',_0x6e70('0x29'),_0x6e70('0x46'),_0x6e70('0x47')],'model':db[_0x6e70('0x48')],'as':'User'}];}return db[_0x6e70('0x2c')][_0x6e70('0x49')](_0x54a5fe);})[_0x6e70('0x26')](function(_0x31cad2){_0x3af17f[_0x6e70('0x4a')]=_0x31cad2;return _0x3af17f;})[_0x6e70('0x26')](respondWithFilteredResult(_0x4a67ac,_0x54a5fe))[_0x6e70('0x4b')](handleError(_0x4a67ac,null));};exports['show']=function(_0x56ea6e,_0x5ae898){var _0x154e0c={'raw':!![],'where':{'id':_0x56ea6e[_0x6e70('0x4c')]['id']}},_0x2b63cc={};_0x2b63cc[_0x6e70('0x32')]=_[_0x6e70('0x2e')](db['VoiceCallReport'][_0x6e70('0x2d')]);_0x2b63cc[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x56ea6e['query']);_0x2b63cc['filters']=_['intersection'](_0x2b63cc[_0x6e70('0x32')],_0x2b63cc['query']);_0x154e0c[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2b63cc[_0x6e70('0x32')],qs[_0x6e70('0x34')](_0x56ea6e['query'][_0x6e70('0x34')]));_0x154e0c['attributes']=_0x154e0c[_0x6e70('0x33')][_0x6e70('0x35')]?_0x154e0c[_0x6e70('0x33')]:_0x2b63cc[_0x6e70('0x32')];if(_0x56ea6e['query'][_0x6e70('0x44')]){_0x154e0c[_0x6e70('0x45')]=[{'all':!![]}];}_0x154e0c=_[_0x6e70('0x3d')]({},_0x154e0c,_0x56ea6e[_0x6e70('0x43')]);return db[_0x6e70('0x2c')][_0x6e70('0x4d')](_0x154e0c)[_0x6e70('0x26')](handleEntityNotFound(_0x5ae898,null))['then'](respondWithResult(_0x5ae898,null))[_0x6e70('0x4b')](handleError(_0x5ae898,null));};exports[_0x6e70('0x4e')]=function(_0x10de2a,_0x2f99cb){return db[_0x6e70('0x2c')][_0x6e70('0x4e')](_0x10de2a[_0x6e70('0x4f')],{})['then'](respondWithResult(_0x2f99cb,0xc9))[_0x6e70('0x4b')](handleError(_0x2f99cb,null));};exports['destroy']=function(_0x11794e,_0x3836e4){return db['VoiceCallReport']['find']({'where':{'id':_0x11794e[_0x6e70('0x4c')]['id']}})[_0x6e70('0x26')](handleEntityNotFound(_0x3836e4,null))[_0x6e70('0x26')](removeEntity(_0x3836e4,null))['catch'](handleError(_0x3836e4,null));};exports['describe']=function(_0x238ebb,_0x11ac3d){return db[_0x6e70('0x2c')][_0x6e70('0x50')]()[_0x6e70('0x26')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['update']=function(_0x756a5b,_0x3aa1a6){if(_0x756a5b[_0x6e70('0x4f')][_0x6e70('0x51')]){delete _0x756a5b[_0x6e70('0x4f')]['uniqueid'];}return db['VoiceCallReport'][_0x6e70('0x4d')]({'where':{'uniqueid':_0x756a5b[_0x6e70('0x4c')]['id'],'UserId':{'$or':[null,_0x756a5b[_0x6e70('0x52')]['id']]}}})[_0x6e70('0x26')](handleEntityNotFound(_0x3aa1a6,null))[_0x6e70('0x26')](saveUpdates(_0x756a5b['body'],null))[_0x6e70('0x26')](respondWithResult(_0x3aa1a6,null))[_0x6e70('0x4b')](handleError(_0x3aa1a6,null));}; \ No newline at end of file +var _0x34e8=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','VoiceCallReport','includeAll','fullname','alias','User','findAll','catch','rawAttributes','length','include','create','body','destroy','find','params','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x8c92a9,_0x2c9570){var _0x57e3e7=function(_0x1d6c16){while(--_0x1d6c16){_0x8c92a9['push'](_0x8c92a9['shift']());}};_0x57e3e7(++_0x2c9570);}(_0x34e8,0x12c));var _0x834e=function(_0x1521b8,_0xf496bc){_0x1521b8=_0x1521b8-0x0;var _0x258b60=_0x34e8[_0x1521b8];return _0x258b60;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)[_0x834e('0x1d')]();});}};}function handleEntityNotFound(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(!_0x1dc1e0){_0x589dde['sendStatus'](0x194);}return _0x1dc1e0;};}function handleError(_0x3bc4f7,_0x2e1983){_0x2e1983=_0x2e1983||0x1f4;return function(_0x338636){logger['error'](_0x338636[_0x834e('0x29')]);if(_0x338636[_0x834e('0x2a')]){delete _0x338636['name'];}_0x3bc4f7['status'](_0x2e1983)[_0x834e('0x2b')](_0x338636);};}exports['index']=function(_0x2826ec,_0x3f1b0b){var _0x3db026={},_0x2cc2eb={},_0x3cd928={'count':0x0,'rows':[]};var _0x130cc5=db['VoiceCallReport']['rawAttributes'];_0x2cc2eb['model']=_['keys'](_0x130cc5);_0x2cc2eb[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x2826ec[_0x834e('0x2c')]);_0x2cc2eb['filters']=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],_0x2cc2eb[_0x834e('0x2c')]);_0x3db026[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],qs[_0x834e('0x31')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x31')]));_0x3db026['attributes']=_0x3db026[_0x834e('0x30')]['length']?_0x3db026[_0x834e('0x30')]:_0x2cc2eb[_0x834e('0x2f')];if(!_0x2826ec[_0x834e('0x2c')][_0x834e('0x32')](_0x834e('0x33'))){_0x3db026[_0x834e('0x34')]=qs[_0x834e('0x34')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x34')]);_0x3db026[_0x834e('0x20')]=qs['offset'](_0x2826ec[_0x834e('0x2c')][_0x834e('0x20')]);}_0x3db026[_0x834e('0x35')]=qs[_0x834e('0x36')](_0x2826ec['query'][_0x834e('0x36')]);_0x3db026[_0x834e('0x37')]=qs['filters'](_['pick'](_0x2826ec['query'],_0x2cc2eb[_0x834e('0x38')]));if(_0x2826ec[_0x834e('0x2c')][_0x834e('0x39')]){_0x3db026[_0x834e('0x37')]=_[_0x834e('0x3a')](_0x3db026[_0x834e('0x37')],{'$or':_['map'](_0x130cc5,function(_0x2c2d94){if(_0x2c2d94['type'][_0x834e('0x3b')]!==_0x834e('0x3c')){var _0x47abed={};_0x47abed[_0x2c2d94[_0x834e('0x3d')]]={'$like':'%'+_0x2826ec[_0x834e('0x2c')]['filter']+'%'};return _0x47abed;}})});}_0x3db026=_['merge']({},_0x3db026,_0x2826ec[_0x834e('0x3e')]);var _0xd0d43a={'where':_0x3db026[_0x834e('0x37')]};return db[_0x834e('0x3f')][_0x834e('0x1f')](_0xd0d43a)['then'](function(_0x1c5ed6){_0x3cd928['count']=_0x1c5ed6;if(_0x2826ec['query'][_0x834e('0x40')]){_0x3db026['include']=[{'attributes':['id',_0x834e('0x2a'),_0x834e('0x41'),_0x834e('0x42')],'model':db[_0x834e('0x43')],'as':_0x834e('0x43')}];}return db['VoiceCallReport'][_0x834e('0x44')](_0x3db026);})[_0x834e('0x28')](function(_0x38f266){_0x3cd928['rows']=_0x38f266;return _0x3cd928;})[_0x834e('0x28')](respondWithFilteredResult(_0x3f1b0b,_0x3db026))[_0x834e('0x45')](handleError(_0x3f1b0b,null));};exports['show']=function(_0x1e3e71,_0x59932f){var _0x2ebfb6={'raw':!![],'where':{'id':_0x1e3e71['params']['id']}},_0x585335={};_0x585335['model']=_[_0x834e('0x2d')](db[_0x834e('0x3f')][_0x834e('0x46')]);_0x585335[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x1e3e71[_0x834e('0x2c')]);_0x585335[_0x834e('0x38')]=_['intersection'](_0x585335[_0x834e('0x2f')],_0x585335['query']);_0x2ebfb6[_0x834e('0x30')]=_['intersection'](_0x585335[_0x834e('0x2f')],qs['fields'](_0x1e3e71[_0x834e('0x2c')][_0x834e('0x31')]));_0x2ebfb6['attributes']=_0x2ebfb6[_0x834e('0x30')][_0x834e('0x47')]?_0x2ebfb6[_0x834e('0x30')]:_0x585335[_0x834e('0x2f')];if(_0x1e3e71[_0x834e('0x2c')][_0x834e('0x40')]){_0x2ebfb6[_0x834e('0x48')]=[{'all':!![]}];}_0x2ebfb6=_[_0x834e('0x3a')]({},_0x2ebfb6,_0x1e3e71[_0x834e('0x3e')]);return db[_0x834e('0x3f')]['find'](_0x2ebfb6)[_0x834e('0x28')](handleEntityNotFound(_0x59932f,null))[_0x834e('0x28')](respondWithResult(_0x59932f,null))['catch'](handleError(_0x59932f,null));};exports[_0x834e('0x49')]=function(_0x42fd90,_0x25b035){return db[_0x834e('0x3f')][_0x834e('0x49')](_0x42fd90[_0x834e('0x4a')],{})['then'](respondWithResult(_0x25b035,0xc9))['catch'](handleError(_0x25b035,null));};exports[_0x834e('0x4b')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x3f')][_0x834e('0x4c')]({'where':{'id':_0x1a5444[_0x834e('0x4d')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x30568e,null))[_0x834e('0x28')](removeEntity(_0x30568e,null))[_0x834e('0x45')](handleError(_0x30568e,null));};exports[_0x834e('0x4e')]=function(_0xf02f0d,_0x385435){return db[_0x834e('0x3f')][_0x834e('0x4e')]()[_0x834e('0x28')](respondWithResult(_0x385435,null))[_0x834e('0x45')](handleError(_0x385435,null));};exports[_0x834e('0x27')]=function(_0x32b8f7,_0x420841){if(_0x32b8f7[_0x834e('0x4a')]['uniqueid']){delete _0x32b8f7[_0x834e('0x4a')][_0x834e('0x4f')];}return db['VoiceCallReport'][_0x834e('0x4c')]({'where':{'uniqueid':_0x32b8f7[_0x834e('0x4d')]['id'],'UserId':{'$or':[null,_0x32b8f7['user']['id']]}}})[_0x834e('0x28')](handleEntityNotFound(_0x420841,null))[_0x834e('0x28')](saveUpdates(_0x32b8f7[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x420841,null))[_0x834e('0x45')](handleError(_0x420841,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a3c78b6..b15a75c 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 _0x8307=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','define','uniqueid'];(function(_0x25d4ee,_0xc95872){var _0x214a35=function(_0x4285a0){while(--_0x4285a0){_0x25d4ee['push'](_0x25d4ee['shift']());}};_0x214a35(++_0xc95872);}(_0x8307,0x78));var _0x7830=function(_0x21141c,_0xed9815){_0x21141c=_0x21141c-0x0;var _0x2addaf=_0x8307[_0x21141c];return _0x2addaf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7830('0x0'))(_0x7830('0x1'));var moment=require(_0x7830('0x2'));var BPromise=require(_0x7830('0x3'));var rp=require(_0x7830('0x4'));var fs=require('fs');var path=require(_0x7830('0x5'));var rimraf=require('rimraf');var config=require(_0x7830('0x6'));var attributes=require(_0x7830('0x7'));module['exports']=function(_0x3564cf,_0x5f1354){return _0x3564cf[_0x7830('0x8')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x7830('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57e1=['bluebird','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','api'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0x57e1,0x1d1));var _0x157e=function(_0xc1ede1,_0x27c567){_0xc1ede1=_0xc1ede1-0x0;var _0x36f293=_0x57e1[_0xc1ede1];return _0x36f293;};'use strict';var _=require('lodash');var util=require(_0x157e('0x0'));var logger=require(_0x157e('0x1'))(_0x157e('0x2'));var moment=require('moment');var BPromise=require(_0x157e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x157e('0x4'));var rimraf=require('rimraf');var config=require(_0x157e('0x5'));var attributes=require(_0x157e('0x6'));module[_0x157e('0x7')]=function(_0x115a3b,_0xecd9b6){return _0x115a3b[_0x157e('0x8')](_0x157e('0x9'),attributes,{'tableName':_0x157e('0xa'),'paranoid':![],'indexes':[{'fields':[_0x157e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index dd2301c..56f967a 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 _0x6005=['error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','CreateVoiceCallReport','create','UpdateVoiceCallReport','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0xbe3847,_0x1396cb){var _0x1cd899=function(_0x93fc9b){while(--_0x93fc9b){_0xbe3847['push'](_0xbe3847['shift']());}};_0x1cd899(++_0x1396cb);}(_0x6005,0x15d));var _0x5600=function(_0x1079f3,_0x283161){_0x1079f3=_0x1079f3-0x0;var _0x17f7b9=_0x6005[_0x1079f3];return _0x17f7b9;};'use strict';var _=require(_0x5600('0x0'));var util=require(_0x5600('0x1'));var moment=require(_0x5600('0x2'));var BPromise=require(_0x5600('0x3'));var rs=require(_0x5600('0x4'));var fs=require('fs');var Redis=require(_0x5600('0x5'));var db=require(_0x5600('0x6'))['db'];var utils=require(_0x5600('0x7'));var logger=require(_0x5600('0x8'))(_0x5600('0x9'));var config=require(_0x5600('0xa'));var jayson=require(_0x5600('0xb'));var client=jayson[_0x5600('0xc')][_0x5600('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x59dab2,_0x1cc84b,_0x14ea4c){return new BPromise(function(_0x29b5f8,_0x36cdf5){return client[_0x5600('0xe')](_0x59dab2,_0x14ea4c)[_0x5600('0xf')](function(_0x947b23){logger[_0x5600('0x10')](_0x5600('0x11'),_0x1cc84b,_0x5600('0x12'));logger['debug'](_0x5600('0x13'),_0x1cc84b,_0x5600('0x12'),JSON['stringify'](_0x947b23));if(_0x947b23[_0x5600('0x14')]){if(_0x947b23['error'][_0x5600('0x15')]===0x1f4){logger[_0x5600('0x14')](_0x5600('0x11'),_0x1cc84b,_0x947b23['error'][_0x5600('0x16')]);return _0x36cdf5(_0x947b23[_0x5600('0x14')][_0x5600('0x16')]);}logger[_0x5600('0x14')](_0x5600('0x11'),_0x1cc84b,_0x947b23[_0x5600('0x14')]['message']);return _0x29b5f8(_0x947b23['error'][_0x5600('0x16')]);}else{logger[_0x5600('0x10')](_0x5600('0x11'),_0x1cc84b,_0x5600('0x12'));_0x29b5f8(_0x947b23['result']['message']);}})[_0x5600('0x17')](function(_0x4d010b){logger[_0x5600('0x14')](_0x5600('0x11'),_0x1cc84b,_0x4d010b);_0x36cdf5(_0x4d010b);});});}exports[_0x5600('0x18')]=function(_0x4a44c2){var _0x7a49f2=this;return new Promise(function(_0x3be4ba,_0x43fa0a){return db[_0x5600('0x19')][_0x5600('0x1a')]({'raw':_0x4a44c2['options']?_0x4a44c2[_0x5600('0x1b')][_0x5600('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a44c2['options']?_0x4a44c2[_0x5600('0x1b')]['where']||null:null,'attributes':_0x4a44c2[_0x5600('0x1b')]?_0x4a44c2['options'][_0x5600('0x1d')]||null:null,'limit':_0x4a44c2['options']?_0x4a44c2[_0x5600('0x1b')][_0x5600('0x1e')]||null:null,'include':_0x4a44c2['options']?_0x4a44c2[_0x5600('0x1b')][_0x5600('0x1f')]?_[_0x5600('0x20')](_0x4a44c2[_0x5600('0x1b')][_0x5600('0x1f')],function(_0x3c2d71){return{'model':db[_0x3c2d71[_0x5600('0x21')]],'as':_0x3c2d71['as'],'attributes':_0x3c2d71[_0x5600('0x1d')],'include':_0x3c2d71[_0x5600('0x1f')]?_[_0x5600('0x20')](_0x3c2d71[_0x5600('0x1f')],function(_0x52cb48){return{'model':db[_0x52cb48['model']],'as':_0x52cb48['as'],'attributes':_0x52cb48[_0x5600('0x1d')],'include':_0x52cb48[_0x5600('0x1f')]?_[_0x5600('0x20')](_0x52cb48['include'],function(_0x4ec38b){return{'model':db[_0x4ec38b[_0x5600('0x21')]],'as':_0x4ec38b['as'],'attributes':_0x4ec38b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5600('0xf')](function(_0x5bd60b){logger['info'](_0x5600('0x18'),_0x4a44c2);logger[_0x5600('0x22')]('GetVoiceCallReport',_0x4a44c2,JSON[_0x5600('0x23')](_0x5bd60b));_0x3be4ba(_0x5bd60b);})[_0x5600('0x17')](function(_0x409564){logger['error'](_0x5600('0x18'),_0x409564[_0x5600('0x16')],_0x4a44c2);_0x43fa0a(_0x7a49f2[_0x5600('0x14')](0x1f4,_0x409564['message']));});});};exports[_0x5600('0x24')]=function(_0x3ddc05){var _0xf4ca12=this;return new Promise(function(_0x3eadf3,_0x3d29cd){return db[_0x5600('0x19')][_0x5600('0x25')](_0x3ddc05['body'],{'raw':_0x3ddc05[_0x5600('0x1b')]?_0x3ddc05[_0x5600('0x1b')][_0x5600('0x1c')]===undefined?!![]:![]:!![]})[_0x5600('0xf')](function(_0x24f089){logger[_0x5600('0x10')]('CreateVoiceCallReport',_0x3ddc05);logger['debug']('CreateVoiceCallReport',_0x3ddc05,JSON[_0x5600('0x23')](_0x24f089));_0x3eadf3(_0x24f089);})['catch'](function(_0xfe2993){logger[_0x5600('0x14')](_0x5600('0x24'),_0xfe2993[_0x5600('0x16')],_0x3ddc05);_0x3d29cd(_0xf4ca12[_0x5600('0x14')](0x1f4,_0xfe2993[_0x5600('0x16')]));});});};exports[_0x5600('0x26')]=function(_0x1f44be){var _0x16b80b=this;return new Promise(function(_0x22f86c,_0x37d28e){return db['VoiceCallReport']['update'](_0x1f44be[_0x5600('0x27')],{'raw':_0x1f44be['options']?_0x1f44be[_0x5600('0x1b')][_0x5600('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f44be[_0x5600('0x1b')]?_0x1f44be['options'][_0x5600('0x28')]||null:null,'attributes':_0x1f44be[_0x5600('0x1b')]?_0x1f44be[_0x5600('0x1b')][_0x5600('0x1d')]||null:null,'limit':_0x1f44be[_0x5600('0x1b')]?_0x1f44be[_0x5600('0x1b')][_0x5600('0x1e')]||null:null})[_0x5600('0xf')](function(_0x3ca24a){logger[_0x5600('0x10')](_0x5600('0x26'),_0x1f44be);logger[_0x5600('0x22')](_0x5600('0x26'),_0x1f44be,JSON[_0x5600('0x23')](_0x3ca24a));_0x22f86c(_0x3ca24a);})[_0x5600('0x17')](function(_0x622343){logger['error'](_0x5600('0x26'),_0x622343['message'],_0x1f44be);_0x37d28e(_0x16b80b[_0x5600('0x14')](0x1f4,_0x622343[_0x5600('0x16')]));});});}; \ No newline at end of file +var _0x3bd5=['GetVoiceCallReport','findAll','options','where','limit','include','map','model','attributes','debug','CreateVoiceCallReport','VoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x3bd5,0x19d));var _0x53bd=function(_0xa318b6,_0x478b01){_0xa318b6=_0xa318b6-0x0;var _0x24d096=_0x3bd5[_0xa318b6];return _0x24d096;};'use strict';var _=require(_0x53bd('0x0'));var util=require(_0x53bd('0x1'));var moment=require(_0x53bd('0x2'));var BPromise=require(_0x53bd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53bd('0x4'));var logger=require(_0x53bd('0x5'))(_0x53bd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x53bd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a21e6,_0x7d3ac1,_0x484715){return new BPromise(function(_0xbf7e7d,_0x1f3bb1){return client[_0x53bd('0x8')](_0x1a21e6,_0x484715)[_0x53bd('0x9')](function(_0x446778){logger[_0x53bd('0xa')](_0x53bd('0xb'),_0x7d3ac1,_0x53bd('0xc'));logger['debug'](_0x53bd('0xd'),_0x7d3ac1,_0x53bd('0xc'),JSON[_0x53bd('0xe')](_0x446778));if(_0x446778[_0x53bd('0xf')]){if(_0x446778[_0x53bd('0xf')][_0x53bd('0x10')]===0x1f4){logger[_0x53bd('0xf')](_0x53bd('0xb'),_0x7d3ac1,_0x446778[_0x53bd('0xf')]['message']);return _0x1f3bb1(_0x446778['error'][_0x53bd('0x11')]);}logger[_0x53bd('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x7d3ac1,_0x446778[_0x53bd('0xf')][_0x53bd('0x11')]);return _0xbf7e7d(_0x446778[_0x53bd('0xf')]['message']);}else{logger[_0x53bd('0xa')](_0x53bd('0xb'),_0x7d3ac1,'request\x20sent');_0xbf7e7d(_0x446778['result']['message']);}})[_0x53bd('0x12')](function(_0x5ba89d){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x7d3ac1,_0x5ba89d);_0x1f3bb1(_0x5ba89d);});});}exports[_0x53bd('0x13')]=function(_0xaffb99){var _0x268951=this;return new Promise(function(_0x5689e5,_0x585531){return db['VoiceCallReport'][_0x53bd('0x14')]({'raw':_0xaffb99[_0x53bd('0x15')]?_0xaffb99[_0x53bd('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xaffb99[_0x53bd('0x15')]?_0xaffb99[_0x53bd('0x15')][_0x53bd('0x16')]||null:null,'attributes':_0xaffb99['options']?_0xaffb99[_0x53bd('0x15')]['attributes']||null:null,'limit':_0xaffb99['options']?_0xaffb99[_0x53bd('0x15')][_0x53bd('0x17')]||null:null,'include':_0xaffb99[_0x53bd('0x15')]?_0xaffb99['options'][_0x53bd('0x18')]?_[_0x53bd('0x19')](_0xaffb99[_0x53bd('0x15')][_0x53bd('0x18')],function(_0x3da164){return{'model':db[_0x3da164[_0x53bd('0x1a')]],'as':_0x3da164['as'],'attributes':_0x3da164[_0x53bd('0x1b')],'include':_0x3da164['include']?_['map'](_0x3da164['include'],function(_0x55cb3e){return{'model':db[_0x55cb3e[_0x53bd('0x1a')]],'as':_0x55cb3e['as'],'attributes':_0x55cb3e[_0x53bd('0x1b')],'include':_0x55cb3e[_0x53bd('0x18')]?_[_0x53bd('0x19')](_0x55cb3e[_0x53bd('0x18')],function(_0x1e5940){return{'model':db[_0x1e5940[_0x53bd('0x1a')]],'as':_0x1e5940['as'],'attributes':_0x1e5940[_0x53bd('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2df7df){logger[_0x53bd('0xa')](_0x53bd('0x13'),_0xaffb99);logger[_0x53bd('0x1c')](_0x53bd('0x13'),_0xaffb99,JSON[_0x53bd('0xe')](_0x2df7df));_0x5689e5(_0x2df7df);})['catch'](function(_0x2b9068){logger[_0x53bd('0xf')](_0x53bd('0x13'),_0x2b9068[_0x53bd('0x11')],_0xaffb99);_0x585531(_0x268951['error'](0x1f4,_0x2b9068[_0x53bd('0x11')]));});});};exports[_0x53bd('0x1d')]=function(_0x343fff){var _0x357432=this;return new Promise(function(_0x41ead9,_0x39a3df){return db[_0x53bd('0x1e')][_0x53bd('0x1f')](_0x343fff[_0x53bd('0x20')],{'raw':_0x343fff['options']?_0x343fff['options'][_0x53bd('0x21')]===undefined?!![]:![]:!![]})[_0x53bd('0x9')](function(_0x41947b){logger[_0x53bd('0xa')](_0x53bd('0x1d'),_0x343fff);logger[_0x53bd('0x1c')](_0x53bd('0x1d'),_0x343fff,JSON[_0x53bd('0xe')](_0x41947b));_0x41ead9(_0x41947b);})[_0x53bd('0x12')](function(_0x9b9a1b){logger[_0x53bd('0xf')](_0x53bd('0x1d'),_0x9b9a1b[_0x53bd('0x11')],_0x343fff);_0x39a3df(_0x357432[_0x53bd('0xf')](0x1f4,_0x9b9a1b[_0x53bd('0x11')]));});});};exports[_0x53bd('0x22')]=function(_0x3c781f){var _0x1425cb=this;return new Promise(function(_0x9ca1ce,_0x56fcc0){return db[_0x53bd('0x1e')][_0x53bd('0x23')](_0x3c781f[_0x53bd('0x20')],{'raw':_0x3c781f[_0x53bd('0x15')]?_0x3c781f[_0x53bd('0x15')][_0x53bd('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c781f['options']?_0x3c781f[_0x53bd('0x15')][_0x53bd('0x16')]||null:null,'attributes':_0x3c781f[_0x53bd('0x15')]?_0x3c781f[_0x53bd('0x15')][_0x53bd('0x1b')]||null:null,'limit':_0x3c781f[_0x53bd('0x15')]?_0x3c781f[_0x53bd('0x15')][_0x53bd('0x17')]||null:null})[_0x53bd('0x9')](function(_0x123aab){logger[_0x53bd('0xa')](_0x53bd('0x22'),_0x3c781f);logger[_0x53bd('0x1c')]('UpdateVoiceCallReport',_0x3c781f,JSON['stringify'](_0x123aab));_0x9ca1ce(_0x123aab);})[_0x53bd('0x12')](function(_0x480e40){logger[_0x53bd('0xf')](_0x53bd('0x22'),_0x480e40[_0x53bd('0x11')],_0x3c781f);_0x56fcc0(_0x1425cb['error'](0x1f4,_0x480e40[_0x53bd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index b27ad44..a4b6f2f 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 _0x8630=['post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8630,0xcd));var _0x0863=function(_0x3d37a7,_0x44578a){_0x3d37a7=_0x3d37a7-0x0;var _0x55785b=_0x8630[_0x3d37a7];return _0x55785b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0863('0x0'));var express=require(_0x0863('0x1'));var router=express[_0x0863('0x2')]();var auth=require(_0x0863('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0863('0x4'));var controller=require(_0x0863('0x5'));router[_0x0863('0x6')]('/',auth[_0x0863('0x7')](),controller[_0x0863('0x8')]);router[_0x0863('0x6')](_0x0863('0x9'),auth[_0x0863('0x7')](),controller[_0x0863('0xa')]);router[_0x0863('0xb')]('/',auth['isAuthenticated'](),controller[_0x0863('0xc')]);router[_0x0863('0xd')](_0x0863('0x9'),auth[_0x0863('0x7')](),controller[_0x0863('0xe')]);router[_0x0863('0xf')](_0x0863('0x9'),auth['isAuthenticated'](),controller[_0x0863('0x10')]);module[_0x0863('0x11')]=router; \ No newline at end of file +var _0x1666=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','put','update'];(function(_0x2cd795,_0x482d43){var _0x394611=function(_0x13294b){while(--_0x13294b){_0x2cd795['push'](_0x2cd795['shift']());}};_0x394611(++_0x482d43);}(_0x1666,0x75));var _0x6166=function(_0x551a3e,_0x2d93e7){_0x551a3e=_0x551a3e-0x0;var _0x3fcd5d=_0x1666[_0x551a3e];return _0x3fcd5d;};'use strict';var multer=require(_0x6166('0x0'));var util=require(_0x6166('0x1'));var path=require('path');var timeout=require(_0x6166('0x2'));var express=require(_0x6166('0x3'));var router=express[_0x6166('0x4')]();var auth=require(_0x6166('0x5'));var interaction=require(_0x6166('0x6'));var config=require(_0x6166('0x7'));var controller=require(_0x6166('0x8'));router[_0x6166('0x9')]('/',auth['isAuthenticated'](),controller[_0x6166('0xa')]);router[_0x6166('0x9')](_0x6166('0xb'),auth[_0x6166('0xc')](),controller[_0x6166('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6166('0xe')]('/:id',auth[_0x6166('0xc')](),controller[_0x6166('0xf')]);router[_0x6166('0x10')](_0x6166('0xb'),auth[_0x6166('0xc')](),controller[_0x6166('0x11')]);module[_0x6166('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 24c8462..c6744b6 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 _0x4600=['split','BOOLEAN','sequelize','STRING','name','setDataValue','options','getDataValue'];(function(_0x58ef5b,_0xc3c270){var _0x612dff=function(_0x2410d8){while(--_0x2410d8){_0x58ef5b['push'](_0x58ef5b['shift']());}};_0x612dff(++_0xc3c270);}(_0x4600,0x182));var _0x0460=function(_0x183957,_0x8bbe53){_0x183957=_0x183957-0x0;var _0x2fba8f=_0x4600[_0x183957];return _0x2fba8f;};'use strict';var Sequelize=require(_0x0460('0x0'));module['exports']={'name':{'type':Sequelize[_0x0460('0x1')]},'prefix':{'type':Sequelize[_0x0460('0x1')],'unique':_0x0460('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x0460('0x1')],'set':function(_0x137944){this[_0x0460('0x3')](_0x0460('0x4'),_0x137944?_0x137944['join'](''):[]);},'get':function(){return this[_0x0460('0x5')](_0x0460('0x4'))?this['getDataValue'](_0x0460('0x4'))[_0x0460('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x0460('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7221=['BOOLEAN','exports','STRING','options','join','getDataValue'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7221,0x1e1));var _0x1722=function(_0x93a57f,_0x40bc5f){_0x93a57f=_0x93a57f-0x0;var _0x1c8ec5=_0x7221[_0x93a57f];return _0x1c8ec5;};'use strict';var Sequelize=require('sequelize');module[_0x1722('0x0')]={'name':{'type':Sequelize[_0x1722('0x1')]},'prefix':{'type':Sequelize[_0x1722('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1722('0x1')],'set':function(_0x2f1575){this['setDataValue'](_0x1722('0x2'),_0x2f1575?_0x2f1575[_0x1722('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0x1722('0x2'))?this[_0x1722('0x4')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x1722('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0x1722('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1722('0x1')]},'description':{'type':Sequelize[_0x1722('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index a4717ff..a4e4f43 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 _0x002a=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','reject','save','then','destroy','get','UserProfileResource','stack','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','VoiceChanSpy','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x158d9a,_0x2b2ab9){var _0x1370a8=function(_0x133189){while(--_0x133189){_0x158d9a['push'](_0x158d9a['shift']());}};_0x1370a8(++_0x2b2ab9);}(_0x002a,0xe9));var _0xa002=function(_0x269d1d,_0x2315ea){_0x269d1d=_0x269d1d-0x0;var _0x2e6d29=_0x002a[_0x269d1d];return _0x2e6d29;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa002('0x0'));var rimraf=require(_0xa002('0x1'));var zipdir=require(_0xa002('0x2'));var jsonpatch=require(_0xa002('0x3'));var rp=require(_0xa002('0x4'));var moment=require(_0xa002('0x5'));var BPromise=require(_0xa002('0x6'));var Mustache=require(_0xa002('0x7'));var util=require(_0xa002('0x8'));var path=require(_0xa002('0x9'));var sox=require(_0xa002('0xa'));var csv=require(_0xa002('0xb'));var ejs=require(_0xa002('0xc'));var fs=require('fs');var _=require(_0xa002('0xd'));var squel=require('squel');var crypto=require(_0xa002('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa002('0xf'));var toCsv=require(_0xa002('0xb'));var querystring=require(_0xa002('0x10'));var Papa=require(_0xa002('0x11'));var Redis=require(_0xa002('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa002('0x13'));var hardwareService=require(_0xa002('0x14'));var logger=require(_0xa002('0x15'))(_0xa002('0x16'));var utils=require(_0xa002('0x17'));var config=require(_0xa002('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55e0e9,_0x427a35){_0x427a35=_0x427a35||0xcc;return function(_0x158a00){if(_0x158a00){return _0x55e0e9[_0xa002('0x19')](_0x427a35);}return _0x55e0e9[_0xa002('0x1a')](_0x427a35)[_0xa002('0x1b')]();};}function respondWithResult(_0x517a08,_0xf9c65f){_0xf9c65f=_0xf9c65f||0xc8;return function(_0x36d133){if(_0x36d133){return _0x517a08[_0xa002('0x1a')](_0xf9c65f)[_0xa002('0x1c')](_0x36d133);}};}function respondWithFilteredResult(_0x121931,_0x524eee){return function(_0x34202e){if(_0x34202e){var _0x119491=_0x34202e[_0xa002('0x1d')],_0x325b4a=_0x524eee[_0xa002('0x1e')],_0x194153=_0x524eee[_0xa002('0x1e')]+_0x524eee[_0xa002('0x1f')],_0xb35087;if(_0x194153>=_0x119491){_0x194153=_0x119491;_0xb35087=0xc8;}else{_0xb35087=0xce;}_0x121931[_0xa002('0x1a')](_0xb35087);return _0x121931[_0xa002('0x20')]('Content-Range',_0x325b4a+'-'+_0x194153+'/'+_0x119491)[_0xa002('0x1c')](_0x34202e);}return null;};}function patchUpdates(_0x288f53){return function(_0x15e5a9){try{jsonpatch['apply'](_0x15e5a9,_0x288f53,!![]);}catch(_0x4ef1b3){return BPromise[_0xa002('0x21')](_0x4ef1b3);}return _0x15e5a9[_0xa002('0x22')]();};}function saveUpdates(_0x518c63,_0x311ca9){return function(_0x1156c9){if(_0x1156c9){return _0x1156c9['update'](_0x518c63)[_0xa002('0x23')](function(_0x2d05b1){return _0x2d05b1;});}return null;};}function removeEntity(_0x583ead,_0xa4b60f){return function(_0x4b4c16){if(_0x4b4c16){return _0x4b4c16[_0xa002('0x24')]()[_0xa002('0x23')](function(){var _0x24f37b=_0x4b4c16[_0xa002('0x25')]({'plain':!![]});var _0x1c12fb='ChanSpies';return db[_0xa002('0x26')][_0xa002('0x24')]({'where':{'type':_0x1c12fb,'resourceId':_0x24f37b['id']}})['then'](function(){return _0x4b4c16;});})[_0xa002('0x23')](function(){_0x583ead['status'](0xcc)[_0xa002('0x1b')]();});}};}function handleEntityNotFound(_0x3bc17a,_0x534741){return function(_0xdacb2b){if(!_0xdacb2b){_0x3bc17a[_0xa002('0x19')](0x194);}return _0xdacb2b;};}function handleError(_0x44cc02,_0x395feb){_0x395feb=_0x395feb||0x1f4;return function(_0xd43c67){logger['error'](_0xd43c67[_0xa002('0x27')]);if(_0xd43c67['name']){delete _0xd43c67[_0xa002('0x28')];}_0x44cc02[_0xa002('0x1a')](_0x395feb)['send'](_0xd43c67);};}exports['index']=function(_0x2096d2,_0x152cc6){var _0x384bbd={},_0x5c2298={},_0x51ab06={'count':0x0,'rows':[]};var _0x16e09e=db['VoiceChanSpy'][_0xa002('0x29')];_0x5c2298[_0xa002('0x2a')]=_['keys'](_0x16e09e);_0x5c2298['query']=_[_0xa002('0x2b')](_0x2096d2[_0xa002('0x2c')]);_0x5c2298[_0xa002('0x2d')]=_[_0xa002('0x2e')](_0x5c2298[_0xa002('0x2a')],_0x5c2298[_0xa002('0x2c')]);_0x384bbd['attributes']=_[_0xa002('0x2e')](_0x5c2298['model'],qs['fields'](_0x2096d2[_0xa002('0x2c')][_0xa002('0x2f')]));_0x384bbd[_0xa002('0x30')]=_0x384bbd[_0xa002('0x30')][_0xa002('0x31')]?_0x384bbd[_0xa002('0x30')]:_0x5c2298[_0xa002('0x2a')];if(!_0x2096d2['query'][_0xa002('0x32')](_0xa002('0x33'))){_0x384bbd['limit']=qs[_0xa002('0x1f')](_0x2096d2['query']['limit']);_0x384bbd[_0xa002('0x1e')]=qs[_0xa002('0x1e')](_0x2096d2[_0xa002('0x2c')][_0xa002('0x1e')]);}_0x384bbd[_0xa002('0x34')]=qs[_0xa002('0x35')](_0x2096d2[_0xa002('0x2c')]['sort']);_0x384bbd['where']=qs[_0xa002('0x2d')](_[_0xa002('0x36')](_0x2096d2['query'],_0x5c2298[_0xa002('0x2d')]));if(_0x2096d2[_0xa002('0x2c')][_0xa002('0x37')]){_0x384bbd[_0xa002('0x38')]=_[_0xa002('0x39')](_0x384bbd[_0xa002('0x38')],{'$or':_['map'](_0x16e09e,function(_0x11a88f){if(_0x11a88f[_0xa002('0x3a')][_0xa002('0x3b')]!==_0xa002('0x3c')){var _0x2d8221={};_0x2d8221[_0x11a88f[_0xa002('0x3d')]]={'$like':'%'+_0x2096d2['query'][_0xa002('0x37')]+'%'};return _0x2d8221;}})});}_0x384bbd=_[_0xa002('0x39')]({},_0x384bbd,_0x2096d2[_0xa002('0x3e')]);var _0x130846={'where':_0x384bbd[_0xa002('0x38')]};return db['VoiceChanSpy'][_0xa002('0x1d')](_0x130846)['then'](function(_0x365366){_0x51ab06[_0xa002('0x1d')]=_0x365366;if(_0x2096d2['query'][_0xa002('0x3f')]){_0x384bbd['include']=[{'all':!![]}];}return db[_0xa002('0x40')][_0xa002('0x41')](_0x384bbd);})[_0xa002('0x23')](function(_0x85897d){_0x51ab06[_0xa002('0x42')]=_0x85897d;return _0x51ab06;})[_0xa002('0x23')](respondWithFilteredResult(_0x152cc6,_0x384bbd))[_0xa002('0x43')](handleError(_0x152cc6,null));};exports[_0xa002('0x44')]=function(_0x446bfa,_0x13a6f0){var _0x8fd635={'raw':![],'where':{'id':_0x446bfa['params']['id']}},_0x54cf9a={};_0x54cf9a[_0xa002('0x2a')]=_[_0xa002('0x2b')](db[_0xa002('0x40')][_0xa002('0x29')]);_0x54cf9a[_0xa002('0x2c')]=_[_0xa002('0x2b')](_0x446bfa[_0xa002('0x2c')]);_0x54cf9a[_0xa002('0x2d')]=_[_0xa002('0x2e')](_0x54cf9a[_0xa002('0x2a')],_0x54cf9a[_0xa002('0x2c')]);_0x8fd635['attributes']=_[_0xa002('0x2e')](_0x54cf9a[_0xa002('0x2a')],qs[_0xa002('0x2f')](_0x446bfa[_0xa002('0x2c')]['fields']));_0x8fd635[_0xa002('0x30')]=_0x8fd635[_0xa002('0x30')][_0xa002('0x31')]?_0x8fd635[_0xa002('0x30')]:_0x54cf9a[_0xa002('0x2a')];if(_0x446bfa[_0xa002('0x2c')][_0xa002('0x3f')]){_0x8fd635[_0xa002('0x45')]=[{'all':!![]}];}_0x8fd635=_[_0xa002('0x39')]({},_0x8fd635,_0x446bfa['options']);return db[_0xa002('0x40')][_0xa002('0x46')](_0x8fd635)[_0xa002('0x23')](handleEntityNotFound(_0x13a6f0,null))[_0xa002('0x23')](respondWithResult(_0x13a6f0,null))[_0xa002('0x43')](handleError(_0x13a6f0,null));};exports[_0xa002('0x47')]=function(_0x558184,_0x3df237){return db[_0xa002('0x40')][_0xa002('0x47')](_0x558184[_0xa002('0x48')],{})[_0xa002('0x23')](function(_0x2c0844){var _0x3ec2f8=_0x558184[_0xa002('0x49')][_0xa002('0x25')]({'plain':!![]});if(!_0x3ec2f8)throw new Error(_0xa002('0x4a'));if(_0x3ec2f8[_0xa002('0x4b')]===_0xa002('0x49')){var _0xeda101=_0x2c0844[_0xa002('0x25')]({'plain':!![]});var _0x455c66=_0xa002('0x4c');return db[_0xa002('0x4d')][_0xa002('0x46')]({'where':{'name':_0x455c66,'userProfileId':_0x3ec2f8[_0xa002('0x4e')]},'raw':!![]})[_0xa002('0x23')](function(_0xa8ace){if(_0xa8ace&&_0xa8ace[_0xa002('0x4f')]===0x0){return db[_0xa002('0x26')][_0xa002('0x47')]({'name':_0xeda101[_0xa002('0x28')],'resourceId':_0xeda101['id'],'type':_0xa8ace[_0xa002('0x28')],'sectionId':_0xa8ace['id']},{})[_0xa002('0x23')](function(){return _0x2c0844;});}else{return _0x2c0844;}})[_0xa002('0x43')](function(_0x34d61e){logger[_0xa002('0x50')](_0xa002('0x51'),_0x34d61e);throw _0x34d61e;});}return _0x2c0844;})['then'](respondWithResult(_0x3df237,0xc9))[_0xa002('0x43')](handleError(_0x3df237,null));};exports[_0xa002('0x52')]=function(_0x30c842,_0x2e8776){if(_0x30c842[_0xa002('0x48')]['id']){delete _0x30c842[_0xa002('0x48')]['id'];}return db[_0xa002('0x40')]['find']({'where':{'id':_0x30c842[_0xa002('0x53')]['id']}})['then'](handleEntityNotFound(_0x2e8776,null))[_0xa002('0x23')](saveUpdates(_0x30c842[_0xa002('0x48')],null))['then'](respondWithResult(_0x2e8776,null))[_0xa002('0x43')](handleError(_0x2e8776,null));};exports[_0xa002('0x24')]=function(_0x5e08fe,_0x380cf6){return db['VoiceChanSpy'][_0xa002('0x46')]({'where':{'id':_0x5e08fe[_0xa002('0x53')]['id']}})['then'](handleEntityNotFound(_0x380cf6,null))[_0xa002('0x23')](removeEntity(_0x380cf6,null))['catch'](handleError(_0x380cf6,null));}; \ No newline at end of file +var _0x6eea=['merge','key','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6eea,0xae));var _0xa6ee=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x6eea[_0x511bd1];return _0x4c48ec;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa6ee('0x0'));var rimraf=require(_0xa6ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6ee('0x2'));var rp=require(_0xa6ee('0x3'));var moment=require(_0xa6ee('0x4'));var BPromise=require(_0xa6ee('0x5'));var Mustache=require(_0xa6ee('0x6'));var util=require(_0xa6ee('0x7'));var path=require(_0xa6ee('0x8'));var sox=require(_0xa6ee('0x9'));var csv=require('to-csv');var ejs=require(_0xa6ee('0xa'));var fs=require('fs');var _=require(_0xa6ee('0xb'));var squel=require(_0xa6ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa6ee('0xd'));var deskjs=require(_0xa6ee('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa6ee('0xf'));var Papa=require(_0xa6ee('0x10'));var Redis=require(_0xa6ee('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa6ee('0x12'));var logger=require(_0xa6ee('0x13'))('api');var utils=require(_0xa6ee('0x14'));var config=require(_0xa6ee('0x15'));var db=require(_0xa6ee('0x16'))['db'];function respondWithStatusCode(_0x2465de,_0x4e252a){_0x4e252a=_0x4e252a||0xcc;return function(_0x4f8232){if(_0x4f8232){return _0x2465de[_0xa6ee('0x17')](_0x4e252a);}return _0x2465de['status'](_0x4e252a)[_0xa6ee('0x18')]();};}function respondWithResult(_0x4e5410,_0x41cf21){_0x41cf21=_0x41cf21||0xc8;return function(_0x1d6629){if(_0x1d6629){return _0x4e5410[_0xa6ee('0x19')](_0x41cf21)[_0xa6ee('0x1a')](_0x1d6629);}};}function respondWithFilteredResult(_0x306a92,_0x523ce3){return function(_0x49719a){if(_0x49719a){var _0x4ad849=_0x49719a[_0xa6ee('0x1b')],_0x4cbae2=_0x523ce3[_0xa6ee('0x1c')],_0x3070f4=_0x523ce3[_0xa6ee('0x1c')]+_0x523ce3[_0xa6ee('0x1d')],_0x18337d;if(_0x3070f4>=_0x4ad849){_0x3070f4=_0x4ad849;_0x18337d=0xc8;}else{_0x18337d=0xce;}_0x306a92[_0xa6ee('0x19')](_0x18337d);return _0x306a92[_0xa6ee('0x1e')]('Content-Range',_0x4cbae2+'-'+_0x3070f4+'/'+_0x4ad849)[_0xa6ee('0x1a')](_0x49719a);}return null;};}function patchUpdates(_0x80eb8e){return function(_0x7a0196){try{jsonpatch[_0xa6ee('0x1f')](_0x7a0196,_0x80eb8e,!![]);}catch(_0x405cfc){return BPromise['reject'](_0x405cfc);}return _0x7a0196[_0xa6ee('0x20')]();};}function saveUpdates(_0x45a565,_0x3140a9){return function(_0x514654){if(_0x514654){return _0x514654[_0xa6ee('0x21')](_0x45a565)[_0xa6ee('0x22')](function(_0x3d84f9){return _0x3d84f9;});}return null;};}function removeEntity(_0x19f772,_0x4f9dd1){return function(_0x3957d9){if(_0x3957d9){return _0x3957d9[_0xa6ee('0x23')]()[_0xa6ee('0x22')](function(){var _0x360fcd=_0x3957d9[_0xa6ee('0x24')]({'plain':!![]});var _0x19da32=_0xa6ee('0x25');return db[_0xa6ee('0x26')][_0xa6ee('0x23')]({'where':{'type':_0x19da32,'resourceId':_0x360fcd['id']}})['then'](function(){return _0x3957d9;});})[_0xa6ee('0x22')](function(){_0x19f772[_0xa6ee('0x19')](0xcc)[_0xa6ee('0x18')]();});}};}function handleEntityNotFound(_0x44fb0b,_0xb299d9){return function(_0xf4d50b){if(!_0xf4d50b){_0x44fb0b[_0xa6ee('0x17')](0x194);}return _0xf4d50b;};}function handleError(_0x3def5c,_0x294756){_0x294756=_0x294756||0x1f4;return function(_0x5b5818){logger[_0xa6ee('0x27')](_0x5b5818[_0xa6ee('0x28')]);if(_0x5b5818[_0xa6ee('0x29')]){delete _0x5b5818[_0xa6ee('0x29')];}_0x3def5c[_0xa6ee('0x19')](_0x294756)[_0xa6ee('0x2a')](_0x5b5818);};}exports[_0xa6ee('0x2b')]=function(_0x28cd8c,_0x16e866){var _0x55a20f={},_0x4033f5={},_0x1e460b={'count':0x0,'rows':[]};var _0x48c85e=db[_0xa6ee('0x2c')][_0xa6ee('0x2d')];_0x4033f5['model']=_[_0xa6ee('0x2e')](_0x48c85e);_0x4033f5[_0xa6ee('0x2f')]=_[_0xa6ee('0x2e')](_0x28cd8c[_0xa6ee('0x2f')]);_0x4033f5[_0xa6ee('0x30')]=_['intersection'](_0x4033f5['model'],_0x4033f5['query']);_0x55a20f[_0xa6ee('0x31')]=_[_0xa6ee('0x32')](_0x4033f5[_0xa6ee('0x33')],qs[_0xa6ee('0x34')](_0x28cd8c[_0xa6ee('0x2f')]['fields']));_0x55a20f[_0xa6ee('0x31')]=_0x55a20f['attributes'][_0xa6ee('0x35')]?_0x55a20f[_0xa6ee('0x31')]:_0x4033f5[_0xa6ee('0x33')];if(!_0x28cd8c[_0xa6ee('0x2f')][_0xa6ee('0x36')]('nolimit')){_0x55a20f['limit']=qs[_0xa6ee('0x1d')](_0x28cd8c[_0xa6ee('0x2f')][_0xa6ee('0x1d')]);_0x55a20f['offset']=qs[_0xa6ee('0x1c')](_0x28cd8c[_0xa6ee('0x2f')][_0xa6ee('0x1c')]);}_0x55a20f[_0xa6ee('0x37')]=qs[_0xa6ee('0x38')](_0x28cd8c[_0xa6ee('0x2f')][_0xa6ee('0x38')]);_0x55a20f[_0xa6ee('0x39')]=qs[_0xa6ee('0x30')](_[_0xa6ee('0x3a')](_0x28cd8c['query'],_0x4033f5[_0xa6ee('0x30')]));if(_0x28cd8c[_0xa6ee('0x2f')][_0xa6ee('0x3b')]){_0x55a20f[_0xa6ee('0x39')]=_[_0xa6ee('0x3c')](_0x55a20f[_0xa6ee('0x39')],{'$or':_['map'](_0x48c85e,function(_0x429071){if(_0x429071['type'][_0xa6ee('0x3d')]!=='VIRTUAL'){var _0x22bf8e={};_0x22bf8e[_0x429071['field']]={'$like':'%'+_0x28cd8c[_0xa6ee('0x2f')][_0xa6ee('0x3b')]+'%'};return _0x22bf8e;}})});}_0x55a20f=_[_0xa6ee('0x3c')]({},_0x55a20f,_0x28cd8c[_0xa6ee('0x3e')]);var _0x2121bd={'where':_0x55a20f[_0xa6ee('0x39')]};return db[_0xa6ee('0x2c')]['count'](_0x2121bd)[_0xa6ee('0x22')](function(_0x2286bd){_0x1e460b[_0xa6ee('0x1b')]=_0x2286bd;if(_0x28cd8c[_0xa6ee('0x2f')][_0xa6ee('0x3f')]){_0x55a20f[_0xa6ee('0x40')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xa6ee('0x41')](_0x55a20f);})[_0xa6ee('0x22')](function(_0x27cb9a){_0x1e460b[_0xa6ee('0x42')]=_0x27cb9a;return _0x1e460b;})[_0xa6ee('0x22')](respondWithFilteredResult(_0x16e866,_0x55a20f))[_0xa6ee('0x43')](handleError(_0x16e866,null));};exports[_0xa6ee('0x44')]=function(_0x4e1e8a,_0x104b84){var _0x4c91e1={'raw':![],'where':{'id':_0x4e1e8a[_0xa6ee('0x45')]['id']}},_0x2fa943={};_0x2fa943[_0xa6ee('0x33')]=_[_0xa6ee('0x2e')](db[_0xa6ee('0x2c')][_0xa6ee('0x2d')]);_0x2fa943[_0xa6ee('0x2f')]=_['keys'](_0x4e1e8a[_0xa6ee('0x2f')]);_0x2fa943[_0xa6ee('0x30')]=_[_0xa6ee('0x32')](_0x2fa943[_0xa6ee('0x33')],_0x2fa943[_0xa6ee('0x2f')]);_0x4c91e1[_0xa6ee('0x31')]=_[_0xa6ee('0x32')](_0x2fa943[_0xa6ee('0x33')],qs[_0xa6ee('0x34')](_0x4e1e8a[_0xa6ee('0x2f')][_0xa6ee('0x34')]));_0x4c91e1[_0xa6ee('0x31')]=_0x4c91e1['attributes']['length']?_0x4c91e1[_0xa6ee('0x31')]:_0x2fa943[_0xa6ee('0x33')];if(_0x4e1e8a[_0xa6ee('0x2f')][_0xa6ee('0x3f')]){_0x4c91e1[_0xa6ee('0x40')]=[{'all':!![]}];}_0x4c91e1=_[_0xa6ee('0x3c')]({},_0x4c91e1,_0x4e1e8a['options']);return db[_0xa6ee('0x2c')]['find'](_0x4c91e1)[_0xa6ee('0x22')](handleEntityNotFound(_0x104b84,null))['then'](respondWithResult(_0x104b84,null))[_0xa6ee('0x43')](handleError(_0x104b84,null));};exports[_0xa6ee('0x46')]=function(_0x2484bb,_0x27d4e1){return db[_0xa6ee('0x2c')][_0xa6ee('0x46')](_0x2484bb[_0xa6ee('0x47')],{})[_0xa6ee('0x22')](function(_0x2e4d5e){var _0x27e494=_0x2484bb[_0xa6ee('0x48')][_0xa6ee('0x24')]({'plain':!![]});if(!_0x27e494)throw new Error(_0xa6ee('0x49'));if(_0x27e494[_0xa6ee('0x4a')]===_0xa6ee('0x48')){var _0x635b24=_0x2e4d5e[_0xa6ee('0x24')]({'plain':!![]});var _0x556419='ChanSpies';return db[_0xa6ee('0x4b')][_0xa6ee('0x4c')]({'where':{'name':_0x556419,'userProfileId':_0x27e494['userProfileId']},'raw':!![]})[_0xa6ee('0x22')](function(_0x37748a){if(_0x37748a&&_0x37748a['autoAssociation']===0x0){return db[_0xa6ee('0x26')]['create']({'name':_0x635b24['name'],'resourceId':_0x635b24['id'],'type':_0x37748a['name'],'sectionId':_0x37748a['id']},{})[_0xa6ee('0x22')](function(){return _0x2e4d5e;});}else{return _0x2e4d5e;}})['catch'](function(_0x1c3b3){logger[_0xa6ee('0x27')](_0xa6ee('0x4d'),_0x1c3b3);throw _0x1c3b3;});}return _0x2e4d5e;})[_0xa6ee('0x22')](respondWithResult(_0x27d4e1,0xc9))[_0xa6ee('0x43')](handleError(_0x27d4e1,null));};exports[_0xa6ee('0x21')]=function(_0x5bde87,_0x13b324){if(_0x5bde87[_0xa6ee('0x47')]['id']){delete _0x5bde87['body']['id'];}return db[_0xa6ee('0x2c')][_0xa6ee('0x4c')]({'where':{'id':_0x5bde87[_0xa6ee('0x45')]['id']}})[_0xa6ee('0x22')](handleEntityNotFound(_0x13b324,null))[_0xa6ee('0x22')](saveUpdates(_0x5bde87[_0xa6ee('0x47')],null))[_0xa6ee('0x22')](respondWithResult(_0x13b324,null))[_0xa6ee('0x43')](handleError(_0x13b324,null));};exports[_0xa6ee('0x23')]=function(_0x33a6b2,_0x5e5192){return db[_0xa6ee('0x2c')][_0xa6ee('0x4c')]({'where':{'id':_0x33a6b2[_0xa6ee('0x45')]['id']}})[_0xa6ee('0x22')](handleEntityNotFound(_0x5e5192,null))[_0xa6ee('0x22')](removeEntity(_0x5e5192,null))['catch'](handleError(_0x5e5192,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 96ecd16..4a27796 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 _0x634a=['internal','name','User','findAll','agent','catch','exports','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length'];(function(_0x17c8a9,_0x531ca3){var _0x379aa6=function(_0x5ba780){while(--_0x5ba780){_0x17c8a9['push'](_0x17c8a9['shift']());}};_0x379aa6(++_0x531ca3);}(_0x634a,0x17f));var _0xa634=function(_0x594c3a,_0x53cf24){_0x594c3a=_0x594c3a-0x0;var _0x1474f1=_0x634a[_0x594c3a];return _0x1474f1;};'use strict';var _=require(_0xa634('0x0'));var util=require(_0xa634('0x1'));var BPromise=require(_0xa634('0x2'));var attributes=require(_0xa634('0x3'));var getUserApplications=function(_0x11629,_0x10d097,_0x36c510){var _0x155280=0x1;var _0x269ac7=[];var _0x414e1c={'context':_0x10d097[_0xa634('0x4')]||_0xa634('0x5'),'exten':util['format'](_0xa634('0x6'),_0x11629[_0xa634('0x7')],_0x36c510),'type':_0xa634('0x8'),'isApp':![],'ChanSpyId':_0x11629['id'],'UserId':_0x10d097['id']};_0x269ac7['push'](_[_0xa634('0x9')]({'app':_0xa634('0xa'),'appdata':util[_0xa634('0xb')](_0xa634('0xc'),_0xa634('0xd')),'priority':_0x155280++},_0x414e1c));if(_0x11629[_0xa634('0xe')]){_0x269ac7['push'](_[_0xa634('0x9')]({'app':_0xa634('0xf'),'appdata':util[_0xa634('0xb')](_0xa634('0x10'),_0x11629['recordingFormat']),'priority':_0x155280++},_0x414e1c));}if(_0x11629[_0xa634('0x11')]){_0x269ac7[_0xa634('0x12')](_['merge']({'app':_0xa634('0x13'),'appdata':_0x11629[_0xa634('0x14')],'priority':_0x155280++},_0x414e1c));}_0x269ac7[_0xa634('0x12')](_['merge']({'app':_0xa634('0x15'),'appdata':util[_0xa634('0xb')](_0xa634('0x16'),_0x10d097['name'],_0x11629[_0xa634('0x17')]?_0x11629['options'][_0xa634('0x18')](''):''),'priority':_0x155280++},_0x414e1c));if(_0x11629['record']){_0x269ac7[_0xa634('0x12')](_['merge']({'app':_0xa634('0x19'),'priority':_0x155280++},_0x414e1c));}return _0x269ac7;};var getChanSpyApplications=function(_0x284ebe,_0x1ee8f6){var _0x1ff748=[];for(var _0x581077=0x0,_0x34e56d=0x1;_0x581077<_0x1ee8f6[_0xa634('0x1a')];_0x581077++,_0x34e56d=0x1){_0x1ff748=_0x1ff748['concat'](getUserApplications(_0x284ebe,_0x1ee8f6[_0x581077],_0x1ee8f6[_0x581077][_0xa634('0x1b')]));if(_0x1ee8f6[_0x581077]['internal']!=_0x1ee8f6[_0x581077]['name']){_0x1ff748=_0x1ff748['concat'](getUserApplications(_0x284ebe,_0x1ee8f6[_0x581077],_0x1ee8f6[_0x581077][_0xa634('0x1c')]));}}return _0x1ff748;};var getChanSpyPromise=function(_0x3d3d8d,_0x5e0b58){return new BPromise(function(_0x31ef09,_0x3020d9){return _0x3d3d8d[_0xa634('0x1d')][_0xa634('0x1e')]({'attributes':['id',_0xa634('0x1c'),_0xa634('0x1b')],'where':{'role':_0xa634('0x1f'),'chanspy':!![]},'raw':!![]})['then'](function(_0x5b9448){if(_0x5b9448){return _0x31ef09(getChanSpyApplications(_0x5e0b58,_0x5b9448));}return _0x31ef09([]);})[_0xa634('0x20')](function(_0x3b08e3){_0x3020d9(_0x3b08e3);});});};module[_0xa634('0x21')]=function(_0x2c90ea,_0x426910){var _0x3f58eb=_0x2c90ea['models'];return _0x2c90ea[_0xa634('0x22')](_0xa634('0x23'),attributes,{'tableName':_0xa634('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2052d7,_0xa43900,_0x129c9b){return getChanSpyPromise(_0x3f58eb,_0x2052d7)[_0xa634('0x25')](function(_0x440bae){if(_0x440bae&&_0x440bae['length']){return _0x3f58eb[_0xa634('0x26')]['bulkCreate'](_0x440bae);}})['then'](function(){_0x129c9b();})['catch'](function(_0x37a04c){_0x129c9b(_0x37a04c);});},'afterUpdate':function(_0x5d6a32,_0x45a7ee,_0x4d5f67){return _0x3f58eb[_0xa634('0x26')][_0xa634('0x27')]({'where':{'ChanSpyId':_0x5d6a32['id']}})[_0xa634('0x25')](function(){return getChanSpyPromise(_0x3f58eb,_0x5d6a32);})[_0xa634('0x25')](function(_0x53a6ac){if(_0x53a6ac&&_0x53a6ac[_0xa634('0x1a')]){return _0x3f58eb[_0xa634('0x26')][_0xa634('0x28')](_0x53a6ac);}})[_0xa634('0x25')](function(){_0x4d5f67();})[_0xa634('0x20')](function(_0x3fb0b4){_0x4d5f67(_0x3fb0b4);});},'afterDestroy':function(_0x19ed24,_0x39517d,_0x387fab){return _0x3f58eb[_0xa634('0x26')]['destroy']({'where':{'ChanSpyId':_0x19ed24['id']}})[_0xa634('0x25')](function(){_0x387fab();})[_0xa634('0x20')](function(_0x31e1c8){_0x387fab(_0x31e1c8);});}}});}; \ No newline at end of file +var _0x0ab2=['define','VoiceChanSpy','voice_chanspy','bulkCreate','destroy','VoiceExtension','bluebird','context','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch'];(function(_0x4b1643,_0x270da2){var _0x412a67=function(_0xb36e99){while(--_0xb36e99){_0x4b1643['push'](_0x4b1643['shift']());}};_0x412a67(++_0x270da2);}(_0x0ab2,0x92));var _0x20ab=function(_0x5f44e9,_0x9c8700){_0x5f44e9=_0x5f44e9-0x0;var _0x2ff50a=_0x0ab2[_0x5f44e9];return _0x2ff50a;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x20ab('0x0'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x226a0c,_0x1d5bee,_0x4bdd70){var _0x513532=0x1;var _0x2aa2b9=[];var _0x58f8d6={'context':_0x1d5bee[_0x20ab('0x1')]||'from-sip','exten':util[_0x20ab('0x2')](_0x20ab('0x3'),_0x226a0c[_0x20ab('0x4')],_0x4bdd70),'type':_0x20ab('0x5'),'isApp':![],'ChanSpyId':_0x226a0c['id'],'UserId':_0x1d5bee['id']};_0x2aa2b9[_0x20ab('0x6')](_[_0x20ab('0x7')]({'app':_0x20ab('0x8'),'appdata':util[_0x20ab('0x2')](_0x20ab('0x9'),'chanspy'),'priority':_0x513532++},_0x58f8d6));if(_0x226a0c['record']){_0x2aa2b9['push'](_['merge']({'app':_0x20ab('0xa'),'appdata':util[_0x20ab('0x2')](_0x20ab('0xb'),_0x226a0c[_0x20ab('0xc')]),'priority':_0x513532++},_0x58f8d6));}if(_0x226a0c['auth']){_0x2aa2b9[_0x20ab('0x6')](_['merge']({'app':_0x20ab('0xd'),'appdata':_0x226a0c['password'],'priority':_0x513532++},_0x58f8d6));}_0x2aa2b9[_0x20ab('0x6')](_['merge']({'app':_0x20ab('0xe'),'appdata':util[_0x20ab('0x2')](_0x20ab('0xf'),_0x1d5bee[_0x20ab('0x10')],_0x226a0c['options']?_0x226a0c[_0x20ab('0x11')][_0x20ab('0x12')](''):''),'priority':_0x513532++},_0x58f8d6));if(_0x226a0c[_0x20ab('0x13')]){_0x2aa2b9[_0x20ab('0x6')](_['merge']({'app':_0x20ab('0x14'),'priority':_0x513532++},_0x58f8d6));}return _0x2aa2b9;};var getChanSpyApplications=function(_0x305d1e,_0x29f882){var _0x2c550f=[];for(var _0x4d4f90=0x0,_0x241495=0x1;_0x4d4f90<_0x29f882[_0x20ab('0x15')];_0x4d4f90++,_0x241495=0x1){_0x2c550f=_0x2c550f[_0x20ab('0x16')](getUserApplications(_0x305d1e,_0x29f882[_0x4d4f90],_0x29f882[_0x4d4f90][_0x20ab('0x17')]));if(_0x29f882[_0x4d4f90][_0x20ab('0x17')]!=_0x29f882[_0x4d4f90][_0x20ab('0x10')]){_0x2c550f=_0x2c550f['concat'](getUserApplications(_0x305d1e,_0x29f882[_0x4d4f90],_0x29f882[_0x4d4f90]['name']));}}return _0x2c550f;};var getChanSpyPromise=function(_0xa347ce,_0x39bf0e){return new BPromise(function(_0x25f2d6,_0x1d8c48){return _0xa347ce[_0x20ab('0x18')][_0x20ab('0x19')]({'attributes':['id',_0x20ab('0x10'),_0x20ab('0x17')],'where':{'role':_0x20ab('0x1a'),'chanspy':!![]},'raw':!![]})[_0x20ab('0x1b')](function(_0x29ce34){if(_0x29ce34){return _0x25f2d6(getChanSpyApplications(_0x39bf0e,_0x29ce34));}return _0x25f2d6([]);})[_0x20ab('0x1c')](function(_0x4a62f1){_0x1d8c48(_0x4a62f1);});});};module['exports']=function(_0x841053,_0x177de7){var _0x444f89=_0x841053['models'];return _0x841053[_0x20ab('0x1d')](_0x20ab('0x1e'),attributes,{'tableName':_0x20ab('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5931e4,_0x3ebc3d,_0x374d1f){return getChanSpyPromise(_0x444f89,_0x5931e4)[_0x20ab('0x1b')](function(_0x385729){if(_0x385729&&_0x385729[_0x20ab('0x15')]){return _0x444f89['VoiceExtension'][_0x20ab('0x20')](_0x385729);}})['then'](function(){_0x374d1f();})[_0x20ab('0x1c')](function(_0x1dc5bd){_0x374d1f(_0x1dc5bd);});},'afterUpdate':function(_0x278e59,_0x27432a,_0x5331f6){return _0x444f89['VoiceExtension'][_0x20ab('0x21')]({'where':{'ChanSpyId':_0x278e59['id']}})[_0x20ab('0x1b')](function(){return getChanSpyPromise(_0x444f89,_0x278e59);})[_0x20ab('0x1b')](function(_0x4f7873){if(_0x4f7873&&_0x4f7873[_0x20ab('0x15')]){return _0x444f89[_0x20ab('0x22')][_0x20ab('0x20')](_0x4f7873);}})[_0x20ab('0x1b')](function(){_0x5331f6();})[_0x20ab('0x1c')](function(_0x654289){_0x5331f6(_0x654289);});},'afterDestroy':function(_0x726fd5,_0x3b33ae,_0x4d4a79){return _0x444f89[_0x20ab('0x22')][_0x20ab('0x21')]({'where':{'ChanSpyId':_0x726fd5['id']}})['then'](function(){_0x4d4a79();})[_0x20ab('0x1c')](function(_0x247257){_0x4d4a79(_0x247257);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index e354174..74f1287 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 _0xa0bc=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e4001,_0x34fad7){var _0x4cdcc2=function(_0x48a29e){while(--_0x48a29e){_0x2e4001['push'](_0x2e4001['shift']());}};_0x4cdcc2(++_0x34fad7);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var moment=require(_0xca0b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca0b('0x2'));var fs=require('fs');var Redis=require(_0xca0b('0x3'));var db=require(_0xca0b('0x4'))['db'];var utils=require(_0xca0b('0x5'));var logger=require(_0xca0b('0x6'))(_0xca0b('0x7'));var config=require(_0xca0b('0x8'));var jayson=require(_0xca0b('0x9'));var client=jayson[_0xca0b('0xa')][_0xca0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe64c7,_0x30202d,_0xa506a4){return new BPromise(function(_0x19acc2,_0x55a1de){return client[_0xca0b('0xc')](_0xbe64c7,_0xa506a4)[_0xca0b('0xd')](function(_0x3e3909){logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));logger['debug'](_0xca0b('0x11'),_0x30202d,_0xca0b('0x10'),JSON[_0xca0b('0x12')](_0x3e3909));if(_0x3e3909[_0xca0b('0x13')]){if(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x14')]===0x1f4){logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);return _0x55a1de(_0x3e3909['error'][_0xca0b('0x15')]);}logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909['error'][_0xca0b('0x15')]);return _0x19acc2(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);}else{logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));_0x19acc2(_0x3e3909['result'][_0xca0b('0x15')]);}})[_0xca0b('0x16')](function(_0x4d9b16){logger[_0xca0b('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x30202d,_0x4d9b16);_0x55a1de(_0x4d9b16);});});} \ No newline at end of file +var _0xcc2e=['request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceChanSpy,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x53456f,_0x502e75){var _0x492de8=function(_0x332a11){while(--_0x332a11){_0x53456f['push'](_0x53456f['shift']());}};_0x492de8(++_0x502e75);}(_0xcc2e,0xdd));var _0xecc2=function(_0x163add,_0x6191a2){_0x163add=_0x163add-0x0;var _0x473df9=_0xcc2e[_0x163add];return _0x473df9;};'use strict';var _=require(_0xecc2('0x0'));var util=require(_0xecc2('0x1'));var moment=require('moment');var BPromise=require(_0xecc2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecc2('0x3'))['db'];var utils=require(_0xecc2('0x4'));var logger=require(_0xecc2('0x5'))(_0xecc2('0x6'));var config=require(_0xecc2('0x7'));var jayson=require(_0xecc2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x260577,_0x88bb53,_0x659a9e){return new BPromise(function(_0x2f1764,_0x2d66a1){return client['request'](_0x260577,_0x659a9e)[_0xecc2('0x9')](function(_0x533643){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x88bb53,_0xecc2('0xa'));logger[_0xecc2('0xb')](_0xecc2('0xc'),_0x88bb53,_0xecc2('0xa'),JSON[_0xecc2('0xd')](_0x533643));if(_0x533643[_0xecc2('0xe')]){if(_0x533643['error'][_0xecc2('0xf')]===0x1f4){logger[_0xecc2('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x88bb53,_0x533643[_0xecc2('0xe')][_0xecc2('0x10')]);return _0x2d66a1(_0x533643[_0xecc2('0xe')]['message']);}logger[_0xecc2('0xe')](_0xecc2('0x11'),_0x88bb53,_0x533643[_0xecc2('0xe')][_0xecc2('0x10')]);return _0x2f1764(_0x533643[_0xecc2('0xe')]['message']);}else{logger[_0xecc2('0x12')](_0xecc2('0x11'),_0x88bb53,_0xecc2('0xa'));_0x2f1764(_0x533643[_0xecc2('0x13')][_0xecc2('0x10')]);}})[_0xecc2('0x14')](function(_0x5a70ea){logger[_0xecc2('0xe')](_0xecc2('0x11'),_0x88bb53,_0x5a70ea);_0x2d66a1(_0x5a70ea);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index dcea4a6..c1ee6d0 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 _0xe820=['create','put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','get','/:id','post'];(function(_0xb995d7,_0x37ddfc){var _0x4ec7cc=function(_0x3c0af7){while(--_0x3c0af7){_0xb995d7['push'](_0xb995d7['shift']());}};_0x4ec7cc(++_0x37ddfc);}(_0xe820,0xd2));var _0x0e82=function(_0x43b647,_0x7050d5){_0x43b647=_0x43b647-0x0;var _0x456b28=_0xe820[_0x43b647];return _0x456b28;};'use strict';var multer=require(_0x0e82('0x0'));var util=require('util');var path=require(_0x0e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e82('0x2')]();var auth=require(_0x0e82('0x3'));var interaction=require(_0x0e82('0x4'));var config=require('../../config/environment');var controller=require(_0x0e82('0x5'));router['get']('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0x7')]);router[_0x0e82('0x8')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller['show']);router[_0x0e82('0xa')]('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0xb')]);router[_0x0e82('0xc')](_0x0e82('0x9'),auth['isAuthenticated'](),controller[_0x0e82('0xd')]);router[_0x0e82('0xe')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller[_0x0e82('0xf')]);module[_0x0e82('0x10')]=router; \ No newline at end of file +var _0x86c0=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x4a2689,_0x314a16){var _0x463450=function(_0x5388b8){while(--_0x5388b8){_0x4a2689['push'](_0x4a2689['shift']());}};_0x463450(++_0x314a16);}(_0x86c0,0x133));var _0x086c=function(_0x1de8d8,_0xca0c0c){_0x1de8d8=_0x1de8d8-0x0;var _0x5ad51f=_0x86c0[_0x1de8d8];return _0x5ad51f;};'use strict';var multer=require(_0x086c('0x0'));var util=require('util');var path=require(_0x086c('0x1'));var timeout=require(_0x086c('0x2'));var express=require(_0x086c('0x3'));var router=express[_0x086c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x086c('0x5'));var config=require(_0x086c('0x6'));var controller=require(_0x086c('0x7'));router[_0x086c('0x8')]('/',auth['isAuthenticated'](),controller[_0x086c('0x9')]);router[_0x086c('0x8')](_0x086c('0xa'),auth[_0x086c('0xb')](),controller[_0x086c('0xc')]);router[_0x086c('0xd')]('/',auth['isAuthenticated'](),controller[_0x086c('0xe')]);router[_0x086c('0xf')](_0x086c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x086c('0x10')](_0x086c('0xa'),auth[_0x086c('0xb')](),controller[_0x086c('0x11')]);module[_0x086c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7c6458f..9feb3e0 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 _0x07d7=['STRING','name','BOOLEAN'];(function(_0x50c700,_0x1145a0){var _0x51b66e=function(_0x3076c4){while(--_0x3076c4){_0x50c700['push'](_0x50c700['shift']());}};_0x51b66e(++_0x1145a0);}(_0x07d7,0x1e6));var _0x707d=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0x07d7[_0x484cac];return _0x1d6e77;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x707d('0x0')],'unique':_0x707d('0x1')},'description':{'type':Sequelize[_0x707d('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x707d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc7a=['exports','STRING','BOOLEAN','sequelize'];(function(_0xdd3cbc,_0x125105){var _0x54797d=function(_0x361942){while(--_0x361942){_0xdd3cbc['push'](_0xdd3cbc['shift']());}};_0x54797d(++_0x125105);}(_0xfc7a,0x1ef));var _0xafc7=function(_0x1f8921,_0x38bd21){_0x1f8921=_0x1f8921-0x0;var _0x2c2f34=_0xfc7a[_0x1f8921];return _0x2c2f34;};'use strict';var Sequelize=require(_0xafc7('0x0'));module[_0xafc7('0x1')]={'name':{'type':Sequelize[_0xafc7('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xafc7('0x3')],'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 283bf00..a661de3 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 _0x184a=['includeAll','include','findAll','rows','catch','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','get','find','Contexts','userProfileId','autoAssociation','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','apply','reject','update','destroy','UserProfileResource','stack','name','index','VoiceContext','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','pick','filter','merge','where','map','type','key','field','count'];(function(_0x32cf49,_0x385484){var _0x420854=function(_0x174ad6){while(--_0x174ad6){_0x32cf49['push'](_0x32cf49['shift']());}};_0x420854(++_0x385484);}(_0x184a,0xdb));var _0xa184=function(_0x35227b,_0x334189){_0x35227b=_0x35227b-0x0;var _0xb7ac85=_0x184a[_0x35227b];return _0xb7ac85;};'use strict';var pdf=require(_0xa184('0x0'));var emlformat=require(_0xa184('0x1'));var rimraf=require(_0xa184('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa184('0x3'));var rp=require(_0xa184('0x4'));var moment=require(_0xa184('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa184('0x6'));var util=require(_0xa184('0x7'));var path=require(_0xa184('0x8'));var sox=require(_0xa184('0x9'));var csv=require(_0xa184('0xa'));var ejs=require(_0xa184('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa184('0xc'));var jsforce=require(_0xa184('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa184('0xa'));var querystring=require(_0xa184('0xe'));var Papa=require(_0xa184('0xf'));var Redis=require(_0xa184('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa184('0x11'));var hardwareService=require(_0xa184('0x12'));var logger=require(_0xa184('0x13'))(_0xa184('0x14'));var utils=require(_0xa184('0x15'));var config=require(_0xa184('0x16'));var db=require(_0xa184('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa184('0x18')][_0xa184('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3f5d15,_0x54e3aa,_0x5e6645){if(_0x5e6645){var _0x4a2a41=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a2a41[_0xa184('0x1a')](_0x54e3aa)){return _0x3f5d15;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3f5d15;}}function respondWithRpcPromise(_0x5a3466,_0xe5e56f,_0x26b051,_0x286feb){return new BPromise(function(_0xca29e7,_0x47889f){var _0xae067e=_0x286feb||client;return _0xae067e['request'](_0x5a3466,_0x26b051)[_0xa184('0x1b')](function(_0x4cff4e){logger[_0xa184('0x1c')](_0xa184('0x1d'),_0xe5e56f,_0xa184('0x1e'));logger[_0xa184('0x1f')](_0xa184('0x20'),_0xe5e56f,_0xa184('0x1e'),JSON[_0xa184('0x21')](_0x4cff4e));if(_0x4cff4e[_0xa184('0x22')]){if(_0x4cff4e[_0xa184('0x22')]['code']===0x1f4){logger['error'](_0xa184('0x1d'),_0xe5e56f,_0x4cff4e[_0xa184('0x22')][_0xa184('0x23')]);return _0x47889f(_0x4cff4e['error'][_0xa184('0x23')]);}logger[_0xa184('0x22')]('VoiceContext,\x20%s,\x20%s',_0xe5e56f,_0x4cff4e[_0xa184('0x22')][_0xa184('0x23')]);return _0xca29e7(_0x4cff4e[_0xa184('0x22')]['message']);}else{logger[_0xa184('0x1c')](_0xa184('0x1d'),_0xe5e56f,_0xa184('0x1e'));_0xca29e7(_0x4cff4e[_0xa184('0x24')][_0xa184('0x23')]);}})['catch'](function(_0x46c69a){logger['error']('VoiceContext,\x20%s,\x20%s',_0xe5e56f,_0x46c69a);_0x47889f(_0x46c69a);});});}function respondWithStatusCode(_0xff9f06,_0x5e9a78){_0x5e9a78=_0x5e9a78||0xcc;return function(_0x66d6c8){if(_0x66d6c8){return _0xff9f06[_0xa184('0x25')](_0x5e9a78);}return _0xff9f06[_0xa184('0x26')](_0x5e9a78)[_0xa184('0x27')]();};}function respondWithResult(_0x360a7c,_0x70652){_0x70652=_0x70652||0xc8;return function(_0x2f2891){if(_0x2f2891){return _0x360a7c[_0xa184('0x26')](_0x70652)[_0xa184('0x28')](_0x2f2891);}};}function respondWithFilteredResult(_0x576b74,_0x440566){return function(_0x1ae2a5){if(_0x1ae2a5){var _0x4a6247=_0x1ae2a5['count'],_0x193e88=_0x440566[_0xa184('0x29')],_0x474d9b=_0x440566[_0xa184('0x29')]+_0x440566['limit'],_0x5de569;if(_0x474d9b>=_0x4a6247){_0x474d9b=_0x4a6247;_0x5de569=0xc8;}else{_0x5de569=0xce;}_0x576b74[_0xa184('0x26')](_0x5de569);return _0x576b74['set']('Content-Range',_0x193e88+'-'+_0x474d9b+'/'+_0x4a6247)['json'](_0x1ae2a5);}return null;};}function patchUpdates(_0x2a618a){return function(_0x116f3c){try{jsonpatch[_0xa184('0x2a')](_0x116f3c,_0x2a618a,!![]);}catch(_0x98f8cf){return BPromise[_0xa184('0x2b')](_0x98f8cf);}return _0x116f3c['save']();};}function saveUpdates(_0x47aae8,_0xa5c709){return function(_0x35a122){if(_0x35a122){return _0x35a122[_0xa184('0x2c')](_0x47aae8)[_0xa184('0x1b')](function(_0x32e2f0){return _0x32e2f0;});}return null;};}function removeEntity(_0x51f2f1,_0x218d29){return function(_0x33f9ea){if(_0x33f9ea){return _0x33f9ea[_0xa184('0x2d')]()[_0xa184('0x1b')](function(){var _0x34149b=_0x33f9ea['get']({'plain':!![]});var _0xea940c='Contexts';return db[_0xa184('0x2e')][_0xa184('0x2d')]({'where':{'type':_0xea940c,'resourceId':_0x34149b['id']}})['then'](function(){return _0x33f9ea;});})[_0xa184('0x1b')](function(){_0x51f2f1['status'](0xcc)[_0xa184('0x27')]();});}};}function handleEntityNotFound(_0x5d9679,_0x1fb3b4){return function(_0x103f22){if(!_0x103f22){_0x5d9679['sendStatus'](0x194);}return _0x103f22;};}function handleError(_0x540ce2,_0x45bef8){_0x45bef8=_0x45bef8||0x1f4;return function(_0x153acf){logger['error'](_0x153acf[_0xa184('0x2f')]);if(_0x153acf[_0xa184('0x30')]){delete _0x153acf[_0xa184('0x30')];}_0x540ce2[_0xa184('0x26')](_0x45bef8)['send'](_0x153acf);};}exports[_0xa184('0x31')]=function(_0x268221,_0x1aa0d8){var _0x48e7a0={},_0x101101={},_0x176771={'count':0x0,'rows':[]};var _0x1b64a3=db[_0xa184('0x32')][_0xa184('0x33')];_0x101101['model']=_['keys'](_0x1b64a3);_0x101101[_0xa184('0x34')]=_[_0xa184('0x35')](_0x268221[_0xa184('0x34')]);_0x101101[_0xa184('0x36')]=_[_0xa184('0x37')](_0x101101['model'],_0x101101[_0xa184('0x34')]);_0x48e7a0[_0xa184('0x38')]=_[_0xa184('0x37')](_0x101101[_0xa184('0x39')],qs['fields'](_0x268221[_0xa184('0x34')][_0xa184('0x3a')]));_0x48e7a0[_0xa184('0x38')]=_0x48e7a0[_0xa184('0x38')][_0xa184('0x3b')]?_0x48e7a0['attributes']:_0x101101[_0xa184('0x39')];if(!_0x268221['query']['hasOwnProperty'](_0xa184('0x3c'))){_0x48e7a0[_0xa184('0x3d')]=qs[_0xa184('0x3d')](_0x268221[_0xa184('0x34')]['limit']);_0x48e7a0[_0xa184('0x29')]=qs[_0xa184('0x29')](_0x268221[_0xa184('0x34')][_0xa184('0x29')]);}_0x48e7a0['order']=qs[_0xa184('0x3e')](_0x268221[_0xa184('0x34')][_0xa184('0x3e')]);_0x48e7a0['where']=qs[_0xa184('0x36')](_[_0xa184('0x3f')](_0x268221[_0xa184('0x34')],_0x101101[_0xa184('0x36')]));if(_0x268221[_0xa184('0x34')][_0xa184('0x40')]){_0x48e7a0['where']=_[_0xa184('0x41')](_0x48e7a0[_0xa184('0x42')],{'$or':_[_0xa184('0x43')](_0x1b64a3,function(_0x2c0a8c){if(_0x2c0a8c[_0xa184('0x44')][_0xa184('0x45')]!=='VIRTUAL'){var _0xca95d={};_0xca95d[_0x2c0a8c[_0xa184('0x46')]]={'$like':'%'+_0x268221[_0xa184('0x34')]['filter']+'%'};return _0xca95d;}})});}_0x48e7a0=_[_0xa184('0x41')]({},_0x48e7a0,_0x268221['options']);var _0x1d3bd5={'where':_0x48e7a0[_0xa184('0x42')]};return db['VoiceContext'][_0xa184('0x47')](_0x1d3bd5)[_0xa184('0x1b')](function(_0x3a54cb){_0x176771['count']=_0x3a54cb;if(_0x268221[_0xa184('0x34')][_0xa184('0x48')]){_0x48e7a0[_0xa184('0x49')]=[{'all':!![]}];}return db[_0xa184('0x32')][_0xa184('0x4a')](_0x48e7a0);})['then'](function(_0x4b42b3){_0x176771[_0xa184('0x4b')]=_0x4b42b3;return _0x176771;})[_0xa184('0x1b')](respondWithFilteredResult(_0x1aa0d8,_0x48e7a0))[_0xa184('0x4c')](handleError(_0x1aa0d8,null));};exports['show']=function(_0x2df5cc,_0x49d1fd){var _0x11e41d={'raw':![],'where':{'id':_0x2df5cc['params']['id']}},_0x5565de={};_0x5565de['model']=_[_0xa184('0x35')](db[_0xa184('0x32')][_0xa184('0x33')]);_0x5565de[_0xa184('0x34')]=_[_0xa184('0x35')](_0x2df5cc['query']);_0x5565de[_0xa184('0x36')]=_[_0xa184('0x37')](_0x5565de[_0xa184('0x39')],_0x5565de['query']);_0x11e41d[_0xa184('0x38')]=_[_0xa184('0x37')](_0x5565de[_0xa184('0x39')],qs[_0xa184('0x3a')](_0x2df5cc[_0xa184('0x34')][_0xa184('0x3a')]));_0x11e41d['attributes']=_0x11e41d['attributes'][_0xa184('0x3b')]?_0x11e41d[_0xa184('0x38')]:_0x5565de[_0xa184('0x39')];if(_0x2df5cc[_0xa184('0x34')][_0xa184('0x48')]){_0x11e41d[_0xa184('0x49')]=[{'all':!![]}];}_0x11e41d=_[_0xa184('0x41')]({},_0x11e41d,_0x2df5cc['options']);return db['VoiceContext']['find'](_0x11e41d)[_0xa184('0x1b')](handleEntityNotFound(_0x49d1fd,null))[_0xa184('0x1b')](respondWithResult(_0x49d1fd,null))[_0xa184('0x4c')](handleError(_0x49d1fd,null));};exports[_0xa184('0x4d')]=function(_0x31e9df,_0x5bccc5,_0x1b9569){var _0x23a3ea;return db[_0xa184('0x32')]['create'](_0x31e9df[_0xa184('0x4e')],{'raw':!![]})[_0xa184('0x1b')](function(_0x5ea126){_0x23a3ea=_0x5ea126;return db[_0xa184('0x32')][_0xa184('0x4a')]({'raw':!![]});})[_0xa184('0x1b')](function(_0x2a8c70){var _0x1f45c0=fs[_0xa184('0x4f')](path[_0xa184('0x50')](config[_0xa184('0x51')],_0xa184('0x52')),_0xa184('0x53'));var _0xa06517=ejs[_0xa184('0x54')](_0x1f45c0,{'contexts':_0x2a8c70||[]});fs[_0xa184('0x55')](_0xa184('0x56'),_0xa06517);})[_0xa184('0x1b')](function(){return respondWithRpcPromise(_0xa184('0x57'),_0xa184('0x4d'),{'module':_0xa184('0x58')});})[_0xa184('0x1b')](function(){var _0x133156=_0x31e9df[_0xa184('0x59')]['get']({'plain':!![]});if(!_0x133156)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x133156[_0xa184('0x5a')]===_0xa184('0x59')){var _0x5caed5=_0x23a3ea[_0xa184('0x5b')]({'plain':!![]});return db['UserProfileSection'][_0xa184('0x5c')]({'where':{'name':_0xa184('0x5d'),'userProfileId':_0x133156[_0xa184('0x5e')]},'raw':!![]})[_0xa184('0x1b')](function(_0xa32e7){if(_0xa32e7&&_0xa32e7[_0xa184('0x5f')]===0x0){return db[_0xa184('0x2e')][_0xa184('0x4d')]({'name':_0x5caed5['name'],'resourceId':_0x5caed5['id'],'type':_0xa32e7[_0xa184('0x30')],'sectionId':_0xa32e7['id']},{})[_0xa184('0x1b')](function(){return _0x23a3ea;});}else{return _0x23a3ea;}})['catch'](function(_0x29c178){logger[_0xa184('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29c178);throw _0x29c178;});}return _0x23a3ea;})[_0xa184('0x1b')](respondWithResult(_0x5bccc5,0xc9))['catch'](handleError(_0x5bccc5,null));};exports[_0xa184('0x2c')]=function(_0xa33d7a,_0x577ab9,_0x40848c){var _0x244b6a;return db['VoiceContext'][_0xa184('0x5c')]({'where':{'id':_0xa33d7a['params']['id']}})[_0xa184('0x1b')](handleEntityNotFound(_0x577ab9,null))[_0xa184('0x1b')](saveUpdates(_0xa33d7a['body'],null))[_0xa184('0x1b')](function(_0x3e0cc2){if(_0x3e0cc2){_0x244b6a=_0x3e0cc2;return db[_0xa184('0x32')][_0xa184('0x4a')]({'raw':!![]});}})[_0xa184('0x1b')](function(_0x4e700d){var _0x42358d=fs[_0xa184('0x4f')](path['join'](config[_0xa184('0x51')],_0xa184('0x52')),_0xa184('0x53'));var _0x4161ea=ejs['render'](_0x42358d,{'contexts':_0x4e700d||[]});fs[_0xa184('0x55')](_0xa184('0x56'),_0x4161ea);})[_0xa184('0x1b')](function(){return respondWithRpcPromise('Reload',_0xa184('0x2c'),{'module':_0xa184('0x58')});})['then'](function(){return _0x244b6a;})[_0xa184('0x1b')](respondWithResult(_0x577ab9,null))[_0xa184('0x4c')](handleError(_0x577ab9,null));};exports[_0xa184('0x2d')]=function(_0x30eda8,_0x480c47,_0x25a7ac){var _0x4781b3;return db['VoiceContext'][_0xa184('0x5c')]({'where':{'id':_0x30eda8[_0xa184('0x60')]['id']}})[_0xa184('0x1b')](handleEntityNotFound(_0x480c47,null))[_0xa184('0x1b')](removeEntity(_0x480c47,null))['then'](function(){return db['VoiceContext'][_0xa184('0x4a')]({'raw':!![]});})[_0xa184('0x1b')](function(_0x930116){var _0x383609=fs['readFileSync'](path[_0xa184('0x50')](config['root'],_0xa184('0x52')),_0xa184('0x53'));var _0x58b79c=ejs['render'](_0x383609,{'contexts':_0x930116});fs[_0xa184('0x55')](_0xa184('0x56'),_0x58b79c);return respondWithRpcPromise(_0xa184('0x57'),_0xa184('0x2d'),{'module':'chan_sip.so'});})['catch'](handleError(_0x480c47,null));}; \ No newline at end of file +var _0xc8ec=['end','status','json','count','offset','limit','set','apply','reject','update','destroy','Contexts','stack','name','send','index','VoiceContext','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','rows','show','params','includeAll','create','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus'];(function(_0x4deb7a,_0x35c932){var _0x2e60ad=function(_0xbb889){while(--_0xbb889){_0x4deb7a['push'](_0x4deb7a['shift']());}};_0x2e60ad(++_0x35c932);}(_0xc8ec,0x119));var _0xcc8e=function(_0x2e5803,_0x562ea7){_0x2e5803=_0x2e5803-0x0;var _0x4258e3=_0xc8ec[_0x2e5803];return _0x4258e3;};'use strict';var pdf=require(_0xcc8e('0x0'));var emlformat=require(_0xcc8e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcc8e('0x2'));var jsonpatch=require(_0xcc8e('0x3'));var rp=require(_0xcc8e('0x4'));var moment=require(_0xcc8e('0x5'));var BPromise=require(_0xcc8e('0x6'));var Mustache=require(_0xcc8e('0x7'));var util=require(_0xcc8e('0x8'));var path=require(_0xcc8e('0x9'));var sox=require(_0xcc8e('0xa'));var csv=require('to-csv');var ejs=require(_0xcc8e('0xb'));var fs=require('fs');var _=require(_0xcc8e('0xc'));var squel=require(_0xcc8e('0xd'));var crypto=require('crypto');var jsforce=require(_0xcc8e('0xe'));var deskjs=require(_0xcc8e('0xf'));var toCsv=require(_0xcc8e('0x10'));var querystring=require('querystring');var Papa=require(_0xcc8e('0x11'));var Redis=require(_0xcc8e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc8e('0x13'));var hardwareService=require(_0xcc8e('0x14'));var logger=require(_0xcc8e('0x15'))(_0xcc8e('0x16'));var utils=require(_0xcc8e('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xcc8e('0x18'));var client=jayson['client'][_0xcc8e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x239942,_0x45b539,_0x3a4779){if(_0x3a4779){var _0x29c0e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29c0e8['test'](_0x45b539)){return _0x239942;}else{throw new Error(_0xcc8e('0x1a'));}}else{return _0x239942;}}function respondWithRpcPromise(_0x55d035,_0x43be3b,_0xf7a846,_0x59c5fb){return new BPromise(function(_0x4423c0,_0x15f49c){var _0xfce562=_0x59c5fb||client;return _0xfce562[_0xcc8e('0x1b')](_0x55d035,_0xf7a846)[_0xcc8e('0x1c')](function(_0x2d1380){logger[_0xcc8e('0x1d')](_0xcc8e('0x1e'),_0x43be3b,_0xcc8e('0x1f'));logger[_0xcc8e('0x20')](_0xcc8e('0x21'),_0x43be3b,_0xcc8e('0x1f'),JSON[_0xcc8e('0x22')](_0x2d1380));if(_0x2d1380[_0xcc8e('0x23')]){if(_0x2d1380['error']['code']===0x1f4){logger['error'](_0xcc8e('0x1e'),_0x43be3b,_0x2d1380[_0xcc8e('0x23')][_0xcc8e('0x24')]);return _0x15f49c(_0x2d1380[_0xcc8e('0x23')][_0xcc8e('0x24')]);}logger[_0xcc8e('0x23')](_0xcc8e('0x1e'),_0x43be3b,_0x2d1380[_0xcc8e('0x23')][_0xcc8e('0x24')]);return _0x4423c0(_0x2d1380[_0xcc8e('0x23')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x43be3b,_0xcc8e('0x1f'));_0x4423c0(_0x2d1380[_0xcc8e('0x25')][_0xcc8e('0x24')]);}})[_0xcc8e('0x26')](function(_0x4f703d){logger[_0xcc8e('0x23')](_0xcc8e('0x1e'),_0x43be3b,_0x4f703d);_0x15f49c(_0x4f703d);});});}function respondWithStatusCode(_0x10d1c2,_0xedb06b){_0xedb06b=_0xedb06b||0xcc;return function(_0x135ad6){if(_0x135ad6){return _0x10d1c2[_0xcc8e('0x27')](_0xedb06b);}return _0x10d1c2['status'](_0xedb06b)[_0xcc8e('0x28')]();};}function respondWithResult(_0x2d0bd4,_0x4a4c1c){_0x4a4c1c=_0x4a4c1c||0xc8;return function(_0x4bf18d){if(_0x4bf18d){return _0x2d0bd4[_0xcc8e('0x29')](_0x4a4c1c)[_0xcc8e('0x2a')](_0x4bf18d);}};}function respondWithFilteredResult(_0x565621,_0x4af006){return function(_0x25572d){if(_0x25572d){var _0x531c82=_0x25572d[_0xcc8e('0x2b')],_0x19ded1=_0x4af006[_0xcc8e('0x2c')],_0x12eb39=_0x4af006['offset']+_0x4af006[_0xcc8e('0x2d')],_0x5342eb;if(_0x12eb39>=_0x531c82){_0x12eb39=_0x531c82;_0x5342eb=0xc8;}else{_0x5342eb=0xce;}_0x565621[_0xcc8e('0x29')](_0x5342eb);return _0x565621[_0xcc8e('0x2e')]('Content-Range',_0x19ded1+'-'+_0x12eb39+'/'+_0x531c82)[_0xcc8e('0x2a')](_0x25572d);}return null;};}function patchUpdates(_0x2cc820){return function(_0x2b4c95){try{jsonpatch[_0xcc8e('0x2f')](_0x2b4c95,_0x2cc820,!![]);}catch(_0xc91d5){return BPromise[_0xcc8e('0x30')](_0xc91d5);}return _0x2b4c95['save']();};}function saveUpdates(_0x5260be,_0x2bd8bb){return function(_0x4bcc69){if(_0x4bcc69){return _0x4bcc69[_0xcc8e('0x31')](_0x5260be)['then'](function(_0x22a7cc){return _0x22a7cc;});}return null;};}function removeEntity(_0x48292f,_0xa8e464){return function(_0x197992){if(_0x197992){return _0x197992[_0xcc8e('0x32')]()[_0xcc8e('0x1c')](function(){var _0xe1c929=_0x197992['get']({'plain':!![]});var _0x32a4e3=_0xcc8e('0x33');return db['UserProfileResource'][_0xcc8e('0x32')]({'where':{'type':_0x32a4e3,'resourceId':_0xe1c929['id']}})['then'](function(){return _0x197992;});})['then'](function(){_0x48292f[_0xcc8e('0x29')](0xcc)[_0xcc8e('0x28')]();});}};}function handleEntityNotFound(_0x388fb0,_0x558bc1){return function(_0x3c5696){if(!_0x3c5696){_0x388fb0[_0xcc8e('0x27')](0x194);}return _0x3c5696;};}function handleError(_0x12836d,_0x580eab){_0x580eab=_0x580eab||0x1f4;return function(_0x196393){logger['error'](_0x196393[_0xcc8e('0x34')]);if(_0x196393[_0xcc8e('0x35')]){delete _0x196393[_0xcc8e('0x35')];}_0x12836d['status'](_0x580eab)[_0xcc8e('0x36')](_0x196393);};}exports[_0xcc8e('0x37')]=function(_0x318b05,_0x440e50){var _0x593973={},_0x30d1d1={},_0x351951={'count':0x0,'rows':[]};var _0x546efc=db[_0xcc8e('0x38')][_0xcc8e('0x39')];_0x30d1d1[_0xcc8e('0x3a')]=_[_0xcc8e('0x3b')](_0x546efc);_0x30d1d1[_0xcc8e('0x3c')]=_['keys'](_0x318b05[_0xcc8e('0x3c')]);_0x30d1d1[_0xcc8e('0x3d')]=_[_0xcc8e('0x3e')](_0x30d1d1[_0xcc8e('0x3a')],_0x30d1d1[_0xcc8e('0x3c')]);_0x593973['attributes']=_['intersection'](_0x30d1d1['model'],qs[_0xcc8e('0x3f')](_0x318b05[_0xcc8e('0x3c')][_0xcc8e('0x3f')]));_0x593973[_0xcc8e('0x40')]=_0x593973[_0xcc8e('0x40')][_0xcc8e('0x41')]?_0x593973[_0xcc8e('0x40')]:_0x30d1d1[_0xcc8e('0x3a')];if(!_0x318b05['query'][_0xcc8e('0x42')](_0xcc8e('0x43'))){_0x593973[_0xcc8e('0x2d')]=qs[_0xcc8e('0x2d')](_0x318b05[_0xcc8e('0x3c')][_0xcc8e('0x2d')]);_0x593973[_0xcc8e('0x2c')]=qs[_0xcc8e('0x2c')](_0x318b05[_0xcc8e('0x3c')]['offset']);}_0x593973[_0xcc8e('0x44')]=qs[_0xcc8e('0x45')](_0x318b05[_0xcc8e('0x3c')][_0xcc8e('0x45')]);_0x593973[_0xcc8e('0x46')]=qs[_0xcc8e('0x3d')](_[_0xcc8e('0x47')](_0x318b05[_0xcc8e('0x3c')],_0x30d1d1[_0xcc8e('0x3d')]));if(_0x318b05['query'][_0xcc8e('0x48')]){_0x593973[_0xcc8e('0x46')]=_[_0xcc8e('0x49')](_0x593973['where'],{'$or':_[_0xcc8e('0x4a')](_0x546efc,function(_0x1b32dd){if(_0x1b32dd[_0xcc8e('0x4b')][_0xcc8e('0x4c')]!==_0xcc8e('0x4d')){var _0x27d7f6={};_0x27d7f6[_0x1b32dd['field']]={'$like':'%'+_0x318b05[_0xcc8e('0x3c')][_0xcc8e('0x48')]+'%'};return _0x27d7f6;}})});}_0x593973=_[_0xcc8e('0x49')]({},_0x593973,_0x318b05[_0xcc8e('0x4e')]);var _0x48b5b8={'where':_0x593973[_0xcc8e('0x46')]};return db[_0xcc8e('0x38')][_0xcc8e('0x2b')](_0x48b5b8)[_0xcc8e('0x1c')](function(_0x203656){_0x351951[_0xcc8e('0x2b')]=_0x203656;if(_0x318b05[_0xcc8e('0x3c')]['includeAll']){_0x593973[_0xcc8e('0x4f')]=[{'all':!![]}];}return db[_0xcc8e('0x38')]['findAll'](_0x593973);})[_0xcc8e('0x1c')](function(_0x492731){_0x351951[_0xcc8e('0x50')]=_0x492731;return _0x351951;})[_0xcc8e('0x1c')](respondWithFilteredResult(_0x440e50,_0x593973))[_0xcc8e('0x26')](handleError(_0x440e50,null));};exports[_0xcc8e('0x51')]=function(_0x5b1c68,_0x4e806d){var _0x399e6b={'raw':![],'where':{'id':_0x5b1c68[_0xcc8e('0x52')]['id']}},_0x42c9ae={};_0x42c9ae[_0xcc8e('0x3a')]=_[_0xcc8e('0x3b')](db[_0xcc8e('0x38')][_0xcc8e('0x39')]);_0x42c9ae[_0xcc8e('0x3c')]=_[_0xcc8e('0x3b')](_0x5b1c68[_0xcc8e('0x3c')]);_0x42c9ae[_0xcc8e('0x3d')]=_['intersection'](_0x42c9ae['model'],_0x42c9ae[_0xcc8e('0x3c')]);_0x399e6b[_0xcc8e('0x40')]=_[_0xcc8e('0x3e')](_0x42c9ae[_0xcc8e('0x3a')],qs['fields'](_0x5b1c68[_0xcc8e('0x3c')]['fields']));_0x399e6b[_0xcc8e('0x40')]=_0x399e6b['attributes'][_0xcc8e('0x41')]?_0x399e6b[_0xcc8e('0x40')]:_0x42c9ae['model'];if(_0x5b1c68['query'][_0xcc8e('0x53')]){_0x399e6b[_0xcc8e('0x4f')]=[{'all':!![]}];}_0x399e6b=_[_0xcc8e('0x49')]({},_0x399e6b,_0x5b1c68[_0xcc8e('0x4e')]);return db['VoiceContext']['find'](_0x399e6b)[_0xcc8e('0x1c')](handleEntityNotFound(_0x4e806d,null))[_0xcc8e('0x1c')](respondWithResult(_0x4e806d,null))['catch'](handleError(_0x4e806d,null));};exports[_0xcc8e('0x54')]=function(_0x5da50e,_0x4d56fb,_0x4ea866){var _0x29ecb5;return db[_0xcc8e('0x38')][_0xcc8e('0x54')](_0x5da50e['body'],{'raw':!![]})['then'](function(_0x1a616a){_0x29ecb5=_0x1a616a;return db['VoiceContext'][_0xcc8e('0x55')]({'raw':!![]});})['then'](function(_0x361534){var _0x7f4385=fs[_0xcc8e('0x56')](path[_0xcc8e('0x57')](config[_0xcc8e('0x58')],_0xcc8e('0x59')),_0xcc8e('0x5a'));var _0x5d55bb=ejs[_0xcc8e('0x5b')](_0x7f4385,{'contexts':_0x361534||[]});fs[_0xcc8e('0x5c')](_0xcc8e('0x5d'),_0x5d55bb);})[_0xcc8e('0x1c')](function(){return respondWithRpcPromise(_0xcc8e('0x5e'),_0xcc8e('0x54'),{'module':_0xcc8e('0x5f')});})['then'](function(){var _0x11e9b7=_0x5da50e[_0xcc8e('0x60')][_0xcc8e('0x61')]({'plain':!![]});if(!_0x11e9b7)throw new Error(_0xcc8e('0x62'));if(_0x11e9b7[_0xcc8e('0x63')]===_0xcc8e('0x60')){var _0x3c927f=_0x29ecb5[_0xcc8e('0x61')]({'plain':!![]});return db[_0xcc8e('0x64')][_0xcc8e('0x65')]({'where':{'name':'Contexts','userProfileId':_0x11e9b7[_0xcc8e('0x66')]},'raw':!![]})[_0xcc8e('0x1c')](function(_0x4a71b7){if(_0x4a71b7&&_0x4a71b7[_0xcc8e('0x67')]===0x0){return db[_0xcc8e('0x68')]['create']({'name':_0x3c927f[_0xcc8e('0x35')],'resourceId':_0x3c927f['id'],'type':_0x4a71b7['name'],'sectionId':_0x4a71b7['id']},{})[_0xcc8e('0x1c')](function(){return _0x29ecb5;});}else{return _0x29ecb5;}})['catch'](function(_0x323488){logger[_0xcc8e('0x23')](_0xcc8e('0x69'),_0x323488);throw _0x323488;});}return _0x29ecb5;})[_0xcc8e('0x1c')](respondWithResult(_0x4d56fb,0xc9))['catch'](handleError(_0x4d56fb,null));};exports['update']=function(_0x4477b7,_0xf47449,_0x362770){var _0x15bbb3;return db[_0xcc8e('0x38')][_0xcc8e('0x65')]({'where':{'id':_0x4477b7[_0xcc8e('0x52')]['id']}})[_0xcc8e('0x1c')](handleEntityNotFound(_0xf47449,null))[_0xcc8e('0x1c')](saveUpdates(_0x4477b7[_0xcc8e('0x6a')],null))['then'](function(_0x181cf0){if(_0x181cf0){_0x15bbb3=_0x181cf0;return db[_0xcc8e('0x38')]['findAll']({'raw':!![]});}})['then'](function(_0x58625f){var _0x404c5a=fs['readFileSync'](path[_0xcc8e('0x57')](config[_0xcc8e('0x58')],'server/files/templates/context.ejs'),_0xcc8e('0x5a'));var _0x5cc54e=ejs[_0xcc8e('0x5b')](_0x404c5a,{'contexts':_0x58625f||[]});fs['writeFileSync'](_0xcc8e('0x5d'),_0x5cc54e);})[_0xcc8e('0x1c')](function(){return respondWithRpcPromise(_0xcc8e('0x5e'),_0xcc8e('0x31'),{'module':_0xcc8e('0x5f')});})[_0xcc8e('0x1c')](function(){return _0x15bbb3;})['then'](respondWithResult(_0xf47449,null))['catch'](handleError(_0xf47449,null));};exports[_0xcc8e('0x32')]=function(_0x2d8c97,_0x28eadd,_0x51455f){var _0x29fa30;return db[_0xcc8e('0x38')][_0xcc8e('0x65')]({'where':{'id':_0x2d8c97['params']['id']}})[_0xcc8e('0x1c')](handleEntityNotFound(_0x28eadd,null))[_0xcc8e('0x1c')](removeEntity(_0x28eadd,null))['then'](function(){return db['VoiceContext'][_0xcc8e('0x55')]({'raw':!![]});})['then'](function(_0x39d4b1){var _0x48c00d=fs[_0xcc8e('0x56')](path['join'](config[_0xcc8e('0x58')],_0xcc8e('0x59')),'utf8');var _0x21815c=ejs[_0xcc8e('0x5b')](_0x48c00d,{'contexts':_0x39d4b1});fs['writeFileSync'](_0xcc8e('0x5d'),_0x21815c);return respondWithRpcPromise(_0xcc8e('0x5e'),_0xcc8e('0x32'),{'module':_0xcc8e('0x5f')});})[_0xcc8e('0x26')](handleError(_0x28eadd,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index f936fa7..8cc4403 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 _0xd83a=['../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xd83a,0x1c8));var _0xad83=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xd83a[_0x349367];return _0x14179b;};'use strict';var _=require(_0xad83('0x0'));var util=require(_0xad83('0x1'));var logger=require(_0xad83('0x2'))('api');var moment=require('moment');var BPromise=require(_0xad83('0x3'));var rp=require(_0xad83('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad83('0x5'));var config=require(_0xad83('0x6'));var attributes=require(_0xad83('0x7'));module[_0xad83('0x8')]=function(_0x51e65a,_0x11b165){return _0x51e65a[_0xad83('0x9')]('VoiceContext',attributes,{'tableName':_0xad83('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfaff=['lodash','util','../../config/logger','api','moment','bluebird','path','./voiceContext.attributes','define','VoiceContext','voice_contexts'];(function(_0x4019d2,_0x271056){var _0xa02ed2=function(_0x3c2ab8){while(--_0x3c2ab8){_0x4019d2['push'](_0x4019d2['shift']());}};_0xa02ed2(++_0x271056);}(_0xfaff,0x1c3));var _0xffaf=function(_0x9aa351,_0x4be397){_0x9aa351=_0x9aa351-0x0;var _0x5c729b=_0xfaff[_0x9aa351];return _0x5c729b;};'use strict';var _=require(_0xffaf('0x0'));var util=require(_0xffaf('0x1'));var logger=require(_0xffaf('0x2'))(_0xffaf('0x3'));var moment=require(_0xffaf('0x4'));var BPromise=require(_0xffaf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffaf('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xffaf('0x7'));module['exports']=function(_0x52f04c,_0x21fe3d){return _0x52f04c[_0xffaf('0x8')](_0xffaf('0x9'),attributes,{'tableName':_0xffaf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 5e49e74..fd38d98 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 _0x3976=['result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message'];(function(_0x7d9ea5,_0x1c4686){var _0x2d050d=function(_0x1f8445){while(--_0x1f8445){_0x7d9ea5['push'](_0x7d9ea5['shift']());}};_0x2d050d(++_0x1c4686);}(_0x3976,0xbe));var _0x6397=function(_0x152fc4,_0x3147cc){_0x152fc4=_0x152fc4-0x0;var _0x38cf4f=_0x3976[_0x152fc4];return _0x38cf4f;};'use strict';var _=require(_0x6397('0x0'));var util=require(_0x6397('0x1'));var moment=require(_0x6397('0x2'));var BPromise=require(_0x6397('0x3'));var rs=require(_0x6397('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6397('0x5'))(_0x6397('0x6'));var config=require('../../config/environment');var jayson=require(_0x6397('0x7'));var client=jayson[_0x6397('0x8')][_0x6397('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x606737,_0x276e52,_0x3ac49){return new BPromise(function(_0x27766f,_0xe49c58){return client[_0x6397('0xa')](_0x606737,_0x3ac49)[_0x6397('0xb')](function(_0x45212e){logger[_0x6397('0xc')]('VoiceContext,\x20%s,\x20%s',_0x276e52,_0x6397('0xd'));logger[_0x6397('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x276e52,_0x6397('0xd'),JSON[_0x6397('0xf')](_0x45212e));if(_0x45212e['error']){if(_0x45212e[_0x6397('0x10')][_0x6397('0x11')]===0x1f4){logger[_0x6397('0x10')](_0x6397('0x12'),_0x276e52,_0x45212e[_0x6397('0x10')][_0x6397('0x13')]);return _0xe49c58(_0x45212e['error'][_0x6397('0x13')]);}logger['error'](_0x6397('0x12'),_0x276e52,_0x45212e[_0x6397('0x10')][_0x6397('0x13')]);return _0x27766f(_0x45212e[_0x6397('0x10')][_0x6397('0x13')]);}else{logger[_0x6397('0xc')](_0x6397('0x12'),_0x276e52,_0x6397('0xd'));_0x27766f(_0x45212e[_0x6397('0x14')]['message']);}})['catch'](function(_0x33c919){logger['error'](_0x6397('0x12'),_0x276e52,_0x33c919);_0xe49c58(_0x33c919);});});} \ No newline at end of file +var _0x7bbb=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x375907,_0x18cce8){var _0xb4addf=function(_0x1142cb){while(--_0x1142cb){_0x375907['push'](_0x375907['shift']());}};_0xb4addf(++_0x18cce8);}(_0x7bbb,0x177));var _0xb7bb=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7bbb[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xb7bb('0x0'));var util=require(_0xb7bb('0x1'));var moment=require(_0xb7bb('0x2'));var BPromise=require(_0xb7bb('0x3'));var rs=require(_0xb7bb('0x4'));var fs=require('fs');var Redis=require(_0xb7bb('0x5'));var db=require(_0xb7bb('0x6'))['db'];var utils=require(_0xb7bb('0x7'));var logger=require(_0xb7bb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb7bb('0x9'));var client=jayson[_0xb7bb('0xa')][_0xb7bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x173883,_0x1c21b5,_0x404ddc){return new BPromise(function(_0x39fde4,_0x476f90){return client[_0xb7bb('0xc')](_0x173883,_0x404ddc)[_0xb7bb('0xd')](function(_0x4eb4b2){logger[_0xb7bb('0xe')](_0xb7bb('0xf'),_0x1c21b5,'request\x20sent');logger[_0xb7bb('0x10')](_0xb7bb('0x11'),_0x1c21b5,'request\x20sent',JSON[_0xb7bb('0x12')](_0x4eb4b2));if(_0x4eb4b2[_0xb7bb('0x13')]){if(_0x4eb4b2[_0xb7bb('0x13')]['code']===0x1f4){logger[_0xb7bb('0x13')](_0xb7bb('0xf'),_0x1c21b5,_0x4eb4b2[_0xb7bb('0x13')][_0xb7bb('0x14')]);return _0x476f90(_0x4eb4b2['error']['message']);}logger[_0xb7bb('0x13')]('VoiceContext,\x20%s,\x20%s',_0x1c21b5,_0x4eb4b2[_0xb7bb('0x13')]['message']);return _0x39fde4(_0x4eb4b2[_0xb7bb('0x13')][_0xb7bb('0x14')]);}else{logger[_0xb7bb('0xe')]('VoiceContext,\x20%s,\x20%s',_0x1c21b5,'request\x20sent');_0x39fde4(_0x4eb4b2[_0xb7bb('0x15')][_0xb7bb('0x14')]);}})[_0xb7bb('0x16')](function(_0x5d401a){logger[_0xb7bb('0x13')]('VoiceContext,\x20%s,\x20%s',_0x1c21b5,_0x5d401a);_0x476f90(_0x5d401a);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 9ab5083..8770e0b 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 _0x036a=['destroy','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update'];(function(_0x55097e,_0x2c970e){var _0x469d5c=function(_0x22545f){while(--_0x22545f){_0x55097e['push'](_0x55097e['shift']());}};_0x469d5c(++_0x2c970e);}(_0x036a,0x133));var _0xa036=function(_0x1f34bc,_0x1e4df5){_0x1f34bc=_0x1f34bc-0x0;var _0x28f297=_0x036a[_0x1f34bc];return _0x28f297;};'use strict';var multer=require(_0xa036('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa036('0x1'));var router=express[_0xa036('0x2')]();var auth=require(_0xa036('0x3'));var interaction=require(_0xa036('0x4'));var config=require(_0xa036('0x5'));var controller=require(_0xa036('0x6'));router[_0xa036('0x7')]('/',auth[_0xa036('0x8')](),controller[_0xa036('0x9')]);router[_0xa036('0x7')](_0xa036('0xa'),auth[_0xa036('0x8')](),controller[_0xa036('0xb')]);router['get']('/:id',auth[_0xa036('0x8')](),controller[_0xa036('0xc')]);router['post']('/',auth[_0xa036('0x8')](),controller['create']);router[_0xa036('0xd')](_0xa036('0xe'),auth[_0xa036('0x8')](),controller[_0xa036('0xf')]);router['delete']('/:id',auth[_0xa036('0x8')](),controller[_0xa036('0x10')]);module['exports']=router; \ No newline at end of file +var _0x812f=['../../config/environment','./voiceDialReport.controller','get','index','describe','/:id','show','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x812f,0xd2));var _0xf812=function(_0x29a41c,_0x278eb9){_0x29a41c=_0x29a41c-0x0;var _0x4e6983=_0x812f[_0x29a41c];return _0x4e6983;};'use strict';var multer=require(_0xf812('0x0'));var util=require('util');var path=require(_0xf812('0x1'));var timeout=require(_0xf812('0x2'));var express=require('express');var router=express[_0xf812('0x3')]();var auth=require(_0xf812('0x4'));var interaction=require(_0xf812('0x5'));var config=require(_0xf812('0x6'));var controller=require(_0xf812('0x7'));router[_0xf812('0x8')]('/',auth['isAuthenticated'](),controller[_0xf812('0x9')]);router[_0xf812('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xf812('0xa')]);router[_0xf812('0x8')](_0xf812('0xb'),auth['isAuthenticated'](),controller[_0xf812('0xc')]);router['post']('/',auth[_0xf812('0xd')](),controller['create']);router['put'](_0xf812('0xb'),auth[_0xf812('0xd')](),controller[_0xf812('0xe')]);router[_0xf812('0xf')](_0xf812('0xb'),auth[_0xf812('0xd')](),controller[_0xf812('0x10')]);module[_0xf812('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a125782..25eec65 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 _0xd671=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x1310a1,_0x49d28a){var _0x307353=function(_0x48b2af){while(--_0x48b2af){_0x1310a1['push'](_0x1310a1['shift']());}};_0x307353(++_0x49d28a);}(_0xd671,0x172));var _0x1d67=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0xd671[_0x3c858f];return _0x198090;};'use strict';var Sequelize=require(_0x1d67('0x0'));module[_0x1d67('0x1')]={'privilege':{'type':Sequelize[_0x1d67('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1d67('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1d67('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1d67('0x2')]},'connectedlinename':{'type':Sequelize[_0x1d67('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1d67('0x2')]},'context':{'type':Sequelize[_0x1d67('0x2')]},'exten':{'type':Sequelize[_0x1d67('0x2')]},'priority':{'type':Sequelize[_0x1d67('0x3')]},'uniqueid':{'type':Sequelize[_0x1d67('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x1d67('0x2')]},'destchannelstate':{'type':Sequelize[_0x1d67('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x1d67('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1d67('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1d67('0x2')]},'destlanguage':{'type':Sequelize[_0x1d67('0x2')]},'destaccountcode':{'type':Sequelize[_0x1d67('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x1d67('0x2')]},'destpriority':{'type':Sequelize[_0x1d67('0x3')]},'destuniqueid':{'type':Sequelize[_0x1d67('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x1d67('0x2')]},'dialstatus':{'type':Sequelize[_0x1d67('0x2')]},'starttime':{'type':Sequelize[_0x1d67('0x4')]},'answertime':{'type':Sequelize[_0x1d67('0x4')]},'endtime':{'type':Sequelize[_0x1d67('0x4')]},'lastevent':{'type':Sequelize[_0x1d67('0x2')],'comment':_0x1d67('0x5')},'routeId':{'type':Sequelize[_0x1d67('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1d67('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x20ad=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x1879a6,_0x2cb4df){var _0x3ca317=function(_0x2c15d2){while(--_0x2c15d2){_0x1879a6['push'](_0x1879a6['shift']());}};_0x3ca317(++_0x2cb4df);}(_0x20ad,0x13a));var _0xd20a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x20ad[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xd20a('0x0'));module[_0xd20a('0x1')]={'privilege':{'type':Sequelize[_0xd20a('0x2')]},'channel':{'type':Sequelize[_0xd20a('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd20a('0x2')]},'calleridnum':{'type':Sequelize[_0xd20a('0x2')]},'calleridname':{'type':Sequelize[_0xd20a('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd20a('0x2')]},'connectedlinename':{'type':Sequelize[_0xd20a('0x2')]},'language':{'type':Sequelize[_0xd20a('0x2')]},'accountcode':{'type':Sequelize[_0xd20a('0x2')]},'context':{'type':Sequelize[_0xd20a('0x2')]},'exten':{'type':Sequelize[_0xd20a('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xd20a('0x2')]},'linkedid':{'type':Sequelize[_0xd20a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd20a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xd20a('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd20a('0x2')]},'destcalleridname':{'type':Sequelize[_0xd20a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd20a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd20a('0x2')]},'destlanguage':{'type':Sequelize[_0xd20a('0x2')]},'destaccountcode':{'type':Sequelize[_0xd20a('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd20a('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xd20a('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xd20a('0x2')]},'dialstatus':{'type':Sequelize[_0xd20a('0x2')]},'starttime':{'type':Sequelize[_0xd20a('0x4')]},'answertime':{'type':Sequelize[_0xd20a('0x4')]},'endtime':{'type':Sequelize[_0xd20a('0x4')]},'lastevent':{'type':Sequelize[_0xd20a('0x2')],'comment':_0xd20a('0x5')},'routeId':{'type':Sequelize[_0xd20a('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd20a('0x3')]},'billableseconds':{'type':Sequelize[_0xd20a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8d13209..f28326c 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 _0x6873=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','map','key','field','filter','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','VoiceDialReport','model'];(function(_0x85a934,_0x535eb2){var _0x22d263=function(_0x2d0b5f){while(--_0x2d0b5f){_0x85a934['push'](_0x85a934['shift']());}};_0x22d263(++_0x535eb2);}(_0x6873,0xac));var _0x3687=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x6873[_0x53f897];return _0x6879f8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3687('0x0'));var zipdir=require(_0x3687('0x1'));var jsonpatch=require(_0x3687('0x2'));var rp=require(_0x3687('0x3'));var moment=require(_0x3687('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3687('0x5'));var util=require('util');var path=require(_0x3687('0x6'));var sox=require(_0x3687('0x7'));var csv=require('to-csv');var ejs=require(_0x3687('0x8'));var fs=require('fs');var _=require(_0x3687('0x9'));var squel=require(_0x3687('0xa'));var crypto=require(_0x3687('0xb'));var jsforce=require(_0x3687('0xc'));var deskjs=require(_0x3687('0xd'));var toCsv=require(_0x3687('0xe'));var querystring=require(_0x3687('0xf'));var Papa=require(_0x3687('0x10'));var Redis=require('ioredis');var authService=require(_0x3687('0x11'));var qs=require(_0x3687('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3687('0x13'))(_0x3687('0x14'));var utils=require(_0x3687('0x15'));var config=require(_0x3687('0x16'));var db=require(_0x3687('0x17'))['db'];function respondWithStatusCode(_0x538d18,_0x4555b9){_0x4555b9=_0x4555b9||0xcc;return function(_0x5742cd){if(_0x5742cd){return _0x538d18['sendStatus'](_0x4555b9);}return _0x538d18[_0x3687('0x18')](_0x4555b9)[_0x3687('0x19')]();};}function respondWithResult(_0x16bec2,_0x1ab9ee){_0x1ab9ee=_0x1ab9ee||0xc8;return function(_0x44aab2){if(_0x44aab2){return _0x16bec2[_0x3687('0x18')](_0x1ab9ee)[_0x3687('0x1a')](_0x44aab2);}};}function respondWithFilteredResult(_0x40a9f4,_0x818da5){return function(_0x4879d0){if(_0x4879d0){var _0x2afd7f=_0x4879d0['count'],_0xe62468=_0x818da5[_0x3687('0x1b')],_0x411002=_0x818da5[_0x3687('0x1b')]+_0x818da5[_0x3687('0x1c')],_0x541726;if(_0x411002>=_0x2afd7f){_0x411002=_0x2afd7f;_0x541726=0xc8;}else{_0x541726=0xce;}_0x40a9f4[_0x3687('0x18')](_0x541726);return _0x40a9f4[_0x3687('0x1d')](_0x3687('0x1e'),_0xe62468+'-'+_0x411002+'/'+_0x2afd7f)['json'](_0x4879d0);}return null;};}function patchUpdates(_0x468859){return function(_0x149320){try{jsonpatch[_0x3687('0x1f')](_0x149320,_0x468859,!![]);}catch(_0xbd6230){return BPromise['reject'](_0xbd6230);}return _0x149320[_0x3687('0x20')]();};}function saveUpdates(_0x57838d,_0x2f34b6){return function(_0x4cbbd1){if(_0x4cbbd1){return _0x4cbbd1[_0x3687('0x21')](_0x57838d)[_0x3687('0x22')](function(_0x18b722){return _0x18b722;});}return null;};}function removeEntity(_0x3f0f4e,_0x1ad11a){return function(_0x14521e){if(_0x14521e){return _0x14521e[_0x3687('0x23')]()[_0x3687('0x22')](function(){_0x3f0f4e[_0x3687('0x18')](0xcc)[_0x3687('0x19')]();});}};}function handleEntityNotFound(_0x159a49,_0x203f09){return function(_0x54a905){if(!_0x54a905){_0x159a49['sendStatus'](0x194);}return _0x54a905;};}function handleError(_0x5f4420,_0x16dbac){_0x16dbac=_0x16dbac||0x1f4;return function(_0xe0d37){logger[_0x3687('0x24')](_0xe0d37[_0x3687('0x25')]);if(_0xe0d37[_0x3687('0x26')]){delete _0xe0d37[_0x3687('0x26')];}_0x5f4420[_0x3687('0x18')](_0x16dbac)['send'](_0xe0d37);};}exports['index']=function(_0xad9d7d,_0x52101c){var _0x2f418f={},_0x30be03={},_0x4e05e1={'count':0x0,'rows':[]};var _0x547d79=db[_0x3687('0x27')]['rawAttributes'];_0x30be03[_0x3687('0x28')]=_[_0x3687('0x29')](_0x547d79);_0x30be03[_0x3687('0x2a')]=_[_0x3687('0x29')](_0xad9d7d['query']);_0x30be03[_0x3687('0x2b')]=_[_0x3687('0x2c')](_0x30be03[_0x3687('0x28')],_0x30be03['query']);_0x2f418f[_0x3687('0x2d')]=_[_0x3687('0x2c')](_0x30be03[_0x3687('0x28')],qs[_0x3687('0x2e')](_0xad9d7d[_0x3687('0x2a')][_0x3687('0x2e')]));_0x2f418f['attributes']=_0x2f418f['attributes'][_0x3687('0x2f')]?_0x2f418f[_0x3687('0x2d')]:_0x30be03['model'];if(!_0xad9d7d['query'][_0x3687('0x30')](_0x3687('0x31'))){_0x2f418f[_0x3687('0x1c')]=qs[_0x3687('0x1c')](_0xad9d7d['query'][_0x3687('0x1c')]);_0x2f418f[_0x3687('0x1b')]=qs[_0x3687('0x1b')](_0xad9d7d[_0x3687('0x2a')]['offset']);}_0x2f418f[_0x3687('0x32')]=qs['sort'](_0xad9d7d['query']['sort']);_0x2f418f[_0x3687('0x33')]=qs[_0x3687('0x2b')](_[_0x3687('0x34')](_0xad9d7d[_0x3687('0x2a')],_0x30be03['filters']));if(_0xad9d7d[_0x3687('0x2a')]['filter']){_0x2f418f[_0x3687('0x33')]=_[_0x3687('0x35')](_0x2f418f[_0x3687('0x33')],{'$or':_[_0x3687('0x36')](_0x547d79,function(_0x5d0e4f){if(_0x5d0e4f['type'][_0x3687('0x37')]!=='VIRTUAL'){var _0x364486={};_0x364486[_0x5d0e4f[_0x3687('0x38')]]={'$like':'%'+_0xad9d7d[_0x3687('0x2a')][_0x3687('0x39')]+'%'};return _0x364486;}})});}_0x2f418f=_[_0x3687('0x35')]({},_0x2f418f,_0xad9d7d[_0x3687('0x3a')]);var _0x98e6da={'where':_0x2f418f[_0x3687('0x33')]};return db[_0x3687('0x27')][_0x3687('0x3b')](_0x98e6da)[_0x3687('0x22')](function(_0x6113ee){_0x4e05e1['count']=_0x6113ee;if(_0xad9d7d[_0x3687('0x2a')][_0x3687('0x3c')]){_0x2f418f[_0x3687('0x3d')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x3687('0x3e')](_0x2f418f);})['then'](function(_0x20edd9){_0x4e05e1[_0x3687('0x3f')]=_0x20edd9;return _0x4e05e1;})['then'](respondWithFilteredResult(_0x52101c,_0x2f418f))['catch'](handleError(_0x52101c,null));};exports[_0x3687('0x40')]=function(_0x91c580,_0x5dbc9a){var _0x45451d={'raw':!![],'where':{'id':_0x91c580[_0x3687('0x41')]['id']}},_0x123ee6={};_0x123ee6['model']=_[_0x3687('0x29')](db[_0x3687('0x27')]['rawAttributes']);_0x123ee6['query']=_[_0x3687('0x29')](_0x91c580['query']);_0x123ee6['filters']=_[_0x3687('0x2c')](_0x123ee6[_0x3687('0x28')],_0x123ee6[_0x3687('0x2a')]);_0x45451d[_0x3687('0x2d')]=_['intersection'](_0x123ee6[_0x3687('0x28')],qs[_0x3687('0x2e')](_0x91c580[_0x3687('0x2a')][_0x3687('0x2e')]));_0x45451d[_0x3687('0x2d')]=_0x45451d[_0x3687('0x2d')][_0x3687('0x2f')]?_0x45451d['attributes']:_0x123ee6[_0x3687('0x28')];if(_0x91c580[_0x3687('0x2a')]['includeAll']){_0x45451d[_0x3687('0x3d')]=[{'all':!![]}];}_0x45451d=_['merge']({},_0x45451d,_0x91c580[_0x3687('0x3a')]);return db['VoiceDialReport'][_0x3687('0x42')](_0x45451d)[_0x3687('0x22')](handleEntityNotFound(_0x5dbc9a,null))[_0x3687('0x22')](respondWithResult(_0x5dbc9a,null))[_0x3687('0x43')](handleError(_0x5dbc9a,null));};exports['create']=function(_0x5701e9,_0x2097cb){return db['VoiceDialReport'][_0x3687('0x44')](_0x5701e9[_0x3687('0x45')],{})['then'](respondWithResult(_0x2097cb,0xc9))['catch'](handleError(_0x2097cb,null));};exports[_0x3687('0x21')]=function(_0x1dca36,_0x1db01b){if(_0x1dca36[_0x3687('0x45')]['id']){delete _0x1dca36[_0x3687('0x45')]['id'];}return db[_0x3687('0x27')][_0x3687('0x42')]({'where':{'id':_0x1dca36['params']['id']}})['then'](handleEntityNotFound(_0x1db01b,null))[_0x3687('0x22')](saveUpdates(_0x1dca36[_0x3687('0x45')],null))[_0x3687('0x22')](respondWithResult(_0x1db01b,null))[_0x3687('0x43')](handleError(_0x1db01b,null));};exports['destroy']=function(_0x2c3933,_0x1049ea){return db[_0x3687('0x27')]['find']({'where':{'id':_0x2c3933[_0x3687('0x41')]['id']}})['then'](handleEntityNotFound(_0x1049ea,null))[_0x3687('0x22')](removeEntity(_0x1049ea,null))['catch'](handleError(_0x1049ea,null));};exports[_0x3687('0x46')]=function(_0x241da3,_0x22a6f2){return db[_0x3687('0x27')][_0x3687('0x46')]()[_0x3687('0x22')](respondWithResult(_0x22a6f2,null))['catch'](handleError(_0x22a6f2,null));}; \ No newline at end of file +var _0x87f8=['set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','map','type','key','field','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit'];(function(_0x26f216,_0x2dfa9b){var _0x4d2915=function(_0x21fe03){while(--_0x21fe03){_0x26f216['push'](_0x26f216['shift']());}};_0x4d2915(++_0x2dfa9b);}(_0x87f8,0x152));var _0x887f=function(_0x51c336,_0x2e08a4){_0x51c336=_0x51c336-0x0;var _0x49db03=_0x87f8[_0x51c336];return _0x49db03;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x887f('0x0'));var jsonpatch=require(_0x887f('0x1'));var rp=require('request-promise');var moment=require(_0x887f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x887f('0x3'));var util=require(_0x887f('0x4'));var path=require(_0x887f('0x5'));var sox=require(_0x887f('0x6'));var csv=require('to-csv');var ejs=require(_0x887f('0x7'));var fs=require('fs');var _=require(_0x887f('0x8'));var squel=require(_0x887f('0x9'));var crypto=require(_0x887f('0xa'));var jsforce=require(_0x887f('0xb'));var deskjs=require(_0x887f('0xc'));var toCsv=require(_0x887f('0xd'));var querystring=require('querystring');var Papa=require(_0x887f('0xe'));var Redis=require('ioredis');var authService=require(_0x887f('0xf'));var qs=require(_0x887f('0x10'));var hardwareService=require(_0x887f('0x11'));var logger=require(_0x887f('0x12'))('api');var utils=require(_0x887f('0x13'));var config=require(_0x887f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49eac7,_0x32cd6a){_0x32cd6a=_0x32cd6a||0xcc;return function(_0x32b6c4){if(_0x32b6c4){return _0x49eac7[_0x887f('0x15')](_0x32cd6a);}return _0x49eac7['status'](_0x32cd6a)[_0x887f('0x16')]();};}function respondWithResult(_0x3abe48,_0x571066){_0x571066=_0x571066||0xc8;return function(_0x16bbc4){if(_0x16bbc4){return _0x3abe48[_0x887f('0x17')](_0x571066)['json'](_0x16bbc4);}};}function respondWithFilteredResult(_0xabcefd,_0x46920e){return function(_0x59ed6c){if(_0x59ed6c){var _0x3f189a=_0x59ed6c[_0x887f('0x18')],_0xf69779=_0x46920e[_0x887f('0x19')],_0x9f5d78=_0x46920e['offset']+_0x46920e[_0x887f('0x1a')],_0x486b46;if(_0x9f5d78>=_0x3f189a){_0x9f5d78=_0x3f189a;_0x486b46=0xc8;}else{_0x486b46=0xce;}_0xabcefd[_0x887f('0x17')](_0x486b46);return _0xabcefd[_0x887f('0x1b')](_0x887f('0x1c'),_0xf69779+'-'+_0x9f5d78+'/'+_0x3f189a)[_0x887f('0x1d')](_0x59ed6c);}return null;};}function patchUpdates(_0x19a134){return function(_0x3ced63){try{jsonpatch[_0x887f('0x1e')](_0x3ced63,_0x19a134,!![]);}catch(_0x342e8e){return BPromise[_0x887f('0x1f')](_0x342e8e);}return _0x3ced63[_0x887f('0x20')]();};}function saveUpdates(_0x366aae,_0x3bb998){return function(_0x4deddd){if(_0x4deddd){return _0x4deddd[_0x887f('0x21')](_0x366aae)[_0x887f('0x22')](function(_0x49af51){return _0x49af51;});}return null;};}function removeEntity(_0x11479b,_0x8e4ca8){return function(_0x48fd49){if(_0x48fd49){return _0x48fd49[_0x887f('0x23')]()['then'](function(){_0x11479b[_0x887f('0x17')](0xcc)[_0x887f('0x16')]();});}};}function handleEntityNotFound(_0x566fb9,_0x338777){return function(_0x3af68e){if(!_0x3af68e){_0x566fb9[_0x887f('0x15')](0x194);}return _0x3af68e;};}function handleError(_0x9f7131,_0x538285){_0x538285=_0x538285||0x1f4;return function(_0x2bfe06){logger[_0x887f('0x24')](_0x2bfe06[_0x887f('0x25')]);if(_0x2bfe06[_0x887f('0x26')]){delete _0x2bfe06[_0x887f('0x26')];}_0x9f7131['status'](_0x538285)[_0x887f('0x27')](_0x2bfe06);};}exports[_0x887f('0x28')]=function(_0x108890,_0x4f25b1){var _0x267e67={},_0x596db8={},_0x49b715={'count':0x0,'rows':[]};var _0x36cd1a=db[_0x887f('0x29')][_0x887f('0x2a')];_0x596db8[_0x887f('0x2b')]=_[_0x887f('0x2c')](_0x36cd1a);_0x596db8['query']=_['keys'](_0x108890[_0x887f('0x2d')]);_0x596db8[_0x887f('0x2e')]=_[_0x887f('0x2f')](_0x596db8[_0x887f('0x2b')],_0x596db8['query']);_0x267e67[_0x887f('0x30')]=_['intersection'](_0x596db8[_0x887f('0x2b')],qs['fields'](_0x108890[_0x887f('0x2d')][_0x887f('0x31')]));_0x267e67[_0x887f('0x30')]=_0x267e67[_0x887f('0x30')][_0x887f('0x32')]?_0x267e67[_0x887f('0x30')]:_0x596db8[_0x887f('0x2b')];if(!_0x108890[_0x887f('0x2d')]['hasOwnProperty'](_0x887f('0x33'))){_0x267e67[_0x887f('0x1a')]=qs[_0x887f('0x1a')](_0x108890[_0x887f('0x2d')][_0x887f('0x1a')]);_0x267e67[_0x887f('0x19')]=qs['offset'](_0x108890[_0x887f('0x2d')][_0x887f('0x19')]);}_0x267e67[_0x887f('0x34')]=qs[_0x887f('0x35')](_0x108890[_0x887f('0x2d')]['sort']);_0x267e67[_0x887f('0x36')]=qs[_0x887f('0x2e')](_['pick'](_0x108890[_0x887f('0x2d')],_0x596db8[_0x887f('0x2e')]));if(_0x108890[_0x887f('0x2d')]['filter']){_0x267e67[_0x887f('0x36')]=_[_0x887f('0x37')](_0x267e67[_0x887f('0x36')],{'$or':_[_0x887f('0x38')](_0x36cd1a,function(_0x580bae){if(_0x580bae[_0x887f('0x39')][_0x887f('0x3a')]!=='VIRTUAL'){var _0x51e449={};_0x51e449[_0x580bae[_0x887f('0x3b')]]={'$like':'%'+_0x108890[_0x887f('0x2d')][_0x887f('0x3c')]+'%'};return _0x51e449;}})});}_0x267e67=_['merge']({},_0x267e67,_0x108890[_0x887f('0x3d')]);var _0x585eef={'where':_0x267e67['where']};return db[_0x887f('0x29')][_0x887f('0x18')](_0x585eef)[_0x887f('0x22')](function(_0x5e9782){_0x49b715[_0x887f('0x18')]=_0x5e9782;if(_0x108890[_0x887f('0x2d')][_0x887f('0x3e')]){_0x267e67['include']=[{'all':!![]}];}return db[_0x887f('0x29')][_0x887f('0x3f')](_0x267e67);})['then'](function(_0x4022fa){_0x49b715[_0x887f('0x40')]=_0x4022fa;return _0x49b715;})[_0x887f('0x22')](respondWithFilteredResult(_0x4f25b1,_0x267e67))[_0x887f('0x41')](handleError(_0x4f25b1,null));};exports[_0x887f('0x42')]=function(_0xd6bf57,_0x5b59bd){var _0x1e4b9b={'raw':!![],'where':{'id':_0xd6bf57[_0x887f('0x43')]['id']}},_0x2894f2={};_0x2894f2[_0x887f('0x2b')]=_[_0x887f('0x2c')](db[_0x887f('0x29')][_0x887f('0x2a')]);_0x2894f2['query']=_[_0x887f('0x2c')](_0xd6bf57[_0x887f('0x2d')]);_0x2894f2[_0x887f('0x2e')]=_[_0x887f('0x2f')](_0x2894f2['model'],_0x2894f2[_0x887f('0x2d')]);_0x1e4b9b[_0x887f('0x30')]=_['intersection'](_0x2894f2[_0x887f('0x2b')],qs['fields'](_0xd6bf57['query'][_0x887f('0x31')]));_0x1e4b9b[_0x887f('0x30')]=_0x1e4b9b[_0x887f('0x30')][_0x887f('0x32')]?_0x1e4b9b[_0x887f('0x30')]:_0x2894f2[_0x887f('0x2b')];if(_0xd6bf57['query'][_0x887f('0x3e')]){_0x1e4b9b[_0x887f('0x44')]=[{'all':!![]}];}_0x1e4b9b=_[_0x887f('0x37')]({},_0x1e4b9b,_0xd6bf57[_0x887f('0x3d')]);return db[_0x887f('0x29')][_0x887f('0x45')](_0x1e4b9b)[_0x887f('0x22')](handleEntityNotFound(_0x5b59bd,null))[_0x887f('0x22')](respondWithResult(_0x5b59bd,null))[_0x887f('0x41')](handleError(_0x5b59bd,null));};exports[_0x887f('0x46')]=function(_0x5059b5,_0x4e5c4e){return db[_0x887f('0x29')][_0x887f('0x46')](_0x5059b5['body'],{})[_0x887f('0x22')](respondWithResult(_0x4e5c4e,0xc9))[_0x887f('0x41')](handleError(_0x4e5c4e,null));};exports['update']=function(_0x3293a8,_0x3434fd){if(_0x3293a8[_0x887f('0x47')]['id']){delete _0x3293a8[_0x887f('0x47')]['id'];}return db[_0x887f('0x29')][_0x887f('0x45')]({'where':{'id':_0x3293a8[_0x887f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3434fd,null))['then'](saveUpdates(_0x3293a8[_0x887f('0x47')],null))[_0x887f('0x22')](respondWithResult(_0x3434fd,null))['catch'](handleError(_0x3434fd,null));};exports[_0x887f('0x23')]=function(_0x3fcd12,_0x2bdd65){return db[_0x887f('0x29')][_0x887f('0x45')]({'where':{'id':_0x3fcd12[_0x887f('0x43')]['id']}})['then'](handleEntityNotFound(_0x2bdd65,null))['then'](removeEntity(_0x2bdd65,null))[_0x887f('0x41')](handleError(_0x2bdd65,null));};exports['describe']=function(_0x35553f,_0x56a96d){return db[_0x887f('0x29')][_0x887f('0x48')]()[_0x887f('0x22')](respondWithResult(_0x56a96d,null))[_0x887f('0x41')](handleError(_0x56a96d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 588365d..4adb046 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 _0xaf4c=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial'];(function(_0x1a7244,_0x3d99d9){var _0x5c4e9f=function(_0xe168b8){while(--_0xe168b8){_0x1a7244['push'](_0x1a7244['shift']());}};_0x5c4e9f(++_0x3d99d9);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x10ed60,_0x4c7476){_0x10ed60=_0x10ed60-0x0;var _0x565494=_0xaf4c[_0x10ed60];return _0x565494;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))('api');var moment=require(_0xcaf4('0x2'));var BPromise=require(_0xcaf4('0x3'));var rp=require(_0xcaf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module['exports']=function(_0x21ad95,_0x548527){return _0x21ad95[_0xcaf4('0x8')](_0xcaf4('0x9'),attributes,{'tableName':_0xcaf4('0xa'),'paranoid':![],'indexes':[{'fields':[_0xcaf4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e77=['rimraf','../../config/environment','define','report_dial','uniqueid','util','moment','bluebird','path'];(function(_0x5b6cc7,_0x51e742){var _0x30a04f=function(_0x5f50f){while(--_0x5f50f){_0x5b6cc7['push'](_0x5b6cc7['shift']());}};_0x30a04f(++_0x51e742);}(_0x6e77,0xef));var _0x76e7=function(_0xfc8faf,_0x86244a){_0xfc8faf=_0xfc8faf-0x0;var _0x48c40b=_0x6e77[_0xfc8faf];return _0x48c40b;};'use strict';var _=require('lodash');var util=require(_0x76e7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x76e7('0x1'));var BPromise=require(_0x76e7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e7('0x3'));var rimraf=require(_0x76e7('0x4'));var config=require(_0x76e7('0x5'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x423b7a,_0xf4d008){return _0x423b7a[_0x76e7('0x6')]('VoiceDialReport',attributes,{'tableName':_0x76e7('0x7'),'paranoid':![],'indexes':[{'fields':[_0x76e7('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 77097c8..f3565ed 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 _0xe009=['rpc','../../config/environment','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','debug','UpdateVoiceDialReport','update','where','attributes','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5011f5,_0x92181b){var _0x2b0e3f=function(_0x47393c){while(--_0x47393c){_0x5011f5['push'](_0x5011f5['shift']());}};_0x2b0e3f(++_0x92181b);}(_0xe009,0x122));var _0x9e00=function(_0x1ee700,_0x33dfc7){_0x1ee700=_0x1ee700-0x0;var _0x2a239e=_0xe009[_0x1ee700];return _0x2a239e;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var moment=require(_0x9e00('0x2'));var BPromise=require(_0x9e00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e00('0x5'));var logger=require(_0x9e00('0x6'))(_0x9e00('0x7'));var config=require(_0x9e00('0x8'));var jayson=require(_0x9e00('0x9'));var client=jayson[_0x9e00('0xa')][_0x9e00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x402bb0,_0x22417d,_0x1eb956){return new BPromise(function(_0x5da6a4,_0x292a51){return client['request'](_0x402bb0,_0x1eb956)['then'](function(_0x531c9b){logger[_0x9e00('0xc')](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));logger['debug'](_0x9e00('0xf'),_0x22417d,_0x9e00('0xe'),JSON[_0x9e00('0x10')](_0x531c9b));if(_0x531c9b['error']){if(_0x531c9b[_0x9e00('0x11')]['code']===0x1f4){logger['error'](_0x9e00('0xd'),_0x22417d,_0x531c9b['error'][_0x9e00('0x12')]);return _0x292a51(_0x531c9b[_0x9e00('0x11')][_0x9e00('0x12')]);}logger[_0x9e00('0x11')](_0x9e00('0xd'),_0x22417d,_0x531c9b[_0x9e00('0x11')]['message']);return _0x5da6a4(_0x531c9b['error'][_0x9e00('0x12')]);}else{logger['info'](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));_0x5da6a4(_0x531c9b[_0x9e00('0x13')][_0x9e00('0x12')]);}})['catch'](function(_0x4f9007){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x22417d,_0x4f9007);_0x292a51(_0x4f9007);});});}exports[_0x9e00('0x14')]=function(_0x5971eb){var _0x2c88e9=this;return new Promise(function(_0x4402b,_0x4d5527){return db[_0x9e00('0x15')][_0x9e00('0x16')](_0x5971eb[_0x9e00('0x17')],{'raw':_0x5971eb[_0x9e00('0x18')]?_0x5971eb[_0x9e00('0x18')][_0x9e00('0x19')]===undefined?!![]:![]:!![]})[_0x9e00('0x1a')](function(_0x306094){logger['info']('CreateVoiceDialReport',_0x5971eb);logger[_0x9e00('0x1b')](_0x9e00('0x14'),_0x5971eb,JSON[_0x9e00('0x10')](_0x306094));_0x4402b(_0x306094);})['catch'](function(_0x217bcd){logger[_0x9e00('0x11')](_0x9e00('0x14'),_0x217bcd['message'],_0x5971eb);_0x4d5527(_0x2c88e9[_0x9e00('0x11')](0x1f4,_0x217bcd[_0x9e00('0x12')]));});});};exports[_0x9e00('0x1c')]=function(_0x781601){var _0x826a6=this;return new Promise(function(_0xe40857,_0x12df8e){return db[_0x9e00('0x15')][_0x9e00('0x1d')](_0x781601[_0x9e00('0x17')],{'raw':_0x781601[_0x9e00('0x18')]?_0x781601[_0x9e00('0x18')][_0x9e00('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x781601[_0x9e00('0x18')]?_0x781601[_0x9e00('0x18')][_0x9e00('0x1e')]||null:null,'attributes':_0x781601[_0x9e00('0x18')]?_0x781601[_0x9e00('0x18')][_0x9e00('0x1f')]||null:null,'limit':_0x781601['options']?_0x781601['options']['limit']||null:null})[_0x9e00('0x1a')](function(_0xd88357){logger[_0x9e00('0xc')](_0x9e00('0x1c'),_0x781601);logger['debug'](_0x9e00('0x1c'),_0x781601,JSON[_0x9e00('0x10')](_0xd88357));_0xe40857(_0xd88357);})[_0x9e00('0x20')](function(_0x54a102){logger[_0x9e00('0x11')](_0x9e00('0x1c'),_0x54a102[_0x9e00('0x12')],_0x781601);_0x12df8e(_0x826a6[_0x9e00('0x11')](0x1f4,_0x54a102[_0x9e00('0x12')]));});});}; \ No newline at end of file +var _0x984b=['CreateVoiceDialReport','update','body','attributes','limit','UpdateVoiceDialReport','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceDialReport','create','options','raw'];(function(_0x3f9b46,_0x36b927){var _0x3315d5=function(_0x447396){while(--_0x447396){_0x3f9b46['push'](_0x3f9b46['shift']());}};_0x3315d5(++_0x36b927);}(_0x984b,0xee));var _0xb984=function(_0x455e3b,_0xf43acf){_0x455e3b=_0x455e3b-0x0;var _0x28b2a5=_0x984b[_0x455e3b];return _0x28b2a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});}exports['CreateVoiceDialReport']=function(_0x396c36){var _0x35bd75=this;return new Promise(function(_0x3a5c96,_0x9afbee){return db[_0xb984('0x13')][_0xb984('0x14')](_0x396c36['body'],{'raw':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x16')]===undefined?!![]:![]:!![]})[_0xb984('0x7')](function(_0x32831b){logger[_0xb984('0x8')]('CreateVoiceDialReport',_0x396c36);logger[_0xb984('0xb')](_0xb984('0x17'),_0x396c36,JSON['stringify'](_0x32831b));_0x3a5c96(_0x32831b);})[_0xb984('0x12')](function(_0x97af5c){logger[_0xb984('0xe')](_0xb984('0x17'),_0x97af5c[_0xb984('0x10')],_0x396c36);_0x9afbee(_0x35bd75[_0xb984('0xe')](0x1f4,_0x97af5c[_0xb984('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x391a1e){var _0x25de23=this;return new Promise(function(_0x1b6be3,_0x5d4d38){return db[_0xb984('0x13')][_0xb984('0x18')](_0x391a1e[_0xb984('0x19')],{'raw':_0x391a1e[_0xb984('0x15')]?_0x391a1e[_0xb984('0x15')][_0xb984('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x391a1e[_0xb984('0x15')]?_0x391a1e[_0xb984('0x15')]['where']||null:null,'attributes':_0x391a1e[_0xb984('0x15')]?_0x391a1e[_0xb984('0x15')][_0xb984('0x1a')]||null:null,'limit':_0x391a1e[_0xb984('0x15')]?_0x391a1e['options'][_0xb984('0x1b')]||null:null})[_0xb984('0x7')](function(_0x476811){logger['info'](_0xb984('0x1c'),_0x391a1e);logger[_0xb984('0xb')](_0xb984('0x1c'),_0x391a1e,JSON[_0xb984('0xd')](_0x476811));_0x1b6be3(_0x476811);})['catch'](function(_0x5b8da1){logger['error'](_0xb984('0x1c'),_0x5b8da1[_0xb984('0x10')],_0x391a1e);_0x5d4d38(_0x25de23['error'](0x1f4,_0x5b8da1[_0xb984('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index c5608b2..74590be 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 _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','/:id/applications','addApplications','put','/:id','update','exports','path','connect-timeout','express','Router'];(function(_0x3f1c28,_0x1f3b4f){var _0x234af6=function(_0xcb3a7f){while(--_0xcb3a7f){_0x3f1c28['push'](_0x3f1c28['shift']());}};_0x234af6(++_0x1f3b4f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4e7844,_0x30ce77){_0x4e7844=_0x4e7844-0x0;var _0x336119=_0x5eb8[_0x4e7844];return _0x336119;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x85eb('0xd')]);router['post'](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0x11'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x12')]);router['delete'](_0x85eb('0x11'),auth[_0x85eb('0x9')](),controller['destroy']);module[_0x85eb('0x13')]=router; \ No newline at end of file +var _0x317b=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','/:id/applications','addApplications','put','update','delete','exports','multer'];(function(_0x4dbe5c,_0x36ed26){var _0x57bd05=function(_0x2ad3e2){while(--_0x2ad3e2){_0x4dbe5c['push'](_0x4dbe5c['shift']());}};_0x57bd05(++_0x36ed26);}(_0x317b,0x1c7));var _0xb317=function(_0xda17d5,_0x30573b){_0xda17d5=_0xda17d5-0x0;var _0x160a7f=_0x317b[_0xda17d5];return _0x160a7f;};'use strict';var multer=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var path=require('path');var timeout=require(_0xb317('0x2'));var express=require(_0xb317('0x3'));var router=express['Router']();var auth=require(_0xb317('0x4'));var interaction=require(_0xb317('0x5'));var config=require(_0xb317('0x6'));var controller=require(_0xb317('0x7'));router[_0xb317('0x8')]('/',auth[_0xb317('0x9')](),controller[_0xb317('0xa')]);router[_0xb317('0x8')](_0xb317('0xb'),auth[_0xb317('0x9')](),controller['show']);router[_0xb317('0xc')]('/',auth[_0xb317('0x9')](),controller['create']);router[_0xb317('0xc')](_0xb317('0xd'),auth[_0xb317('0x9')](),controller[_0xb317('0xe')]);router[_0xb317('0xf')](_0xb317('0xb'),auth['isAuthenticated'](),controller[_0xb317('0x10')]);router[_0xb317('0x11')]('/:id',auth[_0xb317('0x9')](),controller['destroy']);module[_0xb317('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c26b529..ee0a741 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 _0x9348=['compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x9348,0x10d));var _0x8934=function(_0x3440d0,_0x5005c4){_0x3440d0=_0x3440d0-0x0;var _0x5aa155=_0x9348[_0x3440d0];return _0x5aa155;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'context':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'unique':_0x8934('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x8934('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'defaultValue':_0x8934('0x4')},'appdata':{'type':Sequelize[_0x8934('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8934('0x5')](_0x8934('0x6'),_0x8934('0x7'),'internal',_0x8934('0x8'),_0x8934('0x9'),_0x8934('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x8934('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8934('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x8934('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x8934('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x8934('0xb')]},'recordingFormat':{'type':Sequelize[_0x8934('0x2')],'defaultValue':_0x8934('0xd')},'answer':{'type':Sequelize[_0x8934('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x8934('0xe')],'get':function(_0x4a999c){return this[_0x8934('0xf')](_0x8934('0x10'));}}}; \ No newline at end of file +var _0x5b02=['internal','outbound-fax','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b02,0xe9));var _0x25b0=function(_0x501b38,_0x510e2c){_0x501b38=_0x501b38-0x0;var _0x553cfa=_0x5b02[_0x501b38];return _0x553cfa;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'context':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![],'unique':_0x25b0('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![],'defaultValue':_0x25b0('0x4')},'appdata':{'type':Sequelize[_0x25b0('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x25b0('0x5')]('inbound',_0x25b0('0x6'),_0x25b0('0x7'),'inbound-fax',_0x25b0('0x8'),'system','any'),'allowNull':![]},'description':{'type':Sequelize[_0x25b0('0x2')]},'interval':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![],'defaultValue':_0x25b0('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x25b0('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x25b0('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x25b0('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x25b0('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x25b0('0xb')]},'recordingFormat':{'type':Sequelize[_0x25b0('0x2')],'defaultValue':_0x25b0('0xc')},'answer':{'type':Sequelize[_0x25b0('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x25b0('0xd')],'get':function(_0x1d3178){return this[_0x25b0('0xe')](_0x25b0('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 1d09647..e639797 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 _0x1430=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','limit','set','apply','save','then','destroy','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','type','find','name','error','stack','index','VoiceExtension','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InternalRoutes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','recordingFormat','addApplications','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x160b71,_0x2ed489){var _0x32a6e1=function(_0x57c9b3){while(--_0x57c9b3){_0x160b71['push'](_0x160b71['shift']());}};_0x32a6e1(++_0x2ed489);}(_0x1430,0x178));var _0x0143=function(_0x15c9f8,_0x1cc5f2){_0x15c9f8=_0x15c9f8-0x0;var _0x52b276=_0x1430[_0x15c9f8];return _0x52b276;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0143('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0143('0x1'));var rp=require('request-promise');var moment=require(_0x0143('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0143('0x3'));var util=require(_0x0143('0x4'));var path=require(_0x0143('0x5'));var sox=require(_0x0143('0x6'));var csv=require(_0x0143('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0143('0x8'));var squel=require(_0x0143('0x9'));var crypto=require(_0x0143('0xa'));var jsforce=require(_0x0143('0xb'));var deskjs=require(_0x0143('0xc'));var toCsv=require(_0x0143('0x7'));var querystring=require(_0x0143('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0143('0xe'));var qs=require(_0x0143('0xf'));var hardwareService=require(_0x0143('0x10'));var logger=require(_0x0143('0x11'))(_0x0143('0x12'));var utils=require('../../config/utils');var config=require(_0x0143('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0143('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0143('0x15'))(new Redis(config[_0x0143('0x16')]));require('./voiceExtension.socket')[_0x0143('0x17')](socket);function respondWithStatusCode(_0x2a2a2b,_0x1bedc4){_0x1bedc4=_0x1bedc4||0xcc;return function(_0x2ddc24){if(_0x2ddc24){return _0x2a2a2b[_0x0143('0x18')](_0x1bedc4);}return _0x2a2a2b[_0x0143('0x19')](_0x1bedc4)[_0x0143('0x1a')]();};}function respondWithResult(_0x1e1e31,_0x16dfd5){_0x16dfd5=_0x16dfd5||0xc8;return function(_0x3cae50){if(_0x3cae50){return _0x1e1e31[_0x0143('0x19')](_0x16dfd5)[_0x0143('0x1b')](_0x3cae50);}};}function respondWithFilteredResult(_0x55a703,_0x3ce528){return function(_0x8ea0d8){if(_0x8ea0d8){var _0x58ce93=_0x8ea0d8['count'],_0x4a0203=_0x3ce528[_0x0143('0x1c')],_0x59aa78=_0x3ce528[_0x0143('0x1c')]+_0x3ce528[_0x0143('0x1d')],_0x533ace;if(_0x59aa78>=_0x58ce93){_0x59aa78=_0x58ce93;_0x533ace=0xc8;}else{_0x533ace=0xce;}_0x55a703[_0x0143('0x19')](_0x533ace);return _0x55a703[_0x0143('0x1e')]('Content-Range',_0x4a0203+'-'+_0x59aa78+'/'+_0x58ce93)[_0x0143('0x1b')](_0x8ea0d8);}return null;};}function patchUpdates(_0xa48d08){return function(_0x3eb180){try{jsonpatch[_0x0143('0x1f')](_0x3eb180,_0xa48d08,!![]);}catch(_0x21d10d){return BPromise['reject'](_0x21d10d);}return _0x3eb180[_0x0143('0x20')]();};}function saveUpdates(_0x56a87c,_0x203947){return function(_0x2e2b49){if(_0x2e2b49){return _0x2e2b49['update'](_0x56a87c)[_0x0143('0x21')](function(_0x3eb12d){return _0x3eb12d;});}return null;};}function removeEntity(_0x3bd388,_0xb8ddbe){return function(_0x2674d5){if(_0x2674d5){return _0x2674d5[_0x0143('0x22')]()[_0x0143('0x21')](function(){var _0x900392=_0x2674d5[_0x0143('0x23')]({'plain':!![]});var _0x49ad29=[{'name':'InboundRoutes','value':_0x0143('0x24'),'ignore':![]},{'name':_0x0143('0x25'),'value':_0x0143('0x26'),'ignore':![]},{'name':'InternalRoutes','value':_0x0143('0x27'),'ignore':![]}];var _0x119dc9=_(_0x49ad29)[_0x0143('0x28')](_0x0143('0x29'))[_0x0143('0x2a')](_0x0143('0x2b'))['value']();if(_['includes'](_0x119dc9,_0x900392[_0x0143('0x2c')])){return;}var _0x2b6cb2=_[_0x0143('0x2d')](_0x49ad29,[_0x0143('0x2b'),_0x900392[_0x0143('0x2c')]])[_0x0143('0x2e')];return db['UserProfileResource']['destroy']({'where':{'type':_0x2b6cb2,'resourceId':_0x900392['id']}})['then'](function(){return _0x2674d5;});})['then'](function(){_0x3bd388[_0x0143('0x19')](0xcc)[_0x0143('0x1a')]();});}};}function handleEntityNotFound(_0x12fddd,_0x4a66a2){return function(_0x342ce8){if(!_0x342ce8){_0x12fddd['sendStatus'](0x194);}return _0x342ce8;};}function handleError(_0x56b328,_0x38865a){_0x38865a=_0x38865a||0x1f4;return function(_0xc7777f){logger[_0x0143('0x2f')](_0xc7777f[_0x0143('0x30')]);if(_0xc7777f[_0x0143('0x2e')]){delete _0xc7777f[_0x0143('0x2e')];}_0x56b328[_0x0143('0x19')](_0x38865a)['send'](_0xc7777f);};}exports[_0x0143('0x31')]=function(_0x3fdcfe,_0x206afd){var _0x3c6a4e={},_0x3c5e48={},_0x592226={'count':0x0,'rows':[]};var _0xe5570b=db[_0x0143('0x32')][_0x0143('0x33')];_0x3c5e48[_0x0143('0x34')]=_[_0x0143('0x35')](_0xe5570b);_0x3c5e48[_0x0143('0x36')]=_[_0x0143('0x35')](_0x3fdcfe['query']);_0x3c5e48[_0x0143('0x37')]=_[_0x0143('0x38')](_0x3c5e48[_0x0143('0x34')],_0x3c5e48[_0x0143('0x36')]);_0x3c6a4e[_0x0143('0x39')]=_[_0x0143('0x38')](_0x3c5e48[_0x0143('0x34')],qs[_0x0143('0x3a')](_0x3fdcfe[_0x0143('0x36')][_0x0143('0x3a')]));_0x3c6a4e['attributes']=_0x3c6a4e[_0x0143('0x39')][_0x0143('0x3b')]?_0x3c6a4e[_0x0143('0x39')]:_0x3c5e48[_0x0143('0x34')];if(!_0x3fdcfe[_0x0143('0x36')][_0x0143('0x3c')](_0x0143('0x3d'))){_0x3c6a4e[_0x0143('0x1d')]=qs['limit'](_0x3fdcfe[_0x0143('0x36')][_0x0143('0x1d')]);_0x3c6a4e[_0x0143('0x1c')]=qs[_0x0143('0x1c')](_0x3fdcfe[_0x0143('0x36')]['offset']);}_0x3c6a4e[_0x0143('0x3e')]=qs[_0x0143('0x3f')](_0x3fdcfe[_0x0143('0x36')][_0x0143('0x3f')]);_0x3c6a4e[_0x0143('0x40')]=qs['filters'](_['pick'](_0x3fdcfe[_0x0143('0x36')],_0x3c5e48[_0x0143('0x37')]));if(_0x3fdcfe[_0x0143('0x36')][_0x0143('0x28')]){_0x3c6a4e[_0x0143('0x40')]=_['merge'](_0x3c6a4e['where'],{'$or':_[_0x0143('0x2a')](_0xe5570b,function(_0x3d9e71){if(_0x3d9e71[_0x0143('0x2c')]['key']!==_0x0143('0x41')){var _0xfaac29={};_0xfaac29[_0x3d9e71[_0x0143('0x42')]]={'$like':'%'+_0x3fdcfe['query'][_0x0143('0x28')]+'%'};return _0xfaac29;}})});}_0x3c6a4e=_[_0x0143('0x43')]({},_0x3c6a4e,_0x3fdcfe[_0x0143('0x44')]);var _0x2e7954={'where':_0x3c6a4e[_0x0143('0x40')]};return db['VoiceExtension'][_0x0143('0x45')](_0x2e7954)[_0x0143('0x21')](function(_0x423101){_0x592226[_0x0143('0x45')]=_0x423101;if(_0x3fdcfe[_0x0143('0x36')][_0x0143('0x46')]){_0x3c6a4e[_0x0143('0x47')]=[{'all':!![]}];}return db[_0x0143('0x32')][_0x0143('0x48')](_0x3c6a4e);})['then'](function(_0x16c3fb){_0x592226[_0x0143('0x49')]=_0x16c3fb;return _0x592226;})['then'](respondWithFilteredResult(_0x206afd,_0x3c6a4e))[_0x0143('0x4a')](handleError(_0x206afd,null));};exports[_0x0143('0x4b')]=function(_0x3287ea,_0x5dbda4){var _0x4e4e21={'raw':![],'where':{'id':_0x3287ea['params']['id']}},_0x2566e0={};_0x2566e0[_0x0143('0x34')]=_[_0x0143('0x35')](db[_0x0143('0x32')]['rawAttributes']);_0x2566e0[_0x0143('0x36')]=_['keys'](_0x3287ea[_0x0143('0x36')]);_0x2566e0['filters']=_['intersection'](_0x2566e0[_0x0143('0x34')],_0x2566e0[_0x0143('0x36')]);_0x4e4e21[_0x0143('0x39')]=_[_0x0143('0x38')](_0x2566e0[_0x0143('0x34')],qs[_0x0143('0x3a')](_0x3287ea[_0x0143('0x36')]['fields']));_0x4e4e21['attributes']=_0x4e4e21['attributes'][_0x0143('0x3b')]?_0x4e4e21[_0x0143('0x39')]:_0x2566e0[_0x0143('0x34')];if(_0x3287ea[_0x0143('0x36')][_0x0143('0x46')]){_0x4e4e21[_0x0143('0x47')]=[{'all':!![]}];}_0x4e4e21=_[_0x0143('0x43')]({},_0x4e4e21,_0x3287ea[_0x0143('0x44')]);return db[_0x0143('0x32')]['find'](_0x4e4e21)[_0x0143('0x21')](handleEntityNotFound(_0x5dbda4,null))['then'](respondWithResult(_0x5dbda4,null))[_0x0143('0x4a')](handleError(_0x5dbda4,null));};exports[_0x0143('0x22')]=function(_0x2df19b,_0x59fbac){return db[_0x0143('0x32')]['find']({'where':{'id':_0x2df19b[_0x0143('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59fbac,null))[_0x0143('0x21')](removeEntity(_0x59fbac,null))[_0x0143('0x4a')](handleError(_0x59fbac,null));};exports[_0x0143('0x4d')]=function(_0x150403,_0x37792a){if(_0x150403[_0x0143('0x4e')][_0x0143('0x2c')]===_0x0143('0x26')&&!_[_0x0143('0x4f')](_0x150403[_0x0143('0x4e')][_0x0143('0x50')],'_')){_0x150403[_0x0143('0x4e')][_0x0143('0x50')]='_'['concat'](_0x150403['body']['exten']);}return db[_0x0143('0x32')][_0x0143('0x4d')](_0x150403['body'],{'raw':![]})['then'](function(_0x1c592a){var _0x170f0f=_0x150403[_0x0143('0x51')][_0x0143('0x23')]({'plain':!![]});if(!_0x170f0f)throw new Error(_0x0143('0x52'));if(_0x170f0f['role']===_0x0143('0x51')){var _0x27d68c=_0x1c592a[_0x0143('0x23')]({'plain':!![]});var _0x439e57=[{'name':'InboundRoutes','value':_0x0143('0x24')},{'name':_0x0143('0x25'),'value':_0x0143('0x26')},{'name':_0x0143('0x53'),'value':'internal'}];var _0x34b7ae=_[_0x0143('0x2d')](_0x439e57,[_0x0143('0x2b'),_0x27d68c[_0x0143('0x2c')]])[_0x0143('0x2e')];return db['UserProfileSection']['find']({'where':{'name':_0x34b7ae,'userProfileId':_0x170f0f[_0x0143('0x54')]},'raw':!![]})[_0x0143('0x21')](function(_0x26b5e7){if(_0x26b5e7&&_0x26b5e7[_0x0143('0x55')]===0x0){return db[_0x0143('0x56')][_0x0143('0x4d')]({'name':_0x27d68c[_0x0143('0x2e')],'resourceId':_0x27d68c['id'],'type':_0x26b5e7[_0x0143('0x2e')],'sectionId':_0x26b5e7['id']},{})[_0x0143('0x21')](function(){return _0x1c592a;});}else{return _0x1c592a;}})[_0x0143('0x4a')](function(_0x34e720){logger[_0x0143('0x2f')](_0x0143('0x57'),_0x34e720);throw _0x34e720;});}return _0x1c592a;})[_0x0143('0x21')](respondWithResult(_0x37792a,0xc9))['catch'](handleError(_0x37792a,null));};exports['update']=function(_0x39117f,_0x11062f){if(_0x39117f[_0x0143('0x4e')]['id']){delete _0x39117f[_0x0143('0x4e')]['id'];}return db[_0x0143('0x32')]['find']({'where':{'id':_0x39117f[_0x0143('0x4c')]['id']}})[_0x0143('0x21')](handleEntityNotFound(_0x11062f,null))[_0x0143('0x21')](function(_0x5d094b){if(_0x5d094b){return db[_0x0143('0x32')]['update'](_[_0x0143('0x58')](_0x39117f[_0x0143('0x4e')],[_0x0143('0x50'),_0x0143('0x59'),_0x0143('0x5a'),_0x0143('0x5b'),'cutdigits','mandatoryDisposition']),{'where':{'context':_0x5d094b[_0x0143('0x59')],'exten':_0x5d094b[_0x0143('0x50')]},'individualHooks':!![]})[_0x0143('0x21')](function(_0x11045e){return _0x11045e;});}return null;})[_0x0143('0x21')](respondWithStatusCode(_0x11062f,null))[_0x0143('0x4a')](handleError(_0x11062f,null));};exports[_0x0143('0x5c')]=function(_0x10a13b,_0x413908,_0x4383e9){return db[_0x0143('0x32')][_0x0143('0x5d')]({'where':{'id':_0x10a13b['params']['id']}})[_0x0143('0x21')](handleEntityNotFound(_0x413908,null))[_0x0143('0x21')](function(_0x584804){if(_0x584804){return db['sequelize']['transaction'](function(_0x2293cd){return db[_0x0143('0x32')][_0x0143('0x22')]({'where':{'VoiceExtensionId':_0x10a13b['params']['id']},'transaction':_0x2293cd})[_0x0143('0x21')](function(_0x2ea896){var _0xe5d22e=_['map'](_0x10a13b['body'],function(_0x208329){_0x208329[_0x0143('0x5e')]=_0x10a13b['params']['id'];return _0x208329;});return db['VoiceExtension'][_0x0143('0x5f')](_0xe5d22e,{'transaction':_0x2293cd});});})['then'](function(){return db[_0x0143('0x32')][_0x0143('0x60')]({'where':{'isApp':!![],'VoiceExtensionId':_0x10a13b[_0x0143('0x4c')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x0143('0x21')](respondWithResult(_0x413908,null))[_0x0143('0x4a')](handleError(_0x413908,null));}; \ No newline at end of file +var _0x7c79=['error','send','VoiceExtension','rawAttributes','model','keys','filters','query','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','intersection','options','find','params','startsWith','body','exten','concat','create','role','user','UserProfileSection','userProfileId','autoAssociation','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./voiceExtension.socket','register','status','json','count','offset','Content-Range','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','name','UserProfileResource','sendStatus'];(function(_0x1e7ddc,_0x1a8d9b){var _0x18346b=function(_0x264fe4){while(--_0x264fe4){_0x1e7ddc['push'](_0x1e7ddc['shift']());}};_0x18346b(++_0x1a8d9b);}(_0x7c79,0x179));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x97c7('0x0'));var emlformat=require(_0x97c7('0x1'));var rimraf=require(_0x97c7('0x2'));var zipdir=require(_0x97c7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c7('0x4'));var moment=require('moment');var BPromise=require(_0x97c7('0x5'));var Mustache=require(_0x97c7('0x6'));var util=require(_0x97c7('0x7'));var path=require(_0x97c7('0x8'));var sox=require(_0x97c7('0x9'));var csv=require(_0x97c7('0xa'));var ejs=require(_0x97c7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x97c7('0xc'));var crypto=require(_0x97c7('0xd'));var jsforce=require(_0x97c7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97c7('0xf'));var Papa=require(_0x97c7('0x10'));var Redis=require(_0x97c7('0x11'));var authService=require(_0x97c7('0x12'));var qs=require(_0x97c7('0x13'));var hardwareService=require(_0x97c7('0x14'));var logger=require('../../config/logger')(_0x97c7('0x15'));var utils=require(_0x97c7('0x16'));var config=require(_0x97c7('0x17'));var db=require(_0x97c7('0x18'))['db'];config['redis']=_[_0x97c7('0x19')](config[_0x97c7('0x1a')],{'host':_0x97c7('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97c7('0x1a')]));require(_0x97c7('0x1c'))[_0x97c7('0x1d')](socket);function respondWithStatusCode(_0x5578df,_0x3c5fc2){_0x3c5fc2=_0x3c5fc2||0xcc;return function(_0x5a4b67){if(_0x5a4b67){return _0x5578df['sendStatus'](_0x3c5fc2);}return _0x5578df[_0x97c7('0x1e')](_0x3c5fc2)['end']();};}function respondWithResult(_0x5ebf22,_0x4b7f63){_0x4b7f63=_0x4b7f63||0xc8;return function(_0x698317){if(_0x698317){return _0x5ebf22[_0x97c7('0x1e')](_0x4b7f63)[_0x97c7('0x1f')](_0x698317);}};}function respondWithFilteredResult(_0x2c9053,_0x966a2d){return function(_0x23ac6c){if(_0x23ac6c){var _0x491516=_0x23ac6c[_0x97c7('0x20')],_0x7dca3d=_0x966a2d['offset'],_0x51482a=_0x966a2d[_0x97c7('0x21')]+_0x966a2d['limit'],_0x1416ca;if(_0x51482a>=_0x491516){_0x51482a=_0x491516;_0x1416ca=0xc8;}else{_0x1416ca=0xce;}_0x2c9053[_0x97c7('0x1e')](_0x1416ca);return _0x2c9053['set'](_0x97c7('0x22'),_0x7dca3d+'-'+_0x51482a+'/'+_0x491516)[_0x97c7('0x1f')](_0x23ac6c);}return null;};}function patchUpdates(_0x52e43f){return function(_0x2d0a3f){try{jsonpatch['apply'](_0x2d0a3f,_0x52e43f,!![]);}catch(_0x55ff55){return BPromise[_0x97c7('0x23')](_0x55ff55);}return _0x2d0a3f[_0x97c7('0x24')]();};}function saveUpdates(_0x5d519a,_0x1e686f){return function(_0x841a51){if(_0x841a51){return _0x841a51[_0x97c7('0x25')](_0x5d519a)[_0x97c7('0x26')](function(_0x4e863d){return _0x4e863d;});}return null;};}function removeEntity(_0x24affa,_0x54a9e7){return function(_0x32fd10){if(_0x32fd10){return _0x32fd10[_0x97c7('0x27')]()[_0x97c7('0x26')](function(){var _0x71f084=_0x32fd10[_0x97c7('0x28')]({'plain':!![]});var _0x5a66a7=[{'name':_0x97c7('0x29'),'value':_0x97c7('0x2a'),'ignore':![]},{'name':_0x97c7('0x2b'),'value':_0x97c7('0x2c'),'ignore':![]},{'name':_0x97c7('0x2d'),'value':_0x97c7('0x2e'),'ignore':![]}];var _0x39c672=_(_0x5a66a7)['filter'](_0x97c7('0x2f'))[_0x97c7('0x30')](_0x97c7('0x31'))[_0x97c7('0x31')]();if(_[_0x97c7('0x32')](_0x39c672,_0x71f084[_0x97c7('0x33')])){return;}var _0x391606=_['find'](_0x5a66a7,[_0x97c7('0x31'),_0x71f084[_0x97c7('0x33')]])[_0x97c7('0x34')];return db[_0x97c7('0x35')]['destroy']({'where':{'type':_0x391606,'resourceId':_0x71f084['id']}})[_0x97c7('0x26')](function(){return _0x32fd10;});})[_0x97c7('0x26')](function(){_0x24affa[_0x97c7('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2918bd,_0x41186b){return function(_0x47093f){if(!_0x47093f){_0x2918bd[_0x97c7('0x36')](0x194);}return _0x47093f;};}function handleError(_0x570822,_0x15cc80){_0x15cc80=_0x15cc80||0x1f4;return function(_0x29ecde){logger[_0x97c7('0x37')](_0x29ecde['stack']);if(_0x29ecde[_0x97c7('0x34')]){delete _0x29ecde[_0x97c7('0x34')];}_0x570822[_0x97c7('0x1e')](_0x15cc80)[_0x97c7('0x38')](_0x29ecde);};}exports['index']=function(_0x21e1af,_0x236a63){var _0x713060={},_0x57f022={},_0x420cdb={'count':0x0,'rows':[]};var _0x481562=db[_0x97c7('0x39')][_0x97c7('0x3a')];_0x57f022[_0x97c7('0x3b')]=_['keys'](_0x481562);_0x57f022['query']=_[_0x97c7('0x3c')](_0x21e1af['query']);_0x57f022[_0x97c7('0x3d')]=_['intersection'](_0x57f022[_0x97c7('0x3b')],_0x57f022[_0x97c7('0x3e')]);_0x713060[_0x97c7('0x3f')]=_['intersection'](_0x57f022[_0x97c7('0x3b')],qs[_0x97c7('0x40')](_0x21e1af['query'][_0x97c7('0x40')]));_0x713060[_0x97c7('0x3f')]=_0x713060[_0x97c7('0x3f')][_0x97c7('0x41')]?_0x713060[_0x97c7('0x3f')]:_0x57f022[_0x97c7('0x3b')];if(!_0x21e1af[_0x97c7('0x3e')]['hasOwnProperty'](_0x97c7('0x42'))){_0x713060['limit']=qs[_0x97c7('0x43')](_0x21e1af[_0x97c7('0x3e')][_0x97c7('0x43')]);_0x713060[_0x97c7('0x21')]=qs['offset'](_0x21e1af[_0x97c7('0x3e')][_0x97c7('0x21')]);}_0x713060[_0x97c7('0x44')]=qs['sort'](_0x21e1af[_0x97c7('0x3e')][_0x97c7('0x45')]);_0x713060['where']=qs['filters'](_[_0x97c7('0x46')](_0x21e1af[_0x97c7('0x3e')],_0x57f022['filters']));if(_0x21e1af[_0x97c7('0x3e')][_0x97c7('0x47')]){_0x713060[_0x97c7('0x48')]=_[_0x97c7('0x49')](_0x713060[_0x97c7('0x48')],{'$or':_[_0x97c7('0x30')](_0x481562,function(_0x22bea4){if(_0x22bea4[_0x97c7('0x33')][_0x97c7('0x4a')]!==_0x97c7('0x4b')){var _0x46002a={};_0x46002a[_0x22bea4[_0x97c7('0x4c')]]={'$like':'%'+_0x21e1af[_0x97c7('0x3e')][_0x97c7('0x47')]+'%'};return _0x46002a;}})});}_0x713060=_[_0x97c7('0x49')]({},_0x713060,_0x21e1af['options']);var _0x5a121b={'where':_0x713060[_0x97c7('0x48')]};return db[_0x97c7('0x39')]['count'](_0x5a121b)[_0x97c7('0x26')](function(_0x161b80){_0x420cdb[_0x97c7('0x20')]=_0x161b80;if(_0x21e1af[_0x97c7('0x3e')][_0x97c7('0x4d')]){_0x713060[_0x97c7('0x4e')]=[{'all':!![]}];}return db[_0x97c7('0x39')][_0x97c7('0x4f')](_0x713060);})[_0x97c7('0x26')](function(_0x1ec3f2){_0x420cdb[_0x97c7('0x50')]=_0x1ec3f2;return _0x420cdb;})[_0x97c7('0x26')](respondWithFilteredResult(_0x236a63,_0x713060))[_0x97c7('0x51')](handleError(_0x236a63,null));};exports[_0x97c7('0x52')]=function(_0x548f68,_0x14b948){var _0x5c2e76={'raw':![],'where':{'id':_0x548f68['params']['id']}},_0x362eb4={};_0x362eb4[_0x97c7('0x3b')]=_[_0x97c7('0x3c')](db[_0x97c7('0x39')][_0x97c7('0x3a')]);_0x362eb4[_0x97c7('0x3e')]=_[_0x97c7('0x3c')](_0x548f68['query']);_0x362eb4[_0x97c7('0x3d')]=_['intersection'](_0x362eb4[_0x97c7('0x3b')],_0x362eb4[_0x97c7('0x3e')]);_0x5c2e76[_0x97c7('0x3f')]=_[_0x97c7('0x53')](_0x362eb4['model'],qs[_0x97c7('0x40')](_0x548f68[_0x97c7('0x3e')][_0x97c7('0x40')]));_0x5c2e76[_0x97c7('0x3f')]=_0x5c2e76[_0x97c7('0x3f')][_0x97c7('0x41')]?_0x5c2e76['attributes']:_0x362eb4['model'];if(_0x548f68['query'][_0x97c7('0x4d')]){_0x5c2e76[_0x97c7('0x4e')]=[{'all':!![]}];}_0x5c2e76=_[_0x97c7('0x49')]({},_0x5c2e76,_0x548f68[_0x97c7('0x54')]);return db['VoiceExtension'][_0x97c7('0x55')](_0x5c2e76)[_0x97c7('0x26')](handleEntityNotFound(_0x14b948,null))['then'](respondWithResult(_0x14b948,null))['catch'](handleError(_0x14b948,null));};exports[_0x97c7('0x27')]=function(_0x45642f,_0xc6502f){return db[_0x97c7('0x39')][_0x97c7('0x55')]({'where':{'id':_0x45642f[_0x97c7('0x56')]['id']}})[_0x97c7('0x26')](handleEntityNotFound(_0xc6502f,null))[_0x97c7('0x26')](removeEntity(_0xc6502f,null))[_0x97c7('0x51')](handleError(_0xc6502f,null));};exports['create']=function(_0x45fccf,_0x2b831b){if(_0x45fccf['body'][_0x97c7('0x33')]===_0x97c7('0x2c')&&!_[_0x97c7('0x57')](_0x45fccf[_0x97c7('0x58')][_0x97c7('0x59')],'_')){_0x45fccf[_0x97c7('0x58')][_0x97c7('0x59')]='_'[_0x97c7('0x5a')](_0x45fccf[_0x97c7('0x58')][_0x97c7('0x59')]);}return db[_0x97c7('0x39')][_0x97c7('0x5b')](_0x45fccf[_0x97c7('0x58')],{'raw':![]})[_0x97c7('0x26')](function(_0x5bdb81){var _0x3b9b93=_0x45fccf['user'][_0x97c7('0x28')]({'plain':!![]});if(!_0x3b9b93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b9b93[_0x97c7('0x5c')]===_0x97c7('0x5d')){var _0x16c80d=_0x5bdb81[_0x97c7('0x28')]({'plain':!![]});var _0xc1f3aa=[{'name':_0x97c7('0x29'),'value':_0x97c7('0x2a')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x97c7('0x2d'),'value':_0x97c7('0x2e')}];var _0x2879b8=_['find'](_0xc1f3aa,['value',_0x16c80d[_0x97c7('0x33')]])['name'];return db[_0x97c7('0x5e')][_0x97c7('0x55')]({'where':{'name':_0x2879b8,'userProfileId':_0x3b9b93[_0x97c7('0x5f')]},'raw':!![]})['then'](function(_0x24294f){if(_0x24294f&&_0x24294f[_0x97c7('0x60')]===0x0){return db[_0x97c7('0x35')][_0x97c7('0x5b')]({'name':_0x16c80d[_0x97c7('0x34')],'resourceId':_0x16c80d['id'],'type':_0x24294f[_0x97c7('0x34')],'sectionId':_0x24294f['id']},{})[_0x97c7('0x26')](function(){return _0x5bdb81;});}else{return _0x5bdb81;}})[_0x97c7('0x51')](function(_0x3c1ee2){logger[_0x97c7('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c1ee2);throw _0x3c1ee2;});}return _0x5bdb81;})['then'](respondWithResult(_0x2b831b,0xc9))[_0x97c7('0x51')](handleError(_0x2b831b,null));};exports[_0x97c7('0x25')]=function(_0x4bf6a3,_0x20111d){if(_0x4bf6a3['body']['id']){delete _0x4bf6a3['body']['id'];}return db[_0x97c7('0x39')]['find']({'where':{'id':_0x4bf6a3[_0x97c7('0x56')]['id']}})['then'](handleEntityNotFound(_0x20111d,null))[_0x97c7('0x26')](function(_0xedd629){if(_0xedd629){return db[_0x97c7('0x39')][_0x97c7('0x25')](_[_0x97c7('0x46')](_0x4bf6a3['body'],[_0x97c7('0x59'),_0x97c7('0x61'),_0x97c7('0x62'),_0x97c7('0x63'),_0x97c7('0x64'),_0x97c7('0x65')]),{'where':{'context':_0xedd629[_0x97c7('0x61')],'exten':_0xedd629[_0x97c7('0x59')]},'individualHooks':!![]})[_0x97c7('0x26')](function(_0x567638){return _0x567638;});}return null;})[_0x97c7('0x26')](respondWithStatusCode(_0x20111d,null))[_0x97c7('0x51')](handleError(_0x20111d,null));};exports[_0x97c7('0x66')]=function(_0x198ccc,_0x21160a,_0x4f32e5){return db[_0x97c7('0x39')]['findOne']({'where':{'id':_0x198ccc[_0x97c7('0x56')]['id']}})[_0x97c7('0x26')](handleEntityNotFound(_0x21160a,null))[_0x97c7('0x26')](function(_0x200f8d){if(_0x200f8d){return db['sequelize'][_0x97c7('0x67')](function(_0x1e7281){return db[_0x97c7('0x39')][_0x97c7('0x27')]({'where':{'VoiceExtensionId':_0x198ccc[_0x97c7('0x56')]['id']},'transaction':_0x1e7281})['then'](function(_0x313663){var _0x5e4f4f=_[_0x97c7('0x30')](_0x198ccc[_0x97c7('0x58')],function(_0x2de2d3){_0x2de2d3[_0x97c7('0x68')]=_0x198ccc[_0x97c7('0x56')]['id'];return _0x2de2d3;});return db[_0x97c7('0x39')][_0x97c7('0x69')](_0x5e4f4f,{'transaction':_0x1e7281});});})[_0x97c7('0x26')](function(){return db[_0x97c7('0x39')][_0x97c7('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x198ccc['params']['id']},'order':_0x97c7('0x6b')});});}})[_0x97c7('0x26')](respondWithResult(_0x21160a,null))[_0x97c7('0x51')](handleError(_0x21160a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 6d49c4d..59794e0 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 _0x00bb=['remove','hook','exports','events','../../mysqldb','VoiceExtension','save'];(function(_0xddbeef,_0x4ab4c9){var _0x5bd0b8=function(_0x1d28c3){while(--_0x1d28c3){_0xddbeef['push'](_0xddbeef['shift']());}};_0x5bd0b8(++_0x4ab4c9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var EventEmitter=require(_0xb00b('0x0'));var VoiceExtension=require(_0xb00b('0x1'))['db'][_0xb00b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb00b('0x3'),'afterUpdate':'update','afterDestroy':_0xb00b('0x4')};function emitEvent(_0x464fe7){return function(_0x582ef9,_0x14b5d0,_0x2dbd25){VoiceExtensionEvents['emit'](_0x464fe7+':'+_0x582ef9['id'],_0x582ef9);VoiceExtensionEvents['emit'](_0x464fe7,_0x582ef9);_0x2dbd25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xb00b('0x5')](e,emitEvent(event));}}module[_0xb00b('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xa41a=['remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x138147,_0x2f95b8){var _0x57870c=function(_0x43452f){while(--_0x43452f){_0x138147['push'](_0x138147['shift']());}};_0x57870c(++_0x2f95b8);}(_0xa41a,0x6b));var _0xaa41=function(_0x34d7c3,_0x1d09c0){_0x34d7c3=_0x34d7c3-0x0;var _0x27f4c7=_0xa41a[_0x34d7c3];return _0x27f4c7;};'use strict';var EventEmitter=require(_0xaa41('0x0'));var VoiceExtension=require(_0xaa41('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xaa41('0x2')](0x0);var events={'afterCreate':_0xaa41('0x3'),'afterUpdate':_0xaa41('0x4'),'afterDestroy':_0xaa41('0x5')};function emitEvent(_0x37c7a1){return function(_0x3168be,_0x42896b,_0x251efa){VoiceExtensionEvents['emit'](_0x37c7a1+':'+_0x3168be['id'],_0x3168be);VoiceExtensionEvents[_0xaa41('0x6')](_0x37c7a1,_0x3168be);_0x251efa(null);};}for(var e in events){if(events[_0xaa41('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 467bb67..6e82ed3 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 _0xdae9=['./voiceExtension.attributes','define','VoiceExtension','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x19de0a,_0x46b44b){var _0x4458b5=function(_0xbaf6){while(--_0xbaf6){_0x19de0a['push'](_0x19de0a['shift']());}};_0x4458b5(++_0x46b44b);}(_0xdae9,0xa5));var _0x9dae=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xdae9[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x9dae('0x0'));var logger=require('../../config/logger')(_0x9dae('0x1'));var moment=require(_0x9dae('0x2'));var BPromise=require('bluebird');var rp=require(_0x9dae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9dae('0x4'));var config=require(_0x9dae('0x5'));var attributes=require(_0x9dae('0x6'));module['exports']=function(_0x49d6bd,_0x1f5bd7){return _0x49d6bd[_0x9dae('0x7')](_0x9dae('0x8'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40f5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','define','VoiceExtension','voice_extensions','lodash','../../config/logger','api'];(function(_0x31acf0,_0xd0ec3){var _0x3b3f1d=function(_0x303092){while(--_0x303092){_0x31acf0['push'](_0x31acf0['shift']());}};_0x3b3f1d(++_0xd0ec3);}(_0x40f5,0x15c));var _0x540f=function(_0x3730b1,_0x28a04b){_0x3730b1=_0x3730b1-0x0;var _0x2a75db=_0x40f5[_0x3730b1];return _0x2a75db;};'use strict';var _=require(_0x540f('0x0'));var util=require('util');var logger=require(_0x540f('0x1'))(_0x540f('0x2'));var moment=require(_0x540f('0x3'));var BPromise=require(_0x540f('0x4'));var rp=require(_0x540f('0x5'));var fs=require('fs');var path=require(_0x540f('0x6'));var rimraf=require(_0x540f('0x7'));var config=require(_0x540f('0x8'));var attributes=require(_0x540f('0x9'));module['exports']=function(_0x1c02c6,_0x400078){return _0x1c02c6[_0x540f('0xa')](_0x540f('0xb'),attributes,{'tableName':_0x540f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 8e0770b..157c51a 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 _0xe5b5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','info','lodash','util'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xe5b5[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});config[_0x5e5b('0xe')]=_[_0x5e5b('0xf')](config[_0x5e5b('0xe')],{'host':_0x5e5b('0x10'),'port':0x18eb});var socket=require(_0x5e5b('0x11'))(new Redis(config[_0x5e5b('0xe')]));require(_0x5e5b('0x12'))[_0x5e5b('0x13')](socket);function respondWithRpcPromise(_0x3f8534,_0x492a0e,_0x300890){return new BPromise(function(_0x59112d,_0x108c34){return client[_0x5e5b('0x14')](_0x3f8534,_0x300890)[_0x5e5b('0x15')](function(_0x3f64b6){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x492a0e,'request\x20sent');logger[_0x5e5b('0x16')](_0x5e5b('0x17'),_0x492a0e,_0x5e5b('0x18'),JSON[_0x5e5b('0x19')](_0x3f64b6));if(_0x3f64b6[_0x5e5b('0x1a')]){if(_0x3f64b6[_0x5e5b('0x1a')][_0x5e5b('0x1b')]===0x1f4){logger['error'](_0x5e5b('0x1c'),_0x492a0e,_0x3f64b6[_0x5e5b('0x1a')]['message']);return _0x108c34(_0x3f64b6[_0x5e5b('0x1a')]['message']);}logger['error'](_0x5e5b('0x1c'),_0x492a0e,_0x3f64b6[_0x5e5b('0x1a')][_0x5e5b('0x1d')]);return _0x59112d(_0x3f64b6['error'][_0x5e5b('0x1d')]);}else{logger['info'](_0x5e5b('0x1c'),_0x492a0e,_0x5e5b('0x18'));_0x59112d(_0x3f64b6['result'][_0x5e5b('0x1d')]);}})[_0x5e5b('0x1e')](function(_0x2281c8){logger['error'](_0x5e5b('0x1c'),_0x492a0e,_0x2281c8);_0x108c34(_0x2281c8);});});}exports[_0x5e5b('0x1f')]=function(_0x490e2b){var _0x2fdc38=this;return new Promise(function(_0x1aa0c2,_0x3c488e){return db[_0x5e5b('0x20')][_0x5e5b('0x21')]({'raw':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x23')]===undefined?!![]:![]:!![],'where':_0x490e2b['options']?_0x490e2b['options'][_0x5e5b('0x24')]||null:null,'attributes':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x25')]||null:null,'limit':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x26')]||null:null,'include':_0x490e2b[_0x5e5b('0x22')]?_0x490e2b[_0x5e5b('0x22')][_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x490e2b['options'][_0x5e5b('0x27')],function(_0x75800d){return{'model':db[_0x75800d[_0x5e5b('0x29')]],'as':_0x75800d['as'],'attributes':_0x75800d['attributes'],'include':_0x75800d[_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x75800d['include'],function(_0x13ff91){return{'model':db[_0x13ff91[_0x5e5b('0x29')]],'as':_0x13ff91['as'],'attributes':_0x13ff91[_0x5e5b('0x25')],'include':_0x13ff91[_0x5e5b('0x27')]?_[_0x5e5b('0x28')](_0x13ff91[_0x5e5b('0x27')],function(_0x2cb695){return{'model':db[_0x2cb695[_0x5e5b('0x29')]],'as':_0x2cb695['as'],'attributes':_0x2cb695[_0x5e5b('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0x15')](function(_0xcb272c){logger[_0x5e5b('0x2a')]('GetVoiceExtension',_0x490e2b);logger['debug'](_0x5e5b('0x1f'),_0x490e2b,JSON[_0x5e5b('0x19')](_0xcb272c));_0x1aa0c2(_0xcb272c);})[_0x5e5b('0x1e')](function(_0x3dcdab){logger[_0x5e5b('0x1a')]('GetVoiceExtension',_0x3dcdab[_0x5e5b('0x1d')],_0x490e2b);_0x3c488e(_0x2fdc38['error'](0x1f4,_0x3dcdab[_0x5e5b('0x1d')]));});});}; \ No newline at end of file +var _0x70e0=['VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x70e0,0x17b));var _0x070e=function(_0x552ec8,_0x3dcc9e){_0x552ec8=_0x552ec8-0x0;var _0x4f2cae=_0x70e0[_0x552ec8];return _0x4f2cae;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x070e('0x9')],{'host':_0x070e('0xa'),'port':0x18eb});var socket=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x9')]));require(_0x070e('0xc'))[_0x070e('0xd')](socket);function respondWithRpcPromise(_0x11ffa8,_0x4e99e6,_0x49b2fb){return new BPromise(function(_0x50f4eb,_0x2e3e5e){return client[_0x070e('0xe')](_0x11ffa8,_0x49b2fb)[_0x070e('0xf')](function(_0xa927a2){logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));logger[_0x070e('0x13')](_0x070e('0x14'),_0x4e99e6,_0x070e('0x12'),JSON['stringify'](_0xa927a2));if(_0xa927a2['error']){if(_0xa927a2[_0x070e('0x15')]['code']===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x2e3e5e(_0xa927a2['error']['message']);}logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x50f4eb(_0xa927a2['error']['message']);}else{logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));_0x50f4eb(_0xa927a2[_0x070e('0x17')][_0x070e('0x16')]);}})['catch'](function(_0x3938b5){logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0x3938b5);_0x2e3e5e(_0x3938b5);});});}exports[_0x070e('0x18')]=function(_0x259893){var _0x5c16fd=this;return new Promise(function(_0x5b2f48,_0x4e958f){return db[_0x070e('0x19')][_0x070e('0x1a')]({'raw':_0x259893[_0x070e('0x1b')]?_0x259893['options'][_0x070e('0x1c')]===undefined?!![]:![]:!![],'where':_0x259893['options']?_0x259893[_0x070e('0x1b')][_0x070e('0x1d')]||null:null,'attributes':_0x259893[_0x070e('0x1b')]?_0x259893[_0x070e('0x1b')][_0x070e('0x1e')]||null:null,'limit':_0x259893[_0x070e('0x1b')]?_0x259893[_0x070e('0x1b')][_0x070e('0x1f')]||null:null,'include':_0x259893['options']?_0x259893[_0x070e('0x1b')][_0x070e('0x20')]?_[_0x070e('0x21')](_0x259893['options'][_0x070e('0x20')],function(_0x5f3e9d){return{'model':db[_0x5f3e9d['model']],'as':_0x5f3e9d['as'],'attributes':_0x5f3e9d[_0x070e('0x1e')],'include':_0x5f3e9d[_0x070e('0x20')]?_[_0x070e('0x21')](_0x5f3e9d[_0x070e('0x20')],function(_0x4763c6){return{'model':db[_0x4763c6['model']],'as':_0x4763c6['as'],'attributes':_0x4763c6[_0x070e('0x1e')],'include':_0x4763c6[_0x070e('0x20')]?_[_0x070e('0x21')](_0x4763c6[_0x070e('0x20')],function(_0x43dd96){return{'model':db[_0x43dd96[_0x070e('0x22')]],'as':_0x43dd96['as'],'attributes':_0x43dd96[_0x070e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x070e('0xf')](function(_0x5e8326){logger[_0x070e('0x10')](_0x070e('0x18'),_0x259893);logger[_0x070e('0x13')]('GetVoiceExtension',_0x259893,JSON['stringify'](_0x5e8326));_0x5b2f48(_0x5e8326);})[_0x070e('0x23')](function(_0x46065c){logger[_0x070e('0x15')]('GetVoiceExtension',_0x46065c[_0x070e('0x16')],_0x259893);_0x4e958f(_0x5c16fd[_0x070e('0x15')](0x1f4,_0x46065c[_0x070e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 37fa795..53b4640 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 _0x2a23=['remove','update','removeListener','register','length','voiceExtension:','./voiceExtension.events'];(function(_0x4ec3f0,_0x3f482b){var _0x379526=function(_0x2e4aff){while(--_0x2e4aff){_0x4ec3f0['push'](_0x4ec3f0['shift']());}};_0x379526(++_0x3f482b);}(_0x2a23,0x8b));var _0x32a2=function(_0x572a39,_0x493ca9){_0x572a39=_0x572a39-0x0;var _0x1ef4a1=_0x2a23[_0x572a39];return _0x1ef4a1;};'use strict';var VoiceExtensionEvents=require(_0x32a2('0x0'));var events=['save',_0x32a2('0x1'),_0x32a2('0x2')];function createListener(_0x59ad1b,_0x4502b1){return function(_0x5420a2){_0x4502b1['emit'](_0x59ad1b,_0x5420a2);};}function removeListener(_0x58a388,_0x586ba4){return function(){VoiceExtensionEvents[_0x32a2('0x3')](_0x58a388,_0x586ba4);};}exports[_0x32a2('0x4')]=function(_0x18f430){for(var _0x13412c=0x0,_0x3c56db=events[_0x32a2('0x5')];_0x13412c<_0x3c56db;_0x13412c++){var _0x28e369=events[_0x13412c];var _0x51373e=createListener(_0x32a2('0x6')+_0x28e369,_0x18f430);VoiceExtensionEvents['on'](_0x28e369,_0x51373e);}}; \ No newline at end of file +var _0x8d1a=['emit','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x207cde,_0x275944){var _0x483c1b=function(_0x400caf){while(--_0x400caf){_0x207cde['push'](_0x207cde['shift']());}};_0x483c1b(++_0x275944);}(_0x8d1a,0x19c));var _0xa8d1=function(_0x2c5d0c,_0x2efb70){_0x2c5d0c=_0x2c5d0c-0x0;var _0x4d7408=_0x8d1a[_0x2c5d0c];return _0x4d7408;};'use strict';var VoiceExtensionEvents=require(_0xa8d1('0x0'));var events=[_0xa8d1('0x1'),'remove','update'];function createListener(_0x1d2ea2,_0x172c52){return function(_0x1a57da){_0x172c52[_0xa8d1('0x2')](_0x1d2ea2,_0x1a57da);};}function removeListener(_0x3b5a78,_0x4c750c){return function(){VoiceExtensionEvents['removeListener'](_0x3b5a78,_0x4c750c);};}exports[_0xa8d1('0x3')]=function(_0x528447){for(var _0x47b9ce=0x0,_0x5a7f20=events[_0xa8d1('0x4')];_0x47b9ce<_0x5a7f20;_0x47b9ce++){var _0x2e6030=events[_0x47b9ce];var _0x5c2d32=createListener(_0xa8d1('0x5')+_0x2e6030,_0x528447);VoiceExtensionEvents['on'](_0x2e6030,_0x5c2d32);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 14081a1..b6dbade 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 _0xf3fa=['isAuthenticated','show','/:id/messages','create','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','./voiceMail.controller','get','index','/:id'];(function(_0x3589fb,_0x1a7cf5){var _0x43519a=function(_0x3d83d6){while(--_0x3d83d6){_0x3589fb['push'](_0x3589fb['shift']());}};_0x43519a(++_0x1a7cf5);}(_0xf3fa,0x1d4));var _0xaf3f=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0xf3fa[_0x2726ad];return _0xd87993;};'use strict';var multer=require(_0xaf3f('0x0'));var util=require('util');var path=require(_0xaf3f('0x1'));var timeout=require(_0xaf3f('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xaf3f('0x3'));var config=require('../../config/environment');var controller=require(_0xaf3f('0x4'));router[_0xaf3f('0x5')]('/',auth['isAuthenticated'](),controller[_0xaf3f('0x6')]);router[_0xaf3f('0x5')](_0xaf3f('0x7'),auth[_0xaf3f('0x8')](),controller[_0xaf3f('0x9')]);router[_0xaf3f('0x5')](_0xaf3f('0xa'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xaf3f('0xb')]);router['put'](_0xaf3f('0x7'),auth[_0xaf3f('0x8')](),controller['update']);router['delete'](_0xaf3f('0x7'),auth[_0xaf3f('0x8')](),controller[_0xaf3f('0xc')]);module[_0xaf3f('0xd')]=router; \ No newline at end of file +var _0xfed0=['get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','index'];(function(_0x1d3774,_0x4894fc){var _0x597766=function(_0x81b564){while(--_0x81b564){_0x1d3774['push'](_0x1d3774['shift']());}};_0x597766(++_0x4894fc);}(_0xfed0,0x122));var _0x0fed=function(_0x512c16,_0x4779b1){_0x512c16=_0x512c16-0x0;var _0x161b44=_0xfed0[_0x512c16];return _0x161b44;};'use strict';var multer=require(_0x0fed('0x0'));var util=require(_0x0fed('0x1'));var path=require('path');var timeout=require(_0x0fed('0x2'));var express=require(_0x0fed('0x3'));var router=express[_0x0fed('0x4')]();var auth=require(_0x0fed('0x5'));var interaction=require(_0x0fed('0x6'));var config=require(_0x0fed('0x7'));var controller=require(_0x0fed('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0fed('0x9')]);router[_0x0fed('0xa')]('/:id',auth[_0x0fed('0xb')](),controller[_0x0fed('0xc')]);router[_0x0fed('0xa')]('/:id/messages',auth[_0x0fed('0xb')](),controller['getMessages']);router[_0x0fed('0xd')]('/',auth[_0x0fed('0xb')](),controller['create']);router[_0x0fed('0xe')](_0x0fed('0xf'),auth[_0x0fed('0xb')](),controller[_0x0fed('0x10')]);router[_0x0fed('0x11')](_0x0fed('0xf'),auth[_0x0fed('0xb')](),controller[_0x0fed('0x12')]);module[_0x0fed('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 79126a9..0b1d04c 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 _0x4244=['\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','fullname'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0x4244,0x1ef));var _0x4424=function(_0x1696a8,_0x4e6af6){_0x1696a8=_0x1696a8-0x0;var _0x4fd06a=_0x4244[_0x1696a8];return _0x4fd06a;};'use strict';var Sequelize=require('sequelize');module[_0x4424('0x0')]={'customer_id':{'type':Sequelize[_0x4424('0x1')]},'context':{'type':Sequelize[_0x4424('0x1')],'defaultValue':_0x4424('0x2'),'unique':_0x4424('0x3')},'mailbox':{'type':Sequelize[_0x4424('0x1')],'defaultValue':'','allowNull':![],'unique':_0x4424('0x3')},'password':{'type':Sequelize[_0x4424('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4424('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4cd58b){this[_0x4424('0x4')](_0x4424('0x5'),typeof _0x4cd58b===_0x4424('0x6')&&_0x4cd58b[_0x4424('0x7')]()?_0x4cd58b[_0x4424('0x7')]():null);}},'pager':{'type':Sequelize[_0x4424('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x4424('0x8')},'attach':{'type':Sequelize[_0x4424('0x9')](_0x4424('0xa'),'no'),'defaultValue':_0x4424('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x4424('0xa'),'no'),'defaultValue':_0x4424('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x4424('0x9')](_0x4424('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x4424('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4424('0x9')](_0x4424('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4424('0x9')](_0x4424('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4424('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4424('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4424('0x9')](_0x4424('0xa'),'no'),'defaultValue':_0x4424('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4424('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4424('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4424('0x9')](_0x4424('0xa'),'no'),'defaultValue':_0x4424('0xa'),'allowNull':![]},'stamp':{'type':_0x4424('0xb')},'emailsubject':{'type':Sequelize[_0x4424('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4424('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4424('0xd')](_0x4424('0xe'))+_0x4424('0xf')+this[_0x4424('0xd')](_0x4424('0x10'));}}}; \ No newline at end of file +var _0xc5a0=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','\x20-\x20','mailbox','sequelize','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc5a0,0x1cd));var _0x0c5a=function(_0x298dd8,_0x610d3e){_0x298dd8=_0x298dd8-0x0;var _0x9b316a=_0xc5a0[_0x298dd8];return _0x9b316a;};'use strict';var Sequelize=require(_0x0c5a('0x0'));module[_0x0c5a('0x1')]={'customer_id':{'type':Sequelize[_0x0c5a('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x0c5a('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x0c5a('0x4')},'password':{'type':Sequelize[_0x0c5a('0x2')]},'fullname':{'type':Sequelize[_0x0c5a('0x2')]},'email':{'type':Sequelize[_0x0c5a('0x2')],'validate':{'isEmail':!![]},'set':function(_0xedcb1a){this[_0x0c5a('0x5')](_0x0c5a('0x6'),typeof _0xedcb1a===_0x0c5a('0x7')&&_0xedcb1a[_0x0c5a('0x8')]()?_0xedcb1a[_0x0c5a('0x8')]():null);}},'pager':{'type':Sequelize[_0x0c5a('0x2')]},'tz':{'type':Sequelize[_0x0c5a('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x0c5a('0x9')](_0x0c5a('0xa'),'no'),'defaultValue':_0x0c5a('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x0c5a('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x0c5a('0x2')]},'callback':{'type':Sequelize[_0x0c5a('0x2')]},'review':{'type':Sequelize[_0x0c5a('0x9')](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0c5a('0x9')](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0c5a('0x9')](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0c5a('0x9')](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0c5a('0x9')](_0x0c5a('0xa'),'no'),'defaultValue':_0x0c5a('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0c5a('0x9')](_0x0c5a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0c5a('0x9')]('yes','no'),'defaultValue':_0x0c5a('0xa'),'allowNull':![]},'stamp':{'type':_0x0c5a('0xb')},'emailsubject':{'type':Sequelize[_0x0c5a('0x2')]},'emailbody':{'type':Sequelize[_0x0c5a('0x2')]},'maxsecs':{'type':Sequelize[_0x0c5a('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0c5a('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0c5a('0xd')]('fullname')+_0x0c5a('0xe')+this['getDataValue'](_0x0c5a('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 377429e..2ef7531 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 _0xb2a3=['type','key','VIRTUAL','field','options','VoiceMail','count','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb2a3,0x179));var _0x3b2a=function(_0x37bdc9,_0x636fae){_0x37bdc9=_0x37bdc9-0x0;var _0x360fc7=_0xb2a3[_0x37bdc9];return _0x360fc7;};'use strict';var pdf=require(_0x3b2a('0x0'));var emlformat=require(_0x3b2a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3b2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b2a('0x3'));var moment=require('moment');var BPromise=require(_0x3b2a('0x4'));var Mustache=require(_0x3b2a('0x5'));var util=require(_0x3b2a('0x6'));var path=require(_0x3b2a('0x7'));var sox=require(_0x3b2a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3b2a('0x9'));var squel=require(_0x3b2a('0xa'));var crypto=require('crypto');var jsforce=require(_0x3b2a('0xb'));var deskjs=require(_0x3b2a('0xc'));var toCsv=require(_0x3b2a('0xd'));var querystring=require(_0x3b2a('0xe'));var Papa=require('papaparse');var Redis=require(_0x3b2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b2a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b2a('0x11'))('api');var utils=require(_0x3b2a('0x12'));var config=require(_0x3b2a('0x13'));var db=require(_0x3b2a('0x14'))['db'];function respondWithStatusCode(_0x5d4c89,_0x8e3df1){_0x8e3df1=_0x8e3df1||0xcc;return function(_0x198fc9){if(_0x198fc9){return _0x5d4c89[_0x3b2a('0x15')](_0x8e3df1);}return _0x5d4c89[_0x3b2a('0x16')](_0x8e3df1)[_0x3b2a('0x17')]();};}function respondWithResult(_0x581eee,_0x4149ec){_0x4149ec=_0x4149ec||0xc8;return function(_0x3b6cc0){if(_0x3b6cc0){return _0x581eee[_0x3b2a('0x16')](_0x4149ec)[_0x3b2a('0x18')](_0x3b6cc0);}};}function respondWithFilteredResult(_0x5cacbc,_0x485f7a){return function(_0x527dc6){if(_0x527dc6){var _0x380f9e=_0x527dc6['count'],_0x2c386c=_0x485f7a[_0x3b2a('0x19')],_0x290e2c=_0x485f7a[_0x3b2a('0x19')]+_0x485f7a[_0x3b2a('0x1a')],_0x3543bf;if(_0x290e2c>=_0x380f9e){_0x290e2c=_0x380f9e;_0x3543bf=0xc8;}else{_0x3543bf=0xce;}_0x5cacbc['status'](_0x3543bf);return _0x5cacbc[_0x3b2a('0x1b')]('Content-Range',_0x2c386c+'-'+_0x290e2c+'/'+_0x380f9e)['json'](_0x527dc6);}return null;};}function patchUpdates(_0x2d055a){return function(_0x36b1ac){try{jsonpatch[_0x3b2a('0x1c')](_0x36b1ac,_0x2d055a,!![]);}catch(_0xb47d38){return BPromise[_0x3b2a('0x1d')](_0xb47d38);}return _0x36b1ac[_0x3b2a('0x1e')]();};}function saveUpdates(_0x29edf6,_0x52f559){return function(_0x5afef6){if(_0x5afef6){return _0x5afef6['update'](_0x29edf6)[_0x3b2a('0x1f')](function(_0x421f00){return _0x421f00;});}return null;};}function removeEntity(_0x644b1b,_0x289499){return function(_0x60888d){if(_0x60888d){return _0x60888d[_0x3b2a('0x20')]()[_0x3b2a('0x1f')](function(){var _0x37e0e6=_0x60888d[_0x3b2a('0x21')]({'plain':!![]});var _0x5602ba=_0x3b2a('0x22');return db[_0x3b2a('0x23')]['destroy']({'where':{'type':_0x5602ba,'resourceId':_0x37e0e6['id']}})[_0x3b2a('0x1f')](function(){return _0x60888d;});})[_0x3b2a('0x1f')](function(){_0x644b1b['status'](0xcc)[_0x3b2a('0x17')]();});}};}function handleEntityNotFound(_0x1471a9,_0x12ea55){return function(_0x4a3f44){if(!_0x4a3f44){_0x1471a9[_0x3b2a('0x15')](0x194);}return _0x4a3f44;};}function handleError(_0x141724,_0x52d4d9){_0x52d4d9=_0x52d4d9||0x1f4;return function(_0x4edfb7){logger[_0x3b2a('0x24')](_0x4edfb7[_0x3b2a('0x25')]);if(_0x4edfb7['name']){delete _0x4edfb7[_0x3b2a('0x26')];}_0x141724[_0x3b2a('0x16')](_0x52d4d9)['send'](_0x4edfb7);};}exports[_0x3b2a('0x27')]=function(_0x5ed50e,_0x2367e0){var _0x4d38e4={},_0x5b1b54={},_0x3d4ba4={'count':0x0,'rows':[]};var _0x3c6e37=db['VoiceMail'][_0x3b2a('0x28')];_0x5b1b54['model']=_['keys'](_0x3c6e37);_0x5b1b54['query']=_[_0x3b2a('0x29')](_0x5ed50e[_0x3b2a('0x2a')]);_0x5b1b54[_0x3b2a('0x2b')]=_[_0x3b2a('0x2c')](_0x5b1b54[_0x3b2a('0x2d')],_0x5b1b54[_0x3b2a('0x2a')]);_0x4d38e4[_0x3b2a('0x2e')]=_[_0x3b2a('0x2c')](_0x5b1b54['model'],qs[_0x3b2a('0x2f')](_0x5ed50e[_0x3b2a('0x2a')]['fields']));_0x4d38e4[_0x3b2a('0x2e')]=_0x4d38e4[_0x3b2a('0x2e')][_0x3b2a('0x30')]?_0x4d38e4[_0x3b2a('0x2e')]:_0x5b1b54[_0x3b2a('0x2d')];if(!_0x5ed50e[_0x3b2a('0x2a')][_0x3b2a('0x31')](_0x3b2a('0x32'))){_0x4d38e4[_0x3b2a('0x1a')]=qs['limit'](_0x5ed50e['query'][_0x3b2a('0x1a')]);_0x4d38e4['offset']=qs[_0x3b2a('0x19')](_0x5ed50e['query'][_0x3b2a('0x19')]);}_0x4d38e4[_0x3b2a('0x33')]=qs[_0x3b2a('0x34')](_0x5ed50e['query'][_0x3b2a('0x34')]);_0x4d38e4['where']=qs['filters'](_[_0x3b2a('0x35')](_0x5ed50e['query'],_0x5b1b54[_0x3b2a('0x2b')]));if(_0x5ed50e[_0x3b2a('0x2a')][_0x3b2a('0x36')]){_0x4d38e4[_0x3b2a('0x37')]=_[_0x3b2a('0x38')](_0x4d38e4[_0x3b2a('0x37')],{'$or':_[_0x3b2a('0x39')](_0x3c6e37,function(_0xa11498){if(_0xa11498[_0x3b2a('0x3a')][_0x3b2a('0x3b')]!==_0x3b2a('0x3c')){var _0x138f20={};_0x138f20[_0xa11498[_0x3b2a('0x3d')]]={'$like':'%'+_0x5ed50e[_0x3b2a('0x2a')][_0x3b2a('0x36')]+'%'};return _0x138f20;}})});}_0x4d38e4=_['merge']({},_0x4d38e4,_0x5ed50e[_0x3b2a('0x3e')]);var _0x34bd3f={'where':_0x4d38e4['where']};return db[_0x3b2a('0x3f')][_0x3b2a('0x40')](_0x34bd3f)['then'](function(_0x278467){_0x3d4ba4['count']=_0x278467;if(_0x5ed50e['query'][_0x3b2a('0x41')]){_0x4d38e4[_0x3b2a('0x42')]=[{'all':!![]}];}return db[_0x3b2a('0x3f')][_0x3b2a('0x43')](_0x4d38e4);})[_0x3b2a('0x1f')](function(_0x183571){_0x3d4ba4[_0x3b2a('0x44')]=_0x183571;return _0x3d4ba4;})[_0x3b2a('0x1f')](respondWithFilteredResult(_0x2367e0,_0x4d38e4))[_0x3b2a('0x45')](handleError(_0x2367e0,null));};exports[_0x3b2a('0x46')]=function(_0x390064,_0x555ae4){var _0x1f5002={'raw':!![],'where':{'id':_0x390064[_0x3b2a('0x47')]['id']}},_0x54bd04={};_0x54bd04[_0x3b2a('0x2d')]=_[_0x3b2a('0x29')](db[_0x3b2a('0x3f')][_0x3b2a('0x28')]);_0x54bd04[_0x3b2a('0x2a')]=_[_0x3b2a('0x29')](_0x390064[_0x3b2a('0x2a')]);_0x54bd04['filters']=_['intersection'](_0x54bd04[_0x3b2a('0x2d')],_0x54bd04[_0x3b2a('0x2a')]);_0x1f5002['attributes']=_[_0x3b2a('0x2c')](_0x54bd04[_0x3b2a('0x2d')],qs[_0x3b2a('0x2f')](_0x390064['query'][_0x3b2a('0x2f')]));_0x1f5002[_0x3b2a('0x2e')]=_0x1f5002['attributes'][_0x3b2a('0x30')]?_0x1f5002['attributes']:_0x54bd04[_0x3b2a('0x2d')];if(_0x390064[_0x3b2a('0x2a')][_0x3b2a('0x41')]){_0x1f5002[_0x3b2a('0x42')]=[{'all':!![]}];}_0x1f5002=_[_0x3b2a('0x38')]({},_0x1f5002,_0x390064['options']);return db[_0x3b2a('0x3f')]['find'](_0x1f5002)[_0x3b2a('0x1f')](handleEntityNotFound(_0x555ae4,null))[_0x3b2a('0x1f')](respondWithResult(_0x555ae4,null))[_0x3b2a('0x45')](handleError(_0x555ae4,null));};exports['create']=function(_0x4d2163,_0x343484){return db[_0x3b2a('0x3f')][_0x3b2a('0x48')](_0x4d2163['body'],{})[_0x3b2a('0x1f')](function(_0x1c13f9){var _0x237b1e=_0x4d2163[_0x3b2a('0x49')]['get']({'plain':!![]});if(!_0x237b1e)throw new Error(_0x3b2a('0x4a'));if(_0x237b1e[_0x3b2a('0x4b')]===_0x3b2a('0x49')){var _0x16cd08=_0x1c13f9['get']({'plain':!![]});var _0x3d0819=_0x3b2a('0x22');return db[_0x3b2a('0x4c')][_0x3b2a('0x4d')]({'where':{'name':_0x3d0819,'userProfileId':_0x237b1e[_0x3b2a('0x4e')]},'raw':!![]})[_0x3b2a('0x1f')](function(_0x3eb582){if(_0x3eb582&&_0x3eb582[_0x3b2a('0x4f')]===0x0){return db['UserProfileResource'][_0x3b2a('0x48')]({'name':_0x16cd08[_0x3b2a('0x26')],'resourceId':_0x16cd08['id'],'type':_0x3eb582[_0x3b2a('0x26')],'sectionId':_0x3eb582['id']},{})[_0x3b2a('0x1f')](function(){return _0x1c13f9;});}else{return _0x1c13f9;}})['catch'](function(_0x26ff25){logger['error'](_0x3b2a('0x50'),_0x26ff25);throw _0x26ff25;});}return _0x1c13f9;})['then'](respondWithResult(_0x343484,0xc9))[_0x3b2a('0x45')](handleError(_0x343484,null));};exports['update']=function(_0x31f995,_0x4549e5){if(_0x31f995[_0x3b2a('0x51')]['id']){delete _0x31f995[_0x3b2a('0x51')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x31f995[_0x3b2a('0x47')]['id']}})[_0x3b2a('0x1f')](handleEntityNotFound(_0x4549e5,null))['then'](saveUpdates(_0x31f995[_0x3b2a('0x51')],null))[_0x3b2a('0x1f')](respondWithResult(_0x4549e5,null))['catch'](handleError(_0x4549e5,null));};exports['destroy']=function(_0x2352fd,_0x20e560){return db[_0x3b2a('0x3f')]['find']({'where':{'id':_0x2352fd[_0x3b2a('0x47')]['id']}})[_0x3b2a('0x1f')](handleEntityNotFound(_0x20e560,null))[_0x3b2a('0x1f')](removeEntity(_0x20e560,null))[_0x3b2a('0x45')](handleError(_0x20e560,null));};exports[_0x3b2a('0x52')]=function(_0x40b4af,_0xec52f,_0x292b9a){return db[_0x3b2a('0x3f')][_0x3b2a('0x53')]({'where':{'id':_0x40b4af[_0x3b2a('0x47')]['id']}})[_0x3b2a('0x1f')](handleEntityNotFound(_0xec52f,null))[_0x3b2a('0x1f')](function(_0x39ffb0){var _0x56a71b;var _0x54d03e={},_0xbe76f7={};_0xbe76f7[_0x3b2a('0x2d')]=_[_0x3b2a('0x29')](db[_0x3b2a('0x54')][_0x3b2a('0x28')]);_0xbe76f7[_0x3b2a('0x2a')]=_[_0x3b2a('0x29')](_0x40b4af[_0x3b2a('0x2a')]);_0xbe76f7['filters']=_[_0x3b2a('0x2c')](_0xbe76f7[_0x3b2a('0x2d')],_0xbe76f7['query']);_0x54d03e[_0x3b2a('0x2e')]=_[_0x3b2a('0x2c')](_0xbe76f7['model'],qs[_0x3b2a('0x2f')](_0x40b4af[_0x3b2a('0x2a')][_0x3b2a('0x2f')]));_0x54d03e[_0x3b2a('0x2e')]=_0x54d03e[_0x3b2a('0x2e')][_0x3b2a('0x30')]?_0x54d03e[_0x3b2a('0x2e')]:_0xbe76f7['model'];if(!_0x40b4af['query'][_0x3b2a('0x31')]('nolimit')){_0x54d03e[_0x3b2a('0x1a')]=qs[_0x3b2a('0x1a')](_0x40b4af[_0x3b2a('0x2a')][_0x3b2a('0x1a')]);_0x54d03e[_0x3b2a('0x19')]=qs[_0x3b2a('0x19')](_0x40b4af[_0x3b2a('0x2a')][_0x3b2a('0x19')]);}_0x54d03e[_0x3b2a('0x33')]=qs[_0x3b2a('0x34')](_0x40b4af[_0x3b2a('0x2a')][_0x3b2a('0x34')]);_0x54d03e[_0x3b2a('0x37')]=qs[_0x3b2a('0x2b')](_[_0x3b2a('0x35')](_0x40b4af[_0x3b2a('0x2a')],_0xbe76f7[_0x3b2a('0x2b')]));if(_0x40b4af[_0x3b2a('0x2a')]['filter']){_0x54d03e[_0x3b2a('0x37')]=_[_0x3b2a('0x38')](_0x54d03e[_0x3b2a('0x37')],{'$or':_[_0x3b2a('0x39')](_0x54d03e[_0x3b2a('0x2e')],function(_0x4278a9){var _0x1542ae={};_0x1542ae[_0x4278a9]={'$like':'%'+_0x40b4af[_0x3b2a('0x2a')][_0x3b2a('0x36')]+'%'};return _0x1542ae;})});}_0x54d03e['where']=_[_0x3b2a('0x38')](_0x54d03e['where'],{'mailboxuser':_0x39ffb0[_0x3b2a('0x55')]});_0x54d03e=_['merge']({},_0x54d03e,_0x40b4af[_0x3b2a('0x3e')]);return db[_0x3b2a('0x54')][_0x3b2a('0x56')](_0x54d03e)['then'](respondWithFilteredResult(_0xec52f,_0x54d03e));})[_0x3b2a('0x45')](handleError(_0xec52f,null));}; \ No newline at end of file +var _0x3498=['offset','limit','set','reject','save','update','then','get','Voicemails','UserProfileResource','sendStatus','stack','name','send','index','VoiceMail','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','map','type','key','field','count','rows','catch','show','rawAttributes','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMessages','findOne','nolimit','pick','mailbox','VoiceMailMessage','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json'];(function(_0xc6bd3c,_0x2cf1a2){var _0x46c9e6=function(_0x45ba3e){while(--_0x45ba3e){_0xc6bd3c['push'](_0xc6bd3c['shift']());}};_0x46c9e6(++_0x2cf1a2);}(_0x3498,0x90));var _0x8349=function(_0x1f8c59,_0x3c8819){_0x1f8c59=_0x1f8c59-0x0;var _0x56969e=_0x3498[_0x1f8c59];return _0x56969e;};'use strict';var pdf=require(_0x8349('0x0'));var emlformat=require(_0x8349('0x1'));var rimraf=require(_0x8349('0x2'));var zipdir=require(_0x8349('0x3'));var jsonpatch=require(_0x8349('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8349('0x5'));var Mustache=require('mustache');var util=require(_0x8349('0x6'));var path=require(_0x8349('0x7'));var sox=require(_0x8349('0x8'));var csv=require(_0x8349('0x9'));var ejs=require(_0x8349('0xa'));var fs=require('fs');var _=require(_0x8349('0xb'));var squel=require(_0x8349('0xc'));var crypto=require(_0x8349('0xd'));var jsforce=require(_0x8349('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8349('0x9'));var querystring=require('querystring');var Papa=require(_0x8349('0xf'));var Redis=require(_0x8349('0x10'));var authService=require(_0x8349('0x11'));var qs=require(_0x8349('0x12'));var hardwareService=require(_0x8349('0x13'));var logger=require('../../config/logger')(_0x8349('0x14'));var utils=require('../../config/utils');var config=require(_0x8349('0x15'));var db=require(_0x8349('0x16'))['db'];function respondWithStatusCode(_0xd65dd7,_0x50cebd){_0x50cebd=_0x50cebd||0xcc;return function(_0x1354c7){if(_0x1354c7){return _0xd65dd7['sendStatus'](_0x50cebd);}return _0xd65dd7[_0x8349('0x17')](_0x50cebd)[_0x8349('0x18')]();};}function respondWithResult(_0x46443b,_0x140ff7){_0x140ff7=_0x140ff7||0xc8;return function(_0x52d9ae){if(_0x52d9ae){return _0x46443b[_0x8349('0x17')](_0x140ff7)[_0x8349('0x19')](_0x52d9ae);}};}function respondWithFilteredResult(_0x1df8e3,_0x2d038a){return function(_0x512fe8){if(_0x512fe8){var _0x40a33d=_0x512fe8['count'],_0x2ee7b8=_0x2d038a[_0x8349('0x1a')],_0x2bbd40=_0x2d038a[_0x8349('0x1a')]+_0x2d038a[_0x8349('0x1b')],_0x2bbeb8;if(_0x2bbd40>=_0x40a33d){_0x2bbd40=_0x40a33d;_0x2bbeb8=0xc8;}else{_0x2bbeb8=0xce;}_0x1df8e3[_0x8349('0x17')](_0x2bbeb8);return _0x1df8e3[_0x8349('0x1c')]('Content-Range',_0x2ee7b8+'-'+_0x2bbd40+'/'+_0x40a33d)[_0x8349('0x19')](_0x512fe8);}return null;};}function patchUpdates(_0x2eb664){return function(_0x13862e){try{jsonpatch['apply'](_0x13862e,_0x2eb664,!![]);}catch(_0x3bde65){return BPromise[_0x8349('0x1d')](_0x3bde65);}return _0x13862e[_0x8349('0x1e')]();};}function saveUpdates(_0x383d20,_0x6a3ecd){return function(_0x5523ad){if(_0x5523ad){return _0x5523ad[_0x8349('0x1f')](_0x383d20)[_0x8349('0x20')](function(_0x4d8e28){return _0x4d8e28;});}return null;};}function removeEntity(_0x645724,_0x48a240){return function(_0x550957){if(_0x550957){return _0x550957['destroy']()[_0x8349('0x20')](function(){var _0x5ba7f6=_0x550957[_0x8349('0x21')]({'plain':!![]});var _0x9c5f31=_0x8349('0x22');return db[_0x8349('0x23')]['destroy']({'where':{'type':_0x9c5f31,'resourceId':_0x5ba7f6['id']}})[_0x8349('0x20')](function(){return _0x550957;});})[_0x8349('0x20')](function(){_0x645724[_0x8349('0x17')](0xcc)[_0x8349('0x18')]();});}};}function handleEntityNotFound(_0xff670b,_0xd77f1c){return function(_0x493d74){if(!_0x493d74){_0xff670b[_0x8349('0x24')](0x194);}return _0x493d74;};}function handleError(_0x5ec267,_0x53a704){_0x53a704=_0x53a704||0x1f4;return function(_0x4e5496){logger['error'](_0x4e5496[_0x8349('0x25')]);if(_0x4e5496[_0x8349('0x26')]){delete _0x4e5496[_0x8349('0x26')];}_0x5ec267['status'](_0x53a704)[_0x8349('0x27')](_0x4e5496);};}exports[_0x8349('0x28')]=function(_0x56abed,_0x32b278){var _0x189296={},_0x1d3617={},_0x23be28={'count':0x0,'rows':[]};var _0x2686af=db[_0x8349('0x29')]['rawAttributes'];_0x1d3617['model']=_[_0x8349('0x2a')](_0x2686af);_0x1d3617[_0x8349('0x2b')]=_[_0x8349('0x2a')](_0x56abed['query']);_0x1d3617['filters']=_[_0x8349('0x2c')](_0x1d3617[_0x8349('0x2d')],_0x1d3617[_0x8349('0x2b')]);_0x189296[_0x8349('0x2e')]=_[_0x8349('0x2c')](_0x1d3617[_0x8349('0x2d')],qs[_0x8349('0x2f')](_0x56abed['query'][_0x8349('0x2f')]));_0x189296[_0x8349('0x2e')]=_0x189296[_0x8349('0x2e')][_0x8349('0x30')]?_0x189296[_0x8349('0x2e')]:_0x1d3617[_0x8349('0x2d')];if(!_0x56abed[_0x8349('0x2b')][_0x8349('0x31')]('nolimit')){_0x189296['limit']=qs[_0x8349('0x1b')](_0x56abed[_0x8349('0x2b')][_0x8349('0x1b')]);_0x189296['offset']=qs[_0x8349('0x1a')](_0x56abed[_0x8349('0x2b')]['offset']);}_0x189296[_0x8349('0x32')]=qs[_0x8349('0x33')](_0x56abed[_0x8349('0x2b')][_0x8349('0x33')]);_0x189296[_0x8349('0x34')]=qs[_0x8349('0x35')](_['pick'](_0x56abed[_0x8349('0x2b')],_0x1d3617['filters']));if(_0x56abed[_0x8349('0x2b')][_0x8349('0x36')]){_0x189296['where']=_[_0x8349('0x37')](_0x189296[_0x8349('0x34')],{'$or':_[_0x8349('0x38')](_0x2686af,function(_0x4708db){if(_0x4708db[_0x8349('0x39')][_0x8349('0x3a')]!=='VIRTUAL'){var _0x157310={};_0x157310[_0x4708db[_0x8349('0x3b')]]={'$like':'%'+_0x56abed['query'][_0x8349('0x36')]+'%'};return _0x157310;}})});}_0x189296=_[_0x8349('0x37')]({},_0x189296,_0x56abed['options']);var _0x516e3b={'where':_0x189296[_0x8349('0x34')]};return db[_0x8349('0x29')][_0x8349('0x3c')](_0x516e3b)['then'](function(_0x1fc686){_0x23be28[_0x8349('0x3c')]=_0x1fc686;if(_0x56abed[_0x8349('0x2b')]['includeAll']){_0x189296['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x189296);})[_0x8349('0x20')](function(_0x1edf07){_0x23be28[_0x8349('0x3d')]=_0x1edf07;return _0x23be28;})['then'](respondWithFilteredResult(_0x32b278,_0x189296))[_0x8349('0x3e')](handleError(_0x32b278,null));};exports[_0x8349('0x3f')]=function(_0x263c3c,_0x2f349a){var _0x23447c={'raw':!![],'where':{'id':_0x263c3c['params']['id']}},_0x5a05fb={};_0x5a05fb[_0x8349('0x2d')]=_[_0x8349('0x2a')](db[_0x8349('0x29')][_0x8349('0x40')]);_0x5a05fb[_0x8349('0x2b')]=_[_0x8349('0x2a')](_0x263c3c[_0x8349('0x2b')]);_0x5a05fb[_0x8349('0x35')]=_['intersection'](_0x5a05fb[_0x8349('0x2d')],_0x5a05fb[_0x8349('0x2b')]);_0x23447c[_0x8349('0x2e')]=_[_0x8349('0x2c')](_0x5a05fb['model'],qs[_0x8349('0x2f')](_0x263c3c['query'][_0x8349('0x2f')]));_0x23447c['attributes']=_0x23447c[_0x8349('0x2e')]['length']?_0x23447c[_0x8349('0x2e')]:_0x5a05fb['model'];if(_0x263c3c[_0x8349('0x2b')][_0x8349('0x41')]){_0x23447c[_0x8349('0x42')]=[{'all':!![]}];}_0x23447c=_[_0x8349('0x37')]({},_0x23447c,_0x263c3c[_0x8349('0x43')]);return db[_0x8349('0x29')][_0x8349('0x44')](_0x23447c)[_0x8349('0x20')](handleEntityNotFound(_0x2f349a,null))[_0x8349('0x20')](respondWithResult(_0x2f349a,null))[_0x8349('0x3e')](handleError(_0x2f349a,null));};exports[_0x8349('0x45')]=function(_0x3dff57,_0x5a3578){return db[_0x8349('0x29')][_0x8349('0x45')](_0x3dff57['body'],{})['then'](function(_0xe9153e){var _0x437ae9=_0x3dff57[_0x8349('0x46')][_0x8349('0x21')]({'plain':!![]});if(!_0x437ae9)throw new Error(_0x8349('0x47'));if(_0x437ae9[_0x8349('0x48')]===_0x8349('0x46')){var _0x54730d=_0xe9153e[_0x8349('0x21')]({'plain':!![]});var _0x19d3cc=_0x8349('0x22');return db['UserProfileSection'][_0x8349('0x44')]({'where':{'name':_0x19d3cc,'userProfileId':_0x437ae9[_0x8349('0x49')]},'raw':!![]})[_0x8349('0x20')](function(_0x1cce8d){if(_0x1cce8d&&_0x1cce8d['autoAssociation']===0x0){return db['UserProfileResource'][_0x8349('0x45')]({'name':_0x54730d[_0x8349('0x26')],'resourceId':_0x54730d['id'],'type':_0x1cce8d[_0x8349('0x26')],'sectionId':_0x1cce8d['id']},{})['then'](function(){return _0xe9153e;});}else{return _0xe9153e;}})[_0x8349('0x3e')](function(_0xdba4a0){logger[_0x8349('0x4a')](_0x8349('0x4b'),_0xdba4a0);throw _0xdba4a0;});}return _0xe9153e;})[_0x8349('0x20')](respondWithResult(_0x5a3578,0xc9))[_0x8349('0x3e')](handleError(_0x5a3578,null));};exports[_0x8349('0x1f')]=function(_0x4e5843,_0x120644){if(_0x4e5843[_0x8349('0x4c')]['id']){delete _0x4e5843['body']['id'];}return db[_0x8349('0x29')][_0x8349('0x44')]({'where':{'id':_0x4e5843[_0x8349('0x4d')]['id']}})[_0x8349('0x20')](handleEntityNotFound(_0x120644,null))[_0x8349('0x20')](saveUpdates(_0x4e5843['body'],null))[_0x8349('0x20')](respondWithResult(_0x120644,null))[_0x8349('0x3e')](handleError(_0x120644,null));};exports['destroy']=function(_0x1daa0e,_0x39b1fd){return db[_0x8349('0x29')][_0x8349('0x44')]({'where':{'id':_0x1daa0e['params']['id']}})[_0x8349('0x20')](handleEntityNotFound(_0x39b1fd,null))[_0x8349('0x20')](removeEntity(_0x39b1fd,null))[_0x8349('0x3e')](handleError(_0x39b1fd,null));};exports[_0x8349('0x4e')]=function(_0x1fb04d,_0x138140,_0x3ca3dd){return db[_0x8349('0x29')][_0x8349('0x4f')]({'where':{'id':_0x1fb04d[_0x8349('0x4d')]['id']}})[_0x8349('0x20')](handleEntityNotFound(_0x138140,null))['then'](function(_0x3a7896){var _0x4b3d0a;var _0x50270a={},_0x53fcc6={};_0x53fcc6[_0x8349('0x2d')]=_[_0x8349('0x2a')](db['VoiceMailMessage'][_0x8349('0x40')]);_0x53fcc6['query']=_[_0x8349('0x2a')](_0x1fb04d['query']);_0x53fcc6['filters']=_['intersection'](_0x53fcc6[_0x8349('0x2d')],_0x53fcc6['query']);_0x50270a[_0x8349('0x2e')]=_[_0x8349('0x2c')](_0x53fcc6[_0x8349('0x2d')],qs[_0x8349('0x2f')](_0x1fb04d['query'][_0x8349('0x2f')]));_0x50270a[_0x8349('0x2e')]=_0x50270a['attributes'][_0x8349('0x30')]?_0x50270a[_0x8349('0x2e')]:_0x53fcc6[_0x8349('0x2d')];if(!_0x1fb04d[_0x8349('0x2b')][_0x8349('0x31')](_0x8349('0x50'))){_0x50270a[_0x8349('0x1b')]=qs[_0x8349('0x1b')](_0x1fb04d[_0x8349('0x2b')][_0x8349('0x1b')]);_0x50270a[_0x8349('0x1a')]=qs[_0x8349('0x1a')](_0x1fb04d[_0x8349('0x2b')][_0x8349('0x1a')]);}_0x50270a[_0x8349('0x32')]=qs[_0x8349('0x33')](_0x1fb04d[_0x8349('0x2b')]['sort']);_0x50270a[_0x8349('0x34')]=qs[_0x8349('0x35')](_[_0x8349('0x51')](_0x1fb04d['query'],_0x53fcc6[_0x8349('0x35')]));if(_0x1fb04d['query'][_0x8349('0x36')]){_0x50270a[_0x8349('0x34')]=_[_0x8349('0x37')](_0x50270a['where'],{'$or':_[_0x8349('0x38')](_0x50270a['attributes'],function(_0x3c6511){var _0x5e918d={};_0x5e918d[_0x3c6511]={'$like':'%'+_0x1fb04d[_0x8349('0x2b')]['filter']+'%'};return _0x5e918d;})});}_0x50270a['where']=_[_0x8349('0x37')](_0x50270a[_0x8349('0x34')],{'mailboxuser':_0x3a7896[_0x8349('0x52')]});_0x50270a=_[_0x8349('0x37')]({},_0x50270a,_0x1fb04d[_0x8349('0x43')]);return db[_0x8349('0x53')][_0x8349('0x54')](_0x50270a)[_0x8349('0x20')](respondWithFilteredResult(_0x138140,_0x50270a));})[_0x8349('0x3e')](handleError(_0x138140,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 348e3a3..9143716 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 _0xe330=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','lodash','util','api'];(function(_0x488ebf,_0x4ba59a){var _0x1d3276=function(_0x44002f){while(--_0x44002f){_0x488ebf['push'](_0x488ebf['shift']());}};_0x1d3276(++_0x4ba59a);}(_0xe330,0x107));var _0x0e33=function(_0x14d4eb,_0x1dff6b){_0x14d4eb=_0x14d4eb-0x0;var _0x58426a=_0xe330[_0x14d4eb];return _0x58426a;};'use strict';var _=require(_0x0e33('0x0'));var util=require(_0x0e33('0x1'));var logger=require('../../config/logger')(_0x0e33('0x2'));var moment=require(_0x0e33('0x3'));var BPromise=require(_0x0e33('0x4'));var rp=require(_0x0e33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e33('0x6'));var config=require(_0x0e33('0x7'));var attributes=require(_0x0e33('0x8'));module[_0x0e33('0x9')]=function(_0x311942,_0xa5b416){return _0x311942[_0x0e33('0xa')](_0x0e33('0xb'),attributes,{'tableName':_0x0e33('0xc'),'paranoid':![],'indexes':[{'name':_0x0e33('0xd'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f30=['mailbox','context','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x46c8d6,_0x4def08){var _0xcdafe6=function(_0x5eef86){while(--_0x5eef86){_0x46c8d6['push'](_0x46c8d6['shift']());}};_0xcdafe6(++_0x4def08);}(_0x3f30,0x112));var _0x03f3=function(_0x3f7153,_0x3c0574){_0x3f7153=_0x3f7153-0x0;var _0x32b2ae=_0x3f30[_0x3f7153];return _0x32b2ae;};'use strict';var _=require('lodash');var util=require(_0x03f3('0x0'));var logger=require(_0x03f3('0x1'))(_0x03f3('0x2'));var moment=require(_0x03f3('0x3'));var BPromise=require(_0x03f3('0x4'));var rp=require(_0x03f3('0x5'));var fs=require('fs');var path=require(_0x03f3('0x6'));var rimraf=require(_0x03f3('0x7'));var config=require(_0x03f3('0x8'));var attributes=require('./voiceMail.attributes');module[_0x03f3('0x9')]=function(_0x767dc3,_0x4cb1d7){return _0x767dc3[_0x03f3('0xa')](_0x03f3('0xb'),attributes,{'tableName':_0x03f3('0xc'),'paranoid':![],'indexes':[{'name':_0x03f3('0xd'),'fields':[_0x03f3('0xe'),_0x03f3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index a331798..41afff3 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 _0x2102=['VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x574c4e,_0x5c0218){var _0x11b2e4=function(_0x207c3e){while(--_0x207c3e){_0x574c4e['push'](_0x574c4e['shift']());}};_0x11b2e4(++_0x5c0218);}(_0x2102,0x87));var _0x2210=function(_0x3c6684,_0x5026c7){_0x3c6684=_0x3c6684-0x0;var _0x2b0f7c=_0x2102[_0x3c6684];return _0x2b0f7c;};'use strict';var _=require('lodash');var util=require(_0x2210('0x0'));var moment=require(_0x2210('0x1'));var BPromise=require('bluebird');var rs=require(_0x2210('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2210('0x3'))['db'];var utils=require(_0x2210('0x4'));var logger=require(_0x2210('0x5'))('rpc');var config=require(_0x2210('0x6'));var jayson=require(_0x2210('0x7'));var client=jayson[_0x2210('0x8')][_0x2210('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a1af7,_0x438f4c,_0x2657dc){return new BPromise(function(_0x35cf23,_0x5ab2a9){return client['request'](_0x3a1af7,_0x2657dc)[_0x2210('0xa')](function(_0x409465){logger[_0x2210('0xb')](_0x2210('0xc'),_0x438f4c,_0x2210('0xd'));logger[_0x2210('0xe')](_0x2210('0xf'),_0x438f4c,_0x2210('0xd'),JSON[_0x2210('0x10')](_0x409465));if(_0x409465[_0x2210('0x11')]){if(_0x409465['error'][_0x2210('0x12')]===0x1f4){logger[_0x2210('0x11')](_0x2210('0xc'),_0x438f4c,_0x409465[_0x2210('0x11')][_0x2210('0x13')]);return _0x5ab2a9(_0x409465[_0x2210('0x11')]['message']);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x438f4c,_0x409465[_0x2210('0x11')]['message']);return _0x35cf23(_0x409465[_0x2210('0x11')][_0x2210('0x13')]);}else{logger[_0x2210('0xb')](_0x2210('0xc'),_0x438f4c,_0x2210('0xd'));_0x35cf23(_0x409465[_0x2210('0x14')][_0x2210('0x13')]);}})['catch'](function(_0x31d5e4){logger[_0x2210('0x11')](_0x2210('0xc'),_0x438f4c,_0x31d5e4);_0x5ab2a9(_0x31d5e4);});});} \ No newline at end of file +var _0x7f31=['../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7f31,0x1d9));var _0x17f3=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x7f31[_0x210d7f];return _0x42d687;};'use strict';var _=require(_0x17f3('0x0'));var util=require(_0x17f3('0x1'));var moment=require(_0x17f3('0x2'));var BPromise=require(_0x17f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17f3('0x4'));var db=require(_0x17f3('0x5'))['db'];var utils=require(_0x17f3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x17f3('0x7'));var jayson=require(_0x17f3('0x8'));var client=jayson[_0x17f3('0x9')][_0x17f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b2923,_0x6629b6,_0x2ec63c){return new BPromise(function(_0x564737,_0x36dedd){return client[_0x17f3('0xb')](_0x5b2923,_0x2ec63c)['then'](function(_0x478aab){logger[_0x17f3('0xc')](_0x17f3('0xd'),_0x6629b6,'request\x20sent');logger[_0x17f3('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x6629b6,_0x17f3('0xf'),JSON[_0x17f3('0x10')](_0x478aab));if(_0x478aab[_0x17f3('0x11')]){if(_0x478aab[_0x17f3('0x11')][_0x17f3('0x12')]===0x1f4){logger[_0x17f3('0x11')]('VoiceMail,\x20%s,\x20%s',_0x6629b6,_0x478aab['error'][_0x17f3('0x13')]);return _0x36dedd(_0x478aab[_0x17f3('0x11')]['message']);}logger[_0x17f3('0x11')]('VoiceMail,\x20%s,\x20%s',_0x6629b6,_0x478aab[_0x17f3('0x11')]['message']);return _0x564737(_0x478aab[_0x17f3('0x11')][_0x17f3('0x13')]);}else{logger[_0x17f3('0xc')](_0x17f3('0xd'),_0x6629b6,_0x17f3('0xf'));_0x564737(_0x478aab['result'][_0x17f3('0x13')]);}})['catch'](function(_0x4b9927){logger['error'](_0x17f3('0xd'),_0x6629b6,_0x4b9927);_0x36dedd(_0x4b9927);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d1cfe90..4df3b66 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 _0x4625=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','/:id/download','download','post','put','update','delete','destroy','exports'];(function(_0x5aa5a6,_0x2aba26){var _0x3cff27=function(_0x5beba2){while(--_0x5beba2){_0x5aa5a6['push'](_0x5aa5a6['shift']());}};_0x3cff27(++_0x2aba26);}(_0x4625,0xbe));var _0x5462=function(_0x18ec61,_0x9fa74b){_0x18ec61=_0x18ec61-0x0;var _0xeaed3e=_0x4625[_0x18ec61];return _0xeaed3e;};'use strict';var multer=require(_0x5462('0x0'));var util=require(_0x5462('0x1'));var path=require(_0x5462('0x2'));var timeout=require(_0x5462('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5462('0x4'));var interaction=require(_0x5462('0x5'));var config=require(_0x5462('0x6'));var controller=require(_0x5462('0x7'));router[_0x5462('0x8')]('/',auth[_0x5462('0x9')](),controller['index']);router[_0x5462('0x8')](_0x5462('0xa'),auth[_0x5462('0x9')](),controller['show']);router[_0x5462('0x8')](_0x5462('0xb'),auth['isAuthenticated'](),controller[_0x5462('0xc')]);router[_0x5462('0xd')]('/',auth[_0x5462('0x9')](),controller['create']);router[_0x5462('0xe')](_0x5462('0xa'),auth[_0x5462('0x9')](),controller[_0x5462('0xf')]);router[_0x5462('0x10')]('/:id',auth[_0x5462('0x9')](),controller[_0x5462('0x11')]);module[_0x5462('0x12')]=router; \ No newline at end of file +var _0x7bfd=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','put','update','delete'];(function(_0x571c8e,_0x18546d){var _0x1fe343=function(_0x34e91c){while(--_0x34e91c){_0x571c8e['push'](_0x571c8e['shift']());}};_0x1fe343(++_0x18546d);}(_0x7bfd,0x1b5));var _0xd7bf=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7bfd[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xd7bf('0x0'));var util=require(_0xd7bf('0x1'));var path=require(_0xd7bf('0x2'));var timeout=require(_0xd7bf('0x3'));var express=require(_0xd7bf('0x4'));var router=express[_0xd7bf('0x5')]();var auth=require(_0xd7bf('0x6'));var interaction=require(_0xd7bf('0x7'));var config=require(_0xd7bf('0x8'));var controller=require(_0xd7bf('0x9'));router[_0xd7bf('0xa')]('/',auth[_0xd7bf('0xb')](),controller['index']);router[_0xd7bf('0xa')](_0xd7bf('0xc'),auth['isAuthenticated'](),controller[_0xd7bf('0xd')]);router[_0xd7bf('0xa')](_0xd7bf('0xe'),auth[_0xd7bf('0xb')](),controller[_0xd7bf('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd7bf('0x10')](_0xd7bf('0xc'),auth[_0xd7bf('0xb')](),controller[_0xd7bf('0x11')]);router[_0xd7bf('0x12')](_0xd7bf('0xc'),auth[_0xd7bf('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index d4b0b62..ed12089 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 _0x240f=['sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x2cbdc5,_0x54d560){var _0x1f5dad=function(_0x522105){while(--_0x522105){_0x2cbdc5['push'](_0x2cbdc5['shift']());}};_0x1f5dad(++_0x54d560);}(_0x240f,0x1a8));var _0xf240=function(_0x5d0810,_0x155f4c){_0x5d0810=_0x5d0810-0x0;var _0x148a3f=_0x240f[_0x5d0810];return _0x148a3f;};'use strict';var Sequelize=require(_0xf240('0x0'));module[_0xf240('0x1')]={'name':{'type':Sequelize[_0xf240('0x2')],'get':function(_0x4d6ada){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xf240('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf240('0x5')](_0xf240('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf240('0x4')],'defaultValue':''},'stamp':{'type':_0xf240('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0xc8ac=['BLOB','long','sequelize','exports','VIRTUAL','INTEGER','STRING'];(function(_0x164798,_0x29e959){var _0xc5da=function(_0x30e86f){while(--_0x30e86f){_0x164798['push'](_0x164798['shift']());}};_0xc5da(++_0x29e959);}(_0xc8ac,0xe9));var _0xcc8a=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0xc8ac[_0x322bef];return _0x229e60;};'use strict';var Sequelize=require(_0xcc8a('0x0'));module[_0xcc8a('0x1')]={'name':{'type':Sequelize[_0xcc8a('0x2')],'get':function(_0x7fb54a){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xcc8a('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xcc8a('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xcc8a('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xcc8a('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xcc8a('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xcc8a('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xcc8a('0x5')](_0xcc8a('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xcc8a('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 434c7a8..7c427d2 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 _0xdda8=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','name','send','index','VoiceMailMessage','rawAttributes','model','keys','query','attributes','intersection','fields','length','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','rows','catch','params','find','create','body','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','.wav\x22','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdda8,0x1cd));var _0x8dda=function(_0x39b447,_0x2a526c){_0x39b447=_0x39b447-0x0;var _0x5e479e=_0xdda8[_0x39b447];return _0x5e479e;};'use strict';var pdf=require(_0x8dda('0x0'));var emlformat=require(_0x8dda('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8dda('0x2'));var jsonpatch=require(_0x8dda('0x3'));var rp=require(_0x8dda('0x4'));var moment=require(_0x8dda('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8dda('0x6'));var util=require(_0x8dda('0x7'));var path=require(_0x8dda('0x8'));var sox=require(_0x8dda('0x9'));var csv=require(_0x8dda('0xa'));var ejs=require(_0x8dda('0xb'));var fs=require('fs');var _=require(_0x8dda('0xc'));var squel=require(_0x8dda('0xd'));var crypto=require(_0x8dda('0xe'));var jsforce=require(_0x8dda('0xf'));var deskjs=require(_0x8dda('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8dda('0x11'));var Papa=require(_0x8dda('0x12'));var Redis=require(_0x8dda('0x13'));var authService=require(_0x8dda('0x14'));var qs=require(_0x8dda('0x15'));var hardwareService=require(_0x8dda('0x16'));var logger=require('../../config/logger')(_0x8dda('0x17'));var utils=require(_0x8dda('0x18'));var config=require(_0x8dda('0x19'));var db=require(_0x8dda('0x1a'))['db'];function respondWithStatusCode(_0x280c08,_0xc15fb4){_0xc15fb4=_0xc15fb4||0xcc;return function(_0xea0cee){if(_0xea0cee){return _0x280c08[_0x8dda('0x1b')](_0xc15fb4);}return _0x280c08[_0x8dda('0x1c')](_0xc15fb4)[_0x8dda('0x1d')]();};}function respondWithResult(_0x4b0146,_0x2a8126){_0x2a8126=_0x2a8126||0xc8;return function(_0x2c6e12){if(_0x2c6e12){return _0x4b0146[_0x8dda('0x1c')](_0x2a8126)[_0x8dda('0x1e')](_0x2c6e12);}};}function respondWithFilteredResult(_0x1fd178,_0x1b78e7){return function(_0x1d2c54){if(_0x1d2c54){var _0x4c00be=_0x1d2c54[_0x8dda('0x1f')],_0x9fa579=_0x1b78e7[_0x8dda('0x20')],_0x2f80d7=_0x1b78e7[_0x8dda('0x20')]+_0x1b78e7[_0x8dda('0x21')],_0x1f63a9;if(_0x2f80d7>=_0x4c00be){_0x2f80d7=_0x4c00be;_0x1f63a9=0xc8;}else{_0x1f63a9=0xce;}_0x1fd178['status'](_0x1f63a9);return _0x1fd178[_0x8dda('0x22')](_0x8dda('0x23'),_0x9fa579+'-'+_0x2f80d7+'/'+_0x4c00be)[_0x8dda('0x1e')](_0x1d2c54);}return null;};}function patchUpdates(_0x2b04a8){return function(_0x837129){try{jsonpatch['apply'](_0x837129,_0x2b04a8,!![]);}catch(_0x5ec35c){return BPromise['reject'](_0x5ec35c);}return _0x837129[_0x8dda('0x24')]();};}function saveUpdates(_0x43f634,_0x47da84){return function(_0x444171){if(_0x444171){return _0x444171[_0x8dda('0x25')](_0x43f634)[_0x8dda('0x26')](function(_0x296f95){return _0x296f95;});}return null;};}function removeEntity(_0x234d17,_0x46f365){return function(_0x59c3ae){if(_0x59c3ae){return _0x59c3ae[_0x8dda('0x27')]()[_0x8dda('0x26')](function(){_0x234d17[_0x8dda('0x1c')](0xcc)[_0x8dda('0x1d')]();});}};}function handleEntityNotFound(_0x1c202f,_0x525515){return function(_0x1b9b2f){if(!_0x1b9b2f){_0x1c202f[_0x8dda('0x1b')](0x194);}return _0x1b9b2f;};}function handleError(_0x91263d,_0x3bc141){_0x3bc141=_0x3bc141||0x1f4;return function(_0x303aab){logger[_0x8dda('0x28')](_0x303aab['stack']);if(_0x303aab[_0x8dda('0x29')]){delete _0x303aab[_0x8dda('0x29')];}_0x91263d[_0x8dda('0x1c')](_0x3bc141)[_0x8dda('0x2a')](_0x303aab);};}exports[_0x8dda('0x2b')]=function(_0x5e3b2b,_0x4011dd){var _0x29e191={},_0x442747={},_0x4d75e1={'count':0x0,'rows':[]};var _0xdc2e9e=db[_0x8dda('0x2c')][_0x8dda('0x2d')];_0x442747[_0x8dda('0x2e')]=_['differenceBy'](_[_0x8dda('0x2f')](_0xdc2e9e),[_0x8dda('0x29')]);_0x442747[_0x8dda('0x30')]=_[_0x8dda('0x2f')](_0x5e3b2b['query']);_0x442747['filters']=_['intersection'](_0x442747[_0x8dda('0x2e')],_0x442747[_0x8dda('0x30')]);_0x29e191[_0x8dda('0x31')]=_[_0x8dda('0x32')](_0x442747['model'],qs['fields'](_0x5e3b2b[_0x8dda('0x30')][_0x8dda('0x33')]));_0x29e191[_0x8dda('0x31')]=_0x29e191[_0x8dda('0x31')][_0x8dda('0x34')]?_0x29e191[_0x8dda('0x31')]:_0x442747['model'];if(!_0x5e3b2b[_0x8dda('0x30')]['hasOwnProperty']('nolimit')){_0x29e191[_0x8dda('0x21')]=qs[_0x8dda('0x21')](_0x5e3b2b['query'][_0x8dda('0x21')]);_0x29e191['offset']=qs[_0x8dda('0x20')](_0x5e3b2b[_0x8dda('0x30')][_0x8dda('0x20')]);}_0x29e191['order']=qs[_0x8dda('0x35')](_0x5e3b2b[_0x8dda('0x30')][_0x8dda('0x35')]);_0x29e191[_0x8dda('0x36')]=qs[_0x8dda('0x37')](_[_0x8dda('0x38')](_0x5e3b2b[_0x8dda('0x30')],_0x442747[_0x8dda('0x37')]));if(_0x5e3b2b[_0x8dda('0x30')][_0x8dda('0x39')]){_0x29e191[_0x8dda('0x36')]=_[_0x8dda('0x3a')](_0x29e191[_0x8dda('0x36')],{'$or':_['map'](_0xdc2e9e,function(_0x474622){if(_0x474622[_0x8dda('0x3b')]['key']!==_0x8dda('0x3c')){var _0x3be713={};_0x3be713[_0x474622[_0x8dda('0x3d')]]={'$like':'%'+_0x5e3b2b[_0x8dda('0x30')]['filter']+'%'};return _0x3be713;}})});}_0x29e191=_[_0x8dda('0x3a')]({},_0x29e191,_0x5e3b2b[_0x8dda('0x3e')]);var _0xebe3c3={'where':_0x29e191['where']};return db[_0x8dda('0x2c')][_0x8dda('0x1f')](_0xebe3c3)[_0x8dda('0x26')](function(_0x5848ae){_0x4d75e1['count']=_0x5848ae;if(_0x5e3b2b[_0x8dda('0x30')][_0x8dda('0x3f')]){_0x29e191[_0x8dda('0x40')]=[{'all':!![]}];}return db[_0x8dda('0x2c')]['findAll'](_0x29e191);})[_0x8dda('0x26')](function(_0x55215e){_0x4d75e1[_0x8dda('0x41')]=_0x55215e;return _0x4d75e1;})[_0x8dda('0x26')](respondWithFilteredResult(_0x4011dd,_0x29e191))[_0x8dda('0x42')](handleError(_0x4011dd,null));};exports['show']=function(_0x45f95a,_0x1fc075){var _0x535fdb={'raw':!![],'where':{'id':_0x45f95a[_0x8dda('0x43')]['id']}},_0xbbb8e2={};_0xbbb8e2[_0x8dda('0x2e')]=_[_0x8dda('0x2f')](db[_0x8dda('0x2c')][_0x8dda('0x2d')]);_0xbbb8e2[_0x8dda('0x30')]=_[_0x8dda('0x2f')](_0x45f95a[_0x8dda('0x30')]);_0xbbb8e2['filters']=_[_0x8dda('0x32')](_0xbbb8e2[_0x8dda('0x2e')],_0xbbb8e2[_0x8dda('0x30')]);_0x535fdb[_0x8dda('0x31')]=_[_0x8dda('0x32')](_0xbbb8e2[_0x8dda('0x2e')],qs[_0x8dda('0x33')](_0x45f95a['query'][_0x8dda('0x33')]));_0x535fdb[_0x8dda('0x31')]=_0x535fdb[_0x8dda('0x31')][_0x8dda('0x34')]?_0x535fdb['attributes']:_0xbbb8e2[_0x8dda('0x2e')];if(_0x45f95a[_0x8dda('0x30')][_0x8dda('0x3f')]){_0x535fdb[_0x8dda('0x40')]=[{'all':!![]}];}_0x535fdb=_['merge']({},_0x535fdb,_0x45f95a[_0x8dda('0x3e')]);return db[_0x8dda('0x2c')][_0x8dda('0x44')](_0x535fdb)[_0x8dda('0x26')](handleEntityNotFound(_0x1fc075,null))[_0x8dda('0x26')](respondWithResult(_0x1fc075,null))[_0x8dda('0x42')](handleError(_0x1fc075,null));};exports[_0x8dda('0x45')]=function(_0x17a6cb,_0x3167a5){return db[_0x8dda('0x2c')][_0x8dda('0x45')](_0x17a6cb['body'],{})['then'](respondWithResult(_0x3167a5,0xc9))[_0x8dda('0x42')](handleError(_0x3167a5,null));};exports[_0x8dda('0x25')]=function(_0x582621,_0x28441e){if(_0x582621['body']['id']){delete _0x582621[_0x8dda('0x46')]['id'];}return db[_0x8dda('0x2c')][_0x8dda('0x44')]({'where':{'id':_0x582621['params']['id']}})[_0x8dda('0x26')](handleEntityNotFound(_0x28441e,null))[_0x8dda('0x26')](saveUpdates(_0x582621[_0x8dda('0x46')],null))[_0x8dda('0x26')](respondWithResult(_0x28441e,null))[_0x8dda('0x42')](handleError(_0x28441e,null));};exports[_0x8dda('0x27')]=function(_0x452baf,_0x44a1b7){return db['VoiceMailMessage'][_0x8dda('0x44')]({'where':{'id':_0x452baf[_0x8dda('0x43')]['id']}})[_0x8dda('0x26')](handleEntityNotFound(_0x44a1b7,null))[_0x8dda('0x26')](removeEntity(_0x44a1b7,null))['catch'](handleError(_0x44a1b7,null));};exports[_0x8dda('0x47')]=function(_0x256601,_0x2f0d07,_0x706d1b){return db[_0x8dda('0x2c')][_0x8dda('0x44')]({'where':{'id':_0x256601[_0x8dda('0x43')]['id']},'attributes':['id',_0x8dda('0x48'),_0x8dda('0x49')]})[_0x8dda('0x26')](handleEntityNotFound(_0x2f0d07,null))['then'](function(_0x5eb87){if(_0x5eb87){if(!_0x5eb87[_0x8dda('0x48')]){throw new db[(_0x8dda('0x4a'))][(_0x8dda('0x4b'))]('VoiceMailMessage\x20not\x20found');}var _0x40ca5f={'Content-Type':_0x8dda('0x4c'),'Content-Disposition':_0x8dda('0x4d')};if(_0x5eb87[_0x8dda('0x49')]){_0x40ca5f['Content-Disposition']='attachment;\x20filename=\x22'+_0x5eb87[_0x8dda('0x49')]+_0x8dda('0x4e');}_0x2f0d07[_0x8dda('0x22')](_0x40ca5f);return _0x2f0d07[_0x8dda('0x2a')](new Buffer(_0x5eb87[_0x8dda('0x48')]));}})['catch'](handleError(_0x2f0d07,null));}; \ No newline at end of file +var _0x9af5=['body','recording','msg_id','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','show','params','VoiceMailMessage','includeAll','find','catch','create'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x9af5,0xf9));var _0x59af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9af5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x59af('0x0'));var emlformat=require(_0x59af('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x59af('0x2'));var jsonpatch=require(_0x59af('0x3'));var rp=require(_0x59af('0x4'));var moment=require(_0x59af('0x5'));var BPromise=require(_0x59af('0x6'));var Mustache=require(_0x59af('0x7'));var util=require(_0x59af('0x8'));var path=require(_0x59af('0x9'));var sox=require(_0x59af('0xa'));var csv=require(_0x59af('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x59af('0xc'));var squel=require(_0x59af('0xd'));var crypto=require(_0x59af('0xe'));var jsforce=require(_0x59af('0xf'));var deskjs=require(_0x59af('0x10'));var toCsv=require(_0x59af('0xb'));var querystring=require(_0x59af('0x11'));var Papa=require(_0x59af('0x12'));var Redis=require(_0x59af('0x13'));var authService=require(_0x59af('0x14'));var qs=require(_0x59af('0x15'));var hardwareService=require(_0x59af('0x16'));var logger=require(_0x59af('0x17'))(_0x59af('0x18'));var utils=require(_0x59af('0x19'));var config=require('../../config/environment');var db=require(_0x59af('0x1a'))['db'];function respondWithStatusCode(_0x548b79,_0x4d430c){_0x4d430c=_0x4d430c||0xcc;return function(_0x3c0898){if(_0x3c0898){return _0x548b79[_0x59af('0x1b')](_0x4d430c);}return _0x548b79[_0x59af('0x1c')](_0x4d430c)['end']();};}function respondWithResult(_0x596d59,_0x482ada){_0x482ada=_0x482ada||0xc8;return function(_0x484756){if(_0x484756){return _0x596d59[_0x59af('0x1c')](_0x482ada)[_0x59af('0x1d')](_0x484756);}};}function respondWithFilteredResult(_0x447577,_0x54e171){return function(_0x4906e8){if(_0x4906e8){var _0x4a08c8=_0x4906e8[_0x59af('0x1e')],_0x391b8d=_0x54e171[_0x59af('0x1f')],_0x1fc5de=_0x54e171[_0x59af('0x1f')]+_0x54e171[_0x59af('0x20')],_0x59af95;if(_0x1fc5de>=_0x4a08c8){_0x1fc5de=_0x4a08c8;_0x59af95=0xc8;}else{_0x59af95=0xce;}_0x447577[_0x59af('0x1c')](_0x59af95);return _0x447577[_0x59af('0x21')]('Content-Range',_0x391b8d+'-'+_0x1fc5de+'/'+_0x4a08c8)[_0x59af('0x1d')](_0x4906e8);}return null;};}function patchUpdates(_0x54b672){return function(_0xfdb3){try{jsonpatch[_0x59af('0x22')](_0xfdb3,_0x54b672,!![]);}catch(_0xe86e38){return BPromise[_0x59af('0x23')](_0xe86e38);}return _0xfdb3[_0x59af('0x24')]();};}function saveUpdates(_0x1753c3,_0x21a733){return function(_0x2f5e18){if(_0x2f5e18){return _0x2f5e18[_0x59af('0x25')](_0x1753c3)[_0x59af('0x26')](function(_0x5b9bf9){return _0x5b9bf9;});}return null;};}function removeEntity(_0x3cc145,_0x330823){return function(_0x43b14a){if(_0x43b14a){return _0x43b14a[_0x59af('0x27')]()[_0x59af('0x26')](function(){_0x3cc145[_0x59af('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5288a5,_0x3b7eb6){return function(_0x5ef961){if(!_0x5ef961){_0x5288a5['sendStatus'](0x194);}return _0x5ef961;};}function handleError(_0x68a67d,_0x51874b){_0x51874b=_0x51874b||0x1f4;return function(_0x1547c7){logger[_0x59af('0x28')](_0x1547c7[_0x59af('0x29')]);if(_0x1547c7[_0x59af('0x2a')]){delete _0x1547c7['name'];}_0x68a67d[_0x59af('0x1c')](_0x51874b)[_0x59af('0x2b')](_0x1547c7);};}exports[_0x59af('0x2c')]=function(_0x3351a1,_0x528f51){var _0xfd0ee={},_0x177f2e={},_0x249c96={'count':0x0,'rows':[]};var _0x29ba95=db['VoiceMailMessage'][_0x59af('0x2d')];_0x177f2e[_0x59af('0x2e')]=_[_0x59af('0x2f')](_['keys'](_0x29ba95),[_0x59af('0x2a')]);_0x177f2e[_0x59af('0x30')]=_[_0x59af('0x31')](_0x3351a1[_0x59af('0x30')]);_0x177f2e['filters']=_[_0x59af('0x32')](_0x177f2e[_0x59af('0x2e')],_0x177f2e[_0x59af('0x30')]);_0xfd0ee[_0x59af('0x33')]=_[_0x59af('0x32')](_0x177f2e[_0x59af('0x2e')],qs['fields'](_0x3351a1[_0x59af('0x30')][_0x59af('0x34')]));_0xfd0ee[_0x59af('0x33')]=_0xfd0ee[_0x59af('0x33')][_0x59af('0x35')]?_0xfd0ee[_0x59af('0x33')]:_0x177f2e[_0x59af('0x2e')];if(!_0x3351a1[_0x59af('0x30')][_0x59af('0x36')]('nolimit')){_0xfd0ee[_0x59af('0x20')]=qs[_0x59af('0x20')](_0x3351a1[_0x59af('0x30')][_0x59af('0x20')]);_0xfd0ee[_0x59af('0x1f')]=qs['offset'](_0x3351a1[_0x59af('0x30')][_0x59af('0x1f')]);}_0xfd0ee['order']=qs[_0x59af('0x37')](_0x3351a1[_0x59af('0x30')][_0x59af('0x37')]);_0xfd0ee[_0x59af('0x38')]=qs[_0x59af('0x39')](_[_0x59af('0x3a')](_0x3351a1['query'],_0x177f2e['filters']));if(_0x3351a1[_0x59af('0x30')][_0x59af('0x3b')]){_0xfd0ee[_0x59af('0x38')]=_[_0x59af('0x3c')](_0xfd0ee[_0x59af('0x38')],{'$or':_[_0x59af('0x3d')](_0x29ba95,function(_0x1f1876){if(_0x1f1876[_0x59af('0x3e')]['key']!==_0x59af('0x3f')){var _0x4550df={};_0x4550df[_0x1f1876[_0x59af('0x40')]]={'$like':'%'+_0x3351a1[_0x59af('0x30')]['filter']+'%'};return _0x4550df;}})});}_0xfd0ee=_[_0x59af('0x3c')]({},_0xfd0ee,_0x3351a1[_0x59af('0x41')]);var _0x38609a={'where':_0xfd0ee[_0x59af('0x38')]};return db['VoiceMailMessage'][_0x59af('0x1e')](_0x38609a)['then'](function(_0x5e1e9f){_0x249c96[_0x59af('0x1e')]=_0x5e1e9f;if(_0x3351a1[_0x59af('0x30')]['includeAll']){_0xfd0ee[_0x59af('0x42')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x59af('0x43')](_0xfd0ee);})[_0x59af('0x26')](function(_0x1d041f){_0x249c96['rows']=_0x1d041f;return _0x249c96;})[_0x59af('0x26')](respondWithFilteredResult(_0x528f51,_0xfd0ee))['catch'](handleError(_0x528f51,null));};exports[_0x59af('0x44')]=function(_0x51948e,_0x5efb0c){var _0x2d0fd3={'raw':!![],'where':{'id':_0x51948e[_0x59af('0x45')]['id']}},_0x1629e9={};_0x1629e9[_0x59af('0x2e')]=_['keys'](db[_0x59af('0x46')][_0x59af('0x2d')]);_0x1629e9[_0x59af('0x30')]=_[_0x59af('0x31')](_0x51948e[_0x59af('0x30')]);_0x1629e9[_0x59af('0x39')]=_[_0x59af('0x32')](_0x1629e9[_0x59af('0x2e')],_0x1629e9['query']);_0x2d0fd3[_0x59af('0x33')]=_[_0x59af('0x32')](_0x1629e9[_0x59af('0x2e')],qs[_0x59af('0x34')](_0x51948e['query'][_0x59af('0x34')]));_0x2d0fd3[_0x59af('0x33')]=_0x2d0fd3[_0x59af('0x33')][_0x59af('0x35')]?_0x2d0fd3[_0x59af('0x33')]:_0x1629e9[_0x59af('0x2e')];if(_0x51948e[_0x59af('0x30')][_0x59af('0x47')]){_0x2d0fd3[_0x59af('0x42')]=[{'all':!![]}];}_0x2d0fd3=_[_0x59af('0x3c')]({},_0x2d0fd3,_0x51948e['options']);return db[_0x59af('0x46')][_0x59af('0x48')](_0x2d0fd3)[_0x59af('0x26')](handleEntityNotFound(_0x5efb0c,null))['then'](respondWithResult(_0x5efb0c,null))[_0x59af('0x49')](handleError(_0x5efb0c,null));};exports[_0x59af('0x4a')]=function(_0x392572,_0x174086){return db['VoiceMailMessage'][_0x59af('0x4a')](_0x392572[_0x59af('0x4b')],{})[_0x59af('0x26')](respondWithResult(_0x174086,0xc9))[_0x59af('0x49')](handleError(_0x174086,null));};exports['update']=function(_0x3897e4,_0x2be2d2){if(_0x3897e4[_0x59af('0x4b')]['id']){delete _0x3897e4[_0x59af('0x4b')]['id'];}return db[_0x59af('0x46')]['find']({'where':{'id':_0x3897e4[_0x59af('0x45')]['id']}})[_0x59af('0x26')](handleEntityNotFound(_0x2be2d2,null))[_0x59af('0x26')](saveUpdates(_0x3897e4['body'],null))[_0x59af('0x26')](respondWithResult(_0x2be2d2,null))[_0x59af('0x49')](handleError(_0x2be2d2,null));};exports[_0x59af('0x27')]=function(_0x54fd4c,_0x53820c){return db[_0x59af('0x46')]['find']({'where':{'id':_0x54fd4c[_0x59af('0x45')]['id']}})[_0x59af('0x26')](handleEntityNotFound(_0x53820c,null))[_0x59af('0x26')](removeEntity(_0x53820c,null))['catch'](handleError(_0x53820c,null));};exports['download']=function(_0x4e9281,_0x3fad56,_0x16d0b6){return db[_0x59af('0x46')]['find']({'where':{'id':_0x4e9281[_0x59af('0x45')]['id']},'attributes':['id',_0x59af('0x4c'),_0x59af('0x4d')]})[_0x59af('0x26')](handleEntityNotFound(_0x3fad56,null))[_0x59af('0x26')](function(_0x651d73){if(_0x651d73){if(!_0x651d73[_0x59af('0x4c')]){throw new db['Sequelize']['ValidationError'](_0x59af('0x4e'));}var _0xb76747={'Content-Type':_0x59af('0x4f'),'Content-Disposition':'attachment'};if(_0x651d73[_0x59af('0x4d')]){_0xb76747['Content-Disposition']=_0x59af('0x50')+_0x651d73[_0x59af('0x4d')]+'.wav\x22';}_0x3fad56['set'](_0xb76747);return _0x3fad56[_0x59af('0x2b')](new Buffer(_0x651d73[_0x59af('0x4c')]));}})['catch'](handleError(_0x3fad56,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 669bd3a..771ab90 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 _0x1b79=['request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x282999,_0x4df660){var _0x30681f=function(_0x50e926){while(--_0x50e926){_0x282999['push'](_0x282999['shift']());}};_0x30681f(++_0x4df660);}(_0x1b79,0x1ba));var _0x91b7=function(_0xa49ada,_0xfb3cd1){_0xa49ada=_0xa49ada-0x0;var _0x48f893=_0x1b79[_0xa49ada];return _0x48f893;};'use strict';var _=require(_0x91b7('0x0'));var util=require(_0x91b7('0x1'));var logger=require(_0x91b7('0x2'))(_0x91b7('0x3'));var moment=require(_0x91b7('0x4'));var BPromise=require(_0x91b7('0x5'));var rp=require(_0x91b7('0x6'));var fs=require('fs');var path=require(_0x91b7('0x7'));var rimraf=require('rimraf');var config=require(_0x91b7('0x8'));var attributes=require(_0x91b7('0x9'));module[_0x91b7('0xa')]=function(_0x3748a1,_0x53aff7){return _0x3748a1[_0x91b7('0xb')](_0x91b7('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x91b7('0xd'),'fields':[_0x91b7('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf7c4=['request-promise','rimraf','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7c4,0x1e7));var _0x4f7c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf7c4[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x4f7c('0x0'));var util=require('util');var logger=require(_0x4f7c('0x1'))(_0x4f7c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4f7c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f7c('0x4'));var config=require('../../config/environment');var attributes=require(_0x4f7c('0x5'));module['exports']=function(_0x12b219,_0x664e0e){return _0x12b219[_0x4f7c('0x6')](_0x4f7c('0x7'),attributes,{'tableName':_0x4f7c('0x8'),'paranoid':![],'indexes':[{'name':_0x4f7c('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5b2e2dd..c2d3966 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 _0x49b0=['request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x49b0,0x1e3));var _0x049b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x049b('0x0'));var util=require(_0x049b('0x1'));var moment=require(_0x049b('0x2'));var BPromise=require(_0x049b('0x3'));var rs=require(_0x049b('0x4'));var fs=require('fs');var Redis=require(_0x049b('0x5'));var db=require(_0x049b('0x6'))['db'];var utils=require(_0x049b('0x7'));var logger=require(_0x049b('0x8'))(_0x049b('0x9'));var config=require(_0x049b('0xa'));var jayson=require(_0x049b('0xb'));var client=jayson[_0x049b('0xc')][_0x049b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4535a9,_0x45782f,_0x3563b0){return new BPromise(function(_0x2c71d4,_0x2764e7){return client[_0x049b('0xe')](_0x4535a9,_0x3563b0)['then'](function(_0x4b3fbb){logger[_0x049b('0xf')](_0x049b('0x10'),_0x45782f,_0x049b('0x11'));logger[_0x049b('0x12')](_0x049b('0x13'),_0x45782f,_0x049b('0x11'),JSON[_0x049b('0x14')](_0x4b3fbb));if(_0x4b3fbb[_0x049b('0x15')]){if(_0x4b3fbb['error'][_0x049b('0x16')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x45782f,_0x4b3fbb[_0x049b('0x15')]['message']);return _0x2764e7(_0x4b3fbb['error']['message']);}logger[_0x049b('0x15')](_0x049b('0x10'),_0x45782f,_0x4b3fbb[_0x049b('0x15')][_0x049b('0x17')]);return _0x2c71d4(_0x4b3fbb[_0x049b('0x15')]['message']);}else{logger['info'](_0x049b('0x10'),_0x45782f,_0x049b('0x11'));_0x2c71d4(_0x4b3fbb['result']['message']);}})[_0x049b('0x18')](function(_0x38b193){logger[_0x049b('0x15')](_0x049b('0x10'),_0x45782f,_0x38b193);_0x2764e7(_0x38b193);});});} \ No newline at end of file +var _0xf3d4=['stringify','error','code','message','result','catch','util','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3d4,0x78));var _0x4f3d=function(_0x2071ce,_0x242ac7){_0x2071ce=_0x2071ce-0x0;var _0x54f5a8=_0xf3d4[_0x2071ce];return _0x54f5a8;};'use strict';var _=require('lodash');var util=require(_0x4f3d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f3d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4f3d('0x2'))(_0x4f3d('0x3'));var config=require(_0x4f3d('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4f3d('0x5')][_0x4f3d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x96830a,_0x2038cb,_0x22d426){return new BPromise(function(_0x4a0040,_0x393a44){return client[_0x4f3d('0x7')](_0x96830a,_0x22d426)[_0x4f3d('0x8')](function(_0x271997){logger[_0x4f3d('0x9')](_0x4f3d('0xa'),_0x2038cb,_0x4f3d('0xb'));logger[_0x4f3d('0xc')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x2038cb,_0x4f3d('0xb'),JSON[_0x4f3d('0xd')](_0x271997));if(_0x271997[_0x4f3d('0xe')]){if(_0x271997['error'][_0x4f3d('0xf')]===0x1f4){logger[_0x4f3d('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x2038cb,_0x271997[_0x4f3d('0xe')]['message']);return _0x393a44(_0x271997['error']['message']);}logger[_0x4f3d('0xe')](_0x4f3d('0xa'),_0x2038cb,_0x271997[_0x4f3d('0xe')][_0x4f3d('0x10')]);return _0x4a0040(_0x271997['error'][_0x4f3d('0x10')]);}else{logger[_0x4f3d('0x9')](_0x4f3d('0xa'),_0x2038cb,_0x4f3d('0xb'));_0x4a0040(_0x271997[_0x4f3d('0x11')][_0x4f3d('0x10')]);}})[_0x4f3d('0x12')](function(_0x58d8b8){logger[_0x4f3d('0xe')](_0x4f3d('0xa'),_0x2038cb,_0x58d8b8);_0x393a44(_0x58d8b8);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f081244..f83bb12 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 _0xedd9=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sounds','getSounds','post','addSound','put','update','delete','/:id','destroy','/:id/sounds/:id2','removeSound','exports','util'];(function(_0x4beae9,_0x5bca9b){var _0x3cc690=function(_0x172016){while(--_0x172016){_0x4beae9['push'](_0x4beae9['shift']());}};_0x3cc690(++_0x5bca9b);}(_0xedd9,0xfc));var _0x9edd=function(_0x5ed7c7,_0x58b41c){_0x5ed7c7=_0x5ed7c7-0x0;var _0x1e4b7f=_0xedd9[_0x5ed7c7];return _0x1e4b7f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['post']('/',auth[_0x9edd('0x9')](),controller['create']);router[_0x9edd('0xd')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xf')]('/:id',auth[_0x9edd('0x9')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')](_0x9edd('0x12'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x13')]);router[_0x9edd('0x11')](_0x9edd('0x14'),auth['isAuthenticated'](),controller[_0x9edd('0x15')]);module[_0x9edd('0x16')]=router; \ No newline at end of file +var _0x2bc6=['index','/:id','isAuthenticated','show','getSounds','post','/:id/sounds','put','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','../../components/interaction/service','./voiceMusicOnHold.controller','get'];(function(_0x502ff1,_0x13b500){var _0x19b961=function(_0x1a5623){while(--_0x1a5623){_0x502ff1['push'](_0x502ff1['shift']());}};_0x19b961(++_0x13b500);}(_0x2bc6,0x163));var _0x62bc=function(_0x5908f9,_0x59d9d1){_0x5908f9=_0x5908f9-0x0;var _0xbdc629=_0x2bc6[_0x5908f9];return _0xbdc629;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x62bc('0x3'));var config=require('../../config/environment');var controller=require(_0x62bc('0x4'));router[_0x62bc('0x5')]('/',auth['isAuthenticated'](),controller[_0x62bc('0x6')]);router[_0x62bc('0x5')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller[_0x62bc('0x9')]);router[_0x62bc('0x5')]('/:id/sounds',auth[_0x62bc('0x8')](),controller[_0x62bc('0xa')]);router[_0x62bc('0xb')]('/',auth[_0x62bc('0x8')](),controller['create']);router[_0x62bc('0xb')](_0x62bc('0xc'),auth[_0x62bc('0x8')](),controller['addSound']);router[_0x62bc('0xd')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller[_0x62bc('0xe')]);router[_0x62bc('0xf')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller['destroy']);router[_0x62bc('0xf')](_0x62bc('0x10'),auth['isAuthenticated'](),controller[_0x62bc('0x11')]);module[_0x62bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a42c85b..ee96485 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 _0x7ca2=['ENUM','custom','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','sequelize','exports','STRING'];(function(_0x69a748,_0x7e2ee1){var _0x116db0=function(_0x67e3ab){while(--_0x67e3ab){_0x69a748['push'](_0x69a748['shift']());}};_0x116db0(++_0x7e2ee1);}(_0x7ca2,0xa2));var _0x27ca=function(_0x45eaa3,_0x1181e2){_0x45eaa3=_0x45eaa3-0x0;var _0x55ba26=_0x7ca2[_0x45eaa3];return _0x55ba26;};'use strict';var Sequelize=require(_0x27ca('0x0'));module[_0x27ca('0x1')]={'name':{'type':Sequelize[_0x27ca('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x27ca('0x3')](_0x27ca('0x4'),_0x27ca('0x5'),_0x27ca('0x6'),_0x27ca('0x7'),'quietmp3',_0x27ca('0x8')),'allowNull':!![],'defaultValue':_0x27ca('0x5')},'directory':{'type':Sequelize[_0x27ca('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x27ca('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x27ca('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x27ca('0x2')],'allowNull':!![],'defaultValue':_0x27ca('0x9')},'format':{'type':Sequelize[_0x27ca('0x2')],'allowNull':!![]},'stamp':{'type':_0x27ca('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfa70=['alpha','TIMESTAMP','sequelize','exports','STRING','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x2c7a74,_0x4cb0c0){var _0x19815a=function(_0x37ab39){while(--_0x37ab39){_0x2c7a74['push'](_0x2c7a74['shift']());}};_0x19815a(++_0x4cb0c0);}(_0xfa70,0x156));var _0x0fa7=function(_0x318b03,_0x5b31b2){_0x318b03=_0x318b03-0x0;var _0x40f77e=_0xfa70[_0x318b03];return _0x40f77e;};'use strict';var Sequelize=require(_0x0fa7('0x0'));module[_0x0fa7('0x1')]={'name':{'type':Sequelize[_0x0fa7('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom',_0x0fa7('0x3'),_0x0fa7('0x4'),_0x0fa7('0x5'),_0x0fa7('0x6'),_0x0fa7('0x7')),'allowNull':!![],'defaultValue':_0x0fa7('0x3')},'directory':{'type':Sequelize[_0x0fa7('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x0fa7('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x0fa7('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x0fa7('0x2')],'allowNull':!![],'defaultValue':_0x0fa7('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x0fa7('0x9')},'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 73da555..617f028 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 _0xd5cf=['createdAt','root','format','%s.%s','basename','extname','server/files/moh','symlinkSync','ValidationError','removeSound','id2','getSounds','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','catch','show','params','options','find','body','create','sequelize','mode','files','directory','join','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','transaction','readdirSync','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format'];(function(_0x269db8,_0x1a5018){var _0x26818f=function(_0x4e6aa3){while(--_0x4e6aa3){_0x269db8['push'](_0x269db8['shift']());}};_0x26818f(++_0x1a5018);}(_0xd5cf,0x1cd));var _0xfd5c=function(_0x2698e2,_0xfe0b43){_0x2698e2=_0x2698e2-0x0;var _0x44dab3=_0xd5cf[_0x2698e2];return _0x44dab3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfd5c('0x0'));var zipdir=require(_0xfd5c('0x1'));var jsonpatch=require(_0xfd5c('0x2'));var rp=require(_0xfd5c('0x3'));var moment=require(_0xfd5c('0x4'));var BPromise=require(_0xfd5c('0x5'));var Mustache=require(_0xfd5c('0x6'));var util=require(_0xfd5c('0x7'));var path=require('path');var sox=require(_0xfd5c('0x8'));var csv=require('to-csv');var ejs=require(_0xfd5c('0x9'));var fs=require('fs');var _=require(_0xfd5c('0xa'));var squel=require(_0xfd5c('0xb'));var crypto=require('crypto');var jsforce=require(_0xfd5c('0xc'));var deskjs=require(_0xfd5c('0xd'));var toCsv=require(_0xfd5c('0xe'));var querystring=require(_0xfd5c('0xf'));var Papa=require('papaparse');var Redis=require(_0xfd5c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfd5c('0x11'));var hardwareService=require(_0xfd5c('0x12'));var logger=require(_0xfd5c('0x13'))(_0xfd5c('0x14'));var utils=require(_0xfd5c('0x15'));var config=require(_0xfd5c('0x16'));var db=require(_0xfd5c('0x17'))['db'];function respondWithStatusCode(_0x2482bd,_0x383562){_0x383562=_0x383562||0xcc;return function(_0x252990){if(_0x252990){return _0x2482bd[_0xfd5c('0x18')](_0x383562);}return _0x2482bd[_0xfd5c('0x19')](_0x383562)[_0xfd5c('0x1a')]();};}function respondWithResult(_0x5a1a5d,_0x3ebe2b){_0x3ebe2b=_0x3ebe2b||0xc8;return function(_0x269ec8){if(_0x269ec8){return _0x5a1a5d[_0xfd5c('0x19')](_0x3ebe2b)[_0xfd5c('0x1b')](_0x269ec8);}};}function respondWithFilteredResult(_0x4b6c58,_0x65432d){return function(_0x4c4bca){if(_0x4c4bca){var _0x48f1a7=_0x4c4bca[_0xfd5c('0x1c')],_0x1f4968=_0x65432d[_0xfd5c('0x1d')],_0x3ce8fb=_0x65432d[_0xfd5c('0x1d')]+_0x65432d[_0xfd5c('0x1e')],_0x12cba7;if(_0x3ce8fb>=_0x48f1a7){_0x3ce8fb=_0x48f1a7;_0x12cba7=0xc8;}else{_0x12cba7=0xce;}_0x4b6c58['status'](_0x12cba7);return _0x4b6c58[_0xfd5c('0x1f')](_0xfd5c('0x20'),_0x1f4968+'-'+_0x3ce8fb+'/'+_0x48f1a7)['json'](_0x4c4bca);}return null;};}function patchUpdates(_0x3e32ff){return function(_0x2cf669){try{jsonpatch[_0xfd5c('0x21')](_0x2cf669,_0x3e32ff,!![]);}catch(_0x47509c){return BPromise['reject'](_0x47509c);}return _0x2cf669[_0xfd5c('0x22')]();};}function saveUpdates(_0x176786,_0x2360d5){return function(_0x2cfcd4){if(_0x2cfcd4){return _0x2cfcd4[_0xfd5c('0x23')](_0x176786)[_0xfd5c('0x24')](function(_0x385b7f){return _0x385b7f;});}return null;};}function removeEntity(_0x1fe109,_0x20c210){return function(_0x7c29ee){if(_0x7c29ee){return _0x7c29ee[_0xfd5c('0x25')]()[_0xfd5c('0x24')](function(){var _0x132bfa=_0x7c29ee[_0xfd5c('0x26')]({'plain':!![]});var _0x14b489=_0xfd5c('0x27');return db[_0xfd5c('0x28')]['destroy']({'where':{'type':_0x14b489,'resourceId':_0x132bfa['id']}})[_0xfd5c('0x24')](function(){return _0x7c29ee;});})[_0xfd5c('0x24')](function(){_0x1fe109[_0xfd5c('0x19')](0xcc)[_0xfd5c('0x1a')]();});}};}function handleEntityNotFound(_0x1ac8ce,_0x466198){return function(_0x5050a2){if(!_0x5050a2){_0x1ac8ce[_0xfd5c('0x18')](0x194);}return _0x5050a2;};}function handleError(_0x1cb743,_0x17e9cf){_0x17e9cf=_0x17e9cf||0x1f4;return function(_0x4d7285){logger[_0xfd5c('0x29')](_0x4d7285[_0xfd5c('0x2a')]);if(_0x4d7285[_0xfd5c('0x2b')]){delete _0x4d7285[_0xfd5c('0x2b')];}_0x1cb743['status'](_0x17e9cf)[_0xfd5c('0x2c')](_0x4d7285);};}exports[_0xfd5c('0x2d')]=function(_0x180afa,_0x4835b6){var _0x143bdb={},_0x2e7a78={},_0x4b2b76={'count':0x0,'rows':[]};var _0x1274a4=db[_0xfd5c('0x2e')][_0xfd5c('0x2f')];_0x2e7a78['model']=_[_0xfd5c('0x30')](_0x1274a4);_0x2e7a78['query']=_[_0xfd5c('0x30')](_0x180afa[_0xfd5c('0x31')]);_0x2e7a78[_0xfd5c('0x32')]=_[_0xfd5c('0x33')](_0x2e7a78[_0xfd5c('0x34')],_0x2e7a78[_0xfd5c('0x31')]);_0x143bdb[_0xfd5c('0x35')]=_['intersection'](_0x2e7a78[_0xfd5c('0x34')],qs[_0xfd5c('0x36')](_0x180afa[_0xfd5c('0x31')][_0xfd5c('0x36')]));_0x143bdb[_0xfd5c('0x35')]=_0x143bdb[_0xfd5c('0x35')][_0xfd5c('0x37')]?_0x143bdb[_0xfd5c('0x35')]:_0x2e7a78[_0xfd5c('0x34')];if(!_0x180afa['query'][_0xfd5c('0x38')]('nolimit')){_0x143bdb[_0xfd5c('0x1e')]=qs['limit'](_0x180afa['query']['limit']);_0x143bdb[_0xfd5c('0x1d')]=qs[_0xfd5c('0x1d')](_0x180afa['query'][_0xfd5c('0x1d')]);}_0x143bdb[_0xfd5c('0x39')]=qs[_0xfd5c('0x3a')](_0x180afa[_0xfd5c('0x31')]['sort']);_0x143bdb[_0xfd5c('0x3b')]=qs['filters'](_[_0xfd5c('0x3c')](_0x180afa[_0xfd5c('0x31')],_0x2e7a78[_0xfd5c('0x32')]));if(_0x180afa[_0xfd5c('0x31')][_0xfd5c('0x3d')]){_0x143bdb[_0xfd5c('0x3b')]=_[_0xfd5c('0x3e')](_0x143bdb[_0xfd5c('0x3b')],{'$or':_[_0xfd5c('0x3f')](_0x1274a4,function(_0x303d80){if(_0x303d80[_0xfd5c('0x40')]['key']!==_0xfd5c('0x41')){var _0x14b61c={};_0x14b61c[_0x303d80[_0xfd5c('0x42')]]={'$like':'%'+_0x180afa[_0xfd5c('0x31')][_0xfd5c('0x3d')]+'%'};return _0x14b61c;}})});}_0x143bdb=_['merge']({},_0x143bdb,_0x180afa['options']);var _0x562e24={'where':_0x143bdb[_0xfd5c('0x3b')]};return db[_0xfd5c('0x2e')][_0xfd5c('0x1c')](_0x562e24)[_0xfd5c('0x24')](function(_0x574027){_0x4b2b76[_0xfd5c('0x1c')]=_0x574027;if(_0x180afa[_0xfd5c('0x31')][_0xfd5c('0x43')]){_0x143bdb[_0xfd5c('0x44')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xfd5c('0x45')](_0x143bdb);})[_0xfd5c('0x24')](function(_0x59e38a){_0x4b2b76['rows']=_0x59e38a;return _0x4b2b76;})[_0xfd5c('0x24')](respondWithFilteredResult(_0x4835b6,_0x143bdb))[_0xfd5c('0x46')](handleError(_0x4835b6,null));};exports[_0xfd5c('0x47')]=function(_0x3f3671,_0x5d0a99){var _0x3ee36c={'raw':![],'where':{'id':_0x3f3671[_0xfd5c('0x48')]['id']}},_0x2f11ea={};_0x2f11ea[_0xfd5c('0x34')]=_[_0xfd5c('0x30')](db[_0xfd5c('0x2e')][_0xfd5c('0x2f')]);_0x2f11ea['query']=_[_0xfd5c('0x30')](_0x3f3671['query']);_0x2f11ea['filters']=_[_0xfd5c('0x33')](_0x2f11ea[_0xfd5c('0x34')],_0x2f11ea[_0xfd5c('0x31')]);_0x3ee36c[_0xfd5c('0x35')]=_[_0xfd5c('0x33')](_0x2f11ea[_0xfd5c('0x34')],qs[_0xfd5c('0x36')](_0x3f3671[_0xfd5c('0x31')][_0xfd5c('0x36')]));_0x3ee36c['attributes']=_0x3ee36c[_0xfd5c('0x35')][_0xfd5c('0x37')]?_0x3ee36c[_0xfd5c('0x35')]:_0x2f11ea['model'];if(_0x3f3671[_0xfd5c('0x31')][_0xfd5c('0x43')]){_0x3ee36c[_0xfd5c('0x44')]=[{'all':!![]}];}_0x3ee36c=_['merge']({},_0x3ee36c,_0x3f3671[_0xfd5c('0x49')]);return db[_0xfd5c('0x2e')][_0xfd5c('0x4a')](_0x3ee36c)[_0xfd5c('0x24')](handleEntityNotFound(_0x5d0a99,null))[_0xfd5c('0x24')](respondWithResult(_0x5d0a99,null))[_0xfd5c('0x46')](handleError(_0x5d0a99,null));};exports[_0xfd5c('0x23')]=function(_0x3a5804,_0xa1deab){if(_0x3a5804[_0xfd5c('0x4b')]['id']){delete _0x3a5804[_0xfd5c('0x4b')]['id'];}return db[_0xfd5c('0x2e')]['find']({'where':{'id':_0x3a5804[_0xfd5c('0x48')]['id']}})[_0xfd5c('0x24')](handleEntityNotFound(_0xa1deab,null))[_0xfd5c('0x24')](saveUpdates(_0x3a5804[_0xfd5c('0x4b')],null))[_0xfd5c('0x24')](respondWithResult(_0xa1deab,null))[_0xfd5c('0x46')](handleError(_0xa1deab,null));};exports[_0xfd5c('0x4c')]=function(_0x5e05be,_0x301e0d,_0x4adbf1){return db[_0xfd5c('0x4d')]['transaction'](function(_0x37a56e){if(_0x5e05be[_0xfd5c('0x4b')][_0xfd5c('0x4e')]===_0xfd5c('0x4f')){_0x5e05be['body'][_0xfd5c('0x50')]=path[_0xfd5c('0x51')](config['root'],'server/files/moh',_0x5e05be['body'][_0xfd5c('0x2b')]);}return db[_0xfd5c('0x2e')]['create'](_0x5e05be[_0xfd5c('0x4b')],{'transaction':_0x37a56e})['then'](function(_0x284e0c){if(_0x5e05be[_0xfd5c('0x4b')][_0xfd5c('0x4e')]==='files'){fs[_0xfd5c('0x52')](_0x284e0c[_0xfd5c('0x50')],parseInt(_0xfd5c('0x53'),0x8));}var _0x13428e=_0x5e05be['user']['get']({'plain':!![]});if(!_0x13428e)throw new Error(_0xfd5c('0x54'));if(_0x13428e['role']===_0xfd5c('0x55')){var _0x1aaf1f=_0x284e0c[_0xfd5c('0x26')]({'plain':!![]});return db[_0xfd5c('0x56')][_0xfd5c('0x4a')]({'where':{'name':_0xfd5c('0x27'),'userProfileId':_0x13428e['userProfileId']},'raw':!![]})[_0xfd5c('0x24')](function(_0x296f8b){if(_0x296f8b&&_0x296f8b[_0xfd5c('0x57')]===0x0){return db[_0xfd5c('0x28')]['create']({'name':_0x1aaf1f[_0xfd5c('0x2b')],'resourceId':_0x1aaf1f['id'],'type':_0x296f8b[_0xfd5c('0x2b')],'sectionId':_0x296f8b['id']},{})[_0xfd5c('0x24')](function(){return _0x284e0c;});}else{return _0x284e0c;}})[_0xfd5c('0x46')](function(_0x27c445){logger[_0xfd5c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27c445);});}return _0x284e0c;});})[_0xfd5c('0x24')](respondWithResult(_0x301e0d,0xc9))[_0xfd5c('0x46')](handleError(_0x301e0d,null));};exports[_0xfd5c('0x25')]=function(_0x5bcc56,_0x559975,_0x45b1af){var _0x2bf323;return db[_0xfd5c('0x2e')]['find']({'where':{'id':_0x5bcc56[_0xfd5c('0x48')]['id']}})['then'](function(_0x51d0b6){if(_0x51d0b6){return db[_0xfd5c('0x4d')][_0xfd5c('0x58')](function(_0x6dcd1a){return _0x51d0b6[_0xfd5c('0x25')]({'transaction':_0x6dcd1a,'raw':!![]})[_0xfd5c('0x24')](function(_0x3c0dea){if(_0x3c0dea[_0xfd5c('0x50')]){fs[_0xfd5c('0x59')](_0x3c0dea[_0xfd5c('0x50')])['forEach'](function(_0x586b9b){fs[_0xfd5c('0x5a')](path[_0xfd5c('0x51')](_0x3c0dea[_0xfd5c('0x50')],_0x586b9b));});fs[_0xfd5c('0x5b')](_0x3c0dea[_0xfd5c('0x50')]);}return _0x3c0dea;});})['catch'](function(_0x32cb4d){throw new db[(_0xfd5c('0x5c'))]['ValidationError'](_0x32cb4d[_0xfd5c('0x5d')]);});}})['then'](handleEntityNotFound(_0x559975,null))['then'](removeEntity(_0x559975,null))[_0xfd5c('0x46')](handleError(_0x559975,null));};exports[_0xfd5c('0x5e')]=function(_0x269af9,_0x4bf1e7,_0x3fe28a){return db[_0xfd5c('0x4d')]['transaction'](function(_0x1ad56c){var _0x54f89a;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x269af9['params']['id']}})['then'](function(_0x253346){if(_0x253346){_0x54f89a=_0x253346;return _0x253346[_0xfd5c('0x5e')](_0x269af9[_0xfd5c('0x4b')]['id'],{'transaction':_0x1ad56c});}})[_0xfd5c('0x24')](function(_0x5614d2){if(_0x5614d2){return db[_0xfd5c('0x5f')][_0xfd5c('0x60')]({'where':{'id':_0x269af9[_0xfd5c('0x4b')]['id']},'attributes':['id','name',_0xfd5c('0x61'),_0xfd5c('0x62'),_0xfd5c('0x63')],'raw':!![]});}})[_0xfd5c('0x24')](function(_0x579e49){if(_0x579e49){var _0x1ea00e=path[_0xfd5c('0x51')](config[_0xfd5c('0x64')],'server/files/sounds/converted',util[_0xfd5c('0x65')](_0xfd5c('0x66'),path[_0xfd5c('0x67')](_0x579e49[_0xfd5c('0x61')],path[_0xfd5c('0x68')](_0x579e49['save_name'])),_0x579e49[_0xfd5c('0x62')]));var _0xa3f49b=path['join'](config[_0xfd5c('0x64')],_0xfd5c('0x69'),_0x54f89a[_0xfd5c('0x2b')],util['format']('%s.%s',_0x579e49[_0xfd5c('0x2b')],_0x579e49['converted_format']));fs[_0xfd5c('0x6a')](_0x1ea00e,_0xa3f49b);return _0x579e49;}})['catch'](function(_0x3b1acf){throw new db['Sequelize'][(_0xfd5c('0x6b'))](_0x3b1acf[_0xfd5c('0x5d')]);});})[_0xfd5c('0x24')](handleEntityNotFound(_0x4bf1e7,null))['then'](respondWithResult(_0x4bf1e7,0xc9))[_0xfd5c('0x46')](handleError(_0x4bf1e7,null));};exports['removeSound']=function(_0x5c6169,_0x1dd469,_0x21b84a){return db['sequelize'][_0xfd5c('0x58')](function(_0x1cad55){var _0x47c4ea;return db[_0xfd5c('0x2e')][_0xfd5c('0x60')]({'where':{'id':_0x5c6169['params']['id']}})[_0xfd5c('0x24')](handleEntityNotFound(_0x1dd469,null))[_0xfd5c('0x24')](function(_0x51abd2){if(_0x51abd2){_0x47c4ea=_0x51abd2;return _0x51abd2[_0xfd5c('0x6c')](_0x5c6169[_0xfd5c('0x48')][_0xfd5c('0x6d')]);}})['then'](function(_0x40900d){if(_0x40900d){return db[_0xfd5c('0x5f')]['findOne']({'where':{'id':_0x5c6169[_0xfd5c('0x48')][_0xfd5c('0x6d')]},'attributes':['id',_0xfd5c('0x2b'),'save_name',_0xfd5c('0x62'),_0xfd5c('0x63')],'raw':!![]});}})[_0xfd5c('0x24')](function(_0x4a66e5){if(_0x4a66e5){fs['unlinkSync'](path[_0xfd5c('0x51')](_0x47c4ea[_0xfd5c('0x50')],util['format'](_0xfd5c('0x66'),_0x4a66e5[_0xfd5c('0x2b')],_0x4a66e5['converted_format'])));return _0x4a66e5;}})[_0xfd5c('0x46')](function(_0x1364b6){throw new db[(_0xfd5c('0x5c'))][(_0xfd5c('0x6b'))](_0x1364b6[_0xfd5c('0x5d')]);});})['then'](handleEntityNotFound(_0x1dd469,null))[_0xfd5c('0x24')](respondWithStatusCode(_0x1dd469,0xcc))[_0xfd5c('0x46')](handleError(_0x1dd469,null));};exports[_0xfd5c('0x6e')]=function(_0x5282fc,_0x22db67,_0x4f9895){var _0x564d55={};var _0x3ab3a4={};var _0xc937ca;var _0x5f2271;return db[_0xfd5c('0x2e')][_0xfd5c('0x60')]({'where':{'id':_0x5282fc[_0xfd5c('0x48')]['id']}})['then'](handleEntityNotFound(_0x22db67,null))['then'](function(_0x3c187a){if(_0x3c187a){_0xc937ca=_0x3c187a;_0x3ab3a4[_0xfd5c('0x34')]=_[_0xfd5c('0x30')](db[_0xfd5c('0x5f')]['rawAttributes']);_0x3ab3a4[_0xfd5c('0x31')]=_[_0xfd5c('0x30')](_0x5282fc[_0xfd5c('0x31')]);_0x3ab3a4[_0xfd5c('0x32')]=_[_0xfd5c('0x33')](_0x3ab3a4[_0xfd5c('0x34')],_0x3ab3a4['query']);_0x564d55[_0xfd5c('0x35')]=_[_0xfd5c('0x33')](_0x3ab3a4[_0xfd5c('0x34')],qs[_0xfd5c('0x36')](_0x5282fc['query'][_0xfd5c('0x36')]));_0x564d55[_0xfd5c('0x35')]=_0x564d55[_0xfd5c('0x35')][_0xfd5c('0x37')]?_0x564d55[_0xfd5c('0x35')]:_0x3ab3a4[_0xfd5c('0x34')];_0x564d55[_0xfd5c('0x39')]=qs['sort'](_0x5282fc['query']['sort']);_0x564d55['where']=qs[_0xfd5c('0x32')](_[_0xfd5c('0x3c')](_0x5282fc[_0xfd5c('0x31')],_0x3ab3a4[_0xfd5c('0x32')]));if(_0x5282fc[_0xfd5c('0x31')][_0xfd5c('0x3d')]){_0x564d55[_0xfd5c('0x3b')]=_['merge'](_0x564d55[_0xfd5c('0x3b')],{'$or':_[_0xfd5c('0x3f')](_0x564d55[_0xfd5c('0x35')],function(_0x121010){var _0xba3313={};_0xba3313[_0x121010]={'$like':'%'+_0x5282fc[_0xfd5c('0x31')][_0xfd5c('0x3d')]+'%'};return _0xba3313;})});}_0x564d55=_[_0xfd5c('0x3e')]({},_0x564d55,_0x5282fc[_0xfd5c('0x49')]);return _0xc937ca[_0xfd5c('0x6e')](_0x564d55);}})[_0xfd5c('0x24')](function(_0x3e237e){if(_0x3e237e){_0x5f2271=_0x3e237e[_0xfd5c('0x37')];if(!_0x5282fc[_0xfd5c('0x31')][_0xfd5c('0x38')](_0xfd5c('0x6f'))){_0x564d55['limit']=qs[_0xfd5c('0x1e')](_0x5282fc[_0xfd5c('0x31')][_0xfd5c('0x1e')]);_0x564d55[_0xfd5c('0x1d')]=qs[_0xfd5c('0x1d')](_0x5282fc[_0xfd5c('0x31')][_0xfd5c('0x1d')]);}return _0xc937ca[_0xfd5c('0x6e')](_0x564d55);}})[_0xfd5c('0x24')](function(_0x1f7fb8){if(_0x1f7fb8){return _0x1f7fb8?{'count':_0x5f2271,'rows':_0x1f7fb8}:null;}})['then'](respondWithResult(_0x22db67,null))[_0xfd5c('0x46')](handleError(_0x22db67,null));}; \ No newline at end of file +var _0x8814=['desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','then','end','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','key','VIRTUAL','options','includeAll','include','VoiceMusicOnHold','findAll','catch','show','params','find','body','create','sequelize','transaction','mode','join','root','server/files/moh','files','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','format','basename','extname','symlinkSync','removeSound','id2','%s.%s','getSounds','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','jsforce'];(function(_0x1e750d,_0x56174f){var _0x1bb3e1=function(_0x37770e){while(--_0x37770e){_0x1e750d['push'](_0x1e750d['shift']());}};_0x1bb3e1(++_0x56174f);}(_0x8814,0x19d));var _0x4881=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x8814[_0x3b5ad9];return _0x611ae9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4881('0x0'));var rimraf=require(_0x4881('0x1'));var zipdir=require(_0x4881('0x2'));var jsonpatch=require(_0x4881('0x3'));var rp=require(_0x4881('0x4'));var moment=require('moment');var BPromise=require(_0x4881('0x5'));var Mustache=require('mustache');var util=require(_0x4881('0x6'));var path=require(_0x4881('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4881('0x8'));var fs=require('fs');var _=require(_0x4881('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4881('0xa'));var deskjs=require(_0x4881('0xb'));var toCsv=require(_0x4881('0xc'));var querystring=require(_0x4881('0xd'));var Papa=require('papaparse');var Redis=require(_0x4881('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4881('0xf'));var hardwareService=require(_0x4881('0x10'));var logger=require('../../config/logger')(_0x4881('0x11'));var utils=require(_0x4881('0x12'));var config=require(_0x4881('0x13'));var db=require(_0x4881('0x14'))['db'];function respondWithStatusCode(_0x3a0f9a,_0x17886e){_0x17886e=_0x17886e||0xcc;return function(_0x17589c){if(_0x17589c){return _0x3a0f9a[_0x4881('0x15')](_0x17886e);}return _0x3a0f9a[_0x4881('0x16')](_0x17886e)['end']();};}function respondWithResult(_0x3ff465,_0x25cb05){_0x25cb05=_0x25cb05||0xc8;return function(_0x4f18ac){if(_0x4f18ac){return _0x3ff465[_0x4881('0x16')](_0x25cb05)['json'](_0x4f18ac);}};}function respondWithFilteredResult(_0x98be21,_0x2fc314){return function(_0x2df479){if(_0x2df479){var _0x463013=_0x2df479[_0x4881('0x17')],_0x1914d7=_0x2fc314[_0x4881('0x18')],_0x15659e=_0x2fc314[_0x4881('0x18')]+_0x2fc314['limit'],_0x966d90;if(_0x15659e>=_0x463013){_0x15659e=_0x463013;_0x966d90=0xc8;}else{_0x966d90=0xce;}_0x98be21['status'](_0x966d90);return _0x98be21['set'](_0x4881('0x19'),_0x1914d7+'-'+_0x15659e+'/'+_0x463013)[_0x4881('0x1a')](_0x2df479);}return null;};}function patchUpdates(_0x576db4){return function(_0x27b9d1){try{jsonpatch[_0x4881('0x1b')](_0x27b9d1,_0x576db4,!![]);}catch(_0x1db618){return BPromise[_0x4881('0x1c')](_0x1db618);}return _0x27b9d1[_0x4881('0x1d')]();};}function saveUpdates(_0x51517d,_0x25bfca){return function(_0x514b41){if(_0x514b41){return _0x514b41[_0x4881('0x1e')](_0x51517d)['then'](function(_0x3ad1f4){return _0x3ad1f4;});}return null;};}function removeEntity(_0x1c52d5,_0x4e7ab1){return function(_0x3babc5){if(_0x3babc5){return _0x3babc5[_0x4881('0x1f')]()['then'](function(){var _0x58d5b8=_0x3babc5[_0x4881('0x20')]({'plain':!![]});var _0x4091d5='MusicOnHolds';return db[_0x4881('0x21')]['destroy']({'where':{'type':_0x4091d5,'resourceId':_0x58d5b8['id']}})[_0x4881('0x22')](function(){return _0x3babc5;});})[_0x4881('0x22')](function(){_0x1c52d5['status'](0xcc)[_0x4881('0x23')]();});}};}function handleEntityNotFound(_0x137395,_0x5b768f){return function(_0xde45ed){if(!_0xde45ed){_0x137395[_0x4881('0x15')](0x194);}return _0xde45ed;};}function handleError(_0x1fb4fb,_0x2af7ed){_0x2af7ed=_0x2af7ed||0x1f4;return function(_0x23767c){logger[_0x4881('0x24')](_0x23767c[_0x4881('0x25')]);if(_0x23767c[_0x4881('0x26')]){delete _0x23767c[_0x4881('0x26')];}_0x1fb4fb[_0x4881('0x16')](_0x2af7ed)[_0x4881('0x27')](_0x23767c);};}exports['index']=function(_0x30b2aa,_0x69bd57){var _0x515b60={},_0x127c46={},_0x4775fc={'count':0x0,'rows':[]};var _0x16f9a9=db['VoiceMusicOnHold'][_0x4881('0x28')];_0x127c46[_0x4881('0x29')]=_[_0x4881('0x2a')](_0x16f9a9);_0x127c46[_0x4881('0x2b')]=_[_0x4881('0x2a')](_0x30b2aa[_0x4881('0x2b')]);_0x127c46[_0x4881('0x2c')]=_[_0x4881('0x2d')](_0x127c46[_0x4881('0x29')],_0x127c46[_0x4881('0x2b')]);_0x515b60[_0x4881('0x2e')]=_[_0x4881('0x2d')](_0x127c46[_0x4881('0x29')],qs[_0x4881('0x2f')](_0x30b2aa[_0x4881('0x2b')][_0x4881('0x2f')]));_0x515b60[_0x4881('0x2e')]=_0x515b60[_0x4881('0x2e')][_0x4881('0x30')]?_0x515b60['attributes']:_0x127c46[_0x4881('0x29')];if(!_0x30b2aa[_0x4881('0x2b')]['hasOwnProperty'](_0x4881('0x31'))){_0x515b60['limit']=qs[_0x4881('0x32')](_0x30b2aa[_0x4881('0x2b')][_0x4881('0x32')]);_0x515b60['offset']=qs[_0x4881('0x18')](_0x30b2aa['query'][_0x4881('0x18')]);}_0x515b60[_0x4881('0x33')]=qs[_0x4881('0x34')](_0x30b2aa[_0x4881('0x2b')][_0x4881('0x34')]);_0x515b60[_0x4881('0x35')]=qs[_0x4881('0x2c')](_[_0x4881('0x36')](_0x30b2aa[_0x4881('0x2b')],_0x127c46[_0x4881('0x2c')]));if(_0x30b2aa[_0x4881('0x2b')][_0x4881('0x37')]){_0x515b60[_0x4881('0x35')]=_[_0x4881('0x38')](_0x515b60[_0x4881('0x35')],{'$or':_['map'](_0x16f9a9,function(_0x1d4f03){if(_0x1d4f03['type'][_0x4881('0x39')]!==_0x4881('0x3a')){var _0x2550a7={};_0x2550a7[_0x1d4f03['field']]={'$like':'%'+_0x30b2aa['query'][_0x4881('0x37')]+'%'};return _0x2550a7;}})});}_0x515b60=_[_0x4881('0x38')]({},_0x515b60,_0x30b2aa[_0x4881('0x3b')]);var _0x3648f6={'where':_0x515b60[_0x4881('0x35')]};return db['VoiceMusicOnHold'][_0x4881('0x17')](_0x3648f6)[_0x4881('0x22')](function(_0x140eaf){_0x4775fc['count']=_0x140eaf;if(_0x30b2aa['query'][_0x4881('0x3c')]){_0x515b60[_0x4881('0x3d')]=[{'all':!![]}];}return db[_0x4881('0x3e')][_0x4881('0x3f')](_0x515b60);})[_0x4881('0x22')](function(_0x2d0061){_0x4775fc['rows']=_0x2d0061;return _0x4775fc;})[_0x4881('0x22')](respondWithFilteredResult(_0x69bd57,_0x515b60))[_0x4881('0x40')](handleError(_0x69bd57,null));};exports[_0x4881('0x41')]=function(_0x50959c,_0x348353){var _0x1bdeb6={'raw':![],'where':{'id':_0x50959c[_0x4881('0x42')]['id']}},_0x2ee068={};_0x2ee068[_0x4881('0x29')]=_[_0x4881('0x2a')](db[_0x4881('0x3e')][_0x4881('0x28')]);_0x2ee068['query']=_[_0x4881('0x2a')](_0x50959c[_0x4881('0x2b')]);_0x2ee068[_0x4881('0x2c')]=_[_0x4881('0x2d')](_0x2ee068[_0x4881('0x29')],_0x2ee068[_0x4881('0x2b')]);_0x1bdeb6[_0x4881('0x2e')]=_['intersection'](_0x2ee068[_0x4881('0x29')],qs[_0x4881('0x2f')](_0x50959c[_0x4881('0x2b')][_0x4881('0x2f')]));_0x1bdeb6[_0x4881('0x2e')]=_0x1bdeb6[_0x4881('0x2e')][_0x4881('0x30')]?_0x1bdeb6[_0x4881('0x2e')]:_0x2ee068[_0x4881('0x29')];if(_0x50959c[_0x4881('0x2b')][_0x4881('0x3c')]){_0x1bdeb6[_0x4881('0x3d')]=[{'all':!![]}];}_0x1bdeb6=_['merge']({},_0x1bdeb6,_0x50959c['options']);return db[_0x4881('0x3e')][_0x4881('0x43')](_0x1bdeb6)[_0x4881('0x22')](handleEntityNotFound(_0x348353,null))[_0x4881('0x22')](respondWithResult(_0x348353,null))[_0x4881('0x40')](handleError(_0x348353,null));};exports[_0x4881('0x1e')]=function(_0x72e14a,_0x33734a){if(_0x72e14a[_0x4881('0x44')]['id']){delete _0x72e14a[_0x4881('0x44')]['id'];}return db['VoiceMusicOnHold'][_0x4881('0x43')]({'where':{'id':_0x72e14a[_0x4881('0x42')]['id']}})[_0x4881('0x22')](handleEntityNotFound(_0x33734a,null))['then'](saveUpdates(_0x72e14a[_0x4881('0x44')],null))[_0x4881('0x22')](respondWithResult(_0x33734a,null))[_0x4881('0x40')](handleError(_0x33734a,null));};exports[_0x4881('0x45')]=function(_0x19fe78,_0x46e677,_0x41c824){return db[_0x4881('0x46')][_0x4881('0x47')](function(_0x5033d8){if(_0x19fe78['body'][_0x4881('0x48')]==='files'){_0x19fe78[_0x4881('0x44')]['directory']=path[_0x4881('0x49')](config[_0x4881('0x4a')],_0x4881('0x4b'),_0x19fe78['body'][_0x4881('0x26')]);}return db[_0x4881('0x3e')][_0x4881('0x45')](_0x19fe78[_0x4881('0x44')],{'transaction':_0x5033d8})[_0x4881('0x22')](function(_0x9d4308){if(_0x19fe78[_0x4881('0x44')][_0x4881('0x48')]===_0x4881('0x4c')){fs[_0x4881('0x4d')](_0x9d4308[_0x4881('0x4e')],parseInt('0777',0x8));}var _0xb0259c=_0x19fe78[_0x4881('0x4f')][_0x4881('0x20')]({'plain':!![]});if(!_0xb0259c)throw new Error(_0x4881('0x50'));if(_0xb0259c[_0x4881('0x51')]===_0x4881('0x4f')){var _0xd4cd56=_0x9d4308['get']({'plain':!![]});return db['UserProfileSection'][_0x4881('0x43')]({'where':{'name':_0x4881('0x52'),'userProfileId':_0xb0259c['userProfileId']},'raw':!![]})['then'](function(_0x4bbab6){if(_0x4bbab6&&_0x4bbab6[_0x4881('0x53')]===0x0){return db['UserProfileResource'][_0x4881('0x45')]({'name':_0xd4cd56['name'],'resourceId':_0xd4cd56['id'],'type':_0x4bbab6[_0x4881('0x26')],'sectionId':_0x4bbab6['id']},{})[_0x4881('0x22')](function(){return _0x9d4308;});}else{return _0x9d4308;}})[_0x4881('0x40')](function(_0x28acd0){logger[_0x4881('0x24')](_0x4881('0x54'),_0x28acd0);});}return _0x9d4308;});})[_0x4881('0x22')](respondWithResult(_0x46e677,0xc9))[_0x4881('0x40')](handleError(_0x46e677,null));};exports['destroy']=function(_0x330d59,_0x3bc339,_0x31d77b){var _0x4d1be6;return db[_0x4881('0x3e')][_0x4881('0x43')]({'where':{'id':_0x330d59[_0x4881('0x42')]['id']}})[_0x4881('0x22')](function(_0x1758ad){if(_0x1758ad){return db['sequelize']['transaction'](function(_0x39b8a1){return _0x1758ad['destroy']({'transaction':_0x39b8a1,'raw':!![]})[_0x4881('0x22')](function(_0x3dfcc5){if(_0x3dfcc5[_0x4881('0x4e')]){fs[_0x4881('0x55')](_0x3dfcc5[_0x4881('0x4e')])['forEach'](function(_0x28bf46){fs[_0x4881('0x56')](path[_0x4881('0x49')](_0x3dfcc5[_0x4881('0x4e')],_0x28bf46));});fs[_0x4881('0x57')](_0x3dfcc5[_0x4881('0x4e')]);}return _0x3dfcc5;});})['catch'](function(_0x1aee93){throw new db[(_0x4881('0x58'))][(_0x4881('0x59'))](_0x1aee93[_0x4881('0x5a')]);});}})[_0x4881('0x22')](handleEntityNotFound(_0x3bc339,null))[_0x4881('0x22')](removeEntity(_0x3bc339,null))[_0x4881('0x40')](handleError(_0x3bc339,null));};exports[_0x4881('0x5b')]=function(_0x582766,_0x2dbcde,_0x245f51){return db['sequelize'][_0x4881('0x47')](function(_0x25be71){var _0x36aba6;return db[_0x4881('0x3e')][_0x4881('0x43')]({'where':{'id':_0x582766['params']['id']}})[_0x4881('0x22')](function(_0x419867){if(_0x419867){_0x36aba6=_0x419867;return _0x419867[_0x4881('0x5b')](_0x582766[_0x4881('0x44')]['id'],{'transaction':_0x25be71});}})[_0x4881('0x22')](function(_0x2a5316){if(_0x2a5316){return db[_0x4881('0x5c')][_0x4881('0x5d')]({'where':{'id':_0x582766['body']['id']},'attributes':['id',_0x4881('0x26'),_0x4881('0x5e'),_0x4881('0x5f'),_0x4881('0x60')],'raw':!![]});}})['then'](function(_0x5bd6a4){if(_0x5bd6a4){var _0x480039=path[_0x4881('0x49')](config[_0x4881('0x4a')],'server/files/sounds/converted',util[_0x4881('0x61')]('%s.%s',path[_0x4881('0x62')](_0x5bd6a4[_0x4881('0x5e')],path[_0x4881('0x63')](_0x5bd6a4[_0x4881('0x5e')])),_0x5bd6a4[_0x4881('0x5f')]));var _0x1dff99=path['join'](config[_0x4881('0x4a')],_0x4881('0x4b'),_0x36aba6[_0x4881('0x26')],util['format']('%s.%s',_0x5bd6a4['name'],_0x5bd6a4['converted_format']));fs[_0x4881('0x64')](_0x480039,_0x1dff99);return _0x5bd6a4;}})['catch'](function(_0x546d7b){throw new db['Sequelize'][(_0x4881('0x59'))](_0x546d7b['message']);});})[_0x4881('0x22')](handleEntityNotFound(_0x2dbcde,null))[_0x4881('0x22')](respondWithResult(_0x2dbcde,0xc9))[_0x4881('0x40')](handleError(_0x2dbcde,null));};exports[_0x4881('0x65')]=function(_0x1bd353,_0x34f4d9,_0x4c32e9){return db[_0x4881('0x46')]['transaction'](function(_0x1ca1a1){var _0x1af0f3;return db[_0x4881('0x3e')]['findOne']({'where':{'id':_0x1bd353['params']['id']}})[_0x4881('0x22')](handleEntityNotFound(_0x34f4d9,null))[_0x4881('0x22')](function(_0x1bf7e2){if(_0x1bf7e2){_0x1af0f3=_0x1bf7e2;return _0x1bf7e2[_0x4881('0x65')](_0x1bd353[_0x4881('0x42')][_0x4881('0x66')]);}})[_0x4881('0x22')](function(_0xa53923){if(_0xa53923){return db[_0x4881('0x5c')][_0x4881('0x5d')]({'where':{'id':_0x1bd353[_0x4881('0x42')]['id2']},'attributes':['id',_0x4881('0x26'),_0x4881('0x5e'),'converted_format',_0x4881('0x60')],'raw':!![]});}})[_0x4881('0x22')](function(_0x542770){if(_0x542770){fs[_0x4881('0x56')](path[_0x4881('0x49')](_0x1af0f3['directory'],util[_0x4881('0x61')](_0x4881('0x67'),_0x542770[_0x4881('0x26')],_0x542770[_0x4881('0x5f')])));return _0x542770;}})['catch'](function(_0x513ddd){throw new db[(_0x4881('0x58'))][(_0x4881('0x59'))](_0x513ddd['message']);});})[_0x4881('0x22')](handleEntityNotFound(_0x34f4d9,null))[_0x4881('0x22')](respondWithStatusCode(_0x34f4d9,0xcc))[_0x4881('0x40')](handleError(_0x34f4d9,null));};exports['getSounds']=function(_0x3c9e4d,_0x252030,_0x20baf2){var _0x16a0f1={};var _0x5ba6bd={};var _0x407e2f;var _0x166a92;return db[_0x4881('0x3e')][_0x4881('0x5d')]({'where':{'id':_0x3c9e4d['params']['id']}})['then'](handleEntityNotFound(_0x252030,null))[_0x4881('0x22')](function(_0x27fced){if(_0x27fced){_0x407e2f=_0x27fced;_0x5ba6bd[_0x4881('0x29')]=_[_0x4881('0x2a')](db[_0x4881('0x5c')][_0x4881('0x28')]);_0x5ba6bd[_0x4881('0x2b')]=_[_0x4881('0x2a')](_0x3c9e4d[_0x4881('0x2b')]);_0x5ba6bd['filters']=_[_0x4881('0x2d')](_0x5ba6bd[_0x4881('0x29')],_0x5ba6bd[_0x4881('0x2b')]);_0x16a0f1[_0x4881('0x2e')]=_[_0x4881('0x2d')](_0x5ba6bd[_0x4881('0x29')],qs[_0x4881('0x2f')](_0x3c9e4d['query']['fields']));_0x16a0f1[_0x4881('0x2e')]=_0x16a0f1[_0x4881('0x2e')][_0x4881('0x30')]?_0x16a0f1['attributes']:_0x5ba6bd[_0x4881('0x29')];_0x16a0f1['order']=qs['sort'](_0x3c9e4d[_0x4881('0x2b')][_0x4881('0x34')]);_0x16a0f1[_0x4881('0x35')]=qs[_0x4881('0x2c')](_[_0x4881('0x36')](_0x3c9e4d[_0x4881('0x2b')],_0x5ba6bd['filters']));if(_0x3c9e4d[_0x4881('0x2b')][_0x4881('0x37')]){_0x16a0f1['where']=_[_0x4881('0x38')](_0x16a0f1[_0x4881('0x35')],{'$or':_['map'](_0x16a0f1[_0x4881('0x2e')],function(_0x157545){var _0x4976c8={};_0x4976c8[_0x157545]={'$like':'%'+_0x3c9e4d[_0x4881('0x2b')][_0x4881('0x37')]+'%'};return _0x4976c8;})});}_0x16a0f1=_[_0x4881('0x38')]({},_0x16a0f1,_0x3c9e4d[_0x4881('0x3b')]);return _0x407e2f[_0x4881('0x68')](_0x16a0f1);}})[_0x4881('0x22')](function(_0x4ac82f){if(_0x4ac82f){_0x166a92=_0x4ac82f[_0x4881('0x30')];if(!_0x3c9e4d[_0x4881('0x2b')][_0x4881('0x69')](_0x4881('0x31'))){_0x16a0f1[_0x4881('0x32')]=qs[_0x4881('0x32')](_0x3c9e4d[_0x4881('0x2b')][_0x4881('0x32')]);_0x16a0f1[_0x4881('0x18')]=qs[_0x4881('0x18')](_0x3c9e4d[_0x4881('0x2b')][_0x4881('0x18')]);}return _0x407e2f[_0x4881('0x68')](_0x16a0f1);}})['then'](function(_0x2ec76c){if(_0x2ec76c){return _0x2ec76c?{'count':_0x166a92,'rows':_0x2ec76c}:null;}})[_0x4881('0x22')](respondWithResult(_0x252030,null))[_0x4881('0x40')](handleError(_0x252030,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 73881c1..6e87e92 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 _0x2b48=['VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0x2b48,0x15e));var _0x82b4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x2b48[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x82b4('0x0'));var logger=require(_0x82b4('0x1'))(_0x82b4('0x2'));var moment=require(_0x82b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x82b4('0x4'));var fs=require('fs');var path=require(_0x82b4('0x5'));var rimraf=require(_0x82b4('0x6'));var config=require(_0x82b4('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x82b4('0x8')]=function(_0x19e5ef,_0x585377){return _0x19e5ef[_0x82b4('0x9')](_0x82b4('0xa'),attributes,{'tableName':_0x82b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8603=['voice_musiconhold','../../config/logger','bluebird','path','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold'];(function(_0x19b3f8,_0x150751){var _0x22c3a1=function(_0x16bf0a){while(--_0x16bf0a){_0x19b3f8['push'](_0x19b3f8['shift']());}};_0x22c3a1(++_0x150751);}(_0x8603,0xe1));var _0x3860=function(_0x3bd099,_0x2c30ad){_0x3bd099=_0x3bd099-0x0;var _0x38e655=_0x8603[_0x3bd099];return _0x38e655;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3860('0x0'))('api');var moment=require('moment');var BPromise=require(_0x3860('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3860('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3860('0x3'));module[_0x3860('0x4')]=function(_0x17a1bc,_0x412a49){return _0x17a1bc['define'](_0x3860('0x5'),attributes,{'tableName':_0x3860('0x6'),'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 575c4d8..646e17f 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 _0xa5cb=['message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','code','error','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0x3539c0,_0x228e11){var _0x344ba8=function(_0xfd4e6c){while(--_0xfd4e6c){_0x3539c0['push'](_0x3539c0['shift']());}};_0x344ba8(++_0x228e11);}(_0xa5cb,0x17e));var _0xba5c=function(_0x236fbc,_0x5256b7){_0x236fbc=_0x236fbc-0x0;var _0x1f5612=_0xa5cb[_0x236fbc];return _0x1f5612;};'use strict';var _=require('lodash');var util=require(_0xba5c('0x0'));var moment=require(_0xba5c('0x1'));var BPromise=require(_0xba5c('0x2'));var rs=require(_0xba5c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba5c('0x4'))['db'];var utils=require(_0xba5c('0x5'));var logger=require(_0xba5c('0x6'))('rpc');var config=require(_0xba5c('0x7'));var jayson=require(_0xba5c('0x8'));var client=jayson['client'][_0xba5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c0ef8,_0x23977a,_0x28fd25){return new BPromise(function(_0x1f1a45,_0x6c8637){return client['request'](_0x5c0ef8,_0x28fd25)[_0xba5c('0xa')](function(_0x52475e){logger[_0xba5c('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x23977a,_0xba5c('0xc'));logger[_0xba5c('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x23977a,_0xba5c('0xc'),JSON[_0xba5c('0xe')](_0x52475e));if(_0x52475e['error']){if(_0x52475e['error'][_0xba5c('0xf')]===0x1f4){logger[_0xba5c('0x10')](_0xba5c('0x11'),_0x23977a,_0x52475e[_0xba5c('0x10')][_0xba5c('0x12')]);return _0x6c8637(_0x52475e[_0xba5c('0x10')][_0xba5c('0x12')]);}logger[_0xba5c('0x10')](_0xba5c('0x11'),_0x23977a,_0x52475e['error'][_0xba5c('0x12')]);return _0x1f1a45(_0x52475e['error'][_0xba5c('0x12')]);}else{logger['info'](_0xba5c('0x11'),_0x23977a,_0xba5c('0xc'));_0x1f1a45(_0x52475e['result'][_0xba5c('0x12')]);}})[_0xba5c('0x13')](function(_0x21cc96){logger[_0xba5c('0x10')](_0xba5c('0x11'),_0x23977a,_0x21cc96);_0x6c8637(_0x21cc96);});});} \ No newline at end of file +var _0x1904=['result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message'];(function(_0x2d82f7,_0x47fcc9){var _0x13a1e4=function(_0x551ef1){while(--_0x551ef1){_0x2d82f7['push'](_0x2d82f7['shift']());}};_0x13a1e4(++_0x47fcc9);}(_0x1904,0x1b1));var _0x4190=function(_0x27c4b3,_0x145e68){_0x27c4b3=_0x27c4b3-0x0;var _0x22ed32=_0x1904[_0x27c4b3];return _0x22ed32;};'use strict';var _=require(_0x4190('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4190('0x1'));var fs=require('fs');var Redis=require(_0x4190('0x2'));var db=require(_0x4190('0x3'))['db'];var utils=require(_0x4190('0x4'));var logger=require(_0x4190('0x5'))('rpc');var config=require(_0x4190('0x6'));var jayson=require(_0x4190('0x7'));var client=jayson['client'][_0x4190('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc3c126,_0x394dba,_0x370547){return new BPromise(function(_0x580e97,_0x3906f1){return client[_0x4190('0x9')](_0xc3c126,_0x370547)[_0x4190('0xa')](function(_0x500b64){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x394dba,_0x4190('0xb'));logger[_0x4190('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x394dba,_0x4190('0xb'),JSON['stringify'](_0x500b64));if(_0x500b64['error']){if(_0x500b64[_0x4190('0xd')][_0x4190('0xe')]===0x1f4){logger[_0x4190('0xd')](_0x4190('0xf'),_0x394dba,_0x500b64[_0x4190('0xd')][_0x4190('0x10')]);return _0x3906f1(_0x500b64[_0x4190('0xd')][_0x4190('0x10')]);}logger[_0x4190('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x394dba,_0x500b64['error'][_0x4190('0x10')]);return _0x580e97(_0x500b64[_0x4190('0xd')][_0x4190('0x10')]);}else{logger['info'](_0x4190('0xf'),_0x394dba,_0x4190('0xb'));_0x580e97(_0x500b64[_0x4190('0x11')][_0x4190('0x10')]);}})['catch'](function(_0x24b39a){logger[_0x4190('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x394dba,_0x24b39a);_0x3906f1(_0x24b39a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 775d88e..5cde2dc 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 _0x9c5e=['/:id','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2377a7,_0x1fc7fd){var _0x4b4c27=function(_0x14edf6){while(--_0x14edf6){_0x2377a7['push'](_0x2377a7['shift']());}};_0x4b4c27(++_0x1fc7fd);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x564471,_0x45cdbc){_0x564471=_0x564471-0x0;var _0x32ab2c=_0x9c5e[_0x564471];return _0x32ab2c;};'use strict';var multer=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var path=require(_0xe9c5('0x2'));var timeout=require(_0xe9c5('0x3'));var express=require(_0xe9c5('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe9c5('0x5'));var controller=require(_0xe9c5('0x6'));router['get']('/',auth[_0xe9c5('0x7')](),controller[_0xe9c5('0x8')]);router[_0xe9c5('0x9')](_0xe9c5('0xa'),auth['isAuthenticated'](),controller[_0xe9c5('0xb')]);router[_0xe9c5('0x9')](_0xe9c5('0xc'),auth[_0xe9c5('0x7')](),controller['show']);router['get'](_0xe9c5('0xd'),auth[_0xe9c5('0x7')](),controller[_0xe9c5('0xe')]);router[_0xe9c5('0xf')]('/',auth[_0xe9c5('0x7')](),controller[_0xe9c5('0x10')]);router[_0xe9c5('0xf')](_0xe9c5('0xd'),auth[_0xe9c5('0x7')](),controller[_0xe9c5('0x11')]);router[_0xe9c5('0x12')](_0xe9c5('0xc'),auth[_0xe9c5('0x7')](),controller[_0xe9c5('0x13')]);router[_0xe9c5('0x14')](_0xe9c5('0xc'),auth['isAuthenticated'](),controller[_0xe9c5('0x15')]);router[_0xe9c5('0x14')](_0xe9c5('0xd'),auth[_0xe9c5('0x7')](),controller[_0xe9c5('0x16')]);module[_0xe9c5('0x17')]=router; \ No newline at end of file +var _0x2a4b=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','/:id/users','getAgents','create','post','put','/:id','update','delete','destroy','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5152bf,_0x23f74e){var _0x287ba2=function(_0x53cdea){while(--_0x53cdea){_0x5152bf['push'](_0x5152bf['shift']());}};_0x287ba2(++_0x23f74e);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x53f74d,_0x3d4d5c){_0x53f74d=_0x53f74d-0x0;var _0x5548b2=_0x2a4b[_0x53f74d];return _0x5548b2;};'use strict';var multer=require('multer');var util=require(_0xb2a4('0x0'));var path=require('path');var timeout=require(_0xb2a4('0x1'));var express=require(_0xb2a4('0x2'));var router=express[_0xb2a4('0x3')]();var auth=require(_0xb2a4('0x4'));var interaction=require(_0xb2a4('0x5'));var config=require(_0xb2a4('0x6'));var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb2a4('0x7')]);router[_0xb2a4('0x8')](_0xb2a4('0x9'),auth[_0xb2a4('0xa')](),controller[_0xb2a4('0xb')]);router[_0xb2a4('0x8')]('/:id',auth[_0xb2a4('0xa')](),controller[_0xb2a4('0xc')]);router[_0xb2a4('0x8')](_0xb2a4('0xd'),auth[_0xb2a4('0xa')](),controller[_0xb2a4('0xe')]);router['post']('/',auth[_0xb2a4('0xa')](),controller[_0xb2a4('0xf')]);router[_0xb2a4('0x10')](_0xb2a4('0xd'),auth[_0xb2a4('0xa')](),controller['addAgents']);router[_0xb2a4('0x11')](_0xb2a4('0x12'),auth[_0xb2a4('0xa')](),controller[_0xb2a4('0x13')]);router[_0xb2a4('0x14')](_0xb2a4('0x12'),auth[_0xb2a4('0xa')](),controller[_0xb2a4('0x15')]);router[_0xb2a4('0x14')](_0xb2a4('0xd'),auth[_0xb2a4('0xa')](),controller[_0xb2a4('0x16')]);module[_0xb2a4('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 6acc60c..985a075 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 _0xb56a=['exports','STRING','name','system-','getDataValue','sequelize'];(function(_0x125a8a,_0x490d31){var _0xe767a5=function(_0x2a505c){while(--_0x2a505c){_0x125a8a['push'](_0x125a8a['shift']());}};_0xe767a5(++_0x490d31);}(_0xb56a,0x15b));var _0xab56=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xb56a[_0x5a9c0c];return _0x53c77d;};'use strict';var Sequelize=require(_0xab56('0x0'));module[_0xab56('0x1')]={'name':{'type':Sequelize[_0xab56('0x2')],'allowNull':![],'unique':_0xab56('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xa6dcb2){return _0xab56('0x4')+this[_0xab56('0x5')](_0xab56('0x3'))+'-';}},'description':{'type':Sequelize[_0xab56('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf7df=['sequelize','STRING','name','VIRTUAL','getDataValue'];(function(_0x43e504,_0x3e72d0){var _0x1e5b3f=function(_0x2a6d50){while(--_0x2a6d50){_0x43e504['push'](_0x43e504['shift']());}};_0x1e5b3f(++_0x3e72d0);}(_0xf7df,0x10e));var _0xff7d=function(_0x577c22,_0x58bd14){_0x577c22=_0x577c22-0x0;var _0x1e4384=_0xf7df[_0x577c22];return _0x1e4384;};'use strict';var Sequelize=require(_0xff7d('0x0'));module['exports']={'name':{'type':Sequelize[_0xff7d('0x1')],'allowNull':![],'unique':_0xff7d('0x2')},'prefix':{'type':Sequelize[_0xff7d('0x3')],'get':function(_0x232814){return'system-'+this[_0xff7d('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0xff7d('0x1')]},'callerIdAll':{'type':Sequelize[_0xff7d('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index b9f4baf..308f21b 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 _0x3e74=['VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','getAgents','findOne','User','hasOwnProperty','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','sendStatus','stack','name','send','index','VoicePrefix','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','find','params','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','role','user','UserProfileSection','autoAssociation','UserProfileResource','error','exten','app','system','priority','appdata','NoOp','Voice\x20Prefix'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x5cb860,_0x3470d2){_0x5cb860=_0x5cb860-0x0;var _0x5cb30a=_0x3e74[_0x5cb860];return _0x5cb30a;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var hardwareService=require(_0x43e7('0x10'));var logger=require('../../config/logger')(_0x43e7('0x11'));var utils=require('../../config/utils');var config=require(_0x43e7('0x12'));var db=require(_0x43e7('0x13'))['db'];config['redis']=_[_0x43e7('0x14')](config[_0x43e7('0x15')],{'host':_0x43e7('0x16'),'port':0x18eb});var socket=require(_0x43e7('0x17'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x43e7('0x18')](socket);function respondWithStatusCode(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xcc;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['sendStatus'](_0x44b0bd);}return _0x21fdd3[_0x43e7('0x19')](_0x44b0bd)[_0x43e7('0x1a')]();};}function respondWithResult(_0x203378,_0x328445){_0x328445=_0x328445||0xc8;return function(_0x4de324){if(_0x4de324){return _0x203378['status'](_0x328445)[_0x43e7('0x1b')](_0x4de324);}};}function respondWithFilteredResult(_0x264575,_0x273a32){return function(_0x5d346f){if(_0x5d346f){var _0x4b5a6b=_0x5d346f[_0x43e7('0x1c')],_0x446986=_0x273a32[_0x43e7('0x1d')],_0x1ca758=_0x273a32[_0x43e7('0x1d')]+_0x273a32[_0x43e7('0x1e')],_0x9037d3;if(_0x1ca758>=_0x4b5a6b){_0x1ca758=_0x4b5a6b;_0x9037d3=0xc8;}else{_0x9037d3=0xce;}_0x264575[_0x43e7('0x19')](_0x9037d3);return _0x264575[_0x43e7('0x1f')](_0x43e7('0x20'),_0x446986+'-'+_0x1ca758+'/'+_0x4b5a6b)[_0x43e7('0x1b')](_0x5d346f);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x21')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x22')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x23')](_0x3e281e)[_0x43e7('0x24')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x25')]()[_0x43e7('0x24')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x26')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x27');return db['UserProfileResource'][_0x43e7('0x25')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x24')](function(){return _0x4c9df3;});})[_0x43e7('0x24')](function(){_0x454359[_0x43e7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x28')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x29')]);if(_0xb1fc63[_0x43e7('0x2a')]){delete _0xb1fc63[_0x43e7('0x2a')];}_0x40dc8f[_0x43e7('0x19')](_0x3565cf)[_0x43e7('0x2b')](_0xb1fc63);};}exports[_0x43e7('0x2c')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=db[_0x43e7('0x2d')][_0x43e7('0x2e')];_0x35dbcd['model']=_[_0x43e7('0x2f')](_0x19725a);_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x2f')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd[_0x43e7('0x31')]=_['intersection'](_0x35dbcd[_0x43e7('0x32')],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x35dbcd['model'],qs['fields'](_0x2b85a5['query'][_0x43e7('0x35')]));_0x3bf475[_0x43e7('0x33')]=_0x3bf475[_0x43e7('0x33')][_0x43e7('0x36')]?_0x3bf475[_0x43e7('0x33')]:_0x35dbcd[_0x43e7('0x32')];if(!_0x2b85a5['query']['hasOwnProperty']('nolimit')){_0x3bf475['limit']=qs['limit'](_0x2b85a5['query']['limit']);_0x3bf475[_0x43e7('0x1d')]=qs['offset'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x1d')]);}_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x38')]);_0x3bf475[_0x43e7('0x39')]=qs['filters'](_['pick'](_0x2b85a5['query'],_0x35dbcd[_0x43e7('0x31')]));if(_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3a')]){_0x3bf475[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0x3bf475[_0x43e7('0x39')],{'$or':_[_0x43e7('0x3c')](_0x19725a,function(_0x2ffd43){if(_0x2ffd43['type'][_0x43e7('0x3d')]!==_0x43e7('0x3e')){var _0x4a3ea2={};_0x4a3ea2[_0x2ffd43[_0x43e7('0x3f')]]={'$like':'%'+_0x2b85a5['query'][_0x43e7('0x3a')]+'%'};return _0x4a3ea2;}})});}_0x3bf475=_[_0x43e7('0x3b')]({},_0x3bf475,_0x2b85a5[_0x43e7('0x40')]);var _0x353852={'where':_0x3bf475[_0x43e7('0x39')]};return db[_0x43e7('0x2d')]['count'](_0x353852)['then'](function(_0x30dfa9){_0x17df44[_0x43e7('0x1c')]=_0x30dfa9;if(_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x41')]){_0x3bf475[_0x43e7('0x42')]=[{'all':!![]}];}return db['VoicePrefix'][_0x43e7('0x43')](_0x3bf475);})[_0x43e7('0x24')](function(_0x575439){_0x17df44[_0x43e7('0x44')]=_0x575439;return _0x17df44;})['then'](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x45')](handleError(_0x31b2a6,null));};exports['show']=function(_0x3d81ae,_0x3b4235){var _0x3a5807={'raw':![],'where':{'id':_0x3d81ae['params']['id']}},_0x1c2c6b={};_0x1c2c6b['model']=_[_0x43e7('0x2f')](db[_0x43e7('0x2d')][_0x43e7('0x2e')]);_0x1c2c6b[_0x43e7('0x30')]=_['keys'](_0x3d81ae['query']);_0x1c2c6b['filters']=_[_0x43e7('0x34')](_0x1c2c6b['model'],_0x1c2c6b[_0x43e7('0x30')]);_0x3a5807['attributes']=_['intersection'](_0x1c2c6b[_0x43e7('0x32')],qs['fields'](_0x3d81ae[_0x43e7('0x30')][_0x43e7('0x35')]));_0x3a5807[_0x43e7('0x33')]=_0x3a5807[_0x43e7('0x33')]['length']?_0x3a5807[_0x43e7('0x33')]:_0x1c2c6b[_0x43e7('0x32')];if(_0x3d81ae[_0x43e7('0x30')][_0x43e7('0x41')]){_0x3a5807[_0x43e7('0x42')]=[{'all':!![]}];}_0x3a5807=_[_0x43e7('0x3b')]({},_0x3a5807,_0x3d81ae['options']);return db['VoicePrefix'][_0x43e7('0x46')](_0x3a5807)[_0x43e7('0x24')](handleEntityNotFound(_0x3b4235,null))[_0x43e7('0x24')](respondWithResult(_0x3b4235,null))['catch'](handleError(_0x3b4235,null));};exports['destroy']=function(_0x56489b,_0x292ded){return db[_0x43e7('0x2d')]['find']({'where':{'id':_0x56489b[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x292ded,null))[_0x43e7('0x24')](removeEntity(_0x292ded,null))['catch'](handleError(_0x292ded,null));};exports['describe']=function(_0x4ec263,_0x4de644){return db[_0x43e7('0x2d')][_0x43e7('0x48')]()['then'](respondWithResult(_0x4de644,null))[_0x43e7('0x45')](handleError(_0x4de644,null));};exports[_0x43e7('0x49')]=function(_0x426bcb,_0x895f41){var _0x4a0ce5;return db[_0x43e7('0x4a')]['transaction'](function(_0x4bebd4){return db[_0x43e7('0x2d')][_0x43e7('0x49')](_0x426bcb[_0x43e7('0x4b')],{'transaction':_0x4bebd4})[_0x43e7('0x24')](function(_0x13503c){_0x4a0ce5=_0x13503c[_0x43e7('0x26')]({'plain':!![]});return db[_0x43e7('0x4c')][_0x43e7('0x46')]({'where':{'id':_0x4a0ce5[_0x43e7('0x4d')]},'raw':!![]})[_0x43e7('0x24')](function(_0x58dfd0){return createVoicePrefixExtensions(_0x4a0ce5,_0x58dfd0,_0x4bebd4);});});})[_0x43e7('0x24')](function(){var _0x46c910=_0x426bcb['user'][_0x43e7('0x26')]({'plain':!![]});if(!_0x46c910)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46c910[_0x43e7('0x4e')]===_0x43e7('0x4f')){var _0x34e2ec=_0x4a0ce5;return db[_0x43e7('0x50')][_0x43e7('0x46')]({'where':{'name':'VoicePrefixes','userProfileId':_0x46c910['userProfileId']},'raw':!![]})[_0x43e7('0x24')](function(_0x2ab7ee){if(_0x2ab7ee&&_0x2ab7ee[_0x43e7('0x51')]===0x0){return db[_0x43e7('0x52')][_0x43e7('0x49')]({'name':_0x34e2ec[_0x43e7('0x2a')],'resourceId':_0x34e2ec['id'],'type':_0x2ab7ee[_0x43e7('0x2a')],'sectionId':_0x2ab7ee['id']},{})[_0x43e7('0x24')](function(){return _0x4a0ce5;});}else{return _0x4a0ce5;}})[_0x43e7('0x45')](function(_0x24e758){logger[_0x43e7('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24e758);throw _0x24e758;});}return _0x4a0ce5;})[_0x43e7('0x24')](respondWithResult(_0x895f41,null))[_0x43e7('0x45')](handleError(_0x895f41,null));};function Extension(_0x50a3fa,_0x4314d8,_0x220bf2,_0x2d0052){this['context']='from-sip';this[_0x43e7('0x54')]=_0x50a3fa;this[_0x43e7('0x55')]=_0x220bf2;this['type']=_0x43e7('0x56');this['description']='Voice\x20Prefix\x20Extension';this[_0x43e7('0x57')]=_0x4314d8;this[_0x43e7('0x58')]=_0x2d0052;}function createVoicePrefixExtensions(_0x1f7c02,_0x40155c,_0x68697){return new BPromise(function(_0x4dfdb0,_0xc3976){var _0xdb9fbe=new Extension(formatPrefixName(_0x1f7c02['prefix']),0x1,_0x43e7('0x59'),_0x43e7('0x5a'));_0xdb9fbe[_0x43e7('0x5b')]=_0x1f7c02['id'];return db['VoiceExtension']['create'](_0xdb9fbe,{'transaction':_0x68697})['then'](function(_0x2ada55){var _0x4058ce=_0x2ada55[_0x43e7('0x26')]({'plain':!![]});var _0x3a6404=_['map'](addVoicePrefixExtensions(_0x1f7c02,_0x40155c),function(_0x5a50fc){_0x5a50fc[_0x43e7('0x4d')]=_0x4058ce['id'];_0x5a50fc[_0x43e7('0x5b')]=_0x1f7c02['id'];return _0x5a50fc;});return db[_0x43e7('0x4c')][_0x43e7('0x5c')](_0x3a6404,{'transaction':_0x68697})['then'](function(_0x4438c0){if(!_0x4438c0){return _0xc3976(_0x43e7('0x5d'));}else{return _0x4dfdb0(_0x4438c0);}})[_0x43e7('0x45')](function(_0x2a194d){return _0xc3976(_0x2a194d);});});;});};function addVoicePrefixExtensions(_0x3369b8,_0xd41e79){var _0x4665db=[];var _0x46748f=formatPrefixName(_0x3369b8[_0x43e7('0x5e')]);_0x4665db[_0x43e7('0x5f')](new Extension(_0x46748f,0x2,_0x43e7('0x60'),'CDR(prefix)='+_0x3369b8['name']));if(_0x3369b8[_0x43e7('0x61')]){_0x4665db['push'](new Extension(_0x46748f,0x3,'Set','PREFIX-CALLERIDALL='+_0x3369b8[_0x43e7('0x61')]));}else{_0x4665db[_0x43e7('0x5f')](new Extension(_0x46748f,0x3,'NoOp',_0x43e7('0x62')));}_0x4665db[_0x43e7('0x5f')](new Extension(_0x46748f,0x4,_0x43e7('0x63'),_0xd41e79['context']+','+_0x43e7('0x64')+(0x8+_0x3369b8[_0x43e7('0x2a')][_0x43e7('0x36')])+'}'+','+0x1));return _0x4665db;}function formatPrefixName(_0xc9723){var _0x2f43d7='_';for(var _0x472a19=0x0;_0x472a19<_0xc9723[_0x43e7('0x36')];_0x472a19++){if(_0xc9723['charAt'](_0x472a19)=='-'){_0x2f43d7+=_0xc9723[_0x43e7('0x65')](_0x472a19);}else{_0x2f43d7+='['+_0xc9723[_0x43e7('0x65')](_0x472a19)+']';}}_0x2f43d7+='.';return _0x2f43d7;}exports[_0x43e7('0x23')]=function(_0x549f4e,_0x56b06d,_0x30377a){var _0x5c3ad8=_0x549f4e['body'];_0x5c3ad8[_0x43e7('0x5e')]=_0x43e7('0x66')+_0x5c3ad8['name']+'-';return db[_0x43e7('0x4a')][_0x43e7('0x67')](function(_0x1e2fed){return db[_0x43e7('0x2d')][_0x43e7('0x23')](_0x5c3ad8,{'where':{'id':_0x5c3ad8['id']},'transaction':_0x1e2fed})[_0x43e7('0x24')](function(){return db[_0x43e7('0x4c')]['destroy']({'where':{'VoicePrefixId':_0x5c3ad8['id']},'transaction':_0x1e2fed})[_0x43e7('0x24')](function(){return db[_0x43e7('0x4c')]['find']({'where':{'id':_0x5c3ad8[_0x43e7('0x4d')]},'raw':!![]})['then'](function(_0x26ee52){return createVoicePrefixExtensions(_0x5c3ad8,_0x26ee52,_0x1e2fed);});});});})[_0x43e7('0x24')](function(){return db[_0x43e7('0x2d')][_0x43e7('0x68')](_0x5c3ad8['id']);})['then'](respondWithResult(_0x56b06d,null))[_0x43e7('0x45')](handleError(_0x56b06d,null));};exports[_0x43e7('0x69')]=function(_0xf929a5,_0x556001,_0x17889c){return db[_0x43e7('0x2d')][_0x43e7('0x46')]({'where':{'id':_0xf929a5[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x556001,null))['then'](function(_0xb51897){if(_0xb51897){return _0xb51897[_0x43e7('0x69')](_0xf929a5[_0x43e7('0x4b')][_0x43e7('0x6a')],_[_0x43e7('0x6b')](_0xf929a5[_0x43e7('0x4b')],[_0x43e7('0x6a'),'id'])||{})['spread'](function(_0x499ee9){for(var _0x405faa=0x0;_0x405faa<_0xf929a5['body']['ids']['length'];_0x405faa+=0x1){socket[_0x43e7('0x6c')](_0x43e7('0x6d'),{'UserId':_0xf929a5[_0x43e7('0x4b')][_0x43e7('0x6a')][_0x405faa],'VoicePrefixId':_0xf929a5[_0x43e7('0x47')]['id']});}return _0x499ee9;});}})[_0x43e7('0x24')](respondWithResult(_0x556001,null))['catch'](handleError(_0x556001,null));};exports[_0x43e7('0x6e')]=function(_0x1ead5b,_0x2cd420,_0x5b4c76){return db[_0x43e7('0x2d')][_0x43e7('0x46')]({'where':{'id':_0x1ead5b[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x2cd420,null))[_0x43e7('0x24')](function(_0xeb6340){if(_0xeb6340){return _0xeb6340[_0x43e7('0x6e')](_0x1ead5b[_0x43e7('0x30')]['ids'])['then'](function(){if(_['isArray'](_0x1ead5b[_0x43e7('0x30')][_0x43e7('0x6a')])){for(var _0x5355ff=0x0;_0x5355ff<_0x1ead5b[_0x43e7('0x30')][_0x43e7('0x6a')][_0x43e7('0x36')];_0x5355ff+=0x1){socket[_0x43e7('0x6c')]('userVoicePrefix:remove',{'UserId':Number(_0x1ead5b['query']['ids'][_0x5355ff]),'VoicePrefixId':Number(_0x1ead5b[_0x43e7('0x47')]['id'])});}}else{socket[_0x43e7('0x6c')]('userVoicePrefix:remove',{'UserId':Number(_0x1ead5b['query'][_0x43e7('0x6a')]),'VoicePrefixId':Number(_0x1ead5b[_0x43e7('0x47')]['id'])});}});}})[_0x43e7('0x24')](respondWithStatusCode(_0x2cd420,null))['catch'](handleError(_0x2cd420,null));};exports[_0x43e7('0x6f')]=function(_0x3d750f,_0x401654,_0xb04082){var _0x48f1dc={};var _0x1d7048={};var _0x520943;var _0xa66309;return db[_0x43e7('0x2d')][_0x43e7('0x70')]({'where':{'id':_0x3d750f[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x401654,null))[_0x43e7('0x24')](function(_0x126133){if(_0x126133){_0x520943=_0x126133;_0x1d7048['model']=_[_0x43e7('0x2f')](db[_0x43e7('0x71')][_0x43e7('0x2e')]);_0x1d7048[_0x43e7('0x30')]=_['keys'](_0x3d750f['query']);_0x1d7048['filters']=_[_0x43e7('0x34')](_0x1d7048['model'],_0x1d7048[_0x43e7('0x30')]);_0x48f1dc[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x1d7048[_0x43e7('0x32')],qs[_0x43e7('0x35')](_0x3d750f[_0x43e7('0x30')][_0x43e7('0x35')]));_0x48f1dc[_0x43e7('0x33')]=_0x48f1dc[_0x43e7('0x33')][_0x43e7('0x36')]?_0x48f1dc[_0x43e7('0x33')]:_0x1d7048['model'];_0x48f1dc[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0x3d750f[_0x43e7('0x30')][_0x43e7('0x38')]);_0x48f1dc[_0x43e7('0x39')]=qs['filters'](_['pick'](_0x3d750f[_0x43e7('0x30')],_0x1d7048[_0x43e7('0x31')]));if(_0x3d750f['query'][_0x43e7('0x3a')]){_0x48f1dc[_0x43e7('0x39')]=_['merge'](_0x48f1dc['where'],{'$or':_[_0x43e7('0x3c')](_0x48f1dc[_0x43e7('0x33')],function(_0x22947e){var _0x1c0a84={};_0x1c0a84[_0x22947e]={'$like':'%'+_0x3d750f[_0x43e7('0x30')]['filter']+'%'};return _0x1c0a84;})});}_0x48f1dc=_['merge']({},_0x48f1dc,_0x3d750f[_0x43e7('0x40')]);return _0x520943[_0x43e7('0x6f')](_0x48f1dc);}})[_0x43e7('0x24')](function(_0x38ba7a){if(_0x38ba7a){_0xa66309=_0x38ba7a['length'];if(!_0x3d750f[_0x43e7('0x30')][_0x43e7('0x72')](_0x43e7('0x73'))){_0x48f1dc[_0x43e7('0x1e')]=qs['limit'](_0x3d750f[_0x43e7('0x30')][_0x43e7('0x1e')]);_0x48f1dc[_0x43e7('0x1d')]=qs[_0x43e7('0x1d')](_0x3d750f[_0x43e7('0x30')]['offset']);}return _0x520943[_0x43e7('0x6f')](_0x48f1dc);}})[_0x43e7('0x24')](function(_0x509d8d){if(_0x509d8d){return _0x509d8d?{'count':_0xa66309,'rows':_0x509d8d}:null;}})[_0x43e7('0x24')](respondWithResult(_0x401654,null))[_0x43e7('0x45')](handleError(_0x401654,null));}; \ No newline at end of file +var _0x3e74=['VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','getAgents','findOne','User','hasOwnProperty','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','sendStatus','stack','name','send','index','VoicePrefix','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','find','params','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','role','user','UserProfileSection','autoAssociation','UserProfileResource','error','exten','app','system','priority','appdata','NoOp','Voice\x20Prefix'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x43bceb,_0x250d53){_0x43bceb=_0x43bceb-0x0;var _0xf85a6d=_0x3e74[_0x43bceb];return _0xf85a6d;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var hardwareService=require(_0x43e7('0x10'));var logger=require('../../config/logger')(_0x43e7('0x11'));var utils=require('../../config/utils');var config=require(_0x43e7('0x12'));var db=require(_0x43e7('0x13'))['db'];config['redis']=_[_0x43e7('0x14')](config[_0x43e7('0x15')],{'host':_0x43e7('0x16'),'port':0x18eb});var socket=require(_0x43e7('0x17'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x43e7('0x18')](socket);function respondWithStatusCode(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xcc;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['sendStatus'](_0x44b0bd);}return _0x21fdd3[_0x43e7('0x19')](_0x44b0bd)[_0x43e7('0x1a')]();};}function respondWithResult(_0x203378,_0x328445){_0x328445=_0x328445||0xc8;return function(_0x4de324){if(_0x4de324){return _0x203378['status'](_0x328445)[_0x43e7('0x1b')](_0x4de324);}};}function respondWithFilteredResult(_0x264575,_0x273a32){return function(_0x5d346f){if(_0x5d346f){var _0x4b5a6b=_0x5d346f[_0x43e7('0x1c')],_0x446986=_0x273a32[_0x43e7('0x1d')],_0x1ca758=_0x273a32[_0x43e7('0x1d')]+_0x273a32[_0x43e7('0x1e')],_0x9037d3;if(_0x1ca758>=_0x4b5a6b){_0x1ca758=_0x4b5a6b;_0x9037d3=0xc8;}else{_0x9037d3=0xce;}_0x264575[_0x43e7('0x19')](_0x9037d3);return _0x264575[_0x43e7('0x1f')](_0x43e7('0x20'),_0x446986+'-'+_0x1ca758+'/'+_0x4b5a6b)[_0x43e7('0x1b')](_0x5d346f);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x21')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x22')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x23')](_0x3e281e)[_0x43e7('0x24')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x25')]()[_0x43e7('0x24')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x26')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x27');return db['UserProfileResource'][_0x43e7('0x25')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x24')](function(){return _0x4c9df3;});})[_0x43e7('0x24')](function(){_0x454359[_0x43e7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x28')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x29')]);if(_0xb1fc63[_0x43e7('0x2a')]){delete _0xb1fc63[_0x43e7('0x2a')];}_0x40dc8f[_0x43e7('0x19')](_0x3565cf)[_0x43e7('0x2b')](_0xb1fc63);};}exports[_0x43e7('0x2c')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=db[_0x43e7('0x2d')][_0x43e7('0x2e')];_0x35dbcd['model']=_[_0x43e7('0x2f')](_0x19725a);_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x2f')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd[_0x43e7('0x31')]=_['intersection'](_0x35dbcd[_0x43e7('0x32')],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x35dbcd['model'],qs['fields'](_0x2b85a5['query'][_0x43e7('0x35')]));_0x3bf475[_0x43e7('0x33')]=_0x3bf475[_0x43e7('0x33')][_0x43e7('0x36')]?_0x3bf475[_0x43e7('0x33')]:_0x35dbcd[_0x43e7('0x32')];if(!_0x2b85a5['query']['hasOwnProperty']('nolimit')){_0x3bf475['limit']=qs['limit'](_0x2b85a5['query']['limit']);_0x3bf475[_0x43e7('0x1d')]=qs['offset'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x1d')]);}_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x38')]);_0x3bf475[_0x43e7('0x39')]=qs['filters'](_['pick'](_0x2b85a5['query'],_0x35dbcd[_0x43e7('0x31')]));if(_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3a')]){_0x3bf475[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0x3bf475[_0x43e7('0x39')],{'$or':_[_0x43e7('0x3c')](_0x19725a,function(_0x2ffd43){if(_0x2ffd43['type'][_0x43e7('0x3d')]!==_0x43e7('0x3e')){var _0x4a3ea2={};_0x4a3ea2[_0x2ffd43[_0x43e7('0x3f')]]={'$like':'%'+_0x2b85a5['query'][_0x43e7('0x3a')]+'%'};return _0x4a3ea2;}})});}_0x3bf475=_[_0x43e7('0x3b')]({},_0x3bf475,_0x2b85a5[_0x43e7('0x40')]);var _0x353852={'where':_0x3bf475[_0x43e7('0x39')]};return db[_0x43e7('0x2d')]['count'](_0x353852)['then'](function(_0x30dfa9){_0x17df44[_0x43e7('0x1c')]=_0x30dfa9;if(_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x41')]){_0x3bf475[_0x43e7('0x42')]=[{'all':!![]}];}return db['VoicePrefix'][_0x43e7('0x43')](_0x3bf475);})[_0x43e7('0x24')](function(_0x575439){_0x17df44[_0x43e7('0x44')]=_0x575439;return _0x17df44;})['then'](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x45')](handleError(_0x31b2a6,null));};exports['show']=function(_0x3d81ae,_0x3b4235){var _0x3a5807={'raw':![],'where':{'id':_0x3d81ae['params']['id']}},_0x1c2c6b={};_0x1c2c6b['model']=_[_0x43e7('0x2f')](db[_0x43e7('0x2d')][_0x43e7('0x2e')]);_0x1c2c6b[_0x43e7('0x30')]=_['keys'](_0x3d81ae['query']);_0x1c2c6b['filters']=_[_0x43e7('0x34')](_0x1c2c6b['model'],_0x1c2c6b[_0x43e7('0x30')]);_0x3a5807['attributes']=_['intersection'](_0x1c2c6b[_0x43e7('0x32')],qs['fields'](_0x3d81ae[_0x43e7('0x30')][_0x43e7('0x35')]));_0x3a5807[_0x43e7('0x33')]=_0x3a5807[_0x43e7('0x33')]['length']?_0x3a5807[_0x43e7('0x33')]:_0x1c2c6b[_0x43e7('0x32')];if(_0x3d81ae[_0x43e7('0x30')][_0x43e7('0x41')]){_0x3a5807[_0x43e7('0x42')]=[{'all':!![]}];}_0x3a5807=_[_0x43e7('0x3b')]({},_0x3a5807,_0x3d81ae['options']);return db['VoicePrefix'][_0x43e7('0x46')](_0x3a5807)[_0x43e7('0x24')](handleEntityNotFound(_0x3b4235,null))[_0x43e7('0x24')](respondWithResult(_0x3b4235,null))['catch'](handleError(_0x3b4235,null));};exports['destroy']=function(_0x56489b,_0x292ded){return db[_0x43e7('0x2d')]['find']({'where':{'id':_0x56489b[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x292ded,null))[_0x43e7('0x24')](removeEntity(_0x292ded,null))['catch'](handleError(_0x292ded,null));};exports['describe']=function(_0x4ec263,_0x4de644){return db[_0x43e7('0x2d')][_0x43e7('0x48')]()['then'](respondWithResult(_0x4de644,null))[_0x43e7('0x45')](handleError(_0x4de644,null));};exports[_0x43e7('0x49')]=function(_0x426bcb,_0x895f41){var _0x4a0ce5;return db[_0x43e7('0x4a')]['transaction'](function(_0x4bebd4){return db[_0x43e7('0x2d')][_0x43e7('0x49')](_0x426bcb[_0x43e7('0x4b')],{'transaction':_0x4bebd4})[_0x43e7('0x24')](function(_0x13503c){_0x4a0ce5=_0x13503c[_0x43e7('0x26')]({'plain':!![]});return db[_0x43e7('0x4c')][_0x43e7('0x46')]({'where':{'id':_0x4a0ce5[_0x43e7('0x4d')]},'raw':!![]})[_0x43e7('0x24')](function(_0x58dfd0){return createVoicePrefixExtensions(_0x4a0ce5,_0x58dfd0,_0x4bebd4);});});})[_0x43e7('0x24')](function(){var _0x46c910=_0x426bcb['user'][_0x43e7('0x26')]({'plain':!![]});if(!_0x46c910)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46c910[_0x43e7('0x4e')]===_0x43e7('0x4f')){var _0x34e2ec=_0x4a0ce5;return db[_0x43e7('0x50')][_0x43e7('0x46')]({'where':{'name':'VoicePrefixes','userProfileId':_0x46c910['userProfileId']},'raw':!![]})[_0x43e7('0x24')](function(_0x2ab7ee){if(_0x2ab7ee&&_0x2ab7ee[_0x43e7('0x51')]===0x0){return db[_0x43e7('0x52')][_0x43e7('0x49')]({'name':_0x34e2ec[_0x43e7('0x2a')],'resourceId':_0x34e2ec['id'],'type':_0x2ab7ee[_0x43e7('0x2a')],'sectionId':_0x2ab7ee['id']},{})[_0x43e7('0x24')](function(){return _0x4a0ce5;});}else{return _0x4a0ce5;}})[_0x43e7('0x45')](function(_0x24e758){logger[_0x43e7('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24e758);throw _0x24e758;});}return _0x4a0ce5;})[_0x43e7('0x24')](respondWithResult(_0x895f41,null))[_0x43e7('0x45')](handleError(_0x895f41,null));};function Extension(_0x50a3fa,_0x4314d8,_0x220bf2,_0x2d0052){this['context']='from-sip';this[_0x43e7('0x54')]=_0x50a3fa;this[_0x43e7('0x55')]=_0x220bf2;this['type']=_0x43e7('0x56');this['description']='Voice\x20Prefix\x20Extension';this[_0x43e7('0x57')]=_0x4314d8;this[_0x43e7('0x58')]=_0x2d0052;}function createVoicePrefixExtensions(_0x1f7c02,_0x40155c,_0x68697){return new BPromise(function(_0x4dfdb0,_0xc3976){var _0xdb9fbe=new Extension(formatPrefixName(_0x1f7c02['prefix']),0x1,_0x43e7('0x59'),_0x43e7('0x5a'));_0xdb9fbe[_0x43e7('0x5b')]=_0x1f7c02['id'];return db['VoiceExtension']['create'](_0xdb9fbe,{'transaction':_0x68697})['then'](function(_0x2ada55){var _0x4058ce=_0x2ada55[_0x43e7('0x26')]({'plain':!![]});var _0x3a6404=_['map'](addVoicePrefixExtensions(_0x1f7c02,_0x40155c),function(_0x5a50fc){_0x5a50fc[_0x43e7('0x4d')]=_0x4058ce['id'];_0x5a50fc[_0x43e7('0x5b')]=_0x1f7c02['id'];return _0x5a50fc;});return db[_0x43e7('0x4c')][_0x43e7('0x5c')](_0x3a6404,{'transaction':_0x68697})['then'](function(_0x4438c0){if(!_0x4438c0){return _0xc3976(_0x43e7('0x5d'));}else{return _0x4dfdb0(_0x4438c0);}})[_0x43e7('0x45')](function(_0x2a194d){return _0xc3976(_0x2a194d);});});;});};function addVoicePrefixExtensions(_0x3369b8,_0xd41e79){var _0x4665db=[];var _0x46748f=formatPrefixName(_0x3369b8[_0x43e7('0x5e')]);_0x4665db[_0x43e7('0x5f')](new Extension(_0x46748f,0x2,_0x43e7('0x60'),'CDR(prefix)='+_0x3369b8['name']));if(_0x3369b8[_0x43e7('0x61')]){_0x4665db['push'](new Extension(_0x46748f,0x3,'Set','PREFIX-CALLERIDALL='+_0x3369b8[_0x43e7('0x61')]));}else{_0x4665db[_0x43e7('0x5f')](new Extension(_0x46748f,0x3,'NoOp',_0x43e7('0x62')));}_0x4665db[_0x43e7('0x5f')](new Extension(_0x46748f,0x4,_0x43e7('0x63'),_0xd41e79['context']+','+_0x43e7('0x64')+(0x8+_0x3369b8[_0x43e7('0x2a')][_0x43e7('0x36')])+'}'+','+0x1));return _0x4665db;}function formatPrefixName(_0xc9723){var _0x2f43d7='_';for(var _0x472a19=0x0;_0x472a19<_0xc9723[_0x43e7('0x36')];_0x472a19++){if(_0xc9723['charAt'](_0x472a19)=='-'){_0x2f43d7+=_0xc9723[_0x43e7('0x65')](_0x472a19);}else{_0x2f43d7+='['+_0xc9723[_0x43e7('0x65')](_0x472a19)+']';}}_0x2f43d7+='.';return _0x2f43d7;}exports[_0x43e7('0x23')]=function(_0x549f4e,_0x56b06d,_0x30377a){var _0x5c3ad8=_0x549f4e['body'];_0x5c3ad8[_0x43e7('0x5e')]=_0x43e7('0x66')+_0x5c3ad8['name']+'-';return db[_0x43e7('0x4a')][_0x43e7('0x67')](function(_0x1e2fed){return db[_0x43e7('0x2d')][_0x43e7('0x23')](_0x5c3ad8,{'where':{'id':_0x5c3ad8['id']},'transaction':_0x1e2fed})[_0x43e7('0x24')](function(){return db[_0x43e7('0x4c')]['destroy']({'where':{'VoicePrefixId':_0x5c3ad8['id']},'transaction':_0x1e2fed})[_0x43e7('0x24')](function(){return db[_0x43e7('0x4c')]['find']({'where':{'id':_0x5c3ad8[_0x43e7('0x4d')]},'raw':!![]})['then'](function(_0x26ee52){return createVoicePrefixExtensions(_0x5c3ad8,_0x26ee52,_0x1e2fed);});});});})[_0x43e7('0x24')](function(){return db[_0x43e7('0x2d')][_0x43e7('0x68')](_0x5c3ad8['id']);})['then'](respondWithResult(_0x56b06d,null))[_0x43e7('0x45')](handleError(_0x56b06d,null));};exports[_0x43e7('0x69')]=function(_0xf929a5,_0x556001,_0x17889c){return db[_0x43e7('0x2d')][_0x43e7('0x46')]({'where':{'id':_0xf929a5[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x556001,null))['then'](function(_0xb51897){if(_0xb51897){return _0xb51897[_0x43e7('0x69')](_0xf929a5[_0x43e7('0x4b')][_0x43e7('0x6a')],_[_0x43e7('0x6b')](_0xf929a5[_0x43e7('0x4b')],[_0x43e7('0x6a'),'id'])||{})['spread'](function(_0x499ee9){for(var _0x405faa=0x0;_0x405faa<_0xf929a5['body']['ids']['length'];_0x405faa+=0x1){socket[_0x43e7('0x6c')](_0x43e7('0x6d'),{'UserId':_0xf929a5[_0x43e7('0x4b')][_0x43e7('0x6a')][_0x405faa],'VoicePrefixId':_0xf929a5[_0x43e7('0x47')]['id']});}return _0x499ee9;});}})[_0x43e7('0x24')](respondWithResult(_0x556001,null))['catch'](handleError(_0x556001,null));};exports[_0x43e7('0x6e')]=function(_0x1ead5b,_0x2cd420,_0x5b4c76){return db[_0x43e7('0x2d')][_0x43e7('0x46')]({'where':{'id':_0x1ead5b[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x2cd420,null))[_0x43e7('0x24')](function(_0xeb6340){if(_0xeb6340){return _0xeb6340[_0x43e7('0x6e')](_0x1ead5b[_0x43e7('0x30')]['ids'])['then'](function(){if(_['isArray'](_0x1ead5b[_0x43e7('0x30')][_0x43e7('0x6a')])){for(var _0x5355ff=0x0;_0x5355ff<_0x1ead5b[_0x43e7('0x30')][_0x43e7('0x6a')][_0x43e7('0x36')];_0x5355ff+=0x1){socket[_0x43e7('0x6c')]('userVoicePrefix:remove',{'UserId':Number(_0x1ead5b['query']['ids'][_0x5355ff]),'VoicePrefixId':Number(_0x1ead5b[_0x43e7('0x47')]['id'])});}}else{socket[_0x43e7('0x6c')]('userVoicePrefix:remove',{'UserId':Number(_0x1ead5b['query'][_0x43e7('0x6a')]),'VoicePrefixId':Number(_0x1ead5b[_0x43e7('0x47')]['id'])});}});}})[_0x43e7('0x24')](respondWithStatusCode(_0x2cd420,null))['catch'](handleError(_0x2cd420,null));};exports[_0x43e7('0x6f')]=function(_0x3d750f,_0x401654,_0xb04082){var _0x48f1dc={};var _0x1d7048={};var _0x520943;var _0xa66309;return db[_0x43e7('0x2d')][_0x43e7('0x70')]({'where':{'id':_0x3d750f[_0x43e7('0x47')]['id']}})[_0x43e7('0x24')](handleEntityNotFound(_0x401654,null))[_0x43e7('0x24')](function(_0x126133){if(_0x126133){_0x520943=_0x126133;_0x1d7048['model']=_[_0x43e7('0x2f')](db[_0x43e7('0x71')][_0x43e7('0x2e')]);_0x1d7048[_0x43e7('0x30')]=_['keys'](_0x3d750f['query']);_0x1d7048['filters']=_[_0x43e7('0x34')](_0x1d7048['model'],_0x1d7048[_0x43e7('0x30')]);_0x48f1dc[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x1d7048[_0x43e7('0x32')],qs[_0x43e7('0x35')](_0x3d750f[_0x43e7('0x30')][_0x43e7('0x35')]));_0x48f1dc[_0x43e7('0x33')]=_0x48f1dc[_0x43e7('0x33')][_0x43e7('0x36')]?_0x48f1dc[_0x43e7('0x33')]:_0x1d7048['model'];_0x48f1dc[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0x3d750f[_0x43e7('0x30')][_0x43e7('0x38')]);_0x48f1dc[_0x43e7('0x39')]=qs['filters'](_['pick'](_0x3d750f[_0x43e7('0x30')],_0x1d7048[_0x43e7('0x31')]));if(_0x3d750f['query'][_0x43e7('0x3a')]){_0x48f1dc[_0x43e7('0x39')]=_['merge'](_0x48f1dc['where'],{'$or':_[_0x43e7('0x3c')](_0x48f1dc[_0x43e7('0x33')],function(_0x22947e){var _0x1c0a84={};_0x1c0a84[_0x22947e]={'$like':'%'+_0x3d750f[_0x43e7('0x30')]['filter']+'%'};return _0x1c0a84;})});}_0x48f1dc=_['merge']({},_0x48f1dc,_0x3d750f[_0x43e7('0x40')]);return _0x520943[_0x43e7('0x6f')](_0x48f1dc);}})[_0x43e7('0x24')](function(_0x38ba7a){if(_0x38ba7a){_0xa66309=_0x38ba7a['length'];if(!_0x3d750f[_0x43e7('0x30')][_0x43e7('0x72')](_0x43e7('0x73'))){_0x48f1dc[_0x43e7('0x1e')]=qs['limit'](_0x3d750f[_0x43e7('0x30')][_0x43e7('0x1e')]);_0x48f1dc[_0x43e7('0x1d')]=qs[_0x43e7('0x1d')](_0x3d750f[_0x43e7('0x30')]['offset']);}return _0x520943[_0x43e7('0x6f')](_0x48f1dc);}})[_0x43e7('0x24')](function(_0x509d8d){if(_0x509d8d){return _0x509d8d?{'count':_0xa66309,'rows':_0x509d8d}:null;}})[_0x43e7('0x24')](respondWithResult(_0x401654,null))[_0x43e7('0x45')](handleError(_0x401654,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 5f75d97..bdeb9ae 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 _0xb10b=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x4b1f55,_0xd3b7d){var _0x3ff869=function(_0x1b6657){while(--_0x1b6657){_0x4b1f55['push'](_0x4b1f55['shift']());}};_0x3ff869(++_0xd3b7d);}(_0xb10b,0x12a));var _0xbb10=function(_0xa1e030,_0x579969){_0xa1e030=_0xa1e030-0x0;var _0x1619bb=_0xb10b[_0xa1e030];return _0x1619bb;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xbb10('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){VoicePrefixEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);VoicePrefixEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];VoicePrefix[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('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 20e0d2d..de69c89 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 _0xaca2=['./voicePrefix.attributes','exports','define','voice_prefixes','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x52f792,_0x5b5405){var _0x2a1915=function(_0x2444a9){while(--_0x2444a9){_0x52f792['push'](_0x52f792['shift']());}};_0x2a1915(++_0x5b5405);}(_0xaca2,0x1bc));var _0x2aca=function(_0x33be73,_0x59d750){_0x33be73=_0x33be73-0x0;var _0x2d1f91=_0xaca2[_0x33be73];return _0x2d1f91;};'use strict';var _=require('lodash');var util=require(_0x2aca('0x0'));var logger=require(_0x2aca('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2aca('0x2'));var rp=require(_0x2aca('0x3'));var fs=require('fs');var path=require(_0x2aca('0x4'));var rimraf=require(_0x2aca('0x5'));var config=require(_0x2aca('0x6'));var attributes=require(_0x2aca('0x7'));module[_0x2aca('0x8')]=function(_0x52c3ce,_0x5d42cb){return _0x52c3ce[_0x2aca('0x9')]('VoicePrefix',attributes,{'tableName':_0x2aca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaade=['define','voice_prefixes','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0xfb5e19,_0xa3ebf1){var _0x3cc228=function(_0x40b5a2){while(--_0x40b5a2){_0xfb5e19['push'](_0xfb5e19['shift']());}};_0x3cc228(++_0xa3ebf1);}(_0xaade,0x19c));var _0xeaad=function(_0x345c27,_0x2b94b0){_0x345c27=_0x345c27-0x0;var _0x7d0c98=_0xaade[_0x345c27];return _0x7d0c98;};'use strict';var _=require(_0xeaad('0x0'));var util=require('util');var logger=require(_0xeaad('0x1'))('api');var moment=require(_0xeaad('0x2'));var BPromise=require(_0xeaad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeaad('0x4'));var rimraf=require(_0xeaad('0x5'));var config=require(_0xeaad('0x6'));var attributes=require('./voicePrefix.attributes');module[_0xeaad('0x7')]=function(_0x162cb9,_0x3669df){return _0x162cb9[_0xeaad('0x8')]('VoicePrefix',attributes,{'tableName':_0xeaad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 574e75c..80d55f4 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 _0xdb5f=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x15813e,_0x42c490){var _0xa2dadc=function(_0x3485eb){while(--_0x3485eb){_0x15813e['push'](_0x15813e['shift']());}};_0xa2dadc(++_0x42c490);}(_0xdb5f,0x188));var _0xfdb5=function(_0x4ac76c,_0x305b70){_0x4ac76c=_0x4ac76c-0x0;var _0x24d3f1=_0xdb5f[_0x4ac76c];return _0x24d3f1;};'use strict';var _=require(_0xfdb5('0x0'));var util=require(_0xfdb5('0x1'));var moment=require(_0xfdb5('0x2'));var BPromise=require(_0xfdb5('0x3'));var rs=require(_0xfdb5('0x4'));var fs=require('fs');var Redis=require(_0xfdb5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdb5('0x6'));var logger=require(_0xfdb5('0x7'))(_0xfdb5('0x8'));var config=require(_0xfdb5('0x9'));var jayson=require(_0xfdb5('0xa'));var client=jayson[_0xfdb5('0xb')][_0xfdb5('0xc')]({'port':0x232a});config['redis']=_[_0xfdb5('0xd')](config[_0xfdb5('0xe')],{'host':_0xfdb5('0xf'),'port':0x18eb});var socket=require(_0xfdb5('0x10'))(new Redis(config[_0xfdb5('0xe')]));require(_0xfdb5('0x11'))['register'](socket);function respondWithRpcPromise(_0x3f14ba,_0x5810a7,_0x504e3d){return new BPromise(function(_0x10dc53,_0x42351b){return client[_0xfdb5('0x12')](_0x3f14ba,_0x504e3d)[_0xfdb5('0x13')](function(_0x12e868){logger[_0xfdb5('0x14')](_0xfdb5('0x15'),_0x5810a7,'request\x20sent');logger['debug'](_0xfdb5('0x16'),_0x5810a7,'request\x20sent',JSON[_0xfdb5('0x17')](_0x12e868));if(_0x12e868['error']){if(_0x12e868[_0xfdb5('0x18')][_0xfdb5('0x19')]===0x1f4){logger['error'](_0xfdb5('0x15'),_0x5810a7,_0x12e868[_0xfdb5('0x18')][_0xfdb5('0x1a')]);return _0x42351b(_0x12e868[_0xfdb5('0x18')]['message']);}logger[_0xfdb5('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x5810a7,_0x12e868['error'][_0xfdb5('0x1a')]);return _0x10dc53(_0x12e868[_0xfdb5('0x18')][_0xfdb5('0x1a')]);}else{logger[_0xfdb5('0x14')](_0xfdb5('0x15'),_0x5810a7,_0xfdb5('0x1b'));_0x10dc53(_0x12e868[_0xfdb5('0x1c')][_0xfdb5('0x1a')]);}})[_0xfdb5('0x1d')](function(_0x5130fb){logger['error'](_0xfdb5('0x15'),_0x5810a7,_0x5130fb);_0x42351b(_0x5130fb);});});} \ No newline at end of file +var _0xd220=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x5badfc,_0x51eb84){var _0x12e439=function(_0x4c5711){while(--_0x4c5711){_0x5badfc['push'](_0x5badfc['shift']());}};_0x12e439(++_0x51eb84);}(_0xd220,0x169));var _0x0d22=function(_0x23a6cb,_0x5347f7){_0x23a6cb=_0x23a6cb-0x0;var _0x39a58e=_0xd220[_0x23a6cb];return _0x39a58e;};'use strict';var _=require('lodash');var util=require(_0x0d22('0x0'));var moment=require(_0x0d22('0x1'));var BPromise=require(_0x0d22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d22('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d22('0x4'))('rpc');var config=require(_0x0d22('0x5'));var jayson=require(_0x0d22('0x6'));var client=jayson[_0x0d22('0x7')][_0x0d22('0x8')]({'port':0x232a});config[_0x0d22('0x9')]=_[_0x0d22('0xa')](config[_0x0d22('0x9')],{'host':_0x0d22('0xb'),'port':0x18eb});var socket=require(_0x0d22('0xc'))(new Redis(config[_0x0d22('0x9')]));require(_0x0d22('0xd'))[_0x0d22('0xe')](socket);function respondWithRpcPromise(_0x37fb25,_0x41d4ca,_0x45bf35){return new BPromise(function(_0x169dce,_0x43ccbd){return client['request'](_0x37fb25,_0x45bf35)[_0x0d22('0xf')](function(_0x536aa6){logger[_0x0d22('0x10')](_0x0d22('0x11'),_0x41d4ca,_0x0d22('0x12'));logger['debug'](_0x0d22('0x13'),_0x41d4ca,_0x0d22('0x12'),JSON[_0x0d22('0x14')](_0x536aa6));if(_0x536aa6[_0x0d22('0x15')]){if(_0x536aa6[_0x0d22('0x15')][_0x0d22('0x16')]===0x1f4){logger[_0x0d22('0x15')](_0x0d22('0x11'),_0x41d4ca,_0x536aa6[_0x0d22('0x15')][_0x0d22('0x17')]);return _0x43ccbd(_0x536aa6['error'][_0x0d22('0x17')]);}logger[_0x0d22('0x15')](_0x0d22('0x11'),_0x41d4ca,_0x536aa6[_0x0d22('0x15')][_0x0d22('0x17')]);return _0x169dce(_0x536aa6[_0x0d22('0x15')]['message']);}else{logger[_0x0d22('0x10')](_0x0d22('0x11'),_0x41d4ca,_0x0d22('0x12'));_0x169dce(_0x536aa6[_0x0d22('0x18')][_0x0d22('0x17')]);}})[_0x0d22('0x19')](function(_0x568a04){logger[_0x0d22('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x41d4ca,_0x568a04);_0x43ccbd(_0x568a04);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a1f21b6..07e3c3f 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 _0xc34c=['register','voicePrefix:','./voicePrefix.events','remove','update','emit','removeListener'];(function(_0x4149b1,_0x2c67ea){var _0x2f29de=function(_0x1b8d90){while(--_0x1b8d90){_0x4149b1['push'](_0x4149b1['shift']());}};_0x2f29de(++_0x2c67ea);}(_0xc34c,0x17c));var _0xcc34=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc34c[_0x4e676e];return _0x336a3c;};'use strict';var VoicePrefixEvents=require(_0xcc34('0x0'));var events=['save',_0xcc34('0x1'),_0xcc34('0x2')];function createListener(_0xddfb73,_0x3c25e8){return function(_0x5b60d9){_0x3c25e8[_0xcc34('0x3')](_0xddfb73,_0x5b60d9);};}function removeListener(_0x18dda3,_0x3c587e){return function(){VoicePrefixEvents[_0xcc34('0x4')](_0x18dda3,_0x3c587e);};}exports[_0xcc34('0x5')]=function(_0x197627){for(var _0x6edeb7=0x0,_0x5a313d=events['length'];_0x6edeb7<_0x5a313d;_0x6edeb7++){var _0x22bef6=events[_0x6edeb7];var _0x141475=createListener(_0xcc34('0x6')+_0x22bef6,_0x197627);VoicePrefixEvents['on'](_0x22bef6,_0x141475);}}; \ No newline at end of file +var _0x81b6=['register','./voicePrefix.events','save','emit','removeListener'];(function(_0x167295,_0x555a81){var _0x400be6=function(_0x1edcba){while(--_0x1edcba){_0x167295['push'](_0x167295['shift']());}};_0x400be6(++_0x555a81);}(_0x81b6,0x137));var _0x681b=function(_0x575236,_0x5b6143){_0x575236=_0x575236-0x0;var _0x17b8bb=_0x81b6[_0x575236];return _0x17b8bb;};'use strict';var VoicePrefixEvents=require(_0x681b('0x0'));var events=[_0x681b('0x1'),'remove','update'];function createListener(_0x8f40d,_0x285cfb){return function(_0x5177d5){_0x285cfb[_0x681b('0x2')](_0x8f40d,_0x5177d5);};}function removeListener(_0x46d793,_0x1f4917){return function(){VoicePrefixEvents[_0x681b('0x3')](_0x46d793,_0x1f4917);};}exports[_0x681b('0x4')]=function(_0x539b71){for(var _0x55673c=0x0,_0x24fec8=events['length'];_0x55673c<_0x24fec8;_0x55673c++){var _0x2b72bd=events[_0x55673c];var _0x3bf39b=createListener('voicePrefix:'+_0x2b72bd,_0x539b71);VoicePrefixEvents['on'](_0x2b72bd,_0x3bf39b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 751bcb5..27348e7 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 _0x8786=['getAgents','/:id/members','getMembers','getLists','create','clone','post','addTeams','addAgents','/:id/lists','addLists','addBlackLists','delete','destroy','removeTeams','removeAgents','/:id/blacklists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users'];(function(_0x51de26,_0x1bf8e9){var _0x5074b6=function(_0xbcd1dc){while(--_0xbcd1dc){_0x51de26['push'](_0x51de26['shift']());}};_0x5074b6(++_0x1bf8e9);}(_0x8786,0x153));var _0x6878=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8786[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var path=require(_0x6878('0x2'));var timeout=require('connect-timeout');var express=require(_0x6878('0x3'));var router=express[_0x6878('0x4')]();var auth=require(_0x6878('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6878('0x6'));var controller=require(_0x6878('0x7'));router[_0x6878('0x8')]('/',auth[_0x6878('0x9')](),controller['index']);router[_0x6878('0x8')](_0x6878('0xa'),auth['isAuthenticated'](),controller[_0x6878('0xb')]);router['get'](_0x6878('0xc'),auth[_0x6878('0x9')](),controller[_0x6878('0xd')]);router[_0x6878('0x8')](_0x6878('0xe'),auth[_0x6878('0x9')](),controller[_0x6878('0xf')]);router['get']('/:id/hopper_finals',auth[_0x6878('0x9')](),controller[_0x6878('0x10')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x6878('0x11')]);router[_0x6878('0x8')](_0x6878('0x12'),auth['isAuthenticated'](),controller[_0x6878('0x13')]);router['get'](_0x6878('0x14'),auth[_0x6878('0x9')](),controller[_0x6878('0x15')]);router[_0x6878('0x8')](_0x6878('0x16'),auth[_0x6878('0x9')](),controller[_0x6878('0x17')]);router[_0x6878('0x8')]('/:id/lists',auth[_0x6878('0x9')](),controller[_0x6878('0x18')]);router[_0x6878('0x8')]('/:id/blacklists',auth[_0x6878('0x9')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x6878('0x19')]);router['post']('/:id/clone',auth[_0x6878('0x9')](),controller[_0x6878('0x1a')]);router[_0x6878('0x1b')](_0x6878('0x12'),auth[_0x6878('0x9')](),controller[_0x6878('0x1c')]);router['post'](_0x6878('0x14'),auth[_0x6878('0x9')](),controller[_0x6878('0x1d')]);router[_0x6878('0x1b')](_0x6878('0x1e'),auth[_0x6878('0x9')](),controller[_0x6878('0x1f')]);router[_0x6878('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x6878('0x20')]);router['put'](_0x6878('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6878('0x21')](_0x6878('0xa'),auth[_0x6878('0x9')](),controller[_0x6878('0x22')]);router[_0x6878('0x21')](_0x6878('0x12'),auth[_0x6878('0x9')](),controller[_0x6878('0x23')]);router[_0x6878('0x21')](_0x6878('0x14'),auth['isAuthenticated'](),controller[_0x6878('0x24')]);router[_0x6878('0x21')](_0x6878('0x1e'),auth[_0x6878('0x9')](),controller['removeLists']);router['delete'](_0x6878('0x25'),auth[_0x6878('0x9')](),controller[_0x6878('0x26')]);module[_0x6878('0x27')]=router; \ No newline at end of file +var _0xe123=['removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','show','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','getBlackLists','post','create','clone','addTeams','/:id/users','addAgents','addLists','/:id/blacklists','update','delete','destroy','removeTeams','removeAgents'];(function(_0x5da22d,_0x82c6e7){var _0x362c6a=function(_0x1697eb){while(--_0x1697eb){_0x5da22d['push'](_0x5da22d['shift']());}};_0x362c6a(++_0x82c6e7);}(_0xe123,0x1cf));var _0x3e12=function(_0x4f6bb7,_0x10f082){_0x4f6bb7=_0x4f6bb7-0x0;var _0x1c8afb=_0xe123[_0x4f6bb7];return _0x1c8afb;};'use strict';var multer=require(_0x3e12('0x0'));var util=require(_0x3e12('0x1'));var path=require(_0x3e12('0x2'));var timeout=require(_0x3e12('0x3'));var express=require(_0x3e12('0x4'));var router=express[_0x3e12('0x5')]();var auth=require(_0x3e12('0x6'));var interaction=require(_0x3e12('0x7'));var config=require(_0x3e12('0x8'));var controller=require(_0x3e12('0x9'));router[_0x3e12('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e12('0xb')]);router['get'](_0x3e12('0xc'),auth['isAuthenticated'](),controller[_0x3e12('0xd')]);router['get']('/:id/hoppers',auth[_0x3e12('0xe')](),controller[_0x3e12('0xf')]);router[_0x3e12('0xa')](_0x3e12('0x10'),auth['isAuthenticated'](),controller[_0x3e12('0x11')]);router[_0x3e12('0xa')](_0x3e12('0x12'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x13')]);router[_0x3e12('0xa')](_0x3e12('0x14'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x15')]);router['get'](_0x3e12('0x16'),auth['isAuthenticated'](),controller[_0x3e12('0x17')]);router[_0x3e12('0xa')]('/:id/users',auth[_0x3e12('0xe')](),controller[_0x3e12('0x18')]);router[_0x3e12('0xa')](_0x3e12('0x19'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x1a')]);router['get'](_0x3e12('0x1b'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x1c')]);router[_0x3e12('0xa')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x3e12('0x1d')]);router[_0x3e12('0x1e')]('/',auth[_0x3e12('0xe')](),controller[_0x3e12('0x1f')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x3e12('0x20')]);router[_0x3e12('0x1e')](_0x3e12('0x16'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x21')]);router[_0x3e12('0x1e')](_0x3e12('0x22'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x23')]);router[_0x3e12('0x1e')](_0x3e12('0x1b'),auth['isAuthenticated'](),controller[_0x3e12('0x24')]);router['post'](_0x3e12('0x25'),auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0x3e12('0xc'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x26')]);router[_0x3e12('0x27')]('/:id',auth[_0x3e12('0xe')](),controller[_0x3e12('0x28')]);router[_0x3e12('0x27')](_0x3e12('0x16'),auth['isAuthenticated'](),controller[_0x3e12('0x29')]);router[_0x3e12('0x27')](_0x3e12('0x22'),auth['isAuthenticated'](),controller[_0x3e12('0x2a')]);router[_0x3e12('0x27')](_0x3e12('0x1b'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x2b')]);router['delete'](_0x3e12('0x25'),auth[_0x3e12('0xe')](),controller[_0x3e12('0x2c')]);module[_0x3e12('0x2d')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 68ff38e..c7cd9b8 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 _0xca26=['UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','name','inbound','default','ENUM','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','ringall','getDataValue','strategy','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview'];(function(_0x3add71,_0x2c0872){var _0x1204bc=function(_0x2f76eb){while(--_0x2f76eb){_0x3add71['push'](_0x3add71['shift']());}};_0x1204bc(++_0x2c0872);}(_0xca26,0x1bf));var _0x6ca2=function(_0x23a874,_0x2dab2f){_0x23a874=_0x23a874-0x0;var _0x1d9263=_0xca26[_0x23a874];return _0x1d9263;};'use strict';var Sequelize=require(_0x6ca2('0x0'));module[_0x6ca2('0x1')]={'name':{'type':Sequelize[_0x6ca2('0x2')],'allowNull':![],'unique':_0x6ca2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x6ca2('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x6ca2('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x6ca2('0x5')},'announce':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x6ca2('0x6')]('rr','ringall',_0x6ca2('0x7'),_0x6ca2('0x8'),_0x6ca2('0x9'),_0x6ca2('0xa'),_0x6ca2('0xb'),_0x6ca2('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x6ca2('0xd'),'set':function(_0x17b943){this['setDataValue']('strategy',_0x17b943?_0x17b943:_0x6ca2('0xa'));},'get':function(){var _0x1ca4c7=this['getDataValue']('type');var _0x189870=this[_0x6ca2('0xe')]('dialMethod');var _0x54f5ab=this[_0x6ca2('0xe')](_0x6ca2('0xf'));if(_0x1ca4c7===_0x6ca2('0x4')){return _0x54f5ab;}if(_0x189870===_0x6ca2('0x10')&&_0x54f5ab==='rrmemory'||_0x189870==='booked'&&_0x54f5ab===_0x6ca2('0x11')){return _0x54f5ab;}if(_0x189870===_0x6ca2('0x12')||_0x189870===_0x6ca2('0x13')||_0x189870===_0x6ca2('0x14')){return _0x54f5ab;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x6ca2('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6ca2('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6ca2('0x2')]},'weight':{'type':Sequelize[_0x6ca2('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no'),'defaultValue':_0x6ca2('0x16')},'autopause':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no',_0x6ca2('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x6ca2('0x6')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x6ca2('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6ca2('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6ca2('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x6ca2('0x16'),'no'),'defaultValue':_0x6ca2('0x16')},'announce_holdtime':{'type':Sequelize[_0x6ca2('0x6')]('yes','no',_0x6ca2('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x6ca2('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x6ca2('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x6ca2('0x2')]},'queue_youarenext':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6ca2('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x6ca2('0x2')]},'queue_quantity2':{'type':Sequelize[_0x6ca2('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x6ca2('0x2')]},'periodic_announce':{'type':Sequelize[_0x6ca2('0x19')],'set':function(_0x5cc4dd){this[_0x6ca2('0x1a')]('periodic_announce',_0x5cc4dd?_0x5cc4dd[_0x6ca2('0x1b')](','):[]);},'get':function(){return this[_0x6ca2('0xe')]('periodic_announce')?this[_0x6ca2('0xe')]('periodic_announce')[_0x6ca2('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':'yes','set':function(_0x116ff4){this[_0x6ca2('0x1a')](_0x6ca2('0x1d'),_0x116ff4?_0x116ff4[_0x6ca2('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x6ca2('0x1d'))?this[_0x6ca2('0xe')](_0x6ca2('0x1d'))[_0x6ca2('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5a0488){this[_0x6ca2('0x1a')](_0x6ca2('0x1e'),_0x5a0488?_0x5a0488[_0x6ca2('0x1b')](','):[]);},'get':function(){return this[_0x6ca2('0xe')]('leavewhenempty')?this[_0x6ca2('0xe')](_0x6ca2('0x1e'))[_0x6ca2('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x6ca2('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x6ca2('0x2')]},'description':{'type':Sequelize[_0x6ca2('0x2')]},'acw':{'type':Sequelize[_0x6ca2('0x1f')],'defaultValue':0x0,'set':function(_0x5ee2c0){this[_0x6ca2('0x1a')](_0x6ca2('0x20'),_0x5ee2c0);if(_0x5ee2c0){if(this[_0x6ca2('0xe')](_0x6ca2('0x21'))<0x2){this[_0x6ca2('0x1a')](_0x6ca2('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6ca2('0x22')},'dialMethod':{'type':Sequelize['ENUM'](_0x6ca2('0x23'),_0x6ca2('0x12'),_0x6ca2('0x14'),_0x6ca2('0x13'),_0x6ca2('0x10')),'defaultValue':_0x6ca2('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x6ca2('0x15')](0x4)[_0x6ca2('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6ca2('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x6ca2('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6ca2('0x26')},'dialPowerLevel':{'type':Sequelize[_0x6ca2('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6ca2('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x29'),_0x6ca2('0x2a')),'defaultValue':_0x6ca2('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6ca2('0x27')](0x2)[_0x6ca2('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6ca2('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x6ca2('0x15')](0x3)[_0x6ca2('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x6ca2('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6ca2('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x6ca2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6ca2('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':_0x6ca2('0x2e'),'comment':_0x6ca2('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6ca2('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6ca2('0x30')},'dialQueueProject':{'type':Sequelize[_0x6ca2('0x2')],'comment':_0x6ca2('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6ca2('0x15')](0x3)[_0x6ca2('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6ca2('0x15')](0x5)[_0x6ca2('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6ca2('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6ca2('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6ca2('0x15')](0x5)[_0x6ca2('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6ca2('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6ca2('0x15')](0x3)[_0x6ca2('0x24')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6ca2('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x6ca2('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6ca2('0x35')},'dialTimezone':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':_0x6ca2('0x36')},'dialPrefix':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x6ca2('0x6')](_0x6ca2('0x37'),_0x6ca2('0x38'),_0x6ca2('0x39')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6ca2('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6ca2('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x6ca2('0x15')](0x9)[_0x6ca2('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6ca2('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6ca2('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6ca2('0x15')](0x9)[_0x6ca2('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6ca2('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6ca2('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6ca2('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6ca2('0x15')](0x9)[_0x6ca2('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6ca2('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6ca2('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6ca2('0x15')](0x5)[_0x6ca2('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6ca2('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6ca2('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x6ca2('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x6ca2('0x6')]('DESC',_0x6ca2('0x40')),'defaultValue':_0x6ca2('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x6ca2('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x6ca2('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6ca2('0x15')](0x3)[_0x6ca2('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6ca2('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ca2('0x15')],'allowNull':!![],'comment':_0x6ca2('0x43')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3943af){if(!_0x3943af)this[_0x6ca2('0x1a')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x6ca2('0x44'),_0x3943af);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x6ca2('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x22e8=['Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','inbound','outbound','default','ENUM','ringall','leastrecent','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','progressive','predictive','power','INTEGER','yes','all','once','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x22e8,0xb0));var _0x822e=function(_0x1fae25,_0x11d6d8){_0x1fae25=_0x1fae25-0x0;var _0x25e66b=_0x22e8[_0x1fae25];return _0x25e66b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x822e('0x0')],'allowNull':![],'unique':_0x822e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x822e('0x2'),_0x822e('0x3')),'allowNull':![],'defaultValue':_0x822e('0x2')},'musiconhold':{'type':Sequelize[_0x822e('0x0')],'defaultValue':_0x822e('0x4')},'announce':{'type':Sequelize[_0x822e('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x822e('0x5')]('rr',_0x822e('0x6'),_0x822e('0x7'),'fewestcalls',_0x822e('0x8'),_0x822e('0x9'),_0x822e('0xa'),_0x822e('0xb'),_0x822e('0xc')),'allowNull':![],'defaultValue':_0x822e('0x6'),'set':function(_0x2f411e){this[_0x822e('0xd')]('strategy',_0x2f411e?_0x2f411e:_0x822e('0x9'));},'get':function(){var _0x3a00b1=this[_0x822e('0xe')](_0x822e('0xf'));var _0x2ca36d=this['getDataValue'](_0x822e('0x10'));var _0x274ca0=this[_0x822e('0xe')](_0x822e('0x11'));if(_0x3a00b1==='inbound'){return _0x274ca0;}if(_0x2ca36d===_0x822e('0x12')&&_0x274ca0===_0x822e('0x9')||_0x2ca36d===_0x822e('0x12')&&_0x274ca0==='roundrobin'){return _0x274ca0;}if(_0x2ca36d===_0x822e('0x13')||_0x2ca36d===_0x822e('0x14')||_0x2ca36d===_0x822e('0x15')){return _0x274ca0;}return null;}},'servicelevel':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x822e('0x16')](0xb)},'timeout':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x822e('0x0')]},'weight':{'type':Sequelize[_0x822e('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':_0x822e('0x17')},'autopause':{'type':Sequelize[_0x822e('0x5')]('yes','no',_0x822e('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x822e('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x822e('0x5')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x822e('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':_0x822e('0x17')},'announce_holdtime':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no',_0x822e('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x822e('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x822e('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x822e('0x0')]},'queue_youarenext':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x822e('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x822e('0x0')]},'queue_quantity1':{'type':Sequelize[_0x822e('0x0')]},'queue_quantity2':{'type':Sequelize[_0x822e('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x822e('0x0')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2a73c1){this[_0x822e('0xd')]('periodic_announce',_0x2a73c1?_0x2a73c1[_0x822e('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0x822e('0x1b'))?this['getDataValue'](_0x822e('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x822e('0x0')],'defaultValue':_0x822e('0x17'),'set':function(_0x1e85df){this[_0x822e('0xd')]('joinempty',_0x1e85df?_0x1e85df[_0x822e('0x1a')](','):[]);},'get':function(){return this[_0x822e('0xe')](_0x822e('0x1c'))?this[_0x822e('0xe')](_0x822e('0x1c'))[_0x822e('0x1d')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x822e('0x0')],'defaultValue':'no','set':function(_0x209d00){this['setDataValue'](_0x822e('0x1e'),_0x209d00?_0x209d00[_0x822e('0x1a')](','):[]);},'get':function(){return this[_0x822e('0xe')](_0x822e('0x1e'))?this[_0x822e('0xe')](_0x822e('0x1e'))['split'](','):[];}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x822e('0x0')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x822e('0x1f')],'defaultValue':0x0,'set':function(_0x75b0e3){this['setDataValue'](_0x822e('0x20'),_0x75b0e3);if(_0x75b0e3){if(this[_0x822e('0xe')](_0x822e('0x21'))<0x2){this[_0x822e('0xd')](_0x822e('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x822e('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x822e('0x1f')],'defaultValue':0x0,'comment':_0x822e('0x22')},'dialMethod':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x23'),'progressive',_0x822e('0x15'),_0x822e('0x14'),_0x822e('0x12')),'defaultValue':_0x822e('0x13'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x822e('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x822e('0x25')},'dialLimitQueue':{'type':Sequelize[_0x822e('0x16')](0x4)[_0x822e('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x822e('0x26')},'dialPowerLevel':{'type':Sequelize[_0x822e('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x822e('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x822e('0x5')](_0x822e('0x29'),_0x822e('0x2a')),'defaultValue':_0x822e('0x2a'),'comment':_0x822e('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x822e('0x27')](0x2)[_0x822e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x822e('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x822e('0x16')](0x3)[_0x822e('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x822e('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x822e('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x822e('0x16')](0x3)[_0x822e('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x822e('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x822e('0x0')],'defaultValue':_0x822e('0x2e'),'comment':_0x822e('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x822e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x822e('0x30')},'dialQueueProject':{'type':Sequelize[_0x822e('0x0')],'comment':_0x822e('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x822e('0x16')](0x3)[_0x822e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x822e('0x16')](0x5)[_0x822e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x822e('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x822e('0x16')](0x3)[_0x822e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x822e('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x822e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x822e('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x822e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x822e('0x16')](0x5)[_0x822e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x822e('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x822e('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x822e('0x36')},'dialTimezone':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x822e('0x0')],'defaultValue':_0x822e('0x37')},'dialPrefix':{'type':Sequelize[_0x822e('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x822e('0x38'),_0x822e('0x39'),_0x822e('0x3a')),'defaultValue':_0x822e('0x38')},'dialAMDActive':{'type':Sequelize[_0x822e('0x1f')],'defaultValue':0x0,'comment':_0x822e('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x822e('0x16')](0x9)[_0x822e('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x822e('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x822e('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x822e('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x822e('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x822e('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x822e('0x16')](0x9)[_0x822e('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x822e('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x822e('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x822e('0x16')](0x9)[_0x822e('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x822e('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x822e('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x822e('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x822e('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x822e('0x16')](0x5)[_0x822e('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x822e('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x822e('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x822e('0x44'),_0x822e('0x45')),'defaultValue':_0x822e('0x44')},'dialQueueProject2':{'type':Sequelize[_0x822e('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x822e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x822e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x822e('0x16')](0x3)[_0x822e('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x822e('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x822e('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x822e('0x1f')],'defaultValue':![],'comment':_0x822e('0x46'),'set':function(_0x55fe86){if(!_0x55fe86)this[_0x822e('0xd')](_0x822e('0x47'),null);this[_0x822e('0xd')](_0x822e('0x48'),_0x55fe86);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x822e('0x16')](0x3)[_0x822e('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x822e('0x24')],'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 c8b53ef..e35c911 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 _0x6b24=['field','options','count','findAll','rows','includeAll','include','catch','create','body','user','role','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','destroy','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','order','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','Agents','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','interface','voicePause','forEach','emit','userVoiceQueue:save','ids','select','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','push','isNil','SIP/%s','all','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','ContactId','ListId','phone','NOW()','scheduledAt','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','fromQuery','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','VoiceQueues','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','end','error','stack','send','VoiceQueue','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','key'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6b24,0x1ce));var _0x46b2=function(_0x38eb22,_0x458a8c){_0x38eb22=_0x38eb22-0x0;var _0x49553e=_0x6b24[_0x38eb22];return _0x49553e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x46b2('0x0'));var rimraf=require(_0x46b2('0x1'));var zipdir=require(_0x46b2('0x2'));var jsonpatch=require(_0x46b2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x46b2('0x4'));var util=require('util');var path=require(_0x46b2('0x5'));var sox=require('sox');var csv=require(_0x46b2('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x46b2('0x7'));var crypto=require(_0x46b2('0x8'));var jsforce=require(_0x46b2('0x9'));var deskjs=require(_0x46b2('0xa'));var toCsv=require(_0x46b2('0x6'));var querystring=require(_0x46b2('0xb'));var Papa=require(_0x46b2('0xc'));var Redis=require(_0x46b2('0xd'));var authService=require(_0x46b2('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x46b2('0xf'))(_0x46b2('0x10'));var utils=require(_0x46b2('0x11'));var config=require('../../config/environment');var db=require(_0x46b2('0x12'))['db'];config[_0x46b2('0x13')]=_[_0x46b2('0x14')](config['redis'],{'host':_0x46b2('0x15'),'port':0x18eb});var socket=require(_0x46b2('0x16'))(new Redis(config[_0x46b2('0x13')]));require(_0x46b2('0x17'))[_0x46b2('0x18')](socket);function respondWithStatusCode(_0x1cf0f0,_0x3ff25d){_0x3ff25d=_0x3ff25d||0xcc;return function(_0x228261){if(_0x228261){return _0x1cf0f0[_0x46b2('0x19')](_0x3ff25d);}return _0x1cf0f0[_0x46b2('0x1a')](_0x3ff25d)['end']();};}function respondWithResult(_0x43e0d9,_0x5b49da){_0x5b49da=_0x5b49da||0xc8;return function(_0x49479c){if(_0x49479c){return _0x43e0d9[_0x46b2('0x1a')](_0x5b49da)[_0x46b2('0x1b')](_0x49479c);}};}function respondWithFilteredResult(_0xe3d3d9,_0x3c62c6){return function(_0x373c49){if(_0x373c49){var _0x1497d6=_0x373c49['count'],_0x226ab5=_0x3c62c6[_0x46b2('0x1c')],_0x5bd251=_0x3c62c6[_0x46b2('0x1c')]+_0x3c62c6[_0x46b2('0x1d')],_0x316c39;if(_0x5bd251>=_0x1497d6){_0x5bd251=_0x1497d6;_0x316c39=0xc8;}else{_0x316c39=0xce;}_0xe3d3d9['status'](_0x316c39);return _0xe3d3d9[_0x46b2('0x1e')](_0x46b2('0x1f'),_0x226ab5+'-'+_0x5bd251+'/'+_0x1497d6)[_0x46b2('0x1b')](_0x373c49);}return null;};}function patchUpdates(_0x1e5c35){return function(_0x350f85){try{jsonpatch[_0x46b2('0x20')](_0x350f85,_0x1e5c35,!![]);}catch(_0x3a0ea5){return BPromise[_0x46b2('0x21')](_0x3a0ea5);}return _0x350f85[_0x46b2('0x22')]();};}function saveUpdates(_0x259f2f,_0x29ade9){return function(_0x1b5fbe){if(_0x1b5fbe){return _0x1b5fbe[_0x46b2('0x23')](_0x259f2f)[_0x46b2('0x24')](function(_0x1caa77){return _0x1caa77;});}return null;};}function removeEntity(_0x50011b,_0x209519){return function(_0x4c2983){if(_0x4c2983){return _0x4c2983['destroy']()[_0x46b2('0x24')](function(){var _0x310a77=_0x4c2983[_0x46b2('0x25')]({'plain':!![]});var _0x134526=[{'name':_0x46b2('0x26'),'value':'inbound','ignore':![]},{'name':_0x46b2('0x27'),'value':_0x46b2('0x28'),'ignore':![]}];var _0x5ca1c7=_(_0x134526)[_0x46b2('0x29')]('ignore')[_0x46b2('0x2a')](_0x46b2('0x2b'))[_0x46b2('0x2b')]();if(_[_0x46b2('0x2c')](_0x5ca1c7,_0x310a77[_0x46b2('0x2d')])){return;}var _0x364048=_[_0x46b2('0x2e')](_0x134526,[_0x46b2('0x2b'),_0x310a77[_0x46b2('0x2d')]])[_0x46b2('0x2f')];return db['UserProfileResource']['destroy']({'where':{'type':_0x364048,'resourceId':_0x310a77['id']}})['then'](function(){return _0x4c2983;});})[_0x46b2('0x24')](function(){_0x50011b[_0x46b2('0x1a')](0xcc)[_0x46b2('0x30')]();});}};}function handleEntityNotFound(_0x58fd96,_0x3ae316){return function(_0x8f0c46){if(!_0x8f0c46){_0x58fd96['sendStatus'](0x194);}return _0x8f0c46;};}function handleError(_0x37282e,_0x16ecc1){_0x16ecc1=_0x16ecc1||0x1f4;return function(_0x11de37){logger[_0x46b2('0x31')](_0x11de37[_0x46b2('0x32')]);if(_0x11de37[_0x46b2('0x2f')]){delete _0x11de37[_0x46b2('0x2f')];}_0x37282e[_0x46b2('0x1a')](_0x16ecc1)[_0x46b2('0x33')](_0x11de37);};}exports['index']=function(_0x293310,_0x457223){var _0x98db11={},_0x4e4ca4={},_0x6af9d2={'count':0x0,'rows':[]};var _0x2bee45=db[_0x46b2('0x34')][_0x46b2('0x35')];_0x4e4ca4['model']=_[_0x46b2('0x36')](_0x2bee45);_0x4e4ca4['query']=_[_0x46b2('0x36')](_0x293310[_0x46b2('0x37')]);_0x4e4ca4[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x4e4ca4[_0x46b2('0x3a')],_0x4e4ca4[_0x46b2('0x37')]);_0x98db11[_0x46b2('0x3b')]=_['intersection'](_0x4e4ca4[_0x46b2('0x3a')],qs[_0x46b2('0x3c')](_0x293310[_0x46b2('0x37')][_0x46b2('0x3c')]));_0x98db11[_0x46b2('0x3b')]=_0x98db11[_0x46b2('0x3b')][_0x46b2('0x3d')]?_0x98db11['attributes']:_0x4e4ca4['model'];if(!_0x293310['query'][_0x46b2('0x3e')](_0x46b2('0x3f'))){_0x98db11['limit']=qs[_0x46b2('0x1d')](_0x293310['query']['limit']);_0x98db11[_0x46b2('0x1c')]=qs[_0x46b2('0x1c')](_0x293310[_0x46b2('0x37')][_0x46b2('0x1c')]);}_0x98db11['order']=qs[_0x46b2('0x40')](_0x293310['query']['sort']);_0x98db11['where']=qs[_0x46b2('0x38')](_[_0x46b2('0x41')](_0x293310[_0x46b2('0x37')],_0x4e4ca4['filters']));if(_0x293310[_0x46b2('0x37')]['filter']){_0x98db11[_0x46b2('0x42')]=_[_0x46b2('0x43')](_0x98db11['where'],{'$or':_[_0x46b2('0x2a')](_0x2bee45,function(_0x557df0){if(_0x557df0['type'][_0x46b2('0x44')]!=='VIRTUAL'){var _0x22c896={};_0x22c896[_0x557df0[_0x46b2('0x45')]]={'$like':'%'+_0x293310[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0x22c896;}})});}_0x98db11=_['merge']({},_0x98db11,_0x293310[_0x46b2('0x46')]);var _0x13343e={'where':_0x98db11[_0x46b2('0x42')]};return db['VoiceQueue']['count'](_0x13343e)[_0x46b2('0x24')](function(_0x1b3867){_0x6af9d2[_0x46b2('0x47')]=_0x1b3867;if(_0x293310[_0x46b2('0x37')]['includeAll']){_0x98db11['include']=[{'all':!![]}];}return db[_0x46b2('0x34')][_0x46b2('0x48')](_0x98db11);})[_0x46b2('0x24')](function(_0x46ebfc){_0x6af9d2[_0x46b2('0x49')]=_0x46ebfc;return _0x6af9d2;})[_0x46b2('0x24')](respondWithFilteredResult(_0x457223,_0x98db11))['catch'](handleError(_0x457223,null));};exports['show']=function(_0x39a45c,_0x2205bc){var _0x21efe8={'raw':![],'where':{'id':_0x39a45c['params']['id']}},_0x435e55={};_0x435e55[_0x46b2('0x3a')]=_[_0x46b2('0x36')](db[_0x46b2('0x34')][_0x46b2('0x35')]);_0x435e55['query']=_[_0x46b2('0x36')](_0x39a45c[_0x46b2('0x37')]);_0x435e55[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x435e55[_0x46b2('0x3a')],_0x435e55[_0x46b2('0x37')]);_0x21efe8[_0x46b2('0x3b')]=_['intersection'](_0x435e55[_0x46b2('0x3a')],qs[_0x46b2('0x3c')](_0x39a45c['query'][_0x46b2('0x3c')]));_0x21efe8['attributes']=_0x21efe8[_0x46b2('0x3b')]['length']?_0x21efe8[_0x46b2('0x3b')]:_0x435e55[_0x46b2('0x3a')];if(_0x39a45c['query'][_0x46b2('0x4a')]){_0x21efe8[_0x46b2('0x4b')]=[{'all':!![]}];}_0x21efe8=_['merge']({},_0x21efe8,_0x39a45c['options']);return db[_0x46b2('0x34')]['find'](_0x21efe8)[_0x46b2('0x24')](handleEntityNotFound(_0x2205bc,null))['then'](respondWithResult(_0x2205bc,null))[_0x46b2('0x4c')](handleError(_0x2205bc,null));};exports[_0x46b2('0x4d')]=function(_0x124516,_0x1fc13c){return db[_0x46b2('0x34')][_0x46b2('0x4d')](_0x124516[_0x46b2('0x4e')],{})[_0x46b2('0x24')](function(_0x1d19a2){var _0x310769=_0x124516[_0x46b2('0x4f')][_0x46b2('0x25')]({'plain':!![]});if(!_0x310769)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x310769[_0x46b2('0x50')]===_0x46b2('0x4f')){var _0x4eb8f4=_0x1d19a2[_0x46b2('0x25')]({'plain':!![]});var _0x5012ac=[{'name':_0x46b2('0x26'),'value':_0x46b2('0x51')},{'name':_0x46b2('0x27'),'value':_0x46b2('0x28')}];var _0x2225cf=_[_0x46b2('0x2e')](_0x5012ac,[_0x46b2('0x2b'),_0x4eb8f4[_0x46b2('0x2d')]])[_0x46b2('0x2f')];return db[_0x46b2('0x52')]['find']({'where':{'name':_0x2225cf,'userProfileId':_0x310769[_0x46b2('0x53')]},'raw':!![]})['then'](function(_0x4eda21){if(_0x4eda21&&_0x4eda21[_0x46b2('0x54')]===0x0){return db[_0x46b2('0x55')]['create']({'name':_0x4eb8f4[_0x46b2('0x2f')],'resourceId':_0x4eb8f4['id'],'type':_0x4eda21[_0x46b2('0x2f')],'sectionId':_0x4eda21['id']},{})[_0x46b2('0x24')](function(){return _0x1d19a2;});}else{return _0x1d19a2;}})[_0x46b2('0x4c')](function(_0x24ead5){logger[_0x46b2('0x31')](_0x46b2('0x56'),_0x24ead5);throw _0x24ead5;});}return _0x1d19a2;})[_0x46b2('0x24')](respondWithResult(_0x1fc13c,0xc9))[_0x46b2('0x4c')](handleError(_0x1fc13c,null));};exports['clone']=function(_0x2f5e28,_0x2b9042){var _0x322723={'raw':![],'where':{'id':_0x2f5e28[_0x46b2('0x57')]['id']}},_0xe1d839={};_0xe1d839[_0x46b2('0x3a')]=_['keys'](db[_0x46b2('0x34')][_0x46b2('0x35')]);_0x322723['attributes']=_[_0x46b2('0x39')](_0xe1d839[_0x46b2('0x3a')],qs['fields'](_0x2f5e28['query'][_0x46b2('0x3c')]));_0x322723[_0x46b2('0x3b')]=_0x322723[_0x46b2('0x3b')]['length']?_0x322723['attributes']:_0xe1d839[_0x46b2('0x3a')];if(_0x2f5e28[_0x46b2('0x37')][_0x46b2('0x4a')]){_0x322723['include']=[{'all':!![]}];}_0x322723=_[_0x46b2('0x43')]({},_0x322723,_0x2f5e28[_0x46b2('0x46')]);return db[_0x46b2('0x34')][_0x46b2('0x2e')](_0x322723)[_0x46b2('0x24')](handleEntityNotFound(_0x2b9042,null))[_0x46b2('0x24')](function(_0x49d2d7){if(_0x49d2d7){var _0x4ed26d=_0x49d2d7[_0x46b2('0x25')]({'plain':!![]});_0x4ed26d=qs['omit'](_0x4ed26d,['id',_0x46b2('0x58'),_0x46b2('0x59')]);_0x2f5e28[_0x46b2('0x4e')]=_[_0x46b2('0x5a')](_0x2f5e28[_0x46b2('0x4e')],['id',_0x46b2('0x58'),_0x46b2('0x59')]);return db[_0x46b2('0x34')][_0x46b2('0x4d')](_[_0x46b2('0x43')](_0x4ed26d,_0x2f5e28[_0x46b2('0x4e')]),{'include':_0x2f5e28['query'][_0x46b2('0x4a')]?[{'all':!![]}]:undefined})[_0x46b2('0x24')](function(_0x11e778){var _0x5c2546=_0x2f5e28['user'][_0x46b2('0x25')]({'plain':!![]});if(!_0x5c2546)throw new Error(_0x46b2('0x5b'));if(_0x5c2546['role']===_0x46b2('0x4f')){var _0x18322c=_0x11e778['get']({'plain':!![]});var _0x215526=[{'name':'VoiceQueues','value':_0x46b2('0x51')},{'name':_0x46b2('0x27'),'value':_0x46b2('0x28')}];var _0x1698ba=_[_0x46b2('0x2e')](_0x215526,[_0x46b2('0x2b'),_0x18322c['type']])[_0x46b2('0x2f')];return db[_0x46b2('0x52')][_0x46b2('0x2e')]({'where':{'name':_0x1698ba,'userProfileId':_0x5c2546[_0x46b2('0x53')]},'raw':!![]})[_0x46b2('0x24')](function(_0x36ea00){if(_0x36ea00&&_0x36ea00[_0x46b2('0x54')]===0x0){return db[_0x46b2('0x55')]['create']({'name':_0x18322c[_0x46b2('0x2f')],'resourceId':_0x18322c['id'],'type':_0x36ea00['name'],'sectionId':_0x36ea00['id']},{})['then'](function(){return _0x11e778;});}else{return _0x11e778;}})['catch'](function(_0xe1eebd){logger[_0x46b2('0x31')](_0x46b2('0x56'),_0xe1eebd);throw _0xe1eebd;});}return _0x11e778;});}})['then'](respondWithResult(_0x2b9042,0xc9))[_0x46b2('0x4c')](handleError(_0x2b9042,null));};exports[_0x46b2('0x23')]=function(_0x5cf1d0,_0x10e060){if(_0x5cf1d0[_0x46b2('0x4e')]['id']){delete _0x5cf1d0[_0x46b2('0x4e')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x5cf1d0['params']['id']}})['then'](handleEntityNotFound(_0x10e060,null))[_0x46b2('0x24')](saveUpdates(_0x5cf1d0['body'],null))[_0x46b2('0x24')](respondWithResult(_0x10e060,null))[_0x46b2('0x4c')](handleError(_0x10e060,null));};exports[_0x46b2('0x5c')]=function(_0x578368,_0x136007){return db[_0x46b2('0x34')][_0x46b2('0x2e')]({'where':{'id':_0x578368[_0x46b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x136007,null))['then'](removeEntity(_0x136007,null))[_0x46b2('0x4c')](handleError(_0x136007,null));};exports[_0x46b2('0x5d')]=function(_0x5a701e,_0x3c09ac,_0x2c7817){var _0x58bccc={'raw':![],'where':{}};var _0x3d547f={};var _0x526605={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x46b2('0x5e')]({'where':{'id':_0x5a701e[_0x46b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x3c09ac,null))[_0x46b2('0x24')](function(_0x3c7dff){if(_0x3c7dff){_0x3d547f[_0x46b2('0x3a')]=_[_0x46b2('0x36')](db[_0x46b2('0x5f')][_0x46b2('0x35')]);_0x3d547f[_0x46b2('0x37')]=_[_0x46b2('0x36')](_0x5a701e[_0x46b2('0x37')]);_0x3d547f[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x3d547f[_0x46b2('0x3a')],_0x3d547f['query']);_0x58bccc[_0x46b2('0x3b')]=_[_0x46b2('0x39')](_0x3d547f['model'],qs[_0x46b2('0x3c')](_0x5a701e[_0x46b2('0x37')][_0x46b2('0x3c')]));_0x58bccc[_0x46b2('0x3b')]=_0x58bccc[_0x46b2('0x3b')][_0x46b2('0x3d')]?_0x58bccc['attributes']:_0x3d547f[_0x46b2('0x3a')];if(!_0x5a701e[_0x46b2('0x37')][_0x46b2('0x3e')](_0x46b2('0x3f'))){_0x58bccc['limit']=qs[_0x46b2('0x1d')](_0x5a701e['query'][_0x46b2('0x1d')]);_0x58bccc[_0x46b2('0x1c')]=qs['offset'](_0x5a701e[_0x46b2('0x37')]['offset']);}_0x58bccc['order']=qs[_0x46b2('0x40')](_0x5a701e[_0x46b2('0x37')]['sort']);_0x58bccc[_0x46b2('0x42')]=qs[_0x46b2('0x38')](_['pick'](_0x5a701e[_0x46b2('0x37')],_0x3d547f[_0x46b2('0x38')]));_0x58bccc['where'][_0x46b2('0x60')]=_0x3c7dff['id'];if(_0x5a701e[_0x46b2('0x37')][_0x46b2('0x29')]){_0x58bccc[_0x46b2('0x42')]=_[_0x46b2('0x43')](_0x58bccc[_0x46b2('0x42')],{'$or':_[_0x46b2('0x2a')](_0x58bccc[_0x46b2('0x3b')],function(_0x33145a){var _0x5105b6={};_0x5105b6[_0x33145a]={'$like':'%'+_0x5a701e[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0x5105b6;})});}_0x58bccc=_[_0x46b2('0x43')]({},_0x58bccc,_0x5a701e['options']);return db[_0x46b2('0x5f')]['count']({'where':_0x58bccc['where']})[_0x46b2('0x24')](function(_0x311ecb){_0x526605[_0x46b2('0x47')]=_0x311ecb;if(_0x5a701e[_0x46b2('0x37')][_0x46b2('0x4a')]){_0x58bccc[_0x46b2('0x4b')]=[{'all':!![]}];}return db[_0x46b2('0x5f')][_0x46b2('0x48')](_0x58bccc);})[_0x46b2('0x24')](function(_0x2fd7aa){_0x526605[_0x46b2('0x49')]=_0x2fd7aa;return _0x526605;});}})[_0x46b2('0x24')](respondWithFilteredResult(_0x3c09ac,_0x58bccc))[_0x46b2('0x4c')](handleError(_0x3c09ac,null));};exports[_0x46b2('0x61')]=function(_0x15f5a6,_0x1b8b39,_0x44f3f5){var _0x406f83={'raw':!![],'where':{}};var _0x470e3f={};var _0x556f43={'count':0x0,'rows':[]};return db[_0x46b2('0x34')][_0x46b2('0x5e')]({'where':{'id':_0x15f5a6['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x1b8b39,null))[_0x46b2('0x24')](function(_0x5cff91){if(_0x5cff91){_0x470e3f['model']=_[_0x46b2('0x36')](db[_0x46b2('0x62')][_0x46b2('0x35')]);_0x470e3f['query']=_[_0x46b2('0x36')](_0x15f5a6[_0x46b2('0x37')]);_0x470e3f[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x470e3f['model'],_0x470e3f[_0x46b2('0x37')]);_0x406f83['attributes']=_['intersection'](_0x470e3f[_0x46b2('0x3a')],qs['fields'](_0x15f5a6['query']['fields']));_0x406f83['attributes']=_0x406f83['attributes'][_0x46b2('0x3d')]?_0x406f83['attributes']:_0x470e3f[_0x46b2('0x3a')];if(!_0x15f5a6['query'][_0x46b2('0x3e')]('nolimit')){_0x406f83[_0x46b2('0x1d')]=qs[_0x46b2('0x1d')](_0x15f5a6[_0x46b2('0x37')]['limit']);_0x406f83['offset']=qs[_0x46b2('0x1c')](_0x15f5a6[_0x46b2('0x37')][_0x46b2('0x1c')]);}_0x406f83[_0x46b2('0x63')]=qs[_0x46b2('0x40')](_0x15f5a6[_0x46b2('0x37')][_0x46b2('0x40')]);_0x406f83[_0x46b2('0x42')]=qs[_0x46b2('0x38')](_[_0x46b2('0x41')](_0x15f5a6[_0x46b2('0x37')],_0x470e3f[_0x46b2('0x38')]));_0x406f83[_0x46b2('0x42')][_0x46b2('0x60')]=_0x5cff91['id'];if(_0x15f5a6[_0x46b2('0x37')][_0x46b2('0x29')]){_0x406f83[_0x46b2('0x42')]=_['merge'](_0x406f83[_0x46b2('0x42')],{'$or':_[_0x46b2('0x2a')](_0x406f83[_0x46b2('0x3b')],function(_0x1bbd86){var _0x4d82b4={};_0x4d82b4[_0x1bbd86]={'$like':'%'+_0x15f5a6[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0x4d82b4;})});}_0x406f83=_['merge']({},_0x406f83,_0x15f5a6['options']);return db[_0x46b2('0x62')][_0x46b2('0x47')]({'where':_0x406f83[_0x46b2('0x42')]})[_0x46b2('0x24')](function(_0x526b8a){_0x556f43[_0x46b2('0x47')]=_0x526b8a;if(_0x15f5a6[_0x46b2('0x37')][_0x46b2('0x4a')]){_0x406f83[_0x46b2('0x4b')]=[{'all':!![]}];}return db[_0x46b2('0x62')][_0x46b2('0x48')](_0x406f83);})[_0x46b2('0x24')](function(_0x431221){_0x556f43[_0x46b2('0x49')]=_0x431221;return _0x556f43;});}})[_0x46b2('0x24')](respondWithFilteredResult(_0x1b8b39,_0x406f83))[_0x46b2('0x4c')](handleError(_0x1b8b39,null));};exports['getHopperFinals']=function(_0x351954,_0x31bca6,_0x14cfca){var _0x593c9b={'raw':!![],'where':{}};var _0x530d53={};var _0x5ca3cc={'count':0x0,'rows':[]};return db[_0x46b2('0x34')][_0x46b2('0x5e')]({'where':{'id':_0x351954['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x31bca6,null))[_0x46b2('0x24')](function(_0x356728){if(_0x356728){_0x530d53['model']=_['keys'](db[_0x46b2('0x64')]['rawAttributes']);_0x530d53[_0x46b2('0x37')]=_[_0x46b2('0x36')](_0x351954['query']);_0x530d53['filters']=_[_0x46b2('0x39')](_0x530d53[_0x46b2('0x3a')],_0x530d53[_0x46b2('0x37')]);_0x593c9b[_0x46b2('0x3b')]=_['intersection'](_0x530d53[_0x46b2('0x3a')],qs[_0x46b2('0x3c')](_0x351954[_0x46b2('0x37')]['fields']));_0x593c9b[_0x46b2('0x3b')]=_0x593c9b['attributes'][_0x46b2('0x3d')]?_0x593c9b[_0x46b2('0x3b')]:_0x530d53[_0x46b2('0x3a')];if(!_0x351954[_0x46b2('0x37')][_0x46b2('0x3e')](_0x46b2('0x3f'))){_0x593c9b[_0x46b2('0x1d')]=qs[_0x46b2('0x1d')](_0x351954[_0x46b2('0x37')][_0x46b2('0x1d')]);_0x593c9b['offset']=qs[_0x46b2('0x1c')](_0x351954[_0x46b2('0x37')][_0x46b2('0x1c')]);}_0x593c9b[_0x46b2('0x63')]=qs[_0x46b2('0x40')](_0x351954[_0x46b2('0x37')][_0x46b2('0x40')]);_0x593c9b[_0x46b2('0x42')]=qs[_0x46b2('0x38')](_[_0x46b2('0x41')](_0x351954[_0x46b2('0x37')],_0x530d53['filters']));_0x593c9b[_0x46b2('0x42')][_0x46b2('0x60')]=_0x356728['id'];if(_0x351954['query'][_0x46b2('0x29')]){_0x593c9b['where']=_[_0x46b2('0x43')](_0x593c9b[_0x46b2('0x42')],{'$or':_[_0x46b2('0x2a')](_0x593c9b[_0x46b2('0x3b')],function(_0x226082){var _0x309cbb={};_0x309cbb[_0x226082]={'$like':'%'+_0x351954['query']['filter']+'%'};return _0x309cbb;})});}_0x593c9b=_[_0x46b2('0x43')]({},_0x593c9b,_0x351954[_0x46b2('0x46')]);return db[_0x46b2('0x64')][_0x46b2('0x47')]({'where':_0x593c9b[_0x46b2('0x42')]})['then'](function(_0x39ae7a){_0x5ca3cc[_0x46b2('0x47')]=_0x39ae7a;if(_0x351954[_0x46b2('0x37')][_0x46b2('0x4a')]){_0x593c9b['include']=[{'all':!![]}];}return db[_0x46b2('0x64')]['findAll'](_0x593c9b);})[_0x46b2('0x24')](function(_0x14dd45){_0x5ca3cc['rows']=_0x14dd45;return _0x5ca3cc;});}})[_0x46b2('0x24')](respondWithFilteredResult(_0x31bca6,_0x593c9b))[_0x46b2('0x4c')](handleError(_0x31bca6,null));};exports['getHopperBlacks']=function(_0x51c2aa,_0x1e24fc,_0x2090b3){var _0x98b6dd={'raw':!![],'where':{}};var _0x2ff241={};var _0x102f9e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x46b2('0x5e')]({'where':{'id':_0x51c2aa['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x1e24fc,null))[_0x46b2('0x24')](function(_0x519bda){if(_0x519bda){_0x2ff241[_0x46b2('0x3a')]=_[_0x46b2('0x36')](db['CmHopperBlack'][_0x46b2('0x35')]);_0x2ff241[_0x46b2('0x37')]=_[_0x46b2('0x36')](_0x51c2aa[_0x46b2('0x37')]);_0x2ff241[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x2ff241['model'],_0x2ff241[_0x46b2('0x37')]);_0x98b6dd[_0x46b2('0x3b')]=_[_0x46b2('0x39')](_0x2ff241[_0x46b2('0x3a')],qs[_0x46b2('0x3c')](_0x51c2aa['query']['fields']));_0x98b6dd['attributes']=_0x98b6dd[_0x46b2('0x3b')][_0x46b2('0x3d')]?_0x98b6dd[_0x46b2('0x3b')]:_0x2ff241[_0x46b2('0x3a')];if(!_0x51c2aa[_0x46b2('0x37')][_0x46b2('0x3e')](_0x46b2('0x3f'))){_0x98b6dd['limit']=qs[_0x46b2('0x1d')](_0x51c2aa[_0x46b2('0x37')][_0x46b2('0x1d')]);_0x98b6dd[_0x46b2('0x1c')]=qs[_0x46b2('0x1c')](_0x51c2aa['query'][_0x46b2('0x1c')]);}_0x98b6dd[_0x46b2('0x63')]=qs[_0x46b2('0x40')](_0x51c2aa[_0x46b2('0x37')][_0x46b2('0x40')]);_0x98b6dd['where']=qs['filters'](_['pick'](_0x51c2aa[_0x46b2('0x37')],_0x2ff241['filters']));_0x98b6dd[_0x46b2('0x42')][_0x46b2('0x60')]=_0x519bda['id'];if(_0x51c2aa['query']['filter']){_0x98b6dd[_0x46b2('0x42')]=_['merge'](_0x98b6dd[_0x46b2('0x42')],{'$or':_['map'](_0x98b6dd[_0x46b2('0x3b')],function(_0x37e629){var _0x361c70={};_0x361c70[_0x37e629]={'$like':'%'+_0x51c2aa['query'][_0x46b2('0x29')]+'%'};return _0x361c70;})});}_0x98b6dd=_['merge']({},_0x98b6dd,_0x51c2aa[_0x46b2('0x46')]);return db[_0x46b2('0x65')][_0x46b2('0x47')]({'where':_0x98b6dd[_0x46b2('0x42')]})[_0x46b2('0x24')](function(_0x4ef9eb){_0x102f9e['count']=_0x4ef9eb;if(_0x51c2aa[_0x46b2('0x37')][_0x46b2('0x4a')]){_0x98b6dd[_0x46b2('0x4b')]=[{'all':!![]}];}return db[_0x46b2('0x65')][_0x46b2('0x48')](_0x98b6dd);})['then'](function(_0x10c902){_0x102f9e['rows']=_0x10c902;return _0x102f9e;});}})[_0x46b2('0x24')](respondWithFilteredResult(_0x1e24fc,_0x98b6dd))[_0x46b2('0x4c')](handleError(_0x1e24fc,null));};exports[_0x46b2('0x66')]=function(_0x359620,_0x225e26,_0x11f1a3){var _0x44ee5b={};var _0x95ed6={};var _0x4ea4d2;var _0x3c578c;return db['VoiceQueue'][_0x46b2('0x5e')]({'where':{'id':_0x359620['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x225e26,null))['then'](function(_0x2cf272){if(_0x2cf272){_0x4ea4d2=_0x2cf272;_0x95ed6[_0x46b2('0x3a')]=_[_0x46b2('0x36')](db[_0x46b2('0x67')][_0x46b2('0x35')]);_0x95ed6[_0x46b2('0x37')]=_[_0x46b2('0x36')](_0x359620[_0x46b2('0x37')]);_0x95ed6[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x95ed6[_0x46b2('0x3a')],_0x95ed6[_0x46b2('0x37')]);_0x44ee5b[_0x46b2('0x3b')]=_[_0x46b2('0x39')](_0x95ed6['model'],qs[_0x46b2('0x3c')](_0x359620[_0x46b2('0x37')][_0x46b2('0x3c')]));_0x44ee5b[_0x46b2('0x3b')]=_0x44ee5b['attributes'][_0x46b2('0x3d')]?_0x44ee5b[_0x46b2('0x3b')]:_0x95ed6['model'];_0x44ee5b['order']=qs[_0x46b2('0x40')](_0x359620[_0x46b2('0x37')]['sort']);_0x44ee5b[_0x46b2('0x42')]=qs[_0x46b2('0x38')](_[_0x46b2('0x41')](_0x359620['query'],_0x95ed6[_0x46b2('0x38')]));if(_0x359620[_0x46b2('0x37')][_0x46b2('0x29')]){_0x44ee5b[_0x46b2('0x42')]=_[_0x46b2('0x43')](_0x44ee5b[_0x46b2('0x42')],{'$or':_[_0x46b2('0x2a')](_0x44ee5b[_0x46b2('0x3b')],function(_0x46c50c){var _0x1f72a9={};_0x1f72a9[_0x46c50c]={'$like':'%'+_0x359620[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0x1f72a9;})});}_0x44ee5b=_[_0x46b2('0x43')]({},_0x44ee5b,_0x359620[_0x46b2('0x46')]);return _0x4ea4d2[_0x46b2('0x66')](_0x44ee5b);}})[_0x46b2('0x24')](function(_0x87fc2b){if(_0x87fc2b){_0x3c578c=_0x87fc2b['length'];if(!_0x359620['query'][_0x46b2('0x3e')](_0x46b2('0x3f'))){_0x44ee5b[_0x46b2('0x1d')]=qs[_0x46b2('0x1d')](_0x359620['query'][_0x46b2('0x1d')]);_0x44ee5b[_0x46b2('0x1c')]=qs[_0x46b2('0x1c')](_0x359620[_0x46b2('0x37')][_0x46b2('0x1c')]);}return _0x4ea4d2[_0x46b2('0x66')](_0x44ee5b);}})[_0x46b2('0x24')](function(_0x36df7f){if(_0x36df7f){return _0x36df7f?{'count':_0x3c578c,'rows':_0x36df7f}:null;}})['then'](respondWithResult(_0x225e26,null))[_0x46b2('0x4c')](handleError(_0x225e26,null));};exports[_0x46b2('0x68')]=function(_0x2363d0,_0x517653,_0x36022b){var _0x19cfe8=_0x2363d0[_0x46b2('0x4e')][_0x46b2('0x69')];return db[_0x46b2('0x67')][_0x46b2('0x48')]({'where':{'id':_[_0x46b2('0x2a')](_0x19cfe8,'id')},'attributes':['id'],'include':[{'model':db[_0x46b2('0x6a')],'as':'Agents','attributes':['id',_0x46b2('0x2f'),_0x46b2('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0x46b2('0x24')](function(_0x219258){if(_0x219258){var _0x11b124=_['flatMap'](_0x219258,function(_0x318692){var _0x45afa7=_0x318692[_0x46b2('0x25')]({'plain':!![]});_0x45afa7[_0x46b2('0x6c')]['forEach'](function(_0x4cb83e){_0x4cb83e[_0x46b2('0x6d')]=_['find'](_0x19cfe8,{'id':_0x45afa7['id']})[_0x46b2('0x6d')];});return _0x45afa7[_0x46b2('0x6c')];});return db['VoiceQueue'][_0x46b2('0x2e')]({'where':{'id':_0x2363d0[_0x46b2('0x57')]['id']}})[_0x46b2('0x24')](function(_0x2c952e){return db[_0x46b2('0x6e')][_0x46b2('0x6f')](function(_0x3999a0){return _0x2c952e['addTeams'](_['map'](_0x19cfe8,'id'),{'transaction':_0x3999a0})[_0x46b2('0x24')](function(){return BPromise[_0x46b2('0x70')](_0x11b124,function(_0x30af25){return db[_0x46b2('0x71')][_0x46b2('0x72')]({'where':{'UserId':_0x30af25['id'],'VoiceQueueId':_0x2363d0[_0x46b2('0x57')]['id']},'defaults':{'penalty':_0x30af25['penalty']},'transaction':_0x3999a0});});})[_0x46b2('0x24')](function(){return BPromise[_0x46b2('0x70')](_['filter'](_0x11b124,{'online':!![]}),function(_0x51cbc7){return db[_0x46b2('0x73')][_0x46b2('0x74')]({'membername':_0x51cbc7['name'],'UserId':_0x51cbc7['id'],'queue_name':_0x2c952e[_0x46b2('0x2f')],'VoiceQueueId':_0x2c952e['id'],'interface':_['isNil'](_0x51cbc7['interface'])?util[_0x46b2('0x75')]('SIP/%s',_0x51cbc7[_0x46b2('0x2f')]):_0x51cbc7[_0x46b2('0x76')],'paused':_0x51cbc7[_0x46b2('0x77')]||![],'penalty':_0x51cbc7[_0x46b2('0x6d')]},{'transaction':_0x3999a0});});})[_0x46b2('0x24')](function(){_0x11b124[_0x46b2('0x78')](function(_0x10e77a){socket[_0x46b2('0x79')](_0x46b2('0x7a'),{'UserId':_0x10e77a['id'],'VoiceQueueId':_0x2c952e['id']});});});});});}})[_0x46b2('0x24')](respondWithStatusCode(_0x517653,null))[_0x46b2('0x4c')](handleError(_0x517653,null));};exports['removeTeams']=function(_0xbc16ae,_0xcd448a,_0x44eb16){return db[_0x46b2('0x67')][_0x46b2('0x48')]({'where':{'id':_0xbc16ae[_0x46b2('0x37')][_0x46b2('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x46b2('0x6a')],'as':_0x46b2('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x46b2('0x24')](handleEntityNotFound(_0xcd448a,null))[_0x46b2('0x24')](function(_0x1757f9){var _0x13e4d7=_[_0x46b2('0x2a')](_0x1757f9,'id');var _0x232334=[];var _0x1750e9=[];var _0x2bf4fc=squel[_0x46b2('0x7c')]();_0x2bf4fc[_0x46b2('0x45')](_0x46b2('0x7d'))['from']('team_has_voice_queues','tq')[_0x46b2('0x7e')](_0x46b2('0x7f'),'ut',_0x46b2('0x80'))[_0x46b2('0x42')]('VoiceQueueId\x20=\x20?',_0xbc16ae['params']['id']);for(var _0x5b887a=0x0;_0x5b887a<_0x1757f9[_0x46b2('0x3d')];_0x5b887a+=0x1){let _0x4d470f=_0x1757f9[_0x5b887a];for(var _0x11e969=0x0;_0x11e969<_0x4d470f[_0x46b2('0x6c')][_0x46b2('0x3d')];_0x11e969+=0x1){let _0x22e193=_0x4d470f[_0x46b2('0x6c')][_0x11e969];var _0xc2f21e=_0x2bf4fc['clone']();_0xc2f21e[_0x46b2('0x42')](_0x46b2('0x81'),_0x22e193['id']);_0x1750e9['push'](db[_0x46b2('0x6e')][_0x46b2('0x37')](_0xc2f21e[_0x46b2('0x82')](),{'type':db['sequelize'][_0x46b2('0x83')]['SELECT']})[_0x46b2('0x24')](function(_0x12846f){if(_0x12846f[_0x46b2('0x3d')]===0x1){return _0x22e193['id'];}else{var _0x58a5b5=_[_0x46b2('0x84')](_['map'](_0x12846f,_0x46b2('0x85')),function(_0xe61cd2){return _[_0x46b2('0x2c')](_0x13e4d7,_0xe61cd2);});if(_0x58a5b5){return _0x22e193['id'];}}}));}}return BPromise['all'](_0x1750e9)[_0x46b2('0x24')](function(_0x1ca226){_0x232334=_(_0x232334)[_0x46b2('0x86')](_0x1ca226)[_0x46b2('0x87')]()[_0x46b2('0x2b')]();return db[_0x46b2('0x34')][_0x46b2('0x2e')]({'where':{'id':_0xbc16ae['params']['id']}})[_0x46b2('0x24')](function(_0x2f047a){return db[_0x46b2('0x6e')][_0x46b2('0x6f')](function(_0x2c2888){return _0x2f047a['removeTeams'](_0xbc16ae[_0x46b2('0x37')][_0x46b2('0x7b')],{'transaction':_0x2c2888})['then'](function(){if(!_[_0x46b2('0x88')](_0x232334)){return _0x2f047a[_0x46b2('0x89')](_0x232334,{'transaction':_0x2c2888})[_0x46b2('0x24')](function(){return db['UserVoiceQueueRt'][_0x46b2('0x5c')]({'where':{'VoiceQueueId':_0xbc16ae[_0x46b2('0x57')]['id'],'UserId':_0x232334},'transaction':_0x2c2888});});}})[_0x46b2('0x24')](function(){_0x232334[_0x46b2('0x78')](function(_0x15db49){socket[_0x46b2('0x79')](_0x46b2('0x8a'),{'UserId':_0x15db49,'VoiceQueueId':_0x2f047a['id']});});});});});});})[_0x46b2('0x24')](respondWithStatusCode(_0xcd448a,null))[_0x46b2('0x4c')](handleError(_0xcd448a,null));};exports[_0x46b2('0x8b')]=function(_0x49b63b,_0x39bd3a,_0x3ef0c3){var _0x30463d,_0x125ea1;return db[_0x46b2('0x34')][_0x46b2('0x2e')]({'where':{'id':_0x49b63b[_0x46b2('0x57')]['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x39bd3a,null))[_0x46b2('0x24')](function(_0x3b9d14){if(_0x3b9d14){_0x125ea1=_0x3b9d14;return _0x3b9d14[_0x46b2('0x8b')](_0x49b63b['body'][_0x46b2('0x7b')],_['omit'](_0x49b63b[_0x46b2('0x4e')],[_0x46b2('0x7b'),'id'])||{})[_0x46b2('0x8c')](function(_0x3e9d26){for(var _0x2d6621=0x0;_0x2d6621<_0x49b63b[_0x46b2('0x4e')][_0x46b2('0x7b')]['length'];_0x2d6621+=0x1){socket[_0x46b2('0x79')](_0x46b2('0x7a'),{'UserId':_0x49b63b[_0x46b2('0x4e')][_0x46b2('0x7b')][_0x2d6621],'VoiceQueueId':_0x49b63b[_0x46b2('0x57')]['id']});}return _0x3e9d26;});}})[_0x46b2('0x24')](function(_0x42580c){_0x30463d=_0x42580c||[];if(_0x125ea1){return db[_0x46b2('0x6a')][_0x46b2('0x48')]({'where':{'id':_0x49b63b['body'][_0x46b2('0x7b')]},'attributes':['id',_0x46b2('0x2f'),_0x46b2('0x6b'),_0x46b2('0x77'),'interface'],'raw':!![]});}})[_0x46b2('0x24')](function(_0x4a0f60){if(!_[_0x46b2('0x88')](_0x4a0f60)){var _0x1683b4=[];for(var _0x4c7624=0x0;_0x4c7624<_0x4a0f60[_0x46b2('0x3d')];_0x4c7624++){if(_0x4a0f60[_0x4c7624][_0x46b2('0x6b')]){_0x1683b4[_0x46b2('0x8d')](db[_0x46b2('0x73')][_0x46b2('0x74')]({'membername':_0x4a0f60[_0x4c7624][_0x46b2('0x2f')],'UserId':_0x4a0f60[_0x4c7624]['id'],'queue_name':_0x125ea1['name'],'VoiceQueueId':_0x125ea1['id'],'interface':_[_0x46b2('0x8e')](_0x4a0f60[_0x4c7624][_0x46b2('0x76')])?util['format'](_0x46b2('0x8f'),_0x4a0f60[_0x4c7624][_0x46b2('0x2f')]):_0x4a0f60[_0x4c7624][_0x46b2('0x76')],'paused':_0x4a0f60[_0x4c7624][_0x46b2('0x77')]||![],'penalty':_0x49b63b[_0x46b2('0x4e')][_0x46b2('0x6d')]||0x0}));}}return BPromise[_0x46b2('0x90')](_0x1683b4);}})[_0x46b2('0x24')](function(){return _0x30463d;})['then'](respondWithResult(_0x39bd3a,null))[_0x46b2('0x4c')](handleError(_0x39bd3a,null));};exports[_0x46b2('0x89')]=function(_0x4da4ed,_0x11d3e2,_0x1f0795){return db[_0x46b2('0x34')][_0x46b2('0x2e')]({'where':{'id':_0x4da4ed[_0x46b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x11d3e2,null))[_0x46b2('0x24')](function(_0x433ba5){if(_0x433ba5){return _0x433ba5[_0x46b2('0x89')](_0x4da4ed[_0x46b2('0x37')]['ids'])['then'](function(){if(_['isArray'](_0x4da4ed[_0x46b2('0x37')][_0x46b2('0x7b')])){for(var _0x50d962=0x0;_0x50d962<_0x4da4ed[_0x46b2('0x37')]['ids'][_0x46b2('0x3d')];_0x50d962+=0x1){socket[_0x46b2('0x79')](_0x46b2('0x8a'),{'UserId':Number(_0x4da4ed[_0x46b2('0x37')][_0x46b2('0x7b')][_0x50d962]),'VoiceQueueId':Number(_0x4da4ed[_0x46b2('0x57')]['id'])});}}else{socket[_0x46b2('0x79')](_0x46b2('0x8a'),{'UserId':Number(_0x4da4ed[_0x46b2('0x37')]['ids']),'VoiceQueueId':Number(_0x4da4ed[_0x46b2('0x57')]['id'])});}});}})[_0x46b2('0x24')](function(_0xa6535a){return db[_0x46b2('0x73')][_0x46b2('0x5c')]({'where':{'VoiceQueueId':_0x4da4ed[_0x46b2('0x57')]['id'],'UserId':_0x4da4ed[_0x46b2('0x37')][_0x46b2('0x7b')]}})[_0x46b2('0x24')](function(){return _0xa6535a;});})[_0x46b2('0x24')](respondWithStatusCode(_0x11d3e2,null))[_0x46b2('0x4c')](handleError(_0x11d3e2,null));};exports['getAgents']=function(_0x5ad602,_0x5a20ea,_0x2fa5c3){var _0x4c30c5={};var _0x81d79f={};var _0x5d6b62;var _0x494e1f;return db[_0x46b2('0x34')]['findOne']({'where':{'id':_0x5ad602['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x5a20ea,null))['then'](function(_0x592767){if(_0x592767){_0x5d6b62=_0x592767;_0x81d79f[_0x46b2('0x3a')]=_[_0x46b2('0x36')](db[_0x46b2('0x6a')][_0x46b2('0x35')]);_0x81d79f[_0x46b2('0x37')]=_[_0x46b2('0x36')](_0x5ad602[_0x46b2('0x37')]);_0x81d79f[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x81d79f[_0x46b2('0x3a')],_0x81d79f[_0x46b2('0x37')]);_0x4c30c5[_0x46b2('0x3b')]=_['intersection'](_0x81d79f[_0x46b2('0x3a')],qs['fields'](_0x5ad602[_0x46b2('0x37')][_0x46b2('0x3c')]));_0x4c30c5[_0x46b2('0x3b')]=_0x4c30c5[_0x46b2('0x3b')][_0x46b2('0x3d')]?_0x4c30c5[_0x46b2('0x3b')]:_0x81d79f[_0x46b2('0x3a')];_0x4c30c5[_0x46b2('0x63')]=qs[_0x46b2('0x40')](_0x5ad602[_0x46b2('0x37')][_0x46b2('0x40')]);_0x4c30c5[_0x46b2('0x42')]=qs[_0x46b2('0x38')](_['pick'](_0x5ad602[_0x46b2('0x37')],_0x81d79f[_0x46b2('0x38')]));if(_0x5ad602['query'][_0x46b2('0x29')]){_0x4c30c5['where']=_[_0x46b2('0x43')](_0x4c30c5[_0x46b2('0x42')],{'$or':_[_0x46b2('0x2a')](_0x4c30c5['attributes'],function(_0x48c797){var _0xbedeba={};_0xbedeba[_0x48c797]={'$like':'%'+_0x5ad602[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0xbedeba;})});}_0x4c30c5=_['merge']({},_0x4c30c5,_0x5ad602[_0x46b2('0x46')]);return _0x5d6b62[_0x46b2('0x91')](_0x4c30c5);}})[_0x46b2('0x24')](function(_0x263d95){if(_0x263d95){_0x494e1f=_0x263d95[_0x46b2('0x3d')];if(!_0x5ad602['query']['hasOwnProperty']('nolimit')){_0x4c30c5[_0x46b2('0x1d')]=qs[_0x46b2('0x1d')](_0x5ad602[_0x46b2('0x37')][_0x46b2('0x1d')]);_0x4c30c5[_0x46b2('0x1c')]=qs[_0x46b2('0x1c')](_0x5ad602[_0x46b2('0x37')][_0x46b2('0x1c')]);}return _0x5d6b62[_0x46b2('0x91')](_0x4c30c5);}})[_0x46b2('0x24')](function(_0x3202c6){if(_0x3202c6){return _0x3202c6?{'count':_0x494e1f,'rows':_0x3202c6}:null;}})[_0x46b2('0x24')](respondWithResult(_0x5a20ea,null))[_0x46b2('0x4c')](handleError(_0x5a20ea,null));};exports[_0x46b2('0x92')]=function(_0x399a4d,_0x4a2905,_0x13a127){var _0x294278={};var _0x409dc0={};var _0x18edc0;var _0x379144;return db[_0x46b2('0x34')][_0x46b2('0x5e')]({'where':{'id':_0x399a4d['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x4a2905,null))['then'](function(_0x3e7aa0){if(_0x3e7aa0){_0x18edc0=_0x3e7aa0;_0x409dc0['model']=_[_0x46b2('0x36')](db[_0x46b2('0x73')][_0x46b2('0x35')]);_0x409dc0[_0x46b2('0x37')]=_[_0x46b2('0x36')](_0x399a4d[_0x46b2('0x37')]);_0x409dc0[_0x46b2('0x38')]=_['intersection'](_0x409dc0[_0x46b2('0x3a')],_0x409dc0[_0x46b2('0x37')]);_0x294278['attributes']=_[_0x46b2('0x39')](_0x409dc0['model'],qs[_0x46b2('0x3c')](_0x399a4d[_0x46b2('0x37')]['fields']));_0x294278[_0x46b2('0x3b')]=_0x294278['attributes']['length']?_0x294278[_0x46b2('0x3b')]:_0x409dc0[_0x46b2('0x3a')];_0x294278['order']=qs[_0x46b2('0x40')](_0x399a4d[_0x46b2('0x37')][_0x46b2('0x40')]);_0x294278[_0x46b2('0x42')]=qs['filters'](_['pick'](_0x399a4d[_0x46b2('0x37')],_0x409dc0[_0x46b2('0x38')]));if(_0x399a4d[_0x46b2('0x37')][_0x46b2('0x29')]){_0x294278[_0x46b2('0x42')]=_['merge'](_0x294278[_0x46b2('0x42')],{'$or':_['map'](_0x294278['attributes'],function(_0x320cea){var _0x571122={};_0x571122[_0x320cea]={'$like':'%'+_0x399a4d[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0x571122;})});}_0x294278=_[_0x46b2('0x43')]({},_0x294278,_0x399a4d['options']);return _0x18edc0['getMembers'](_0x294278);}})[_0x46b2('0x24')](function(_0x3bbba9){if(_0x3bbba9){_0x379144=_0x3bbba9['length'];if(!_0x399a4d[_0x46b2('0x37')][_0x46b2('0x3e')](_0x46b2('0x3f'))){_0x294278[_0x46b2('0x1d')]=qs['limit'](_0x399a4d[_0x46b2('0x37')]['limit']);_0x294278['offset']=qs[_0x46b2('0x1c')](_0x399a4d[_0x46b2('0x37')]['offset']);}return _0x18edc0[_0x46b2('0x92')](_0x294278);}})[_0x46b2('0x24')](function(_0x51620b){return _0x51620b?{'count':_0x379144,'rows':_0x51620b}:null;})[_0x46b2('0x24')](respondWithResult(_0x4a2905,null))[_0x46b2('0x4c')](handleError(_0x4a2905,null));};exports[_0x46b2('0x93')]=function(_0x128753,_0x14222f,_0x31b9fb){var _0x2b1fd9={};var _0xd08d77={};var _0x263993;var _0x3248c8;return db[_0x46b2('0x34')][_0x46b2('0x5e')]({'where':{'id':_0x128753[_0x46b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x14222f,null))[_0x46b2('0x24')](function(_0x34027f){if(_0x34027f){_0x263993=_0x34027f;_0xd08d77[_0x46b2('0x3a')]=_[_0x46b2('0x36')](db['CmList'][_0x46b2('0x35')]);_0xd08d77['query']=_[_0x46b2('0x36')](_0x128753['query']);_0xd08d77[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0xd08d77['model'],_0xd08d77[_0x46b2('0x37')]);_0x2b1fd9[_0x46b2('0x3b')]=_['intersection'](_0xd08d77['model'],qs[_0x46b2('0x3c')](_0x128753[_0x46b2('0x37')][_0x46b2('0x3c')]));_0x2b1fd9[_0x46b2('0x3b')]=_0x2b1fd9[_0x46b2('0x3b')][_0x46b2('0x3d')]?_0x2b1fd9['attributes']:_0xd08d77['model'];_0x2b1fd9['order']=qs[_0x46b2('0x40')](_0x128753['query'][_0x46b2('0x40')]);_0x2b1fd9[_0x46b2('0x42')]=qs[_0x46b2('0x38')](_[_0x46b2('0x41')](_0x128753[_0x46b2('0x37')],_0xd08d77[_0x46b2('0x38')]));if(_0x128753[_0x46b2('0x37')][_0x46b2('0x29')]){_0x2b1fd9[_0x46b2('0x42')]=_[_0x46b2('0x43')](_0x2b1fd9[_0x46b2('0x42')],{'$or':_[_0x46b2('0x2a')](_0x2b1fd9[_0x46b2('0x3b')],function(_0x13df4d){var _0x111c8b={};_0x111c8b[_0x13df4d]={'$like':'%'+_0x128753[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0x111c8b;})});}_0x2b1fd9=_['merge']({},_0x2b1fd9,_0x128753[_0x46b2('0x46')]);return _0x263993['getLists'](_0x2b1fd9);}})[_0x46b2('0x24')](function(_0x44beb9){if(_0x44beb9){_0x3248c8=_0x44beb9[_0x46b2('0x3d')];if(!_0x128753[_0x46b2('0x37')]['hasOwnProperty'](_0x46b2('0x3f'))){_0x2b1fd9['limit']=qs[_0x46b2('0x1d')](_0x128753[_0x46b2('0x37')][_0x46b2('0x1d')]);_0x2b1fd9[_0x46b2('0x1c')]=qs[_0x46b2('0x1c')](_0x128753[_0x46b2('0x37')][_0x46b2('0x1c')]);}return _0x263993[_0x46b2('0x93')](_0x2b1fd9);}})[_0x46b2('0x24')](function(_0x50bbd0){if(_0x50bbd0){return _0x50bbd0?{'count':_0x3248c8,'rows':_0x50bbd0}:null;}})['then'](respondWithResult(_0x14222f,null))[_0x46b2('0x4c')](handleError(_0x14222f,null));};exports[_0x46b2('0x94')]=function(_0x56fc70,_0x2d67ca,_0x5a1d8d){var _0x1a0cdc,_0x18a1de;return db[_0x46b2('0x34')][_0x46b2('0x2e')]({'where':{'id':_0x56fc70['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x2d67ca,null))[_0x46b2('0x24')](function(_0x8e398a){if(_0x8e398a){_0x18a1de=_0x8e398a;return _0x8e398a[_0x46b2('0x94')](_0x56fc70[_0x46b2('0x4e')][_0x46b2('0x7b')],_['omit'](_0x56fc70[_0x46b2('0x4e')],[_0x46b2('0x7b'),'id'])||{});}return null;})[_0x46b2('0x8c')](function(_0x5a4a9c){var _0xdce7ae;_0x1a0cdc=_0x5a4a9c||[];var _0x495942=[];if(_0x5a4a9c){for(var _0x23fa93=0x0;_0x23fa93<_0x5a4a9c[_0x46b2('0x3d')];_0x23fa93+=0x1){var _0x265b0c=_0x5a4a9c[_0x23fa93][_0x46b2('0x25')]({'plain':!![]});_0x18a1de[_0x46b2('0x95')]=_0x56fc70['body'][_0x46b2('0x95')]?_0x56fc70[_0x46b2('0x4e')][_0x46b2('0x95')]:_0x18a1de['dialCheckDuplicateType'];switch(_0x18a1de[_0x46b2('0x95')]){case'always':_0xdce7ae=squel[_0x46b2('0x96')]()[_0x46b2('0x97')](_0x46b2('0x98'))['fromQuery'](['phone','scheduledAt',_0x46b2('0x99'),_0x46b2('0x9a'),_0x46b2('0x60'),_0x46b2('0x58'),_0x46b2('0x59')],squel[_0x46b2('0x7c')]()[_0x46b2('0x45')](_0x46b2('0x9b'),_0x46b2('0x9b'))[_0x46b2('0x45')](_0x46b2('0x9c'),_0x46b2('0x9d'))[_0x46b2('0x45')]('id',_0x46b2('0x99'))['field'](_0x265b0c[_0x46b2('0x9e')][_0x46b2('0x82')](),'ListId')[_0x46b2('0x45')](_0x56fc70['params']['id']['toString'](),_0x46b2('0x60'))[_0x46b2('0x45')](_0x46b2('0x9c'),_0x46b2('0x58'))['field'](_0x46b2('0x9c'),'updatedAt')[_0x46b2('0x9f')](_0x46b2('0xa0'))[_0x46b2('0x42')](_0x46b2('0xa1'))[_0x46b2('0x42')](_0x46b2('0xa2'),_0x265b0c[_0x46b2('0x9e')][_0x46b2('0x82')]())[_0x46b2('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x46b2('0x42')](_0x46b2('0xa3'),squel['select']()[_0x46b2('0x45')](_0x46b2('0xa4'))['from'](_0x46b2('0xa5'))[_0x46b2('0x42')]('VoiceQueueId\x20=\x20?',_0x56fc70['params']['id']['toString']()))[_0x46b2('0x42')](_0x46b2('0xa3'),squel[_0x46b2('0x7c')]()[_0x46b2('0x45')](_0x46b2('0xa6'))[_0x46b2('0x9f')](_0x46b2('0x98'))[_0x46b2('0x42')](_0x46b2('0xa7'),_0x56fc70[_0x46b2('0x57')]['id']['toString']())))[_0x46b2('0x82')]();break;case _0x46b2('0xa8'):_0xdce7ae=squel[_0x46b2('0x96')]()['into'](_0x46b2('0x98'))[_0x46b2('0xa9')]([_0x46b2('0x9b'),_0x46b2('0x9d'),'ContactId',_0x46b2('0x9a'),'VoiceQueueId',_0x46b2('0x58'),_0x46b2('0x59')],squel[_0x46b2('0x7c')]()[_0x46b2('0x45')]('phone',_0x46b2('0x9b'))[_0x46b2('0x45')](_0x46b2('0x9c'),_0x46b2('0x9d'))[_0x46b2('0x45')]('id',_0x46b2('0x99'))['field'](_0x265b0c['CmListId'][_0x46b2('0x82')](),_0x46b2('0x9a'))[_0x46b2('0x45')](_0x56fc70[_0x46b2('0x57')]['id'][_0x46b2('0x82')](),_0x46b2('0x60'))[_0x46b2('0x45')]('NOW()',_0x46b2('0x58'))[_0x46b2('0x45')]('NOW()',_0x46b2('0x59'))[_0x46b2('0x9f')](_0x46b2('0xa0'))[_0x46b2('0x42')]('deletedAt\x20IS\x20NULL')[_0x46b2('0x42')](_0x46b2('0xa2'),_0x265b0c['CmListId'][_0x46b2('0x82')]())[_0x46b2('0x42')](_0x46b2('0xaa'))[_0x46b2('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x46b2('0x7c')]()['field'](_0x46b2('0xa6'))['from'](_0x46b2('0x98'))[_0x46b2('0x42')](_0x46b2('0xa7'),_0x56fc70['params']['id']['toString']())))[_0x46b2('0x82')]();break;default:_0xdce7ae=squel[_0x46b2('0x96')]()[_0x46b2('0x97')]('cm_hopper')[_0x46b2('0xa9')]([_0x46b2('0x9b'),_0x46b2('0x9d'),_0x46b2('0x99'),'ListId',_0x46b2('0x60'),'createdAt',_0x46b2('0x59')],squel[_0x46b2('0x7c')]()[_0x46b2('0x45')](_0x46b2('0x9b'),'phone')['field'](_0x46b2('0x9c'),_0x46b2('0x9d'))[_0x46b2('0x45')]('id',_0x46b2('0x99'))[_0x46b2('0x45')](_0x265b0c[_0x46b2('0x9e')][_0x46b2('0x82')](),_0x46b2('0x9a'))[_0x46b2('0x45')](_0x56fc70[_0x46b2('0x57')]['id']['toString'](),_0x46b2('0x60'))[_0x46b2('0x45')](_0x46b2('0x9c'),_0x46b2('0x58'))[_0x46b2('0x45')](_0x46b2('0x9c'),'updatedAt')[_0x46b2('0x9f')]('cm_contacts')[_0x46b2('0x42')](_0x46b2('0xa1'))['where'](_0x46b2('0xa2'),_0x265b0c[_0x46b2('0x9e')][_0x46b2('0x82')]())['where'](_0x46b2('0xaa')))[_0x46b2('0x82')]();}_0x495942['push'](db[_0x46b2('0x6e')][_0x46b2('0x37')](_0xdce7ae));}return BPromise[_0x46b2('0x90')](_0x495942);}})[_0x46b2('0x24')](function(){return _0x1a0cdc;})['then'](respondWithResult(_0x2d67ca,null))[_0x46b2('0x4c')](handleError(_0x2d67ca,null));};exports[_0x46b2('0xab')]=function(_0x1ce57b,_0x57ef98,_0x167e94){return db['VoiceQueue'][_0x46b2('0x2e')]({'where':{'id':_0x1ce57b[_0x46b2('0x57')]['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x57ef98,null))[_0x46b2('0x24')](function(_0x3bd36f){if(_0x3bd36f){return _0x3bd36f[_0x46b2('0xab')](_0x1ce57b[_0x46b2('0x37')][_0x46b2('0x7b')]);}})[_0x46b2('0x24')](function(_0x42b8d4){if(_0x42b8d4){return db[_0x46b2('0x5f')]['destroy']({'where':{'ListId':_0x1ce57b['query'][_0x46b2('0x7b')],'VoiceQueueId':_0x1ce57b[_0x46b2('0x57')]['id']}})[_0x46b2('0x24')](function(){return _0x42b8d4;});}})[_0x46b2('0x24')](respondWithStatusCode(_0x57ef98,null))[_0x46b2('0x4c')](handleError(_0x57ef98,null));};exports[_0x46b2('0xac')]=function(_0x5f2821,_0x59cffc,_0x2c502f){var _0x342f80={};var _0x16dce3={};var _0x3689c6;var _0xcd5903;return db[_0x46b2('0x34')][_0x46b2('0x5e')]({'where':{'id':_0x5f2821[_0x46b2('0x57')]['id']}})['then'](handleEntityNotFound(_0x59cffc,null))[_0x46b2('0x24')](function(_0x3369fa){if(_0x3369fa){_0x3689c6=_0x3369fa;_0x16dce3[_0x46b2('0x3a')]=_[_0x46b2('0x36')](db[_0x46b2('0xad')][_0x46b2('0x35')]);_0x16dce3[_0x46b2('0x37')]=_[_0x46b2('0x36')](_0x5f2821[_0x46b2('0x37')]);_0x16dce3[_0x46b2('0x38')]=_[_0x46b2('0x39')](_0x16dce3[_0x46b2('0x3a')],_0x16dce3[_0x46b2('0x37')]);_0x342f80[_0x46b2('0x3b')]=_['intersection'](_0x16dce3[_0x46b2('0x3a')],qs[_0x46b2('0x3c')](_0x5f2821[_0x46b2('0x37')][_0x46b2('0x3c')]));_0x342f80['attributes']=_0x342f80[_0x46b2('0x3b')][_0x46b2('0x3d')]?_0x342f80[_0x46b2('0x3b')]:_0x16dce3[_0x46b2('0x3a')];_0x342f80[_0x46b2('0x63')]=qs[_0x46b2('0x40')](_0x5f2821[_0x46b2('0x37')][_0x46b2('0x40')]);_0x342f80[_0x46b2('0x42')]=qs['filters'](_[_0x46b2('0x41')](_0x5f2821[_0x46b2('0x37')],_0x16dce3[_0x46b2('0x38')]));if(_0x5f2821['query'][_0x46b2('0x29')]){_0x342f80[_0x46b2('0x42')]=_['merge'](_0x342f80[_0x46b2('0x42')],{'$or':_[_0x46b2('0x2a')](_0x342f80[_0x46b2('0x3b')],function(_0x50c0f2){var _0xa3b6bd={};_0xa3b6bd[_0x50c0f2]={'$like':'%'+_0x5f2821[_0x46b2('0x37')][_0x46b2('0x29')]+'%'};return _0xa3b6bd;})});}_0x342f80=_[_0x46b2('0x43')]({},_0x342f80,_0x5f2821[_0x46b2('0x46')]);return _0x3689c6[_0x46b2('0xac')](_0x342f80);}})[_0x46b2('0x24')](function(_0x19dbb8){if(_0x19dbb8){_0xcd5903=_0x19dbb8[_0x46b2('0x3d')];if(!_0x5f2821['query'][_0x46b2('0x3e')](_0x46b2('0x3f'))){_0x342f80['limit']=qs[_0x46b2('0x1d')](_0x5f2821[_0x46b2('0x37')][_0x46b2('0x1d')]);_0x342f80[_0x46b2('0x1c')]=qs[_0x46b2('0x1c')](_0x5f2821[_0x46b2('0x37')][_0x46b2('0x1c')]);}return _0x3689c6['getBlackLists'](_0x342f80);}})[_0x46b2('0x24')](function(_0x35ae66){if(_0x35ae66){return _0x35ae66?{'count':_0xcd5903,'rows':_0x35ae66}:null;}})[_0x46b2('0x24')](respondWithResult(_0x59cffc,null))[_0x46b2('0x4c')](handleError(_0x59cffc,null));};exports[_0x46b2('0xae')]=function(_0x1bb2df,_0xe5288d,_0x3f56fc){var _0xb946d1,_0x3d88df;return db['VoiceQueue'][_0x46b2('0x2e')]({'where':{'id':_0x1bb2df[_0x46b2('0x57')]['id']}})['then'](handleEntityNotFound(_0xe5288d,null))['then'](function(_0x3dd7bf){if(_0x3dd7bf){_0x3d88df=_0x3dd7bf;return _0x3dd7bf['addBlackLists'](_0x1bb2df[_0x46b2('0x4e')][_0x46b2('0x7b')],_[_0x46b2('0x5a')](_0x1bb2df['body'],[_0x46b2('0x7b'),'id'])||{});}return null;})[_0x46b2('0x8c')](function(_0x3127ca){var _0x3e3331;_0xb946d1=_0x3127ca||[];var _0x44941a=[];if(_0x3127ca){for(var _0x78afba=0x0;_0x78afba<_0x3127ca[_0x46b2('0x3d')];_0x78afba+=0x1){var _0x4d56c5=_0x3127ca[_0x78afba][_0x46b2('0x25')]({'plain':!![]});_0x3e3331=squel[_0x46b2('0x96')]()[_0x46b2('0x97')](_0x46b2('0xaf'))[_0x46b2('0xa9')](['phone',_0x46b2('0x99'),_0x46b2('0x9a'),'VoiceQueueId','createdAt',_0x46b2('0x59')],squel[_0x46b2('0x7c')]()[_0x46b2('0x45')](_0x46b2('0x9b'),_0x46b2('0x9b'))['field']('id',_0x46b2('0x99'))['field'](_0x4d56c5['CmListId'][_0x46b2('0x82')](),_0x46b2('0x9a'))[_0x46b2('0x45')](_0x1bb2df['params']['id'][_0x46b2('0x82')](),_0x46b2('0x60'))[_0x46b2('0x45')](_0x46b2('0x9c'),_0x46b2('0x58'))[_0x46b2('0x45')]('NOW()',_0x46b2('0x59'))[_0x46b2('0x9f')](_0x46b2('0xa0'))['where'](_0x46b2('0xa1'))[_0x46b2('0x42')](_0x46b2('0xa2'),_0x4d56c5[_0x46b2('0x9e')][_0x46b2('0x82')]())[_0x46b2('0x42')](_0x46b2('0xaa')))[_0x46b2('0x82')]();_0x44941a[_0x46b2('0x8d')](db['sequelize'][_0x46b2('0x37')](_0x3e3331));}return BPromise[_0x46b2('0x90')](_0x44941a);}})['then'](function(){return _0xb946d1;})['then'](respondWithResult(_0xe5288d,null))[_0x46b2('0x4c')](handleError(_0xe5288d,null));};exports[_0x46b2('0xb0')]=function(_0x2df7f2,_0x3ad2a9,_0xc8aa73){return db[_0x46b2('0x34')]['find']({'where':{'id':_0x2df7f2[_0x46b2('0x57')]['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x3ad2a9,null))[_0x46b2('0x24')](function(_0x398f00){if(_0x398f00){return _0x398f00[_0x46b2('0xb0')](_0x2df7f2[_0x46b2('0x37')]['ids']);}})['then'](function(_0x2bc72e){if(_0x2bc72e){return db['CmHopperBlack'][_0x46b2('0x5c')]({'where':{'ListId':_0x2df7f2[_0x46b2('0x37')]['ids'],'VoiceQueueId':_0x2df7f2['params']['id']}})[_0x46b2('0x24')](function(){return _0x2bc72e;});}})[_0x46b2('0x24')](respondWithStatusCode(_0x3ad2a9,null))[_0x46b2('0x4c')](handleError(_0x3ad2a9,null));}; \ No newline at end of file +var _0x9b87=['get','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','UserProfileResource','sendStatus','error','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceQueue','count','includeAll','include','rows','catch','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','omit','updatedAt','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','userVoiceQueue:save','ids','select','field','tq.TeamId','team_has_voice_queues','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','TeamId','all','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','isNil','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','phone\x20NOT\x20IN\x20(?)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','end','status','offset','set','Content-Range','json','apply','reject','update','then','destroy'];(function(_0x40a851,_0x4bc700){var _0x560c74=function(_0x1252ad){while(--_0x1252ad){_0x40a851['push'](_0x40a851['shift']());}};_0x560c74(++_0x4bc700);}(_0x9b87,0x8e));var _0x79b8=function(_0x4c359e,_0x127f7e){_0x4c359e=_0x4c359e-0x0;var _0x11c86c=_0x9b87[_0x4c359e];return _0x11c86c;};'use strict';var pdf=require(_0x79b8('0x0'));var emlformat=require(_0x79b8('0x1'));var rimraf=require(_0x79b8('0x2'));var zipdir=require(_0x79b8('0x3'));var jsonpatch=require(_0x79b8('0x4'));var rp=require(_0x79b8('0x5'));var moment=require(_0x79b8('0x6'));var BPromise=require(_0x79b8('0x7'));var Mustache=require(_0x79b8('0x8'));var util=require(_0x79b8('0x9'));var path=require(_0x79b8('0xa'));var sox=require(_0x79b8('0xb'));var csv=require(_0x79b8('0xc'));var ejs=require(_0x79b8('0xd'));var fs=require('fs');var _=require(_0x79b8('0xe'));var squel=require(_0x79b8('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79b8('0x10'));var Papa=require(_0x79b8('0x11'));var Redis=require(_0x79b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x79b8('0x13'));var hardwareService=require(_0x79b8('0x14'));var logger=require(_0x79b8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b8('0x16'));var db=require(_0x79b8('0x17'))['db'];config[_0x79b8('0x18')]=_[_0x79b8('0x19')](config[_0x79b8('0x18')],{'host':_0x79b8('0x1a'),'port':0x18eb});var socket=require(_0x79b8('0x1b'))(new Redis(config[_0x79b8('0x18')]));require(_0x79b8('0x1c'))[_0x79b8('0x1d')](socket);function respondWithStatusCode(_0x43ec09,_0x59e229){_0x59e229=_0x59e229||0xcc;return function(_0x150fb7){if(_0x150fb7){return _0x43ec09['sendStatus'](_0x59e229);}return _0x43ec09['status'](_0x59e229)[_0x79b8('0x1e')]();};}function respondWithResult(_0x21aae0,_0x57a248){_0x57a248=_0x57a248||0xc8;return function(_0x5ddab5){if(_0x5ddab5){return _0x21aae0[_0x79b8('0x1f')](_0x57a248)['json'](_0x5ddab5);}};}function respondWithFilteredResult(_0x5ef869,_0x26f2ec){return function(_0x24c02f){if(_0x24c02f){var _0x9e0342=_0x24c02f['count'],_0x2ae2d5=_0x26f2ec[_0x79b8('0x20')],_0x383a34=_0x26f2ec['offset']+_0x26f2ec['limit'],_0x23d771;if(_0x383a34>=_0x9e0342){_0x383a34=_0x9e0342;_0x23d771=0xc8;}else{_0x23d771=0xce;}_0x5ef869[_0x79b8('0x1f')](_0x23d771);return _0x5ef869[_0x79b8('0x21')](_0x79b8('0x22'),_0x2ae2d5+'-'+_0x383a34+'/'+_0x9e0342)[_0x79b8('0x23')](_0x24c02f);}return null;};}function patchUpdates(_0x1e24cf){return function(_0x1e7507){try{jsonpatch[_0x79b8('0x24')](_0x1e7507,_0x1e24cf,!![]);}catch(_0x261c48){return BPromise[_0x79b8('0x25')](_0x261c48);}return _0x1e7507['save']();};}function saveUpdates(_0x3e9d83,_0x255207){return function(_0x4dbfcf){if(_0x4dbfcf){return _0x4dbfcf[_0x79b8('0x26')](_0x3e9d83)[_0x79b8('0x27')](function(_0x54c605){return _0x54c605;});}return null;};}function removeEntity(_0x28be4b,_0x4f543f){return function(_0x5e8228){if(_0x5e8228){return _0x5e8228[_0x79b8('0x28')]()[_0x79b8('0x27')](function(){var _0x262b48=_0x5e8228[_0x79b8('0x29')]({'plain':!![]});var _0x9deb6c=[{'name':'VoiceQueues','value':_0x79b8('0x2a'),'ignore':![]},{'name':_0x79b8('0x2b'),'value':_0x79b8('0x2c'),'ignore':![]}];var _0x3ba5ac=_(_0x9deb6c)['filter'](_0x79b8('0x2d'))[_0x79b8('0x2e')](_0x79b8('0x2f'))['value']();if(_[_0x79b8('0x30')](_0x3ba5ac,_0x262b48[_0x79b8('0x31')])){return;}var _0x43058e=_[_0x79b8('0x32')](_0x9deb6c,[_0x79b8('0x2f'),_0x262b48[_0x79b8('0x31')]])['name'];return db[_0x79b8('0x33')]['destroy']({'where':{'type':_0x43058e,'resourceId':_0x262b48['id']}})[_0x79b8('0x27')](function(){return _0x5e8228;});})['then'](function(){_0x28be4b[_0x79b8('0x1f')](0xcc)[_0x79b8('0x1e')]();});}};}function handleEntityNotFound(_0x300755,_0x55c631){return function(_0x1e03c1){if(!_0x1e03c1){_0x300755[_0x79b8('0x34')](0x194);}return _0x1e03c1;};}function handleError(_0x252472,_0xdc3993){_0xdc3993=_0xdc3993||0x1f4;return function(_0x4df203){logger[_0x79b8('0x35')](_0x4df203['stack']);if(_0x4df203['name']){delete _0x4df203[_0x79b8('0x36')];}_0x252472[_0x79b8('0x1f')](_0xdc3993)['send'](_0x4df203);};}exports[_0x79b8('0x37')]=function(_0x4fa882,_0x4c5696){var _0x302598={},_0x4823f5={},_0x1ad785={'count':0x0,'rows':[]};var _0x5a2af7=db['VoiceQueue'][_0x79b8('0x38')];_0x4823f5[_0x79b8('0x39')]=_[_0x79b8('0x3a')](_0x5a2af7);_0x4823f5[_0x79b8('0x3b')]=_[_0x79b8('0x3a')](_0x4fa882[_0x79b8('0x3b')]);_0x4823f5['filters']=_[_0x79b8('0x3c')](_0x4823f5[_0x79b8('0x39')],_0x4823f5[_0x79b8('0x3b')]);_0x302598[_0x79b8('0x3d')]=_[_0x79b8('0x3c')](_0x4823f5[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x4fa882[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x302598[_0x79b8('0x3d')]=_0x302598[_0x79b8('0x3d')]['length']?_0x302598[_0x79b8('0x3d')]:_0x4823f5[_0x79b8('0x39')];if(!_0x4fa882[_0x79b8('0x3b')]['hasOwnProperty'](_0x79b8('0x3f'))){_0x302598[_0x79b8('0x40')]=qs[_0x79b8('0x40')](_0x4fa882[_0x79b8('0x3b')][_0x79b8('0x40')]);_0x302598[_0x79b8('0x20')]=qs['offset'](_0x4fa882[_0x79b8('0x3b')]['offset']);}_0x302598['order']=qs[_0x79b8('0x41')](_0x4fa882['query']['sort']);_0x302598[_0x79b8('0x42')]=qs[_0x79b8('0x43')](_[_0x79b8('0x44')](_0x4fa882[_0x79b8('0x3b')],_0x4823f5[_0x79b8('0x43')]));if(_0x4fa882[_0x79b8('0x3b')][_0x79b8('0x45')]){_0x302598[_0x79b8('0x42')]=_[_0x79b8('0x46')](_0x302598[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x5a2af7,function(_0x157f92){if(_0x157f92[_0x79b8('0x31')]['key']!==_0x79b8('0x47')){var _0x13b041={};_0x13b041[_0x157f92['field']]={'$like':'%'+_0x4fa882[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x13b041;}})});}_0x302598=_['merge']({},_0x302598,_0x4fa882[_0x79b8('0x48')]);var _0x62a011={'where':_0x302598[_0x79b8('0x42')]};return db[_0x79b8('0x49')][_0x79b8('0x4a')](_0x62a011)[_0x79b8('0x27')](function(_0x3872da){_0x1ad785[_0x79b8('0x4a')]=_0x3872da;if(_0x4fa882[_0x79b8('0x3b')][_0x79b8('0x4b')]){_0x302598[_0x79b8('0x4c')]=[{'all':!![]}];}return db[_0x79b8('0x49')]['findAll'](_0x302598);})['then'](function(_0x2a2b66){_0x1ad785[_0x79b8('0x4d')]=_0x2a2b66;return _0x1ad785;})[_0x79b8('0x27')](respondWithFilteredResult(_0x4c5696,_0x302598))[_0x79b8('0x4e')](handleError(_0x4c5696,null));};exports['show']=function(_0x1e04f4,_0x45d7d7){var _0x24f486={'raw':![],'where':{'id':_0x1e04f4['params']['id']}},_0x436157={};_0x436157[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x49')][_0x79b8('0x38')]);_0x436157['query']=_[_0x79b8('0x3a')](_0x1e04f4[_0x79b8('0x3b')]);_0x436157[_0x79b8('0x43')]=_[_0x79b8('0x3c')](_0x436157[_0x79b8('0x39')],_0x436157[_0x79b8('0x3b')]);_0x24f486['attributes']=_[_0x79b8('0x3c')](_0x436157[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x1e04f4[_0x79b8('0x3b')]['fields']));_0x24f486['attributes']=_0x24f486[_0x79b8('0x3d')][_0x79b8('0x4f')]?_0x24f486[_0x79b8('0x3d')]:_0x436157[_0x79b8('0x39')];if(_0x1e04f4[_0x79b8('0x3b')][_0x79b8('0x4b')]){_0x24f486[_0x79b8('0x4c')]=[{'all':!![]}];}_0x24f486=_[_0x79b8('0x46')]({},_0x24f486,_0x1e04f4[_0x79b8('0x48')]);return db['VoiceQueue'][_0x79b8('0x32')](_0x24f486)[_0x79b8('0x27')](handleEntityNotFound(_0x45d7d7,null))[_0x79b8('0x27')](respondWithResult(_0x45d7d7,null))['catch'](handleError(_0x45d7d7,null));};exports[_0x79b8('0x50')]=function(_0x56fe69,_0x5556ef){return db[_0x79b8('0x49')][_0x79b8('0x50')](_0x56fe69[_0x79b8('0x51')],{})[_0x79b8('0x27')](function(_0x4cdcf9){var _0x5d2fae=_0x56fe69[_0x79b8('0x52')][_0x79b8('0x29')]({'plain':!![]});if(!_0x5d2fae)throw new Error(_0x79b8('0x53'));if(_0x5d2fae[_0x79b8('0x54')]===_0x79b8('0x52')){var _0xcfb9c2=_0x4cdcf9[_0x79b8('0x29')]({'plain':!![]});var _0x3d1078=[{'name':_0x79b8('0x55'),'value':_0x79b8('0x2a')},{'name':_0x79b8('0x2b'),'value':_0x79b8('0x2c')}];var _0x125361=_[_0x79b8('0x32')](_0x3d1078,['value',_0xcfb9c2[_0x79b8('0x31')]])[_0x79b8('0x36')];return db[_0x79b8('0x56')][_0x79b8('0x32')]({'where':{'name':_0x125361,'userProfileId':_0x5d2fae['userProfileId']},'raw':!![]})['then'](function(_0xe6316c){if(_0xe6316c&&_0xe6316c[_0x79b8('0x57')]===0x0){return db[_0x79b8('0x33')][_0x79b8('0x50')]({'name':_0xcfb9c2['name'],'resourceId':_0xcfb9c2['id'],'type':_0xe6316c[_0x79b8('0x36')],'sectionId':_0xe6316c['id']},{})[_0x79b8('0x27')](function(){return _0x4cdcf9;});}else{return _0x4cdcf9;}})['catch'](function(_0x8e0f70){logger[_0x79b8('0x35')](_0x79b8('0x58'),_0x8e0f70);throw _0x8e0f70;});}return _0x4cdcf9;})['then'](respondWithResult(_0x5556ef,0xc9))[_0x79b8('0x4e')](handleError(_0x5556ef,null));};exports['clone']=function(_0x361048,_0x3a85bd){var _0x161fa3={'raw':![],'where':{'id':_0x361048[_0x79b8('0x59')]['id']}},_0x1c2ea5={};_0x1c2ea5[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x49')][_0x79b8('0x38')]);_0x161fa3[_0x79b8('0x3d')]=_['intersection'](_0x1c2ea5[_0x79b8('0x39')],qs['fields'](_0x361048[_0x79b8('0x3b')]['fields']));_0x161fa3[_0x79b8('0x3d')]=_0x161fa3[_0x79b8('0x3d')][_0x79b8('0x4f')]?_0x161fa3[_0x79b8('0x3d')]:_0x1c2ea5[_0x79b8('0x39')];if(_0x361048[_0x79b8('0x3b')][_0x79b8('0x4b')]){_0x161fa3['include']=[{'all':!![]}];}_0x161fa3=_[_0x79b8('0x46')]({},_0x161fa3,_0x361048[_0x79b8('0x48')]);return db[_0x79b8('0x49')][_0x79b8('0x32')](_0x161fa3)[_0x79b8('0x27')](handleEntityNotFound(_0x3a85bd,null))[_0x79b8('0x27')](function(_0x53da4a){if(_0x53da4a){var _0x42c6a4=_0x53da4a[_0x79b8('0x29')]({'plain':!![]});_0x42c6a4=qs['omit'](_0x42c6a4,['id',_0x79b8('0x5a'),'updatedAt']);_0x361048[_0x79b8('0x51')]=_[_0x79b8('0x5b')](_0x361048['body'],['id',_0x79b8('0x5a'),_0x79b8('0x5c')]);return db['VoiceQueue'][_0x79b8('0x50')](_['merge'](_0x42c6a4,_0x361048[_0x79b8('0x51')]),{'include':_0x361048['query'][_0x79b8('0x4b')]?[{'all':!![]}]:undefined})[_0x79b8('0x27')](function(_0x41f243){var _0x26722c=_0x361048[_0x79b8('0x52')][_0x79b8('0x29')]({'plain':!![]});if(!_0x26722c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26722c[_0x79b8('0x54')]===_0x79b8('0x52')){var _0x5c02a7=_0x41f243['get']({'plain':!![]});var _0x2228a2=[{'name':_0x79b8('0x55'),'value':'inbound'},{'name':_0x79b8('0x2b'),'value':_0x79b8('0x2c')}];var _0x2daf0a=_['find'](_0x2228a2,[_0x79b8('0x2f'),_0x5c02a7[_0x79b8('0x31')]])[_0x79b8('0x36')];return db[_0x79b8('0x56')][_0x79b8('0x32')]({'where':{'name':_0x2daf0a,'userProfileId':_0x26722c[_0x79b8('0x5d')]},'raw':!![]})['then'](function(_0x33d1f6){if(_0x33d1f6&&_0x33d1f6[_0x79b8('0x57')]===0x0){return db[_0x79b8('0x33')]['create']({'name':_0x5c02a7[_0x79b8('0x36')],'resourceId':_0x5c02a7['id'],'type':_0x33d1f6[_0x79b8('0x36')],'sectionId':_0x33d1f6['id']},{})[_0x79b8('0x27')](function(){return _0x41f243;});}else{return _0x41f243;}})['catch'](function(_0xfd5147){logger[_0x79b8('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfd5147);throw _0xfd5147;});}return _0x41f243;});}})['then'](respondWithResult(_0x3a85bd,0xc9))[_0x79b8('0x4e')](handleError(_0x3a85bd,null));};exports[_0x79b8('0x26')]=function(_0x172532,_0x1cba9b){if(_0x172532[_0x79b8('0x51')]['id']){delete _0x172532[_0x79b8('0x51')]['id'];}return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x172532['params']['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x1cba9b,null))['then'](saveUpdates(_0x172532['body'],null))[_0x79b8('0x27')](respondWithResult(_0x1cba9b,null))['catch'](handleError(_0x1cba9b,null));};exports[_0x79b8('0x28')]=function(_0x43b067,_0x151cd5){return db['VoiceQueue'][_0x79b8('0x32')]({'where':{'id':_0x43b067[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x151cd5,null))[_0x79b8('0x27')](removeEntity(_0x151cd5,null))[_0x79b8('0x4e')](handleError(_0x151cd5,null));};exports[_0x79b8('0x5e')]=function(_0x1707ad,_0x2c84d0,_0x429c41){var _0x2d19b9={'raw':![],'where':{}};var _0x3c6ad8={};var _0x65f178={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x79b8('0x5f')]({'where':{'id':_0x1707ad[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x2c84d0,null))[_0x79b8('0x27')](function(_0x2654a){if(_0x2654a){_0x3c6ad8[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x60')][_0x79b8('0x38')]);_0x3c6ad8[_0x79b8('0x3b')]=_[_0x79b8('0x3a')](_0x1707ad['query']);_0x3c6ad8[_0x79b8('0x43')]=_['intersection'](_0x3c6ad8['model'],_0x3c6ad8[_0x79b8('0x3b')]);_0x2d19b9[_0x79b8('0x3d')]=_[_0x79b8('0x3c')](_0x3c6ad8[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x1707ad[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x2d19b9[_0x79b8('0x3d')]=_0x2d19b9['attributes']['length']?_0x2d19b9['attributes']:_0x3c6ad8[_0x79b8('0x39')];if(!_0x1707ad[_0x79b8('0x3b')][_0x79b8('0x61')](_0x79b8('0x3f'))){_0x2d19b9[_0x79b8('0x40')]=qs[_0x79b8('0x40')](_0x1707ad[_0x79b8('0x3b')][_0x79b8('0x40')]);_0x2d19b9[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0x1707ad[_0x79b8('0x3b')][_0x79b8('0x20')]);}_0x2d19b9['order']=qs[_0x79b8('0x41')](_0x1707ad[_0x79b8('0x3b')]['sort']);_0x2d19b9[_0x79b8('0x42')]=qs[_0x79b8('0x43')](_[_0x79b8('0x44')](_0x1707ad[_0x79b8('0x3b')],_0x3c6ad8[_0x79b8('0x43')]));_0x2d19b9[_0x79b8('0x42')][_0x79b8('0x62')]=_0x2654a['id'];if(_0x1707ad[_0x79b8('0x3b')]['filter']){_0x2d19b9['where']=_[_0x79b8('0x46')](_0x2d19b9[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x2d19b9[_0x79b8('0x3d')],function(_0x48a2f4){var _0x7101cc={};_0x7101cc[_0x48a2f4]={'$like':'%'+_0x1707ad[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x7101cc;})});}_0x2d19b9=_[_0x79b8('0x46')]({},_0x2d19b9,_0x1707ad[_0x79b8('0x48')]);return db['CmHopper']['count']({'where':_0x2d19b9['where']})['then'](function(_0x1207d3){_0x65f178[_0x79b8('0x4a')]=_0x1207d3;if(_0x1707ad['query'][_0x79b8('0x4b')]){_0x2d19b9[_0x79b8('0x4c')]=[{'all':!![]}];}return db[_0x79b8('0x60')][_0x79b8('0x63')](_0x2d19b9);})[_0x79b8('0x27')](function(_0x3c98aa){_0x65f178[_0x79b8('0x4d')]=_0x3c98aa;return _0x65f178;});}})[_0x79b8('0x27')](respondWithFilteredResult(_0x2c84d0,_0x2d19b9))[_0x79b8('0x4e')](handleError(_0x2c84d0,null));};exports[_0x79b8('0x64')]=function(_0x2b7e60,_0x4d5fcf,_0x4a7963){var _0x1b5e04={'raw':!![],'where':{}};var _0xf0bf62={};var _0xbc1e3f={'count':0x0,'rows':[]};return db[_0x79b8('0x49')][_0x79b8('0x5f')]({'where':{'id':_0x2b7e60[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x4d5fcf,null))['then'](function(_0x34b4d1){if(_0x34b4d1){_0xf0bf62[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x65')]['rawAttributes']);_0xf0bf62[_0x79b8('0x3b')]=_[_0x79b8('0x3a')](_0x2b7e60[_0x79b8('0x3b')]);_0xf0bf62['filters']=_[_0x79b8('0x3c')](_0xf0bf62[_0x79b8('0x39')],_0xf0bf62[_0x79b8('0x3b')]);_0x1b5e04[_0x79b8('0x3d')]=_['intersection'](_0xf0bf62['model'],qs[_0x79b8('0x3e')](_0x2b7e60[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x1b5e04[_0x79b8('0x3d')]=_0x1b5e04[_0x79b8('0x3d')][_0x79b8('0x4f')]?_0x1b5e04[_0x79b8('0x3d')]:_0xf0bf62[_0x79b8('0x39')];if(!_0x2b7e60['query'][_0x79b8('0x61')]('nolimit')){_0x1b5e04['limit']=qs[_0x79b8('0x40')](_0x2b7e60[_0x79b8('0x3b')]['limit']);_0x1b5e04['offset']=qs[_0x79b8('0x20')](_0x2b7e60[_0x79b8('0x3b')][_0x79b8('0x20')]);}_0x1b5e04[_0x79b8('0x66')]=qs['sort'](_0x2b7e60[_0x79b8('0x3b')][_0x79b8('0x41')]);_0x1b5e04[_0x79b8('0x42')]=qs['filters'](_[_0x79b8('0x44')](_0x2b7e60['query'],_0xf0bf62['filters']));_0x1b5e04[_0x79b8('0x42')][_0x79b8('0x62')]=_0x34b4d1['id'];if(_0x2b7e60[_0x79b8('0x3b')]['filter']){_0x1b5e04['where']=_['merge'](_0x1b5e04[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x1b5e04[_0x79b8('0x3d')],function(_0x4db5a5){var _0x1e6ce2={};_0x1e6ce2[_0x4db5a5]={'$like':'%'+_0x2b7e60[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x1e6ce2;})});}_0x1b5e04=_['merge']({},_0x1b5e04,_0x2b7e60[_0x79b8('0x48')]);return db[_0x79b8('0x65')][_0x79b8('0x4a')]({'where':_0x1b5e04[_0x79b8('0x42')]})[_0x79b8('0x27')](function(_0x452b7e){_0xbc1e3f[_0x79b8('0x4a')]=_0x452b7e;if(_0x2b7e60['query'][_0x79b8('0x4b')]){_0x1b5e04[_0x79b8('0x4c')]=[{'all':!![]}];}return db[_0x79b8('0x65')][_0x79b8('0x63')](_0x1b5e04);})[_0x79b8('0x27')](function(_0x20673a){_0xbc1e3f['rows']=_0x20673a;return _0xbc1e3f;});}})[_0x79b8('0x27')](respondWithFilteredResult(_0x4d5fcf,_0x1b5e04))[_0x79b8('0x4e')](handleError(_0x4d5fcf,null));};exports[_0x79b8('0x67')]=function(_0x2cc8ba,_0xf83823,_0x42002d){var _0x98038c={'raw':!![],'where':{}};var _0x142142={};var _0x4e5bda={'count':0x0,'rows':[]};return db[_0x79b8('0x49')]['findOne']({'where':{'id':_0x2cc8ba[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0xf83823,null))[_0x79b8('0x27')](function(_0x3aeea1){if(_0x3aeea1){_0x142142[_0x79b8('0x39')]=_['keys'](db[_0x79b8('0x68')][_0x79b8('0x38')]);_0x142142[_0x79b8('0x3b')]=_[_0x79b8('0x3a')](_0x2cc8ba[_0x79b8('0x3b')]);_0x142142['filters']=_[_0x79b8('0x3c')](_0x142142['model'],_0x142142[_0x79b8('0x3b')]);_0x98038c['attributes']=_['intersection'](_0x142142[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x2cc8ba[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x98038c['attributes']=_0x98038c['attributes']['length']?_0x98038c['attributes']:_0x142142[_0x79b8('0x39')];if(!_0x2cc8ba[_0x79b8('0x3b')][_0x79b8('0x61')](_0x79b8('0x3f'))){_0x98038c[_0x79b8('0x40')]=qs[_0x79b8('0x40')](_0x2cc8ba['query']['limit']);_0x98038c[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0x2cc8ba['query'][_0x79b8('0x20')]);}_0x98038c[_0x79b8('0x66')]=qs['sort'](_0x2cc8ba['query'][_0x79b8('0x41')]);_0x98038c[_0x79b8('0x42')]=qs['filters'](_[_0x79b8('0x44')](_0x2cc8ba[_0x79b8('0x3b')],_0x142142[_0x79b8('0x43')]));_0x98038c['where']['VoiceQueueId']=_0x3aeea1['id'];if(_0x2cc8ba[_0x79b8('0x3b')][_0x79b8('0x45')]){_0x98038c[_0x79b8('0x42')]=_['merge'](_0x98038c[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x98038c[_0x79b8('0x3d')],function(_0x11f3b0){var _0x22ea80={};_0x22ea80[_0x11f3b0]={'$like':'%'+_0x2cc8ba[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x22ea80;})});}_0x98038c=_[_0x79b8('0x46')]({},_0x98038c,_0x2cc8ba[_0x79b8('0x48')]);return db[_0x79b8('0x68')]['count']({'where':_0x98038c['where']})[_0x79b8('0x27')](function(_0x330c73){_0x4e5bda[_0x79b8('0x4a')]=_0x330c73;if(_0x2cc8ba['query'][_0x79b8('0x4b')]){_0x98038c[_0x79b8('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x79b8('0x63')](_0x98038c);})[_0x79b8('0x27')](function(_0x17ac97){_0x4e5bda[_0x79b8('0x4d')]=_0x17ac97;return _0x4e5bda;});}})['then'](respondWithFilteredResult(_0xf83823,_0x98038c))[_0x79b8('0x4e')](handleError(_0xf83823,null));};exports['getHopperBlacks']=function(_0x5965a0,_0x445ab2,_0x3b7473){var _0x59da9a={'raw':!![],'where':{}};var _0x3339a0={};var _0xb16342={'count':0x0,'rows':[]};return db[_0x79b8('0x49')]['findOne']({'where':{'id':_0x5965a0[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x445ab2,null))[_0x79b8('0x27')](function(_0x20391e){if(_0x20391e){_0x3339a0[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x69')][_0x79b8('0x38')]);_0x3339a0[_0x79b8('0x3b')]=_['keys'](_0x5965a0['query']);_0x3339a0['filters']=_[_0x79b8('0x3c')](_0x3339a0[_0x79b8('0x39')],_0x3339a0[_0x79b8('0x3b')]);_0x59da9a['attributes']=_['intersection'](_0x3339a0[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x5965a0[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x59da9a[_0x79b8('0x3d')]=_0x59da9a[_0x79b8('0x3d')]['length']?_0x59da9a[_0x79b8('0x3d')]:_0x3339a0[_0x79b8('0x39')];if(!_0x5965a0[_0x79b8('0x3b')][_0x79b8('0x61')](_0x79b8('0x3f'))){_0x59da9a[_0x79b8('0x40')]=qs['limit'](_0x5965a0[_0x79b8('0x3b')][_0x79b8('0x40')]);_0x59da9a[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0x5965a0[_0x79b8('0x3b')][_0x79b8('0x20')]);}_0x59da9a[_0x79b8('0x66')]=qs['sort'](_0x5965a0['query']['sort']);_0x59da9a[_0x79b8('0x42')]=qs[_0x79b8('0x43')](_['pick'](_0x5965a0[_0x79b8('0x3b')],_0x3339a0[_0x79b8('0x43')]));_0x59da9a[_0x79b8('0x42')][_0x79b8('0x62')]=_0x20391e['id'];if(_0x5965a0[_0x79b8('0x3b')][_0x79b8('0x45')]){_0x59da9a['where']=_[_0x79b8('0x46')](_0x59da9a[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x59da9a[_0x79b8('0x3d')],function(_0x49ea78){var _0x267aec={};_0x267aec[_0x49ea78]={'$like':'%'+_0x5965a0[_0x79b8('0x3b')]['filter']+'%'};return _0x267aec;})});}_0x59da9a=_['merge']({},_0x59da9a,_0x5965a0[_0x79b8('0x48')]);return db[_0x79b8('0x69')]['count']({'where':_0x59da9a['where']})['then'](function(_0x1add5e){_0xb16342[_0x79b8('0x4a')]=_0x1add5e;if(_0x5965a0['query']['includeAll']){_0x59da9a[_0x79b8('0x4c')]=[{'all':!![]}];}return db[_0x79b8('0x69')][_0x79b8('0x63')](_0x59da9a);})[_0x79b8('0x27')](function(_0x43f6f7){_0xb16342[_0x79b8('0x4d')]=_0x43f6f7;return _0xb16342;});}})[_0x79b8('0x27')](respondWithFilteredResult(_0x445ab2,_0x59da9a))[_0x79b8('0x4e')](handleError(_0x445ab2,null));};exports[_0x79b8('0x6a')]=function(_0x2056b3,_0x340807,_0x12d42d){var _0x4c9213={};var _0x3d4680={};var _0x7d7ea5;var _0x635e53;return db[_0x79b8('0x49')]['findOne']({'where':{'id':_0x2056b3['params']['id']}})['then'](handleEntityNotFound(_0x340807,null))[_0x79b8('0x27')](function(_0x28c692){if(_0x28c692){_0x7d7ea5=_0x28c692;_0x3d4680[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x6b')][_0x79b8('0x38')]);_0x3d4680['query']=_[_0x79b8('0x3a')](_0x2056b3['query']);_0x3d4680[_0x79b8('0x43')]=_['intersection'](_0x3d4680[_0x79b8('0x39')],_0x3d4680[_0x79b8('0x3b')]);_0x4c9213[_0x79b8('0x3d')]=_[_0x79b8('0x3c')](_0x3d4680[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x2056b3[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x4c9213['attributes']=_0x4c9213[_0x79b8('0x3d')][_0x79b8('0x4f')]?_0x4c9213[_0x79b8('0x3d')]:_0x3d4680[_0x79b8('0x39')];_0x4c9213[_0x79b8('0x66')]=qs[_0x79b8('0x41')](_0x2056b3[_0x79b8('0x3b')][_0x79b8('0x41')]);_0x4c9213[_0x79b8('0x42')]=qs[_0x79b8('0x43')](_[_0x79b8('0x44')](_0x2056b3['query'],_0x3d4680[_0x79b8('0x43')]));if(_0x2056b3[_0x79b8('0x3b')][_0x79b8('0x45')]){_0x4c9213[_0x79b8('0x42')]=_['merge'](_0x4c9213['where'],{'$or':_[_0x79b8('0x2e')](_0x4c9213[_0x79b8('0x3d')],function(_0xd18d43){var _0x209e05={};_0x209e05[_0xd18d43]={'$like':'%'+_0x2056b3[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x209e05;})});}_0x4c9213=_['merge']({},_0x4c9213,_0x2056b3['options']);return _0x7d7ea5[_0x79b8('0x6a')](_0x4c9213);}})['then'](function(_0x5e4889){if(_0x5e4889){_0x635e53=_0x5e4889[_0x79b8('0x4f')];if(!_0x2056b3['query'][_0x79b8('0x61')](_0x79b8('0x3f'))){_0x4c9213[_0x79b8('0x40')]=qs[_0x79b8('0x40')](_0x2056b3[_0x79b8('0x3b')][_0x79b8('0x40')]);_0x4c9213[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0x2056b3[_0x79b8('0x3b')][_0x79b8('0x20')]);}return _0x7d7ea5['getTeams'](_0x4c9213);}})[_0x79b8('0x27')](function(_0x5100c9){if(_0x5100c9){return _0x5100c9?{'count':_0x635e53,'rows':_0x5100c9}:null;}})[_0x79b8('0x27')](respondWithResult(_0x340807,null))['catch'](handleError(_0x340807,null));};exports[_0x79b8('0x6c')]=function(_0x1dbcb0,_0x224696,_0x1fe02f){var _0x332f7c=_0x1dbcb0['body'][_0x79b8('0x6d')];return db[_0x79b8('0x6b')][_0x79b8('0x63')]({'where':{'id':_['map'](_0x332f7c,'id')},'attributes':['id'],'include':[{'model':db[_0x79b8('0x6e')],'as':_0x79b8('0x6f'),'attributes':['id',_0x79b8('0x36'),_0x79b8('0x70'),_0x79b8('0x71'),_0x79b8('0x72')],'raw':!![]}]})['then'](function(_0x2e1236){if(_0x2e1236){var _0x11c9cf=_[_0x79b8('0x73')](_0x2e1236,function(_0x564735){var _0x23c51f=_0x564735[_0x79b8('0x29')]({'plain':!![]});_0x23c51f[_0x79b8('0x6f')][_0x79b8('0x74')](function(_0x57905f){_0x57905f[_0x79b8('0x75')]=_[_0x79b8('0x32')](_0x332f7c,{'id':_0x23c51f['id']})[_0x79b8('0x75')];});return _0x23c51f['Agents'];});return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x1dbcb0[_0x79b8('0x59')]['id']}})['then'](function(_0x38514b){return db[_0x79b8('0x76')][_0x79b8('0x77')](function(_0x53c5ac){return _0x38514b[_0x79b8('0x6c')](_[_0x79b8('0x2e')](_0x332f7c,'id'),{'transaction':_0x53c5ac})[_0x79b8('0x27')](function(){return BPromise[_0x79b8('0x78')](_0x11c9cf,function(_0x1e835f){return db[_0x79b8('0x79')][_0x79b8('0x7a')]({'where':{'UserId':_0x1e835f['id'],'VoiceQueueId':_0x1dbcb0[_0x79b8('0x59')]['id']},'defaults':{'penalty':_0x1e835f[_0x79b8('0x75')]},'transaction':_0x53c5ac});});})[_0x79b8('0x27')](function(){return BPromise[_0x79b8('0x78')](_[_0x79b8('0x45')](_0x11c9cf,{'online':!![]}),function(_0x59ee59){return db[_0x79b8('0x7b')][_0x79b8('0x7c')]({'membername':_0x59ee59[_0x79b8('0x36')],'UserId':_0x59ee59['id'],'queue_name':_0x38514b['name'],'VoiceQueueId':_0x38514b['id'],'interface':_['isNil'](_0x59ee59['interface'])?util[_0x79b8('0x7d')](_0x79b8('0x7e'),_0x59ee59[_0x79b8('0x36')]):_0x59ee59[_0x79b8('0x72')],'paused':_0x59ee59[_0x79b8('0x71')]||![],'penalty':_0x59ee59[_0x79b8('0x75')]},{'transaction':_0x53c5ac});});})[_0x79b8('0x27')](function(){_0x11c9cf[_0x79b8('0x74')](function(_0x5d3d01){socket['emit'](_0x79b8('0x7f'),{'UserId':_0x5d3d01['id'],'VoiceQueueId':_0x38514b['id']});});});});});}})['then'](respondWithStatusCode(_0x224696,null))['catch'](handleError(_0x224696,null));};exports['removeTeams']=function(_0x5be0f4,_0x27463a,_0x4a302b){return db[_0x79b8('0x6b')][_0x79b8('0x63')]({'where':{'id':_0x5be0f4[_0x79b8('0x3b')][_0x79b8('0x80')]},'attributes':['id'],'include':[{'model':db[_0x79b8('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x79b8('0x27')](handleEntityNotFound(_0x27463a,null))[_0x79b8('0x27')](function(_0x651e96){var _0x431c87=_[_0x79b8('0x2e')](_0x651e96,'id');var _0x151ef6=[];var _0xafc97a=[];var _0x3957da=squel[_0x79b8('0x81')]();_0x3957da[_0x79b8('0x82')](_0x79b8('0x83'))['from'](_0x79b8('0x84'),'tq')['join']('user_has_teams','ut',_0x79b8('0x85'))[_0x79b8('0x42')](_0x79b8('0x86'),_0x5be0f4[_0x79b8('0x59')]['id']);for(var _0x45e6e2=0x0;_0x45e6e2<_0x651e96[_0x79b8('0x4f')];_0x45e6e2+=0x1){let _0x3a0ef6=_0x651e96[_0x45e6e2];for(var _0x5024a4=0x0;_0x5024a4<_0x3a0ef6[_0x79b8('0x6f')][_0x79b8('0x4f')];_0x5024a4+=0x1){let _0x5daca6=_0x3a0ef6[_0x79b8('0x6f')][_0x5024a4];var _0x1089f1=_0x3957da[_0x79b8('0x87')]();_0x1089f1['where']('ut.UserId\x20=\x20?',_0x5daca6['id']);_0xafc97a[_0x79b8('0x88')](db[_0x79b8('0x76')][_0x79b8('0x3b')](_0x1089f1['toString'](),{'type':db['sequelize'][_0x79b8('0x89')][_0x79b8('0x8a')]})[_0x79b8('0x27')](function(_0x1abf88){if(_0x1abf88[_0x79b8('0x4f')]===0x1){return _0x5daca6['id'];}else{var _0x285d62=_['every'](_[_0x79b8('0x2e')](_0x1abf88,_0x79b8('0x8b')),function(_0x32e610){return _[_0x79b8('0x30')](_0x431c87,_0x32e610);});if(_0x285d62){return _0x5daca6['id'];}}}));}}return BPromise[_0x79b8('0x8c')](_0xafc97a)[_0x79b8('0x27')](function(_0x3b393c){_0x151ef6=_(_0x151ef6)['union'](_0x3b393c)[_0x79b8('0x8d')]()[_0x79b8('0x2f')]();return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x5be0f4[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](function(_0x5217ab){return db['sequelize']['transaction'](function(_0x49860d){return _0x5217ab[_0x79b8('0x8e')](_0x5be0f4[_0x79b8('0x3b')][_0x79b8('0x80')],{'transaction':_0x49860d})[_0x79b8('0x27')](function(){if(!_[_0x79b8('0x8f')](_0x151ef6)){return _0x5217ab[_0x79b8('0x90')](_0x151ef6,{'transaction':_0x49860d})[_0x79b8('0x27')](function(){return db[_0x79b8('0x7b')][_0x79b8('0x28')]({'where':{'VoiceQueueId':_0x5be0f4['params']['id'],'UserId':_0x151ef6},'transaction':_0x49860d});});}})[_0x79b8('0x27')](function(){_0x151ef6['forEach'](function(_0x5d8937){socket['emit'](_0x79b8('0x91'),{'UserId':_0x5d8937,'VoiceQueueId':_0x5217ab['id']});});});});});});})[_0x79b8('0x27')](respondWithStatusCode(_0x27463a,null))[_0x79b8('0x4e')](handleError(_0x27463a,null));};exports[_0x79b8('0x92')]=function(_0x29daf0,_0x489673,_0x2b05c8){var _0x55aceb,_0x11193f;return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x29daf0[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x489673,null))['then'](function(_0x23e775){if(_0x23e775){_0x11193f=_0x23e775;return _0x23e775['addAgents'](_0x29daf0[_0x79b8('0x51')][_0x79b8('0x80')],_[_0x79b8('0x5b')](_0x29daf0[_0x79b8('0x51')],[_0x79b8('0x80'),'id'])||{})[_0x79b8('0x93')](function(_0x4cfe9b){for(var _0x359aa9=0x0;_0x359aa9<_0x29daf0['body'][_0x79b8('0x80')]['length'];_0x359aa9+=0x1){socket[_0x79b8('0x94')]('userVoiceQueue:save',{'UserId':_0x29daf0[_0x79b8('0x51')]['ids'][_0x359aa9],'VoiceQueueId':_0x29daf0[_0x79b8('0x59')]['id']});}return _0x4cfe9b;});}})[_0x79b8('0x27')](function(_0x1dec62){_0x55aceb=_0x1dec62||[];if(_0x11193f){return db[_0x79b8('0x6e')][_0x79b8('0x63')]({'where':{'id':_0x29daf0[_0x79b8('0x51')][_0x79b8('0x80')]},'attributes':['id',_0x79b8('0x36'),_0x79b8('0x70'),_0x79b8('0x71'),_0x79b8('0x72')],'raw':!![]});}})['then'](function(_0x3ec7f0){if(!_[_0x79b8('0x8f')](_0x3ec7f0)){var _0x237db0=[];for(var _0xbde21f=0x0;_0xbde21f<_0x3ec7f0[_0x79b8('0x4f')];_0xbde21f++){if(_0x3ec7f0[_0xbde21f][_0x79b8('0x70')]){_0x237db0[_0x79b8('0x88')](db[_0x79b8('0x7b')][_0x79b8('0x7c')]({'membername':_0x3ec7f0[_0xbde21f][_0x79b8('0x36')],'UserId':_0x3ec7f0[_0xbde21f]['id'],'queue_name':_0x11193f[_0x79b8('0x36')],'VoiceQueueId':_0x11193f['id'],'interface':_[_0x79b8('0x95')](_0x3ec7f0[_0xbde21f][_0x79b8('0x72')])?util[_0x79b8('0x7d')](_0x79b8('0x7e'),_0x3ec7f0[_0xbde21f][_0x79b8('0x36')]):_0x3ec7f0[_0xbde21f][_0x79b8('0x72')],'paused':_0x3ec7f0[_0xbde21f]['voicePause']||![],'penalty':_0x29daf0['body'][_0x79b8('0x75')]||0x0}));}}return BPromise[_0x79b8('0x8c')](_0x237db0);}})[_0x79b8('0x27')](function(){return _0x55aceb;})[_0x79b8('0x27')](respondWithResult(_0x489673,null))[_0x79b8('0x4e')](handleError(_0x489673,null));};exports[_0x79b8('0x90')]=function(_0x197d8b,_0x4d2c8b,_0x2d6cef){return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x197d8b[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x4d2c8b,null))[_0x79b8('0x27')](function(_0x4bfeb1){if(_0x4bfeb1){return _0x4bfeb1[_0x79b8('0x90')](_0x197d8b[_0x79b8('0x3b')][_0x79b8('0x80')])['then'](function(){if(_[_0x79b8('0x96')](_0x197d8b[_0x79b8('0x3b')][_0x79b8('0x80')])){for(var _0x3f1ad8=0x0;_0x3f1ad8<_0x197d8b[_0x79b8('0x3b')]['ids'][_0x79b8('0x4f')];_0x3f1ad8+=0x1){socket['emit'](_0x79b8('0x91'),{'UserId':Number(_0x197d8b['query'][_0x79b8('0x80')][_0x3f1ad8]),'VoiceQueueId':Number(_0x197d8b[_0x79b8('0x59')]['id'])});}}else{socket[_0x79b8('0x94')](_0x79b8('0x91'),{'UserId':Number(_0x197d8b[_0x79b8('0x3b')]['ids']),'VoiceQueueId':Number(_0x197d8b['params']['id'])});}});}})[_0x79b8('0x27')](function(_0x2cecfd){return db[_0x79b8('0x7b')][_0x79b8('0x28')]({'where':{'VoiceQueueId':_0x197d8b[_0x79b8('0x59')]['id'],'UserId':_0x197d8b[_0x79b8('0x3b')][_0x79b8('0x80')]}})[_0x79b8('0x27')](function(){return _0x2cecfd;});})[_0x79b8('0x27')](respondWithStatusCode(_0x4d2c8b,null))[_0x79b8('0x4e')](handleError(_0x4d2c8b,null));};exports['getAgents']=function(_0xf54453,_0x4406cc,_0x197b15){var _0x2a89cd={};var _0x17af05={};var _0x518e72;var _0x8db353;return db[_0x79b8('0x49')][_0x79b8('0x5f')]({'where':{'id':_0xf54453[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x4406cc,null))[_0x79b8('0x27')](function(_0x510b44){if(_0x510b44){_0x518e72=_0x510b44;_0x17af05[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x6e')]['rawAttributes']);_0x17af05[_0x79b8('0x3b')]=_['keys'](_0xf54453[_0x79b8('0x3b')]);_0x17af05[_0x79b8('0x43')]=_[_0x79b8('0x3c')](_0x17af05[_0x79b8('0x39')],_0x17af05[_0x79b8('0x3b')]);_0x2a89cd[_0x79b8('0x3d')]=_['intersection'](_0x17af05[_0x79b8('0x39')],qs['fields'](_0xf54453[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x2a89cd[_0x79b8('0x3d')]=_0x2a89cd[_0x79b8('0x3d')]['length']?_0x2a89cd[_0x79b8('0x3d')]:_0x17af05[_0x79b8('0x39')];_0x2a89cd[_0x79b8('0x66')]=qs[_0x79b8('0x41')](_0xf54453[_0x79b8('0x3b')][_0x79b8('0x41')]);_0x2a89cd[_0x79b8('0x42')]=qs[_0x79b8('0x43')](_[_0x79b8('0x44')](_0xf54453['query'],_0x17af05[_0x79b8('0x43')]));if(_0xf54453[_0x79b8('0x3b')][_0x79b8('0x45')]){_0x2a89cd[_0x79b8('0x42')]=_[_0x79b8('0x46')](_0x2a89cd[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x2a89cd['attributes'],function(_0x510724){var _0x275169={};_0x275169[_0x510724]={'$like':'%'+_0xf54453[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x275169;})});}_0x2a89cd=_[_0x79b8('0x46')]({},_0x2a89cd,_0xf54453['options']);return _0x518e72[_0x79b8('0x97')](_0x2a89cd);}})[_0x79b8('0x27')](function(_0x3c7a6e){if(_0x3c7a6e){_0x8db353=_0x3c7a6e[_0x79b8('0x4f')];if(!_0xf54453[_0x79b8('0x3b')]['hasOwnProperty']('nolimit')){_0x2a89cd['limit']=qs[_0x79b8('0x40')](_0xf54453[_0x79b8('0x3b')][_0x79b8('0x40')]);_0x2a89cd[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0xf54453['query'][_0x79b8('0x20')]);}return _0x518e72[_0x79b8('0x97')](_0x2a89cd);}})[_0x79b8('0x27')](function(_0x1d70fc){if(_0x1d70fc){return _0x1d70fc?{'count':_0x8db353,'rows':_0x1d70fc}:null;}})[_0x79b8('0x27')](respondWithResult(_0x4406cc,null))[_0x79b8('0x4e')](handleError(_0x4406cc,null));};exports[_0x79b8('0x98')]=function(_0x555dd5,_0x2a61bb,_0x510241){var _0x899af6={};var _0x363276={};var _0x123c75;var _0x429a10;return db[_0x79b8('0x49')][_0x79b8('0x5f')]({'where':{'id':_0x555dd5['params']['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x2a61bb,null))[_0x79b8('0x27')](function(_0x39867e){if(_0x39867e){_0x123c75=_0x39867e;_0x363276[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db['UserVoiceQueueRt'][_0x79b8('0x38')]);_0x363276['query']=_[_0x79b8('0x3a')](_0x555dd5[_0x79b8('0x3b')]);_0x363276[_0x79b8('0x43')]=_[_0x79b8('0x3c')](_0x363276[_0x79b8('0x39')],_0x363276[_0x79b8('0x3b')]);_0x899af6[_0x79b8('0x3d')]=_[_0x79b8('0x3c')](_0x363276[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x555dd5['query'][_0x79b8('0x3e')]));_0x899af6[_0x79b8('0x3d')]=_0x899af6[_0x79b8('0x3d')][_0x79b8('0x4f')]?_0x899af6['attributes']:_0x363276[_0x79b8('0x39')];_0x899af6['order']=qs[_0x79b8('0x41')](_0x555dd5[_0x79b8('0x3b')][_0x79b8('0x41')]);_0x899af6[_0x79b8('0x42')]=qs['filters'](_[_0x79b8('0x44')](_0x555dd5['query'],_0x363276[_0x79b8('0x43')]));if(_0x555dd5['query'][_0x79b8('0x45')]){_0x899af6[_0x79b8('0x42')]=_[_0x79b8('0x46')](_0x899af6[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x899af6['attributes'],function(_0x58ad0a){var _0x5177bd={};_0x5177bd[_0x58ad0a]={'$like':'%'+_0x555dd5[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x5177bd;})});}_0x899af6=_[_0x79b8('0x46')]({},_0x899af6,_0x555dd5['options']);return _0x123c75['getMembers'](_0x899af6);}})[_0x79b8('0x27')](function(_0x444c7d){if(_0x444c7d){_0x429a10=_0x444c7d[_0x79b8('0x4f')];if(!_0x555dd5[_0x79b8('0x3b')][_0x79b8('0x61')](_0x79b8('0x3f'))){_0x899af6[_0x79b8('0x40')]=qs['limit'](_0x555dd5['query'][_0x79b8('0x40')]);_0x899af6[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0x555dd5['query'][_0x79b8('0x20')]);}return _0x123c75[_0x79b8('0x98')](_0x899af6);}})['then'](function(_0x459a43){return _0x459a43?{'count':_0x429a10,'rows':_0x459a43}:null;})['then'](respondWithResult(_0x2a61bb,null))[_0x79b8('0x4e')](handleError(_0x2a61bb,null));};exports[_0x79b8('0x99')]=function(_0x5ba8f7,_0x32e77e,_0x7cbf0){var _0x58958e={};var _0xe5e2f5={};var _0x72a5fd;var _0x17dd96;return db['VoiceQueue'][_0x79b8('0x5f')]({'where':{'id':_0x5ba8f7[_0x79b8('0x59')]['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x32e77e,null))[_0x79b8('0x27')](function(_0x21625a){if(_0x21625a){_0x72a5fd=_0x21625a;_0xe5e2f5[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x9a')][_0x79b8('0x38')]);_0xe5e2f5[_0x79b8('0x3b')]=_[_0x79b8('0x3a')](_0x5ba8f7[_0x79b8('0x3b')]);_0xe5e2f5[_0x79b8('0x43')]=_[_0x79b8('0x3c')](_0xe5e2f5[_0x79b8('0x39')],_0xe5e2f5[_0x79b8('0x3b')]);_0x58958e[_0x79b8('0x3d')]=_['intersection'](_0xe5e2f5[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x5ba8f7[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x58958e['attributes']=_0x58958e[_0x79b8('0x3d')][_0x79b8('0x4f')]?_0x58958e[_0x79b8('0x3d')]:_0xe5e2f5['model'];_0x58958e[_0x79b8('0x66')]=qs[_0x79b8('0x41')](_0x5ba8f7[_0x79b8('0x3b')][_0x79b8('0x41')]);_0x58958e[_0x79b8('0x42')]=qs[_0x79b8('0x43')](_[_0x79b8('0x44')](_0x5ba8f7[_0x79b8('0x3b')],_0xe5e2f5[_0x79b8('0x43')]));if(_0x5ba8f7[_0x79b8('0x3b')][_0x79b8('0x45')]){_0x58958e[_0x79b8('0x42')]=_[_0x79b8('0x46')](_0x58958e[_0x79b8('0x42')],{'$or':_[_0x79b8('0x2e')](_0x58958e[_0x79b8('0x3d')],function(_0x3df479){var _0x424e8a={};_0x424e8a[_0x3df479]={'$like':'%'+_0x5ba8f7[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x424e8a;})});}_0x58958e=_['merge']({},_0x58958e,_0x5ba8f7[_0x79b8('0x48')]);return _0x72a5fd[_0x79b8('0x99')](_0x58958e);}})[_0x79b8('0x27')](function(_0x521168){if(_0x521168){_0x17dd96=_0x521168['length'];if(!_0x5ba8f7[_0x79b8('0x3b')][_0x79b8('0x61')](_0x79b8('0x3f'))){_0x58958e[_0x79b8('0x40')]=qs['limit'](_0x5ba8f7[_0x79b8('0x3b')][_0x79b8('0x40')]);_0x58958e[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0x5ba8f7[_0x79b8('0x3b')]['offset']);}return _0x72a5fd[_0x79b8('0x99')](_0x58958e);}})[_0x79b8('0x27')](function(_0x3a62ab){if(_0x3a62ab){return _0x3a62ab?{'count':_0x17dd96,'rows':_0x3a62ab}:null;}})[_0x79b8('0x27')](respondWithResult(_0x32e77e,null))[_0x79b8('0x4e')](handleError(_0x32e77e,null));};exports[_0x79b8('0x9b')]=function(_0x4e775b,_0x4da13e,_0x24fbdb){var _0x30b8df,_0x3b7b1b;return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x4e775b[_0x79b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x4da13e,null))['then'](function(_0x1aee39){if(_0x1aee39){_0x3b7b1b=_0x1aee39;return _0x1aee39[_0x79b8('0x9b')](_0x4e775b['body'][_0x79b8('0x80')],_[_0x79b8('0x5b')](_0x4e775b[_0x79b8('0x51')],[_0x79b8('0x80'),'id'])||{});}return null;})[_0x79b8('0x93')](function(_0x4c0ffe){var _0x3cd36a;_0x30b8df=_0x4c0ffe||[];var _0x5ae5eb=[];if(_0x4c0ffe){for(var _0x60272d=0x0;_0x60272d<_0x4c0ffe[_0x79b8('0x4f')];_0x60272d+=0x1){var _0x264f6b=_0x4c0ffe[_0x60272d]['get']({'plain':!![]});_0x3b7b1b[_0x79b8('0x9c')]=_0x4e775b['body'][_0x79b8('0x9c')]?_0x4e775b[_0x79b8('0x51')]['dialCheckDuplicateType']:_0x3b7b1b[_0x79b8('0x9c')];switch(_0x3b7b1b[_0x79b8('0x9c')]){case _0x79b8('0x9d'):_0x3cd36a=squel[_0x79b8('0x9e')]()[_0x79b8('0x9f')]('cm_hopper')[_0x79b8('0xa0')]([_0x79b8('0xa1'),_0x79b8('0xa2'),_0x79b8('0xa3'),_0x79b8('0xa4'),'VoiceQueueId',_0x79b8('0x5a'),_0x79b8('0x5c')],squel[_0x79b8('0x81')]()['field'](_0x79b8('0xa1'),_0x79b8('0xa1'))[_0x79b8('0x82')]('NOW()','scheduledAt')['field']('id',_0x79b8('0xa3'))[_0x79b8('0x82')](_0x264f6b[_0x79b8('0xa5')][_0x79b8('0xa6')](),_0x79b8('0xa4'))['field'](_0x4e775b[_0x79b8('0x59')]['id'][_0x79b8('0xa6')](),_0x79b8('0x62'))['field'](_0x79b8('0xa7'),_0x79b8('0x5a'))[_0x79b8('0x82')](_0x79b8('0xa7'),'updatedAt')[_0x79b8('0xa8')](_0x79b8('0xa9'))[_0x79b8('0x42')](_0x79b8('0xaa'))['where'](_0x79b8('0xab'),_0x264f6b[_0x79b8('0xa5')]['toString']())[_0x79b8('0x42')](_0x79b8('0xac'))[_0x79b8('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x79b8('0x81')]()[_0x79b8('0x82')](_0x79b8('0xad'))[_0x79b8('0xa8')](_0x79b8('0xae'))[_0x79b8('0x42')](_0x79b8('0x86'),_0x4e775b['params']['id'][_0x79b8('0xa6')]()))[_0x79b8('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x79b8('0x81')]()[_0x79b8('0x82')]('COALESCE(phone,\x27\x27)')['from'](_0x79b8('0xaf'))['where'](_0x79b8('0x86'),_0x4e775b[_0x79b8('0x59')]['id'][_0x79b8('0xa6')]())))[_0x79b8('0xa6')]();break;case _0x79b8('0xb0'):_0x3cd36a=squel[_0x79b8('0x9e')]()['into']('cm_hopper')[_0x79b8('0xa0')]([_0x79b8('0xa1'),_0x79b8('0xa2'),'ContactId',_0x79b8('0xa4'),_0x79b8('0x62'),'createdAt','updatedAt'],squel['select']()['field'](_0x79b8('0xa1'),'phone')[_0x79b8('0x82')]('NOW()',_0x79b8('0xa2'))[_0x79b8('0x82')]('id',_0x79b8('0xa3'))[_0x79b8('0x82')](_0x264f6b[_0x79b8('0xa5')]['toString'](),_0x79b8('0xa4'))[_0x79b8('0x82')](_0x4e775b[_0x79b8('0x59')]['id'][_0x79b8('0xa6')](),'VoiceQueueId')[_0x79b8('0x82')](_0x79b8('0xa7'),_0x79b8('0x5a'))[_0x79b8('0x82')](_0x79b8('0xa7'),_0x79b8('0x5c'))[_0x79b8('0xa8')]('cm_contacts')[_0x79b8('0x42')](_0x79b8('0xaa'))[_0x79b8('0x42')](_0x79b8('0xab'),_0x264f6b['CmListId'][_0x79b8('0xa6')]())[_0x79b8('0x42')](_0x79b8('0xac'))[_0x79b8('0x42')](_0x79b8('0xb1'),squel[_0x79b8('0x81')]()[_0x79b8('0x82')]('COALESCE(phone,\x27\x27)')[_0x79b8('0xa8')](_0x79b8('0xaf'))[_0x79b8('0x42')]('VoiceQueueId\x20=\x20?',_0x4e775b[_0x79b8('0x59')]['id'][_0x79b8('0xa6')]())))[_0x79b8('0xa6')]();break;default:_0x3cd36a=squel[_0x79b8('0x9e')]()[_0x79b8('0x9f')](_0x79b8('0xaf'))[_0x79b8('0xa0')]([_0x79b8('0xa1'),_0x79b8('0xa2'),'ContactId','ListId',_0x79b8('0x62'),_0x79b8('0x5a'),_0x79b8('0x5c')],squel[_0x79b8('0x81')]()[_0x79b8('0x82')](_0x79b8('0xa1'),_0x79b8('0xa1'))['field'](_0x79b8('0xa7'),_0x79b8('0xa2'))[_0x79b8('0x82')]('id',_0x79b8('0xa3'))[_0x79b8('0x82')](_0x264f6b[_0x79b8('0xa5')][_0x79b8('0xa6')](),_0x79b8('0xa4'))['field'](_0x4e775b[_0x79b8('0x59')]['id'][_0x79b8('0xa6')](),_0x79b8('0x62'))['field'](_0x79b8('0xa7'),_0x79b8('0x5a'))[_0x79b8('0x82')](_0x79b8('0xa7'),'updatedAt')['from'](_0x79b8('0xa9'))[_0x79b8('0x42')]('deletedAt\x20IS\x20NULL')[_0x79b8('0x42')](_0x79b8('0xab'),_0x264f6b[_0x79b8('0xa5')][_0x79b8('0xa6')]())[_0x79b8('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x79b8('0xa6')]();}_0x5ae5eb[_0x79b8('0x88')](db[_0x79b8('0x76')][_0x79b8('0x3b')](_0x3cd36a));}return BPromise[_0x79b8('0x8c')](_0x5ae5eb);}})[_0x79b8('0x27')](function(){return _0x30b8df;})[_0x79b8('0x27')](respondWithResult(_0x4da13e,null))[_0x79b8('0x4e')](handleError(_0x4da13e,null));};exports[_0x79b8('0xb2')]=function(_0x45f385,_0x5c5a38,_0x52d7bd){return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x45f385[_0x79b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c5a38,null))['then'](function(_0x1ffd9c){if(_0x1ffd9c){return _0x1ffd9c[_0x79b8('0xb2')](_0x45f385[_0x79b8('0x3b')]['ids']);}})[_0x79b8('0x27')](function(_0x41a4e5){if(_0x41a4e5){return db[_0x79b8('0x60')][_0x79b8('0x28')]({'where':{'ListId':_0x45f385[_0x79b8('0x3b')][_0x79b8('0x80')],'VoiceQueueId':_0x45f385['params']['id']}})[_0x79b8('0x27')](function(){return _0x41a4e5;});}})[_0x79b8('0x27')](respondWithStatusCode(_0x5c5a38,null))[_0x79b8('0x4e')](handleError(_0x5c5a38,null));};exports[_0x79b8('0xb3')]=function(_0x21c09c,_0x26e524,_0x594508){var _0x5ca137={};var _0x1df93b={};var _0x2af107;var _0x249164;return db[_0x79b8('0x49')][_0x79b8('0x5f')]({'where':{'id':_0x21c09c['params']['id']}})[_0x79b8('0x27')](handleEntityNotFound(_0x26e524,null))[_0x79b8('0x27')](function(_0x1baa72){if(_0x1baa72){_0x2af107=_0x1baa72;_0x1df93b[_0x79b8('0x39')]=_[_0x79b8('0x3a')](db[_0x79b8('0x9a')][_0x79b8('0x38')]);_0x1df93b[_0x79b8('0x3b')]=_[_0x79b8('0x3a')](_0x21c09c[_0x79b8('0x3b')]);_0x1df93b[_0x79b8('0x43')]=_[_0x79b8('0x3c')](_0x1df93b[_0x79b8('0x39')],_0x1df93b[_0x79b8('0x3b')]);_0x5ca137[_0x79b8('0x3d')]=_[_0x79b8('0x3c')](_0x1df93b[_0x79b8('0x39')],qs[_0x79b8('0x3e')](_0x21c09c[_0x79b8('0x3b')][_0x79b8('0x3e')]));_0x5ca137[_0x79b8('0x3d')]=_0x5ca137['attributes'][_0x79b8('0x4f')]?_0x5ca137['attributes']:_0x1df93b[_0x79b8('0x39')];_0x5ca137[_0x79b8('0x66')]=qs[_0x79b8('0x41')](_0x21c09c[_0x79b8('0x3b')][_0x79b8('0x41')]);_0x5ca137[_0x79b8('0x42')]=qs[_0x79b8('0x43')](_[_0x79b8('0x44')](_0x21c09c[_0x79b8('0x3b')],_0x1df93b[_0x79b8('0x43')]));if(_0x21c09c[_0x79b8('0x3b')][_0x79b8('0x45')]){_0x5ca137[_0x79b8('0x42')]=_[_0x79b8('0x46')](_0x5ca137[_0x79b8('0x42')],{'$or':_['map'](_0x5ca137[_0x79b8('0x3d')],function(_0x2fce16){var _0x1949ba={};_0x1949ba[_0x2fce16]={'$like':'%'+_0x21c09c[_0x79b8('0x3b')][_0x79b8('0x45')]+'%'};return _0x1949ba;})});}_0x5ca137=_[_0x79b8('0x46')]({},_0x5ca137,_0x21c09c[_0x79b8('0x48')]);return _0x2af107['getBlackLists'](_0x5ca137);}})[_0x79b8('0x27')](function(_0x155d07){if(_0x155d07){_0x249164=_0x155d07[_0x79b8('0x4f')];if(!_0x21c09c[_0x79b8('0x3b')][_0x79b8('0x61')](_0x79b8('0x3f'))){_0x5ca137[_0x79b8('0x40')]=qs[_0x79b8('0x40')](_0x21c09c['query'][_0x79b8('0x40')]);_0x5ca137[_0x79b8('0x20')]=qs[_0x79b8('0x20')](_0x21c09c[_0x79b8('0x3b')]['offset']);}return _0x2af107[_0x79b8('0xb3')](_0x5ca137);}})[_0x79b8('0x27')](function(_0xedc126){if(_0xedc126){return _0xedc126?{'count':_0x249164,'rows':_0xedc126}:null;}})[_0x79b8('0x27')](respondWithResult(_0x26e524,null))[_0x79b8('0x4e')](handleError(_0x26e524,null));};exports[_0x79b8('0xb4')]=function(_0x29f824,_0x5c9eff,_0x59fe47){var _0x28b712,_0x3c552d;return db['VoiceQueue']['find']({'where':{'id':_0x29f824[_0x79b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c9eff,null))['then'](function(_0x521143){if(_0x521143){_0x3c552d=_0x521143;return _0x521143[_0x79b8('0xb4')](_0x29f824[_0x79b8('0x51')][_0x79b8('0x80')],_[_0x79b8('0x5b')](_0x29f824[_0x79b8('0x51')],[_0x79b8('0x80'),'id'])||{});}return null;})[_0x79b8('0x93')](function(_0x52865d){var _0x4ef825;_0x28b712=_0x52865d||[];var _0x1e6db7=[];if(_0x52865d){for(var _0x1bc910=0x0;_0x1bc910<_0x52865d[_0x79b8('0x4f')];_0x1bc910+=0x1){var _0x2826bf=_0x52865d[_0x1bc910]['get']({'plain':!![]});_0x4ef825=squel[_0x79b8('0x9e')]()[_0x79b8('0x9f')](_0x79b8('0xb5'))[_0x79b8('0xa0')]([_0x79b8('0xa1'),_0x79b8('0xa3'),_0x79b8('0xa4'),_0x79b8('0x62'),_0x79b8('0x5a'),_0x79b8('0x5c')],squel['select']()[_0x79b8('0x82')](_0x79b8('0xa1'),_0x79b8('0xa1'))[_0x79b8('0x82')]('id',_0x79b8('0xa3'))[_0x79b8('0x82')](_0x2826bf['CmListId'][_0x79b8('0xa6')](),_0x79b8('0xa4'))['field'](_0x29f824[_0x79b8('0x59')]['id'][_0x79b8('0xa6')](),_0x79b8('0x62'))[_0x79b8('0x82')](_0x79b8('0xa7'),_0x79b8('0x5a'))[_0x79b8('0x82')](_0x79b8('0xa7'),'updatedAt')[_0x79b8('0xa8')](_0x79b8('0xa9'))[_0x79b8('0x42')](_0x79b8('0xaa'))[_0x79b8('0x42')](_0x79b8('0xab'),_0x2826bf[_0x79b8('0xa5')][_0x79b8('0xa6')]())['where'](_0x79b8('0xac')))['toString']();_0x1e6db7[_0x79b8('0x88')](db['sequelize'][_0x79b8('0x3b')](_0x4ef825));}return BPromise[_0x79b8('0x8c')](_0x1e6db7);}})['then'](function(){return _0x28b712;})['then'](respondWithResult(_0x5c9eff,null))[_0x79b8('0x4e')](handleError(_0x5c9eff,null));};exports[_0x79b8('0xb6')]=function(_0x492797,_0x4f40d7,_0x2f7eec){return db[_0x79b8('0x49')][_0x79b8('0x32')]({'where':{'id':_0x492797[_0x79b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x4f40d7,null))[_0x79b8('0x27')](function(_0x47b452){if(_0x47b452){return _0x47b452[_0x79b8('0xb6')](_0x492797[_0x79b8('0x3b')][_0x79b8('0x80')]);}})[_0x79b8('0x27')](function(_0x5125ae){if(_0x5125ae){return db[_0x79b8('0x69')][_0x79b8('0x28')]({'where':{'ListId':_0x492797[_0x79b8('0x3b')][_0x79b8('0x80')],'VoiceQueueId':_0x492797['params']['id']}})[_0x79b8('0x27')](function(){return _0x5125ae;});}})['then'](respondWithStatusCode(_0x4f40d7,null))[_0x79b8('0x4e')](handleError(_0x4f40d7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 6c27601..c7609d6 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 _0x4b22=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x38e69d,_0x23bed8){var _0x18fa90=function(_0x344188){while(--_0x344188){_0x38e69d['push'](_0x38e69d['shift']());}};_0x18fa90(++_0x23bed8);}(_0x4b22,0xd2));var _0x24b2=function(_0x98c929,_0xde2f6e){_0x98c929=_0x98c929-0x0;var _0x286adb=_0x4b22[_0x98c929];return _0x286adb;};'use strict';var EventEmitter=require(_0x24b2('0x0'));var VoiceQueue=require(_0x24b2('0x1'))['db'][_0x24b2('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x24b2('0x3')](0x0);var events={'afterCreate':_0x24b2('0x4'),'afterUpdate':_0x24b2('0x5'),'afterDestroy':_0x24b2('0x6')};function emitEvent(_0x2812c5){return function(_0x3ac93e,_0x40781a,_0x2c47cf){VoiceQueueEvents['emit'](_0x2812c5+':'+_0x3ac93e['id'],_0x3ac93e);VoiceQueueEvents[_0x24b2('0x7')](_0x2812c5,_0x3ac93e);_0x2c47cf(null);};}for(var e in events){if(events[_0x24b2('0x8')](e)){var event=events[e];VoiceQueue[_0x24b2('0x9')](e,emitEvent(event));}}module[_0x24b2('0xa')]=VoiceQueueEvents; \ No newline at end of file +var _0x44be=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x44be,0x111));var _0xe44b=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x44be[_0x11005e];return _0x29338f;};'use strict';var EventEmitter=require(_0xe44b('0x0'));var VoiceQueue=require(_0xe44b('0x1'))['db'][_0xe44b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe44b('0x3')](0x0);var events={'afterCreate':_0xe44b('0x4'),'afterUpdate':_0xe44b('0x5'),'afterDestroy':_0xe44b('0x6')};function emitEvent(_0x25f077){return function(_0x31098c,_0x3d6fe7,_0x525152){VoiceQueueEvents['emit'](_0x25f077+':'+_0x31098c['id'],_0x31098c);VoiceQueueEvents[_0xe44b('0x7')](_0x25f077,_0x31098c);_0x525152(null);};}for(var e in events){if(events[_0xe44b('0x8')](e)){var event=events[e];VoiceQueue[_0xe44b('0x9')](e,emitEvent(event));}}module[_0xe44b('0xa')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d59fd90..adabdae 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','util'];(function(_0x140896,_0x1a4f03){var _0x29f376=function(_0x8ef14c){while(--_0x8ef14c){_0x140896['push'](_0x140896['shift']());}};_0x29f376(++_0x1a4f03);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueue','voice_queues','../../config/logger','api'];(function(_0x5f477a,_0x41cfd1){var _0x37a42a=function(_0x37630e){while(--_0x37630e){_0x5f477a['push'](_0x5f477a['shift']());}};_0x37a42a(++_0x41cfd1);}(_0x1339,0x1ed));var _0x9133=function(_0x5ea866,_0x3b8952){_0x5ea866=_0x5ea866-0x0;var _0x1ba350=_0x1339[_0x5ea866];return _0x1ba350;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./voiceQueue.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index b81d9e2..e237d57 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 _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x34a2cb,_0x521c87){var _0x5e7f23=function(_0x509e28){while(--_0x509e28){_0x34a2cb['push'](_0x34a2cb['shift']());}};_0x5e7f23(++_0x521c87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file +var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x419a38,_0x4c9986){var _0x191874=function(_0x50abb8){while(--_0x50abb8){_0x419a38['push'](_0x419a38['shift']());}};_0x191874(++_0x4c9986);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 43323fb..7c82e48 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 _0x33ba=['./voiceQueue.events','save','update','removeListener','register','length','voiceQueue:'];(function(_0x480da8,_0x33de2a){var _0x311072=function(_0x46aea7){while(--_0x46aea7){_0x480da8['push'](_0x480da8['shift']());}};_0x311072(++_0x33de2a);}(_0x33ba,0x142));var _0xa33b=function(_0x5358ea,_0x393d63){_0x5358ea=_0x5358ea-0x0;var _0x350763=_0x33ba[_0x5358ea];return _0x350763;};'use strict';var VoiceQueueEvents=require(_0xa33b('0x0'));var events=[_0xa33b('0x1'),'remove',_0xa33b('0x2')];function createListener(_0x3cdabb,_0x1664a4){return function(_0x16813d){_0x1664a4['emit'](_0x3cdabb,_0x16813d);};}function removeListener(_0x40f188,_0x492f7b){return function(){VoiceQueueEvents[_0xa33b('0x3')](_0x40f188,_0x492f7b);};}exports[_0xa33b('0x4')]=function(_0x4ec491){for(var _0x5ddc8d=0x0,_0xb6a2e1=events[_0xa33b('0x5')];_0x5ddc8d<_0xb6a2e1;_0x5ddc8d++){var _0x1246c0=events[_0x5ddc8d];var _0xff362d=createListener(_0xa33b('0x6')+_0x1246c0,_0x4ec491);VoiceQueueEvents['on'](_0x1246c0,_0xff362d);}}; \ No newline at end of file +var _0x21ae=['remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x456491,_0x4dd8cf){var _0x79c2b7=function(_0x3978d8){while(--_0x3978d8){_0x456491['push'](_0x456491['shift']());}};_0x79c2b7(++_0x4dd8cf);}(_0x21ae,0x117));var _0xe21a=function(_0x2a44a2,_0x5f5148){_0x2a44a2=_0x2a44a2-0x0;var _0xde7c53=_0x21ae[_0x2a44a2];return _0xde7c53;};'use strict';var VoiceQueueEvents=require(_0xe21a('0x0'));var events=['save',_0xe21a('0x1'),_0xe21a('0x2')];function createListener(_0x48268d,_0x4f2128){return function(_0x155369){_0x4f2128[_0xe21a('0x3')](_0x48268d,_0x155369);};}function removeListener(_0x3d330a,_0x38a7c6){return function(){VoiceQueueEvents[_0xe21a('0x4')](_0x3d330a,_0x38a7c6);};}exports[_0xe21a('0x5')]=function(_0x2f8835){for(var _0x34999d=0x0,_0x14eade=events[_0xe21a('0x6')];_0x34999d<_0x14eade;_0x34999d++){var _0xeacf1a=events[_0x34999d];var _0x512a5a=createListener(_0xe21a('0x7')+_0xeacf1a,_0x2f8835);VoiceQueueEvents['on'](_0xeacf1a,_0x512a5a);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 288936d..f6b8aee 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 _0x6da2=['describe','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3dbef0,_0x36f5a4){var _0x4295b9=function(_0x55557a){while(--_0x55557a){_0x3dbef0['push'](_0x3dbef0['shift']());}};_0x4295b9(++_0x36f5a4);}(_0x6da2,0x86));var _0x26da=function(_0x2cb870,_0x178ba3){_0x2cb870=_0x2cb870-0x0;var _0x559f67=_0x6da2[_0x2cb870];return _0x559f67;};'use strict';var multer=require(_0x26da('0x0'));var util=require(_0x26da('0x1'));var path=require(_0x26da('0x2'));var timeout=require(_0x26da('0x3'));var express=require('express');var router=express[_0x26da('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x26da('0x5'));var controller=require('./voiceQueueReport.controller');router[_0x26da('0x6')]('/',auth[_0x26da('0x7')](),controller[_0x26da('0x8')]);router[_0x26da('0x6')](_0x26da('0x9'),auth[_0x26da('0x7')](),controller[_0x26da('0xa')]);router[_0x26da('0x6')]('/index',auth[_0x26da('0x7')](),controller['getVoiceQueuesReport']);router[_0x26da('0x6')](_0x26da('0xb'),auth[_0x26da('0x7')](),controller[_0x26da('0xc')]);router[_0x26da('0xd')]('/',auth[_0x26da('0x7')](),controller['create']);router[_0x26da('0xe')]('/:id',auth[_0x26da('0x7')](),controller[_0x26da('0xf')]);router[_0x26da('0x10')](_0x26da('0xb'),auth[_0x26da('0x7')](),controller['destroy']);module[_0x26da('0x11')]=router; \ No newline at end of file +var _0xe41d=['describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xe41d,0x14d));var _0xde41=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe41d[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xde41('0x0'));var util=require('util');var path=require(_0xde41('0x1'));var timeout=require(_0xde41('0x2'));var express=require(_0xde41('0x3'));var router=express[_0xde41('0x4')]();var auth=require(_0xde41('0x5'));var interaction=require(_0xde41('0x6'));var config=require(_0xde41('0x7'));var controller=require(_0xde41('0x8'));router[_0xde41('0x9')]('/',auth[_0xde41('0xa')](),controller['index']);router[_0xde41('0x9')](_0xde41('0xb'),auth[_0xde41('0xa')](),controller[_0xde41('0xc')]);router['get'](_0xde41('0xd'),auth[_0xde41('0xa')](),controller[_0xde41('0xe')]);router['get'](_0xde41('0xf'),auth[_0xde41('0xa')](),controller[_0xde41('0x10')]);router[_0xde41('0x11')]('/',auth[_0xde41('0xa')](),controller[_0xde41('0x12')]);router[_0xde41('0x13')](_0xde41('0xf'),auth[_0xde41('0xa')](),controller[_0xde41('0x14')]);router[_0xde41('0x15')](_0xde41('0xf'),auth[_0xde41('0xa')](),controller['destroy']);module[_0xde41('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 60cc641..120d3d8 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 _0x152b=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x50c9e1,_0x1587ba){var _0x439eb4=function(_0x4fe40d){while(--_0x4fe40d){_0x50c9e1['push'](_0x50c9e1['shift']());}};_0x439eb4(++_0x1587ba);}(_0x152b,0x13a));var _0xb152=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x152b[_0x147497];return _0x35f45;};'use strict';var Sequelize=require(_0xb152('0x0'));var moment=require(_0xb152('0x1'));module[_0xb152('0x2')]={'type':{'type':Sequelize[_0xb152('0x3')]},'uniqueid':{'type':Sequelize[_0xb152('0x3')]},'calleridnum':{'type':Sequelize[_0xb152('0x3')]},'calleridname':{'type':Sequelize[_0xb152('0x3')]},'queue':{'type':Sequelize[_0xb152('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xb152('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xb152('0x4')],'set':function(_0x4219a5){var _0x2e2150=moment(_0x4219a5);var _0x10943c=moment(this[_0xb152('0x5')](_0xb152('0x6')))[_0xb152('0x7')](_0xb152('0x8'));var _0x36bbcf=_0x2e2150[_0xb152('0x9')](_0x10943c,_0xb152('0xa'));this['setDataValue']('queuecallerleaveAt',_0x4219a5);this[_0xb152('0xb')](_0xb152('0xc'),_0x36bbcf||null);}},'position':{'type':Sequelize[_0xb152('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xb152('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb152('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb152('0x4')]},'queuecallerexit':{'type':Sequelize[_0xb152('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb152('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xb152('0x3')],'comment':_0xb152('0xf')},'originalposition':{'type':Sequelize[_0xb152('0xd')]},'channel':{'type':Sequelize[_0xb152('0x3')]},'connectedlinenum':{'type':Sequelize[_0xb152('0x3')]},'connectedlinename':{'type':Sequelize[_0xb152('0x3')]},'accountcode':{'type':Sequelize[_0xb152('0x3')]},'context':{'type':Sequelize[_0xb152('0x3')]},'exten':{'type':Sequelize[_0xb152('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xb152('0xd')]},'mohtime':{'type':Sequelize[_0xb152('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xb152('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xb152('0x3')]},'transferuniqueid':{'type':Sequelize[_0xb152('0x3')]},'disposition':{'type':Sequelize[_0xb152('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xb152('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa11e=['sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0xe331bc,_0x13da33){var _0x28e3e1=function(_0x2eea62){while(--_0x2eea62){_0xe331bc['push'](_0xe331bc['shift']());}};_0x28e3e1(++_0x13da33);}(_0xa11e,0x1c0));var _0xea11=function(_0x45d56b,_0x3b99e4){_0x45d56b=_0x45d56b-0x0;var _0xd62e37=_0xa11e[_0x45d56b];return _0xd62e37;};'use strict';var Sequelize=require(_0xea11('0x0'));var moment=require('moment');module[_0xea11('0x1')]={'type':{'type':Sequelize[_0xea11('0x2')]},'uniqueid':{'type':Sequelize[_0xea11('0x2')]},'calleridnum':{'type':Sequelize[_0xea11('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xea11('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xea11('0x3')],'set':function(_0x3d16ea){var _0x3c978c=moment(_0x3d16ea);var _0x5a7904=moment(this['getDataValue']('queuecallerjoinAt'))[_0xea11('0x4')](_0xea11('0x5'));var _0x44cfd1=_0x3c978c['diff'](_0x5a7904,_0xea11('0x6'));this[_0xea11('0x7')](_0xea11('0x8'),_0x3d16ea);this[_0xea11('0x7')](_0xea11('0x9'),_0x44cfd1||null);}},'position':{'type':Sequelize[_0xea11('0xa')]},'count':{'type':Sequelize[_0xea11('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xea11('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xea11('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xea11('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xea11('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xea11('0x2')],'comment':_0xea11('0xc')},'originalposition':{'type':Sequelize[_0xea11('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xea11('0x2')]},'connectedlinename':{'type':Sequelize[_0xea11('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xea11('0x2')]},'exten':{'type':Sequelize[_0xea11('0x2')]},'priority':{'type':Sequelize[_0xea11('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xea11('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xea11('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xea11('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xea11('0xd')},'transferexten':{'type':Sequelize[_0xea11('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xea11('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xea11('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index da9d341..35ac44d 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 _0xadcc=['destroy','error','stack','name','VoiceQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','then','includeAll','include','findAll','catch','show','params','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','map','rows','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','json','count','offset','limit','status','set','reject','update'];(function(_0x37cc56,_0x43439d){var _0x52a79f=function(_0x2fe327){while(--_0x2fe327){_0x37cc56['push'](_0x37cc56['shift']());}};_0x52a79f(++_0x43439d);}(_0xadcc,0x76));var _0xcadc=function(_0x2cfa45,_0x228c59){_0x2cfa45=_0x2cfa45-0x0;var _0x5c07a5=_0xadcc[_0x2cfa45];return _0x5c07a5;};'use strict';var pdf=require(_0xcadc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcadc('0x1'));var zipdir=require(_0xcadc('0x2'));var jsonpatch=require(_0xcadc('0x3'));var rp=require(_0xcadc('0x4'));var moment=require(_0xcadc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcadc('0x6'));var path=require(_0xcadc('0x7'));var sox=require(_0xcadc('0x8'));var csv=require(_0xcadc('0x9'));var ejs=require(_0xcadc('0xa'));var fs=require('fs');var _=require(_0xcadc('0xb'));var squel=require(_0xcadc('0xc'));var crypto=require(_0xcadc('0xd'));var jsforce=require(_0xcadc('0xe'));var deskjs=require(_0xcadc('0xf'));var toCsv=require(_0xcadc('0x9'));var querystring=require(_0xcadc('0x10'));var Papa=require(_0xcadc('0x11'));var Redis=require(_0xcadc('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcadc('0x13'));var logger=require(_0xcadc('0x14'))('api');var utils=require(_0xcadc('0x15'));var config=require(_0xcadc('0x16'));var db=require(_0xcadc('0x17'))['db'];config['redis']=_['defaults'](config[_0xcadc('0x18')],{'host':_0xcadc('0x19'),'port':0x18eb});var socket=require(_0xcadc('0x1a'))(new Redis(config[_0xcadc('0x18')]));require('./voiceQueueReport.socket')[_0xcadc('0x1b')](socket);function respondWithStatusCode(_0x4d5837,_0x2f380f){_0x2f380f=_0x2f380f||0xcc;return function(_0x115a05){if(_0x115a05){return _0x4d5837[_0xcadc('0x1c')](_0x2f380f);}return _0x4d5837['status'](_0x2f380f)[_0xcadc('0x1d')]();};}function respondWithResult(_0x3504c5,_0x56660a){_0x56660a=_0x56660a||0xc8;return function(_0x31bf31){if(_0x31bf31){return _0x3504c5['status'](_0x56660a)[_0xcadc('0x1e')](_0x31bf31);}};}function respondWithFilteredResult(_0x36d544,_0x2c0375){return function(_0x2007f4){if(_0x2007f4){var _0x18a584=_0x2007f4[_0xcadc('0x1f')],_0x505a28=_0x2c0375[_0xcadc('0x20')],_0x4738af=_0x2c0375[_0xcadc('0x20')]+_0x2c0375[_0xcadc('0x21')],_0x43b33e;if(_0x4738af>=_0x18a584){_0x4738af=_0x18a584;_0x43b33e=0xc8;}else{_0x43b33e=0xce;}_0x36d544[_0xcadc('0x22')](_0x43b33e);return _0x36d544[_0xcadc('0x23')]('Content-Range',_0x505a28+'-'+_0x4738af+'/'+_0x18a584)['json'](_0x2007f4);}return null;};}function patchUpdates(_0x38b105){return function(_0x153741){try{jsonpatch['apply'](_0x153741,_0x38b105,!![]);}catch(_0x905a25){return BPromise[_0xcadc('0x24')](_0x905a25);}return _0x153741['save']();};}function saveUpdates(_0x496289,_0x3c5dca){return function(_0x5258b1){if(_0x5258b1){return _0x5258b1[_0xcadc('0x25')](_0x496289)['then'](function(_0x4230bd){return _0x4230bd;});}return null;};}function removeEntity(_0x35e081,_0x4c47b8){return function(_0x3239ba){if(_0x3239ba){return _0x3239ba[_0xcadc('0x26')]()['then'](function(){_0x35e081['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x955ff,_0x16c6be){return function(_0x59c6f8){if(!_0x59c6f8){_0x955ff[_0xcadc('0x1c')](0x194);}return _0x59c6f8;};}function handleError(_0x4d8cdc,_0x277d1e){_0x277d1e=_0x277d1e||0x1f4;return function(_0x34ceac){logger[_0xcadc('0x27')](_0x34ceac[_0xcadc('0x28')]);if(_0x34ceac[_0xcadc('0x29')]){delete _0x34ceac[_0xcadc('0x29')];}_0x4d8cdc['status'](_0x277d1e)['send'](_0x34ceac);};}exports['index']=function(_0x1f6402,_0x31b7fd){var _0x3a19d1={},_0x113843={},_0xc68af8={'count':0x0,'rows':[]};var _0x309e29=db[_0xcadc('0x2a')][_0xcadc('0x2b')];_0x113843[_0xcadc('0x2c')]=_[_0xcadc('0x2d')](_0x309e29);_0x113843[_0xcadc('0x2e')]=_['keys'](_0x1f6402['query']);_0x113843[_0xcadc('0x2f')]=_[_0xcadc('0x30')](_0x113843[_0xcadc('0x2c')],_0x113843[_0xcadc('0x2e')]);_0x3a19d1[_0xcadc('0x31')]=_[_0xcadc('0x30')](_0x113843[_0xcadc('0x2c')],qs[_0xcadc('0x32')](_0x1f6402[_0xcadc('0x2e')][_0xcadc('0x32')]));_0x3a19d1[_0xcadc('0x31')]=_0x3a19d1[_0xcadc('0x31')][_0xcadc('0x33')]?_0x3a19d1['attributes']:_0x113843['model'];if(!_0x1f6402['query']['hasOwnProperty'](_0xcadc('0x34'))){_0x3a19d1['limit']=qs['limit'](_0x1f6402[_0xcadc('0x2e')][_0xcadc('0x21')]);_0x3a19d1[_0xcadc('0x20')]=qs[_0xcadc('0x20')](_0x1f6402[_0xcadc('0x2e')]['offset']);}_0x3a19d1[_0xcadc('0x35')]=qs[_0xcadc('0x36')](_0x1f6402['query'][_0xcadc('0x36')]);_0x3a19d1[_0xcadc('0x37')]=qs[_0xcadc('0x2f')](_[_0xcadc('0x38')](_0x1f6402['query'],_0x113843[_0xcadc('0x2f')]));if(_0x1f6402[_0xcadc('0x2e')][_0xcadc('0x39')]){_0x3a19d1[_0xcadc('0x37')]=_[_0xcadc('0x3a')](_0x3a19d1[_0xcadc('0x37')],{'$or':_['map'](_0x309e29,function(_0x1cdcd2){if(_0x1cdcd2['type'][_0xcadc('0x3b')]!==_0xcadc('0x3c')){var _0x466efd={};_0x466efd[_0x1cdcd2[_0xcadc('0x3d')]]={'$like':'%'+_0x1f6402[_0xcadc('0x2e')][_0xcadc('0x39')]+'%'};return _0x466efd;}})});}_0x3a19d1=_[_0xcadc('0x3a')]({},_0x3a19d1,_0x1f6402[_0xcadc('0x3e')]);var _0x1bbc50={'where':_0x3a19d1[_0xcadc('0x37')]};return db['VoiceQueueReport'][_0xcadc('0x1f')](_0x1bbc50)[_0xcadc('0x3f')](function(_0x4e71d7){_0xc68af8['count']=_0x4e71d7;if(_0x1f6402[_0xcadc('0x2e')][_0xcadc('0x40')]){_0x3a19d1[_0xcadc('0x41')]=[{'all':!![]}];}return db[_0xcadc('0x2a')][_0xcadc('0x42')](_0x3a19d1);})[_0xcadc('0x3f')](function(_0x561026){_0xc68af8['rows']=_0x561026;return _0xc68af8;})[_0xcadc('0x3f')](respondWithFilteredResult(_0x31b7fd,_0x3a19d1))[_0xcadc('0x43')](handleError(_0x31b7fd,null));};exports[_0xcadc('0x44')]=function(_0x3e57ab,_0x5b42f7){var _0x370090={'raw':![],'where':{'id':_0x3e57ab[_0xcadc('0x45')]['id']}},_0x421b7d={};_0x421b7d[_0xcadc('0x2c')]=_[_0xcadc('0x2d')](db[_0xcadc('0x2a')][_0xcadc('0x2b')]);_0x421b7d[_0xcadc('0x2e')]=_['keys'](_0x3e57ab['query']);_0x421b7d[_0xcadc('0x2f')]=_[_0xcadc('0x30')](_0x421b7d['model'],_0x421b7d[_0xcadc('0x2e')]);_0x370090[_0xcadc('0x31')]=_[_0xcadc('0x30')](_0x421b7d['model'],qs[_0xcadc('0x32')](_0x3e57ab[_0xcadc('0x2e')][_0xcadc('0x32')]));_0x370090[_0xcadc('0x31')]=_0x370090[_0xcadc('0x31')]['length']?_0x370090[_0xcadc('0x31')]:_0x421b7d[_0xcadc('0x2c')];if(_0x3e57ab[_0xcadc('0x2e')][_0xcadc('0x40')]){_0x370090[_0xcadc('0x41')]=[{'all':!![]}];}_0x370090=_[_0xcadc('0x3a')]({},_0x370090,_0x3e57ab[_0xcadc('0x3e')]);return db[_0xcadc('0x2a')][_0xcadc('0x46')](_0x370090)['then'](handleEntityNotFound(_0x5b42f7,null))[_0xcadc('0x3f')](respondWithResult(_0x5b42f7,null))[_0xcadc('0x43')](handleError(_0x5b42f7,null));};exports['create']=function(_0x36dd35,_0xde0adf){return db['VoiceQueueReport'][_0xcadc('0x47')](_0x36dd35[_0xcadc('0x48')],{})[_0xcadc('0x3f')](respondWithResult(_0xde0adf,0xc9))[_0xcadc('0x43')](handleError(_0xde0adf,null));};exports['update']=function(_0x15b232,_0x4663d6){if(_0x15b232[_0xcadc('0x48')]['id']){delete _0x15b232[_0xcadc('0x48')]['id'];}return db[_0xcadc('0x2a')][_0xcadc('0x46')]({'where':{'id':_0x15b232[_0xcadc('0x45')]['id']}})[_0xcadc('0x3f')](handleEntityNotFound(_0x4663d6,null))[_0xcadc('0x3f')](saveUpdates(_0x15b232[_0xcadc('0x48')],null))[_0xcadc('0x3f')](respondWithResult(_0x4663d6,null))[_0xcadc('0x43')](handleError(_0x4663d6,null));};exports['destroy']=function(_0x1ff76b,_0x1591ce){return db['VoiceQueueReport'][_0xcadc('0x46')]({'where':{'id':_0x1ff76b[_0xcadc('0x45')]['id']}})[_0xcadc('0x3f')](handleEntityNotFound(_0x1591ce,null))[_0xcadc('0x3f')](removeEntity(_0x1591ce,null))['catch'](handleError(_0x1591ce,null));};exports[_0xcadc('0x49')]=function(_0x43ac6d,_0x5cd5cb){return db[_0xcadc('0x2a')]['describe']()['then'](respondWithResult(_0x5cd5cb,null))['catch'](handleError(_0x5cd5cb,null));};exports[_0xcadc('0x4a')]=function(_0x5596a1,_0x1cc85a){var _0x5b6120={},_0x471f55={},_0x39195f={'count':0x0,'rows':[]};_0x471f55[_0xcadc('0x2c')]=_['keys'](db[_0xcadc('0x2a')][_0xcadc('0x2b')]);_0x471f55[_0xcadc('0x2e')]=_[_0xcadc('0x2d')](_0x5596a1['query']);_0x471f55[_0xcadc('0x2f')]=_['intersection'](_0x471f55[_0xcadc('0x2c')],_0x471f55[_0xcadc('0x2e')]);_0x5b6120['attributes']=_[_0xcadc('0x30')](_0x471f55[_0xcadc('0x2c')],qs[_0xcadc('0x32')](_0x5596a1['query']['fields']));_0x5b6120[_0xcadc('0x31')]=_0x5b6120['attributes'][_0xcadc('0x33')]?_0x5b6120[_0xcadc('0x31')]:_0x471f55[_0xcadc('0x2c')];if(!_0x5596a1[_0xcadc('0x2e')][_0xcadc('0x4b')](_0xcadc('0x34'))){_0x5b6120[_0xcadc('0x21')]=qs[_0xcadc('0x21')](_0x5596a1['query'][_0xcadc('0x21')]);_0x5b6120[_0xcadc('0x20')]=qs[_0xcadc('0x20')](_0x5596a1[_0xcadc('0x2e')][_0xcadc('0x20')]);}_0x5b6120[_0xcadc('0x35')]=qs[_0xcadc('0x36')](_0x5596a1['query'][_0xcadc('0x36')]);_0x5b6120[_0xcadc('0x37')]=qs[_0xcadc('0x2f')](_[_0xcadc('0x38')](_0x5596a1[_0xcadc('0x2e')],_0x471f55['filters']));if(_0x5596a1['query'][_0xcadc('0x39')]){_0x5b6120[_0xcadc('0x37')]=_[_0xcadc('0x3a')](_0x5b6120[_0xcadc('0x37')],{'$or':_[_0xcadc('0x4c')](_0x5b6120[_0xcadc('0x31')],function(_0x43813f){var _0x1514b7={};_0x1514b7[_0x43813f]={'$like':'%'+_0x5596a1[_0xcadc('0x2e')]['filter']+'%'};return _0x1514b7;})});}_0x5b6120=_[_0xcadc('0x3a')]({},_0x5b6120,_0x5596a1['options']);var _0x4d527f={'where':_0x5b6120[_0xcadc('0x37')]};return db[_0xcadc('0x2a')]['count'](_0x4d527f)[_0xcadc('0x3f')](function(_0x344e60){_0x39195f[_0xcadc('0x1f')]=_0x344e60;if(_0x5596a1[_0xcadc('0x2e')][_0xcadc('0x40')]){_0x5b6120[_0xcadc('0x41')]=[{'all':!![]}];}return db[_0xcadc('0x2a')][_0xcadc('0x42')](_0x5b6120);})[_0xcadc('0x3f')](function(_0x504b05){_0x39195f[_0xcadc('0x4d')]=_0x504b05;return _0x39195f;})['then'](respondWithFilteredResult(_0x1cc85a,_0x5b6120,'getVoiceQueuesReport'))[_0xcadc('0x43')](handleError(_0x1cc85a,null,_0xcadc('0x4a')));}; \ No newline at end of file +var _0x8533=['find','create','body','describe','getVoiceQueuesReport','rawAttributes','hasOwnProperty','pick','findAll','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','keys','query','filters','intersection','model','attributes','length','nolimit','limit','order','sort','where','filter','map','type','key','VIRTUAL','options','VoiceQueueReport','includeAll','include','rows','catch','show','params','fields','merge'];(function(_0x47a7a6,_0x17653b){var _0x1fd4ac=function(_0x14fbf9){while(--_0x14fbf9){_0x47a7a6['push'](_0x47a7a6['shift']());}};_0x1fd4ac(++_0x17653b);}(_0x8533,0x141));var _0x3853=function(_0x2c89da,_0x231afe){_0x2c89da=_0x2c89da-0x0;var _0x12fee8=_0x8533[_0x2c89da];return _0x12fee8;};'use strict';var pdf=require(_0x3853('0x0'));var emlformat=require(_0x3853('0x1'));var rimraf=require(_0x3853('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3853('0x3'));var rp=require(_0x3853('0x4'));var moment=require('moment');var BPromise=require(_0x3853('0x5'));var Mustache=require('mustache');var util=require(_0x3853('0x6'));var path=require('path');var sox=require(_0x3853('0x7'));var csv=require(_0x3853('0x8'));var ejs=require(_0x3853('0x9'));var fs=require('fs');var _=require(_0x3853('0xa'));var squel=require('squel');var crypto=require(_0x3853('0xb'));var jsforce=require(_0x3853('0xc'));var deskjs=require(_0x3853('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3853('0xe'));var Redis=require(_0x3853('0xf'));var authService=require(_0x3853('0x10'));var qs=require(_0x3853('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3853('0x12'))(_0x3853('0x13'));var utils=require(_0x3853('0x14'));var config=require(_0x3853('0x15'));var db=require(_0x3853('0x16'))['db'];config[_0x3853('0x17')]=_['defaults'](config[_0x3853('0x17')],{'host':_0x3853('0x18'),'port':0x18eb});var socket=require(_0x3853('0x19'))(new Redis(config[_0x3853('0x17')]));require('./voiceQueueReport.socket')[_0x3853('0x1a')](socket);function respondWithStatusCode(_0x32ffe1,_0x96cfef){_0x96cfef=_0x96cfef||0xcc;return function(_0x97c5d9){if(_0x97c5d9){return _0x32ffe1['sendStatus'](_0x96cfef);}return _0x32ffe1['status'](_0x96cfef)['end']();};}function respondWithResult(_0x130b7b,_0x77518){_0x77518=_0x77518||0xc8;return function(_0x378431){if(_0x378431){return _0x130b7b[_0x3853('0x1b')](_0x77518)[_0x3853('0x1c')](_0x378431);}};}function respondWithFilteredResult(_0x59eb33,_0x14c3df){return function(_0x4bf82a){if(_0x4bf82a){var _0x28f339=_0x4bf82a[_0x3853('0x1d')],_0x42dbd1=_0x14c3df[_0x3853('0x1e')],_0x13c67c=_0x14c3df['offset']+_0x14c3df['limit'],_0x1ffdc9;if(_0x13c67c>=_0x28f339){_0x13c67c=_0x28f339;_0x1ffdc9=0xc8;}else{_0x1ffdc9=0xce;}_0x59eb33[_0x3853('0x1b')](_0x1ffdc9);return _0x59eb33['set'](_0x3853('0x1f'),_0x42dbd1+'-'+_0x13c67c+'/'+_0x28f339)[_0x3853('0x1c')](_0x4bf82a);}return null;};}function patchUpdates(_0x5b211d){return function(_0x24223c){try{jsonpatch[_0x3853('0x20')](_0x24223c,_0x5b211d,!![]);}catch(_0x231b3){return BPromise[_0x3853('0x21')](_0x231b3);}return _0x24223c[_0x3853('0x22')]();};}function saveUpdates(_0x54252e,_0x1140e3){return function(_0x233c9c){if(_0x233c9c){return _0x233c9c[_0x3853('0x23')](_0x54252e)[_0x3853('0x24')](function(_0x2d089e){return _0x2d089e;});}return null;};}function removeEntity(_0x2a8fdb,_0x464fc2){return function(_0x5ea629){if(_0x5ea629){return _0x5ea629[_0x3853('0x25')]()['then'](function(){_0x2a8fdb[_0x3853('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5068fa,_0x18c271){return function(_0xd603df){if(!_0xd603df){_0x5068fa[_0x3853('0x26')](0x194);}return _0xd603df;};}function handleError(_0x3e4f79,_0x87682d){_0x87682d=_0x87682d||0x1f4;return function(_0x556cc5){logger[_0x3853('0x27')](_0x556cc5[_0x3853('0x28')]);if(_0x556cc5['name']){delete _0x556cc5[_0x3853('0x29')];}_0x3e4f79['status'](_0x87682d)['send'](_0x556cc5);};}exports['index']=function(_0x20c68e,_0x4391f2){var _0x323384={},_0x50e181={},_0x22788d={'count':0x0,'rows':[]};var _0x438d29=db['VoiceQueueReport']['rawAttributes'];_0x50e181['model']=_[_0x3853('0x2a')](_0x438d29);_0x50e181[_0x3853('0x2b')]=_[_0x3853('0x2a')](_0x20c68e[_0x3853('0x2b')]);_0x50e181[_0x3853('0x2c')]=_[_0x3853('0x2d')](_0x50e181[_0x3853('0x2e')],_0x50e181[_0x3853('0x2b')]);_0x323384['attributes']=_[_0x3853('0x2d')](_0x50e181[_0x3853('0x2e')],qs['fields'](_0x20c68e[_0x3853('0x2b')]['fields']));_0x323384[_0x3853('0x2f')]=_0x323384[_0x3853('0x2f')][_0x3853('0x30')]?_0x323384['attributes']:_0x50e181['model'];if(!_0x20c68e[_0x3853('0x2b')]['hasOwnProperty'](_0x3853('0x31'))){_0x323384[_0x3853('0x32')]=qs[_0x3853('0x32')](_0x20c68e[_0x3853('0x2b')]['limit']);_0x323384[_0x3853('0x1e')]=qs[_0x3853('0x1e')](_0x20c68e[_0x3853('0x2b')][_0x3853('0x1e')]);}_0x323384[_0x3853('0x33')]=qs[_0x3853('0x34')](_0x20c68e['query'][_0x3853('0x34')]);_0x323384[_0x3853('0x35')]=qs[_0x3853('0x2c')](_['pick'](_0x20c68e[_0x3853('0x2b')],_0x50e181[_0x3853('0x2c')]));if(_0x20c68e['query'][_0x3853('0x36')]){_0x323384[_0x3853('0x35')]=_['merge'](_0x323384[_0x3853('0x35')],{'$or':_[_0x3853('0x37')](_0x438d29,function(_0x3c6497){if(_0x3c6497[_0x3853('0x38')][_0x3853('0x39')]!==_0x3853('0x3a')){var _0x1e7839={};_0x1e7839[_0x3c6497['field']]={'$like':'%'+_0x20c68e[_0x3853('0x2b')][_0x3853('0x36')]+'%'};return _0x1e7839;}})});}_0x323384=_['merge']({},_0x323384,_0x20c68e[_0x3853('0x3b')]);var _0x20a543={'where':_0x323384[_0x3853('0x35')]};return db[_0x3853('0x3c')][_0x3853('0x1d')](_0x20a543)['then'](function(_0x3333d3){_0x22788d[_0x3853('0x1d')]=_0x3333d3;if(_0x20c68e[_0x3853('0x2b')][_0x3853('0x3d')]){_0x323384[_0x3853('0x3e')]=[{'all':!![]}];}return db[_0x3853('0x3c')]['findAll'](_0x323384);})[_0x3853('0x24')](function(_0x9eb0e){_0x22788d[_0x3853('0x3f')]=_0x9eb0e;return _0x22788d;})['then'](respondWithFilteredResult(_0x4391f2,_0x323384))[_0x3853('0x40')](handleError(_0x4391f2,null));};exports[_0x3853('0x41')]=function(_0x1bf89c,_0xf54806){var _0x1a7e17={'raw':![],'where':{'id':_0x1bf89c[_0x3853('0x42')]['id']}},_0x5a1d18={};_0x5a1d18[_0x3853('0x2e')]=_[_0x3853('0x2a')](db[_0x3853('0x3c')]['rawAttributes']);_0x5a1d18[_0x3853('0x2b')]=_[_0x3853('0x2a')](_0x1bf89c[_0x3853('0x2b')]);_0x5a1d18[_0x3853('0x2c')]=_[_0x3853('0x2d')](_0x5a1d18[_0x3853('0x2e')],_0x5a1d18[_0x3853('0x2b')]);_0x1a7e17[_0x3853('0x2f')]=_[_0x3853('0x2d')](_0x5a1d18[_0x3853('0x2e')],qs[_0x3853('0x43')](_0x1bf89c['query'][_0x3853('0x43')]));_0x1a7e17[_0x3853('0x2f')]=_0x1a7e17[_0x3853('0x2f')][_0x3853('0x30')]?_0x1a7e17['attributes']:_0x5a1d18['model'];if(_0x1bf89c[_0x3853('0x2b')][_0x3853('0x3d')]){_0x1a7e17[_0x3853('0x3e')]=[{'all':!![]}];}_0x1a7e17=_[_0x3853('0x44')]({},_0x1a7e17,_0x1bf89c['options']);return db['VoiceQueueReport'][_0x3853('0x45')](_0x1a7e17)[_0x3853('0x24')](handleEntityNotFound(_0xf54806,null))['then'](respondWithResult(_0xf54806,null))[_0x3853('0x40')](handleError(_0xf54806,null));};exports[_0x3853('0x46')]=function(_0x3048bf,_0x5ba886){return db[_0x3853('0x3c')]['create'](_0x3048bf[_0x3853('0x47')],{})[_0x3853('0x24')](respondWithResult(_0x5ba886,0xc9))[_0x3853('0x40')](handleError(_0x5ba886,null));};exports[_0x3853('0x23')]=function(_0x16fedd,_0x369fc8){if(_0x16fedd[_0x3853('0x47')]['id']){delete _0x16fedd['body']['id'];}return db[_0x3853('0x3c')][_0x3853('0x45')]({'where':{'id':_0x16fedd[_0x3853('0x42')]['id']}})[_0x3853('0x24')](handleEntityNotFound(_0x369fc8,null))[_0x3853('0x24')](saveUpdates(_0x16fedd[_0x3853('0x47')],null))[_0x3853('0x24')](respondWithResult(_0x369fc8,null))['catch'](handleError(_0x369fc8,null));};exports[_0x3853('0x25')]=function(_0x28a4f9,_0x2c0ba0){return db[_0x3853('0x3c')][_0x3853('0x45')]({'where':{'id':_0x28a4f9['params']['id']}})[_0x3853('0x24')](handleEntityNotFound(_0x2c0ba0,null))['then'](removeEntity(_0x2c0ba0,null))[_0x3853('0x40')](handleError(_0x2c0ba0,null));};exports[_0x3853('0x48')]=function(_0x2cfb59,_0x17ca71){return db[_0x3853('0x3c')][_0x3853('0x48')]()[_0x3853('0x24')](respondWithResult(_0x17ca71,null))[_0x3853('0x40')](handleError(_0x17ca71,null));};exports[_0x3853('0x49')]=function(_0x67285b,_0xf5716a){var _0x16f7fb={},_0x3ba627={},_0x2be791={'count':0x0,'rows':[]};_0x3ba627[_0x3853('0x2e')]=_['keys'](db['VoiceQueueReport'][_0x3853('0x4a')]);_0x3ba627[_0x3853('0x2b')]=_[_0x3853('0x2a')](_0x67285b[_0x3853('0x2b')]);_0x3ba627[_0x3853('0x2c')]=_[_0x3853('0x2d')](_0x3ba627[_0x3853('0x2e')],_0x3ba627[_0x3853('0x2b')]);_0x16f7fb[_0x3853('0x2f')]=_[_0x3853('0x2d')](_0x3ba627[_0x3853('0x2e')],qs[_0x3853('0x43')](_0x67285b[_0x3853('0x2b')][_0x3853('0x43')]));_0x16f7fb[_0x3853('0x2f')]=_0x16f7fb[_0x3853('0x2f')][_0x3853('0x30')]?_0x16f7fb[_0x3853('0x2f')]:_0x3ba627[_0x3853('0x2e')];if(!_0x67285b[_0x3853('0x2b')][_0x3853('0x4b')](_0x3853('0x31'))){_0x16f7fb[_0x3853('0x32')]=qs[_0x3853('0x32')](_0x67285b['query'][_0x3853('0x32')]);_0x16f7fb[_0x3853('0x1e')]=qs[_0x3853('0x1e')](_0x67285b[_0x3853('0x2b')][_0x3853('0x1e')]);}_0x16f7fb[_0x3853('0x33')]=qs[_0x3853('0x34')](_0x67285b[_0x3853('0x2b')][_0x3853('0x34')]);_0x16f7fb['where']=qs[_0x3853('0x2c')](_[_0x3853('0x4c')](_0x67285b[_0x3853('0x2b')],_0x3ba627[_0x3853('0x2c')]));if(_0x67285b[_0x3853('0x2b')][_0x3853('0x36')]){_0x16f7fb['where']=_[_0x3853('0x44')](_0x16f7fb[_0x3853('0x35')],{'$or':_[_0x3853('0x37')](_0x16f7fb[_0x3853('0x2f')],function(_0x492c4e){var _0x496f9e={};_0x496f9e[_0x492c4e]={'$like':'%'+_0x67285b[_0x3853('0x2b')][_0x3853('0x36')]+'%'};return _0x496f9e;})});}_0x16f7fb=_[_0x3853('0x44')]({},_0x16f7fb,_0x67285b[_0x3853('0x3b')]);var _0x30b30b={'where':_0x16f7fb[_0x3853('0x35')]};return db[_0x3853('0x3c')][_0x3853('0x1d')](_0x30b30b)['then'](function(_0x4e868e){_0x2be791[_0x3853('0x1d')]=_0x4e868e;if(_0x67285b['query'][_0x3853('0x3d')]){_0x16f7fb['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3853('0x4d')](_0x16f7fb);})[_0x3853('0x24')](function(_0x3157d4){_0x2be791[_0x3853('0x3f')]=_0x3157d4;return _0x2be791;})[_0x3853('0x24')](respondWithFilteredResult(_0xf5716a,_0x16f7fb,_0x3853('0x49')))[_0x3853('0x40')](handleError(_0xf5716a,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 311d9a7..e9f91c3 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 _0xfa57=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa57,0xf4));var _0x7fa5=function(_0x40c5a8,_0xc0da3c){_0x40c5a8=_0x40c5a8-0x0;var _0x4f3ff6=_0xfa57[_0x40c5a8];return _0x4f3ff6;};'use strict';var EventEmitter=require(_0x7fa5('0x0'));var VoiceQueueReport=require(_0x7fa5('0x1'))['db'][_0x7fa5('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7fa5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7fa5('0x4'),'afterDestroy':_0x7fa5('0x5')};function emitEvent(_0x4259b1){return function(_0x3083e0,_0x3d5bbc,_0x2198f8){VoiceQueueReportEvents[_0x7fa5('0x6')](_0x4259b1+':'+_0x3083e0['id'],_0x3083e0);VoiceQueueReportEvents[_0x7fa5('0x6')](_0x4259b1,_0x3083e0);_0x2198f8(null);};}for(var e in events){if(events[_0x7fa5('0x7')](e)){var event=events[e];VoiceQueueReport[_0x7fa5('0x8')](e,emitEvent(event));}}module[_0x7fa5('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x8c51=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x8b7fbc,_0x59ea3e){var _0x19e77e=function(_0x4c0fb0){while(--_0x4c0fb0){_0x8b7fbc['push'](_0x8b7fbc['shift']());}};_0x19e77e(++_0x59ea3e);}(_0x8c51,0x1b5));var _0x18c5=function(_0xb2ace8,_0x461fd7){_0xb2ace8=_0xb2ace8-0x0;var _0xc2ba67=_0x8c51[_0xb2ace8];return _0xc2ba67;};'use strict';var EventEmitter=require(_0x18c5('0x0'));var VoiceQueueReport=require(_0x18c5('0x1'))['db'][_0x18c5('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x18c5('0x3')](0x0);var events={'afterCreate':_0x18c5('0x4'),'afterUpdate':_0x18c5('0x5'),'afterDestroy':_0x18c5('0x6')};function emitEvent(_0x686dd2){return function(_0x24084d,_0x21a4ea,_0x1314f0){VoiceQueueReportEvents[_0x18c5('0x7')](_0x686dd2+':'+_0x24084d['id'],_0x24084d);VoiceQueueReportEvents['emit'](_0x686dd2,_0x24084d);_0x1314f0(null);};}for(var e in events){if(events[_0x18c5('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x18c5('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 5f13dec..e5f8d5a 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 _0x9e77=['VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x483232,_0x471d2d){var _0x273379=function(_0x594bcb){while(--_0x594bcb){_0x483232['push'](_0x483232['shift']());}};_0x273379(++_0x471d2d);}(_0x9e77,0x138));var _0x79e7=function(_0x4b8de4,_0x321549){_0x4b8de4=_0x4b8de4-0x0;var _0x3996da=_0x9e77[_0x4b8de4];return _0x3996da;};'use strict';var _=require(_0x79e7('0x0'));var util=require(_0x79e7('0x1'));var logger=require(_0x79e7('0x2'))(_0x79e7('0x3'));var moment=require(_0x79e7('0x4'));var BPromise=require(_0x79e7('0x5'));var rp=require(_0x79e7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79e7('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x79e7('0x8')]=function(_0x302a31,_0x199b7d){return _0x302a31[_0x79e7('0x9')](_0x79e7('0xa'),attributes,{'tableName':_0x79e7('0xb'),'paranoid':![],'indexes':[{'fields':[_0x79e7('0xc')]},{'fields':[_0x79e7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x41e0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash'];(function(_0x2ba818,_0x21ad9f){var _0x45c156=function(_0x29df31){while(--_0x29df31){_0x2ba818['push'](_0x2ba818['shift']());}};_0x45c156(++_0x21ad9f);}(_0x41e0,0x18f));var _0x041e=function(_0x5c2ba0,_0x196e25){_0x5c2ba0=_0x5c2ba0-0x0;var _0x1723eb=_0x41e0[_0x5c2ba0];return _0x1723eb;};'use strict';var _=require(_0x041e('0x0'));var util=require(_0x041e('0x1'));var logger=require(_0x041e('0x2'))(_0x041e('0x3'));var moment=require(_0x041e('0x4'));var BPromise=require(_0x041e('0x5'));var rp=require(_0x041e('0x6'));var fs=require('fs');var path=require(_0x041e('0x7'));var rimraf=require(_0x041e('0x8'));var config=require(_0x041e('0x9'));var attributes=require(_0x041e('0xa'));module[_0x041e('0xb')]=function(_0x23ed1e,_0x2fadd8){return _0x23ed1e[_0x041e('0xc')](_0x041e('0xd'),attributes,{'tableName':_0x041e('0xe'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x041e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 05c6d3d..fecfc9f 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 _0xfb8a=['socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','body','CreateVoiceQueueReport','VoiceQueueReport','update','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x47b431,_0x46ab44){var _0x18aa3f=function(_0x2c2e79){while(--_0x2c2e79){_0x47b431['push'](_0x47b431['shift']());}};_0x18aa3f(++_0x46ab44);}(_0xfb8a,0x132));var _0xafb8=function(_0x3fcf30,_0xe3a49e){_0x3fcf30=_0x3fcf30-0x0;var _0x2ed4b0=_0xfb8a[_0x3fcf30];return _0x2ed4b0;};'use strict';var _=require(_0xafb8('0x0'));var util=require(_0xafb8('0x1'));var moment=require(_0xafb8('0x2'));var BPromise=require(_0xafb8('0x3'));var rs=require(_0xafb8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafb8('0x5'))['db'];var utils=require(_0xafb8('0x6'));var logger=require(_0xafb8('0x7'))(_0xafb8('0x8'));var config=require(_0xafb8('0x9'));var jayson=require(_0xafb8('0xa'));var client=jayson[_0xafb8('0xb')][_0xafb8('0xc')]({'port':0x232a});config[_0xafb8('0xd')]=_[_0xafb8('0xe')](config[_0xafb8('0xd')],{'host':_0xafb8('0xf'),'port':0x18eb});var socket=require(_0xafb8('0x10'))(new Redis(config['redis']));require(_0xafb8('0x11'))['register'](socket);function respondWithRpcPromise(_0x290180,_0x5d5567,_0x3d6098){return new BPromise(function(_0x16861c,_0x43790d){return client[_0xafb8('0x12')](_0x290180,_0x3d6098)[_0xafb8('0x13')](function(_0x5286e0){logger[_0xafb8('0x14')](_0xafb8('0x15'),_0x5d5567,_0xafb8('0x16'));logger['debug'](_0xafb8('0x17'),_0x5d5567,_0xafb8('0x16'),JSON['stringify'](_0x5286e0));if(_0x5286e0[_0xafb8('0x18')]){if(_0x5286e0[_0xafb8('0x18')][_0xafb8('0x19')]===0x1f4){logger[_0xafb8('0x18')](_0xafb8('0x15'),_0x5d5567,_0x5286e0['error']['message']);return _0x43790d(_0x5286e0[_0xafb8('0x18')]['message']);}logger['error'](_0xafb8('0x15'),_0x5d5567,_0x5286e0[_0xafb8('0x18')][_0xafb8('0x1a')]);return _0x16861c(_0x5286e0[_0xafb8('0x18')][_0xafb8('0x1a')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x5d5567,'request\x20sent');_0x16861c(_0x5286e0[_0xafb8('0x1b')][_0xafb8('0x1a')]);}})[_0xafb8('0x1c')](function(_0x4f3c8a){logger[_0xafb8('0x18')](_0xafb8('0x15'),_0x5d5567,_0x4f3c8a);_0x43790d(_0x4f3c8a);});});}exports[_0xafb8('0x1d')]=function(_0x4c5e8c){var _0x496c9f=this;return new Promise(function(_0x3850a0,_0x577fbf){return db['VoiceQueueReport'][_0xafb8('0x1e')]({'raw':_0x4c5e8c['options']?_0x4c5e8c[_0xafb8('0x1f')][_0xafb8('0x20')]===undefined?!![]:![]:!![],'where':_0x4c5e8c[_0xafb8('0x1f')]?_0x4c5e8c[_0xafb8('0x1f')][_0xafb8('0x21')]||null:null,'attributes':_0x4c5e8c[_0xafb8('0x1f')]?_0x4c5e8c[_0xafb8('0x1f')][_0xafb8('0x22')]||null:null,'limit':_0x4c5e8c['options']?_0x4c5e8c[_0xafb8('0x1f')][_0xafb8('0x23')]||null:null,'include':_0x4c5e8c[_0xafb8('0x1f')]?_0x4c5e8c[_0xafb8('0x1f')][_0xafb8('0x24')]?_[_0xafb8('0x25')](_0x4c5e8c['options'][_0xafb8('0x24')],function(_0x38d495){return{'model':db[_0x38d495['model']],'as':_0x38d495['as'],'attributes':_0x38d495[_0xafb8('0x22')],'include':_0x38d495[_0xafb8('0x24')]?_['map'](_0x38d495[_0xafb8('0x24')],function(_0x459107){return{'model':db[_0x459107[_0xafb8('0x26')]],'as':_0x459107['as'],'attributes':_0x459107[_0xafb8('0x22')],'include':_0x459107[_0xafb8('0x24')]?_[_0xafb8('0x25')](_0x459107['include'],function(_0x5cf3a6){return{'model':db[_0x5cf3a6[_0xafb8('0x26')]],'as':_0x5cf3a6['as'],'attributes':_0x5cf3a6[_0xafb8('0x22')]};}):[]};}):[]};}):[]:[]})[_0xafb8('0x13')](function(_0x22e62e){logger[_0xafb8('0x14')](_0xafb8('0x1d'),_0x4c5e8c);logger[_0xafb8('0x27')](_0xafb8('0x1d'),_0x4c5e8c,JSON[_0xafb8('0x28')](_0x22e62e));_0x3850a0(_0x22e62e);})[_0xafb8('0x1c')](function(_0x10c422){logger[_0xafb8('0x18')](_0xafb8('0x1d'),_0x10c422[_0xafb8('0x1a')],_0x4c5e8c);_0x577fbf(_0x496c9f[_0xafb8('0x18')](0x1f4,_0x10c422[_0xafb8('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x3b84e9){var _0x523f25=this;return new Promise(function(_0x1afdb7,_0x3478b2){return db['VoiceQueueReport']['create'](_0x3b84e9[_0xafb8('0x29')],{'raw':_0x3b84e9['options']?_0x3b84e9[_0xafb8('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xafb8('0x13')](function(_0x30d1ba){logger[_0xafb8('0x14')](_0xafb8('0x2a'),_0x3b84e9);logger[_0xafb8('0x27')]('CreateVoiceQueueReport',_0x3b84e9,JSON[_0xafb8('0x28')](_0x30d1ba));_0x1afdb7(_0x30d1ba);})[_0xafb8('0x1c')](function(_0x21a49d){logger['error'](_0xafb8('0x2a'),_0x21a49d[_0xafb8('0x1a')],_0x3b84e9);_0x3478b2(_0x523f25[_0xafb8('0x18')](0x1f4,_0x21a49d[_0xafb8('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4b3f71){var _0xbaeee5=this;return new Promise(function(_0x2ee57b,_0x435bf7){return db[_0xafb8('0x2b')][_0xafb8('0x2c')](_0x4b3f71[_0xafb8('0x29')],{'raw':_0x4b3f71[_0xafb8('0x1f')]?_0x4b3f71[_0xafb8('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3f71[_0xafb8('0x1f')]?_0x4b3f71[_0xafb8('0x1f')][_0xafb8('0x21')]||null:null,'attributes':_0x4b3f71[_0xafb8('0x1f')]?_0x4b3f71[_0xafb8('0x1f')][_0xafb8('0x22')]||null:null,'limit':_0x4b3f71[_0xafb8('0x1f')]?_0x4b3f71[_0xafb8('0x1f')][_0xafb8('0x23')]||null:null})[_0xafb8('0x13')](function(_0x46ada0){logger['info'](_0xafb8('0x2d'),_0x4b3f71);logger['debug'](_0xafb8('0x2d'),_0x4b3f71,JSON[_0xafb8('0x28')](_0x46ada0));_0x2ee57b(_0x46ada0);})[_0xafb8('0x1c')](function(_0x25a6d6){logger[_0xafb8('0x18')](_0xafb8('0x2d'),_0x25a6d6[_0xafb8('0x1a')],_0x4b3f71);_0x435bf7(_0xbaeee5[_0xafb8('0x18')](0x1f4,_0x25a6d6[_0xafb8('0x1a')]));});});}; \ No newline at end of file +var _0x403b=['map','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueReport','options','raw','where','attributes','limit','include'];(function(_0x29e6d4,_0x104722){var _0x4af328=function(_0x46ed82){while(--_0x46ed82){_0x29e6d4['push'](_0x29e6d4['shift']());}};_0x4af328(++_0x104722);}(_0x403b,0xd0));var _0xb403=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x403b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xb403('0x0'));var util=require(_0xb403('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb403('0x2'));var db=require(_0xb403('0x3'))['db'];var utils=require(_0xb403('0x4'));var logger=require('../../config/logger')(_0xb403('0x5'));var config=require('../../config/environment');var jayson=require(_0xb403('0x6'));var client=jayson[_0xb403('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xb403('0x8')],{'host':_0xb403('0x9'),'port':0x18eb});var socket=require(_0xb403('0xa'))(new Redis(config[_0xb403('0x8')]));require(_0xb403('0xb'))[_0xb403('0xc')](socket);function respondWithRpcPromise(_0x578758,_0x1aea29,_0x440f49){return new BPromise(function(_0x3db209,_0x5a789f){return client[_0xb403('0xd')](_0x578758,_0x440f49)[_0xb403('0xe')](function(_0x49322f){logger[_0xb403('0xf')](_0xb403('0x10'),_0x1aea29,'request\x20sent');logger[_0xb403('0x11')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1aea29,_0xb403('0x12'),JSON[_0xb403('0x13')](_0x49322f));if(_0x49322f['error']){if(_0x49322f[_0xb403('0x14')][_0xb403('0x15')]===0x1f4){logger['error'](_0xb403('0x10'),_0x1aea29,_0x49322f[_0xb403('0x14')]['message']);return _0x5a789f(_0x49322f[_0xb403('0x14')][_0xb403('0x16')]);}logger[_0xb403('0x14')](_0xb403('0x10'),_0x1aea29,_0x49322f[_0xb403('0x14')][_0xb403('0x16')]);return _0x3db209(_0x49322f[_0xb403('0x14')][_0xb403('0x16')]);}else{logger[_0xb403('0xf')](_0xb403('0x10'),_0x1aea29,_0xb403('0x12'));_0x3db209(_0x49322f[_0xb403('0x17')][_0xb403('0x16')]);}})[_0xb403('0x18')](function(_0x5501bb){logger[_0xb403('0x14')](_0xb403('0x10'),_0x1aea29,_0x5501bb);_0x5a789f(_0x5501bb);});});}exports[_0xb403('0x19')]=function(_0x415907){var _0x234316=this;return new Promise(function(_0x3bb2b9,_0x5c98e5){return db['VoiceQueueReport']['findAll']({'raw':_0x415907['options']?_0x415907[_0xb403('0x1a')][_0xb403('0x1b')]===undefined?!![]:![]:!![],'where':_0x415907[_0xb403('0x1a')]?_0x415907['options'][_0xb403('0x1c')]||null:null,'attributes':_0x415907[_0xb403('0x1a')]?_0x415907[_0xb403('0x1a')][_0xb403('0x1d')]||null:null,'limit':_0x415907[_0xb403('0x1a')]?_0x415907['options'][_0xb403('0x1e')]||null:null,'include':_0x415907[_0xb403('0x1a')]?_0x415907['options'][_0xb403('0x1f')]?_[_0xb403('0x20')](_0x415907[_0xb403('0x1a')][_0xb403('0x1f')],function(_0x38cd6a){return{'model':db[_0x38cd6a[_0xb403('0x21')]],'as':_0x38cd6a['as'],'attributes':_0x38cd6a['attributes'],'include':_0x38cd6a['include']?_[_0xb403('0x20')](_0x38cd6a['include'],function(_0x2ef14d){return{'model':db[_0x2ef14d[_0xb403('0x21')]],'as':_0x2ef14d['as'],'attributes':_0x2ef14d[_0xb403('0x1d')],'include':_0x2ef14d[_0xb403('0x1f')]?_[_0xb403('0x20')](_0x2ef14d['include'],function(_0x2f76b5){return{'model':db[_0x2f76b5[_0xb403('0x21')]],'as':_0x2f76b5['as'],'attributes':_0x2f76b5[_0xb403('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb403('0xe')](function(_0x3c5f76){logger[_0xb403('0xf')]('GetVoiceQueueReport',_0x415907);logger[_0xb403('0x11')](_0xb403('0x19'),_0x415907,JSON[_0xb403('0x13')](_0x3c5f76));_0x3bb2b9(_0x3c5f76);})[_0xb403('0x18')](function(_0x202e9d){logger[_0xb403('0x14')]('GetVoiceQueueReport',_0x202e9d['message'],_0x415907);_0x5c98e5(_0x234316[_0xb403('0x14')](0x1f4,_0x202e9d['message']));});});};exports[_0xb403('0x22')]=function(_0x17f011){var _0xa2422b=this;return new Promise(function(_0x3576cd,_0x3f0023){return db[_0xb403('0x23')][_0xb403('0x24')](_0x17f011[_0xb403('0x25')],{'raw':_0x17f011[_0xb403('0x1a')]?_0x17f011[_0xb403('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xb403('0xe')](function(_0x549ec0){logger[_0xb403('0xf')](_0xb403('0x22'),_0x17f011);logger['debug'](_0xb403('0x22'),_0x17f011,JSON[_0xb403('0x13')](_0x549ec0));_0x3576cd(_0x549ec0);})[_0xb403('0x18')](function(_0x5290d7){logger['error']('CreateVoiceQueueReport',_0x5290d7[_0xb403('0x16')],_0x17f011);_0x3f0023(_0xa2422b[_0xb403('0x14')](0x1f4,_0x5290d7['message']));});});};exports[_0xb403('0x26')]=function(_0x3e54f0){var _0x32becf=this;return new Promise(function(_0x3f1b40,_0x4fe25b){return db[_0xb403('0x23')][_0xb403('0x27')](_0x3e54f0[_0xb403('0x25')],{'raw':_0x3e54f0['options']?_0x3e54f0['options'][_0xb403('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e54f0['options']?_0x3e54f0[_0xb403('0x1a')]['where']||null:null,'attributes':_0x3e54f0[_0xb403('0x1a')]?_0x3e54f0['options'][_0xb403('0x1d')]||null:null,'limit':_0x3e54f0['options']?_0x3e54f0[_0xb403('0x1a')][_0xb403('0x1e')]||null:null})['then'](function(_0x2e01a1){logger[_0xb403('0xf')](_0xb403('0x26'),_0x3e54f0);logger[_0xb403('0x11')]('UpdateVoiceQueueReport',_0x3e54f0,JSON[_0xb403('0x13')](_0x2e01a1));_0x3f1b40(_0x2e01a1);})[_0xb403('0x18')](function(_0x5a429a){logger[_0xb403('0x14')](_0xb403('0x26'),_0x5a429a['message'],_0x3e54f0);_0x4fe25b(_0x32becf[_0xb403('0x14')](0x1f4,_0x5a429a[_0xb403('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index abeff3e..2ab9152 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 _0x7abe=['update','removeListener','register','voiceQueueReport:','save','remove'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0x7abe,0xa0));var _0xe7ab=function(_0x2fc379,_0xd4e15){_0x2fc379=_0x2fc379-0x0;var _0x91e89d=_0x7abe[_0x2fc379];return _0x91e89d;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xe7ab('0x0'),_0xe7ab('0x1'),_0xe7ab('0x2')];function createListener(_0x178042,_0x22da03){return function(_0x402117){_0x22da03['emit'](_0x178042,_0x402117);};}function removeListener(_0x53f706,_0x4262e0){return function(){VoiceQueueReportEvents[_0xe7ab('0x3')](_0x53f706,_0x4262e0);};}exports[_0xe7ab('0x4')]=function(_0x4695ee){for(var _0x4e5c0b=0x0,_0x3503cd=events['length'];_0x4e5c0b<_0x3503cd;_0x4e5c0b++){var _0x3d7fd6=events[_0x4e5c0b];var _0x515230=createListener(_0xe7ab('0x5')+_0x3d7fd6,_0x4695ee);VoiceQueueReportEvents['on'](_0x3d7fd6,_0x515230);}}; \ No newline at end of file +var _0xc7aa=['register','./voiceQueueReport.events','save','update'];(function(_0x41f1a5,_0x53f9f3){var _0x50b44f=function(_0x240bce){while(--_0x240bce){_0x41f1a5['push'](_0x41f1a5['shift']());}};_0x50b44f(++_0x53f9f3);}(_0xc7aa,0x1a9));var _0xac7a=function(_0x5e851c,_0x41b03d){_0x5e851c=_0x5e851c-0x0;var _0x25c367=_0xc7aa[_0x5e851c];return _0x25c367;};'use strict';var VoiceQueueReportEvents=require(_0xac7a('0x0'));var events=[_0xac7a('0x1'),'remove',_0xac7a('0x2')];function createListener(_0x42ba47,_0xfde0ae){return function(_0x42f0d3){_0xfde0ae['emit'](_0x42ba47,_0x42f0d3);};}function removeListener(_0x2e87d2,_0x502d37){return function(){VoiceQueueReportEvents['removeListener'](_0x2e87d2,_0x502d37);};}exports[_0xac7a('0x3')]=function(_0x12c51b){for(var _0x2ae0b=0x0,_0x568e4e=events['length'];_0x2ae0b<_0x568e4e;_0x2ae0b++){var _0x2a7ddd=events[_0x2ae0b];var _0x534bf3=createListener('voiceQueueReport:'+_0x2a7ddd,_0x12c51b);VoiceQueueReportEvents['on'](_0x2a7ddd,_0x534bf3);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index a9efcb2..9e76316 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 _0x47c5=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x47c5,0x165));var _0x547c=function(_0x3d46e5,_0x565392){_0x3d46e5=_0x3d46e5-0x0;var _0x5b9e42=_0x47c5[_0x3d46e5];return _0x5b9e42;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x547c('0x6'));var config=require(_0x547c('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x547c('0x8')]('/',auth[_0x547c('0x9')](),controller['index']);router[_0x547c('0x8')](_0x547c('0xa'),auth[_0x547c('0x9')](),controller[_0x547c('0xb')]);router[_0x547c('0xc')]('/',auth[_0x547c('0x9')](),controller[_0x547c('0xd')]);router[_0x547c('0xe')](_0x547c('0xa'),auth[_0x547c('0x9')](),controller[_0x547c('0xf')]);router[_0x547c('0x10')](_0x547c('0xa'),auth[_0x547c('0x9')](),controller[_0x547c('0x11')]);module[_0x547c('0x12')]=router; \ No newline at end of file +var _0x2aa3=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x17290a,_0xc4a28e){var _0x415d35=function(_0x2e2203){while(--_0x2e2203){_0x17290a['push'](_0x17290a['shift']());}};_0x415d35(++_0xc4a28e);}(_0x2aa3,0x83));var _0x32aa=function(_0x440060,_0x17e4f5){_0x440060=_0x440060-0x0;var _0x58debe=_0x2aa3[_0x440060];return _0x58debe;};'use strict';var multer=require(_0x32aa('0x0'));var util=require(_0x32aa('0x1'));var path=require(_0x32aa('0x2'));var timeout=require(_0x32aa('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x32aa('0x4'));var interaction=require(_0x32aa('0x5'));var config=require(_0x32aa('0x6'));var controller=require(_0x32aa('0x7'));router[_0x32aa('0x8')]('/',auth[_0x32aa('0x9')](),controller['index']);router[_0x32aa('0x8')](_0x32aa('0xa'),auth[_0x32aa('0x9')](),controller[_0x32aa('0xb')]);router[_0x32aa('0xc')]('/',auth[_0x32aa('0x9')](),controller[_0x32aa('0xd')]);router[_0x32aa('0xe')]('/:id',auth[_0x32aa('0x9')](),controller['update']);router[_0x32aa('0xf')](_0x32aa('0xa'),auth[_0x32aa('0x9')](),controller[_0x32aa('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 2fc2f61..da72c8c 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 _0x7217=['sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4370c7,_0x5dbfb0){var _0xce78a9=function(_0x157b2c){while(--_0x157b2c){_0x4370c7['push'](_0x4370c7['shift']());}};_0xce78a9(++_0x5dbfb0);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x7721('0x0'));var moment=require('moment');module[_0x7721('0x1')]={'time':{'type':Sequelize[_0x7721('0x2')]},'callid':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7721('0x3')],'allowNull':![],'defaultValue':moment()[_0x7721('0x4')](_0x7721('0x5'))}}; \ No newline at end of file +var _0x2d17=['DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING'];(function(_0x3c9e45,_0x5bf8fe){var _0x4061c0=function(_0x1f3354){while(--_0x1f3354){_0x3c9e45['push'](_0x3c9e45['shift']());}};_0x4061c0(++_0x5bf8fe);}(_0x2d17,0x17e));var _0x72d1=function(_0x844ef3,_0x112530){_0x844ef3=_0x844ef3-0x0;var _0x88c371=_0x2d17[_0x844ef3];return _0x88c371;};'use strict';var Sequelize=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));module['exports']={'time':{'type':Sequelize[_0x72d1('0x2')]},'callid':{'type':Sequelize[_0x72d1('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x72d1('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x72d1('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x72d1('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x72d1('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x72d1('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x72d1('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x72d1('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8b7056e..1fe4cc8 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 _0x9635=['squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','VoiceQueuesLog','include','findAll','rows','catch','show','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0x9635,0x104));var _0x5963=function(_0x998e84,_0x2f1dd8){_0x998e84=_0x998e84-0x0;var _0x43ce2c=_0x9635[_0x998e84];return _0x43ce2c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5963('0x0'));var zipdir=require(_0x5963('0x1'));var jsonpatch=require(_0x5963('0x2'));var rp=require('request-promise');var moment=require(_0x5963('0x3'));var BPromise=require(_0x5963('0x4'));var Mustache=require('mustache');var util=require(_0x5963('0x5'));var path=require(_0x5963('0x6'));var sox=require(_0x5963('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5963('0x8'));var crypto=require(_0x5963('0x9'));var jsforce=require(_0x5963('0xa'));var deskjs=require(_0x5963('0xb'));var toCsv=require(_0x5963('0xc'));var querystring=require(_0x5963('0xd'));var Papa=require('papaparse');var Redis=require(_0x5963('0xe'));var authService=require(_0x5963('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5963('0x10'));var utils=require(_0x5963('0x11'));var config=require(_0x5963('0x12'));var db=require(_0x5963('0x13'))['db'];function respondWithStatusCode(_0x4a1b09,_0x3c2c3e){_0x3c2c3e=_0x3c2c3e||0xcc;return function(_0x30477b){if(_0x30477b){return _0x4a1b09[_0x5963('0x14')](_0x3c2c3e);}return _0x4a1b09[_0x5963('0x15')](_0x3c2c3e)['end']();};}function respondWithResult(_0x41db3b,_0x4846a6){_0x4846a6=_0x4846a6||0xc8;return function(_0x2bb5c9){if(_0x2bb5c9){return _0x41db3b[_0x5963('0x15')](_0x4846a6)[_0x5963('0x16')](_0x2bb5c9);}};}function respondWithFilteredResult(_0x23b44c,_0x19b7f2){return function(_0x3a98de){if(_0x3a98de){var _0x447a96=_0x3a98de[_0x5963('0x17')],_0x55f04d=_0x19b7f2[_0x5963('0x18')],_0x3c6453=_0x19b7f2['offset']+_0x19b7f2[_0x5963('0x19')],_0x354267;if(_0x3c6453>=_0x447a96){_0x3c6453=_0x447a96;_0x354267=0xc8;}else{_0x354267=0xce;}_0x23b44c[_0x5963('0x15')](_0x354267);return _0x23b44c[_0x5963('0x1a')](_0x5963('0x1b'),_0x55f04d+'-'+_0x3c6453+'/'+_0x447a96)['json'](_0x3a98de);}return null;};}function patchUpdates(_0x12ce65){return function(_0x32821a){try{jsonpatch[_0x5963('0x1c')](_0x32821a,_0x12ce65,!![]);}catch(_0x34fee4){return BPromise['reject'](_0x34fee4);}return _0x32821a['save']();};}function saveUpdates(_0x32faa1,_0x5ac236){return function(_0x38959f){if(_0x38959f){return _0x38959f[_0x5963('0x1d')](_0x32faa1)[_0x5963('0x1e')](function(_0x5c1b3a){return _0x5c1b3a;});}return null;};}function removeEntity(_0x5d72b2,_0x58cd9b){return function(_0x54ff94){if(_0x54ff94){return _0x54ff94[_0x5963('0x1f')]()[_0x5963('0x1e')](function(){_0x5d72b2[_0x5963('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56cd7a,_0x25e75f){return function(_0x25c26c){if(!_0x25c26c){_0x56cd7a[_0x5963('0x14')](0x194);}return _0x25c26c;};}function handleError(_0x5a46bb,_0x37159f){_0x37159f=_0x37159f||0x1f4;return function(_0x4e8307){logger[_0x5963('0x20')](_0x4e8307[_0x5963('0x21')]);if(_0x4e8307['name']){delete _0x4e8307[_0x5963('0x22')];}_0x5a46bb[_0x5963('0x15')](_0x37159f)[_0x5963('0x23')](_0x4e8307);};}exports['index']=function(_0x5a853b,_0x17f979){var _0x372a6d={},_0x234fe0={},_0x4deedf={'count':0x0,'rows':[]};var _0x36c4ff=db['VoiceQueuesLog'][_0x5963('0x24')];_0x234fe0[_0x5963('0x25')]=_[_0x5963('0x26')](_0x36c4ff);_0x234fe0[_0x5963('0x27')]=_[_0x5963('0x26')](_0x5a853b[_0x5963('0x27')]);_0x234fe0[_0x5963('0x28')]=_[_0x5963('0x29')](_0x234fe0[_0x5963('0x25')],_0x234fe0[_0x5963('0x27')]);_0x372a6d[_0x5963('0x2a')]=_['intersection'](_0x234fe0[_0x5963('0x25')],qs[_0x5963('0x2b')](_0x5a853b[_0x5963('0x27')][_0x5963('0x2b')]));_0x372a6d[_0x5963('0x2a')]=_0x372a6d[_0x5963('0x2a')][_0x5963('0x2c')]?_0x372a6d['attributes']:_0x234fe0[_0x5963('0x25')];if(!_0x5a853b[_0x5963('0x27')][_0x5963('0x2d')](_0x5963('0x2e'))){_0x372a6d[_0x5963('0x19')]=qs[_0x5963('0x19')](_0x5a853b[_0x5963('0x27')][_0x5963('0x19')]);_0x372a6d[_0x5963('0x18')]=qs[_0x5963('0x18')](_0x5a853b[_0x5963('0x27')][_0x5963('0x18')]);}_0x372a6d[_0x5963('0x2f')]=qs['sort'](_0x5a853b['query'][_0x5963('0x30')]);_0x372a6d['where']=qs[_0x5963('0x28')](_[_0x5963('0x31')](_0x5a853b[_0x5963('0x27')],_0x234fe0['filters']));if(_0x5a853b[_0x5963('0x27')][_0x5963('0x32')]){_0x372a6d[_0x5963('0x33')]=_[_0x5963('0x34')](_0x372a6d[_0x5963('0x33')],{'$or':_[_0x5963('0x35')](_0x36c4ff,function(_0x46b8a6){if(_0x46b8a6[_0x5963('0x36')]['key']!==_0x5963('0x37')){var _0x2ae387={};_0x2ae387[_0x46b8a6['field']]={'$like':'%'+_0x5a853b['query']['filter']+'%'};return _0x2ae387;}})});}_0x372a6d=_[_0x5963('0x34')]({},_0x372a6d,_0x5a853b['options']);var _0x213ff0={'where':_0x372a6d['where']};return db[_0x5963('0x38')]['count'](_0x213ff0)['then'](function(_0x5d589e){_0x4deedf[_0x5963('0x17')]=_0x5d589e;if(_0x5a853b[_0x5963('0x27')]['includeAll']){_0x372a6d[_0x5963('0x39')]=[{'all':!![]}];}return db[_0x5963('0x38')][_0x5963('0x3a')](_0x372a6d);})[_0x5963('0x1e')](function(_0x1594a4){_0x4deedf[_0x5963('0x3b')]=_0x1594a4;return _0x4deedf;})['then'](respondWithFilteredResult(_0x17f979,_0x372a6d))[_0x5963('0x3c')](handleError(_0x17f979,null));};exports[_0x5963('0x3d')]=function(_0x793943,_0x112758){var _0x1e2936={'raw':!![],'where':{'id':_0x793943['params']['id']}},_0x512ef1={};_0x512ef1['model']=_['keys'](db[_0x5963('0x38')][_0x5963('0x24')]);_0x512ef1['query']=_[_0x5963('0x26')](_0x793943[_0x5963('0x27')]);_0x512ef1[_0x5963('0x28')]=_[_0x5963('0x29')](_0x512ef1[_0x5963('0x25')],_0x512ef1['query']);_0x1e2936['attributes']=_['intersection'](_0x512ef1[_0x5963('0x25')],qs[_0x5963('0x2b')](_0x793943['query'][_0x5963('0x2b')]));_0x1e2936[_0x5963('0x2a')]=_0x1e2936[_0x5963('0x2a')][_0x5963('0x2c')]?_0x1e2936[_0x5963('0x2a')]:_0x512ef1[_0x5963('0x25')];if(_0x793943['query']['includeAll']){_0x1e2936[_0x5963('0x39')]=[{'all':!![]}];}_0x1e2936=_['merge']({},_0x1e2936,_0x793943[_0x5963('0x3e')]);return db[_0x5963('0x38')][_0x5963('0x3f')](_0x1e2936)[_0x5963('0x1e')](handleEntityNotFound(_0x112758,null))[_0x5963('0x1e')](respondWithResult(_0x112758,null))[_0x5963('0x3c')](handleError(_0x112758,null));};exports[_0x5963('0x40')]=function(_0x596473,_0x1e6e3f){return db[_0x5963('0x38')][_0x5963('0x40')](_0x596473[_0x5963('0x41')],{})[_0x5963('0x1e')](respondWithResult(_0x1e6e3f,0xc9))[_0x5963('0x3c')](handleError(_0x1e6e3f,null));};exports['update']=function(_0x5cdbca,_0x43be11){if(_0x5cdbca[_0x5963('0x41')]['id']){delete _0x5cdbca['body']['id'];}return db[_0x5963('0x38')]['find']({'where':{'id':_0x5cdbca[_0x5963('0x42')]['id']}})[_0x5963('0x1e')](handleEntityNotFound(_0x43be11,null))['then'](saveUpdates(_0x5cdbca[_0x5963('0x41')],null))[_0x5963('0x1e')](respondWithResult(_0x43be11,null))['catch'](handleError(_0x43be11,null));};exports['destroy']=function(_0xb2de71,_0x573950){return db['VoiceQueuesLog'][_0x5963('0x3f')]({'where':{'id':_0xb2de71[_0x5963('0x42')]['id']}})[_0x5963('0x1e')](handleEntityNotFound(_0x573950,null))[_0x5963('0x1e')](removeEntity(_0x573950,null))[_0x5963('0x3c')](handleError(_0x573950,null));}; \ No newline at end of file +var _0x91e8=['hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','include','find','create','body','params','html-pdf','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','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceQueuesLog','rawAttributes','model','keys','query','intersection','attributes','fields','length'];(function(_0x5d3a05,_0x4add38){var _0x12141a=function(_0x388eec){while(--_0x388eec){_0x5d3a05['push'](_0x5d3a05['shift']());}};_0x12141a(++_0x4add38);}(_0x91e8,0x144));var _0x891e=function(_0x198ef2,_0x3dbf35){_0x198ef2=_0x198ef2-0x0;var _0x579fd2=_0x91e8[_0x198ef2];return _0x579fd2;};'use strict';var pdf=require(_0x891e('0x0'));var emlformat=require(_0x891e('0x1'));var rimraf=require(_0x891e('0x2'));var zipdir=require(_0x891e('0x3'));var jsonpatch=require(_0x891e('0x4'));var rp=require(_0x891e('0x5'));var moment=require(_0x891e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x891e('0x7'));var util=require('util');var path=require(_0x891e('0x8'));var sox=require(_0x891e('0x9'));var csv=require('to-csv');var ejs=require(_0x891e('0xa'));var fs=require('fs');var _=require(_0x891e('0xb'));var squel=require(_0x891e('0xc'));var crypto=require('crypto');var jsforce=require(_0x891e('0xd'));var deskjs=require(_0x891e('0xe'));var toCsv=require(_0x891e('0xf'));var querystring=require(_0x891e('0x10'));var Papa=require(_0x891e('0x11'));var Redis=require(_0x891e('0x12'));var authService=require(_0x891e('0x13'));var qs=require(_0x891e('0x14'));var hardwareService=require(_0x891e('0x15'));var logger=require('../../config/logger')(_0x891e('0x16'));var utils=require(_0x891e('0x17'));var config=require(_0x891e('0x18'));var db=require(_0x891e('0x19'))['db'];function respondWithStatusCode(_0x2d11d8,_0xb4b6f4){_0xb4b6f4=_0xb4b6f4||0xcc;return function(_0x524f14){if(_0x524f14){return _0x2d11d8['sendStatus'](_0xb4b6f4);}return _0x2d11d8[_0x891e('0x1a')](_0xb4b6f4)[_0x891e('0x1b')]();};}function respondWithResult(_0x23123d,_0xac01b){_0xac01b=_0xac01b||0xc8;return function(_0x555400){if(_0x555400){return _0x23123d['status'](_0xac01b)[_0x891e('0x1c')](_0x555400);}};}function respondWithFilteredResult(_0x29d148,_0x10c06c){return function(_0x5658b1){if(_0x5658b1){var _0x53aba4=_0x5658b1[_0x891e('0x1d')],_0x45cc8f=_0x10c06c['offset'],_0x1d558d=_0x10c06c[_0x891e('0x1e')]+_0x10c06c['limit'],_0xf945e6;if(_0x1d558d>=_0x53aba4){_0x1d558d=_0x53aba4;_0xf945e6=0xc8;}else{_0xf945e6=0xce;}_0x29d148[_0x891e('0x1a')](_0xf945e6);return _0x29d148[_0x891e('0x1f')](_0x891e('0x20'),_0x45cc8f+'-'+_0x1d558d+'/'+_0x53aba4)[_0x891e('0x1c')](_0x5658b1);}return null;};}function patchUpdates(_0x63c66d){return function(_0x3e1392){try{jsonpatch[_0x891e('0x21')](_0x3e1392,_0x63c66d,!![]);}catch(_0x2b7815){return BPromise['reject'](_0x2b7815);}return _0x3e1392[_0x891e('0x22')]();};}function saveUpdates(_0x378478,_0x328f3c){return function(_0x1f4d7c){if(_0x1f4d7c){return _0x1f4d7c[_0x891e('0x23')](_0x378478)[_0x891e('0x24')](function(_0x245b2d){return _0x245b2d;});}return null;};}function removeEntity(_0x477bdc,_0x5f5d2f){return function(_0x227255){if(_0x227255){return _0x227255[_0x891e('0x25')]()[_0x891e('0x24')](function(){_0x477bdc[_0x891e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f973,_0x4a6c39){return function(_0x24fdb1){if(!_0x24fdb1){_0x55f973['sendStatus'](0x194);}return _0x24fdb1;};}function handleError(_0x2c7398,_0x488616){_0x488616=_0x488616||0x1f4;return function(_0x2ad915){logger['error'](_0x2ad915[_0x891e('0x26')]);if(_0x2ad915['name']){delete _0x2ad915[_0x891e('0x27')];}_0x2c7398[_0x891e('0x1a')](_0x488616)[_0x891e('0x28')](_0x2ad915);};}exports[_0x891e('0x29')]=function(_0x1fb25b,_0x1f7c12){var _0x30599b={},_0x554033={},_0x1ce14d={'count':0x0,'rows':[]};var _0x9ce58f=db[_0x891e('0x2a')][_0x891e('0x2b')];_0x554033[_0x891e('0x2c')]=_[_0x891e('0x2d')](_0x9ce58f);_0x554033[_0x891e('0x2e')]=_[_0x891e('0x2d')](_0x1fb25b[_0x891e('0x2e')]);_0x554033['filters']=_[_0x891e('0x2f')](_0x554033[_0x891e('0x2c')],_0x554033[_0x891e('0x2e')]);_0x30599b[_0x891e('0x30')]=_[_0x891e('0x2f')](_0x554033['model'],qs[_0x891e('0x31')](_0x1fb25b['query']['fields']));_0x30599b[_0x891e('0x30')]=_0x30599b[_0x891e('0x30')][_0x891e('0x32')]?_0x30599b[_0x891e('0x30')]:_0x554033[_0x891e('0x2c')];if(!_0x1fb25b[_0x891e('0x2e')][_0x891e('0x33')](_0x891e('0x34'))){_0x30599b['limit']=qs['limit'](_0x1fb25b['query'][_0x891e('0x35')]);_0x30599b['offset']=qs['offset'](_0x1fb25b[_0x891e('0x2e')][_0x891e('0x1e')]);}_0x30599b[_0x891e('0x36')]=qs[_0x891e('0x37')](_0x1fb25b[_0x891e('0x2e')]['sort']);_0x30599b['where']=qs[_0x891e('0x38')](_['pick'](_0x1fb25b[_0x891e('0x2e')],_0x554033[_0x891e('0x38')]));if(_0x1fb25b['query'][_0x891e('0x39')]){_0x30599b[_0x891e('0x3a')]=_['merge'](_0x30599b[_0x891e('0x3a')],{'$or':_[_0x891e('0x3b')](_0x9ce58f,function(_0x2f870d){if(_0x2f870d[_0x891e('0x3c')][_0x891e('0x3d')]!==_0x891e('0x3e')){var _0x58e99c={};_0x58e99c[_0x2f870d[_0x891e('0x3f')]]={'$like':'%'+_0x1fb25b[_0x891e('0x2e')][_0x891e('0x39')]+'%'};return _0x58e99c;}})});}_0x30599b=_[_0x891e('0x40')]({},_0x30599b,_0x1fb25b[_0x891e('0x41')]);var _0x35d40f={'where':_0x30599b[_0x891e('0x3a')]};return db[_0x891e('0x2a')]['count'](_0x35d40f)['then'](function(_0x23c404){_0x1ce14d[_0x891e('0x1d')]=_0x23c404;if(_0x1fb25b[_0x891e('0x2e')][_0x891e('0x42')]){_0x30599b['include']=[{'all':!![]}];}return db[_0x891e('0x2a')][_0x891e('0x43')](_0x30599b);})[_0x891e('0x24')](function(_0x15241e){_0x1ce14d[_0x891e('0x44')]=_0x15241e;return _0x1ce14d;})[_0x891e('0x24')](respondWithFilteredResult(_0x1f7c12,_0x30599b))[_0x891e('0x45')](handleError(_0x1f7c12,null));};exports['show']=function(_0x2013aa,_0x38f00a){var _0xf93b94={'raw':!![],'where':{'id':_0x2013aa['params']['id']}},_0x1caf13={};_0x1caf13[_0x891e('0x2c')]=_[_0x891e('0x2d')](db[_0x891e('0x2a')]['rawAttributes']);_0x1caf13[_0x891e('0x2e')]=_[_0x891e('0x2d')](_0x2013aa[_0x891e('0x2e')]);_0x1caf13[_0x891e('0x38')]=_['intersection'](_0x1caf13[_0x891e('0x2c')],_0x1caf13['query']);_0xf93b94[_0x891e('0x30')]=_['intersection'](_0x1caf13[_0x891e('0x2c')],qs[_0x891e('0x31')](_0x2013aa['query'][_0x891e('0x31')]));_0xf93b94['attributes']=_0xf93b94['attributes'][_0x891e('0x32')]?_0xf93b94[_0x891e('0x30')]:_0x1caf13[_0x891e('0x2c')];if(_0x2013aa[_0x891e('0x2e')][_0x891e('0x42')]){_0xf93b94[_0x891e('0x46')]=[{'all':!![]}];}_0xf93b94=_[_0x891e('0x40')]({},_0xf93b94,_0x2013aa[_0x891e('0x41')]);return db['VoiceQueuesLog'][_0x891e('0x47')](_0xf93b94)[_0x891e('0x24')](handleEntityNotFound(_0x38f00a,null))[_0x891e('0x24')](respondWithResult(_0x38f00a,null))[_0x891e('0x45')](handleError(_0x38f00a,null));};exports[_0x891e('0x48')]=function(_0x35cd62,_0x4dc9bf){return db[_0x891e('0x2a')][_0x891e('0x48')](_0x35cd62[_0x891e('0x49')],{})[_0x891e('0x24')](respondWithResult(_0x4dc9bf,0xc9))['catch'](handleError(_0x4dc9bf,null));};exports['update']=function(_0x4537de,_0x506030){if(_0x4537de[_0x891e('0x49')]['id']){delete _0x4537de[_0x891e('0x49')]['id'];}return db[_0x891e('0x2a')]['find']({'where':{'id':_0x4537de[_0x891e('0x4a')]['id']}})[_0x891e('0x24')](handleEntityNotFound(_0x506030,null))[_0x891e('0x24')](saveUpdates(_0x4537de[_0x891e('0x49')],null))['then'](respondWithResult(_0x506030,null))['catch'](handleError(_0x506030,null));};exports[_0x891e('0x25')]=function(_0x5948ba,_0x22fcef){return db[_0x891e('0x2a')][_0x891e('0x47')]({'where':{'id':_0x5948ba[_0x891e('0x4a')]['id']}})[_0x891e('0x24')](handleEntityNotFound(_0x22fcef,null))[_0x891e('0x24')](removeEntity(_0x22fcef,null))[_0x891e('0x45')](handleError(_0x22fcef,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 697b05a..988ea5c 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 _0xdc5f=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x410f5d,_0x4c9cd3){var _0x2fb0dd=function(_0x37091d){while(--_0x37091d){_0x410f5d['push'](_0x410f5d['shift']());}};_0x2fb0dd(++_0x4c9cd3);}(_0xdc5f,0x149));var _0xfdc5=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xdc5f[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xfdc5('0x0'));var util=require(_0xfdc5('0x1'));var logger=require(_0xfdc5('0x2'))(_0xfdc5('0x3'));var moment=require(_0xfdc5('0x4'));var BPromise=require('bluebird');var rp=require(_0xfdc5('0x5'));var fs=require('fs');var path=require(_0xfdc5('0x6'));var rimraf=require(_0xfdc5('0x7'));var config=require(_0xfdc5('0x8'));var attributes=require(_0xfdc5('0x9'));module[_0xfdc5('0xa')]=function(_0x33aecd,_0x503a5c){return _0x33aecd[_0xfdc5('0xb')](_0xfdc5('0xc'),attributes,{'tableName':_0xfdc5('0xd'),'paranoid':![],'indexes':[{'name':_0xfdc5('0xe'),'fields':[_0xfdc5('0xf'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x8f53=['VoiceQueuesLog','voice_queues_log','dtm','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x8f53,0x85));var _0x38f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f53[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x38f5('0x0'));var util=require(_0x38f5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x38f5('0x2'));var BPromise=require(_0x38f5('0x3'));var rp=require(_0x38f5('0x4'));var fs=require('fs');var path=require(_0x38f5('0x5'));var rimraf=require(_0x38f5('0x6'));var config=require(_0x38f5('0x7'));var attributes=require(_0x38f5('0x8'));module[_0x38f5('0x9')]=function(_0x52c6e9,_0x498ba6){return _0x52c6e9['define'](_0x38f5('0xa'),attributes,{'tableName':_0x38f5('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x38f5('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e206e9e..1fb42b3 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 _0x0d94=['http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client'];(function(_0xe80018,_0xd6884e){var _0x309cab=function(_0x14ab1f){while(--_0x14ab1f){_0xe80018['push'](_0xe80018['shift']());}};_0x309cab(++_0xd6884e);}(_0x0d94,0xb5));var _0x40d9=function(_0x55447e,_0x5a209b){_0x55447e=_0x55447e-0x0;var _0x5bd6fd=_0x0d94[_0x55447e];return _0x5bd6fd;};'use strict';var _=require(_0x40d9('0x0'));var util=require(_0x40d9('0x1'));var moment=require('moment');var BPromise=require(_0x40d9('0x2'));var rs=require(_0x40d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x40d9('0x5'));var config=require('../../config/environment');var jayson=require(_0x40d9('0x6'));var client=jayson[_0x40d9('0x7')][_0x40d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x76bbd9,_0x47ac62,_0x4cbeaf){return new BPromise(function(_0x89a147,_0x47eb51){return client[_0x40d9('0x9')](_0x76bbd9,_0x4cbeaf)[_0x40d9('0xa')](function(_0x4ff6e6){logger[_0x40d9('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x47ac62,'request\x20sent');logger['debug'](_0x40d9('0xc'),_0x47ac62,_0x40d9('0xd'),JSON[_0x40d9('0xe')](_0x4ff6e6));if(_0x4ff6e6[_0x40d9('0xf')]){if(_0x4ff6e6['error'][_0x40d9('0x10')]===0x1f4){logger[_0x40d9('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x47ac62,_0x4ff6e6[_0x40d9('0xf')][_0x40d9('0x11')]);return _0x47eb51(_0x4ff6e6[_0x40d9('0xf')][_0x40d9('0x11')]);}logger[_0x40d9('0xf')](_0x40d9('0x12'),_0x47ac62,_0x4ff6e6[_0x40d9('0xf')][_0x40d9('0x11')]);return _0x89a147(_0x4ff6e6[_0x40d9('0xf')][_0x40d9('0x11')]);}else{logger[_0x40d9('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x47ac62,_0x40d9('0xd'));_0x89a147(_0x4ff6e6[_0x40d9('0x13')][_0x40d9('0x11')]);}})[_0x40d9('0x14')](function(_0x2630f3){logger[_0x40d9('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x47ac62,_0x2630f3);_0x47eb51(_0x2630f3);});});} \ No newline at end of file +var _0x4034=['catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3aa2e8,_0x2b9050){var _0xc3d50f=function(_0x587769){while(--_0x587769){_0x3aa2e8['push'](_0x3aa2e8['shift']());}};_0xc3d50f(++_0x2b9050);}(_0x4034,0x166));var _0x4403=function(_0x1a6e19,_0x3d67f0){_0x1a6e19=_0x1a6e19-0x0;var _0x122bc2=_0x4034[_0x1a6e19];return _0x122bc2;};'use strict';var _=require('lodash');var util=require(_0x4403('0x0'));var moment=require(_0x4403('0x1'));var BPromise=require(_0x4403('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4403('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4403('0x4'));var logger=require(_0x4403('0x5'))('rpc');var config=require(_0x4403('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37f0cf,_0x538c95,_0xfd91ca){return new BPromise(function(_0x517d90,_0x4cdc07){return client['request'](_0x37f0cf,_0xfd91ca)['then'](function(_0xf3b5a9){logger[_0x4403('0x7')](_0x4403('0x8'),_0x538c95,_0x4403('0x9'));logger[_0x4403('0xa')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x538c95,_0x4403('0x9'),JSON[_0x4403('0xb')](_0xf3b5a9));if(_0xf3b5a9[_0x4403('0xc')]){if(_0xf3b5a9['error'][_0x4403('0xd')]===0x1f4){logger[_0x4403('0xc')](_0x4403('0x8'),_0x538c95,_0xf3b5a9[_0x4403('0xc')][_0x4403('0xe')]);return _0x4cdc07(_0xf3b5a9['error'][_0x4403('0xe')]);}logger['error'](_0x4403('0x8'),_0x538c95,_0xf3b5a9[_0x4403('0xc')]['message']);return _0x517d90(_0xf3b5a9[_0x4403('0xc')][_0x4403('0xe')]);}else{logger[_0x4403('0x7')](_0x4403('0x8'),_0x538c95,_0x4403('0x9'));_0x517d90(_0xf3b5a9[_0x4403('0xf')][_0x4403('0xe')]);}})[_0x4403('0x10')](function(_0x5db8df){logger['error'](_0x4403('0x8'),_0x538c95,_0x5db8df);_0x4cdc07(_0x5db8df);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 78998d0..f936707 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 _0x684c=['/:id/download','download','downloads','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2fe0a5,_0x4f67b9){var _0x3acbcc=function(_0xaa2292){while(--_0xaa2292){_0x2fe0a5['push'](_0x2fe0a5['shift']());}};_0x3acbcc(++_0x4f67b9);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var path=require('path');var timeout=require(_0xc684('0x2'));var express=require(_0xc684('0x3'));var router=express[_0xc684('0x4')]();var auth=require(_0xc684('0x5'));var interaction=require(_0xc684('0x6'));var config=require('../../config/environment');var controller=require(_0xc684('0x7'));router[_0xc684('0x8')]('/',auth[_0xc684('0x9')](),controller[_0xc684('0xa')]);router[_0xc684('0x8')](_0xc684('0xb'),auth[_0xc684('0x9')](),controller[_0xc684('0xc')]);router[_0xc684('0x8')](_0xc684('0xd'),auth[_0xc684('0x9')](),controller[_0xc684('0xe')]);router[_0xc684('0x8')](_0xc684('0xf'),auth[_0xc684('0x9')](),controller[_0xc684('0x10')]);router[_0xc684('0x8')]('/:id/downloads',controller[_0xc684('0x11')]);router[_0xc684('0x12')]('/',auth[_0xc684('0x9')](),controller[_0xc684('0x13')]);router[_0xc684('0x14')](_0xc684('0xd'),auth['isAuthenticated'](),controller[_0xc684('0x15')]);router[_0xc684('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xc684('0x17')]);module[_0xc684('0x18')]=router; \ No newline at end of file +var _0xcea2=['./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','/:id/downloads','downloads','post','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xcea2,0x15a));var _0x2cea=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xcea2[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var auth=require(_0x2cea('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2cea('0x5'));var controller=require(_0x2cea('0x6'));router[_0x2cea('0x7')]('/',auth['isAuthenticated'](),controller[_0x2cea('0x8')]);router['get'](_0x2cea('0x9'),auth[_0x2cea('0xa')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x7')](_0x2cea('0xc'),auth[_0x2cea('0xa')](),controller['show']);router[_0x2cea('0x7')](_0x2cea('0xd'),auth[_0x2cea('0xa')](),controller[_0x2cea('0xe')]);router[_0x2cea('0x7')](_0x2cea('0xf'),controller[_0x2cea('0x10')]);router[_0x2cea('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2cea('0x12')](_0x2cea('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2cea('0x13')]('/:id',auth[_0x2cea('0xa')](),controller[_0x2cea('0x14')]);module[_0x2cea('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index ac3becd..52935ed 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 _0x30d1=['moment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','membername','split','INTEGER','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','sequelize'];(function(_0x37aec3,_0x583967){var _0x4e65b8=function(_0x31ad98){while(--_0x31ad98){_0x37aec3['push'](_0x37aec3['shift']());}};_0x4e65b8(++_0x583967);}(_0x30d1,0xba));var _0x130d=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x30d1[_0x1cb18a];return _0x22442e;};'use strict';var Sequelize=require(_0x130d('0x0'));var moment=require(_0x130d('0x1'));var path=require('path');module[_0x130d('0x2')]={'format':{'type':Sequelize[_0x130d('0x3')],'get':function(){return this[_0x130d('0x4')](_0x130d('0x5'))?path[_0x130d('0x6')](this[_0x130d('0x4')](_0x130d('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x130d('0x7')]},'channel':{'type':Sequelize[_0x130d('0x7')],'set':function(_0x44e0c0){if(_0x44e0c0){this['setDataValue']('channel',_0x44e0c0);this[_0x130d('0x8')](_0x130d('0x9'),_0x44e0c0[_0x130d('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x130d('0x7')]},'calleridnum':{'type':Sequelize[_0x130d('0x7')]},'calleridname':{'type':Sequelize[_0x130d('0x7')]},'connectedlinenum':{'type':Sequelize[_0x130d('0x7')]},'connectedlinename':{'type':Sequelize[_0x130d('0x7')]},'accountcode':{'type':Sequelize[_0x130d('0x7')]},'context':{'type':Sequelize[_0x130d('0x7')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x130d('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0x130d('0xc')],'get':function(){return moment(this[_0x130d('0x4')](_0x130d('0xd')))[_0x130d('0xe')](_0x130d('0xf'))[_0x130d('0x10')]();}},'updatedAt':{'type':Sequelize[_0x130d('0xc')],'get':function(){return moment(this[_0x130d('0x4')]('updatedAt'))[_0x130d('0xe')](_0x130d('0xf'))[_0x130d('0x10')]();}}}; \ No newline at end of file +var _0xfeef=['MM-DD-YYYY\x20HH:mm','sequelize','moment','path','exports','extname','getDataValue','value','STRING','membername','split','INTEGER','DATE','createdAt','format','updatedAt'];(function(_0x2872b0,_0x4b0855){var _0x58b379=function(_0x18954b){while(--_0x18954b){_0x2872b0['push'](_0x2872b0['shift']());}};_0x58b379(++_0x4b0855);}(_0xfeef,0x81));var _0xffee=function(_0xf95114,_0x3a96dc){_0xf95114=_0xf95114-0x0;var _0x1d135c=_0xfeef[_0xf95114];return _0x1d135c;};'use strict';var Sequelize=require(_0xffee('0x0'));var moment=require(_0xffee('0x1'));var path=require(_0xffee('0x2'));module[_0xffee('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('value')?path[_0xffee('0x4')](this[_0xffee('0x5')](_0xffee('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0xffee('0x7')]},'channel':{'type':Sequelize[_0xffee('0x7')],'set':function(_0x2abe91){if(_0x2abe91){this['setDataValue']('channel',_0x2abe91);this['setDataValue'](_0xffee('0x8'),_0x2abe91[_0xffee('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xffee('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xffee('0x7')]},'connectedlinenum':{'type':Sequelize[_0xffee('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xffee('0x7')]},'context':{'type':Sequelize[_0xffee('0x7')]},'exten':{'type':Sequelize[_0xffee('0x7')]},'value':{'type':Sequelize[_0xffee('0x7')]},'type':{'type':Sequelize[_0xffee('0x7')]},'rating':{'type':Sequelize[_0xffee('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xffee('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xffee('0xb')],'get':function(){return moment(this[_0xffee('0x5')](_0xffee('0xc')))[_0xffee('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0xffee('0xb')],'get':function(){return moment(this[_0xffee('0x5')](_0xffee('0xe')))[_0xffee('0xd')](_0xffee('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index a150de3..bb89229 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 _0xd8ba=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','query','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','token','$and','push','format','recording','zip-dir','fast-json-patch','request-promise'];(function(_0x3c3d59,_0x369b04){var _0x25d467=function(_0x991667){while(--_0x991667){_0x3c3d59['push'](_0x3c3d59['shift']());}};_0x25d467(++_0x369b04);}(_0xd8ba,0x175));var _0xad8b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd8ba[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad8b('0x0'));var jsonpatch=require(_0xad8b('0x1'));var rp=require(_0xad8b('0x2'));var moment=require('moment');var BPromise=require(_0xad8b('0x3'));var Mustache=require(_0xad8b('0x4'));var util=require(_0xad8b('0x5'));var path=require('path');var sox=require(_0xad8b('0x6'));var csv=require(_0xad8b('0x7'));var ejs=require(_0xad8b('0x8'));var fs=require('fs');var _=require(_0xad8b('0x9'));var squel=require(_0xad8b('0xa'));var crypto=require(_0xad8b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xad8b('0xc'));var toCsv=require(_0xad8b('0x7'));var querystring=require(_0xad8b('0xd'));var Papa=require('papaparse');var Redis=require(_0xad8b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xad8b('0xf'));var hardwareService=require(_0xad8b('0x10'));var logger=require(_0xad8b('0x11'))('api');var utils=require(_0xad8b('0x12'));var config=require(_0xad8b('0x13'));var db=require(_0xad8b('0x14'))['db'];function respondWithStatusCode(_0x209e21,_0x1f386){_0x1f386=_0x1f386||0xcc;return function(_0x3e8857){if(_0x3e8857){return _0x209e21[_0xad8b('0x15')](_0x1f386);}return _0x209e21[_0xad8b('0x16')](_0x1f386)[_0xad8b('0x17')]();};}function respondWithResult(_0x49876f,_0x2bee59){_0x2bee59=_0x2bee59||0xc8;return function(_0x25c75f){if(_0x25c75f){return _0x49876f[_0xad8b('0x16')](_0x2bee59)[_0xad8b('0x18')](_0x25c75f);}};}function respondWithFilteredResult(_0x1ee501,_0xc9687e){return function(_0x26fe88){if(_0x26fe88){var _0xb4441d=_0x26fe88[_0xad8b('0x19')],_0x2b51c1=_0xc9687e[_0xad8b('0x1a')],_0x48ec10=_0xc9687e['offset']+_0xc9687e['limit'],_0x363a20;if(_0x48ec10>=_0xb4441d){_0x48ec10=_0xb4441d;_0x363a20=0xc8;}else{_0x363a20=0xce;}_0x1ee501[_0xad8b('0x16')](_0x363a20);return _0x1ee501[_0xad8b('0x1b')](_0xad8b('0x1c'),_0x2b51c1+'-'+_0x48ec10+'/'+_0xb4441d)[_0xad8b('0x18')](_0x26fe88);}return null;};}function patchUpdates(_0xfe7622){return function(_0xcd57d9){try{jsonpatch[_0xad8b('0x1d')](_0xcd57d9,_0xfe7622,!![]);}catch(_0x3927e8){return BPromise['reject'](_0x3927e8);}return _0xcd57d9[_0xad8b('0x1e')]();};}function saveUpdates(_0x36a44b,_0x20499b){return function(_0x56f801){if(_0x56f801){return _0x56f801[_0xad8b('0x1f')](_0x36a44b)[_0xad8b('0x20')](function(_0x2ec7ff){return _0x2ec7ff;});}return null;};}function removeEntity(_0x39a04b,_0x4c62dc){return function(_0x149741){if(_0x149741){return _0x149741[_0xad8b('0x21')]()[_0xad8b('0x20')](function(){_0x39a04b[_0xad8b('0x16')](0xcc)[_0xad8b('0x17')]();});}};}function handleEntityNotFound(_0x2db50c,_0xc46458){return function(_0x28f00d){if(!_0x28f00d){_0x2db50c[_0xad8b('0x15')](0x194);}return _0x28f00d;};}function handleError(_0x665283,_0x33ff53){_0x33ff53=_0x33ff53||0x1f4;return function(_0x17f884){logger[_0xad8b('0x22')](_0x17f884['stack']);if(_0x17f884[_0xad8b('0x23')]){delete _0x17f884[_0xad8b('0x23')];}_0x665283[_0xad8b('0x16')](_0x33ff53)[_0xad8b('0x24')](_0x17f884);};}exports[_0xad8b('0x25')]=function(_0x62ea08,_0x53f7bf){var _0x509fce={},_0x43ec4b={},_0x12a36f={'count':0x0,'rows':[]};var _0x4a8590=db[_0xad8b('0x26')][_0xad8b('0x27')];_0x43ec4b[_0xad8b('0x28')]=_[_0xad8b('0x29')](_[_0xad8b('0x2a')](_0x4a8590),['format']);_0x43ec4b[_0xad8b('0x2b')]=_[_0xad8b('0x2a')](_0x62ea08[_0xad8b('0x2b')]);_0x43ec4b['filters']=_[_0xad8b('0x2c')](_0x43ec4b[_0xad8b('0x28')],_0x43ec4b[_0xad8b('0x2b')]);_0x509fce[_0xad8b('0x2d')]=_['intersection'](_0x43ec4b['model'],qs[_0xad8b('0x2e')](_0x62ea08['query'][_0xad8b('0x2e')]));_0x509fce[_0xad8b('0x2d')]=_0x509fce[_0xad8b('0x2d')]['length']?_0x509fce['attributes']:_0x43ec4b[_0xad8b('0x28')];if(!_0x62ea08[_0xad8b('0x2b')][_0xad8b('0x2f')]('nolimit')){_0x509fce[_0xad8b('0x30')]=qs[_0xad8b('0x30')](_0x62ea08[_0xad8b('0x2b')][_0xad8b('0x30')]);_0x509fce[_0xad8b('0x1a')]=qs[_0xad8b('0x1a')](_0x62ea08[_0xad8b('0x2b')][_0xad8b('0x1a')]);}_0x509fce[_0xad8b('0x31')]=qs[_0xad8b('0x32')](_0x62ea08[_0xad8b('0x2b')]['sort']);_0x509fce[_0xad8b('0x33')]=qs['filters'](_[_0xad8b('0x34')](_0x62ea08[_0xad8b('0x2b')],_0x43ec4b[_0xad8b('0x35')]));if(_0x62ea08[_0xad8b('0x2b')][_0xad8b('0x36')]){_0x509fce['where']=_[_0xad8b('0x37')](_0x509fce[_0xad8b('0x33')],{'$or':_[_0xad8b('0x38')](_0x4a8590,function(_0x3e6ec7){if(_0x3e6ec7[_0xad8b('0x39')]['key']!==_0xad8b('0x3a')){var _0x32c384={};_0x32c384[_0x3e6ec7[_0xad8b('0x3b')]]={'$like':'%'+_0x62ea08[_0xad8b('0x2b')]['filter']+'%'};return _0x32c384;}})});}_0x509fce=_[_0xad8b('0x37')]({},_0x509fce,_0x62ea08[_0xad8b('0x3c')]);var _0x208c27={'where':_0x509fce[_0xad8b('0x33')]};return db['VoiceRecording'][_0xad8b('0x19')](_0x208c27)['then'](function(_0x134a10){_0x12a36f[_0xad8b('0x19')]=_0x134a10;if(_0x62ea08['query'][_0xad8b('0x3d')]){_0x509fce[_0xad8b('0x3e')]=[{'all':!![]}];}return db[_0xad8b('0x26')][_0xad8b('0x3f')](_0x509fce);})[_0xad8b('0x20')](function(_0x559cf1){_0x12a36f[_0xad8b('0x40')]=_0x559cf1;return _0x12a36f;})[_0xad8b('0x20')](respondWithFilteredResult(_0x53f7bf,_0x509fce))[_0xad8b('0x41')](handleError(_0x53f7bf,null));};exports[_0xad8b('0x42')]=function(_0x7bb853,_0x2d7cae){var _0x36a5dd={'raw':![],'where':{'id':_0x7bb853['params']['id']}},_0x5ea9fd={};_0x5ea9fd[_0xad8b('0x28')]=_[_0xad8b('0x2a')](db[_0xad8b('0x26')][_0xad8b('0x27')]);_0x5ea9fd['query']=_['keys'](_0x7bb853['query']);_0x5ea9fd['filters']=_[_0xad8b('0x2c')](_0x5ea9fd[_0xad8b('0x28')],_0x5ea9fd['query']);_0x36a5dd[_0xad8b('0x2d')]=_[_0xad8b('0x2c')](_0x5ea9fd['model'],qs['fields'](_0x7bb853[_0xad8b('0x2b')][_0xad8b('0x2e')]));_0x36a5dd[_0xad8b('0x2d')]=_0x36a5dd[_0xad8b('0x2d')]['length']?_0x36a5dd[_0xad8b('0x2d')]:_0x5ea9fd['model'];if(_0x7bb853['query']['includeAll']){_0x36a5dd[_0xad8b('0x3e')]=[{'all':!![]}];}_0x36a5dd=_[_0xad8b('0x37')]({},_0x36a5dd,_0x7bb853[_0xad8b('0x3c')]);return db[_0xad8b('0x26')][_0xad8b('0x43')](_0x36a5dd)['then'](handleEntityNotFound(_0x2d7cae,null))[_0xad8b('0x20')](respondWithResult(_0x2d7cae,null))[_0xad8b('0x41')](handleError(_0x2d7cae,null));};exports[_0xad8b('0x44')]=function(_0x2358d4,_0x401649){return db[_0xad8b('0x26')][_0xad8b('0x44')](_0x2358d4['body'],{})['then'](respondWithResult(_0x401649,0xc9))[_0xad8b('0x41')](handleError(_0x401649,null));};exports[_0xad8b('0x1f')]=function(_0x23b9b3,_0x3d101c){if(_0x23b9b3['body']['id']){delete _0x23b9b3[_0xad8b('0x45')]['id'];}return db[_0xad8b('0x26')][_0xad8b('0x43')]({'where':{'id':_0x23b9b3[_0xad8b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d101c,null))['then'](saveUpdates(_0x23b9b3[_0xad8b('0x45')],null))['then'](respondWithResult(_0x3d101c,null))[_0xad8b('0x41')](handleError(_0x3d101c,null));};exports['destroy']=function(_0x2b5f6a,_0x20bbde){return db[_0xad8b('0x26')][_0xad8b('0x43')]({'where':{'id':_0x2b5f6a[_0xad8b('0x46')]['id']}})[_0xad8b('0x20')](handleEntityNotFound(_0x20bbde,null))['then'](removeEntity(_0x20bbde,null))[_0xad8b('0x41')](handleError(_0x20bbde,null));};exports['describe']=function(_0x985f9c,_0x3b6ff5){return db[_0xad8b('0x26')]['describe']()[_0xad8b('0x20')](respondWithResult(_0x3b6ff5,null))[_0xad8b('0x41')](handleError(_0x3b6ff5,null));};exports[_0xad8b('0x47')]=function(_0x34a95d,_0x53bf94,_0x105a77){var _0x29e917=require('../../components/encryptor');var _0x4aeaaf=![];var _0x4e37d0={};if(_0x34a95d[_0xad8b('0x2b')][_0xad8b('0x39')]&&_0x34a95d[_0xad8b('0x2b')][_0xad8b('0x39')]===_0xad8b('0x48')){_0x4e37d0[_0xad8b('0x48')]=_0x34a95d[_0xad8b('0x46')]['id'];}else{_0x4e37d0['id']=_0x34a95d[_0xad8b('0x46')]['id'];}return db[_0xad8b('0x26')]['find']({'where':_0x4e37d0,'attributes':['id',_0xad8b('0x49')],'raw':!![]})[_0xad8b('0x20')](handleEntityNotFound(_0x53bf94,null))[_0xad8b('0x20')](function(_0x4ed77d){if(_0x4ed77d){var _0x23838d=_0x4ed77d[_0xad8b('0x49')];var _0x1b630d=util['format'](_0xad8b('0x4a'),_0x23838d);if(fs[_0xad8b('0x4b')](_0x1b630d)){_0x4aeaaf=!![];return _0x29e917[_0xad8b('0x4c')](_0x1b630d,_0x23838d,config[_0xad8b('0x4d')]['recording'])['then'](function(){return _0x4ed77d;});}return _0x4ed77d;}})[_0xad8b('0x20')](function(_0x25be7a){if(_0x25be7a){var _0x3967a9=_0x25be7a[_0xad8b('0x49')];if(!fs[_0xad8b('0x4b')](_0x3967a9)){throw new db[(_0xad8b('0x4e'))][(_0xad8b('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x25be7a[_0xad8b('0x50')]){return _0x53bf94[_0xad8b('0x47')](_0x3967a9,_0x25be7a[_0xad8b('0x50')]+path[_0xad8b('0x51')](_0x3967a9),function(){if(_0x4aeaaf){fs[_0xad8b('0x52')](_0x3967a9);}});}else{return _0x53bf94[_0xad8b('0x47')](_0x3967a9,function(_0x526631){if(_0x4aeaaf){fs[_0xad8b('0x52')](_0x3967a9);}});}}})['catch'](function(_0x2cfb3e){if(_0x2cfb3e['message']===_0xad8b('0x53')){_0x53bf94[_0xad8b('0x16')](0x194)[_0xad8b('0x24')](_0xad8b('0x54'));}else{return handleError(_0x53bf94,null);}});};exports[_0xad8b('0x55')]=function(_0x11663d,_0x489862,_0x4a02ec){var _0x508ade=require(_0xad8b('0x56'));var _0x49b473=![];var _0x5259f7={'$and':[db[_0xad8b('0x57')][_0xad8b('0x33')](db[_0xad8b('0x57')]['fn'](_0xad8b('0x58'),db[_0xad8b('0x57')]['col']('uniqueid')),_0x11663d['query'][_0xad8b('0x59')])]};if(_0x11663d[_0xad8b('0x2b')][_0xad8b('0x39')]&&_0x11663d[_0xad8b('0x2b')][_0xad8b('0x39')]===_0xad8b('0x48')){_0x5259f7[_0xad8b('0x5a')][_0xad8b('0x5b')]({'uniqueid':_0x11663d[_0xad8b('0x46')]['id']});}else{_0x5259f7[_0xad8b('0x5a')][_0xad8b('0x5b')]({'id':_0x11663d['params']['id']});}return db['VoiceRecording'][_0xad8b('0x43')]({'where':_0x5259f7,'attributes':['id',_0xad8b('0x49')],'raw':!![]})[_0xad8b('0x20')](handleEntityNotFound(_0x489862,null))[_0xad8b('0x20')](function(_0x4ab66f){if(_0x4ab66f){var _0x4753e2=util[_0xad8b('0x5c')]('%s.cypher',_0x4ab66f[_0xad8b('0x49')]);if(fs[_0xad8b('0x4b')](_0x4753e2)){_0x49b473=!![];return _0x508ade['decryptFile'](_0x4753e2,_0x4ab66f[_0xad8b('0x49')],config[_0xad8b('0x4d')][_0xad8b('0x5d')])[_0xad8b('0x20')](function(){return _0x4ab66f;});}return _0x4ab66f;}})['then'](function(_0x82ac16){if(_0x82ac16){if(!fs[_0xad8b('0x4b')](_0x82ac16['value'])){throw new db[(_0xad8b('0x4e'))][(_0xad8b('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x82ac16[_0xad8b('0x50')]){return _0x489862[_0xad8b('0x47')](_0x82ac16[_0xad8b('0x49')],_0x82ac16[_0xad8b('0x50')]+path['extname'](_0x82ac16[_0xad8b('0x49')]),function(){if(_0x49b473){fs[_0xad8b('0x52')](_0x82ac16['value']);}});}else{return _0x489862[_0xad8b('0x47')](_0x82ac16['value'],function(_0x14c3a1){if(_0x49b473){fs[_0xad8b('0x52')](_0x82ac16[_0xad8b('0x49')]);}});}}})[_0xad8b('0x41')](handleError(_0x489862,null));}; \ No newline at end of file +var _0x82b9=['nolimit','order','sort','where','pick','filter','merge','map','key','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','describe','../../components/encryptor','type','uniqueid','value','%s.cypher','decryptFile','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','Sequelize','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','reject','save','then','destroy','error','name','send','VoiceRecording','rawAttributes','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x82b9,0x149));var _0x982b=function(_0x55723e,_0x339471){_0x55723e=_0x55723e-0x0;var _0x51f9c6=_0x82b9[_0x55723e];return _0x51f9c6;};'use strict';var pdf=require(_0x982b('0x0'));var emlformat=require(_0x982b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x982b('0x2'));var rp=require(_0x982b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x982b('0x4'));var util=require(_0x982b('0x5'));var path=require(_0x982b('0x6'));var sox=require('sox');var csv=require(_0x982b('0x7'));var ejs=require(_0x982b('0x8'));var fs=require('fs');var _=require(_0x982b('0x9'));var squel=require(_0x982b('0xa'));var crypto=require(_0x982b('0xb'));var jsforce=require(_0x982b('0xc'));var deskjs=require(_0x982b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x982b('0xe'));var authService=require(_0x982b('0xf'));var qs=require(_0x982b('0x10'));var hardwareService=require(_0x982b('0x11'));var logger=require(_0x982b('0x12'))(_0x982b('0x13'));var utils=require(_0x982b('0x14'));var config=require(_0x982b('0x15'));var db=require(_0x982b('0x16'))['db'];function respondWithStatusCode(_0x2b7a60,_0x29c70f){_0x29c70f=_0x29c70f||0xcc;return function(_0x817a75){if(_0x817a75){return _0x2b7a60[_0x982b('0x17')](_0x29c70f);}return _0x2b7a60['status'](_0x29c70f)[_0x982b('0x18')]();};}function respondWithResult(_0xc67d83,_0x215d5a){_0x215d5a=_0x215d5a||0xc8;return function(_0x398d90){if(_0x398d90){return _0xc67d83[_0x982b('0x19')](_0x215d5a)[_0x982b('0x1a')](_0x398d90);}};}function respondWithFilteredResult(_0x3b3e43,_0x158e09){return function(_0xac93a7){if(_0xac93a7){var _0x359bbc=_0xac93a7[_0x982b('0x1b')],_0x3a5099=_0x158e09['offset'],_0x5f58d3=_0x158e09[_0x982b('0x1c')]+_0x158e09[_0x982b('0x1d')],_0x3d6f72;if(_0x5f58d3>=_0x359bbc){_0x5f58d3=_0x359bbc;_0x3d6f72=0xc8;}else{_0x3d6f72=0xce;}_0x3b3e43[_0x982b('0x19')](_0x3d6f72);return _0x3b3e43[_0x982b('0x1e')]('Content-Range',_0x3a5099+'-'+_0x5f58d3+'/'+_0x359bbc)[_0x982b('0x1a')](_0xac93a7);}return null;};}function patchUpdates(_0x426935){return function(_0x51e905){try{jsonpatch['apply'](_0x51e905,_0x426935,!![]);}catch(_0x1f37fb){return BPromise[_0x982b('0x1f')](_0x1f37fb);}return _0x51e905[_0x982b('0x20')]();};}function saveUpdates(_0xe4da1f,_0x29cadf){return function(_0x1e4c0d){if(_0x1e4c0d){return _0x1e4c0d['update'](_0xe4da1f)[_0x982b('0x21')](function(_0x45c36f){return _0x45c36f;});}return null;};}function removeEntity(_0x39af3d,_0x1ccb15){return function(_0x27f50b){if(_0x27f50b){return _0x27f50b[_0x982b('0x22')]()[_0x982b('0x21')](function(){_0x39af3d[_0x982b('0x19')](0xcc)[_0x982b('0x18')]();});}};}function handleEntityNotFound(_0x1d9eb7,_0x2cb8fa){return function(_0x108cf1){if(!_0x108cf1){_0x1d9eb7[_0x982b('0x17')](0x194);}return _0x108cf1;};}function handleError(_0x341d98,_0x5fe347){_0x5fe347=_0x5fe347||0x1f4;return function(_0x1cc973){logger[_0x982b('0x23')](_0x1cc973['stack']);if(_0x1cc973[_0x982b('0x24')]){delete _0x1cc973[_0x982b('0x24')];}_0x341d98['status'](_0x5fe347)[_0x982b('0x25')](_0x1cc973);};}exports['index']=function(_0x458ce4,_0x55a937){var _0x50dca9={},_0x29e13d={},_0x1fd2b0={'count':0x0,'rows':[]};var _0x497e7b=db[_0x982b('0x26')][_0x982b('0x27')];_0x29e13d[_0x982b('0x28')]=_[_0x982b('0x29')](_['keys'](_0x497e7b),[_0x982b('0x2a')]);_0x29e13d[_0x982b('0x2b')]=_[_0x982b('0x2c')](_0x458ce4[_0x982b('0x2b')]);_0x29e13d[_0x982b('0x2d')]=_[_0x982b('0x2e')](_0x29e13d[_0x982b('0x28')],_0x29e13d['query']);_0x50dca9[_0x982b('0x2f')]=_[_0x982b('0x2e')](_0x29e13d[_0x982b('0x28')],qs[_0x982b('0x30')](_0x458ce4[_0x982b('0x2b')][_0x982b('0x30')]));_0x50dca9[_0x982b('0x2f')]=_0x50dca9[_0x982b('0x2f')][_0x982b('0x31')]?_0x50dca9[_0x982b('0x2f')]:_0x29e13d[_0x982b('0x28')];if(!_0x458ce4[_0x982b('0x2b')][_0x982b('0x32')](_0x982b('0x33'))){_0x50dca9['limit']=qs['limit'](_0x458ce4[_0x982b('0x2b')]['limit']);_0x50dca9[_0x982b('0x1c')]=qs[_0x982b('0x1c')](_0x458ce4['query'][_0x982b('0x1c')]);}_0x50dca9[_0x982b('0x34')]=qs[_0x982b('0x35')](_0x458ce4[_0x982b('0x2b')][_0x982b('0x35')]);_0x50dca9[_0x982b('0x36')]=qs[_0x982b('0x2d')](_[_0x982b('0x37')](_0x458ce4['query'],_0x29e13d[_0x982b('0x2d')]));if(_0x458ce4[_0x982b('0x2b')][_0x982b('0x38')]){_0x50dca9[_0x982b('0x36')]=_[_0x982b('0x39')](_0x50dca9[_0x982b('0x36')],{'$or':_[_0x982b('0x3a')](_0x497e7b,function(_0x17af19){if(_0x17af19['type'][_0x982b('0x3b')]!=='VIRTUAL'){var _0x633021={};_0x633021[_0x17af19['field']]={'$like':'%'+_0x458ce4['query']['filter']+'%'};return _0x633021;}})});}_0x50dca9=_[_0x982b('0x39')]({},_0x50dca9,_0x458ce4[_0x982b('0x3c')]);var _0x94c3dd={'where':_0x50dca9['where']};return db[_0x982b('0x26')][_0x982b('0x1b')](_0x94c3dd)[_0x982b('0x21')](function(_0x46b5e6){_0x1fd2b0[_0x982b('0x1b')]=_0x46b5e6;if(_0x458ce4[_0x982b('0x2b')][_0x982b('0x3d')]){_0x50dca9[_0x982b('0x3e')]=[{'all':!![]}];}return db['VoiceRecording'][_0x982b('0x3f')](_0x50dca9);})[_0x982b('0x21')](function(_0xc11795){_0x1fd2b0[_0x982b('0x40')]=_0xc11795;return _0x1fd2b0;})[_0x982b('0x21')](respondWithFilteredResult(_0x55a937,_0x50dca9))['catch'](handleError(_0x55a937,null));};exports[_0x982b('0x41')]=function(_0x2b2e87,_0x5cfc28){var _0x6a22e5={'raw':![],'where':{'id':_0x2b2e87[_0x982b('0x42')]['id']}},_0x5d65f1={};_0x5d65f1[_0x982b('0x28')]=_[_0x982b('0x2c')](db[_0x982b('0x26')][_0x982b('0x27')]);_0x5d65f1[_0x982b('0x2b')]=_[_0x982b('0x2c')](_0x2b2e87[_0x982b('0x2b')]);_0x5d65f1[_0x982b('0x2d')]=_[_0x982b('0x2e')](_0x5d65f1[_0x982b('0x28')],_0x5d65f1['query']);_0x6a22e5['attributes']=_[_0x982b('0x2e')](_0x5d65f1[_0x982b('0x28')],qs[_0x982b('0x30')](_0x2b2e87['query'][_0x982b('0x30')]));_0x6a22e5[_0x982b('0x2f')]=_0x6a22e5['attributes'][_0x982b('0x31')]?_0x6a22e5['attributes']:_0x5d65f1[_0x982b('0x28')];if(_0x2b2e87[_0x982b('0x2b')][_0x982b('0x3d')]){_0x6a22e5[_0x982b('0x3e')]=[{'all':!![]}];}_0x6a22e5=_[_0x982b('0x39')]({},_0x6a22e5,_0x2b2e87[_0x982b('0x3c')]);return db['VoiceRecording'][_0x982b('0x43')](_0x6a22e5)[_0x982b('0x21')](handleEntityNotFound(_0x5cfc28,null))['then'](respondWithResult(_0x5cfc28,null))[_0x982b('0x44')](handleError(_0x5cfc28,null));};exports[_0x982b('0x45')]=function(_0x654ff9,_0x3cb02f){return db[_0x982b('0x26')][_0x982b('0x45')](_0x654ff9[_0x982b('0x46')],{})[_0x982b('0x21')](respondWithResult(_0x3cb02f,0xc9))[_0x982b('0x44')](handleError(_0x3cb02f,null));};exports[_0x982b('0x47')]=function(_0x9c52b,_0x43ba69){if(_0x9c52b['body']['id']){delete _0x9c52b[_0x982b('0x46')]['id'];}return db[_0x982b('0x26')][_0x982b('0x43')]({'where':{'id':_0x9c52b['params']['id']}})[_0x982b('0x21')](handleEntityNotFound(_0x43ba69,null))[_0x982b('0x21')](saveUpdates(_0x9c52b[_0x982b('0x46')],null))['then'](respondWithResult(_0x43ba69,null))['catch'](handleError(_0x43ba69,null));};exports['destroy']=function(_0x4cbd61,_0x50e00e){return db['VoiceRecording'][_0x982b('0x43')]({'where':{'id':_0x4cbd61[_0x982b('0x42')]['id']}})[_0x982b('0x21')](handleEntityNotFound(_0x50e00e,null))['then'](removeEntity(_0x50e00e,null))[_0x982b('0x44')](handleError(_0x50e00e,null));};exports[_0x982b('0x48')]=function(_0x3808ee,_0x5b8432){return db[_0x982b('0x26')]['describe']()[_0x982b('0x21')](respondWithResult(_0x5b8432,null))[_0x982b('0x44')](handleError(_0x5b8432,null));};exports['download']=function(_0x5abf97,_0x1f16b5,_0x2ada9b){var _0xffe6fc=require(_0x982b('0x49'));var _0x227d32=![];var _0x3347c1={};if(_0x5abf97['query'][_0x982b('0x4a')]&&_0x5abf97[_0x982b('0x2b')][_0x982b('0x4a')]===_0x982b('0x4b')){_0x3347c1['uniqueid']=_0x5abf97[_0x982b('0x42')]['id'];}else{_0x3347c1['id']=_0x5abf97[_0x982b('0x42')]['id'];}return db['VoiceRecording'][_0x982b('0x43')]({'where':_0x3347c1,'attributes':['id',_0x982b('0x4c')],'raw':!![]})[_0x982b('0x21')](handleEntityNotFound(_0x1f16b5,null))[_0x982b('0x21')](function(_0x328eea){if(_0x328eea){var _0x4ef034=_0x328eea['value'];var _0x38bd1e=util[_0x982b('0x2a')](_0x982b('0x4d'),_0x4ef034);if(fs['existsSync'](_0x38bd1e)){_0x227d32=!![];return _0xffe6fc[_0x982b('0x4e')](_0x38bd1e,_0x4ef034,config['secrets']['recording'])[_0x982b('0x21')](function(){return _0x328eea;});}return _0x328eea;}})[_0x982b('0x21')](function(_0x26fd1e){if(_0x26fd1e){var _0x4e5f39=_0x26fd1e[_0x982b('0x4c')];if(!fs[_0x982b('0x4f')](_0x4e5f39)){throw new db['Sequelize'][(_0x982b('0x50'))](_0x982b('0x51'));}if(_0x26fd1e[_0x982b('0x52')]){return _0x1f16b5[_0x982b('0x53')](_0x4e5f39,_0x26fd1e['filename']+path[_0x982b('0x54')](_0x4e5f39),function(){if(_0x227d32){fs[_0x982b('0x55')](_0x4e5f39);}});}else{return _0x1f16b5[_0x982b('0x53')](_0x4e5f39,function(_0x2c6707){if(_0x227d32){fs['unlink'](_0x4e5f39);}});}}})[_0x982b('0x44')](function(_0x5b7758){if(_0x5b7758[_0x982b('0x56')]===_0x982b('0x51')){_0x1f16b5[_0x982b('0x19')](0x194)[_0x982b('0x25')](_0x982b('0x57'));}else{return handleError(_0x1f16b5,null);}});};exports[_0x982b('0x58')]=function(_0x57238f,_0x25e136,_0x4411bb){var _0x5acb9a=require(_0x982b('0x49'));var _0x3af521=![];var _0x5d3f0c={'$and':[db[_0x982b('0x59')][_0x982b('0x36')](db[_0x982b('0x59')]['fn'](_0x982b('0x5a'),db[_0x982b('0x59')][_0x982b('0x5b')](_0x982b('0x4b'))),_0x57238f[_0x982b('0x2b')][_0x982b('0x5c')])]};if(_0x57238f[_0x982b('0x2b')][_0x982b('0x4a')]&&_0x57238f['query'][_0x982b('0x4a')]===_0x982b('0x4b')){_0x5d3f0c[_0x982b('0x5d')]['push']({'uniqueid':_0x57238f[_0x982b('0x42')]['id']});}else{_0x5d3f0c[_0x982b('0x5d')]['push']({'id':_0x57238f[_0x982b('0x42')]['id']});}return db[_0x982b('0x26')][_0x982b('0x43')]({'where':_0x5d3f0c,'attributes':['id',_0x982b('0x4c')],'raw':!![]})[_0x982b('0x21')](handleEntityNotFound(_0x25e136,null))[_0x982b('0x21')](function(_0x2f6341){if(_0x2f6341){var _0x25a8c6=util[_0x982b('0x2a')](_0x982b('0x4d'),_0x2f6341['value']);if(fs[_0x982b('0x4f')](_0x25a8c6)){_0x3af521=!![];return _0x5acb9a[_0x982b('0x4e')](_0x25a8c6,_0x2f6341[_0x982b('0x4c')],config['secrets']['recording'])['then'](function(){return _0x2f6341;});}return _0x2f6341;}})[_0x982b('0x21')](function(_0x531d8f){if(_0x531d8f){if(!fs[_0x982b('0x4f')](_0x531d8f[_0x982b('0x4c')])){throw new db[(_0x982b('0x5e'))][(_0x982b('0x50'))](_0x982b('0x51'));}if(_0x531d8f['filename']){return _0x25e136[_0x982b('0x53')](_0x531d8f['value'],_0x531d8f['filename']+path[_0x982b('0x54')](_0x531d8f[_0x982b('0x4c')]),function(){if(_0x3af521){fs[_0x982b('0x55')](_0x531d8f[_0x982b('0x4c')]);}});}else{return _0x25e136['download'](_0x531d8f[_0x982b('0x4c')],function(_0x279385){if(_0x3af521){fs[_0x982b('0x55')](_0x531d8f[_0x982b('0x4c')]);}});}}})[_0x982b('0x44')](handleError(_0x25e136,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 37e46a9..d6fcf27 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 _0x2e3c=['uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x957b63,_0x73eef6){var _0x1e5224=function(_0x468295){while(--_0x468295){_0x957b63['push'](_0x957b63['shift']());}};_0x1e5224(++_0x73eef6);}(_0x2e3c,0x1b1));var _0xc2e3=function(_0x1db95d,_0x471a46){_0x1db95d=_0x1db95d-0x0;var _0x4993a3=_0x2e3c[_0x1db95d];return _0x4993a3;};'use strict';var _=require(_0xc2e3('0x0'));var util=require(_0xc2e3('0x1'));var logger=require(_0xc2e3('0x2'))(_0xc2e3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc2e3('0x4'));var fs=require('fs');var path=require(_0xc2e3('0x5'));var rimraf=require(_0xc2e3('0x6'));var config=require(_0xc2e3('0x7'));var attributes=require(_0xc2e3('0x8'));module['exports']=function(_0xfc283c,_0x11d75d){return _0xfc283c[_0xc2e3('0x9')](_0xc2e3('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xc2e3('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcfb6=['define','voice_recordings','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcfb6,0xe0));var _0x6cfb=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0xcfb6[_0x589f71];return _0x5763bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6cfb('0x0'))(_0x6cfb('0x1'));var moment=require(_0x6cfb('0x2'));var BPromise=require(_0x6cfb('0x3'));var rp=require(_0x6cfb('0x4'));var fs=require('fs');var path=require(_0x6cfb('0x5'));var rimraf=require(_0x6cfb('0x6'));var config=require(_0x6cfb('0x7'));var attributes=require(_0x6cfb('0x8'));module[_0x6cfb('0x9')]=function(_0x27319d,_0x26978d){return _0x27319d[_0x6cfb('0xa')]('VoiceRecording',attributes,{'tableName':_0x6cfb('0xb'),'paranoid':![],'indexes':[{'name':_0x6cfb('0xc'),'fields':[_0x6cfb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 12ece2f..4c51be2 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 _0x9c02=['format','%s.cypher','encryptFile','secrets','recording','unlink','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','UpdateVoiceRecording','body','options','raw','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','VoiceRecording','value'];(function(_0x576faa,_0x40825d){var _0x455ed3=function(_0x50adbd){while(--_0x50adbd){_0x576faa['push'](_0x576faa['shift']());}};_0x455ed3(++_0x40825d);}(_0x9c02,0xfc));var _0x29c0=function(_0x1a5815,_0x355213){_0x1a5815=_0x1a5815-0x0;var _0x2b7bdf=_0x9c02[_0x1a5815];return _0x2b7bdf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x29c0('0x0'));var BPromise=require(_0x29c0('0x1'));var rs=require(_0x29c0('0x2'));var fs=require('fs');var Redis=require(_0x29c0('0x3'));var db=require(_0x29c0('0x4'))['db'];var utils=require(_0x29c0('0x5'));var logger=require(_0x29c0('0x6'))(_0x29c0('0x7'));var config=require(_0x29c0('0x8'));var jayson=require(_0x29c0('0x9'));var client=jayson[_0x29c0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x358027,_0x106741,_0x992849){return new BPromise(function(_0x731bc7,_0x235c7d){return client[_0x29c0('0xb')](_0x358027,_0x992849)[_0x29c0('0xc')](function(_0x27a7d4){logger[_0x29c0('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x106741,'request\x20sent');logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x106741,_0x29c0('0xe'),JSON[_0x29c0('0xf')](_0x27a7d4));if(_0x27a7d4['error']){if(_0x27a7d4[_0x29c0('0x10')][_0x29c0('0x11')]===0x1f4){logger['error'](_0x29c0('0x12'),_0x106741,_0x27a7d4[_0x29c0('0x10')][_0x29c0('0x13')]);return _0x235c7d(_0x27a7d4[_0x29c0('0x10')][_0x29c0('0x13')]);}logger['error'](_0x29c0('0x12'),_0x106741,_0x27a7d4[_0x29c0('0x10')][_0x29c0('0x13')]);return _0x731bc7(_0x27a7d4[_0x29c0('0x10')][_0x29c0('0x13')]);}else{logger[_0x29c0('0xd')](_0x29c0('0x12'),_0x106741,_0x29c0('0xe'));_0x731bc7(_0x27a7d4[_0x29c0('0x14')][_0x29c0('0x13')]);}})['catch'](function(_0x2c9aec){logger[_0x29c0('0x10')](_0x29c0('0x12'),_0x106741,_0x2c9aec);_0x235c7d(_0x2c9aec);});});}exports[_0x29c0('0x15')]=function(_0x524ba6){var _0x16a642=this;return new Promise(function(_0x51cc7e,_0x341778){return db['VoiceRecording']['update'](_0x524ba6[_0x29c0('0x16')],{'raw':_0x524ba6[_0x29c0('0x17')]?_0x524ba6[_0x29c0('0x17')][_0x29c0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524ba6[_0x29c0('0x17')]?_0x524ba6['options'][_0x29c0('0x19')]||null:null,'attributes':_0x524ba6[_0x29c0('0x17')]?_0x524ba6[_0x29c0('0x17')][_0x29c0('0x1a')]||null:null,'limit':_0x524ba6[_0x29c0('0x17')]?_0x524ba6[_0x29c0('0x17')][_0x29c0('0x1b')]||null:null})[_0x29c0('0xc')](function(_0x3f093f){logger[_0x29c0('0xd')](_0x29c0('0x15'),_0x524ba6);logger[_0x29c0('0x1c')](_0x29c0('0x15'),_0x524ba6,JSON[_0x29c0('0xf')](_0x3f093f));_0x51cc7e(_0x3f093f);})['catch'](function(_0x3469d7){logger[_0x29c0('0x10')]('UpdateVoiceRecording',_0x3469d7[_0x29c0('0x13')],_0x524ba6);_0x341778(_0x16a642['error'](0x1f4,_0x3469d7[_0x29c0('0x13')]));});});};exports[_0x29c0('0x1d')]=function(_0xea7120){var _0x13788e=this;return new Promise(function(_0x19c7f8,_0x78c9ad){var _0x5527bb=require(_0x29c0('0x1e'));var _0x242a31;return db[_0x29c0('0x1f')]['findOne']({'attributes':['id',_0x29c0('0x20')],'where':{'id':0x1},'raw':!![]})[_0x29c0('0xc')](function(_0x4d8399){_0x242a31=_0x4d8399;return db[_0x29c0('0x21')]['create'](_0xea7120[_0x29c0('0x16')]);})[_0x29c0('0xc')](function(_0x2a0c4c){if(_0x242a31[_0x29c0('0x20')]&&fs['existsSync'](_0x2a0c4c[_0x29c0('0x22')])){var _0x398d2e=util[_0x29c0('0x23')](_0x29c0('0x24'),_0x2a0c4c[_0x29c0('0x22')]);return _0x5527bb[_0x29c0('0x25')](_0x2a0c4c[_0x29c0('0x22')],_0x398d2e,config[_0x29c0('0x26')][_0x29c0('0x27')])[_0x29c0('0xc')](function(){fs[_0x29c0('0x28')](_0x2a0c4c['value']);logger[_0x29c0('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2a0c4c;});}return _0x2a0c4c;})[_0x29c0('0xc')](function(_0x4dc670){logger[_0x29c0('0xd')]('CreateVoiceRecording',_0xea7120);logger[_0x29c0('0x1c')](_0x29c0('0x1d'),_0xea7120,JSON[_0x29c0('0xf')](_0x4dc670));_0x19c7f8(_0x4dc670);})['catch'](function(_0xd095f6){logger[_0x29c0('0x10')](_0x29c0('0x1d'),_0xd095f6[_0x29c0('0x13')],_0xea7120);_0x78c9ad(_0x13788e[_0x29c0('0x10')](0x1f4,_0xd095f6[_0x29c0('0x13')]));});});}; \ No newline at end of file +var _0xc95a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceRecording','options','raw','attributes','limit','UpdateVoiceRecording','debug','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','util','moment','ioredis','../../mysqldb'];(function(_0x24288b,_0x17b7d3){var _0x56ba2d=function(_0x57b486){while(--_0x57b486){_0x24288b['push'](_0x24288b['shift']());}};_0x56ba2d(++_0x17b7d3);}(_0xc95a,0xa0));var _0xac95=function(_0x39065e,_0x17a1d2){_0x39065e=_0x39065e-0x0;var _0x456b5a=_0xc95a[_0x39065e];return _0x456b5a;};'use strict';var _=require('lodash');var util=require(_0xac95('0x0'));var moment=require(_0xac95('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac95('0x2'));var db=require(_0xac95('0x3'))['db'];var utils=require(_0xac95('0x4'));var logger=require(_0xac95('0x5'))(_0xac95('0x6'));var config=require(_0xac95('0x7'));var jayson=require(_0xac95('0x8'));var client=jayson[_0xac95('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa201,_0x3fffb1,_0x475c0f){return new BPromise(function(_0x45a5ce,_0x4b013c){return client[_0xac95('0xa')](_0x4aa201,_0x475c0f)[_0xac95('0xb')](function(_0x55ed7c){logger[_0xac95('0xc')](_0xac95('0xd'),_0x3fffb1,_0xac95('0xe'));logger['debug'](_0xac95('0xf'),_0x3fffb1,_0xac95('0xe'),JSON[_0xac95('0x10')](_0x55ed7c));if(_0x55ed7c[_0xac95('0x11')]){if(_0x55ed7c[_0xac95('0x11')]['code']===0x1f4){logger[_0xac95('0x11')](_0xac95('0xd'),_0x3fffb1,_0x55ed7c['error']['message']);return _0x4b013c(_0x55ed7c[_0xac95('0x11')]['message']);}logger[_0xac95('0x11')](_0xac95('0xd'),_0x3fffb1,_0x55ed7c[_0xac95('0x11')][_0xac95('0x12')]);return _0x45a5ce(_0x55ed7c[_0xac95('0x11')][_0xac95('0x12')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x3fffb1,_0xac95('0xe'));_0x45a5ce(_0x55ed7c[_0xac95('0x13')][_0xac95('0x12')]);}})[_0xac95('0x14')](function(_0x3cece7){logger[_0xac95('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x3fffb1,_0x3cece7);_0x4b013c(_0x3cece7);});});}exports['UpdateVoiceRecording']=function(_0x4f0550){var _0x4be49c=this;return new Promise(function(_0xa693c5,_0x437ee5){return db[_0xac95('0x15')]['update'](_0x4f0550['body'],{'raw':_0x4f0550[_0xac95('0x16')]?_0x4f0550[_0xac95('0x16')][_0xac95('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f0550[_0xac95('0x16')]?_0x4f0550['options']['where']||null:null,'attributes':_0x4f0550['options']?_0x4f0550[_0xac95('0x16')][_0xac95('0x18')]||null:null,'limit':_0x4f0550['options']?_0x4f0550['options'][_0xac95('0x19')]||null:null})[_0xac95('0xb')](function(_0x36c62){logger[_0xac95('0xc')](_0xac95('0x1a'),_0x4f0550);logger[_0xac95('0x1b')](_0xac95('0x1a'),_0x4f0550,JSON['stringify'](_0x36c62));_0xa693c5(_0x36c62);})[_0xac95('0x14')](function(_0xf337e2){logger['error'](_0xac95('0x1a'),_0xf337e2['message'],_0x4f0550);_0x437ee5(_0x4be49c[_0xac95('0x11')](0x1f4,_0xf337e2[_0xac95('0x12')]));});});};exports[_0xac95('0x1c')]=function(_0x108bc){var _0x6c9278=this;return new Promise(function(_0x1870b4,_0x198a2b){var _0x502ed9=require(_0xac95('0x1d'));var _0x14537a;return db['Setting'][_0xac95('0x1e')]({'attributes':['id',_0xac95('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3de792){_0x14537a=_0x3de792;return db['VoiceRecording'][_0xac95('0x20')](_0x108bc['body']);})[_0xac95('0xb')](function(_0x412729){if(_0x14537a[_0xac95('0x1f')]&&fs[_0xac95('0x21')](_0x412729[_0xac95('0x22')])){var _0x3c2727=util[_0xac95('0x23')](_0xac95('0x24'),_0x412729['value']);return _0x502ed9[_0xac95('0x25')](_0x412729[_0xac95('0x22')],_0x3c2727,config[_0xac95('0x26')][_0xac95('0x27')])[_0xac95('0xb')](function(){fs['unlink'](_0x412729[_0xac95('0x22')]);logger[_0xac95('0xc')](_0xac95('0x28'));return _0x412729;});}return _0x412729;})[_0xac95('0xb')](function(_0x447dcd){logger[_0xac95('0xc')](_0xac95('0x1c'),_0x108bc);logger[_0xac95('0x1b')](_0xac95('0x1c'),_0x108bc,JSON['stringify'](_0x447dcd));_0x1870b4(_0x447dcd);})['catch'](function(_0x2ee39e){logger['error'](_0xac95('0x1c'),_0x2ee39e[_0xac95('0x12')],_0x108bc);_0x198a2b(_0x6c9278[_0xac95('0x11')](0x1f4,_0x2ee39e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 25e04c7..6f9c45b 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 _0xbe26=['isAuthenticated','update','delete','multer','util','path','express','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/:id','post','put'];(function(_0x5577c3,_0x468b33){var _0x33ea26=function(_0x55e2b0){while(--_0x55e2b0){_0x5577c3['push'](_0x5577c3['shift']());}};_0x33ea26(++_0x468b33);}(_0xbe26,0x6c));var _0x6be2=function(_0x57b446,_0x20702a){_0x57b446=_0x57b446-0x0;var _0x220dc0=_0xbe26[_0x57b446];return _0x220dc0;};'use strict';var multer=require(_0x6be2('0x0'));var util=require(_0x6be2('0x1'));var path=require(_0x6be2('0x2'));var timeout=require('connect-timeout');var express=require(_0x6be2('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6be2('0x4'));var config=require(_0x6be2('0x5'));var controller=require(_0x6be2('0x6'));router[_0x6be2('0x7')]('/',auth['isAuthenticated'](),controller[_0x6be2('0x8')]);router[_0x6be2('0x7')](_0x6be2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6be2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6be2('0xb')](_0x6be2('0x9'),auth[_0x6be2('0xc')](),controller[_0x6be2('0xd')]);router[_0x6be2('0xe')](_0x6be2('0x9'),auth[_0x6be2('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x72e8=['/:id','post','create','put','update','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x1069c6,_0x43ac3b){var _0x515a13=function(_0x103424){while(--_0x103424){_0x1069c6['push'](_0x1069c6['shift']());}};_0x515a13(++_0x43ac3b);}(_0x72e8,0x106));var _0x872e=function(_0x14fa3f,_0x51dd5b){_0x14fa3f=_0x14fa3f-0x0;var _0x3dedfd=_0x72e8[_0x14fa3f];return _0x3dedfd;};'use strict';var multer=require('multer');var util=require(_0x872e('0x0'));var path=require(_0x872e('0x1'));var timeout=require('connect-timeout');var express=require(_0x872e('0x2'));var router=express[_0x872e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x872e('0x4'));var config=require(_0x872e('0x5'));var controller=require(_0x872e('0x6'));router[_0x872e('0x7')]('/',auth[_0x872e('0x8')](),controller[_0x872e('0x9')]);router[_0x872e('0x7')](_0x872e('0xa'),auth[_0x872e('0x8')](),controller['show']);router[_0x872e('0xb')]('/',auth[_0x872e('0x8')](),controller[_0x872e('0xc')]);router[_0x872e('0xd')](_0x872e('0xa'),auth[_0x872e('0x8')](),controller[_0x872e('0xe')]);router['delete'](_0x872e('0xa'),auth['isAuthenticated'](),controller[_0x872e('0xf')]);module[_0x872e('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 332c46b..20434c3 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 _0x3c0e=['moment','exports','ENUM','blind','attended','STRING','sequelize'];(function(_0x5904b2,_0x17ea32){var _0x73d42c=function(_0xc4b6c8){while(--_0xc4b6c8){_0x5904b2['push'](_0x5904b2['shift']());}};_0x73d42c(++_0x17ea32);}(_0x3c0e,0x102));var _0xe3c0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3c0e[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xe3c0('0x0'));var moment=require(_0xe3c0('0x1'));module[_0xe3c0('0x2')]={'type':{'type':Sequelize[_0xe3c0('0x3')](_0xe3c0('0x4'),_0xe3c0('0x5'))},'result':{'type':Sequelize[_0xe3c0('0x6')]},'transfererchannel':{'type':Sequelize[_0xe3c0('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xe3c0('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xe3c0('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xe3c0('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xe3c0('0x6')]},'transferercontext':{'type':Sequelize[_0xe3c0('0x6')]},'transfererexten':{'type':Sequelize[_0xe3c0('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xe3c0('0x6')]},'transfereechannel':{'type':Sequelize[_0xe3c0('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xe3c0('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe3c0('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe3c0('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xe3c0('0x6')]},'transfereeexten':{'type':Sequelize[_0xe3c0('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xe3c0('0x6')]},'isexternal':{'type':Sequelize[_0xe3c0('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xe3c0('0x6')]},'extension':{'type':Sequelize[_0xe3c0('0x6')]}}; \ No newline at end of file +var _0x8f5f=['STRING','Yes','moment','ENUM','blind','attended'];(function(_0x3214e1,_0x22db68){var _0x22c7d4=function(_0x5cc58d){while(--_0x5cc58d){_0x3214e1['push'](_0x3214e1['shift']());}};_0x22c7d4(++_0x22db68);}(_0x8f5f,0x1b2));var _0xf8f5=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x8f5f[_0x40df5f];return _0x1573f1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf8f5('0x0'));module['exports']={'type':{'type':Sequelize[_0xf8f5('0x1')](_0xf8f5('0x2'),_0xf8f5('0x3'))},'result':{'type':Sequelize[_0xf8f5('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xf8f5('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf8f5('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xf8f5('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xf8f5('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xf8f5('0x4')]},'transfereechannel':{'type':Sequelize[_0xf8f5('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xf8f5('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xf8f5('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf8f5('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xf8f5('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xf8f5('0x4')]},'transfereeexten':{'type':Sequelize[_0xf8f5('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xf8f5('0x4')]},'isexternal':{'type':Sequelize[_0xf8f5('0x1')](_0xf8f5('0x5'),'No')},'context':{'type':Sequelize[_0xf8f5('0x4')]},'extension':{'type':Sequelize[_0xf8f5('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index a72181a..fff0df4 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 _0x8579=['catch','show','params','fields','includeAll','include','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','VoiceTransferReport','findAll','rows'];(function(_0x245bc4,_0x5889a0){var _0x4612d7=function(_0x584e3b){while(--_0x584e3b){_0x245bc4['push'](_0x245bc4['shift']());}};_0x4612d7(++_0x5889a0);}(_0x8579,0x16c));var _0x9857=function(_0x2f504a,_0x5293c9){_0x2f504a=_0x2f504a-0x0;var _0x1908df=_0x8579[_0x2f504a];return _0x1908df;};'use strict';var pdf=require(_0x9857('0x0'));var emlformat=require(_0x9857('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9857('0x2'));var jsonpatch=require(_0x9857('0x3'));var rp=require(_0x9857('0x4'));var moment=require(_0x9857('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9857('0x6'));var csv=require(_0x9857('0x7'));var ejs=require(_0x9857('0x8'));var fs=require('fs');var _=require(_0x9857('0x9'));var squel=require(_0x9857('0xa'));var crypto=require(_0x9857('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9857('0xc'));var toCsv=require(_0x9857('0x7'));var querystring=require(_0x9857('0xd'));var Papa=require(_0x9857('0xe'));var Redis=require(_0x9857('0xf'));var authService=require(_0x9857('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9857('0x11'));var utils=require(_0x9857('0x12'));var config=require(_0x9857('0x13'));var db=require(_0x9857('0x14'))['db'];function respondWithStatusCode(_0x42b7ec,_0x3814af){_0x3814af=_0x3814af||0xcc;return function(_0x19473e){if(_0x19473e){return _0x42b7ec[_0x9857('0x15')](_0x3814af);}return _0x42b7ec[_0x9857('0x16')](_0x3814af)[_0x9857('0x17')]();};}function respondWithResult(_0x1c7e4e,_0x3bf71a){_0x3bf71a=_0x3bf71a||0xc8;return function(_0xaf5d4){if(_0xaf5d4){return _0x1c7e4e[_0x9857('0x16')](_0x3bf71a)[_0x9857('0x18')](_0xaf5d4);}};}function respondWithFilteredResult(_0x334105,_0x211cf2){return function(_0x3c0ec3){if(_0x3c0ec3){var _0x385714=_0x3c0ec3[_0x9857('0x19')],_0x79f0a4=_0x211cf2[_0x9857('0x1a')],_0x5b2cf9=_0x211cf2[_0x9857('0x1a')]+_0x211cf2[_0x9857('0x1b')],_0x3e0d3b;if(_0x5b2cf9>=_0x385714){_0x5b2cf9=_0x385714;_0x3e0d3b=0xc8;}else{_0x3e0d3b=0xce;}_0x334105[_0x9857('0x16')](_0x3e0d3b);return _0x334105['set']('Content-Range',_0x79f0a4+'-'+_0x5b2cf9+'/'+_0x385714)['json'](_0x3c0ec3);}return null;};}function patchUpdates(_0x4d3a21){return function(_0x37360c){try{jsonpatch[_0x9857('0x1c')](_0x37360c,_0x4d3a21,!![]);}catch(_0x1f7dd4){return BPromise[_0x9857('0x1d')](_0x1f7dd4);}return _0x37360c[_0x9857('0x1e')]();};}function saveUpdates(_0x63b6d0,_0xb7c90e){return function(_0x196115){if(_0x196115){return _0x196115[_0x9857('0x1f')](_0x63b6d0)[_0x9857('0x20')](function(_0x5e0683){return _0x5e0683;});}return null;};}function removeEntity(_0x83ad63,_0x446ca0){return function(_0x9eb2b3){if(_0x9eb2b3){return _0x9eb2b3[_0x9857('0x21')]()[_0x9857('0x20')](function(){_0x83ad63[_0x9857('0x16')](0xcc)[_0x9857('0x17')]();});}};}function handleEntityNotFound(_0x3c4201,_0x1fe26d){return function(_0x48fe32){if(!_0x48fe32){_0x3c4201[_0x9857('0x15')](0x194);}return _0x48fe32;};}function handleError(_0x39450a,_0x6e76a8){_0x6e76a8=_0x6e76a8||0x1f4;return function(_0x2f8d3b){logger[_0x9857('0x22')](_0x2f8d3b[_0x9857('0x23')]);if(_0x2f8d3b['name']){delete _0x2f8d3b[_0x9857('0x24')];}_0x39450a[_0x9857('0x16')](_0x6e76a8)[_0x9857('0x25')](_0x2f8d3b);};}exports[_0x9857('0x26')]=function(_0x2a4135,_0x59e930){var _0x321c89={},_0x2f9e5d={},_0x233a25={'count':0x0,'rows':[]};var _0x3c0e3f=db['VoiceTransferReport'][_0x9857('0x27')];_0x2f9e5d[_0x9857('0x28')]=_[_0x9857('0x29')](_0x3c0e3f);_0x2f9e5d['query']=_[_0x9857('0x29')](_0x2a4135['query']);_0x2f9e5d[_0x9857('0x2a')]=_[_0x9857('0x2b')](_0x2f9e5d['model'],_0x2f9e5d[_0x9857('0x2c')]);_0x321c89[_0x9857('0x2d')]=_[_0x9857('0x2b')](_0x2f9e5d[_0x9857('0x28')],qs['fields'](_0x2a4135[_0x9857('0x2c')]['fields']));_0x321c89[_0x9857('0x2d')]=_0x321c89[_0x9857('0x2d')][_0x9857('0x2e')]?_0x321c89[_0x9857('0x2d')]:_0x2f9e5d[_0x9857('0x28')];if(!_0x2a4135[_0x9857('0x2c')][_0x9857('0x2f')](_0x9857('0x30'))){_0x321c89[_0x9857('0x1b')]=qs['limit'](_0x2a4135[_0x9857('0x2c')]['limit']);_0x321c89['offset']=qs[_0x9857('0x1a')](_0x2a4135[_0x9857('0x2c')]['offset']);}_0x321c89[_0x9857('0x31')]=qs[_0x9857('0x32')](_0x2a4135[_0x9857('0x2c')][_0x9857('0x32')]);_0x321c89[_0x9857('0x33')]=qs[_0x9857('0x2a')](_[_0x9857('0x34')](_0x2a4135[_0x9857('0x2c')],_0x2f9e5d['filters']));if(_0x2a4135['query'][_0x9857('0x35')]){_0x321c89['where']=_[_0x9857('0x36')](_0x321c89[_0x9857('0x33')],{'$or':_[_0x9857('0x37')](_0x3c0e3f,function(_0x4d2b4e){if(_0x4d2b4e[_0x9857('0x38')][_0x9857('0x39')]!==_0x9857('0x3a')){var _0x590a9a={};_0x590a9a[_0x4d2b4e['field']]={'$like':'%'+_0x2a4135[_0x9857('0x2c')]['filter']+'%'};return _0x590a9a;}})});}_0x321c89=_[_0x9857('0x36')]({},_0x321c89,_0x2a4135['options']);var _0xe41c64={'where':_0x321c89[_0x9857('0x33')]};return db['VoiceTransferReport']['count'](_0xe41c64)['then'](function(_0x2b107c){_0x233a25['count']=_0x2b107c;if(_0x2a4135[_0x9857('0x2c')]['includeAll']){_0x321c89['include']=[{'all':!![]}];}return db[_0x9857('0x3b')][_0x9857('0x3c')](_0x321c89);})[_0x9857('0x20')](function(_0x5689c3){_0x233a25[_0x9857('0x3d')]=_0x5689c3;return _0x233a25;})[_0x9857('0x20')](respondWithFilteredResult(_0x59e930,_0x321c89))[_0x9857('0x3e')](handleError(_0x59e930,null));};exports[_0x9857('0x3f')]=function(_0x456d80,_0x1f1097){var _0x20ecf7={'raw':!![],'where':{'id':_0x456d80[_0x9857('0x40')]['id']}},_0x374348={};_0x374348[_0x9857('0x28')]=_[_0x9857('0x29')](db[_0x9857('0x3b')][_0x9857('0x27')]);_0x374348[_0x9857('0x2c')]=_[_0x9857('0x29')](_0x456d80[_0x9857('0x2c')]);_0x374348[_0x9857('0x2a')]=_['intersection'](_0x374348[_0x9857('0x28')],_0x374348[_0x9857('0x2c')]);_0x20ecf7[_0x9857('0x2d')]=_[_0x9857('0x2b')](_0x374348[_0x9857('0x28')],qs['fields'](_0x456d80[_0x9857('0x2c')][_0x9857('0x41')]));_0x20ecf7[_0x9857('0x2d')]=_0x20ecf7['attributes'][_0x9857('0x2e')]?_0x20ecf7[_0x9857('0x2d')]:_0x374348[_0x9857('0x28')];if(_0x456d80[_0x9857('0x2c')][_0x9857('0x42')]){_0x20ecf7[_0x9857('0x43')]=[{'all':!![]}];}_0x20ecf7=_['merge']({},_0x20ecf7,_0x456d80['options']);return db[_0x9857('0x3b')]['find'](_0x20ecf7)['then'](handleEntityNotFound(_0x1f1097,null))[_0x9857('0x20')](respondWithResult(_0x1f1097,null))[_0x9857('0x3e')](handleError(_0x1f1097,null));};exports[_0x9857('0x44')]=function(_0x47be19,_0x2f930b){return db['VoiceTransferReport'][_0x9857('0x44')](_0x47be19['body'],{})[_0x9857('0x20')](respondWithResult(_0x2f930b,0xc9))[_0x9857('0x3e')](handleError(_0x2f930b,null));};exports[_0x9857('0x1f')]=function(_0x9f537c,_0x51c082){if(_0x9f537c[_0x9857('0x45')]['id']){delete _0x9f537c['body']['id'];}return db[_0x9857('0x3b')][_0x9857('0x46')]({'where':{'id':_0x9f537c['params']['id']}})['then'](handleEntityNotFound(_0x51c082,null))[_0x9857('0x20')](saveUpdates(_0x9f537c[_0x9857('0x45')],null))[_0x9857('0x20')](respondWithResult(_0x51c082,null))[_0x9857('0x3e')](handleError(_0x51c082,null));};exports['destroy']=function(_0x292a2d,_0x1d6424){return db[_0x9857('0x3b')][_0x9857('0x46')]({'where':{'id':_0x292a2d[_0x9857('0x40')]['id']}})[_0x9857('0x20')](handleEntityNotFound(_0x1d6424,null))[_0x9857('0x20')](removeEntity(_0x1d6424,null))[_0x9857('0x3e')](handleError(_0x1d6424,null));}; \ No newline at end of file +var _0xd8a5=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','VoiceTransferReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x42ea7d,_0x7dd28){var _0x5006eb=function(_0x45e16b){while(--_0x45e16b){_0x42ea7d['push'](_0x42ea7d['shift']());}};_0x5006eb(++_0x7dd28);}(_0xd8a5,0x160));var _0x5d8a=function(_0x36dd4e,_0x579fda){_0x36dd4e=_0x36dd4e-0x0;var _0x59f9f6=_0xd8a5[_0x36dd4e];return _0x59f9f6;};'use strict';var pdf=require(_0x5d8a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5d8a('0x1'));var zipdir=require(_0x5d8a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d8a('0x3'));var moment=require(_0x5d8a('0x4'));var BPromise=require(_0x5d8a('0x5'));var Mustache=require(_0x5d8a('0x6'));var util=require(_0x5d8a('0x7'));var path=require(_0x5d8a('0x8'));var sox=require(_0x5d8a('0x9'));var csv=require(_0x5d8a('0xa'));var ejs=require(_0x5d8a('0xb'));var fs=require('fs');var _=require(_0x5d8a('0xc'));var squel=require(_0x5d8a('0xd'));var crypto=require(_0x5d8a('0xe'));var jsforce=require(_0x5d8a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5d8a('0xa'));var querystring=require(_0x5d8a('0x10'));var Papa=require(_0x5d8a('0x11'));var Redis=require(_0x5d8a('0x12'));var authService=require(_0x5d8a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5d8a('0x14'));var logger=require(_0x5d8a('0x15'))(_0x5d8a('0x16'));var utils=require(_0x5d8a('0x17'));var config=require('../../config/environment');var db=require(_0x5d8a('0x18'))['db'];function respondWithStatusCode(_0x45ca6e,_0x5ca29c){_0x5ca29c=_0x5ca29c||0xcc;return function(_0x3b4578){if(_0x3b4578){return _0x45ca6e[_0x5d8a('0x19')](_0x5ca29c);}return _0x45ca6e[_0x5d8a('0x1a')](_0x5ca29c)[_0x5d8a('0x1b')]();};}function respondWithResult(_0x2b82c1,_0x4211c7){_0x4211c7=_0x4211c7||0xc8;return function(_0x3727d3){if(_0x3727d3){return _0x2b82c1[_0x5d8a('0x1a')](_0x4211c7)[_0x5d8a('0x1c')](_0x3727d3);}};}function respondWithFilteredResult(_0x33b2de,_0x94a2ba){return function(_0x81815e){if(_0x81815e){var _0x5dba52=_0x81815e['count'],_0x4d45e7=_0x94a2ba[_0x5d8a('0x1d')],_0x39a1b8=_0x94a2ba[_0x5d8a('0x1d')]+_0x94a2ba[_0x5d8a('0x1e')],_0x1567e0;if(_0x39a1b8>=_0x5dba52){_0x39a1b8=_0x5dba52;_0x1567e0=0xc8;}else{_0x1567e0=0xce;}_0x33b2de[_0x5d8a('0x1a')](_0x1567e0);return _0x33b2de['set'](_0x5d8a('0x1f'),_0x4d45e7+'-'+_0x39a1b8+'/'+_0x5dba52)['json'](_0x81815e);}return null;};}function patchUpdates(_0xc67710){return function(_0x380e52){try{jsonpatch[_0x5d8a('0x20')](_0x380e52,_0xc67710,!![]);}catch(_0x235257){return BPromise[_0x5d8a('0x21')](_0x235257);}return _0x380e52[_0x5d8a('0x22')]();};}function saveUpdates(_0x2004e4,_0x48fc2b){return function(_0x460e95){if(_0x460e95){return _0x460e95[_0x5d8a('0x23')](_0x2004e4)[_0x5d8a('0x24')](function(_0x3c2524){return _0x3c2524;});}return null;};}function removeEntity(_0x5f0066,_0x304eeb){return function(_0x3d9815){if(_0x3d9815){return _0x3d9815[_0x5d8a('0x25')]()['then'](function(){_0x5f0066[_0x5d8a('0x1a')](0xcc)[_0x5d8a('0x1b')]();});}};}function handleEntityNotFound(_0x186aa9,_0x1201c6){return function(_0x5d9f63){if(!_0x5d9f63){_0x186aa9[_0x5d8a('0x19')](0x194);}return _0x5d9f63;};}function handleError(_0x463519,_0x482532){_0x482532=_0x482532||0x1f4;return function(_0x93d735){logger['error'](_0x93d735[_0x5d8a('0x26')]);if(_0x93d735[_0x5d8a('0x27')]){delete _0x93d735[_0x5d8a('0x27')];}_0x463519['status'](_0x482532)[_0x5d8a('0x28')](_0x93d735);};}exports[_0x5d8a('0x29')]=function(_0x4cb5e2,_0x4b5f67){var _0x3a637f={},_0x189617={},_0x20fae2={'count':0x0,'rows':[]};var _0x50660e=db[_0x5d8a('0x2a')][_0x5d8a('0x2b')];_0x189617['model']=_[_0x5d8a('0x2c')](_0x50660e);_0x189617[_0x5d8a('0x2d')]=_[_0x5d8a('0x2c')](_0x4cb5e2[_0x5d8a('0x2d')]);_0x189617[_0x5d8a('0x2e')]=_['intersection'](_0x189617[_0x5d8a('0x2f')],_0x189617[_0x5d8a('0x2d')]);_0x3a637f[_0x5d8a('0x30')]=_[_0x5d8a('0x31')](_0x189617[_0x5d8a('0x2f')],qs[_0x5d8a('0x32')](_0x4cb5e2[_0x5d8a('0x2d')][_0x5d8a('0x32')]));_0x3a637f['attributes']=_0x3a637f[_0x5d8a('0x30')][_0x5d8a('0x33')]?_0x3a637f[_0x5d8a('0x30')]:_0x189617[_0x5d8a('0x2f')];if(!_0x4cb5e2[_0x5d8a('0x2d')][_0x5d8a('0x34')](_0x5d8a('0x35'))){_0x3a637f[_0x5d8a('0x1e')]=qs[_0x5d8a('0x1e')](_0x4cb5e2[_0x5d8a('0x2d')][_0x5d8a('0x1e')]);_0x3a637f[_0x5d8a('0x1d')]=qs['offset'](_0x4cb5e2[_0x5d8a('0x2d')][_0x5d8a('0x1d')]);}_0x3a637f[_0x5d8a('0x36')]=qs['sort'](_0x4cb5e2[_0x5d8a('0x2d')]['sort']);_0x3a637f[_0x5d8a('0x37')]=qs['filters'](_['pick'](_0x4cb5e2[_0x5d8a('0x2d')],_0x189617['filters']));if(_0x4cb5e2['query'][_0x5d8a('0x38')]){_0x3a637f[_0x5d8a('0x37')]=_[_0x5d8a('0x39')](_0x3a637f[_0x5d8a('0x37')],{'$or':_[_0x5d8a('0x3a')](_0x50660e,function(_0x2d9a48){if(_0x2d9a48[_0x5d8a('0x3b')][_0x5d8a('0x3c')]!==_0x5d8a('0x3d')){var _0x5cb9b4={};_0x5cb9b4[_0x2d9a48['field']]={'$like':'%'+_0x4cb5e2['query'][_0x5d8a('0x38')]+'%'};return _0x5cb9b4;}})});}_0x3a637f=_[_0x5d8a('0x39')]({},_0x3a637f,_0x4cb5e2[_0x5d8a('0x3e')]);var _0x199558={'where':_0x3a637f['where']};return db['VoiceTransferReport'][_0x5d8a('0x3f')](_0x199558)[_0x5d8a('0x24')](function(_0x88291f){_0x20fae2[_0x5d8a('0x3f')]=_0x88291f;if(_0x4cb5e2[_0x5d8a('0x2d')][_0x5d8a('0x40')]){_0x3a637f[_0x5d8a('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x3a637f);})['then'](function(_0x46ad3a){_0x20fae2[_0x5d8a('0x42')]=_0x46ad3a;return _0x20fae2;})[_0x5d8a('0x24')](respondWithFilteredResult(_0x4b5f67,_0x3a637f))[_0x5d8a('0x43')](handleError(_0x4b5f67,null));};exports[_0x5d8a('0x44')]=function(_0x1ac98c,_0x1d9e88){var _0x5287ba={'raw':!![],'where':{'id':_0x1ac98c[_0x5d8a('0x45')]['id']}},_0x35c729={};_0x35c729[_0x5d8a('0x2f')]=_['keys'](db[_0x5d8a('0x2a')][_0x5d8a('0x2b')]);_0x35c729[_0x5d8a('0x2d')]=_[_0x5d8a('0x2c')](_0x1ac98c['query']);_0x35c729['filters']=_[_0x5d8a('0x31')](_0x35c729[_0x5d8a('0x2f')],_0x35c729[_0x5d8a('0x2d')]);_0x5287ba['attributes']=_[_0x5d8a('0x31')](_0x35c729['model'],qs[_0x5d8a('0x32')](_0x1ac98c[_0x5d8a('0x2d')]['fields']));_0x5287ba['attributes']=_0x5287ba[_0x5d8a('0x30')][_0x5d8a('0x33')]?_0x5287ba[_0x5d8a('0x30')]:_0x35c729[_0x5d8a('0x2f')];if(_0x1ac98c[_0x5d8a('0x2d')][_0x5d8a('0x40')]){_0x5287ba[_0x5d8a('0x41')]=[{'all':!![]}];}_0x5287ba=_[_0x5d8a('0x39')]({},_0x5287ba,_0x1ac98c[_0x5d8a('0x3e')]);return db[_0x5d8a('0x2a')][_0x5d8a('0x46')](_0x5287ba)['then'](handleEntityNotFound(_0x1d9e88,null))[_0x5d8a('0x24')](respondWithResult(_0x1d9e88,null))[_0x5d8a('0x43')](handleError(_0x1d9e88,null));};exports[_0x5d8a('0x47')]=function(_0x860f25,_0x37690e){return db[_0x5d8a('0x2a')]['create'](_0x860f25['body'],{})[_0x5d8a('0x24')](respondWithResult(_0x37690e,0xc9))[_0x5d8a('0x43')](handleError(_0x37690e,null));};exports[_0x5d8a('0x23')]=function(_0x14db73,_0x35de3e){if(_0x14db73[_0x5d8a('0x48')]['id']){delete _0x14db73[_0x5d8a('0x48')]['id'];}return db[_0x5d8a('0x2a')]['find']({'where':{'id':_0x14db73[_0x5d8a('0x45')]['id']}})['then'](handleEntityNotFound(_0x35de3e,null))['then'](saveUpdates(_0x14db73[_0x5d8a('0x48')],null))['then'](respondWithResult(_0x35de3e,null))[_0x5d8a('0x43')](handleError(_0x35de3e,null));};exports[_0x5d8a('0x25')]=function(_0xcc48d9,_0x9c507b){return db['VoiceTransferReport']['find']({'where':{'id':_0xcc48d9[_0x5d8a('0x45')]['id']}})[_0x5d8a('0x24')](handleEntityNotFound(_0x9c507b,null))['then'](removeEntity(_0x9c507b,null))[_0x5d8a('0x43')](handleError(_0x9c507b,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 5ce4db8..39775d9 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 _0x489d=['VoiceTransferReport','report_call_transfer','lodash','util','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','define'];(function(_0x2d4d2c,_0x509d76){var _0x3bed29=function(_0x5ec535){while(--_0x5ec535){_0x2d4d2c['push'](_0x2d4d2c['shift']());}};_0x3bed29(++_0x509d76);}(_0x489d,0x65));var _0xd489=function(_0x1bf441,_0x49f64b){_0x1bf441=_0x1bf441-0x0;var _0x4d7eee=_0x489d[_0x1bf441];return _0x4d7eee;};'use strict';var _=require(_0xd489('0x0'));var util=require(_0xd489('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd489('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd489('0x3'));var config=require(_0xd489('0x4'));var attributes=require(_0xd489('0x5'));module['exports']=function(_0x5e4dd3,_0x565d19){return _0x5e4dd3[_0xd489('0x6')](_0xd489('0x7'),attributes,{'tableName':_0xd489('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0df0=['exports','define','VoiceTransferReport','lodash','util','api','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x3efe9b,_0x5b41a8){var _0x132073=function(_0x34459e){while(--_0x34459e){_0x3efe9b['push'](_0x3efe9b['shift']());}};_0x132073(++_0x5b41a8);}(_0x0df0,0x116));var _0x00df=function(_0x5ebf44,_0x4e543e){_0x5ebf44=_0x5ebf44-0x0;var _0x2fef12=_0x0df0[_0x5ebf44];return _0x2fef12;};'use strict';var _=require(_0x00df('0x0'));var util=require(_0x00df('0x1'));var logger=require('../../config/logger')(_0x00df('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x00df('0x3'));var fs=require('fs');var path=require(_0x00df('0x4'));var rimraf=require(_0x00df('0x5'));var config=require(_0x00df('0x6'));var attributes=require(_0x00df('0x7'));module[_0x00df('0x8')]=function(_0x3d5649,_0x224440){return _0x3d5649[_0x00df('0x9')](_0x00df('0xa'),attributes,{'tableName':'report_call_transfer','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 b2aaf0f..1c9bde7 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 _0xea2f=['jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceTransferReport','body','options','raw','catch','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4dfef2,_0x385a93){var _0x2acc66=function(_0x210365){while(--_0x210365){_0x4dfef2['push'](_0x4dfef2['shift']());}};_0x2acc66(++_0x385a93);}(_0xea2f,0x87));var _0xfea2=function(_0x404e13,_0x1de972){_0x404e13=_0x404e13-0x0;var _0x3c6ebf=_0xea2f[_0x404e13];return _0x3c6ebf;};'use strict';var _=require(_0xfea2('0x0'));var util=require(_0xfea2('0x1'));var moment=require(_0xfea2('0x2'));var BPromise=require(_0xfea2('0x3'));var rs=require(_0xfea2('0x4'));var fs=require('fs');var Redis=require(_0xfea2('0x5'));var db=require(_0xfea2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfea2('0x7'))(_0xfea2('0x8'));var config=require(_0xfea2('0x9'));var jayson=require(_0xfea2('0xa'));var client=jayson[_0xfea2('0xb')][_0xfea2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11decf,_0x1123e0,_0x4d3efd){return new BPromise(function(_0x197e51,_0xbbc82b){return client[_0xfea2('0xd')](_0x11decf,_0x4d3efd)[_0xfea2('0xe')](function(_0x226204){logger[_0xfea2('0xf')](_0xfea2('0x10'),_0x1123e0,_0xfea2('0x11'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1123e0,_0xfea2('0x11'),JSON[_0xfea2('0x12')](_0x226204));if(_0x226204[_0xfea2('0x13')]){if(_0x226204[_0xfea2('0x13')][_0xfea2('0x14')]===0x1f4){logger['error'](_0xfea2('0x10'),_0x1123e0,_0x226204[_0xfea2('0x13')][_0xfea2('0x15')]);return _0xbbc82b(_0x226204[_0xfea2('0x13')][_0xfea2('0x15')]);}logger['error'](_0xfea2('0x10'),_0x1123e0,_0x226204[_0xfea2('0x13')]['message']);return _0x197e51(_0x226204[_0xfea2('0x13')][_0xfea2('0x15')]);}else{logger[_0xfea2('0xf')](_0xfea2('0x10'),_0x1123e0,_0xfea2('0x11'));_0x197e51(_0x226204[_0xfea2('0x16')][_0xfea2('0x15')]);}})['catch'](function(_0x52599a){logger[_0xfea2('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x1123e0,_0x52599a);_0xbbc82b(_0x52599a);});});}exports['CreateVoiceTransferReport']=function(_0x440ee8){var _0x2e7989=this;return new Promise(function(_0x3b467e,_0xefe20e){return db[_0xfea2('0x17')]['create'](_0x440ee8[_0xfea2('0x18')],{'raw':_0x440ee8[_0xfea2('0x19')]?_0x440ee8[_0xfea2('0x19')][_0xfea2('0x1a')]===undefined?!![]:![]:!![]})[_0xfea2('0xe')](function(_0x10b1d1){logger[_0xfea2('0xf')]('CreateVoiceTransferReport',_0x440ee8);logger['debug']('CreateVoiceTransferReport',_0x440ee8,JSON[_0xfea2('0x12')](_0x10b1d1));_0x3b467e(_0x10b1d1);})[_0xfea2('0x1b')](function(_0x6784db){logger[_0xfea2('0x13')](_0xfea2('0x1c'),_0x6784db['message'],_0x440ee8);_0xefe20e(_0x2e7989[_0xfea2('0x13')](0x1f4,_0x6784db[_0xfea2('0x15')]));});});}; \ No newline at end of file +var _0xa8a8=['then','debug','CreateVoiceTransferReport','stringify','catch','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','create','options','raw'];(function(_0x30e4ec,_0x2e128c){var _0x11457a=function(_0x31a1bb){while(--_0x31a1bb){_0x30e4ec['push'](_0x30e4ec['shift']());}};_0x11457a(++_0x2e128c);}(_0xa8a8,0x155));var _0x8a8a=function(_0x32b0ba,_0xad6cc7){_0x32b0ba=_0x32b0ba-0x0;var _0x28376d=_0xa8a8[_0x32b0ba];return _0x28376d;};'use strict';var _=require('lodash');var util=require(_0x8a8a('0x0'));var moment=require(_0x8a8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a8a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a8a('0x3'));var logger=require(_0x8a8a('0x4'))(_0x8a8a('0x5'));var config=require('../../config/environment');var jayson=require(_0x8a8a('0x6'));var client=jayson[_0x8a8a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b65c8,_0x29c524,_0x2536a1){return new BPromise(function(_0x2438ea,_0x1f9cc4){return client[_0x8a8a('0x8')](_0x1b65c8,_0x2536a1)['then'](function(_0x3e1a4b){logger[_0x8a8a('0x9')](_0x8a8a('0xa'),_0x29c524,_0x8a8a('0xb'));logger['debug'](_0x8a8a('0xc'),_0x29c524,_0x8a8a('0xb'),JSON['stringify'](_0x3e1a4b));if(_0x3e1a4b['error']){if(_0x3e1a4b[_0x8a8a('0xd')]['code']===0x1f4){logger[_0x8a8a('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x29c524,_0x3e1a4b['error'][_0x8a8a('0xe')]);return _0x1f9cc4(_0x3e1a4b[_0x8a8a('0xd')]['message']);}logger[_0x8a8a('0xd')](_0x8a8a('0xa'),_0x29c524,_0x3e1a4b['error']['message']);return _0x2438ea(_0x3e1a4b[_0x8a8a('0xd')][_0x8a8a('0xe')]);}else{logger[_0x8a8a('0x9')](_0x8a8a('0xa'),_0x29c524,_0x8a8a('0xb'));_0x2438ea(_0x3e1a4b[_0x8a8a('0xf')][_0x8a8a('0xe')]);}})['catch'](function(_0x561437){logger[_0x8a8a('0xd')](_0x8a8a('0xa'),_0x29c524,_0x561437);_0x1f9cc4(_0x561437);});});}exports['CreateVoiceTransferReport']=function(_0x3775b6){var _0x4400c3=this;return new Promise(function(_0x58542d,_0x32d7f3){return db['VoiceTransferReport'][_0x8a8a('0x10')](_0x3775b6['body'],{'raw':_0x3775b6['options']?_0x3775b6[_0x8a8a('0x11')][_0x8a8a('0x12')]===undefined?!![]:![]:!![]})[_0x8a8a('0x13')](function(_0x4af41e){logger['info']('CreateVoiceTransferReport',_0x3775b6);logger[_0x8a8a('0x14')](_0x8a8a('0x15'),_0x3775b6,JSON[_0x8a8a('0x16')](_0x4af41e));_0x58542d(_0x4af41e);})[_0x8a8a('0x17')](function(_0x2f8187){logger['error'](_0x8a8a('0x15'),_0x2f8187[_0x8a8a('0xe')],_0x3775b6);_0x32d7f3(_0x4400c3['error'](0x1f4,_0x2f8187[_0x8a8a('0xe')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 76fb1a3..50443f9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7107=['default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','then','info','start','filter','online','name','join','Offline\x20apps:','map','None','seedDB','./config/seedDB','./config/license'];(function(_0x87598f,_0x342536){var _0x21b203=function(_0x26189c){while(--_0x26189c){_0x87598f['push'](_0x87598f['shift']());}};_0x21b203(++_0x342536);}(_0x7107,0x11d));var _0x7710=function(_0x4ab4e3,_0x54cc66){_0x4ab4e3=_0x4ab4e3-0x0;var _0x2843bd=_0x7107[_0x4ab4e3];return _0x2843bd;};'use strict';var _=require(_0x7710('0x0'));var mysqldb=require(_0x7710('0x1'));var rpc=require(_0x7710('0x2'));var config=require('./config/environment');var logger=require(_0x7710('0x3'))(_0x7710('0x4'));var pm2=require(_0x7710('0x5'));var pm2Config=require(_0x7710('0x6'));var schedule=require(_0x7710('0x7'));var chat=require(_0x7710('0x8'));function main(){return mysqldb['db'][_0x7710('0x9')]['sync']()[_0x7710('0xa')](function(){return rpc['listen']();})['then'](function(_0x4f3f29){logger[_0x7710('0xb')](_0x4f3f29);return chat[_0x7710('0xc')]();})['then'](function(){return schedule[_0x7710('0xc')]();})[_0x7710('0xa')](function(_0x4cc42d){logger[_0x7710('0xb')](_0x4cc42d);return pm2[_0x7710('0xc')](pm2Config);})[_0x7710('0xa')](function(_0x51ebaf){logger[_0x7710('0xb')]('Online\x20apps:',_['map'](_[_0x7710('0xd')](_0x51ebaf,{'status':_0x7710('0xe')}),_0x7710('0xf'))[_0x7710('0x10')]());logger['info'](_0x7710('0x11'),_[_0x7710('0x12')](_[_0x7710('0xd')](_0x51ebaf,function(_0x1d4be3){return _0x1d4be3['status']!==_0x7710('0xe');}),_0x7710('0xf'))[_0x7710('0x10')]()||_0x7710('0x13'));config[_0x7710('0x14')]&&require(_0x7710('0x15'))['default']();require(_0x7710('0x16'))[_0x7710('0x17')]();})[_0x7710('0x18')](function(_0xd02c0c){logger[_0x7710('0x19')](_0x7710('0x1a'),_0xd02c0c);process[_0x7710('0x1b')](0x1);});}main(); \ No newline at end of file +var _0x03e7=['error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','listen','then','info','start','Online\x20apps:','map','Offline\x20apps:','filter','status','online','name','join','None','seedDB','./config/seedDB','default','catch'];(function(_0x3dc562,_0x7c35bd){var _0x1b72b0=function(_0x2d9118){while(--_0x2d9118){_0x3dc562['push'](_0x3dc562['shift']());}};_0x1b72b0(++_0x7c35bd);}(_0x03e7,0x1d2));var _0x703e=function(_0x384455,_0x5cdb5b){_0x384455=_0x384455-0x0;var _0x147a16=_0x03e7[_0x384455];return _0x147a16;};'use strict';var _=require(_0x703e('0x0'));var mysqldb=require(_0x703e('0x1'));var rpc=require(_0x703e('0x2'));var config=require(_0x703e('0x3'));var logger=require(_0x703e('0x4'))(_0x703e('0x5'));var pm2=require(_0x703e('0x6'));var pm2Config=require(_0x703e('0x7'));var schedule=require(_0x703e('0x8'));var chat=require(_0x703e('0x9'));function main(){return mysqldb['db']['sequelize']['sync']()['then'](function(){return rpc[_0x703e('0xa')]();})[_0x703e('0xb')](function(_0x22198b){logger[_0x703e('0xc')](_0x22198b);return chat[_0x703e('0xd')]();})[_0x703e('0xb')](function(){return schedule[_0x703e('0xd')]();})[_0x703e('0xb')](function(_0x1158d3){logger[_0x703e('0xc')](_0x1158d3);return pm2['start'](pm2Config);})[_0x703e('0xb')](function(_0x4fb09e){logger[_0x703e('0xc')](_0x703e('0xe'),_[_0x703e('0xf')](_['filter'](_0x4fb09e,{'status':'online'}),'name')['join']());logger[_0x703e('0xc')](_0x703e('0x10'),_['map'](_[_0x703e('0x11')](_0x4fb09e,function(_0x25faa5){return _0x25faa5[_0x703e('0x12')]!==_0x703e('0x13');}),_0x703e('0x14'))[_0x703e('0x15')]()||_0x703e('0x16'));config[_0x703e('0x17')]&&require(_0x703e('0x18'))[_0x703e('0x19')]();require('./config/license')[_0x703e('0x19')]();})[_0x703e('0x1a')](function(_0x28dece){logger[_0x703e('0x1b')](_0x703e('0x1c'),_0x28dece);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 6bd5403..5c97553 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 _0xec91=['role','fullname','name','internal','email','permissions','voicePause','faxPause','smsPause','openchannelPause','phoneBarRemoteControlPort','phoneBarRemoteControl','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','then','status','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','find','authenticate','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','verify','getUuid','User','sub','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','cookie','motion.user','stringify','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','toString','hex','now','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','ipaddr.js','secrets','session'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0xec91,0x1ad));var _0x1ec9=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xec91[_0x40be86];return _0xda3c3b;};'use strict';var db=require(_0x1ec9('0x0'))['db'];var config=require(_0x1ec9('0x1'));var hardwareConf=require(_0x1ec9('0x2'));var _=require(_0x1ec9('0x3'));var jwt=require(_0x1ec9('0x4'));var expressJwt=require(_0x1ec9('0x5'));var compose=require(_0x1ec9('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x1ec9('0x7'));var ipaddr=require(_0x1ec9('0x8'));var validateJwt=expressJwt({'secret':config[_0x1ec9('0x9')][_0x1ec9('0xa')]});var userAttributes=['id',_0x1ec9('0xb'),_0x1ec9('0xc'),_0x1ec9('0xd'),_0x1ec9('0xe'),_0x1ec9('0xf'),'userpic',_0x1ec9('0x10'),_0x1ec9('0x11'),'chatPause','mailPause',_0x1ec9('0x12'),_0x1ec9('0x13'),_0x1ec9('0x14'),'pauseType','showWebBar',_0x1ec9('0x15'),_0x1ec9('0x16'),'interface',_0x1ec9('0x17')];exports[_0x1ec9('0x18')]=function(){return isAuthenticated(!![])[_0x1ec9('0x19')](function(_0x419f40,_0x276500,_0x4459c7){if(_0x419f40[_0x1ec9('0x1a')]){_0x4459c7();}else{return db[_0x1ec9('0x1b')][_0x1ec9('0x1c')]({'where':{'id':_0x419f40[_0x1ec9('0x1d')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x1ec9('0x1e')](function(_0x5570d){if(_0x5570d&&_0x5570d['closed']){return _0x276500[_0x1ec9('0x1f')](_0x5570d[_0x1ec9('0x20')]===_0x1ec9('0x21')?0x195:0x193)['json']({'message':_0x5570d[_0x1ec9('0x20')]===_0x1ec9('0x21')?_0x1ec9('0x22'):_0x1ec9('0x23')});}else{_0x4459c7();}})[_0x1ec9('0x24')](function(_0x5c2479){_0x4459c7(_0x5c2479);});}});};function isAuthenticated(_0x5f7c5f){return compose()['use'](function(_0x443b8c,_0x1e8817,_0x3ef8cf){if(_0x443b8c[_0x1ec9('0x25')][_0x1ec9('0x26')]){if(_[_0x1ec9('0x27')](_0x443b8c[_0x1ec9('0x25')][_0x1ec9('0x26')],'Basic')){var _0x5bf85f=basicAuth(_0x443b8c);db['User'][_0x1ec9('0x28')]({'where':{'name':_0x5bf85f[_0x1ec9('0xd')]}})[_0x1ec9('0x1e')](function(_0x8411f8){if(!_0x8411f8||!_0x8411f8[_0x1ec9('0x29')](_0x5bf85f['pass'])){return _0x1e8817[_0x1ec9('0x1f')](0x191)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x2b')});}_0x443b8c[_0x1ec9('0x1a')]={'id':_0x8411f8['id']};_0x3ef8cf();})[_0x1ec9('0x24')](function(_0x33d6c4){_0x3ef8cf(_0x33d6c4);});}else if(_[_0x1ec9('0x27')](_0x443b8c[_0x1ec9('0x25')][_0x1ec9('0x26')],'Bearer')){validateJwt(_0x443b8c,_0x1e8817,_0x3ef8cf);}else{if(_0x5f7c5f){_0x3ef8cf();}else{return _0x1e8817[_0x1ec9('0x1f')](0x193)['json']({'message':_0x1ec9('0x2c')});}}}else if(_0x443b8c[_0x1ec9('0x2d')][_0x1ec9('0x2e')]){try{var _0x12e3d5=jwt[_0x1ec9('0x2f')](_0x443b8c['query']['apikey'],config[_0x1ec9('0x9')][_0x1ec9('0xa')],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x1ec9('0x30')]()});db[_0x1ec9('0x31')][_0x1ec9('0x28')]({'where':{'id':_0x12e3d5[_0x1ec9('0x32')]}})[_0x1ec9('0x1e')](function(_0x40e19a){if(!_0x40e19a||!_['isEqual'](_0x40e19a[_0x1ec9('0x33')],_0x12e3d5['nonce'])){return _0x1e8817[_0x1ec9('0x1f')](0x193)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x34')});}_0x443b8c[_0x1ec9('0x1a')]={'id':_0x40e19a['id']};_0x3ef8cf();})[_0x1ec9('0x24')](function(_0x93252a){_0x3ef8cf(_0x93252a);});}catch(_0x382a0f){console[_0x1ec9('0x35')](_0x382a0f);return _0x1e8817[_0x1ec9('0x1f')](0x193)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x36')});}}else if(_0x5f7c5f){_0x3ef8cf();}else{return _0x1e8817[_0x1ec9('0x1f')](0x193)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x2c')});}})['use'](function(_0x1ae46c,_0x3b1326,_0x45ad96){if(_0x1ae46c['user']){db[_0x1ec9('0x31')][_0x1ec9('0x28')]({'where':{'id':_0x1ae46c[_0x1ec9('0x1a')]['id']},'attributes':userAttributes})['then'](function(_0x512a9d){if(!_0x512a9d){return _0x3b1326[_0x1ec9('0x1f')](0x194)['json']({'message':_0x1ec9('0x37')});}_0x1ae46c[_0x1ec9('0x1a')]=_0x512a9d;_0x45ad96();})[_0x1ec9('0x24')](function(_0x548e5b){_0x45ad96(_0x548e5b);});}else if(_0x5f7c5f){_0x45ad96();}else{return _0x3b1326[_0x1ec9('0x1f')](0x194)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x38')});}});}exports[_0x1ec9('0x39')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x31d844,_0x2405bd,_0x4da4b7){return require(_0x1ec9('0x3a'))[_0x1ec9('0x3b')]()['then'](function(_0x45f73a){if(_0x45f73a[_0x1ec9('0x3c')]){_0x4da4b7();}else{return _0x2405bd[_0x1ec9('0x1f')](0x193)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x3d')});}})[_0x1ec9('0x24')](function(_0x313c45){_0x4da4b7(_0x313c45);});});}exports[_0x1ec9('0x3e')]=canUpdate;function signToken(_0x3c0132,_0x1884d8){return jwt[_0x1ec9('0x3f')]({'id':_0x3c0132,'role':_0x1884d8},config[_0x1ec9('0x9')][_0x1ec9('0xa')],{'expiresIn':0x15180});}exports[_0x1ec9('0x40')]=signToken;exports[_0x1ec9('0x41')]=function(_0x118752){if(!_0x118752){throw new Error(_0x1ec9('0x42'));}return compose()['use'](isAuthenticated())[_0x1ec9('0x19')](function meetsRequirements(_0x17b978,_0x64de89,_0x2f50f6){if(config[_0x1ec9('0x43')]['indexOf'](_0x17b978[_0x1ec9('0x1a')]['role'])>=config[_0x1ec9('0x43')][_0x1ec9('0x44')](_0x118752)){return _0x2f50f6();}else{return _0x64de89['status'](0x193)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x3d')});}});};exports[_0x1ec9('0x45')]=function(_0x5b2dd4,_0x53c95b,_0x240483){_0x5b2dd4[_0x1ec9('0x45')]=!![];return _0x240483();};exports[_0x1ec9('0x46')]=function(_0x507250,_0x2d78db){if(!_0x507250[_0x1ec9('0x1a')]){return _0x2d78db[_0x1ec9('0x1f')](0x194)[_0x1ec9('0x2a')]({'message':_0x1ec9('0x47')});}var _0x5c6be6=signToken(_0x507250[_0x1ec9('0x1a')]['id'],_0x507250[_0x1ec9('0x1a')]['role']);_0x2d78db['cookie'](_0x1ec9('0x48'),_0x5c6be6);_0x2d78db[_0x1ec9('0x49')](_0x1ec9('0x4a'),JSON[_0x1ec9('0x4b')](_['pick'](_0x507250[_0x1ec9('0x1a')],userAttributes)));_0x2d78db[_0x1ec9('0x4c')](_0x1ec9('0x4d'));};exports[_0x1ec9('0x4e')]=function(_0x54bb2b){if(_['isNil'](_0x54bb2b[_0x1ec9('0x33')])||_[_0x1ec9('0x4f')](_0x54bb2b[_0x1ec9('0x50')]))return null;else return createJwt(_0x54bb2b);};exports[_0x1ec9('0x51')]=function(_0x31fe0a){_0x31fe0a[_0x1ec9('0x33')]=crypto['randomBytes'](0x10)[_0x1ec9('0x52')](_0x1ec9('0x53'));_0x31fe0a[_0x1ec9('0x50')]=Math['floor'](Date[_0x1ec9('0x54')]()/0x3e8)[_0x1ec9('0x52')]();return createJwt(_0x31fe0a);};exports[_0x1ec9('0x55')]=function(_0x2a7931,_0x416976){if(_0x2a7931['query'][_0x1ec9('0x2e')]){jwt[_0x1ec9('0x2f')](_0x2a7931[_0x1ec9('0x2d')][_0x1ec9('0x2e')],config[_0x1ec9('0x9')][_0x1ec9('0xa')],{'nonce':_0x416976['apiKeyNonce'],'iat':_0x416976[_0x1ec9('0x50')],'audience':hardwareConf[_0x1ec9('0x30')](),'issuer':hardwareConf[_0x1ec9('0x30')]()});return generateApiKey(_0x416976);}else{throw{'message':_0x1ec9('0x56')};}};function createJwt(_0x2c506b){return jwt[_0x1ec9('0x3f')]({'iat':_0x2c506b[_0x1ec9('0x50')],'nonce':_0x2c506b[_0x1ec9('0x33')]},config[_0x1ec9('0x9')][_0x1ec9('0xa')],{'algorithm':_0x1ec9('0x57'),'subject':_0x2c506b['id']['toString'](),'issuer':hardwareConf[_0x1ec9('0x30')](),'audience':hardwareConf[_0x1ec9('0x30')]()});} \ No newline at end of file +var _0xe832=['User\x20not\x20found.','update','Forbidden','sign','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','randomBytes','toString','apiKeyIat','floor','now','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../config/environment','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','role','fullname','internal','email','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','interface','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','catch','headers','authorization','startsWith','Basic','find','name','authenticate','Wrong\x20credentials.','Unknown\x20authorization\x20format','apikey','verify','query','session','getUuid','User','sub','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0xe832,0x1ae));var _0x2e83=function(_0x10433d,_0x364671){_0x10433d=_0x10433d-0x0;var _0x588889=_0xe832[_0x10433d];return _0x588889;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2e83('0x0'));var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0x2e83('0x1'));var expressJwt=require(_0x2e83('0x2'));var compose=require(_0x2e83('0x3'));var basicAuth=require(_0x2e83('0x4'));var crypto=require(_0x2e83('0x5'));var ipaddr=require(_0x2e83('0x6'));var validateJwt=expressJwt({'secret':config[_0x2e83('0x7')]['session']});var userAttributes=['id',_0x2e83('0x8'),_0x2e83('0x9'),'name',_0x2e83('0xa'),_0x2e83('0xb'),_0x2e83('0xc'),'permissions',_0x2e83('0xd'),_0x2e83('0xe'),_0x2e83('0xf'),_0x2e83('0x10'),_0x2e83('0x11'),_0x2e83('0x12'),_0x2e83('0x13'),_0x2e83('0x14'),_0x2e83('0x15'),'phoneBarRemoteControl',_0x2e83('0x16'),_0x2e83('0x17')];exports[_0x2e83('0x18')]=function(){return isAuthenticated(!![])[_0x2e83('0x19')](function(_0x5f5d94,_0xb4389d,_0xe926f5){if(_0x5f5d94[_0x2e83('0x1a')]){_0xe926f5();}else{return db[_0x2e83('0x1b')][_0x2e83('0x1c')]({'where':{'id':_0x5f5d94['params']['id']},'attributes':['id',_0x2e83('0x1d'),_0x2e83('0x1e')],'raw':!![]})[_0x2e83('0x1f')](function(_0x37efdb){if(_0x37efdb&&_0x37efdb[_0x2e83('0x1d')]){return _0xb4389d[_0x2e83('0x20')](_0x37efdb[_0x2e83('0x1e')]===_0x2e83('0x21')?0x195:0x193)[_0x2e83('0x22')]({'message':_0x37efdb[_0x2e83('0x1e')]==='unmanaged'?_0x2e83('0x23'):'Forbidden.'});}else{_0xe926f5();}})[_0x2e83('0x24')](function(_0x2b08d0){_0xe926f5(_0x2b08d0);});}});};function isAuthenticated(_0x4d22d3){return compose()[_0x2e83('0x19')](function(_0x121072,_0x330794,_0x4d0c36){if(_0x121072[_0x2e83('0x25')][_0x2e83('0x26')]){if(_[_0x2e83('0x27')](_0x121072[_0x2e83('0x25')]['authorization'],_0x2e83('0x28'))){var _0x326402=basicAuth(_0x121072);db['User'][_0x2e83('0x29')]({'where':{'name':_0x326402[_0x2e83('0x2a')]}})[_0x2e83('0x1f')](function(_0x46fa3f){if(!_0x46fa3f||!_0x46fa3f[_0x2e83('0x2b')](_0x326402['pass'])){return _0x330794[_0x2e83('0x20')](0x191)[_0x2e83('0x22')]({'message':_0x2e83('0x2c')});}_0x121072[_0x2e83('0x1a')]={'id':_0x46fa3f['id']};_0x4d0c36();})['catch'](function(_0x29fdcf){_0x4d0c36(_0x29fdcf);});}else if(_[_0x2e83('0x27')](_0x121072[_0x2e83('0x25')][_0x2e83('0x26')],'Bearer')){validateJwt(_0x121072,_0x330794,_0x4d0c36);}else{if(_0x4d22d3){_0x4d0c36();}else{return _0x330794['status'](0x193)['json']({'message':_0x2e83('0x2d')});}}}else if(_0x121072['query'][_0x2e83('0x2e')]){try{var _0x1c67b1=jwt[_0x2e83('0x2f')](_0x121072[_0x2e83('0x30')][_0x2e83('0x2e')],config[_0x2e83('0x7')][_0x2e83('0x31')],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x2e83('0x32')]()});db[_0x2e83('0x33')][_0x2e83('0x29')]({'where':{'id':_0x1c67b1[_0x2e83('0x34')]}})[_0x2e83('0x1f')](function(_0x5e3ade){if(!_0x5e3ade||!_['isEqual'](_0x5e3ade['apiKeyNonce'],_0x1c67b1[_0x2e83('0x35')])){return _0x330794[_0x2e83('0x20')](0x193)[_0x2e83('0x22')]({'message':_0x2e83('0x36')});}_0x121072[_0x2e83('0x1a')]={'id':_0x5e3ade['id']};_0x4d0c36();})[_0x2e83('0x24')](function(_0x32f4e4){_0x4d0c36(_0x32f4e4);});}catch(_0xe407bf){console['log'](_0xe407bf);return _0x330794['status'](0x193)[_0x2e83('0x22')]({'message':_0x2e83('0x37')});}}else if(_0x4d22d3){_0x4d0c36();}else{return _0x330794['status'](0x193)[_0x2e83('0x22')]({'message':_0x2e83('0x2d')});}})['use'](function(_0x2f93ee,_0x56b1a2,_0x160896){if(_0x2f93ee[_0x2e83('0x1a')]){db[_0x2e83('0x33')][_0x2e83('0x29')]({'where':{'id':_0x2f93ee[_0x2e83('0x1a')]['id']},'attributes':userAttributes})['then'](function(_0x2362d9){if(!_0x2362d9){return _0x56b1a2[_0x2e83('0x20')](0x194)[_0x2e83('0x22')]({'message':_0x2e83('0x38')});}_0x2f93ee[_0x2e83('0x1a')]=_0x2362d9;_0x160896();})[_0x2e83('0x24')](function(_0x140987){_0x160896(_0x140987);});}else if(_0x4d22d3){_0x160896();}else{return _0x56b1a2[_0x2e83('0x20')](0x194)[_0x2e83('0x22')]({'message':'User\x20object\x20not\x20found.'});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()[_0x2e83('0x19')](function(_0x49d863,_0x45e4b1,_0xc670ea){return require('../../config/license/util')['getLicense']()[_0x2e83('0x1f')](function(_0x5cf917){if(_0x5cf917[_0x2e83('0x39')]){_0xc670ea();}else{return _0x45e4b1[_0x2e83('0x20')](0x193)[_0x2e83('0x22')]({'message':_0x2e83('0x3a')});}})[_0x2e83('0x24')](function(_0x70c6d9){_0xc670ea(_0x70c6d9);});});}exports['canUpdate']=canUpdate;function signToken(_0x280e9e,_0x537571){return jwt[_0x2e83('0x3b')]({'id':_0x280e9e,'role':_0x537571},config[_0x2e83('0x7')][_0x2e83('0x31')],{'expiresIn':0x15180});}exports[_0x2e83('0x3c')]=signToken;exports[_0x2e83('0x3d')]=function(_0x5c2a19){if(!_0x5c2a19){throw new Error(_0x2e83('0x3e'));}return compose()[_0x2e83('0x19')](isAuthenticated())[_0x2e83('0x19')](function meetsRequirements(_0x1b2429,_0x596597,_0x589282){if(config[_0x2e83('0x3f')][_0x2e83('0x40')](_0x1b2429['user'][_0x2e83('0x8')])>=config['userRoles'][_0x2e83('0x40')](_0x5c2a19)){return _0x589282();}else{return _0x596597[_0x2e83('0x20')](0x193)[_0x2e83('0x22')]({'message':_0x2e83('0x3a')});}});};exports['isMiddleware']=function(_0x15e16d,_0x4bff14,_0x2368fd){_0x15e16d[_0x2e83('0x41')]=!![];return _0x2368fd();};exports[_0x2e83('0x42')]=function(_0x3a2405,_0x2dc409){if(!_0x3a2405[_0x2e83('0x1a')]){return _0x2dc409[_0x2e83('0x20')](0x194)['json']({'message':_0x2e83('0x43')});}var _0x2ca37a=signToken(_0x3a2405[_0x2e83('0x1a')]['id'],_0x3a2405[_0x2e83('0x1a')]['role']);_0x2dc409[_0x2e83('0x44')](_0x2e83('0x45'),_0x2ca37a);_0x2dc409['cookie']('motion.user',JSON['stringify'](_['pick'](_0x3a2405['user'],userAttributes)));_0x2dc409[_0x2e83('0x46')](_0x2e83('0x47'));};exports[_0x2e83('0x48')]=function(_0x809a51){if(_[_0x2e83('0x49')](_0x809a51[_0x2e83('0x4a')])||_[_0x2e83('0x49')](_0x809a51['apiKeyIat']))return null;else return createJwt(_0x809a51);};exports['generateApiKey']=function(_0x2eb2cf){_0x2eb2cf[_0x2e83('0x4a')]=crypto[_0x2e83('0x4b')](0x10)[_0x2e83('0x4c')]('hex');_0x2eb2cf[_0x2e83('0x4d')]=Math[_0x2e83('0x4e')](Date[_0x2e83('0x4f')]()/0x3e8)[_0x2e83('0x4c')]();return createJwt(_0x2eb2cf);};exports['regenerateApiKey']=function(_0x2156cf,_0x23b43b){if(_0x2156cf[_0x2e83('0x30')][_0x2e83('0x2e')]){jwt[_0x2e83('0x2f')](_0x2156cf['query'][_0x2e83('0x2e')],config[_0x2e83('0x7')][_0x2e83('0x31')],{'nonce':_0x23b43b[_0x2e83('0x4a')],'iat':_0x23b43b['apiKeyIat'],'audience':hardwareConf[_0x2e83('0x32')](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x23b43b);}else{throw{'message':_0x2e83('0x50')};}};function createJwt(_0x2420b1){return jwt[_0x2e83('0x3b')]({'iat':_0x2420b1[_0x2e83('0x4d')],'nonce':_0x2420b1['apiKeyNonce']},config[_0x2e83('0x7')][_0x2e83('0x31')],{'algorithm':'HS512','subject':_0x2420b1['id']['toString'](),'issuer':hardwareConf[_0x2e83('0x32')](),'audience':hardwareConf[_0x2e83('0x32')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 8e7f7ed..7f8c5e9 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 _0xfabc=['createWriteStream','algorithm','data','update','binary','write','end','close','unlink','decryptFile','createDecipher','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xfabc,0xe8));var _0xcfab=function(_0x242164,_0x1759e5){_0x242164=_0x242164-0x0;var _0x505dd4=_0xfabc[_0x242164];return _0x505dd4;};'use strict';var crypto=require(_0xcfab('0x0'));var fs=require('fs');var BPromise=require(_0xcfab('0x1'));var defaultOptions={'algorithm':_0xcfab('0x2')};function combineOptions(_0x47f40d){var _0x4a3f8d={};for(var _0x58758f in defaultOptions){if(defaultOptions[_0xcfab('0x3')](_0x58758f)){_0x4a3f8d[_0x58758f]=defaultOptions[_0x58758f];}}if(_0x47f40d){for(var _0x7a3bb0 in _0x47f40d){if(_0x47f40d[_0xcfab('0x3')](_0x7a3bb0)){_0x4a3f8d[_0x7a3bb0]=_0x47f40d[_0x7a3bb0];}}}return _0x4a3f8d;}exports[_0xcfab('0x4')]=function(_0x280629,_0x2f780f,_0x4e0bb8,_0x3dba90){return new BPromise(function(_0x370a45,_0x391e5c){_0x3dba90=combineOptions(_0x3dba90);var _0x5b232e=new Buffer(_0x4e0bb8);var _0x2e53a6=fs[_0xcfab('0x5')](_0x280629);var _0x44cd70=fs[_0xcfab('0x6')](_0x2f780f);var _0x3d6e7b=crypto['createCipher'](_0x3dba90[_0xcfab('0x7')],_0x5b232e);_0x2e53a6['on'](_0xcfab('0x8'),function(_0x59c1eb){var _0x937f8d=new Buffer(_0x3d6e7b[_0xcfab('0x9')](_0x59c1eb),_0xcfab('0xa'));_0x44cd70[_0xcfab('0xb')](_0x937f8d);});_0x2e53a6['on'](_0xcfab('0xc'),function(){try{var _0x11f51f=new Buffer(_0x3d6e7b['final'](_0xcfab('0xa')),_0xcfab('0xa'));_0x44cd70[_0xcfab('0xb')](_0x11f51f);_0x44cd70[_0xcfab('0xc')]();_0x44cd70['on'](_0xcfab('0xd'),function(){return _0x370a45(_0x2f780f);});}catch(_0xd33168){fs[_0xcfab('0xe')](_0x2f780f);return _0x391e5c(_0xd33168);}});});};exports[_0xcfab('0xf')]=function(_0x4bdf6d,_0x2a6599,_0x486b90,_0xa39fb4){return new BPromise(function(_0x58f714,_0x1e74c1){_0xa39fb4=combineOptions(_0xa39fb4);var _0x59e44c=new Buffer(_0x486b90);var _0xed711=fs[_0xcfab('0x5')](_0x4bdf6d);var _0x161a79=fs[_0xcfab('0x6')](_0x2a6599);var _0x194163=crypto[_0xcfab('0x10')](_0xa39fb4[_0xcfab('0x7')],_0x59e44c);_0xed711['on'](_0xcfab('0x8'),function(_0x12788d){var _0x8d3b30=new Buffer(_0x194163[_0xcfab('0x9')](_0x12788d),_0xcfab('0xa'));_0x161a79['write'](_0x8d3b30);});_0xed711['on'](_0xcfab('0xc'),function(){try{var _0x1da152=new Buffer(_0x194163['final'](_0xcfab('0xa')),_0xcfab('0xa'));_0x161a79[_0xcfab('0xb')](_0x1da152);_0x161a79[_0xcfab('0xc')]();_0x161a79['on'](_0xcfab('0xd'),function(){return _0x58f714(_0x2a6599);});}catch(_0x225bea){fs[_0xcfab('0xe')](_0x2a6599);return _0x1e74c1(_0x225bea);}});});}; \ No newline at end of file +var _0x9446=['binary','write','end','final','close','createDecipher','unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update'];(function(_0xab7710,_0x1bf517){var _0x238bad=function(_0x2e3075){while(--_0x2e3075){_0xab7710['push'](_0xab7710['shift']());}};_0x238bad(++_0x1bf517);}(_0x9446,0x103));var _0x6944=function(_0x44783e,_0x423336){_0x44783e=_0x44783e-0x0;var _0x5ca05d=_0x9446[_0x44783e];return _0x5ca05d;};'use strict';var crypto=require(_0x6944('0x0'));var fs=require('fs');var BPromise=require(_0x6944('0x1'));var defaultOptions={'algorithm':_0x6944('0x2')};function combineOptions(_0x28e74f){var _0x493bf1={};for(var _0x52af8d in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x52af8d)){_0x493bf1[_0x52af8d]=defaultOptions[_0x52af8d];}}if(_0x28e74f){for(var _0x2f0e69 in _0x28e74f){if(_0x28e74f[_0x6944('0x3')](_0x2f0e69)){_0x493bf1[_0x2f0e69]=_0x28e74f[_0x2f0e69];}}}return _0x493bf1;}exports[_0x6944('0x4')]=function(_0x211586,_0x11ea57,_0x43a3cd,_0x2e7578){return new BPromise(function(_0x149ee8,_0x395db0){_0x2e7578=combineOptions(_0x2e7578);var _0x13e322=new Buffer(_0x43a3cd);var _0x2d0795=fs[_0x6944('0x5')](_0x211586);var _0x41375d=fs[_0x6944('0x6')](_0x11ea57);var _0x3de40a=crypto[_0x6944('0x7')](_0x2e7578[_0x6944('0x8')],_0x13e322);_0x2d0795['on'](_0x6944('0x9'),function(_0x205158){var _0x593337=new Buffer(_0x3de40a[_0x6944('0xa')](_0x205158),_0x6944('0xb'));_0x41375d[_0x6944('0xc')](_0x593337);});_0x2d0795['on'](_0x6944('0xd'),function(){try{var _0x17670b=new Buffer(_0x3de40a[_0x6944('0xe')](_0x6944('0xb')),_0x6944('0xb'));_0x41375d['write'](_0x17670b);_0x41375d[_0x6944('0xd')]();_0x41375d['on'](_0x6944('0xf'),function(){return _0x149ee8(_0x11ea57);});}catch(_0x571eb6){fs['unlink'](_0x11ea57);return _0x395db0(_0x571eb6);}});});};exports['decryptFile']=function(_0x5b9369,_0x4c3d24,_0x8f2a10,_0x2932e1){return new BPromise(function(_0x59221c,_0x3528ce){_0x2932e1=combineOptions(_0x2932e1);var _0x76cbca=new Buffer(_0x8f2a10);var _0x426b7c=fs['createReadStream'](_0x5b9369);var _0x36e966=fs[_0x6944('0x6')](_0x4c3d24);var _0x2688ac=crypto[_0x6944('0x10')](_0x2932e1[_0x6944('0x8')],_0x76cbca);_0x426b7c['on']('data',function(_0x3a4947){var _0x725bbc=new Buffer(_0x2688ac[_0x6944('0xa')](_0x3a4947),'binary');_0x36e966[_0x6944('0xc')](_0x725bbc);});_0x426b7c['on'](_0x6944('0xd'),function(){try{var _0x664036=new Buffer(_0x2688ac[_0x6944('0xe')](_0x6944('0xb')),_0x6944('0xb'));_0x36e966[_0x6944('0xc')](_0x664036);_0x36e966[_0x6944('0xd')]();_0x36e966['on']('close',function(){return _0x59221c(_0x4c3d24);});}catch(_0x3f8162){fs[_0x6944('0x11')](_0x4c3d24);return _0x3528ce(_0x3f8162);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index b77fc0e..f4d53f1 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 _0xbe0d=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','push','QueryTypes','.csv','length','join','%s%d.%s','csv','%s.%s','writeFileSync','zip'];(function(_0x556f5e,_0x35e9e6){var _0x42ac8d=function(_0x325517){while(--_0x325517){_0x556f5e['push'](_0x556f5e['shift']());}};_0x42ac8d(++_0x35e9e6);}(_0xbe0d,0x19e));var _0xdbe0=function(_0x41983e,_0x1db165){_0x41983e=_0x41983e-0x0;var _0x23cb77=_0xbe0d[_0x41983e];return _0x23cb77;};'use strict';var util=require(_0xdbe0('0x0'));var path=require(_0xdbe0('0x1'));var _=require(_0xdbe0('0x2'));var csv=require(_0xdbe0('0x3'));var fs=require('fs');var BPromise=require(_0xdbe0('0x4'));var zipdir=require(_0xdbe0('0x5'));var rimraf=require(_0xdbe0('0x6'));var db=require(_0xdbe0('0x7'))['db'];var dbH=require(_0xdbe0('0x7'))['dbH'];var logger=require(_0xdbe0('0x8'))(_0xdbe0('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xdbe0('0xa')][0x2]);var QUERY=process[_0xdbe0('0xa')][0x3];var PATH=process[_0xdbe0('0xa')][0x4];function analyticExtractedReport(_0x53aa1d,_0x71dd91){var _0x56a2ee={'status':_0x53aa1d};var _0x1ac88c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x71dd91){_0x56a2ee['savename']=_0x71dd91;}return db[_0xdbe0('0xb')][_0xdbe0('0xc')](_0x56a2ee,_0x1ac88c);}function main(){var _0x404f10=0x1388;var _0x24cd1c;logger[_0xdbe0('0xd')](util['format'](_0xdbe0('0xe'),EXTRACTED_REPORT_ID,_0xdbe0('0xf')));return db[_0xdbe0('0x10')][_0xdbe0('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdbe0('0x12'),_0xdbe0('0x13')]})['then'](function(_0x261828){if(_0x261828){_0x24cd1c=_0x261828;_0x404f10=_0x24cd1c[_0xdbe0('0x13')]||0x1388;}})[_0xdbe0('0x14')](function(){return dbH['sequelize'][_0xdbe0('0x15')](util[_0xdbe0('0x16')](_0xdbe0('0x17'),QUERY),{'type':dbH[_0xdbe0('0x18')]['QueryTypes'][_0xdbe0('0x19')]});})[_0xdbe0('0x14')](function(_0x1f3a7e){if(!_0x1f3a7e[0x0]['num']){return analyticExtractedReport('Empty');}var _0x539cd8=[];var _0x112352=0x0;var _0x10f37d=!![];if(_0x1f3a7e&&_0x1f3a7e['length']){var _0x5e1d8c=_0x1f3a7e[0x0]['num']%(_0x112352+_0x404f10);if(_0x24cd1c[_0xdbe0('0x12')]){for(;_0x10f37d;_0x112352+=_0x404f10,_0x5e1d8c=_0x1f3a7e[0x0][_0xdbe0('0x1a')]%(_0x112352+_0x404f10)){if(_0x5e1d8c==0x0||_0x5e1d8c==_0x1f3a7e[0x0][_0xdbe0('0x1a')]){_0x10f37d=![];}_0x539cd8[_0xdbe0('0x1b')](dbH[_0xdbe0('0x18')][_0xdbe0('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x404f10,_0x112352),{'type':dbH['sequelize'][_0xdbe0('0x1c')]['SELECT']}));}}else{_0x539cd8['push'](dbH[_0xdbe0('0x18')]['query'](QUERY,{'type':dbH[_0xdbe0('0x18')][_0xdbe0('0x1c')]['SELECT']}));}}var _0x471520=path['dirname'](PATH);var _0x2d2a4b=path['basename'](PATH,_0xdbe0('0x1d'));var _0x2a3324=_0x24cd1c[_0xdbe0('0x12')]&&_0x539cd8[_0xdbe0('0x1e')]>0x1;var _0x4c649b=[];if(!fs['existsSync'](path[_0xdbe0('0x1f')](_0x471520,_0x2d2a4b))&&_0x2a3324){fs['mkdirSync'](path['join'](_0x471520,_0x2d2a4b));}return BPromise['each'](_0x539cd8,function(_0x3cacf3){_0x4c649b[_0xdbe0('0x1b')](_0x3cacf3);})['then'](function(){for(var _0x4685d7=0x0;_0x4685d7<_0x4c649b['length'];_0x4685d7+=0x1){var _0x42e939;var _0x31bdef=_0x4c649b[_0x4685d7];if(_0x2a3324){_0x42e939=path[_0xdbe0('0x1f')](_0x471520,_0x2d2a4b,util[_0xdbe0('0x16')](_0xdbe0('0x20'),_0x2d2a4b,_0x4685d7,_0xdbe0('0x21')));}else{_0x42e939=path[_0xdbe0('0x1f')](_0x471520,util[_0xdbe0('0x16')](_0xdbe0('0x22'),_0x2d2a4b,_0xdbe0('0x21')));}fs[_0xdbe0('0x23')](_0x42e939,csv(_0x31bdef));}})[_0xdbe0('0x14')](function(){if(_0x2a3324){zipdir(path['join'](_0x471520,_0x2d2a4b),{'saveTo':path['join'](_0x471520,util[_0xdbe0('0x16')](_0xdbe0('0x22'),_0x2d2a4b,_0xdbe0('0x24')))},function(_0x10dd6e,_0x18e585){});rimraf(path['join'](_0x471520,_0x2d2a4b),function(){});}})[_0xdbe0('0x14')](function(){logger[_0xdbe0('0xd')](util[_0xdbe0('0x16')](_0xdbe0('0x25'),EXTRACTED_REPORT_ID,_0xdbe0('0xf')));return analyticExtractedReport(_0xdbe0('0x26'),_0x2a3324?util[_0xdbe0('0x16')]('%s.%s',_0x2d2a4b,_0x2a3324?_0xdbe0('0x24'):_0xdbe0('0x21')):null);});})['catch'](function(_0x42117b){logger[_0xdbe0('0xd')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xdbe0('0xf')),util[_0xdbe0('0x27')](_0x42117b,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xdbe0('0x28'));});}main(); \ No newline at end of file +var _0x2efa=['splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','dirname','basename','existsSync','join','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2efa,0xc7));var _0xa2ef=function(_0x45a7c3,_0x89a009){_0x45a7c3=_0x45a7c3-0x0;var _0x15cebe=_0x2efa[_0x45a7c3];return _0x15cebe;};'use strict';var util=require(_0xa2ef('0x0'));var path=require(_0xa2ef('0x1'));var _=require(_0xa2ef('0x2'));var csv=require(_0xa2ef('0x3'));var fs=require('fs');var BPromise=require(_0xa2ef('0x4'));var zipdir=require(_0xa2ef('0x5'));var rimraf=require(_0xa2ef('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa2ef('0x7'))[_0xa2ef('0x8')];var logger=require(_0xa2ef('0x9'))(_0xa2ef('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xa2ef('0xb')][0x2]);var QUERY=process[_0xa2ef('0xb')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x14c5ad,_0x49b601){var _0xdec231={'status':_0x14c5ad};var _0x226b46={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x49b601){_0xdec231[_0xa2ef('0xc')]=_0x49b601;}return db[_0xa2ef('0xd')][_0xa2ef('0xe')](_0xdec231,_0x226b46);}function main(){var _0x1fd04e=0x1388;var _0x550e81;logger[_0xa2ef('0xf')](util['format'](_0xa2ef('0x10'),EXTRACTED_REPORT_ID,_0xa2ef('0x11')));return db[_0xa2ef('0x12')][_0xa2ef('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa2ef('0x14'),_0xa2ef('0x15')]})[_0xa2ef('0x16')](function(_0x480f43){if(_0x480f43){_0x550e81=_0x480f43;_0x1fd04e=_0x550e81['splitSizeCsv']||0x1388;}})[_0xa2ef('0x16')](function(){return dbH[_0xa2ef('0x17')][_0xa2ef('0x18')](util[_0xa2ef('0x19')](_0xa2ef('0x1a'),QUERY),{'type':dbH[_0xa2ef('0x17')][_0xa2ef('0x1b')][_0xa2ef('0x1c')]});})[_0xa2ef('0x16')](function(_0x4aa573){if(!_0x4aa573[0x0][_0xa2ef('0x1d')]){return analyticExtractedReport(_0xa2ef('0x1e'));}var _0x334b02=[];var _0x592f54=0x0;var _0x1900ac=!![];if(_0x4aa573&&_0x4aa573[_0xa2ef('0x1f')]){var _0x3ebf45=_0x4aa573[0x0][_0xa2ef('0x1d')]%(_0x592f54+_0x1fd04e);if(_0x550e81[_0xa2ef('0x14')]){for(;_0x1900ac;_0x592f54+=_0x1fd04e,_0x3ebf45=_0x4aa573[0x0][_0xa2ef('0x1d')]%(_0x592f54+_0x1fd04e)){if(_0x3ebf45==0x0||_0x3ebf45==_0x4aa573[0x0][_0xa2ef('0x1d')]){_0x1900ac=![];}_0x334b02[_0xa2ef('0x20')](dbH['sequelize'][_0xa2ef('0x18')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1fd04e,_0x592f54),{'type':dbH[_0xa2ef('0x17')][_0xa2ef('0x1b')][_0xa2ef('0x1c')]}));}}else{_0x334b02[_0xa2ef('0x20')](dbH[_0xa2ef('0x17')][_0xa2ef('0x18')](QUERY,{'type':dbH[_0xa2ef('0x17')][_0xa2ef('0x1b')]['SELECT']}));}}var _0x426905=path[_0xa2ef('0x21')](PATH);var _0x160aab=path[_0xa2ef('0x22')](PATH,'.csv');var _0x184733=_0x550e81[_0xa2ef('0x14')]&&_0x334b02[_0xa2ef('0x1f')]>0x1;var _0x25d75d=[];if(!fs[_0xa2ef('0x23')](path[_0xa2ef('0x24')](_0x426905,_0x160aab))&&_0x184733){fs['mkdirSync'](path['join'](_0x426905,_0x160aab));}return BPromise['each'](_0x334b02,function(_0x28dfc3){_0x25d75d[_0xa2ef('0x20')](_0x28dfc3);})[_0xa2ef('0x16')](function(){for(var _0x2ce65e=0x0;_0x2ce65e<_0x25d75d[_0xa2ef('0x1f')];_0x2ce65e+=0x1){var _0x33a43b;var _0x1fe435=_0x25d75d[_0x2ce65e];if(_0x184733){_0x33a43b=path[_0xa2ef('0x24')](_0x426905,_0x160aab,util['format']('%s%d.%s',_0x160aab,_0x2ce65e,_0xa2ef('0x25')));}else{_0x33a43b=path[_0xa2ef('0x24')](_0x426905,util[_0xa2ef('0x19')](_0xa2ef('0x26'),_0x160aab,_0xa2ef('0x25')));}fs[_0xa2ef('0x27')](_0x33a43b,csv(_0x1fe435));}})[_0xa2ef('0x16')](function(){if(_0x184733){zipdir(path[_0xa2ef('0x24')](_0x426905,_0x160aab),{'saveTo':path['join'](_0x426905,util[_0xa2ef('0x19')]('%s.%s',_0x160aab,_0xa2ef('0x28')))},function(_0x1819ee,_0x2a6da3){});rimraf(path[_0xa2ef('0x24')](_0x426905,_0x160aab),function(){});}})['then'](function(){logger[_0xa2ef('0xf')](util[_0xa2ef('0x19')](_0xa2ef('0x29'),EXTRACTED_REPORT_ID,_0xa2ef('0x11')));return analyticExtractedReport(_0xa2ef('0x2a'),_0x184733?util[_0xa2ef('0x19')](_0xa2ef('0x26'),_0x160aab,_0x184733?_0xa2ef('0x28'):'csv'):null);});})['catch'](function(_0x4d8c9e){logger[_0xa2ef('0xf')](util[_0xa2ef('0x19')](_0xa2ef('0x2b'),EXTRACTED_REPORT_ID,_0xa2ef('0x11')),util['inspect'](_0x4d8c9e,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 95a673a..3f74d36 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 _0xc536=['splitSizePdf','then','length','split','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','existsSync','mkdirSync','join','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','landscape','body','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','pipe','finish','err','end','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','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','bluebird','util','path','rimraf','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','push','tableHeader','Empty','dirname','basename','.pdf'];(function(_0x3024b4,_0x442dc8){var _0x1d2e21=function(_0x35d087){while(--_0x35d087){_0x3024b4['push'](_0x3024b4['shift']());}};_0x1d2e21(++_0x442dc8);}(_0xc536,0x137));var _0x6c53=function(_0x45ad9c,_0x4bccd6){_0x45ad9c=_0x45ad9c-0x0;var _0x4e4727=_0xc536[_0x45ad9c];return _0x4e4727;};'use strict';var _=require('lodash');var fs=require('fs');var BPromise=require(_0x6c53('0x0'));var util=require(_0x6c53('0x1'));var path=require(_0x6c53('0x2'));var moment=require('moment');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x6c53('0x3'));var db=require(_0x6c53('0x4'))['db'];var dbH=require(_0x6c53('0x4'))[_0x6c53('0x5')];var logger=require('../../config/logger')(_0x6c53('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x6c53('0x7')][0x2]);var QUERY=process[_0x6c53('0x7')][0x3];var PATH=process[_0x6c53('0x7')][0x4];var NAME=process[_0x6c53('0x7')][0x5];var FORMAT=_0x6c53('0x8');var _extractedReport;function analyticExtractedReport(_0x436299,_0xa7bf66){var _0x2b1ea7={'status':_0x436299};var _0x3e91dc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa7bf66){_0x2b1ea7[_0x6c53('0x9')]=_0xa7bf66;}return db[_0x6c53('0xa')][_0x6c53('0xb')](_0x2b1ea7,_0x3e91dc);}function getHeader(_0x523037){var _0x26917f=[];for(var _0x3756e0 in _0x523037){if(_0x523037[_0x6c53('0xc')](_0x3756e0)){_0x26917f[_0x6c53('0xd')]({'text':_0x3756e0,'style':_0x6c53('0xe')});}}return _0x26917f;}function extractReport(_0x36648e){var _0x128ff5=0x1388;var _0x31a2cc;if(!_0x36648e[0x0]['num']){return analyticExtractedReport(_0x6c53('0xf'));}var _0xc3f076=[];var _0xb55d0f=0x0;var _0x498cf1=!![];var _0x9bd416=path[_0x6c53('0x10')](PATH);var _0x5ea2ed=path[_0x6c53('0x11')](PATH,_0x6c53('0x12'));var _0x434b11=![];var _0x1a1dca=[];return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6c53('0x13')]})[_0x6c53('0x14')](function(_0x303414){if(_0x303414){_0x31a2cc=_0x303414;_0x128ff5=_0x31a2cc['splitSizePdf']||0x3e8;}})[_0x6c53('0x14')](function(){if(_0x36648e&&_0x36648e[_0x6c53('0x15')]){var _0xdcba06=_0x36648e[0x0]['num']%(_0xb55d0f+_0x128ff5);if(_0x31a2cc[_0x6c53('0x16')]){for(;_0x498cf1;_0xb55d0f+=_0x128ff5,_0xdcba06=_0x36648e[0x0]['num']%(_0xb55d0f+_0x128ff5)){if(_0xdcba06==0x0||_0xdcba06==_0x36648e[0x0][_0x6c53('0x17')]){_0x498cf1=![];}_0xc3f076[_0x6c53('0xd')](dbH['sequelize'][_0x6c53('0x18')](util['format'](_0x6c53('0x19'),QUERY,_0x128ff5,_0xb55d0f),{'type':dbH[_0x6c53('0x1a')][_0x6c53('0x1b')]['SELECT']}));}}else{_0xc3f076[_0x6c53('0xd')](dbH[_0x6c53('0x1a')][_0x6c53('0x18')](QUERY,{'type':dbH[_0x6c53('0x1a')][_0x6c53('0x1b')][_0x6c53('0x1c')]}));}}_0x434b11=_0x31a2cc['split']&&_0xc3f076['length']>0x1;if(!fs[_0x6c53('0x1d')](path['join'](_0x9bd416,_0x5ea2ed))&&_0x434b11){fs[_0x6c53('0x1e')](path[_0x6c53('0x1f')](_0x9bd416,_0x5ea2ed));}return BPromise[_0x6c53('0x20')](_0xc3f076,function(_0x4fe341){_0x1a1dca[_0x6c53('0xd')](_0x4fe341);});})['then'](function(){return BPromise[_0x6c53('0x20')](_0xc3f076,function(_0x5cf9ed,_0x2c8854){var _0x5a1b7f;var _0x11d796=util['format'](_0x6c53('0x21'),NAME,_extractedReport[_0x6c53('0x22')],moment(_extractedReport[_0x6c53('0x23')])[_0x6c53('0x24')](FORMAT),moment(_extractedReport[_0x6c53('0x25')])['format'](FORMAT));var _0x32ede9={'pageSize':'A4','pageOrientation':_0x6c53('0x26'),'content':[{'text':_0x11d796,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x4b3bbf={'headerRows':0x1,'body':[]};_0x4b3bbf[_0x6c53('0x27')][_0x6c53('0xd')](getHeader(_0x5cf9ed[0x0]));var _0x292689;for(var _0x2d2ba5=0x0;_0x2d2ba5<_0x5cf9ed[_0x6c53('0x15')];_0x2d2ba5+=0x1){_0x292689=[];for(var _0x280d78 in _0x5cf9ed[_0x2d2ba5]){if(_0x5cf9ed[_0x2d2ba5]['hasOwnProperty'](_0x280d78)){_0x292689[_0x6c53('0xd')](_0x5cf9ed[_0x2d2ba5][_0x280d78]?_['toString'](_0x5cf9ed[_0x2d2ba5][_0x280d78]):'');}}_0x4b3bbf['body'][_0x6c53('0xd')](_0x292689);}_0x32ede9[_0x6c53('0x28')][_0x6c53('0xd')]({'table':_0x4b3bbf});return new BPromise(function(_0x57f14d,_0x43b525){var _0x2cb51c=new PdfPrinter({'Roboto':{'normal':__dirname+_0x6c53('0x29'),'bold':__dirname+_0x6c53('0x2a'),'italics':__dirname+_0x6c53('0x2b'),'bolditalics':__dirname+_0x6c53('0x2c')}});var _0x2289c7=_0x2cb51c[_0x6c53('0x2d')](_0x32ede9);if(_0x434b11){_0x5a1b7f=path[_0x6c53('0x1f')](_0x9bd416,_0x5ea2ed,util[_0x6c53('0x24')](_0x6c53('0x2e'),_0x5ea2ed,_0x2c8854,_0x6c53('0x2f')));}else{_0x5a1b7f=path[_0x6c53('0x1f')](_0x9bd416,util['format'](_0x6c53('0x30'),_0x5ea2ed,'pdf'));}var _0x5aceb7=_0x2289c7[_0x6c53('0x31')](fs['createWriteStream'](_0x5a1b7f));_0x5aceb7['on'](_0x6c53('0x32'),function(){_0x57f14d();});_0x5aceb7['on']('error',function(_0x2bdc18){console['log'](_0x6c53('0x33'),_0x2bdc18);_0x43b525(_0x2bdc18);});_0x2289c7[_0x6c53('0x34')]();});});})[_0x6c53('0x14')](function(){if(_0x434b11){return new BPromise(function(_0xdad49b,_0x2d8a93){zipdir(path[_0x6c53('0x1f')](_0x9bd416,_0x5ea2ed),{'saveTo':path[_0x6c53('0x1f')](_0x9bd416,util[_0x6c53('0x24')]('%s.%s',_0x5ea2ed,'zip'))},function(_0x4faef8){if(_0x4faef8){_0x2d8a93(_0x4faef8);}else{_0xdad49b();}});});}})['then'](function(){if(_0x434b11){rimraf(path[_0x6c53('0x1f')](_0x9bd416,_0x5ea2ed),function(){});}})[_0x6c53('0x14')](function(){logger[_0x6c53('0x35')](util[_0x6c53('0x24')](_0x6c53('0x36'),EXTRACTED_REPORT_ID,_0x6c53('0x37')));return analyticExtractedReport(_0x6c53('0x38'),_0x434b11?util[_0x6c53('0x24')](_0x6c53('0x30'),_0x5ea2ed,_0x434b11?_0x6c53('0x39'):_0x6c53('0x2f')):null);});}function main(){logger['info'](util[_0x6c53('0x24')](_0x6c53('0x3a'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x6c53('0xa')][_0x6c53('0x3b')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6c53('0x14')](function(_0x36d30e){_extractedReport=_0x36d30e;return dbH['sequelize'][_0x6c53('0x18')](util[_0x6c53('0x24')](_0x6c53('0x3c'),QUERY),{'type':dbH[_0x6c53('0x1a')][_0x6c53('0x1b')][_0x6c53('0x1c')]});})['then'](extractReport)[_0x6c53('0x3d')](function(_0x281d03){logger[_0x6c53('0x35')](util[_0x6c53('0x24')](_0x6c53('0x3e'),EXTRACTED_REPORT_ID,_0x6c53('0x3f')),util[_0x6c53('0x40')](_0x281d03,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x6c53('0x41'));});}main(); \ No newline at end of file +var _0x4bfa=['pdf','pipe','createWriteStream','error','log','err','end','zip','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','query','QueryTypes','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','push','tableHeader','num','Empty','.pdf','Setting','find','split','splitSizePdf','then','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','length','existsSync','join','each','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','black','body','hasOwnProperty','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','%s%d.%s','%s.%s'];(function(_0x57913b,_0x41bb78){var _0x5ce491=function(_0x224c5c){while(--_0x224c5c){_0x57913b['push'](_0x57913b['shift']());}};_0x5ce491(++_0x41bb78);}(_0x4bfa,0x95));var _0xa4bf=function(_0x3e4ccf,_0x263017){_0x3e4ccf=_0x3e4ccf-0x0;var _0x25d931=_0x4bfa[_0x3e4ccf];return _0x25d931;};'use strict';var _=require(_0xa4bf('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require('util');var path=require(_0xa4bf('0x1'));var moment=require(_0xa4bf('0x2'));var PdfPrinter=require(_0xa4bf('0x3'));var zipdir=require(_0xa4bf('0x4'));var rimraf=require(_0xa4bf('0x5'));var db=require(_0xa4bf('0x6'))['db'];var dbH=require(_0xa4bf('0x6'))[_0xa4bf('0x7')];var logger=require(_0xa4bf('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa4bf('0x9')][0x2]);var QUERY=process[_0xa4bf('0x9')][0x3];var PATH=process[_0xa4bf('0x9')][0x4];var NAME=process[_0xa4bf('0x9')][0x5];var FORMAT=_0xa4bf('0xa');var _extractedReport;function analyticExtractedReport(_0xe151db,_0x5732cc){var _0x24cc52={'status':_0xe151db};var _0x5668af={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5732cc){_0x24cc52[_0xa4bf('0xb')]=_0x5732cc;}return db[_0xa4bf('0xc')][_0xa4bf('0xd')](_0x24cc52,_0x5668af);}function getHeader(_0x24ef04){var _0x237bf7=[];for(var _0x4b5854 in _0x24ef04){if(_0x24ef04['hasOwnProperty'](_0x4b5854)){_0x237bf7[_0xa4bf('0xe')]({'text':_0x4b5854,'style':_0xa4bf('0xf')});}}return _0x237bf7;}function extractReport(_0x4ef896){var _0x2ea5c4=0x1388;var _0x2d1d70;if(!_0x4ef896[0x0][_0xa4bf('0x10')]){return analyticExtractedReport(_0xa4bf('0x11'));}var _0x47253c=[];var _0x42eb36=0x0;var _0x4cfa98=!![];var _0x10d884=path['dirname'](PATH);var _0x3ae878=path['basename'](PATH,_0xa4bf('0x12'));var _0x20b55d=![];var _0x7117c5=[];return db[_0xa4bf('0x13')][_0xa4bf('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa4bf('0x15'),_0xa4bf('0x16')]})[_0xa4bf('0x17')](function(_0xe2eaa0){if(_0xe2eaa0){_0x2d1d70=_0xe2eaa0;_0x2ea5c4=_0x2d1d70[_0xa4bf('0x16')]||0x3e8;}})[_0xa4bf('0x17')](function(){if(_0x4ef896&&_0x4ef896['length']){var _0x5d53d5=_0x4ef896[0x0][_0xa4bf('0x10')]%(_0x42eb36+_0x2ea5c4);if(_0x2d1d70[_0xa4bf('0x15')]){for(;_0x4cfa98;_0x42eb36+=_0x2ea5c4,_0x5d53d5=_0x4ef896[0x0][_0xa4bf('0x10')]%(_0x42eb36+_0x2ea5c4)){if(_0x5d53d5==0x0||_0x5d53d5==_0x4ef896[0x0]['num']){_0x4cfa98=![];}_0x47253c[_0xa4bf('0xe')](dbH[_0xa4bf('0x18')]['query'](util['format'](_0xa4bf('0x19'),QUERY,_0x2ea5c4,_0x42eb36),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}else{_0x47253c[_0xa4bf('0xe')](dbH[_0xa4bf('0x18')]['query'](QUERY,{'type':dbH[_0xa4bf('0x18')]['QueryTypes'][_0xa4bf('0x1a')]}));}}_0x20b55d=_0x2d1d70['split']&&_0x47253c[_0xa4bf('0x1b')]>0x1;if(!fs[_0xa4bf('0x1c')](path[_0xa4bf('0x1d')](_0x10d884,_0x3ae878))&&_0x20b55d){fs['mkdirSync'](path['join'](_0x10d884,_0x3ae878));}return BPromise[_0xa4bf('0x1e')](_0x47253c,function(_0x4578bf){_0x7117c5[_0xa4bf('0xe')](_0x4578bf);});})[_0xa4bf('0x17')](function(){return BPromise[_0xa4bf('0x1e')](_0x47253c,function(_0x607e0b,_0x233c56){var _0x41dd8a;var _0x405f83=util[_0xa4bf('0x1f')](_0xa4bf('0x20'),NAME,_extractedReport[_0xa4bf('0x21')],moment(_extractedReport[_0xa4bf('0x22')])[_0xa4bf('0x1f')](FORMAT),moment(_extractedReport[_0xa4bf('0x23')])[_0xa4bf('0x1f')](FORMAT));var _0x91b6a2={'pageSize':'A4','pageOrientation':'landscape','content':[{'text':_0x405f83,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa4bf('0x24')}}};var _0x56f1a2={'headerRows':0x1,'body':[]};_0x56f1a2[_0xa4bf('0x25')]['push'](getHeader(_0x607e0b[0x0]));var _0x233257;for(var _0x4ea697=0x0;_0x4ea697<_0x607e0b[_0xa4bf('0x1b')];_0x4ea697+=0x1){_0x233257=[];for(var _0x41824d in _0x607e0b[_0x4ea697]){if(_0x607e0b[_0x4ea697][_0xa4bf('0x26')](_0x41824d)){_0x233257['push'](_0x607e0b[_0x4ea697][_0x41824d]?_[_0xa4bf('0x27')](_0x607e0b[_0x4ea697][_0x41824d]):'');}}_0x56f1a2[_0xa4bf('0x25')]['push'](_0x233257);}_0x91b6a2[_0xa4bf('0x28')][_0xa4bf('0xe')]({'table':_0x56f1a2});return new BPromise(function(_0x2f9fb9,_0xa24720){var _0x175e92=new PdfPrinter({'Roboto':{'normal':__dirname+_0xa4bf('0x29'),'bold':__dirname+_0xa4bf('0x2a'),'italics':__dirname+_0xa4bf('0x2b'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x42e048=_0x175e92['createPdfKitDocument'](_0x91b6a2);if(_0x20b55d){_0x41dd8a=path[_0xa4bf('0x1d')](_0x10d884,_0x3ae878,util['format'](_0xa4bf('0x2c'),_0x3ae878,_0x233c56,'pdf'));}else{_0x41dd8a=path[_0xa4bf('0x1d')](_0x10d884,util[_0xa4bf('0x1f')](_0xa4bf('0x2d'),_0x3ae878,_0xa4bf('0x2e')));}var _0x205cbb=_0x42e048[_0xa4bf('0x2f')](fs[_0xa4bf('0x30')](_0x41dd8a));_0x205cbb['on']('finish',function(){_0x2f9fb9();});_0x205cbb['on'](_0xa4bf('0x31'),function(_0x1887c9){console[_0xa4bf('0x32')](_0xa4bf('0x33'),_0x1887c9);_0xa24720(_0x1887c9);});_0x42e048[_0xa4bf('0x34')]();});});})[_0xa4bf('0x17')](function(){if(_0x20b55d){return new BPromise(function(_0x4c0802,_0x3043cf){zipdir(path[_0xa4bf('0x1d')](_0x10d884,_0x3ae878),{'saveTo':path['join'](_0x10d884,util['format']('%s.%s',_0x3ae878,_0xa4bf('0x35')))},function(_0xab6f86){if(_0xab6f86){_0x3043cf(_0xab6f86);}else{_0x4c0802();}});});}})['then'](function(){if(_0x20b55d){rimraf(path[_0xa4bf('0x1d')](_0x10d884,_0x3ae878),function(){});}})['then'](function(){logger['info'](util[_0xa4bf('0x1f')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa4bf('0x36')));return analyticExtractedReport(_0xa4bf('0x37'),_0x20b55d?util[_0xa4bf('0x1f')](_0xa4bf('0x2d'),_0x3ae878,_0x20b55d?_0xa4bf('0x35'):_0xa4bf('0x2e')):null);});}function main(){logger['info'](util[_0xa4bf('0x1f')](_0xa4bf('0x38'),EXTRACTED_REPORT_ID,_0xa4bf('0x39')));return db[_0xa4bf('0xc')][_0xa4bf('0x3a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa4bf('0x17')](function(_0x1c6ee9){_extractedReport=_0x1c6ee9;return dbH['sequelize'][_0xa4bf('0x3b')](util[_0xa4bf('0x1f')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa4bf('0x18')][_0xa4bf('0x3c')]['SELECT']});})[_0xa4bf('0x17')](extractReport)['catch'](function(_0x1ca9fc){logger[_0xa4bf('0x3d')](util[_0xa4bf('0x1f')](_0xa4bf('0x3e'),EXTRACTED_REPORT_ID,_0xa4bf('0x39')),util[_0xa4bf('0x3f')](_0x1ca9fc,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xa4bf('0x40'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 5abe7d1..847f4d4 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 _0x52f7=['Empty','split','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','then'];(function(_0x4530e1,_0x2d81b7){var _0x4f12fe=function(_0x300f5e){while(--_0x300f5e){_0x4530e1['push'](_0x4530e1['shift']());}};_0x4f12fe(++_0x2d81b7);}(_0x52f7,0xd4));var _0x752f=function(_0x504de5,_0x346727){_0x504de5=_0x504de5-0x0;var _0x3b9997=_0x52f7[_0x504de5];return _0x3b9997;};'use strict';var util=require(_0x752f('0x0'));var path=require(_0x752f('0x1'));var _=require(_0x752f('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x752f('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x752f('0x4'));var db=require(_0x752f('0x5'))['db'];var dbH=require(_0x752f('0x5'))['dbH'];var logger=require(_0x752f('0x6'))(_0x752f('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x752f('0x8')][0x2]);var QUERY=process[_0x752f('0x8')][0x3];var PATH=process[_0x752f('0x8')][0x4];function analyticExtractedReport(_0x3c4da5,_0x4c199){var _0x3e2596={'status':_0x3c4da5};var _0x3027bf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4c199){_0x3e2596[_0x752f('0x9')]=_0x4c199;}return db[_0x752f('0xa')][_0x752f('0xb')](_0x3e2596,_0x3027bf);}function main(){var _0x4a312c=0x1388;var _0x2a4912;logger[_0x752f('0xc')](util[_0x752f('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x752f('0xe')));return db[_0x752f('0xf')][_0x752f('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x752f('0x11')]})['then'](function(_0x440635){if(_0x440635){_0x2a4912=_0x440635;_0x4a312c=_0x2a4912[_0x752f('0x11')]||0x1388;}})['then'](function(){return dbH[_0x752f('0x12')][_0x752f('0x13')](util[_0x752f('0xd')](_0x752f('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x752f('0x15')]});})[_0x752f('0x16')](function(_0x28c13c){if(!_0x28c13c[0x0]['num']){return analyticExtractedReport(_0x752f('0x17'));}var _0x5745e5=[];var _0xbbe41=0x0;var _0x3c525f=!![];if(_0x2a4912[_0x752f('0x18')]){if(_0x28c13c&&_0x28c13c[_0x752f('0x19')]){var _0x2cbf35=_0x28c13c[0x0][_0x752f('0x1a')]%(_0xbbe41+_0x4a312c);for(;_0x3c525f;_0xbbe41+=_0x4a312c,_0x2cbf35=_0x28c13c[0x0][_0x752f('0x1a')]%(_0xbbe41+_0x4a312c)){if(_0x2cbf35==0x0||_0x2cbf35==_0x28c13c[0x0][_0x752f('0x1a')]){_0x3c525f=![];}_0x5745e5[_0x752f('0x1b')](dbH['sequelize'][_0x752f('0x13')](util[_0x752f('0xd')](_0x752f('0x1c'),QUERY,_0x4a312c,_0xbbe41),{'type':dbH[_0x752f('0x12')]['QueryTypes'][_0x752f('0x15')]}));}}}else{_0x5745e5[_0x752f('0x1b')](dbH[_0x752f('0x12')][_0x752f('0x13')](QUERY,{'type':dbH[_0x752f('0x12')][_0x752f('0x1d')][_0x752f('0x15')]}));}var _0x19046f=path[_0x752f('0x1e')](PATH);var _0x9cef41=path[_0x752f('0x1f')](PATH,_0x752f('0x20'));var _0x580945=_0x2a4912[_0x752f('0x18')]&&_0x5745e5['length']>0x1;var _0x11a916=[];if(!fs[_0x752f('0x21')](path[_0x752f('0x22')](_0x19046f,_0x9cef41))&&_0x580945){fs[_0x752f('0x23')](path[_0x752f('0x22')](_0x19046f,_0x9cef41));}return BPromise[_0x752f('0x24')](_0x5745e5,function(_0x68a2bc){_0x11a916[_0x752f('0x1b')](_0x68a2bc);})[_0x752f('0x16')](function(){for(var _0x323167=0x0;_0x323167<_0x11a916['length'];_0x323167+=0x1){var _0xf7b707;var _0x2f71d5=_0x11a916[_0x323167];if(_0x580945){_0xf7b707=path[_0x752f('0x22')](_0x19046f,_0x9cef41,util['format'](_0x752f('0x25'),_0x9cef41,_0x323167,_0x752f('0x26')));}else{_0xf7b707=path['join'](_0x19046f,util['format'](_0x752f('0x27'),_0x9cef41,_0x752f('0x26')));}fs[_0x752f('0x28')](_0xf7b707,json2xls(_0x2f71d5),_0x752f('0x29'));}})[_0x752f('0x16')](function(){if(_0x580945){zipdir(path['join'](_0x19046f,_0x9cef41),{'saveTo':path[_0x752f('0x22')](_0x19046f,util[_0x752f('0xd')]('%s.%s',_0x9cef41,_0x752f('0x2a')))},function(_0x114955,_0x49446c){});rimraf(path[_0x752f('0x22')](_0x19046f,_0x9cef41),function(){});}})['then'](function(){logger[_0x752f('0xc')](util[_0x752f('0xd')](_0x752f('0x2b'),EXTRACTED_REPORT_ID,_0x752f('0xe')));return analyticExtractedReport('Completed',_0x580945?util[_0x752f('0xd')](_0x752f('0x27'),_0x9cef41,_0x580945?_0x752f('0x2a'):_0x752f('0x26')):null);});})[_0x752f('0x2c')](function(_0x14a443){logger['info'](util[_0x752f('0xd')](_0x752f('0x2d'),EXTRACTED_REPORT_ID,_0x752f('0xe')),util['inspect'](_0x14a443,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x752f('0x2e'));});}main(); \ No newline at end of file +var _0xc92a=['sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','split','push','QueryTypes','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','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','inspect','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','splitSizeXlsx','then'];(function(_0x4fbcfb,_0x1d40d4){var _0x387222=function(_0x5d9e8e){while(--_0x5d9e8e){_0x4fbcfb['push'](_0x4fbcfb['shift']());}};_0x387222(++_0x1d40d4);}(_0xc92a,0x15c));var _0xac92=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc92a[_0x3b380d];return _0x54502b;};'use strict';var util=require('util');var path=require(_0xac92('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xac92('0x1'));var BPromise=require(_0xac92('0x2'));var zipdir=require(_0xac92('0x3'));var rimraf=require(_0xac92('0x4'));var db=require(_0xac92('0x5'))['db'];var dbH=require(_0xac92('0x5'))[_0xac92('0x6')];var logger=require(_0xac92('0x7'))(_0xac92('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xac92('0x9')][0x2]);var QUERY=process[_0xac92('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x37b70a,_0x4bcf2d){var _0x45fc17={'status':_0x37b70a};var _0x556459={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bcf2d){_0x45fc17[_0xac92('0xa')]=_0x4bcf2d;}return db[_0xac92('0xb')][_0xac92('0xc')](_0x45fc17,_0x556459);}function main(){var _0x573f2b=0x1388;var _0x222289;logger[_0xac92('0xd')](util[_0xac92('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xac92('0xf')));return db[_0xac92('0x10')][_0xac92('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xac92('0x12')]})[_0xac92('0x13')](function(_0x519e9d){if(_0x519e9d){_0x222289=_0x519e9d;_0x573f2b=_0x222289[_0xac92('0x12')]||0x1388;}})[_0xac92('0x13')](function(){return dbH[_0xac92('0x14')][_0xac92('0x15')](util[_0xac92('0xe')](_0xac92('0x16'),QUERY),{'type':dbH[_0xac92('0x14')]['QueryTypes'][_0xac92('0x17')]});})['then'](function(_0x57d301){if(!_0x57d301[0x0][_0xac92('0x18')]){return analyticExtractedReport('Empty');}var _0x229891=[];var _0x5c2cc0=0x0;var _0x42b6ad=!![];if(_0x222289[_0xac92('0x19')]){if(_0x57d301&&_0x57d301['length']){var _0x3cb8a6=_0x57d301[0x0][_0xac92('0x18')]%(_0x5c2cc0+_0x573f2b);for(;_0x42b6ad;_0x5c2cc0+=_0x573f2b,_0x3cb8a6=_0x57d301[0x0][_0xac92('0x18')]%(_0x5c2cc0+_0x573f2b)){if(_0x3cb8a6==0x0||_0x3cb8a6==_0x57d301[0x0][_0xac92('0x18')]){_0x42b6ad=![];}_0x229891['push'](dbH[_0xac92('0x14')][_0xac92('0x15')](util[_0xac92('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x573f2b,_0x5c2cc0),{'type':dbH[_0xac92('0x14')]['QueryTypes'][_0xac92('0x17')]}));}}}else{_0x229891[_0xac92('0x1a')](dbH[_0xac92('0x14')]['query'](QUERY,{'type':dbH[_0xac92('0x14')][_0xac92('0x1b')]['SELECT']}));}var _0x4f2229=path[_0xac92('0x1c')](PATH);var _0x83084b=path[_0xac92('0x1d')](PATH,_0xac92('0x1e'));var _0x5f0c31=_0x222289['split']&&_0x229891[_0xac92('0x1f')]>0x1;var _0x2b016f=[];if(!fs[_0xac92('0x20')](path[_0xac92('0x21')](_0x4f2229,_0x83084b))&&_0x5f0c31){fs[_0xac92('0x22')](path[_0xac92('0x21')](_0x4f2229,_0x83084b));}return BPromise['each'](_0x229891,function(_0x920675){_0x2b016f[_0xac92('0x1a')](_0x920675);})[_0xac92('0x13')](function(){for(var _0x369833=0x0;_0x369833<_0x2b016f[_0xac92('0x1f')];_0x369833+=0x1){var _0x237df1;var _0x1b90bc=_0x2b016f[_0x369833];if(_0x5f0c31){_0x237df1=path[_0xac92('0x21')](_0x4f2229,_0x83084b,util['format'](_0xac92('0x23'),_0x83084b,_0x369833,_0xac92('0x24')));}else{_0x237df1=path[_0xac92('0x21')](_0x4f2229,util['format'](_0xac92('0x25'),_0x83084b,'xlsx'));}fs[_0xac92('0x26')](_0x237df1,json2xls(_0x1b90bc),_0xac92('0x27'));}})['then'](function(){if(_0x5f0c31){zipdir(path[_0xac92('0x21')](_0x4f2229,_0x83084b),{'saveTo':path['join'](_0x4f2229,util['format'](_0xac92('0x25'),_0x83084b,_0xac92('0x28')))},function(_0xb2a88f,_0x48e25e){});rimraf(path[_0xac92('0x21')](_0x4f2229,_0x83084b),function(){});}})[_0xac92('0x13')](function(){logger['info'](util[_0xac92('0xe')](_0xac92('0x29'),EXTRACTED_REPORT_ID,_0xac92('0xf')));return analyticExtractedReport(_0xac92('0x2a'),_0x5f0c31?util[_0xac92('0xe')](_0xac92('0x25'),_0x83084b,_0x5f0c31?_0xac92('0x28'):_0xac92('0x24')):null);});})[_0xac92('0x2b')](function(_0x397b53){logger['info'](util['format'](_0xac92('0x2c'),EXTRACTED_REPORT_ID,_0xac92('0xf')),util[_0xac92('0x2d')](_0x397b53,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 0bb4d67..5c384c4 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 _0xf981=['filter','exten','queue','priority','extensions','extension','find','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','push','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','*,*,*,*','IntervalId','intervals','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','then','models','VoiceExtension','findAll','uniq','map','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x5e2720,_0x252cc4){var _0xf804ca=function(_0x9944e8){while(--_0x9944e8){_0x5e2720['push'](_0x5e2720['shift']());}};_0xf804ca(++_0x252cc4);}(_0xf981,0x1a6));var _0x1f98=function(_0x3a374c,_0x420af9){_0x3a374c=_0x3a374c-0x0;var _0x14a064=_0xf981[_0x3a374c];return _0x14a064;};'use strict';var _=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));function rewrite(_0x549474,_0x1534d6){var _0x3cd64=this;return _0x549474['models'][_0x1f98('0x2')]['findAll']({'raw':!![]})[_0x1f98('0x3')](function(_0x480277){_0x3cd64['intervals']=_0x480277;return _0x549474[_0x1f98('0x4')][_0x1f98('0x5')][_0x1f98('0x6')]({'where':{'IntervalId':_0x1534d6['IntervalId']},'raw':!![]});})[_0x1f98('0x3')](function(_0x3bbd5b){return _0x549474[_0x1f98('0x4')][_0x1f98('0x5')][_0x1f98('0x6')]({'where':{'exten':{'$in':_[_0x1f98('0x7')](_[_0x1f98('0x8')](_0x3bbd5b,'exten'))}},'order':[{'raw':_0x1f98('0x9')}],'raw':!![]});})['then'](function(_0x480f27){var _0x19bd8b=_[_0x1f98('0xa')](_0x480f27,{'priority':'1'});var _0x2e4c7b=_[_0x1f98('0xa')](_0x480f27,{'isApp':0x1});var _0x47f342=_['groupBy'](_0x2e4c7b,_0x1f98('0xb'));var _0x4f2eae=[_0x1f98('0xc'),'playback'];var _0x13a77f=[];var _0xff3ecb=[];for(var _0x7a3f68 in _0x47f342){if(_0x47f342['hasOwnProperty'](_0x7a3f68)){_0x3cd64[_0x1f98('0xd')]=0x2;_0x3cd64[_0x1f98('0xe')]=[];_0x3cd64[_0x1f98('0xf')]=_[_0x1f98('0x10')](_0x19bd8b,{'exten':_0x47f342[_0x7a3f68][0x0]['exten']});_0x3cd64[_0x1f98('0xe')]['push']({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':util[_0x1f98('0x13')](_0x1f98('0x14'),_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')]),'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});if(_0x47f342[_0x7a3f68][0x0]['type']===_0x1f98('0x17')){if(_0x3cd64[_0x1f98('0xf')]){_0x3cd64[_0x1f98('0xe')]['push']({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':'Set','appdata':_0x1f98('0x18')+(_0x3cd64[_0x1f98('0xf')][_0x1f98('0x19')]?_0x1f98('0x1a')+_0x3cd64[_0x1f98('0xf')][_0x1f98('0x19')]+'}':_0x1f98('0x1b')),'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0]['VoiceExtensionId']});}_0x3cd64['extensions'][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x1f98('0x1d')+_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')],'context':_0x47f342[_0x7a3f68][0x0]['context'],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});var _0x37e5b9=_0x3cd64[_0x1f98('0xd')]++;_0x3cd64['extensions'][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':'ExecIf','appdata':_0x1f98('0x1e')+(_0x37e5b9+0x2)+_0x1f98('0x1f')+(_0x37e5b9+0x1)+')','context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x37e5b9,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});if(_0x3cd64[_0x1f98('0xf')]){_0x3cd64[_0x1f98('0xe')][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x3cd64[_0x1f98('0xf')][_0x1f98('0x19')]?'CDR(prefix)=${EXTEN:0:'+_0x3cd64[_0x1f98('0xf')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0]['VoiceExtensionId']});}_0x3cd64['extensions'][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x1f98('0x20')+_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')],'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});if(_0x3cd64[_0x1f98('0xf')]&&_0x3cd64[_0x1f98('0xf')][_0x1f98('0x21')](_0x1f98('0x22'))&&_0x3cd64['extension'][_0x1f98('0x22')]!==_0x1f98('0x23')){_0x3cd64[_0x1f98('0xe')][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x1f98('0x24'),'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});_0x3cd64[_0x1f98('0xe')][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':'Set','appdata':_0x1f98('0x25')+_0x3cd64[_0x1f98('0xf')]['recordingFormat']||'wav','context':_0x47f342[_0x7a3f68][0x0]['context'],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});}}_0x3cd64[_0x1f98('0xe')][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x1f98('0x26'),'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0]['VoiceExtensionId']});_0x3cd64['extensions'][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x1f98('0x27'),'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0]['exten'],'priority':_0x3cd64['priority']++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});_0x3cd64[_0x1f98('0xe')][_0x1f98('0x1c')]({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x1f98('0x28'),'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'exten':_0x47f342[_0x7a3f68][0x0][_0x1f98('0xb')],'priority':_0x3cd64[_0x1f98('0xd')]++,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});for(var _0x130c16=0x0,_0xf88342=0x0;_0x130c16<_0x47f342[_0x7a3f68][_0x1f98('0x29')];_0x130c16+=0x1,_0xf88342=0x0){var _0x317a38=_0x47f342[_0x7a3f68][_0x130c16];if(_0x317a38[_0x1f98('0x11')]){_0x317a38[_0x1f98('0x11')]=_0x317a38[_0x1f98('0x11')]['toLowerCase']();}var _0x46624f=[];var _0x3ba851=[];delete _0x317a38['id'];delete _0x317a38[_0x1f98('0x2a')];delete _0x317a38['updatedAt'];var _0x3e4384=_0x317a38[_0x1f98('0x2b')]!==_0x1f98('0x2c')?[_0x317a38[_0x1f98('0x2b')]]:_0x317a38[_0x1f98('0x2d')]?_[_0x1f98('0x8')](_[_0x1f98('0xa')](_0x3cd64[_0x1f98('0x2e')],{'IntervalId':_0x317a38[_0x1f98('0x2d')]}),_0x1f98('0x2b')):[];if(_0x317a38[_0x1f98('0x21')](_0x1f98('0x2f'))){if(_0x317a38[_0x1f98('0x2f')]&&_0x317a38[_0x1f98('0x2f')]!=='--'){_0x46624f[_0x1f98('0x1c')]({'type':_0x317a38[_0x1f98('0x11')],'app':_0x1f98('0x12'),'appdata':_0x1f98('0x30')+_0x317a38[_0x1f98('0x2f')],'context':_0x317a38[_0x1f98('0x15')],'exten':_0x317a38[_0x1f98('0xb')],'priority':_0x3e4384[_0x1f98('0x29')]+_0x3cd64[_0x1f98('0xd')]+_0xf88342++,'VoiceExtensionId':_0x317a38[_0x1f98('0x16')]});}}if(_0x317a38[_0x1f98('0x11')]===_0x1f98('0x17')&&_0x317a38['hasOwnProperty']('callerID')){if(_0x317a38[_0x1f98('0x31')]){_0x46624f[_0x1f98('0x1c')]({'type':_0x317a38[_0x1f98('0x11')],'app':_0x1f98('0x32'),'appdata':_0x1f98('0x33')+_0x317a38['callerID']+')','context':_0x317a38['context'],'exten':_0x317a38[_0x1f98('0xb')],'priority':_0x3e4384['length']+_0x3cd64[_0x1f98('0xd')]+_0xf88342++,'VoiceExtensionId':_0x317a38[_0x1f98('0x16')]});}else{_0x46624f[_0x1f98('0x1c')]({'type':_0x317a38[_0x1f98('0x11')],'app':_0x1f98('0x32'),'appdata':_0x1f98('0x34'),'context':_0x317a38[_0x1f98('0x15')],'exten':_0x317a38['exten'],'priority':_0x3e4384[_0x1f98('0x29')]+_0x3cd64['priority']+_0xf88342++,'VoiceExtensionId':_0x317a38[_0x1f98('0x16')]});}}if(_0x317a38[_0x1f98('0x21')](_0x1f98('0x35'))){if(_0x4f2eae[_0x1f98('0x36')](_0x317a38[_0x1f98('0x37')][_0x1f98('0x38')]())>=0x0&&_0x317a38[_0x1f98('0x39')]!==_0x1f98('0x3a')){if(_0x317a38['answer']){_0x46624f['push']({'type':_0x317a38[_0x1f98('0x11')],'app':_0x1f98('0x32'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x317a38['context'],'exten':_0x317a38[_0x1f98('0xb')],'priority':_0x3e4384['length']+_0x3cd64[_0x1f98('0xd')]+_0xf88342++,'VoiceExtensionId':_0x317a38[_0x1f98('0x16')]});_0x46624f['push']({'type':_0x317a38['type'],'app':'Set','appdata':_0x1f98('0x3b'),'context':_0x317a38['context'],'exten':_0x317a38['exten'],'priority':_0x3e4384['length']+_0x3cd64[_0x1f98('0xd')]+_0xf88342++,'VoiceExtensionId':_0x317a38['VoiceExtensionId']});}else{_0x46624f[_0x1f98('0x1c')]({'type':_0x317a38[_0x1f98('0x11')],'app':_0x1f98('0x32'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x317a38['context'],'exten':_0x317a38[_0x1f98('0xb')],'priority':_0x3e4384[_0x1f98('0x29')]+_0x3cd64['priority']+_0xf88342++,'VoiceExtensionId':_0x317a38[_0x1f98('0x16')]});_0x46624f[_0x1f98('0x1c')]({'type':_0x317a38['type'],'app':_0x1f98('0x12'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x317a38[_0x1f98('0x15')],'exten':_0x317a38[_0x1f98('0xb')],'priority':_0x3e4384[_0x1f98('0x29')]+_0x3cd64[_0x1f98('0xd')]+_0xf88342++,'VoiceExtensionId':_0x317a38[_0x1f98('0x16')]});}}}for(var _0x4788ec=0x0;_0x4788ec<_0x3e4384[_0x1f98('0x29')];_0x4788ec+=0x1){var _0x15be05=_0x3cd64[_0x1f98('0xd')]+_0x3e4384['length'];var _0x1190dd=_0x4788ec===_0x3e4384['length']-0x1?_0x3cd64[_0x1f98('0xd')]+_0x46624f['length']+_0x3ba851[_0x1f98('0x29')]+0x2:_0x3cd64['priority']+_0x4788ec+0x1;_0x46624f[_0x1f98('0x3c')](_0x4788ec,0x0,{'type':_0x317a38[_0x1f98('0x11')],'app':_0x1f98('0x3d'),'appdata':_0x3e4384[_0x4788ec]+'?'+_0x317a38[_0x1f98('0x15')]+_0x1f98('0x3e')+_0x15be05+':'+_0x317a38['context']+',${EXTEN},'+_0x1190dd,'exten':_0x317a38['exten'],'context':_0x317a38[_0x1f98('0x15')],'priority':_0x3cd64[_0x1f98('0xd')]+_0x4788ec,'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});}_0x317a38[_0x1f98('0xd')]=_0x46624f[_0x1f98('0x29')]?_[_0x1f98('0x3f')](_0x46624f)[_0x1f98('0xd')]+0x1:_0x3cd64['priority'];_0x3cd64[_0x1f98('0xd')]=(_0x3ba851[_0x1f98('0x29')]?_[_0x1f98('0x3f')](_0x3ba851)['priority']:_0x317a38[_0x1f98('0xd')])+0x1;_0x3cd64['extensions']=_[_0x1f98('0x40')](_0x3cd64[_0x1f98('0xe')],_0x46624f,[_0x317a38],_0x3ba851);}_0x3cd64[_0x1f98('0xe')]['push']({'type':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x11')],'app':'Hangup','exten':_0x47f342[_0x7a3f68][0x0]['exten'],'context':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x15')],'priority':_0x3cd64[_0x1f98('0xd')],'VoiceExtensionId':_0x47f342[_0x7a3f68][0x0][_0x1f98('0x16')]});_0x13a77f['push'](_0x47f342[_0x7a3f68][0x0]['VoiceExtensionId']);_0xff3ecb=_[_0x1f98('0x40')](_0xff3ecb,_0x3cd64[_0x1f98('0xe')]);}}return _0x549474[_0x1f98('0x41')](function(_0x2dbfd7){return _0x549474[_0x1f98('0x4')][_0x1f98('0x5')][_0x1f98('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x13a77f}},'transaction':_0x2dbfd7})[_0x1f98('0x3')](function(_0x14c0e9){return _0x549474[_0x1f98('0x4')][_0x1f98('0x5')][_0x1f98('0x43')](_[_0x1f98('0x44')](_0xff3ecb,_0x1f98('0xd')),{'transaction':_0x2dbfd7});});});})[_0x1f98('0x45')](function(_0x52373a){console[_0x1f98('0x46')](_0x52373a);});}exports[_0x1f98('0x47')]=rewrite; \ No newline at end of file +var _0x5a9e=['error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority','extensions','extension','find','push','Set','CDR(type)=%s','type','VoiceExtensionId','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','context','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','*,*,*,*','interval','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy'];(function(_0x1cec51,_0x357cf6){var _0x43a186=function(_0x26d3ff){while(--_0x26d3ff){_0x1cec51['push'](_0x1cec51['shift']());}};_0x43a186(++_0x357cf6);}(_0x5a9e,0x11e));var _0xe5a9=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x5a9e[_0x2d982d];return _0x4f36b0;};'use strict';var _=require(_0xe5a9('0x0'));var util=require(_0xe5a9('0x1'));function rewrite(_0x1bc63d,_0x5afa08){var _0x1291da=this;return _0x1bc63d[_0xe5a9('0x2')]['Interval'][_0xe5a9('0x3')]({'raw':!![]})[_0xe5a9('0x4')](function(_0x517dc9){_0x1291da[_0xe5a9('0x5')]=_0x517dc9;return _0x1bc63d[_0xe5a9('0x2')][_0xe5a9('0x6')][_0xe5a9('0x3')]({'where':{'IntervalId':_0x5afa08[_0xe5a9('0x7')]},'raw':!![]});})[_0xe5a9('0x4')](function(_0x46af12){return _0x1bc63d[_0xe5a9('0x2')][_0xe5a9('0x6')][_0xe5a9('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0xe5a9('0x8')](_0x46af12,_0xe5a9('0x9')))}},'order':[{'raw':_0xe5a9('0xa')}],'raw':!![]});})[_0xe5a9('0x4')](function(_0x35019d){var _0x21650e=_[_0xe5a9('0xb')](_0x35019d,{'priority':'1'});var _0x1f5f2d=_[_0xe5a9('0xb')](_0x35019d,{'isApp':0x1});var _0x48c26a=_[_0xe5a9('0xc')](_0x1f5f2d,_0xe5a9('0x9'));var _0x5cb3b3=['queue',_0xe5a9('0xd')];var _0x13cdc7=[];var _0x57cabc=[];for(var _0x347f1c in _0x48c26a){if(_0x48c26a['hasOwnProperty'](_0x347f1c)){_0x1291da[_0xe5a9('0xe')]=0x2;_0x1291da[_0xe5a9('0xf')]=[];_0x1291da[_0xe5a9('0x10')]=_[_0xe5a9('0x11')](_0x21650e,{'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')]});_0x1291da['extensions'][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0]['type'],'app':_0xe5a9('0x13'),'appdata':util['format'](_0xe5a9('0x14'),_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')]),'context':_0x48c26a[_0x347f1c][0x0]['context'],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da['priority']++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});if(_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')]==='outbound'){if(_0x1291da[_0xe5a9('0x10')]){_0x1291da['extensions']['push']({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':_0xe5a9('0x17')+(_0x1291da['extension']['cutdigits']?_0xe5a9('0x18')+_0x1291da[_0xe5a9('0x10')][_0xe5a9('0x19')]+'}':_0xe5a9('0x1a')),'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da[_0xe5a9('0xe')]++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0]['VoiceExtensionId']});}_0x1291da[_0xe5a9('0xf')][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':'CDR(routeid)='+_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')],'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0]['exten'],'priority':_0x1291da['priority']++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});var _0x15da61=_0x1291da[_0xe5a9('0xe')]++;_0x1291da['extensions'][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':'ExecIf','appdata':_0xe5a9('0x1c')+(_0x15da61+0x2)+_0xe5a9('0x1d')+(_0x15da61+0x1)+')','context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x15da61,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});if(_0x1291da[_0xe5a9('0x10')]){_0x1291da[_0xe5a9('0xf')][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':'Set','appdata':_0x1291da['extension'][_0xe5a9('0x19')]?_0xe5a9('0x1e')+_0x1291da[_0xe5a9('0x10')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da[_0xe5a9('0xe')]++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});}_0x1291da['extensions'][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':_0xe5a9('0x1f')+_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')],'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da[_0xe5a9('0xe')]++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});if(_0x1291da['extension']&&_0x1291da[_0xe5a9('0x10')][_0xe5a9('0x20')](_0xe5a9('0x21'))&&_0x1291da[_0xe5a9('0x10')][_0xe5a9('0x21')]!==_0xe5a9('0x22')){_0x1291da[_0xe5a9('0xf')][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':'Set','appdata':_0xe5a9('0x23'),'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da[_0xe5a9('0xe')]++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0]['VoiceExtensionId']});_0x1291da['extensions'][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0]['type'],'app':_0xe5a9('0x13'),'appdata':_0xe5a9('0x24')+_0x1291da['extension'][_0xe5a9('0x21')]||_0xe5a9('0x25'),'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da[_0xe5a9('0xe')]++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});}}_0x1291da[_0xe5a9('0xf')][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':_0xe5a9('0x26'),'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da[_0xe5a9('0xe')]++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});_0x1291da['extensions'][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0]['type'],'app':'Set','appdata':_0xe5a9('0x27'),'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da['priority']++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});_0x1291da['extensions'][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':_0xe5a9('0x28'),'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'exten':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x9')],'priority':_0x1291da[_0xe5a9('0xe')]++,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});for(var _0x46bd08=0x0,_0x56fa9e=0x0;_0x46bd08<_0x48c26a[_0x347f1c][_0xe5a9('0x29')];_0x46bd08+=0x1,_0x56fa9e=0x0){var _0xec7966=_0x48c26a[_0x347f1c][_0x46bd08];if(_0xec7966[_0xe5a9('0x15')]){_0xec7966[_0xe5a9('0x15')]=_0xec7966['type'][_0xe5a9('0x2a')]();}var _0x1628d5=[];var _0x7eb280=[];delete _0xec7966['id'];delete _0xec7966['createdAt'];delete _0xec7966['updatedAt'];var _0x40c79b=_0xec7966['interval']!==_0xe5a9('0x2b')?[_0xec7966[_0xe5a9('0x2c')]]:_0xec7966['IntervalId']?_['map'](_[_0xe5a9('0xb')](_0x1291da[_0xe5a9('0x5')],{'IntervalId':_0xec7966['IntervalId']}),_0xe5a9('0x2c')):[];if(_0xec7966[_0xe5a9('0x20')]('tag')){if(_0xec7966[_0xe5a9('0x2d')]&&_0xec7966[_0xe5a9('0x2d')]!=='--'){_0x1628d5['push']({'type':_0xec7966[_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':'CDR(tag)='+_0xec7966[_0xe5a9('0x2d')],'context':_0xec7966['context'],'exten':_0xec7966['exten'],'priority':_0x40c79b[_0xe5a9('0x29')]+_0x1291da[_0xe5a9('0xe')]+_0x56fa9e++,'VoiceExtensionId':_0xec7966['VoiceExtensionId']});}}if(_0xec7966['type']==='outbound'&&_0xec7966[_0xe5a9('0x20')](_0xe5a9('0x2e'))){if(_0xec7966[_0xe5a9('0x2e')]){_0x1628d5[_0xe5a9('0x12')]({'type':_0xec7966[_0xe5a9('0x15')],'app':_0xe5a9('0x2f'),'appdata':_0xe5a9('0x30')+_0xec7966[_0xe5a9('0x2e')]+')','context':_0xec7966[_0xe5a9('0x1b')],'exten':_0xec7966[_0xe5a9('0x9')],'priority':_0x40c79b['length']+_0x1291da['priority']+_0x56fa9e++,'VoiceExtensionId':_0xec7966[_0xe5a9('0x16')]});}else{_0x1628d5[_0xe5a9('0x12')]({'type':_0xec7966[_0xe5a9('0x15')],'app':_0xe5a9('0x2f'),'appdata':_0xe5a9('0x31'),'context':_0xec7966[_0xe5a9('0x1b')],'exten':_0xec7966[_0xe5a9('0x9')],'priority':_0x40c79b[_0xe5a9('0x29')]+_0x1291da[_0xe5a9('0xe')]+_0x56fa9e++,'VoiceExtensionId':_0xec7966[_0xe5a9('0x16')]});}}if(_0xec7966[_0xe5a9('0x20')](_0xe5a9('0x32'))){if(_0x5cb3b3[_0xe5a9('0x33')](_0xec7966[_0xe5a9('0x34')][_0xe5a9('0x2a')]())>=0x0&&_0xec7966[_0xe5a9('0x35')]!==_0xe5a9('0x36')){if(_0xec7966[_0xe5a9('0x32')]){_0x1628d5[_0xe5a9('0x12')]({'type':_0xec7966[_0xe5a9('0x15')],'app':_0xe5a9('0x2f'),'appdata':_0xe5a9('0x37'),'context':_0xec7966[_0xe5a9('0x1b')],'exten':_0xec7966[_0xe5a9('0x9')],'priority':_0x40c79b[_0xe5a9('0x29')]+_0x1291da[_0xe5a9('0xe')]+_0x56fa9e++,'VoiceExtensionId':_0xec7966['VoiceExtensionId']});_0x1628d5[_0xe5a9('0x12')]({'type':_0xec7966[_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':_0xe5a9('0x38'),'context':_0xec7966['context'],'exten':_0xec7966[_0xe5a9('0x9')],'priority':_0x40c79b['length']+_0x1291da['priority']+_0x56fa9e++,'VoiceExtensionId':_0xec7966[_0xe5a9('0x16')]});}else{_0x1628d5[_0xe5a9('0x12')]({'type':_0xec7966[_0xe5a9('0x15')],'app':'ExecIf','appdata':_0xe5a9('0x39'),'context':_0xec7966[_0xe5a9('0x1b')],'exten':_0xec7966['exten'],'priority':_0x40c79b['length']+_0x1291da[_0xe5a9('0xe')]+_0x56fa9e++,'VoiceExtensionId':_0xec7966[_0xe5a9('0x16')]});_0x1628d5[_0xe5a9('0x12')]({'type':_0xec7966[_0xe5a9('0x15')],'app':_0xe5a9('0x13'),'appdata':_0xe5a9('0x3a'),'context':_0xec7966[_0xe5a9('0x1b')],'exten':_0xec7966['exten'],'priority':_0x40c79b[_0xe5a9('0x29')]+_0x1291da[_0xe5a9('0xe')]+_0x56fa9e++,'VoiceExtensionId':_0xec7966[_0xe5a9('0x16')]});}}}for(var _0x58b6df=0x0;_0x58b6df<_0x40c79b['length'];_0x58b6df+=0x1){var _0x5f3a47=_0x1291da[_0xe5a9('0xe')]+_0x40c79b[_0xe5a9('0x29')];var _0x3310ee=_0x58b6df===_0x40c79b[_0xe5a9('0x29')]-0x1?_0x1291da['priority']+_0x1628d5['length']+_0x7eb280[_0xe5a9('0x29')]+0x2:_0x1291da[_0xe5a9('0xe')]+_0x58b6df+0x1;_0x1628d5[_0xe5a9('0x3b')](_0x58b6df,0x0,{'type':_0xec7966[_0xe5a9('0x15')],'app':_0xe5a9('0x3c'),'appdata':_0x40c79b[_0x58b6df]+'?'+_0xec7966[_0xe5a9('0x1b')]+_0xe5a9('0x3d')+_0x5f3a47+':'+_0xec7966[_0xe5a9('0x1b')]+_0xe5a9('0x3d')+_0x3310ee,'exten':_0xec7966[_0xe5a9('0x9')],'context':_0xec7966['context'],'priority':_0x1291da[_0xe5a9('0xe')]+_0x58b6df,'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x16')]});}_0xec7966[_0xe5a9('0xe')]=_0x1628d5[_0xe5a9('0x29')]?_[_0xe5a9('0x3e')](_0x1628d5)['priority']+0x1:_0x1291da['priority'];_0x1291da['priority']=(_0x7eb280[_0xe5a9('0x29')]?_[_0xe5a9('0x3e')](_0x7eb280)[_0xe5a9('0xe')]:_0xec7966[_0xe5a9('0xe')])+0x1;_0x1291da[_0xe5a9('0xf')]=_['concat'](_0x1291da[_0xe5a9('0xf')],_0x1628d5,[_0xec7966],_0x7eb280);}_0x1291da[_0xe5a9('0xf')][_0xe5a9('0x12')]({'type':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x15')],'app':_0xe5a9('0x3f'),'exten':_0x48c26a[_0x347f1c][0x0]['exten'],'context':_0x48c26a[_0x347f1c][0x0][_0xe5a9('0x1b')],'priority':_0x1291da['priority'],'VoiceExtensionId':_0x48c26a[_0x347f1c][0x0]['VoiceExtensionId']});_0x13cdc7[_0xe5a9('0x12')](_0x48c26a[_0x347f1c][0x0]['VoiceExtensionId']);_0x57cabc=_[_0xe5a9('0x40')](_0x57cabc,_0x1291da[_0xe5a9('0xf')]);}}return _0x1bc63d[_0xe5a9('0x41')](function(_0x498405){return _0x1bc63d[_0xe5a9('0x2')][_0xe5a9('0x6')][_0xe5a9('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x13cdc7}},'transaction':_0x498405})[_0xe5a9('0x4')](function(_0x5c45ec){return _0x1bc63d[_0xe5a9('0x2')][_0xe5a9('0x6')][_0xe5a9('0x43')](_[_0xe5a9('0x44')](_0x57cabc,_0xe5a9('0xe')),{'transaction':_0x498405});});});})['catch'](function(_0x51cce8){console[_0xe5a9('0x45')](_0x51cce8);});}exports[_0xe5a9('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index f4bc94c..f268c8f 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 _0x1179=['CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','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','CompanyId','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','inspect','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_contacts','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info'];(function(_0x5df0dc,_0x30e015){var _0x15c095=function(_0x5792a0){while(--_0x5792a0){_0x5df0dc['push'](_0x5df0dc['shift']());}};_0x15c095(++_0x30e015);}(_0x1179,0xeb));var _0x9117=function(_0x5f5c56,_0x268bff){_0x5f5c56=_0x5f5c56-0x0;var _0x50cdbb=_0x1179[_0x5f5c56];return _0x50cdbb;};'use strict';var BPromise=require(_0x9117('0x0'));var util=require(_0x9117('0x1'));var _=require(_0x9117('0x2'));var fs=require('fs');var squel=require(_0x9117('0x3'));var Papa=require(_0x9117('0x4'));var Redis=require(_0x9117('0x5'));var db=require(_0x9117('0x6'))['db'];var config=require(_0x9117('0x7'));var logger=require(_0x9117('0x8'))('api');config[_0x9117('0x9')]=_[_0x9117('0xa')](config[_0x9117('0x9')],{'host':_0x9117('0xb'),'port':0x18eb});var socket=require(_0x9117('0xc'))(new Redis(config[_0x9117('0x9')]));require(_0x9117('0xd'))[_0x9117('0xe')](socket);try{if(!process[_0x9117('0xf')][0x2]||process[_0x9117('0xf')][0x2]==='undefined'||process[_0x9117('0xf')][0x2]===_0x9117('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x9117('0xf')][0x2];if(!process[_0x9117('0xf')][0x3]||process[_0x9117('0xf')][0x3]==='undefined'||process[_0x9117('0xf')][0x3]==='null'||!process['argv'][0x4]||process[_0x9117('0xf')][0x4]===_0x9117('0x11')||process[_0x9117('0xf')][0x4]===_0x9117('0x10')){throw new Error(_0x9117('0x12'));}var FIELDS=_[_0x9117('0x13')](process[_0x9117('0xf')][0x3][_0x9117('0x14')](','),process[_0x9117('0xf')][0x4]['split'](','));if(!process[_0x9117('0xf')][0x5]||process['argv'][0x5]===_0x9117('0x11')||process['argv'][0x5]===_0x9117('0x10')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x9117('0xf')][0x5];var COMPANYID=process[_0x9117('0xf')][0x6]&&process[_0x9117('0xf')][0x6]!==_0x9117('0x11')&&process['argv'][0x6]!==_0x9117('0x10')?process[_0x9117('0xf')][0x6]:null;var DUPLICATES=process[_0x9117('0xf')][0x7]&&process[_0x9117('0xf')][0x7]!==_0x9117('0x11')&&process[_0x9117('0xf')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x9117('0xf')][0x8]===_0x9117('0x11')||process[_0x9117('0xf')][0x8]==='null'){throw new Error(_0x9117('0x15'));}var SOCKET_TIMESTAMP=process[_0x9117('0xf')][0x8];}catch(_0x2016e6){logger[_0x9117('0x16')](_0x2016e6);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(_0x17a152,_0x425707,_0x371ca2,_0x32f160){var _0x5450ee={'message':_0x425707};_0x5450ee[_0x17a152]=!![];if(_0x371ca2){_0x5450ee[_0x9117('0x17')]=_0x371ca2;}if(_0x32f160){_0x5450ee[_0x9117('0x18')]=_0x32f160;}return _0x5450ee;}function isEmail(_0x542775){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))*$/[_0x9117('0x19')](_0x542775);}function checkRow(_0x2b1d22,_0x2500a2,_0x53a73f){return new BPromise(function(_0x22197f,_0x27f028){if(_['isNil'](_0x2b1d22)){return _0x27f028(handleCheckRowError(_0x9117('0x16'),_0x9117('0x1a'),null,_0x53a73f));}if(_0x2b1d22['errors']&&_0x2b1d22[_0x9117('0x1b')][_0x9117('0x1c')]){var _0x3f04a9=_[_0x9117('0x1d')](_0x2b1d22['errors'],_0x9117('0x1e'))[_0x9117('0x1f')](';');return _0x27f028(handleCheckRowError(_0x9117('0x16'),_0x3f04a9,null,_0x53a73f));}var _0x3d790b={};for(var _0x28307a in FIELDS){if(FIELDS[_0x9117('0x20')](_0x28307a)&&FIELDS[_0x28307a]){_0x3d790b[_0x28307a]=_0x2b1d22[_0x9117('0x21')][0x0][FIELDS[_0x28307a]]||_0x2b1d22['data'][0x0]['\ufeff'+FIELDS[_0x28307a]];}}if(!_0x3d790b[_0x9117('0x22')]){return _0x27f028(handleCheckRowError(_0x9117('0x16'),'firstName\x20not\x20specified!',null,_0x53a73f));}if(!_0x3d790b['phone']){return _0x27f028(handleCheckRowError(_0x9117('0x16'),_0x9117('0x23'),null,_0x53a73f));}if(_0x3d790b[_0x9117('0x24')]){var _0x11b71e=moment(_0x3d790b[_0x9117('0x24')],_0x9117('0x25'));if(!_0x11b71e[_0x9117('0x26')]()){return _0x27f028(handleCheckRowError(_0x9117('0x16'),_0x9117('0x27'),null,_0x53a73f));}}if(_0x3d790b[_0x9117('0x28')]){if(!isEmail(_0x3d790b['email'])){return _0x27f028(handleCheckRowError(_0x9117('0x16'),_0x9117('0x29'),null,_0x53a73f));}}_0x3d790b[_0x9117('0x2a')]=LISTID;_0x3d790b[_0x9117('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9117('0x1c')]&&_0x2500a2){var _0x43f1a4={};for(var _0x2de0e6=0x0,_0x241780=DUPLICATES['length'];_0x2de0e6<_0x241780;_0x2de0e6+=0x1){_0x43f1a4[DUPLICATES[_0x2de0e6]]=_0x3d790b[DUPLICATES[_0x2de0e6]];}var _0x4bd73a=_['find'](_0x2500a2,_0x43f1a4);if(_0x4bd73a){return _0x27f028(handleCheckRowError(_0x9117('0x2c'),_0x9117('0x2d'),_0x4bd73a,_0x53a73f));}}return db[_0x9117('0x2e')]['create'](_0x3d790b,{'raw':!![],'hooks':![],'fields':_[_0x9117('0x2f')](_0x3d790b)})[_0x9117('0x30')](function(_0x31bc9d){if(DUPLICATES&&DUPLICATES[_0x9117('0x1c')]&&_0x2500a2){_0x2500a2[_0x9117('0x31')](_[_0x9117('0x32')](_0x3d790b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x31bc9d['id'];return _0x22197f();})[_0x9117('0x33')](function(_0x4145c2){return _0x27f028(handleCheckRowError(_0x9117('0x16'),_0x9117('0x34')+(_0x4145c2[_0x9117('0x1e')]||JSON['stringify'](_0x4145c2)),null,_0x53a73f));});});}function checkHopper(){function _0x4812c6(){return function(_0xcf189){logger['error'](_0x9117('0x35'),'checkHopper',util[_0x9117('0x36')](_0xcf189,{'showHidden':![],'depth':null}));};}var _0x495153=function(_0x193332,_0x52e63f){var _0x2ac34a=squel[_0x9117('0x37')]()[_0x9117('0x38')](_0x9117('0x39'))[_0x9117('0x3a')]([_0x9117('0x3b'),_0x9117('0x3c'),_0x9117('0x3d'),'ListId',_0x52e63f,_0x9117('0x3e'),'updatedAt'],squel[_0x9117('0x3f')]()[_0x9117('0x40')]('phone','phone')[_0x9117('0x40')](_0x9117('0x41'),_0x9117('0x3c'))[_0x9117('0x40')]('id',_0x9117('0x3d'))[_0x9117('0x40')](LISTID[_0x9117('0x42')](),_0x9117('0x2a'))['field'](_0x193332['id'][_0x9117('0x42')](),_0x52e63f)[_0x9117('0x40')](_0x9117('0x41'),_0x9117('0x3e'))['field']('NOW()',_0x9117('0x43'))[_0x9117('0x44')]('cm_contacts')['where'](_0x9117('0x45'))['where'](_0x9117('0x46'),LISTID[_0x9117('0x42')]())[_0x9117('0x47')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x9117('0x48'),squel[_0x9117('0x3f')]()[_0x9117('0x40')]('phone')[_0x9117('0x44')]('cm_hopper')[_0x9117('0x47')](_0x52e63f+_0x9117('0x49'),_0x193332['id'][_0x9117('0x42')]())))['toString']();return _0x2ac34a;};var _0x3498e7=function(_0x5cc660,_0x414cca){var _0x34d22d=squel[_0x9117('0x37')]()['into'](_0x9117('0x39'))[_0x9117('0x3a')]([_0x9117('0x3b'),'scheduledAt',_0x9117('0x3d'),_0x9117('0x2a'),_0x414cca,_0x9117('0x3e'),_0x9117('0x43')],squel[_0x9117('0x3f')]()[_0x9117('0x40')](_0x9117('0x3b'),_0x9117('0x3b'))['field'](_0x9117('0x41'),'scheduledAt')[_0x9117('0x40')]('id','ContactId')['field'](LISTID[_0x9117('0x42')](),_0x9117('0x2a'))[_0x9117('0x40')](_0x5cc660['id'][_0x9117('0x42')](),_0x414cca)[_0x9117('0x40')](_0x9117('0x41'),_0x9117('0x3e'))[_0x9117('0x40')](_0x9117('0x41'),'updatedAt')[_0x9117('0x44')](_0x9117('0x4a'))[_0x9117('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0x9117('0x46'),LISTID['toString']())[_0x9117('0x47')]('id\x20IN\x20?',squel[_0x9117('0x4b')](hopperContacts))[_0x9117('0x47')](_0x9117('0x4c'))[_0x9117('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9117('0x3f')]()[_0x9117('0x40')](_0x9117('0x4d'))[_0x9117('0x44')](_0x9117('0x4e'))[_0x9117('0x47')](_0x414cca+_0x9117('0x49'),_0x5cc660['id'][_0x9117('0x42')]()))[_0x9117('0x47')](_0x9117('0x48'),squel[_0x9117('0x3f')]()[_0x9117('0x40')]('phone')[_0x9117('0x44')](_0x9117('0x39'))[_0x9117('0x47')](_0x414cca+_0x9117('0x49'),_0x5cc660['id'][_0x9117('0x42')]())))['toString']();return _0x34d22d;};function _0x440e80(_0x5cdfa3,_0x5cbf9b){var _0x1995e7=squel['insert']()[_0x9117('0x38')](_0x9117('0x39'))[_0x9117('0x3a')]([_0x9117('0x3b'),'scheduledAt',_0x9117('0x3d'),'ListId',_0x5cbf9b,_0x9117('0x3e'),'updatedAt'],squel[_0x9117('0x3f')]()[_0x9117('0x40')](_0x9117('0x3b'),'phone')[_0x9117('0x40')](_0x9117('0x41'),_0x9117('0x3c'))['field']('id',_0x9117('0x3d'))['field'](LISTID['toString'](),_0x9117('0x2a'))['field'](_0x5cdfa3['id'][_0x9117('0x42')](),_0x5cbf9b)[_0x9117('0x40')](_0x9117('0x41'),'createdAt')[_0x9117('0x40')](_0x9117('0x41'),_0x9117('0x43'))[_0x9117('0x44')]('cm_contacts')[_0x9117('0x47')](_0x9117('0x45'))[_0x9117('0x47')](_0x9117('0x46'),LISTID[_0x9117('0x42')]())[_0x9117('0x47')](_0x9117('0x4f'),squel['str'](hopperContacts))[_0x9117('0x47')](_0x9117('0x4c')))['toString']();return _0x1995e7;}function _0x12c267(_0x1d5837,_0x54de5f){var _0x331562=squel[_0x9117('0x37')]()['into'](_0x9117('0x50'))['fromQuery']([_0x9117('0x3b'),_0x9117('0x3d'),_0x9117('0x2a'),_0x54de5f,_0x9117('0x3e'),'updatedAt'],squel[_0x9117('0x3f')]()[_0x9117('0x40')](_0x9117('0x3b'),_0x9117('0x3b'))[_0x9117('0x40')]('id',_0x9117('0x3d'))[_0x9117('0x40')](LISTID['toString'](),'ListId')[_0x9117('0x40')](_0x1d5837['id']['toString'](),_0x54de5f)[_0x9117('0x40')](_0x9117('0x41'),_0x9117('0x3e'))[_0x9117('0x40')]('NOW()',_0x9117('0x43'))[_0x9117('0x44')](_0x9117('0x4a'))[_0x9117('0x47')](_0x9117('0x45'))[_0x9117('0x47')](_0x9117('0x46'),LISTID[_0x9117('0x42')]())[_0x9117('0x47')](_0x9117('0x4f'),squel[_0x9117('0x4b')](hopperContacts))[_0x9117('0x47')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x331562;}return db[_0x9117('0x51')][_0x9117('0x52')]({'where':{'type':_0x9117('0x53')},'attributes':['id',_0x9117('0x54')],'include':[{'model':db[_0x9117('0x55')],'as':_0x9117('0x56'),'where':{'id':LISTID}}]})[_0x9117('0x30')](function(_0xcfa313){var _0xd05e4d=[];if(_0xcfa313){var _0x36a1b3;for(var _0x2bbdcd=0x0,_0x5b3944;_0x2bbdcd<_0xcfa313[_0x9117('0x1c')];_0x2bbdcd+=0x1){_0x5b3944=_0xcfa313[_0x2bbdcd][_0x9117('0x57')]({'plain':!![]});switch(_0x5b3944['dialCheckDuplicateType']){case _0x9117('0x58'):_0xd05e4d['push'](db[_0x9117('0x59')][_0x9117('0x5a')](_0x3498e7(_0x5b3944,_0x9117('0x5b')))['then'](function(){})[_0x9117('0x33')](_0x4812c6()));break;case _0x9117('0x5c'):_0xd05e4d[_0x9117('0x31')](db['sequelize'][_0x9117('0x5a')](_0x495153(_0x5b3944,_0x9117('0x5b')))[_0x9117('0x30')](function(){})[_0x9117('0x33')](_0x4812c6()));break;default:_0xd05e4d[_0x9117('0x31')](db[_0x9117('0x59')][_0x9117('0x5a')](_0x440e80(_0x5b3944,_0x9117('0x5b')))[_0x9117('0x30')](function(){})[_0x9117('0x33')](_0x4812c6()));}}}return _0xd05e4d;})[_0x9117('0x5d')]()[_0x9117('0x30')](function(){return db[_0x9117('0x51')][_0x9117('0x52')]({'where':{'type':_0x9117('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x9117('0x5e'),'where':{'id':LISTID}}]})['then'](function(_0x189510){var _0x41a6c8=[];if(_0x189510){var _0x4604cc;for(var _0x5993c6=0x0,_0x599250;_0x5993c6<_0x189510[_0x9117('0x1c')];_0x5993c6+=0x1){_0x599250=_0x189510[_0x5993c6][_0x9117('0x57')]({'plain':!![]});_0x41a6c8[_0x9117('0x31')](db[_0x9117('0x59')][_0x9117('0x5a')](_0x12c267(_0x599250,_0x9117('0x5b')))[_0x9117('0x30')](function(){})['catch'](_0x4812c6()));}}return _0x41a6c8;})['all']();})[_0x9117('0x30')](function(){return db[_0x9117('0x5f')][_0x9117('0x52')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x9117('0x55')],'as':_0x9117('0x56'),'where':{'id':LISTID}}]})[_0x9117('0x30')](function(_0xde6505){var _0x1c8184=[];if(_0xde6505){for(var _0x58169d=0x0,_0x357f29;_0x58169d<_0xde6505[_0x9117('0x1c')];_0x58169d+=0x1){_0x357f29=_0xde6505[_0x58169d]['get']({'plain':!![]});switch(_0x357f29['dialCheckDuplicateType']){case _0x9117('0x58'):_0x1c8184[_0x9117('0x31')](db[_0x9117('0x59')]['query'](_0x3498e7(_0x357f29,_0x9117('0x60')))[_0x9117('0x30')](function(){})[_0x9117('0x33')](_0x4812c6()));break;case'onlyIfOpen':_0x1c8184['push'](db[_0x9117('0x59')][_0x9117('0x5a')](_0x495153(_0x357f29,_0x9117('0x60')))[_0x9117('0x30')](function(){})[_0x9117('0x33')](_0x4812c6()));break;default:_0x1c8184[_0x9117('0x31')](db['sequelize']['query'](_0x440e80(_0x357f29,'CampaignId'))[_0x9117('0x30')](function(){})['catch'](_0x4812c6()));}}}return _0x1c8184;})[_0x9117('0x5d')]();})[_0x9117('0x30')](function(){return db[_0x9117('0x5f')][_0x9117('0x52')]({'attributes':['id'],'include':[{'model':db[_0x9117('0x55')],'as':_0x9117('0x5e'),'where':{'id':LISTID}}]})[_0x9117('0x30')](function(_0x127c68){var _0x5be0f3=[];if(_0x127c68){for(var _0x26ec63=0x0,_0xeebd07;_0x26ec63<_0x127c68[_0x9117('0x1c')];_0x26ec63+=0x1){_0xeebd07=_0x127c68[_0x26ec63][_0x9117('0x57')]({'plain':!![]});_0x5be0f3['push'](db['sequelize']['query'](_0x12c267(_0xeebd07,_0x9117('0x60')))['then'](function(){})[_0x9117('0x33')](_0x4812c6()));}}return _0x5be0f3;})[_0x9117('0x5d')]();})['catch'](function(_0x665e77){logger[_0x9117('0x16')](_0x9117('0x61'),'generalCheckHopper',_0x665e77['message']);});}var processPromises=function(_0x3c2544){return BPromise[_0x9117('0x5d')](promises)[_0x9117('0x30')](function(_0x55bd8f){})['catch'](function(_0x445721){logger[_0x9117('0x16')](_0x9117('0x62'),JSON[_0x9117('0x63')](_0x445721));})[_0x9117('0x64')](function(){socket[_0x9117('0x65')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3c2544){return _0x3c2544['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0x9117('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x9117('0x30')](function(){socket[_0x9117('0x65')](_0x9117('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9117('0x67')](FILEPATH);}catch(_0x16b967){logger[_0x9117('0x16')](_0x9117('0x68'),JSON[_0x9117('0x63')](_0x16b967));}finally{process['exit'](0x0);}});};process['on'](_0x9117('0x69'),function(){logger[_0x9117('0x6a')](_0x9117('0x6b'));endCsv();});function main(){return BPromise[_0x9117('0x6c')]()[_0x9117('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9117('0x14')](',');return db[_0x9117('0x2e')][_0x9117('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9117('0x30')](function(_0x3d2f4b){var _0x200a2d=fs[_0x9117('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9117('0x6e')](_0x200a2d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ce962,_0x3ba6c4){total+=0x1;var _0x57de15=total;promises[_0x9117('0x31')](checkRow(_0x1ce962,_0x3d2f4b,_0x57de15)[_0x9117('0x30')](function(){success+=0x1;})[_0x9117('0x33')](function(_0x11c555){if(_0x11c555[_0x9117('0x16')]){errors+=0x1;delete _0x11c555['error'];}else if(_0x11c555[_0x9117('0x2c')]){duplicates+=0x1;delete _0x11c555['duplicate'];}rows['push'](_0x11c555);}));if(total%0xc8===0x0){_0x3ba6c4[_0x9117('0x6f')]();return processPromises(_0x3ba6c4);}},'complete':function(){return processPromises()['then'](function(){logger[_0x9117('0x6a')](_0x9117('0x70'));endCsv();});},'error':function(_0x26c99a,_0x25bbfc){logger['info']('CSV\x20parse\x20error',JSON[_0x9117('0x63')](_0x26c99a));endCsv();}});})['catch'](function(_0x37382e){logger[_0x9117('0x16')](_0x9117('0x71'),JSON['stringify'](_0x37382e));});}main(); \ No newline at end of file +var _0x3220=['toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','\x20=\x20?','insert','select','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','always','sequelize','catch','VoiceQueueId','query','all','outbound','get','Campaign','Lists','CampaignId','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parse\x20error','bluebird','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','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','message','hasOwnProperty','data','firstName','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','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x3220,0x16b));var _0x0322=function(_0x6b7852,_0x4c685a){_0x6b7852=_0x6b7852-0x0;var _0x3edb08=_0x3220[_0x6b7852];return _0x3edb08;};'use strict';var BPromise=require(_0x0322('0x0'));var util=require('util');var _=require(_0x0322('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0322('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0x0322('0x3'));var logger=require(_0x0322('0x4'))(_0x0322('0x5'));config[_0x0322('0x6')]=_[_0x0322('0x7')](config[_0x0322('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x0322('0x8'))(new Redis(config[_0x0322('0x6')]));require(_0x0322('0x9'))[_0x0322('0xa')](socket);try{if(!process[_0x0322('0xb')][0x2]||process[_0x0322('0xb')][0x2]===_0x0322('0xc')||process[_0x0322('0xb')][0x2]==='null'){throw new Error(_0x0322('0xd'));}var FILEPATH=process[_0x0322('0xb')][0x2];if(!process[_0x0322('0xb')][0x3]||process[_0x0322('0xb')][0x3]===_0x0322('0xc')||process['argv'][0x3]===_0x0322('0xe')||!process[_0x0322('0xb')][0x4]||process[_0x0322('0xb')][0x4]===_0x0322('0xc')||process['argv'][0x4]===_0x0322('0xe')){throw new Error(_0x0322('0xf'));}var FIELDS=_['zipObject'](process[_0x0322('0xb')][0x3][_0x0322('0x10')](','),process[_0x0322('0xb')][0x4][_0x0322('0x10')](','));if(!process[_0x0322('0xb')][0x5]||process['argv'][0x5]===_0x0322('0xc')||process[_0x0322('0xb')][0x5]===_0x0322('0xe')){throw new Error(_0x0322('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x0322('0xb')][0x6]&&process[_0x0322('0xb')][0x6]!==_0x0322('0xc')&&process['argv'][0x6]!=='null'?process[_0x0322('0xb')][0x6]:null;var DUPLICATES=process[_0x0322('0xb')][0x7]&&process[_0x0322('0xb')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x0322('0xe')?process[_0x0322('0xb')][0x7]:null;if(!process[_0x0322('0xb')][0x8]||process['argv'][0x8]===_0x0322('0xc')||process['argv'][0x8]===_0x0322('0xe')){throw new Error(_0x0322('0x12'));}var SOCKET_TIMESTAMP=process[_0x0322('0xb')][0x8];}catch(_0x327c7b){logger[_0x0322('0x13')](_0x327c7b);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(_0x11ed0e,_0xfa43b0,_0x196b44,_0x38c37f){var _0x87054c={'message':_0xfa43b0};_0x87054c[_0x11ed0e]=!![];if(_0x196b44){_0x87054c[_0x0322('0x14')]=_0x196b44;}if(_0x38c37f){_0x87054c[_0x0322('0x15')]=_0x38c37f;}return _0x87054c;}function isEmail(_0x1d89d8){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'](_0x1d89d8);}function checkRow(_0xf502be,_0x112407,_0x1b0499){return new BPromise(function(_0x27e912,_0x4790d6){if(_[_0x0322('0x16')](_0xf502be)){return _0x4790d6(handleCheckRowError('error',_0x0322('0x17'),null,_0x1b0499));}if(_0xf502be['errors']&&_0xf502be[_0x0322('0x18')][_0x0322('0x19')]){var _0x3bc6ac=_[_0x0322('0x1a')](_0xf502be[_0x0322('0x18')],_0x0322('0x1b'))['join'](';');return _0x4790d6(handleCheckRowError(_0x0322('0x13'),_0x3bc6ac,null,_0x1b0499));}var _0x544dea={};for(var _0x19e09c in FIELDS){if(FIELDS[_0x0322('0x1c')](_0x19e09c)&&FIELDS[_0x19e09c]){_0x544dea[_0x19e09c]=_0xf502be[_0x0322('0x1d')][0x0][FIELDS[_0x19e09c]]||_0xf502be[_0x0322('0x1d')][0x0]['\ufeff'+FIELDS[_0x19e09c]];}}if(!_0x544dea[_0x0322('0x1e')]){return _0x4790d6(handleCheckRowError(_0x0322('0x13'),'firstName\x20not\x20specified!',null,_0x1b0499));}if(!_0x544dea['phone']){return _0x4790d6(handleCheckRowError(_0x0322('0x13'),_0x0322('0x1f'),null,_0x1b0499));}if(_0x544dea[_0x0322('0x20')]){var _0x1a7dfa=moment(_0x544dea[_0x0322('0x20')],_0x0322('0x21'));if(!_0x1a7dfa[_0x0322('0x22')]()){return _0x4790d6(handleCheckRowError(_0x0322('0x13'),_0x0322('0x23'),null,_0x1b0499));}}if(_0x544dea[_0x0322('0x24')]){if(!isEmail(_0x544dea['email'])){return _0x4790d6(handleCheckRowError(_0x0322('0x13'),_0x0322('0x25'),null,_0x1b0499));}}_0x544dea[_0x0322('0x26')]=LISTID;_0x544dea[_0x0322('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0322('0x19')]&&_0x112407){var _0x489bae={};for(var _0xa29f3e=0x0,_0x6431da=DUPLICATES[_0x0322('0x19')];_0xa29f3e<_0x6431da;_0xa29f3e+=0x1){_0x489bae[DUPLICATES[_0xa29f3e]]=_0x544dea[DUPLICATES[_0xa29f3e]];}var _0x52794c=_['find'](_0x112407,_0x489bae);if(_0x52794c){return _0x4790d6(handleCheckRowError(_0x0322('0x28'),_0x0322('0x29'),_0x52794c,_0x1b0499));}}return db[_0x0322('0x2a')][_0x0322('0x2b')](_0x544dea,{'raw':!![],'hooks':![],'fields':_[_0x0322('0x2c')](_0x544dea)})[_0x0322('0x2d')](function(_0x4f3e0e){if(DUPLICATES&&DUPLICATES[_0x0322('0x19')]&&_0x112407){_0x112407[_0x0322('0x2e')](_['pick'](_0x544dea,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4f3e0e['id'];return _0x27e912();})['catch'](function(_0x7edf91){return _0x4790d6(handleCheckRowError(_0x0322('0x13'),_0x0322('0x2f')+(_0x7edf91[_0x0322('0x1b')]||JSON[_0x0322('0x30')](_0x7edf91)),null,_0x1b0499));});});}function checkHopper(){function _0xb9fc00(){return function(_0x286df9){logger['error'](_0x0322('0x31'),'checkHopper',util[_0x0322('0x32')](_0x286df9,{'showHidden':![],'depth':null}));};}var _0x18e631=function(_0x5e0932,_0x26c474){var _0x4f1ea6=squel['insert']()[_0x0322('0x33')](_0x0322('0x34'))[_0x0322('0x35')]([_0x0322('0x36'),_0x0322('0x37'),_0x0322('0x38'),_0x0322('0x26'),_0x26c474,_0x0322('0x39'),_0x0322('0x3a')],squel['select']()[_0x0322('0x3b')](_0x0322('0x36'),_0x0322('0x36'))[_0x0322('0x3b')](_0x0322('0x3c'),'scheduledAt')[_0x0322('0x3b')]('id','ContactId')[_0x0322('0x3b')](LISTID[_0x0322('0x3d')](),_0x0322('0x26'))['field'](_0x5e0932['id']['toString'](),_0x26c474)['field'](_0x0322('0x3c'),_0x0322('0x39'))[_0x0322('0x3b')]('NOW()',_0x0322('0x3a'))['from'](_0x0322('0x3e'))[_0x0322('0x3f')](_0x0322('0x40'))[_0x0322('0x3f')](_0x0322('0x41'),LISTID[_0x0322('0x3d')]())[_0x0322('0x3f')](_0x0322('0x42'))[_0x0322('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0322('0x3b')](_0x0322('0x36'))[_0x0322('0x43')](_0x0322('0x34'))[_0x0322('0x3f')](_0x26c474+_0x0322('0x44'),_0x5e0932['id'][_0x0322('0x3d')]())))[_0x0322('0x3d')]();return _0x4f1ea6;};var _0x3b90bb=function(_0x4478ff,_0x9a72b6){var _0x573810=squel[_0x0322('0x45')]()[_0x0322('0x33')]('cm_hopper')[_0x0322('0x35')]([_0x0322('0x36'),_0x0322('0x37'),_0x0322('0x38'),'ListId',_0x9a72b6,_0x0322('0x39'),_0x0322('0x3a')],squel[_0x0322('0x46')]()['field']('phone','phone')['field'](_0x0322('0x3c'),_0x0322('0x37'))[_0x0322('0x3b')]('id','ContactId')[_0x0322('0x3b')](LISTID[_0x0322('0x3d')](),_0x0322('0x26'))[_0x0322('0x3b')](_0x4478ff['id']['toString'](),_0x9a72b6)[_0x0322('0x3b')](_0x0322('0x3c'),_0x0322('0x39'))[_0x0322('0x3b')](_0x0322('0x3c'),_0x0322('0x3a'))['from'](_0x0322('0x3e'))[_0x0322('0x3f')](_0x0322('0x40'))[_0x0322('0x3f')](_0x0322('0x41'),LISTID[_0x0322('0x3d')]())[_0x0322('0x3f')](_0x0322('0x47'),squel[_0x0322('0x48')](hopperContacts))[_0x0322('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x0322('0x3f')](_0x0322('0x49'),squel[_0x0322('0x46')]()[_0x0322('0x3b')](_0x0322('0x4a'))[_0x0322('0x43')](_0x0322('0x4b'))[_0x0322('0x3f')](_0x9a72b6+_0x0322('0x44'),_0x4478ff['id'][_0x0322('0x3d')]()))[_0x0322('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0322('0x46')]()[_0x0322('0x3b')](_0x0322('0x36'))[_0x0322('0x43')](_0x0322('0x34'))[_0x0322('0x3f')](_0x9a72b6+_0x0322('0x44'),_0x4478ff['id'][_0x0322('0x3d')]())))[_0x0322('0x3d')]();return _0x573810;};function _0xf8cde0(_0x4b2128,_0x5b19bc){var _0x10a61c=squel[_0x0322('0x45')]()[_0x0322('0x33')]('cm_hopper')['fromQuery']([_0x0322('0x36'),'scheduledAt',_0x0322('0x38'),'ListId',_0x5b19bc,_0x0322('0x39'),_0x0322('0x3a')],squel[_0x0322('0x46')]()[_0x0322('0x3b')](_0x0322('0x36'),_0x0322('0x36'))[_0x0322('0x3b')](_0x0322('0x3c'),_0x0322('0x37'))['field']('id',_0x0322('0x38'))[_0x0322('0x3b')](LISTID['toString'](),'ListId')[_0x0322('0x3b')](_0x4b2128['id']['toString'](),_0x5b19bc)[_0x0322('0x3b')](_0x0322('0x3c'),_0x0322('0x39'))[_0x0322('0x3b')](_0x0322('0x3c'),_0x0322('0x3a'))[_0x0322('0x43')](_0x0322('0x3e'))[_0x0322('0x3f')]('deletedAt\x20IS\x20NULL')[_0x0322('0x3f')](_0x0322('0x41'),LISTID['toString']())[_0x0322('0x3f')]('id\x20IN\x20?',squel[_0x0322('0x48')](hopperContacts))[_0x0322('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x0322('0x3d')]();return _0x10a61c;}function _0x56d25f(_0x57b6f9,_0x56a173){var _0x5d9b50=squel[_0x0322('0x45')]()[_0x0322('0x33')](_0x0322('0x4c'))[_0x0322('0x35')]([_0x0322('0x36'),'ContactId','ListId',_0x56a173,'createdAt',_0x0322('0x3a')],squel[_0x0322('0x46')]()[_0x0322('0x3b')](_0x0322('0x36'),'phone')['field']('id',_0x0322('0x38'))[_0x0322('0x3b')](LISTID['toString'](),'ListId')['field'](_0x57b6f9['id'][_0x0322('0x3d')](),_0x56a173)[_0x0322('0x3b')](_0x0322('0x3c'),_0x0322('0x39'))[_0x0322('0x3b')](_0x0322('0x3c'),'updatedAt')[_0x0322('0x43')]('cm_contacts')[_0x0322('0x3f')](_0x0322('0x40'))['where']('ListId\x20=\x20?',LISTID[_0x0322('0x3d')]())['where'](_0x0322('0x47'),squel[_0x0322('0x48')](hopperContacts))[_0x0322('0x3f')](_0x0322('0x42')))[_0x0322('0x3d')]();return _0x5d9b50;}return db[_0x0322('0x4d')][_0x0322('0x4e')]({'where':{'type':'outbound'},'attributes':['id',_0x0322('0x4f')],'include':[{'model':db[_0x0322('0x50')],'as':'Lists','where':{'id':LISTID}}]})[_0x0322('0x2d')](function(_0x54fc2a){var _0x13dafc=[];if(_0x54fc2a){var _0x5833e6;for(var _0x85b93f=0x0,_0x1620e3;_0x85b93f<_0x54fc2a[_0x0322('0x19')];_0x85b93f+=0x1){_0x1620e3=_0x54fc2a[_0x85b93f]['get']({'plain':!![]});switch(_0x1620e3[_0x0322('0x4f')]){case _0x0322('0x51'):_0x13dafc[_0x0322('0x2e')](db[_0x0322('0x52')]['query'](_0x3b90bb(_0x1620e3,'VoiceQueueId'))[_0x0322('0x2d')](function(){})[_0x0322('0x53')](_0xb9fc00()));break;case'onlyIfOpen':_0x13dafc[_0x0322('0x2e')](db['sequelize']['query'](_0x18e631(_0x1620e3,_0x0322('0x54')))[_0x0322('0x2d')](function(){})['catch'](_0xb9fc00()));break;default:_0x13dafc[_0x0322('0x2e')](db['sequelize'][_0x0322('0x55')](_0xf8cde0(_0x1620e3,_0x0322('0x54')))['then'](function(){})[_0x0322('0x53')](_0xb9fc00()));}}}return _0x13dafc;})[_0x0322('0x56')]()[_0x0322('0x2d')](function(){return db[_0x0322('0x4d')][_0x0322('0x4e')]({'where':{'type':_0x0322('0x57')},'attributes':['id'],'include':[{'model':db[_0x0322('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x417c62){var _0x2ad43c=[];if(_0x417c62){var _0xd633ff;for(var _0x463797=0x0,_0x243f38;_0x463797<_0x417c62['length'];_0x463797+=0x1){_0x243f38=_0x417c62[_0x463797][_0x0322('0x58')]({'plain':!![]});_0x2ad43c[_0x0322('0x2e')](db[_0x0322('0x52')]['query'](_0x56d25f(_0x243f38,_0x0322('0x54')))[_0x0322('0x2d')](function(){})['catch'](_0xb9fc00()));}}return _0x2ad43c;})['all']();})[_0x0322('0x2d')](function(){return db[_0x0322('0x59')][_0x0322('0x4e')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x0322('0x50')],'as':_0x0322('0x5a'),'where':{'id':LISTID}}]})[_0x0322('0x2d')](function(_0x1419c7){var _0x341042=[];if(_0x1419c7){for(var _0x2f728f=0x0,_0x498846;_0x2f728f<_0x1419c7[_0x0322('0x19')];_0x2f728f+=0x1){_0x498846=_0x1419c7[_0x2f728f][_0x0322('0x58')]({'plain':!![]});switch(_0x498846['dialCheckDuplicateType']){case _0x0322('0x51'):_0x341042[_0x0322('0x2e')](db[_0x0322('0x52')][_0x0322('0x55')](_0x3b90bb(_0x498846,_0x0322('0x5b')))['then'](function(){})[_0x0322('0x53')](_0xb9fc00()));break;case'onlyIfOpen':_0x341042['push'](db[_0x0322('0x52')]['query'](_0x18e631(_0x498846,_0x0322('0x5b')))[_0x0322('0x2d')](function(){})[_0x0322('0x53')](_0xb9fc00()));break;default:_0x341042[_0x0322('0x2e')](db[_0x0322('0x52')]['query'](_0xf8cde0(_0x498846,_0x0322('0x5b')))[_0x0322('0x2d')](function(){})[_0x0322('0x53')](_0xb9fc00()));}}}return _0x341042;})['all']();})[_0x0322('0x2d')](function(){return db[_0x0322('0x59')][_0x0322('0x4e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x2928de){var _0x4e4fd6=[];if(_0x2928de){for(var _0x5d108e=0x0,_0x22a995;_0x5d108e<_0x2928de[_0x0322('0x19')];_0x5d108e+=0x1){_0x22a995=_0x2928de[_0x5d108e][_0x0322('0x58')]({'plain':!![]});_0x4e4fd6[_0x0322('0x2e')](db['sequelize'][_0x0322('0x55')](_0x56d25f(_0x22a995,_0x0322('0x5b')))[_0x0322('0x2d')](function(){})['catch'](_0xb9fc00()));}}return _0x4e4fd6;})['all']();})['catch'](function(_0x2ae84c){logger[_0x0322('0x13')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x2ae84c[_0x0322('0x1b')]);});}var processPromises=function(_0x99d28f){return BPromise[_0x0322('0x56')](promises)['then'](function(_0xf88d63){})[_0x0322('0x53')](function(_0x184758){logger[_0x0322('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0x0322('0x30')](_0x184758));})[_0x0322('0x5c')](function(){socket['emit'](_0x0322('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x99d28f){return _0x99d28f[_0x0322('0x5e')]();}});};var endCsv=function(){return BPromise[_0x0322('0x5f')]()[_0x0322('0x2d')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x0322('0x60')](_0x0322('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x12d809){logger[_0x0322('0x13')](_0x0322('0x61'),JSON[_0x0322('0x30')](_0x12d809));}finally{process[_0x0322('0x62')](0x0);}});};process['on'](_0x0322('0x63'),function(){logger[_0x0322('0x64')](_0x0322('0x65'));endCsv();});function main(){return BPromise[_0x0322('0x5f')]()[_0x0322('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0x0322('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0322('0x2d')](function(_0xe3840e){var _0x40e3db=fs[_0x0322('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0322('0x67')](_0x40e3db,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2d4b9c,_0xce1a9a){total+=0x1;var _0x186260=total;promises[_0x0322('0x2e')](checkRow(_0x2d4b9c,_0xe3840e,_0x186260)['then'](function(){success+=0x1;})[_0x0322('0x53')](function(_0x353bb7){if(_0x353bb7[_0x0322('0x13')]){errors+=0x1;delete _0x353bb7[_0x0322('0x13')];}else if(_0x353bb7[_0x0322('0x28')]){duplicates+=0x1;delete _0x353bb7['duplicate'];}rows[_0x0322('0x2e')](_0x353bb7);}));if(total%0xc8===0x0){_0xce1a9a[_0x0322('0x68')]();return processPromises(_0xce1a9a);}},'complete':function(){return processPromises()[_0x0322('0x2d')](function(){logger[_0x0322('0x64')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x28bdac,_0x365965){logger[_0x0322('0x64')](_0x0322('0x69'),JSON['stringify'](_0x28bdac));endCsv();}});})[_0x0322('0x53')](function(_0xdb0cd8){logger[_0x0322('0x13')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0322('0x30')](_0xdb0cd8));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 45286f1..6927a97 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 _0x3064=['step','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','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','.id\x20=\x20','where','join','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_hopper_black','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','message','errors','push','code','info','sequelize','spread','catch','error','main','stringify','send','start','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','rows','data','hasOwnProperty','trim','replace','scheduledat','isValid','isNaN','isNumber','includes','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','Abort\x20parser','abort','SystemError'];(function(_0x56bc31,_0x491dd6){var _0xacded9=function(_0x25d2a6){while(--_0x25d2a6){_0x56bc31['push'](_0x56bc31['shift']());}};_0xacded9(++_0x491dd6);}(_0x3064,0xaa));var _0x4306=function(_0xde2edf,_0x2debb4){_0xde2edf=_0xde2edf-0x0;var _0x46d3d1=_0x3064[_0xde2edf];return _0x46d3d1;};'use strict';var fs=require('fs');var path=require(_0x4306('0x0'));var _=require(_0x4306('0x1'));var Papa=require(_0x4306('0x2'));var util=require(_0x4306('0x3'));var BPromise=require('bluebird');var moment=require(_0x4306('0x4'));var squel=require(_0x4306('0x5'));var Redis=require('ioredis');var db=require(_0x4306('0x6'))['db'];var config=require(_0x4306('0x7'));var logger=require(_0x4306('0x8'))('import');config[_0x4306('0x9')]=_[_0x4306('0xa')](config[_0x4306('0x9')],{'host':_0x4306('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4306('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x4306('0xc')](_0x4306('0xd'));function isEmail(_0xbd42a9){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'](_0xbd42a9);}function selectNotIn(_0x334aee,_0x2fceaf,_0x286beb,_0xad4a1,_0x334919){return squel[_0x4306('0xe')]()[_0x4306('0xf')](_0x4306('0x10'))[_0x4306('0x11')](_0xad4a1)['join'](_0x2fceaf,null,_0x2fceaf+_0x4306('0x12')+_0xad4a1+'.'+_0x286beb)[_0x4306('0x13')](_0xad4a1+'.'+_0x286beb+'\x20=\x20'+_0x334aee+'.'+_0x286beb)[_0x4306('0x13')](_0x2fceaf+'.dialCheckDuplicateType\x20IN\x20('+_0x334919[_0x4306('0x14')]()+')');}function insertCmHopper(_0xa696c7,_0x4f6180,_0x1881ee,_0x3d272f,_0x3c7d8a){var _0x591140=['cm_contacts.phone',_0x4306('0x15'),_0x4306('0x16'),_0x4306('0x17'),_0x4f6180+'.'+_0x3d272f,_0x4306('0x18'),_0x4306('0x19'),_0x4306('0x1a'),_0x4306('0x1b'),'\x22'+_0x3c7d8a+'\x22'];return squel[_0x4306('0x1c')]()[_0x4306('0x1d')]('cm_hopper')[_0x4306('0x1e')]([_0x4306('0x10'),'scheduledat',_0x4306('0x1f'),_0x4306('0x20'),_0x3d272f,_0x4306('0x21'),_0x4306('0x22'),_0x4306('0x23'),_0x4306('0x24'),'recallme'],squel[_0x4306('0xe')]()[_0x4306('0x25')](_0x591140)[_0x4306('0x11')](_0x4f6180)[_0x4306('0x14')](_0x4306('0x26'),null,_0x4306('0x27')+_0x4f6180+_0x4306('0x28'))['join'](_0x1881ee,null,_0x1881ee+_0x4306('0x12')+_0x4f6180+'.'+_0x3d272f)[_0x4306('0x13')](_0x4f6180+'.CmListId\x20=\x20?',_0xa696c7)[_0x4306('0x13')](_0x4306('0x29'),NOW)[_0x4306('0x13')](_0x4306('0x2a'),selectNotIn(_0x4f6180,_0x1881ee,_0x3d272f,_0x4306('0x2b'),[_0x4306('0x2c'),_0x4306('0x2d')]))[_0x4306('0x13')](_0x4306('0x2a'),selectNotIn(_0x4f6180,_0x1881ee,_0x3d272f,_0x4306('0x2b'),[_0x4306('0x2c')])))[_0x4306('0x2e')]();}function insertCmHopperBlack(_0x2df5aa,_0x19dce0,_0x3033da,_0x36d762){var _0x43eaf5=[_0x4306('0x2f'),'cm_contacts.id',_0x4306('0x17'),_0x19dce0+'.'+_0x36d762,'cm_contacts.createdAt',_0x4306('0x19')];return squel[_0x4306('0x1c')]()[_0x4306('0x1d')](_0x4306('0x30'))[_0x4306('0x1e')]([_0x4306('0x10'),_0x4306('0x1f'),'ListId',_0x36d762,'createdAt','updatedAt'],squel[_0x4306('0xe')]()['fields'](_0x43eaf5)[_0x4306('0x11')](_0x19dce0)['join'](_0x4306('0x26'),null,_0x4306('0x27')+_0x19dce0+'.CmListId')['join'](_0x3033da,null,_0x3033da+'.id\x20=\x20'+_0x19dce0+'.'+_0x36d762)['where'](_0x19dce0+_0x4306('0x31'),_0x2df5aa)['where'](_0x4306('0x29'),NOW)[_0x4306('0x13')](_0x4306('0x2a'),squel[_0x4306('0xe')]()[_0x4306('0xf')](_0x4306('0x10'))[_0x4306('0x11')](_0x4306('0x30'))[_0x4306('0x13')](_0x4306('0x32'),_0x2df5aa)['where'](_0x36d762+_0x4306('0x33'),_0x19dce0+'.'+_0x36d762)))[_0x4306('0x2e')]();}function insertCmContact(_0x8ff0e4,_0x48e97a,_0x2d4ce9,_0x540527){var _0xf97679=_[_0x4306('0x34')](_[_0x4306('0x35')](_0x540527),[_0x4306('0x20'),_0x4306('0x36'),'createdAt','updatedAt']);return squel[_0x4306('0x1c')]()[_0x4306('0x1d')](_0x4306('0x26'))[_0x4306('0x1e')](_0xf97679,squel[_0x4306('0xe')]()[_0x4306('0x25')](_0xf97679)[_0x4306('0x11')](_0x48e97a)['where']('('+_0x2d4ce9['join'](',')+_0x4306('0x37'),squel[_0x4306('0xe')]()[_0x4306('0x25')](_0x2d4ce9)[_0x4306('0x11')](_0x4306('0x26'))[_0x4306('0x13')](_0x4306('0x32'),_0x8ff0e4))[_0x4306('0x13')](_0x4306('0x38'),squel[_0x4306('0xe')]()[_0x4306('0xf')](_0x4306('0x39'),_0x4306('0x3a'))[_0x4306('0x11')](_0x48e97a)[_0x4306('0x3b')](_0x2d4ce9[_0x4306('0x14')](','))))[_0x4306('0x2e')]();}function handleStop(){logger['info'](_0x4306('0x3c'));stopped=!![];}function handleUncaughtException(_0x573a85){logger['error'](_0x573a85[_0x4306('0x3d')]);process['exit'](0x1);}function handleError(_0x195189,_0x33fbb8){stats[_0x4306('0x3e')][_0x4306('0x3f')]({'name':_0x33fbb8[_0x4306('0x40')],'message':_0x33fbb8['message'],'row':_0x195189});}function handleQuery(_0x92770f){logger[_0x4306('0x41')](_0x92770f);return db[_0x4306('0x42')]['query'](_0x92770f)[_0x4306('0x43')](function(_0x49a002){results[_0x4306('0x3f')](_0x49a002);})[_0x4306('0x44')](function(_0x245865){logger[_0x4306('0x45')](_0x245865['message']);});}function main(_0x53acf3,_0x552d89,_0x36bea9,_0x9e2677){logger['info'](_0x4306('0x46'),_0x53acf3,JSON[_0x4306('0x47')](_0x552d89));process[_0x4306('0x48')](_0x4306('0x49'));var _0x3ea0ba=_0x552d89['binding'];var _0x588437=_0x552d89[_0x4306('0x4a')];var _0x39b402=path[_0x4306('0x14')](config[_0x4306('0x4b')],_0x4306('0x4c'),_0x588437+_0x4306('0x4d'));var _0x3ad54c=_[_0x4306('0x35')](_0x3ea0ba)[_0x4306('0x14')]();logger[_0x4306('0x41')](_0x4306('0x4e'),_0x3ad54c);fs[_0x4306('0x4f')](_0x39b402,_0x3ad54c+'\x0a');Papa[_0x4306('0x50')](fs[_0x4306('0x51')](_0x53acf3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a09de,_0x440e45){try{for(var _0x3e0746=0x0,_0x5904b5=[];_0x3e0746<_0x1a09de['data'][_0x4306('0x52')];_0x3e0746++){stats[_0x4306('0x53')]+=0x1;if(_0x1a09de[_0x4306('0x3e')][_0x3e0746]){handleError(_0x1a09de[_0x4306('0x54')][_0x3e0746],_0x1a09de[_0x4306('0x3e')][_0x3e0746]);}else{var _0x4d5222=[];for(var _0xd4cd9e in _0x3ea0ba){if(_0x3ea0ba[_0x4306('0x55')](_0xd4cd9e)){if(_0x1a09de[_0x4306('0x54')][_0x3e0746][_0x3ea0ba[_0xd4cd9e]]){var _0x2b2820=_[_0x4306('0x56')](_0x1a09de[_0x4306('0x54')][_0x3e0746][_0x3ea0ba[_0xd4cd9e]][_0x4306('0x57')](/"/g,'\x27'));switch(_0xd4cd9e){case _0x4306('0x58'):var _0x23c60f=moment(_0x2b2820,_0x4306('0xd'),!![]);if(_0x23c60f[_0x4306('0x59')]()){_0x5904b5['push']('\x22'+_0x2b2820+'\x22');}else{_0x4d5222[_0x4306('0x3f')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x4306('0x23'):var _0x4939c4=parseInt(_0x2b2820);_0x2b2820=_[_0x4306('0x5a')](_0x4939c4)||_0x4939c4<0x0||_0x4939c4>0x4?_0x9e2677?0x3:0x2:_0x4939c4;_0x5904b5[_0x4306('0x3f')]('\x22'+_0x2b2820+'\x22');break;case'UserId':var _0xfab581=parseInt(_0x2b2820);if(_[_0x4306('0x5b')](_0xfab581)&&_[_0x4306('0x5c')](_0x36bea9,_0xfab581)){_0x5904b5[_0x4306('0x3f')]('\x22'+_0xfab581+'\x22');}else{_0x4d5222[_0x4306('0x3f')]('agent\x20not\x20exists');}break;case _0x4306('0x5d'):if(isEmail(_0x2b2820)){_0x5904b5[_0x4306('0x3f')]('\x22'+_0x2b2820+'\x22');}else{_0x4d5222[_0x4306('0x3f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x58af6e=moment(_0x2b2820,_0x4306('0x5e'),!![]);if(_0x58af6e['isValid']()){_0x5904b5[_0x4306('0x3f')]('\x22'+_0x2b2820+'\x22');}else{_0x4d5222[_0x4306('0x3f')](_0x4306('0x5f'));}break;default:_0x5904b5[_0x4306('0x3f')]('\x22'+_0x2b2820+'\x22');}}else{switch(_0xd4cd9e){case _0x4306('0x60'):case'phone':_0x4d5222[_0x4306('0x3f')](_0xd4cd9e+_0x4306('0x61'));break;default:_0x5904b5[_0x4306('0x3f')]('\x22\x22');}}}}if(_0x4d5222[_0x4306('0x52')]){handleError(_0x1a09de['data'][_0x3e0746],{'code':_0x4306('0x62'),'message':_0x4d5222[_0x4306('0x14')]()});}else{fs['appendFileSync'](_0x39b402,_0x5904b5[_0x4306('0x14')]()+'\x0a');}_0x5904b5=[];}if(!(stats[_0x4306('0x53')]%0xc8)){socket['emit']('contact:import:'+_0x588437,stats);stats[_0x4306('0x3e')]=[];}}if(stopped){logger[_0x4306('0x41')](_0x4306('0x63'));_0x440e45[_0x4306('0x64')]();}}catch(_0x45ed09){handleError(_0x1a09de[_0x4306('0x54')][_0x3e0746],{'code':_0x4306('0x65'),'message':_0x45ed09['message']});logger[_0x4306('0x45')](_0x4306('0x66'),_0x45ed09[_0x4306('0x3d')]);}},'complete':function(){try{var _0x388473=[];var _0x9adc56=_0x4306('0x26');if(_0x552d89[_0x4306('0x67')]&&_0x552d89[_0x4306('0x67')][_0x4306('0x52')]){_0x9adc56=_0x4306('0x68')+_0x588437;_0x388473[_0x4306('0x3f')](_0x4306('0x69')+_0x9adc56+_0x4306('0x6a'));}var _0xbc930a=util[_0x4306('0xc')](_0x4306('0x6b'),_0x39b402,_0x9adc56,_0x3ad54c,_0x552d89[_0x4306('0x20')],_0x552d89['CompanyId']||null,NOW,NOW);if(_[_0x4306('0x6c')](_0x3ea0ba[_0x4306('0x58')])){_0xbc930a+=_0x4306('0x6d');}_0x388473[_0x4306('0x3f')](_0xbc930a);if(_0x552d89[_0x4306('0x67')]&&_0x552d89[_0x4306('0x67')]['length']){_0x388473[_0x4306('0x3f')](insertCmContact(_0x552d89[_0x4306('0x20')],_0x9adc56,_0x552d89[_0x4306('0x67')],_0x3ea0ba));_0x388473[_0x4306('0x3f')](_0x4306('0x6e')+_0x9adc56+';');}_0x388473['push'](insertCmHopper(_0x552d89['ListId'],_0x4306('0x6f'),_0x4306('0x70'),'VoiceQueueId',_0x9e2677));_0x388473[_0x4306('0x3f')](insertCmHopperBlack(_0x552d89['ListId'],'voice_queues_has_cm_blacklists',_0x4306('0x70'),_0x4306('0x71')));_0x388473[_0x4306('0x3f')](insertCmHopper(_0x552d89[_0x4306('0x20')],_0x4306('0x72'),'campaigns',_0x4306('0x73'),_0x9e2677));_0x388473[_0x4306('0x3f')](insertCmHopperBlack(_0x552d89[_0x4306('0x20')],_0x4306('0x74'),'campaigns','CampaignId'));BPromise[_0x4306('0x75')](_0x388473,handleQuery)[_0x4306('0x76')](function(_0x130892){stats[_0x4306('0x77')]=!![];stats[_0x4306('0x78')]=_0x552d89[_0x4306('0x67')]&&_0x552d89[_0x4306('0x67')][_0x4306('0x52')]?results[0x2][_0x4306('0x78')]:results[0x0][_0x4306('0x78')];socket[_0x4306('0x79')](_0x4306('0x7a')+_0x588437,stats);fs[_0x4306('0x7b')](_0x53acf3);fs[_0x4306('0x7b')](_0x39b402);process['exit'](0x0);})[_0x4306('0x44')](function(_0x12f0ed){logger[_0x4306('0x45')](_0x12f0ed['message']);process['exit'](0x1);});}catch(_0x5557ec){logger[_0x4306('0x45')](_0x4306('0x7c'),_0x5557ec[_0x4306('0x3d')]);process['exit'](0x1);}},'error':function(_0x599cb0,_0x217ace,_0x2e7ae2,_0x418b6b){throw new Error(_0x418b6b);}});}function validate(){if(process[_0x4306('0x7d')]&&process[_0x4306('0x7d')]['length']<0x4){throw new Error(_0x4306('0x7e'));}var _0x22cdf9=path[_0x4306('0x14')](config[_0x4306('0x4b')],_0x4306('0x4c'),process[_0x4306('0x7d')][0x2]);if(!fs[_0x4306('0x7f')](_0x22cdf9)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2e8442={};try{_0x2e8442=JSON[_0x4306('0x50')](process['argv'][0x3]);if(!_0x2e8442[_0x4306('0x80')]){throw new Error(_0x4306('0x81'));}if(!_0x2e8442[_0x4306('0x80')]['phone']){throw new Error(_0x4306('0x82'));}if(!_0x2e8442[_0x4306('0x80')][_0x4306('0x60')]){throw new Error(_0x4306('0x83'));}var _0x1ad97a=0x0;if(_0x2e8442[_0x4306('0x80')][_0x4306('0x24')]){_0x1ad97a=0x1;}if(!_0x2e8442[_0x4306('0x20')]){throw new Error(_0x4306('0x84'));}}catch(_0x2f97dd){throw new Error(_0x4306('0x85'));}var _0x1f94c6=[];try{_0x1f94c6=_[_0x4306('0x86')](JSON[_0x4306('0x50')](process[_0x4306('0x7d')][0x4]),'id');}catch(_0x36f873){logger[_0x4306('0x41')]('No\x20agent\x20available');}main(_0x22cdf9,_0x2e8442,_0x1f94c6,_0x1ad97a);}validate();process['on'](_0x4306('0x87'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x97b6=['createdAt','updatedAt','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','toString','cm_contacts.id','cm_contacts.createdAt','cm_hopper_black','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','field','\x20=\x20?','concat','keys','CompanyId','fromQuery',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','errors','code','info','sequelize','query','spread','push','catch','main','stringify','start','binding','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','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','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','CampaignId','campaigns_has_cm_blacklists','campaigns','each','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x97b6,0xee));var _0x697b=function(_0x2d305b,_0x459d7c){_0x2d305b=_0x2d305b-0x0;var _0x52be39=_0x97b6[_0x2d305b];return _0x52be39;};'use strict';var fs=require('fs');var path=require(_0x697b('0x0'));var _=require(_0x697b('0x1'));var Papa=require(_0x697b('0x2'));var util=require(_0x697b('0x3'));var BPromise=require(_0x697b('0x4'));var moment=require('moment');var squel=require(_0x697b('0x5'));var Redis=require(_0x697b('0x6'));var db=require(_0x697b('0x7'))['db'];var config=require(_0x697b('0x8'));var logger=require(_0x697b('0x9'))(_0x697b('0xa'));config[_0x697b('0xb')]=_[_0x697b('0xc')](config[_0x697b('0xb')],{'host':_0x697b('0xd'),'port':0x18eb});var socket=require(_0x697b('0xe'))(new Redis(config[_0x697b('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x697b('0xf')](_0x697b('0x10'));function isEmail(_0x495df5){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'](_0x495df5);}function selectNotIn(_0x2b7f7e,_0x29dd04,_0x41b397,_0x580d21,_0x197856){return squel[_0x697b('0x11')]()['field'](_0x697b('0x12'))[_0x697b('0x13')](_0x580d21)[_0x697b('0x14')](_0x29dd04,null,_0x29dd04+_0x697b('0x15')+_0x580d21+'.'+_0x41b397)['where'](_0x580d21+'.'+_0x41b397+'\x20=\x20'+_0x2b7f7e+'.'+_0x41b397)[_0x697b('0x16')](_0x29dd04+_0x697b('0x17')+_0x197856[_0x697b('0x14')]()+')');}function insertCmHopper(_0x42d7da,_0x137586,_0x262cb6,_0x8ded9,_0x116df8){var _0xd240a4=[_0x697b('0x18'),_0x697b('0x19'),'cm_contacts.id',_0x697b('0x1a'),_0x137586+'.'+_0x8ded9,'cm_contacts.createdAt',_0x697b('0x1b'),_0x697b('0x1c'),_0x697b('0x1d'),'\x22'+_0x116df8+'\x22'];return squel[_0x697b('0x1e')]()[_0x697b('0x1f')](_0x697b('0x20'))['fromQuery']([_0x697b('0x12'),_0x697b('0x21'),_0x697b('0x22'),_0x697b('0x23'),_0x8ded9,_0x697b('0x24'),_0x697b('0x25'),'priority',_0x697b('0x26'),'recallme'],squel['select']()[_0x697b('0x27')](_0xd240a4)['from'](_0x137586)[_0x697b('0x14')](_0x697b('0x28'),null,_0x697b('0x29')+_0x137586+'.CmListId')[_0x697b('0x14')](_0x262cb6,null,_0x262cb6+_0x697b('0x15')+_0x137586+'.'+_0x8ded9)[_0x697b('0x16')](_0x137586+_0x697b('0x2a'),_0x42d7da)[_0x697b('0x16')](_0x697b('0x2b'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x137586,_0x262cb6,_0x8ded9,_0x697b('0x20'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x697b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x137586,_0x262cb6,_0x8ded9,_0x697b('0x20'),[_0x697b('0x2c')])))[_0x697b('0x2d')]();}function insertCmHopperBlack(_0x29ca1f,_0x559f21,_0x1c1d69,_0x5024c9){var _0x4ee770=[_0x697b('0x18'),_0x697b('0x2e'),_0x697b('0x1a'),_0x559f21+'.'+_0x5024c9,_0x697b('0x2f'),_0x697b('0x1b')];return squel[_0x697b('0x1e')]()[_0x697b('0x1f')](_0x697b('0x30'))['fromQuery']([_0x697b('0x12'),_0x697b('0x22'),_0x697b('0x23'),_0x5024c9,'createdAt',_0x697b('0x25')],squel[_0x697b('0x11')]()[_0x697b('0x27')](_0x4ee770)[_0x697b('0x13')](_0x559f21)[_0x697b('0x14')](_0x697b('0x28'),null,_0x697b('0x29')+_0x559f21+_0x697b('0x31'))[_0x697b('0x14')](_0x1c1d69,null,_0x1c1d69+_0x697b('0x15')+_0x559f21+'.'+_0x5024c9)[_0x697b('0x16')](_0x559f21+_0x697b('0x2a'),_0x29ca1f)[_0x697b('0x16')](_0x697b('0x2b'),NOW)[_0x697b('0x16')](_0x697b('0x32'),squel[_0x697b('0x11')]()[_0x697b('0x33')](_0x697b('0x12'))['from'](_0x697b('0x30'))[_0x697b('0x16')]('ListId\x20=\x20?',_0x29ca1f)[_0x697b('0x16')](_0x5024c9+_0x697b('0x34'),_0x559f21+'.'+_0x5024c9)))[_0x697b('0x2d')]();}function insertCmContact(_0x2a30bf,_0x53ffd6,_0x452a11,_0x34f61e){var _0x4b6e35=_[_0x697b('0x35')](_[_0x697b('0x36')](_0x34f61e),['ListId',_0x697b('0x37'),_0x697b('0x24'),'updatedAt']);return squel['insert']()['into'](_0x697b('0x28'))[_0x697b('0x38')](_0x4b6e35,squel['select']()[_0x697b('0x27')](_0x4b6e35)[_0x697b('0x13')](_0x53ffd6)[_0x697b('0x16')]('('+_0x452a11[_0x697b('0x14')](',')+_0x697b('0x39'),squel[_0x697b('0x11')]()[_0x697b('0x27')](_0x452a11)['from'](_0x697b('0x28'))['where']('ListId\x20=\x20?',_0x2a30bf))[_0x697b('0x16')]('id\x20IN\x20?',squel[_0x697b('0x11')]()[_0x697b('0x33')](_0x697b('0x3a'),_0x697b('0x3b'))['from'](_0x53ffd6)[_0x697b('0x3c')](_0x452a11[_0x697b('0x14')](','))))['toString']();}function handleStop(){logger['info'](_0x697b('0x3d'));stopped=!![];}function handleUncaughtException(_0x313156){logger[_0x697b('0x3e')](_0x313156[_0x697b('0x3f')]);process[_0x697b('0x40')](0x1);}function handleError(_0xec9307,_0x27a8ea){stats[_0x697b('0x41')]['push']({'name':_0x27a8ea[_0x697b('0x42')],'message':_0x27a8ea[_0x697b('0x3f')],'row':_0xec9307});}function handleQuery(_0x4f8943){logger[_0x697b('0x43')](_0x4f8943);return db[_0x697b('0x44')][_0x697b('0x45')](_0x4f8943)[_0x697b('0x46')](function(_0x5339a4){results[_0x697b('0x47')](_0x5339a4);})[_0x697b('0x48')](function(_0x58613b){logger['error'](_0x58613b['message']);});}function main(_0x2d4ff5,_0x9015c0,_0x2fb826,_0x34e036){logger['info'](_0x697b('0x49'),_0x2d4ff5,JSON[_0x697b('0x4a')](_0x9015c0));process['send'](_0x697b('0x4b'));var _0x5e6edb=_0x9015c0[_0x697b('0x4c')];var _0x49298a=_0x9015c0['socket_timestamp'];var _0x4f0961=path[_0x697b('0x14')](config[_0x697b('0x4d')],_0x697b('0x4e'),_0x49298a+_0x697b('0x4f'));var _0x56408a=_[_0x697b('0x36')](_0x5e6edb)[_0x697b('0x14')]();logger['info'](_0x697b('0x50'),_0x56408a);fs[_0x697b('0x51')](_0x4f0961,_0x56408a+'\x0a');Papa[_0x697b('0x52')](fs[_0x697b('0x53')](_0x2d4ff5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4a83bb,_0x20dbae){try{for(var _0x22dc69=0x0,_0xa5d885=[];_0x22dc69<_0x4a83bb[_0x697b('0x54')][_0x697b('0x55')];_0x22dc69++){stats[_0x697b('0x56')]+=0x1;if(_0x4a83bb['errors'][_0x22dc69]){handleError(_0x4a83bb[_0x697b('0x54')][_0x22dc69],_0x4a83bb[_0x697b('0x41')][_0x22dc69]);}else{var _0x59851a=[];for(var _0x262251 in _0x5e6edb){if(_0x5e6edb['hasOwnProperty'](_0x262251)){if(_0x4a83bb['data'][_0x22dc69][_0x5e6edb[_0x262251]]){var _0x20caf5=_[_0x697b('0x57')](_0x4a83bb['data'][_0x22dc69][_0x5e6edb[_0x262251]][_0x697b('0x58')](/"/g,'\x27'));switch(_0x262251){case _0x697b('0x21'):var _0x2a7474=moment(_0x20caf5,_0x697b('0x10'),!![]);if(_0x2a7474[_0x697b('0x59')]()){_0xa5d885[_0x697b('0x47')]('\x22'+_0x20caf5+'\x22');}else{_0x59851a[_0x697b('0x47')](_0x697b('0x5a'));}break;case _0x697b('0x5b'):var _0x8b7946=parseInt(_0x20caf5);_0x20caf5=_[_0x697b('0x5c')](_0x8b7946)||_0x8b7946<0x0||_0x8b7946>0x4?_0x34e036?0x3:0x2:_0x8b7946;_0xa5d885['push']('\x22'+_0x20caf5+'\x22');break;case _0x697b('0x26'):var _0x6ab345=parseInt(_0x20caf5);if(_[_0x697b('0x5d')](_0x6ab345)&&_[_0x697b('0x5e')](_0x2fb826,_0x6ab345)){_0xa5d885[_0x697b('0x47')]('\x22'+_0x6ab345+'\x22');}else{_0x59851a[_0x697b('0x47')](_0x697b('0x5f'));}break;case _0x697b('0x60'):if(isEmail(_0x20caf5)){_0xa5d885[_0x697b('0x47')]('\x22'+_0x20caf5+'\x22');}else{_0x59851a[_0x697b('0x47')](_0x697b('0x61'));}break;case _0x697b('0x62'):var _0x3ffc24=moment(_0x20caf5,_0x697b('0x63'),!![]);if(_0x3ffc24[_0x697b('0x59')]()){_0xa5d885[_0x697b('0x47')]('\x22'+_0x20caf5+'\x22');}else{_0x59851a[_0x697b('0x47')](_0x697b('0x64'));}break;default:_0xa5d885[_0x697b('0x47')]('\x22'+_0x20caf5+'\x22');}}else{switch(_0x262251){case _0x697b('0x65'):case _0x697b('0x12'):_0x59851a[_0x697b('0x47')](_0x262251+_0x697b('0x66'));break;default:_0xa5d885[_0x697b('0x47')]('\x22\x22');}}}}if(_0x59851a[_0x697b('0x55')]){handleError(_0x4a83bb[_0x697b('0x54')][_0x22dc69],{'code':_0x697b('0x67'),'message':_0x59851a[_0x697b('0x14')]()});}else{fs[_0x697b('0x68')](_0x4f0961,_0xa5d885[_0x697b('0x14')]()+'\x0a');}_0xa5d885=[];}if(!(stats[_0x697b('0x56')]%0xc8)){socket[_0x697b('0x69')]('contact:import:'+_0x49298a,stats);stats['errors']=[];}}if(stopped){logger[_0x697b('0x43')](_0x697b('0x6a'));_0x20dbae[_0x697b('0x6b')]();}}catch(_0x244c44){handleError(_0x4a83bb[_0x697b('0x54')][_0x22dc69],{'code':_0x697b('0x6c'),'message':_0x244c44[_0x697b('0x3f')]});logger[_0x697b('0x3e')](_0x697b('0x6d'),_0x244c44[_0x697b('0x3f')]);}},'complete':function(){try{var _0x1059cd=[];var _0x2d4752=_0x697b('0x28');if(_0x9015c0[_0x697b('0x6e')]&&_0x9015c0[_0x697b('0x6e')]['length']){_0x2d4752=_0x697b('0x6f')+_0x49298a;_0x1059cd[_0x697b('0x47')](_0x697b('0x70')+_0x2d4752+_0x697b('0x71'));}var _0x57d727=util[_0x697b('0xf')](_0x697b('0x72'),_0x4f0961,_0x2d4752,_0x56408a,_0x9015c0['ListId'],_0x9015c0[_0x697b('0x37')]||null,NOW,NOW);if(_['isNil'](_0x5e6edb[_0x697b('0x21')])){_0x57d727+=',\x20scheduledAt\x20=\x20NOW()';}_0x1059cd[_0x697b('0x47')](_0x57d727);if(_0x9015c0[_0x697b('0x6e')]&&_0x9015c0[_0x697b('0x6e')][_0x697b('0x55')]){_0x1059cd[_0x697b('0x47')](insertCmContact(_0x9015c0[_0x697b('0x23')],_0x2d4752,_0x9015c0[_0x697b('0x6e')],_0x5e6edb));_0x1059cd['push'](_0x697b('0x73')+_0x2d4752+';');}_0x1059cd['push'](insertCmHopper(_0x9015c0[_0x697b('0x23')],'voice_queues_has_cm_lists','voice_queues',_0x697b('0x74'),_0x34e036));_0x1059cd[_0x697b('0x47')](insertCmHopperBlack(_0x9015c0[_0x697b('0x23')],_0x697b('0x75'),_0x697b('0x76'),_0x697b('0x74')));_0x1059cd[_0x697b('0x47')](insertCmHopper(_0x9015c0['ListId'],'campaigns_has_cm_lists','campaigns',_0x697b('0x77'),_0x34e036));_0x1059cd['push'](insertCmHopperBlack(_0x9015c0[_0x697b('0x23')],_0x697b('0x78'),_0x697b('0x79'),_0x697b('0x77')));BPromise[_0x697b('0x7a')](_0x1059cd,handleQuery)['then'](function(_0x2de3a5){stats[_0x697b('0x7b')]=!![];stats[_0x697b('0x7c')]=_0x9015c0[_0x697b('0x6e')]&&_0x9015c0[_0x697b('0x6e')][_0x697b('0x55')]?results[0x2][_0x697b('0x7c')]:results[0x0]['affectedRows'];socket[_0x697b('0x69')](_0x697b('0x7d')+_0x49298a,stats);fs[_0x697b('0x7e')](_0x2d4ff5);fs['unlink'](_0x4f0961);process[_0x697b('0x40')](0x0);})['catch'](function(_0x19445f){logger[_0x697b('0x3e')](_0x19445f[_0x697b('0x3f')]);process[_0x697b('0x40')](0x1);});}catch(_0x4e4260){logger[_0x697b('0x3e')](_0x697b('0x7f'),_0x4e4260[_0x697b('0x3f')]);process[_0x697b('0x40')](0x1);}},'error':function(_0x5a113b,_0x360fd8,_0x184d7a,_0x435f9d){throw new Error(_0x435f9d);}});}function validate(){if(process['argv']&&process[_0x697b('0x80')][_0x697b('0x55')]<0x4){throw new Error(_0x697b('0x81'));}var _0x5677d0=path[_0x697b('0x14')](config[_0x697b('0x4d')],_0x697b('0x4e'),process[_0x697b('0x80')][0x2]);if(!fs[_0x697b('0x82')](_0x5677d0)){throw new Error(_0x697b('0x83'));}var _0x29229d={};try{_0x29229d=JSON[_0x697b('0x52')](process[_0x697b('0x80')][0x3]);if(!_0x29229d[_0x697b('0x4c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x29229d[_0x697b('0x4c')][_0x697b('0x12')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x29229d['binding'][_0x697b('0x65')]){throw new Error(_0x697b('0x84'));}var _0x2c7d03=0x0;if(_0x29229d[_0x697b('0x4c')][_0x697b('0x26')]){_0x2c7d03=0x1;}if(!_0x29229d[_0x697b('0x23')]){throw new Error(_0x697b('0x85'));}}catch(_0x383306){throw new Error(_0x697b('0x86'));}var _0x191e52=[];try{_0x191e52=_['map'](JSON['parse'](process[_0x697b('0x80')][0x4]),'id');}catch(_0x28669d){logger['info']('No\x20agent\x20available');}main(_0x5677d0,_0x29229d,_0x191e52,_0x2c7d03);}validate();process['on'](_0x697b('0x87'),handleStop);process['on'](_0x697b('0x88'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index b1adf91..a610145 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 _0xdb28=['toLowerCase','voice','inbound','variable','queue','calleridnum','outbound','push','string','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','Complete\x20Time','Duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdb28,0x106));var _0x8db2=function(_0x2f7fd1,_0xf99ec1){_0x2f7fd1=_0x2f7fd1-0x0;var _0x2b288c=_0xdb28[_0x2f7fd1];return _0x2b288c;};'use strict';exports[_0x8db2('0x0')]=function(_0x4221b3,_0x1dc797){var _0xf66e59=[{'type':'string','content':_0x8db2('0x1'),'variableName':null}];switch(_0x4221b3[_0x8db2('0x2')]()){case _0x8db2('0x3'):switch(_0x1dc797[_0x8db2('0x2')]()){case _0x8db2('0x4'):_0xf66e59['push']({'type':_0x8db2('0x5'),'content':'','variableName':_0x8db2('0x6')});_0xf66e59['push']({'type':'variable','content':'','variableName':_0x8db2('0x7')});break;case _0x8db2('0x8'):_0xf66e59[_0x8db2('0x9')]({'type':_0x8db2('0xa'),'content':_0x8db2('0xb'),'variableName':null});_0xf66e59[_0x8db2('0x9')]({'type':_0x8db2('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0xf66e59;};exports[_0x8db2('0xc')]=function(_0x476216,_0x1f62af){var _0x57015f=[];switch(_0x476216[_0x8db2('0x2')]()){case _0x8db2('0x3'):switch(_0x1f62af['toLowerCase']()){case _0x8db2('0x4'):_0x57015f=[{'type':_0x8db2('0xa'),'content':_0x8db2('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0xf'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x10'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x11')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x12'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x13')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x14'),'keyType':'variable','variableName':_0x8db2('0x6')},{'type':_0x8db2('0xe'),'content':'','key':'UniqueId','keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x15')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x16'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x17')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x18'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x19')},{'type':'keyValue','content':'','key':_0x8db2('0x1a'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x1b')},{'type':_0x8db2('0xa'),'content':_0x8db2('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x8db2('0x1d'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x17')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x1e'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x1f')},{'type':'keyValue','content':'','key':_0x8db2('0x20'),'keyType':'variable','variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x21')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x22'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x23')}];break;case'outbound':_0x57015f=[{'type':_0x8db2('0xa'),'content':_0x8db2('0xd'),'variableName':null},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x24'),'keyType':'variable','keyContent':'','variableName':_0x8db2('0x1b')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x25'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':_0x8db2('0x26')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x27'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':_0x8db2('0x15')},{'type':'keyValue','content':'','key':_0x8db2('0x16'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x8db2('0xa'),'content':_0x8db2('0x1c')},{'type':_0x8db2('0xe'),'content':'','key':'Answer\x20Time','keyType':_0x8db2('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x28'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x8db2('0x29'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0x8db2('0x2a'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':_0x8db2('0x2b')}];break;}}return _0x57015f;}; \ No newline at end of file +var _0x5f66=['***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','queue','calleridnum','outbound','push','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Number','destcalleridnum'];(function(_0x2f4266,_0x4df175){var _0x1ee274=function(_0x3ede72){while(--_0x3ede72){_0x2f4266['push'](_0x2f4266['shift']());}};_0x1ee274(++_0x4df175);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';exports['getSubjects']=function(_0x61c60c,_0x4a3887){var _0x2d5fd9=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1'),'variableName':null}];switch(_0x61c60c[_0x65f6('0x2')]()){case _0x65f6('0x3'):switch(_0x4a3887['toLowerCase']()){case _0x65f6('0x4'):_0x2d5fd9['push']({'type':_0x65f6('0x5'),'content':'','variableName':_0x65f6('0x6')});_0x2d5fd9['push']({'type':'variable','content':'','variableName':_0x65f6('0x7')});break;case _0x65f6('0x8'):_0x2d5fd9[_0x65f6('0x9')]({'type':_0x65f6('0x0'),'content':_0x65f6('0xa'),'variableName':null});_0x2d5fd9[_0x65f6('0x9')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x2d5fd9;};exports[_0x65f6('0xb')]=function(_0x2f6d5b,_0x264647){var _0x25c416=[];switch(_0x2f6d5b['toLowerCase']()){case _0x65f6('0x3'):switch(_0x264647['toLowerCase']()){case'inbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x7')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xd'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0xe')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xf'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x10')},{'type':'keyValue','content':'','key':_0x65f6('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x12'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x16'),'keyType':'variable','variableName':_0x65f6('0x17')},{'type':_0x65f6('0x0'),'content':_0x65f6('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x19'),'keyType':_0x65f6('0x5'),'variableName':'agentcalledAt'},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x65f6('0x1a')},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x1b')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1c'),'keyType':'variable','variableName':_0x65f6('0x1d')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1e'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':_0x65f6('0x20'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x21'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x22')},{'type':_0x65f6('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x65f6('0x23'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x65f6('0x24'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x25')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x26'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x27'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x25c416;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 9b6aa9e..2a37171 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 _0x3967=['tracked','user','query','clone','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','Interaction','findOne','info','catch'];(function(_0x5f5497,_0x50803a){var _0x10e943=function(_0x2f5faa){while(--_0x2f5faa){_0x5f5497['push'](_0x5f5497['shift']());}};_0x10e943(++_0x50803a);}(_0x3967,0x159));var _0x7396=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0x3967[_0x3e91a9];return _0x25c9ad;};'use strict';var _=require(_0x7396('0x0'));var db=require(_0x7396('0x1'))['db'];var loggers={'openchannel':require(_0x7396('0x2'))(_0x7396('0x3')),'mail':require(_0x7396('0x2'))(_0x7396('0x4')),'fax':require('../../config/logger')(_0x7396('0x5')),'sms':require('../../config/logger')(_0x7396('0x6')),'chat':require(_0x7396('0x2'))(_0x7396('0x7'))};function getInteractionId(_0x353883,_0x57085a,_0x2b6945){if(_0x353883&&_0x353883[_[_0x7396('0x8')](_0x2b6945)+'InteractionId']){return _0x353883[_['upperFirst'](_0x2b6945)+_0x7396('0x9')];}else if(_0x353883&&_0x353883['id']){return _0x353883['id'];}else if(_0x57085a&&_0x57085a['id']){return _0x57085a['id'];}else{return _0x7396('0xa');}}function log(_0x4706fa,_0x197ff6,_0x2f89be,_0xd2a12d,_0x56ca8a,_0x114d26){loggers[_0x56ca8a[_0x7396('0xb')]()][_0x4706fa](_0x7396('0xc'),_0x114d26[_0x7396('0xd')](),_0x197ff6?_0x197ff6['id']:null,_0x197ff6?_0x197ff6['name']:null,_0x197ff6?_0x197ff6[_0x7396('0xe')]:null,getInteractionId(_0x2f89be,_0xd2a12d,_0x56ca8a),_0x2f89be?JSON['stringify'](_0x2f89be):'null');}function updateUser(_0x3ffed8,_0x39bb9d,_0x55edec,_0xf1de28,_0x5e3a39){db[_['upperFirst'](_0xf1de28)+_0x7396('0xf')][_0x7396('0x10')]({'where':{'id':getInteractionId(_0x39bb9d,_0x55edec,_0xf1de28)}})['then'](function(_0x206a36){if(_0x206a36){return _0x206a36['update']({'UserId':_0x3ffed8?_0x3ffed8['id']:null});}})['then'](function(_0x4a9694){if(_0x4a9694){log(_0x7396('0x11'),_0x3ffed8,_0x39bb9d,_0x55edec,_0xf1de28,_0x5e3a39);}})[_0x7396('0x12')](function(){log('error',_0x3ffed8,_0x39bb9d,_0x55edec,_0xf1de28,_0x5e3a39);});}exports[_0x7396('0x13')]=function(_0x18473e,_0x37fb17){return function(_0x3e7a22,_0x2d0c0b,_0x38951b){var _0x9b265a=_0x3e7a22[_0x7396('0x14')];var _0x52eacf={};var _0x5d024e=_0x3e7a22[_0x7396('0x15')];if(_0x52eacf){_0x52eacf=_[_0x7396('0x16')](_0x3e7a22[_0x7396('0x17')]);_0x52eacf=_['omit'](_0x52eacf,[_0x7396('0x17'),_0x7396('0x18'),_0x7396('0x19'),_0x7396('0x1a'),_0x7396('0x1b')]);}updateUser(_0x9b265a,_0x52eacf,_0x5d024e,_0x18473e,_0x37fb17);_0x38951b(null);};}; \ No newline at end of file +var _0x3ff8=['body','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','upperFirst','unknown','toLowerCase','toUpperCase','name','stringify','null','Interaction','findOne','then','catch','error','tracked','query','clone','omit'];(function(_0x111f3b,_0x45d417){var _0x468136=function(_0x5a0347){while(--_0x5a0347){_0x111f3b['push'](_0x111f3b['shift']());}};_0x468136(++_0x45d417);}(_0x3ff8,0x1f2));var _0x83ff=function(_0x3e2f39,_0x52276d){_0x3e2f39=_0x3e2f39-0x0;var _0x1f915c=_0x3ff8[_0x3e2f39];return _0x1f915c;};'use strict';var _=require(_0x83ff('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x83ff('0x1'))(_0x83ff('0x2')),'mail':require('../../config/logger')(_0x83ff('0x3')),'fax':require(_0x83ff('0x1'))(_0x83ff('0x4')),'sms':require('../../config/logger')(_0x83ff('0x5')),'chat':require(_0x83ff('0x1'))(_0x83ff('0x6'))};function getInteractionId(_0xd56c11,_0x2406bf,_0x11fdc5){if(_0xd56c11&&_0xd56c11[_['upperFirst'](_0x11fdc5)+_0x83ff('0x7')]){return _0xd56c11[_[_0x83ff('0x8')](_0x11fdc5)+_0x83ff('0x7')];}else if(_0xd56c11&&_0xd56c11['id']){return _0xd56c11['id'];}else if(_0x2406bf&&_0x2406bf['id']){return _0x2406bf['id'];}else{return _0x83ff('0x9');}}function log(_0x529f2f,_0x3f201f,_0x9bd625,_0xd60283,_0x329f03,_0x4ef616){loggers[_0x329f03[_0x83ff('0xa')]()][_0x529f2f]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ef616[_0x83ff('0xb')](),_0x3f201f?_0x3f201f['id']:null,_0x3f201f?_0x3f201f[_0x83ff('0xc')]:null,_0x3f201f?_0x3f201f['role']:null,getInteractionId(_0x9bd625,_0xd60283,_0x329f03),_0x9bd625?JSON[_0x83ff('0xd')](_0x9bd625):_0x83ff('0xe'));}function updateUser(_0x4c59b4,_0x803538,_0x4f0b3a,_0x5929af,_0x35108e){db[_[_0x83ff('0x8')](_0x5929af)+_0x83ff('0xf')][_0x83ff('0x10')]({'where':{'id':getInteractionId(_0x803538,_0x4f0b3a,_0x5929af)}})[_0x83ff('0x11')](function(_0x2d2a90){if(_0x2d2a90){return _0x2d2a90['update']({'UserId':_0x4c59b4?_0x4c59b4['id']:null});}})[_0x83ff('0x11')](function(_0x38aa09){if(_0x38aa09){log('info',_0x4c59b4,_0x803538,_0x4f0b3a,_0x5929af,_0x35108e);}})[_0x83ff('0x12')](function(){log(_0x83ff('0x13'),_0x4c59b4,_0x803538,_0x4f0b3a,_0x5929af,_0x35108e);});}exports[_0x83ff('0x14')]=function(_0x1ce936,_0xc66a45){return function(_0x3a370d,_0xc589fc,_0x5b29d2){var _0x40f167=_0x3a370d['user'];var _0x3506d6={};var _0x3f6af9=_0x3a370d[_0x83ff('0x15')];if(_0x3506d6){_0x3506d6=_[_0x83ff('0x16')](_0x3a370d['body']);_0x3506d6=_[_0x83ff('0x17')](_0x3506d6,[_0x83ff('0x18'),_0x83ff('0x19'),_0x83ff('0x1a'),_0x83ff('0x1b'),_0x83ff('0x1c')]);}updateUser(_0x40f167,_0x3506d6,_0x3f6af9,_0x1ce936,_0xc66a45);_0x5b29d2(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 83ec679..c4ea906 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 _0x0f8f=['License','findOne','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use'];(function(_0x228607,_0x257322){var _0x4433d7=function(_0x1610f){while(--_0x1610f){_0x228607['push'](_0x228607['shift']());}};_0x4433d7(++_0x257322);}(_0x0f8f,0x1cc));var _0xf0f8=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x0f8f[_0x53bcc3];return _0x47c959;};'use strict';var crypto=require('crypto');var util=require(_0xf0f8('0x0'));var compose=require(_0xf0f8('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xf0f8('0x2'));function getValueFromLicense(_0x467125,_0x4e0a2e){if(_0x467125&&_0x4e0a2e){if(_0x4e0a2e[_0xf0f8('0x3')]&&_0x4e0a2e[_0xf0f8('0x4')]){var _0x759448=_0x4e0a2e[_0xf0f8('0x3')];var _0x5c33cc=_0x4e0a2e[_0xf0f8('0x4')];var _0x4a023a=_0x759448[_0xf0f8('0x5')]('-')[0x4];var _0x8b125b=_0x759448['split']('-')[0x0];var _0xaf78ff=crypto[_0xf0f8('0x6')](_0xf0f8('0x7'),util['format'](_0xf0f8('0x8'),_0x4a023a,_0x759448,_0x8b125b));var _0x24899b=_0xaf78ff[_0xf0f8('0x9')](_0x5c33cc,_0xf0f8('0xa'),_0xf0f8('0xb'));_0x24899b+=_0xaf78ff[_0xf0f8('0xc')](_0xf0f8('0xb'));var _0x165551=JSON[_0xf0f8('0xd')](_0x24899b);return _0x165551[_0xf0f8('0xe')](_0x467125)?_0x165551[_0x467125]:null;}}return null;}function isLimit(_0x405aff,_0x1bb91f,_0x5acb89,_0x37c2b9){var _0x3eabdd=_0x1bb91f;return compose()[_0xf0f8('0xf')](function(_0x9b8c6b,_0x1fa76f,_0x44366b){return db[_0xf0f8('0x10')][_0xf0f8('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x4991e4){var _0x55c43a=getValueFromLicense(_0x405aff,_0x4991e4);return _0x55c43a?_0x55c43a:_0x3eabdd;})['then'](function(_0x485592){_0x3eabdd=_0x485592;return _0x5acb89['count'](_0x37c2b9);})[_0xf0f8('0x12')](function(_0x366fea){if(_0x366fea>=_0x3eabdd){return _0x1fa76f[_0xf0f8('0x13')](0x193)[_0xf0f8('0x14')]({'message':util[_0xf0f8('0x15')](_0xf0f8('0x16'),_0x405aff)});}_0x44366b();})[_0xf0f8('0x17')](function(_0x56ef42){_0x44366b(_0x56ef42);});});}function isUserLimit(){return isLimit(_0xf0f8('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xf0f8('0x19')},{'role':_0xf0f8('0x1a')}]}});}exports[_0xf0f8('0x1b')]=isUserLimit; \ No newline at end of file +var _0xa99d=['catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xa99d,0xb3));var _0xda99=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xa99d[_0x3a7a9c];return _0x59156e;};'use strict';var crypto=require(_0xda99('0x0'));var util=require(_0xda99('0x1'));var compose=require(_0xda99('0x2'));var db=require(_0xda99('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x2a336f,_0x28d1c6){if(_0x2a336f&&_0x28d1c6){if(_0x28d1c6[_0xda99('0x4')]&&_0x28d1c6[_0xda99('0x5')]){var _0x41516f=_0x28d1c6[_0xda99('0x4')];var _0x18891e=_0x28d1c6[_0xda99('0x5')];var _0x5f1a30=_0x41516f[_0xda99('0x6')]('-')[0x4];var _0x4fa3b8=_0x41516f[_0xda99('0x6')]('-')[0x0];var _0x82c6e6=crypto[_0xda99('0x7')](_0xda99('0x8'),util[_0xda99('0x9')](_0xda99('0xa'),_0x5f1a30,_0x41516f,_0x4fa3b8));var _0x5442ab=_0x82c6e6[_0xda99('0xb')](_0x18891e,_0xda99('0xc'),_0xda99('0xd'));_0x5442ab+=_0x82c6e6['final']('utf8');var _0x3494e5=JSON[_0xda99('0xe')](_0x5442ab);return _0x3494e5[_0xda99('0xf')](_0x2a336f)?_0x3494e5[_0x2a336f]:null;}}return null;}function isLimit(_0x345bc9,_0x391350,_0x29f197,_0x1296d2){var _0x587be2=_0x391350;return compose()[_0xda99('0x10')](function(_0x34f204,_0x357e85,_0x11719b){return db[_0xda99('0x11')][_0xda99('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5a04a7){var _0x4d0f4f=getValueFromLicense(_0x345bc9,_0x5a04a7);return _0x4d0f4f?_0x4d0f4f:_0x587be2;})['then'](function(_0x1a68ef){_0x587be2=_0x1a68ef;return _0x29f197[_0xda99('0x13')](_0x1296d2);})[_0xda99('0x14')](function(_0x323020){if(_0x323020>=_0x587be2){return _0x357e85[_0xda99('0x15')](0x193)[_0xda99('0x16')]({'message':util['format'](_0xda99('0x17'),_0x345bc9)});}_0x11719b();})[_0xda99('0x18')](function(_0x424b77){_0x11719b(_0x424b77);});});}function isUserLimit(){return isLimit(_0xda99('0x19'),0x1,db[_0xda99('0x1a')],{'where':{'$or':[{'role':_0xda99('0x1b')},{'role':_0xda99('0x1c')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6df74ad..eaa15e2 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 _0x7281=['isObject','length','hasOwnProperty','isNumeric','^[0-9]*$','isEmail','lodash','moment','sequelize','fields','split','isEmpty','forOwn','isArray','parse','limit','offset','sort','map','indexOf','priority','unsigned','substr','DESC','col','omit'];(function(_0x1654e,_0x31262b){var _0x544920=function(_0x972482){while(--_0x972482){_0x1654e['push'](_0x1654e['shift']());}};_0x544920(++_0x31262b);}(_0x7281,0xa2));var _0x1728=function(_0x43aecc,_0x3b3a3b){_0x43aecc=_0x43aecc-0x0;var _0x2e9e89=_0x7281[_0x43aecc];return _0x2e9e89;};'use strict';var _=require(_0x1728('0x0'));var moment=require(_0x1728('0x1'));var sequelize=require(_0x1728('0x2'));var LIMIT_VALUE=0xfa;exports[_0x1728('0x3')]=function(_0xedb1f2){var _0x57d2a9=null;if(_0xedb1f2){_0x57d2a9=_0xedb1f2[_0x1728('0x4')](',');}return _0x57d2a9;};exports['filters']=function(_0x853354){var _0x1dc627={};if(!_[_0x1728('0x5')](_0x853354)){_0x1dc627={};_[_0x1728('0x6')](_0x853354,function(_0x1f25e5,_0x1406b7){try{_0x1dc627[_0x1406b7]=_[_0x1728('0x7')](_0x1f25e5)?_0x1f25e5:JSON[_0x1728('0x8')](_0x1f25e5);}catch(_0x38367e){_0x1dc627[_0x1406b7]=_0x1f25e5[_0x1728('0x4')](',');}});}return _0x1dc627;};exports[_0x1728('0x9')]=function(_0x11a60d){_0x11a60d=parseInt(_0x11a60d,0xa);if(!_0x11a60d||_0x11a60d<0x0){_0x11a60d=LIMIT_VALUE;}return _0x11a60d;};exports[_0x1728('0xa')]=function(_0x14f6e6){_0x14f6e6=parseInt(_0x14f6e6,0xa);if(!_0x14f6e6||_0x14f6e6<0x0){_0x14f6e6=0x0;}return _0x14f6e6;};exports[_0x1728('0xb')]=function(_0x2edc5a){var _0x52def,_0x5a8884=null;if(_0x2edc5a){_0x52def=_0x2edc5a[_0x1728('0x4')](',');_0x5a8884=_[_0x1728('0xc')](_0x52def,function(_0x24df65){if(_0x24df65[_0x1728('0xd')]('-')===0x0){return[_0x24df65===_0x1728('0xe')?sequelize['cast'](sequelize['col']('priority'),_0x1728('0xf')):_0x24df65[_0x1728('0x10')](0x1),_0x1728('0x11')];}else{return[_0x24df65===_0x1728('0xe')?sequelize['cast'](sequelize[_0x1728('0x12')](_0x1728('0xe')),_0x1728('0xf')):_0x24df65,'ASC'];}});}return _0x5a8884;};exports[_0x1728('0x13')]=function(_0x22c3cd,_0x5337e0){if(_['isEmpty'](_0x22c3cd)){return _0x22c3cd;}if(_['isArray'](_0x22c3cd)){for(var _0x1d1aaa=0x0;_0x1d1aaa<_0x22c3cd['length'];_0x1d1aaa+=0x1){_0x22c3cd[_0x1d1aaa]=this[_0x1728('0x13')](_0x22c3cd[_0x1d1aaa],_0x5337e0);}return _0x22c3cd;}if(!_[_0x1728('0x14')](_0x22c3cd)){return _0x22c3cd;}if(_['isString'](_0x5337e0)){_0x5337e0=[_0x5337e0];}if(!_[_0x1728('0x7')](_0x5337e0)){return _0x22c3cd;}for(var _0x5849b5=0x0;_0x5849b5<_0x5337e0[_0x1728('0x15')];_0x5849b5+=0x1){_['unset'](_0x22c3cd,_0x5337e0[_0x5849b5]);}for(var _0xfc19db in _0x22c3cd){if(_0x22c3cd[_0x1728('0x16')](_0xfc19db)){_0x22c3cd[_0xfc19db]=this[_0x1728('0x13')](_0x22c3cd[_0xfc19db],_0x5337e0);}}return _0x22c3cd;};exports[_0x1728('0x17')]=function(_0x4486dd){return _0x4486dd['match'](RegExp(_0x1728('0x18')))?!![]:![];};exports[_0x1728('0x19')]=function(_0x33083f){return _0x33083f['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x19fe=['substr','DESC','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','lodash','fields','split','filters','isEmpty','forOwn','isArray','parse','offset','map','indexOf','priority','cast','unsigned'];(function(_0x28ebc9,_0x3a1246){var _0x5b4fd0=function(_0x32d689){while(--_0x32d689){_0x28ebc9['push'](_0x28ebc9['shift']());}};_0x5b4fd0(++_0x3a1246);}(_0x19fe,0x142));var _0xe19f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x19fe[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe19f('0x0'));var moment=require('moment');var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0xe19f('0x1')]=function(_0x79f925){var _0x7622ca=null;if(_0x79f925){_0x7622ca=_0x79f925[_0xe19f('0x2')](',');}return _0x7622ca;};exports[_0xe19f('0x3')]=function(_0x25f3f2){var _0x19923e={};if(!_[_0xe19f('0x4')](_0x25f3f2)){_0x19923e={};_[_0xe19f('0x5')](_0x25f3f2,function(_0x2acb23,_0x509b9a){try{_0x19923e[_0x509b9a]=_[_0xe19f('0x6')](_0x2acb23)?_0x2acb23:JSON[_0xe19f('0x7')](_0x2acb23);}catch(_0xe466b8){_0x19923e[_0x509b9a]=_0x2acb23[_0xe19f('0x2')](',');}});}return _0x19923e;};exports['limit']=function(_0x2c981c){_0x2c981c=parseInt(_0x2c981c,0xa);if(!_0x2c981c||_0x2c981c<0x0){_0x2c981c=LIMIT_VALUE;}return _0x2c981c;};exports[_0xe19f('0x8')]=function(_0x452dc4){_0x452dc4=parseInt(_0x452dc4,0xa);if(!_0x452dc4||_0x452dc4<0x0){_0x452dc4=0x0;}return _0x452dc4;};exports['sort']=function(_0x398d50){var _0x3b6a83,_0x52590e=null;if(_0x398d50){_0x3b6a83=_0x398d50['split'](',');_0x52590e=_[_0xe19f('0x9')](_0x3b6a83,function(_0x1b2587){if(_0x1b2587[_0xe19f('0xa')]('-')===0x0){return[_0x1b2587===_0xe19f('0xb')?sequelize[_0xe19f('0xc')](sequelize['col'](_0xe19f('0xb')),_0xe19f('0xd')):_0x1b2587[_0xe19f('0xe')](0x1),_0xe19f('0xf')];}else{return[_0x1b2587==='priority'?sequelize['cast'](sequelize[_0xe19f('0x10')]('priority'),_0xe19f('0xd')):_0x1b2587,_0xe19f('0x11')];}});}return _0x52590e;};exports[_0xe19f('0x12')]=function(_0x17daba,_0x1d42cf){if(_['isEmpty'](_0x17daba)){return _0x17daba;}if(_[_0xe19f('0x6')](_0x17daba)){for(var _0x56cdc9=0x0;_0x56cdc9<_0x17daba[_0xe19f('0x13')];_0x56cdc9+=0x1){_0x17daba[_0x56cdc9]=this[_0xe19f('0x12')](_0x17daba[_0x56cdc9],_0x1d42cf);}return _0x17daba;}if(!_[_0xe19f('0x14')](_0x17daba)){return _0x17daba;}if(_[_0xe19f('0x15')](_0x1d42cf)){_0x1d42cf=[_0x1d42cf];}if(!_['isArray'](_0x1d42cf)){return _0x17daba;}for(var _0x10f53f=0x0;_0x10f53f<_0x1d42cf[_0xe19f('0x13')];_0x10f53f+=0x1){_[_0xe19f('0x16')](_0x17daba,_0x1d42cf[_0x10f53f]);}for(var _0x2f1b1e in _0x17daba){if(_0x17daba[_0xe19f('0x17')](_0x2f1b1e)){_0x17daba[_0x2f1b1e]=this[_0xe19f('0x12')](_0x17daba[_0x2f1b1e],_0x1d42cf);}}return _0x17daba;};exports[_0xe19f('0x18')]=function(_0x1d2dbf){return _0x1d2dbf[_0xe19f('0x19')](RegExp(_0xe19f('0x1a')))?!![]:![];};exports[_0xe19f('0x1b')]=function(_0x341421){return _0x341421[_0xe19f('0x19')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index fb0c52a..11f199a 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x1b57a2,_0x490afd){var _0x2a86be=function(_0x545ddf){while(--_0x545ddf){_0x1b57a2['push'](_0x1b57a2['shift']());}};_0x2a86be(++_0x490afd);}(_0xe706,0xa3));var _0x6e70=function(_0x31f2dc,_0x4b13bd){_0x31f2dc=_0x31f2dc-0x0;var _0x2359b2=_0xe706[_0x31f2dc];return _0x2359b2;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());}; \ No newline at end of file +var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 7c4bb4b..c052f99 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 _0x5cf0=['00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','family','IPv4','internal','head','mac'];(function(_0x1e14f6,_0x2bab0e){var _0xa8d17f=function(_0x4cbe03){while(--_0x4cbe03){_0x1e14f6['push'](_0x1e14f6['shift']());}};_0xa8d17f(++_0x2bab0e);}(_0x5cf0,0x114));var _0x05cf=function(_0x4503d6,_0x41475e){_0x4503d6=_0x4503d6-0x0;var _0x3c09fa=_0x5cf0[_0x4503d6];return _0x3c09fa;};'use strict';var _=require(_0x05cf('0x0'));var os=require('os');var crypto=require(_0x05cf('0x1'));var machine=require(_0x05cf('0x2'));var exec=require(_0x05cf('0x3'))[_0x05cf('0x4')];function getInterfaces(){var _0x17582d=[];var _0x29c5a4=os['networkInterfaces']();var _0x4ac21f=_[_0x05cf('0x5')](_[_0x05cf('0x6')](_0x29c5a4));for(var _0x31be1b=0x0;_0x31be1b<_0x4ac21f['length'];_0x31be1b++){var _0x10a964=_0x29c5a4[_0x4ac21f[_0x31be1b]]['filter'](function(_0xa829ea){return _0xa829ea[_0x05cf('0x7')]===_0x05cf('0x8')&&_0xa829ea[_0x05cf('0x9')]===![];});_0x17582d=_0x17582d['concat'](_0x10a964);}return _0x17582d;}function getFirstInterface(){var _0x203144=_[_0x05cf('0xa')](getInterfaces());return{'macAddress':_0x203144&&_0x203144['mac']?_0x203144[_0x05cf('0xb')]:_0x05cf('0xc'),'ipAddress':_0x203144&&_0x203144['address']?_0x203144[_0x05cf('0xd')]:_0x05cf('0xe')};}exports[_0x05cf('0xf')]=getFirstInterface;function getCPUhash(){var _0x4004e0=_[_0x05cf('0x5')](os['cpus']()[_0x05cf('0x10')](function(_0x1daa03){return _0x1daa03[_0x05cf('0x11')];}))[_0x05cf('0x12')](':');return crypto[_0x05cf('0x13')](_0x05cf('0x14'))[_0x05cf('0x15')](_0x4004e0)['digest'](_0x05cf('0x16'));}exports[_0x05cf('0x17')]=function(){switch(os['platform']()){case _0x05cf('0x18'):return exec(_0x05cf('0x19'),{'encoding':_0x05cf('0x1a')})[_0x05cf('0x1b')]('\x0d\x0a','');default:var _0x1393d7=getFirstInterface();var _0x3c4dae=getCPUhash();var _0x30fd0c=_0x3c4dae+'|'+os['hostname']()+'|'+_0x1393d7[_0x05cf('0x1c')]+'|'+_0x1393d7[_0x05cf('0x1d')];var _0x218b19=crypto['createHash'](_0x05cf('0x14'))[_0x05cf('0x15')](_0x30fd0c)[_0x05cf('0x1e')](_0x05cf('0x16'));return _0x218b19[_0x05cf('0x1f')](0x0,0x8)+'-'+_0x218b19['substring'](0x8,0xc)+'-'+_0x218b19['substring'](0xc,0x10)+'-'+_0x218b19[_0x05cf('0x1f')](0x10,0x14)+'-'+_0x218b19['substring'](0x14);}}; \ No newline at end of file +var _0xbf2b=['utf8','replace','hostname','macAddress','ipAddress','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','keys','length','filter','family','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','createHash','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x571844,_0x1f12e0){var _0x3c5829=function(_0x44c8ec){while(--_0x44c8ec){_0x571844['push'](_0x571844['shift']());}};_0x3c5829(++_0x1f12e0);}(_0xbf2b,0x103));var _0xbbf2=function(_0x591859,_0x467cee){_0x591859=_0x591859-0x0;var _0x2370fe=_0xbf2b[_0x591859];return _0x2370fe;};'use strict';var _=require(_0xbbf2('0x0'));var os=require('os');var crypto=require(_0xbbf2('0x1'));var machine=require(_0xbbf2('0x2'));var exec=require(_0xbbf2('0x3'))[_0xbbf2('0x4')];function getInterfaces(){var _0x49151d=[];var _0x4bd703=os[_0xbbf2('0x5')]();var _0x485eaa=_['orderBy'](_[_0xbbf2('0x6')](_0x4bd703));for(var _0x12c526=0x0;_0x12c526<_0x485eaa[_0xbbf2('0x7')];_0x12c526++){var _0x2960cc=_0x4bd703[_0x485eaa[_0x12c526]][_0xbbf2('0x8')](function(_0x162539){return _0x162539[_0xbbf2('0x9')]==='IPv4'&&_0x162539['internal']===![];});_0x49151d=_0x49151d[_0xbbf2('0xa')](_0x2960cc);}return _0x49151d;}function getFirstInterface(){var _0xa4f095=_[_0xbbf2('0xb')](getInterfaces());return{'macAddress':_0xa4f095&&_0xa4f095[_0xbbf2('0xc')]?_0xa4f095[_0xbbf2('0xc')]:_0xbbf2('0xd'),'ipAddress':_0xa4f095&&_0xa4f095['address']?_0xa4f095[_0xbbf2('0xe')]:'127.0.0.1'};}exports[_0xbbf2('0xf')]=getFirstInterface;function getCPUhash(){var _0x56ff5d=_[_0xbbf2('0x10')](os[_0xbbf2('0x11')]()[_0xbbf2('0x12')](function(_0x504edd){return _0x504edd[_0xbbf2('0x13')];}))[_0xbbf2('0x14')](':');return crypto[_0xbbf2('0x15')]('md5')[_0xbbf2('0x16')](_0x56ff5d)[_0xbbf2('0x17')](_0xbbf2('0x18'));}exports[_0xbbf2('0x19')]=function(){switch(os[_0xbbf2('0x1a')]()){case _0xbbf2('0x1b'):return exec(_0xbbf2('0x1c'),{'encoding':_0xbbf2('0x1d')})[_0xbbf2('0x1e')]('\x0d\x0a','');default:var _0xb39bf5=getFirstInterface();var _0x17691f=getCPUhash();var _0x18ebe2=_0x17691f+'|'+os[_0xbbf2('0x1f')]()+'|'+_0xb39bf5[_0xbbf2('0x20')]+'|'+_0xb39bf5[_0xbbf2('0x21')];var _0x3a63eb=crypto[_0xbbf2('0x15')](_0xbbf2('0x22'))[_0xbbf2('0x16')](_0x18ebe2)[_0xbbf2('0x17')]('hex');return _0x3a63eb[_0xbbf2('0x23')](0x0,0x8)+'-'+_0x3a63eb['substring'](0x8,0xc)+'-'+_0x3a63eb[_0xbbf2('0x23')](0xc,0x10)+'-'+_0x3a63eb[_0xbbf2('0x23')](0x10,0x14)+'-'+_0x3a63eb[_0xbbf2('0x23')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1cfa5f2..b9360bb 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 _0x6564=['version','../../mysqldb','../environment','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','catch','createCipher','aes-256-ctr','update','utf8','base64','final','createDecipher','secrets','||FIELD||VALUE||\x0a','email','then','|reason|','|uuid|','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise','bluebird','pkginfo'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x6564,0x1a1));var _0x4656=function(_0x53c3a1,_0x42a944){_0x53c3a1=_0x53c3a1-0x0;var _0x4f385e=_0x6564[_0x53c3a1];return _0x4f385e;};'use strict';var util=require('util');var crypto=require('crypto');var moment=require('moment');var rp=require(_0x4656('0x0'));var BPromise=require(_0x4656('0x1'));var pkginfo=require(_0x4656('0x2'))(module,_0x4656('0x3'));var db=require(_0x4656('0x4'))['db'];var config=require(_0x4656('0x5'));var hardware=require(_0x4656('0x6'));var logger=require('../logger')(_0x4656('0x7'));var jira=require('../../api/jira/jira.controller');var HOST=_0x4656('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xcba408){return new BPromise(function(_0x42db7d,_0x1285c5){var _0x28ad14=util[_0x4656('0x9')](_0x4656('0xa'),HOST,_0xcba408,module['exports']['version']);if(oldToken){_0x28ad14=util[_0x4656('0x9')](_0x4656('0xb'),HOST,_0xcba408,module[_0x4656('0xc')][_0x4656('0x3')],oldToken);}var _0xdf9c64={'uri':_0x28ad14,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xdf9c64)['then'](function(_0x4c64bc){_0x42db7d(_0x4c64bc);})[_0x4656('0xd')](function(_0x4858d0){_0x1285c5(_0x4858d0);});});}function encryptDate(_0x47a6c9){var _0x54a647=crypto[_0x4656('0xe')](_0x4656('0xf'),config['secrets']['session']);var _0x344e08=_0x54a647[_0x4656('0x10')](_0x47a6c9,_0x4656('0x11'),_0x4656('0x12'));_0x344e08+=_0x54a647[_0x4656('0x13')](_0x4656('0x12'));return _0x344e08;}function decryptDate(_0x107063){var _0xf17a6d=crypto[_0x4656('0x14')](_0x4656('0xf'),config[_0x4656('0x15')]['session']);var _0x524206=_0xf17a6d[_0x4656('0x10')](_0x107063,_0x4656('0x12'),_0x4656('0x11'));_0x524206+=_0xf17a6d['final'](_0x4656('0x11'));return _0x524206;}function sendJiraAlert(_0x830078,_0x1ac4fd,_0x2da17a){var _0xcea315=_0x4656('0x16');return db['User']['findOne']({'where':{'role':'admin'},'attributes':['fullname',_0x4656('0x17')],'raw':!![]})[_0x4656('0x18')](function(_0x1b8900){ADMIN=_0x1b8900;_0xcea315+=_0x4656('0x19')+_0x2da17a+'|\x0a';_0xcea315+=_0x4656('0x1a')+_0x830078+'|\x0a';_0xcea315+=_0x4656('0x1b')+_0x1ac4fd+'|\x0a';_0xcea315+=_0x4656('0x1c')+ADMIN[_0x4656('0x1d')]+'|\x0a';_0xcea315+=_0x4656('0x1e')+ADMIN[_0x4656('0x17')]+'|\x0a';return _0xcea315;})[_0x4656('0x18')](function(_0x175e0f){var _0x4b3142=hardware[_0x4656('0x1f')]()[_0x4656('0x20')];return jira[_0x4656('0x21')]({'key':_0x4656('0x22'),'summary':_0x4656('0x23'),'description':_0x175e0f,'issuetype':_0x4656('0x24'),'oldToken':_0x830078,'newToken':_0x1ac4fd,'email':ADMIN[_0x4656('0x17')],'name':ADMIN[_0x4656('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x4b3142});});}function manageLicense(_0x21f42c,_0x4198b6){var _0x2bef28=_0x4198b6[_0x4656('0x25')]({'plain':!![]});httpRequest(_0x21f42c)[_0x4656('0x18')](function(_0x1f112d){if(oldToken){oldToken=undefined;}if(_0x1f112d['active']){if(!_0x2bef28['license']&&_0x2bef28[_0x4656('0x7')]!=_0x1f112d[_0x4656('0x7')]||_0x2bef28['license']&&_0x2bef28[_0x4656('0x26')]){logger[_0x4656('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2bef28[_0x4656('0x7')]&&!_0x2bef28['data2']&&_0x2bef28[_0x4656('0x7')]!=_0x1f112d[_0x4656('0x7')]){logger[_0x4656('0x27')](_0x4656('0x28'));}if(_0x2bef28[_0x4656('0x7')]&&!_0x2bef28[_0x4656('0x26')]&&_0x2bef28['license']==_0x1f112d[_0x4656('0x7')]){return _0x4198b6;}return _0x4198b6[_0x4656('0x10')]({'data1':_0x21f42c,'data2':null,'license':_0x1f112d[_0x4656('0x7')]});}else{if(_0x1f112d[_0x4656('0x7')]||_0x2bef28['license']){if(!_0x2bef28[_0x4656('0x26')]){if(_0x2bef28[_0x4656('0x29')]==_0x21f42c){GRAY_PERIOD_REASON=_0x4656('0x2a');logger[_0x4656('0x27')](_0x4656('0x2b'));}else{GRAY_PERIOD_REASON=_0x4656('0x2c');oldToken=_0x2bef28['data1'];logger[_0x4656('0x27')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2bef28['data1'],_0x21f42c);}sendJiraAlert(_0x2bef28[_0x4656('0x29')],_0x1f112d[_0x4656('0x2d')],GRAY_PERIOD_REASON);logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x4656('0x2e')](),moment()[_0x4656('0x9')](_0x4656('0x2f')));return _0x4198b6[_0x4656('0x10')]({'data2':encryptDate(moment()[_0x4656('0x9')](_0x4656('0x2f')))});}else{if(moment()[_0x4656('0x30')](decryptDate(_0x2bef28[_0x4656('0x26')]),'days')>DAYS){logger[_0x4656('0x27')](_0x4656('0x31'),moment()[_0x4656('0x9')](_0x4656('0x2f')));return _0x4198b6[_0x4656('0x10')]({'data1':_0x21f42c,'data2':null,'license':null});}}}else{if(_0x2bef28[_0x4656('0x29')]!=_0x21f42c){logger[_0x4656('0x27')](_0x4656('0x32'),_0x2bef28[_0x4656('0x29')],_0x21f42c);return _0x4198b6[_0x4656('0x10')]({'data1':_0x21f42c,'data2':null,'license':null});}}}return _0x4198b6;})[_0x4656('0x18')](function(_0x55f9d3){_0x4198b6=_0x55f9d3;})[_0x4656('0xd')](function(_0x361539){logger[_0x4656('0x33')](_0x361539[_0x4656('0x34')]);})[_0x4656('0x35')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4198b6);},TIME);});}function defaultLicense(){var _0x335c0e=hardware[_0x4656('0x36')]();if(_0x335c0e){return db[_0x4656('0x37')][_0x4656('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x335c0e}})[_0x4656('0x39')](function(_0x2c912d,_0x1a83dc){logger['info'](_0x4656('0x3a'),_0x335c0e);manageLicense(_0x335c0e,_0x2c912d);})['catch'](function(_0x463d79){logger[_0x4656('0x33')](_0x463d79[_0x4656('0x34')]);});}}exports[_0x4656('0x3b')]=defaultLicense; \ No newline at end of file +var _0xa2ff=['THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','request-promise','../../mysqldb','../environment','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','aes-256-ctr','secrets','session','update','base64','final','createDecipher','utf8','||FIELD||VALUE||\x0a','User','findOne','fullname','email','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xa2ff,0xdb));var _0xfa2f=function(_0x432782,_0x587627){_0x432782=_0x432782-0x0;var _0x49d0aa=_0xa2ff[_0x432782];return _0x49d0aa;};'use strict';var util=require('util');var crypto=require('crypto');var moment=require('moment');var rp=require(_0xfa2f('0x0'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0xfa2f('0x1'))['db'];var config=require(_0xfa2f('0x2'));var hardware=require(_0xfa2f('0x3'));var logger=require('../logger')(_0xfa2f('0x4'));var jira=require(_0xfa2f('0x5'));var HOST=_0xfa2f('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xf71b9a){return new BPromise(function(_0x26cf0b,_0x4a33d9){var _0x3b3d16=util['format'](_0xfa2f('0x7'),HOST,_0xf71b9a,module[_0xfa2f('0x8')][_0xfa2f('0x9')]);if(oldToken){_0x3b3d16=util[_0xfa2f('0xa')](_0xfa2f('0xb'),HOST,_0xf71b9a,module[_0xfa2f('0x8')][_0xfa2f('0x9')],oldToken);}var _0x21b19a={'uri':_0x3b3d16,'method':_0xfa2f('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x21b19a)[_0xfa2f('0xd')](function(_0x3ba84b){_0x26cf0b(_0x3ba84b);})['catch'](function(_0x256bd5){_0x4a33d9(_0x256bd5);});});}function encryptDate(_0x1360bb){var _0x2d6af7=crypto['createCipher'](_0xfa2f('0xe'),config[_0xfa2f('0xf')][_0xfa2f('0x10')]);var _0x185472=_0x2d6af7[_0xfa2f('0x11')](_0x1360bb,'utf8',_0xfa2f('0x12'));_0x185472+=_0x2d6af7[_0xfa2f('0x13')](_0xfa2f('0x12'));return _0x185472;}function decryptDate(_0x2bbdfd){var _0x28d960=crypto[_0xfa2f('0x14')](_0xfa2f('0xe'),config[_0xfa2f('0xf')][_0xfa2f('0x10')]);var _0x258f10=_0x28d960[_0xfa2f('0x11')](_0x2bbdfd,'base64',_0xfa2f('0x15'));_0x258f10+=_0x28d960['final'](_0xfa2f('0x15'));return _0x258f10;}function sendJiraAlert(_0x59aa4d,_0x219a57,_0x4f2cb2){var _0x3fff3f=_0xfa2f('0x16');return db[_0xfa2f('0x17')][_0xfa2f('0x18')]({'where':{'role':'admin'},'attributes':[_0xfa2f('0x19'),_0xfa2f('0x1a')],'raw':!![]})[_0xfa2f('0xd')](function(_0x5d87b5){ADMIN=_0x5d87b5;_0x3fff3f+=_0xfa2f('0x1b')+_0x4f2cb2+'|\x0a';_0x3fff3f+=_0xfa2f('0x1c')+_0x59aa4d+'|\x0a';_0x3fff3f+=_0xfa2f('0x1d')+_0x219a57+'|\x0a';_0x3fff3f+=_0xfa2f('0x1e')+ADMIN[_0xfa2f('0x19')]+'|\x0a';_0x3fff3f+=_0xfa2f('0x1f')+ADMIN[_0xfa2f('0x1a')]+'|\x0a';return _0x3fff3f;})[_0xfa2f('0xd')](function(_0x97fb57){var _0x509333=hardware[_0xfa2f('0x20')]()[_0xfa2f('0x21')];return jira[_0xfa2f('0x22')]({'key':_0xfa2f('0x23'),'summary':_0xfa2f('0x24'),'description':_0x97fb57,'issuetype':_0xfa2f('0x25'),'oldToken':_0x59aa4d,'newToken':_0x219a57,'email':ADMIN[_0xfa2f('0x1a')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x509333});});}function manageLicense(_0x390745,_0xe41d11){var _0xefc56d=_0xe41d11[_0xfa2f('0x26')]({'plain':!![]});httpRequest(_0x390745)['then'](function(_0x406b9b){if(oldToken){oldToken=undefined;}if(_0x406b9b[_0xfa2f('0x27')]){if(!_0xefc56d[_0xfa2f('0x4')]&&_0xefc56d[_0xfa2f('0x4')]!=_0x406b9b[_0xfa2f('0x4')]||_0xefc56d['license']&&_0xefc56d[_0xfa2f('0x28')]){logger['info'](_0xfa2f('0x29'));}if(_0xefc56d['license']&&!_0xefc56d[_0xfa2f('0x28')]&&_0xefc56d[_0xfa2f('0x4')]!=_0x406b9b[_0xfa2f('0x4')]){logger[_0xfa2f('0x2a')](_0xfa2f('0x2b'));}if(_0xefc56d[_0xfa2f('0x4')]&&!_0xefc56d[_0xfa2f('0x28')]&&_0xefc56d[_0xfa2f('0x4')]==_0x406b9b[_0xfa2f('0x4')]){return _0xe41d11;}return _0xe41d11[_0xfa2f('0x11')]({'data1':_0x390745,'data2':null,'license':_0x406b9b['license']});}else{if(_0x406b9b[_0xfa2f('0x4')]||_0xefc56d[_0xfa2f('0x4')]){if(!_0xefc56d[_0xfa2f('0x28')]){if(_0xefc56d[_0xfa2f('0x2c')]==_0x390745){GRAY_PERIOD_REASON=_0xfa2f('0x2d');logger[_0xfa2f('0x2a')](_0xfa2f('0x2e'));}else{GRAY_PERIOD_REASON=_0xfa2f('0x2f');oldToken=_0xefc56d[_0xfa2f('0x2c')];logger[_0xfa2f('0x2a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xefc56d['data1'],_0x390745);}sendJiraAlert(_0xefc56d[_0xfa2f('0x2c')],_0x406b9b[_0xfa2f('0x30')],GRAY_PERIOD_REASON);logger[_0xfa2f('0x2a')](_0xfa2f('0x31'),GRAY_PERIOD_REASON[_0xfa2f('0x32')](),moment()['format'](_0xfa2f('0x33')));return _0xe41d11[_0xfa2f('0x11')]({'data2':encryptDate(moment()[_0xfa2f('0xa')](_0xfa2f('0x33')))});}else{if(moment()[_0xfa2f('0x34')](decryptDate(_0xefc56d[_0xfa2f('0x28')]),'days')>DAYS){logger[_0xfa2f('0x2a')](_0xfa2f('0x35'),moment()[_0xfa2f('0xa')](_0xfa2f('0x33')));return _0xe41d11[_0xfa2f('0x11')]({'data1':_0x390745,'data2':null,'license':null});}}}else{if(_0xefc56d[_0xfa2f('0x2c')]!=_0x390745){logger[_0xfa2f('0x2a')](_0xfa2f('0x36'),_0xefc56d[_0xfa2f('0x2c')],_0x390745);return _0xe41d11[_0xfa2f('0x11')]({'data1':_0x390745,'data2':null,'license':null});}}}return _0xe41d11;})['then'](function(_0x5bac75){_0xe41d11=_0x5bac75;})['catch'](function(_0x4382c4){logger[_0xfa2f('0x37')](_0x4382c4[_0xfa2f('0x38')]);})[_0xfa2f('0x39')](function(){setTimeout(function(){manageLicense(hardware[_0xfa2f('0x3a')](),_0xe41d11);},TIME);});}function defaultLicense(){var _0x249d2b=hardware[_0xfa2f('0x3a')]();if(_0x249d2b){return db[_0xfa2f('0x3b')][_0xfa2f('0x3c')]({'where':{'id':0x1},'defaults':{'data1':_0x249d2b}})[_0xfa2f('0x3d')](function(_0xfe903d,_0x2e7865){logger[_0xfa2f('0x2a')](_0xfa2f('0x3e'),_0x249d2b);manageLicense(_0x249d2b,_0xfe903d);})[_0xfa2f('0x3f')](function(_0x36d5a1){logger['error'](_0x36d5a1[_0xfa2f('0x38')]);});}}exports[_0xfa2f('0x40')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index ef02ba4..89649b1 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 _0x31c1=['utf8','final','parse','demo','uuid','machineUuid','getUuid','secrets','session','gray','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','getLicense','defaults','checkLicense','crypto','lodash','./hardware','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64'];(function(_0x3fe48d,_0x4e6adb){var _0xd39f6e=function(_0x38ea25){while(--_0x38ea25){_0x3fe48d['push'](_0x3fe48d['shift']());}};_0xd39f6e(++_0x4e6adb);}(_0x31c1,0x17e));var _0x131c=function(_0x22f876,_0x5d8b8d){_0x22f876=_0x22f876-0x0;var _0x51215d=_0x31c1[_0x22f876];return _0x51215d;};'use strict';var crypto=require(_0x131c('0x0'));var util=require('util');var _=require(_0x131c('0x1'));var moment=require('moment');var hardware=require(_0x131c('0x2'));var config=require('../environment');var db=require(_0x131c('0x3'))['db'];function checkLicense(_0x461d98,_0x17835e){if(_0x461d98){try{var _0x1b139f=_0x17835e||_0x461d98['license'];if(_[_0x131c('0x4')](_0x1b139f)){throw new Error(_0x131c('0x5'));}var _0x422d5b=_0x461d98[_0x131c('0x6')];var _0x28c749=_0x461d98['data2'];var _0x518d76=_0x422d5b[_0x131c('0x7')]('-')[0x4];var _0x337f3c=_0x422d5b['split']('-')[0x0];var _0x319f40=crypto[_0x131c('0x8')](_0x131c('0x9'),util[_0x131c('0xa')](_0x131c('0xb'),_0x518d76,_0x422d5b,_0x337f3c));var _0x42c5f2=_0x319f40[_0x131c('0xc')](_0x1b139f,_0x131c('0xd'),_0x131c('0xe'));_0x42c5f2+=_0x319f40[_0x131c('0xf')]('utf8');var _0x2807eb=JSON[_0x131c('0x10')](_0x42c5f2);_0x2807eb[_0x131c('0x11')]=![];_0x2807eb[_0x131c('0x12')]=_0x422d5b;_0x2807eb[_0x131c('0x13')]=hardware[_0x131c('0x14')]();if(_0x28c749){var _0xdbd7f6=crypto[_0x131c('0x8')](_0x131c('0x9'),config[_0x131c('0x15')][_0x131c('0x16')]);var _0x110b6f=_0xdbd7f6['update'](_0x28c749,_0x131c('0xd'),'utf8');_0x110b6f+=_0xdbd7f6[_0x131c('0xf')](_0x131c('0xe'));_0x2807eb[_0x131c('0x17')]=_0x110b6f;_0x2807eb[_0x131c('0x18')]=moment(_0x110b6f)[_0x131c('0x19')](0x7,_0x131c('0x1a'))[_0x131c('0xa')]();_0x2807eb[_0x131c('0x1b')]=_0x2807eb[_0x131c('0x12')]!=_0x2807eb[_0x131c('0x13')]?_0x131c('0x1c'):_0x131c('0x1d');}return _0x2807eb;}catch(_0x1381b1){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x131c('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x131c('0x1f'),'uuid':_0x461d98[_0x131c('0x6')],'machineUuid':hardware['getUuid'](),'message':_0x1381b1[_0x131c('0x20')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x461d98[_0x131c('0x6')],'machineUuid':hardware[_0x131c('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x131c('0x21')]=function(_0x524c94){return db['License']['find'](_[_0x131c('0x22')](_0x524c94,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x10cc40){return checkLicense(_0x10cc40,null);});};exports[_0x131c('0x23')]=checkLicense; \ No newline at end of file +var _0x5cb1=['getLicense','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','secrets','session','gray','add','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license'];(function(_0x2378ce,_0x114da4){var _0x2dbd02=function(_0xb8deb7){while(--_0xb8deb7){_0x2378ce['push'](_0x2378ce['shift']());}};_0x2dbd02(++_0x114da4);}(_0x5cb1,0x1e4));var _0x15cb=function(_0x103ff9,_0x576a4d){_0x103ff9=_0x103ff9-0x0;var _0x40693e=_0x5cb1[_0x103ff9];return _0x40693e;};'use strict';var crypto=require(_0x15cb('0x0'));var util=require(_0x15cb('0x1'));var _=require(_0x15cb('0x2'));var moment=require(_0x15cb('0x3'));var hardware=require(_0x15cb('0x4'));var config=require(_0x15cb('0x5'));var db=require(_0x15cb('0x6'))['db'];function checkLicense(_0x48ecfb,_0x1df764){if(_0x48ecfb){try{var _0x45a450=_0x1df764||_0x48ecfb['license'];if(_[_0x15cb('0x7')](_0x45a450)){throw new Error(_0x15cb('0x8'));}var _0x58f176=_0x48ecfb[_0x15cb('0x9')];var _0x3948af=_0x48ecfb[_0x15cb('0xa')];var _0x119284=_0x58f176[_0x15cb('0xb')]('-')[0x4];var _0x1c8432=_0x58f176[_0x15cb('0xb')]('-')[0x0];var _0x18a729=crypto[_0x15cb('0xc')](_0x15cb('0xd'),util[_0x15cb('0xe')](_0x15cb('0xf'),_0x119284,_0x58f176,_0x1c8432));var _0x3d0cf6=_0x18a729[_0x15cb('0x10')](_0x45a450,_0x15cb('0x11'),_0x15cb('0x12'));_0x3d0cf6+=_0x18a729[_0x15cb('0x13')](_0x15cb('0x12'));var _0x28a505=JSON[_0x15cb('0x14')](_0x3d0cf6);_0x28a505[_0x15cb('0x15')]=![];_0x28a505[_0x15cb('0x16')]=_0x58f176;_0x28a505[_0x15cb('0x17')]=hardware[_0x15cb('0x18')]();if(_0x3948af){var _0x4d1e8b=crypto[_0x15cb('0xc')]('aes-256-ctr',config[_0x15cb('0x19')][_0x15cb('0x1a')]);var _0x166ac4=_0x4d1e8b[_0x15cb('0x10')](_0x3948af,'base64',_0x15cb('0x12'));_0x166ac4+=_0x4d1e8b[_0x15cb('0x13')]('utf8');_0x28a505[_0x15cb('0x1b')]=_0x166ac4;_0x28a505['deadline']=moment(_0x166ac4)[_0x15cb('0x1c')](0x7,'days')[_0x15cb('0xe')]();_0x28a505[_0x15cb('0x1d')]=_0x28a505[_0x15cb('0x16')]!=_0x28a505[_0x15cb('0x17')]?_0x15cb('0x1e'):_0x15cb('0x1f');}return _0x28a505;}catch(_0x1ae259){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x15cb('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x15cb('0x21'),'uuid':_0x48ecfb['data1'],'machineUuid':hardware[_0x15cb('0x18')](),'message':_0x1ae259[_0x15cb('0x22')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x15cb('0x23'),'uuid':_0x48ecfb[_0x15cb('0x9')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x15cb('0x24')]=function(_0x3667a4){return db['License']['find'](_[_0x15cb('0x25')](_0x3667a4,{'raw':!![],'where':{'id':0x1}}))[_0x15cb('0x26')](function(_0x1a8b42){return checkLicense(_0x1a8b42,null);});};exports[_0x15cb('0x27')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 8ab0de8..3a49a67 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 _0x1db3=['secret','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x1db3,0x1e5));var _0x31db=function(_0x122f09,_0x348dc4){_0x122f09=_0x122f09-0x0;var _0x598787=_0x1db3[_0x122f09];return _0x598787;};'use strict';module['exports']={'DOMAIN':_0x31db('0x0'),'SESSION_SECRET':_0x31db('0x1'),'GOOGLE_ID':_0x31db('0x2'),'GOOGLE_SECRET':_0x31db('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xd353=['app-id','secret','exports','http://localhost:9000'];(function(_0x287b65,_0x480133){var _0x3417c6=function(_0x46a5fb){while(--_0x46a5fb){_0x287b65['push'](_0x287b65['shift']());}};_0x3417c6(++_0x480133);}(_0xd353,0x7e));var _0x3d35=function(_0x3ad77b,_0x13dd89){_0x3ad77b=_0x3ad77b-0x0;var _0x2d4f59=_0xd353[_0x3ad77b];return _0x2d4f59;};'use strict';module[_0x3d35('0x0')]={'DOMAIN':_0x3d35('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x3d35('0x2'),'GOOGLE_SECRET':_0x3d35('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 1d071b5..70f4a4c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa388=['%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','File','%s-%s','error','info','Console','env','moment','winston','util','path','INFO','join','/var','xcally','format'];(function(_0xebd78,_0x2994fc){var _0x4545b7=function(_0x4e1925){while(--_0x4e1925){_0xebd78['push'](_0xebd78['shift']());}};_0x4545b7(++_0x2994fc);}(_0xa388,0xc6));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x8a38('0x0'));var winston=require(_0x8a38('0x1'));var util=require(_0x8a38('0x2'));var path=require(_0x8a38('0x3'));var debugLevel=_0x8a38('0x4');function filename(_0x2a8edf,_0x56fad6){return path[_0x8a38('0x5')](_0x8a38('0x6'),'log',_0x8a38('0x7'),util[_0x8a38('0x8')](_0x8a38('0x9'),_0x2a8edf,_0x56fad6));}function formatter(_0x18183e,_0x1bcc2c){return util[_0x8a38('0x8')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x8a38('0x8')](_0x8a38('0xa')),_0x1bcc2c[_0x8a38('0xb')][_0x8a38('0xc')](),_0x18183e,_0x1bcc2c[_0x8a38('0xd')]);}module[_0x8a38('0xe')]=function(_0x4141bf){return new winston[(_0x8a38('0xf'))]({'transports':[new winston[(_0x8a38('0x10'))][(_0x8a38('0x11'))]({'name':util['format'](_0x8a38('0x12'),_0x4141bf,'error'),'filename':filename(_0x4141bf,'error'),'level':_0x8a38('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x7a7684){return formatter(_0x4141bf,_0x7a7684);}}),new winston[(_0x8a38('0x10'))]['File']({'name':util[_0x8a38('0x8')]('%s-%s',_0x4141bf,_0x8a38('0x14')),'filename':filename(_0x4141bf,_0x8a38('0x14')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5f4460){return formatter(_0x4141bf,_0x5f4460);}}),new winston['transports'][(_0x8a38('0x15'))]({'level':process[_0x8a38('0x16')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x2c45de){return formatter(_0x4141bf,_0x2c45de);}})]});}; \ No newline at end of file +var _0xe41b=['transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','join','/var','log','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger'];(function(_0x45c712,_0x2e68b2){var _0xb612e0=function(_0x51b7fe){while(--_0x51b7fe){_0x45c712['push'](_0x45c712['shift']());}};_0xb612e0(++_0x2e68b2);}(_0xe41b,0x1bd));var _0xbe41=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xe41b[_0x53cf8e];return _0x459197;};'use strict';var moment=require(_0xbe41('0x0'));var winston=require(_0xbe41('0x1'));var util=require(_0xbe41('0x2'));var path=require(_0xbe41('0x3'));var debugLevel='INFO';function filename(_0x564ba5,_0x473e66){return path[_0xbe41('0x4')](_0xbe41('0x5'),_0xbe41('0x6'),'xcally',util[_0xbe41('0x7')](_0xbe41('0x8'),_0x564ba5,_0x473e66));}function formatter(_0xbfacc2,_0xa46017){return util[_0xbe41('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xbe41('0x7')](_0xbe41('0x9')),_0xa46017[_0xbe41('0xa')][_0xbe41('0xb')](),_0xbfacc2,_0xa46017[_0xbe41('0xc')]);}module[_0xbe41('0xd')]=function(_0xb04360){return new winston[(_0xbe41('0xe'))]({'transports':[new winston[(_0xbe41('0xf'))][(_0xbe41('0x10'))]({'name':util['format'](_0xbe41('0x11'),_0xb04360,_0xbe41('0x12')),'filename':filename(_0xb04360,_0xbe41('0x12')),'level':_0xbe41('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x455060){return formatter(_0xb04360,_0x455060);}}),new winston['transports'][(_0xbe41('0x10'))]({'name':util['format']('%s-%s',_0xb04360,_0xbe41('0x13')),'filename':filename(_0xb04360,'info'),'level':_0xbe41('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5197fe){return formatter(_0xb04360,_0x5197fe);}}),new winston[(_0xbe41('0xf'))][(_0xbe41('0x14'))]({'level':process[_0xbe41('0x15')][_0xbe41('0x16')]||debugLevel,'json':![],'formatter':function(_0x204618){return formatter(_0xb04360,_0x204618);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 82a4d05..7754863 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 _0x1e6b=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','join','ami','agi','email','../../services/email/index.js'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1e6b,0x89));var _0xb1e6=function(_0x56a463,_0x54e72){_0x56a463=_0x56a463-0x0;var _0x252898=_0x1e6b[_0x56a463];return _0x252898;};'use strict';var path=require(_0xb1e6('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xb1e6('0x1')](__dirname,'../../services/express/index.js')},{'name':_0xb1e6('0x2'),'script':path[_0xb1e6('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0xb1e6('0x3'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xb1e6('0x4'),'script':path[_0xb1e6('0x1')](__dirname,_0xb1e6('0x5'))},{'name':_0xb1e6('0x6'),'script':path['join'](__dirname,_0xb1e6('0x7'))},{'name':_0xb1e6('0x8'),'script':path[_0xb1e6('0x1')](__dirname,_0xb1e6('0x9'))}]};module[_0xb1e6('0xa')]=config; \ No newline at end of file +var _0x0aaf=['../../services/ami/index.js','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','exports','join','../../services/express/index.js','ami'];(function(_0x41d47d,_0x2f7d8b){var _0xc18fcb=function(_0x21dd4a){while(--_0x21dd4a){_0x41d47d['push'](_0x41d47d['shift']());}};_0xc18fcb(++_0x2f7d8b);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x4ddc5a,_0x5e319b){_0x4ddc5a=_0x4ddc5a-0x0;var _0x499313=_0x0aaf[_0x4ddc5a];return _0x499313;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0xf0aa('0x0')](__dirname,_0xf0aa('0x1'))},{'name':_0xf0aa('0x2'),'script':path[_0xf0aa('0x0')](__dirname,_0xf0aa('0x3'))},{'name':'agi','script':path[_0xf0aa('0x0')](__dirname,_0xf0aa('0x4'))},{'name':'email','script':path[_0xf0aa('0x0')](__dirname,'../../services/email/index.js')},{'name':_0xf0aa('0x5'),'script':path['join'](__dirname,_0xf0aa('0x6'))},{'name':_0xf0aa('0x7'),'script':path[_0xf0aa('0x0')](__dirname,'../../services/xdr/index.js')}]};module[_0xf0aa('0x8')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 91de0f8..78ee8f0 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 _0x34e8=['stop','restart','list','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect'];(function(_0x31c884,_0xd3619e){var _0x107d80=function(_0x49b026){while(--_0x49b026){_0x31c884['push'](_0x31c884['shift']());}};_0x107d80(++_0xd3619e);}(_0x34e8,0x12c));var _0x834e=function(_0x2ac12b,_0x298548){_0x2ac12b=_0x2ac12b-0x0;var _0x3bf5d7=_0x34e8[_0x2ac12b];return _0x3bf5d7;};'use strict';var pm2=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var config=require(_0x834e('0x2'));function connect(){return new BPromise(function(_0x35e6fb,_0x530939){return pm2[_0x834e('0x3')](function(_0x21e2e0){if(_0x21e2e0){return _0x530939(_0x21e2e0);}return _0x35e6fb(_0x834e('0x4'));});});};exports[_0x834e('0x5')]=function(_0x289ef2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x398bee,_0x4a2018){return pm2[_0x834e('0x5')](_0x289ef2,function(_0x52056d,_0x3e16d2){if(_0x52056d){return _0x4a2018(_0x52056d);}pm2[_0x834e('0x7')]();return _0x398bee(_0x3e16d2);});});});};exports[_0x834e('0x8')]=function(_0x2e69e2){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x23501c,_0x363786){return pm2[_0x834e('0x8')](_0x2e69e2,function(_0x3bdda9,_0x186b3b){if(_0x3bdda9){return _0x363786(_0x3bdda9);}pm2[_0x834e('0x7')]();return _0x23501c(_0x186b3b);});});});};exports[_0x834e('0x9')]=function(_0x14038b){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x293514,_0x1e00de){return pm2[_0x834e('0x9')](_0x14038b,function(_0x538bb3,_0x5e5b6d){if(_0x538bb3){return _0x1e00de(_0x538bb3);}pm2[_0x834e('0x7')]();return _0x293514(_0x5e5b6d);});});});};exports['list']=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x2d95f2,_0x28e659){return pm2[_0x834e('0xa')](function(_0x50e860,_0x43156c){if(_0x50e860){return _0x28e659(_0x50e860);}pm2[_0x834e('0x7')]();return _0x2d95f2(_0x43156c);});});});};exports['describe']=function(_0x316205){return connect()['then'](function(){return new BPromise(function(_0x38a8cd,_0x36d443){return pm2['describe'](_0x316205,function(_0x43ac41,_0x22106e){if(_0x43ac41){return _0x36d443(_0x43ac41);}pm2[_0x834e('0x7')]();return _0x38a8cd(_0x22106e);});});});};exports['delete']=function(_0x283e56){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x34e41a,_0xb993a1){return pm2[_0x834e('0xb')](_0x283e56,function(_0x254677,_0x1dd214){if(_0x254677){return _0xb993a1(_0x254677);}pm2['disconnect']();return _0x34e41a(_0x1dd214);});});});};exports[_0x834e('0xc')]=function(){return connect()[_0x834e('0x6')](function(){return new BPromise(function(_0x113ff4,_0x325a99){return pm2['dump'](function(_0x45a630){if(_0x45a630){return _0x325a99(_0x45a630);}return _0x113ff4(_0x834e('0xd'));});});});}; \ No newline at end of file +var _0x9957=['stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var pm2=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var config=require(_0x7995('0x2'));function connect(){return new BPromise(function(_0x10a05d,_0x5b96eb){return pm2[_0x7995('0x3')](function(_0x3c58eb){if(_0x3c58eb){return _0x5b96eb(_0x3c58eb);}return _0x10a05d(_0x7995('0x4'));});});};exports[_0x7995('0x5')]=function(_0x576d89){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1a36d8,_0x137b6b){return pm2[_0x7995('0x5')](_0x576d89,function(_0xbda126,_0x326741){if(_0xbda126){return _0x137b6b(_0xbda126);}pm2['disconnect']();return _0x1a36d8(_0x326741);});});});};exports[_0x7995('0x7')]=function(_0x1cad37){return connect()['then'](function(){return new BPromise(function(_0xa2e5f0,_0x3116fb){return pm2[_0x7995('0x7')](_0x1cad37,function(_0x35b5fe,_0x3c1d19){if(_0x35b5fe){return _0x3116fb(_0x35b5fe);}pm2[_0x7995('0x8')]();return _0xa2e5f0(_0x3c1d19);});});});};exports[_0x7995('0x9')]=function(_0x524f7b){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x41c652,_0x581f22){return pm2[_0x7995('0x9')](_0x524f7b,function(_0x2cb37a,_0x19a27e){if(_0x2cb37a){return _0x581f22(_0x2cb37a);}pm2[_0x7995('0x8')]();return _0x41c652(_0x19a27e);});});});};exports[_0x7995('0xa')]=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2bbe7a,_0x4cc004){return pm2['list'](function(_0x2b4e94,_0x2233dd){if(_0x2b4e94){return _0x4cc004(_0x2b4e94);}pm2[_0x7995('0x8')]();return _0x2bbe7a(_0x2233dd);});});});};exports[_0x7995('0xb')]=function(_0x3f1d3e){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2202ce,_0x41cbf0){return pm2['describe'](_0x3f1d3e,function(_0x2eeacc,_0x565d97){if(_0x2eeacc){return _0x41cbf0(_0x2eeacc);}pm2[_0x7995('0x8')]();return _0x2202ce(_0x565d97);});});});};exports[_0x7995('0xc')]=function(_0x43d4b8){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1e1415,_0x37a7d4){return pm2['delete'](_0x43d4b8,function(_0x54c9ae,_0x2536c8){if(_0x54c9ae){return _0x37a7d4(_0x54c9ae);}pm2['disconnect']();return _0x1e1415(_0x2536c8);});});});};exports['dump']=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x3d463e,_0x4cbe10){return pm2[_0x7995('0xd')](function(_0x51f276){if(_0x51f276){return _0x4cbe10(_0x51f276);}return _0x3d463e('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f9f2bb1..3d26170 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 _0x766f=['length','emit','chatInteraction:update','catch','start','../../config/environment','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','minutes','then','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map'];(function(_0x4951c1,_0xbf0c01){var _0x1d1d36=function(_0x1d36a5){while(--_0x1d36a5){_0x4951c1['push'](_0x4951c1['shift']());}};_0x1d1d36(++_0xbf0c01);}(_0x766f,0x14f));var _0xf766=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x766f[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0xf766('0x0'));config[_0xf766('0x1')]=_[_0xf766('0x2')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf766('0x3'))(new Redis(config[_0xf766('0x1')]));function closeInteractions(){var _0x4f33ad=0x0;var _0x4fb4cc=[];return db[_0xf766('0x4')][_0xf766('0x5')]({'raw':!![],'attributes':['id',_0xf766('0x6')],'where':{'id':0x1}})['then'](function(_0x3c48b1){_0x4f33ad=_0x3c48b1[_0xf766('0x6')];if(_0x4f33ad){return db[_0xf766('0x7')][_0xf766('0x8')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3c48b1[_0xf766('0x6')],_0xf766('0x9'))}}});}else{return[];}})[_0xf766('0xa')](function(_0x554814){_0x4fb4cc=_0x554814;if(_0x4f33ad){return db[_0xf766('0x7')][_0xf766('0xb')]({'closeReason':_0xf766('0xc'),'disposition':_0xf766('0xd'),'closed':!![],'closedAt':moment()[_0xf766('0xe')](_0xf766('0xf'))},{'where':{'id':_[_0xf766('0x10')](_0x4fb4cc||[],'id')}});}})[_0xf766('0xa')](function(_0x5647fb){for(var _0x591499=0x0;_0x591499<_0x4fb4cc[_0xf766('0x11')];_0x591499++){io[_0xf766('0x12')](_0xf766('0x13'),{'id':_0x4fb4cc[_0x591499]['id'],'closed':!![]});}})[_0xf766('0x14')](function(_0x1a4f70){console['error'](_0x1a4f70);});}exports[_0xf766('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7dc2=['Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','chatInteraction:update','catch','error','ioredis','../../mysqldb','../../config/environment','redis','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x27dc('0x0'));var db=require(_0x27dc('0x1'))['db'];var config=require(_0x27dc('0x2'));config[_0x27dc('0x3')]=_['defaults'](config[_0x27dc('0x3')],{'host':_0x27dc('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x27dc('0x3')]));function closeInteractions(){var _0x23bbbe=0x0;var _0x5a442a=[];return db[_0x27dc('0x5')]['find']({'raw':!![],'attributes':['id',_0x27dc('0x6')],'where':{'id':0x1}})[_0x27dc('0x7')](function(_0x5181ab){_0x23bbbe=_0x5181ab[_0x27dc('0x6')];if(_0x23bbbe){return db[_0x27dc('0x8')][_0x27dc('0x9')]({'raw':!![],'attributes':['id',_0x27dc('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x5181ab[_0x27dc('0x6')],'minutes')}}});}else{return[];}})[_0x27dc('0x7')](function(_0x187853){_0x5a442a=_0x187853;if(_0x23bbbe){return db[_0x27dc('0x8')]['update']({'closeReason':'system','disposition':_0x27dc('0xb'),'closed':!![],'closedAt':moment()[_0x27dc('0xc')](_0x27dc('0xd'))},{'where':{'id':_[_0x27dc('0xe')](_0x5a442a||[],'id')}});}})['then'](function(_0x2d7799){for(var _0x4d40fd=0x0;_0x4d40fd<_0x5a442a[_0x27dc('0xf')];_0x4d40fd++){io['emit'](_0x27dc('0x10'),{'id':_0x5a442a[_0x4d40fd]['id'],'closed':!![]});}})[_0x27dc('0x11')](function(_0x7972d8){console[_0x27dc('0x12')](_0x7972d8);});}exports['start']=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 5d732db..ed0173b 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 _0x2602=['subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','exists','stop\x20cron','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','port','secure','authentication','user','pass','format','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','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','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','request','SendMail','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined'];(function(_0x20fc53,_0x59bfb4){var _0x2763f0=function(_0x34d330){while(--_0x34d330){_0x20fc53['push'](_0x20fc53['shift']());}};_0x2763f0(++_0x59bfb4);}(_0x2602,0x89));var _0x2260=function(_0x2ebf9d,_0x5d8e7c){_0x2ebf9d=_0x2ebf9d-0x0;var _0x2ee4de=_0x2602[_0x2ebf9d];return _0x2ee4de;};'use strict';var fs=require('fs');var util=require(_0x2260('0x0'));var path=require(_0x2260('0x1'));var _=require(_0x2260('0x2'));var moment=require(_0x2260('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x2260('0x4'));var BPromise=require(_0x2260('0x5'));var logger=require(_0x2260('0x6'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x2260('0x7'));var analyticDefaultReportController=require(_0x2260('0x8'));var client=jayson[_0x2260('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x194e95,_0x28d605){return function(){logger[_0x2260('0xa')](_0x2260('0xb'),_0x194e95[_0x2260('0xc')]);var _0x566228=!![];var _0x10d469={'tls':{'rejectUnauthorized':![]}};if(_0x194e95[_0x2260('0xd')]['Smtp'][_0x2260('0xe')]){_0x10d469[_0x2260('0xe')]=_0x194e95['MailAccount']['Smtp']['service'];}else{_0x10d469[_0x2260('0xf')]=_0x194e95[_0x2260('0xd')][_0x2260('0x10')]['host'];_0x10d469[_0x2260('0x11')]=_0x194e95[_0x2260('0xd')][_0x2260('0x10')][_0x2260('0x11')];_0x10d469[_0x2260('0x12')]=_0x194e95[_0x2260('0xd')][_0x2260('0x10')]['secure'];}if(_0x194e95['MailAccount'][_0x2260('0x10')][_0x2260('0x13')]){_0x10d469['auth']={'user':_0x194e95[_0x2260('0xd')][_0x2260('0x10')][_0x2260('0x14')],'pass':_0x194e95[_0x2260('0xd')][_0x2260('0x10')][_0x2260('0x15')]};}var _0x2d4990={'account':_0x10d469,'message':{'from':util[_0x2260('0x16')]('\x22%s\x22\x20<%s>',_0x194e95[_0x2260('0xd')]['name'],_0x194e95['MailAccount'][_0x2260('0xc')]||_0x194e95['MailAccount']['Smtp'][_0x2260('0x14')]),'to':_0x194e95[_0x2260('0xc')],'cc':_0x194e95['cc'],'bcc':_0x194e95[_0x2260('0x17')],'subject':util[_0x2260('0x16')](_0x2260('0x18'),_0x28d605['name'],_0x194e95[_0x2260('0x19')],_0x194e95[_0x2260('0x1a')])}};var _0x247704=path[_0x2260('0x1b')](__dirname,_0x2260('0x1c'));var _0xb4a35=_0x28d605[_0x2260('0x1d')];var _0x4ad6ef=util[_0x2260('0x16')](_0x2260('0x1e'),path[_0x2260('0x1f')](_0x28d605['savename'],path[_0x2260('0x20')](_0x28d605[_0x2260('0x1d')])),_0x2260('0x21'));var _0x5aceea=path[_0x2260('0x1b')](_0x247704,_0xb4a35);var _0x56d978=path[_0x2260('0x1b')](_0x247704,_0x4ad6ef);if(fs[_0x2260('0x22')](_0x5aceea)){_0x28d605[_0x2260('0x23')]=_0x2260('0x24');_0x2d4990[_0x2260('0x25')]['attachments']=[{'filename':_0xb4a35,'path':_0x5aceea}];_0x2d4990[_0x2260('0x25')]['text']=util['format'](_0x2260('0x26'),JSON[_0x2260('0x27')](_0x28d605,null,0x2));}else if(fs[_0x2260('0x22')](_0x56d978)){_0x28d605[_0x2260('0x23')]=_0x2260('0x24');_0x2d4990['message'][_0x2260('0x28')]=[{'filename':_0x4ad6ef,'path':_0x56d978}];}else{_0x2d4990[_0x2260('0x25')][_0x2260('0x29')]=_0x2260('0x2a');if(!_0x194e95[_0x2260('0x2b')]){_0x566228=![];logger['info'](_0x2260('0x2c'));}}if(_0x566228){return client[_0x2260('0x2d')](_0x2260('0x2e'),_0x2d4990)[_0x2260('0x2f')](function(_0x230be8){if(_0x230be8[_0x2260('0x30')]){return logger[_0x2260('0x30')]('error\x20mail',JSON[_0x2260('0x27')](_0x230be8));}return logger[_0x2260('0xa')](_0x2260('0x31'));})[_0x2260('0x32')](function(_0x29dee8){return logger[_0x2260('0x30')](_0x2260('0x33'),JSON[_0x2260('0x27')](_0x29dee8));});}};}function handleError(){return function(_0x14e02e){return logger[_0x2260('0x30')](JSON[_0x2260('0x27')](_0x14e02e));};}function handleResult(_0x1e8de4){return function(_0x5bb364){logger[_0x2260('0xa')](_0x2260('0x34'),JSON[_0x2260('0x27')](_0x5bb364));if(_0x1e8de4[_0x2260('0xd')]&&_0x1e8de4['MailAccount'][_0x2260('0x10')]&&!_[_0x2260('0x35')](_0x1e8de4[_0x2260('0xc')])){setTimeout(handleSendEmail(_0x1e8de4,_0x5bb364),0x3c*0x3e8);}};}function handleJob(_0x48cb79){return function(){try{if(_[_0x2260('0x35')](_0x48cb79[_0x2260('0x19')])){return logger['info'](_0x2260('0x36'));}if(_[_0x2260('0x35')](_0x48cb79[_0x2260('0x1a')])){return logger[_0x2260('0xa')](_0x2260('0x37'));}var _0x1b2e30={'startDate':moment()[_0x2260('0x38')](_0x48cb79[_0x2260('0x19')],_0x48cb79[_0x2260('0x1a')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x2260('0x39')),'type':_0x2260('0x3a'),'output':_0x48cb79[_0x2260('0x3b')],'name':_0x48cb79[_0x2260('0x3c')]};if(!_[_0x2260('0x35')](_0x48cb79[_0x2260('0x3d')])){logger[_0x2260('0xa')](_0x2260('0x3e'),_0x48cb79['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x48cb79['DefaultReportId']},_0x1b2e30)['then'](handleResult(_0x48cb79))[_0x2260('0x32')](handleError());}if(!_[_0x2260('0x35')](_0x48cb79[_0x2260('0x3f')])){logger[_0x2260('0xa')](_0x2260('0x40'),_0x48cb79[_0x2260('0x3f')]);return analyticCustomReportController[_0x2260('0x41')]({'id':_0x48cb79[_0x2260('0x3f')]},_0x1b2e30)[_0x2260('0x2f')](handleResult(_0x48cb79))[_0x2260('0x32')](handleError());}}catch(_0x22e973){logger[_0x2260('0x30')](JSON[_0x2260('0x27')](_0x22e973));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x568bf8){var _0x4c1b4e={};if(_0x568bf8){_0x4c1b4e['id']=_0x568bf8;}return db[_0x2260('0x42')][_0x2260('0x43')]({'where':_0x4c1b4e,'include':[{'model':db[_0x2260('0xd')],'attributes':['id',_0x2260('0x3c'),_0x2260('0xc')],'include':[{'model':db[_0x2260('0x44')],'as':_0x2260('0x10')}]}]})[_0x2260('0x2f')](function(_0x2bea7d){var _0x494a5a=_[_0x2260('0x45')](manager[_0x2260('0x46')]);var _0xba9a1a=_[_0x2260('0x47')](_0x2bea7d,function(_0x25a3bc){return _0x25a3bc['id'][_0x2260('0x48')]();});var _0x382bc0=_[_0x2260('0x49')](_0x2bea7d,function(_0x306565){return _0x306565['id'][_0x2260('0x48')]();});var _0x2e415c=_0x568bf8?_0xba9a1a:_['difference'](_0xba9a1a,_0x494a5a);var _0x2344e9=_['intersection'](_0xba9a1a,_0x494a5a);var _0x3b239e=_[_0x2260('0x4a')](_0x494a5a,_0xba9a1a);var _0x318917;var _0x464c1b;for(_0x318917=0x0;_0x318917<_0x3b239e[_0x2260('0x4b')]&&!_0x568bf8;_0x318917+=0x1){_0x464c1b=_0x3b239e[_0x318917][_0x2260('0x48')]();if(manager['exists'](_0x464c1b)){manager[_0x2260('0x4c')](_0x464c1b);manager[_0x2260('0x4d')](_0x464c1b);logger['info'](_0x2260('0x4e'),_0x464c1b);}}logger['info'](_0x2260('0x4f'),JSON[_0x2260('0x27')](_0x2e415c));for(_0x318917=0x0;_0x318917<_0x2e415c['length'];_0x318917+=0x1){_0x464c1b=_0x2e415c[_0x318917][_0x2260('0x48')]();logger[_0x2260('0xa')](_0x2260('0x50'),_0x464c1b);if(_0x568bf8){logger[_0x2260('0xa')](_0x2260('0x51'),_0x568bf8);logger['info'](JSON[_0x2260('0x27')](_0x382bc0[_0x464c1b]));BPromise[_0x2260('0x52')]()['then'](handleJob(_0x382bc0[_0x464c1b]));logger[_0x2260('0xa')](_0x2260('0x53'),_0x382bc0[_0x464c1b][_0x2260('0x3c')],_0x382bc0[_0x464c1b][_0x2260('0x54')]);}else if(_0x382bc0[_0x464c1b][_0x2260('0x54')]&&_0x382bc0[_0x464c1b][_0x2260('0x55')]&&moment()[_0x2260('0x56')](_0x382bc0[_0x464c1b][_0x2260('0x57')],_0x382bc0[_0x464c1b][_0x2260('0x58')])){manager[_0x2260('0x59')](_0x464c1b,_0x382bc0[_0x464c1b]['cron'],handleJob(_0x382bc0[_0x464c1b]));manager[_0x2260('0x5a')](_0x464c1b);logger[_0x2260('0xa')]('add\x20cron',_0x382bc0[_0x464c1b][_0x2260('0x3c')],_0x382bc0[_0x464c1b]['cron']);}else if(manager[_0x2260('0x5b')](_0x464c1b)){manager[_0x2260('0x4c')](_0x464c1b);manager[_0x2260('0x4d')](_0x464c1b);logger['info'](_0x2260('0x5c'),_0x382bc0[_0x464c1b][_0x2260('0x3c')],_0x382bc0[_0x464c1b]['cron']);}}for(_0x318917=0x0,_0x464c1b;_0x318917<_0x2344e9['length']&&!_0x568bf8;_0x318917+=0x1){_0x464c1b=_0x2344e9[_0x318917]['toString']();if(manager[_0x2260('0x5b')](_0x464c1b)){if(_0x382bc0[_0x464c1b]['cron']&&_0x382bc0[_0x464c1b][_0x2260('0x55')]&&moment()['isBetween'](_0x382bc0[_0x464c1b]['startAt'],_0x382bc0[_0x464c1b][_0x2260('0x58')])){manager[_0x2260('0x5d')](_0x464c1b,_0x382bc0[_0x464c1b]['cron'],handleJob(_0x382bc0[_0x464c1b]));logger[_0x2260('0xa')](_0x2260('0x5e'),_0x382bc0[_0x464c1b][_0x2260('0x3c')],_0x382bc0[_0x464c1b][_0x2260('0x54')]);}else{manager[_0x2260('0x4c')](_0x464c1b);manager['deleteJob'](_0x464c1b);logger['info'](_0x2260('0x5c'),_0x382bc0[_0x464c1b][_0x2260('0x3c')],_0x382bc0[_0x464c1b][_0x2260('0x54')]);}}}})[_0x2260('0x32')](function(_0x651397){logger['error'](JSON['stringify'](_0x651397));});}exports[_0x2260('0x5f')]=function(_0x37e8a4){return getJobs(_0x37e8a4);};exports[_0x2260('0x5a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x16dc=['Sent','message','text','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractUnit','info','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','findAll','MailServerOut','jobs','toString','keyBy','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','active','isBetween','startAt','endAt','cron','start','add\x20cron','stop\x20cron','update\x20cron','run','path','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status'];(function(_0x4235d1,_0x266ad){var _0x5030c6=function(_0x212d42){while(--_0x212d42){_0x4235d1['push'](_0x4235d1['shift']());}};_0x5030c6(++_0x266ad);}(_0x16dc,0xe3));var _0xc16d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16dc[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xc16d('0x0'));var _=require('lodash');var moment=require(_0xc16d('0x1'));var CronJobManager=require(_0xc16d('0x2'));var jayson=require(_0xc16d('0x3'));var BPromise=require(_0xc16d('0x4'));var logger=require('../logger')(_0xc16d('0x5'));var db=require(_0xc16d('0x6'))['db'];var analyticCustomReportController=require(_0xc16d('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xc16d('0x8')][_0xc16d('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x37706f,_0x445435){return function(){logger['info'](_0xc16d('0xa'),_0x37706f[_0xc16d('0xb')]);var _0x2fc7e5=!![];var _0x3f461e={'tls':{'rejectUnauthorized':![]}};if(_0x37706f['MailAccount'][_0xc16d('0xc')][_0xc16d('0xd')]){_0x3f461e[_0xc16d('0xd')]=_0x37706f[_0xc16d('0xe')][_0xc16d('0xc')][_0xc16d('0xd')];}else{_0x3f461e['host']=_0x37706f[_0xc16d('0xe')]['Smtp'][_0xc16d('0xf')];_0x3f461e[_0xc16d('0x10')]=_0x37706f[_0xc16d('0xe')][_0xc16d('0xc')][_0xc16d('0x10')];_0x3f461e[_0xc16d('0x11')]=_0x37706f[_0xc16d('0xe')][_0xc16d('0xc')][_0xc16d('0x11')];}if(_0x37706f[_0xc16d('0xe')][_0xc16d('0xc')][_0xc16d('0x12')]){_0x3f461e['auth']={'user':_0x37706f[_0xc16d('0xe')]['Smtp'][_0xc16d('0x13')],'pass':_0x37706f[_0xc16d('0xe')][_0xc16d('0xc')][_0xc16d('0x14')]};}var _0x46ddf0={'account':_0x3f461e,'message':{'from':util[_0xc16d('0x15')](_0xc16d('0x16'),_0x37706f[_0xc16d('0xe')][_0xc16d('0x17')],_0x37706f[_0xc16d('0xe')]['email']||_0x37706f[_0xc16d('0xe')][_0xc16d('0xc')][_0xc16d('0x13')]),'to':_0x37706f[_0xc16d('0xb')],'cc':_0x37706f['cc'],'bcc':_0x37706f[_0xc16d('0x18')],'subject':util[_0xc16d('0x15')](_0xc16d('0x19'),_0x445435[_0xc16d('0x17')],_0x37706f['subtractNumber'],_0x37706f['subtractUnit'])}};var _0x3de184=path[_0xc16d('0x1a')](__dirname,_0xc16d('0x1b'));var _0x508e25=_0x445435[_0xc16d('0x1c')];var _0x1f3709=util[_0xc16d('0x15')](_0xc16d('0x1d'),path[_0xc16d('0x1e')](_0x445435[_0xc16d('0x1c')],path[_0xc16d('0x1f')](_0x445435['savename'])),'zip');var _0x300d9d=path['join'](_0x3de184,_0x508e25);var _0x436245=path[_0xc16d('0x1a')](_0x3de184,_0x1f3709);if(fs[_0xc16d('0x20')](_0x300d9d)){_0x445435[_0xc16d('0x21')]=_0xc16d('0x22');_0x46ddf0['message']['attachments']=[{'filename':_0x508e25,'path':_0x300d9d}];_0x46ddf0[_0xc16d('0x23')][_0xc16d('0x24')]=util[_0xc16d('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xc16d('0x25')](_0x445435,null,0x2));}else if(fs[_0xc16d('0x20')](_0x436245)){_0x445435[_0xc16d('0x21')]=_0xc16d('0x22');_0x46ddf0['message'][_0xc16d('0x26')]=[{'filename':_0x1f3709,'path':_0x436245}];}else{_0x46ddf0[_0xc16d('0x23')][_0xc16d('0x24')]=_0xc16d('0x27');if(!_0x37706f[_0xc16d('0x28')]){_0x2fc7e5=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2fc7e5){return client[_0xc16d('0x29')](_0xc16d('0x2a'),_0x46ddf0)['then'](function(_0x59bfa3){if(_0x59bfa3[_0xc16d('0x2b')]){return logger[_0xc16d('0x2b')](_0xc16d('0x2c'),JSON['stringify'](_0x59bfa3));}return logger['info'](_0xc16d('0x2d'));})[_0xc16d('0x2e')](function(_0x56ba9b){return logger[_0xc16d('0x2b')](_0xc16d('0x2c'),JSON[_0xc16d('0x25')](_0x56ba9b));});}};}function handleError(){return function(_0x423a8b){return logger['error'](JSON['stringify'](_0x423a8b));};}function handleResult(_0x2bb883){return function(_0x2fbb43){logger['info'](_0xc16d('0x2f'),JSON[_0xc16d('0x25')](_0x2fbb43));if(_0x2bb883[_0xc16d('0xe')]&&_0x2bb883[_0xc16d('0xe')]['Smtp']&&!_[_0xc16d('0x30')](_0x2bb883[_0xc16d('0xb')])){setTimeout(handleSendEmail(_0x2bb883,_0x2fbb43),0x3c*0x3e8);}};}function handleJob(_0x4cb480){return function(){try{if(_['isNil'](_0x4cb480[_0xc16d('0x31')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xc16d('0x30')](_0x4cb480[_0xc16d('0x32')])){return logger[_0xc16d('0x33')](_0xc16d('0x34'));}var _0x3246d5={'startDate':moment()[_0xc16d('0x35')](_0x4cb480['subtractNumber'],_0x4cb480[_0xc16d('0x32')])[_0xc16d('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xc16d('0x15')](_0xc16d('0x36')),'type':_0xc16d('0x37'),'output':_0x4cb480['output'],'name':_0x4cb480[_0xc16d('0x17')]};if(!_[_0xc16d('0x30')](_0x4cb480[_0xc16d('0x38')])){logger['info'](_0xc16d('0x39'),_0x4cb480[_0xc16d('0x38')]);return analyticDefaultReportController[_0xc16d('0x3a')]({'id':_0x4cb480[_0xc16d('0x38')]},_0x3246d5)[_0xc16d('0x3b')](handleResult(_0x4cb480))[_0xc16d('0x2e')](handleError());}if(!_[_0xc16d('0x30')](_0x4cb480['CustomReportId'])){logger['info'](_0xc16d('0x3c'),_0x4cb480[_0xc16d('0x3d')]);return analyticCustomReportController[_0xc16d('0x3a')]({'id':_0x4cb480[_0xc16d('0x3d')]},_0x3246d5)[_0xc16d('0x3b')](handleResult(_0x4cb480))[_0xc16d('0x2e')](handleError());}}catch(_0x2bf5a2){logger[_0xc16d('0x2b')](JSON['stringify'](_0x2bf5a2));}return logger[_0xc16d('0x33')](_0xc16d('0x3e'));};}function getJobs(_0x497b24){var _0x105e6d={};if(_0x497b24){_0x105e6d['id']=_0x497b24;}return db['Schedule'][_0xc16d('0x3f')]({'where':_0x105e6d,'include':[{'model':db['MailAccount'],'attributes':['id',_0xc16d('0x17'),'email'],'include':[{'model':db[_0xc16d('0x40')],'as':_0xc16d('0xc')}]}]})[_0xc16d('0x3b')](function(_0x33d8e6){var _0x1773e0=_['keys'](manager[_0xc16d('0x41')]);var _0x3995bd=_['map'](_0x33d8e6,function(_0x55dfe7){return _0x55dfe7['id'][_0xc16d('0x42')]();});var _0x16475b=_[_0xc16d('0x43')](_0x33d8e6,function(_0x3e4a22){return _0x3e4a22['id'][_0xc16d('0x42')]();});var _0x687562=_0x497b24?_0x3995bd:_['difference'](_0x3995bd,_0x1773e0);var _0x5ece34=_[_0xc16d('0x44')](_0x3995bd,_0x1773e0);var _0x2ac393=_['difference'](_0x1773e0,_0x3995bd);var _0x262883;var _0xdb6616;for(_0x262883=0x0;_0x262883<_0x2ac393[_0xc16d('0x45')]&&!_0x497b24;_0x262883+=0x1){_0xdb6616=_0x2ac393[_0x262883][_0xc16d('0x42')]();if(manager[_0xc16d('0x46')](_0xdb6616)){manager[_0xc16d('0x47')](_0xdb6616);manager[_0xc16d('0x48')](_0xdb6616);logger[_0xc16d('0x33')](_0xc16d('0x49'),_0xdb6616);}}logger[_0xc16d('0x33')](_0xc16d('0x4a'),JSON['stringify'](_0x687562));for(_0x262883=0x0;_0x262883<_0x687562[_0xc16d('0x45')];_0x262883+=0x1){_0xdb6616=_0x687562[_0x262883][_0xc16d('0x42')]();logger[_0xc16d('0x33')]('index',_0xdb6616);if(_0x497b24){logger[_0xc16d('0x33')]('my\x20id',_0x497b24);logger[_0xc16d('0x33')](JSON[_0xc16d('0x25')](_0x16475b[_0xdb6616]));BPromise[_0xc16d('0x4b')]()[_0xc16d('0x3b')](handleJob(_0x16475b[_0xdb6616]));logger[_0xc16d('0x33')](_0xc16d('0x4c'),_0x16475b[_0xdb6616][_0xc16d('0x17')],_0x16475b[_0xdb6616]['cron']);}else if(_0x16475b[_0xdb6616]['cron']&&_0x16475b[_0xdb6616][_0xc16d('0x4d')]&&moment()[_0xc16d('0x4e')](_0x16475b[_0xdb6616][_0xc16d('0x4f')],_0x16475b[_0xdb6616][_0xc16d('0x50')])){manager['add'](_0xdb6616,_0x16475b[_0xdb6616][_0xc16d('0x51')],handleJob(_0x16475b[_0xdb6616]));manager[_0xc16d('0x52')](_0xdb6616);logger[_0xc16d('0x33')](_0xc16d('0x53'),_0x16475b[_0xdb6616][_0xc16d('0x17')],_0x16475b[_0xdb6616][_0xc16d('0x51')]);}else if(manager[_0xc16d('0x46')](_0xdb6616)){manager['stop'](_0xdb6616);manager[_0xc16d('0x48')](_0xdb6616);logger['info'](_0xc16d('0x54'),_0x16475b[_0xdb6616][_0xc16d('0x17')],_0x16475b[_0xdb6616][_0xc16d('0x51')]);}}for(_0x262883=0x0,_0xdb6616;_0x262883<_0x5ece34[_0xc16d('0x45')]&&!_0x497b24;_0x262883+=0x1){_0xdb6616=_0x5ece34[_0x262883][_0xc16d('0x42')]();if(manager[_0xc16d('0x46')](_0xdb6616)){if(_0x16475b[_0xdb6616]['cron']&&_0x16475b[_0xdb6616][_0xc16d('0x4d')]&&moment()[_0xc16d('0x4e')](_0x16475b[_0xdb6616][_0xc16d('0x4f')],_0x16475b[_0xdb6616]['endAt'])){manager['update'](_0xdb6616,_0x16475b[_0xdb6616]['cron'],handleJob(_0x16475b[_0xdb6616]));logger[_0xc16d('0x33')](_0xc16d('0x55'),_0x16475b[_0xdb6616][_0xc16d('0x17')],_0x16475b[_0xdb6616][_0xc16d('0x51')]);}else{manager['stop'](_0xdb6616);manager[_0xc16d('0x48')](_0xdb6616);logger[_0xc16d('0x33')](_0xc16d('0x54'),_0x16475b[_0xdb6616]['name'],_0x16475b[_0xdb6616][_0xc16d('0x51')]);}}}})[_0xc16d('0x2e')](function(_0x3b30fb){logger[_0xc16d('0x2b')](JSON[_0xc16d('0x25')](_0x3b30fb));});}exports[_0xc16d('0x56')]=function(_0x35b14c){return getJobs(_0x35b14c);};exports[_0xc16d('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index b408eee..d25219d 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3819=['contacts1','CmHopper','finished\x20populating','hopper1','bulkCreate','contacts2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','log'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0x3819,0xeb));var _0x9381=function(_0x55b81d,_0x3b8eaa){_0x55b81d=_0x55b81d-0x0;var _0x5cb8f4=_0x3819[_0x55b81d];return _0x5cb8f4;};'use strict';var util=require(_0x9381('0x0'));var db=require(_0x9381('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9381('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9381('0x3')+i,'phone':0xf879fb460+i,'email':_0x9381('0x4')+i+_0x9381('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9381('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9381('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9381('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9381('0x2')]({'id':i,'firstName':_0x9381('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x9381('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9381('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9381('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x9381('0x6')]()});}db[_0x9381('0x8')][_0x9381('0x9')]({'where':{}})[_0x9381('0xa')](function(){return db[_0x9381('0x8')]['bulkCreate'](contacts);})['then'](function(){console[_0x9381('0xb')]('finished\x20populating',_0x9381('0xc'));return db[_0x9381('0xd')]['destroy']({'where':{}});})[_0x9381('0xa')](function(){return db[_0x9381('0xd')]['bulkCreate'](hopper);})['then'](function(){console[_0x9381('0xb')](_0x9381('0xe'),_0x9381('0xf'));return db[_0x9381('0x8')][_0x9381('0x10')](contacts2);})['then'](function(){console[_0x9381('0xb')]('finished\x20populating',_0x9381('0x11'));return db[_0x9381('0xd')][_0x9381('0x10')](hopper2);})[_0x9381('0xa')](function(){console['log'](_0x9381('0xe'),'hopper2');})[_0x9381('0x12')](function(_0x33faa0){console[_0x9381('0xb')](_0x33faa0);}); \ No newline at end of file +var _0xead3=['CmHopper','hopper1','contacts2','hopper2','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','then','CmContact','bulkCreate','log','finished\x20populating','destroy'];(function(_0x436716,_0x19466f){var _0x45d6bc=function(_0x401a3c){while(--_0x401a3c){_0x436716['push'](_0x436716['shift']());}};_0x45d6bc(++_0x19466f);}(_0xead3,0xd0));var _0x3ead=function(_0xdc66e7,_0x13a216){_0xdc66e7=_0xdc66e7-0x0;var _0x1a46af=_0xead3[_0xdc66e7];return _0x1a46af;};'use strict';var util=require('util');var db=require(_0x3ead('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3ead('0x1')]({'id':i,'firstName':_0x3ead('0x2')+i,'lastName':_0x3ead('0x3')+i,'phone':0xf879fb460+i,'email':_0x3ead('0x4')+i+_0x3ead('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3ead('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3ead('0x6')](),'updatedAt':Date[_0x3ead('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3ead('0x1')]({'id':i,'firstName':_0x3ead('0x2')+i,'lastName':_0x3ead('0x3')+i,'phone':0xf879fb460+i,'email':_0x3ead('0x4')+i+_0x3ead('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3ead('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x3ead('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3ead('0x6')](),'updatedAt':Date[_0x3ead('0x6')]()});}db['CmContact']['destroy']({'where':{}})[_0x3ead('0x7')](function(){return db[_0x3ead('0x8')][_0x3ead('0x9')](contacts);})[_0x3ead('0x7')](function(){console[_0x3ead('0xa')](_0x3ead('0xb'),'contacts1');return db['CmHopper'][_0x3ead('0xc')]({'where':{}});})[_0x3ead('0x7')](function(){return db[_0x3ead('0xd')][_0x3ead('0x9')](hopper);})[_0x3ead('0x7')](function(){console[_0x3ead('0xa')](_0x3ead('0xb'),_0x3ead('0xe'));return db[_0x3ead('0x8')][_0x3ead('0x9')](contacts2);})[_0x3ead('0x7')](function(){console[_0x3ead('0xa')](_0x3ead('0xb'),_0x3ead('0xf'));return db[_0x3ead('0xd')]['bulkCreate'](hopper2);})[_0x3ead('0x7')](function(){console[_0x3ead('0xa')]('finished\x20populating',_0x3ead('0x10'));})['catch'](function(_0x235098){console[_0x3ead('0xa')](_0x235098);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8484f0b..2e1cfa0 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb1e=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x4bd28c,_0xcc7429){var _0x1fa99c=function(_0x377dfd){while(--_0x377dfd){_0x4bd28c['push'](_0x4bd28c['shift']());}};_0x1fa99c(++_0xcc7429);}(_0xbb1e,0x7c));var _0xebb1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbb1e[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0xebb1('0x0'));var db=require(_0xebb1('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xebb1('0x2')]({'name':util[_0xebb1('0x3')](_0xebb1('0x4'),_0xebb1('0x5'),i),'fullname':util[_0xebb1('0x3')](_0xebb1('0x4'),_0xebb1('0x5'),i),'email':util[_0xebb1('0x3')](_0xebb1('0x6'),'agent',i),'role':_0xebb1('0x5'),'password':_0xebb1('0x7'),'internal':0xfa0+i,'type':_0xebb1('0x8'),'transport':[_0xebb1('0x9'),'ws',_0xebb1('0xa')],'disallow':['all'],'allow':[_0xebb1('0xb')],'defaultuser':util[_0xebb1('0x3')](_0xebb1('0x4'),_0xebb1('0x5'),i),'encryption':'yes','avpf':_0xebb1('0xc'),'force_avp':_0xebb1('0xc'),'icesupport':_0xebb1('0xc'),'dtlsenable':_0xebb1('0xc'),'dtlsverify':'no','dtlscertfile':_0xebb1('0xd'),'dtlsprivatekey':_0xebb1('0xe'),'dtlssetup':_0xebb1('0xf'),'callerid':util[_0xebb1('0x3')](_0xebb1('0x10'),util['format'](_0xebb1('0x4'),'agent',i),0xfa0+i)});}db[_0xebb1('0x11')][_0xebb1('0x12')](users)[_0xebb1('0x13')](function(){console[_0xebb1('0x14')](_0xebb1('0x15'));})[_0xebb1('0x16')](function(_0x1dfaec){console[_0xebb1('0x14')](_0x1dfaec);}); \ No newline at end of file +var _0x9a37=['catch','util','../mysqldb','push','format','%s%s','agent','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x9a37,0x17d));var _0x79a3=function(_0x256973,_0x3cdbd4){_0x256973=_0x256973-0x0;var _0x4bf1d8=_0x9a37[_0x256973];return _0x4bf1d8;};'use strict';var util=require(_0x79a3('0x0'));var db=require(_0x79a3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x79a3('0x2')]({'name':util[_0x79a3('0x3')](_0x79a3('0x4'),_0x79a3('0x5'),i),'fullname':util[_0x79a3('0x3')](_0x79a3('0x4'),_0x79a3('0x5'),i),'email':util[_0x79a3('0x3')]('%s%s@xcally.com',_0x79a3('0x5'),i),'role':'agent','password':_0x79a3('0x6'),'internal':0xfa0+i,'type':_0x79a3('0x7'),'transport':['udp','ws',_0x79a3('0x8')],'disallow':[_0x79a3('0x9')],'allow':[_0x79a3('0xa')],'defaultuser':util[_0x79a3('0x3')](_0x79a3('0x4'),_0x79a3('0x5'),i),'encryption':_0x79a3('0xb'),'avpf':_0x79a3('0xb'),'force_avp':'yes','icesupport':_0x79a3('0xb'),'dtlsenable':_0x79a3('0xb'),'dtlsverify':'no','dtlscertfile':_0x79a3('0xc'),'dtlsprivatekey':_0x79a3('0xd'),'dtlssetup':_0x79a3('0xe'),'callerid':util[_0x79a3('0x3')](_0x79a3('0xf'),util['format'](_0x79a3('0x4'),'agent',i),0xfa0+i)});}db[_0x79a3('0x10')][_0x79a3('0x11')](users)['then'](function(){console[_0x79a3('0x12')]('add\x20user');})[_0x79a3('0x13')](function(_0x4362e5){console[_0x79a3('0x12')](_0x4362e5);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 863a34b..7731390 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x078b=['FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','voice:outbound','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','Campaign','user','userProfileId','ChatQueues','Trunks','voice:inbound','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','fax','sms','telephone:%s','campaign:%s:%s','leave','map','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','join','default','connection','address','request','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','UserProfileResource','resourceId','role','format','%s:queue:%s','length','user:%s','handshake','find','query','ChatInteraction','MailInteraction'];(function(_0x22a22b,_0x9a4116){var _0x3239b8=function(_0x41aa55){while(--_0x41aa55){_0x22a22b['push'](_0x22a22b['shift']());}};_0x3239b8(++_0x9a4116);}(_0x078b,0x14a));var _0xb078=function(_0x13b0f3,_0x28b066){_0x13b0f3=_0x13b0f3-0x0;var _0x4d7eb9=_0x078b[_0x13b0f3];return _0x4d7eb9;};'use strict';var _=require(_0xb078('0x0'));var util=require('util');var BPromise=require(_0xb078('0x1'));var db=require(_0xb078('0x2'))['db'];var config=require(_0xb078('0x3'));var queryQueues={'attributes':['id',_0xb078('0x4')],'include':[{'as':_0xb078('0x5'),'model':db[_0xb078('0x6')],'attributes':['id',_0xb078('0x4'),'role'],'raw':!![],'where':{'role':_0xb078('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb078('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xb078('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xb078('0x4')],'where':{'role':_0xb078('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb078('0x4'),_0xb078('0x9')],'where':{'type':_0xb078('0xa')}};function getAssociatedResources(_0xc72a1f,_0x4601c1,_0x42ac00){return db[_0xb078('0xb')][_0xb078('0xc')]({'where':{'name':_0xc72a1f,'userProfileId':_0x4601c1},'raw':!![]})[_0xb078('0xd')](function(_0x552cbd){if(_0x552cbd){if(_0x552cbd[_0xb078('0xe')]){switch(_0xc72a1f){case _0xb078('0xf'):case'ChatQueues':case _0xb078('0x10'):case _0xb078('0x11'):case _0xb078('0x12'):case _0xb078('0x13'):return db[_0x42ac00][_0xb078('0x14')](queryQueues);case _0xb078('0x15'):return db[_0x42ac00]['findAll'](queryTelephones);case'Trunks':return db[_0x42ac00][_0xb078('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x42ac00]['findAll'](queryCampaigns);}}else{return db[_0xb078('0x16')]['findAll']({'attributes':[_0xb078('0x17')],'where':{'sectionId':_0x552cbd['id']},'raw':!![]})[_0xb078('0xd')](function(_0x39177e){if(_0x39177e){var _0x1065ea={'where':{'id':_['map'](_0x39177e,_0xb078('0x17'))},'raw':!![]};switch(_0x42ac00){case'User':_0x1065ea['where'][_0xb078('0x18')]=_0xb078('0x8');break;case'Campaign':_0x1065ea['where'][_0xb078('0x9')]=_0xb078('0xa');break;}return db[_0x42ac00][_0xb078('0x14')](_0x1065ea);}else{return[];}});}}else{return[];}})[_0xb078('0xd')](function(_0x731dd0){return _0x731dd0;});}function joinOrLeaveQueues(_0x12a829,_0x2ee653,_0x1f144d,_0x10b909){_0x12a829[_0x2ee653](util[_0xb078('0x19')](_0xb078('0x1a'),_0x1f144d,_0x10b909[_0xb078('0x4')]));if(_0x10b909[_0xb078('0x5')]){for(var _0x5af60e=0x0;_0x5af60e<_0x10b909['Agents'][_0xb078('0x1b')];_0x5af60e+=0x1){_0x12a829[_0x2ee653](util['format'](_0xb078('0x1c'),_0x10b909['Agents'][_0x5af60e][_0xb078('0x4')]));}}}function joinOrLeave(_0x2be879,_0x3b350c,_0xd78739){var _0x3ad34b;if(_0x2be879[_0xb078('0x1d')]['query']['id']){db[_0xb078('0x6')][_0xb078('0x1e')]({'attributes':['id',_0xb078('0x4'),_0xb078('0x18'),'userProfileId'],'where':{'id':_0x2be879[_0xb078('0x1d')][_0xb078('0x1f')]['id']},'include':[{'model':db[_0xb078('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb078('0x21')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb078('0x22')],'as':_0xb078('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xb078('0x24')],'as':_0xb078('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb078('0x26')],'as':_0xb078('0x27'),'attributes':['id'],'raw':!![]}]})[_0xb078('0xd')](function(_0xa3c191){if(_0xa3c191){_0x3ad34b=_0xa3c191;_0x2be879[_0x3b350c](util[_0xb078('0x19')](_0xb078('0x1c'),_0xa3c191[_0xb078('0x4')]));var _0x382deb=[];switch(_0xa3c191[_0xb078('0x18')]){case'admin':_0x2be879[_0x3b350c]('voice:inbound');_0x2be879[_0x3b350c](_0xb078('0x28'));if(queryQueues['hasOwnProperty'](_0xb078('0x29'))){delete queryQueues[_0xb078('0x29')];}_0x382deb['push'](db[_0xb078('0x2a')][_0xb078('0x14')](queryQueues));_0x382deb[_0xb078('0x2b')](db[_0xb078('0x2c')][_0xb078('0x14')](queryQueues));_0x382deb['push'](db[_0xb078('0x2d')][_0xb078('0x14')](queryQueues));_0x382deb[_0xb078('0x2b')](db[_0xb078('0x2e')][_0xb078('0x14')](queryQueues));_0x382deb[_0xb078('0x2b')](db['MailQueue'][_0xb078('0x14')](queryQueues));_0x382deb[_0xb078('0x2b')](db[_0xb078('0x2f')][_0xb078('0x14')](queryQueues));_0x382deb[_0xb078('0x2b')](db[_0xb078('0x6')][_0xb078('0x14')](queryTelephones));_0x382deb[_0xb078('0x2b')](db[_0xb078('0x30')]['findAll'](queryTrunks));_0x382deb[_0xb078('0x2b')](db[_0xb078('0x31')][_0xb078('0x14')](queryCampaigns));_0x382deb[_0xb078('0x2b')](db['User'][_0xb078('0x14')](queryAgents));break;case _0xb078('0x32'):_0x2be879[_0x3b350c]('voice:inbound');_0x2be879[_0x3b350c](_0xb078('0x28'));_0x382deb['push'](getAssociatedResources('VoiceQueues',_0xa3c191[_0xb078('0x33')],'VoiceQueue'));_0x382deb[_0xb078('0x2b')](getAssociatedResources(_0xb078('0x34'),_0xa3c191[_0xb078('0x33')],_0xb078('0x2c')));_0x382deb[_0xb078('0x2b')](getAssociatedResources(_0xb078('0x10'),_0xa3c191[_0xb078('0x33')],_0xb078('0x2d')));_0x382deb[_0xb078('0x2b')](getAssociatedResources(_0xb078('0x11'),_0xa3c191[_0xb078('0x33')],_0xb078('0x2e')));_0x382deb[_0xb078('0x2b')](getAssociatedResources('MailQueues',_0xa3c191[_0xb078('0x33')],'MailQueue'));_0x382deb[_0xb078('0x2b')](getAssociatedResources(_0xb078('0x13'),_0xa3c191[_0xb078('0x33')],_0xb078('0x2f')));_0x382deb['push'](getAssociatedResources(_0xb078('0x15'),_0xa3c191[_0xb078('0x33')],'User'));_0x382deb[_0xb078('0x2b')](getAssociatedResources(_0xb078('0x35'),_0xa3c191[_0xb078('0x33')],_0xb078('0x30')));_0x382deb[_0xb078('0x2b')](getAssociatedResources('IvrCampaigns',_0xa3c191[_0xb078('0x33')],_0xb078('0x31')));_0x382deb[_0xb078('0x2b')](db[_0xb078('0x6')][_0xb078('0x14')](queryAgents));break;case'agent':_0x2be879[_0x3b350c](_0xb078('0x36'));_0x2be879[_0x3b350c]('voice:outbound');_0x382deb[_0xb078('0x2b')](_0xa3c191['getVoiceQueues']({'attributes':['id','name']}));_0x382deb[_0xb078('0x2b')](_0xa3c191[_0xb078('0x37')]({'attributes':['id',_0xb078('0x4')]}));_0x382deb[_0xb078('0x2b')](_0xa3c191[_0xb078('0x38')]({'attributes':['id',_0xb078('0x4')]}));_0x382deb[_0xb078('0x2b')](_0xa3c191[_0xb078('0x39')]({'attributes':['id',_0xb078('0x4')]}));_0x382deb[_0xb078('0x2b')](_0xa3c191[_0xb078('0x3a')]({'attributes':['id',_0xb078('0x4')]}));_0x382deb[_0xb078('0x2b')](_0xa3c191['getOpenchannelQueues']({'attributes':['id',_0xb078('0x4')]}));break;}return BPromise[_0xb078('0x3b')](_0x382deb);}})['then'](function(_0x2a2245){if(_0x2a2245&&_0x2a2245[_0xb078('0x1b')]){for(var _0x5448be=0x0;_0x5448be<_0x2a2245[_0xb078('0x1b')];_0x5448be+=0x1){for(var _0x64b54a=0x0;_0x64b54a<_0x2a2245[_0x5448be]['length'];_0x64b54a+=0x1){switch(_0x5448be){case 0x0:joinOrLeaveQueues(_0x2be879,_0x3b350c,_0xb078('0x3c'),_0x2a2245[_0x5448be][_0x64b54a]);break;case 0x1:joinOrLeaveQueues(_0x2be879,_0x3b350c,_0xb078('0x3d'),_0x2a2245[_0x5448be][_0x64b54a]);break;case 0x2:joinOrLeaveQueues(_0x2be879,_0x3b350c,_0xb078('0x3e'),_0x2a2245[_0x5448be][_0x64b54a]);break;case 0x3:joinOrLeaveQueues(_0x2be879,_0x3b350c,_0xb078('0x3f'),_0x2a2245[_0x5448be][_0x64b54a]);break;case 0x4:joinOrLeaveQueues(_0x2be879,_0x3b350c,'mail',_0x2a2245[_0x5448be][_0x64b54a]);break;case 0x5:joinOrLeaveQueues(_0x2be879,_0x3b350c,'openchannel',_0x2a2245[_0x5448be][_0x64b54a]);break;case 0x6:_0x2be879[_0x3b350c](util['format'](_0xb078('0x40'),_0x2a2245[_0x5448be][_0x64b54a][_0xb078('0x4')]));break;case 0x7:_0x2be879[_0x3b350c](util['format']('trunk:%s',_0x2a2245[_0x5448be][_0x64b54a][_0xb078('0x4')]));break;case 0x8:_0x2be879[_0x3b350c](util[_0xb078('0x19')](_0xb078('0x41'),_0x2a2245[_0x5448be][_0x64b54a]['type'],_0x2a2245[_0x5448be][_0x64b54a][_0xb078('0x4')]));break;case 0x9:_0x2be879[_0x3b350c](util[_0xb078('0x19')](_0xb078('0x1c'),_0x2a2245[_0x5448be][_0x64b54a][_0xb078('0x4')]));break;}}}}})[_0xb078('0xd')](function(){if(_0x3b350c===_0xb078('0x42')){var _0x15c18d=_[_0xb078('0x43')](_0x3ad34b['ChatInteractions'],'id');return _0x3ad34b['removeChatInteractions'](_0x15c18d)[_0xb078('0xd')](function(){for(var _0x414398=0x0;_0x414398<_0x15c18d[_0xb078('0x1b')];_0x414398+=0x1){_0xd78739[_0xb078('0x44')](_0xb078('0x45'),{'ChatInteractionId':Number(_0x15c18d[_0x414398]),'UserId':Number(_0x3ad34b['id'])});}});}})[_0xb078('0xd')](function(){if(_0x3b350c===_0xb078('0x42')){var _0x5bed6b=_['map'](_0x3ad34b[_0xb078('0x46')],'id');return _0x3ad34b[_0xb078('0x47')](_0x5bed6b)[_0xb078('0xd')](function(){for(var _0x4a8c42=0x0;_0x4a8c42<_0x5bed6b[_0xb078('0x1b')];_0x4a8c42+=0x1){_0xd78739[_0xb078('0x44')](_0xb078('0x48'),{'MailInteractionId':Number(_0x5bed6b[_0x4a8c42]),'UserId':Number(_0x3ad34b['id'])});}});}})['then'](function(){if(_0x3b350c===_0xb078('0x42')){var _0x4209a9=_[_0xb078('0x43')](_0x3ad34b[_0xb078('0x23')],'id');return _0x3ad34b[_0xb078('0x49')](_0x4209a9)[_0xb078('0xd')](function(){for(var _0x317cfe=0x0;_0x317cfe<_0x4209a9[_0xb078('0x1b')];_0x317cfe+=0x1){_0xd78739[_0xb078('0x44')](_0xb078('0x4a'),{'FaxInteractionId':Number(_0x4209a9[_0x317cfe]),'UserId':Number(_0x3ad34b['id'])});}});}})[_0xb078('0xd')](function(){if(_0x3b350c===_0xb078('0x42')){var _0x47f3ba=_[_0xb078('0x43')](_0x3ad34b['SmsInteractions'],'id');return _0x3ad34b[_0xb078('0x4b')](_0x47f3ba)['then'](function(){for(var _0x20d2e5=0x0;_0x20d2e5<_0x47f3ba[_0xb078('0x1b')];_0x20d2e5+=0x1){_0xd78739[_0xb078('0x44')](_0xb078('0x4c'),{'SmsInteractionId':Number(_0x47f3ba[_0x20d2e5]),'UserId':Number(_0x3ad34b['id'])});}});}})[_0xb078('0xd')](function(){if(_0x3b350c==='leave'){var _0x30d510=_[_0xb078('0x43')](_0x3ad34b[_0xb078('0x27')],'id');return _0x3ad34b[_0xb078('0x4d')](_0x30d510)[_0xb078('0xd')](function(){for(var _0x352b44=0x0;_0x352b44<_0x30d510[_0xb078('0x1b')];_0x352b44+=0x1){_0xd78739['emit'](_0xb078('0x4e'),{'OpenchannelInteractionId':Number(_0x30d510[_0x352b44]),'UserId':Number(_0x3ad34b['id'])});}});}})[_0xb078('0x4f')](function(_0x217fdf){_0x2be879['log'](_0x217fdf);});}}function onDisconnect(_0x2ecc35,_0x202427){joinOrLeave(_0x2ecc35,'leave',_0x202427);}function onConnect(_0x12f0ba){joinOrLeave(_0x12f0ba,_0xb078('0x50'));}exports[_0xb078('0x51')]=function(_0x4cfb0c){_0x4cfb0c['on'](_0xb078('0x52'),function(_0x2173f8){_0x2173f8['setMaxListeners'](0x0);_0x2173f8[_0xb078('0x53')]=_0x2173f8[_0xb078('0x54')][_0xb078('0x52')]['remoteAddress']+':'+_0x2173f8[_0xb078('0x54')]['connection']['remotePort'];_0x2173f8[_0xb078('0x55')]=new Date();_0x2173f8['log']=function(_0x1be8de){console[_0xb078('0x56')](_0xb078('0x57')+_0x2173f8[_0xb078('0x58')]['name']+'['+_0x2173f8[_0xb078('0x53')]+']',_0x1be8de);};_0x2173f8['on'](_0xb078('0x59'),function(){onDisconnect(_0x2173f8,_0x4cfb0c);_0x2173f8[_0xb078('0x56')](_0xb078('0x5a'));});onConnect(_0x2173f8);_0x2173f8[_0xb078('0x56')]('CONNECTED');});}; \ No newline at end of file +var _0x7869=['ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','user:%s','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','FaxQueue','SmsQueues','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','chat','fax','sms','openchannel','trunk:%s','campaign:%s:%s','leave','map','emit','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','telephone','agent','ivr','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','User','where','role','type','then','format','%s:queue:%s','handshake','query','find','userProfileId','ChatInteraction'];(function(_0x144cdc,_0x37dcc5){var _0x1751cf=function(_0x132d31){while(--_0x132d31){_0x144cdc['push'](_0x144cdc['shift']());}};_0x1751cf(++_0x37dcc5);}(_0x7869,0xf8));var _0x9786=function(_0x576a7c,_0x1baa09){_0x576a7c=_0x576a7c-0x0;var _0x30c387=_0x7869[_0x576a7c];return _0x30c387;};'use strict';var _=require(_0x9786('0x0'));var util=require(_0x9786('0x1'));var BPromise=require(_0x9786('0x2'));var db=require(_0x9786('0x3'))['db'];var config=require(_0x9786('0x4'));var queryQueues={'attributes':['id',_0x9786('0x5')],'include':[{'as':_0x9786('0x6'),'model':db['User'],'attributes':['id',_0x9786('0x5'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9786('0x5')],'where':{'role':_0x9786('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9786('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x9786('0x5')],'where':{'role':_0x9786('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x9786('0x9')}};function getAssociatedResources(_0xbc24d9,_0x28bf80,_0x149da2){return db['UserProfileSection'][_0x9786('0xa')]({'where':{'name':_0xbc24d9,'userProfileId':_0x28bf80},'raw':!![]})['then'](function(_0x1078d1){if(_0x1078d1){if(_0x1078d1[_0x9786('0xb')]){switch(_0xbc24d9){case _0x9786('0xc'):case _0x9786('0xd'):case _0x9786('0xe'):case'SmsQueues':case _0x9786('0xf'):case'OpenchannelQueues':return db[_0x149da2][_0x9786('0x10')](queryQueues);case _0x9786('0x11'):return db[_0x149da2][_0x9786('0x10')](queryTelephones);case _0x9786('0x12'):return db[_0x149da2][_0x9786('0x10')](queryTrunks);case _0x9786('0x13'):return db[_0x149da2][_0x9786('0x10')](queryCampaigns);}}else{return db[_0x9786('0x14')][_0x9786('0x10')]({'attributes':[_0x9786('0x15')],'where':{'sectionId':_0x1078d1['id']},'raw':!![]})['then'](function(_0x46b28f){if(_0x46b28f){var _0x5d9603={'where':{'id':_['map'](_0x46b28f,'resourceId')},'raw':!![]};switch(_0x149da2){case _0x9786('0x16'):_0x5d9603[_0x9786('0x17')][_0x9786('0x18')]=_0x9786('0x7');break;case'Campaign':_0x5d9603[_0x9786('0x17')][_0x9786('0x19')]=_0x9786('0x9');break;}return db[_0x149da2]['findAll'](_0x5d9603);}else{return[];}});}}else{return[];}})[_0x9786('0x1a')](function(_0x30e38e){return _0x30e38e;});}function joinOrLeaveQueues(_0x96e07e,_0x2c2f45,_0x4d845a,_0x570270){_0x96e07e[_0x2c2f45](util[_0x9786('0x1b')](_0x9786('0x1c'),_0x4d845a,_0x570270[_0x9786('0x5')]));if(_0x570270[_0x9786('0x6')]){for(var _0x1a7046=0x0;_0x1a7046<_0x570270[_0x9786('0x6')]['length'];_0x1a7046+=0x1){_0x96e07e[_0x2c2f45](util[_0x9786('0x1b')]('user:%s',_0x570270[_0x9786('0x6')][_0x1a7046][_0x9786('0x5')]));}}}function joinOrLeave(_0x33d408,_0x182597,_0x27ee04){var _0x3cbfef;if(_0x33d408[_0x9786('0x1d')][_0x9786('0x1e')]['id']){db[_0x9786('0x16')][_0x9786('0x1f')]({'attributes':['id','name',_0x9786('0x18'),_0x9786('0x20')],'where':{'id':_0x33d408[_0x9786('0x1d')][_0x9786('0x1e')]['id']},'include':[{'model':db[_0x9786('0x21')],'as':_0x9786('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x9786('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x9786('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9786('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x9786('0x1a')](function(_0x321080){if(_0x321080){_0x3cbfef=_0x321080;_0x33d408[_0x182597](util['format'](_0x9786('0x26'),_0x321080[_0x9786('0x5')]));var _0x46bef4=[];switch(_0x321080[_0x9786('0x18')]){case _0x9786('0x27'):_0x33d408[_0x182597](_0x9786('0x28'));_0x33d408[_0x182597]('voice:outbound');if(queryQueues[_0x9786('0x29')](_0x9786('0x2a'))){delete queryQueues[_0x9786('0x2a')];}_0x46bef4[_0x9786('0x2b')](db[_0x9786('0x2c')][_0x9786('0x10')](queryQueues));_0x46bef4[_0x9786('0x2b')](db[_0x9786('0x2d')][_0x9786('0x10')](queryQueues));_0x46bef4[_0x9786('0x2b')](db['FaxQueue'][_0x9786('0x10')](queryQueues));_0x46bef4['push'](db['SmsQueue'][_0x9786('0x10')](queryQueues));_0x46bef4[_0x9786('0x2b')](db[_0x9786('0x2e')][_0x9786('0x10')](queryQueues));_0x46bef4[_0x9786('0x2b')](db[_0x9786('0x2f')]['findAll'](queryQueues));_0x46bef4[_0x9786('0x2b')](db['User'][_0x9786('0x10')](queryTelephones));_0x46bef4[_0x9786('0x2b')](db[_0x9786('0x30')]['findAll'](queryTrunks));_0x46bef4[_0x9786('0x2b')](db[_0x9786('0x31')][_0x9786('0x10')](queryCampaigns));_0x46bef4[_0x9786('0x2b')](db[_0x9786('0x16')]['findAll'](queryAgents));break;case _0x9786('0x32'):_0x33d408[_0x182597]('voice:inbound');_0x33d408[_0x182597]('voice:outbound');_0x46bef4['push'](getAssociatedResources('VoiceQueues',_0x321080['userProfileId'],_0x9786('0x2c')));_0x46bef4[_0x9786('0x2b')](getAssociatedResources('ChatQueues',_0x321080['userProfileId'],_0x9786('0x2d')));_0x46bef4[_0x9786('0x2b')](getAssociatedResources(_0x9786('0xe'),_0x321080['userProfileId'],_0x9786('0x33')));_0x46bef4[_0x9786('0x2b')](getAssociatedResources(_0x9786('0x34'),_0x321080[_0x9786('0x20')],'SmsQueue'));_0x46bef4[_0x9786('0x2b')](getAssociatedResources('MailQueues',_0x321080[_0x9786('0x20')],_0x9786('0x2e')));_0x46bef4[_0x9786('0x2b')](getAssociatedResources('OpenchannelQueues',_0x321080['userProfileId'],_0x9786('0x2f')));_0x46bef4[_0x9786('0x2b')](getAssociatedResources(_0x9786('0x11'),_0x321080['userProfileId'],_0x9786('0x16')));_0x46bef4[_0x9786('0x2b')](getAssociatedResources(_0x9786('0x12'),_0x321080['userProfileId'],_0x9786('0x30')));_0x46bef4['push'](getAssociatedResources(_0x9786('0x13'),_0x321080['userProfileId'],_0x9786('0x31')));_0x46bef4['push'](db[_0x9786('0x16')]['findAll'](queryAgents));break;case _0x9786('0x8'):_0x33d408[_0x182597](_0x9786('0x28'));_0x33d408[_0x182597](_0x9786('0x35'));_0x46bef4[_0x9786('0x2b')](_0x321080[_0x9786('0x36')]({'attributes':['id',_0x9786('0x5')]}));_0x46bef4[_0x9786('0x2b')](_0x321080[_0x9786('0x37')]({'attributes':['id',_0x9786('0x5')]}));_0x46bef4['push'](_0x321080[_0x9786('0x38')]({'attributes':['id',_0x9786('0x5')]}));_0x46bef4[_0x9786('0x2b')](_0x321080[_0x9786('0x39')]({'attributes':['id','name']}));_0x46bef4[_0x9786('0x2b')](_0x321080[_0x9786('0x3a')]({'attributes':['id','name']}));_0x46bef4[_0x9786('0x2b')](_0x321080[_0x9786('0x3b')]({'attributes':['id',_0x9786('0x5')]}));break;}return BPromise[_0x9786('0x3c')](_0x46bef4);}})['then'](function(_0x59ec07){if(_0x59ec07&&_0x59ec07[_0x9786('0x3d')]){for(var _0x4f5bdc=0x0;_0x4f5bdc<_0x59ec07[_0x9786('0x3d')];_0x4f5bdc+=0x1){for(var _0x52200a=0x0;_0x52200a<_0x59ec07[_0x4f5bdc]['length'];_0x52200a+=0x1){switch(_0x4f5bdc){case 0x0:joinOrLeaveQueues(_0x33d408,_0x182597,'voice',_0x59ec07[_0x4f5bdc][_0x52200a]);break;case 0x1:joinOrLeaveQueues(_0x33d408,_0x182597,_0x9786('0x3e'),_0x59ec07[_0x4f5bdc][_0x52200a]);break;case 0x2:joinOrLeaveQueues(_0x33d408,_0x182597,_0x9786('0x3f'),_0x59ec07[_0x4f5bdc][_0x52200a]);break;case 0x3:joinOrLeaveQueues(_0x33d408,_0x182597,_0x9786('0x40'),_0x59ec07[_0x4f5bdc][_0x52200a]);break;case 0x4:joinOrLeaveQueues(_0x33d408,_0x182597,'mail',_0x59ec07[_0x4f5bdc][_0x52200a]);break;case 0x5:joinOrLeaveQueues(_0x33d408,_0x182597,_0x9786('0x41'),_0x59ec07[_0x4f5bdc][_0x52200a]);break;case 0x6:_0x33d408[_0x182597](util['format']('telephone:%s',_0x59ec07[_0x4f5bdc][_0x52200a]['name']));break;case 0x7:_0x33d408[_0x182597](util[_0x9786('0x1b')](_0x9786('0x42'),_0x59ec07[_0x4f5bdc][_0x52200a][_0x9786('0x5')]));break;case 0x8:_0x33d408[_0x182597](util['format'](_0x9786('0x43'),_0x59ec07[_0x4f5bdc][_0x52200a][_0x9786('0x19')],_0x59ec07[_0x4f5bdc][_0x52200a][_0x9786('0x5')]));break;case 0x9:_0x33d408[_0x182597](util[_0x9786('0x1b')](_0x9786('0x26'),_0x59ec07[_0x4f5bdc][_0x52200a][_0x9786('0x5')]));break;}}}}})['then'](function(){if(_0x182597===_0x9786('0x44')){var _0x35ff63=_[_0x9786('0x45')](_0x3cbfef['ChatInteractions'],'id');return _0x3cbfef['removeChatInteractions'](_0x35ff63)['then'](function(){for(var _0x462741=0x0;_0x462741<_0x35ff63[_0x9786('0x3d')];_0x462741+=0x1){_0x27ee04[_0x9786('0x46')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x35ff63[_0x462741]),'UserId':Number(_0x3cbfef['id'])});}});}})[_0x9786('0x1a')](function(){if(_0x182597===_0x9786('0x44')){var _0x5ef748=_['map'](_0x3cbfef['MailInteractions'],'id');return _0x3cbfef[_0x9786('0x47')](_0x5ef748)[_0x9786('0x1a')](function(){for(var _0x4e4b61=0x0;_0x4e4b61<_0x5ef748['length'];_0x4e4b61+=0x1){_0x27ee04[_0x9786('0x46')](_0x9786('0x48'),{'MailInteractionId':Number(_0x5ef748[_0x4e4b61]),'UserId':Number(_0x3cbfef['id'])});}});}})[_0x9786('0x1a')](function(){if(_0x182597===_0x9786('0x44')){var _0x21bcfd=_[_0x9786('0x45')](_0x3cbfef[_0x9786('0x49')],'id');return _0x3cbfef[_0x9786('0x4a')](_0x21bcfd)[_0x9786('0x1a')](function(){for(var _0x2b7fcd=0x0;_0x2b7fcd<_0x21bcfd[_0x9786('0x3d')];_0x2b7fcd+=0x1){_0x27ee04[_0x9786('0x46')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x21bcfd[_0x2b7fcd]),'UserId':Number(_0x3cbfef['id'])});}});}})[_0x9786('0x1a')](function(){if(_0x182597===_0x9786('0x44')){var _0x33a2f3=_[_0x9786('0x45')](_0x3cbfef[_0x9786('0x4b')],'id');return _0x3cbfef[_0x9786('0x4c')](_0x33a2f3)['then'](function(){for(var _0x1b136f=0x0;_0x1b136f<_0x33a2f3[_0x9786('0x3d')];_0x1b136f+=0x1){_0x27ee04[_0x9786('0x46')](_0x9786('0x4d'),{'SmsInteractionId':Number(_0x33a2f3[_0x1b136f]),'UserId':Number(_0x3cbfef['id'])});}});}})[_0x9786('0x1a')](function(){if(_0x182597===_0x9786('0x44')){var _0x4fd752=_[_0x9786('0x45')](_0x3cbfef[_0x9786('0x4e')],'id');return _0x3cbfef['removeOpenchannelInteractions'](_0x4fd752)[_0x9786('0x1a')](function(){for(var _0x3a9fe1=0x0;_0x3a9fe1<_0x4fd752['length'];_0x3a9fe1+=0x1){_0x27ee04[_0x9786('0x46')](_0x9786('0x4f'),{'OpenchannelInteractionId':Number(_0x4fd752[_0x3a9fe1]),'UserId':Number(_0x3cbfef['id'])});}});}})[_0x9786('0x50')](function(_0x2c0ec3){_0x33d408[_0x9786('0x51')](_0x2c0ec3);});}}function onDisconnect(_0x37efc9,_0x1d78b7){joinOrLeave(_0x37efc9,_0x9786('0x44'),_0x1d78b7);}function onConnect(_0x31efa1){joinOrLeave(_0x31efa1,_0x9786('0x52'));}exports[_0x9786('0x53')]=function(_0xfc6dea){_0xfc6dea['on'](_0x9786('0x54'),function(_0x5ca294){_0x5ca294[_0x9786('0x55')](0x0);_0x5ca294[_0x9786('0x56')]=_0x5ca294[_0x9786('0x57')][_0x9786('0x54')][_0x9786('0x58')]+':'+_0x5ca294[_0x9786('0x57')][_0x9786('0x54')][_0x9786('0x59')];_0x5ca294[_0x9786('0x5a')]=new Date();_0x5ca294[_0x9786('0x51')]=function(_0x1bb5ec){console[_0x9786('0x51')](_0x9786('0x5b')+_0x5ca294[_0x9786('0x5c')][_0x9786('0x5')]+'['+_0x5ca294[_0x9786('0x56')]+']',_0x1bb5ec);};_0x5ca294['on']('disconnect',function(){onDisconnect(_0x5ca294,_0xfc6dea);_0x5ca294['log']('DISCONNECTED');});onConnect(_0x5ca294);_0x5ca294[_0x9786('0x51')](_0x9786('0x5d'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 4270e93..e6c2133 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 _0xf9e1=['ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','closedinteraction','SmsMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','UserId','User','find','name','interface','format','SIP/%s','incomingmessage','outgoingmessage','opened','changed','closed','default','length','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','Chat'];(function(_0x189aad,_0xc1007a){var _0x472674=function(_0x2ea690){while(--_0x2ea690){_0x189aad['push'](_0x189aad['shift']());}};_0x472674(++_0xc1007a);}(_0xf9e1,0x9e));var _0x1f9e=function(_0x449759,_0x3e66d2){_0x449759=_0x449759-0x0;var _0xc7f444=_0xf9e1[_0x449759];return _0xc7f444;};'use strict';var util=require(_0x1f9e('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1f9e('0x1'));var logger=require(_0x1f9e('0x2'))(_0x1f9e('0x3'));var client=jayson[_0x1f9e('0x4')][_0x1f9e('0x5')]({'port':0x232a});var triggers=[{'channel':_0x1f9e('0x6'),'model':_0x1f9e('0x7'),'event':_0x1f9e('0x8'),'condition':_0x1f9e('0x9'),'callback':afterCreate},{'channel':_0x1f9e('0x6'),'model':_0x1f9e('0x7'),'event':_0x1f9e('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0x1f9e('0xb'),'event':_0x1f9e('0x8'),'condition':_0x1f9e('0xc'),'callback':afterCreateMessage},{'channel':_0x1f9e('0xd'),'model':'SmsInteraction','event':_0x1f9e('0x8'),'condition':_0x1f9e('0x9'),'callback':afterCreate},{'channel':_0x1f9e('0xd'),'model':_0x1f9e('0xe'),'event':_0x1f9e('0xa'),'condition':_0x1f9e('0xf'),'callback':afterUpdate},{'channel':_0x1f9e('0xd'),'model':_0x1f9e('0x10'),'event':_0x1f9e('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1f9e('0x11'),'model':_0x1f9e('0x12'),'event':_0x1f9e('0x8'),'condition':_0x1f9e('0x9'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0x1f9e('0xa'),'condition':_0x1f9e('0xf'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x1f9e('0x8'),'condition':_0x1f9e('0xc'),'callback':afterCreateMessage},{'channel':_0x1f9e('0x13'),'model':_0x1f9e('0x14'),'event':_0x1f9e('0x8'),'condition':_0x1f9e('0x9'),'callback':afterCreate},{'channel':_0x1f9e('0x13'),'model':'MailInteraction','event':'afterUpdate','condition':_0x1f9e('0xf'),'callback':afterUpdate},{'channel':_0x1f9e('0x13'),'model':_0x1f9e('0x15'),'event':_0x1f9e('0x8'),'condition':_0x1f9e('0xc'),'callback':afterCreateMessage},{'channel':_0x1f9e('0x16'),'model':_0x1f9e('0x17'),'event':_0x1f9e('0x8'),'condition':_0x1f9e('0x9'),'callback':afterCreate},{'channel':_0x1f9e('0x16'),'model':_0x1f9e('0x17'),'event':_0x1f9e('0xa'),'condition':_0x1f9e('0xf'),'callback':afterUpdate},{'channel':_0x1f9e('0x16'),'model':_0x1f9e('0x18'),'event':'afterCreate','condition':_0x1f9e('0xc'),'callback':afterCreateMessage}];function request(_0x4fb6da){return client['request'](_0x1f9e('0x19'),_0x4fb6da)[_0x1f9e('0x1a')](function(_0x34c444){logger[_0x1f9e('0x1b')](_0x1f9e('0x1c'),_0x1f9e('0x19'),_0x34c444);if(_0x34c444[_0x1f9e('0x1d')]){if(_0x34c444[_0x1f9e('0x1d')][_0x1f9e('0x1e')]===0x1f4){logger[_0x1f9e('0x1d')](_0x1f9e('0x1c'),_0x1f9e('0x19'),_0x34c444[_0x1f9e('0x1d')]);}}})[_0x1f9e('0x1f')](function(_0x445730){logger[_0x1f9e('0x1d')]('Trigger,\x20%s',_0x1f9e('0x19'),_0x445730);});}function afterCreateMessage(_0x1dcbe7,_0x45f4f5){return function(_0x25fa4a,_0x2a28bb){_0x25fa4a=_0x25fa4a[_0x1f9e('0x20')]({'plain':!![]});_0x25fa4a[_0x1f9e('0x21')]=_0x1dcbe7;_0x25fa4a[_0x1f9e('0x22')]=_0x25fa4a[_0x1f9e('0x23')];if(_0x25fa4a[_0x1f9e('0x24')]){return db[_0x1f9e('0x25')][_0x1f9e('0x26')]({'where':{'id':_0x25fa4a[_0x1f9e('0x24')]},'attributes':['id',_0x1f9e('0x27')],'raw':!![]})[_0x1f9e('0x1a')](function(_0x3a6962){_0x25fa4a[_0x1f9e('0x28')]=util[_0x1f9e('0x29')](_0x1f9e('0x2a'),_0x3a6962[_0x1f9e('0x27')]);_0x25fa4a[_0x1f9e('0x21')]=_0x1dcbe7;return request({'event':_0x1f9e('0x2b'),'message':_0x25fa4a});})['catch'](function(_0x1d4725){console[_0x1f9e('0x1d')](_0x1d4725);});}else{return request({'event':_0x1f9e('0x2c'),'message':_0x25fa4a});}};}function afterCreate(_0x2f63d9,_0x593d2d){return function(_0x308d5a,_0x4ce1fd){_0x308d5a=_0x308d5a[_0x1f9e('0x20')]({'plain':!![]});_0x308d5a[_0x1f9e('0x21')]=_0x2f63d9;_0x308d5a['event']=_0x1f9e('0x2d');return request({'event':_0x593d2d,'message':_0x308d5a});};}function afterUpdate(_0x3ff336,_0x148be5){return function(_0x497716,_0x33ecaa){if(_0x497716[_0x1f9e('0x2e')](_0x1f9e('0x2f'))&&_0x497716[_0x1f9e('0x2f')]){_0x497716=_0x497716[_0x1f9e('0x20')]({'plain':!![]});_0x497716['channel']=_0x3ff336;_0x497716['event']=_0x1f9e('0x2f');if(_0x497716[_0x1f9e('0x24')]){return db[_0x1f9e('0x25')][_0x1f9e('0x26')]({'where':{'id':_0x497716[_0x1f9e('0x24')]},'attributes':['id',_0x1f9e('0x27')],'raw':!![]})['then'](function(_0x131066){_0x497716[_0x1f9e('0x28')]=util['format'](_0x1f9e('0x2a'),_0x131066[_0x1f9e('0x27')]);return request({'event':_0x148be5,'message':_0x497716});})[_0x1f9e('0x1f')](function(_0x4337f2){console[_0x1f9e('0x1d')](_0x4337f2);});}else{return request({'event':_0x148be5,'message':_0x497716});}}};}exports[_0x1f9e('0x30')]=function(){for(var _0x194616=0x0;_0x194616=_0xde036a[_0x92ab('0x15')]){throw Error(_0x92ab('0x16'));}_0x53a1d8(_0x17dca4);})[_0x92ab('0x17')](function(_0x1a80fd){_0x4ad57a(_0x1a80fd);});});}; \ No newline at end of file +var _0xecac=['fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes','getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat'];(function(_0x306646,_0xdc2e1b){var _0x40bd8d=function(_0x397d05){while(--_0x397d05){_0x306646['push'](_0x306646['shift']());}};_0x40bd8d(++_0xdc2e1b);}(_0xecac,0x199));var _0xceca=function(_0x2d895a,_0x14899b){_0x2d895a=_0x2d895a-0x0;var _0x3830d8=_0xecac[_0x2d895a];return _0x3830d8;};'use strict';var _=require(_0xceca('0x0'));var BPromise=require(_0xceca('0x1'));var db=require(_0xceca('0x2'))['db'];var util=require(_0xceca('0x3'));var channels=[_0xceca('0x4'),_0xceca('0x5'),_0xceca('0x6'),_0xceca('0x7'),_0xceca('0x8'),_0xceca('0x9')];exports[_0xceca('0xa')]=function(){return channels;};exports[_0xceca('0xb')]=function(_0x4cd623){_0x4cd623=_0x4cd623[_0xceca('0xc')]();return _[_0xceca('0xd')](channels,_0x4cd623);};exports[_0xceca('0xe')]=function(_0x78fa5b,_0x1633cf,_0xcc22af,_0x2d890c){var _0xa41022={'loginAttempts':_0x1633cf,'blocked':_0xcc22af};if(!_[_0xceca('0xf')](_0x2d890c)){_0xa41022['blockedAt']=_0x2d890c;}return _0x78fa5b[_0xceca('0x10')](_0xa41022);};exports[_0xceca('0x11')]=function(_0x197b44){return new BPromise(function(_0x2ee095,_0x26c6d8){var _0xeea7dd=0x0;if(_0x197b44[_0xceca('0x12')]!=='agent'){_0x2ee095(_0x197b44);}db[_0xceca('0x13')][_0xceca('0x14')]({'where':{'role':_0xceca('0x15'),'online':!![],'id':{'$ne':_0x197b44['id']}}})[_0xceca('0x16')](function(_0x486eda){_0xeea7dd=_0x486eda;return util[_0xceca('0x11')]();})['then'](function(_0x3392f2){if(_0x3392f2&&_0x3392f2[_0xceca('0x17')]&&_0xeea7dd>=_0x3392f2[_0xceca('0x17')]){throw Error(_0xceca('0x18'));}_0x2ee095(_0x197b44);})[_0xceca('0x19')](function(_0x564eab){_0x26c6d8(_0x564eab);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7d85658..4bdcd59 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d3=['status','render','json','send','exports'];(function(_0x6364e4,_0x2f14ee){var _0x338710=function(_0x4051b9){while(--_0x4051b9){_0x6364e4['push'](_0x6364e4['shift']());}};_0x338710(++_0x2f14ee);}(_0x01d3,0xb8));var _0x301d=function(_0x1990d1,_0x5023f3){_0x1990d1=_0x1990d1-0x0;var _0x30a337=_0x01d3[_0x1990d1];return _0x30a337;};'use strict';module[_0x301d('0x0')][0x194]=function pageNotFound(_0x1ab2ad,_0x958bdc){var _0x43b602='404';var _0x51721f=0x194;var _0x4fbaab={'status':_0x51721f};_0x958bdc['status'](_0x4fbaab[_0x301d('0x1')]);_0x958bdc[_0x301d('0x2')](_0x43b602,{},function(_0x64c22f,_0x575a75){if(_0x64c22f){return _0x958bdc['status'](_0x4fbaab[_0x301d('0x1')])[_0x301d('0x3')](_0x4fbaab);}_0x958bdc[_0x301d('0x4')](_0x575a75);});}; \ No newline at end of file +var _0x960b=['json','send','exports','404','status'];(function(_0x375a22,_0x4c065d){var _0x573d9f=function(_0x3de1ac){while(--_0x3de1ac){_0x375a22['push'](_0x375a22['shift']());}};_0x573d9f(++_0x4c065d);}(_0x960b,0x89));var _0xb960=function(_0x3d41e2,_0x1ce8e7){_0x3d41e2=_0x3d41e2-0x0;var _0x1d5b85=_0x960b[_0x3d41e2];return _0x1d5b85;};'use strict';module[_0xb960('0x0')][0x194]=function pageNotFound(_0x499e3b,_0x2db9b6){var _0x27af3a=_0xb960('0x1');var _0x168979=0x194;var _0x53c938={'status':_0x168979};_0x2db9b6[_0xb960('0x2')](_0x53c938[_0xb960('0x2')]);_0x2db9b6['render'](_0x27af3a,{},function(_0xc7fd93,_0x50bdd8){if(_0xc7fd93){return _0x2db9b6[_0xb960('0x2')](_0x53c938['status'])[_0xb960('0x3')](_0x53c938);}_0x2db9b6[_0xb960('0x4')](_0x50bdd8);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 6ef3f17..90b5ec6 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49c1=['Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','hasMany','Recordings','UserId','Extensions','HopperFinals','ChatInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','chat_group_has_users','CmContact','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','OpenchannelQueue','CmList','cm_user_has_lists','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','OpenchannelAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','CmHopper','CmHopperBlack','HopperBlacks','JscriptySessionReport','TrunkId','TrunkBackup','Interval','IntervalId','voice_queues_has_cm_lists','Agents','team_has_voice_queues','voice_queues_has_cm_blacklists','mailbox','QueueCalls','uniqueid','ContactId','Imap','Smtp','MailAccountId','Answers','Messages','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','user_has_mail_accounts','MailMessage','MailInteractionId','Account','Contact','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','MailApplication','restrict','TagId','Dashboard','Dispositions','FaxAccountId','Interactions','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Interaction','team_has_fax_queues','Teams','SmsAccount','SmsAccountId','SmsQueue','SmsMessage','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','ChatQueueId','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','team_has_chat_queues','Contacts','CompanyId','Hoppers','HopperHistories','JscriptySessions','Company','cm_user_has_contacts','cm_contact_has_tags','Queue','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','VoiceMusicOnHold','Mohs','moh_has_sounds','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','VariableId','Configurations','SugarcrmAccount','Description','Field','DeskConfiguration','DeskField','DeskAccount','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','ServicenowAccount','ServicenowConfiguration','FromId','JscriptyAnswerReport','SessionId','JscriptyProject','ProjectId','team_has_mail_queues','FaxQueues','SmsQueues','OpenchannelQueues','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromAccount','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','FromUserId','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','path','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','xC@LL1234','mysql','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailQueueReport','../api/dashboard/dashboard.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','../api/cmHopper/cmHopper.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/team/team.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model'];(function(_0x54a73a,_0x1e0bea){var _0x3c9127=function(_0x2b16d9){while(--_0x2b16d9){_0x54a73a['push'](_0x54a73a['shift']());}};_0x3c9127(++_0x1e0bea);}(_0x49c1,0xef));var _0x149c=function(_0x4ca0de,_0x77e8e3){_0x4ca0de=_0x4ca0de-0x0;var _0x149378=_0x49c1[_0x4ca0de];return _0x149378;};'use strict';var path=require(_0x149c('0x0'));var config=require('../config/environment');var Sequelize=require(_0x149c('0x1'));var _=require(_0x149c('0x2'));var jstz=require(_0x149c('0x3'));var timezone=jstz['determine']();config[_0x149c('0x1')]=_[_0x149c('0x4')](config['sequelize'],{'database':_0x149c('0x5'),'username':_0x149c('0x6'),'password':'xC@LL1234','options':{'host':_0x149c('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x149c('0x8')},'logging':![],'timezone':timezone[_0x149c('0x9')](),'define':{'charset':'utf8','collate':_0x149c('0xa')}}});config[_0x149c('0xb')]=_['defaultsDeep'](config[_0x149c('0xb')],{'database':_0x149c('0x5'),'username':'xcall','password':_0x149c('0xc'),'options':{'host':_0x149c('0x7'),'port':0xcea,'dialect':_0x149c('0xd'),'dialectOptions':{'charset':_0x149c('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x149c('0xe'),'collate':_0x149c('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x149c('0x1')][_0x149c('0xf')],config[_0x149c('0x1')][_0x149c('0x10')],config[_0x149c('0x1')][_0x149c('0x11')],config['sequelize'][_0x149c('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x149c('0xb')]['database'],config[_0x149c('0xb')]['username'],config[_0x149c('0xb')][_0x149c('0x11')],config[_0x149c('0xb')][_0x149c('0x12')])};db[_0x149c('0x13')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x15'));db[_0x149c('0x16')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x17'));db[_0x149c('0x18')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x19'));db[_0x149c('0x1a')]=db[_0x149c('0x1')]['import'](_0x149c('0x1b'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0x149c('0x1c'));db[_0x149c('0x1d')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x1e'));db[_0x149c('0x1f')]=db[_0x149c('0x1')]['import'](_0x149c('0x20'));db[_0x149c('0x21')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x22'));db[_0x149c('0x23')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/voiceMail/voiceMail.model');db[_0x149c('0x24')]=db[_0x149c('0x1')]['import'](_0x149c('0x25'));db[_0x149c('0x26')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x149c('0x27')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x28'));db[_0x149c('0x29')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x2a'));db['MemberReport']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x2b'));db[_0x149c('0x2c')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x2d'));db[_0x149c('0x2e')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x149c('0x2f')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x30'));db[_0x149c('0x31')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x32'));db[_0x149c('0x33')]=db['sequelize'][_0x149c('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x149c('0x34')]=db['sequelize'][_0x149c('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x149c('0x35')]=db[_0x149c('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x149c('0x36')]=db[_0x149c('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x149c('0x37')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x38'));db[_0x149c('0x39')]=db[_0x149c('0x1')]['import'](_0x149c('0x3a'));db[_0x149c('0x3b')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/mailServerOut/mailServerOut.model');db[_0x149c('0x3c')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x3d'));db['MailQueue']=db['sequelize'][_0x149c('0x14')](_0x149c('0x3e'));db['MailSubstatus']=db[_0x149c('0x1')]['import'](_0x149c('0x3f'));db[_0x149c('0x40')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x41'));db['MailMessage']=db[_0x149c('0x1')][_0x149c('0x14')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x149c('0x1')][_0x149c('0x14')]('../api/mailApplication/mailApplication.model');db[_0x149c('0x42')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x43'));db['DashboardItem']=db[_0x149c('0x1')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x149c('0x44')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x45'));db[_0x149c('0x46')]=db[_0x149c('0x1')]['import'](_0x149c('0x47'));db[_0x149c('0x48')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x49'));db[_0x149c('0x4a')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x4b'));db[_0x149c('0x4c')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x4d'));db[_0x149c('0x4e')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x149c('0x1')]['import'](_0x149c('0x4f'));db[_0x149c('0x50')]=db['sequelize']['import'](_0x149c('0x51'));db[_0x149c('0x52')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x149c('0x1')][_0x149c('0x14')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db['sequelize'][_0x149c('0x14')](_0x149c('0x53'));db[_0x149c('0x54')]=db[_0x149c('0x1')]['import'](_0x149c('0x55'));db[_0x149c('0x56')]=db[_0x149c('0x1')]['import'](_0x149c('0x57'));db[_0x149c('0x58')]=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x59'));db['OpenchannelQueue']=db[_0x149c('0x1')]['import'](_0x149c('0x5a'));db['ChatWebsite']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x5b'));db[_0x149c('0x5c')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x149c('0x5d')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/chatApplication/chatApplication.model');db[_0x149c('0x5e')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x5f'));db[_0x149c('0x60')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x61'));db[_0x149c('0x62')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x63'));db[_0x149c('0x64')]=db['sequelize']['import'](_0x149c('0x65'));db[_0x149c('0x66')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x67'));db[_0x149c('0x68')]=db[_0x149c('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x149c('0x69')]=db['sequelize']['import'](_0x149c('0x6a'));db['CmContact']=db[_0x149c('0x1')][_0x149c('0x14')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x149c('0x1')]['import'](_0x149c('0x6b'));db['CmHopperBlack']=db[_0x149c('0x1')][_0x149c('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x149c('0x6c')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x149c('0x6d')]=db[_0x149c('0x1')]['import'](_0x149c('0x6e'));db[_0x149c('0x6f')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x70'));db[_0x149c('0x71')]=db[_0x149c('0x1')]['import'](_0x149c('0x72'));db['Action']=db['sequelize']['import']('../api/action/action.model');db[_0x149c('0x73')]=db[_0x149c('0x1')]['import'](_0x149c('0x74'));db[_0x149c('0x75')]=db['sequelize']['import'](_0x149c('0x76'));db[_0x149c('0x77')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x78'));db['Condition']=db[_0x149c('0x1')][_0x149c('0x14')]('../api/condition/condition.model');db['Interval']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x79'));db[_0x149c('0x7a')]=db[_0x149c('0x1')]['import'](_0x149c('0x7b'));db['Cdr']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x7c'));db[_0x149c('0x7d')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x7e'));db['Schedule']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x7f'));db[_0x149c('0x80')]=db['sequelize'][_0x149c('0x14')]('../api/sound/sound.model');db[_0x149c('0x81')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x82'));db[_0x149c('0x83')]=db['sequelize']['import'](_0x149c('0x84'));db[_0x149c('0x85')]=db[_0x149c('0x1')]['import']('../api/trigger/trigger.model');db[_0x149c('0x86')]=db[_0x149c('0x1')]['import'](_0x149c('0x87'));db['Integration']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x88'));db['IntegrationReport']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x89'));db[_0x149c('0x8a')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x149c('0x8b')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x8c'));db[_0x149c('0x8d')]=db['sequelize'][_0x149c('0x14')](_0x149c('0x8e'));db[_0x149c('0x8f')]=db[_0x149c('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x149c('0x90')]=db[_0x149c('0x1')]['import'](_0x149c('0x91'));db[_0x149c('0x92')]=db[_0x149c('0x1')]['import'](_0x149c('0x93'));db[_0x149c('0x94')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x95'));db['SalesforceConfiguration']=db['sequelize'][_0x149c('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x149c('0x96')]=db[_0x149c('0x1')]['import'](_0x149c('0x97'));db['SugarcrmAccount']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x98'));db[_0x149c('0x99')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x9a'));db[_0x149c('0x9b')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x9c'));db['DeskConfiguration']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x9d'));db['DeskField']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0x9e'));db[_0x149c('0x9f')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xa0'));db[_0x149c('0xa1')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xa2'));db[_0x149c('0xa3')]=db['sequelize'][_0x149c('0x14')]('../api/intZohoField/intZohoField.model');db[_0x149c('0xa4')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x149c('0xa5')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x149c('0xa6')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xa7'));db[_0x149c('0xa8')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xa9'));db[_0x149c('0xaa')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xab'));db['FreshdeskField']=db[_0x149c('0x1')]['import'](_0x149c('0xac'));db[_0x149c('0xad')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xae'));db[_0x149c('0xaf')]=db[_0x149c('0x1')]['import'](_0x149c('0xb0'));db[_0x149c('0xb1')]=db[_0x149c('0x1')]['import'](_0x149c('0xb2'));db['ServicenowAccount']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xb3'));db['ServicenowConfiguration']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xb4'));db[_0x149c('0xb5')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0x149c('0xb6')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x149c('0xb7')]=db[_0x149c('0x1')]['import'](_0x149c('0xb8'));db[_0x149c('0xb9')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xba'));db[_0x149c('0xbb')]=db['sequelize']['import'](_0x149c('0x88'));db[_0x149c('0xbc')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xbd'));db[_0x149c('0xbe')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xbf'));db[_0x149c('0xc0')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xc1'));db['JscriptyAnswerReport']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xc2'));db[_0x149c('0xc3')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xc4'));db['JscriptySessionReport']=db[_0x149c('0x1')]['import'](_0x149c('0xc5'));db[_0x149c('0xc6')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xc7'));db[_0x149c('0xc8')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xc9'));db[_0x149c('0xca')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xcb'));db['JscriptyProject']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xcc'));db[_0x149c('0xcd')]=db[_0x149c('0x1')]['import'](_0x149c('0xce'));db[_0x149c('0xcf')]=db[_0x149c('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x149c('0xd0')]=db['sequelize'][_0x149c('0x14')](_0x149c('0xd1'));db['SquareRecording']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xd2'));db['SquareMessage']=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db['Team']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xd3'));db['License']=db[_0x149c('0x1')][_0x149c('0x14')]('../api/license/license.model');db[_0x149c('0xd4')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xd5'));db[_0x149c('0xd6')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xd7'));db[_0x149c('0xd8')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xd9'));db[_0x149c('0xda')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xdb'));db[_0x149c('0xdc')]=db['sequelize']['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x149c('0xdd')]=db['sequelize'][_0x149c('0x14')](_0x149c('0xde'));db[_0x149c('0xdf')]=db['sequelize'][_0x149c('0x14')](_0x149c('0xe0'));db[_0x149c('0xe1')]=db[_0x149c('0x1')][_0x149c('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x149c('0xe2')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xe3'));db['CmList']=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xe4'));db[_0x149c('0xe5')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xe6'));db[_0x149c('0xe7')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xe8'));db[_0x149c('0xe9')]=db[_0x149c('0x1')][_0x149c('0x14')](_0x149c('0xea'));db[_0x149c('0xeb')]=db['sequelize'][_0x149c('0x14')](_0x149c('0xec'));db['User'][_0x149c('0xed')](db['VoiceMail'],{'as':_0x149c('0x23'),'onDelete':_0x149c('0xee'),'foreignKey':'UserId'});db[_0x149c('0x13')][_0x149c('0xef')](db[_0x149c('0x1f')],{'as':_0x149c('0xf0'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x149c('0x2f')],{'as':'VoiceQueuesRt','foreignKey':_0x149c('0xf1')});db['User'][_0x149c('0xef')](db[_0x149c('0x1a')],{'as':_0x149c('0xf2'),'onDelete':_0x149c('0xee'),'hooks':!![]});db[_0x149c('0x13')][_0x149c('0xef')](db[_0x149c('0x6c')],{'as':_0x149c('0xf3'),'foreignKey':_0x149c('0xf1')});db[_0x149c('0x13')][_0x149c('0xef')](db[_0x149c('0x6d')],{'as':'HopperHistory','foreignKey':_0x149c('0xf1')});db['User']['hasMany'](db[_0x149c('0x6f')],{'as':_0x149c('0x6f'),'foreignKey':'UserId'});db[_0x149c('0x13')]['hasMany'](db[_0x149c('0x58')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x149c('0x13')]['hasMany'](db['ChatInteraction'],{'as':_0x149c('0xf4'),'foreignKey':_0x149c('0xf1')});db[_0x149c('0x13')][_0x149c('0xef')](db[_0x149c('0x52')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0x149c('0x13')]['hasMany'](db['FaxInteraction'],{'as':_0x149c('0xf5'),'foreignKey':_0x149c('0xf1')});db[_0x149c('0x13')]['hasMany'](db[_0x149c('0x40')],{'as':_0x149c('0xf6'),'foreignKey':_0x149c('0xf1')});db['User'][_0x149c('0xf7')](db[_0x149c('0xe7')],{'as':_0x149c('0xe7'),'foreignKey':_0x149c('0xf8')});db['User'][_0x149c('0xf9')](db['ChatGroup'],{'as':'Groups','through':_0x149c('0xfa')});db['User']['belongsToMany'](db[_0x149c('0xfb')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x149c('0x13')][_0x149c('0xf9')](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db[_0x149c('0x13')]['belongsToMany'](db[_0x149c('0xfc')],{'through':_0x149c('0xfd')});db['User']['belongsToMany'](db[_0x149c('0x40')],{'as':_0x149c('0xf6'),'through':_0x149c('0xfe')});db[_0x149c('0x13')]['belongsToMany'](db[_0x149c('0x5e')],{'as':_0x149c('0xf4'),'through':'user_has_chat_interactions'});db[_0x149c('0x13')][_0x149c('0xf9')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x149c('0xff')});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0x52')],{'as':_0x149c('0x100'),'through':_0x149c('0x101')});db[_0x149c('0x13')][_0x149c('0xf9')](db['OpenchannelInteraction'],{'as':_0x149c('0x102'),'through':_0x149c('0x103')});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0x1d')],{'as':_0x149c('0x104'),'through':_0x149c('0x31'),'required':![]});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0x105')],{'as':_0x149c('0x106'),'through':'UserMailQueue','required':![]});db[_0x149c('0x13')]['belongsToMany'](db[_0x149c('0x64')],{'as':_0x149c('0x107'),'through':_0x149c('0x33'),'required':![],'hooks':!![]});db[_0x149c('0x13')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x149c('0x13')]['belongsToMany'](db['SmsQueue'],{'as':'SmsQueues','through':_0x149c('0x36'),'required':![]});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0x108')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0x109')],{'through':_0x149c('0x10a')});db['User'][_0x149c('0xf9')](db[_0x149c('0xe5')],{'as':_0x149c('0x10b'),'through':_0x149c('0x10c'),'required':![]});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0x10d')],{'as':_0x149c('0x10e'),'through':_0x149c('0x10f')});db['User'][_0x149c('0xf9')](db[_0x149c('0x44')],{'as':_0x149c('0x110'),'through':'user_has_fax_accounts'});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0x3c')],{'as':_0x149c('0x111'),'through':'user_has_mail_accounts'});db['User']['belongsToMany'](db[_0x149c('0x54')],{'as':_0x149c('0x112'),'through':'user_has_openchannel_accounts'});db[_0x149c('0x13')][_0x149c('0xf9')](db['SmsAccount'],{'as':'SmsAccounts','through':_0x149c('0x113')});db[_0x149c('0x13')][_0x149c('0xf9')](db[_0x149c('0xd0')],{'as':_0x149c('0x114'),'through':_0x149c('0x115')});db['VoiceChanSpy'][_0x149c('0xef')](db[_0x149c('0x1a')],{'as':_0x149c('0x116'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x117')});db['VoiceContext'][_0x149c('0xef')](db[_0x149c('0x1a')],{'onDelete':_0x149c('0xee')});db['VoiceExtension'][_0x149c('0xef')](db[_0x149c('0x1a')],{'as':_0x149c('0x118'),'onDelete':_0x149c('0xee')});db['VoiceMusicOnHold'][_0x149c('0xf9')](db['Sound'],{'as':_0x149c('0x119'),'through':'moh_has_sounds'});db[_0x149c('0x1d')][_0x149c('0xef')](db[_0x149c('0x2f')],{'as':_0x149c('0x11a'),'foreignKey':_0x149c('0x11b')});db[_0x149c('0x1d')][_0x149c('0xef')](db[_0x149c('0x11c')],{'as':'Hoppers','foreignKey':_0x149c('0x11b')});db[_0x149c('0x1d')][_0x149c('0xef')](db[_0x149c('0x6c')],{'as':_0x149c('0xf3'),'foreignKey':_0x149c('0x11b')});db[_0x149c('0x1d')][_0x149c('0xef')](db[_0x149c('0x6d')],{'as':'HopperHistories','foreignKey':_0x149c('0x11b')});db['VoiceQueue'][_0x149c('0xef')](db[_0x149c('0x6f')],{'as':_0x149c('0x6f'),'foreignKey':_0x149c('0x11b')});db[_0x149c('0x1d')][_0x149c('0xef')](db[_0x149c('0x11d')],{'as':_0x149c('0x11e'),'foreignKey':'VoiceQueueId'});db[_0x149c('0x1d')]['hasMany'](db[_0x149c('0x11f')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0x149c('0x1d')][_0x149c('0xf7')](db[_0x149c('0x2c')],{'as':_0x149c('0x2c'),'foreignKey':_0x149c('0x120')});db[_0x149c('0x1d')][_0x149c('0xf7')](db[_0x149c('0x2c')],{'as':_0x149c('0x121'),'foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0x149c('0xf7')](db[_0x149c('0x122')],{'as':_0x149c('0x122'),'foreignKey':_0x149c('0x123')});db[_0x149c('0x1d')][_0x149c('0xf7')](db[_0x149c('0x7a')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x149c('0x1d')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x149c('0x124')});db[_0x149c('0x1d')][_0x149c('0xf9')](db['User'],{'as':_0x149c('0x125'),'through':'UserVoiceQueue'});db[_0x149c('0x1d')][_0x149c('0xf9')](db[_0x149c('0xfc')],{'as':'Teams','through':_0x149c('0x126')});db[_0x149c('0x1d')][_0x149c('0xf9')](db[_0x149c('0x109')],{'as':'BlackLists','through':_0x149c('0x127')});db[_0x149c('0x1f')]['belongsTo'](db[_0x149c('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x149c('0x21')][_0x149c('0xf7')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x149c('0x23')][_0x149c('0xef')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x149c('0xee'),'foreignKey':'mailboxuser','sourceKey':_0x149c('0x128')});db['VoiceMailMessage'][_0x149c('0xf7')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x149c('0x128')});db[_0x149c('0x26')][_0x149c('0xef')](db['VoiceQueueReport'],{'as':_0x149c('0x129'),'foreignKey':_0x149c('0x12a'),'constraints':![]});db['VoiceCallReport'][_0x149c('0xef')](db[_0x149c('0x29')],{'as':'AgentReports','foreignKey':_0x149c('0x12a'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x149c('0x13')],{'as':'User','foreignKey':_0x149c('0xf1')});db[_0x149c('0x26')][_0x149c('0xf7')](db['CmContact'],{'as':'Contact','foreignKey':_0x149c('0x12b')});db[_0x149c('0x39')][_0x149c('0xf7')](db[_0x149c('0x3c')],{'as':_0x149c('0x3c'),'foreignKey':'MailAccountId'});db[_0x149c('0x3b')][_0x149c('0xf7')](db['MailAccount'],{'as':_0x149c('0x3c'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x149c('0xed')](db['MailServerIn'],{'as':_0x149c('0x12c'),'onDelete':_0x149c('0xee')});db[_0x149c('0x3c')][_0x149c('0xed')](db['MailServerOut'],{'as':_0x149c('0x12d'),'onDelete':_0x149c('0xee')});db['MailAccount'][_0x149c('0xef')](db[_0x149c('0x77')],{'as':'Dispositions','foreignKey':_0x149c('0x12e')});db[_0x149c('0x3c')][_0x149c('0xef')](db[_0x149c('0x75')],{'as':_0x149c('0x12f'),'foreignKey':'MailAccountId'});db[_0x149c('0x3c')]['hasMany'](db['MailMessage'],{'as':_0x149c('0x130'),'foreignKey':_0x149c('0x12e')});db[_0x149c('0x3c')][_0x149c('0xef')](db[_0x149c('0x40')],{'as':'Interactions'});db['MailAccount'][_0x149c('0xef')](db['MailApplication'],{'as':'Applications'});db[_0x149c('0x3c')]['belongsTo'](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':_0x149c('0x132')});db[_0x149c('0x3c')][_0x149c('0xf7')](db[_0x149c('0x83')],{'as':'Template','foreignKey':_0x149c('0x133')});db[_0x149c('0x3c')][_0x149c('0xf7')](db[_0x149c('0x7a')],{'as':_0x149c('0x134'),'foreignKey':_0x149c('0x135')});db['MailAccount']['belongsToMany'](db[_0x149c('0x13')],{'as':_0x149c('0x125'),'through':_0x149c('0x136')});db[_0x149c('0x105')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':'Agents','through':_0x149c('0x34')});db[_0x149c('0x105')][_0x149c('0xf9')](db[_0x149c('0xfc')],{'through':'team_has_mail_queues','as':'Teams'});db[_0x149c('0x40')][_0x149c('0xef')](db[_0x149c('0x137')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x149c('0x138')});db[_0x149c('0x40')][_0x149c('0xf7')](db[_0x149c('0x3c')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x12e')});db[_0x149c('0x40')][_0x149c('0xf7')](db[_0x149c('0xfb')],{'as':_0x149c('0x13a'),'foreignKey':_0x149c('0x12b')});db[_0x149c('0x40')][_0x149c('0xf7')](db[_0x149c('0x13')],{'as':_0x149c('0x13b'),'foreignKey':_0x149c('0xf1')});db[_0x149c('0x40')][_0x149c('0xf9')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x149c('0x13c')});db[_0x149c('0x40')][_0x149c('0xf9')](db['Tag'],{'through':_0x149c('0x13d'),'as':_0x149c('0x13e')});db['MailInteraction'][_0x149c('0xf9')](db['User'],{'as':_0x149c('0x13f'),'through':'user_has_mail_interactions','foreignKey':_0x149c('0x138')});db[_0x149c('0x137')][_0x149c('0xef')](db['Attachment'],{'as':'Attachments','onDelete':_0x149c('0xee')});db[_0x149c('0x137')][_0x149c('0xf7')](db[_0x149c('0x13')],{'as':'User'});db[_0x149c('0x137')]['belongsTo'](db[_0x149c('0xfb')],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x13a')});db[_0x149c('0x137')][_0x149c('0xf7')](db[_0x149c('0x40')],{'as':'Interaction','foreignKey':_0x149c('0x138')});db[_0x149c('0x137')][_0x149c('0xf7')](db[_0x149c('0x3c')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x149c('0x140')]['belongsTo'](db[_0x149c('0x13')],{'onDelete':'restrict'});db[_0x149c('0x140')][_0x149c('0xf7')](db[_0x149c('0x105')],{'onDelete':_0x149c('0x141')});db[_0x149c('0x140')][_0x149c('0xf7')](db[_0x149c('0x3c')],{'onDelete':_0x149c('0x141')});db['MailApplication'][_0x149c('0xf7')](db[_0x149c('0x122')],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x123')});db['MailApplication'][_0x149c('0xf7')](db[_0x149c('0x81')],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x142')});db[_0x149c('0x42')]['belongsTo'](db[_0x149c('0x3c')],{});db['MailQueueReport'][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':'ListId'});db[_0x149c('0x42')]['belongsTo'](db[_0x149c('0xfb')],{'as':'Contact','foreignKey':_0x149c('0x12b')});db[_0x149c('0x42')][_0x149c('0xf7')](db[_0x149c('0x40')],{});db[_0x149c('0x42')][_0x149c('0xf7')](db[_0x149c('0x137')],{});db['MailQueueReport'][_0x149c('0xf7')](db[_0x149c('0x13')],{});db[_0x149c('0x42')]['belongsTo'](db[_0x149c('0x105')],{});db[_0x149c('0x143')][_0x149c('0xef')](db['DashboardItem'],{'as':'Items','onDelete':_0x149c('0xee')});db[_0x149c('0x44')][_0x149c('0xef')](db[_0x149c('0x77')],{'as':_0x149c('0x144'),'foreignKey':_0x149c('0x145')});db['FaxAccount'][_0x149c('0xef')](db[_0x149c('0x75')],{'as':_0x149c('0x12f'),'foreignKey':_0x149c('0x145')});db[_0x149c('0x44')][_0x149c('0xef')](db[_0x149c('0x48')],{'as':_0x149c('0x146')});db[_0x149c('0x44')][_0x149c('0xef')](db[_0x149c('0x46')],{'as':_0x149c('0x118')});db[_0x149c('0x44')][_0x149c('0xef')](db[_0x149c('0x1a')],{'as':_0x149c('0x147'),'onDelete':_0x149c('0xee')});db[_0x149c('0x44')]['hasMany'](db['FaxMessage'],{'as':_0x149c('0x130')});db[_0x149c('0x44')][_0x149c('0xf7')](db[_0x149c('0x2c')],{'as':_0x149c('0x2c')});db[_0x149c('0x44')][_0x149c('0xf7')](db['CmList'],{'as':_0x149c('0x131'),'foreignKey':_0x149c('0x132')});db[_0x149c('0x44')][_0x149c('0xf7')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':'Agents','through':_0x149c('0x148')});db['FaxApplication'][_0x149c('0xf7')](db['User'],{'onDelete':_0x149c('0x141')});db[_0x149c('0x46')][_0x149c('0xf7')](db[_0x149c('0x4c')],{'onDelete':_0x149c('0x141')});db[_0x149c('0x46')][_0x149c('0xf7')](db[_0x149c('0x44')],{'onDelete':_0x149c('0x141')});db[_0x149c('0x46')][_0x149c('0xf7')](db[_0x149c('0x81')],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x142')});db[_0x149c('0x48')]['hasMany'](db[_0x149c('0x4a')],{'as':'Messages','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x149')});db[_0x149c('0x48')]['belongsTo'](db[_0x149c('0x44')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x145')});db[_0x149c('0x48')][_0x149c('0xf7')](db[_0x149c('0xfb')],{'as':'Contact','foreignKey':'ContactId'});db['FaxInteraction'][_0x149c('0xf7')](db['User'],{'as':_0x149c('0x13b'),'foreignKey':'UserId'});db[_0x149c('0x48')][_0x149c('0xf9')](db['Tag'],{'through':_0x149c('0x14a'),'as':_0x149c('0x13c')});db[_0x149c('0x48')]['belongsToMany'](db[_0x149c('0x81')],{'through':_0x149c('0x14a'),'as':_0x149c('0x13e')});db['FaxInteraction']['belongsToMany'](db[_0x149c('0x13')],{'as':_0x149c('0x13f'),'through':_0x149c('0xff'),'foreignKey':_0x149c('0x149')});db[_0x149c('0x4a')]['belongsTo'](db[_0x149c('0x13')],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x13')});db[_0x149c('0x4a')][_0x149c('0xf7')](db['FaxInteraction'],{'as':_0x149c('0x14b'),'foreignKey':_0x149c('0x149')});db[_0x149c('0x4a')]['belongsTo'](db[_0x149c('0xfb')],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x13a')});db[_0x149c('0x4a')][_0x149c('0xf7')](db['Attachment'],{'as':_0x149c('0xd8'),'foreignKey':'AttachmentId'});db[_0x149c('0x4a')][_0x149c('0xf7')](db[_0x149c('0x44')],{'as':_0x149c('0x139'),'foreignKey':'FaxAccountId'});db[_0x149c('0x4c')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':_0x149c('0x125'),'through':_0x149c('0x35')});db[_0x149c('0x4c')][_0x149c('0xf9')](db['Team'],{'through':_0x149c('0x14c'),'as':_0x149c('0x14d')});db[_0x149c('0x4e')]['belongsTo'](db[_0x149c('0x44')],{});db[_0x149c('0x4e')][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':_0x149c('0x132')});db[_0x149c('0x4e')][_0x149c('0xf7')](db['CmContact'],{'as':_0x149c('0x13a'),'foreignKey':'ContactId'});db[_0x149c('0x4e')][_0x149c('0xf7')](db[_0x149c('0x48')],{});db['FaxQueueReport'][_0x149c('0xf7')](db[_0x149c('0x4a')],{});db[_0x149c('0x4e')][_0x149c('0xf7')](db[_0x149c('0x13')],{});db[_0x149c('0x4e')][_0x149c('0xf7')](db['FaxQueue'],{});db[_0x149c('0x14e')][_0x149c('0xef')](db['Disposition'],{'as':_0x149c('0x144'),'foreignKey':_0x149c('0x14f')});db[_0x149c('0x14e')]['hasMany'](db[_0x149c('0x75')],{'as':_0x149c('0x12f'),'foreignKey':'SmsAccountId'});db[_0x149c('0x14e')][_0x149c('0xef')](db['SmsMessage'],{'as':_0x149c('0x130'),'foreignKey':_0x149c('0x14f')});db[_0x149c('0x14e')][_0x149c('0xef')](db['SmsInteraction'],{'as':_0x149c('0x146')});db[_0x149c('0x14e')][_0x149c('0xef')](db[_0x149c('0x50')],{'as':'Applications'});db['SmsAccount'][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':_0x149c('0x132')});db[_0x149c('0x14e')][_0x149c('0xf7')](db[_0x149c('0x7a')],{'as':_0x149c('0x134'),'foreignKey':_0x149c('0x135')});db[_0x149c('0x14e')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':_0x149c('0x125'),'through':_0x149c('0x113')});db[_0x149c('0x50')]['belongsTo'](db['User'],{'onDelete':_0x149c('0x141')});db[_0x149c('0x50')][_0x149c('0xf7')](db[_0x149c('0x150')],{'onDelete':_0x149c('0x141')});db[_0x149c('0x50')][_0x149c('0xf7')](db['SmsAccount'],{'onDelete':_0x149c('0x141')});db['SmsApplication'][_0x149c('0xf7')](db[_0x149c('0x122')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x149c('0x50')]['belongsTo'](db[_0x149c('0x81')],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x142')});db['SmsInteraction'][_0x149c('0xef')](db[_0x149c('0x151')],{'as':_0x149c('0x130'),'onDelete':'cascade','foreignKey':_0x149c('0x152')});db[_0x149c('0x52')]['belongsTo'](db[_0x149c('0x14e')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x14f')});db[_0x149c('0x52')][_0x149c('0xf7')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x149c('0x52')][_0x149c('0xf7')](db[_0x149c('0x13')],{'as':_0x149c('0x13b'),'foreignKey':'UserId'});db[_0x149c('0x52')]['belongsToMany'](db[_0x149c('0x81')],{'through':_0x149c('0x153'),'as':'Tags'});db['SmsInteraction'][_0x149c('0xf9')](db[_0x149c('0x81')],{'through':_0x149c('0x153'),'as':_0x149c('0x13e')});db[_0x149c('0x52')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':'Users','through':_0x149c('0x101'),'foreignKey':'SmsInteractionId'});db[_0x149c('0x151')][_0x149c('0xf7')](db[_0x149c('0x13')],{'as':_0x149c('0x13')});db[_0x149c('0x151')]['belongsTo'](db[_0x149c('0xfb')],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x13a')});db['SmsMessage']['belongsTo'](db[_0x149c('0x52')],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x14b'),'foreignKey':'SmsInteractionId'});db[_0x149c('0x151')]['belongsTo'](db[_0x149c('0x14e')],{'as':'Account','foreignKey':_0x149c('0x14f')});db[_0x149c('0x150')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':_0x149c('0x125'),'through':_0x149c('0x36'),'foreignKey':'SmsQueueId'});db[_0x149c('0x150')][_0x149c('0xf9')](db[_0x149c('0xfc')],{'through':_0x149c('0x154'),'as':_0x149c('0x14d')});db[_0x149c('0x54')][_0x149c('0xef')](db[_0x149c('0x77')],{'as':_0x149c('0x144'),'foreignKey':_0x149c('0x155')});db[_0x149c('0x54')][_0x149c('0xef')](db[_0x149c('0x75')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x149c('0x54')][_0x149c('0xef')](db[_0x149c('0x58')],{'as':_0x149c('0x146'),'foreignKey':_0x149c('0x155')});db[_0x149c('0x54')]['hasMany'](db['OpenchannelMessage'],{'as':_0x149c('0x130'),'foreignKey':_0x149c('0x155')});db[_0x149c('0x54')][_0x149c('0xef')](db[_0x149c('0x56')],{'as':_0x149c('0x118'),'foreignKey':_0x149c('0x155')});db[_0x149c('0x54')][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x149c('0xf7')](db[_0x149c('0x7a')],{'as':_0x149c('0x134'),'foreignKey':_0x149c('0x135')});db[_0x149c('0x54')][_0x149c('0xf9')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x149c('0x56')][_0x149c('0xf7')](db[_0x149c('0x13')],{'onDelete':_0x149c('0x141')});db['OpenchannelApplication'][_0x149c('0xf7')](db['OpenchannelQueue'],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x156')});db['OpenchannelApplication'][_0x149c('0xf7')](db[_0x149c('0x54')],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x155')});db[_0x149c('0x56')][_0x149c('0xf7')](db[_0x149c('0x122')],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x123')});db[_0x149c('0x56')][_0x149c('0xf7')](db[_0x149c('0x81')],{'onDelete':_0x149c('0x141'),'foreignKey':'TagId'});db[_0x149c('0x58')][_0x149c('0xef')](db[_0x149c('0x157')],{'as':'Messages','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x158')});db[_0x149c('0x58')]['belongsTo'](db[_0x149c('0x54')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x155')});db['OpenchannelInteraction'][_0x149c('0xf7')](db[_0x149c('0xfb')],{'as':_0x149c('0x13a'),'foreignKey':_0x149c('0x12b')});db['OpenchannelInteraction'][_0x149c('0xf7')](db[_0x149c('0x13')],{'as':_0x149c('0x13b'),'foreignKey':_0x149c('0xf1')});db[_0x149c('0x58')]['belongsToMany'](db['Tag'],{'through':_0x149c('0x159'),'as':_0x149c('0x13c')});db[_0x149c('0x58')][_0x149c('0xf9')](db['Tag'],{'through':_0x149c('0x159'),'as':_0x149c('0x13e')});db[_0x149c('0x58')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x149c('0x158')});db[_0x149c('0x157')][_0x149c('0xf7')](db['User'],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x13')});db[_0x149c('0x157')]['belongsTo'](db[_0x149c('0xfb')],{'onDelete':'cascade','as':_0x149c('0x13a')});db[_0x149c('0x157')]['belongsTo'](db[_0x149c('0x58')],{'onDelete':_0x149c('0xee'),'as':'Interaction','foreignKey':_0x149c('0x158')});db[_0x149c('0x157')][_0x149c('0xf7')](db[_0x149c('0xd8')],{'as':_0x149c('0xd8'),'foreignKey':_0x149c('0x15a')});db[_0x149c('0x157')][_0x149c('0xf7')](db['OpenchannelAccount'],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x155')});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0x149c('0x125'),'through':_0x149c('0x37'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x149c('0xf9')](db[_0x149c('0xfc')],{'through':_0x149c('0x15b'),'as':_0x149c('0x14d')});db['ChatWebsite'][_0x149c('0xef')](db[_0x149c('0x77')],{'as':'Dispositions','foreignKey':_0x149c('0x15c')});db[_0x149c('0x10d')]['hasMany'](db[_0x149c('0x75')],{'as':_0x149c('0x12f'),'foreignKey':_0x149c('0x15c')});db[_0x149c('0x10d')][_0x149c('0xef')](db[_0x149c('0x68')],{'as':_0x149c('0x15d')});db['ChatWebsite'][_0x149c('0xef')](db['ChatInteraction'],{'as':_0x149c('0x146')});db[_0x149c('0x10d')]['hasMany'](db[_0x149c('0x5d')],{'as':_0x149c('0x118')});db['ChatWebsite'][_0x149c('0xef')](db['ChatMessage'],{'as':_0x149c('0x130')});db[_0x149c('0x10d')][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':'ListId'});db[_0x149c('0x10d')]['belongsTo'](db[_0x149c('0x122')],{'as':_0x149c('0x122'),'foreignKey':'IntervalId'});db[_0x149c('0x10d')]['belongsTo'](db[_0x149c('0x7a')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x149c('0x10d')]['belongsToMany'](db[_0x149c('0x13')],{'as':_0x149c('0x125'),'through':_0x149c('0x10f')});db[_0x149c('0x5c')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x149c('0x5c')][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':_0x149c('0x132')});db[_0x149c('0x5c')][_0x149c('0xf7')](db[_0x149c('0xfb')],{'as':_0x149c('0x13a'),'foreignKey':_0x149c('0x12b')});db[_0x149c('0x5c')]['belongsTo'](db[_0x149c('0x58')],{});db[_0x149c('0x5c')][_0x149c('0xf7')](db[_0x149c('0x157')],{});db[_0x149c('0x5c')][_0x149c('0xf7')](db['User'],{});db[_0x149c('0x5c')][_0x149c('0xf7')](db['OpenchannelQueue'],{});db['ChatApplication']['belongsTo'](db[_0x149c('0x13')],{'as':_0x149c('0x15e'),'foreignKey':_0x149c('0xf1'),'onDelete':'restrict'});db[_0x149c('0x5d')][_0x149c('0xf7')](db[_0x149c('0x64')],{'as':'Queue','foreignKey':_0x149c('0x15f'),'onDelete':_0x149c('0x141')});db[_0x149c('0x5d')][_0x149c('0xf7')](db[_0x149c('0x10d')],{'as':'Website','foreignKey':_0x149c('0x15c'),'onDelete':_0x149c('0x141')});db[_0x149c('0x5d')]['belongsTo'](db[_0x149c('0x81')],{'onDelete':_0x149c('0x141'),'foreignKey':_0x149c('0x142')});db[_0x149c('0x5e')][_0x149c('0xef')](db['ChatMessage'],{'as':_0x149c('0x130'),'onDelete':_0x149c('0xee'),'foreignKey':'ChatInteractionId'});db[_0x149c('0x5e')][_0x149c('0xf7')](db[_0x149c('0x10d')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x15c')});db['ChatInteraction'][_0x149c('0xf7')](db[_0x149c('0xfb')],{'as':'Contact','foreignKey':_0x149c('0x12b')});db[_0x149c('0x5e')]['belongsTo'](db[_0x149c('0x13')],{'as':_0x149c('0x13b'),'foreignKey':'UserId'});db[_0x149c('0x5e')][_0x149c('0xf9')](db[_0x149c('0x81')],{'through':'chat_interaction_has_tags','as':_0x149c('0x13c')});db[_0x149c('0x5e')][_0x149c('0xf9')](db[_0x149c('0x81')],{'through':_0x149c('0x160'),'as':_0x149c('0x13e')});db[_0x149c('0x5e')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':_0x149c('0x13f'),'through':_0x149c('0x161'),'foreignKey':_0x149c('0x162')});db[_0x149c('0x60')]['belongsTo'](db[_0x149c('0x13')],{'onDelete':_0x149c('0xee'),'as':'User'});db[_0x149c('0x60')][_0x149c('0xf7')](db[_0x149c('0xfb')],{'onDelete':'cascade','as':_0x149c('0x13a'),'foreignKey':_0x149c('0x12b')});db['ChatMessage'][_0x149c('0xf7')](db['ChatInteraction'],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x14b'),'foreignKey':_0x149c('0x162')});db[_0x149c('0x60')][_0x149c('0xf7')](db['Attachment'],{'as':_0x149c('0xd8'),'foreignKey':_0x149c('0x15a')});db[_0x149c('0x60')][_0x149c('0xf7')](db['ChatWebsite'],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x15c')});db[_0x149c('0x62')][_0x149c('0xf7')](db[_0x149c('0xfb')],{'onDelete':_0x149c('0xee'),'as':_0x149c('0x13a'),'foreignKey':'ContactId'});db[_0x149c('0x62')][_0x149c('0xf7')](db['ChatWebsite'],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x15c')});db[_0x149c('0x64')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':'Agents','through':_0x149c('0x33'),'hooks':!![]});db[_0x149c('0x64')][_0x149c('0xf9')](db[_0x149c('0xfc')],{'through':_0x149c('0x163'),'as':'Teams'});db[_0x149c('0x66')][_0x149c('0xef')](db[_0x149c('0xc0')],{'as':_0x149c('0x130'),'foreignKey':'ChatGroupId','onDelete':_0x149c('0xee')});db[_0x149c('0x66')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':_0x149c('0x11a'),'through':_0x149c('0xfa')});db[_0x149c('0x68')][_0x149c('0xf7')](db[_0x149c('0x10d')],{'as':'Website','foreignKey':_0x149c('0x15c')});db[_0x149c('0x69')][_0x149c('0xef')](db[_0x149c('0xfb')],{'as':_0x149c('0x164'),'foreignKey':_0x149c('0x165')});db[_0x149c('0xfb')][_0x149c('0xef')](db[_0x149c('0x11c')],{'as':_0x149c('0x166'),'foreignKey':_0x149c('0x12b')});db[_0x149c('0xfb')][_0x149c('0xef')](db[_0x149c('0x6c')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0x149c('0xfb')][_0x149c('0xef')](db[_0x149c('0x6d')],{'as':_0x149c('0x167'),'foreignKey':_0x149c('0x12b')});db[_0x149c('0xfb')][_0x149c('0xef')](db['ReportAgentPreview'],{'as':_0x149c('0x6f'),'foreignKey':_0x149c('0x12b')});db['CmContact'][_0x149c('0xef')](db[_0x149c('0x11f')],{'as':_0x149c('0x168'),'foreignKey':'ContactId'});db[_0x149c('0xfb')]['hasMany'](db[_0x149c('0x58')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x149c('0x141')});db[_0x149c('0xfb')][_0x149c('0xef')](db[_0x149c('0x5e')],{'as':'ChatInteractions','foreignKey':_0x149c('0x12b'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x149c('0x52')],{'as':_0x149c('0x100'),'foreignKey':_0x149c('0x12b'),'onDelete':'restrict'});db[_0x149c('0xfb')][_0x149c('0xef')](db['FaxInteraction'],{'as':_0x149c('0xf5'),'foreignKey':'ContactId','onDelete':_0x149c('0x141')});db[_0x149c('0xfb')][_0x149c('0xef')](db[_0x149c('0x40')],{'as':_0x149c('0xf6'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x149c('0xf7')](db['CmCompany'],{'as':_0x149c('0x169'),'foreignKey':_0x149c('0x165')});db[_0x149c('0xfb')][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':'List','foreignKey':_0x149c('0x132'),'onDelete':_0x149c('0xee')});db[_0x149c('0xfb')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':'Users','through':_0x149c('0x16a')});db[_0x149c('0xfb')][_0x149c('0xf9')](db[_0x149c('0x81')],{'as':_0x149c('0x13c'),'through':_0x149c('0x16b')});db[_0x149c('0xfb')]['belongsToMany'](db[_0x149c('0x81')],{'through':_0x149c('0x16b'),'as':_0x149c('0x13e')});db[_0x149c('0x11c')]['belongsTo'](db[_0x149c('0xfb')],{'as':_0x149c('0x13a'),'foreignKey':'ContactId','onDelete':_0x149c('0xee')});db['CmHopper']['belongsTo'](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':_0x149c('0x132'),'onDelete':'cascade'});db[_0x149c('0x11c')]['belongsTo'](db['User'],{'as':_0x149c('0x15e'),'foreignKey':_0x149c('0xf1')});db[_0x149c('0x11c')][_0x149c('0xf7')](db[_0x149c('0x1d')],{'as':_0x149c('0x16c'),'foreignKey':_0x149c('0x11b'),'onDelete':_0x149c('0xee')});db[_0x149c('0x11c')]['belongsTo'](db[_0x149c('0xd4')],{'as':_0x149c('0xd4'),'foreignKey':_0x149c('0x16d'),'onDelete':_0x149c('0xee')});db['CmHopper']['belongsTo'](db[_0x149c('0x13')],{'as':_0x149c('0x13b'),'foreignKey':_0x149c('0x16e')});db[_0x149c('0x11d')][_0x149c('0xf7')](db[_0x149c('0xfb')],{'as':_0x149c('0x13a'),'foreignKey':_0x149c('0x12b'),'onDelete':_0x149c('0xee')});db[_0x149c('0x11d')][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':'ListId','onDelete':_0x149c('0xee')});db[_0x149c('0x11d')][_0x149c('0xf7')](db[_0x149c('0x1d')],{'as':_0x149c('0x16c'),'foreignKey':_0x149c('0x11b'),'onDelete':_0x149c('0xee')});db[_0x149c('0x11d')]['belongsTo'](db[_0x149c('0xd4')],{'as':_0x149c('0xd4'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x149c('0x73')][_0x149c('0xef')](db[_0x149c('0x16f')],{'as':{'plural':_0x149c('0x170'),'singular':_0x149c('0x171')},'foreignKey':_0x149c('0x172'),'onDelete':_0x149c('0xee'),'hooks':!![]});db[_0x149c('0x73')][_0x149c('0xef')](db[_0x149c('0x16f')],{'as':{'plural':_0x149c('0x173'),'singular':_0x149c('0x174')},'foreignKey':_0x149c('0x175'),'onDelete':_0x149c('0xee'),'hooks':!![]});db[_0x149c('0x73')][_0x149c('0xef')](db[_0x149c('0x176')],{'as':_0x149c('0x177'),'foreignKey':_0x149c('0x178'),'onDelete':_0x149c('0xee'),'hooks':!![]});db['Interval'][_0x149c('0xef')](db[_0x149c('0x122')],{'as':_0x149c('0x179'),'foreignKey':'IntervalId','onDelete':_0x149c('0xee'),'hooks':!![],'required':![]});db[_0x149c('0x122')][_0x149c('0xef')](db[_0x149c('0x1a')],{'as':'Extensions','foreignKey':_0x149c('0x123'),'onDelete':_0x149c('0x141')});db['Interval']['hasMany'](db[_0x149c('0x140')],{'as':_0x149c('0x17a'),'foreignKey':_0x149c('0x123')});db[_0x149c('0x122')]['hasMany'](db['ChatApplication'],{'as':_0x149c('0x17b'),'foreignKey':_0x149c('0x123')});db['Interval'][_0x149c('0xef')](db[_0x149c('0x46')],{'as':_0x149c('0x17c'),'foreignKey':_0x149c('0x123')});db[_0x149c('0x122')][_0x149c('0xef')](db['SmsApplication'],{'as':_0x149c('0x17d'),'foreignKey':'IntervalId'});db[_0x149c('0x17e')][_0x149c('0xf7')](db[_0x149c('0x3c')],{});db['Schedule']['belongsTo'](db[_0x149c('0x8b')],{'foreignKey':_0x149c('0x17f')});db[_0x149c('0x17e')]['belongsTo'](db[_0x149c('0x8a')],{'foreignKey':_0x149c('0x180')});db[_0x149c('0x80')]['belongsToMany'](db[_0x149c('0x181')],{'as':_0x149c('0x182'),'through':_0x149c('0x183'),'onDelete':_0x149c('0x141')});db['Tag']['belongsToMany'](db[_0x149c('0xfb')],{'through':'cm_contact_has_tags'});db[_0x149c('0x81')]['belongsToMany'](db[_0x149c('0x5e')],{'through':_0x149c('0x160')});db['Tag'][_0x149c('0xf9')](db[_0x149c('0x40')],{'through':_0x149c('0x13d')});db[_0x149c('0x81')][_0x149c('0xf9')](db[_0x149c('0x52')],{'through':'sms_interaction_has_tags'});db['Tag'][_0x149c('0xf9')](db['FaxInteraction'],{'through':_0x149c('0x14a')});db[_0x149c('0x81')][_0x149c('0xf9')](db[_0x149c('0x58')],{'through':_0x149c('0x159')});db['Trigger'][_0x149c('0xef')](db['Condition'],{'as':{'plural':_0x149c('0x184'),'singular':_0x149c('0x185')},'foreignKey':_0x149c('0x186'),'onDelete':_0x149c('0xee'),'hooks':!![]});db[_0x149c('0x85')]['hasMany'](db['Condition'],{'as':{'plural':_0x149c('0x187'),'singular':_0x149c('0x188')},'foreignKey':_0x149c('0x189'),'onDelete':'cascade','hooks':!![]});db[_0x149c('0x85')][_0x149c('0xef')](db[_0x149c('0x176')],{'as':_0x149c('0x177'),'foreignKey':_0x149c('0x18a'),'onDelete':'cascade','hooks':!![]});db[_0x149c('0x8a')][_0x149c('0xef')](db['AnalyticFieldReport'],{'as':_0x149c('0x18b'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x180'),'hooks':!![]});db[_0x149c('0x8b')][_0x149c('0xef')](db[_0x149c('0x90')],{'as':_0x149c('0x18b'),'onDelete':_0x149c('0xee'),'foreignKey':'DefaultReportId'});db[_0x149c('0x8f')][_0x149c('0xef')](db[_0x149c('0x90')],{'as':'Fields','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x18c')});db[_0x149c('0x90')][_0x149c('0xf7')](db[_0x149c('0x8f')],{'foreignKey':_0x149c('0x18c')});db[_0x149c('0x94')][_0x149c('0xef')](db[_0x149c('0x18d')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x149c('0x18e')});db[_0x149c('0x18d')][_0x149c('0xef')](db[_0x149c('0x96')],{'as':_0x149c('0x18f'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x190')});db['SalesforceConfiguration'][_0x149c('0xef')](db[_0x149c('0x96')],{'as':_0x149c('0x191'),'onDelete':'cascade','foreignKey':_0x149c('0x192')});db['SalesforceConfiguration']['hasMany'](db[_0x149c('0x96')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x149c('0x193')});db[_0x149c('0x18d')][_0x149c('0xf7')](db[_0x149c('0x94')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x18e')});db[_0x149c('0x96')][_0x149c('0xef')](db['SalesforceField'],{'as':_0x149c('0x194'),'foreignKey':_0x149c('0x190')});db['SalesforceField'][_0x149c('0xef')](db['SalesforceField'],{'as':'Description','foreignKey':_0x149c('0x192')});db[_0x149c('0x96')][_0x149c('0xef')](db[_0x149c('0x96')],{'as':'Field','foreignKey':_0x149c('0x193')});db[_0x149c('0x96')][_0x149c('0xf7')](db[_0x149c('0x86')],{'as':_0x149c('0x86'),'foreignKey':_0x149c('0x195')});db['SugarcrmAccount'][_0x149c('0xef')](db[_0x149c('0x99')],{'as':_0x149c('0x196'),'onDelete':_0x149c('0xee'),'foreignKey':'AccountId'});db[_0x149c('0x99')][_0x149c('0xef')](db[_0x149c('0x9b')],{'as':_0x149c('0x18f'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x149c('0x99')]['hasMany'](db['SugarcrmField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x149c('0x192')});db[_0x149c('0x99')]['hasMany'](db[_0x149c('0x9b')],{'as':'Fields','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x193')});db[_0x149c('0x99')][_0x149c('0xf7')](db[_0x149c('0x197')],{'as':'Account','foreignKey':_0x149c('0x18e')});db[_0x149c('0x9b')][_0x149c('0xef')](db['SugarcrmField'],{'as':_0x149c('0x194'),'foreignKey':_0x149c('0x190')});db['SugarcrmField']['hasMany'](db[_0x149c('0x9b')],{'as':_0x149c('0x198'),'foreignKey':_0x149c('0x192')});db[_0x149c('0x9b')][_0x149c('0xef')](db['SugarcrmField'],{'as':_0x149c('0x199'),'foreignKey':_0x149c('0x193')});db['SugarcrmField']['belongsTo'](db[_0x149c('0x86')],{'as':'Variable','foreignKey':_0x149c('0x195')});db['DeskAccount'][_0x149c('0xef')](db[_0x149c('0x19a')],{'as':_0x149c('0x196'),'onDelete':_0x149c('0xee'),'foreignKey':'AccountId'});db[_0x149c('0x19a')][_0x149c('0xef')](db[_0x149c('0x19b')],{'as':_0x149c('0x18f'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x190')});db[_0x149c('0x19a')][_0x149c('0xef')](db[_0x149c('0x19b')],{'as':_0x149c('0x191'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x192')});db[_0x149c('0x19a')][_0x149c('0xef')](db['DeskField'],{'as':_0x149c('0x18b'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x193')});db['DeskConfiguration'][_0x149c('0xf7')](db[_0x149c('0x19c')],{'as':'Account','foreignKey':_0x149c('0x18e')});db['DeskConfiguration'][_0x149c('0xf9')](db['Tag'],{'through':_0x149c('0x19d')});db[_0x149c('0x19b')][_0x149c('0xef')](db['DeskField'],{'as':_0x149c('0x194'),'foreignKey':_0x149c('0x190')});db[_0x149c('0x19b')]['hasMany'](db[_0x149c('0x19b')],{'as':_0x149c('0x198'),'foreignKey':_0x149c('0x192')});db[_0x149c('0x19b')][_0x149c('0xef')](db[_0x149c('0x19b')],{'as':_0x149c('0x199'),'foreignKey':_0x149c('0x193')});db['DeskField'][_0x149c('0xf7')](db[_0x149c('0x86')],{'as':'Variable','foreignKey':_0x149c('0x195')});db[_0x149c('0x9f')]['hasMany'](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x149c('0xee'),'foreignKey':'AccountId'});db[_0x149c('0xa1')][_0x149c('0xef')](db['ZohoField'],{'as':'Subjects','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x190')});db['ZohoConfiguration'][_0x149c('0xef')](db[_0x149c('0xa3')],{'as':_0x149c('0x191'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x192')});db[_0x149c('0xa1')]['hasMany'](db[_0x149c('0xa3')],{'as':'Fields','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x193')});db[_0x149c('0xa1')]['belongsTo'](db['ZohoAccount'],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x18e')});db[_0x149c('0xa3')][_0x149c('0xef')](db[_0x149c('0xa3')],{'as':_0x149c('0x194'),'foreignKey':_0x149c('0x190')});db['ZohoField'][_0x149c('0xef')](db[_0x149c('0xa3')],{'as':_0x149c('0x198'),'foreignKey':_0x149c('0x192')});db['ZohoField'][_0x149c('0xef')](db[_0x149c('0xa3')],{'as':_0x149c('0x199'),'foreignKey':_0x149c('0x193')});db['ZohoField'][_0x149c('0xf7')](db[_0x149c('0x86')],{'as':_0x149c('0x86'),'foreignKey':_0x149c('0x195')});db[_0x149c('0xa4')][_0x149c('0xef')](db[_0x149c('0xa5')],{'as':_0x149c('0x196'),'onDelete':_0x149c('0xee'),'foreignKey':'AccountId'});db[_0x149c('0xa5')][_0x149c('0xef')](db[_0x149c('0xa6')],{'as':_0x149c('0x18f'),'foreignKey':_0x149c('0x190')});db[_0x149c('0xa5')]['hasMany'](db['ZendeskField'],{'as':_0x149c('0x191'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x149c('0xef')](db[_0x149c('0xa6')],{'as':_0x149c('0x18b'),'foreignKey':'FieldId'});db[_0x149c('0xa5')][_0x149c('0xf7')](db[_0x149c('0xa4')],{'as':'Account','foreignKey':_0x149c('0x18e')});db[_0x149c('0xa5')][_0x149c('0xf9')](db[_0x149c('0x81')],{'through':_0x149c('0x19e')});db[_0x149c('0xa6')][_0x149c('0xef')](db[_0x149c('0xa6')],{'as':_0x149c('0x194'),'foreignKey':'SubjectId'});db[_0x149c('0xa6')][_0x149c('0xef')](db[_0x149c('0xa6')],{'as':_0x149c('0x198'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0x149c('0xa6')],{'as':_0x149c('0x199'),'foreignKey':_0x149c('0x193')});db[_0x149c('0xa6')][_0x149c('0xf7')](db[_0x149c('0x86')],{'as':_0x149c('0x86'),'foreignKey':_0x149c('0x195')});db[_0x149c('0xa8')][_0x149c('0xef')](db[_0x149c('0xaa')],{'as':'Configurations','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x18e')});db[_0x149c('0xaa')][_0x149c('0xef')](db[_0x149c('0x19f')],{'as':_0x149c('0x18f'),'onDelete':_0x149c('0xee'),'foreignKey':'SubjectId'});db[_0x149c('0xaa')][_0x149c('0xef')](db[_0x149c('0x19f')],{'as':_0x149c('0x191'),'onDelete':'cascade','foreignKey':_0x149c('0x192')});db['FreshdeskConfiguration'][_0x149c('0xef')](db[_0x149c('0x19f')],{'as':'Fields','onDelete':_0x149c('0xee'),'foreignKey':'FieldId'});db[_0x149c('0xaa')][_0x149c('0xf7')](db[_0x149c('0xa8')],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x149c('0xf9')](db[_0x149c('0x81')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x149c('0x19f')][_0x149c('0xef')](db[_0x149c('0x19f')],{'as':_0x149c('0x194'),'foreignKey':'SubjectId'});db[_0x149c('0x19f')][_0x149c('0xef')](db['FreshdeskField'],{'as':_0x149c('0x198'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0x149c('0xef')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x149c('0x193')});db[_0x149c('0x19f')][_0x149c('0xf7')](db[_0x149c('0x86')],{'as':_0x149c('0x86'),'foreignKey':_0x149c('0x195')});db[_0x149c('0xad')]['hasMany'](db['VtigerConfiguration'],{'as':_0x149c('0x196'),'onDelete':'cascade','foreignKey':_0x149c('0x18e')});db[_0x149c('0xaf')]['hasMany'](db[_0x149c('0xb1')],{'as':_0x149c('0x18f'),'foreignKey':_0x149c('0x190')});db[_0x149c('0xaf')]['hasMany'](db[_0x149c('0xb1')],{'as':_0x149c('0x191'),'foreignKey':_0x149c('0x192')});db[_0x149c('0xaf')][_0x149c('0xef')](db[_0x149c('0xb1')],{'as':_0x149c('0x18b'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x149c('0xf7')](db[_0x149c('0xad')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x18e')});db[_0x149c('0xaf')][_0x149c('0xf9')](db[_0x149c('0x81')],{'through':'int_vtiger_configuration_has_tags'});db['VtigerField'][_0x149c('0xef')](db[_0x149c('0xb1')],{'as':_0x149c('0x194'),'foreignKey':_0x149c('0x190')});db[_0x149c('0xb1')]['hasMany'](db[_0x149c('0xb1')],{'as':_0x149c('0x198'),'foreignKey':'DescriptionId'});db['VtigerField']['hasMany'](db[_0x149c('0xb1')],{'as':_0x149c('0x199'),'foreignKey':'FieldId'});db[_0x149c('0xb1')][_0x149c('0xf7')](db[_0x149c('0x86')],{'as':_0x149c('0x86'),'foreignKey':_0x149c('0x195')});db[_0x149c('0x1a0')][_0x149c('0xef')](db[_0x149c('0x1a1')],{'as':_0x149c('0x196'),'onDelete':'cascade','foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x149c('0xef')](db[_0x149c('0xb5')],{'as':_0x149c('0x18f'),'foreignKey':_0x149c('0x190')});db['ServicenowConfiguration']['hasMany'](db[_0x149c('0xb5')],{'as':_0x149c('0x191'),'foreignKey':_0x149c('0x192')});db[_0x149c('0x1a1')]['hasMany'](db[_0x149c('0xb5')],{'as':_0x149c('0x18b'),'foreignKey':_0x149c('0x193')});db[_0x149c('0x1a1')]['belongsTo'](db[_0x149c('0x1a0')],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x18e')});db[_0x149c('0xb5')][_0x149c('0xef')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x149c('0x190')});db[_0x149c('0xb5')][_0x149c('0xef')](db[_0x149c('0xb5')],{'as':'Description','foreignKey':'DescriptionId'});db['ServicenowField']['hasMany'](db[_0x149c('0xb5')],{'as':_0x149c('0x199'),'foreignKey':_0x149c('0x193')});db[_0x149c('0xb5')]['belongsTo'](db['Variable'],{'as':_0x149c('0x86'),'foreignKey':_0x149c('0x195')});db[_0x149c('0xb6')]['hasMany'](db[_0x149c('0xb7')],{'as':_0x149c('0x196'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x18e')});db[_0x149c('0xb7')][_0x149c('0xef')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x190')});db[_0x149c('0xb7')][_0x149c('0xef')](db['Dynamics365Field'],{'as':_0x149c('0x191'),'onDelete':'cascade','foreignKey':_0x149c('0x192')});db[_0x149c('0xb7')][_0x149c('0xef')](db[_0x149c('0xb9')],{'as':_0x149c('0x18b'),'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x193')});db[_0x149c('0xb7')][_0x149c('0xf7')](db['Dynamics365Account'],{'as':_0x149c('0x139'),'foreignKey':_0x149c('0x18e')});db[_0x149c('0xb9')][_0x149c('0xef')](db['Dynamics365Field'],{'as':_0x149c('0x194'),'foreignKey':_0x149c('0x190')});db[_0x149c('0xb9')][_0x149c('0xef')](db[_0x149c('0xb9')],{'as':_0x149c('0x198'),'foreignKey':_0x149c('0x192')});db['Dynamics365Field'][_0x149c('0xef')](db[_0x149c('0xb9')],{'as':_0x149c('0x199'),'foreignKey':'FieldId'});db[_0x149c('0xb9')][_0x149c('0xf7')](db['Variable'],{'as':_0x149c('0x86'),'foreignKey':_0x149c('0x195')});db[_0x149c('0xbe')][_0x149c('0xf7')](db[_0x149c('0x10d')],{});db[_0x149c('0xbe')][_0x149c('0xf7')](db[_0x149c('0x109')],{'as':_0x149c('0x131'),'foreignKey':_0x149c('0x132')});db[_0x149c('0xbe')][_0x149c('0xf7')](db['CmContact'],{'as':_0x149c('0x13a'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0x149c('0xf7')](db[_0x149c('0x5e')],{});db[_0x149c('0xbe')][_0x149c('0xf7')](db[_0x149c('0x60')],{});db[_0x149c('0xbe')][_0x149c('0xf7')](db[_0x149c('0x13')],{});db['ChatQueueReport'][_0x149c('0xf7')](db[_0x149c('0x64')],{});db[_0x149c('0xc0')][_0x149c('0xf7')](db['User'],{'onDelete':_0x149c('0xee'),'foreignKey':_0x149c('0x1a2')});db[_0x149c('0xc0')][_0x149c('0xf7')](db[_0x149c('0x13')],{'onDelete':'cascade','foreignKey':'ToId'});db[_0x149c('0x11f')][_0x149c('0xef')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0x149c('0xee')});db['JscriptySessionReport'][_0x149c('0xef')](db[_0x149c('0x1a3')],{'foreignKey':_0x149c('0x1a4'),'onDelete':_0x149c('0xee')});db['SmsQueueReport'][_0x149c('0xf7')](db[_0x149c('0x14e')],{});db[_0x149c('0xc6')]['belongsTo'](db[_0x149c('0x109')],{'as':'List','foreignKey':'ListId'});db[_0x149c('0xc6')][_0x149c('0xf7')](db[_0x149c('0xfb')],{'as':'Contact','foreignKey':_0x149c('0x12b')});db[_0x149c('0xc6')][_0x149c('0xf7')](db[_0x149c('0x52')],{});db[_0x149c('0xc6')][_0x149c('0xf7')](db['SmsMessage'],{});db[_0x149c('0xc6')][_0x149c('0xf7')](db['User'],{});db[_0x149c('0xc6')]['belongsTo'](db[_0x149c('0x150')],{});db[_0x149c('0x1a5')][_0x149c('0xef')](db[_0x149c('0x11f')],{'foreignKey':_0x149c('0x1a6')});db[_0x149c('0x1a5')][_0x149c('0xef')](db[_0x149c('0xc3')],{'foreignKey':_0x149c('0x1a6')});db[_0x149c('0x1a5')][_0x149c('0xef')](db[_0x149c('0x1a3')],{'foreignKey':_0x149c('0x1a6')});db[_0x149c('0xd0')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':'Users','through':_0x149c('0x115')});db[_0x149c('0xfc')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x149c('0xfd')});db[_0x149c('0xfc')]['belongsToMany'](db[_0x149c('0x1d')],{'through':_0x149c('0x126'),'as':_0x149c('0x104')});db[_0x149c('0xfc')]['belongsToMany'](db['MailQueue'],{'through':_0x149c('0x1a7'),'as':_0x149c('0x106')});db[_0x149c('0xfc')]['belongsToMany'](db[_0x149c('0x64')],{'through':'team_has_chat_queues','as':_0x149c('0x107')});db['Team'][_0x149c('0xf9')](db['FaxQueue'],{'through':_0x149c('0x14c'),'as':_0x149c('0x1a8')});db[_0x149c('0xfc')][_0x149c('0xf9')](db[_0x149c('0x150')],{'through':_0x149c('0x154'),'as':_0x149c('0x1a9')});db[_0x149c('0xfc')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0x149c('0x15b'),'as':_0x149c('0x1aa')});db[_0x149c('0xd4')][_0x149c('0xef')](db[_0x149c('0x11c')],{'as':_0x149c('0x166'),'foreignKey':_0x149c('0x16d')});db[_0x149c('0xd4')][_0x149c('0xef')](db['CmHopperFinal'],{'as':_0x149c('0xf3'),'foreignKey':_0x149c('0x16d')});db['Campaign']['hasMany'](db['CmHopperHistory'],{'as':_0x149c('0x167'),'foreignKey':_0x149c('0x16d')});db['Campaign'][_0x149c('0xef')](db['CmHopperBlack'],{'as':_0x149c('0x11e'),'foreignKey':_0x149c('0x16d')});db['Campaign'][_0x149c('0xf7')](db[_0x149c('0x2c')],{'as':_0x149c('0x2c'),'foreignKey':_0x149c('0x120')});db['Campaign'][_0x149c('0xf7')](db[_0x149c('0x2c')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x149c('0xd4')][_0x149c('0xf7')](db[_0x149c('0x122')],{'as':_0x149c('0x122'),'foreignKey':_0x149c('0x123')});db['Campaign'][_0x149c('0xf7')](db[_0x149c('0xd0')],{'as':'SquareProject','foreignKey':_0x149c('0x1ab')});db[_0x149c('0xd4')][_0x149c('0xf9')](db['CmList'],{'as':'Lists','through':_0x149c('0x1ac')});db[_0x149c('0xd4')][_0x149c('0xf9')](db[_0x149c('0x109')],{'as':_0x149c('0x1ad'),'through':'campaigns_has_cm_blacklists'});db[_0x149c('0xdc')]['belongsTo'](db['MailMessage'],{});db[_0x149c('0xdc')][_0x149c('0xf7')](db[_0x149c('0x40')],{});db['MailTransferReport'][_0x149c('0xf7')](db[_0x149c('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x149c('0x1ae')});db[_0x149c('0xdc')][_0x149c('0xf7')](db[_0x149c('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db['MailTransferReport']['belongsTo'](db[_0x149c('0x13')],{'foreignKey':'ToUserId','as':_0x149c('0x1af')});db[_0x149c('0xdc')]['belongsTo'](db['MailQueue'],{'foreignKey':_0x149c('0x1b0'),'as':_0x149c('0x1b1')});db[_0x149c('0xdc')][_0x149c('0xf7')](db['MailAccount'],{'foreignKey':_0x149c('0x1b2'),'as':'ToAccount'});db[_0x149c('0xdd')][_0x149c('0xf7')](db[_0x149c('0x60')],{});db[_0x149c('0xdd')][_0x149c('0xf7')](db[_0x149c('0x5e')],{});db[_0x149c('0xdd')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x149c('0x1b3'),'as':'FromAccount'});db['ChatTransferReport']['belongsTo'](db[_0x149c('0x13')],{'foreignKey':_0x149c('0x1b4'),'as':_0x149c('0x1b5')});db[_0x149c('0xdd')][_0x149c('0xf7')](db[_0x149c('0x13')],{'foreignKey':_0x149c('0x1b6'),'as':'ToAgent'});db[_0x149c('0xdd')][_0x149c('0xf7')](db['ChatQueue'],{'foreignKey':_0x149c('0x1b7'),'as':_0x149c('0x1b1')});db['ChatTransferReport']['belongsTo'](db[_0x149c('0x10d')],{'foreignKey':_0x149c('0x1b8'),'as':_0x149c('0x1b9')});db[_0x149c('0xdf')][_0x149c('0xf7')](db[_0x149c('0x4a')],{});db[_0x149c('0xdf')]['belongsTo'](db[_0x149c('0x48')],{});db[_0x149c('0xdf')]['belongsTo'](db[_0x149c('0x44')],{'foreignKey':_0x149c('0x1ba'),'as':_0x149c('0x1ae')});db['FaxTransferReport'][_0x149c('0xf7')](db[_0x149c('0x13')],{'foreignKey':_0x149c('0x1b4'),'as':_0x149c('0x1b5')});db[_0x149c('0xdf')][_0x149c('0xf7')](db[_0x149c('0x13')],{'foreignKey':_0x149c('0x1b6'),'as':_0x149c('0x1af')});db['FaxTransferReport'][_0x149c('0xf7')](db[_0x149c('0x4c')],{'foreignKey':'ToFaxQueueId','as':_0x149c('0x1b1')});db[_0x149c('0xdf')]['belongsTo'](db[_0x149c('0x44')],{'foreignKey':_0x149c('0x1bb'),'as':'ToAccount'});db[_0x149c('0xe1')]['belongsTo'](db[_0x149c('0x157')],{});db[_0x149c('0xe1')][_0x149c('0xf7')](db[_0x149c('0x58')],{});db['OpenchannelTransferReport'][_0x149c('0xf7')](db['OpenchannelAccount'],{'foreignKey':_0x149c('0x1bc'),'as':_0x149c('0x1ae')});db[_0x149c('0xe1')][_0x149c('0xf7')](db['User'],{'foreignKey':_0x149c('0x1b4'),'as':_0x149c('0x1b5')});db[_0x149c('0xe1')]['belongsTo'](db['User'],{'foreignKey':_0x149c('0x1b6'),'as':_0x149c('0x1af')});db['OpenchannelTransferReport'][_0x149c('0xf7')](db[_0x149c('0x108')],{'foreignKey':_0x149c('0x1bd'),'as':_0x149c('0x1b1')});db['OpenchannelTransferReport'][_0x149c('0xf7')](db[_0x149c('0x54')],{'foreignKey':_0x149c('0x1be'),'as':'ToAccount'});db[_0x149c('0xe2')][_0x149c('0xf7')](db[_0x149c('0x151')],{});db[_0x149c('0xe2')]['belongsTo'](db['SmsInteraction'],{});db['SmsTransferReport'][_0x149c('0xf7')](db[_0x149c('0x14e')],{'foreignKey':_0x149c('0x1bf'),'as':_0x149c('0x1ae')});db[_0x149c('0xe2')][_0x149c('0xf7')](db['User'],{'foreignKey':'FromUserId','as':_0x149c('0x1b5')});db[_0x149c('0xe2')][_0x149c('0xf7')](db[_0x149c('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x149c('0xe2')]['belongsTo'](db[_0x149c('0x150')],{'foreignKey':_0x149c('0x1c0'),'as':_0x149c('0x1b1')});db[_0x149c('0xe2')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x149c('0x1c1'),'as':_0x149c('0x1b9')});db[_0x149c('0x109')]['hasMany'](db[_0x149c('0x77')],{'as':_0x149c('0x144'),'foreignKey':'ListId'});db['CmList'][_0x149c('0xef')](db['CmCustomField'],{'as':_0x149c('0x1c2'),'foreignKey':'ListId'});db[_0x149c('0x109')][_0x149c('0xef')](db[_0x149c('0xfb')],{'as':_0x149c('0x164'),'onDelete':_0x149c('0xee'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x149c('0x6c')],{'as':'HopperFinals','foreignKey':_0x149c('0x132')});db[_0x149c('0x109')][_0x149c('0xef')](db[_0x149c('0x6d')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x149c('0x109')]['hasMany'](db['ReportAgentPreview'],{'as':_0x149c('0x6f'),'foreignKey':'ListId'});db[_0x149c('0x109')][_0x149c('0xf9')](db['VoiceQueue'],{'as':_0x149c('0x1c3'),'through':_0x149c('0x124')});db['CmList'][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':_0x149c('0x125'),'through':_0x149c('0x10a')});db[_0x149c('0xe5')][_0x149c('0xef')](db[_0x149c('0x1a')],{'as':_0x149c('0xf2'),'onDelete':'restrict'});db[_0x149c('0xe5')][_0x149c('0xf9')](db[_0x149c('0x13')],{'as':_0x149c('0x125'),'through':_0x149c('0x10c')});db[_0x149c('0xe7')][_0x149c('0xef')](db[_0x149c('0x13')],{'as':'Users','foreignKey':_0x149c('0xf8')});db[_0x149c('0xe7')][_0x149c('0xef')](db[_0x149c('0xe9')],{'as':_0x149c('0x1c4'),'foreignKey':_0x149c('0xf8'),'onDelete':_0x149c('0xee')});db[_0x149c('0xe9')][_0x149c('0xef')](db[_0x149c('0xeb')],{'as':_0x149c('0x1c5'),'foreignKey':_0x149c('0x1c6'),'onDelete':_0x149c('0xee')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x8cad=['../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','VoiceRecording','Recordings','hasMany','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','MailInteraction','MailInteractions','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueues','FaxQueues','UserFaxQueue','SmsQueues','UserOpenchannelQueue','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailServerIn','MailAccountId','MailServerOut','Smtp','Disposition','Dispositions','Answers','Interactions','List','ListId','Template','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Interaction','restrict','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','Teams','FaxQueueReport','SmsAccountId','CannedAnswer','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueue','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','ChatInternalMessage','ChatGroupId','HopperHistories','JscriptySessions','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Automation','Any','AutomationAnyId','Actions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Sound','Trigger','AllConditions','TriggerAllId','TriggerAnyId','AnalyticFieldReport','Fields','CustomReportId','AnalyticMetric','MetricId','SalesforceAccount','AccountId','Descriptions','FieldId','Description','DescriptionId','Field','SugarcrmAccount','Subjects','Subject','SubjectId','VariableId','int_desk_configuration_has_tags','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','Configurations','int_freshdesk_configuration_has_tags','int_vtiger_configuration_has_tags','ServicenowField','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyProject','ProjectId','ChatQueues','OpenchannelQueues','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToAgent','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSections','Resources','sectionId','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../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','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../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','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x903ca9,_0x2fbc2a){var _0x370719=function(_0x515f41){while(--_0x515f41){_0x903ca9['push'](_0x903ca9['shift']());}};_0x370719(++_0x2fbc2a);}(_0x8cad,0xfe));var _0xd8ca=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x8cad[_0x45f951];return _0x24756c;};'use strict';var path=require(_0xd8ca('0x0'));var config=require(_0xd8ca('0x1'));var Sequelize=require(_0xd8ca('0x2'));var _=require(_0xd8ca('0x3'));var jstz=require(_0xd8ca('0x4'));var timezone=jstz[_0xd8ca('0x5')]();config[_0xd8ca('0x2')]=_[_0xd8ca('0x6')](config[_0xd8ca('0x2')],{'database':_0xd8ca('0x7'),'username':_0xd8ca('0x8'),'password':_0xd8ca('0x9'),'options':{'host':_0xd8ca('0xa'),'port':0xcea,'dialect':_0xd8ca('0xb'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xd8ca('0xc')](),'define':{'charset':_0xd8ca('0xd'),'collate':_0xd8ca('0xe')}}});config[_0xd8ca('0xf')]=_[_0xd8ca('0x6')](config['sequelizeHistory'],{'database':_0xd8ca('0x7'),'username':'xcall','password':_0xd8ca('0x9'),'options':{'host':_0xd8ca('0xa'),'port':0xcea,'dialect':_0xd8ca('0xb'),'dialectOptions':{'charset':_0xd8ca('0x10')},'logging':![],'timezone':timezone[_0xd8ca('0xc')](),'define':{'charset':_0xd8ca('0xd'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd8ca('0x2')][_0xd8ca('0x11')],config[_0xd8ca('0x2')][_0xd8ca('0x12')],config[_0xd8ca('0x2')][_0xd8ca('0x13')],config[_0xd8ca('0x2')][_0xd8ca('0x14')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd8ca('0xf')]['database'],config[_0xd8ca('0xf')][_0xd8ca('0x12')],config[_0xd8ca('0xf')][_0xd8ca('0x13')],config[_0xd8ca('0xf')][_0xd8ca('0x14')])};db[_0xd8ca('0x15')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x17'));db['VoiceChanSpy']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x18'));db[_0xd8ca('0x19')]=db['sequelize']['import'](_0xd8ca('0x1a'));db['VoiceExtension']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x1b'));db[_0xd8ca('0x1c')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xd8ca('0x1d')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x1e'));db['VoiceRecording']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x1f'));db['ScreenRecording']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x20'));db[_0xd8ca('0x21')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x22'));db['VoiceMailMessage']=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xd8ca('0x23')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x24'));db[_0xd8ca('0x25')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x26'));db['VoiceAgentReport']=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x27'));db[_0xd8ca('0x28')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x29'));db[_0xd8ca('0x2a')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x2b'));db[_0xd8ca('0x2c')]=db['sequelize']['import'](_0xd8ca('0x2d'));db[_0xd8ca('0x2e')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x2f'));db[_0xd8ca('0x30')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd8ca('0x31')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x32'));db[_0xd8ca('0x33')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x34'));db['UserFaxQueue']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x35'));db['UserSmsQueue']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x36'));db['UserOpenchannelQueue']=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x37'));db['MailServerIn']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x38'));db['MailServerOut']=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/mailServerOut/mailServerOut.model');db[_0xd8ca('0x39')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x3a'));db[_0xd8ca('0x3b')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x3c'));db[_0xd8ca('0x3d')]=db['sequelize']['import'](_0xd8ca('0x3e'));db['MailInteraction']=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x3f'));db[_0xd8ca('0x40')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/mailMessage/mailMessage.model');db[_0xd8ca('0x41')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/mailQueueReport/mailQueueReport.model');db[_0xd8ca('0x42')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x43'));db[_0xd8ca('0x44')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x45'));db[_0xd8ca('0x46')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x47'));db[_0xd8ca('0x48')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/faxApplication/faxApplication.model');db[_0xd8ca('0x49')]=db[_0xd8ca('0x2')]['import']('../api/faxInteraction/faxInteraction.model');db[_0xd8ca('0x4a')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x4b'));db[_0xd8ca('0x4c')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x4d'));db['FaxQueueReport']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x4e'));db[_0xd8ca('0x4f')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x50'));db[_0xd8ca('0x51')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x52'));db['SmsInteraction']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x53'));db[_0xd8ca('0x54')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x55'));db[_0xd8ca('0x56')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x57'));db[_0xd8ca('0x58')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x59'));db[_0xd8ca('0x5a')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x5b'));db[_0xd8ca('0x5c')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x5d'));db[_0xd8ca('0x5e')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x5f'));db['OpenchannelQueue']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x60'));db[_0xd8ca('0x61')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x62'));db[_0xd8ca('0x63')]=db[_0xd8ca('0x2')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xd8ca('0x64')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x65'));db[_0xd8ca('0x66')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x67'));db['ChatOfflineMessage']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x68'));db[_0xd8ca('0x69')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x6a'));db[_0xd8ca('0x6b')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x6c'));db[_0xd8ca('0x6d')]=db[_0xd8ca('0x2')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xd8ca('0x6e')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x6f'));db[_0xd8ca('0x70')]=db['sequelize'][_0xd8ca('0x16')]('../api/cmContact/cmContact.model');db[_0xd8ca('0x71')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x72'));db[_0xd8ca('0x73')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x74'));db[_0xd8ca('0x75')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x76'));db[_0xd8ca('0x77')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x78'));db[_0xd8ca('0x79')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x7a'));db['CmCustomField']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x7b'));db[_0xd8ca('0x7c')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x7d'));db['Automation']=db['sequelize']['import'](_0xd8ca('0x7e'));db['CannedAnswer']=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x7f'));db['Disposition']=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x80'));db['Condition']=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x81'));db[_0xd8ca('0x82')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x83'));db[_0xd8ca('0x84')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x85'));db[_0xd8ca('0x86')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x87'));db['VoiceQueuesLog']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x88'));db[_0xd8ca('0x89')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/schedule/schedule.model');db['Sound']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x8a'));db['Tag']=db['sequelize'][_0xd8ca('0x16')]('../api/tag/tag.model');db['Template']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x8b'));db['Trigger']=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x8c'));db[_0xd8ca('0x8d')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x8e'));db[_0xd8ca('0x8f')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0x90'));db['IntegrationReport']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x91'));db[_0xd8ca('0x92')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x93'));db[_0xd8ca('0x94')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x95'));db[_0xd8ca('0x96')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x97'));db['AnalyticFieldReport']=db['sequelize']['import'](_0xd8ca('0x98'));db['AnalyticTreeReport']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x99'));db['SalesforceAccount']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x9a'));db[_0xd8ca('0x9b')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x9c'));db[_0xd8ca('0x9d')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x9e'));db['SugarcrmAccount']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0x9f'));db[_0xd8ca('0xa0')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xa1'));db[_0xd8ca('0xa2')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xa3'));db[_0xd8ca('0xa4')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0xa5'));db[_0xd8ca('0xa6')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xa7'));db[_0xd8ca('0xa8')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xa9'));db[_0xd8ca('0xaa')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xab'));db[_0xd8ca('0xac')]=db[_0xd8ca('0x2')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xd8ca('0xad')]=db['sequelize'][_0xd8ca('0x16')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xd8ca('0xae')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xaf'));db['ZendeskField']=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/intZendeskField/intZendeskField.model');db[_0xd8ca('0xb0')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xb1'));db[_0xd8ca('0xb2')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xd8ca('0xb3')]=db['sequelize'][_0xd8ca('0x16')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xd8ca('0xb4')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xb5'));db[_0xd8ca('0xb6')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xb7'));db[_0xd8ca('0xb8')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xb9'));db[_0xd8ca('0xba')]=db['sequelize']['import'](_0xd8ca('0xbb'));db[_0xd8ca('0xbc')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0xbd'));db['ServicenowField']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xbe'));db[_0xd8ca('0xbf')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xc0'));db[_0xd8ca('0xc1')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xc2'));db[_0xd8ca('0xc3')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0xc4'));db[_0xd8ca('0x8f')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0x90'));db[_0xd8ca('0xc5')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xc6'));db[_0xd8ca('0xc7')]=db['sequelize']['import'](_0xd8ca('0xc8'));db['ChatInternalMessage']=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xd8ca('0xc9')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xca'));db['JscriptyQuestionReport']=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xcb'));db[_0xd8ca('0xcc')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xcd'));db[_0xd8ca('0xce')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xcf'));db['SquareDetailsReport']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xd0'));db['JscriptyProject']=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0xd1'));db['Setting']=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xd2'));db[_0xd8ca('0xd3')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xd4'));db[_0xd8ca('0xd5')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0xd6'));db['SquareRecording']=db['sequelize'][_0xd8ca('0x16')]('../api/squareRecording/squareRecording.model');db[_0xd8ca('0xd7')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xd8'));db[_0xd8ca('0xd9')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xda'));db[_0xd8ca('0xdb')]=db['sequelize'][_0xd8ca('0x16')](_0xd8ca('0xdc'));db[_0xd8ca('0xdd')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xde'));db['Migration']=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xdf'));db[_0xd8ca('0xe0')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/attachment/attachment.model');db[_0xd8ca('0xe1')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xe2'));db[_0xd8ca('0xe3')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xe4'));db[_0xd8ca('0xe5')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')]('../api/chatTransferReport/chatTransferReport.model');db[_0xd8ca('0xe6')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xe7'));db[_0xd8ca('0xe8')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xe9'));db[_0xd8ca('0xea')]=db[_0xd8ca('0x2')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0xd8ca('0xeb')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xec'));db[_0xd8ca('0xed')]=db[_0xd8ca('0x2')]['import'](_0xd8ca('0xee'));db['UserProfile']=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xef'));db[_0xd8ca('0xf0')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xf1'));db[_0xd8ca('0xf2')]=db[_0xd8ca('0x2')][_0xd8ca('0x16')](_0xd8ca('0xf3'));db[_0xd8ca('0x15')][_0xd8ca('0xf4')](db[_0xd8ca('0x21')],{'as':_0xd8ca('0x21'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x15')]['hasMany'](db[_0xd8ca('0xf7')],{'as':_0xd8ca('0xf8'),'foreignKey':'UserId'});db['User'][_0xd8ca('0xf9')](db['UserVoiceQueueRt'],{'as':_0xd8ca('0xfa'),'foreignKey':'UserId'});db[_0xd8ca('0x15')][_0xd8ca('0xf9')](db[_0xd8ca('0xfb')],{'as':_0xd8ca('0xfc'),'onDelete':_0xd8ca('0xf5'),'hooks':!![]});db[_0xd8ca('0x15')][_0xd8ca('0xf9')](db['CmHopperFinal'],{'as':_0xd8ca('0xfd'),'foreignKey':_0xd8ca('0xf6')});db['User'][_0xd8ca('0xf9')](db['CmHopperHistory'],{'as':_0xd8ca('0xfe'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x15')][_0xd8ca('0xf9')](db[_0xd8ca('0x79')],{'as':_0xd8ca('0x79'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x15')][_0xd8ca('0xf9')](db[_0xd8ca('0x5c')],{'as':_0xd8ca('0xff'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x15')]['hasMany'](db[_0xd8ca('0x66')],{'as':_0xd8ca('0x100'),'foreignKey':'UserId'});db[_0xd8ca('0x15')][_0xd8ca('0xf9')](db[_0xd8ca('0x101')],{'as':_0xd8ca('0x102'),'foreignKey':_0xd8ca('0xf6')});db['User'][_0xd8ca('0xf9')](db[_0xd8ca('0x49')],{'as':'FaxInteractions','foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x15')]['hasMany'](db[_0xd8ca('0x103')],{'as':_0xd8ca('0x104'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x15')]['belongsTo'](db[_0xd8ca('0x105')],{'as':'UserProfile','foreignKey':_0xd8ca('0x106')});db['User'][_0xd8ca('0x107')](db[_0xd8ca('0x6b')],{'as':_0xd8ca('0x108'),'through':_0xd8ca('0x109')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x10a'),'through':'cm_user_has_contacts'});db[_0xd8ca('0x15')]['belongsToMany'](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x10b'),'through':_0xd8ca('0x10c')});db[_0xd8ca('0x15')]['belongsToMany'](db[_0xd8ca('0xd9')],{'through':'user_has_teams'});db[_0xd8ca('0x15')]['belongsToMany'](db[_0xd8ca('0x103')],{'as':_0xd8ca('0x104'),'through':'user_has_mail_interactions'});db[_0xd8ca('0x15')]['belongsToMany'](db[_0xd8ca('0x66')],{'as':_0xd8ca('0x100'),'through':_0xd8ca('0x10d')});db[_0xd8ca('0x15')]['belongsToMany'](db[_0xd8ca('0x49')],{'as':_0xd8ca('0x10e'),'through':_0xd8ca('0x10f')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db['SmsInteraction'],{'as':_0xd8ca('0x102'),'through':_0xd8ca('0x110')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x5c')],{'as':_0xd8ca('0xff'),'through':'user_has_openchannel_interactions'});db[_0xd8ca('0x15')]['belongsToMany'](db[_0xd8ca('0x1d')],{'as':_0xd8ca('0x111'),'through':_0xd8ca('0x30'),'required':![]});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x3b')],{'as':_0xd8ca('0x112'),'through':_0xd8ca('0x33'),'required':![]});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x69')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x4c')],{'as':_0xd8ca('0x113'),'through':_0xd8ca('0x114'),'required':![]});db[_0xd8ca('0x15')]['belongsToMany'](db[_0xd8ca('0x56')],{'as':_0xd8ca('0x115'),'through':'UserSmsQueue','required':![]});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0xd8ca('0x116'),'required':![]});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0xeb')],{'through':_0xd8ca('0x10c')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0xed')],{'as':'VoicePrefixes','through':_0xd8ca('0x117'),'required':![]});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x61')],{'as':_0xd8ca('0x118'),'through':_0xd8ca('0x119')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x46')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x39')],{'as':_0xd8ca('0x11a'),'through':_0xd8ca('0x11b')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x58')],{'as':_0xd8ca('0x11c'),'through':_0xd8ca('0x11d')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0x4f')],{'as':_0xd8ca('0x11e'),'through':_0xd8ca('0x11f')});db[_0xd8ca('0x15')][_0xd8ca('0x107')](db[_0xd8ca('0xd5')],{'as':_0xd8ca('0x120'),'through':_0xd8ca('0x121')});db['VoiceChanSpy']['hasMany'](db[_0xd8ca('0xfb')],{'as':_0xd8ca('0x122'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x123')});db['VoiceContext'][_0xd8ca('0xf9')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xd8ca('0xfb')][_0xd8ca('0xf9')](db['VoiceExtension'],{'as':_0xd8ca('0x124'),'onDelete':_0xd8ca('0xf5')});db['VoiceMusicOnHold'][_0xd8ca('0x107')](db['Sound'],{'as':_0xd8ca('0x125'),'through':_0xd8ca('0x126')});db[_0xd8ca('0x1d')][_0xd8ca('0xf9')](db[_0xd8ca('0x2e')],{'as':_0xd8ca('0x127'),'foreignKey':'VoiceQueueId'});db[_0xd8ca('0x1d')][_0xd8ca('0xf9')](db['CmHopper'],{'as':_0xd8ca('0x128'),'foreignKey':_0xd8ca('0x129')});db[_0xd8ca('0x1d')][_0xd8ca('0xf9')](db[_0xd8ca('0x75')],{'as':_0xd8ca('0xfd'),'foreignKey':'VoiceQueueId'});db[_0xd8ca('0x1d')][_0xd8ca('0xf9')](db[_0xd8ca('0x77')],{'as':'HopperHistories','foreignKey':_0xd8ca('0x129')});db[_0xd8ca('0x1d')][_0xd8ca('0xf9')](db[_0xd8ca('0x79')],{'as':_0xd8ca('0x79'),'foreignKey':_0xd8ca('0x129')});db[_0xd8ca('0x1d')][_0xd8ca('0xf9')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0xd8ca('0x1d')][_0xd8ca('0xf9')](db[_0xd8ca('0xcc')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xd8ca('0x1d')][_0xd8ca('0x12a')](db['Trunk'],{'as':_0xd8ca('0x2a'),'foreignKey':_0xd8ca('0x12b')});db['VoiceQueue'][_0xd8ca('0x12a')](db['Trunk'],{'as':_0xd8ca('0x12c'),'foreignKey':_0xd8ca('0x12d')});db[_0xd8ca('0x1d')][_0xd8ca('0x12a')](db[_0xd8ca('0x82')],{'as':'Interval','foreignKey':_0xd8ca('0x12e')});db[_0xd8ca('0x1d')][_0xd8ca('0x12a')](db[_0xd8ca('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xd8ca('0x12f')});db[_0xd8ca('0x1d')][_0xd8ca('0x107')](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x10b'),'through':_0xd8ca('0x130')});db[_0xd8ca('0x1d')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x131'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0xd8ca('0x107')](db[_0xd8ca('0xd9')],{'as':'Teams','through':_0xd8ca('0x132')});db[_0xd8ca('0x1d')]['belongsToMany'](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x133'),'through':_0xd8ca('0x134')});db['VoiceRecording'][_0xd8ca('0x12a')](db['User'],{'as':_0xd8ca('0x15'),'foreignKey':'UserId'});db[_0xd8ca('0x135')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x15'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x21')][_0xd8ca('0xf9')](db[_0xd8ca('0x136')],{'as':_0xd8ca('0x137'),'onDelete':'cascade','foreignKey':_0xd8ca('0x138'),'sourceKey':_0xd8ca('0x139')});db[_0xd8ca('0x136')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0xd8ca('0x138'),'targetKey':_0xd8ca('0x139')});db[_0xd8ca('0x23')]['hasMany'](db[_0xd8ca('0x13a')],{'as':_0xd8ca('0x13b'),'foreignKey':_0xd8ca('0x13c'),'constraints':![]});db[_0xd8ca('0x23')]['hasMany'](db['VoiceAgentReport'],{'as':_0xd8ca('0x13d'),'foreignKey':_0xd8ca('0x13c'),'constraints':![]});db[_0xd8ca('0x23')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':'User','foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x23')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x140')]['belongsTo'](db['MailAccount'],{'as':_0xd8ca('0x39'),'foreignKey':_0xd8ca('0x141')});db[_0xd8ca('0x142')][_0xd8ca('0x12a')](db['MailAccount'],{'as':_0xd8ca('0x39'),'foreignKey':_0xd8ca('0x141')});db[_0xd8ca('0x39')][_0xd8ca('0xf4')](db[_0xd8ca('0x140')],{'as':'Imap','onDelete':'cascade'});db[_0xd8ca('0x39')][_0xd8ca('0xf4')](db['MailServerOut'],{'as':_0xd8ca('0x143'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x39')][_0xd8ca('0xf9')](db[_0xd8ca('0x144')],{'as':_0xd8ca('0x145'),'foreignKey':_0xd8ca('0x141')});db[_0xd8ca('0x39')]['hasMany'](db['CannedAnswer'],{'as':_0xd8ca('0x146'),'foreignKey':_0xd8ca('0x141')});db[_0xd8ca('0x39')][_0xd8ca('0xf9')](db['MailMessage'],{'as':_0xd8ca('0x137'),'foreignKey':_0xd8ca('0x141')});db[_0xd8ca('0x39')][_0xd8ca('0xf9')](db[_0xd8ca('0x103')],{'as':_0xd8ca('0x147')});db[_0xd8ca('0x39')][_0xd8ca('0xf9')](db[_0xd8ca('0x41')],{'as':_0xd8ca('0x124')});db[_0xd8ca('0x39')][_0xd8ca('0x12a')](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x148'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0x39')]['belongsTo'](db['Template'],{'as':_0xd8ca('0x14a'),'foreignKey':'TemplateId'});db[_0xd8ca('0x39')]['belongsTo'](db[_0xd8ca('0x84')],{'as':_0xd8ca('0x14b'),'foreignKey':_0xd8ca('0x12f')});db[_0xd8ca('0x39')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xd8ca('0x3b')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':'Agents','through':_0xd8ca('0x33')});db[_0xd8ca('0x3b')][_0xd8ca('0x107')](db[_0xd8ca('0xd9')],{'through':_0xd8ca('0x14c'),'as':'Teams'});db['MailInteraction'][_0xd8ca('0xf9')](db[_0xd8ca('0x40')],{'as':_0xd8ca('0x137'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x14d')});db[_0xd8ca('0x103')][_0xd8ca('0x12a')](db[_0xd8ca('0x39')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x141')});db[_0xd8ca('0x103')]['belongsTo'](db[_0xd8ca('0x70')],{'as':'Contact','foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x103')]['belongsTo'](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x14f'),'foreignKey':_0xd8ca('0xf6')});db['MailInteraction'][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':'mail_interaction_has_tags','as':_0xd8ca('0x151')});db[_0xd8ca('0x103')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x152'),'as':_0xd8ca('0x153')});db['MailInteraction']['belongsToMany'](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x154'),'through':_0xd8ca('0x155'),'foreignKey':_0xd8ca('0x14d')});db[_0xd8ca('0x40')][_0xd8ca('0xf9')](db[_0xd8ca('0xe0')],{'as':'Attachments','onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x40')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x15')});db[_0xd8ca('0x40')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x13e')});db['MailMessage'][_0xd8ca('0x12a')](db[_0xd8ca('0x103')],{'as':_0xd8ca('0x156'),'foreignKey':'MailInteractionId'});db[_0xd8ca('0x40')][_0xd8ca('0x12a')](db[_0xd8ca('0x39')],{'as':'Account','foreignKey':_0xd8ca('0x141')});db[_0xd8ca('0x41')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x41')][_0xd8ca('0x12a')](db[_0xd8ca('0x3b')],{'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x41')][_0xd8ca('0x12a')](db['MailAccount'],{'onDelete':'restrict'});db[_0xd8ca('0x41')]['belongsTo'](db[_0xd8ca('0x82')],{'onDelete':_0xd8ca('0x157'),'foreignKey':'IntervalId'});db[_0xd8ca('0x41')][_0xd8ca('0x12a')](db[_0xd8ca('0x150')],{'onDelete':_0xd8ca('0x157'),'foreignKey':_0xd8ca('0x158')});db[_0xd8ca('0x159')]['belongsTo'](db['MailAccount'],{});db[_0xd8ca('0x159')][_0xd8ca('0x12a')](db['CmList'],{'as':_0xd8ca('0x148'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0x159')]['belongsTo'](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x159')][_0xd8ca('0x12a')](db['MailInteraction'],{});db[_0xd8ca('0x159')][_0xd8ca('0x12a')](db[_0xd8ca('0x40')],{});db[_0xd8ca('0x159')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{});db[_0xd8ca('0x159')][_0xd8ca('0x12a')](db[_0xd8ca('0x3b')],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':_0xd8ca('0x15a'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x46')][_0xd8ca('0xf9')](db[_0xd8ca('0x144')],{'as':_0xd8ca('0x145'),'foreignKey':_0xd8ca('0x15b')});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':_0xd8ca('0x146'),'foreignKey':_0xd8ca('0x15b')});db[_0xd8ca('0x46')][_0xd8ca('0xf9')](db['FaxInteraction'],{'as':'Interactions'});db['FaxAccount'][_0xd8ca('0xf9')](db[_0xd8ca('0x48')],{'as':_0xd8ca('0x124')});db[_0xd8ca('0x46')][_0xd8ca('0xf9')](db[_0xd8ca('0xfb')],{'as':_0xd8ca('0x15c'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x46')][_0xd8ca('0xf9')](db[_0xd8ca('0x4a')],{'as':'Messages'});db['FaxAccount'][_0xd8ca('0x12a')](db[_0xd8ca('0x2a')],{'as':_0xd8ca('0x2a')});db[_0xd8ca('0x46')][_0xd8ca('0x12a')](db[_0xd8ca('0xeb')],{'as':'List','foreignKey':_0xd8ca('0x149')});db['FaxAccount'][_0xd8ca('0x12a')](db['Pause'],{'as':_0xd8ca('0x14b'),'foreignKey':_0xd8ca('0x12f')});db[_0xd8ca('0x46')]['belongsToMany'](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x131'),'through':_0xd8ca('0x15d')});db[_0xd8ca('0x48')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'onDelete':'restrict'});db[_0xd8ca('0x48')]['belongsTo'](db[_0xd8ca('0x4c')],{'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x48')][_0xd8ca('0x12a')](db[_0xd8ca('0x46')],{'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x48')][_0xd8ca('0x12a')](db[_0xd8ca('0x150')],{'onDelete':_0xd8ca('0x157'),'foreignKey':_0xd8ca('0x158')});db[_0xd8ca('0x49')][_0xd8ca('0xf9')](db[_0xd8ca('0x4a')],{'as':_0xd8ca('0x137'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x15e')});db['FaxInteraction'][_0xd8ca('0x12a')](db['FaxAccount'],{'as':'Account','foreignKey':_0xd8ca('0x15b')});db[_0xd8ca('0x49')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db['FaxInteraction'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x14f'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x49')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x15f'),'as':'Tags'});db[_0xd8ca('0x49')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x15f'),'as':_0xd8ca('0x153')});db[_0xd8ca('0x49')][_0xd8ca('0x107')](db['User'],{'as':_0xd8ca('0x154'),'through':_0xd8ca('0x10f'),'foreignKey':_0xd8ca('0x15e')});db[_0xd8ca('0x4a')]['belongsTo'](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0xf5'),'as':'User'});db['FaxMessage'][_0xd8ca('0x12a')](db[_0xd8ca('0x49')],{'as':_0xd8ca('0x156'),'foreignKey':'FaxInteractionId'});db[_0xd8ca('0x4a')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x13e')});db[_0xd8ca('0x4a')][_0xd8ca('0x12a')](db[_0xd8ca('0xe0')],{'as':'Attachment','foreignKey':_0xd8ca('0x160')});db['FaxMessage'][_0xd8ca('0x12a')](db[_0xd8ca('0x46')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x15b')});db[_0xd8ca('0x4c')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x131'),'through':_0xd8ca('0x114')});db['FaxQueue']['belongsToMany'](db[_0xd8ca('0xd9')],{'through':_0xd8ca('0x161'),'as':_0xd8ca('0x162')});db[_0xd8ca('0x163')]['belongsTo'](db[_0xd8ca('0x46')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db['FaxQueueReport'][_0xd8ca('0x12a')](db['CmContact'],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x163')][_0xd8ca('0x12a')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x4a')],{});db[_0xd8ca('0x163')][_0xd8ca('0x12a')](db['User'],{});db['FaxQueueReport'][_0xd8ca('0x12a')](db['FaxQueue'],{});db[_0xd8ca('0x4f')][_0xd8ca('0xf9')](db[_0xd8ca('0x144')],{'as':_0xd8ca('0x145'),'foreignKey':_0xd8ca('0x164')});db['SmsAccount'][_0xd8ca('0xf9')](db[_0xd8ca('0x165')],{'as':'Answers','foreignKey':_0xd8ca('0x164')});db[_0xd8ca('0x4f')][_0xd8ca('0xf9')](db['SmsMessage'],{'as':_0xd8ca('0x137'),'foreignKey':_0xd8ca('0x164')});db[_0xd8ca('0x4f')][_0xd8ca('0xf9')](db[_0xd8ca('0x101')],{'as':_0xd8ca('0x147')});db['SmsAccount'][_0xd8ca('0xf9')](db['SmsApplication'],{'as':'Applications'});db['SmsAccount'][_0xd8ca('0x12a')](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x148'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0x4f')][_0xd8ca('0x12a')](db[_0xd8ca('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xd8ca('0x12f')});db[_0xd8ca('0x4f')]['belongsToMany'](db[_0xd8ca('0x15')],{'as':'Agents','through':_0xd8ca('0x11f')});db[_0xd8ca('0x51')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x51')]['belongsTo'](db[_0xd8ca('0x56')],{'onDelete':'restrict'});db[_0xd8ca('0x51')][_0xd8ca('0x12a')](db['SmsAccount'],{'onDelete':_0xd8ca('0x157')});db['SmsApplication'][_0xd8ca('0x12a')](db['Interval'],{'onDelete':_0xd8ca('0x157'),'foreignKey':'IntervalId'});db[_0xd8ca('0x51')][_0xd8ca('0x12a')](db[_0xd8ca('0x150')],{'onDelete':_0xd8ca('0x157'),'foreignKey':_0xd8ca('0x158')});db[_0xd8ca('0x101')][_0xd8ca('0xf9')](db['SmsMessage'],{'as':_0xd8ca('0x137'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x166')});db[_0xd8ca('0x101')][_0xd8ca('0x12a')](db[_0xd8ca('0x4f')],{'as':_0xd8ca('0x14e'),'foreignKey':'SmsAccountId'});db[_0xd8ca('0x101')]['belongsTo'](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db['SmsInteraction'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x14f'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x101')]['belongsToMany'](db['Tag'],{'through':_0xd8ca('0x167'),'as':_0xd8ca('0x151')});db[_0xd8ca('0x101')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0xd8ca('0x101')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x154'),'through':_0xd8ca('0x110'),'foreignKey':'SmsInteractionId'});db[_0xd8ca('0x54')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x15')});db['SmsMessage'][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'onDelete':_0xd8ca('0xf5'),'as':'Contact'});db[_0xd8ca('0x54')][_0xd8ca('0x12a')](db[_0xd8ca('0x101')],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x156'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xd8ca('0x12a')](db[_0xd8ca('0x4f')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x164')});db[_0xd8ca('0x56')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':'Agents','through':_0xd8ca('0x168'),'foreignKey':_0xd8ca('0x169')});db[_0xd8ca('0x56')][_0xd8ca('0x107')](db['Team'],{'through':_0xd8ca('0x16a'),'as':'Teams'});db[_0xd8ca('0x58')][_0xd8ca('0xf9')](db[_0xd8ca('0x144')],{'as':_0xd8ca('0x145'),'foreignKey':_0xd8ca('0x16b')});db[_0xd8ca('0x58')][_0xd8ca('0xf9')](db[_0xd8ca('0x165')],{'as':_0xd8ca('0x146'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xd8ca('0xf9')](db[_0xd8ca('0x5c')],{'as':_0xd8ca('0x147'),'foreignKey':'OpenchannelAccountId'});db[_0xd8ca('0x58')][_0xd8ca('0xf9')](db[_0xd8ca('0x5e')],{'as':_0xd8ca('0x137'),'foreignKey':_0xd8ca('0x16b')});db[_0xd8ca('0x58')][_0xd8ca('0xf9')](db[_0xd8ca('0x5a')],{'as':'Applications','foreignKey':_0xd8ca('0x16b')});db[_0xd8ca('0x58')][_0xd8ca('0x12a')](db[_0xd8ca('0xeb')],{'as':'List','foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0x58')][_0xd8ca('0x12a')](db[_0xd8ca('0x84')],{'as':_0xd8ca('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount']['belongsToMany'](db['User'],{'as':_0xd8ca('0x131'),'through':_0xd8ca('0x11d')});db['OpenchannelApplication'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x5a')][_0xd8ca('0x12a')](db['OpenchannelQueue'],{'onDelete':_0xd8ca('0x157'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0xd8ca('0x12a')](db['OpenchannelAccount'],{'onDelete':_0xd8ca('0x157'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0xd8ca('0x12a')](db[_0xd8ca('0x82')],{'onDelete':_0xd8ca('0x157'),'foreignKey':'IntervalId'});db[_0xd8ca('0x5a')][_0xd8ca('0x12a')](db[_0xd8ca('0x150')],{'onDelete':_0xd8ca('0x157'),'foreignKey':'TagId'});db[_0xd8ca('0x5c')][_0xd8ca('0xf9')](db[_0xd8ca('0x5e')],{'as':_0xd8ca('0x137'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x16c')});db[_0xd8ca('0x5c')][_0xd8ca('0x12a')](db[_0xd8ca('0x58')],{'as':_0xd8ca('0x14e'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':'ContactId'});db['OpenchannelInteraction']['belongsTo'](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x14f'),'foreignKey':'UserId'});db['OpenchannelInteraction']['belongsToMany'](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x16d'),'as':_0xd8ca('0x151')});db[_0xd8ca('0x5c')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x16d'),'as':_0xd8ca('0x153')});db[_0xd8ca('0x5c')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x154'),'through':_0xd8ca('0x16e'),'foreignKey':_0xd8ca('0x16c')});db['OpenchannelMessage']['belongsTo'](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x15')});db['OpenchannelMessage'][_0xd8ca('0x12a')](db['CmContact'],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x13e')});db[_0xd8ca('0x5e')][_0xd8ca('0x12a')](db[_0xd8ca('0x5c')],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x156'),'foreignKey':_0xd8ca('0x16c')});db[_0xd8ca('0x5e')]['belongsTo'](db[_0xd8ca('0xe0')],{'as':_0xd8ca('0xe0'),'foreignKey':'AttachmentId'});db[_0xd8ca('0x5e')][_0xd8ca('0x12a')](db[_0xd8ca('0x58')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x16b')});db[_0xd8ca('0x16f')]['belongsToMany'](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x131'),'through':_0xd8ca('0x116'),'foreignKey':'OpenchannelQueueId'});db[_0xd8ca('0x16f')]['belongsToMany'](db[_0xd8ca('0xd9')],{'through':_0xd8ca('0x170'),'as':_0xd8ca('0x162')});db[_0xd8ca('0x61')][_0xd8ca('0xf9')](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0xd8ca('0x165')],{'as':_0xd8ca('0x146'),'foreignKey':_0xd8ca('0x171')});db[_0xd8ca('0x61')][_0xd8ca('0xf9')](db['ChatProactiveAction'],{'as':_0xd8ca('0x172')});db[_0xd8ca('0x61')][_0xd8ca('0xf9')](db[_0xd8ca('0x66')],{'as':_0xd8ca('0x147')});db[_0xd8ca('0x61')][_0xd8ca('0xf9')](db[_0xd8ca('0x64')],{'as':'Applications'});db['ChatWebsite'][_0xd8ca('0xf9')](db[_0xd8ca('0x173')],{'as':_0xd8ca('0x137')});db[_0xd8ca('0x61')][_0xd8ca('0x12a')](db[_0xd8ca('0xeb')],{'as':'List','foreignKey':_0xd8ca('0x149')});db['ChatWebsite'][_0xd8ca('0x12a')](db[_0xd8ca('0x82')],{'as':_0xd8ca('0x82'),'foreignKey':_0xd8ca('0x12e')});db[_0xd8ca('0x61')]['belongsTo'](db['Pause'],{'as':_0xd8ca('0x14b'),'foreignKey':_0xd8ca('0x12f')});db[_0xd8ca('0x61')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x131'),'through':_0xd8ca('0x119')});db[_0xd8ca('0x63')][_0xd8ca('0x12a')](db[_0xd8ca('0x58')],{});db[_0xd8ca('0x63')][_0xd8ca('0x12a')](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x148'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0x63')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db['OpenchannelQueueReport']['belongsTo'](db[_0xd8ca('0x5c')],{});db[_0xd8ca('0x63')]['belongsTo'](db[_0xd8ca('0x5e')],{});db['OpenchannelQueueReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{});db['OpenchannelQueueReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x16f')],{});db[_0xd8ca('0x64')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x174'),'foreignKey':_0xd8ca('0xf6'),'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x64')][_0xd8ca('0x12a')](db[_0xd8ca('0x69')],{'as':_0xd8ca('0x175'),'foreignKey':'ChatQueueId','onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x64')][_0xd8ca('0x12a')](db[_0xd8ca('0x61')],{'as':'Website','foreignKey':_0xd8ca('0x171'),'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x64')][_0xd8ca('0x12a')](db[_0xd8ca('0x150')],{'onDelete':'restrict','foreignKey':_0xd8ca('0x158')});db[_0xd8ca('0x66')]['hasMany'](db[_0xd8ca('0x173')],{'as':_0xd8ca('0x137'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x176')});db[_0xd8ca('0x66')][_0xd8ca('0x12a')](db[_0xd8ca('0x61')],{'as':_0xd8ca('0x14e'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x66')]['belongsTo'](db['User'],{'as':_0xd8ca('0x14f'),'foreignKey':_0xd8ca('0xf6')});db[_0xd8ca('0x66')][_0xd8ca('0x107')](db['Tag'],{'through':_0xd8ca('0x177'),'as':_0xd8ca('0x151')});db[_0xd8ca('0x66')]['belongsToMany'](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x177'),'as':_0xd8ca('0x153')});db[_0xd8ca('0x66')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x154'),'through':_0xd8ca('0x10d'),'foreignKey':_0xd8ca('0x176')});db[_0xd8ca('0x173')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x15')});db[_0xd8ca('0x173')][_0xd8ca('0x12a')](db['CmContact'],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x173')][_0xd8ca('0x12a')](db[_0xd8ca('0x66')],{'onDelete':'cascade','as':_0xd8ca('0x156'),'foreignKey':'ChatInteractionId'});db[_0xd8ca('0x173')]['belongsTo'](db[_0xd8ca('0xe0')],{'as':'Attachment','foreignKey':_0xd8ca('0x160')});db[_0xd8ca('0x173')]['belongsTo'](db[_0xd8ca('0x61')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xd8ca('0x178')][_0xd8ca('0x12a')](db['CmContact'],{'onDelete':_0xd8ca('0xf5'),'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db['ChatOfflineMessage'][_0xd8ca('0x12a')](db[_0xd8ca('0x61')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x171')});db[_0xd8ca('0x69')]['belongsToMany'](db[_0xd8ca('0x15')],{'as':'Agents','through':_0xd8ca('0x31'),'hooks':!![]});db[_0xd8ca('0x69')][_0xd8ca('0x107')](db[_0xd8ca('0xd9')],{'through':_0xd8ca('0x179'),'as':_0xd8ca('0x162')});db[_0xd8ca('0x6b')][_0xd8ca('0xf9')](db[_0xd8ca('0x17a')],{'as':_0xd8ca('0x137'),'foreignKey':_0xd8ca('0x17b'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x6b')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':'Members','through':_0xd8ca('0x109')});db[_0xd8ca('0x6d')][_0xd8ca('0x12a')](db[_0xd8ca('0x61')],{'as':'Website','foreignKey':_0xd8ca('0x171')});db[_0xd8ca('0x6e')][_0xd8ca('0xf9')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x10a'),'foreignKey':'CompanyId'});db[_0xd8ca('0x70')]['hasMany'](db['CmHopper'],{'as':_0xd8ca('0x128'),'foreignKey':_0xd8ca('0x13f')});db['CmContact'][_0xd8ca('0xf9')](db[_0xd8ca('0x75')],{'as':_0xd8ca('0xfd'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x70')][_0xd8ca('0xf9')](db[_0xd8ca('0x77')],{'as':_0xd8ca('0x17c'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x70')][_0xd8ca('0xf9')](db['ReportAgentPreview'],{'as':_0xd8ca('0x79'),'foreignKey':_0xd8ca('0x13f')});db['CmContact'][_0xd8ca('0xf9')](db[_0xd8ca('0xcc')],{'as':_0xd8ca('0x17d'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0x70')][_0xd8ca('0xf9')](db[_0xd8ca('0x5c')],{'as':_0xd8ca('0xff'),'foreignKey':_0xd8ca('0x13f'),'onDelete':_0xd8ca('0x157')});db['CmContact'][_0xd8ca('0xf9')](db['ChatInteraction'],{'as':_0xd8ca('0x100'),'foreignKey':_0xd8ca('0x13f'),'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x70')][_0xd8ca('0xf9')](db[_0xd8ca('0x101')],{'as':_0xd8ca('0x102'),'foreignKey':'ContactId','onDelete':_0xd8ca('0x157')});db['CmContact'][_0xd8ca('0xf9')](db[_0xd8ca('0x49')],{'as':'FaxInteractions','foreignKey':_0xd8ca('0x13f'),'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x70')][_0xd8ca('0xf9')](db['MailInteraction'],{'as':_0xd8ca('0x104'),'foreignKey':_0xd8ca('0x13f'),'onDelete':_0xd8ca('0x157')});db['CmContact'][_0xd8ca('0x12a')](db[_0xd8ca('0x6e')],{'as':_0xd8ca('0x17e'),'foreignKey':_0xd8ca('0x17f')});db[_0xd8ca('0x70')][_0xd8ca('0x12a')](db['CmList'],{'as':_0xd8ca('0x148'),'foreignKey':'ListId','onDelete':_0xd8ca('0xf5')});db['CmContact'][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x154'),'through':_0xd8ca('0x180')});db[_0xd8ca('0x70')]['belongsToMany'](db[_0xd8ca('0x150')],{'as':'Tags','through':_0xd8ca('0x181')});db[_0xd8ca('0x70')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':'cm_contact_has_tags','as':_0xd8ca('0x153')});db[_0xd8ca('0x71')][_0xd8ca('0x12a')](db['CmContact'],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x71')][_0xd8ca('0x12a')](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x148'),'foreignKey':_0xd8ca('0x149'),'onDelete':_0xd8ca('0xf5')});db['CmHopper'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x174'),'foreignKey':'UserId'});db[_0xd8ca('0x71')][_0xd8ca('0x12a')](db[_0xd8ca('0x1d')],{'as':'Queue','foreignKey':_0xd8ca('0x129'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x71')][_0xd8ca('0x12a')](db['Campaign'],{'as':'Campaign','foreignKey':_0xd8ca('0x182'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x71')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'as':_0xd8ca('0x14f'),'foreignKey':_0xd8ca('0x183')});db[_0xd8ca('0x73')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0x73')][_0xd8ca('0x12a')](db['CmList'],{'as':_0xd8ca('0x148'),'foreignKey':_0xd8ca('0x149'),'onDelete':'cascade'});db[_0xd8ca('0x73')][_0xd8ca('0x12a')](db[_0xd8ca('0x1d')],{'as':_0xd8ca('0x175'),'foreignKey':_0xd8ca('0x129'),'onDelete':_0xd8ca('0xf5')});db['CmHopperBlack'][_0xd8ca('0x12a')](db[_0xd8ca('0xdd')],{'as':_0xd8ca('0xdd'),'foreignKey':'CampaignId','onDelete':'cascade'});db['Automation'][_0xd8ca('0xf9')](db[_0xd8ca('0x184')],{'as':{'plural':_0xd8ca('0x185'),'singular':_0xd8ca('0x186')},'foreignKey':_0xd8ca('0x187'),'onDelete':_0xd8ca('0xf5'),'hooks':!![]});db[_0xd8ca('0x188')][_0xd8ca('0xf9')](db[_0xd8ca('0x184')],{'as':{'plural':_0xd8ca('0x189'),'singular':'OneAny'},'foreignKey':_0xd8ca('0x18a'),'onDelete':_0xd8ca('0xf5'),'hooks':!![]});db[_0xd8ca('0x188')]['hasMany'](db[_0xd8ca('0x7c')],{'as':_0xd8ca('0x18b'),'foreignKey':'AutomationId','onDelete':_0xd8ca('0xf5'),'hooks':!![]});db[_0xd8ca('0x82')][_0xd8ca('0xf9')](db[_0xd8ca('0x82')],{'as':'Intervals','foreignKey':_0xd8ca('0x12e'),'onDelete':_0xd8ca('0xf5'),'hooks':!![],'required':![]});db[_0xd8ca('0x82')][_0xd8ca('0xf9')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0xd8ca('0x12e'),'onDelete':'restrict'});db[_0xd8ca('0x82')][_0xd8ca('0xf9')](db[_0xd8ca('0x41')],{'as':_0xd8ca('0x18c'),'foreignKey':'IntervalId'});db[_0xd8ca('0x82')][_0xd8ca('0xf9')](db[_0xd8ca('0x64')],{'as':_0xd8ca('0x18d'),'foreignKey':_0xd8ca('0x12e')});db[_0xd8ca('0x82')]['hasMany'](db['FaxApplication'],{'as':_0xd8ca('0x18e'),'foreignKey':_0xd8ca('0x12e')});db['Interval']['hasMany'](db['SmsApplication'],{'as':_0xd8ca('0x18f'),'foreignKey':_0xd8ca('0x12e')});db[_0xd8ca('0x89')][_0xd8ca('0x12a')](db[_0xd8ca('0x39')],{});db[_0xd8ca('0x89')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0xd8ca('0x190')});db[_0xd8ca('0x89')][_0xd8ca('0x12a')](db[_0xd8ca('0x92')],{'foreignKey':'CustomReportId'});db[_0xd8ca('0x191')][_0xd8ca('0x107')](db[_0xd8ca('0x1c')],{'as':'Mohs','through':_0xd8ca('0x126'),'onDelete':_0xd8ca('0x157')});db[_0xd8ca('0x150')][_0xd8ca('0x107')](db[_0xd8ca('0x70')],{'through':_0xd8ca('0x181')});db[_0xd8ca('0x150')][_0xd8ca('0x107')](db[_0xd8ca('0x66')],{'through':_0xd8ca('0x177')});db['Tag'][_0xd8ca('0x107')](db[_0xd8ca('0x103')],{'through':_0xd8ca('0x152')});db[_0xd8ca('0x150')][_0xd8ca('0x107')](db[_0xd8ca('0x101')],{'through':_0xd8ca('0x167')});db[_0xd8ca('0x150')][_0xd8ca('0x107')](db[_0xd8ca('0x49')],{'through':_0xd8ca('0x15f')});db[_0xd8ca('0x150')][_0xd8ca('0x107')](db[_0xd8ca('0x5c')],{'through':_0xd8ca('0x16d')});db[_0xd8ca('0x192')][_0xd8ca('0xf9')](db[_0xd8ca('0x184')],{'as':{'plural':_0xd8ca('0x193'),'singular':'AllCondition'},'foreignKey':_0xd8ca('0x194'),'onDelete':_0xd8ca('0xf5'),'hooks':!![]});db[_0xd8ca('0x192')]['hasMany'](db[_0xd8ca('0x184')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xd8ca('0x195'),'onDelete':_0xd8ca('0xf5'),'hooks':!![]});db['Trigger'][_0xd8ca('0xf9')](db[_0xd8ca('0x7c')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xd8ca('0xf5'),'hooks':!![]});db['AnalyticCustomReport'][_0xd8ca('0xf9')](db[_0xd8ca('0x196')],{'as':_0xd8ca('0x197'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x198'),'hooks':!![]});db[_0xd8ca('0x94')]['hasMany'](db[_0xd8ca('0x196')],{'as':'Fields','onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x190')});db[_0xd8ca('0x199')][_0xd8ca('0xf9')](db[_0xd8ca('0x196')],{'as':'Fields','onDelete':_0xd8ca('0xf5'),'foreignKey':'MetricId'});db[_0xd8ca('0x196')][_0xd8ca('0x12a')](db[_0xd8ca('0x199')],{'foreignKey':_0xd8ca('0x19a')});db[_0xd8ca('0x19b')][_0xd8ca('0xf9')](db[_0xd8ca('0x9b')],{'as':'Configurations','onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0x9b')][_0xd8ca('0xf9')](db[_0xd8ca('0x9d')],{'as':'Subjects','onDelete':_0xd8ca('0xf5'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0xd8ca('0xf9')](db[_0xd8ca('0x9d')],{'as':_0xd8ca('0x19d'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xd8ca('0x9b')]['hasMany'](db['SalesforceField'],{'as':_0xd8ca('0x197'),'onDelete':'cascade','foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0x9b')][_0xd8ca('0x12a')](db[_0xd8ca('0x19b')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x19c')});db['SalesforceField'][_0xd8ca('0xf9')](db[_0xd8ca('0x9d')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd8ca('0x9d')][_0xd8ca('0xf9')](db[_0xd8ca('0x9d')],{'as':_0xd8ca('0x19f'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0x9d')]['hasMany'](db[_0xd8ca('0x9d')],{'as':_0xd8ca('0x1a1'),'foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0x9d')][_0xd8ca('0x12a')](db[_0xd8ca('0x8d')],{'as':_0xd8ca('0x8d'),'foreignKey':'VariableId'});db[_0xd8ca('0x1a2')][_0xd8ca('0xf9')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xa0')]['hasMany'](db[_0xd8ca('0xa2')],{'as':_0xd8ca('0x1a3'),'onDelete':_0xd8ca('0xf5'),'foreignKey':'SubjectId'});db[_0xd8ca('0xa0')]['hasMany'](db[_0xd8ca('0xa2')],{'as':_0xd8ca('0x19d'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xa0')][_0xd8ca('0xf9')](db[_0xd8ca('0xa2')],{'as':'Fields','onDelete':_0xd8ca('0xf5'),'foreignKey':'FieldId'});db[_0xd8ca('0xa0')][_0xd8ca('0x12a')](db['SugarcrmAccount'],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xa2')][_0xd8ca('0xf9')](db[_0xd8ca('0xa2')],{'as':_0xd8ca('0x1a4'),'foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0xa2')]['hasMany'](db[_0xd8ca('0xa2')],{'as':_0xd8ca('0x19f'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xa2')]['hasMany'](db[_0xd8ca('0xa2')],{'as':'Field','foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xa2')][_0xd8ca('0x12a')](db[_0xd8ca('0x8d')],{'as':_0xd8ca('0x8d'),'foreignKey':_0xd8ca('0x1a6')});db[_0xd8ca('0xa4')][_0xd8ca('0xf9')](db[_0xd8ca('0xa6')],{'as':'Configurations','onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19c')});db['DeskConfiguration'][_0xd8ca('0xf9')](db['DeskField'],{'as':_0xd8ca('0x1a3'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0xa6')][_0xd8ca('0xf9')](db[_0xd8ca('0xa8')],{'as':_0xd8ca('0x19d'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xa6')]['hasMany'](db[_0xd8ca('0xa8')],{'as':_0xd8ca('0x197'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xa6')][_0xd8ca('0x12a')](db[_0xd8ca('0xa4')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xa6')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x1a7')});db['DeskField'][_0xd8ca('0xf9')](db['DeskField'],{'as':_0xd8ca('0x1a4'),'foreignKey':'SubjectId'});db[_0xd8ca('0xa8')][_0xd8ca('0xf9')](db[_0xd8ca('0xa8')],{'as':_0xd8ca('0x19f'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xa8')][_0xd8ca('0xf9')](db['DeskField'],{'as':'Field','foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xa8')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xd8ca('0x1a6')});db['ZohoAccount']['hasMany'](db[_0xd8ca('0xac')],{'as':'Configurations','onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xac')][_0xd8ca('0xf9')](db[_0xd8ca('0xad')],{'as':_0xd8ca('0x1a3'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0xac')][_0xd8ca('0xf9')](db['ZohoField'],{'as':_0xd8ca('0x19d'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xac')]['hasMany'](db[_0xd8ca('0xad')],{'as':_0xd8ca('0x197'),'onDelete':'cascade','foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xac')][_0xd8ca('0x12a')](db[_0xd8ca('0xaa')],{'as':'Account','foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xad')][_0xd8ca('0xf9')](db[_0xd8ca('0xad')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd8ca('0xad')][_0xd8ca('0xf9')](db[_0xd8ca('0xad')],{'as':_0xd8ca('0x19f'),'foreignKey':_0xd8ca('0x1a0')});db['ZohoField'][_0xd8ca('0xf9')](db['ZohoField'],{'as':_0xd8ca('0x1a1'),'foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xad')][_0xd8ca('0x12a')](db[_0xd8ca('0x8d')],{'as':_0xd8ca('0x8d'),'foreignKey':_0xd8ca('0x1a6')});db[_0xd8ca('0x1a8')][_0xd8ca('0xf9')](db[_0xd8ca('0xae')],{'as':'Configurations','onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xae')][_0xd8ca('0xf9')](db[_0xd8ca('0x1a9')],{'as':'Subjects','foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0xae')][_0xd8ca('0xf9')](db[_0xd8ca('0x1a9')],{'as':_0xd8ca('0x19d'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xae')]['hasMany'](db[_0xd8ca('0x1a9')],{'as':_0xd8ca('0x197'),'foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xae')][_0xd8ca('0x12a')](db[_0xd8ca('0x1a8')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xae')][_0xd8ca('0x107')](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x1aa')});db['ZendeskField'][_0xd8ca('0xf9')](db[_0xd8ca('0x1a9')],{'as':_0xd8ca('0x1a4'),'foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0x1a9')][_0xd8ca('0xf9')](db['ZendeskField'],{'as':'Description','foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0x1a9')][_0xd8ca('0xf9')](db[_0xd8ca('0x1a9')],{'as':_0xd8ca('0x1a1'),'foreignKey':'FieldId'});db[_0xd8ca('0x1a9')][_0xd8ca('0x12a')](db['Variable'],{'as':_0xd8ca('0x8d'),'foreignKey':_0xd8ca('0x1a6')});db[_0xd8ca('0xb0')][_0xd8ca('0xf9')](db[_0xd8ca('0xb2')],{'as':_0xd8ca('0x1ab'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xb2')][_0xd8ca('0xf9')](db[_0xd8ca('0xb3')],{'as':_0xd8ca('0x1a3'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0xb2')][_0xd8ca('0xf9')](db['FreshdeskField'],{'as':_0xd8ca('0x19d'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xb2')][_0xd8ca('0xf9')](db[_0xd8ca('0xb3')],{'as':_0xd8ca('0x197'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xb2')][_0xd8ca('0x12a')](db[_0xd8ca('0xb0')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xb2')]['belongsToMany'](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x1ac')});db[_0xd8ca('0xb3')][_0xd8ca('0xf9')](db[_0xd8ca('0xb3')],{'as':_0xd8ca('0x1a4'),'foreignKey':_0xd8ca('0x1a5')});db['FreshdeskField'][_0xd8ca('0xf9')](db['FreshdeskField'],{'as':_0xd8ca('0x19f'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xb3')][_0xd8ca('0xf9')](db['FreshdeskField'],{'as':_0xd8ca('0x1a1'),'foreignKey':'FieldId'});db['FreshdeskField'][_0xd8ca('0x12a')](db[_0xd8ca('0x8d')],{'as':_0xd8ca('0x8d'),'foreignKey':_0xd8ca('0x1a6')});db['VtigerAccount'][_0xd8ca('0xf9')](db[_0xd8ca('0xb6')],{'as':_0xd8ca('0x1ab'),'onDelete':_0xd8ca('0xf5'),'foreignKey':'AccountId'});db[_0xd8ca('0xb6')][_0xd8ca('0xf9')](db[_0xd8ca('0xb8')],{'as':_0xd8ca('0x1a3'),'foreignKey':'SubjectId'});db[_0xd8ca('0xb6')][_0xd8ca('0xf9')](db[_0xd8ca('0xb8')],{'as':_0xd8ca('0x19d'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xd8ca('0xf9')](db[_0xd8ca('0xb8')],{'as':_0xd8ca('0x197'),'foreignKey':'FieldId'});db[_0xd8ca('0xb6')][_0xd8ca('0x12a')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xb6')]['belongsToMany'](db[_0xd8ca('0x150')],{'through':_0xd8ca('0x1ad')});db[_0xd8ca('0xb8')][_0xd8ca('0xf9')](db[_0xd8ca('0xb8')],{'as':_0xd8ca('0x1a4'),'foreignKey':_0xd8ca('0x1a5')});db['VtigerField'][_0xd8ca('0xf9')](db[_0xd8ca('0xb8')],{'as':'Description','foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xb8')]['hasMany'](db[_0xd8ca('0xb8')],{'as':_0xd8ca('0x1a1'),'foreignKey':_0xd8ca('0x19e')});db['VtigerField'][_0xd8ca('0x12a')](db[_0xd8ca('0x8d')],{'as':_0xd8ca('0x8d'),'foreignKey':_0xd8ca('0x1a6')});db[_0xd8ca('0xba')][_0xd8ca('0xf9')](db[_0xd8ca('0xbc')],{'as':_0xd8ca('0x1ab'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xbc')][_0xd8ca('0xf9')](db[_0xd8ca('0x1ae')],{'as':_0xd8ca('0x1a3'),'foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0xbc')][_0xd8ca('0xf9')](db[_0xd8ca('0x1ae')],{'as':_0xd8ca('0x19d'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xbc')][_0xd8ca('0xf9')](db[_0xd8ca('0x1ae')],{'as':'Fields','foreignKey':'FieldId'});db[_0xd8ca('0xbc')][_0xd8ca('0x12a')](db[_0xd8ca('0xba')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0x1ae')][_0xd8ca('0xf9')](db[_0xd8ca('0x1ae')],{'as':_0xd8ca('0x1a4'),'foreignKey':_0xd8ca('0x1a5')});db['ServicenowField'][_0xd8ca('0xf9')](db[_0xd8ca('0x1ae')],{'as':_0xd8ca('0x19f'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0x1ae')]['hasMany'](db[_0xd8ca('0x1ae')],{'as':'Field','foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0x1ae')][_0xd8ca('0x12a')](db[_0xd8ca('0x8d')],{'as':'Variable','foreignKey':_0xd8ca('0x1a6')});db[_0xd8ca('0xbf')][_0xd8ca('0xf9')](db[_0xd8ca('0xc1')],{'as':_0xd8ca('0x1ab'),'onDelete':'cascade','foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xc1')][_0xd8ca('0xf9')](db[_0xd8ca('0xc3')],{'as':_0xd8ca('0x1a3'),'onDelete':'cascade','foreignKey':_0xd8ca('0x1a5')});db[_0xd8ca('0xc1')][_0xd8ca('0xf9')](db[_0xd8ca('0xc3')],{'as':_0xd8ca('0x19d'),'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xc1')][_0xd8ca('0xf9')](db[_0xd8ca('0xc3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xd8ca('0x19e')});db['Dynamics365Configuration'][_0xd8ca('0x12a')](db[_0xd8ca('0xbf')],{'as':_0xd8ca('0x14e'),'foreignKey':_0xd8ca('0x19c')});db[_0xd8ca('0xc3')][_0xd8ca('0xf9')](db[_0xd8ca('0xc3')],{'as':_0xd8ca('0x1a4'),'foreignKey':_0xd8ca('0x1a5')});db['Dynamics365Field'][_0xd8ca('0xf9')](db[_0xd8ca('0xc3')],{'as':'Description','foreignKey':_0xd8ca('0x1a0')});db[_0xd8ca('0xc3')]['hasMany'](db[_0xd8ca('0xc3')],{'as':'Field','foreignKey':_0xd8ca('0x19e')});db[_0xd8ca('0xc3')]['belongsTo'](db['Variable'],{'as':_0xd8ca('0x8d'),'foreignKey':_0xd8ca('0x1a6')});db[_0xd8ca('0xc7')][_0xd8ca('0x12a')](db[_0xd8ca('0x61')],{});db['ChatQueueReport']['belongsTo'](db[_0xd8ca('0xeb')],{'as':'List','foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0xc7')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0xc7')][_0xd8ca('0x12a')](db[_0xd8ca('0x66')],{});db[_0xd8ca('0xc7')]['belongsTo'](db['ChatMessage'],{});db[_0xd8ca('0xc7')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{});db[_0xd8ca('0xc7')]['belongsTo'](db[_0xd8ca('0x69')],{});db['ChatInternalMessage'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1af')});db[_0xd8ca('0x17a')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'onDelete':_0xd8ca('0xf5'),'foreignKey':_0xd8ca('0x1b0')});db[_0xd8ca('0xcc')][_0xd8ca('0xf9')](db[_0xd8ca('0x1b1')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xd8ca('0xcc')][_0xd8ca('0xf9')](db['JscriptyAnswerReport'],{'foreignKey':_0xd8ca('0x1b2'),'onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db[_0xd8ca('0x4f')],{});db[_0xd8ca('0xce')]['belongsTo'](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x148'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0xce')][_0xd8ca('0x12a')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x13e'),'foreignKey':_0xd8ca('0x13f')});db[_0xd8ca('0xce')]['belongsTo'](db[_0xd8ca('0x101')],{});db[_0xd8ca('0xce')][_0xd8ca('0x12a')](db[_0xd8ca('0x54')],{});db[_0xd8ca('0xce')][_0xd8ca('0x12a')](db['User'],{});db[_0xd8ca('0xce')][_0xd8ca('0x12a')](db[_0xd8ca('0x56')],{});db[_0xd8ca('0x1b3')][_0xd8ca('0xf9')](db[_0xd8ca('0xcc')],{'foreignKey':_0xd8ca('0x1b4')});db[_0xd8ca('0x1b3')][_0xd8ca('0xf9')](db['JscriptyQuestionReport'],{'foreignKey':_0xd8ca('0x1b4')});db[_0xd8ca('0x1b3')][_0xd8ca('0xf9')](db[_0xd8ca('0xc9')],{'foreignKey':_0xd8ca('0x1b4')});db['SquareProject']['belongsToMany'](db['User'],{'as':_0xd8ca('0x154'),'through':_0xd8ca('0x121')});db[_0xd8ca('0xd9')][_0xd8ca('0x107')](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0xd8ca('0xd9')]['belongsToMany'](db[_0xd8ca('0x1d')],{'through':'team_has_voice_queues','as':'VoiceQueues'});db[_0xd8ca('0xd9')][_0xd8ca('0x107')](db[_0xd8ca('0x3b')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xd8ca('0xd9')][_0xd8ca('0x107')](db['ChatQueue'],{'through':_0xd8ca('0x179'),'as':_0xd8ca('0x1b5')});db[_0xd8ca('0xd9')][_0xd8ca('0x107')](db['FaxQueue'],{'through':_0xd8ca('0x161'),'as':_0xd8ca('0x113')});db[_0xd8ca('0xd9')][_0xd8ca('0x107')](db[_0xd8ca('0x56')],{'through':'team_has_sms_queues','as':_0xd8ca('0x115')});db[_0xd8ca('0xd9')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0xd8ca('0x170'),'as':_0xd8ca('0x1b6')});db[_0xd8ca('0xdd')]['hasMany'](db[_0xd8ca('0x71')],{'as':_0xd8ca('0x128'),'foreignKey':_0xd8ca('0x182')});db['Campaign'][_0xd8ca('0xf9')](db[_0xd8ca('0x75')],{'as':_0xd8ca('0xfd'),'foreignKey':'CampaignId'});db['Campaign'][_0xd8ca('0xf9')](db[_0xd8ca('0x77')],{'as':_0xd8ca('0x17c'),'foreignKey':_0xd8ca('0x182')});db['Campaign'][_0xd8ca('0xf9')](db[_0xd8ca('0x73')],{'as':_0xd8ca('0x1b7'),'foreignKey':_0xd8ca('0x182')});db['Campaign'][_0xd8ca('0x12a')](db['Trunk'],{'as':'Trunk','foreignKey':_0xd8ca('0x12b')});db['Campaign']['belongsTo'](db[_0xd8ca('0x2a')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xd8ca('0xdd')][_0xd8ca('0x12a')](db[_0xd8ca('0x82')],{'as':_0xd8ca('0x82'),'foreignKey':'IntervalId'});db[_0xd8ca('0xdd')][_0xd8ca('0x12a')](db[_0xd8ca('0xd5')],{'as':_0xd8ca('0xd5'),'foreignKey':_0xd8ca('0x1b8')});db[_0xd8ca('0xdd')][_0xd8ca('0x107')](db[_0xd8ca('0xeb')],{'as':_0xd8ca('0x10b'),'through':_0xd8ca('0x1b9')});db['Campaign']['belongsToMany'](db[_0xd8ca('0xeb')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xd8ca('0xe3')][_0xd8ca('0x12a')](db['MailMessage'],{});db['MailTransferReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x103')],{});db['MailTransferReport'][_0xd8ca('0x12a')](db['MailAccount'],{'foreignKey':_0xd8ca('0x1ba'),'as':_0xd8ca('0x1bb')});db['MailTransferReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'foreignKey':_0xd8ca('0x1bc'),'as':_0xd8ca('0x1bd')});db[_0xd8ca('0xe3')][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'foreignKey':_0xd8ca('0x1be'),'as':'ToAgent'});db[_0xd8ca('0xe3')]['belongsTo'](db[_0xd8ca('0x3b')],{'foreignKey':_0xd8ca('0x1bf'),'as':_0xd8ca('0x1c0')});db[_0xd8ca('0xe3')][_0xd8ca('0x12a')](db[_0xd8ca('0x39')],{'foreignKey':_0xd8ca('0x1c1'),'as':'ToAccount'});db[_0xd8ca('0xe5')][_0xd8ca('0x12a')](db['ChatMessage'],{});db[_0xd8ca('0xe5')]['belongsTo'](db[_0xd8ca('0x66')],{});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xd8ca('0x1c2'),'as':'FromAccount'});db[_0xd8ca('0xe5')][_0xd8ca('0x12a')](db['User'],{'foreignKey':_0xd8ca('0x1bc'),'as':_0xd8ca('0x1bd')});db['ChatTransferReport']['belongsTo'](db[_0xd8ca('0x15')],{'foreignKey':_0xd8ca('0x1be'),'as':_0xd8ca('0x1c3')});db[_0xd8ca('0xe5')]['belongsTo'](db[_0xd8ca('0x69')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0xd8ca('0xe5')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xd8ca('0x1c4'),'as':_0xd8ca('0x1c5')});db['FaxTransferReport'][_0xd8ca('0x12a')](db['FaxMessage'],{});db['FaxTransferReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x49')],{});db[_0xd8ca('0xe6')][_0xd8ca('0x12a')](db['FaxAccount'],{'foreignKey':_0xd8ca('0x1c6'),'as':_0xd8ca('0x1bb')});db[_0xd8ca('0xe6')]['belongsTo'](db[_0xd8ca('0x15')],{'foreignKey':_0xd8ca('0x1bc'),'as':_0xd8ca('0x1bd')});db[_0xd8ca('0xe6')]['belongsTo'](db[_0xd8ca('0x15')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xd8ca('0xe6')][_0xd8ca('0x12a')](db[_0xd8ca('0x4c')],{'foreignKey':_0xd8ca('0x1c7'),'as':'ToQueue'});db[_0xd8ca('0xe6')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xd8ca('0x1c8'),'as':_0xd8ca('0x1c5')});db[_0xd8ca('0xe8')][_0xd8ca('0x12a')](db[_0xd8ca('0x5e')],{});db[_0xd8ca('0xe8')][_0xd8ca('0x12a')](db[_0xd8ca('0x5c')],{});db[_0xd8ca('0xe8')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xd8ca('0x1c9'),'as':_0xd8ca('0x1bb')});db['OpenchannelTransferReport']['belongsTo'](db[_0xd8ca('0x15')],{'foreignKey':_0xd8ca('0x1bc'),'as':_0xd8ca('0x1bd')});db[_0xd8ca('0xe8')]['belongsTo'](db[_0xd8ca('0x15')],{'foreignKey':_0xd8ca('0x1be'),'as':_0xd8ca('0x1c3')});db['OpenchannelTransferReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x16f')],{'foreignKey':_0xd8ca('0x1ca'),'as':_0xd8ca('0x1c0')});db['OpenchannelTransferReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x58')],{'foreignKey':_0xd8ca('0x1cb'),'as':'ToAccount'});db[_0xd8ca('0xea')][_0xd8ca('0x12a')](db[_0xd8ca('0x54')],{});db[_0xd8ca('0xea')][_0xd8ca('0x12a')](db['SmsInteraction'],{});db[_0xd8ca('0xea')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xd8ca('0x1cc'),'as':'FromAccount'});db['SmsTransferReport'][_0xd8ca('0x12a')](db[_0xd8ca('0x15')],{'foreignKey':_0xd8ca('0x1bc'),'as':_0xd8ca('0x1bd')});db[_0xd8ca('0xea')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xd8ca('0xea')]['belongsTo'](db[_0xd8ca('0x56')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xd8ca('0xea')]['belongsTo'](db[_0xd8ca('0x4f')],{'foreignKey':_0xd8ca('0x1cd'),'as':_0xd8ca('0x1c5')});db['CmList'][_0xd8ca('0xf9')](db[_0xd8ca('0x144')],{'as':_0xd8ca('0x145'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0xeb')][_0xd8ca('0xf9')](db[_0xd8ca('0x1ce')],{'as':_0xd8ca('0x1cf'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0xeb')][_0xd8ca('0xf9')](db[_0xd8ca('0x70')],{'as':_0xd8ca('0x10a'),'onDelete':'cascade','foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0xeb')][_0xd8ca('0xf9')](db['CmHopperFinal'],{'as':_0xd8ca('0xfd'),'foreignKey':_0xd8ca('0x149')});db['CmList'][_0xd8ca('0xf9')](db['CmHopperHistory'],{'as':_0xd8ca('0xfe'),'foreignKey':_0xd8ca('0x149')});db[_0xd8ca('0xeb')][_0xd8ca('0xf9')](db[_0xd8ca('0x79')],{'as':_0xd8ca('0x79'),'foreignKey':'ListId'});db[_0xd8ca('0xeb')]['belongsToMany'](db[_0xd8ca('0x1d')],{'as':_0xd8ca('0x1d0'),'through':_0xd8ca('0x130')});db[_0xd8ca('0xeb')][_0xd8ca('0x107')](db[_0xd8ca('0x15')],{'as':'Agents','through':_0xd8ca('0x10c')});db[_0xd8ca('0xed')][_0xd8ca('0xf9')](db['VoiceExtension'],{'as':_0xd8ca('0xfc'),'onDelete':'restrict'});db[_0xd8ca('0xed')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_voice_prefixes'});db['UserProfile'][_0xd8ca('0xf9')](db['User'],{'as':_0xd8ca('0x154'),'foreignKey':_0xd8ca('0x106')});db[_0xd8ca('0x105')][_0xd8ca('0xf9')](db['UserProfileSection'],{'as':_0xd8ca('0x1d1'),'foreignKey':_0xd8ca('0x106'),'onDelete':_0xd8ca('0xf5')});db[_0xd8ca('0xf0')][_0xd8ca('0xf9')](db['UserProfileResource'],{'as':_0xd8ca('0x1d2'),'foreignKey':_0xd8ca('0x1d3'),'onDelete':_0xd8ca('0xf5')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index ca30fcc..d49fbda 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc368=['./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./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/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/apidoc','join','root','static','/www','/demo','/snippet','1.0.14','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','util','./errors','./config/environment','./config/logger','api','auth','default','use','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','remoteAddress','url','responseTime','user','name','role','logger','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','statusCode','other','agent_name','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports'];(function(_0x3702ce,_0x1cd8b1){var _0x1990f5=function(_0x418c4e){while(--_0x418c4e){_0x3702ce['push'](_0x3702ce['shift']());}};_0x1990f5(++_0x1cd8b1);}(_0xc368,0x7b));var _0x8c36=function(_0x2abb66,_0x2f0761){_0x2abb66=_0x2abb66-0x0;var _0x424a01=_0xc368[_0x2abb66];return _0x424a01;};'use strict';var path=require('path');var express=require(_0x8c36('0x0'));var ewinston=require('express-winston');var util=require(_0x8c36('0x1'));var errors=require(_0x8c36('0x2'));var config=require(_0x8c36('0x3'));var logger=require(_0x8c36('0x4'))(_0x8c36('0x5'));var authLogger=require('./config/logger')(_0x8c36('0x6'));exports[_0x8c36('0x7')]=function(_0x912acb){_0x912acb[_0x8c36('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x554022,_0x8ed437){return util[_0x8c36('0x9')](_0x8c36('0xa'),_0x554022[_0x8c36('0xb')],_0x554022[_0x8c36('0xc')][_0x8c36('0xd')]?_0x554022['headers']['x-forwarded-for']:_0x554022['connection'][_0x8c36('0xe')]||_0x554022['ip'],_0x554022[_0x8c36('0xf')],_0x8ed437['statusCode'],_0x8ed437[_0x8c36('0x10')],_0x554022[_0x8c36('0x11')]?_0x554022[_0x8c36('0x11')]['id']:null,_0x554022[_0x8c36('0x11')]?_0x554022[_0x8c36('0x11')][_0x8c36('0x12')]:null,_0x554022[_0x8c36('0x11')]?_0x554022[_0x8c36('0x11')][_0x8c36('0x13')]:null);}}));_0x912acb[_0x8c36('0x8')](ewinston[_0x8c36('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x25a83e,_0x3c824b){var _0x220f18='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x25a83e[_0x8c36('0x15')]&&_0x25a83e['body'][_0x8c36('0x16')]&&_0x25a83e[_0x8c36('0x15')][_0x8c36('0x17')]){_0x220f18=_0x8c36('0x18');}return util[_0x8c36('0x9')](_0x220f18,_0x25a83e[_0x8c36('0xb')],_0x25a83e[_0x8c36('0xc')][_0x8c36('0xd')]?_0x25a83e[_0x8c36('0xc')]['x-forwarded-for']:_0x25a83e[_0x8c36('0x19')][_0x8c36('0xe')]||_0x25a83e['ip'],_0x25a83e[_0x8c36('0xf')],_0x3c824b[_0x8c36('0x1a')],_0x3c824b[_0x8c36('0x10')],_0x25a83e['user']?_0x25a83e[_0x8c36('0x11')]['id']:null,_0x25a83e[_0x8c36('0x11')]?_0x25a83e[_0x8c36('0x11')][_0x8c36('0x12')]:null,_0x25a83e[_0x8c36('0x11')]?_0x25a83e[_0x8c36('0x11')][_0x8c36('0x13')]:null,_0x25a83e[_0x8c36('0x15')]&&_0x25a83e[_0x8c36('0x15')][_0x8c36('0x16')]?_0x25a83e[_0x8c36('0x15')][_0x8c36('0x16')]:_0x8c36('0x1b'),_0x25a83e['body']&&_0x25a83e['body']['agent_id']?_0x25a83e['body'][_0x8c36('0x17')]:'',_0x25a83e[_0x8c36('0x15')]&&_0x25a83e[_0x8c36('0x15')][_0x8c36('0x1c')]?_0x25a83e[_0x8c36('0x15')][_0x8c36('0x1c')]:'');},'ignoreRoute':function(_0x4bf4c2){var _0x1d39ca=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1d39ca['test'](_0x4bf4c2[_0x8c36('0xf')]);}}));_0x912acb['use'](_0x8c36('0x1d'),require(_0x8c36('0x1e')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x1f'),require('./api/voiceChanSpy'));_0x912acb['use'](_0x8c36('0x20'),require(_0x8c36('0x21')));_0x912acb['use']('/api/voice/extensions',require(_0x8c36('0x22')));_0x912acb[_0x8c36('0x8')]('/api/voice/mohs',require(_0x8c36('0x23')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x24'),require('./api/voiceQueue'));_0x912acb['use'](_0x8c36('0x25'),require(_0x8c36('0x26')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x27'),require(_0x8c36('0x28')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x29'),require(_0x8c36('0x2a')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x2b'),require(_0x8c36('0x2c')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x2d'),require(_0x8c36('0x2e')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x2f'),require(_0x8c36('0x30')));_0x912acb['use']('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x31'),require(_0x8c36('0x32')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x33'),require(_0x8c36('0x34')));_0x912acb[_0x8c36('0x8')]('/api/trunks',require(_0x8c36('0x35')));_0x912acb['use'](_0x8c36('0x36'),require('./api/voiceTransferReport'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x37'),require(_0x8c36('0x38')));_0x912acb['use'](_0x8c36('0x39'),require(_0x8c36('0x3a')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x3b'),require(_0x8c36('0x3c')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x3d'),require(_0x8c36('0x3e')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x3f'),require(_0x8c36('0x40')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x41'),require(_0x8c36('0x42')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x43'),require(_0x8c36('0x44')));_0x912acb['use'](_0x8c36('0x45'),require('./api/mailQueueReport'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x46'),require(_0x8c36('0x47')));_0x912acb[_0x8c36('0x8')]('/api/dashboards/items',require('./api/dashboardItem'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x48'),require(_0x8c36('0x49')));_0x912acb['use']('/api/fax/applications',require(_0x8c36('0x4a')));_0x912acb['use']('/api/fax/interactions',require(_0x8c36('0x4b')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x4c'),require(_0x8c36('0x4d')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x4e'),require(_0x8c36('0x4f')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x50'),require(_0x8c36('0x51')));_0x912acb['use'](_0x8c36('0x52'),require(_0x8c36('0x53')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x54'),require(_0x8c36('0x55')));_0x912acb['use'](_0x8c36('0x56'),require(_0x8c36('0x57')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x58'),require(_0x8c36('0x59')));_0x912acb[_0x8c36('0x8')]('/api/sms/queues',require(_0x8c36('0x5a')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x5b'),require(_0x8c36('0x5c')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x5d'),require(_0x8c36('0x5e')));_0x912acb['use'](_0x8c36('0x5f'),require(_0x8c36('0x60')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x61'),require(_0x8c36('0x62')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x63'),require(_0x8c36('0x64')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x65'),require(_0x8c36('0x66')));_0x912acb[_0x8c36('0x8')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x67'),require(_0x8c36('0x68')));_0x912acb[_0x8c36('0x8')]('/api/chat/interactions',require(_0x8c36('0x69')));_0x912acb[_0x8c36('0x8')]('/api/chat/messages',require('./api/chatMessage'));_0x912acb['use'](_0x8c36('0x6a'),require(_0x8c36('0x6b')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x6c'),require(_0x8c36('0x6d')));_0x912acb[_0x8c36('0x8')]('/api/chat/groups',require(_0x8c36('0x6e')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x6f'),require(_0x8c36('0x70')));_0x912acb['use']('/api/cm/companies',require('./api/cmCompany'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x71'),require(_0x8c36('0x72')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x73'),require(_0x8c36('0x74')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x75'),require(_0x8c36('0x76')));_0x912acb['use']('/api/cm/hopper_final',require(_0x8c36('0x77')));_0x912acb['use']('/api/cm/hopper_history',require(_0x8c36('0x78')));_0x912acb['use'](_0x8c36('0x79'),require(_0x8c36('0x7a')));_0x912acb['use'](_0x8c36('0x7b'),require('./api/action'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x7c'),require(_0x8c36('0x7d')));_0x912acb['use'](_0x8c36('0x7e'),require(_0x8c36('0x7f')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x80'),require(_0x8c36('0x81')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x82'),require(_0x8c36('0x83')));_0x912acb[_0x8c36('0x8')]('/api/intervals',require('./api/interval'));_0x912acb['use'](_0x8c36('0x84'),require('./api/pause'));_0x912acb['use'](_0x8c36('0x85'),require(_0x8c36('0x86')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x87'),require(_0x8c36('0x88')));_0x912acb['use']('/api/schedules',require('./api/schedule'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x89'),require('./api/sound'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x8a'),require(_0x8c36('0x8b')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x8c'),require(_0x8c36('0x8d')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x8e'),require(_0x8c36('0x8f')));_0x912acb['use']('/api/variables',require('./api/variable'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x90'),require(_0x8c36('0x91')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x92'),require(_0x8c36('0x93')));_0x912acb['use'](_0x8c36('0x94'),require('./api/analyticCustomReport'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x95'),require(_0x8c36('0x96')));_0x912acb['use'](_0x8c36('0x97'),require('./api/analyticExtractedReport'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x98'),require(_0x8c36('0x99')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x9a'),require('./api/analyticFieldReport'));_0x912acb[_0x8c36('0x8')]('/api/analytics/tree_reports',require(_0x8c36('0x9b')));_0x912acb[_0x8c36('0x8')]('/api/integrations/salesforce/accounts',require(_0x8c36('0x9c')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x9d'),require('./api/intSalesforceConfiguration'));_0x912acb[_0x8c36('0x8')](_0x8c36('0x9e'),require(_0x8c36('0x9f')));_0x912acb[_0x8c36('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x8c36('0xa0')));_0x912acb[_0x8c36('0x8')]('/api/integrations/sugarcrm/configurations',require(_0x8c36('0xa1')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xa2'),require('./api/intSugarcrmField'));_0x912acb[_0x8c36('0x8')](_0x8c36('0xa3'),require('./api/intDeskAccount'));_0x912acb[_0x8c36('0x8')](_0x8c36('0xa4'),require(_0x8c36('0xa5')));_0x912acb[_0x8c36('0x8')]('/api/integrations/desk/fields',require(_0x8c36('0xa6')));_0x912acb['use'](_0x8c36('0xa7'),require(_0x8c36('0xa8')));_0x912acb['use'](_0x8c36('0xa9'),require(_0x8c36('0xaa')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xab'),require(_0x8c36('0xac')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xad'),require(_0x8c36('0xae')));_0x912acb['use'](_0x8c36('0xaf'),require(_0x8c36('0xb0')));_0x912acb[_0x8c36('0x8')]('/api/integrations/zendesk/fields',require(_0x8c36('0xb1')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xb2'),require(_0x8c36('0xb3')));_0x912acb[_0x8c36('0x8')]('/api/integrations/freshdesk/configurations',require(_0x8c36('0xb4')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xb5'),require('./api/intFreshdeskField'));_0x912acb[_0x8c36('0x8')](_0x8c36('0xb6'),require(_0x8c36('0xb7')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xb8'),require('./api/intVtigerConfiguration'));_0x912acb[_0x8c36('0x8')](_0x8c36('0xb9'),require(_0x8c36('0xba')));_0x912acb['use'](_0x8c36('0xbb'),require(_0x8c36('0xbc')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xbd'),require(_0x8c36('0xbe')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xbf'),require('./api/intServicenowField'));_0x912acb['use']('/api/integrations/dynamics365/accounts',require(_0x8c36('0xc0')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xc1'),require(_0x8c36('0xc2')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xc3'),require(_0x8c36('0xc4')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xc5'),require(_0x8c36('0xc6')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xc7'),require(_0x8c36('0xc8')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xc9'),require(_0x8c36('0xca')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xcb'),require('./api/jscriptyAnswerReport'));_0x912acb[_0x8c36('0x8')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x912acb[_0x8c36('0x8')]('/api/jscripty/sessions/reports',require(_0x8c36('0xcc')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xcd'),require(_0x8c36('0xce')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xcf'),require(_0x8c36('0xd0')));_0x912acb['use']('/api/square/details/reports',require(_0x8c36('0xd1')));_0x912acb[_0x8c36('0x8')]('/api/jscripty/projects',require(_0x8c36('0xd2')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xd3'),require(_0x8c36('0xd4')));_0x912acb['use'](_0x8c36('0xd5'),require(_0x8c36('0xd6')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xd7'),require(_0x8c36('0xd8')));_0x912acb[_0x8c36('0x8')]('/api/square/recordings',require(_0x8c36('0xd9')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xda'),require(_0x8c36('0xdb')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xdc'),require(_0x8c36('0xdd')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xde'),require(_0x8c36('0xdf')));_0x912acb['use']('/api/campaigns',require(_0x8c36('0xe0')));_0x912acb['use']('/api/migrations',require(_0x8c36('0xe1')));_0x912acb[_0x8c36('0x8')]('/api/attachments',require(_0x8c36('0xe2')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xe3'),require(_0x8c36('0xe4')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xe5'),require('./api/mailTransferReport'));_0x912acb['use'](_0x8c36('0xe6'),require(_0x8c36('0xe7')));_0x912acb['use'](_0x8c36('0xe8'),require(_0x8c36('0xe9')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xea'),require(_0x8c36('0xeb')));_0x912acb[_0x8c36('0x8')]('/api/sms/reports/transfer',require(_0x8c36('0xec')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xed'),require(_0x8c36('0xee')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xef'),require('./api/voicePrefix'));_0x912acb['use'](_0x8c36('0xf0'),require(_0x8c36('0xf1')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xf2'),require(_0x8c36('0xf3')));_0x912acb['use']('/api/userProfile/resources',require(_0x8c36('0xf4')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xf5'),require('./api/authLocal'));_0x912acb[_0x8c36('0x8')](_0x8c36('0xf6'),require(_0x8c36('0xf7')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xf8'),require(_0x8c36('0xf9')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xfa'),require(_0x8c36('0xfb')));_0x912acb[_0x8c36('0x8')](_0x8c36('0xfc'),require(_0x8c36('0xfd')));_0x912acb['use'](_0x8c36('0xfe'),require(_0x8c36('0xff')));_0x912acb['use']('/api/pm2',require(_0x8c36('0x100')));_0x912acb[_0x8c36('0x8')](_0x8c36('0x101'),express['static'](path[_0x8c36('0x102')](config[_0x8c36('0x103')],_0x8c36('0x101'))));_0x912acb[_0x8c36('0x8')]('/www',express[_0x8c36('0x104')](path[_0x8c36('0x102')](config['root'],_0x8c36('0x105'))));_0x912acb[_0x8c36('0x8')]('/demo',express[_0x8c36('0x104')](path[_0x8c36('0x102')](config[_0x8c36('0x103')],_0x8c36('0x106'))));_0x912acb[_0x8c36('0x8')](_0x8c36('0x107'),express[_0x8c36('0x104')](path['join'](config['root'],'snippet',_0x8c36('0x108'))));_0x912acb[_0x8c36('0x8')](_0x8c36('0x109'),express[_0x8c36('0x104')](path[_0x8c36('0x102')](config[_0x8c36('0x103')],'/server/files/plugins')));_0x912acb[_0x8c36('0x10a')](_0x8c36('0x10b'))[_0x8c36('0x10c')](errors[0x194]);_0x912acb[_0x8c36('0x10a')]('/*')['get'](function(_0x5551db,_0x1d49bf){_0x1d49bf[_0x8c36('0x10d')](path[_0x8c36('0x10e')](_0x912acb['get'](_0x8c36('0x10f'))+_0x8c36('0x110')));});}; \ No newline at end of file +var _0x6ddd=['./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','./api/plugin','./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/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','static','join','root','/apidoc','/www','/demo','snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','appPath','express-winston','util','./errors','./config/environment','api','auth','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','name','other','agent_name','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxQueue','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x6ddd,0xae));var _0xd6dd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6ddd[_0x432682];return _0x463d05;};'use strict';var path=require('path');var express=require('express');var ewinston=require(_0xd6dd('0x0'));var util=require(_0xd6dd('0x1'));var errors=require(_0xd6dd('0x2'));var config=require(_0xd6dd('0x3'));var logger=require('./config/logger')(_0xd6dd('0x4'));var authLogger=require('./config/logger')(_0xd6dd('0x5'));exports['default']=function(_0x43c57e){_0x43c57e[_0xd6dd('0x6')](ewinston[_0xd6dd('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x49d412,_0x402dee){return util[_0xd6dd('0x8')](_0xd6dd('0x9'),_0x49d412[_0xd6dd('0xa')],_0x49d412['headers'][_0xd6dd('0xb')]?_0x49d412[_0xd6dd('0xc')][_0xd6dd('0xb')]:_0x49d412[_0xd6dd('0xd')][_0xd6dd('0xe')]||_0x49d412['ip'],_0x49d412[_0xd6dd('0xf')],_0x402dee[_0xd6dd('0x10')],_0x402dee[_0xd6dd('0x11')],_0x49d412[_0xd6dd('0x12')]?_0x49d412[_0xd6dd('0x12')]['id']:null,_0x49d412[_0xd6dd('0x12')]?_0x49d412[_0xd6dd('0x12')]['name']:null,_0x49d412[_0xd6dd('0x12')]?_0x49d412[_0xd6dd('0x12')][_0xd6dd('0x13')]:null);}}));_0x43c57e[_0xd6dd('0x6')](ewinston[_0xd6dd('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x11f224,_0x302760){var _0x550953=_0xd6dd('0x14');if(_0x11f224[_0xd6dd('0x15')]&&_0x11f224[_0xd6dd('0x15')][_0xd6dd('0x16')]&&_0x11f224[_0xd6dd('0x15')][_0xd6dd('0x17')]){_0x550953=_0xd6dd('0x18');}return util[_0xd6dd('0x8')](_0x550953,_0x11f224[_0xd6dd('0xa')],_0x11f224[_0xd6dd('0xc')][_0xd6dd('0xb')]?_0x11f224[_0xd6dd('0xc')]['x-forwarded-for']:_0x11f224[_0xd6dd('0xd')][_0xd6dd('0xe')]||_0x11f224['ip'],_0x11f224[_0xd6dd('0xf')],_0x302760[_0xd6dd('0x10')],_0x302760['responseTime'],_0x11f224['user']?_0x11f224[_0xd6dd('0x12')]['id']:null,_0x11f224[_0xd6dd('0x12')]?_0x11f224['user'][_0xd6dd('0x19')]:null,_0x11f224[_0xd6dd('0x12')]?_0x11f224['user'][_0xd6dd('0x13')]:null,_0x11f224[_0xd6dd('0x15')]&&_0x11f224[_0xd6dd('0x15')]['device']?_0x11f224[_0xd6dd('0x15')][_0xd6dd('0x16')]:_0xd6dd('0x1a'),_0x11f224['body']&&_0x11f224[_0xd6dd('0x15')][_0xd6dd('0x17')]?_0x11f224[_0xd6dd('0x15')][_0xd6dd('0x17')]:'',_0x11f224[_0xd6dd('0x15')]&&_0x11f224[_0xd6dd('0x15')][_0xd6dd('0x1b')]?_0x11f224['body']['agent_name']:'');},'ignoreRoute':function(_0x284a95){var _0x48c31a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x48c31a['test'](_0x284a95['url']);}}));_0x43c57e[_0xd6dd('0x6')]('/api/users',require('./api/user'));_0x43c57e['use'](_0xd6dd('0x1c'),require(_0xd6dd('0x1d')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x1e'),require(_0xd6dd('0x1f')));_0x43c57e[_0xd6dd('0x6')]('/api/voice/extensions',require(_0xd6dd('0x20')));_0x43c57e['use'](_0xd6dd('0x21'),require(_0xd6dd('0x22')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x23'),require(_0xd6dd('0x24')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x25'),require(_0xd6dd('0x26')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x27'),require('./api/screenRecording'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x28'),require(_0xd6dd('0x29')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x2a'),require('./api/voiceMailMessage'));_0x43c57e['use'](_0xd6dd('0x2b'),require(_0xd6dd('0x2c')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x2d'),require(_0xd6dd('0x2e')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x2f'),require(_0xd6dd('0x30')));_0x43c57e['use'](_0xd6dd('0x31'),require(_0xd6dd('0x32')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x33'),require(_0xd6dd('0x34')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x35'),require('./api/trunk'));_0x43c57e[_0xd6dd('0x6')]('/api/voice/transfers/reports',require(_0xd6dd('0x36')));_0x43c57e['use'](_0xd6dd('0x37'),require(_0xd6dd('0x38')));_0x43c57e['use'](_0xd6dd('0x39'),require(_0xd6dd('0x3a')));_0x43c57e['use']('/api/mail/queues',require(_0xd6dd('0x3b')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x3c'),require(_0xd6dd('0x3d')));_0x43c57e[_0xd6dd('0x6')]('/api/mail/interactions',require('./api/mailInteraction'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x3e'),require(_0xd6dd('0x3f')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x40'),require(_0xd6dd('0x41')));_0x43c57e['use'](_0xd6dd('0x42'),require('./api/mailQueueReport'));_0x43c57e['use'](_0xd6dd('0x43'),require(_0xd6dd('0x44')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x45'),require(_0xd6dd('0x46')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x47'),require(_0xd6dd('0x48')));_0x43c57e['use'](_0xd6dd('0x49'),require(_0xd6dd('0x4a')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x4b'),require('./api/faxInteraction'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x4c'),require('./api/faxMessage'));_0x43c57e[_0xd6dd('0x6')]('/api/fax/queues',require(_0xd6dd('0x4d')));_0x43c57e[_0xd6dd('0x6')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x43c57e[_0xd6dd('0x6')]('/api/sms/accounts',require(_0xd6dd('0x4e')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x4f'),require('./api/smsApplication'));_0x43c57e['use'](_0xd6dd('0x50'),require(_0xd6dd('0x51')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x52'),require(_0xd6dd('0x53')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x54'),require('./api/smsQueue'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x55'),require(_0xd6dd('0x56')));_0x43c57e['use'](_0xd6dd('0x57'),require(_0xd6dd('0x58')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x59'),require(_0xd6dd('0x5a')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x5b'),require(_0xd6dd('0x5c')));_0x43c57e['use'](_0xd6dd('0x5d'),require(_0xd6dd('0x5e')));_0x43c57e[_0xd6dd('0x6')]('/api/chat/websites',require(_0xd6dd('0x5f')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x60'),require('./api/openchannelQueueReport'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x61'),require(_0xd6dd('0x62')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x63'),require(_0xd6dd('0x64')));_0x43c57e['use'](_0xd6dd('0x65'),require(_0xd6dd('0x66')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x67'),require(_0xd6dd('0x68')));_0x43c57e['use'](_0xd6dd('0x69'),require(_0xd6dd('0x6a')));_0x43c57e['use'](_0xd6dd('0x6b'),require(_0xd6dd('0x6c')));_0x43c57e[_0xd6dd('0x6')]('/api/chat/proactive_actions',require(_0xd6dd('0x6d')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x6e'),require(_0xd6dd('0x6f')));_0x43c57e[_0xd6dd('0x6')]('/api/cm/contacts',require(_0xd6dd('0x70')));_0x43c57e['use']('/api/cm/hopper',require(_0xd6dd('0x71')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x72'),require(_0xd6dd('0x73')));_0x43c57e[_0xd6dd('0x6')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x74'),require('./api/cmHopperHistory'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x75'),require(_0xd6dd('0x76')));_0x43c57e[_0xd6dd('0x6')]('/api/actions',require(_0xd6dd('0x77')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x78'),require(_0xd6dd('0x79')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x7a'),require(_0xd6dd('0x7b')));_0x43c57e[_0xd6dd('0x6')]('/api/dispositions',require(_0xd6dd('0x7c')));_0x43c57e[_0xd6dd('0x6')]('/api/conditions',require(_0xd6dd('0x7d')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x7e'),require('./api/interval'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x7f'),require('./api/pause'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x80'),require(_0xd6dd('0x81')));_0x43c57e['use'](_0xd6dd('0x82'),require(_0xd6dd('0x83')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x84'),require(_0xd6dd('0x85')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x86'),require(_0xd6dd('0x87')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x88'),require('./api/tag'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x89'),require(_0xd6dd('0x8a')));_0x43c57e[_0xd6dd('0x6')]('/api/triggers',require('./api/trigger'));_0x43c57e[_0xd6dd('0x6')]('/api/variables',require(_0xd6dd('0x8b')));_0x43c57e['use']('/api/integrations',require(_0xd6dd('0x8c')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x8d'),require(_0xd6dd('0x8e')));_0x43c57e['use']('/api/analytics/custom_reports',require(_0xd6dd('0x8f')));_0x43c57e['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x43c57e['use'](_0xd6dd('0x90'),require(_0xd6dd('0x91')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x92'),require(_0xd6dd('0x93')));_0x43c57e[_0xd6dd('0x6')]('/api/analytics/field_reports',require(_0xd6dd('0x94')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x95'),require(_0xd6dd('0x96')));_0x43c57e['use'](_0xd6dd('0x97'),require(_0xd6dd('0x98')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x99'),require(_0xd6dd('0x9a')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x9b'),require(_0xd6dd('0x9c')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x9d'),require('./api/intSugarcrmAccount'));_0x43c57e['use']('/api/integrations/sugarcrm/configurations',require(_0xd6dd('0x9e')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/sugarcrm/fields',require(_0xd6dd('0x9f')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/desk/accounts',require(_0xd6dd('0xa0')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xa1'),require(_0xd6dd('0xa2')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/desk/fields',require(_0xd6dd('0xa3')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xa4'),require(_0xd6dd('0xa5')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/zoho/configurations',require(_0xd6dd('0xa6')));_0x43c57e['use'](_0xd6dd('0xa7'),require(_0xd6dd('0xa8')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xa9'),require(_0xd6dd('0xaa')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xab'),require(_0xd6dd('0xac')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xad'),require(_0xd6dd('0xae')));_0x43c57e['use']('/api/integrations/freshdesk/accounts',require(_0xd6dd('0xaf')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/freshdesk/configurations',require(_0xd6dd('0xb0')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/freshdesk/fields',require(_0xd6dd('0xb1')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xb2'),require(_0xd6dd('0xb3')));_0x43c57e['use'](_0xd6dd('0xb4'),require(_0xd6dd('0xb5')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xb6'),require(_0xd6dd('0xb7')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xb8'),require('./api/intServicenowAccount'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xb9'),require(_0xd6dd('0xba')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/servicenow/fields',require(_0xd6dd('0xbb')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xbc'),require(_0xd6dd('0xbd')));_0x43c57e['use'](_0xd6dd('0xbe'),require(_0xd6dd('0xbf')));_0x43c57e[_0xd6dd('0x6')]('/api/integrations/dynamics365/fields',require(_0xd6dd('0xc0')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xc1'),require(_0xd6dd('0xc2')));_0x43c57e['use'](_0xd6dd('0xc3'),require(_0xd6dd('0xc4')));_0x43c57e['use'](_0xd6dd('0xc5'),require(_0xd6dd('0xc6')));_0x43c57e['use'](_0xd6dd('0xc7'),require(_0xd6dd('0xc8')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xc9'),require(_0xd6dd('0xca')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xcb'),require('./api/jscriptySessionReport'));_0x43c57e['use'](_0xd6dd('0xcc'),require(_0xd6dd('0xcd')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xce'),require(_0xd6dd('0xcf')));_0x43c57e['use'](_0xd6dd('0xd0'),require(_0xd6dd('0xd1')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xd2'),require(_0xd6dd('0xd3')));_0x43c57e['use'](_0xd6dd('0xd4'),require(_0xd6dd('0xd5')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xd6'),require('./api/squareOdbc'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xd7'),require(_0xd6dd('0xd8')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xd9'),require(_0xd6dd('0xda')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xdb'),require(_0xd6dd('0xdc')));_0x43c57e[_0xd6dd('0x6')]('/api/teams',require(_0xd6dd('0xdd')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xde'),require(_0xd6dd('0xdf')));_0x43c57e[_0xd6dd('0x6')]('/api/campaigns',require(_0xd6dd('0xe0')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xe1'),require(_0xd6dd('0xe2')));_0x43c57e[_0xd6dd('0x6')]('/api/attachments',require('./api/attachment'));_0x43c57e['use']('/api/plugins',require(_0xd6dd('0xe3')));_0x43c57e[_0xd6dd('0x6')]('/api/mail/reports/transfer',require(_0xd6dd('0xe4')));_0x43c57e['use'](_0xd6dd('0xe5'),require(_0xd6dd('0xe6')));_0x43c57e['use'](_0xd6dd('0xe7'),require(_0xd6dd('0xe8')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xe9'),require(_0xd6dd('0xea')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xeb'),require(_0xd6dd('0xec')));_0x43c57e[_0xd6dd('0x6')]('/api/cm/lists',require(_0xd6dd('0xed')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xee'),require(_0xd6dd('0xef')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xf0'),require('./api/userProfile'));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xf1'),require(_0xd6dd('0xf2')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xf3'),require(_0xd6dd('0xf4')));_0x43c57e['use']('/api/auth/local',require(_0xd6dd('0xf5')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xf6'),require(_0xd6dd('0xf7')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xf8'),require(_0xd6dd('0xf9')));_0x43c57e['use'](_0xd6dd('0xfa'),require(_0xd6dd('0xfb')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0xfc'),require('./api/version'));_0x43c57e[_0xd6dd('0x6')]('/api/system',require(_0xd6dd('0xfd')));_0x43c57e['use'](_0xd6dd('0xfe'),require('./api/pm2'));_0x43c57e['use']('/apidoc',express[_0xd6dd('0xff')](path[_0xd6dd('0x100')](config[_0xd6dd('0x101')],_0xd6dd('0x102'))));_0x43c57e[_0xd6dd('0x6')]('/www',express[_0xd6dd('0xff')](path[_0xd6dd('0x100')](config[_0xd6dd('0x101')],_0xd6dd('0x103'))));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x104'),express[_0xd6dd('0xff')](path['join'](config['root'],_0xd6dd('0x104'))));_0x43c57e[_0xd6dd('0x6')]('/snippet',express[_0xd6dd('0xff')](path[_0xd6dd('0x100')](config[_0xd6dd('0x101')],_0xd6dd('0x105'),'1.0.14')));_0x43c57e[_0xd6dd('0x6')](_0xd6dd('0x106'),express[_0xd6dd('0xff')](path[_0xd6dd('0x100')](config[_0xd6dd('0x101')],_0xd6dd('0x107'))));_0x43c57e['route'](_0xd6dd('0x108'))[_0xd6dd('0x109')](errors[0x194]);_0x43c57e[_0xd6dd('0x10a')]('/*')[_0xd6dd('0x109')](function(_0x2a539f,_0x175a04){_0x175a04[_0xd6dd('0x10b')](path['resolve'](_0x43c57e[_0xd6dd('0x109')](_0xd6dd('0x10c'))+'/index.html'));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0a38e73..f3b80b4 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb647=['rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc'];(function(_0x9ba4e0,_0x3e1c20){var _0x5a8382=function(_0x3542b7){while(--_0x3542b7){_0x9ba4e0['push'](_0x9ba4e0['shift']());}};_0x5a8382(++_0x3e1c20);}(_0xb647,0xdb));var _0x7b64=function(_0x1669cb,_0x453670){_0x1669cb=_0x1669cb-0x0;var _0x4f74f9=_0xb647[_0x1669cb];return _0x4f74f9;};'use strict';var jayson=require(_0x7b64('0x0'));var BPromise=require(_0x7b64('0x1'));var _=require(_0x7b64('0x2'));var config=require(_0x7b64('0x3'));exports[_0x7b64('0x4')]=function(){return new BPromise(function(_0x3b659e,_0x274824){var _0x2b0ff5={};_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x5')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x6')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x8')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x9')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0xa')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0xb')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0xc')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0xd')));_0x2b0ff5=_['merge'](_0x2b0ff5,require('../api/memberReport/memberReport.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0xe')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0xf')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x10')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x11')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x12')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x13')));_0x2b0ff5=_['merge'](_0x2b0ff5,require('../api/mailInteraction/mailInteraction.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x14')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x15')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x16')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/faxAccount/faxAccount.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x17')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x18')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/faxMessage/faxMessage.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x19')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x1a')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/smsAccount/smsAccount.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x1b')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x1c')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x1d')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x1e')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x1f')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x20')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x21')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x22')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x23')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x24')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x25')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x26')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x27')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x28')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x29')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x2a')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/template/template.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x2b')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x2c')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x2d')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x2e')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x2f')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x30')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x31')));_0x2b0ff5=_['merge'](_0x2b0ff5,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x32')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x33')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x34')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x35')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x36')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x37')));_0x2b0ff5=_['merge'](_0x2b0ff5,require(_0x7b64('0x38')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x39')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require('../api/squareMessage/squareMessage.rpc'));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x3a')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x3b')));_0x2b0ff5=_[_0x7b64('0x7')](_0x2b0ff5,require(_0x7b64('0x3c')));var _0x1c0be6=jayson['server'](_0x2b0ff5)['http']();var _0xe9eac=config[_0x7b64('0x3d')][_0x7b64('0x3e')]||config[_0x7b64('0x3e')]+0x1;var _0xe3f7d1=config[_0x7b64('0x3d')]['ip']||_0x7b64('0x3f');_0x1c0be6['on'](_0x7b64('0x40'),function(_0x126536){return _0x274824(_0x126536);});_0x1c0be6['listen'](_0xe9eac,_0xe3f7d1,function(){console[_0x7b64('0x41')](_0x7b64('0x42'),_0xe3f7d1,_0xe9eac);require(_0x7b64('0x43'))[_0x7b64('0x44')]();return _0x3b659e(_0x7b64('0x45')+_0xe3f7d1+':'+_0xe9eac);});});}; \ No newline at end of file +var _0x6dd1=['../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.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/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.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/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'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6dd1,0x111));var _0x16dd=function(_0x45581f,_0x4bc3ce){_0x45581f=_0x45581f-0x0;var _0x51f58f=_0x6dd1[_0x45581f];return _0x51f58f;};'use strict';var jayson=require(_0x16dd('0x0'));var BPromise=require('bluebird');var _=require(_0x16dd('0x1'));var config=require(_0x16dd('0x2'));exports['listen']=function(){return new BPromise(function(_0x3dbe50,_0x283f1f){var _0x160837={};_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x4')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x5')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x6')));_0x160837=_['merge'](_0x160837,require('../api/voiceRecording/voiceRecording.rpc'));_0x160837=_['merge'](_0x160837,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x7')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x8')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x9')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0xa')));_0x160837=_['merge'](_0x160837,require('../api/trunk/trunk.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0xb')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0xc')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0xd')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0xe')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0xf')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x10')));_0x160837=_['merge'](_0x160837,require('../api/mailMessage/mailMessage.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/mailApplication/mailApplication.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x11')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x12')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x13')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x14')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x15')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x16')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x17')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x18')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x19')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x1a')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x1b')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x1c')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x1d')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x1e')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x1f')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/chatMessage/chatMessage.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x20')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/cmContact/cmContact.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x21')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x22')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x23')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/interval/interval.rpc'));_0x160837=_['merge'](_0x160837,require('../api/pause/pause.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x24')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/template/template.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x25')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x26')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x27')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x28')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x29')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x2a')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x2b')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x2c')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x2d')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x2e')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x2f')));_0x160837=_['merge'](_0x160837,require(_0x16dd('0x30')));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require('../api/squareOdbc/squareOdbc.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x31')));_0x160837=_['merge'](_0x160837,require('../api/squareRecording/squareRecording.rpc'));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x32')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x33')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x34')));_0x160837=_[_0x16dd('0x3')](_0x160837,require(_0x16dd('0x35')));var _0x12c14e=jayson['server'](_0x160837)[_0x16dd('0x36')]();var _0x2fa6da=config[_0x16dd('0x37')]['port']||config[_0x16dd('0x38')]+0x1;var _0x17a184=config[_0x16dd('0x37')]['ip']||_0x16dd('0x39');_0x12c14e['on']('error',function(_0x4e34a4){return _0x283f1f(_0x4e34a4);});_0x12c14e['listen'](_0x2fa6da,_0x17a184,function(){console['log'](_0x16dd('0x3a'),_0x17a184,_0x2fa6da);require('../config/triggers')[_0x16dd('0x3b')]();return _0x3dbe50('RPC\x20listening\x20on\x20'+_0x17a184+':'+_0x2fa6da);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 52a970d..f280ca0 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 _0x0161=['ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','noop','label','exports','util','lodash','events','EventEmitter','./error','call','setTimeout','setEncoding','utf8','headers','ready','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','emit','E_AGI_SOCKET_CLOSE','timeout','destroy','command','inherits','prototype','answer','sendRequest'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x0161,0x67));var _0x1016=function(_0x31e4aa,_0x169543){_0x31e4aa=_0x31e4aa-0x0;var _0x5553e3=_0x0161[_0x31e4aa];return _0x5553e3;};'use strict';var util=require(_0x1016('0x0'));var _=require(_0x1016('0x1'));var EventEmitter=require(_0x1016('0x2'))[_0x1016('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x1016('0x4'));function AGIChannel(_0xb1d47a){var _0x5a2c50=this,_0x33ece0=new AGIReply(),_0x5861ff=![],_0x376a96={};EventEmitter[_0x1016('0x5')](_0x5a2c50);_0xb1d47a['setEncoding']('utf8');_0xb1d47a[_0x1016('0x6')](0x8*0x3c*0x3c*0x3e8);_0x33ece0[_0x1016('0x7')](_0x1016('0x8'));_0x33ece0['on'](_0x1016('0x9'),function(_0x1ae048){for(var _0x2a190e in _0x1ae048){_0x5a2c50[_0x2a190e]=_0x1ae048[_0x2a190e];}_0x5a2c50['emit'](_0x1016('0xa'));});_0x33ece0['on']('line',function(_0x10d782){if(_0x10d782['toLowerCase']()=='hangup'){_0x5a2c50['emit'](_0x1016('0xb'));return;}if(_0x10d782[_0x1016('0xc')](0x0,0xb)==_0x1016('0xd')){_0x5861ff=!![];}if(_0x5861ff){_0x376a96['rx']+=_0x10d782+'\x0a';if(_0x10d782['search'](_0x1016('0xe'))!=-0x1){_0x5861ff=![];}}else{_0x376a96['rx']=_0x10d782;}if(_0x5861ff){return;}if(typeof _0x376a96['cb']==_0x1016('0xf')){var _0x491fed=_0x376a96['rx'][_0x1016('0xc')](0x0,0x3),_0x331c9f=null,_0x6f597e=null;_0x491fed=parseInt(_0x491fed);if(isNaN(_0x491fed)){_0x376a96['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1016('0x10')});return;}if(_0x491fed!=0xc8){_0x376a96['cb'](null,{'code':_0x491fed,'result':-0x1,'extra':'KO'});return;}_0x331c9f=_0x376a96['rx'][_0x1016('0xc')](0x4)[_0x1016('0x11')](_0x1016('0x12'),'');if(_0x331c9f[_0x1016('0x13')]('\x20')!=-0x1){_0x331c9f=_0x331c9f[_0x1016('0x14')](0x0,_0x331c9f[_0x1016('0x13')]('\x20'));}if(_[_0x1016('0x15')](_0x331c9f,'-1')){_0x331c9f=parseInt(_0x331c9f);}_0x6f597e=_0x376a96['rx'][_0x1016('0x16')]('\x20');if(_0x6f597e[_0x1016('0x17')]==0x3){_0x6f597e=_0x6f597e[0x2][_0x1016('0xc')](0x1,_0x6f597e[0x2]['length']-0x1);}else if(_0x6f597e['length']>0x3){var _0x45d801=/\((.+)\)/;var _0xddcf82=_0x376a96['rx']['match'](_0x45d801);if(_0xddcf82){_0x6f597e=_0xddcf82[0x1];}else{_0x6f597e=null;}}else{_0x6f597e=null;}_0x376a96['cb'](null,{'code':_0x491fed,'result':_0x331c9f,'extra':_0x6f597e});}});_0xb1d47a['on'](_0x1016('0x18'),function(_0x1258cc){_0x5a2c50['emit'](_0x1016('0x18'),new AGIError(_0x1016('0x19'),_0x1258cc[_0x1016('0x1a')]));});_0xb1d47a['on'](_0x1016('0x1b'),function(){_0x5a2c50[_0x1016('0x1c')]('close',new AGIError(_0x1016('0x1d')));});_0xb1d47a['on'](_0x1016('0x1e'),function(){_0x5a2c50[_0x1016('0x1c')](_0x1016('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0xb1d47a[_0x1016('0x1f')]();});_0xb1d47a['pipe'](_0x33ece0);this[_0x1016('0x20')]=function(_0x34417d,_0x212b11){var _0x34417d=_0x34417d||'',_0x212b11=typeof _0x212b11=='function'?_0x212b11:new Function();_0x376a96={'tx':_0x34417d,'rx':'','cb':_0x212b11};_0xb1d47a['write'](_0x34417d+'\x0a');},this[_0x1016('0x1b')]=function(){_0xb1d47a['destroy']();};}util[_0x1016('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x1016('0x22')]['sendRequest']=function(_0x49c31d){return this['command']['sync'](this,_0x49c31d);};AGIChannel[_0x1016('0x22')][_0x1016('0x23')]=function(){return this[_0x1016('0x24')](_0x1016('0x25'));};AGIChannel['prototype'][_0x1016('0x26')]=function(_0x235a7c,_0x3dc2d2,_0x5b2c56){_0x235a7c=_0x235a7c===undefined?_0x1016('0x27'):_0x235a7c;_0x3dc2d2=_0x3dc2d2===undefined?'5':_0x3dc2d2;_0x5b2c56=_0x5b2c56===undefined?'1':_0x5b2c56;return this[_0x1016('0x24')](util[_0x1016('0x28')](_0x1016('0x29'),_0x235a7c,_0x3dc2d2*0x3e8,_0x5b2c56));};AGIChannel[_0x1016('0x22')]['noop']=function(_0x1b9168){_0x1b9168=_0x1b9168||_0x1016('0x2a');return this[_0x1016('0x24')](util[_0x1016('0x28')](_0x1016('0x2b'),_0x1b9168));};AGIChannel[_0x1016('0x22')][_0x1016('0x2c')]=function(_0x1b6b2d,_0x55c2b7){if(_[_0x1016('0x2d')](_0x55c2b7)){return this['sendRequest'](util[_0x1016('0x28')](_0x1016('0x2e'),_0x1b6b2d,_0x55c2b7['join'](',')));}return this[_0x1016('0x24')](util[_0x1016('0x28')]('EXEC\x20%s\x20%s',_0x1b6b2d,_0x55c2b7));};AGIChannel[_0x1016('0x22')][_0x1016('0x2f')]=function(_0x3da4b2){return this[_0x1016('0x24')](util[_0x1016('0x28')](_0x1016('0x30'),_0x3da4b2));};AGIChannel[_0x1016('0x22')][_0x1016('0x31')]=function(_0x3e4964){return this['sendRequest'](util['format']('SET\x20EXTENSION\x20%s',_0x3e4964));};AGIChannel[_0x1016('0x22')]['setPriority']=function(_0x56e753){return this[_0x1016('0x24')](util[_0x1016('0x28')](_0x1016('0x32'),_0x56e753));};AGIChannel[_0x1016('0x22')][_0x1016('0xb')]=function(){return this[_0x1016('0x24')](_0x1016('0x33'));};AGIChannel[_0x1016('0x22')]['setVariable']=function(_0xfee41b,_0x4a9720){return this[_0x1016('0x24')](util[_0x1016('0x28')](_0x1016('0x34'),_0xfee41b,_0x4a9720?_0x4a9720['toString']()[_0x1016('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x1069ff,_0x2ecf2b){return this[_0x1016('0x24')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x1069ff,_0x2ecf2b));};AGIChannel[_0x1016('0x22')][_0x1016('0x35')]=function(_0x5d175b,_0x1c51b6){return this['sendRequest'](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x5d175b,_0x1c51b6));};AGIChannel['prototype'][_0x1016('0x36')]=function(_0x54a895,_0x45c262){return this[_0x1016('0x24')](util[_0x1016('0x28')](_0x1016('0x37'),_0x54a895,_0x45c262));};AGIChannel[_0x1016('0x22')][_0x1016('0x38')]=function(_0x57c5ab,_0x24dd54,_0x3e3d0b){_0x24dd54=_0x24dd54||this[_0x1016('0x39')];_0x3e3d0b=_0x3e3d0b||0x1;this[_0x1016('0x2f')](_0x57c5ab);this[_0x1016('0x31')](_0x24dd54);this[_0x1016('0x3a')](_0x3e3d0b);return this['noop'](util[_0x1016('0x28')](_0x1016('0x3b'),_0x57c5ab,_0x24dd54,_0x3e3d0b));};AGIChannel['prototype']['getVariable']=function(_0x587d7a){return this['sendRequest'](util[_0x1016('0x28')](_0x1016('0x3c'),_0x587d7a));};AGIChannel['prototype'][_0x1016('0x3d')]=function(_0x328988,_0x41cfb1,_0xbf92bd,_0x37acc4,_0x2623d3,_0x5edb61){_0x41cfb1=_0x41cfb1||_0x1016('0x3e');_0xbf92bd=_0xbf92bd||'';_0x37acc4=_0x37acc4===undefined?-0x1:_0x37acc4==='-1'?-0x1:_0x37acc4*0x3e8;_0x2623d3=_0x2623d3===undefined?'':'s='+_0x2623d3;_0x5edb61=_0x5edb61?_0x1016('0x3f'):'';return this['sendRequest'](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x328988,_0x41cfb1,_0xbf92bd,_0x37acc4,_0x5edb61,_0x2623d3));};AGIChannel[_0x1016('0x22')][_0x1016('0x40')]=function(_0x1d6e3e,_0x39ae43){_0x39ae43=_0x39ae43||'';return this[_0x1016('0x24')](util['format'](_0x1016('0x41'),_0x1d6e3e,_0x39ae43));};AGIChannel['prototype'][_0x1016('0x42')]=function(_0x2256aa){return this[_0x1016('0x2c')]('AGI',_0x2256aa);};AGIChannel[_0x1016('0x22')]['wait']=function(_0x17c60b){return this[_0x1016('0x2c')]('WAIT',_0x17c60b);};AGIChannel[_0x1016('0x22')][_0x1016('0x18')]=function(_0x562ca2,_0x3555eb){this[_0x1016('0x43')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x562ca2['id'],_0x562ca2[_0x1016('0x44')],_0x3555eb));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1016('0x45')]=AGIChannel; \ No newline at end of file +var _0x6f1d=['length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','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','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','call','utf8','setEncoding','headers','line','toLowerCase','hangup','emit','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith'];(function(_0x38d92a,_0x3da3a7){var _0x291adf=function(_0x16e15b){while(--_0x16e15b){_0x38d92a['push'](_0x38d92a['shift']());}};_0x291adf(++_0x3da3a7);}(_0x6f1d,0xc8));var _0xd6f1=function(_0x116cb8,_0x28b44f){_0x116cb8=_0x116cb8-0x0;var _0x4bedc4=_0x6f1d[_0x116cb8];return _0x4bedc4;};'use strict';var util=require('util');var _=require(_0xd6f1('0x0'));var EventEmitter=require(_0xd6f1('0x1'))[_0xd6f1('0x2')];var AGIReply=require(_0xd6f1('0x3'));var AGIError=require('./error');function AGIChannel(_0x1332e8){var _0x26c3ba=this,_0x3a499b=new AGIReply(),_0x4263e5=![],_0x29950b={};EventEmitter[_0xd6f1('0x4')](_0x26c3ba);_0x1332e8['setEncoding'](_0xd6f1('0x5'));_0x1332e8['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3a499b[_0xd6f1('0x6')]('utf8');_0x3a499b['on'](_0xd6f1('0x7'),function(_0x5a6cdb){for(var _0x5927a2 in _0x5a6cdb){_0x26c3ba[_0x5927a2]=_0x5a6cdb[_0x5927a2];}_0x26c3ba['emit']('ready');});_0x3a499b['on'](_0xd6f1('0x8'),function(_0x3cb294){if(_0x3cb294[_0xd6f1('0x9')]()==_0xd6f1('0xa')){_0x26c3ba[_0xd6f1('0xb')](_0xd6f1('0xa'));return;}if(_0x3cb294[_0xd6f1('0xc')](0x0,0xb)=='520-Invalid'){_0x4263e5=!![];}if(_0x4263e5){_0x29950b['rx']+=_0x3cb294+'\x0a';if(_0x3cb294[_0xd6f1('0xd')](_0xd6f1('0xe'))!=-0x1){_0x4263e5=![];}}else{_0x29950b['rx']=_0x3cb294;}if(_0x4263e5){return;}if(typeof _0x29950b['cb']==_0xd6f1('0xf')){var _0x52c928=_0x29950b['rx'][_0xd6f1('0xc')](0x0,0x3),_0x1dfca9=null,_0x57f97f=null;_0x52c928=parseInt(_0x52c928);if(isNaN(_0x52c928)){_0x29950b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd6f1('0x10')});return;}if(_0x52c928!=0xc8){_0x29950b['cb'](null,{'code':_0x52c928,'result':-0x1,'extra':'KO'});return;}_0x1dfca9=_0x29950b['rx']['substring'](0x4)[_0xd6f1('0x11')](_0xd6f1('0x12'),'');if(_0x1dfca9[_0xd6f1('0x13')]('\x20')!=-0x1){_0x1dfca9=_0x1dfca9[_0xd6f1('0x14')](0x0,_0x1dfca9[_0xd6f1('0x13')]('\x20'));}if(_[_0xd6f1('0x15')](_0x1dfca9,'-1')){_0x1dfca9=parseInt(_0x1dfca9);}_0x57f97f=_0x29950b['rx']['split']('\x20');if(_0x57f97f[_0xd6f1('0x16')]==0x3){_0x57f97f=_0x57f97f[0x2][_0xd6f1('0xc')](0x1,_0x57f97f[0x2]['length']-0x1);}else if(_0x57f97f[_0xd6f1('0x16')]>0x3){var _0x3bec25=/\((.+)\)/;var _0x1dac4c=_0x29950b['rx'][_0xd6f1('0x17')](_0x3bec25);if(_0x1dac4c){_0x57f97f=_0x1dac4c[0x1];}else{_0x57f97f=null;}}else{_0x57f97f=null;}_0x29950b['cb'](null,{'code':_0x52c928,'result':_0x1dfca9,'extra':_0x57f97f});}});_0x1332e8['on'](_0xd6f1('0x18'),function(_0x473b5a){_0x26c3ba[_0xd6f1('0xb')](_0xd6f1('0x18'),new AGIError(_0xd6f1('0x19'),_0x473b5a[_0xd6f1('0x1a')]));});_0x1332e8['on'](_0xd6f1('0x1b'),function(){_0x26c3ba[_0xd6f1('0xb')](_0xd6f1('0x1b'),new AGIError(_0xd6f1('0x1c')));});_0x1332e8['on'](_0xd6f1('0x1d'),function(){_0x26c3ba[_0xd6f1('0xb')]('timeout',new AGIError(_0xd6f1('0x1e')));_0x1332e8[_0xd6f1('0x1f')]();});_0x1332e8[_0xd6f1('0x20')](_0x3a499b);this[_0xd6f1('0x21')]=function(_0x27455c,_0x43381c){var _0x27455c=_0x27455c||'',_0x43381c=typeof _0x43381c==_0xd6f1('0xf')?_0x43381c:new Function();_0x29950b={'tx':_0x27455c,'rx':'','cb':_0x43381c};_0x1332e8[_0xd6f1('0x22')](_0x27455c+'\x0a');},this[_0xd6f1('0x1b')]=function(){_0x1332e8[_0xd6f1('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x24')]=function(_0x2f501f){return this['command']['sync'](this,_0x2f501f);};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x25')]=function(){return this[_0xd6f1('0x24')](_0xd6f1('0x26'));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x27')]=function(_0x3f6b5b,_0x29e47a,_0x2e3c4f){_0x3f6b5b=_0x3f6b5b===undefined?_0xd6f1('0x28'):_0x3f6b5b;_0x29e47a=_0x29e47a===undefined?'5':_0x29e47a;_0x2e3c4f=_0x2e3c4f===undefined?'1':_0x2e3c4f;return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x2a'),_0x3f6b5b,_0x29e47a*0x3e8,_0x2e3c4f));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x2b')]=function(_0xc4b257){_0xc4b257=_0xc4b257||_0xd6f1('0x2c');return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x2d'),_0xc4b257));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x2e')]=function(_0x26e381,_0x22df1a){if(_[_0xd6f1('0x2f')](_0x22df1a)){return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x30'),_0x26e381,_0x22df1a['join'](',')));}return this['sendRequest'](util[_0xd6f1('0x29')]('EXEC\x20%s\x20%s',_0x26e381,_0x22df1a));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x31')]=function(_0x25ae03){return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x32'),_0x25ae03));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x33')]=function(_0x30449e){return this[_0xd6f1('0x24')](util['format']('SET\x20EXTENSION\x20%s',_0x30449e));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x34')]=function(_0x3bb9b0){return this[_0xd6f1('0x24')](util['format'](_0xd6f1('0x35'),_0x3bb9b0));};AGIChannel[_0xd6f1('0x23')]['hangup']=function(){return this[_0xd6f1('0x24')]('HANGUP');};AGIChannel[_0xd6f1('0x23')]['setVariable']=function(_0x427cc4,_0x322aa){return this['sendRequest'](util[_0xd6f1('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x427cc4,_0x322aa?_0x322aa[_0xd6f1('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd6f1('0x23')]['sayNumber']=function(_0x385e65,_0x2f95aa){return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x37'),_0x385e65,_0x2f95aa));};AGIChannel['prototype'][_0xd6f1('0x38')]=function(_0x231d1b,_0x231621){return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x39'),_0x231d1b,_0x231621));};AGIChannel['prototype'][_0xd6f1('0x3a')]=function(_0xa465ec,_0x1de7eb){return this['sendRequest'](util[_0xd6f1('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xa465ec,_0x1de7eb));};AGIChannel[_0xd6f1('0x23')]['continueAt']=function(_0x454801,_0x2b7de4,_0x3b6a6c){_0x2b7de4=_0x2b7de4||this['extension'];_0x3b6a6c=_0x3b6a6c||0x1;this[_0xd6f1('0x31')](_0x454801);this[_0xd6f1('0x33')](_0x2b7de4);this[_0xd6f1('0x34')](_0x3b6a6c);return this['noop'](util[_0xd6f1('0x29')](_0xd6f1('0x3b'),_0x454801,_0x2b7de4,_0x3b6a6c));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x3c')]=function(_0x4dbc1e){return this[_0xd6f1('0x24')](util['format'](_0xd6f1('0x3d'),_0x4dbc1e));};AGIChannel[_0xd6f1('0x23')][_0xd6f1('0x3e')]=function(_0xbee49,_0xa7a77,_0x52f1ed,_0x593c30,_0x16d09d,_0x8605dd){_0xa7a77=_0xa7a77||_0xd6f1('0x3f');_0x52f1ed=_0x52f1ed||'';_0x593c30=_0x593c30===undefined?-0x1:_0x593c30==='-1'?-0x1:_0x593c30*0x3e8;_0x16d09d=_0x16d09d===undefined?'':'s='+_0x16d09d;_0x8605dd=_0x8605dd?'BEEP':'';return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x40'),_0xbee49,_0xa7a77,_0x52f1ed,_0x593c30,_0x8605dd,_0x16d09d));};AGIChannel['prototype'][_0xd6f1('0x41')]=function(_0x2112d4,_0x3cae6b){_0x3cae6b=_0x3cae6b||'';return this[_0xd6f1('0x24')](util[_0xd6f1('0x29')](_0xd6f1('0x42'),_0x2112d4,_0x3cae6b));};AGIChannel['prototype'][_0xd6f1('0x43')]=function(_0x416ab8){return this[_0xd6f1('0x2e')](_0xd6f1('0x44'),_0x416ab8);};AGIChannel['prototype'][_0xd6f1('0x45')]=function(_0x55f39a){return this[_0xd6f1('0x2e')](_0xd6f1('0x46'),_0x55f39a);};AGIChannel['prototype']['error']=function(_0x2a4dce,_0xcbfe9b){this[_0xd6f1('0x2b')](util['format'](_0xd6f1('0x47'),_0x2a4dce['id'],_0x2a4dce[_0xd6f1('0x48')],_0xcbfe9b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd6f1('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 8947020..012915b 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 _0xa420=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa420,0x7a));var _0x0a42=function(_0x45e911,_0x359b9a){_0x45e911=_0x45e911-0x0;var _0x5266dc=_0xa420[_0x45e911];return _0x5266dc;};'use strict';var util=require(_0x0a42('0x0'));var error={'E_AGI_UNDEFINED':_0x0a42('0x1'),'E_AGI_ARGUMENT_PORT':_0x0a42('0x2'),'E_AGI_SERVER_ERROR':_0x0a42('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x0a42('0x4'),'E_AGI_SOCKET_ERROR':_0x0a42('0x5'),'E_AGI_SOCKET_CLOSE':_0x0a42('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x0a42('0x7'),'E_AGI_COMMAND_EMPTY':_0x0a42('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0a42('0x9'),'E_AGI_IVR_ENTRY':_0x0a42('0xa')};function AGIError(_0xdca5aa){var _0xdca5aa=_0xdca5aa||null,_0x2a0627=_0x2a0627||[],_0x3ccfa8=0x1,_0x2d9653='';if(!error[_0xdca5aa]){_0xdca5aa='E_AGI_UNDEFINED';}_0x2a0627[_0x0a42('0xb')](error[_0xdca5aa]);while(arguments[_0x3ccfa8]){_0x2a0627[_0x0a42('0xb')](arguments[_0x3ccfa8]);_0x3ccfa8++;}_0x2d9653=util[_0x0a42('0xc')]['apply'](util,_0x2a0627);this[_0x0a42('0xd')]=_0x2d9653;this[_0x0a42('0xe')]=_0xdca5aa;}module[_0x0a42('0xf')]=AGIError; \ No newline at end of file +var _0x0b74=['push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x58f324,_0x6376e6){var _0x10d561=function(_0x2f67f6){while(--_0x2f67f6){_0x58f324['push'](_0x58f324['shift']());}};_0x10d561(++_0x6376e6);}(_0x0b74,0x166));var _0x40b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b74[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x40b7('0x0'));var error={'E_AGI_UNDEFINED':_0x40b7('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x40b7('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x40b7('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x40b7('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x40b7('0x5'),'E_AGI_COMMAND_EMPTY':_0x40b7('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x40b7('0x7'),'E_AGI_IVR_ENTRY':_0x40b7('0x8')};function AGIError(_0xc96234){var _0xc96234=_0xc96234||null,_0x2da5ba=_0x2da5ba||[],_0x42903a=0x1,_0x7e022b='';if(!error[_0xc96234]){_0xc96234=_0x40b7('0x9');}_0x2da5ba[_0x40b7('0xa')](error[_0xc96234]);while(arguments[_0x42903a]){_0x2da5ba[_0x40b7('0xa')](arguments[_0x42903a]);_0x42903a++;}_0x7e022b=util[_0x40b7('0xb')][_0x40b7('0xc')](util,_0x2da5ba);this[_0x40b7('0xd')]=_0x7e022b;this[_0x40b7('0xe')]=_0xc96234;}module[_0x40b7('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 1c439cd..7c259e1 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 _0x087b=['max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','getdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','menu','invalid','default\x20on\x20switch\x20not\x20found','includes'];(function(_0x2b2e4f,_0x7b5af){var _0x574482=function(_0x15b968){while(--_0x15b968){_0x2b2e4f['push'](_0x2b2e4f['shift']());}};_0x574482(++_0x7b5af);}(_0x087b,0x11a));var _0xb087=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x087b[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0xb087('0x0'));var logger=require(_0xb087('0x1'))('agi');var verticesWithRetry=['menu',_0xb087('0x2'),'getsecretdigits'];var Graph=function(){this[_0xb087('0x3')]={};this[_0xb087('0x4')]={};this[_0xb087('0x5')]=0x0;};Graph[_0xb087('0x6')][_0xb087('0x7')]=function(_0x46e106){this[_0xb087('0x3')][_0x46e106['id']]=_0x46e106;this[_0xb087('0x4')][_0x46e106['id']]=[];};Graph[_0xb087('0x6')][_0xb087('0x8')]=function(_0x3cebbf,_0x6d83fb,_0x1dbe9f){this[_0xb087('0x4')][_0x3cebbf][_0xb087('0x9')]({'target':_0x6d83fb,'condition':_0x1dbe9f});this[_0xb087('0x5')]+=0x1;};Graph[_0xb087('0x6')]['size']=function(){return _[_0xb087('0xa')](this[_0xb087('0x3')]);};Graph[_0xb087('0x6')][_0xb087('0xb')]=function(){return this[_0xb087('0x5')];};Graph[_0xb087('0x6')][_0xb087('0xc')]=function(_0x5cced1){return this[_0xb087('0x3')][_0x5cced1];};Graph[_0xb087('0x6')][_0xb087('0xd')]=function(_0x51ceaa,_0x3001e3){if(!this[_0xb087('0x3')][_0x51ceaa]){return logger[_0xb087('0xe')](_0xb087('0xf'));}var _0x11784c=_0x3001e3(this[_0xb087('0x3')][_0x51ceaa]);if(!_0x11784c){return logger[_0xb087('0xe')](_0xb087('0x10'));}if(this[_0xb087('0x4')][_0x51ceaa][_0xb087('0x11')]===0x0){return logger['info'](_0xb087('0x12'));}for(var _0x412b48=0x0,_0x597478=[],_0xcc4426=![];_0x412b48\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','evtHangup','mxGraphModel','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','source','target','addEdge','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','sync','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','connection','lodash','syncho','../../config/environment','../../config/logger','../../config/license/util','./mailRpc','./graph','defaults','agi','127.0.0.1','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port'];(function(_0x3bcf38,_0x290cc0){var _0x49d42e=function(_0x59d61e){while(--_0x59d61e){_0x3bcf38['push'](_0x3bcf38['shift']());}};_0x49d42e(++_0x290cc0);}(_0x794e,0x194));var _0xe794=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x794e[_0x2dadb9];return _0x2f0097;};'use strict';var parser=require('xml2json');var _=require(_0xe794('0x0'));var syncho=require(_0xe794('0x1'));var util=require('util');var moment=require('moment');var config=require(_0xe794('0x2'));var logger=require(_0xe794('0x3'))('agi');var utilLicense=require(_0xe794('0x4'));var rpc=require('./rpc');var mailRpc=require(_0xe794('0x5'));var Graph=require(_0xe794('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xe794('0x7')](config[_0xe794('0x8')],{'ip':_0xe794('0x9'),'port':0x11dd});function connectionHandler(_0x45f3fe){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x45f3fe);agiHandler(_0x45f3fe);}catch(_0x40eb69){logger[_0xe794('0xa')](_0x40eb69[_0xe794('0xb')]);}});});}function listeningHandler(){console['log'](_0xe794('0xc'),config[_0xe794('0x8')]['port']);logger['info'](util[_0xe794('0xd')](_0xe794('0xe'),config[_0xe794('0x8')]['ip'],config[_0xe794('0x8')][_0xe794('0xf')]));}function errorHandler(_0x28099e){if(_0x28099e&&_0x28099e['name']&&_0x28099e['message']){logger[_0xe794('0xa')](util[_0xe794('0xd')](_0xe794('0x10'),_0x28099e[_0xe794('0x11')],_0x28099e['message']));}else{logger[_0xe794('0xa')](util['format']('[ERROR]\x20%s',_0x28099e['stack']));}}function closeHandler(){logger[_0xe794('0x12')](util[_0xe794('0xd')](_0xe794('0x13'),this['arg_1'],this[_0xe794('0x14')],this['callerid'],this[_0xe794('0x15')],this[_0xe794('0x16')]));try{createSquareReport(this);}catch(_0x346e28){logger[_0xe794('0xa')](_0x346e28[_0xe794('0xb')]);}}function timeoutHandler(){logger['info'](util[_0xe794('0xd')](_0xe794('0x17'),this['arg_1'],this['calleridname'],this['callerid'],this[_0xe794('0x15')],this[_0xe794('0x16')]));}function hangupHandler(){logger['info'](util[_0xe794('0xd')](_0xe794('0x18'),this[_0xe794('0x19')],this[_0xe794('0x14')],this[_0xe794('0x1a')],this[_0xe794('0x15')],this[_0xe794('0x16')]));this[_0xe794('0x1b')]=!![];}function getRoot(_0x1863f4){return parser['toJson'](_0x1863f4,{'object':!![]})[_0xe794('0x1c')]['root'];}function addVertex(_0x55e3f3,_0x36ef4d,_0x2ef7ff){_0x36ef4d['agicommand']=_0x2ef7ff;if(_0x36ef4d[_0xe794('0x1d')](_0xe794('0x1e'))){_0x36ef4d['maxRetry']=parseInt(_0x36ef4d['retry'],0xa);}_0x55e3f3[_0xe794('0x1f')](_[_0xe794('0x20')](_0x36ef4d,_0xe794('0x21')));}function initGraph(_0x2d075a,_0x1d871d){var _0xa0aa31=new Graph();for(var _0x1d6ad7 in _0x2d075a){if(_0x2d075a['hasOwnProperty'](_0x1d6ad7)){if(_[_0xe794('0x22')](_0x2d075a[_0x1d6ad7])){for(var _0x24fff3=0x0;_0x24fff3<_0x2d075a[_0x1d6ad7]['length'];_0x24fff3+=0x1){addVertex(_0xa0aa31,_0x2d075a[_0x1d6ad7][_0x24fff3],_0x1d6ad7);}}else{addVertex(_0xa0aa31,_0x2d075a[_0x1d6ad7],_0x1d6ad7);}}}for(var _0x470a93=0x0;_0x470a93<_0x1d871d['length'];_0x470a93+=0x1){if(_0x1d871d[_0x470a93][_0xe794('0x23')]&&_0x1d871d[_0x470a93][_0xe794('0x24')]){_0xa0aa31[_0xe794('0x25')](_0x1d871d[_0x470a93]['source'],_0x1d871d[_0x470a93][_0xe794('0x24')],_0x1d871d[_0x470a93]['value']);}}return _0xa0aa31;}function getSquareProject(_0x5c04b7,_0x56499f){rpc[_0xe794('0x26')](_0x5c04b7)['then'](function(_0x3e5709){_0x56499f(null,_0x3e5709);})[_0xe794('0x27')](function(_0x3c3af0){_0x56499f(null,_0x3c3af0);});}function createSquareReport(_0x5c4ae0,_0x4f74f8){rpc[_0xe794('0x28')](_0x5c4ae0)[_0xe794('0x29')](function(_0x5ba328){if(_0x4f74f8){_0x4f74f8(null,_0x5ba328);}})['catch'](function(_0x304659){if(_0x4f74f8){_0x4f74f8(null,_0x304659);}});}function setChannelVariables(_0x30dcbc){for(var _0x1e5aca in _0x30dcbc){if(_0x30dcbc[_0xe794('0x1d')](_0x1e5aca)){if(_0x1e5aca[_0xe794('0x2a')](_0xe794('0x2b'))===0x0){_0x30dcbc[_0x1e5aca[_0xe794('0x2c')](0x4)]=_0x30dcbc[_0x1e5aca];delete _0x30dcbc[_0x1e5aca];}}}}function getLogFromObject(_0x2b4113){return util[_0xe794('0x2d')](_0x2b4113,{'showHidden':![],'depth':null});}function agiHandler(_0x238aec){var _0x9ff25c,_0x4da7cd,_0x4b1916,_0xe5c930,_0x24a2b6;logger[_0xe794('0x2e')](_0xe794('0x2f'),JSON[_0xe794('0x30')](_0x238aec,null,0x2));logger[_0xe794('0x12')](util['format'](_0xe794('0x31'),_0x238aec[_0xe794('0x19')],_0x238aec['calleridname'],_0x238aec[_0xe794('0x1a')],_0x238aec['dnid'],_0x238aec[_0xe794('0x16')]));_0x238aec['on']('error',errorHandler);_0x238aec['on']('close',closeHandler);_0x238aec['on']('timeout',timeoutHandler);_0x238aec[_0xe794('0x1b')]=![];_0x238aec['on']('hangup',hangupHandler);var _0x4c01c6=getSquareProject[_0xe794('0x32')](null,_0x238aec[_0xe794('0x19')]);if(_0x4c01c6){if(_0x4c01c6[_0xe794('0x33')]){_0x9ff25c=getRoot(_0x4c01c6[_0xe794('0x33')]);if(_0x9ff25c&&_0x9ff25c[_0xe794('0x34')]){logger[_0xe794('0x2e')](_0xe794('0x35'),JSON[_0xe794('0x30')](_0x9ff25c,null,0x2));_0x238aec[_0xe794('0x36')]=moment()[_0xe794('0xd')](_0xe794('0x37'));_0x4da7cd=initGraph(_[_0xe794('0x20')](_0x9ff25c,'mxCell'),_0x9ff25c[_0xe794('0x21')]);_0x4b1916=new Vertices(_0x238aec,rpc,mailRpc);logger['info'](util[_0xe794('0xd')](_0xe794('0x38'),_0x238aec[_0xe794('0x19')],_0x238aec[_0xe794('0x14')],_0x238aec[_0xe794('0x1a')],_0x238aec[_0xe794('0x15')],_0x238aec[_0xe794('0x16')]));_0x4da7cd['traverseBFS'](_0x9ff25c[_0xe794('0x34')]['id'],function(_0xb982d9){try{_0xb982d9=_0x4b1916['clear'](_0xb982d9);logger['debug'](_0xe794('0x39'),JSON[_0xe794('0x30')](_0xb982d9,null,0x2));if(_0xb982d9[_0xe794('0x3a')]===_0xe794('0x3b')){logger[_0xe794('0x12')](_0xe794('0x3c'));_0x238aec[_0xe794('0x3d')]=_0xb982d9[_0xe794('0x3d')]||_0x238aec[_0xe794('0x3d')];_0x238aec[_0xe794('0x3e')]=_0xb982d9[_0xe794('0x3e')];_0x238aec['priority']=_0xb982d9[_0xe794('0x3f')]?_0xb982d9[_0xe794('0x3f')]-0x1:0x1;return null;}else if(_0xb982d9&&_0x4b1916[_0xb982d9[_0xe794('0x3a')]]){_0x24a2b6=_0x4b1916[_0xb982d9['agicommand']](_0xb982d9);logger[_0xe794('0x12')](_0xe794('0x40'),JSON['stringify'](_0x24a2b6,null,0x2));if(_0x24a2b6&&_0x24a2b6[_0xe794('0x41')]===AGI_CODE_SUCCESS&&_0x24a2b6[_0xe794('0x42')]!==AGI_RESULT_ERROR&&!_0x238aec[_0xe794('0x1b')]){logger[_0xe794('0x2e')](_0xe794('0x40'),getLogFromObject(_0x24a2b6));return _[_0xe794('0x43')](_0x24a2b6[_0xe794('0x42')])?null:_0x24a2b6[_0xe794('0x42')]['toString']();}else{logger[_0xe794('0xa')]('response',getLogFromObject(_0x24a2b6));return null;}}else{logger[_0xe794('0xa')](_0xe794('0x44'));return null;}}catch(_0x3d0239){logger[_0xe794('0xa')](_0x3d0239[_0xe794('0xb')]);return null;}});if(_0x9ff25c[_0xe794('0x45')]){logger[_0xe794('0x12')](util['format'](_0xe794('0x46'),_0x238aec['arg_1'],_0x238aec['calleridname'],_0x238aec[_0xe794('0x1a')],_0x238aec['dnid'],_0x238aec[_0xe794('0x16')]));_0x4da7cd[_0xe794('0x47')](_0x9ff25c[_0xe794('0x45')]['id'],function(_0x23186d){try{_0x23186d=_0x4b1916[_0xe794('0x48')](_0x23186d);logger[_0xe794('0x2e')](_0xe794('0x39'),JSON[_0xe794('0x30')](_0x23186d,null,0x2));if(_0x23186d&&_0x4b1916[_0x23186d['agicommand']]){_0x24a2b6=_0x4b1916[_0x23186d['agicommand']](_0x23186d);if(_0x24a2b6){logger['debug'](_0xe794('0x40'),getLogFromObject(_0x24a2b6));return _['isUndefined'](_0x24a2b6[_0xe794('0x42')])?null:_0x24a2b6[_0xe794('0x42')]['toString']();}else{logger[_0xe794('0xa')](_0xe794('0x40'),getLogFromObject(_0x24a2b6));return null;}}else{logger['error'](_0xe794('0x44'));return null;}}catch(_0x5584b2){logger[_0xe794('0xa')](_0x5584b2[_0xe794('0xb')]);return null;}});}logger[_0xe794('0x12')](util[_0xe794('0xd')](_0xe794('0x49'),_0x238aec[_0xe794('0x19')],_0x238aec[_0xe794('0x14')],_0x238aec[_0xe794('0x1a')],_0x238aec['dnid'],_0x238aec[_0xe794('0x16')]));logger['info'](util[_0xe794('0xd')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x238aec[_0xe794('0x3d')],_0x238aec[_0xe794('0x3e')],parseInt(_0x238aec[_0xe794('0x3f')],0xa)+0x1));_0x238aec[_0xe794('0x4a')](_0x238aec[_0xe794('0x3d')],_0x238aec[_0xe794('0x3e')],parseInt(_0x238aec['priority'],0xa)+0x1);_0x238aec[_0xe794('0x4b')]();}}else{logger['error'](util[_0xe794('0xd')](_0xe794('0x4c'),_0x238aec[_0xe794('0x19')]));_0x238aec[_0xe794('0x4a')](_0x238aec[_0xe794('0x3d')],_0x238aec[_0xe794('0x3e')],parseInt(_0x238aec[_0xe794('0x3f')],0xa)+0x1);_0x238aec[_0xe794('0x4b')]();}}else{logger['error'](util[_0xe794('0xd')](_0xe794('0x4d'),_0x238aec['arg_1']));_0x238aec[_0xe794('0x4a')](_0x238aec[_0xe794('0x3d')],_0x238aec[_0xe794('0x3e')],parseInt(_0x238aec[_0xe794('0x3f')],0xa)+0x1);_0x238aec[_0xe794('0x4b')]();}}function main(){var _0x578cb4;return utilLicense['getLicense']()[_0xe794('0x29')](function(_0x4c9d9a){if(_0x4c9d9a){if(_0x4c9d9a['voice']){if(_0x4c9d9a['callysquare']&&_0x4c9d9a[_0xe794('0x4e')]>0x0){logger[_0xe794('0x12')](util[_0xe794('0xd')](_0xe794('0x4f'),_0x4c9d9a[_0xe794('0x4e')]));_0x578cb4=_0x4c9d9a[_0xe794('0x4e')];}else{logger['info'](_0xe794('0x50'));}}else{logger[_0xe794('0x12')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x578cb4=-0x1;}}})['catch'](function(_0x238364){logger[_0xe794('0xa')](_0xe794('0x51'),_0x238364[_0xe794('0xb')]);})[_0xe794('0x45')](function(){var _0x114bc8=require(_0xe794('0x52'))(config[_0xe794('0x8')][_0xe794('0xf')],config['agi']['ip'],_0x578cb4);_0x114bc8['on'](_0xe794('0xa'),errorHandler);_0x114bc8['on']('listening',listeningHandler);_0x114bc8['on'](_0xe794('0x53'),connectionHandler);_0x114bc8['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x9fd4=['calleridname','evtHangup','toJson','mxGraphModel','retry','maxRetry','isArray','length','source','target','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand','gotoc','context','extension','priority','code','result','toString','response','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9fd4,0x1a3));var _0x49fd=function(_0x20f60f,_0x1548a7){_0x20f60f=_0x20f60f-0x0;var _0x7e5daa=_0x9fd4[_0x20f60f];return _0x7e5daa;};'use strict';var parser=require(_0x49fd('0x0'));var _=require(_0x49fd('0x1'));var syncho=require(_0x49fd('0x2'));var util=require(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var config=require('../../config/environment');var logger=require(_0x49fd('0x5'))(_0x49fd('0x6'));var utilLicense=require(_0x49fd('0x7'));var rpc=require(_0x49fd('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x49fd('0x9'));var Vertices=require(_0x49fd('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x49fd('0xb')](config[_0x49fd('0x6')],{'ip':_0x49fd('0xc'),'port':0x11dd});function connectionHandler(_0x16068f){process[_0x49fd('0xd')](function(){syncho(function(){try{setChannelVariables(_0x16068f);agiHandler(_0x16068f);}catch(_0x5f8a1e){logger[_0x49fd('0xe')](_0x5f8a1e[_0x49fd('0xf')]);}});});}function listeningHandler(){console[_0x49fd('0x10')](_0x49fd('0x11'),config[_0x49fd('0x6')][_0x49fd('0x12')]);logger[_0x49fd('0x13')](util[_0x49fd('0x14')](_0x49fd('0x15'),config[_0x49fd('0x6')]['ip'],config[_0x49fd('0x6')][_0x49fd('0x12')]));}function errorHandler(_0x15577b){if(_0x15577b&&_0x15577b[_0x49fd('0x16')]&&_0x15577b[_0x49fd('0x17')]){logger[_0x49fd('0xe')](util['format'](_0x49fd('0x18'),_0x15577b[_0x49fd('0x16')],_0x15577b[_0x49fd('0x17')]));}else{logger['error'](util[_0x49fd('0x14')]('[ERROR]\x20%s',_0x15577b[_0x49fd('0xf')]));}}function closeHandler(){logger[_0x49fd('0x13')](util['format'](_0x49fd('0x19'),this[_0x49fd('0x1a')],this['calleridname'],this[_0x49fd('0x1b')],this[_0x49fd('0x1c')],this[_0x49fd('0x1d')]));try{createSquareReport(this);}catch(_0x1cfb1c){logger[_0x49fd('0xe')](_0x1cfb1c['stack']);}}function timeoutHandler(){logger[_0x49fd('0x13')](util[_0x49fd('0x14')](_0x49fd('0x1e'),this['arg_1'],this[_0x49fd('0x1f')],this[_0x49fd('0x1b')],this['dnid'],this[_0x49fd('0x1d')]));}function hangupHandler(){logger[_0x49fd('0x13')](util[_0x49fd('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x49fd('0x1a')],this[_0x49fd('0x1f')],this['callerid'],this[_0x49fd('0x1c')],this[_0x49fd('0x1d')]));this[_0x49fd('0x20')]=!![];}function getRoot(_0x383e21){return parser[_0x49fd('0x21')](_0x383e21,{'object':!![]})[_0x49fd('0x22')]['root'];}function addVertex(_0x39d964,_0x469b8d,_0x12db6a){_0x469b8d['agicommand']=_0x12db6a;if(_0x469b8d['hasOwnProperty'](_0x49fd('0x23'))){_0x469b8d[_0x49fd('0x24')]=parseInt(_0x469b8d[_0x49fd('0x23')],0xa);}_0x39d964['addVertex'](_['omit'](_0x469b8d,'mxCell'));}function initGraph(_0x48cdda,_0x35645e){var _0x2e73db=new Graph();for(var _0x56dcd0 in _0x48cdda){if(_0x48cdda['hasOwnProperty'](_0x56dcd0)){if(_[_0x49fd('0x25')](_0x48cdda[_0x56dcd0])){for(var _0xf7b9a9=0x0;_0xf7b9a9<_0x48cdda[_0x56dcd0][_0x49fd('0x26')];_0xf7b9a9+=0x1){addVertex(_0x2e73db,_0x48cdda[_0x56dcd0][_0xf7b9a9],_0x56dcd0);}}else{addVertex(_0x2e73db,_0x48cdda[_0x56dcd0],_0x56dcd0);}}}for(var _0x1d55d4=0x0;_0x1d55d4<_0x35645e[_0x49fd('0x26')];_0x1d55d4+=0x1){if(_0x35645e[_0x1d55d4][_0x49fd('0x27')]&&_0x35645e[_0x1d55d4][_0x49fd('0x28')]){_0x2e73db['addEdge'](_0x35645e[_0x1d55d4][_0x49fd('0x27')],_0x35645e[_0x1d55d4][_0x49fd('0x28')],_0x35645e[_0x1d55d4][_0x49fd('0x29')]);}}return _0x2e73db;}function getSquareProject(_0x1dd449,_0x38f879){rpc[_0x49fd('0x2a')](_0x1dd449)[_0x49fd('0x2b')](function(_0x2f44e4){_0x38f879(null,_0x2f44e4);})['catch'](function(_0x54e9ad){_0x38f879(null,_0x54e9ad);});}function createSquareReport(_0x2af3dd,_0x469219){rpc[_0x49fd('0x2c')](_0x2af3dd)[_0x49fd('0x2b')](function(_0x3fd56a){if(_0x469219){_0x469219(null,_0x3fd56a);}})[_0x49fd('0x2d')](function(_0x2cc56c){if(_0x469219){_0x469219(null,_0x2cc56c);}});}function setChannelVariables(_0x42f2d2){for(var _0xc8ee57 in _0x42f2d2){if(_0x42f2d2['hasOwnProperty'](_0xc8ee57)){if(_0xc8ee57[_0x49fd('0x2e')](_0x49fd('0x2f'))===0x0){_0x42f2d2[_0xc8ee57[_0x49fd('0x30')](0x4)]=_0x42f2d2[_0xc8ee57];delete _0x42f2d2[_0xc8ee57];}}}}function getLogFromObject(_0x2d097e){return util[_0x49fd('0x31')](_0x2d097e,{'showHidden':![],'depth':null});}function agiHandler(_0x17ec79){var _0x275c2f,_0x1fb031,_0x2d592f,_0x51b951,_0xa91d1;logger[_0x49fd('0x32')](_0x49fd('0x33'),JSON[_0x49fd('0x34')](_0x17ec79,null,0x2));logger['info'](util[_0x49fd('0x14')](_0x49fd('0x35'),_0x17ec79[_0x49fd('0x1a')],_0x17ec79[_0x49fd('0x1f')],_0x17ec79[_0x49fd('0x1b')],_0x17ec79['dnid'],_0x17ec79[_0x49fd('0x1d')]));_0x17ec79['on']('error',errorHandler);_0x17ec79['on'](_0x49fd('0x36'),closeHandler);_0x17ec79['on'](_0x49fd('0x37'),timeoutHandler);_0x17ec79['evtHangup']=![];_0x17ec79['on'](_0x49fd('0x38'),hangupHandler);var _0x15e1d3=getSquareProject[_0x49fd('0x39')](null,_0x17ec79[_0x49fd('0x1a')]);if(_0x15e1d3){if(_0x15e1d3[_0x49fd('0x3a')]){_0x275c2f=getRoot(_0x15e1d3['production']);if(_0x275c2f&&_0x275c2f[_0x49fd('0x3b')]){logger[_0x49fd('0x32')]('root',JSON[_0x49fd('0x34')](_0x275c2f,null,0x2));_0x17ec79[_0x49fd('0x3c')]=moment()[_0x49fd('0x14')](_0x49fd('0x3d'));_0x1fb031=initGraph(_[_0x49fd('0x3e')](_0x275c2f,_0x49fd('0x3f')),_0x275c2f[_0x49fd('0x3f')]);_0x2d592f=new Vertices(_0x17ec79,rpc,mailRpc);logger[_0x49fd('0x13')](util[_0x49fd('0x14')](_0x49fd('0x40'),_0x17ec79['arg_1'],_0x17ec79[_0x49fd('0x1f')],_0x17ec79[_0x49fd('0x1b')],_0x17ec79[_0x49fd('0x1c')],_0x17ec79[_0x49fd('0x1d')]));_0x1fb031['traverseBFS'](_0x275c2f[_0x49fd('0x3b')]['id'],function(_0x4784d8){try{_0x4784d8=_0x2d592f['clear'](_0x4784d8);logger[_0x49fd('0x32')]('vertex',JSON[_0x49fd('0x34')](_0x4784d8,null,0x2));if(_0x4784d8[_0x49fd('0x41')]===_0x49fd('0x42')){logger[_0x49fd('0x13')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x17ec79[_0x49fd('0x43')]=_0x4784d8[_0x49fd('0x43')]||_0x17ec79[_0x49fd('0x43')];_0x17ec79[_0x49fd('0x44')]=_0x4784d8[_0x49fd('0x44')];_0x17ec79['priority']=_0x4784d8[_0x49fd('0x45')]?_0x4784d8[_0x49fd('0x45')]-0x1:0x1;return null;}else if(_0x4784d8&&_0x2d592f[_0x4784d8['agicommand']]){_0xa91d1=_0x2d592f[_0x4784d8[_0x49fd('0x41')]](_0x4784d8);logger['info']('response',JSON['stringify'](_0xa91d1,null,0x2));if(_0xa91d1&&_0xa91d1[_0x49fd('0x46')]===AGI_CODE_SUCCESS&&_0xa91d1['result']!==AGI_RESULT_ERROR&&!_0x17ec79['evtHangup']){logger['debug']('response',getLogFromObject(_0xa91d1));return _['isUndefined'](_0xa91d1[_0x49fd('0x47')])?null:_0xa91d1[_0x49fd('0x47')][_0x49fd('0x48')]();}else{logger[_0x49fd('0xe')](_0x49fd('0x49'),getLogFromObject(_0xa91d1));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x521559){logger['error'](_0x521559[_0x49fd('0xf')]);return null;}});if(_0x275c2f[_0x49fd('0x4a')]){logger[_0x49fd('0x13')](util[_0x49fd('0x14')](_0x49fd('0x4b'),_0x17ec79[_0x49fd('0x1a')],_0x17ec79['calleridname'],_0x17ec79[_0x49fd('0x1b')],_0x17ec79['dnid'],_0x17ec79[_0x49fd('0x1d')]));_0x1fb031[_0x49fd('0x4c')](_0x275c2f[_0x49fd('0x4a')]['id'],function(_0x1a13da){try{_0x1a13da=_0x2d592f[_0x49fd('0x4d')](_0x1a13da);logger[_0x49fd('0x32')]('vertex',JSON[_0x49fd('0x34')](_0x1a13da,null,0x2));if(_0x1a13da&&_0x2d592f[_0x1a13da[_0x49fd('0x41')]]){_0xa91d1=_0x2d592f[_0x1a13da[_0x49fd('0x41')]](_0x1a13da);if(_0xa91d1){logger[_0x49fd('0x32')]('response',getLogFromObject(_0xa91d1));return _[_0x49fd('0x4e')](_0xa91d1[_0x49fd('0x47')])?null:_0xa91d1['result'][_0x49fd('0x48')]();}else{logger['error'](_0x49fd('0x49'),getLogFromObject(_0xa91d1));return null;}}else{logger[_0x49fd('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x2dac9f){logger[_0x49fd('0xe')](_0x2dac9f[_0x49fd('0xf')]);return null;}});}logger[_0x49fd('0x13')](util['format'](_0x49fd('0x4f'),_0x17ec79[_0x49fd('0x1a')],_0x17ec79[_0x49fd('0x1f')],_0x17ec79['callerid'],_0x17ec79[_0x49fd('0x1c')],_0x17ec79[_0x49fd('0x1d')]));logger[_0x49fd('0x13')](util[_0x49fd('0x14')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x17ec79[_0x49fd('0x43')],_0x17ec79[_0x49fd('0x44')],parseInt(_0x17ec79[_0x49fd('0x45')],0xa)+0x1));_0x17ec79[_0x49fd('0x50')](_0x17ec79[_0x49fd('0x43')],_0x17ec79[_0x49fd('0x44')],parseInt(_0x17ec79[_0x49fd('0x45')],0xa)+0x1);_0x17ec79[_0x49fd('0x36')]();}}else{logger[_0x49fd('0xe')](util[_0x49fd('0x14')](_0x49fd('0x51'),_0x17ec79[_0x49fd('0x1a')]));_0x17ec79[_0x49fd('0x50')](_0x17ec79[_0x49fd('0x43')],_0x17ec79[_0x49fd('0x44')],parseInt(_0x17ec79['priority'],0xa)+0x1);_0x17ec79[_0x49fd('0x36')]();}}else{logger['error'](util[_0x49fd('0x14')](_0x49fd('0x52'),_0x17ec79[_0x49fd('0x1a')]));_0x17ec79[_0x49fd('0x50')](_0x17ec79[_0x49fd('0x43')],_0x17ec79[_0x49fd('0x44')],parseInt(_0x17ec79['priority'],0xa)+0x1);_0x17ec79[_0x49fd('0x36')]();}}function main(){var _0x9a9182;return utilLicense['getLicense']()['then'](function(_0x41b988){if(_0x41b988){if(_0x41b988[_0x49fd('0x53')]){if(_0x41b988['callysquare']&&_0x41b988[_0x49fd('0x54')]>0x0){logger['info'](util[_0x49fd('0x14')](_0x49fd('0x55'),_0x41b988['callysquare']));_0x9a9182=_0x41b988[_0x49fd('0x54')];}else{logger[_0x49fd('0x13')](_0x49fd('0x56'));}}else{logger[_0x49fd('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x9a9182=-0x1;}}})[_0x49fd('0x2d')](function(_0x434075){logger['error']('[LICENSE]',_0x434075[_0x49fd('0xf')]);})[_0x49fd('0x4a')](function(){var _0x104ba2=require(_0x49fd('0x57'))(config[_0x49fd('0x6')][_0x49fd('0x12')],config[_0x49fd('0x6')]['ip'],_0x9a9182);_0x104ba2['on']('error',errorHandler);_0x104ba2['on'](_0x49fd('0x58'),listeningHandler);_0x104ba2['on'](_0x49fd('0x59'),connectionHandler);_0x104ba2['on'](_0x49fd('0x36'),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 97feabe..f6992bd 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x6ab3e3,_0x560beb){var _0x1b1734=function(_0x5e0659){while(--_0x5e0659){_0x6ab3e3['push'](_0x6ab3e3['shift']());}};_0x1b1734(++_0x560beb);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x322264,_0x9abb7a){var _0x1153c1=function(_0x704b12){while(--_0x704b12){_0x322264['push'](_0x322264['shift']());}};_0x1153c1(++_0x9abb7a);}(_0x34e8,0x12c));var _0x834e=function(_0x5db661,_0x3167bf){_0x5db661=_0x5db661-0x0;var _0x4663b9=_0x34e8[_0x5db661];return _0x4663b9;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b57c210..55ae744 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x359e4f,_0x25efbe){var _0x3d0d31=function(_0x5b9420){while(--_0x5b9420){_0x359e4f['push'](_0x359e4f['shift']());}};_0x3d0d31(++_0x25efbe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ce2bb,_0xf151b){_0x1ce2bb=_0x1ce2bb-0x0;var _0x40dc49=_0x5f2f[_0x1ce2bb];return _0x40dc49;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x2fb3ef,_0x5a6000){var _0x46f9fc=function(_0x4ef80f){while(--_0x4ef80f){_0x2fb3ef['push'](_0x2fb3ef['shift']());}};_0x46f9fc(++_0x5a6000);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1363e7,_0x1e578b){_0x1363e7=_0x1363e7-0x0;var _0x1498c6=_0x5f2f[_0x1363e7];return _0x1498c6;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 1115662..1b6d87a 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 _0x9476=['agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','jayson/promise','client','http','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowSound','save_name','getIntervalById','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','phone','then','getPauseById','ShowPause','agentLogin','LoginUser','agentPause'];(function(_0xc7ed29,_0x515330){var _0xf8da19=function(_0x1bd99c){while(--_0x1bd99c){_0xc7ed29['push'](_0xc7ed29['shift']());}};_0xf8da19(++_0x515330);}(_0x9476,0xdc));var _0x6947=function(_0x4a5deb,_0x3ea78c){_0x4a5deb=_0x4a5deb-0x0;var _0x5c0429=_0x9476[_0x4a5deb];return _0x5c0429;};'use strict';var BPromise=require(_0x6947('0x0'));var moment=require('moment');var _=require(_0x6947('0x1'));var util=require('util');var jayson=require(_0x6947('0x2'));var client=jayson[_0x6947('0x3')][_0x6947('0x4')]({'port':0x2329});function request(_0x569b40,_0x4bb0d7){return new BPromise(function(_0x3f533a,_0x35ef4a){return client['request'](_0x569b40,_0x4bb0d7)['then'](function(_0x4fea14){if(_0x4fea14['error']){return _0x35ef4a(_0x4fea14[_0x6947('0x5')][_0x6947('0x6')]);}else{return _0x3f533a(_0x4fea14[_0x6947('0x7')]);}})[_0x6947('0x8')](function(_0x3f9a8b){return _0x35ef4a(_0x3f9a8b);});});}exports[_0x6947('0x9')]=function(_0x13cbd4){return request(_0x6947('0xa'),{'options':{'raw':![],'where':{'name':_0x13cbd4},'attributes':['production']}});};exports[_0x6947('0xb')]=function(_0x3acb8f){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3acb8f},'include':[{'model':_0x6947('0xc'),'as':_0x6947('0xd')}],'attributes':['id','name',_0x6947('0xe')]}});};exports[_0x6947('0xf')]=function(_0xce5b19){return request(_0x6947('0xa'),{'options':{'where':{'id':_0xce5b19},'attributes':[_0x6947('0x10')]}});};exports[_0x6947('0x11')]=function(_0x5438e1){return request(_0x6947('0x12'),{'options':{'where':{'id':_0x5438e1},'attributes':[_0x6947('0x10')]}});};exports[_0x6947('0x13')]=function(_0x4f8c9e){return request(_0x6947('0x14'),{'options':{'where':{'id':_0x4f8c9e},'attributes':[_0x6947('0x10')]}});};exports[_0x6947('0x15')]=function(_0x3b6593){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3b6593},'attributes':[_0x6947('0x16')]}});};exports[_0x6947('0x17')]=function(_0x5ce6be){return request(_0x6947('0x18'),{'options':{'where':{'id':_0x5ce6be},'attributes':[_0x6947('0x10')]}});};exports[_0x6947('0x19')]=function(_0x2482df){return request('ShowTrunk',{'options':{'where':{'id':_0x2482df},'attributes':[_0x6947('0x10')]}});};exports['getSoundById']=function(_0x2cde3e){return request(_0x6947('0x1a'),{'options':{'where':{'id':_0x2cde3e},'attributes':[_0x6947('0x1b')]}});};exports[_0x6947('0x1c')]=function(_0x35683c){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x35683c},'include':[{'model':'Interval','as':_0x6947('0x1d')}]}});};exports[_0x6947('0x1e')]=function(_0x21f3f3){return request('ShowSmsAccount',{'options':{'where':{'id':_0x21f3f3},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x2c30ec){return request(_0x6947('0x1f'),{'body':_0x2c30ec});};exports[_0x6947('0x20')]=function(_0x841735){return request(_0x6947('0x21'),{'body':_0x841735});};exports['createSquareReport']=function(_0xe049b3){return request(_0x6947('0x22'),{'body':_[_0x6947('0x23')](_0xe049b3,{'project_name':_0xe049b3['arg_1'],'prev_project_name':_0xe049b3[_0x6947('0x24')]||'','is_subproject':_0xe049b3[_0x6947('0x24')]?!![]:![],'leaveAt':moment()[_0x6947('0x25')](_0x6947('0x26'))})});};exports[_0x6947('0x27')]=function(_0x1725f7){return request(_0x6947('0x28'),{'body':_0x1725f7});};exports['createSquareMessage']=function(_0x55b4e1){return request(_0x6947('0x29'),{'body':_0x55b4e1});};exports['createCmContact']=function(_0x5e1f65){return request(_0x6947('0x2a'),{'options':{'raw':![],'where':{'phone':_0x5e1f65[_0x6947('0x2b')],'ListId':_0x5e1f65['ListId']}}})[_0x6947('0x2c')](function(_0x1dbf4e){if(_0x1dbf4e){return _0x1dbf4e;}return request('CreateCmContact',{'body':_0x5e1f65});});};exports[_0x6947('0x2d')]=function(_0x528a1e){return request(_0x6947('0x2e'),{'options':{'where':{'id':_0x528a1e},'attributes':[_0x6947('0x10')]}});};exports[_0x6947('0x2f')]=function(_0x5ad56f,_0x4cdc48){return request(_0x6947('0x30'),{'body':{'interface':_0x4cdc48},'options':{'where':_0x5ad56f}});};exports[_0x6947('0x31')]=function(_0x2eb6f1,_0x2b1661,_0x7e6de5){return request('PauseUser',{'body':{'type':_0x2b1661,'uniqueid':_0x7e6de5},'options':{'where':_0x2eb6f1}});};exports[_0x6947('0x32')]=function(_0x414df7){return request(_0x6947('0x33'),{'body':{},'options':{'where':_0x414df7}});};exports[_0x6947('0x34')]=function(_0x1988e2){return request(_0x6947('0x35'),{'body':{},'options':{'where':_0x1988e2}});}; \ No newline at end of file +var _0x6eb8=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','util','jayson/promise','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','getSquareProjectById','name','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0x25a5dc,_0x34dd3c){var _0x432b6d=function(_0x4ffa49){while(--_0x4ffa49){_0x25a5dc['push'](_0x25a5dc['shift']());}};_0x432b6d(++_0x34dd3c);}(_0x6eb8,0xeb));var _0x86eb=function(_0x277068,_0x3d1e8e){_0x277068=_0x277068-0x0;var _0x2c446b=_0x6eb8[_0x277068];return _0x2c446b;};'use strict';var BPromise=require(_0x86eb('0x0'));var moment=require(_0x86eb('0x1'));var _=require('lodash');var util=require(_0x86eb('0x2'));var jayson=require(_0x86eb('0x3'));var client=jayson['client'][_0x86eb('0x4')]({'port':0x2329});function request(_0x2e3546,_0x40ea4e){return new BPromise(function(_0x4f97ae,_0x1900a8){return client[_0x86eb('0x5')](_0x2e3546,_0x40ea4e)[_0x86eb('0x6')](function(_0x16fc61){if(_0x16fc61[_0x86eb('0x7')]){return _0x1900a8(_0x16fc61[_0x86eb('0x7')][_0x86eb('0x8')]);}else{return _0x4f97ae(_0x16fc61[_0x86eb('0x9')]);}})[_0x86eb('0xa')](function(_0x3690dd){return _0x1900a8(_0x3690dd);});});}exports[_0x86eb('0xb')]=function(_0x14e4dc){return request(_0x86eb('0xc'),{'options':{'raw':![],'where':{'name':_0x14e4dc},'attributes':[_0x86eb('0xd')]}});};exports[_0x86eb('0xe')]=function(_0x404d32){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x404d32},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id','name','email']}});};exports[_0x86eb('0xf')]=function(_0x51d0ca){return request('ShowSquareProject',{'options':{'where':{'id':_0x51d0ca},'attributes':[_0x86eb('0x10')]}});};exports['getVoiceQueueById']=function(_0x4ec2d3){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4ec2d3},'attributes':[_0x86eb('0x10')]}});};exports[_0x86eb('0x11')]=function(_0x41cd3c){return request('ShowVariable',{'options':{'where':{'id':_0x41cd3c},'attributes':[_0x86eb('0x10')]}});};exports[_0x86eb('0x12')]=function(_0xe3c567){return request(_0x86eb('0x13'),{'options':{'where':{'id':_0xe3c567},'attributes':[_0x86eb('0x14')]}});};exports[_0x86eb('0x15')]=function(_0x2ca601){return request('ShowUser',{'options':{'where':{'id':_0x2ca601},'attributes':[_0x86eb('0x10')]}});};exports['getTrunkById']=function(_0x3fb5cd){return request(_0x86eb('0x16'),{'options':{'where':{'id':_0x3fb5cd},'attributes':[_0x86eb('0x10')]}});};exports[_0x86eb('0x17')]=function(_0x93f3c8){return request(_0x86eb('0x18'),{'options':{'where':{'id':_0x93f3c8},'attributes':[_0x86eb('0x19')]}});};exports['getIntervalById']=function(_0x4aae26){return request(_0x86eb('0x1a'),{'options':{'raw':![],'where':{'id':_0x4aae26},'include':[{'model':_0x86eb('0x1b'),'as':_0x86eb('0x1c')}]}});};exports[_0x86eb('0x1d')]=function(_0x12c076){return request(_0x86eb('0x1e'),{'options':{'where':{'id':_0x12c076},'attributes':['id','name']}});};exports[_0x86eb('0x1f')]=function(_0x38874f){return request(_0x86eb('0x20'),{'body':_0x38874f});};exports[_0x86eb('0x21')]=function(_0x3346a7){return request(_0x86eb('0x22'),{'body':_0x3346a7});};exports[_0x86eb('0x23')]=function(_0x58c343){return request(_0x86eb('0x24'),{'body':_[_0x86eb('0x25')](_0x58c343,{'project_name':_0x58c343['arg_1'],'prev_project_name':_0x58c343[_0x86eb('0x26')]||'','is_subproject':_0x58c343['arg_2']?!![]:![],'leaveAt':moment()[_0x86eb('0x27')](_0x86eb('0x28'))})});};exports[_0x86eb('0x29')]=function(_0x4dafd5){return request('CreateSquareRecording',{'body':_0x4dafd5});};exports[_0x86eb('0x2a')]=function(_0x277abb){return request(_0x86eb('0x2b'),{'body':_0x277abb});};exports[_0x86eb('0x2c')]=function(_0x546ab5){return request(_0x86eb('0x2d'),{'options':{'raw':![],'where':{'phone':_0x546ab5[_0x86eb('0x2e')],'ListId':_0x546ab5[_0x86eb('0x2f')]}}})['then'](function(_0x45f236){if(_0x45f236){return _0x45f236;}return request(_0x86eb('0x30'),{'body':_0x546ab5});});};exports[_0x86eb('0x31')]=function(_0x4600e1){return request('ShowPause',{'options':{'where':{'id':_0x4600e1},'attributes':[_0x86eb('0x10')]}});};exports['agentLogin']=function(_0x45a32c,_0x324f33){return request('LoginUser',{'body':{'interface':_0x324f33},'options':{'where':_0x45a32c}});};exports['agentPause']=function(_0x546b3c,_0x2a6e24,_0x237331){return request('PauseUser',{'body':{'type':_0x2a6e24,'uniqueid':_0x237331},'options':{'where':_0x546b3c}});};exports[_0x86eb('0x32')]=function(_0x298ee8){return request(_0x86eb('0x33'),{'body':{},'options':{'where':_0x298ee8}});};exports[_0x86eb('0x34')]=function(_0x12ba59){return request('LogoutUser',{'body':{},'options':{'where':_0x12ba59}});}; \ 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 93f6ce2..742bd4f 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 _0xc561=['exports','./polly','./lex'];(function(_0x30f4a2,_0x114e59){var _0x454c31=function(_0x24bdd1){while(--_0x24bdd1){_0x30f4a2['push'](_0x30f4a2['shift']());}};_0x454c31(++_0x114e59);}(_0xc561,0x1e1));var _0x1c56=function(_0x5c9f2d,_0xeee094){_0x5c9f2d=_0x5c9f2d-0x0;var _0x4007f0=_0xc561[_0x5c9f2d];return _0x4007f0;};var polly=require(_0x1c56('0x0'));var lex=require(_0x1c56('0x1'));module[_0x1c56('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6065=['./polly','./lex','exports'];(function(_0x1ded0f,_0x2c82a9){var _0x1ad47a=function(_0x5b745b){while(--_0x5b745b){_0x1ded0f['push'](_0x1ded0f['shift']());}};_0x1ad47a(++_0x2c82a9);}(_0x6065,0xf9));var _0x5606=function(_0x18f64a,_0x1c8248){_0x18f64a=_0x18f64a-0x0;var _0x44687f=_0x6065[_0x18f64a];return _0x44687f;};var polly=require(_0x5606('0x0'));var lex=require(_0x5606('0x1'));module[_0x5606('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index ae65872..e6438de 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x46441c,_0x3c645a,_0x48adc3,_0x270dda,_0x7191f2,_0x5709b7){return lex(_0x46441c,_0x3c645a,_0x48adc3,_0x270dda,_0x7191f2,_0x5709b7);}; \ No newline at end of file +var _0x2821=['exports','./lib/api'];(function(_0x4d2db0,_0xc060e7){var _0x3fc182=function(_0x2dd19b){while(--_0x2dd19b){_0x4d2db0['push'](_0x4d2db0['shift']());}};_0x3fc182(++_0xc060e7);}(_0x2821,0x87));var _0x1282=function(_0x57bcd2,_0x51a5e5){_0x57bcd2=_0x57bcd2-0x0;var _0x114d8d=_0x2821[_0x57bcd2];return _0x114d8d;};'use strict';var lex=require(_0x1282('0x0'));module[_0x1282('0x1')]=function(_0x333849,_0x356903,_0x27c0ae,_0x1bebaa,_0x279fa6,_0x1e303b){return lex(_0x333849,_0x356903,_0x27c0ae,_0x1bebaa,_0x279fa6,_0x1e303b);}; \ 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 de15824..8ecc8f7 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 _0x05e9=['slot_','LexRuntime','aws-sdk','slots','hasOwnProperty'];(function(_0x576383,_0x10ce5a){var _0x53eaae=function(_0xedcb42){while(--_0xedcb42){_0x576383['push'](_0x576383['shift']());}};_0x53eaae(++_0x10ce5a);}(_0x05e9,0x11f));var _0x905e=function(_0x1a5f51,_0x1db1a0){_0x1a5f51=_0x1a5f51-0x0;var _0x294d64=_0x05e9[_0x1a5f51];return _0x294d64;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x905e('0x0'));function lexResult(_0xe373b8,_0xc90734){return new BPromise(function(_0x5c8b35,_0x5e668a){_0xe373b8['postText'](_0xc90734,function(_0x321a2e,_0x7f7357){if(_0x321a2e){_0x5e668a(_0x321a2e);}if(_0x7f7357[_0x905e('0x1')]){for(const _0x416d96 in _0x7f7357['slots']){if(_0x7f7357['slots'][_0x905e('0x2')](_0x416d96)){var _0x5af4ef=_0x7f7357['slots'][_0x416d96];_0x7f7357[_0x905e('0x3')+_0x416d96]=_0x5af4ef;}}}_0x5c8b35(_0x7f7357);});});}module['exports']=function(_0x2db755,_0x3d9ea4,_0x38a12b,_0x1e8c6c,_0x148663,_0x32196f){var _0x5da8d5=new AWS[(_0x905e('0x4'))]({'accessKeyId':_0x3d9ea4,'secretAccessKey':_0x38a12b,'region':_0x1e8c6c});var _0x4b2488={'botAlias':'$LATEST','botName':_0x32196f,'inputText':_0x148663,'userId':_0x2db755};return lexResult(_0x5da8d5,_0x4b2488);}; \ No newline at end of file +var _0xd6a3=['$LATEST','bluebird','postText','slots','hasOwnProperty','exports','LexRuntime'];(function(_0xc1b0b1,_0x2765f9){var _0x5c735d=function(_0x11c023){while(--_0x11c023){_0xc1b0b1['push'](_0xc1b0b1['shift']());}};_0x5c735d(++_0x2765f9);}(_0xd6a3,0xcc));var _0x3d6a=function(_0x12ef9a,_0x67ee59){_0x12ef9a=_0x12ef9a-0x0;var _0x475f50=_0xd6a3[_0x12ef9a];return _0x475f50;};'use strict';var BPromise=require(_0x3d6a('0x0'));var AWS=require('aws-sdk');function lexResult(_0x2bb2d7,_0x443afd){return new BPromise(function(_0x3dc7aa,_0xf59552){_0x2bb2d7[_0x3d6a('0x1')](_0x443afd,function(_0x4c2ebd,_0x1262dc){if(_0x4c2ebd){_0xf59552(_0x4c2ebd);}if(_0x1262dc['slots']){for(const _0x2b8bc8 in _0x1262dc[_0x3d6a('0x2')]){if(_0x1262dc[_0x3d6a('0x2')][_0x3d6a('0x3')](_0x2b8bc8)){var _0x229c18=_0x1262dc[_0x3d6a('0x2')][_0x2b8bc8];_0x1262dc['slot_'+_0x2b8bc8]=_0x229c18;}}}_0x3dc7aa(_0x1262dc);});});}module[_0x3d6a('0x4')]=function(_0x43663c,_0x507265,_0x4da3d6,_0x418f46,_0x68448,_0x59fc22){var _0x12ab7f=new AWS[(_0x3d6a('0x5'))]({'accessKeyId':_0x507265,'secretAccessKey':_0x4da3d6,'region':_0x418f46});var _0x2b45af={'botAlias':_0x3d6a('0x6'),'botName':_0x59fc22,'inputText':_0x68448,'userId':_0x43663c};return lexResult(_0x12ab7f,_0x2b45af);}; \ 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 32ca33f..d3ed603 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 _0x9f4a=['exports','./lib/api'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9f4a,0x13b));var _0xa9f4=function(_0x8b324d,_0x466c57){_0x8b324d=_0x8b324d-0x0;var _0x13b577=_0x9f4a[_0x8b324d];return _0x13b577;};'use strict';var polly=require(_0xa9f4('0x0'));module[_0xa9f4('0x1')]=function(_0x496fe6,_0x23e1a0,_0x3e5f10,_0x449a75,_0x95ba52,_0x18e0e1,_0x582702){return polly(_0x496fe6,_0x23e1a0,_0x3e5f10,_0x449a75,_0x95ba52,_0x18e0e1,_0x582702);}; \ No newline at end of file +var _0xcdfb=['./lib/api','exports'];(function(_0x5d9c08,_0x68d66e){var _0x3d07ae=function(_0x1f6d8d){while(--_0x1f6d8d){_0x5d9c08['push'](_0x5d9c08['shift']());}};_0x3d07ae(++_0x68d66e);}(_0xcdfb,0x134));var _0xbcdf=function(_0x3de58f,_0x412362){_0x3de58f=_0x3de58f-0x0;var _0x5a0f61=_0xcdfb[_0x3de58f];return _0x5a0f61;};'use strict';var polly=require(_0xbcdf('0x0'));module[_0xbcdf('0x1')]=function(_0x8e04e6,_0x4f51e7,_0x48e11a,_0x2ebadd,_0x3e7215,_0x51cd32,_0xa323c9){return polly(_0x8e04e6,_0x4f51e7,_0x48e11a,_0x2ebadd,_0x3e7215,_0x51cd32,_0xa323c9);}; \ 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 5f50ecd..58a0612 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 _0x4f4a=['randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','mp3','path','bluebird'];(function(_0x50ae92,_0x11e899){var _0x375128=function(_0xbdc369){while(--_0xbdc369){_0x50ae92['push'](_0x50ae92['shift']());}};_0x375128(++_0x11e899);}(_0x4f4a,0x1f2));var _0xa4f4=function(_0x26e9b8,_0xecfbf1){_0x26e9b8=_0x26e9b8-0x0;var _0x5e093e=_0x4f4a[_0x26e9b8];return _0x5e093e;};'use strict';var fs=require('fs');var path=require(_0xa4f4('0x0'));var BPromise=require(_0xa4f4('0x1'));var rs=require(_0xa4f4('0x2'));var AWS=require(_0xa4f4('0x3'));function pollyResult(_0x736765,_0x39560e,_0x401341){return new BPromise(function(_0x4df10b,_0x13d60a){_0x736765[_0xa4f4('0x4')](_0x39560e,function(_0x45dcd6,_0x10d77b){if(_0x45dcd6){_0x13d60a(_0x45dcd6);}else if(_0x10d77b){if(_0x10d77b['AudioStream']instanceof Buffer){fs[_0xa4f4('0x5')](_0x401341,_0x10d77b[_0xa4f4('0x6')],function(_0x45b2f3){if(_0x45b2f3){_0x13d60a(_0x45b2f3);}else{_0x4df10b();}});}else{_0x13d60a(new Error(_0xa4f4('0x7')));}}else{_0x13d60a(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xa4f4('0x8')]=function(_0x20efd8,_0x3c0358,_0x1d6a3b,_0x347553,_0x115a8f,_0x2c2f06,_0x13d183){var _0x52554b=new AWS['Polly']({'accessKeyId':_0x20efd8,'secretAccessKey':_0x3c0358,'region':_0x1d6a3b});var _0x30c1b3={'Text':_0x115a8f,'TextType':_0x2c2f06||'text','OutputFormat':_0xa4f4('0x9'),'VoiceId':_0x347553};return pollyResult(_0x52554b,_0x30c1b3,_0x13d183);}; \ No newline at end of file +var _0x84d7=['path','bluebird','randomstring','writeFile','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3a5db6,_0x48f935){var _0x25fe94=function(_0x309a10){while(--_0x309a10){_0x3a5db6['push'](_0x3a5db6['shift']());}};_0x25fe94(++_0x48f935);}(_0x84d7,0x1aa));var _0x784d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x84d7[_0x4c12ec];return _0x3ae42c;};'use strict';var fs=require('fs');var path=require(_0x784d('0x0'));var BPromise=require(_0x784d('0x1'));var rs=require(_0x784d('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x2547f7,_0x5a8d70,_0xdf875a){return new BPromise(function(_0xcaf173,_0x59c22e){_0x2547f7['synthesizeSpeech'](_0x5a8d70,function(_0x2b63fc,_0x4caa19){if(_0x2b63fc){_0x59c22e(_0x2b63fc);}else if(_0x4caa19){if(_0x4caa19['AudioStream']instanceof Buffer){fs[_0x784d('0x3')](_0xdf875a,_0x4caa19[_0x784d('0x4')],function(_0x4c6442){if(_0x4c6442){_0x59c22e(_0x4c6442);}else{_0xcaf173();}});}else{_0x59c22e(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x59c22e(new Error(_0x784d('0x5')));}});});}module['exports']=function(_0x1ad3f1,_0x47e26d,_0x254765,_0x14274d,_0x30070b,_0x114a89,_0x44c8be){var _0x30b0b1=new AWS['Polly']({'accessKeyId':_0x1ad3f1,'secretAccessKey':_0x47e26d,'region':_0x254765});var _0x47b6cf={'Text':_0x30070b,'TextType':_0x114a89||'text','OutputFormat':'mp3','VoiceId':_0x14274d};return pollyResult(_0x30b0b1,_0x47b6cf,_0x44c8be);}; \ 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 9e555d8..7eccd5b 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 _0xb299=['./lib/api'];(function(_0x5bd913,_0x174eaf){var _0x5925c7=function(_0x21ca7a){while(--_0x21ca7a){_0x5bd913['push'](_0x5bd913['shift']());}};_0x5925c7(++_0x174eaf);}(_0xb299,0x19b));var _0x9b29=function(_0x2a9d38,_0x4ec7fb){_0x2a9d38=_0x2a9d38-0x0;var _0x291883=_0xb299[_0x2a9d38];return _0x291883;};'use strict';var asr=require(_0x9b29('0x0'));module['exports']=function(_0xb0d226,_0x215bac,_0x14663c,_0x3d0722){return asr(_0xb0d226,_0x215bac,_0x14663c);}; \ No newline at end of file +var _0xd291=['./lib/api','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd291,0xae));var _0x1d29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd291[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0x1d29('0x0'));module[_0x1d29('0x1')]=function(_0x25b187,_0x2814ac,_0x11abde,_0x1c01bf){return asr(_0x25b187,_0x2814ac,_0x11abde);}; \ 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 deb7c6b..5898170 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 _0x5b94=['length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','exports'];(function(_0x3d7740,_0x62957c){var _0x234780=function(_0x413b17){while(--_0x413b17){_0x3d7740['push'](_0x3d7740['shift']());}};_0x234780(++_0x62957c);}(_0x5b94,0x6c));var _0x45b9=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x5b94[_0x7e2eb0];return _0xd92de4;};'use strict';var url=require(_0x45b9('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x45b9('0x1')]=function(_0x43e334,_0xb18339,_0x38c409){return new BPromise(function(_0x89b0c4,_0x378b5d){var _0x2df3b7;if(typeof _0x43e334!=='string'||_0x43e334[_0x45b9('0x2')]===0x0){return _0x378b5d(_0x45b9('0x3'));}if(typeof _0xb18339!=='string'||_0xb18339[_0x45b9('0x2')]===0x0){return _0x378b5d('key\x20should\x20be\x20a\x20string');}if(typeof _0x38c409!==_0x45b9('0x4')&&(typeof _0x38c409!=='string'||_0x38c409[_0x45b9('0x2')]===0x0)){return _0x378b5d(_0x45b9('0x5'));}try{_0x2df3b7=fs[_0x45b9('0x6')](_0x43e334)['toString'](_0x45b9('0x7'));}catch(_0x60fb8a){return _0x378b5d(_0x60fb8a);}return _0x89b0c4({'method':'POST','uri':host+_0x45b9('0x8')+_0xb18339,'body':{'config':{'encoding':_0x45b9('0x9'),'sampleRateHertz':_0x45b9('0xa'),'languageCode':_0x38c409},'audio':{'content':_0x2df3b7}},'json':!![]});});}; \ No newline at end of file +var _0x0522=['bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','url'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x0522,0x103));var _0x2052=function(_0x523fa9,_0x4afaf2){_0x523fa9=_0x523fa9-0x0;var _0x1df5b6=_0x0522[_0x523fa9];return _0x1df5b6;};'use strict';var url=require(_0x2052('0x0'));var BPromise=require(_0x2052('0x1'));var fs=require('fs');var host=_0x2052('0x2');module[_0x2052('0x3')]=function(_0x4614c0,_0x29f78d,_0x15a8a6){return new BPromise(function(_0x378d1a,_0x1081c7){var _0x4058de;if(typeof _0x4614c0!==_0x2052('0x4')||_0x4614c0['length']===0x0){return _0x1081c7(_0x2052('0x5'));}if(typeof _0x29f78d!=='string'||_0x29f78d[_0x2052('0x6')]===0x0){return _0x1081c7('key\x20should\x20be\x20a\x20string');}if(typeof _0x15a8a6!=='undefined'&&(typeof _0x15a8a6!==_0x2052('0x4')||_0x15a8a6[_0x2052('0x6')]===0x0)){return _0x1081c7(_0x2052('0x7'));}try{_0x4058de=fs[_0x2052('0x8')](_0x4614c0)[_0x2052('0x9')](_0x2052('0xa'));}catch(_0x2dc50b){return _0x1081c7(_0x2dc50b);}return _0x378d1a({'method':_0x2052('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x29f78d,'body':{'config':{'encoding':_0x2052('0xc'),'sampleRateHertz':'8000','languageCode':_0x15a8a6},'audio':{'content':_0x4058de}},'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 63981c7..b210c44 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 _0x34e8=['./asr','exports'];(function(_0x19311a,_0x2d2679){var _0x42617c=function(_0x43227d){while(--_0x43227d){_0x19311a['push'](_0x19311a['shift']());}};_0x42617c(++_0x2d2679);}(_0x34e8,0x12c));var _0x834e=function(_0x1eabbb,_0x5ddfc1){_0x1eabbb=_0x1eabbb-0x0;var _0x3ef170=_0x34e8[_0x1eabbb];return _0x3ef170;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x008c=['./asr','exports'];(function(_0x30e7df,_0x12d70e){var _0x541b6f=function(_0x1044ce){while(--_0x1044ce){_0x30e7df['push'](_0x30e7df['shift']());}};_0x541b6f(++_0x12d70e);}(_0x008c,0x188));var _0xc008=function(_0x42879f,_0x3b68ed){_0x42879f=_0x42879f-0x0;var _0x328d93=_0x008c[_0x42879f];return _0x328d93;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index dec62bc..5dcb432 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 _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x2092c5,_0x28edb9){var _0x2c03bc=function(_0x5846c7){while(--_0x5846c7){_0x2092c5['push'](_0x2092c5['shift']());}};_0x2c03bc(++_0x28edb9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file +var _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0xb10b,0x12a));var _0xbb10=function(_0x158658,_0x46f304){_0x158658=_0x158658-0x0;var _0x2c408f=_0xb10b[_0x158658];return _0x2c408f;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=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 a5de1c4..aad8e88 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 _0x5953=['exports','./nda'];(function(_0x28b7b8,_0x3cce45){var _0x58042a=function(_0x41a5ed){while(--_0x41a5ed){_0x28b7b8['push'](_0x28b7b8['shift']());}};_0x58042a(++_0x3cce45);}(_0x5953,0xe1));var _0x3595=function(_0x513e76,_0x1d2589){_0x513e76=_0x513e76-0x0;var _0x2b11c2=_0x5953[_0x513e76];return _0x2b11c2;};var nda=require(_0x3595('0x0'));module[_0x3595('0x1')]={'nda':nda}; \ No newline at end of file +var _0x3863=['./nda'];(function(_0x3f0c41,_0x13ed17){var _0x16b224=function(_0xd9b577){while(--_0xd9b577){_0x3f0c41['push'](_0x3f0c41['shift']());}};_0x16b224(++_0x13ed17);}(_0x3863,0x1c1));var _0x3386=function(_0x4ecec1,_0x447117){_0x4ecec1=_0x4ecec1-0x0;var _0x1c2b8e=_0x3863[_0x4ecec1];return _0x1c2b8e;};var nda=require(_0x3386('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index a9e0975..62acded 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 _0xaffa=['extension','text','Bearer\x20','access_token','project','body','ProjectName','channelData','audio/wav','custom_action','CustomActionData','stringify','url','../../../../../config/logger','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xaffa,0x1a2));var _0xaaff=function(_0x987307,_0x315f1d){_0x987307=_0x987307-0x0;var _0xcfd024=_0xaffa[_0x987307];return _0xcfd024;};'use strict';var rp=require('request-promise');var url=require(_0xaaff('0x0'));var logger=require(_0xaaff('0x1'))('agi');module['exports']=function(_0x414e53,_0x24fa2b){var _0x1b0a5f={'method':_0xaaff('0x2'),'uri':url[_0xaaff('0x3')](_0x24fa2b[_0xaaff('0x4')],_0xaaff('0x5')),'form':{'grant_type':'password','username':_0x24fa2b[_0xaaff('0x6')],'password':_0x24fa2b[_0xaaff('0x7')]},'json':!![]};return rp(_0x1b0a5f)['then'](function(_0x59b757){var _0x1546d4={'method':'POST','uri':url[_0xaaff('0x3')](_0x24fa2b[_0xaaff('0x8')],_0xaaff('0x9')),'body':{'type':_0x24fa2b[_0xaaff('0xa')]||_0xaaff('0xb'),'channelId':_0xaaff('0xc'),'conversation':{'id':_0x414e53[_0xaaff('0xd')]},'from':{'id':_0x414e53[_0xaaff('0xe')],'name':_0x414e53[_0xaaff('0xf')]},'recipient':{'id':_0x414e53[_0xaaff('0x10')],'name':_0x414e53[_0xaaff('0x11')]},'text':_0x24fa2b[_0xaaff('0x12')],'channelData':{}},'headers':{'Authorization':_0xaaff('0x13')+_0x59b757[_0xaaff('0x14')]},'json':!![]};if(_0x24fa2b[_0xaaff('0x15')]){_0x1546d4[_0xaaff('0x16')]['channelData'][_0xaaff('0x17')]=_0x24fa2b['project'];}if(_0x24fa2b['ndagenerate_audio']=='1'){_0x1546d4[_0xaaff('0x16')][_0xaaff('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xaaff('0x19')};}if(_0x24fa2b['custom_action']){_0x1546d4[_0xaaff('0x16')][_0xaaff('0x18')]['CustomAction']=_0x24fa2b[_0xaaff('0x1a')];if(_0x24fa2b['custom_action_data']){_0x1546d4[_0xaaff('0x16')]['channelData'][_0xaaff('0x1b')]=_0x24fa2b['custom_action_data'];}}logger['info'](JSON[_0xaaff('0x1c')](_0x1546d4));return rp(_0x1546d4);});}; \ No newline at end of file +var _0x1b19=['resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','Bearer\x20','access_token','project','ProjectName','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','../../../../../config/logger','agi','exports','POST'];(function(_0xffc988,_0xd466ab){var _0x1e738b=function(_0x33c2b3){while(--_0x33c2b3){_0xffc988['push'](_0xffc988['shift']());}};_0x1e738b(++_0xd466ab);}(_0x1b19,0x1af));var _0x91b1=function(_0x312a01,_0x302b8d){_0x312a01=_0x312a01-0x0;var _0x273426=_0x1b19[_0x312a01];return _0x273426;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x91b1('0x0'))(_0x91b1('0x1'));module[_0x91b1('0x2')]=function(_0x1e5c93,_0x3708ba){var _0x49ea6d={'method':_0x91b1('0x3'),'uri':url[_0x91b1('0x4')](_0x3708ba[_0x91b1('0x5')],_0x91b1('0x6')),'form':{'grant_type':_0x91b1('0x7'),'username':_0x3708ba[_0x91b1('0x8')],'password':_0x3708ba[_0x91b1('0x7')]},'json':!![]};return rp(_0x49ea6d)[_0x91b1('0x9')](function(_0x2a1c7e){var _0x14472b={'method':_0x91b1('0x3'),'uri':url['resolve'](_0x3708ba['ndassistant_url'],_0x91b1('0xa')),'body':{'type':_0x3708ba[_0x91b1('0xb')]||_0x91b1('0xc'),'channelId':_0x91b1('0xd'),'conversation':{'id':_0x1e5c93[_0x91b1('0xe')]},'from':{'id':_0x1e5c93['callerid'],'name':_0x1e5c93[_0x91b1('0xf')]},'recipient':{'id':_0x1e5c93[_0x91b1('0x10')],'name':_0x1e5c93['extension']},'text':_0x3708ba['text'],'channelData':{}},'headers':{'Authorization':_0x91b1('0x11')+_0x2a1c7e[_0x91b1('0x12')]},'json':!![]};if(_0x3708ba[_0x91b1('0x13')]){_0x14472b['body']['channelData'][_0x91b1('0x14')]=_0x3708ba['project'];}if(_0x3708ba['ndagenerate_audio']=='1'){_0x14472b[_0x91b1('0x15')]['channelData'][_0x91b1('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3708ba[_0x91b1('0x17')]){_0x14472b[_0x91b1('0x15')]['channelData'][_0x91b1('0x18')]=_0x3708ba['custom_action'];if(_0x3708ba[_0x91b1('0x19')]){_0x14472b[_0x91b1('0x15')]['channelData'][_0x91b1('0x1a')]=_0x3708ba['custom_action_data'];}}logger[_0x91b1('0x1b')](JSON[_0x91b1('0x1c')](_0x14472b));return rp(_0x14472b);});}; \ 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 d6f7147..bfe9496 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 _0x0099=['exports','./lib/api'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x0099,0x115));var _0x9009=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0x0099[_0xf72786];return _0x113f3e;};'use strict';var asr=require(_0x9009('0x0'));module[_0x9009('0x1')]=function(_0x5c12e7,_0x311279,_0x3cea3f,_0x3db018){return asr(_0x5c12e7,_0x311279,_0x3cea3f,_0x3db018);}; \ No newline at end of file +var _0x464d=['./lib/api'];(function(_0x13e31f,_0x25f412){var _0x5b06e6=function(_0x136e23){while(--_0x136e23){_0x13e31f['push'](_0x13e31f['shift']());}};_0x5b06e6(++_0x25f412);}(_0x464d,0x12e));var _0xd464=function(_0x2fbab6,_0x461312){_0x2fbab6=_0x2fbab6-0x0;var _0x360fa5=_0x464d[_0x2fbab6];return _0x360fa5;};'use strict';var asr=require(_0xd464('0x0'));module['exports']=function(_0x4f7ad1,_0x2df059,_0xb660c5,_0x5cf3ff){return asr(_0x4f7ad1,_0x2df059,_0xb660c5,_0x5cf3ff);}; \ 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 dede63d..5f2a29e 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 _0x397f=['../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','lodash','moment','crypto'];(function(_0x2f7c40,_0xb36203){var _0x57a4a5=function(_0x47db35){while(--_0x47db35){_0x2f7c40['push'](_0x2f7c40['shift']());}};_0x57a4a5(++_0xb36203);}(_0x397f,0x177));var _0xf397=function(_0x46856b,_0x54f85b){_0x46856b=_0x46856b-0x0;var _0x32a364=_0x397f[_0x46856b];return _0x32a364;};'use strict';var BPromise=require('bluebird');var _=require(_0xf397('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf397('0x1'));var crypto=require(_0xf397('0x2'));var logger=require(_0xf397('0x3'))(_0xf397('0x4'));module[_0xf397('0x5')]=function(_0x1b8669,_0x26aa55,_0x27c54f,_0x1a2fe2){return new BPromise(function(_0x575a92,_0x2244a6){logger[_0xf397('0x6')](_0xf397('0x7'),_0x1a2fe2||_0xf397('0x8'));var _0x7d0b12=new WebSocket(_0x1a2fe2||_0xf397('0x8'),{'perMessageDeflate':![]});var _0x4964a7='';var _0x412834='0';var _0x128b82='1';var _0x178f00=_0xf397('0x9');function _0x4d1a35(_0x2ae344){var _0xa5c01e=crypto[_0xf397('0xa')]('sha1');_0xa5c01e[_0xf397('0xb')](_0x2ae344);return _0xa5c01e[_0xf397('0xc')](_0xf397('0xd'));}function _0xd9000c(){try{logger[_0xf397('0x6')](_0xf397('0xe'));var _0x3f9b7d=moment()[_0xf397('0xf')]();var _0x1fe8d1=_0x4d1a35(_0x3f9b7d+_0x26aa55+_0x27c54f);_0x7d0b12[_0xf397('0x10')](JSON[_0xf397('0x11')]({'appID':_0x26aa55,'timestamp':_0x3f9b7d,'appKey':_0x1fe8d1}));var _0x454a3c=fs[_0xf397('0x12')](_0x1b8669);_0x454a3c['on'](_0xf397('0x13'),function(_0x22149e){_0x7d0b12[_0xf397('0x10')](_0x22149e);});_0x454a3c['on']('close',function(){_0x7d0b12[_0xf397('0x10')](_0xf397('0x14'));});}catch(_0xe3e469){logger[_0xf397('0x15')](_0xf397('0x16'),JSON['stringify'](_0xe3e469));_0x7d0b12['terminate']();}}function _0x5db518(_0x22bb26){try{if(_0x22bb26){var _0xe6c8af=JSON['parse'](_0x22bb26);switch(_0xe6c8af[_0xf397('0x17')]){case 0x0:if(_0xe6c8af[_0xf397('0x18')]){if(_0xe6c8af[_0xf397('0x18')][_0xf397('0x19')]){logger[_0xf397('0x6')](_0xf397('0x1a'),JSON[_0xf397('0x11')](_0xe6c8af[_0xf397('0x18')][_0xf397('0x1b')]));_0x4964a7=_0xe6c8af[_0xf397('0x18')]['hypotheses'][0x0][_0xf397('0x1c')];_0x412834=_0xe6c8af['result']['hypotheses'][0x0][_0xf397('0x1d')];_0x128b82='0';_0x178f00=_0xf397('0x1e');_0x7d0b12[_0xf397('0x1f')]();}}break;case 0x1:logger['info'](_0xf397('0x9'));_0x128b82='1';_0x178f00=_0xf397('0x9');break;case 0x2:logger[_0xf397('0x6')](_0xf397('0x20'));_0x128b82='2';_0x178f00=_0xf397('0x20');break;case 0x9:logger[_0xf397('0x6')](_0xf397('0x21'));_0x128b82='9';_0x178f00=_0xf397('0x21');break;case 0xa:logger[_0xf397('0x6')](_0xf397('0x22'));_0x128b82='10';_0x178f00='Authentication\x20failed.';break;case 0xb:logger['info'](_0xf397('0x23'));_0x128b82='11';_0x178f00=_0xf397('0x23');}}}catch(_0x34a611){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xf397('0x11')](_0x34a611));_0x7d0b12[_0xf397('0x1f')]();}}function _0x3a77e6(){logger[_0xf397('0x6')](_0xf397('0x24'));_0x575a92({'transcript':_0x4964a7,'confidence':_0x412834,'status':_0x128b82,'status_message':_0x178f00});}function _0x3ef199(_0x17cace){logger[_0xf397('0x15')](_0xf397('0x25'));if(!_[_0xf397('0x26')](_0x17cace)){logger[_0xf397('0x15')](_[_0xf397('0x27')](_0x17cace)?JSON[_0xf397('0x11')](_0x17cace):_0x17cace);}}_0x7d0b12['on']('open',_0xd9000c);_0x7d0b12['on'](_0xf397('0x28'),_0x5db518);_0x7d0b12['on'](_0xf397('0x29'),_0x3a77e6);_0x7d0b12['on'](_0xf397('0x15'),_0x3ef199);});}; \ No newline at end of file +var _0xdd50=['close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','likelihood','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','isNil','isObject','message','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data'];(function(_0x33b6ac,_0x46f023){var _0x1553f7=function(_0x469a7e){while(--_0x469a7e){_0x33b6ac['push'](_0x33b6ac['shift']());}};_0x1553f7(++_0x46f023);}(_0xdd50,0x15d));var _0x0dd5=function(_0x29a08d,_0x551eca){_0x29a08d=_0x29a08d-0x0;var _0x10fc1a=_0xdd50[_0x29a08d];return _0x10fc1a;};'use strict';var BPromise=require('bluebird');var _=require(_0x0dd5('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0dd5('0x1'));var crypto=require(_0x0dd5('0x2'));var logger=require(_0x0dd5('0x3'))(_0x0dd5('0x4'));module[_0x0dd5('0x5')]=function(_0x199642,_0x517123,_0x24cd52,_0x46e9dd){return new BPromise(function(_0x1a05eb,_0x8de53f){logger[_0x0dd5('0x6')](_0x0dd5('0x7'),_0x46e9dd||_0x0dd5('0x8'));var _0x2ab5d5=new WebSocket(_0x46e9dd||_0x0dd5('0x8'),{'perMessageDeflate':![]});var _0x3e4b4c='';var _0x1ebc27='0';var _0x466f62='1';var _0x5b36c6=_0x0dd5('0x9');function _0x3bf17f(_0x354d7b){var _0xdf293a=crypto[_0x0dd5('0xa')](_0x0dd5('0xb'));_0xdf293a['update'](_0x354d7b);return _0xdf293a[_0x0dd5('0xc')](_0x0dd5('0xd'));}function _0x58d766(){try{logger[_0x0dd5('0x6')](_0x0dd5('0xe'));var _0x2ec30d=moment()[_0x0dd5('0xf')]();var _0x3ff712=_0x3bf17f(_0x2ec30d+_0x517123+_0x24cd52);_0x2ab5d5[_0x0dd5('0x10')](JSON[_0x0dd5('0x11')]({'appID':_0x517123,'timestamp':_0x2ec30d,'appKey':_0x3ff712}));var _0x2b6f34=fs[_0x0dd5('0x12')](_0x199642);_0x2b6f34['on'](_0x0dd5('0x13'),function(_0x313c16){_0x2ab5d5[_0x0dd5('0x10')](_0x313c16);});_0x2b6f34['on'](_0x0dd5('0x14'),function(){_0x2ab5d5[_0x0dd5('0x10')](_0x0dd5('0x15'));});}catch(_0x582f40){logger[_0x0dd5('0x16')](_0x0dd5('0x17'),JSON[_0x0dd5('0x11')](_0x582f40));_0x2ab5d5[_0x0dd5('0x18')]();}}function _0x123850(_0xaa0fde){try{if(_0xaa0fde){var _0x2701f8=JSON['parse'](_0xaa0fde);switch(_0x2701f8[_0x0dd5('0x19')]){case 0x0:if(_0x2701f8[_0x0dd5('0x1a')]){if(_0x2701f8[_0x0dd5('0x1a')][_0x0dd5('0x1b')]){logger['info'](_0x0dd5('0x1c'),JSON[_0x0dd5('0x11')](_0x2701f8[_0x0dd5('0x1a')]['hypotheses']));_0x3e4b4c=_0x2701f8['result']['hypotheses'][0x0][_0x0dd5('0x1d')];_0x1ebc27=_0x2701f8[_0x0dd5('0x1a')][_0x0dd5('0x1e')][0x0][_0x0dd5('0x1f')];_0x466f62='0';_0x5b36c6='Success.';_0x2ab5d5[_0x0dd5('0x18')]();}}break;case 0x1:logger[_0x0dd5('0x6')](_0x0dd5('0x9'));_0x466f62='1';_0x5b36c6=_0x0dd5('0x9');break;case 0x2:logger[_0x0dd5('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x466f62='2';_0x5b36c6=_0x0dd5('0x20');break;case 0x9:logger[_0x0dd5('0x6')](_0x0dd5('0x21'));_0x466f62='9';_0x5b36c6=_0x0dd5('0x21');break;case 0xa:logger[_0x0dd5('0x6')](_0x0dd5('0x22'));_0x466f62='10';_0x5b36c6=_0x0dd5('0x22');break;case 0xb:logger[_0x0dd5('0x6')](_0x0dd5('0x23'));_0x466f62='11';_0x5b36c6='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x517b43){logger[_0x0dd5('0x16')](_0x0dd5('0x24'),JSON['stringify'](_0x517b43));_0x2ab5d5[_0x0dd5('0x18')]();}}function _0x17f8b2(){logger[_0x0dd5('0x6')](_0x0dd5('0x25'));_0x1a05eb({'transcript':_0x3e4b4c,'confidence':_0x1ebc27,'status':_0x466f62,'status_message':_0x5b36c6});}function _0x354805(_0x298ffe){logger[_0x0dd5('0x16')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x0dd5('0x26')](_0x298ffe)){logger[_0x0dd5('0x16')](_[_0x0dd5('0x27')](_0x298ffe)?JSON['stringify'](_0x298ffe):_0x298ffe);}}_0x2ab5d5['on']('open',_0x58d766);_0x2ab5d5['on'](_0x0dd5('0x28'),_0x123850);_0x2ab5d5['on'](_0x0dd5('0x14'),_0x17f8b2);_0x2ab5d5['on'](_0x0dd5('0x16'),_0x354805);});}; \ 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 107767f..ac55c2e 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 _0x34e8=['./asr','exports'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_0x34e8,0x12c));var _0x834e=function(_0x10ade4,_0x283c1f){_0x10ade4=_0x10ade4-0x0;var _0x2c5b6a=_0x34e8[_0x10ade4];return _0x2c5b6a;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x34e8,0x12c));var _0x834e=function(_0x4fc7df,_0x11ade8){_0x4fc7df=_0x4fc7df-0x0;var _0x13db3e=_0x34e8[_0x4fc7df];return _0x13db3e;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 997757b..6d98ab2 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 _0x78d2=['nextTick','inherits','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE'];(function(_0x19e241,_0x59e769){var _0x375cd5=function(_0x5b50ba){while(--_0x5b50ba){_0x19e241['push'](_0x19e241['shift']());}};_0x375cd5(++_0x59e769);}(_0x78d2,0x1c4));var _0x278d=function(_0x3f6587,_0x4025b0){_0x3f6587=_0x3f6587-0x0;var _0x263b33=_0x78d2[_0x3f6587];return _0x263b33;};'use strict';var util=require(_0x278d('0x0'));var net=require(_0x278d('0x1'));var EventEmitter=require(_0x278d('0x2'))[_0x278d('0x3')];var AGIError=require(_0x278d('0x4'));var AGIChannel=require(_0x278d('0x5'));var AGIServer=function(_0x572e67,_0x4dd724,_0x1a0172){var _0xe2a9c8=this,_0x572e67=_0x572e67||0x11dd,_0x4dd724=_0x4dd724||_0x278d('0x6'),_0x2c9c36=null,_0x1b6ffc=0x0;EventEmitter[_0x278d('0x7')](_0xe2a9c8);function _0x2fcb89(){if(!_0x572e67){_0xe2a9c8[_0x278d('0x8')](_0x278d('0x9'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x2c9c36=net[_0x278d('0xa')]();_0x2c9c36[_0x278d('0xb')](_0x572e67,_0x4dd724);_0x2c9c36['on']('listening',function(){_0xe2a9c8[_0x278d('0x8')](_0x278d('0xc'));});_0x2c9c36['on'](_0x278d('0xd'),function(_0x340db5){_0x2c9c36[_0x278d('0xe')](function(_0xd5306e,_0x473a5e){if(_0xd5306e){_0xe2a9c8[_0x278d('0x8')](_0x278d('0x9'),new AGIError(_0x278d('0xf'),_0xd5306e));}else if(_0x1a0172&&_0x1a0172<0x0){_0xe2a9c8[_0x278d('0x8')](_0x278d('0x9'),new AGIError(_0x278d('0x10')));_0x340db5[_0x278d('0x11')]();}else if(_0x1a0172&&_0x1a0172>0x0&&_0x1a0172<_0x473a5e){_0x1b6ffc+=0x1;_0xe2a9c8[_0x278d('0x8')](_0x278d('0x9'),new AGIError(_0x278d('0x12'),_0x1b6ffc));_0x340db5[_0x278d('0x11')]();}else{var _0x1e60fd=new AGIChannel(_0x340db5);_0x1e60fd['on'](_0x278d('0x13'),function(){_0xe2a9c8[_0x278d('0x8')](_0x278d('0xd'),_0x1e60fd);});}});});_0x2c9c36['on'](_0x278d('0x9'),function(_0xaffcd2){_0xe2a9c8[_0x278d('0x8')](_0x278d('0x9'),new AGIError(_0x278d('0xf'),_0xaffcd2[_0x278d('0x14')]));});_0x2c9c36['on'](_0x278d('0x15'),function(){_0xe2a9c8['emit']('close',new AGIError(_0x278d('0x16')));});}process[_0x278d('0x17')](function(){_0x2fcb89();});};util[_0x278d('0x18')](AGIServer,EventEmitter);module['exports']=function(_0x1bffa7,_0x49c279,_0x338ea1){return new AGIServer(_0x1bffa7,_0x49c279,_0x338ea1);}; \ No newline at end of file +var _0x3e33=['nextTick','inherits','exports','util','events','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3e33,0x137));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x33e3('0x0'));var net=require('net');var EventEmitter=require(_0x33e3('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x33e3('0x2'));var AGIServer=function(_0xa5cb8f,_0x5aec2f,_0x555a79){var _0x5d49a2=this,_0xa5cb8f=_0xa5cb8f||0x11dd,_0x5aec2f=_0x5aec2f||_0x33e3('0x3'),_0x3d4093=null,_0x85c38e=0x0;EventEmitter[_0x33e3('0x4')](_0x5d49a2);function _0x36da59(){if(!_0xa5cb8f){_0x5d49a2[_0x33e3('0x5')](_0x33e3('0x6'),new AGIError(_0x33e3('0x7')));return![];}_0x3d4093=net['createServer']();_0x3d4093[_0x33e3('0x8')](_0xa5cb8f,_0x5aec2f);_0x3d4093['on'](_0x33e3('0x9'),function(){_0x5d49a2[_0x33e3('0x5')](_0x33e3('0x9'));});_0x3d4093['on'](_0x33e3('0xa'),function(_0x31652e){_0x3d4093[_0x33e3('0xb')](function(_0x101f2,_0x2a6dc0){if(_0x101f2){_0x5d49a2['emit'](_0x33e3('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x101f2));}else if(_0x555a79&&_0x555a79<0x0){_0x5d49a2[_0x33e3('0x5')]('error',new AGIError(_0x33e3('0xc')));_0x31652e[_0x33e3('0xd')]();}else if(_0x555a79&&_0x555a79>0x0&&_0x555a79<_0x2a6dc0){_0x85c38e+=0x1;_0x5d49a2['emit'](_0x33e3('0x6'),new AGIError(_0x33e3('0xe'),_0x85c38e));_0x31652e[_0x33e3('0xd')]();}else{var _0x4ccc79=new AGIChannel(_0x31652e);_0x4ccc79['on'](_0x33e3('0xf'),function(){_0x5d49a2[_0x33e3('0x5')](_0x33e3('0xa'),_0x4ccc79);});}});});_0x3d4093['on'](_0x33e3('0x6'),function(_0x3e2859){_0x5d49a2['emit']('error',new AGIError(_0x33e3('0x10'),_0x3e2859['code']));});_0x3d4093['on'](_0x33e3('0x11'),function(){_0x5d49a2[_0x33e3('0x5')](_0x33e3('0x11'),new AGIError(_0x33e3('0x12')));});}process[_0x33e3('0x13')](function(){_0x36da59();});};util[_0x33e3('0x14')](AGIServer,EventEmitter);module[_0x33e3('0x15')]=function(_0x1bdfbd,_0x4485c4,_0x402b52){return new AGIServer(_0x1bdfbd,_0x4485c4,_0x402b52);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 3c55b54..638e01c 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 _0x8375=['Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','%s/recordings/%s','%s.%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','wav','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','auth','pass','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','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','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','odbc','randomstring','moment','mustache','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','map','getSoundPath','format','getQueryOdbc','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','callerid','context','extension','priority','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','error','agent','agentUnpause','agentLogout','agentLogin','LOCAL','exec','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','includes','hasOwnProperty','replaceAllVariables','split','length','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','list_id','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','application','options','noop','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','query','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','DIAL','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','audiofile','unlink','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','stringify','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal'];(function(_0x4f0fdb,_0x2d4bbe){var _0x199e0e=function(_0x5fca92){while(--_0x5fca92){_0x4f0fdb['push'](_0x4f0fdb['shift']());}};_0x199e0e(++_0x2d4bbe);}(_0x8375,0xa8));var _0x5837=function(_0x4ba752,_0x49bbe9){_0x4ba752=_0x4ba752-0x0;var _0x34e1e0=_0x8375[_0x4ba752];return _0x34e1e0;};'use strict';var fs=require('fs');var path=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var _=require(_0x5837('0x2'));var sh=require('shelljs');var odbc=require(_0x5837('0x3'))();var rs=require(_0x5837('0x4'));var moment=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var logger=require(_0x5837('0x7'))(_0x5837('0x8'));var config=require('../../config/environment');var scripts=require(_0x5837('0x9'));var FILES_PATH=_0x5837('0xa');var verticesWithRetry=[_0x5837('0xb'),_0x5837('0xc'),_0x5837('0xd')];var AGIVertices=function(_0x5bc421,_0x508caf,_0x1e44c4){this[_0x5837('0xe')]=_0x5bc421;this['rpc']=_0x508caf;this[_0x5837('0xf')]=_0x1e44c4;};AGIVertices['prototype'][_0x5837('0x10')]=function(_0x383e5e,_0x11cd29){this[_0x5837('0x11')][_0x5837('0x12')](_0x383e5e)[_0x5837('0x13')](function(_0x5ec2fe){_0x11cd29(null,_0x5ec2fe?_0x5ec2fe[_0x5837('0x14')]:![]);})[_0x5837('0x15')](function(_0x1b0a4d){_0x11cd29(_0x1b0a4d);});};AGIVertices[_0x5837('0x16')][_0x5837('0x17')]=function(_0x485366,_0x533962){this['rpc'][_0x5837('0x18')](_0x485366)[_0x5837('0x13')](function(_0x469903){_0x533962(null,_0x469903?_0x469903[_0x5837('0x14')]:![]);})[_0x5837('0x15')](function(_0x2a7d71){_0x533962(_0x2a7d71);});};AGIVertices[_0x5837('0x16')][_0x5837('0x19')]=function(_0x10d882,_0x59a378){this[_0x5837('0x11')][_0x5837('0x1a')](_0x10d882)['then'](function(_0xcb5fce){_0x59a378(null,_0xcb5fce?_0xcb5fce[_0x5837('0x14')]:![]);})[_0x5837('0x15')](function(_0x49279d){_0x59a378(_0x49279d);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x38d0c9,_0x3a5386){this[_0x5837('0x11')]['getSquareOdbcById'](_0x38d0c9)[_0x5837('0x13')](function(_0x178c4c){_0x3a5386(null,_0x178c4c?_0x178c4c[_0x5837('0x1b')]:![]);})[_0x5837('0x15')](function(_0x5881ff){_0x3a5386(_0x5881ff);});};AGIVertices['prototype']['getUser']=function(_0x3d352f,_0x5475c3){this[_0x5837('0x11')][_0x5837('0x1c')](_0x3d352f)[_0x5837('0x13')](function(_0x3a7efe){_0x5475c3(null,_0x3a7efe?_0x3a7efe['name']:![]);})['catch'](function(_0x1b80db){_0x5475c3(_0x1b80db);});};AGIVertices[_0x5837('0x16')][_0x5837('0x1d')]=function(_0x5e8089,_0x7a6232){this[_0x5837('0x11')][_0x5837('0x1e')](_0x5e8089)['then'](function(_0x41f86a){_0x7a6232(null,_0x41f86a?_0x41f86a[_0x5837('0x14')]:![]);})[_0x5837('0x15')](function(_0x58905c){_0x7a6232(_0x58905c);});};AGIVertices['prototype'][_0x5837('0x1f')]=function(_0x15655e,_0x23a4e3){var _0x2ae6a0=this;this[_0x5837('0x11')][_0x5837('0x20')](_0x15655e)[_0x5837('0x13')](function(_0x2ee271){_0x23a4e3(null,_0x2ee271?_0x2ae6a0['getSoundPath'](_0x2ee271[_0x5837('0x21')]):![]);})[_0x5837('0x15')](function(_0x3cbd3f){_0x23a4e3(_0x3cbd3f);});};AGIVertices[_0x5837('0x16')][_0x5837('0x22')]=function(_0x228f1,_0x1761c1){this[_0x5837('0x11')]['getMailAccountById'](_0x228f1)['then'](function(_0xeaaabb){_0x1761c1(null,_0xeaaabb?_0xeaaabb:![]);})[_0x5837('0x15')](function(_0x5ab246){_0x1761c1(_0x5ab246);});};AGIVertices[_0x5837('0x16')][_0x5837('0x23')]=function(_0x493b46,_0xb3a22e,_0x2554bb){this[_0x5837('0xf')]['sendMailMessage'](_0x493b46,_0xb3a22e)['then'](function(){_0x2554bb(null);})['catch'](function(_0x24bcc7){_0x2554bb(_0x24bcc7);});};AGIVertices[_0x5837('0x16')][_0x5837('0x24')]=function(_0x1902a4,_0x1c0eca){this['rpc']['getIntervalById'](_0x1902a4)[_0x5837('0x13')](function(_0x3bb513){if(_0x3bb513){if(_0x3bb513['IntervalId']){_0x1c0eca(null,[_0x3bb513['interval']]);}else{_0x1c0eca(null,_[_0x5837('0x25')](_0x3bb513['Intervals'],'interval'));}}else{_0x1c0eca(null,![]);}})[_0x5837('0x15')](function(_0x330acc){_0x1c0eca(_0x330acc);});};AGIVertices['prototype'][_0x5837('0x26')]=function(_0x323981){return util[_0x5837('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x323981);};AGIVertices[_0x5837('0x16')][_0x5837('0x28')]=function(_0xc90d35,_0x364381,_0x36c3e1){odbc['open'](_0xc90d35,function(_0x1d48c8){if(_0x1d48c8){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1d48c8);_0x36c3e1(_0x1d48c8);}else{logger[_0x5837('0x29')](_0x5837('0x2a'));odbc['query'](_0x364381,function(_0x3d00e9,_0x3d186b){if(_0x3d00e9){logger[_0x5837('0x29')](_0x5837('0x2b'),_0x364381);_0x36c3e1(_0x3d00e9);}else{logger['info'](_0x5837('0x2c'),_0x364381);odbc[_0x5837('0x2d')](function(_0x457394){if(_0x457394){logger['error'](_0x5837('0x2e'),_0x457394);}_0x36c3e1(null,_0x3d186b);});}});}});};AGIVertices[_0x5837('0x16')][_0x5837('0x2f')]=function(_0x31710b,_0x422953){this[_0x5837('0x11')][_0x5837('0x30')](_0x31710b)[_0x5837('0x13')](function(_0x323762){_0x422953(null,_0x323762?_0x323762:![]);})[_0x5837('0x15')](function(_0x1a5e2d){_0x422953(_0x1a5e2d);});};AGIVertices[_0x5837('0x16')]['createSmsMessage']=function(_0x5ef1be,_0x12f5f9){this[_0x5837('0x11')]['createSmsMessage'](_0x5ef1be)[_0x5837('0x13')](function(_0x1ae168){_0x12f5f9(null,_0x1ae168);})[_0x5837('0x15')](function(_0x581e6a){_0x12f5f9(_0x581e6a);});};AGIVertices[_0x5837('0x16')][_0x5837('0x31')]=function(_0x1c81ed,_0x3acdf5,_0x4643e3){this[_0x5837('0x11')][_0x5837('0x31')]({'uniqueid':this[_0x5837('0xe')][_0x5837('0x32')],'node':_0x1c81ed['label'],'application':_0x1c81ed[_0x5837('0x33')],'data':_0x3acdf5||null,'project_name':this[_0x5837('0xe')][_0x5837('0x34')],'callerid':this['channel']['callerid']})[_0x5837('0x13')](function(_0x160a2c){if(_0x4643e3){_0x4643e3(null,_0x160a2c);}})[_0x5837('0x15')](function(_0x3bb280){if(_0x4643e3){_0x4643e3(_0x3bb280);}});};AGIVertices[_0x5837('0x16')][_0x5837('0x35')]=function(_0x368e80,_0x44b07f,_0x45ae2c,_0x3aaa7b){this[_0x5837('0x11')][_0x5837('0x35')]({'uniqueid':this['channel'][_0x5837('0x32')],'callerid':this['channel'][_0x5837('0x36')],'calleridname':this[_0x5837('0xe')]['calleridname'],'context':this[_0x5837('0xe')][_0x5837('0x37')],'extension':this['channel'][_0x5837('0x38')],'priority':this[_0x5837('0xe')][_0x5837('0x39')],'accountcode':this[_0x5837('0xe')]['accountcode'],'dnid':this['channel'][_0x5837('0x3a')],'projectName':this[_0x5837('0xe')]['arg_1'],'saveName':_0x44b07f,'filename':_0x368e80['file']||_0x44b07f,'savePath':_0x45ae2c})['then'](function(_0x5c2d6f){_0x3aaa7b(null,_0x5c2d6f);})[_0x5837('0x15')](function(_0x6423f2){_0x3aaa7b(_0x6423f2);});};AGIVertices[_0x5837('0x16')]['createSquareMessage']=function(_0x4eaac2,_0xc9d31a,_0xe1e6c4){this[_0x5837('0x11')][_0x5837('0x3b')]({'uniqueid':this[_0x5837('0xe')][_0x5837('0x32')],'body':_0x4eaac2,'direction':_0xc9d31a})[_0x5837('0x13')](function(_0x20bdd4){if(_0xe1e6c4){_0xe1e6c4(null,_0x20bdd4);}})[_0x5837('0x15')](function(_0x38743a){if(_0xe1e6c4){_0xe1e6c4(_0x38743a);}});};AGIVertices['prototype'][_0x5837('0x3c')]=function(_0x3b0b80,_0x574bd4){this[_0x5837('0x11')][_0x5837('0x3c')]({'firstName':_[_0x5837('0x3d')](_0x3b0b80[_0x5837('0x14')])||_[_0x5837('0x3e')](_0x3b0b80['name'])?_0x5837('0x3f')+Math[_0x5837('0x40')]():_0x3b0b80[_0x5837('0x14')],'lastName':_[_0x5837('0x3d')](_0x3b0b80[_0x5837('0x41')])||_[_0x5837('0x3e')](_0x3b0b80['lastName'])?null:_0x3b0b80[_0x5837('0x41')],'phone':_0x3b0b80['phone'],'ListId':_0x3b0b80['list_id'],'scheduledAt':_0x3b0b80[_0x5837('0x42')],'callbackUniqueid':this['channel'][_0x5837('0x32')],'tags':_0x5837('0x43'),'description':_0x5837('0x44')+_0x3b0b80['scheduledAt'][_0x5837('0x45')](),'priority':_0x3b0b80[_0x5837('0x46')]})[_0x5837('0x13')](function(_0x49cd9b){_0x574bd4(null,_0x49cd9b);})[_0x5837('0x15')](function(_0x4c1079){_0x574bd4(_0x4c1079);});};AGIVertices[_0x5837('0x16')][_0x5837('0x47')]=function(_0x201cde,_0x43703a){this[_0x5837('0x11')]['getPauseById'](_0x201cde)[_0x5837('0x13')](function(_0x33ecc6){_0x43703a(null,_0x33ecc6?_0x33ecc6['name']:![]);})[_0x5837('0x15')](function(_0xd052d6){_0x43703a(_0xd052d6);});};AGIVertices[_0x5837('0x16')]['agentPause']=function(_0x5787ba,_0x1e24cd,_0x3b19c8){var _0x3a948f={'role':'agent'};_0x3a948f[_0x5787ba]=this[_0x5837('0xe')][_0x5837('0x36')];this['rpc'][_0x5837('0x48')](_0x3a948f,_0x1e24cd,this['channel']['uniqueid'])[_0x5837('0x13')](function(_0xa8d156){_0x3b19c8(null,_['isNil'](_0xa8d156)?![]:!![]);})[_0x5837('0x15')](function(_0x3c552a){logger[_0x5837('0x49')](_0x3c552a);_0x3b19c8(null,![]);});};AGIVertices[_0x5837('0x16')]['agentUnpause']=function(_0x430a0e,_0x5b9fc7){var _0x120631={'role':_0x5837('0x4a')};_0x120631[_0x430a0e]=this[_0x5837('0xe')]['callerid'];this[_0x5837('0x11')][_0x5837('0x4b')](_0x120631)['then'](function(_0x172e79){_0x5b9fc7(null,_['isNil'](_0x172e79)?![]:!![]);})[_0x5837('0x15')](function(_0x2a7981){logger[_0x5837('0x49')](_0x2a7981);_0x5b9fc7(null,![]);});};AGIVertices[_0x5837('0x16')][_0x5837('0x4c')]=function(_0x175e8c,_0x54fb71){var _0x3c88b4={'role':_0x5837('0x4a')};_0x3c88b4[_0x175e8c]=this[_0x5837('0xe')][_0x5837('0x36')];this[_0x5837('0x11')]['agentLogout'](_0x3c88b4)[_0x5837('0x13')](function(_0x523a68){_0x54fb71(null,_[_0x5837('0x3e')](_0x523a68)?![]:!![]);})[_0x5837('0x15')](function(_0x263ccb){logger['error'](_0x263ccb);_0x54fb71(null,![]);});};AGIVertices[_0x5837('0x16')][_0x5837('0x4d')]=function(_0x2f8282,_0x46aeeb){var _0x4af185={'role':'agent'};_0x4af185[_0x2f8282]=this[_0x5837('0xe')][_0x5837('0x36')];var _0x15e503=_0x2f8282!='internal'?util[_0x5837('0x27')]('%s/%s@from-sip/n',_0x5837('0x4e'),this[_0x5837('0xe')][_0x5837('0x36')]):undefined;this[_0x5837('0x11')]['agentLogin'](_0x4af185,_0x15e503)['then'](function(_0x56f7e1){_0x46aeeb(null,_[_0x5837('0x3e')](_0x56f7e1)?![]:!![]);})['catch'](function(_0x62aaae){logger[_0x5837('0x49')](_0x62aaae);_0x46aeeb(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x1c8679,_0x473a02){sh[_0x5837('0x4f')](_[_0x5837('0x50')](_0x1c8679),function(_0x1d065d,_0x2d5ff3){var _0x126bea=_0x2d5ff3[_0x5837('0x51')](/(\r\n|\n|\r)/gm,'');_0x473a02(null,_0x126bea);});};AGIVertices[_0x5837('0x16')][_0x5837('0x52')]=function(_0x1cf801,_0x162c2c){scripts['googleTTS'](_0x1cf801[_0x5837('0x53')],_0x1cf801[_0x5837('0x54')]||'en',0x1)[_0x5837('0x13')](function(_0x1e433d){_0x162c2c(null,_0x1e433d);})[_0x5837('0x15')](function(_0xe94b4){_0x162c2c(_0xe94b4);});};AGIVertices[_0x5837('0x16')][_0x5837('0x55')]=function(_0x52b517,_0xf74ccf){scripts[_0x5837('0x55')](this[_0x5837('0xe')][_0x5837('0x32')],_0x52b517[_0x5837('0x56')],_0x52b517['text'],_0x52b517[_0x5837('0x57')]||'en')[_0x5837('0x13')](function(_0x2ddbb0){_0xf74ccf(null,_0x2ddbb0);})[_0x5837('0x15')](function(_0x2d0cee){_0xf74ccf(_0x2d0cee);});};AGIVertices['prototype'][_0x5837('0x58')]=function(_0x562e69,_0x4f74a2){scripts[_0x5837('0x58')](this[_0x5837('0xe')],_0x562e69)[_0x5837('0x13')](function(_0x3a0ccc){_0x4f74a2(null,_0x3a0ccc);})[_0x5837('0x15')](function(_0x35ff75){_0x4f74a2(_0x35ff75);});};AGIVertices['prototype']['ispeechTTS']=function(_0x6e74b,_0x163023){scripts[_0x5837('0x59')](_0x6e74b[_0x5837('0x56')],_0x6e74b[_0x5837('0x53')],_0x6e74b['ispeech_tts_language']||_0x5837('0x5a'),_0x6e74b[_0x5837('0x5b')])['then'](function(_0x53d223){_0x163023(null,_0x53d223);})[_0x5837('0x15')](function(_0x3c5d65){_0x163023(_0x3c5d65);});};AGIVertices[_0x5837('0x16')]['ispeechASR']=function(_0x256e97,_0x3403d0,_0x590cac){scripts[_0x5837('0x5c')](_0x3403d0,_0x256e97[_0x5837('0x56')],_0x256e97[_0x5837('0x5d')]||_0x5837('0x5a'),this[_0x5837('0x5e')](_0x256e97['model'])?_0x256e97[_0x5837('0x5f')]:undefined)[_0x5837('0x13')](function(_0x196422){_0x590cac(null,_0x196422);})[_0x5837('0x15')](function(_0xb5fa5){_0x590cac(_0xb5fa5);});};AGIVertices[_0x5837('0x16')][_0x5837('0x60')]=function(_0x59edfc,_0x5f2d84){scripts[_0x5837('0x60')](_0x59edfc[_0x5837('0x61')],_0x59edfc[_0x5837('0x62')],_0x59edfc[_0x5837('0x63')],_0x59edfc[_0x5837('0x64')]||_0x5837('0x65'),_0x59edfc[_0x5837('0x53')],_0x59edfc['aws_text_type']||'text')[_0x5837('0x13')](function(_0x243a28){_0x5f2d84(null,_0x243a28);})[_0x5837('0x15')](function(_0x2c0d28){_0x5f2d84(_0x2c0d28);});};AGIVertices[_0x5837('0x16')]['awsLex']=function(_0x272391,_0x3c4509){scripts[_0x5837('0x66')](this[_0x5837('0xe')][_0x5837('0x32')],_0x272391[_0x5837('0x61')],_0x272391[_0x5837('0x62')],_0x272391[_0x5837('0x67')],_0x272391[_0x5837('0x53')],_0x272391[_0x5837('0x68')])[_0x5837('0x13')](function(_0x570a01){_0x3c4509(null,_0x570a01);})[_0x5837('0x15')](function(_0x57993a){_0x3c4509(_0x57993a);});};AGIVertices[_0x5837('0x16')][_0x5837('0x69')]=function(_0x2dcfff,_0x508f6c,_0x57331f){scripts[_0x5837('0x69')](_0x508f6c,_0x2dcfff['key'],_0x2dcfff[_0x5837('0x6a')]||_0x5837('0x5a'))[_0x5837('0x13')](function(_0x1eadc8){_0x57331f(null,_0x1eadc8);})[_0x5837('0x15')](function(_0x4d274d){_0x57331f(_0x4d274d);});};AGIVertices[_0x5837('0x16')][_0x5837('0x6b')]=function(_0x3f121a,_0xe93b29,_0x5add5b){scripts[_0x5837('0x6b')](_0xe93b29,_0x3f121a[_0x5837('0x6c')],_0x3f121a[_0x5837('0x6d')],_0x3f121a['uri'])[_0x5837('0x13')](function(_0x2abb2c){_0x5add5b(null,_0x2abb2c);})[_0x5837('0x15')](function(_0x4952e1){_0x5add5b(_0x4952e1);});};AGIVertices['prototype']['clear']=function(_0x3e02d8){var _0x5c42a8=_[_0x5837('0x6e')](verticesWithRetry,_0x3e02d8[_0x5837('0x33')])?_0x3e02d8:_['clone'](_0x3e02d8);for(var _0x3a1a2f in _0x5c42a8){if(_0x5c42a8[_0x5837('0x6f')](_0x3a1a2f)){if(_0x5c42a8[_0x3a1a2f]&&_['isString'](_0x5c42a8[_0x3a1a2f])){_0x5c42a8[_0x3a1a2f]=this['replaceAllVariables'](_0x5c42a8[_0x3a1a2f]);}}}return _0x5c42a8;};AGIVertices[_0x5837('0x16')][_0x5837('0x70')]=function(_0x23b119){var _0x1d9ea2=_0x23b119[_0x5837('0x71')]('{');for(var _0x1e4fde=0x1;_0x1e4fde<_0x1d9ea2[_0x5837('0x72')];_0x1e4fde+=0x1){var _0x1f4f30=_0x1d9ea2[_0x1e4fde][_0x5837('0x71')]('}');if(_0x1f4f30[_0x5837('0x72')]>0x1){_0x23b119=_0x23b119['replaceAll']('{'+_0x1f4f30[0x0]+'}',this[_0x5837('0xe')][_0x5837('0x10')](_0x1f4f30[0x0])['extra']||_0x1f4f30[0x0]);}}if(_0x1d9ea2[_0x5837('0x72')]===0x1){return _0x23b119[_0x5837('0x45')]();}return this[_0x5837('0x70')](_0x23b119);};AGIVertices[_0x5837('0x16')][_0x5837('0x73')]=function(_0xe6482d,_0x4c6354){var _0x17b7aa=this[_0x5837('0xe')]['getVariable'](_0xe6482d);if(_0x17b7aa[_0x5837('0x74')]===-0x1){return _0x17b7aa;}logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x75'),_0x4c6354,_0x17b7aa[_0x5837('0x76')]));return this[_0x5837('0xe')]['setVariable'](_0x4c6354,_0x17b7aa[_0x5837('0x76')]);};AGIVertices[_0x5837('0x16')][_0x5837('0x5e')]=function(_0x2f1cde){return _0x2f1cde&&_0x2f1cde!=='0'&&_0x2f1cde!=='-1'&&_0x2f1cde!=='';};AGIVertices[_0x5837('0x16')][_0x5837('0x77')]=function(_0x5737b0){this[_0x5837('0x31')][_0x5837('0x78')](this,_0x5737b0,'-');_0x5737b0[_0x5837('0x79')]=_0x5737b0[_0x5837('0x77')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x5837('0x8')]=function(_0x2b5856){logger['info'](util[_0x5837('0x27')](_0x5837('0x7a'),_0x2b5856[_0x5837('0x7b')]));return this[_0x5837('0xe')]['agi']([_0x2b5856[_0x5837('0x7c')],_0x2b5856[_0x5837('0x7d')]]);};AGIVertices[_0x5837('0x16')][_0x5837('0x7e')]=function(_0x411481){logger[_0x5837('0x29')](util['format'](_0x5837('0x7f'),_0x411481['label']));if(this[_0x5837('0x5e')](_0x411481[_0x5837('0x80')])){logger['info'](util[_0x5837('0x27')](_0x5837('0x81'),_0x411481[_0x5837('0x80')]));var _0x4f7c15=this[_0x5837('0xe')][_0x5837('0x82')](_0x411481['timeout']);if(_0x4f7c15[_0x5837('0x74')]===-0x1){return _0x4f7c15;}}return this[_0x5837('0xe')][_0x5837('0x7e')]();};AGIVertices[_0x5837('0x16')][_0x5837('0x43')]=function(_0x36f789){logger[_0x5837('0x29')](util[_0x5837('0x27')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x36f789[_0x5837('0x7b')]));if(!this['isConfigured'](_0x36f789[_0x5837('0x83')])){return this[_0x5837('0xe')]['error'](_0x36f789,'no\x20list\x20selected');}_0x36f789['scheduledAt']=moment();if(this[_0x5837('0x5e')](_0x36f789[_0x5837('0x84')])){_0x36f789['scheduledAt']=moment()[_0x5837('0x85')](_0x36f789[_0x5837('0x84')],'minutes');}if(!this[_0x5837('0x5e')](_0x36f789['callback_priority'])){_0x36f789[_0x5837('0x46')]=0x2;}this['createCmContact']['sync'](this,_0x36f789);return this['channel']['noop'](util[_0x5837('0x27')](_0x5837('0x86'),_0x36f789[_0x5837('0x87')],_0x36f789[_0x5837('0x83')],_0x36f789[_0x5837('0x42')]));};AGIVertices[_0x5837('0x16')]['custom_app']=function(_0x112e89){logger[_0x5837('0x29')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x112e89[_0x5837('0x7b')]));var _0x2e6370=this['channel'][_0x5837('0x4f')](_0x112e89[_0x5837('0x88')],_0x112e89[_0x5837('0x89')]);if(_0x2e6370[_0x5837('0x74')]===-0x1){return _0x2e6370;}return this[_0x5837('0xe')][_0x5837('0x8a')](util['format'](_0x5837('0x8b'),_0x112e89[_0x5837('0x88')],_0x112e89['options']));};AGIVertices[_0x5837('0x16')][_0x5837('0x8c')]=function(_0x19cead){logger[_0x5837('0x29')](util['format'](_0x5837('0x8d'),_0x19cead['label']));if(!this['isConfigured'](_0x19cead[_0x5837('0x53')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0x8e'));}var _0x4165ec='\x22'+_0x19cead[_0x5837('0x53')]+'\x22';if(this[_0x5837('0x5e')](_0x19cead['options'])){_0x4165ec+=','+_0x19cead[_0x5837('0x89')];}var _0x7da352=this[_0x5837('0xe')][_0x5837('0x4f')](_0x5837('0x8f'),_0x4165ec);if(_0x7da352[_0x5837('0x74')]===-0x1){return _0x7da352;}return this[_0x5837('0xe')][_0x5837('0x8a')](util['format'](_0x5837('0x90'),_0x4165ec));};AGIVertices['prototype'][_0x5837('0x91')]=function(_0xc7ca56){logger[_0x5837('0x29')](util['format'](_0x5837('0x92'),_0xc7ca56[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0xc7ca56[_0x5837('0x53')])){return this[_0x5837('0xe')][_0x5837('0x8a')]('no\x20text\x20configured');}var _0x4bdd27='\x22'+_0xc7ca56[_0x5837('0x53')]+'\x22';if(this[_0x5837('0x5e')](_0xc7ca56[_0x5837('0x89')])){_0x4bdd27+=','+_0xc7ca56[_0x5837('0x89')];}var _0x1d766b=this[_0x5837('0xe')]['exec'](_0x5837('0x8f'),_0x4bdd27);if(_0x1d766b[_0x5837('0x74')]===-0x1){return _0x1d766b;}return this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0x90'),_0x4bdd27));};AGIVertices[_0x5837('0x16')][_0x5837('0x93')]=function(_0x403837){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x94'),_0x403837[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x403837[_0x5837('0x95')])){return this[_0x5837('0xe')]['noop'](_0x5837('0x96'));}var _0x15e300=_0x403837['grammar'];if(this[_0x5837('0x5e')](_0x403837[_0x5837('0x89')])){_0x15e300+=','+_0x403837[_0x5837('0x89')];}var _0x1dcd46=this[_0x5837('0xe')][_0x5837('0x4f')](_0x5837('0x97'),_0x15e300);if(_0x1dcd46[_0x5837('0x74')]===-0x1){return _0x1dcd46;}var _0x37c3ce=this[_0x5837('0x73')](_0x5837('0x98'),_0x5837('0x99'));if(_0x37c3ce['result']===-0x1){return _0x37c3ce;}var _0xa03772=this[_0x5837('0x73')](_0x5837('0x9a'),_0x5837('0x9b'));if(_0xa03772[_0x5837('0x74')]===-0x1){return _0xa03772;}var _0x2424e3=this[_0x5837('0x73')](_0x5837('0x9c'),_0x5837('0x9d'));if(_0x2424e3[_0x5837('0x74')]===-0x1){return _0x2424e3;}return this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x9e'),_0x15e300));};AGIVertices['prototype'][_0x5837('0x9f')]=function(_0xbdfc57){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0xa0'),_0xbdfc57[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0xbdfc57[_0x5837('0x95')])){return this[_0x5837('0xe')][_0x5837('0x8a')]('no\x20grammar\x20configured');}var _0x1becf5=_0xbdfc57[_0x5837('0x95')];if(this[_0x5837('0x5e')](_0xbdfc57['options'])){_0x1becf5+=','+_0xbdfc57[_0x5837('0x89')];}var _0x2a2309=this['channel'][_0x5837('0x4f')](_0x5837('0x97'),_0x1becf5);if(_0x2a2309['result']===-0x1){return _0x2a2309;}var _0x227ea4=this[_0x5837('0x73')](_0x5837('0x98'),_0x5837('0xa1'));if(_0x227ea4[_0x5837('0x74')]===-0x1){return _0x227ea4;}var _0x2e8023=this['getAndSetVariable'](_0x5837('0x9a'),_0x5837('0xa2'));if(_0x2e8023['result']===-0x1){return _0x2e8023;}var _0x4fb034=this['getAndSetVariable'](_0x5837('0x9c'),'SESTEK_ASR_INSTANCE');if(_0x4fb034[_0x5837('0x74')]===-0x1){return _0x4fb034;}return this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0x9e'),_0x1becf5));};AGIVertices[_0x5837('0x16')]['database']=function(_0x3a5c7f){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0xa3'),_0x3a5c7f[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x3a5c7f[_0x5837('0xa4')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x3a5c7f,_0x5837('0xa5'));}var _0x81e10b=this[_0x5837('0xa6')][_0x5837('0x78')](this,_0x3a5c7f[_0x5837('0xa4')]);if(!_0x81e10b){return this[_0x5837('0xe')][_0x5837('0x49')](_0x3a5c7f,'no\x20odbc\x20database\x20found');}if(!this[_0x5837('0x5e')](_0x3a5c7f[_0x5837('0xa7')])){return this[_0x5837('0xe')]['error'](_0x3a5c7f,_0x5837('0xa8'));}var _0x38e563=_0x3a5c7f[_0x5837('0xa7')][_0x5837('0x51')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0x5837('0xa9'),_0x38e563));var _0x657084=this['getQueryOdbc'][_0x5837('0x78')](this,_0x81e10b,_0x38e563);this[_0x5837('0x31')][_0x5837('0x78')](this,_0x3a5c7f,_0x38e563);if(!this[_0x5837('0x5e')](_0x3a5c7f['variable_id'])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0xaa'));}var _0x17f07a=this[_0x5837('0x10')][_0x5837('0x78')](this,_0x3a5c7f['variable_id']);if(!_0x17f07a){return this[_0x5837('0xe')]['error'](_0x3a5c7f,_0x5837('0xab'));}var _0x1fd0b7=this;_0x657084[_0x5837('0xac')](function(_0x4f4f09,_0x6e7e51){Object['keys'](_0x4f4f09)[_0x5837('0xac')](function(_0x1f2a1f){_0x1fd0b7[_0x5837('0xe')]['setVariable'](util['format'](_0x5837('0xad'),_0x17f07a,_0x6e7e51,_0x1f2a1f),_0x4f4f09[_0x1f2a1f]);});});this[_0x5837('0xe')][_0x5837('0xae')](util[_0x5837('0x27')](_0x5837('0xaf'),_0x17f07a),_0x657084[_0x5837('0x72')]);return this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0xb0'),_0x17f07a));};AGIVertices['prototype']['dial']=function(_0x396f36){logger[_0x5837('0xb1')](util['format'](_0x5837('0xb2'),_0x396f36[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x396f36['sip_id'])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x396f36,_0x5837('0xb3'));}var _0x53e5e4=this[_0x5837('0xb4')]['sync'](this,_0x396f36[_0x5837('0xb5')]);if(!_0x53e5e4){return this[_0x5837('0xe')][_0x5837('0x49')](_0x396f36,'no\x20user\x20found');}var _0x5efefd=this[_0x5837('0xe')]['exec'](_0x5837('0xb6'),[util[_0x5837('0x27')]('SIP/%s',_0x53e5e4),_0x396f36[_0x5837('0x80')],_0x396f36[_0x5837('0xb7')],_0x396f36[_0x5837('0xb8')]]);if(_0x5efefd[_0x5837('0x74')]===-0x1){return _0x5efefd;}return this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0xb9'),'DIAL'));};AGIVertices[_0x5837('0x16')][_0x5837('0xba')]=function(_0x55ec27){logger['info'](util[_0x5837('0x27')](_0x5837('0xbb'),_0x55ec27['label']));if(!this['isConfigured'](_0x55ec27[_0x5837('0x56')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0xbc'));}if(!this[_0x5837('0x5e')](_0x55ec27['text'])){return this[_0x5837('0xe')]['noop'](_0x5837('0x8e'));}this[_0x5837('0xe')]['bot']=!![];this[_0x5837('0x31')](_0x55ec27);this[_0x5837('0x3b')](_0x55ec27['text'],'in');this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0xbd'),_0x55ec27[_0x5837('0x53')]));var _0x56a41c=this[_0x5837('0x55')][_0x5837('0x78')](this,_0x55ec27);if(_0x56a41c){for(var _0x5ea6ab in _0x56a41c){if(_0x56a41c[_0x5837('0x6f')](_0x5ea6ab)){this[_0x5837('0xe')][_0x5837('0xae')](util[_0x5837('0x27')](_0x5837('0xbe'),_0x5ea6ab[_0x5837('0xbf')]()),_0x56a41c[_0x5ea6ab]);}}this[_0x5837('0x3b')](_0x56a41c[_0x5837('0xc0')],_0x5837('0xc1'));return this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0xc2'),_0x56a41c['speech']));}return this[_0x5837('0xe')][_0x5837('0x49')](_0x55ec27,_0x5837('0xc3'));};AGIVertices[_0x5837('0x16')][_0x5837('0xc4')]=function(_0x470bb6){logger[_0x5837('0x29')](util['format'](_0x5837('0xc5'),_0x470bb6[_0x5837('0x7b')]));if(!this['isConfigured'](_0x470bb6[_0x5837('0xc6')])){return this['channel'][_0x5837('0x8a')](_0x5837('0xc7'));}if(!this[_0x5837('0x5e')](_0x470bb6[_0x5837('0xc8')])){return this[_0x5837('0xe')][_0x5837('0x8a')]('no\x20username\x20configured');}if(!this[_0x5837('0x5e')](_0x470bb6['password'])){return this[_0x5837('0xe')]['noop'](_0x5837('0xc9'));}if(!this['isConfigured'](_0x470bb6[_0x5837('0xca')])){return this['channel']['noop'](_0x5837('0x8e'));}this[_0x5837('0xe')][_0x5837('0xcb')]=!![];this[_0x5837('0x31')](_0x470bb6);this[_0x5837('0x3b')](_0x470bb6['text'],'in');this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0xcc'),_0x470bb6['text']));var _0x28516d=this[_0x5837('0x58')][_0x5837('0x78')](this,_0x470bb6);if(_0x28516d){for(var _0x185e4f in _0x28516d){if(_0x28516d[_0x5837('0x6f')](_0x185e4f)){this['channel'][_0x5837('0xae')](util[_0x5837('0x27')]('SESTEK_NDA_%s',_0x185e4f[_0x5837('0xbf')]()),_0x28516d[_0x185e4f]);}}this[_0x5837('0x3b')](_0x28516d[_0x5837('0xc0')],'out');if(_0x28516d[_0x5837('0xcd')]){this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x28516d[_0x5837('0xcd')]));var _0x31b96a=this[_0x5837('0xe')]['streamFile'](_0x28516d[_0x5837('0xcd')]);try{fs[_0x5837('0xce')](_0x28516d[_0x5837('0xcd')]+_0x5837('0xcf'));}catch(_0x3111c2){logger[_0x5837('0x49')](_0x3111c2);}return _0x31b96a;}else{return this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')]('SestekNDA\x20Result\x20%s',_0x28516d[_0x5837('0xc0')]));}}return this[_0x5837('0xe')][_0x5837('0x49')](_0x470bb6,_0x5837('0xd0'));};AGIVertices[_0x5837('0x16')]['end']=function(_0x2e7d65){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0xd1'),_0x2e7d65[_0x5837('0x7b')]));return this['channel']['noop'](_0x5837('0xd2'));};AGIVertices['prototype']['ext_dial']=function(_0x9aa7f3){logger['info'](util[_0x5837('0x27')](_0x5837('0xd3'),_0x9aa7f3[_0x5837('0x7b')]));var _0x2151f0='';if(_0x9aa7f3[_0x5837('0xd4')]){if(!this['isConfigured'](_0x9aa7f3[_0x5837('0xd4')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x9aa7f3,_0x5837('0xd5'));}else{var _0x279def=parseInt(_0x9aa7f3[_0x5837('0xd4')],0xa);if(isNaN(_0x279def)){_0x2151f0=_0x9aa7f3[_0x5837('0xd4')];}else{_0x2151f0=this[_0x5837('0x1d')][_0x5837('0x78')](this,_0x9aa7f3[_0x5837('0xd4')]);if(!_0x2151f0){return this[_0x5837('0xe')][_0x5837('0x49')](_0x9aa7f3,_0x5837('0xd6'));}}}}else if(_0x9aa7f3['trunk_name']){_0x2151f0=_0x9aa7f3[_0x5837('0xd7')];}else{return this[_0x5837('0xe')][_0x5837('0x49')](_0x9aa7f3,'no\x20trunk\x20selected');}var _0x29b0c5=this['channel'][_0x5837('0x4f')](_0x5837('0xb6'),[util[_0x5837('0x27')](_0x5837('0xd8'),_0x2151f0,_0x9aa7f3[_0x5837('0x87')]),_0x9aa7f3[_0x5837('0x80')],_0x9aa7f3[_0x5837('0xb7')],_0x9aa7f3[_0x5837('0xb8')]]);if(_0x29b0c5['result']===-0x1){return _0x29b0c5;}return this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0xb9'),_0x5837('0xb6')));};AGIVertices[_0x5837('0x16')]['finally']=function(_0x43a096){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0xd9'),_0x43a096[_0x5837('0x7b')]));return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0xda'));};AGIVertices[_0x5837('0x16')][_0x5837('0xc')]=function(_0x429f18){logger['info'](util[_0x5837('0x27')](_0x5837('0xdb'),_0x429f18[_0x5837('0x7b')]));if(_0x429f18[_0x5837('0x79')]===0x0){return this[_0x5837('0x77')](_0x429f18);}_0x429f18[_0x5837('0x79')]-=0x1;if(!this[_0x5837('0x5e')](_0x429f18[_0x5837('0xdc')])){return this['channel']['error'](_0x429f18,_0x5837('0xdd'));}var _0x53ce10=this[_0x5837('0x1f')][_0x5837('0x78')](this,_0x429f18[_0x5837('0xdc')]);if(!_0x53ce10){return this[_0x5837('0xe')]['error'](_0x429f18,_0x5837('0xde'));}if(!this['isConfigured'](_0x429f18[_0x5837('0xdf')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x5837('0xaa'));}var _0x21c1fc=this[_0x5837('0xe')]['getData'](_0x53ce10,_0x429f18['response'],_0x429f18['maxdigit']);var _0x5bc634=_0x21c1fc[_0x5837('0x74')]?_0x21c1fc[_0x5837('0x74')][_0x5837('0x45')]():'';logger[_0x5837('0x29')]('test',JSON[_0x5837('0xe0')](_0x21c1fc));if(_0x21c1fc[_0x5837('0x74')]===-0x1){this[_0x5837('0x31')]['sync'](this,_0x429f18,_0x5bc634);return _0x21c1fc;}else if(_0x21c1fc[_0x5837('0x76')]===_0x5837('0x80')){_0x21c1fc[_0x5837('0x74')]=_0x5bc634[_0x5837('0x72')]>=parseInt(_0x429f18[_0x5837('0xe1')])?'x':'i';}else{_0x21c1fc['result']=_0x5bc634[_0x5837('0x72')]>=parseInt(_0x429f18[_0x5837('0xe1')])&&_0x5bc634['length']<=parseInt(_0x429f18[_0x5837('0xe2')])?'x':'i';}var _0x9276b8=this[_0x5837('0x10')][_0x5837('0x78')](this,_0x429f18[_0x5837('0xdf')]);if(!_0x9276b8){return this[_0x5837('0xe')][_0x5837('0x49')](_0x429f18,_0x5837('0xab'));}this['channel'][_0x5837('0xae')](_0x9276b8,_0x5bc634);if(this[_0x5837('0x5e')](_0x429f18[_0x5837('0xe3')])){var _0x2659cf=parseInt(_0x429f18[_0x5837('0xe3')],0xa);var _0x327597=rs[_0x5837('0xe4')]({'charset':'*','length':_0x2659cf});var _0x430195=_0x5bc634[_0x5837('0x72')];if(_0x430195>0x0){if(_0x430195>_0x2659cf){this[_0x5837('0x31')][_0x5837('0x78')](this,_0x429f18,_0x429f18[_0x5837('0xe5')]===_0x5837('0xe6')?_0x327597+_0x5bc634[_0x5837('0xe7')](_0x2659cf):_0x5bc634[_0x5837('0xe7')](0x0,_0x430195-_0x2659cf)+_0x327597);}else{this[_0x5837('0x31')][_0x5837('0x78')](this,_0x429f18,rs[_0x5837('0xe4')]({'charset':'*','length':_0x430195}));}}else{this['createSquareDetailsReport'][_0x5837('0x78')](this,_0x429f18,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x429f18,_0x5bc634);}return _0x21c1fc;};AGIVertices[_0x5837('0x16')][_0x5837('0xd')]=function(_0x129e6a){logger[_0x5837('0x29')](util[_0x5837('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x129e6a[_0x5837('0x7b')]));return this[_0x5837('0xc')](_0x129e6a);};AGIVertices[_0x5837('0x16')][_0x5837('0xe8')]=function(_0x17046b){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0xe9'),_0x17046b[_0x5837('0x7b')]));this[_0x5837('0x31')][_0x5837('0x78')](this,_0x17046b,_0x17046b[_0x5837('0xea')]);return this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0xeb'),_0x17046b[_0x5837('0xea')]));};AGIVertices[_0x5837('0x16')]['awspolly']=function(_0x27b55b){logger[_0x5837('0x29')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x27b55b[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x27b55b[_0x5837('0x61')])||!this['isConfigured'](_0x27b55b[_0x5837('0x62')])){return this[_0x5837('0xe')]['noop'](_0x5837('0xec'));}if(!this[_0x5837('0x5e')](_0x27b55b[_0x5837('0x53')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0x8e'));}this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0xed'),_0x27b55b[_0x5837('0x53')]));var _0x2c1382=this[_0x5837('0x60')][_0x5837('0x78')](this,_0x27b55b);if(_0x2c1382){this['channel']['noop'](util[_0x5837('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0x2c1382));var _0x3f6daa=this['channel'][_0x5837('0xee')](_0x2c1382);try{fs[_0x5837('0xce')](_0x2c1382+'.wav');}catch(_0x2b10b8){logger[_0x5837('0x49')](_0x2b10b8);}return _0x3f6daa;}return this[_0x5837('0xe')]['error'](_0x27b55b,_0x5837('0xef'));};AGIVertices[_0x5837('0x16')]['awslex']=function(_0x63c05c){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0xf0'),_0x63c05c[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x63c05c[_0x5837('0x61')])||!this[_0x5837('0x5e')](_0x63c05c[_0x5837('0x62')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0xec'));}if(!this['isConfigured'](_0x63c05c[_0x5837('0x68')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0xf1'));}if(!this['isConfigured'](_0x63c05c['text'])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0x8e'));}this['channel'][_0x5837('0xcb')]=!![];this[_0x5837('0x31')](_0x63c05c);this['createSquareMessage'](_0x63c05c['text'],'in');this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0xf2'),_0x63c05c[_0x5837('0x53')]));var _0x2e78b5=this[_0x5837('0x66')][_0x5837('0x78')](this,_0x63c05c);if(_0x2e78b5){for(var _0x4ef8db in _0x2e78b5){if(_0x2e78b5[_0x5837('0x6f')](_0x4ef8db)&&_[_0x5837('0xf3')](_0x2e78b5[_0x4ef8db])){this[_0x5837('0xe')][_0x5837('0xae')](util[_0x5837('0x27')](_0x5837('0xf4'),_0x4ef8db['toUpperCase']()),_0x2e78b5[_0x4ef8db]);}}if(_['isNil'](_0x2e78b5[_0x5837('0xf5')])){return this[_0x5837('0xe')][_0x5837('0x8a')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x5837('0x3b')](_0x2e78b5['message'],_0x5837('0xc1'));return this['channel']['noop'](util[_0x5837('0x27')](_0x5837('0xf6'),_0x2e78b5[_0x5837('0xf5')]));}}return this[_0x5837('0xe')][_0x5837('0x49')](_0x63c05c,_0x5837('0xf7'));};AGIVertices[_0x5837('0x16')][_0x5837('0xf8')]=function(_0x1f30e5){logger['info'](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1f30e5[_0x5837('0x7b')],_0x1f30e5['timeout']));if(!this['isConfigured'](_0x1f30e5['key'])){return this[_0x5837('0xe')][_0x5837('0x8a')]('no\x20key\x20configured');}var _0x45893c='wav';var _0x3036d6=util[_0x5837('0x27')](_0x5837('0xf9'),FILES_PATH,rs[_0x5837('0xe4')](0x4));var _0x54b84d=util[_0x5837('0x27')](_0x5837('0xfa'),_0x3036d6,_0x45893c);var _0x65a0ce=!![];if(_0x1f30e5['beep']===_0x5837('0xfb')){_0x65a0ce=![];}var _0x3973f2=this[_0x5837('0xe')][_0x5837('0xfc')](_0x3036d6,_0x45893c,_0x1f30e5['intKey'],_0x1f30e5[_0x5837('0x80')],undefined,_0x65a0ce);if(_0x3973f2['result']!==-0x1){this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0xfd'),_0x54b84d));var _0x17161c=this['googleASR']['sync'](this,_0x1f30e5,_0x54b84d);if(_0x17161c){for(var _0x3b7c6c in _0x17161c){if(_0x17161c['hasOwnProperty'](_0x3b7c6c)){this[_0x5837('0xe')][_0x5837('0xae')](util[_0x5837('0x27')](_0x5837('0xfe'),_0x3b7c6c['toUpperCase']()),_0x17161c[_0x3b7c6c]);}}return this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')]('GoogleASR\x20Result\x20%s',JSON[_0x5837('0xe0')](_0x17161c)));}}return _0x3973f2;};AGIVertices['prototype'][_0x5837('0xff')]=function(_0x548ef6){logger['info'](util[_0x5837('0x27')](_0x5837('0x100'),_0x548ef6[_0x5837('0x7b')]));if(!this['isConfigured'](_0x548ef6[_0x5837('0x6c')])){return this[_0x5837('0xe')][_0x5837('0x8a')]('no\x20appid\x20configured');}if(!this[_0x5837('0x5e')](_0x548ef6[_0x5837('0x6d')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0x101'));}var _0x20d3ed='wav';var _0x264f8a=util[_0x5837('0x27')](_0x5837('0xf9'),FILES_PATH,rs['generate'](0x4));var _0x14859d=util[_0x5837('0x27')]('%s.%s',_0x264f8a,_0x20d3ed);var _0x408d60=!![];if(_0x548ef6[_0x5837('0x102')]==='NOBEEP'){_0x408d60=![];}var _0x157500=this[_0x5837('0xe')]['recordFile'](_0x264f8a,_0x20d3ed,_0x548ef6[_0x5837('0x103')],_0x548ef6[_0x5837('0x80')],undefined,_0x408d60);if(_0x157500[_0x5837('0x74')]!==-0x1){this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x104'),_0x14859d));var _0x3ce63f=this[_0x5837('0x6b')]['sync'](this,_0x548ef6,_0x14859d);if(_0x3ce63f){for(var _0x5dd34c in _0x3ce63f){if(_0x3ce63f[_0x5837('0x6f')](_0x5dd34c)){this[_0x5837('0xe')][_0x5837('0xae')](util[_0x5837('0x27')](_0x5837('0x105'),_0x5dd34c[_0x5837('0xbf')]()),_0x3ce63f[_0x5dd34c]);}}return this[_0x5837('0xe')][_0x5837('0x8a')](util['format'](_0x5837('0x106'),JSON[_0x5837('0xe0')](_0x3ce63f)));}}return _0x157500;};AGIVertices[_0x5837('0x16')][_0x5837('0x107')]=function(_0x18d5fb){logger['info'](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x18d5fb[_0x5837('0x7b')]));return this[_0x5837('0xe')]['continueAt'](_0x18d5fb['context'],_0x18d5fb[_0x5837('0x38')],_0x18d5fb[_0x5837('0x39')]);};AGIVertices[_0x5837('0x16')][_0x5837('0x108')]=function(_0x5da880){logger['info'](util[_0x5837('0x27')](_0x5837('0x109'),_0x5da880['label']));if(!this[_0x5837('0x5e')](_0x5da880[_0x5837('0x10a')])){return this['channel'][_0x5837('0x49')](_0x5da880,_0x5837('0x10b'));}try{var _0x1fad3f=eval(_0x5da880[_0x5837('0x10a')])?_0x5837('0x10c'):_0x5837('0x10d');this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')]('EVAL\x20CONDITION\x20%s\x20%s',_0x5da880[_0x5837('0x10a')],_0x1fad3f));return{'code':0xc8,'result':_0x1fad3f};}catch(_0x309e97){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x5837('0x16')]['gotoiftime']=function(_0x49b003){logger[_0x5837('0x29')](util['format'](_0x5837('0x10e'),_0x49b003[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x49b003[_0x5837('0x10f')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x49b003,_0x5837('0x110'));}var _0x4d0ceb=this[_0x5837('0x24')][_0x5837('0x78')](this,_0x49b003[_0x5837('0x10f')]);if(!_0x4d0ceb){return this[_0x5837('0xe')][_0x5837('0x49')](_0x49b003,_0x5837('0x111'));}for(var _0x41c7e5=0x0;_0x41c7e5<_0x4d0ceb[_0x5837('0x72')];_0x41c7e5+=0x1){var _0xdf56d=this['channel'][_0x5837('0x10')](util[_0x5837('0x27')](_0x5837('0x112'),_0x4d0ceb[_0x41c7e5]));if(_0xdf56d[_0x5837('0x74')]===-0x1){return _0xdf56d;}logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x113'),_0x4d0ceb[_0x41c7e5],_0xdf56d[_0x5837('0x76')]));if(_0xdf56d[_0x5837('0x76')]===_0x5837('0x10c')){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x113'),_0x4d0ceb[_0x41c7e5],'true'));this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x113'),_0x4d0ceb[_0x41c7e5],_0x5837('0x10c')));return{'code':0xc8,'result':_0x5837('0x10c')};}else{logger['info'](util[_0x5837('0x27')]('IFTIME\x20%s\x20%s',_0x4d0ceb[_0x41c7e5],_0x5837('0x10d')));this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0x113'),_0x4d0ceb[_0x41c7e5],_0x5837('0x10d')));}}return{'code':0xc8,'result':_0x5837('0x10d')};};AGIVertices[_0x5837('0x16')]['hangup']=function(_0x59b865){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x114'),_0x59b865[_0x5837('0x7b')]));return this['channel']['hangup']();};AGIVertices[_0x5837('0x16')][_0x5837('0x115')]=function(_0x183451){logger['info'](util[_0x5837('0x27')](_0x5837('0x116'),_0x183451[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x183451[_0x5837('0x56')])){return this[_0x5837('0xe')]['noop'](_0x5837('0xbc'));}var _0x1a99e4='wav';var _0x44cf05=util[_0x5837('0x27')](_0x5837('0xf9'),FILES_PATH,rs[_0x5837('0xe4')](0x4));var _0x503211=util[_0x5837('0x27')](_0x5837('0xfa'),_0x44cf05,_0x1a99e4);var _0x52d287=!![];if(_0x183451['beep']==='NOBEEP'){_0x52d287=![];}var _0x4be90c=this[_0x5837('0xe')]['recordFile'](_0x44cf05,_0x1a99e4,_0x183451[_0x5837('0x103')],_0x183451[_0x5837('0x80')],undefined,_0x52d287);if(_0x4be90c[_0x5837('0x74')]!==-0x1){this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x117'),_0x503211));var _0x129fd0=this['ispeechASR'][_0x5837('0x78')](this,_0x183451,_0x503211);if(_0x129fd0){for(var _0x13a556 in _0x129fd0){if(_0x129fd0[_0x5837('0x6f')](_0x13a556)){this['channel']['setVariable'](util[_0x5837('0x27')](_0x5837('0x118'),_0x13a556[_0x5837('0xbf')]()),_0x129fd0[_0x13a556]);}}return this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')]('IspeechASR\x20Result\x20%s',JSON[_0x5837('0xe0')](_0x129fd0)));}}return _0x4be90c;};AGIVertices[_0x5837('0x16')][_0x5837('0x119')]=function(_0x4d3d39){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x11a'),_0x4d3d39[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x4d3d39[_0x5837('0x56')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x4d3d39[_0x5837('0x53')])){return this[_0x5837('0xe')]['noop'](_0x5837('0x8e'));}this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x11b'),_0x4d3d39[_0x5837('0x53')]));var _0x248d83=this['ispeechTTS'][_0x5837('0x78')](this,_0x4d3d39);if(_0x248d83){this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x117'),_0x248d83));var _0x59113d=this[_0x5837('0xe')][_0x5837('0xee')](_0x248d83,_0x4d3d39[_0x5837('0x103')]);try{fs[_0x5837('0xce')](_0x248d83+'.wav');}catch(_0x189c5c){logger[_0x5837('0x49')](_0x189c5c);}return _0x59113d;}return this[_0x5837('0xe')]['error'](_0x4d3d39,_0x5837('0x11c'));};AGIVertices[_0x5837('0x16')][_0x5837('0x11d')]=function(_0x456b38){logger['info'](util[_0x5837('0x27')](_0x5837('0x11e'),_0x456b38[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x456b38[_0x5837('0x11f')])){return this['channel'][_0x5837('0x49')](_0x456b38,'no\x20find\x20by\x20configured');}logger[_0x5837('0x29')](util['format'](_0x5837('0x120'),this[_0x5837('0xe')]['callerid'],_0x456b38['findBy']));var _0x44ddcf=this[_0x5837('0x4d')]['sync'](this,_0x456b38['findBy']);if(_0x44ddcf){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x121'),this[_0x5837('0xe')][_0x5837('0x36')],_0x456b38[_0x5837('0x11f')]));this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x121'),this[_0x5837('0xe')][_0x5837('0x36')],_0x456b38['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5837('0x27')](_0x5837('0x122'),this[_0x5837('0xe')]['callerid'],_0x456b38[_0x5837('0x11f')]));this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x122'),this['channel'][_0x5837('0x36')],_0x456b38[_0x5837('0x11f')]));return{'code':0xc8,'result':_0x5837('0x123')};}};AGIVertices['prototype'][_0x5837('0x124')]=function(_0x1e79d2){logger[_0x5837('0x29')](util[_0x5837('0x27')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1e79d2[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x1e79d2['findBy'])){return this['channel'][_0x5837('0x49')](_0x1e79d2,_0x5837('0x125'));}logger['info'](util[_0x5837('0x27')](_0x5837('0x120'),this[_0x5837('0xe')][_0x5837('0x36')],_0x1e79d2[_0x5837('0x11f')]));var _0x3ba83a=this[_0x5837('0x4c')][_0x5837('0x78')](this,_0x1e79d2[_0x5837('0x11f')]);if(_0x3ba83a){logger['info'](util[_0x5837('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5837('0xe')]['callerid'],_0x1e79d2[_0x5837('0x11f')]));this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5837('0xe')][_0x5837('0x36')],_0x1e79d2[_0x5837('0x11f')]));return{'code':0xc8,'result':_0x5837('0x126')};}else{logger['info'](util[_0x5837('0x27')](_0x5837('0x122'),this[_0x5837('0xe')][_0x5837('0x36')],_0x1e79d2[_0x5837('0x11f')]));this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0x122'),this[_0x5837('0xe')]['callerid'],_0x1e79d2['findBy']));return{'code':0xc8,'result':_0x5837('0x123')};}};AGIVertices[_0x5837('0x16')]['math']=function(_0x3314df){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x127'),_0x3314df[_0x5837('0x7b')]));if(!this['isConfigured'](_0x3314df[_0x5837('0x128')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x3314df,_0x5837('0x129'));}this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')]('math\x20%s',_0x3314df[_0x5837('0x128')]));var _0x1c2633=eval(_0x3314df['operation']);if(!this['isConfigured'](_0x3314df[_0x5837('0xdf')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0xaa'));}var _0x346a28=this['getVariable'][_0x5837('0x78')](this,_0x3314df[_0x5837('0xdf')]);if(!_0x346a28){return this[_0x5837('0xe')][_0x5837('0x49')](_0x3314df,_0x5837('0xab'));}if(_[_0x5837('0x12a')](_0x1c2633)){var _0x5b3838=this;_0x1c2633[_0x5837('0xac')](function(_0x2419bc,_0x5985fd){_0x5b3838[_0x5837('0xe')][_0x5837('0xae')](util['format'](_0x5837('0x12b'),_0x346a28,_0x5985fd),_0x2419bc);});return this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x12c'),_0x346a28));}else{return this[_0x5837('0xe')][_0x5837('0xae')](_0x346a28,_0x1c2633);}};AGIVertices[_0x5837('0x16')]['menu']=function(_0x3967e3){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x12d'),_0x3967e3[_0x5837('0x7b')]));if(_0x3967e3[_0x5837('0x79')]===0x0){return this[_0x5837('0x77')](_0x3967e3);}_0x3967e3[_0x5837('0x79')]-=0x1;if(!this[_0x5837('0x5e')](_0x3967e3[_0x5837('0xdc')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x3967e3,_0x5837('0xdd'));}var _0x3720b2=this[_0x5837('0x1f')][_0x5837('0x78')](this,_0x3967e3[_0x5837('0xdc')]);if(!_0x3720b2){return this['channel'][_0x5837('0x49')](_0x3967e3,_0x5837('0xde'));}var _0x389695=this[_0x5837('0xe')]['getData'](_0x3720b2,_0x3967e3[_0x5837('0x12e')],_0x3967e3[_0x5837('0x12f')]);var _0x413840=_0x389695['result'];if(_0x389695['result']===-0x1){this[_0x5837('0x31')][_0x5837('0x78')](this,_0x3967e3,'-1');return _0x389695;}else if(_0x389695[_0x5837('0x76')]===_0x5837('0x80')){_0x389695[_0x5837('0x74')]=_0x389695[_0x5837('0x74')]['length']>0x0?_0x389695['result']:'t';}else if(_[_0x5837('0x3d')](_0x389695[_0x5837('0x74')])){_0x389695['result']='#';_0x413840='#';}if(!this['isConfigured'](_0x3967e3['variable_id'])){this[_0x5837('0xe')][_0x5837('0x8a')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0xe29822=this[_0x5837('0x10')][_0x5837('0x78')](this,_0x3967e3[_0x5837('0xdf')]);if(!_0xe29822){return this['channel'][_0x5837('0x49')](_0x3967e3,_0x5837('0xab'));}this['channel'][_0x5837('0xae')](_0xe29822,_0x413840);}this[_0x5837('0x31')]['sync'](this,_0x3967e3,_0x413840);return _0x389695;};AGIVertices['prototype']['noop']=function(_0x457b43){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x130'),_0x457b43[_0x5837('0x7b')]));return this[_0x5837('0xe')][_0x5837('0x8a')](_0x457b43[_0x5837('0x131')]||_0x457b43[_0x5837('0x7b')]);};AGIVertices[_0x5837('0x16')][_0x5837('0x132')]=function(_0x4d30c0){logger['info'](util['format'](_0x5837('0x133'),_0x4d30c0[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x4d30c0[_0x5837('0x11f')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x4d30c0,_0x5837('0x125'));}logger[_0x5837('0x29')](util[_0x5837('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5837('0xe')][_0x5837('0x36')],_0x4d30c0[_0x5837('0x11f')]));var _0x5ace75=this[_0x5837('0x47')][_0x5837('0x78')](this,_0x4d30c0[_0x5837('0x134')]);var _0x3163d0=this['agentPause'][_0x5837('0x78')](this,_0x4d30c0[_0x5837('0x11f')],_0x5ace75);if(_0x3163d0){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x121'),this[_0x5837('0xe')]['callerid'],_0x4d30c0['findBy']));this['channel']['noop'](util[_0x5837('0x27')](_0x5837('0x121'),this[_0x5837('0xe')][_0x5837('0x36')],_0x4d30c0[_0x5837('0x11f')]));return{'code':0xc8,'result':_0x5837('0x126')};}else{logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x122'),this[_0x5837('0xe')][_0x5837('0x36')],_0x4d30c0[_0x5837('0x11f')]));this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5837('0xe')][_0x5837('0x36')],_0x4d30c0['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5837('0x16')][_0x5837('0x135')]=function(_0x54b506){logger['info'](util[_0x5837('0x27')](_0x5837('0x136'),_0x54b506[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x54b506['file_id'])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x54b506,_0x5837('0xdd'));}var _0x386d9a=this[_0x5837('0x1f')][_0x5837('0x78')](this,_0x54b506[_0x5837('0xdc')]);if(!_0x386d9a){return this['channel'][_0x5837('0x49')](_0x54b506,_0x5837('0xde'));}var _0x43f328=this['channel'][_0x5837('0x4f')]('PLAYBACK',[_0x386d9a,_0x54b506['opts']]);if(_0x43f328[_0x5837('0x74')]===-0x1){return _0x43f328;}return this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')]('Executed\x20command\x20%s\x20%s',_0x5837('0x137'),_0x386d9a));};AGIVertices[_0x5837('0x16')]['queue']=function(_0x5c3c6a){logger[_0x5837('0x29')](util['format'](_0x5837('0x138'),_0x5c3c6a[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x5c3c6a[_0x5837('0x139')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x5c3c6a,_0x5837('0x13a'));}var _0x24bf57='';var _0x23d1f0=parseInt(_0x5c3c6a[_0x5837('0x139')],0xa);if(isNaN(_0x23d1f0)){_0x24bf57=_0x5c3c6a[_0x5837('0x139')];}else{_0x24bf57=this[_0x5837('0x17')]['sync'](this,_0x5c3c6a[_0x5837('0x139')]);if(!_0x24bf57){return this['channel'][_0x5837('0x49')](_0x5c3c6a,_0x5837('0x13b'));}}var _0xcbfc19='';if(this[_0x5837('0x5e')](_0x5c3c6a[_0x5837('0xdc')])){var _0x5b58e3=this['getSound'][_0x5837('0x78')](this,_0x5c3c6a['file_id']);if(_0x5b58e3){_0xcbfc19=_0x5b58e3;}}this[_0x5837('0x31')][_0x5837('0x78')](this,_0x5c3c6a,_0x24bf57);if(_0x5c3c6a['opts'][_0x5837('0x13c')]('x')<0x0){_0x5c3c6a[_0x5837('0xb7')]+='x';}if(_0x5c3c6a[_0x5837('0xb7')][_0x5837('0x13c')]('X')<0x0){_0x5c3c6a['opts']+='X';}this['channel']['setVariable'](_0x5837('0x13d'),_0x24bf57?_0x24bf57[_0x5837('0x13e')]():'');var _0x199606=this[_0x5837('0xe')]['exec'](_0x5837('0x13f'),[_0x24bf57,_0x5c3c6a['opts'],_0x5c3c6a[_0x5837('0xb8')],_0xcbfc19,_0x5c3c6a[_0x5837('0x80')],_0x5c3c6a[_0x5837('0x8')],_0x5c3c6a[_0x5837('0x140')],_0x5c3c6a[_0x5837('0x141')],'',_0x5c3c6a[_0x5837('0x142')]]);if(_0x199606[_0x5837('0x74')]===-0x1){return _0x199606;}return this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x8b'),_0x5837('0x13f'),_0x24bf57));};AGIVertices[_0x5837('0x16')][_0x5837('0x143')]=function(_0x36b2c1){logger[_0x5837('0x29')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x36b2c1[_0x5837('0x7b')]));var _0x2c9a35=_0x36b2c1[_0x5837('0x144')]||_0x5837('0x145');var _0x3b63ec=util['format']('%s_%s',this[_0x5837('0xe')][_0x5837('0x32')],rs[_0x5837('0xe4')](0x5));var _0x15a7e9=util[_0x5837('0x27')](_0x5837('0x146'),FILES_PATH,_0x3b63ec,_0x2c9a35);var _0x112e6a=util['format'](_0x5837('0xf9'),FILES_PATH,_0x3b63ec);this[_0x5837('0x35')][_0x5837('0x78')](this,_0x36b2c1,_0x3b63ec,_0x15a7e9);this['channel'][_0x5837('0xae')](_0x5837('0x147'),_0x3b63ec);logger[_0x5837('0x29')](_0x5837('0x148'),_0x112e6a,_0x2c9a35,_0x36b2c1[_0x5837('0x149')],_0x36b2c1[_0x5837('0x80')]);return this[_0x5837('0xe')][_0x5837('0xfc')](_0x112e6a,_0x2c9a35,_0x36b2c1[_0x5837('0x149')],_0x36b2c1[_0x5837('0x80')],undefined,!![]);};AGIVertices[_0x5837('0x16')]['saydigits']=function(_0x1b1b0a){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x14a'),_0x1b1b0a['label']));return this[_0x5837('0xe')][_0x5837('0x14b')](_0x1b1b0a['digits'][_0x5837('0x51')](/\s+/g,''),_0x1b1b0a[_0x5837('0x149')]);};AGIVertices[_0x5837('0x16')][_0x5837('0x14c')]=function(_0x183cac){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x14d'),_0x183cac[_0x5837('0x7b')]));return this[_0x5837('0xe')][_0x5837('0x14e')](_0x183cac[_0x5837('0x14f')]['replace'](/\s+/g,''),_0x183cac[_0x5837('0x149')]);};AGIVertices['prototype'][_0x5837('0x150')]=function(_0x1c1025){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x151'),_0x1c1025[_0x5837('0x7b')]));return this[_0x5837('0xe')][_0x5837('0x152')](_0x1c1025['text'],_0x1c1025['escape_digits']);};AGIVertices[_0x5837('0x16')][_0x5837('0x153')]=function(_0x22362d){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x154'),_0x22362d[_0x5837('0x7b')]));if(!this['isConfigured'](_0x22362d[_0x5837('0x155')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0x156'));}var _0xa2b9e9=this[_0x5837('0x22')][_0x5837('0x78')](this,_0x22362d[_0x5837('0x155')]);if(!_0xa2b9e9||!_0xa2b9e9[_0x5837('0x157')]){return this[_0x5837('0xe')][_0x5837('0x49')](_0x22362d,'no\x20mail\x20account\x20found');}var _0x419ef3={'from':util[_0x5837('0x27')](_0x5837('0x158'),_0xa2b9e9[_0x5837('0x14')],_0xa2b9e9[_0x5837('0x159')]||_0xa2b9e9[_0x5837('0x157')][_0x5837('0x15a')]),'to':_0x22362d['to']||'','cc':_0x22362d['cc']||'','bcc':_0x22362d[_0x5837('0x15b')]||'','subject':_0x22362d[_0x5837('0x15c')],'html':_0x22362d[_0x5837('0x53')],'text':_0x22362d[_0x5837('0x53')]};var _0x1a3513={'tls':{'rejectUnauthorized':![]}};if(_0xa2b9e9['Smtp']['service']){_0x1a3513[_0x5837('0x15d')]=_0xa2b9e9[_0x5837('0x157')][_0x5837('0x15d')];}else{_0x1a3513[_0x5837('0x15e')]=_0xa2b9e9[_0x5837('0x157')][_0x5837('0x15e')];_0x1a3513[_0x5837('0x15f')]=_0xa2b9e9[_0x5837('0x157')][_0x5837('0x15f')];_0x1a3513[_0x5837('0x160')]=_0xa2b9e9[_0x5837('0x157')][_0x5837('0x160')];}if(_0xa2b9e9[_0x5837('0x157')]['authentication']){_0x1a3513[_0x5837('0x161')]={'user':_0xa2b9e9[_0x5837('0x157')][_0x5837('0x15a')],'pass':_0xa2b9e9['Smtp'][_0x5837('0x162')]};}if(this['isConfigured'](_0x22362d['template_id'])){}logger['debug']('sendMail\x20message',JSON[_0x5837('0xe0')](_0x419ef3));this['createSquareDetailsReport']['sync'](this,_0x22362d,_0x22362d[_0x5837('0x155')]);this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0x163'),_0xa2b9e9[_0x5837('0x14')]));this[_0x5837('0x23')]['sync'](this,_0x1a3513,_0x419ef3);return this['channel'][_0x5837('0x8a')](_0x5837('0x164'));};AGIVertices[_0x5837('0x16')]['sendFax']=function(_0x4724a1){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x165'),_0x4724a1[_0x5837('0x7b')]));return this[_0x5837('0xe')]['noop'](_0x5837('0x166'));};AGIVertices[_0x5837('0x16')][_0x5837('0x167')]=function(_0x222614){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x168'),_0x222614[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x222614[_0x5837('0x169')])){return this[_0x5837('0xe')][_0x5837('0x8a')](_0x5837('0x16a'));}var _0x10641c=this['getSmsAccount'][_0x5837('0x78')](this,_0x222614[_0x5837('0x169')]);if(!_0x10641c){return this['channel']['error'](_0x222614,'no\x20sms\x20account\x20found');}var _0x3b6bb0={'body':_0x222614['sms_text'],'phone':_0x222614['to']||'','SmsAccountId':_0x10641c['id']};logger[_0x5837('0xb1')](_0x5837('0x16b'),JSON['stringify'](_0x3b6bb0));this[_0x5837('0x31')][_0x5837('0x78')](this,_0x222614,_0x222614[_0x5837('0x169')]);this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x16c'),_0x10641c[_0x5837('0x14')]));this['createSmsMessage']['sync'](this,_0x3b6bb0);return this[_0x5837('0xe')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5837('0x16')][_0x5837('0x16d')]=function(_0x4d6e95){logger[_0x5837('0x29')](util['format'](_0x5837('0x16e'),_0x4d6e95['label']));if(!this[_0x5837('0x5e')](_0x4d6e95[_0x5837('0xdf')])){return this['channel']['error'](_0x4d6e95,_0x5837('0x16f'));}var _0x1d5890=this[_0x5837('0x10')][_0x5837('0x78')](this,_0x4d6e95['variable_id']);if(!_0x1d5890){return this[_0x5837('0xe')][_0x5837('0x49')](_0x4d6e95,_0x5837('0xab'));}return this[_0x5837('0xe')][_0x5837('0xae')](_0x1d5890,_0x4d6e95[_0x5837('0x170')]);};AGIVertices[_0x5837('0x16')][_0x5837('0x171')]=function(_0x25bb20){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x172'),_0x25bb20['label']));this[_0x5837('0xe')]['noop']('START\x20CALLY\x20SQUARE');if(_0x25bb20['answer']===_0x5837('0x173')){this['channel']['noop'](_0x5837('0x174'));return this[_0x5837('0xe')][_0x5837('0x7e')]();}return this['channel'][_0x5837('0x8a')]('Skipped\x20Answer');};AGIVertices[_0x5837('0x16')]['subproject']=function(_0x41c84c){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x175'),_0x41c84c['label']));if(!this[_0x5837('0x5e')](_0x41c84c[_0x5837('0x176')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x41c84c,_0x5837('0x177'));}var _0x28683a=this['getSquareProject'][_0x5837('0x78')](this,_0x41c84c[_0x5837('0x176')]);if(!this[_0x5837('0x5e')](_0x28683a)){return this['channel'][_0x5837('0x49')](_0x41c84c,util[_0x5837('0x27')](_0x5837('0x178'),_0x41c84c[_0x5837('0x176')]));}if(_0x28683a===this[_0x5837('0xe')][_0x5837('0x34')]){return this[_0x5837('0xe')][_0x5837('0x49')](_0x41c84c,_0x5837('0x179'));}this[_0x5837('0x31')][_0x5837('0x78')](this,_0x41c84c,_0x28683a);var _0x4b90ef=this[_0x5837('0xe')][_0x5837('0x4f')](_0x5837('0x17a'),util[_0x5837('0x27')](_0x5837('0x17b'),config[_0x5837('0x8')]['host']||_0x5837('0x17c'),_0x28683a,this[_0x5837('0xe')][_0x5837('0x34')]));if(_0x4b90ef[_0x5837('0x74')]===-0x1){return _0x4b90ef;}return this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')]('Executed\x20command\x20%s\x20%s',_0x5837('0x17a'),_0x28683a));};AGIVertices[_0x5837('0x16')][_0x5837('0x17d')]=function(_0x4824a5){logger['info'](util['format'](_0x5837('0x17e'),_0x4824a5['label']));var _0x8a992=this[_0x5837('0x17f')][_0x5837('0x78')](this,_0x4824a5[_0x5837('0x7c')]);this[_0x5837('0x31')][_0x5837('0x78')](this,_0x4824a5,_0x4824a5['command']);if(this['isConfigured'](_0x4824a5['variable_id'])){var _0x48f4af=this[_0x5837('0x10')][_0x5837('0x78')](this,_0x4824a5[_0x5837('0xdf')]);if(_0x48f4af){this['channel'][_0x5837('0xae')](_0x48f4af,_0x8a992);return this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x180'),_0x4824a5['command'],_0x48f4af));}}return this['channel']['noop'](util['format'](_0x5837('0x181'),_0x4824a5['command']));};AGIVertices[_0x5837('0x16')][_0x5837('0x182')]=function(_0x4162b3){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x183'),_0x4162b3[_0x5837('0x7b')]));if(!this['isConfigured'](_0x4162b3[_0x5837('0x53')])){return this[_0x5837('0xe')][_0x5837('0x8a')]('no\x20text\x20configured');}this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x184'),_0x4162b3[_0x5837('0x53')]));var _0x23cd42=this[_0x5837('0x52')]['sync'](this,_0x4162b3);if(_0x23cd42){this[_0x5837('0xe')][_0x5837('0x8a')](util['format'](_0x5837('0x185'),_0x23cd42));var _0x3429b8=this[_0x5837('0xe')][_0x5837('0xee')](_0x23cd42);try{fs['unlink'](_0x23cd42+_0x5837('0xcf'));}catch(_0x3c9e89){logger[_0x5837('0x49')](_0x3c9e89);}return _0x3429b8;}return this[_0x5837('0xe')]['error'](_0x4162b3,_0x5837('0x186'));};AGIVertices[_0x5837('0x16')][_0x5837('0x187')]=function(_0x4d1f02){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x188'),_0x4d1f02[_0x5837('0x7b')]));if(!this[_0x5837('0x5e')](_0x4d1f02[_0x5837('0x11f')])){return this[_0x5837('0xe')][_0x5837('0x49')](_0x4d1f02,'no\x20find\x20by\x20configured');}logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x120'),this[_0x5837('0xe')]['callerid'],_0x4d1f02[_0x5837('0x11f')]));var _0x58a4af=this[_0x5837('0x4b')][_0x5837('0x78')](this,_0x4d1f02[_0x5837('0x11f')]);if(_0x58a4af){logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x121'),this[_0x5837('0xe')]['callerid'],_0x4d1f02[_0x5837('0x11f')]));this[_0x5837('0xe')][_0x5837('0x8a')](util[_0x5837('0x27')](_0x5837('0x121'),this[_0x5837('0xe')][_0x5837('0x36')],_0x4d1f02['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x5837('0x29')](util[_0x5837('0x27')](_0x5837('0x122'),this['channel'][_0x5837('0x36')],_0x4d1f02[_0x5837('0x11f')]));this[_0x5837('0xe')]['noop'](util[_0x5837('0x27')](_0x5837('0x122'),this[_0x5837('0xe')][_0x5837('0x36')],_0x4d1f02['findBy']));return{'code':0xc8,'result':_0x5837('0x123')};}};AGIVertices[_0x5837('0x16')][_0x5837('0x189')]=function(_0x3f0032){logger[_0x5837('0x29')](util['format'](_0x5837('0x18a'),_0x3f0032[_0x5837('0x7b')]));var _0x53e33d=this[_0x5837('0xe')][_0x5837('0x4f')]('VOICEMAIL',[_0x3f0032[_0x5837('0x18b')],_0x3f0032[_0x5837('0x89')]]);if(_0x53e33d['result']===-0x1){return _0x53e33d;}return this['channel'][_0x5837('0x8a')](util[_0x5837('0x27')]('Executed\x20command\x20%s\x20%s',_0x5837('0x18c'),_0x3f0032[_0x5837('0x18b')]));};AGIVertices[_0x5837('0x16')][_0x5837('0x18d')]=function(_0x17fedd){logger['info'](util[_0x5837('0x27')](_0x5837('0x18e'),_0x17fedd[_0x5837('0x7b')]));if(!this['isConfigured'](_0x17fedd[_0x5837('0xdf')])){return this['channel'][_0x5837('0x49')](_0x17fedd,_0x5837('0x16f'));}var _0x1cdbd3=this[_0x5837('0x10')][_0x5837('0x78')](this,_0x17fedd['variable_id']);if(!_0x1cdbd3){return this[_0x5837('0xe')][_0x5837('0x49')](_0x17fedd,_0x5837('0xab'));}var _0x51f2dc=this[_0x5837('0xe')]['getVariable'](_0x1cdbd3);return{'code':0xc8,'result':_0x51f2dc['extra']?_0x51f2dc[_0x5837('0x76')]:'-'};};String['prototype']['replaceAll']=function(_0x3d45de,_0x573ba0){return this['split'](_0x3d45de)[_0x5837('0x18f')](_0x573ba0);};module[_0x5837('0x190')]=AGIVertices; \ No newline at end of file +var _0x2171=['trim','replace','googleTTS','google_tts_language','key','text','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','Amy','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','agicommand','hasOwnProperty','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','getVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','retry','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','sync','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','password','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','no\x20trunk\x20selected','getTrunk','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','toString','test','stringify','mindigit','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','login','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20variable\x20selected\x20for\x20the\x20result','isArray','forEach','%s[%s]','variable\x20%s[key]\x20set','digit','isEmpty','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','macro','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','moment','../../config/logger','agi','../../config/environment','./scripts','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','getVoiceQueue','catch','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','query','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','createSquareMessage','createCmContact','callback_','random','lastName','isNil','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand'];(function(_0x440740,_0x539f09){var _0x102b0e=function(_0x374610){while(--_0x374610){_0x440740['push'](_0x440740['shift']());}};_0x102b0e(++_0x539f09);}(_0x2171,0x143));var _0x1217=function(_0x5464ab,_0x329d11){_0x5464ab=_0x5464ab-0x0;var _0x15432c=_0x2171[_0x5464ab];return _0x15432c;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x1217('0x0'));var _=require(_0x1217('0x1'));var sh=require(_0x1217('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x1217('0x3'));var Mustache=require('mustache');var logger=require(_0x1217('0x4'))(_0x1217('0x5'));var config=require(_0x1217('0x6'));var scripts=require(_0x1217('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0x1217('0x8'),_0x1217('0x9'),_0x1217('0xa')];var AGIVertices=function(_0x5bde7e,_0x46474e,_0x2a3c36){this[_0x1217('0xb')]=_0x5bde7e;this[_0x1217('0xc')]=_0x46474e;this[_0x1217('0xd')]=_0x2a3c36;};AGIVertices[_0x1217('0xe')]['getVariable']=function(_0x125efc,_0x5114fd){this[_0x1217('0xc')][_0x1217('0xf')](_0x125efc)[_0x1217('0x10')](function(_0x24336c){_0x5114fd(null,_0x24336c?_0x24336c[_0x1217('0x11')]:![]);})['catch'](function(_0x173ce0){_0x5114fd(_0x173ce0);});};AGIVertices[_0x1217('0xe')][_0x1217('0x12')]=function(_0x107d99,_0xe7c511){this['rpc']['getVoiceQueueById'](_0x107d99)[_0x1217('0x10')](function(_0x5d8f22){_0xe7c511(null,_0x5d8f22?_0x5d8f22['name']:![]);})[_0x1217('0x13')](function(_0x4877b3){_0xe7c511(_0x4877b3);});};AGIVertices['prototype'][_0x1217('0x14')]=function(_0x24a3f3,_0x417cfe){this[_0x1217('0xc')]['getSquareProjectById'](_0x24a3f3)[_0x1217('0x10')](function(_0x13a827){_0x417cfe(null,_0x13a827?_0x13a827[_0x1217('0x11')]:![]);})[_0x1217('0x13')](function(_0x512159){_0x417cfe(_0x512159);});};AGIVertices[_0x1217('0xe')][_0x1217('0x15')]=function(_0x432c61,_0x1a0a6c){this[_0x1217('0xc')][_0x1217('0x16')](_0x432c61)[_0x1217('0x10')](function(_0xa0a5fd){_0x1a0a6c(null,_0xa0a5fd?_0xa0a5fd['dsn']:![]);})[_0x1217('0x13')](function(_0x49382b){_0x1a0a6c(_0x49382b);});};AGIVertices[_0x1217('0xe')][_0x1217('0x17')]=function(_0x5f018c,_0x2a69e8){this[_0x1217('0xc')][_0x1217('0x18')](_0x5f018c)[_0x1217('0x10')](function(_0x2c625b){_0x2a69e8(null,_0x2c625b?_0x2c625b['name']:![]);})[_0x1217('0x13')](function(_0x11f512){_0x2a69e8(_0x11f512);});};AGIVertices[_0x1217('0xe')]['getTrunk']=function(_0x4a9c32,_0x590919){this[_0x1217('0xc')][_0x1217('0x19')](_0x4a9c32)['then'](function(_0x463c66){_0x590919(null,_0x463c66?_0x463c66[_0x1217('0x11')]:![]);})[_0x1217('0x13')](function(_0x3cd531){_0x590919(_0x3cd531);});};AGIVertices[_0x1217('0xe')][_0x1217('0x1a')]=function(_0x518a0a,_0x4e4c09){var _0x1c61b2=this;this[_0x1217('0xc')]['getSoundById'](_0x518a0a)[_0x1217('0x10')](function(_0x3e0d07){_0x4e4c09(null,_0x3e0d07?_0x1c61b2[_0x1217('0x1b')](_0x3e0d07[_0x1217('0x1c')]):![]);})[_0x1217('0x13')](function(_0x5eb398){_0x4e4c09(_0x5eb398);});};AGIVertices[_0x1217('0xe')][_0x1217('0x1d')]=function(_0x3060fe,_0x564c47){this['rpc'][_0x1217('0x1e')](_0x3060fe)[_0x1217('0x10')](function(_0x1b1cb9){_0x564c47(null,_0x1b1cb9?_0x1b1cb9:![]);})['catch'](function(_0x56a8b9){_0x564c47(_0x56a8b9);});};AGIVertices[_0x1217('0xe')][_0x1217('0x1f')]=function(_0xd4760e,_0x5d89d5,_0x48dff4){this[_0x1217('0xd')][_0x1217('0x1f')](_0xd4760e,_0x5d89d5)[_0x1217('0x10')](function(){_0x48dff4(null);})[_0x1217('0x13')](function(_0x41328b){_0x48dff4(_0x41328b);});};AGIVertices['prototype']['getIntervals']=function(_0x52b2fb,_0x49e917){this[_0x1217('0xc')][_0x1217('0x20')](_0x52b2fb)['then'](function(_0x103cff){if(_0x103cff){if(_0x103cff[_0x1217('0x21')]){_0x49e917(null,[_0x103cff[_0x1217('0x22')]]);}else{_0x49e917(null,_[_0x1217('0x23')](_0x103cff[_0x1217('0x24')],_0x1217('0x22')));}}else{_0x49e917(null,![]);}})[_0x1217('0x13')](function(_0x716bdb){_0x49e917(_0x716bdb);});};AGIVertices[_0x1217('0xe')][_0x1217('0x1b')]=function(_0x23daa4){return util[_0x1217('0x25')](_0x1217('0x26'),FILES_PATH,_0x23daa4);};AGIVertices[_0x1217('0xe')][_0x1217('0x27')]=function(_0x560408,_0xc189a6,_0x3ac293){odbc[_0x1217('0x28')](_0x560408,function(_0x5f5de1){if(_0x5f5de1){logger[_0x1217('0x29')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5f5de1);_0x3ac293(_0x5f5de1);}else{logger[_0x1217('0x2a')]('ODBC\x20connection\x20successfully');odbc[_0x1217('0x2b')](_0xc189a6,function(_0x7993e4,_0x3f99bb){if(_0x7993e4){logger[_0x1217('0x2a')]('Error\x20executing\x20query\x20%s',_0xc189a6);_0x3ac293(_0x7993e4);}else{logger[_0x1217('0x2a')](_0x1217('0x2c'),_0xc189a6);odbc[_0x1217('0x2d')](function(_0x4d42ee){if(_0x4d42ee){logger[_0x1217('0x29')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4d42ee);}_0x3ac293(null,_0x3f99bb);});}});}});};AGIVertices[_0x1217('0xe')][_0x1217('0x2e')]=function(_0x5c09ed,_0x153502){this[_0x1217('0xc')]['getSmsAccountById'](_0x5c09ed)[_0x1217('0x10')](function(_0x440d51){_0x153502(null,_0x440d51?_0x440d51:![]);})[_0x1217('0x13')](function(_0x4fc284){_0x153502(_0x4fc284);});};AGIVertices[_0x1217('0xe')]['createSmsMessage']=function(_0x161b7b,_0x3453f1){this['rpc'][_0x1217('0x2f')](_0x161b7b)[_0x1217('0x10')](function(_0x2b5a2d){_0x3453f1(null,_0x2b5a2d);})['catch'](function(_0x37c913){_0x3453f1(_0x37c913);});};AGIVertices[_0x1217('0xe')]['createSquareDetailsReport']=function(_0xe81b11,_0x1bdf05,_0x40a82f){this[_0x1217('0xc')][_0x1217('0x30')]({'uniqueid':this['channel'][_0x1217('0x31')],'node':_0xe81b11[_0x1217('0x32')],'application':_0xe81b11['agicommand'],'data':_0x1bdf05||null,'project_name':this[_0x1217('0xb')][_0x1217('0x33')],'callerid':this[_0x1217('0xb')][_0x1217('0x34')]})[_0x1217('0x10')](function(_0x403005){if(_0x40a82f){_0x40a82f(null,_0x403005);}})[_0x1217('0x13')](function(_0x46f5b4){if(_0x40a82f){_0x40a82f(_0x46f5b4);}});};AGIVertices[_0x1217('0xe')]['createSquareRecording']=function(_0x1d44d6,_0x32ac6a,_0x17242b,_0x4fc702){this[_0x1217('0xc')][_0x1217('0x35')]({'uniqueid':this[_0x1217('0xb')]['uniqueid'],'callerid':this[_0x1217('0xb')][_0x1217('0x34')],'calleridname':this[_0x1217('0xb')][_0x1217('0x36')],'context':this['channel']['context'],'extension':this[_0x1217('0xb')][_0x1217('0x37')],'priority':this[_0x1217('0xb')][_0x1217('0x38')],'accountcode':this[_0x1217('0xb')][_0x1217('0x39')],'dnid':this['channel']['dnid'],'projectName':this[_0x1217('0xb')]['arg_1'],'saveName':_0x32ac6a,'filename':_0x1d44d6['file']||_0x32ac6a,'savePath':_0x17242b})[_0x1217('0x10')](function(_0x19ea10){_0x4fc702(null,_0x19ea10);})[_0x1217('0x13')](function(_0x3befe2){_0x4fc702(_0x3befe2);});};AGIVertices['prototype'][_0x1217('0x3a')]=function(_0x2886df,_0x2b073d,_0x4ecbb2){this[_0x1217('0xc')][_0x1217('0x3a')]({'uniqueid':this[_0x1217('0xb')][_0x1217('0x31')],'body':_0x2886df,'direction':_0x2b073d})[_0x1217('0x10')](function(_0x47f2a4){if(_0x4ecbb2){_0x4ecbb2(null,_0x47f2a4);}})[_0x1217('0x13')](function(_0x4b4653){if(_0x4ecbb2){_0x4ecbb2(_0x4b4653);}});};AGIVertices[_0x1217('0xe')][_0x1217('0x3b')]=function(_0x297167,_0x3322b4){this[_0x1217('0xc')][_0x1217('0x3b')]({'firstName':_['isEmpty'](_0x297167[_0x1217('0x11')])||_['isNil'](_0x297167['name'])?_0x1217('0x3c')+Math[_0x1217('0x3d')]():_0x297167['name'],'lastName':_['isEmpty'](_0x297167[_0x1217('0x3e')])||_[_0x1217('0x3f')](_0x297167['lastName'])?null:_0x297167[_0x1217('0x3e')],'phone':_0x297167[_0x1217('0x40')],'ListId':_0x297167[_0x1217('0x41')],'scheduledAt':_0x297167['scheduledAt'],'callbackUniqueid':this[_0x1217('0xb')][_0x1217('0x31')],'tags':'callback','description':_0x1217('0x42')+_0x297167[_0x1217('0x43')]['toString'](),'priority':_0x297167[_0x1217('0x44')]})[_0x1217('0x10')](function(_0x53c9e6){_0x3322b4(null,_0x53c9e6);})['catch'](function(_0x48316f){_0x3322b4(_0x48316f);});};AGIVertices[_0x1217('0xe')][_0x1217('0x45')]=function(_0x54c81a,_0x57b07d){this[_0x1217('0xc')][_0x1217('0x46')](_0x54c81a)[_0x1217('0x10')](function(_0x5e7ec6){_0x57b07d(null,_0x5e7ec6?_0x5e7ec6[_0x1217('0x11')]:![]);})['catch'](function(_0x9c99ef){_0x57b07d(_0x9c99ef);});};AGIVertices[_0x1217('0xe')][_0x1217('0x47')]=function(_0x4e9e15,_0x2143a3,_0x5225f8){var _0x7d43f8={'role':'agent'};_0x7d43f8[_0x4e9e15]=this[_0x1217('0xb')][_0x1217('0x34')];this[_0x1217('0xc')]['agentPause'](_0x7d43f8,_0x2143a3,this['channel'][_0x1217('0x31')])[_0x1217('0x10')](function(_0x2a6163){_0x5225f8(null,_[_0x1217('0x3f')](_0x2a6163)?![]:!![]);})[_0x1217('0x13')](function(_0x1114a7){logger['error'](_0x1114a7);_0x5225f8(null,![]);});};AGIVertices[_0x1217('0xe')]['agentUnpause']=function(_0x4a1892,_0x238878){var _0x703631={'role':_0x1217('0x48')};_0x703631[_0x4a1892]=this[_0x1217('0xb')][_0x1217('0x34')];this[_0x1217('0xc')][_0x1217('0x49')](_0x703631)['then'](function(_0x2a0697){_0x238878(null,_['isNil'](_0x2a0697)?![]:!![]);})['catch'](function(_0x2c9d7e){logger[_0x1217('0x29')](_0x2c9d7e);_0x238878(null,![]);});};AGIVertices[_0x1217('0xe')][_0x1217('0x4a')]=function(_0x58a55b,_0xe0b159){var _0x1ecf53={'role':_0x1217('0x48')};_0x1ecf53[_0x58a55b]=this[_0x1217('0xb')][_0x1217('0x34')];this[_0x1217('0xc')][_0x1217('0x4a')](_0x1ecf53)['then'](function(_0x6ef3fb){_0xe0b159(null,_[_0x1217('0x3f')](_0x6ef3fb)?![]:!![]);})[_0x1217('0x13')](function(_0x5c9482){logger['error'](_0x5c9482);_0xe0b159(null,![]);});};AGIVertices[_0x1217('0xe')][_0x1217('0x4b')]=function(_0x34529f,_0xa58f86){var _0x1cfa5b={'role':_0x1217('0x48')};_0x1cfa5b[_0x34529f]=this[_0x1217('0xb')]['callerid'];var _0x53955e=_0x34529f!='internal'?util[_0x1217('0x25')](_0x1217('0x4c'),_0x1217('0x4d'),this[_0x1217('0xb')][_0x1217('0x34')]):undefined;this[_0x1217('0xc')][_0x1217('0x4b')](_0x1cfa5b,_0x53955e)['then'](function(_0x130e9a){_0xa58f86(null,_['isNil'](_0x130e9a)?![]:!![]);})['catch'](function(_0x3be85b){logger[_0x1217('0x29')](_0x3be85b);_0xa58f86(null,![]);});};AGIVertices[_0x1217('0xe')][_0x1217('0x4e')]=function(_0x9b165,_0x1e4012){sh['exec'](_[_0x1217('0x4f')](_0x9b165),function(_0x3710d2,_0x38d369){var _0x3811bd=_0x38d369[_0x1217('0x50')](/(\r\n|\n|\r)/gm,'');_0x1e4012(null,_0x3811bd);});};AGIVertices[_0x1217('0xe')][_0x1217('0x51')]=function(_0xd243a8,_0x5dcee6){scripts['googleTTS'](_0xd243a8['text'],_0xd243a8[_0x1217('0x52')]||'en',0x1)[_0x1217('0x10')](function(_0x201306){_0x5dcee6(null,_0x201306);})[_0x1217('0x13')](function(_0x5b2477){_0x5dcee6(_0x5b2477);});};AGIVertices['prototype']['googleDialogflow']=function(_0x4e2132,_0x2d1910){scripts['googleDialogflow'](this[_0x1217('0xb')][_0x1217('0x31')],_0x4e2132[_0x1217('0x53')],_0x4e2132[_0x1217('0x54')],_0x4e2132['dialogflow_language']||'en')[_0x1217('0x10')](function(_0x1ca78f){_0x2d1910(null,_0x1ca78f);})[_0x1217('0x13')](function(_0x2b1e87){_0x2d1910(_0x2b1e87);});};AGIVertices[_0x1217('0xe')][_0x1217('0x55')]=function(_0x57c62e,_0x5eccc6){scripts[_0x1217('0x55')](this[_0x1217('0xb')],_0x57c62e)[_0x1217('0x10')](function(_0x3c1ace){_0x5eccc6(null,_0x3c1ace);})[_0x1217('0x13')](function(_0x2e70bd){_0x5eccc6(_0x2e70bd);});};AGIVertices[_0x1217('0xe')][_0x1217('0x56')]=function(_0x3849f3,_0x1ad6e5){scripts[_0x1217('0x56')](_0x3849f3[_0x1217('0x53')],_0x3849f3[_0x1217('0x54')],_0x3849f3[_0x1217('0x57')]||_0x1217('0x58'),_0x3849f3[_0x1217('0x59')])[_0x1217('0x10')](function(_0x3d9551){_0x1ad6e5(null,_0x3d9551);})['catch'](function(_0x56ee8a){_0x1ad6e5(_0x56ee8a);});};AGIVertices['prototype'][_0x1217('0x5a')]=function(_0x418d50,_0x28502b,_0x51f8c3){scripts[_0x1217('0x5a')](_0x28502b,_0x418d50[_0x1217('0x53')],_0x418d50[_0x1217('0x5b')]||'en-US',this[_0x1217('0x5c')](_0x418d50[_0x1217('0x5d')])?_0x418d50['model']:undefined)[_0x1217('0x10')](function(_0x2b0964){_0x51f8c3(null,_0x2b0964);})[_0x1217('0x13')](function(_0x23fbdb){_0x51f8c3(_0x23fbdb);});};AGIVertices[_0x1217('0xe')][_0x1217('0x5e')]=function(_0x386ecf,_0x1d44d0){scripts[_0x1217('0x5e')](_0x386ecf['aws_access_key_id'],_0x386ecf['aws_secret_access_key'],_0x386ecf['aws_polly_region'],_0x386ecf['aws_polly_voice']||_0x1217('0x5f'),_0x386ecf['text'],_0x386ecf['aws_text_type']||_0x1217('0x54'))[_0x1217('0x10')](function(_0x649eb7){_0x1d44d0(null,_0x649eb7);})[_0x1217('0x13')](function(_0x22cd37){_0x1d44d0(_0x22cd37);});};AGIVertices[_0x1217('0xe')][_0x1217('0x60')]=function(_0x466038,_0x35e69c){scripts[_0x1217('0x60')](this[_0x1217('0xb')]['uniqueid'],_0x466038[_0x1217('0x61')],_0x466038[_0x1217('0x62')],_0x466038[_0x1217('0x63')],_0x466038['text'],_0x466038['aws_bot_name'])[_0x1217('0x10')](function(_0x48ee31){_0x35e69c(null,_0x48ee31);})[_0x1217('0x13')](function(_0x1b67fc){_0x35e69c(_0x1b67fc);});};AGIVertices['prototype'][_0x1217('0x64')]=function(_0x2b5baf,_0x3010c2,_0x18c4cb){scripts[_0x1217('0x64')](_0x3010c2,_0x2b5baf['key'],_0x2b5baf[_0x1217('0x65')]||_0x1217('0x58'))['then'](function(_0x209703){_0x18c4cb(null,_0x209703);})['catch'](function(_0x89697d){_0x18c4cb(_0x89697d);});};AGIVertices[_0x1217('0xe')][_0x1217('0x66')]=function(_0x305d6c,_0x4c2e21,_0x13fb45){scripts['tildeASR'](_0x4c2e21,_0x305d6c[_0x1217('0x67')],_0x305d6c[_0x1217('0x68')],_0x305d6c[_0x1217('0x69')])['then'](function(_0x37842e){_0x13fb45(null,_0x37842e);})[_0x1217('0x13')](function(_0x38fe29){_0x13fb45(_0x38fe29);});};AGIVertices[_0x1217('0xe')][_0x1217('0x6a')]=function(_0x2b3db7){var _0x3b0869=_['includes'](verticesWithRetry,_0x2b3db7[_0x1217('0x6b')])?_0x2b3db7:_['clone'](_0x2b3db7);for(var _0x16e49e in _0x3b0869){if(_0x3b0869[_0x1217('0x6c')](_0x16e49e)){if(_0x3b0869[_0x16e49e]&&_['isString'](_0x3b0869[_0x16e49e])){_0x3b0869[_0x16e49e]=this['replaceAllVariables'](_0x3b0869[_0x16e49e]);}}}return _0x3b0869;};AGIVertices[_0x1217('0xe')][_0x1217('0x6d')]=function(_0x2b10cf){var _0x201340=_0x2b10cf[_0x1217('0x6e')]('{');for(var _0x5df638=0x1;_0x5df638<_0x201340[_0x1217('0x6f')];_0x5df638+=0x1){var _0x2dcaa1=_0x201340[_0x5df638][_0x1217('0x6e')]('}');if(_0x2dcaa1['length']>0x1){_0x2b10cf=_0x2b10cf[_0x1217('0x70')]('{'+_0x2dcaa1[0x0]+'}',this[_0x1217('0xb')]['getVariable'](_0x2dcaa1[0x0])[_0x1217('0x71')]||_0x2dcaa1[0x0]);}}if(_0x201340['length']===0x1){return _0x2b10cf['toString']();}return this[_0x1217('0x6d')](_0x2b10cf);};AGIVertices['prototype'][_0x1217('0x72')]=function(_0x1b08a5,_0x1091dc){var _0xe98cfc=this[_0x1217('0xb')][_0x1217('0x73')](_0x1b08a5);if(_0xe98cfc['result']===-0x1){return _0xe98cfc;}logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x74'),_0x1091dc,_0xe98cfc[_0x1217('0x71')]));return this['channel'][_0x1217('0x75')](_0x1091dc,_0xe98cfc[_0x1217('0x71')]);};AGIVertices['prototype'][_0x1217('0x5c')]=function(_0x2b1950){return _0x2b1950&&_0x2b1950!=='0'&&_0x2b1950!=='-1'&&_0x2b1950!=='';};AGIVertices[_0x1217('0xe')]['maxRetry']=function(_0x422e26){this[_0x1217('0x30')]['sync'](this,_0x422e26,'-');_0x422e26[_0x1217('0x76')]=_0x422e26[_0x1217('0x77')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['agi']=function(_0x32ff75){logger['info'](util[_0x1217('0x25')](_0x1217('0x78'),_0x32ff75['label']));return this[_0x1217('0xb')][_0x1217('0x5')]([_0x32ff75[_0x1217('0x79')],_0x32ff75[_0x1217('0x7a')]]);};AGIVertices[_0x1217('0xe')][_0x1217('0x7b')]=function(_0x40f9c9){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x7c'),_0x40f9c9['label']));if(this[_0x1217('0x5c')](_0x40f9c9[_0x1217('0x7d')])){logger['info'](util[_0x1217('0x25')](_0x1217('0x7e'),_0x40f9c9['timeout']));var _0x22a63a=this[_0x1217('0xb')][_0x1217('0x7f')](_0x40f9c9[_0x1217('0x7d')]);if(_0x22a63a[_0x1217('0x80')]===-0x1){return _0x22a63a;}}return this['channel'][_0x1217('0x7b')]();};AGIVertices[_0x1217('0xe')][_0x1217('0x81')]=function(_0x31c0d0){logger['info'](util[_0x1217('0x25')](_0x1217('0x82'),_0x31c0d0[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x31c0d0[_0x1217('0x41')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x31c0d0,_0x1217('0x83'));}_0x31c0d0[_0x1217('0x43')]=moment();if(this['isConfigured'](_0x31c0d0[_0x1217('0x84')])){_0x31c0d0[_0x1217('0x43')]=moment()[_0x1217('0x85')](_0x31c0d0[_0x1217('0x84')],_0x1217('0x86'));}if(!this[_0x1217('0x5c')](_0x31c0d0[_0x1217('0x44')])){_0x31c0d0[_0x1217('0x44')]=0x2;}this[_0x1217('0x3b')][_0x1217('0x87')](this,_0x31c0d0);return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x89'),_0x31c0d0[_0x1217('0x40')],_0x31c0d0[_0x1217('0x41')],_0x31c0d0[_0x1217('0x43')]));};AGIVertices[_0x1217('0xe')]['custom_app']=function(_0x3dbe7a){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x8a'),_0x3dbe7a['label']));var _0x1b5e93=this['channel'][_0x1217('0x8b')](_0x3dbe7a[_0x1217('0x8c')],_0x3dbe7a[_0x1217('0x8d')]);if(_0x1b5e93[_0x1217('0x80')]===-0x1){return _0x1b5e93;}return this[_0x1217('0xb')][_0x1217('0x88')](util['format'](_0x1217('0x8e'),_0x3dbe7a[_0x1217('0x8c')],_0x3dbe7a[_0x1217('0x8d')]));};AGIVertices[_0x1217('0xe')][_0x1217('0x8f')]=function(_0x5f1ad1){logger['info'](util['format'](_0x1217('0x90'),_0x5f1ad1[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x5f1ad1[_0x1217('0x54')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x485d8b='\x22'+_0x5f1ad1[_0x1217('0x54')]+'\x22';if(this['isConfigured'](_0x5f1ad1[_0x1217('0x8d')])){_0x485d8b+=','+_0x5f1ad1[_0x1217('0x8d')];}var _0xa355ea=this[_0x1217('0xb')][_0x1217('0x8b')](_0x1217('0x91'),_0x485d8b);if(_0xa355ea[_0x1217('0x80')]===-0x1){return _0xa355ea;}return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x92'),_0x485d8b));};AGIVertices[_0x1217('0xe')][_0x1217('0x93')]=function(_0x49e82f){logger['info'](util['format'](_0x1217('0x94'),_0x49e82f[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x49e82f[_0x1217('0x54')])){return this['channel']['noop'](_0x1217('0x95'));}var _0x328abe='\x22'+_0x49e82f[_0x1217('0x54')]+'\x22';if(this[_0x1217('0x5c')](_0x49e82f['options'])){_0x328abe+=','+_0x49e82f['options'];}var _0x58d051=this['channel']['exec'](_0x1217('0x91'),_0x328abe);if(_0x58d051['result']===-0x1){return _0x58d051;}return this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0x92'),_0x328abe));};AGIVertices[_0x1217('0xe')][_0x1217('0x96')]=function(_0x1feaed){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x97'),_0x1feaed[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x1feaed[_0x1217('0x98')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x99'));}var _0x734cf2=_0x1feaed[_0x1217('0x98')];if(this[_0x1217('0x5c')](_0x1feaed['options'])){_0x734cf2+=','+_0x1feaed[_0x1217('0x8d')];}var _0x4261e5=this['channel'][_0x1217('0x8b')]('MRCPRecog',_0x734cf2);if(_0x4261e5[_0x1217('0x80')]===-0x1){return _0x4261e5;}var _0x424b0f=this[_0x1217('0x72')]('RECOG_CONFIDENCE()',_0x1217('0x9a'));if(_0x424b0f['result']===-0x1){return _0x424b0f;}var _0x488890=this[_0x1217('0x72')](_0x1217('0x9b'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x488890[_0x1217('0x80')]===-0x1){return _0x488890;}var _0x487fb0=this[_0x1217('0x72')](_0x1217('0x9c'),_0x1217('0x9d'));if(_0x487fb0[_0x1217('0x80')]===-0x1){return _0x487fb0;}return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x9e'),_0x734cf2));};AGIVertices[_0x1217('0xe')][_0x1217('0x9f')]=function(_0x62ec92){logger[_0x1217('0x2a')](util['format'](_0x1217('0xa0'),_0x62ec92[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x62ec92[_0x1217('0x98')])){return this[_0x1217('0xb')]['noop'](_0x1217('0x99'));}var _0x5a3d1a=_0x62ec92[_0x1217('0x98')];if(this[_0x1217('0x5c')](_0x62ec92[_0x1217('0x8d')])){_0x5a3d1a+=','+_0x62ec92['options'];}var _0x29d877=this[_0x1217('0xb')][_0x1217('0x8b')](_0x1217('0xa1'),_0x5a3d1a);if(_0x29d877[_0x1217('0x80')]===-0x1){return _0x29d877;}var _0x51ea5e=this[_0x1217('0x72')](_0x1217('0xa2'),'SESTEK_ASR_CONFIDENCE');if(_0x51ea5e[_0x1217('0x80')]===-0x1){return _0x51ea5e;}var _0x13914b=this[_0x1217('0x72')](_0x1217('0x9b'),_0x1217('0xa3'));if(_0x13914b[_0x1217('0x80')]===-0x1){return _0x13914b;}var _0x203112=this[_0x1217('0x72')](_0x1217('0x9c'),_0x1217('0xa4'));if(_0x203112['result']===-0x1){return _0x203112;}return this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5a3d1a));};AGIVertices[_0x1217('0xe')][_0x1217('0xa5')]=function(_0x453fb5){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0xa6'),_0x453fb5['label']));if(!this[_0x1217('0x5c')](_0x453fb5[_0x1217('0xa7')])){return this['channel'][_0x1217('0x29')](_0x453fb5,_0x1217('0xa8'));}var _0x6f8878=this['getSquareOdbc'][_0x1217('0x87')](this,_0x453fb5[_0x1217('0xa7')]);if(!_0x6f8878){return this[_0x1217('0xb')][_0x1217('0x29')](_0x453fb5,_0x1217('0xa9'));}if(!this[_0x1217('0x5c')](_0x453fb5[_0x1217('0x2b')])){return this['channel'][_0x1217('0x29')](_0x453fb5,_0x1217('0xaa'));}var _0x5478d6=_0x453fb5[_0x1217('0x2b')][_0x1217('0x50')](/(\r\n|\n|\r)/gm,'\x20');this[_0x1217('0xb')][_0x1217('0x88')](util['format'](_0x1217('0xab'),_0x5478d6));var _0x1d689b=this['getQueryOdbc'][_0x1217('0x87')](this,_0x6f8878,_0x5478d6);this['createSquareDetailsReport']['sync'](this,_0x453fb5,_0x5478d6);if(!this['isConfigured'](_0x453fb5[_0x1217('0xac')])){return this[_0x1217('0xb')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x471f8b=this['getVariable'][_0x1217('0x87')](this,_0x453fb5['variable_id']);if(!_0x471f8b){return this[_0x1217('0xb')][_0x1217('0x29')](_0x453fb5,_0x1217('0xad'));}var _0x1a1304=this;_0x1d689b['forEach'](function(_0x13ce95,_0x3b7582){Object['keys'](_0x13ce95)['forEach'](function(_0x17d975){_0x1a1304[_0x1217('0xb')][_0x1217('0x75')](util[_0x1217('0x25')](_0x1217('0xae'),_0x471f8b,_0x3b7582,_0x17d975),_0x13ce95[_0x17d975]);});});this[_0x1217('0xb')][_0x1217('0x75')](util[_0x1217('0x25')](_0x1217('0xaf'),_0x471f8b),_0x1d689b[_0x1217('0x6f')]);return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0xb0'),_0x471f8b));};AGIVertices[_0x1217('0xe')][_0x1217('0xb1')]=function(_0x5f1af4){logger[_0x1217('0xb2')](util[_0x1217('0x25')](_0x1217('0xb3'),_0x5f1af4[_0x1217('0x32')]));if(!this['isConfigured'](_0x5f1af4[_0x1217('0xb4')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x5f1af4,'no\x20user\x20selected');}var _0xa28814=this[_0x1217('0x17')][_0x1217('0x87')](this,_0x5f1af4[_0x1217('0xb4')]);if(!_0xa28814){return this[_0x1217('0xb')][_0x1217('0x29')](_0x5f1af4,'no\x20user\x20found');}var _0x464ec2=this[_0x1217('0xb')][_0x1217('0x8b')](_0x1217('0xb5'),[util['format'](_0x1217('0xb6'),_0xa28814),_0x5f1af4['timeout'],_0x5f1af4[_0x1217('0xb7')],_0x5f1af4[_0x1217('0xb8')]]);if(_0x464ec2[_0x1217('0x80')]===-0x1){return _0x464ec2;}return this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0xb9'),'DIAL'));};AGIVertices[_0x1217('0xe')][_0x1217('0xba')]=function(_0x2a6067){logger['info'](util['format'](_0x1217('0xbb'),_0x2a6067[_0x1217('0x32')]));if(!this['isConfigured'](_0x2a6067['key'])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0xbc'));}if(!this['isConfigured'](_0x2a6067['text'])){return this[_0x1217('0xb')][_0x1217('0x88')]('no\x20text\x20configured');}this[_0x1217('0xb')][_0x1217('0xbd')]=!![];this[_0x1217('0x30')](_0x2a6067);this[_0x1217('0x3a')](_0x2a6067[_0x1217('0x54')],'in');this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0xbe'),_0x2a6067[_0x1217('0x54')]));var _0x240ff3=this[_0x1217('0xbf')][_0x1217('0x87')](this,_0x2a6067);if(_0x240ff3){for(var _0x4c9817 in _0x240ff3){if(_0x240ff3[_0x1217('0x6c')](_0x4c9817)){this[_0x1217('0xb')]['setVariable'](util[_0x1217('0x25')]('DIALOGFLOW_%s',_0x4c9817[_0x1217('0xc0')]()),_0x240ff3[_0x4c9817]);}}this[_0x1217('0x3a')](_0x240ff3[_0x1217('0xc1')],_0x1217('0xc2'));return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0xc3'),_0x240ff3[_0x1217('0xc1')]));}return this[_0x1217('0xb')][_0x1217('0x29')](_0x2a6067,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x1217('0xe')]['sesteknda']=function(_0x5003f6){logger['info'](util[_0x1217('0x25')](_0x1217('0xc4'),_0x5003f6['label']));if(!this[_0x1217('0x5c')](_0x5003f6[_0x1217('0xc5')])){return this['channel']['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0x1217('0x5c')](_0x5003f6['username'])){return this[_0x1217('0xb')][_0x1217('0x88')]('no\x20username\x20configured');}if(!this[_0x1217('0x5c')](_0x5003f6[_0x1217('0xc6')])){return this[_0x1217('0xb')][_0x1217('0x88')]('no\x20password\x20configured');}if(!this[_0x1217('0x5c')](_0x5003f6[_0x1217('0xc7')])){return this[_0x1217('0xb')][_0x1217('0x88')]('no\x20text\x20configured');}this['channel'][_0x1217('0xbd')]=!![];this[_0x1217('0x30')](_0x5003f6);this[_0x1217('0x3a')](_0x5003f6['text'],'in');this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')]('Trying\x20SestekNDA:\x20%s',_0x5003f6[_0x1217('0x54')]));var _0x53d270=this['sestekNDA'][_0x1217('0x87')](this,_0x5003f6);if(_0x53d270){for(var _0x2050d8 in _0x53d270){if(_0x53d270[_0x1217('0x6c')](_0x2050d8)){this[_0x1217('0xb')][_0x1217('0x75')](util[_0x1217('0x25')](_0x1217('0xc8'),_0x2050d8['toUpperCase']()),_0x53d270[_0x2050d8]);}}this[_0x1217('0x3a')](_0x53d270[_0x1217('0xc1')],_0x1217('0xc2'));if(_0x53d270[_0x1217('0xc9')]){this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0xca'),_0x53d270[_0x1217('0xc9')]));var _0xe97884=this[_0x1217('0xb')][_0x1217('0xcb')](_0x53d270[_0x1217('0xc9')]);try{fs[_0x1217('0xcc')](_0x53d270[_0x1217('0xc9')]+'.wav');}catch(_0x282958){logger['error'](_0x282958);}return _0xe97884;}else{return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')]('SestekNDA\x20Result\x20%s',_0x53d270['speech']));}}return this[_0x1217('0xb')]['error'](_0x5003f6,_0x1217('0xcd'));};AGIVertices[_0x1217('0xe')][_0x1217('0xce')]=function(_0x12c7c3){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0xcf'),_0x12c7c3[_0x1217('0x32')]));return this['channel']['noop']('end');};AGIVertices['prototype'][_0x1217('0xd0')]=function(_0x4c827c){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0xd1'),_0x4c827c[_0x1217('0x32')]));var _0x503bf5='';if(_0x4c827c['trunk_id']){if(!this[_0x1217('0x5c')](_0x4c827c['trunk_id'])){return this['channel'][_0x1217('0x29')](_0x4c827c,_0x1217('0xd2'));}else{var _0x20f115=parseInt(_0x4c827c['trunk_id'],0xa);if(isNaN(_0x20f115)){_0x503bf5=_0x4c827c['trunk_id'];}else{_0x503bf5=this[_0x1217('0xd3')][_0x1217('0x87')](this,_0x4c827c[_0x1217('0xd4')]);if(!_0x503bf5){return this[_0x1217('0xb')][_0x1217('0x29')](_0x4c827c,_0x1217('0xd5'));}}}}else if(_0x4c827c[_0x1217('0xd6')]){_0x503bf5=_0x4c827c[_0x1217('0xd6')];}else{return this[_0x1217('0xb')][_0x1217('0x29')](_0x4c827c,_0x1217('0xd2'));}var _0x2a2963=this[_0x1217('0xb')][_0x1217('0x8b')](_0x1217('0xb5'),[util['format'](_0x1217('0xd7'),_0x503bf5,_0x4c827c[_0x1217('0x40')]),_0x4c827c[_0x1217('0x7d')],_0x4c827c[_0x1217('0xb7')],_0x4c827c['url']]);if(_0x2a2963[_0x1217('0x80')]===-0x1){return _0x2a2963;}return this[_0x1217('0xb')][_0x1217('0x88')](util['format'](_0x1217('0xb9'),_0x1217('0xb5')));};AGIVertices['prototype'][_0x1217('0xd8')]=function(_0x4bc6ee){logger[_0x1217('0x2a')](util['format'](_0x1217('0xd9'),_0x4bc6ee[_0x1217('0x32')]));return this[_0x1217('0xb')]['noop']('finally');};AGIVertices['prototype'][_0x1217('0x9')]=function(_0x22898b){logger[_0x1217('0x2a')](util['format'](_0x1217('0xda'),_0x22898b[_0x1217('0x32')]));if(_0x22898b[_0x1217('0x76')]===0x0){return this['maxRetry'](_0x22898b);}_0x22898b[_0x1217('0x76')]-=0x1;if(!this[_0x1217('0x5c')](_0x22898b[_0x1217('0xdb')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x22898b,_0x1217('0xdc'));}var _0x32f4f9=this[_0x1217('0x1a')][_0x1217('0x87')](this,_0x22898b[_0x1217('0xdb')]);if(!_0x32f4f9){return this[_0x1217('0xb')][_0x1217('0x29')](_0x22898b,_0x1217('0xdd'));}if(!this[_0x1217('0x5c')](_0x22898b[_0x1217('0xac')])){return this[_0x1217('0xb')][_0x1217('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x272fc3=this['channel'][_0x1217('0xde')](_0x32f4f9,_0x22898b[_0x1217('0xdf')],_0x22898b[_0x1217('0xe0')]);var _0x431334=_0x272fc3['result']?_0x272fc3[_0x1217('0x80')][_0x1217('0xe1')]():'';logger[_0x1217('0x2a')](_0x1217('0xe2'),JSON[_0x1217('0xe3')](_0x272fc3));if(_0x272fc3[_0x1217('0x80')]===-0x1){this[_0x1217('0x30')]['sync'](this,_0x22898b,_0x431334);return _0x272fc3;}else if(_0x272fc3[_0x1217('0x71')]===_0x1217('0x7d')){_0x272fc3['result']=_0x431334[_0x1217('0x6f')]>=parseInt(_0x22898b[_0x1217('0xe4')])?'x':'i';}else{_0x272fc3[_0x1217('0x80')]=_0x431334[_0x1217('0x6f')]>=parseInt(_0x22898b[_0x1217('0xe4')])&&_0x431334[_0x1217('0x6f')]<=parseInt(_0x22898b[_0x1217('0xe0')])?'x':'i';}var _0x14126d=this[_0x1217('0x73')][_0x1217('0x87')](this,_0x22898b[_0x1217('0xac')]);if(!_0x14126d){return this[_0x1217('0xb')][_0x1217('0x29')](_0x22898b,'no\x20variable\x20found');}this[_0x1217('0xb')][_0x1217('0x75')](_0x14126d,_0x431334);if(this['isConfigured'](_0x22898b[_0x1217('0xe5')])){var _0x17f4cd=parseInt(_0x22898b[_0x1217('0xe5')],0xa);var _0x2250f8=rs[_0x1217('0xe6')]({'charset':'*','length':_0x17f4cd});var _0x3b3abb=_0x431334[_0x1217('0x6f')];if(_0x3b3abb>0x0){if(_0x3b3abb>_0x17f4cd){this[_0x1217('0x30')]['sync'](this,_0x22898b,_0x22898b['hiddendigitspos']===_0x1217('0xe7')?_0x2250f8+_0x431334[_0x1217('0xe8')](_0x17f4cd):_0x431334['substr'](0x0,_0x3b3abb-_0x17f4cd)+_0x2250f8);}else{this[_0x1217('0x30')][_0x1217('0x87')](this,_0x22898b,rs[_0x1217('0xe6')]({'charset':'*','length':_0x3b3abb}));}}else{this[_0x1217('0x30')][_0x1217('0x87')](this,_0x22898b,'');}}else{this[_0x1217('0x30')][_0x1217('0x87')](this,_0x22898b,_0x431334);}return _0x272fc3;};AGIVertices['prototype'][_0x1217('0xa')]=function(_0x38919){logger[_0x1217('0x2a')](util[_0x1217('0x25')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x38919[_0x1217('0x32')]));return this[_0x1217('0x9')](_0x38919);};AGIVertices['prototype'][_0x1217('0xe9')]=function(_0x201011){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0xea'),_0x201011[_0x1217('0x32')]));this[_0x1217('0x30')][_0x1217('0x87')](this,_0x201011,_0x201011[_0x1217('0xeb')]);return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')]('GOAL\x20%s',_0x201011[_0x1217('0xeb')]));};AGIVertices[_0x1217('0xe')]['awspolly']=function(_0x10b2b6){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0xec'),_0x10b2b6[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x10b2b6[_0x1217('0x61')])||!this[_0x1217('0x5c')](_0x10b2b6['aws_secret_access_key'])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0xed'));}if(!this[_0x1217('0x5c')](_0x10b2b6[_0x1217('0x54')])){return this[_0x1217('0xb')]['noop'](_0x1217('0x95'));}this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')]('Trying\x20aws\x20Polly\x20%s',_0x10b2b6['text']));var _0x19977a=this['awsPolly']['sync'](this,_0x10b2b6);if(_0x19977a){this[_0x1217('0xb')][_0x1217('0x88')](util['format'](_0x1217('0xee'),_0x19977a));var _0x494ca3=this['channel'][_0x1217('0xcb')](_0x19977a);try{fs['unlink'](_0x19977a+'.wav');}catch(_0x4ee9a0){logger[_0x1217('0x29')](_0x4ee9a0);}return _0x494ca3;}return this[_0x1217('0xb')]['error'](_0x10b2b6,_0x1217('0xef'));};AGIVertices[_0x1217('0xe')][_0x1217('0xf0')]=function(_0x546f9b){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0xf1'),_0x546f9b[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x546f9b[_0x1217('0x61')])||!this[_0x1217('0x5c')](_0x546f9b[_0x1217('0x62')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0xed'));}if(!this[_0x1217('0x5c')](_0x546f9b['aws_bot_name'])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0xf2'));}if(!this[_0x1217('0x5c')](_0x546f9b[_0x1217('0x54')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x95'));}this['channel']['bot']=!![];this[_0x1217('0x30')](_0x546f9b);this[_0x1217('0x3a')](_0x546f9b[_0x1217('0x54')],'in');this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0xf3'),_0x546f9b[_0x1217('0x54')]));var _0x555fa8=this['awsLex']['sync'](this,_0x546f9b);if(_0x555fa8){for(var _0x50af0d in _0x555fa8){if(_0x555fa8[_0x1217('0x6c')](_0x50af0d)&&_[_0x1217('0xf4')](_0x555fa8[_0x50af0d])){this['channel'][_0x1217('0x75')](util['format'](_0x1217('0xf5'),_0x50af0d[_0x1217('0xc0')]()),_0x555fa8[_0x50af0d]);}}if(_[_0x1217('0x3f')](_0x555fa8['message'])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0xf6'));}else{this['createSquareMessage'](_0x555fa8[_0x1217('0xf7')],'out');return this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')]('Amazon\x20Lex\x20Result\x20%s',_0x555fa8[_0x1217('0xf7')]));}}return this[_0x1217('0xb')][_0x1217('0x29')](_0x546f9b,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x1217('0xe')]['googleasr']=function(_0x6386d7){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0xf8'),_0x6386d7[_0x1217('0x32')],_0x6386d7[_0x1217('0x7d')]));if(!this[_0x1217('0x5c')](_0x6386d7[_0x1217('0x53')])){return this[_0x1217('0xb')]['noop']('no\x20key\x20configured');}var _0xefd73e=_0x1217('0xf9');var _0x49efef=util[_0x1217('0x25')](_0x1217('0xfa'),FILES_PATH,rs[_0x1217('0xe6')](0x4));var _0x4cc14d=util[_0x1217('0x25')](_0x1217('0xfb'),_0x49efef,_0xefd73e);var _0x2a90e6=!![];if(_0x6386d7[_0x1217('0xfc')]==='NOBEEP'){_0x2a90e6=![];}var _0x15ae1c=this[_0x1217('0xb')][_0x1217('0xfd')](_0x49efef,_0xefd73e,_0x6386d7[_0x1217('0xfe')],_0x6386d7['timeout'],undefined,_0x2a90e6);if(_0x15ae1c['result']!==-0x1){this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0xff'),_0x4cc14d));var _0x5dc247=this[_0x1217('0x64')][_0x1217('0x87')](this,_0x6386d7,_0x4cc14d);if(_0x5dc247){for(var _0x16bfa8 in _0x5dc247){if(_0x5dc247[_0x1217('0x6c')](_0x16bfa8)){this[_0x1217('0xb')][_0x1217('0x75')](util['format']('GOOGLE_ASR_%s',_0x16bfa8['toUpperCase']()),_0x5dc247[_0x16bfa8]);}}return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x100'),JSON[_0x1217('0xe3')](_0x5dc247)));}}return _0x15ae1c;};AGIVertices[_0x1217('0xe')][_0x1217('0x101')]=function(_0x410a14){logger[_0x1217('0x2a')](util['format'](_0x1217('0x102'),_0x410a14[_0x1217('0x32')]));if(!this['isConfigured'](_0x410a14[_0x1217('0x67')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x103'));}if(!this['isConfigured'](_0x410a14['appsecret'])){return this['channel'][_0x1217('0x88')](_0x1217('0x104'));}var _0x409aad=_0x1217('0xf9');var _0x33eb16=util[_0x1217('0x25')](_0x1217('0xfa'),FILES_PATH,rs['generate'](0x4));var _0x438d3a=util[_0x1217('0x25')](_0x1217('0xfb'),_0x33eb16,_0x409aad);var _0x55aece=!![];if(_0x410a14[_0x1217('0xfc')]==='NOBEEP'){_0x55aece=![];}var _0x53e5d9=this[_0x1217('0xb')][_0x1217('0xfd')](_0x33eb16,_0x409aad,_0x410a14[_0x1217('0xfe')],_0x410a14['timeout'],undefined,_0x55aece);if(_0x53e5d9[_0x1217('0x80')]!==-0x1){this[_0x1217('0xb')][_0x1217('0x88')](util['format']('tilde\x20%s\x20file\x20created',_0x438d3a));var _0x19c0e8=this['tildeASR'][_0x1217('0x87')](this,_0x410a14,_0x438d3a);if(_0x19c0e8){for(var _0x2d4a75 in _0x19c0e8){if(_0x19c0e8[_0x1217('0x6c')](_0x2d4a75)){this[_0x1217('0xb')][_0x1217('0x75')](util['format']('TILDE_ASR_%s',_0x2d4a75[_0x1217('0xc0')]()),_0x19c0e8[_0x2d4a75]);}}return this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0x105'),JSON[_0x1217('0xe3')](_0x19c0e8)));}}return _0x53e5d9;};AGIVertices[_0x1217('0xe')][_0x1217('0x106')]=function(_0x4a3793){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x107'),_0x4a3793[_0x1217('0x32')]));return this[_0x1217('0xb')][_0x1217('0x108')](_0x4a3793['context'],_0x4a3793['extension'],_0x4a3793[_0x1217('0x38')]);};AGIVertices[_0x1217('0xe')][_0x1217('0x109')]=function(_0x14eab2){logger[_0x1217('0x2a')](util['format'](_0x1217('0x10a'),_0x14eab2[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x14eab2[_0x1217('0x10b')])){return this[_0x1217('0xb')]['error'](_0x14eab2,_0x1217('0x10c'));}try{var _0x4a5489=eval(_0x14eab2[_0x1217('0x10b')])?_0x1217('0x10d'):'false';this[_0x1217('0xb')]['noop'](util['format'](_0x1217('0x10e'),_0x14eab2[_0x1217('0x10b')],_0x4a5489));return{'code':0xc8,'result':_0x4a5489};}catch(_0x3b9b18){return{'code':0xc8,'result':_0x1217('0x10f')};}};AGIVertices[_0x1217('0xe')][_0x1217('0x110')]=function(_0x1b93ef){logger[_0x1217('0x2a')](util['format'](_0x1217('0x111'),_0x1b93ef[_0x1217('0x32')]));if(!this['isConfigured'](_0x1b93ef[_0x1217('0x112')])){return this['channel'][_0x1217('0x29')](_0x1b93ef,_0x1217('0x113'));}var _0x44df25=this[_0x1217('0x114')][_0x1217('0x87')](this,_0x1b93ef[_0x1217('0x112')]);if(!_0x44df25){return this[_0x1217('0xb')]['error'](_0x1b93ef,'no\x20intervals\x20found');}for(var _0x12357b=0x0;_0x12357b<_0x44df25[_0x1217('0x6f')];_0x12357b+=0x1){var _0xc420aa=this['channel'][_0x1217('0x73')](util['format'](_0x1217('0x115'),_0x44df25[_0x12357b]));if(_0xc420aa[_0x1217('0x80')]===-0x1){return _0xc420aa;}logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x116'),_0x44df25[_0x12357b],_0xc420aa[_0x1217('0x71')]));if(_0xc420aa[_0x1217('0x71')]==='true'){logger['info'](util[_0x1217('0x25')](_0x1217('0x116'),_0x44df25[_0x12357b],'true'));this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x116'),_0x44df25[_0x12357b],_0x1217('0x10d')));return{'code':0xc8,'result':_0x1217('0x10d')};}else{logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x116'),_0x44df25[_0x12357b],_0x1217('0x10f')));this[_0x1217('0xb')][_0x1217('0x88')](util['format'](_0x1217('0x116'),_0x44df25[_0x12357b],'false'));}}return{'code':0xc8,'result':_0x1217('0x10f')};};AGIVertices['prototype']['hangup']=function(_0x26f435){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x117'),_0x26f435['label']));return this[_0x1217('0xb')][_0x1217('0x118')]();};AGIVertices[_0x1217('0xe')][_0x1217('0x119')]=function(_0x1b8d30){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x11a'),_0x1b8d30[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x1b8d30['key'])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0xbc'));}var _0x422ba2=_0x1217('0xf9');var _0x32bc3e=util[_0x1217('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0x1217('0xe6')](0x4));var _0x214da3=util[_0x1217('0x25')]('%s.%s',_0x32bc3e,_0x422ba2);var _0x2e8d8f=!![];if(_0x1b8d30[_0x1217('0xfc')]===_0x1217('0x11b')){_0x2e8d8f=![];}var _0x2493d0=this[_0x1217('0xb')][_0x1217('0xfd')](_0x32bc3e,_0x422ba2,_0x1b8d30[_0x1217('0xfe')],_0x1b8d30[_0x1217('0x7d')],undefined,_0x2e8d8f);if(_0x2493d0[_0x1217('0x80')]!==-0x1){this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x11c'),_0x214da3));var _0x1a57d0=this['ispeechASR'][_0x1217('0x87')](this,_0x1b8d30,_0x214da3);if(_0x1a57d0){for(var _0x5dbf9e in _0x1a57d0){if(_0x1a57d0[_0x1217('0x6c')](_0x5dbf9e)){this[_0x1217('0xb')][_0x1217('0x75')](util[_0x1217('0x25')]('ISPEECH_ASR_%s',_0x5dbf9e[_0x1217('0xc0')]()),_0x1a57d0[_0x5dbf9e]);}}return this[_0x1217('0xb')][_0x1217('0x88')](util['format'](_0x1217('0x11d'),JSON['stringify'](_0x1a57d0)));}}return _0x2493d0;};AGIVertices['prototype'][_0x1217('0x11e')]=function(_0x101780){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x11f'),_0x101780[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x101780[_0x1217('0x53')])){return this['channel'][_0x1217('0x88')](_0x1217('0xbc'));}if(!this[_0x1217('0x5c')](_0x101780[_0x1217('0x54')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x95'));}this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x120'),_0x101780[_0x1217('0x54')]));var _0x4a1877=this[_0x1217('0x56')][_0x1217('0x87')](this,_0x101780);if(_0x4a1877){this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x11c'),_0x4a1877));var _0x49d42f=this[_0x1217('0xb')][_0x1217('0xcb')](_0x4a1877,_0x101780[_0x1217('0xfe')]);try{fs['unlink'](_0x4a1877+_0x1217('0x121'));}catch(_0x399fa1){logger[_0x1217('0x29')](_0x399fa1);}return _0x49d42f;}return this[_0x1217('0xb')]['error'](_0x101780,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1217('0xe')][_0x1217('0x122')]=function(_0x2218ec){logger['info'](util[_0x1217('0x25')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2218ec[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x2218ec[_0x1217('0x123')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x2218ec,_0x1217('0x124'));}logger[_0x1217('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1217('0xb')][_0x1217('0x34')],_0x2218ec[_0x1217('0x123')]));var _0x79443=this['agentLogin'][_0x1217('0x87')](this,_0x2218ec['findBy']);if(_0x79443){logger['info'](util[_0x1217('0x25')](_0x1217('0x125'),this['channel']['callerid'],_0x2218ec[_0x1217('0x123')]));this['channel'][_0x1217('0x88')](util['format'](_0x1217('0x125'),this[_0x1217('0xb')][_0x1217('0x34')],_0x2218ec[_0x1217('0x123')]));return{'code':0xc8,'result':_0x1217('0x126')};}else{logger['info'](util[_0x1217('0x25')](_0x1217('0x127'),this[_0x1217('0xb')][_0x1217('0x34')],_0x2218ec[_0x1217('0x123')]));this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x127'),this[_0x1217('0xb')]['callerid'],_0x2218ec[_0x1217('0x123')]));return{'code':0xc8,'result':_0x1217('0x128')};}};AGIVertices['prototype'][_0x1217('0x129')]=function(_0x21189e){logger[_0x1217('0x2a')](util['format'](_0x1217('0x12a'),_0x21189e[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x21189e['findBy'])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x21189e,_0x1217('0x124'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x1217('0x34')],_0x21189e['findBy']));var _0x50bb1c=this[_0x1217('0x4a')][_0x1217('0x87')](this,_0x21189e['findBy']);if(_0x50bb1c){logger[_0x1217('0x2a')](util['format'](_0x1217('0x125'),this[_0x1217('0xb')][_0x1217('0x34')],_0x21189e[_0x1217('0x123')]));this['channel'][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x125'),this[_0x1217('0xb')][_0x1217('0x34')],_0x21189e[_0x1217('0x123')]));return{'code':0xc8,'result':_0x1217('0x126')};}else{logger[_0x1217('0x2a')](util[_0x1217('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x1217('0x34')],_0x21189e['findBy']));this['channel'][_0x1217('0x88')](util['format'](_0x1217('0x127'),this[_0x1217('0xb')]['callerid'],_0x21189e[_0x1217('0x123')]));return{'code':0xc8,'result':_0x1217('0x128')};}};AGIVertices[_0x1217('0xe')][_0x1217('0x12b')]=function(_0x23f6cb){logger['info'](util[_0x1217('0x25')](_0x1217('0x12c'),_0x23f6cb['label']));if(!this[_0x1217('0x5c')](_0x23f6cb[_0x1217('0x12d')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x23f6cb,'no\x20operation\x20configured');}this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')]('math\x20%s',_0x23f6cb['operation']));var _0x572aca=eval(_0x23f6cb['operation']);if(!this[_0x1217('0x5c')](_0x23f6cb[_0x1217('0xac')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x12e'));}var _0x29d101=this[_0x1217('0x73')][_0x1217('0x87')](this,_0x23f6cb[_0x1217('0xac')]);if(!_0x29d101){return this[_0x1217('0xb')]['error'](_0x23f6cb,_0x1217('0xad'));}if(_[_0x1217('0x12f')](_0x572aca)){var _0x105b08=this;_0x572aca[_0x1217('0x130')](function(_0x3aaded,_0x315c68){_0x105b08[_0x1217('0xb')][_0x1217('0x75')](util[_0x1217('0x25')](_0x1217('0x131'),_0x29d101,_0x315c68),_0x3aaded);});return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x132'),_0x29d101));}else{return this[_0x1217('0xb')][_0x1217('0x75')](_0x29d101,_0x572aca);}};AGIVertices['prototype']['menu']=function(_0x33c428){logger[_0x1217('0x2a')](util[_0x1217('0x25')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x33c428[_0x1217('0x32')]));if(_0x33c428[_0x1217('0x76')]===0x0){return this['maxRetry'](_0x33c428);}_0x33c428[_0x1217('0x76')]-=0x1;if(!this[_0x1217('0x5c')](_0x33c428[_0x1217('0xdb')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x33c428,_0x1217('0xdc'));}var _0x131c0a=this[_0x1217('0x1a')]['sync'](this,_0x33c428[_0x1217('0xdb')]);if(!_0x131c0a){return this[_0x1217('0xb')][_0x1217('0x29')](_0x33c428,_0x1217('0xdd'));}var _0x50e832=this[_0x1217('0xb')][_0x1217('0xde')](_0x131c0a,_0x33c428[_0x1217('0xdf')],_0x33c428[_0x1217('0x133')]);var _0x1c949b=_0x50e832[_0x1217('0x80')];if(_0x50e832[_0x1217('0x80')]===-0x1){this[_0x1217('0x30')][_0x1217('0x87')](this,_0x33c428,'-1');return _0x50e832;}else if(_0x50e832['extra']===_0x1217('0x7d')){_0x50e832[_0x1217('0x80')]=_0x50e832[_0x1217('0x80')][_0x1217('0x6f')]>0x0?_0x50e832['result']:'t';}else if(_[_0x1217('0x134')](_0x50e832['result'])){_0x50e832[_0x1217('0x80')]='#';_0x1c949b='#';}if(!this[_0x1217('0x5c')](_0x33c428[_0x1217('0xac')])){this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x12e'));}else{var _0x46704c=this[_0x1217('0x73')][_0x1217('0x87')](this,_0x33c428['variable_id']);if(!_0x46704c){return this[_0x1217('0xb')][_0x1217('0x29')](_0x33c428,_0x1217('0xad'));}this[_0x1217('0xb')][_0x1217('0x75')](_0x46704c,_0x1c949b);}this[_0x1217('0x30')][_0x1217('0x87')](this,_0x33c428,_0x1c949b);return _0x50e832;};AGIVertices[_0x1217('0xe')][_0x1217('0x88')]=function(_0x488a85){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x488a85[_0x1217('0x32')]));return this['channel'][_0x1217('0x88')](_0x488a85[_0x1217('0x135')]||_0x488a85[_0x1217('0x32')]);};AGIVertices[_0x1217('0xe')][_0x1217('0x136')]=function(_0x3df76e){logger['info'](util[_0x1217('0x25')](_0x1217('0x137'),_0x3df76e[_0x1217('0x32')]));if(!this['isConfigured'](_0x3df76e['findBy'])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x3df76e,_0x1217('0x124'));}logger[_0x1217('0x2a')](util[_0x1217('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x3df76e[_0x1217('0x123')]));var _0x33f27f=this[_0x1217('0x45')][_0x1217('0x87')](this,_0x3df76e['pause_id']);var _0x5e5334=this[_0x1217('0x47')][_0x1217('0x87')](this,_0x3df76e['findBy'],_0x33f27f);if(_0x5e5334){logger['info'](util[_0x1217('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1217('0x34')],_0x3df76e[_0x1217('0x123')]));this['channel']['noop'](util[_0x1217('0x25')](_0x1217('0x125'),this[_0x1217('0xb')][_0x1217('0x34')],_0x3df76e[_0x1217('0x123')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1217('0x2a')](util[_0x1217('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1217('0xb')]['callerid'],_0x3df76e[_0x1217('0x123')]));this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0x125'),this['channel'][_0x1217('0x34')],_0x3df76e['findBy']));return{'code':0xc8,'result':_0x1217('0x128')};}};AGIVertices[_0x1217('0xe')][_0x1217('0x138')]=function(_0x259996){logger[_0x1217('0x2a')](util['format'](_0x1217('0x139'),_0x259996[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x259996[_0x1217('0xdb')])){return this['channel'][_0x1217('0x29')](_0x259996,'no\x20file\x20audio\x20selected');}var _0x111875=this[_0x1217('0x1a')]['sync'](this,_0x259996[_0x1217('0xdb')]);if(!_0x111875){return this[_0x1217('0xb')][_0x1217('0x29')](_0x259996,_0x1217('0xdd'));}var _0x32beb5=this[_0x1217('0xb')][_0x1217('0x8b')]('PLAYBACK',[_0x111875,_0x259996['opts']]);if(_0x32beb5[_0x1217('0x80')]===-0x1){return _0x32beb5;}return this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0x8e'),'PLAYBACK',_0x111875));};AGIVertices[_0x1217('0xe')][_0x1217('0x13a')]=function(_0x159569){logger[_0x1217('0x2a')](util['format'](_0x1217('0x13b'),_0x159569[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x159569['queue_id'])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x159569,_0x1217('0x13c'));}var _0x5d09a5='';var _0x595bbb=parseInt(_0x159569[_0x1217('0x13d')],0xa);if(isNaN(_0x595bbb)){_0x5d09a5=_0x159569['queue_id'];}else{_0x5d09a5=this[_0x1217('0x12')][_0x1217('0x87')](this,_0x159569[_0x1217('0x13d')]);if(!_0x5d09a5){return this[_0x1217('0xb')][_0x1217('0x29')](_0x159569,_0x1217('0x13e'));}}var _0x10faeb='';if(this[_0x1217('0x5c')](_0x159569[_0x1217('0xdb')])){var _0x104aeb=this[_0x1217('0x1a')][_0x1217('0x87')](this,_0x159569[_0x1217('0xdb')]);if(_0x104aeb){_0x10faeb=_0x104aeb;}}this[_0x1217('0x30')][_0x1217('0x87')](this,_0x159569,_0x5d09a5);if(_0x159569[_0x1217('0xb7')][_0x1217('0x13f')]('x')<0x0){_0x159569['opts']+='x';}if(_0x159569[_0x1217('0xb7')]['indexOf']('X')<0x0){_0x159569[_0x1217('0xb7')]+='X';}this[_0x1217('0xb')][_0x1217('0x75')](_0x1217('0x140'),_0x5d09a5?_0x5d09a5['toLowerCase']():'');var _0x205146=this[_0x1217('0xb')][_0x1217('0x8b')]('QUEUE',[_0x5d09a5,_0x159569[_0x1217('0xb7')],_0x159569['url'],_0x10faeb,_0x159569['timeout'],_0x159569[_0x1217('0x5')],_0x159569[_0x1217('0x141')],_0x159569['gosub'],'',_0x159569[_0x1217('0x142')]]);if(_0x205146[_0x1217('0x80')]===-0x1){return _0x205146;}return this['channel'][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x8e'),_0x1217('0x143'),_0x5d09a5));};AGIVertices[_0x1217('0xe')]['record']=function(_0x43e24a){logger['info'](util[_0x1217('0x25')](_0x1217('0x144'),_0x43e24a[_0x1217('0x32')]));var _0x45c471=_0x43e24a['recordingFormat']||'wav';var _0x6b3b3b=util[_0x1217('0x25')](_0x1217('0x145'),this['channel'][_0x1217('0x31')],rs[_0x1217('0xe6')](0x5));var _0x158567=util[_0x1217('0x25')](_0x1217('0x146'),FILES_PATH,_0x6b3b3b,_0x45c471);var _0x2d86a2=util[_0x1217('0x25')](_0x1217('0xfa'),FILES_PATH,_0x6b3b3b);this[_0x1217('0x35')][_0x1217('0x87')](this,_0x43e24a,_0x6b3b3b,_0x158567);this['channel'][_0x1217('0x75')]('RECORDING_SAVENAME',_0x6b3b3b);logger[_0x1217('0x2a')](_0x1217('0x147'),_0x2d86a2,_0x45c471,_0x43e24a['escape_digits'],_0x43e24a[_0x1217('0x7d')]);return this[_0x1217('0xb')][_0x1217('0xfd')](_0x2d86a2,_0x45c471,_0x43e24a[_0x1217('0x148')],_0x43e24a['timeout'],undefined,!![]);};AGIVertices['prototype']['saydigits']=function(_0x245c4f){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x149'),_0x245c4f['label']));return this[_0x1217('0xb')][_0x1217('0x14a')](_0x245c4f[_0x1217('0x14b')][_0x1217('0x50')](/\s+/g,''),_0x245c4f[_0x1217('0x148')]);};AGIVertices[_0x1217('0xe')]['saynumber']=function(_0x111db8){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x14c'),_0x111db8['label']));return this[_0x1217('0xb')][_0x1217('0x14d')](_0x111db8[_0x1217('0x14e')][_0x1217('0x50')](/\s+/g,''),_0x111db8['escape_digits']);};AGIVertices[_0x1217('0xe')][_0x1217('0x14f')]=function(_0x1a2b53){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x150'),_0x1a2b53[_0x1217('0x32')]));return this[_0x1217('0xb')][_0x1217('0x151')](_0x1a2b53[_0x1217('0x54')],_0x1a2b53[_0x1217('0x148')]);};AGIVertices[_0x1217('0xe')][_0x1217('0x152')]=function(_0x441218){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x153'),_0x441218[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x441218[_0x1217('0x154')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x155'));}var _0x4346ea=this[_0x1217('0x1d')][_0x1217('0x87')](this,_0x441218['account_id']);if(!_0x4346ea||!_0x4346ea[_0x1217('0x156')]){return this[_0x1217('0xb')][_0x1217('0x29')](_0x441218,_0x1217('0x157'));}var _0x5a7e3f={'from':util[_0x1217('0x25')](_0x1217('0x158'),_0x4346ea[_0x1217('0x11')],_0x4346ea[_0x1217('0x159')]||_0x4346ea[_0x1217('0x156')][_0x1217('0x15a')]),'to':_0x441218['to']||'','cc':_0x441218['cc']||'','bcc':_0x441218['bcc']||'','subject':_0x441218[_0x1217('0x15b')],'html':_0x441218[_0x1217('0x54')],'text':_0x441218[_0x1217('0x54')]};var _0x24726e={'tls':{'rejectUnauthorized':![]}};if(_0x4346ea['Smtp']['service']){_0x24726e[_0x1217('0x15c')]=_0x4346ea[_0x1217('0x156')]['service'];}else{_0x24726e['host']=_0x4346ea['Smtp'][_0x1217('0x15d')];_0x24726e[_0x1217('0x15e')]=_0x4346ea[_0x1217('0x156')][_0x1217('0x15e')];_0x24726e[_0x1217('0x15f')]=_0x4346ea[_0x1217('0x156')]['secure'];}if(_0x4346ea[_0x1217('0x156')][_0x1217('0x160')]){_0x24726e[_0x1217('0x161')]={'user':_0x4346ea[_0x1217('0x156')]['user'],'pass':_0x4346ea[_0x1217('0x156')][_0x1217('0x162')]};}if(this[_0x1217('0x5c')](_0x441218['template_id'])){}logger[_0x1217('0xb2')](_0x1217('0x163'),JSON['stringify'](_0x5a7e3f));this[_0x1217('0x30')][_0x1217('0x87')](this,_0x441218,_0x441218['account_id']);this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x164'),_0x4346ea['name']));this[_0x1217('0x1f')][_0x1217('0x87')](this,_0x24726e,_0x5a7e3f);return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x165'));};AGIVertices[_0x1217('0xe')][_0x1217('0x166')]=function(_0x15cd4a){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x167'),_0x15cd4a['label']));return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x168'));};AGIVertices[_0x1217('0xe')][_0x1217('0x169')]=function(_0x446a84){logger[_0x1217('0x2a')](util[_0x1217('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x446a84[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x446a84[_0x1217('0x16a')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x16b'));}var _0x78f353=this['getSmsAccount'][_0x1217('0x87')](this,_0x446a84['sms_account_id']);if(!_0x78f353){return this[_0x1217('0xb')]['error'](_0x446a84,_0x1217('0x16c'));}var _0x2e781e={'body':_0x446a84[_0x1217('0x16d')],'phone':_0x446a84['to']||'','SmsAccountId':_0x78f353['id']};logger['debug'](_0x1217('0x16e'),JSON['stringify'](_0x2e781e));this[_0x1217('0x30')][_0x1217('0x87')](this,_0x446a84,_0x446a84[_0x1217('0x16a')]);this['channel'][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x16f'),_0x78f353[_0x1217('0x11')]));this[_0x1217('0x2f')][_0x1217('0x87')](this,_0x2e781e);return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x170'));};AGIVertices[_0x1217('0xe')][_0x1217('0x171')]=function(_0x5421cd){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x172'),_0x5421cd[_0x1217('0x32')]));if(!this['isConfigured'](_0x5421cd[_0x1217('0xac')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x5421cd,_0x1217('0x173'));}var _0x33037=this[_0x1217('0x73')][_0x1217('0x87')](this,_0x5421cd[_0x1217('0xac')]);if(!_0x33037){return this[_0x1217('0xb')][_0x1217('0x29')](_0x5421cd,_0x1217('0xad'));}return this['channel']['setVariable'](_0x33037,_0x5421cd['variable_value']);};AGIVertices[_0x1217('0xe')][_0x1217('0x174')]=function(_0x39167b){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x175'),_0x39167b[_0x1217('0x32')]));this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x176'));if(_0x39167b[_0x1217('0x7b')]===_0x1217('0x177')){this[_0x1217('0xb')]['noop'](_0x1217('0x178'));return this[_0x1217('0xb')]['answer']();}return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x179'));};AGIVertices[_0x1217('0xe')]['subproject']=function(_0x4c8e3d){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x17a'),_0x4c8e3d[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x4c8e3d[_0x1217('0x17b')])){return this[_0x1217('0xb')]['error'](_0x4c8e3d,_0x1217('0x17c'));}var _0x38ee77=this[_0x1217('0x14')]['sync'](this,_0x4c8e3d[_0x1217('0x17b')]);if(!this['isConfigured'](_0x38ee77)){return this[_0x1217('0xb')][_0x1217('0x29')](_0x4c8e3d,util[_0x1217('0x25')](_0x1217('0x17d'),_0x4c8e3d[_0x1217('0x17b')]));}if(_0x38ee77===this[_0x1217('0xb')][_0x1217('0x33')]){return this['channel'][_0x1217('0x29')](_0x4c8e3d,_0x1217('0x17e'));}this['createSquareDetailsReport'][_0x1217('0x87')](this,_0x4c8e3d,_0x38ee77);var _0x43cc3b=this[_0x1217('0xb')][_0x1217('0x8b')](_0x1217('0x17f'),util[_0x1217('0x25')](_0x1217('0x180'),config[_0x1217('0x5')][_0x1217('0x15d')]||'127.0.0.1',_0x38ee77,this[_0x1217('0xb')][_0x1217('0x33')]));if(_0x43cc3b[_0x1217('0x80')]===-0x1){return _0x43cc3b;}return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x8e'),'AGI',_0x38ee77));};AGIVertices[_0x1217('0xe')][_0x1217('0x181')]=function(_0x45659b){logger[_0x1217('0x2a')](util['format'](_0x1217('0x182'),_0x45659b[_0x1217('0x32')]));var _0x3cedd1=this[_0x1217('0x4e')][_0x1217('0x87')](this,_0x45659b[_0x1217('0x79')]);this[_0x1217('0x30')][_0x1217('0x87')](this,_0x45659b,_0x45659b[_0x1217('0x79')]);if(this[_0x1217('0x5c')](_0x45659b['variable_id'])){var _0x24d30b=this[_0x1217('0x73')][_0x1217('0x87')](this,_0x45659b[_0x1217('0xac')]);if(_0x24d30b){this[_0x1217('0xb')]['setVariable'](_0x24d30b,_0x3cedd1);return this[_0x1217('0xb')]['noop'](util['format'](_0x1217('0x183'),_0x45659b[_0x1217('0x79')],_0x24d30b));}}return this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x184'),_0x45659b['command']));};AGIVertices[_0x1217('0xe')][_0x1217('0x185')]=function(_0x4fc5a0){logger[_0x1217('0x2a')](util['format'](_0x1217('0x186'),_0x4fc5a0[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x4fc5a0[_0x1217('0x54')])){return this[_0x1217('0xb')][_0x1217('0x88')](_0x1217('0x95'));}this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0x187'),_0x4fc5a0['text']));var _0x10236b=this[_0x1217('0x51')]['sync'](this,_0x4fc5a0);if(_0x10236b){this['channel'][_0x1217('0x88')](util[_0x1217('0x25')]('Google\x20TTS\x20%s\x20file\x20created',_0x10236b));var _0x56be04=this[_0x1217('0xb')][_0x1217('0xcb')](_0x10236b);try{fs[_0x1217('0xcc')](_0x10236b+_0x1217('0x121'));}catch(_0x3c884e){logger['error'](_0x3c884e);}return _0x56be04;}return this[_0x1217('0xb')][_0x1217('0x29')](_0x4fc5a0,_0x1217('0x188'));};AGIVertices[_0x1217('0xe')]['unpause']=function(_0x4ba769){logger['info'](util[_0x1217('0x25')](_0x1217('0x189'),_0x4ba769[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x4ba769[_0x1217('0x123')])){return this[_0x1217('0xb')][_0x1217('0x29')](_0x4ba769,_0x1217('0x124'));}logger['info'](util[_0x1217('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1217('0xb')][_0x1217('0x34')],_0x4ba769[_0x1217('0x123')]));var _0x459baf=this[_0x1217('0x49')][_0x1217('0x87')](this,_0x4ba769[_0x1217('0x123')]);if(_0x459baf){logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x125'),this[_0x1217('0xb')][_0x1217('0x34')],_0x4ba769['findBy']));this[_0x1217('0xb')]['noop'](util[_0x1217('0x25')](_0x1217('0x125'),this[_0x1217('0xb')][_0x1217('0x34')],_0x4ba769[_0x1217('0x123')]));return{'code':0xc8,'result':_0x1217('0x126')};}else{logger[_0x1217('0x2a')](util[_0x1217('0x25')](_0x1217('0x127'),this['channel'][_0x1217('0x34')],_0x4ba769[_0x1217('0x123')]));this[_0x1217('0xb')][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x127'),this[_0x1217('0xb')][_0x1217('0x34')],_0x4ba769['findBy']));return{'code':0xc8,'result':_0x1217('0x128')};}};AGIVertices[_0x1217('0xe')][_0x1217('0x18a')]=function(_0x10ac7a){logger['info'](util[_0x1217('0x25')](_0x1217('0x18b'),_0x10ac7a[_0x1217('0x32')]));var _0x1fd199=this[_0x1217('0xb')]['exec'](_0x1217('0x18c'),[_0x10ac7a[_0x1217('0x18d')],_0x10ac7a['options']]);if(_0x1fd199[_0x1217('0x80')]===-0x1){return _0x1fd199;}return this['channel'][_0x1217('0x88')](util[_0x1217('0x25')](_0x1217('0x8e'),_0x1217('0x18c'),_0x10ac7a[_0x1217('0x18d')]));};AGIVertices[_0x1217('0xe')][_0x1217('0x18e')]=function(_0x17132d){logger['info'](util['format'](_0x1217('0x18f'),_0x17132d[_0x1217('0x32')]));if(!this[_0x1217('0x5c')](_0x17132d[_0x1217('0xac')])){return this[_0x1217('0xb')]['error'](_0x17132d,_0x1217('0x173'));}var _0x578bef=this[_0x1217('0x73')]['sync'](this,_0x17132d['variable_id']);if(!_0x578bef){return this[_0x1217('0xb')]['error'](_0x17132d,'no\x20variable\x20found');}var _0x423ed6=this[_0x1217('0xb')][_0x1217('0x73')](_0x578bef);return{'code':0xc8,'result':_0x423ed6[_0x1217('0x71')]?_0x423ed6['extra']:'-'};};String[_0x1217('0xe')][_0x1217('0x70')]=function(_0x30ed42,_0x12bdd2){return this[_0x1217('0x6e')](_0x30ed42)[_0x1217('0x190')](_0x12bdd2);};module[_0x1217('0x191')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 36c1dd1..604a85f 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 _0x24ca=['acw','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','exports','util','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDispositionPause','name','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','prototype','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s'];(function(_0x17210f,_0x5955c0){var _0x3cb288=function(_0x3965c3){while(--_0x3965c3){_0x17210f['push'](_0x17210f['shift']());}};_0x3cb288(++_0x5955c0);}(_0x24ca,0x1bc));var _0xa24c=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x24ca[_0x334651];return _0x29657c;};'use strict';var util=require(_0xa24c('0x0'));var _=require('lodash');var moment=require(_0xa24c('0x1'));var ami=require(_0xa24c('0x2'));var logger=require(_0xa24c('0x3'))('acw');var RpcUser=require(_0xa24c('0x4'));var RpcVoiceAgentReport=require(_0xa24c('0x5'));function Acw(_0x195e60){this[_0xa24c('0x6')]=_0x195e60[_0xa24c('0x6')];this[_0xa24c('0x7')]=_0x195e60[_0xa24c('0x7')];this[_0xa24c('0x8')]=_0x195e60[_0xa24c('0x8')];this[_0xa24c('0x9')]={};ami['on'](_0xa24c('0xa'),this['syncAgentConnect'][_0xa24c('0xb')](this));ami['on'](_0xa24c('0xc'),this[_0xa24c('0xd')]['bind'](this));ami['on'](_0xa24c('0xe'),this[_0xa24c('0xf')][_0xa24c('0xb')](this));ami['on'](_0xa24c('0x10'),this[_0xa24c('0x11')][_0xa24c('0xb')](this));ami['on'](_0xa24c('0x12'),this[_0xa24c('0x13')][_0xa24c('0xb')](this));ami['on']('blindtransfer',this[_0xa24c('0x14')][_0xa24c('0xb')](this));ami['on'](_0xa24c('0x15'),this[_0xa24c('0x16')]['bind'](this));}function getDiff(_0x3ad0bf){var _0x3c23fc=moment()[_0xa24c('0x17')](0x0);var _0x2fcd8b=moment(_0x3ad0bf)[_0xa24c('0x17')](0x0);return _0x3c23fc[_0xa24c('0x18')](_0x2fcd8b,_0xa24c('0x19'));}Acw['prototype']['startAcw']=function(_0xb80781){try{var _0x87aa90=this;var _0x49ce53=this['channels'][_0xb80781][_0xa24c('0x1a')];var _0x1b29ad=this['channels'][_0xb80781][_0xa24c('0x1b')];var _0x5de3e6=this[_0xa24c('0x6')][_0x1b29ad];var _0x2a610a=![];var _0x1fcd4b=_0xa24c('0x1c');if(_0x5de3e6['mandatoryDisposition']){if(_0x5de3e6[_0xa24c('0x1d')][_0xa24c('0x1e')]){_0x2a610a=!![];_0x1fcd4b=_0x5de3e6[_0xa24c('0x1d')]['name'];}}ami['Action']({'action':'QueuePause','interface':_0x49ce53,'paused':!![],'reason':_0x1fcd4b})['then'](function(_0x2173f6){if(_0x87aa90[_0xa24c('0x7')][_0x49ce53]){return RpcUser[_0xa24c('0x1f')](_0x87aa90[_0xa24c('0x7')][_0x49ce53]['id'])['then'](function(_0x30ec21){if(_0x30ec21&&!_0x30ec21['voicePause']){logger[_0xa24c('0x20')](_0xa24c('0x21'),_0xb80781,_0x49ce53,_0x1b29ad);var _0x4a1cda=_0x87aa90[_0xa24c('0x9')][_0xb80781][_0xa24c('0x22')]&&_0x87aa90[_0xa24c('0x9')][_0xb80781][_0xa24c('0x23')]?_0x87aa90[_0xa24c('0x9')][_0xb80781]['destlinkedid']:_0xb80781;return RpcUser[_0xa24c('0x24')](_0x87aa90['agents'][_0x49ce53],_0x1fcd4b,_0x4a1cda)[_0xa24c('0x25')](function(_0x3951ae){if(!_0x2a610a){_0x87aa90[_0xa24c('0x8')][_0x49ce53]={};logger['info'](_0xa24c('0x26'),_0xb80781,_0x87aa90[_0xa24c('0x6')][_0x1b29ad][_0xa24c('0x27')],_0x49ce53,_0x1b29ad);_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x28')]=setTimeout(_0x87aa90[_0xa24c('0x29')][_0xa24c('0xb')](_0x87aa90,_0x49ce53),_0x87aa90['voiceQueues'][_0x1b29ad][_0xa24c('0x27')]*0x3e8);_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2a')]=moment()[_0xa24c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2c')]=_0xb80781;_0x87aa90[_0xa24c('0x8')][_0x49ce53]['queue']=_0x1b29ad;_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2d')]=function(){var _0x253d83=getDiff(_0x87aa90['timers'][_0x49ce53][_0xa24c('0x2a')]);clearTimeout(_0x87aa90['timers'][_0x49ce53][_0xa24c('0x28')]);_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x253d83},_0x87aa90[_0xa24c('0x8')][_0x49ce53][_0xa24c('0x2c')],_0x49ce53)[_0xa24c('0x25')](function(_0x52572f){logger[_0xa24c('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0xb80781,_0x253d83,_0x52572f);})[_0xa24c('0x2e')](function(_0x42ba21){logger['error']('[%s][UPDATE][ERRORS:%s]',_0xb80781,_0x42ba21);});delete _0x87aa90[_0xa24c('0x8')][_0x49ce53];};}});}else{logger[_0xa24c('0x20')](_0xa24c('0x2f'),_0xb80781,_0x49ce53,_0x1b29ad);}});}})[_0xa24c('0x2e')](function(_0x298dec){logger[_0xa24c('0x30')](_0xa24c('0x26'),_0xb80781,_0x87aa90['voiceQueues'][_0x1b29ad][_0xa24c('0x27')],_0x49ce53,_0x1b29ad);})[_0xa24c('0x31')](function(){delete _0x87aa90[_0xa24c('0x9')][_0xb80781];});}catch(_0xbd24c0){logger[_0xa24c('0x30')](_0xa24c('0x32'),_0xbd24c0[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0x29')]=function(_0x129bb9){try{var _0x4c7a30=this;if(_0x4c7a30[_0xa24c('0x8')][_0x129bb9]){_0x4c7a30[_0xa24c('0x8')][_0x129bb9][_0xa24c('0x28')]=![];var _0x1b0757=_0x4c7a30['timers'][_0x129bb9]['uniqueid'];var _0x19a65f=_0x4c7a30['timers'][_0x129bb9][_0xa24c('0x1b')];var _0x13f272=_0x4c7a30[_0xa24c('0x6')][_0x19a65f][_0xa24c('0x27')];logger[_0xa24c('0x20')]('[TIMER][STOP][AGENT:%s]',_0x129bb9);RpcUser['saveUnpause'](this[_0xa24c('0x7')][_0x129bb9]);RpcVoiceAgentReport[_0xa24c('0x35')]({'acwtime':_0x13f272,'agentacw':!![]},_0x1b0757,_0x129bb9)[_0xa24c('0x25')](function(_0x213dc3){logger[_0xa24c('0x20')](_0xa24c('0x36'),_0x1b0757,_0x13f272,_0x213dc3);})['catch'](function(_0x56f392){logger[_0xa24c('0x30')](_0xa24c('0x37'),_0x1b0757,_0x56f392);});}else{logger[_0xa24c('0x30')](_0xa24c('0x38'),_0x129bb9);if(_0x4c7a30[_0xa24c('0x8')]){logger['info'](_0xa24c('0x39'),JSON[_0xa24c('0x3a')](_0x4c7a30['timers']));}}}catch(_0x599627){logger[_0xa24c('0x30')](_0xa24c('0x3b'),_0x599627[_0xa24c('0x33')]);}};Acw['prototype']['syncAgentConnect']=function(_0x21e204){try{if(this[_0xa24c('0x6')][_0x21e204[_0xa24c('0x1b')]]&&(this[_0xa24c('0x6')][_0x21e204[_0xa24c('0x1b')]][_0xa24c('0x3c')]||this[_0xa24c('0x6')][_0x21e204[_0xa24c('0x1b')]]['mandatoryDisposition'])){if(this['agents'][_0x21e204[_0xa24c('0x1a')]]){this[_0xa24c('0x9')][_0x21e204[_0xa24c('0x2c')]]={'queue':_0x21e204['queue'],'interface':_0x21e204[_0xa24c('0x1a')],'destlinkedid':_0x21e204[_0xa24c('0x23')]};}}}catch(_0xf67572){logger[_0xa24c('0x30')](_0xa24c('0x3d'),_0xf67572[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0x16')]=function(_0x3f52fe){try{if(this[_0xa24c('0x6')][_0x3f52fe['queue']]&&(this[_0xa24c('0x6')][_0x3f52fe[_0xa24c('0x1b')]][_0xa24c('0x3c')]||this['voiceQueues'][_0x3f52fe[_0xa24c('0x1b')]][_0xa24c('0x3e')])){if(this[_0xa24c('0x7')][_0x3f52fe[_0xa24c('0x1a')]]){this[_0xa24c('0x9')][_0x3f52fe[_0xa24c('0x2c')]]={'queue':_0x3f52fe[_0xa24c('0x1b')],'interface':_0x3f52fe[_0xa24c('0x1a')]};}}}catch(_0x2ac54d){logger[_0xa24c('0x30')](_0xa24c('0x3f'),_0x2ac54d['message']);}};Acw[_0xa24c('0x34')][_0xa24c('0xd')]=function(_0x42028b){try{if(this[_0xa24c('0x9')][_0x42028b[_0xa24c('0x2c')]]&&_[_0xa24c('0x40')](this[_0xa24c('0x9')][_0x42028b[_0xa24c('0x2c')]][_0xa24c('0x22')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x42028b[_0xa24c('0x2c')]);this['startAcw'](_0x42028b[_0xa24c('0x2c')]);}else if(this[_0xa24c('0x9')][_0x42028b['linkedid']]&&_[_0xa24c('0x40')](this[_0xa24c('0x9')][_0x42028b[_0xa24c('0x41')]]['attended'])){logger['info'](_0xa24c('0x42'),_0x42028b['linkedid']);this[_0xa24c('0x43')](_0x42028b[_0xa24c('0x41')]);}}catch(_0x3c3c8b){logger[_0xa24c('0x30')](_0xa24c('0x44'),_0x3c3c8b[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0xf')]=function(_0x22a0db){try{if(this[_0xa24c('0x9')][_0x22a0db['uniqueid']]&&this[_0xa24c('0x9')][_0x22a0db[_0xa24c('0x2c')]][_0xa24c('0x22')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x22a0db['uniqueid']);this[_0xa24c('0x43')](_0x22a0db['uniqueid']);}else if(this[_0xa24c('0x9')][_0x22a0db[_0xa24c('0x41')]]&&this['channels'][_0x22a0db[_0xa24c('0x41')]][_0xa24c('0x22')]){logger[_0xa24c('0x20')](_0xa24c('0x45'),_0x22a0db[_0xa24c('0x41')]);this[_0xa24c('0x43')](_0x22a0db[_0xa24c('0x41')]);}}catch(_0xbeab78){logger['error'](_0xa24c('0x46'),_0xbeab78['message']);}};Acw['prototype']['syncAttendedTransfer']=function(_0x5bd2af){try{if(!_['isNil'](this[_0xa24c('0x9')][_0x5bd2af['transfereeuniqueid']])){this[_0xa24c('0x43')](_0x5bd2af[_0xa24c('0x47')]);if(this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]]){this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]][_0xa24c('0x22')]=!![];this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x49')]]=this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]];delete this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x48')]];}}else if(!_[_0xa24c('0x4a')](this[_0xa24c('0x9')][_0x5bd2af['transfertargetuniqueid']])){this[_0xa24c('0x43')](_0x5bd2af[_0xa24c('0x49')]);if(this['channels'][_0x5bd2af[_0xa24c('0x4b')]]){this[_0xa24c('0x9')][_0x5bd2af[_0xa24c('0x4b')]][_0xa24c('0x22')]=!![];this['channels'][_0x5bd2af['transfereeuniqueid']]=this[_0xa24c('0x9')][_0x5bd2af['origtransfereruniqueid']];delete this['channels'][_0x5bd2af[_0xa24c('0x4b')]];}}}catch(_0x2515b1){logger[_0xa24c('0x30')](_0xa24c('0x4c'),_0x2515b1['message']);}};Acw['prototype'][_0xa24c('0x14')]=function(_0x512b6f){try{if(this['channels'][_0x512b6f[_0xa24c('0x4d')]]){logger[_0xa24c('0x20')](_0xa24c('0x4e'),JSON['stringify'](_0x512b6f[_0xa24c('0x4d')]));this[_0xa24c('0x43')](_0x512b6f['transfereruniqueid']);}else if(this[_0xa24c('0x9')][_0x512b6f[_0xa24c('0x4f')]]){logger[_0xa24c('0x20')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xa24c('0x3a')](_0x512b6f[_0xa24c('0x4f')]));this[_0xa24c('0x43')](_0x512b6f[_0xa24c('0x4f')]);}}catch(_0xe56235){logger['error'](_0xa24c('0x50'),_0xe56235[_0xa24c('0x33')]);}};Acw[_0xa24c('0x34')][_0xa24c('0x11')]=function(_0xab5260){try{if(this[_0xa24c('0x6')][_0xab5260[_0xa24c('0x1b')]]&&this['voiceQueues'][_0xab5260[_0xa24c('0x1b')]][_0xa24c('0x51')]==='all'){if(this[_0xa24c('0x7')][_0xab5260[_0xa24c('0x1a')]]){logger[_0xa24c('0x20')](_0xa24c('0x52'),_0xab5260[_0xa24c('0x2c')],_0xab5260[_0xa24c('0x1a')],_0xab5260[_0xa24c('0x1b')]);return RpcUser[_0xa24c('0x24')](this[_0xa24c('0x7')][_0xab5260[_0xa24c('0x1a')]],'Auto-Pause',_0xab5260[_0xa24c('0x2c')]);}}}catch(_0x3a4abd){logger[_0xa24c('0x30')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x3a4abd[_0xa24c('0x33')]);}};module[_0xa24c('0x53')]=Acw; \ No newline at end of file +var _0x33c5=['Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0x33c5,0xe6));var _0x533c=function(_0x156489,_0x2bbaf2){_0x156489=_0x156489-0x0;var _0x4d2814=_0x33c5[_0x156489];return _0x4d2814;};'use strict';var util=require('util');var _=require(_0x533c('0x0'));var moment=require(_0x533c('0x1'));var ami=require('../ami');var logger=require(_0x533c('0x2'))(_0x533c('0x3'));var RpcUser=require(_0x533c('0x4'));var RpcVoiceAgentReport=require(_0x533c('0x5'));function Acw(_0x358127){this['voiceQueues']=_0x358127[_0x533c('0x6')];this[_0x533c('0x7')]=_0x358127[_0x533c('0x7')];this[_0x533c('0x8')]=_0x358127[_0x533c('0x8')];this[_0x533c('0x9')]={};ami['on'](_0x533c('0xa'),this[_0x533c('0xb')][_0x533c('0xc')](this));ami['on'](_0x533c('0xd'),this[_0x533c('0xe')][_0x533c('0xc')](this));ami['on'](_0x533c('0xf'),this[_0x533c('0x10')][_0x533c('0xc')](this));ami['on'](_0x533c('0x11'),this['syncAgentRingNoAnswer'][_0x533c('0xc')](this));ami['on'](_0x533c('0x12'),this[_0x533c('0x13')][_0x533c('0xc')](this));ami['on'](_0x533c('0x14'),this[_0x533c('0x15')]['bind'](this));ami['on'](_0x533c('0x16'),this[_0x533c('0x17')][_0x533c('0xc')](this));}function getDiff(_0x12ecae){var _0x2d5bc8=moment()[_0x533c('0x18')](0x0);var _0x8d7c66=moment(_0x12ecae)[_0x533c('0x18')](0x0);return _0x2d5bc8['diff'](_0x8d7c66,_0x533c('0x19'));}Acw[_0x533c('0x1a')][_0x533c('0x1b')]=function(_0x3e544f){try{var _0x56dfb7=this;var _0x1031e7=this[_0x533c('0x9')][_0x3e544f][_0x533c('0x1c')];var _0x311700=this[_0x533c('0x9')][_0x3e544f][_0x533c('0x1d')];var _0x1f0a72=this[_0x533c('0x6')][_0x311700];var _0x1f9f85=![];var _0x12e126=_0x533c('0x1e');if(_0x1f0a72[_0x533c('0x1f')]){if(_0x1f0a72[_0x533c('0x20')][_0x533c('0x21')]){_0x1f9f85=!![];_0x12e126=_0x1f0a72[_0x533c('0x20')][_0x533c('0x21')];}}ami[_0x533c('0x22')]({'action':_0x533c('0x23'),'interface':_0x1031e7,'paused':!![],'reason':_0x12e126})['then'](function(_0xce8d9){if(_0x56dfb7['agents'][_0x1031e7]){return RpcUser['getAgent'](_0x56dfb7[_0x533c('0x7')][_0x1031e7]['id'])[_0x533c('0x24')](function(_0x5f5090){if(_0x5f5090&&!_0x5f5090[_0x533c('0x25')]){logger[_0x533c('0x26')](_0x533c('0x27'),_0x3e544f,_0x1031e7,_0x311700);var _0x3dd249=_0x56dfb7['channels'][_0x3e544f][_0x533c('0x28')]&&_0x56dfb7[_0x533c('0x9')][_0x3e544f][_0x533c('0x29')]?_0x56dfb7[_0x533c('0x9')][_0x3e544f][_0x533c('0x29')]:_0x3e544f;return RpcUser[_0x533c('0x2a')](_0x56dfb7[_0x533c('0x7')][_0x1031e7],_0x12e126,_0x3dd249)[_0x533c('0x24')](function(_0xb1c937){if(!_0x1f9f85){_0x56dfb7[_0x533c('0x8')][_0x1031e7]={};logger['info'](_0x533c('0x2b'),_0x3e544f,_0x56dfb7[_0x533c('0x6')][_0x311700]['acwTimeout'],_0x1031e7,_0x311700);_0x56dfb7[_0x533c('0x8')][_0x1031e7]['timer']=setTimeout(_0x56dfb7[_0x533c('0x2c')][_0x533c('0xc')](_0x56dfb7,_0x1031e7),_0x56dfb7[_0x533c('0x6')][_0x311700][_0x533c('0x2d')]*0x3e8);_0x56dfb7[_0x533c('0x8')][_0x1031e7][_0x533c('0x2e')]=moment()[_0x533c('0x2f')](_0x533c('0x30'));_0x56dfb7[_0x533c('0x8')][_0x1031e7][_0x533c('0x31')]=_0x3e544f;_0x56dfb7[_0x533c('0x8')][_0x1031e7][_0x533c('0x1d')]=_0x311700;_0x56dfb7['timers'][_0x1031e7][_0x533c('0x32')]=function(){var _0x591499=getDiff(_0x56dfb7[_0x533c('0x8')][_0x1031e7][_0x533c('0x2e')]);clearTimeout(_0x56dfb7[_0x533c('0x8')][_0x1031e7][_0x533c('0x33')]);_0x56dfb7[_0x533c('0x8')][_0x1031e7][_0x533c('0x33')]=![];RpcVoiceAgentReport[_0x533c('0x34')]({'acwtime':_0x591499},_0x56dfb7[_0x533c('0x8')][_0x1031e7][_0x533c('0x31')],_0x1031e7)[_0x533c('0x24')](function(_0x1bbcb7){logger[_0x533c('0x26')](_0x533c('0x35'),_0x3e544f,_0x591499,_0x1bbcb7);})[_0x533c('0x36')](function(_0x3803d0){logger['error'](_0x533c('0x37'),_0x3e544f,_0x3803d0);});delete _0x56dfb7[_0x533c('0x8')][_0x1031e7];};}});}else{logger[_0x533c('0x26')](_0x533c('0x38'),_0x3e544f,_0x1031e7,_0x311700);}});}})['catch'](function(_0x3f1db9){logger[_0x533c('0x39')](_0x533c('0x2b'),_0x3e544f,_0x56dfb7[_0x533c('0x6')][_0x311700][_0x533c('0x2d')],_0x1031e7,_0x311700);})['finally'](function(){delete _0x56dfb7['channels'][_0x3e544f];});}catch(_0x538bc0){logger['error']('[ACW][START]\x20%s',_0x538bc0[_0x533c('0x3a')]);}};Acw['prototype'][_0x533c('0x2c')]=function(_0x55726a){try{var _0x34243d=this;if(_0x34243d[_0x533c('0x8')][_0x55726a]){_0x34243d[_0x533c('0x8')][_0x55726a]['timer']=![];var _0x44a18d=_0x34243d[_0x533c('0x8')][_0x55726a][_0x533c('0x31')];var _0x55b010=_0x34243d[_0x533c('0x8')][_0x55726a][_0x533c('0x1d')];var _0x30e5eb=_0x34243d['voiceQueues'][_0x55b010][_0x533c('0x2d')];logger[_0x533c('0x26')](_0x533c('0x3b'),_0x55726a);RpcUser[_0x533c('0x3c')](this[_0x533c('0x7')][_0x55726a]);RpcVoiceAgentReport[_0x533c('0x34')]({'acwtime':_0x30e5eb,'agentacw':!![]},_0x44a18d,_0x55726a)[_0x533c('0x24')](function(_0x2dbd81){logger[_0x533c('0x26')](_0x533c('0x35'),_0x44a18d,_0x30e5eb,_0x2dbd81);})[_0x533c('0x36')](function(_0x55af6e){logger[_0x533c('0x39')](_0x533c('0x37'),_0x44a18d,_0x55af6e);});}else{logger[_0x533c('0x39')](_0x533c('0x3d'),_0x55726a);if(_0x34243d[_0x533c('0x8')]){logger[_0x533c('0x26')]('[ACW][TIMERS]',JSON[_0x533c('0x3e')](_0x34243d[_0x533c('0x8')]));}}}catch(_0x41f5a2){logger['error'](_0x533c('0x3f'),_0x41f5a2[_0x533c('0x3a')]);}};Acw[_0x533c('0x1a')][_0x533c('0xb')]=function(_0x502a67){try{if(this[_0x533c('0x6')][_0x502a67['queue']]&&(this[_0x533c('0x6')][_0x502a67[_0x533c('0x1d')]]['acw']||this[_0x533c('0x6')][_0x502a67[_0x533c('0x1d')]][_0x533c('0x1f')])){if(this['agents'][_0x502a67['interface']]){this['channels'][_0x502a67['uniqueid']]={'queue':_0x502a67[_0x533c('0x1d')],'interface':_0x502a67['interface'],'destlinkedid':_0x502a67[_0x533c('0x29')]};}}}catch(_0x503852){logger[_0x533c('0x39')]('[ACW][syncAgentConnect]\x20%s',_0x503852[_0x533c('0x3a')]);}};Acw[_0x533c('0x1a')]['syncAgentConnectPreview']=function(_0x132e42){try{if(this[_0x533c('0x6')][_0x132e42[_0x533c('0x1d')]]&&(this[_0x533c('0x6')][_0x132e42[_0x533c('0x1d')]]['acw']||this[_0x533c('0x6')][_0x132e42[_0x533c('0x1d')]][_0x533c('0x1f')])){if(this[_0x533c('0x7')][_0x132e42['interface']]){this[_0x533c('0x9')][_0x132e42[_0x533c('0x31')]]={'queue':_0x132e42['queue'],'interface':_0x132e42['interface']};}}}catch(_0x1dc963){logger['error'](_0x533c('0x40'),_0x1dc963[_0x533c('0x3a')]);}};Acw[_0x533c('0x1a')][_0x533c('0xe')]=function(_0xe9354a){try{if(this[_0x533c('0x9')][_0xe9354a[_0x533c('0x31')]]&&_[_0x533c('0x41')](this['channels'][_0xe9354a[_0x533c('0x31')]][_0x533c('0x28')])){logger[_0x533c('0x26')]('[%s][HANGUP:UNIQUEID]',_0xe9354a[_0x533c('0x31')]);this[_0x533c('0x1b')](_0xe9354a['uniqueid']);}else if(this[_0x533c('0x9')][_0xe9354a['linkedid']]&&_[_0x533c('0x41')](this[_0x533c('0x9')][_0xe9354a[_0x533c('0x42')]][_0x533c('0x28')])){logger[_0x533c('0x26')](_0x533c('0x43'),_0xe9354a[_0x533c('0x42')]);this['startAcw'](_0xe9354a[_0x533c('0x42')]);}}catch(_0x24c2f4){logger[_0x533c('0x39')](_0x533c('0x44'),_0x24c2f4[_0x533c('0x3a')]);}};Acw[_0x533c('0x1a')][_0x533c('0x10')]=function(_0x50d5a2){try{if(this['channels'][_0x50d5a2['uniqueid']]&&this['channels'][_0x50d5a2[_0x533c('0x31')]][_0x533c('0x28')]){logger['info'](_0x533c('0x45'),_0x50d5a2[_0x533c('0x31')]);this[_0x533c('0x1b')](_0x50d5a2['uniqueid']);}else if(this[_0x533c('0x9')][_0x50d5a2['linkedid']]&&this['channels'][_0x50d5a2[_0x533c('0x42')]][_0x533c('0x28')]){logger[_0x533c('0x26')](_0x533c('0x46'),_0x50d5a2[_0x533c('0x42')]);this[_0x533c('0x1b')](_0x50d5a2[_0x533c('0x42')]);}}catch(_0x51190c){logger[_0x533c('0x39')]('[ACW][syncHangup]\x20%s',_0x51190c[_0x533c('0x3a')]);}};Acw[_0x533c('0x1a')][_0x533c('0x13')]=function(_0x2c7600){try{if(!_[_0x533c('0x47')](this[_0x533c('0x9')][_0x2c7600[_0x533c('0x48')]])){this[_0x533c('0x1b')](_0x2c7600['transfereeuniqueid']);if(this[_0x533c('0x9')][_0x2c7600[_0x533c('0x49')]]){this[_0x533c('0x9')][_0x2c7600[_0x533c('0x49')]][_0x533c('0x28')]=!![];this[_0x533c('0x9')][_0x2c7600['transfertargetuniqueid']]=this[_0x533c('0x9')][_0x2c7600['secondtransfereruniqueid']];delete this[_0x533c('0x9')][_0x2c7600[_0x533c('0x49')]];}}else if(!_[_0x533c('0x47')](this[_0x533c('0x9')][_0x2c7600[_0x533c('0x4a')]])){this[_0x533c('0x1b')](_0x2c7600['transfertargetuniqueid']);if(this['channels'][_0x2c7600[_0x533c('0x4b')]]){this[_0x533c('0x9')][_0x2c7600[_0x533c('0x4b')]][_0x533c('0x28')]=!![];this['channels'][_0x2c7600[_0x533c('0x48')]]=this[_0x533c('0x9')][_0x2c7600[_0x533c('0x4b')]];delete this[_0x533c('0x9')][_0x2c7600[_0x533c('0x4b')]];}}}catch(_0x2f2863){logger[_0x533c('0x39')](_0x533c('0x4c'),_0x2f2863[_0x533c('0x3a')]);}};Acw[_0x533c('0x1a')][_0x533c('0x15')]=function(_0xb8a24b){try{if(this[_0x533c('0x9')][_0xb8a24b[_0x533c('0x4d')]]){logger[_0x533c('0x26')](_0x533c('0x4e'),JSON[_0x533c('0x3e')](_0xb8a24b['transfereruniqueid']));this[_0x533c('0x1b')](_0xb8a24b['transfereruniqueid']);}else if(this['channels'][_0xb8a24b[_0x533c('0x4f')]]){logger[_0x533c('0x26')](_0x533c('0x50'),JSON[_0x533c('0x3e')](_0xb8a24b[_0x533c('0x4f')]));this[_0x533c('0x1b')](_0xb8a24b[_0x533c('0x4f')]);}}catch(_0x50df3a){logger[_0x533c('0x39')](_0x533c('0x51'),_0x50df3a['message']);}};Acw[_0x533c('0x1a')][_0x533c('0x52')]=function(_0x8174d0){try{if(this[_0x533c('0x6')][_0x8174d0['queue']]&&this[_0x533c('0x6')][_0x8174d0[_0x533c('0x1d')]]['autopause']===_0x533c('0x53')){if(this[_0x533c('0x7')][_0x8174d0['interface']]){logger[_0x533c('0x26')](_0x533c('0x54'),_0x8174d0['uniqueid'],_0x8174d0[_0x533c('0x1c')],_0x8174d0['queue']);return RpcUser['savePause'](this[_0x533c('0x7')][_0x8174d0[_0x533c('0x1c')]],_0x533c('0x55'),_0x8174d0[_0x533c('0x31')]);}}}catch(_0x5f233c){logger[_0x533c('0x39')](_0x533c('0x56'),_0x5f233c[_0x533c('0x3a')]);}};module[_0x533c('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e0efd96..93c8891 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 _0x00e4=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','once','close','connect','shutdown','fullybooted','then','actionCoreShowChannels','catch','exports','bluebird','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x37089a,_0x3a2b2e){var _0x110cf5=function(_0x286503){while(--_0x286503){_0x37089a['push'](_0x37089a['shift']());}};_0x110cf5(++_0x3a2b2e);}(_0x00e4,0x191));var _0x400e=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x00e4[_0x13e741];return _0x3f8bb3;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x400e('0x0'));var moment=require('moment');var util=require(_0x400e('0x1'));var _=require(_0x400e('0x2'));var logger=require(_0x400e('0x3'))(_0x400e('0x4'));var config=require(_0x400e('0x5'));var ami=new Manager(config[_0x400e('0x6')][_0x400e('0x7')],config['asterisk']['ip'],config[_0x400e('0x6')][_0x400e('0x8')],config[_0x400e('0x6')][_0x400e('0x9')],!![]);ami[_0x400e('0xa')]();ami[_0x400e('0xb')]=BPromise['promisify'](ami[_0x400e('0xc')]);function error(_0x24b0cb){logger[_0x400e('0xd')](util[_0x400e('0xe')](_0x400e('0xf'),config[_0x400e('0x6')][_0x400e('0x8')],config['asterisk']['ip'],config['asterisk'][_0x400e('0x7')],util[_0x400e('0x10')](_0x24b0cb,![],null)));}function close(){logger[_0x400e('0xd')](util[_0x400e('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x400e('0x6')][_0x400e('0x8')],config['asterisk']['ip'],config[_0x400e('0x6')]['port']));}ami[_0x400e('0x11')]=function(){return function(){return ami[_0x400e('0xb')]({'action':'sipshowregistry'});};};ami[_0x400e('0x12')]=function(){return function(){return ami[_0x400e('0xb')]({'action':_0x400e('0x13')});};};ami[_0x400e('0x14')]=function(){return function(){return ami[_0x400e('0xb')]({'action':_0x400e('0x15')});};};ami[_0x400e('0x16')]=function(){return function(){return ami[_0x400e('0xb')]({'action':_0x400e('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x400e('0xb')]({'action':_0x400e('0x18')});};};function connect(_0xfd0283){logger[_0x400e('0x19')](util[_0x400e('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x400e('0x6')][_0x400e('0x8')],config['asterisk']['ip'],config['asterisk'][_0x400e('0x7')]));ami[_0x400e('0x1a')]('error',error);ami[_0x400e('0x1a')](_0x400e('0x1b'),close);}ami['on'](_0x400e('0x1c'),connect);ami['on'](_0x400e('0x1d'),function(_0x83b4ed){logger['info'](util[_0x400e('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x400e('0x6')][_0x400e('0x8')],config[_0x400e('0x6')]['ip'],config[_0x400e('0x6')][_0x400e('0x7')],util[_0x400e('0x10')](_0x83b4ed,![],null)));});ami['on'](_0x400e('0x1e'),function(_0x52a76c){logger[_0x400e('0x19')](util[_0x400e('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x400e('0x6')][_0x400e('0x8')],config[_0x400e('0x6')]['ip'],config[_0x400e('0x6')][_0x400e('0x7')]));return BPromise['resolve']()[_0x400e('0x1f')](ami[_0x400e('0x11')]())[_0x400e('0x1f')](ami[_0x400e('0x12')]())[_0x400e('0x1f')](ami['actionSipPeerStatus']())[_0x400e('0x1f')](ami[_0x400e('0x16')]())[_0x400e('0x1f')](ami[_0x400e('0x20')]())[_0x400e('0x21')](function(_0x4dc21e){console['log'](_0x4dc21e);});});ami[_0x400e('0x1a')]('error',error);ami['once'](_0x400e('0x1b'),close);module[_0x400e('0x22')]=ami; \ No newline at end of file +var _0x6624=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','log','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','port','asterisk','Action','action','error','format'];(function(_0x18be56,_0xc7a6e2){var _0x29979c=function(_0x1395d0){while(--_0x1395d0){_0x18be56['push'](_0x18be56['shift']());}};_0x29979c(++_0xc7a6e2);}(_0x6624,0xd6));var _0x4662=function(_0x4f37cd,_0x24901b){_0x4f37cd=_0x4f37cd-0x0;var _0x557e8a=_0x6624[_0x4f37cd];return _0x557e8a;};'use strict';var Manager=require(_0x4662('0x0'));var BPromise=require(_0x4662('0x1'));var moment=require(_0x4662('0x2'));var util=require(_0x4662('0x3'));var _=require(_0x4662('0x4'));var logger=require(_0x4662('0x5'))(_0x4662('0x6'));var config=require(_0x4662('0x7'));var ami=new Manager(config['asterisk'][_0x4662('0x8')],config['asterisk']['ip'],config['asterisk']['username'],config[_0x4662('0x9')]['password'],!![]);ami['keepConnected']();ami[_0x4662('0xa')]=BPromise['promisify'](ami[_0x4662('0xb')]);function error(_0x43bf7f){logger[_0x4662('0xc')](util[_0x4662('0xd')](_0x4662('0xe'),config[_0x4662('0x9')]['username'],config[_0x4662('0x9')]['ip'],config[_0x4662('0x9')][_0x4662('0x8')],util[_0x4662('0xf')](_0x43bf7f,![],null)));}function close(){logger[_0x4662('0xc')](util[_0x4662('0xd')](_0x4662('0x10'),config[_0x4662('0x9')][_0x4662('0x11')],config[_0x4662('0x9')]['ip'],config[_0x4662('0x9')][_0x4662('0x8')]));}ami[_0x4662('0x12')]=function(){return function(){return ami[_0x4662('0xa')]({'action':_0x4662('0x13')});};};ami[_0x4662('0x14')]=function(){return function(){return ami[_0x4662('0xa')]({'action':'devicestatelist'});};};ami[_0x4662('0x15')]=function(){return function(){return ami['Action']({'action':_0x4662('0x16')});};};ami[_0x4662('0x17')]=function(){return function(){return ami['Action']({'action':_0x4662('0x18')});};};ami[_0x4662('0x19')]=function(){return function(){return ami['Action']({'action':_0x4662('0x1a')});};};function connect(_0x566512){logger[_0x4662('0x1b')](util[_0x4662('0xd')](_0x4662('0x1c'),config[_0x4662('0x9')]['username'],config[_0x4662('0x9')]['ip'],config[_0x4662('0x9')]['port']));ami[_0x4662('0x1d')](_0x4662('0xc'),error);ami['once']('close',close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x4e905e){logger[_0x4662('0x1b')](util[_0x4662('0xd')](_0x4662('0x1e'),config['asterisk'][_0x4662('0x11')],config['asterisk']['ip'],config[_0x4662('0x9')]['port'],util[_0x4662('0xf')](_0x4e905e,![],null)));});ami['on'](_0x4662('0x1f'),function(_0x354d06){logger[_0x4662('0x1b')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x4662('0x9')][_0x4662('0x11')],config[_0x4662('0x9')]['ip'],config[_0x4662('0x9')]['port']));return BPromise[_0x4662('0x20')]()[_0x4662('0x21')](ami[_0x4662('0x12')]())[_0x4662('0x21')](ami['actionDeviceStateList']())['then'](ami['actionSipPeerStatus']())[_0x4662('0x21')](ami[_0x4662('0x17')]())[_0x4662('0x21')](ami[_0x4662('0x19')]())[_0x4662('0x22')](function(_0x838378){console[_0x4662('0x23')](_0x838378);});});ami[_0x4662('0x1d')]('error',error);ami[_0x4662('0x1d')](_0x4662('0x24'),close);module[_0x4662('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 0e4ab29..24066d5 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 _0x32ab=['Request','request','then','rpc','memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','http'];(function(_0x2df0ff,_0x2884ba){var _0x4619e7=function(_0x210a41){while(--_0x210a41){_0x2df0ff['push'](_0x2df0ff['shift']());}};_0x4619e7(++_0x2884ba);}(_0x32ab,0x11a));var _0xb32a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x32ab[_0x42cae2];return _0x5f256f;};'use strict';var jayson=require(_0xb32a('0x0'));var BPromise=require(_0xb32a('0x1'));var logger=require(_0xb32a('0x2'))(_0xb32a('0x3'));var client=jayson[_0xb32a('0x4')][_0xb32a('0x5')]({'port':0x2329});client[_0xb32a('0x6')]=function(_0x497969,_0x785d7b){return new BPromise(function(_0x394f2c,_0x1b9e9d){return client[_0xb32a('0x7')](_0x497969,_0x785d7b)[_0xb32a('0x8')](function(_0x11aba6){logger['debug'](_0xb32a('0x9'),_0xb32a('0xa'),_0x497969,_0x785d7b,_0x11aba6);if(_0x11aba6[_0xb32a('0xb')]){logger['error'](_0xb32a('0x9'),'memberReport',_0x497969,_0x11aba6[_0xb32a('0xb')][_0xb32a('0xc')],_0x785d7b);return _0x1b9e9d(_0x11aba6[_0xb32a('0xb')][_0xb32a('0xc')]);}else{return _0x394f2c(_0x11aba6[_0xb32a('0xd')]);}})[_0xb32a('0xe')](function(_0x3c3870){logger[_0xb32a('0xb')](_0xb32a('0x9'),_0xb32a('0xa'),_0x497969,_0x3c3870,_0x785d7b);return _0x1b9e9d(_0x3c3870);});});};module[_0xb32a('0xf')]=client; \ No newline at end of file +var _0x384d=['result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x1aa640,_0x20df7f){var _0x370596=function(_0x5c752e){while(--_0x5c752e){_0x1aa640['push'](_0x1aa640['shift']());}};_0x370596(++_0x20df7f);}(_0x384d,0x1f2));var _0xd384=function(_0x4d25ed,_0x3f8140){_0x4d25ed=_0x4d25ed-0x0;var _0x54904a=_0x384d[_0x4d25ed];return _0x54904a;};'use strict';var jayson=require(_0xd384('0x0'));var BPromise=require(_0xd384('0x1'));var logger=require(_0xd384('0x2'))(_0xd384('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0xd384('0x4')]=function(_0x2dd702,_0x43c482){return new BPromise(function(_0x2573dc,_0x3b3700){return client[_0xd384('0x5')](_0x2dd702,_0x43c482)[_0xd384('0x6')](function(_0x5426b0){logger[_0xd384('0x7')](_0xd384('0x8'),_0xd384('0x9'),_0x2dd702,_0x43c482,_0x5426b0);if(_0x5426b0[_0xd384('0xa')]){logger[_0xd384('0xa')](_0xd384('0x8'),'memberReport',_0x2dd702,_0x5426b0['error'][_0xd384('0xb')],_0x43c482);return _0x3b3700(_0x5426b0[_0xd384('0xa')][_0xd384('0xb')]);}else{return _0x2573dc(_0x5426b0[_0xd384('0xc')]);}})[_0xd384('0xd')](function(_0x2e27a0){logger[_0xd384('0xa')](_0xd384('0x8'),_0xd384('0x9'),_0x2dd702,_0x2e27a0,_0x43c482);return _0x3b3700(_0x2e27a0);});});};module[_0xd384('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 1ab7144..58e1f2b 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 _0x04de=['lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','number','substring','dialCutDigit','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName'];(function(_0x554047,_0x46ec41){var _0x5d11e4=function(_0x5a026e){while(--_0x5a026e){_0x554047['push'](_0x554047['shift']());}};_0x5d11e4(++_0x46ec41);}(_0x04de,0x107));var _0xe04d=function(_0x2c4ab7,_0x16d0db){_0x2c4ab7=_0x2c4ab7-0x0;var _0x3f8e88=_0x04de[_0x2c4ab7];return _0x3f8e88;};'use strict';var util=require(_0xe04d('0x0'));var _=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));function checkNameSurname(_0x299552,_0x1e650d,_0x28f63f){var _0x1113af='';if(!_[_0xe04d('0x3')](_0x1e650d)&&_0xe04d('0x4')===typeof _0x1e650d){_0x1113af+=_0x1e650d;}if(!_[_0xe04d('0x3')](_0x28f63f)&&_0xe04d('0x4')===typeof _0x28f63f){_0x1113af+='\x20'+_0x28f63f;}if(_0x1113af!==''){return _0x1113af;}return _0x299552;}function Action(_0x4804c8,_0x4bb925,_0x4f7637){this['voiceQueue']=_0x4804c8;this[_0xe04d('0x5')]=_0x4f7637||undefined;this[_0xe04d('0x6')]=checkNameSurname(_0x4bb925[_0xe04d('0x7')][_0xe04d('0x8')],_0x4bb925[_0xe04d('0x7')][_0xe04d('0x9')],_0x4bb925[_0xe04d('0x7')][_0xe04d('0xa')]);this['number']=_0x4bb925[_0xe04d('0x7')][_0xe04d('0x8')];this[_0xe04d('0xb')]=_0x4804c8[_0xe04d('0x6')];this[_0xe04d('0xc')]=_0x4bb925[_0xe04d('0xc')]||![];this[_0xe04d('0xd')]=_0x4804c8[_0xe04d('0xd')];this[_0xe04d('0xe')]=_0x4804c8['dialQueueTimeout']||0x3;this[_0xe04d('0xf')]=_0x4bb925[_0xe04d('0xf')];this[_0xe04d('0x10')]=_0x4bb925[_0xe04d('0x10')];this[_0xe04d('0x11')]=_0x4bb925[_0xe04d('0x11')];this[_0xe04d('0x12')]=_0x4bb925[_0xe04d('0x12')];this[_0xe04d('0x13')]=_0x4bb925[_0xe04d('0x13')];this[_0xe04d('0x14')]=_0x4bb925[_0xe04d('0x14')];this['UserId']=_0x4bb925[_0xe04d('0x15')];this['VoiceQueueId']=_0x4bb925[_0xe04d('0x16')];this['CampaignId']=_0x4bb925[_0xe04d('0x17')];this[_0xe04d('0x18')]=_0x4bb925['id'];this[_0xe04d('0x19')]=_0x4bb925[_0xe04d('0x7')][_0xe04d('0x9')]||'';this[_0xe04d('0x1a')]=moment()[_0xe04d('0x1b')](_0xe04d('0x1c'));this[_0xe04d('0x1d')]=_0x4bb925['callback'];this[_0xe04d('0x1e')]=_0x4bb925[_0xe04d('0x1e')];this[_0xe04d('0x1f')]=_0x4bb925[_0xe04d('0x1f')];this[_0xe04d('0x20')]=_0x4bb925[_0xe04d('0x20')];this['originatecalleridnum']='';this[_0xe04d('0x21')]='';}Action[_0xe04d('0x22')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xe04d('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xe04d('0x23')][_0xe04d('0x24')](this['voiceQueue'][_0xe04d('0x25')]):this['number']);};Action[_0xe04d('0x22')]['getQueue']=function(){return this[_0xe04d('0xb')];};module[_0xe04d('0x26')]=Action; \ No newline at end of file +var _0xb647=['number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','isNil','voiceQueue','uniqueid','name','Contact','phone'];(function(_0x2803ab,_0x1c33f2){var _0x3d6e8e=function(_0x8a86f1){while(--_0x8a86f1){_0x2803ab['push'](_0x2803ab['shift']());}};_0x3d6e8e(++_0x1c33f2);}(_0xb647,0xdb));var _0x7b64=function(_0x24b5e0,_0x4877ca){_0x24b5e0=_0x24b5e0-0x0;var _0x19dd4c=_0xb647[_0x24b5e0];return _0x19dd4c;};'use strict';var util=require(_0x7b64('0x0'));var _=require(_0x7b64('0x1'));var moment=require(_0x7b64('0x2'));function checkNameSurname(_0x248af6,_0x38de52,_0x3b659e){var _0x274824='';if(!_[_0x7b64('0x3')](_0x38de52)&&'string'===typeof _0x38de52){_0x274824+=_0x38de52;}if(!_[_0x7b64('0x3')](_0x3b659e)&&'string'===typeof _0x3b659e){_0x274824+='\x20'+_0x3b659e;}if(_0x274824!==''){return _0x274824;}return _0x248af6;}function Action(_0x1daa28,_0x38ebf7,_0x31915b){this[_0x7b64('0x4')]=_0x1daa28;this[_0x7b64('0x5')]=_0x31915b||undefined;this[_0x7b64('0x6')]=checkNameSurname(_0x38ebf7[_0x7b64('0x7')][_0x7b64('0x8')],_0x38ebf7[_0x7b64('0x7')]['firstName'],_0x38ebf7[_0x7b64('0x7')]['lastName']);this[_0x7b64('0x9')]=_0x38ebf7['Contact']['phone'];this[_0x7b64('0xa')]=_0x1daa28[_0x7b64('0x6')];this['active']=_0x38ebf7[_0x7b64('0xb')]||![];this[_0x7b64('0xc')]=_0x1daa28[_0x7b64('0xc')];this[_0x7b64('0xd')]=_0x1daa28[_0x7b64('0xd')]||0x3;this[_0x7b64('0xe')]=_0x38ebf7[_0x7b64('0xe')];this['countbusyretry']=_0x38ebf7[_0x7b64('0xf')];this['countcongestionretry']=_0x38ebf7['countcongestionretry'];this[_0x7b64('0x10')]=_0x38ebf7[_0x7b64('0x10')];this[_0x7b64('0x11')]=_0x38ebf7[_0x7b64('0x11')];this[_0x7b64('0x12')]=_0x38ebf7[_0x7b64('0x12')];this[_0x7b64('0x13')]=_0x38ebf7['UserId'];this[_0x7b64('0x14')]=_0x38ebf7[_0x7b64('0x14')];this[_0x7b64('0x15')]=_0x38ebf7[_0x7b64('0x15')];this[_0x7b64('0x16')]=_0x38ebf7['id'];this['ContactFirstName']=_0x38ebf7[_0x7b64('0x7')][_0x7b64('0x17')]||'';this['starttime']=moment()[_0x7b64('0x18')](_0x7b64('0x19'));this['callback']=_0x38ebf7[_0x7b64('0x1a')];this[_0x7b64('0x1b')]=_0x38ebf7[_0x7b64('0x1b')];this[_0x7b64('0x1c')]=_0x38ebf7['callbackat'];this[_0x7b64('0x1d')]=_0x38ebf7[_0x7b64('0x1d')];this['originatecalleridnum']='';this[_0x7b64('0x1e')]='';}Action['prototype'][_0x7b64('0x1f')]=function(){return util['format'](_0x7b64('0x20'),this[_0x7b64('0x6')],this[_0x7b64('0x4')][_0x7b64('0x21')]>0x0?this[_0x7b64('0x9')][_0x7b64('0x22')](this[_0x7b64('0x4')][_0x7b64('0x21')]):this[_0x7b64('0x9')]);};Action[_0x7b64('0x23')][_0x7b64('0x24')]=function(){return this[_0x7b64('0xa')];};module[_0x7b64('0x25')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b78cd4b..512f5a5 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 _0xa45d=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback'];(function(_0xb65f0c,_0xe60c57){var _0x2ff246=function(_0x7d191c){while(--_0x7d191c){_0xb65f0c['push'](_0xb65f0c['shift']());}};_0x2ff246(++_0xe60c57);}(_0xa45d,0x17b));var _0xda45=function(_0x521fc4,_0x401320){_0x521fc4=_0x521fc4-0x0;var _0x2661f8=_0xa45d[_0x521fc4];return _0x2661f8;};'use strict';var util=require('util');var _=require(_0xda45('0x0'));var moment=require(_0xda45('0x1'));function getSeconds(_0x342b41,_0xc0ce9e){var _0x4c9703=moment(_0x342b41)[_0xda45('0x2')](0x0);var _0x175063=moment(_0xc0ce9e)[_0xda45('0x2')](0x0);return _0x4c9703[_0xda45('0x3')](_0x175063,_0xda45('0x4'));}function AgentComplete(_0xeda664,_0x16730b){this[_0xda45('0x5')]=0x4;this[_0xda45('0x6')]=_0xda45('0x7');this[_0xda45('0x8')]=_0xeda664[_0xda45('0x8')];this[_0xda45('0x9')]=_0xeda664['type'];this[_0xda45('0xa')]=_0xeda664[_0xda45('0x9')]==='outbound'?_0xda45('0xb'):_0xeda664[_0xda45('0x9')];this[_0xda45('0xc')]=_0xeda664[_0xda45('0xc')];this[_0xda45('0xd')]=_0xeda664[_0xda45('0xd')];this['countnoanswerretry']=_0xeda664[_0xda45('0xe')];this['countglobal']=_0xeda664[_0xda45('0xc')]+_0xeda664['countcongestionretry']+_0xeda664[_0xda45('0xe')];this[_0xda45('0xf')]=_0x16730b['uniqueid'];this[_0xda45('0x10')]=_0xeda664[_0xda45('0x11')];this[_0xda45('0x12')]=_0xeda664[_0xda45('0x13')];this[_0xda45('0x14')]=_0xeda664['starttime'];this[_0xda45('0x15')]=_0xeda664['responsetime'];this[_0xda45('0x16')]=_0xeda664[_0xda45('0x16')];this[_0xda45('0x17')]=moment()[_0xda45('0x18')](_0xda45('0x19'));this[_0xda45('0x1a')]=getSeconds(_0xeda664[_0xda45('0x15')],_0xeda664[_0xda45('0x14')]);this['holdtime']=getSeconds(_0xeda664['answertime'],_0xeda664[_0xda45('0x15')]);this[_0xda45('0x1b')]=getSeconds(this[_0xda45('0x17')],_0xeda664['answertime']);this[_0xda45('0xb')]=_0x16730b[_0xda45('0xb')];this[_0xda45('0x1c')]=_0x16730b[_0xda45('0x1c')];this[_0xda45('0x1d')]=_0x16730b['reason'];this[_0xda45('0x1e')]=_0xeda664['callback'];this[_0xda45('0x1f')]=_0xeda664[_0xda45('0x1f')];this['callbackat']=_0xeda664[_0xda45('0x20')];this['recallme']=_0xeda664[_0xda45('0x21')];this['ContactId']=_0xeda664[_0xda45('0x22')];this[_0xda45('0x23')]=_0xeda664['ListId'];this[_0xda45('0x24')]=_0xeda664[_0xda45('0x24')];this['VoiceQueueId']=_0xeda664['VoiceQueueId'];this[_0xda45('0x25')]=_0xeda664[_0xda45('0x25')];this[_0xda45('0x26')]=_0xeda664['originatecalleridnum']||'';this[_0xda45('0x27')]=_0xeda664[_0xda45('0x27')]||'';}module[_0xda45('0x28')]=AgentComplete; \ No newline at end of file +var _0xa53c=['lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0xa53c,0x1e0));var _0xca53=function(_0x106aec,_0x3004fe){_0x106aec=_0x106aec-0x0;var _0x53cf90=_0xa53c[_0x106aec];return _0x53cf90;};'use strict';var util=require('util');var _=require(_0xca53('0x0'));var moment=require(_0xca53('0x1'));function getSeconds(_0x36050b,_0x457279){var _0x4a713f=moment(_0x36050b)['milliseconds'](0x0);var _0x539bc1=moment(_0x457279)[_0xca53('0x2')](0x0);return _0x4a713f[_0xca53('0x3')](_0x539bc1,'seconds');}function AgentComplete(_0x1088e4,_0x56d79a){this[_0xca53('0x4')]=0x4;this[_0xca53('0x5')]=_0xca53('0x6');this[_0xca53('0x7')]=_0x1088e4[_0xca53('0x7')];this[_0xca53('0x8')]=_0x1088e4['type'];this[_0xca53('0x9')]=_0x1088e4[_0xca53('0x8')]===_0xca53('0xa')?_0xca53('0xb'):_0x1088e4['type'];this[_0xca53('0xc')]=_0x1088e4[_0xca53('0xc')];this[_0xca53('0xd')]=_0x1088e4[_0xca53('0xd')];this[_0xca53('0xe')]=_0x1088e4[_0xca53('0xe')];this[_0xca53('0xf')]=_0x1088e4[_0xca53('0xc')]+_0x1088e4[_0xca53('0xd')]+_0x1088e4[_0xca53('0xe')];this[_0xca53('0x10')]=_0x56d79a[_0xca53('0x10')];this['calleridname']=_0x1088e4[_0xca53('0x11')];this[_0xca53('0x12')]=_0x1088e4['number'];this[_0xca53('0x13')]=_0x1088e4[_0xca53('0x13')];this[_0xca53('0x14')]=_0x1088e4[_0xca53('0x14')];this[_0xca53('0x15')]=_0x1088e4['answertime'];this[_0xca53('0x16')]=moment()[_0xca53('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xca53('0x18')]=getSeconds(_0x1088e4[_0xca53('0x14')],_0x1088e4['starttime']);this[_0xca53('0x19')]=getSeconds(_0x1088e4[_0xca53('0x15')],_0x1088e4[_0xca53('0x14')]);this[_0xca53('0x1a')]=getSeconds(this[_0xca53('0x16')],_0x1088e4[_0xca53('0x15')]);this[_0xca53('0xb')]=_0x56d79a['queue'];this[_0xca53('0x1b')]=_0x56d79a[_0xca53('0x1b')];this[_0xca53('0x1c')]=_0x56d79a['reason'];this[_0xca53('0x1d')]=_0x1088e4['callback'];this['callbackuniqueid']=_0x1088e4['callbackuniqueid'];this[_0xca53('0x1e')]=_0x1088e4[_0xca53('0x1e')];this[_0xca53('0x1f')]=_0x1088e4[_0xca53('0x1f')];this[_0xca53('0x20')]=_0x1088e4['ContactId'];this[_0xca53('0x21')]=_0x1088e4[_0xca53('0x21')];this[_0xca53('0x22')]=_0x1088e4[_0xca53('0x22')];this[_0xca53('0x23')]=_0x1088e4['VoiceQueueId'];this[_0xca53('0x24')]=_0x1088e4[_0xca53('0x24')];this[_0xca53('0x25')]=_0x1088e4['originatecalleridnum']||'';this[_0xca53('0x26')]=_0x1088e4[_0xca53('0x26')]||'';}module[_0xca53('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 3134cbe..8faee47 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 _0x80c4=['milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment'];(function(_0x539a58,_0x4ecaaf){var _0x46cf98=function(_0x5dda1c){while(--_0x5dda1c){_0x539a58['push'](_0x539a58['shift']());}};_0x46cf98(++_0x4ecaaf);}(_0x80c4,0xa3));var _0x480c=function(_0x34b02e,_0xdb9397){_0x34b02e=_0x34b02e-0x0;var _0x78c524=_0x80c4[_0x34b02e];return _0x78c524;};'use strict';var util=require(_0x480c('0x0'));var _=require('lodash');var moment=require(_0x480c('0x1'));function getSeconds(_0x260386,_0x33fc1a){var _0x44e9d7=moment(_0x260386)[_0x480c('0x2')](0x0);var _0x36a6c3=moment(_0x33fc1a)['milliseconds'](0x0);return _0x44e9d7[_0x480c('0x3')](_0x36a6c3,_0x480c('0x4'));}function Final(_0x20daac){this[_0x480c('0x5')]=_0x20daac[_0x480c('0x5')];this[_0x480c('0x6')]=_0x20daac[_0x480c('0x6')];this[_0x480c('0x7')]=_0x20daac[_0x480c('0x7')];this['campaigntype']=_0x20daac[_0x480c('0x7')]===_0x480c('0x8')?_0x480c('0x9'):_0x20daac[_0x480c('0x7')];this[_0x480c('0xa')]=_0x20daac[_0x480c('0xa')];this[_0x480c('0xb')]=_0x20daac[_0x480c('0xb')];this[_0x480c('0xc')]=_0x20daac[_0x480c('0xc')];this[_0x480c('0xd')]=_0x20daac[_0x480c('0xa')]+_0x20daac[_0x480c('0xb')]+_0x20daac[_0x480c('0xc')];this[_0x480c('0x9')]=_0x20daac[_0x480c('0x9')];this[_0x480c('0xe')]=_0x20daac[_0x480c('0xe')];this['calleridnum']=_0x20daac[_0x480c('0xf')];this[_0x480c('0x10')]=_0x20daac['starttime'];this[_0x480c('0x11')]=_0x20daac[_0x480c('0x11')];this[_0x480c('0x12')]=_0x20daac['responsetime'];this['ringtime']=_0x20daac[_0x480c('0x13')]||0x0;this[_0x480c('0x14')]=_0x20daac[_0x480c('0x14')]||0x0;this[_0x480c('0x15')]=_0x20daac[_0x480c('0x15')]||0x0;this['callback']=_0x20daac['callback'];this['callbackuniqueid']=_0x20daac[_0x480c('0x16')];this[_0x480c('0x17')]=_0x20daac['callbackat'];this[_0x480c('0x18')]=_0x20daac['recallme'];this[_0x480c('0x19')]=_0x20daac[_0x480c('0x19')];this[_0x480c('0x1a')]=_0x20daac['ListId'];this[_0x480c('0x1b')]=_0x20daac[_0x480c('0x1b')];this[_0x480c('0x1c')]=_0x20daac['VoiceQueueId'];this[_0x480c('0x1d')]=_0x20daac['CampaignId'];this[_0x480c('0x1e')]=_0x20daac[_0x480c('0x1e')]||'';this['originatecalleridname']=_0x20daac[_0x480c('0x1f')]||'';}module[_0x480c('0x20')]=Final; \ No newline at end of file +var _0x47a1=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound'];(function(_0x2f8738,_0x20f84){var _0x91c3d7=function(_0x3a58a9){while(--_0x3a58a9){_0x2f8738['push'](_0x2f8738['shift']());}};_0x91c3d7(++_0x20f84);}(_0x47a1,0xbd));var _0x147a=function(_0x3f54a2,_0x368d4b){_0x3f54a2=_0x3f54a2-0x0;var _0x4d9fb5=_0x47a1[_0x3f54a2];return _0x4d9fb5;};'use strict';var util=require(_0x147a('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x418194,_0x575af9){var _0x17575a=moment(_0x418194)[_0x147a('0x1')](0x0);var _0x5e69bc=moment(_0x575af9)[_0x147a('0x1')](0x0);return _0x17575a[_0x147a('0x2')](_0x5e69bc,_0x147a('0x3'));}function Final(_0x17f2c0){this[_0x147a('0x4')]=_0x17f2c0['uniqueid'];this[_0x147a('0x5')]=_0x17f2c0[_0x147a('0x5')];this[_0x147a('0x6')]=_0x17f2c0[_0x147a('0x6')];this[_0x147a('0x7')]=_0x17f2c0[_0x147a('0x6')]===_0x147a('0x8')?'queue':_0x17f2c0[_0x147a('0x6')];this[_0x147a('0x9')]=_0x17f2c0['countbusyretry'];this[_0x147a('0xa')]=_0x17f2c0['countcongestionretry'];this[_0x147a('0xb')]=_0x17f2c0[_0x147a('0xb')];this[_0x147a('0xc')]=_0x17f2c0['countbusyretry']+_0x17f2c0[_0x147a('0xa')]+_0x17f2c0[_0x147a('0xb')];this[_0x147a('0xd')]=_0x17f2c0['queue'];this[_0x147a('0xe')]=_0x17f2c0[_0x147a('0xe')];this[_0x147a('0xf')]=_0x17f2c0[_0x147a('0xf')];this[_0x147a('0x10')]=_0x17f2c0[_0x147a('0x10')];this[_0x147a('0x11')]=_0x17f2c0[_0x147a('0x11')];this[_0x147a('0x12')]=_0x17f2c0['responsetime'];this[_0x147a('0x13')]=_0x17f2c0['ringtime']||0x0;this[_0x147a('0x14')]=_0x17f2c0[_0x147a('0x14')]||0x0;this[_0x147a('0x15')]=_0x17f2c0[_0x147a('0x15')]||0x0;this[_0x147a('0x16')]=_0x17f2c0[_0x147a('0x16')];this['callbackuniqueid']=_0x17f2c0['callbackuniqueid'];this['callbackat']=_0x17f2c0[_0x147a('0x17')];this[_0x147a('0x18')]=_0x17f2c0['recallme'];this[_0x147a('0x19')]=_0x17f2c0['ContactId'];this[_0x147a('0x1a')]=_0x17f2c0[_0x147a('0x1a')];this[_0x147a('0x1b')]=_0x17f2c0[_0x147a('0x1b')];this[_0x147a('0x1c')]=_0x17f2c0[_0x147a('0x1c')];this[_0x147a('0x1d')]=_0x17f2c0[_0x147a('0x1d')];this[_0x147a('0x1e')]=_0x17f2c0[_0x147a('0x1e')]||'';this[_0x147a('0x1f')]=_0x17f2c0['originatecalleridname']||'';}module[_0x147a('0x20')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index dd90b09..9af28a7 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 _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x3b30ef,_0x276af6){var _0x1fcda1=function(_0x1eeac1){while(--_0x1eeac1){_0x3b30ef['push'](_0x3b30ef['shift']());}};_0x1fcda1(++_0x276af6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x130d3a,_0x1dbbc3){var _0x568c0d=function(_0x59c967){while(--_0x59c967){_0x130d3a['push'](_0x130d3a['shift']());}};_0x568c0d(++_0x1dbbc3);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 831d07c..2e471fe 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 _0xdef6=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','number','starttime','responsetime','holdtime','talktime','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound'];(function(_0x2ec509,_0x14e710){var _0x3930a5=function(_0xeb41e9){while(--_0xeb41e9){_0x2ec509['push'](_0x2ec509['shift']());}};_0x3930a5(++_0x14e710);}(_0xdef6,0x88));var _0x6def=function(_0x423b7e,_0x3387b8){_0x423b7e=_0x423b7e-0x0;var _0x1974cb=_0xdef6[_0x423b7e];return _0x1974cb;};'use strict';var util=require(_0x6def('0x0'));var _=require(_0x6def('0x1'));var moment=require(_0x6def('0x2'));function getSeconds(_0x503c7d,_0x5116c7){var _0x1fc1db=moment(_0x503c7d)['milliseconds'](0x0);var _0x17fd24=moment(_0x5116c7)[_0x6def('0x3')](0x0);return _0x1fc1db['diff'](_0x17fd24,'seconds');}function History(_0x2fe35b){this[_0x6def('0x4')]=_0x2fe35b[_0x6def('0x4')];this[_0x6def('0x5')]=_0x2fe35b[_0x6def('0x5')]||undefined;this[_0x6def('0x6')]=_0x2fe35b[_0x6def('0x6')];this[_0x6def('0x7')]=_0x2fe35b[_0x6def('0x6')]===_0x6def('0x8')?_0x6def('0x9'):_0x2fe35b[_0x6def('0x6')];this[_0x6def('0xa')]=_0x2fe35b['countbusyretry'];this['countcongestionretry']=_0x2fe35b[_0x6def('0xb')];this[_0x6def('0xc')]=_0x2fe35b['countnoanswerretry'];this[_0x6def('0xd')]=_0x2fe35b[_0x6def('0xa')]+_0x2fe35b[_0x6def('0xb')]+_0x2fe35b[_0x6def('0xc')];this['queue']=_0x2fe35b[_0x6def('0x9')];this[_0x6def('0xe')]=_0x2fe35b['name'];this[_0x6def('0xf')]=_0x2fe35b[_0x6def('0x10')];this[_0x6def('0x11')]=_0x2fe35b[_0x6def('0x11')];this['responsetime']=_0x2fe35b[_0x6def('0x12')];this['endtime']=_0x2fe35b[_0x6def('0x12')];this['ringtime']=getSeconds(_0x2fe35b[_0x6def('0x12')],_0x2fe35b['starttime']);this[_0x6def('0x13')]=0x0;this[_0x6def('0x14')]=0x0;this['callback']=_0x2fe35b['callback'];this[_0x6def('0x15')]=_0x2fe35b['callbackuniqueid'];this[_0x6def('0x16')]=_0x2fe35b[_0x6def('0x16')];this['recallme']=_0x2fe35b['recallme'];this[_0x6def('0x17')]=_0x2fe35b[_0x6def('0x17')];this[_0x6def('0x18')]=_0x2fe35b[_0x6def('0x18')];this['UserId']=_0x2fe35b[_0x6def('0x19')];this['VoiceQueueId']=_0x2fe35b['VoiceQueueId'];this['CampaignId']=_0x2fe35b[_0x6def('0x1a')];this[_0x6def('0x1b')]=_0x2fe35b[_0x6def('0x1b')]||'';this[_0x6def('0x1c')]=_0x2fe35b[_0x6def('0x1c')]||'';}module['exports']=History; \ No newline at end of file +var _0xb632=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','calleridnum','number','starttime','responsetime','holdtime'];(function(_0x22ba79,_0x1fd59f){var _0x3c64a7=function(_0x30b023){while(--_0x30b023){_0x22ba79['push'](_0x22ba79['shift']());}};_0x3c64a7(++_0x1fd59f);}(_0xb632,0x1da));var _0x2b63=function(_0x304b89,_0x1f79b3){_0x304b89=_0x304b89-0x0;var _0x4e08ce=_0xb632[_0x304b89];return _0x4e08ce;};'use strict';var util=require(_0x2b63('0x0'));var _=require('lodash');var moment=require(_0x2b63('0x1'));function getSeconds(_0x4eec49,_0x553ab8){var _0x1ef007=moment(_0x4eec49)['milliseconds'](0x0);var _0x2843db=moment(_0x553ab8)[_0x2b63('0x2')](0x0);return _0x1ef007[_0x2b63('0x3')](_0x2843db,_0x2b63('0x4'));}function History(_0x1e6b80){this['uniqueid']=_0x1e6b80[_0x2b63('0x5')];this[_0x2b63('0x6')]=_0x1e6b80['scheduledat']||undefined;this[_0x2b63('0x7')]=_0x1e6b80[_0x2b63('0x7')];this[_0x2b63('0x8')]=_0x1e6b80['type']==='outbound'?_0x2b63('0x9'):_0x1e6b80['type'];this[_0x2b63('0xa')]=_0x1e6b80[_0x2b63('0xa')];this['countcongestionretry']=_0x1e6b80[_0x2b63('0xb')];this[_0x2b63('0xc')]=_0x1e6b80[_0x2b63('0xc')];this[_0x2b63('0xd')]=_0x1e6b80['countbusyretry']+_0x1e6b80[_0x2b63('0xb')]+_0x1e6b80['countnoanswerretry'];this[_0x2b63('0x9')]=_0x1e6b80[_0x2b63('0x9')];this[_0x2b63('0xe')]=_0x1e6b80[_0x2b63('0xf')];this[_0x2b63('0x10')]=_0x1e6b80[_0x2b63('0x11')];this[_0x2b63('0x12')]=_0x1e6b80[_0x2b63('0x12')];this['responsetime']=_0x1e6b80[_0x2b63('0x13')];this['endtime']=_0x1e6b80[_0x2b63('0x13')];this['ringtime']=getSeconds(_0x1e6b80[_0x2b63('0x13')],_0x1e6b80[_0x2b63('0x12')]);this[_0x2b63('0x14')]=0x0;this[_0x2b63('0x15')]=0x0;this[_0x2b63('0x16')]=_0x1e6b80[_0x2b63('0x16')];this[_0x2b63('0x17')]=_0x1e6b80[_0x2b63('0x17')];this['callbackat']=_0x1e6b80[_0x2b63('0x18')];this[_0x2b63('0x19')]=_0x1e6b80[_0x2b63('0x19')];this[_0x2b63('0x1a')]=_0x1e6b80[_0x2b63('0x1a')];this[_0x2b63('0x1b')]=_0x1e6b80[_0x2b63('0x1b')];this['UserId']=_0x1e6b80['UserId'];this[_0x2b63('0x1c')]=_0x1e6b80[_0x2b63('0x1c')];this[_0x2b63('0x1d')]=_0x1e6b80[_0x2b63('0x1d')];this['originatecalleridnum']=_0x1e6b80[_0x2b63('0x1e')]||'';this[_0x2b63('0x1f')]=_0x1e6b80[_0x2b63('0x1f')]||'';}module[_0x2b63('0x20')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index e7d4053..4da6647 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 _0xd8c4=['booked','../../../config/logger','predictiveCalls','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./queueCallerAbandon','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','custom:queuesummary','syncQueueSummary','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','stringify','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\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','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','sendMessageOneNotActive','waiting','available','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','statedesc','endtime','clearZombieChannels','[actions]','prototype','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD]','MACHINE','state','Machine','amd','[syncMachine][createHistory]','[syncMachine]','value','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','outboundDropCallsDayCallersExit','CALLEREXIT','syncQueueMember','actionid','locked','paused','stateinterface','rrmemory','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','Contact','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','starttime','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','countcongestionretry','dialGlobalMaxRetry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','checkRetriveMax','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','Contact.phone','dialLimitQueue','not_inuse','RUNNING','[actionOriginate]\x20','loggerHandler','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment/','dialer'];(function(_0x1f6dd0,_0x413d32){var _0x1ab7e1=function(_0x1355d3){while(--_0x1355d3){_0x1f6dd0['push'](_0x1f6dd0['shift']());}};_0x1ab7e1(++_0x413d32);}(_0xd8c4,0x1f2));var _0x4d8c=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xd8c4[_0x68c979];return _0x4f0001;};'use strict';var util=require(_0x4d8c('0x0'));var _=require(_0x4d8c('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4d8c('0x2'));var moment=require(_0x4d8c('0x3'));var rr=require('rr');var md5=require(_0x4d8c('0x4'));var Redis=require(_0x4d8c('0x5'));var config=require(_0x4d8c('0x6'));var logger=require('../../../config/logger')(_0x4d8c('0x7'));var loggerBooked=require('../../../config/logger')(_0x4d8c('0x8'));var loggerPredictive=require(_0x4d8c('0x9'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x4d8c('0xa'));var loggerSyncQueueSummary=require(_0x4d8c('0x9'))('syncQueueSummary');var ami=require(_0x4d8c('0xb'));config[_0x4d8c('0xc')]=_[_0x4d8c('0xd')](config[_0x4d8c('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x4d8c('0xe'))(new Redis(config['redis']));var cmHopper=require(_0x4d8c('0xf'));var cmHopperFinal=require(_0x4d8c('0x10'));var cmHopperHistory=require(_0x4d8c('0x11'));var cmHopperBlack=require(_0x4d8c('0x12'));var voiceQueueRt=require(_0x4d8c('0x13'));var Action=require('./action');var History=require(_0x4d8c('0x14'));var Final=require(_0x4d8c('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x4d8c('0x16'));var Hangup=require('./hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x4d8c('0x17')};var Sequence=function(){};Sequence['prototype'][_0x4d8c('0x18')]=function(_0x3980ce){this[_0x4d8c('0x19')]=this[_0x4d8c('0x19')]?this['tail'][_0x4d8c('0x1a')](_0x3980ce):_0x3980ce();};function Dialer(_0x41a27a,_0x21823b){this[_0x4d8c('0x1b')]=new Sequence();this[_0x4d8c('0x1c')]=_0x21823b;this['voiceQueues']=_0x41a27a[_0x4d8c('0x1d')];this[_0x4d8c('0x1e')]=_0x41a27a[_0x4d8c('0x1e')];this['agents']=_0x41a27a[_0x4d8c('0x1f')];this[_0x4d8c('0x20')]=_0x41a27a['trunks'];this[_0x4d8c('0x21')]=config[_0x4d8c('0x21')]||0x2;this[_0x4d8c('0x22')]={};this[_0x4d8c('0x23')]={};this[_0x4d8c('0x24')]={};this[_0x4d8c('0x25')]={};this[_0x4d8c('0x26')]={};this['startPredictive']={};this[_0x4d8c('0x27')]={};this[_0x4d8c('0x28')]={};this[_0x4d8c('0x29')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x4d8c('0x2a')][_0x4d8c('0x2b')](this));ami['on'](_0x4d8c('0x2c'),this[_0x4d8c('0x2d')][_0x4d8c('0x2b')](this));ami['on']('originateresponse',this[_0x4d8c('0x2e')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x4d8c('0x2f'),this[_0x4d8c('0x30')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x4d8c('0x2b')](this));ami['on'](_0x4d8c('0x31'),this['syncNewExten'][_0x4d8c('0x2b')](this));ami['on'](_0x4d8c('0x32'),this[_0x4d8c('0x33')]['bind'](this));ami['on'](_0x4d8c('0x34'),this['syncQueueMember']['bind'](this));ami['on'](_0x4d8c('0x35'),this[_0x4d8c('0x36')]['bind'](this));this[_0x4d8c('0x37')]();this[_0x4d8c('0x38')]();}function isNotNull(_0x4db055){return _0x4db055!==null&&!_[_0x4d8c('0x39')](_0x4db055);}function checkIsLoggedIn(_0x49bc88,_0x55ca1d){return function(){if(_0x55ca1d<=0x0){_0x49bc88[_0x4d8c('0x3a')]='AGENTS_NOT_LOGGED';throw _0x49bc88[_0x4d8c('0x3b')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x33adde){return _0x33adde;}function checkIsActive(_0x21f774,_0x4d69d8){return function(){if(!isActive(_0x4d69d8)){_0x21f774[_0x4d8c('0x3a')]=_0x4d8c('0x3c');throw _0x21f774[_0x4d8c('0x3b')]+_0x4d8c('0x3d');}};}function checkInterval(_0x76bcd0){return function(){if(!isNotNull(_0x76bcd0[_0x4d8c('0x3e')])){_0x76bcd0['message']='INTERVAL_IS_NULL';throw _0x76bcd0['name']+_0x4d8c('0x3f');}if(!isNotNull(_0x76bcd0[_0x4d8c('0x3e')][_0x4d8c('0x40')])){_0x76bcd0['message']=_0x4d8c('0x41');throw _0x76bcd0[_0x4d8c('0x3b')]+_0x4d8c('0x3f');}if(!isNotNull(_[_0x4d8c('0x42')](_0x76bcd0['Interval'][_0x4d8c('0x40')]))){_0x76bcd0[_0x4d8c('0x3a')]=_0x4d8c('0x41');throw _0x76bcd0['name']+_0x4d8c('0x3f');}};}function msgResponse(_0x2cd5c7,_0x342a86,_0x3993d7){return{'action':_0x2cd5c7,'response':_0x342a86,'message':_0x3993d7,'stack':_0x3993d7};}function myreject(_0xa972c2){return function(_0x5871cf){return _0xa972c2(msgResponse(_0x4d8c('0x43'),_0x4d8c('0x44'),JSON['stringify'](_0x5871cf)));};}function getSeconds(_0x147eec,_0xf56158){var _0x17fd85=moment(_0x147eec)['milliseconds'](0x0);var _0x54c704=moment(_0xf56158)[_0x4d8c('0x45')](0x0);return _0x17fd85[_0x4d8c('0x46')](_0x54c704,_0x4d8c('0x47'));}function emit(_0x3376d5,_0x15ace0,_0xce5f63){io['to'](_0x3376d5)[_0x4d8c('0x48')](_0x15ace0,_0xce5f63);}function emitVoiceQueueSummary(_0x4bc968){if(_0x4bc968[_0x4d8c('0x49')]===_0x4d8c('0x4a')){var _0x18bc5b={'id':_0x4bc968['id'],'name':_0x4bc968[_0x4d8c('0x3b')],'strategy':_0x4bc968[_0x4d8c('0x4b')],'answered':_0x4bc968[_0x4d8c('0x4c')],'available':_0x4bc968['available'],'loggedIn':_0x4bc968[_0x4d8c('0x4d')],'pTalking':_0x4bc968[_0x4d8c('0x4e')],'sumBillable':_0x4bc968[_0x4d8c('0x4f')],'sumDuration':_0x4bc968[_0x4d8c('0x50')],'sumHoldTime':_0x4bc968['sumHoldTime']||0x0,'talking':_0x4bc968[_0x4d8c('0x51')],'total':_0x4bc968[_0x4d8c('0x52')],'type':_0x4bc968['type'],'unmanaged':_0x4bc968[_0x4d8c('0x53')],'abandoned':_0x4bc968[_0x4d8c('0x54')],'waiting':_0x4bc968['waiting'],'loggedInDb':_0x4bc968[_0x4d8c('0x55')],'dialActive':_0x4bc968[_0x4d8c('0x56')],'dialMethod':_0x4bc968[_0x4d8c('0x57')],'dialOriginateCallerIdName':_0x4bc968[_0x4d8c('0x58')],'dialOriginateCallerIdNumber':_0x4bc968['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4bc968['dialOriginateTimeout'],'dialPrefix':_0x4bc968[_0x4d8c('0x59')],'outboundAnswerAgiCallsDay':_0x4bc968[_0x4d8c('0x5a')],'outboundAnswerCallsDay':_0x4bc968[_0x4d8c('0x5b')],'outboundBlacklistCallsDay':_0x4bc968[_0x4d8c('0x5c')],'outboundBusyCallsDay':_0x4bc968[_0x4d8c('0x5d')],'outboundCongestionCallsDay':_0x4bc968[_0x4d8c('0x5e')],'outboundDropCallsDayACS':_0x4bc968[_0x4d8c('0x5f')],'outboundDropCallsDayCallersExit':_0x4bc968['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4bc968[_0x4d8c('0x60')],'outboundNoAnswerCallsDay':_0x4bc968[_0x4d8c('0x61')],'outboundNoSuchCallsDay':_0x4bc968['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4bc968['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4bc968[_0x4d8c('0x62')],'outboundRejectCallsDay':_0x4bc968[_0x4d8c('0x63')],'outboundUnknownCallsDay':_0x4bc968['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4bc968[_0x4d8c('0x64')],'predictiveIntervalAvgHoldtime':_0x4bc968[_0x4d8c('0x65')],'predictiveIntervalAvgTalktime':_0x4bc968[_0x4d8c('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x4bc968[_0x4d8c('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x4bc968[_0x4d8c('0x68')],'predictiveIntervalErlangCalls':_0x4bc968[_0x4d8c('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x4bc968[_0x4d8c('0x6a')],'predictiveIntervalHitRate':_0x4bc968[_0x4d8c('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x4bc968[_0x4d8c('0x6c')],'predictiveIntervalPauses':_0x4bc968[_0x4d8c('0x6d')],'predictiveIntervalAvailable':_0x4bc968['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4bc968[_0x4d8c('0x6e')],'message':_0x4bc968[_0x4d8c('0x3a')],'originated':_0x4bc968['originated'],'erlangCalls':_0x4bc968[_0x4d8c('0x6f')],'erlangCallToSecond':_0x4bc968[_0x4d8c('0x70')],'erlangAbandonmentRate':_0x4bc968[_0x4d8c('0x71')],'erlangBusyFactor':_0x4bc968[_0x4d8c('0x72')],'startPredictive':_0x4bc968[_0x4d8c('0x73')],'startProgressive':_0x4bc968['startProgressive']};if(_0x4bc968['Trunk']){_0x18bc5b[_0x4d8c('0x74')]={'id':_0x4bc968[_0x4d8c('0x74')]['id'],'name':_0x4bc968[_0x4d8c('0x74')][_0x4d8c('0x3b')],'active':_0x4bc968[_0x4d8c('0x74')][_0x4d8c('0x75')],'callerid':_0x4bc968[_0x4d8c('0x74')]['callerid']};}if(_0x4bc968[_0x4d8c('0x3e')]){_0x18bc5b[_0x4d8c('0x3e')]={'id':_0x4bc968[_0x4d8c('0x3e')]['id'],'name':_0x4bc968[_0x4d8c('0x3e')][_0x4d8c('0x3b')]};}var _0x3fcaec=md5(JSON[_0x4d8c('0x76')](_0x18bc5b));if(_0x4bc968[_0x4d8c('0x4')]!==_0x3fcaec){_0x4bc968[_0x4d8c('0x4')]=_0x3fcaec;emit(util['format'](_0x4d8c('0x77'),_0x18bc5b[_0x4d8c('0x3b')]),'voice_queue:save',_0x18bc5b);}}}function emitCampaignSummary(_0x4a27de){if(_0x4a27de[_0x4d8c('0x49')]===_0x4d8c('0x78')){emit(util['format'](_0x4d8c('0x79'),_0x4a27de['name']),_0x4d8c('0x7a'),_0x4a27de);}}function checkGetDataPredictive(_0xdcc9b0){if(isNotNull(_0xdcc9b0)){if(!_[_0x4d8c('0x42')](_0xdcc9b0)){loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x7c'));loggerPredictive['info'](_0x4d8c('0x7d'),_0xdcc9b0['predictiveIntervalTotalCalls']);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x7e'),_0xdcc9b0[_0x4d8c('0x64')]);loggerPredictive[_0x4d8c('0x7b')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xdcc9b0[_0x4d8c('0x68')]);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x7f'),_0xdcc9b0[_0x4d8c('0x67')]);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x80'),_0xdcc9b0[_0x4d8c('0x65')]);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x81'),_0xdcc9b0['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x4d8c('0x82'));if(_0xdcc9b0[_0x4d8c('0x6e')]>0x0){if(!_[_0x4d8c('0x39')](_0xdcc9b0[_0x4d8c('0x66')])&&_0xdcc9b0[_0x4d8c('0x66')]>0x0){return!![];}else{loggerPredictive[_0x4d8c('0x7b')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x4d8c('0x39')](_0xdcc9b0[_0x4d8c('0x65')])&&_0xdcc9b0[_0x4d8c('0x65')]>0x0){return!![];}else{loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x83'));}}else{loggerPredictive['info'](_0x4d8c('0x84'));}}else{loggerPredictive[_0x4d8c('0x7b')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0x4d8c('0x7b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x43cb33){return function(_0x4912c4){loggerPredictive['info'](_0x4d8c('0x85'));loggerPredictive[_0x4d8c('0x7b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4912c4[_0x4d8c('0x6f')]);loggerPredictive[_0x4d8c('0x7b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4912c4['erlangCallToSecond']);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x86'),_0x4912c4['erlangAbandonmentRate']);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x87'),_0x4912c4[_0x4d8c('0x72')]);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x86'),_0x4912c4[_0x4d8c('0x71')]);loggerPredictive[_0x4d8c('0x7b')]('---------------------------');_['merge'](_0x43cb33,_0x4912c4);};}function getDiff(_0x606de8){var _0x1c347b=moment()[_0x4d8c('0x45')](0x0);var _0x387f46=moment(_0x606de8)[_0x4d8c('0x45')](0x0);return _0x1c347b['diff'](_0x387f46,_0x4d8c('0x47'));}function ifInterval(_0x5a9300,_0x249859){if(_[_0x4d8c('0x39')](_0x249859)){return![];}if(getDiff(_0x249859)<_0x5a9300*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x168788){if(isNotNull(_0x168788)){if(!_[_0x4d8c('0x39')](_0x168788[_0x4d8c('0x27')])){_0x168788[_0x4d8c('0x27')]=undefined;loggerPredictive[_0x4d8c('0x7b')](_0x168788[_0x4d8c('0x3b')],_0x4d8c('0x88'));}if(!_[_0x4d8c('0x39')](_0x168788[_0x4d8c('0x73')])){_0x168788[_0x4d8c('0x73')]=undefined;loggerPredictive[_0x4d8c('0x7b')](_0x168788[_0x4d8c('0x3b')],_0x4d8c('0x89'));}if(!_['isUndefined'](_0x168788[_0x4d8c('0x8a')])){clearInterval(_0x168788[_0x4d8c('0x8a')]);_0x168788['handlePredictive']=undefined;loggerPredictive['info'](_0x168788[_0x4d8c('0x3b')],_0x4d8c('0x8b'));}}}function erlangb(_0x4d6803,_0x52ccfd){if(_0x52ccfd===0x0){return 0x0;}var _0x30bf01=0x1;for(var _0x370814=0x1;_0x370814<=_0x52ccfd;_0x370814+=0x1){_0x30bf01=0x1+_0x30bf01*_0x370814/_0x4d6803;}return 0x1/_0x30bf01;}function isVoiceQueueOutbound(_0x24daae){return _0x24daae==='outbound';}function isNotPreview(_0x1412d7){return _0x1412d7!==_0x4d8c('0x1c');}function isCampaignIvr(_0x17687e){return _0x17687e===_0x4d8c('0x78');}function getCallerId(_0x51f4e4,_0x2d6d97,_0x3f03ff){if(!_[_0x4d8c('0x39')](_0x3f03ff)&&_0x4d8c('0x8c')===typeof _0x3f03ff&&!_[_0x4d8c('0x42')](_0x3f03ff)){if(!_[_0x4d8c('0x39')](_0x2d6d97)&&_0x4d8c('0x8c')===typeof _0x2d6d97&&!_[_0x4d8c('0x42')](_0x2d6d97)){return util['format'](_0x4d8c('0x8d'),_0x2d6d97,_0x3f03ff);}return util[_0x4d8c('0x8e')](_0x4d8c('0x8d'),_0x3f03ff,_0x3f03ff);}if(!_[_0x4d8c('0x39')](_0x51f4e4)&&'string'===typeof _0x51f4e4&&!_['isEmpty'](_0x51f4e4)){return _0x51f4e4;}return _0x4d8c('0x8f');}function loggerCatchQueueSummary(_0x86e3e2,_0x4991aa){return function(_0x52179d){freeVariablesPredictive(_0x4991aa);emitVoiceQueueSummary(_0x4991aa);emitCampaignSummary(_0x4991aa);loggerSyncQueueSummary[_0x4d8c('0x90')](_0x86e3e2,util[_0x4d8c('0x91')](_0x52179d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2765a9,_0x22e3a8){return function(_0x1181cd){loggerPredictive[_0x4d8c('0x90')](_0x22e3a8[_0x4d8c('0x3b')],_0x2765a9);loggerPredictive[_0x4d8c('0x90')](_0x1181cd[_0x4d8c('0x92')]);freeVariablesPredictive(_0x22e3a8);};}function loggerCatch(_0x11b172){return function(_0x33ac37){logger[_0x4d8c('0x90')](_0x11b172,util[_0x4d8c('0x91')](_0x33ac37,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x185800){return _0x185800&&!_[_0x4d8c('0x39')](_0x185800)&&_0x185800[_0x4d8c('0x93')]>0x0;}function decremetOriginate(_0x3f66c5){if(!_[_0x4d8c('0x39')](_0x3f66c5)&&_0x3f66c5!==null){if(_0x3f66c5[_0x4d8c('0x94')](_0x4d8c('0x95'))){if(_0x3f66c5['originated']>0x0){_0x3f66c5[_0x4d8c('0x95')]-=0x1;}else{logger['error'](_0x4d8c('0x96'));}}}else{logger[_0x4d8c('0x90')](_0x4d8c('0x97'));}}function checkContactLowerLimitOriginate(_0x341a7c,_0x3ab146,_0x5cbc2e){if(_0x3ab146>_0x5cbc2e){for(var _0x47f590=0x0;_0x47f590<_0x3ab146-_0x5cbc2e;_0x47f590+=0x1){decremetOriginate(_0x341a7c);}}}function loggerGetContactDialer(_0x34dacb,_0x4d24c0,_0x34b962){return function(_0x126fe8){checkContactLowerLimitOriginate(_0x4d24c0,_0x34b962,0x0);logger[_0x4d8c('0x90')](_0x34dacb,util[_0x4d8c('0x91')](_0x126fe8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xd33b0){return function(_0x54e5ac){if(isNotNull(_0x54e5ac)&&isNotNull(_0x54e5ac[0x0])){if(_0x54e5ac[0x0][_0x4d8c('0x98')]>0x0){_0xd33b0[_0x4d8c('0x3a')]=_0x4d8c('0x99');logger[_0x4d8c('0x7b')](_0x4d8c('0x9a')+_0xd33b0['name'],_0x54e5ac[0x0][_0x4d8c('0x98')],'contacts');}else{_0xd33b0[_0x4d8c('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4d8c('0x7b')]('[getContactDialer2][Empty]'+_0xd33b0['name']);}}};}function notSendMessagesQueue(_0x1bec64){if(_0x1bec64[_0x4d8c('0x9b')]){freeVariablesPredictive(_0x1bec64);if(_0x1bec64[_0x4d8c('0x95')]===0x0&&_0x1bec64['talking']===0x0&&_0x1bec64[_0x4d8c('0x9c')]===0x0&&(_0x1bec64[_0x4d8c('0x4e')]||0x0)===0x0){_0x1bec64[_0x4d8c('0x9b')]=![];_0x1bec64[_0x4d8c('0x9d')]=0x0;_0x1bec64['message']=_0x4d8c('0x3c');loggerSyncQueueSummary[_0x4d8c('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1bec64[_0x4d8c('0x3b')],_0x4d8c('0x9e'));}else{_0x1bec64['message']=_0x4d8c('0x9f');loggerSyncQueueSummary[_0x4d8c('0x90')](_0x4d8c('0xa0'),_0x1bec64[_0x4d8c('0x3b')],_0x4d8c('0xa1'));}emitVoiceQueueSummary(_0x1bec64);}}function notSendMessagesCampaign(_0x376520){if(_0x376520[_0x4d8c('0x9b')]){if(_0x376520['originated']===0x0){_0x376520[_0x4d8c('0x9b')]=![];_0x376520[_0x4d8c('0x3a')]=_0x4d8c('0x3c');loggerSyncQueueSummary[_0x4d8c('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x376520[_0x4d8c('0x3b')],_0x4d8c('0x9e'));}else{_0x376520['message']=_0x4d8c('0x9f');loggerSyncQueueSummary[_0x4d8c('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x376520['name'],_0x4d8c('0xa1'));}emitCampaignSummary(_0x376520);}}function createObjHistory(_0xb8c571,_0x34b677,_0x428fac,_0x11183b,_0xf1d8a3){_0xb8c571[_0x4d8c('0x3a')]=_0x428fac;var _0x28255c=new Action(_0xb8c571,_0x34b677);var _0x5d7e95=new History(_0x28255c);_0x5d7e95['state']=_0x11183b;_0x5d7e95[_0x4d8c('0xa2')]=_0xf1d8a3;_0x5d7e95[_0x4d8c('0xa3')]=_0x28255c['starttime'];return _0x5d7e95;}Dialer['prototype'][_0x4d8c('0x38')]=function(){var _0x11d81f=this;setInterval(function(){_0x11d81f[_0x4d8c('0xa4')](_0x11d81f[_0x4d8c('0x25')],'[uniqueid]');_0x11d81f[_0x4d8c('0xa4')](_0x11d81f[_0x4d8c('0x23')],_0x4d8c('0xa5'));},0x32c8);};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xa4')]=function(_0x14762a,_0x21755b){var _0x3d5b49=this;for(var _0x57d5e6 in _0x14762a){if(_0x14762a[_0x4d8c('0x94')](_0x57d5e6)){this[_0x4d8c('0x1b')][_0x4d8c('0x18')](function(){if(!_['isNil'](_0x14762a[_0x57d5e6])){return ami[_0x4d8c('0xa7')]({'action':_0x4d8c('0xa8'),'channel':_0x14762a[_0x57d5e6][_0x4d8c('0xa9')]})[_0x4d8c('0xaa')](function(_0xbb5dd){if(_0xbb5dd[_0x4d8c('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x14762a[_0x57d5e6]&&_0x14762a[_0x57d5e6][_0x4d8c('0x49')]!==_0x4d8c('0x78')){_0x3d5b49[_0x4d8c('0xab')](_0x3d5b49['voiceQueues'][_0x14762a[_0x57d5e6]['queue']]);logger[_0x4d8c('0x90')]('[Dialer][checkChannel]',_0x21755b,_0x57d5e6,_0x14762a[_0x57d5e6][_0x4d8c('0xac')]);delete _0x14762a[_0x57d5e6];}if(_0x14762a[_0x57d5e6]&&_0x14762a[_0x57d5e6][_0x4d8c('0x49')]===_0x4d8c('0x78')){_0x3d5b49['updateOriginated'](_0x3d5b49[_0x4d8c('0x1e')][_0x14762a[_0x57d5e6][_0x4d8c('0xac')]]);logger[_0x4d8c('0x90')](_0x4d8c('0xad'),_0x21755b,_0x57d5e6,_0x14762a[_0x57d5e6][_0x4d8c('0xac')]);delete _0x14762a[_0x57d5e6];}},0x2328);}});}});}}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xae')]=function(_0x365a9d){return BPromise['resolve']()[_0x4d8c('0xaf')](cmHopper[_0x4d8c('0xae')](_0x365a9d))['catch'](loggerCatch(_0x4d8c('0xb0')));};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xb1')]=function(_0x4de15c){return BPromise[_0x4d8c('0xb2')]()[_0x4d8c('0xaf')](cmHopperBlack['checkIsBlackList'](_0x4de15c))[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xb3')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0xf4cfc9){return BPromise['resolve']()[_0x4d8c('0xaf')](cmHopperBlack[_0x4d8c('0xb4')](_0xf4cfc9))[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xb5')));};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xb6')]=function(_0x3a3b6c){return BPromise[_0x4d8c('0xb2')]()['then'](cmHopperHistory[_0x4d8c('0xb7')](_0x3a3b6c))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x4d8c('0xb8')]=function(_0xcfa5bd){return BPromise[_0x4d8c('0xb2')]()[_0x4d8c('0xaf')](cmHopper[_0x4d8c('0xb8')](_0xcfa5bd))[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xb9')));};Dialer['prototype'][_0x4d8c('0xba')]=function(_0x1731b6,_0x157197,_0xb0dca7,_0x3e710d){return BPromise[_0x4d8c('0xb2')]()[_0x4d8c('0xaf')](cmHopper[_0x4d8c('0xba')](_0x1731b6,_0x157197,_0xb0dca7,_0x3e710d))[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xbb')));};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xbc')]=function(_0x209d1e,_0x19fff4,_0x45fa4f){return BPromise[_0x4d8c('0xb2')]()[_0x4d8c('0xaf')](cmHopper[_0x4d8c('0xbc')](_0x209d1e,_0x19fff4,_0x45fa4f))[_0x4d8c('0xaa')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0x4d8c('0xbd')]=function(_0x3baf63){return BPromise['resolve']()[_0x4d8c('0xaf')](voiceQueueRt[_0x4d8c('0xbd')](_0x3baf63))[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xbe')));};Dialer[_0x4d8c('0xa6')]['moveContactManagedDialer']=function(_0xd738bb){return BPromise[_0x4d8c('0xb2')]()[_0x4d8c('0xaf')](cmHopper[_0x4d8c('0xbf')](_0xd738bb))[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xc0')));};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xc1')]=function(_0x3909e0){return BPromise['resolve']()[_0x4d8c('0xaf')](cmHopperHistory['createHistory'](_0x3909e0))['catch'](loggerCatch(_0x4d8c('0xc2')));};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xab')]=function(_0x516c9a){if(!_[_0x4d8c('0x39')](_0x516c9a)&&_0x516c9a!==null){if(_0x516c9a[_0x4d8c('0x94')]('originated')){if(_0x516c9a['originated']>0x0){_0x516c9a[_0x4d8c('0x95')]-=0x1;}else{logger['error'](_0x4d8c('0xc3'));}}}else{logger[_0x4d8c('0x90')](_0x4d8c('0xc4'));}};Dialer['prototype']['loggerHandler']=function(_0x3a868d,_0x47da19){var _0x5bebb6=this;return function(_0x470688){_0x5bebb6[_0x4d8c('0xab')](_0x47da19);logger[_0x4d8c('0x90')](_0x3a868d,util[_0x4d8c('0x91')](_0x470688,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x4d8c('0xc5')]=function(_0x24d92a,_0xfc61f5,_0x49d6e){var _0x45a840={'state':0x19,'statedesc':_0x4d8c('0xc6')};this[_0x4d8c('0xab')](_0xfc61f5);this[_0x4d8c('0xc7')](_[_0x4d8c('0xc8')](_0x45a840,_[_0x4d8c('0xc9')](_0x49d6e,[_0x4d8c('0xca'),_0x4d8c('0xcb'),_0x4d8c('0xcc'),_0x4d8c('0xcd'),_0x4d8c('0xce')])),_0x4d8c('0xcf'),_0x4d8c('0xd0'));logger[_0x4d8c('0x90')](_0x24d92a);};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xd1')]=function(_0x5e9db3){return _0x5e9db3===_0x4d8c('0xd2');};Dialer['prototype'][_0x4d8c('0xd3')]=function(_0x3a7c86){return!_[_0x4d8c('0x39')](_0x3a7c86)&&_0x3a7c86&&!_[_0x4d8c('0x39')](_0x3a7c86[_0x4d8c('0x3b')])&&!_[_0x4d8c('0x39')](_0x3a7c86['active'])&&_0x3a7c86[_0x4d8c('0x75')]&&(this[_0x4d8c('0x20')][util['format']('SIP/%s',_0x3a7c86[_0x4d8c('0x3b')])][_0x4d8c('0xa8')]===_0x4d8c('0xd4')||this[_0x4d8c('0x20')][util[_0x4d8c('0x8e')](_0x4d8c('0xd5'),_0x3a7c86[_0x4d8c('0x3b')])][_0x4d8c('0xa8')]===_0x4d8c('0xd6'));};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xc7')]=function(_0x5c8784,_0x272deb,_0x44e1c5){this[_0x4d8c('0xc1')](_0x5c8784)[_0x4d8c('0xaa')](loggerCatch(_0x272deb));this[_0x4d8c('0xbf')](_0x5c8784)[_0x4d8c('0xaa')](loggerCatch(_0x44e1c5));};Dialer['prototype'][_0x4d8c('0x33')]=function(_0x36b2ab){var _0x1eb8b7=this[_0x4d8c('0x25')][_0x36b2ab[_0x4d8c('0xd7')]];var _0x154be5;if(!_[_0x4d8c('0xd8')](_0x36b2ab)&&!_[_0x4d8c('0xd8')](_0x36b2ab[_0x4d8c('0xd9')])&&!_[_0x4d8c('0xd8')](_0x36b2ab[_0x4d8c('0xd9')][_0x4d8c('0xda')])&&_0x36b2ab[_0x4d8c('0xdb')]===_0x4d8c('0xdc')&&_0x1eb8b7){if(_0x1eb8b7[_0x4d8c('0x49')]!==_0x4d8c('0x78')&&this['voiceQueues'][_0x1eb8b7[_0x4d8c('0xac')]][_0x4d8c('0xdd')]&&_0x36b2ab['value']===_0x4d8c('0xde')){delete this[_0x4d8c('0x25')][_0x36b2ab[_0x4d8c('0xd7')]];this[_0x4d8c('0xab')](this[_0x4d8c('0x1d')][_0x1eb8b7[_0x4d8c('0xac')]]);this['voiceQueues'][_0x1eb8b7[_0x4d8c('0xac')]][_0x4d8c('0x5b')]+=0x1;this[_0x4d8c('0x1d')][_0x1eb8b7['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x154be5=new Hangup(_0x1eb8b7,_0x36b2ab);_0x154be5['state']=0x12;_0x154be5[_0x4d8c('0xa2')]=_0x4d8c('0xdf');_0x154be5[_0x4d8c('0xe0')]=_0x4d8c('0xe1');this[_0x4d8c('0xc7')](_0x154be5,'[syncHangupInAMD][createHistory]',_0x4d8c('0xe2'));}if(_0x1eb8b7[_0x4d8c('0x49')]!==_0x4d8c('0x78')&&this['voiceQueues'][_0x1eb8b7['queue']][_0x4d8c('0xdd')]&&_0x36b2ab['value']===_0x4d8c('0xe3')){delete this[_0x4d8c('0x25')][_0x36b2ab[_0x4d8c('0xd7')]];this[_0x4d8c('0xab')](this[_0x4d8c('0x1d')][_0x1eb8b7['queue']]);this[_0x4d8c('0x1d')][_0x1eb8b7['queue']][_0x4d8c('0x5b')]+=0x1;this[_0x4d8c('0x1d')][_0x1eb8b7[_0x4d8c('0xac')]][_0x4d8c('0x5a')]+=0x1;_0x154be5=new Hangup(_0x1eb8b7,_0x36b2ab);_0x154be5[_0x4d8c('0xe4')]=0x13;_0x154be5[_0x4d8c('0xa2')]=_0x4d8c('0xe5');_0x154be5['membername']='AMD';_0x154be5[_0x4d8c('0xe6')]=!![];this[_0x4d8c('0xc7')](_0x154be5,_0x4d8c('0xe7'),_0x4d8c('0xe8'));}if(_0x1eb8b7[_0x4d8c('0x49')]===_0x4d8c('0x78')&&this['campaigns'][_0x1eb8b7[_0x4d8c('0xac')]][_0x4d8c('0xdd')]&&_0x36b2ab[_0x4d8c('0xe9')]===_0x4d8c('0xde')){delete this[_0x4d8c('0x25')][_0x36b2ab[_0x4d8c('0xd7')]];this['updateOriginated'](this[_0x4d8c('0x1e')][_0x1eb8b7[_0x4d8c('0xac')]]);_0x154be5=new Hangup(_0x1eb8b7,_0x36b2ab);_0x154be5[_0x4d8c('0xe4')]=0x12;_0x154be5[_0x4d8c('0xa2')]=_0x4d8c('0xdf');_0x154be5[_0x4d8c('0xe0')]=_0x4d8c('0xe1');this[_0x4d8c('0xc7')](_0x154be5,'[syncHangupInAMDIvr][createHistory]',_0x4d8c('0xea'));}if(_0x1eb8b7['type']===_0x4d8c('0x78')&&this[_0x4d8c('0x1e')][_0x1eb8b7[_0x4d8c('0xac')]][_0x4d8c('0xdd')]&&_0x36b2ab['value']===_0x4d8c('0xe3')){delete this[_0x4d8c('0x25')][_0x36b2ab[_0x4d8c('0xd7')]];this[_0x4d8c('0xab')](this['campaigns'][_0x1eb8b7[_0x4d8c('0xac')]]);_0x154be5=new Hangup(_0x1eb8b7,_0x36b2ab);_0x154be5[_0x4d8c('0xe4')]=0x13;_0x154be5['statedesc']=_0x4d8c('0xe5');_0x154be5[_0x4d8c('0xe0')]='AMD';_0x154be5[_0x4d8c('0xe6')]=!![];this[_0x4d8c('0xc7')](_0x154be5,_0x4d8c('0xeb'),_0x4d8c('0xec'));}}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xed')]=function(_0x3873a8){var _0x1d9088=this['uniqueId'][_0x3873a8[_0x4d8c('0xd7')]];var _0x48b95c=this;var _0x5a18fd;if(_0x1d9088&&_0x1d9088[_0x4d8c('0x49')]===_0x4d8c('0x78')){delete this[_0x4d8c('0x25')][_0x3873a8[_0x4d8c('0xd7')]];this[_0x4d8c('0xab')](this['campaigns'][_0x1d9088[_0x4d8c('0xac')]]);this['campaigns'][_0x1d9088[_0x4d8c('0xac')]][_0x4d8c('0xee')]+=0x1;_0x5a18fd=new Hangup(_0x1d9088,_0x3873a8);this['createHistory'](_0x5a18fd)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xef')));this['moveContactManagedDialer'](_0x5a18fd)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xf0')));}if(_0x1d9088&&_0x1d9088[_0x4d8c('0x49')]!=='ivr'&&isNotNull(this[_0x4d8c('0x1d')][_0x1d9088[_0x4d8c('0xac')]][_0x4d8c('0xf1')])){delete this[_0x4d8c('0x25')][_0x3873a8[_0x4d8c('0xd7')]];this[_0x4d8c('0xab')](this['voiceQueues'][_0x1d9088[_0x4d8c('0xac')]]);this['voiceQueues'][_0x1d9088[_0x4d8c('0xac')]][_0x4d8c('0x5b')]+=0x1;this[_0x4d8c('0x1d')][_0x1d9088[_0x4d8c('0xac')]][_0x4d8c('0x5a')]+=0x1;_0x5a18fd=new Hangup(_0x1d9088,_0x3873a8);_0x5a18fd[_0x4d8c('0xe4')]=0x10;_0x5a18fd['statedesc']=_0x4d8c('0xf2');_0x5a18fd[_0x4d8c('0xe0')]=_0x4d8c('0xf3');this[_0x4d8c('0xc1')](_0x5a18fd)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xef')));this['moveContactManagedDialer'](_0x5a18fd)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x1d9088&&_0x1d9088['type']!==_0x4d8c('0x78')&&!isNotNull(this[_0x4d8c('0x1d')][_0x1d9088[_0x4d8c('0xac')]][_0x4d8c('0xf1')])){delete this['uniqueId'][_0x3873a8[_0x4d8c('0xd7')]];this['updateOriginated'](this[_0x4d8c('0x1d')][_0x1d9088[_0x4d8c('0xac')]]);this[_0x4d8c('0x1d')][_0x1d9088[_0x4d8c('0xac')]][_0x4d8c('0xf4')]+=0x1;_0x5a18fd=new Hangup(_0x1d9088,_0x3873a8);_0x5a18fd['state']=0xc;_0x5a18fd['statedesc']=_0x3873a8[_0x4d8c('0xf5')];_0x5a18fd[_0x4d8c('0xe0')]='Unknow';this[_0x4d8c('0xc1')](_0x5a18fd)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xef')));this[_0x4d8c('0xbf')](_0x5a18fd)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xf0')));}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0xf6')]=function(_0x12df57){var _0x4754f6=this[_0x4d8c('0x25')][_0x12df57[_0x4d8c('0xd7')]];var _0x29bb8b=this;if(this[_0x4d8c('0x1d')][_0x12df57['queue']]){if(_0x4754f6&&_0x4754f6[_0x4d8c('0x49')]!==_0x4d8c('0x78')){delete this[_0x4d8c('0x25')][_0x12df57[_0x4d8c('0xd7')]];this[_0x4d8c('0x1d')][_0x12df57[_0x4d8c('0xac')]]['outboundAnswerCallsDay']+=0x1;var _0x43e578=new AgentComplete(_0x4754f6,_0x12df57);if(_0x12df57[_0x4d8c('0xf7')]===_0x4d8c('0xf8')){_0x43e578['agiafterat']=this[_0x4d8c('0x1d')][_0x12df57[_0x4d8c('0xac')]][_0x4d8c('0xf9')]&&this[_0x4d8c('0x1d')][_0x12df57[_0x4d8c('0xac')]][_0x4d8c('0xfa')]?moment()['format'](_0x4d8c('0xfb')):undefined;}this['createHistory'](_0x43e578)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xfc')));this[_0x4d8c('0xbf')](_0x43e578)['catch'](loggerCatch(_0x4d8c('0xfd')));}}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x2a')]=function(_0x21272f){if(this[_0x4d8c('0x1d')][_0x21272f[_0x4d8c('0xac')]]){if(this[_0x4d8c('0x25')][_0x21272f['uniqueid']]&&this[_0x4d8c('0x25')][_0x21272f['uniqueid']][_0x4d8c('0x49')]!=='ivr'){this[_0x4d8c('0xab')](this[_0x4d8c('0x1d')][_0x21272f[_0x4d8c('0xac')]]);this[_0x4d8c('0x25')][_0x21272f[_0x4d8c('0xd7')]]['answertime']=moment()['format'](_0x4d8c('0xfb'));}}};Dialer['prototype'][_0x4d8c('0xfe')]=function(_0x1fc899){this[_0x4d8c('0xc1')](_0x1fc899)[_0x4d8c('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x4d8c('0xbf')](_0x1fc899)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xff')));};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x2d')]=function(_0x1c57dd){var _0x5e264e=this[_0x4d8c('0x25')][_0x1c57dd[_0x4d8c('0xd7')]];var _0x3faf05=this;if(this[_0x4d8c('0x1d')][_0x1c57dd['queue']]){if(_0x5e264e&&_0x5e264e[_0x4d8c('0x49')]!=='ivr'){delete this['uniqueId'][_0x1c57dd[_0x4d8c('0xd7')]];this[_0x4d8c('0xab')](this[_0x4d8c('0x1d')][_0x1c57dd[_0x4d8c('0xac')]]);_0x5e264e[_0x4d8c('0x100')]=moment()[_0x4d8c('0x8e')](_0x4d8c('0xfb'));var _0x47a3f8=new QueueCallerAbandon(_0x5e264e,_0x1c57dd);if(getSeconds(_0x5e264e['droptime'],_0x5e264e[_0x4d8c('0x101')])>=_0x5e264e[_0x4d8c('0x102')]){this['voiceQueues'][_0x1c57dd['queue']][_0x4d8c('0x68')]+=0x1;this[_0x4d8c('0x1d')][_0x1c57dd[_0x4d8c('0xac')]][_0x4d8c('0x60')]+=0x1;this['voiceQueues'][_0x1c57dd['queue']][_0x4d8c('0x6a')]+=0x1;_0x47a3f8[_0x4d8c('0xe4')]=0xa;_0x47a3f8[_0x4d8c('0xa2')]=_0x4d8c('0x103');_0x47a3f8[_0x4d8c('0x104')]=_0x4d8c('0x105');_0x47a3f8[_0x4d8c('0x106')]=this['voiceQueues'][_0x1c57dd[_0x4d8c('0xac')]][_0x4d8c('0xf9')]?moment()[_0x4d8c('0x8e')](_0x4d8c('0xfb')):undefined;this[_0x4d8c('0xfe')](_0x47a3f8);}else{this[_0x4d8c('0x1d')][_0x1c57dd['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x4d8c('0x1d')][_0x1c57dd[_0x4d8c('0xac')]][_0x4d8c('0x107')]+=0x1;_0x47a3f8[_0x4d8c('0xe4')]=0xb;_0x47a3f8[_0x4d8c('0xa2')]='Abandoned';_0x47a3f8['dropreason']=_0x4d8c('0x108');this[_0x4d8c('0xfe')](_0x47a3f8);}}}};Dialer[_0x4d8c('0xa6')]['syncNewExten']=function(_0x5706a6){if(this['actions'][_0x5706a6[_0x4d8c('0xd7')]]){this[_0x4d8c('0x23')][_0x5706a6[_0x4d8c('0xd7')]][_0x4d8c('0xa9')]=_0x5706a6[_0x4d8c('0xa9')];}if(this[_0x4d8c('0x25')][_0x5706a6[_0x4d8c('0xd7')]]){this['uniqueId'][_0x5706a6[_0x4d8c('0xd7')]][_0x4d8c('0xa9')]=_0x5706a6['channel'];}};Dialer['prototype'][_0x4d8c('0x109')]=function(_0x4b96b6){if(strategy[this['voiceQueues'][this[_0x4d8c('0x23')][_0x4b96b6[_0x4d8c('0x10a')]][_0x4d8c('0xac')]]['strategy']]===_0x4d8c('0x17')){if(this[_0x4d8c('0x23')][_0x4b96b6['actionid']]&&_[_0x4d8c('0xd8')](this[_0x4d8c('0x23')][_0x4b96b6[_0x4d8c('0x10a')]][_0x4d8c('0x10b')])&&_0x4b96b6[_0x4d8c('0xa8')]==='1'&&_0x4b96b6[_0x4d8c('0x10c')]==='0'){if(this['agents'][_0x4b96b6[_0x4d8c('0x10d')]]){if(!this['agents'][_0x4b96b6['stateinterface']][_0x4d8c('0x10b')]){this[_0x4d8c('0x1f')][_0x4b96b6[_0x4d8c('0x10d')]][_0x4d8c('0x10b')]=!![];this[_0x4d8c('0x23')][_0x4b96b6[_0x4d8c('0x10a')]][_0x4d8c('0x10b')]=!![];this['actions'][_0x4b96b6[_0x4d8c('0x10a')]][_0x4d8c('0x10d')]=_0x4b96b6[_0x4d8c('0x10d')];}}}}else if((strategy[this[_0x4d8c('0x1d')][this[_0x4d8c('0x23')][_0x4b96b6[_0x4d8c('0x10a')]][_0x4d8c('0xac')]][_0x4d8c('0x4b')]]||_0x4d8c('0x10e'))===_0x4d8c('0x10e')){if(this[_0x4d8c('0x23')][_0x4b96b6[_0x4d8c('0x10a')]]){if(this[_0x4d8c('0x1f')][_0x4b96b6[_0x4d8c('0x10d')]]){this[_0x4d8c('0x23')][_0x4b96b6[_0x4d8c('0x10a')]][_0x4d8c('0x10d')]=_0x4b96b6[_0x4d8c('0x10d')];if(_['isNil'](this[_0x4d8c('0x29')][this['actions'][_0x4b96b6['actionid']][_0x4d8c('0xac')]])){this[_0x4d8c('0x29')][this[_0x4d8c('0x23')][_0x4b96b6['actionid']][_0x4d8c('0xac')]]=[];}this['queueBooked'][this[_0x4d8c('0x23')][_0x4b96b6[_0x4d8c('0x10a')]][_0x4d8c('0xac')]][_0x4d8c('0x10f')](_[_0x4d8c('0xc8')](_[_0x4d8c('0xc9')](this['actions'][_0x4b96b6[_0x4d8c('0x10a')]],[_0x4d8c('0x110'),_0x4d8c('0x10d')]),{'status':_0x4b96b6['status'],'paused':_0x4b96b6[_0x4d8c('0x10c')]}));}}}};function unlockQueueStatus(_0xcfefaf,_0x3e8c82){setTimeout(function(){if(_[_0x4d8c('0x39')](_0xcfefaf['queueStatusComplete'])){loggerBooked[_0x4d8c('0x90')](_0x4d8c('0x111'),_0x3e8c82);}_0xcfefaf[_0x4d8c('0x112')]=!![];loggerBooked[_0x4d8c('0x7b')](_0x4d8c('0x113'),_0x3e8c82,JSON[_0x4d8c('0x76')](_[_0x4d8c('0xc9')](_0xcfefaf,[_0x4d8c('0x3b'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x4d8c('0xa6')][_0x4d8c('0x36')]=function(_0xb764c4){var _0xda4af0=this;var _0x19e653=_0xda4af0['voiceQueues'][_0xda4af0[_0x4d8c('0x23')][_0xb764c4['actionid']]['queue']];if(strategy[this[_0x4d8c('0x1d')][this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]]['queue']][_0x4d8c('0x4b')]]===_0x4d8c('0x17')){if(this['actions'][_0xb764c4['actionid']]&&this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0x10d')]){this[_0x4d8c('0x1c')][_0x4d8c('0x114')](this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]]['idHopper'],this['actions'][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0x10d')])['catch'](function(_0x4058fb){logger[_0x4d8c('0x90')](_0x4d8c('0x115'),util['inspect'](_0x4058fb,{'showHidden':![],'depth':null}));})[_0x4d8c('0x1a')](function(){_0xda4af0[_0x4d8c('0xab')](_0xda4af0[_0x4d8c('0x1d')][_0xda4af0['actions'][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]]);_0xda4af0[_0x4d8c('0x1f')][_0xda4af0[_0x4d8c('0x23')][_0xb764c4['actionid']][_0x4d8c('0x10d')]][_0x4d8c('0x10b')]=![];delete _0xda4af0[_0x4d8c('0x23')][_0xb764c4['actionid']];unlockQueueStatus(_0x19e653);});}else{this[_0x4d8c('0xab')](this['voiceQueues'][this['actions'][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]]);this[_0x4d8c('0xb8')]({'active':![],'ContactId':this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]]['ContactId'],'ListId':this['actions'][_0xb764c4['actionid']][_0x4d8c('0xcb')],'VoiceQueueId':this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xcd')]||undefined,'CampaignId':this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xce')]||undefined})['catch'](loggerCatch(_0x4d8c('0x116')));delete this['actions'][_0xb764c4['actionid']];unlockQueueStatus(_0x19e653);}}else if((strategy[this[_0x4d8c('0x1d')][this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]][_0x4d8c('0x4b')]]||_0x4d8c('0x10e'))===_0x4d8c('0x10e')){var _0x3fb30e;if(this[_0x4d8c('0x23')][_0xb764c4['actionid']]&&!_[_0x4d8c('0x42')](this[_0x4d8c('0x29')][this['actions'][_0xb764c4['actionid']][_0x4d8c('0xac')]])){if(this[_0x4d8c('0x117')][_0xda4af0[_0x4d8c('0x23')][_0xb764c4['actionid']][_0x4d8c('0xac')]]){this[_0x4d8c('0x117')][_0xda4af0[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]]=this[_0x4d8c('0x117')][this['actions'][_0xb764c4['actionid']][_0x4d8c('0xac')]]?this['queueBookedRR'][this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]]:this[_0x4d8c('0x29')][this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]]?this[_0x4d8c('0x29')][this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]]['queue']][_0x4d8c('0x118')]||0x0:0x0;}this['queueBooked'][this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]][_0x4d8c('0x118')]=this[_0x4d8c('0x117')][this[_0x4d8c('0x23')][_0xb764c4[_0x4d8c('0x10a')]][_0x4d8c('0xac')]];for(var _0x428be6=0x0;_0x428be6=0x0?!![]:![];})[_0x4d8c('0xaa')](myreject(_0x289c10)));}}else{_0x367cbf[_0x4d8c('0x10f')](ami[_0x4d8c('0xa7')]({'action':_0x4d8c('0x132'),'command':util[_0x4d8c('0x8e')](_0x4d8c('0x133'),_0x1aad1d,!_[_0x4d8c('0x39')](config[_0x4d8c('0x12e')][_0x39eec6])?_0x39eec6:'')})[_0x4d8c('0xaf')](function(_0x38024b){return _0x38024b['content'][_0x4d8c('0x136')](_0x4d8c('0x137'))>=0x0?!![]:![];})[_0x4d8c('0xaa')](myreject(_0x289c10)));}BPromise['all'](_0x367cbf)[_0x4d8c('0xaf')](function(_0x468247){var _0x544fc7=_[_0x4d8c('0x138')](_0x468247);if(_0x544fc7){return _0x43f828(_0x544fc7);}else{_0x37cd66[_0x4d8c('0x3a')]=_0x2027e8?_0x4d8c('0x139'):_0x4d8c('0x13a');return _0x289c10(msgResponse(_0x4d8c('0x13b'),_0x4d8c('0x12a'),_0x4d8c('0x13c')+_0x2027e8+'\x20'+_0x3dc644+'\x20Interval\x20is\x20overtime:\x20'+util[_0x4d8c('0x91')](_0x1aad1d,{'showHidden':![],'depth':null})+_0x4d8c('0x13d')+_0x39eec6));}})['catch'](function(_0x5912cf){return _0x289c10(msgResponse(_0x4d8c('0x129'),_0x4d8c('0x12a'),JSON[_0x4d8c('0x76')](_0x5912cf)));});});};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x13e')]=function(_0x4fc81d){var _0x33ad09=this;return function(){switch(_0x4fc81d['dialMethod']){case _0x4d8c('0x13f'):freeVariablesPredictive(_0x4fc81d);_0x33ad09[_0x4d8c('0x140')](_0x4fc81d,0x1);break;case'power':freeVariablesPredictive(_0x4fc81d);_0x33ad09['handlePower'](_0x4fc81d,_0x4fc81d[_0x4d8c('0x141')]);break;case _0x4d8c('0x142'):_0x33ad09[_0x4d8c('0x142')](_0x4fc81d);break;case _0x4d8c('0x8'):freeVariablesPredictive(_0x4fc81d);_0x33ad09[_0x4d8c('0x140')](_0x4fc81d,0x1);break;default:freeVariablesPredictive(_0x4fc81d);logger[_0x4d8c('0x90')](_0x4d8c('0x143'),_0x4fc81d['name'],_0x4d8c('0x144'));}};};Dialer['prototype'][_0x4d8c('0x145')]=function(_0x198865){var _0x2338cd=this;return function(){_0x2338cd['handleIvr'](_0x198865);};};Dialer['prototype'][_0x4d8c('0x30')]=function(_0x14719c){var _0x4944d3=this;if(isNotPreview(_0x14719c[_0x4d8c('0x57')])){if(isVoiceQueueOutbound(_0x14719c['type'])&&isActive(_0x14719c[_0x4d8c('0x56')])){_0x14719c['sendMessageOneNotActive']=!![];BPromise[_0x4d8c('0xb2')]()[_0x4d8c('0xaf')](checkIsLoggedIn(_0x14719c,_0x14719c[_0x4d8c('0x4d')]))['then'](checkIsActive(_0x14719c,_0x14719c[_0x4d8c('0x56')]))[_0x4d8c('0xaf')](checkInterval(_0x14719c))[_0x4d8c('0xaf')](_0x4944d3[_0x4d8c('0x124')](_0x14719c))[_0x4d8c('0xaf')](_0x4944d3[_0x4d8c('0x128')](_0x14719c[_0x4d8c('0x146')],_0x14719c[_0x4d8c('0x147')],_0x14719c[_0x4d8c('0x3b')],_0x14719c))[_0x4d8c('0xaf')](_0x4944d3[_0x4d8c('0x148')](_0x14719c[_0x4d8c('0x3e')],_0x14719c[_0x4d8c('0x147')],_0x14719c[_0x4d8c('0x3b')],_0x14719c))[_0x4d8c('0xaf')](_0x4944d3[_0x4d8c('0x13e')](_0x14719c))[_0x4d8c('0xaa')](loggerCatchQueueSummary(_0x4d8c('0x149'),_0x14719c));}else{notSendMessagesQueue(_0x14719c);}}else{freeVariablesPredictive(_0x14719c);}};Dialer['prototype'][_0x4d8c('0x123')]=function(){var _0x1d808b=this;var _0x13bffa;for(var _0x1fd6d5 in this[_0x4d8c('0x1e')]){if(this[_0x4d8c('0x1e')][_0x4d8c('0x94')](_0x1fd6d5)){_0x13bffa=this[_0x4d8c('0x1e')][_0x1fd6d5];if(isCampaignIvr(_0x13bffa['type'])&&isActive(_0x13bffa[_0x4d8c('0x75')])){_0x13bffa[_0x4d8c('0x9b')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x13bffa,_0x13bffa[_0x4d8c('0x75')]))[_0x4d8c('0xaf')](checkInterval(_0x13bffa))[_0x4d8c('0xaf')](_0x1d808b[_0x4d8c('0x124')](_0x13bffa))['then'](_0x1d808b[_0x4d8c('0x128')](_0x13bffa['dialGlobalInterval'],_0x13bffa[_0x4d8c('0x147')],_0x13bffa[_0x4d8c('0x3b')],_0x13bffa))[_0x4d8c('0xaf')](_0x1d808b[_0x4d8c('0x148')](_0x13bffa[_0x4d8c('0x3e')],_0x13bffa[_0x4d8c('0x147')],_0x13bffa[_0x4d8c('0x3b')],_0x13bffa))[_0x4d8c('0xaf')](_0x1d808b[_0x4d8c('0x145')](_0x13bffa))[_0x4d8c('0xaa')](loggerCatchQueueSummary(_0x4d8c('0x14a'),_0x13bffa));}else{notSendMessagesCampaign(_0x13bffa);}}}};function getCallerIdRandom(_0x1b2600,_0x3ad38c){var _0x2c6f2f,_0x52fed9,_0x65de58;if(_0x3ad38c<=0x0){_0x3ad38c=0x1;}_0x2c6f2f=new RegExp(_0x4d8c('0x14b')+_0x3ad38c+'}$');_0x52fed9=Math['pow'](0xa,_0x3ad38c-0x1);_0x65de58=Math[_0x4d8c('0x14c')](0xa,_0x3ad38c)-0x1;return util['format']('%s',_[_0x4d8c('0x14d')](_0x1b2600,_0x2c6f2f,_[_0x4d8c('0x14e')](_0x52fed9,_0x65de58)));}function extractCalleridName(_0x3b799d){var _0x1e296c=_0x3b799d[_0x4d8c('0x14f')](/"(.*?)"/);return _0x1e296c?_0x1e296c[0x1]:_0x3b799d;}function extractCalleridNumber(_0x25589a){var _0x38c82b=_0x25589a[_0x4d8c('0x14f')](/<(.*?)>/);return _0x38c82b?_0x38c82b[0x1]:_0x25589a;}Dialer[_0x4d8c('0xa6')][_0x4d8c('0x150')]=function(_0x56afdc,_0x39eaa5){var _0x1913f2=this;var _0x183743=uuid['v4']();this[_0x4d8c('0x23')][_0x183743]=new Action(_0x56afdc,_0x39eaa5,_0x183743);return new BPromise(function(_0x37be71,_0x52a96c){if(_[_0x4d8c('0x39')](_0x56afdc)&&_0x4d8c('0x151')!==typeof _0x56afdc){return _0x52a96c(msgResponse('originate',_0x4d8c('0x12a'),_0x4d8c('0x152')));}if(_['isUndefined'](_0x39eaa5['Contact'][_0x4d8c('0x153')])||_0x39eaa5[_0x4d8c('0x154')]['phone']===null){return _0x52a96c(msgResponse(_0x4d8c('0x155'),_0x4d8c('0x12a'),_0x4d8c('0x156')));}var _0x26b972={'XMD-CALLERID':_0x1913f2['actions'][_0x183743][_0x4d8c('0x157')](),'XMD-AGI':_0x56afdc[_0x4d8c('0xf1')]?util[_0x4d8c('0x8e')](_0x4d8c('0x158'),ipAgi,_0x56afdc[_0x4d8c('0xf1')]):_0x4d8c('0x159'),'XMD-AGIAFTER':_0x56afdc['dialQueueProject2']?util[_0x4d8c('0x8e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x56afdc[_0x4d8c('0xf9')]):_0x4d8c('0x159'),'XMD-QUEUE':_0x56afdc[_0x4d8c('0x49')]==='outbound'?util[_0x4d8c('0x8e')]('\x22%s,%s%s,,,%s\x22',_0x56afdc[_0x4d8c('0x3b')],_0x56afdc[_0x4d8c('0x15a')]||'',_0x56afdc[_0x4d8c('0xfa')]?'c':'',_0x56afdc['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x39eaa5['ContactId'],'XMD-CDRTYPE':_0x4d8c('0x7'),'CALLERID(all)':_0x1913f2[_0x4d8c('0x23')][_0x183743]['getCaller'](),'XMD-AMD':_0x56afdc['dialAMDActive']?_0x4d8c('0x15b'):_0x4d8c('0x159'),'XMD-DESTINATION':_0x4d8c('0xdc')};if(_0x56afdc[_0x4d8c('0xdd')]){_0x26b972[_0x4d8c('0x15c')]=_0x56afdc['dialAMDInitialSilence']||0x9c4;_0x26b972[_0x4d8c('0x15d')]=_0x56afdc[_0x4d8c('0x15e')]||0x5dc;_0x26b972[_0x4d8c('0x15f')]=_0x56afdc[_0x4d8c('0x160')]||0x320;_0x26b972[_0x4d8c('0x161')]=_0x56afdc[_0x4d8c('0x162')]||0x1388;_0x26b972[_0x4d8c('0x163')]=_0x56afdc['dialAMDMinWordLength']||0x64;_0x26b972[_0x4d8c('0x164')]=_0x56afdc['dialAMDBetweenWordsSilence']||0x32;_0x26b972[_0x4d8c('0x165')]=_0x56afdc[_0x4d8c('0x166')]||0x3;_0x26b972[_0x4d8c('0x167')]=_0x56afdc[_0x4d8c('0x168')]||0x100;_0x26b972[_0x4d8c('0x169')]=_0x56afdc['dialAMDMaximumWordLength']||0x1388;}if(_0x56afdc['type']===_0x4d8c('0x4a')){_0x26b972[_0x4d8c('0x16a')]=_0x39eaa5[_0x4d8c('0xcd')];}else{_0x26b972['XMD-CAMPAIGNID']=_0x39eaa5[_0x4d8c('0xce')];}for(var _0x576749 in _0x39eaa5[_0x4d8c('0x154')]){if(_0x39eaa5[_0x4d8c('0x154')][_0x4d8c('0x94')](_0x576749)){if(isNotNull(_0x39eaa5[_0x4d8c('0x154')][_0x576749])&&_0x576749!=='id'&&_0x576749!==_0x4d8c('0x16b')&&_0x576749!==_0x4d8c('0x16c')&&_0x576749!==_0x4d8c('0x16d')){_0x26b972[util['format']('%s%s','XMD-',_[_0x4d8c('0x16e')](_0x576749))]=_0x39eaa5[_0x4d8c('0x154')][_0x576749];}}}var _0x2d1b62=_0x1913f2[_0x4d8c('0xd3')](_0x56afdc['Trunk'])?getCallerId(_0x56afdc[_0x4d8c('0x74')][_0x4d8c('0x16f')],_0x56afdc[_0x4d8c('0x58')],_0x56afdc[_0x4d8c('0x170')]>0x0?getCallerIdRandom(_0x56afdc[_0x4d8c('0x171')],_0x56afdc[_0x4d8c('0x170')]):_0x56afdc[_0x4d8c('0x171')]):getCallerId(_[_0x4d8c('0xd8')](_0x56afdc[_0x4d8c('0x125')])?_0x56afdc[_0x4d8c('0x74')][_0x4d8c('0x16f')]:_0x56afdc[_0x4d8c('0x125')][_0x4d8c('0x16f')],_0x56afdc[_0x4d8c('0x58')],_0x56afdc[_0x4d8c('0x170')]>0x0?getCallerIdRandom(_0x56afdc[_0x4d8c('0x171')],_0x56afdc['dialRandomLastDigitCallerIdNumber']):_0x56afdc[_0x4d8c('0x171')]);if(_0x2d1b62){_0x26b972[_0x4d8c('0x172')]=_0x1913f2[_0x4d8c('0x23')][_0x183743][_0x4d8c('0x173')]=extractCalleridName(_0x2d1b62);_0x26b972[_0x4d8c('0x174')]=_0x1913f2[_0x4d8c('0x23')][_0x183743][_0x4d8c('0x175')]=extractCalleridNumber(_0x2d1b62);}return ami['Action']({'actionid':_0x183743,'action':'originate','channel':_0x1913f2[_0x4d8c('0xd3')](_0x56afdc[_0x4d8c('0x74')])?util[_0x4d8c('0x8e')](_0x4d8c('0x176'),_0x56afdc[_0x4d8c('0x74')][_0x4d8c('0x3b')],isNotNull(_0x56afdc[_0x4d8c('0x59')])?_0x56afdc[_0x4d8c('0x59')][_0x4d8c('0x177')]()||'':'',_0x56afdc[_0x4d8c('0x178')]>0x0?_0x39eaa5['Contact'][_0x4d8c('0x153')][_0x4d8c('0x179')](_0x56afdc[_0x4d8c('0x178')]):_0x39eaa5[_0x4d8c('0x154')]['phone']):util[_0x4d8c('0x8e')](_0x4d8c('0x176'),_['isNil'](_0x56afdc[_0x4d8c('0x125')])?_0x56afdc[_0x4d8c('0x74')][_0x4d8c('0x3b')]:_0x56afdc[_0x4d8c('0x125')][_0x4d8c('0x3b')],isNotNull(_0x56afdc['dialPrefix'])?_0x56afdc[_0x4d8c('0x59')][_0x4d8c('0x177')]()||'':'',_0x56afdc[_0x4d8c('0x178')]>0x0?_0x39eaa5['Contact'][_0x4d8c('0x153')]['substring'](_0x56afdc['dialCutDigit']):_0x39eaa5['Contact'][_0x4d8c('0x153')]),'callerid':_0x2d1b62,'Exten':_0x4d8c('0xdc'),'Context':_0x4d8c('0x17a'),'Priority':'1','variable':_0x26b972,'timeout':(_0x56afdc[_0x4d8c('0x17b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x183743})[_0x4d8c('0xaf')](function(_0x41f0e){return _0x37be71(_0x41f0e);})[_0x4d8c('0xaa')](function(_0x2206e5){_0x56afdc[_0x4d8c('0x17c')]+=0x1;var _0x1760c2=new History(_0x1913f2['actions'][_0x183743]);logger[_0x4d8c('0x90')](util[_0x4d8c('0x8e')]('[originateError]:\x20%s',JSON[_0x4d8c('0x76')](_0x2206e5)));_0x1760c2[_0x4d8c('0xe4')]=0xe;_0x1760c2[_0x4d8c('0xa2')]=_0x4d8c('0x17d');_0x1760c2['starttime']=moment()[_0x4d8c('0x8e')](_0x4d8c('0xfb'));_0x1760c2[_0x4d8c('0xa3')]=_0x1760c2[_0x4d8c('0x17e')];_0x1913f2[_0x4d8c('0xc1')](_0x1760c2)['catch'](loggerCatch('[originate][error]'));_0x1913f2[_0x4d8c('0xbf')](_0x1760c2)[_0x4d8c('0xaa')](loggerCatch('[originate][error]'))[_0x4d8c('0x1a')](function(){delete _0x1913f2[_0x4d8c('0x23')][_0x183743];return _0x52a96c(msgResponse(_0x4d8c('0x155'),'Error',_0x4d8c('0x17f')));});});});};Dialer[_0x4d8c('0xa6')]['syncOriginateResponse']=function(_0x55aff6){var _0x158117=this[_0x4d8c('0x23')][_0x55aff6['actionid']];var _0x4465d0=this;if(_0x158117){delete this[_0x4d8c('0x23')][_0x55aff6[_0x4d8c('0x10a')]];_0x158117['responsetime']=moment()[_0x4d8c('0x8e')](_0x4d8c('0xfb'));var _0x341b62=_0x158117[_0x4d8c('0x49')]===_0x4d8c('0x78')?this[_0x4d8c('0x1e')][_0x158117[_0x4d8c('0xac')]]:this['voiceQueues'][_0x158117[_0x4d8c('0x180')]()];if(!this[_0x4d8c('0xd1')](_0x55aff6[_0x4d8c('0x181')])){this['updateOriginated'](_0x341b62);return this['callProgressDetecting'](_0x158117,_0x341b62,_0x55aff6)['then'](function(_0x1868b5){})[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x182')));}else{this[_0x4d8c('0x25')][_0x55aff6[_0x4d8c('0xd7')]]=_0x158117;}}};Dialer['prototype']['checkRetriveMax']=function(_0x34eca3,_0x1e1b5c,_0x3f34e0){var _0x520d82=new History(_0x1e1b5c);if(_0x520d82['countbusyretry']+_0x520d82[_0x4d8c('0x183')]+_0x520d82['countnoanswerretry']>=_0x3f34e0[_0x4d8c('0x184')]-0x1){return!![];}switch(_0x34eca3){case 0x3:if(_0x520d82[_0x4d8c('0x185')]>=_0x3f34e0[_0x4d8c('0x186')]-0x1){return!![];}else{this[_0x4d8c('0xb8')]({'active':![],'countnoanswerretry':_0x520d82['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x4d8c('0x187')](_0x3f34e0[_0x4d8c('0x188')],_0x4d8c('0x189'))[_0x4d8c('0x8e')](_0x4d8c('0xfb')),'ContactId':_0x520d82[_0x4d8c('0xca')],'ListId':_0x520d82['ListId'],'VoiceQueueId':_0x520d82['VoiceQueueId']||undefined,'CampaignId':_0x520d82[_0x4d8c('0xce')]||undefined})[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x18a')));}break;case 0x5:if(_0x520d82[_0x4d8c('0x18b')]>=_0x3f34e0[_0x4d8c('0x18c')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x520d82[_0x4d8c('0x18b')]+=0x1,'scheduledat':moment()[_0x4d8c('0x187')](_0x3f34e0[_0x4d8c('0x18d')],_0x4d8c('0x189'))['format'](_0x4d8c('0xfb')),'ContactId':_0x520d82['ContactId'],'ListId':_0x520d82[_0x4d8c('0xcb')],'VoiceQueueId':_0x520d82[_0x4d8c('0xcd')]||undefined,'CampaignId':_0x520d82['CampaignId']||undefined})[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x18e')));}break;case 0x8:if(_0x520d82[_0x4d8c('0x183')]>=_0x3f34e0['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x4d8c('0xb8')]({'active':![],'countcongestionretry':_0x520d82[_0x4d8c('0x183')]+=0x1,'scheduledat':moment()[_0x4d8c('0x187')](_0x3f34e0[_0x4d8c('0x18f')],'minutes')[_0x4d8c('0x8e')](_0x4d8c('0xfb')),'ContactId':_0x520d82[_0x4d8c('0xca')],'ListId':_0x520d82[_0x4d8c('0xcb')],'VoiceQueueId':_0x520d82['VoiceQueueId']||undefined,'CampaignId':_0x520d82[_0x4d8c('0xce')]||undefined})[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x190')));}break;default:return!![];}};Dialer['prototype'][_0x4d8c('0x191')]=function(_0x472edc,_0x11c77e,_0x3d0e56){var _0x2980b4=this;var _0x2d064a=new History(_0x472edc);return new BPromise(function(_0xcd515b,_0x4155dc){if(_['isUndefined'](_0x11c77e)&&'object'!==typeof _0x11c77e){return _0x4155dc(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x3d0e56)&&'object'!==typeof _0x3d0e56){return _0x4155dc(msgResponse(_0x4d8c('0x192'),_0x4d8c('0x12a'),_0x4d8c('0x193')));}switch(_0x3d0e56[_0x4d8c('0xf7')]){case'0':_0x11c77e[_0x4d8c('0x194')]+=0x1;_0x2d064a['state']=0x0;_0x2d064a[_0x4d8c('0xa2')]=_0x4d8c('0x195');_0x2980b4['createHistory'](_0x2d064a)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x196')));if(_0x2980b4['checkRetriveMax'](0x0,_0x472edc,_0x11c77e)){if(_0x2d064a[_0x4d8c('0x18b')]+_0x2d064a[_0x4d8c('0x183')]+_0x2d064a['countnoanswerretry']>=_0x11c77e['dialGlobalMaxRetry']){_0x2980b4[_0x4d8c('0x197')](_0x2d064a,_0xcd515b,_0x4155dc,'reason\x200\x20no\x20such\x20number....');}else{_0x2980b4[_0x4d8c('0x198')](_0x2d064a,_0xcd515b,_0x4155dc,_0x4d8c('0x199'));}}break;case'3':_0x11c77e[_0x4d8c('0x61')]+=0x1;_0x2d064a[_0x4d8c('0xe4')]=0x3;_0x2d064a[_0x4d8c('0xa2')]=_0x4d8c('0x19a');_0x2d064a['countnoanswerretry']+=0x1;_0x2d064a[_0x4d8c('0x19b')]+=0x1;_0x2980b4[_0x4d8c('0xc1')](_0x2d064a)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x19c')));if(_0x2980b4[_0x4d8c('0x19d')](0x3,_0x472edc,_0x11c77e)){if(_0x2d064a[_0x4d8c('0x185')]>=_0x11c77e[_0x4d8c('0x186')]){_0x2980b4[_0x4d8c('0x198')](_0x2d064a,_0xcd515b,_0x4155dc,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2980b4['stateGlobal'](_0x2d064a,_0xcd515b,_0x4155dc,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x11c77e[_0x4d8c('0x5d')]+=0x1;_0x2d064a['state']=0x5;_0x2d064a['statedesc']=_0x4d8c('0x19e');_0x2d064a[_0x4d8c('0x18b')]+=0x1;_0x2d064a[_0x4d8c('0x19b')]+=0x1;_0x2980b4['createHistory'](_0x2d064a)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x19f')));if(_0x2980b4[_0x4d8c('0x19d')](0x5,_0x472edc,_0x11c77e)){if(_0x2d064a[_0x4d8c('0x18b')]>=_0x11c77e[_0x4d8c('0x18c')]){_0x2980b4[_0x4d8c('0x198')](_0x2d064a,_0xcd515b,_0x4155dc,'reason\x205\x20busy');}else{_0x2980b4['stateGlobal'](_0x2d064a,_0xcd515b,_0x4155dc,_0x4d8c('0x1a0'));}}break;case'8':_0x11c77e['outboundCongestionCallsDay']+=0x1;_0x2d064a['state']=0x8;_0x2d064a[_0x4d8c('0xa2')]=_0x4d8c('0x1a1');_0x2d064a[_0x4d8c('0x183')]+=0x1;_0x2d064a[_0x4d8c('0x19b')]+=0x1;_0x2980b4['createHistory'](_0x2d064a)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x1a2')));if(_0x2980b4[_0x4d8c('0x19d')](0x8,_0x472edc,_0x11c77e)){if(_0x2d064a[_0x4d8c('0x183')]>=_0x11c77e['dialCongestionMaxRetry']){_0x2980b4[_0x4d8c('0x198')](_0x2d064a,_0xcd515b,_0x4155dc,_0x4d8c('0x1a3'));}else{_0x2980b4[_0x4d8c('0x197')](_0x2d064a,_0xcd515b,_0x4155dc,_0x4d8c('0x1a3'));}}break;default:_0x11c77e[_0x4d8c('0xf4')]+=0x1;_0x2d064a['state']=0xc;_0x2d064a[_0x4d8c('0xa2')]=_0x3d0e56[_0x4d8c('0xf7')];_0x2980b4[_0x4d8c('0xc1')](_0x2d064a)[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x1a4')));if(_0x2980b4[_0x4d8c('0x19d')](_0x3d0e56['reason'],_0x472edc,_0x11c77e)){if(_0x2d064a[_0x4d8c('0x18b')]+_0x2d064a[_0x4d8c('0x183')]+_0x2d064a['countnoanswerretry']>=_0x11c77e[_0x4d8c('0x184')]){_0x2980b4[_0x4d8c('0x197')](_0x2d064a,_0xcd515b,_0x4155dc,_0x3d0e56[_0x4d8c('0xf7')]);}else{_0x2980b4[_0x4d8c('0x198')](_0x2d064a,_0xcd515b,_0x4155dc,_0x3d0e56['reason']);}}}});};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x197')]=function(_0x43c035,_0x5d7e8f,_0x11d51d,_0x617433){var _0xd1bf0f=new Final(_0x43c035);_0xd1bf0f[_0x4d8c('0xe4')]=0xf;_0xd1bf0f[_0x4d8c('0xa2')]='Global';this[_0x4d8c('0x198')](_0xd1bf0f,_0x5d7e8f,_0x11d51d,_0x617433);};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x198')]=function(_0x52f106,_0x40f646,_0x51f13a,_0x5f3305){this[_0x4d8c('0xbf')](_0x52f106)[_0x4d8c('0xaf')](function(_0x3f9708){return _0x40f646(msgResponse(_0x4d8c('0x192'),_0x4d8c('0xd2'),_0x5f3305));})[_0x4d8c('0xaa')](function(_0x1df911){return _0x51f13a(msgResponse(_0x4d8c('0x1a5'),_0x4d8c('0x12a'),_0x4d8c('0x1a6')));});};Dialer[_0x4d8c('0xa6')]['predictive']=function(_0x1cd99a){var _0x242886=this;var _0x5797ba=_0x1cd99a[_0x4d8c('0x1a7')]/0x64;var _0x571e99=_0x1cd99a[_0x4d8c('0x60')]/(_0x1cd99a['outboundDropCallsDayTimeout']+_0x1cd99a[_0x4d8c('0x5b')]);var _0x258423=Math['round'](_0x1cd99a[_0x4d8c('0x1a8')]*(_0x1cd99a['predictiveIntervalMaxThreshold']/0x64));var _0x5e33a9=Math['round'](_0x1cd99a[_0x4d8c('0x1a8')]*(_0x1cd99a[_0x4d8c('0x1a9')]/0x64));var _0x5ed1a3=_0x1cd99a['available']+_0x1cd99a[_0x4d8c('0x51')];var _0x58c6f6=Math[_0x4d8c('0x1aa')](_0x1cd99a[_0x4d8c('0x6f')]*_0x1cd99a[_0x4d8c('0x71')]*_0x1cd99a[_0x4d8c('0x6b')]*_0x1cd99a[_0x4d8c('0x6c')]);if(_[_0x4d8c('0x39')](_0x1cd99a[_0x4d8c('0x27')])){if(!_[_0x4d8c('0x39')](_0x1cd99a[_0x4d8c('0x73')])){_0x1cd99a[_0x4d8c('0x73')]=undefined;loggerPredictive[_0x4d8c('0x90')](_0x4d8c('0x1ab'),_0x4d8c('0x1ac'));}if(!_[_0x4d8c('0x39')](_0x1cd99a[_0x4d8c('0x8a')])){loggerPredictive[_0x4d8c('0x90')](_0x4d8c('0x1ab'),_0x4d8c('0x1ad'));clearInterval(_0x1cd99a['handlePredictive']);_0x1cd99a['handlePredictive']=undefined;}_0x1cd99a[_0x4d8c('0x27')]=moment()['format'](_0x4d8c('0xfb'));loggerPredictive['info'](_0x1cd99a[_0x4d8c('0x3b')],'collection\x20data\x20in\x20progressive\x20at',_0x1cd99a[_0x4d8c('0x27')]);this[_0x4d8c('0x140')](_0x1cd99a,0x1);}else if(ifInterval(_0x1cd99a[_0x4d8c('0x1ae')],_0x1cd99a[_0x4d8c('0x27')])){this[_0x4d8c('0x140')](_0x1cd99a,0x1);loggerPredictiveCalls[_0x4d8c('0x7b')]('[startMethodPredictive][StartProgressive][Loop]',_0x1cd99a[_0x4d8c('0x27')],_0x1cd99a[_0x4d8c('0x3b')]);_0x1cd99a[_0x4d8c('0x6f')]=0x0;_0x1cd99a[_0x4d8c('0x6a')]=0x0;}else if(_0x5797ba<_0x571e99&&_0x1cd99a['dialPredictiveOptimization']===_0x4d8c('0x1af')){freeVariablesPredictive(_0x1cd99a);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1b0'),_0x4d8c('0x1b1'),_0x571e99,_0x4d8c('0x27'),_0x1cd99a[_0x4d8c('0x3b')]);}else if(_0x58c6f6<_0x1cd99a[_0x4d8c('0x6a')]&&_0x1cd99a[_0x4d8c('0x1b2')]===_0x4d8c('0x1af')){freeVariablesPredictive(_0x1cd99a);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1b3'),_0x4d8c('0x1b4'),_0x58c6f6,_0x4d8c('0x1b5'),_0x1cd99a['predictiveIntervalErlangCallsDroppedCalls'],_0x4d8c('0x27'),_0x1cd99a[_0x4d8c('0x3b')]);}else if(!ifInterval(_0x1cd99a[_0x4d8c('0x1ae')],_0x1cd99a[_0x4d8c('0x27')])&&_[_0x4d8c('0x39')](_0x1cd99a[_0x4d8c('0x73')])&&!_[_0x4d8c('0x39')](_0x1cd99a['startProgressive'])){_0x1cd99a[_0x4d8c('0x73')]=moment()[_0x4d8c('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x1cd99a[_0x4d8c('0x3b')],'started\x20in\x20predictive\x20at',_0x1cd99a[_0x4d8c('0x73')]);this[_0x4d8c('0xb6')](_0x1cd99a[_0x4d8c('0x1ae')])[_0x4d8c('0xaf')](this[_0x4d8c('0x1b6')](_0x1cd99a))[_0x4d8c('0xaf')](mergeDataErlangB(_0x1cd99a))[_0x4d8c('0xaf')](this[_0x4d8c('0x1b7')](_0x1cd99a))[_0x4d8c('0xaa')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1cd99a));}else if(!ifInterval(_0x1cd99a[_0x4d8c('0x1ae')],_0x1cd99a[_0x4d8c('0x73')])){_0x1cd99a[_0x4d8c('0x6a')]=0x0;_0x1cd99a['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4d8c('0x7b')](_0x1cd99a['name'],_0x4d8c('0x1b8'),_0x1cd99a[_0x4d8c('0x73')]);clearInterval(_0x1cd99a[_0x4d8c('0x8a')]);_0x1cd99a[_0x4d8c('0x8a')]=undefined;this[_0x4d8c('0xb6')](_0x1cd99a['dialPredictiveInterval'])[_0x4d8c('0xaf')](this[_0x4d8c('0x1b6')](_0x1cd99a))[_0x4d8c('0xaf')](mergeDataErlangB(_0x1cd99a))['then'](this['startMethodPredictive'](_0x1cd99a))['catch'](loggerCatchPredictive(_0x4d8c('0x1b9'),_0x1cd99a));}else if(_0x1cd99a[_0x4d8c('0x1a8')]&&_0x5ed1a3<_0x1cd99a['predictiveIntervalAvailable']-_0x5e33a9){freeVariablesPredictive(_0x1cd99a);loggerPredictive[_0x4d8c('0x7b')](_0x1cd99a[_0x4d8c('0x3b')],_0x4d8c('0x1ba'),_0x5ed1a3,_0x4d8c('0x1bb'),_0x1cd99a['predictiveIntervalAvailable'],'-',_0x5e33a9,'=',_0x1cd99a[_0x4d8c('0x1a8')]-_0x5e33a9,')');}else if(_0x1cd99a[_0x4d8c('0x1a8')]&&_0x5ed1a3>_0x1cd99a[_0x4d8c('0x1a8')]+_0x258423){freeVariablesPredictive(_0x1cd99a);loggerPredictive['info'](_0x1cd99a[_0x4d8c('0x3b')],_0x4d8c('0x1ba'),_0x5ed1a3,_0x4d8c('0x1bc'),_0x1cd99a[_0x4d8c('0x1a8')],'+',_0x258423,'=',_0x1cd99a[_0x4d8c('0x1a8')]+_0x258423,')');}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x1b6')]=function(_0x5959c0){var _0x2e2c0c=this;return function(_0x33fa5b){return new BPromise(function(_0x115f51,_0x219638){_[_0x4d8c('0xc8')](_0x5959c0,_0x33fa5b[0x0]);if(checkGetDataPredictive(_0x33fa5b[0x0])){var _0x476830=_0x5959c0[_0x4d8c('0x1a8')]=_0x5959c0[_0x4d8c('0x51')]+_0x5959c0[_0x4d8c('0x9d')];var _0x71f5ae=_0x5959c0[_0x4d8c('0x1ae')]*0x3c;var _0x2256ad=_0x33fa5b[0x0][_0x4d8c('0x66')]+_0x33fa5b[0x0][_0x4d8c('0x65')];var _0x4e5b92=(_0x33fa5b[0x0][_0x4d8c('0x64')]+_0x33fa5b[0x0][_0x4d8c('0x68')]+_0x33fa5b[0x0][_0x4d8c('0x67')])/_0x33fa5b[0x0][_0x4d8c('0x6e')];_0x5959c0['predictiveIntervalHitRate']=_0x4e5b92>0x0?_0x4e5b92:0x1;switch(_0x5959c0[_0x4d8c('0x1b2')]){case _0x4d8c('0x1af'):var _0x47b9de=_0x5959c0[_0x4d8c('0x1a7')]/0x64;return _0x2e2c0c[_0x4d8c('0x1bd')](_0x476830,_0x71f5ae,_0x2256ad,_0x4e5b92,_0x47b9de)[_0x4d8c('0xaf')](function(_0x4ef712){return _0x115f51(_0x4ef712);});case'agentBusyFactor':var _0x155c3f=_0x5959c0[_0x4d8c('0x1a7')]/0x64;return _0x2e2c0c[_0x4d8c('0x1be')](_0x476830,_0x71f5ae,_0x2256ad,_0x4e5b92,_0x155c3f)['then'](function(_0x1af633){return _0x115f51(_0x1af633);});default:return _0x219638(msgResponse(_0x4d8c('0x1bf'),_0x4d8c('0x12a'),_0x4d8c('0x1c0')));}}else{return _0x219638(msgResponse(_0x4d8c('0x1bf'),_0x4d8c('0x12a'),'check\x20failure'));}});};};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x1c1')]=function(_0x5d406b){var _0x3a9e6d=this;return function(_0x50aaf6){return new BPromise(function(_0x599329,_0xc0dd3a){_[_0x4d8c('0xc8')](_0x5d406b,_0x50aaf6[0x0]);if(checkGetDataPredictive(_0x50aaf6[0x0])){loggerPredictive[_0x4d8c('0x7b')](JSON[_0x4d8c('0x76')](_0x50aaf6[0x0]));if(_0x5d406b[_0x4d8c('0x1b2')]==='dropRate'){return _0x3a9e6d[_0x4d8c('0xbd')](_0x5d406b['id'])['then'](function(_0x1a4e3e){var _0x4b93c7=_0x5d406b[_0x4d8c('0x4d')]-_0x1a4e3e[0x0][_0x4d8c('0x1c2')];var _0x6aaff4=_0x5d406b[_0x4d8c('0x1ae')]*0x3c;var _0x3a3be9=_0x50aaf6[0x0][_0x4d8c('0x66')]+_0x50aaf6[0x0]['predictiveIntervalAvgHoldtime'];var _0x4ae099=(_0x50aaf6[0x0]['predictiveIntervalAnsweredCalls']+_0x50aaf6[0x0][_0x4d8c('0x68')]+_0x50aaf6[0x0][_0x4d8c('0x67')])/_0x50aaf6[0x0][_0x4d8c('0x6e')];var _0x2db848=_0x5d406b[_0x4d8c('0x1a7')]/0x64;_0x5d406b[_0x4d8c('0x6d')]=_0x1a4e3e[0x0]['outboundQueuePauses']||0x0;_0x5d406b[_0x4d8c('0x6b')]=_0x4ae099>0x0?_0x4ae099:0x1;return _0x3a9e6d[_0x4d8c('0x1bd')](_0x4b93c7,_0x6aaff4,_0x3a3be9,_0x4ae099,_0x2db848);})[_0x4d8c('0xaf')](function(_0x51bf4c){return _0x599329(_0x51bf4c);})[_0x4d8c('0xaa')](function(_0xbce9fa){return _0xc0dd3a(msgResponse(_0x4d8c('0x1c3'),_0x4d8c('0x12a'),JSON[_0x4d8c('0x76')](_0xbce9fa)));});}if(_0x5d406b['dialPredictiveOptimization']===_0x4d8c('0x1c4')){return _0x3a9e6d[_0x4d8c('0xbd')](_0x5d406b['id'])['then'](function(_0x4dcd96){var _0x59cf95=_0x5d406b[_0x4d8c('0x4d')]-_0x4dcd96[0x0][_0x4d8c('0x1c2')];var _0x4237f9=_0x5d406b[_0x4d8c('0x1ae')]*0x3c;var _0x1656af=_0x50aaf6[0x0][_0x4d8c('0x66')]+_0x50aaf6[0x0][_0x4d8c('0x65')];var _0x18fd53=(_0x50aaf6[0x0][_0x4d8c('0x64')]+_0x50aaf6[0x0][_0x4d8c('0x68')]+_0x50aaf6[0x0][_0x4d8c('0x67')])/_0x50aaf6[0x0][_0x4d8c('0x6e')];var _0x2fa3c9=_0x5d406b[_0x4d8c('0x1a7')]/0x64;_0x5d406b['predictiveIntervalPauses']=_0x4dcd96[0x0][_0x4d8c('0x1c2')]||0x0;_0x5d406b['predictiveIntervalHitRate']=_0x18fd53>0x0?_0x18fd53:0x1;return _0x3a9e6d[_0x4d8c('0x1be')](_0x59cf95,_0x4237f9,_0x1656af,_0x18fd53,_0x2fa3c9);})[_0x4d8c('0xaf')](function(_0x524802){return _0x599329(_0x524802);})['catch'](function(_0x126d9a){return _0xc0dd3a(msgResponse('[CatchErlangB]',_0x4d8c('0x12a'),JSON[_0x4d8c('0x76')](_0x126d9a)));});}}else{return _0xc0dd3a(msgResponse(_0x4d8c('0x1bf'),_0x4d8c('0x12a'),'check\x20failure'));}});};};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x1b7')]=function(_0xf794e9){var _0x4b6c59=this;return function(){var _0x5c154d=0x0;var _0x207c45=Math[_0x4d8c('0x1aa')](_0xf794e9[_0x4d8c('0x70')]*0x3e8);if(_0x207c45>0x0){_0x207c45=_0x207c45<0x64?0x64:_0x207c45;loggerPredictive[_0x4d8c('0x7b')](_0xf794e9[_0x4d8c('0x3b')],_0x4d8c('0x1c5'),_0x207c45,_0x4d8c('0x45'));_0xf794e9[_0x4d8c('0x8a')]=setInterval(function(){_0x4b6c59[_0x4d8c('0x8a')](_0xf794e9);loggerPredictiveCalls[_0x4d8c('0x7b')](_0x4d8c('0x1c6'),_0x5c154d+=0x1);},_0x207c45);}else{loggerPredictive[_0x4d8c('0x7b')](_0xf794e9[_0x4d8c('0x3b')],_0x4d8c('0x1c7'));}};};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x1c8')]=function(_0x5c7d94,_0x14164d){var _0x22edb1=this;return function(_0x36cc44){if(_[_0x4d8c('0x42')](_0x36cc44)){if(_['isNil'](_0x14164d[_0x4d8c('0xcc')])||!_0x14164d[_0x4d8c('0x1c9')]){if(_0x5c7d94['dialMethod']===_0x4d8c('0x8')){_0x5c7d94['queueStatusComplete']=_[_0x4d8c('0x39')](_0x5c7d94[_0x4d8c('0x112')])?!![]:_0x5c7d94[_0x4d8c('0x112')];var _0x3b24de=uuid['v4']();_0x22edb1[_0x4d8c('0x23')][_0x3b24de]=new Action(_0x5c7d94,_0x14164d,_0x3b24de);loggerBooked['info'](_0x4d8c('0x1ca'),_0x3b24de,_0x4d8c('0x1cb'),JSON[_0x4d8c('0x76')](_0x5c7d94[_0x4d8c('0x112')]),'Queue:\x20',_0x5c7d94[_0x4d8c('0x3b')]);if(_0x5c7d94[_0x4d8c('0x112')]){_0x5c7d94[_0x4d8c('0x112')]=![];_0x22edb1[_0x4d8c('0x29')][_0x22edb1[_0x4d8c('0x23')][_0x3b24de]['queue']]=[];ami[_0x4d8c('0xa7')]({'actionid':_0x3b24de,'action':_0x4d8c('0x1cc'),'queue':_0x5c7d94[_0x4d8c('0x3b')]})[_0x4d8c('0xaa')](function(_0x122a2d){_0x22edb1[_0x4d8c('0xab')](_0x5c7d94);_0x22edb1[_0x4d8c('0xb8')]({'active':![],'ContactId':_0x22edb1[_0x4d8c('0x23')][_0x3b24de]['ContactId'],'ListId':_0x22edb1['actions'][_0x3b24de][_0x4d8c('0xcb')],'VoiceQueueId':_0x22edb1[_0x4d8c('0x23')][_0x3b24de][_0x4d8c('0xcd')]||undefined,'CampaignId':_0x22edb1[_0x4d8c('0x23')][_0x3b24de]['CampaignId']||undefined})[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x1cd')));delete _0x22edb1['actions'][_0x3b24de];});}else{loggerBooked[_0x4d8c('0x7b')](_0x4d8c('0x1ce'),JSON[_0x4d8c('0x76')](_0x5c7d94['queueStatusComplete']),_0x4d8c('0x1cf'),_0x5c7d94['name']);_0x22edb1[_0x4d8c('0xab')](_0x5c7d94);_0x22edb1[_0x4d8c('0xb8')]({'active':![],'ContactId':_0x22edb1[_0x4d8c('0x23')][_0x3b24de][_0x4d8c('0xca')],'ListId':_0x22edb1[_0x4d8c('0x23')][_0x3b24de][_0x4d8c('0xcb')],'VoiceQueueId':_0x22edb1[_0x4d8c('0x23')][_0x3b24de][_0x4d8c('0xcd')]||undefined,'CampaignId':_0x22edb1[_0x4d8c('0x23')][_0x3b24de][_0x4d8c('0xce')]||undefined})['catch'](loggerCatch(_0x4d8c('0x1cd')));delete _0x22edb1[_0x4d8c('0x23')][_0x3b24de];}}else{return _0x22edb1[_0x4d8c('0x150')](_0x5c7d94,_0x14164d);}}else{if(getDiff(_0x14164d[_0x4d8c('0x1d0')])<_0x5c7d94[_0x4d8c('0x1d1')]*0x3c){_0x22edb1[_0x4d8c('0x1c')]['run'](_0x14164d['id'])['finally'](function(){_0x22edb1[_0x4d8c('0xab')](_0x5c7d94);});}else{_0x5c7d94[_0x4d8c('0x62')]+=0x1;_0x22edb1['updateOriginated'](_0x5c7d94);if(_0x5c7d94[_0x4d8c('0x1d2')]){_0x22edb1['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x14164d[_0x4d8c('0xca')],'ListId':_0x14164d[_0x4d8c('0xcb')],'VoiceQueueId':_0x14164d[_0x4d8c('0xcd')]||undefined,'CampaignId':_0x14164d[_0x4d8c('0xce')]||undefined})[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0x1d3')));_0x22edb1[_0x4d8c('0xc1')](createObjHistory(_0x5c7d94,_0x14164d,'RECALLINQUEUE',0x17,_0x4d8c('0x1d4')))[_0x4d8c('0xaa')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x22edb1[_0x4d8c('0xc7')](createObjHistory(_0x5c7d94,_0x14164d,_0x4d8c('0x1d5'),0x16,_0x4d8c('0x1d6')),'[Originate][HistoryRecallClose][historyCatch]',_0x4d8c('0x1d7'));}}}}else{_0x5c7d94[_0x4d8c('0x5c')]+=0x1;_0x22edb1[_0x4d8c('0xc7')](createObjHistory(_0x5c7d94,_0x14164d,'BLACKLIST',0xd,_0x4d8c('0x1d8')),_0x4d8c('0x1d9'),_0x4d8c('0x1da'));throw'inBlackList';}};};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x1db')]=function(_0x1feb5b){var _0x57b240=this;var _0x1fa1e8=[];var _0x38f90c=_0x1feb5b[_0x4d8c('0x1dc')]-_0x1feb5b[_0x4d8c('0x95')]-_0x1feb5b[_0x4d8c('0x1dd')];emitCampaignSummary(_0x1feb5b);if(_0x38f90c>0x0){if(_0x38f90c>this['maxNumberOriginate']){_0x38f90c=this[_0x4d8c('0x21')];}_0x1feb5b[_0x4d8c('0x1dd')]+=_0x38f90c;this[_0x4d8c('0xbc')](_0x1feb5b['id'],_0x38f90c,_0x1feb5b[_0x4d8c('0x1de')])[_0x4d8c('0xaf')](function(_0x39e845){_0x1feb5b['temp']-=_0x38f90c;_0x1feb5b[_0x4d8c('0x1dd')]=_0x1feb5b[_0x4d8c('0x1dd')]>0x0?_0x1feb5b[_0x4d8c('0x1dd')]:0x0;if(!checkContactEmpty(_0x39e845)){_0x1feb5b[_0x4d8c('0x3a')]=_0x4d8c('0x1df');logger[_0x4d8c('0x7b')](_0x4d8c('0x1e0')+_0x1feb5b['name']);}else{_0x1feb5b['originated']+=_0x39e845[_0x4d8c('0x93')];_0x1feb5b[_0x4d8c('0x3a')]='RUNNING';for(var _0x246954=0x0;_0x246954<_0x39e845[_0x4d8c('0x93')];_0x246954+=0x1){_0x1feb5b[_0x4d8c('0x1e1')]+=0x1;if(_['isNil'](_0x39e845[_0x246954])||_['isNil'](_0x39e845[_0x246954]['Contact'])||_[_0x4d8c('0xd8')](_0x39e845[_0x246954][_0x4d8c('0x154')][_0x4d8c('0x153')])){_0x57b240['emptyContact']('[actionOriginate]\x20',_0x1feb5b,_0x39e845[_0x246954]);}else{_0x57b240[_0x4d8c('0xb4')](_[_0x4d8c('0xc9')](_0x39e845[_0x246954],[_0x4d8c('0xce'),_0x4d8c('0x1e2')]))[_0x4d8c('0xaf')](_0x57b240['checkContactBlack'](_0x1feb5b,_0x39e845[_0x246954]))[_0x4d8c('0xaa')](_0x57b240['loggerHandler']('[actionOriginateIvr]\x20',_0x1feb5b));}}}})[_0x4d8c('0xaa')](loggerGetContactDialer('[getContactCampaign2]',_0x1feb5b,_0x38f90c));}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x140')]=function(_0x2300f8,_0x245935){var _0x1bb403=this;var _0x2f95e7=[];var _0x3ac431=_0x245935>=0x1?_0x245935:0x1;var _0x52ab6c=[];if(_0x2300f8[_0x4d8c('0x57')]===_0x4d8c('0x8')){_0x3ac431=0x1;}var _0x4a52c2=Math[_0x4d8c('0x1aa')](_0x2300f8[_0x4d8c('0x9d')]*_0x3ac431)-_0x2300f8[_0x4d8c('0x95')]-_0x2300f8['temp'];emitVoiceQueueSummary(_0x2300f8);if(_0x2300f8[_0x4d8c('0x1e3')]>0x0){var _0xbd562f=_0x2300f8[_0x4d8c('0x1e3')]-_0x2300f8['originated']-_0x2300f8[_0x4d8c('0x51')]-_0x2300f8[_0x4d8c('0x1dd')]-_0x2300f8[_0x4d8c('0x4e')];if(_0x4a52c2>_0xbd562f){_0x4a52c2=_0xbd562f;}}if(_0x4a52c2>0x0){if(_0x2300f8['dialMethod']===_0x4d8c('0x8')){_0x4a52c2=0x1;}if(_0x4a52c2>this['maxNumberOriginate']){_0x4a52c2=this[_0x4d8c('0x21')];}_0x2300f8[_0x4d8c('0x1dd')]+=_0x4a52c2;for(var _0x187de0 in this['agents']){if(this[_0x4d8c('0x1f')]['hasOwnProperty'](_0x187de0)){if(this[_0x4d8c('0x1f')][_0x187de0]['state']===_0x4d8c('0x1e4')&&this[_0x4d8c('0x1f')][_0x187de0][_0x4d8c('0xa8')]===_0x4d8c('0xd4')){_0x2f95e7[_0x4d8c('0x10f')](this[_0x4d8c('0x1f')][_0x187de0]['id']);}}}this[_0x4d8c('0xba')](_0x2300f8['id'],_0x2f95e7,_0x4a52c2,_0x2300f8[_0x4d8c('0x1de')])[_0x4d8c('0xaf')](function(_0x57f197){_0x2300f8[_0x4d8c('0x1dd')]-=_0x4a52c2;_0x2300f8['temp']=_0x2300f8[_0x4d8c('0x1dd')]>0x0?_0x2300f8[_0x4d8c('0x1dd')]:0x0;if(!checkContactEmpty(_0x57f197)){_0x1bb403[_0x4d8c('0xae')](_0x2300f8)[_0x4d8c('0xaf')](sendMessageReschedule(_0x2300f8))[_0x4d8c('0xaa')](loggerCatch(_0x4d8c('0xb0')));}else{_0x2300f8[_0x4d8c('0x95')]+=_0x57f197[_0x4d8c('0x93')];_0x2300f8['message']=_0x2300f8['dialMethod']===_0x4d8c('0x8')?_0x4d8c('0x15b'):_0x4d8c('0x1e5');for(var _0x594491=0x0;_0x594491<_0x57f197[_0x4d8c('0x93')];_0x594491+=0x1){if(_['isNil'](_0x57f197[_0x594491])||_[_0x4d8c('0xd8')](_0x57f197[_0x594491]['Contact'])||_[_0x4d8c('0xd8')](_0x57f197[_0x594491][_0x4d8c('0x154')][_0x4d8c('0x153')])){_0x1bb403[_0x4d8c('0xc5')](_0x4d8c('0x1e6'),_0x2300f8,_0x57f197[_0x594491]);}else{_0x1bb403[_0x4d8c('0xb1')](_[_0x4d8c('0xc9')](_0x57f197[_0x594491],[_0x4d8c('0xcd'),_0x4d8c('0x1e2')]))[_0x4d8c('0xaf')](_0x1bb403['checkContactBlack'](_0x2300f8,_0x57f197[_0x594491]))[_0x4d8c('0xaa')](_0x1bb403[_0x4d8c('0x1e7')](_0x4d8c('0x1e6'),_0x2300f8));}}}})['catch'](loggerGetContactDialer(_0x4d8c('0x1e8'),_0x2300f8,_0x4a52c2));}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x8a')]=function(_0xbc98ab){var _0x1a411a=this;if(_0xbc98ab[_0x4d8c('0x1e3')]>0x0){var _0x270a9a=_0xbc98ab[_0x4d8c('0x1e3')]-_0xbc98ab[_0x4d8c('0x95')]-_0xbc98ab[_0x4d8c('0x51')];if(_0x270a9a>0x0){this['tryOriginatePredictive'](_0xbc98ab);}else{loggerPredictiveCalls[_0x4d8c('0x7b')](_0x4d8c('0x1e9'));}}else{this['tryOriginatePredictive'](_0xbc98ab);}};Dialer[_0x4d8c('0xa6')][_0x4d8c('0x1ea')]=function(_0x536c6e){var _0x52c639=this;var _0x2e366d=[];_0x536c6e[_0x4d8c('0x95')]+=0x1;for(var _0x3d676e in this[_0x4d8c('0x1f')]){if(this[_0x4d8c('0x1f')][_0x4d8c('0x94')](_0x3d676e)){if(this[_0x4d8c('0x1f')][_0x3d676e]['state']===_0x4d8c('0x1e4')&&this[_0x4d8c('0x1f')][_0x3d676e][_0x4d8c('0xa8')]===_0x4d8c('0xd4')){_0x2e366d['push'](this[_0x4d8c('0x1f')][_0x3d676e]['id']);}}}this[_0x4d8c('0xba')](_0x536c6e['id'],_0x2e366d,0x1,_0x536c6e[_0x4d8c('0x1de')])[_0x4d8c('0xaf')](function(_0x662a83){if(!checkContactEmpty(_0x662a83)){checkContactLowerLimitOriginate(_0x536c6e,0x1,0x0);_0x52c639[_0x4d8c('0xae')](_0x536c6e)[_0x4d8c('0xaf')](sendMessageReschedule(_0x536c6e))['catch'](loggerCatch(_0x4d8c('0xb0')));}else{_0x536c6e['message']=_0x4d8c('0x1e5');if(_['isNil'](_0x662a83[0x0])||_[_0x4d8c('0xd8')](_0x662a83[0x0][_0x4d8c('0x154')])||_[_0x4d8c('0xd8')](_0x662a83[0x0][_0x4d8c('0x154')]['phone'])){_0x52c639['emptyContact'](_0x4d8c('0x1e6'),_0x536c6e,_0x662a83[0x0]);}else{_0x52c639[_0x4d8c('0xb1')](_[_0x4d8c('0xc9')](_0x662a83[0x0],[_0x4d8c('0xcd'),_0x4d8c('0x1e2')]))[_0x4d8c('0xaf')](_0x52c639[_0x4d8c('0x1c8')](_0x536c6e,_0x662a83[0x0]))[_0x4d8c('0xaa')](_0x52c639['loggerHandler'](_0x4d8c('0x1eb'),_0x536c6e));}}})['catch'](loggerGetContactDialer(_0x4d8c('0x1ec'),_0x536c6e,0x1));emitVoiceQueueSummary(_0x536c6e);};Dialer['prototype'][_0x4d8c('0x1bd')]=function(_0x1d3a18,_0x5a2d3a,_0x573da5,_0x2739ba,_0x2479ca,_0x3c48c2){loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1ed'));loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1ee'),_0x1d3a18);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1ef'),_0x5a2d3a);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1f0'),_0x573da5);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1f1'),_0x2739ba);loggerPredictive[_0x4d8c('0x7b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2479ca);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x82'));return new BPromise(function(_0x503f8a,_0x2202ca){if(_0x1d3a18<=0x0||isNaN(_0x1d3a18)){return _0x2202ca(msgResponse(_0x4d8c('0x1f2'),'Error',_0x4d8c('0x1f3')+_0x1d3a18));}if(_0x573da5<=0x0||isNaN(_0x573da5)){return _0x2202ca(msgResponse('[abandonmentRate]',_0x4d8c('0x44'),_0x4d8c('0x1f4')+_0x573da5));}if(_0x2739ba<=0x0||isNaN(_0x2739ba)){return _0x2202ca(msgResponse(_0x4d8c('0x1f2'),'Error','p\x20=\x20'+_0x2739ba));}if(_0x5a2d3a<=0x0||isNaN(_0x5a2d3a)){return _0x2202ca(msgResponse(_0x4d8c('0x1f2'),_0x4d8c('0x44'),'interval\x20=\x20'+_0x5a2d3a));}if(_0x2479ca<=0x0||isNaN(_0x2479ca)){return _0x2202ca(msgResponse(_0x4d8c('0x1f2'),_0x4d8c('0x44'),_0x4d8c('0x1f5')+_0x2479ca));}_0x3c48c2=_0x3c48c2||0x0;var _0x3db1e7=0x1/_0x573da5;var _0x301766=0x0;var _0x51abda=0x0;var _0x1ec27a=0x0;var _0x513b59=0x0;for(var _0x3a95fd=0x0;_0x1ec27a<_0x2479ca;_0x3a95fd+=0x1){_0x51abda=_0x3a95fd/_0x5a2d3a;_0x301766=(_0x2739ba*_0x51abda+_0x3c48c2)/_0x3db1e7;_0x1ec27a=erlangb(_0x301766,_0x1d3a18);_0x513b59=_0x301766/_0x1d3a18*(0x1-erlangb(_0x301766,_0x1d3a18));}return _0x503f8a({'erlangCalls':_0x3a95fd,'erlangCallToSecond':_0x5a2d3a/_0x3a95fd,'erlangAbandonmentRate':_0x1ec27a,'erlangBusyFactor':_0x513b59});});};Dialer[_0x4d8c('0xa6')]['busyFactor']=function(_0x3e268f,_0x3148ac,_0x42d7da,_0x160a9c,_0x131cdd,_0x419537){loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1f6'));loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1ee'),_0x3e268f);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1ef'),_0x3148ac);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1f0'),_0x42d7da);loggerPredictive[_0x4d8c('0x7b')](_0x4d8c('0x1f1'),_0x160a9c);loggerPredictive[_0x4d8c('0x7b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x131cdd);loggerPredictive[_0x4d8c('0x7b')]('---------------------------');return new BPromise(function(_0x4995c0,_0x452ddf){if(_0x3e268f<=0x0||isNaN(_0x3e268f)){return _0x452ddf(msgResponse('[busyFactor]',_0x4d8c('0x44'),_0x4d8c('0x1f3')+_0x3e268f));}if(_0x42d7da<=0x0||isNaN(_0x42d7da)){return _0x452ddf(msgResponse(_0x4d8c('0x1f7'),_0x4d8c('0x44'),'Ts\x20=\x20'+_0x42d7da));}if(_0x160a9c<=0x0||isNaN(_0x160a9c)){return _0x452ddf(msgResponse(_0x4d8c('0x1f7'),_0x4d8c('0x44'),_0x4d8c('0x1f8')+_0x160a9c));}if(_0x3148ac<=0x0||isNaN(_0x3148ac)){return _0x452ddf(msgResponse('[busyFactor]',_0x4d8c('0x44'),'interval\x20=\x20'+_0x3148ac));}if(_0x131cdd<=0x0||isNaN(_0x131cdd)){return _0x452ddf(msgResponse(_0x4d8c('0x1f7'),_0x4d8c('0x44'),'Umin\x20=\x20'+_0x131cdd));}_0x419537=_0x419537||0x0;var _0x375c88=0x1/_0x42d7da;var _0x238b3f=0x0;var _0xb64ad3=0x0;var _0x3c17cc=0x0;var _0x373123=0x0;for(var _0x4ad9e5=0x0;_0x373123<_0x131cdd;_0x4ad9e5+=0x1){_0xb64ad3=_0x4ad9e5/_0x3148ac;_0x238b3f=(_0x160a9c*_0xb64ad3+_0x419537)/_0x375c88;_0x3c17cc=erlangb(_0x238b3f,_0x3e268f);_0x373123=_0x238b3f/_0x3e268f*(0x1-erlangb(_0x238b3f,_0x3e268f));}return _0x4995c0({'erlangCalls':_0x4ad9e5,'erlangCallToSecond':_0x3148ac/_0x4ad9e5,'erlangAbandonmentRate':_0x3c17cc,'erlangBusyFactor':_0x373123});});};module[_0x4d8c('0x1f9')]=Dialer; \ No newline at end of file +var _0x75d2=['[syncHangupInAMD]','uniqueid','Machine','membername','amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','Abandoned','CALLEREXIT','channel','syncQueueMember','actionid','roundrobin','locked','stateinterface','rrmemory','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','interval','true','Action','content','indexOf','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','dialPowerLevel','booked','handlePower','Queue','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','NONE','dialer','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','countcongestionretry','add','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','countglobal','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundUnknownCallsDay','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','scheduledat','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','reachable','dialOrderByScheduledAt','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','interval\x20=\x20','Umin\x20=\x20','exports','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','name','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Interval','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','seconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','statedesc','endtime','uniqueId','[uniqueid]','clearZombieChannels','[actions]','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','status','unmonitored','syncVarSet','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','state','HangupInAMD','[syncHangupInAMD][createHistory]'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x75d2,0x115));var _0x275d=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x75d2[_0xf0bcac];return _0x4e4c65;};'use strict';var util=require('util');var _=require(_0x275d('0x0'));var BPromise=require('bluebird');var uuid=require(_0x275d('0x1'));var moment=require(_0x275d('0x2'));var rr=require('rr');var md5=require(_0x275d('0x3'));var Redis=require(_0x275d('0x4'));var config=require(_0x275d('0x5'));var logger=require(_0x275d('0x6'))('dialer');var loggerBooked=require(_0x275d('0x6'))('booked');var loggerPredictive=require(_0x275d('0x6'))(_0x275d('0x7'));var loggerPredictiveCalls=require(_0x275d('0x6'))(_0x275d('0x8'));var loggerSyncQueueSummary=require(_0x275d('0x6'))(_0x275d('0x9'));var ami=require(_0x275d('0xa'));config[_0x275d('0xb')]=_[_0x275d('0xc')](config[_0x275d('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x275d('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x275d('0xd'));var cmHopperHistory=require(_0x275d('0xe'));var cmHopperBlack=require(_0x275d('0xf'));var voiceQueueRt=require(_0x275d('0x10'));var Action=require('./action');var History=require('./history');var Final=require(_0x275d('0x11'));var AgentComplete=require(_0x275d('0x12'));var QueueCallerAbandon=require(_0x275d('0x13'));var Hangup=require('./hangup');var ipAgi=process[_0x275d('0x14')][_0x275d('0x15')]||_0x275d('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x275d('0x17')][_0x275d('0x18')]=function(_0x30dea0){this[_0x275d('0x19')]=this['tail']?this[_0x275d('0x19')]['finally'](_0x30dea0):_0x30dea0();};function Dialer(_0x57f059,_0x4e6e1f){this[_0x275d('0x1a')]=new Sequence();this[_0x275d('0x1b')]=_0x4e6e1f;this[_0x275d('0x1c')]=_0x57f059['voiceQueues'];this[_0x275d('0x1d')]=_0x57f059[_0x275d('0x1d')];this[_0x275d('0x1e')]=_0x57f059[_0x275d('0x1e')];this[_0x275d('0x1f')]=_0x57f059[_0x275d('0x1f')];this[_0x275d('0x20')]=config['maxNumberOriginate']||0x2;this[_0x275d('0x21')]={};this[_0x275d('0x22')]={};this['contactsId']={};this['uniqueId']={};this[_0x275d('0x23')]={};this[_0x275d('0x24')]={};this[_0x275d('0x25')]={};this[_0x275d('0x26')]={};this[_0x275d('0x27')]={};this['queueBookedRR']={};ami['on'](_0x275d('0x28'),this[_0x275d('0x29')][_0x275d('0x2a')](this));ami['on'](_0x275d('0x2b'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x275d('0x2c'),this[_0x275d('0x2d')][_0x275d('0x2a')](this));ami['on'](_0x275d('0x2e'),this['syncAgentComplete'][_0x275d('0x2a')](this));ami['on'](_0x275d('0x2f'),this[_0x275d('0x9')][_0x275d('0x2a')](this));ami['on'](_0x275d('0x30'),this[_0x275d('0x31')][_0x275d('0x2a')](this));ami['on'](_0x275d('0x32'),this[_0x275d('0x33')][_0x275d('0x2a')](this));ami['on'](_0x275d('0x34'),this['syncVarSet'][_0x275d('0x2a')](this));ami['on'](_0x275d('0x35'),this['syncQueueMember'][_0x275d('0x2a')](this));ami['on'](_0x275d('0x36'),this[_0x275d('0x37')]['bind'](this));this[_0x275d('0x38')]();this[_0x275d('0x39')]();}function isNotNull(_0xec05f){return _0xec05f!==null&&!_[_0x275d('0x3a')](_0xec05f);}function checkIsLoggedIn(_0x4d9df3,_0x228b92){return function(){if(_0x228b92<=0x0){_0x4d9df3[_0x275d('0x3b')]=_0x275d('0x3c');throw _0x4d9df3['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x6f90d3){return _0x6f90d3;}function checkIsActive(_0xb3f87c,_0x537ca3){return function(){if(!isActive(_0x537ca3)){_0xb3f87c['message']=_0x275d('0x3d');throw _0xb3f87c['name']+_0x275d('0x3e');}};}function checkInterval(_0x3f1ae0){return function(){if(!isNotNull(_0x3f1ae0['Interval'])){_0x3f1ae0[_0x275d('0x3b')]=_0x275d('0x3f');throw _0x3f1ae0[_0x275d('0x40')]+_0x275d('0x41');}if(!isNotNull(_0x3f1ae0['Interval'][_0x275d('0x42')])){_0x3f1ae0[_0x275d('0x3b')]=_0x275d('0x3f');throw _0x3f1ae0[_0x275d('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x275d('0x43')](_0x3f1ae0[_0x275d('0x44')]['Intervals']))){_0x3f1ae0[_0x275d('0x3b')]='INTERVAL_IS_NULL';throw _0x3f1ae0[_0x275d('0x40')]+_0x275d('0x41');}};}function msgResponse(_0x344cfb,_0x583117,_0x10f6db){return{'action':_0x344cfb,'response':_0x583117,'message':_0x10f6db,'stack':_0x10f6db};}function myreject(_0x507977){return function(_0x283173){return _0x507977(msgResponse('[ifTime][Action]','Error',JSON['stringify'](_0x283173)));};}function getSeconds(_0x2fdb67,_0x44fbf3){var _0x220220=moment(_0x2fdb67)[_0x275d('0x45')](0x0);var _0x24fbe3=moment(_0x44fbf3)[_0x275d('0x45')](0x0);return _0x220220[_0x275d('0x46')](_0x24fbe3,'seconds');}function emit(_0x50a5c7,_0x2630f7,_0x1d03d2){io['to'](_0x50a5c7)[_0x275d('0x47')](_0x2630f7,_0x1d03d2);}function emitVoiceQueueSummary(_0x92549d){if(_0x92549d[_0x275d('0x48')]===_0x275d('0x49')){var _0x5e17a9={'id':_0x92549d['id'],'name':_0x92549d[_0x275d('0x40')],'strategy':_0x92549d[_0x275d('0x4a')],'answered':_0x92549d[_0x275d('0x4b')],'available':_0x92549d[_0x275d('0x4c')],'loggedIn':_0x92549d[_0x275d('0x4d')],'pTalking':_0x92549d['pTalking'],'sumBillable':_0x92549d[_0x275d('0x4e')],'sumDuration':_0x92549d['sumDuration'],'sumHoldTime':_0x92549d[_0x275d('0x4f')]||0x0,'talking':_0x92549d[_0x275d('0x50')],'total':_0x92549d['total'],'type':_0x92549d[_0x275d('0x48')],'unmanaged':_0x92549d[_0x275d('0x51')],'abandoned':_0x92549d[_0x275d('0x52')],'waiting':_0x92549d['waiting'],'loggedInDb':_0x92549d[_0x275d('0x53')],'dialActive':_0x92549d[_0x275d('0x54')],'dialMethod':_0x92549d[_0x275d('0x55')],'dialOriginateCallerIdName':_0x92549d[_0x275d('0x56')],'dialOriginateCallerIdNumber':_0x92549d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x92549d['dialOriginateTimeout'],'dialPrefix':_0x92549d['dialPrefix'],'outboundAnswerAgiCallsDay':_0x92549d[_0x275d('0x57')],'outboundAnswerCallsDay':_0x92549d[_0x275d('0x58')],'outboundBlacklistCallsDay':_0x92549d[_0x275d('0x59')],'outboundBusyCallsDay':_0x92549d[_0x275d('0x5a')],'outboundCongestionCallsDay':_0x92549d[_0x275d('0x5b')],'outboundDropCallsDayACS':_0x92549d[_0x275d('0x5c')],'outboundDropCallsDayCallersExit':_0x92549d[_0x275d('0x5d')],'outboundDropCallsDayTimeout':_0x92549d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x92549d[_0x275d('0x5e')],'outboundNoSuchCallsDay':_0x92549d[_0x275d('0x5f')],'outboundOriginateFailureCallsDay':_0x92549d[_0x275d('0x60')],'outboundReCallsDay':_0x92549d['outboundReCallsDay'],'outboundRejectCallsDay':_0x92549d['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x92549d['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x92549d[_0x275d('0x61')],'predictiveIntervalAvgHoldtime':_0x92549d[_0x275d('0x62')],'predictiveIntervalAvgTalktime':_0x92549d[_0x275d('0x63')],'predictiveIntervalDroppedCallsCallersExit':_0x92549d[_0x275d('0x64')],'predictiveIntervalDroppedCallsTimeout':_0x92549d['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x92549d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x92549d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x92549d[_0x275d('0x65')],'predictiveIntervalMultiplicativeFactor':_0x92549d[_0x275d('0x66')],'predictiveIntervalPauses':_0x92549d[_0x275d('0x67')],'predictiveIntervalAvailable':_0x92549d[_0x275d('0x68')],'predictiveIntervalTotalCalls':_0x92549d['predictiveIntervalTotalCalls'],'message':_0x92549d['message'],'originated':_0x92549d[_0x275d('0x69')],'erlangCalls':_0x92549d[_0x275d('0x6a')],'erlangCallToSecond':_0x92549d[_0x275d('0x6b')],'erlangAbandonmentRate':_0x92549d['erlangAbandonmentRate'],'erlangBusyFactor':_0x92549d['erlangBusyFactor'],'startPredictive':_0x92549d[_0x275d('0x24')],'startProgressive':_0x92549d[_0x275d('0x25')]};if(_0x92549d[_0x275d('0x6c')]){_0x5e17a9[_0x275d('0x6c')]={'id':_0x92549d[_0x275d('0x6c')]['id'],'name':_0x92549d['Trunk'][_0x275d('0x40')],'active':_0x92549d[_0x275d('0x6c')][_0x275d('0x6d')],'callerid':_0x92549d[_0x275d('0x6c')][_0x275d('0x6e')]};}if(_0x92549d['Interval']){_0x5e17a9[_0x275d('0x44')]={'id':_0x92549d[_0x275d('0x44')]['id'],'name':_0x92549d[_0x275d('0x44')][_0x275d('0x40')]};}var _0x384e62=md5(JSON['stringify'](_0x5e17a9));if(_0x92549d['md5']!==_0x384e62){_0x92549d[_0x275d('0x3')]=_0x384e62;emit(util['format'](_0x275d('0x6f'),_0x5e17a9['name']),_0x275d('0x70'),_0x5e17a9);}}}function emitCampaignSummary(_0x47dd16){if(_0x47dd16['type']===_0x275d('0x71')){emit(util[_0x275d('0x72')](_0x275d('0x73'),_0x47dd16[_0x275d('0x40')]),_0x275d('0x74'),_0x47dd16);}}function checkGetDataPredictive(_0x447687){if(isNotNull(_0x447687)){if(!_['isEmpty'](_0x447687)){loggerPredictive['info'](_0x275d('0x75'));loggerPredictive[_0x275d('0x76')](_0x275d('0x77'),_0x447687[_0x275d('0x78')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x79'),_0x447687[_0x275d('0x61')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x7a'),_0x447687[_0x275d('0x7b')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x7c'),_0x447687['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x275d('0x76')](_0x275d('0x7d'),_0x447687[_0x275d('0x62')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x7e'),_0x447687[_0x275d('0x63')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x7f'));if(_0x447687[_0x275d('0x78')]>0x0){if(!_[_0x275d('0x3a')](_0x447687['predictiveIntervalAvgTalktime'])&&_0x447687[_0x275d('0x63')]>0x0){return!![];}else{loggerPredictive[_0x275d('0x76')](_0x275d('0x80'));}if(!_[_0x275d('0x3a')](_0x447687['predictiveIntervalAvgHoldtime'])&&_0x447687['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x275d('0x76')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x275d('0x76')](_0x275d('0x81'));}}else{loggerPredictive['info'](_0x275d('0x82'));}}else{loggerPredictive[_0x275d('0x76')](_0x275d('0x82'));}return![];}function mergeDataErlangB(_0xbbb2ed){return function(_0x266153){loggerPredictive[_0x275d('0x76')](_0x275d('0x83'));loggerPredictive[_0x275d('0x76')](_0x275d('0x84'),_0x266153['erlangCalls']);loggerPredictive[_0x275d('0x76')](_0x275d('0x85'),_0x266153[_0x275d('0x6b')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x86'),_0x266153[_0x275d('0x87')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x88'),_0x266153[_0x275d('0x89')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x86'),_0x266153[_0x275d('0x87')]);loggerPredictive[_0x275d('0x76')](_0x275d('0x7f'));_[_0x275d('0x8a')](_0xbbb2ed,_0x266153);};}function getDiff(_0x5ebd8d){var _0x1d5863=moment()[_0x275d('0x45')](0x0);var _0x50ddab=moment(_0x5ebd8d)[_0x275d('0x45')](0x0);return _0x1d5863[_0x275d('0x46')](_0x50ddab,_0x275d('0x8b'));}function ifInterval(_0x3ba609,_0x4f1560){if(_[_0x275d('0x3a')](_0x4f1560)){return![];}if(getDiff(_0x4f1560)<_0x3ba609*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x416f3e){if(isNotNull(_0x416f3e)){if(!_[_0x275d('0x3a')](_0x416f3e[_0x275d('0x25')])){_0x416f3e[_0x275d('0x25')]=undefined;loggerPredictive[_0x275d('0x76')](_0x416f3e[_0x275d('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x275d('0x3a')](_0x416f3e[_0x275d('0x24')])){_0x416f3e[_0x275d('0x24')]=undefined;loggerPredictive[_0x275d('0x76')](_0x416f3e[_0x275d('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x275d('0x3a')](_0x416f3e[_0x275d('0x8c')])){clearInterval(_0x416f3e[_0x275d('0x8c')]);_0x416f3e['handlePredictive']=undefined;loggerPredictive['info'](_0x416f3e[_0x275d('0x40')],_0x275d('0x8d'));}}}function erlangb(_0x353eb2,_0x17d915){if(_0x17d915===0x0){return 0x0;}var _0x4a0bb8=0x1;for(var _0x4962f4=0x1;_0x4962f4<=_0x17d915;_0x4962f4+=0x1){_0x4a0bb8=0x1+_0x4a0bb8*_0x4962f4/_0x353eb2;}return 0x1/_0x4a0bb8;}function isVoiceQueueOutbound(_0x543f75){return _0x543f75===_0x275d('0x49');}function isNotPreview(_0x25f463){return _0x25f463!=='preview';}function isCampaignIvr(_0x25b596){return _0x25b596===_0x275d('0x71');}function getCallerId(_0x1a4b24,_0xe3071c,_0x45318d){if(!_[_0x275d('0x3a')](_0x45318d)&&_0x275d('0x8e')===typeof _0x45318d&&!_[_0x275d('0x43')](_0x45318d)){if(!_[_0x275d('0x3a')](_0xe3071c)&&_0x275d('0x8e')===typeof _0xe3071c&&!_[_0x275d('0x43')](_0xe3071c)){return util['format']('\x22%s\x22\x20<%s>',_0xe3071c,_0x45318d);}return util[_0x275d('0x72')](_0x275d('0x8f'),_0x45318d,_0x45318d);}if(!_[_0x275d('0x3a')](_0x1a4b24)&&_0x275d('0x8e')===typeof _0x1a4b24&&!_[_0x275d('0x43')](_0x1a4b24)){return _0x1a4b24;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2aef92,_0x392eb9){return function(_0x77c049){freeVariablesPredictive(_0x392eb9);emitVoiceQueueSummary(_0x392eb9);emitCampaignSummary(_0x392eb9);loggerSyncQueueSummary[_0x275d('0x90')](_0x2aef92,util[_0x275d('0x91')](_0x77c049,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4a913e,_0x334d5a){return function(_0x168959){loggerPredictive['error'](_0x334d5a[_0x275d('0x40')],_0x4a913e);loggerPredictive[_0x275d('0x90')](_0x168959[_0x275d('0x92')]);freeVariablesPredictive(_0x334d5a);};}function loggerCatch(_0x3f6edd){return function(_0x3c2936){logger['error'](_0x3f6edd,util[_0x275d('0x91')](_0x3c2936,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x41af87){return _0x41af87&&!_['isUndefined'](_0x41af87)&&_0x41af87[_0x275d('0x93')]>0x0;}function decremetOriginate(_0x7c252b){if(!_[_0x275d('0x3a')](_0x7c252b)&&_0x7c252b!==null){if(_0x7c252b[_0x275d('0x94')]('originated')){if(_0x7c252b[_0x275d('0x69')]>0x0){_0x7c252b[_0x275d('0x69')]-=0x1;}else{logger['error'](_0x275d('0x95'));}}}else{logger[_0x275d('0x90')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x32ad1a,_0x383ba1,_0x3d0325){if(_0x383ba1>_0x3d0325){for(var _0x1ec583=0x0;_0x1ec583<_0x383ba1-_0x3d0325;_0x1ec583+=0x1){decremetOriginate(_0x32ad1a);}}}function loggerGetContactDialer(_0x1597bd,_0x9b714f,_0x1fabee){return function(_0x10fd19){checkContactLowerLimitOriginate(_0x9b714f,_0x1fabee,0x0);logger[_0x275d('0x90')](_0x1597bd,util[_0x275d('0x91')](_0x10fd19,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x56509e){return function(_0x20fe88){if(isNotNull(_0x20fe88)&&isNotNull(_0x20fe88[0x0])){if(_0x20fe88[0x0][_0x275d('0x96')]>0x0){_0x56509e[_0x275d('0x3b')]='RESCHEDULED_CONTACTS';logger['info']('[getContactDialer2][ReScheduled]'+_0x56509e[_0x275d('0x40')],_0x20fe88[0x0][_0x275d('0x96')],_0x275d('0x97'));}else{_0x56509e['message']=_0x275d('0x98');logger[_0x275d('0x76')]('[getContactDialer2][Empty]'+_0x56509e[_0x275d('0x40')]);}}};}function notSendMessagesQueue(_0x502dc6){if(_0x502dc6[_0x275d('0x99')]){freeVariablesPredictive(_0x502dc6);if(_0x502dc6[_0x275d('0x69')]===0x0&&_0x502dc6[_0x275d('0x50')]===0x0&&_0x502dc6['waiting']===0x0&&(_0x502dc6['pTalking']||0x0)===0x0){_0x502dc6['sendMessageOneNotActive']=![];_0x502dc6[_0x275d('0x4c')]=0x0;_0x502dc6[_0x275d('0x3b')]=_0x275d('0x3d');loggerSyncQueueSummary[_0x275d('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x502dc6[_0x275d('0x40')],'is\x20not\x20active');}else{_0x502dc6[_0x275d('0x3b')]=_0x275d('0x9a');loggerSyncQueueSummary[_0x275d('0x90')](_0x275d('0x9b'),_0x502dc6[_0x275d('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x502dc6);}}function notSendMessagesCampaign(_0x1a7432){if(_0x1a7432[_0x275d('0x99')]){if(_0x1a7432[_0x275d('0x69')]===0x0){_0x1a7432[_0x275d('0x99')]=![];_0x1a7432[_0x275d('0x3b')]=_0x275d('0x3d');loggerSyncQueueSummary[_0x275d('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1a7432[_0x275d('0x40')],_0x275d('0x9c'));}else{_0x1a7432[_0x275d('0x3b')]=_0x275d('0x9a');loggerSyncQueueSummary[_0x275d('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1a7432['name'],'is\x20disactive');}emitCampaignSummary(_0x1a7432);}}function createObjHistory(_0x8a56d9,_0x3ff0f1,_0x548d26,_0x106244,_0x7b738b){_0x8a56d9[_0x275d('0x3b')]=_0x548d26;var _0x54452f=new Action(_0x8a56d9,_0x3ff0f1);var _0x5b8b0f=new History(_0x54452f);_0x5b8b0f['state']=_0x106244;_0x5b8b0f[_0x275d('0x9d')]=_0x7b738b;_0x5b8b0f[_0x275d('0x9e')]=_0x54452f['starttime'];return _0x5b8b0f;}Dialer[_0x275d('0x17')][_0x275d('0x39')]=function(){var _0x425300=this;setInterval(function(){_0x425300['clearZombieChannels'](_0x425300[_0x275d('0x9f')],_0x275d('0xa0'));_0x425300[_0x275d('0xa1')](_0x425300['actions'],_0x275d('0xa2'));},0x32c8);};Dialer[_0x275d('0x17')][_0x275d('0xa1')]=function(_0x1e0f35,_0x3eb4e0){var _0x52a44e=this;for(var _0x110434 in _0x1e0f35){if(_0x1e0f35[_0x275d('0x94')](_0x110434)){this[_0x275d('0x1a')][_0x275d('0x18')](function(){if(!_['isNil'](_0x1e0f35[_0x110434])){return ami['Action']({'action':'status','channel':_0x1e0f35[_0x110434]['channel']})[_0x275d('0xa3')](function(_0x3d46a1){if(_0x3d46a1[_0x275d('0x3b')]===_0x275d('0xa4')){setTimeout(function(){if(_0x1e0f35[_0x110434]&&_0x1e0f35[_0x110434]['type']!==_0x275d('0x71')){_0x52a44e[_0x275d('0xa5')](_0x52a44e[_0x275d('0x1c')][_0x1e0f35[_0x110434]['queue']]);logger[_0x275d('0x90')]('[Dialer][checkChannel]',_0x3eb4e0,_0x110434,_0x1e0f35[_0x110434][_0x275d('0xa6')]);delete _0x1e0f35[_0x110434];}if(_0x1e0f35[_0x110434]&&_0x1e0f35[_0x110434]['type']===_0x275d('0x71')){_0x52a44e['updateOriginated'](_0x52a44e[_0x275d('0x1d')][_0x1e0f35[_0x110434][_0x275d('0xa6')]]);logger['error'](_0x275d('0xa7'),_0x3eb4e0,_0x110434,_0x1e0f35[_0x110434]['queue']);delete _0x1e0f35[_0x110434];}},0x2328);}});}});}}};Dialer[_0x275d('0x17')][_0x275d('0xa8')]=function(_0x4616b7){return BPromise[_0x275d('0xa9')]()[_0x275d('0xaa')](cmHopper[_0x275d('0xa8')](_0x4616b7))[_0x275d('0xa3')](loggerCatch(_0x275d('0xab')));};Dialer[_0x275d('0x17')][_0x275d('0xac')]=function(_0x4b37ba){return BPromise[_0x275d('0xa9')]()['then'](cmHopperBlack[_0x275d('0xac')](_0x4b37ba))[_0x275d('0xa3')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x275d('0x17')][_0x275d('0xad')]=function(_0x31b77e){return BPromise[_0x275d('0xa9')]()['then'](cmHopperBlack[_0x275d('0xad')](_0x31b77e))[_0x275d('0xa3')](loggerCatch(_0x275d('0xae')));};Dialer[_0x275d('0x17')]['averageHandleTime']=function(_0x594346){return BPromise[_0x275d('0xa9')]()[_0x275d('0xaa')](cmHopperHistory[_0x275d('0xaf')](_0x594346))[_0x275d('0xa3')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x275d('0x17')]['rescheduleContact']=function(_0x3b295e){return BPromise[_0x275d('0xa9')]()[_0x275d('0xaa')](cmHopper[_0x275d('0xb0')](_0x3b295e))['catch'](loggerCatch(_0x275d('0xb1')));};Dialer[_0x275d('0x17')][_0x275d('0xb2')]=function(_0x2d3313,_0x278461,_0x39783b,_0x1b44dd){return BPromise[_0x275d('0xa9')]()[_0x275d('0xaa')](cmHopper['getContactDialer'](_0x2d3313,_0x278461,_0x39783b,_0x1b44dd))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x275d('0x17')]['getContactDialerIvr']=function(_0x5c8b6d,_0x6b111d,_0x1f588a){return BPromise[_0x275d('0xa9')]()[_0x275d('0xaa')](cmHopper['getContactDialerIvr'](_0x5c8b6d,_0x6b111d,_0x1f588a))['catch'](loggerCatch(_0x275d('0xb3')));};Dialer['prototype'][_0x275d('0xb4')]=function(_0x44b398){return BPromise[_0x275d('0xa9')]()[_0x275d('0xaa')](voiceQueueRt['getVoiceQueueRtPauses'](_0x44b398))[_0x275d('0xa3')](loggerCatch(_0x275d('0xb5')));};Dialer[_0x275d('0x17')][_0x275d('0xb6')]=function(_0x4b5eee){return BPromise['resolve']()[_0x275d('0xaa')](cmHopper[_0x275d('0xb6')](_0x4b5eee))['catch'](loggerCatch(_0x275d('0xb7')));};Dialer[_0x275d('0x17')][_0x275d('0xb8')]=function(_0x4264d1){return BPromise['resolve']()[_0x275d('0xaa')](cmHopperHistory['createHistory'](_0x4264d1))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0x275d('0x17')]['updateOriginated']=function(_0x3acb8d){if(!_['isUndefined'](_0x3acb8d)&&_0x3acb8d!==null){if(_0x3acb8d[_0x275d('0x94')](_0x275d('0x69'))){if(_0x3acb8d[_0x275d('0x69')]>0x0){_0x3acb8d['originated']-=0x1;}else{logger['error'](_0x275d('0xb9'));}}}else{logger['error'](_0x275d('0xba'));}};Dialer[_0x275d('0x17')][_0x275d('0xbb')]=function(_0x2a6ba4,_0x391a95){var _0x22dbaa=this;return function(_0x583758){_0x22dbaa[_0x275d('0xa5')](_0x391a95);logger[_0x275d('0x90')](_0x2a6ba4,util[_0x275d('0x91')](_0x583758,{'showHidden':![],'depth':null}));};};Dialer[_0x275d('0x17')][_0x275d('0xbc')]=function(_0xccd684,_0x353dc8,_0x5ac660){var _0xcaf942={'state':0x19,'statedesc':_0x275d('0xbd')};this[_0x275d('0xa5')](_0x353dc8);this[_0x275d('0xbe')](_[_0x275d('0x8a')](_0xcaf942,_[_0x275d('0xbf')](_0x5ac660,[_0x275d('0xc0'),_0x275d('0xc1'),_0x275d('0xc2'),_0x275d('0xc3'),_0x275d('0xc4')])),'[emptyContact][createHistory]',_0x275d('0xc5'));logger[_0x275d('0x90')](_0xccd684);};Dialer[_0x275d('0x17')][_0x275d('0xc6')]=function(_0x317281){return _0x317281===_0x275d('0xc7');};Dialer[_0x275d('0x17')][_0x275d('0xc8')]=function(_0x5e549c){return!_[_0x275d('0x3a')](_0x5e549c)&&_0x5e549c&&!_[_0x275d('0x3a')](_0x5e549c[_0x275d('0x40')])&&!_['isUndefined'](_0x5e549c['active'])&&_0x5e549c[_0x275d('0x6d')]&&(this[_0x275d('0x1f')][util[_0x275d('0x72')](_0x275d('0xc9'),_0x5e549c[_0x275d('0x40')])][_0x275d('0xca')]==='reachable'||this[_0x275d('0x1f')][util[_0x275d('0x72')]('SIP/%s',_0x5e549c[_0x275d('0x40')])]['status']===_0x275d('0xcb'));};Dialer[_0x275d('0x17')][_0x275d('0xbe')]=function(_0x2fdf3d,_0x3f7a69,_0x15b59e){this[_0x275d('0xb8')](_0x2fdf3d)[_0x275d('0xa3')](loggerCatch(_0x3f7a69));this['moveContactManagedDialer'](_0x2fdf3d)[_0x275d('0xa3')](loggerCatch(_0x15b59e));};Dialer[_0x275d('0x17')][_0x275d('0xcc')]=function(_0x68e588){var _0x1cc2f4=this[_0x275d('0x9f')][_0x68e588['uniqueid']];var _0x5cf901;if(!_[_0x275d('0xcd')](_0x68e588)&&!_['isNil'](_0x68e588[_0x275d('0xce')])&&!_[_0x275d('0xcd')](_0x68e588[_0x275d('0xce')][_0x275d('0xcf')])&&_0x68e588[_0x275d('0xd0')]===_0x275d('0xd1')&&_0x1cc2f4){if(_0x1cc2f4['type']!=='ivr'&&this[_0x275d('0x1c')][_0x1cc2f4['queue']][_0x275d('0xd2')]&&_0x68e588[_0x275d('0xd3')]===_0x275d('0xd4')){delete this['uniqueId'][_0x68e588['uniqueid']];this[_0x275d('0xa5')](this[_0x275d('0x1c')][_0x1cc2f4[_0x275d('0xa6')]]);this[_0x275d('0x1c')][_0x1cc2f4['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x275d('0x1c')][_0x1cc2f4['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x5cf901=new Hangup(_0x1cc2f4,_0x68e588);_0x5cf901[_0x275d('0xd5')]=0x12;_0x5cf901['statedesc']=_0x275d('0xd6');_0x5cf901['membername']='AMD';this[_0x275d('0xbe')](_0x5cf901,_0x275d('0xd7'),_0x275d('0xd8'));}if(_0x1cc2f4[_0x275d('0x48')]!=='ivr'&&this[_0x275d('0x1c')][_0x1cc2f4[_0x275d('0xa6')]]['dialAMDActive']&&_0x68e588[_0x275d('0xd3')]==='MACHINE'){delete this[_0x275d('0x9f')][_0x68e588[_0x275d('0xd9')]];this[_0x275d('0xa5')](this[_0x275d('0x1c')][_0x1cc2f4[_0x275d('0xa6')]]);this['voiceQueues'][_0x1cc2f4['queue']][_0x275d('0x58')]+=0x1;this['voiceQueues'][_0x1cc2f4['queue']][_0x275d('0x57')]+=0x1;_0x5cf901=new Hangup(_0x1cc2f4,_0x68e588);_0x5cf901[_0x275d('0xd5')]=0x13;_0x5cf901[_0x275d('0x9d')]=_0x275d('0xda');_0x5cf901[_0x275d('0xdb')]='AMD';_0x5cf901[_0x275d('0xdc')]=!![];this[_0x275d('0xbe')](_0x5cf901,'[syncMachine][createHistory]','[syncMachine]');}if(_0x1cc2f4['type']===_0x275d('0x71')&&this[_0x275d('0x1d')][_0x1cc2f4[_0x275d('0xa6')]]['dialAMDActive']&&_0x68e588[_0x275d('0xd3')]===_0x275d('0xd4')){delete this[_0x275d('0x9f')][_0x68e588['uniqueid']];this[_0x275d('0xa5')](this[_0x275d('0x1d')][_0x1cc2f4[_0x275d('0xa6')]]);_0x5cf901=new Hangup(_0x1cc2f4,_0x68e588);_0x5cf901[_0x275d('0xd5')]=0x12;_0x5cf901[_0x275d('0x9d')]='HangupInAMD';_0x5cf901['membername']='AMD';this[_0x275d('0xbe')](_0x5cf901,_0x275d('0xdd'),_0x275d('0xde'));}if(_0x1cc2f4[_0x275d('0x48')]===_0x275d('0x71')&&this['campaigns'][_0x1cc2f4['queue']][_0x275d('0xd2')]&&_0x68e588['value']===_0x275d('0xdf')){delete this[_0x275d('0x9f')][_0x68e588[_0x275d('0xd9')]];this[_0x275d('0xa5')](this['campaigns'][_0x1cc2f4['queue']]);_0x5cf901=new Hangup(_0x1cc2f4,_0x68e588);_0x5cf901[_0x275d('0xd5')]=0x13;_0x5cf901[_0x275d('0x9d')]=_0x275d('0xda');_0x5cf901[_0x275d('0xdb')]='AMD';_0x5cf901[_0x275d('0xdc')]=!![];this['saveInDb'](_0x5cf901,'[syncMachineIvr][createHistory]',_0x275d('0xe0'));}}};Dialer[_0x275d('0x17')][_0x275d('0x31')]=function(_0x48bb6c){var _0x1a4002=this['uniqueId'][_0x48bb6c[_0x275d('0xd9')]];var _0x5c0d06=this;var _0x5a5dc2;if(_0x1a4002&&_0x1a4002[_0x275d('0x48')]===_0x275d('0x71')){delete this['uniqueId'][_0x48bb6c['uniqueid']];this['updateOriginated'](this[_0x275d('0x1d')][_0x1a4002[_0x275d('0xa6')]]);this[_0x275d('0x1d')][_0x1a4002[_0x275d('0xa6')]]['ivrAnswerCallsDay']+=0x1;_0x5a5dc2=new Hangup(_0x1a4002,_0x48bb6c);this[_0x275d('0xb8')](_0x5a5dc2)[_0x275d('0xa3')](loggerCatch(_0x275d('0xe1')));this['moveContactManagedDialer'](_0x5a5dc2)[_0x275d('0xa3')](loggerCatch(_0x275d('0xe2')));}if(_0x1a4002&&_0x1a4002[_0x275d('0x48')]!==_0x275d('0x71')&&isNotNull(this[_0x275d('0x1c')][_0x1a4002[_0x275d('0xa6')]][_0x275d('0xe3')])){delete this[_0x275d('0x9f')][_0x48bb6c[_0x275d('0xd9')]];this[_0x275d('0xa5')](this['voiceQueues'][_0x1a4002[_0x275d('0xa6')]]);this[_0x275d('0x1c')][_0x1a4002[_0x275d('0xa6')]][_0x275d('0x58')]+=0x1;this[_0x275d('0x1c')][_0x1a4002['queue']][_0x275d('0x57')]+=0x1;_0x5a5dc2=new Hangup(_0x1a4002,_0x48bb6c);_0x5a5dc2['state']=0x10;_0x5a5dc2['statedesc']=_0x275d('0xe4');_0x5a5dc2[_0x275d('0xdb')]=_0x275d('0xe5');this[_0x275d('0xb8')](_0x5a5dc2)['catch'](loggerCatch(_0x275d('0xe1')));this['moveContactManagedDialer'](_0x5a5dc2)[_0x275d('0xa3')](loggerCatch(_0x275d('0xe2')));}if(_0x1a4002&&_0x1a4002[_0x275d('0x48')]!==_0x275d('0x71')&&!isNotNull(this['voiceQueues'][_0x1a4002[_0x275d('0xa6')]][_0x275d('0xe3')])){delete this[_0x275d('0x9f')][_0x48bb6c[_0x275d('0xd9')]];this['updateOriginated'](this[_0x275d('0x1c')][_0x1a4002['queue']]);this[_0x275d('0x1c')][_0x1a4002[_0x275d('0xa6')]]['outboundUnknownCallsDay']+=0x1;_0x5a5dc2=new Hangup(_0x1a4002,_0x48bb6c);_0x5a5dc2['state']=0xc;_0x5a5dc2[_0x275d('0x9d')]=_0x48bb6c['cause-txt'];_0x5a5dc2['membername']=_0x275d('0xe6');this[_0x275d('0xb8')](_0x5a5dc2)[_0x275d('0xa3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x275d('0xb6')](_0x5a5dc2)['catch'](loggerCatch(_0x275d('0xe2')));}};Dialer[_0x275d('0x17')][_0x275d('0xe7')]=function(_0x1937c9){var _0x41ccbb=this['uniqueId'][_0x1937c9[_0x275d('0xd9')]];var _0x4a6133=this;if(this['voiceQueues'][_0x1937c9[_0x275d('0xa6')]]){if(_0x41ccbb&&_0x41ccbb['type']!==_0x275d('0x71')){delete this[_0x275d('0x9f')][_0x1937c9[_0x275d('0xd9')]];this[_0x275d('0x1c')][_0x1937c9['queue']][_0x275d('0x58')]+=0x1;var _0x51464b=new AgentComplete(_0x41ccbb,_0x1937c9);if(_0x1937c9[_0x275d('0xe8')]===_0x275d('0xe9')){_0x51464b[_0x275d('0xea')]=this[_0x275d('0x1c')][_0x1937c9[_0x275d('0xa6')]][_0x275d('0xeb')]&&this[_0x275d('0x1c')][_0x1937c9[_0x275d('0xa6')]]['dialAgiAfterHangupAgent']?moment()[_0x275d('0x72')](_0x275d('0xec')):undefined;}this[_0x275d('0xb8')](_0x51464b)['catch'](loggerCatch(_0x275d('0xed')));this[_0x275d('0xb6')](_0x51464b)['catch'](loggerCatch(_0x275d('0xee')));}}};Dialer[_0x275d('0x17')][_0x275d('0x29')]=function(_0x25c55a){if(this[_0x275d('0x1c')][_0x25c55a['queue']]){if(this['uniqueId'][_0x25c55a['uniqueid']]&&this[_0x275d('0x9f')][_0x25c55a[_0x275d('0xd9')]]['type']!==_0x275d('0x71')){this[_0x275d('0xa5')](this[_0x275d('0x1c')][_0x25c55a['queue']]);this[_0x275d('0x9f')][_0x25c55a[_0x275d('0xd9')]][_0x275d('0xef')]=moment()[_0x275d('0x72')](_0x275d('0xec'));}}};Dialer[_0x275d('0x17')][_0x275d('0xf0')]=function(_0x1dcf20){this[_0x275d('0xb8')](_0x1dcf20)[_0x275d('0xa3')](loggerCatch(_0x275d('0xed')));this[_0x275d('0xb6')](_0x1dcf20)[_0x275d('0xa3')](loggerCatch(_0x275d('0xf1')));};Dialer['prototype'][_0x275d('0xf2')]=function(_0x2947b2){var _0x19a5a9=this[_0x275d('0x9f')][_0x2947b2[_0x275d('0xd9')]];var _0x44e685=this;if(this[_0x275d('0x1c')][_0x2947b2[_0x275d('0xa6')]]){if(_0x19a5a9&&_0x19a5a9[_0x275d('0x48')]!==_0x275d('0x71')){delete this['uniqueId'][_0x2947b2[_0x275d('0xd9')]];this[_0x275d('0xa5')](this[_0x275d('0x1c')][_0x2947b2[_0x275d('0xa6')]]);_0x19a5a9[_0x275d('0xf3')]=moment()[_0x275d('0x72')]('YYYY-MM-DD\x20HH:mm:ss');var _0x172b6e=new QueueCallerAbandon(_0x19a5a9,_0x2947b2);if(getSeconds(_0x19a5a9['droptime'],_0x19a5a9['responsetime'])>=_0x19a5a9[_0x275d('0xf4')]){this[_0x275d('0x1c')][_0x2947b2['queue']][_0x275d('0x7b')]+=0x1;this[_0x275d('0x1c')][_0x2947b2[_0x275d('0xa6')]][_0x275d('0xf5')]+=0x1;this[_0x275d('0x1c')][_0x2947b2['queue']][_0x275d('0xf6')]+=0x1;_0x172b6e[_0x275d('0xd5')]=0xa;_0x172b6e[_0x275d('0x9d')]=_0x275d('0xf7');_0x172b6e[_0x275d('0xf8')]='TIMEOUT';_0x172b6e[_0x275d('0xea')]=this[_0x275d('0x1c')][_0x2947b2[_0x275d('0xa6')]][_0x275d('0xeb')]?moment()[_0x275d('0x72')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this['queueCallerAbandonCreateState'](_0x172b6e);}else{this[_0x275d('0x1c')][_0x2947b2[_0x275d('0xa6')]][_0x275d('0x64')]+=0x1;this['voiceQueues'][_0x2947b2[_0x275d('0xa6')]][_0x275d('0x5d')]+=0x1;_0x172b6e[_0x275d('0xd5')]=0xb;_0x172b6e[_0x275d('0x9d')]=_0x275d('0xf9');_0x172b6e[_0x275d('0xf8')]=_0x275d('0xfa');this[_0x275d('0xf0')](_0x172b6e);}}}};Dialer[_0x275d('0x17')]['syncNewExten']=function(_0x58023b){if(this[_0x275d('0x22')][_0x58023b[_0x275d('0xd9')]]){this[_0x275d('0x22')][_0x58023b[_0x275d('0xd9')]]['channel']=_0x58023b[_0x275d('0xfb')];}if(this[_0x275d('0x9f')][_0x58023b[_0x275d('0xd9')]]){this[_0x275d('0x9f')][_0x58023b['uniqueid']]['channel']=_0x58023b[_0x275d('0xfb')];}};Dialer['prototype'][_0x275d('0xfc')]=function(_0x35d92b){if(strategy[this[_0x275d('0x1c')][this[_0x275d('0x22')][_0x35d92b[_0x275d('0xfd')]][_0x275d('0xa6')]][_0x275d('0x4a')]]===_0x275d('0xfe')){if(this[_0x275d('0x22')][_0x35d92b[_0x275d('0xfd')]]&&_[_0x275d('0xcd')](this[_0x275d('0x22')][_0x35d92b[_0x275d('0xfd')]][_0x275d('0xff')])&&_0x35d92b[_0x275d('0xca')]==='1'&&_0x35d92b['paused']==='0'){if(this[_0x275d('0x1e')][_0x35d92b[_0x275d('0x100')]]){if(!this['agents'][_0x35d92b[_0x275d('0x100')]]['locked']){this[_0x275d('0x1e')][_0x35d92b[_0x275d('0x100')]][_0x275d('0xff')]=!![];this[_0x275d('0x22')][_0x35d92b['actionid']][_0x275d('0xff')]=!![];this['actions'][_0x35d92b[_0x275d('0xfd')]][_0x275d('0x100')]=_0x35d92b[_0x275d('0x100')];}}}}else if((strategy[this['voiceQueues'][this[_0x275d('0x22')][_0x35d92b[_0x275d('0xfd')]][_0x275d('0xa6')]][_0x275d('0x4a')]]||_0x275d('0x101'))===_0x275d('0x101')){if(this[_0x275d('0x22')][_0x35d92b[_0x275d('0xfd')]]){if(this[_0x275d('0x1e')][_0x35d92b[_0x275d('0x100')]]){this['actions'][_0x35d92b[_0x275d('0xfd')]][_0x275d('0x100')]=_0x35d92b[_0x275d('0x100')];if(_['isNil'](this['queueBooked'][this[_0x275d('0x22')][_0x35d92b['actionid']][_0x275d('0xa6')]])){this[_0x275d('0x27')][this['actions'][_0x35d92b[_0x275d('0xfd')]][_0x275d('0xa6')]]=[];}this[_0x275d('0x27')][this[_0x275d('0x22')][_0x35d92b[_0x275d('0xfd')]][_0x275d('0xa6')]][_0x275d('0x102')](_[_0x275d('0x8a')](_[_0x275d('0xbf')](this['actions'][_0x35d92b[_0x275d('0xfd')]],[_0x275d('0x103'),_0x275d('0x100')]),{'status':_0x35d92b[_0x275d('0xca')],'paused':_0x35d92b[_0x275d('0x104')]}));}}}};function unlockQueueStatus(_0x59d345,_0x5df24f){setTimeout(function(){if(_[_0x275d('0x3a')](_0x59d345[_0x275d('0x105')])){loggerBooked[_0x275d('0x90')](_0x275d('0x106'),_0x5df24f);}_0x59d345[_0x275d('0x105')]=!![];loggerBooked[_0x275d('0x76')](_0x275d('0x107'),_0x5df24f,JSON[_0x275d('0x108')](_['pick'](_0x59d345,[_0x275d('0x40'),_0x275d('0x105')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x45b502){var _0x47773b=this;var _0x2b3e67=_0x47773b[_0x275d('0x1c')][_0x47773b[_0x275d('0x22')][_0x45b502['actionid']]['queue']];if(strategy[this[_0x275d('0x1c')][this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]][_0x275d('0x4a')]]==='roundrobin'){if(this[_0x275d('0x22')][_0x45b502['actionid']]&&this['actions'][_0x45b502['actionid']]['stateinterface']){this[_0x275d('0x1b')][_0x275d('0x109')](this[_0x275d('0x22')][_0x45b502['actionid']][_0x275d('0x103')],this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0x100')])[_0x275d('0xa3')](function(_0x44c6ed){logger[_0x275d('0x90')](_0x275d('0x10a'),util[_0x275d('0x91')](_0x44c6ed,{'showHidden':![],'depth':null}));})[_0x275d('0x10b')](function(){_0x47773b['updateOriginated'](_0x47773b[_0x275d('0x1c')][_0x47773b[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]]);_0x47773b['agents'][_0x47773b[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]]['stateinterface']][_0x275d('0xff')]=![];delete _0x47773b[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]];unlockQueueStatus(_0x2b3e67);});}else{this[_0x275d('0xa5')](this['voiceQueues'][this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]]);this[_0x275d('0xb0')]({'active':![],'ContactId':this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]]['ContactId'],'ListId':this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xc1')],'VoiceQueueId':this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xc3')]||undefined,'CampaignId':this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xc4')]||undefined})[_0x275d('0xa3')](loggerCatch(_0x275d('0x10c')));delete this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]];unlockQueueStatus(_0x2b3e67);}}else if((strategy[this[_0x275d('0x1c')][this['actions'][_0x45b502['actionid']][_0x275d('0xa6')]][_0x275d('0x4a')]]||_0x275d('0x101'))===_0x275d('0x101')){var _0x43009b;if(this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]]&&!_[_0x275d('0x43')](this[_0x275d('0x27')][this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]])){if(this[_0x275d('0x10d')][_0x47773b[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]]){this['queueBookedRR'][_0x47773b['actions'][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]]=this[_0x275d('0x10d')][this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]]?this[_0x275d('0x10d')][this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]]['queue']]:this[_0x275d('0x27')][this['actions'][_0x45b502[_0x275d('0xfd')]]['queue']]?this[_0x275d('0x27')][this[_0x275d('0x22')][_0x45b502['actionid']][_0x275d('0xa6')]]['_rr']||0x0:0x0;}this[_0x275d('0x27')][this['actions'][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]][_0x275d('0x10e')]=this['queueBookedRR'][this[_0x275d('0x22')][_0x45b502[_0x275d('0xfd')]][_0x275d('0xa6')]];for(var _0x482c63=0x0;_0x482c63=0x0?!![]:![];})[_0x275d('0xa3')](myreject(_0x46dc93)));}}else{_0x10ef85[_0x275d('0x102')](ami[_0x275d('0x128')]({'action':_0x275d('0x125'),'command':util[_0x275d('0x72')]('iftime\x20%s,%s',_0x593682,!_[_0x275d('0x3a')](config[_0x275d('0x122')][_0x3042c8])?_0x3042c8:'')})[_0x275d('0xaa')](function(_0x260bbc){return _0x260bbc[_0x275d('0x129')][_0x275d('0x12a')](_0x275d('0x127'))>=0x0?!![]:![];})[_0x275d('0xa3')](myreject(_0x46dc93)));}BPromise['all'](_0x10ef85)[_0x275d('0xaa')](function(_0x4f4f6b){var _0x9b16c6=_[_0x275d('0x12b')](_0x4f4f6b);if(_0x9b16c6){return _0x2b11a1(_0x9b16c6);}else{_0x1de11f[_0x275d('0x3b')]=_0x47794e?'GLOBAL_INTERVAL_IS_OVERTIME':_0x275d('0x12c');return _0x46dc93(msgResponse(_0x275d('0x12d'),_0x275d('0x11e'),_0x275d('0x12e')+_0x47794e+'\x20'+_0x239afd+_0x275d('0x12f')+util[_0x275d('0x91')](_0x593682,{'showHidden':![],'depth':null})+_0x275d('0x130')+_0x3042c8));}})[_0x275d('0xa3')](function(_0x2e5162){return _0x46dc93(msgResponse('ifTime',_0x275d('0x11e'),JSON[_0x275d('0x108')](_0x2e5162)));});});};Dialer['prototype']['checkDialMethod']=function(_0xefc273){var _0x210dc6=this;return function(){switch(_0xefc273[_0x275d('0x55')]){case _0x275d('0x131'):freeVariablesPredictive(_0xefc273);_0x210dc6['handlePower'](_0xefc273,0x1);break;case'power':freeVariablesPredictive(_0xefc273);_0x210dc6['handlePower'](_0xefc273,_0xefc273[_0x275d('0x132')]);break;case _0x275d('0x7'):_0x210dc6['predictive'](_0xefc273);break;case _0x275d('0x133'):freeVariablesPredictive(_0xefc273);_0x210dc6[_0x275d('0x134')](_0xefc273,0x1);break;default:freeVariablesPredictive(_0xefc273);logger[_0x275d('0x90')](_0x275d('0x135'),_0xefc273[_0x275d('0x40')],_0x275d('0x136'));}};};Dialer[_0x275d('0x17')][_0x275d('0x137')]=function(_0x4765a4){var _0x240192=this;return function(){_0x240192['handleIvr'](_0x4765a4);};};Dialer[_0x275d('0x17')][_0x275d('0x9')]=function(_0x23c0b3){var _0xe0382a=this;if(isNotPreview(_0x23c0b3['dialMethod'])){if(isVoiceQueueOutbound(_0x23c0b3[_0x275d('0x48')])&&isActive(_0x23c0b3['dialActive'])){_0x23c0b3[_0x275d('0x99')]=!![];BPromise['resolve']()[_0x275d('0xaa')](checkIsLoggedIn(_0x23c0b3,_0x23c0b3[_0x275d('0x4d')]))[_0x275d('0xaa')](checkIsActive(_0x23c0b3,_0x23c0b3[_0x275d('0x54')]))['then'](checkInterval(_0x23c0b3))[_0x275d('0xaa')](_0xe0382a[_0x275d('0x138')](_0x23c0b3))[_0x275d('0xaa')](_0xe0382a['checkIfTime'](_0x23c0b3[_0x275d('0x139')],_0x23c0b3[_0x275d('0x13a')],_0x23c0b3[_0x275d('0x40')],_0x23c0b3))['then'](_0xe0382a[_0x275d('0x11d')](_0x23c0b3['Interval'],_0x23c0b3[_0x275d('0x13a')],_0x23c0b3[_0x275d('0x40')],_0x23c0b3))['then'](_0xe0382a['checkDialMethod'](_0x23c0b3))[_0x275d('0xa3')](loggerCatchQueueSummary(_0x275d('0x13b'),_0x23c0b3));}else{notSendMessagesQueue(_0x23c0b3);}}else{freeVariablesPredictive(_0x23c0b3);}};Dialer[_0x275d('0x17')][_0x275d('0x118')]=function(){var _0x517e3c=this;var _0xed107e;for(var _0x9665c3 in this[_0x275d('0x1d')]){if(this[_0x275d('0x1d')][_0x275d('0x94')](_0x9665c3)){_0xed107e=this[_0x275d('0x1d')][_0x9665c3];if(isCampaignIvr(_0xed107e[_0x275d('0x48')])&&isActive(_0xed107e['active'])){_0xed107e[_0x275d('0x99')]=!![];BPromise[_0x275d('0xa9')]()['then'](checkIsActive(_0xed107e,_0xed107e[_0x275d('0x6d')]))[_0x275d('0xaa')](checkInterval(_0xed107e))[_0x275d('0xaa')](_0x517e3c[_0x275d('0x138')](_0xed107e))[_0x275d('0xaa')](_0x517e3c['checkIfTime'](_0xed107e[_0x275d('0x139')],_0xed107e[_0x275d('0x13a')],_0xed107e['name'],_0xed107e))[_0x275d('0xaa')](_0x517e3c[_0x275d('0x11d')](_0xed107e['Interval'],_0xed107e[_0x275d('0x13a')],_0xed107e[_0x275d('0x40')],_0xed107e))[_0x275d('0xaa')](_0x517e3c[_0x275d('0x137')](_0xed107e))[_0x275d('0xa3')](loggerCatchQueueSummary('[syncCampaigns]',_0xed107e));}else{notSendMessagesCampaign(_0xed107e);}}}};function getCallerIdRandom(_0x4a0564,_0x1e480b){var _0x3a5966,_0x56da73,_0x13ac52;if(_0x1e480b<=0x0){_0x1e480b=0x1;}_0x3a5966=new RegExp(_0x275d('0x13c')+_0x1e480b+'}$');_0x56da73=Math[_0x275d('0x13d')](0xa,_0x1e480b-0x1);_0x13ac52=Math['pow'](0xa,_0x1e480b)-0x1;return util[_0x275d('0x72')]('%s',_[_0x275d('0x13e')](_0x4a0564,_0x3a5966,_['random'](_0x56da73,_0x13ac52)));}function extractCalleridName(_0x62822a){var _0x74a1f8=_0x62822a[_0x275d('0x13f')](/"(.*?)"/);return _0x74a1f8?_0x74a1f8[0x1]:_0x62822a;}function extractCalleridNumber(_0x41351b){var _0x946846=_0x41351b[_0x275d('0x13f')](/<(.*?)>/);return _0x946846?_0x946846[0x1]:_0x41351b;}Dialer[_0x275d('0x17')][_0x275d('0x140')]=function(_0x378b62,_0x290e85){var _0x423ea5=this;var _0x8b1af7=uuid['v4']();this[_0x275d('0x22')][_0x8b1af7]=new Action(_0x378b62,_0x290e85,_0x8b1af7);return new BPromise(function(_0x3c9318,_0x5917e1){if(_[_0x275d('0x3a')](_0x378b62)&&_0x275d('0x141')!==typeof _0x378b62){return _0x5917e1(msgResponse(_0x275d('0x142'),'Failure',_0x275d('0x143')));}if(_[_0x275d('0x3a')](_0x290e85[_0x275d('0x144')][_0x275d('0x145')])||_0x290e85[_0x275d('0x144')][_0x275d('0x145')]===null){return _0x5917e1(msgResponse(_0x275d('0x142'),'Failure',_0x275d('0x146')));}var _0x352408={'XMD-CALLERID':_0x423ea5[_0x275d('0x22')][_0x8b1af7]['getCaller'](),'XMD-AGI':_0x378b62['dialQueueProject']?util[_0x275d('0x72')]('\x22agi://%s/square,%s\x22',ipAgi,_0x378b62[_0x275d('0xe3')]):'NONE','XMD-AGIAFTER':_0x378b62['dialQueueProject2']?util[_0x275d('0x72')](_0x275d('0x147'),ipAgi,_0x378b62[_0x275d('0xeb')]):'NONE','XMD-QUEUE':_0x378b62[_0x275d('0x48')]===_0x275d('0x49')?util[_0x275d('0x72')](_0x275d('0x148'),_0x378b62['name'],_0x378b62['dialQueueOptions']||'',_0x378b62[_0x275d('0x149')]?'c':'',_0x378b62[_0x275d('0xf4')]||0x3):_0x275d('0x14a'),'XMD-CONTACTID':_0x290e85[_0x275d('0xc0')],'XMD-CDRTYPE':_0x275d('0x14b'),'CALLERID(all)':_0x423ea5[_0x275d('0x22')][_0x8b1af7][_0x275d('0x14c')](),'XMD-AMD':_0x378b62[_0x275d('0xd2')]?'ACTIVE':_0x275d('0x14a'),'XMD-DESTINATION':_0x275d('0xd1')};if(_0x378b62['dialAMDActive']){_0x352408[_0x275d('0x14d')]=_0x378b62[_0x275d('0x14e')]||0x9c4;_0x352408[_0x275d('0x14f')]=_0x378b62[_0x275d('0x150')]||0x5dc;_0x352408[_0x275d('0x151')]=_0x378b62['dialAMDAfterGreetingSilence']||0x320;_0x352408[_0x275d('0x152')]=_0x378b62['dialAMDTotalAnalysisTime']||0x1388;_0x352408[_0x275d('0x153')]=_0x378b62[_0x275d('0x154')]||0x64;_0x352408['XMD-AMDBETWEENWORDSSILENCE']=_0x378b62['dialAMDBetweenWordsSilence']||0x32;_0x352408[_0x275d('0x155')]=_0x378b62[_0x275d('0x156')]||0x3;_0x352408[_0x275d('0x157')]=_0x378b62[_0x275d('0x158')]||0x100;_0x352408['XMD-AMDMAXIMUMWORDLENGTH']=_0x378b62['dialAMDMaximumWordLength']||0x1388;}if(_0x378b62[_0x275d('0x48')]==='outbound'){_0x352408[_0x275d('0x159')]=_0x290e85[_0x275d('0xc3')];}else{_0x352408[_0x275d('0x15a')]=_0x290e85[_0x275d('0xc4')];}for(var _0x1c39b3 in _0x290e85[_0x275d('0x144')]){if(_0x290e85[_0x275d('0x144')]['hasOwnProperty'](_0x1c39b3)){if(isNotNull(_0x290e85['Contact'][_0x1c39b3])&&_0x1c39b3!=='id'&&_0x1c39b3!==_0x275d('0x15b')&&_0x1c39b3!==_0x275d('0x15c')&&_0x1c39b3!==_0x275d('0x15d')){_0x352408[util[_0x275d('0x72')](_0x275d('0x15e'),_0x275d('0x15f'),_['toUpper'](_0x1c39b3))]=_0x290e85[_0x275d('0x144')][_0x1c39b3];}}}var _0xa82885=_0x423ea5[_0x275d('0xc8')](_0x378b62[_0x275d('0x6c')])?getCallerId(_0x378b62[_0x275d('0x6c')][_0x275d('0x6e')],_0x378b62[_0x275d('0x56')],_0x378b62[_0x275d('0x160')]>0x0?getCallerIdRandom(_0x378b62['dialOriginateCallerIdNumber'],_0x378b62[_0x275d('0x160')]):_0x378b62[_0x275d('0x161')]):getCallerId(_[_0x275d('0xcd')](_0x378b62[_0x275d('0x162')])?_0x378b62[_0x275d('0x6c')][_0x275d('0x6e')]:_0x378b62[_0x275d('0x162')][_0x275d('0x6e')],_0x378b62[_0x275d('0x56')],_0x378b62[_0x275d('0x160')]>0x0?getCallerIdRandom(_0x378b62[_0x275d('0x161')],_0x378b62[_0x275d('0x160')]):_0x378b62[_0x275d('0x161')]);if(_0xa82885){_0x352408[_0x275d('0x163')]=_0x423ea5['actions'][_0x8b1af7]['originatecalleridname']=extractCalleridName(_0xa82885);_0x352408[_0x275d('0x164')]=_0x423ea5[_0x275d('0x22')][_0x8b1af7]['originatecalleridnum']=extractCalleridNumber(_0xa82885);}return ami['Action']({'actionid':_0x8b1af7,'action':'originate','channel':_0x423ea5['isTrunkReachable'](_0x378b62[_0x275d('0x6c')])?util[_0x275d('0x72')](_0x275d('0x165'),_0x378b62[_0x275d('0x6c')]['name'],isNotNull(_0x378b62[_0x275d('0x166')])?_0x378b62[_0x275d('0x166')][_0x275d('0x167')]()||'':'',_0x378b62[_0x275d('0x168')]>0x0?_0x290e85[_0x275d('0x144')]['phone'][_0x275d('0x169')](_0x378b62[_0x275d('0x168')]):_0x290e85[_0x275d('0x144')]['phone']):util['format']('SIP/%s/%s%s',_[_0x275d('0xcd')](_0x378b62[_0x275d('0x162')])?_0x378b62[_0x275d('0x6c')][_0x275d('0x40')]:_0x378b62[_0x275d('0x162')][_0x275d('0x40')],isNotNull(_0x378b62['dialPrefix'])?_0x378b62[_0x275d('0x166')][_0x275d('0x167')]()||'':'',_0x378b62['dialCutDigit']>0x0?_0x290e85[_0x275d('0x144')][_0x275d('0x145')]['substring'](_0x378b62[_0x275d('0x168')]):_0x290e85[_0x275d('0x144')][_0x275d('0x145')]),'callerid':_0xa82885,'Exten':_0x275d('0xd1'),'Context':_0x275d('0x16a'),'Priority':'1','variable':_0x352408,'timeout':(_0x378b62[_0x275d('0x16b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x8b1af7})[_0x275d('0xaa')](function(_0x2d238f){return _0x3c9318(_0x2d238f);})[_0x275d('0xa3')](function(_0x2c7039){_0x378b62[_0x275d('0x60')]+=0x1;var _0x25c689=new History(_0x423ea5[_0x275d('0x22')][_0x8b1af7]);logger['error'](util[_0x275d('0x72')](_0x275d('0x16c'),JSON['stringify'](_0x2c7039)));_0x25c689[_0x275d('0xd5')]=0xe;_0x25c689[_0x275d('0x9d')]=_0x275d('0x16d');_0x25c689[_0x275d('0x16e')]=moment()[_0x275d('0x72')]('YYYY-MM-DD\x20HH:mm:ss');_0x25c689[_0x275d('0x9e')]=_0x25c689[_0x275d('0x16e')];_0x423ea5['createHistory'](_0x25c689)['catch'](loggerCatch(_0x275d('0x16f')));_0x423ea5[_0x275d('0xb6')](_0x25c689)[_0x275d('0xa3')](loggerCatch('[originate][error]'))[_0x275d('0x10b')](function(){delete _0x423ea5[_0x275d('0x22')][_0x8b1af7];return _0x5917e1(msgResponse(_0x275d('0x142'),_0x275d('0x170'),_0x275d('0x171')));});});});};Dialer[_0x275d('0x17')][_0x275d('0x2d')]=function(_0x2339d6){var _0xfe53ea=this[_0x275d('0x22')][_0x2339d6['actionid']];var _0x4b5265=this;if(_0xfe53ea){delete this[_0x275d('0x22')][_0x2339d6[_0x275d('0xfd')]];_0xfe53ea['responsetime']=moment()[_0x275d('0x72')](_0x275d('0xec'));var _0x44b551=_0xfe53ea[_0x275d('0x48')]==='ivr'?this['campaigns'][_0xfe53ea['queue']]:this[_0x275d('0x1c')][_0xfe53ea[_0x275d('0x172')]()];if(!this[_0x275d('0xc6')](_0x2339d6[_0x275d('0x173')])){this['updateOriginated'](_0x44b551);return this[_0x275d('0x174')](_0xfe53ea,_0x44b551,_0x2339d6)[_0x275d('0xaa')](function(_0x13c49f){})[_0x275d('0xa3')](loggerCatch(_0x275d('0x175')));}else{this[_0x275d('0x9f')][_0x2339d6[_0x275d('0xd9')]]=_0xfe53ea;}}};Dialer[_0x275d('0x17')][_0x275d('0x176')]=function(_0x2c63ed,_0x9c61d6,_0x4f124b){var _0x39cd32=new History(_0x9c61d6);if(_0x39cd32[_0x275d('0x177')]+_0x39cd32['countcongestionretry']+_0x39cd32[_0x275d('0x178')]>=_0x4f124b[_0x275d('0x179')]-0x1){return!![];}switch(_0x2c63ed){case 0x3:if(_0x39cd32[_0x275d('0x178')]>=_0x4f124b['dialNoAnswerMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x39cd32['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x4f124b[_0x275d('0x17a')],_0x275d('0x17b'))[_0x275d('0x72')](_0x275d('0xec')),'ContactId':_0x39cd32[_0x275d('0xc0')],'ListId':_0x39cd32['ListId'],'VoiceQueueId':_0x39cd32['VoiceQueueId']||undefined,'CampaignId':_0x39cd32[_0x275d('0xc4')]||undefined})[_0x275d('0xa3')](loggerCatch(_0x275d('0x17c')));}break;case 0x5:if(_0x39cd32[_0x275d('0x177')]>=_0x4f124b[_0x275d('0x17d')]-0x1){return!![];}else{this[_0x275d('0xb0')]({'active':![],'countbusyretry':_0x39cd32[_0x275d('0x177')]+=0x1,'scheduledat':moment()['add'](_0x4f124b[_0x275d('0x17e')],'minutes')[_0x275d('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x39cd32[_0x275d('0xc0')],'ListId':_0x39cd32[_0x275d('0xc1')],'VoiceQueueId':_0x39cd32[_0x275d('0xc3')]||undefined,'CampaignId':_0x39cd32[_0x275d('0xc4')]||undefined})[_0x275d('0xa3')](loggerCatch(_0x275d('0x17f')));}break;case 0x8:if(_0x39cd32['countcongestionretry']>=_0x4f124b[_0x275d('0x180')]-0x1){return!![];}else{this[_0x275d('0xb0')]({'active':![],'countcongestionretry':_0x39cd32[_0x275d('0x181')]+=0x1,'scheduledat':moment()[_0x275d('0x182')](_0x4f124b[_0x275d('0x183')],_0x275d('0x17b'))[_0x275d('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x39cd32[_0x275d('0xc0')],'ListId':_0x39cd32[_0x275d('0xc1')],'VoiceQueueId':_0x39cd32['VoiceQueueId']||undefined,'CampaignId':_0x39cd32[_0x275d('0xc4')]||undefined})[_0x275d('0xa3')](loggerCatch(_0x275d('0x184')));}break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x3ade89,_0x1d0041,_0x1d6e28){var _0x4bcde4=this;var _0x15fe63=new History(_0x3ade89);return new BPromise(function(_0x1a4a41,_0x16d277){if(_[_0x275d('0x3a')](_0x1d0041)&&_0x275d('0x141')!==typeof _0x1d0041){return _0x16d277(msgResponse(_0x275d('0x185'),'Failure',_0x275d('0x186')));}if(_[_0x275d('0x3a')](_0x1d6e28)&&_0x275d('0x141')!==typeof _0x1d6e28){return _0x16d277(msgResponse('[callProgressDetecting]',_0x275d('0x11e'),_0x275d('0x187')));}switch(_0x1d6e28[_0x275d('0xe8')]){case'0':_0x1d0041[_0x275d('0x5f')]+=0x1;_0x15fe63['state']=0x0;_0x15fe63['statedesc']=_0x275d('0x188');_0x4bcde4[_0x275d('0xb8')](_0x15fe63)[_0x275d('0xa3')](loggerCatch(_0x275d('0x189')));if(_0x4bcde4[_0x275d('0x176')](0x0,_0x3ade89,_0x1d0041)){if(_0x15fe63[_0x275d('0x177')]+_0x15fe63[_0x275d('0x181')]+_0x15fe63['countnoanswerretry']>=_0x1d0041[_0x275d('0x179')]){_0x4bcde4[_0x275d('0x18a')](_0x15fe63,_0x1a4a41,_0x16d277,_0x275d('0x18b'));}else{_0x4bcde4[_0x275d('0x18c')](_0x15fe63,_0x1a4a41,_0x16d277,_0x275d('0x18b'));}}break;case'3':_0x1d0041['outboundNoAnswerCallsDay']+=0x1;_0x15fe63[_0x275d('0xd5')]=0x3;_0x15fe63[_0x275d('0x9d')]='NoAnswer';_0x15fe63[_0x275d('0x178')]+=0x1;_0x15fe63[_0x275d('0x18d')]+=0x1;_0x4bcde4[_0x275d('0xb8')](_0x15fe63)[_0x275d('0xa3')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4bcde4[_0x275d('0x176')](0x3,_0x3ade89,_0x1d0041)){if(_0x15fe63[_0x275d('0x178')]>=_0x1d0041[_0x275d('0x18e')]){_0x4bcde4['createStateFinal'](_0x15fe63,_0x1a4a41,_0x16d277,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4bcde4[_0x275d('0x18a')](_0x15fe63,_0x1a4a41,_0x16d277,_0x275d('0x18f'));}}break;case'5':_0x1d0041['outboundBusyCallsDay']+=0x1;_0x15fe63[_0x275d('0xd5')]=0x5;_0x15fe63['statedesc']='Busy';_0x15fe63['countbusyretry']+=0x1;_0x15fe63['countglobal']+=0x1;_0x4bcde4[_0x275d('0xb8')](_0x15fe63)[_0x275d('0xa3')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4bcde4[_0x275d('0x176')](0x5,_0x3ade89,_0x1d0041)){if(_0x15fe63[_0x275d('0x177')]>=_0x1d0041['dialBusyMaxRetry']){_0x4bcde4['createStateFinal'](_0x15fe63,_0x1a4a41,_0x16d277,_0x275d('0x190'));}else{_0x4bcde4[_0x275d('0x18a')](_0x15fe63,_0x1a4a41,_0x16d277,_0x275d('0x190'));}}break;case'8':_0x1d0041[_0x275d('0x5b')]+=0x1;_0x15fe63[_0x275d('0xd5')]=0x8;_0x15fe63[_0x275d('0x9d')]=_0x275d('0x191');_0x15fe63[_0x275d('0x181')]+=0x1;_0x15fe63['countglobal']+=0x1;_0x4bcde4['createHistory'](_0x15fe63)[_0x275d('0xa3')](loggerCatch(_0x275d('0x192')));if(_0x4bcde4[_0x275d('0x176')](0x8,_0x3ade89,_0x1d0041)){if(_0x15fe63[_0x275d('0x181')]>=_0x1d0041[_0x275d('0x180')]){_0x4bcde4[_0x275d('0x18c')](_0x15fe63,_0x1a4a41,_0x16d277,'reason\x208\x20congestion');}else{_0x4bcde4[_0x275d('0x18a')](_0x15fe63,_0x1a4a41,_0x16d277,_0x275d('0x193'));}}break;default:_0x1d0041[_0x275d('0x194')]+=0x1;_0x15fe63[_0x275d('0xd5')]=0xc;_0x15fe63[_0x275d('0x9d')]=_0x1d6e28[_0x275d('0xe8')];_0x4bcde4[_0x275d('0xb8')](_0x15fe63)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4bcde4[_0x275d('0x176')](_0x1d6e28[_0x275d('0xe8')],_0x3ade89,_0x1d0041)){if(_0x15fe63['countbusyretry']+_0x15fe63[_0x275d('0x181')]+_0x15fe63[_0x275d('0x178')]>=_0x1d0041[_0x275d('0x179')]){_0x4bcde4[_0x275d('0x18a')](_0x15fe63,_0x1a4a41,_0x16d277,_0x1d6e28[_0x275d('0xe8')]);}else{_0x4bcde4['createStateFinal'](_0x15fe63,_0x1a4a41,_0x16d277,_0x1d6e28[_0x275d('0xe8')]);}}}});};Dialer[_0x275d('0x17')][_0x275d('0x18a')]=function(_0x128eec,_0x2af4e9,_0x43a55e,_0x4070b5){var _0x594f2b=new Final(_0x128eec);_0x594f2b[_0x275d('0xd5')]=0xf;_0x594f2b[_0x275d('0x9d')]=_0x275d('0x195');this[_0x275d('0x18c')](_0x594f2b,_0x2af4e9,_0x43a55e,_0x4070b5);};Dialer[_0x275d('0x17')]['createStateFinal']=function(_0x8b6e5e,_0x34bd0c,_0x4693b1,_0x150109){this[_0x275d('0xb6')](_0x8b6e5e)[_0x275d('0xaa')](function(_0xb8203f){return _0x34bd0c(msgResponse(_0x275d('0x185'),_0x275d('0xc7'),_0x150109));})['catch'](function(_0x11668f){return _0x4693b1(msgResponse(_0x275d('0x196'),_0x275d('0x11e'),'contact\x20not\x20moved'));});};Dialer['prototype']['predictive']=function(_0x3b0940){var _0x52cccd=this;var _0x464f49=_0x3b0940[_0x275d('0x197')]/0x64;var _0x471f88=_0x3b0940[_0x275d('0xf5')]/(_0x3b0940[_0x275d('0xf5')]+_0x3b0940[_0x275d('0x58')]);var _0x2745e1=Math[_0x275d('0x198')](_0x3b0940[_0x275d('0x68')]*(_0x3b0940['predictiveIntervalMaxThreshold']/0x64));var _0x386bf2=Math[_0x275d('0x198')](_0x3b0940[_0x275d('0x68')]*(_0x3b0940[_0x275d('0x199')]/0x64));var _0x39f047=_0x3b0940[_0x275d('0x4c')]+_0x3b0940[_0x275d('0x50')];var _0x12ebc6=Math[_0x275d('0x19a')](_0x3b0940[_0x275d('0x6a')]*_0x3b0940[_0x275d('0x87')]*_0x3b0940[_0x275d('0x65')]*_0x3b0940[_0x275d('0x66')]);if(_[_0x275d('0x3a')](_0x3b0940['startProgressive'])){if(!_[_0x275d('0x3a')](_0x3b0940[_0x275d('0x24')])){_0x3b0940[_0x275d('0x24')]=undefined;loggerPredictive[_0x275d('0x90')](_0x275d('0x19b'),_0x275d('0x19c'));}if(!_['isUndefined'](_0x3b0940[_0x275d('0x8c')])){loggerPredictive[_0x275d('0x90')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3b0940[_0x275d('0x8c')]);_0x3b0940['handlePredictive']=undefined;}_0x3b0940['startProgressive']=moment()[_0x275d('0x72')](_0x275d('0xec'));loggerPredictive['info'](_0x3b0940[_0x275d('0x40')],_0x275d('0x19d'),_0x3b0940[_0x275d('0x25')]);this[_0x275d('0x134')](_0x3b0940,0x1);}else if(ifInterval(_0x3b0940['dialPredictiveInterval'],_0x3b0940[_0x275d('0x25')])){this[_0x275d('0x134')](_0x3b0940,0x1);loggerPredictiveCalls[_0x275d('0x76')](_0x275d('0x19e'),_0x3b0940[_0x275d('0x25')],_0x3b0940['name']);_0x3b0940[_0x275d('0x6a')]=0x0;_0x3b0940[_0x275d('0xf6')]=0x0;}else if(_0x464f49<_0x471f88&&_0x3b0940[_0x275d('0x19f')]===_0x275d('0x1a0')){freeVariablesPredictive(_0x3b0940);loggerPredictive[_0x275d('0x76')](_0x275d('0x1a1'),_0x275d('0x1a2'),_0x471f88,_0x275d('0x25'),_0x3b0940[_0x275d('0x40')]);}else if(_0x12ebc6<_0x3b0940[_0x275d('0xf6')]&&_0x3b0940[_0x275d('0x19f')]===_0x275d('0x1a0')){freeVariablesPredictive(_0x3b0940);loggerPredictive[_0x275d('0x76')](_0x275d('0x1a3'),_0x275d('0x1a4'),_0x12ebc6,_0x275d('0x1a5'),_0x3b0940['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x3b0940[_0x275d('0x40')]);}else if(!ifInterval(_0x3b0940[_0x275d('0x1a6')],_0x3b0940[_0x275d('0x25')])&&_[_0x275d('0x3a')](_0x3b0940[_0x275d('0x24')])&&!_[_0x275d('0x3a')](_0x3b0940[_0x275d('0x25')])){_0x3b0940[_0x275d('0x24')]=moment()['format'](_0x275d('0xec'));loggerPredictive[_0x275d('0x76')](_0x3b0940[_0x275d('0x40')],_0x275d('0x1a7'),_0x3b0940[_0x275d('0x24')]);this[_0x275d('0x1a8')](_0x3b0940['dialPredictiveInterval'])['then'](this[_0x275d('0x1a9')](_0x3b0940))[_0x275d('0xaa')](mergeDataErlangB(_0x3b0940))[_0x275d('0xaa')](this[_0x275d('0x1aa')](_0x3b0940))[_0x275d('0xa3')](loggerCatchPredictive(_0x275d('0x1ab'),_0x3b0940));}else if(!ifInterval(_0x3b0940[_0x275d('0x1a6')],_0x3b0940[_0x275d('0x24')])){_0x3b0940[_0x275d('0xf6')]=0x0;_0x3b0940[_0x275d('0x24')]=moment()['format'](_0x275d('0xec'));loggerPredictive[_0x275d('0x76')](_0x3b0940[_0x275d('0x40')],_0x275d('0x1ac'),_0x3b0940[_0x275d('0x24')]);clearInterval(_0x3b0940[_0x275d('0x8c')]);_0x3b0940[_0x275d('0x8c')]=undefined;this['averageHandleTime'](_0x3b0940['dialPredictiveInterval'])[_0x275d('0xaa')](this['getDataPredictive'](_0x3b0940))['then'](mergeDataErlangB(_0x3b0940))[_0x275d('0xaa')](this[_0x275d('0x1aa')](_0x3b0940))[_0x275d('0xa3')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3b0940));}else if(_0x3b0940[_0x275d('0x68')]&&_0x39f047<_0x3b0940['predictiveIntervalAvailable']-_0x386bf2){freeVariablesPredictive(_0x3b0940);loggerPredictive[_0x275d('0x76')](_0x3b0940[_0x275d('0x40')],_0x275d('0x1ad'),_0x39f047,_0x275d('0x1ae'),_0x3b0940[_0x275d('0x68')],'-',_0x386bf2,'=',_0x3b0940[_0x275d('0x68')]-_0x386bf2,')');}else if(_0x3b0940[_0x275d('0x68')]&&_0x39f047>_0x3b0940['predictiveIntervalAvailable']+_0x2745e1){freeVariablesPredictive(_0x3b0940);loggerPredictive[_0x275d('0x76')](_0x3b0940[_0x275d('0x40')],_0x275d('0x1ad'),_0x39f047,_0x275d('0x1af'),_0x3b0940['predictiveIntervalAvailable'],'+',_0x2745e1,'=',_0x3b0940[_0x275d('0x68')]+_0x2745e1,')');}};Dialer[_0x275d('0x17')][_0x275d('0x1a9')]=function(_0x573849){var _0x455a27=this;return function(_0x5925cf){return new BPromise(function(_0x2eccfc,_0x2d7f3d){_['merge'](_0x573849,_0x5925cf[0x0]);if(checkGetDataPredictive(_0x5925cf[0x0])){var _0x556cc9=_0x573849['predictiveIntervalAvailable']=_0x573849['talking']+_0x573849['available'];var _0x15a46e=_0x573849['dialPredictiveInterval']*0x3c;var _0x1f4186=_0x5925cf[0x0][_0x275d('0x63')]+_0x5925cf[0x0][_0x275d('0x62')];var _0x5df100=(_0x5925cf[0x0][_0x275d('0x61')]+_0x5925cf[0x0][_0x275d('0x7b')]+_0x5925cf[0x0][_0x275d('0x64')])/_0x5925cf[0x0][_0x275d('0x78')];_0x573849[_0x275d('0x65')]=_0x5df100>0x0?_0x5df100:0x1;switch(_0x573849[_0x275d('0x19f')]){case _0x275d('0x1a0'):var _0x4fc699=_0x573849[_0x275d('0x197')]/0x64;return _0x455a27[_0x275d('0x1b0')](_0x556cc9,_0x15a46e,_0x1f4186,_0x5df100,_0x4fc699)['then'](function(_0xbbb6dd){return _0x2eccfc(_0xbbb6dd);});case _0x275d('0x1b1'):var _0x1ef9bc=_0x573849[_0x275d('0x197')]/0x64;return _0x455a27[_0x275d('0x1b2')](_0x556cc9,_0x15a46e,_0x1f4186,_0x5df100,_0x1ef9bc)[_0x275d('0xaa')](function(_0x2330c7){return _0x2eccfc(_0x2330c7);});default:return _0x2d7f3d(msgResponse('[getDataPredictive]','Failure',_0x275d('0x1b3')));}}else{return _0x2d7f3d(msgResponse(_0x275d('0x1b4'),_0x275d('0x11e'),_0x275d('0x1b5')));}});};};Dialer[_0x275d('0x17')][_0x275d('0x1b6')]=function(_0x49b828){var _0x328abf=this;return function(_0x469a25){return new BPromise(function(_0x801c77,_0x24cea9){_[_0x275d('0x8a')](_0x49b828,_0x469a25[0x0]);if(checkGetDataPredictive(_0x469a25[0x0])){loggerPredictive[_0x275d('0x76')](JSON[_0x275d('0x108')](_0x469a25[0x0]));if(_0x49b828[_0x275d('0x19f')]===_0x275d('0x1a0')){return _0x328abf[_0x275d('0xb4')](_0x49b828['id'])[_0x275d('0xaa')](function(_0x589f76){var _0x485923=_0x49b828[_0x275d('0x4d')]-_0x589f76[0x0][_0x275d('0x1b7')];var _0x35989a=_0x49b828[_0x275d('0x1a6')]*0x3c;var _0x1faf29=_0x469a25[0x0]['predictiveIntervalAvgTalktime']+_0x469a25[0x0][_0x275d('0x62')];var _0x31b980=(_0x469a25[0x0][_0x275d('0x61')]+_0x469a25[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x469a25[0x0][_0x275d('0x64')])/_0x469a25[0x0][_0x275d('0x78')];var _0x303c48=_0x49b828[_0x275d('0x197')]/0x64;_0x49b828[_0x275d('0x67')]=_0x589f76[0x0][_0x275d('0x1b7')]||0x0;_0x49b828[_0x275d('0x65')]=_0x31b980>0x0?_0x31b980:0x1;return _0x328abf[_0x275d('0x1b0')](_0x485923,_0x35989a,_0x1faf29,_0x31b980,_0x303c48);})[_0x275d('0xaa')](function(_0x1998dc){return _0x801c77(_0x1998dc);})[_0x275d('0xa3')](function(_0x6b8822){return _0x24cea9(msgResponse(_0x275d('0x1b8'),_0x275d('0x11e'),JSON['stringify'](_0x6b8822)));});}if(_0x49b828[_0x275d('0x19f')]==='agentBusyFactor'){return _0x328abf['getVoiceQueueRtPauses'](_0x49b828['id'])['then'](function(_0x72b389){var _0x3c6174=_0x49b828[_0x275d('0x4d')]-_0x72b389[0x0][_0x275d('0x1b7')];var _0x5f9b75=_0x49b828['dialPredictiveInterval']*0x3c;var _0x4d693a=_0x469a25[0x0][_0x275d('0x63')]+_0x469a25[0x0][_0x275d('0x62')];var _0x55db84=(_0x469a25[0x0][_0x275d('0x61')]+_0x469a25[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x469a25[0x0][_0x275d('0x64')])/_0x469a25[0x0][_0x275d('0x78')];var _0x67fffb=_0x49b828[_0x275d('0x197')]/0x64;_0x49b828[_0x275d('0x67')]=_0x72b389[0x0][_0x275d('0x1b7')]||0x0;_0x49b828['predictiveIntervalHitRate']=_0x55db84>0x0?_0x55db84:0x1;return _0x328abf['busyFactor'](_0x3c6174,_0x5f9b75,_0x4d693a,_0x55db84,_0x67fffb);})[_0x275d('0xaa')](function(_0x41c961){return _0x801c77(_0x41c961);})[_0x275d('0xa3')](function(_0x47ba5a){return _0x24cea9(msgResponse(_0x275d('0x1b8'),_0x275d('0x11e'),JSON[_0x275d('0x108')](_0x47ba5a)));});}}else{return _0x24cea9(msgResponse('[getDataPredictive]',_0x275d('0x11e'),'check\x20failure'));}});};};Dialer[_0x275d('0x17')][_0x275d('0x1aa')]=function(_0x2415f7){var _0x5548db=this;return function(){var _0x3143ff=0x0;var _0x4a30da=Math[_0x275d('0x19a')](_0x2415f7[_0x275d('0x6b')]*0x3e8);if(_0x4a30da>0x0){_0x4a30da=_0x4a30da<0x64?0x64:_0x4a30da;loggerPredictive[_0x275d('0x76')](_0x2415f7[_0x275d('0x40')],_0x275d('0x1b9'),_0x4a30da,_0x275d('0x45'));_0x2415f7[_0x275d('0x8c')]=setInterval(function(){_0x5548db[_0x275d('0x8c')](_0x2415f7);loggerPredictiveCalls[_0x275d('0x76')](_0x275d('0x1ba'),_0x3143ff+=0x1);},_0x4a30da);}else{loggerPredictive['info'](_0x2415f7[_0x275d('0x40')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x275d('0x17')][_0x275d('0x1bb')]=function(_0x2402cd,_0x544219){var _0x5db2c0=this;return function(_0x3d1b3d){if(_[_0x275d('0x43')](_0x3d1b3d)){if(_[_0x275d('0xcd')](_0x544219[_0x275d('0xc2')])||!_0x544219['recallme']){if(_0x2402cd[_0x275d('0x55')]===_0x275d('0x133')){_0x2402cd[_0x275d('0x105')]=_[_0x275d('0x3a')](_0x2402cd['queueStatusComplete'])?!![]:_0x2402cd[_0x275d('0x105')];var _0x28bd98=uuid['v4']();_0x5db2c0[_0x275d('0x22')][_0x28bd98]=new Action(_0x2402cd,_0x544219,_0x28bd98);loggerBooked[_0x275d('0x76')](_0x275d('0x1bc'),_0x28bd98,_0x275d('0x1bd'),JSON[_0x275d('0x108')](_0x2402cd[_0x275d('0x105')]),_0x275d('0x1be'),_0x2402cd[_0x275d('0x40')]);if(_0x2402cd[_0x275d('0x105')]){_0x2402cd[_0x275d('0x105')]=![];_0x5db2c0[_0x275d('0x27')][_0x5db2c0[_0x275d('0x22')][_0x28bd98]['queue']]=[];ami['Action']({'actionid':_0x28bd98,'action':'queuestatus','queue':_0x2402cd[_0x275d('0x40')]})['catch'](function(_0x5b2fcc){_0x5db2c0[_0x275d('0xa5')](_0x2402cd);_0x5db2c0[_0x275d('0xb0')]({'active':![],'ContactId':_0x5db2c0[_0x275d('0x22')][_0x28bd98][_0x275d('0xc0')],'ListId':_0x5db2c0[_0x275d('0x22')][_0x28bd98][_0x275d('0xc1')],'VoiceQueueId':_0x5db2c0[_0x275d('0x22')][_0x28bd98][_0x275d('0xc3')]||undefined,'CampaignId':_0x5db2c0[_0x275d('0x22')][_0x28bd98]['CampaignId']||undefined})[_0x275d('0xa3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5db2c0['actions'][_0x28bd98];});}else{loggerBooked[_0x275d('0x76')](_0x275d('0x1bf'),JSON[_0x275d('0x108')](_0x2402cd[_0x275d('0x105')]),'Queue:\x20',_0x2402cd[_0x275d('0x40')]);_0x5db2c0[_0x275d('0xa5')](_0x2402cd);_0x5db2c0[_0x275d('0xb0')]({'active':![],'ContactId':_0x5db2c0[_0x275d('0x22')][_0x28bd98]['ContactId'],'ListId':_0x5db2c0[_0x275d('0x22')][_0x28bd98][_0x275d('0xc1')],'VoiceQueueId':_0x5db2c0['actions'][_0x28bd98][_0x275d('0xc3')]||undefined,'CampaignId':_0x5db2c0[_0x275d('0x22')][_0x28bd98]['CampaignId']||undefined})[_0x275d('0xa3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5db2c0[_0x275d('0x22')][_0x28bd98];}}else{return _0x5db2c0[_0x275d('0x140')](_0x2402cd,_0x544219);}}else{if(getDiff(_0x544219[_0x275d('0x1c0')])<_0x2402cd['dialRecallMeTimeout']*0x3c){_0x5db2c0['preview']['run'](_0x544219['id'])['finally'](function(){_0x5db2c0['updateOriginated'](_0x2402cd);});}else{_0x2402cd[_0x275d('0x1c1')]+=0x1;_0x5db2c0[_0x275d('0xa5')](_0x2402cd);if(_0x2402cd['dialRecallInQueue']){_0x5db2c0[_0x275d('0xb0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x544219[_0x275d('0xc0')],'ListId':_0x544219['ListId'],'VoiceQueueId':_0x544219[_0x275d('0xc3')]||undefined,'CampaignId':_0x544219[_0x275d('0xc4')]||undefined})['catch'](loggerCatch(_0x275d('0x1c2')));_0x5db2c0[_0x275d('0xb8')](createObjHistory(_0x2402cd,_0x544219,_0x275d('0x1c3'),0x17,'RecallInQueue'))[_0x275d('0xa3')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5db2c0[_0x275d('0xbe')](createObjHistory(_0x2402cd,_0x544219,'RECALLFAILEDTIMEOUT',0x16,_0x275d('0x1c4')),_0x275d('0x1c5'),'[Originate][HistoryRecallClose]');}}}}else{_0x2402cd[_0x275d('0x59')]+=0x1;_0x5db2c0['saveInDb'](createObjHistory(_0x2402cd,_0x544219,_0x275d('0x1c6'),0xd,'Blacklist'),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x275d('0x1c7');}};};Dialer[_0x275d('0x17')][_0x275d('0x1c8')]=function(_0x56e010){var _0x162d59=this;var _0x2051d3=[];var _0x495fe5=_0x56e010[_0x275d('0x1c9')]-_0x56e010['originated']-_0x56e010[_0x275d('0x1ca')];emitCampaignSummary(_0x56e010);if(_0x495fe5>0x0){if(_0x495fe5>this[_0x275d('0x20')]){_0x495fe5=this['maxNumberOriginate'];}_0x56e010['temp']+=_0x495fe5;this[_0x275d('0x1cb')](_0x56e010['id'],_0x495fe5,_0x56e010['dialOrderByScheduledAt'])['then'](function(_0x5da1c2){_0x56e010[_0x275d('0x1ca')]-=_0x495fe5;_0x56e010[_0x275d('0x1ca')]=_0x56e010[_0x275d('0x1ca')]>0x0?_0x56e010[_0x275d('0x1ca')]:0x0;if(!checkContactEmpty(_0x5da1c2)){_0x56e010[_0x275d('0x3b')]=_0x275d('0x98');logger[_0x275d('0x76')](_0x275d('0x1cc')+_0x56e010[_0x275d('0x40')]);}else{_0x56e010[_0x275d('0x69')]+=_0x5da1c2[_0x275d('0x93')];_0x56e010[_0x275d('0x3b')]=_0x275d('0x1cd');for(var _0x56bc3d=0x0;_0x56bc3d<_0x5da1c2[_0x275d('0x93')];_0x56bc3d+=0x1){_0x56e010['ivrTotalCallsDays']+=0x1;if(_[_0x275d('0xcd')](_0x5da1c2[_0x56bc3d])||_[_0x275d('0xcd')](_0x5da1c2[_0x56bc3d][_0x275d('0x144')])||_[_0x275d('0xcd')](_0x5da1c2[_0x56bc3d][_0x275d('0x144')]['phone'])){_0x162d59[_0x275d('0xbc')]('[actionOriginate]\x20',_0x56e010,_0x5da1c2[_0x56bc3d]);}else{_0x162d59[_0x275d('0xad')](_[_0x275d('0xbf')](_0x5da1c2[_0x56bc3d],[_0x275d('0xc4'),_0x275d('0x1ce')]))[_0x275d('0xaa')](_0x162d59[_0x275d('0x1bb')](_0x56e010,_0x5da1c2[_0x56bc3d]))[_0x275d('0xa3')](_0x162d59[_0x275d('0xbb')](_0x275d('0x1cf'),_0x56e010));}}}})[_0x275d('0xa3')](loggerGetContactDialer(_0x275d('0x1d0'),_0x56e010,_0x495fe5));}};Dialer[_0x275d('0x17')][_0x275d('0x134')]=function(_0x56aa0a,_0x3a11a1){var _0xf20e53=this;var _0x385605=[];var _0x3c6202=_0x3a11a1>=0x1?_0x3a11a1:0x1;var _0x12094d=[];if(_0x56aa0a['dialMethod']===_0x275d('0x133')){_0x3c6202=0x1;}var _0x41d287=Math[_0x275d('0x19a')](_0x56aa0a[_0x275d('0x4c')]*_0x3c6202)-_0x56aa0a['originated']-_0x56aa0a[_0x275d('0x1ca')];emitVoiceQueueSummary(_0x56aa0a);if(_0x56aa0a[_0x275d('0x1d1')]>0x0){var _0x4a1ec2=_0x56aa0a[_0x275d('0x1d1')]-_0x56aa0a['originated']-_0x56aa0a[_0x275d('0x50')]-_0x56aa0a[_0x275d('0x1ca')]-_0x56aa0a[_0x275d('0x1d2')];if(_0x41d287>_0x4a1ec2){_0x41d287=_0x4a1ec2;}}if(_0x41d287>0x0){if(_0x56aa0a[_0x275d('0x55')]===_0x275d('0x133')){_0x41d287=0x1;}if(_0x41d287>this[_0x275d('0x20')]){_0x41d287=this['maxNumberOriginate'];}_0x56aa0a[_0x275d('0x1ca')]+=_0x41d287;for(var _0x1bca11 in this['agents']){if(this[_0x275d('0x1e')][_0x275d('0x94')](_0x1bca11)){if(this[_0x275d('0x1e')][_0x1bca11]['state']===_0x275d('0x1d3')&&this['agents'][_0x1bca11][_0x275d('0xca')]===_0x275d('0x1d4')){_0x385605[_0x275d('0x102')](this[_0x275d('0x1e')][_0x1bca11]['id']);}}}this[_0x275d('0xb2')](_0x56aa0a['id'],_0x385605,_0x41d287,_0x56aa0a[_0x275d('0x1d5')])['then'](function(_0x133422){_0x56aa0a[_0x275d('0x1ca')]-=_0x41d287;_0x56aa0a[_0x275d('0x1ca')]=_0x56aa0a[_0x275d('0x1ca')]>0x0?_0x56aa0a['temp']:0x0;if(!checkContactEmpty(_0x133422)){_0xf20e53['countReScheduled'](_0x56aa0a)[_0x275d('0xaa')](sendMessageReschedule(_0x56aa0a))['catch'](loggerCatch(_0x275d('0xab')));}else{_0x56aa0a[_0x275d('0x69')]+=_0x133422[_0x275d('0x93')];_0x56aa0a[_0x275d('0x3b')]=_0x56aa0a[_0x275d('0x55')]===_0x275d('0x133')?_0x275d('0x1d6'):'RUNNING';for(var _0x4cd34c=0x0;_0x4cd34c<_0x133422[_0x275d('0x93')];_0x4cd34c+=0x1){if(_[_0x275d('0xcd')](_0x133422[_0x4cd34c])||_['isNil'](_0x133422[_0x4cd34c][_0x275d('0x144')])||_[_0x275d('0xcd')](_0x133422[_0x4cd34c][_0x275d('0x144')][_0x275d('0x145')])){_0xf20e53[_0x275d('0xbc')](_0x275d('0x1d7'),_0x56aa0a,_0x133422[_0x4cd34c]);}else{_0xf20e53[_0x275d('0xac')](_[_0x275d('0xbf')](_0x133422[_0x4cd34c],[_0x275d('0xc3'),_0x275d('0x1ce')]))[_0x275d('0xaa')](_0xf20e53[_0x275d('0x1bb')](_0x56aa0a,_0x133422[_0x4cd34c]))[_0x275d('0xa3')](_0xf20e53[_0x275d('0xbb')](_0x275d('0x1d7'),_0x56aa0a));}}}})[_0x275d('0xa3')](loggerGetContactDialer(_0x275d('0x1d8'),_0x56aa0a,_0x41d287));}};Dialer[_0x275d('0x17')][_0x275d('0x8c')]=function(_0xe84733){var _0x51daea=this;if(_0xe84733[_0x275d('0x1d1')]>0x0){var _0x28f1d8=_0xe84733['dialLimitQueue']-_0xe84733['originated']-_0xe84733[_0x275d('0x50')];if(_0x28f1d8>0x0){this[_0x275d('0x1d9')](_0xe84733);}else{loggerPredictiveCalls['info'](_0x275d('0x1da'));}}else{this['tryOriginatePredictive'](_0xe84733);}};Dialer[_0x275d('0x17')][_0x275d('0x1d9')]=function(_0x1ccf68){var _0x15272e=this;var _0x42fab6=[];_0x1ccf68[_0x275d('0x69')]+=0x1;for(var _0xd5a029 in this[_0x275d('0x1e')]){if(this[_0x275d('0x1e')][_0x275d('0x94')](_0xd5a029)){if(this[_0x275d('0x1e')][_0xd5a029][_0x275d('0xd5')]===_0x275d('0x1d3')&&this[_0x275d('0x1e')][_0xd5a029][_0x275d('0xca')]===_0x275d('0x1d4')){_0x42fab6[_0x275d('0x102')](this[_0x275d('0x1e')][_0xd5a029]['id']);}}}this[_0x275d('0xb2')](_0x1ccf68['id'],_0x42fab6,0x1,_0x1ccf68[_0x275d('0x1d5')])['then'](function(_0x4bb6b8){if(!checkContactEmpty(_0x4bb6b8)){checkContactLowerLimitOriginate(_0x1ccf68,0x1,0x0);_0x15272e[_0x275d('0xa8')](_0x1ccf68)[_0x275d('0xaa')](sendMessageReschedule(_0x1ccf68))[_0x275d('0xa3')](loggerCatch('[countReScheduled]\x20'));}else{_0x1ccf68[_0x275d('0x3b')]=_0x275d('0x1cd');if(_[_0x275d('0xcd')](_0x4bb6b8[0x0])||_[_0x275d('0xcd')](_0x4bb6b8[0x0][_0x275d('0x144')])||_[_0x275d('0xcd')](_0x4bb6b8[0x0][_0x275d('0x144')]['phone'])){_0x15272e[_0x275d('0xbc')]('[actionOriginate]\x20',_0x1ccf68,_0x4bb6b8[0x0]);}else{_0x15272e[_0x275d('0xac')](_[_0x275d('0xbf')](_0x4bb6b8[0x0],['VoiceQueueId',_0x275d('0x1ce')]))['then'](_0x15272e[_0x275d('0x1bb')](_0x1ccf68,_0x4bb6b8[0x0]))[_0x275d('0xa3')](_0x15272e[_0x275d('0xbb')](_0x275d('0x1db'),_0x1ccf68));}}})['catch'](loggerGetContactDialer(_0x275d('0x1dc'),_0x1ccf68,0x1));emitVoiceQueueSummary(_0x1ccf68);};Dialer['prototype']['abandonmentRate']=function(_0x151d5b,_0x23e8b5,_0x1b7703,_0x3f93c6,_0x193e00,_0x65ff48){loggerPredictive['info'](_0x275d('0x1dd'));loggerPredictive[_0x275d('0x76')](_0x275d('0x1de'),_0x151d5b);loggerPredictive[_0x275d('0x76')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23e8b5);loggerPredictive[_0x275d('0x76')]('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',_0x1b7703);loggerPredictive[_0x275d('0x76')]('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',_0x3f93c6);loggerPredictive[_0x275d('0x76')](_0x275d('0x1df'),_0x193e00);loggerPredictive[_0x275d('0x76')](_0x275d('0x7f'));return new BPromise(function(_0x3403d2,_0x2e8d9b){if(_0x151d5b<=0x0||isNaN(_0x151d5b)){return _0x2e8d9b(msgResponse(_0x275d('0x1e0'),_0x275d('0x170'),_0x275d('0x1e1')+_0x151d5b));}if(_0x1b7703<=0x0||isNaN(_0x1b7703)){return _0x2e8d9b(msgResponse(_0x275d('0x1e0'),_0x275d('0x170'),_0x275d('0x1e2')+_0x1b7703));}if(_0x3f93c6<=0x0||isNaN(_0x3f93c6)){return _0x2e8d9b(msgResponse(_0x275d('0x1e0'),_0x275d('0x170'),_0x275d('0x1e3')+_0x3f93c6));}if(_0x23e8b5<=0x0||isNaN(_0x23e8b5)){return _0x2e8d9b(msgResponse(_0x275d('0x1e0'),_0x275d('0x170'),'interval\x20=\x20'+_0x23e8b5));}if(_0x193e00<=0x0||isNaN(_0x193e00)){return _0x2e8d9b(msgResponse(_0x275d('0x1e0'),'Error',_0x275d('0x1e4')+_0x193e00));}_0x65ff48=_0x65ff48||0x0;var _0x2340f0=0x1/_0x1b7703;var _0x1a2336=0x0;var _0x356d84=0x0;var _0x41bb9b=0x0;var _0x1a5279=0x0;for(var _0x2aa094=0x0;_0x41bb9b<_0x193e00;_0x2aa094+=0x1){_0x356d84=_0x2aa094/_0x23e8b5;_0x1a2336=(_0x3f93c6*_0x356d84+_0x65ff48)/_0x2340f0;_0x41bb9b=erlangb(_0x1a2336,_0x151d5b);_0x1a5279=_0x1a2336/_0x151d5b*(0x1-erlangb(_0x1a2336,_0x151d5b));}return _0x3403d2({'erlangCalls':_0x2aa094,'erlangCallToSecond':_0x23e8b5/_0x2aa094,'erlangAbandonmentRate':_0x41bb9b,'erlangBusyFactor':_0x1a5279});});};Dialer[_0x275d('0x17')][_0x275d('0x1b2')]=function(_0x482b7b,_0xdaeacf,_0x4ab427,_0x51aeed,_0x2e9beb,_0x370ad4){loggerPredictive[_0x275d('0x76')](_0x275d('0x1e5'));loggerPredictive['info']('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',_0x482b7b);loggerPredictive['info'](_0x275d('0x1e6'),_0xdaeacf);loggerPredictive[_0x275d('0x76')]('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',_0x4ab427);loggerPredictive['info'](_0x275d('0x1e7'),_0x51aeed);loggerPredictive[_0x275d('0x76')](_0x275d('0x1e8'),_0x2e9beb);loggerPredictive[_0x275d('0x76')](_0x275d('0x7f'));return new BPromise(function(_0x3b0647,_0x103bfe){if(_0x482b7b<=0x0||isNaN(_0x482b7b)){return _0x103bfe(msgResponse(_0x275d('0x1e9'),_0x275d('0x170'),'m\x20=\x20'+_0x482b7b));}if(_0x4ab427<=0x0||isNaN(_0x4ab427)){return _0x103bfe(msgResponse(_0x275d('0x1e9'),'Error',_0x275d('0x1e2')+_0x4ab427));}if(_0x51aeed<=0x0||isNaN(_0x51aeed)){return _0x103bfe(msgResponse(_0x275d('0x1e9'),'Error',_0x275d('0x1e3')+_0x51aeed));}if(_0xdaeacf<=0x0||isNaN(_0xdaeacf)){return _0x103bfe(msgResponse(_0x275d('0x1e9'),_0x275d('0x170'),_0x275d('0x1ea')+_0xdaeacf));}if(_0x2e9beb<=0x0||isNaN(_0x2e9beb)){return _0x103bfe(msgResponse(_0x275d('0x1e9'),'Error',_0x275d('0x1eb')+_0x2e9beb));}_0x370ad4=_0x370ad4||0x0;var _0x2c94d4=0x1/_0x4ab427;var _0xc0d849=0x0;var _0x1208e2=0x0;var _0x3675a1=0x0;var _0x3f1e5f=0x0;for(var _0x312ce4=0x0;_0x3f1e5f<_0x2e9beb;_0x312ce4+=0x1){_0x1208e2=_0x312ce4/_0xdaeacf;_0xc0d849=(_0x51aeed*_0x1208e2+_0x370ad4)/_0x2c94d4;_0x3675a1=erlangb(_0xc0d849,_0x482b7b);_0x3f1e5f=_0xc0d849/_0x482b7b*(0x1-erlangb(_0xc0d849,_0x482b7b));}return _0x3b0647({'erlangCalls':_0x312ce4,'erlangCallToSecond':_0xdaeacf/_0x312ce4,'erlangAbandonmentRate':_0x3675a1,'erlangBusyFactor':_0x3f1e5f});});};module[_0x275d('0x1ec')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index df346a8..a4e8821 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 _0x7cfa=['membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','calleridnum','responsetime','droptime','starttime','holdtime','talktime'];(function(_0x140fd6,_0x5d8037){var _0x16a6ad=function(_0x5adbf7){while(--_0x5adbf7){_0x140fd6['push'](_0x140fd6['shift']());}};_0x16a6ad(++_0x5d8037);}(_0x7cfa,0x137));var _0xa7cf=function(_0x243ef5,_0x3a9746){_0x243ef5=_0x243ef5-0x0;var _0x2ead71=_0x7cfa[_0x243ef5];return _0x2ead71;};'use strict';var util=require(_0xa7cf('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0xd35f8,_0x1b4d3e){var _0x27b7d2=moment(_0xd35f8)[_0xa7cf('0x1')](0x0);var _0x541b45=moment(_0x1b4d3e)[_0xa7cf('0x1')](0x0);return _0x27b7d2['diff'](_0x541b45,_0xa7cf('0x2'));}function QueueCallerAbandon(_0x1c38cc,_0x7e0d37){this[_0xa7cf('0x3')]=_0x1c38cc[_0xa7cf('0x3')];this[_0xa7cf('0x4')]=_0x1c38cc[_0xa7cf('0x4')];this[_0xa7cf('0x5')]=_0x1c38cc[_0xa7cf('0x4')]===_0xa7cf('0x6')?_0xa7cf('0x7'):_0x1c38cc['type'];this[_0xa7cf('0x8')]=_0x1c38cc[_0xa7cf('0x8')];this['countcongestionretry']=_0x1c38cc[_0xa7cf('0x9')];this[_0xa7cf('0xa')]=_0x1c38cc[_0xa7cf('0xa')];this['countglobal']=_0x1c38cc['countbusyretry']+_0x1c38cc[_0xa7cf('0x9')]+_0x1c38cc[_0xa7cf('0xa')];this[_0xa7cf('0xb')]=_0x7e0d37['uniqueid'];this[_0xa7cf('0xc')]=_0x1c38cc['name'];this[_0xa7cf('0xd')]=_0x1c38cc['number'];this['starttime']=_0x1c38cc['starttime'];this['responsetime']=_0x1c38cc[_0xa7cf('0xe')];this['droptime']=_0x1c38cc['droptime'];this['endtime']=this[_0xa7cf('0xf')];this['ringtime']=getSeconds(_0x1c38cc['responsetime'],_0x1c38cc[_0xa7cf('0x10')]);this[_0xa7cf('0x11')]=getSeconds(this[_0xa7cf('0xf')],_0x1c38cc[_0xa7cf('0xe')]);this[_0xa7cf('0x12')]=0x0;this['queue']=_0x7e0d37['queue'];this[_0xa7cf('0x13')]=_0x7e0d37['connectedlinename'];this[_0xa7cf('0x14')]=_0x7e0d37[_0xa7cf('0x14')];this[_0xa7cf('0x15')]=_0x1c38cc[_0xa7cf('0x15')];this[_0xa7cf('0x16')]=_0x1c38cc[_0xa7cf('0x16')];this[_0xa7cf('0x17')]=_0x1c38cc[_0xa7cf('0x17')];this[_0xa7cf('0x18')]=_0x1c38cc[_0xa7cf('0x18')];this[_0xa7cf('0x19')]=_0x1c38cc[_0xa7cf('0x19')];this[_0xa7cf('0x1a')]=_0x1c38cc['ListId'];this[_0xa7cf('0x1b')]=_0x1c38cc[_0xa7cf('0x1b')];this[_0xa7cf('0x1c')]=_0x1c38cc[_0xa7cf('0x1c')];this[_0xa7cf('0x1d')]=_0x1c38cc[_0xa7cf('0x1d')];this['originatecalleridnum']=_0x1c38cc[_0xa7cf('0x1e')]||'';this[_0xa7cf('0x1f')]=_0x1c38cc[_0xa7cf('0x1f')]||'';}module[_0xa7cf('0x20')]=QueueCallerAbandon; \ No newline at end of file +var _0xef0d=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x54203e,_0x1db8db){var _0xe307cf=function(_0x933016){while(--_0x933016){_0x54203e['push'](_0x54203e['shift']());}};_0xe307cf(++_0x1db8db);}(_0xef0d,0xdc));var _0xdef0=function(_0x276603,_0x3e9a0e){_0x276603=_0x276603-0x0;var _0x54bf7a=_0xef0d[_0x276603];return _0x54bf7a;};'use strict';var util=require(_0xdef0('0x0'));var _=require('lodash');var moment=require(_0xdef0('0x1'));function getSeconds(_0x25e59e,_0x360189){var _0xa5ee85=moment(_0x25e59e)[_0xdef0('0x2')](0x0);var _0x135749=moment(_0x360189)[_0xdef0('0x2')](0x0);return _0xa5ee85[_0xdef0('0x3')](_0x135749,_0xdef0('0x4'));}function QueueCallerAbandon(_0x53bfb8,_0x2d4aca){this[_0xdef0('0x5')]=_0x53bfb8[_0xdef0('0x5')];this[_0xdef0('0x6')]=_0x53bfb8[_0xdef0('0x6')];this[_0xdef0('0x7')]=_0x53bfb8[_0xdef0('0x6')]===_0xdef0('0x8')?'queue':_0x53bfb8[_0xdef0('0x6')];this[_0xdef0('0x9')]=_0x53bfb8[_0xdef0('0x9')];this[_0xdef0('0xa')]=_0x53bfb8[_0xdef0('0xa')];this[_0xdef0('0xb')]=_0x53bfb8['countnoanswerretry'];this[_0xdef0('0xc')]=_0x53bfb8[_0xdef0('0x9')]+_0x53bfb8['countcongestionretry']+_0x53bfb8[_0xdef0('0xb')];this[_0xdef0('0xd')]=_0x2d4aca[_0xdef0('0xd')];this['calleridname']=_0x53bfb8[_0xdef0('0xe')];this[_0xdef0('0xf')]=_0x53bfb8[_0xdef0('0x10')];this[_0xdef0('0x11')]=_0x53bfb8[_0xdef0('0x11')];this[_0xdef0('0x12')]=_0x53bfb8[_0xdef0('0x12')];this['droptime']=_0x53bfb8[_0xdef0('0x13')];this[_0xdef0('0x14')]=this[_0xdef0('0x13')];this[_0xdef0('0x15')]=getSeconds(_0x53bfb8[_0xdef0('0x12')],_0x53bfb8['starttime']);this['holdtime']=getSeconds(this[_0xdef0('0x13')],_0x53bfb8['responsetime']);this[_0xdef0('0x16')]=0x0;this[_0xdef0('0x17')]=_0x2d4aca[_0xdef0('0x17')];this[_0xdef0('0x18')]=_0x2d4aca['connectedlinename'];this[_0xdef0('0x19')]=_0x2d4aca['reason'];this['callback']=_0x53bfb8[_0xdef0('0x1a')];this[_0xdef0('0x1b')]=_0x53bfb8[_0xdef0('0x1b')];this[_0xdef0('0x1c')]=_0x53bfb8['callbackat'];this['recallme']=_0x53bfb8[_0xdef0('0x1d')];this[_0xdef0('0x1e')]=_0x53bfb8[_0xdef0('0x1e')];this[_0xdef0('0x1f')]=_0x53bfb8[_0xdef0('0x1f')];this['UserId']=_0x53bfb8['UserId'];this[_0xdef0('0x20')]=_0x53bfb8[_0xdef0('0x20')];this[_0xdef0('0x21')]=_0x53bfb8['CampaignId'];this[_0xdef0('0x22')]=_0x53bfb8['originatecalleridnum']||'';this[_0xdef0('0x23')]=_0x53bfb8[_0xdef0('0x23')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 46eeef8..d41cf0c 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 _0x1e5c=['lodash','moment','format','%s/%s/%s','tech','Trunk','localstationid','headerinfo','path','AttachmentId','exports','util'];(function(_0x169639,_0x146136){var _0x277351=function(_0x5e8e2a){while(--_0x5e8e2a){_0x169639['push'](_0x169639['shift']());}};_0x277351(++_0x146136);}(_0x1e5c,0x14f));var _0xc1e5=function(_0x34ed91,_0x535cf2){_0x34ed91=_0x34ed91-0x0;var _0x300842=_0x1e5c[_0x34ed91];return _0x300842;};'use strict';var util=require(_0xc1e5('0x0'));var _=require(_0xc1e5('0x1'));var moment=require(_0xc1e5('0x2'));function Action(_0x33f1ff,_0x101d38,_0x15b243){this['uniqueid']=_0x33f1ff||undefined;this['channel']=util[_0xc1e5('0x3')](_0xc1e5('0x4'),_0x101d38[_0xc1e5('0x5')],_0x101d38[_0xc1e5('0x6')]['name'],_0x15b243['fax']);this[_0xc1e5('0x7')]=_0x101d38[_0xc1e5('0x7')];this[_0xc1e5('0x8')]=_0x101d38[_0xc1e5('0x8')];this[_0xc1e5('0x9')]=_0x15b243[_0xc1e5('0x9')];this['AttachmentId']=_0x15b243[_0xc1e5('0xa')];}module[_0xc1e5('0xb')]=Action; \ No newline at end of file +var _0x5c3d=['AttachmentId','exports','util','lodash','moment','uniqueid','format','%s/%s/%s','tech','name','localstationid','headerinfo','path'];(function(_0x2e58fc,_0x2eab93){var _0x420edd=function(_0x14c785){while(--_0x14c785){_0x2e58fc['push'](_0x2e58fc['shift']());}};_0x420edd(++_0x2eab93);}(_0x5c3d,0x84));var _0xd5c3=function(_0x440b4a,_0x1f3651){_0x440b4a=_0x440b4a-0x0;var _0x22403d=_0x5c3d[_0x440b4a];return _0x22403d;};'use strict';var util=require(_0xd5c3('0x0'));var _=require(_0xd5c3('0x1'));var moment=require(_0xd5c3('0x2'));function Action(_0x2cd608,_0x2a4427,_0x22aca0){this[_0xd5c3('0x3')]=_0x2cd608||undefined;this['channel']=util[_0xd5c3('0x4')](_0xd5c3('0x5'),_0x2a4427[_0xd5c3('0x6')],_0x2a4427['Trunk'][_0xd5c3('0x7')],_0x22aca0['fax']);this[_0xd5c3('0x8')]=_0x2a4427[_0xd5c3('0x8')];this[_0xd5c3('0x9')]=_0x2a4427[_0xd5c3('0x9')];this[_0xd5c3('0xa')]=_0x22aca0[_0xd5c3('0xa')];this[_0xd5c3('0xb')]=_0x22aca0[_0xd5c3('0xb')];}module[_0xd5c3('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 96848f5..63aba1a 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 _0x7d69=['[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncVarSet','bind','newstate','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncNewchannel','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax'];(function(_0x52767a,_0xfc62b6){var _0x51c68e=function(_0x421698){while(--_0x421698){_0x52767a['push'](_0x52767a['shift']());}};_0x51c68e(++_0xfc62b6);}(_0x7d69,0x159));var _0x97d6=function(_0xd4f83b,_0xe33d81){_0xd4f83b=_0xd4f83b-0x0;var _0x4ec559=_0x7d69[_0xd4f83b];return _0x4ec559;};'use strict';var util=require(_0x97d6('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x97d6('0x1'));var moment=require(_0x97d6('0x2'));var path=require(_0x97d6('0x3'));var tiff2pdf=require(_0x97d6('0x4'));var gs=require(_0x97d6('0x5'));var logger=require(_0x97d6('0x6'))(_0x97d6('0x7'));var ami=require(_0x97d6('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0x97d6('0x9'));var ut=require(_0x97d6('0xa'));var Action=require(_0x97d6('0xb'));var faxAccount=require(_0x97d6('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x97d6('0xd'));function Fax(_0x3ca31f){this['channels']={};this[_0x97d6('0xe')]=_0x3ca31f[_0x97d6('0xe')];this[_0x97d6('0xf')]=_0x3ca31f[_0x97d6('0xf')];this[_0x97d6('0x10')]={};ami['on'](_0x97d6('0x11'),this['syncNewchannel']['bind'](this));ami['on']('varset',this[_0x97d6('0x12')][_0x97d6('0x13')](this));ami['on'](_0x97d6('0x14'),this['syncNewState'][_0x97d6('0x13')](this));ami['on'](_0x97d6('0x15'),this[_0x97d6('0x16')]['bind'](this));ami['on']('faxstatus',this[_0x97d6('0x17')]['bind'](this));ami['on'](_0x97d6('0x18'),this[_0x97d6('0x19')][_0x97d6('0x13')](this));ami['on'](_0x97d6('0x1a'),this[_0x97d6('0x1b')][_0x97d6('0x13')](this));ami['on'](_0x97d6('0x1c'),this['syncOriginateResponse'][_0x97d6('0x13')](this));}Fax['prototype'][_0x97d6('0x1d')]=function(_0x7ce83f){if(_0x7ce83f['context']==='from-voip-provider'){for(var _0x5a0077 in this[_0x97d6('0xe')]){if(this['faxAccounts'][_0x97d6('0x1e')](_0x5a0077)){if(_0x7ce83f[_0x97d6('0x1f')]===this[_0x97d6('0xe')][_0x5a0077][_0x97d6('0x20')]){this[_0x97d6('0x21')][_0x7ce83f['uniqueid']]={};this[_0x97d6('0x21')][_0x7ce83f[_0x97d6('0x22')]]['channel']=_0x7ce83f[_0x97d6('0x23')];this[_0x97d6('0x21')][_0x7ce83f[_0x97d6('0x22')]]['id']=this[_0x97d6('0xe')][_0x5a0077]['id'];this['channels'][_0x7ce83f[_0x97d6('0x22')]][_0x97d6('0x24')]=this['faxAccounts'][_0x5a0077][_0x97d6('0x24')];logger['info'](_0x7ce83f[_0x97d6('0x22')],_0x97d6('0x25'));}}}}if(this['actions'][_0x7ce83f[_0x97d6('0x22')]]){this[_0x97d6('0x21')][_0x7ce83f[_0x97d6('0x22')]]={};this['channels'][_0x7ce83f[_0x97d6('0x22')]][_0x97d6('0x23')]=_0x7ce83f[_0x97d6('0x23')];logger[_0x97d6('0x26')](_0x7ce83f['uniqueid'],_0x97d6('0x25'));}};Fax[_0x97d6('0x27')][_0x97d6('0x12')]=function(_0xbc9d45){if(this[_0x97d6('0x21')][_0xbc9d45['uniqueid']]){for(var _0x5eb3ab in _0xbc9d45[_0x97d6('0x28')]){if(_0xbc9d45[_0x97d6('0x28')][_0x97d6('0x1e')](_0x5eb3ab)){this['channels'][_0xbc9d45[_0x97d6('0x22')]][_0x5eb3ab]=_0xbc9d45[_0x97d6('0x29')];}}}};Fax[_0x97d6('0x27')][_0x97d6('0x2a')]=function(_0x3cb92d){if(this[_0x97d6('0x21')][_0x3cb92d[_0x97d6('0x22')]]){this[_0x97d6('0x21')][_0x3cb92d['uniqueid']][_0x97d6('0x2b')]=_0x3cb92d[_0x97d6('0x2b')];this[_0x97d6('0x21')][_0x3cb92d[_0x97d6('0x22')]]['channelstatedesc']=_0x3cb92d[_0x97d6('0x2c')];}};Fax[_0x97d6('0x27')][_0x97d6('0x16')]=function(_0x1cbfe8){if(this[_0x97d6('0x21')][_0x1cbfe8[_0x97d6('0x22')]]){for(var _0x14ba49 in _0x1cbfe8[_0x97d6('0x28')]){if(_0x1cbfe8[_0x97d6('0x28')][_0x97d6('0x1e')](_0x14ba49)){this[_0x97d6('0x21')][_0x1cbfe8[_0x97d6('0x22')]][_0x14ba49]=_0x1cbfe8[_0x97d6('0x29')];}}}};Fax[_0x97d6('0x27')]['syncFaxStatus']=function(_0x6996d){if(this['channels'][_0x6996d[_0x97d6('0x22')]]){this[_0x97d6('0x21')][_0x6996d[_0x97d6('0x22')]]['operation']=_0x6996d[_0x97d6('0x2d')];this[_0x97d6('0x21')][_0x6996d['uniqueid']][_0x97d6('0x2e')]=_0x6996d[_0x97d6('0x2e')];this[_0x97d6('0x21')][_0x6996d[_0x97d6('0x22')]][_0x97d6('0x20')]=_0x6996d[_0x97d6('0x20')];this[_0x97d6('0x21')][_0x6996d['uniqueid']][_0x97d6('0x2f')]=_0x6996d[_0x97d6('0x2f')];logger['info'](_0x6996d[_0x97d6('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0x97d6('0x27')][_0x97d6('0x19')]=function(_0x2d3d9f){var _0x54ee2e=this;if(this[_0x97d6('0x21')][_0x2d3d9f[_0x97d6('0x22')]]){var _0x2c8a4e=this['channels'][_0x2d3d9f[_0x97d6('0x22')]]['id'];this[_0x97d6('0x21')][_0x2d3d9f[_0x97d6('0x22')]][_0x97d6('0x30')]=_0x2d3d9f[_0x97d6('0x30')];this['channels'][_0x2d3d9f['uniqueid']][_0x97d6('0x31')]=_0x2d3d9f[_0x97d6('0x31')];this[_0x97d6('0x21')][_0x2d3d9f[_0x97d6('0x22')]]['localstationid']=_0x2d3d9f[_0x97d6('0x20')];this['channels'][_0x2d3d9f[_0x97d6('0x22')]][_0x97d6('0x32')]=_0x2d3d9f[_0x97d6('0x32')];this[_0x97d6('0x21')][_0x2d3d9f[_0x97d6('0x22')]][_0x97d6('0x33')]=_0x2d3d9f[_0x97d6('0x33')];this['channels'][_0x2d3d9f[_0x97d6('0x22')]][_0x97d6('0x2f')]=_0x2d3d9f[_0x97d6('0x2f')];this[_0x97d6('0x21')][_0x2d3d9f['uniqueid']][_0x97d6('0x34')]=_0x2d3d9f['calleridnum'];if(this[_0x97d6('0x21')][_0x2d3d9f[_0x97d6('0x22')]][_0x97d6('0x31')]>0x0){tiff2pdf(_0x2d3d9f[_0x97d6('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x2cb772){logger[_0x97d6('0x26')](_0x2d3d9f[_0x97d6('0x22')],_0x97d6('0x35'),_0x2cb772[_0x97d6('0x36')]);attachment[_0x97d6('0x37')]({'name':path[_0x97d6('0x38')](_0x2d3d9f[_0x97d6('0x2f')])[_0x97d6('0x24')],'basename':path[_0x97d6('0x38')](_0x2d3d9f['filename'])[_0x97d6('0x24')]+_0x97d6('0x39'),'type':_0x97d6('0x3a')})[_0x97d6('0x3b')](function(_0x2b83a9){faxAccount['notify'](_0x2c8a4e,{'from':_0x2d3d9f['calleridnum'],'mapKey':_0x97d6('0x7'),'body':path[_0x97d6('0x38')](_0x2d3d9f[_0x97d6('0x2f')])[_0x97d6('0x24')]+_0x97d6('0x39'),'AttachmentId':_0x2b83a9['id']})[_0x97d6('0x3c')](function(_0x13c00c){logger[_0x97d6('0x3d')](_0x2d3d9f[_0x97d6('0x22')],'\x20notify\x20',JSON[_0x97d6('0x3e')](_0x13c00c));});})[_0x97d6('0x3c')](function(_0x2a0bea){logger[_0x97d6('0x3d')](_0x2d3d9f['uniqueid'],_0x97d6('0x3f'),JSON[_0x97d6('0x3e')](_0x2a0bea));});});}logger['info'](_0x2d3d9f[_0x97d6('0x22')],_0x97d6('0x3f'));}};Fax[_0x97d6('0x27')]['syncOriginateResponse']=function(_0x101ed4){if(this[_0x97d6('0x10')][_0x101ed4[_0x97d6('0x22')]]){_[_0x97d6('0x40')](this['channels'][_0x101ed4[_0x97d6('0x22')]],_[_0x97d6('0x41')](_0x101ed4,[_0x97d6('0x42'),_0x97d6('0x43')]));}};function updateStatus(_0x62b874){if(_0x62b874[_0x97d6('0x44')]){faxMessage[_0x97d6('0x45')](_0x62b874[_0x97d6('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x97d6('0x3b')](function(_0x174352){ut[_0x97d6('0x46')]('[Fax][Message][Error][Updated]',_0x174352);})['catch'](function(_0x287f56){ut[_0x97d6('0x46')]('[Fax][Message][Error][NoUpdate1]',_0x287f56);});}else{ut[_0x97d6('0x46')](_0x97d6('0x47'));}}Fax[_0x97d6('0x27')]['updateStatus']=function(_0x183655,_0x4288a9,_0x26e963){var _0xdfcf3b=this;var _0x4a0367={};if(_0x4288a9){_0x4a0367={'read':_0x4288a9};}else{_0x4a0367={'failMessage':_0x26e963};}if(this[_0x97d6('0x10')][_0x183655]['AttachmentId']){faxMessage['update'](this[_0x97d6('0x10')][_0x183655][_0x97d6('0x44')],_0x4a0367)[_0x97d6('0x3b')](function(_0x55540b){ut[_0x97d6('0x46')](_0x97d6('0x48'),_0x55540b);})['catch'](function(_0x2615f5){ut[_0x97d6('0x46')](_0x97d6('0x49'),_0x2615f5);})[_0x97d6('0x4a')](function(){delete _0xdfcf3b[_0x97d6('0x21')][_0x183655];delete _0xdfcf3b[_0x97d6('0x10')][_0x183655];});}else{ut[_0x97d6('0x46')](_0x97d6('0x4b'));delete this[_0x97d6('0x21')][_0x183655];delete this[_0x97d6('0x10')][_0x183655];}};Fax[_0x97d6('0x27')][_0x97d6('0x1b')]=function(_0x4382f1){var _0x33038d=this;if(this[_0x97d6('0x21')][_0x4382f1[_0x97d6('0x22')]]){if(this[_0x97d6('0x10')][_0x4382f1[_0x97d6('0x22')]]){this['channels'][_0x4382f1[_0x97d6('0x22')]]['id']=this['actions'][_0x4382f1[_0x97d6('0x22')]]['id'];this[_0x97d6('0x21')][_0x4382f1[_0x97d6('0x22')]][_0x97d6('0x24')]=this[_0x97d6('0x10')][_0x4382f1[_0x97d6('0x22')]]['name'];}logger['info'](_0x4382f1[_0x97d6('0x22')],this[_0x97d6('0x10')][_0x4382f1[_0x97d6('0x22')]]?'\x20hangup\x20sendFile\x20':_0x97d6('0x4c'),JSON[_0x97d6('0x3e')](this[_0x97d6('0x21')][_0x4382f1['uniqueid']]));if(this[_0x97d6('0x10')][_0x4382f1[_0x97d6('0x22')]]){if(this['channels'][_0x4382f1[_0x97d6('0x22')]][_0x97d6('0x4d')]>0x0&&this[_0x97d6('0x21')][_0x4382f1[_0x97d6('0x22')]][_0x97d6('0x4e')]===_0x97d6('0x4f')){this[_0x97d6('0x50')](_0x4382f1[_0x97d6('0x22')],!![]);}else{this[_0x97d6('0x50')](_0x4382f1[_0x97d6('0x22')],![],this[_0x97d6('0x21')][_0x4382f1[_0x97d6('0x22')]][_0x97d6('0x51')]?_0x97d6('0x52')+this[_0x97d6('0x21')][_0x4382f1['uniqueid']]['faxstatusstring']:_0x97d6('0x53'));}}}};Fax['prototype'][_0x97d6('0x54')]=function(_0x56e018){var _0x480a6a=this;return new BPromise(function(_0x561c47,_0xec5ad9){_0x480a6a['execOriginate'](_0x56e018,_0x480a6a[_0x97d6('0xe')][_0x56e018[_0x97d6('0x55')]])[_0x97d6('0x3b')](function(_0x6282c6){ut[_0x97d6('0x46')](_0x97d6('0x56'),_0x6282c6);_0x561c47(ut[_0x97d6('0x36')]('Fax\x20received'));})[_0x97d6('0x3c')](function(_0x211884){ut[_0x97d6('0x46')](_0x97d6('0x57'),_0x211884);updateStatus(_0x56e018);_0xec5ad9(ut[_0x97d6('0x36')](_0x97d6('0x58')));});});};Fax[_0x97d6('0x27')][_0x97d6('0x59')]=function(_0x4aebfb){var _0x3fa7ec=this;return new BPromise(function(_0x1ac0c6,_0x2314c3){var _0x2e50ca=_0x3fa7ec[_0x97d6('0x5a')](_0x3fa7ec['faxAccounts'][_0x4aebfb[_0x97d6('0x55')]][_0x97d6('0x5b')],_0x4aebfb);if(_0x2e50ca['isValid']){_0x1ac0c6(ut[_0x97d6('0x36')](_0x97d6('0x5c')));}else{_0x2314c3(ut[_0x97d6('0x36')](_0x2e50ca[_0x97d6('0x36')]));}});};function originate(_0xb8e0a4,_0x57df79,_0x2d7d41){return new BPromise(function(_0x3caf95,_0x2aadee){if(_0x2d7d41){var _0x18fe85=util[_0x97d6('0x5d')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x97d6('0x38')](_0xb8e0a4[_0x97d6('0x3')])['name'],_0xb8e0a4[_0x97d6('0x3')]);gs[_0x97d6('0x5e')](_0x18fe85)['then'](function(){_0xb8e0a4['path']=util[_0x97d6('0x5d')](_0x97d6('0x5f'),path[_0x97d6('0x38')](_0xb8e0a4[_0x97d6('0x3')])['dir'],path['parse'](_0xb8e0a4[_0x97d6('0x3')])['name']);_0x57df79[_0x97d6('0x60')]=_0xb8e0a4[_0x97d6('0x3')];ut['logger'](_0x97d6('0x61'),'');ami[_0x97d6('0x62')](ut[_0x97d6('0x63')](_0xb8e0a4,_0x57df79))[_0x97d6('0x3b')](function(_0x496576){_0x3caf95(_0x496576);})[_0x97d6('0x3c')](function(_0x3ed411){_0x2aadee(_0x3ed411);});})[_0x97d6('0x3c')](function(_0x5295a3){_0x2aadee(_0x5295a3);});}else{ami['Action'](ut[_0x97d6('0x63')](_0xb8e0a4,_0x57df79))[_0x97d6('0x3b')](function(_0x21db3b){_0x3caf95(_0x21db3b);})[_0x97d6('0x3c')](function(_0x4e5e91){_0x2aadee(_0x4e5e91);});}});}Fax[_0x97d6('0x27')]['execOriginate']=function(_0x32fb3a,_0xc2a7d2){var _0xb7c2d6=this;return new BPromise(function(_0x255d46,_0x57bc64){var _0x525c5e=uuid['v4']();var _0x311fe4=ut[_0x97d6('0x64')](_0x32fb3a,_0xc2a7d2);_0xb7c2d6[_0x97d6('0x10')][_0x525c5e]=new Action(_0x525c5e,_0xc2a7d2,_0x32fb3a);var _0x993d31=_0xb7c2d6[_0x97d6('0x10')][_0x525c5e];if(path[_0x97d6('0x38')](_0x32fb3a['path'])[_0x97d6('0x65')]==='.pdf'){originate(_0x993d31,_0x311fe4,!![])['then'](function(_0x235c16){_0x255d46(_0x235c16);})['catch'](function(_0x26ee87){_0x57bc64(_0x26ee87);});}else{originate(_0x993d31,_0x311fe4,![])[_0x97d6('0x3b')](function(_0x252fd9){_0x255d46(_0x252fd9);})['catch'](function(_0x37a3b0){_0x57bc64(_0x37a3b0);});}});};Fax[_0x97d6('0x27')]['isTrunkReachable']=function(_0x3c5e88){return!_[_0x97d6('0x66')](_0x3c5e88)&&!_[_0x97d6('0x66')](_0x3c5e88['name'])&&!_[_0x97d6('0x66')](_0x3c5e88[_0x97d6('0x67')])&&_0x3c5e88[_0x97d6('0x67')]&&!_[_0x97d6('0x66')](this[_0x97d6('0xf')][util['format']('SIP/%s',_0x3c5e88[_0x97d6('0x24')])])&&!_['isNil'](this['trunks'][util[_0x97d6('0x5d')](_0x97d6('0x68'),_0x3c5e88['name'])][_0x97d6('0x2e')])&&(this[_0x97d6('0xf')][util[_0x97d6('0x5d')](_0x97d6('0x68'),_0x3c5e88['name'])][_0x97d6('0x2e')]===_0x97d6('0x69')||this[_0x97d6('0xf')][util[_0x97d6('0x5d')](_0x97d6('0x68'),_0x3c5e88['name'])][_0x97d6('0x2e')]===_0x97d6('0x6a'));};Fax['prototype'][_0x97d6('0x5a')]=function(_0x54dbe1,_0x26a128){if(!this['isTrunkReachable'](_0x54dbe1)){ut[_0x97d6('0x46')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x97d6('0x66')](_0x54dbe1)?'':_0x54dbe1[_0x97d6('0x24')]+_0x97d6('0x6b'));return{'isValid':![],'message':_0x97d6('0x6c')};}if(_[_0x97d6('0x66')](_0x26a128['fax'])){ut['logger'](_0x97d6('0x6d'),JSON[_0x97d6('0x3e')](_0x26a128));return{'isValid':![],'message':_0x97d6('0x6e')};}if(_[_0x97d6('0x66')](_0x26a128[_0x97d6('0x3')])){ut[_0x97d6('0x46')](_0x97d6('0x6f'),JSON[_0x97d6('0x3e')](_0x26a128));return{'isValid':![],'message':_0x97d6('0x70')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x97d6('0x71')]=Fax; \ No newline at end of file +var _0xbc7b=['trunks','newchannel','syncNewchannel','bind','varset','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','syncVarSet','variable','value','syncNewState','channelstate','channelstatedesc','operation','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','message','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','\x20receiveFax\x20','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','SUCCESS','faxstatusstring','SENDING\x20FAILED','execOriginate','then','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','format','path','execute','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','status','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Is\x20Valid','exports','util','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts'];(function(_0x2364d8,_0x370c89){var _0x1b85a2=function(_0x1d5c53){while(--_0x1d5c53){_0x2364d8['push'](_0x2364d8['shift']());}};_0x1b85a2(++_0x370c89);}(_0xbc7b,0x142));var _0xbbc7=function(_0x2b7548,_0x1df408){_0x2b7548=_0x2b7548-0x0;var _0x5653ea=_0xbc7b[_0x2b7548];return _0x5653ea;};'use strict';var util=require(_0xbbc7('0x0'));var _=require('lodash');var BPromise=require(_0xbbc7('0x1'));var uuid=require(_0xbbc7('0x2'));var moment=require(_0xbbc7('0x3'));var path=require('path');var tiff2pdf=require(_0xbbc7('0x4'));var gs=require(_0xbbc7('0x5'));var logger=require(_0xbbc7('0x6'))(_0xbbc7('0x7'));var ami=require(_0xbbc7('0x8'));var rpcDb=require(_0xbbc7('0x9'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xbbc7('0xa'));var faxAccount=require(_0xbbc7('0xb'));var attachment=require(_0xbbc7('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x524c4c){this['channels']={};this[_0xbbc7('0xd')]=_0x524c4c['faxAccounts'];this[_0xbbc7('0xe')]=_0x524c4c[_0xbbc7('0xe')];this['actions']={};ami['on'](_0xbbc7('0xf'),this[_0xbbc7('0x10')][_0xbbc7('0x11')](this));ami['on'](_0xbbc7('0x12'),this['syncVarSet'][_0xbbc7('0x11')](this));ami['on'](_0xbbc7('0x13'),this['syncNewState'][_0xbbc7('0x11')](this));ami['on']('newexten',this[_0xbbc7('0x14')][_0xbbc7('0x11')](this));ami['on'](_0xbbc7('0x15'),this[_0xbbc7('0x16')][_0xbbc7('0x11')](this));ami['on'](_0xbbc7('0x17'),this[_0xbbc7('0x18')][_0xbbc7('0x11')](this));ami['on'](_0xbbc7('0x19'),this[_0xbbc7('0x1a')]['bind'](this));ami['on'](_0xbbc7('0x1b'),this[_0xbbc7('0x1c')][_0xbbc7('0x11')](this));}Fax[_0xbbc7('0x1d')][_0xbbc7('0x10')]=function(_0x1e3f52){if(_0x1e3f52[_0xbbc7('0x1e')]===_0xbbc7('0x1f')){for(var _0x598d12 in this[_0xbbc7('0xd')]){if(this['faxAccounts'][_0xbbc7('0x20')](_0x598d12)){if(_0x1e3f52[_0xbbc7('0x21')]===this[_0xbbc7('0xd')][_0x598d12][_0xbbc7('0x22')]){this[_0xbbc7('0x23')][_0x1e3f52[_0xbbc7('0x24')]]={};this[_0xbbc7('0x23')][_0x1e3f52[_0xbbc7('0x24')]][_0xbbc7('0x25')]=_0x1e3f52[_0xbbc7('0x25')];this[_0xbbc7('0x23')][_0x1e3f52[_0xbbc7('0x24')]]['id']=this['faxAccounts'][_0x598d12]['id'];this['channels'][_0x1e3f52['uniqueid']][_0xbbc7('0x26')]=this[_0xbbc7('0xd')][_0x598d12][_0xbbc7('0x26')];logger[_0xbbc7('0x27')](_0x1e3f52[_0xbbc7('0x24')],'\x20syncNewchannel\x20');}}}}if(this[_0xbbc7('0x28')][_0x1e3f52['uniqueid']]){this[_0xbbc7('0x23')][_0x1e3f52[_0xbbc7('0x24')]]={};this[_0xbbc7('0x23')][_0x1e3f52[_0xbbc7('0x24')]][_0xbbc7('0x25')]=_0x1e3f52[_0xbbc7('0x25')];logger[_0xbbc7('0x27')](_0x1e3f52['uniqueid'],_0xbbc7('0x29'));}};Fax[_0xbbc7('0x1d')][_0xbbc7('0x2a')]=function(_0x4bc446){if(this[_0xbbc7('0x23')][_0x4bc446['uniqueid']]){for(var _0x266f5f in _0x4bc446[_0xbbc7('0x2b')]){if(_0x4bc446[_0xbbc7('0x2b')][_0xbbc7('0x20')](_0x266f5f)){this[_0xbbc7('0x23')][_0x4bc446[_0xbbc7('0x24')]][_0x266f5f]=_0x4bc446[_0xbbc7('0x2c')];}}}};Fax['prototype'][_0xbbc7('0x2d')]=function(_0x188a39){if(this['channels'][_0x188a39['uniqueid']]){this[_0xbbc7('0x23')][_0x188a39[_0xbbc7('0x24')]][_0xbbc7('0x2e')]=_0x188a39[_0xbbc7('0x2e')];this['channels'][_0x188a39[_0xbbc7('0x24')]][_0xbbc7('0x2f')]=_0x188a39['channelstatedesc'];}};Fax[_0xbbc7('0x1d')][_0xbbc7('0x14')]=function(_0x425000){if(this[_0xbbc7('0x23')][_0x425000[_0xbbc7('0x24')]]){for(var _0x30510f in _0x425000[_0xbbc7('0x2b')]){if(_0x425000[_0xbbc7('0x2b')][_0xbbc7('0x20')](_0x30510f)){this[_0xbbc7('0x23')][_0x425000[_0xbbc7('0x24')]][_0x30510f]=_0x425000[_0xbbc7('0x2c')];}}}};Fax[_0xbbc7('0x1d')][_0xbbc7('0x16')]=function(_0x4027ac){if(this['channels'][_0x4027ac[_0xbbc7('0x24')]]){this[_0xbbc7('0x23')][_0x4027ac[_0xbbc7('0x24')]][_0xbbc7('0x30')]=_0x4027ac[_0xbbc7('0x30')];this['channels'][_0x4027ac['uniqueid']]['status']=_0x4027ac['status'];this[_0xbbc7('0x23')][_0x4027ac['uniqueid']][_0xbbc7('0x22')]=_0x4027ac[_0xbbc7('0x22')];this[_0xbbc7('0x23')][_0x4027ac[_0xbbc7('0x24')]][_0xbbc7('0x31')]=_0x4027ac[_0xbbc7('0x31')];logger['info'](_0x4027ac[_0xbbc7('0x24')],_0xbbc7('0x32'));}};Fax['prototype'][_0xbbc7('0x18')]=function(_0x54bbb6){var _0x4bf4a2=this;if(this[_0xbbc7('0x23')][_0x54bbb6[_0xbbc7('0x24')]]){var _0x33fc26=this[_0xbbc7('0x23')][_0x54bbb6[_0xbbc7('0x24')]]['id'];this[_0xbbc7('0x23')][_0x54bbb6['uniqueid']][_0xbbc7('0x33')]=_0x54bbb6[_0xbbc7('0x33')];this['channels'][_0x54bbb6[_0xbbc7('0x24')]]['pagestransferred']=_0x54bbb6['pagestransferred'];this[_0xbbc7('0x23')][_0x54bbb6[_0xbbc7('0x24')]][_0xbbc7('0x22')]=_0x54bbb6[_0xbbc7('0x22')];this['channels'][_0x54bbb6[_0xbbc7('0x24')]][_0xbbc7('0x34')]=_0x54bbb6[_0xbbc7('0x34')];this['channels'][_0x54bbb6['uniqueid']][_0xbbc7('0x35')]=_0x54bbb6[_0xbbc7('0x35')];this[_0xbbc7('0x23')][_0x54bbb6[_0xbbc7('0x24')]][_0xbbc7('0x31')]=_0x54bbb6['filename'];this[_0xbbc7('0x23')][_0x54bbb6[_0xbbc7('0x24')]]['calleridnum']=_0x54bbb6[_0xbbc7('0x36')];if(this[_0xbbc7('0x23')][_0x54bbb6[_0xbbc7('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x54bbb6[_0xbbc7('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0x5ccd5e){logger[_0xbbc7('0x27')](_0x54bbb6[_0xbbc7('0x24')],'\x20result\x20conversion\x20file\x20',_0x5ccd5e[_0xbbc7('0x37')]);attachment['create']({'name':path[_0xbbc7('0x38')](_0x54bbb6['filename'])['name'],'basename':path[_0xbbc7('0x38')](_0x54bbb6['filename'])[_0xbbc7('0x26')]+_0xbbc7('0x39'),'type':_0xbbc7('0x3a')})['then'](function(_0x262882){faxAccount[_0xbbc7('0x3b')](_0x33fc26,{'from':_0x54bbb6[_0xbbc7('0x36')],'mapKey':_0xbbc7('0x7'),'body':path['parse'](_0x54bbb6[_0xbbc7('0x31')])['name']+_0xbbc7('0x39'),'AttachmentId':_0x262882['id']})[_0xbbc7('0x3c')](function(_0x56332b){logger[_0xbbc7('0x3d')](_0x54bbb6['uniqueid'],_0xbbc7('0x3e'),JSON['stringify'](_0x56332b));});})[_0xbbc7('0x3c')](function(_0x15197b){logger[_0xbbc7('0x3d')](_0x54bbb6['uniqueid'],_0xbbc7('0x3f'),JSON['stringify'](_0x15197b));});});}logger[_0xbbc7('0x27')](_0x54bbb6['uniqueid'],_0xbbc7('0x3f'));}};Fax[_0xbbc7('0x1d')][_0xbbc7('0x1c')]=function(_0x2c3afb){if(this[_0xbbc7('0x28')][_0x2c3afb[_0xbbc7('0x24')]]){_['merge'](this[_0xbbc7('0x23')][_0x2c3afb[_0xbbc7('0x24')]],_[_0xbbc7('0x40')](_0x2c3afb,[_0xbbc7('0x41'),_0xbbc7('0x42')]));}};function updateStatus(_0x1df51a){if(_0x1df51a[_0xbbc7('0x43')]){faxMessage['update'](_0x1df51a[_0xbbc7('0x43')],{'failMessage':_0xbbc7('0x44')})['then'](function(_0x5ec3e6){ut[_0xbbc7('0x45')](_0xbbc7('0x46'),_0x5ec3e6);})[_0xbbc7('0x3c')](function(_0x5e7d77){ut[_0xbbc7('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x5e7d77);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xbbc7('0x1d')][_0xbbc7('0x47')]=function(_0x1aa886,_0x238b77,_0x994719){var _0x58083b=this;var _0x303586={};if(_0x238b77){_0x303586={'read':_0x238b77};}else{_0x303586={'failMessage':_0x994719};}if(this[_0xbbc7('0x28')][_0x1aa886][_0xbbc7('0x43')]){faxMessage[_0xbbc7('0x48')](this[_0xbbc7('0x28')][_0x1aa886][_0xbbc7('0x43')],_0x303586)['then'](function(_0x131a04){ut[_0xbbc7('0x45')](_0xbbc7('0x49'),_0x131a04);})['catch'](function(_0x204619){ut[_0xbbc7('0x45')]('[Fax][Message][NoUpdate1]',_0x204619);})['finally'](function(){delete _0x58083b['channels'][_0x1aa886];delete _0x58083b[_0xbbc7('0x28')][_0x1aa886];});}else{ut[_0xbbc7('0x45')](_0xbbc7('0x4a'));delete this[_0xbbc7('0x23')][_0x1aa886];delete this[_0xbbc7('0x28')][_0x1aa886];}};Fax[_0xbbc7('0x1d')]['syncHangup']=function(_0x1f1b5c){var _0x4ecd06=this;if(this[_0xbbc7('0x23')][_0x1f1b5c[_0xbbc7('0x24')]]){if(this[_0xbbc7('0x28')][_0x1f1b5c[_0xbbc7('0x24')]]){this[_0xbbc7('0x23')][_0x1f1b5c[_0xbbc7('0x24')]]['id']=this[_0xbbc7('0x28')][_0x1f1b5c[_0xbbc7('0x24')]]['id'];this[_0xbbc7('0x23')][_0x1f1b5c[_0xbbc7('0x24')]][_0xbbc7('0x26')]=this[_0xbbc7('0x28')][_0x1f1b5c[_0xbbc7('0x24')]][_0xbbc7('0x26')];}logger[_0xbbc7('0x27')](_0x1f1b5c[_0xbbc7('0x24')],this[_0xbbc7('0x28')][_0x1f1b5c[_0xbbc7('0x24')]]?_0xbbc7('0x4b'):_0xbbc7('0x4c'),JSON[_0xbbc7('0x4d')](this[_0xbbc7('0x23')][_0x1f1b5c[_0xbbc7('0x24')]]));if(this[_0xbbc7('0x28')][_0x1f1b5c[_0xbbc7('0x24')]]){if(this[_0xbbc7('0x23')][_0x1f1b5c[_0xbbc7('0x24')]]['faxpages']>0x0&&this[_0xbbc7('0x23')][_0x1f1b5c[_0xbbc7('0x24')]][_0xbbc7('0x15')]===_0xbbc7('0x4e')){this[_0xbbc7('0x47')](_0x1f1b5c[_0xbbc7('0x24')],!![]);}else{this[_0xbbc7('0x47')](_0x1f1b5c['uniqueid'],![],this[_0xbbc7('0x23')][_0x1f1b5c['uniqueid']][_0xbbc7('0x4f')]?'SENDING\x20FAILED:\x20'+this[_0xbbc7('0x23')][_0x1f1b5c[_0xbbc7('0x24')]]['faxstatusstring']:_0xbbc7('0x50'));}}}};Fax['prototype']['send']=function(_0x8c8996){var _0x509bb8=this;return new BPromise(function(_0x8d0e74,_0x2dc16c){_0x509bb8[_0xbbc7('0x51')](_0x8c8996,_0x509bb8[_0xbbc7('0xd')][_0x8c8996['FaxAccountId']])[_0xbbc7('0x52')](function(_0x444399){ut[_0xbbc7('0x45')](_0xbbc7('0x53'),_0x444399);_0x8d0e74(ut[_0xbbc7('0x37')]('Fax\x20received'));})['catch'](function(_0x2b7655){ut[_0xbbc7('0x45')](_0xbbc7('0x54'),_0x2b7655);updateStatus(_0x8c8996);_0x2dc16c(ut[_0xbbc7('0x37')](_0xbbc7('0x55')));});});};Fax[_0xbbc7('0x1d')][_0xbbc7('0x56')]=function(_0x34ef36){var _0x141282=this;return new BPromise(function(_0x256337,_0x47fbb3){var _0x19abca=_0x141282[_0xbbc7('0x57')](_0x141282[_0xbbc7('0xd')][_0x34ef36[_0xbbc7('0x58')]][_0xbbc7('0x59')],_0x34ef36);if(_0x19abca[_0xbbc7('0x5a')]){_0x256337(ut['message']('Trunk\x20Reachable'));}else{_0x47fbb3(ut[_0xbbc7('0x37')](_0x19abca[_0xbbc7('0x37')]));}});};function originate(_0x1aa945,_0x3bd7a5,_0x4627d3){return new BPromise(function(_0x4b5957,_0x4645c6){if(_0x4627d3){var _0x20732f=util[_0xbbc7('0x5b')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xbbc7('0x38')](_0x1aa945['path'])[_0xbbc7('0x26')],_0x1aa945[_0xbbc7('0x5c')]);gs[_0xbbc7('0x5d')](_0x20732f)[_0xbbc7('0x52')](function(){_0x1aa945[_0xbbc7('0x5c')]=util[_0xbbc7('0x5b')]('%s/%s.tif',path[_0xbbc7('0x38')](_0x1aa945['path'])['dir'],path[_0xbbc7('0x38')](_0x1aa945[_0xbbc7('0x5c')])[_0xbbc7('0x26')]);_0x3bd7a5[_0xbbc7('0x5e')]=_0x1aa945[_0xbbc7('0x5c')];ut[_0xbbc7('0x45')](_0xbbc7('0x5f'),'');ami[_0xbbc7('0x60')](ut[_0xbbc7('0x61')](_0x1aa945,_0x3bd7a5))[_0xbbc7('0x52')](function(_0x1cd62b){_0x4b5957(_0x1cd62b);})[_0xbbc7('0x3c')](function(_0x440f1b){_0x4645c6(_0x440f1b);});})[_0xbbc7('0x3c')](function(_0x42d5cd){_0x4645c6(_0x42d5cd);});}else{ami[_0xbbc7('0x60')](ut[_0xbbc7('0x61')](_0x1aa945,_0x3bd7a5))[_0xbbc7('0x52')](function(_0x2e5fe5){_0x4b5957(_0x2e5fe5);})['catch'](function(_0x4fd10b){_0x4645c6(_0x4fd10b);});}});}Fax[_0xbbc7('0x1d')][_0xbbc7('0x51')]=function(_0x22ccc0,_0x197931){var _0x2625f4=this;return new BPromise(function(_0x5b34b0,_0x1c9fe5){var _0x2e78ee=uuid['v4']();var _0x97bcb6=ut[_0xbbc7('0x62')](_0x22ccc0,_0x197931);_0x2625f4[_0xbbc7('0x28')][_0x2e78ee]=new Action(_0x2e78ee,_0x197931,_0x22ccc0);var _0x407a61=_0x2625f4[_0xbbc7('0x28')][_0x2e78ee];if(path[_0xbbc7('0x38')](_0x22ccc0['path'])['ext']===_0xbbc7('0x39')){originate(_0x407a61,_0x97bcb6,!![])[_0xbbc7('0x52')](function(_0x64ff49){_0x5b34b0(_0x64ff49);})[_0xbbc7('0x3c')](function(_0x4c7879){_0x1c9fe5(_0x4c7879);});}else{originate(_0x407a61,_0x97bcb6,![])[_0xbbc7('0x52')](function(_0x334b2d){_0x5b34b0(_0x334b2d);})[_0xbbc7('0x3c')](function(_0xda3cfd){_0x1c9fe5(_0xda3cfd);});}});};Fax[_0xbbc7('0x1d')][_0xbbc7('0x63')]=function(_0x7e5830){return!_['isNil'](_0x7e5830)&&!_[_0xbbc7('0x64')](_0x7e5830[_0xbbc7('0x26')])&&!_[_0xbbc7('0x64')](_0x7e5830[_0xbbc7('0x65')])&&_0x7e5830[_0xbbc7('0x65')]&&!_[_0xbbc7('0x64')](this[_0xbbc7('0xe')][util[_0xbbc7('0x5b')](_0xbbc7('0x66'),_0x7e5830[_0xbbc7('0x26')])])&&!_['isNil'](this[_0xbbc7('0xe')][util[_0xbbc7('0x5b')](_0xbbc7('0x66'),_0x7e5830['name'])][_0xbbc7('0x67')])&&(this[_0xbbc7('0xe')][util[_0xbbc7('0x5b')](_0xbbc7('0x66'),_0x7e5830[_0xbbc7('0x26')])][_0xbbc7('0x67')]===_0xbbc7('0x68')||this[_0xbbc7('0xe')][util['format'](_0xbbc7('0x66'),_0x7e5830[_0xbbc7('0x26')])]['status']===_0xbbc7('0x69'));};Fax[_0xbbc7('0x1d')]['checkTrunk']=function(_0x2d8dac,_0x25efbe){if(!this[_0xbbc7('0x63')](_0x2d8dac)){ut['logger'](_0xbbc7('0x6a'),_[_0xbbc7('0x64')](_0x2d8dac)?'':_0x2d8dac[_0xbbc7('0x26')]+_0xbbc7('0x6b'));return{'isValid':![],'message':_0xbbc7('0x6c')};}if(_[_0xbbc7('0x64')](_0x25efbe[_0xbbc7('0x7')])){ut['logger'](_0xbbc7('0x6d'),JSON['stringify'](_0x25efbe));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xbbc7('0x64')](_0x25efbe['path'])){ut[_0xbbc7('0x45')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xbbc7('0x4d')](_0x25efbe));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xbbc7('0x6e')};};module[_0xbbc7('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 079f49c..580444e 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 _0x5a14=['notify','resolve','then','[Notify]\x20','bluebird','../../../config/logger','preview','../rpc/faxAccount','error'];(function(_0x2c40c7,_0x17c37a){var _0x10d5e8=function(_0x305a7f){while(--_0x305a7f){_0x2c40c7['push'](_0x2c40c7['shift']());}};_0x10d5e8(++_0x17c37a);}(_0x5a14,0x70));var _0x45a1=function(_0x342bd0,_0x27c579){_0x342bd0=_0x342bd0-0x0;var _0x2bfd01=_0x5a14[_0x342bd0];return _0x2bfd01;};'use strict';var util=require('util');var BPromise=require(_0x45a1('0x0'));var logger=require(_0x45a1('0x1'))(_0x45a1('0x2'));var _=require('lodash');var faxAccount=require(_0x45a1('0x3'));function loggerCatch(_0x1013ef){return function(_0x1ff138){logger[_0x45a1('0x4')](_0x1013ef,util['inspect'](_0x1ff138,{'showHidden':![],'depth':null}));};}exports[_0x45a1('0x5')]=function(_0x2a5ead,_0x5cf7ac){return BPromise[_0x45a1('0x6')]()[_0x45a1('0x7')](faxAccount[_0x45a1('0x5')](_0x2a5ead,_0x5cf7ac))['catch'](loggerCatch(_0x45a1('0x8')));}; \ No newline at end of file +var _0xe6d0=['../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe6d0,0x17e));var _0x0e6d=function(_0xb056f7,_0x2bcd9a){_0xb056f7=_0xb056f7-0x0;var _0x3a27ca=_0xe6d0[_0xb056f7];return _0x3a27ca;};'use strict';var util=require(_0x0e6d('0x0'));var BPromise=require(_0x0e6d('0x1'));var logger=require(_0x0e6d('0x2'))('preview');var _=require(_0x0e6d('0x3'));var faxAccount=require(_0x0e6d('0x4'));function loggerCatch(_0x47cdc8){return function(_0x5ef126){logger[_0x0e6d('0x5')](_0x47cdc8,util[_0x0e6d('0x6')](_0x5ef126,{'showHidden':![],'depth':null}));};}exports[_0x0e6d('0x7')]=function(_0x1021d9,_0x35d877){return BPromise[_0x0e6d('0x8')]()[_0x0e6d('0x9')](faxAccount['notify'](_0x1021d9,_0x35d877))[_0x0e6d('0xa')](loggerCatch(_0x0e6d('0xb')));}; \ 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 f5d93b2..e59ce55 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 _0x10bd=['execute','info','Exec\x20gs','\x20Error\x20:','../../../../config/logger','fax','bluebird','exec'];(function(_0x3a60b8,_0x47caab){var _0x4eb583=function(_0x2251b5){while(--_0x2251b5){_0x3a60b8['push'](_0x3a60b8['shift']());}};_0x4eb583(++_0x47caab);}(_0x10bd,0x15c));var _0xd10b=function(_0x13f93d,_0x40f289){_0x13f93d=_0x13f93d-0x0;var _0x26e77c=_0x10bd[_0x13f93d];return _0x26e77c;};'use strict';var util=require('util');var logger=require(_0xd10b('0x0'))(_0xd10b('0x1'));var BPromise=require(_0xd10b('0x2'));var exec=require('child_process')[_0xd10b('0x3')];exports[_0xd10b('0x4')]=function(_0x26dabe){return new BPromise(function(_0x11100e,_0x446ce5){exec(_0x26dabe,function(_0x32ddd9,_0x8c4519,_0x4992ed){logger[_0xd10b('0x5')](_0xd10b('0x6'),_0x8c4519);if(_0x32ddd9){logger[_0xd10b('0x5')](_0xd10b('0x6'),_0xd10b('0x7'),util['inspect'](_0x32ddd9,{'showHidden':![],'depth':null}),_0x8c4519,_0x4992ed);_0x446ce5(_0x32ddd9);}_0x11100e(_0x8c4519);});});}; \ No newline at end of file +var _0x42e8=['Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird','child_process','execute','info'];(function(_0x534bd9,_0x12b7b0){var _0x207e9d=function(_0x6910bf){while(--_0x6910bf){_0x534bd9['push'](_0x534bd9['shift']());}};_0x207e9d(++_0x12b7b0);}(_0x42e8,0x17c));var _0x842e=function(_0x263bff,_0x28aff9){_0x263bff=_0x263bff-0x0;var _0x5dfe74=_0x42e8[_0x263bff];return _0x5dfe74;};'use strict';var util=require(_0x842e('0x0'));var logger=require(_0x842e('0x1'))(_0x842e('0x2'));var BPromise=require(_0x842e('0x3'));var exec=require(_0x842e('0x4'))['exec'];exports[_0x842e('0x5')]=function(_0x3e1e14){return new BPromise(function(_0x26f22c,_0x3625ae){exec(_0x3e1e14,function(_0x446966,_0x52ba62,_0x3863fd){logger['info']('Exec\x20gs',_0x52ba62);if(_0x446966){logger[_0x842e('0x6')](_0x842e('0x7'),'\x20Error\x20:',util[_0x842e('0x8')](_0x446966,{'showHidden':![],'depth':null}),_0x52ba62,_0x3863fd);_0x3625ae(_0x446966);}_0x26f22c(_0x52ba62);});});}; \ 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 484ce61..dc48ad6 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 _0x0dae=['t38timeout','localstationid','path','variablesAction','uniqueid','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','message','logger','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x4746ed,_0x49e152){var _0x5bcc4e=function(_0x5cda22){while(--_0x5cda22){_0x4746ed['push'](_0x4746ed['shift']());}};_0x5bcc4e(++_0x49e152);}(_0x0dae,0xa0));var _0xe0da=function(_0x364cba,_0x19c43b){_0x364cba=_0x364cba-0x0;var _0x1e6de2=_0x0dae[_0x364cba];return _0x1e6de2;};'use strict';var util=require(_0xe0da('0x0'));var _=require(_0xe0da('0x1'));var moment=require(_0xe0da('0x2'));var logger=require(_0xe0da('0x3'))('fax');exports[_0xe0da('0x4')]=function(_0x13eccc){return{'message':_0x13eccc};};exports[_0xe0da('0x5')]=function(_0x436794,_0x1b32cc){logger['info'](_0x436794,util[_0xe0da('0x6')](_0x1b32cc,{'showHidden':![],'depth':null}));};exports[_0xe0da('0x7')]=function(_0x172ab5,_0x284da4){var _0x416346={'XMF-ECM':_0x284da4[_0xe0da('0x8')],'XMF-HEADERINFO':_0x284da4[_0xe0da('0x9')],'XMF-MINRATE':_0x284da4['minrate'],'XMF-MAXRATE':_0x284da4[_0xe0da('0xa')],'XMF-MODEM':util[_0xe0da('0xb')](_0xe0da('0xc'),_0x284da4[_0xe0da('0xd')]),'XMF-GATEWAY':_0x284da4[_0xe0da('0xe')],'XMF-FAXDETECT':_0x284da4[_0xe0da('0xf')],'XMF-T38TIMEOUT':_0x284da4[_0xe0da('0x10')],'XMF-LOCALSTATIONID':_0x284da4[_0xe0da('0x11')],'XMF-PATH':_0x172ab5[_0xe0da('0x12')]};return _0x416346;};exports[_0xe0da('0x13')]=function(_0x55e496,_0x2e5671){return{'actionid':_0x55e496[_0xe0da('0x14')],'action':'originate','channel':_0x55e496['channel'],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0xe0da('0xb')](_0xe0da('0x15'),_0x55e496['headerinfo']?_0x55e496['headerinfo']:'',_0x55e496[_0xe0da('0x11')]),'variable':_0x2e5671,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x55e496[_0xe0da('0x14')]};}; \ No newline at end of file +var _0x21da=['\x22%s\x22\x20<%s>','uniqueid','util','moment','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','from-sip','format'];(function(_0x23717c,_0x28834d){var _0x2e87ce=function(_0x28fccd){while(--_0x28fccd){_0x23717c['push'](_0x23717c['shift']());}};_0x2e87ce(++_0x28834d);}(_0x21da,0xda));var _0xa21d=function(_0x24ead6,_0x28ade7){_0x24ead6=_0x24ead6-0x0;var _0x242e9c=_0x21da[_0x24ead6];return _0x242e9c;};'use strict';var util=require(_0xa21d('0x0'));var _=require('lodash');var moment=require(_0xa21d('0x1'));var logger=require('../../../../config/logger')(_0xa21d('0x2'));exports[_0xa21d('0x3')]=function(_0x3ff54d){return{'message':_0x3ff54d};};exports[_0xa21d('0x4')]=function(_0x2390cf,_0x137f77){logger[_0xa21d('0x5')](_0x2390cf,util[_0xa21d('0x6')](_0x137f77,{'showHidden':![],'depth':null}));};exports[_0xa21d('0x7')]=function(_0x571441,_0x77d85d){var _0x40bfc2={'XMF-ECM':_0x77d85d[_0xa21d('0x8')],'XMF-HEADERINFO':_0x77d85d[_0xa21d('0x9')],'XMF-MINRATE':_0x77d85d['minrate'],'XMF-MAXRATE':_0x77d85d[_0xa21d('0xa')],'XMF-MODEM':util['format'](_0xa21d('0xb'),_0x77d85d[_0xa21d('0xc')]),'XMF-GATEWAY':_0x77d85d[_0xa21d('0xd')],'XMF-FAXDETECT':_0x77d85d[_0xa21d('0xe')],'XMF-T38TIMEOUT':_0x77d85d[_0xa21d('0xf')],'XMF-LOCALSTATIONID':_0x77d85d[_0xa21d('0x10')],'XMF-PATH':_0x571441[_0xa21d('0x11')]};return _0x40bfc2;};exports[_0xa21d('0x12')]=function(_0x40aa33,_0x1a6345){return{'actionid':_0x40aa33['uniqueid'],'action':_0xa21d('0x13'),'channel':_0x40aa33['channel'],'Exten':'xcally-motion-fax','Context':_0xa21d('0x14'),'Priority':'1','callerid':util[_0xa21d('0x15')](_0xa21d('0x16'),_0x40aa33[_0xa21d('0x9')]?_0x40aa33[_0xa21d('0x9')]:'',_0x40aa33[_0xa21d('0x10')]),'variable':_0x1a6345,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x40aa33[_0xa21d('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 75dd63e..7bceb96 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 _0xeffb=['./realtime','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','log','bluebird','util','moment','./server'];(function(_0x1d6ce8,_0x5c8081){var _0x4bc446=function(_0x5ea66f){while(--_0x5ea66f){_0x1d6ce8['push'](_0x1d6ce8['shift']());}};_0x4bc446(++_0x5c8081);}(_0xeffb,0x10c));var _0xbeff=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0xeffb[_0x1e06f1];return _0x34f77e;};'use strict';var BPromise=require(_0xbeff('0x0'));var util=require(_0xbeff('0x1'));var moment=require(_0xbeff('0x2'));var server=require(_0xbeff('0x3'));var Realtime=require(_0xbeff('0x4'));var Report=require(_0xbeff('0x5'));var Acw=require(_0xbeff('0x6'));var Trigger=require(_0xbeff('0x7'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0xbeff('0x8'));var user=require(_0xbeff('0x9'));var voiceQueue=require(_0xbeff('0xa'));var voiceQueueReport=require(_0xbeff('0xb'));var voiceCallReport=require(_0xbeff('0xc'));var trunk=require(_0xbeff('0xd'));var trigger=require(_0xbeff('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0xbeff('0xf'));var campaign=require(_0xbeff('0x10'));var voiceExtension=require(_0xbeff('0x11'));var faxAccount=require(_0xbeff('0x12'));var zendesk=require(_0xbeff('0x13'));var salesforce=require(_0xbeff('0x14'));var sugarcrm=require(_0xbeff('0x15'));var freshdesk=require(_0xbeff('0x16'));var desk=require(_0xbeff('0x17'));var zoho=require(_0xbeff('0x18'));var vtiger=require(_0xbeff('0x19'));var servicenow=require(_0xbeff('0x1a'));var dynamics365=require(_0xbeff('0x1b'));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()[_0xbeff('0x1c')](_0xbeff('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbeff('0x1e')]()['then'](user[_0xbeff('0x1f')]())[_0xbeff('0x20')](realtime['initAgents']())[_0xbeff('0x20')](user[_0xbeff('0x21')]())['then'](realtime['initTelephones']())[_0xbeff('0x20')](trunk['getTrunks']())[_0xbeff('0x20')](realtime[_0xbeff('0x22')]())[_0xbeff('0x20')](voiceQueue[_0xbeff('0x23')]())['then'](realtime[_0xbeff('0x24')]())[_0xbeff('0x20')](trigger[_0xbeff('0x25')]())[_0xbeff('0x20')](realtime['initTriggers']())['then'](template[_0xbeff('0x26')]())[_0xbeff('0x20')](realtime[_0xbeff('0x27')]())['then'](zendesk[_0xbeff('0x28')]())[_0xbeff('0x20')](realtime['initZendeskAccounts']())[_0xbeff('0x20')](salesforce['getSalesforceAccounts']())[_0xbeff('0x20')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0xbeff('0x29')]())['then'](realtime[_0xbeff('0x2a')]())[_0xbeff('0x20')](freshdesk[_0xbeff('0x2b')]())[_0xbeff('0x20')](realtime['initFreshdeskAccounts']())[_0xbeff('0x20')](desk[_0xbeff('0x2c')]())[_0xbeff('0x20')](realtime[_0xbeff('0x2d')]())['then'](zoho[_0xbeff('0x2e')]())[_0xbeff('0x20')](realtime[_0xbeff('0x2f')]())[_0xbeff('0x20')](vtiger[_0xbeff('0x30')]())[_0xbeff('0x20')](realtime[_0xbeff('0x31')]())[_0xbeff('0x20')](servicenow['getServicenowAccounts']())[_0xbeff('0x20')](realtime[_0xbeff('0x32')]())[_0xbeff('0x20')](dynamics365[_0xbeff('0x33')]())[_0xbeff('0x20')](realtime['initDynamics365Accounts']())[_0xbeff('0x20')](campaign[_0xbeff('0x34')]())[_0xbeff('0x20')](realtime[_0xbeff('0x35')]())['then'](voiceExtension[_0xbeff('0x36')]())[_0xbeff('0x20')](realtime[_0xbeff('0x37')]())[_0xbeff('0x20')](faxAccount[_0xbeff('0x38')]())['then'](realtime[_0xbeff('0x39')]())[_0xbeff('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0xbeff('0x1e')]()[_0xbeff('0x20')](voiceQueueReport[_0xbeff('0x3a')]())['then'](realtime[_0xbeff('0x3b')]())[_0xbeff('0x20')](cmHopperHistory[_0xbeff('0x3c')]())[_0xbeff('0x20')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0xbeff('0x3d')]())[_0xbeff('0x20')](realtime[_0xbeff('0x3e')]())[_0xbeff('0x20')](voiceCallReport[_0xbeff('0x3f')]())[_0xbeff('0x20')](realtime[_0xbeff('0x40')]())[_0xbeff('0x20')](function(_0x58c32c){})[_0xbeff('0x41')](function(_0x23c39a){console['log'](_0x23c39a);});}function main(){return server[_0xbeff('0x42')](realtime,preview,fax)[_0xbeff('0x20')](function(_0x4e858c){return initRealtime();})['then'](function(){return initParams();})[_0xbeff('0x20')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xbeff('0x41')](function(_0x5554dd){console[_0xbeff('0x43')](_0x5554dd);});}main(); \ No newline at end of file +var _0x8cc5=['initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts'];(function(_0x48647c,_0x2126d2){var _0x21c009=function(_0x192396){while(--_0x192396){_0x48647c['push'](_0x48647c['shift']());}};_0x21c009(++_0x2126d2);}(_0x8cc5,0x156));var _0x58cc=function(_0x577ec1,_0x17c00c){_0x577ec1=_0x577ec1-0x0;var _0x13eb28=_0x8cc5[_0x577ec1];return _0x13eb28;};'use strict';var BPromise=require(_0x58cc('0x0'));var util=require(_0x58cc('0x1'));var moment=require(_0x58cc('0x2'));var server=require(_0x58cc('0x3'));var Realtime=require(_0x58cc('0x4'));var Report=require('./report');var Acw=require(_0x58cc('0x5'));var Trigger=require(_0x58cc('0x6'));var Dialer=require(_0x58cc('0x7'));var Preview=require(_0x58cc('0x8'));var Fax=require(_0x58cc('0x9'));var user=require(_0x58cc('0xa'));var voiceQueue=require(_0x58cc('0xb'));var voiceQueueReport=require(_0x58cc('0xc'));var voiceCallReport=require(_0x58cc('0xd'));var trunk=require(_0x58cc('0xe'));var trigger=require(_0x58cc('0xf'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x58cc('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x58cc('0x11'));var zendesk=require(_0x58cc('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x58cc('0x13'));var freshdesk=require(_0x58cc('0x14'));var desk=require(_0x58cc('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x58cc('0x16'));var servicenow=require(_0x58cc('0x17'));var dynamics365=require(_0x58cc('0x18'));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()[_0x58cc('0x19')](_0x58cc('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x58cc('0x1b')]()[_0x58cc('0x1c')](user[_0x58cc('0x1d')]())[_0x58cc('0x1c')](realtime['initAgents']())[_0x58cc('0x1c')](user[_0x58cc('0x1e')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x1f')]())[_0x58cc('0x1c')](trunk[_0x58cc('0x20')]())['then'](realtime[_0x58cc('0x21')]())[_0x58cc('0x1c')](voiceQueue[_0x58cc('0x22')]())[_0x58cc('0x1c')](realtime['initVoiceQueues']())[_0x58cc('0x1c')](trigger[_0x58cc('0x23')]())['then'](realtime[_0x58cc('0x24')]())['then'](template['getTemplates']())[_0x58cc('0x1c')](realtime[_0x58cc('0x25')]())[_0x58cc('0x1c')](zendesk[_0x58cc('0x26')]())[_0x58cc('0x1c')](realtime['initZendeskAccounts']())[_0x58cc('0x1c')](salesforce[_0x58cc('0x27')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x28')]())[_0x58cc('0x1c')](sugarcrm[_0x58cc('0x29')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x2a')]())[_0x58cc('0x1c')](freshdesk[_0x58cc('0x2b')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x2c')]())[_0x58cc('0x1c')](desk[_0x58cc('0x2d')]())[_0x58cc('0x1c')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())[_0x58cc('0x1c')](realtime[_0x58cc('0x2e')]())['then'](vtiger[_0x58cc('0x2f')]())['then'](realtime['initVtigerAccounts']())['then'](servicenow['getServicenowAccounts']())[_0x58cc('0x1c')](realtime[_0x58cc('0x30')]())[_0x58cc('0x1c')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x58cc('0x31')]())[_0x58cc('0x1c')](campaign[_0x58cc('0x32')]())['then'](realtime['initCampaigns']())[_0x58cc('0x1c')](voiceExtension[_0x58cc('0x33')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x34')]())[_0x58cc('0x1c')](faxAccount[_0x58cc('0x35')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x36')]())[_0x58cc('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x58cc('0x1b')]()[_0x58cc('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0x58cc('0x1c')](realtime[_0x58cc('0x37')]())[_0x58cc('0x1c')](cmHopperHistory[_0x58cc('0x38')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x39')]())['then'](cmHopperHistory[_0x58cc('0x3a')]())['then'](realtime[_0x58cc('0x3b')]())[_0x58cc('0x1c')](voiceCallReport[_0x58cc('0x3c')]())[_0x58cc('0x1c')](realtime[_0x58cc('0x3d')]())[_0x58cc('0x1c')](function(_0x539143){})[_0x58cc('0x3e')](function(_0x679954){console[_0x58cc('0x3f')](_0x679954);});}function main(){return server[_0x58cc('0x40')](realtime,preview,fax)[_0x58cc('0x1c')](function(_0x342baa){return initRealtime();})[_0x58cc('0x1c')](function(){return initParams();})[_0x58cc('0x1c')](function(){report[_0x58cc('0x41')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x471241){console[_0x58cc('0x3f')](_0x471241);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index a7bea73..8fd452f 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 _0xd369=['updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','address','interface','format','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype'];(function(_0x20b50a,_0x20cac7){var _0x4fea3b=function(_0x114df4){while(--_0x114df4){_0x20b50a['push'](_0x20b50a['shift']());}};_0x4fea3b(++_0x20cac7);}(_0xd369,0xdd));var _0x9d36=function(_0xe60c8,_0x423ee6){_0xe60c8=_0xe60c8-0x0;var _0x33a86c=_0xd369[_0xe60c8];return _0x33a86c;};'use strict';var _=require('lodash');var util=require(_0x9d36('0x0'));var moment=require(_0x9d36('0x1'));var md5=require(_0x9d36('0x2'));var Redis=require(_0x9d36('0x3'));var config=require(_0x9d36('0x4'));config[_0x9d36('0x5')]=_[_0x9d36('0x6')](config[_0x9d36('0x5')],{'host':_0x9d36('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9d36('0x5')]));function Agent(_0x4b0778){this['id']=_0x4b0778['id']||0x0;this[_0x9d36('0x8')]=_0x4b0778[_0x9d36('0x8')]||'';this[_0x9d36('0x9')]=_0x4b0778[_0x9d36('0x9')]||'';this[_0x9d36('0xa')]=_0x4b0778['accountcode']||'';this[_0x9d36('0xb')]=_0x4b0778[_0x9d36('0xb')]||'';this[_0x9d36('0xc')]=_0x9d36('0xd');this[_0x9d36('0xe')]=0x0;this[_0x9d36('0xf')]=_0x9d36('0xd');this['address']='';this[_0x9d36('0x10')]='';this['mobile']='';this['interface']='';this[_0x9d36('0x11')]=_0x4b0778[_0x9d36('0x11')]||![];this[_0x9d36('0x12')]=_0x9d36('0xd');this[_0x9d36('0x13')]=0x0;this[_0x9d36('0x14')]='';this[_0x9d36('0x15')]='';this[_0x9d36('0x16')]=![];this['local']=![];this['md5']='';}Agent[_0x9d36('0x17')][_0x9d36('0x18')]=function(_0x45cdc5){var _0x550018;if(_0x45cdc5&&_0x45cdc5[_0x9d36('0xc')]){_0x550018=_0x45cdc5[_0x9d36('0xc')][_0x9d36('0x19')]();switch(_0x550018){case _0x9d36('0x1a'):_0x550018=_0x9d36('0x1b');break;case'inuse':_0x550018=_0x9d36('0x1c');break;}}if(_0x550018&&this[_0x9d36('0x12')]!==_0x550018||_0x45cdc5[_0x9d36('0x1d')]){this[_0x9d36('0x13')]=_[_0x9d36('0x1e')](moment()['format']('x'));}if(_0x550018){this[_0x9d36('0x12')]=_0x550018;}var _0x5f0e67={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0x9d36('0xa')],'fullname':this[_0x9d36('0xb')],'state':this['state'],'stateTime':this[_0x9d36('0xe')],'status':this[_0x9d36('0xf')],'address':this[_0x9d36('0x1f')],'online':this[_0x9d36('0x11')],'voiceStatus':this[_0x9d36('0x12')],'voiceStatusTime':this[_0x9d36('0x13')],'voiceStatusCallerIdNumber':this[_0x9d36('0x14')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9d36('0x20')],'onhold':this[_0x9d36('0x16')]};var _0x40a6fa=md5(JSON['stringify'](_0x5f0e67));if(this['md5']!==_0x40a6fa){this[_0x9d36('0x2')]=_0x40a6fa;io['to'](util[_0x9d36('0x21')]('user:%s',_0x5f0e67['name']))['emit']('user:save',_0x5f0e67);}};module[_0x9d36('0x22')]=Agent; \ No newline at end of file +var _0xb9a5=['phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','voiceStatusCallerIdNumber','user:%s','emit','user:save','exports','lodash','moment','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0xb9a5,0x186));var _0x5b9a=function(_0x529587,_0x7b9e47){_0x529587=_0x529587-0x0;var _0x4ea039=_0xb9a5[_0x529587];return _0x4ea039;};'use strict';var _=require(_0x5b9a('0x0'));var util=require('util');var moment=require(_0x5b9a('0x1'));var md5=require(_0x5b9a('0x2'));var Redis=require('ioredis');var config=require(_0x5b9a('0x3'));config['redis']=_[_0x5b9a('0x4')](config[_0x5b9a('0x5')],{'host':_0x5b9a('0x6'),'port':0x18eb});var io=require(_0x5b9a('0x7'))(new Redis(config['redis']));function Agent(_0x42abe2){this['id']=_0x42abe2['id']||0x0;this[_0x5b9a('0x8')]=_0x42abe2[_0x5b9a('0x8')]||'';this['email']=_0x42abe2[_0x5b9a('0x9')]||'';this[_0x5b9a('0xa')]=_0x42abe2[_0x5b9a('0xa')]||'';this[_0x5b9a('0xb')]=_0x42abe2['fullname']||'';this[_0x5b9a('0xc')]=_0x5b9a('0xd');this[_0x5b9a('0xe')]=0x0;this[_0x5b9a('0xf')]=_0x5b9a('0xd');this[_0x5b9a('0x10')]='';this[_0x5b9a('0x11')]='';this['mobile']='';this[_0x5b9a('0x12')]='';this[_0x5b9a('0x13')]=_0x42abe2[_0x5b9a('0x13')]||![];this[_0x5b9a('0x14')]=_0x5b9a('0xd');this[_0x5b9a('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x5b9a('0x16')]='';this[_0x5b9a('0x17')]=![];this['local']=![];this[_0x5b9a('0x2')]='';}Agent['prototype']['updateStatusRealtime']=function(_0xe5a1d2){var _0x121eae;if(_0xe5a1d2&&_0xe5a1d2[_0x5b9a('0xc')]){_0x121eae=_0xe5a1d2[_0x5b9a('0xc')][_0x5b9a('0x18')]();switch(_0x121eae){case _0x5b9a('0x19'):_0x121eae=_0x5b9a('0x1a');break;case _0x5b9a('0x1b'):_0x121eae=_0x5b9a('0x1c');break;}}if(_0x121eae&&this['voiceStatus']!==_0x121eae||_0xe5a1d2[_0x5b9a('0x1d')]){this[_0x5b9a('0x15')]=_[_0x5b9a('0x1e')](moment()[_0x5b9a('0x1f')]('x'));}if(_0x121eae){this[_0x5b9a('0x14')]=_0x121eae;}var _0x1ec37e={'id':this['id'],'name':this[_0x5b9a('0x8')],'email':this[_0x5b9a('0x9')],'accountcode':this[_0x5b9a('0xa')],'fullname':this['fullname'],'state':this[_0x5b9a('0xc')],'stateTime':this[_0x5b9a('0xe')],'status':this[_0x5b9a('0xf')],'address':this[_0x5b9a('0x10')],'online':this[_0x5b9a('0x13')],'voiceStatus':this[_0x5b9a('0x14')],'voiceStatusTime':this[_0x5b9a('0x15')],'voiceStatusCallerIdNumber':this[_0x5b9a('0x20')],'voiceStatusQueue':this[_0x5b9a('0x16')],'interface':this['interface'],'onhold':this[_0x5b9a('0x17')]};var _0x20bbc6=md5(JSON['stringify'](_0x1ec37e));if(this['md5']!==_0x20bbc6){this[_0x5b9a('0x2')]=_0x20bbc6;io['to'](util['format'](_0x5b9a('0x21'),_0x1ec37e[_0x5b9a('0x8')]))[_0x5b9a('0x22')](_0x5b9a('0x23'),_0x1ec37e);}};module[_0x5b9a('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index fd961b7..1ee26e9 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 _0x19ea=['dialAMDMaximumWordLength','exports','type','campaign','originated','temp','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x3fcb02,_0x1fbba3){var _0xa9a148=function(_0x208c05){while(--_0x208c05){_0x3fcb02['push'](_0x3fcb02['shift']());}};_0xa9a148(++_0x1fbba3);}(_0x19ea,0xfe));var _0xa19e=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x19ea[_0x513047];return _0x15b779;};'use strict';function Campaign(_0x142947){this['id']=_0x142947['id']||0x0;this['name']=_0x142947['name']||'';this[_0xa19e('0x0')]=_0x142947['type']||_0xa19e('0x1');this[_0xa19e('0x2')]=0x0;this[_0xa19e('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0xa19e('0x4')]='';this[_0xa19e('0x5')]=!![];this[_0xa19e('0x6')]=_0x142947[_0xa19e('0x6')];this[_0xa19e('0x7')]=_0x142947[_0xa19e('0x7')];this[_0xa19e('0x8')]=_0x142947[_0xa19e('0x8')]||null;this[_0xa19e('0x9')]=_0x142947[_0xa19e('0x9')]?_0x142947[_0xa19e('0x9')]:null;this['dialOriginateCallerIdName']=_0x142947[_0xa19e('0xa')];this[_0xa19e('0xb')]=_0x142947[_0xa19e('0xb')];this[_0xa19e('0xc')]=_0x142947['dialOriginateTimeout']||0x1e;this[_0xa19e('0xd')]=_0x142947[_0xa19e('0xd')];this[_0xa19e('0xe')]=_0x142947['dialCongestionRetryFrequency'];this[_0xa19e('0xf')]=_0x142947[_0xa19e('0xf')];this[_0xa19e('0x10')]=_0x142947[_0xa19e('0x10')];this[_0xa19e('0x11')]=_0x142947['dialNoAnswerMaxRetry'];this[_0xa19e('0x12')]=_0x142947[_0xa19e('0x12')];this[_0xa19e('0x13')]=_0x142947[_0xa19e('0x13')];this[_0xa19e('0x14')]=_0x142947[_0xa19e('0x14')]||_0xa19e('0x15');this[_0xa19e('0x16')]=_0x142947[_0xa19e('0x16')]||undefined;this[_0xa19e('0x17')]=_0x142947[_0xa19e('0x17')]||undefined;this['dialCutDigit']=_0x142947[_0xa19e('0x18')]||undefined;this[_0xa19e('0x19')]=_0x142947[_0xa19e('0x19')]?_0x142947[_0xa19e('0x19')]:undefined;this[_0xa19e('0x1a')]=_0x142947[_0xa19e('0x1a')]?_0x142947[_0xa19e('0x1a')]:undefined;this['Interval']=_0x142947[_0xa19e('0x1b')]?_0x142947['Interval']:undefined;this[_0xa19e('0x1c')]=_0x142947['SquareProject']?_0x142947['SquareProject']:undefined;this[_0xa19e('0x1d')]=_0x142947[_0xa19e('0x1c')]?_0x142947['SquareProject'][_0xa19e('0x1e')]:undefined;this[_0xa19e('0x1f')]=_0x142947[_0xa19e('0x1f')]||![];this[_0xa19e('0x20')]=_0x142947['dialAMDInitialSilence'];this[_0xa19e('0x21')]=_0x142947[_0xa19e('0x21')];this[_0xa19e('0x22')]=_0x142947[_0xa19e('0x22')];this[_0xa19e('0x23')]=_0x142947[_0xa19e('0x23')];this[_0xa19e('0x24')]=_0x142947[_0xa19e('0x24')];this[_0xa19e('0x25')]=_0x142947['dialAMDBetweenWordsSilence'];this[_0xa19e('0x26')]=_0x142947[_0xa19e('0x26')];this['dialAMDSilenceThreshold']=_0x142947[_0xa19e('0x27')];this[_0xa19e('0x28')]=_0x142947['dialAMDMaximumWordLength'];}module[_0xa19e('0x29')]=Campaign; \ No newline at end of file +var _0x41bb=['dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x4b7124,_0x206b7b){var _0x23e16d=function(_0x2cd68e){while(--_0x2cd68e){_0x4b7124['push'](_0x4b7124['shift']());}};_0x23e16d(++_0x206b7b);}(_0x41bb,0xc5));var _0xb41b=function(_0x3e2423,_0x5554c6){_0x3e2423=_0x3e2423-0x0;var _0x26c422=_0x41bb[_0x3e2423];return _0x26c422;};'use strict';function Campaign(_0x4337f5){this['id']=_0x4337f5['id']||0x0;this[_0xb41b('0x0')]=_0x4337f5['name']||'';this[_0xb41b('0x1')]=_0x4337f5['type']||_0xb41b('0x2');this[_0xb41b('0x3')]=0x0;this[_0xb41b('0x4')]=0x0;this[_0xb41b('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xb41b('0x6')]='';this[_0xb41b('0x7')]=!![];this[_0xb41b('0x8')]=_0x4337f5['active'];this['limitCalls']=_0x4337f5['limitCalls'];this[_0xb41b('0x9')]=_0x4337f5[_0xb41b('0x9')]||null;this['dialGlobalInterval']=_0x4337f5[_0xb41b('0xa')]?_0x4337f5[_0xb41b('0xa')]:null;this[_0xb41b('0xb')]=_0x4337f5[_0xb41b('0xb')];this[_0xb41b('0xc')]=_0x4337f5[_0xb41b('0xc')];this[_0xb41b('0xd')]=_0x4337f5['dialOriginateTimeout']||0x1e;this[_0xb41b('0xe')]=_0x4337f5['dialCongestionMaxRetry'];this[_0xb41b('0xf')]=_0x4337f5[_0xb41b('0xf')];this[_0xb41b('0x10')]=_0x4337f5[_0xb41b('0x10')];this[_0xb41b('0x11')]=_0x4337f5['dialBusyRetryFrequency'];this[_0xb41b('0x12')]=_0x4337f5[_0xb41b('0x12')];this[_0xb41b('0x13')]=_0x4337f5[_0xb41b('0x13')];this[_0xb41b('0x14')]=_0x4337f5['dialGlobalMaxRetry'];this['dialOrderByScheduledAt']=_0x4337f5['dialOrderByScheduledAt']||_0xb41b('0x15');this[_0xb41b('0x16')]=_0x4337f5[_0xb41b('0x16')]||undefined;this[_0xb41b('0x17')]=_0x4337f5[_0xb41b('0x17')]||undefined;this['dialCutDigit']=_0x4337f5[_0xb41b('0x18')]||undefined;this[_0xb41b('0x19')]=_0x4337f5[_0xb41b('0x19')]?_0x4337f5[_0xb41b('0x19')]:undefined;this[_0xb41b('0x1a')]=_0x4337f5[_0xb41b('0x1a')]?_0x4337f5[_0xb41b('0x1a')]:undefined;this['Interval']=_0x4337f5['Interval']?_0x4337f5['Interval']:undefined;this[_0xb41b('0x1b')]=_0x4337f5['SquareProject']?_0x4337f5[_0xb41b('0x1b')]:undefined;this[_0xb41b('0x1c')]=_0x4337f5[_0xb41b('0x1b')]?_0x4337f5['SquareProject']['name']:undefined;this[_0xb41b('0x1d')]=_0x4337f5[_0xb41b('0x1d')]||![];this[_0xb41b('0x1e')]=_0x4337f5[_0xb41b('0x1e')];this[_0xb41b('0x1f')]=_0x4337f5[_0xb41b('0x1f')];this['dialAMDAfterGreetingSilence']=_0x4337f5['dialAMDAfterGreetingSilence'];this[_0xb41b('0x20')]=_0x4337f5[_0xb41b('0x20')];this[_0xb41b('0x21')]=_0x4337f5['dialAMDMinWordLength'];this[_0xb41b('0x22')]=_0x4337f5[_0xb41b('0x22')];this['dialAMDMaximumNumberOfWords']=_0x4337f5[_0xb41b('0x23')];this[_0xb41b('0x24')]=_0x4337f5['dialAMDSilenceThreshold'];this[_0xb41b('0x25')]=_0x4337f5['dialAMDMaximumWordLength'];}module[_0xb41b('0x26')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index fd7b8a2..45cf03b 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 _0x288a=['exports','channel','destinationchannel','calleridnum','calleridname','accountcode','uniqueid','linkedid','exten','answertime','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitors','transfercalleridnum','mohtime'];(function(_0x45f1ca,_0x5c4d8e){var _0x40d9d1=function(_0x4581a8){while(--_0x4581a8){_0x45f1ca['push'](_0x45f1ca['shift']());}};_0x40d9d1(++_0x5c4d8e);}(_0x288a,0x188));var _0xa288=function(_0x3ea119,_0x2ef623){_0x3ea119=_0x3ea119-0x0;var _0xbeec29=_0x288a[_0x3ea119];return _0xbeec29;};'use strict';function Channel(){this['starttime']=null;this[_0xa288('0x0')]='';this[_0xa288('0x1')]='';this[_0xa288('0x2')]=0x0;this[_0xa288('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xa288('0x4')]=0x0;this['context']='';this[_0xa288('0x5')]=0x0;this[_0xa288('0x6')]=0x0;this[_0xa288('0x7')]=0x0;this['answered']=![];this[_0xa288('0x8')]=null;this[_0xa288('0x9')]=null;this[_0xa288('0xa')]=![];this['abandoned']=![];this[_0xa288('0xb')]='';this[_0xa288('0xc')]='';this[_0xa288('0xd')]=0x0;this[_0xa288('0xe')]=0x0;this[_0xa288('0xf')]=0x0;this[_0xa288('0x10')]=null;this[_0xa288('0x11')]=null;this[_0xa288('0x12')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0xa288('0x13')]=[];this[_0xa288('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xa288('0x15')]=0x0;}module[_0xa288('0x16')]=Channel; \ No newline at end of file +var _0x282a=['queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','linkedid','answered','endtime','unmanaged','abandoned','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename'];(function(_0x13fc1a,_0x1ba9e2){var _0x38710=function(_0x2629f9){while(--_0x2629f9){_0x13fc1a['push'](_0x13fc1a['shift']());}};_0x38710(++_0x1ba9e2);}(_0x282a,0xa2));var _0xa282=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x282a[_0x21a9d9];return _0x46adce;};'use strict';function Channel(){this['starttime']=null;this[_0xa282('0x0')]='';this[_0xa282('0x1')]='';this[_0xa282('0x2')]=0x0;this[_0xa282('0x3')]='';this[_0xa282('0x4')]=undefined;this['connectedlinename']=undefined;this[_0xa282('0x5')]=0x0;this[_0xa282('0x6')]='';this['uniqueid']=0x0;this[_0xa282('0x7')]=0x0;this['exten']=0x0;this[_0xa282('0x8')]=![];this['answertime']=null;this[_0xa282('0x9')]=null;this[_0xa282('0xa')]=![];this[_0xa282('0xb')]=![];this['lastapplication']='';this[_0xa282('0xc')]='';this['duration']=0x0;this[_0xa282('0xd')]=0x0;this[_0xa282('0xe')]=0x0;this[_0xa282('0xf')]=null;this[_0xa282('0x10')]=null;this[_0xa282('0x11')]=null;this[_0xa282('0x12')]=![];this[_0xa282('0x13')]=null;this[_0xa282('0x14')]=null;this[_0xa282('0x15')]=[];this[_0xa282('0x16')]=undefined;this[_0xa282('0x17')]=undefined;this[_0xa282('0x18')]=0x0;}module[_0xa282('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 5493be9..d0d9f28 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 _0x5870=['tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x4031c3,_0x16e428){var _0x38ca27=function(_0x2232f1){while(--_0x2232f1){_0x4031c3['push'](_0x4031c3['shift']());}};_0x38ca27(++_0x16e428);}(_0x5870,0x18b));var _0x0587=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5870[_0x278e3c];return _0x3e2d9b;};'use strict';function DeskAccount(_0x5cc6c2){this['id']=_0x5cc6c2['id']||0x0;this['name']=_0x5cc6c2[_0x0587('0x0')]||'';this['username']=_0x5cc6c2[_0x0587('0x1')]||'';this[_0x0587('0x2')]=_0x5cc6c2[_0x0587('0x2')]||'';this[_0x0587('0x3')]=_0x5cc6c2['authType']||'';this['password']=_0x5cc6c2[_0x0587('0x4')]||'';this['consumerKey']=_0x5cc6c2[_0x0587('0x5')]||'';this['consumerSecret']=_0x5cc6c2[_0x0587('0x6')]||'';this[_0x0587('0x7')]=_0x5cc6c2['token']||'';this[_0x0587('0x8')]=_0x5cc6c2['tokenSecret']||'';this[_0x0587('0x9')]=_0x5cc6c2[_0x0587('0x9')]||'';this[_0x0587('0xa')]=_0x5cc6c2[_0x0587('0xa')]||'';this[_0x0587('0xb')]=_0x5cc6c2[_0x0587('0xb')]||{};}module[_0x0587('0xc')]=DeskAccount; \ No newline at end of file +var _0xb896=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x491bfe,_0x5a230c){var _0x377f4a=function(_0x505a71){while(--_0x505a71){_0x491bfe['push'](_0x491bfe['shift']());}};_0x377f4a(++_0x5a230c);}(_0xb896,0xa4));var _0x6b89=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xb896[_0x2d982d];return _0x4f36b0;};'use strict';function DeskAccount(_0x23e1a5){this['id']=_0x23e1a5['id']||0x0;this[_0x6b89('0x0')]=_0x23e1a5[_0x6b89('0x0')]||'';this[_0x6b89('0x1')]=_0x23e1a5[_0x6b89('0x1')]||'';this[_0x6b89('0x2')]=_0x23e1a5[_0x6b89('0x2')]||'';this[_0x6b89('0x3')]=_0x23e1a5[_0x6b89('0x3')]||'';this['password']=_0x23e1a5[_0x6b89('0x4')]||'';this[_0x6b89('0x5')]=_0x23e1a5['consumerKey']||'';this[_0x6b89('0x6')]=_0x23e1a5[_0x6b89('0x6')]||'';this['token']=_0x23e1a5[_0x6b89('0x7')]||'';this[_0x6b89('0x8')]=_0x23e1a5[_0x6b89('0x8')]||'';this[_0x6b89('0x9')]=_0x23e1a5[_0x6b89('0x9')]||'';this['serverUrl']=_0x23e1a5[_0x6b89('0xa')]||'';this[_0x6b89('0xb')]=_0x23e1a5[_0x6b89('0xb')]||{};}module[_0x6b89('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 2b14d31..1b3a979 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 _0x9176=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name','username'];(function(_0x3dedad,_0x435b1f){var _0x5470ba=function(_0x9268c4){while(--_0x9268c4){_0x3dedad['push'](_0x3dedad['shift']());}};_0x5470ba(++_0x435b1f);}(_0x9176,0x142));var _0x6917=function(_0x576363,_0x128737){_0x576363=_0x576363-0x0;var _0xba659d=_0x9176[_0x576363];return _0xba659d;};'use strict';function Dynamics365Account(_0xa2c2){this['id']=_0xa2c2['id']||0x0;this[_0x6917('0x0')]=_0xa2c2['name']||'';this[_0x6917('0x1')]=_0xa2c2[_0x6917('0x1')]||'';this[_0x6917('0x2')]=_0xa2c2['password']||'';this['remoteUri']=_0xa2c2[_0x6917('0x3')]||'';this[_0x6917('0x4')]=_0xa2c2[_0x6917('0x4')]||'';this[_0x6917('0x5')]=_0xa2c2[_0x6917('0x5')]||'';this[_0x6917('0x6')]=_0xa2c2['clientSecret']||{};this[_0x6917('0x7')]=_0xa2c2[_0x6917('0x7')]||'';this[_0x6917('0x8')]=_0xa2c2[_0x6917('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xab04=['exports','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x39bf21,_0x5c2e3f){var _0x19c6e9=function(_0xe79045){while(--_0xe79045){_0x39bf21['push'](_0x39bf21['shift']());}};_0x19c6e9(++_0x5c2e3f);}(_0xab04,0x1cc));var _0x4ab0=function(_0x153844,_0x37a9b9){_0x153844=_0x153844-0x0;var _0x4207d0=_0xab04[_0x153844];return _0x4207d0;};'use strict';function Dynamics365Account(_0x5e5a57){this['id']=_0x5e5a57['id']||0x0;this[_0x4ab0('0x0')]=_0x5e5a57[_0x4ab0('0x0')]||'';this['username']=_0x5e5a57['username']||'';this[_0x4ab0('0x1')]=_0x5e5a57[_0x4ab0('0x1')]||'';this[_0x4ab0('0x2')]=_0x5e5a57[_0x4ab0('0x2')]||'';this[_0x4ab0('0x3')]=_0x5e5a57[_0x4ab0('0x3')]||'';this[_0x4ab0('0x4')]=_0x5e5a57[_0x4ab0('0x4')]||'';this[_0x4ab0('0x5')]=_0x5e5a57[_0x4ab0('0x5')]||{};this[_0x4ab0('0x6')]=_0x5e5a57['serverUrl']||'';this['Configurations']=_0x5e5a57[_0x4ab0('0x7')]||{};}module[_0x4ab0('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index ce647a0..4e252fe 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 _0xc368=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','tech','Trunk'];(function(_0x3363ae,_0x5c3f3f){var _0x2bc795=function(_0xd9803c){while(--_0xd9803c){_0x3363ae['push'](_0x3363ae['shift']());}};_0x2bc795(++_0x5c3f3f);}(_0xc368,0x7b));var _0x8c36=function(_0x3bccbe,_0xf18bd8){_0x3bccbe=_0x3bccbe-0x0;var _0x299bff=_0xc368[_0x3bccbe];return _0x299bff;};'use strict';function FaxAccount(_0x49b9d5){this['id']=_0x49b9d5['id']||0x0;this[_0x8c36('0x0')]=_0x49b9d5['name']||'';this[_0x8c36('0x1')]=_0x49b9d5[_0x8c36('0x1')];this[_0x8c36('0x2')]=_0x49b9d5[_0x8c36('0x2')];this[_0x8c36('0x3')]=_0x49b9d5['headerinfo'];this[_0x8c36('0x4')]=_0x49b9d5[_0x8c36('0x4')];this[_0x8c36('0x5')]=_0x49b9d5[_0x8c36('0x5')]||0x960;this['maxrate']=_0x49b9d5['maxrate']||0x3840;this[_0x8c36('0x6')]=_0x49b9d5[_0x8c36('0x6')]||_0x8c36('0x7');this[_0x8c36('0x8')]=_0x49b9d5[_0x8c36('0x8')]||'no';this[_0x8c36('0x9')]=_0x49b9d5['faxdetect']||'no';this['t38timeout']=_0x49b9d5['t38timeout']||0x1388;this[_0x8c36('0xa')]=_0x49b9d5[_0x8c36('0xa')]||'SIP';this[_0x8c36('0xb')]=_0x49b9d5[_0x8c36('0xb')]?_0x49b9d5[_0x8c36('0xb')]:undefined;this[_0x8c36('0xc')]=_0x49b9d5[_0x8c36('0xc')];this[_0x8c36('0xd')]=_0x49b9d5[_0x8c36('0xd')];}module[_0x8c36('0xe')]=FaxAccount; \ No newline at end of file +var _0xc6d8=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','localstationid','minrate','maxrate'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0xc6d8[_0x6c59fc];return _0x17c96f;};'use strict';function FaxAccount(_0x55520c){this['id']=_0x55520c['id']||0x0;this['name']=_0x55520c[_0x8c6d('0x0')]||'';this['description']=_0x55520c[_0x8c6d('0x1')];this['ecm']=_0x55520c[_0x8c6d('0x2')];this['headerinfo']=_0x55520c['headerinfo'];this[_0x8c6d('0x3')]=_0x55520c[_0x8c6d('0x3')];this[_0x8c6d('0x4')]=_0x55520c[_0x8c6d('0x4')]||0x960;this[_0x8c6d('0x5')]=_0x55520c[_0x8c6d('0x5')]||0x3840;this[_0x8c6d('0x6')]=_0x55520c['modem']||_0x8c6d('0x7');this[_0x8c6d('0x8')]=_0x55520c[_0x8c6d('0x8')]||'no';this['faxdetect']=_0x55520c[_0x8c6d('0x9')]||'no';this[_0x8c6d('0xa')]=_0x55520c[_0x8c6d('0xa')]||0x1388;this[_0x8c6d('0xb')]=_0x55520c[_0x8c6d('0xb')]||_0x8c6d('0xc');this[_0x8c6d('0xd')]=_0x55520c[_0x8c6d('0xd')]?_0x55520c['Trunk']:undefined;this[_0x8c6d('0xe')]=_0x55520c['ListId'];this['key']=_0x55520c[_0x8c6d('0xf')];}module[_0x8c6d('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d0cfd57..fee508c 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 _0xb9c8=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x21a631,_0x398195){var _0x26ab28=function(_0x4aaa20){while(--_0x4aaa20){_0x21a631['push'](_0x21a631['shift']());}};_0x26ab28(++_0x398195);}(_0xb9c8,0xa0));var _0x8b9c=function(_0x5427c8,_0x18f384){_0x5427c8=_0x5427c8-0x0;var _0x33a129=_0xb9c8[_0x5427c8];return _0x33a129;};'use strict';function FreshdeskAccount(_0x39fd9d){this['id']=_0x39fd9d['id']||0x0;this[_0x8b9c('0x0')]=_0x39fd9d[_0x8b9c('0x0')]||'';this[_0x8b9c('0x1')]=_0x39fd9d[_0x8b9c('0x1')]||'';this[_0x8b9c('0x2')]=_0x39fd9d[_0x8b9c('0x3')]||'';this[_0x8b9c('0x4')]=_0x39fd9d[_0x8b9c('0x4')]||'';this[_0x8b9c('0x5')]=_0x39fd9d[_0x8b9c('0x5')]||'';this[_0x8b9c('0x6')]=_0x39fd9d[_0x8b9c('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x937d=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x937d,0xd2));var _0xd937=function(_0x11bcaa,_0x37173a){_0x11bcaa=_0x11bcaa-0x0;var _0x325ff4=_0x937d[_0x11bcaa];return _0x325ff4;};'use strict';function FreshdeskAccount(_0x4894a3){this['id']=_0x4894a3['id']||0x0;this[_0xd937('0x0')]=_0x4894a3[_0xd937('0x0')]||'';this[_0xd937('0x1')]=_0x4894a3[_0xd937('0x1')]||'';this[_0xd937('0x2')]=_0x4894a3['token']||'';this['remoteUri']=_0x4894a3[_0xd937('0x3')]||'';this[_0xd937('0x4')]=_0x4894a3['serverUrl']||'';this['Configurations']=_0x4894a3[_0xd937('0x5')]||{};}module[_0xd937('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c417366..77ee2e7 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 _0x2abb=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2abb,0x1d8));var _0xb2ab=function(_0x1d8858,_0x34add7){_0x1d8858=_0x1d8858-0x0;var _0x498308=_0x2abb[_0x1d8858];return _0x498308;};'use strict';function QueueReport(){this[_0xb2ab('0x0')]=_0xb2ab('0x1');this['uniqueid']='';this[_0xb2ab('0x2')]='';this[_0xb2ab('0x3')]='';this['queue']='';this[_0xb2ab('0x4')]=null;this[_0xb2ab('0x5')]=null;this['position']=0x1;this['count']=0x1;this[_0xb2ab('0x6')]=![];this[_0xb2ab('0x7')]=null;this[_0xb2ab('0x8')]=![];this[_0xb2ab('0x9')]=null;this[_0xb2ab('0xa')]=![];this[_0xb2ab('0xb')]=null;this['originalposition']=0x1;this[_0xb2ab('0xc')]='';this[_0xb2ab('0xd')]='';this[_0xb2ab('0xe')]='';this[_0xb2ab('0xf')]='';this[_0xb2ab('0x10')]='';this[_0xb2ab('0x11')]='';this[_0xb2ab('0x12')]='';this[_0xb2ab('0x13')]=0x0;this[_0xb2ab('0x14')]=![];this['lastAssignedTo']='';this[_0xb2ab('0x15')]=0x0;this[_0xb2ab('0x16')]={};}module[_0xb2ab('0x17')]=QueueReport; \ No newline at end of file +var _0x049b=['context','exten','holdtime','variables','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x049b,0xc1));var _0xb049=function(_0x196b29,_0x5a4915){_0x196b29=_0x196b29-0x0;var _0x432ae1=_0x049b[_0x196b29];return _0x432ae1;};'use strict';function QueueReport(){this['type']=_0xb049('0x0');this[_0xb049('0x1')]='';this[_0xb049('0x2')]='';this[_0xb049('0x3')]='';this[_0xb049('0x4')]='';this[_0xb049('0x5')]=null;this[_0xb049('0x6')]=null;this[_0xb049('0x7')]=0x1;this[_0xb049('0x8')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xb049('0x9')]=![];this[_0xb049('0xa')]=null;this[_0xb049('0xb')]=![];this[_0xb049('0xc')]=null;this[_0xb049('0xd')]=0x1;this[_0xb049('0xe')]='';this[_0xb049('0xf')]='';this[_0xb049('0x10')]='';this['accountcode']='';this[_0xb049('0x11')]='';this[_0xb049('0x12')]='';this['priority']='';this[_0xb049('0x13')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this['mohtime']=0x0;this[_0xb049('0x14')]={};}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 0ee3562..7b04e91 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 _0x12af=['securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x4c8276,_0x3ed888){var _0x17524f=function(_0x4307a2){while(--_0x4307a2){_0x4c8276['push'](_0x4c8276['shift']());}};_0x17524f(++_0x3ed888);}(_0x12af,0x123));var _0xf12a=function(_0x28d2e5,_0x30179f){_0x28d2e5=_0x28d2e5-0x0;var _0x19372b=_0x12af[_0x28d2e5];return _0x19372b;};'use strict';function SalesforceAccount(_0x295567){this['id']=_0x295567['id']||0x0;this[_0xf12a('0x0')]=_0x295567['name']||'';this[_0xf12a('0x1')]=_0x295567[_0xf12a('0x1')]||'';this[_0xf12a('0x2')]=_0x295567[_0xf12a('0x2')]||'';this[_0xf12a('0x3')]=_0x295567[_0xf12a('0x3')]||'';this[_0xf12a('0x4')]=_0x295567[_0xf12a('0x4')]||'';this['clientSecret']=_0x295567[_0xf12a('0x5')]||'';this[_0xf12a('0x6')]=_0x295567['securityToken']||'';this[_0xf12a('0x7')]=_0x295567[_0xf12a('0x7')]||'integrationTab';this[_0xf12a('0x8')]=_0x295567[_0xf12a('0x8')]||'';this['Configurations']=_0x295567[_0xf12a('0x9')]||{};}module[_0xf12a('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x2e38=['securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x236906,_0x1c2803){var _0x21199e=function(_0x5eb347){while(--_0x5eb347){_0x236906['push'](_0x236906['shift']());}};_0x21199e(++_0x1c2803);}(_0x2e38,0x68));var _0x82e3=function(_0x4ad3f5,_0x554e00){_0x4ad3f5=_0x4ad3f5-0x0;var _0x535e59=_0x2e38[_0x4ad3f5];return _0x535e59;};'use strict';function SalesforceAccount(_0x415cc2){this['id']=_0x415cc2['id']||0x0;this[_0x82e3('0x0')]=_0x415cc2[_0x82e3('0x0')]||'';this[_0x82e3('0x1')]=_0x415cc2[_0x82e3('0x1')]||'';this[_0x82e3('0x2')]=_0x415cc2[_0x82e3('0x2')]||'';this[_0x82e3('0x3')]=_0x415cc2[_0x82e3('0x3')]||'';this['clientId']=_0x415cc2[_0x82e3('0x4')]||'';this['clientSecret']=_0x415cc2[_0x82e3('0x5')]||'';this[_0x82e3('0x6')]=_0x415cc2[_0x82e3('0x6')]||'';this['type']=_0x415cc2[_0x82e3('0x7')]||_0x82e3('0x8');this[_0x82e3('0x9')]=_0x415cc2['serverUrl']||'';this[_0x82e3('0xa')]=_0x415cc2[_0x82e3('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 59634ac..e8f80a8 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 _0x8a99=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4ef226,_0x1ffd4d){var _0x4a20f4=function(_0x4934bd){while(--_0x4934bd){_0x4ef226['push'](_0x4ef226['shift']());}};_0x4a20f4(++_0x1ffd4d);}(_0x8a99,0x18e));var _0x98a9=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x8a99[_0x1a9204];return _0x17ca68;};'use strict';function ServicenowAccount(_0x275df6){this['id']=_0x275df6['id']||0x0;this[_0x98a9('0x0')]=_0x275df6['name']||'';this[_0x98a9('0x1')]=_0x275df6[_0x98a9('0x1')]||'';this[_0x98a9('0x2')]=_0x275df6[_0x98a9('0x2')]||'';this[_0x98a9('0x3')]=_0x275df6['remoteUri']||'';this[_0x98a9('0x4')]=_0x275df6['serverUrl']||'';this[_0x98a9('0x5')]=_0x275df6['Configurations']||{};}module[_0x98a9('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x1e3b=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x13e01a,_0x103f66){var _0x3ac654=function(_0x569233){while(--_0x569233){_0x13e01a['push'](_0x13e01a['shift']());}};_0x3ac654(++_0x103f66);}(_0x1e3b,0x1e7));var _0xb1e3=function(_0x29e457,_0x5891b8){_0x29e457=_0x29e457-0x0;var _0x357c9e=_0x1e3b[_0x29e457];return _0x357c9e;};'use strict';function ServicenowAccount(_0x476e3d){this['id']=_0x476e3d['id']||0x0;this[_0xb1e3('0x0')]=_0x476e3d[_0xb1e3('0x0')]||'';this['username']=_0x476e3d[_0xb1e3('0x1')]||'';this[_0xb1e3('0x2')]=_0x476e3d['password']||'';this['remoteUri']=_0x476e3d[_0xb1e3('0x3')]||'';this[_0xb1e3('0x4')]=_0x476e3d['serverUrl']||'';this[_0xb1e3('0x5')]=_0x476e3d[_0xb1e3('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index ddd8de3..56a677e 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 _0x664f=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x26883d,_0x368e9e){var _0x22a429=function(_0x128b1f){while(--_0x128b1f){_0x26883d['push'](_0x26883d['shift']());}};_0x22a429(++_0x368e9e);}(_0x664f,0xa7));var _0xf664=function(_0x5599aa,_0x1b9ffe){_0x5599aa=_0x5599aa-0x0;var _0x4b0f34=_0x664f[_0x5599aa];return _0x4b0f34;};'use strict';function SugarcrmAccount(_0x3c59e8){this['id']=_0x3c59e8['id']||0x0;this['name']=_0x3c59e8[_0xf664('0x0')]||'';this[_0xf664('0x1')]=_0x3c59e8[_0xf664('0x1')]||'';this[_0xf664('0x2')]=_0x3c59e8['password']||'';this[_0xf664('0x3')]=_0x3c59e8[_0xf664('0x3')]||'';this[_0xf664('0x4')]=_0x3c59e8[_0xf664('0x4')]||'';this[_0xf664('0x5')]=_0x3c59e8[_0xf664('0x5')]||{};}module[_0xf664('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x3ee1=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x119eee,_0x22bfaf){var _0x51c813=function(_0x4d7ad4){while(--_0x4d7ad4){_0x119eee['push'](_0x119eee['shift']());}};_0x51c813(++_0x22bfaf);}(_0x3ee1,0x91));var _0x13ee=function(_0x4809e8,_0x4276b5){_0x4809e8=_0x4809e8-0x0;var _0x3d3e60=_0x3ee1[_0x4809e8];return _0x3d3e60;};'use strict';function SugarcrmAccount(_0x496d55){this['id']=_0x496d55['id']||0x0;this[_0x13ee('0x0')]=_0x496d55[_0x13ee('0x0')]||'';this['username']=_0x496d55[_0x13ee('0x1')]||'';this['password']=_0x496d55[_0x13ee('0x2')]||'';this['remoteUri']=_0x496d55[_0x13ee('0x3')]||'';this['serverUrl']=_0x496d55[_0x13ee('0x4')]||'';this['Configurations']=_0x496d55[_0x13ee('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 ec455ca..772ac87 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 _0x2b1c=['stateTime','exports','name','accountcode','state','unknown'];(function(_0x126050,_0x4d676b){var _0x4aa0f5=function(_0x2407a7){while(--_0x2407a7){_0x126050['push'](_0x126050['shift']());}};_0x4aa0f5(++_0x4d676b);}(_0x2b1c,0x6e));var _0xc2b1=function(_0x16a8af,_0x3864d2){_0x16a8af=_0x16a8af-0x0;var _0x495c50=_0x2b1c[_0x16a8af];return _0x495c50;};'use strict';function Telephone(_0x23abe4){this['id']=_0x23abe4['id']||0x0;this[_0xc2b1('0x0')]=_0x23abe4[_0xc2b1('0x0')]||'';this[_0xc2b1('0x1')]=_0x23abe4[_0xc2b1('0x1')]||'';this[_0xc2b1('0x2')]=_0xc2b1('0x3');this[_0xc2b1('0x4')]=0x0;this['status']='unknown';this['address']='';}module[_0xc2b1('0x5')]=Telephone; \ No newline at end of file +var _0xe10c=['address','exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x5356da,_0x2e4df2){var _0xa81bc0=function(_0xd366a0){while(--_0xd366a0){_0x5356da['push'](_0x5356da['shift']());}};_0xa81bc0(++_0x2e4df2);}(_0xe10c,0x72));var _0xce10=function(_0x59ec54,_0x208ba6){_0x59ec54=_0x59ec54-0x0;var _0x1a89f8=_0xe10c[_0x59ec54];return _0x1a89f8;};'use strict';function Telephone(_0x3495e5){this['id']=_0x3495e5['id']||0x0;this[_0xce10('0x0')]=_0x3495e5[_0xce10('0x0')]||'';this[_0xce10('0x1')]=_0x3495e5[_0xce10('0x1')]||'';this[_0xce10('0x2')]=_0xce10('0x3');this[_0xce10('0x4')]=0x0;this[_0xce10('0x5')]=_0xce10('0x3');this[_0xce10('0x6')]='';}module[_0xce10('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 6fc5b0e..4857881 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 _0x5ff3=['name','html','exports'];(function(_0x158e99,_0x49423b){var _0x18ad93=function(_0x4e2847){while(--_0x4e2847){_0x158e99['push'](_0x158e99['shift']());}};_0x18ad93(++_0x49423b);}(_0x5ff3,0x17d));var _0x35ff=function(_0x5beab7,_0x14d985){_0x5beab7=_0x5beab7-0x0;var _0x18d02e=_0x5ff3[_0x5beab7];return _0x18d02e;};'use strict';function template(_0x2fc021){this['id']=_0x2fc021['id']||0x0;this[_0x35ff('0x0')]=_0x2fc021['name']||'';this[_0x35ff('0x1')]=_0x2fc021['html']||'';}module[_0x35ff('0x2')]=template; \ No newline at end of file +var _0x6737=['exports','name','html'];(function(_0x388015,_0x175483){var _0x398b27=function(_0x213f32){while(--_0x213f32){_0x388015['push'](_0x388015['shift']());}};_0x398b27(++_0x175483);}(_0x6737,0xe2));var _0x7673=function(_0x2b1296,_0x6f0969){_0x2b1296=_0x2b1296-0x0;var _0xebbc1b=_0x6737[_0x2b1296];return _0xebbc1b;};'use strict';function template(_0x343312){this['id']=_0x343312['id']||0x0;this[_0x7673('0x0')]=_0x343312[_0x7673('0x0')]||'';this['html']=_0x343312[_0x7673('0x1')]||'';}module[_0x7673('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 6e3b5c5..5b843fd 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 _0xf0c9=['name','channel','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x5cdce2,_0x5d70ba){var _0x38b366=function(_0x50dd66){while(--_0x50dd66){_0x5cdce2['push'](_0x5cdce2['shift']());}};_0x38b366(++_0x5d70ba);}(_0xf0c9,0x1ab));var _0x9f0c=function(_0x441e18,_0x2a4780){_0x441e18=_0x441e18-0x0;var _0x4adf21=_0xf0c9[_0x441e18];return _0x4adf21;};'use strict';function Trigger(_0xafa89d){this['id']=_0xafa89d['id']||0x0;this[_0x9f0c('0x0')]=_0xafa89d[_0x9f0c('0x0')]||'';this[_0x9f0c('0x1')]=_0xafa89d[_0x9f0c('0x1')]||'voice';this[_0x9f0c('0x2')]=_0xafa89d[_0x9f0c('0x2')]||![];this[_0x9f0c('0x3')]=_0xafa89d[_0x9f0c('0x3')]||[];this['AnyConditions']=_0xafa89d[_0x9f0c('0x4')]||[];this[_0x9f0c('0x5')]=_0xafa89d[_0x9f0c('0x5')]||[];}module[_0x9f0c('0x6')]=Trigger; \ No newline at end of file +var _0x8efd=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x5d93db,_0x252289){var _0x5937f0=function(_0x5e39c1){while(--_0x5e39c1){_0x5d93db['push'](_0x5d93db['shift']());}};_0x5937f0(++_0x252289);}(_0x8efd,0x15b));var _0xd8ef=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8efd[_0x4b055c];return _0x4b62bb;};'use strict';function Trigger(_0x190046){this['id']=_0x190046['id']||0x0;this[_0xd8ef('0x0')]=_0x190046[_0xd8ef('0x0')]||'';this[_0xd8ef('0x1')]=_0x190046[_0xd8ef('0x1')]||'voice';this[_0xd8ef('0x2')]=_0x190046[_0xd8ef('0x2')]||![];this['AllConditions']=_0x190046[_0xd8ef('0x3')]||[];this[_0xd8ef('0x4')]=_0x190046[_0xd8ef('0x4')]||[];this[_0xd8ef('0x5')]=_0x190046[_0xd8ef('0x5')]||[];}module[_0xd8ef('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 397c409..d6dae07 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 _0xe749=['state','unknown','stateTime','status','registry','indexOf','split','port','domain','domainport','refresh','stateRegistry','address','active'];(function(_0x12fdd0,_0x4d6143){var _0x50f1de=function(_0x5ef886){while(--_0x5ef886){_0x12fdd0['push'](_0x12fdd0['shift']());}};_0x50f1de(++_0x4d6143);}(_0xe749,0x8b));var _0x9e74=function(_0x5d29f3,_0x41f133){_0x5d29f3=_0x5d29f3-0x0;var _0x338a80=_0xe749[_0x5d29f3];return _0x338a80;};'use strict';function Trunk(_0xf58461){this['id']=_0xf58461['id']||0x0;this[_0x9e74('0x0')]=_0xf58461[_0x9e74('0x0')]||![];this['name']=_0xf58461['name']||'';this[_0x9e74('0x1')]=_0x9e74('0x2');this[_0x9e74('0x3')]=0x0;this[_0x9e74('0x4')]='unknown';this[_0x9e74('0x5')]=_0xf58461['registry']&&_0xf58461[_0x9e74('0x5')][_0x9e74('0x6')](':')?_0xf58461[_0x9e74('0x5')][_0x9e74('0x7')](':')[0x0]:'';this['host']='';this[_0x9e74('0x8')]='';this[_0x9e74('0x9')]='';this[_0x9e74('0xa')]='';this[_0x9e74('0xb')]='';this[_0x9e74('0xc')]=_0x9e74('0x2');this['registrationtime']='';this[_0x9e74('0xd')]='';}module['exports']=Trunk; \ No newline at end of file +var _0xca85=['indexOf','host','port','domain','domainport','stateRegistry','address','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xca85,0x80));var _0x5ca8=function(_0x414cbe,_0x16a463){_0x414cbe=_0x414cbe-0x0;var _0x2793fe=_0xca85[_0x414cbe];return _0x2793fe;};'use strict';function Trunk(_0x286424){this['id']=_0x286424['id']||0x0;this[_0x5ca8('0x0')]=_0x286424['active']||![];this[_0x5ca8('0x1')]=_0x286424[_0x5ca8('0x1')]||'';this[_0x5ca8('0x2')]=_0x5ca8('0x3');this[_0x5ca8('0x4')]=0x0;this[_0x5ca8('0x5')]=_0x5ca8('0x3');this[_0x5ca8('0x6')]=_0x286424[_0x5ca8('0x6')]&&_0x286424[_0x5ca8('0x6')][_0x5ca8('0x7')](':')?_0x286424[_0x5ca8('0x6')]['split'](':')[0x0]:'';this[_0x5ca8('0x8')]='';this[_0x5ca8('0x9')]='';this[_0x5ca8('0xa')]='';this[_0x5ca8('0xb')]='';this['refresh']='';this[_0x5ca8('0xc')]=_0x5ca8('0x3');this['registrationtime']='';this[_0x5ca8('0xd')]='';}module[_0x5ca8('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 96220c2..c96dd5c 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 _0x8126=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x5159af,_0x3ab20e){var _0x5a729e=function(_0x4de433){while(--_0x4de433){_0x5159af['push'](_0x5159af['shift']());}};_0x5a729e(++_0x3ab20e);}(_0x8126,0x127));var _0x6812=function(_0x121709,_0xf73b35){_0x121709=_0x121709-0x0;var _0x36bec9=_0x8126[_0x121709];return _0x36bec9;};'use strict';function voiceExtension(_0x4970e1){this['id']=_0x4970e1['id']||0x0;this['exten']=_0x4970e1[_0x6812('0x0')]||'';this[_0x6812('0x1')]=_0x4970e1['recordingFormat']||'none';this[_0x6812('0x2')]=_0x4970e1[_0x6812('0x2')]||![];}module[_0x6812('0x3')]=voiceExtension; \ No newline at end of file +var _0xf12d=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x5250a0,_0x324f16){var _0xc2753f=function(_0x339d2c){while(--_0x339d2c){_0x5250a0['push'](_0x5250a0['shift']());}};_0xc2753f(++_0x324f16);}(_0xf12d,0x1e8));var _0xdf12=function(_0xc3d2e1,_0xc59f8){_0xc3d2e1=_0xc3d2e1-0x0;var _0x565073=_0xf12d[_0xc3d2e1];return _0x565073;};'use strict';function voiceExtension(_0x50e402){this['id']=_0x50e402['id']||0x0;this[_0xdf12('0x0')]=_0x50e402[_0xdf12('0x0')]||'';this[_0xdf12('0x1')]=_0x50e402[_0xdf12('0x1')]||'none';this[_0xdf12('0x2')]=_0x50e402[_0xdf12('0x2')]||![];}module[_0xdf12('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 569b929..56995e3 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 _0x2fc1=['message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','name','monitor_format','inbound','waiting','talking','total','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive'];(function(_0x560e89,_0x21822a){var _0x59704a=function(_0x3b265a){while(--_0x3b265a){_0x560e89['push'](_0x560e89['shift']());}};_0x59704a(++_0x21822a);}(_0x2fc1,0xbb));var _0x12fc=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2fc1[_0x2c91e9];return _0x13f0ff;};'use strict';var statusDesc=['unknown',_0x12fc('0x0'),'inuse',_0x12fc('0x1'),_0x12fc('0x2'),_0x12fc('0x3'),_0x12fc('0x4'),_0x12fc('0x5'),_0x12fc('0x6')];var monitorFormat={'wav':_0x12fc('0x7'),'wav49':_0x12fc('0x8'),'gsm':_0x12fc('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x14e3e3){this['id']=_0x14e3e3['id']||0x0;this['name']=_0x14e3e3[_0x12fc('0xa')]||'';this['monitor_format']=_0x14e3e3[_0x12fc('0xb')]||'';this['type']=_0x14e3e3['type']||_0x12fc('0xc');this[_0x12fc('0xd')]=0x0;this[_0x12fc('0xe')]=0x0;this[_0x12fc('0xf')]=0x0;this['answered']=0x0;this[_0x12fc('0x10')]=0x0;this[_0x12fc('0x11')]=0x0;this['sumBillable']=0x0;this[_0x12fc('0x12')]=0x0;this[_0x12fc('0x13')]=0x0;this[_0x12fc('0x14')]=0x0;this['available']=0x0;this[_0x12fc('0x15')]=_0x14e3e3[_0x12fc('0x15')]||![];this[_0x12fc('0x16')]=_0x14e3e3[_0x12fc('0x16')]||0xa;this['autopause']=_0x14e3e3[_0x12fc('0x17')]||'no';this[_0x12fc('0x18')]=!![];this[_0x12fc('0x19')]='';this[_0x12fc('0x1a')]=0x0;this['temp']=0x0;this[_0x12fc('0x1b')]=_0x14e3e3[_0x12fc('0x1b')]||null;this[_0x12fc('0x1c')]=_0x14e3e3['dialGlobalInterval']?_0x14e3e3['dialGlobalInterval']:null;this[_0x12fc('0x1d')]=_0x14e3e3[_0x12fc('0x1d')];this[_0x12fc('0x1e')]=_0x14e3e3[_0x12fc('0x1e')]||_0x12fc('0x1f');this[_0x12fc('0x20')]=_0x14e3e3[_0x12fc('0x20')]||0x0;this[_0x12fc('0x21')]=_0x14e3e3[_0x12fc('0x21')]||0x0;this[_0x12fc('0x22')]=_0x14e3e3[_0x12fc('0x22')]||0x1;this[_0x12fc('0x23')]=_0x14e3e3[_0x12fc('0x23')]||_0x12fc('0x24');this[_0x12fc('0x25')]=_0x14e3e3[_0x12fc('0x25')]||0.03;this[_0x12fc('0x26')]=_0x14e3e3[_0x12fc('0x26')]||0x258;this[_0x12fc('0x27')]=_0x14e3e3['dialOriginateCallerIdName']||'anonymous';this[_0x12fc('0x28')]=_0x14e3e3['dialOriginateCallerIdNumber']||_0x12fc('0x29');this['dialOriginateTimeout']=_0x14e3e3['dialOriginateTimeout']||0x1e;this[_0x12fc('0x2a')]=_0x14e3e3[_0x12fc('0x2a')]||_0x12fc('0x2b');this[_0x12fc('0x2c')]=_0x14e3e3[_0x12fc('0x2c')]||0x3;this[_0x12fc('0x2d')]=_0x14e3e3['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x14e3e3[_0x12fc('0x2e')]||0x3;this[_0x12fc('0x2f')]=_0x14e3e3[_0x12fc('0x2f')]||0x96;this[_0x12fc('0x30')]=_0x14e3e3['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x14e3e3['dialBusyRetryFrequency']||0x96;this[_0x12fc('0x31')]=_0x14e3e3[_0x12fc('0x31')]||0x3;this[_0x12fc('0x32')]=_0x14e3e3[_0x12fc('0x32')]||0x96;this[_0x12fc('0x33')]=_0x14e3e3['dialGlobalMaxRetry']||0x4;this[_0x12fc('0x34')]=_0x14e3e3[_0x12fc('0x34')]?_0x14e3e3['Trunk']:undefined;this[_0x12fc('0x35')]=_0x14e3e3[_0x12fc('0x35')]?_0x14e3e3[_0x12fc('0x35')]:undefined;this['dialPrefix']=_0x14e3e3[_0x12fc('0x36')]||undefined;this['Interval']=_0x14e3e3['Interval']?_0x14e3e3[_0x12fc('0x37')]:undefined;this[_0x12fc('0x38')]=_0x14e3e3[_0x12fc('0x38')]||_0x12fc('0x39');this[_0x12fc('0x3a')]=_0x14e3e3[_0x12fc('0x3a')]||undefined;this[_0x12fc('0x3b')]=_0x14e3e3[_0x12fc('0x3b')]||undefined;this[_0x12fc('0x3c')]=strategy[_0x14e3e3[_0x12fc('0x3c')]]||_0x12fc('0x3d');this[_0x12fc('0x3e')]=!![];this[_0x12fc('0x3f')]=_0x14e3e3[_0x12fc('0x3f')]||![];this[_0x12fc('0x40')]=_0x14e3e3[_0x12fc('0x40')];this[_0x12fc('0x41')]=_0x14e3e3[_0x12fc('0x41')];this[_0x12fc('0x42')]=_0x14e3e3[_0x12fc('0x42')];this[_0x12fc('0x43')]=_0x14e3e3['dialAMDTotalAnalysisTime'];this[_0x12fc('0x44')]=_0x14e3e3['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x14e3e3[_0x12fc('0x45')];this[_0x12fc('0x46')]=_0x14e3e3[_0x12fc('0x46')];this[_0x12fc('0x47')]=_0x14e3e3['dialAMDSilenceThreshold'];this[_0x12fc('0x48')]=_0x14e3e3[_0x12fc('0x48')];this[_0x12fc('0x49')]=0x0;this[_0x12fc('0x4a')]=0x0;this[_0x12fc('0x4b')]=_0x14e3e3[_0x12fc('0x4b')];this[_0x12fc('0x4c')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x12fc('0x4d')]=0x0;this[_0x12fc('0x4e')]=0x0;this[_0x12fc('0x4f')]=0x0;this[_0x12fc('0x50')]=0x0;this[_0x12fc('0x51')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x12fc('0x52')]=0x0;this[_0x12fc('0x53')]=0x0;this['outboundReCallsDay']=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x12fc('0x54')]=0x0;this[_0x12fc('0x55')]=0x0;this[_0x12fc('0x56')]=0x0;this[_0x12fc('0x57')]=0x0;this[_0x12fc('0x58')]=0x0;this[_0x12fc('0x59')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x12fc('0x5a')]=0x0;this[_0x12fc('0x5b')]=_0x14e3e3[_0x12fc('0x5c')]||0x14;this[_0x12fc('0x5d')]=_0x14e3e3[_0x12fc('0x5c')]||0xa;this[_0x12fc('0x5e')]=0x0;this[_0x12fc('0x5f')]=0x0;this[_0x12fc('0x60')]=0x1;this[_0x12fc('0x61')]=0x0;this[_0x12fc('0x62')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x12fc('0x63')]=0x0;this['dialRecallMeTimeout']=_0x14e3e3['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x14e3e3[_0x12fc('0x64')]||![];this[_0x12fc('0x65')]=_0x14e3e3[_0x12fc('0x65')]||undefined;this['dialAgiAfterHangupClient']=_0x14e3e3['dialAgiAfterHangupClient']||![];this[_0x12fc('0x66')]=_0x14e3e3[_0x12fc('0x66')]||![];this['monitor_format']=monitorFormat[_0x14e3e3['monitor_format']]?monitorFormat[_0x14e3e3[_0x12fc('0xb')]]:undefined;this['mandatoryDisposition']=_0x14e3e3[_0x12fc('0x67')]||![];this[_0x12fc('0x68')]=_0x14e3e3[_0x12fc('0x68')]?_0x14e3e3['mandatoryDispositionPause']:undefined;}module[_0x12fc('0x69')]=VoiceQueue; \ No newline at end of file +var _0xa43a=['message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','wav','wav49','gsm','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive'];(function(_0x285d34,_0x42dd2d){var _0x59e21d=function(_0x386777){while(--_0x386777){_0x285d34['push'](_0x285d34['shift']());}};_0x59e21d(++_0x42dd2d);}(_0xa43a,0x1a2));var _0xaa43=function(_0x5c3dfe,_0x9f42e9){_0x5c3dfe=_0x5c3dfe-0x0;var _0x433cca=_0xa43a[_0x5c3dfe];return _0x433cca;};'use strict';var statusDesc=[_0xaa43('0x0'),_0xaa43('0x1'),_0xaa43('0x2'),'busy',_0xaa43('0x3'),_0xaa43('0x4'),'ringing',_0xaa43('0x5'),'onhold'];var monitorFormat={'wav':_0xaa43('0x6'),'wav49':_0xaa43('0x7'),'gsm':_0xaa43('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x60a790){this['id']=_0x60a790['id']||0x0;this[_0xaa43('0x9')]=_0x60a790['name']||'';this[_0xaa43('0xa')]=_0x60a790[_0xaa43('0xa')]||'';this[_0xaa43('0xb')]=_0x60a790['type']||_0xaa43('0xc');this[_0xaa43('0xd')]=0x0;this['talking']=0x0;this[_0xaa43('0xe')]=0x0;this[_0xaa43('0xf')]=0x0;this[_0xaa43('0x10')]=0x0;this[_0xaa43('0x11')]=0x0;this[_0xaa43('0x12')]=0x0;this[_0xaa43('0x13')]=0x0;this[_0xaa43('0x14')]=0x0;this[_0xaa43('0x15')]=0x0;this['available']=0x0;this[_0xaa43('0x16')]=_0x60a790[_0xaa43('0x16')]||![];this[_0xaa43('0x17')]=_0x60a790[_0xaa43('0x17')]||0xa;this['autopause']=_0x60a790[_0xaa43('0x18')]||'no';this[_0xaa43('0x19')]=!![];this[_0xaa43('0x1a')]='';this[_0xaa43('0x1b')]=0x0;this[_0xaa43('0x1c')]=0x0;this[_0xaa43('0x1d')]=_0x60a790[_0xaa43('0x1d')]||null;this[_0xaa43('0x1e')]=_0x60a790[_0xaa43('0x1e')]?_0x60a790['dialGlobalInterval']:null;this[_0xaa43('0x1f')]=_0x60a790[_0xaa43('0x1f')];this[_0xaa43('0x20')]=_0x60a790[_0xaa43('0x20')]||_0xaa43('0x21');this[_0xaa43('0x22')]=_0x60a790[_0xaa43('0x22')]||0x0;this[_0xaa43('0x23')]=_0x60a790['dialLimitQueue']||0x0;this[_0xaa43('0x24')]=_0x60a790[_0xaa43('0x24')]||0x1;this[_0xaa43('0x25')]=_0x60a790['dialPredictiveOptimization']||_0xaa43('0x26');this[_0xaa43('0x27')]=_0x60a790['dialPredictiveOptimizationPercentage']||0.03;this[_0xaa43('0x28')]=_0x60a790[_0xaa43('0x28')]||0x258;this[_0xaa43('0x29')]=_0x60a790[_0xaa43('0x29')]||'anonymous';this[_0xaa43('0x2a')]=_0x60a790[_0xaa43('0x2a')]||_0xaa43('0x2b');this[_0xaa43('0x2c')]=_0x60a790['dialOriginateTimeout']||0x1e;this[_0xaa43('0x2d')]=_0x60a790[_0xaa43('0x2d')]||_0xaa43('0x2e');this['dialQueueTimeout']=_0x60a790[_0xaa43('0x2f')]||0x3;this[_0xaa43('0x30')]=_0x60a790[_0xaa43('0x30')]||undefined;this['dialCongestionMaxRetry']=_0x60a790[_0xaa43('0x31')]||0x3;this[_0xaa43('0x32')]=_0x60a790[_0xaa43('0x32')]||0x96;this[_0xaa43('0x33')]=_0x60a790[_0xaa43('0x33')]||0x3;this[_0xaa43('0x34')]=_0x60a790[_0xaa43('0x34')]||0x96;this['dialNoAnswerMaxRetry']=_0x60a790[_0xaa43('0x35')]||0x3;this[_0xaa43('0x36')]=_0x60a790[_0xaa43('0x36')]||0x96;this[_0xaa43('0x37')]=_0x60a790[_0xaa43('0x37')]||0x4;this['Trunk']=_0x60a790[_0xaa43('0x38')]?_0x60a790[_0xaa43('0x38')]:undefined;this['TrunkBackup']=_0x60a790[_0xaa43('0x39')]?_0x60a790['TrunkBackup']:undefined;this[_0xaa43('0x3a')]=_0x60a790[_0xaa43('0x3a')]||undefined;this['Interval']=_0x60a790[_0xaa43('0x3b')]?_0x60a790[_0xaa43('0x3b')]:undefined;this[_0xaa43('0x3c')]=_0x60a790[_0xaa43('0x3c')]||'DESC';this[_0xaa43('0x3d')]=_0x60a790['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xaa43('0x3e')]=_0x60a790[_0xaa43('0x3e')]||undefined;this['strategy']=strategy[_0x60a790['strategy']]||_0xaa43('0x3f');this[_0xaa43('0x40')]=!![];this['dialAMDActive']=_0x60a790[_0xaa43('0x41')]||![];this[_0xaa43('0x42')]=_0x60a790['dialAMDInitialSilence'];this[_0xaa43('0x43')]=_0x60a790[_0xaa43('0x43')];this[_0xaa43('0x44')]=_0x60a790['dialAMDAfterGreetingSilence'];this[_0xaa43('0x45')]=_0x60a790['dialAMDTotalAnalysisTime'];this[_0xaa43('0x46')]=_0x60a790[_0xaa43('0x46')];this[_0xaa43('0x47')]=_0x60a790[_0xaa43('0x47')];this['dialAMDMaximumNumberOfWords']=_0x60a790['dialAMDMaximumNumberOfWords'];this[_0xaa43('0x48')]=_0x60a790['dialAMDSilenceThreshold'];this[_0xaa43('0x49')]=_0x60a790['dialAMDMaximumWordLength'];this[_0xaa43('0x4a')]=0x0;this[_0xaa43('0x4b')]=0x0;this['timeout']=_0x60a790[_0xaa43('0x4c')];this[_0xaa43('0x4d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xaa43('0x4e')]=0x0;this[_0xaa43('0x4f')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xaa43('0x50')]=0x0;this[_0xaa43('0x51')]=0x0;this[_0xaa43('0x52')]=0x0;this[_0xaa43('0x53')]=0x0;this[_0xaa43('0x54')]=0x0;this[_0xaa43('0x55')]=0x0;this[_0xaa43('0x56')]=0x0;this[_0xaa43('0x57')]=0x0;this['startProgressive']=undefined;this[_0xaa43('0x58')]=undefined;this[_0xaa43('0x59')]=undefined;this[_0xaa43('0x5a')]=1.05;this[_0xaa43('0x5b')]=0x0;this[_0xaa43('0x5c')]=0x0;this[_0xaa43('0x5d')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xaa43('0x5e')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xaa43('0x5f')]=0x0;this[_0xaa43('0x60')]=_0x60a790['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x60a790[_0xaa43('0x61')]||0xa;this[_0xaa43('0x62')]=0x0;this[_0xaa43('0x63')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xaa43('0x64')]=0x0;this[_0xaa43('0x65')]=0x0;this[_0xaa43('0x66')]=0x0;this[_0xaa43('0x67')]=_0x60a790[_0xaa43('0x67')]||0x1e;this[_0xaa43('0x68')]=_0x60a790[_0xaa43('0x68')]||![];this[_0xaa43('0x69')]=_0x60a790[_0xaa43('0x69')]||undefined;this['dialAgiAfterHangupClient']=_0x60a790[_0xaa43('0x6a')]||![];this[_0xaa43('0x6b')]=_0x60a790[_0xaa43('0x6b')]||![];this['monitor_format']=monitorFormat[_0x60a790['monitor_format']]?monitorFormat[_0x60a790['monitor_format']]:undefined;this[_0xaa43('0x6c')]=_0x60a790[_0xaa43('0x6c')]||![];this[_0xaa43('0x6d')]=_0x60a790['mandatoryDispositionPause']?_0x60a790[_0xaa43('0x6d')]:undefined;}module[_0xaa43('0x6e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index e8446c3..c1969ca 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 _0xf3b2=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf3b2,0x10e));var _0x2f3b=function(_0x20006a,_0x30e3a9){_0x20006a=_0x20006a-0x0;var _0x5e26ac=_0xf3b2[_0x20006a];return _0x5e26ac;};'use strict';function VtigerAccount(_0x3d8511){this['id']=_0x3d8511['id']||0x0;this[_0x2f3b('0x0')]=_0x3d8511['name']||'';this['username']=_0x3d8511[_0x2f3b('0x1')]||'';this[_0x2f3b('0x2')]=_0x3d8511[_0x2f3b('0x2')]||'';this['remoteUri']=_0x3d8511[_0x2f3b('0x3')]||'';this['serverUrl']=_0x3d8511[_0x2f3b('0x4')]||'';this['Configurations']=_0x3d8511[_0x2f3b('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xe4ef=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4ef,0x100));var _0xfe4e=function(_0xfadf78,_0x4299f5){_0xfadf78=_0xfadf78-0x0;var _0x26eaa8=_0xe4ef[_0xfadf78];return _0x26eaa8;};'use strict';function VtigerAccount(_0x1b22f){this['id']=_0x1b22f['id']||0x0;this[_0xfe4e('0x0')]=_0x1b22f[_0xfe4e('0x0')]||'';this['username']=_0x1b22f[_0xfe4e('0x1')]||'';this['accessKey']=_0x1b22f[_0xfe4e('0x2')]||'';this[_0xfe4e('0x3')]=_0x1b22f['remoteUri']||'';this[_0xfe4e('0x4')]=_0x1b22f[_0xfe4e('0x4')]||'';this['Configurations']=_0x1b22f[_0xfe4e('0x5')]||{};}module[_0xfe4e('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index f87ed08..382572c 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 _0x476e=['name','username','password','token','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x476e,0xfa));var _0xe476=function(_0x5b3cde,_0xa835cd){_0x5b3cde=_0x5b3cde-0x0;var _0x5bdc33=_0x476e[_0x5b3cde];return _0x5bdc33;};'use strict';function ZendeskAccount(_0x2b2c09){this['id']=_0x2b2c09['id']||0x0;this[_0xe476('0x0')]=_0x2b2c09['name']||'';this[_0xe476('0x1')]=_0x2b2c09[_0xe476('0x1')]||'';this['password']=_0x2b2c09[_0xe476('0x2')]||'';this[_0xe476('0x3')]=_0x2b2c09[_0xe476('0x3')]||'';this['remoteUri']=_0x2b2c09['remoteUri']||'';this[_0xe476('0x4')]=_0x2b2c09[_0xe476('0x4')]||'';this['type']=_0x2b2c09[_0xe476('0x5')]||_0xe476('0x6');this[_0xe476('0x7')]=_0x2b2c09['serverUrl']||'';this[_0xe476('0x8')]=_0x2b2c09[_0xe476('0x8')]||{};}module[_0xe476('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xc639=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x1acbfd,_0x579b5b){var _0x1884d5=function(_0x5df091){while(--_0x5df091){_0x1acbfd['push'](_0x1acbfd['shift']());}};_0x1884d5(++_0x579b5b);}(_0xc639,0xfc));var _0x9c63=function(_0x27c79d,_0x4927f2){_0x27c79d=_0x27c79d-0x0;var _0x3f2d3e=_0xc639[_0x27c79d];return _0x3f2d3e;};'use strict';function ZendeskAccount(_0x132d5f){this['id']=_0x132d5f['id']||0x0;this[_0x9c63('0x0')]=_0x132d5f[_0x9c63('0x0')]||'';this[_0x9c63('0x1')]=_0x132d5f[_0x9c63('0x1')]||'';this[_0x9c63('0x2')]=_0x132d5f[_0x9c63('0x2')]||'';this[_0x9c63('0x3')]=_0x132d5f[_0x9c63('0x3')]||'';this[_0x9c63('0x4')]=_0x132d5f[_0x9c63('0x4')]||'';this[_0x9c63('0x5')]=_0x132d5f[_0x9c63('0x5')]||'';this[_0x9c63('0x6')]=_0x132d5f[_0x9c63('0x6')]||_0x9c63('0x7');this[_0x9c63('0x8')]=_0x132d5f[_0x9c63('0x8')]||'';this['Configurations']=_0x132d5f[_0x9c63('0x9')]||{};}module[_0x9c63('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 9674169..dfd56ee 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 _0x2bd8=['host','Configurations','serverUrl','exports','name','authToken'];(function(_0x579af1,_0xf7e598){var _0x348cc3=function(_0xa42871){while(--_0xa42871){_0x579af1['push'](_0x579af1['shift']());}};_0x348cc3(++_0xf7e598);}(_0x2bd8,0x130));var _0x82bd=function(_0x1eb24e,_0x9d4e08){_0x1eb24e=_0x1eb24e-0x0;var _0xf97163=_0x2bd8[_0x1eb24e];return _0xf97163;};'use strict';function ZohoAccount(_0x1f587f){this['id']=_0x1f587f['id']||0x0;this['name']=_0x1f587f[_0x82bd('0x0')]||'';this[_0x82bd('0x1')]=_0x1f587f[_0x82bd('0x1')]||'';this[_0x82bd('0x2')]=_0x1f587f[_0x82bd('0x2')]||'';this[_0x82bd('0x3')]=_0x1f587f[_0x82bd('0x3')]||{};this['serverUrl']=_0x1f587f[_0x82bd('0x4')]||'';}module[_0x82bd('0x5')]=ZohoAccount; \ No newline at end of file +var _0x2542=['exports','name','authToken','host','Configurations','serverUrl'];(function(_0x413a86,_0x2f5bac){var _0x4e4305=function(_0x45f552){while(--_0x45f552){_0x413a86['push'](_0x413a86['shift']());}};_0x4e4305(++_0x2f5bac);}(_0x2542,0x169));var _0x2254=function(_0x592205,_0xb3bc4f){_0x592205=_0x592205-0x0;var _0x17bcd9=_0x2542[_0x592205];return _0x17bcd9;};'use strict';function ZohoAccount(_0x326732){this['id']=_0x326732['id']||0x0;this[_0x2254('0x0')]=_0x326732[_0x2254('0x0')]||'';this[_0x2254('0x1')]=_0x326732['authToken']||'';this[_0x2254('0x2')]=_0x326732['host']||'';this[_0x2254('0x3')]=_0x326732[_0x2254('0x3')]||{};this[_0x2254('0x4')]=_0x326732[_0x2254('0x4')]||'';}module[_0x2254('0x5')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index f3f74aa..d0a37be 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 _0x5082=['string','uniqueid','idContact','queue','type','campaigntype','membername','Agent','channelAgent','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','exports','lodash','isNil'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5082,0x1ab));var _0x2508=function(_0x576d9b,_0xddfca2){_0x576d9b=_0x576d9b-0x0;var _0x1644a5=_0x5082[_0x576d9b];return _0x1644a5;};'use strict';var util=require('util');var _=require(_0x2508('0x0'));var moment=require('moment');function checkNameSurname(_0x33d4cd,_0x92cd3d,_0x58b408){var _0x17bebb='';if(!_[_0x2508('0x1')](_0x92cd3d)&&_0x2508('0x2')===typeof _0x92cd3d){_0x17bebb+=_0x92cd3d;}if(!_[_0x2508('0x1')](_0x58b408)&&_0x2508('0x2')===typeof _0x58b408){_0x17bebb+='\x20'+_0x58b408;}if(_0x17bebb!==''){return _0x17bebb;}return _0x33d4cd;}function Action(_0x560317,_0x2fd106,_0x349946,_0x37615d,_0x42ad3a){this[_0x2508('0x3')]=_0x349946||undefined;this[_0x2508('0x4')]=_0x560317['id'];this[_0x2508('0x5')]=_0x2fd106['name'];this['type']=_0x2fd106[_0x2508('0x6')];this[_0x2508('0x7')]=_0x2508('0x5');this['dialAnswer']=![];this[_0x2508('0x8')]=_['isNil'](_0x560317[_0x2508('0x9')])?undefined:_0x560317[_0x2508('0x9')]['name'];this[_0x2508('0xa')]=this[_0x2508('0x8')]?util['format'](_0x2508('0xb'),this['membername']):_0x37615d||undefined;this[_0x2508('0xc')]=checkNameSurname(_0x560317['Contact'][_0x2508('0xd')],_0x560317[_0x2508('0xe')][_0x2508('0xf')],_0x560317[_0x2508('0xe')][_0x2508('0x10')]);this[_0x2508('0x11')]=_0x560317[_0x2508('0x11')]||![];this[_0x2508('0x12')]=_0x560317[_0x2508('0xe')][_0x2508('0xd')];this[_0x2508('0x13')]=_0x560317['scheduledat'];this[_0x2508('0x14')]=_0x560317[_0x2508('0x14')]||0x0;this['countcongestionretry']=_0x560317['countcongestionretry']||0x0;this['countnoanswerretry']=_0x560317[_0x2508('0x15')]||0x0;this[_0x2508('0x16')]=(_0x560317[_0x2508('0x14')]||0x0)+(_0x560317[_0x2508('0x17')]||0x0)+(_0x560317[_0x2508('0x15')]||0x0);this[_0x2508('0x18')]=_0x560317[_0x2508('0x18')];this[_0x2508('0x19')]=_0x560317[_0x2508('0x19')];this[_0x2508('0x1a')]=_0x560317[_0x2508('0x1a')];this[_0x2508('0x1b')]=_0x560317[_0x2508('0x1b')];this[_0x2508('0x1c')]=_0x560317[_0x2508('0x1c')];this[_0x2508('0x1d')]=_0x560317['ListId'];this[_0x2508('0x1e')]=_[_0x2508('0x1')](_0x560317['Agent'])?_0x560317['UserId']:_0x560317[_0x2508('0x9')]['id'];this[_0x2508('0x1f')]=_0x560317[_0x2508('0x1f')];this['originatecalleridnum']='';this[_0x2508('0x20')]='';}Action[_0x2508('0x21')][_0x2508('0x22')]=function(){return util[_0x2508('0x23')](_0x2508('0x24'),this['calleridname'],this[_0x2508('0x25')]);};module[_0x2508('0x26')]=Action; \ No newline at end of file +var _0x740a=['ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x740a,0x15d));var _0xa740=function(_0x50b8eb,_0x1dfb2a){_0x50b8eb=_0x50b8eb-0x0;var _0x50f099=_0x740a[_0x50b8eb];return _0x50f099;};'use strict';var util=require(_0xa740('0x0'));var _=require(_0xa740('0x1'));var moment=require('moment');function checkNameSurname(_0x3d8bfa,_0x32fcbb,_0x3566b9){var _0x338c2d='';if(!_[_0xa740('0x2')](_0x32fcbb)&&'string'===typeof _0x32fcbb){_0x338c2d+=_0x32fcbb;}if(!_[_0xa740('0x2')](_0x3566b9)&&_0xa740('0x3')===typeof _0x3566b9){_0x338c2d+='\x20'+_0x3566b9;}if(_0x338c2d!==''){return _0x338c2d;}return _0x3d8bfa;}function Action(_0xcc417c,_0x404a46,_0x2e160a,_0x3638c6,_0x2cd1c7){this[_0xa740('0x4')]=_0x2e160a||undefined;this[_0xa740('0x5')]=_0xcc417c['id'];this[_0xa740('0x6')]=_0x404a46[_0xa740('0x7')];this[_0xa740('0x8')]=_0x404a46[_0xa740('0x8')];this[_0xa740('0x9')]=_0xa740('0x6');this[_0xa740('0xa')]=![];this['membername']=_[_0xa740('0x2')](_0xcc417c[_0xa740('0xb')])?undefined:_0xcc417c['Agent']['name'];this[_0xa740('0xc')]=this[_0xa740('0xd')]?util[_0xa740('0xe')](_0xa740('0xf'),this['membername']):_0x3638c6||undefined;this[_0xa740('0x10')]=checkNameSurname(_0xcc417c[_0xa740('0x11')][_0xa740('0x12')],_0xcc417c[_0xa740('0x11')]['firstName'],_0xcc417c[_0xa740('0x11')][_0xa740('0x13')]);this[_0xa740('0x14')]=_0xcc417c[_0xa740('0x14')]||![];this[_0xa740('0x15')]=_0xcc417c['Contact'][_0xa740('0x12')];this[_0xa740('0x16')]=_0xcc417c[_0xa740('0x16')];this[_0xa740('0x17')]=_0xcc417c[_0xa740('0x17')]||0x0;this[_0xa740('0x18')]=_0xcc417c[_0xa740('0x18')]||0x0;this[_0xa740('0x19')]=_0xcc417c['countnoanswerretry']||0x0;this[_0xa740('0x1a')]=(_0xcc417c['countbusyretry']||0x0)+(_0xcc417c[_0xa740('0x18')]||0x0)+(_0xcc417c[_0xa740('0x19')]||0x0);this['callback']=_0xcc417c['callback'];this[_0xa740('0x1b')]=_0xcc417c[_0xa740('0x1b')];this[_0xa740('0x1c')]=_0xcc417c[_0xa740('0x1c')];this[_0xa740('0x1d')]=_0xcc417c['recallme'];this['ContactId']=_0xcc417c[_0xa740('0x1e')];this[_0xa740('0x1f')]=_0xcc417c[_0xa740('0x1f')];this[_0xa740('0x20')]=_[_0xa740('0x2')](_0xcc417c[_0xa740('0xb')])?_0xcc417c[_0xa740('0x20')]:_0xcc417c[_0xa740('0xb')]['id'];this[_0xa740('0x21')]=_0xcc417c[_0xa740('0x21')];this['originatecalleridnum']='';this[_0xa740('0x22')]='';}Action[_0xa740('0x23')][_0xa740('0x24')]=function(){return util[_0xa740('0xe')](_0xa740('0x25'),this[_0xa740('0x10')],this['number']);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c4b4fc7..c445286 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 _0xb3c1=['[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','clearZombieChannels','size','clearZombieChannel','agentReadyId','then','getDiff','scheduledat','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','logger2','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','pTalking','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','NoAnswer','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','execRun','unlockContact','disableContact','recallme','validateContact','isValid','checkIsBlackList','VoiceQueueId','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','trim','dialCutDigit','substring','SIP/%s/%s%s','TrunkBackup','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','Action','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','[syncHangup][talking][cause]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','enqueue','tail','sequence','trunks','agents','clockClearZombieChannels','syncOriginateResponse','syncHangup','syncHangupRequest','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','loopCampaigns','campaignsPreview','emit','type','name','strategy','answered','loggedIn','sumBillable','talking','total','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','format','sendMessageOneNotActive','available','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','dialMethod','preview','hasOwnProperty','outbound','setMessage','recallMe','isNil','actions','info','[clearZombieChannels][talking]','queue','originated:\x20','dialAnswer','pick','status','channel','catch','No\x20such\x20channel','updateOriginated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb3c1,0xc5));var _0x1b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c1[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x1b3c('0x0'));var _=require(_0x1b3c('0x1'));var BPromise=require(_0x1b3c('0x2'));var uuid=require('uuid');var moment=require(_0x1b3c('0x3'));var md5=require(_0x1b3c('0x4'));var Redis=require(_0x1b3c('0x5'));var config=require(_0x1b3c('0x6'));var logger=require(_0x1b3c('0x7'))('preview');var loggerAction=require('../../../config/logger')(_0x1b3c('0x8'));var ami=require(_0x1b3c('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0x1b3c('0xa'));var ut=require(_0x1b3c('0xb'));config[_0x1b3c('0xc')]=_[_0x1b3c('0xd')](config[_0x1b3c('0xc')],{'host':_0x1b3c('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1b3c('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x1b3c('0xf')]=function(_0x5826b4){this[_0x1b3c('0x10')]=this[_0x1b3c('0x10')]?this[_0x1b3c('0x10')]['finally'](_0x5826b4):_0x5826b4();};function Preview(_0x4c18e3){this[_0x1b3c('0x11')]=new Sequence();this['campaignsPreview']=_0x4c18e3['voiceQueues'];this[_0x1b3c('0x12')]=_0x4c18e3['trunks'];this['actions']={};this[_0x1b3c('0x13')]=_0x4c18e3[_0x1b3c('0x13')];this[_0x1b3c('0x14')]=0x0;ami['on']('originateresponse',this[_0x1b3c('0x15')]['bind'](this));ami['on']('hangup',this[_0x1b3c('0x16')]['bind'](this));ami['on']('hanguprequest',this[_0x1b3c('0x17')][_0x1b3c('0x18')](this));ami['on'](_0x1b3c('0x19'),this[_0x1b3c('0x1a')][_0x1b3c('0x18')](this));ami['on'](_0x1b3c('0x1b'),this[_0x1b3c('0x1c')][_0x1b3c('0x18')](this));ami['on'](_0x1b3c('0x1d'),this[_0x1b3c('0x1e')][_0x1b3c('0x18')](this));ami['on'](_0x1b3c('0x1f'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x1b3c('0x20'),this['syncBlindTransfer'][_0x1b3c('0x18')](this));this[_0x1b3c('0x21')](this[_0x1b3c('0x22')]);}function emit(_0x53e3a4,_0x231cea,_0x2a75d1){io['to'](_0x53e3a4)[_0x1b3c('0x23')](_0x231cea,_0x2a75d1);}function emitCampaignPreview(_0x44db97){if(_0x44db97[_0x1b3c('0x24')]==='outbound'){var _0x2ea214={'id':_0x44db97['id'],'name':_0x44db97[_0x1b3c('0x25')],'strategy':_0x44db97[_0x1b3c('0x26')],'answered':_0x44db97[_0x1b3c('0x27')],'available':_0x44db97['available'],'loggedIn':_0x44db97[_0x1b3c('0x28')],'pTalking':_0x44db97['pTalking'],'sumBillable':_0x44db97[_0x1b3c('0x29')],'sumDuration':_0x44db97['sumDuration'],'sumHoldTime':_0x44db97['sumHoldTime']||0x0,'talking':_0x44db97[_0x1b3c('0x2a')],'total':_0x44db97[_0x1b3c('0x2b')],'type':_0x44db97[_0x1b3c('0x24')],'unmanaged':_0x44db97[_0x1b3c('0x2c')],'abandoned':_0x44db97[_0x1b3c('0x2d')],'waiting':_0x44db97[_0x1b3c('0x2e')],'loggedInDb':_0x44db97['loggedInDb'],'dialActive':_0x44db97[_0x1b3c('0x2f')],'dialMethod':_0x44db97['dialMethod'],'dialOriginateCallerIdName':_0x44db97[_0x1b3c('0x30')],'dialOriginateCallerIdNumber':_0x44db97[_0x1b3c('0x31')],'dialOriginateTimeout':_0x44db97[_0x1b3c('0x32')],'dialPrefix':_0x44db97[_0x1b3c('0x33')],'outboundAnswerAgiCallsDay':_0x44db97[_0x1b3c('0x34')],'outboundAnswerCallsDay':_0x44db97[_0x1b3c('0x35')],'outboundBlacklistCallsDay':_0x44db97[_0x1b3c('0x36')],'outboundBusyCallsDay':_0x44db97['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x44db97[_0x1b3c('0x37')],'outboundDropCallsDayACS':_0x44db97[_0x1b3c('0x38')],'outboundDropCallsDayCallersExit':_0x44db97[_0x1b3c('0x39')],'outboundDropCallsDayTimeout':_0x44db97[_0x1b3c('0x3a')],'outboundNoAnswerCallsDay':_0x44db97[_0x1b3c('0x3b')],'outboundNoSuchCallsDay':_0x44db97['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x44db97[_0x1b3c('0x3c')],'outboundReCallsDay':_0x44db97[_0x1b3c('0x3d')],'outboundRejectCallsDay':_0x44db97[_0x1b3c('0x3e')],'outboundUnknownCallsDay':_0x44db97[_0x1b3c('0x3f')],'predictiveIntervalAnsweredCalls':_0x44db97[_0x1b3c('0x40')],'predictiveIntervalAvgHoldtime':_0x44db97['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x44db97[_0x1b3c('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x44db97[_0x1b3c('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x44db97[_0x1b3c('0x43')],'predictiveIntervalErlangCalls':_0x44db97[_0x1b3c('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x44db97['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x44db97[_0x1b3c('0x45')],'predictiveIntervalMultiplicativeFactor':_0x44db97[_0x1b3c('0x46')],'predictiveIntervalPauses':_0x44db97[_0x1b3c('0x47')],'predictiveIntervalAvailable':_0x44db97['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x44db97[_0x1b3c('0x48')],'message':_0x44db97['message'],'originated':_0x44db97[_0x1b3c('0x49')],'erlangCalls':_0x44db97[_0x1b3c('0x4a')],'erlangCallToSecond':_0x44db97[_0x1b3c('0x4b')],'erlangAbandonmentRate':_0x44db97[_0x1b3c('0x4c')],'erlangBusyFactor':_0x44db97['erlangBusyFactor'],'startPredictive':_0x44db97['startPredictive'],'startProgressive':_0x44db97[_0x1b3c('0x4d')]};if(_0x44db97[_0x1b3c('0x4e')]){_0x2ea214[_0x1b3c('0x4e')]={'id':_0x44db97[_0x1b3c('0x4e')]['id'],'name':_0x44db97[_0x1b3c('0x4e')][_0x1b3c('0x25')],'active':_0x44db97['Trunk'][_0x1b3c('0x4f')],'callerid':_0x44db97['Trunk'][_0x1b3c('0x50')]};}if(_0x44db97['Interval']){_0x2ea214[_0x1b3c('0x51')]={'id':_0x44db97[_0x1b3c('0x51')]['id'],'name':_0x44db97[_0x1b3c('0x51')][_0x1b3c('0x25')]};}var _0x29b115=md5(JSON[_0x1b3c('0x52')](_0x2ea214));if(_0x44db97[_0x1b3c('0x4')]!==_0x29b115){_0x44db97['md5']=_0x29b115;emit(util['format'](_0x1b3c('0x53'),_0x2ea214[_0x1b3c('0x25')]),_0x1b3c('0x54'),_0x2ea214);}}}function emitVoiceQueueChannelRemove(_0x35e4db){emit(util[_0x1b3c('0x55')](_0x1b3c('0x53'),_0x35e4db[_0x1b3c('0x25')]),'voice_queue_channel:remove',_0x35e4db);}function notSendMessagesQueue(_0x50d1fe){if(_0x50d1fe['sendMessageOneNotActive']){if(_0x50d1fe[_0x1b3c('0x49')]===0x0&&_0x50d1fe['pTalking']===0x0){_0x50d1fe[_0x1b3c('0x56')]=![];_0x50d1fe[_0x1b3c('0x57')]=0x0;_0x50d1fe[_0x1b3c('0x58')]=0x0;_0x50d1fe[_0x1b3c('0x59')]=_0x1b3c('0x5a');ut[_0x1b3c('0x5b')](_0x1b3c('0x5c'),_0x50d1fe[_0x1b3c('0x25')]+_0x1b3c('0x5d'));}else{_0x50d1fe[_0x1b3c('0x59')]=_0x1b3c('0x5e');ut[_0x1b3c('0x5b')](_0x1b3c('0x5c'),_0x50d1fe[_0x1b3c('0x25')]+_0x1b3c('0x5f'));}emitCampaignPreview(_0x50d1fe);}}Preview[_0x1b3c('0x60')][_0x1b3c('0x21')]=function(){var _0x48422e=this;setInterval(function(){_0x48422e[_0x1b3c('0x61')]();},0x7cf);};Preview['prototype'][_0x1b3c('0x61')]=function(){var _0x57ad63=this[_0x1b3c('0x22')];this[_0x1b3c('0x14')]+=0x1;for(var _0x139495 in _0x57ad63){if(_0x57ad63['hasOwnProperty'](_0x139495)&&(_0x57ad63[_0x139495][_0x1b3c('0x62')]===_0x1b3c('0x63')||_0x57ad63[_0x139495]['dialMethod']==='booked')&&_0x57ad63[_0x139495]['type']==='outbound'){if(this[_0x1b3c('0x14')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x57ad63[_0x1b3c('0x64')](_0x139495)&&_0x57ad63[_0x139495]['dialMethod']===_0x1b3c('0x63')&&_0x57ad63[_0x139495][_0x1b3c('0x24')]===_0x1b3c('0x65')){if(_0x57ad63[_0x139495][_0x1b3c('0x2f')]){this[_0x1b3c('0x66')](_0x57ad63[_0x139495]);this[_0x1b3c('0x67')](_0x57ad63[_0x139495]);}else{notSendMessagesQueue(_0x57ad63[_0x139495]);}}}};Preview[_0x1b3c('0x60')]['clearZombieChannel']=function(_0x1a5dc2){var _0x182196=this;this[_0x1b3c('0x11')][_0x1b3c('0xf')](function(){if(!_[_0x1b3c('0x68')](_0x182196[_0x1b3c('0x69')][_0x1a5dc2])){loggerAction[_0x1b3c('0x6a')](_0x1b3c('0x6b'),_0x1a5dc2,'Queue',_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6c')],_0x1b3c('0x6d'),JSON['stringify'](_0x182196[_0x1b3c('0x22')][_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6c')]][_0x1b3c('0x49')]),'pTalking:\x20',JSON[_0x1b3c('0x52')](_0x182196['campaignsPreview'][_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6c')]]['pTalking']),JSON['stringify'](_0x182196['actions'][_0x1a5dc2][_0x1b3c('0x6e')]),JSON[_0x1b3c('0x52')](_[_0x1b3c('0x6f')](_0x182196[_0x1b3c('0x69')][_0x1a5dc2],['contactId','UserId','VoiceQueueId','ListId'])));return ami['Action']({'action':_0x1b3c('0x70'),'channel':_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x71')]})[_0x1b3c('0x72')](function(_0x162eb6){if(_0x162eb6[_0x1b3c('0x59')]===_0x1b3c('0x73')){setTimeout(function(){if(_0x182196[_0x1b3c('0x69')][_0x1a5dc2]){ut[_0x1b3c('0x74')](_0x182196[_0x1b3c('0x22')][_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6c')]],_0x1b3c('0x75'));if(_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6e')]===!![]){ut[_0x1b3c('0x76')](_0x182196[_0x1b3c('0x22')][_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6c')]],_0x1b3c('0x75'));ut['loggerError'](_0x1b3c('0x77')+_0x1a5dc2,_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6c')]);}ut[_0x1b3c('0x78')]('[Dialer][checkChannel][Preview]'+_0x1a5dc2,_0x182196[_0x1b3c('0x69')][_0x1a5dc2][_0x1b3c('0x6c')]);delete _0x182196[_0x1b3c('0x69')][_0x1a5dc2];}},0x2328);}});}});};Preview[_0x1b3c('0x60')][_0x1b3c('0x79')]=function(){var _0x48d200=this;loggerAction[_0x1b3c('0x6a')]('[action]',_[_0x1b3c('0x7a')](this[_0x1b3c('0x69')]));for(var _0x136309 in this[_0x1b3c('0x69')]){if(_0x48d200[_0x1b3c('0x69')][_0x1b3c('0x64')](_0x136309)){_0x48d200[_0x1b3c('0x7b')](_0x136309);}}};Preview[_0x1b3c('0x60')]['recallMe']=function(_0x5512be){var _0x2582fc=this;rpcDb['getContactRecallMe'](_0x5512be['id'],ut[_0x1b3c('0x7c')](this[_0x1b3c('0x13')]))[_0x1b3c('0x7d')](function(_0x49dd77){if(!_[_0x1b3c('0x68')](_0x49dd77)){for(var _0x288bb5=0x0;_0x288bb5<_0x49dd77['length'];_0x288bb5+=0x1){if(ut[_0x1b3c('0x7e')](_0x49dd77[_0x288bb5][_0x1b3c('0x7f')])<_0x5512be['dialRecallMeTimeout']*0x3c){_0x2582fc['run'](_0x49dd77[_0x288bb5]['id'])[_0x1b3c('0x7d')](ut['logger2'](_0x1b3c('0x80')))[_0x1b3c('0x72')](ut['logger2'](_0x1b3c('0x80')));}else{var _0xd5b42b=new Action(_0x49dd77[_0x288bb5],_0x5512be);_0xd5b42b[_0x1b3c('0x81')]=moment()[_0x1b3c('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x5512be[_0x1b3c('0x3d')]+=0x1;ut[_0x1b3c('0x82')](_0xd5b42b,0x17,_0x1b3c('0x83'));if(_0x5512be[_0x1b3c('0x84')]){rpcDb['rescheduleContactInQueue'](ut[_0x1b3c('0x85')](_0x49dd77[_0x288bb5]));rpcDb[_0x1b3c('0x86')](_0xd5b42b,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x1b3c('0x82')](_0xd5b42b,0x16,_0x1b3c('0x87'));rpcDb[_0x1b3c('0x86')](_0xd5b42b,'[HistoryRecallClose]');rpcDb[_0x1b3c('0x88')](_0xd5b42b,_0x1b3c('0x89'));}}}}})['catch'](ut[_0x1b3c('0x8a')](_0x1b3c('0x8b')));};Preview[_0x1b3c('0x60')][_0x1b3c('0x66')]=function(_0x1483ec){_0x1483ec[_0x1b3c('0x56')]=!![];if(ut[_0x1b3c('0x8c')](_0x1483ec[_0x1b3c('0x28')])){_0x1483ec[_0x1b3c('0x59')]=_0x1b3c('0x8d');}else if(!ut[_0x1b3c('0x8e')](_0x1483ec[_0x1b3c('0x2f')])){_0x1483ec['message']=_0x1b3c('0x5a');}else if(!this[_0x1b3c('0x8f')](_0x1483ec[_0x1b3c('0x4e')])){if(!this[_0x1b3c('0x8f')](_0x1483ec['TrunkBackup'])){_0x1483ec[_0x1b3c('0x59')]=_0x1b3c('0x90');}else{_0x1483ec[_0x1b3c('0x59')]='ACTIVE';}}else{_0x1483ec['message']=_0x1b3c('0x91');}emitCampaignPreview(_0x1483ec);};Preview[_0x1b3c('0x60')][_0x1b3c('0x92')]=function(_0x5f09ab,_0x45327c,_0x389510){var _0x4ab752=this;var _0xab9e2c=this[_0x1b3c('0x69')][_0x45327c];var _0x227f69=this['campaignsPreview'][_0xab9e2c[_0x1b3c('0x6c')]];var _0x2e746a;if(_0x227f69){switch(_0x389510){case'1':_0x227f69[_0x1b3c('0x93')]+=0x1;_0xab9e2c[_0x1b3c('0x94')]=ut[_0x1b3c('0x95')](_0xab9e2c);ut[_0x1b3c('0x82')](_0xab9e2c,0x0,_0x1b3c('0x96'));rpcDb[_0x1b3c('0x86')](_0xab9e2c,_0x1b3c('0x97'));if(ut[_0x1b3c('0x95')](_0xab9e2c)>=_0x227f69[_0x1b3c('0x98')]){_0x2e746a=ut[_0x1b3c('0x99')](_0xab9e2c,0xf,_0x1b3c('0x9a'));rpcDb[_0x1b3c('0x88')](_0x2e746a,_0x1b3c('0x9b'));}else{rpcDb['createCustomerFinal'](_0xab9e2c,_0x1b3c('0x9b'));}delete this['actions'][_0x5f09ab[_0x1b3c('0x9c')]];break;case'ANSWER':var _0x3691a4=moment()[_0x1b3c('0x55')](_0x1b3c('0x9d'));_0xab9e2c[_0x1b3c('0x9e')]=_0x3691a4;_0xab9e2c[_0x1b3c('0x9f')]=_0x3691a4;_0xab9e2c[_0x1b3c('0x6e')]=!![];_0x227f69[_0x1b3c('0xa0')]+=0x1;logger['info']('[syncHangup][talking][increment]',_0xab9e2c[_0x1b3c('0xa1')],_0x1b3c('0xa2'),_0x227f69[_0x1b3c('0x25')],_0x1b3c('0xa3'),_0x227f69['pTalking']);ami[_0x1b3c('0x23')](_0x1b3c('0xa4'),ut[_0x1b3c('0xa5')](_0xab9e2c,_0x1b3c('0xa6')));if(_0x227f69[_0x1b3c('0xa7')]){ami[_0x1b3c('0x23')](_0x1b3c('0xa8'),ut['buildAcw'](_0xab9e2c));}break;case'16':ami['emit'](_0x1b3c('0xa9'),ut[_0x1b3c('0xa5')](_0xab9e2c,'complete'));emitVoiceQueueChannelRemove(ut[_0x1b3c('0xa5')](_0xab9e2c,_0x1b3c('0xaa')));_0x227f69[_0x1b3c('0x35')]+=0x1;_0x227f69[_0x1b3c('0x2b')]+=0x1;_0x227f69[_0x1b3c('0x27')]+=0x1;ut[_0x1b3c('0x76')](_0x227f69,_0x1b3c('0xab'));_0xab9e2c[_0x1b3c('0x94')]=ut[_0x1b3c('0x95')](_0xab9e2c);ut[_0x1b3c('0x82')](_0xab9e2c,0x4,_0x1b3c('0xac'));rpcDb['createCustomerHistory'](_0xab9e2c,_0x1b3c('0xad'));rpcDb['createCustomerFinal'](_0xab9e2c,_0x1b3c('0xae'));rpcDb[_0x1b3c('0xaf')](_0xab9e2c);_0x227f69['sumDuration']+=_0xab9e2c[_0x1b3c('0xb0')];_0x227f69[_0x1b3c('0x29')]+=_0xab9e2c[_0x1b3c('0xb0')];logger[_0x1b3c('0x6a')](_0x1b3c('0xb1'),_0xab9e2c[_0x1b3c('0xa1')],_0x1b3c('0xa2'),_0x227f69['name'],_0x1b3c('0xa3'),_0x227f69[_0x1b3c('0xa0')]);delete this['actions'][_0x5f09ab[_0x1b3c('0x9c')]];break;case _0x1b3c('0xb2'):_0x227f69[_0x1b3c('0xb3')]+=0x1;_0xab9e2c[_0x1b3c('0xb4')]+=0x1;_0xab9e2c[_0x1b3c('0x94')]=ut[_0x1b3c('0x95')](_0xab9e2c);ut[_0x1b3c('0x82')](_0xab9e2c,0x5,'Busy');rpcDb['createCustomerHistory'](_0xab9e2c,_0x1b3c('0xb5'));if(ut[_0x1b3c('0x95')](_0xab9e2c)>=_0x227f69['dialGlobalMaxRetry']){_0x2e746a=ut['cloneAction'](_0xab9e2c,0xf,_0x1b3c('0x9a'));rpcDb[_0x1b3c('0x88')](_0x2e746a,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0xab9e2c[_0x1b3c('0xb4')]>=_0x227f69['dialBusyMaxRetry']){rpcDb[_0x1b3c('0x88')](_0xab9e2c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x1b3c('0xb6')](ut[_0x1b3c('0xb7')](_0xab9e2c,_0x1b3c('0xb4'),_0x227f69[_0x1b3c('0xb8')]),_0xab9e2c[_0x1b3c('0xb9')],_0xab9e2c[_0x1b3c('0xba')]);}}break;case _0x1b3c('0xbb'):_0x227f69[_0x1b3c('0x3b')]+=0x1;_0xab9e2c['countnoanswerretry']+=0x1;_0xab9e2c[_0x1b3c('0x94')]=ut['totalGlobal'](_0xab9e2c);ut[_0x1b3c('0x82')](_0xab9e2c,0x3,_0x1b3c('0xbc'));rpcDb[_0x1b3c('0x86')](_0xab9e2c,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x1b3c('0x95')](_0xab9e2c)>=_0x227f69['dialGlobalMaxRetry']){_0x2e746a=ut[_0x1b3c('0x99')](_0xab9e2c,0xf,'Global');rpcDb[_0x1b3c('0x88')](_0x2e746a,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xab9e2c[_0x1b3c('0xbd')]>=_0x227f69[_0x1b3c('0xbe')]){rpcDb[_0x1b3c('0x88')](_0xab9e2c,_0x1b3c('0xbf'));}else{rpcDb[_0x1b3c('0xb6')](ut[_0x1b3c('0xb7')](_0xab9e2c,'countnoanswerretry',_0x227f69[_0x1b3c('0xc0')]),_0xab9e2c['unlockAgent'],_0xab9e2c[_0x1b3c('0xba')]);}}break;case _0x1b3c('0xc1'):_0x227f69[_0x1b3c('0x37')]+=0x1;_0xab9e2c['countcongestionretry']+=0x1;_0xab9e2c[_0x1b3c('0x94')]=ut[_0x1b3c('0x95')](_0xab9e2c);ut[_0x1b3c('0x82')](_0xab9e2c,0x8,_0x1b3c('0xc2'));rpcDb[_0x1b3c('0x86')](_0xab9e2c,_0x1b3c('0xc3'));if(ut[_0x1b3c('0x95')](_0xab9e2c)>=_0x227f69[_0x1b3c('0x98')]){_0x2e746a=ut[_0x1b3c('0x99')](_0xab9e2c,0xf,'Global');rpcDb['createCustomerFinal'](_0x2e746a,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0xab9e2c['countcongestionretry']>=_0x227f69[_0x1b3c('0xc4')]){rpcDb['createCustomerFinal'](_0xab9e2c,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x1b3c('0xb6')](ut[_0x1b3c('0xb7')](_0xab9e2c,'countcongestionretry',_0x227f69['dialBusyRetryFrequency']),_0xab9e2c[_0x1b3c('0xb9')],_0xab9e2c[_0x1b3c('0xba')]);}}break;case _0x1b3c('0xc5'):_0x227f69[_0x1b3c('0x3e')]+=0x1;_0xab9e2c[_0x1b3c('0x94')]=ut['totalGlobal'](_0xab9e2c);ut[_0x1b3c('0x82')](_0xab9e2c,0x14,_0x1b3c('0xc6'));rpcDb[_0x1b3c('0x86')](_0xab9e2c,_0x1b3c('0xc7'));if(_0xab9e2c[_0x1b3c('0xb9')]){rpcDb['unlockContact'](_0xab9e2c[_0x1b3c('0xc8')]);}if(_0xab9e2c[_0x1b3c('0xba')]){rpcDb['disableContact'](_0xab9e2c[_0x1b3c('0xc8')]);}break;default:if(_0xab9e2c['dialAnswer']){ut[_0x1b3c('0x76')](_0x227f69,_0x1b3c('0xc9'));ut[_0x1b3c('0x78')](_0x1b3c('0xca')+_0x227f69['name'],_0x5f09ab);}_0x227f69[_0x1b3c('0x3f')]+=0x1;_0xab9e2c[_0x1b3c('0x94')]=ut[_0x1b3c('0x95')](_0xab9e2c);ut[_0x1b3c('0x82')](_0xab9e2c,0xc,_0x5f09ab['cause-txt']||_0x5f09ab[_0x1b3c('0xcb')]);rpcDb[_0x1b3c('0x86')](_0xab9e2c,_0x1b3c('0xcc'));if(ut[_0x1b3c('0x95')](_0xab9e2c)>=_0x227f69[_0x1b3c('0x98')]){_0x2e746a=ut[_0x1b3c('0x99')](_0xab9e2c,0xf,_0x1b3c('0x9a'));rpcDb[_0x1b3c('0x88')](_0x2e746a,_0x1b3c('0xcd'));}else{rpcDb[_0x1b3c('0x88')](_0xab9e2c,_0x1b3c('0xcd'));}delete this[_0x1b3c('0x69')][_0x5f09ab[_0x1b3c('0x9c')]];}if(!(_0xab9e2c[_0x1b3c('0x6e')]&&_0x389510==='16')){ut[_0x1b3c('0x74')](_0x227f69,_0x1b3c('0xce'));logger[_0x1b3c('0x6a')](_0x1b3c('0xcf'),_0xab9e2c['uniqueid'],_0x1b3c('0xa2'),_0x227f69['name'],'originated:\x20',_0x227f69[_0x1b3c('0x49')]);}if(_0x389510!==_0x1b3c('0xd0')){delete this[_0x1b3c('0x69')][_0x5f09ab[_0x1b3c('0x9c')]];delete this[_0x1b3c('0x69')][_0x5f09ab['destlinkedid']];}}};Preview[_0x1b3c('0x60')][_0x1b3c('0xd1')]=function(_0x216508,_0x327a8c,_0x21c1fd){if(_[_0x1b3c('0xd2')](_0x327a8c)&&_0x1b3c('0xd3')!==typeof _0x327a8c){return;}if(_[_0x1b3c('0xd2')](_0x21c1fd)&&'object'!==typeof _0x21c1fd){return;}switch(_0x21c1fd[_0x1b3c('0xd4')]){case'0':ut[_0x1b3c('0xd5')](_0x216508,0x0,_0x1b3c('0x96'));rpcDb[_0x1b3c('0xd6')](_0x216508,_0x1b3c('0xd7'));break;case'3':ut[_0x1b3c('0xd5')](_0x216508,0x3,_0x1b3c('0xbc'));rpcDb[_0x1b3c('0xd6')](_0x216508,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x216508,0x5,_0x1b3c('0xd8'));rpcDb[_0x1b3c('0xd6')](_0x216508,_0x1b3c('0xd9'));break;case'8':ut['logAgent'](_0x216508,0x8,'Congestion');rpcDb['createAgentHistory'](_0x216508,_0x1b3c('0xda'));break;case'22':ut[_0x1b3c('0xd5')](_0x216508,0x16,_0x1b3c('0xdb'));rpcDb['createAgentHistory'](_0x216508,_0x1b3c('0xdc'));break;default:ut[_0x1b3c('0xd5')](_0x216508,0xc,_0x21c1fd[_0x1b3c('0xd4')]);rpcDb['createAgentHistory'](_0x216508,_0x1b3c('0xda'));}ut['updateOriginated'](_0x327a8c,_0x1b3c('0xdd'));logger['info'](_0x1b3c('0xde'),_0x216508['uniqueid'],_0x1b3c('0xa2'),_0x327a8c[_0x1b3c('0x25')],_0x1b3c('0x6d'),_0x327a8c[_0x1b3c('0x49')]);delete this[_0x1b3c('0x69')][_0x216508['uniqueid']];};Preview[_0x1b3c('0x60')][_0x1b3c('0xdf')]=function(_0x46e448,_0xb9e295,_0x11934e,_0x72c6aa,_0x2e040c){var _0x3bacfa=this;return new BPromise(function(_0xb7c9e3,_0x56e597){if(_[_0x1b3c('0x68')](_0xb9e295)||_[_0x1b3c('0x68')](_0xb9e295['Contact'])||_[_0x1b3c('0x68')](_0xb9e295[_0x1b3c('0xe0')][_0x1b3c('0xe1')])||_[_0x1b3c('0x68')](_0xb9e295['VoiceQueueId'])){_0x56e597(ut[_0x1b3c('0x59')](_0x1b3c('0xe2'),_0x72c6aa,_0x2e040c));return;}var _0x375a6f=uuid['v4']();var _0x5a7de6=_0x3bacfa['campaignsPreview'][_0xb9e295[_0x1b3c('0xe3')][_0x1b3c('0x25')]];var _0x26ca9a=_0x11934e?_0x3bacfa[_0x1b3c('0x13')][_0x11934e]['id']:undefined;_0x3bacfa[_0x1b3c('0x69')][_0x375a6f]=new Action(_0xb9e295,_0x5a7de6,_0x375a6f,_0x11934e,_0x26ca9a);var _0x4c9e61=_0x3bacfa[_0x1b3c('0x69')][_0x375a6f];_0x4c9e61[_0x1b3c('0xb9')]=_0x72c6aa;_0x4c9e61[_0x1b3c('0xba')]=_0x2e040c;_0x4c9e61['lookAgent']=_0x11934e;if(_['isEmpty'](_0x46e448)){_0x3bacfa[_0x1b3c('0xe4')](_0x4c9e61,_0x5a7de6,_0xb9e295,_0x11934e)[_0x1b3c('0x7d')](function(_0x2927e1){logger[_0x1b3c('0x6a')](_0x1b3c('0xe5'),_0x1b3c('0xe6')+_0x4c9e61[_0x1b3c('0x6c')]+_0x1b3c('0xe7')+_0x4c9e61[_0x1b3c('0xc8')],JSON[_0x1b3c('0x52')](_0x2927e1));ami['emit'](_0x1b3c('0xe8'),ut[_0x1b3c('0xa5')](_0x4c9e61,_0x1b3c('0xe9')));_0xb7c9e3(ut['message'](_0x1b3c('0xea')));})[_0x1b3c('0x72')](function(_0x443d55){ut[_0x1b3c('0x5b')]('[Preview][execCall][failure]',_0x443d55);_0x56e597(ut['message'](_0x1b3c('0xeb'),_0x72c6aa,_0x2e040c));});}else{_0x5a7de6[_0x1b3c('0x36')]+=0x1;ut[_0x1b3c('0xec')](_0x4c9e61);rpcDb[_0x1b3c('0xed')](_0x4c9e61,_0x1b3c('0xee'));delete _0x3bacfa['actions'][_0x375a6f];_0x56e597(ut['message'](_0x1b3c('0xef'),_0x72c6aa,_0x2e040c));}});};Preview[_0x1b3c('0x60')]['isTrunkReachable']=function(_0x4e948b){return!_[_0x1b3c('0x68')](_0x4e948b)&&!_['isNil'](_0x4e948b[_0x1b3c('0x25')])&&!_[_0x1b3c('0x68')](_0x4e948b[_0x1b3c('0x4f')])&&_0x4e948b[_0x1b3c('0x4f')]&&!_[_0x1b3c('0x68')](this[_0x1b3c('0x12')][util['format']('SIP/%s',_0x4e948b[_0x1b3c('0x25')])])&&!_[_0x1b3c('0x68')](this['trunks'][util['format']('SIP/%s',_0x4e948b['name'])][_0x1b3c('0x70')])&&(this[_0x1b3c('0x12')][util[_0x1b3c('0x55')](_0x1b3c('0xf0'),_0x4e948b[_0x1b3c('0x25')])][_0x1b3c('0x70')]===_0x1b3c('0xf1')||this[_0x1b3c('0x12')][util[_0x1b3c('0x55')](_0x1b3c('0xf0'),_0x4e948b[_0x1b3c('0x25')])][_0x1b3c('0x70')]===_0x1b3c('0xf2'));};Preview['prototype'][_0x1b3c('0xf3')]=function(_0x5f188a,_0x4046b6){var _0xa318bc=this;return new BPromise(function(_0x4159d1,_0x5bf9be){_0xa318bc[_0x1b3c('0xf4')](_0x5f188a,_0x4046b6)['then'](function(_0x7af40){_0x4159d1(_[_0x1b3c('0x6f')](_0x7af40,[_0x1b3c('0x59')]));})['catch'](function(_0x1f878e){if(_0x1f878e['unlock']){rpcDb[_0x1b3c('0xf5')](_0x5f188a);}if(_0x1f878e[_0x1b3c('0x4f')]){rpcDb[_0x1b3c('0xf6')](_0x5f188a);}_0x5bf9be(_[_0x1b3c('0x6f')](_0x1f878e,[_0x1b3c('0x59')]));});});};Preview[_0x1b3c('0x60')][_0x1b3c('0xf4')]=function(_0x3ae674,_0x55f403){var _0x32f736=this;return new BPromise(function(_0xdc6c11,_0x481f6a){var _0x5196e4,_0x54ba5c;rpcDb['getContactPreview'](_0x3ae674)[_0x1b3c('0x7d')](function(_0x53e966){if(!_[_0x1b3c('0x68')](_0x53e966[0x0])){_0x54ba5c=_0x53e966[0x0][_0x1b3c('0xf7')]?![]:!![];_0x5196e4=_0x53e966[0x0]['recallme']?!![]:![];_0x5196e4=_0x55f403?!![]:_0x5196e4;}var _0x3c913b=_0x32f736[_0x1b3c('0xf8')](_0x53e966);if(_0x3c913b[_0x1b3c('0xf9')]){rpcDb[_0x1b3c('0xfa')](_[_0x1b3c('0x6f')](_0x53e966[0x0],[_0x1b3c('0xfb'),_0x1b3c('0xfc')]))[_0x1b3c('0x7d')](function(_0x2309b1){_0x32f736[_0x1b3c('0xdf')](_0x2309b1,_0x53e966[0x0],_0x55f403,_0x54ba5c,_0x5196e4)['then'](function(_0x2acd39){_0xdc6c11(_0x2acd39);})[_0x1b3c('0x72')](function(_0x1207ff){_0x481f6a(_0x1207ff);});})['catch'](function(_0x189842){ut[_0x1b3c('0x5b')]('[Preview][checkIsBlackList]',_0x189842);_0x481f6a(ut[_0x1b3c('0x59')](_0x1b3c('0xfd'),_0x54ba5c,_0x5196e4));});}else{_0x481f6a(ut[_0x1b3c('0x59')](_0x3c913b[_0x1b3c('0x59')],_0x54ba5c,_0x5196e4));}})[_0x1b3c('0x72')](function(_0x1f5623){ut['logger'](_0x1b3c('0xfe'),_0x1f5623);_0x481f6a(ut[_0x1b3c('0x59')](_0x1b3c('0xfd'),![],!![]));});});};Preview[_0x1b3c('0x60')][_0x1b3c('0xf8')]=function(_0x3b9877){if(_['isNil'](_0x3b9877)||_[_0x1b3c('0xff')](_0x3b9877)||!_['isNil'](_0x3b9877[0x0]['Agent'])&&_['isNil'](_0x3b9877[0x0][_0x1b3c('0x100')][_0x1b3c('0x25')])){ut[_0x1b3c('0x5b')](_0x1b3c('0x101'),_0x3b9877);return{'isValid':![],'message':_0x1b3c('0x102')};}var _0x4d39a9=this[_0x1b3c('0x22')][_0x3b9877[0x0][_0x1b3c('0xe3')][_0x1b3c('0x25')]];_0x4d39a9[_0x1b3c('0x59')]='ACTIVE';if(_['isNil'](_0x4d39a9)){ut[_0x1b3c('0x5b')](_0x1b3c('0x103'),_0x4d39a9);return{'isValid':![],'message':_0x1b3c('0x104')};}if(!this[_0x1b3c('0x8f')](_0x4d39a9['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x1b3c('0x105')+_0x4d39a9[_0x1b3c('0x25')]+_0x1b3c('0x106'));if(!this[_0x1b3c('0x8f')](_0x4d39a9['TrunkBackup'])){ut[_0x1b3c('0x5b')](_0x1b3c('0x107'),_0x4d39a9[_0x1b3c('0x25')]+_0x1b3c('0x108'));return{'isValid':![],'message':_0x1b3c('0x109')};}}if(!ut[_0x1b3c('0x8e')](_0x4d39a9[_0x1b3c('0x2f')])){ut['logger'](_0x1b3c('0x10a'),_0x4d39a9['name']+_0x1b3c('0x10b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d39a9[_0x1b3c('0x25')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x1b3c('0x60')][_0x1b3c('0xe4')]=function(_0x3a99f1,_0x3c55fa,_0x34723b,_0x94dcc7){var _0x764f0c=this;return new BPromise(function(_0xe9cb3a,_0x354ab4){var _0x2457c4=_0x3a99f1['uniqueid'];var _0x5d610b=_0x764f0c['isTrunkReachable'](_0x3c55fa['Trunk'])?util[_0x1b3c('0x55')]('SIP/%s/%s%s',_0x3c55fa[_0x1b3c('0x4e')][_0x1b3c('0x25')],_[_0x1b3c('0x68')](_0x3c55fa[_0x1b3c('0x33')])?'':_0x3c55fa[_0x1b3c('0x33')][_0x1b3c('0x10c')]()||'',_0x3c55fa[_0x1b3c('0x10d')]>0x0?_0x34723b[_0x1b3c('0xe0')]['phone'][_0x1b3c('0x10e')](_0x3c55fa[_0x1b3c('0x10d')]):_0x34723b[_0x1b3c('0xe0')][_0x1b3c('0xe1')]):util[_0x1b3c('0x55')](_0x1b3c('0x10f'),_[_0x1b3c('0x68')](_0x3c55fa[_0x1b3c('0x110')])?_0x3c55fa[_0x1b3c('0x4e')][_0x1b3c('0x25')]:_0x3c55fa[_0x1b3c('0x110')]['name'],_[_0x1b3c('0x68')](_0x3c55fa[_0x1b3c('0x33')])?'':_0x3c55fa[_0x1b3c('0x33')][_0x1b3c('0x10c')]()||'',_0x3c55fa[_0x1b3c('0x10d')]>0x0?_0x34723b[_0x1b3c('0xe0')][_0x1b3c('0xe1')][_0x1b3c('0x10e')](_0x3c55fa[_0x1b3c('0x10d')]):_0x34723b['Contact'][_0x1b3c('0xe1')]);var _0x21f399=_0x764f0c[_0x1b3c('0x8f')](_0x3c55fa[_0x1b3c('0x4e')])?ut[_0x1b3c('0x111')](_0x3c55fa[_0x1b3c('0x4e')][_0x1b3c('0x50')],_0x3c55fa[_0x1b3c('0x30')],_0x3c55fa[_0x1b3c('0x112')]>0x0?ut[_0x1b3c('0x113')](_0x3c55fa['dialOriginateCallerIdNumber'],_0x3c55fa[_0x1b3c('0x112')]):_0x3c55fa[_0x1b3c('0x31')]):ut[_0x1b3c('0x111')](_[_0x1b3c('0x68')](_0x3c55fa[_0x1b3c('0x110')])?_0x3c55fa[_0x1b3c('0x4e')]['callerid']:_0x3c55fa[_0x1b3c('0x110')][_0x1b3c('0x50')],_0x3c55fa['dialOriginateCallerIdName'],_0x3c55fa[_0x1b3c('0x112')]>0x0?ut[_0x1b3c('0x113')](_0x3c55fa[_0x1b3c('0x31')],_0x3c55fa[_0x1b3c('0x112')]):_0x3c55fa[_0x1b3c('0x31')]);if(_0x21f399){_0x3a99f1[_0x1b3c('0x114')]=ut[_0x1b3c('0x115')](_0x21f399);_0x3a99f1[_0x1b3c('0x116')]=ut[_0x1b3c('0x117')](_0x21f399);}var _0xea8b7a=ut[_0x1b3c('0x118')](_0x3c55fa,_0x34723b,_0x5d610b,_0x21f399,_0x2457c4,_0x3a99f1);_[_0x1b3c('0x119')](_0x3a99f1,ut[_0x1b3c('0x11a')](_0xea8b7a));_0x3a99f1[_0x1b3c('0x81')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x1b3c('0x11b')](ut['variablesAction'](_0x3a99f1,_0x3c55fa,_0xea8b7a,_0x3a99f1['activeContact'],_0x94dcc7))[_0x1b3c('0x7d')](function(_0x741e5){_0x3c55fa['originated']+=0x1;logger['info']('[originated][increment]',_0x2457c4,_0x1b3c('0xa2'),_0x3c55fa[_0x1b3c('0x25')],_0x1b3c('0x6d'),_0x3c55fa[_0x1b3c('0x49')]);_0xe9cb3a(_0x741e5);})[_0x1b3c('0x72')](function(_0x2e95ef){ut[_0x1b3c('0xd5')](_0x3a99f1,0xe,_0x1b3c('0x11c'));rpcDb['createAgentHistory'](_0x3a99f1,_0x1b3c('0x11d'));_0x354ab4(_0x2e95ef);});});};Preview[_0x1b3c('0x60')]['syncNewExten']=function(_0x4ffbc5){if(this[_0x1b3c('0x69')][_0x4ffbc5['linkedid']]){this['actions'][_0x4ffbc5[_0x1b3c('0x9c')]]['channel']=_0x4ffbc5[_0x1b3c('0x71')];}};Preview[_0x1b3c('0x60')][_0x1b3c('0x15')]=function(_0x2d6a3a){var _0x4ea78f=this;var _0xbc53ca=this[_0x1b3c('0x69')][_0x2d6a3a[_0x1b3c('0x11e')]];if(_0xbc53ca){if(_0xbc53ca[_0x1b3c('0x11f')]&&this[_0x1b3c('0x13')][_0xbc53ca['lookAgent']]){ut[_0x1b3c('0x120')](_0xbc53ca,this[_0x1b3c('0x13')][_0xbc53ca[_0x1b3c('0x11f')]][_0x1b3c('0x25')],this[_0x1b3c('0x13')][_0xbc53ca[_0x1b3c('0x11f')]]['id']);}var _0x377cbf=_['clone'](_0xbc53ca);_0x377cbf[_0x1b3c('0x9e')]=moment()[_0x1b3c('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x24e7b6=_0x4ea78f[_0x1b3c('0x22')][_0xbc53ca[_0x1b3c('0x6c')]];if(ut[_0x1b3c('0x121')](_0x2d6a3a['response'])){if(_0xbc53ca[_0x1b3c('0xb9')]){rpcDb[_0x1b3c('0xf5')](_0xbc53ca[_0x1b3c('0xc8')]);}if(_0xbc53ca[_0x1b3c('0xba')]){rpcDb[_0x1b3c('0xf6')](_0xbc53ca[_0x1b3c('0xc8')]);}ami[_0x1b3c('0x23')](_0x1b3c('0x122'),ut['buildObj'](_0xbc53ca,_0x1b3c('0x123')));this[_0x1b3c('0xd1')](_0x377cbf,_0x24e7b6,_0x2d6a3a);}else{_0xbc53ca[_0x1b3c('0x81')]=moment()[_0x1b3c('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x377cbf,0x4,_0x1b3c('0xac'));rpcDb[_0x1b3c('0xd6')](_0x377cbf,_0x1b3c('0x124'));}}};Preview[_0x1b3c('0x60')][_0x1b3c('0x16')]=function(_0x354b70){var _0x2b6697=this;var _0x4f3401=this[_0x1b3c('0x69')][_0x354b70[_0x1b3c('0x9c')]];var _0x36064f;if(_0x4f3401){_0x36064f=this[_0x1b3c('0x22')][_0x4f3401[_0x1b3c('0x6c')]];logger['info'](_0x1b3c('0x125'),_0x354b70['linkedid'],_0x1b3c('0xa2'),_0x36064f[_0x1b3c('0x25')],'pTalking:\x20',_0x36064f[_0x1b3c('0xa0')]);}if(this[_0x1b3c('0x69')][_0x354b70[_0x1b3c('0x9c')]]&&_0x354b70['linkedid']!==_0x354b70[_0x1b3c('0xa1')]){if(_0x354b70['cause']==='16'&&this[_0x1b3c('0x69')][_0x354b70[_0x1b3c('0x9c')]][_0x1b3c('0x6e')]){this[_0x1b3c('0x92')](_0x354b70,_0x354b70['linkedid'],_0x354b70['cause']);}else if(this['actions'][_0x354b70[_0x1b3c('0x9c')]][_0x1b3c('0x6e')]){logger[_0x1b3c('0x6a')](_0x1b3c('0x126'),_0x354b70[_0x1b3c('0x9c')],_0x354b70[_0x1b3c('0x127')],'\x20Queue',_0x36064f[_0x1b3c('0x25')],'pTalking:\x20',_0x36064f[_0x1b3c('0xa0')]);this[_0x1b3c('0x92')](_0x354b70,_0x354b70[_0x1b3c('0x9c')],_0x354b70['cause']);}}else if(_0x4f3401&&_[_0x1b3c('0x68')](_0x4f3401[_0x1b3c('0x128')])&&_0x36064f['dialQueueProject']&&_0x354b70[_0x1b3c('0x9c')]===_0x354b70[_0x1b3c('0xa1')]&&_[_0x1b3c('0x68')](_0x354b70[_0x1b3c('0xd4')])&&_0x354b70[_0x1b3c('0x127')]==='16'&&_0x354b70[_0x1b3c('0x129')]==='6'&&_['isUndefined'](_0x4f3401[_0x1b3c('0x12a')])){if(_0x4f3401[_0x1b3c('0xb9')]){rpcDb[_0x1b3c('0xf5')](_0x4f3401['idContact']);}if(_0x4f3401[_0x1b3c('0xba')]){rpcDb['disableContact'](_0x4f3401[_0x1b3c('0xc8')]);}_0x354b70['reason']='22';this['callProgressDetectingAgent'](_0x4f3401,_0x36064f,_0x354b70);}else if(_0x4f3401&&_0x4f3401[_0x1b3c('0x12a')]){if(_0x354b70[_0x1b3c('0x127')]==='16'&&this[_0x1b3c('0x69')][_0x354b70[_0x1b3c('0x9c')]]['dialAnswer']){logger[_0x1b3c('0x6a')](_0x1b3c('0x12b'),_0x354b70[_0x1b3c('0x9c')],_0x354b70[_0x1b3c('0x127')],'\x20Queue',_0x36064f[_0x1b3c('0x25')],_0x1b3c('0xa3'),_0x36064f[_0x1b3c('0xa0')]);this[_0x1b3c('0x92')](_0x354b70,_0x354b70[_0x1b3c('0x9c')],_0x354b70['cause']);}else if(this[_0x1b3c('0x69')][_0x354b70[_0x1b3c('0x9c')]][_0x1b3c('0x6e')]){logger[_0x1b3c('0x6a')](_0x1b3c('0x126'),_0x354b70[_0x1b3c('0x9c')],_0x354b70[_0x1b3c('0x127')],_0x1b3c('0xa2'),_0x36064f[_0x1b3c('0x25')],_0x1b3c('0xa3'),_0x36064f[_0x1b3c('0xa0')]);this[_0x1b3c('0x92')](_0x354b70,_0x354b70[_0x1b3c('0x9c')],_0x354b70[_0x1b3c('0x127')]);}}};Preview[_0x1b3c('0x60')]['syncDialEnd']=function(_0x325fed){if(this[_0x1b3c('0x69')][_0x325fed[_0x1b3c('0x12c')]]&&_0x325fed[_0x1b3c('0x12c')]!==_0x325fed[_0x1b3c('0x12d')]){this[_0x1b3c('0x92')](_0x325fed,_0x325fed[_0x1b3c('0x12c')],_0x325fed['dialstatus']);}};Preview[_0x1b3c('0x60')][_0x1b3c('0x17')]=function(_0x15d5ef){if(this[_0x1b3c('0x69')][_0x15d5ef['linkedid']]&&_0x15d5ef[_0x1b3c('0x9c')]!==_0x15d5ef['uniqueid']&&!this[_0x1b3c('0x69')][_0x15d5ef[_0x1b3c('0x9c')]]['dialAnswer']){if(_0x15d5ef[_0x1b3c('0x127')]==='1'){this[_0x1b3c('0x92')](_0x15d5ef,_0x15d5ef[_0x1b3c('0x9c')],_0x15d5ef[_0x1b3c('0x127')]);}}};Preview['prototype']['addVariable']=function(_0x144b99,_0x17e155,_0x4f1e59){if(this['actions'][_0x144b99]){if(_['isNil'](this[_0x1b3c('0x69')][_0x144b99][_0x1b3c('0x12e')])){this[_0x1b3c('0x69')][_0x144b99][_0x1b3c('0x12e')]={};}this[_0x1b3c('0x69')][_0x144b99][_0x1b3c('0x12e')][_0x17e155]=_0x4f1e59;}};Preview['prototype'][_0x1b3c('0x1e')]=function(_0xc87d91){try{if(!_[_0x1b3c('0x68')](_0xc87d91)){if(ut[_0x1b3c('0x12f')](_[_0x1b3c('0x130')](_0xc87d91[_0x1b3c('0x131')])[0x0])){this[_0x1b3c('0x132')](_0xc87d91['uniqueid'],_[_0x1b3c('0x130')](_0xc87d91[_0x1b3c('0x131')])[0x0],_0xc87d91[_0x1b3c('0x133')]);}}}catch(_0x48a887){logger[_0x1b3c('0x134')](_0x1b3c('0x135'),util['inspect'](_0x48a887,{'showHidden':![],'depth':null}));}};Preview[_0x1b3c('0x60')]['syncAttendedTransfer']=function(_0x5c85be){if(_0x5c85be){if(this[_0x1b3c('0x69')][_0x5c85be['transfertargetlinkedid']]){this[_0x1b3c('0x69')][_0x5c85be[_0x1b3c('0x136')]]['transfer']=!![];}}};Preview[_0x1b3c('0x60')][_0x1b3c('0x137')]=function(_0x444aad){if(_0x444aad){if(this[_0x1b3c('0x69')][_0x444aad[_0x1b3c('0x138')]]){this[_0x1b3c('0x69')][_0x444aad[_0x1b3c('0x138')]][_0x1b3c('0x12a')]=!![];}}};module[_0x1b3c('0x139')]=Preview; \ No newline at end of file +var _0xe1f2=['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','dialPrefix','trim','substring','phone','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','md5','voice:queue:%s','format','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','dialActive','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','stringify','queue','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','clearZombieChannels','info','[action]','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','run','[RecallMe]','catch','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','callProgressDetectingCustomer','outboundNoSuchCallsDay','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','emit','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','total','decrementTalkink','[16]','countglobal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','outboundBusyCallsDay','countbusyretry','[callProgressDetectingCustomer][logBusy]','cloneAction','rescheduleContact','scheduledAt','unlockAgent','activeContact','NOANSWER','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlock','getContactPreview','recallme','isValid','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]'];(function(_0x23a1c0,_0x491c31){var _0x19b696=function(_0x580d87){while(--_0x580d87){_0x23a1c0['push'](_0x23a1c0['shift']());}};_0x19b696(++_0x491c31);}(_0xe1f2,0x172));var _0x2e1f=function(_0x4024bd,_0x164def){_0x4024bd=_0x4024bd-0x0;var _0x5cbe79=_0xe1f2[_0x4024bd];return _0x5cbe79;};'use strict';var util=require(_0x2e1f('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x2e1f('0x1'));var md5=require('md5');var Redis=require(_0x2e1f('0x2'));var config=require(_0x2e1f('0x3'));var logger=require(_0x2e1f('0x4'))(_0x2e1f('0x5'));var loggerAction=require(_0x2e1f('0x4'))(_0x2e1f('0x6'));var ami=require(_0x2e1f('0x7'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require('./util/util');config['redis']=_['defaults'](config['redis'],{'host':_0x2e1f('0x8'),'port':0x18eb});var io=require(_0x2e1f('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x2e1f('0xa')][_0x2e1f('0xb')]=function(_0x364dc9){this[_0x2e1f('0xc')]=this['tail']?this[_0x2e1f('0xc')][_0x2e1f('0xd')](_0x364dc9):_0x364dc9();};function Preview(_0x1a7393){this[_0x2e1f('0xe')]=new Sequence();this['campaignsPreview']=_0x1a7393[_0x2e1f('0xf')];this[_0x2e1f('0x10')]=_0x1a7393[_0x2e1f('0x10')];this[_0x2e1f('0x11')]={};this['agents']=_0x1a7393[_0x2e1f('0x12')];this[_0x2e1f('0x13')]=0x0;ami['on']('originateresponse',this[_0x2e1f('0x14')][_0x2e1f('0x15')](this));ami['on']('hangup',this[_0x2e1f('0x16')][_0x2e1f('0x15')](this));ami['on']('hanguprequest',this[_0x2e1f('0x17')][_0x2e1f('0x15')](this));ami['on'](_0x2e1f('0x18'),this[_0x2e1f('0x19')][_0x2e1f('0x15')](this));ami['on'](_0x2e1f('0x1a'),this[_0x2e1f('0x1b')][_0x2e1f('0x15')](this));ami['on'](_0x2e1f('0x1c'),this[_0x2e1f('0x1d')]['bind'](this));ami['on'](_0x2e1f('0x1e'),this[_0x2e1f('0x1f')][_0x2e1f('0x15')](this));ami['on'](_0x2e1f('0x20'),this[_0x2e1f('0x21')][_0x2e1f('0x15')](this));this[_0x2e1f('0x22')](this[_0x2e1f('0x23')]);}function emit(_0x1639c5,_0x358f4c,_0x232590){io['to'](_0x1639c5)['emit'](_0x358f4c,_0x232590);}function emitCampaignPreview(_0x4e1701){if(_0x4e1701[_0x2e1f('0x24')]===_0x2e1f('0x25')){var _0x76f1ed={'id':_0x4e1701['id'],'name':_0x4e1701[_0x2e1f('0x26')],'strategy':_0x4e1701[_0x2e1f('0x27')],'answered':_0x4e1701[_0x2e1f('0x28')],'available':_0x4e1701[_0x2e1f('0x29')],'loggedIn':_0x4e1701[_0x2e1f('0x2a')],'pTalking':_0x4e1701[_0x2e1f('0x2b')],'sumBillable':_0x4e1701[_0x2e1f('0x2c')],'sumDuration':_0x4e1701[_0x2e1f('0x2d')],'sumHoldTime':_0x4e1701['sumHoldTime']||0x0,'talking':_0x4e1701['talking'],'total':_0x4e1701['total'],'type':_0x4e1701[_0x2e1f('0x24')],'unmanaged':_0x4e1701[_0x2e1f('0x2e')],'abandoned':_0x4e1701['abandoned'],'waiting':_0x4e1701['waiting'],'loggedInDb':_0x4e1701[_0x2e1f('0x2f')],'dialActive':_0x4e1701['dialActive'],'dialMethod':_0x4e1701[_0x2e1f('0x30')],'dialOriginateCallerIdName':_0x4e1701[_0x2e1f('0x31')],'dialOriginateCallerIdNumber':_0x4e1701[_0x2e1f('0x32')],'dialOriginateTimeout':_0x4e1701[_0x2e1f('0x33')],'dialPrefix':_0x4e1701['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4e1701[_0x2e1f('0x34')],'outboundAnswerCallsDay':_0x4e1701[_0x2e1f('0x35')],'outboundBlacklistCallsDay':_0x4e1701['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4e1701['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4e1701[_0x2e1f('0x36')],'outboundDropCallsDayACS':_0x4e1701[_0x2e1f('0x37')],'outboundDropCallsDayCallersExit':_0x4e1701[_0x2e1f('0x38')],'outboundDropCallsDayTimeout':_0x4e1701[_0x2e1f('0x39')],'outboundNoAnswerCallsDay':_0x4e1701[_0x2e1f('0x3a')],'outboundNoSuchCallsDay':_0x4e1701['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4e1701['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4e1701[_0x2e1f('0x3b')],'outboundRejectCallsDay':_0x4e1701[_0x2e1f('0x3c')],'outboundUnknownCallsDay':_0x4e1701[_0x2e1f('0x3d')],'predictiveIntervalAnsweredCalls':_0x4e1701[_0x2e1f('0x3e')],'predictiveIntervalAvgHoldtime':_0x4e1701[_0x2e1f('0x3f')],'predictiveIntervalAvgTalktime':_0x4e1701['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4e1701[_0x2e1f('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x4e1701[_0x2e1f('0x41')],'predictiveIntervalErlangCalls':_0x4e1701[_0x2e1f('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x4e1701['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4e1701[_0x2e1f('0x43')],'predictiveIntervalMultiplicativeFactor':_0x4e1701[_0x2e1f('0x44')],'predictiveIntervalPauses':_0x4e1701[_0x2e1f('0x45')],'predictiveIntervalAvailable':_0x4e1701[_0x2e1f('0x46')],'predictiveIntervalTotalCalls':_0x4e1701[_0x2e1f('0x47')],'message':_0x4e1701[_0x2e1f('0x48')],'originated':_0x4e1701[_0x2e1f('0x49')],'erlangCalls':_0x4e1701[_0x2e1f('0x4a')],'erlangCallToSecond':_0x4e1701[_0x2e1f('0x4b')],'erlangAbandonmentRate':_0x4e1701[_0x2e1f('0x4c')],'erlangBusyFactor':_0x4e1701['erlangBusyFactor'],'startPredictive':_0x4e1701[_0x2e1f('0x4d')],'startProgressive':_0x4e1701[_0x2e1f('0x4e')]};if(_0x4e1701[_0x2e1f('0x4f')]){_0x76f1ed[_0x2e1f('0x4f')]={'id':_0x4e1701[_0x2e1f('0x4f')]['id'],'name':_0x4e1701[_0x2e1f('0x4f')][_0x2e1f('0x26')],'active':_0x4e1701[_0x2e1f('0x4f')][_0x2e1f('0x50')],'callerid':_0x4e1701[_0x2e1f('0x4f')][_0x2e1f('0x51')]};}if(_0x4e1701[_0x2e1f('0x52')]){_0x76f1ed[_0x2e1f('0x52')]={'id':_0x4e1701[_0x2e1f('0x52')]['id'],'name':_0x4e1701['Interval']['name']};}var _0x3d6b50=md5(JSON['stringify'](_0x76f1ed));if(_0x4e1701[_0x2e1f('0x53')]!==_0x3d6b50){_0x4e1701[_0x2e1f('0x53')]=_0x3d6b50;emit(util['format'](_0x2e1f('0x54'),_0x76f1ed[_0x2e1f('0x26')]),'voice_queue:save',_0x76f1ed);}}}function emitVoiceQueueChannelRemove(_0x452208){emit(util[_0x2e1f('0x55')](_0x2e1f('0x54'),_0x452208[_0x2e1f('0x26')]),_0x2e1f('0x56'),_0x452208);}function notSendMessagesQueue(_0x17adaf){if(_0x17adaf['sendMessageOneNotActive']){if(_0x17adaf['originated']===0x0&&_0x17adaf[_0x2e1f('0x2b')]===0x0){_0x17adaf[_0x2e1f('0x57')]=![];_0x17adaf[_0x2e1f('0x29')]=0x0;_0x17adaf[_0x2e1f('0x58')]=0x0;_0x17adaf[_0x2e1f('0x48')]=_0x2e1f('0x59');ut[_0x2e1f('0x5a')](_0x2e1f('0x5b'),_0x17adaf[_0x2e1f('0x26')]+_0x2e1f('0x5c'));}else{_0x17adaf[_0x2e1f('0x48')]=_0x2e1f('0x5d');ut[_0x2e1f('0x5a')](_0x2e1f('0x5b'),_0x17adaf['name']+_0x2e1f('0x5e'));}emitCampaignPreview(_0x17adaf);}}Preview[_0x2e1f('0xa')][_0x2e1f('0x22')]=function(){var _0x30f7c3=this;setInterval(function(){_0x30f7c3[_0x2e1f('0x5f')]();},0x7cf);};Preview[_0x2e1f('0xa')][_0x2e1f('0x5f')]=function(){var _0x52d12d=this[_0x2e1f('0x23')];this['clockClearZombieChannels']+=0x1;for(var _0x112531 in _0x52d12d){if(_0x52d12d[_0x2e1f('0x60')](_0x112531)&&(_0x52d12d[_0x112531][_0x2e1f('0x30')]===_0x2e1f('0x5')||_0x52d12d[_0x112531][_0x2e1f('0x30')]===_0x2e1f('0x61'))&&_0x52d12d[_0x112531][_0x2e1f('0x24')]===_0x2e1f('0x25')){if(this[_0x2e1f('0x13')]>0x7){this[_0x2e1f('0x13')]=0x0;this['clearZombieChannels']();}}if(_0x52d12d[_0x2e1f('0x60')](_0x112531)&&_0x52d12d[_0x112531]['dialMethod']===_0x2e1f('0x5')&&_0x52d12d[_0x112531][_0x2e1f('0x24')]===_0x2e1f('0x25')){if(_0x52d12d[_0x112531][_0x2e1f('0x62')]){this[_0x2e1f('0x63')](_0x52d12d[_0x112531]);this[_0x2e1f('0x64')](_0x52d12d[_0x112531]);}else{notSendMessagesQueue(_0x52d12d[_0x112531]);}}}};Preview['prototype'][_0x2e1f('0x65')]=function(_0x947934){var _0x122a36=this;this['sequence'][_0x2e1f('0xb')](function(){if(!_[_0x2e1f('0x66')](_0x122a36[_0x2e1f('0x11')][_0x947934])){loggerAction['info'](_0x2e1f('0x67'),_0x947934,_0x2e1f('0x68'),_0x122a36[_0x2e1f('0x11')][_0x947934]['queue'],_0x2e1f('0x69'),JSON[_0x2e1f('0x6a')](_0x122a36[_0x2e1f('0x23')][_0x122a36[_0x2e1f('0x11')][_0x947934][_0x2e1f('0x6b')]][_0x2e1f('0x49')]),'pTalking:\x20',JSON['stringify'](_0x122a36['campaignsPreview'][_0x122a36[_0x2e1f('0x11')][_0x947934][_0x2e1f('0x6b')]]['pTalking']),JSON['stringify'](_0x122a36[_0x2e1f('0x11')][_0x947934]['dialAnswer']),JSON[_0x2e1f('0x6a')](_[_0x2e1f('0x6c')](_0x122a36['actions'][_0x947934],[_0x2e1f('0x6d'),_0x2e1f('0x6e'),_0x2e1f('0x6f'),_0x2e1f('0x70')])));return ami[_0x2e1f('0x71')]({'action':_0x2e1f('0x72'),'channel':_0x122a36[_0x2e1f('0x11')][_0x947934][_0x2e1f('0x73')]})['catch'](function(_0x1907ec){if(_0x1907ec[_0x2e1f('0x48')]===_0x2e1f('0x74')){setTimeout(function(){if(_0x122a36[_0x2e1f('0x11')][_0x947934]){ut[_0x2e1f('0x75')](_0x122a36['campaignsPreview'][_0x122a36[_0x2e1f('0x11')][_0x947934][_0x2e1f('0x6b')]],_0x2e1f('0x76'));if(_0x122a36[_0x2e1f('0x11')][_0x947934][_0x2e1f('0x77')]===!![]){ut['decrementTalkink'](_0x122a36['campaignsPreview'][_0x122a36[_0x2e1f('0x11')][_0x947934][_0x2e1f('0x6b')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x947934,_0x122a36[_0x2e1f('0x11')][_0x947934][_0x2e1f('0x6b')]);}ut[_0x2e1f('0x78')]('[Dialer][checkChannel][Preview]'+_0x947934,_0x122a36['actions'][_0x947934][_0x2e1f('0x6b')]);delete _0x122a36['actions'][_0x947934];}},0x2328);}});}});};Preview[_0x2e1f('0xa')][_0x2e1f('0x79')]=function(){var _0xcd7d35=this;loggerAction[_0x2e1f('0x7a')](_0x2e1f('0x7b'),_['size'](this[_0x2e1f('0x11')]));for(var _0x3665e5 in this[_0x2e1f('0x11')]){if(_0xcd7d35[_0x2e1f('0x11')][_0x2e1f('0x60')](_0x3665e5)){_0xcd7d35[_0x2e1f('0x65')](_0x3665e5);}}};Preview['prototype']['recallMe']=function(_0x1a20f4){var _0x456ff7=this;rpcDb[_0x2e1f('0x7c')](_0x1a20f4['id'],ut[_0x2e1f('0x7d')](this[_0x2e1f('0x12')]))[_0x2e1f('0x7e')](function(_0x366f44){if(!_[_0x2e1f('0x66')](_0x366f44)){for(var _0x3f955f=0x0;_0x3f955f<_0x366f44[_0x2e1f('0x7f')];_0x3f955f+=0x1){if(ut['getDiff'](_0x366f44[_0x3f955f][_0x2e1f('0x80')])<_0x1a20f4[_0x2e1f('0x81')]*0x3c){_0x456ff7[_0x2e1f('0x82')](_0x366f44[_0x3f955f]['id'])[_0x2e1f('0x7e')](ut['logger2'](_0x2e1f('0x83')))[_0x2e1f('0x84')](ut[_0x2e1f('0x85')](_0x2e1f('0x83')));}else{var _0x12289b=new Action(_0x366f44[_0x3f955f],_0x1a20f4);_0x12289b[_0x2e1f('0x86')]=moment()[_0x2e1f('0x55')](_0x2e1f('0x87'));_0x1a20f4['outboundReCallsDay']+=0x1;ut[_0x2e1f('0x88')](_0x12289b,0x17,_0x2e1f('0x89'));if(_0x1a20f4[_0x2e1f('0x8a')]){rpcDb['rescheduleContactInQueue'](ut[_0x2e1f('0x8b')](_0x366f44[_0x3f955f]));rpcDb[_0x2e1f('0x8c')](_0x12289b,_0x2e1f('0x8d'));}else{ut['logCustomer'](_0x12289b,0x16,_0x2e1f('0x8e'));rpcDb[_0x2e1f('0x8c')](_0x12289b,'[HistoryRecallClose]');rpcDb[_0x2e1f('0x8f')](_0x12289b,_0x2e1f('0x90'));}}}}})[_0x2e1f('0x84')](ut['logger2'](_0x2e1f('0x91')));};Preview[_0x2e1f('0xa')][_0x2e1f('0x63')]=function(_0x3bc032){_0x3bc032[_0x2e1f('0x57')]=!![];if(ut[_0x2e1f('0x92')](_0x3bc032[_0x2e1f('0x2a')])){_0x3bc032[_0x2e1f('0x48')]=_0x2e1f('0x93');}else if(!ut['isActive'](_0x3bc032['dialActive'])){_0x3bc032[_0x2e1f('0x48')]=_0x2e1f('0x59');}else if(!this['isTrunkReachable'](_0x3bc032[_0x2e1f('0x4f')])){if(!this[_0x2e1f('0x94')](_0x3bc032[_0x2e1f('0x95')])){_0x3bc032['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x3bc032[_0x2e1f('0x48')]='ACTIVE';}}else{_0x3bc032['message']='ACTIVE';}emitCampaignPreview(_0x3bc032);};Preview['prototype'][_0x2e1f('0x96')]=function(_0x6d4740,_0x72e263,_0x2c2046){var _0x377549=this;var _0x58f296=this[_0x2e1f('0x11')][_0x72e263];var _0x3ed5b1=this[_0x2e1f('0x23')][_0x58f296[_0x2e1f('0x6b')]];var _0x46020b;if(_0x3ed5b1){switch(_0x2c2046){case'1':_0x3ed5b1[_0x2e1f('0x97')]+=0x1;_0x58f296['countglobal']=ut[_0x2e1f('0x98')](_0x58f296);ut[_0x2e1f('0x88')](_0x58f296,0x0,_0x2e1f('0x99'));rpcDb[_0x2e1f('0x8c')](_0x58f296,_0x2e1f('0x9a'));if(ut[_0x2e1f('0x98')](_0x58f296)>=_0x3ed5b1[_0x2e1f('0x9b')]){_0x46020b=ut['cloneAction'](_0x58f296,0xf,_0x2e1f('0x9c'));rpcDb[_0x2e1f('0x8f')](_0x46020b,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x2e1f('0x8f')](_0x58f296,_0x2e1f('0x9d'));}delete this[_0x2e1f('0x11')][_0x6d4740[_0x2e1f('0x9e')]];break;case'ANSWER':var _0x1a5f7c=moment()[_0x2e1f('0x55')](_0x2e1f('0x87'));_0x58f296[_0x2e1f('0x9f')]=_0x1a5f7c;_0x58f296[_0x2e1f('0xa0')]=_0x1a5f7c;_0x58f296[_0x2e1f('0x77')]=!![];_0x3ed5b1[_0x2e1f('0x2b')]+=0x1;logger['info'](_0x2e1f('0xa1'),_0x58f296[_0x2e1f('0xa2')],_0x2e1f('0xa3'),_0x3ed5b1[_0x2e1f('0x26')],_0x2e1f('0xa4'),_0x3ed5b1[_0x2e1f('0x2b')]);ami[_0x2e1f('0xa5')](_0x2e1f('0xa6'),ut['buildObj'](_0x58f296,'connect'));if(_0x3ed5b1[_0x2e1f('0xa7')]){ami[_0x2e1f('0xa5')](_0x2e1f('0xa8'),ut[_0x2e1f('0xa9')](_0x58f296));}break;case'16':ami['emit'](_0x2e1f('0xaa'),ut[_0x2e1f('0xab')](_0x58f296,_0x2e1f('0xac')));emitVoiceQueueChannelRemove(ut[_0x2e1f('0xab')](_0x58f296,'complete'));_0x3ed5b1['outboundAnswerCallsDay']+=0x1;_0x3ed5b1[_0x2e1f('0xad')]+=0x1;_0x3ed5b1[_0x2e1f('0x28')]+=0x1;ut[_0x2e1f('0xae')](_0x3ed5b1,_0x2e1f('0xaf'));_0x58f296[_0x2e1f('0xb0')]=ut[_0x2e1f('0x98')](_0x58f296);ut[_0x2e1f('0x88')](_0x58f296,0x4,'Answer');rpcDb[_0x2e1f('0x8c')](_0x58f296,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x58f296,_0x2e1f('0xb1'));rpcDb[_0x2e1f('0xb2')](_0x58f296);_0x3ed5b1[_0x2e1f('0x2d')]+=_0x58f296['talktime'];_0x3ed5b1['sumBillable']+=_0x58f296[_0x2e1f('0xb3')];logger[_0x2e1f('0x7a')](_0x2e1f('0xb4'),_0x58f296[_0x2e1f('0xa2')],_0x2e1f('0xa3'),_0x3ed5b1[_0x2e1f('0x26')],_0x2e1f('0xa4'),_0x3ed5b1['pTalking']);delete this[_0x2e1f('0x11')][_0x6d4740[_0x2e1f('0x9e')]];break;case'BUSY':_0x3ed5b1[_0x2e1f('0xb5')]+=0x1;_0x58f296[_0x2e1f('0xb6')]+=0x1;_0x58f296[_0x2e1f('0xb0')]=ut[_0x2e1f('0x98')](_0x58f296);ut[_0x2e1f('0x88')](_0x58f296,0x5,'Busy');rpcDb[_0x2e1f('0x8c')](_0x58f296,_0x2e1f('0xb7'));if(ut[_0x2e1f('0x98')](_0x58f296)>=_0x3ed5b1['dialGlobalMaxRetry']){_0x46020b=ut[_0x2e1f('0xb8')](_0x58f296,0xf,_0x2e1f('0x9c'));rpcDb[_0x2e1f('0x8f')](_0x46020b,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x58f296[_0x2e1f('0xb6')]>=_0x3ed5b1['dialBusyMaxRetry']){rpcDb[_0x2e1f('0x8f')](_0x58f296,_0x2e1f('0xb7'));}else{rpcDb[_0x2e1f('0xb9')](ut[_0x2e1f('0xba')](_0x58f296,_0x2e1f('0xb6'),_0x3ed5b1['dialBusyRetryFrequency']),_0x58f296[_0x2e1f('0xbb')],_0x58f296[_0x2e1f('0xbc')]);}}break;case _0x2e1f('0xbd'):_0x3ed5b1[_0x2e1f('0x3a')]+=0x1;_0x58f296['countnoanswerretry']+=0x1;_0x58f296[_0x2e1f('0xb0')]=ut[_0x2e1f('0x98')](_0x58f296);ut[_0x2e1f('0x88')](_0x58f296,0x3,_0x2e1f('0xbe'));rpcDb['createCustomerHistory'](_0x58f296,_0x2e1f('0xbf'));if(ut[_0x2e1f('0x98')](_0x58f296)>=_0x3ed5b1['dialGlobalMaxRetry']){_0x46020b=ut[_0x2e1f('0xb8')](_0x58f296,0xf,_0x2e1f('0x9c'));rpcDb[_0x2e1f('0x8f')](_0x46020b,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x58f296[_0x2e1f('0xc0')]>=_0x3ed5b1['dialNoAnswerMaxRetry']){rpcDb[_0x2e1f('0x8f')](_0x58f296,_0x2e1f('0xbf'));}else{rpcDb[_0x2e1f('0xb9')](ut[_0x2e1f('0xba')](_0x58f296,_0x2e1f('0xc0'),_0x3ed5b1[_0x2e1f('0xc1')]),_0x58f296[_0x2e1f('0xbb')],_0x58f296['activeContact']);}}break;case _0x2e1f('0xc2'):_0x3ed5b1['outboundCongestionCallsDay']+=0x1;_0x58f296[_0x2e1f('0xc3')]+=0x1;_0x58f296[_0x2e1f('0xb0')]=ut[_0x2e1f('0x98')](_0x58f296);ut[_0x2e1f('0x88')](_0x58f296,0x8,_0x2e1f('0xc4'));rpcDb[_0x2e1f('0x8c')](_0x58f296,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x58f296)>=_0x3ed5b1['dialGlobalMaxRetry']){_0x46020b=ut[_0x2e1f('0xb8')](_0x58f296,0xf,_0x2e1f('0x9c'));rpcDb[_0x2e1f('0x8f')](_0x46020b,_0x2e1f('0xc5'));}else{if(_0x58f296[_0x2e1f('0xc3')]>=_0x3ed5b1[_0x2e1f('0xc6')]){rpcDb[_0x2e1f('0x8f')](_0x58f296,_0x2e1f('0xc7'));}else{rpcDb[_0x2e1f('0xb9')](ut['scheduledAt'](_0x58f296,_0x2e1f('0xc3'),_0x3ed5b1['dialBusyRetryFrequency']),_0x58f296[_0x2e1f('0xbb')],_0x58f296[_0x2e1f('0xbc')]);}}break;case _0x2e1f('0xc8'):_0x3ed5b1[_0x2e1f('0x3c')]+=0x1;_0x58f296[_0x2e1f('0xb0')]=ut[_0x2e1f('0x98')](_0x58f296);ut[_0x2e1f('0x88')](_0x58f296,0x14,_0x2e1f('0xc9'));rpcDb['createCustomerHistory'](_0x58f296,_0x2e1f('0xca'));if(_0x58f296['unlockAgent']){rpcDb[_0x2e1f('0xcb')](_0x58f296[_0x2e1f('0xcc')]);}if(_0x58f296[_0x2e1f('0xbc')]){rpcDb[_0x2e1f('0xcd')](_0x58f296['idContact']);}break;default:if(_0x58f296[_0x2e1f('0x77')]){ut[_0x2e1f('0xae')](_0x3ed5b1,_0x2e1f('0xce'));ut[_0x2e1f('0x78')](_0x2e1f('0xcf')+_0x3ed5b1[_0x2e1f('0x26')],_0x6d4740);}_0x3ed5b1['outboundUnknownCallsDay']+=0x1;_0x58f296[_0x2e1f('0xb0')]=ut[_0x2e1f('0x98')](_0x58f296);ut[_0x2e1f('0x88')](_0x58f296,0xc,_0x6d4740[_0x2e1f('0xd0')]||_0x6d4740[_0x2e1f('0xd1')]);rpcDb[_0x2e1f('0x8c')](_0x58f296,_0x2e1f('0xd2'));if(ut[_0x2e1f('0x98')](_0x58f296)>=_0x3ed5b1['dialGlobalMaxRetry']){_0x46020b=ut['cloneAction'](_0x58f296,0xf,_0x2e1f('0x9c'));rpcDb['createCustomerFinal'](_0x46020b,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x2e1f('0x8f')](_0x58f296,_0x2e1f('0xd3'));}delete this[_0x2e1f('0x11')][_0x6d4740[_0x2e1f('0x9e')]];}if(!(_0x58f296[_0x2e1f('0x77')]&&_0x2c2046==='16')){ut['updateOriginated'](_0x3ed5b1,_0x2e1f('0xd4'));logger[_0x2e1f('0x7a')](_0x2e1f('0xd5'),_0x58f296['uniqueid'],_0x2e1f('0xa3'),_0x3ed5b1['name'],_0x2e1f('0x69'),_0x3ed5b1[_0x2e1f('0x49')]);}if(_0x2c2046!==_0x2e1f('0xd6')){delete this[_0x2e1f('0x11')][_0x6d4740[_0x2e1f('0x9e')]];delete this[_0x2e1f('0x11')][_0x6d4740['destlinkedid']];}}};Preview[_0x2e1f('0xa')][_0x2e1f('0xd7')]=function(_0x272c0c,_0x2ed5c1,_0x4462af){if(_[_0x2e1f('0xd8')](_0x2ed5c1)&&_0x2e1f('0xd9')!==typeof _0x2ed5c1){return;}if(_[_0x2e1f('0xd8')](_0x4462af)&&_0x2e1f('0xd9')!==typeof _0x4462af){return;}switch(_0x4462af[_0x2e1f('0xda')]){case'0':ut['logAgent'](_0x272c0c,0x0,'NoSuchNumber');rpcDb[_0x2e1f('0xdb')](_0x272c0c,_0x2e1f('0xdc'));break;case'3':ut[_0x2e1f('0xdd')](_0x272c0c,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x272c0c,_0x2e1f('0xde'));break;case'5':ut[_0x2e1f('0xdd')](_0x272c0c,0x5,_0x2e1f('0xdf'));rpcDb[_0x2e1f('0xdb')](_0x272c0c,_0x2e1f('0xe0'));break;case'8':ut['logAgent'](_0x272c0c,0x8,_0x2e1f('0xc4'));rpcDb[_0x2e1f('0xdb')](_0x272c0c,_0x2e1f('0xe1'));break;case'22':ut[_0x2e1f('0xdd')](_0x272c0c,0x16,_0x2e1f('0xe2'));rpcDb[_0x2e1f('0xdb')](_0x272c0c,_0x2e1f('0xe3'));break;default:ut['logAgent'](_0x272c0c,0xc,_0x4462af[_0x2e1f('0xda')]);rpcDb[_0x2e1f('0xdb')](_0x272c0c,_0x2e1f('0xe1'));}ut[_0x2e1f('0x75')](_0x2ed5c1,_0x2e1f('0xe4'));logger[_0x2e1f('0x7a')](_0x2e1f('0xe5'),_0x272c0c[_0x2e1f('0xa2')],'\x20Queue',_0x2ed5c1[_0x2e1f('0x26')],_0x2e1f('0x69'),_0x2ed5c1[_0x2e1f('0x49')]);delete this[_0x2e1f('0x11')][_0x272c0c[_0x2e1f('0xa2')]];};Preview[_0x2e1f('0xa')][_0x2e1f('0xe6')]=function(_0x4875a4,_0x5cb42c,_0x2a9bd0,_0x8387a3,_0x422b1b){var _0x526add=this;return new BPromise(function(_0x5d689e,_0x52f939){if(_[_0x2e1f('0x66')](_0x5cb42c)||_[_0x2e1f('0x66')](_0x5cb42c['Contact'])||_[_0x2e1f('0x66')](_0x5cb42c[_0x2e1f('0xe7')]['phone'])||_[_0x2e1f('0x66')](_0x5cb42c[_0x2e1f('0x6f')])){_0x52f939(ut[_0x2e1f('0x48')](_0x2e1f('0xe8'),_0x8387a3,_0x422b1b));return;}var _0x5c7c1f=uuid['v4']();var _0x5c272e=_0x526add['campaignsPreview'][_0x5cb42c['Queue']['name']];var _0xba7e5d=_0x2a9bd0?_0x526add[_0x2e1f('0x12')][_0x2a9bd0]['id']:undefined;_0x526add[_0x2e1f('0x11')][_0x5c7c1f]=new Action(_0x5cb42c,_0x5c272e,_0x5c7c1f,_0x2a9bd0,_0xba7e5d);var _0x1c0c86=_0x526add['actions'][_0x5c7c1f];_0x1c0c86[_0x2e1f('0xbb')]=_0x8387a3;_0x1c0c86[_0x2e1f('0xbc')]=_0x422b1b;_0x1c0c86[_0x2e1f('0xe9')]=_0x2a9bd0;if(_['isEmpty'](_0x4875a4)){_0x526add[_0x2e1f('0xea')](_0x1c0c86,_0x5c272e,_0x5cb42c,_0x2a9bd0)['then'](function(_0x50cf39){logger[_0x2e1f('0x7a')](_0x2e1f('0xeb'),_0x2e1f('0xec')+_0x1c0c86[_0x2e1f('0x6b')]+_0x2e1f('0xed')+_0x1c0c86['idContact'],JSON[_0x2e1f('0x6a')](_0x50cf39));ami['emit'](_0x2e1f('0xee'),ut[_0x2e1f('0xab')](_0x1c0c86,_0x2e1f('0xef')));_0x5d689e(ut[_0x2e1f('0x48')](_0x2e1f('0xf0')));})[_0x2e1f('0x84')](function(_0x487197){ut[_0x2e1f('0x5a')]('[Preview][execCall][failure]',_0x487197);_0x52f939(ut[_0x2e1f('0x48')](_0x2e1f('0xf1'),_0x8387a3,_0x422b1b));});}else{_0x5c272e[_0x2e1f('0xf2')]+=0x1;ut[_0x2e1f('0xf3')](_0x1c0c86);rpcDb[_0x2e1f('0xf4')](_0x1c0c86,_0x2e1f('0xf5'));delete _0x526add[_0x2e1f('0x11')][_0x5c7c1f];_0x52f939(ut[_0x2e1f('0x48')](_0x2e1f('0xf6'),_0x8387a3,_0x422b1b));}});};Preview[_0x2e1f('0xa')][_0x2e1f('0x94')]=function(_0x36b916){return!_[_0x2e1f('0x66')](_0x36b916)&&!_[_0x2e1f('0x66')](_0x36b916['name'])&&!_['isNil'](_0x36b916[_0x2e1f('0x50')])&&_0x36b916[_0x2e1f('0x50')]&&!_['isNil'](this[_0x2e1f('0x10')][util[_0x2e1f('0x55')](_0x2e1f('0xf7'),_0x36b916[_0x2e1f('0x26')])])&&!_[_0x2e1f('0x66')](this[_0x2e1f('0x10')][util[_0x2e1f('0x55')]('SIP/%s',_0x36b916['name'])][_0x2e1f('0x72')])&&(this[_0x2e1f('0x10')][util['format']('SIP/%s',_0x36b916[_0x2e1f('0x26')])][_0x2e1f('0x72')]===_0x2e1f('0xf8')||this[_0x2e1f('0x10')][util['format'](_0x2e1f('0xf7'),_0x36b916['name'])]['status']==='unmonitored');};Preview[_0x2e1f('0xa')][_0x2e1f('0x82')]=function(_0x2576e1,_0x26c5b1){var _0x58983d=this;return new BPromise(function(_0x2bb727,_0x4d73ee){_0x58983d[_0x2e1f('0xf9')](_0x2576e1,_0x26c5b1)[_0x2e1f('0x7e')](function(_0x25e7b1){_0x2bb727(_['pick'](_0x25e7b1,[_0x2e1f('0x48')]));})[_0x2e1f('0x84')](function(_0x35854a){if(_0x35854a[_0x2e1f('0xfa')]){rpcDb['unlockContact'](_0x2576e1);}if(_0x35854a[_0x2e1f('0x50')]){rpcDb[_0x2e1f('0xcd')](_0x2576e1);}_0x4d73ee(_[_0x2e1f('0x6c')](_0x35854a,[_0x2e1f('0x48')]));});});};Preview[_0x2e1f('0xa')]['execRun']=function(_0x4eeba9,_0x1a8f30){var _0x49aed8=this;return new BPromise(function(_0xedac67,_0x4f3a7b){var _0x40cb40,_0xba37;rpcDb[_0x2e1f('0xfb')](_0x4eeba9)['then'](function(_0x5f2389){if(!_[_0x2e1f('0x66')](_0x5f2389[0x0])){_0xba37=_0x5f2389[0x0]['recallme']?![]:!![];_0x40cb40=_0x5f2389[0x0][_0x2e1f('0xfc')]?!![]:![];_0x40cb40=_0x1a8f30?!![]:_0x40cb40;}var _0x4a3294=_0x49aed8['validateContact'](_0x5f2389);if(_0x4a3294[_0x2e1f('0xfd')]){rpcDb['checkIsBlackList'](_['pick'](_0x5f2389[0x0],['VoiceQueueId','Contact.phone']))['then'](function(_0x40d991){_0x49aed8[_0x2e1f('0xe6')](_0x40d991,_0x5f2389[0x0],_0x1a8f30,_0xba37,_0x40cb40)[_0x2e1f('0x7e')](function(_0x5b71ea){_0xedac67(_0x5b71ea);})[_0x2e1f('0x84')](function(_0x252c06){_0x4f3a7b(_0x252c06);});})[_0x2e1f('0x84')](function(_0x43366a){ut[_0x2e1f('0x5a')](_0x2e1f('0xfe'),_0x43366a);_0x4f3a7b(ut[_0x2e1f('0x48')]('Call\x20unsuccessful',_0xba37,_0x40cb40));});}else{_0x4f3a7b(ut['message'](_0x4a3294[_0x2e1f('0x48')],_0xba37,_0x40cb40));}})[_0x2e1f('0x84')](function(_0x1e24b9){ut[_0x2e1f('0x5a')](_0x2e1f('0xff'),_0x1e24b9);_0x4f3a7b(ut['message'](_0x2e1f('0x100'),![],!![]));});});};Preview[_0x2e1f('0xa')][_0x2e1f('0x101')]=function(_0x4ba258){if(_[_0x2e1f('0x66')](_0x4ba258)||_['isEmpty'](_0x4ba258)||!_[_0x2e1f('0x66')](_0x4ba258[0x0][_0x2e1f('0x102')])&&_[_0x2e1f('0x66')](_0x4ba258[0x0][_0x2e1f('0x102')]['name'])){ut[_0x2e1f('0x5a')](_0x2e1f('0x103'),_0x4ba258);return{'isValid':![],'message':_0x2e1f('0x104')};}var _0x4ab1a4=this[_0x2e1f('0x23')][_0x4ba258[0x0][_0x2e1f('0x68')][_0x2e1f('0x26')]];_0x4ab1a4['message']=_0x2e1f('0x105');if(_[_0x2e1f('0x66')](_0x4ab1a4)){ut['logger'](_0x2e1f('0x106'),_0x4ab1a4);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x4ab1a4['Trunk'])){ut[_0x2e1f('0x5a')](_0x2e1f('0x107'),_0x2e1f('0x108')+_0x4ab1a4['name']+_0x2e1f('0x109'));if(!this[_0x2e1f('0x94')](_0x4ab1a4[_0x2e1f('0x95')])){ut['logger'](_0x2e1f('0x107'),_0x4ab1a4[_0x2e1f('0x26')]+_0x2e1f('0x10a'));return{'isValid':![],'message':_0x2e1f('0x10b')};}}if(!ut[_0x2e1f('0x10c')](_0x4ab1a4[_0x2e1f('0x62')])){ut[_0x2e1f('0x5a')](_0x2e1f('0x10d'),_0x4ab1a4[_0x2e1f('0x26')]+_0x2e1f('0x10e'));return{'isValid':![],'message':_0x2e1f('0x108')+_0x4ab1a4[_0x2e1f('0x26')]+_0x2e1f('0x10e')};}return{'isValid':!![],'message':_0x2e1f('0x10f')};};Preview[_0x2e1f('0xa')][_0x2e1f('0xea')]=function(_0x42f788,_0x1c6876,_0x45a030,_0x5c2e27){var _0x4ab814=this;return new BPromise(function(_0x4113fd,_0x29bf7c){var _0x2654d9=_0x42f788[_0x2e1f('0xa2')];var _0x5c5058=_0x4ab814['isTrunkReachable'](_0x1c6876[_0x2e1f('0x4f')])?util[_0x2e1f('0x55')](_0x2e1f('0x110'),_0x1c6876[_0x2e1f('0x4f')][_0x2e1f('0x26')],_[_0x2e1f('0x66')](_0x1c6876[_0x2e1f('0x111')])?'':_0x1c6876['dialPrefix'][_0x2e1f('0x112')]()||'',_0x1c6876['dialCutDigit']>0x0?_0x45a030[_0x2e1f('0xe7')]['phone'][_0x2e1f('0x113')](_0x1c6876['dialCutDigit']):_0x45a030[_0x2e1f('0xe7')][_0x2e1f('0x114')]):util[_0x2e1f('0x55')](_0x2e1f('0x110'),_[_0x2e1f('0x66')](_0x1c6876[_0x2e1f('0x95')])?_0x1c6876[_0x2e1f('0x4f')][_0x2e1f('0x26')]:_0x1c6876[_0x2e1f('0x95')][_0x2e1f('0x26')],_['isNil'](_0x1c6876[_0x2e1f('0x111')])?'':_0x1c6876['dialPrefix'][_0x2e1f('0x112')]()||'',_0x1c6876['dialCutDigit']>0x0?_0x45a030[_0x2e1f('0xe7')][_0x2e1f('0x114')][_0x2e1f('0x113')](_0x1c6876[_0x2e1f('0x115')]):_0x45a030['Contact'][_0x2e1f('0x114')]);var _0x435601=_0x4ab814[_0x2e1f('0x94')](_0x1c6876[_0x2e1f('0x4f')])?ut[_0x2e1f('0x116')](_0x1c6876[_0x2e1f('0x4f')]['callerid'],_0x1c6876[_0x2e1f('0x31')],_0x1c6876['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1c6876['dialOriginateCallerIdNumber'],_0x1c6876[_0x2e1f('0x117')]):_0x1c6876[_0x2e1f('0x32')]):ut[_0x2e1f('0x116')](_[_0x2e1f('0x66')](_0x1c6876[_0x2e1f('0x95')])?_0x1c6876[_0x2e1f('0x4f')][_0x2e1f('0x51')]:_0x1c6876[_0x2e1f('0x95')][_0x2e1f('0x51')],_0x1c6876[_0x2e1f('0x31')],_0x1c6876[_0x2e1f('0x117')]>0x0?ut['getCallerIdRandom'](_0x1c6876[_0x2e1f('0x32')],_0x1c6876[_0x2e1f('0x117')]):_0x1c6876[_0x2e1f('0x32')]);if(_0x435601){_0x42f788['originatecalleridname']=ut['extractCalleridName'](_0x435601);_0x42f788[_0x2e1f('0x118')]=ut[_0x2e1f('0x119')](_0x435601);}var _0x392d8b=ut[_0x2e1f('0x11a')](_0x1c6876,_0x45a030,_0x5c5058,_0x435601,_0x2654d9,_0x42f788);_[_0x2e1f('0x11b')](_0x42f788,ut[_0x2e1f('0x11c')](_0x392d8b));_0x42f788[_0x2e1f('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x2e1f('0x71')](ut[_0x2e1f('0x11d')](_0x42f788,_0x1c6876,_0x392d8b,_0x42f788[_0x2e1f('0xbc')],_0x5c2e27))[_0x2e1f('0x7e')](function(_0x2ade0e){_0x1c6876[_0x2e1f('0x49')]+=0x1;logger[_0x2e1f('0x7a')](_0x2e1f('0x11e'),_0x2654d9,'\x20Queue',_0x1c6876[_0x2e1f('0x26')],'originated:\x20',_0x1c6876[_0x2e1f('0x49')]);_0x4113fd(_0x2ade0e);})['catch'](function(_0x1a9928){ut[_0x2e1f('0xdd')](_0x42f788,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x42f788,_0x2e1f('0x11f'));_0x29bf7c(_0x1a9928);});});};Preview['prototype']['syncNewExten']=function(_0x549944){if(this['actions'][_0x549944[_0x2e1f('0x9e')]]){this['actions'][_0x549944[_0x2e1f('0x9e')]][_0x2e1f('0x73')]=_0x549944[_0x2e1f('0x73')];}};Preview[_0x2e1f('0xa')][_0x2e1f('0x14')]=function(_0x1bbee5){var _0x324f81=this;var _0x1f0d89=this[_0x2e1f('0x11')][_0x1bbee5[_0x2e1f('0x120')]];if(_0x1f0d89){if(_0x1f0d89['lookAgent']&&this[_0x2e1f('0x12')][_0x1f0d89[_0x2e1f('0xe9')]]){ut[_0x2e1f('0x121')](_0x1f0d89,this[_0x2e1f('0x12')][_0x1f0d89[_0x2e1f('0xe9')]][_0x2e1f('0x26')],this[_0x2e1f('0x12')][_0x1f0d89[_0x2e1f('0xe9')]]['id']);}var _0x58d988=_[_0x2e1f('0x122')](_0x1f0d89);_0x58d988['responsetime']=moment()['format'](_0x2e1f('0x87'));var _0x45604e=_0x324f81[_0x2e1f('0x23')][_0x1f0d89[_0x2e1f('0x6b')]];if(ut['isFailure'](_0x1bbee5[_0x2e1f('0x123')])){if(_0x1f0d89[_0x2e1f('0xbb')]){rpcDb[_0x2e1f('0xcb')](_0x1f0d89[_0x2e1f('0xcc')]);}if(_0x1f0d89['activeContact']){rpcDb[_0x2e1f('0xcd')](_0x1f0d89[_0x2e1f('0xcc')]);}ami[_0x2e1f('0xa5')](_0x2e1f('0x124'),ut[_0x2e1f('0xab')](_0x1f0d89,_0x2e1f('0x125')));this[_0x2e1f('0xd7')](_0x58d988,_0x45604e,_0x1bbee5);}else{_0x1f0d89[_0x2e1f('0x86')]=moment()[_0x2e1f('0x55')](_0x2e1f('0x87'));ut[_0x2e1f('0xdd')](_0x58d988,0x4,_0x2e1f('0x126'));rpcDb[_0x2e1f('0xdb')](_0x58d988,_0x2e1f('0x127'));}}};Preview[_0x2e1f('0xa')][_0x2e1f('0x16')]=function(_0x58fdf6){var _0x41da9e=this;var _0x4d9e13=this['actions'][_0x58fdf6[_0x2e1f('0x9e')]];var _0x4d721c;if(_0x4d9e13){_0x4d721c=this[_0x2e1f('0x23')][_0x4d9e13['queue']];logger[_0x2e1f('0x7a')](_0x2e1f('0x128'),_0x58fdf6[_0x2e1f('0x9e')],'\x20Queue',_0x4d721c[_0x2e1f('0x26')],_0x2e1f('0xa4'),_0x4d721c[_0x2e1f('0x2b')]);}if(this[_0x2e1f('0x11')][_0x58fdf6[_0x2e1f('0x9e')]]&&_0x58fdf6[_0x2e1f('0x9e')]!==_0x58fdf6['uniqueid']){if(_0x58fdf6[_0x2e1f('0x129')]==='16'&&this[_0x2e1f('0x11')][_0x58fdf6['linkedid']]['dialAnswer']){this['callProgressDetectingCustomer'](_0x58fdf6,_0x58fdf6[_0x2e1f('0x9e')],_0x58fdf6[_0x2e1f('0x129')]);}else if(this['actions'][_0x58fdf6[_0x2e1f('0x9e')]][_0x2e1f('0x77')]){logger[_0x2e1f('0x7a')]('[syncHangup][talking][cause]',_0x58fdf6[_0x2e1f('0x9e')],_0x58fdf6[_0x2e1f('0x129')],'\x20Queue',_0x4d721c[_0x2e1f('0x26')],_0x2e1f('0xa4'),_0x4d721c[_0x2e1f('0x2b')]);this['callProgressDetectingCustomer'](_0x58fdf6,_0x58fdf6['linkedid'],_0x58fdf6[_0x2e1f('0x129')]);}}else if(_0x4d9e13&&_['isNil'](_0x4d9e13['statedesc'])&&_0x4d721c[_0x2e1f('0x12a')]&&_0x58fdf6[_0x2e1f('0x9e')]===_0x58fdf6[_0x2e1f('0xa2')]&&_[_0x2e1f('0x66')](_0x58fdf6['reason'])&&_0x58fdf6[_0x2e1f('0x129')]==='16'&&_0x58fdf6[_0x2e1f('0x12b')]==='6'&&_[_0x2e1f('0xd8')](_0x4d9e13[_0x2e1f('0x12c')])){if(_0x4d9e13[_0x2e1f('0xbb')]){rpcDb[_0x2e1f('0xcb')](_0x4d9e13[_0x2e1f('0xcc')]);}if(_0x4d9e13[_0x2e1f('0xbc')]){rpcDb['disableContact'](_0x4d9e13[_0x2e1f('0xcc')]);}_0x58fdf6[_0x2e1f('0xda')]='22';this[_0x2e1f('0xd7')](_0x4d9e13,_0x4d721c,_0x58fdf6);}else if(_0x4d9e13&&_0x4d9e13[_0x2e1f('0x12c')]){if(_0x58fdf6[_0x2e1f('0x129')]==='16'&&this['actions'][_0x58fdf6['linkedid']][_0x2e1f('0x77')]){logger[_0x2e1f('0x7a')](_0x2e1f('0x12d'),_0x58fdf6['linkedid'],_0x58fdf6[_0x2e1f('0x129')],_0x2e1f('0xa3'),_0x4d721c[_0x2e1f('0x26')],'pTalking:\x20',_0x4d721c['pTalking']);this[_0x2e1f('0x96')](_0x58fdf6,_0x58fdf6[_0x2e1f('0x9e')],_0x58fdf6['cause']);}else if(this['actions'][_0x58fdf6['linkedid']][_0x2e1f('0x77')]){logger['info'](_0x2e1f('0x12e'),_0x58fdf6['linkedid'],_0x58fdf6['cause'],_0x2e1f('0xa3'),_0x4d721c['name'],_0x2e1f('0xa4'),_0x4d721c['pTalking']);this[_0x2e1f('0x96')](_0x58fdf6,_0x58fdf6[_0x2e1f('0x9e')],_0x58fdf6[_0x2e1f('0x129')]);}}};Preview['prototype'][_0x2e1f('0x19')]=function(_0x14d5fb){if(this[_0x2e1f('0x11')][_0x14d5fb[_0x2e1f('0x12f')]]&&_0x14d5fb[_0x2e1f('0x12f')]!==_0x14d5fb[_0x2e1f('0x130')]){this['callProgressDetectingCustomer'](_0x14d5fb,_0x14d5fb[_0x2e1f('0x12f')],_0x14d5fb[_0x2e1f('0xd1')]);}};Preview[_0x2e1f('0xa')][_0x2e1f('0x17')]=function(_0x440e4f){if(this['actions'][_0x440e4f[_0x2e1f('0x9e')]]&&_0x440e4f[_0x2e1f('0x9e')]!==_0x440e4f[_0x2e1f('0xa2')]&&!this[_0x2e1f('0x11')][_0x440e4f['linkedid']][_0x2e1f('0x77')]){if(_0x440e4f[_0x2e1f('0x129')]==='1'){this[_0x2e1f('0x96')](_0x440e4f,_0x440e4f[_0x2e1f('0x9e')],_0x440e4f['cause']);}}};Preview[_0x2e1f('0xa')]['addVariable']=function(_0xfe16ca,_0x248ca2,_0x51b2d9){if(this['actions'][_0xfe16ca]){if(_['isNil'](this[_0x2e1f('0x11')][_0xfe16ca]['variables'])){this['actions'][_0xfe16ca][_0x2e1f('0x131')]={};}this[_0x2e1f('0x11')][_0xfe16ca][_0x2e1f('0x131')][_0x248ca2]=_0x51b2d9;}};Preview[_0x2e1f('0xa')]['syncVarSet']=function(_0x44a97d){try{if(!_[_0x2e1f('0x66')](_0x44a97d)){if(ut[_0x2e1f('0x132')](_[_0x2e1f('0x133')](_0x44a97d[_0x2e1f('0x134')])[0x0])){this[_0x2e1f('0x135')](_0x44a97d[_0x2e1f('0xa2')],_[_0x2e1f('0x133')](_0x44a97d['variable'])[0x0],_0x44a97d[_0x2e1f('0x136')]);}}}catch(_0x201d98){logger[_0x2e1f('0x137')](_0x2e1f('0x138'),util[_0x2e1f('0x139')](_0x201d98,{'showHidden':![],'depth':null}));}};Preview[_0x2e1f('0xa')][_0x2e1f('0x1f')]=function(_0x391082){if(_0x391082){if(this[_0x2e1f('0x11')][_0x391082['transfertargetlinkedid']]){this[_0x2e1f('0x11')][_0x391082[_0x2e1f('0x13a')]][_0x2e1f('0x12c')]=!![];}}};Preview[_0x2e1f('0xa')][_0x2e1f('0x21')]=function(_0x2f0242){if(_0x2f0242){if(this[_0x2e1f('0x11')][_0x2f0242[_0x2e1f('0x13b')]]){this[_0x2e1f('0x11')][_0x2f0242[_0x2e1f('0x13b')]]['transfer']=!![];}}};module[_0x2e1f('0x13c')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 7b2531e..331ee36 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 _0x9afc=['createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','connectedlinename','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then'];(function(_0x416ca3,_0x22ed17){var _0x894f17=function(_0x4284df){while(--_0x4284df){_0x416ca3['push'](_0x416ca3['shift']());}};_0x894f17(++_0x22ed17);}(_0x9afc,0x12a));var _0xc9af=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0x9afc[_0x57db49];return _0xd0636f;};'use strict';var util=require(_0xc9af('0x0'));var BPromise=require(_0xc9af('0x1'));var logger=require(_0xc9af('0x2'))(_0xc9af('0x3'));var _=require(_0xc9af('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xc9af('0x5'));var cmHopperHistory=require(_0xc9af('0x6'));var cmHopperBlack=require(_0xc9af('0x7'));var voiceQueueRt=require(_0xc9af('0x8'));var agentReportPreview=require(_0xc9af('0x9'));var voiceQueueReport=require(_0xc9af('0xa'));function loggerCatch(_0x26fb29){return function(_0x438f44){logger['error'](_0x26fb29,util[_0xc9af('0xb')](_0x438f44,{'showHidden':![],'depth':null}));};}function create(_0x59eb98){return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopperHistory[_0xc9af('0xe')](_0x59eb98))['catch'](loggerCatch(_0xc9af('0xf')));}function createAgent(_0x5b4a4a){return BPromise['resolve']()[_0xc9af('0xd')](agentReportPreview['createHistory'](_0x5b4a4a))[_0xc9af('0x10')](loggerCatch(_0xc9af('0xf')));}function moveContact(_0x919ed3){return BPromise[_0xc9af('0xc')]()['then'](cmHopper[_0xc9af('0x11')](_0x919ed3,!![]))[_0xc9af('0x10')](loggerCatch(_0xc9af('0x12')));}exports[_0xc9af('0x13')]=function(_0x523f46){return BPromise['resolve']()[_0xc9af('0xd')](cmHopperBlack['checkIsBlackList'](_0x523f46))[_0xc9af('0x10')](loggerCatch(_0xc9af('0x14')));};exports[_0xc9af('0x15')]=function(_0x5ecda0){return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopper[_0xc9af('0x15')](_0x5ecda0))[_0xc9af('0x10')](loggerCatch('[getContactPreview]\x20'));};exports[_0xc9af('0xe')]=function(_0xb8c07b,_0x4e02c4){create(_0xb8c07b)['catch'](loggerCatch(_0x4e02c4));moveContact(_0xb8c07b)[_0xc9af('0x10')](loggerCatch(_0x4e02c4));};exports[_0xc9af('0x16')]=function(_0x7277c7,_0x26c285){createAgent(_0x7277c7)[_0xc9af('0x10')](loggerCatch(_0x26c285));};exports[_0xc9af('0x17')]=function(_0x1a10ab,_0x5913aa){create(_0x1a10ab)['catch'](loggerCatch(_0x5913aa));};exports['createCustomerFinal']=function(_0x30f188,_0x59a23d){moveContact(_0x30f188)[_0xc9af('0x10')](loggerCatch(_0x59a23d));};exports[_0xc9af('0x18')]=function(_0x351ff6,_0x28aa88,_0x542eaa){if(_0x28aa88){_0x351ff6[_0xc9af('0x19')]=null;}if(_0x542eaa){_0x351ff6[_0xc9af('0x1a')]=![];}return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopper['rescheduleContact'](_0x351ff6))[_0xc9af('0x10')](loggerCatch(_0xc9af('0x1b')));};exports[_0xc9af('0x1c')]=function(_0x485ba7){return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopper['countReScheduled'](_0x485ba7))[_0xc9af('0x10')](loggerCatch(_0xc9af('0x1d')));};exports['unlockContact']=function(_0x5ca4c7){return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopper[_0xc9af('0x1e')]({'UserId':null},_0x5ca4c7,0x1))[_0xc9af('0x10')](loggerCatch('[unlockContact]\x20'));};exports[_0xc9af('0x1f')]=function(_0x3cae1f){return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopper[_0xc9af('0x1e')]({'active':![]},_0x3cae1f,0x1))[_0xc9af('0x10')](loggerCatch(_0xc9af('0x20')));};exports[_0xc9af('0x21')]=function(_0x4d72f3){var _0x21e84e={};_0x21e84e[_0xc9af('0x22')]=_0x4d72f3['type'];_0x21e84e[_0xc9af('0x23')]=_0x4d72f3['uniqueid'];_0x21e84e['calleridnum']=_0x4d72f3['calleridnum'];_0x21e84e[_0xc9af('0x24')]=_0x4d72f3[_0xc9af('0x24')];_0x21e84e[_0xc9af('0x25')]=_0x4d72f3[_0xc9af('0x25')];_0x21e84e[_0xc9af('0x26')]=_0x4d72f3[_0xc9af('0x27')];_0x21e84e['queuecallerleaveAt']=_0x4d72f3[_0xc9af('0x27')];_0x21e84e[_0xc9af('0x28')]=0x1;_0x21e84e['queuecallercompleteAt']=_0x4d72f3['endtime'];_0x21e84e[_0xc9af('0x29')]=_0x4d72f3['membername'];_0x21e84e['context']='from-sip';_0x21e84e['exten']=_0xc9af('0x2a');_0x21e84e[_0xc9af('0x2b')]=0x0;_0x21e84e['assigned']=0x1;_0x21e84e[_0xc9af('0x2c')]=_0x4d72f3['membername'];_0x21e84e[_0xc9af('0x2d')]=_0xc9af('0x2e');return BPromise[_0xc9af('0xc')]()['then'](voiceQueueReport[_0xc9af('0x2f')](_0x21e84e))[_0xc9af('0x10')](loggerCatch(_0xc9af('0x30')));};exports[_0xc9af('0x31')]=function(_0x540a03,_0x3ea98a){return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopper[_0xc9af('0x31')](_0x540a03,_0x3ea98a))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xc9af('0x32')]=function(_0x521110){return BPromise[_0xc9af('0xc')]()[_0xc9af('0xd')](cmHopper[_0xc9af('0x18')](_0x521110,!![],!![]))[_0xc9af('0x10')](loggerCatch(_0xc9af('0x33')));}; \ No newline at end of file +var _0xb7b7=['getContactPreview','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','membername','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','resolve','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xb7b7,0x89));var _0x7b7b=function(_0x595ed4,_0x27221d){_0x595ed4=_0x595ed4-0x0;var _0x581dba=_0xb7b7[_0x595ed4];return _0x581dba;};'use strict';var util=require(_0x7b7b('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7b('0x1'))(_0x7b7b('0x2'));var _=require('lodash');var cmHopper=require(_0x7b7b('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x7b7b('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7b7b('0x5'));var agentReportPreview=require(_0x7b7b('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x46e6f8){return function(_0x7bd236){logger[_0x7b7b('0x7')](_0x46e6f8,util[_0x7b7b('0x8')](_0x7bd236,{'showHidden':![],'depth':null}));};}function create(_0x5551a5){return BPromise['resolve']()[_0x7b7b('0x9')](cmHopperHistory['createHistory'](_0x5551a5))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x46be2c){return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](agentReportPreview['createHistory'](_0x46be2c))[_0x7b7b('0xb')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x22c4ff){return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](cmHopper[_0x7b7b('0xc')](_0x22c4ff,!![]))[_0x7b7b('0xb')](loggerCatch(_0x7b7b('0xd')));}exports[_0x7b7b('0xe')]=function(_0x356fb2){return BPromise[_0x7b7b('0xa')]()['then'](cmHopperBlack[_0x7b7b('0xe')](_0x356fb2))[_0x7b7b('0xb')](loggerCatch(_0x7b7b('0xf')));};exports['getContactPreview']=function(_0x51ba08){return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](cmHopper[_0x7b7b('0x10')](_0x51ba08))[_0x7b7b('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0x7b7b('0x11')]=function(_0x21b175,_0x3332bc){create(_0x21b175)[_0x7b7b('0xb')](loggerCatch(_0x3332bc));moveContact(_0x21b175)[_0x7b7b('0xb')](loggerCatch(_0x3332bc));};exports[_0x7b7b('0x12')]=function(_0x3da7b9,_0x1f52cc){createAgent(_0x3da7b9)[_0x7b7b('0xb')](loggerCatch(_0x1f52cc));};exports[_0x7b7b('0x13')]=function(_0x358531,_0x21c76e){create(_0x358531)[_0x7b7b('0xb')](loggerCatch(_0x21c76e));};exports[_0x7b7b('0x14')]=function(_0x17cf79,_0x5ea2e6){moveContact(_0x17cf79)[_0x7b7b('0xb')](loggerCatch(_0x5ea2e6));};exports[_0x7b7b('0x15')]=function(_0x5e7be2,_0x12552a,_0x247e05){if(_0x12552a){_0x5e7be2['UserId']=null;}if(_0x247e05){_0x5e7be2[_0x7b7b('0x16')]=![];}return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](cmHopper[_0x7b7b('0x15')](_0x5e7be2))['catch'](loggerCatch(_0x7b7b('0x17')));};exports[_0x7b7b('0x18')]=function(_0x4d94db){return BPromise['resolve']()[_0x7b7b('0x9')](cmHopper['countReScheduled'](_0x4d94db))['catch'](loggerCatch(_0x7b7b('0x19')));};exports[_0x7b7b('0x1a')]=function(_0x5e1b0f){return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](cmHopper['unlockContact']({'UserId':null},_0x5e1b0f,0x1))[_0x7b7b('0xb')](loggerCatch(_0x7b7b('0x1b')));};exports[_0x7b7b('0x1c')]=function(_0x408fb5){return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](cmHopper[_0x7b7b('0x1a')]({'active':![]},_0x408fb5,0x1))[_0x7b7b('0xb')](loggerCatch(_0x7b7b('0x1d')));};exports['crateCustomerReportQueue']=function(_0x46af1d){var _0x2020d0={};_0x2020d0[_0x7b7b('0x1e')]=_0x46af1d[_0x7b7b('0x1e')];_0x2020d0[_0x7b7b('0x1f')]=_0x46af1d[_0x7b7b('0x1f')];_0x2020d0[_0x7b7b('0x20')]=_0x46af1d[_0x7b7b('0x20')];_0x2020d0[_0x7b7b('0x21')]=_0x46af1d[_0x7b7b('0x21')];_0x2020d0[_0x7b7b('0x22')]=_0x46af1d['queue'];_0x2020d0[_0x7b7b('0x23')]=_0x46af1d[_0x7b7b('0x24')];_0x2020d0[_0x7b7b('0x25')]=_0x46af1d['answertime'];_0x2020d0[_0x7b7b('0x26')]=0x1;_0x2020d0[_0x7b7b('0x27')]=_0x46af1d['endtime'];_0x2020d0['connectedlinename']=_0x46af1d[_0x7b7b('0x28')];_0x2020d0['context']='from-sip';_0x2020d0[_0x7b7b('0x29')]=_0x7b7b('0x2a');_0x2020d0['holdtime']=0x0;_0x2020d0[_0x7b7b('0x2b')]=0x1;_0x2020d0[_0x7b7b('0x2c')]=_0x46af1d[_0x7b7b('0x28')];_0x2020d0[_0x7b7b('0x2d')]=_0x7b7b('0x2e');return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](voiceQueueReport['create'](_0x2020d0))[_0x7b7b('0xb')](loggerCatch(_0x7b7b('0x2f')));};exports[_0x7b7b('0x30')]=function(_0x4a8392,_0x2ee4ce){return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](cmHopper[_0x7b7b('0x30')](_0x4a8392,_0x2ee4ce))[_0x7b7b('0xb')](loggerCatch(_0x7b7b('0x31')));};exports[_0x7b7b('0x32')]=function(_0x253f5e){return BPromise[_0x7b7b('0xa')]()[_0x7b7b('0x9')](cmHopper['rescheduleContact'](_0x253f5e,!![],!![]))['catch'](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 53ecec4..aa5003a 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 _0x5dad=['UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','match','extractCalleridNumber','util','lodash','moment','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','loggerError','inspect','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','logCustomer','endtime','talktime','answertime','isFailure','RECALL','calleridname','originate','channelAgent','xcally-motion-preview','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','uniqueid','status','reachable','push','getDiff','createBody','filterKey','idContact','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme'];(function(_0x366545,_0xb0e092){var _0x50eee6=function(_0x37f4e6){while(--_0x37f4e6){_0x366545['push'](_0x366545['shift']());}};_0x50eee6(++_0xb0e092);}(_0x5dad,0x128));var _0xd5da=function(_0x55a8fb,_0x296dd3){_0x55a8fb=_0x55a8fb-0x0;var _0x3c8ce7=_0x5dad[_0x55a8fb];return _0x3c8ce7;};'use strict';var util=require(_0xd5da('0x0'));var _=require(_0xd5da('0x1'));var moment=require(_0xd5da('0x2'));var logger=require('../../../../config/logger')(_0xd5da('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xd5da('0x4');function getSeconds(_0xbcd957,_0x4d640a){var _0x5beb78=moment(_0xbcd957)[_0xd5da('0x5')](0x0);var _0x1f8203=moment(_0x4d640a)[_0xd5da('0x5')](0x0);return _0x5beb78[_0xd5da('0x6')](_0x1f8203,_0xd5da('0x7'));}exports[_0xd5da('0x8')]=function(_0x1900fe){return function(_0x479e8c){logger[_0xd5da('0x9')](_0x1900fe,util['inspect'](_0x479e8c,{'showHidden':![],'depth':null}));};};exports[_0xd5da('0xa')]=function(_0x1eadff,_0x1252a4){logger[_0xd5da('0xb')](_0x1eadff,util['inspect'](_0x1252a4,{'showHidden':![],'depth':null}));};exports[_0xd5da('0xc')]=function(_0x2982fb,_0x673a46){logger['error'](_0x2982fb,util[_0xd5da('0xd')](_0x673a46,{'showHidden':![],'depth':null}));};exports[_0xd5da('0xe')]=function(_0x146498){return function(_0x109a99){logger[_0xd5da('0xb')](_0x146498,util[_0xd5da('0xd')](_0x109a99,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x20d3d6,_0x5448d5,_0x1fb419){return{'message':_0x20d3d6,'unlock':_0x5448d5,'active':_0x1fb419};};exports[_0xd5da('0xf')]=function(_0x5cc722,_0x52dd4c,_0x2482dd){if(!_[_0xd5da('0x10')](_0x2482dd)&&_0xd5da('0x11')===typeof _0x2482dd&&!_[_0xd5da('0x12')](_0x2482dd)){if(!_[_0xd5da('0x10')](_0x52dd4c)&&'string'===typeof _0x52dd4c&&!_[_0xd5da('0x12')](_0x52dd4c)){return util[_0xd5da('0x13')](_0xd5da('0x14'),_0x52dd4c,_0x2482dd);}return util[_0xd5da('0x13')](_0xd5da('0x14'),_0x2482dd,_0x2482dd);}if(!_['isUndefined'](_0x5cc722)&&'string'===typeof _0x5cc722&&!_[_0xd5da('0x12')](_0x5cc722)){return _0x5cc722;}return _0xd5da('0x15');};exports[_0xd5da('0x16')]=function(_0x455d48){if(_[_0xd5da('0x17')](_0x455d48)){return![];}return _0x455d48;};exports[_0xd5da('0x18')]=function(_0x228b4c,_0xe9fef5,_0x42f244,_0xa26b96,_0x42d9c4,_0x2e37d5){var _0x4df612={'XMD-QUEUE':_0xe9fef5[_0xd5da('0x19')]?_0xe9fef5['Queue']['name']:'','XMD-CALLERID':_0xa26b96,'XMD-CALLERID-PREVIEW':_0x2e37d5?util[_0xd5da('0x13')](_0xd5da('0x14'),_0x2e37d5['calleridname'],_0x2e37d5[_0xd5da('0x1a')]):_0xa26b96,'XMD-DIALID':_0x42d9c4,'XMD-CONTACTID':_0xe9fef5[_0xd5da('0x1b')],'XMD-CDRTYPE':_0xd5da('0x1c'),'CALLERID(all)':_0xa26b96,'XMD-VOICEQUEUEID':_0xe9fef5[_0xd5da('0x1d')],'XMD-DIALCHANNEL':_0x42f244,'XMD-DIALTIMEOUT':_0x228b4c['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xd5da('0x13')](_0xd5da('0x1e'),_0x228b4c['dialQueueProject2']?'g':'',_[_0xd5da('0x12')](_0x228b4c[_0xd5da('0x1f')])?'':_0xd5da('0x20')),'XMD-DIALURL':_0x228b4c[_0xd5da('0x21')]||'','XMD-AGI':_0x228b4c[_0xd5da('0x22')]?util[_0xd5da('0x13')](_0xd5da('0x23'),ipAgi,_0x228b4c['dialQueueProject']):_0xd5da('0x24'),'XMD-AGIAFTER':_0x228b4c['dialQueueProject2']?util[_0xd5da('0x13')](_0xd5da('0x23'),ipAgi,_0x228b4c['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2e37d5?_0x2e37d5[_0xd5da('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x2e37d5?_0x2e37d5[_0xd5da('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xd5da('0x12')](_0x228b4c[_0xd5da('0x1f')])){_0x4df612[util[_0xd5da('0x13')]('%s',_0xd5da('0x27'))]=_0x228b4c[_0xd5da('0x1f')];_0x4df612[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x42d9c4;}if(_0xe9fef5&&_0xe9fef5[_0xd5da('0x28')]){for(var _0x15ff4d in _0xe9fef5[_0xd5da('0x28')]){if(_0xe9fef5[_0xd5da('0x28')][_0xd5da('0x29')](_0x15ff4d)){if(!_[_0xd5da('0x17')](_0xe9fef5[_0xd5da('0x28')][_0x15ff4d])&&_0x15ff4d!=='id'&&_0x15ff4d!=='tags'&&_0x15ff4d!==_0xd5da('0x2a')&&_0x15ff4d!==_0xd5da('0x2b')){_0x4df612[util[_0xd5da('0x13')](_0xd5da('0x2c'),_0xd5da('0x2d'),_[_0xd5da('0x2e')](_0x15ff4d))]=_0xe9fef5[_0xd5da('0x28')][_0x15ff4d];}}}}return _0x4df612;};exports['toLowerVariables']=function(_0x39a954){var _0x141ef9={};for(var _0x38fafb in _0x39a954){if(_0x39a954[_0xd5da('0x29')](_0x38fafb)){_0x141ef9[util[_0xd5da('0x13')]('%s',_[_0xd5da('0x2f')](_0x38fafb))]=_0x39a954[_0x38fafb];}}return{'variables':_0x141ef9};};exports[_0xd5da('0x30')]=function(_0x498f32,_0x31d2dc){if(!_['isNil'](_0x498f32)){if(_0x498f32[_0xd5da('0x29')]('originated')){if(_0x498f32[_0xd5da('0x31')]>0x0){_0x498f32[_0xd5da('0x31')]-=0x1;}else{logger['error'](_0xd5da('0x32'),_0x31d2dc);}}}else{logger[_0xd5da('0x9')](_0xd5da('0x33'),_0x31d2dc);}};exports[_0xd5da('0x34')]=function(_0x313c1){var _0x6b1cc6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x313c1[_0xd5da('0x35')]=0xd;_0x313c1[_0xd5da('0x36')]='Blacklist';_0x313c1[_0xd5da('0x37')]=_0x6b1cc6;_0x313c1[_0xd5da('0x38')]=_0x6b1cc6;_0x313c1['endtime']=_0x6b1cc6;};exports[_0xd5da('0x39')]=function(_0x4dd677,_0x4d7ab5,_0x20138d){var _0x52eace=moment()[_0xd5da('0x13')](_0xd5da('0x3a'));_0x4dd677[_0xd5da('0x35')]=_0x4d7ab5;_0x4dd677[_0xd5da('0x36')]=_0x20138d;_0x4dd677[_0xd5da('0x38')]=_0x52eace;_0x4dd677[_0xd5da('0x3b')]=getSeconds(_0x4dd677[_0xd5da('0x38')],_0x4dd677['starttime']);};exports[_0xd5da('0x3c')]=function(_0x4f3750,_0x2415b3,_0x4c0aa9){_0x4f3750[_0xd5da('0x3d')]=_0x2415b3;_0x4f3750['UserId']=_0x4c0aa9;};exports[_0xd5da('0x3e')]=function(_0x469892,_0x27bc65,_0x19803a){var _0x4fe39f=moment()[_0xd5da('0x13')](_0xd5da('0x3a'));_0x469892[_0xd5da('0x35')]=_0x27bc65;_0x469892[_0xd5da('0x36')]=_0x19803a;_0x469892['responsetime']=_0x469892['responsetime']?_0x469892[_0xd5da('0x38')]:_0x4fe39f;_0x469892[_0xd5da('0x3f')]=_0x469892['endtime']?_0x469892['endtime']:_0x4fe39f;_0x469892['ringtime']=getSeconds(_0x469892[_0xd5da('0x38')]||0x0,_0x469892[_0xd5da('0x37')]||0x0);_0x469892[_0xd5da('0x40')]=_0x469892[_0xd5da('0x41')]?getSeconds(_0x469892[_0xd5da('0x3f')],_0x469892[_0xd5da('0x41')]):0x0;};exports[_0xd5da('0x42')]=function(_0x1a0596){return _0x1a0596==='Failure';};exports['variablesAction']=function(_0x1696f2,_0x1d4b67,_0x2494bd,_0x22fd3d,_0x33eed8){var _0x4d9e05=_0x22fd3d?_0xd5da('0x43'):_0x1696f2[_0xd5da('0x44')];_0x4d9e05=_0x33eed8?'BOOKED':_0x4d9e05;return{'actionid':_0x1696f2['uniqueid'],'action':_0xd5da('0x45'),'channel':_0x1696f2[_0xd5da('0x46')],'callerid':util['format'](_0xd5da('0x14'),_0x4d9e05,_0x1696f2[_0xd5da('0x1a')]),'Exten':_0xd5da('0x47'),'Context':_0xd5da('0x48'),'Priority':'1','variable':_0x2494bd,'timeout':(_0x1d4b67['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1696f2['uniqueid']};};exports['totalGlobal']=function(_0x14d708){return _0x14d708[_0xd5da('0x49')]+_0x14d708[_0xd5da('0x4a')]+_0x14d708[_0xd5da('0x4b')];};exports[_0xd5da('0x4c')]=function(_0x3d947d){var _0xa2cb4c=_[_0xd5da('0x4d')](_0x3d947d);_0xa2cb4c[_0xd5da('0x35')]=0xf;_0xa2cb4c[_0xd5da('0x36')]=_0xd5da('0x4e');return _0xa2cb4c;};exports[_0xd5da('0x4f')]=function(_0x50cc13,_0x4c5a4e,_0x555720){var _0x193b18={};_0x193b18[_0x4c5a4e]=_0x50cc13[_0x4c5a4e];_0x193b18[_0xd5da('0x50')]=![];_0x193b18[_0xd5da('0x51')]=moment()[_0xd5da('0x52')](_0x555720,'minutes')[_0xd5da('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x193b18[_0xd5da('0x1b')]=_0x50cc13[_0xd5da('0x1b')];_0x193b18[_0xd5da('0x53')]=_0x50cc13[_0xd5da('0x53')];_0x193b18[_0xd5da('0x1d')]=_0x50cc13[_0xd5da('0x1d')]||undefined;return _0x193b18;};exports[_0xd5da('0x54')]=function(_0x4aeea6,_0x29b8c5){if(!_[_0xd5da('0x17')](_0x4aeea6)){if(_0x4aeea6[_0xd5da('0x55')]>0x0){_0x4aeea6['pTalking']-=0x1;}else{logger['error'](_0x29b8c5,_0xd5da('0x56'));}}else{logger[_0xd5da('0x9')](_0x29b8c5,_0xd5da('0x57'));}};exports[_0xd5da('0x58')]=function(_0x17692f){if(_0x17692f<=0x0){return!![];}return![];};exports[_0xd5da('0x59')]=function(_0x89c887,_0x3dd057){_0x89c887['lastevent']=_0x3dd057;_0x89c887['name']=_0x89c887[_0xd5da('0x5a')];_0x89c887[_0xd5da('0x5b')]=_0x89c887[_0xd5da('0x46')];return _0x89c887;};exports['buildAcw']=function(_0x6bcaa9){var _0x31ac82={};_0x31ac82[_0xd5da('0x5a')]=_0x6bcaa9[_0xd5da('0x5a')];_0x31ac82[_0xd5da('0x5b')]=_0x6bcaa9[_0xd5da('0x46')];_0x31ac82[_0xd5da('0x5c')]=_0x6bcaa9[_0xd5da('0x5c')];return _0x31ac82;};exports['agentReadyId']=function(_0x38c79d){var _0x31560b=[];for(var _0x953333 in _0x38c79d){if(_0x38c79d[_0xd5da('0x29')](_0x953333)){if(!_[_0xd5da('0x17')](_0x38c79d[_0x953333])&&_0x38c79d[_0x953333][_0xd5da('0x35')]==='not_inuse'&&_0x38c79d[_0x953333][_0xd5da('0x5d')]===_0xd5da('0x5e')){_0x31560b[_0xd5da('0x5f')](_0x38c79d[_0x953333]['id']);}}}return _0x31560b;};exports[_0xd5da('0x60')]=function(_0x16edb4){var _0x106b8c=moment()['milliseconds'](0x0);var _0x6942c5=moment(_0x16edb4)[_0xd5da('0x5')](0x0);return _0x106b8c[_0xd5da('0x6')](_0x6942c5,'seconds');};exports[_0xd5da('0x61')]=function(_0x583e7d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x583e7d[_0xd5da('0x1b')],'ListId':_0x583e7d[_0xd5da('0x53')],'VoiceQueueId':_0x583e7d[_0xd5da('0x1d')]||undefined,'CampaignId':_0x583e7d['CampaignId']||undefined};};exports[_0xd5da('0x62')]=function(_0x555048){if(_0x555048===_0xd5da('0x5c')||_0x555048===_0xd5da('0x63')||_0x555048==='queue'||_0x555048==='type'||_0x555048===_0xd5da('0x64')||_0x555048===_0xd5da('0x65')||_0x555048===_0xd5da('0x3d')||_0x555048===_0xd5da('0x46')||_0x555048===_0xd5da('0x44')||_0x555048==='active'||_0x555048===_0xd5da('0x1a')||_0x555048==='scheduledat'||_0x555048==='countbusyretry'||_0x555048===_0xd5da('0x4a')||_0x555048===_0xd5da('0x4b')||_0x555048==='countglobal'||_0x555048===_0xd5da('0x66')||_0x555048===_0xd5da('0x67')||_0x555048===_0xd5da('0x68')||_0x555048===_0xd5da('0x69')||_0x555048==='ContactId'||_0x555048===_0xd5da('0x53')||_0x555048===_0xd5da('0x6a')||_0x555048===_0xd5da('0x1d')||_0x555048===_0xd5da('0x6b')||_0x555048===_0xd5da('0x6c')||_0x555048===_0xd5da('0x6d')||_0x555048===_0xd5da('0x6e')||_0x555048===_0xd5da('0x6f')||_0x555048===_0xd5da('0x70')||_0x555048===_0xd5da('0x71')||_0x555048===_0xd5da('0x72')||_0x555048===_0xd5da('0x73')||_0x555048===_0xd5da('0x74')||_0x555048==='xmd-contactid'||_0x555048===_0xd5da('0x75')||_0x555048===_0xd5da('0x76')||_0x555048===_0xd5da('0x77')||_0x555048===_0xd5da('0x78')||_0x555048===_0xd5da('0x79')||_0x555048===_0xd5da('0x7a')||_0x555048===_0xd5da('0x7b')||_0x555048===_0xd5da('0x7c')||_0x555048===_0xd5da('0x7d')||_0x555048==='rtpaudioqoslossbridged'||_0x555048===_0xd5da('0x7e')||_0x555048==='rtpaudioqosrttbridged'||_0x555048==='rtpaudioqos'||_0x555048===_0xd5da('0x7a')||_0x555048==='rtpaudioqosjitter'||_0x555048===_0xd5da('0x7c')||_0x555048==='rtpaudioqosloss'||_0x555048==='rtpaudioqoslossbridged'||_0x555048==='rtpaudioqosrtt'||_0x555048==='rtpaudioqosrttbridged'||_0x555048===_0xd5da('0x7f')||_0x555048===_0xd5da('0x80')||_0x555048===_0xd5da('0x35')||_0x555048===_0xd5da('0x36')){return![];}return!![];};exports[_0xd5da('0x81')]=function(_0xfe3333,_0x2dd374){var _0x438a80,_0x4553d9,_0x308dc1;if(_0x2dd374<=0x0){_0x2dd374=0x1;}_0x438a80=new RegExp('\x5cw{0,'+_0x2dd374+'}$');_0x4553d9=Math['pow'](0xa,_0x2dd374-0x1);_0x308dc1=Math[_0xd5da('0x82')](0xa,_0x2dd374)-0x1;return util[_0xd5da('0x13')]('%s',_['replace'](_0xfe3333,_0x438a80,_[_0xd5da('0x83')](_0x4553d9,_0x308dc1)));};exports['extractCalleridName']=function(_0x1e214a){var _0x27f56d=_0x1e214a[_0xd5da('0x84')](/"(.*?)"/);return _0x27f56d?_0x27f56d[0x1]:_0x1e214a;};exports[_0xd5da('0x85')]=function(_0x28f01f){var _0x523c3f=_0x28f01f['match'](/<(.*?)>/);return _0x523c3f?_0x523c3f[0x1]:_0x28f01f;}; \ No newline at end of file +var _0xcfe5=['from-sip','timeout','totalGlobal','countnoanswerretry','cloneAction','clone','active','add','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','channelAgent','buildAcw','interface','not_inuse','reachable','push','milliseconds','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countbusyretry','countcongestionretry','countglobal','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','XCALLY_IP_AGI','diff','loggerCatch','error','inspect','logger','info','loggerError','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','tags','updatedAt','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','logLookAgent','membername','UserId','logCustomer','endtime','ringtime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid'];(function(_0x35d604,_0x354467){var _0xb5cfad=function(_0x29bc7b){while(--_0x29bc7b){_0x35d604['push'](_0x35d604['shift']());}};_0xb5cfad(++_0x354467);}(_0xcfe5,0x1c9));var _0x5cfe=function(_0x216a8d,_0x5473bb){_0x216a8d=_0x216a8d-0x0;var _0xb21f7b=_0xcfe5[_0x216a8d];return _0xb21f7b;};'use strict';var util=require(_0x5cfe('0x0'));var _=require(_0x5cfe('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('preview');var ipAgi=process['env'][_0x5cfe('0x2')]||'127.0.0.1';function getSeconds(_0x3e6fc8,_0x78cec3){var _0xd1f15e=moment(_0x3e6fc8)['milliseconds'](0x0);var _0x26bdda=moment(_0x78cec3)['milliseconds'](0x0);return _0xd1f15e[_0x5cfe('0x3')](_0x26bdda,'seconds');}exports[_0x5cfe('0x4')]=function(_0x2c0401){return function(_0xaa5f3c){logger[_0x5cfe('0x5')](_0x2c0401,util[_0x5cfe('0x6')](_0xaa5f3c,{'showHidden':![],'depth':null}));};};exports[_0x5cfe('0x7')]=function(_0x1f9cb2,_0x1e9498){logger[_0x5cfe('0x8')](_0x1f9cb2,util['inspect'](_0x1e9498,{'showHidden':![],'depth':null}));};exports[_0x5cfe('0x9')]=function(_0x1b4884,_0x55c9f1){logger[_0x5cfe('0x5')](_0x1b4884,util[_0x5cfe('0x6')](_0x55c9f1,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x27c7df){return function(_0x49a882){logger['info'](_0x27c7df,util[_0x5cfe('0x6')](_0x49a882,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x467404,_0x508d6c,_0x59de75){return{'message':_0x467404,'unlock':_0x508d6c,'active':_0x59de75};};exports[_0x5cfe('0xa')]=function(_0x590c96,_0xbfe4c2,_0x4b5853){if(!_['isUndefined'](_0x4b5853)&&_0x5cfe('0xb')===typeof _0x4b5853&&!_['isEmpty'](_0x4b5853)){if(!_['isUndefined'](_0xbfe4c2)&&_0x5cfe('0xb')===typeof _0xbfe4c2&&!_[_0x5cfe('0xc')](_0xbfe4c2)){return util[_0x5cfe('0xd')]('\x22%s\x22\x20<%s>',_0xbfe4c2,_0x4b5853);}return util['format'](_0x5cfe('0xe'),_0x4b5853,_0x4b5853);}if(!_[_0x5cfe('0xf')](_0x590c96)&&_0x5cfe('0xb')===typeof _0x590c96&&!_[_0x5cfe('0xc')](_0x590c96)){return _0x590c96;}return'\x22\x22\x20<>';};exports[_0x5cfe('0x10')]=function(_0x52615f){if(_['isNil'](_0x52615f)){return![];}return _0x52615f;};exports[_0x5cfe('0x11')]=function(_0x495962,_0xaf1bae,_0xf39119,_0x3ec0f,_0x44f8b9,_0x3ec21e){var _0x3c324c={'XMD-QUEUE':_0xaf1bae[_0x5cfe('0x12')]?_0xaf1bae['Queue'][_0x5cfe('0x13')]:'','XMD-CALLERID':_0x3ec0f,'XMD-CALLERID-PREVIEW':_0x3ec21e?util['format'](_0x5cfe('0xe'),_0x3ec21e[_0x5cfe('0x14')],_0x3ec21e[_0x5cfe('0x15')]):_0x3ec0f,'XMD-DIALID':_0x44f8b9,'XMD-CONTACTID':_0xaf1bae[_0x5cfe('0x16')],'XMD-CDRTYPE':_0x5cfe('0x17'),'CALLERID(all)':_0x3ec0f,'XMD-VOICEQUEUEID':_0xaf1bae['VoiceQueueId'],'XMD-DIALCHANNEL':_0xf39119,'XMD-DIALTIMEOUT':_0x495962[_0x5cfe('0x18')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x5cfe('0x19'),_0x495962[_0x5cfe('0x1a')]?'g':'',_[_0x5cfe('0xc')](_0x495962['monitor_format'])?'':_0x5cfe('0x1b')),'XMD-DIALURL':_0x495962[_0x5cfe('0x1c')]||'','XMD-AGI':_0x495962['dialQueueProject']?util[_0x5cfe('0xd')](_0x5cfe('0x1d'),ipAgi,_0x495962[_0x5cfe('0x1e')]):_0x5cfe('0x1f'),'XMD-AGIAFTER':_0x495962[_0x5cfe('0x1a')]?util['format'](_0x5cfe('0x1d'),ipAgi,_0x495962['dialQueueProject2']):_0x5cfe('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x3ec21e?_0x3ec21e['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3ec21e?_0x3ec21e[_0x5cfe('0x20')]:'','XMD-DESTINATION':_0x5cfe('0x21')};if(!_[_0x5cfe('0xc')](_0x495962[_0x5cfe('0x22')])){_0x3c324c[util['format']('%s',_0x5cfe('0x23'))]=_0x495962[_0x5cfe('0x22')];_0x3c324c[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x44f8b9;}if(_0xaf1bae&&_0xaf1bae['Contact']){for(var _0x1649bd in _0xaf1bae['Contact']){if(_0xaf1bae[_0x5cfe('0x24')][_0x5cfe('0x25')](_0x1649bd)){if(!_[_0x5cfe('0x26')](_0xaf1bae[_0x5cfe('0x24')][_0x1649bd])&&_0x1649bd!=='id'&&_0x1649bd!==_0x5cfe('0x27')&&_0x1649bd!=='createdAt'&&_0x1649bd!==_0x5cfe('0x28')){_0x3c324c[util[_0x5cfe('0xd')]('%s%s',_0x5cfe('0x29'),_[_0x5cfe('0x2a')](_0x1649bd))]=_0xaf1bae[_0x5cfe('0x24')][_0x1649bd];}}}}return _0x3c324c;};exports[_0x5cfe('0x2b')]=function(_0x26dd55){var _0x2b422b={};for(var _0x4f4dca in _0x26dd55){if(_0x26dd55[_0x5cfe('0x25')](_0x4f4dca)){_0x2b422b[util[_0x5cfe('0xd')]('%s',_['toLower'](_0x4f4dca))]=_0x26dd55[_0x4f4dca];}}return{'variables':_0x2b422b};};exports[_0x5cfe('0x2c')]=function(_0xd602c6,_0x5d47a6){if(!_[_0x5cfe('0x26')](_0xd602c6)){if(_0xd602c6['hasOwnProperty']('originated')){if(_0xd602c6[_0x5cfe('0x2d')]>0x0){_0xd602c6['originated']-=0x1;}else{logger[_0x5cfe('0x5')](_0x5cfe('0x2e'),_0x5d47a6);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5d47a6);}};exports[_0x5cfe('0x2f')]=function(_0x5cbf06){var _0xed8bf0=moment()[_0x5cfe('0xd')](_0x5cfe('0x30'));_0x5cbf06[_0x5cfe('0x31')]=0xd;_0x5cbf06[_0x5cfe('0x32')]=_0x5cfe('0x33');_0x5cbf06[_0x5cfe('0x34')]=_0xed8bf0;_0x5cbf06[_0x5cfe('0x35')]=_0xed8bf0;_0x5cbf06['endtime']=_0xed8bf0;};exports[_0x5cfe('0x36')]=function(_0x1ec762,_0x409632,_0x2f4f8a){var _0x4f3f79=moment()[_0x5cfe('0xd')](_0x5cfe('0x30'));_0x1ec762[_0x5cfe('0x31')]=_0x409632;_0x1ec762[_0x5cfe('0x32')]=_0x2f4f8a;_0x1ec762[_0x5cfe('0x35')]=_0x4f3f79;_0x1ec762['ringtime']=getSeconds(_0x1ec762['responsetime'],_0x1ec762[_0x5cfe('0x34')]);};exports[_0x5cfe('0x37')]=function(_0xe892f,_0x3612fd,_0x4500ab){_0xe892f[_0x5cfe('0x38')]=_0x3612fd;_0xe892f[_0x5cfe('0x39')]=_0x4500ab;};exports[_0x5cfe('0x3a')]=function(_0x5725e6,_0x109fb6,_0x586d9d){var _0x34c1bf=moment()[_0x5cfe('0xd')](_0x5cfe('0x30'));_0x5725e6['state']=_0x109fb6;_0x5725e6[_0x5cfe('0x32')]=_0x586d9d;_0x5725e6[_0x5cfe('0x35')]=_0x5725e6[_0x5cfe('0x35')]?_0x5725e6[_0x5cfe('0x35')]:_0x34c1bf;_0x5725e6[_0x5cfe('0x3b')]=_0x5725e6['endtime']?_0x5725e6[_0x5cfe('0x3b')]:_0x34c1bf;_0x5725e6[_0x5cfe('0x3c')]=getSeconds(_0x5725e6[_0x5cfe('0x35')]||0x0,_0x5725e6[_0x5cfe('0x34')]||0x0);_0x5725e6['talktime']=_0x5725e6['answertime']?getSeconds(_0x5725e6[_0x5cfe('0x3b')],_0x5725e6[_0x5cfe('0x3d')]):0x0;};exports[_0x5cfe('0x3e')]=function(_0x277f3b){return _0x277f3b===_0x5cfe('0x3f');};exports[_0x5cfe('0x40')]=function(_0x25a700,_0x1c2de5,_0x1d3fe2,_0x3af085,_0x5512fb){var _0x41eee1=_0x3af085?'RECALL':_0x25a700[_0x5cfe('0x14')];_0x41eee1=_0x5512fb?_0x5cfe('0x41'):_0x41eee1;return{'actionid':_0x25a700[_0x5cfe('0x42')],'action':'originate','channel':_0x25a700['channelAgent'],'callerid':util['format'](_0x5cfe('0xe'),_0x41eee1,_0x25a700[_0x5cfe('0x15')]),'Exten':_0x5cfe('0x21'),'Context':_0x5cfe('0x43'),'Priority':'1','variable':_0x1d3fe2,'timeout':(_0x1c2de5[_0x5cfe('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x25a700['uniqueid']};};exports[_0x5cfe('0x45')]=function(_0x197922){return _0x197922['countbusyretry']+_0x197922['countcongestionretry']+_0x197922[_0x5cfe('0x46')];};exports[_0x5cfe('0x47')]=function(_0x58f0c2){var _0x3ffe63=_[_0x5cfe('0x48')](_0x58f0c2);_0x3ffe63['state']=0xf;_0x3ffe63[_0x5cfe('0x32')]='Global';return _0x3ffe63;};exports['scheduledAt']=function(_0x119a5b,_0x207ef0,_0x42223e){var _0x106961={};_0x106961[_0x207ef0]=_0x119a5b[_0x207ef0];_0x106961[_0x5cfe('0x49')]=![];_0x106961['scheduledat']=moment()[_0x5cfe('0x4a')](_0x42223e,_0x5cfe('0x4b'))[_0x5cfe('0xd')](_0x5cfe('0x30'));_0x106961['ContactId']=_0x119a5b[_0x5cfe('0x16')];_0x106961['ListId']=_0x119a5b[_0x5cfe('0x4c')];_0x106961['VoiceQueueId']=_0x119a5b[_0x5cfe('0x4d')]||undefined;return _0x106961;};exports['decrementTalkink']=function(_0x292b50,_0x4ae8b4){if(!_[_0x5cfe('0x26')](_0x292b50)){if(_0x292b50[_0x5cfe('0x4e')]>0x0){_0x292b50['pTalking']-=0x1;}else{logger[_0x5cfe('0x5')](_0x4ae8b4,_0x5cfe('0x4f'));}}else{logger[_0x5cfe('0x5')](_0x4ae8b4,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x5cfe('0x50')]=function(_0x154dcc){if(_0x154dcc<=0x0){return!![];}return![];};exports[_0x5cfe('0x51')]=function(_0x1b78fa,_0x115724){_0x1b78fa[_0x5cfe('0x52')]=_0x115724;_0x1b78fa[_0x5cfe('0x13')]=_0x1b78fa[_0x5cfe('0x53')];_0x1b78fa['interface']=_0x1b78fa[_0x5cfe('0x54')];return _0x1b78fa;};exports[_0x5cfe('0x55')]=function(_0x17f61f){var _0x207616={};_0x207616['queue']=_0x17f61f[_0x5cfe('0x53')];_0x207616[_0x5cfe('0x56')]=_0x17f61f[_0x5cfe('0x54')];_0x207616[_0x5cfe('0x42')]=_0x17f61f['uniqueid'];return _0x207616;};exports['agentReadyId']=function(_0x1e36bb){var _0xb087c3=[];for(var _0x544acf in _0x1e36bb){if(_0x1e36bb[_0x5cfe('0x25')](_0x544acf)){if(!_[_0x5cfe('0x26')](_0x1e36bb[_0x544acf])&&_0x1e36bb[_0x544acf]['state']===_0x5cfe('0x57')&&_0x1e36bb[_0x544acf]['status']===_0x5cfe('0x58')){_0xb087c3[_0x5cfe('0x59')](_0x1e36bb[_0x544acf]['id']);}}}return _0xb087c3;};exports['getDiff']=function(_0x176d29){var _0x599509=moment()[_0x5cfe('0x5a')](0x0);var _0x3adacd=moment(_0x176d29)[_0x5cfe('0x5a')](0x0);return _0x599509[_0x5cfe('0x3')](_0x3adacd,_0x5cfe('0x5b'));};exports[_0x5cfe('0x5c')]=function(_0x5ecd76){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5ecd76[_0x5cfe('0x16')],'ListId':_0x5ecd76['ListId'],'VoiceQueueId':_0x5ecd76[_0x5cfe('0x4d')]||undefined,'CampaignId':_0x5ecd76[_0x5cfe('0x5d')]||undefined};};exports[_0x5cfe('0x5e')]=function(_0x161adb){if(_0x161adb==='uniqueid'||_0x161adb===_0x5cfe('0x5f')||_0x161adb===_0x5cfe('0x53')||_0x161adb===_0x5cfe('0x60')||_0x161adb===_0x5cfe('0x61')||_0x161adb==='dialAnswer'||_0x161adb===_0x5cfe('0x38')||_0x161adb===_0x5cfe('0x54')||_0x161adb===_0x5cfe('0x14')||_0x161adb===_0x5cfe('0x49')||_0x161adb===_0x5cfe('0x15')||_0x161adb===_0x5cfe('0x62')||_0x161adb===_0x5cfe('0x63')||_0x161adb===_0x5cfe('0x64')||_0x161adb===_0x5cfe('0x46')||_0x161adb===_0x5cfe('0x65')||_0x161adb==='callback'||_0x161adb===_0x5cfe('0x66')||_0x161adb==='callbackat'||_0x161adb===_0x5cfe('0x67')||_0x161adb===_0x5cfe('0x16')||_0x161adb===_0x5cfe('0x4c')||_0x161adb==='UserId'||_0x161adb===_0x5cfe('0x4d')||_0x161adb===_0x5cfe('0x68')||_0x161adb===_0x5cfe('0x69')||_0x161adb==='xmd-queue'||_0x161adb===_0x5cfe('0x6a')||_0x161adb===_0x5cfe('0x6b')||_0x161adb===_0x5cfe('0x6c')||_0x161adb===_0x5cfe('0x6d')||_0x161adb==='xmd-dialoptions'||_0x161adb===_0x5cfe('0x6e')||_0x161adb==='xmd-dialchannel'||_0x161adb===_0x5cfe('0x6f')||_0x161adb==='xmd-cdrtype'||_0x161adb==='xmd-callerid'||_0x161adb===_0x5cfe('0x70')||_0x161adb===_0x5cfe('0x71')||_0x161adb==='rtpaudioqos'||_0x161adb===_0x5cfe('0x72')||_0x161adb===_0x5cfe('0x73')||_0x161adb===_0x5cfe('0x74')||_0x161adb===_0x5cfe('0x75')||_0x161adb===_0x5cfe('0x76')||_0x161adb==='rtpaudioqosrtt'||_0x161adb===_0x5cfe('0x77')||_0x161adb===_0x5cfe('0x78')||_0x161adb===_0x5cfe('0x72')||_0x161adb===_0x5cfe('0x73')||_0x161adb===_0x5cfe('0x74')||_0x161adb===_0x5cfe('0x75')||_0x161adb===_0x5cfe('0x76')||_0x161adb===_0x5cfe('0x79')||_0x161adb==='rtpaudioqosrttbridged'||_0x161adb===_0x5cfe('0x7a')||_0x161adb===_0x5cfe('0x7b')||_0x161adb===_0x5cfe('0x31')||_0x161adb===_0x5cfe('0x32')){return![];}return!![];};exports[_0x5cfe('0x7c')]=function(_0x2197f5,_0x562271){var _0x3ed0a3,_0x27687d,_0x4bbb17;if(_0x562271<=0x0){_0x562271=0x1;}_0x3ed0a3=new RegExp(_0x5cfe('0x7d')+_0x562271+'}$');_0x27687d=Math[_0x5cfe('0x7e')](0xa,_0x562271-0x1);_0x4bbb17=Math[_0x5cfe('0x7e')](0xa,_0x562271)-0x1;return util[_0x5cfe('0xd')]('%s',_[_0x5cfe('0x7f')](_0x2197f5,_0x3ed0a3,_[_0x5cfe('0x80')](_0x27687d,_0x4bbb17)));};exports['extractCalleridName']=function(_0x39c813){var _0x4a1c74=_0x39c813[_0x5cfe('0x81')](/"(.*?)"/);return _0x4a1c74?_0x4a1c74[0x1]:_0x39c813;};exports[_0x5cfe('0x82')]=function(_0x504569){var _0xb37ed4=_0x504569[_0x5cfe('0x81')](/<(.*?)>/);return _0xb37ed4?_0xb37ed4[0x1]:_0x504569;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 0a754f7..26c7a48 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 _0xd0bb=['voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel'];(function(_0x5e5a26,_0x4ad3e1){var _0x5dcc7b=function(_0x156a63){while(--_0x156a63){_0x5e5a26['push'](_0x5e5a26['shift']());}};_0x5dcc7b(++_0x4ad3e1);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xd1315c,_0x2ce3a0){_0xd1315c=_0xd1315c-0x0;var _0x40565a=_0xd0bb[_0xd1315c];return _0x40565a;};'use strict';exports[_0xbd0b('0x0')]={'queue':{'type':_0xbd0b('0x1'),'required':!![]},'interface':{'type':_0xbd0b('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xbd0b('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbd0b('0x3')]={'queue':{'type':_0xbd0b('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xbd0b('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xbd0b('0x5')},'reason':{'type':_0xbd0b('0x1'),'required':![]}};exports[_0xbd0b('0x6')]={'module':{'type':_0xbd0b('0x1'),'required':![]}};exports[_0xbd0b('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xbd0b('0x8')]={'uniqueid':{'type':_0xbd0b('0x1'),'required':!![]},'filename':{'type':_0xbd0b('0x1')},'format':{'type':_0xbd0b('0x1')},'mixmonitorid':{'type':_0xbd0b('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0xbd0b('0x9')]={'uniqueid':{'type':_0xbd0b('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xbd0b('0x1')}}; \ No newline at end of file +var _0x689c=['queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove'];(function(_0x2968f2,_0x24e694){var _0x3e25ec=function(_0x2ca4d2){while(--_0x2ca4d2){_0x2968f2['push'](_0x2968f2['shift']());}};_0x3e25ec(++_0x24e694);}(_0x689c,0x9e));var _0xc689=function(_0x30524d,_0x3e48de){_0x30524d=_0x30524d-0x0;var _0x180f71=_0x689c[_0x30524d];return _0x180f71;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xc689('0x0'),'required':!![]},'membername':{'type':_0xc689('0x0'),'required':!![]},'penalty':{'type':_0xc689('0x1'),'required':![]},'paused':{'type':_0xc689('0x2'),'required':![]}};exports[_0xc689('0x3')]={'queue':{'type':_0xc689('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xc689('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xc689('0x0'),'required':![]}};exports[_0xc689('0x5')]={'module':{'type':_0xc689('0x0'),'required':![]}};exports[_0xc689('0x6')]={'uniqueid':{'type':_0xc689('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xc689('0x0'),'required':!![]},'filename':{'type':_0xc689('0x0')},'format':{'type':_0xc689('0x0')},'mixmonitorid':{'type':'string'}};exports[_0xc689('0x7')]={'uniqueid':{'type':_0xc689('0x0'),'required':!![]}};exports[_0xc689('0x8')]={'uniqueid':{'type':_0xc689('0x0'),'required':!![]},'exten':{'type':_0xc689('0x0'),'required':!![]},'context':{'type':_0xc689('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b5f238a..52a3a47 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 _0x2029=['sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','duration','ANSWERED','billableseconds','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','name','isNil','format','SIP/%s','interface','answered'];(function(_0x3b7186,_0x3cb7ee){var _0x1196cc=function(_0x2b2492){while(--_0x2b2492){_0x3b7186['push'](_0x3b7186['shift']());}};_0x1196cc(++_0x3cb7ee);}(_0x2029,0x171));var _0x9202=function(_0x35e8c6,_0x3668ad){_0x35e8c6=_0x35e8c6-0x0;var _0x2da74b=_0x2029[_0x35e8c6];return _0x2da74b;};'use strict';var BPromise=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var _=require('lodash');var moment=require(_0x9202('0x2'));var Agent=require(_0x9202('0x3'));var Telephone=require(_0x9202('0x4'));var Trunk=require(_0x9202('0x5'));var VoiceQueue=require(_0x9202('0x6'));var Trigger=require(_0x9202('0x7'));var Template=require(_0x9202('0x8'));var Campaign=require(_0x9202('0x9'));var VoiceExtension=require(_0x9202('0xa'));var ZendeskAccount=require(_0x9202('0xb'));var SalesforceAccount=require(_0x9202('0xc'));var FreshdeskAccount=require(_0x9202('0xd'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x9202('0xe'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x9202('0xf'));var Dynamics365Account=require(_0x9202('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x9202('0x11')]={};this[_0x9202('0x12')]={};this[_0x9202('0x13')]={};this[_0x9202('0x14')]={};this[_0x9202('0x15')]={};this[_0x9202('0x16')]={};this[_0x9202('0x17')]={};this[_0x9202('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9202('0x19')]={};this[_0x9202('0x1a')]={};this[_0x9202('0x1b')]={};this[_0x9202('0x1c')]={};this[_0x9202('0x1d')]={};this[_0x9202('0x1e')]={};this[_0x9202('0x1f')]={};this[_0x9202('0x20')]={};this[_0x9202('0x21')]={};this['zohoAccounts']={};this[_0x9202('0x22')]={};this[_0x9202('0x23')]={};this[_0x9202('0x24')]={};this[_0x9202('0x25')]={};this[_0x9202('0x26')]={};};function freeIsNotKey(_0x141a17,_0x1ca7a3,_0x1bb4c1){var _0x8c1319=_[_0x9202('0x27')](_0x141a17,function(_0x4bcfe4,_0x281219){return _0x4bcfe4[_0x1bb4c1];});for(var _0x1c3243 in _0x1ca7a3){if(_0x1ca7a3[_0x9202('0x28')](_0x1c3243)){if(!_0x8c1319[_0x1c3243]){delete _0x1ca7a3[_0x1c3243];}}}}function freeIsNotKeySip(_0x1222b6,_0x332141){var _0x1aad83=_[_0x9202('0x27')](_0x1222b6,function(_0x3bd33f,_0x2a3c41){return util['format']('SIP/%s',_0x3bd33f[_0x9202('0x29')]);});for(var _0x286a16 in _0x332141){if(_0x332141[_0x9202('0x28')](_0x286a16)){if(!_0x1aad83[_0x286a16]){delete _0x332141[_0x286a16];}}}}function freeIsNotKeyAgent(_0x10a556,_0x520f98){var _0x2a3a02=_['mapKeys'](_0x10a556,function(_0x2f9b9d,_0x3141c3){var _0x57585e=_[_0x9202('0x2a')](_0x2f9b9d['interface'])?util[_0x9202('0x2b')](_0x9202('0x2c'),_0x2f9b9d[_0x9202('0x29')]):_0x2f9b9d[_0x9202('0x2d')];return _0x57585e;});for(var _0x2cdeb8 in _0x520f98){if(_0x520f98[_0x9202('0x28')](_0x2cdeb8)){if(!_0x2a3a02[_0x2cdeb8]){delete _0x520f98[_0x2cdeb8];}}}}function clearVoiceCallReports(_0x3a68f5){_0x3a68f5['total']=0x0;_0x3a68f5[_0x9202('0x2e')]=0x0;_0x3a68f5[_0x9202('0x2f')]=0x0;_0x3a68f5[_0x9202('0x30')]=0x0;_0x3a68f5[_0x9202('0x31')]=0x0;}function clearCampaigns(_0x3e722a){if(!_[_0x9202('0x32')](_0x3e722a)){for(var _0x547328 in _0x3e722a){if(_0x3e722a[_0x9202('0x28')](_0x547328)){_0x3e722a[_0x547328][_0x9202('0x33')]=0x0;_0x3e722a[_0x547328][_0x9202('0x34')]=0x0;}}}}function clearVoiceQueues(_0x5082b6){if(!_['isEmpty'](_0x5082b6)){for(var _0x56c58d in _0x5082b6){if(_0x5082b6[_0x9202('0x28')](_0x56c58d)){_0x5082b6[_0x56c58d][_0x9202('0x35')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x2e')]=0x0;_0x5082b6[_0x56c58d]['unmanaged']=0x0;_0x5082b6[_0x56c58d][_0x9202('0x36')]=0x0;_0x5082b6[_0x56c58d]['sumHoldTime']=0x0;_0x5082b6[_0x56c58d][_0x9202('0x30')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x31')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x37')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x38')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x39')]=0x0;_0x5082b6[_0x56c58d]['outboundCongestionCallsDay']=0x0;_0x5082b6[_0x56c58d][_0x9202('0x3a')]=0x0;_0x5082b6[_0x56c58d]['outboundUnknownCallsDay']=0x0;_0x5082b6[_0x56c58d][_0x9202('0x3b')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x3c')]=0x0;_0x5082b6[_0x56c58d]['outboundBlacklistCallsDay']=0x0;_0x5082b6[_0x56c58d]['outboundOriginateFailureCallsDay']=0x0;_0x5082b6[_0x56c58d]['outboundRejectCallsDay']=0x0;_0x5082b6[_0x56c58d][_0x9202('0x3d')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x37')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x3e')]=0x0;_0x5082b6[_0x56c58d][_0x9202('0x3f')]=!![];}}}}Realtime['prototype'][_0x9202('0x40')]=function(_0x1c0d75,_0x15591f){for(var _0x4e7c30 in _0x15591f){if(_0x1c0d75[_0x9202('0x28')](_0x4e7c30)){_0x1c0d75[_0x4e7c30]=_0x15591f[_0x4e7c30];}}};Realtime[_0x9202('0x41')][_0x9202('0x42')]=function(){var _0x32d194=this;return function(_0x237cac){if(_0x237cac){freeIsNotKeyAgent(_0x237cac,_0x32d194[_0x9202('0x11')]);for(var _0xa4564a=0x0,_0x46d641={},_0x1c3070={};_0xa4564a<_0x237cac[_0x9202('0x43')];_0xa4564a+=0x1){_0x46d641=_0x237cac[_0xa4564a];var _0x26697a=_[_0x9202('0x2a')](_0x46d641[_0x9202('0x2d')])?util['format'](_0x9202('0x2c'),_0x46d641[_0x9202('0x29')]):_0x46d641['interface'];if(_[_0x9202('0x44')](_0x32d194['agents'][_0x26697a])){_0x32d194[_0x9202('0x11')][_0x26697a]=new Agent(_0x46d641);}else{_0x32d194[_0x9202('0x40')](_0x32d194[_0x9202('0x11')][_0x26697a],_0x46d641);}}}return _0x32d194[_0x9202('0x11')];};};Realtime[_0x9202('0x41')]['initTelephones']=function(){var _0x3c394b=this;return function(_0x52f5e5){if(_0x52f5e5){freeIsNotKeySip(_0x52f5e5,_0x3c394b[_0x9202('0x12')]);for(var _0xc0da2a=0x0,_0x844134={},_0x7f0321={};_0xc0da2a<_0x52f5e5['length'];_0xc0da2a+=0x1){_0x844134=_0x52f5e5[_0xc0da2a];if(_['isUndefined'](_0x3c394b['telephones'][util[_0x9202('0x2b')](_0x9202('0x2c'),_0x844134[_0x9202('0x29')])])){_0x3c394b[_0x9202('0x12')][util[_0x9202('0x2b')]('SIP/%s',_0x844134[_0x9202('0x29')])]=new Telephone(_0x844134);}else{_0x3c394b[_0x9202('0x40')](_0x3c394b[_0x9202('0x12')][util[_0x9202('0x2b')](_0x9202('0x2c'),_0x844134['name'])],_0x844134);}}}return _0x3c394b[_0x9202('0x12')];};};Realtime[_0x9202('0x41')][_0x9202('0x45')]=function(){var _0x1037da=this;return function(_0x10095e){if(_0x10095e){freeIsNotKeySip(_0x10095e,_0x1037da[_0x9202('0x13')]);for(var _0x5c83c1=0x0,_0x44e9e5={},_0x3bd0af={};_0x5c83c1<_0x10095e[_0x9202('0x43')];_0x5c83c1+=0x1){_0x44e9e5=_0x10095e[_0x5c83c1];if(_[_0x9202('0x44')](_0x1037da[_0x9202('0x13')][util['format'](_0x9202('0x2c'),_0x44e9e5[_0x9202('0x29')])])){_0x1037da[_0x9202('0x13')][util[_0x9202('0x2b')]('SIP/%s',_0x44e9e5[_0x9202('0x29')])]=new Trunk(_0x44e9e5);}else{_0x1037da['mergeFromDatabase'](_0x1037da[_0x9202('0x13')][util[_0x9202('0x2b')]('SIP/%s',_0x44e9e5['name'])],_0x44e9e5);}}}return _0x1037da[_0x9202('0x13')];};};Realtime['prototype'][_0x9202('0x46')]=function(){var _0x254d15=this;return function(_0x8a4a37){if(_0x8a4a37){freeIsNotKey(_0x8a4a37,_0x254d15[_0x9202('0x14')],_0x9202('0x29'));for(var _0x14af96=0x0,_0x553cff={},_0x725c70={};_0x14af96<_0x8a4a37[_0x9202('0x43')];_0x14af96+=0x1){_0x553cff=_0x8a4a37[_0x14af96];if(_[_0x9202('0x44')](_0x254d15[_0x9202('0x14')][_0x553cff['name']])){_0x254d15['voiceQueues'][_0x553cff[_0x9202('0x29')]]=new VoiceQueue(_0x553cff);}else{_0x254d15[_0x9202('0x40')](_0x254d15[_0x9202('0x14')][_0x553cff['name']],_0x553cff);}}}return _0x254d15['voiceQueues'];};};Realtime['prototype'][_0x9202('0x47')]=function(){var _0x1e9d12=this;return function(_0x36b6c9){if(_0x36b6c9){freeIsNotKey(_0x36b6c9,_0x1e9d12[_0x9202('0x15')],'id');for(var _0x1b6289=0x0,_0x1396d5={},_0x5b41a9={};_0x1b6289<_0x36b6c9['length'];_0x1b6289+=0x1){_0x1396d5=_0x36b6c9[_0x1b6289];if(_[_0x9202('0x44')](_0x1e9d12[_0x9202('0x15')][_0x1396d5['id']])){_0x1e9d12[_0x9202('0x15')][_0x1396d5['id']]=new Trigger(_0x1396d5);}else{_0x1e9d12[_0x9202('0x40')](_0x1e9d12['triggers'][_0x1396d5['id']],_0x1396d5);}}}return _0x1e9d12['triggers'];};};Realtime['prototype'][_0x9202('0x48')]=function(){var _0x411c3a=this;return function(_0x4b9d05){if(_0x4b9d05){freeIsNotKey(_0x4b9d05,_0x411c3a[_0x9202('0x17')],'id');for(var _0xa8e09e=0x0,_0x2b87e2={},_0x261c27={};_0xa8e09e<_0x4b9d05[_0x9202('0x43')];_0xa8e09e+=0x1){_0x2b87e2=_0x4b9d05[_0xa8e09e];if(_[_0x9202('0x44')](_0x411c3a[_0x9202('0x17')][_0x2b87e2['id']])){_0x411c3a['templates'][_0x2b87e2['id']]=new Template(_0x2b87e2);}else{_0x411c3a[_0x9202('0x40')](_0x411c3a[_0x9202('0x17')][_0x2b87e2['id']],_0x2b87e2);}}}return _0x411c3a[_0x9202('0x17')];};};Realtime['prototype'][_0x9202('0x49')]=function(){var _0x2e134b=this;return function(_0x2e6d09){if(_0x2e6d09){freeIsNotKey(_0x2e6d09,_0x2e134b[_0x9202('0x1e')],'id');for(var _0x4bbbf1=0x0,_0x23f041={},_0x5e4e80={};_0x4bbbf1<_0x2e6d09[_0x9202('0x43')];_0x4bbbf1+=0x1){_0x23f041=_0x2e6d09[_0x4bbbf1];if(_[_0x9202('0x44')](_0x2e134b[_0x9202('0x1e')][_0x23f041['id']])){_0x2e134b[_0x9202('0x1e')][_0x23f041['id']]=new ZendeskAccount(_0x23f041);}else{_0x2e134b[_0x9202('0x40')](_0x2e134b[_0x9202('0x1e')][_0x23f041['id']],_0x23f041);}}}return _0x2e134b[_0x9202('0x1e')];};};Realtime[_0x9202('0x41')][_0x9202('0x4a')]=function(){var _0x28d6b2=this;return function(_0x45155f){if(_0x45155f){freeIsNotKey(_0x45155f,_0x28d6b2[_0x9202('0x1f')],'id');for(var _0x338173=0x0,_0x3987ac={},_0x29ef57={};_0x338173<_0x45155f[_0x9202('0x43')];_0x338173+=0x1){_0x3987ac=_0x45155f[_0x338173];if(_[_0x9202('0x44')](_0x28d6b2['salesforceAccounts'][_0x3987ac['id']])){_0x28d6b2['salesforceAccounts'][_0x3987ac['id']]=new SalesforceAccount(_0x3987ac);}else{_0x28d6b2[_0x9202('0x40')](_0x28d6b2['salesforceAccounts'][_0x3987ac['id']],_0x3987ac);}}}return _0x28d6b2['salesforceAccounts'];};};Realtime[_0x9202('0x41')][_0x9202('0x4b')]=function(){var _0x195b93=this;return function(_0xd02f28){if(_0xd02f28){freeIsNotKey(_0xd02f28,_0x195b93['freshdeskAccounts'],'id');for(var _0x38f8cf=0x0,_0x1c8af7={},_0x494d41={};_0x38f8cf<_0xd02f28[_0x9202('0x43')];_0x38f8cf+=0x1){_0x1c8af7=_0xd02f28[_0x38f8cf];if(_[_0x9202('0x44')](_0x195b93['freshdeskAccounts'][_0x1c8af7['id']])){_0x195b93[_0x9202('0x21')][_0x1c8af7['id']]=new FreshdeskAccount(_0x1c8af7);}else{_0x195b93[_0x9202('0x40')](_0x195b93[_0x9202('0x21')][_0x1c8af7['id']],_0x1c8af7);}}}return _0x195b93[_0x9202('0x21')];};};Realtime['prototype'][_0x9202('0x4c')]=function(){var _0x5babf6=this;return function(_0x14ecdb){if(_0x14ecdb){freeIsNotKey(_0x14ecdb,_0x5babf6[_0x9202('0x4d')],'id');for(var _0x13ee4f=0x0,_0x556031={},_0x436802={};_0x13ee4f<_0x14ecdb[_0x9202('0x43')];_0x13ee4f+=0x1){_0x556031=_0x14ecdb[_0x13ee4f];if(_[_0x9202('0x44')](_0x5babf6[_0x9202('0x4d')][_0x556031['id']])){_0x5babf6['zohoAccounts'][_0x556031['id']]=new ZohoAccount(_0x556031);}else{_0x5babf6['mergeFromDatabase'](_0x5babf6[_0x9202('0x4d')][_0x556031['id']],_0x556031);}}}return _0x5babf6[_0x9202('0x4d')];};};Realtime[_0x9202('0x41')][_0x9202('0x4e')]=function(){var _0x3ff96d=this;return function(_0x4166e5){if(_0x4166e5){freeIsNotKey(_0x4166e5,_0x3ff96d['deskAccounts'],'id');for(var _0x2a67e5=0x0,_0x30373d={},_0x5689cf={};_0x2a67e5<_0x4166e5[_0x9202('0x43')];_0x2a67e5+=0x1){_0x30373d=_0x4166e5[_0x2a67e5];if(_[_0x9202('0x44')](_0x3ff96d['deskAccounts'][_0x30373d['id']])){_0x3ff96d['deskAccounts'][_0x30373d['id']]=new DeskAccount(_0x30373d);}else{_0x3ff96d[_0x9202('0x40')](_0x3ff96d['deskAccounts'][_0x30373d['id']],_0x30373d);}}}return _0x3ff96d['deskAccounts'];};};Realtime[_0x9202('0x41')][_0x9202('0x4f')]=function(){var _0xb9e5f7=this;return function(_0x3e2fb0){if(_0x3e2fb0){freeIsNotKey(_0x3e2fb0,_0xb9e5f7[_0x9202('0x20')],'id');for(var _0x1e6be4=0x0,_0x42d168={},_0x3122eb={};_0x1e6be4<_0x3e2fb0[_0x9202('0x43')];_0x1e6be4+=0x1){_0x42d168=_0x3e2fb0[_0x1e6be4];if(_[_0x9202('0x44')](_0xb9e5f7[_0x9202('0x20')][_0x42d168['id']])){_0xb9e5f7[_0x9202('0x20')][_0x42d168['id']]=new SugarcrmAccount(_0x42d168);}else{_0xb9e5f7[_0x9202('0x40')](_0xb9e5f7[_0x9202('0x20')][_0x42d168['id']],_0x42d168);}}}return _0xb9e5f7[_0x9202('0x20')];};};Realtime[_0x9202('0x41')][_0x9202('0x50')]=function(){var _0x422d48=this;return function(_0x568dae){if(_0x568dae){freeIsNotKey(_0x568dae,_0x422d48[_0x9202('0x23')],'id');for(var _0xdef345=0x0,_0x3013bf={},_0x28e852={};_0xdef345<_0x568dae[_0x9202('0x43')];_0xdef345+=0x1){_0x3013bf=_0x568dae[_0xdef345];if(_['isUndefined'](_0x422d48[_0x9202('0x23')][_0x3013bf['id']])){_0x422d48[_0x9202('0x23')][_0x3013bf['id']]=new VtigerAccount(_0x3013bf);}else{_0x422d48[_0x9202('0x40')](_0x422d48[_0x9202('0x23')][_0x3013bf['id']],_0x3013bf);}}}return _0x422d48['vtigerAccounts'];};};Realtime[_0x9202('0x41')]['initServicenowAccounts']=function(){var _0x2f0e69=this;return function(_0x3a6c6c){if(_0x3a6c6c){freeIsNotKey(_0x3a6c6c,_0x2f0e69['servicenowAccounts'],'id');for(var _0x2306b0=0x0,_0x288a9e={},_0x4ffc42={};_0x2306b0<_0x3a6c6c[_0x9202('0x43')];_0x2306b0+=0x1){_0x288a9e=_0x3a6c6c[_0x2306b0];if(_[_0x9202('0x44')](_0x2f0e69[_0x9202('0x24')][_0x288a9e['id']])){_0x2f0e69[_0x9202('0x24')][_0x288a9e['id']]=new ServicenowAccount(_0x288a9e);}else{_0x2f0e69[_0x9202('0x40')](_0x2f0e69[_0x9202('0x24')][_0x288a9e['id']],_0x288a9e);}}}return _0x2f0e69[_0x9202('0x24')];};};Realtime[_0x9202('0x41')]['initDynamics365Accounts']=function(){var _0x577aa5=this;return function(_0x30b4ef){if(_0x30b4ef){freeIsNotKey(_0x30b4ef,_0x577aa5[_0x9202('0x25')],'id');for(var _0x24e981=0x0,_0x34dac4={},_0x42957d={};_0x24e981<_0x30b4ef[_0x9202('0x43')];_0x24e981+=0x1){_0x34dac4=_0x30b4ef[_0x24e981];if(_[_0x9202('0x44')](_0x577aa5['dynamics365Accounts'][_0x34dac4['id']])){_0x577aa5[_0x9202('0x25')][_0x34dac4['id']]=new Dynamics365Account(_0x34dac4);}else{_0x577aa5[_0x9202('0x40')](_0x577aa5[_0x9202('0x25')][_0x34dac4['id']],_0x34dac4);}}}return _0x577aa5['dynamics365Accounts'];};};Realtime[_0x9202('0x41')][_0x9202('0x51')]=function(){var _0x1ab82f=this;return function(_0x5f5259){for(var _0x248123=0x0;_0x248123<_0x5f5259[_0x9202('0x43')];_0x248123+=0x1){_[_0x9202('0x52')](_0x1ab82f['voiceQueues'][_0x5f5259[_0x248123][_0x9202('0x29')]],_0x5f5259[_0x248123]);}return _0x1ab82f[_0x9202('0x14')];};};Realtime['prototype'][_0x9202('0x53')]=function(){var _0x9bdac9=this;return function(_0x12a457){clearVoiceQueues(_0x9bdac9[_0x9202('0x14')]);if(_0x12a457){_0x12a457=_[_0x9202('0x54')](_0x12a457,'uniqueid');for(var _0x59d498 in _0x12a457){if(_0x12a457[_0x9202('0x28')](_0x59d498)){var _0x1d271e={};for(var _0x3504b6=0x0;_0x3504b6<_0x12a457[_0x59d498][_0x9202('0x43')];_0x3504b6+=0x1){var _0x101957=_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x55')];if(_0x9bdac9[_0x9202('0x14')][_0x101957]){if(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x56')]){_0x9bdac9['voiceQueues'][_0x101957]['unmanaged']+=0x1;}if(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x57')]){_0x9bdac9['voiceQueues'][_0x101957][_0x9202('0x36')]+=0x1;}_0x9bdac9[_0x9202('0x14')][_0x101957][_0x9202('0x2f')]+=moment(_0x12a457[_0x59d498][_0x3504b6]['queuecallerleaveAt'])[_0x9202('0x58')](moment(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x59')]),_0x9202('0x5a'))||0x0;if(_0x3504b6===_0x12a457[_0x59d498]['length']-0x1){_0x9bdac9[_0x9202('0x14')][_0x101957][_0x9202('0x30')]+=moment(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x5b')]||_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x5c')]||_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x5d')])['diff'](moment(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x59')]),_0x9202('0x5a'))||0x0;_0x9bdac9[_0x9202('0x14')][_0x101957][_0x9202('0x35')]+=0x1;if(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x5e')]){_0x9bdac9['voiceQueues'][_0x101957][_0x9202('0x2e')]+=0x1;_0x9bdac9[_0x9202('0x14')][_0x101957]['sumBillable']+=moment(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x5b')])[_0x9202('0x58')](moment(_0x12a457[_0x59d498][_0x3504b6][_0x9202('0x5f')]),_0x9202('0x5a'))||0x0;}}else{_0x9bdac9[_0x9202('0x14')][_0x101957][_0x9202('0x30')]+=_0x9bdac9[_0x9202('0x14')][_0x101957][_0x9202('0x2f')]||0x0;}}}}}}return _0x9bdac9[_0x9202('0x14')];};};Realtime[_0x9202('0x41')][_0x9202('0x60')]=function(){var _0xe3bec=this;return function(_0x181db9){clearVoiceCallReports(_0xe3bec[_0x9202('0x18')]);if(_0x181db9){for(var _0x439ced=0x0;_0x439ced<_0x181db9['length'];_0x439ced+=0x1){_0xe3bec[_0x9202('0x18')][_0x9202('0x35')]+=0x1;_0xe3bec[_0x9202('0x18')][_0x9202('0x30')]+=_0x181db9[_0x439ced][_0x9202('0x61')];if(_0x181db9[_0x439ced]['disposition']===_0x9202('0x62')){_0xe3bec[_0x9202('0x18')][_0x9202('0x2e')]+=0x1;_0xe3bec[_0x9202('0x18')][_0x9202('0x2f')]+=_0x181db9[_0x439ced]['duration']-_0x181db9[_0x439ced][_0x9202('0x63')]||0x0;_0xe3bec[_0x9202('0x18')][_0x9202('0x31')]+=_0x181db9[_0x439ced][_0x9202('0x63')];}}}return _0xe3bec[_0x9202('0x18')];};};Realtime[_0x9202('0x41')]['initCampaigns']=function(){var _0x2dc7f8=this;return function(_0x513a67){if(_0x513a67){freeIsNotKey(_0x513a67,_0x2dc7f8['campaigns'],_0x9202('0x29'));for(var _0x3d7362=0x0,_0x4be772={};_0x3d7362<_0x513a67[_0x9202('0x43')];_0x3d7362+=0x1){_0x4be772=_0x513a67[_0x3d7362];if(_[_0x9202('0x44')](_0x2dc7f8[_0x9202('0x16')][_0x4be772['name']])){_0x2dc7f8[_0x9202('0x16')][_0x4be772[_0x9202('0x29')]]=new Campaign(_0x4be772);}else{_0x2dc7f8['mergeFromDatabase'](_0x2dc7f8[_0x9202('0x16')][_0x4be772[_0x9202('0x29')]],_0x4be772);}}}return _0x2dc7f8[_0x9202('0x16')];};};Realtime[_0x9202('0x41')][_0x9202('0x64')]=function(){var _0x1eb9cb=this;return function(_0x3445a1){if(_0x3445a1){freeIsNotKey(_0x3445a1,_0x1eb9cb[_0x9202('0x19')],'id');for(var _0x4a27b7=0x0,_0x183a97={};_0x4a27b7<_0x3445a1[_0x9202('0x43')];_0x4a27b7+=0x1){_0x183a97=_0x3445a1[_0x4a27b7];if(_[_0x9202('0x44')](_0x1eb9cb[_0x9202('0x19')][_0x183a97['id']])){_0x1eb9cb[_0x9202('0x19')][_0x183a97['id']]=new VoiceExtension(_0x183a97);}else{_0x1eb9cb[_0x9202('0x40')](_0x1eb9cb[_0x9202('0x19')][_0x183a97['id']],_0x183a97);}}}return _0x1eb9cb[_0x9202('0x19')];};};Realtime[_0x9202('0x41')][_0x9202('0x65')]=function(){var _0x3205a4=this;return function(_0x16b5f0){clearCampaigns(_0x3205a4[_0x9202('0x16')]);for(var _0x51719a=0x0;_0x51719a<_0x16b5f0['length'];_0x51719a+=0x1){_[_0x9202('0x52')](_0x3205a4[_0x9202('0x16')][_0x16b5f0[_0x51719a]['name']],_0x16b5f0[_0x51719a]);}return _0x3205a4['campaigns'];};};Realtime[_0x9202('0x41')][_0x9202('0x66')]=function(){var _0x4ebd1f=this;return function(_0x5538bb){if(_0x5538bb){freeIsNotKey(_0x5538bb,_0x4ebd1f['faxAccounts'],'id');for(var _0x1a874c=0x0,_0x532b62={},_0x4fbfc9={};_0x1a874c<_0x5538bb['length'];_0x1a874c+=0x1){_0x532b62=_0x5538bb[_0x1a874c];if(_[_0x9202('0x44')](_0x4ebd1f[_0x9202('0x26')][_0x532b62['id']])){_0x4ebd1f[_0x9202('0x26')][_0x532b62['id']]=new FaxAccount(_0x532b62);}else{_0x4ebd1f[_0x9202('0x40')](_0x4ebd1f['faxAccounts'][_0x532b62['id']],_0x532b62);}}}return _0x4ebd1f[_0x9202('0x26')];};};module[_0x9202('0x67')]=Realtime; \ No newline at end of file +var _0x534f=['initCampaigns','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','triggers','campaigns','outbound','queueChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','dynamics365Accounts','hasOwnProperty','mapKeys','SIP/%s','isNil','interface','format','name','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','mergeFromDatabase','prototype','length','isUndefined','initTelephones','telephones','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','templates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerjoinAt','queuecallercomplete','duration','disposition','ANSWERED','billableseconds'];(function(_0x5d20e7,_0x17d4a4){var _0x70836e=function(_0x1859d9){while(--_0x1859d9){_0x5d20e7['push'](_0x5d20e7['shift']());}};_0x70836e(++_0x17d4a4);}(_0x534f,0x1a3));var _0xf534=function(_0x52f80a,_0x1a4c09){_0x52f80a=_0x52f80a-0x0;var _0x536987=_0x534f[_0x52f80a];return _0x536987;};'use strict';var BPromise=require(_0xf534('0x0'));var util=require(_0xf534('0x1'));var _=require(_0xf534('0x2'));var moment=require(_0xf534('0x3'));var Agent=require(_0xf534('0x4'));var Telephone=require(_0xf534('0x5'));var Trunk=require(_0xf534('0x6'));var VoiceQueue=require(_0xf534('0x7'));var Trigger=require(_0xf534('0x8'));var Template=require(_0xf534('0x9'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf534('0xa'));var ZendeskAccount=require(_0xf534('0xb'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xf534('0xc'));var SugarcrmAccount=require(_0xf534('0xd'));var ZohoAccount=require(_0xf534('0xe'));var DeskAccount=require(_0xf534('0xf'));var VtigerAccount=require(_0xf534('0x10'));var ServicenowAccount=require(_0xf534('0x11'));var Dynamics365Account=require(_0xf534('0x12'));var FaxAccount=require(_0xf534('0x13'));var Realtime=function(){this[_0xf534('0x14')]={};this['telephones']={};this['trunks']={};this['voiceQueues']={};this[_0xf534('0x15')]={};this[_0xf534('0x16')]={};this['templates']={};this[_0xf534('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0xf534('0x18')]={};this['outboundChannels']={};this['timers']={};this[_0xf534('0x19')]={};this[_0xf534('0x1a')]={};this[_0xf534('0x1b')]={};this[_0xf534('0x1c')]={};this['zohoAccounts']={};this[_0xf534('0x1d')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0xf534('0x1e')]={};this['faxAccounts']={};};function freeIsNotKey(_0x121b21,_0x1a2de3,_0x2f3884){var _0x3c1bf8=_['mapKeys'](_0x121b21,function(_0x5a4a43,_0x533f9c){return _0x5a4a43[_0x2f3884];});for(var _0x1979f5 in _0x1a2de3){if(_0x1a2de3[_0xf534('0x1f')](_0x1979f5)){if(!_0x3c1bf8[_0x1979f5]){delete _0x1a2de3[_0x1979f5];}}}}function freeIsNotKeySip(_0x3c4dfb,_0x5cbc4c){var _0x1b82d7=_[_0xf534('0x20')](_0x3c4dfb,function(_0x169d96,_0x2ab579){return util['format'](_0xf534('0x21'),_0x169d96['name']);});for(var _0x234055 in _0x5cbc4c){if(_0x5cbc4c[_0xf534('0x1f')](_0x234055)){if(!_0x1b82d7[_0x234055]){delete _0x5cbc4c[_0x234055];}}}}function freeIsNotKeyAgent(_0x2598cf,_0x2faeaf){var _0x1b06e8=_['mapKeys'](_0x2598cf,function(_0x1f9afb,_0xd7ae14){var _0x112638=_[_0xf534('0x22')](_0x1f9afb[_0xf534('0x23')])?util[_0xf534('0x24')](_0xf534('0x21'),_0x1f9afb[_0xf534('0x25')]):_0x1f9afb[_0xf534('0x23')];return _0x112638;});for(var _0x51b604 in _0x2faeaf){if(_0x2faeaf[_0xf534('0x1f')](_0x51b604)){if(!_0x1b06e8[_0x51b604]){delete _0x2faeaf[_0x51b604];}}}}function clearVoiceCallReports(_0x52698f){_0x52698f[_0xf534('0x26')]=0x0;_0x52698f[_0xf534('0x27')]=0x0;_0x52698f['sumHoldTime']=0x0;_0x52698f[_0xf534('0x28')]=0x0;_0x52698f[_0xf534('0x29')]=0x0;}function clearCampaigns(_0x1ccdca){if(!_[_0xf534('0x2a')](_0x1ccdca)){for(var _0x5ae9bf in _0x1ccdca){if(_0x1ccdca['hasOwnProperty'](_0x5ae9bf)){_0x1ccdca[_0x5ae9bf][_0xf534('0x2b')]=0x0;_0x1ccdca[_0x5ae9bf][_0xf534('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x4161e1){if(!_[_0xf534('0x2a')](_0x4161e1)){for(var _0x4f58ee in _0x4161e1){if(_0x4161e1['hasOwnProperty'](_0x4f58ee)){_0x4161e1[_0x4f58ee][_0xf534('0x26')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x27')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x2d')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x2e')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x2f')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x28')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x29')]=0x0;_0x4161e1[_0x4f58ee]['outboundAnswerAgiCallsDay']=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x30')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x31')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x32')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x33')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x34')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x35')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x36')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x37')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x38')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x39')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x3a')]=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x3b')]=0x0;_0x4161e1[_0x4f58ee]['outboundAnswerCallsDay']=0x0;_0x4161e1[_0x4f58ee][_0xf534('0x3c')]=!![];}}}}Realtime['prototype'][_0xf534('0x3d')]=function(_0x29d6cc,_0x4bd308){for(var _0x298915 in _0x4bd308){if(_0x29d6cc[_0xf534('0x1f')](_0x298915)){_0x29d6cc[_0x298915]=_0x4bd308[_0x298915];}}};Realtime[_0xf534('0x3e')]['initAgents']=function(){var _0x191b49=this;return function(_0x4d667b){if(_0x4d667b){freeIsNotKeyAgent(_0x4d667b,_0x191b49[_0xf534('0x14')]);for(var _0xac63e6=0x0,_0xff61f7={},_0x2c65ec={};_0xac63e6<_0x4d667b[_0xf534('0x3f')];_0xac63e6+=0x1){_0xff61f7=_0x4d667b[_0xac63e6];var _0x349345=_[_0xf534('0x22')](_0xff61f7[_0xf534('0x23')])?util[_0xf534('0x24')]('SIP/%s',_0xff61f7[_0xf534('0x25')]):_0xff61f7['interface'];if(_[_0xf534('0x40')](_0x191b49[_0xf534('0x14')][_0x349345])){_0x191b49['agents'][_0x349345]=new Agent(_0xff61f7);}else{_0x191b49['mergeFromDatabase'](_0x191b49[_0xf534('0x14')][_0x349345],_0xff61f7);}}}return _0x191b49['agents'];};};Realtime[_0xf534('0x3e')][_0xf534('0x41')]=function(){var _0x138c4a=this;return function(_0x2fcb75){if(_0x2fcb75){freeIsNotKeySip(_0x2fcb75,_0x138c4a['telephones']);for(var _0x468b90=0x0,_0x532c45={},_0x203868={};_0x468b90<_0x2fcb75['length'];_0x468b90+=0x1){_0x532c45=_0x2fcb75[_0x468b90];if(_[_0xf534('0x40')](_0x138c4a[_0xf534('0x42')][util[_0xf534('0x24')](_0xf534('0x21'),_0x532c45[_0xf534('0x25')])])){_0x138c4a[_0xf534('0x42')][util[_0xf534('0x24')]('SIP/%s',_0x532c45[_0xf534('0x25')])]=new Telephone(_0x532c45);}else{_0x138c4a[_0xf534('0x3d')](_0x138c4a[_0xf534('0x42')][util['format'](_0xf534('0x21'),_0x532c45[_0xf534('0x25')])],_0x532c45);}}}return _0x138c4a['telephones'];};};Realtime[_0xf534('0x3e')][_0xf534('0x43')]=function(){var _0x20d52c=this;return function(_0x33b2cc){if(_0x33b2cc){freeIsNotKeySip(_0x33b2cc,_0x20d52c['trunks']);for(var _0x269599=0x0,_0x12f685={},_0x28d7f4={};_0x269599<_0x33b2cc['length'];_0x269599+=0x1){_0x12f685=_0x33b2cc[_0x269599];if(_['isUndefined'](_0x20d52c[_0xf534('0x44')][util[_0xf534('0x24')](_0xf534('0x21'),_0x12f685['name'])])){_0x20d52c[_0xf534('0x44')][util['format']('SIP/%s',_0x12f685[_0xf534('0x25')])]=new Trunk(_0x12f685);}else{_0x20d52c['mergeFromDatabase'](_0x20d52c['trunks'][util['format'](_0xf534('0x21'),_0x12f685[_0xf534('0x25')])],_0x12f685);}}}return _0x20d52c[_0xf534('0x44')];};};Realtime['prototype'][_0xf534('0x45')]=function(){var _0x2946d7=this;return function(_0x413810){if(_0x413810){freeIsNotKey(_0x413810,_0x2946d7['voiceQueues'],_0xf534('0x25'));for(var _0x17cf14=0x0,_0x4b5183={},_0x50f13a={};_0x17cf14<_0x413810[_0xf534('0x3f')];_0x17cf14+=0x1){_0x4b5183=_0x413810[_0x17cf14];if(_[_0xf534('0x40')](_0x2946d7[_0xf534('0x46')][_0x4b5183[_0xf534('0x25')]])){_0x2946d7[_0xf534('0x46')][_0x4b5183[_0xf534('0x25')]]=new VoiceQueue(_0x4b5183);}else{_0x2946d7[_0xf534('0x3d')](_0x2946d7['voiceQueues'][_0x4b5183[_0xf534('0x25')]],_0x4b5183);}}}return _0x2946d7[_0xf534('0x46')];};};Realtime[_0xf534('0x3e')][_0xf534('0x47')]=function(){var _0x76b993=this;return function(_0x13962c){if(_0x13962c){freeIsNotKey(_0x13962c,_0x76b993[_0xf534('0x15')],'id');for(var _0x328049=0x0,_0x24bfe6={},_0x43caa1={};_0x328049<_0x13962c[_0xf534('0x3f')];_0x328049+=0x1){_0x24bfe6=_0x13962c[_0x328049];if(_[_0xf534('0x40')](_0x76b993['triggers'][_0x24bfe6['id']])){_0x76b993[_0xf534('0x15')][_0x24bfe6['id']]=new Trigger(_0x24bfe6);}else{_0x76b993['mergeFromDatabase'](_0x76b993['triggers'][_0x24bfe6['id']],_0x24bfe6);}}}return _0x76b993[_0xf534('0x15')];};};Realtime['prototype']['initTemplates']=function(){var _0x5ec224=this;return function(_0x3b528c){if(_0x3b528c){freeIsNotKey(_0x3b528c,_0x5ec224[_0xf534('0x48')],'id');for(var _0x922c71=0x0,_0x4315c3={},_0x4e81d4={};_0x922c71<_0x3b528c['length'];_0x922c71+=0x1){_0x4315c3=_0x3b528c[_0x922c71];if(_[_0xf534('0x40')](_0x5ec224['templates'][_0x4315c3['id']])){_0x5ec224[_0xf534('0x48')][_0x4315c3['id']]=new Template(_0x4315c3);}else{_0x5ec224[_0xf534('0x3d')](_0x5ec224[_0xf534('0x48')][_0x4315c3['id']],_0x4315c3);}}}return _0x5ec224[_0xf534('0x48')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x2bfd3b=this;return function(_0x2f7e32){if(_0x2f7e32){freeIsNotKey(_0x2f7e32,_0x2bfd3b[_0xf534('0x19')],'id');for(var _0x3c6cda=0x0,_0x4451a8={},_0x490b3b={};_0x3c6cda<_0x2f7e32[_0xf534('0x3f')];_0x3c6cda+=0x1){_0x4451a8=_0x2f7e32[_0x3c6cda];if(_['isUndefined'](_0x2bfd3b[_0xf534('0x19')][_0x4451a8['id']])){_0x2bfd3b[_0xf534('0x19')][_0x4451a8['id']]=new ZendeskAccount(_0x4451a8);}else{_0x2bfd3b[_0xf534('0x3d')](_0x2bfd3b['zendeskAccounts'][_0x4451a8['id']],_0x4451a8);}}}return _0x2bfd3b['zendeskAccounts'];};};Realtime[_0xf534('0x3e')][_0xf534('0x49')]=function(){var _0x19a4a6=this;return function(_0x23005b){if(_0x23005b){freeIsNotKey(_0x23005b,_0x19a4a6[_0xf534('0x1a')],'id');for(var _0x54f171=0x0,_0x52a869={},_0x5290b9={};_0x54f171<_0x23005b['length'];_0x54f171+=0x1){_0x52a869=_0x23005b[_0x54f171];if(_['isUndefined'](_0x19a4a6[_0xf534('0x1a')][_0x52a869['id']])){_0x19a4a6[_0xf534('0x1a')][_0x52a869['id']]=new SalesforceAccount(_0x52a869);}else{_0x19a4a6[_0xf534('0x3d')](_0x19a4a6[_0xf534('0x1a')][_0x52a869['id']],_0x52a869);}}}return _0x19a4a6[_0xf534('0x1a')];};};Realtime[_0xf534('0x3e')][_0xf534('0x4a')]=function(){var _0x41b8dc=this;return function(_0x134e4e){if(_0x134e4e){freeIsNotKey(_0x134e4e,_0x41b8dc[_0xf534('0x1c')],'id');for(var _0x130511=0x0,_0x43c184={},_0x48cbf3={};_0x130511<_0x134e4e[_0xf534('0x3f')];_0x130511+=0x1){_0x43c184=_0x134e4e[_0x130511];if(_['isUndefined'](_0x41b8dc['freshdeskAccounts'][_0x43c184['id']])){_0x41b8dc[_0xf534('0x1c')][_0x43c184['id']]=new FreshdeskAccount(_0x43c184);}else{_0x41b8dc['mergeFromDatabase'](_0x41b8dc['freshdeskAccounts'][_0x43c184['id']],_0x43c184);}}}return _0x41b8dc[_0xf534('0x1c')];};};Realtime[_0xf534('0x3e')][_0xf534('0x4b')]=function(){var _0x3f8d9e=this;return function(_0x8fd14c){if(_0x8fd14c){freeIsNotKey(_0x8fd14c,_0x3f8d9e[_0xf534('0x4c')],'id');for(var _0x49ca39=0x0,_0x1c26a1={},_0x2149c5={};_0x49ca39<_0x8fd14c[_0xf534('0x3f')];_0x49ca39+=0x1){_0x1c26a1=_0x8fd14c[_0x49ca39];if(_[_0xf534('0x40')](_0x3f8d9e[_0xf534('0x4c')][_0x1c26a1['id']])){_0x3f8d9e['zohoAccounts'][_0x1c26a1['id']]=new ZohoAccount(_0x1c26a1);}else{_0x3f8d9e['mergeFromDatabase'](_0x3f8d9e[_0xf534('0x4c')][_0x1c26a1['id']],_0x1c26a1);}}}return _0x3f8d9e['zohoAccounts'];};};Realtime[_0xf534('0x3e')][_0xf534('0x4d')]=function(){var _0x2f343d=this;return function(_0x21e2cb){if(_0x21e2cb){freeIsNotKey(_0x21e2cb,_0x2f343d['deskAccounts'],'id');for(var _0x18bde2=0x0,_0x36d4f5={},_0x1797fa={};_0x18bde2<_0x21e2cb[_0xf534('0x3f')];_0x18bde2+=0x1){_0x36d4f5=_0x21e2cb[_0x18bde2];if(_[_0xf534('0x40')](_0x2f343d['deskAccounts'][_0x36d4f5['id']])){_0x2f343d[_0xf534('0x1d')][_0x36d4f5['id']]=new DeskAccount(_0x36d4f5);}else{_0x2f343d[_0xf534('0x3d')](_0x2f343d[_0xf534('0x1d')][_0x36d4f5['id']],_0x36d4f5);}}}return _0x2f343d[_0xf534('0x1d')];};};Realtime[_0xf534('0x3e')]['initSugarcrmAccounts']=function(){var _0x538bb5=this;return function(_0x5a3393){if(_0x5a3393){freeIsNotKey(_0x5a3393,_0x538bb5['sugarcrmAccounts'],'id');for(var _0x15aa1d=0x0,_0x47dfcf={},_0x1cea6d={};_0x15aa1d<_0x5a3393[_0xf534('0x3f')];_0x15aa1d+=0x1){_0x47dfcf=_0x5a3393[_0x15aa1d];if(_[_0xf534('0x40')](_0x538bb5[_0xf534('0x1b')][_0x47dfcf['id']])){_0x538bb5[_0xf534('0x1b')][_0x47dfcf['id']]=new SugarcrmAccount(_0x47dfcf);}else{_0x538bb5[_0xf534('0x3d')](_0x538bb5[_0xf534('0x1b')][_0x47dfcf['id']],_0x47dfcf);}}}return _0x538bb5['sugarcrmAccounts'];};};Realtime[_0xf534('0x3e')]['initVtigerAccounts']=function(){var _0x170dad=this;return function(_0x5db67d){if(_0x5db67d){freeIsNotKey(_0x5db67d,_0x170dad['vtigerAccounts'],'id');for(var _0x2e0eaf=0x0,_0x5634e3={},_0x568ec6={};_0x2e0eaf<_0x5db67d[_0xf534('0x3f')];_0x2e0eaf+=0x1){_0x5634e3=_0x5db67d[_0x2e0eaf];if(_['isUndefined'](_0x170dad[_0xf534('0x4e')][_0x5634e3['id']])){_0x170dad[_0xf534('0x4e')][_0x5634e3['id']]=new VtigerAccount(_0x5634e3);}else{_0x170dad[_0xf534('0x3d')](_0x170dad[_0xf534('0x4e')][_0x5634e3['id']],_0x5634e3);}}}return _0x170dad[_0xf534('0x4e')];};};Realtime[_0xf534('0x3e')][_0xf534('0x4f')]=function(){var _0x30ae7e=this;return function(_0x28932f){if(_0x28932f){freeIsNotKey(_0x28932f,_0x30ae7e[_0xf534('0x50')],'id');for(var _0x41c948=0x0,_0x4ecb9f={},_0x2eebbf={};_0x41c948<_0x28932f['length'];_0x41c948+=0x1){_0x4ecb9f=_0x28932f[_0x41c948];if(_[_0xf534('0x40')](_0x30ae7e[_0xf534('0x50')][_0x4ecb9f['id']])){_0x30ae7e[_0xf534('0x50')][_0x4ecb9f['id']]=new ServicenowAccount(_0x4ecb9f);}else{_0x30ae7e[_0xf534('0x3d')](_0x30ae7e[_0xf534('0x50')][_0x4ecb9f['id']],_0x4ecb9f);}}}return _0x30ae7e[_0xf534('0x50')];};};Realtime[_0xf534('0x3e')][_0xf534('0x51')]=function(){var _0x3f0851=this;return function(_0x11c584){if(_0x11c584){freeIsNotKey(_0x11c584,_0x3f0851[_0xf534('0x1e')],'id');for(var _0x3547fd=0x0,_0x2e77ab={},_0x593122={};_0x3547fd<_0x11c584[_0xf534('0x3f')];_0x3547fd+=0x1){_0x2e77ab=_0x11c584[_0x3547fd];if(_['isUndefined'](_0x3f0851[_0xf534('0x1e')][_0x2e77ab['id']])){_0x3f0851[_0xf534('0x1e')][_0x2e77ab['id']]=new Dynamics365Account(_0x2e77ab);}else{_0x3f0851[_0xf534('0x3d')](_0x3f0851['dynamics365Accounts'][_0x2e77ab['id']],_0x2e77ab);}}}return _0x3f0851['dynamics365Accounts'];};};Realtime[_0xf534('0x3e')][_0xf534('0x52')]=function(){var _0x39561b=this;return function(_0x434411){for(var _0x9f8e09=0x0;_0x9f8e09<_0x434411[_0xf534('0x3f')];_0x9f8e09+=0x1){_['merge'](_0x39561b[_0xf534('0x46')][_0x434411[_0x9f8e09][_0xf534('0x25')]],_0x434411[_0x9f8e09]);}return _0x39561b[_0xf534('0x46')];};};Realtime['prototype'][_0xf534('0x53')]=function(){var _0x3e6ca9=this;return function(_0x1a76e8){clearVoiceQueues(_0x3e6ca9[_0xf534('0x46')]);if(_0x1a76e8){_0x1a76e8=_['groupBy'](_0x1a76e8,'uniqueid');for(var _0x38bf53 in _0x1a76e8){if(_0x1a76e8[_0xf534('0x1f')](_0x38bf53)){var _0x2902e9={};for(var _0x477b98=0x0;_0x477b98<_0x1a76e8[_0x38bf53][_0xf534('0x3f')];_0x477b98+=0x1){var _0x8554c1=_0x1a76e8[_0x38bf53][_0x477b98][_0xf534('0x54')];if(_0x3e6ca9[_0xf534('0x46')][_0x8554c1]){if(_0x1a76e8[_0x38bf53][_0x477b98]['queuecallerexit']){_0x3e6ca9['voiceQueues'][_0x8554c1][_0xf534('0x2d')]+=0x1;}if(_0x1a76e8[_0x38bf53][_0x477b98]['queuecallerabandon']){_0x3e6ca9['voiceQueues'][_0x8554c1][_0xf534('0x2e')]+=0x1;}_0x3e6ca9[_0xf534('0x46')][_0x8554c1][_0xf534('0x2f')]+=moment(_0x1a76e8[_0x38bf53][_0x477b98][_0xf534('0x55')])[_0xf534('0x56')](moment(_0x1a76e8[_0x38bf53][_0x477b98]['queuecallerjoinAt']),_0xf534('0x57'))||0x0;if(_0x477b98===_0x1a76e8[_0x38bf53][_0xf534('0x3f')]-0x1){_0x3e6ca9[_0xf534('0x46')][_0x8554c1][_0xf534('0x28')]+=moment(_0x1a76e8[_0x38bf53][_0x477b98][_0xf534('0x58')]||_0x1a76e8[_0x38bf53][_0x477b98][_0xf534('0x59')]||_0x1a76e8[_0x38bf53][_0x477b98]['queuecallerexitAt'])[_0xf534('0x56')](moment(_0x1a76e8[_0x38bf53][_0x477b98][_0xf534('0x5a')]),_0xf534('0x57'))||0x0;_0x3e6ca9[_0xf534('0x46')][_0x8554c1][_0xf534('0x26')]+=0x1;if(_0x1a76e8[_0x38bf53][_0x477b98][_0xf534('0x5b')]){_0x3e6ca9['voiceQueues'][_0x8554c1][_0xf534('0x27')]+=0x1;_0x3e6ca9[_0xf534('0x46')][_0x8554c1]['sumBillable']+=moment(_0x1a76e8[_0x38bf53][_0x477b98]['queuecallercompleteAt'])[_0xf534('0x56')](moment(_0x1a76e8[_0x38bf53][_0x477b98][_0xf534('0x55')]),_0xf534('0x57'))||0x0;}}else{_0x3e6ca9[_0xf534('0x46')][_0x8554c1]['sumDuration']+=_0x3e6ca9['voiceQueues'][_0x8554c1][_0xf534('0x2f')]||0x0;}}}}}}return _0x3e6ca9[_0xf534('0x46')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x3e72f0=this;return function(_0x34dd3b){clearVoiceCallReports(_0x3e72f0[_0xf534('0x17')]);if(_0x34dd3b){for(var _0xba36d5=0x0;_0xba36d5<_0x34dd3b['length'];_0xba36d5+=0x1){_0x3e72f0['outbound'][_0xf534('0x26')]+=0x1;_0x3e72f0[_0xf534('0x17')][_0xf534('0x28')]+=_0x34dd3b[_0xba36d5][_0xf534('0x5c')];if(_0x34dd3b[_0xba36d5][_0xf534('0x5d')]===_0xf534('0x5e')){_0x3e72f0[_0xf534('0x17')][_0xf534('0x27')]+=0x1;_0x3e72f0[_0xf534('0x17')][_0xf534('0x2f')]+=_0x34dd3b[_0xba36d5][_0xf534('0x5c')]-_0x34dd3b[_0xba36d5][_0xf534('0x5f')]||0x0;_0x3e72f0[_0xf534('0x17')][_0xf534('0x29')]+=_0x34dd3b[_0xba36d5][_0xf534('0x5f')];}}}return _0x3e72f0['outbound'];};};Realtime['prototype'][_0xf534('0x60')]=function(){var _0x23de31=this;return function(_0x4a8bd9){if(_0x4a8bd9){freeIsNotKey(_0x4a8bd9,_0x23de31[_0xf534('0x16')],_0xf534('0x25'));for(var _0x1327ea=0x0,_0x2e47e2={};_0x1327ea<_0x4a8bd9[_0xf534('0x3f')];_0x1327ea+=0x1){_0x2e47e2=_0x4a8bd9[_0x1327ea];if(_[_0xf534('0x40')](_0x23de31['campaigns'][_0x2e47e2[_0xf534('0x25')]])){_0x23de31[_0xf534('0x16')][_0x2e47e2[_0xf534('0x25')]]=new Campaign(_0x2e47e2);}else{_0x23de31[_0xf534('0x3d')](_0x23de31[_0xf534('0x16')][_0x2e47e2['name']],_0x2e47e2);}}}return _0x23de31[_0xf534('0x16')];};};Realtime[_0xf534('0x3e')][_0xf534('0x61')]=function(){var _0x1c648b=this;return function(_0x2eca58){if(_0x2eca58){freeIsNotKey(_0x2eca58,_0x1c648b[_0xf534('0x62')],'id');for(var _0x59daeb=0x0,_0x56b80a={};_0x59daeb<_0x2eca58[_0xf534('0x3f')];_0x59daeb+=0x1){_0x56b80a=_0x2eca58[_0x59daeb];if(_['isUndefined'](_0x1c648b['voiceExtensions'][_0x56b80a['id']])){_0x1c648b[_0xf534('0x62')][_0x56b80a['id']]=new VoiceExtension(_0x56b80a);}else{_0x1c648b[_0xf534('0x3d')](_0x1c648b['voiceExtensions'][_0x56b80a['id']],_0x56b80a);}}}return _0x1c648b[_0xf534('0x62')];};};Realtime[_0xf534('0x3e')][_0xf534('0x63')]=function(){var _0x343341=this;return function(_0x5191ae){clearCampaigns(_0x343341[_0xf534('0x16')]);for(var _0x52aafc=0x0;_0x52aafc<_0x5191ae[_0xf534('0x3f')];_0x52aafc+=0x1){_['merge'](_0x343341[_0xf534('0x16')][_0x5191ae[_0x52aafc][_0xf534('0x25')]],_0x5191ae[_0x52aafc]);}return _0x343341[_0xf534('0x16')];};};Realtime[_0xf534('0x3e')][_0xf534('0x64')]=function(){var _0x1f0fda=this;return function(_0x553459){if(_0x553459){freeIsNotKey(_0x553459,_0x1f0fda[_0xf534('0x65')],'id');for(var _0xfb38d5=0x0,_0x8257ed={},_0x5e18b6={};_0xfb38d5<_0x553459[_0xf534('0x3f')];_0xfb38d5+=0x1){_0x8257ed=_0x553459[_0xfb38d5];if(_[_0xf534('0x40')](_0x1f0fda[_0xf534('0x65')][_0x8257ed['id']])){_0x1f0fda[_0xf534('0x65')][_0x8257ed['id']]=new FaxAccount(_0x8257ed);}else{_0x1f0fda[_0xf534('0x3d')](_0x1f0fda['faxAccounts'][_0x8257ed['id']],_0x8257ed);}}}return _0x1f0fda[_0xf534('0x65')];};};module[_0xf534('0x66')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index fe1ee78..d92d04b 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 _0x2d9e=['type','dialer','lastapplication','queue','lastdata','from-voip-provider','context','xcally-motion-preview','originatecalleridnum','destinationchannel','channel','calleridpreview','calleridnum','disposition','ANSWERED','callerid','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','exten','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','substring','indexOf','mobile','lastIndexOf','blindTransfer','bluebird','lodash','moment','util','../../../config/environment','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','bind','blindtransfer','attendedTransfer','find','accountcode','name','isNil','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x2d9e,0xca));var _0xe2d9=function(_0x498f2a,_0x1e7ab3){_0x498f2a=_0x498f2a-0x0;var _0xfab8a5=_0x2d9e[_0x498f2a];return _0xfab8a5;};'use strict';var BPromise=require(_0xe2d9('0x0'));var _=require(_0xe2d9('0x1'));var moment=require(_0xe2d9('0x2'));var util=require(_0xe2d9('0x3'));var config=require(_0xe2d9('0x4'));var logger=require('../../../config/logger')(_0xe2d9('0x5'));var ami=require(_0xe2d9('0x6'));var RpcVoiceAgentReport=require(_0xe2d9('0x7'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xe2d9('0x8'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xe2d9('0x9'));var RpcVoiceRecording=require(_0xe2d9('0xa'));var RpcVoiceTransferReport=require(_0xe2d9('0xb'));var VoiceQueueReport=require(_0xe2d9('0xc'));var VoiceCallReport=require(_0xe2d9('0xd'));var VoiceAgentReport=require(_0xe2d9('0xe'));var VoiceDialReport=require(_0xe2d9('0xf'));var UserReport=require(_0xe2d9('0x10'));function Report(_0x3cc26a){this[_0xe2d9('0x11')]=_0x3cc26a;this[_0xe2d9('0x12')]=_0x3cc26a[_0xe2d9('0x12')];this[_0xe2d9('0x13')]=_0x3cc26a[_0xe2d9('0x13')];}Report[_0xe2d9('0x14')][_0xe2d9('0x15')]=function(_0x4de050){var _0x15d838=new VoiceQueueReport(this[_0xe2d9('0x11')]);var _0x39c5c1=new VoiceAgentReport(this[_0xe2d9('0x11')]);var _0x5a5d1a=new VoiceDialReport(this[_0xe2d9('0x11')]);var _0x47bd5a=new VoiceCallReport(this[_0xe2d9('0x11')]);var _0x52732c=new UserReport(this['realtime']);if(config[_0xe2d9('0x16')]&&config[_0xe2d9('0x16')][_0xe2d9('0x17')]){ami['on'](_0xe2d9('0x18'),this['voiceQueueReport']['bind'](this));ami['on'](_0xe2d9('0x19'),this[_0xe2d9('0x1a')]['bind'](this));ami['on'](_0xe2d9('0x1b'),this[_0xe2d9('0x1c')][_0xe2d9('0x1d')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0xe2d9('0x1d')](this));ami['on'](_0xe2d9('0x1e'),this['blindTransfer']['bind'](this));ami['on']('attendedtransfer',this[_0xe2d9('0x1f')][_0xe2d9('0x1d')](this));}};Report['prototype']['findAgent']=function(_0x3f92f1){var _0xb4650c=undefined;_0xb4650c=_[_0xe2d9('0x20')](this[_0xe2d9('0x12')],function(_0xc2b7c5){return _0xc2b7c5[_0xe2d9('0x21')]==_0x3f92f1||_0xc2b7c5[_0xe2d9('0x22')]==_0x3f92f1;});if(_[_0xe2d9('0x23')](_0xb4650c)){var _0x316129=_[_0xe2d9('0x20')](this[_0xe2d9('0x13')],function(_0x1c2eaa){return _0x1c2eaa[_0xe2d9('0x21')]==_0x3f92f1||_0x1c2eaa[_0xe2d9('0x22')]==_0x3f92f1;});if(_0x316129){_0xb4650c=_['find'](this['agents'],function(_0x31eb49){return _0x31eb49['interface']==util['format']('SIP/%s',_0x316129['name']);});}}return _0xb4650c;};Report[_0xe2d9('0x14')]['voiceQueueReport']=function(_0x44787b){for(var _0x4b59c7=0x0;_0x4b59c7<_0x44787b['length'];_0x4b59c7+=0x1){var _0x10e72a=this[_0xe2d9('0x24')](_0x44787b[_0x4b59c7][_0xe2d9('0x25')]);if(_0x10e72a){_0x44787b[_0x4b59c7][_0xe2d9('0x21')]=_0x10e72a[_0xe2d9('0x21')];_0x44787b[_0x4b59c7][_0xe2d9('0x26')]=!![];_0x44787b[_0x4b59c7][_0xe2d9('0x27')]=_0x10e72a[_0xe2d9('0x22')];_0x44787b[_0x4b59c7][_0xe2d9('0x28')]=_[_0xe2d9('0x23')](_0x10e72a[_0xe2d9('0x28')])?util[_0xe2d9('0x29')](_0xe2d9('0x2a'),_0x10e72a['name']):_0x10e72a[_0xe2d9('0x28')];if(_0x44787b[_0x4b59c7][_0xe2d9('0x2b')]){_0x44787b[_0x4b59c7][_0xe2d9('0x2c')]=moment()[_0xe2d9('0x29')](_0xe2d9('0x2d'));}if(_0x44787b[_0x4b59c7][_0xe2d9('0x2e')]){_0x44787b[_0x4b59c7][_0xe2d9('0x2f')]=moment()['format'](_0xe2d9('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x44787b[_0x4b59c7]);}RpcVoiceQueueReport[_0xe2d9('0x30')](_0x44787b[_0x4b59c7]);}};function extractCalleridNumber(_0x5610da){var _0x35e0a7=_0x5610da['match'](/<(.*?)>/);return _0x35e0a7?_0x35e0a7[0x1]:_0x5610da;}Report[_0xe2d9('0x14')][_0xe2d9('0x1a')]=function(_0xc95122){_0xc95122[_0xe2d9('0x31')]=_0xc95122['destination']||_0xc95122['exten'];if(_0xc95122[_0xe2d9('0x32')]==_0xe2d9('0x33')){_0xc95122[_0xe2d9('0x34')]=_0xe2d9('0x35');_0xc95122[_0xe2d9('0x36')]=_0xc95122[_0xe2d9('0x35')];if(_0xc95122['context']==_0xe2d9('0x37')){_0xc95122[_0xe2d9('0x21')]='';_0xc95122['destination']=extractCalleridNumber(_0xc95122['callerid']);}else if(_0xc95122[_0xe2d9('0x38')]=='from-sip'){if(_0xc95122[_0xe2d9('0x31')]==_0xe2d9('0x39')){_0xc95122[_0xe2d9('0x31')]=extractCalleridNumber(_0xc95122['calleridpreview']);_0xc95122['calleridnum']=_0xc95122[_0xe2d9('0x3a')];_0xc95122[_0xe2d9('0x3b')]=[_0xc95122[_0xe2d9('0x3c')],_0xc95122['channel']=_0xc95122[_0xe2d9('0x3b')]][0x0];_0xc95122['callerid']=_0xc95122[_0xe2d9('0x3d')];}else{_0xc95122[_0xe2d9('0x31')]=_0xc95122[_0xe2d9('0x3e')];_0xc95122[_0xe2d9('0x3e')]=_0xc95122[_0xe2d9('0x3a')];if(_0xc95122[_0xe2d9('0x3f')]==_0xe2d9('0x40')){_0xc95122[_0xe2d9('0x21')]=_0xc95122[_0xe2d9('0x25')];}else{_0xc95122[_0xe2d9('0x21')]='';}}}}else{_0xc95122[_0xe2d9('0x41')]=util[_0xe2d9('0x29')]('\x22%s\x22\x20<%s>',_0xc95122['calleridname'],_0xc95122[_0xe2d9('0x3e')]);}RpcVoiceCallReport[_0xe2d9('0x30')](_0xc95122);if(_0xc95122['monitor']){for(var _0x5158df=0x0;_0x5158df<_0xc95122[_0xe2d9('0x42')]['length'];_0x5158df+=0x1){_0xc95122[_0xe2d9('0x43')]=_0xc95122['monitors'][_0x5158df][_0xe2d9('0x44')];_0xc95122[_0xe2d9('0x45')]=_0xc95122['monitors'][_0x5158df][_0xe2d9('0x45')];if(_0xc95122['exten']==_0xe2d9('0x39')){_0xc95122[_0xe2d9('0x3e')]=_0xc95122[_0xe2d9('0x25')];_0xc95122[_0xe2d9('0x46')]=_0xc95122[_0xe2d9('0x47')];_0xc95122[_0xe2d9('0x25')]=_0xc95122['accountcode'];_0xc95122['connectedlinename']=_0xc95122[_0xe2d9('0x48')];_0xc95122[_0xe2d9('0x49')]=_0xc95122[_0xe2d9('0x3a')];}else if(_0xc95122['exten']==_0xe2d9('0x4a')){_0xc95122[_0xe2d9('0x3e')]=_0xc95122['destination'];_0xc95122[_0xe2d9('0x49')]=_0xc95122[_0xe2d9('0x3a')];}RpcVoiceRecording[_0xe2d9('0x30')](_0xc95122);}}};Report[_0xe2d9('0x14')][_0xe2d9('0x1c')]=function(_0x268a11){if(_[_0xe2d9('0x4b')](_0x268a11)){_0x268a11[_0xe2d9('0x4c')](function(_0x4030b6){RpcVoiceAgentReport[_0xe2d9('0x30')](_0x4030b6);});}else{RpcVoiceAgentReport[_0xe2d9('0x30')](_0x268a11);}};Report[_0xe2d9('0x14')][_0xe2d9('0x4d')]=function(_0x16db52){RpcVoiceDialReport[_0xe2d9('0x30')](_0x16db52);var _0x3eb00f=undefined;var _0x238642=_0x16db52['channel'];if(_[_0xe2d9('0x4e')](_0x238642,'Local')){var _0x573388=_0x238642[_0xe2d9('0x4f')](_0x238642['indexOf']('/')+0x1,_0x238642[_0xe2d9('0x50')]('@'));_0x3eb00f=_[_0xe2d9('0x20')](this['agents'],function(_0x2b6668){return _0x2b6668[_0xe2d9('0x51')]==_0x573388||_0x2b6668['phone']==_0x573388||_0x2b6668[_0xe2d9('0x21')]==_0x573388;});}else{var _0x573388=_0x238642[_0xe2d9('0x4f')](_0x238642['indexOf']('/')+0x1,_0x238642[_0xe2d9('0x52')]('-'));_0x3eb00f=this[_0xe2d9('0x24')](_0x573388);}if(_0x3eb00f){_0x16db52[_0xe2d9('0x28')]=_[_0xe2d9('0x23')](_0x3eb00f[_0xe2d9('0x28')])?util['format'](_0xe2d9('0x2a'),_0x3eb00f[_0xe2d9('0x22')]):_0x3eb00f[_0xe2d9('0x28')];_0x16db52[_0xe2d9('0x48')]=_0x3eb00f[_0xe2d9('0x22')];_0x16db52[_0xe2d9('0x21')]=_0x3eb00f[_0xe2d9('0x21')];RpcMemberReport[_0xe2d9('0x4d')](_0x16db52);}};Report[_0xe2d9('0x14')][_0xe2d9('0x53')]=function(_0x2ce8e9){RpcVoiceTransferReport[_0xe2d9('0x53')](_0x2ce8e9);};Report['prototype'][_0xe2d9('0x1f')]=function(_0xd3ab8a){RpcVoiceTransferReport[_0xe2d9('0x1f')](_0xd3ab8a);};module['exports']=Report; \ No newline at end of file +var _0xbbd6=['channel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','indexOf','mobile','membername','blindTransfer','exports','bluebird','moment','util','../../../config/environment','../../../config/logger','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','bind','custom:voiceAgentReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceQueueReport','create','match','voiceCallReport','destination','exten','type','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel'];(function(_0x24b852,_0x2bad67){var _0x180ad2=function(_0x454562){while(--_0x454562){_0x24b852['push'](_0x24b852['shift']());}};_0x180ad2(++_0x2bad67);}(_0xbbd6,0x1f2));var _0x6bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd6[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x6bbd('0x0'));var _=require('lodash');var moment=require(_0x6bbd('0x1'));var util=require(_0x6bbd('0x2'));var config=require(_0x6bbd('0x3'));var logger=require(_0x6bbd('0x4'))('ami');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x6bbd('0x5'));var RpcVoiceCallReport=require(_0x6bbd('0x6'));var RpcVoiceDialReport=require(_0x6bbd('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x6bbd('0x8'));var RpcVoiceRecording=require(_0x6bbd('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x6bbd('0xa'));var VoiceCallReport=require(_0x6bbd('0xb'));var VoiceAgentReport=require(_0x6bbd('0xc'));var VoiceDialReport=require(_0x6bbd('0xd'));var UserReport=require('./userReport');function Report(_0x202c0e){this[_0x6bbd('0xe')]=_0x202c0e;this[_0x6bbd('0xf')]=_0x202c0e[_0x6bbd('0xf')];this['telephones']=_0x202c0e[_0x6bbd('0x10')];}Report[_0x6bbd('0x11')][_0x6bbd('0x12')]=function(_0x22d0de){var _0x4c00c0=new VoiceQueueReport(this[_0x6bbd('0xe')]);var _0x129a2a=new VoiceAgentReport(this[_0x6bbd('0xe')]);var _0x338d10=new VoiceDialReport(this[_0x6bbd('0xe')]);var _0x16e377=new VoiceCallReport(this[_0x6bbd('0xe')]);var _0x59c4fd=new UserReport(this[_0x6bbd('0xe')]);if(config[_0x6bbd('0x13')]&&config['xdr'][_0x6bbd('0x14')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x6bbd('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x6bbd('0x15')](this));ami['on'](_0x6bbd('0x16'),this['voiceAgentReport'][_0x6bbd('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x6bbd('0x17')][_0x6bbd('0x15')](this));ami['on'](_0x6bbd('0x18'),this['blindTransfer']['bind'](this));ami['on'](_0x6bbd('0x19'),this[_0x6bbd('0x1a')][_0x6bbd('0x15')](this));}};Report[_0x6bbd('0x11')][_0x6bbd('0x1b')]=function(_0x49d87b){var _0x53dc63=undefined;_0x53dc63=_[_0x6bbd('0x1c')](this[_0x6bbd('0xf')],function(_0x2427c3){return _0x2427c3[_0x6bbd('0x1d')]==_0x49d87b||_0x2427c3[_0x6bbd('0x1e')]==_0x49d87b;});if(_[_0x6bbd('0x1f')](_0x53dc63)){var _0x178a63=_['find'](this[_0x6bbd('0x10')],function(_0x17fa5e){return _0x17fa5e[_0x6bbd('0x1d')]==_0x49d87b||_0x17fa5e['name']==_0x49d87b;});if(_0x178a63){_0x53dc63=_[_0x6bbd('0x1c')](this['agents'],function(_0x3d099c){return _0x3d099c[_0x6bbd('0x20')]==util['format'](_0x6bbd('0x21'),_0x178a63['name']);});}}return _0x53dc63;};Report[_0x6bbd('0x11')]['voiceQueueReport']=function(_0x422fc4){for(var _0x2a1669=0x0;_0x2a1669<_0x422fc4[_0x6bbd('0x22')];_0x2a1669+=0x1){var _0x485d77=this[_0x6bbd('0x1b')](_0x422fc4[_0x2a1669][_0x6bbd('0x23')]);if(_0x485d77){_0x422fc4[_0x2a1669][_0x6bbd('0x1d')]=_0x485d77[_0x6bbd('0x1d')];_0x422fc4[_0x2a1669][_0x6bbd('0x24')]=!![];_0x422fc4[_0x2a1669][_0x6bbd('0x25')]=_0x485d77[_0x6bbd('0x1e')];_0x422fc4[_0x2a1669][_0x6bbd('0x20')]=_[_0x6bbd('0x1f')](_0x485d77[_0x6bbd('0x20')])?util[_0x6bbd('0x26')](_0x6bbd('0x21'),_0x485d77[_0x6bbd('0x1e')]):_0x485d77[_0x6bbd('0x20')];if(_0x422fc4[_0x2a1669][_0x6bbd('0x27')]){_0x422fc4[_0x2a1669][_0x6bbd('0x28')]=moment()[_0x6bbd('0x26')](_0x6bbd('0x29'));}if(_0x422fc4[_0x2a1669][_0x6bbd('0x2a')]){_0x422fc4[_0x2a1669][_0x6bbd('0x2b')]=moment()[_0x6bbd('0x26')](_0x6bbd('0x29'));}RpcMemberReport[_0x6bbd('0x2c')](_0x422fc4[_0x2a1669]);}RpcVoiceQueueReport[_0x6bbd('0x2d')](_0x422fc4[_0x2a1669]);}};function extractCalleridNumber(_0x3bcb80){var _0x1c1b55=_0x3bcb80[_0x6bbd('0x2e')](/<(.*?)>/);return _0x1c1b55?_0x1c1b55[0x1]:_0x3bcb80;}Report[_0x6bbd('0x11')][_0x6bbd('0x2f')]=function(_0x4fb32e){_0x4fb32e['destination']=_0x4fb32e[_0x6bbd('0x30')]||_0x4fb32e[_0x6bbd('0x31')];if(_0x4fb32e[_0x6bbd('0x32')]=='dialer'){_0x4fb32e[_0x6bbd('0x33')]=_0x6bbd('0x34');_0x4fb32e[_0x6bbd('0x35')]=_0x4fb32e[_0x6bbd('0x34')];if(_0x4fb32e['context']==_0x6bbd('0x36')){_0x4fb32e[_0x6bbd('0x1d')]='';_0x4fb32e[_0x6bbd('0x30')]=extractCalleridNumber(_0x4fb32e[_0x6bbd('0x37')]);}else if(_0x4fb32e[_0x6bbd('0x38')]==_0x6bbd('0x39')){if(_0x4fb32e[_0x6bbd('0x30')]=='xcally-motion-preview'){_0x4fb32e[_0x6bbd('0x30')]=extractCalleridNumber(_0x4fb32e[_0x6bbd('0x3a')]);_0x4fb32e[_0x6bbd('0x3b')]=_0x4fb32e[_0x6bbd('0x3c')];_0x4fb32e[_0x6bbd('0x3d')]=[_0x4fb32e[_0x6bbd('0x3e')],_0x4fb32e[_0x6bbd('0x3e')]=_0x4fb32e['destinationchannel']][0x0];_0x4fb32e[_0x6bbd('0x37')]=_0x4fb32e['calleridpreview'];}else{_0x4fb32e[_0x6bbd('0x30')]=_0x4fb32e[_0x6bbd('0x3b')];_0x4fb32e[_0x6bbd('0x3b')]=_0x4fb32e['originatecalleridnum'];if(_0x4fb32e['disposition']==_0x6bbd('0x3f')){_0x4fb32e[_0x6bbd('0x1d')]=_0x4fb32e['connectedlinenum'];}else{_0x4fb32e[_0x6bbd('0x1d')]='';}}}}else{_0x4fb32e['callerid']=util[_0x6bbd('0x26')](_0x6bbd('0x40'),_0x4fb32e[_0x6bbd('0x41')],_0x4fb32e[_0x6bbd('0x3b')]);}RpcVoiceCallReport[_0x6bbd('0x2d')](_0x4fb32e);if(_0x4fb32e['monitor']){for(var _0x372998=0x0;_0x372998<_0x4fb32e[_0x6bbd('0x42')]['length'];_0x372998+=0x1){_0x4fb32e[_0x6bbd('0x43')]=_0x4fb32e['monitors'][_0x372998][_0x6bbd('0x44')];_0x4fb32e[_0x6bbd('0x45')]=_0x4fb32e['monitors'][_0x372998]['createdAt'];if(_0x4fb32e[_0x6bbd('0x31')]==_0x6bbd('0x46')){_0x4fb32e['calleridnum']=_0x4fb32e[_0x6bbd('0x23')];_0x4fb32e['calleridname']=_0x4fb32e[_0x6bbd('0x47')];_0x4fb32e[_0x6bbd('0x23')]=_0x4fb32e[_0x6bbd('0x1d')];_0x4fb32e[_0x6bbd('0x47')]=_0x4fb32e['membername'];_0x4fb32e['exten']=_0x4fb32e[_0x6bbd('0x3c')];}else if(_0x4fb32e['exten']==_0x6bbd('0x48')){_0x4fb32e[_0x6bbd('0x3b')]=_0x4fb32e[_0x6bbd('0x30')];_0x4fb32e[_0x6bbd('0x31')]=_0x4fb32e[_0x6bbd('0x3c')];}RpcVoiceRecording[_0x6bbd('0x2d')](_0x4fb32e);}}};Report[_0x6bbd('0x11')][_0x6bbd('0x49')]=function(_0x3a91fc){if(_[_0x6bbd('0x4a')](_0x3a91fc)){_0x3a91fc['forEach'](function(_0x37bff6){RpcVoiceAgentReport[_0x6bbd('0x2d')](_0x37bff6);});}else{RpcVoiceAgentReport[_0x6bbd('0x2d')](_0x3a91fc);}};Report[_0x6bbd('0x11')]['voiceDialReport']=function(_0x378fc1){RpcVoiceDialReport[_0x6bbd('0x2d')](_0x378fc1);var _0x8e30f5=undefined;var _0x312e1b=_0x378fc1[_0x6bbd('0x3e')];if(_['startsWith'](_0x312e1b,'Local')){var _0x57213a=_0x312e1b['substring'](_0x312e1b[_0x6bbd('0x4b')]('/')+0x1,_0x312e1b[_0x6bbd('0x4b')]('@'));_0x8e30f5=_[_0x6bbd('0x1c')](this['agents'],function(_0x221345){return _0x221345[_0x6bbd('0x4c')]==_0x57213a||_0x221345['phone']==_0x57213a||_0x221345[_0x6bbd('0x1d')]==_0x57213a;});}else{var _0x57213a=_0x312e1b['substring'](_0x312e1b[_0x6bbd('0x4b')]('/')+0x1,_0x312e1b['lastIndexOf']('-'));_0x8e30f5=this[_0x6bbd('0x1b')](_0x57213a);}if(_0x8e30f5){_0x378fc1['interface']=_['isNil'](_0x8e30f5[_0x6bbd('0x20')])?util[_0x6bbd('0x26')](_0x6bbd('0x21'),_0x8e30f5[_0x6bbd('0x1e')]):_0x8e30f5['interface'];_0x378fc1[_0x6bbd('0x4d')]=_0x8e30f5[_0x6bbd('0x1e')];_0x378fc1[_0x6bbd('0x1d')]=_0x8e30f5['accountcode'];RpcMemberReport[_0x6bbd('0x17')](_0x378fc1);}};Report['prototype'][_0x6bbd('0x4e')]=function(_0x5bf763){RpcVoiceTransferReport[_0x6bbd('0x4e')](_0x5bf763);};Report[_0x6bbd('0x11')][_0x6bbd('0x1a')]=function(_0x2c5790){RpcVoiceTransferReport[_0x6bbd('0x1a')](_0x2c5790);};module[_0x6bbd('0x4f')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 737711f..a93ba0c 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 _0xa20c=['username','state','merge','omit','actionid','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','exports','lodash','bluebird','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','trunks','agents','telephones','syncRegistry','registry','devicestatechange','bind','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','error','inspect','prototype','loopSyncRealTimeShow','[loopSyncRealTimeShow]','isNotNull','isUndefined','emit'];(function(_0x10132d,_0xcfbdc9){var _0x20d7c9=function(_0x17a38f){while(--_0x17a38f){_0x10132d['push'](_0x10132d['shift']());}};_0x20d7c9(++_0xcfbdc9);}(_0xa20c,0x16c));var _0xca20=function(_0x3f157a,_0x5cb402){_0x3f157a=_0x3f157a-0x0;var _0x234267=_0xa20c[_0x3f157a];return _0x234267;};'use strict';var _=require(_0xca20('0x0'));var moment=require('moment');var BPromise=require(_0xca20('0x1'));var util=require('util');var Redis=require(_0xca20('0x2'));var config=require(_0xca20('0x3'));var logger=require(_0xca20('0x4'))(_0xca20('0x5'));var ami=require('../ami');config[_0xca20('0x6')]=_[_0xca20('0x7')](config[_0xca20('0x6')],{'host':_0xca20('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xca20('0x6')]));function UserReport(_0x45e5d5){this['trunks']=_0x45e5d5[_0xca20('0x9')];this['agents']=_0x45e5d5[_0xca20('0xa')];this[_0xca20('0xb')]=_0x45e5d5[_0xca20('0xb')];ami['on']('registryentry',this[_0xca20('0xc')]['bind'](this));ami['on'](_0xca20('0xd'),this[_0xca20('0xc')]['bind'](this));ami['on'](_0xca20('0xe'),this['syncDeviceState'][_0xca20('0xf')](this));ami['on'](_0xca20('0x10'),this[_0xca20('0x11')]['bind'](this));this['loopSyncRealTimeShow']();return BPromise[_0xca20('0x12')]()[_0xca20('0x13')](ami[_0xca20('0x14')]())[_0xca20('0x13')](ami[_0xca20('0x15')]())['then'](ami[_0xca20('0x16')]())[_0xca20('0x17')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x487072){return function(_0x9e5505){logger[_0xca20('0x18')](_0x487072,util[_0xca20('0x19')](_0x9e5505,{'showHidden':![],'depth':null}));};}UserReport[_0xca20('0x1a')][_0xca20('0x1b')]=function(){setInterval(function(){BPromise[_0xca20('0x12')]()[_0xca20('0x13')](ami[_0xca20('0x14')]())['then'](ami[_0xca20('0x15')]())['then'](ami[_0xca20('0x16')]())['catch'](loggerCatch(_0xca20('0x1c')));},0x32c8);};UserReport['prototype'][_0xca20('0x1d')]=function(_0x433f43){return _0x433f43!==null&&!_[_0xca20('0x1e')](_0x433f43);};UserReport[_0xca20('0x1a')]['emit']=function(_0x1e93f3,_0x2855eb,_0xf0a8bc){io['to'](_0x1e93f3)[_0xca20('0x1f')](_0x2855eb,_0xf0a8bc);};UserReport[_0xca20('0x1a')][_0xca20('0xc')]=function(_0x1e7971){try{if(this['isNotNull'](_0x1e7971)){var _0x4c3e0c=_['find'](this[_0xca20('0x9')],{'registry':_0x1e7971[_0xca20('0x20')]});if(_0x4c3e0c){_0x1e7971['stateRegistry']=_0x1e7971[_0xca20('0x21')];_[_0xca20('0x22')](_0x4c3e0c,_[_0xca20('0x23')](_0x1e7971,['event',_0xca20('0x24'),_0xca20('0x20'),_0xca20('0x21')]));this[_0xca20('0x1f')](util[_0xca20('0x25')](_0xca20('0x26'),_0x4c3e0c[_0xca20('0x27')]),_0xca20('0x28'),_0x4c3e0c);}}}catch(_0x16f652){logger[_0xca20('0x18')](_0xca20('0x29'),util[_0xca20('0x19')](_0x16f652,{'showHidden':![],'depth':null}));}};UserReport[_0xca20('0x1a')][_0xca20('0x2a')]=function(_0x266be6){try{if(this[_0xca20('0x1d')](_0x266be6)){if(this['agents'][_0x266be6[_0xca20('0x2b')]]){if(!this[_0xca20('0xa')][_0x266be6[_0xca20('0x2b')]]['local']||_0x266be6[_0xca20('0x21')][_0xca20('0x2c')]()==_0xca20('0x2d')){this[_0xca20('0xa')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x2e')]=![];if(this[_0xca20('0xa')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x21')]!==_0x266be6[_0xca20('0x21')][_0xca20('0x2c')]()){this[_0xca20('0xa')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x2f')]=_[_0xca20('0x30')](moment()[_0xca20('0x25')]('x'));}this[_0xca20('0xa')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x21')]=_0x266be6[_0xca20('0x21')][_0xca20('0x2c')]();this[_0xca20('0xa')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x31')](_0x266be6);}}else if(this[_0xca20('0xb')][_0x266be6[_0xca20('0x2b')]]){if(this[_0xca20('0xb')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x21')]!==_0x266be6['state']['toLowerCase']()){this['telephones'][_0x266be6[_0xca20('0x2b')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0xca20('0xb')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x21')]=_0x266be6['state'][_0xca20('0x2c')]();this[_0xca20('0x1f')](util['format'](_0xca20('0x32'),this['telephones'][_0x266be6['device']][_0xca20('0x27')]),_0xca20('0x33'),this[_0xca20('0xb')][_0x266be6[_0xca20('0x2b')]]);}else if(this[_0xca20('0x9')][_0x266be6['device']]){if(this[_0xca20('0x9')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x21')]!==_0x266be6[_0xca20('0x21')]['toLowerCase']()){this[_0xca20('0x9')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x2f')]=_[_0xca20('0x30')](moment()[_0xca20('0x25')]('x'));}this[_0xca20('0x9')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x21')]=_0x266be6[_0xca20('0x21')][_0xca20('0x2c')]();this[_0xca20('0x1f')](util[_0xca20('0x25')](_0xca20('0x26'),this[_0xca20('0x9')][_0x266be6[_0xca20('0x2b')]][_0xca20('0x27')]),'trunk:save',this[_0xca20('0x9')][_0x266be6['device']]);}else if(_[_0xca20('0x34')](_0x266be6[_0xca20('0x2b')],_0xca20('0x35'))){}else if(_[_0xca20('0x34')](_0x266be6[_0xca20('0x2b')],_0xca20('0x36'))){var _0xfa93dd=_0x266be6['device'];var _0x59b259=_0xfa93dd[_0xca20('0x37')](_0xfa93dd['indexOf']('/')+0x1,_0xfa93dd[_0xca20('0x38')]('@'));var _0x16e3d1=_['find'](this['agents'],function(_0x128594){return _0x128594[_0xca20('0x39')]==_0x59b259||_0x128594[_0xca20('0x3a')]==_0x59b259||_0x128594[_0xca20('0x3b')]==_0x59b259;});if(_0x16e3d1){if(_0x16e3d1[_0xca20('0x21')]!==_0x266be6[_0xca20('0x21')][_0xca20('0x2c')]()){_0x16e3d1[_0xca20('0x2f')]=_[_0xca20('0x30')](moment()[_0xca20('0x25')]('x'));}_0x16e3d1[_0xca20('0x21')]=_0x266be6['state'][_0xca20('0x2c')]();_0x16e3d1[_0xca20('0x2e')]=!![];_0x16e3d1[_0xca20('0x31')](_0x266be6);}}else{}}}catch(_0x341d35){logger[_0xca20('0x18')](_0xca20('0x3c'),util[_0xca20('0x19')](_0x341d35,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xca20('0x11')]=function(_0x31dc2d){try{if(this[_0xca20('0x1d')](_0x31dc2d)&&this[_0xca20('0x1d')](_0x31dc2d[_0xca20('0x10')])){if(this['agents'][_0x31dc2d[_0xca20('0x3d')]]){if(!this['agents'][_0x31dc2d[_0xca20('0x3d')]][_0xca20('0x2e')]||_0x31dc2d[_0xca20('0x10')][_0xca20('0x2c')]()==_0xca20('0x3e')){this[_0xca20('0xa')][_0x31dc2d[_0xca20('0x3d')]][_0xca20('0x2e')]=![];this[_0xca20('0xa')][_0x31dc2d[_0xca20('0x3d')]][_0xca20('0x3f')]=_0x31dc2d[_0xca20('0x10')][_0xca20('0x2c')]();this[_0xca20('0xa')][_0x31dc2d['peer']][_0xca20('0x40')]=_0x31dc2d['address'];this[_0xca20('0xa')][_0x31dc2d[_0xca20('0x3d')]][_0xca20('0x31')](_0x31dc2d);}}else if(this['telephones'][_0x31dc2d[_0xca20('0x3d')]]){this[_0xca20('0xb')][_0x31dc2d[_0xca20('0x3d')]][_0xca20('0x3f')]=_0x31dc2d[_0xca20('0x10')][_0xca20('0x2c')]();this[_0xca20('0xb')][_0x31dc2d[_0xca20('0x3d')]]['address']=_0x31dc2d['address'];this[_0xca20('0x1f')](util[_0xca20('0x25')]('telephone:%s',this['telephones'][_0x31dc2d['peer']]['name']),'telephone:save',this['telephones'][_0x31dc2d[_0xca20('0x3d')]]);}else if(this[_0xca20('0x9')][_0x31dc2d[_0xca20('0x3d')]]){this[_0xca20('0x9')][_0x31dc2d[_0xca20('0x3d')]]['status']=_0x31dc2d['peerstatus'][_0xca20('0x2c')]();this[_0xca20('0x9')][_0x31dc2d[_0xca20('0x3d')]]['address']=_0x31dc2d[_0xca20('0x40')];this[_0xca20('0x1f')](util[_0xca20('0x25')](_0xca20('0x26'),this[_0xca20('0x9')][_0x31dc2d['peer']][_0xca20('0x27')]),_0xca20('0x28'),this['trunks'][_0x31dc2d[_0xca20('0x3d')]]);}else{}}}catch(_0x279faf){logger['error']('[syncPeerStatus][UserReport]',util[_0xca20('0x19')](_0x279faf,{'showHidden':![],'depth':null}));}};module[_0xca20('0x41')]=UserReport; \ No newline at end of file +var _0xfc88=['isNotNull','find','username','stateRegistry','state','omit','event','actionid','trunk:%s','name','error','[syncRegistry][UserReport]','device','local','inuse','toLowerCase','format','stateTime','telephone:%s','telephone:save','trunk:save','startsWith','Local','substring','indexOf','mobile','accountcode','toNumber','updateStatusRealtime','[syncDeviceState][UserReport]','peer','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus','inspect','prototype','resolve','emit'];(function(_0x1c2a94,_0xbebf4d){var _0x2699c=function(_0x36fb14){while(--_0x36fb14){_0x1c2a94['push'](_0x1c2a94['shift']());}};_0x2699c(++_0xbebf4d);}(_0xfc88,0x1ae));var _0x8fc8=function(_0x4e1b54,_0x55659f){_0x4e1b54=_0x4e1b54-0x0;var _0x46ee67=_0xfc88[_0x4e1b54];return _0x46ee67;};'use strict';var _=require(_0x8fc8('0x0'));var moment=require(_0x8fc8('0x1'));var BPromise=require(_0x8fc8('0x2'));var util=require(_0x8fc8('0x3'));var Redis=require(_0x8fc8('0x4'));var config=require(_0x8fc8('0x5'));var logger=require(_0x8fc8('0x6'))(_0x8fc8('0x7'));var ami=require(_0x8fc8('0x8'));config['redis']=_[_0x8fc8('0x9')](config[_0x8fc8('0xa')],{'host':_0x8fc8('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8fc8('0xa')]));function UserReport(_0x5a9817){this[_0x8fc8('0xc')]=_0x5a9817[_0x8fc8('0xc')];this[_0x8fc8('0xd')]=_0x5a9817[_0x8fc8('0xd')];this[_0x8fc8('0xe')]=_0x5a9817[_0x8fc8('0xe')];ami['on'](_0x8fc8('0xf'),this[_0x8fc8('0x10')]['bind'](this));ami['on'](_0x8fc8('0x11'),this[_0x8fc8('0x10')][_0x8fc8('0x12')](this));ami['on'](_0x8fc8('0x13'),this[_0x8fc8('0x14')][_0x8fc8('0x12')](this));ami['on'](_0x8fc8('0x15'),this[_0x8fc8('0x16')][_0x8fc8('0x12')](this));this[_0x8fc8('0x17')]();return BPromise['resolve']()['then'](ami[_0x8fc8('0x18')]())[_0x8fc8('0x19')](ami[_0x8fc8('0x1a')]())[_0x8fc8('0x19')](ami[_0x8fc8('0x1b')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x128872){return function(_0x446097){logger['error'](_0x128872,util[_0x8fc8('0x1c')](_0x446097,{'showHidden':![],'depth':null}));};}UserReport[_0x8fc8('0x1d')][_0x8fc8('0x17')]=function(){setInterval(function(){BPromise[_0x8fc8('0x1e')]()[_0x8fc8('0x19')](ami[_0x8fc8('0x18')]())[_0x8fc8('0x19')](ami[_0x8fc8('0x1a')]())[_0x8fc8('0x19')](ami[_0x8fc8('0x1b')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0x8fc8('0x1d')]['isNotNull']=function(_0x2cc757){return _0x2cc757!==null&&!_['isUndefined'](_0x2cc757);};UserReport[_0x8fc8('0x1d')]['emit']=function(_0x43e6e3,_0x40b2ba,_0xfd6f95){io['to'](_0x43e6e3)[_0x8fc8('0x1f')](_0x40b2ba,_0xfd6f95);};UserReport['prototype'][_0x8fc8('0x10')]=function(_0x545e54){try{if(this[_0x8fc8('0x20')](_0x545e54)){var _0x592a3f=_[_0x8fc8('0x21')](this[_0x8fc8('0xc')],{'registry':_0x545e54[_0x8fc8('0x22')]});if(_0x592a3f){_0x545e54[_0x8fc8('0x23')]=_0x545e54[_0x8fc8('0x24')];_['merge'](_0x592a3f,_[_0x8fc8('0x25')](_0x545e54,[_0x8fc8('0x26'),_0x8fc8('0x27'),_0x8fc8('0x22'),'state']));this['emit'](util['format'](_0x8fc8('0x28'),_0x592a3f[_0x8fc8('0x29')]),'trunk:save',_0x592a3f);}}}catch(_0xc272e4){logger[_0x8fc8('0x2a')](_0x8fc8('0x2b'),util[_0x8fc8('0x1c')](_0xc272e4,{'showHidden':![],'depth':null}));}};UserReport[_0x8fc8('0x1d')][_0x8fc8('0x14')]=function(_0x46cce9){try{if(this['isNotNull'](_0x46cce9)){if(this['agents'][_0x46cce9['device']]){if(!this[_0x8fc8('0xd')][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x2d')]||_0x46cce9[_0x8fc8('0x24')]['toLowerCase']()==_0x8fc8('0x2e')){this[_0x8fc8('0xd')][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x2d')]=![];if(this[_0x8fc8('0xd')][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x24')]!==_0x46cce9[_0x8fc8('0x24')][_0x8fc8('0x2f')]()){this[_0x8fc8('0xd')][_0x46cce9[_0x8fc8('0x2c')]]['stateTime']=_['toNumber'](moment()[_0x8fc8('0x30')]('x'));}this['agents'][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x24')]=_0x46cce9[_0x8fc8('0x24')]['toLowerCase']();this[_0x8fc8('0xd')][_0x46cce9[_0x8fc8('0x2c')]]['updateStatusRealtime'](_0x46cce9);}}else if(this[_0x8fc8('0xe')][_0x46cce9[_0x8fc8('0x2c')]]){if(this[_0x8fc8('0xe')][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x24')]!==_0x46cce9[_0x8fc8('0x24')][_0x8fc8('0x2f')]()){this['telephones'][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x31')]=_['toNumber'](moment()['format']('x'));}this[_0x8fc8('0xe')][_0x46cce9[_0x8fc8('0x2c')]]['state']=_0x46cce9[_0x8fc8('0x24')][_0x8fc8('0x2f')]();this[_0x8fc8('0x1f')](util['format'](_0x8fc8('0x32'),this[_0x8fc8('0xe')][_0x46cce9[_0x8fc8('0x2c')]]['name']),_0x8fc8('0x33'),this[_0x8fc8('0xe')][_0x46cce9[_0x8fc8('0x2c')]]);}else if(this['trunks'][_0x46cce9['device']]){if(this[_0x8fc8('0xc')][_0x46cce9[_0x8fc8('0x2c')]]['state']!==_0x46cce9[_0x8fc8('0x24')][_0x8fc8('0x2f')]()){this['trunks'][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x31')]=_['toNumber'](moment()['format']('x'));}this[_0x8fc8('0xc')][_0x46cce9[_0x8fc8('0x2c')]][_0x8fc8('0x24')]=_0x46cce9[_0x8fc8('0x24')][_0x8fc8('0x2f')]();this[_0x8fc8('0x1f')](util[_0x8fc8('0x30')](_0x8fc8('0x28'),this[_0x8fc8('0xc')][_0x46cce9[_0x8fc8('0x2c')]]['name']),_0x8fc8('0x34'),this[_0x8fc8('0xc')][_0x46cce9[_0x8fc8('0x2c')]]);}else if(_[_0x8fc8('0x35')](_0x46cce9[_0x8fc8('0x2c')],'Queue')){}else if(_['startsWith'](_0x46cce9['device'],_0x8fc8('0x36'))){var _0x8d1d82=_0x46cce9[_0x8fc8('0x2c')];var _0x3e5f97=_0x8d1d82[_0x8fc8('0x37')](_0x8d1d82[_0x8fc8('0x38')]('/')+0x1,_0x8d1d82[_0x8fc8('0x38')]('@'));var _0x27c40a=_[_0x8fc8('0x21')](this[_0x8fc8('0xd')],function(_0x5e64f1){return _0x5e64f1[_0x8fc8('0x39')]==_0x3e5f97||_0x5e64f1['phone']==_0x3e5f97||_0x5e64f1[_0x8fc8('0x3a')]==_0x3e5f97;});if(_0x27c40a){if(_0x27c40a[_0x8fc8('0x24')]!==_0x46cce9[_0x8fc8('0x24')]['toLowerCase']()){_0x27c40a[_0x8fc8('0x31')]=_[_0x8fc8('0x3b')](moment()[_0x8fc8('0x30')]('x'));}_0x27c40a[_0x8fc8('0x24')]=_0x46cce9[_0x8fc8('0x24')][_0x8fc8('0x2f')]();_0x27c40a['local']=!![];_0x27c40a[_0x8fc8('0x3c')](_0x46cce9);}}else{}}}catch(_0x1905c4){logger[_0x8fc8('0x2a')](_0x8fc8('0x3d'),util[_0x8fc8('0x1c')](_0x1905c4,{'showHidden':![],'depth':null}));}};UserReport[_0x8fc8('0x1d')]['syncPeerStatus']=function(_0x51921a){try{if(this[_0x8fc8('0x20')](_0x51921a)&&this[_0x8fc8('0x20')](_0x51921a[_0x8fc8('0x15')])){if(this[_0x8fc8('0xd')][_0x51921a[_0x8fc8('0x3e')]]){if(!this['agents'][_0x51921a[_0x8fc8('0x3e')]][_0x8fc8('0x2d')]||_0x51921a[_0x8fc8('0x15')][_0x8fc8('0x2f')]()=='registered'){this[_0x8fc8('0xd')][_0x51921a['peer']][_0x8fc8('0x2d')]=![];this['agents'][_0x51921a[_0x8fc8('0x3e')]][_0x8fc8('0x3f')]=_0x51921a[_0x8fc8('0x15')][_0x8fc8('0x2f')]();this['agents'][_0x51921a[_0x8fc8('0x3e')]][_0x8fc8('0x40')]=_0x51921a[_0x8fc8('0x40')];this[_0x8fc8('0xd')][_0x51921a['peer']][_0x8fc8('0x3c')](_0x51921a);}}else if(this[_0x8fc8('0xe')][_0x51921a[_0x8fc8('0x3e')]]){this[_0x8fc8('0xe')][_0x51921a[_0x8fc8('0x3e')]][_0x8fc8('0x3f')]=_0x51921a[_0x8fc8('0x15')][_0x8fc8('0x2f')]();this['telephones'][_0x51921a['peer']][_0x8fc8('0x40')]=_0x51921a[_0x8fc8('0x40')];this[_0x8fc8('0x1f')](util[_0x8fc8('0x30')](_0x8fc8('0x32'),this['telephones'][_0x51921a[_0x8fc8('0x3e')]][_0x8fc8('0x29')]),_0x8fc8('0x33'),this[_0x8fc8('0xe')][_0x51921a[_0x8fc8('0x3e')]]);}else if(this[_0x8fc8('0xc')][_0x51921a[_0x8fc8('0x3e')]]){this[_0x8fc8('0xc')][_0x51921a[_0x8fc8('0x3e')]][_0x8fc8('0x3f')]=_0x51921a['peerstatus']['toLowerCase']();this[_0x8fc8('0xc')][_0x51921a[_0x8fc8('0x3e')]][_0x8fc8('0x40')]=_0x51921a[_0x8fc8('0x40')];this[_0x8fc8('0x1f')](util[_0x8fc8('0x30')]('trunk:%s',this[_0x8fc8('0xc')][_0x51921a[_0x8fc8('0x3e')]]['name']),_0x8fc8('0x34'),this['trunks'][_0x51921a['peer']]);}else{}}}catch(_0x5e073d){logger[_0x8fc8('0x2a')](_0x8fc8('0x41'),util['inspect'](_0x5e073d,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index f381738..809d8e3 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 _0x2e95=['[syncMusicOnHoldStop][VoiceAgentReport]','exports','moment','util','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','uniqueid','isUndefined','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','user:%s','membername','user:called','error','hasOwnProperty','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','inspect','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','agentcompleteAt','complete','talktime','transfer','agent','acw','acwtime','custom:agentcomplete','syncVarSet','addVariable','keys','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','syncMusicOnHoldStop','lastIndexOf'];(function(_0x4396b3,_0x41318d){var _0x1ed158=function(_0x8a57c7){while(--_0x8a57c7){_0x4396b3['push'](_0x4396b3['shift']());}};_0x1ed158(++_0x41318d);}(_0x2e95,0x16d));var _0x52e9=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x2e95[_0x139a3c];return _0x2b375b;};'use strict';var _=require('lodash');var moment=require(_0x52e9('0x0'));var util=require(_0x52e9('0x1'));var Redis=require('ioredis');var config=require(_0x52e9('0x2'));var logger=require('../../../config/logger')(_0x52e9('0x3'));var ami=require(_0x52e9('0x4'));config[_0x52e9('0x5')]=_[_0x52e9('0x6')](config[_0x52e9('0x5')],{'host':_0x52e9('0x7'),'port':0x18eb});var io=require(_0x52e9('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x4075ff){this[_0x52e9('0x9')]={};this[_0x52e9('0xa')]=_0x4075ff['voiceQueues'];this[_0x52e9('0xb')]=_0x4075ff[_0x52e9('0xb')];this[_0x52e9('0xc')]={};ami['on'](_0x52e9('0xd'),this[_0x52e9('0xe')][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x10'),this['syncAgentConnect'][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x11'),this[_0x52e9('0x12')][_0x52e9('0xf')](this));ami['on']('queuecallerabandon',this[_0x52e9('0x13')][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x14'),this[_0x52e9('0x15')][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x16'),this['syncVarSet'][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x17'),this[_0x52e9('0x18')][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x19'),this[_0x52e9('0x1a')][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x1b'),this['syncMusicOnHoldStop'][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x1c'),this[_0x52e9('0x1d')][_0x52e9('0xf')](this));ami['on'](_0x52e9('0x1e'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x20')]=function(_0x25ae8b,_0x5207f7,_0xd91d1){io['to'](_0x25ae8b)[_0x52e9('0x20')](_0x5207f7,_0xd91d1);};VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x21')]=function(_0x5ac3cd){return _0x5ac3cd!==null&&!_['isUndefined'](_0x5ac3cd);};VoiceAgentReport['prototype'][_0x52e9('0xe')]=function(_0x3c71a9){try{if(this[_0x52e9('0x21')](_0x3c71a9)){if(_['isUndefined'](this[_0x52e9('0x9')][_0x3c71a9[_0x52e9('0x22')]])){this[_0x52e9('0x9')][_0x3c71a9['uniqueid']]={};}if(_[_0x52e9('0x23')](this[_0x52e9('0x9')][_0x3c71a9['uniqueid']][_0x3c71a9[_0x52e9('0x24')]])){this['channels'][_0x3c71a9[_0x52e9('0x22')]][_0x3c71a9[_0x52e9('0x24')]]={'agentcalledAt':moment()[_0x52e9('0x25')](_0x52e9('0x26')),'lastevent':_0x52e9('0x27'),'variables':this['variables'][_0x3c71a9['uniqueid']],'type':this['voiceQueues'][_0x3c71a9[_0x52e9('0x28')]]?this[_0x52e9('0xa')][_0x3c71a9['queue']][_0x52e9('0x29')]||_0x52e9('0x2a'):_0x52e9('0x2a')};}_[_0x52e9('0x2b')](this[_0x52e9('0x9')][_0x3c71a9[_0x52e9('0x22')]][_0x3c71a9[_0x52e9('0x24')]],_[_0x52e9('0x2c')](_0x3c71a9,[_0x52e9('0x2d'),_0x52e9('0x2e')]));ami[_0x52e9('0x20')]('custom:agentcalled',this[_0x52e9('0x9')][_0x3c71a9[_0x52e9('0x22')]][_0x3c71a9['destuniqueid']]);this[_0x52e9('0x20')](util[_0x52e9('0x25')](_0x52e9('0x2f'),_0x3c71a9[_0x52e9('0x30')]),_0x52e9('0x31'),this['channels'][_0x3c71a9[_0x52e9('0x22')]][_0x3c71a9[_0x52e9('0x24')]]);}}catch(_0x29812d){logger[_0x52e9('0x32')]('[syncAgentCalled][VoiceAgentReport]',util['inspect'](_0x29812d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x52e9('0x1f')]['syncAgentConnect']=function(_0x3abab8){try{if(this[_0x52e9('0x21')](_0x3abab8)){if(this[_0x52e9('0x9')][_0x3abab8['uniqueid']]){for(var _0x5ba063 in this[_0x52e9('0x9')][_0x3abab8['uniqueid']]){if(this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x52e9('0x33')](_0x5ba063)){if(_0x3abab8[_0x52e9('0x24')]===_0x5ba063){this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]['agentconnectAt']=moment()[_0x52e9('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]['lastevent']=_0x52e9('0x34');this['channels'][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]['holdtime']=_0x3abab8[_0x52e9('0x35')];this['channels'][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x36')]=_0x3abab8['connectedlinenum'];this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x37')]=_0x3abab8['connectedlinename'];this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x38')]=_0x3abab8['destchannelstate'];this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x39')]=_0x3abab8[_0x52e9('0x39')];_[_0x52e9('0x2b')](this[_0x52e9('0xb')][_0x3abab8[_0x52e9('0x3a')]],_[_0x52e9('0x3b')](_0x3abab8,['queue',_0x52e9('0x3c')]));this[_0x52e9('0x20')](util['format'](_0x52e9('0x2f'),_0x3abab8['membername']),_0x52e9('0x3d'),this[_0x52e9('0x9')][_0x3abab8['uniqueid']][_0x3abab8[_0x52e9('0x24')]]);ami['emit'](_0x52e9('0x3e'),this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]);}else if(!this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]['agentringnoanswer']&&!this['channels'][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x14')]){this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]['agentringnoanswer']=!![];this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x3f')]=moment()[_0x52e9('0x25')](_0x52e9('0x26'));this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x40')]='answered_elsewhere';this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x41')]=_0x52e9('0x42');this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063][_0x52e9('0x43')]=_0x3abab8['destuniqueid'];this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]['answeredelsewheremembername']=_0x3abab8[_0x52e9('0x30')];ami[_0x52e9('0x20')](_0x52e9('0x44'),this[_0x52e9('0x9')][_0x3abab8[_0x52e9('0x22')]][_0x5ba063]);}}}}}}catch(_0x2448e9){logger['error'](_0x52e9('0x45'),util['inspect'](_0x2448e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x52e9('0x12')]=function(_0x9f260){try{if(this[_0x52e9('0x21')](_0x9f260)){if(this[_0x52e9('0x9')][_0x9f260[_0x52e9('0x22')]]&&this['channels'][_0x9f260[_0x52e9('0x22')]][_0x9f260[_0x52e9('0x24')]]){this[_0x52e9('0x9')][_0x9f260[_0x52e9('0x22')]][_0x9f260['destuniqueid']]['agentringnoanswer']=!![];this[_0x52e9('0x9')][_0x9f260['uniqueid']][_0x9f260[_0x52e9('0x24')]][_0x52e9('0x3f')]=moment()[_0x52e9('0x25')](_0x52e9('0x26'));this[_0x52e9('0x9')][_0x9f260['uniqueid']][_0x9f260['destuniqueid']][_0x52e9('0x40')]=_0x52e9('0x46');this['channels'][_0x9f260['uniqueid']][_0x9f260[_0x52e9('0x24')]][_0x52e9('0x41')]=_0x52e9('0x46');ami[_0x52e9('0x20')](_0x52e9('0x47'),this[_0x52e9('0x9')][_0x9f260[_0x52e9('0x22')]][_0x9f260[_0x52e9('0x24')]]);}}}catch(_0x7765c5){logger[_0x52e9('0x32')](_0x52e9('0x48'),util[_0x52e9('0x49')](_0x7765c5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x13')]=function(_0x87beae){try{if(this[_0x52e9('0x21')](_0x87beae)){if(this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]]){for(var _0x1a068e in this['channels'][_0x87beae['uniqueid']]){if(this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]][_0x52e9('0x33')](_0x1a068e)&&!this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]][_0x1a068e][_0x52e9('0x11')]&&!this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]][_0x1a068e][_0x52e9('0x14')]){this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]][_0x1a068e][_0x52e9('0x11')]=!![];this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]][_0x1a068e][_0x52e9('0x3f')]=moment()['format'](_0x52e9('0x26'));this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]][_0x1a068e][_0x52e9('0x40')]=_0x52e9('0x4a');this[_0x52e9('0x9')][_0x87beae[_0x52e9('0x22')]][_0x1a068e][_0x52e9('0x41')]='abandoned';ami[_0x52e9('0x20')]('custom:agentqueuecallerabandon',this['channels'][_0x87beae['uniqueid']][_0x1a068e]);}}}}}catch(_0x447673){logger[_0x52e9('0x32')](_0x52e9('0x4b'),util['inspect'](_0x447673,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x4c83be){try{if(this['isNotNull'](_0x4c83be)){if(this[_0x52e9('0x9')][_0x4c83be['uniqueid']]){for(var _0x1d3951 in this[_0x52e9('0x9')][_0x4c83be[_0x52e9('0x22')]]){if(this[_0x52e9('0x9')][_0x4c83be['uniqueid']][_0x52e9('0x33')](_0x1d3951)){if(this['channels'][_0x4c83be[_0x52e9('0x22')]][_0x1d3951][_0x52e9('0x4c')]&&!this[_0x52e9('0x9')][_0x4c83be[_0x52e9('0x22')]][_0x1d3951][_0x52e9('0x14')]){this[_0x52e9('0x9')][_0x4c83be[_0x52e9('0x22')]][_0x1d3951][_0x52e9('0x14')]=!![];this[_0x52e9('0x9')][_0x4c83be[_0x52e9('0x22')]][_0x1d3951][_0x52e9('0x4d')]=moment()[_0x52e9('0x25')](_0x52e9('0x26'));this[_0x52e9('0x9')][_0x4c83be[_0x52e9('0x22')]][_0x1d3951][_0x52e9('0x41')]=_0x52e9('0x4e');this[_0x52e9('0x9')][_0x4c83be[_0x52e9('0x22')]][_0x1d3951][_0x52e9('0x4f')]=_0x4c83be[_0x52e9('0x4f')];this[_0x52e9('0x9')][_0x4c83be['uniqueid']][_0x1d3951][_0x52e9('0x40')]=_0x4c83be['reason']==_0x52e9('0x50')?_0x52e9('0x51'):_0x4c83be[_0x52e9('0x40')];if(this[_0x52e9('0xa')][_0x4c83be[_0x52e9('0x28')]]&&this[_0x52e9('0xa')][_0x4c83be[_0x52e9('0x28')]][_0x52e9('0x52')]){this['channels'][_0x4c83be[_0x52e9('0x22')]][_0x1d3951]['agentacw']=!![];this['channels'][_0x4c83be[_0x52e9('0x22')]][_0x1d3951][_0x52e9('0x53')]=this[_0x52e9('0xa')][_0x4c83be[_0x52e9('0x28')]]['acwTimeout'];}this[_0x52e9('0xb')][_0x4c83be[_0x52e9('0x3a')]]=_[_0x52e9('0x2c')](this['agents'][_0x4c83be[_0x52e9('0x3a')]],['queue',_0x52e9('0x3c')]);this[_0x52e9('0x20')](util[_0x52e9('0x25')]('user:%s',_0x4c83be[_0x52e9('0x30')]),'user:agentcomplete',this['channels'][_0x4c83be['uniqueid']][_0x1d3951]);ami[_0x52e9('0x20')](_0x52e9('0x54'),this[_0x52e9('0x9')][_0x4c83be[_0x52e9('0x22')]][_0x1d3951]);}}}}}}catch(_0x27239b){logger[_0x52e9('0x32')]('[syncAgentComplete][VoiceAgentReport]',util[_0x52e9('0x49')](_0x27239b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x55')]=function(_0x3364d9){try{if(this[_0x52e9('0x21')](_0x3364d9)){this[_0x52e9('0x56')](_0x3364d9[_0x52e9('0x22')],_[_0x52e9('0x57')](_0x3364d9['variable'])[0x0],_0x3364d9[_0x52e9('0x58')]);if(this['channels'][_0x3364d9['uniqueid']]){for(var _0x44eadb in this[_0x52e9('0x9')][_0x3364d9['uniqueid']]){if(this[_0x52e9('0x9')][_0x3364d9[_0x52e9('0x22')]]['hasOwnProperty'](_0x44eadb)){if(_[_0x52e9('0x23')](this[_0x52e9('0x9')][_0x3364d9['uniqueid']][_0x44eadb]['variables'])){this[_0x52e9('0x9')][_0x3364d9['uniqueid']][_0x44eadb]['variables']={};}this[_0x52e9('0x9')][_0x3364d9[_0x52e9('0x22')]][_0x44eadb][_0x52e9('0xc')]=this[_0x52e9('0xc')][_0x3364d9[_0x52e9('0x22')]];}}}}}catch(_0x5ee4a5){logger[_0x52e9('0x32')]('[syncVarSet][VoiceAgentReport]',util[_0x52e9('0x49')](_0x5ee4a5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x56')]=function(_0x886e8d,_0x2983a4,_0x24d84e){var _0x44962f=[_0x52e9('0x59'),_0x52e9('0x5a'),_0x52e9('0x5b'),_0x52e9('0x5c'),_0x52e9('0x5d'),_0x52e9('0x5e'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0x52e9('0x5f'),_0x52e9('0x60'),'bridgepvtcallid',_0x52e9('0x61'),_0x52e9('0x62'),_0x52e9('0x63'),_0x52e9('0x64'),_0x52e9('0x30'),_0x52e9('0x65'),'memberrealtime'];if(!_[_0x52e9('0x66')](_0x2983a4)&&!_[_0x52e9('0x67')](_0x44962f,_0x2983a4)){if(_['isUndefined'](this['variables'][_0x886e8d])){this[_0x52e9('0xc')][_0x886e8d]={};}this['variables'][_0x886e8d][_0x2983a4]=_0x24d84e;}};VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x18')]=function(_0x3dfcd5){try{if(this['isNotNull'](_0x3dfcd5)){if(this[_0x52e9('0x9')][_0x3dfcd5[_0x52e9('0x22')]]){for(var _0x3b9758 in this[_0x52e9('0x9')][_0x3dfcd5[_0x52e9('0x22')]]){if(this['channels'][_0x3dfcd5[_0x52e9('0x22')]][_0x52e9('0x33')](_0x3b9758)){if(this[_0x52e9('0x9')][_0x3dfcd5['uniqueid']][_0x3b9758][_0x52e9('0x40')]==_0x52e9('0x50')&&this[_0x52e9('0x9')][_0x3dfcd5[_0x52e9('0x22')]][_0x3b9758]['agentcomplete']){this[_0x52e9('0x9')][_0x3dfcd5[_0x52e9('0x22')]][_0x3b9758][_0x52e9('0x4d')]=moment()[_0x52e9('0x25')](_0x52e9('0x26'));}}}ami[_0x52e9('0x20')](_0x52e9('0x68'),_[_0x52e9('0x69')](this['channels'][_0x3dfcd5[_0x52e9('0x22')]]));delete this[_0x52e9('0x9')][_0x3dfcd5[_0x52e9('0x22')]];}if(this[_0x52e9('0xc')][_0x3dfcd5['uniqueid']]){delete this[_0x52e9('0xc')][_0x3dfcd5[_0x52e9('0x22')]];}}}catch(_0xf39fb3){logger[_0x52e9('0x32')](_0x52e9('0x6a'),util[_0x52e9('0x49')](_0xf39fb3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x1d')]=function(_0x31b427){try{if(this[_0x52e9('0x21')](_0x31b427)){if(this[_0x52e9('0x9')][_0x31b427[_0x52e9('0x6b')]]){for(var _0x42de7f in this[_0x52e9('0x9')][_0x31b427['transfereeuniqueid']]){if(this['channels'][_0x31b427[_0x52e9('0x6b')]][_0x52e9('0x33')](_0x42de7f)){if(_0x31b427[_0x52e9('0x6c')]===_0x42de7f){var _0x11d44e=moment();this[_0x52e9('0x9')][_0x31b427[_0x52e9('0x6b')]][_0x42de7f][_0x52e9('0x14')]=!![];this['channels'][_0x31b427[_0x52e9('0x6b')]][_0x42de7f][_0x52e9('0x4d')]=moment()[_0x52e9('0x25')](_0x52e9('0x26'));this['channels'][_0x31b427[_0x52e9('0x6b')]][_0x42de7f][_0x52e9('0x40')]=_0x52e9('0x50');this['channels'][_0x31b427[_0x52e9('0x6b')]][_0x42de7f]['lastevent']=_0x52e9('0x4e');this[_0x52e9('0x9')][_0x31b427[_0x52e9('0x6b')]][_0x42de7f][_0x52e9('0x4f')]=_0x11d44e[_0x52e9('0x6d')](this[_0x52e9('0x9')][_0x31b427[_0x52e9('0x6b')]][_0x42de7f][_0x52e9('0x4c')],_0x52e9('0x6e'));}}}}if(this[_0x52e9('0x9')][_0x31b427[_0x52e9('0x6f')]]){var _0x35af4d=this[_0x52e9('0x9')][_0x31b427[_0x52e9('0x6f')]];this[_0x52e9('0x9')][_0x31b427['secondtransfereruniqueid']]=this['channels'][_0x31b427['transfereeuniqueid']];this['channels'][_0x31b427['transfereeuniqueid']]=_0x35af4d;}}}catch(_0x135565){logger[_0x52e9('0x32')](_0x52e9('0x70'),util[_0x52e9('0x49')](_0x135565,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x52e9('0x1f')]['syncBlindTransfer']=function(_0x29a987){try{if(this['isNotNull'](_0x29a987)){if(this[_0x52e9('0x9')][_0x29a987[_0x52e9('0x6b')]]){for(var _0x212037 in this[_0x52e9('0x9')][_0x29a987[_0x52e9('0x6b')]]){if(this[_0x52e9('0x9')][_0x29a987[_0x52e9('0x6b')]]['hasOwnProperty'](_0x212037)){if(_0x29a987['transfereruniqueid']===_0x212037){var _0x1f3700=moment();this[_0x52e9('0x9')][_0x29a987[_0x52e9('0x6b')]][_0x212037]['agentcomplete']=!![];this[_0x52e9('0x9')][_0x29a987[_0x52e9('0x6b')]][_0x212037][_0x52e9('0x4d')]=_0x1f3700;this['channels'][_0x29a987['transfereeuniqueid']][_0x212037]['reason']=_0x52e9('0x50');this[_0x52e9('0x9')][_0x29a987[_0x52e9('0x6b')]][_0x212037][_0x52e9('0x41')]=_0x52e9('0x4e');this[_0x52e9('0x9')][_0x29a987[_0x52e9('0x6b')]][_0x212037][_0x52e9('0x4f')]=_0x1f3700[_0x52e9('0x6d')](this[_0x52e9('0x9')][_0x29a987['transfereeuniqueid']][_0x212037][_0x52e9('0x4c')],_0x52e9('0x6e'));}}}}}}catch(_0x36bc99){logger[_0x52e9('0x32')](_0x52e9('0x71'),util[_0x52e9('0x49')](_0x36bc99,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x52e9('0x1f')][_0x52e9('0x1a')]=function(_0x48f26b){var _0x2ce0b9='';try{if(this[_0x52e9('0x21')](_0x48f26b)){if(_0x48f26b[_0x52e9('0x72')]){_0x2ce0b9=_0x48f26b['channel'][_0x52e9('0x73')](0x0,_0x48f26b[_0x52e9('0x72')]['lastIndexOf']('-'));if(this[_0x52e9('0xb')][_0x2ce0b9]){this[_0x52e9('0xb')][_0x2ce0b9][_0x52e9('0x74')]=!![];}}}}catch(_0x544da6){logger[_0x52e9('0x32')]('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x52e9('0x49')](_0x544da6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x52e9('0x75')]=function(_0x504e24){var _0x23267c='';try{if(this['isNotNull'](_0x504e24)){if(_0x504e24[_0x52e9('0x72')]){_0x23267c=_0x504e24['channel']['substring'](0x0,_0x504e24[_0x52e9('0x72')][_0x52e9('0x76')]('-'));if(this[_0x52e9('0xb')][_0x23267c]){this[_0x52e9('0xb')][_0x23267c][_0x52e9('0x74')]=![];}}}}catch(_0x5a5507){logger[_0x52e9('0x32')](_0x52e9('0x77'),util[_0x52e9('0x49')](_0x5a5507,{'showHidden':![],'depth':null}));}};module[_0x52e9('0x78')]=VoiceAgentReport; \ No newline at end of file +var _0x3f3b=['isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','privilege','custom:agentcalled','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','user:%s','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','agentcompleteAt','talktime','transfer','acw','agentacw','acwtime','acwTimeout','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosloss','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','complete','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','diff','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','exports','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0x3f3b,0x1c0));var _0xb3f3=function(_0x35c829,_0x369e3e){_0x35c829=_0x35c829-0x0;var _0x26bb82=_0x3f3b[_0x35c829];return _0x26bb82;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require(_0xb3f3('0x0'));var logger=require(_0xb3f3('0x1'))(_0xb3f3('0x2'));var ami=require(_0xb3f3('0x3'));config[_0xb3f3('0x4')]=_[_0xb3f3('0x5')](config[_0xb3f3('0x4')],{'host':_0xb3f3('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb3f3('0x4')]));function VoiceAgentReport(_0x34e005){this[_0xb3f3('0x7')]={};this[_0xb3f3('0x8')]=_0x34e005[_0xb3f3('0x8')];this[_0xb3f3('0x9')]=_0x34e005[_0xb3f3('0x9')];this[_0xb3f3('0xa')]={};ami['on'](_0xb3f3('0xb'),this[_0xb3f3('0xc')][_0xb3f3('0xd')](this));ami['on'](_0xb3f3('0xe'),this[_0xb3f3('0xf')][_0xb3f3('0xd')](this));ami['on'](_0xb3f3('0x10'),this[_0xb3f3('0x11')]['bind'](this));ami['on'](_0xb3f3('0x12'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xb3f3('0x13'),this[_0xb3f3('0x14')][_0xb3f3('0xd')](this));ami['on']('varset',this[_0xb3f3('0x15')][_0xb3f3('0xd')](this));ami['on'](_0xb3f3('0x16'),this['syncHangup'][_0xb3f3('0xd')](this));ami['on']('musiconholdstart',this[_0xb3f3('0x17')][_0xb3f3('0xd')](this));ami['on']('musiconholdstop',this[_0xb3f3('0x18')][_0xb3f3('0xd')](this));ami['on'](_0xb3f3('0x19'),this[_0xb3f3('0x1a')][_0xb3f3('0xd')](this));ami['on'](_0xb3f3('0x1b'),this[_0xb3f3('0x1c')]['bind'](this));}VoiceAgentReport[_0xb3f3('0x1d')][_0xb3f3('0x1e')]=function(_0x501278,_0x581510,_0x10f0dc){io['to'](_0x501278)['emit'](_0x581510,_0x10f0dc);};VoiceAgentReport['prototype'][_0xb3f3('0x1f')]=function(_0x107dda){return _0x107dda!==null&&!_[_0xb3f3('0x20')](_0x107dda);};VoiceAgentReport[_0xb3f3('0x1d')][_0xb3f3('0xc')]=function(_0x2f918a){try{if(this[_0xb3f3('0x1f')](_0x2f918a)){if(_[_0xb3f3('0x20')](this[_0xb3f3('0x7')][_0x2f918a[_0xb3f3('0x21')]])){this[_0xb3f3('0x7')][_0x2f918a[_0xb3f3('0x21')]]={};}if(_[_0xb3f3('0x20')](this['channels'][_0x2f918a[_0xb3f3('0x21')]][_0x2f918a[_0xb3f3('0x22')]])){this['channels'][_0x2f918a[_0xb3f3('0x21')]][_0x2f918a['destuniqueid']]={'agentcalledAt':moment()[_0xb3f3('0x23')](_0xb3f3('0x24')),'lastevent':_0xb3f3('0x25'),'variables':this[_0xb3f3('0xa')][_0x2f918a[_0xb3f3('0x21')]],'type':this['voiceQueues'][_0x2f918a[_0xb3f3('0x26')]]?this[_0xb3f3('0x8')][_0x2f918a[_0xb3f3('0x26')]][_0xb3f3('0x27')]||_0xb3f3('0x28'):_0xb3f3('0x28')};}_['merge'](this[_0xb3f3('0x7')][_0x2f918a[_0xb3f3('0x21')]][_0x2f918a[_0xb3f3('0x22')]],_['omit'](_0x2f918a,['event',_0xb3f3('0x29')]));ami[_0xb3f3('0x1e')](_0xb3f3('0x2a'),this['channels'][_0x2f918a['uniqueid']][_0x2f918a[_0xb3f3('0x22')]]);this[_0xb3f3('0x1e')](util[_0xb3f3('0x23')]('user:%s',_0x2f918a[_0xb3f3('0x2b')]),_0xb3f3('0x2c'),this['channels'][_0x2f918a['uniqueid']][_0x2f918a['destuniqueid']]);}}catch(_0x1aa8d7){logger[_0xb3f3('0x2d')](_0xb3f3('0x2e'),util[_0xb3f3('0x2f')](_0x1aa8d7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb3f3('0x1d')][_0xb3f3('0xf')]=function(_0x5f074b){try{if(this[_0xb3f3('0x1f')](_0x5f074b)){if(this[_0xb3f3('0x7')][_0x5f074b['uniqueid']]){for(var _0x432ea5 in this[_0xb3f3('0x7')][_0x5f074b['uniqueid']]){if(this['channels'][_0x5f074b[_0xb3f3('0x21')]][_0xb3f3('0x30')](_0x432ea5)){if(_0x5f074b[_0xb3f3('0x22')]===_0x432ea5){this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5]['agentconnectAt']=moment()[_0xb3f3('0x23')](_0xb3f3('0x24'));this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x31')]='connect';this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x32')]=_0x5f074b[_0xb3f3('0x32')];this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x33')]=_0x5f074b[_0xb3f3('0x33')];this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x34')]=_0x5f074b['connectedlinename'];this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x35')]=_0x5f074b[_0xb3f3('0x35')];this[_0xb3f3('0x7')][_0x5f074b['uniqueid']][_0x432ea5][_0xb3f3('0x36')]=_0x5f074b[_0xb3f3('0x36')];_[_0xb3f3('0x37')](this[_0xb3f3('0x9')][_0x5f074b[_0xb3f3('0x38')]],_[_0xb3f3('0x39')](_0x5f074b,[_0xb3f3('0x26'),_0xb3f3('0x3a')]));this[_0xb3f3('0x1e')](util[_0xb3f3('0x23')](_0xb3f3('0x3b'),_0x5f074b['membername']),'user:agentconnect',this['channels'][_0x5f074b[_0xb3f3('0x21')]][_0x5f074b[_0xb3f3('0x22')]]);ami['emit'](_0xb3f3('0x3c'),this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5]);}else if(!this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x10')]&&!this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x13')]){this['channels'][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5]['agentringnoanswer']=!![];this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x3d')]=moment()[_0xb3f3('0x23')](_0xb3f3('0x24'));this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x3e')]=_0xb3f3('0x3f');this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5]['lastevent']=_0xb3f3('0x3f');this['channels'][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5][_0xb3f3('0x40')]=_0x5f074b[_0xb3f3('0x22')];this[_0xb3f3('0x7')][_0x5f074b['uniqueid']][_0x432ea5][_0xb3f3('0x41')]=_0x5f074b[_0xb3f3('0x2b')];ami['emit'](_0xb3f3('0x42'),this[_0xb3f3('0x7')][_0x5f074b[_0xb3f3('0x21')]][_0x432ea5]);}}}}}}catch(_0x4ddc91){logger[_0xb3f3('0x2d')](_0xb3f3('0x43'),util[_0xb3f3('0x2f')](_0x4ddc91,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb3f3('0x1d')][_0xb3f3('0x11')]=function(_0x3b62da){try{if(this[_0xb3f3('0x1f')](_0x3b62da)){if(this[_0xb3f3('0x7')][_0x3b62da[_0xb3f3('0x21')]]&&this[_0xb3f3('0x7')][_0x3b62da[_0xb3f3('0x21')]][_0x3b62da[_0xb3f3('0x22')]]){this[_0xb3f3('0x7')][_0x3b62da['uniqueid']][_0x3b62da['destuniqueid']]['agentringnoanswer']=!![];this[_0xb3f3('0x7')][_0x3b62da[_0xb3f3('0x21')]][_0x3b62da[_0xb3f3('0x22')]][_0xb3f3('0x3d')]=moment()[_0xb3f3('0x23')](_0xb3f3('0x24'));this['channels'][_0x3b62da[_0xb3f3('0x21')]][_0x3b62da[_0xb3f3('0x22')]][_0xb3f3('0x3e')]=_0xb3f3('0x44');this[_0xb3f3('0x7')][_0x3b62da[_0xb3f3('0x21')]][_0x3b62da['destuniqueid']][_0xb3f3('0x31')]=_0xb3f3('0x44');ami[_0xb3f3('0x1e')]('custom:agentringnoanswer',this[_0xb3f3('0x7')][_0x3b62da[_0xb3f3('0x21')]][_0x3b62da[_0xb3f3('0x22')]]);}}}catch(_0x1a50db){logger[_0xb3f3('0x2d')](_0xb3f3('0x45'),util[_0xb3f3('0x2f')](_0x1a50db,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb3f3('0x46')]=function(_0x24cce5){try{if(this['isNotNull'](_0x24cce5)){if(this[_0xb3f3('0x7')][_0x24cce5[_0xb3f3('0x21')]]){for(var _0xdde5ac in this['channels'][_0x24cce5[_0xb3f3('0x21')]]){if(this[_0xb3f3('0x7')][_0x24cce5[_0xb3f3('0x21')]][_0xb3f3('0x30')](_0xdde5ac)&&!this[_0xb3f3('0x7')][_0x24cce5[_0xb3f3('0x21')]][_0xdde5ac]['agentringnoanswer']&&!this[_0xb3f3('0x7')][_0x24cce5[_0xb3f3('0x21')]][_0xdde5ac][_0xb3f3('0x13')]){this[_0xb3f3('0x7')][_0x24cce5['uniqueid']][_0xdde5ac][_0xb3f3('0x10')]=!![];this[_0xb3f3('0x7')][_0x24cce5[_0xb3f3('0x21')]][_0xdde5ac][_0xb3f3('0x3d')]=moment()[_0xb3f3('0x23')](_0xb3f3('0x24'));this[_0xb3f3('0x7')][_0x24cce5[_0xb3f3('0x21')]][_0xdde5ac][_0xb3f3('0x3e')]=_0xb3f3('0x47');this['channels'][_0x24cce5['uniqueid']][_0xdde5ac][_0xb3f3('0x31')]=_0xb3f3('0x47');ami[_0xb3f3('0x1e')](_0xb3f3('0x48'),this['channels'][_0x24cce5[_0xb3f3('0x21')]][_0xdde5ac]);}}}}}catch(_0x26cb75){logger['error'](_0xb3f3('0x49'),util[_0xb3f3('0x2f')](_0x26cb75,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb3f3('0x1d')]['syncAgentComplete']=function(_0x37c181){try{if(this[_0xb3f3('0x1f')](_0x37c181)){if(this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]]){for(var _0x1dcec9 in this[_0xb3f3('0x7')][_0x37c181['uniqueid']]){if(this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]]['hasOwnProperty'](_0x1dcec9)){if(this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9][_0xb3f3('0x4a')]&&!this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9][_0xb3f3('0x13')]){this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9][_0xb3f3('0x13')]=!![];this[_0xb3f3('0x7')][_0x37c181['uniqueid']][_0x1dcec9][_0xb3f3('0x4b')]=moment()[_0xb3f3('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb3f3('0x7')][_0x37c181['uniqueid']][_0x1dcec9][_0xb3f3('0x31')]='complete';this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9][_0xb3f3('0x4c')]=_0x37c181[_0xb3f3('0x4c')];this['channels'][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9][_0xb3f3('0x3e')]=_0x37c181[_0xb3f3('0x3e')]==_0xb3f3('0x4d')?'agent':_0x37c181['reason'];if(this[_0xb3f3('0x8')][_0x37c181['queue']]&&this[_0xb3f3('0x8')][_0x37c181[_0xb3f3('0x26')]][_0xb3f3('0x4e')]){this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9][_0xb3f3('0x4f')]=!![];this[_0xb3f3('0x7')][_0x37c181['uniqueid']][_0x1dcec9][_0xb3f3('0x50')]=this[_0xb3f3('0x8')][_0x37c181[_0xb3f3('0x26')]][_0xb3f3('0x51')];}this[_0xb3f3('0x9')][_0x37c181[_0xb3f3('0x38')]]=_['omit'](this[_0xb3f3('0x9')][_0x37c181[_0xb3f3('0x38')]],['queue',_0xb3f3('0x3a')]);this[_0xb3f3('0x1e')](util[_0xb3f3('0x23')](_0xb3f3('0x3b'),_0x37c181[_0xb3f3('0x2b')]),'user:agentcomplete',this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9]);ami['emit']('custom:agentcomplete',this[_0xb3f3('0x7')][_0x37c181[_0xb3f3('0x21')]][_0x1dcec9]);}}}}}}catch(_0x18e4c3){logger[_0xb3f3('0x2d')](_0xb3f3('0x52'),util[_0xb3f3('0x2f')](_0x18e4c3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb3f3('0x1d')][_0xb3f3('0x15')]=function(_0x2c83ec){try{if(this[_0xb3f3('0x1f')](_0x2c83ec)){this[_0xb3f3('0x53')](_0x2c83ec['uniqueid'],_[_0xb3f3('0x54')](_0x2c83ec[_0xb3f3('0x55')])[0x0],_0x2c83ec[_0xb3f3('0x56')]);if(this[_0xb3f3('0x7')][_0x2c83ec[_0xb3f3('0x21')]]){for(var _0x11b989 in this['channels'][_0x2c83ec[_0xb3f3('0x21')]]){if(this['channels'][_0x2c83ec['uniqueid']][_0xb3f3('0x30')](_0x11b989)){if(_[_0xb3f3('0x20')](this[_0xb3f3('0x7')][_0x2c83ec[_0xb3f3('0x21')]][_0x11b989][_0xb3f3('0xa')])){this[_0xb3f3('0x7')][_0x2c83ec['uniqueid']][_0x11b989][_0xb3f3('0xa')]={};}this[_0xb3f3('0x7')][_0x2c83ec[_0xb3f3('0x21')]][_0x11b989]['variables']=this[_0xb3f3('0xa')][_0x2c83ec[_0xb3f3('0x21')]];}}}}}catch(_0x44aac2){logger[_0xb3f3('0x2d')](_0xb3f3('0x57'),util[_0xb3f3('0x2f')](_0x44aac2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb3f3('0x1d')][_0xb3f3('0x53')]=function(_0x131b67,_0x476fab,_0x26a14b){var _0x5ed735=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xb3f3('0x58'),_0xb3f3('0x59'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xb3f3('0x5a'),_0xb3f3('0x5b'),_0xb3f3('0x5c'),'bridgepvtcallid',_0xb3f3('0x5d'),_0xb3f3('0x5e'),_0xb3f3('0x5f'),_0xb3f3('0x60'),'membername',_0xb3f3('0x61'),_0xb3f3('0x62')];if(!_[_0xb3f3('0x63')](_0x476fab)&&!_[_0xb3f3('0x64')](_0x5ed735,_0x476fab)){if(_[_0xb3f3('0x20')](this['variables'][_0x131b67])){this['variables'][_0x131b67]={};}this[_0xb3f3('0xa')][_0x131b67][_0x476fab]=_0x26a14b;}};VoiceAgentReport['prototype'][_0xb3f3('0x65')]=function(_0x473e61){try{if(this[_0xb3f3('0x1f')](_0x473e61)){if(this[_0xb3f3('0x7')][_0x473e61[_0xb3f3('0x21')]]){for(var _0x5389e7 in this[_0xb3f3('0x7')][_0x473e61['uniqueid']]){if(this[_0xb3f3('0x7')][_0x473e61['uniqueid']][_0xb3f3('0x30')](_0x5389e7)){if(this[_0xb3f3('0x7')][_0x473e61[_0xb3f3('0x21')]][_0x5389e7][_0xb3f3('0x3e')]=='transfer'&&this[_0xb3f3('0x7')][_0x473e61['uniqueid']][_0x5389e7][_0xb3f3('0x13')]){this['channels'][_0x473e61[_0xb3f3('0x21')]][_0x5389e7]['agentcompleteAt']=moment()[_0xb3f3('0x23')](_0xb3f3('0x24'));}}}ami[_0xb3f3('0x1e')](_0xb3f3('0x66'),_[_0xb3f3('0x67')](this[_0xb3f3('0x7')][_0x473e61[_0xb3f3('0x21')]]));delete this[_0xb3f3('0x7')][_0x473e61['uniqueid']];}if(this[_0xb3f3('0xa')][_0x473e61[_0xb3f3('0x21')]]){delete this[_0xb3f3('0xa')][_0x473e61[_0xb3f3('0x21')]];}}}catch(_0xdf982b){logger[_0xb3f3('0x2d')](_0xb3f3('0x68'),util[_0xb3f3('0x2f')](_0xdf982b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb3f3('0x1a')]=function(_0x516dcc){try{if(this['isNotNull'](_0x516dcc)){if(this['channels'][_0x516dcc[_0xb3f3('0x69')]]){for(var _0x217835 in this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x69')]]){if(this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x69')]][_0xb3f3('0x30')](_0x217835)){if(_0x516dcc['origtransfereruniqueid']===_0x217835){var _0x1c98f1=moment();this['channels'][_0x516dcc['transfereeuniqueid']][_0x217835][_0xb3f3('0x13')]=!![];this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x69')]][_0x217835][_0xb3f3('0x4b')]=moment()[_0xb3f3('0x23')](_0xb3f3('0x24'));this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x69')]][_0x217835][_0xb3f3('0x3e')]=_0xb3f3('0x4d');this[_0xb3f3('0x7')][_0x516dcc['transfereeuniqueid']][_0x217835][_0xb3f3('0x31')]=_0xb3f3('0x6a');this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x69')]][_0x217835][_0xb3f3('0x4c')]=_0x1c98f1['diff'](this['channels'][_0x516dcc[_0xb3f3('0x69')]][_0x217835][_0xb3f3('0x4a')],_0xb3f3('0x6b'));}}}}if(this['channels'][_0x516dcc[_0xb3f3('0x6c')]]){var _0x286b0e=this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x6c')]];this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x6c')]]=this['channels'][_0x516dcc[_0xb3f3('0x69')]];this[_0xb3f3('0x7')][_0x516dcc[_0xb3f3('0x69')]]=_0x286b0e;}}}catch(_0x1caa56){logger[_0xb3f3('0x2d')](_0xb3f3('0x6d'),util['inspect'](_0x1caa56,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb3f3('0x1d')][_0xb3f3('0x1c')]=function(_0x21de5b){try{if(this[_0xb3f3('0x1f')](_0x21de5b)){if(this[_0xb3f3('0x7')][_0x21de5b[_0xb3f3('0x69')]]){for(var _0x13bd57 in this[_0xb3f3('0x7')][_0x21de5b['transfereeuniqueid']]){if(this[_0xb3f3('0x7')][_0x21de5b[_0xb3f3('0x69')]]['hasOwnProperty'](_0x13bd57)){if(_0x21de5b[_0xb3f3('0x6e')]===_0x13bd57){var _0x3d828b=moment();this[_0xb3f3('0x7')][_0x21de5b[_0xb3f3('0x69')]][_0x13bd57][_0xb3f3('0x13')]=!![];this[_0xb3f3('0x7')][_0x21de5b['transfereeuniqueid']][_0x13bd57][_0xb3f3('0x4b')]=_0x3d828b;this['channels'][_0x21de5b['transfereeuniqueid']][_0x13bd57]['reason']=_0xb3f3('0x4d');this[_0xb3f3('0x7')][_0x21de5b['transfereeuniqueid']][_0x13bd57][_0xb3f3('0x31')]=_0xb3f3('0x6a');this[_0xb3f3('0x7')][_0x21de5b[_0xb3f3('0x69')]][_0x13bd57][_0xb3f3('0x4c')]=_0x3d828b[_0xb3f3('0x6f')](this[_0xb3f3('0x7')][_0x21de5b[_0xb3f3('0x69')]][_0x13bd57][_0xb3f3('0x4a')],'seconds');}}}}}}catch(_0x1b05c1){logger[_0xb3f3('0x2d')](_0xb3f3('0x70'),util[_0xb3f3('0x2f')](_0x1b05c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb3f3('0x17')]=function(_0x204db4){var _0x5df22e='';try{if(this[_0xb3f3('0x1f')](_0x204db4)){if(_0x204db4[_0xb3f3('0x71')]){_0x5df22e=_0x204db4[_0xb3f3('0x71')][_0xb3f3('0x72')](0x0,_0x204db4[_0xb3f3('0x71')][_0xb3f3('0x73')]('-'));if(this[_0xb3f3('0x9')][_0x5df22e]){this[_0xb3f3('0x9')][_0x5df22e]['onhold']=!![];}}}}catch(_0x15f48a){logger[_0xb3f3('0x2d')](_0xb3f3('0x74'),util['inspect'](_0x15f48a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x5611d3){var _0x10b067='';try{if(this[_0xb3f3('0x1f')](_0x5611d3)){if(_0x5611d3[_0xb3f3('0x71')]){_0x10b067=_0x5611d3['channel'][_0xb3f3('0x72')](0x0,_0x5611d3[_0xb3f3('0x71')]['lastIndexOf']('-'));if(this[_0xb3f3('0x9')][_0x10b067]){this[_0xb3f3('0x9')][_0x10b067][_0xb3f3('0x75')]=![];}}}}catch(_0x28710f){logger[_0xb3f3('0x2d')](_0xb3f3('0x76'),util['inspect'](_0x28710f,{'showHidden':![],'depth':null}));}};module[_0xb3f3('0x77')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 8fc21ba..2823ff5 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 _0xbdbe=['applicationdata','appdata','starttime','duration','seconds','includes','lastapplication','lastdata','set','cdr(','match','queue','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','.wav49','find','monitors','isNil','push','rec','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','diff','billableseconds','holdtime','context','omit','destconnectedlinenum','user:%s','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','path','../../../config/environment','../../../config/logger','ami','../ami','unknown','busy','invalid','unavailable','ringing','ringinuse','onhold','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','newchannel','syncNewChannel','varset','syncVarSet','bind','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','merge','pick','keys','error','channel','OutgoingSpoolFailed','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','from-sip','split','exten','format','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','inspect','linkedid','application','toLowerCase'];(function(_0x3f1ede,_0x17355d){var _0x166689=function(_0x2b3d84){while(--_0x2b3d84){_0x3f1ede['push'](_0x3f1ede['shift']());}};_0x166689(++_0x17355d);}(_0xbdbe,0xe3));var _0xebdb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbdbe[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require(_0xebdb('0x0'));var _=require(_0xebdb('0x1'));var moment=require(_0xebdb('0x2'));var util=require('util');var path=require(_0xebdb('0x3'));var Redis=require('ioredis');var config=require(_0xebdb('0x4'));var logger=require(_0xebdb('0x5'))(_0xebdb('0x6'));var ami=require(_0xebdb('0x7'));var Channel=require('../model/channel');var statusDesc=[_0xebdb('0x8'),'not_inuse','inuse',_0xebdb('0x9'),_0xebdb('0xa'),_0xebdb('0xb'),_0xebdb('0xc'),_0xebdb('0xd'),_0xebdb('0xe')];var applications=['set','queue',_0xebdb('0xf'),_0xebdb('0x10'),_0xebdb('0x11'),'voicemail'];var dispositions=[_0xebdb('0x12'),_0xebdb('0x13'),'FAILED',_0xebdb('0x12'),_0xebdb('0x12'),_0xebdb('0x12'),_0xebdb('0x14'),_0xebdb('0x15'),_0xebdb('0x13'),_0xebdb('0x13'),_0xebdb('0x13')];var actions={};config[_0xebdb('0x16')]=_['defaults'](config[_0xebdb('0x16')],{'host':_0xebdb('0x17'),'port':0x18eb});var io=require(_0xebdb('0x18'))(new Redis(config['redis']));function VoiceCallReport(_0x35c620){this[_0xebdb('0x19')]=_0x35c620['channels'];this[_0xebdb('0x1a')]=_0x35c620[_0xebdb('0x1a')];ami['on'](_0xebdb('0x1b'),this[_0xebdb('0x1c')]['bind'](this));ami['on'](_0xebdb('0x1d'),this['syncNewExten']['bind'](this));ami['on'](_0xebdb('0x1e'),this[_0xebdb('0x1f')]['bind'](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on'](_0xebdb('0x20'),this[_0xebdb('0x21')][_0xebdb('0x22')](this));ami['on'](_0xebdb('0x23'),this[_0xebdb('0x24')]['bind'](this));ami['on'](_0xebdb('0x25'),this['syncNewCallerId']['bind'](this));ami['on']('attendedtransfer',this[_0xebdb('0x26')][_0xebdb('0x22')](this));ami['on'](_0xebdb('0x27'),this[_0xebdb('0x28')][_0xebdb('0x22')](this));ami['on'](_0xebdb('0x29'),this[_0xebdb('0x2a')][_0xebdb('0x22')](this));ami['on']('musiconholdstop',this[_0xebdb('0x2b')]['bind'](this));return BPromise[_0xebdb('0x2c')]()[_0xebdb('0x2d')](ami[_0xebdb('0x2e')]())[_0xebdb('0x2f')](function(_0x32df74){console[_0xebdb('0x30')](_0x32df74);});}VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x32')]=function(_0x3458c1){return _0x3458c1!==null&&!_[_0xebdb('0x33')](_0x3458c1);};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x34')]=function(_0x4a164b,_0x3c6e4d,_0x50bef2){io['to'](_0x4a164b)[_0xebdb('0x34')](_0x3c6e4d,_0x50bef2);};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x35')]=function(_0x1bf4a4){try{if(this['isNotNull'](_0x1bf4a4)){if(_0x1bf4a4['uniqueid']===_0x1bf4a4['linkedid']){if(!_[_0xebdb('0x33')](this['channels'][_0x1bf4a4[_0xebdb('0x36')]])){_[_0xebdb('0x37')](this[_0xebdb('0x19')][_0x1bf4a4[_0xebdb('0x36')]],_[_0xebdb('0x38')](_0x1bf4a4,_[_0xebdb('0x39')](this[_0xebdb('0x19')][_0x1bf4a4[_0xebdb('0x36')]])));}}}}catch(_0x25c212){logger[_0xebdb('0x3a')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x25c212,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x1f')]=function(_0x289c57){try{if(this[_0xebdb('0x32')](_0x289c57)){if(_0x289c57[_0xebdb('0x36')]===_0x289c57['linkedid']&&_0x289c57[_0xebdb('0x3b')]!=_0xebdb('0x3c')){if(_[_0xebdb('0x33')](this['channels'][_0x289c57[_0xebdb('0x36')]])){this[_0xebdb('0x19')][_0x289c57[_0xebdb('0x36')]]=new Channel();this[_0xebdb('0x19')][_0x289c57[_0xebdb('0x36')]]['starttime']=moment()['format'](_0xebdb('0x3d'));this['channels'][_0x289c57[_0xebdb('0x36')]][_0xebdb('0x3e')]=dispositions[_[_0xebdb('0x3f')](_0x289c57[_0xebdb('0x40')])];_[_0xebdb('0x37')](this['channels'][_0x289c57[_0xebdb('0x36')]],_['pick'](_0x289c57,_['keys'](this['channels'][_0x289c57['uniqueid']])));if(_0x289c57['context']===_0xebdb('0x41')){if(this[_0xebdb('0x1a')][_0x289c57[_0xebdb('0x3b')]['split']('-')[0x0]]){this[_0xebdb('0x1a')][_0x289c57[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]]['destconnectedlinenum']=_0x289c57[_0xebdb('0x43')];this[_0xebdb('0x34')](util[_0xebdb('0x44')]('user:%s',this[_0xebdb('0x1a')][_0x289c57[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]][_0xebdb('0x45')]),_0xebdb('0x46'),{'destaccountcode':this[_0xebdb('0x1a')][_0x289c57[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]][_0xebdb('0x47')],'destconnectedlinenum':_0x289c57[_0xebdb('0x43')]});}}}}}}catch(_0x13cd8e){logger['error'](_0xebdb('0x48'),util[_0xebdb('0x49')](_0x13cd8e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x1c')]=function(_0x1325f8){try{if(this[_0xebdb('0x32')](_0x1325f8)){if(_0x1325f8[_0xebdb('0x36')]===_0x1325f8[_0xebdb('0x4a')]&&_0x1325f8[_0xebdb('0x43')]!='h'&&_0x1325f8[_0xebdb('0x3b')]!=_0xebdb('0x3c')){_0x1325f8[_0xebdb('0x4b')]=_0x1325f8[_0xebdb('0x4b')][_0xebdb('0x4c')]();_0x1325f8[_0xebdb('0x4d')]=(_0x1325f8[_0xebdb('0x4e')]||_0x1325f8[_0xebdb('0x4d')])[_0xebdb('0x4c')]();if(_['isUndefined'](this[_0xebdb('0x19')][_0x1325f8[_0xebdb('0x36')]])){this[_0xebdb('0x19')][_0x1325f8[_0xebdb('0x36')]]=new Channel();this[_0xebdb('0x19')][_0x1325f8[_0xebdb('0x36')]][_0xebdb('0x4f')]=_0x1325f8[_0xebdb('0x50')]?moment()['subtract'](moment['duration'](_0x1325f8[_0xebdb('0x50')])[_0xebdb('0x51')](),_0xebdb('0x51'))[_0xebdb('0x44')](_0xebdb('0x3d')):moment()[_0xebdb('0x44')](_0xebdb('0x3d'));this[_0xebdb('0x19')][_0x1325f8[_0xebdb('0x36')]][_0xebdb('0x3e')]=_0xebdb('0x12');}_[_0xebdb('0x37')](this[_0xebdb('0x19')][_0x1325f8[_0xebdb('0x36')]],_[_0xebdb('0x38')](_0x1325f8,_['keys'](this[_0xebdb('0x19')][_0x1325f8[_0xebdb('0x36')]])));if(_[_0xebdb('0x52')](applications,_0x1325f8['application'])){this['channels'][_0x1325f8[_0xebdb('0x36')]][_0xebdb('0x53')]=_0x1325f8['application'];this[_0xebdb('0x19')][_0x1325f8['uniqueid']][_0xebdb('0x54')]=_0x1325f8[_0xebdb('0x4d')];if(_0x1325f8[_0xebdb('0x4b')]===_0xebdb('0x55')&&_['startsWith'](_0x1325f8['applicationdata'],_0xebdb('0x56'))){var _0x8c3d1f=_0x1325f8[_0xebdb('0x4d')][_0xebdb('0x42')]('=');var _0x1eddf7=_0x8c3d1f[0x0][_0xebdb('0x57')](/cdr\((.*)\)/);if(_0x1eddf7){this[_0xebdb('0x19')][_0x1325f8[_0xebdb('0x36')]][_0x1eddf7[0x1]]=_0x8c3d1f[0x1];}}else if(_0x1325f8[_0xebdb('0x4b')]===_0xebdb('0x58')){this[_0xebdb('0x19')][_0x1325f8['uniqueid']][_0xebdb('0x58')]=_0x1325f8[_0xebdb('0x4d')][_0xebdb('0x42')](',')[0x0];}}}}}catch(_0x338b06){logger[_0xebdb('0x3a')](_0xebdb('0x59'),util[_0xebdb('0x49')](_0x338b06,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x5a')]=function(_0x184965){try{if(this[_0xebdb('0x32')](_0x184965)){if(_0x184965[_0xebdb('0x36')]!==_0x184965[_0xebdb('0x4a')]){if(this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]]){if(_0x184965['channelstate']==='6'){if(!this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]][_0xebdb('0x5b')]){var _0x2b4c9a=moment();this[_0xebdb('0x19')][_0x184965['linkedid']][_0xebdb('0x5b')]=!![];this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]][_0xebdb('0x5c')]=_0x2b4c9a[_0xebdb('0x44')](_0xebdb('0x3d'));if(this[_0xebdb('0x19')][_0x184965['linkedid']]['starttime']){this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]]['holdtime']=_0x2b4c9a['diff'](this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]][_0xebdb('0x4f')],_0xebdb('0x51'));}}this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]]['linkedid']=_0x184965[_0xebdb('0x36')];if(_0x184965[_0xebdb('0x5d')]!==_0xebdb('0x5e')){this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]][_0xebdb('0x5f')]=_0x184965[_0xebdb('0x5d')];}this['channels'][_0x184965['linkedid']][_0xebdb('0x60')]=_0x184965[_0xebdb('0x61')];this[_0xebdb('0x19')][_0x184965['linkedid']][_0xebdb('0x62')]=_0x184965['channel'];this[_0xebdb('0x19')][_0x184965['linkedid']][_0xebdb('0x3e')]=dispositions[_[_0xebdb('0x3f')](_0x184965[_0xebdb('0x40')])];if(this['agents'][_0x184965[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]]){this['channels'][_0x184965[_0xebdb('0x4a')]]['UserId']=this[_0xebdb('0x1a')][_0x184965[_0xebdb('0x3b')]['split']('-')[0x0]]['id'];this[_0xebdb('0x19')][_0x184965[_0xebdb('0x4a')]][_0xebdb('0x63')]=this['agents'][_0x184965[_0xebdb('0x3b')]['split']('-')[0x0]][_0xebdb('0x45')];}}}}else{if(this[_0xebdb('0x19')][_0x184965[_0xebdb('0x36')]]){if(_0x184965['channelstate']==='6'){if(this[_0xebdb('0x1a')][_0x184965[_0xebdb('0x3b')]['split']('-')[0x0]]){this['channels'][_0x184965[_0xebdb('0x36')]]['UserId']=this['agents'][_0x184965[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]]['id'];this[_0xebdb('0x19')][_0x184965['uniqueid']]['membername']=this['agents'][_0x184965[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]][_0xebdb('0x45')];}}}}}}catch(_0xfb8e37){logger[_0xebdb('0x3a')](_0xebdb('0x64'),util['inspect'](_0xfb8e37,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x65')]=function(_0x3980bd,_0x241718){if(this['channels'][_0x3980bd]){this[_0xebdb('0x19')][_0x3980bd][_0xebdb('0x66')]=!![];if(_['endsWith'](_0x241718,'.wav49')){_0x241718=_0x241718[_0xebdb('0x67')](_0xebdb('0x68'),'.WAV');}this[_0xebdb('0x19')][_0x3980bd]['monitorFilename']=_0x241718;var _0x4a2d2a=_[_0xebdb('0x69')](this['channels'][_0x3980bd][_0xebdb('0x6a')],{'filename':_0x241718});if(_[_0xebdb('0x6b')](_0x4a2d2a)){this[_0xebdb('0x19')][_0x3980bd][_0xebdb('0x6a')][_0xebdb('0x6c')]({'filename':_0x241718,'createdAt':moment()[_0xebdb('0x44')](_0xebdb('0x3d')),'mixmonitorid':'','status':_0xebdb('0x6d')});}}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x21')]=function(_0x5a6c94){try{if(this['isNotNull'](_0x5a6c94)){if(this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x36')]]&&_0x5a6c94[_0xebdb('0x3b')]!=_0xebdb('0x3c')){if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')])){if(this['isNotNull'](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x6f')])){this['syncMixMonitorFilename'](_0x5a6c94['uniqueid'],_0x5a6c94['value']);}else if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x70')])){this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x36')]][_0xebdb('0x5d')]=_0x5a6c94[_0xebdb('0x71')];}else if(this['isNotNull'](_0x5a6c94['variable'][_0xebdb('0x72')])){this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x36')]][_0xebdb('0x73')]=_0x5a6c94[_0xebdb('0x71')];}else if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')]['xmd-cdrtype'])){this['channels'][_0x5a6c94[_0xebdb('0x36')]][_0xebdb('0x74')]=_0x5a6c94['value'];}else if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x75')])){this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x36')]][_0xebdb('0x58')]=_0x5a6c94[_0xebdb('0x71')][_0xebdb('0x42')](',')[0x0];}else if(this['isNotNull'](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x76')])){this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x36')]][_0xebdb('0x77')]=_0x5a6c94[_0xebdb('0x71')];}else if(this['isNotNull'](_0x5a6c94[_0xebdb('0x6e')]['xmd-destination'])){this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x36')]][_0xebdb('0x78')]=_0x5a6c94[_0xebdb('0x71')];}else if(this[_0xebdb('0x32')](_0x5a6c94['variable'][_0xebdb('0x79')])){this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x36')]]['calleridpreview']=_0x5a6c94[_0xebdb('0x71')];}else if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x7a')])){this[_0xebdb('0x19')][_0x5a6c94['uniqueid']][_0xebdb('0x58')]=_0x5a6c94[_0xebdb('0x71')];}else if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x7b')])){this[_0xebdb('0x19')][_0x5a6c94['uniqueid']][_0xebdb('0x7c')]=_0x5a6c94[_0xebdb('0x71')];}}}else if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x6f')])){if(_0x5a6c94[_0xebdb('0x71')]){var _0x2b199f=path['parse'](_0x5a6c94['value'])[_0xebdb('0x45')];this[_0xebdb('0x65')](_0x2b199f,_0x5a6c94[_0xebdb('0x71')]);}}else if(this[_0xebdb('0x19')][_0x5a6c94[_0xebdb('0x4a')]]){if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')])){if(this[_0xebdb('0x32')](_0x5a6c94[_0xebdb('0x6e')][_0xebdb('0x7b')])){this[_0xebdb('0x19')][_0x5a6c94['linkedid']][_0xebdb('0x7d')]=_0x5a6c94[_0xebdb('0x71')];}}}}}catch(_0x1c8fc4){logger[_0xebdb('0x3a')](_0xebdb('0x7e'),util[_0xebdb('0x49')](_0x1c8fc4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x24')]=function(_0xa4817b){try{if(this[_0xebdb('0x32')](_0xa4817b)){if(this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]]){var _0xe87a4=moment();this[_0xebdb('0x19')][_0xa4817b['uniqueid']][_0xebdb('0x7f')]=_0xe87a4['format'](_0xebdb('0x3d'));this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]][_0xebdb('0x50')]=_0xe87a4[_0xebdb('0x80')](this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]]['starttime'],_0xebdb('0x51'));if(this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]][_0xebdb('0x5b')]){this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]][_0xebdb('0x81')]=_0xe87a4[_0xebdb('0x80')](this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]][_0xebdb('0x5c')],'seconds');this['channels'][_0xa4817b[_0xebdb('0x36')]][_0xebdb('0x82')]=this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]][_0xebdb('0x50')]-this[_0xebdb('0x19')][_0xa4817b['uniqueid']][_0xebdb('0x81')];}if(_0xa4817b[_0xebdb('0x83')]===_0xebdb('0x41')){if(this[_0xebdb('0x1a')][_0xa4817b['channel']['split']('-')[0x0]]){this[_0xebdb('0x1a')][_0xa4817b[_0xebdb('0x3b')]['split']('-')[0x0]]=_[_0xebdb('0x84')](this[_0xebdb('0x1a')][_0xa4817b[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]],[_0xebdb('0x85')]);this[_0xebdb('0x34')](util[_0xebdb('0x44')](_0xebdb('0x86'),this[_0xebdb('0x1a')][_0xa4817b[_0xebdb('0x3b')]['split']('-')[0x0]][_0xebdb('0x45')]),'user:agentcomplete',{'destaccountcode':this[_0xebdb('0x1a')][_0xa4817b[_0xebdb('0x3b')][_0xebdb('0x42')]('-')[0x0]][_0xebdb('0x47')]});}}ami[_0xebdb('0x34')]('custom:voiceCallReport',this[_0xebdb('0x19')][_0xa4817b['uniqueid']]);delete this[_0xebdb('0x19')][_0xa4817b[_0xebdb('0x36')]];}}}catch(_0x7d55d){logger[_0xebdb('0x3a')]('[syncHangup][VoiceCallReport]',util[_0xebdb('0x49')](_0x7d55d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x26')]=function(_0x4def91){try{if(this[_0xebdb('0x32')](_0x4def91)){if(this[_0xebdb('0x19')][_0x4def91['transfereeuniqueid']]){this[_0xebdb('0x19')][_0x4def91[_0xebdb('0x87')]][_0xebdb('0x88')]=_0x4def91[_0xebdb('0x89')];this[_0xebdb('0x19')][_0x4def91[_0xebdb('0x87')]][_0xebdb('0x8a')]=_0x4def91['transfertargetcalleridnum'];if(this[_0xebdb('0x19')][_0x4def91['secondtransfereruniqueid']]){var _0x19b77e=this[_0xebdb('0x19')][_0x4def91['secondtransfereruniqueid']];this['channels'][_0x4def91['secondtransfereruniqueid']]=this['channels'][_0x4def91[_0xebdb('0x87')]];this['channels'][_0x4def91[_0xebdb('0x87')]]=_0x19b77e;}}else if(this['channels'][_0x4def91[_0xebdb('0x8b')]]){this[_0xebdb('0x19')][_0x4def91['transfertargetuniqueid']][_0xebdb('0x88')]=_0x4def91[_0xebdb('0x89')];this[_0xebdb('0x19')][_0x4def91[_0xebdb('0x8b')]][_0xebdb('0x8a')]=_0x4def91[_0xebdb('0x8c')];if(this['channels'][_0x4def91['origtransfereruniqueid']]){var _0x19b77e=this[_0xebdb('0x19')][_0x4def91[_0xebdb('0x8d')]];this[_0xebdb('0x19')][_0x4def91[_0xebdb('0x8d')]]=this[_0xebdb('0x19')][_0x4def91['transfertargetuniqueid']];this[_0xebdb('0x19')][_0x4def91[_0xebdb('0x8b')]]=_0x19b77e;}}}}catch(_0x5a6e39){logger[_0xebdb('0x3a')](_0xebdb('0x8e'),util[_0xebdb('0x49')](_0x5a6e39,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')]['syncBlindTransfer']=function(_0x4b0708){try{if(this[_0xebdb('0x32')](_0x4b0708)){if(this['channels'][_0x4b0708['transfereeuniqueid']]){this[_0xebdb('0x19')][_0x4b0708[_0xebdb('0x87')]][_0xebdb('0x88')]=_0x4b0708[_0xebdb('0x8f')];this[_0xebdb('0x19')][_0x4b0708[_0xebdb('0x87')]]['transferconnectedlinenum']=_0x4b0708[_0xebdb('0x90')];this[_0xebdb('0x24')]({'event':'BlindTransfer','uniqueid':_0x4b0708[_0xebdb('0x87')],'context':_0x4b0708[_0xebdb('0x83')],'channel':_0x4b0708[_0xebdb('0x91')]});}}}catch(_0x48fb40){logger[_0xebdb('0x3a')](_0xebdb('0x92'),util[_0xebdb('0x49')](_0x48fb40,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xebdb('0x31')][_0xebdb('0x2a')]=function(_0x2b2c20){try{if(this[_0xebdb('0x32')](_0x2b2c20)){if(this['channels'][_0x2b2c20[_0xebdb('0x36')]]){if(!_[_0xebdb('0x6b')](this[_0xebdb('0x19')][_0x2b2c20['uniqueid']][_0xebdb('0x5c')])){this['channels'][_0x2b2c20['uniqueid']][_0xebdb('0x93')]=moment()[_0xebdb('0x44')](_0xebdb('0x3d'));}}}}catch(_0xecceea){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0xebdb('0x49')](_0xecceea,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xebdb('0x2b')]=function(_0x197081){try{if(this[_0xebdb('0x32')](_0x197081)){if(this[_0xebdb('0x19')][_0x197081[_0xebdb('0x36')]]){if(!_[_0xebdb('0x6b')](this['channels'][_0x197081[_0xebdb('0x36')]][_0xebdb('0x93')])){this[_0xebdb('0x19')][_0x197081['uniqueid']][_0xebdb('0x94')]+=moment()[_0xebdb('0x95')](0x0)[_0xebdb('0x80')](this['channels'][_0x197081[_0xebdb('0x36')]][_0xebdb('0x93')],_0xebdb('0x51'));delete this['channels'][_0x197081[_0xebdb('0x36')]]['mohstarttime'];}}}}catch(_0x269614){logger[_0xebdb('0x3a')](_0xebdb('0x96'),util['inspect'](_0x269614,{'showHidden':![],'depth':null}));}};module[_0xebdb('0x97')]=VoiceCallReport; \ No newline at end of file +var _0x2e30=['rec','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','type','xmd-queue','originatecalleridnum','destination','calleridpreview','xmcs-queue','sipcallid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds','user:agentcomplete','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','BlindTransfer','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','ioredis','../../../config/environment','../../../config/logger','ami','../ami','unknown','inuse','invalid','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','emit','isNotNull','uniqueid','linkedid','isUndefined','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','OutgoingSpoolFailed','starttime','disposition','toNumber','channelstate','context','from-sip','channel','split','destconnectedlinenum','format','user:%s','name','user:agentconnect','accountcode','exten','[syncNewChannel][VoiceCallReport]','inspect','syncNewExten','toLowerCase','applicationdata','appdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','application','lastapplication','lastdata','cdr(','match','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','.WAV','monitorFilename','find','monitors','isNil','push'];(function(_0x5e8f78,_0x4f98d1){var _0x4b6f17=function(_0x3ba2b1){while(--_0x3ba2b1){_0x5e8f78['push'](_0x5e8f78['shift']());}};_0x4b6f17(++_0x4f98d1);}(_0x2e30,0x1e3));var _0x02e3=function(_0xc5baf7,_0x2f0ed1){_0xc5baf7=_0xc5baf7-0x0;var _0x4b0a0d=_0x2e30[_0xc5baf7];return _0x4b0a0d;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require('moment');var util=require('util');var path=require('path');var Redis=require(_0x02e3('0x0'));var config=require(_0x02e3('0x1'));var logger=require(_0x02e3('0x2'))(_0x02e3('0x3'));var ami=require(_0x02e3('0x4'));var Channel=require('../model/channel');var statusDesc=[_0x02e3('0x5'),'not_inuse',_0x02e3('0x6'),'busy',_0x02e3('0x7'),'unavailable',_0x02e3('0x8'),'ringinuse',_0x02e3('0x9')];var applications=[_0x02e3('0xa'),_0x02e3('0xb'),_0x02e3('0xc'),_0x02e3('0xd'),_0x02e3('0xe'),_0x02e3('0xf')];var dispositions=[_0x02e3('0x10'),_0x02e3('0x11'),_0x02e3('0x11'),_0x02e3('0x10'),_0x02e3('0x10'),_0x02e3('0x10'),_0x02e3('0x12'),_0x02e3('0x13'),_0x02e3('0x11'),_0x02e3('0x11'),_0x02e3('0x11')];var actions={};config[_0x02e3('0x14')]=_[_0x02e3('0x15')](config[_0x02e3('0x14')],{'host':_0x02e3('0x16'),'port':0x18eb});var io=require(_0x02e3('0x17'))(new Redis(config[_0x02e3('0x14')]));function VoiceCallReport(_0x3870ef){this[_0x02e3('0x18')]=_0x3870ef[_0x02e3('0x18')];this[_0x02e3('0x19')]=_0x3870ef[_0x02e3('0x19')];ami['on'](_0x02e3('0x1a'),this['syncNewExten']['bind'](this));ami['on'](_0x02e3('0x1b'),this['syncNewExten'][_0x02e3('0x1c')](this));ami['on'](_0x02e3('0x1d'),this[_0x02e3('0x1e')]['bind'](this));ami['on'](_0x02e3('0x1f'),this[_0x02e3('0x20')][_0x02e3('0x1c')](this));ami['on'](_0x02e3('0x21'),this[_0x02e3('0x22')][_0x02e3('0x1c')](this));ami['on'](_0x02e3('0x23'),this[_0x02e3('0x24')][_0x02e3('0x1c')](this));ami['on']('newcallerid',this[_0x02e3('0x25')][_0x02e3('0x1c')](this));ami['on']('attendedtransfer',this[_0x02e3('0x26')]['bind'](this));ami['on'](_0x02e3('0x27'),this[_0x02e3('0x28')][_0x02e3('0x1c')](this));ami['on'](_0x02e3('0x29'),this[_0x02e3('0x2a')][_0x02e3('0x1c')](this));ami['on'](_0x02e3('0x2b'),this[_0x02e3('0x2c')][_0x02e3('0x1c')](this));return BPromise[_0x02e3('0x2d')]()[_0x02e3('0x2e')](ami[_0x02e3('0x2f')]())[_0x02e3('0x30')](function(_0x59a8a6){console[_0x02e3('0x31')](_0x59a8a6);});}VoiceCallReport[_0x02e3('0x32')]['isNotNull']=function(_0x396ee9){return _0x396ee9!==null&&!_['isUndefined'](_0x396ee9);};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x33')]=function(_0x14d0c6,_0x2988cd,_0x4c2cd7){io['to'](_0x14d0c6)[_0x02e3('0x33')](_0x2988cd,_0x4c2cd7);};VoiceCallReport['prototype'][_0x02e3('0x25')]=function(_0x23cf91){try{if(this[_0x02e3('0x34')](_0x23cf91)){if(_0x23cf91[_0x02e3('0x35')]===_0x23cf91[_0x02e3('0x36')]){if(!_[_0x02e3('0x37')](this[_0x02e3('0x18')][_0x23cf91['uniqueid']])){_[_0x02e3('0x38')](this[_0x02e3('0x18')][_0x23cf91[_0x02e3('0x35')]],_[_0x02e3('0x39')](_0x23cf91,_[_0x02e3('0x3a')](this[_0x02e3('0x18')][_0x23cf91[_0x02e3('0x35')]])));}}}}catch(_0x53a4fe){logger[_0x02e3('0x3b')](_0x02e3('0x3c'),util['inspect'](_0x53a4fe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x1e')]=function(_0x44332d){try{if(this[_0x02e3('0x34')](_0x44332d)){if(_0x44332d[_0x02e3('0x35')]===_0x44332d['linkedid']&&_0x44332d['channel']!=_0x02e3('0x3d')){if(_['isUndefined'](this[_0x02e3('0x18')][_0x44332d[_0x02e3('0x35')]])){this[_0x02e3('0x18')][_0x44332d['uniqueid']]=new Channel();this[_0x02e3('0x18')][_0x44332d['uniqueid']][_0x02e3('0x3e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x44332d['uniqueid']][_0x02e3('0x3f')]=dispositions[_[_0x02e3('0x40')](_0x44332d[_0x02e3('0x41')])];_['merge'](this[_0x02e3('0x18')][_0x44332d[_0x02e3('0x35')]],_[_0x02e3('0x39')](_0x44332d,_[_0x02e3('0x3a')](this[_0x02e3('0x18')][_0x44332d[_0x02e3('0x35')]])));if(_0x44332d[_0x02e3('0x42')]===_0x02e3('0x43')){if(this[_0x02e3('0x19')][_0x44332d[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]]){this['agents'][_0x44332d[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]][_0x02e3('0x46')]=_0x44332d['exten'];this[_0x02e3('0x33')](util[_0x02e3('0x47')](_0x02e3('0x48'),this['agents'][_0x44332d[_0x02e3('0x44')]['split']('-')[0x0]][_0x02e3('0x49')]),_0x02e3('0x4a'),{'destaccountcode':this[_0x02e3('0x19')][_0x44332d[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]][_0x02e3('0x4b')],'destconnectedlinenum':_0x44332d[_0x02e3('0x4c')]});}}}}}}catch(_0x438df9){logger[_0x02e3('0x3b')](_0x02e3('0x4d'),util[_0x02e3('0x4e')](_0x438df9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x4f')]=function(_0x15478a){try{if(this[_0x02e3('0x34')](_0x15478a)){if(_0x15478a['uniqueid']===_0x15478a[_0x02e3('0x36')]&&_0x15478a[_0x02e3('0x4c')]!='h'&&_0x15478a[_0x02e3('0x44')]!='OutgoingSpoolFailed'){_0x15478a['application']=_0x15478a['application'][_0x02e3('0x50')]();_0x15478a[_0x02e3('0x51')]=(_0x15478a[_0x02e3('0x52')]||_0x15478a[_0x02e3('0x51')])[_0x02e3('0x50')]();if(_[_0x02e3('0x37')](this['channels'][_0x15478a[_0x02e3('0x35')]])){this['channels'][_0x15478a['uniqueid']]=new Channel();this[_0x02e3('0x18')][_0x15478a[_0x02e3('0x35')]]['starttime']=_0x15478a[_0x02e3('0x53')]?moment()[_0x02e3('0x54')](moment[_0x02e3('0x53')](_0x15478a[_0x02e3('0x53')])[_0x02e3('0x55')](),_0x02e3('0x55'))[_0x02e3('0x47')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0x02e3('0x56'));this['channels'][_0x15478a['uniqueid']][_0x02e3('0x3f')]='NO\x20ANSWER';}_[_0x02e3('0x38')](this[_0x02e3('0x18')][_0x15478a[_0x02e3('0x35')]],_[_0x02e3('0x39')](_0x15478a,_['keys'](this[_0x02e3('0x18')][_0x15478a[_0x02e3('0x35')]])));if(_[_0x02e3('0x57')](applications,_0x15478a[_0x02e3('0x58')])){this['channels'][_0x15478a[_0x02e3('0x35')]][_0x02e3('0x59')]=_0x15478a[_0x02e3('0x58')];this[_0x02e3('0x18')][_0x15478a[_0x02e3('0x35')]][_0x02e3('0x5a')]=_0x15478a['applicationdata'];if(_0x15478a[_0x02e3('0x58')]===_0x02e3('0xa')&&_['startsWith'](_0x15478a[_0x02e3('0x51')],_0x02e3('0x5b'))){var _0x143a73=_0x15478a[_0x02e3('0x51')]['split']('=');var _0x172d1b=_0x143a73[0x0][_0x02e3('0x5c')](/cdr\((.*)\)/);if(_0x172d1b){this[_0x02e3('0x18')][_0x15478a[_0x02e3('0x35')]][_0x172d1b[0x1]]=_0x143a73[0x1];}}else if(_0x15478a[_0x02e3('0x58')]===_0x02e3('0xb')){this[_0x02e3('0x18')][_0x15478a[_0x02e3('0x35')]][_0x02e3('0xb')]=_0x15478a[_0x02e3('0x51')]['split'](',')[0x0];}}}}}catch(_0x29cd1f){logger[_0x02e3('0x3b')](_0x02e3('0x5d'),util[_0x02e3('0x4e')](_0x29cd1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x20')]=function(_0x1ab694){try{if(this[_0x02e3('0x34')](_0x1ab694)){if(_0x1ab694[_0x02e3('0x35')]!==_0x1ab694[_0x02e3('0x36')]){if(this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x36')]]){if(_0x1ab694[_0x02e3('0x41')]==='6'){if(!this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x5e')]){var _0x3cb93b=moment();this['channels'][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x5e')]=!![];this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x5f')]=_0x3cb93b['format'](_0x02e3('0x56'));if(this['channels'][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x3e')]){this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x60')]=_0x3cb93b[_0x02e3('0x61')](this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x3e')],_0x02e3('0x55'));}}this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x36')]=_0x1ab694[_0x02e3('0x35')];if(_0x1ab694[_0x02e3('0x62')]!=='xcally-motion-preview'){this[_0x02e3('0x18')][_0x1ab694['linkedid']]['connectedlinenum']=_0x1ab694[_0x02e3('0x62')];}this['channels'][_0x1ab694[_0x02e3('0x36')]]['connectedlinename']=_0x1ab694[_0x02e3('0x63')];this['channels'][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x64')]=_0x1ab694[_0x02e3('0x44')];this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x36')]][_0x02e3('0x3f')]=dispositions[_['toNumber'](_0x1ab694[_0x02e3('0x41')])];if(this['agents'][_0x1ab694[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]]){this[_0x02e3('0x18')][_0x1ab694['linkedid']][_0x02e3('0x65')]=this['agents'][_0x1ab694[_0x02e3('0x44')]['split']('-')[0x0]]['id'];this['channels'][_0x1ab694['linkedid']]['membername']=this[_0x02e3('0x19')][_0x1ab694[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]]['name'];}}}}else{if(this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x35')]]){if(_0x1ab694[_0x02e3('0x41')]==='6'){if(this[_0x02e3('0x19')][_0x1ab694[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]]){this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x35')]][_0x02e3('0x65')]=this['agents'][_0x1ab694[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]]['id'];this[_0x02e3('0x18')][_0x1ab694[_0x02e3('0x35')]][_0x02e3('0x66')]=this[_0x02e3('0x19')][_0x1ab694[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]][_0x02e3('0x49')];}}}}}}catch(_0xfeb5c3){logger[_0x02e3('0x3b')](_0x02e3('0x67'),util['inspect'](_0xfeb5c3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x68')]=function(_0x3ce78f,_0x75ab0c){if(this[_0x02e3('0x18')][_0x3ce78f]){this['channels'][_0x3ce78f]['monitor']=!![];if(_[_0x02e3('0x69')](_0x75ab0c,_0x02e3('0x6a'))){_0x75ab0c=_0x75ab0c['replace'](_0x02e3('0x6a'),_0x02e3('0x6b'));}this[_0x02e3('0x18')][_0x3ce78f][_0x02e3('0x6c')]=_0x75ab0c;var _0x1a4d52=_[_0x02e3('0x6d')](this[_0x02e3('0x18')][_0x3ce78f][_0x02e3('0x6e')],{'filename':_0x75ab0c});if(_[_0x02e3('0x6f')](_0x1a4d52)){this[_0x02e3('0x18')][_0x3ce78f][_0x02e3('0x6e')][_0x02e3('0x70')]({'filename':_0x75ab0c,'createdAt':moment()[_0x02e3('0x47')](_0x02e3('0x56')),'mixmonitorid':'','status':_0x02e3('0x71')});}}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x22')]=function(_0x6a956c){try{if(this[_0x02e3('0x34')](_0x6a956c)){if(this['channels'][_0x6a956c[_0x02e3('0x35')]]&&_0x6a956c[_0x02e3('0x44')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x6a956c[_0x02e3('0x72')])){if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')][_0x02e3('0x73')])){this[_0x02e3('0x68')](_0x6a956c[_0x02e3('0x35')],_0x6a956c['value']);}else if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')][_0x02e3('0x74')])){this['channels'][_0x6a956c['uniqueid']][_0x02e3('0x62')]=_0x6a956c[_0x02e3('0x75')];}else if(this['isNotNull'](_0x6a956c['variable'][_0x02e3('0x76')])){this[_0x02e3('0x18')][_0x6a956c[_0x02e3('0x35')]][_0x02e3('0x77')]=_0x6a956c[_0x02e3('0x75')];}else if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')]['xmd-cdrtype'])){this[_0x02e3('0x18')][_0x6a956c[_0x02e3('0x35')]][_0x02e3('0x78')]=_0x6a956c[_0x02e3('0x75')];}else if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')][_0x02e3('0x79')])){this[_0x02e3('0x18')][_0x6a956c['uniqueid']][_0x02e3('0xb')]=_0x6a956c[_0x02e3('0x75')][_0x02e3('0x45')](',')[0x0];}else if(this[_0x02e3('0x34')](_0x6a956c['variable']['xmd-originatecalleridnum'])){this[_0x02e3('0x18')][_0x6a956c[_0x02e3('0x35')]][_0x02e3('0x7a')]=_0x6a956c[_0x02e3('0x75')];}else if(this[_0x02e3('0x34')](_0x6a956c['variable']['xmd-destination'])){this[_0x02e3('0x18')][_0x6a956c[_0x02e3('0x35')]][_0x02e3('0x7b')]=_0x6a956c['value'];}else if(this['isNotNull'](_0x6a956c[_0x02e3('0x72')]['xmd-callerid-preview'])){this[_0x02e3('0x18')][_0x6a956c[_0x02e3('0x35')]][_0x02e3('0x7c')]=_0x6a956c[_0x02e3('0x75')];}else if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')][_0x02e3('0x7d')])){this[_0x02e3('0x18')][_0x6a956c[_0x02e3('0x35')]][_0x02e3('0xb')]=_0x6a956c[_0x02e3('0x75')];}else if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')][_0x02e3('0x7e')])){this[_0x02e3('0x18')][_0x6a956c['uniqueid']]['sipcalluniqueid']=_0x6a956c['value'];}}}else if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')][_0x02e3('0x73')])){if(_0x6a956c[_0x02e3('0x75')]){var _0x57f977=path[_0x02e3('0x7f')](_0x6a956c[_0x02e3('0x75')])[_0x02e3('0x49')];this[_0x02e3('0x68')](_0x57f977,_0x6a956c[_0x02e3('0x75')]);}}else if(this[_0x02e3('0x18')][_0x6a956c[_0x02e3('0x36')]]){if(this[_0x02e3('0x34')](_0x6a956c[_0x02e3('0x72')])){if(this[_0x02e3('0x34')](_0x6a956c['variable']['sipcallid'])){this[_0x02e3('0x18')][_0x6a956c['linkedid']][_0x02e3('0x80')]=_0x6a956c[_0x02e3('0x75')];}}}}}catch(_0x814aaf){logger[_0x02e3('0x3b')](_0x02e3('0x81'),util[_0x02e3('0x4e')](_0x814aaf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x24')]=function(_0x509828){try{if(this['isNotNull'](_0x509828)){if(this[_0x02e3('0x18')][_0x509828['uniqueid']]){var _0x44c160=moment();this[_0x02e3('0x18')][_0x509828[_0x02e3('0x35')]]['endtime']=_0x44c160[_0x02e3('0x47')](_0x02e3('0x56'));this[_0x02e3('0x18')][_0x509828[_0x02e3('0x35')]]['duration']=_0x44c160[_0x02e3('0x61')](this[_0x02e3('0x18')][_0x509828['uniqueid']][_0x02e3('0x3e')],'seconds');if(this[_0x02e3('0x18')][_0x509828[_0x02e3('0x35')]][_0x02e3('0x5e')]){this['channels'][_0x509828['uniqueid']][_0x02e3('0x82')]=_0x44c160[_0x02e3('0x61')](this['channels'][_0x509828[_0x02e3('0x35')]][_0x02e3('0x5f')],_0x02e3('0x55'));this[_0x02e3('0x18')][_0x509828[_0x02e3('0x35')]][_0x02e3('0x60')]=this['channels'][_0x509828[_0x02e3('0x35')]]['duration']-this[_0x02e3('0x18')][_0x509828[_0x02e3('0x35')]][_0x02e3('0x82')];}if(_0x509828[_0x02e3('0x42')]===_0x02e3('0x43')){if(this[_0x02e3('0x19')][_0x509828['channel'][_0x02e3('0x45')]('-')[0x0]]){this['agents'][_0x509828['channel'][_0x02e3('0x45')]('-')[0x0]]=_['omit'](this['agents'][_0x509828['channel'][_0x02e3('0x45')]('-')[0x0]],['destconnectedlinenum']);this[_0x02e3('0x33')](util[_0x02e3('0x47')](_0x02e3('0x48'),this[_0x02e3('0x19')][_0x509828[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]][_0x02e3('0x49')]),_0x02e3('0x83'),{'destaccountcode':this[_0x02e3('0x19')][_0x509828[_0x02e3('0x44')][_0x02e3('0x45')]('-')[0x0]]['accountcode']});}}ami[_0x02e3('0x33')]('custom:voiceCallReport',this['channels'][_0x509828[_0x02e3('0x35')]]);delete this['channels'][_0x509828[_0x02e3('0x35')]];}}}catch(_0x236591){logger[_0x02e3('0x3b')](_0x02e3('0x84'),util[_0x02e3('0x4e')](_0x236591,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x26')]=function(_0x5b2936){try{if(this[_0x02e3('0x34')](_0x5b2936)){if(this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x85')]]){this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x85')]][_0x02e3('0x86')]=_0x5b2936[_0x02e3('0x87')];this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x85')]]['transferconnectedlinenum']=_0x5b2936[_0x02e3('0x88')];if(this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x89')]]){var _0x12bedd=this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x89')]];this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x89')]]=this['channels'][_0x5b2936[_0x02e3('0x85')]];this['channels'][_0x5b2936[_0x02e3('0x85')]]=_0x12bedd;}}else if(this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x8a')]]){this[_0x02e3('0x18')][_0x5b2936['transfertargetuniqueid']][_0x02e3('0x86')]=_0x5b2936[_0x02e3('0x87')];this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x8a')]][_0x02e3('0x8b')]=_0x5b2936['transfertargetcalleridnum'];if(this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x8c')]]){var _0x12bedd=this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x8c')]];this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x8c')]]=this['channels'][_0x5b2936[_0x02e3('0x8a')]];this[_0x02e3('0x18')][_0x5b2936[_0x02e3('0x8a')]]=_0x12bedd;}}}}catch(_0x1f1956){logger[_0x02e3('0x3b')](_0x02e3('0x8d'),util[_0x02e3('0x4e')](_0x1f1956,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x28')]=function(_0x277ad2){try{if(this[_0x02e3('0x34')](_0x277ad2)){if(this['channels'][_0x277ad2[_0x02e3('0x85')]]){this[_0x02e3('0x18')][_0x277ad2[_0x02e3('0x85')]][_0x02e3('0x86')]=_0x277ad2['transfereecalleridnum'];this[_0x02e3('0x18')][_0x277ad2['transfereeuniqueid']][_0x02e3('0x8b')]=_0x277ad2['extension'];this[_0x02e3('0x24')]({'event':_0x02e3('0x8e'),'uniqueid':_0x277ad2[_0x02e3('0x85')],'context':_0x277ad2[_0x02e3('0x42')],'channel':_0x277ad2[_0x02e3('0x8f')]});}}}catch(_0x1d5725){logger[_0x02e3('0x3b')]('[syncBlindTransfer][VoiceCallReport]',util[_0x02e3('0x4e')](_0x1d5725,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')][_0x02e3('0x2a')]=function(_0x54e28e){try{if(this[_0x02e3('0x34')](_0x54e28e)){if(this[_0x02e3('0x18')][_0x54e28e[_0x02e3('0x35')]]){if(!_[_0x02e3('0x6f')](this['channels'][_0x54e28e['uniqueid']]['answertime'])){this[_0x02e3('0x18')][_0x54e28e[_0x02e3('0x35')]][_0x02e3('0x90')]=moment()[_0x02e3('0x47')](_0x02e3('0x56'));}}}}catch(_0x4a7296){logger[_0x02e3('0x3b')](_0x02e3('0x91'),util[_0x02e3('0x4e')](_0x4a7296,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x02e3('0x32')]['syncMusicOnHoldStop']=function(_0x48fedc){try{if(this[_0x02e3('0x34')](_0x48fedc)){if(this[_0x02e3('0x18')][_0x48fedc[_0x02e3('0x35')]]){if(!_[_0x02e3('0x6f')](this[_0x02e3('0x18')][_0x48fedc[_0x02e3('0x35')]][_0x02e3('0x90')])){this[_0x02e3('0x18')][_0x48fedc['uniqueid']]['mohtime']+=moment()[_0x02e3('0x92')](0x0)[_0x02e3('0x61')](this[_0x02e3('0x18')][_0x48fedc[_0x02e3('0x35')]][_0x02e3('0x90')],_0x02e3('0x55'));delete this[_0x02e3('0x18')][_0x48fedc[_0x02e3('0x35')]]['mohstarttime'];}}}}catch(_0x382f91){logger[_0x02e3('0x3b')](_0x02e3('0x93'),util[_0x02e3('0x4e')](_0x382f91,{'showHidden':![],'depth':null}));}};module[_0x02e3('0x94')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 9e26577..ad76087 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 _0xf12b=['syncHangup','prototype','isNotNull','isUndefined','emit','merge','channels','uniqueid','YYYY-MM-DD\x20HH:mm:ss','substring','lastIndexOf','channel','voice:outbound','custom:dialbegin','error','inspect','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','seconds','total','answered','holdtime','starttime','diff','sumHoldTime','sumBillable','billableseconds','sumDuration','custom:dialend','voice_outbound:save','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','varset','syncVarSet','hangup'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xf12b,0x9f));var _0xbf12=function(_0x56414e,_0x565921){_0x56414e=_0x56414e-0x0;var _0xc1dd09=_0xf12b[_0x56414e];return _0xc1dd09;};'use strict';var _=require(_0xbf12('0x0'));var moment=require(_0xbf12('0x1'));var util=require(_0xbf12('0x2'));var Redis=require(_0xbf12('0x3'));var config=require(_0xbf12('0x4'));var logger=require(_0xbf12('0x5'))(_0xbf12('0x6'));var ami=require('../ami');config[_0xbf12('0x7')]=_[_0xbf12('0x8')](config[_0xbf12('0x7')],{'host':_0xbf12('0x9'),'port':0x18eb});var io=require(_0xbf12('0xa'))(new Redis(config[_0xbf12('0x7')]));function VoiceDialReport(_0x47554b){this['channels']=_0x47554b[_0xbf12('0xb')];this['outbound']=_0x47554b[_0xbf12('0xc')];this[_0xbf12('0xd')]={};ami['on'](_0xbf12('0xe'),this[_0xbf12('0xf')][_0xbf12('0x10')](this));ami['on'](_0xbf12('0x11'),this['syncDialEnd'][_0xbf12('0x10')](this));ami['on'](_0xbf12('0x12'),this[_0xbf12('0x13')]['bind'](this));ami['on'](_0xbf12('0x14'),this[_0xbf12('0x15')]['bind'](this));}VoiceDialReport[_0xbf12('0x16')][_0xbf12('0x17')]=function(_0x127fcf){return _0x127fcf!==null&&!_[_0xbf12('0x18')](_0x127fcf);};VoiceDialReport[_0xbf12('0x16')]['emit']=function(_0x54e7f9,_0x5c9fbe,_0x26ef6d){io['to'](_0x54e7f9)[_0xbf12('0x19')](_0x5c9fbe,_0x26ef6d);};VoiceDialReport[_0xbf12('0x16')][_0xbf12('0xf')]=function(_0x322a2a){try{if(this[_0xbf12('0x17')](_0x322a2a)){if(this['channels'][_0x322a2a['uniqueid']]){_[_0xbf12('0x1a')](this[_0xbf12('0x1b')][_0x322a2a[_0xbf12('0x1c')]],{'starttime':moment()['format'](_0xbf12('0x1d')),'lastevent':'called','interface':_0x322a2a['channel'][_0xbf12('0x1e')](0x0,_0x322a2a['channel'][_0xbf12('0x1f')]('-')),'membername':_0x322a2a['channel'][_0xbf12('0x1e')](_0x322a2a[_0xbf12('0x20')]['lastIndexOf']('/')+0x1,_0x322a2a[_0xbf12('0x20')][_0xbf12('0x1f')]('-'))},_['omit'](_0x322a2a,['event','privilege']));this['emit'](_0xbf12('0x21'),'voice_outbound_channel:save',this[_0xbf12('0x1b')][_0x322a2a[_0xbf12('0x1c')]]);ami[_0xbf12('0x19')](_0xbf12('0x22'),this[_0xbf12('0x1b')][_0x322a2a[_0xbf12('0x1c')]]);}}}catch(_0x45d1da){logger[_0xbf12('0x23')]('[syncDialBegin][VoiceDialReport]',util[_0xbf12('0x24')](_0x45d1da,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbf12('0x16')][_0xbf12('0x25')]=function(_0x39acca){try{if(this[_0xbf12('0x17')](_0x39acca)){if(this[_0xbf12('0x1b')][_0x39acca[_0xbf12('0x1c')]]){this[_0xbf12('0x1b')][_0x39acca[_0xbf12('0x1c')]][_0xbf12('0x26')]=_0x39acca[_0xbf12('0x26')];if(_0x39acca['dialstatus']===_0xbf12('0x27')){this['channels'][_0x39acca[_0xbf12('0x1c')]]['connectedlinenum']=_0x39acca[_0xbf12('0x28')];this['channels'][_0x39acca['uniqueid']][_0xbf12('0x29')]=_0x39acca[_0xbf12('0x29')];this[_0xbf12('0x1b')][_0x39acca['uniqueid']][_0xbf12('0x2a')]=moment()[_0xbf12('0x2b')](_0xbf12('0x1d'));this[_0xbf12('0x1b')][_0x39acca[_0xbf12('0x1c')]][_0xbf12('0x2c')]=_0xbf12('0x2d');ami[_0xbf12('0x19')](_0xbf12('0x2e'),this[_0xbf12('0x1b')][_0x39acca[_0xbf12('0x1c')]]);}this[_0xbf12('0x19')](_0xbf12('0x21'),_0xbf12('0x2f'),this[_0xbf12('0x1b')][_0x39acca[_0xbf12('0x1c')]]);}}}catch(_0x1e8c32){logger['error'](_0xbf12('0x30'),util[_0xbf12('0x24')](_0x1e8c32,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xbf12('0x13')]=function(_0x3ade46){try{if(this['isNotNull'](_0x3ade46)){this[_0xbf12('0x31')](_0x3ade46[_0xbf12('0x1c')],_[_0xbf12('0x32')](_0x3ade46[_0xbf12('0x33')])[0x0],_0x3ade46[_0xbf12('0x34')]);if(this[_0xbf12('0x17')](_0x3ade46[_0xbf12('0x33')])&&this['isNotNull'](_0x3ade46['variable']['outboundrouteid'])){if(_[_0xbf12('0x18')](this[_0xbf12('0x1b')][_0x3ade46[_0xbf12('0x1c')]])){this[_0xbf12('0x1b')][_0x3ade46[_0xbf12('0x1c')]]={'routeId':_0x3ade46[_0xbf12('0x34')],'variables':this['variables'][_0x3ade46[_0xbf12('0x1c')]]};this[_0xbf12('0x19')](_0xbf12('0x21'),'voice_outbound_channel:save',this['channels'][_0x3ade46[_0xbf12('0x1c')]]);}}}}catch(_0x1a1bc1){logger[_0xbf12('0x23')](_0xbf12('0x35'),util[_0xbf12('0x24')](_0x1a1bc1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbf12('0x16')][_0xbf12('0x31')]=function(_0xd32990,_0x4beb19,_0x1c61d2){var _0x1e209d=[_0xbf12('0x36'),_0xbf12('0x37'),_0xbf12('0x38'),_0xbf12('0x39'),_0xbf12('0x3a'),_0xbf12('0x3b'),_0xbf12('0x3c'),_0xbf12('0x3d'),_0xbf12('0x3e'),_0xbf12('0x3f'),_0xbf12('0x40'),_0xbf12('0x41'),_0xbf12('0x42'),_0xbf12('0x43'),_0xbf12('0x44'),_0xbf12('0x45'),_0xbf12('0x46'),_0xbf12('0x47'),_0xbf12('0x48')];if(!_[_0xbf12('0x49')](_0x4beb19)&&!_[_0xbf12('0x4a')](_0x1e209d,_0x4beb19)){if(_[_0xbf12('0x18')](this[_0xbf12('0xd')][_0xd32990])){this['variables'][_0xd32990]={};}this[_0xbf12('0xd')][_0xd32990][_0x4beb19]=_0x1c61d2;}};VoiceDialReport[_0xbf12('0x16')][_0xbf12('0x15')]=function(_0x6f78a1){try{if(this['isNotNull'](_0x6f78a1)){if(this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]]){this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x4b')]=moment()[_0xbf12('0x2b')](_0xbf12('0x1d'));this['channels'][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x4c')]=moment(this[_0xbf12('0x1b')][_0x6f78a1['uniqueid']][_0xbf12('0x4b')])['diff'](this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]]['starttime'],_0xbf12('0x4d'));this['channels'][_0x6f78a1[_0xbf12('0x1c')]]['lastevent']='complete';this[_0xbf12('0xc')][_0xbf12('0x4e')]+=0x1;if(this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x2a')]){this[_0xbf12('0xc')][_0xbf12('0x4f')]+=0x1;this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x50')]=moment(this[_0xbf12('0x1b')][_0x6f78a1['uniqueid']][_0xbf12('0x2a')])['diff'](this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x51')],'seconds');this[_0xbf12('0x1b')][_0x6f78a1['uniqueid']]['billableseconds']=moment(this[_0xbf12('0x1b')][_0x6f78a1['uniqueid']][_0xbf12('0x4b')])[_0xbf12('0x52')](this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x2a')],_0xbf12('0x4d'));this['outbound'][_0xbf12('0x53')]+=this['channels'][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x50')]||0x0;this['outbound'][_0xbf12('0x54')]+=this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x55')];}this[_0xbf12('0xc')][_0xbf12('0x56')]+=this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]][_0xbf12('0x4c')];ami['emit']('custom:voiceDialReport',this['channels'][_0x6f78a1[_0xbf12('0x1c')]]);ami[_0xbf12('0x19')](_0xbf12('0x57'),this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]]);this['emit'](_0xbf12('0x21'),_0xbf12('0x58'),this[_0xbf12('0xc')]);this[_0xbf12('0x19')]('voice:outbound','voice_outbound_channel:remove',this['channels'][_0x6f78a1[_0xbf12('0x1c')]]);delete this[_0xbf12('0x1b')][_0x6f78a1[_0xbf12('0x1c')]];}if(this['variables'][_0x6f78a1['uniqueid']]){delete this['variables'][_0x6f78a1['uniqueid']];}}}catch(_0x1ad6e4){logger[_0xbf12('0x23')]('[syncHangup][VoiceDialReport]',util[_0xbf12('0x24')](_0x1ad6e4,{'showHidden':![],'depth':null}));}};module[_0xbf12('0x59')]=VoiceDialReport; \ No newline at end of file +var _0x13d0=['outbound','variables','dialbegin','bind','dialend','syncDialEnd','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','channels','uniqueid','format','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','inspect','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepvtcallid','membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','diff','starttime','seconds','complete','total','answered','billableseconds','sumHoldTime','holdtime','sumBillable','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter'];(function(_0x4bb05d,_0x2dfa45){var _0x3b7cc1=function(_0x567513){while(--_0x567513){_0x4bb05d['push'](_0x4bb05d['shift']());}};_0x3b7cc1(++_0x2dfa45);}(_0x13d0,0xfd));var _0x013d=function(_0x507d43,_0x7904b2){_0x507d43=_0x507d43-0x0;var _0x169667=_0x13d0[_0x507d43];return _0x169667;};'use strict';var _=require(_0x013d('0x0'));var moment=require(_0x013d('0x1'));var util=require(_0x013d('0x2'));var Redis=require('ioredis');var config=require(_0x013d('0x3'));var logger=require(_0x013d('0x4'))(_0x013d('0x5'));var ami=require(_0x013d('0x6'));config[_0x013d('0x7')]=_[_0x013d('0x8')](config[_0x013d('0x7')],{'host':_0x013d('0x9'),'port':0x18eb});var io=require(_0x013d('0xa'))(new Redis(config[_0x013d('0x7')]));function VoiceDialReport(_0x91341e){this['channels']=_0x91341e['outboundChannels'];this[_0x013d('0xb')]=_0x91341e[_0x013d('0xb')];this[_0x013d('0xc')]={};ami['on'](_0x013d('0xd'),this['syncDialBegin'][_0x013d('0xe')](this));ami['on'](_0x013d('0xf'),this[_0x013d('0x10')][_0x013d('0xe')](this));ami['on']('varset',this['syncVarSet'][_0x013d('0xe')](this));ami['on'](_0x013d('0x11'),this[_0x013d('0x12')][_0x013d('0xe')](this));}VoiceDialReport[_0x013d('0x13')][_0x013d('0x14')]=function(_0x3cd7be){return _0x3cd7be!==null&&!_[_0x013d('0x15')](_0x3cd7be);};VoiceDialReport[_0x013d('0x13')]['emit']=function(_0x5ce6eb,_0x1f28ff,_0x7db6e5){io['to'](_0x5ce6eb)[_0x013d('0x16')](_0x1f28ff,_0x7db6e5);};VoiceDialReport[_0x013d('0x13')][_0x013d('0x17')]=function(_0x1cd173){try{if(this['isNotNull'](_0x1cd173)){if(this['channels'][_0x1cd173['uniqueid']]){_['merge'](this[_0x013d('0x18')][_0x1cd173[_0x013d('0x19')]],{'starttime':moment()[_0x013d('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x013d('0x1b'),'interface':_0x1cd173[_0x013d('0x1c')][_0x013d('0x1d')](0x0,_0x1cd173[_0x013d('0x1c')]['lastIndexOf']('-')),'membername':_0x1cd173[_0x013d('0x1c')][_0x013d('0x1d')](_0x1cd173[_0x013d('0x1c')][_0x013d('0x1e')]('/')+0x1,_0x1cd173[_0x013d('0x1c')]['lastIndexOf']('-'))},_[_0x013d('0x1f')](_0x1cd173,[_0x013d('0x20'),_0x013d('0x21')]));this[_0x013d('0x16')](_0x013d('0x22'),_0x013d('0x23'),this['channels'][_0x1cd173[_0x013d('0x19')]]);ami[_0x013d('0x16')](_0x013d('0x24'),this[_0x013d('0x18')][_0x1cd173['uniqueid']]);}}}catch(_0x4ed7e5){logger[_0x013d('0x25')](_0x013d('0x26'),util['inspect'](_0x4ed7e5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x013d('0x13')][_0x013d('0x10')]=function(_0x5bdf79){try{if(this[_0x013d('0x14')](_0x5bdf79)){if(this[_0x013d('0x18')][_0x5bdf79[_0x013d('0x19')]]){this[_0x013d('0x18')][_0x5bdf79[_0x013d('0x19')]][_0x013d('0x27')]=_0x5bdf79[_0x013d('0x27')];if(_0x5bdf79[_0x013d('0x27')]==='ANSWER'){this[_0x013d('0x18')][_0x5bdf79['uniqueid']]['connectedlinenum']=_0x5bdf79[_0x013d('0x28')];this[_0x013d('0x18')][_0x5bdf79[_0x013d('0x19')]][_0x013d('0x29')]=_0x5bdf79[_0x013d('0x29')];this['channels'][_0x5bdf79['uniqueid']][_0x013d('0x2a')]=moment()['format'](_0x013d('0x2b'));this[_0x013d('0x18')][_0x5bdf79[_0x013d('0x19')]][_0x013d('0x2c')]=_0x013d('0x2d');ami[_0x013d('0x16')](_0x013d('0x2e'),this['channels'][_0x5bdf79[_0x013d('0x19')]]);}this[_0x013d('0x16')](_0x013d('0x22'),_0x013d('0x23'),this[_0x013d('0x18')][_0x5bdf79['uniqueid']]);}}}catch(_0x3c709d){logger['error'](_0x013d('0x2f'),util['inspect'](_0x3c709d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x013d('0x13')][_0x013d('0x30')]=function(_0x50a91a){try{if(this[_0x013d('0x14')](_0x50a91a)){this[_0x013d('0x31')](_0x50a91a[_0x013d('0x19')],_[_0x013d('0x32')](_0x50a91a[_0x013d('0x33')])[0x0],_0x50a91a[_0x013d('0x34')]);if(this[_0x013d('0x14')](_0x50a91a['variable'])&&this[_0x013d('0x14')](_0x50a91a['variable'][_0x013d('0x35')])){if(_[_0x013d('0x15')](this[_0x013d('0x18')][_0x50a91a[_0x013d('0x19')]])){this[_0x013d('0x18')][_0x50a91a['uniqueid']]={'routeId':_0x50a91a[_0x013d('0x34')],'variables':this[_0x013d('0xc')][_0x50a91a[_0x013d('0x19')]]};this['emit']('voice:outbound',_0x013d('0x23'),this[_0x013d('0x18')][_0x50a91a[_0x013d('0x19')]]);}}}}catch(_0xbe63ea){logger[_0x013d('0x25')](_0x013d('0x36'),util[_0x013d('0x37')](_0xbe63ea,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x013d('0x13')][_0x013d('0x31')]=function(_0x20e0d6,_0x3f1fb7,_0x4ad498){var _0x1c49d6=['rtpaudioqos',_0x013d('0x38'),'rtpaudioqosjitter',_0x013d('0x39'),'rtpaudioqosloss',_0x013d('0x3a'),_0x013d('0x3b'),'rtpaudioqosrttbridged',_0x013d('0x3c'),'sipuri','bridgepeer',_0x013d('0x3d'),_0x013d('0x3e'),'memberdynamic',_0x013d('0x3f'),_0x013d('0x40'),_0x013d('0x41'),_0x013d('0x42'),_0x013d('0x43')];if(!_[_0x013d('0x44')](_0x3f1fb7)&&!_[_0x013d('0x45')](_0x1c49d6,_0x3f1fb7)){if(_[_0x013d('0x15')](this[_0x013d('0xc')][_0x20e0d6])){this[_0x013d('0xc')][_0x20e0d6]={};}this['variables'][_0x20e0d6][_0x3f1fb7]=_0x4ad498;}};VoiceDialReport[_0x013d('0x13')]['syncHangup']=function(_0x434842){try{if(this[_0x013d('0x14')](_0x434842)){if(this['channels'][_0x434842[_0x013d('0x19')]]){this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]][_0x013d('0x46')]=moment()['format'](_0x013d('0x2b'));this[_0x013d('0x18')][_0x434842['uniqueid']][_0x013d('0x47')]=moment(this['channels'][_0x434842[_0x013d('0x19')]][_0x013d('0x46')])[_0x013d('0x48')](this['channels'][_0x434842[_0x013d('0x19')]][_0x013d('0x49')],_0x013d('0x4a'));this['channels'][_0x434842['uniqueid']][_0x013d('0x2c')]=_0x013d('0x4b');this['outbound'][_0x013d('0x4c')]+=0x1;if(this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]][_0x013d('0x2a')]){this[_0x013d('0xb')][_0x013d('0x4d')]+=0x1;this['channels'][_0x434842[_0x013d('0x19')]]['holdtime']=moment(this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]][_0x013d('0x2a')])[_0x013d('0x48')](this['channels'][_0x434842['uniqueid']][_0x013d('0x49')],_0x013d('0x4a'));this[_0x013d('0x18')][_0x434842['uniqueid']][_0x013d('0x4e')]=moment(this[_0x013d('0x18')][_0x434842['uniqueid']][_0x013d('0x46')])['diff'](this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]]['answertime'],_0x013d('0x4a'));this[_0x013d('0xb')][_0x013d('0x4f')]+=this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]][_0x013d('0x50')]||0x0;this[_0x013d('0xb')][_0x013d('0x51')]+=this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]][_0x013d('0x4e')];}this[_0x013d('0xb')]['sumDuration']+=this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]]['duration'];ami[_0x013d('0x16')](_0x013d('0x52'),this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]]);ami['emit'](_0x013d('0x53'),this[_0x013d('0x18')][_0x434842[_0x013d('0x19')]]);this['emit'](_0x013d('0x22'),_0x013d('0x54'),this[_0x013d('0xb')]);this['emit'](_0x013d('0x22'),_0x013d('0x55'),this['channels'][_0x434842[_0x013d('0x19')]]);delete this['channels'][_0x434842[_0x013d('0x19')]];}if(this[_0x013d('0xc')][_0x434842['uniqueid']]){delete this[_0x013d('0xc')][_0x434842[_0x013d('0x19')]];}}}catch(_0x1a9e73){logger[_0x013d('0x25')](_0x013d('0x56'),util[_0x013d('0x37')](_0x1a9e73,{'showHidden':![],'depth':null}));}};module[_0x013d('0x57')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index c74a10c..5fc93d1 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 _0xa98f=['rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberrealtime','includes','syncHangup','length','abandoned','milliseconds','diff','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','sumHoldTime','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','ATTENDEDTRANSFER','transfertype','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLIND','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','[syncMusicOnHoldStart][VoiceQueueReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','originated','pTalking','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','enqueue','isNil','Action','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','emitVoiceQueueChannelRemove','voice_queue_channel:remove','type','inbound','strategy','available','sumBillable','sumDuration','talking','total','unmanaged','waiting','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','loopQueueShow','queues','[queues]','[queuesummary]','queue','countBy','callers','toNumber','loggedIn','loggedin','emitVoiceQueueSummary','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncQueueCallerJoin','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallerexitreason','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','queuecallerexit','queuecallerexitAt','transfer','startsWith','local/','linkedid','add','seconds','FORWARDTRANSFER','FORWARD','transferexten','transferuniqueid','COMPLETEDBY','toUpperCase','addVariable','keys','variable','queuestatus','value','CONTINUE','queuecallerleaveAt','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa98f,0x1bd));var _0xfa98=function(_0x12ec66,_0x3ef1dc){_0x12ec66=_0x12ec66-0x0;var _0x5c9dd8=_0xa98f[_0x12ec66];return _0x5c9dd8;};'use strict';var _=require(_0xfa98('0x0'));var moment=require(_0xfa98('0x1'));var BPromise=require(_0xfa98('0x2'));var util=require(_0xfa98('0x3'));var md5=require(_0xfa98('0x4'));var Redis=require(_0xfa98('0x5'));var config=require(_0xfa98('0x6'));var logger=require(_0xfa98('0x7'))(_0xfa98('0x8'));var ami=require('../ami');var QueueReport=require(_0xfa98('0x9'));config[_0xfa98('0xa')]=_[_0xfa98('0xb')](config['redis'],{'host':_0xfa98('0xc'),'port':0x18eb});var io=require(_0xfa98('0xd'))(new Redis(config[_0xfa98('0xa')]));var Sequence=function(){};Sequence[_0xfa98('0xe')]['enqueue']=function(_0x3bde7a){this['tail']=this[_0xfa98('0xf')]?this[_0xfa98('0xf')][_0xfa98('0x10')](_0x3bde7a):_0x3bde7a();};function VoiceQueueReport(_0x4f9aad){this[_0xfa98('0x11')]=new Sequence();this[_0xfa98('0x12')]={};this[_0xfa98('0x13')]=_0x4f9aad[_0xfa98('0x13')];this['channels']=_0x4f9aad[_0xfa98('0x14')];this[_0xfa98('0x15')]=_0x4f9aad['voiceQueues'];this[_0xfa98('0x16')]=!![];this['campaigns']=_0x4f9aad[_0xfa98('0x17')];this[_0xfa98('0x18')]={};ami['on'](_0xfa98('0x19'),this[_0xfa98('0x1a')]['bind'](this));ami['on'](_0xfa98('0x1b'),this[_0xfa98('0x1c')][_0xfa98('0x1d')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0xfa98('0x1d')](this));ami['on'](_0xfa98('0x1e'),this[_0xfa98('0x1f')][_0xfa98('0x1d')](this));ami['on'](_0xfa98('0x20'),this[_0xfa98('0x21')][_0xfa98('0x1d')](this));ami['on'](_0xfa98('0x22'),this[_0xfa98('0x23')]['bind'](this));ami['on']('agentconnect',this[_0xfa98('0x24')][_0xfa98('0x1d')](this));ami['on']('varset',this[_0xfa98('0x25')]['bind'](this));ami['on'](_0xfa98('0x26'),this['syncHangup'][_0xfa98('0x1d')](this));ami['on'](_0xfa98('0x27'),this[_0xfa98('0x28')]['bind'](this));ami['on'](_0xfa98('0x29'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xfa98('0x2a'),this[_0xfa98('0x2b')][_0xfa98('0x1d')](this));ami['on'](_0xfa98('0x2c'),this[_0xfa98('0x2d')][_0xfa98('0x1d')](this));ami['on']('blindtransfer',this[_0xfa98('0x2e')][_0xfa98('0x1d')](this));this[_0xfa98('0x2f')]();this['loopQueueShow']();}function isNotNull(_0x3f9e83){return _0x3f9e83!==null&&!_[_0xfa98('0x30')](_0x3f9e83);}function clearChannels(_0x1aa467){if(!_[_0xfa98('0x31')](_0x1aa467)){for(var _0x433d1b in _0x1aa467){if(_0x1aa467[_0xfa98('0x32')](_0x433d1b)){delete _0x1aa467[_0x433d1b];}}}}function clearCampaigns(_0x1b453a){if(!_[_0xfa98('0x31')](_0x1b453a)){for(var _0x28bfc1 in _0x1b453a){if(_0x1b453a[_0xfa98('0x32')](_0x28bfc1)){_0x1b453a[_0x28bfc1][_0xfa98('0x33')]=0x0;}}}}function clearVoiceQueues(_0x372411){if(!_[_0xfa98('0x31')](_0x372411)){for(var _0x2e930b in _0x372411){if(_0x372411[_0xfa98('0x32')](_0x2e930b)){_0x372411[_0x2e930b][_0xfa98('0x33')]=0x0;_0x372411[_0x2e930b]['talking']=0x0;_0x372411[_0x2e930b][_0xfa98('0x34')]=0x0;_0x372411[_0x2e930b]['waiting']=0x0;_0x372411[_0x2e930b][_0xfa98('0x35')]=!![];}}}}function clearAgentBooked(_0x42948b){if(!_[_0xfa98('0x31')](_0x42948b)){for(var _0x4f2c24 in _0x42948b){if(_0x42948b[_0xfa98('0x32')](_0x4f2c24)){_0x42948b[_0x4f2c24][_0xfa98('0x36')]=!![];}}}}VoiceQueueReport['prototype'][_0xfa98('0x37')]=function(){var _0x5f100e=this;for(var _0x1d0b6a in this['channels']){if(this[_0xfa98('0x38')][_0xfa98('0x32')](_0x1d0b6a)&&!this[_0xfa98('0x38')][_0x1d0b6a][_0xfa98('0x39')]){this[_0xfa98('0x11')][_0xfa98('0x3a')](function(){if(!_[_0xfa98('0x3b')](_0x5f100e[_0xfa98('0x38')][_0x1d0b6a])){return ami[_0xfa98('0x3c')]({'action':'status','channel':_0x5f100e['channels'][_0x1d0b6a][_0xfa98('0x3d')]})[_0xfa98('0x3e')](function(_0x2fd435){if(_0x2fd435[_0xfa98('0x3f')]===_0xfa98('0x40')){setTimeout(function(){if(_0x5f100e[_0xfa98('0x38')][_0x1d0b6a]){delete _0x5f100e[_0xfa98('0x38')][_0x1d0b6a];logger[_0xfa98('0x41')](_0xfa98('0x42'),_0x1d0b6a);}if(_0x5f100e['queueReports'][_0x1d0b6a]){delete _0x5f100e['queueReports'][_0x1d0b6a];logger[_0xfa98('0x41')](_0xfa98('0x43'),_0x1d0b6a);}if(_0x5f100e['variables'][_0x1d0b6a]){delete _0x5f100e['variables'][_0x1d0b6a];logger['error'](_0xfa98('0x44'),_0x1d0b6a);}},0x1f40);}});}});}}};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x28')]=function(){logger['error'](_0xfa98('0x45'));clearChannels(this[_0xfa98('0x38')]);this[_0xfa98('0x46')](this[_0xfa98('0x12')]);clearAgentBooked(this[_0xfa98('0x13')]);clearVoiceQueues(this[_0xfa98('0x15')]);clearCampaigns(this[_0xfa98('0x17')]);};VoiceQueueReport[_0xfa98('0xe')]['clearQueueReport']=function(_0x41997c){var _0x3019fb=this;if(!_[_0xfa98('0x31')](_0x41997c)){for(var _0x39b2dd in _0x41997c){if(_0x41997c['hasOwnProperty'](_0x39b2dd)){_0x3019fb['emitVoiceQueueChannelRemove'](_0x41997c[_0x39b2dd]);delete _0x41997c[_0x39b2dd];}}}};function loggerCatch(_0x100ff9){return function(_0x8902f2){logger[_0xfa98('0x41')](_0x100ff9,util[_0xfa98('0x47')](_0x8902f2,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x48')]=function(_0x32550a,_0x1cedce,_0x138eb6){io['to'](_0x32550a)[_0xfa98('0x48')](_0x1cedce,_0x138eb6);};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x49')]=function(_0x35d4df){this[_0xfa98('0x48')](util[_0xfa98('0x4a')](_0xfa98('0x4b'),_0x35d4df[_0xfa98('0x4c')]),'voice_queue_channel:save',_0x35d4df);};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x4d')]=function(_0xf3e899){this[_0xfa98('0x48')](util[_0xfa98('0x4a')](_0xfa98('0x4b'),_0xf3e899['name']),_0xfa98('0x4e'),_0xf3e899);};VoiceQueueReport[_0xfa98('0xe')]['emitVoiceQueueSummary']=function(_0x1dd5fc){if(_0x1dd5fc[_0xfa98('0x4f')]===_0xfa98('0x50')){var _0xdb9eef={'id':_0x1dd5fc['id'],'name':_0x1dd5fc[_0xfa98('0x4c')],'strategy':_0x1dd5fc[_0xfa98('0x51')],'answered':_0x1dd5fc['answered'],'available':_0x1dd5fc[_0xfa98('0x52')],'loggedIn':_0x1dd5fc['loggedIn'],'pTalking':_0x1dd5fc[_0xfa98('0x34')],'sumBillable':_0x1dd5fc[_0xfa98('0x53')],'sumDuration':_0x1dd5fc[_0xfa98('0x54')],'sumHoldTime':_0x1dd5fc['sumHoldTime']||0x0,'talking':_0x1dd5fc[_0xfa98('0x55')],'total':_0x1dd5fc[_0xfa98('0x56')],'type':_0x1dd5fc[_0xfa98('0x4f')],'unmanaged':_0x1dd5fc[_0xfa98('0x57')],'abandoned':_0x1dd5fc['abandoned'],'waiting':_0x1dd5fc[_0xfa98('0x58')]};if(_0x1dd5fc[_0xfa98('0x59')]){_0xdb9eef[_0xfa98('0x59')]={'id':_0x1dd5fc[_0xfa98('0x59')]['id'],'name':_0x1dd5fc['Trunk'][_0xfa98('0x4c')],'active':_0x1dd5fc[_0xfa98('0x59')][_0xfa98('0x5a')],'callerid':_0x1dd5fc[_0xfa98('0x59')][_0xfa98('0x5b')]};}if(_0x1dd5fc[_0xfa98('0x5c')]){_0xdb9eef[_0xfa98('0x5c')]={'id':_0x1dd5fc['Interval']['id'],'name':_0x1dd5fc['Interval']['name']};}var _0x36ea93=md5(JSON[_0xfa98('0x5d')](_0xdb9eef));if(_0x1dd5fc[_0xfa98('0x4')]!==_0x36ea93){_0x1dd5fc[_0xfa98('0x4')]=_0x36ea93;this[_0xfa98('0x48')](util['format']('voice:queue:%s',_0xdb9eef[_0xfa98('0x4c')]),_0xfa98('0x5e'),_0xdb9eef);}}};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x5f')]=function(_0x2c5d38){return _0x2c5d38!==null&&!_[_0xfa98('0x30')](_0x2c5d38);};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x60')]=function(){var _0x44e459=this;setInterval(function(){_0x44e459[_0xfa98('0x37')]();ami[_0xfa98('0x3c')]({'action':_0xfa98('0x61')})[_0xfa98('0x3e')](loggerCatch(_0xfa98('0x62')));},0x2710);};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x2f')]=function(){var _0x1ad4f7=this;setInterval(function(){if(_0x1ad4f7[_0xfa98('0x16')]){return ami[_0xfa98('0x3c')]({'action':'queuesummary'})['then'](function(_0x3d3ad3){_0x1ad4f7[_0xfa98('0x16')]=![];})[_0xfa98('0x3e')](loggerCatch(_0xfa98('0x63')));}},0x3e8);};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x1a')]=function(_0x5601c3){try{if(this[_0xfa98('0x5f')](_0x5601c3)&&this[_0xfa98('0x5f')](_0x5601c3[_0xfa98('0x64')])){if(this[_0xfa98('0x15')][_0x5601c3[_0xfa98('0x64')]]){var _0x17ac84=_[_0xfa98('0x65')](this[_0xfa98('0x38')],_0xfa98('0x64'))[_0x5601c3[_0xfa98('0x64')]]||0x0;var _0x207bc1=_0x17ac84-_0x5601c3[_0xfa98('0x66')];if(this[_0xfa98('0x15')][_0x5601c3[_0xfa98('0x64')]][_0xfa98('0x58')]!==_[_0xfa98('0x67')](_0x5601c3[_0xfa98('0x66')])||this[_0xfa98('0x15')][_0x5601c3[_0xfa98('0x64')]][_0xfa98('0x68')]!==_[_0xfa98('0x67')](_0x5601c3[_0xfa98('0x69')])||this['voiceQueues'][_0x5601c3[_0xfa98('0x64')]]['available']!==_['toNumber'](_0x5601c3[_0xfa98('0x52')])||this[_0xfa98('0x15')][_0x5601c3[_0xfa98('0x64')]][_0xfa98('0x55')]!==_0x207bc1){this['voiceQueues'][_0x5601c3['queue']][_0xfa98('0x58')]=_[_0xfa98('0x67')](_0x5601c3[_0xfa98('0x66')]);this['voiceQueues'][_0x5601c3[_0xfa98('0x64')]][_0xfa98('0x68')]=_['toNumber'](_0x5601c3[_0xfa98('0x69')]);this[_0xfa98('0x15')][_0x5601c3[_0xfa98('0x64')]][_0xfa98('0x52')]=_[_0xfa98('0x67')](_0x5601c3[_0xfa98('0x52')]);this[_0xfa98('0x15')][_0x5601c3['queue']][_0xfa98('0x55')]=_0x207bc1>0x0?_0x207bc1:0x0;this[_0xfa98('0x15')][_0x5601c3[_0xfa98('0x64')]]['talking']=this[_0xfa98('0x15')][_0x5601c3[_0xfa98('0x64')]][_0xfa98('0x55')]>_[_0xfa98('0x67')](_0x5601c3[_0xfa98('0x69')])?_['toNumber'](_0x5601c3[_0xfa98('0x69')]):this[_0xfa98('0x15')][_0x5601c3['queue']][_0xfa98('0x55')];this[_0xfa98('0x6a')](this['voiceQueues'][_0x5601c3[_0xfa98('0x64')]]);}ami[_0xfa98('0x48')](_0xfa98('0x6b'),this['voiceQueues'][_0x5601c3[_0xfa98('0x64')]]);}}}catch(_0x37c36d){logger[_0xfa98('0x41')](_0xfa98('0x6c'),util[_0xfa98('0x47')](_0x37c36d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa98('0xe')]['syncQueueSummaryComplete']=function(_0x5be02b){this[_0xfa98('0x16')]=!![];};VoiceQueueReport['prototype']['syncNewExten']=function(_0x45a19d){};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x6d')]=function(_0x2c6167){try{if(this['isNotNull'](_0x2c6167)){if(_[_0xfa98('0x30')](this[_0xfa98('0x12')][_0x2c6167['uniqueid']])){this[_0xfa98('0x12')][_0x2c6167[_0xfa98('0x6e')]]=[];this[_0xfa98('0x38')][_0x2c6167[_0xfa98('0x6e')]]={};}var _0x4022b3=new QueueReport();_0x4022b3['name']=_0x2c6167['queue'];_0x4022b3[_0xfa98('0x4f')]=this[_0xfa98('0x15')][_0x4022b3['name']]&&this[_0xfa98('0x15')][_0x4022b3[_0xfa98('0x4c')]]['type']?this[_0xfa98('0x15')][_0x4022b3['name']][_0xfa98('0x4f')]||_0xfa98('0x50'):_0xfa98('0x50');_0x4022b3[_0xfa98('0x64')]=_0x2c6167[_0xfa98('0x64')];_0x4022b3[_0xfa98('0x6f')]=moment()[_0xfa98('0x4a')](_0xfa98('0x70'));_0x4022b3[_0xfa98('0x71')]=_0x2c6167['position'];_0x4022b3['count']=_0x2c6167[_0xfa98('0x72')];_[_0xfa98('0x73')](_0x4022b3,_[_0xfa98('0x74')](_0x2c6167,_['keys'](_0x4022b3)));this[_0xfa98('0x12')][_0x2c6167[_0xfa98('0x6e')]][_0xfa98('0x75')](_0x4022b3);this[_0xfa98('0x38')][_0x2c6167['uniqueid']]=_0x4022b3;this[_0xfa98('0x49')](_0x4022b3);}}catch(_0x228461){logger[_0xfa98('0x41')](_0xfa98('0x76'),util[_0xfa98('0x47')](_0x228461,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x1372b5){try{if(this[_0xfa98('0x5f')](_0x1372b5)){if(this['queueReports'][_0x1372b5[_0xfa98('0x6e')]]){var _0x3eb20e=_[_0xfa98('0x77')](this[_0xfa98('0x12')][_0x1372b5[_0xfa98('0x6e')]]);_0x3eb20e[_0xfa98('0x78')]=![];_0x3eb20e[_0xfa98('0x79')]=null;_0x3eb20e[_0xfa98('0x7a')]=_0x1372b5[_0xfa98('0x7a')];_0x3eb20e[_0xfa98('0x7b')]=_0x1372b5[_0xfa98('0x7b')];_0x3eb20e[_0xfa98('0x1e')]=!![];_0x3eb20e[_0xfa98('0x7c')]=moment()[_0xfa98('0x4a')](_0xfa98('0x70'));_0x3eb20e['queuecallerexitreason']='ABANDONED';_0x3eb20e[_0xfa98('0x7d')]=null;this[_0xfa98('0x38')][_0x1372b5[_0xfa98('0x6e')]]=_0x3eb20e;this[_0xfa98('0x4d')](_0x3eb20e);}}}catch(_0x54a1a2){logger['error'](_0xfa98('0x7e'),util[_0xfa98('0x47')](_0x54a1a2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x21')]=function(_0x22d656){try{if(this[_0xfa98('0x5f')](_0x22d656)){if(this['queueReports'][_0x22d656[_0xfa98('0x6e')]]){var _0x1af9b6=_['last'](this[_0xfa98('0x12')][_0x22d656[_0xfa98('0x6e')]]);_0x1af9b6['queuecallerleaveAt']=moment()[_0xfa98('0x4a')](_0xfa98('0x70'));_0x1af9b6[_0xfa98('0x7f')]=_0x22d656[_0xfa98('0x7f')];_0x1af9b6[_0xfa98('0x80')]=_0x22d656['connectedlinename'];this['channels'][_0x22d656['uniqueid']]=_0x1af9b6;this[_0xfa98('0x49')](_0x1af9b6);}}}catch(_0x2097d0){logger[_0xfa98('0x41')](_0xfa98('0x81'),util[_0xfa98('0x47')](_0x2097d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x24')]=function(_0x87b245){try{if(this['isNotNull'](_0x87b245)){if(this[_0xfa98('0x12')][_0x87b245[_0xfa98('0x6e')]]){var _0x18bc83=_['last'](this['queueReports'][_0x87b245[_0xfa98('0x6e')]]);_0x18bc83[_0xfa98('0x78')]=!![];_0x18bc83[_0xfa98('0x82')]=_0xfa98('0x83');}}}catch(_0x22e99e){logger[_0xfa98('0x41')](_0xfa98('0x84'),util[_0xfa98('0x47')](_0x22e99e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x1c9549){try{if(this[_0xfa98('0x5f')](_0x1c9549)){if(this['queueReports'][_0x1c9549['uniqueid']]){var _0x29f1ad=_['last'](this[_0xfa98('0x12')][_0x1c9549[_0xfa98('0x6e')]]);_0x29f1ad['queuecallerabandon']=![];_0x29f1ad[_0xfa98('0x7c')]=null;_0x29f1ad[_0xfa98('0x85')]=!![];_0x29f1ad[_0xfa98('0x7d')]=_0x1c9549['membername'];_0x29f1ad[_0xfa98('0x7a')]=_0x1c9549[_0xfa98('0x7a')];_0x29f1ad[_0xfa98('0x78')]=!![];_0x29f1ad[_0xfa98('0x86')]=![];_0x29f1ad[_0xfa98('0x87')]=null;if(!_0x29f1ad['transfer']){if(_0x1c9549['reason']==_0xfa98('0x88')){_0x29f1ad['queuecallerexitreason']='COMPLETED';}else{if(_[_0xfa98('0x89')](_0x1c9549[_0xfa98('0x3d')]['toLowerCase'](),_0xfa98('0x8a'))){if(this['queueReports'][_0x1c9549[_0xfa98('0x8b')]]){var _0x4f45a5=_[_0xfa98('0x77')](this[_0xfa98('0x12')][_0x1c9549[_0xfa98('0x8b')]]);_0x4f45a5[_0xfa98('0x78')]=![];_0x4f45a5['queuecallerexit']=!![];_0x4f45a5['queuecallerexitAt']=moment(_0x29f1ad[_0xfa98('0x6f')])[_0xfa98('0x8c')](_0x1c9549['holdtime'],_0xfa98('0x8d'))[_0xfa98('0x4a')](_0xfa98('0x70'));_0x4f45a5[_0xfa98('0x82')]=_0xfa98('0x8e');_0x4f45a5[_0xfa98('0x88')]=!![];_0x4f45a5['transfertype']=_0xfa98('0x8f');_0x4f45a5[_0xfa98('0x90')]=_0x1c9549['destexten'];_0x4f45a5[_0xfa98('0x91')]=_0x1c9549['uniqueid'];var _0x178cf4=this[_0xfa98('0x12')][_0x1c9549[_0xfa98('0x8b')]];this[_0xfa98('0x12')][_0x1c9549[_0xfa98('0x8b')]]=this[_0xfa98('0x12')][_0x1c9549[_0xfa98('0x6e')]];this[_0xfa98('0x12')][_0x1c9549[_0xfa98('0x6e')]]=_0x178cf4;}}else{_0x29f1ad[_0xfa98('0x82')]=_0xfa98('0x92')+_0x1c9549['reason'][_0xfa98('0x93')]();}}}this[_0xfa98('0x38')][_0x1c9549[_0xfa98('0x6e')]]=_0x29f1ad;this[_0xfa98('0x4d')](_0x29f1ad);}}}catch(_0x2b33a1){logger[_0xfa98('0x41')]('[syncAgentComplete][VoiceQueueReport]',util[_0xfa98('0x47')](_0x2b33a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x25')]=function(_0x15ebee){try{if(this[_0xfa98('0x5f')](_0x15ebee)){this[_0xfa98('0x94')](_0x15ebee[_0xfa98('0x6e')],_[_0xfa98('0x95')](_0x15ebee[_0xfa98('0x96')])[0x0],_0x15ebee['value']);if(this[_0xfa98('0x12')][_0x15ebee[_0xfa98('0x6e')]]){var _0x2085dc=_[_0xfa98('0x77')](this[_0xfa98('0x12')][_0x15ebee[_0xfa98('0x6e')]]);if(_0x2085dc){if(this[_0xfa98('0x5f')](_0x15ebee[_0xfa98('0x96')])&&this['isNotNull'](_0x15ebee[_0xfa98('0x96')][_0xfa98('0x97')])){switch(_0x15ebee[_0xfa98('0x98')]){case _0xfa98('0x99'):_0x2085dc[_0xfa98('0x86')]=![];_0x2085dc[_0xfa98('0x87')]=null;break;default:_0x2085dc[_0xfa98('0x86')]=!![];_0x2085dc[_0xfa98('0x87')]=moment()[_0xfa98('0x4a')](_0xfa98('0x70'));_0x2085dc[_0xfa98('0x9a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2085dc['queuecallerabandon']=![];_0x2085dc[_0xfa98('0x7c')]=null;_0x2085dc[_0xfa98('0x82')]=_0x15ebee[_0xfa98('0x98')];this['channels'][_0x15ebee[_0xfa98('0x6e')]]=_0x2085dc;this[_0xfa98('0x4d')](_0x2085dc);}else if(this[_0xfa98('0x5f')](_0x15ebee['variable'])&&this[_0xfa98('0x5f')](_0x15ebee['variable'][_0xfa98('0x9b')])){if(!_0x2085dc[_0xfa98('0x1e')]){_0x2085dc[_0xfa98('0x86')]=!![];_0x2085dc[_0xfa98('0x87')]=moment()[_0xfa98('0x4a')](_0xfa98('0x70'));_0x2085dc[_0xfa98('0x82')]=_0xfa98('0x9c');_0x2085dc[_0xfa98('0x9a')]=moment()[_0xfa98('0x4a')](_0xfa98('0x70'));this['channels'][_0x15ebee['uniqueid']]=_0x2085dc;}}_0x2085dc['variables']=this[_0xfa98('0x18')][_0x15ebee[_0xfa98('0x6e')]];}}}}catch(_0x57a368){logger[_0xfa98('0x41')](_0xfa98('0x9d'),util['inspect'](_0x57a368,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0x94')]=function(_0x328f0b,_0x43338b,_0x4e77bf){var _0x277a08=[_0xfa98('0x9e'),_0xfa98('0x9f'),_0xfa98('0xa0'),_0xfa98('0xa1'),_0xfa98('0xa2'),_0xfa98('0xa3'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer',_0xfa98('0xa4'),_0xfa98('0xa5'),_0xfa98('0xa6'),_0xfa98('0xa7'),_0xfa98('0xa8'),_0xfa98('0xa9'),'memberpenalty',_0xfa98('0xaa')];if(!_[_0xfa98('0x3b')](_0x43338b)&&!_[_0xfa98('0xab')](_0x277a08,_0x43338b)){if(_[_0xfa98('0x30')](this['variables'][_0x328f0b])){this[_0xfa98('0x18')][_0x328f0b]={};}this['variables'][_0x328f0b][_0x43338b]=_0x4e77bf;}};VoiceQueueReport[_0xfa98('0xe')][_0xfa98('0xac')]=function(_0xf8e828){try{if(this[_0xfa98('0x5f')](_0xf8e828)){if(this[_0xfa98('0x12')][_0xf8e828['uniqueid']]){for(var _0x376fe0=0x0,_0x184c13={};_0x376fe00x0?_0x53f9a3:0x0;this[_0x665e('0x10')][_0x4960d2[_0x665e('0x57')]][_0x665e('0x5c')]=this[_0x665e('0x10')][_0x4960d2[_0x665e('0x57')]]['talking']>_[_0x665e('0x5a')](_0x4960d2[_0x665e('0x5b')])?_[_0x665e('0x5a')](_0x4960d2[_0x665e('0x5b')]):this[_0x665e('0x10')][_0x4960d2[_0x665e('0x57')]]['talking'];this[_0x665e('0x5d')](this['voiceQueues'][_0x4960d2[_0x665e('0x57')]]);}ami[_0x665e('0x40')](_0x665e('0x5e'),this[_0x665e('0x10')][_0x4960d2[_0x665e('0x57')]]);}}}catch(_0x40314f){logger[_0x665e('0x37')](_0x665e('0x5f'),util[_0x665e('0x3f')](_0x40314f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x665e('0x15')]=function(_0x51b2e8){this['flagQueueSummary']=!![];};VoiceQueueReport[_0x665e('0x2e')][_0x665e('0x60')]=function(_0x2a3685){};VoiceQueueReport[_0x665e('0x2e')][_0x665e('0x61')]=function(_0x1d6f86){try{if(this['isNotNull'](_0x1d6f86)){if(_[_0x665e('0x28')](this[_0x665e('0x39')][_0x1d6f86['uniqueid']])){this[_0x665e('0x39')][_0x1d6f86[_0x665e('0x62')]]=[];this[_0x665e('0xf')][_0x1d6f86[_0x665e('0x62')]]={};}var _0x1bbf91=new QueueReport();_0x1bbf91[_0x665e('0x43')]=_0x1d6f86[_0x665e('0x57')];_0x1bbf91[_0x665e('0x45')]=this[_0x665e('0x10')][_0x1bbf91['name']]&&this[_0x665e('0x10')][_0x1bbf91[_0x665e('0x43')]]['type']?this[_0x665e('0x10')][_0x1bbf91[_0x665e('0x43')]][_0x665e('0x45')]||_0x665e('0x46'):'inbound';_0x1bbf91['queue']=_0x1d6f86['queue'];_0x1bbf91[_0x665e('0x63')]=moment()[_0x665e('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x1bbf91['position']=_0x1d6f86['position'];_0x1bbf91['count']=_0x1d6f86['count'];_[_0x665e('0x64')](_0x1bbf91,_[_0x665e('0x65')](_0x1d6f86,_[_0x665e('0x66')](_0x1bbf91)));this[_0x665e('0x39')][_0x1d6f86[_0x665e('0x62')]][_0x665e('0x67')](_0x1bbf91);this['channels'][_0x1d6f86[_0x665e('0x62')]]=_0x1bbf91;this[_0x665e('0x68')](_0x1bbf91);}}catch(_0x7f4df6){logger[_0x665e('0x37')](_0x665e('0x69'),util[_0x665e('0x3f')](_0x7f4df6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x665e('0x2e')][_0x665e('0x6a')]=function(_0x3e268f){try{if(this[_0x665e('0x53')](_0x3e268f)){if(this[_0x665e('0x39')][_0x3e268f[_0x665e('0x62')]]){var _0x2c0026=_[_0x665e('0x6b')](this['queueReports'][_0x3e268f['uniqueid']]);_0x2c0026[_0x665e('0x6c')]=![];_0x2c0026['queuecallercompleteAt']=null;_0x2c0026[_0x665e('0x6d')]=_0x3e268f[_0x665e('0x6d')];_0x2c0026[_0x665e('0x6e')]=_0x3e268f[_0x665e('0x6e')];_0x2c0026[_0x665e('0x18')]=!![];_0x2c0026[_0x665e('0x6f')]=moment()[_0x665e('0x41')](_0x665e('0x70'));_0x2c0026['queuecallerexitreason']='ABANDONED';_0x2c0026[_0x665e('0x71')]=null;this[_0x665e('0xf')][_0x3e268f[_0x665e('0x62')]]=_0x2c0026;this[_0x665e('0x3e')](_0x2c0026);}}}catch(_0x3c7ac2){logger[_0x665e('0x37')](_0x665e('0x72'),util[_0x665e('0x3f')](_0x3c7ac2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x665e('0x2e')][_0x665e('0x1a')]=function(_0x3b53e2){try{if(this[_0x665e('0x53')](_0x3b53e2)){if(this[_0x665e('0x39')][_0x3b53e2[_0x665e('0x62')]]){var _0x305772=_[_0x665e('0x6b')](this[_0x665e('0x39')][_0x3b53e2[_0x665e('0x62')]]);_0x305772['queuecallerleaveAt']=moment()[_0x665e('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x305772[_0x665e('0x73')]=_0x3b53e2[_0x665e('0x73')];_0x305772[_0x665e('0x74')]=_0x3b53e2[_0x665e('0x74')];this['channels'][_0x3b53e2[_0x665e('0x62')]]=_0x305772;this[_0x665e('0x68')](_0x305772);}}}catch(_0x130b04){logger[_0x665e('0x37')](_0x665e('0x75'),util[_0x665e('0x3f')](_0x130b04,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x665e('0x2e')][_0x665e('0x76')]=function(_0x1f07af){try{if(this['isNotNull'](_0x1f07af)){if(this[_0x665e('0x39')][_0x1f07af['uniqueid']]){var _0xd66068=_[_0x665e('0x6b')](this[_0x665e('0x39')][_0x1f07af['uniqueid']]);_0xd66068[_0x665e('0x6c')]=!![];_0xd66068['queuecallerexitreason']=_0x665e('0x77');}}}catch(_0x159008){logger[_0x665e('0x37')](_0x665e('0x78'),util['inspect'](_0x159008,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x665e('0x2e')][_0x665e('0x79')]=function(_0x57e2c7){try{if(this[_0x665e('0x53')](_0x57e2c7)){if(this[_0x665e('0x39')][_0x57e2c7[_0x665e('0x62')]]){var _0x2beb62=_[_0x665e('0x6b')](this[_0x665e('0x39')][_0x57e2c7[_0x665e('0x62')]]);_0x2beb62['queuecallerabandon']=![];_0x2beb62['queuecallerabandonAt']=null;_0x2beb62[_0x665e('0x7a')]=!![];_0x2beb62[_0x665e('0x71')]=_0x57e2c7['membername'];_0x2beb62[_0x665e('0x6d')]=_0x57e2c7[_0x665e('0x6d')];_0x2beb62[_0x665e('0x6c')]=!![];_0x2beb62[_0x665e('0x7b')]=![];_0x2beb62[_0x665e('0x7c')]=null;if(!_0x2beb62['transfer']){if(_0x57e2c7['reason']==_0x665e('0x7d')){_0x2beb62['queuecallerexitreason']=_0x665e('0x7e');}else{if(_['startsWith'](_0x57e2c7['channel'][_0x665e('0x7f')](),_0x665e('0x80'))){if(this[_0x665e('0x39')][_0x57e2c7['linkedid']]){var _0x174638=_[_0x665e('0x6b')](this[_0x665e('0x39')][_0x57e2c7['linkedid']]);_0x174638[_0x665e('0x6c')]=![];_0x174638[_0x665e('0x7b')]=!![];_0x174638['queuecallerexitAt']=moment(_0x2beb62[_0x665e('0x63')])[_0x665e('0x81')](_0x57e2c7[_0x665e('0x6d')],_0x665e('0x82'))[_0x665e('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x174638[_0x665e('0x83')]='FORWARDTRANSFER';_0x174638[_0x665e('0x7d')]=!![];_0x174638['transfertype']=_0x665e('0x84');_0x174638['transferexten']=_0x57e2c7['destexten'];_0x174638[_0x665e('0x85')]=_0x57e2c7['uniqueid'];var _0x28157d=this[_0x665e('0x39')][_0x57e2c7[_0x665e('0x86')]];this[_0x665e('0x39')][_0x57e2c7[_0x665e('0x86')]]=this['queueReports'][_0x57e2c7[_0x665e('0x62')]];this[_0x665e('0x39')][_0x57e2c7[_0x665e('0x62')]]=_0x28157d;}}else{_0x2beb62['queuecallerexitreason']='COMPLETEDBY'+_0x57e2c7[_0x665e('0x87')][_0x665e('0x88')]();}}}this['channels'][_0x57e2c7[_0x665e('0x62')]]=_0x2beb62;this['emitVoiceQueueChannelRemove'](_0x2beb62);}}}catch(_0xa5914d){logger[_0x665e('0x37')]('[syncAgentComplete][VoiceQueueReport]',util[_0x665e('0x3f')](_0xa5914d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x665e('0x1e')]=function(_0x5a9839){try{if(this['isNotNull'](_0x5a9839)){this[_0x665e('0x89')](_0x5a9839[_0x665e('0x62')],_[_0x665e('0x66')](_0x5a9839[_0x665e('0x8a')])[0x0],_0x5a9839[_0x665e('0x8b')]);if(this[_0x665e('0x39')][_0x5a9839[_0x665e('0x62')]]){var _0x1d0e66=_[_0x665e('0x6b')](this[_0x665e('0x39')][_0x5a9839[_0x665e('0x62')]]);if(_0x1d0e66){if(this[_0x665e('0x53')](_0x5a9839[_0x665e('0x8a')])&&this[_0x665e('0x53')](_0x5a9839['variable'][_0x665e('0x8c')])){switch(_0x5a9839[_0x665e('0x8b')]){case _0x665e('0x8d'):_0x1d0e66['queuecallerexit']=![];_0x1d0e66['queuecallerexitAt']=null;break;default:_0x1d0e66[_0x665e('0x7b')]=!![];_0x1d0e66[_0x665e('0x7c')]=moment()[_0x665e('0x41')](_0x665e('0x70'));_0x1d0e66[_0x665e('0x8e')]=moment()[_0x665e('0x41')](_0x665e('0x70'));}_0x1d0e66[_0x665e('0x18')]=![];_0x1d0e66[_0x665e('0x6f')]=null;_0x1d0e66[_0x665e('0x83')]=_0x5a9839[_0x665e('0x8b')];this[_0x665e('0xf')][_0x5a9839['uniqueid']]=_0x1d0e66;this[_0x665e('0x3e')](_0x1d0e66);}else if(this[_0x665e('0x53')](_0x5a9839[_0x665e('0x8a')])&&this[_0x665e('0x53')](_0x5a9839[_0x665e('0x8a')][_0x665e('0x8f')])){if(!_0x1d0e66[_0x665e('0x18')]){_0x1d0e66[_0x665e('0x7b')]=!![];_0x1d0e66[_0x665e('0x7c')]=moment()[_0x665e('0x41')](_0x665e('0x70'));_0x1d0e66['queuecallerexitreason']=_0x665e('0x90');_0x1d0e66[_0x665e('0x8e')]=moment()[_0x665e('0x41')](_0x665e('0x70'));this[_0x665e('0xf')][_0x5a9839[_0x665e('0x62')]]=_0x1d0e66;}}_0x1d0e66[_0x665e('0x12')]=this[_0x665e('0x12')][_0x5a9839[_0x665e('0x62')]];}}}}catch(_0x200b73){logger[_0x665e('0x37')]('[syncVarSet][VoiceQueueReport]',util[_0x665e('0x3f')](_0x200b73,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x665e('0x2e')]['addVariable']=function(_0x2c368d,_0x32569f,_0x6db4e2){var _0x3429ee=[_0x665e('0x91'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x665e('0x92'),_0x665e('0x93'),_0x665e('0x94'),_0x665e('0x95'),_0x665e('0x96'),'sipcallid',_0x665e('0x97'),_0x665e('0x98'),'bridgepvtcallid','membercalls',_0x665e('0x99'),_0x665e('0x9a'),_0x665e('0x9b'),'membername',_0x665e('0x9c'),_0x665e('0x9d')];if(!_[_0x665e('0x31')](_0x32569f)&&!_[_0x665e('0x9e')](_0x3429ee,_0x32569f)){if(_['isUndefined'](this['variables'][_0x2c368d])){this[_0x665e('0x12')][_0x2c368d]={};}this[_0x665e('0x12')][_0x2c368d][_0x32569f]=_0x6db4e2;}};VoiceQueueReport[_0x665e('0x2e')]['syncHangup']=function(_0x5e5c3e){try{if(this[_0x665e('0x53')](_0x5e5c3e)){if(this['queueReports'][_0x5e5c3e[_0x665e('0x62')]]){for(var _0x49b9e7=0x0,_0x379ac0={};_0x49b9e7=0x0?moment(_0x2b1b2b['endtime'])[_0x7e62('0xc')](_0x2b1b2b['starttime'],_0x7e62('0xd')):null,'data1':_0x7e62('0x1a'),'data2':_0x2b1b2b[_0x7e62('0x13')],'data3':_0x2b1b2b[_0x7e62('0x10')],'data4':_0x2b1b2b[_0x7e62('0x1b')]||null,'role':'agent','internal':_0x2b1b2b[_0x7e62('0x13')]?_['toNumber'](_0x2b1b2b['accountcode']):undefined,'uniqueid':_0x2b1b2b[_0x7e62('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xec74=['dialstring','toNumber','uniqueid','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','accountcode','voiceDialReport','CreateMemberReport','voice','starttime','outbound','exten'];(function(_0x2bc72c,_0x1c1ae0){var _0x597e4a=function(_0x3df641){while(--_0x3df641){_0x2bc72c['push'](_0x2bc72c['shift']());}};_0x597e4a(++_0x1c1ae0);}(_0xec74,0x12c));var _0x4ec7=function(_0x1818ef,_0x2fb6f0){_0x1818ef=_0x1818ef-0x0;var _0x200bbc=_0xec74[_0x1818ef];return _0x200bbc;};'use strict';var moment=require(_0x4ec7('0x0'));var _=require(_0x4ec7('0x1'));var util=require(_0x4ec7('0x2'));var client=require(_0x4ec7('0x3'));exports[_0x4ec7('0x4')]=function(_0x3043b1){var _0x6ed7c=_0x3043b1[_0x4ec7('0x5')]||_0x3043b1[_0x4ec7('0x6')];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3043b1[_0x4ec7('0x7')],'interface':_[_0x4ec7('0x8')](_0x3043b1[_0x4ec7('0x9')])?util[_0x4ec7('0xa')](_0x4ec7('0xb'),_0x3043b1[_0x4ec7('0x7')]):_0x3043b1[_0x4ec7('0x9')],'type':_0x4ec7('0xc'),'enterAt':_0x3043b1[_0x4ec7('0xd')],'exitAt':_0x6ed7c,'duration':moment(_0x6ed7c)[_0x4ec7('0xe')](_0x3043b1[_0x4ec7('0xd')],_0x4ec7('0xf')),'data1':'inbound','data2':_0x3043b1[_0x4ec7('0x10')],'data3':_0x3043b1['exten'],'data4':null,'data5':_0x3043b1['queue'],'role':'agent','internal':_0x3043b1[_0x4ec7('0x11')]?_['toNumber'](_0x3043b1[_0x4ec7('0x11')]):undefined,'uniqueid':_0x3043b1['uniqueid']},'log':'CreateMemberReport'});};exports[_0x4ec7('0x12')]=function(_0x1b0099){return client['Request'](_0x4ec7('0x13'),{'body':{'channel':_0x4ec7('0x14'),'membername':_0x1b0099['membername'],'interface':_0x1b0099[_0x4ec7('0x9')],'type':_0x4ec7('0xc'),'enterAt':_0x1b0099['starttime'],'exitAt':_0x1b0099['endtime'],'duration':moment(_0x1b0099['endtime'])['diff'](_0x1b0099[_0x4ec7('0x15')],_0x4ec7('0xf'))>=0x0?moment(_0x1b0099['endtime'])[_0x4ec7('0xe')](_0x1b0099[_0x4ec7('0x15')],_0x4ec7('0xf')):null,'data1':_0x4ec7('0x16'),'data2':_0x1b0099[_0x4ec7('0x11')],'data3':_0x1b0099[_0x4ec7('0x17')],'data4':_0x1b0099[_0x4ec7('0x18')]||null,'role':'agent','internal':_0x1b0099[_0x4ec7('0x11')]?_[_0x4ec7('0x19')](_0x1b0099[_0x4ec7('0x11')]):undefined,'uniqueid':_0x1b0099[_0x4ec7('0x1a')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6670ae8..4152208 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 _0x59c3=['html','../client','getTemplates','Request','GetTemplate'];(function(_0x444b30,_0x1ba647){var _0x23e75b=function(_0x3a99ef){while(--_0x3a99ef){_0x444b30['push'](_0x444b30['shift']());}};_0x23e75b(++_0x1ba647);}(_0x59c3,0xb0));var _0x359c=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x59c3[_0x5c3c0b];return _0x52ecd2;};'use strict';var client=require(_0x359c('0x0'));exports[_0x359c('0x1')]=function(_0x230e5f){return function(_0xe62c5e){return client[_0x359c('0x2')](_0x359c('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x359c('0x4')]},'log':_0x359c('0x3')});};}; \ No newline at end of file +var _0x6f35=['../client','getTemplates','Request','GetTemplate','name'];(function(_0x202fcb,_0x22d294){var _0x5c2847=function(_0x54053f){while(--_0x54053f){_0x202fcb['push'](_0x202fcb['shift']());}};_0x5c2847(++_0x22d294);}(_0x6f35,0x18b));var _0x56f3=function(_0x3a4d2e,_0xed7b5b){_0x3a4d2e=_0x3a4d2e-0x0;var _0xb7596a=_0x6f35[_0x3a4d2e];return _0xb7596a;};'use strict';var client=require(_0x56f3('0x0'));exports[_0x56f3('0x1')]=function(_0x59f4db){return function(_0x1adbee){return client[_0x56f3('0x2')](_0x56f3('0x3'),{'options':{'raw':!![],'attributes':['id',_0x56f3('0x4'),'html']},'log':_0x56f3('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index f9e927f..8fccfe8 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 _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x544216,_0x3645c6){var _0xa8b010=function(_0x5a5097){while(--_0x5a5097){_0x544216['push'](_0x544216['shift']());}};_0xa8b010(++_0x3645c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x37978c,_0x29ed82){var _0x18306c=function(_0x47880c){while(--_0x47880c){_0x37978c['push'](_0x37978c['shift']());}};_0x18306c(++_0x29ed82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'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 5c27ffd..5d011ec 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 _0x3a92=['GetTrunk','registry','../client'];(function(_0x4ecfcb,_0x9bce22){var _0x2324c4=function(_0x5c8d11){while(--_0x5c8d11){_0x4ecfcb['push'](_0x4ecfcb['shift']());}};_0x2324c4(++_0x9bce22);}(_0x3a92,0x1e8));var _0x23a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a92[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x23a9('0x0'));exports['getTrunks']=function(_0x2f703f){return function(_0xc631c){return client['Request'](_0x23a9('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x23a9('0x2')]},'log':_0x23a9('0x1')});};}; \ No newline at end of file +var _0xfa1d=['Request','GetTrunk','name','registry','getTrunks'];(function(_0x4a669e,_0x431b9c){var _0x27dd1c=function(_0xa07cb8){while(--_0xa07cb8){_0x4a669e['push'](_0x4a669e['shift']());}};_0x27dd1c(++_0x431b9c);}(_0xfa1d,0x1e9));var _0xdfa1=function(_0x44e4e1,_0x5637b2){_0x44e4e1=_0x44e4e1-0x0;var _0x300cd2=_0xfa1d[_0x44e4e1];return _0x300cd2;};'use strict';var client=require('../client');exports[_0xdfa1('0x0')]=function(_0x263e88){return function(_0x2bdcc4){return client[_0xdfa1('0x1')](_0xdfa1('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xdfa1('0x3'),_0xdfa1('0x4')]},'log':_0xdfa1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9e75af1..1e89161 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 _0x2f68=['interface','getTelephones','Request','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','online','voicePause','getAgent','../client','getAgents','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','mobile'];(function(_0x5e8dab,_0x5602b0){var _0x499cc0=function(_0x2d0ab8){while(--_0x2d0ab8){_0x5e8dab['push'](_0x5e8dab['shift']());}};_0x499cc0(++_0x5602b0);}(_0x2f68,0x71));var _0x82f6=function(_0x116274,_0x506043){_0x116274=_0x116274-0x0;var _0xe20bf=_0x2f68[_0x116274];return _0xe20bf;};'use strict';var client=require(_0x82f6('0x0'));exports[_0x82f6('0x1')]=function(){return function(){return client['Request'](_0x82f6('0x2'),{'options':{'raw':![],'where':{'role':_0x82f6('0x3')},'attributes':['id',_0x82f6('0x4'),_0x82f6('0x5'),_0x82f6('0x6'),_0x82f6('0x7'),'online',_0x82f6('0x8'),_0x82f6('0x9'),_0x82f6('0xa'),'voicePause','phone',_0x82f6('0xb'),_0x82f6('0xc')]},'log':_0x82f6('0x1')});};};exports[_0x82f6('0xd')]=function(){return function(){return client[_0x82f6('0xe')](_0x82f6('0x2'),{'options':{'raw':!![],'where':{'role':_0x82f6('0xf')},'attributes':['id',_0x82f6('0x4'),_0x82f6('0x6'),_0x82f6('0x10')]},'log':_0x82f6('0xd')});};};exports[_0x82f6('0x11')]=function(_0x19c340,_0x51eb84,_0x5dfdd0){return client['Request'](_0x82f6('0x12'),{'body':{'type':_0x51eb84,'uniqueid':_0x5dfdd0},'options':{'where':{'id':_0x19c340['id']}},'log':_0x82f6('0x11')});};exports[_0x82f6('0x13')]=function(_0x55187b){return client[_0x82f6('0xe')](_0x82f6('0x14'),{'body':{},'options':{'where':{'id':_0x55187b['id']}},'log':'savePause'});};exports['getAgent']=function(_0x25160a){return client[_0x82f6('0xe')](_0x82f6('0x15'),{'options':{'raw':![],'where':{'role':_0x82f6('0x3'),'id':_0x25160a},'attributes':['id','name','email',_0x82f6('0x6'),'fullname',_0x82f6('0x16'),'lastLoginAt',_0x82f6('0x9'),_0x82f6('0xa'),_0x82f6('0x17'),'interface']},'log':_0x82f6('0x18')});}; \ No newline at end of file +var _0x0b82=['email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','accountcode','internal','savePause','PauseUser','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','GetUser','agent','name'];(function(_0x541ca2,_0x61657d){var _0x329d47=function(_0x598c09){while(--_0x598c09){_0x541ca2['push'](_0x541ca2['shift']());}};_0x329d47(++_0x61657d);}(_0x0b82,0x171));var _0x20b8=function(_0x5c1c98,_0xc733b0){_0x5c1c98=_0x5c1c98-0x0;var _0x45e95a=_0x0b82[_0x5c1c98];return _0x45e95a;};'use strict';var client=require(_0x20b8('0x0'));exports[_0x20b8('0x1')]=function(){return function(){return client[_0x20b8('0x2')](_0x20b8('0x3'),{'options':{'raw':![],'where':{'role':_0x20b8('0x4')},'attributes':['id',_0x20b8('0x5'),_0x20b8('0x6'),'accountcode',_0x20b8('0x7'),_0x20b8('0x8'),_0x20b8('0x9'),_0x20b8('0xa'),_0x20b8('0xb'),_0x20b8('0xc'),_0x20b8('0xd'),_0x20b8('0xe'),_0x20b8('0xf')]},'log':_0x20b8('0x1')});};};exports[_0x20b8('0x10')]=function(){return function(){return client[_0x20b8('0x2')](_0x20b8('0x3'),{'options':{'raw':!![],'where':{'role':_0x20b8('0x11')},'attributes':['id',_0x20b8('0x5'),_0x20b8('0x12'),_0x20b8('0x13')]},'log':'getTelephones'});};};exports[_0x20b8('0x14')]=function(_0x175f15,_0x16e07a,_0x370677){return client['Request'](_0x20b8('0x15'),{'body':{'type':_0x16e07a,'uniqueid':_0x370677},'options':{'where':{'id':_0x175f15['id']}},'log':_0x20b8('0x14')});};exports['saveUnpause']=function(_0x201811){return client[_0x20b8('0x2')](_0x20b8('0x16'),{'body':{},'options':{'where':{'id':_0x201811['id']}},'log':_0x20b8('0x14')});};exports['getAgent']=function(_0x3cc049){return client[_0x20b8('0x2')](_0x20b8('0x17'),{'options':{'raw':![],'where':{'role':_0x20b8('0x4'),'id':_0x3cc049},'attributes':['id','name',_0x20b8('0x6'),_0x20b8('0x12'),_0x20b8('0x7'),_0x20b8('0x8'),_0x20b8('0x9'),_0x20b8('0xa'),_0x20b8('0xb'),_0x20b8('0xc'),'interface']},'log':_0x20b8('0x18')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 433a0ff..2944a47 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 _0x673c=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x200ee7,_0xf264be){var _0x50fad1=function(_0xbf1dfa){while(--_0xbf1dfa){_0x200ee7['push'](_0x200ee7['shift']());}};_0x50fad1(++_0xf264be);}(_0x673c,0x148));var _0xc673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x673c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc673('0x0'));exports[_0xc673('0x1')]=function(_0x1bcff7){return client[_0xc673('0x2')](_0xc673('0x3'),{'body':_0x1bcff7,'log':_0xc673('0x3')});};exports[_0xc673('0x4')]=function(_0x533292,_0xdea8f3,_0x759f7e){return client[_0xc673('0x2')]('UpdateVoiceAgentReport',{'body':_0x533292,'options':{'where':{'uniqueid':_0xdea8f3,'interface':_0x759f7e}},'log':_0xc673('0x5')});}; \ No newline at end of file +var _0xd22c=['../client','CreateVoiceAgentReport','update','Request'];(function(_0x3bc0c4,_0x12be65){var _0x145000=function(_0x26e8f6){while(--_0x26e8f6){_0x3bc0c4['push'](_0x3bc0c4['shift']());}};_0x145000(++_0x12be65);}(_0xd22c,0xf4));var _0xcd22=function(_0x346df7,_0x3404ad){_0x346df7=_0x346df7-0x0;var _0x504fd8=_0xd22c[_0x346df7];return _0x504fd8;};'use strict';var client=require(_0xcd22('0x0'));exports['create']=function(_0xb01925){return client['Request'](_0xcd22('0x1'),{'body':_0xb01925,'log':_0xcd22('0x1')});};exports[_0xcd22('0x2')]=function(_0x4e00d9,_0x43034c,_0x463939){return client[_0xcd22('0x3')]('UpdateVoiceAgentReport',{'body':_0x4e00d9,'options':{'where':{'uniqueid':_0x43034c,'interface':_0x463939}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 93ec236..7c02d22 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 _0x5906=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0x32548c,_0x413495){var _0x5ce3e4=function(_0x7d2ee9){while(--_0x7d2ee9){_0x32548c['push'](_0x32548c['shift']());}};_0x5ce3e4(++_0x413495);}(_0x5906,0x93));var _0x6590=function(_0x22abe1,_0x89f196){_0x22abe1=_0x22abe1-0x0;var _0x51e0fe=_0x5906[_0x22abe1];return _0x51e0fe;};'use strict';var moment=require('moment');var util=require(_0x6590('0x0'));var _=require(_0x6590('0x1'));var client=require(_0x6590('0x2'));exports[_0x6590('0x3')]=function(_0x597f56){return client[_0x6590('0x4')]('CreateVoiceCallReport',{'body':_[_0x6590('0x5')](_0x597f56,{'source':_0x597f56[_0x6590('0x6')],'destinationcontext':_0x597f56[_0x6590('0x7')],'callerid':_0x597f56[_0x6590('0x8')],'amaflags':_0x6590('0x9')}),'log':_0x6590('0xa')});};exports[_0x6590('0xb')]=function(){return function(){return client[_0x6590('0x4')](_0x6590('0xc'),{'options':{'where':{'type':[_0x6590('0xd')],'createdAt':{'$between':[moment()[_0x6590('0xe')](_0x6590('0xf'))[_0x6590('0x10')](_0x6590('0x11')),moment()[_0x6590('0x12')]('day')['format'](_0x6590('0x11'))]}},'attributes':['type',_0x6590('0x13'),_0x6590('0x14'),_0x6590('0x15')]},'log':_0x6590('0x16')});};}; \ No newline at end of file +var _0xa291=['format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day'];(function(_0x80e3c8,_0x3bda46){var _0x10c710=function(_0x4c5b22){while(--_0x4c5b22){_0x80e3c8['push'](_0x80e3c8['shift']());}};_0x10c710(++_0x3bda46);}(_0xa291,0x12c));var _0x1a29=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0xa291[_0x2125f0];return _0x12d6eb;};'use strict';var moment=require('moment');var util=require(_0x1a29('0x0'));var _=require(_0x1a29('0x1'));var client=require(_0x1a29('0x2'));exports[_0x1a29('0x3')]=function(_0xc073b){return client[_0x1a29('0x4')](_0x1a29('0x5'),{'body':_[_0x1a29('0x6')](_0xc073b,{'source':_0xc073b[_0x1a29('0x7')],'destinationcontext':_0xc073b[_0x1a29('0x8')],'callerid':_0xc073b[_0x1a29('0x9')],'amaflags':_0x1a29('0xa')}),'log':_0x1a29('0x5')});};exports[_0x1a29('0xb')]=function(){return function(){return client[_0x1a29('0x4')](_0x1a29('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x1a29('0xd')](_0x1a29('0xe'))[_0x1a29('0xf')](_0x1a29('0x10')),moment()['endOf']('day')[_0x1a29('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x1a29('0x11'),'disposition',_0x1a29('0x12'),_0x1a29('0x13')]},'log':_0x1a29('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 3974bc5..e0d3822 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 _0x4cc3=['CreateVoiceDialReport','../client','create','Request'];(function(_0x71bb3,_0x316ff8){var _0x6849c=function(_0xc98614){while(--_0xc98614){_0x71bb3['push'](_0x71bb3['shift']());}};_0x6849c(++_0x316ff8);}(_0x4cc3,0x19d));var _0x34cc=function(_0x5e157d,_0xa6d110){_0x5e157d=_0x5e157d-0x0;var _0x1a7bb5=_0x4cc3[_0x5e157d];return _0x1a7bb5;};'use strict';var client=require(_0x34cc('0x0'));exports[_0x34cc('0x1')]=function(_0x439c47){return client[_0x34cc('0x2')](_0x34cc('0x3'),{'body':_0x439c47,'log':_0x34cc('0x3')});}; \ No newline at end of file +var _0x7a29=['Request','CreateVoiceDialReport','../client','create'];(function(_0x494f61,_0x48140b){var _0x1e26b2=function(_0x287c6a){while(--_0x287c6a){_0x494f61['push'](_0x494f61['shift']());}};_0x1e26b2(++_0x48140b);}(_0x7a29,0x76));var _0x97a2=function(_0x1c7782,_0x5d7617){_0x1c7782=_0x1c7782-0x0;var _0x2195b1=_0x7a29[_0x1c7782];return _0x2195b1;};'use strict';var client=require(_0x97a2('0x0'));exports[_0x97a2('0x1')]=function(_0x7a6790){return client[_0x97a2('0x2')]('CreateVoiceDialReport',{'body':_0x7a6790,'log':_0x97a2('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index fa22f9c..0610613 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 _0xe4fa=['../client','Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x1122a0,_0x2af894){var _0x4f0541=function(_0x2cfd90){while(--_0x2cfd90){_0x1122a0['push'](_0x1122a0['shift']());}};_0x4f0541(++_0x2af894);}(_0xe4fa,0xcd));var _0xae4f=function(_0x56ff7b,_0x20d151){_0x56ff7b=_0x56ff7b-0x0;var _0x31fff3=_0xe4fa[_0x56ff7b];return _0x31fff3;};'use strict';var client=require(_0xae4f('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xae4f('0x1')](_0xae4f('0x2'),{'options':{'raw':!![],'attributes':['id',_0xae4f('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xae4f('0x4')});};}; \ No newline at end of file +var _0x9316=['recordingFormat','getVoiceExtensions'];(function(_0x1b8347,_0x3e69a7){var _0x1619a6=function(_0x195c34){while(--_0x195c34){_0x1b8347['push'](_0x1b8347['shift']());}};_0x1619a6(++_0x3e69a7);}(_0x9316,0x98));var _0x6931=function(_0x34dcfc,_0x58aae7){_0x34dcfc=_0x34dcfc-0x0;var _0x2bf82c=_0x9316[_0x34dcfc];return _0x2bf82c;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x6931('0x0')],'where':{'VoiceExtensionId':null}},'log':_0x6931('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b0d58c6..9b84574 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 _0x189f=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','mandatoryDisposition','Trunk','callerid','Pause','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','monitor_format','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x1e3608,_0x143526){var _0x21da32=function(_0x25483b){while(--_0x25483b){_0x1e3608['push'](_0x1e3608['shift']());}};_0x21da32(++_0x143526);}(_0x189f,0x145));var _0xf189=function(_0x50e89b,_0x4bded8){_0x50e89b=_0x50e89b-0x0;var _0x4b9202=_0x189f[_0x50e89b];return _0x4b9202;};'use strict';var client=require(_0xf189('0x0'));exports[_0xf189('0x1')]=function(){return function(){return client[_0xf189('0x2')](_0xf189('0x3'),{'options':{'raw':![],'attributes':['id',_0xf189('0x4'),'acw','acwTimeout','autopause',_0xf189('0x5'),_0xf189('0x6'),_0xf189('0x7'),'dialMethod','dialLimitChannel',_0xf189('0x8'),_0xf189('0x9'),_0xf189('0xa'),_0xf189('0xb'),_0xf189('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xf189('0xd'),_0xf189('0xe'),'dialQueueTimeout',_0xf189('0xf'),'dialCongestionMaxRetry',_0xf189('0x10'),_0xf189('0x11'),_0xf189('0x12'),_0xf189('0x13'),'dialNoAnswerRetryFrequency',_0xf189('0x14'),'dialTimezone','dialGlobalInterval',_0xf189('0x15'),'dialCheckDuplicateType',_0xf189('0x16'),_0xf189('0x17'),_0xf189('0x18'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0xf189('0x19'),_0xf189('0x1a'),_0xf189('0x1b'),_0xf189('0x1c'),_0xf189('0x1d'),_0xf189('0x1e'),'dialRecallInQueue',_0xf189('0x1f'),'dialAgiAfterHangupAgent',_0xf189('0x20'),_0xf189('0x21'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber',_0xf189('0x22'),_0xf189('0x23'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xf189('0x24'),'as':_0xf189('0x24'),'attributes':['id',_0xf189('0x4'),_0xf189('0x25'),'active']},{'model':_0xf189('0x26'),'as':'mandatoryDispositionPause','attributes':['id',_0xf189('0x4')]},{'model':_0xf189('0x24'),'as':_0xf189('0x27'),'attributes':['id','name','callerid',_0xf189('0x28')]},{'model':'Interval','as':'Interval','attributes':['id',_0xf189('0x4')],'include':[{'model':_0xf189('0x29'),'as':_0xf189('0x2a'),'attributes':['id',_0xf189('0x4'),_0xf189('0x2b')]}]}]},'log':_0xf189('0x1')});};}; \ No newline at end of file +var _0x8069=['dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','name','acwTimeout','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber'];(function(_0x52790e,_0x34910b){var _0x275ce9=function(_0x197fa7){while(--_0x197fa7){_0x52790e['push'](_0x52790e['shift']());}};_0x275ce9(++_0x34910b);}(_0x8069,0x6f));var _0x9806=function(_0x6f13df,_0x4de85c){_0x6f13df=_0x6f13df-0x0;var _0x3ea2c4=_0x8069[_0x6f13df];return _0x3ea2c4;};'use strict';var client=require(_0x9806('0x0'));exports[_0x9806('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x9806('0x2'),'acw',_0x9806('0x3'),'autopause',_0x9806('0x4'),_0x9806('0x5'),_0x9806('0x6'),'dialMethod',_0x9806('0x7'),_0x9806('0x8'),_0x9806('0x9'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x9806('0xa'),_0x9806('0xb'),_0x9806('0xc'),'dialOriginateTimeout',_0x9806('0xd'),_0x9806('0xe'),_0x9806('0xf'),_0x9806('0x10'),_0x9806('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x9806('0x12'),'dialGlobalMaxRetry',_0x9806('0x13'),_0x9806('0x14'),_0x9806('0x15'),_0x9806('0x16'),_0x9806('0x17'),_0x9806('0x18'),_0x9806('0x19'),_0x9806('0x1a'),_0x9806('0x1b'),_0x9806('0x1c'),'dialAMDBetweenWordsSilence',_0x9806('0x1d'),_0x9806('0x1e'),_0x9806('0x1f'),_0x9806('0x20'),_0x9806('0x21'),_0x9806('0x22'),_0x9806('0x23'),'dialAgiAfterHangupAgent',_0x9806('0x24'),'dialQueueProject2',_0x9806('0x4'),_0x9806('0x25'),_0x9806('0x26'),_0x9806('0x27'),_0x9806('0x28'),'dialPredictiveIntervalMaxThreshold',_0x9806('0x29')],'include':[{'model':_0x9806('0x2a'),'as':_0x9806('0x2a'),'attributes':['id',_0x9806('0x2'),_0x9806('0x2b'),_0x9806('0x2c')]},{'model':_0x9806('0x2d'),'as':_0x9806('0x2e'),'attributes':['id',_0x9806('0x2')]},{'model':_0x9806('0x2a'),'as':_0x9806('0x2f'),'attributes':['id',_0x9806('0x2'),_0x9806('0x2b'),_0x9806('0x2c')]},{'model':_0x9806('0x30'),'as':_0x9806('0x30'),'attributes':['id',_0x9806('0x2')],'include':[{'model':_0x9806('0x30'),'as':'Intervals','attributes':['id','name',_0x9806('0x31')]}]}]},'log':_0x9806('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 72f9049..8c3185b 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 _0xc51f=['day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','GetVoiceQueueReports','moment','lodash','../client','create','CreateVoiceQueueReport','getVoiceQueueReports','Request','GetVoiceQueueReport','startOf'];(function(_0xda9b45,_0xf29797){var _0x367025=function(_0x9cc9bc){while(--_0x9cc9bc){_0xda9b45['push'](_0xda9b45['shift']());}};_0x367025(++_0xf29797);}(_0xc51f,0x187));var _0xfc51=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0xc51f[_0x1d7037];return _0x4d6568;};'use strict';var moment=require(_0xfc51('0x0'));var _=require(_0xfc51('0x1'));var client=require(_0xfc51('0x2'));exports[_0xfc51('0x3')]=function(_0x57d711){return client['Request'](_0xfc51('0x4'),{'body':_0x57d711,'log':_0xfc51('0x4')});};exports[_0xfc51('0x5')]=function(){return function(){return client[_0xfc51('0x6')](_0xfc51('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xfc51('0x8')](_0xfc51('0x9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xfc51('0xa')]('day')[_0xfc51('0xb')](_0xfc51('0xc'))]}},'attributes':['uniqueid',_0xfc51('0xd'),_0xfc51('0xe'),_0xfc51('0xf'),'queuecallercomplete',_0xfc51('0x10'),_0xfc51('0x11'),_0xfc51('0x12'),'queuecallerabandon','queuecallerabandonAt']},'log':_0xfc51('0x13')});};}; \ No newline at end of file +var _0x2574=['moment','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','day','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x2574,0x11d));var _0x4257=function(_0xc59ae5,_0x1d28ca){_0xc59ae5=_0xc59ae5-0x0;var _0x3e054f=_0x2574[_0xc59ae5];return _0x3e054f;};'use strict';var moment=require(_0x4257('0x0'));var _=require('lodash');var client=require(_0x4257('0x1'));exports[_0x4257('0x2')]=function(_0x56c1d6){return client[_0x4257('0x3')](_0x4257('0x4'),{'body':_0x56c1d6,'log':_0x4257('0x4')});};exports[_0x4257('0x5')]=function(){return function(){return client[_0x4257('0x3')](_0x4257('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x4257('0x7')]('day')[_0x4257('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x4257('0x9'))[_0x4257('0x8')](_0x4257('0xa'))]}},'attributes':['uniqueid',_0x4257('0xb'),_0x4257('0xc'),_0x4257('0xd'),'queuecallercomplete',_0x4257('0xe'),'queuecallerexit',_0x4257('0xf'),_0x4257('0x10'),_0x4257('0x11')]},'log':_0x4257('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 8e0b5ec..6873142 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 _0x094c=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x1436e1,_0x33ad78){var _0x38bb8a=function(_0x23dd78){while(--_0x23dd78){_0x1436e1['push'](_0x1436e1['shift']());}};_0x38bb8a(++_0x33ad78);}(_0x094c,0x131));var _0xc094=function(_0x36a786,_0x1f112a){_0x36a786=_0x36a786-0x0;var _0x371498=_0x094c[_0x36a786];return _0x371498;};'use strict';var client=require('../client');exports[_0xc094('0x0')]=function(_0x1fc9a5){return function(){return client['Request'](_0xc094('0x1'),{'options':{'where':{'VoiceQueueId':_0x1fc9a5,'paused':!![]},'raw':!![]},'log':_0xc094('0x0')});};}; \ No newline at end of file +var _0x6070=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x6070,0x12e));var _0x0607=function(_0x5852d8,_0x207105){_0x5852d8=_0x5852d8-0x0;var _0x2af15d=_0x6070[_0x5852d8];return _0x2af15d;};'use strict';var client=require('../client');exports[_0x0607('0x0')]=function(_0xc5c291){return function(){return client[_0x0607('0x1')](_0x0607('0x2'),{'options':{'where':{'VoiceQueueId':_0xc5c291,'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 1660879..629b184 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 _0x792f=['lodash','create','Request','CreateVoiceRecording','monitorFilename'];(function(_0x4c9a7d,_0x386611){var _0x2f7fb9=function(_0x2c9fcc){while(--_0x2c9fcc){_0x4c9a7d['push'](_0x4c9a7d['shift']());}};_0x2f7fb9(++_0x386611);}(_0x792f,0xa5));var _0xf792=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x792f[_0x1f44e4];return _0x591989;};'use strict';var _=require(_0xf792('0x0'));var client=require('../client');exports[_0xf792('0x1')]=function(_0x23c678){return client[_0xf792('0x2')](_0xf792('0x3'),{'body':_['merge'](_0x23c678,{'value':_0x23c678[_0xf792('0x4')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x7ad6=['CreateVoiceRecording','lodash','../client','create','merge','monitorFilename'];(function(_0x54e1de,_0x5d6357){var _0x5acb3a=function(_0x53269a){while(--_0x53269a){_0x54e1de['push'](_0x54e1de['shift']());}};_0x5acb3a(++_0x5d6357);}(_0x7ad6,0x18d));var _0x67ad=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7ad6[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x67ad('0x0'));var client=require(_0x67ad('0x1'));exports[_0x67ad('0x2')]=function(_0x3881fe){return client['Request']('CreateVoiceRecording',{'body':_[_0x67ad('0x3')](_0x3881fe,{'value':_0x3881fe[_0x67ad('0x4')]}),'log':_0x67ad('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index cbbcd1f..fded53f 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 _0xf60c=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer'];(function(_0x58c4bc,_0x80c91f){var _0x2a1818=function(_0x34a10e){while(--_0x34a10e){_0x58c4bc['push'](_0x58c4bc['shift']());}};_0x2a1818(++_0x80c91f);}(_0xf60c,0xf4));var _0xcf60=function(_0x53dd61,_0x386863){_0x53dd61=_0x53dd61-0x0;var _0x325ca9=_0xf60c[_0x53dd61];return _0x325ca9;};'use strict';var client=require(_0xcf60('0x0'));exports[_0xcf60('0x1')]=function(_0x2c5c30){return client[_0xcf60('0x2')](_0xcf60('0x3'),{'body':{'result':_0x2c5c30[_0xcf60('0x4')],'transfererchannel':_0x2c5c30['transfererchannel'],'transferercalleridnum':_0x2c5c30[_0xcf60('0x5')],'transferercalleridname':_0x2c5c30[_0xcf60('0x6')],'transfererconnectedlinenum':_0x2c5c30[_0xcf60('0x7')],'transfererconnectedlinename':_0x2c5c30[_0xcf60('0x8')],'transfereraccountcode':_0x2c5c30[_0xcf60('0x9')],'transferercontext':_0x2c5c30['transferercontext'],'transfererexten':_0x2c5c30['transfererexten'],'transfererlinkedid':_0x2c5c30[_0xcf60('0xa')],'transfereechannel':_0x2c5c30['transfereechannel'],'transfereecalleridnum':_0x2c5c30[_0xcf60('0xb')],'transfereecalleridname':_0x2c5c30[_0xcf60('0xc')],'transfereeconnectedlinenum':_0x2c5c30[_0xcf60('0xd')],'transfereeconnectedlinename':_0x2c5c30['transfereeconnectedlinename'],'transfereeaccountcode':_0x2c5c30['transfereeaccountcode'],'transfereecontext':_0x2c5c30[_0xcf60('0xe')],'transfereeexten':_0x2c5c30[_0xcf60('0xf')],'transfereelinkedid':_0x2c5c30[_0xcf60('0x10')],'isexternal':_0x2c5c30[_0xcf60('0x11')],'context':_0x2c5c30[_0xcf60('0x12')],'extension':_0x2c5c30[_0xcf60('0x13')],'type':_0xcf60('0x14')},'log':_0xcf60('0x3')});};exports[_0xcf60('0x15')]=function(_0x2da1b2){return client[_0xcf60('0x2')](_0xcf60('0x3'),{'body':{'result':_0x2da1b2[_0xcf60('0x4')],'transfererchannel':_0x2da1b2['origtransfererchannel'],'transferercalleridnum':_0x2da1b2[_0xcf60('0x16')],'transferercalleridname':_0x2da1b2[_0xcf60('0x17')],'transfererconnectedlinenum':_0x2da1b2[_0xcf60('0x18')],'transfererconnectedlinename':_0x2da1b2[_0xcf60('0x19')],'transfereraccountcode':_0x2da1b2['origtransfereraccountcode'],'transferercontext':_0x2da1b2[_0xcf60('0x1a')],'transfererexten':_0x2da1b2[_0xcf60('0x1b')],'transfererlinkedid':_0x2da1b2[_0xcf60('0x1c')],'transfereechannel':_0x2da1b2[_0xcf60('0x1d')],'transfereecalleridnum':_0x2da1b2[_0xcf60('0x1e')],'transfereecalleridname':_0x2da1b2['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2da1b2[_0xcf60('0x1f')],'transfereeconnectedlinename':_0x2da1b2[_0xcf60('0x20')],'transfereeaccountcode':_0x2da1b2['transfertargetaccountcode'],'transfereecontext':_0x2da1b2[_0xcf60('0x21')],'transfereeexten':_0x2da1b2[_0xcf60('0x22')],'transfereelinkedid':_0x2da1b2[_0xcf60('0x23')],'isexternal':_0x2da1b2['isexternal'],'context':_0x2da1b2[_0xcf60('0x24')],'extension':_0x2da1b2[_0xcf60('0x25')],'type':'attended'},'log':_0xcf60('0x3')});}; \ No newline at end of file +var _0xe888=['origtransferercontext','origtransfererexten','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinenum','transfereeexten','isexternal','context','extension','blind','Request','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid'];(function(_0x1a0e46,_0x510f37){var _0x5dee50=function(_0x2537f1){while(--_0x2537f1){_0x1a0e46['push'](_0x1a0e46['shift']());}};_0x5dee50(++_0x510f37);}(_0xe888,0xc8));var _0x8e88=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xe888[_0x3c51d4];return _0x53c45f;};'use strict';var client=require('../client');exports[_0x8e88('0x0')]=function(_0x164d86){return client['Request'](_0x8e88('0x1'),{'body':{'result':_0x164d86[_0x8e88('0x2')],'transfererchannel':_0x164d86[_0x8e88('0x3')],'transferercalleridnum':_0x164d86[_0x8e88('0x4')],'transferercalleridname':_0x164d86[_0x8e88('0x5')],'transfererconnectedlinenum':_0x164d86['transfererconnectedlinenum'],'transfererconnectedlinename':_0x164d86[_0x8e88('0x6')],'transfereraccountcode':_0x164d86['transfereraccountcode'],'transferercontext':_0x164d86['transferercontext'],'transfererexten':_0x164d86[_0x8e88('0x7')],'transfererlinkedid':_0x164d86[_0x8e88('0x8')],'transfereechannel':_0x164d86['transfereechannel'],'transfereecalleridnum':_0x164d86[_0x8e88('0x9')],'transfereecalleridname':_0x164d86['transfereecalleridname'],'transfereeconnectedlinenum':_0x164d86[_0x8e88('0xa')],'transfereeconnectedlinename':_0x164d86['transfereeconnectedlinename'],'transfereeaccountcode':_0x164d86['transfereeaccountcode'],'transfereecontext':_0x164d86['transfereecontext'],'transfereeexten':_0x164d86[_0x8e88('0xb')],'transfereelinkedid':_0x164d86['transfereelinkedid'],'isexternal':_0x164d86[_0x8e88('0xc')],'context':_0x164d86[_0x8e88('0xd')],'extension':_0x164d86[_0x8e88('0xe')],'type':_0x8e88('0xf')},'log':_0x8e88('0x1')});};exports['attendedTransfer']=function(_0x494606){return client[_0x8e88('0x10')](_0x8e88('0x1'),{'body':{'result':_0x494606[_0x8e88('0x2')],'transfererchannel':_0x494606[_0x8e88('0x11')],'transferercalleridnum':_0x494606[_0x8e88('0x12')],'transferercalleridname':_0x494606['origtransferercalleridname'],'transfererconnectedlinenum':_0x494606[_0x8e88('0x13')],'transfererconnectedlinename':_0x494606[_0x8e88('0x14')],'transfereraccountcode':_0x494606[_0x8e88('0x15')],'transferercontext':_0x494606['secondtransferercontext'],'transfererexten':_0x494606[_0x8e88('0x16')],'transfererlinkedid':_0x494606[_0x8e88('0x17')],'transfereechannel':_0x494606[_0x8e88('0x18')],'transfereecalleridnum':_0x494606[_0x8e88('0x19')],'transfereecalleridname':_0x494606['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x494606['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x494606[_0x8e88('0x1a')],'transfereeaccountcode':_0x494606[_0x8e88('0x1b')],'transfereecontext':_0x494606[_0x8e88('0x1c')],'transfereeexten':_0x494606[_0x8e88('0x1d')],'transfereelinkedid':_0x494606[_0x8e88('0x1e')],'isexternal':_0x494606[_0x8e88('0xc')],'context':_0x494606[_0x8e88('0x1f')],'extension':_0x494606[_0x8e88('0x20')],'type':'attended'},'log':_0x8e88('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 99d435a..fde9f6b 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 _0x5231=['outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','channels','voicechannel','map','find','uniqueid','channel','format','%s.%s','MixMonitor','ai(mixmonitorid)','then','monitors','/var/spool/asterisk/monitor/','isNil','mixmonitorid','rec','status','resolve','StopMixMonitor','destinationchannel','stop','wav','toLowerCase','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','../properties','listen','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','message','catch','command','Action','voiceQueues','hasOwnProperty','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x5231,0xd0));var _0x1523=function(_0x132644,_0x3e7045){_0x132644=_0x132644-0x0;var _0x438960=_0x5231[_0x132644];return _0x438960;};'use strict';var _=require(_0x1523('0x0'));var util=require(_0x1523('0x1'));var jayson=require(_0x1523('0x2'));var schema=require(_0x1523('0x3'));var BPromise=require('bluebird');var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x1523('0x4'));var ami=require('../ami');exports[_0x1523('0x5')]=function(_0x17554d,_0x2591ae,_0x5290f8){return new BPromise(function(_0x58fcbd,_0xf7863c){var _0x845ffe={'QueuePause':function(_0x2245b4){return new Promise(function(_0x1be0b9,_0x1eb498){var _0x3fe6aa=util['format'](_0x1523('0x6'),'SIP',_0x2245b4[_0x1523('0x7')]);if(_0x17554d[_0x1523('0x8')]&&_0x17554d['timers'][_0x3fe6aa]&&_0x17554d[_0x1523('0x8')][_0x3fe6aa][_0x1523('0x9')]){_0x17554d[_0x1523('0x8')][_0x3fe6aa][_0x1523('0xa')]();}if(_0x17554d[_0x1523('0xb')][_0x3fe6aa]){_0x17554d['agents'][_0x3fe6aa][_0x1523('0xc')]({'statePause':_0x2245b4[_0x1523('0xd')]?!![]:![]});}_0x1be0b9({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x2b67d9){var _0x20557d=this;return new Promise(function(_0x2e8294,_0x519f62){if(ami[_0x1523('0xe')]()==![]){return _0x519f62(_0x20557d[_0x1523('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x1523('0x10')][_0x1523('0x11')],_0x1523('0x12')][_0x1523('0x13')]('\x20')));}_0x2b67d9=_[_0x1523('0x14')](_0x2b67d9,_[_0x1523('0x15')](properties[_0x1523('0x16')]));_0x2b67d9[_0x1523('0x17')]=_0x1523('0x18');return ami['Action'](_0x2b67d9)['then'](function(_0x4bca03){_0x2e8294({'code':0xc8,'message':_0x4bca03[_0x1523('0x19')]});})[_0x1523('0x1a')](function(_0x540dc5){_0x519f62(_0x20557d['error'](0x1f5,_0x540dc5[_0x1523('0x19')]));});});},'Command':function(_0x1c81f7){var _0x2f32e1=this;return new Promise(function(_0xdcfd30,_0x1df32e){if(ami[_0x1523('0xe')]()==![]){return _0x1df32e(_0x2f32e1[_0x1523('0xf')](0x1f4,[config[_0x1523('0x10')]['ip'],config[_0x1523('0x10')][_0x1523('0x11')],_0x1523('0x12')]['join']('\x20')));}_0x1c81f7=_[_0x1523('0x14')](_0x1c81f7,_0x1523('0x1b'));_0x1c81f7[_0x1523('0x17')]='Command';return ami[_0x1523('0x1c')](_0x1c81f7)['then'](function(_0x56025a){_0xdcfd30({'code':0xc8,'message':_0x56025a['content']});})['catch'](function(_0x58cf01){_0x1df32e(_0x2f32e1[_0x1523('0xf')](0x1f5,_0x58cf01[_0x1523('0x19')]));});});},'VoiceQueues':function(_0x4b944f){return new Promise(function(_0x46c667,_0x25cb76){var _0x437f8b=[];for(var _0x219865 in _0x17554d[_0x1523('0x1d')]){if(_0x17554d['voiceQueues'][_0x1523('0x1e')](_0x219865)){var _0x2c09ca=_0x17554d[_0x1523('0x1d')][_0x219865];var _0x307f5={'id':_0x2c09ca['id'],'name':_0x2c09ca['name'],'strategy':_0x2c09ca['strategy'],'answered':_0x2c09ca[_0x1523('0x1f')],'available':_0x2c09ca[_0x1523('0x20')],'loggedIn':_0x2c09ca[_0x1523('0x21')],'pTalking':_0x2c09ca[_0x1523('0x22')],'sumBillable':_0x2c09ca[_0x1523('0x23')],'sumDuration':_0x2c09ca[_0x1523('0x24')],'sumHoldTime':_0x2c09ca[_0x1523('0x25')]||0x0,'talking':_0x2c09ca[_0x1523('0x26')],'total':_0x2c09ca['total'],'type':_0x2c09ca['type'],'unmanaged':_0x2c09ca[_0x1523('0x27')],'abandoned':_0x2c09ca[_0x1523('0x28')],'waiting':_0x2c09ca[_0x1523('0x29')],'loggedInDb':_0x2c09ca[_0x1523('0x2a')]};if(_0x2c09ca['type']===_0x1523('0x2b')){_0x307f5[_0x1523('0x2c')]=_0x2c09ca[_0x1523('0x2c')];_0x307f5[_0x1523('0x2d')]=_0x2c09ca[_0x1523('0x2d')];_0x307f5[_0x1523('0x2e')]=_0x2c09ca[_0x1523('0x2e')];_0x307f5[_0x1523('0x2f')]=_0x2c09ca[_0x1523('0x2f')];_0x307f5[_0x1523('0x30')]=_0x2c09ca[_0x1523('0x30')];_0x307f5['dialPrefix']=_0x2c09ca[_0x1523('0x31')];_0x307f5[_0x1523('0x32')]=_0x2c09ca['outboundAnswerAgiCallsDay'];_0x307f5[_0x1523('0x33')]=_0x2c09ca[_0x1523('0x33')];_0x307f5[_0x1523('0x34')]=_0x2c09ca['outboundBlacklistCallsDay'];_0x307f5[_0x1523('0x35')]=_0x2c09ca['outboundBusyCallsDay'];_0x307f5[_0x1523('0x36')]=_0x2c09ca[_0x1523('0x36')];_0x307f5[_0x1523('0x37')]=_0x2c09ca[_0x1523('0x37')];_0x307f5[_0x1523('0x38')]=_0x2c09ca[_0x1523('0x38')];_0x307f5[_0x1523('0x39')]=_0x2c09ca[_0x1523('0x39')];_0x307f5[_0x1523('0x3a')]=_0x2c09ca['outboundNoAnswerCallsDay'];_0x307f5[_0x1523('0x3b')]=_0x2c09ca[_0x1523('0x3b')];_0x307f5[_0x1523('0x3c')]=_0x2c09ca[_0x1523('0x3c')];_0x307f5[_0x1523('0x3d')]=_0x2c09ca[_0x1523('0x3d')];_0x307f5['outboundRejectCallsDay']=_0x2c09ca[_0x1523('0x3e')];_0x307f5['outboundUnknownCallsDay']=_0x2c09ca['outboundUnknownCallsDay'];_0x307f5[_0x1523('0x3f')]=_0x2c09ca['predictiveIntervalAnsweredCalls'];_0x307f5[_0x1523('0x40')]=_0x2c09ca['predictiveIntervalAvgHoldtime'];_0x307f5[_0x1523('0x41')]=_0x2c09ca[_0x1523('0x41')];_0x307f5[_0x1523('0x42')]=_0x2c09ca[_0x1523('0x42')];_0x307f5[_0x1523('0x43')]=_0x2c09ca[_0x1523('0x43')];_0x307f5[_0x1523('0x44')]=_0x2c09ca[_0x1523('0x44')];_0x307f5[_0x1523('0x45')]=_0x2c09ca['predictiveIntervalErlangCallsDroppedCalls'];_0x307f5[_0x1523('0x46')]=_0x2c09ca[_0x1523('0x46')];_0x307f5['predictiveIntervalMultiplicativeFactor']=_0x2c09ca[_0x1523('0x47')];_0x307f5[_0x1523('0x48')]=_0x2c09ca['predictiveIntervalPauses'];_0x307f5[_0x1523('0x49')]=_0x2c09ca['predictiveIntervalAvailable'];_0x307f5[_0x1523('0x4a')]=_0x2c09ca['predictiveIntervalTotalCalls'];_0x307f5[_0x1523('0x19')]=_0x2c09ca[_0x1523('0x19')];_0x307f5[_0x1523('0x4b')]=_0x2c09ca[_0x1523('0x4b')];_0x307f5[_0x1523('0x4c')]=_0x2c09ca[_0x1523('0x4c')];_0x307f5[_0x1523('0x4d')]=_0x2c09ca['erlangCallToSecond'];_0x307f5[_0x1523('0x4e')]=_0x2c09ca[_0x1523('0x4e')];_0x307f5[_0x1523('0x4f')]=_0x2c09ca['erlangBusyFactor'];_0x307f5['startPredictive']=_0x2c09ca[_0x1523('0x50')];_0x307f5[_0x1523('0x51')]=_0x2c09ca[_0x1523('0x51')];}if(_0x2c09ca['Trunk']){_0x307f5[_0x1523('0x52')]={'id':_0x2c09ca[_0x1523('0x52')]['id'],'name':_0x2c09ca[_0x1523('0x52')][_0x1523('0x7')],'active':_0x2c09ca[_0x1523('0x52')][_0x1523('0x53')],'callerid':_0x2c09ca[_0x1523('0x52')][_0x1523('0x54')]};}if(_0x2c09ca[_0x1523('0x55')]){_0x307f5[_0x1523('0x55')]={'id':_0x2c09ca[_0x1523('0x55')]['id'],'name':_0x2c09ca[_0x1523('0x55')]['name']};}_0x437f8b[_0x1523('0x56')](_0x307f5);}}_0x46c667({'count':_0x437f8b[_0x1523('0x57')],'rows':_0x437f8b});});},'VoiceChannels':function(_0x3321d4){return new Promise(function(_0x321872,_0x1048c6){var _0xac1103=_['values'](_0x17554d[_0x1523('0x58')]);_0x321872({'count':_0xac1103[_0x1523('0x57')],'rows':_0xac1103});});},'VoiceChannelMixMonitor':function(_0x4ea198){var _0x54eb96=this;return new Promise(function(_0x4b841d,_0x8a7e1f){if(ami['isConnected']()==![]){return _0x8a7e1f(_0x54eb96[_0x1523('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x1523('0x10')][_0x1523('0x11')],_0x1523('0x12')][_0x1523('0x13')]('\x20')));}var _0xd26c58=schema(properties[_0x1523('0x59')])[_0x1523('0x3')](_0x4ea198);if(_0xd26c58[_0x1523('0x57')]>0x0){return _0x8a7e1f(_0x54eb96[_0x1523('0xf')](0x1f4,_[_0x1523('0x5a')](_0xd26c58,_0x1523('0x19'))['join'](',\x20')));}var _0x1732c8=_[_0x1523('0x5b')](_0x17554d['channels'],{'uniqueid':_0x4ea198[_0x1523('0x5c')]});if(_0x1732c8&&_0x1732c8[_0x1523('0x5d')]){var _0x226486=util[_0x1523('0x5e')](_0x1523('0x5f'),_0x4ea198['filename']||_0x4ea198[_0x1523('0x5c')],_0x4ea198['format']||'wav');return ami[_0x1523('0x1c')]({'action':_0x1523('0x60'),'channel':_0x1732c8[_0x1523('0x5d')],'file':_0x226486,'options':_0x1523('0x61')})[_0x1523('0x62')](function(_0x317035){var _0x14e2ce=_[_0x1523('0x5b')](_0x1732c8[_0x1523('0x63')],{'filename':_0x1523('0x64')+_0x226486['toLowerCase']()});if(_[_0x1523('0x65')](_0x14e2ce)){_0x1732c8[_0x1523('0x63')][_0x1523('0x56')]({'filename':_0x1523('0x64')+_0x226486['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x317035[_0x1523('0x66')],'status':_0x1523('0x67')});}else{_0x14e2ce[_0x1523('0x66')]=_0x317035[_0x1523('0x66')];_0x14e2ce[_0x1523('0x68')]=_0x1523('0x67');}_0x4b841d({'code':0xc8,'message':[_0x4ea198[_0x1523('0x5c')],'MixMonitor\x20Success',_0x317035[_0x1523('0x66')]][_0x1523('0x13')]('\x20'),'mixmonitorid':_0x317035['mixmonitorid']});})[_0x1523('0x1a')](function(_0x5f1b76){_0x8a7e1f(_0x54eb96[_0x1523('0xf')](0x1f5,[_0x4ea198[_0x1523('0x5c')],_0x5f1b76[_0x1523('0x19')]['toLowerCase']()][_0x1523('0x13')]('\x20')));});}else{return _0x8a7e1f(_0x54eb96[_0x1523('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5dde22){var _0x3481fb=this;return new Promise(function(_0x5b3e3f,_0x5dd32e){if(ami[_0x1523('0xe')]()==![]){return _0x5dd32e(_0x3481fb[_0x1523('0xf')](0x1f4,[config[_0x1523('0x10')]['ip'],config['asterisk'][_0x1523('0x11')],_0x1523('0x12')][_0x1523('0x13')]('\x20')));}var _0xc7530f=schema(properties['voicechannel'])[_0x1523('0x3')](_0x5dde22);if(_0xc7530f[_0x1523('0x57')]>0x0){return _0x5dd32e(_0x3481fb[_0x1523('0xf')](0x1f4,_[_0x1523('0x5a')](_0xc7530f,'message')['join'](',\x20')));}var _0x40a39b=_[_0x1523('0x5b')](_0x17554d[_0x1523('0x58')],{'uniqueid':_0x5dde22[_0x1523('0x5c')]});if(_0x40a39b){return BPromise[_0x1523('0x69')]()[_0x1523('0x62')](function(){if(_0x40a39b[_0x1523('0x5d')]){return ami['Action']({'action':_0x1523('0x6a'),'channel':_0x40a39b[_0x1523('0x5d')],'mixmonitorid':_0x5dde22[_0x1523('0x66')]})['catch'](function(_0x28e66a){});}})[_0x1523('0x62')](function(){if(_0x40a39b[_0x1523('0x6b')]){return ami[_0x1523('0x1c')]({'action':_0x1523('0x6a'),'channel':_0x40a39b[_0x1523('0x6b')],'mixmonitorid':_0x5dde22[_0x1523('0x66')]})[_0x1523('0x1a')](function(_0x2d70ad){});}})['then'](function(_0x16074f){var _0x4bccd3=_[_0x1523('0x5b')](_0x40a39b[_0x1523('0x63')],{'mixmonitorid':_0x5dde22[_0x1523('0x66')]});if(_0x4bccd3){_0x4bccd3['status']=_0x1523('0x6c');}})[_0x1523('0x62')](function(){var _0x3e1194=util[_0x1523('0x5e')](_0x1523('0x5f'),_0x5dde22['filename']||_0x5dde22['uniqueid'],_0x5dde22['format']||_0x1523('0x6d'));var _0x15966d=_[_0x1523('0x5b')](_0x40a39b[_0x1523('0x63')],{'filename':'/var/spool/asterisk/monitor/'+_0x3e1194[_0x1523('0x6e')]()});if(_0x15966d){_0x15966d[_0x1523('0x68')]=_0x1523('0x6c');}})['then'](function(){_0x5b3e3f({'code':0xc8,'message':[_0x5dde22[_0x1523('0x5c')],_0x1523('0x6f')][_0x1523('0x13')]('\x20')});})[_0x1523('0x1a')](function(_0x255a69){_0x5dd32e(_0x3481fb[_0x1523('0xf')](0x1f5,[_0x5dde22[_0x1523('0x5c')],_0x255a69[_0x1523('0x19')][_0x1523('0x6e')]()][_0x1523('0x13')]('\x20')));});}else{return _0x5dd32e(_0x3481fb[_0x1523('0xf')](0x1f5,_0x1523('0x70')));}});},'VoiceQueuesChannels':function(_0x1c0ac5){return new Promise(function(_0x29e33c,_0x7661a9){var _0x7e1539=_[_0x1523('0x71')](_0x17554d[_0x1523('0x72')]);_0x29e33c({'count':_0x7e1539[_0x1523('0x57')],'rows':_0x7e1539});});},'VoiceQueuesChannel':function(_0x1ceae1){var _0x24e35f=this;return new Promise(function(_0x623ecd,_0x4a956c){var _0x5b367d=schema(properties[_0x1523('0x73')])[_0x1523('0x3')](_0x1ceae1);if(_0x5b367d['length']>0x0){return _0x4a956c(_0x24e35f[_0x1523('0xf')](0x1f4,_['map'](_0x5b367d,_0x1523('0x19'))[_0x1523('0x13')](',\x20')));}var _0x52de11=_[_0x1523('0x5b')](_0x17554d['queueChannels'],{'uniqueid':_0x1ceae1[_0x1523('0x5c')]});if(_0x52de11){_0x623ecd(_0x52de11);}else{return _0x4a956c(_0x24e35f[_0x1523('0xf')](0x1f5,_0x1523('0x70')));}});},'VoiceQueuesChannelHangup':function(_0xe58446){var _0x1b4b49=this;return new Promise(function(_0x1f5045,_0x1cd23e){if(ami['isConnected']()==![]){return _0x1cd23e(_0x1b4b49[_0x1523('0xf')](0x1f4,[config[_0x1523('0x10')]['ip'],config[_0x1523('0x10')][_0x1523('0x11')],'ami\x20disconnected'][_0x1523('0x13')]('\x20')));}var _0x1e1d4b=schema(properties[_0x1523('0x74')])[_0x1523('0x3')](_0xe58446);if(_0x1e1d4b['length']>0x0){return _0x1cd23e(_0x1b4b49['error'](0x1f4,_[_0x1523('0x5a')](_0x1e1d4b,_0x1523('0x19'))['join'](',\x20')));}var _0xfaf88f=_['find'](_0x17554d[_0x1523('0x72')],{'uniqueid':_0xe58446['uniqueid']});if(_0xfaf88f&&_0xfaf88f[_0x1523('0x5d')]){return ami[_0x1523('0x1c')]({'action':_0x1523('0x75'),'channel':_0xfaf88f['channel']})[_0x1523('0x62')](function(_0x2f40e2){_0x1f5045({'code':0xc8,'message':[_0xe58446[_0x1523('0x5c')],_0x2f40e2[_0x1523('0x19')][_0x1523('0x6e')]()]['join']('\x20')});})[_0x1523('0x1a')](function(_0x310124){_0x1cd23e(_0x1b4b49[_0x1523('0xf')](0x1f5,[_0xe58446[_0x1523('0x5c')],_0x310124['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x1cd23e(_0x1b4b49[_0x1523('0xf')](0x1f5,_0x1523('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x1c775f){var _0xdb6a15=this;return new Promise(function(_0x32e8fd,_0x241f05){if(ami[_0x1523('0xe')]()==![]){return _0x241f05(_0xdb6a15['error'](0x1f4,[config[_0x1523('0x10')]['ip'],config[_0x1523('0x10')][_0x1523('0x11')],_0x1523('0x12')][_0x1523('0x13')]('\x20')));}var _0xb38d4d=schema(properties[_0x1523('0x76')])['validate'](_0x1c775f);if(_0xb38d4d['length']>0x0){return _0x241f05(_0xdb6a15[_0x1523('0xf')](0x1f4,_[_0x1523('0x5a')](_0xb38d4d,'message')['join'](',\x20')));}var _0x3183eb=_[_0x1523('0x5b')](_0x17554d[_0x1523('0x72')],{'uniqueid':_0x1c775f['uniqueid']});if(_0x3183eb&&_0x3183eb[_0x1523('0x5d')]){return ami[_0x1523('0x1c')]({'action':_0x1523('0x77'),'channel':_0x3183eb[_0x1523('0x5d')],'exten':_0x1c775f['exten'],'context':_0x1c775f[_0x1523('0x78')]||_0x3183eb[_0x1523('0x78')],'priority':0x1})[_0x1523('0x62')](function(_0x28bda2){_0x32e8fd({'code':0xc8,'message':[_0x1c775f[_0x1523('0x5c')],_0x28bda2[_0x1523('0x19')]['toLowerCase']()][_0x1523('0x13')]('\x20')});})[_0x1523('0x1a')](function(_0x4925dd){_0x241f05(_0xdb6a15['error'](0x1f5,[_0x1c775f[_0x1523('0x5c')],_0x4925dd[_0x1523('0x19')][_0x1523('0x6e')]()]['join']('\x20')));});}else{return _0x241f05(_0xdb6a15['error'](0x1f5,_0x1523('0x70')));}});},'Agents':function(_0x3b5f1f){return new Promise(function(_0x8163c2,_0x24afb2){var _0x21d362=_['values'](_0x17554d[_0x1523('0xb')]);_0x8163c2({'count':_0x21d362['length'],'rows':_0x21d362});});},'Telephones':function(_0x55accc){return new Promise(function(_0x265a63,_0x345287){var _0x2dde94=_[_0x1523('0x71')](_0x17554d[_0x1523('0x79')]);_0x265a63({'count':_0x2dde94[_0x1523('0x57')],'rows':_0x2dde94});});},'Trunks':function(_0x4fe77b){return new Promise(function(_0x2ffcbb,_0x3e72ca){var _0x90197a=_[_0x1523('0x71')](_0x17554d[_0x1523('0x7a')]);_0x2ffcbb({'count':_0x90197a['length'],'rows':_0x90197a});});},'OutboundChannels':function(_0x4e35be){return new Promise(function(_0x3efe72,_0x1c462d){var _0x569d9d=_['values'](_0x17554d[_0x1523('0x7b')]);_0x3efe72({'count':_0x569d9d[_0x1523('0x57')],'rows':_0x569d9d});});},'Outbound':function(_0x6ce176){return new Promise(function(_0x406ebf,_0x1efd5b){_0x406ebf(_0x17554d['outbound']);});},'Campaigns':function(_0x2f768){return new Promise(function(_0x15bafc,_0x3c99b4){var _0x2d4b06=_[_0x1523('0x71')](_0x17554d['campaigns']);_0x15bafc({'count':_0x2d4b06[_0x1523('0x57')],'rows':_0x2d4b06});});},'VoiceQueuesPreview':function(_0x2da2ff){var _0x4cab99=this;return new Promise(function(_0x5930ac,_0x2bf5bc){_0x2591ae[_0x1523('0x7c')](_0x2da2ff['id'])[_0x1523('0x62')](function(_0xdb2ef5){_0x5930ac({'code':0xc8,'message':_0xdb2ef5[_0x1523('0x19')]});})['catch'](function(_0x5a1c13){_0x2bf5bc(_0x4cab99[_0x1523('0xf')](0x1f4,_0x5a1c13[_0x1523('0x19')]));});});},'EventManager':function(_0x41c772){var _0x1163e6=this;return new Promise(function(_0x1e43c4,_0xccf77b){if(!_0x41c772[_0x1523('0x7d')]){return _0xccf77b(_0x1163e6['error'](0x1f4,_0x1523('0x7e')));}ami[_0x1523('0x7f')]('custom:'+_0x41c772[_0x1523('0x7d')],_0x41c772[_0x1523('0x19')]);_0x1e43c4({'code':0xc8,'message':_0x41c772});});},'FaxAccounts':function(_0x5ca107){return new Promise(function(_0x4aa20b,_0x3ce407){var _0x231625=_['values'](_0x17554d[_0x1523('0x80')]);_0x4aa20b({'count':_0x231625[_0x1523('0x57')],'rows':_0x231625});});},'SendFax':function(_0x59bca9){var _0x6ca8c5=this;return new Promise(function(_0x5ae5bb,_0x5c98f3){_0x5290f8[_0x1523('0x81')](_0x59bca9)[_0x1523('0x62')](function(_0x366779){_0x5ae5bb({'code':0xc8,'message':_0x366779[_0x1523('0x19')]});})['catch'](function(_0x48474b){_0x5c98f3(_0x6ca8c5[_0x1523('0xf')](0x1f4,_0x48474b[_0x1523('0x19')]));});});},'CheckAfterSend':function(_0x51e15d){var _0x2cd8cb=this;return new Promise(function(_0x9d1536,_0x502786){_0x5290f8['checkAfterSend'](_0x51e15d)[_0x1523('0x62')](function(_0x2cab01){_0x9d1536({'code':0xc8,'message':_0x2cab01['message']});})['catch'](function(_0x5f11b){_0x502786(_0x2cd8cb[_0x1523('0xf')](0x1f4,_0x5f11b[_0x1523('0x19')]));});});}};var _0x543418=jayson[_0x1523('0x82')](_0x845ffe)['http']();_0x543418['on'](_0x1523('0xf'),function(_0x4095d4){return _0xf7863c(_0x4095d4);});_0x543418[_0x1523('0x5')](0x232a,_0x1523('0x83'),function(){console[_0x1523('0x84')](_0x1523('0x85'),0x232a);return _0x58fcbd(_0x1523('0x86')+0x232a);});});}; \ No newline at end of file +var _0x7a8c=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','values','channels','voicechannel','validate','map','find','uniqueid','channel','filename','wav','/var/spool/asterisk/monitor/','isNil','monitors','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','trunks','outbound','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../../../config/environment','../properties','listen','format','name','timers','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','then','message','pick','command','Command','catch','voiceQueues','hasOwnProperty','answered','available','loggedIn','pTalking','sumDuration','unmanaged','abandoned','waiting','loggedInDb','type','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay'];(function(_0x3f5a7a,_0x5e8e0a){var _0x4b6ad3=function(_0x2ea27d){while(--_0x2ea27d){_0x3f5a7a['push'](_0x3f5a7a['shift']());}};_0x4b6ad3(++_0x5e8e0a);}(_0x7a8c,0x1ca));var _0xc7a8=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x7a8c[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xc7a8('0x0'));var util=require(_0xc7a8('0x1'));var jayson=require(_0xc7a8('0x2'));var schema=require('validate');var BPromise=require(_0xc7a8('0x3'));var moment=require('moment');var config=require(_0xc7a8('0x4'));var properties=require(_0xc7a8('0x5'));var ami=require('../ami');exports[_0xc7a8('0x6')]=function(_0x57e6a7,_0x1aeb11,_0x4ed267){return new BPromise(function(_0x52ba54,_0x35efb5){var _0x358478={'QueuePause':function(_0x40b7a5){return new Promise(function(_0x28bf58,_0x126c5){var _0x47f197=util[_0xc7a8('0x7')]('%s/%s','SIP',_0x40b7a5[_0xc7a8('0x8')]);if(_0x57e6a7['timers']&&_0x57e6a7['timers'][_0x47f197]&&_0x57e6a7[_0xc7a8('0x9')][_0x47f197]['timer']){_0x57e6a7[_0xc7a8('0x9')][_0x47f197][_0xc7a8('0xa')]();}if(_0x57e6a7['agents'][_0x47f197]){_0x57e6a7[_0xc7a8('0xb')][_0x47f197]['updateStatusRealtime']({'statePause':_0x40b7a5[_0xc7a8('0xc')]?!![]:![]});}_0x28bf58({'code':0xc8,'message':_0xc7a8('0xd')});});},'Reload':function(_0x250a67){var _0x327277=this;return new Promise(function(_0x165710,_0x2a56de){if(ami[_0xc7a8('0xe')]()==![]){return _0x2a56de(_0x327277[_0xc7a8('0xf')](0x1f4,[config[_0xc7a8('0x10')]['ip'],config['asterisk'][_0xc7a8('0x11')],_0xc7a8('0x12')][_0xc7a8('0x13')]('\x20')));}_0x250a67=_['pick'](_0x250a67,_['keys'](properties[_0xc7a8('0x14')]));_0x250a67[_0xc7a8('0x15')]=_0xc7a8('0x16');return ami[_0xc7a8('0x17')](_0x250a67)[_0xc7a8('0x18')](function(_0x356c62){_0x165710({'code':0xc8,'message':_0x356c62[_0xc7a8('0x19')]});})['catch'](function(_0x55d734){_0x2a56de(_0x327277[_0xc7a8('0xf')](0x1f5,_0x55d734['message']));});});},'Command':function(_0x32c352){var _0x3049f0=this;return new Promise(function(_0x24f807,_0x127d7e){if(ami[_0xc7a8('0xe')]()==![]){return _0x127d7e(_0x3049f0['error'](0x1f4,[config[_0xc7a8('0x10')]['ip'],config[_0xc7a8('0x10')][_0xc7a8('0x11')],_0xc7a8('0x12')][_0xc7a8('0x13')]('\x20')));}_0x32c352=_[_0xc7a8('0x1a')](_0x32c352,_0xc7a8('0x1b'));_0x32c352['action']=_0xc7a8('0x1c');return ami[_0xc7a8('0x17')](_0x32c352)[_0xc7a8('0x18')](function(_0x380e2c){_0x24f807({'code':0xc8,'message':_0x380e2c['content']});})[_0xc7a8('0x1d')](function(_0x5f3a81){_0x127d7e(_0x3049f0[_0xc7a8('0xf')](0x1f5,_0x5f3a81['message']));});});},'VoiceQueues':function(_0x5a63a7){return new Promise(function(_0x117165,_0x24f374){var _0x3cda40=[];for(var _0x3a0160 in _0x57e6a7[_0xc7a8('0x1e')]){if(_0x57e6a7['voiceQueues'][_0xc7a8('0x1f')](_0x3a0160)){var _0x4d3c99=_0x57e6a7[_0xc7a8('0x1e')][_0x3a0160];var _0x353582={'id':_0x4d3c99['id'],'name':_0x4d3c99[_0xc7a8('0x8')],'strategy':_0x4d3c99['strategy'],'answered':_0x4d3c99[_0xc7a8('0x20')],'available':_0x4d3c99[_0xc7a8('0x21')],'loggedIn':_0x4d3c99[_0xc7a8('0x22')],'pTalking':_0x4d3c99[_0xc7a8('0x23')],'sumBillable':_0x4d3c99['sumBillable'],'sumDuration':_0x4d3c99[_0xc7a8('0x24')],'sumHoldTime':_0x4d3c99['sumHoldTime']||0x0,'talking':_0x4d3c99['talking'],'total':_0x4d3c99['total'],'type':_0x4d3c99['type'],'unmanaged':_0x4d3c99[_0xc7a8('0x25')],'abandoned':_0x4d3c99[_0xc7a8('0x26')],'waiting':_0x4d3c99[_0xc7a8('0x27')],'loggedInDb':_0x4d3c99[_0xc7a8('0x28')]};if(_0x4d3c99[_0xc7a8('0x29')]==='outbound'){_0x353582['dialActive']=_0x4d3c99['dialActive'];_0x353582[_0xc7a8('0x2a')]=_0x4d3c99[_0xc7a8('0x2a')];_0x353582[_0xc7a8('0x2b')]=_0x4d3c99[_0xc7a8('0x2b')];_0x353582[_0xc7a8('0x2c')]=_0x4d3c99[_0xc7a8('0x2c')];_0x353582[_0xc7a8('0x2d')]=_0x4d3c99[_0xc7a8('0x2d')];_0x353582[_0xc7a8('0x2e')]=_0x4d3c99['dialPrefix'];_0x353582['outboundAnswerAgiCallsDay']=_0x4d3c99[_0xc7a8('0x2f')];_0x353582[_0xc7a8('0x30')]=_0x4d3c99[_0xc7a8('0x30')];_0x353582[_0xc7a8('0x31')]=_0x4d3c99['outboundBlacklistCallsDay'];_0x353582[_0xc7a8('0x32')]=_0x4d3c99[_0xc7a8('0x32')];_0x353582[_0xc7a8('0x33')]=_0x4d3c99[_0xc7a8('0x33')];_0x353582['outboundDropCallsDayACS']=_0x4d3c99[_0xc7a8('0x34')];_0x353582[_0xc7a8('0x35')]=_0x4d3c99[_0xc7a8('0x35')];_0x353582[_0xc7a8('0x36')]=_0x4d3c99['outboundDropCallsDayTimeout'];_0x353582[_0xc7a8('0x37')]=_0x4d3c99[_0xc7a8('0x37')];_0x353582[_0xc7a8('0x38')]=_0x4d3c99[_0xc7a8('0x38')];_0x353582[_0xc7a8('0x39')]=_0x4d3c99[_0xc7a8('0x39')];_0x353582[_0xc7a8('0x3a')]=_0x4d3c99[_0xc7a8('0x3a')];_0x353582[_0xc7a8('0x3b')]=_0x4d3c99['outboundRejectCallsDay'];_0x353582[_0xc7a8('0x3c')]=_0x4d3c99[_0xc7a8('0x3c')];_0x353582[_0xc7a8('0x3d')]=_0x4d3c99['predictiveIntervalAnsweredCalls'];_0x353582[_0xc7a8('0x3e')]=_0x4d3c99['predictiveIntervalAvgHoldtime'];_0x353582['predictiveIntervalAvgTalktime']=_0x4d3c99[_0xc7a8('0x3f')];_0x353582['predictiveIntervalDroppedCallsCallersExit']=_0x4d3c99[_0xc7a8('0x40')];_0x353582[_0xc7a8('0x41')]=_0x4d3c99[_0xc7a8('0x41')];_0x353582[_0xc7a8('0x42')]=_0x4d3c99['predictiveIntervalErlangCalls'];_0x353582[_0xc7a8('0x43')]=_0x4d3c99[_0xc7a8('0x43')];_0x353582['predictiveIntervalHitRate']=_0x4d3c99[_0xc7a8('0x44')];_0x353582[_0xc7a8('0x45')]=_0x4d3c99[_0xc7a8('0x45')];_0x353582['predictiveIntervalPauses']=_0x4d3c99[_0xc7a8('0x46')];_0x353582['predictiveIntervalAvailable']=_0x4d3c99[_0xc7a8('0x47')];_0x353582[_0xc7a8('0x48')]=_0x4d3c99[_0xc7a8('0x48')];_0x353582[_0xc7a8('0x19')]=_0x4d3c99[_0xc7a8('0x19')];_0x353582['originated']=_0x4d3c99[_0xc7a8('0x49')];_0x353582[_0xc7a8('0x4a')]=_0x4d3c99[_0xc7a8('0x4a')];_0x353582[_0xc7a8('0x4b')]=_0x4d3c99['erlangCallToSecond'];_0x353582[_0xc7a8('0x4c')]=_0x4d3c99['erlangAbandonmentRate'];_0x353582['erlangBusyFactor']=_0x4d3c99[_0xc7a8('0x4d')];_0x353582[_0xc7a8('0x4e')]=_0x4d3c99[_0xc7a8('0x4e')];_0x353582[_0xc7a8('0x4f')]=_0x4d3c99[_0xc7a8('0x4f')];}if(_0x4d3c99[_0xc7a8('0x50')]){_0x353582[_0xc7a8('0x50')]={'id':_0x4d3c99[_0xc7a8('0x50')]['id'],'name':_0x4d3c99['Trunk'][_0xc7a8('0x8')],'active':_0x4d3c99['Trunk']['active'],'callerid':_0x4d3c99[_0xc7a8('0x50')][_0xc7a8('0x51')]};}if(_0x4d3c99['Interval']){_0x353582[_0xc7a8('0x52')]={'id':_0x4d3c99[_0xc7a8('0x52')]['id'],'name':_0x4d3c99[_0xc7a8('0x52')][_0xc7a8('0x8')]};}_0x3cda40[_0xc7a8('0x53')](_0x353582);}}_0x117165({'count':_0x3cda40[_0xc7a8('0x54')],'rows':_0x3cda40});});},'VoiceChannels':function(_0x5b3065){return new Promise(function(_0xe12286,_0x4d9f6c){var _0x1ee3eb=_[_0xc7a8('0x55')](_0x57e6a7[_0xc7a8('0x56')]);_0xe12286({'count':_0x1ee3eb[_0xc7a8('0x54')],'rows':_0x1ee3eb});});},'VoiceChannelMixMonitor':function(_0x75d5d0){var _0x5a19f6=this;return new Promise(function(_0x2b96af,_0xc6bc60){if(ami[_0xc7a8('0xe')]()==![]){return _0xc6bc60(_0x5a19f6['error'](0x1f4,[config[_0xc7a8('0x10')]['ip'],config[_0xc7a8('0x10')]['username'],_0xc7a8('0x12')][_0xc7a8('0x13')]('\x20')));}var _0x24204c=schema(properties[_0xc7a8('0x57')])[_0xc7a8('0x58')](_0x75d5d0);if(_0x24204c['length']>0x0){return _0xc6bc60(_0x5a19f6[_0xc7a8('0xf')](0x1f4,_[_0xc7a8('0x59')](_0x24204c,'message')[_0xc7a8('0x13')](',\x20')));}var _0x2929a5=_[_0xc7a8('0x5a')](_0x57e6a7[_0xc7a8('0x56')],{'uniqueid':_0x75d5d0[_0xc7a8('0x5b')]});if(_0x2929a5&&_0x2929a5[_0xc7a8('0x5c')]){var _0x10e6a2=util[_0xc7a8('0x7')]('%s.%s',_0x75d5d0[_0xc7a8('0x5d')]||_0x75d5d0[_0xc7a8('0x5b')],_0x75d5d0[_0xc7a8('0x7')]||_0xc7a8('0x5e'));return ami[_0xc7a8('0x17')]({'action':'MixMonitor','channel':_0x2929a5[_0xc7a8('0x5c')],'file':_0x10e6a2,'options':'ai(mixmonitorid)'})[_0xc7a8('0x18')](function(_0x325a58){var _0xd26c38=_['find'](_0x2929a5['monitors'],{'filename':_0xc7a8('0x5f')+_0x10e6a2['toLowerCase']()});if(_[_0xc7a8('0x60')](_0xd26c38)){_0x2929a5[_0xc7a8('0x61')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x10e6a2[_0xc7a8('0x62')](),'createdAt':moment()[_0xc7a8('0x7')](_0xc7a8('0x63')),'mixmonitorid':_0x325a58[_0xc7a8('0x64')],'status':_0xc7a8('0x65')});}else{_0xd26c38[_0xc7a8('0x64')]=_0x325a58[_0xc7a8('0x64')];_0xd26c38['status']='rec';}_0x2b96af({'code':0xc8,'message':[_0x75d5d0[_0xc7a8('0x5b')],'MixMonitor\x20Success',_0x325a58[_0xc7a8('0x64')]][_0xc7a8('0x13')]('\x20'),'mixmonitorid':_0x325a58['mixmonitorid']});})['catch'](function(_0x2da8ff){_0xc6bc60(_0x5a19f6[_0xc7a8('0xf')](0x1f5,[_0x75d5d0['uniqueid'],_0x2da8ff['message'][_0xc7a8('0x62')]()][_0xc7a8('0x13')]('\x20')));});}else{return _0xc6bc60(_0x5a19f6[_0xc7a8('0xf')](0x1f5,_0xc7a8('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x489430){var _0x47e0de=this;return new Promise(function(_0x269d36,_0x5b3b68){if(ami['isConnected']()==![]){return _0x5b3b68(_0x47e0de[_0xc7a8('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xc7a8('0x11')],'ami\x20disconnected'][_0xc7a8('0x13')]('\x20')));}var _0xbb7ea2=schema(properties[_0xc7a8('0x57')])[_0xc7a8('0x58')](_0x489430);if(_0xbb7ea2[_0xc7a8('0x54')]>0x0){return _0x5b3b68(_0x47e0de[_0xc7a8('0xf')](0x1f4,_['map'](_0xbb7ea2,_0xc7a8('0x19'))[_0xc7a8('0x13')](',\x20')));}var _0x2d626b=_['find'](_0x57e6a7['channels'],{'uniqueid':_0x489430[_0xc7a8('0x5b')]});if(_0x2d626b){return BPromise[_0xc7a8('0x67')]()[_0xc7a8('0x18')](function(){if(_0x2d626b[_0xc7a8('0x5c')]){return ami[_0xc7a8('0x17')]({'action':_0xc7a8('0x68'),'channel':_0x2d626b[_0xc7a8('0x5c')],'mixmonitorid':_0x489430[_0xc7a8('0x64')]})[_0xc7a8('0x1d')](function(_0x267456){});}})[_0xc7a8('0x18')](function(){if(_0x2d626b['destinationchannel']){return ami['Action']({'action':_0xc7a8('0x68'),'channel':_0x2d626b[_0xc7a8('0x69')],'mixmonitorid':_0x489430['mixmonitorid']})[_0xc7a8('0x1d')](function(_0x4a2c06){});}})[_0xc7a8('0x18')](function(_0x3f7701){var _0x1c9494=_[_0xc7a8('0x5a')](_0x2d626b[_0xc7a8('0x61')],{'mixmonitorid':_0x489430[_0xc7a8('0x64')]});if(_0x1c9494){_0x1c9494['status']=_0xc7a8('0x6a');}})[_0xc7a8('0x18')](function(){var _0x339b1a=util[_0xc7a8('0x7')]('%s.%s',_0x489430[_0xc7a8('0x5d')]||_0x489430[_0xc7a8('0x5b')],_0x489430[_0xc7a8('0x7')]||_0xc7a8('0x5e'));var _0x4f5d59=_[_0xc7a8('0x5a')](_0x2d626b[_0xc7a8('0x61')],{'filename':_0xc7a8('0x5f')+_0x339b1a['toLowerCase']()});if(_0x4f5d59){_0x4f5d59['status']=_0xc7a8('0x6a');}})[_0xc7a8('0x18')](function(){_0x269d36({'code':0xc8,'message':[_0x489430[_0xc7a8('0x5b')],_0xc7a8('0x6b')][_0xc7a8('0x13')]('\x20')});})[_0xc7a8('0x1d')](function(_0x561ea9){_0x5b3b68(_0x47e0de[_0xc7a8('0xf')](0x1f5,[_0x489430[_0xc7a8('0x5b')],_0x561ea9[_0xc7a8('0x19')][_0xc7a8('0x62')]()]['join']('\x20')));});}else{return _0x5b3b68(_0x47e0de[_0xc7a8('0xf')](0x1f5,_0xc7a8('0x66')));}});},'VoiceQueuesChannels':function(_0x22242f){return new Promise(function(_0x1c9c5a,_0x30d8b0){var _0x5871dc=_[_0xc7a8('0x55')](_0x57e6a7[_0xc7a8('0x6c')]);_0x1c9c5a({'count':_0x5871dc[_0xc7a8('0x54')],'rows':_0x5871dc});});},'VoiceQueuesChannel':function(_0x4cb25d){var _0x93feb5=this;return new Promise(function(_0x25eaae,_0x32f642){var _0x1b5a53=schema(properties[_0xc7a8('0x6d')])[_0xc7a8('0x58')](_0x4cb25d);if(_0x1b5a53[_0xc7a8('0x54')]>0x0){return _0x32f642(_0x93feb5['error'](0x1f4,_[_0xc7a8('0x59')](_0x1b5a53,_0xc7a8('0x19'))[_0xc7a8('0x13')](',\x20')));}var _0x4c35c8=_[_0xc7a8('0x5a')](_0x57e6a7[_0xc7a8('0x6c')],{'uniqueid':_0x4cb25d[_0xc7a8('0x5b')]});if(_0x4c35c8){_0x25eaae(_0x4c35c8);}else{return _0x32f642(_0x93feb5[_0xc7a8('0xf')](0x1f5,_0xc7a8('0x66')));}});},'VoiceQueuesChannelHangup':function(_0x11f037){var _0x58976f=this;return new Promise(function(_0x58618b,_0x2d5842){if(ami[_0xc7a8('0xe')]()==![]){return _0x2d5842(_0x58976f[_0xc7a8('0xf')](0x1f4,[config[_0xc7a8('0x10')]['ip'],config[_0xc7a8('0x10')][_0xc7a8('0x11')],_0xc7a8('0x12')][_0xc7a8('0x13')]('\x20')));}var _0x438bcf=schema(properties[_0xc7a8('0x6e')])[_0xc7a8('0x58')](_0x11f037);if(_0x438bcf[_0xc7a8('0x54')]>0x0){return _0x2d5842(_0x58976f['error'](0x1f4,_[_0xc7a8('0x59')](_0x438bcf,'message')[_0xc7a8('0x13')](',\x20')));}var _0x1cc889=_[_0xc7a8('0x5a')](_0x57e6a7['queueChannels'],{'uniqueid':_0x11f037['uniqueid']});if(_0x1cc889&&_0x1cc889[_0xc7a8('0x5c')]){return ami['Action']({'action':_0xc7a8('0x6f'),'channel':_0x1cc889[_0xc7a8('0x5c')]})[_0xc7a8('0x18')](function(_0x5a75a){_0x58618b({'code':0xc8,'message':[_0x11f037['uniqueid'],_0x5a75a[_0xc7a8('0x19')][_0xc7a8('0x62')]()][_0xc7a8('0x13')]('\x20')});})[_0xc7a8('0x1d')](function(_0x52b83f){_0x2d5842(_0x58976f['error'](0x1f5,[_0x11f037['uniqueid'],_0x52b83f[_0xc7a8('0x19')][_0xc7a8('0x62')]()]['join']('\x20')));});}else{return _0x2d5842(_0x58976f[_0xc7a8('0xf')](0x1f5,_0xc7a8('0x66')));}});},'VoiceQueuesChannelRedirect':function(_0x267a91){var _0x528e99=this;return new Promise(function(_0x544a2a,_0x339ae3){if(ami[_0xc7a8('0xe')]()==![]){return _0x339ae3(_0x528e99['error'](0x1f4,[config[_0xc7a8('0x10')]['ip'],config['asterisk'][_0xc7a8('0x11')],_0xc7a8('0x12')][_0xc7a8('0x13')]('\x20')));}var _0xac1770=schema(properties[_0xc7a8('0x70')])[_0xc7a8('0x58')](_0x267a91);if(_0xac1770[_0xc7a8('0x54')]>0x0){return _0x339ae3(_0x528e99[_0xc7a8('0xf')](0x1f4,_[_0xc7a8('0x59')](_0xac1770,'message')[_0xc7a8('0x13')](',\x20')));}var _0x4fbe5d=_[_0xc7a8('0x5a')](_0x57e6a7[_0xc7a8('0x6c')],{'uniqueid':_0x267a91[_0xc7a8('0x5b')]});if(_0x4fbe5d&&_0x4fbe5d[_0xc7a8('0x5c')]){return ami['Action']({'action':'Redirect','channel':_0x4fbe5d['channel'],'exten':_0x267a91[_0xc7a8('0x71')],'context':_0x267a91[_0xc7a8('0x72')]||_0x4fbe5d[_0xc7a8('0x72')],'priority':0x1})['then'](function(_0x58e9d5){_0x544a2a({'code':0xc8,'message':[_0x267a91['uniqueid'],_0x58e9d5[_0xc7a8('0x19')]['toLowerCase']()]['join']('\x20')});})[_0xc7a8('0x1d')](function(_0x514efc){_0x339ae3(_0x528e99[_0xc7a8('0xf')](0x1f5,[_0x267a91[_0xc7a8('0x5b')],_0x514efc['message'][_0xc7a8('0x62')]()][_0xc7a8('0x13')]('\x20')));});}else{return _0x339ae3(_0x528e99[_0xc7a8('0xf')](0x1f5,_0xc7a8('0x66')));}});},'Agents':function(_0x3bed8d){return new Promise(function(_0xbebc6b,_0x5df35d){var _0x579442=_[_0xc7a8('0x55')](_0x57e6a7['agents']);_0xbebc6b({'count':_0x579442[_0xc7a8('0x54')],'rows':_0x579442});});},'Telephones':function(_0x13c07c){return new Promise(function(_0x4fc73f,_0x57b144){var _0x525828=_['values'](_0x57e6a7['telephones']);_0x4fc73f({'count':_0x525828[_0xc7a8('0x54')],'rows':_0x525828});});},'Trunks':function(_0x478bc5){return new Promise(function(_0x536cd9,_0x555392){var _0x55d561=_[_0xc7a8('0x55')](_0x57e6a7[_0xc7a8('0x73')]);_0x536cd9({'count':_0x55d561[_0xc7a8('0x54')],'rows':_0x55d561});});},'OutboundChannels':function(_0x2d2d32){return new Promise(function(_0x165430,_0x40a6fc){var _0x1725ba=_[_0xc7a8('0x55')](_0x57e6a7['outboundChannels']);_0x165430({'count':_0x1725ba[_0xc7a8('0x54')],'rows':_0x1725ba});});},'Outbound':function(_0x10db99){return new Promise(function(_0x279986,_0x55d83c){_0x279986(_0x57e6a7[_0xc7a8('0x74')]);});},'Campaigns':function(_0x395922){return new Promise(function(_0x1334ad,_0x19b779){var _0x56c76c=_['values'](_0x57e6a7['campaigns']);_0x1334ad({'count':_0x56c76c[_0xc7a8('0x54')],'rows':_0x56c76c});});},'VoiceQueuesPreview':function(_0x491706){var _0x19cfe9=this;return new Promise(function(_0x1ab2cc,_0x135f54){_0x1aeb11[_0xc7a8('0x75')](_0x491706['id'])[_0xc7a8('0x18')](function(_0x14d4d1){_0x1ab2cc({'code':0xc8,'message':_0x14d4d1[_0xc7a8('0x19')]});})[_0xc7a8('0x1d')](function(_0x3215e5){_0x135f54(_0x19cfe9[_0xc7a8('0xf')](0x1f4,_0x3215e5[_0xc7a8('0x19')]));});});},'EventManager':function(_0x568b46){var _0x2e2520=this;return new Promise(function(_0x275ff9,_0x49e808){if(!_0x568b46[_0xc7a8('0x76')]){return _0x49e808(_0x2e2520['error'](0x1f4,_0xc7a8('0x77')));}ami['emit'](_0xc7a8('0x78')+_0x568b46[_0xc7a8('0x76')],_0x568b46[_0xc7a8('0x19')]);_0x275ff9({'code':0xc8,'message':_0x568b46});});},'FaxAccounts':function(_0xa562fd){return new Promise(function(_0x520381,_0x58abf6){var _0xeb2dea=_['values'](_0x57e6a7[_0xc7a8('0x79')]);_0x520381({'count':_0xeb2dea['length'],'rows':_0xeb2dea});});},'SendFax':function(_0x5e5ee8){var _0x42185f=this;return new Promise(function(_0x155d91,_0x3dbdd5){_0x4ed267[_0xc7a8('0x7a')](_0x5e5ee8)['then'](function(_0x5b27a5){_0x155d91({'code':0xc8,'message':_0x5b27a5['message']});})[_0xc7a8('0x1d')](function(_0x3b9e68){_0x3dbdd5(_0x42185f[_0xc7a8('0xf')](0x1f4,_0x3b9e68[_0xc7a8('0x19')]));});});},'CheckAfterSend':function(_0x3042e3){var _0x56736a=this;return new Promise(function(_0x51f6bc,_0x2ff6fc){_0x4ed267['checkAfterSend'](_0x3042e3)[_0xc7a8('0x18')](function(_0x133e29){_0x51f6bc({'code':0xc8,'message':_0x133e29[_0xc7a8('0x19')]});})[_0xc7a8('0x1d')](function(_0x351403){_0x2ff6fc(_0x56736a[_0xc7a8('0xf')](0x1f4,_0x351403['message']));});});}};var _0x308e28=jayson['server'](_0x358478)[_0xc7a8('0x7b')]();_0x308e28['on'](_0xc7a8('0xf'),function(_0x104c04){return _0x35efb5(_0x104c04);});_0x308e28[_0xc7a8('0x6')](0x232a,_0xc7a8('0x7c'),function(){console[_0xc7a8('0x7d')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x52ba54(_0xc7a8('0x7e')+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 30bfbcc..568b195 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 _0x1720=['../../rpc/cmContact','redis','localhost','socket.io-emitter','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','xmd-contactid2','user:%s','name','action','toLowerCase','merge','createContact','format','trigger:%s','bluebird','util','ioredis','../../../../config/logger','trigger'];(function(_0x49dfb2,_0x444059){var _0x5a5c5c=function(_0xaef2b){while(--_0xaef2b){_0x49dfb2['push'](_0x49dfb2['shift']());}};_0x5a5c5c(++_0x444059);}(_0x1720,0xf7));var _0x0172=function(_0x1e1e66,_0x7778cb){_0x1e1e66=_0x1e1e66-0x0;var _0x205176=_0x1720[_0x1e1e66];return _0x205176;};'use strict';var BPromise=require(_0x0172('0x0'));var util=require(_0x0172('0x1'));var _=require('lodash');var Redis=require(_0x0172('0x2'));var config=require('../../../../config/environment');var logger=require(_0x0172('0x3'))(_0x0172('0x4'));var cmContactRpc=require(_0x0172('0x5'));config[_0x0172('0x6')]=_['defaults'](config['redis'],{'host':_0x0172('0x7'),'port':0x18eb});var io=require(_0x0172('0x8'))(new Redis(config['redis']));function emit(_0x1d8463,_0xf08465,_0xf763ee){logger['info'](_0x1d8463,_0xf08465,JSON[_0x0172('0x9')](_0xf763ee));io['to'](_0x1d8463)[_0x0172('0xa')](_0xf08465,_0xf763ee);}exports[_0x0172('0xb')]=function(_0x3f3250,_0x35fae1,_0x541244){_0x541244[_0x0172('0xc')]=0x0;if(_0x35fae1[_0x0172('0xd')]&&parseInt(_0x35fae1[_0x0172('0xd')],0xa)){var _0x5ab2b3={'ListId':parseInt(_0x35fae1[_0x0172('0xe')],0xa),'phone':_0x541244[_0x0172('0xf')]};if(_[_0x0172('0x10')](_0x541244[_0x0172('0x11')])){_0x5ab2b3[_0x0172('0x12')]=_0x541244[_0x0172('0x13')]&&_0x541244[_0x0172('0x13')]!==_0x0172('0x14')?_0x541244[_0x0172('0x13')]:_0x541244['calleridnum']||_0x541244[_0x0172('0x15')];}else{_0x5ab2b3[_0x0172('0x12')]=_0x541244[_0x0172('0x16')]&&_0x541244[_0x0172('0x16')]!==_0x0172('0x14')?_0x541244[_0x0172('0x16')]:_0x541244[_0x0172('0x17')]||_0x541244[_0x0172('0x15')];_0x5ab2b3[_0x0172('0x18')]=_0x541244[_0x0172('0x16')]&&_0x541244[_0x0172('0x16')]!==_0x0172('0x14')?_0x541244[_0x0172('0x16')]:_0x541244[_0x0172('0x17')]||_0x541244[_0x0172('0x15')];}BPromise[_0x0172('0x19')]()[_0x0172('0x1a')](cmContactRpc['showContact']({'where':_['omit'](_0x5ab2b3,['firstName'])}))[_0x0172('0x1a')](function(_0x11370f){if(_0x11370f){_0x541244[_0x0172('0x1b')]=_0x11370f['id'];emit(util['format'](_0x0172('0x1c'),_0x3f3250[_0x0172('0x1d')]),util['format']('trigger:%s',_0x35fae1[_0x0172('0x1e')][_0x0172('0x1f')]()),_[_0x0172('0x20')](_0x541244,{'ListId':parseInt(_0x35fae1[_0x0172('0xe')],0xa)}));return;}else{return BPromise[_0x0172('0x19')]()['then'](cmContactRpc[_0x0172('0x21')](_0x5ab2b3));}})['then'](function(_0x2e5416){if(_0x2e5416){_0x541244['xmd-contactid2']=_0x2e5416['id'];emit(util[_0x0172('0x22')](_0x0172('0x1c'),_0x3f3250['name']),util[_0x0172('0x22')](_0x0172('0x23'),_0x35fae1[_0x0172('0x1e')][_0x0172('0x1f')]()),_[_0x0172('0x20')](_0x541244,{'ListId':parseInt(_0x35fae1['data1'],0xa)}));}})['catch'](function(_0x4ce8e6){logger['error']('Error\x20creating\x20contact',JSON['stringify'](_0x4ce8e6));});}else{if(_0x3f3250){emit(util[_0x0172('0x22')](_0x0172('0x1c'),_0x3f3250['name']),util[_0x0172('0x22')](_0x0172('0x23'),_0x35fae1[_0x0172('0x1e')]['toLowerCase']()),_['merge']({'ListId':parseInt(_0x35fae1[_0x0172('0xe')],0xa)},_0x541244));}}}; \ No newline at end of file +var _0x5b5b=['data1','resolve','createContact','xmd-contactid2','trigger:%s','catch','bluebird','util','lodash','ioredis','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','autoCreate','data2','calleridnum','routeId','calleridname','uniqueid','destcalleridname','','phone','destcalleridnum','then','showContact','format','user:%s','name','action','toLowerCase','merge'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x5b5b,0x1b6));var _0xb5b5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b5b[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0xb5b5('0x0'));var util=require(_0xb5b5('0x1'));var _=require(_0xb5b5('0x2'));var Redis=require(_0xb5b5('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xb5b5('0x4'));var cmContactRpc=require(_0xb5b5('0x5'));config[_0xb5b5('0x6')]=_[_0xb5b5('0x7')](config[_0xb5b5('0x6')],{'host':_0xb5b5('0x8'),'port':0x18eb});var io=require(_0xb5b5('0x9'))(new Redis(config[_0xb5b5('0x6')]));function emit(_0x30e06f,_0x10fb4f,_0x5f543f){logger[_0xb5b5('0xa')](_0x30e06f,_0x10fb4f,JSON[_0xb5b5('0xb')](_0x5f543f));io['to'](_0x30e06f)['emit'](_0x10fb4f,_0x5f543f);}exports['exec']=function(_0x18fe54,_0x42d4c3,_0x2b082f){_0x2b082f[_0xb5b5('0xc')]=0x0;if(_0x42d4c3[_0xb5b5('0xd')]&&parseInt(_0x42d4c3[_0xb5b5('0xd')],0xa)){var _0xc46f57={'ListId':parseInt(_0x42d4c3['data1'],0xa),'phone':_0x2b082f[_0xb5b5('0xe')]};if(_['isNil'](_0x2b082f[_0xb5b5('0xf')])){_0xc46f57['firstName']=_0x2b082f[_0xb5b5('0x10')]&&_0x2b082f[_0xb5b5('0x10')]!==''?_0x2b082f[_0xb5b5('0x10')]:_0x2b082f[_0xb5b5('0xe')]||_0x2b082f[_0xb5b5('0x11')];}else{_0xc46f57['firstName']=_0x2b082f[_0xb5b5('0x12')]&&_0x2b082f[_0xb5b5('0x12')]!==_0xb5b5('0x13')?_0x2b082f[_0xb5b5('0x12')]:_0x2b082f['destcalleridnum']||_0x2b082f['uniqueid'];_0xc46f57[_0xb5b5('0x14')]=_0x2b082f[_0xb5b5('0x12')]&&_0x2b082f['destcalleridname']!==_0xb5b5('0x13')?_0x2b082f['destcalleridname']:_0x2b082f[_0xb5b5('0x15')]||_0x2b082f['uniqueid'];}BPromise['resolve']()[_0xb5b5('0x16')](cmContactRpc[_0xb5b5('0x17')]({'where':_['omit'](_0xc46f57,['firstName'])}))[_0xb5b5('0x16')](function(_0x2df317){if(_0x2df317){_0x2b082f['xmd-contactid2']=_0x2df317['id'];emit(util[_0xb5b5('0x18')](_0xb5b5('0x19'),_0x18fe54[_0xb5b5('0x1a')]),util[_0xb5b5('0x18')]('trigger:%s',_0x42d4c3[_0xb5b5('0x1b')][_0xb5b5('0x1c')]()),_[_0xb5b5('0x1d')](_0x2b082f,{'ListId':parseInt(_0x42d4c3[_0xb5b5('0x1e')],0xa)}));return;}else{return BPromise[_0xb5b5('0x1f')]()[_0xb5b5('0x16')](cmContactRpc[_0xb5b5('0x20')](_0xc46f57));}})[_0xb5b5('0x16')](function(_0x1fb6fa){if(_0x1fb6fa){_0x2b082f[_0xb5b5('0x21')]=_0x1fb6fa['id'];emit(util[_0xb5b5('0x18')]('user:%s',_0x18fe54['name']),util[_0xb5b5('0x18')](_0xb5b5('0x22'),_0x42d4c3[_0xb5b5('0x1b')][_0xb5b5('0x1c')]()),_['merge'](_0x2b082f,{'ListId':parseInt(_0x42d4c3[_0xb5b5('0x1e')],0xa)}));}})[_0xb5b5('0x23')](function(_0x34a2a7){logger['error']('Error\x20creating\x20contact',JSON[_0xb5b5('0xb')](_0x34a2a7));});}else{if(_0x18fe54){emit(util['format'](_0xb5b5('0x19'),_0x18fe54[_0xb5b5('0x1a')]),util[_0xb5b5('0x18')]('trigger:%s',_0x42d4c3[_0xb5b5('0x1b')][_0xb5b5('0x1c')]()),_[_0xb5b5('0x1d')]({'ListId':parseInt(_0x42d4c3[_0xb5b5('0x1e')],0xa)},_0x2b082f));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e0a5e51..9d847cc 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 _0x3969=['zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','prototype','clone','checkTriggers','interface','hasOwnProperty','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','html','data2','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','800','windowHeight','data6','600','winApplication','render','user:%s','name','format','trigger:%s:%s','action','jscripty','trigger:%s','exec','integration','routeId','urlforward','script','parse','query','search','checkTrigger','AllConditions','every','channel','AnyConditions','checkConditions','field','chat','operator','upperFirst','AccountId','value','interaction','queue','agent','membername','lastevent','util','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x3969,0x1a6));var _0x9396=function(_0x286e9c,_0x1e6c47){_0x286e9c=_0x286e9c-0x0;var _0x5a6704=_0x3969[_0x286e9c];return _0x5a6704;};'use strict';var util=require(_0x9396('0x0'));var _=require(_0x9396('0x1'));var url=require(_0x9396('0x2'));var Mustache=require(_0x9396('0x3'));var Redis=require(_0x9396('0x4'));var urlforward=require('./urlforward');var integration=require(_0x9396('0x5'));var cmContact=require(_0x9396('0x6'));var script=require(_0x9396('0x7'));var cmContactRpc=require(_0x9396('0x8'));var config=require(_0x9396('0x9'));var logger=require(_0x9396('0xa'))(_0x9396('0xb'));var ami=require(_0x9396('0xc'));config['redis']=_['defaults'](config[_0x9396('0xd')],{'host':_0x9396('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9396('0xd')]));var operators={'equals':function(_0x21042a,_0x8e5ab){return _0x21042a==_0x8e5ab;},'not_equals':function(_0x293642,_0x52fa5f){return _0x293642!=_0x52fa5f;}};var barAndWebActions=[_0x9396('0xf'),_0x9396('0x2'),_0x9396('0x10')];function Trigger(_0x651c55){this['triggers']=_0x651c55[_0x9396('0x11')];this[_0x9396('0x12')]=_0x651c55[_0x9396('0x12')];this[_0x9396('0x13')]=_0x651c55[_0x9396('0x13')];this[_0x9396('0x14')]=_0x651c55[_0x9396('0x14')];this[_0x9396('0x15')]=_0x651c55[_0x9396('0x15')];this[_0x9396('0x16')]=_0x651c55[_0x9396('0x16')];this[_0x9396('0x17')]=_0x651c55[_0x9396('0x17')];this[_0x9396('0x18')]=_0x651c55[_0x9396('0x18')];this[_0x9396('0x19')]=_0x651c55['sugarcrmAccounts'];this['zohoAccounts']=_0x651c55[_0x9396('0x1a')];this[_0x9396('0x1b')]=_0x651c55['deskAccounts'];this['vtigerAccounts']=_0x651c55['vtigerAccounts'];this[_0x9396('0x1c')]=_0x651c55[_0x9396('0x1c')];this[_0x9396('0x1d')]=_0x651c55['dynamics365Accounts'];this[_0x9396('0x1e')]={'zendesk':this[_0x9396('0x16')],'salesforce':this[_0x9396('0x18')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x9396('0x19')],'zoho':this[_0x9396('0x1a')],'desk':this['deskAccounts'],'vtiger':this[_0x9396('0x1f')],'servicenow':this[_0x9396('0x1c')],'dynamics365':this['dynamics365Accounts']};ami['on'](_0x9396('0x20'),this[_0x9396('0x21')]['bind'](this));ami['on'](_0x9396('0x22'),this['syncCustomEvent'][_0x9396('0x23')](this));ami['on'](_0x9396('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9396('0x25'),this[_0x9396('0x21')][_0x9396('0x23')](this));ami['on'](_0x9396('0x26'),this[_0x9396('0x21')][_0x9396('0x23')](this));ami['on']('custom:dialbegin',this[_0x9396('0x27')][_0x9396('0x23')](this));ami['on'](_0x9396('0x28'),this[_0x9396('0x27')]['bind'](this));ami['on'](_0x9396('0x29'),this[_0x9396('0x27')][_0x9396('0x23')](this));ami['on'](_0x9396('0x2a'),this['syncCustomEvent'][_0x9396('0x23')](this));ami['on'](_0x9396('0x2b'),this['syncCustomEvent'][_0x9396('0x23')](this));ami['on'](_0x9396('0x2c'),this[_0x9396('0x21')][_0x9396('0x23')](this));ami['on'](_0x9396('0x2d'),this[_0x9396('0x21')]['bind'](this));ami['on']('custom:acceptmessage',this[_0x9396('0x21')][_0x9396('0x23')](this));ami['on'](_0x9396('0x2e'),this['syncCustomEvent']['bind'](this));}Trigger['prototype'][_0x9396('0x2f')]=function(_0x49d370,_0x22d3ef,_0x4b4873){logger['info'](_0x49d370,_0x22d3ef,JSON['stringify'](_0x4b4873));io['to'](_0x49d370)['emit'](_0x22d3ef,_0x4b4873);};Trigger[_0x9396('0x30')][_0x9396('0x21')]=function(_0x298554){var _0x4f0b22=_[_0x9396('0x31')](_0x298554);this[_0x9396('0x32')](_0x4f0b22);};Trigger[_0x9396('0x30')]['syncAgentDial']=function(_0x24c9dc){if(this[_0x9396('0x12')][_0x24c9dc[_0x9396('0x33')]]){this[_0x9396('0x21')](_0x24c9dc);}};Trigger['prototype']['checkTriggers']=function(_0x4f66c1){var _0x54e709;for(var _0x3573ca in this['triggers']){if(this[_0x9396('0x11')][_0x9396('0x34')](_0x3573ca)){if(this[_0x9396('0x11')][_0x3573ca]['status']){_0x54e709=this['checkTrigger'](this[_0x9396('0x11')][_0x3573ca],_0x4f66c1);if(_0x54e709){_[_0x9396('0x35')](_0x4f66c1,_0x4f66c1[_0x9396('0x36')]);for(var _0x133120=0x0,_0x4af5d8,_0xfabb3d,_0x5bb145;_0x1331200x0){_0x692abc=_[_0x67a0('0x2b')](_0x490c73,_0xc5404e);}return _0x692abc;}function getCustomFields(_0x10c588,_0x263cc2){var _0x179fb6=[];var _0x32eee5={'custom_fields':{}};if(_0x10c588[_0x67a0('0x2a')]>0x0){_[_0x67a0('0x2c')](_0x10c588,function(_0x36cca2){if(_0x36cca2[_0x67a0('0x2d')]==='string'&&_0x36cca2['nameField']&&!_0x36cca2[_0x67a0('0x2e')]){_0x32eee5[_0x36cca2['nameField'][_0x67a0('0x2f')]()]=_0x36cca2[_0x67a0('0x30')][_0x67a0('0x21')]();}else if(_0x36cca2[_0x67a0('0x2d')]===_0x67a0('0x31')&&_0x36cca2[_0x67a0('0x32')]&&_0x36cca2[_0x67a0('0x2e')]){_0x32eee5['custom_fields'][_0x36cca2['idField']]=_0x36cca2[_0x67a0('0x30')]['toString']();}else if(_0x36cca2[_0x67a0('0x2d')]==='variable'&&_0x36cca2[_0x67a0('0x33')]&&_0x36cca2['idField']&&_0x36cca2[_0x67a0('0x2e')]){_0x263cc2[_0x36cca2[_0x67a0('0x33')]]&&(_0x32eee5[_0x67a0('0x34')][_0x36cca2['idField']]=_0x263cc2[_0x36cca2['variableName']][_0x67a0('0x21')]());}else if(_0x36cca2[_0x67a0('0x2d')]==='customVariable'&&_0x36cca2[_0x67a0('0x35')]&&_0x36cca2[_0x67a0('0x35')][_0x67a0('0x36')]&&_0x36cca2[_0x67a0('0x32')]&&_0x36cca2[_0x67a0('0x2e')]){_0x263cc2[_0x36cca2[_0x67a0('0x35')]['name'][_0x67a0('0x2f')]()]&&(_0x32eee5[_0x67a0('0x34')][_0x36cca2[_0x67a0('0x32')]]=_0x263cc2[_0x36cca2['Variable'][_0x67a0('0x36')][_0x67a0('0x2f')]()]['toString']());}});}if(_0x32eee5['priority']){_0x32eee5['priority']=Number(_0x32eee5[_0x67a0('0x37')]);}return _0x32eee5;}function getTicket(_0x2077cc,_0x251d40,_0x2d083c,_0x5ba9ae,_0x17fdde){logger[_0x67a0('0x13')]('Creating\x20new\x20ticket...');var _0x2c1b9e=_[_0x67a0('0x38')]({'subject':intUtil[_0x67a0('0x39')](_0x5ba9ae['Subjects'],_0x17fdde,'\x20'),'type':_0x67a0('0x3a'),'status':_0x67a0('0x3b'),'labels':[_0x67a0('0x3c'),_0x67a0('0x3d'),_0x67a0('0x3e')][_0x67a0('0x3f')](getTags(_0x5ba9ae['Tags'],_0x67a0('0x36'))),'description':intUtil[_0x67a0('0x39')](_0x5ba9ae[_0x67a0('0x40')],_0x17fdde,'\x0a'),'_links':{'assigned_user':{'href':util[_0x67a0('0xd')](_0x67a0('0x41'),_0x251d40['id']),'class':_0x67a0('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x5ba9ae[_0x67a0('0x40')],_0x17fdde,'\x0a')}},getCustomFields(_0x5ba9ae[_0x67a0('0x43')],_0x17fdde));return request({'uri':util[_0x67a0('0xd')](_0x67a0('0x44'),_0x2077cc['remoteUri'],_0x2d083c['id']),'method':_0x67a0('0x28'),'body':_0x2c1b9e});}exports[_0x67a0('0x45')]=function(_0x565532,_0x3cf3b6,_0x30b9d5,_0x155d6a,_0x2f18ba,_0x17397b){var _0x28ab0f,_0x30c278;_0x17397b[_0x67a0('0xf')]=intUtil[_0x67a0('0x46')](_0x17397b[_0x67a0('0xf')]);_0x17397b[_0x67a0('0x47')]=intUtil[_0x67a0('0x46')](_0x17397b[_0x67a0('0x47')]);if(_0x2f18ba&&_0x2f18ba[_0x67a0('0x48')]){logger[_0x67a0('0x13')]('[QUEUE]',_0x67a0('0x49'));_0x3cf3b6[_0x67a0('0x4a')]=util[_0x67a0('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17397b[_0x67a0('0x47')],_0x3cf3b6[_0x67a0('0x4b')],md5(_0x3cf3b6[_0x67a0('0x4b')]));}else{_0x3cf3b6[_0x67a0('0x4a')]='';}headers['Authorization']=getAuth(_0x17397b);return getUser(_0x17397b,_0x155d6a[_0x67a0('0x4c')])[_0x67a0('0x10')](function(_0x2961d7){_0x28ab0f=_0x2961d7;logger[_0x67a0('0x13')]('The\x20User\x20ID\x20is:',_0x28ab0f['id']);return getEndUser(_0x17397b,_0x3cf3b6[_0x67a0('0x4d')],_0x3cf3b6['calleridnum']);})['then'](function(_0x87b1b6){_0x30c278=_0x87b1b6;logger[_0x67a0('0x13')]('The\x20Enduser\x20ID\x20is:',_0x30c278['id']);return getTicket(_0x17397b,_0x28ab0f,_0x30c278,_0x30b9d5,_0x3cf3b6);})[_0x67a0('0x10')](function(_0x386903){if(_0x386903){logger[_0x67a0('0x13')](_0x67a0('0x4e'));logger['info'](_0x67a0('0x4f'),_0x386903['id']);switch(_0x17397b[_0x67a0('0x2d')]){case _0x67a0('0x50'):logger[_0x67a0('0x13')](_0x67a0('0x51'),_0x67a0('0x52'));emit(util[_0x67a0('0xd')](_0x67a0('0x53'),_0x155d6a[_0x67a0('0x36')]),_0x67a0('0x54'),{'recordId':_0x386903['id']});break;case'newTab':logger[_0x67a0('0x13')]('[QUEUE]',_0x67a0('0x55'));emit(util[_0x67a0('0xd')](_0x67a0('0x53'),_0x155d6a[_0x67a0('0x36')]),_0x67a0('0x56'),{'uri':util[_0x67a0('0xd')](_0x67a0('0x57'),_0x386903['id'])});break;default:logger[_0x67a0('0x58')](_0x67a0('0x51'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x67a0('0x59')](function(_0x43cf4c){console[_0x67a0('0x58')](_0x43cf4c);logger['error']('[QUEUE]',JSON[_0x67a0('0x19')](_0x43cf4c));});};exports[_0x67a0('0x5a')]=function(_0x2751a4,_0x62d00f,_0x23443d,_0x176548,_0x34f05b,_0x6a1e69,_0x565a5){var _0x376fe6,_0x55de8f;_0x6a1e69['remoteUri']=intUtil[_0x67a0('0x46')](_0x6a1e69[_0x67a0('0xf')]);_0x6a1e69[_0x67a0('0x47')]=intUtil[_0x67a0('0x46')](_0x6a1e69[_0x67a0('0x47')]);if(_0x565a5&&_0x565a5['recordingFormat']&&_0x565a5[_0x67a0('0x5b')]!==_0x67a0('0x5c')){logger[_0x67a0('0x13')](_0x67a0('0x5d'),_0x67a0('0x49'));_0x62d00f[_0x67a0('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6a1e69[_0x67a0('0x47')],_0x62d00f['uniqueid'],md5(_0x62d00f['uniqueid']));}headers['Authorization']=getAuth(_0x6a1e69);return getUser(_0x6a1e69,_0x176548['email'])['then'](function(_0x17aae7){_0x376fe6=_0x17aae7;logger[_0x67a0('0x13')]('The\x20User\x20ID\x20is:',_0x376fe6['id']);return getEndUser(_0x6a1e69,_0x62d00f['destcalleridname'],_0x62d00f[_0x67a0('0x5e')]);})[_0x67a0('0x10')](function(_0x58d35a){_0x55de8f=_0x58d35a;logger[_0x67a0('0x13')](_0x67a0('0x5f'),_0x55de8f['id']);return getTicket(_0x6a1e69,_0x376fe6,_0x55de8f,_0x23443d,_0x62d00f);})[_0x67a0('0x10')](function(_0x17447b){if(_0x17447b){logger[_0x67a0('0x13')]('Ticket\x20created!');logger[_0x67a0('0x13')](_0x67a0('0x4f'),_0x17447b['id']);switch(_0x6a1e69[_0x67a0('0x2d')]){case _0x67a0('0x50'):logger[_0x67a0('0x13')](_0x67a0('0x51'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x67a0('0xd')]('user:%s',_0x176548['name']),'trigger:desk:display',{'recordId':_0x17447b['id']});break;case _0x67a0('0x60'):logger[_0x67a0('0x13')](_0x67a0('0x51'),_0x67a0('0x55'));emit(util[_0x67a0('0xd')]('user:%s',_0x176548[_0x67a0('0x36')]),_0x67a0('0x56'),{'uri':util[_0x67a0('0xd')](_0x67a0('0x61'),_0x6a1e69['remoteUri'],_0x17447b['id'])});break;default:logger[_0x67a0('0x58')](_0x67a0('0x5d'),_0x67a0('0x62'));}}})[_0x67a0('0x59')](function(_0x972123){logger[_0x67a0('0x58')]('[OUTBOUND]',JSON['stringify'](_0x972123));});};exports[_0x67a0('0x63')]=function(_0x1b9cee,_0xdef58c,_0x5962b9,_0x48394a,_0x125ee4,_0x121a5c){var _0x3b924b,_0x1f678f;_0x121a5c[_0x67a0('0xf')]=intUtil[_0x67a0('0x46')](_0x121a5c[_0x67a0('0xf')]);_0x121a5c[_0x67a0('0x47')]=intUtil[_0x67a0('0x46')](_0x121a5c[_0x67a0('0x47')]);if(_0x125ee4&&_0x125ee4[_0x67a0('0x48')]){logger[_0x67a0('0x13')](_0x67a0('0x64'),_0x67a0('0x49'));_0xdef58c[_0x67a0('0x4a')]=util[_0x67a0('0xd')](_0x67a0('0x65'),_0x121a5c[_0x67a0('0x47')],_0xdef58c[_0x67a0('0x4b')],md5(_0xdef58c[_0x67a0('0x4b')]));}else{_0xdef58c[_0x67a0('0x4a')]='';}headers[_0x67a0('0x66')]=getAuth(_0x121a5c);return getUser(_0x121a5c)[_0x67a0('0x10')](function(_0x108a75){_0x3b924b=_0x108a75;logger[_0x67a0('0x13')](_0x67a0('0x67'),_0x3b924b['id']);return getEndUser(_0x121a5c,_0xdef58c[_0x67a0('0x4d')],_0xdef58c[_0x67a0('0x68')]);})[_0x67a0('0x10')](function(_0x1bc193){_0x1f678f=_0x1bc193;logger[_0x67a0('0x13')]('The\x20Enduser\x20ID\x20is:',_0x1f678f['id']);return getTicket(_0x121a5c,_0x3b924b,_0x1f678f,_0x5962b9,_0xdef58c);})[_0x67a0('0x10')](function(_0x338619){if(_0x338619){logger[_0x67a0('0x13')]('Ticket\x20created!');logger[_0x67a0('0x13')](_0x67a0('0x4f'),_0x338619['id']);}})['catch'](function(_0x30767c){logger['error']('[ABANDONED]',JSON[_0x67a0('0x19')](_0x30767c));});}; \ No newline at end of file +var _0x9603=['GET','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','total_entries','Enduser\x20found!','length','type','string','nameField','customField','toLowerCase','content','toString','idField','variableName','Variable','name','custom_fields','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','Motion','CTI','user','Descriptions','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','Desk\x20account\x20type\x20not\x20recognized','catch','error','stringify','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','abandoned','[ABANDONED]','calleridnum','util','ioredis','../../../../config/environment','desk','defaults','socket.io-emitter','redis','application/json','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug'];(function(_0x39c96f,_0x5b0925){var _0x6e3cd5=function(_0x414909){while(--_0x414909){_0x39c96f['push'](_0x39c96f['shift']());}};_0x6e3cd5(++_0x5b0925);}(_0x9603,0x164));var _0x3960=function(_0x14a9fb,_0x473e48){_0x14a9fb=_0x14a9fb-0x0;var _0x5f443f=_0x9603[_0x14a9fb];return _0x5f443f;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x3960('0x0'));var Redis=require(_0x3960('0x1'));var intUtil=require('./util');var config=require(_0x3960('0x2'));var logger=require('../../../../config/logger')(_0x3960('0x3'));config['redis']=_[_0x3960('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3960('0x5'))(new Redis(config[_0x3960('0x6')]));function emit(_0x3918bf,_0x3864bd,_0x365c01){io['to'](_0x3918bf)['emit'](_0x3864bd,_0x365c01);}var headers={'Content-Type':'application/json','Accept':_0x3960('0x7')};function getUser(_0x18a2d1,_0x16ef55){if(intUtil['validateEmail'](_0x16ef55)===!![]){logger[_0x3960('0x8')](_0x3960('0x9'),_0x16ef55);return request({'uri':util[_0x3960('0xa')](_0x3960('0xb'),_0x18a2d1[_0x3960('0xc')])})[_0x3960('0xd')](function(_0x150cf3){if(_0x150cf3['total_entries']){return _[_0x3960('0xe')](_0x150cf3[_0x3960('0xf')][_0x3960('0x10')],{'email':_0x16ef55});}})[_0x3960('0xd')](function(_0x3e76d2){if(_0x3e76d2){logger['info']('Agent\x20found!');return _0x3e76d2;}else{logger[_0x3960('0x8')](_0x3960('0x11'));return request({'uri':util[_0x3960('0xa')]('%s/users/me',_0x18a2d1['remoteUri'])});}});}else{logger[_0x3960('0x8')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x3960('0xa')](_0x3960('0x12'),_0x18a2d1[_0x3960('0xc')])});}}function request(_0xa5c7f0){logger[_0x3960('0x13')]('[HTTP]',JSON['stringify'](_0xa5c7f0));return rp(_[_0x3960('0x4')](_0xa5c7f0,{'method':_0x3960('0x14'),'headers':headers,'json':!![]}));}function getAuth(_0x16358c){var _0x3a0b02;if(_0x16358c[_0x3960('0x15')]==='basic'){_0x3a0b02=util['format'](_0x3960('0x16'),_0x16358c[_0x3960('0x17')],_0x16358c['password']);}else if(_0x16358c['authType']===_0x3960('0x18')){_0x3a0b02=util[_0x3960('0xa')](_0x3960('0x19'),_0x16358c[_0x3960('0x17')],_0x16358c[_0x3960('0x18')]);}return util['format'](_0x3960('0x1a'),new Buffer(_0x3a0b02)['toString']('base64'));}function getEndUser(_0x3077c7,_0x1748d7,_0x1f2918){logger[_0x3960('0x8')](_0x3960('0x1b'),_0x1f2918);return request({'uri':util['format'](_0x3960('0x1c'),_0x3077c7[_0x3960('0xc')]),'qs':{'phone':_0x1f2918}})[_0x3960('0xd')](function(_0x39ed37){if(_0x39ed37[_0x3960('0x1d')]){logger[_0x3960('0x8')](_0x3960('0x1e'));return _0x39ed37[_0x3960('0xf')][_0x3960('0x10')][0x0];}else{logger[_0x3960('0x8')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3960('0xa')]('%s/customers',_0x3077c7[_0x3960('0xc')]),'method':'POST','body':{'first_name':_0x1748d7,'title':_0x1748d7,'phone_numbers':[{'type':'work','value':_0x1f2918}]}});}});}function getTags(_0x4a8e82,_0x502a00){var _0x4c6fd8=[];if(_0x4a8e82&&_0x4a8e82['length']>0x0){_0x4c6fd8=_['map'](_0x4a8e82,_0x502a00);}return _0x4c6fd8;}function getCustomFields(_0x549d42,_0x3eb8ee){var _0x59f600=[];var _0x5a7463={'custom_fields':{}};if(_0x549d42[_0x3960('0x1f')]>0x0){_['forEach'](_0x549d42,function(_0xf201ab){if(_0xf201ab[_0x3960('0x20')]===_0x3960('0x21')&&_0xf201ab[_0x3960('0x22')]&&!_0xf201ab[_0x3960('0x23')]){_0x5a7463[_0xf201ab[_0x3960('0x22')][_0x3960('0x24')]()]=_0xf201ab[_0x3960('0x25')][_0x3960('0x26')]();}else if(_0xf201ab['type']===_0x3960('0x21')&&_0xf201ab[_0x3960('0x27')]&&_0xf201ab[_0x3960('0x23')]){_0x5a7463['custom_fields'][_0xf201ab[_0x3960('0x27')]]=_0xf201ab[_0x3960('0x25')]['toString']();}else if(_0xf201ab[_0x3960('0x20')]==='variable'&&_0xf201ab[_0x3960('0x28')]&&_0xf201ab[_0x3960('0x27')]&&_0xf201ab[_0x3960('0x23')]){_0x3eb8ee[_0xf201ab[_0x3960('0x28')]]&&(_0x5a7463['custom_fields'][_0xf201ab['idField']]=_0x3eb8ee[_0xf201ab[_0x3960('0x28')]][_0x3960('0x26')]());}else if(_0xf201ab[_0x3960('0x20')]==='customVariable'&&_0xf201ab[_0x3960('0x29')]&&_0xf201ab['Variable'][_0x3960('0x2a')]&&_0xf201ab[_0x3960('0x27')]&&_0xf201ab[_0x3960('0x23')]){_0x3eb8ee[_0xf201ab[_0x3960('0x29')]['name'][_0x3960('0x24')]()]&&(_0x5a7463[_0x3960('0x2b')][_0xf201ab[_0x3960('0x27')]]=_0x3eb8ee[_0xf201ab[_0x3960('0x29')][_0x3960('0x2a')][_0x3960('0x24')]()][_0x3960('0x26')]());}});}if(_0x5a7463['priority']){_0x5a7463[_0x3960('0x2c')]=Number(_0x5a7463[_0x3960('0x2c')]);}return _0x5a7463;}function getTicket(_0x31d7c5,_0x1faae7,_0x15bb86,_0x3e3fcd,_0x1bf243){logger[_0x3960('0x8')](_0x3960('0x2d'));var _0x2096fc=_[_0x3960('0x2e')]({'subject':intUtil[_0x3960('0x2f')](_0x3e3fcd[_0x3960('0x30')],_0x1bf243,'\x20'),'type':_0x3960('0x31'),'status':_0x3960('0x32'),'labels':['xCALLY',_0x3960('0x33'),_0x3960('0x34')]['concat'](getTags(_0x3e3fcd['Tags'],_0x3960('0x2a'))),'description':intUtil[_0x3960('0x2f')](_0x3e3fcd['Descriptions'],_0x1bf243,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x1faae7['id']),'class':_0x3960('0x35')}},'message':{'direction':'in','body':intUtil[_0x3960('0x2f')](_0x3e3fcd[_0x3960('0x36')],_0x1bf243,'\x0a')}},getCustomFields(_0x3e3fcd[_0x3960('0x37')],_0x1bf243));return request({'uri':util[_0x3960('0xa')](_0x3960('0x38'),_0x31d7c5[_0x3960('0xc')],_0x15bb86['id']),'method':_0x3960('0x39'),'body':_0x2096fc});}exports[_0x3960('0x3a')]=function(_0xc73aa7,_0x71272d,_0x32901c,_0x115f95,_0x47ae41,_0x534c29){var _0x81c88d,_0x5e71ed;_0x534c29[_0x3960('0xc')]=intUtil[_0x3960('0x3b')](_0x534c29['remoteUri']);_0x534c29[_0x3960('0x3c')]=intUtil[_0x3960('0x3b')](_0x534c29['serverUrl']);if(_0x47ae41&&_0x47ae41[_0x3960('0x3d')]){logger[_0x3960('0x8')](_0x3960('0x3e'),'Recording\x20is\x20enabled!');_0x71272d['recordingURL']=util[_0x3960('0xa')](_0x3960('0x3f'),_0x534c29[_0x3960('0x3c')],_0x71272d[_0x3960('0x40')],md5(_0x71272d[_0x3960('0x40')]));}else{_0x71272d[_0x3960('0x41')]='';}headers[_0x3960('0x42')]=getAuth(_0x534c29);return getUser(_0x534c29,_0x115f95[_0x3960('0x43')])[_0x3960('0xd')](function(_0x5a9a7b){_0x81c88d=_0x5a9a7b;logger['info']('The\x20User\x20ID\x20is:',_0x81c88d['id']);return getEndUser(_0x534c29,_0x71272d[_0x3960('0x44')],_0x71272d['calleridnum']);})['then'](function(_0x396494){_0x5e71ed=_0x396494;logger[_0x3960('0x8')](_0x3960('0x45'),_0x5e71ed['id']);return getTicket(_0x534c29,_0x81c88d,_0x5e71ed,_0x32901c,_0x71272d);})[_0x3960('0xd')](function(_0x471b69){if(_0x471b69){logger[_0x3960('0x8')](_0x3960('0x46'));logger[_0x3960('0x8')]('The\x20Ticket\x20ID\x20is:',_0x471b69['id']);switch(_0x534c29[_0x3960('0x20')]){case _0x3960('0x47'):logger['info'](_0x3960('0x3e'),_0x3960('0x48'));emit(util[_0x3960('0xa')](_0x3960('0x49'),_0x115f95[_0x3960('0x2a')]),_0x3960('0x4a'),{'recordId':_0x471b69['id']});break;case _0x3960('0x4b'):logger[_0x3960('0x8')](_0x3960('0x3e'),_0x3960('0x4c'));emit(util[_0x3960('0xa')](_0x3960('0x49'),_0x115f95['name']),_0x3960('0x4d'),{'uri':util['format'](_0x3960('0x4e'),_0x471b69['id'])});break;default:logger['error'](_0x3960('0x3e'),_0x3960('0x4f'));}}})[_0x3960('0x50')](function(_0x29dfa7){console['error'](_0x29dfa7);logger[_0x3960('0x51')]('[QUEUE]',JSON[_0x3960('0x52')](_0x29dfa7));});};exports[_0x3960('0x53')]=function(_0x116d1e,_0xad1cd7,_0x34f94d,_0x31523c,_0x376888,_0x4c63cc,_0x11317e){var _0x4df20a,_0xc95c1e;_0x4c63cc[_0x3960('0xc')]=intUtil['stripTrailingSlash'](_0x4c63cc[_0x3960('0xc')]);_0x4c63cc[_0x3960('0x3c')]=intUtil[_0x3960('0x3b')](_0x4c63cc[_0x3960('0x3c')]);if(_0x11317e&&_0x11317e['recordingFormat']&&_0x11317e['recordingFormat']!==_0x3960('0x54')){logger[_0x3960('0x8')](_0x3960('0x55'),_0x3960('0x56'));_0xad1cd7['recordingURL']=util[_0x3960('0xa')](_0x3960('0x3f'),_0x4c63cc[_0x3960('0x3c')],_0xad1cd7[_0x3960('0x40')],md5(_0xad1cd7[_0x3960('0x40')]));}headers['Authorization']=getAuth(_0x4c63cc);return getUser(_0x4c63cc,_0x31523c['email'])[_0x3960('0xd')](function(_0x33310a){_0x4df20a=_0x33310a;logger[_0x3960('0x8')](_0x3960('0x57'),_0x4df20a['id']);return getEndUser(_0x4c63cc,_0xad1cd7['destcalleridname'],_0xad1cd7[_0x3960('0x58')]);})[_0x3960('0xd')](function(_0x443427){_0xc95c1e=_0x443427;logger['info'](_0x3960('0x45'),_0xc95c1e['id']);return getTicket(_0x4c63cc,_0x4df20a,_0xc95c1e,_0x34f94d,_0xad1cd7);})['then'](function(_0x442dc4){if(_0x442dc4){logger[_0x3960('0x8')](_0x3960('0x46'));logger[_0x3960('0x8')](_0x3960('0x59'),_0x442dc4['id']);switch(_0x4c63cc[_0x3960('0x20')]){case _0x3960('0x47'):logger[_0x3960('0x8')](_0x3960('0x3e'),_0x3960('0x48'));emit(util[_0x3960('0xa')]('user:%s',_0x31523c[_0x3960('0x2a')]),_0x3960('0x4a'),{'recordId':_0x442dc4['id']});break;case _0x3960('0x4b'):logger['info']('[QUEUE]',_0x3960('0x4c'));emit(util[_0x3960('0xa')](_0x3960('0x49'),_0x31523c[_0x3960('0x2a')]),_0x3960('0x4d'),{'uri':util[_0x3960('0xa')](_0x3960('0x5a'),_0x4c63cc[_0x3960('0xc')],_0x442dc4['id'])});break;default:logger[_0x3960('0x51')]('[OUTBOUND]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0x3960('0x50')](function(_0x96b685){logger['error'](_0x3960('0x55'),JSON[_0x3960('0x52')](_0x96b685));});};exports[_0x3960('0x5b')]=function(_0x3d97da,_0x4e6186,_0x3f2489,_0x736065,_0x54d9bc,_0x5f1b63){var _0x53ac05,_0x7a62ca;_0x5f1b63[_0x3960('0xc')]=intUtil['stripTrailingSlash'](_0x5f1b63['remoteUri']);_0x5f1b63[_0x3960('0x3c')]=intUtil['stripTrailingSlash'](_0x5f1b63[_0x3960('0x3c')]);if(_0x54d9bc&&_0x54d9bc[_0x3960('0x3d')]){logger['info'](_0x3960('0x5c'),_0x3960('0x56'));_0x4e6186['recordingURL']=util['format'](_0x3960('0x3f'),_0x5f1b63[_0x3960('0x3c')],_0x4e6186[_0x3960('0x40')],md5(_0x4e6186[_0x3960('0x40')]));}else{_0x4e6186[_0x3960('0x41')]='';}headers[_0x3960('0x42')]=getAuth(_0x5f1b63);return getUser(_0x5f1b63)[_0x3960('0xd')](function(_0x5a8277){_0x53ac05=_0x5a8277;logger[_0x3960('0x8')](_0x3960('0x57'),_0x53ac05['id']);return getEndUser(_0x5f1b63,_0x4e6186['calleridname'],_0x4e6186[_0x3960('0x5d')]);})[_0x3960('0xd')](function(_0xa3c099){_0x7a62ca=_0xa3c099;logger['info'](_0x3960('0x45'),_0x7a62ca['id']);return getTicket(_0x5f1b63,_0x53ac05,_0x7a62ca,_0x3f2489,_0x4e6186);})['then'](function(_0x510779){if(_0x510779){logger['info'](_0x3960('0x46'));logger[_0x3960('0x8')]('The\x20Ticket\x20ID\x20is:',_0x510779['id']);}})[_0x3960('0x50')](function(_0x5a71de){logger[_0x3960('0x51')](_0x3960('0x5c'),JSON[_0x3960('0x52')](_0x5a71de));});}; \ 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 3b5103e..6866371 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 _0xfaa4=['indexOf','content','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','Subjects','/systemusers(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','serverUrl','stripTrailingSlash','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','isNil','validateEmail','email','length','internalemailaddress','info','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','destcalleridnum','calleridnum','userId','4.0','headers','odata-entityid','substring','lastIndexOf','value','outbound','telephone1','enduserId','contactid',']\x20Enduser\x20Created!','forEach','type','string','customField','idField'];(function(_0x4c4be6,_0x2c35e5){var _0x27a639=function(_0xd02aa6){while(--_0xd02aa6){_0x4c4be6['push'](_0x4c4be6['shift']());}};_0x27a639(++_0x2c35e5);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x3fc6a1,_0x394a57){_0x3fc6a1=_0x3fc6a1-0x0;var _0x26a96e=_0xfaa4[_0x3fc6a1];return _0x26a96e;};'use strict';var _=require(_0x4faa('0x0'));var BPromise=require(_0x4faa('0x1'));var rp=require(_0x4faa('0x2'));var util=require(_0x4faa('0x3'));var intUtil=require(_0x4faa('0x4'));var md5=require(_0x4faa('0x5'));var Redis=require('ioredis');var logger=require(_0x4faa('0x6'))(_0x4faa('0x7'));var config=require(_0x4faa('0x8'));config[_0x4faa('0x9')]=_['defaults'](config[_0x4faa('0x9')],{'host':_0x4faa('0xa'),'port':0x18eb});var io=require(_0x4faa('0xb'))(new Redis(config['redis']));function getAuthToken(_0x528871,_0x5d476f,_0x159843){var _0xa0edee={'method':_0x4faa('0xc'),'uri':_0x5d476f,'form':{'client_id':_0x528871['clientId'],'resource':_0x528871[_0x4faa('0xd')],'username':_0x528871[_0x4faa('0xe')],'password':_0x528871[_0x4faa('0xf')],'grant_type':_0x4faa('0xf'),'client_secret':_0x528871[_0x4faa('0x10')]},'json':!![]};return rp(_0xa0edee)['then'](function(_0x58cbac){return _0x58cbac[_0x4faa('0x11')];})[_0x4faa('0x12')](function(_0x17c847){logger[_0x4faa('0x13')]('['+[_0x159843[_0x4faa('0x14')]()]+_0x4faa('0x15'));return _0x17c847[_0x4faa('0x16')];});}function getUser(_0x12fe31,_0x16b134,_0xccae7b,_0x269899,_0x325030,_0x24ef94){return new BPromise(function(_0x597369,_0x401f2d){return getAuthToken(_0x16b134,_0x269899,_0x24ef94)[_0x4faa('0x17')](function(_0x195569){var _0x5a1ca5={'method':_0x4faa('0x18'),'uri':_0x325030+_0x4faa('0x19'),'headers':{'Authorization':_0x4faa('0x1a')+_0x195569,'OData-Version':'4.0'},'json':!![]};return rp(_0x5a1ca5);})[_0x4faa('0x17')](function(_0x44bd3b){var _0x48a8ed=_0x44bd3b['value'];var _0x5444d9=![];var _0x33592d=null;if(!_[_0x4faa('0x1b')](_0xccae7b)){if(intUtil[_0x4faa('0x1c')](_0xccae7b[_0x4faa('0x1d')])){_0x12fe31['userEmail']=_0xccae7b[_0x4faa('0x1d')];for(_0x33592d=0x0;_0x33592d<_0x48a8ed[_0x4faa('0x1e')];_0x33592d++){if(_0x48a8ed[_0x33592d][_0x4faa('0x1f')]===_0xccae7b[_0x4faa('0x1d')]&&!_0x48a8ed[_0x33592d]['isdisabled']){_0x5444d9=!![];logger[_0x4faa('0x20')]('['+[_0x24ef94['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x48a8ed[_0x33592d][_0x4faa('0x21')]+'!');_0x12fe31['userId']=_0x48a8ed[_0x33592d]['systemuserid'];}}}}if(!_0x5444d9){logger[_0x4faa('0x20')]('['+[_0x24ef94[_0x4faa('0x14')]()]+_0x4faa('0x22'));_0x12fe31[_0x4faa('0x23')]=_0x16b134[_0x4faa('0xe')];for(_0x33592d=0x0;_0x33592d<_0x48a8ed[_0x4faa('0x1e')];_0x33592d++){if(_0x48a8ed[_0x33592d][_0x4faa('0x1f')]===_0x16b134[_0x4faa('0xe')]){_0x12fe31['userId']=_0x48a8ed[_0x33592d][_0x4faa('0x21')];}}}_0x597369(_0x12fe31);})[_0x4faa('0x12')](function(_0x487296){_0x401f2d(_0x487296[_0x4faa('0x16')]);});});}function createEndUser(_0x29d08d,_0x3448b1,_0x40c17d,_0x5206ca,_0x925fe9,_0x5beae8){return new BPromise(function(_0x2e4306,_0x11f216){return getAuthToken(_0x3448b1,_0x40c17d,_0x5beae8)[_0x4faa('0x17')](function(_0x285914){var _0x2817a2=_0x5beae8[_0x4faa('0x24')]()==='outbound'?_0x925fe9[_0x4faa('0x25')]:_0x925fe9[_0x4faa('0x26')];var _0x368749={'method':_0x4faa('0xc'),'uri':_0x5206ca+'contacts','body':{'telephone1':_0x2817a2,'fullname':_0x2817a2,'firstname':_0x2817a2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x29d08d[_0x4faa('0x27')]+')'},'headers':{'Authorization':_0x4faa('0x1a')+_0x285914,'OData-Version':_0x4faa('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x368749);})['then'](function(_0x4397f0){var _0x398868=_0x4397f0[_0x4faa('0x29')][_0x4faa('0x2a')];var _0x428e30=_0x398868[_0x4faa('0x2b')](_0x398868['lastIndexOf']('(')+0x1,_0x398868[_0x4faa('0x2c')](')'));_0x29d08d['enduserId']=_0x428e30;_0x2e4306(_0x29d08d);})[_0x4faa('0x12')](function(_0x5edd1f){_0x11f216(_0x5edd1f[_0x4faa('0x16')]);});});}function getEndUser(_0xab2ebf,_0x233c14,_0x249a2d,_0x56913f,_0x228059,_0x3e72f0){return new BPromise(function(_0x34f062,_0x1fc4cf){return getAuthToken(_0x233c14,_0x249a2d,_0x3e72f0)[_0x4faa('0x17')](function(_0x140885){var _0x3efa1c={'method':_0x4faa('0x18'),'uri':_0x56913f+'contacts?$select=telephone1','headers':{'Authorization':_0x4faa('0x1a')+_0x140885,'If-None-Match':null,'OData-Version':_0x4faa('0x28')},'json':!![]};return rp(_0x3efa1c);})[_0x4faa('0x17')](function(_0x48caf6){var _0x2fd1de=null;if(_0x48caf6){var _0x2d95a2=_0x48caf6[_0x4faa('0x2d')];var _0x3d2ea4=![];for(_0x2fd1de=0x0;_0x2fd1de<_0x2d95a2[_0x4faa('0x1e')];_0x2fd1de++){var _0x3a2c6b=_0x3e72f0[_0x4faa('0x24')]()===_0x4faa('0x2e')?_0x228059[_0x4faa('0x25')]:_0x228059[_0x4faa('0x26')];if(_0x2d95a2[_0x2fd1de][_0x4faa('0x2f')]===_0x3a2c6b){_0x3d2ea4=!![];_0xab2ebf[_0x4faa('0x30')]=_0x2d95a2[_0x2fd1de][_0x4faa('0x31')];}}if(_0x3d2ea4){_0x34f062(_0xab2ebf);}else{return createEndUser(_0xab2ebf,_0x233c14,_0x249a2d,_0x56913f,_0x228059,_0x3e72f0)[_0x4faa('0x17')](function(_0x5b1afb){logger[_0x4faa('0x20')]('['+[_0x3e72f0['toUpperCase']()]+']\x20Enduser\x20created!',_0x5b1afb[_0x4faa('0x30')]);_0x34f062(_0x5b1afb);});}}else{return createEndUser(_0xab2ebf,_0x233c14,_0x249a2d,_0x56913f,_0x228059,_0x3e72f0)[_0x4faa('0x17')](function(_0x5e34ae){logger[_0x4faa('0x20')]('['+[_0x3e72f0[_0x4faa('0x14')]()]+_0x4faa('0x32'),_0x5e34ae[_0x4faa('0x30')]);_0x34f062(_0x5e34ae);});}});});}function getCustomFields(_0x3b6ce7,_0x5739b3,_0x366995){var _0x268abc={};if(_0x3b6ce7[_0x4faa('0x1e')]>0x0){_[_0x4faa('0x33')](_0x3b6ce7,function(_0x22a0a7){if(_0x22a0a7[_0x4faa('0x34')]===_0x4faa('0x35')&&_0x22a0a7['nameField']&&!_0x22a0a7[_0x4faa('0x36')]){var _0x2faa13=_0x22a0a7[_0x4faa('0x37')][_0x4faa('0x24')]();var _0x1f9f72=_0x2faa13[_0x4faa('0x2b')](0x0,_0x2faa13[_0x4faa('0x38')]('_'));var _0x715fd6=_0x2faa13[_0x4faa('0x2b')](_0x2faa13['indexOf']('_')+0x1);if(_0x1f9f72===_0x366995){_0x268abc[_0x715fd6]=_0x22a0a7[_0x4faa('0x39')];}}});}return _0x268abc;}function getTicket(_0x3f26b2,_0xe6985e,_0x2e0589,_0x240209,_0x4d8a65,_0x14a907,_0x2bcd05){return new BPromise(function(_0x784797,_0x5a3b31){var _0x5d54b9;return getAuthToken(_0xe6985e,_0x2e0589,_0x2bcd05)[_0x4faa('0x17')](function(_0x407deb){if(_0x14a907['ticketType']===_0x4faa('0x3a')){_0x5d54b9={'method':_0x4faa('0xc'),'uri':_0x240209+_0x4faa('0x3b'),'body':Object[_0x4faa('0x3c')]({},{'title':intUtil[_0x4faa('0x3d')](_0x14a907['Subjects'],_0x4d8a65,'\x20'),'description':intUtil['getString'](_0x14a907[_0x4faa('0x3e')],_0x4d8a65,'\x0a'),'customerid_contact@odata.bind':_0x4faa('0x3f')+_0x3f26b2['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x3f26b2[_0x4faa('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x14a907[_0x4faa('0x40')],_0x4d8a65,_0x14a907[_0x4faa('0x41')])),'headers':{'Authorization':_0x4faa('0x1a')+_0x407deb,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x14a907[_0x4faa('0x41')]===_0x4faa('0x42')){_0x5d54b9={'method':'POST','uri':_0x240209+_0x4faa('0x43'),'body':Object[_0x4faa('0x3c')]({},{'subject':intUtil[_0x4faa('0x3d')](_0x14a907[_0x4faa('0x44')],_0x4d8a65,'\x20'),'phonenumber':String(_0x4d8a65[_0x4faa('0x26')]),'description':intUtil[_0x4faa('0x3d')](_0x14a907[_0x4faa('0x3e')],_0x4d8a65,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4faa('0x3f')+_0x3f26b2['enduserId']+')','ownerid@odata.bind':_0x4faa('0x45')+_0x3f26b2[_0x4faa('0x27')]+')','directioncode':_0x3f26b2[_0x4faa('0x46')]===_0x4faa('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4faa('0x45')+_0x3f26b2[_0x4faa('0x27')]+')','participationtypemask':_0x3f26b2['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x4faa('0x3f')+_0x3f26b2[_0x4faa('0x30')]+')','participationtypemask':_0x3f26b2[_0x4faa('0x46')]===_0x4faa('0x47')?0x1:0x2}]},getCustomFields(_0x14a907[_0x4faa('0x40')],_0x4d8a65,_0x14a907['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x407deb,'OData-Version':_0x4faa('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5d54b9);})[_0x4faa('0x17')](function(_0x374fc6){var _0x4fa02b=_0x374fc6['headers']['odata-entityid'];var _0x3f45ba=_0x4fa02b[_0x4faa('0x2b')](_0x4fa02b['lastIndexOf']('(')+0x1,_0x4fa02b[_0x4faa('0x2c')](')'));_0x3f26b2[_0x4faa('0x48')]=_0x3f45ba;_0x784797(_0x3f26b2);})[_0x4faa('0x12')](function(_0x38a7f2){_0x5a3b31(_0x38a7f2[_0x4faa('0x16')]);});});}function emit(_0x2c5d3e,_0x3c1af9,_0x339147,_0x497122){var _0x5d18ab={'uri':util[_0x4faa('0x49')](_0x4faa('0x4a'),_0x2c5d3e,_0x339147,_0x497122)};io['to'](util[_0x4faa('0x49')]('user:%s',_0x3c1af9))[_0x4faa('0x4b')]('trigger:browser:url',_0x5d18ab);}exports['cs']=function(_0x5de44c,_0x58a6f0,_0x158efc,_0x307eb2,_0x5958c1,_0x30684c,_0x259a24,_0x21ab7a){var _0xc83207={};_0x30684c['remoteUri']=intUtil['stripTrailingSlash'](_0x30684c[_0x4faa('0xd')]);_0x30684c[_0x4faa('0x4c')]=intUtil[_0x4faa('0x4d')](_0x30684c[_0x4faa('0x4c')]);_0xc83207[_0x4faa('0x46')]=_0x21ab7a==='queue'||_0x21ab7a===_0x4faa('0x4e')?_0x4faa('0x47'):'outbound';var _0x3bfb7d=util[_0x4faa('0x49')]('%s/api/data/v9.0/',_0x30684c[_0x4faa('0xd')]);var _0x23089d=util[_0x4faa('0x49')](_0x4faa('0x4f'),_0x30684c[_0x4faa('0x50')]);var _0x5167d7=util[_0x4faa('0x49')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x30684c[_0x4faa('0x4c')],_0x58a6f0['uniqueid'],md5(_0x58a6f0[_0x4faa('0x51')]));if(_0x5958c1&&_0x5958c1[_0x4faa('0x52')]){logger[_0x4faa('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x58a6f0[_0x4faa('0x53')]=_0x5167d7;}else if(_0x259a24&&_0x259a24['recordingFormat']&&_0x259a24[_0x4faa('0x54')]!==_0x4faa('0x55')){logger[_0x4faa('0x20')](_0x4faa('0x56'),_0x4faa('0x57'));_0x58a6f0[_0x4faa('0x53')]=_0x5167d7;}else{_0x58a6f0[_0x4faa('0x53')]='';}return getUser(_0xc83207,_0x30684c,_0x307eb2,_0x23089d,_0x3bfb7d,_0x21ab7a)['then'](function(_0x439220){logger[_0x4faa('0x20')]('['+_0x21ab7a[_0x4faa('0x14')]()+_0x4faa('0x58'),_0x439220[_0x4faa('0x27')]);logger[_0x4faa('0x20')]('['+_0x21ab7a[_0x4faa('0x14')]()+_0x4faa('0x59'),_0x439220[_0x4faa('0x23')]);return getEndUser(_0x439220,_0x30684c,_0x23089d,_0x3bfb7d,_0x58a6f0,_0x21ab7a);})[_0x4faa('0x17')](function(_0x3e0acf){logger[_0x4faa('0x20')]('['+_0x21ab7a[_0x4faa('0x14')]()+_0x4faa('0x5a'),_0x3e0acf['enduserId']);logger['info']('['+_0x21ab7a[_0x4faa('0x14')]()+_0x4faa('0x5b'),_0x58a6f0['calleridnum']);return getTicket(_0x3e0acf,_0x30684c,_0x23089d,_0x3bfb7d,_0x58a6f0,_0x158efc,_0x21ab7a);})[_0x4faa('0x17')](function(_0x1ff57c){logger['info'](util['format']('['+_0x21ab7a[_0x4faa('0x14')]()+_0x4faa('0x5c'),_0x158efc[_0x4faa('0x41')],_0x1ff57c[_0x4faa('0x48')]));logger[_0x4faa('0x20')](util[_0x4faa('0x49')]('['+_0x21ab7a[_0x4faa('0x14')]()+_0x4faa('0x5d'),_0x21ab7a));if(_0x21ab7a!==_0x4faa('0x4e')){logger[_0x4faa('0x20')]('['+_0x21ab7a[_0x4faa('0x14')]()+']',_0x4faa('0x5e'));emit(_0x30684c[_0x4faa('0xd')],_0x307eb2['name'],_0x158efc[_0x4faa('0x41')],_0x1ff57c['ticketId']);}})['catch'](function(_0x22fdfc){logger[_0x4faa('0x13')]('['+_0x21ab7a[_0x4faa('0x14')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x4faa('0x5f')](_0x22fdfc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe12d=['ticketId',']\x20Call\x20direction:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','email','userEmail','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','info','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1','length','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','content','incident','incidents','assign','getString','Descriptions','/contacts(','/systemusers(','Fields','ticketType','phonecall','phonecalls','Subjects','callDirection','queue','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:'];(function(_0x1ca882,_0x14f6e6){var _0x357d7e=function(_0x41bb23){while(--_0x41bb23){_0x1ca882['push'](_0x1ca882['shift']());}};_0x357d7e(++_0x14f6e6);}(_0xe12d,0xc8));var _0xde12=function(_0x3062cd,_0x15687c){_0x3062cd=_0x3062cd-0x0;var _0x596e6e=_0xe12d[_0x3062cd];return _0x596e6e;};'use strict';var _=require(_0xde12('0x0'));var BPromise=require(_0xde12('0x1'));var rp=require(_0xde12('0x2'));var util=require(_0xde12('0x3'));var intUtil=require(_0xde12('0x4'));var md5=require(_0xde12('0x5'));var Redis=require(_0xde12('0x6'));var logger=require(_0xde12('0x7'))(_0xde12('0x8'));var config=require('../../../../config/environment');config['redis']=_[_0xde12('0x9')](config[_0xde12('0xa')],{'host':_0xde12('0xb'),'port':0x18eb});var io=require(_0xde12('0xc'))(new Redis(config[_0xde12('0xa')]));function getAuthToken(_0x3451e8,_0xf09790,_0x577d6d){var _0x1e60fc={'method':'POST','uri':_0xf09790,'form':{'client_id':_0x3451e8[_0xde12('0xd')],'resource':_0x3451e8[_0xde12('0xe')],'username':_0x3451e8[_0xde12('0xf')],'password':_0x3451e8[_0xde12('0x10')],'grant_type':_0xde12('0x10'),'client_secret':_0x3451e8[_0xde12('0x11')]},'json':!![]};return rp(_0x1e60fc)[_0xde12('0x12')](function(_0x48a2c6){return _0x48a2c6[_0xde12('0x13')];})[_0xde12('0x14')](function(_0x45c048){logger[_0xde12('0x15')]('['+[_0x577d6d[_0xde12('0x16')]()]+_0xde12('0x17'));return _0x45c048[_0xde12('0x18')];});}function getUser(_0x4a7cd3,_0x3f2393,_0x15b9cd,_0x1af8d0,_0x45505e,_0x4d12b6){return new BPromise(function(_0xb21ed8,_0x713f9f){return getAuthToken(_0x3f2393,_0x1af8d0,_0x4d12b6)[_0xde12('0x12')](function(_0x1b5a17){var _0x31516b={'method':_0xde12('0x19'),'uri':_0x45505e+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xde12('0x1a')+_0x1b5a17,'OData-Version':_0xde12('0x1b')},'json':!![]};return rp(_0x31516b);})[_0xde12('0x12')](function(_0x4da295){var _0x339d59=_0x4da295[_0xde12('0x1c')];var _0x33a193=![];var _0x578adf=null;if(!_[_0xde12('0x1d')](_0x15b9cd)){if(intUtil['validateEmail'](_0x15b9cd[_0xde12('0x1e')])){_0x4a7cd3[_0xde12('0x1f')]=_0x15b9cd['email'];for(_0x578adf=0x0;_0x578adf<_0x339d59['length'];_0x578adf++){if(_0x339d59[_0x578adf][_0xde12('0x20')]===_0x15b9cd[_0xde12('0x1e')]&&!_0x339d59[_0x578adf]['isdisabled']){_0x33a193=!![];logger['info']('['+[_0x4d12b6['toUpperCase']()]+_0xde12('0x21')+_0x339d59[_0x578adf][_0xde12('0x22')]+'!');_0x4a7cd3[_0xde12('0x23')]=_0x339d59[_0x578adf][_0xde12('0x22')];}}}}if(!_0x33a193){logger[_0xde12('0x24')]('['+[_0x4d12b6[_0xde12('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4a7cd3[_0xde12('0x1f')]=_0x3f2393[_0xde12('0xf')];for(_0x578adf=0x0;_0x578adf<_0x339d59['length'];_0x578adf++){if(_0x339d59[_0x578adf][_0xde12('0x20')]===_0x3f2393[_0xde12('0xf')]){_0x4a7cd3[_0xde12('0x23')]=_0x339d59[_0x578adf][_0xde12('0x22')];}}}_0xb21ed8(_0x4a7cd3);})['catch'](function(_0x3d62c3){_0x713f9f(_0x3d62c3[_0xde12('0x18')]);});});}function createEndUser(_0x25ae94,_0x16483d,_0x2a96c2,_0x5161e3,_0x5d6486,_0x3df65b){return new BPromise(function(_0x21ca1d,_0x2c5626){return getAuthToken(_0x16483d,_0x2a96c2,_0x3df65b)[_0xde12('0x12')](function(_0x3d124){var _0x5237d3=_0x3df65b[_0xde12('0x25')]()===_0xde12('0x26')?_0x5d6486[_0xde12('0x27')]:_0x5d6486[_0xde12('0x28')];var _0x12888a={'method':_0xde12('0x29'),'uri':_0x5161e3+_0xde12('0x2a'),'body':{'telephone1':_0x5237d3,'fullname':_0x5237d3,'firstname':_0x5237d3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x25ae94[_0xde12('0x23')]+')'},'headers':{'Authorization':_0xde12('0x1a')+_0x3d124,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x12888a);})['then'](function(_0x18d9bd){var _0x48f1fe=_0x18d9bd['headers'][_0xde12('0x2b')];var _0x31aaa6=_0x48f1fe['substring'](_0x48f1fe[_0xde12('0x2c')]('(')+0x1,_0x48f1fe['lastIndexOf'](')'));_0x25ae94[_0xde12('0x2d')]=_0x31aaa6;_0x21ca1d(_0x25ae94);})[_0xde12('0x14')](function(_0x2fa4b2){_0x2c5626(_0x2fa4b2[_0xde12('0x18')]);});});}function getEndUser(_0x58ccd1,_0x4d79e9,_0x5f1896,_0x23981c,_0x809105,_0x35fc0d){return new BPromise(function(_0x22bf1a,_0x4de665){return getAuthToken(_0x4d79e9,_0x5f1896,_0x35fc0d)[_0xde12('0x12')](function(_0x436063){var _0x1d5a31={'method':_0xde12('0x19'),'uri':_0x23981c+_0xde12('0x2e'),'headers':{'Authorization':'Bearer\x20'+_0x436063,'If-None-Match':null,'OData-Version':_0xde12('0x1b')},'json':!![]};return rp(_0x1d5a31);})['then'](function(_0x4286c8){var _0x436111=null;if(_0x4286c8){var _0x303d75=_0x4286c8[_0xde12('0x1c')];var _0x2de394=![];for(_0x436111=0x0;_0x436111<_0x303d75[_0xde12('0x2f')];_0x436111++){var _0x123c36=_0x35fc0d['toLowerCase']()===_0xde12('0x26')?_0x809105['destcalleridnum']:_0x809105[_0xde12('0x28')];if(_0x303d75[_0x436111][_0xde12('0x30')]===_0x123c36){_0x2de394=!![];_0x58ccd1[_0xde12('0x2d')]=_0x303d75[_0x436111][_0xde12('0x31')];}}if(_0x2de394){_0x22bf1a(_0x58ccd1);}else{return createEndUser(_0x58ccd1,_0x4d79e9,_0x5f1896,_0x23981c,_0x809105,_0x35fc0d)['then'](function(_0x2f88da){logger['info']('['+[_0x35fc0d[_0xde12('0x16')]()]+_0xde12('0x32'),_0x2f88da[_0xde12('0x2d')]);_0x22bf1a(_0x2f88da);});}}else{return createEndUser(_0x58ccd1,_0x4d79e9,_0x5f1896,_0x23981c,_0x809105,_0x35fc0d)[_0xde12('0x12')](function(_0x338c46){logger[_0xde12('0x24')]('['+[_0x35fc0d['toUpperCase']()]+_0xde12('0x33'),_0x338c46[_0xde12('0x2d')]);_0x22bf1a(_0x338c46);});}});});}function getCustomFields(_0x58d8f2,_0x21c26f,_0x356ea3){var _0x5914e8={};if(_0x58d8f2['length']>0x0){_[_0xde12('0x34')](_0x58d8f2,function(_0x329b61){if(_0x329b61[_0xde12('0x35')]===_0xde12('0x36')&&_0x329b61[_0xde12('0x37')]&&!_0x329b61[_0xde12('0x38')]){var _0x4d6346=_0x329b61[_0xde12('0x39')][_0xde12('0x25')]();var _0x4ec392=_0x4d6346['substring'](0x0,_0x4d6346[_0xde12('0x3a')]('_'));var _0x528069=_0x4d6346['substring'](_0x4d6346[_0xde12('0x3a')]('_')+0x1);if(_0x4ec392===_0x356ea3){_0x5914e8[_0x528069]=_0x329b61[_0xde12('0x3b')];}}});}return _0x5914e8;}function getTicket(_0x4aedae,_0x38844c,_0x4ba8eb,_0x37b560,_0x3016e3,_0x2ed277,_0x46db74){return new BPromise(function(_0x2474f9,_0x5c06b7){var _0x33c077;return getAuthToken(_0x38844c,_0x4ba8eb,_0x46db74)[_0xde12('0x12')](function(_0x190ff0){if(_0x2ed277['ticketType']===_0xde12('0x3c')){_0x33c077={'method':_0xde12('0x29'),'uri':_0x37b560+_0xde12('0x3d'),'body':Object[_0xde12('0x3e')]({},{'title':intUtil[_0xde12('0x3f')](_0x2ed277['Subjects'],_0x3016e3,'\x20'),'description':intUtil[_0xde12('0x3f')](_0x2ed277[_0xde12('0x40')],_0x3016e3,'\x0a'),'customerid_contact@odata.bind':_0xde12('0x41')+_0x4aedae[_0xde12('0x2d')]+')','ownerid@odata.bind':_0xde12('0x42')+_0x4aedae['userId']+')','caseorigincode':'1'},getCustomFields(_0x2ed277[_0xde12('0x43')],_0x3016e3,_0x2ed277[_0xde12('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x190ff0,'OData-Version':_0xde12('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2ed277[_0xde12('0x44')]===_0xde12('0x45')){_0x33c077={'method':_0xde12('0x29'),'uri':_0x37b560+_0xde12('0x46'),'body':Object[_0xde12('0x3e')]({},{'subject':intUtil['getString'](_0x2ed277[_0xde12('0x47')],_0x3016e3,'\x20'),'phonenumber':String(_0x3016e3['calleridnum']),'description':intUtil['getString'](_0x2ed277[_0xde12('0x40')],_0x3016e3,'\x0a'),'regardingobjectid_contact@odata.bind':_0xde12('0x41')+_0x4aedae[_0xde12('0x2d')]+')','ownerid@odata.bind':_0xde12('0x42')+_0x4aedae[_0xde12('0x23')]+')','directioncode':_0x4aedae[_0xde12('0x48')]===_0xde12('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xde12('0x42')+_0x4aedae[_0xde12('0x23')]+')','participationtypemask':_0x4aedae[_0xde12('0x48')]===_0xde12('0x49')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x4aedae['enduserId']+')','participationtypemask':_0x4aedae['callDirection']===_0xde12('0x49')?0x1:0x2}]},getCustomFields(_0x2ed277['Fields'],_0x3016e3,_0x2ed277['ticketType'])),'headers':{'Authorization':_0xde12('0x1a')+_0x190ff0,'OData-Version':_0xde12('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x33c077);})[_0xde12('0x12')](function(_0x5e5fd1){var _0x1b738d=_0x5e5fd1[_0xde12('0x4a')][_0xde12('0x2b')];var _0x2105de=_0x1b738d['substring'](_0x1b738d[_0xde12('0x2c')]('(')+0x1,_0x1b738d['lastIndexOf'](')'));_0x4aedae['ticketId']=_0x2105de;_0x2474f9(_0x4aedae);})[_0xde12('0x14')](function(_0x355130){_0x5c06b7(_0x355130['message']);});});}function emit(_0xb25cc5,_0x3db9f8,_0x15cdac,_0x1fc4f2){var _0x39417e={'uri':util[_0xde12('0x4b')](_0xde12('0x4c'),_0xb25cc5,_0x15cdac,_0x1fc4f2)};io['to'](util[_0xde12('0x4b')](_0xde12('0x4d'),_0x3db9f8))[_0xde12('0x4e')](_0xde12('0x4f'),_0x39417e);}exports['cs']=function(_0x37b72c,_0x3e935c,_0x2593aa,_0xe7f7bd,_0x32ecd3,_0x1029d3,_0x14e9c7,_0x28edb4){var _0x2fac20={};_0x1029d3[_0xde12('0xe')]=intUtil[_0xde12('0x50')](_0x1029d3['remoteUri']);_0x1029d3[_0xde12('0x51')]=intUtil[_0xde12('0x50')](_0x1029d3['serverUrl']);_0x2fac20[_0xde12('0x48')]=_0x28edb4==='queue'||_0x28edb4===_0xde12('0x52')?_0xde12('0x49'):'outbound';var _0xfcd539=util['format']('%s/api/data/v9.0/',_0x1029d3[_0xde12('0xe')]);var _0x28e151=util[_0xde12('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1029d3[_0xde12('0x53')]);var _0x108cf2=util[_0xde12('0x4b')](_0xde12('0x54'),_0x1029d3[_0xde12('0x51')],_0x3e935c[_0xde12('0x55')],md5(_0x3e935c[_0xde12('0x55')]));if(_0x32ecd3&&_0x32ecd3['monitor_format']){logger[_0xde12('0x24')](_0xde12('0x56'),_0xde12('0x57'));_0x3e935c[_0xde12('0x58')]=_0x108cf2;}else if(_0x14e9c7&&_0x14e9c7['recordingFormat']&&_0x14e9c7[_0xde12('0x59')]!==_0xde12('0x5a')){logger['info'](_0xde12('0x5b'),'Recording\x20is\x20enabled!');_0x3e935c[_0xde12('0x58')]=_0x108cf2;}else{_0x3e935c[_0xde12('0x58')]='';}return getUser(_0x2fac20,_0x1029d3,_0xe7f7bd,_0x28e151,_0xfcd539,_0x28edb4)[_0xde12('0x12')](function(_0x5e224f){logger[_0xde12('0x24')]('['+_0x28edb4[_0xde12('0x16')]()+']\x20The\x20User\x20ID\x20is:',_0x5e224f['userId']);logger[_0xde12('0x24')]('['+_0x28edb4['toUpperCase']()+_0xde12('0x5c'),_0x5e224f[_0xde12('0x1f')]);return getEndUser(_0x5e224f,_0x1029d3,_0x28e151,_0xfcd539,_0x3e935c,_0x28edb4);})[_0xde12('0x12')](function(_0x4c127c){logger[_0xde12('0x24')]('['+_0x28edb4[_0xde12('0x16')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x4c127c['enduserId']);logger['info']('['+_0x28edb4[_0xde12('0x16')]()+_0xde12('0x5d'),_0x3e935c['calleridnum']);return getTicket(_0x4c127c,_0x1029d3,_0x28e151,_0xfcd539,_0x3e935c,_0x2593aa,_0x28edb4);})['then'](function(_0x361663){logger[_0xde12('0x24')](util[_0xde12('0x4b')]('['+_0x28edb4['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2593aa[_0xde12('0x44')],_0x361663[_0xde12('0x5e')]));logger[_0xde12('0x24')](util[_0xde12('0x4b')]('['+_0x28edb4[_0xde12('0x16')]()+_0xde12('0x5f'),_0x28edb4));if(_0x28edb4!==_0xde12('0x52')){logger[_0xde12('0x24')]('['+_0x28edb4[_0xde12('0x16')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1029d3[_0xde12('0xe')],_0xe7f7bd['name'],_0x2593aa[_0xde12('0x44')],_0x361663['ticketId']);}})[_0xde12('0x14')](function(_0x598a69){logger['error']('['+_0x28edb4[_0xde12('0x16')]()+_0xde12('0x60'),util[_0xde12('0x61')](_0x598a69,{'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 e21c8b8..b6640a9 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 _0x72aa=['info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','string','nameField','customField','toLowerCase','content','type','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','user:%s','abandoned','[ABANDONED]','The\x20Enduser\x20ID\x20is:','catch','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x72aa,0x117));var _0xa72a=function(_0x4a7af6,_0x5d85c3){_0x4a7af6=_0x4a7af6-0x0;var _0x592e92=_0x72aa[_0x4a7af6];return _0x592e92;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xa72a('0x0'));var util=require('util');var Redis=require(_0xa72a('0x1'));var intUtil=require(_0xa72a('0x2'));var config=require(_0xa72a('0x3'));var logger=require(_0xa72a('0x4'))(_0xa72a('0x5'));config[_0xa72a('0x6')]=_[_0xa72a('0x7')](config[_0xa72a('0x6')],{'host':_0xa72a('0x8'),'port':0x18eb});var io=require(_0xa72a('0x9'))(new Redis(config[_0xa72a('0x6')]));var headers={'Content-Type':_0xa72a('0xa'),'Accept':_0xa72a('0xa')};function emit(_0x159b7e,_0x585700,_0x5895ac){io['to'](_0x159b7e)[_0xa72a('0xb')](_0x585700,_0x5895ac);}function getTicket(_0x23cf24,_0x3f3cf9,_0x38fe33,_0x42216a,_0x372615){logger[_0xa72a('0xc')](_0xa72a('0xd'));var _0x23e8c7=_[_0xa72a('0xe')]({'responder_id':_0x3f3cf9['id'],'requester_id':_0x38fe33['id'],'name':util['format'](_0xa72a('0xf'),_0x372615['calleridname']),'phone':_0x372615[_0xa72a('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa72a('0x11')](_0x42216a[_0xa72a('0x12')],_0x372615,'\x20'),'description':intUtil[_0xa72a('0x11')](_0x42216a[_0xa72a('0x13')],_0x372615,_0xa72a('0x14')),'tags':getTags(_0x42216a[_0xa72a('0x15')],_0xa72a('0x16'))},getCustomFields(_0x42216a[_0xa72a('0x17')],_0x372615));_0x23e8c7[_0xa72a('0x18')]=_[_0xa72a('0x19')](_[_0xa72a('0x1a')](_0x23e8c7[_0xa72a('0x18')],'id'),_0xa72a('0x1b'));return request({'uri':util[_0xa72a('0x1c')](_0xa72a('0x1d'),_0x23cf24[_0xa72a('0x1e')]),'method':'POST','body':_0x23e8c7})[_0xa72a('0x1f')](function(_0x3c4d12){logger['info'](_0xa72a('0x20'));return _0x3c4d12;});}function getUser(_0x324d85,_0xa495ae){if(intUtil[_0xa72a('0x21')](_0xa495ae)){return request({'uri':util[_0xa72a('0x1c')]('%s/api/v2/agents',_0x324d85[_0xa72a('0x1e')]),'qs':{'email':_0xa495ae}})['then'](function(_0x31e3c4){if(_0x31e3c4[_0xa72a('0x22')]){logger[_0xa72a('0xc')](_0xa72a('0x23'));return _[_0xa72a('0x24')](_0x31e3c4,function(_0x4c163e){return _0x4c163e[_0xa72a('0x25')]['email']===_0xa495ae;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xa72a('0x26'),_0x324d85['remoteUri'])})[_0xa72a('0x1f')](function(_0x5ae3e0){logger[_0xa72a('0xc')]('Admin\x20account\x20selected.');return _0x5ae3e0;});}});}else{logger[_0xa72a('0xc')](_0xa72a('0x27'));return request({'uri':util[_0xa72a('0x1c')]('%s/api/v2/agents/me',_0x324d85['remoteUri'])})['then'](function(_0x574c83){logger[_0xa72a('0xc')](_0xa72a('0x28'));return _0x574c83;});}}function getEndUser(_0x307a33,_0x284363,_0x268426){logger[_0xa72a('0xc')]('Searching\x20enduser\x20with\x20phone',_0x268426);return request({'uri':util[_0xa72a('0x1c')](_0xa72a('0x29'),_0x307a33['remoteUri']),'qs':{'phone':_0x268426}})[_0xa72a('0x1f')](function(_0x2bd480){if(_0x2bd480['length']){logger[_0xa72a('0xc')](_0xa72a('0x2a'));return _['find'](_0x2bd480,{'phone':_0x268426});}else{logger[_0xa72a('0xc')](_0xa72a('0x2b'));return request({'uri':util[_0xa72a('0x1c')](_0xa72a('0x29'),_0x307a33[_0xa72a('0x1e')]),'method':_0xa72a('0x2c'),'body':{'name':_0x284363,'phone':_0x268426}})[_0xa72a('0x1f')](function(_0x4ecfe0){logger['info'](_0xa72a('0x2d'));return _0x4ecfe0;});}});}function getAuth(_0x433c83){return util[_0xa72a('0x1c')](_0xa72a('0x2e'),new Buffer(_0x433c83[_0xa72a('0x2f')]+':X')[_0xa72a('0x30')](_0xa72a('0x31')));}function request(_0x5beb99){logger[_0xa72a('0x32')](_0xa72a('0x33'),JSON[_0xa72a('0x34')](_0x5beb99));return rp(_['defaults'](_0x5beb99,{'method':_0xa72a('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x3394de,_0x504efc){var _0x10f000=[];if(_0x3394de&&_0x3394de['length']>0x0){_0x10f000=_[_0xa72a('0x36')](_0x3394de,_0x504efc);}return _0x10f000;}function getCustomFields(_0x2ee968,_0x55a969){var _0x51ecdf=[];var _0x1fb99a={'custom_fields':[]};if(_0x2ee968[_0xa72a('0x22')]>0x0){_[_0xa72a('0x37')](_0x2ee968,function(_0x21f172){if(_0x21f172['type']===_0xa72a('0x38')&&_0x21f172[_0xa72a('0x39')]&&!_0x21f172[_0xa72a('0x3a')]){_0x1fb99a[_0x21f172['nameField'][_0xa72a('0x3b')]()]=_0x21f172[_0xa72a('0x3c')][_0xa72a('0x30')]();}else if(_0x21f172[_0xa72a('0x3d')]===_0xa72a('0x38')&&_0x21f172['idField']&&_0x21f172['customField']){_0x1fb99a[_0xa72a('0x18')][_0xa72a('0x3e')]({'id':_0x21f172[_0xa72a('0x3f')],'value':_0x21f172[_0xa72a('0x3c')][_0xa72a('0x30')]()});}else if(_0x21f172[_0xa72a('0x3d')]===_0xa72a('0x40')&&_0x21f172[_0xa72a('0x41')]&&_0x21f172[_0xa72a('0x3f')]&&_0x21f172[_0xa72a('0x3a')]){_0x55a969[_0x21f172['variableName']]&&_0x1fb99a[_0xa72a('0x18')][_0xa72a('0x3e')]({'id':_0x21f172[_0xa72a('0x3f')],'value':_0x55a969[_0x21f172['variableName']][_0xa72a('0x30')]()});}else if(_0x21f172[_0xa72a('0x3d')]===_0xa72a('0x42')&&_0x21f172[_0xa72a('0x43')]&&_0x21f172[_0xa72a('0x43')][_0xa72a('0x16')]&&_0x21f172[_0xa72a('0x3f')]&&_0x21f172[_0xa72a('0x3a')]){_0x55a969[_0x21f172[_0xa72a('0x43')][_0xa72a('0x16')][_0xa72a('0x3b')]()]&&_0x1fb99a['custom_fields'][_0xa72a('0x3e')]({'id':_0x21f172[_0xa72a('0x3f')],'value':_0x55a969[_0x21f172['Variable'][_0xa72a('0x16')][_0xa72a('0x3b')]()]['toString']()});}});}return _0x1fb99a;}exports[_0xa72a('0x44')]=function(_0x4bb88d,_0x3db739,_0x1a455f,_0xd026f8,_0x501555,_0x41e824){var _0x5e2596,_0x59fb09;_0x41e824[_0xa72a('0x1e')]=intUtil[_0xa72a('0x45')](_0x41e824[_0xa72a('0x1e')]);_0x41e824[_0xa72a('0x46')]=intUtil['stripTrailingSlash'](_0x41e824[_0xa72a('0x46')]);if(_0x501555&&_0x501555[_0xa72a('0x47')]){logger['info'](_0xa72a('0x48'),_0xa72a('0x49'));_0x3db739[_0xa72a('0x4a')]=util[_0xa72a('0x1c')](_0xa72a('0x4b'),_0x41e824[_0xa72a('0x46')],_0x3db739[_0xa72a('0x4c')],md5(_0x3db739['uniqueid']));}else{_0x3db739[_0xa72a('0x4a')]='';}headers[_0xa72a('0x4d')]=getAuth(_0x41e824);return getUser(_0x41e824,_0xd026f8['email'])[_0xa72a('0x1f')](function(_0x3ffdf6){_0x5e2596=_0x3ffdf6;logger[_0xa72a('0xc')](_0xa72a('0x4e'),_0x5e2596['id']);return getEndUser(_0x41e824,_0x3db739[_0xa72a('0x4f')],_0x3db739[_0xa72a('0x10')]);})[_0xa72a('0x1f')](function(_0x4755d9){_0x59fb09=_0x4755d9;logger[_0xa72a('0xc')]('The\x20Enduser\x20ID\x20is:',_0x59fb09['id']);return getTicket(_0x41e824,_0x5e2596,_0x59fb09,_0x1a455f,_0x3db739);})['then'](function(_0x15f1ff){if(_0x15f1ff&&_0x15f1ff['id']){logger[_0xa72a('0xc')](_0xa72a('0x20'));logger[_0xa72a('0xc')](_0xa72a('0x50'),_0x15f1ff['id']);logger['info']('[QUEUE]',_0xa72a('0x51'));emit(util[_0xa72a('0x1c')]('user:%s',_0xd026f8['name']),_0xa72a('0x52'),{'uri':util[_0xa72a('0x1c')](_0xa72a('0x53'),_0x41e824[_0xa72a('0x1e')],_0x15f1ff['id'])});}})['catch'](function(_0x51bd79){logger[_0xa72a('0x54')]('[QUEUE]',JSON[_0xa72a('0x34')](_0x51bd79));});};exports[_0xa72a('0x55')]=function(_0x5cc6e0,_0x5b86dd,_0xefef6b,_0x8a0155,_0x89c891,_0x48e87b,_0x344afd){var _0x1b96d6,_0x240402;_0x48e87b['remoteUri']=intUtil[_0xa72a('0x45')](_0x48e87b[_0xa72a('0x1e')]);_0x48e87b['serverUrl']=intUtil[_0xa72a('0x45')](_0x48e87b['serverUrl']);if(_0x344afd&&_0x344afd['recordingFormat']&&_0x344afd[_0xa72a('0x56')]!==_0xa72a('0x57')){logger[_0xa72a('0xc')](_0xa72a('0x58'),_0xa72a('0x49'));_0x5b86dd[_0xa72a('0x4a')]=util[_0xa72a('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x48e87b[_0xa72a('0x46')],_0x5b86dd[_0xa72a('0x4c')],md5(_0x5b86dd[_0xa72a('0x4c')]));}headers[_0xa72a('0x4d')]=getAuth(_0x48e87b);return getUser(_0x48e87b,_0x8a0155[_0xa72a('0x59')])[_0xa72a('0x1f')](function(_0x50959c){_0x1b96d6=_0x50959c;logger[_0xa72a('0xc')](_0xa72a('0x4e'),_0x1b96d6['id']);return getEndUser(_0x48e87b,_0x5b86dd[_0xa72a('0x5a')],_0x5b86dd[_0xa72a('0x5b')]);})[_0xa72a('0x1f')](function(_0x140c22){_0x240402=_0x140c22;logger[_0xa72a('0xc')]('The\x20Enduser\x20ID\x20is:',_0x240402['id']);return getTicket(_0x48e87b,_0x1b96d6,_0x240402,_0xefef6b,_0x5b86dd);})['then'](function(_0x2a23ec){if(_0x2a23ec&&_0x2a23ec['id']){logger[_0xa72a('0xc')](_0xa72a('0x20'));logger[_0xa72a('0xc')](_0xa72a('0x50'),_0x2a23ec['id']);logger[_0xa72a('0xc')](_0xa72a('0x58'),_0xa72a('0x51'));emit(util['format'](_0xa72a('0x5c'),_0x8a0155[_0xa72a('0x16')]),_0xa72a('0x52'),{'uri':util[_0xa72a('0x1c')]('%s/helpdesk/tickets/%d',_0x48e87b[_0xa72a('0x1e')],_0x2a23ec['id'])});}})['catch'](function(_0x334ebc){logger['error'](_0xa72a('0x58'),JSON[_0xa72a('0x34')](_0x334ebc));});};exports[_0xa72a('0x5d')]=function(_0x1418fd,_0x291e92,_0x19f1e0,_0x14fe51,_0x3771d5,_0x378eaf){var _0xaa88ed,_0xa16083;_0x378eaf['remoteUri']=intUtil['stripTrailingSlash'](_0x378eaf[_0xa72a('0x1e')]);_0x378eaf[_0xa72a('0x46')]=intUtil[_0xa72a('0x45')](_0x378eaf[_0xa72a('0x46')]);if(_0x3771d5&&_0x3771d5[_0xa72a('0x47')]){logger[_0xa72a('0xc')](_0xa72a('0x5e'),_0xa72a('0x49'));_0x291e92[_0xa72a('0x4a')]=util[_0xa72a('0x1c')](_0xa72a('0x4b'),_0x378eaf[_0xa72a('0x46')],_0x291e92[_0xa72a('0x4c')],md5(_0x291e92[_0xa72a('0x4c')]));}else{_0x291e92[_0xa72a('0x4a')]='';}headers[_0xa72a('0x4d')]=getAuth(_0x378eaf);return getUser(_0x378eaf,'')['then'](function(_0x12025a){_0xaa88ed=_0x12025a;logger[_0xa72a('0xc')]('The\x20User\x20ID\x20is:',_0xaa88ed['id']);return getEndUser(_0x378eaf,_0x291e92['calleridname'],_0x291e92[_0xa72a('0x10')]);})[_0xa72a('0x1f')](function(_0x792af6){_0xa16083=_0x792af6;logger['info'](_0xa72a('0x5f'),_0xa16083['id']);return getTicket(_0x378eaf,_0xaa88ed,_0xa16083,_0x19f1e0,_0x291e92);})[_0xa72a('0x1f')](function(_0x3f815c){if(_0x3f815c){logger[_0xa72a('0xc')](_0xa72a('0x20'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3f815c['id']);}})[_0xa72a('0x60')](function(_0x557fa3){logger[_0xa72a('0x54')](_0xa72a('0x5e'),JSON[_0xa72a('0x34')](_0x557fa3));});}; \ No newline at end of file +var _0x8016=['freshdesk','redis','defaults','localhost','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','name','Fields','custom_fields','mapValues','value','POST','then','Ticket\x20created!','remoteUri','length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20created.','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','content','toString','idField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','abandoned','monitor_format','[ABANDONED]','./util','../../../../config/logger'];(function(_0x2c6fb9,_0xc7d7c0){var _0x49fd5e=function(_0x3dcbaf){while(--_0x3dcbaf){_0x2c6fb9['push'](_0x2c6fb9['shift']());}};_0x49fd5e(++_0xc7d7c0);}(_0x8016,0x9e));var _0x6801=function(_0x2e1058,_0x535e8c){_0x2e1058=_0x2e1058-0x0;var _0x3b9d5b=_0x8016[_0x2e1058];return _0x3b9d5b;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x6801('0x0'));var config=require('../../../../config/environment');var logger=require(_0x6801('0x1'))(_0x6801('0x2'));config[_0x6801('0x3')]=_[_0x6801('0x4')](config[_0x6801('0x3')],{'host':_0x6801('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6801('0x3')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0xb12ac2,_0x1efc0b,_0x543349){io['to'](_0xb12ac2)[_0x6801('0x6')](_0x1efc0b,_0x543349);}function getTicket(_0x29ea6b,_0x4b7c0a,_0x536dea,_0xa8aa50,_0x37babb){logger[_0x6801('0x7')](_0x6801('0x8'));var _0x15d872=_['merge']({'responder_id':_0x4b7c0a['id'],'requester_id':_0x536dea['id'],'name':util[_0x6801('0x9')](_0x6801('0xa'),_0x37babb[_0x6801('0xb')]),'phone':_0x37babb[_0x6801('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6801('0xd')](_0xa8aa50[_0x6801('0xe')],_0x37babb,'\x20'),'description':intUtil[_0x6801('0xd')](_0xa8aa50[_0x6801('0xf')],_0x37babb,'
'),'tags':getTags(_0xa8aa50['Tags'],_0x6801('0x10'))},getCustomFields(_0xa8aa50[_0x6801('0x11')],_0x37babb));_0x15d872[_0x6801('0x12')]=_[_0x6801('0x13')](_['keyBy'](_0x15d872[_0x6801('0x12')],'id'),_0x6801('0x14'));return request({'uri':util['format']('%s/api/v2/tickets',_0x29ea6b['remoteUri']),'method':_0x6801('0x15'),'body':_0x15d872})[_0x6801('0x16')](function(_0x521b75){logger[_0x6801('0x7')](_0x6801('0x17'));return _0x521b75;});}function getUser(_0x55d387,_0x1b3bd3){if(intUtil['validateEmail'](_0x1b3bd3)){return request({'uri':util['format']('%s/api/v2/agents',_0x55d387[_0x6801('0x18')]),'qs':{'email':_0x1b3bd3}})[_0x6801('0x16')](function(_0x5f0f94){if(_0x5f0f94[_0x6801('0x19')]){logger[_0x6801('0x7')]('Agent\x20found!');return _['find'](_0x5f0f94,function(_0x21e4fb){return _0x21e4fb[_0x6801('0x1a')][_0x6801('0x1b')]===_0x1b3bd3;});}else{logger[_0x6801('0x7')](_0x6801('0x1c'));return request({'uri':util[_0x6801('0x9')](_0x6801('0x1d'),_0x55d387[_0x6801('0x18')])})[_0x6801('0x16')](function(_0x38292a){logger[_0x6801('0x7')](_0x6801('0x1e'));return _0x38292a;});}});}else{logger[_0x6801('0x7')](_0x6801('0x1f'));return request({'uri':util[_0x6801('0x9')]('%s/api/v2/agents/me',_0x55d387[_0x6801('0x18')])})['then'](function(_0x5bec07){logger[_0x6801('0x7')](_0x6801('0x1e'));return _0x5bec07;});}}function getEndUser(_0x4c85d1,_0x5eb188,_0x554980){logger[_0x6801('0x7')](_0x6801('0x20'),_0x554980);return request({'uri':util[_0x6801('0x9')](_0x6801('0x21'),_0x4c85d1[_0x6801('0x18')]),'qs':{'phone':_0x554980}})[_0x6801('0x16')](function(_0x323a54){if(_0x323a54[_0x6801('0x19')]){logger[_0x6801('0x7')](_0x6801('0x22'));return _[_0x6801('0x23')](_0x323a54,{'phone':_0x554980});}else{logger[_0x6801('0x7')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/api/v2/contacts',_0x4c85d1[_0x6801('0x18')]),'method':_0x6801('0x15'),'body':{'name':_0x5eb188,'phone':_0x554980}})['then'](function(_0x34b04b){logger[_0x6801('0x7')](_0x6801('0x24'));return _0x34b04b;});}});}function getAuth(_0x5129ab){return util[_0x6801('0x9')]('Basic\x20%s',new Buffer(_0x5129ab['apiKey']+':X')['toString']('base64'));}function request(_0x40470c){logger['debug'](_0x6801('0x25'),JSON[_0x6801('0x26')](_0x40470c));return rp(_['defaults'](_0x40470c,{'method':_0x6801('0x27'),'headers':headers,'json':!![]}));}function getTags(_0x24010f,_0x12d72a){var _0x5cdc11=[];if(_0x24010f&&_0x24010f[_0x6801('0x19')]>0x0){_0x5cdc11=_[_0x6801('0x28')](_0x24010f,_0x12d72a);}return _0x5cdc11;}function getCustomFields(_0x3bdd92,_0x24d1ec){var _0x508109=[];var _0x1b6a11={'custom_fields':[]};if(_0x3bdd92[_0x6801('0x19')]>0x0){_[_0x6801('0x29')](_0x3bdd92,function(_0xb60623){if(_0xb60623[_0x6801('0x2a')]===_0x6801('0x2b')&&_0xb60623[_0x6801('0x2c')]&&!_0xb60623[_0x6801('0x2d')]){_0x1b6a11[_0xb60623[_0x6801('0x2c')]['toLowerCase']()]=_0xb60623[_0x6801('0x2e')][_0x6801('0x2f')]();}else if(_0xb60623[_0x6801('0x2a')]==='string'&&_0xb60623[_0x6801('0x30')]&&_0xb60623[_0x6801('0x2d')]){_0x1b6a11[_0x6801('0x12')][_0x6801('0x31')]({'id':_0xb60623[_0x6801('0x30')],'value':_0xb60623['content']['toString']()});}else if(_0xb60623[_0x6801('0x2a')]===_0x6801('0x32')&&_0xb60623[_0x6801('0x33')]&&_0xb60623['idField']&&_0xb60623[_0x6801('0x2d')]){_0x24d1ec[_0xb60623['variableName']]&&_0x1b6a11['custom_fields']['push']({'id':_0xb60623[_0x6801('0x30')],'value':_0x24d1ec[_0xb60623[_0x6801('0x33')]]['toString']()});}else if(_0xb60623[_0x6801('0x2a')]===_0x6801('0x34')&&_0xb60623[_0x6801('0x35')]&&_0xb60623[_0x6801('0x35')]['name']&&_0xb60623[_0x6801('0x30')]&&_0xb60623[_0x6801('0x2d')]){_0x24d1ec[_0xb60623[_0x6801('0x35')]['name'][_0x6801('0x36')]()]&&_0x1b6a11[_0x6801('0x12')]['push']({'id':_0xb60623[_0x6801('0x30')],'value':_0x24d1ec[_0xb60623['Variable'][_0x6801('0x10')][_0x6801('0x36')]()][_0x6801('0x2f')]()});}});}return _0x1b6a11;}exports[_0x6801('0x37')]=function(_0x1fd195,_0x22c622,_0x31100d,_0x1f770e,_0x135031,_0x53e3a6){var _0x40c9a5,_0x388333;_0x53e3a6[_0x6801('0x18')]=intUtil[_0x6801('0x38')](_0x53e3a6['remoteUri']);_0x53e3a6[_0x6801('0x39')]=intUtil[_0x6801('0x38')](_0x53e3a6['serverUrl']);if(_0x135031&&_0x135031['monitor_format']){logger['info'](_0x6801('0x3a'),_0x6801('0x3b'));_0x22c622[_0x6801('0x3c')]=util[_0x6801('0x9')](_0x6801('0x3d'),_0x53e3a6[_0x6801('0x39')],_0x22c622['uniqueid'],md5(_0x22c622[_0x6801('0x3e')]));}else{_0x22c622[_0x6801('0x3c')]='';}headers[_0x6801('0x3f')]=getAuth(_0x53e3a6);return getUser(_0x53e3a6,_0x1f770e[_0x6801('0x1b')])[_0x6801('0x16')](function(_0x310ce9){_0x40c9a5=_0x310ce9;logger['info'](_0x6801('0x40'),_0x40c9a5['id']);return getEndUser(_0x53e3a6,_0x22c622[_0x6801('0xb')],_0x22c622['calleridnum']);})[_0x6801('0x16')](function(_0x165cd9){_0x388333=_0x165cd9;logger[_0x6801('0x7')](_0x6801('0x41'),_0x388333['id']);return getTicket(_0x53e3a6,_0x40c9a5,_0x388333,_0x31100d,_0x22c622);})[_0x6801('0x16')](function(_0x3d5ba4){if(_0x3d5ba4&&_0x3d5ba4['id']){logger['info'](_0x6801('0x17'));logger[_0x6801('0x7')](_0x6801('0x42'),_0x3d5ba4['id']);logger[_0x6801('0x7')]('[QUEUE]',_0x6801('0x43'));emit(util[_0x6801('0x9')](_0x6801('0x44'),_0x1f770e['name']),_0x6801('0x45'),{'uri':util[_0x6801('0x9')](_0x6801('0x46'),_0x53e3a6[_0x6801('0x18')],_0x3d5ba4['id'])});}})[_0x6801('0x47')](function(_0x382ea0){logger[_0x6801('0x48')](_0x6801('0x3a'),JSON['stringify'](_0x382ea0));});};exports['outbound']=function(_0xd65e7,_0x175eae,_0x164352,_0x353a80,_0x125a4b,_0x4c0126,_0x53b425){var _0x3f345e,_0x1897fc;_0x4c0126[_0x6801('0x18')]=intUtil['stripTrailingSlash'](_0x4c0126['remoteUri']);_0x4c0126['serverUrl']=intUtil[_0x6801('0x38')](_0x4c0126['serverUrl']);if(_0x53b425&&_0x53b425[_0x6801('0x49')]&&_0x53b425[_0x6801('0x49')]!==_0x6801('0x4a')){logger['info'](_0x6801('0x4b'),'Recording\x20is\x20enabled!');_0x175eae['recordingURL']=util[_0x6801('0x9')](_0x6801('0x3d'),_0x4c0126[_0x6801('0x39')],_0x175eae[_0x6801('0x3e')],md5(_0x175eae[_0x6801('0x3e')]));}headers[_0x6801('0x3f')]=getAuth(_0x4c0126);return getUser(_0x4c0126,_0x353a80[_0x6801('0x1b')])[_0x6801('0x16')](function(_0x47d2a2){_0x3f345e=_0x47d2a2;logger[_0x6801('0x7')](_0x6801('0x40'),_0x3f345e['id']);return getEndUser(_0x4c0126,_0x175eae[_0x6801('0x4c')],_0x175eae['destcalleridnum']);})[_0x6801('0x16')](function(_0x271bcf){_0x1897fc=_0x271bcf;logger[_0x6801('0x7')](_0x6801('0x41'),_0x1897fc['id']);return getTicket(_0x4c0126,_0x3f345e,_0x1897fc,_0x164352,_0x175eae);})[_0x6801('0x16')](function(_0x4fd653){if(_0x4fd653&&_0x4fd653['id']){logger['info'](_0x6801('0x17'));logger[_0x6801('0x7')]('The\x20Ticket\x20ID\x20is:',_0x4fd653['id']);logger['info']('[OUTBOUND]',_0x6801('0x43'));emit(util[_0x6801('0x9')](_0x6801('0x44'),_0x353a80['name']),'trigger:browser:url',{'uri':util[_0x6801('0x9')](_0x6801('0x46'),_0x4c0126['remoteUri'],_0x4fd653['id'])});}})[_0x6801('0x47')](function(_0x386e25){logger[_0x6801('0x48')](_0x6801('0x4b'),JSON['stringify'](_0x386e25));});};exports[_0x6801('0x4d')]=function(_0x45fd5c,_0x57f53e,_0x3e7ae7,_0x2276b5,_0x5913ac,_0x5dbe3a){var _0x4229b9,_0x11939b;_0x5dbe3a[_0x6801('0x18')]=intUtil[_0x6801('0x38')](_0x5dbe3a[_0x6801('0x18')]);_0x5dbe3a[_0x6801('0x39')]=intUtil[_0x6801('0x38')](_0x5dbe3a[_0x6801('0x39')]);if(_0x5913ac&&_0x5913ac[_0x6801('0x4e')]){logger[_0x6801('0x7')](_0x6801('0x4f'),_0x6801('0x3b'));_0x57f53e[_0x6801('0x3c')]=util[_0x6801('0x9')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5dbe3a['serverUrl'],_0x57f53e[_0x6801('0x3e')],md5(_0x57f53e[_0x6801('0x3e')]));}else{_0x57f53e['recordingURL']='';}headers['Authorization']=getAuth(_0x5dbe3a);return getUser(_0x5dbe3a,'')['then'](function(_0x38caae){_0x4229b9=_0x38caae;logger['info']('The\x20User\x20ID\x20is:',_0x4229b9['id']);return getEndUser(_0x5dbe3a,_0x57f53e[_0x6801('0xb')],_0x57f53e[_0x6801('0xc')]);})[_0x6801('0x16')](function(_0x332d46){_0x11939b=_0x332d46;logger[_0x6801('0x7')](_0x6801('0x41'),_0x11939b['id']);return getTicket(_0x5dbe3a,_0x4229b9,_0x11939b,_0x3e7ae7,_0x57f53e);})['then'](function(_0x5052b5){if(_0x5052b5){logger[_0x6801('0x7')](_0x6801('0x17'));logger[_0x6801('0x7')](_0x6801('0x42'),_0x5052b5['id']);}})[_0x6801('0x47')](function(_0x24b2a2){logger[_0x6801('0x48')](_0x6801('0x4f'),JSON[_0x6801('0x26')](_0x24b2a2));});}; \ 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 d7c61ab..bd76c58 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 _0x0285=['format','%s\x20configuration\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./dynamics365','zendesk','freshdesk','zoho','servicenow','exec','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','abandoned','salesforce','sugarcrm','desk','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]'];(function(_0x28de75,_0x103055){var _0xa1b275=function(_0x2b7dda){while(--_0x2b7dda){_0x28de75['push'](_0x28de75['shift']());}};_0xa1b275(++_0x103055);}(_0x0285,0xd5));var _0x5028=function(_0x169f86,_0xadf81f){_0x169f86=_0x169f86-0x0;var _0x30cced=_0x0285[_0x169f86];return _0x30cced;};'use strict';var _=require(_0x5028('0x0'));var util=require(_0x5028('0x1'));var zendesk=require(_0x5028('0x2'));var salesforce=require(_0x5028('0x3'));var sugarcrm=require(_0x5028('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x5028('0x5'));var desk=require(_0x5028('0x6'));var vtiger=require(_0x5028('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0x5028('0x8'));var integrations=[_0x5028('0x9'),'salesforce','sugarcrm',_0x5028('0xa'),_0x5028('0xb'),'desk','vtiger',_0x5028('0xc'),'dynamics365'];exports[_0x5028('0xd')]=function(_0x3a7423,_0x2e622e,_0x508495,_0x2c1312,_0x13f53b,_0x2aabb6){if(_0x508495){if(_['includes'](integrations,_0x3a7423[_0x5028('0xe')][_0x5028('0xf')]())){try{var _0x5919d0=null;var _0x5ee7b3='';var _0x172c78=_0x508495[_0x3a7423['data1'][_0x5028('0xf')]()];if(_0x172c78){var _0x29eafc=_0x172c78[_0x3a7423['data2']];if(_0x29eafc){var _0x3a581d=_[_0x5028('0x10')](_0x29eafc[_0x5028('0x11')],{'id':parseInt(_0x3a7423[_0x5028('0x12')],0xa)});if(_0x3a581d){if(_0x2c1312){if(_0x13f53b&&_0x2e622e['queue']){_0x5ee7b3=_0x5028('0x13');}else if(_0x2e622e[_0x5028('0x14')]){_0x5ee7b3=_0x5028('0x15');}else{console[_0x5028('0x16')]('EVENT\x20UNKNOWN',_0x2e622e);}}else{_0x5ee7b3=_0x5028('0x17');}switch(_0x3a7423[_0x5028('0xe')][_0x5028('0xf')]()){case _0x5028('0x9'):zendesk[_0x5ee7b3](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6);break;case _0x5028('0x18'):salesforce[_0x5ee7b3](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6);break;case _0x5028('0x19'):sugarcrm[_0x5ee7b3](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6);break;case _0x5028('0xa'):freshdesk[_0x5ee7b3](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6);break;case _0x5028('0xb'):zoho[_0x5ee7b3](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6);break;case _0x5028('0x1a'):desk[_0x5ee7b3](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6);break;case'vtiger':vtiger[_0x5ee7b3](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6);break;case _0x5028('0xc'):servicenow['cs'](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6,_0x5ee7b3);break;case _0x5028('0x1b'):dynamics365['cs'](_0x3a7423,_0x2e622e,_0x3a581d,_0x2c1312,_0x13f53b,_0x29eafc,_0x2aabb6,_0x5ee7b3);break;default:console['log'](_0x5028('0x1c'));}}else{_0x5919d0=require(_0x5028('0x1d'))(_0x3a7423[_0x5028('0xe')][_0x5028('0xf')]());_0x5919d0[_0x5028('0x1e')](_0x5028('0x1f'),util[_0x5028('0x20')](_0x5028('0x21'),_0x3a7423[_0x5028('0xe')][_0x5028('0xf')](),_0x3a7423[_0x5028('0x12')]));}}else{_0x5919d0=require(_0x5028('0x1d'))(_0x3a7423[_0x5028('0xe')][_0x5028('0xf')]());_0x5919d0[_0x5028('0x1e')](_0x5028('0x1f'),util[_0x5028('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x3a7423['data1'][_0x5028('0xf')](),_0x3a7423[_0x5028('0x22')]));}}else{}}catch(_0xa50d0b){console[_0x5028('0x1e')](_0xa50d0b);}}}}; \ No newline at end of file +var _0x7b18=['zoho','desk','vtiger','servicenow','dynamics365','exec','includes','toLowerCase','find','data3','queue','routeId','outbound','log','abandoned','unknown\x20integration','../../../../config/logger','data1','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./zoho','./vtiger','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk'];(function(_0x44beb1,_0x4f533d){var _0x4766bd=function(_0x7cc25f){while(--_0x7cc25f){_0x44beb1['push'](_0x44beb1['shift']());}};_0x4766bd(++_0x4f533d);}(_0x7b18,0x1af));var _0x87b1=function(_0x4178b4,_0x5e10ab){_0x4178b4=_0x4178b4-0x0;var _0x234b91=_0x7b18[_0x4178b4];return _0x234b91;};'use strict';var _=require(_0x87b1('0x0'));var util=require(_0x87b1('0x1'));var zendesk=require(_0x87b1('0x2'));var salesforce=require(_0x87b1('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x87b1('0x4'));var desk=require('./desk');var vtiger=require(_0x87b1('0x5'));var servicenow=require(_0x87b1('0x6'));var dynamics365=require(_0x87b1('0x7'));var integrations=['zendesk',_0x87b1('0x8'),_0x87b1('0x9'),_0x87b1('0xa'),_0x87b1('0xb'),_0x87b1('0xc'),_0x87b1('0xd'),_0x87b1('0xe'),_0x87b1('0xf')];exports[_0x87b1('0x10')]=function(_0x1d4d5f,_0x2ef226,_0x222c8f,_0x5ec62e,_0xedb1c4,_0x5caf37){if(_0x222c8f){if(_[_0x87b1('0x11')](integrations,_0x1d4d5f['data1'][_0x87b1('0x12')]())){try{var _0x175188=null;var _0x5662fe='';var _0x1f1313=_0x222c8f[_0x1d4d5f['data1'][_0x87b1('0x12')]()];if(_0x1f1313){var _0x1cf8d1=_0x1f1313[_0x1d4d5f['data2']];if(_0x1cf8d1){var _0x5b9959=_[_0x87b1('0x13')](_0x1cf8d1['Configurations'],{'id':parseInt(_0x1d4d5f[_0x87b1('0x14')],0xa)});if(_0x5b9959){if(_0x5ec62e){if(_0xedb1c4&&_0x2ef226[_0x87b1('0x15')]){_0x5662fe='queue';}else if(_0x2ef226[_0x87b1('0x16')]){_0x5662fe=_0x87b1('0x17');}else{console[_0x87b1('0x18')]('EVENT\x20UNKNOWN',_0x2ef226);}}else{_0x5662fe=_0x87b1('0x19');}switch(_0x1d4d5f['data1'][_0x87b1('0x12')]()){case'zendesk':zendesk[_0x5662fe](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37);break;case _0x87b1('0x8'):salesforce[_0x5662fe](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37);break;case _0x87b1('0x9'):sugarcrm[_0x5662fe](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37);break;case _0x87b1('0xa'):freshdesk[_0x5662fe](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37);break;case _0x87b1('0xb'):zoho[_0x5662fe](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37);break;case _0x87b1('0xc'):desk[_0x5662fe](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37);break;case'vtiger':vtiger[_0x5662fe](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37);break;case _0x87b1('0xe'):servicenow['cs'](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37,_0x5662fe);break;case _0x87b1('0xf'):dynamics365['cs'](_0x1d4d5f,_0x2ef226,_0x5b9959,_0x5ec62e,_0xedb1c4,_0x1cf8d1,_0x5caf37,_0x5662fe);break;default:console[_0x87b1('0x18')](_0x87b1('0x1a'));}}else{_0x175188=require(_0x87b1('0x1b'))(_0x1d4d5f[_0x87b1('0x1c')][_0x87b1('0x12')]());_0x175188[_0x87b1('0x1d')](_0x87b1('0x1e'),util[_0x87b1('0x1f')](_0x87b1('0x20'),_0x1d4d5f[_0x87b1('0x1c')][_0x87b1('0x12')](),_0x1d4d5f[_0x87b1('0x14')]));}}else{_0x175188=require(_0x87b1('0x1b'))(_0x1d4d5f[_0x87b1('0x1c')]['toLowerCase']());_0x175188[_0x87b1('0x1d')](_0x87b1('0x1e'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x1d4d5f['data1'][_0x87b1('0x12')](),_0x1d4d5f[_0x87b1('0x21')]));}}else{}}catch(_0x1832b1){console[_0x87b1('0x1d')](_0x1832b1);}}}}; \ 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 ba64602..5bf4292 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 _0xedd9=['username','Connection\x20established.','queue','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','stringify','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','ticketType','Task','assign','utc','getString','Subjects','WhoId','Case','Descriptions','sobject','create','isNil','User','then','length','Email','resolve','Name','info','identity','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','find','execute','Lead','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','string','idField','content','type','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','remoteUri','clientId','clientSecret','login'];(function(_0x53dc2f,_0x352f5f){var _0x2db8b6=function(_0x1c82c9){while(--_0x1c82c9){_0x53dc2f['push'](_0x53dc2f['shift']());}};_0x2db8b6(++_0x352f5f);}(_0xedd9,0xfc));var _0x9edd=function(_0xab0844,_0x108978){_0xab0844=_0xab0844-0x0;var _0x1787b1=_0xedd9[_0xab0844];return _0x1787b1;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var md5=require(_0x9edd('0x3'));var jsforce=require(_0x9edd('0x4'));var util=require(_0x9edd('0x5'));var Redis=require(_0x9edd('0x6'));var intUtil=require(_0x9edd('0x7'));var config=require('../../../../config/environment');var logger=require(_0x9edd('0x8'))(_0x9edd('0x9'));config[_0x9edd('0xa')]=_[_0x9edd('0xb')](config['redis'],{'host':_0x9edd('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0xa')]));function emit(_0x190185,_0x1355be,_0x3280fd){io['to'](_0x190185)['emit'](_0x1355be,_0x3280fd);}function getTicket(_0x494a24,_0x5d2f90,_0x2076fc,_0x138767,_0x523026,_0xbf9da6,_0x13dc4f,_0x5b6c00){var _0x30c0d7={};if(_0x138767[_0x9edd('0xd')]===_0x9edd('0xe')){_0x30c0d7=Object[_0x9edd('0xf')]({},{'OwnerId':_0x5d2f90['id'],'ActivityDate':moment[_0x9edd('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x9edd('0x11')](_0x138767[_0x9edd('0x12')],_0x523026,'\x20'),'Description':intUtil[_0x9edd('0x11')](_0x138767['Descriptions'],_0x523026,'\x0a')},getCustomFields(_0xbf9da6,_0x523026));if(_0x2076fc){_0x30c0d7[_0x9edd('0x13')]=_0x2076fc['id'];}}else if(_0x138767[_0x9edd('0xd')]===_0x9edd('0x14')){_0x30c0d7=Object[_0x9edd('0xf')]({},{'OwnerId':_0x5d2f90['id'],'Subject':intUtil[_0x9edd('0x11')](_0x138767[_0x9edd('0x12')],_0x523026,'\x20'),'Description':intUtil[_0x9edd('0x11')](_0x138767[_0x9edd('0x15')],_0x523026,'\x0a')},getCustomFields(_0xbf9da6,_0x523026));if(_0x2076fc){_0x30c0d7['ContactId']=_0x2076fc['id'];}}return _0x13dc4f[_0x9edd('0x16')](_0x138767[_0x9edd('0xd')])[_0x9edd('0x17')](_0x30c0d7);}function getUser(_0x5acf65,_0x1b54c0,_0x35f454){if(!_[_0x9edd('0x18')](_0x1b54c0)&&intUtil['validateEmail'](_0x1b54c0)){var _0x43dc70={'Email':_0x1b54c0};var _0x5d879c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x35f454[_0x9edd('0x16')](_0x9edd('0x19'))['find'](_0x43dc70,_0x5d879c)['execute']()[_0x9edd('0x1a')](function(_0x50338f){if(_0x50338f[_0x9edd('0x1b')]){var _0x54a03f=_['find'](_0x50338f,function(_0x356751){return _0x356751[_0x9edd('0x1c')]===_0x1b54c0;});if(_0x54a03f){logger['info']('Agent\x20%s\x20found.',_0x1b54c0);return BPromise[_0x9edd('0x1d')]({'id':_0x54a03f['Id'],'name':_0x54a03f[_0x9edd('0x1e')]});}}else{logger[_0x9edd('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1b54c0);return _0x35f454[_0x9edd('0x20')]()[_0x9edd('0x1a')](function(_0x44a6c1){return BPromise[_0x9edd('0x1d')]({'id':_0x44a6c1[_0x9edd('0x21')],'name':_0x44a6c1['display_name']});});}});}else{logger[_0x9edd('0x1f')](_0x9edd('0x22'),_0x1b54c0);return _0x35f454[_0x9edd('0x20')]()[_0x9edd('0x1a')](function(_0x310a4d){return BPromise['resolve']({'id':_0x310a4d['user_id'],'name':_0x310a4d[_0x9edd('0x23')]});});}}function getEndUser(_0xfeca7b,_0x8d67aa,_0x25e135,_0x3c2227,_0x4fe471){var _0x57a2cc={'Phone':_0x3c2227};var _0x214d0a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9edd('0x1d')]()[_0x9edd('0x1a')](function(){if(_0x8d67aa['ticketType']===_0x9edd('0xe')){logger[_0x9edd('0x1f')](_0x9edd('0x24'),_0x3c2227,_0x8d67aa[_0x9edd('0x25')]);switch(_0x8d67aa['moduleSearch']){case _0x9edd('0x26'):return _0x4fe471[_0x9edd('0x16')](_0x9edd('0x27'))[_0x9edd('0x28')](_0x57a2cc,_0x214d0a)[_0x9edd('0x29')]()[_0x9edd('0x1a')](function(_0x209aba){if(_0x209aba&&_0x209aba[_0x9edd('0x1b')]){return _0x209aba;}else{return _0x4fe471[_0x9edd('0x16')](_0x9edd('0x2a'))[_0x9edd('0x28')](_0x57a2cc,_0x214d0a);}});case _0x9edd('0x2b'):return _0x4fe471[_0x9edd('0x16')](_0x9edd('0x27'))[_0x9edd('0x28')](_0x57a2cc,_0x214d0a)['execute']();case _0x9edd('0x2c'):return _0x4fe471[_0x9edd('0x16')](_0x9edd('0x2a'))['find'](_0x57a2cc,_0x214d0a);default:return null;}}else if(_0x8d67aa[_0x9edd('0xd')]===_0x9edd('0x14')){logger[_0x9edd('0x1f')](_0x9edd('0x24'),_0x3c2227,_0x9edd('0x2b'));return _0x4fe471[_0x9edd('0x16')](_0x9edd('0x27'))[_0x9edd('0x28')](_0x57a2cc,_0x214d0a)[_0x9edd('0x29')]();}})[_0x9edd('0x1a')](function(_0x29e789){if(_0x29e789&&_0x29e789[_0x9edd('0x1b')]){var _0x27eb7e=_[_0x9edd('0x28')](_0x29e789,function(_0x5757fc){return _0x5757fc[_0x9edd('0x2d')]===_0x3c2227;});if(_0x27eb7e){return BPromise['resolve']({'id':_0x27eb7e['Id'],'name':_0x27eb7e[_0x9edd('0x1e')],'phone':_0x27eb7e[_0x9edd('0x2d')]});}}})[_0x9edd('0x1a')](function(_0x434d26){if(_0x434d26){logger[_0x9edd('0x1f')]('Enduser\x20with\x20phone\x20%s\x20found.',_0x3c2227);return BPromise[_0x9edd('0x1d')](_0x434d26);}else{logger[_0x9edd('0x1f')](_0x9edd('0x2e'),_0x3c2227);var _0x38e9be={'LastName':_0x25e135!==_0x9edd('0x2f')?_0x25e135:util[_0x9edd('0x30')](_0x9edd('0x31'),_0x3c2227),'Phone':_0x3c2227};if(_0x8d67aa[_0x9edd('0x32')]){if(_0x8d67aa[_0x9edd('0x32')]===_0x9edd('0x2b')){logger['info'](_0x9edd('0x33'),_0x3c2227,_0x8d67aa['moduleCreate']);}else if(_0x8d67aa[_0x9edd('0x32')]==='lead'&&_0x8d67aa[_0x9edd('0xd')]===_0x9edd('0xe')){logger[_0x9edd('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3c2227,_0x8d67aa[_0x9edd('0x32')]);_0x38e9be[_0x9edd('0x34')]=_0x9edd('0x35');}else{return null;}}return _0x4fe471['sobject'](_[_0x9edd('0x36')](_0x8d67aa['moduleCreate']))[_0x9edd('0x17')](_0x38e9be);}});}function getCustomFields(_0xfbc492,_0x50be2c){var _0x315f52={};if(_0xfbc492[_0x9edd('0x1b')]>0x0){_[_0x9edd('0x37')](_0xfbc492,function(_0x810331){if(_0x810331['type']===_0x9edd('0x38')&&_0x810331['idField']){_0x315f52[_0x810331[_0x9edd('0x39')]]=_0x810331[_0x9edd('0x3a')]['toString']();}else if(_0x810331[_0x9edd('0x3b')]==='variable'&&_0x810331['variableName']&&_0x810331[_0x9edd('0x39')]){_0x50be2c[_0x810331[_0x9edd('0x3c')]]&&(_0x315f52[_0x810331[_0x9edd('0x39')]]=_0x50be2c[_0x810331[_0x9edd('0x3c')]][_0x9edd('0x3d')]());}else if(_0x810331[_0x9edd('0x3b')]===_0x9edd('0x3e')&&_0x810331[_0x9edd('0x3f')]&&_0x810331[_0x9edd('0x3f')][_0x9edd('0x40')]&&_0x810331[_0x9edd('0x39')]){_0x50be2c[_0x810331[_0x9edd('0x3f')][_0x9edd('0x40')][_0x9edd('0x41')]()]&&(_0x315f52[_0x810331[_0x9edd('0x39')]]=_0x50be2c[_0x810331['Variable'][_0x9edd('0x40')][_0x9edd('0x41')]()][_0x9edd('0x3d')]());}});}return _0x315f52;}function getConnection(_0x1e5805){var _0x241929=_0x1e5805[_0x9edd('0x42')][_0x9edd('0x43')](_0x1e5805['securityToken']);var _0x4a4656=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1e5805[_0x9edd('0x44')]||'https://login.salesforce.com','clientId':_0x1e5805[_0x9edd('0x45')],'clientSecret':_0x1e5805[_0x9edd('0x46')]}});return _0x4a4656[_0x9edd('0x47')](_0x1e5805[_0x9edd('0x48')],_0x241929)[_0x9edd('0x1a')](function(){logger['info'](_0x9edd('0x49'));return _0x4a4656;});}exports[_0x9edd('0x4a')]=function(_0x40e33d,_0x4a89ae,_0x3626bc,_0xfd7bd1,_0x2159aa,_0x293b03){var _0x1d78c4,_0x35bdec,_0x4d4f33,_0x441e4a;_0x293b03[_0x9edd('0x4b')]=intUtil['stripTrailingSlash'](_0x293b03[_0x9edd('0x4b')]);_0x293b03[_0x9edd('0x44')]=intUtil['stripTrailingSlash'](_0x293b03[_0x9edd('0x44')]);if(_0x2159aa&&_0x2159aa[_0x9edd('0x4c')]){logger[_0x9edd('0x1f')]('[QUEUE]',_0x9edd('0x4d'));_0x4a89ae[_0x9edd('0x4e')]=util[_0x9edd('0x30')](_0x9edd('0x4f'),_0x293b03['serverUrl'],_0x4a89ae[_0x9edd('0x50')],md5(_0x4a89ae[_0x9edd('0x50')]));}else{_0x4a89ae[_0x9edd('0x4e')]='';}return getConnection(_0x293b03)['then'](function(_0x16951a){_0x441e4a=_0x16951a;return getUser(_0x293b03,_0xfd7bd1[_0x9edd('0x51')],_0x441e4a);})['then'](function(_0x8e59bd){_0x1d78c4=_0x8e59bd;return getEndUser(_0x293b03,_0x3626bc,_0x4a89ae['calleridname'],_0x4a89ae[_0x9edd('0x52')],_0x441e4a);})[_0x9edd('0x1a')](function(_0x24245f){_0x35bdec=_0x24245f;return getTicket(_0x293b03,_0x1d78c4,_0x35bdec,_0x3626bc,_0x4a89ae,_0x3626bc[_0x9edd('0x53')],_0x441e4a,_0x9edd('0x4a'));})[_0x9edd('0x1a')](function(_0x2334d4){_0x4d4f33=_0x2334d4;logger[_0x9edd('0x1f')](_0x9edd('0x54'),_0x4d4f33['id']);logger[_0x9edd('0x1f')](_0x9edd('0x55'),_0x4d4f33['id'],_0xfd7bd1['name'],_0x293b03[_0x9edd('0x3b')]);switch(_0x293b03[_0x9edd('0x3b')]){case _0x9edd('0x56'):emit(util['format'](_0x9edd('0x57'),_0xfd7bd1['name']),'trigger:salesforce:display',{'recordId':_0x4d4f33['id']});break;case'newTab':emit(util[_0x9edd('0x30')](_0x9edd('0x57'),_0xfd7bd1[_0x9edd('0x40')]),_0x9edd('0x58'),{'uri':util['format']('%s/%s/e',_0x441e4a['instanceUrl'],_0x4d4f33['id'])});break;default:logger[_0x9edd('0x59')](_0x9edd('0x5a'));}})[_0x9edd('0x5b')](function(_0x1091ff){logger[_0x9edd('0x59')](_0x9edd('0x5c'),JSON[_0x9edd('0x5d')](_0x1091ff));});};exports[_0x9edd('0x5e')]=function(_0x4eb780,_0x16dfdc,_0x49d0ce,_0x421e82,_0x6a1cfc,_0x4b7e68,_0x22b91a){var _0x322359,_0x950e53,_0x5ec9af,_0xc648c4;_0x4b7e68[_0x9edd('0x4b')]=intUtil[_0x9edd('0x5f')](_0x4b7e68[_0x9edd('0x4b')]);_0x4b7e68[_0x9edd('0x44')]=intUtil[_0x9edd('0x5f')](_0x4b7e68['remoteUri']);if(_0x22b91a&&_0x22b91a['recordingFormat']&&_0x22b91a[_0x9edd('0x60')]!=='none'){logger[_0x9edd('0x1f')](_0x9edd('0x61'),_0x9edd('0x4d'));_0x16dfdc[_0x9edd('0x4e')]=util['format'](_0x9edd('0x4f'),_0x4b7e68['serverUrl'],_0x16dfdc[_0x9edd('0x50')],md5(_0x16dfdc[_0x9edd('0x50')]));}return getConnection(_0x4b7e68)[_0x9edd('0x1a')](function(_0x5ca123){_0xc648c4=_0x5ca123;return getUser(_0x4b7e68,_0x421e82[_0x9edd('0x51')],_0xc648c4);})['then'](function(_0x37e603){_0x322359=_0x37e603;return getEndUser(_0x4b7e68,_0x49d0ce,_0x16dfdc[_0x9edd('0x62')],_0x16dfdc['destcalleridnum'],_0xc648c4);})[_0x9edd('0x1a')](function(_0x4a72d0){_0x950e53=_0x4a72d0;return getTicket(_0x4b7e68,_0x322359,_0x950e53,_0x49d0ce,_0x16dfdc,_0x49d0ce[_0x9edd('0x53')],_0xc648c4,_0x9edd('0x5e'));})[_0x9edd('0x1a')](function(_0x50f4fc){_0x5ec9af=_0x50f4fc;logger[_0x9edd('0x1f')](_0x9edd('0x63'),_0x5ec9af['id']);logger[_0x9edd('0x1f')](_0x9edd('0x64'),_0x5ec9af['id'],_0x421e82[_0x9edd('0x40')],_0x4b7e68['type']);switch(_0x4b7e68['type']){case _0x9edd('0x56'):emit(util[_0x9edd('0x30')]('user:%s',_0x421e82['name']),'trigger:salesforce:display',{'recordId':_0x5ec9af['id']});break;case _0x9edd('0x65'):emit(util['format']('user:%s',_0x421e82[_0x9edd('0x40')]),_0x9edd('0x58'),{'uri':util['format'](_0x9edd('0x66'),_0xc648c4[_0x9edd('0x67')],_0x5ec9af['id'])});break;default:logger[_0x9edd('0x59')]('[OUTBOUND]',_0x9edd('0x68'));}})['catch'](function(_0x37b018){logger[_0x9edd('0x59')]('[OUTBOUND]',JSON[_0x9edd('0x5d')](_0x37b018));});};exports[_0x9edd('0x69')]=function(_0x5c1746,_0x2bd6d1,_0x475dc3,_0x460a92,_0x1d9536,_0x5ce70b){var _0x366b04,_0x58330c,_0x1a618c,_0x1a5cdb;_0x5ce70b[_0x9edd('0x4b')]=intUtil['stripTrailingSlash'](_0x5ce70b[_0x9edd('0x4b')]);_0x5ce70b[_0x9edd('0x44')]=intUtil[_0x9edd('0x5f')](_0x5ce70b[_0x9edd('0x44')]);if(_0x1d9536&&_0x1d9536[_0x9edd('0x4c')]){logger[_0x9edd('0x1f')](_0x9edd('0x6a'),'Recording\x20is\x20enabled!');_0x2bd6d1['recordingURL']=util[_0x9edd('0x30')](_0x9edd('0x4f'),_0x5ce70b[_0x9edd('0x4b')],_0x2bd6d1[_0x9edd('0x50')],md5(_0x2bd6d1[_0x9edd('0x50')]));}else{_0x2bd6d1['recordingURL']='';}return getConnection(_0x5ce70b)[_0x9edd('0x1a')](function(_0x5d56a){_0x1a5cdb=_0x5d56a;if(!_[_0x9edd('0x18')](_0x460a92)){return getUser(_0x5ce70b,_0x460a92['name'],_0x1a5cdb);}else{return getUser(_0x5ce70b,null,_0x1a5cdb);}})[_0x9edd('0x1a')](function(_0x29d70d){_0x366b04=_0x29d70d;return getEndUser(_0x5ce70b,_0x475dc3,_0x2bd6d1['calleridname'],_0x2bd6d1[_0x9edd('0x52')],_0x1a5cdb);})[_0x9edd('0x1a')](function(_0x58c839){_0x58330c=_0x58c839;return getTicket(_0x5ce70b,_0x366b04,_0x58330c,_0x475dc3,_0x2bd6d1,_0x475dc3[_0x9edd('0x53')],_0x1a5cdb);})[_0x9edd('0x1a')](function(_0x566be7){_0x1a618c=_0x566be7;logger[_0x9edd('0x1f')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x1a618c['id']);logger['info'](_0x9edd('0x6b'),_0x5ce70b[_0x9edd('0x3b')]);})[_0x9edd('0x5b')](function(_0x5b56c7){logger[_0x9edd('0x59')](_0x9edd('0x6a'),JSON['stringify'](_0x5b56c7));});}; \ No newline at end of file +var _0x0713=['instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','getString','Descriptions','assign','Subjects','ContactId','sobject','create','isNil','validateEmail','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','lead','Lead','Case','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','variableName','toString','customVariable','Variable','name','toLowerCase','password','securityToken','remoteUri','clientId','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var md5=require(_0x3071('0x2'));var jsforce=require(_0x3071('0x3'));var util=require(_0x3071('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var logger=require(_0x3071('0x7'))(_0x3071('0x8'));config[_0x3071('0x9')]=_[_0x3071('0xa')](config[_0x3071('0x9')],{'host':_0x3071('0xb'),'port':0x18eb});var io=require(_0x3071('0xc'))(new Redis(config[_0x3071('0x9')]));function emit(_0x3e9a5e,_0x2fce7a,_0x1a868e){io['to'](_0x3e9a5e)['emit'](_0x2fce7a,_0x1a868e);}function getTicket(_0x3457cd,_0x2610b4,_0x937259,_0xff9a29,_0x1ce844,_0x4a470a,_0x2ace21,_0x11a7ee){var _0x401b4d={};if(_0xff9a29[_0x3071('0xd')]===_0x3071('0xe')){_0x401b4d=Object['assign']({},{'OwnerId':_0x2610b4['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3071('0xf')](_0xff9a29['Subjects'],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d['WhoId']=_0x937259['id'];}}else if(_0xff9a29[_0x3071('0xd')]==='Case'){_0x401b4d=Object[_0x3071('0x11')]({},{'OwnerId':_0x2610b4['id'],'Subject':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x12')],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d[_0x3071('0x13')]=_0x937259['id'];}}return _0x2ace21[_0x3071('0x14')](_0xff9a29[_0x3071('0xd')])[_0x3071('0x15')](_0x401b4d);}function getUser(_0x344ea6,_0x5f3c22,_0x224996){if(!_[_0x3071('0x16')](_0x5f3c22)&&intUtil[_0x3071('0x17')](_0x5f3c22)){var _0x108a83={'Email':_0x5f3c22};var _0x3acf0e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x224996[_0x3071('0x14')](_0x3071('0x18'))[_0x3071('0x19')](_0x108a83,_0x3acf0e)['execute']()[_0x3071('0x1a')](function(_0x2bfa33){if(_0x2bfa33[_0x3071('0x1b')]){var _0x56c267=_[_0x3071('0x19')](_0x2bfa33,function(_0x5cd80d){return _0x5cd80d[_0x3071('0x1c')]===_0x5f3c22;});if(_0x56c267){logger[_0x3071('0x1d')](_0x3071('0x1e'),_0x5f3c22);return BPromise[_0x3071('0x1f')]({'id':_0x56c267['Id'],'name':_0x56c267[_0x3071('0x20')]});}}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()['then'](function(_0x481a51){return BPromise[_0x3071('0x1f')]({'id':_0x481a51[_0x3071('0x23')],'name':_0x481a51[_0x3071('0x24')]});});}});}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()[_0x3071('0x1a')](function(_0x1fe727){return BPromise[_0x3071('0x1f')]({'id':_0x1fe727['user_id'],'name':_0x1fe727[_0x3071('0x24')]});});}}function getEndUser(_0x3f1e6e,_0x177138,_0x4d5c4b,_0x4fb1ca,_0x28792d){var _0x163604={'Phone':_0x4fb1ca};var _0x950fde={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3071('0x1f')]()[_0x3071('0x1a')](function(){if(_0x177138[_0x3071('0xd')]===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x177138[_0x3071('0x26')]);switch(_0x177138['moduleSearch']){case'contact_lead':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)[_0x3071('0x28')]()[_0x3071('0x1a')](function(_0x29538c){if(_0x29538c&&_0x29538c[_0x3071('0x1b')]){return _0x29538c;}else{return _0x28792d[_0x3071('0x14')]('Lead')['find'](_0x163604,_0x950fde);}});case'contact':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))['find'](_0x163604,_0x950fde)[_0x3071('0x28')]();case _0x3071('0x29'):return _0x28792d[_0x3071('0x14')](_0x3071('0x2a'))['find'](_0x163604,_0x950fde);default:return null;}}else if(_0x177138[_0x3071('0xd')]===_0x3071('0x2b')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x3071('0x2c'));return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)['execute']();}})[_0x3071('0x1a')](function(_0x54e52f){if(_0x54e52f&&_0x54e52f['length']){var _0x1a1a64=_[_0x3071('0x19')](_0x54e52f,function(_0x54d9c3){return _0x54d9c3[_0x3071('0x2d')]===_0x4fb1ca;});if(_0x1a1a64){return BPromise[_0x3071('0x1f')]({'id':_0x1a1a64['Id'],'name':_0x1a1a64[_0x3071('0x20')],'phone':_0x1a1a64[_0x3071('0x2d')]});}}})[_0x3071('0x1a')](function(_0x232235){if(_0x232235){logger['info'](_0x3071('0x2e'),_0x4fb1ca);return BPromise[_0x3071('0x1f')](_0x232235);}else{logger['info'](_0x3071('0x2f'),_0x4fb1ca);var _0x5b1392={'LastName':_0x4d5c4b!==_0x3071('0x30')?_0x4d5c4b:util[_0x3071('0x31')]('Caller\x20-\x20%s',_0x4fb1ca),'Phone':_0x4fb1ca};if(_0x177138['moduleCreate']){if(_0x177138[_0x3071('0x32')]===_0x3071('0x2c')){logger[_0x3071('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4fb1ca,_0x177138[_0x3071('0x32')]);}else if(_0x177138['moduleCreate']===_0x3071('0x29')&&_0x177138['ticketType']===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x33'),_0x4fb1ca,_0x177138[_0x3071('0x32')]);_0x5b1392[_0x3071('0x34')]='No\x20Company';}else{return null;}}return _0x28792d['sobject'](_[_0x3071('0x35')](_0x177138[_0x3071('0x32')]))[_0x3071('0x15')](_0x5b1392);}});}function getCustomFields(_0x1f69a6,_0x525389){var _0x3cfc05={};if(_0x1f69a6[_0x3071('0x1b')]>0x0){_[_0x3071('0x36')](_0x1f69a6,function(_0x25c29f){if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x38')&&_0x25c29f['idField']){_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x25c29f['content']['toString']();}else if(_0x25c29f['type']==='variable'&&_0x25c29f[_0x3071('0x3a')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3a')]]&&(_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x525389[_0x25c29f[_0x3071('0x3a')]][_0x3071('0x3b')]());}else if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x3c')&&_0x25c29f['Variable']&&_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]['toLowerCase']()]&&(_0x3cfc05[_0x25c29f['idField']]=_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')][_0x3071('0x3f')]()][_0x3071('0x3b')]());}});}return _0x3cfc05;}function getConnection(_0x606ef8){var _0x5db437=_0x606ef8[_0x3071('0x40')]['concat'](_0x606ef8[_0x3071('0x41')]);var _0x509178=new jsforce['Connection']({'oauth2':{'loginUrl':_0x606ef8[_0x3071('0x42')]||'https://login.salesforce.com','clientId':_0x606ef8[_0x3071('0x43')],'clientSecret':_0x606ef8['clientSecret']}});return _0x509178[_0x3071('0x44')](_0x606ef8[_0x3071('0x45')],_0x5db437)[_0x3071('0x1a')](function(){logger[_0x3071('0x1d')]('Connection\x20established.');return _0x509178;});}exports[_0x3071('0x46')]=function(_0x575c12,_0xd273ec,_0x4b6bbb,_0x46924d,_0x2060e9,_0x4d395a){var _0x131ae6,_0x117e73,_0x224a70,_0x38bcc2;_0x4d395a[_0x3071('0x47')]=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x47')]);_0x4d395a['remoteUri']=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x42')]);if(_0x2060e9&&_0x2060e9[_0x3071('0x49')]){logger[_0x3071('0x1d')]('[QUEUE]',_0x3071('0x4a'));_0xd273ec[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x4d395a[_0x3071('0x47')],_0xd273ec[_0x3071('0x4d')],md5(_0xd273ec[_0x3071('0x4d')]));}else{_0xd273ec[_0x3071('0x4b')]='';}return getConnection(_0x4d395a)[_0x3071('0x1a')](function(_0x886f7){_0x38bcc2=_0x886f7;return getUser(_0x4d395a,_0x46924d[_0x3071('0x4e')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x24977b){_0x131ae6=_0x24977b;return getEndUser(_0x4d395a,_0x4b6bbb,_0xd273ec[_0x3071('0x4f')],_0xd273ec[_0x3071('0x50')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x596cdd){_0x117e73=_0x596cdd;return getTicket(_0x4d395a,_0x131ae6,_0x117e73,_0x4b6bbb,_0xd273ec,_0x4b6bbb['Fields'],_0x38bcc2,_0x3071('0x46'));})['then'](function(_0x403761){_0x224a70=_0x403761;logger[_0x3071('0x1d')](_0x3071('0x51'),_0x224a70['id']);logger['info'](_0x3071('0x52'),_0x224a70['id'],_0x46924d[_0x3071('0x3e')],_0x4d395a['type']);switch(_0x4d395a['type']){case _0x3071('0x53'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),'trigger:salesforce:display',{'recordId':_0x224a70['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),_0x3071('0x56'),{'uri':util['format'](_0x3071('0x57'),_0x38bcc2[_0x3071('0x58')],_0x224a70['id'])});break;default:logger[_0x3071('0x59')](_0x3071('0x5a'));}})[_0x3071('0x5b')](function(_0x24f429){logger[_0x3071('0x59')]('[QUEUE]',JSON['stringify'](_0x24f429));});};exports[_0x3071('0x5c')]=function(_0x4de4f3,_0xe96994,_0x26ba8a,_0x499b6a,_0x19dc95,_0x1bf911,_0x4d3886){var _0x108b14,_0x1878e2,_0x180344,_0x6e96c7;_0x1bf911[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x1bf911[_0x3071('0x47')]);_0x1bf911[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x1bf911['remoteUri']);if(_0x4d3886&&_0x4d3886[_0x3071('0x5d')]&&_0x4d3886[_0x3071('0x5d')]!==_0x3071('0x5e')){logger[_0x3071('0x1d')](_0x3071('0x5f'),_0x3071('0x4a'));_0xe96994[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x1bf911['serverUrl'],_0xe96994[_0x3071('0x4d')],md5(_0xe96994[_0x3071('0x4d')]));}return getConnection(_0x1bf911)[_0x3071('0x1a')](function(_0x26ecb2){_0x6e96c7=_0x26ecb2;return getUser(_0x1bf911,_0x499b6a[_0x3071('0x4e')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x389dca){_0x108b14=_0x389dca;return getEndUser(_0x1bf911,_0x26ba8a,_0xe96994[_0x3071('0x60')],_0xe96994[_0x3071('0x61')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x195d03){_0x1878e2=_0x195d03;return getTicket(_0x1bf911,_0x108b14,_0x1878e2,_0x26ba8a,_0xe96994,_0x26ba8a['Fields'],_0x6e96c7,_0x3071('0x5c'));})[_0x3071('0x1a')](function(_0x279594){_0x180344=_0x279594;logger[_0x3071('0x1d')](_0x3071('0x62'),_0x180344['id']);logger[_0x3071('0x1d')](_0x3071('0x63'),_0x180344['id'],_0x499b6a[_0x3071('0x3e')],_0x1bf911['type']);switch(_0x1bf911[_0x3071('0x37')]){case _0x3071('0x53'):emit(util['format']('user:%s',_0x499b6a[_0x3071('0x3e')]),_0x3071('0x64'),{'recordId':_0x180344['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')]('user:%s',_0x499b6a['name']),_0x3071('0x56'),{'uri':util['format']('%s/%s/e',_0x6e96c7['instanceUrl'],_0x180344['id'])});break;default:logger['error'](_0x3071('0x5f'),_0x3071('0x65'));}})[_0x3071('0x5b')](function(_0x567d19){logger[_0x3071('0x59')](_0x3071('0x5f'),JSON[_0x3071('0x66')](_0x567d19));});};exports[_0x3071('0x67')]=function(_0x5a0c1b,_0x2103a4,_0x29841a,_0x588406,_0x1b35d3,_0x29ee70){var _0x388cd1,_0x40c258,_0x4edd23,_0x11ffdd;_0x29ee70[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x29ee70['serverUrl']);_0x29ee70[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x29ee70[_0x3071('0x42')]);if(_0x1b35d3&&_0x1b35d3['monitor_format']){logger['info'](_0x3071('0x68'),_0x3071('0x4a'));_0x2103a4[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x29ee70[_0x3071('0x47')],_0x2103a4[_0x3071('0x4d')],md5(_0x2103a4[_0x3071('0x4d')]));}else{_0x2103a4['recordingURL']='';}return getConnection(_0x29ee70)[_0x3071('0x1a')](function(_0x5ea33f){_0x11ffdd=_0x5ea33f;if(!_[_0x3071('0x16')](_0x588406)){return getUser(_0x29ee70,_0x588406[_0x3071('0x3e')],_0x11ffdd);}else{return getUser(_0x29ee70,null,_0x11ffdd);}})[_0x3071('0x1a')](function(_0x2fbac7){_0x388cd1=_0x2fbac7;return getEndUser(_0x29ee70,_0x29841a,_0x2103a4[_0x3071('0x4f')],_0x2103a4[_0x3071('0x50')],_0x11ffdd);})[_0x3071('0x1a')](function(_0x2ae053){_0x40c258=_0x2ae053;return getTicket(_0x29ee70,_0x388cd1,_0x40c258,_0x29841a,_0x2103a4,_0x29841a['Fields'],_0x11ffdd);})[_0x3071('0x1a')](function(_0x138a94){_0x4edd23=_0x138a94;logger[_0x3071('0x1d')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x4edd23['id']);logger[_0x3071('0x1d')](_0x3071('0x69'),_0x29ee70[_0x3071('0x37')]);})['catch'](function(_0x521ee6){logger[_0x3071('0x59')]('[ABANDONED]',JSON[_0x3071('0x66')](_0x521ee6));});}; \ 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 b66f4ca..836a79f 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 _0x20d7=['all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','../../../../config/logger','servicenow','localhost','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','info','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','customField','toLowerCase','toString','idField','content','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push'];(function(_0x42f6bb,_0x4f14ca){var _0x3e8d93=function(_0x2f6089){while(--_0x2f6089){_0x42f6bb['push'](_0x42f6bb['shift']());}};_0x3e8d93(++_0x4f14ca);}(_0x20d7,0x146));var _0x720d=function(_0x42b6d4,_0x2b6a05){_0x42b6d4=_0x42b6d4-0x0;var _0x2f635f=_0x20d7[_0x42b6d4];return _0x2f635f;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x720d('0x0'));var util=require(_0x720d('0x1'));var md5=require(_0x720d('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x720d('0x3'))(_0x720d('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x720d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x720d('0x6')]));function getAdminUser(_0x2971b7,_0x407ace,_0x3cdba2,_0x41a46e,_0x43fab6,_0x30febb){return new Promise(function(_0x445fba,_0x3b5d76){var _0x3b4dc1={'method':_0x720d('0x7'),'uri':_0x41a46e+_0x720d('0x8')+'&'+_0x43fab6+'&'+_0x30febb,'auth':_0x407ace,'json':!![]};return rp(_0x3b4dc1)[_0x720d('0x9')](function(_0x122b65){if(_0x122b65[_0x720d('0xa')][_0x720d('0xb')]>0x0){_0x3cdba2[_0x720d('0xc')]=_0x122b65[_0x720d('0xa')][0x0][_0x720d('0xd')];}logger['info']('['+[_0x2971b7[_0x720d('0xe')]()]+_0x720d('0xf'),_0x3cdba2);_0x445fba(_0x3cdba2);})[_0x720d('0x10')](function(_0x41cbb6){logger[_0x720d('0x11')]('['+[_0x2971b7[_0x720d('0xe')]()]+']',_0x41cbb6[_0x720d('0x12')]);_0x3b5d76(_0x41cbb6[_0x720d('0x12')]);});});}function getUser(_0x4aa030,_0x408dff,_0x561445,_0x48c460,_0x5af38e){return function(_0x846597){logger['info']('['+[_0x4aa030[_0x720d('0xe')]()]+_0x720d('0x13'),_0x846597);return new Promise(function(_0x443443,_0x21248a){if(intUtil[_0x720d('0x14')](_0x846597[_0x720d('0x15')])){var _0x134394={'method':'GET','uri':_0x561445+_0x720d('0x16')+_0x846597[_0x720d('0x15')]+'&'+_0x48c460+'&'+_0x5af38e,'auth':_0x408dff,'json':!![]};logger[_0x720d('0x17')]('['+[_0x4aa030[_0x720d('0xe')]()]+'],\x20getUser\x20rp\x20obj',_0x134394);return rp(_0x134394)[_0x720d('0x9')](function(_0x13f27f){logger[_0x720d('0x17')]('['+[_0x4aa030[_0x720d('0xe')]()]+'],\x20getUser\x20entity',_0x13f27f);if(_0x13f27f[_0x720d('0xa')][_0x720d('0xb')]>0x0&&String(_0x13f27f['result'][0x0][_0x720d('0x18')])===_0x720d('0x19')){_0x846597[_0x720d('0x1a')]=_0x13f27f[_0x720d('0xa')][0x0]['sys_id'];}else{_0x846597[_0x720d('0x1a')]=_0x846597['adminId'];_0x846597[_0x720d('0x15')]=_0x846597[_0x720d('0x1b')];}logger['info']('['+[_0x4aa030['toUpperCase']()]+_0x720d('0x1c'),_0x846597);_0x443443(_0x846597);})[_0x720d('0x10')](function(_0x5d31ac){logger[_0x720d('0x11')]('['+[_0x4aa030[_0x720d('0xe')]()]+']',_0x5d31ac[_0x720d('0x12')]);_0x21248a(_0x5d31ac['message']);});}else{logger[_0x720d('0x17')]('['+[_0x4aa030[_0x720d('0xe')]()]+_0x720d('0x1d'));_0x846597[_0x720d('0x1a')]=_0x846597[_0x720d('0xc')];_0x846597['userEmail']=_0x846597[_0x720d('0x1b')];_0x443443(_0x846597);}});};}function createEndUser(_0x5782cb,_0x55dfc4,_0x260820,_0x22c161,_0x4d9778){logger['info']('['+[_0x5782cb[_0x720d('0xe')]()]+_0x720d('0x1e'),_0x260820);return new Promise(function(_0x37faa7,_0x254d20){var _0x2ecf90={'method':_0x720d('0x1f'),'uri':_0x22c161+'sys_user?'+_0x4d9778,'body':{'user_name':_0x260820[_0x720d('0x20')],'roles':_0x720d('0x21'),'first_name':_0x260820[_0x720d('0x20')],'active':_0x720d('0x19'),'date_format':'System','phone':_0x260820[_0x720d('0x20')]},'auth':_0x55dfc4,'json':!![]};return rp(_0x2ecf90)[_0x720d('0x9')](function(_0x4f7566){logger[_0x720d('0x17')]('['+[_0x5782cb[_0x720d('0xe')]()]+_0x720d('0x22'),_0x4f7566['result']);_0x260820[_0x720d('0x23')]=_0x4f7566[_0x720d('0xa')][_0x720d('0xd')];_0x37faa7(_0x260820);})['catch'](function(_0x246a6d){logger[_0x720d('0x11')]('['+[_0x5782cb[_0x720d('0xe')]()]+']',_0x246a6d[_0x720d('0x12')]);_0x254d20(_0x246a6d[_0x720d('0x12')]);});});}function getEndUser(_0x3d91ab,_0x2af175,_0x4507ea,_0x2428f7,_0x5927cc){return function(_0x28afd8){logger[_0x720d('0x17')]('['+[_0x3d91ab[_0x720d('0xe')]()]+'],\x20getEndUser\x20input\x20crm',_0x28afd8);return new Promise(function(_0x21dc7a,_0x41eda3){var _0xeb2475={'method':'GET','uri':_0x4507ea+_0x720d('0x24')+_0x28afd8[_0x720d('0x20')]+'&'+_0x2428f7+'&'+_0x5927cc,'auth':_0x2af175,'json':!![]};return rp(_0xeb2475)['then'](function(_0x1d6884){if(_0x1d6884[_0x720d('0xa')]['length']>0x0){_0x28afd8['endUserId']=_0x1d6884['result'][0x0]['sys_id'];logger[_0x720d('0x17')]('['+[_0x3d91ab[_0x720d('0xe')]()]+_0x720d('0x25'),_0x28afd8);_0x21dc7a(_0x28afd8);}else{return createEndUser(_0x3d91ab,_0x2af175,_0x28afd8,_0x4507ea,_0x2428f7)[_0x720d('0x9')](function(_0xcc327b){logger[_0x720d('0x17')]('['+[_0x3d91ab[_0x720d('0xe')]()]+_0x720d('0x26'),_0xcc327b);_0x21dc7a(_0xcc327b);});}})[_0x720d('0x10')](function(_0x1e2a84){logger['error']('['+[_0x3d91ab['toUpperCase']()]+']',_0x1e2a84[_0x720d('0x12')]);_0x41eda3(_0x1e2a84['message']);});});};}function getCustomFields(_0x438080,_0x40c230){var _0x48743a={};if(_0x438080[_0x720d('0xb')]>0x0){_[_0x720d('0x27')](_0x438080,function(_0x5dff75){if(_0x5dff75[_0x720d('0x28')]===_0x720d('0x29')&&_0x5dff75[_0x720d('0x2a')]&&!_0x5dff75[_0x720d('0x2b')]){_0x48743a[_0x5dff75['idField'][_0x720d('0x2c')]()]=_0x5dff75['content'][_0x720d('0x2d')]();}else if(_0x5dff75[_0x720d('0x28')]===_0x720d('0x29')&&_0x5dff75['idField']&&_0x5dff75[_0x720d('0x2b')]){_0x48743a[_0x5dff75[_0x720d('0x2e')][_0x720d('0x2c')]()]=_0x5dff75[_0x720d('0x2f')][_0x720d('0x2d')]();}else if(_0x5dff75['type']===_0x720d('0x30')&&_0x5dff75[_0x720d('0x31')]&&_0x5dff75[_0x720d('0x2e')]&&_0x5dff75[_0x720d('0x2b')]){_0x48743a[_0x5dff75['idField'][_0x720d('0x2c')]()]=_0x40c230[_0x5dff75[_0x720d('0x31')]]['toString']();}else if(_0x5dff75['type']==='customVariable'&&_0x5dff75[_0x720d('0x32')]&&_0x5dff75['Variable'][_0x720d('0x33')]&&_0x5dff75[_0x720d('0x2e')]&&_0x5dff75[_0x720d('0x2b')]){_0x48743a[_0x5dff75[_0x720d('0x2e')][_0x720d('0x2c')]()]=_0x40c230[_0x5dff75['Variable'][_0x720d('0x33')][_0x720d('0x2c')]()]['toString']();}});}return _0x48743a;}function getTicket(_0x211245,_0x50b2b0,_0x20665a,_0x889f62,_0x1a1c3d,_0x35022b){return function(_0x4239a9){logger[_0x720d('0x17')]('['+[_0x211245[_0x720d('0xe')]()]+_0x720d('0x34'),_0x4239a9);return new Promise(function(_0x3bb8aa,_0x1dcf3f){var _0x31e1ec=_0x211245[_0x720d('0x2c')]()===_0x720d('0x35')?_0x4239a9[_0x720d('0x1a')]:_0x4239a9[_0x720d('0x23')];var _0x58a8e0={'method':_0x720d('0x1f'),'uri':_0x20665a+_0x720d('0x36')+'?'+_0x35022b,'body':Object[_0x720d('0x37')]({},{'active':_0x720d('0x19'),'caller_id':_0x31e1ec,'assigned_to':_0x4239a9[_0x720d('0x1a')],'short_description':intUtil[_0x720d('0x38')](_0x889f62[_0x720d('0x39')],_0x1a1c3d,'\x20'),'description':intUtil[_0x720d('0x38')](_0x889f62[_0x720d('0x3a')],_0x1a1c3d,'\x0a')},getCustomFields(_0x889f62[_0x720d('0x3b')],_0x1a1c3d)),'auth':_0x50b2b0,'json':!![]};return rp(_0x58a8e0)['then'](function(_0x70f609){logger[_0x720d('0x17')]('['+[_0x211245[_0x720d('0xe')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x70f609[_0x720d('0xa')]);_0x4239a9[_0x720d('0x3c')]=_0x70f609['result'][_0x720d('0xd')];_0x4239a9[_0x720d('0x3d')]=_0x70f609[_0x720d('0xa')][_0x720d('0x3e')];logger[_0x720d('0x17')]('['+[_0x211245[_0x720d('0xe')]()]+_0x720d('0x3f'),_0x4239a9);_0x3bb8aa(_0x4239a9);})[_0x720d('0x10')](function(_0xcdea9f){logger[_0x720d('0x11')]('['+[_0x211245['toUpperCase']()]+']',_0xcdea9f[_0x720d('0x12')]);_0x1dcf3f(_0xcdea9f[_0x720d('0x12')]);});});};}function createRemoteTag(_0x5105fb,_0x34fd7e,_0x3d39a5,_0x2087b9){return new Promise(function(_0x351933,_0x4ec5cf){var _0x3eb75f={'method':_0x720d('0x1f'),'uri':_0x3d39a5+_0x720d('0x40')+'?'+_0x2087b9,'body':{'short_description':_0x5105fb,'global':!![],'active':!![],'name':_0x5105fb},'auth':_0x34fd7e,'json':!![]};return rp(_0x3eb75f)[_0x720d('0x9')](function(_0x365f0e){var _0x2726d3=_0x365f0e[_0x720d('0xa')][_0x720d('0xd')];_0x351933(_0x2726d3);});});}function getRemoteTag(_0x3c761f,_0x5076d1,_0x24248,_0x407192,_0x4f68b2){return new Promise(function(_0x1f4a73,_0x4f5392){var _0x48435b={'method':_0x720d('0x7'),'uri':_0x24248+_0x720d('0x40')+_0x720d('0x41')+_0x3c761f+'&'+_0x407192,'auth':_0x5076d1,'json':!![]};return rp(_0x48435b)[_0x720d('0x9')](function(_0x31e7bf){if(_0x31e7bf[_0x720d('0xa')]['length']>0x0){var _0x195e8a=_0x31e7bf[_0x720d('0xa')][0x0][_0x720d('0xd')];_0x1f4a73(_0x195e8a);}else{return createRemoteTag(_0x3c761f,_0x5076d1,_0x24248,_0x407192)[_0x720d('0x9')](function(_0x34c87b){_0x1f4a73(_0x34c87b);});}});});}function assignTagToIncident(_0x2133f7,_0x5fdbde,_0x56949f,_0x242af0,_0x2fc61a){return new Promise(function(_0x47cc3d,_0x13cc00){var _0x3a92ee={'method':_0x720d('0x1f'),'uri':_0x56949f+_0x720d('0x42')+'?'+_0x2fc61a,'body':{'label':_0x2133f7,'table':_0x720d('0x36'),'id_type':_0x720d('0x43'),'table_key':_0x242af0[_0x720d('0x3c')],'title':_0x720d('0x44')+_0x242af0[_0x720d('0x3d')],'id_display':_0x242af0[_0x720d('0x3d')]},'auth':_0x5fdbde,'json':!![]};return rp(_0x3a92ee)[_0x720d('0x9')](function(_0x348613){_0x47cc3d();})[_0x720d('0x10')](function(){_0x47cc3d();});});}function manageTags(_0x44aab9,_0x3a2f3e,_0x1bc6f9,_0x52f1c3,_0xfb6dec,_0x1cbdf8,_0x10282a){return new Promise(function(_0x2d3aac,_0x26a196){var _0x13e680=[];_0x3a2f3e['forEach'](function(_0x289538){_0x13e680[_0x720d('0x45')](getRemoteTag(_0x289538,_0x1bc6f9,_0x52f1c3,_0x1cbdf8,_0x10282a));});return Promise['all'](_0x13e680)[_0x720d('0x9')](function(_0x1c2f9a){if(_0x1c2f9a[_0x720d('0xb')]){logger['info']('['+[_0x44aab9[_0x720d('0xe')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1c2f9a);var _0x37b899=[];_0x1c2f9a['forEach'](function(_0x4e9bf2){_0x37b899[_0x720d('0x45')](assignTagToIncident(_0x4e9bf2,_0x1bc6f9,_0x52f1c3,_0xfb6dec,_0x1cbdf8));});return Promise[_0x720d('0x46')](_0x37b899)[_0x720d('0x9')](function(){_0x2d3aac();})[_0x720d('0x10')](function(){_0x2d3aac();});}else{_0x2d3aac();}});});}function getTags(_0x40f858,_0x7c1f44,_0xea93f7,_0x4e39a0,_0x37047d,_0x2fde8c){return function(_0x5dc468){return new Promise(function(_0x3e1142,_0x378b0c){var _0x16226a=[];var _0x4d3553=_0x4e39a0[_0x720d('0x47')];if(_0x4d3553&&_0x4d3553[_0x720d('0xb')]>0x0){_0x16226a=_['map'](_0x4d3553,_0x720d('0x33'));}if(_0x16226a['length']>0x0){return manageTags(_0x40f858,_0x16226a,_0x7c1f44,_0xea93f7,_0x5dc468,_0x37047d,_0x2fde8c)[_0x720d('0x9')](function(){_0x3e1142(_0x5dc468);});}else{_0x3e1142(_0x5dc468);}});};}function emit(_0x401654,_0x3b3695,_0x3799d8){var _0x3a30a0='%26sysparm_record_target%3Dincident'+_0x720d('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x720d('0x49');var _0x107260={'uri':_0x401654+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3799d8+_0x3a30a0};io['to'](util[_0x720d('0x4a')]('user:%s',_0x3b3695))[_0x720d('0x4b')](_0x720d('0x4c'),_0x107260);}exports['cs']=function(_0x578060,_0x586233,_0xe8286a,_0x573e55,_0x5f2f93,_0x160d5c,_0x1db9da,_0x5693af){var _0x184b88={};var _0x5e78ce={'user':_0x160d5c[_0x720d('0x4d')],'pass':_0x160d5c[_0x720d('0x4e')]};var _0x4d550a=_0x720d('0x4f');var _0x3480ef=_0x720d('0x50');_0x160d5c[_0x720d('0x51')]=intUtil[_0x720d('0x52')](_0x160d5c[_0x720d('0x51')]);_0x160d5c[_0x720d('0x53')]=intUtil[_0x720d('0x52')](_0x160d5c[_0x720d('0x53')]);var _0x49b10e=util[_0x720d('0x4a')](_0x720d('0x54'),_0x160d5c[_0x720d('0x51')]);_0x184b88[_0x720d('0x15')]=!_['isNil'](_0x573e55)?_0x573e55[_0x720d('0x55')]:null;_0x184b88[_0x720d('0x1b')]=_0x160d5c['email'];_0x184b88[_0x720d('0x20')]=_0x5693af[_0x720d('0x2c')]()==='outbound'?_0x586233['destcalleridnum']:_0x586233[_0x720d('0x56')];_0x184b88['callDirection']=_0x5693af===_0x720d('0x57')||_0x5693af===_0x720d('0x58')?_0x720d('0x57'):_0x720d('0x35');var _0x1afe0c=util[_0x720d('0x4a')](_0x720d('0x59'),_0x160d5c[_0x720d('0x53')],_0x586233[_0x720d('0x5a')],md5(_0x586233[_0x720d('0x5a')]));if(_0x5f2f93&&_0x5f2f93[_0x720d('0x5b')]){logger[_0x720d('0x17')]('[QUEUE]',_0x720d('0x5c'));_0x586233[_0x720d('0x5d')]=_0x1afe0c;}else if(_0x1db9da&&_0x1db9da[_0x720d('0x5e')]&&_0x1db9da[_0x720d('0x5e')]!==_0x720d('0x5f')){logger[_0x720d('0x17')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x586233[_0x720d('0x5d')]=_0x1afe0c;}else{_0x586233[_0x720d('0x5d')]='';}return getAdminUser(_0x5693af,_0x5e78ce,_0x184b88,_0x49b10e,_0x3480ef,_0x4d550a)[_0x720d('0x9')](getUser(_0x5693af,_0x5e78ce,_0x49b10e,_0x3480ef,_0x4d550a))['then'](getEndUser(_0x5693af,_0x5e78ce,_0x49b10e,_0x3480ef,_0x4d550a))[_0x720d('0x9')](getTicket(_0x5693af,_0x5e78ce,_0x49b10e,_0xe8286a,_0x586233,_0x3480ef))[_0x720d('0x9')](function(_0x4f3602){logger[_0x720d('0x17')](util[_0x720d('0x4a')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4f3602[_0x720d('0x3c')]));logger['info'](util[_0x720d('0x4a')](_0x720d('0x60'),_0x5693af));if(_0x5693af!==_0x720d('0x58')){logger[_0x720d('0x17')]('['+[_0x5693af[_0x720d('0xe')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x160d5c[_0x720d('0x51')],_0x573e55[_0x720d('0x33')],_0x4f3602[_0x720d('0x3c')]);}})['catch'](function(_0x49da6b){logger[_0x720d('0x11')]('['+[_0x5693af[_0x720d('0xe')]()]+_0x720d('0x61'),util[_0x720d('0x62')](_0x49da6b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1629=['name',']\x20getTicket\x20input\x20crm','outbound','POST','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','GET','],\x20createEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','customVariable','Variable'];(function(_0x3bda0d,_0x38ae3d){var _0x196178=function(_0x160cb8){while(--_0x160cb8){_0x3bda0d['push'](_0x3bda0d['shift']());}};_0x196178(++_0x38ae3d);}(_0x1629,0x1d8));var _0x9162=function(_0x34d0cf,_0xbaf527){_0x34d0cf=_0x34d0cf-0x0;var _0x3b5561=_0x1629[_0x34d0cf];return _0x3b5561;};'use strict';var _=require(_0x9162('0x0'));var Promise=require(_0x9162('0x1'));var rp=require(_0x9162('0x2'));var util=require(_0x9162('0x3'));var md5=require('md5');var Redis=require(_0x9162('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x9162('0x5'))(_0x9162('0x6'));config['redis']=_['defaults'](config[_0x9162('0x7')],{'host':_0x9162('0x8'),'port':0x18eb});var io=require(_0x9162('0x9'))(new Redis(config[_0x9162('0x7')]));function getAdminUser(_0x11d90b,_0x168267,_0x4caf9b,_0x4eec2d,_0x4abb1d,_0xbeefd3){return new Promise(function(_0x32bb33,_0x5900c2){var _0x12e8a5={'method':'GET','uri':_0x4eec2d+_0x9162('0xa')+'&'+_0x4abb1d+'&'+_0xbeefd3,'auth':_0x168267,'json':!![]};return rp(_0x12e8a5)[_0x9162('0xb')](function(_0x59def2){if(_0x59def2[_0x9162('0xc')][_0x9162('0xd')]>0x0){_0x4caf9b['adminId']=_0x59def2[_0x9162('0xc')][0x0][_0x9162('0xe')];}logger[_0x9162('0xf')]('['+[_0x11d90b[_0x9162('0x10')]()]+_0x9162('0x11'),_0x4caf9b);_0x32bb33(_0x4caf9b);})[_0x9162('0x12')](function(_0xdb1819){logger[_0x9162('0x13')]('['+[_0x11d90b[_0x9162('0x10')]()]+']',_0xdb1819[_0x9162('0x14')]);_0x5900c2(_0xdb1819[_0x9162('0x14')]);});});}function getUser(_0x491e44,_0x1bc9aa,_0x299fea,_0x4bd627,_0x26de64){return function(_0x2585d0){logger[_0x9162('0xf')]('['+[_0x491e44[_0x9162('0x10')]()]+_0x9162('0x15'),_0x2585d0);return new Promise(function(_0xa259c2,_0x3f5344){if(intUtil[_0x9162('0x16')](_0x2585d0[_0x9162('0x17')])){var _0x26afe3={'method':'GET','uri':_0x299fea+'sys_user?sysparm_query=email%3D'+_0x2585d0[_0x9162('0x17')]+'&'+_0x4bd627+'&'+_0x26de64,'auth':_0x1bc9aa,'json':!![]};logger[_0x9162('0xf')]('['+[_0x491e44[_0x9162('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x26afe3);return rp(_0x26afe3)[_0x9162('0xb')](function(_0x4fbd09){logger['info']('['+[_0x491e44[_0x9162('0x10')]()]+_0x9162('0x18'),_0x4fbd09);if(_0x4fbd09[_0x9162('0xc')][_0x9162('0xd')]>0x0&&String(_0x4fbd09[_0x9162('0xc')][0x0][_0x9162('0x19')])===_0x9162('0x1a')){_0x2585d0[_0x9162('0x1b')]=_0x4fbd09[_0x9162('0xc')][0x0][_0x9162('0xe')];}else{_0x2585d0[_0x9162('0x1b')]=_0x2585d0[_0x9162('0x1c')];_0x2585d0[_0x9162('0x17')]=_0x2585d0[_0x9162('0x1d')];}logger[_0x9162('0xf')]('['+[_0x491e44[_0x9162('0x10')]()]+_0x9162('0x1e'),_0x2585d0);_0xa259c2(_0x2585d0);})[_0x9162('0x12')](function(_0x15f00c){logger[_0x9162('0x13')]('['+[_0x491e44[_0x9162('0x10')]()]+']',_0x15f00c[_0x9162('0x14')]);_0x3f5344(_0x15f00c[_0x9162('0x14')]);});}else{logger[_0x9162('0xf')]('['+[_0x491e44[_0x9162('0x10')]()]+']\x20using\x20admin\x20profile');_0x2585d0[_0x9162('0x1b')]=_0x2585d0[_0x9162('0x1c')];_0x2585d0[_0x9162('0x17')]=_0x2585d0[_0x9162('0x1d')];_0xa259c2(_0x2585d0);}});};}function createEndUser(_0x5af84f,_0x5cba0b,_0x1511ff,_0x594d42,_0x158056){logger[_0x9162('0xf')]('['+[_0x5af84f[_0x9162('0x10')]()]+_0x9162('0x1f'),_0x1511ff);return new Promise(function(_0x46c5d7,_0x5225c7){var _0x208235={'method':'POST','uri':_0x594d42+_0x9162('0x20')+_0x158056,'body':{'user_name':_0x1511ff[_0x9162('0x21')],'roles':_0x9162('0x22'),'first_name':_0x1511ff['endUserNumber'],'active':'true','date_format':'System','phone':_0x1511ff[_0x9162('0x21')]},'auth':_0x5cba0b,'json':!![]};return rp(_0x208235)[_0x9162('0xb')](function(_0xee7764){logger[_0x9162('0xf')]('['+[_0x5af84f['toUpperCase']()]+_0x9162('0x23'),_0xee7764[_0x9162('0xc')]);_0x1511ff[_0x9162('0x24')]=_0xee7764[_0x9162('0xc')][_0x9162('0xe')];_0x46c5d7(_0x1511ff);})[_0x9162('0x12')](function(_0x56b1b9){logger[_0x9162('0x13')]('['+[_0x5af84f[_0x9162('0x10')]()]+']',_0x56b1b9[_0x9162('0x14')]);_0x5225c7(_0x56b1b9['message']);});});}function getEndUser(_0x45338e,_0x23a06f,_0x23dfc7,_0x21cd3a,_0x4bb62e){return function(_0x28ed41){logger[_0x9162('0xf')]('['+[_0x45338e[_0x9162('0x10')]()]+_0x9162('0x25'),_0x28ed41);return new Promise(function(_0x1e3ed4,_0x539092){var _0x4a806f={'method':_0x9162('0x26'),'uri':_0x23dfc7+'sys_user?sysparm_query=phone%3D'+_0x28ed41['endUserNumber']+'&'+_0x21cd3a+'&'+_0x4bb62e,'auth':_0x23a06f,'json':!![]};return rp(_0x4a806f)[_0x9162('0xb')](function(_0xce29c7){if(_0xce29c7['result'][_0x9162('0xd')]>0x0){_0x28ed41[_0x9162('0x24')]=_0xce29c7['result'][0x0]['sys_id'];logger[_0x9162('0xf')]('['+[_0x45338e['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x28ed41);_0x1e3ed4(_0x28ed41);}else{return createEndUser(_0x45338e,_0x23a06f,_0x28ed41,_0x23dfc7,_0x21cd3a)[_0x9162('0xb')](function(_0x46613a){logger[_0x9162('0xf')]('['+[_0x45338e[_0x9162('0x10')]()]+_0x9162('0x27'),_0x46613a);_0x1e3ed4(_0x46613a);});}})['catch'](function(_0x26bc99){logger[_0x9162('0x13')]('['+[_0x45338e[_0x9162('0x10')]()]+']',_0x26bc99[_0x9162('0x14')]);_0x539092(_0x26bc99[_0x9162('0x14')]);});});};}function getCustomFields(_0x485776,_0x28b533){var _0x1078d5={};if(_0x485776[_0x9162('0xd')]>0x0){_[_0x9162('0x28')](_0x485776,function(_0x25fb83){if(_0x25fb83[_0x9162('0x29')]===_0x9162('0x2a')&&_0x25fb83[_0x9162('0x2b')]&&!_0x25fb83[_0x9162('0x2c')]){_0x1078d5[_0x25fb83[_0x9162('0x2d')][_0x9162('0x2e')]()]=_0x25fb83[_0x9162('0x2f')][_0x9162('0x30')]();}else if(_0x25fb83[_0x9162('0x29')]==='string'&&_0x25fb83[_0x9162('0x2d')]&&_0x25fb83[_0x9162('0x2c')]){_0x1078d5[_0x25fb83[_0x9162('0x2d')]['toLowerCase']()]=_0x25fb83['content'][_0x9162('0x30')]();}else if(_0x25fb83['type']===_0x9162('0x31')&&_0x25fb83[_0x9162('0x32')]&&_0x25fb83[_0x9162('0x2d')]&&_0x25fb83[_0x9162('0x2c')]){_0x1078d5[_0x25fb83['idField'][_0x9162('0x2e')]()]=_0x28b533[_0x25fb83[_0x9162('0x32')]][_0x9162('0x30')]();}else if(_0x25fb83[_0x9162('0x29')]===_0x9162('0x33')&&_0x25fb83[_0x9162('0x34')]&&_0x25fb83[_0x9162('0x34')][_0x9162('0x35')]&&_0x25fb83[_0x9162('0x2d')]&&_0x25fb83[_0x9162('0x2c')]){_0x1078d5[_0x25fb83[_0x9162('0x2d')][_0x9162('0x2e')]()]=_0x28b533[_0x25fb83[_0x9162('0x34')][_0x9162('0x35')][_0x9162('0x2e')]()]['toString']();}});}return _0x1078d5;}function getTicket(_0x4f7e3f,_0x2f5c73,_0x50ce24,_0x191575,_0x9ac8b2,_0x1deb34){return function(_0x3a1f39){logger[_0x9162('0xf')]('['+[_0x4f7e3f[_0x9162('0x10')]()]+_0x9162('0x36'),_0x3a1f39);return new Promise(function(_0x3cf16e,_0x56a9d4){var _0x20baab=_0x4f7e3f[_0x9162('0x2e')]()===_0x9162('0x37')?_0x3a1f39['userId']:_0x3a1f39[_0x9162('0x24')];var _0x1fd3d8={'method':_0x9162('0x38'),'uri':_0x50ce24+'incident'+'?'+_0x1deb34,'body':Object[_0x9162('0x39')]({},{'active':_0x9162('0x1a'),'caller_id':_0x20baab,'assigned_to':_0x3a1f39[_0x9162('0x1b')],'short_description':intUtil[_0x9162('0x3a')](_0x191575[_0x9162('0x3b')],_0x9ac8b2,'\x20'),'description':intUtil[_0x9162('0x3a')](_0x191575[_0x9162('0x3c')],_0x9ac8b2,'\x0a')},getCustomFields(_0x191575[_0x9162('0x3d')],_0x9ac8b2)),'auth':_0x2f5c73,'json':!![]};return rp(_0x1fd3d8)[_0x9162('0xb')](function(_0x9f15ce){logger[_0x9162('0xf')]('['+[_0x4f7e3f[_0x9162('0x10')]()]+_0x9162('0x3e'),_0x9f15ce[_0x9162('0xc')]);_0x3a1f39[_0x9162('0x3f')]=_0x9f15ce[_0x9162('0xc')][_0x9162('0xe')];_0x3a1f39[_0x9162('0x40')]=_0x9f15ce[_0x9162('0xc')][_0x9162('0x41')];logger[_0x9162('0xf')]('['+[_0x4f7e3f[_0x9162('0x10')]()]+_0x9162('0x42'),_0x3a1f39);_0x3cf16e(_0x3a1f39);})[_0x9162('0x12')](function(_0x33fe42){logger['error']('['+[_0x4f7e3f['toUpperCase']()]+']',_0x33fe42[_0x9162('0x14')]);_0x56a9d4(_0x33fe42[_0x9162('0x14')]);});});};}function createRemoteTag(_0x4b1892,_0xa8a6,_0xfadabb,_0x2db732){return new Promise(function(_0x3afc8e,_0x566d5b){var _0x48f45e={'method':'POST','uri':_0xfadabb+_0x9162('0x43')+'?'+_0x2db732,'body':{'short_description':_0x4b1892,'global':!![],'active':!![],'name':_0x4b1892},'auth':_0xa8a6,'json':!![]};return rp(_0x48f45e)['then'](function(_0x199e1f){var _0x42c770=_0x199e1f[_0x9162('0xc')][_0x9162('0xe')];_0x3afc8e(_0x42c770);});});}function getRemoteTag(_0x19ce92,_0x1ac8fa,_0x221664,_0x295f17,_0x46ddff){return new Promise(function(_0x5a7d8f,_0x4b320c){var _0x8859d3={'method':_0x9162('0x26'),'uri':_0x221664+_0x9162('0x43')+_0x9162('0x44')+_0x19ce92+'&'+_0x295f17,'auth':_0x1ac8fa,'json':!![]};return rp(_0x8859d3)['then'](function(_0x1a8494){if(_0x1a8494[_0x9162('0xc')][_0x9162('0xd')]>0x0){var _0x25daab=_0x1a8494[_0x9162('0xc')][0x0][_0x9162('0xe')];_0x5a7d8f(_0x25daab);}else{return createRemoteTag(_0x19ce92,_0x1ac8fa,_0x221664,_0x295f17)[_0x9162('0xb')](function(_0x3c23d6){_0x5a7d8f(_0x3c23d6);});}});});}function assignTagToIncident(_0x2159fc,_0x3ab061,_0x22f52e,_0xa3af61,_0x415f18){return new Promise(function(_0x3bdae0,_0x29c442){var _0x54221b={'method':_0x9162('0x38'),'uri':_0x22f52e+'label_entry'+'?'+_0x415f18,'body':{'label':_0x2159fc,'table':'incident','id_type':_0x9162('0x45'),'table_key':_0xa3af61['ticketId'],'title':_0x9162('0x46')+_0xa3af61['ticketNumber'],'id_display':_0xa3af61['ticketNumber']},'auth':_0x3ab061,'json':!![]};return rp(_0x54221b)[_0x9162('0xb')](function(_0x41e486){_0x3bdae0();})[_0x9162('0x12')](function(){_0x3bdae0();});});}function manageTags(_0xbd8d81,_0x25bedd,_0x7c2ce5,_0x175b5a,_0x659a48,_0x378810,_0xbdc5dc){return new Promise(function(_0x5b39c8,_0x3a6f83){var _0x177300=[];_0x25bedd[_0x9162('0x28')](function(_0x2181b0){_0x177300['push'](getRemoteTag(_0x2181b0,_0x7c2ce5,_0x175b5a,_0x378810,_0xbdc5dc));});return Promise[_0x9162('0x47')](_0x177300)[_0x9162('0xb')](function(_0x4a14ca){if(_0x4a14ca[_0x9162('0xd')]){logger[_0x9162('0xf')]('['+[_0xbd8d81['toUpperCase']()]+_0x9162('0x48'),_0x4a14ca);var _0x220862=[];_0x4a14ca[_0x9162('0x28')](function(_0x2f1433){_0x220862[_0x9162('0x49')](assignTagToIncident(_0x2f1433,_0x7c2ce5,_0x175b5a,_0x659a48,_0x378810));});return Promise[_0x9162('0x47')](_0x220862)[_0x9162('0xb')](function(){_0x5b39c8();})['catch'](function(){_0x5b39c8();});}else{_0x5b39c8();}});});}function getTags(_0x3d862c,_0x337c47,_0x5c83f3,_0x647960,_0x20ef6d,_0x164c9a){return function(_0x404092){return new Promise(function(_0x40adfb,_0x3a7047){var _0x180e53=[];var _0xe03fa6=_0x647960['Tags'];if(_0xe03fa6&&_0xe03fa6[_0x9162('0xd')]>0x0){_0x180e53=_['map'](_0xe03fa6,_0x9162('0x35'));}if(_0x180e53[_0x9162('0xd')]>0x0){return manageTags(_0x3d862c,_0x180e53,_0x337c47,_0x5c83f3,_0x404092,_0x20ef6d,_0x164c9a)[_0x9162('0xb')](function(){_0x40adfb(_0x404092);});}else{_0x40adfb(_0x404092);}});};}function emit(_0x50be43,_0x1d79fe,_0x482aad){var _0x7c5ccc=_0x9162('0x4a')+_0x9162('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x9162('0x4c');var _0x4a656a={'uri':_0x50be43+_0x9162('0x4d')+_0x482aad+_0x7c5ccc};io['to'](util[_0x9162('0x4e')]('user:%s',_0x1d79fe))['emit'](_0x9162('0x4f'),_0x4a656a);}exports['cs']=function(_0x57f053,_0x2d5c70,_0xd5a560,_0x519f17,_0x2f9b22,_0x3241bd,_0x5b5cea,_0x38e111){var _0x916fdf={};var _0x27c2a6={'user':_0x3241bd[_0x9162('0x50')],'pass':_0x3241bd['password']};var _0x2bb4c2=_0x9162('0x51');var _0x1e85e0=_0x9162('0x52');_0x3241bd['remoteUri']=intUtil[_0x9162('0x53')](_0x3241bd[_0x9162('0x54')]);_0x3241bd[_0x9162('0x55')]=intUtil[_0x9162('0x53')](_0x3241bd[_0x9162('0x55')]);var _0x32a5ec=util[_0x9162('0x4e')](_0x9162('0x56'),_0x3241bd['remoteUri']);_0x916fdf[_0x9162('0x17')]=!_[_0x9162('0x57')](_0x519f17)?_0x519f17[_0x9162('0x58')]:null;_0x916fdf[_0x9162('0x1d')]=_0x3241bd[_0x9162('0x58')];_0x916fdf[_0x9162('0x21')]=_0x38e111[_0x9162('0x2e')]()==='outbound'?_0x2d5c70[_0x9162('0x59')]:_0x2d5c70[_0x9162('0x5a')];_0x916fdf[_0x9162('0x5b')]=_0x38e111===_0x9162('0x5c')||_0x38e111==='abandoned'?'queue':_0x9162('0x37');var _0x3b22ef=util[_0x9162('0x4e')](_0x9162('0x5d'),_0x3241bd['serverUrl'],_0x2d5c70[_0x9162('0x5e')],md5(_0x2d5c70['uniqueid']));if(_0x2f9b22&&_0x2f9b22['monitor_format']){logger[_0x9162('0xf')](_0x9162('0x5f'),_0x9162('0x60'));_0x2d5c70[_0x9162('0x61')]=_0x3b22ef;}else if(_0x5b5cea&&_0x5b5cea['recordingFormat']&&_0x5b5cea[_0x9162('0x62')]!==_0x9162('0x63')){logger['info'](_0x9162('0x64'),_0x9162('0x60'));_0x2d5c70[_0x9162('0x61')]=_0x3b22ef;}else{_0x2d5c70[_0x9162('0x61')]='';}return getAdminUser(_0x38e111,_0x27c2a6,_0x916fdf,_0x32a5ec,_0x1e85e0,_0x2bb4c2)[_0x9162('0xb')](getUser(_0x38e111,_0x27c2a6,_0x32a5ec,_0x1e85e0,_0x2bb4c2))[_0x9162('0xb')](getEndUser(_0x38e111,_0x27c2a6,_0x32a5ec,_0x1e85e0,_0x2bb4c2))[_0x9162('0xb')](getTicket(_0x38e111,_0x27c2a6,_0x32a5ec,_0xd5a560,_0x2d5c70,_0x1e85e0))[_0x9162('0xb')](function(_0x42656a){logger[_0x9162('0xf')](util[_0x9162('0x4e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x42656a[_0x9162('0x3f')]));logger[_0x9162('0xf')](util['format'](_0x9162('0x65'),_0x38e111));if(_0x38e111!=='abandoned'){logger['info']('['+[_0x38e111[_0x9162('0x10')]()]+']',_0x9162('0x66'));emit(_0x3241bd[_0x9162('0x54')],_0x519f17['name'],_0x42656a[_0x9162('0x3f')]);}})[_0x9162('0x12')](function(_0x570d36){logger[_0x9162('0x13')]('['+[_0x38e111[_0x9162('0x10')]()]+_0x9162('0x67'),util[_0x9162('0x68')](_0x570d36,{'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 8d2d5d6..10d5bc6 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 _0x29ad=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','uri','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','Fields','Outbound','contacts','abandoned','[ABANDONED]','isNil','error','request-promise','util','./util','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','replace','duration_hours','duration_minutes','Contacts','parent_name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','base64','get_server_info','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','value','Agent\x20found!','name_value_list','resolve','user_id','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','entry_list','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','customVariable','Variable','POST','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x1934b9,_0x23b3a3){var _0x307bf1=function(_0x5d2d0c){while(--_0x5d2d0c){_0x1934b9['push'](_0x1934b9['shift']());}};_0x307bf1(++_0x23b3a3);}(_0x29ad,0x16b));var _0xd29a=function(_0x3dbf2e,_0x408a7b){_0x3dbf2e=_0x3dbf2e-0x0;var _0x2f6a55=_0x29ad[_0x3dbf2e];return _0x2f6a55;};'use strict';var _=require('lodash');var rp=require(_0xd29a('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xd29a('0x1'));var Redis=require('ioredis');var intUtil=require(_0xd29a('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0xd29a('0x3')]=_[_0xd29a('0x4')](config[_0xd29a('0x3')],{'host':_0xd29a('0x5'),'port':0x18eb});var io=require(_0xd29a('0x6'))(new Redis(config[_0xd29a('0x3')]));var def={'method':'POST','json':!![]};function emit(_0x4545f5,_0x43362f,_0x1c7c4c){io['to'](_0x4545f5)[_0xd29a('0x7')](_0x43362f,_0x1c7c4c);}function getTicket(_0xb6009e,_0x5aa8f0,_0x38f6c2,_0x12ab62,_0x3d0f94,_0x57173b,_0x35c8f3,_0x15f86b){logger[_0xd29a('0x8')](_0xd29a('0x9'));var _0x3648c4=new Date();var _0x4e220b=[{'name':_0xd29a('0xa'),'value':intUtil[_0xd29a('0xb')](_0x12ab62[_0xd29a('0xc')],_0x3d0f94,'\x20')},{'name':_0xd29a('0xd'),'value':_0x5aa8f0['id']},{'name':_0xd29a('0xe'),'value':_0x5aa8f0['id']},{'name':'description','value':intUtil[_0xd29a('0xb')](_0x12ab62[_0xd29a('0xf')],_0x3d0f94,'\x0a')},{'name':'date_start','value':_0x3648c4['toISOString']()['slice'](0x0,0x13)[_0xd29a('0x10')]('T','\x20')},{'name':_0xd29a('0x11'),'value':'0'},{'name':_0xd29a('0x12'),'value':'15'},{'name':'parent_id','value':_0x38f6c2['id']},{'name':'parent_type','value':_0xd29a('0x13')},{'name':_0xd29a('0x14'),'value':_0x38f6c2[_0xd29a('0xa')]},{'name':'direction','value':_0x15f86b}];if(_0x57173b[_0xd29a('0x15')]){_[_0xd29a('0x16')](_0x57173b,function(_0xe1f65c){if(_0x3d0f94[_0xe1f65c[_0xd29a('0x17')]]){_0x4e220b[_0xd29a('0x18')]({'name':_0xe1f65c[_0xd29a('0x19')],'value':_0x3d0f94[_0xe1f65c[_0xd29a('0x17')]]});}});}return request({'form':{'method':_0xd29a('0x1a'),'input_type':_0xd29a('0x1b'),'response_type':_0xd29a('0x1b'),'rest_data':JSON[_0xd29a('0x1c')]({'session':_0x35c8f3['id'],'module_name':_0xd29a('0x1d'),'name_value_list':_0x4e220b})}});}function getAuth(_0x23a62d){return util[_0xd29a('0x1e')](_0xd29a('0x1f'),new Buffer(_0x23a62d['apiKey']+':X')['toString'](_0xd29a('0x20')));}function getServerInfo(_0x22c9d2){return request({'form':{'method':_0xd29a('0x21'),'input_type':_0xd29a('0x1b'),'response_type':_0xd29a('0x1b'),'rest_data':JSON[_0xd29a('0x1c')]({'session':_0x22c9d2['id']})}});}function getUser(_0x589cad,_0xe7e5bd,_0x2c1a14){if(!_['isNil'](_0xe7e5bd)){logger[_0xd29a('0x8')]('Getting\x20agent\x20with\x20name',_0xe7e5bd);return request({'form':{'method':'get_entry_list','input_type':_0xd29a('0x1b'),'response_type':'JSON','rest_data':JSON[_0xd29a('0x1c')]({'session':_0x2c1a14['id'],'module_name':_0xd29a('0x22'),'query':util['format'](_0xd29a('0x23'),_0xe7e5bd),'order_by':'','offset':'0','select_fields':['id',_0xd29a('0xa'),_0xd29a('0x24')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd29a('0x25')](function(_0x377f30){if(_0x377f30['entry_list'][_0xd29a('0x15')]){var _0x12ce31=_[_0xd29a('0x26')](_0x377f30['entry_list'],function(_0x2df329){return _0x2df329['name_value_list'][_0xd29a('0x24')][_0xd29a('0x27')]===_0xe7e5bd;});if(_0x12ce31){logger[_0xd29a('0x8')](_0xd29a('0x28'));return BPromise['resolve']({'id':_0x12ce31[_0xd29a('0x29')]['id'][_0xd29a('0x27')],'name':_0x12ce31[_0xd29a('0x29')]['name'][_0xd29a('0x27')]});}}logger[_0xd29a('0x8')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xd29a('0x2a')]({'id':_0x2c1a14[_0xd29a('0x29')][_0xd29a('0x2b')]['value'],'name':_0x2c1a14[_0xd29a('0x29')][_0xd29a('0x24')]['value']});});}else{logger[_0xd29a('0x8')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2c1a14[_0xd29a('0x29')][_0xd29a('0x2b')][_0xd29a('0x27')],'name':_0x2c1a14['name_value_list'][_0xd29a('0x24')][_0xd29a('0x27')]});}}function getEndUser(_0x80b42d,_0x229e15,_0x163451,_0x4d81fe){logger[_0xd29a('0x8')]('Searching\x20enduser\x20with\x20phone',_0x163451);return request({'form':{'method':_0xd29a('0x2c'),'input_type':_0xd29a('0x1b'),'response_type':_0xd29a('0x1b'),'rest_data':JSON[_0xd29a('0x1c')]({'session':_0x4d81fe['id'],'module_name':_0xd29a('0x13'),'query':util['format'](_0xd29a('0x2d'),_0x163451),'order_by':'','offset':'0','select_fields':['id',_0xd29a('0xa'),_0xd29a('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x367bd7){if(_0x367bd7['entry_list'][_0xd29a('0x15')]){var _0xb08a9a=_['find'](_0x367bd7[_0xd29a('0x2f')],function(_0x33267e){return _0x33267e[_0xd29a('0x29')][_0xd29a('0x2e')][_0xd29a('0x27')]===_0x163451;});if(_0xb08a9a){logger[_0xd29a('0x8')]('Enduser\x20found!');return BPromise[_0xd29a('0x2a')]({'id':_0xb08a9a[_0xd29a('0x29')]['id'][_0xd29a('0x27')],'name':_0xb08a9a[_0xd29a('0x29')]['name']['value'],'phone':_0xb08a9a[_0xd29a('0x29')][_0xd29a('0x2e')][_0xd29a('0x27')]});}}else{logger[_0xd29a('0x8')](_0xd29a('0x30'));return request({'form':{'method':'set_entry','input_type':_0xd29a('0x1b'),'response_type':_0xd29a('0x1b'),'rest_data':JSON['stringify']({'session':_0x4d81fe['id'],'module_name':_0xd29a('0x13'),'name_value_list':[{'name':_0xd29a('0x31'),'value':_0x229e15!==_0xd29a('0x32')?_0x229e15:util['format'](_0xd29a('0x33'),_0x163451)},{'name':'phone_home','value':_0x163451}]})}})['then'](function(_0x5ef57d){logger[_0xd29a('0x8')](_0xd29a('0x34'));return BPromise['resolve']({'id':_0x5ef57d['id'],'name':_0x5ef57d[_0xd29a('0x2f')]['first_name'][_0xd29a('0x27')],'phone':_0x5ef57d[_0xd29a('0x2f')][_0xd29a('0x2e')][_0xd29a('0x27')]});});}});}function request(_0x36f21f){logger[_0xd29a('0x35')](_0xd29a('0x36'),JSON['stringify'](_0x36f21f));return rp(_[_0xd29a('0x37')](def,_0x36f21f));}function getTags(_0x2dc3b3,_0x4d266b){var _0x276ab1=[];if(_0x2dc3b3&&_0x2dc3b3[_0xd29a('0x15')]>0x0){_0x276ab1=_[_0xd29a('0x38')](_0x2dc3b3,_0x4d266b);}return _0x276ab1;}function getCustomFields(_0x35d953,_0xb0e5b2){var _0x3b5772=[];var _0x3df4a5={'custom_fields':[]};if(_0x35d953[_0xd29a('0x15')]>0x0){_[_0xd29a('0x16')](_0x35d953,function(_0x51b79c){if(_0x51b79c[_0xd29a('0x39')]===_0xd29a('0x3a')&&_0x51b79c[_0xd29a('0x3b')]&&!_0x51b79c[_0xd29a('0x3c')]){_0x3df4a5[_0x51b79c[_0xd29a('0x3b')][_0xd29a('0x3d')]()]=_0x51b79c['content'][_0xd29a('0x3e')]();}else if(_0x51b79c[_0xd29a('0x39')]==='string'&&_0x51b79c[_0xd29a('0x19')]&&_0x51b79c[_0xd29a('0x3c')]){_0x3df4a5[_0xd29a('0x3f')][_0xd29a('0x18')]({'id':_0x51b79c[_0xd29a('0x19')],'value':_0x51b79c[_0xd29a('0x40')][_0xd29a('0x3e')]()});}else if(_0x51b79c[_0xd29a('0x39')]===_0xd29a('0x41')&&_0x51b79c[_0xd29a('0x17')]&&_0x51b79c[_0xd29a('0x19')]&&_0x51b79c['customField']){_0xb0e5b2[_0x51b79c[_0xd29a('0x17')]]&&_0x3df4a5[_0xd29a('0x3f')][_0xd29a('0x18')]({'id':_0x51b79c['idField'],'value':_0xb0e5b2[_0x51b79c[_0xd29a('0x17')]][_0xd29a('0x3e')]()});}else if(_0x51b79c[_0xd29a('0x39')]===_0xd29a('0x42')&&_0x51b79c[_0xd29a('0x43')]&&_0x51b79c[_0xd29a('0x43')][_0xd29a('0xa')]&&_0x51b79c[_0xd29a('0x19')]&&_0x51b79c[_0xd29a('0x3c')]){_0xb0e5b2[_0x51b79c[_0xd29a('0x43')]['name']['toLowerCase']()]&&_0x3df4a5['custom_fields']['push']({'id':_0x51b79c[_0xd29a('0x19')],'value':_0xb0e5b2[_0x51b79c[_0xd29a('0x43')][_0xd29a('0xa')]['toLowerCase']()][_0xd29a('0x3e')]()});}});}return _0x3df4a5;}function getConnection(_0x157823){return request({'method':_0xd29a('0x44'),'form':{'method':'login','input_type':_0xd29a('0x1b'),'response_type':_0xd29a('0x1b'),'rest_data':JSON[_0xd29a('0x1c')]({'user_auth':{'user_name':_0x157823['username'],'password':_0x157823[_0xd29a('0x45')],'encryption':'PLAIN'},'application':_0xd29a('0x46')})}})[_0xd29a('0x25')](function(_0x515590){var _0x312721=_0x515590;if(_0x312721['id']){def[_0xd29a('0x47')]=_0x312721['id'];return BPromise['resolve'](_0x312721);}else{throw new Error(util[_0xd29a('0x1e')](_0xd29a('0x48'),_0x157823['id']));}});}function setRelationship(_0x1a0b46,_0x5d9f0b,_0x3c7bd1,_0x3ebffa){return request({'form':{'method':_0xd29a('0x49'),'input_type':_0xd29a('0x1b'),'response_type':_0xd29a('0x1b'),'rest_data':JSON[_0xd29a('0x1c')]({'session':_0x1a0b46['id'],'module_name':_0xd29a('0x1d'),'module_id':_0x3c7bd1['id'],'link_field_name':_0x3ebffa,'related_ids':[_0x5d9f0b['id']]})}});}exports['queue']=function(_0x1b8eff,_0x63eba0,_0x40892a,_0x18e86f,_0x5badfc,_0x423381){var _0x5b2f9b,_0x2890b5,_0x49ddc5,_0x1660ae;_0x423381[_0xd29a('0x4a')]=intUtil[_0xd29a('0x4b')](_0x423381['remoteUri']);_0x423381[_0xd29a('0x4c')]=intUtil['stripTrailingSlash'](_0x423381['serverUrl']);def['uri']=util['format'](_0xd29a('0x4d'),_0x423381[_0xd29a('0x4a')]);if(_0x5badfc&&_0x5badfc[_0xd29a('0x4e')]){logger[_0xd29a('0x8')](_0xd29a('0x4f'),_0xd29a('0x50'));_0x63eba0[_0xd29a('0x51')]=util['format'](_0xd29a('0x52'),_0x423381['serverUrl'],_0x63eba0[_0xd29a('0x53')],md5(_0x63eba0[_0xd29a('0x53')]));}else{_0x63eba0[_0xd29a('0x51')]='';}return getConnection(_0x423381)[_0xd29a('0x25')](function(_0x4c8360){_0x1660ae=_0x4c8360;return getUser(_0x423381,_0x18e86f[_0xd29a('0xa')],_0x1660ae);})[_0xd29a('0x25')](function(_0x6aa0dc){_0x5b2f9b=_0x6aa0dc;logger[_0xd29a('0x8')]('The\x20User\x20ID\x20is:',_0x5b2f9b['id']);return getEndUser(_0x423381,_0x63eba0[_0xd29a('0x54')],_0x63eba0[_0xd29a('0x55')],_0x1660ae);})[_0xd29a('0x25')](function(_0x164ffe){_0x2890b5=_0x164ffe;logger[_0xd29a('0x8')](_0xd29a('0x56'),_0x2890b5['id']);return getTicket(_0x423381,_0x5b2f9b,_0x2890b5,_0x40892a,_0x63eba0,_0x40892a['Fields'],_0x1660ae,'Inbound');})[_0xd29a('0x25')](function(_0xf4a4be){_0x49ddc5=_0xf4a4be;logger[_0xd29a('0x8')](_0xd29a('0x57'));logger['info'](_0xd29a('0x58'),_0x49ddc5['id']);return setRelationship(_0x1660ae,_0x5b2f9b,_0x49ddc5,_0xd29a('0x59'));})['then'](function(){return setRelationship(_0x1660ae,_0x2890b5,_0x49ddc5,'contacts');})['then'](function(){return getServerInfo(_0x1660ae);})[_0xd29a('0x25')](function(_0x41cced){var _0x4f4fd2=parseInt(_0x41cced[_0xd29a('0x5a')][_0xd29a('0x5b')](0x0));var _0x3da46e=util['format'](_0xd29a('0x5c'),_0x423381[_0xd29a('0x4a')],_0x49ddc5['id']);if(_0x4f4fd2>0x6){_0x3da46e=util[_0xd29a('0x1e')](_0xd29a('0x5d'),_0x423381[_0xd29a('0x4a')],_0x49ddc5['id']);}logger[_0xd29a('0x8')](_0xd29a('0x4f'),_0xd29a('0x5e'));emit(util[_0xd29a('0x1e')](_0xd29a('0x5f'),_0x18e86f[_0xd29a('0xa')]),_0xd29a('0x60'),{'uri':_0x3da46e});})[_0xd29a('0x61')](function(_0x3f86a3){logger['error'](_0xd29a('0x4f'),JSON[_0xd29a('0x1c')](_0x3f86a3));});};exports[_0xd29a('0x62')]=function(_0x478963,_0x1e329c,_0x52fd5a,_0x334d99,_0xb44673,_0xbfb4d6,_0x2f9fd3){var _0x2af5cb,_0x5b65c9,_0x284091,_0xa16c03;_0xbfb4d6[_0xd29a('0x4a')]=intUtil[_0xd29a('0x4b')](_0xbfb4d6[_0xd29a('0x4a')]);_0xbfb4d6[_0xd29a('0x4c')]=intUtil['stripTrailingSlash'](_0xbfb4d6[_0xd29a('0x4c')]);def[_0xd29a('0x63')]=util[_0xd29a('0x1e')](_0xd29a('0x4d'),_0xbfb4d6[_0xd29a('0x4a')]);if(_0x2f9fd3&&_0x2f9fd3[_0xd29a('0x64')]&&_0x2f9fd3[_0xd29a('0x64')]!==_0xd29a('0x65')){logger[_0xd29a('0x8')]('[OUTBOUND]',_0xd29a('0x50'));_0x1e329c[_0xd29a('0x51')]=util['format'](_0xd29a('0x52'),_0xbfb4d6[_0xd29a('0x4c')],_0x1e329c[_0xd29a('0x53')],md5(_0x1e329c[_0xd29a('0x53')]));}return getConnection(_0xbfb4d6)[_0xd29a('0x25')](function(_0x3daafc){_0xa16c03=_0x3daafc;return getUser(_0xbfb4d6,_0x334d99[_0xd29a('0xa')],_0xa16c03);})[_0xd29a('0x25')](function(_0x2b2f9e){_0x2af5cb=_0x2b2f9e;logger[_0xd29a('0x8')](_0xd29a('0x66'),_0x2af5cb['id']);return getEndUser(_0xbfb4d6,_0x1e329c[_0xd29a('0x67')],_0x1e329c['destcalleridnum'],_0xa16c03);})['then'](function(_0x1ed91e){_0x5b65c9=_0x1ed91e;logger[_0xd29a('0x8')](_0xd29a('0x56'),_0x5b65c9['id']);return getTicket(_0xbfb4d6,_0x2af5cb,_0x5b65c9,_0x52fd5a,_0x1e329c,_0x52fd5a[_0xd29a('0x68')],_0xa16c03,_0xd29a('0x69'));})[_0xd29a('0x25')](function(_0xe44d6a){_0x284091=_0xe44d6a;logger[_0xd29a('0x8')]('Ticket\x20created!');logger['info'](_0xd29a('0x58'),_0x284091['id']);return setRelationship(_0xa16c03,_0x2af5cb,_0x284091,_0xd29a('0x59'));})['then'](function(){return setRelationship(_0xa16c03,_0x5b65c9,_0x284091,_0xd29a('0x6a'));})[_0xd29a('0x25')](function(){return getServerInfo(_0xa16c03);})[_0xd29a('0x25')](function(_0x563ebe){var _0x427827=parseInt(_0x563ebe[_0xd29a('0x5a')]['charAt'](0x0));var _0x1a1dba=util[_0xd29a('0x1e')](_0xd29a('0x5c'),_0xbfb4d6[_0xd29a('0x4a')],_0x284091['id']);if(_0x427827>0x6){_0x1a1dba=util[_0xd29a('0x1e')](_0xd29a('0x5d'),_0xbfb4d6['remoteUri'],_0x284091['id']);}logger['info']('[OUTBOUND]',_0xd29a('0x5e'));emit(util[_0xd29a('0x1e')](_0xd29a('0x5f'),_0x334d99[_0xd29a('0xa')]),_0xd29a('0x60'),{'uri':_0x1a1dba});})['catch'](function(_0x50ef2e){logger['error']('[OUTBOUND]',JSON['stringify'](_0x50ef2e));});};exports[_0xd29a('0x6b')]=function(_0x3d8762,_0x471ca4,_0x4b62a7,_0x395432,_0x1106f5,_0x5f1cb9){var _0x567a36,_0x3ba881,_0x2dc0ef,_0x39857a;_0x5f1cb9[_0xd29a('0x4a')]=intUtil[_0xd29a('0x4b')](_0x5f1cb9[_0xd29a('0x4a')]);_0x5f1cb9['serverUrl']=intUtil[_0xd29a('0x4b')](_0x5f1cb9[_0xd29a('0x4c')]);def['uri']=util[_0xd29a('0x1e')](_0xd29a('0x4d'),_0x5f1cb9[_0xd29a('0x4a')]);if(_0x1106f5&&_0x1106f5['monitor_format']){logger[_0xd29a('0x8')](_0xd29a('0x6c'),'Recording\x20is\x20enabled!');_0x471ca4[_0xd29a('0x51')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5f1cb9[_0xd29a('0x4c')],_0x471ca4[_0xd29a('0x53')],md5(_0x471ca4[_0xd29a('0x53')]));}else{_0x471ca4[_0xd29a('0x51')]='';}return getConnection(_0x5f1cb9)[_0xd29a('0x25')](function(_0x45a096){_0x39857a=_0x45a096;if(!_[_0xd29a('0x6d')](_0x395432)){return getUser(_0x5f1cb9,_0x395432[_0xd29a('0xa')],_0x39857a);}else{return getUser(_0x5f1cb9,null,_0x39857a);}})['then'](function(_0x87fb44){_0x567a36=_0x87fb44;logger[_0xd29a('0x8')](_0xd29a('0x66'),_0x567a36['id']);return getEndUser(_0x5f1cb9,_0x471ca4['calleridname'],_0x471ca4[_0xd29a('0x55')],_0x39857a);})[_0xd29a('0x25')](function(_0x229643){_0x3ba881=_0x229643;logger[_0xd29a('0x8')]('The\x20Enduser\x20ID\x20is:',_0x3ba881['id']);return getTicket(_0x5f1cb9,_0x567a36,_0x3ba881,_0x4b62a7,_0x471ca4,_0x4b62a7[_0xd29a('0x68')],_0x39857a,'Inbound');})['then'](function(_0x1ad5ec){_0x2dc0ef=_0x1ad5ec;logger[_0xd29a('0x8')](_0xd29a('0x57'));logger[_0xd29a('0x8')](_0xd29a('0x58'),_0x2dc0ef['id']);return setRelationship(_0x39857a,_0x567a36,_0x2dc0ef,_0xd29a('0x59'));})['then'](function(){return setRelationship(_0x39857a,_0x3ba881,_0x2dc0ef,_0xd29a('0x6a'));})['then'](function(){return getServerInfo(_0x39857a);})[_0xd29a('0x61')](function(_0x1c4a26){logger[_0xd29a('0x6e')](_0xd29a('0x6c'),JSON['stringify'](_0x1c4a26));});}; \ No newline at end of file +var _0x5f43=['recordingURL','Fields','Inbound','Ticket\x20created!','users','version','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','The\x20Ticket\x20ID\x20is:','%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','trigger:browser:url','abandoned','[ABANDONED]','The\x20User\x20ID\x20is:','calleridname','calleridnum','lodash','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','toISOString','replace','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','base64','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','string','nameField','customField','toString','custom_fields','type','variable','customVariable','Variable','toLowerCase','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x2423f3,_0x5a3cba){var _0x818443=function(_0x35e8c8){while(--_0x35e8c8){_0x2423f3['push'](_0x2423f3['shift']());}};_0x818443(++_0x5a3cba);}(_0x5f43,0x8d));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x35f4('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x35f4('0x1'));var intUtil=require('./util');var config=require(_0x35f4('0x2'));var logger=require(_0x35f4('0x3'))(_0x35f4('0x4'));config['redis']=_[_0x35f4('0x5')](config[_0x35f4('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x35f4('0x7'))(new Redis(config[_0x35f4('0x6')]));var def={'method':_0x35f4('0x8'),'json':!![]};function emit(_0x34baaa,_0x4f1f8c,_0x3f1dcb){io['to'](_0x34baaa)['emit'](_0x4f1f8c,_0x3f1dcb);}function getTicket(_0x53efa4,_0x3e33d9,_0x36b0cd,_0x18b945,_0x568c88,_0x51281c,_0xae629f,_0x3485f2){logger[_0x35f4('0x9')](_0x35f4('0xa'));var _0x51fe1f=new Date();var _0x558505=[{'name':_0x35f4('0xb'),'value':intUtil[_0x35f4('0xc')](_0x18b945[_0x35f4('0xd')],_0x568c88,'\x20')},{'name':'assigned_user_id','value':_0x3e33d9['id']},{'name':_0x35f4('0xe'),'value':_0x3e33d9['id']},{'name':_0x35f4('0xf'),'value':intUtil[_0x35f4('0xc')](_0x18b945[_0x35f4('0x10')],_0x568c88,'\x0a')},{'name':'date_start','value':_0x51fe1f[_0x35f4('0x11')]()['slice'](0x0,0x13)[_0x35f4('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x35f4('0x13'),'value':'15'},{'name':'parent_id','value':_0x36b0cd['id']},{'name':_0x35f4('0x14'),'value':_0x35f4('0x15')},{'name':_0x35f4('0x16'),'value':_0x36b0cd[_0x35f4('0xb')]},{'name':_0x35f4('0x17'),'value':_0x3485f2}];if(_0x51281c[_0x35f4('0x18')]){_[_0x35f4('0x19')](_0x51281c,function(_0x172a30){if(_0x568c88[_0x172a30[_0x35f4('0x1a')]]){_0x558505[_0x35f4('0x1b')]({'name':_0x172a30[_0x35f4('0x1c')],'value':_0x568c88[_0x172a30[_0x35f4('0x1a')]]});}});}return request({'form':{'method':_0x35f4('0x1d'),'input_type':'JSON','response_type':_0x35f4('0x1e'),'rest_data':JSON[_0x35f4('0x1f')]({'session':_0xae629f['id'],'module_name':_0x35f4('0x20'),'name_value_list':_0x558505})}});}function getAuth(_0x17a417){return util[_0x35f4('0x21')](_0x35f4('0x22'),new Buffer(_0x17a417['apiKey']+':X')['toString'](_0x35f4('0x23')));}function getServerInfo(_0x150923){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x35f4('0x1e'),'rest_data':JSON['stringify']({'session':_0x150923['id']})}});}function getUser(_0x4e59e5,_0x43ccce,_0x4febe8){if(!_['isNil'](_0x43ccce)){logger[_0x35f4('0x9')](_0x35f4('0x24'),_0x43ccce);return request({'form':{'method':_0x35f4('0x25'),'input_type':_0x35f4('0x1e'),'response_type':_0x35f4('0x1e'),'rest_data':JSON[_0x35f4('0x1f')]({'session':_0x4febe8['id'],'module_name':_0x35f4('0x26'),'query':util[_0x35f4('0x21')](_0x35f4('0x27'),_0x43ccce),'order_by':'','offset':'0','select_fields':['id','name',_0x35f4('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x35f4('0x29')](function(_0x3ca30a){if(_0x3ca30a[_0x35f4('0x2a')][_0x35f4('0x18')]){var _0x7d0346=_[_0x35f4('0x2b')](_0x3ca30a[_0x35f4('0x2a')],function(_0x1a7b23){return _0x1a7b23[_0x35f4('0x2c')][_0x35f4('0x28')][_0x35f4('0x2d')]===_0x43ccce;});if(_0x7d0346){logger[_0x35f4('0x9')](_0x35f4('0x2e'));return BPromise['resolve']({'id':_0x7d0346['name_value_list']['id'][_0x35f4('0x2d')],'name':_0x7d0346[_0x35f4('0x2c')]['name'][_0x35f4('0x2d')]});}}logger[_0x35f4('0x9')](_0x35f4('0x2f'));return BPromise[_0x35f4('0x30')]({'id':_0x4febe8[_0x35f4('0x2c')][_0x35f4('0x31')]['value'],'name':_0x4febe8['name_value_list']['user_name'][_0x35f4('0x2d')]});});}else{logger[_0x35f4('0x9')](_0x35f4('0x32'));return BPromise[_0x35f4('0x30')]({'id':_0x4febe8[_0x35f4('0x2c')][_0x35f4('0x31')]['value'],'name':_0x4febe8[_0x35f4('0x2c')][_0x35f4('0x28')]['value']});}}function getEndUser(_0xcca56,_0x52377b,_0x30cc8f,_0x5285c2){logger[_0x35f4('0x9')](_0x35f4('0x33'),_0x30cc8f);return request({'form':{'method':_0x35f4('0x25'),'input_type':_0x35f4('0x1e'),'response_type':_0x35f4('0x1e'),'rest_data':JSON[_0x35f4('0x1f')]({'session':_0x5285c2['id'],'module_name':_0x35f4('0x15'),'query':util[_0x35f4('0x21')](_0x35f4('0x34'),_0x30cc8f),'order_by':'','offset':'0','select_fields':['id','name',_0x35f4('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x10a9bb){if(_0x10a9bb[_0x35f4('0x2a')][_0x35f4('0x18')]){var _0x582443=_['find'](_0x10a9bb[_0x35f4('0x2a')],function(_0x3183cf){return _0x3183cf[_0x35f4('0x2c')]['phone_home'][_0x35f4('0x2d')]===_0x30cc8f;});if(_0x582443){logger[_0x35f4('0x9')](_0x35f4('0x36'));return BPromise['resolve']({'id':_0x582443['name_value_list']['id'][_0x35f4('0x2d')],'name':_0x582443['name_value_list'][_0x35f4('0xb')][_0x35f4('0x2d')],'phone':_0x582443[_0x35f4('0x2c')]['phone_home']['value']});}}else{logger[_0x35f4('0x9')](_0x35f4('0x37'));return request({'form':{'method':_0x35f4('0x1d'),'input_type':_0x35f4('0x1e'),'response_type':_0x35f4('0x1e'),'rest_data':JSON[_0x35f4('0x1f')]({'session':_0x5285c2['id'],'module_name':_0x35f4('0x15'),'name_value_list':[{'name':'first_name','value':_0x52377b!==_0x35f4('0x38')?_0x52377b:util['format'](_0x35f4('0x39'),_0x30cc8f)},{'name':'phone_home','value':_0x30cc8f}]})}})[_0x35f4('0x29')](function(_0x17b0fd){logger['info'](_0x35f4('0x3a'));return BPromise[_0x35f4('0x30')]({'id':_0x17b0fd['id'],'name':_0x17b0fd[_0x35f4('0x2a')][_0x35f4('0x3b')][_0x35f4('0x2d')],'phone':_0x17b0fd[_0x35f4('0x2a')]['phone_home'][_0x35f4('0x2d')]});});}});}function request(_0xf54486){logger[_0x35f4('0x3c')](_0x35f4('0x3d'),JSON[_0x35f4('0x1f')](_0xf54486));return rp(_[_0x35f4('0x3e')](def,_0xf54486));}function getTags(_0x356958,_0xe18509){var _0x31cbd4=[];if(_0x356958&&_0x356958['length']>0x0){_0x31cbd4=_[_0x35f4('0x3f')](_0x356958,_0xe18509);}return _0x31cbd4;}function getCustomFields(_0x3cc494,_0x3625ad){var _0x2b72f3=[];var _0x8b806e={'custom_fields':[]};if(_0x3cc494[_0x35f4('0x18')]>0x0){_['forEach'](_0x3cc494,function(_0x2fc0d2){if(_0x2fc0d2['type']===_0x35f4('0x40')&&_0x2fc0d2[_0x35f4('0x41')]&&!_0x2fc0d2[_0x35f4('0x42')]){_0x8b806e[_0x2fc0d2[_0x35f4('0x41')]['toLowerCase']()]=_0x2fc0d2['content'][_0x35f4('0x43')]();}else if(_0x2fc0d2['type']===_0x35f4('0x40')&&_0x2fc0d2[_0x35f4('0x1c')]&&_0x2fc0d2[_0x35f4('0x42')]){_0x8b806e[_0x35f4('0x44')][_0x35f4('0x1b')]({'id':_0x2fc0d2[_0x35f4('0x1c')],'value':_0x2fc0d2['content'][_0x35f4('0x43')]()});}else if(_0x2fc0d2[_0x35f4('0x45')]===_0x35f4('0x46')&&_0x2fc0d2['variableName']&&_0x2fc0d2[_0x35f4('0x1c')]&&_0x2fc0d2[_0x35f4('0x42')]){_0x3625ad[_0x2fc0d2['variableName']]&&_0x8b806e[_0x35f4('0x44')]['push']({'id':_0x2fc0d2[_0x35f4('0x1c')],'value':_0x3625ad[_0x2fc0d2[_0x35f4('0x1a')]][_0x35f4('0x43')]()});}else if(_0x2fc0d2[_0x35f4('0x45')]===_0x35f4('0x47')&&_0x2fc0d2['Variable']&&_0x2fc0d2[_0x35f4('0x48')][_0x35f4('0xb')]&&_0x2fc0d2[_0x35f4('0x1c')]&&_0x2fc0d2[_0x35f4('0x42')]){_0x3625ad[_0x2fc0d2[_0x35f4('0x48')][_0x35f4('0xb')][_0x35f4('0x49')]()]&&_0x8b806e[_0x35f4('0x44')][_0x35f4('0x1b')]({'id':_0x2fc0d2[_0x35f4('0x1c')],'value':_0x3625ad[_0x2fc0d2[_0x35f4('0x48')]['name'][_0x35f4('0x49')]()][_0x35f4('0x43')]()});}});}return _0x8b806e;}function getConnection(_0x3dcd93){return request({'method':_0x35f4('0x8'),'form':{'method':_0x35f4('0x4a'),'input_type':_0x35f4('0x1e'),'response_type':_0x35f4('0x1e'),'rest_data':JSON[_0x35f4('0x1f')]({'user_auth':{'user_name':_0x3dcd93[_0x35f4('0x4b')],'password':_0x3dcd93[_0x35f4('0x4c')],'encryption':'PLAIN'},'application':_0x35f4('0x4d')})}})['then'](function(_0x3d001b){var _0x41894b=_0x3d001b;if(_0x41894b['id']){def['sessionID']=_0x41894b['id'];return BPromise[_0x35f4('0x30')](_0x41894b);}else{throw new Error(util[_0x35f4('0x21')](_0x35f4('0x4e'),_0x3dcd93['id']));}});}function setRelationship(_0x3eb1a4,_0x41bd22,_0x2ad9a6,_0x5a7927){return request({'form':{'method':_0x35f4('0x4f'),'input_type':_0x35f4('0x1e'),'response_type':_0x35f4('0x1e'),'rest_data':JSON['stringify']({'session':_0x3eb1a4['id'],'module_name':_0x35f4('0x20'),'module_id':_0x2ad9a6['id'],'link_field_name':_0x5a7927,'related_ids':[_0x41bd22['id']]})}});}exports['queue']=function(_0x51f320,_0x259b75,_0x11feb4,_0x181ed6,_0x35a815,_0x4df8a8){var _0x2ef531,_0x457150,_0x505880,_0x5e3aba;_0x4df8a8['remoteUri']=intUtil[_0x35f4('0x50')](_0x4df8a8['remoteUri']);_0x4df8a8[_0x35f4('0x51')]=intUtil[_0x35f4('0x50')](_0x4df8a8[_0x35f4('0x51')]);def[_0x35f4('0x52')]=util[_0x35f4('0x21')](_0x35f4('0x53'),_0x4df8a8[_0x35f4('0x54')]);if(_0x35a815&&_0x35a815['monitor_format']){logger[_0x35f4('0x9')](_0x35f4('0x55'),_0x35f4('0x56'));_0x259b75['recordingURL']=util['format'](_0x35f4('0x57'),_0x4df8a8['serverUrl'],_0x259b75['uniqueid'],md5(_0x259b75[_0x35f4('0x58')]));}else{_0x259b75[_0x35f4('0x59')]='';}return getConnection(_0x4df8a8)[_0x35f4('0x29')](function(_0x4f7406){_0x5e3aba=_0x4f7406;return getUser(_0x4df8a8,_0x181ed6[_0x35f4('0xb')],_0x5e3aba);})[_0x35f4('0x29')](function(_0x32fc57){_0x2ef531=_0x32fc57;logger[_0x35f4('0x9')]('The\x20User\x20ID\x20is:',_0x2ef531['id']);return getEndUser(_0x4df8a8,_0x259b75['calleridname'],_0x259b75['calleridnum'],_0x5e3aba);})[_0x35f4('0x29')](function(_0x5b720e){_0x457150=_0x5b720e;logger[_0x35f4('0x9')]('The\x20Enduser\x20ID\x20is:',_0x457150['id']);return getTicket(_0x4df8a8,_0x2ef531,_0x457150,_0x11feb4,_0x259b75,_0x11feb4[_0x35f4('0x5a')],_0x5e3aba,_0x35f4('0x5b'));})[_0x35f4('0x29')](function(_0x460e67){_0x505880=_0x460e67;logger['info'](_0x35f4('0x5c'));logger[_0x35f4('0x9')]('The\x20Ticket\x20ID\x20is:',_0x505880['id']);return setRelationship(_0x5e3aba,_0x2ef531,_0x505880,_0x35f4('0x5d'));})['then'](function(){return setRelationship(_0x5e3aba,_0x457150,_0x505880,'contacts');})['then'](function(){return getServerInfo(_0x5e3aba);})['then'](function(_0x2888ac){var _0x3adc40=parseInt(_0x2888ac[_0x35f4('0x5e')][_0x35f4('0x5f')](0x0));var _0x2ee122=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4df8a8['remoteUri'],_0x505880['id']);if(_0x3adc40>0x6){_0x2ee122=util[_0x35f4('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4df8a8[_0x35f4('0x54')],_0x505880['id']);}logger[_0x35f4('0x9')]('[QUEUE]',_0x35f4('0x60'));emit(util[_0x35f4('0x21')](_0x35f4('0x61'),_0x181ed6['name']),'trigger:browser:url',{'uri':_0x2ee122});})[_0x35f4('0x62')](function(_0x49f45a){logger[_0x35f4('0x63')](_0x35f4('0x55'),JSON[_0x35f4('0x1f')](_0x49f45a));});};exports[_0x35f4('0x64')]=function(_0x397ea4,_0x416d44,_0x43570f,_0xdec84,_0x22c17d,_0x4d449f,_0x38c719){var _0x383836,_0x377bc1,_0x1058f8,_0x27cfd2;_0x4d449f[_0x35f4('0x54')]=intUtil[_0x35f4('0x50')](_0x4d449f[_0x35f4('0x54')]);_0x4d449f[_0x35f4('0x51')]=intUtil[_0x35f4('0x50')](_0x4d449f[_0x35f4('0x51')]);def[_0x35f4('0x52')]=util['format'](_0x35f4('0x53'),_0x4d449f[_0x35f4('0x54')]);if(_0x38c719&&_0x38c719['recordingFormat']&&_0x38c719['recordingFormat']!=='none'){logger[_0x35f4('0x9')](_0x35f4('0x65'),_0x35f4('0x56'));_0x416d44[_0x35f4('0x59')]=util[_0x35f4('0x21')](_0x35f4('0x57'),_0x4d449f[_0x35f4('0x51')],_0x416d44['uniqueid'],md5(_0x416d44[_0x35f4('0x58')]));}return getConnection(_0x4d449f)[_0x35f4('0x29')](function(_0x1da001){_0x27cfd2=_0x1da001;return getUser(_0x4d449f,_0xdec84[_0x35f4('0xb')],_0x27cfd2);})[_0x35f4('0x29')](function(_0x23216e){_0x383836=_0x23216e;logger[_0x35f4('0x9')]('The\x20User\x20ID\x20is:',_0x383836['id']);return getEndUser(_0x4d449f,_0x416d44[_0x35f4('0x66')],_0x416d44[_0x35f4('0x67')],_0x27cfd2);})[_0x35f4('0x29')](function(_0x839eab){_0x377bc1=_0x839eab;logger['info'](_0x35f4('0x68'),_0x377bc1['id']);return getTicket(_0x4d449f,_0x383836,_0x377bc1,_0x43570f,_0x416d44,_0x43570f['Fields'],_0x27cfd2,_0x35f4('0x69'));})['then'](function(_0x52df5d){_0x1058f8=_0x52df5d;logger[_0x35f4('0x9')]('Ticket\x20created!');logger[_0x35f4('0x9')](_0x35f4('0x6a'),_0x1058f8['id']);return setRelationship(_0x27cfd2,_0x383836,_0x1058f8,'users');})[_0x35f4('0x29')](function(){return setRelationship(_0x27cfd2,_0x377bc1,_0x1058f8,'contacts');})[_0x35f4('0x29')](function(){return getServerInfo(_0x27cfd2);})[_0x35f4('0x29')](function(_0x55aafd){var _0x5f2078=parseInt(_0x55aafd[_0x35f4('0x5e')][_0x35f4('0x5f')](0x0));var _0x20aafd=util[_0x35f4('0x21')](_0x35f4('0x6b'),_0x4d449f['remoteUri'],_0x1058f8['id']);if(_0x5f2078>0x6){_0x20aafd=util[_0x35f4('0x21')](_0x35f4('0x6c'),_0x4d449f['remoteUri'],_0x1058f8['id']);}logger[_0x35f4('0x9')](_0x35f4('0x65'),_0x35f4('0x60'));emit(util['format'](_0x35f4('0x61'),_0xdec84[_0x35f4('0xb')]),_0x35f4('0x6d'),{'uri':_0x20aafd});})[_0x35f4('0x62')](function(_0x161505){logger[_0x35f4('0x63')](_0x35f4('0x65'),JSON[_0x35f4('0x1f')](_0x161505));});};exports[_0x35f4('0x6e')]=function(_0x5881e3,_0x4f8991,_0x517021,_0x4312db,_0x418e81,_0x4426e2){var _0x3637a5,_0x2771e9,_0x25f8ff,_0x1d1248;_0x4426e2[_0x35f4('0x54')]=intUtil[_0x35f4('0x50')](_0x4426e2[_0x35f4('0x54')]);_0x4426e2[_0x35f4('0x51')]=intUtil[_0x35f4('0x50')](_0x4426e2[_0x35f4('0x51')]);def[_0x35f4('0x52')]=util[_0x35f4('0x21')](_0x35f4('0x53'),_0x4426e2[_0x35f4('0x54')]);if(_0x418e81&&_0x418e81['monitor_format']){logger[_0x35f4('0x9')](_0x35f4('0x6f'),_0x35f4('0x56'));_0x4f8991[_0x35f4('0x59')]=util[_0x35f4('0x21')](_0x35f4('0x57'),_0x4426e2['serverUrl'],_0x4f8991[_0x35f4('0x58')],md5(_0x4f8991[_0x35f4('0x58')]));}else{_0x4f8991[_0x35f4('0x59')]='';}return getConnection(_0x4426e2)[_0x35f4('0x29')](function(_0x1ec073){_0x1d1248=_0x1ec073;if(!_['isNil'](_0x4312db)){return getUser(_0x4426e2,_0x4312db[_0x35f4('0xb')],_0x1d1248);}else{return getUser(_0x4426e2,null,_0x1d1248);}})[_0x35f4('0x29')](function(_0x76e1ba){_0x3637a5=_0x76e1ba;logger['info'](_0x35f4('0x70'),_0x3637a5['id']);return getEndUser(_0x4426e2,_0x4f8991[_0x35f4('0x71')],_0x4f8991[_0x35f4('0x72')],_0x1d1248);})[_0x35f4('0x29')](function(_0x43be6f){_0x2771e9=_0x43be6f;logger[_0x35f4('0x9')](_0x35f4('0x68'),_0x2771e9['id']);return getTicket(_0x4426e2,_0x3637a5,_0x2771e9,_0x517021,_0x4f8991,_0x517021[_0x35f4('0x5a')],_0x1d1248,_0x35f4('0x5b'));})['then'](function(_0x5a2149){_0x25f8ff=_0x5a2149;logger[_0x35f4('0x9')]('Ticket\x20created!');logger['info'](_0x35f4('0x6a'),_0x25f8ff['id']);return setRelationship(_0x1d1248,_0x3637a5,_0x25f8ff,_0x35f4('0x5d'));})[_0x35f4('0x29')](function(){return setRelationship(_0x1d1248,_0x2771e9,_0x25f8ff,'contacts');})['then'](function(){return getServerInfo(_0x1d1248);})['catch'](function(_0x5a9456){logger[_0x35f4('0x63')]('[ABANDONED]',JSON[_0x35f4('0x1f')](_0x5a9456));});}; \ 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 89aecc8..8b91bdf 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 _0xac99=['toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','type','string','push','variableName'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0xac99,0xc1));var _0x9ac9=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0xac99[_0x15a634];return _0xf4f7a0;};'use strict';var _=require(_0x9ac9('0x0'));var util=require('util');exports[_0x9ac9('0x1')]=function(_0x142fbb,_0x1cb625,_0xf8b946){var _0x3051af=[];if(_0x142fbb['length']>0x0){var _0x481adb=_['sortBy'](_0x142fbb,['id']);for(var _0x2f2862=0x0;_0x2f2862<_0x481adb[_0x9ac9('0x2')];_0x2f2862++){var _0x3f39b5=_0x481adb[_0x2f2862];if(_0x3f39b5[_0x9ac9('0x3')]===_0x9ac9('0x4')){_0x3051af[_0x9ac9('0x5')](_0x3f39b5['content']);}else if(_0x3f39b5[_0x9ac9('0x3')]==='variable'&&_0x3f39b5[_0x9ac9('0x6')]){_0x1cb625[_0x3f39b5[_0x9ac9('0x6')]]&&_0x3051af[_0x9ac9('0x5')](_0x1cb625[_0x3f39b5['variableName']][_0x9ac9('0x7')]());}else if(_0x3f39b5['type']===_0x9ac9('0x8')&&_0x3f39b5[_0x9ac9('0x9')]&&_0x3f39b5[_0x9ac9('0x9')]['name']){_0x1cb625[_0x3f39b5[_0x9ac9('0x9')][_0x9ac9('0xa')]['toLowerCase']()]&&_0x3051af['push'](_0x1cb625[_0x3f39b5['Variable']['name'][_0x9ac9('0xb')]()]['toString']());}else if(_0x3f39b5[_0x9ac9('0x3')]===_0x9ac9('0xc')){if(_0x3f39b5['keyType']==='string'&&_0x3f39b5[_0x9ac9('0xd')]){_0x3051af[_0x9ac9('0x5')](util[_0x9ac9('0xe')](_0x9ac9('0xf'),_0x3f39b5[_0x9ac9('0xd')],_0x3f39b5[_0x9ac9('0x10')]));}else if(_0x3f39b5[_0x9ac9('0x11')]==='variable'&&_0x3f39b5['variableName']&&_0x3f39b5['key']){_0x1cb625[_0x3f39b5[_0x9ac9('0x6')]]&&_0x3051af[_0x9ac9('0x5')](util[_0x9ac9('0xe')](_0x9ac9('0xf'),_0x3f39b5[_0x9ac9('0xd')],_0x1cb625[_0x3f39b5[_0x9ac9('0x6')]]));}else if(_0x3f39b5[_0x9ac9('0x11')]===_0x9ac9('0x8')&&_0x3f39b5[_0x9ac9('0x9')]&&_0x3f39b5[_0x9ac9('0x9')][_0x9ac9('0xa')]&&_0x3f39b5[_0x9ac9('0xd')]){_0x1cb625[_0x3f39b5[_0x9ac9('0x9')][_0x9ac9('0xa')][_0x9ac9('0xb')]()]&&_0x3051af[_0x9ac9('0x5')](util[_0x9ac9('0xe')]('%s:\x20%s',_0x3f39b5[_0x9ac9('0xd')],_0x1cb625[_0x3f39b5[_0x9ac9('0x9')]['name'][_0x9ac9('0xb')]()]));}}}}return _0x3051af['join'](_0xf8b946);};exports[_0x9ac9('0x12')]=function(_0x5b097b){var _0x431714=_0x5b097b[_0x9ac9('0x13')](-0x1);if(_0x431714==='/'){_0x5b097b=_0x5b097b[_0x9ac9('0x14')](0x0,_0x5b097b[_0x9ac9('0x15')](_0x431714));}return _0x5b097b;};exports[_0x9ac9('0x16')]=function(_0x203558){if(!_[_0x9ac9('0x17')](_0x203558)&&_0x203558!==''){var _0x367115=/^(([^<>()\[\]\\.,;:\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 _0x367115[_0x9ac9('0x18')](String(_0x203558)[_0x9ac9('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x7247=['string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','getString','sortBy','length','type'];(function(_0x2bb930,_0xe92f28){var _0x4a7d19=function(_0x31d554){while(--_0x31d554){_0x2bb930['push'](_0x2bb930['shift']());}};_0x4a7d19(++_0xe92f28);}(_0x7247,0x1f4));var _0x7724=function(_0x535a2d,_0x425176){_0x535a2d=_0x535a2d-0x0;var _0x41ab1e=_0x7247[_0x535a2d];return _0x41ab1e;};'use strict';var _=require('lodash');var util=require('util');exports[_0x7724('0x0')]=function(_0xc8c55f,_0x43f1b8,_0x3e3c78){var _0x7f883=[];if(_0xc8c55f['length']>0x0){var _0x404fab=_[_0x7724('0x1')](_0xc8c55f,['id']);for(var _0x189d95=0x0;_0x189d95<_0x404fab[_0x7724('0x2')];_0x189d95++){var _0xf3816b=_0x404fab[_0x189d95];if(_0xf3816b[_0x7724('0x3')]===_0x7724('0x4')){_0x7f883[_0x7724('0x5')](_0xf3816b[_0x7724('0x6')]);}else if(_0xf3816b['type']===_0x7724('0x7')&&_0xf3816b[_0x7724('0x8')]){_0x43f1b8[_0xf3816b[_0x7724('0x8')]]&&_0x7f883[_0x7724('0x5')](_0x43f1b8[_0xf3816b[_0x7724('0x8')]][_0x7724('0x9')]());}else if(_0xf3816b[_0x7724('0x3')]===_0x7724('0xa')&&_0xf3816b[_0x7724('0xb')]&&_0xf3816b[_0x7724('0xb')][_0x7724('0xc')]){_0x43f1b8[_0xf3816b[_0x7724('0xb')]['name'][_0x7724('0xd')]()]&&_0x7f883['push'](_0x43f1b8[_0xf3816b[_0x7724('0xb')][_0x7724('0xc')]['toLowerCase']()]['toString']());}else if(_0xf3816b[_0x7724('0x3')]===_0x7724('0xe')){if(_0xf3816b[_0x7724('0xf')]==='string'&&_0xf3816b[_0x7724('0x10')]){_0x7f883['push'](util[_0x7724('0x11')](_0x7724('0x12'),_0xf3816b[_0x7724('0x10')],_0xf3816b[_0x7724('0x13')]));}else if(_0xf3816b[_0x7724('0xf')]===_0x7724('0x7')&&_0xf3816b[_0x7724('0x8')]&&_0xf3816b[_0x7724('0x10')]){_0x43f1b8[_0xf3816b[_0x7724('0x8')]]&&_0x7f883[_0x7724('0x5')](util[_0x7724('0x11')]('%s:\x20%s',_0xf3816b['key'],_0x43f1b8[_0xf3816b[_0x7724('0x8')]]));}else if(_0xf3816b[_0x7724('0xf')]===_0x7724('0xa')&&_0xf3816b[_0x7724('0xb')]&&_0xf3816b[_0x7724('0xb')][_0x7724('0xc')]&&_0xf3816b[_0x7724('0x10')]){_0x43f1b8[_0xf3816b[_0x7724('0xb')]['name'][_0x7724('0xd')]()]&&_0x7f883['push'](util[_0x7724('0x11')]('%s:\x20%s',_0xf3816b['key'],_0x43f1b8[_0xf3816b[_0x7724('0xb')]['name'][_0x7724('0xd')]()]));}}}}return _0x7f883[_0x7724('0x14')](_0x3e3c78);};exports[_0x7724('0x15')]=function(_0x4a3b7f){var _0x1b823b=_0x4a3b7f[_0x7724('0x16')](-0x1);if(_0x1b823b==='/'){_0x4a3b7f=_0x4a3b7f[_0x7724('0x17')](0x0,_0x4a3b7f[_0x7724('0x18')](_0x1b823b));}return _0x4a3b7f;};exports[_0x7724('0x19')]=function(_0x48cf93){if(!_[_0x7724('0x1a')](_0x48cf93)&&_0x48cf93!==''){var _0x5e5080=/^(([^<>()\[\]\\.,;:\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 _0x5e5080[_0x7724('0x1b')](String(_0x48cf93)[_0x7724('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 3cd0663..586ed37 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 _0x4345=['serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','socket.io-emitter','emit','length','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','merge','Normal','getString','Subjects','Descriptions','%s/webservice.php','create','admin','sessionName','HelpDesk','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','catch','statusCode','validateEmail','Getting\x20agent\x20with\x20email','GET','remoteUri','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','username','Searching\x20end\x20user\x20with\x20phone','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x217be1,_0x11ecd1){var _0x29fbc3=function(_0x4b0a97){while(--_0x4b0a97){_0x217be1['push'](_0x217be1['shift']());}};_0x29fbc3(++_0x11ecd1);}(_0x4345,0x77));var _0x5434=function(_0xe5b8a7,_0x51ef10){_0xe5b8a7=_0xe5b8a7-0x0;var _0x541742=_0x4345[_0xe5b8a7];return _0x541742;};'use strict';var _=require(_0x5434('0x0'));var rp=require(_0x5434('0x1'));var BPromise=require('bluebird');var md5=require(_0x5434('0x2'));var util=require(_0x5434('0x3'));var Redis=require(_0x5434('0x4'));var intUtil=require(_0x5434('0x5'));var config=require('../../../../config/environment');var logger=require(_0x5434('0x6'))('vTiger');config[_0x5434('0x7')]=_[_0x5434('0x8')](config[_0x5434('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5434('0x9'))(new Redis(config['redis']));function emit(_0x395e5c,_0x457fe8,_0x17d20b){io['to'](_0x395e5c)[_0x5434('0xa')](_0x457fe8,_0x17d20b);}function getCustomFields(_0x2f73e0,_0x414550){var _0x417e1e={};if(_0x2f73e0[_0x5434('0xb')]>0x0){_[_0x5434('0xc')](_0x2f73e0,function(_0x2f2ec7){if(_0x2f2ec7[_0x5434('0xd')]===_0x5434('0xe')&&_0x2f2ec7[_0x5434('0xf')]){_0x417e1e[_0x2f2ec7[_0x5434('0xf')]]=_0x2f2ec7['content'][_0x5434('0x10')]();}else if(_0x2f2ec7['type']===_0x5434('0x11')&&_0x2f2ec7[_0x5434('0x12')]&&_0x2f2ec7[_0x5434('0xf')]&&_0x414550[_0x2f2ec7[_0x5434('0x12')]]){_0x417e1e[_0x2f2ec7['idField']]=_0x414550[_0x2f2ec7[_0x5434('0x12')]][_0x5434('0x10')]();}else if(_0x2f2ec7['type']===_0x5434('0x13')&&_0x2f2ec7[_0x5434('0x14')]&&_0x2f2ec7[_0x5434('0x14')][_0x5434('0x15')]&&_0x2f2ec7['idField']&&_0x414550[_0x2f2ec7[_0x5434('0x14')][_0x5434('0x15')]['toLowerCase']()]){_0x417e1e[_0x2f2ec7[_0x5434('0xf')]]=_0x414550[_0x2f2ec7['Variable'][_0x5434('0x15')][_0x5434('0x16')]()][_0x5434('0x10')]();}});}return _0x417e1e;}function createTicket(_0x148b3c,_0x417143,_0x2d60be,_0x1dee84,_0x49038e,_0x3123eb,_0x5a4570){logger[_0x5434('0x17')]('Creating\x20new\x20ticket...');var _0x44f68f=_[_0x5434('0x18')]({'parent_id':'','assigned_user_id':_0x417143['id'],'ticketpriorities':_0x5434('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x5434('0x1a')](_0x1dee84[_0x5434('0x1b')],_0x49038e,'\x20'),'description':intUtil[_0x5434('0x1a')](_0x1dee84[_0x5434('0x1c')],_0x49038e,'\x0a'),'contact_id':_0x2d60be['id']},getCustomFields(_0x3123eb,_0x49038e));var _0x1da16d={'method':'POST','uri':util['format'](_0x5434('0x1d'),_0x148b3c['remoteUri']),'form':{'operation':_0x5434('0x1e'),'username':_0x5434('0x1f'),'sessionName':_0x5a4570[_0x5434('0x20')],'elementType':_0x5434('0x21'),'element':JSON['stringify'](_0x44f68f)},'json':!![]};return request(_0x1da16d)['then'](function(_0x14e903){if(_0x14e903[_0x5434('0x22')]){return BPromise[_0x5434('0x23')]({'id':_0x14e903[_0x5434('0x24')]['id']});}else{throw new Error(util[_0x5434('0x25')](_0x5434('0x26'),JSON[_0x5434('0x27')](_0x14e903[_0x5434('0x28')])));}})[_0x5434('0x29')](function(_0x419621){var _0x14b5ed=_0x419621[_0x5434('0x2a')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x14b5ed,JSON[_0x5434('0x27')](_0x419621));});}function getUser(_0x124371,_0x4189f9,_0x1330ff){if(intUtil[_0x5434('0x2b')](_0x4189f9)){logger['info'](_0x5434('0x2c'),_0x4189f9);return request({'method':_0x5434('0x2d'),'uri':util['format'](_0x5434('0x1d'),_0x124371[_0x5434('0x2e')]),'qs':{'operation':'query','username':'admin','sessionName':_0x1330ff['sessionName'],'query':util[_0x5434('0x25')](_0x5434('0x2f'),_0x4189f9)},'json':!![]})[_0x5434('0x30')](function(_0x446198){if(_0x446198[_0x5434('0x22')]&&_0x446198[_0x5434('0x24')]['length']){logger[_0x5434('0x17')](_0x5434('0x31'));return BPromise[_0x5434('0x23')]({'id':_0x446198[_0x5434('0x24')][0x0]['id'],'email':_0x446198[_0x5434('0x24')][0x0][_0x5434('0x32')],'name':_0x446198[_0x5434('0x24')][0x0]['first_name']+'\x20'+_0x446198[_0x5434('0x24')][_0x5434('0x33')]});}else{logger[_0x5434('0x17')](_0x5434('0x34'));return BPromise[_0x5434('0x23')]({'id':_0x1330ff[_0x5434('0x35')],'email':_0x124371['username'],'name':_0x5434('0x1f')});}})[_0x5434('0x29')](function(_0x2ed007){var _0x168db5=_0x2ed007[_0x5434('0x2a')]||0x1f4;logger[_0x5434('0x28')](_0x5434('0x36'),_0x5434('0x37'),_0x168db5,JSON[_0x5434('0x27')](_0x2ed007));});}else{logger[_0x5434('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x5434('0x23')]({'id':_0x1330ff[_0x5434('0x35')],'email':_0x124371[_0x5434('0x38')],'name':_0x5434('0x1f')})['catch'](function(_0x243163){var _0x1fe399=_0x243163['statusCode']||0x1f4;logger['error'](_0x5434('0x36'),_0x5434('0x37'),_0x1fe399,JSON['stringify'](_0x243163));});}}function getEndUser(_0x184b9a,_0x460eae,_0x58fdad,_0x5ce24d){logger[_0x5434('0x17')](_0x5434('0x39'),_0x58fdad);return request({'method':'GET','uri':util[_0x5434('0x25')](_0x5434('0x1d'),_0x184b9a[_0x5434('0x2e')]),'qs':{'operation':_0x5434('0x3a'),'username':'admin','sessionName':_0x5ce24d[_0x5434('0x20')],'query':util['format'](_0x5434('0x3b'),_0x58fdad,_0x58fdad,_0x58fdad,_0x58fdad,_0x58fdad)},'json':!![]})[_0x5434('0x30')](function(_0x490f67){if(_0x490f67[_0x5434('0x22')]&&_0x490f67[_0x5434('0x24')]['length']){logger[_0x5434('0x17')](_0x5434('0x3c'));return BPromise[_0x5434('0x23')]({'id':_0x490f67[_0x5434('0x24')][0x0]['id'],'name':_0x490f67[_0x5434('0x24')][0x0]['firstname']+'\x20'+_0x490f67['result'][0x0][_0x5434('0x3d')],'phone':_0x58fdad});}else{logger[_0x5434('0x17')](_0x5434('0x3e'));return request({'method':_0x5434('0x3f'),'uri':util['format'](_0x5434('0x1d'),_0x184b9a[_0x5434('0x2e')]),'form':{'operation':_0x5434('0x1e'),'sessionName':_0x5ce24d[_0x5434('0x20')],'elementType':_0x5434('0x40'),'element':JSON[_0x5434('0x27')]({'lastname':_0x460eae,'phone':_0x58fdad,'assigned_user_id':'\x20'})},'json':!![]})[_0x5434('0x30')](function(_0x21056f){logger[_0x5434('0x17')](_0x5434('0x41'));return BPromise[_0x5434('0x23')]({'id':_0x21056f[_0x5434('0x24')]['id'],'name':_0x21056f[_0x5434('0x24')][_0x5434('0x3d')],'phone':_0x21056f[_0x5434('0x24')][_0x5434('0x42')]});})['catch'](function(_0x1c6605){var _0x44de35=_0x1c6605['statusCode']||0x1f4;logger[_0x5434('0x28')](_0x5434('0x36'),_0x5434('0x43'),_0x44de35,JSON[_0x5434('0x27')](_0x1c6605));});}});}function getConnection(_0x123b70){var _0x4e7b13=_0x123b70[_0x5434('0x38')];var _0x501021=_0x123b70[_0x5434('0x44')];return request({'method':_0x5434('0x2d'),'uri':util[_0x5434('0x25')]('%s/webservice.php',_0x123b70['remoteUri']),'qs':{'operation':_0x5434('0x45'),'username':_0x4e7b13},'json':!![]})[_0x5434('0x30')](function(_0x254a2e){if(_0x254a2e['success']){return request({'method':'POST','uri':util[_0x5434('0x25')](_0x5434('0x1d'),_0x123b70['remoteUri']),'form':{'operation':_0x5434('0x46'),'username':_0x5434('0x1f'),'accessKey':md5(_0x254a2e[_0x5434('0x24')][_0x5434('0x47')]+_0x501021)},'json':!![]});}})[_0x5434('0x30')](function(_0x4a6e20){if(_0x4a6e20[_0x5434('0x22')]){return BPromise[_0x5434('0x23')](_0x4a6e20[_0x5434('0x24')]);}else{throw new Error(util[_0x5434('0x25')](_0x5434('0x48'),_0x123b70['id']));}})[_0x5434('0x29')](function(_0xb506f6){var _0x2758dc=_0xb506f6[_0x5434('0x2a')]||0x1f4;logger[_0x5434('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x5434('0x49'),_0x2758dc,JSON['stringify'](_0xb506f6));});}function request(_0x116435){logger[_0x5434('0x17')](_0x5434('0x4a'),JSON[_0x5434('0x27')](_0x116435));return rp(_0x116435);}exports[_0x5434('0x4b')]=function(_0x365ebd,_0x26151a,_0x392965,_0x4c10e5,_0x3423ac,_0x544e11){var _0x552040,_0x1c817d,_0x5be862,_0x4aef5b;_0x544e11[_0x5434('0x2e')]=intUtil[_0x5434('0x4c')](_0x544e11[_0x5434('0x2e')]);if(_0x3423ac&&_0x3423ac[_0x5434('0x4d')]){logger[_0x5434('0x17')](_0x5434('0x4e'),'Recording\x20is\x20enabled!');_0x26151a[_0x5434('0x4f')]=util[_0x5434('0x25')](_0x5434('0x50'),_0x544e11[_0x5434('0x51')],_0x26151a[_0x5434('0x52')],md5(_0x26151a['uniqueid']));}else{_0x26151a[_0x5434('0x4f')]='';}return getConnection(_0x544e11)[_0x5434('0x30')](function(_0x3e8378){_0x4aef5b=_0x3e8378;return getUser(_0x544e11,_0x4c10e5[_0x5434('0x53')],_0x4aef5b);})[_0x5434('0x30')](function(_0xe00ed1){_0x552040=_0xe00ed1;logger[_0x5434('0x17')](_0x5434('0x54'),_0x552040['id']);return getEndUser(_0x544e11,_0x26151a['calleridname'],_0x26151a['calleridnum'],_0x4aef5b);})['then'](function(_0x2de205){_0x1c817d=_0x2de205;logger[_0x5434('0x17')](_0x5434('0x55'),_0x1c817d['id']);return createTicket(_0x544e11,_0x552040,_0x1c817d,_0x392965,_0x26151a,_0x392965[_0x5434('0x56')],_0x4aef5b);})['then'](function(_0x2c631b){_0x5be862=_0x2c631b;logger[_0x5434('0x17')](_0x5434('0x57'));logger['info'](_0x5434('0x58'),_0x5be862['id']);var _0x18f2e1=util[_0x5434('0x25')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x544e11[_0x5434('0x2e')],_[_0x5434('0x59')](_0x5be862['id'],'x')[0x1]);logger[_0x5434('0x17')](_0x5434('0x4e'),_0x5434('0x5a'));emit(util[_0x5434('0x25')](_0x5434('0x5b'),_0x4c10e5[_0x5434('0x15')]),_0x5434('0x5c'),{'uri':_0x18f2e1});})[_0x5434('0x29')](function(_0x26f25e){logger['error']('[QUEUE]',JSON[_0x5434('0x27')](_0x26f25e));});};exports[_0x5434('0x5d')]=function(_0x446775,_0x2ba394,_0xd94887,_0x4893f0,_0x14a542,_0x59b0d1,_0x5bafb5){var _0x496622,_0xfccc73,_0x3a8b22,_0x457174;_0x59b0d1['remoteUri']=intUtil['stripTrailingSlash'](_0x59b0d1['remoteUri']);_0x59b0d1[_0x5434('0x51')]=intUtil[_0x5434('0x4c')](_0x59b0d1[_0x5434('0x51')]);if(_0x5bafb5&&_0x5bafb5['recordingFormat']&&_0x5bafb5['recordingFormat']!==_0x5434('0x5e')){logger[_0x5434('0x17')](_0x5434('0x5f'),_0x5434('0x60'));_0x2ba394['recordingURL']=util['format'](_0x5434('0x50'),_0x59b0d1[_0x5434('0x51')],_0x2ba394[_0x5434('0x52')],md5(_0x2ba394[_0x5434('0x52')]));}return getConnection(_0x59b0d1)[_0x5434('0x30')](function(_0x265a9c){_0x457174=_0x265a9c;return getUser(_0x59b0d1,_0x4893f0['email'],_0x457174);})[_0x5434('0x30')](function(_0x534f0a){_0x496622=_0x534f0a;logger[_0x5434('0x17')](_0x5434('0x54'),_0x496622['id']);return getEndUser(_0x59b0d1,_0x2ba394['destcalleridname'],_0x2ba394[_0x5434('0x61')],_0x457174);})[_0x5434('0x30')](function(_0x42bcdf){_0xfccc73=_0x42bcdf;logger[_0x5434('0x17')]('The\x20Enduser\x20ID\x20is:',_0xfccc73['id']);return createTicket(_0x59b0d1,_0x496622,_0xfccc73,_0xd94887,_0x2ba394,_0xd94887['Fields'],_0x457174);})[_0x5434('0x30')](function(_0x19d357){_0x3a8b22=_0x19d357;logger[_0x5434('0x17')](_0x5434('0x57'));logger[_0x5434('0x17')](_0x5434('0x58'),_0x3a8b22['id']);var _0x3d63a9=util['format'](_0x5434('0x62'),_0x59b0d1[_0x5434('0x2e')],_[_0x5434('0x59')](_0x3a8b22['id'],'x')[0x1]);logger[_0x5434('0x17')](_0x5434('0x5f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5434('0x25')](_0x5434('0x5b'),_0x4893f0['name']),'trigger:browser:url',{'uri':_0x3d63a9});})['catch'](function(_0x5d34b8){logger[_0x5434('0x28')](_0x5434('0x5f'),JSON[_0x5434('0x27')](_0x5d34b8));});};exports['abandoned']=function(_0x1c7e1f,_0x541b26,_0x4a2c49,_0x450877,_0x278da6,_0x2e59a2){var _0x459b12,_0x3730e9,_0x38108e,_0x4571de;_0x2e59a2['remoteUri']=intUtil[_0x5434('0x4c')](_0x2e59a2[_0x5434('0x2e')]);_0x2e59a2[_0x5434('0x51')]=intUtil[_0x5434('0x4c')](_0x2e59a2[_0x5434('0x51')]);if(_0x278da6&&_0x278da6[_0x5434('0x4d')]){logger[_0x5434('0x17')](_0x5434('0x63'),_0x5434('0x60'));_0x541b26[_0x5434('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e59a2['serverUrl'],_0x541b26[_0x5434('0x52')],md5(_0x541b26['uniqueid']));}else{_0x541b26['recordingURL']='';}return getConnection(_0x2e59a2)[_0x5434('0x30')](function(_0x3c0970){_0x4571de=_0x3c0970;return getUser(_0x2e59a2,'',_0x4571de);})[_0x5434('0x30')](function(_0x4d950c){_0x459b12=_0x4d950c;logger[_0x5434('0x17')]('The\x20User\x20ID\x20is:',_0x459b12['id']);return getEndUser(_0x2e59a2,_0x541b26['calleridname'],_0x541b26['calleridnum'],_0x4571de);})['then'](function(_0x1d165d){_0x3730e9=_0x1d165d;logger[_0x5434('0x17')]('The\x20Enduser\x20ID\x20is:',_0x3730e9['id']);return createTicket(_0x2e59a2,_0x459b12,_0x3730e9,_0x4a2c49,_0x541b26,_0x4a2c49[_0x5434('0x56')],_0x4571de);})['then'](function(_0x2a455b){_0x38108e=_0x2a455b;logger[_0x5434('0x17')]('Ticket\x20created!');logger[_0x5434('0x17')](_0x5434('0x58'),_0x38108e['id']);})[_0x5434('0x29')](function(_0x4c9b4d){logger['error']('[ABANDONED]',JSON['stringify'](_0x4c9b4d));});}; \ No newline at end of file +var _0x7daf=['admin','HelpDesk','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','email1','first_name','last_name','userId','username','getUser','[vTiger],\x20%s,\x20%s,\x20%s','Searching\x20end\x20user\x20with\x20phone','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','getConnection','[HTTP]','queue','monitor_format','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','[ABANDONED]','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','getString','Subjects','Descriptions','POST','format','remoteUri','create'];(function(_0x3e3a5e,_0x24d606){var _0x45cdcb=function(_0x4b6c0d){while(--_0x4b6c0d){_0x3e3a5e['push'](_0x3e3a5e['shift']());}};_0x45cdcb(++_0x24d606);}(_0x7daf,0xaa));var _0xf7da=function(_0x2587ca,_0x231303){_0x2587ca=_0x2587ca-0x0;var _0x5aada1=_0x7daf[_0x2587ca];return _0x5aada1;};'use strict';var _=require('lodash');var rp=require(_0xf7da('0x0'));var BPromise=require('bluebird');var md5=require(_0xf7da('0x1'));var util=require(_0xf7da('0x2'));var Redis=require('ioredis');var intUtil=require(_0xf7da('0x3'));var config=require(_0xf7da('0x4'));var logger=require(_0xf7da('0x5'))(_0xf7da('0x6'));config[_0xf7da('0x7')]=_['defaults'](config[_0xf7da('0x7')],{'host':_0xf7da('0x8'),'port':0x18eb});var io=require(_0xf7da('0x9'))(new Redis(config[_0xf7da('0x7')]));function emit(_0x2c70ad,_0x468ca3,_0x53d71f){io['to'](_0x2c70ad)[_0xf7da('0xa')](_0x468ca3,_0x53d71f);}function getCustomFields(_0x3e00f1,_0x326ff5){var _0x1eb33d={};if(_0x3e00f1[_0xf7da('0xb')]>0x0){_[_0xf7da('0xc')](_0x3e00f1,function(_0x209f37){if(_0x209f37[_0xf7da('0xd')]===_0xf7da('0xe')&&_0x209f37[_0xf7da('0xf')]){_0x1eb33d[_0x209f37['idField']]=_0x209f37['content'][_0xf7da('0x10')]();}else if(_0x209f37[_0xf7da('0xd')]===_0xf7da('0x11')&&_0x209f37[_0xf7da('0x12')]&&_0x209f37[_0xf7da('0xf')]&&_0x326ff5[_0x209f37[_0xf7da('0x12')]]){_0x1eb33d[_0x209f37['idField']]=_0x326ff5[_0x209f37[_0xf7da('0x12')]][_0xf7da('0x10')]();}else if(_0x209f37['type']===_0xf7da('0x13')&&_0x209f37[_0xf7da('0x14')]&&_0x209f37[_0xf7da('0x14')][_0xf7da('0x15')]&&_0x209f37[_0xf7da('0xf')]&&_0x326ff5[_0x209f37[_0xf7da('0x14')]['name']['toLowerCase']()]){_0x1eb33d[_0x209f37['idField']]=_0x326ff5[_0x209f37[_0xf7da('0x14')][_0xf7da('0x15')][_0xf7da('0x16')]()][_0xf7da('0x10')]();}});}return _0x1eb33d;}function createTicket(_0x336fca,_0x1f3d53,_0xb75a2c,_0x13cd4a,_0x349e28,_0xc165c3,_0x303459){logger[_0xf7da('0x17')](_0xf7da('0x18'));var _0xc89042=_['merge']({'parent_id':'','assigned_user_id':_0x1f3d53['id'],'ticketpriorities':_0xf7da('0x19'),'ticketstatus':_0xf7da('0x1a'),'ticket_title':intUtil[_0xf7da('0x1b')](_0x13cd4a[_0xf7da('0x1c')],_0x349e28,'\x20'),'description':intUtil[_0xf7da('0x1b')](_0x13cd4a[_0xf7da('0x1d')],_0x349e28,'\x0a'),'contact_id':_0xb75a2c['id']},getCustomFields(_0xc165c3,_0x349e28));var _0x119f49={'method':_0xf7da('0x1e'),'uri':util[_0xf7da('0x1f')]('%s/webservice.php',_0x336fca[_0xf7da('0x20')]),'form':{'operation':_0xf7da('0x21'),'username':_0xf7da('0x22'),'sessionName':_0x303459['sessionName'],'elementType':_0xf7da('0x23'),'element':JSON[_0xf7da('0x24')](_0xc89042)},'json':!![]};return request(_0x119f49)[_0xf7da('0x25')](function(_0x4630ae){if(_0x4630ae[_0xf7da('0x26')]){return BPromise[_0xf7da('0x27')]({'id':_0x4630ae['result']['id']});}else{throw new Error(util[_0xf7da('0x1f')](_0xf7da('0x28'),JSON[_0xf7da('0x24')](_0x4630ae['error'])));}})[_0xf7da('0x29')](function(_0x2c75c4){var _0x3fa1f2=_0x2c75c4[_0xf7da('0x2a')]||0x1f4;logger[_0xf7da('0x2b')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xf7da('0x2c'),_0x3fa1f2,JSON['stringify'](_0x2c75c4));});}function getUser(_0x258c74,_0xdaef0d,_0x1dfcc5){if(intUtil[_0xf7da('0x2d')](_0xdaef0d)){logger['info'](_0xf7da('0x2e'),_0xdaef0d);return request({'method':_0xf7da('0x2f'),'uri':util[_0xf7da('0x1f')](_0xf7da('0x30'),_0x258c74[_0xf7da('0x20')]),'qs':{'operation':_0xf7da('0x31'),'username':_0xf7da('0x22'),'sessionName':_0x1dfcc5[_0xf7da('0x32')],'query':util['format'](_0xf7da('0x33'),_0xdaef0d)},'json':!![]})[_0xf7da('0x25')](function(_0x238074){if(_0x238074[_0xf7da('0x26')]&&_0x238074[_0xf7da('0x34')]['length']){logger[_0xf7da('0x17')](_0xf7da('0x35'));return BPromise['resolve']({'id':_0x238074[_0xf7da('0x34')][0x0]['id'],'email':_0x238074['result'][0x0][_0xf7da('0x36')],'name':_0x238074[_0xf7da('0x34')][0x0][_0xf7da('0x37')]+'\x20'+_0x238074[_0xf7da('0x34')][_0xf7da('0x38')]});}else{logger[_0xf7da('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xf7da('0x27')]({'id':_0x1dfcc5[_0xf7da('0x39')],'email':_0x258c74[_0xf7da('0x3a')],'name':'admin'});}})['catch'](function(_0x3f048a){var _0x4f5637=_0x3f048a['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xf7da('0x3b'),_0x4f5637,JSON['stringify'](_0x3f048a));});}else{logger[_0xf7da('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xf7da('0x27')]({'id':_0x1dfcc5['userId'],'email':_0x258c74[_0xf7da('0x3a')],'name':_0xf7da('0x22')})[_0xf7da('0x29')](function(_0x281fd4){var _0x44f982=_0x281fd4['statusCode']||0x1f4;logger[_0xf7da('0x2b')](_0xf7da('0x3c'),_0xf7da('0x3b'),_0x44f982,JSON[_0xf7da('0x24')](_0x281fd4));});}}function getEndUser(_0x41ad75,_0x18e237,_0x503b22,_0x152da6){logger[_0xf7da('0x17')](_0xf7da('0x3d'),_0x503b22);return request({'method':_0xf7da('0x2f'),'uri':util[_0xf7da('0x1f')]('%s/webservice.php',_0x41ad75[_0xf7da('0x20')]),'qs':{'operation':_0xf7da('0x31'),'username':_0xf7da('0x22'),'sessionName':_0x152da6['sessionName'],'query':util[_0xf7da('0x1f')]('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;',_0x503b22,_0x503b22,_0x503b22,_0x503b22,_0x503b22)},'json':!![]})['then'](function(_0x5519a0){if(_0x5519a0[_0xf7da('0x26')]&&_0x5519a0[_0xf7da('0x34')][_0xf7da('0xb')]){logger[_0xf7da('0x17')](_0xf7da('0x3e'));return BPromise[_0xf7da('0x27')]({'id':_0x5519a0[_0xf7da('0x34')][0x0]['id'],'name':_0x5519a0[_0xf7da('0x34')][0x0][_0xf7da('0x3f')]+'\x20'+_0x5519a0[_0xf7da('0x34')][0x0][_0xf7da('0x40')],'phone':_0x503b22});}else{logger[_0xf7da('0x17')](_0xf7da('0x41'));return request({'method':_0xf7da('0x1e'),'uri':util[_0xf7da('0x1f')]('%s/webservice.php',_0x41ad75[_0xf7da('0x20')]),'form':{'operation':_0xf7da('0x21'),'sessionName':_0x152da6['sessionName'],'elementType':_0xf7da('0x42'),'element':JSON[_0xf7da('0x24')]({'lastname':_0x18e237,'phone':_0x503b22,'assigned_user_id':'\x20'})},'json':!![]})[_0xf7da('0x25')](function(_0x1e4c73){logger['info'](_0xf7da('0x43'));return BPromise['resolve']({'id':_0x1e4c73[_0xf7da('0x34')]['id'],'name':_0x1e4c73[_0xf7da('0x34')][_0xf7da('0x40')],'phone':_0x1e4c73[_0xf7da('0x34')][_0xf7da('0x44')]});})[_0xf7da('0x29')](function(_0x42c494){var _0x28fc5c=_0x42c494[_0xf7da('0x2a')]||0x1f4;logger[_0xf7da('0x2b')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xf7da('0x45'),_0x28fc5c,JSON[_0xf7da('0x24')](_0x42c494));});}});}function getConnection(_0x5c0fd4){var _0x1ea628=_0x5c0fd4[_0xf7da('0x3a')];var _0xb899cc=_0x5c0fd4[_0xf7da('0x46')];return request({'method':'GET','uri':util[_0xf7da('0x1f')](_0xf7da('0x30'),_0x5c0fd4[_0xf7da('0x20')]),'qs':{'operation':_0xf7da('0x47'),'username':_0x1ea628},'json':!![]})[_0xf7da('0x25')](function(_0x544f61){if(_0x544f61[_0xf7da('0x26')]){return request({'method':_0xf7da('0x1e'),'uri':util[_0xf7da('0x1f')](_0xf7da('0x30'),_0x5c0fd4[_0xf7da('0x20')]),'form':{'operation':_0xf7da('0x48'),'username':_0xf7da('0x22'),'accessKey':md5(_0x544f61[_0xf7da('0x34')][_0xf7da('0x49')]+_0xb899cc)},'json':!![]});}})[_0xf7da('0x25')](function(_0x27b1d2){if(_0x27b1d2[_0xf7da('0x26')]){return BPromise['resolve'](_0x27b1d2[_0xf7da('0x34')]);}else{throw new Error(util[_0xf7da('0x1f')]('Account\x20%d\x20is\x20not\x20valid',_0x5c0fd4['id']));}})[_0xf7da('0x29')](function(_0x37449e){var _0x3ae440=_0x37449e['statusCode']||0x1f4;logger[_0xf7da('0x2b')](_0xf7da('0x3c'),_0xf7da('0x4a'),_0x3ae440,JSON[_0xf7da('0x24')](_0x37449e));});}function request(_0x1c2616){logger[_0xf7da('0x17')](_0xf7da('0x4b'),JSON[_0xf7da('0x24')](_0x1c2616));return rp(_0x1c2616);}exports[_0xf7da('0x4c')]=function(_0x2998b7,_0x125310,_0x176780,_0x4425f0,_0x3a1025,_0x558736){var _0x1986b5,_0x6a3b1f,_0x39c5ed,_0x22eefa;_0x558736[_0xf7da('0x20')]=intUtil['stripTrailingSlash'](_0x558736[_0xf7da('0x20')]);if(_0x3a1025&&_0x3a1025[_0xf7da('0x4d')]){logger[_0xf7da('0x17')]('[QUEUE]',_0xf7da('0x4e'));_0x125310[_0xf7da('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x558736[_0xf7da('0x50')],_0x125310['uniqueid'],md5(_0x125310[_0xf7da('0x51')]));}else{_0x125310['recordingURL']='';}return getConnection(_0x558736)['then'](function(_0x3d32ab){_0x22eefa=_0x3d32ab;return getUser(_0x558736,_0x4425f0[_0xf7da('0x52')],_0x22eefa);})[_0xf7da('0x25')](function(_0x1f4d9f){_0x1986b5=_0x1f4d9f;logger[_0xf7da('0x17')](_0xf7da('0x53'),_0x1986b5['id']);return getEndUser(_0x558736,_0x125310[_0xf7da('0x54')],_0x125310[_0xf7da('0x55')],_0x22eefa);})['then'](function(_0x1e10bf){_0x6a3b1f=_0x1e10bf;logger[_0xf7da('0x17')](_0xf7da('0x56'),_0x6a3b1f['id']);return createTicket(_0x558736,_0x1986b5,_0x6a3b1f,_0x176780,_0x125310,_0x176780[_0xf7da('0x57')],_0x22eefa);})['then'](function(_0x2c9dc5){_0x39c5ed=_0x2c9dc5;logger[_0xf7da('0x17')](_0xf7da('0x58'));logger['info'](_0xf7da('0x59'),_0x39c5ed['id']);var _0x41abe7=util[_0xf7da('0x1f')](_0xf7da('0x5a'),_0x558736['remoteUri'],_[_0xf7da('0x5b')](_0x39c5ed['id'],'x')[0x1]);logger[_0xf7da('0x17')](_0xf7da('0x5c'),_0xf7da('0x5d'));emit(util['format']('user:%s',_0x4425f0[_0xf7da('0x15')]),'trigger:browser:url',{'uri':_0x41abe7});})['catch'](function(_0x1a49c2){logger[_0xf7da('0x2b')](_0xf7da('0x5c'),JSON[_0xf7da('0x24')](_0x1a49c2));});};exports['outbound']=function(_0x4b5d57,_0x3fac00,_0x42a38d,_0x315fe5,_0x46ecad,_0x44feeb,_0x399471){var _0x15c9ea,_0x41aef2,_0x56721b,_0x56548b;_0x44feeb[_0xf7da('0x20')]=intUtil[_0xf7da('0x5e')](_0x44feeb[_0xf7da('0x20')]);_0x44feeb['serverUrl']=intUtil['stripTrailingSlash'](_0x44feeb[_0xf7da('0x50')]);if(_0x399471&&_0x399471[_0xf7da('0x5f')]&&_0x399471['recordingFormat']!==_0xf7da('0x60')){logger['info'](_0xf7da('0x61'),_0xf7da('0x4e'));_0x3fac00[_0xf7da('0x4f')]=util[_0xf7da('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44feeb[_0xf7da('0x50')],_0x3fac00[_0xf7da('0x51')],md5(_0x3fac00[_0xf7da('0x51')]));}return getConnection(_0x44feeb)[_0xf7da('0x25')](function(_0x32da9b){_0x56548b=_0x32da9b;return getUser(_0x44feeb,_0x315fe5[_0xf7da('0x52')],_0x56548b);})[_0xf7da('0x25')](function(_0x5d8f00){_0x15c9ea=_0x5d8f00;logger[_0xf7da('0x17')](_0xf7da('0x53'),_0x15c9ea['id']);return getEndUser(_0x44feeb,_0x3fac00[_0xf7da('0x62')],_0x3fac00[_0xf7da('0x63')],_0x56548b);})[_0xf7da('0x25')](function(_0x2b80c6){_0x41aef2=_0x2b80c6;logger['info']('The\x20Enduser\x20ID\x20is:',_0x41aef2['id']);return createTicket(_0x44feeb,_0x15c9ea,_0x41aef2,_0x42a38d,_0x3fac00,_0x42a38d[_0xf7da('0x57')],_0x56548b);})[_0xf7da('0x25')](function(_0x572c83){_0x56721b=_0x572c83;logger['info']('Ticket\x20created!');logger[_0xf7da('0x17')]('The\x20Ticket\x20ID\x20is:',_0x56721b['id']);var _0x2f4c79=util[_0xf7da('0x1f')](_0xf7da('0x5a'),_0x44feeb[_0xf7da('0x20')],_['split'](_0x56721b['id'],'x')[0x1]);logger['info'](_0xf7da('0x61'),_0xf7da('0x5d'));emit(util['format']('user:%s',_0x315fe5[_0xf7da('0x15')]),_0xf7da('0x64'),{'uri':_0x2f4c79});})['catch'](function(_0x2847af){logger['error'](_0xf7da('0x61'),JSON[_0xf7da('0x24')](_0x2847af));});};exports['abandoned']=function(_0x22412b,_0x4bb7ec,_0x3f4398,_0x3a022e,_0x5d6435,_0x3d5465){var _0x4d478f,_0xedebba,_0xe02cb9,_0x511121;_0x3d5465['remoteUri']=intUtil[_0xf7da('0x5e')](_0x3d5465[_0xf7da('0x20')]);_0x3d5465[_0xf7da('0x50')]=intUtil[_0xf7da('0x5e')](_0x3d5465[_0xf7da('0x50')]);if(_0x5d6435&&_0x5d6435['monitor_format']){logger[_0xf7da('0x17')]('[ABANDONED]',_0xf7da('0x4e'));_0x4bb7ec[_0xf7da('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d5465[_0xf7da('0x50')],_0x4bb7ec[_0xf7da('0x51')],md5(_0x4bb7ec[_0xf7da('0x51')]));}else{_0x4bb7ec[_0xf7da('0x4f')]='';}return getConnection(_0x3d5465)[_0xf7da('0x25')](function(_0x3f4977){_0x511121=_0x3f4977;return getUser(_0x3d5465,'',_0x511121);})['then'](function(_0x1673f0){_0x4d478f=_0x1673f0;logger[_0xf7da('0x17')](_0xf7da('0x53'),_0x4d478f['id']);return getEndUser(_0x3d5465,_0x4bb7ec[_0xf7da('0x54')],_0x4bb7ec['calleridnum'],_0x511121);})[_0xf7da('0x25')](function(_0x27754d){_0xedebba=_0x27754d;logger[_0xf7da('0x17')](_0xf7da('0x56'),_0xedebba['id']);return createTicket(_0x3d5465,_0x4d478f,_0xedebba,_0x3f4398,_0x4bb7ec,_0x3f4398[_0xf7da('0x57')],_0x511121);})[_0xf7da('0x25')](function(_0x3d4b87){_0xe02cb9=_0x3d4b87;logger['info'](_0xf7da('0x58'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xe02cb9['id']);})[_0xf7da('0x29')](function(_0x294ff5){logger[_0xf7da('0x2b')](_0xf7da('0x65'),JSON[_0xf7da('0x24')](_0x294ff5));});}; \ 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 7238fde..5911a81 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 _0xe1d8=['count','Agent\x20found!','find','results','agent','user','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','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','string','customField','nameField','toLowerCase','toString','idField','custom_fields','push','type','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%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','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','destcalleridname','integrationTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','zendesk','localhost','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json'];(function(_0x31a259,_0x2b75b9){var _0x3e415a=function(_0x482cd5){while(--_0x482cd5){_0x31a259['push'](_0x31a259['shift']());}};_0x3e415a(++_0x2b75b9);}(_0xe1d8,0x189));var _0x8e1d=function(_0x1ad0e1,_0x1c11c0){_0x1ad0e1=_0x1ad0e1-0x0;var _0x309419=_0xe1d8[_0x1ad0e1];return _0x309419;};'use strict';var _=require('lodash');var rp=require(_0x8e1d('0x0'));var md5=require('md5');var util=require(_0x8e1d('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x8e1d('0x2'));config['redis']=_['defaults'](config['redis'],{'host':_0x8e1d('0x3'),'port':0x18eb});var io=require(_0x8e1d('0x4'))(new Redis(config[_0x8e1d('0x5')]));function emit(_0x172bc0,_0x461e84,_0x428270){io['to'](_0x172bc0)[_0x8e1d('0x6')](_0x461e84,_0x428270);}var headers={'Content-Type':_0x8e1d('0x7'),'Accept':_0x8e1d('0x7')};function getTicket(_0xc1c78e,_0x48cf90,_0x1f853b,_0x8d24a5,_0x487e29){logger[_0x8e1d('0x8')](_0x8e1d('0x9'));return request({'uri':util[_0x8e1d('0xa')](_0x8e1d('0xb'),_0xc1c78e[_0x8e1d('0xc')]),'method':_0x8e1d('0xd'),'body':{'ticket':_[_0x8e1d('0xe')]({'requester_id':_0x1f853b['id'],'submitter_id':_0x48cf90?_0x48cf90['id']:undefined,'assignee_id':_0x48cf90?_0x48cf90['id']:undefined,'tags':getTags(_0x8d24a5[_0x8e1d('0xf')],_0x8e1d('0x10')),'subject':intUtil[_0x8e1d('0x11')](_0x8d24a5[_0x8e1d('0x12')],_0x487e29,'\x20'),'description':intUtil[_0x8e1d('0x11')](_0x8d24a5['Descriptions'],_0x487e29,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8e1d('0x11')](_0x8d24a5[_0x8e1d('0x13')],_0x487e29,'\x0a')}},getCustomFields(_0x8d24a5[_0x8e1d('0x14')],_0x487e29))}})[_0x8e1d('0x15')](function(_0x5c0590){logger['info'](_0x8e1d('0x16'));return _0x5c0590[_0x8e1d('0x17')];});}function getUser(_0x3ab0ae,_0x3f5c00){if(intUtil[_0x8e1d('0x18')](_0x3f5c00)){logger[_0x8e1d('0x8')](_0x8e1d('0x19'),_0x3f5c00);return request({'uri':util['format'](_0x8e1d('0x1a'),_0x3ab0ae[_0x8e1d('0xc')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x3f5c00)}})['then'](function(_0x162235){if(_0x162235[_0x8e1d('0x1b')]){logger[_0x8e1d('0x8')](_0x8e1d('0x1c'));return _[_0x8e1d('0x1d')](_0x162235[_0x8e1d('0x1e')],{'email':_0x3f5c00,'role':_0x8e1d('0x1f')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8e1d('0xa')]('%s/users/me.json',_0x3ab0ae[_0x8e1d('0xc')])})[_0x8e1d('0x15')](function(_0x42612f){logger[_0x8e1d('0x8')]('Admin\x20account\x20selected.');return _0x42612f[_0x8e1d('0x20')];});}});}else{logger[_0x8e1d('0x8')](_0x8e1d('0x21'));return request({'uri':util[_0x8e1d('0xa')](_0x8e1d('0x22'),_0x3ab0ae[_0x8e1d('0xc')])})[_0x8e1d('0x15')](function(_0x465aac){logger['info'](_0x8e1d('0x23'));return _0x465aac[_0x8e1d('0x20')];});}}function getEndUser(_0x3400f1,_0x4471c9,_0x48cde6){logger['info'](_0x8e1d('0x24'),_0x48cde6);return request({'uri':util[_0x8e1d('0xa')]('%s/search.json',_0x3400f1[_0x8e1d('0xc')]),'qs':{'query':util[_0x8e1d('0xa')](_0x8e1d('0x25'),_0x48cde6)}})[_0x8e1d('0x15')](function(_0x2c46fb){var _0x163d6a;if(_0x2c46fb['results'][_0x8e1d('0x26')]){_0x2c46fb[_0x8e1d('0x1e')]=_[_0x8e1d('0x27')](_0x2c46fb[_0x8e1d('0x1e')],{'suspended':![],'role':_0x8e1d('0x28')});if(_0x2c46fb['results'][_0x8e1d('0x26')]){_0x163d6a=_[_0x8e1d('0x29')](_0x2c46fb[_0x8e1d('0x1e')]);}}if(_0x163d6a){logger[_0x8e1d('0x8')]('Enduser\x20found!');return _0x163d6a;}else{logger[_0x8e1d('0x8')](_0x8e1d('0x2a'));return request({'uri':util[_0x8e1d('0xa')]('%s/users.json',_0x3400f1[_0x8e1d('0xc')]),'method':_0x8e1d('0xd'),'body':{'user':{'role':_0x8e1d('0x28'),'name':util['format'](_0x8e1d('0x2b'),_0x4471c9||_0x48cde6),'phone':_0x48cde6}}})[_0x8e1d('0x15')](function(_0x25b501){logger[_0x8e1d('0x8')](_0x8e1d('0x2c'));return _0x25b501[_0x8e1d('0x20')];});}});}function getAuth(_0x1d06e0){var _0x4689f3;if(_0x1d06e0[_0x8e1d('0x2d')]===_0x8e1d('0x2e')){_0x4689f3=util[_0x8e1d('0xa')](_0x8e1d('0x2f'),_0x1d06e0[_0x8e1d('0x30')],_0x1d06e0[_0x8e1d('0x2e')]);}else if(_0x1d06e0['authType']===_0x8e1d('0x31')){_0x4689f3=util[_0x8e1d('0xa')]('%s/token:%s',_0x1d06e0[_0x8e1d('0x30')],_0x1d06e0[_0x8e1d('0x31')]);}return util[_0x8e1d('0xa')](_0x8e1d('0x32'),new Buffer(_0x4689f3)['toString'](_0x8e1d('0x33')));}function request(_0x4be9f9){logger[_0x8e1d('0x34')](_0x8e1d('0x35'),JSON[_0x8e1d('0x36')](_0x4be9f9));return rp(_[_0x8e1d('0x37')](_0x4be9f9,{'method':_0x8e1d('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x563a50,_0x2185bf){var _0x512f12=[];if(_0x563a50&&_0x563a50[_0x8e1d('0x26')]>0x0){_0x512f12=_[_0x8e1d('0x39')](_0x563a50,_0x2185bf);}return _0x512f12;}function getCustomFields(_0x2b063f,_0x149859){var _0x4b79a9=[];var _0x323d30={'custom_fields':[]};if(_0x2b063f['length']>0x0){_[_0x8e1d('0x3a')](_0x2b063f,function(_0x2ff5c1){if(_0x2ff5c1['type']===_0x8e1d('0x3b')&&_0x2ff5c1['nameField']&&!_0x2ff5c1[_0x8e1d('0x3c')]){_0x323d30[_0x2ff5c1[_0x8e1d('0x3d')][_0x8e1d('0x3e')]()]=_0x2ff5c1['content'][_0x8e1d('0x3f')]();}else if(_0x2ff5c1['type']===_0x8e1d('0x3b')&&_0x2ff5c1[_0x8e1d('0x40')]&&_0x2ff5c1['customField']){_0x323d30[_0x8e1d('0x41')][_0x8e1d('0x42')]({'id':_0x2ff5c1[_0x8e1d('0x40')],'value':_0x2ff5c1['content']['toString']()});}else if(_0x2ff5c1[_0x8e1d('0x43')]===_0x8e1d('0x44')&&_0x2ff5c1[_0x8e1d('0x45')]&&_0x2ff5c1[_0x8e1d('0x40')]&&_0x2ff5c1['customField']){_0x149859[_0x2ff5c1[_0x8e1d('0x45')]]&&_0x323d30[_0x8e1d('0x41')]['push']({'id':_0x2ff5c1[_0x8e1d('0x40')],'value':_0x149859[_0x2ff5c1[_0x8e1d('0x45')]][_0x8e1d('0x3f')]()});}else if(_0x2ff5c1[_0x8e1d('0x43')]===_0x8e1d('0x46')&&_0x2ff5c1[_0x8e1d('0x47')]&&_0x2ff5c1[_0x8e1d('0x47')][_0x8e1d('0x10')]&&_0x2ff5c1[_0x8e1d('0x40')]&&_0x2ff5c1['customField']){_0x149859[_0x2ff5c1[_0x8e1d('0x47')]['name']['toLowerCase']()]&&_0x323d30['custom_fields'][_0x8e1d('0x42')]({'id':_0x2ff5c1[_0x8e1d('0x40')],'value':_0x149859[_0x2ff5c1[_0x8e1d('0x47')][_0x8e1d('0x10')]['toLowerCase']()][_0x8e1d('0x3f')]()});}});}return _0x323d30;}exports[_0x8e1d('0x48')]=function(_0x3a9a9c,_0x14bfab,_0x3621fc,_0x341a3e,_0x3b57d2,_0x3d479c){var _0x57122d,_0x1c4d42;_0x3d479c[_0x8e1d('0xc')]=intUtil[_0x8e1d('0x49')](_0x3d479c[_0x8e1d('0xc')]);_0x3d479c[_0x8e1d('0x4a')]=intUtil[_0x8e1d('0x49')](_0x3d479c[_0x8e1d('0x4a')]);if(_0x3b57d2&&_0x3b57d2[_0x8e1d('0x4b')]){logger['info'](_0x8e1d('0x4c'),_0x8e1d('0x4d'));_0x14bfab['recordingURL']=util[_0x8e1d('0xa')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d479c[_0x8e1d('0x4a')],_0x14bfab['uniqueid'],md5(_0x14bfab['uniqueid']));}else{_0x14bfab[_0x8e1d('0x4e')]='';}headers['Authorization']=getAuth(_0x3d479c);return getUser(_0x3d479c,_0x341a3e[_0x8e1d('0x4f')])[_0x8e1d('0x15')](function(_0x29ad68){_0x57122d=_0x29ad68;logger[_0x8e1d('0x8')](_0x8e1d('0x50'),_0x57122d['id']);return getEndUser(_0x3d479c,_0x14bfab[_0x8e1d('0x51')],_0x14bfab['calleridnum']);})['then'](function(_0x40e27f){_0x1c4d42=_0x40e27f;logger[_0x8e1d('0x8')](_0x8e1d('0x52'),_0x1c4d42['id']);return getTicket(_0x3d479c,_0x57122d,_0x1c4d42,_0x3621fc,_0x14bfab);})[_0x8e1d('0x15')](function(_0x571ade){if(_0x571ade){logger[_0x8e1d('0x8')](_0x8e1d('0x53'),_0x571ade['id']);switch(_0x3d479c[_0x8e1d('0x43')]){case'integrationTab':logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8e1d('0xa')](_0x8e1d('0x54'),_0x3d479c[_0x8e1d('0xc')],_0x57122d['id'],_0x571ade['id']),'method':'POST'});case _0x8e1d('0x55'):logger[_0x8e1d('0x8')](_0x8e1d('0x4c'),_0x8e1d('0x56'));emit(util[_0x8e1d('0xa')](_0x8e1d('0x57'),_0x341a3e[_0x8e1d('0x10')]),_0x8e1d('0x58'),{'uri':util[_0x8e1d('0xa')](_0x8e1d('0x59'),_0x3d479c[_0x8e1d('0xc')],_0x571ade['id'])});break;default:logger[_0x8e1d('0x5a')](_0x8e1d('0x4c'),_0x8e1d('0x5b'));}}})[_0x8e1d('0x5c')](function(_0x317897){logger[_0x8e1d('0x5a')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x8e1d('0x5d')](_0x317897,{'showHidden':!![],'depth':null}));});};exports[_0x8e1d('0x5e')]=function(_0x692cf,_0x1edb72,_0x20fe0a,_0x283143,_0x7f5888,_0x166c94,_0x5e6f4e){var _0x20a331,_0x2c35ef;_0x166c94[_0x8e1d('0xc')]=intUtil['stripTrailingSlash'](_0x166c94[_0x8e1d('0xc')]);_0x166c94['serverUrl']=intUtil[_0x8e1d('0x49')](_0x166c94[_0x8e1d('0x4a')]);if(_0x5e6f4e&&_0x5e6f4e[_0x8e1d('0x5f')]&&_0x5e6f4e[_0x8e1d('0x5f')]!==_0x8e1d('0x60')){logger['info'](_0x8e1d('0x61'),_0x8e1d('0x4d'));_0x1edb72[_0x8e1d('0x4e')]=util[_0x8e1d('0xa')](_0x8e1d('0x62'),_0x166c94[_0x8e1d('0x4a')],_0x1edb72[_0x8e1d('0x63')],md5(_0x1edb72[_0x8e1d('0x63')]));}headers[_0x8e1d('0x64')]=getAuth(_0x166c94);return getUser(_0x166c94,_0x283143['email'])[_0x8e1d('0x15')](function(_0x3a2627){_0x20a331=_0x3a2627;logger[_0x8e1d('0x8')](_0x8e1d('0x50'),_0x20a331['id']);return getEndUser(_0x166c94,_0x1edb72[_0x8e1d('0x65')],_0x1edb72['destcalleridnum']);})[_0x8e1d('0x15')](function(_0x4ad173){_0x2c35ef=_0x4ad173;logger[_0x8e1d('0x8')](_0x8e1d('0x52'),_0x2c35ef['id']);return getTicket(_0x166c94,_0x20a331,_0x2c35ef,_0x20fe0a,_0x1edb72);})['then'](function(_0x71b614){if(_0x71b614){logger[_0x8e1d('0x8')](_0x8e1d('0x53'),_0x71b614['id']);switch(_0x166c94[_0x8e1d('0x43')]){case _0x8e1d('0x66'):logger[_0x8e1d('0x8')](_0x8e1d('0x61'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8e1d('0xa')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x166c94[_0x8e1d('0xc')],_0x20a331['id'],_0x71b614['id']),'method':_0x8e1d('0xd')});case _0x8e1d('0x55'):logger[_0x8e1d('0x8')](_0x8e1d('0x61'),_0x8e1d('0x56'));emit(util[_0x8e1d('0xa')](_0x8e1d('0x57'),_0x283143[_0x8e1d('0x10')]),_0x8e1d('0x58'),{'uri':util[_0x8e1d('0xa')](_0x8e1d('0x59'),_0x166c94['remoteUri'],_0x71b614['id'])});break;default:logger[_0x8e1d('0x5a')](_0x8e1d('0x61'),_0x8e1d('0x5b'));}}})[_0x8e1d('0x5c')](function(_0x43fa78){logger[_0x8e1d('0x5a')](_0x8e1d('0x67'),util[_0x8e1d('0x5d')](_0x43fa78,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x28796f,_0x1f03e7,_0x3bbe3b,_0x2564b8,_0x49759b,_0x2a17b4){var _0x2579cd,_0xb6e8d4;_0x2a17b4[_0x8e1d('0xc')]=intUtil[_0x8e1d('0x49')](_0x2a17b4[_0x8e1d('0xc')]);_0x2a17b4[_0x8e1d('0x4a')]=intUtil['stripTrailingSlash'](_0x2a17b4[_0x8e1d('0x4a')]);if(_0x49759b&&_0x49759b[_0x8e1d('0x4b')]){logger[_0x8e1d('0x8')]('[ABANDONED]',_0x8e1d('0x4d'));_0x1f03e7['recordingURL']=util[_0x8e1d('0xa')](_0x8e1d('0x62'),_0x2a17b4[_0x8e1d('0x4a')],_0x1f03e7['uniqueid'],md5(_0x1f03e7[_0x8e1d('0x63')]));}else{_0x1f03e7[_0x8e1d('0x4e')]='';}headers[_0x8e1d('0x64')]=getAuth(_0x2a17b4);return getUser(_0x2a17b4)[_0x8e1d('0x15')](function(_0x41c7a9){_0x2579cd=_0x41c7a9;logger['info'](_0x8e1d('0x50'),_0x2579cd['id']);return getEndUser(_0x2a17b4,_0x1f03e7[_0x8e1d('0x51')],_0x1f03e7['calleridnum']);})[_0x8e1d('0x15')](function(_0x412d6f){_0xb6e8d4=_0x412d6f;logger['info'](_0x8e1d('0x52'),_0xb6e8d4['id']);return getTicket(_0x2a17b4,_0x2579cd,_0xb6e8d4,_0x3bbe3b,_0x1f03e7);})[_0x8e1d('0x15')](function(_0x1929ce){if(_0x1929ce){logger[_0x8e1d('0x8')](_0x8e1d('0x53'),_0x1929ce['id']);}})['catch'](function(_0x2ce49e){logger['error'](_0x8e1d('0x68'),util[_0x8e1d('0x5d')](_0x2ce49e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x127c=['custom_fields','variable','variableName','push','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','format','POST','merge','Tags','Descriptions','then','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','remoteUri','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','length','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','toString','base64','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','idField'];(function(_0x4d9b3f,_0x1b28df){var _0x2805db=function(_0x1e7aff){while(--_0x1e7aff){_0x4d9b3f['push'](_0x4d9b3f['shift']());}};_0x2805db(++_0x1b28df);}(_0x127c,0x15f));var _0xc127=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x127c[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var rp=require(_0xc127('0x0'));var md5=require(_0xc127('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xc127('0x2'));var config=require(_0xc127('0x3'));var logger=require(_0xc127('0x4'))(_0xc127('0x5'));config[_0xc127('0x6')]=_[_0xc127('0x7')](config[_0xc127('0x6')],{'host':_0xc127('0x8'),'port':0x18eb});var io=require(_0xc127('0x9'))(new Redis(config[_0xc127('0x6')]));function emit(_0x2194bb,_0x3ff6ea,_0x1b230b){io['to'](_0x2194bb)[_0xc127('0xa')](_0x3ff6ea,_0x1b230b);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x23c6eb,_0x20bd0b,_0x3edb50,_0x71df4a,_0x27cf2d){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xc127('0xb')]('%s/tickets.json',_0x23c6eb['remoteUri']),'method':_0xc127('0xc'),'body':{'ticket':_[_0xc127('0xd')]({'requester_id':_0x3edb50['id'],'submitter_id':_0x20bd0b?_0x20bd0b['id']:undefined,'assignee_id':_0x20bd0b?_0x20bd0b['id']:undefined,'tags':getTags(_0x71df4a[_0xc127('0xe')],'name'),'subject':intUtil['getString'](_0x71df4a['Subjects'],_0x27cf2d,'\x20'),'description':intUtil['getString'](_0x71df4a[_0xc127('0xf')],_0x27cf2d,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x71df4a['Descriptions'],_0x27cf2d,'\x0a')}},getCustomFields(_0x71df4a['Fields'],_0x27cf2d))}})[_0xc127('0x10')](function(_0x58ad88){logger['info']('Ticket\x20created!');return _0x58ad88[_0xc127('0x11')];});}function getUser(_0x58c00a,_0x4f0c74){if(intUtil[_0xc127('0x12')](_0x4f0c74)){logger[_0xc127('0x13')](_0xc127('0x14'),_0x4f0c74);return request({'uri':util[_0xc127('0xb')]('%s/search.json',_0x58c00a[_0xc127('0x15')]),'qs':{'query':util[_0xc127('0xb')](_0xc127('0x16'),_0x4f0c74)}})[_0xc127('0x10')](function(_0xeb51c){if(_0xeb51c[_0xc127('0x17')]){logger[_0xc127('0x13')]('Agent\x20found!');return _[_0xc127('0x18')](_0xeb51c[_0xc127('0x19')],{'email':_0x4f0c74,'role':_0xc127('0x1a')});}else{logger[_0xc127('0x13')](_0xc127('0x1b'));return request({'uri':util[_0xc127('0xb')](_0xc127('0x1c'),_0x58c00a['remoteUri'])})[_0xc127('0x10')](function(_0x2a0d28){logger['info'](_0xc127('0x1d'));return _0x2a0d28[_0xc127('0x1e')];});}});}else{logger[_0xc127('0x13')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc127('0xb')](_0xc127('0x1c'),_0x58c00a[_0xc127('0x15')])})['then'](function(_0x935005){logger[_0xc127('0x13')](_0xc127('0x1d'));return _0x935005[_0xc127('0x1e')];});}}function getEndUser(_0x34e89a,_0x35782,_0x237acb){logger[_0xc127('0x13')](_0xc127('0x1f'),_0x237acb);return request({'uri':util[_0xc127('0xb')](_0xc127('0x20'),_0x34e89a[_0xc127('0x15')]),'qs':{'query':util[_0xc127('0xb')]('type:user\x20role:end-user\x20phone:%s',_0x237acb)}})[_0xc127('0x10')](function(_0x31a848){var _0x3b3444;if(_0x31a848[_0xc127('0x19')][_0xc127('0x21')]){_0x31a848[_0xc127('0x19')]=_[_0xc127('0x22')](_0x31a848['results'],{'suspended':![],'role':'end-user'});if(_0x31a848[_0xc127('0x19')][_0xc127('0x21')]){_0x3b3444=_['first'](_0x31a848['results']);}}if(_0x3b3444){logger[_0xc127('0x13')](_0xc127('0x23'));return _0x3b3444;}else{logger[_0xc127('0x13')](_0xc127('0x24'));return request({'uri':util['format'](_0xc127('0x25'),_0x34e89a[_0xc127('0x15')]),'method':_0xc127('0xc'),'body':{'user':{'role':_0xc127('0x26'),'name':util[_0xc127('0xb')](_0xc127('0x27'),_0x35782||_0x237acb),'phone':_0x237acb}}})['then'](function(_0x37cdbc){logger['info'](_0xc127('0x28'));return _0x37cdbc['user'];});}});}function getAuth(_0x428729){var _0x547c3b;if(_0x428729['authType']===_0xc127('0x29')){_0x547c3b=util[_0xc127('0xb')](_0xc127('0x2a'),_0x428729[_0xc127('0x2b')],_0x428729[_0xc127('0x29')]);}else if(_0x428729[_0xc127('0x2c')]===_0xc127('0x2d')){_0x547c3b=util['format'](_0xc127('0x2e'),_0x428729[_0xc127('0x2b')],_0x428729[_0xc127('0x2d')]);}return util[_0xc127('0xb')]('Basic\x20%s',new Buffer(_0x547c3b)[_0xc127('0x2f')](_0xc127('0x30')));}function request(_0x54501d){logger['debug'](_0xc127('0x31'),JSON[_0xc127('0x32')](_0x54501d));return rp(_[_0xc127('0x7')](_0x54501d,{'method':_0xc127('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x3ac5f1,_0x480e2e){var _0x461e31=[];if(_0x3ac5f1&&_0x3ac5f1[_0xc127('0x21')]>0x0){_0x461e31=_[_0xc127('0x34')](_0x3ac5f1,_0x480e2e);}return _0x461e31;}function getCustomFields(_0x563b10,_0xd9a1){var _0x2f907a=[];var _0x17b9ca={'custom_fields':[]};if(_0x563b10[_0xc127('0x21')]>0x0){_[_0xc127('0x35')](_0x563b10,function(_0x1e3989){if(_0x1e3989[_0xc127('0x36')]===_0xc127('0x37')&&_0x1e3989[_0xc127('0x38')]&&!_0x1e3989[_0xc127('0x39')]){_0x17b9ca[_0x1e3989[_0xc127('0x38')][_0xc127('0x3a')]()]=_0x1e3989[_0xc127('0x3b')][_0xc127('0x2f')]();}else if(_0x1e3989['type']===_0xc127('0x37')&&_0x1e3989[_0xc127('0x3c')]&&_0x1e3989[_0xc127('0x39')]){_0x17b9ca[_0xc127('0x3d')]['push']({'id':_0x1e3989[_0xc127('0x3c')],'value':_0x1e3989['content']['toString']()});}else if(_0x1e3989[_0xc127('0x36')]===_0xc127('0x3e')&&_0x1e3989[_0xc127('0x3f')]&&_0x1e3989[_0xc127('0x3c')]&&_0x1e3989[_0xc127('0x39')]){_0xd9a1[_0x1e3989[_0xc127('0x3f')]]&&_0x17b9ca['custom_fields'][_0xc127('0x40')]({'id':_0x1e3989['idField'],'value':_0xd9a1[_0x1e3989[_0xc127('0x3f')]][_0xc127('0x2f')]()});}else if(_0x1e3989[_0xc127('0x36')]===_0xc127('0x41')&&_0x1e3989['Variable']&&_0x1e3989[_0xc127('0x42')]['name']&&_0x1e3989[_0xc127('0x3c')]&&_0x1e3989['customField']){_0xd9a1[_0x1e3989[_0xc127('0x42')][_0xc127('0x43')][_0xc127('0x3a')]()]&&_0x17b9ca[_0xc127('0x3d')][_0xc127('0x40')]({'id':_0x1e3989['idField'],'value':_0xd9a1[_0x1e3989[_0xc127('0x42')][_0xc127('0x43')][_0xc127('0x3a')]()][_0xc127('0x2f')]()});}});}return _0x17b9ca;}exports[_0xc127('0x44')]=function(_0x46eb59,_0x47be46,_0x5376b4,_0x4d9208,_0x3f45f1,_0x38cc1b){var _0x45a8ec,_0x1a5ca6;_0x38cc1b[_0xc127('0x15')]=intUtil[_0xc127('0x45')](_0x38cc1b[_0xc127('0x15')]);_0x38cc1b['serverUrl']=intUtil['stripTrailingSlash'](_0x38cc1b[_0xc127('0x46')]);if(_0x3f45f1&&_0x3f45f1[_0xc127('0x47')]){logger[_0xc127('0x13')](_0xc127('0x48'),_0xc127('0x49'));_0x47be46['recordingURL']=util[_0xc127('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38cc1b['serverUrl'],_0x47be46[_0xc127('0x4a')],md5(_0x47be46[_0xc127('0x4a')]));}else{_0x47be46[_0xc127('0x4b')]='';}headers[_0xc127('0x4c')]=getAuth(_0x38cc1b);return getUser(_0x38cc1b,_0x4d9208[_0xc127('0x4d')])[_0xc127('0x10')](function(_0x507349){_0x45a8ec=_0x507349;logger[_0xc127('0x13')](_0xc127('0x4e'),_0x45a8ec['id']);return getEndUser(_0x38cc1b,_0x47be46[_0xc127('0x4f')],_0x47be46[_0xc127('0x50')]);})[_0xc127('0x10')](function(_0x3d42b9){_0x1a5ca6=_0x3d42b9;logger['info'](_0xc127('0x51'),_0x1a5ca6['id']);return getTicket(_0x38cc1b,_0x45a8ec,_0x1a5ca6,_0x5376b4,_0x47be46);})[_0xc127('0x10')](function(_0x206bf7){if(_0x206bf7){logger[_0xc127('0x13')]('The\x20Ticket\x20ID\x20is:',_0x206bf7['id']);switch(_0x38cc1b[_0xc127('0x36')]){case _0xc127('0x52'):logger[_0xc127('0x13')](_0xc127('0x48'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc127('0xb')](_0xc127('0x53'),_0x38cc1b[_0xc127('0x15')],_0x45a8ec['id'],_0x206bf7['id']),'method':_0xc127('0xc')});case'newTab':logger[_0xc127('0x13')](_0xc127('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc127('0xb')](_0xc127('0x54'),_0x4d9208[_0xc127('0x43')]),_0xc127('0x55'),{'uri':util[_0xc127('0xb')](_0xc127('0x56'),_0x38cc1b['remoteUri'],_0x206bf7['id'])});break;default:logger['error'](_0xc127('0x48'),_0xc127('0x57'));}}})[_0xc127('0x58')](function(_0x358d47){logger[_0xc127('0x59')](_0xc127('0x5a'),util[_0xc127('0x5b')](_0x358d47,{'showHidden':!![],'depth':null}));});};exports[_0xc127('0x5c')]=function(_0x3e97ac,_0x23755d,_0x5484a5,_0x1b656a,_0x48cb8e,_0x5823fa,_0x278084){var _0x37e068,_0x575943;_0x5823fa[_0xc127('0x15')]=intUtil['stripTrailingSlash'](_0x5823fa[_0xc127('0x15')]);_0x5823fa[_0xc127('0x46')]=intUtil['stripTrailingSlash'](_0x5823fa[_0xc127('0x46')]);if(_0x278084&&_0x278084[_0xc127('0x5d')]&&_0x278084[_0xc127('0x5d')]!==_0xc127('0x5e')){logger[_0xc127('0x13')](_0xc127('0x5f'),_0xc127('0x49'));_0x23755d[_0xc127('0x4b')]=util[_0xc127('0xb')](_0xc127('0x60'),_0x5823fa['serverUrl'],_0x23755d[_0xc127('0x4a')],md5(_0x23755d[_0xc127('0x4a')]));}headers[_0xc127('0x4c')]=getAuth(_0x5823fa);return getUser(_0x5823fa,_0x1b656a[_0xc127('0x4d')])[_0xc127('0x10')](function(_0x222b8f){_0x37e068=_0x222b8f;logger[_0xc127('0x13')](_0xc127('0x4e'),_0x37e068['id']);return getEndUser(_0x5823fa,_0x23755d['destcalleridname'],_0x23755d[_0xc127('0x61')]);})[_0xc127('0x10')](function(_0x47a9d5){_0x575943=_0x47a9d5;logger[_0xc127('0x13')](_0xc127('0x51'),_0x575943['id']);return getTicket(_0x5823fa,_0x37e068,_0x575943,_0x5484a5,_0x23755d);})[_0xc127('0x10')](function(_0x2b0eb6){if(_0x2b0eb6){logger[_0xc127('0x13')](_0xc127('0x62'),_0x2b0eb6['id']);switch(_0x5823fa[_0xc127('0x36')]){case'integrationTab':logger[_0xc127('0x13')](_0xc127('0x5f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc127('0xb')](_0xc127('0x53'),_0x5823fa[_0xc127('0x15')],_0x37e068['id'],_0x2b0eb6['id']),'method':_0xc127('0xc')});case'newTab':logger[_0xc127('0x13')](_0xc127('0x5f'),_0xc127('0x63'));emit(util[_0xc127('0xb')]('user:%s',_0x1b656a['name']),_0xc127('0x55'),{'uri':util['format'](_0xc127('0x56'),_0x5823fa[_0xc127('0x15')],_0x2b0eb6['id'])});break;default:logger[_0xc127('0x59')](_0xc127('0x5f'),_0xc127('0x57'));}}})[_0xc127('0x58')](function(_0x35f075){logger[_0xc127('0x59')](_0xc127('0x64'),util[_0xc127('0x5b')](_0x35f075,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x21084b,_0x40693a,_0x2fcc9d,_0x260ca3,_0x5580ae,_0x272e07){var _0x140672,_0x1d4847;_0x272e07[_0xc127('0x15')]=intUtil['stripTrailingSlash'](_0x272e07['remoteUri']);_0x272e07[_0xc127('0x46')]=intUtil[_0xc127('0x45')](_0x272e07[_0xc127('0x46')]);if(_0x5580ae&&_0x5580ae[_0xc127('0x47')]){logger[_0xc127('0x13')](_0xc127('0x65'),'Recording\x20is\x20enabled!');_0x40693a[_0xc127('0x4b')]=util[_0xc127('0xb')](_0xc127('0x60'),_0x272e07[_0xc127('0x46')],_0x40693a[_0xc127('0x4a')],md5(_0x40693a['uniqueid']));}else{_0x40693a[_0xc127('0x4b')]='';}headers[_0xc127('0x4c')]=getAuth(_0x272e07);return getUser(_0x272e07)[_0xc127('0x10')](function(_0x5de342){_0x140672=_0x5de342;logger[_0xc127('0x13')](_0xc127('0x4e'),_0x140672['id']);return getEndUser(_0x272e07,_0x40693a['calleridname'],_0x40693a['calleridnum']);})['then'](function(_0x449e1a){_0x1d4847=_0x449e1a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1d4847['id']);return getTicket(_0x272e07,_0x140672,_0x1d4847,_0x2fcc9d,_0x40693a);})['then'](function(_0xbb2936){if(_0xbb2936){logger[_0xc127('0x13')]('The\x20Ticket\x20ID\x20is:',_0xbb2936['id']);}})[_0xc127('0x58')](function(_0x4b5f67){logger[_0xc127('0x59')](_0xc127('0x66'),util[_0xc127('0x5b')](_0x4b5f67,{'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 c26da78..7f78f6a 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 _0xa0ee=['none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','[ABANDONED]','lodash','./util','xml2json','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Descriptions','lastevent','called','Call\x20Result','Called','complete','connect','Answered','Rejected','Abandoned','talktime','utc','answertime','endtime','diff','mm:ss','CONTACTID','SEMODULE','Leads','SEID','LEADID','','hasOwnProperty','%s','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','authToken','crmapi','then','parse','response','result','recorddetail','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','user','isArrayLikeObject','isNil','find','active','Using\x20the\x20admin\x20account!','log','zoho\x20user','profile','Administrator','The\x20failing\x20result\x20is','error','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','content','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','toJson','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','string','idField','toString','variable','variableName','Variable','name','toLowerCase','split','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','recordingFormat'];(function(_0xaf8267,_0x33968b){var _0x20798b=function(_0xaa6732){while(--_0xaa6732){_0xaf8267['push'](_0xaf8267['shift']());}};_0x20798b(++_0x33968b);}(_0xa0ee,0x10c));var _0xea0e=function(_0x6ae66b,_0x3ba914){_0x6ae66b=_0x6ae66b-0x0;var _0x465cef=_0xa0ee[_0x6ae66b];return _0x465cef;};'use strict';var _=require(_0xea0e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var intUtil=require(_0xea0e('0x1'));var parser=require(_0xea0e('0x2'));var entities=require('entities');var moment=require(_0xea0e('0x3'));var Redis=require(_0xea0e('0x4'));var config=require(_0xea0e('0x5'));var logger=require(_0xea0e('0x6'))(_0xea0e('0x7'));config[_0xea0e('0x8')]=_['defaults'](config[_0xea0e('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xea0e('0x9'))(new Redis(config['redis']));function emit(_0x5205aa,_0x1d873b,_0x41c2da){io['to'](_0x5205aa)[_0xea0e('0xa')](_0x1d873b,_0x41c2da);}var headers={'Content-Type':_0xea0e('0xb'),'Accept':'application/json'};function getCall(_0x18724e,_0xac7548,_0x18277d,_0x1621f2,_0x317856,_0xed035b){logger[_0xea0e('0xc')](_0xea0e('0xd'));var _0x463ddc=_[_0xea0e('0xe')]({'SMOWNERID':_0xac7548['id'],'Call Type':_0xed035b||_0xea0e('0xf'),'Call Start Time':(_0xed035b===_0xea0e('0x10')?_0x317856[_0xea0e('0x11')]:_0x317856[_0xea0e('0x12')])||moment()[_0xea0e('0x13')](_0xea0e('0x14')),'Subject':intUtil['getString'](_0x1621f2['Subjects'],_0x317856,'\x20'),'Description':intUtil[_0xea0e('0x15')](_0x1621f2[_0xea0e('0x16')],_0x317856,'\x0a')},getCustomFields(_0x1621f2['Fields'],_0x317856));switch(_0x317856[_0xea0e('0x17')]){case _0xea0e('0x18'):_0x463ddc[_0xea0e('0x19')]=_0xea0e('0x1a');break;case _0xea0e('0x1b'):case _0xea0e('0x1c'):_0x463ddc['Call\x20Result']=_0xea0e('0x1d');break;case'rejected':_0x463ddc[_0xea0e('0x19')]=_0xea0e('0x1e');break;case'abandoned':_0x463ddc[_0xea0e('0x19')]=_0xea0e('0x1f');break;default:}if(_0x317856[_0xea0e('0x20')]){_0x463ddc['Call\x20Duration']=moment[_0xea0e('0x21')](parseInt(_0x317856[_0xea0e('0x20')])*0x3e8)['format']('mm:ss');}else if(_0x317856[_0xea0e('0x22')]&&_0x317856[_0xea0e('0x23')]){_0x463ddc['Call\x20Duration']=moment['utc'](moment(_0x317856[_0xea0e('0x23')],'YYYY-MM-DD\x20HH:mm:ss')[_0xea0e('0x24')](moment(_0x317856['starttime'],_0xea0e('0x14'))))[_0xea0e('0x13')](_0xea0e('0x25'));}if(_0x18277d['CONTACTID']){_0x463ddc[_0xea0e('0x26')]=_0x18277d[_0xea0e('0x26')];}else if(_0x18277d['LEADID']){_0x463ddc[_0xea0e('0x27')]=_0xea0e('0x28');_0x463ddc[_0xea0e('0x29')]=_0x18277d[_0xea0e('0x2a')];}var _0x22005c=_0xea0e('0x2b');for(var _0x3f072d in _0x463ddc){if(_0x463ddc[_0xea0e('0x2c')](_0x3f072d)){_0x22005c+=util[_0xea0e('0x13')](_0xea0e('0x2d'),entities[_0xea0e('0x2e')](_0x3f072d),entities[_0xea0e('0x2e')](_0x463ddc[_0x3f072d]));}}_0x22005c+=_0xea0e('0x2f');return request({'method':_0xea0e('0x30'),'uri':util[_0xea0e('0x13')](_0xea0e('0x31'),_0x18724e[_0xea0e('0x32')]),'qs':{'authtoken':_0x18724e[_0xea0e('0x33')],'scope':_0xea0e('0x34'),'xmlData':_0x22005c},'json':!![]})[_0xea0e('0x35')](function(_0x26d388){_0x26d388=JSON[_0xea0e('0x36')](parser['toJson'](_0x26d388));if(_0x26d388[_0xea0e('0x37')]){if(_0x26d388[_0xea0e('0x37')][_0xea0e('0x38')]&&_0x26d388[_0xea0e('0x37')][_0xea0e('0x38')][_0xea0e('0x39')]){logger[_0xea0e('0xc')](_0xea0e('0x3a'));return{'id':_0x26d388[_0xea0e('0x37')]['result'][_0xea0e('0x39')]['FL'][0x0]['$t']};}}throw new Error(_0xea0e('0x3b')+JSON[_0xea0e('0x3c')](_0x26d388));});}function getUser(_0x337005,_0x32b1cc){return request({'method':_0xea0e('0x3d'),'uri':util[_0xea0e('0x13')](_0xea0e('0x3e'),_0x337005['host']),'qs':{'type':_0xea0e('0x3f'),'authtoken':_0x337005[_0xea0e('0x33')],'scope':_0xea0e('0x34')},'json':!![]})['then'](function(_0x7b6bb6){if(_0x7b6bb6['users']&&_0x7b6bb6[_0xea0e('0x40')][_0xea0e('0x41')]){var _0x252b90;console['log']('zoho\x20data\x20users',_0x7b6bb6[_0xea0e('0x40')][_0xea0e('0x41')]);if(_[_0xea0e('0x42')](_0x7b6bb6[_0xea0e('0x40')]['user'])){console['log']('zoho\x20data\x20users',_0x7b6bb6['users'][_0xea0e('0x41')]);if(!_[_0xea0e('0x43')](_0x32b1cc)){_0x252b90=_[_0xea0e('0x44')](_0x7b6bb6[_0xea0e('0x40')][_0xea0e('0x41')],{'email':_0x32b1cc,'profile':'Standard','status':_0xea0e('0x45')});}if(!_[_0xea0e('0x43')](_0x252b90)){logger[_0xea0e('0xc')]('Agent\x20found!');}else{logger[_0xea0e('0xc')](_0xea0e('0x46'));_0x252b90=_[_0xea0e('0x44')](_0x7b6bb6['users'][_0xea0e('0x41')],{'profile':'Administrator'});}console[_0xea0e('0x47')](_0xea0e('0x48'),_0x252b90);return _0x252b90;}else{if(_0x7b6bb6['users'][_0xea0e('0x41')][_0xea0e('0x49')]===_0xea0e('0x4a')){logger[_0xea0e('0xc')](_0xea0e('0x46'));_0x252b90=_0x7b6bb6[_0xea0e('0x40')][_0xea0e('0x41')];return _0x252b90;}else{logger['error'](_0xea0e('0x4b'),JSON['stringify'](_0x7b6bb6));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xea0e('0x3c')](_0x7b6bb6));}}}else{logger[_0xea0e('0x4c')](_0xea0e('0x4b'),JSON[_0xea0e('0x3c')](_0x7b6bb6));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xea0e('0x3c')](_0x7b6bb6));}});}function getEndUser(_0x10b53b,_0x297689,_0x52183a){logger['info']('Searching\x20enduser\x20with\x20phone',_0x52183a);return request({'method':_0xea0e('0x3d'),'uri':util[_0xea0e('0x13')](_0xea0e('0x4d'),_0x10b53b[_0xea0e('0x32')]),'qs':{'authtoken':_0x10b53b[_0xea0e('0x33')],'scope':_0xea0e('0x34'),'criteria':util[_0xea0e('0x13')](_0xea0e('0x4e'),_0x52183a)},'json':!![]})['then'](function(_0x553895){if(_0x553895[_0xea0e('0x37')]&&_0x553895[_0xea0e('0x37')][_0xea0e('0x38')]){logger[_0xea0e('0xc')](_0xea0e('0x4f'));var _0x283c3e={};var _0x228bf0=_0x553895[_0xea0e('0x37')][_0xea0e('0x38')][_0xea0e('0x50')][_0xea0e('0x51')]['no']?_0x553895['response'][_0xea0e('0x38')]['Contacts'][_0xea0e('0x51')]['FL']:_0x553895[_0xea0e('0x37')][_0xea0e('0x38')]['Contacts'][_0xea0e('0x51')][0x0]['FL'];for(var _0x5362de=0x0,_0x267028=_0x228bf0[_0xea0e('0x52')];_0x5362de<_0x267028;_0x5362de++){_0x283c3e[_0x228bf0[_0x5362de][_0xea0e('0x53')]]=_0x228bf0[_0x5362de]['content'];}return _0x283c3e;}else{return request({'method':_0xea0e('0x3d'),'uri':util['format'](_0xea0e('0x54'),_0x10b53b[_0xea0e('0x32')]),'qs':{'authtoken':_0x10b53b[_0xea0e('0x33')],'scope':_0xea0e('0x34'),'criteria':util[_0xea0e('0x13')](_0xea0e('0x4e'),_0x52183a)},'json':!![]})[_0xea0e('0x35')](function(_0x6f436f){if(_0x6f436f[_0xea0e('0x37')]&&_0x6f436f[_0xea0e('0x37')][_0xea0e('0x38')]){logger[_0xea0e('0xc')](_0xea0e('0x55'));var _0x52bedd={};var _0xa971bd=_0x6f436f['response'][_0xea0e('0x38')][_0xea0e('0x28')]['row']['no']?_0x6f436f[_0xea0e('0x37')][_0xea0e('0x38')]['Leads'][_0xea0e('0x51')]['FL']:_0x6f436f[_0xea0e('0x37')][_0xea0e('0x38')][_0xea0e('0x28')][_0xea0e('0x51')][0x0]['FL'];for(var _0x97a671=0x0,_0x5723ba=_0xa971bd[_0xea0e('0x52')];_0x97a671<_0x5723ba;_0x97a671++){_0x52bedd[_0xa971bd[_0x97a671]['val']]=_0xa971bd[_0x97a671][_0xea0e('0x56')];}return _0x52bedd;}else{logger[_0xea0e('0xc')](_0xea0e('0x57'));_0x297689=getName(_0x297689);return request({'method':_0xea0e('0x30'),'uri':util[_0xea0e('0x13')](_0xea0e('0x58'),_0x10b53b[_0xea0e('0x32')]),'qs':{'authtoken':_0x10b53b[_0xea0e('0x33')],'scope':'crmapi','xmlData':util[_0xea0e('0x13')](_0xea0e('0x59'),entities['encodeXML'](_0x297689[0x0]),entities[_0xea0e('0x2e')](_0x297689[0x1]),_0x52183a)},'json':!![]})[_0xea0e('0x35')](function(_0x2f786b){_0x2f786b=JSON['parse'](parser[_0xea0e('0x5a')](_0x2f786b));if(_0x2f786b[_0xea0e('0x37')]){if(_0x2f786b[_0xea0e('0x37')][_0xea0e('0x38')]&&_0x2f786b[_0xea0e('0x37')][_0xea0e('0x38')][_0xea0e('0x39')]){logger[_0xea0e('0xc')](_0xea0e('0x5b'));return request({'method':_0xea0e('0x3d'),'uri':util[_0xea0e('0x13')](_0xea0e('0x5c'),_0x10b53b[_0xea0e('0x32')]),'qs':{'authtoken':_0x10b53b[_0xea0e('0x33')],'scope':_0xea0e('0x34'),'id':_0x2f786b['response']['result'][_0xea0e('0x39')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xea0e('0x5d')+JSON[_0xea0e('0x3c')](_0x2f786b));})[_0xea0e('0x35')](function(_0x23d455){if(_0x23d455['response']){if(_0x23d455[_0xea0e('0x37')][_0xea0e('0x38')]){var _0x10de0e={};for(var _0x2dd834=0x0,_0x11bd73=_0x23d455['response'][_0xea0e('0x38')]['Leads'][_0xea0e('0x51')]['FL']['length'];_0x2dd834<_0x11bd73;_0x2dd834++){_0x10de0e[_0x23d455[_0xea0e('0x37')][_0xea0e('0x38')][_0xea0e('0x28')][_0xea0e('0x51')]['FL'][_0x2dd834][_0xea0e('0x53')]]=_0x23d455[_0xea0e('0x37')][_0xea0e('0x38')][_0xea0e('0x28')][_0xea0e('0x51')]['FL'][_0x2dd834][_0xea0e('0x56')];}return _0x10de0e;}}throw new Error(_0xea0e('0x5e')+JSON['stringify'](_0x23d455));});}});}});}function request(_0x13b894){logger[_0xea0e('0x5f')](_0xea0e('0x60'),JSON[_0xea0e('0x3c')](_0x13b894));return rp(_0x13b894);}function getCustomFields(_0x35112d,_0x439380){var _0x2af437={};if(_0x35112d[_0xea0e('0x52')]>0x0){_[_0xea0e('0x61')](_0x35112d,function(_0xaad756){if(_0xaad756[_0xea0e('0x62')]===_0xea0e('0x63')&&_0xaad756[_0xea0e('0x64')]){_0x2af437[_0xaad756['idField']]=_0xaad756[_0xea0e('0x56')][_0xea0e('0x65')]();}else if(_0xaad756[_0xea0e('0x62')]===_0xea0e('0x66')&&_0xaad756[_0xea0e('0x67')]&&_0xaad756[_0xea0e('0x64')]&&_0x439380[_0xaad756['variableName']]){_0x2af437[_0xaad756[_0xea0e('0x64')]]=_0x439380[_0xaad756[_0xea0e('0x67')]][_0xea0e('0x65')]();}else if(_0xaad756[_0xea0e('0x62')]==='customVariable'&&_0xaad756['Variable']&&_0xaad756[_0xea0e('0x68')][_0xea0e('0x69')]&&_0xaad756[_0xea0e('0x64')]&&_0x439380[_0xaad756[_0xea0e('0x68')][_0xea0e('0x69')][_0xea0e('0x6a')]()]){_0x2af437[_0xaad756['idField']]=_0x439380[_0xaad756['Variable'][_0xea0e('0x69')][_0xea0e('0x6a')]()][_0xea0e('0x65')]();}});}return _0x2af437;}function getName(_0x43b773){if(_0x43b773['indexOf']('\x20')>0x0){var _0xf66404=_0x43b773[_0xea0e('0x6b')](/ (.+)/);if(_0xf66404[0x1]){return _0xf66404;}}return[_0x43b773,_0x43b773];}exports[_0xea0e('0x6c')]=function(_0xb87790,_0x38edf7,_0x47704e,_0x3f8eff,_0x2e29a2,_0x237689){var _0x9a361d,_0x4c1285;_0x237689['host']=intUtil['stripTrailingSlash'](_0x237689[_0xea0e('0x32')]);_0x237689[_0xea0e('0x6d')]=intUtil[_0xea0e('0x6e')](_0x237689[_0xea0e('0x6d')]);if(_0x2e29a2&&_0x2e29a2[_0xea0e('0x6f')]){logger[_0xea0e('0xc')](_0xea0e('0x70'),_0xea0e('0x71'));_0x38edf7[_0xea0e('0x72')]=util[_0xea0e('0x13')](_0xea0e('0x73'),_0x237689[_0xea0e('0x6d')],_0x38edf7[_0xea0e('0x74')],md5(_0x38edf7[_0xea0e('0x74')]));}else{_0x38edf7[_0xea0e('0x72')]='';}return getUser(_0x237689,_0x3f8eff[_0xea0e('0x75')])[_0xea0e('0x35')](function(_0x186538){_0x9a361d=_0x186538;logger['info'](_0xea0e('0x76'),_0x9a361d['id']);return getEndUser(_0x237689,_0x38edf7['calleridname'],_0x38edf7[_0xea0e('0x77')]);})['then'](function(_0x37446c){_0x4c1285=_0x37446c;logger[_0xea0e('0xc')]('The\x20Enduser\x20ID\x20is:',_0x4c1285[_0xea0e('0x26')]||_0x4c1285['LEADID']);return getCall(_0x237689,_0x9a361d,_0x4c1285,_0x47704e,_0x38edf7,_0xea0e('0x78'));})[_0xea0e('0x35')](function(_0xbb110){if(_0xbb110){logger[_0xea0e('0xc')](_0xea0e('0x79'),_0xbb110['id']);logger['info']('[QUEUE]',_0xea0e('0x7a'));emit(util[_0xea0e('0x13')](_0xea0e('0x7b'),_0x3f8eff[_0xea0e('0x69')]),_0xea0e('0x7c'),{'uri':util[_0xea0e('0x13')](_0xea0e('0x7d'),_0x237689[_0xea0e('0x32')],_0xbb110['id'])});}})[_0xea0e('0x7e')](function(_0x356ac8){logger[_0xea0e('0x4c')](_0xea0e('0x70'),JSON[_0xea0e('0x3c')](_0x356ac8));});};exports[_0xea0e('0x10')]=function(_0x1a5cf1,_0x36da56,_0x40a014,_0xf4f3c0,_0x2cf025,_0xb2e21b,_0x483dc8){var _0xdfb7ea,_0x4cbe84;_0xb2e21b['host']=intUtil['stripTrailingSlash'](_0xb2e21b['host']);_0xb2e21b['serverUrl']=intUtil[_0xea0e('0x6e')](_0xb2e21b[_0xea0e('0x6d')]);if(_0x483dc8&&_0x483dc8[_0xea0e('0x7f')]&&_0x483dc8['recordingFormat']!==_0xea0e('0x80')){logger['info'](_0xea0e('0x81'),'Recording\x20is\x20enabled!');_0x36da56[_0xea0e('0x72')]=util[_0xea0e('0x13')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb2e21b[_0xea0e('0x6d')],_0x36da56[_0xea0e('0x74')],md5(_0x36da56[_0xea0e('0x74')]));}return getUser(_0xb2e21b,_0xf4f3c0[_0xea0e('0x75')])[_0xea0e('0x35')](function(_0x6c5a17){_0xdfb7ea=_0x6c5a17;logger['info'](_0xea0e('0x76'),_0xdfb7ea['id']);return getEndUser(_0xb2e21b,_0x36da56['destcalleridname'],_0x36da56['destcalleridnum']);})[_0xea0e('0x35')](function(_0x3fe135){_0x4cbe84=_0x3fe135;logger[_0xea0e('0xc')](_0xea0e('0x82'),_0x4cbe84[_0xea0e('0x26')]||_0x4cbe84[_0xea0e('0x2a')]);return getCall(_0xb2e21b,_0xdfb7ea,_0x4cbe84,_0x40a014,_0x36da56,'Outbound');})['then'](function(_0x4509a2){if(_0x4509a2){logger[_0xea0e('0xc')](_0xea0e('0x79'),_0x4509a2['id']);logger[_0xea0e('0xc')](_0xea0e('0x81'),_0xea0e('0x7a'));emit(util[_0xea0e('0x13')](_0xea0e('0x7b'),_0xf4f3c0[_0xea0e('0x69')]),'trigger:browser:url',{'uri':util[_0xea0e('0x13')](_0xea0e('0x7d'),_0xb2e21b[_0xea0e('0x32')],_0x4509a2['id'])});}})['catch'](function(_0x29eced){logger['error']('[OUTBOUND]',JSON[_0xea0e('0x3c')](_0x29eced));});};exports['abandoned']=function(_0x3b796e,_0x292cee,_0xdfb178,_0x1afd17,_0x5909a5,_0x6e8aa1){var _0x8bf7ad,_0x1d33ac;_0x6e8aa1[_0xea0e('0x32')]=intUtil[_0xea0e('0x6e')](_0x6e8aa1[_0xea0e('0x32')]);_0x6e8aa1['serverUrl']=intUtil[_0xea0e('0x6e')](_0x6e8aa1['serverUrl']);if(_0x5909a5&&_0x5909a5[_0xea0e('0x6f')]){logger[_0xea0e('0xc')](_0xea0e('0x83'),'Recording\x20is\x20enabled!');_0x292cee['recordingURL']=util[_0xea0e('0x13')](_0xea0e('0x73'),_0x6e8aa1[_0xea0e('0x6d')],_0x292cee['uniqueid'],md5(_0x292cee[_0xea0e('0x74')]));}else{_0x292cee[_0xea0e('0x72')]='';}return getUser(_0x6e8aa1)[_0xea0e('0x35')](function(_0x5e067f){_0x8bf7ad=_0x5e067f;logger[_0xea0e('0xc')](_0xea0e('0x76'),_0x8bf7ad['id']);return getEndUser(_0x6e8aa1,_0x292cee['calleridname'],_0x292cee[_0xea0e('0x77')]);})[_0xea0e('0x35')](function(_0x537423){_0x1d33ac=_0x537423;logger[_0xea0e('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1d33ac['CONTACTID']||_0x1d33ac['LEADID']);return getCall(_0x6e8aa1,_0x8bf7ad,_0x1d33ac,_0xdfb178,_0x292cee,_0xea0e('0x78'));})[_0xea0e('0x35')](function(_0x2be0ef){if(_0x2be0ef){logger['info'](_0xea0e('0x79'),_0x2be0ef['id']);}})['catch'](function(_0x1654f3){logger[_0xea0e('0x4c')](_0xea0e('0x83'),JSON[_0xea0e('0x3c')](_0x1654f3));});}; \ No newline at end of file +var _0x89fe=['users','user','log','zoho\x20data\x20users','isArrayLikeObject','isNil','find','Standard','active','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','authToken','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','string','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','user:%s','trigger:browser:url','[ABANDONED]','request-promise','md5','util','./util','xml2json','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Fields','lastevent','called','Call\x20Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','talktime','Call\x20Duration','utc','mm:ss','answertime','endtime','diff','CONTACTID','LEADID','Leads','SEID','','hasOwnProperty','%s','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','crmapi','then','parse','toJson','response','result','recorddetail','Call\x20created!','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x89fe,0xd8));var _0xe89f=function(_0xcf419,_0x307b19){_0xcf419=_0xcf419-0x0;var _0x456a27=_0x89fe[_0xcf419];return _0x456a27;};'use strict';var _=require('lodash');var rp=require(_0xe89f('0x0'));var md5=require(_0xe89f('0x1'));var util=require(_0xe89f('0x2'));var intUtil=require(_0xe89f('0x3'));var parser=require(_0xe89f('0x4'));var entities=require('entities');var moment=require('moment');var Redis=require(_0xe89f('0x5'));var config=require('../../../../config/environment');var logger=require(_0xe89f('0x6'))(_0xe89f('0x7'));config[_0xe89f('0x8')]=_[_0xe89f('0x9')](config[_0xe89f('0x8')],{'host':_0xe89f('0xa'),'port':0x18eb});var io=require(_0xe89f('0xb'))(new Redis(config[_0xe89f('0x8')]));function emit(_0xa89db6,_0x4b2c61,_0xd5125){io['to'](_0xa89db6)[_0xe89f('0xc')](_0x4b2c61,_0xd5125);}var headers={'Content-Type':_0xe89f('0xd'),'Accept':_0xe89f('0xd')};function getCall(_0x161999,_0x36830e,_0x193962,_0x5ccac5,_0x15a0b5,_0x31bc14){logger[_0xe89f('0xe')](_0xe89f('0xf'));var _0x580e97=_[_0xe89f('0x10')]({'SMOWNERID':_0x36830e['id'],'Call Type':_0x31bc14||_0xe89f('0x11'),'Call Start Time':(_0x31bc14===_0xe89f('0x12')?_0x15a0b5[_0xe89f('0x13')]:_0x15a0b5[_0xe89f('0x14')])||moment()[_0xe89f('0x15')](_0xe89f('0x16')),'Subject':intUtil[_0xe89f('0x17')](_0x5ccac5[_0xe89f('0x18')],_0x15a0b5,'\x20'),'Description':intUtil[_0xe89f('0x17')](_0x5ccac5['Descriptions'],_0x15a0b5,'\x0a')},getCustomFields(_0x5ccac5[_0xe89f('0x19')],_0x15a0b5));switch(_0x15a0b5[_0xe89f('0x1a')]){case _0xe89f('0x1b'):_0x580e97[_0xe89f('0x1c')]=_0xe89f('0x1d');break;case'complete':case _0xe89f('0x1e'):_0x580e97[_0xe89f('0x1c')]=_0xe89f('0x1f');break;case _0xe89f('0x20'):_0x580e97[_0xe89f('0x1c')]=_0xe89f('0x21');break;case _0xe89f('0x22'):_0x580e97[_0xe89f('0x1c')]=_0xe89f('0x23');break;default:}if(_0x15a0b5[_0xe89f('0x24')]){_0x580e97[_0xe89f('0x25')]=moment[_0xe89f('0x26')](parseInt(_0x15a0b5[_0xe89f('0x24')])*0x3e8)[_0xe89f('0x15')](_0xe89f('0x27'));}else if(_0x15a0b5[_0xe89f('0x28')]&&_0x15a0b5[_0xe89f('0x29')]){_0x580e97[_0xe89f('0x25')]=moment[_0xe89f('0x26')](moment(_0x15a0b5['endtime'],'YYYY-MM-DD\x20HH:mm:ss')[_0xe89f('0x2a')](moment(_0x15a0b5[_0xe89f('0x13')],_0xe89f('0x16'))))[_0xe89f('0x15')](_0xe89f('0x27'));}if(_0x193962[_0xe89f('0x2b')]){_0x580e97['CONTACTID']=_0x193962[_0xe89f('0x2b')];}else if(_0x193962[_0xe89f('0x2c')]){_0x580e97['SEMODULE']=_0xe89f('0x2d');_0x580e97[_0xe89f('0x2e')]=_0x193962['LEADID'];}var _0x17dc5f=_0xe89f('0x2f');for(var _0x3bb971 in _0x580e97){if(_0x580e97[_0xe89f('0x30')](_0x3bb971)){_0x17dc5f+=util[_0xe89f('0x15')](_0xe89f('0x31'),entities[_0xe89f('0x32')](_0x3bb971),entities[_0xe89f('0x32')](_0x580e97[_0x3bb971]));}}_0x17dc5f+=_0xe89f('0x33');return request({'method':_0xe89f('0x34'),'uri':util['format'](_0xe89f('0x35'),_0x161999[_0xe89f('0x36')]),'qs':{'authtoken':_0x161999['authToken'],'scope':_0xe89f('0x37'),'xmlData':_0x17dc5f},'json':!![]})[_0xe89f('0x38')](function(_0x5a8376){_0x5a8376=JSON[_0xe89f('0x39')](parser[_0xe89f('0x3a')](_0x5a8376));if(_0x5a8376[_0xe89f('0x3b')]){if(_0x5a8376['response'][_0xe89f('0x3c')]&&_0x5a8376[_0xe89f('0x3b')][_0xe89f('0x3c')][_0xe89f('0x3d')]){logger['info'](_0xe89f('0x3e'));return{'id':_0x5a8376['response'][_0xe89f('0x3c')][_0xe89f('0x3d')]['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0xe89f('0x3f')](_0x5a8376));});}function getUser(_0x45ed83,_0x2eb0d0){return request({'method':_0xe89f('0x40'),'uri':util['format'](_0xe89f('0x41'),_0x45ed83[_0xe89f('0x36')]),'qs':{'type':'AllUsers','authtoken':_0x45ed83['authToken'],'scope':'crmapi'},'json':!![]})[_0xe89f('0x38')](function(_0x377f78){if(_0x377f78[_0xe89f('0x42')]&&_0x377f78[_0xe89f('0x42')][_0xe89f('0x43')]){var _0x46e073;console[_0xe89f('0x44')](_0xe89f('0x45'),_0x377f78['users'][_0xe89f('0x43')]);if(_[_0xe89f('0x46')](_0x377f78[_0xe89f('0x42')]['user'])){console['log']('zoho\x20data\x20users',_0x377f78['users']['user']);if(!_[_0xe89f('0x47')](_0x2eb0d0)){_0x46e073=_[_0xe89f('0x48')](_0x377f78['users'][_0xe89f('0x43')],{'email':_0x2eb0d0,'profile':_0xe89f('0x49'),'status':_0xe89f('0x4a')});}if(!_[_0xe89f('0x47')](_0x46e073)){logger['info'](_0xe89f('0x4b'));}else{logger[_0xe89f('0xe')](_0xe89f('0x4c'));_0x46e073=_[_0xe89f('0x48')](_0x377f78['users']['user'],{'profile':_0xe89f('0x4d')});}console[_0xe89f('0x44')]('zoho\x20user',_0x46e073);return _0x46e073;}else{if(_0x377f78[_0xe89f('0x42')][_0xe89f('0x43')][_0xe89f('0x4e')]===_0xe89f('0x4d')){logger[_0xe89f('0xe')](_0xe89f('0x4c'));_0x46e073=_0x377f78[_0xe89f('0x42')][_0xe89f('0x43')];return _0x46e073;}else{logger[_0xe89f('0x4f')](_0xe89f('0x50'),JSON['stringify'](_0x377f78));throw new Error(_0xe89f('0x51')+JSON[_0xe89f('0x3f')](_0x377f78));}}}else{logger[_0xe89f('0x4f')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x377f78));throw new Error(_0xe89f('0x51')+JSON[_0xe89f('0x3f')](_0x377f78));}});}function getEndUser(_0xca2299,_0x481dc0,_0x54bfb2){logger[_0xe89f('0xe')](_0xe89f('0x52'),_0x54bfb2);return request({'method':'GET','uri':util[_0xe89f('0x15')]('https://crm.%s/crm/private/json/Contacts/searchRecords',_0xca2299[_0xe89f('0x36')]),'qs':{'authtoken':_0xca2299[_0xe89f('0x53')],'scope':'crmapi','criteria':util['format'](_0xe89f('0x54'),_0x54bfb2)},'json':!![]})[_0xe89f('0x38')](function(_0x106590){if(_0x106590[_0xe89f('0x3b')]&&_0x106590[_0xe89f('0x3b')][_0xe89f('0x3c')]){logger[_0xe89f('0xe')](_0xe89f('0x55'));var _0x104f98={};var _0x2f97bf=_0x106590['response']['result'][_0xe89f('0x56')][_0xe89f('0x57')]['no']?_0x106590['response'][_0xe89f('0x3c')][_0xe89f('0x56')]['row']['FL']:_0x106590['response']['result'][_0xe89f('0x56')]['row'][0x0]['FL'];for(var _0x28c104=0x0,_0x38ed09=_0x2f97bf[_0xe89f('0x58')];_0x28c104<_0x38ed09;_0x28c104++){_0x104f98[_0x2f97bf[_0x28c104][_0xe89f('0x59')]]=_0x2f97bf[_0x28c104][_0xe89f('0x5a')];}return _0x104f98;}else{return request({'method':_0xe89f('0x40'),'uri':util[_0xe89f('0x15')](_0xe89f('0x5b'),_0xca2299[_0xe89f('0x36')]),'qs':{'authtoken':_0xca2299[_0xe89f('0x53')],'scope':_0xe89f('0x37'),'criteria':util[_0xe89f('0x15')]('((Phone:%s))',_0x54bfb2)},'json':!![]})['then'](function(_0x31afa1){if(_0x31afa1[_0xe89f('0x3b')]&&_0x31afa1['response'][_0xe89f('0x3c')]){logger[_0xe89f('0xe')](_0xe89f('0x5c'));var _0x18c5ab={};var _0x2bb16f=_0x31afa1[_0xe89f('0x3b')][_0xe89f('0x3c')][_0xe89f('0x2d')]['row']['no']?_0x31afa1[_0xe89f('0x3b')][_0xe89f('0x3c')][_0xe89f('0x2d')][_0xe89f('0x57')]['FL']:_0x31afa1[_0xe89f('0x3b')][_0xe89f('0x3c')][_0xe89f('0x2d')][_0xe89f('0x57')][0x0]['FL'];for(var _0x4b6f17=0x0,_0x499b39=_0x2bb16f[_0xe89f('0x58')];_0x4b6f17<_0x499b39;_0x4b6f17++){_0x18c5ab[_0x2bb16f[_0x4b6f17][_0xe89f('0x59')]]=_0x2bb16f[_0x4b6f17][_0xe89f('0x5a')];}return _0x18c5ab;}else{logger[_0xe89f('0xe')](_0xe89f('0x5d'));_0x481dc0=getName(_0x481dc0);return request({'method':_0xe89f('0x34'),'uri':util[_0xe89f('0x15')](_0xe89f('0x5e'),_0xca2299[_0xe89f('0x36')]),'qs':{'authtoken':_0xca2299[_0xe89f('0x53')],'scope':_0xe89f('0x37'),'xmlData':util[_0xe89f('0x15')](_0xe89f('0x5f'),entities[_0xe89f('0x32')](_0x481dc0[0x0]),entities[_0xe89f('0x32')](_0x481dc0[0x1]),_0x54bfb2)},'json':!![]})[_0xe89f('0x38')](function(_0x4a0250){_0x4a0250=JSON[_0xe89f('0x39')](parser[_0xe89f('0x3a')](_0x4a0250));if(_0x4a0250['response']){if(_0x4a0250[_0xe89f('0x3b')][_0xe89f('0x3c')]&&_0x4a0250[_0xe89f('0x3b')][_0xe89f('0x3c')]['recorddetail']){logger['info'](_0xe89f('0x60'));return request({'method':_0xe89f('0x40'),'uri':util[_0xe89f('0x15')](_0xe89f('0x61'),_0xca2299[_0xe89f('0x36')]),'qs':{'authtoken':_0xca2299[_0xe89f('0x53')],'scope':_0xe89f('0x37'),'id':_0x4a0250['response'][_0xe89f('0x3c')]['recorddetail']['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON[_0xe89f('0x3f')](_0x4a0250));})[_0xe89f('0x38')](function(_0x109f06){if(_0x109f06[_0xe89f('0x3b')]){if(_0x109f06[_0xe89f('0x3b')]['result']){var _0x839d12={};for(var _0x275de4=0x0,_0x5ddad0=_0x109f06[_0xe89f('0x3b')]['result'][_0xe89f('0x2d')][_0xe89f('0x57')]['FL']['length'];_0x275de4<_0x5ddad0;_0x275de4++){_0x839d12[_0x109f06[_0xe89f('0x3b')][_0xe89f('0x3c')][_0xe89f('0x2d')][_0xe89f('0x57')]['FL'][_0x275de4][_0xe89f('0x59')]]=_0x109f06[_0xe89f('0x3b')][_0xe89f('0x3c')][_0xe89f('0x2d')][_0xe89f('0x57')]['FL'][_0x275de4]['content'];}return _0x839d12;}}throw new Error(_0xe89f('0x62')+JSON[_0xe89f('0x3f')](_0x109f06));});}});}});}function request(_0x3fcf61){logger[_0xe89f('0x63')](_0xe89f('0x64'),JSON[_0xe89f('0x3f')](_0x3fcf61));return rp(_0x3fcf61);}function getCustomFields(_0x4cb243,_0x46df8c){var _0x28efa9={};if(_0x4cb243[_0xe89f('0x58')]>0x0){_[_0xe89f('0x65')](_0x4cb243,function(_0x5239ef){if(_0x5239ef[_0xe89f('0x66')]===_0xe89f('0x67')&&_0x5239ef[_0xe89f('0x68')]){_0x28efa9[_0x5239ef[_0xe89f('0x68')]]=_0x5239ef[_0xe89f('0x5a')]['toString']();}else if(_0x5239ef[_0xe89f('0x66')]===_0xe89f('0x69')&&_0x5239ef['variableName']&&_0x5239ef[_0xe89f('0x68')]&&_0x46df8c[_0x5239ef[_0xe89f('0x6a')]]){_0x28efa9[_0x5239ef[_0xe89f('0x68')]]=_0x46df8c[_0x5239ef[_0xe89f('0x6a')]][_0xe89f('0x6b')]();}else if(_0x5239ef[_0xe89f('0x66')]===_0xe89f('0x6c')&&_0x5239ef['Variable']&&_0x5239ef[_0xe89f('0x6d')][_0xe89f('0x6e')]&&_0x5239ef[_0xe89f('0x68')]&&_0x46df8c[_0x5239ef[_0xe89f('0x6d')][_0xe89f('0x6e')][_0xe89f('0x6f')]()]){_0x28efa9[_0x5239ef[_0xe89f('0x68')]]=_0x46df8c[_0x5239ef[_0xe89f('0x6d')][_0xe89f('0x6e')][_0xe89f('0x6f')]()][_0xe89f('0x6b')]();}});}return _0x28efa9;}function getName(_0x253c56){if(_0x253c56[_0xe89f('0x70')]('\x20')>0x0){var _0xeccfca=_0x253c56['split'](/ (.+)/);if(_0xeccfca[0x1]){return _0xeccfca;}}return[_0x253c56,_0x253c56];}exports[_0xe89f('0x71')]=function(_0x2e5d38,_0x55d8a6,_0x5bebcb,_0x3bca36,_0x211d2b,_0x86f3c1){var _0x146759,_0x4f3b41;_0x86f3c1['host']=intUtil[_0xe89f('0x72')](_0x86f3c1[_0xe89f('0x36')]);_0x86f3c1[_0xe89f('0x73')]=intUtil[_0xe89f('0x72')](_0x86f3c1[_0xe89f('0x73')]);if(_0x211d2b&&_0x211d2b[_0xe89f('0x74')]){logger[_0xe89f('0xe')](_0xe89f('0x75'),_0xe89f('0x76'));_0x55d8a6[_0xe89f('0x77')]=util[_0xe89f('0x15')](_0xe89f('0x78'),_0x86f3c1[_0xe89f('0x73')],_0x55d8a6[_0xe89f('0x79')],md5(_0x55d8a6[_0xe89f('0x79')]));}else{_0x55d8a6[_0xe89f('0x77')]='';}return getUser(_0x86f3c1,_0x3bca36[_0xe89f('0x7a')])['then'](function(_0x4d0213){_0x146759=_0x4d0213;logger[_0xe89f('0xe')](_0xe89f('0x7b'),_0x146759['id']);return getEndUser(_0x86f3c1,_0x55d8a6[_0xe89f('0x7c')],_0x55d8a6[_0xe89f('0x7d')]);})[_0xe89f('0x38')](function(_0x4c39a2){_0x4f3b41=_0x4c39a2;logger[_0xe89f('0xe')](_0xe89f('0x7e'),_0x4f3b41[_0xe89f('0x2b')]||_0x4f3b41[_0xe89f('0x2c')]);return getCall(_0x86f3c1,_0x146759,_0x4f3b41,_0x5bebcb,_0x55d8a6,_0xe89f('0x7f'));})[_0xe89f('0x38')](function(_0x31eb94){if(_0x31eb94){logger['info'](_0xe89f('0x80'),_0x31eb94['id']);logger[_0xe89f('0xe')](_0xe89f('0x75'),_0xe89f('0x81'));emit(util[_0xe89f('0x15')]('user:%s',_0x3bca36[_0xe89f('0x6e')]),'trigger:browser:url',{'uri':util[_0xe89f('0x15')](_0xe89f('0x82'),_0x86f3c1['host'],_0x31eb94['id'])});}})[_0xe89f('0x83')](function(_0x7ae315){logger[_0xe89f('0x4f')](_0xe89f('0x75'),JSON[_0xe89f('0x3f')](_0x7ae315));});};exports['outbound']=function(_0x5b8569,_0x3debc5,_0xbfacfd,_0xd91e5e,_0x3a58f7,_0xab828d,_0x113991){var _0x816366,_0x91f8e0;_0xab828d[_0xe89f('0x36')]=intUtil[_0xe89f('0x72')](_0xab828d['host']);_0xab828d[_0xe89f('0x73')]=intUtil[_0xe89f('0x72')](_0xab828d['serverUrl']);if(_0x113991&&_0x113991[_0xe89f('0x84')]&&_0x113991['recordingFormat']!==_0xe89f('0x85')){logger[_0xe89f('0xe')](_0xe89f('0x86'),_0xe89f('0x76'));_0x3debc5[_0xe89f('0x77')]=util[_0xe89f('0x15')](_0xe89f('0x78'),_0xab828d[_0xe89f('0x73')],_0x3debc5[_0xe89f('0x79')],md5(_0x3debc5['uniqueid']));}return getUser(_0xab828d,_0xd91e5e['email'])[_0xe89f('0x38')](function(_0x12c6ca){_0x816366=_0x12c6ca;logger['info']('The\x20User\x20ID\x20is:',_0x816366['id']);return getEndUser(_0xab828d,_0x3debc5[_0xe89f('0x87')],_0x3debc5[_0xe89f('0x88')]);})['then'](function(_0x2b2979){_0x91f8e0=_0x2b2979;logger[_0xe89f('0xe')](_0xe89f('0x7e'),_0x91f8e0[_0xe89f('0x2b')]||_0x91f8e0[_0xe89f('0x2c')]);return getCall(_0xab828d,_0x816366,_0x91f8e0,_0xbfacfd,_0x3debc5,_0xe89f('0x89'));})[_0xe89f('0x38')](function(_0x22c229){if(_0x22c229){logger['info'](_0xe89f('0x80'),_0x22c229['id']);logger[_0xe89f('0xe')](_0xe89f('0x86'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe89f('0x15')](_0xe89f('0x8a'),_0xd91e5e[_0xe89f('0x6e')]),_0xe89f('0x8b'),{'uri':util['format']('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0xab828d[_0xe89f('0x36')],_0x22c229['id'])});}})[_0xe89f('0x83')](function(_0x9ce3c8){logger[_0xe89f('0x4f')](_0xe89f('0x86'),JSON[_0xe89f('0x3f')](_0x9ce3c8));});};exports[_0xe89f('0x22')]=function(_0x37ca26,_0x465832,_0x139579,_0x3346da,_0x18e9f7,_0x2ebf6c){var _0xa910f6,_0x2abd4d;_0x2ebf6c[_0xe89f('0x36')]=intUtil[_0xe89f('0x72')](_0x2ebf6c[_0xe89f('0x36')]);_0x2ebf6c[_0xe89f('0x73')]=intUtil[_0xe89f('0x72')](_0x2ebf6c[_0xe89f('0x73')]);if(_0x18e9f7&&_0x18e9f7['monitor_format']){logger[_0xe89f('0xe')](_0xe89f('0x8c'),'Recording\x20is\x20enabled!');_0x465832[_0xe89f('0x77')]=util['format'](_0xe89f('0x78'),_0x2ebf6c[_0xe89f('0x73')],_0x465832['uniqueid'],md5(_0x465832[_0xe89f('0x79')]));}else{_0x465832[_0xe89f('0x77')]='';}return getUser(_0x2ebf6c)[_0xe89f('0x38')](function(_0xe0ff4d){_0xa910f6=_0xe0ff4d;logger['info'](_0xe89f('0x7b'),_0xa910f6['id']);return getEndUser(_0x2ebf6c,_0x465832[_0xe89f('0x7c')],_0x465832['calleridnum']);})[_0xe89f('0x38')](function(_0x22de19){_0x2abd4d=_0x22de19;logger[_0xe89f('0xe')](_0xe89f('0x7e'),_0x2abd4d[_0xe89f('0x2b')]||_0x2abd4d[_0xe89f('0x2c')]);return getCall(_0x2ebf6c,_0xa910f6,_0x2abd4d,_0x139579,_0x465832,_0xe89f('0x7f'));})['then'](function(_0x1e9b25){if(_0x1e9b25){logger[_0xe89f('0xe')](_0xe89f('0x80'),_0x1e9b25['id']);}})['catch'](function(_0x3de944){logger[_0xe89f('0x4f')](_0xe89f('0x8c'),JSON[_0xe89f('0x3f')](_0x3de944));});}; \ 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 4ff3e96..5607b3c 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x4942e2,_0x141cdd){var _0xe797e3=function(_0x14c8b7){while(--_0x14c8b7){_0x4942e2['push'](_0x4942e2['shift']());}};_0xe797e3(++_0x141cdd);}(_0x7a54,0x106));var _0x47a5=function(_0x481982,_0x29000e){_0x481982=_0x481982-0x0;var _0x1f642d=_0x7a54[_0x481982];return _0x1f642d;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0xa09ec3,_0x30f250){var _0x17139a=function(_0x454f28){while(--_0x454f28){_0xa09ec3['push'](_0xa09ec3['shift']());}};_0x17139a(++_0x30f250);}(_0x7a54,0x106));var _0x47a5=function(_0x1220b7,_0x5cb1ea){_0x1220b7=_0x1220b7-0x0;var _0x1634fd=_0x7a54[_0x1220b7];return _0x1634fd;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 0463f60..507c335 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 _0x4f7b=['lodash','mustache','trigger','exec','data1','render','headers','data6','parse','error','stack','GET','POST','PUT','data7','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x3a01e9,_0x17b221){var _0x2a8d5e=function(_0x163ee2){while(--_0x163ee2){_0x3a01e9['push'](_0x3a01e9['shift']());}};_0x2a8d5e(++_0x17b221);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x4913ac,_0x16cbb7){_0x4913ac=_0x4913ac-0x0;var _0x404bc4=_0x4f7b[_0x4913ac];return _0x404bc4;};'use strict';var rp=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var _=require(_0xb4f7('0x2'));var Mustache=require(_0xb4f7('0x3'));var logger=require('../../../../config/logger')(_0xb4f7('0x4'));exports[_0xb4f7('0x5')]=function(_0x18a8f6,_0x297970){var _0x1d34b7,_0x37ef5a;var _0x2dd6fd={'method':_0x18a8f6[_0xb4f7('0x6')]['toUpperCase'](),'uri':encodeURI(Mustache[_0xb4f7('0x7')](_0x18a8f6['data2'],_0x297970)),'json':!![],'resolveWithFullResponse':!![]};try{_0x2dd6fd[_0xb4f7('0x8')]=_0x18a8f6[_0xb4f7('0x9')]?JSON[_0xb4f7('0xa')](Mustache['render'](_0x18a8f6[_0xb4f7('0x9')],_0x297970)):{};}catch(_0x5af41f){logger[_0xb4f7('0xb')](_0x5af41f[_0xb4f7('0xc')]);}switch(_0x18a8f6[_0xb4f7('0x6')]['toUpperCase']()){case _0xb4f7('0xd'):_0x2dd6fd['qs']=_0x297970;break;case _0xb4f7('0xe'):case _0xb4f7('0xf'):_0x1d34b7={};if(_0x18a8f6[_0xb4f7('0x10')]){_0x1d34b7=Mustache[_0xb4f7('0x7')](_0x18a8f6[_0xb4f7('0x10')],_0x297970);}else{_0x1d34b7=_0x297970;}_0x2dd6fd[_0xb4f7('0x11')]=JSON[_0xb4f7('0xa')](_0x1d34b7);break;}logger['info'](util[_0xb4f7('0x12')](_0xb4f7('0x13'),_0x18a8f6[_0xb4f7('0x6')],_0x18a8f6[_0xb4f7('0x14')],JSON[_0xb4f7('0x15')](_0x2dd6fd)));rp(_0x2dd6fd)[_0xb4f7('0x16')](function(_0x56c6a5){_0x1d34b7=!_[_0xb4f7('0x17')](_0x1d34b7)?',\x20request\x20body:\x20'+_0x1d34b7:'';_0x37ef5a=typeof _0x56c6a5[_0xb4f7('0x11')]===_0xb4f7('0x18')?JSON[_0xb4f7('0x15')](_0x56c6a5[_0xb4f7('0x11')]):_0x56c6a5[_0xb4f7('0x11')];logger[_0xb4f7('0x19')](util[_0xb4f7('0x12')](_0xb4f7('0x1a'),_0x18a8f6[_0xb4f7('0x6')],_0x18a8f6['data2'],_0x56c6a5[_0xb4f7('0x1b')],_0x37ef5a));})[_0xb4f7('0x1c')](function(_0x22e273){logger['error'](util[_0xb4f7('0x12')](_0xb4f7('0x1d'),_0x18a8f6[_0xb4f7('0x6')],_0x18a8f6['data2'],_0x22e273['statusCode'],_0x22e273[_0xb4f7('0x1e')],_0x22e273[_0xb4f7('0x1f')]));});}; \ No newline at end of file +var _0x7c59=['body','parse','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','catch','error','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','headers','data6','stack','GET','PUT','data7'];(function(_0x563b4f,_0x179806){var _0x8aba8c=function(_0xaded97){while(--_0xaded97){_0x563b4f['push'](_0x563b4f['shift']());}};_0x8aba8c(++_0x179806);}(_0x7c59,0x147));var _0x97c5=function(_0x2f4c87,_0x3c3800){_0x2f4c87=_0x2f4c87-0x0;var _0x26f035=_0x7c59[_0x2f4c87];return _0x26f035;};'use strict';var rp=require('request-promise');var util=require(_0x97c5('0x0'));var _=require(_0x97c5('0x1'));var Mustache=require(_0x97c5('0x2'));var logger=require(_0x97c5('0x3'))('trigger');exports[_0x97c5('0x4')]=function(_0x1a1b7e,_0x4982de){var _0x574b06,_0x42b9bc;var _0x434211={'method':_0x1a1b7e[_0x97c5('0x5')][_0x97c5('0x6')](),'uri':encodeURI(Mustache[_0x97c5('0x7')](_0x1a1b7e['data2'],_0x4982de)),'json':!![],'resolveWithFullResponse':!![]};try{_0x434211[_0x97c5('0x8')]=_0x1a1b7e['data6']?JSON['parse'](Mustache[_0x97c5('0x7')](_0x1a1b7e[_0x97c5('0x9')],_0x4982de)):{};}catch(_0x46c58a){logger['error'](_0x46c58a[_0x97c5('0xa')]);}switch(_0x1a1b7e[_0x97c5('0x5')][_0x97c5('0x6')]()){case _0x97c5('0xb'):_0x434211['qs']=_0x4982de;break;case'POST':case _0x97c5('0xc'):_0x574b06={};if(_0x1a1b7e[_0x97c5('0xd')]){_0x574b06=Mustache[_0x97c5('0x7')](_0x1a1b7e['data7'],_0x4982de);}else{_0x574b06=_0x4982de;}_0x434211[_0x97c5('0xe')]=JSON[_0x97c5('0xf')](_0x574b06);break;}logger[_0x97c5('0x10')](util[_0x97c5('0x11')](_0x97c5('0x12'),_0x1a1b7e['data1'],_0x1a1b7e['data2'],JSON[_0x97c5('0x13')](_0x434211)));rp(_0x434211)[_0x97c5('0x14')](function(_0x2b0457){_0x574b06=!_[_0x97c5('0x15')](_0x574b06)?_0x97c5('0x16')+_0x574b06:'';_0x42b9bc=typeof _0x2b0457[_0x97c5('0xe')]===_0x97c5('0x17')?JSON[_0x97c5('0x13')](_0x2b0457[_0x97c5('0xe')]):_0x2b0457['body'];logger[_0x97c5('0x10')](util['format'](_0x97c5('0x18'),_0x1a1b7e[_0x97c5('0x5')],_0x1a1b7e[_0x97c5('0x19')],_0x2b0457[_0x97c5('0x1a')],_0x42b9bc));})[_0x97c5('0x1b')](function(_0x5b8ebc){logger[_0x97c5('0x1c')](util['format'](_0x97c5('0x1d'),_0x1a1b7e['data1'],_0x1a1b7e[_0x97c5('0x19')],_0x5b8ebc[_0x97c5('0x1a')],_0x5b8ebc['name'],_0x5b8ebc[_0x97c5('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index efbf9b7..04ccd74 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 _0xe93b=['catch','exports','bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe93b,0x1c2));var _0xbe93=function(_0x391c01,_0x8a4737){_0x391c01=_0x391c01-0x0;var _0x21b62a=_0xe93b[_0x391c01];return _0x21b62a;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xbe93('0x0'));var logger=require(_0xbe93('0x1'))(_0xbe93('0x2'));var client=jayson['client'][_0xbe93('0x3')]({'port':0x2329});client[_0xbe93('0x4')]=function(_0x39a786,_0xf6395){return new BPromise(function(_0xc103ec,_0x3cf411){return client[_0xbe93('0x5')](_0x39a786,_0xf6395)[_0xbe93('0x6')](function(_0x5ad742){logger[_0xbe93('0x7')](_0xbe93('0x8'),_0xbe93('0x2'),_0x39a786,_0xf6395,_0x5ad742);if(_0x5ad742[_0xbe93('0x9')]){logger[_0xbe93('0x9')](_0xbe93('0x8'),_0xbe93('0x2'),_0x39a786,_0x5ad742[_0xbe93('0x9')][_0xbe93('0xa')],_0xf6395);return _0x3cf411(_0x5ad742['error'][_0xbe93('0xa')]);}else{return _0xc103ec(_0x5ad742[_0xbe93('0xb')]);}})[_0xbe93('0xc')](function(_0x322d00){logger[_0xbe93('0x9')](_0xbe93('0x8'),'routing',_0x39a786,_0x322d00,_0xf6395);return _0x3cf411(_0x322d00);});});};module[_0xbe93('0xd')]=client; \ No newline at end of file +var _0x7edb=['then','debug','rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing','client','http','request'];(function(_0x3f70e6,_0x2bad3e){var _0x5bcb7b=function(_0xc75b51){while(--_0xc75b51){_0x3f70e6['push'](_0x3f70e6['shift']());}};_0x5bcb7b(++_0x2bad3e);}(_0x7edb,0x158));var _0xb7ed=function(_0x4f91d5,_0x1528a9){_0x4f91d5=_0x4f91d5-0x0;var _0x2439cc=_0x7edb[_0x4f91d5];return _0x2439cc;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var client=jayson[_0xb7ed('0x3')][_0xb7ed('0x4')]({'port':0x2329});client['Request']=function(_0x94e65b,_0x595b65){return new BPromise(function(_0x4c8316,_0x1b578f){return client[_0xb7ed('0x5')](_0x94e65b,_0x595b65)[_0xb7ed('0x6')](function(_0x246cfa){logger[_0xb7ed('0x7')](_0xb7ed('0x8'),_0xb7ed('0x2'),_0x94e65b,_0x595b65,_0x246cfa);if(_0x246cfa[_0xb7ed('0x9')]){logger[_0xb7ed('0x9')](_0xb7ed('0x8'),'routing',_0x94e65b,_0x246cfa[_0xb7ed('0x9')][_0xb7ed('0xa')],_0x595b65);return _0x1b578f(_0x246cfa[_0xb7ed('0x9')][_0xb7ed('0xa')]);}else{return _0x4c8316(_0x246cfa[_0xb7ed('0xb')]);}})[_0xb7ed('0xc')](function(_0x313a74){logger['error'](_0xb7ed('0x8'),_0xb7ed('0x2'),_0x94e65b,_0x313a74,_0x595b65);return _0x1b578f(_0x313a74);});});};module[_0xb7ed('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 19f47e1..30b9112 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 _0x90f6=['./realtime','./rpc/mailAccount','resolve','getMailAccounts','initMailAccounts','then','refresh','listen','bluebird','./server'];(function(_0x4e05fd,_0x1a070c){var _0xbd63c1=function(_0x249364){while(--_0x249364){_0x4e05fd['push'](_0x4e05fd['shift']());}};_0xbd63c1(++_0x1a070c);}(_0x90f6,0xe4));var _0x690f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x90f6[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x690f('0x0'));var server=require(_0x690f('0x1'));var Realtime=require(_0x690f('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x690f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x690f('0x4')]()['then'](mailAccount[_0x690f('0x5')]())['then'](realtime[_0x690f('0x6')]())[_0x690f('0x7')](function(){email[_0x690f('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x690f('0x9')](realtime,email)[_0x690f('0x7')](function(_0x5aedab){return initRealtime();})[_0x690f('0x7')](function(_0x14b63d){return setInterval(initRealtime,0x2710);})['catch'](function(_0x3e0b53){console['log'](_0x3e0b53);});}main(); \ No newline at end of file +var _0x36ad=['./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','refresh','mailAccounts','catch','log','bluebird','./server'];(function(_0x5f3905,_0x43a651){var _0x2923b1=function(_0x3c72d8){while(--_0x3c72d8){_0x5f3905['push'](_0x5f3905['shift']());}};_0x2923b1(++_0x43a651);}(_0x36ad,0x174));var _0xd36a=function(_0x31d598,_0x535619){_0x31d598=_0x31d598-0x0;var _0x32c98e=_0x36ad[_0x31d598];return _0x32c98e;};'use strict';var BPromise=require(_0xd36a('0x0'));var server=require(_0xd36a('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xd36a('0x2'));var mailAccount=require(_0xd36a('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xd36a('0x4')]()[_0xd36a('0x5')](mailAccount[_0xd36a('0x6')]())[_0xd36a('0x5')](realtime['initMailAccounts']())[_0xd36a('0x5')](function(){email[_0xd36a('0x7')](realtime[_0xd36a('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x3664f2){return initRealtime();})[_0xd36a('0x5')](function(_0x2b5aad){return setInterval(initRealtime,0x2710);})[_0xd36a('0x9')](function(_0x3b61ff){console[_0xd36a('0xa')](_0x3b61ff);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 2f7cece..1ece31a 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 _0x5c3c=['email','redis','defaults','localhost','socket.io-emitter','info','mailAccounts','smtp','prototype','name','key','Imap','status','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','active','imapAccounts','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','handleImapError','disabled','connected','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','Smtp','verified','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger'];(function(_0x50ebf0,_0x1969b2){var _0x57cb8d=function(_0x8cf923){while(--_0x8cf923){_0x50ebf0['push'](_0x50ebf0['shift']());}};_0x57cb8d(++_0x1969b2);}(_0x5c3c,0x132));var _0xc5c3=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x5c3c[_0x342700];return _0x53406f;};'use strict';var _=require(_0xc5c3('0x0'));var moment=require(_0xc5c3('0x1'));var BPromise=require(_0xc5c3('0x2'));var md5=require(_0xc5c3('0x3'));var Redis=require('ioredis');var config=require(_0xc5c3('0x4'));var logger=require(_0xc5c3('0x5'))(_0xc5c3('0x6'));config[_0xc5c3('0x7')]=_[_0xc5c3('0x8')](config[_0xc5c3('0x7')],{'host':_0xc5c3('0x9'),'port':0x18eb});var io=require(_0xc5c3('0xa'))(new Redis(config[_0xc5c3('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x723c31){logger[_0xc5c3('0xb')]('start\x20email\x20channel');this[_0xc5c3('0xc')]=_0x723c31[_0xc5c3('0xc')];this['imapAccounts']={};this[_0xc5c3('0xd')]=new EmailSmtp();}EmailChannel[_0xc5c3('0xe')]['emit']=function(_0x1f2e34){var _0x105e43=this[_0xc5c3('0xc')][_0x1f2e34];var _0x59fb60={'id':_0x105e43['id'],'name':_0x105e43[_0xc5c3('0xf')],'key':_0x105e43[_0xc5c3('0x10')],'active':_0x105e43['active'],'Imap':{'status':_0x105e43[_0xc5c3('0x11')][_0xc5c3('0x12')],'messageStatus':_0x105e43[_0xc5c3('0x11')]['messageStatus'],'total':_0x105e43[_0xc5c3('0x11')][_0xc5c3('0x13')]}};if(_[_0xc5c3('0x14')](md5Accounts[_0x1f2e34])){md5Accounts[_0x1f2e34]={};}var _0x13a740=md5(JSON[_0xc5c3('0x15')](_0x59fb60));if(md5Accounts[_0x1f2e34]['md5']!==_0x13a740){md5Accounts[_0x1f2e34]['md5']=_0x13a740;io[_0xc5c3('0x16')](_0xc5c3('0x17'),_0x59fb60);}};EmailChannel[_0xc5c3('0xe')][_0xc5c3('0x18')]=function(_0x5ecd4b){for(var _0x4ff2de in _0x5ecd4b){if(_0x5ecd4b[_0xc5c3('0x19')](_0x4ff2de)){if(_0x5ecd4b[_0x4ff2de]['Imap']&&_0x5ecd4b[_0x4ff2de][_0xc5c3('0x1a')]){var _0x17ec62=_0x5ecd4b[_0x4ff2de][_0xc5c3('0x11')];if(!this[_0xc5c3('0x1b')][_0xc5c3('0x19')](_0x17ec62['id'])){this['imapAccounts'][_0x17ec62['id']]=new EmailImap(_0x17ec62,_0x5ecd4b[_0x4ff2de][_0xc5c3('0x6')]);this[_0xc5c3('0x1b')][_0x17ec62['id']]['on'](_0xc5c3('0x1c'),this[_0xc5c3('0x1d')]['bind'](this,_0x4ff2de));this[_0xc5c3('0x1b')][_0x17ec62['id']]['on'](_0xc5c3('0x6'),this[_0xc5c3('0x1e')][_0xc5c3('0x1f')](this,_0x4ff2de));this[_0xc5c3('0x1b')][_0x17ec62['id']]['on']('end',this[_0xc5c3('0x20')][_0xc5c3('0x1f')](this,_0x4ff2de));this[_0xc5c3('0x1b')][_0x17ec62['id']]['on'](_0xc5c3('0x21'),this[_0xc5c3('0x22')][_0xc5c3('0x1f')](this,_0x4ff2de));}}else{if(_[_0xc5c3('0x14')](this['mailAccounts'][_0x4ff2de]['Imap'])){this[_0xc5c3('0xc')][_0x4ff2de][_0xc5c3('0x11')]={};}this['mailAccounts'][_0x4ff2de]['Imap'][_0xc5c3('0x12')]=_0xc5c3('0x23');this[_0xc5c3('0xc')][_0x4ff2de]['Imap']['messageStatus']='';this[_0xc5c3('0x16')](_0x4ff2de);}}}};EmailChannel[_0xc5c3('0xe')][_0xc5c3('0x1d')]=function(_0x29791c,_0x5caf85){if(this[_0xc5c3('0xc')][_0x29791c]){this['mailAccounts'][_0x29791c][_0xc5c3('0x11')]['status']=_0xc5c3('0x24');this[_0xc5c3('0xc')][_0x29791c][_0xc5c3('0x11')][_0xc5c3('0x25')]=_0x5caf85[_0xc5c3('0xf')];if(_0x5caf85[_0xc5c3('0x26')]){this[_0xc5c3('0xc')][_0x29791c]['Imap'][_0xc5c3('0x13')]=_0x5caf85['messages'][_0xc5c3('0x13')];}return this[_0xc5c3('0x16')](_0x29791c);}};EmailChannel['prototype']['handleImapEmail']=function(_0x2e648f,_0x46f149){logger[_0xc5c3('0xb')](_0xc5c3('0x27'),_0x46f149['firstName'],_0x46f149[_0xc5c3('0x28')],_0x46f149[_0xc5c3('0x29')],_0x2e648f);if(this[_0xc5c3('0xc')][_0x2e648f]){return mailAccount[_0xc5c3('0x2a')](_0x2e648f,_0x46f149)[_0xc5c3('0x2b')](function(_0x406968){if(_0x406968){logger[_0xc5c3('0xb')](_0xc5c3('0x2c'));}})[_0xc5c3('0x2d')](function(_0x4b8be9){logger[_0xc5c3('0x21')](_0xc5c3('0x2e'),JSON[_0xc5c3('0x15')](_0x4b8be9));});}};EmailChannel[_0xc5c3('0xe')][_0xc5c3('0x20')]=function(_0x74830f){if(this[_0xc5c3('0xc')][_0x74830f]&&this['mailAccounts'][_0x74830f]['Imap']){if(this[_0xc5c3('0x1b')][this['mailAccounts'][_0x74830f][_0xc5c3('0x11')]['id']]){delete this[_0xc5c3('0x1b')][this[_0xc5c3('0xc')][_0x74830f][_0xc5c3('0x11')]['id']];}this[_0xc5c3('0xc')][_0x74830f]['Imap'][_0xc5c3('0x2f')]=moment();this[_0xc5c3('0x16')](_0x74830f);}};EmailChannel['prototype'][_0xc5c3('0x22')]=function(_0x17d93c,_0x321917){if(this[_0xc5c3('0xc')][_0x17d93c]){this[_0xc5c3('0xc')][_0x17d93c][_0xc5c3('0x11')][_0xc5c3('0x12')]=_0xc5c3('0x21');this[_0xc5c3('0xc')][_0x17d93c][_0xc5c3('0x11')]['messageStatus']=_0x321917;return this[_0xc5c3('0x16')](_0x17d93c);}};EmailChannel['prototype']['sendMail']=function(_0x11c029,_0x10e27d){return this[_0xc5c3('0xd')][_0xc5c3('0x30')](_0x11c029,_0x10e27d);};EmailChannel[_0xc5c3('0xe')]['verifySmtp']=function(_0x5eba80){var _0x17e263=this;if(this[_0xc5c3('0xc')][_0x5eba80['id']]){if(_['isNil'](this[_0xc5c3('0xc')][_0x5eba80['id']]['Smtp'])){this[_0xc5c3('0xc')][_0x5eba80['id']][_0xc5c3('0x31')]={};}this[_0xc5c3('0xc')][_0x5eba80['id']]['Smtp'][_0xc5c3('0x2f')]=moment();return new BPromise(function(_0x34f376,_0x525ef8){return _0x17e263[_0xc5c3('0xd')]['verify'](_0x5eba80)[_0xc5c3('0x2b')](function(_0x28c35c){_0x17e263['mailAccounts'][_0x5eba80['id']]['Smtp']['status']=_0xc5c3('0x32');_0x17e263[_0xc5c3('0xc')][_0x5eba80['id']]['Smtp'][_0xc5c3('0x25')]='';_0x17e263[_0xc5c3('0x16')](_0x5eba80['id']);_0x34f376(_0x28c35c);})[_0xc5c3('0x2d')](function(_0x914ec1){_0x17e263['mailAccounts'][_0x5eba80['id']][_0xc5c3('0x31')]['status']='error';_0x17e263[_0xc5c3('0xc')][_0x5eba80['id']][_0xc5c3('0x31')]['messageStatus']=_0x914ec1;_0x17e263[_0xc5c3('0x16')](_0x5eba80['id']);_0x525ef8(_0x914ec1);});});}return this[_0xc5c3('0xd')]['verify'](_0x5eba80);};module[_0xc5c3('0x33')]=EmailChannel; \ No newline at end of file +var _0xdf55=['handleImapEmail','end','handleImapEnd','error','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','Mail\x20accepted\x20from\x20routing','catch','lastSync','handleImapError','sendMail','smtp','verifySmtp','Smtp','verify','then','verified','exports','lodash','moment','md5','ioredis','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','prototype','name','key','active','Imap','status','messageStatus','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','imapAccounts','handleImapBox','bind'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0xdf55,0x83));var _0x5df5=function(_0x58e8eb,_0x2ac0c7){_0x58e8eb=_0x58e8eb-0x0;var _0x168540=_0xdf55[_0x58e8eb];return _0x168540;};'use strict';var _=require(_0x5df5('0x0'));var moment=require(_0x5df5('0x1'));var BPromise=require('bluebird');var md5=require(_0x5df5('0x2'));var Redis=require(_0x5df5('0x3'));var config=require('../../../config/environment');var logger=require(_0x5df5('0x4'))(_0x5df5('0x5'));config[_0x5df5('0x6')]=_['defaults'](config[_0x5df5('0x6')],{'host':_0x5df5('0x7'),'port':0x18eb});var io=require(_0x5df5('0x8'))(new Redis(config[_0x5df5('0x6')]));var EmailImap=require(_0x5df5('0x9'));var EmailSmtp=require(_0x5df5('0xa'));var mailAccount=require(_0x5df5('0xb'));var md5Accounts={};function EmailChannel(_0x3743f3){logger['info'](_0x5df5('0xc'));this[_0x5df5('0xd')]=_0x3743f3[_0x5df5('0xd')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x5df5('0xe')]['emit']=function(_0x45ad13){var _0x3cd0c0=this['mailAccounts'][_0x45ad13];var _0x59d273={'id':_0x3cd0c0['id'],'name':_0x3cd0c0[_0x5df5('0xf')],'key':_0x3cd0c0[_0x5df5('0x10')],'active':_0x3cd0c0[_0x5df5('0x11')],'Imap':{'status':_0x3cd0c0[_0x5df5('0x12')][_0x5df5('0x13')],'messageStatus':_0x3cd0c0[_0x5df5('0x12')][_0x5df5('0x14')],'total':_0x3cd0c0[_0x5df5('0x12')][_0x5df5('0x15')]}};if(_[_0x5df5('0x16')](md5Accounts[_0x45ad13])){md5Accounts[_0x45ad13]={};}var _0x555d3f=md5(JSON[_0x5df5('0x17')](_0x59d273));if(md5Accounts[_0x45ad13]['md5']!==_0x555d3f){md5Accounts[_0x45ad13][_0x5df5('0x2')]=_0x555d3f;io[_0x5df5('0x18')](_0x5df5('0x19'),_0x59d273);}};EmailChannel[_0x5df5('0xe')][_0x5df5('0x1a')]=function(_0x4e74c4){for(var _0x27b3fb in _0x4e74c4){if(_0x4e74c4[_0x5df5('0x1b')](_0x27b3fb)){if(_0x4e74c4[_0x27b3fb]['Imap']&&_0x4e74c4[_0x27b3fb][_0x5df5('0x11')]){var _0x45813f=_0x4e74c4[_0x27b3fb][_0x5df5('0x12')];if(!this[_0x5df5('0x1c')][_0x5df5('0x1b')](_0x45813f['id'])){this['imapAccounts'][_0x45813f['id']]=new EmailImap(_0x45813f,_0x4e74c4[_0x27b3fb]['email']);this[_0x5df5('0x1c')][_0x45813f['id']]['on']('box',this[_0x5df5('0x1d')][_0x5df5('0x1e')](this,_0x27b3fb));this[_0x5df5('0x1c')][_0x45813f['id']]['on'](_0x5df5('0x5'),this[_0x5df5('0x1f')]['bind'](this,_0x27b3fb));this[_0x5df5('0x1c')][_0x45813f['id']]['on'](_0x5df5('0x20'),this[_0x5df5('0x21')][_0x5df5('0x1e')](this,_0x27b3fb));this[_0x5df5('0x1c')][_0x45813f['id']]['on'](_0x5df5('0x22'),this['handleImapError'][_0x5df5('0x1e')](this,_0x27b3fb));}}else{if(_[_0x5df5('0x16')](this[_0x5df5('0xd')][_0x27b3fb][_0x5df5('0x12')])){this['mailAccounts'][_0x27b3fb][_0x5df5('0x12')]={};}this[_0x5df5('0xd')][_0x27b3fb][_0x5df5('0x12')]['status']='disabled';this['mailAccounts'][_0x27b3fb][_0x5df5('0x12')][_0x5df5('0x14')]='';this[_0x5df5('0x18')](_0x27b3fb);}}}};EmailChannel[_0x5df5('0xe')][_0x5df5('0x1d')]=function(_0x1fd83c,_0x210d20){if(this[_0x5df5('0xd')][_0x1fd83c]){this['mailAccounts'][_0x1fd83c][_0x5df5('0x12')]['status']=_0x5df5('0x23');this[_0x5df5('0xd')][_0x1fd83c]['Imap'][_0x5df5('0x14')]=_0x210d20['name'];if(_0x210d20[_0x5df5('0x24')]){this['mailAccounts'][_0x1fd83c][_0x5df5('0x12')]['total']=_0x210d20[_0x5df5('0x24')]['total'];}return this[_0x5df5('0x18')](_0x1fd83c);}};EmailChannel[_0x5df5('0xe')][_0x5df5('0x1f')]=function(_0x485484,_0xf445de){logger[_0x5df5('0x25')](_0x5df5('0x26'),_0xf445de[_0x5df5('0x27')],_0xf445de[_0x5df5('0x28')],_0xf445de[_0x5df5('0x29')],_0x485484);if(this[_0x5df5('0xd')][_0x485484]){return mailAccount['notify'](_0x485484,_0xf445de)['then'](function(_0x3275e9){if(_0x3275e9){logger[_0x5df5('0x25')](_0x5df5('0x2a'));}})[_0x5df5('0x2b')](function(_0x20ee8a){logger[_0x5df5('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5df5('0x17')](_0x20ee8a));});}};EmailChannel[_0x5df5('0xe')][_0x5df5('0x21')]=function(_0x3a6b75){if(this['mailAccounts'][_0x3a6b75]&&this[_0x5df5('0xd')][_0x3a6b75]['Imap']){if(this[_0x5df5('0x1c')][this[_0x5df5('0xd')][_0x3a6b75]['Imap']['id']]){delete this[_0x5df5('0x1c')][this['mailAccounts'][_0x3a6b75][_0x5df5('0x12')]['id']];}this[_0x5df5('0xd')][_0x3a6b75][_0x5df5('0x12')][_0x5df5('0x2c')]=moment();this['emit'](_0x3a6b75);}};EmailChannel[_0x5df5('0xe')][_0x5df5('0x2d')]=function(_0x28459a,_0x25b6ad){if(this['mailAccounts'][_0x28459a]){this[_0x5df5('0xd')][_0x28459a][_0x5df5('0x12')][_0x5df5('0x13')]=_0x5df5('0x22');this[_0x5df5('0xd')][_0x28459a][_0x5df5('0x12')][_0x5df5('0x14')]=_0x25b6ad;return this['emit'](_0x28459a);}};EmailChannel[_0x5df5('0xe')][_0x5df5('0x2e')]=function(_0x593f6a,_0x690134){return this[_0x5df5('0x2f')]['send'](_0x593f6a,_0x690134);};EmailChannel[_0x5df5('0xe')][_0x5df5('0x30')]=function(_0x1087f7){var _0x3a7f40=this;if(this[_0x5df5('0xd')][_0x1087f7['id']]){if(_[_0x5df5('0x16')](this[_0x5df5('0xd')][_0x1087f7['id']][_0x5df5('0x31')])){this['mailAccounts'][_0x1087f7['id']]['Smtp']={};}this[_0x5df5('0xd')][_0x1087f7['id']]['Smtp'][_0x5df5('0x2c')]=moment();return new BPromise(function(_0x156a03,_0x4ada10){return _0x3a7f40[_0x5df5('0x2f')][_0x5df5('0x32')](_0x1087f7)[_0x5df5('0x33')](function(_0x353ebc){_0x3a7f40[_0x5df5('0xd')][_0x1087f7['id']][_0x5df5('0x31')][_0x5df5('0x13')]=_0x5df5('0x34');_0x3a7f40['mailAccounts'][_0x1087f7['id']][_0x5df5('0x31')]['messageStatus']='';_0x3a7f40[_0x5df5('0x18')](_0x1087f7['id']);_0x156a03(_0x353ebc);})[_0x5df5('0x2b')](function(_0x350536){_0x3a7f40[_0x5df5('0xd')][_0x1087f7['id']][_0x5df5('0x31')]['status']=_0x5df5('0x22');_0x3a7f40[_0x5df5('0xd')][_0x1087f7['id']][_0x5df5('0x31')]['messageStatus']=_0x350536;_0x3a7f40[_0x5df5('0x18')](_0x1087f7['id']);_0x4ada10(_0x350536);});});}return this[_0x5df5('0x2f')]['verify'](_0x1087f7);};module[_0x5df5('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 50078a0..8bdc71c 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 _0xc4dd=['util','imap','randomstring','mailparser','simpleParser','iconv','Iconv','./utils','../../../config/logger','INBOX','account','getAccount','once','handleReady','bind','handleEnd','handleError','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','email','anonymous@xcally.com','openBox','mailbox','handleOpenBox','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','error','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','stringify','textCode','hasOwnProperty','path'];(function(_0x3b8cee,_0x6ae749){var _0x280fb3=function(_0x4e24d4){while(--_0x4e24d4){_0x3b8cee['push'](_0x3b8cee['shift']());}};_0x280fb3(++_0x6ae749);}(_0xc4dd,0xad));var _0xdc4d=function(_0x311e75,_0x4388d8){_0x311e75=_0x311e75-0x0;var _0x274dd8=_0xc4dd[_0x311e75];return _0x274dd8;};'use strict';var fs=require('fs');var path=require(_0xdc4d('0x0'));var util=require(_0xdc4d('0x1'));var Imap=require(_0xdc4d('0x2'));var _=require('lodash');var rs=require(_0xdc4d('0x3'));var simpleParser=require(_0xdc4d('0x4'))[_0xdc4d('0x5')];var Iconv=require(_0xdc4d('0x6'))[_0xdc4d('0x7')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xdc4d('0x8'));var logger=require(_0xdc4d('0x9'))('email');function EmailImap(_0x3c4ce7,_0x2a2a14){this['mailbox']=_0xdc4d('0xa');this[_0xdc4d('0xb')]=this[_0xdc4d('0xc')](_0x3c4ce7,_0x2a2a14);this[_0xdc4d('0x2')]=new Imap(this[_0xdc4d('0xb')]);this[_0xdc4d('0x2')][_0xdc4d('0xd')]('ready',this[_0xdc4d('0xe')][_0xdc4d('0xf')](this));this['imap'][_0xdc4d('0xd')]('end',this[_0xdc4d('0x10')]['bind'](this));this['imap']['on']('error',this[_0xdc4d('0x11')][_0xdc4d('0xf')](this));this[_0xdc4d('0x2')]['connect']();}util[_0xdc4d('0x12')](EmailImap,EventEmitter);EmailImap[_0xdc4d('0x13')][_0xdc4d('0xc')]=function(_0x586e74,_0x45f5d7){var _0x4ecedb={'connTimeout':_0x586e74['connTimeout']?_0x586e74[_0xdc4d('0x14')]*0x3e8:0x2710,'authTimeout':_0x586e74[_0xdc4d('0x15')]?_0x586e74[_0xdc4d('0x15')]*0x3e8:0x1388};if(_[_0xdc4d('0x16')](_0x586e74['service'])){if(_0x586e74[_0xdc4d('0x17')]){_0x4ecedb[_0xdc4d('0x18')]=_0x586e74[_0xdc4d('0x18')];_0x4ecedb[_0xdc4d('0x19')]=_0x586e74['password'];}_0x4ecedb[_0xdc4d('0x1a')]=_0x586e74[_0xdc4d('0x1a')];_0x4ecedb[_0xdc4d('0x1b')]=_0x586e74[_0xdc4d('0x1b')]||0x3e1;if(_0x586e74[_0xdc4d('0x1c')]){_0x4ecedb[_0xdc4d('0x1c')]=!![];}else{_0x4ecedb[_0xdc4d('0x1c')]=![];_0x4ecedb[_0xdc4d('0x1d')]='required';}}else{_0x4ecedb[_0xdc4d('0x18')]=_0x586e74[_0xdc4d('0x18')];_0x4ecedb[_0xdc4d('0x19')]=_0x586e74[_0xdc4d('0x19')];_0x4ecedb[_0xdc4d('0x1a')]=utils['getHost'](_0x586e74['service']);_0x4ecedb[_0xdc4d('0x1b')]=0x3e1;_0x4ecedb[_0xdc4d('0x1c')]=!![];}_0x4ecedb[_0xdc4d('0x1e')]=_0x45f5d7||_0x586e74['user']||_0xdc4d('0x1f');return _0x4ecedb;};EmailImap['prototype'][_0xdc4d('0xe')]=function(){this[_0xdc4d('0x2')][_0xdc4d('0x20')](this[_0xdc4d('0x21')],![],this[_0xdc4d('0x22')]['bind'](this));};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x22')]=function(_0x722a8f,_0xd6f0c7){if(_0x722a8f){this[_0xdc4d('0x11')](_0x722a8f,!![]);}else{this['emit'](_0xdc4d('0x23'),_0xd6f0c7);this[_0xdc4d('0x24')]();}};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x25')]=function(_0x147bb2){if(_0x147bb2){this[_0xdc4d('0x11')](_0x147bb2,!![]);}else{this[_0xdc4d('0x2')][_0xdc4d('0x26')]();}};EmailImap[_0xdc4d('0x13')]['readUnseen']=function(){this[_0xdc4d('0x2')][_0xdc4d('0x27')]([_0xdc4d('0x28')],this['handleReadUnseen']['bind'](this));};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x29')]=function(_0x3fbb1c,_0x19dd86){if(_0x3fbb1c){this['handleError'](_0x3fbb1c,!![]);}else{if(_0x19dd86[_0xdc4d('0x2a')]){try{var _0x17e860=this[_0xdc4d('0x2')]['fetch'](_0x19dd86,{'bodies':'','markSeen':!![]});_0x17e860['on'](_0xdc4d('0x2b'),this[_0xdc4d('0x2c')]['bind'](this));_0x17e860['once']('error',this[_0xdc4d('0x2d')][_0xdc4d('0xf')](this));_0x17e860['once'](_0xdc4d('0x26'),this[_0xdc4d('0x2e')]['bind'](this));}catch(_0x2d45fb){logger[_0xdc4d('0x2f')](_0x2d45fb);}}else{this['imap'][_0xdc4d('0x30')](!![],this[_0xdc4d('0x25')][_0xdc4d('0xf')](this));}}};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x2c')]=function(_0x15c72e,_0x4d4748){_0x15c72e['on']('body',this[_0xdc4d('0x31')][_0xdc4d('0xf')](this));_0x15c72e[_0xdc4d('0xd')](_0xdc4d('0x32'),this[_0xdc4d('0x33')][_0xdc4d('0xf')](this));_0x15c72e[_0xdc4d('0xd')](_0xdc4d('0x26'),this[_0xdc4d('0x34')][_0xdc4d('0xf')](this));};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x31')]=function(_0x2514a9,_0x273b42){simpleParser(_0x2514a9,{'Iconv':Iconv},this[_0xdc4d('0x35')][_0xdc4d('0xf')](this));};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x33')]=function(_0x138b1d){};EmailImap[_0xdc4d('0x13')]['handleMessageEnd']=function(){};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x35')]=function(_0x53a6e8,_0x1eb8b7){if(_0x53a6e8){logger[_0xdc4d('0x2f')](_0x53a6e8);}else{var _0xf3e74e=this;utils['parser'](this[_0xdc4d('0xb')],_0x1eb8b7,function(_0x5330ff){_0xf3e74e[_0xdc4d('0x36')](_0xdc4d('0x1e'),_0x5330ff);});}};EmailImap[_0xdc4d('0x13')]['handleFetchEnd']=function(){this[_0xdc4d('0x2')]['closeBox'](!![],this[_0xdc4d('0x25')][_0xdc4d('0xf')](this));};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x2d')]=function(_0x2eb305){this['handleError'](_0x2eb305);this['imap'][_0xdc4d('0x30')](!![],this[_0xdc4d('0x25')][_0xdc4d('0xf')](this));};EmailImap['prototype'][_0xdc4d('0x10')]=function(){this[_0xdc4d('0x36')]('end');};EmailImap[_0xdc4d('0x13')][_0xdc4d('0x11')]=function(_0x7fb963,_0x22a37d){logger[_0xdc4d('0x2f')](_0xdc4d('0x11'),this['account'][_0xdc4d('0x1e')],JSON[_0xdc4d('0x37')](_0x7fb963));var _0x4c02b8='';if(_0x7fb963){if(_0x7fb963[_0xdc4d('0x38')]){_0x4c02b8=_0x7fb963[_0xdc4d('0x38')];}else{for(var _0x30c8b3 in _0x7fb963){if(_0x7fb963[_0xdc4d('0x39')](_0x30c8b3)){_0x4c02b8+=_['upperFirst'](_0x30c8b3)+':\x20'+_0x7fb963[_0x30c8b3]+'\x0a';}}}}if(_0x22a37d){this[_0xdc4d('0x2')]['end']();}else{this[_0xdc4d('0x36')](_0xdc4d('0x2f'),_0x4c02b8);this[_0xdc4d('0x36')](_0xdc4d('0x26'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x1020=['service','authentication','user','host','port','tls','autotls','required','password','getHost','anonymous@xcally.com','prototype','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','stringify','textCode','hasOwnProperty','upperFirst','exports','path','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','getAccount','connTimeout','authTimeout','isNil'];(function(_0x3dec5d,_0x4a6821){var _0x729d07=function(_0x389fff){while(--_0x389fff){_0x3dec5d['push'](_0x3dec5d['shift']());}};_0x729d07(++_0x4a6821);}(_0x1020,0x1a4));var _0x0102=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x1020[_0x336376];return _0x1d2a8e;};'use strict';var fs=require('fs');var path=require(_0x0102('0x0'));var util=require('util');var Imap=require(_0x0102('0x1'));var _=require(_0x0102('0x2'));var rs=require(_0x0102('0x3'));var simpleParser=require(_0x0102('0x4'))[_0x0102('0x5')];var Iconv=require(_0x0102('0x6'))[_0x0102('0x7')];var EventEmitter=require(_0x0102('0x8'))[_0x0102('0x9')];var utils=require(_0x0102('0xa'));var logger=require(_0x0102('0xb'))(_0x0102('0xc'));function EmailImap(_0x55229f,_0x26804d){this[_0x0102('0xd')]=_0x0102('0xe');this['account']=this['getAccount'](_0x55229f,_0x26804d);this[_0x0102('0x1')]=new Imap(this['account']);this['imap'][_0x0102('0xf')](_0x0102('0x10'),this[_0x0102('0x11')][_0x0102('0x12')](this));this[_0x0102('0x1')]['once'](_0x0102('0x13'),this[_0x0102('0x14')][_0x0102('0x12')](this));this[_0x0102('0x1')]['on'](_0x0102('0x15'),this[_0x0102('0x16')][_0x0102('0x12')](this));this[_0x0102('0x1')][_0x0102('0x17')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x0102('0x18')]=function(_0x20f557,_0x3d0f4b){var _0x21d392={'connTimeout':_0x20f557[_0x0102('0x19')]?_0x20f557[_0x0102('0x19')]*0x3e8:0x2710,'authTimeout':_0x20f557[_0x0102('0x1a')]?_0x20f557[_0x0102('0x1a')]*0x3e8:0x1388};if(_[_0x0102('0x1b')](_0x20f557[_0x0102('0x1c')])){if(_0x20f557[_0x0102('0x1d')]){_0x21d392['user']=_0x20f557[_0x0102('0x1e')];_0x21d392['password']=_0x20f557['password'];}_0x21d392['host']=_0x20f557[_0x0102('0x1f')];_0x21d392[_0x0102('0x20')]=_0x20f557[_0x0102('0x20')]||0x3e1;if(_0x20f557[_0x0102('0x21')]){_0x21d392[_0x0102('0x21')]=!![];}else{_0x21d392[_0x0102('0x21')]=![];_0x21d392[_0x0102('0x22')]=_0x0102('0x23');}}else{_0x21d392[_0x0102('0x1e')]=_0x20f557[_0x0102('0x1e')];_0x21d392[_0x0102('0x24')]=_0x20f557[_0x0102('0x24')];_0x21d392[_0x0102('0x1f')]=utils[_0x0102('0x25')](_0x20f557[_0x0102('0x1c')]);_0x21d392['port']=0x3e1;_0x21d392[_0x0102('0x21')]=!![];}_0x21d392[_0x0102('0xc')]=_0x3d0f4b||_0x20f557[_0x0102('0x1e')]||_0x0102('0x26');return _0x21d392;};EmailImap[_0x0102('0x27')]['handleReady']=function(){this[_0x0102('0x1')][_0x0102('0x28')](this[_0x0102('0xd')],![],this[_0x0102('0x29')][_0x0102('0x12')](this));};EmailImap[_0x0102('0x27')]['handleOpenBox']=function(_0x6938fc,_0x42e908){if(_0x6938fc){this[_0x0102('0x16')](_0x6938fc,!![]);}else{this[_0x0102('0x2a')]('box',_0x42e908);this[_0x0102('0x2b')]();}};EmailImap[_0x0102('0x27')][_0x0102('0x2c')]=function(_0x81b8b2){if(_0x81b8b2){this[_0x0102('0x16')](_0x81b8b2,!![]);}else{this['imap'][_0x0102('0x13')]();}};EmailImap[_0x0102('0x27')][_0x0102('0x2b')]=function(){this[_0x0102('0x1')]['search']([_0x0102('0x2d')],this[_0x0102('0x2e')][_0x0102('0x12')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x4fbc76,_0x15e479){if(_0x4fbc76){this[_0x0102('0x16')](_0x4fbc76,!![]);}else{if(_0x15e479['length']){try{var _0x8cc5db=this[_0x0102('0x1')]['fetch'](_0x15e479,{'bodies':'','markSeen':!![]});_0x8cc5db['on']('message',this['handleFetchMessage'][_0x0102('0x12')](this));_0x8cc5db[_0x0102('0xf')](_0x0102('0x15'),this[_0x0102('0x2f')][_0x0102('0x12')](this));_0x8cc5db[_0x0102('0xf')](_0x0102('0x13'),this[_0x0102('0x30')][_0x0102('0x12')](this));}catch(_0x30f8f0){logger[_0x0102('0x15')](_0x30f8f0);}}else{this[_0x0102('0x1')][_0x0102('0x31')](!![],this[_0x0102('0x2c')]['bind'](this));}}};EmailImap['prototype'][_0x0102('0x32')]=function(_0x18a616,_0x23de33){_0x18a616['on'](_0x0102('0x33'),this[_0x0102('0x34')]['bind'](this));_0x18a616[_0x0102('0xf')](_0x0102('0x35'),this[_0x0102('0x36')]['bind'](this));_0x18a616[_0x0102('0xf')](_0x0102('0x13'),this[_0x0102('0x37')][_0x0102('0x12')](this));};EmailImap[_0x0102('0x27')][_0x0102('0x34')]=function(_0x8fb734,_0x421907){simpleParser(_0x8fb734,{'Iconv':Iconv},this[_0x0102('0x38')][_0x0102('0x12')](this));};EmailImap[_0x0102('0x27')][_0x0102('0x36')]=function(_0xb4e8f5){};EmailImap['prototype'][_0x0102('0x37')]=function(){};EmailImap[_0x0102('0x27')][_0x0102('0x38')]=function(_0x853332,_0x10f9c1){if(_0x853332){logger['error'](_0x853332);}else{var _0x25f539=this;utils[_0x0102('0x39')](this[_0x0102('0x3a')],_0x10f9c1,function(_0x5804ca){_0x25f539[_0x0102('0x2a')](_0x0102('0xc'),_0x5804ca);});}};EmailImap[_0x0102('0x27')][_0x0102('0x30')]=function(){this[_0x0102('0x1')][_0x0102('0x31')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x0102('0x27')][_0x0102('0x2f')]=function(_0x5e0936){this[_0x0102('0x16')](_0x5e0936);this[_0x0102('0x1')][_0x0102('0x31')](!![],this[_0x0102('0x2c')][_0x0102('0x12')](this));};EmailImap[_0x0102('0x27')][_0x0102('0x14')]=function(){this[_0x0102('0x2a')](_0x0102('0x13'));};EmailImap[_0x0102('0x27')][_0x0102('0x16')]=function(_0x53b7ca,_0x2743e4){logger['error'](_0x0102('0x16'),this[_0x0102('0x3a')][_0x0102('0xc')],JSON[_0x0102('0x3b')](_0x53b7ca));var _0x486855='';if(_0x53b7ca){if(_0x53b7ca[_0x0102('0x3c')]){_0x486855=_0x53b7ca[_0x0102('0x3c')];}else{for(var _0x4f2f97 in _0x53b7ca){if(_0x53b7ca[_0x0102('0x3d')](_0x4f2f97)){_0x486855+=_[_0x0102('0x3e')](_0x4f2f97)+':\x20'+_0x53b7ca[_0x4f2f97]+'\x0a';}}}}if(_0x2743e4){this[_0x0102('0x1')][_0x0102('0x13')]();}else{this[_0x0102('0x2a')]('error',_0x486855);this[_0x0102('0x2a')](_0x0102('0x13'));}};module[_0x0102('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index e70f298..b4d7a3d 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 _0x4568=['nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','verify','toString','Not\x20verifired'];(function(_0xd4c460,_0x37ace0){var _0x518ae6=function(_0x539e0f){while(--_0x539e0f){_0xd4c460['push'](_0xd4c460['shift']());}};_0x518ae6(++_0x37ace0);}(_0x4568,0xdc));var _0x8456=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x4568[_0x1762b4];return _0x29beda;};'use strict';var nodemailer=require(_0x8456('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x8456('0x1'));function EmailSmtp(){}EmailSmtp[_0x8456('0x2')][_0x8456('0x3')]=function(_0x45d7b1,_0x2b8eab){return new BPromise(function(_0x6c9015,_0x33e5aa){var _0x43ba13=nodemailer[_0x8456('0x4')](_0x45d7b1);_0x43ba13[_0x8456('0x5')](_0x8456('0x6'),inlineBase64());_0x43ba13[_0x8456('0x7')](_0x2b8eab,function(_0x15f04e,_0x46c0fc){if(_0x15f04e){_0x33e5aa(_0x15f04e['toString']());}else{_0x6c9015(_0x46c0fc);}});});};EmailSmtp[_0x8456('0x2')][_0x8456('0x8')]=function(_0x458871){return new BPromise(function(_0x5f272f,_0x5a044e){var _0x363cbe=nodemailer[_0x8456('0x4')](_0x458871);_0x363cbe[_0x8456('0x8')](function(_0x25f3c6,_0x2bbf4e){if(_0x25f3c6){_0x5a044e(_0x25f3c6[_0x8456('0x9')]());}else{if(_0x2bbf4e){_0x5f272f(_0x2bbf4e);}else{_0x5a044e(_0x8456('0xa'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x40d8=['Not\x20verifired','bluebird','nodemailer-plugin-inline-base64','send','createTransport','sendMail','toString','prototype','verify'];(function(_0x46aad3,_0x5c363f){var _0x20e425=function(_0x3980d2){while(--_0x3980d2){_0x46aad3['push'](_0x46aad3['shift']());}};_0x20e425(++_0x5c363f);}(_0x40d8,0xfd));var _0x840d=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x40d8[_0x2c7dc6];return _0x10002b;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x840d('0x0'));var inlineBase64=require(_0x840d('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x840d('0x2')]=function(_0x4a91e3,_0x527f79){return new BPromise(function(_0x460dc9,_0x2d6e7d){var _0x4387ac=nodemailer[_0x840d('0x3')](_0x4a91e3);_0x4387ac['use']('compile',inlineBase64());_0x4387ac[_0x840d('0x4')](_0x527f79,function(_0x388128,_0x7a8fe6){if(_0x388128){_0x2d6e7d(_0x388128[_0x840d('0x5')]());}else{_0x460dc9(_0x7a8fe6);}});});};EmailSmtp[_0x840d('0x6')]['verify']=function(_0x35dd0f){return new BPromise(function(_0x1c1dea,_0x2a5505){var _0xa35af8=nodemailer[_0x840d('0x3')](_0x35dd0f);_0xa35af8[_0x840d('0x7')](function(_0x18d1bd,_0x3995f8){if(_0x18d1bd){_0x2a5505(_0x18d1bd[_0x840d('0x5')]());}else{if(_0x3995f8){_0x1c1dea(_0x3995f8);}else{_0x2a5505(_0x840d('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 35e9171..fc5372a 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 _0x0eee=['message','originTo','isEmpty','originCc','includes','bcc','attach','attachments','type','attachment','filename','attachment-','now','join','root','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','format','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','value','name','split','length','pop','@xcally.com','html','test','body','textAsHtml'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0eee,0xb3));var _0xe0ee=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x0eee[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xe0ee('0x0'));var moment=require(_0xe0ee('0x1'));var random=require(_0xe0ee('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xe0ee('0x3'));var tnef=require(_0xe0ee('0x4'));var logger=require(_0xe0ee('0x5'))(_0xe0ee('0x6'));var config=require(_0xe0ee('0x7'));function getAddress(_0x35ba0a){var _0x178cc3=_[_0xe0ee('0x8')](_0x35ba0a['value']);return _0x178cc3&&_0x178cc3[_0xe0ee('0x9')]?_0x178cc3[_0xe0ee('0x9')]:_0xe0ee('0xa')+random[_0xe0ee('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x538cf8){var _0x5a0b9d=_['head'](_0x538cf8[_0xe0ee('0xc')]);if(_0x5a0b9d&&_0x5a0b9d[_0xe0ee('0xd')]){var _0x1f1cc7=_0x5a0b9d[_0xe0ee('0xd')][_0xe0ee('0xe')](/\s+/);return _0x1f1cc7[_0xe0ee('0xf')]?_0x1f1cc7['slice'](0x0,-0x1)['join']('\x20'):_0x5a0b9d[_0xe0ee('0xd')];}return'Anonymous';}function getLastName(_0xa1f5c){var _0x56d88e=_['head'](_0xa1f5c[_0xe0ee('0xc')]);if(_0x56d88e&&_0x56d88e[_0xe0ee('0xd')]){var _0xa8838b=_0x56d88e[_0xe0ee('0xd')][_0xe0ee('0xe')](/\s+/);return _0xa8838b['length']>0x1?_0xa8838b[_0xe0ee('0x10')]():'';}return'';}function getMails(_0x5d87be,_0x2a7071){var _0x130ad4='';for(var _0xdc082c=0x0;_0xdc082c<_0x2a7071['value']['length'];_0xdc082c+=0x1){if(_0x2a7071[_0xe0ee('0xc')][_0xdc082c]['address']!==_0x5d87be){if(!_['isEmpty'](_0x130ad4)){_0x130ad4+=',';}_0x130ad4+=_0x2a7071[_0xe0ee('0xc')][_0xdc082c][_0xe0ee('0xd')]||_0x2a7071['value'][_0xdc082c][_0xe0ee('0x9')]||'';_0x130ad4+='\x20<';_0x130ad4+=_0x2a7071['value'][_0xdc082c][_0xe0ee('0x9')]?_0x2a7071['value'][_0xdc082c][_0xe0ee('0x9')]:_0xe0ee('0xa')+random[_0xe0ee('0xb')](0x6)+_0xe0ee('0x11');_0x130ad4+='>';}}return _0x130ad4;}function parseEmail(_0x46ce8b,_0x5645d1,_0x47ab02){if(_0x5645d1[_0xe0ee('0x12')]){var _0xfe6085=/)<[^<]*)*<\/script>/gi;while(_0xfe6085[_0xe0ee('0x13')](_0x5645d1[_0xe0ee('0x12')])){_0x5645d1['html']=_0x5645d1[_0xe0ee('0x12')]['replace'](_0xfe6085,'');}_0x47ab02[_0xe0ee('0x14')]=_0x5645d1[_0xe0ee('0x12')];}else{_0x47ab02['body']=_0x5645d1[_0xe0ee('0x15')];}if(_0x47ab02[_0xe0ee('0x14')]){_0x47ab02['body']=_0x47ab02['body']['replace'](/Empty\x20message

';if(_0x389fc3[_0xe0ee('0x38')]){for(var _0x306dea=0x0;_0x306dea<_0x389fc3[_0xe0ee('0x38')][_0xe0ee('0xf')];_0x306dea++){var _0x376216=_0x389fc3[_0xe0ee('0x38')][_0x306dea];_0x5847ce[_0xe0ee('0x16')]['attachments'][_0xe0ee('0x28')]({'filename':_0x376216['Title'],'content':new Buffer(_0x376216[_0xe0ee('0x39')])});}}}_0x2932f9(parseEmail(_0x1450aa,_0x4f6b7d,_0x5847ce));});}else{_0x4f6b7d[_0xe0ee('0x12')]='

Empty\x20message

';_0x2932f9(parseEmail(_0x1450aa,_0x4f6b7d,_0x5847ce));}}else{_0x2932f9(parseEmail(_0x1450aa,_0x4f6b7d,_0x5847ce));}};exports[_0xe0ee('0x3a')]=function(_0x15d714){switch(_0x15d714){case _0xe0ee('0x3b'):return _0xe0ee('0x3c');case _0xe0ee('0x3d'):return _0xe0ee('0x3e');case _0xe0ee('0x3f'):return _0xe0ee('0x40');case'outlook365':return _0xe0ee('0x41');}return _0xe0ee('0x42');}; \ No newline at end of file +var _0x8e20=['hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','util','node-tnef','email','../../../config/environment','head','address','generate','@xcally.com','value','length','slice','join','name','anonymous','test','html','body','textAsHtml','originTo','isEmpty','message','includes','originCc','bcc','attachments','attach','attachment','attachment-','format','now','server/files/attachments/','writeFileSync','content','push','contentType','from','subject','messageId','inReplyTo','date','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com'];(function(_0x44c857,_0x432c96){var _0x81fdb5=function(_0x350f68){while(--_0x350f68){_0x44c857['push'](_0x44c857['shift']());}};_0x81fdb5(++_0x432c96);}(_0x8e20,0x1af));var _0x08e2=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8e20[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x08e2('0x0'));var moment=require(_0x08e2('0x1'));var random=require(_0x08e2('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x08e2('0x3'));var tnef=require(_0x08e2('0x4'));var logger=require('../../../config/logger')(_0x08e2('0x5'));var config=require(_0x08e2('0x6'));function getAddress(_0x19d766){var _0x37720d=_[_0x08e2('0x7')](_0x19d766['value']);return _0x37720d&&_0x37720d[_0x08e2('0x8')]?_0x37720d[_0x08e2('0x8')]:'anonymous'+random[_0x08e2('0x9')](0x6)+_0x08e2('0xa');}function getFirstName(_0x31d86b){var _0x3211da=_[_0x08e2('0x7')](_0x31d86b[_0x08e2('0xb')]);if(_0x3211da&&_0x3211da['name']){var _0x127f5f=_0x3211da['name']['split'](/\s+/);return _0x127f5f[_0x08e2('0xc')]?_0x127f5f[_0x08e2('0xd')](0x0,-0x1)[_0x08e2('0xe')]('\x20'):_0x3211da[_0x08e2('0xf')];}return'Anonymous';}function getLastName(_0x504b35){var _0x41a673=_['head'](_0x504b35['value']);if(_0x41a673&&_0x41a673[_0x08e2('0xf')]){var _0x56e01c=_0x41a673[_0x08e2('0xf')]['split'](/\s+/);return _0x56e01c[_0x08e2('0xc')]>0x1?_0x56e01c['pop']():'';}return'';}function getMails(_0x53a428,_0x4f0f35){var _0x321f5c='';for(var _0x19c892=0x0;_0x19c892<_0x4f0f35[_0x08e2('0xb')]['length'];_0x19c892+=0x1){if(_0x4f0f35['value'][_0x19c892]['address']!==_0x53a428){if(!_['isEmpty'](_0x321f5c)){_0x321f5c+=',';}_0x321f5c+=_0x4f0f35['value'][_0x19c892]['name']||_0x4f0f35[_0x08e2('0xb')][_0x19c892][_0x08e2('0x8')]||'';_0x321f5c+='\x20<';_0x321f5c+=_0x4f0f35[_0x08e2('0xb')][_0x19c892][_0x08e2('0x8')]?_0x4f0f35[_0x08e2('0xb')][_0x19c892][_0x08e2('0x8')]:_0x08e2('0x10')+random[_0x08e2('0x9')](0x6)+_0x08e2('0xa');_0x321f5c+='>';}}return _0x321f5c;}function parseEmail(_0x3ebd09,_0x2384a3,_0x5d1568){if(_0x2384a3['html']){var _0x52787e=/)<[^<]*)*<\/script>/gi;while(_0x52787e[_0x08e2('0x11')](_0x2384a3[_0x08e2('0x12')])){_0x2384a3['html']=_0x2384a3[_0x08e2('0x12')]['replace'](_0x52787e,'');}_0x5d1568[_0x08e2('0x13')]=_0x2384a3['html'];}else{_0x5d1568[_0x08e2('0x13')]=_0x2384a3[_0x08e2('0x14')];}if(_0x5d1568[_0x08e2('0x13')]){_0x5d1568[_0x08e2('0x13')]=_0x5d1568[_0x08e2('0x13')]['replace'](/0x0){if(this[_0x433cc4+'Capacity']>0x0&&this[_0x433cc4+_0x2e90('0x25')]>=this[_0x433cc4+'Capacity']){return _0x2e90('0x26');}else{return _0x2e90('0x27');}}else{return _0x2e90('0x28');}};Agent[_0x2e90('0x23')]['updateRealtime']=function(){var _0x4e9117=[_0x2e90('0x29'),_0x2e90('0x2a'),_0x2e90('0x2b'),_0x2e90('0x2c'),'sms'];for(var _0x247e5b=0x0;_0x247e5b<_0x4e9117[_0x2e90('0x2d')];_0x247e5b+=0x1){var _0x5ea546=this[_0x2e90('0x24')](_0x4e9117[_0x247e5b]);if(this[_0x4e9117[_0x247e5b]+_0x2e90('0x2e')]!==_0x5ea546){this[_0x4e9117[_0x247e5b]+_0x2e90('0x2f')]=_['toNumber'](moment()[_0x2e90('0x30')]('x'));}this[_0x4e9117[_0x247e5b]+_0x2e90('0x2e')]=_0x5ea546;}var _0x11bf2a={'id':this['id'],'name':this['name'],'online':this[_0x2e90('0x7')],'voicePause':this[_0x2e90('0x8')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x2e90('0xc')],'faxPause':this[_0x2e90('0xb')],'openchannelPause':this[_0x2e90('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x2e90('0x10')],'chatCapacity':this[_0x2e90('0x11')],'chatCurrentCapacity':this[_0x2e90('0x12')],'mailStatus':this[_0x2e90('0x13')],'mailStatusTime':this[_0x2e90('0x14')],'mailCapacity':this[_0x2e90('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x2e90('0x17')],'faxCapacity':this[_0x2e90('0x18')],'faxCurrentCapacity':this[_0x2e90('0x19')],'smsStatus':this[_0x2e90('0x1a')],'smsStatusTime':this[_0x2e90('0x31')],'smsCapacity':this[_0x2e90('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x2e90('0x1e')],'openchannelCapacity':this[_0x2e90('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x2e90('0x20')],'busyQueue':this[_0x2e90('0x21')]};var _0x4e893f=md5(JSON['stringify'](_0x11bf2a));if(this[_0x2e90('0x1')]!==_0x4e893f){this[_0x2e90('0x1')]=_0x4e893f;io[_0x2e90('0x32')](_0x2e90('0x33'),_0x11bf2a);}};module['exports']=Agent; \ No newline at end of file +var _0x689f=['faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','length','Status','format','chatStatus','chatStatusTime','smsStatus','smsCurrentCapacity','stringify','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity'];(function(_0x15ba03,_0x3ded28){var _0x5ec7d8=function(_0x375ee3){while(--_0x375ee3){_0x15ba03['push'](_0x15ba03['shift']());}};_0x5ec7d8(++_0x3ded28);}(_0x689f,0x14f));var _0xf689=function(_0x4fbffe,_0x4c69d1){_0x4fbffe=_0x4fbffe-0x0;var _0x2bbd73=_0x689f[_0x4fbffe];return _0x2bbd73;};'use strict';var _=require('lodash');var moment=require(_0xf689('0x0'));var md5=require(_0xf689('0x1'));var Redis=require(_0xf689('0x2'));var config=require(_0xf689('0x3'));config['redis']=_[_0xf689('0x4')](config[_0xf689('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf689('0x6'))(new Redis(config[_0xf689('0x5')]));function Agent(_0x398628){this['id']=_0x398628['id']||0x0;this[_0xf689('0x7')]=_0x398628[_0xf689('0x7')]||'';this[_0xf689('0x8')]=_0x398628['online']||!![];this[_0xf689('0x9')]=_0x398628[_0xf689('0x9')]||![];this[_0xf689('0xa')]=_0x398628[_0xf689('0xa')]||![];this[_0xf689('0xb')]=_0x398628[_0xf689('0xb')]||![];this[_0xf689('0xc')]=_0x398628[_0xf689('0xc')]||![];this[_0xf689('0xd')]=_0x398628[_0xf689('0xd')]||![];this['openchannelPause']=_0x398628[_0xf689('0xe')]||![];this['chatStatus']=_0xf689('0xf');this['chatStatusTime']=0x0;this[_0xf689('0x10')]=_0x398628['chatCapacity']||0x0;this[_0xf689('0x11')]=0x0;this[_0xf689('0x12')]='unknown';this[_0xf689('0x13')]=0x0;this['mailCapacity']=_0x398628[_0xf689('0x14')]||0x0;this[_0xf689('0x15')]=0x0;this[_0xf689('0x16')]='unknown';this[_0xf689('0x17')]=0x0;this[_0xf689('0x18')]=_0x398628['faxCapacity']||0x0;this[_0xf689('0x19')]=0x0;this['smsStatus']=_0xf689('0xf');this[_0xf689('0x1a')]=0x0;this['smsCapacity']=_0x398628[_0xf689('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xf689('0x1c')]=_0xf689('0xf');this[_0xf689('0x1d')]=0x0;this['openchannelCapacity']=_0x398628[_0xf689('0x1e')]||0x0;this[_0xf689('0x1f')]=0x0;this[_0xf689('0x20')]=![];this[_0xf689('0x21')]=undefined;this[_0xf689('0x1')]='';this['updateRealtime']();}Agent[_0xf689('0x22')][_0xf689('0x23')]=function(_0x15f0f8){if(this[_0x15f0f8+_0xf689('0x24')]>0x0){if(this[_0x15f0f8+_0xf689('0x25')]>0x0&&this[_0x15f0f8+'CurrentCapacity']>=this[_0x15f0f8+_0xf689('0x25')]){return _0xf689('0x26');}else{return _0xf689('0x27');}}else{return _0xf689('0x28');}};Agent['prototype']['updateRealtime']=function(){var _0x56b805=['mail',_0xf689('0x29'),_0xf689('0x2a'),'fax','sms'];for(var _0x1a4a26=0x0;_0x1a4a26<_0x56b805[_0xf689('0x2b')];_0x1a4a26+=0x1){var _0x1c986b=this['getChannelStatus'](_0x56b805[_0x1a4a26]);if(this[_0x56b805[_0x1a4a26]+_0xf689('0x2c')]!==_0x1c986b){this[_0x56b805[_0x1a4a26]+'StatusTime']=_['toNumber'](moment()[_0xf689('0x2d')]('x'));}this[_0x56b805[_0x1a4a26]+_0xf689('0x2c')]=_0x1c986b;}var _0x33c456={'id':this['id'],'name':this[_0xf689('0x7')],'online':this[_0xf689('0x8')],'voicePause':this[_0xf689('0x9')],'chatPause':this[_0xf689('0xa')],'mailPause':this[_0xf689('0xb')],'smsPause':this[_0xf689('0xd')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xf689('0x2e')],'chatStatusTime':this[_0xf689('0x2f')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xf689('0x11')],'mailStatus':this[_0xf689('0x12')],'mailStatusTime':this[_0xf689('0x13')],'mailCapacity':this[_0xf689('0x14')],'mailCurrentCapacity':this[_0xf689('0x15')],'faxStatus':this[_0xf689('0x16')],'faxStatusTime':this[_0xf689('0x17')],'faxCapacity':this[_0xf689('0x18')],'faxCurrentCapacity':this[_0xf689('0x19')],'smsStatus':this[_0xf689('0x30')],'smsStatusTime':this[_0xf689('0x1a')],'smsCapacity':this[_0xf689('0x1b')],'smsCurrentCapacity':this[_0xf689('0x31')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xf689('0x1d')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf689('0x1f')],'busy':this[_0xf689('0x20')],'busyQueue':this[_0xf689('0x21')]};var _0x339a2e=md5(JSON[_0xf689('0x32')](_0x33c456));if(this[_0xf689('0x1')]!==_0x339a2e){this[_0xf689('0x1')]=_0x339a2e;io['emit']('user:save',_0x33c456);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e195e67..a398522 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 _0x22aa=['chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','loggedIn','paused','length','online'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x22aa,0x84));var _0xa22a=function(_0x5c2dd3,_0x2ff971){_0x5c2dd3=_0x5c2dd3-0x0;var _0x29292c=_0x22aa[_0x5c2dd3];return _0x29292c;};'use strict';var _=require(_0xa22a('0x0'));var md5=require(_0xa22a('0x1'));var util=require(_0xa22a('0x2'));var Redis=require(_0xa22a('0x3'));var config=require(_0xa22a('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0xa22a('0x5'),'port':0x18eb});var io=require(_0xa22a('0x6'))(new Redis(config[_0xa22a('0x7')]));function ChatQueue(_0x55ed02){this['id']=_0x55ed02['id']||0x0;this[_0xa22a('0x8')]=_0x55ed02[_0xa22a('0x8')]||'';this[_0xa22a('0x9')]=_0x55ed02['timeout']||0xa;this[_0xa22a('0xa')]=_0x55ed02[_0xa22a('0xa')]||_0xa22a('0xb');this[_0xa22a('0xc')]=_0x55ed02[_0xa22a('0xc')];this[_0xa22a('0xd')]={};this[_0xa22a('0xe')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype'][_0xa22a('0xf')]=function(){var _0x29067d=this[_0xa22a('0xd')][_0xa22a('0x10')];this['mapAgentsId']=_['map'](this[_0xa22a('0xc')],'id');this[_0xa22a('0xd')]['_rr']=_0x29067d;};ChatQueue[_0xa22a('0x11')][_0xa22a('0x12')]=function(){this[_0xa22a('0x13')]=0x0;this[_0xa22a('0x14')]=0x0;for(var _0x25f896=0x0;_0x25f896=0x0?this['available']:0x0;var _0x380048={'id':this['id'],'available':this[_0xa22a('0x18')],'loggedIn':this[_0xa22a('0x13')],'name':this[_0xa22a('0x8')],'paused':this[_0xa22a('0x14')],'waiting':this['waiting']};var _0x4d2fdb=md5(JSON[_0xa22a('0x19')](_0x380048));if(this[_0xa22a('0x1')]!==_0x4d2fdb){this[_0xa22a('0x1')]=_0x4d2fdb;io['to'](util[_0xa22a('0x1a')](_0xa22a('0x1b'),_0x380048[_0xa22a('0x8')]))[_0xa22a('0x1c')](_0xa22a('0x1d'),_0x380048);}};module[_0xa22a('0x1e')]=ChatQueue; \ No newline at end of file +var _0x4089=['loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x2a6f98,_0x596d5b){var _0x1f04d6=function(_0x47b1a0){while(--_0x47b1a0){_0x2a6f98['push'](_0x2a6f98['shift']());}};_0x1f04d6(++_0x596d5b);}(_0x4089,0x149));var _0x9408=function(_0x2ce877,_0x12ceff){_0x2ce877=_0x2ce877-0x0;var _0x5692ab=_0x4089[_0x2ce877];return _0x5692ab;};'use strict';var _=require(_0x9408('0x0'));var md5=require(_0x9408('0x1'));var util=require(_0x9408('0x2'));var Redis=require(_0x9408('0x3'));var config=require(_0x9408('0x4'));config[_0x9408('0x5')]=_[_0x9408('0x6')](config['redis'],{'host':_0x9408('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9408('0x5')]));function ChatQueue(_0x6bfb8c){this['id']=_0x6bfb8c['id']||0x0;this[_0x9408('0x8')]=_0x6bfb8c[_0x9408('0x8')]||'';this[_0x9408('0x9')]=_0x6bfb8c[_0x9408('0x9')]||0xa;this[_0x9408('0xa')]=_0x6bfb8c[_0x9408('0xa')]||'beepall';this[_0x9408('0xb')]=_0x6bfb8c[_0x9408('0xb')];this[_0x9408('0xc')]={};this[_0x9408('0xd')]=0x0;this[_0x9408('0x1')]='';this[_0x9408('0xe')]();this[_0x9408('0xf')]();}ChatQueue[_0x9408('0x10')][_0x9408('0xe')]=function(){var _0x7d58f8=this['mapAgentsId'][_0x9408('0x11')];this['mapAgentsId']=_[_0x9408('0x12')](this[_0x9408('0xb')],'id');this['mapAgentsId'][_0x9408('0x11')]=_0x7d58f8;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x9408('0x13')]=0x0;this[_0x9408('0x14')]=0x0;for(var _0x20fc8a=0x0;_0x20fc8a=0x0?this[_0x9408('0x18')]:0x0;var _0x415d01={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9408('0x13')],'name':this[_0x9408('0x8')],'paused':this[_0x9408('0x14')],'waiting':this[_0x9408('0xd')]};var _0x15e338=md5(JSON[_0x9408('0x19')](_0x415d01));if(this[_0x9408('0x1')]!==_0x15e338){this[_0x9408('0x1')]=_0x15e338;io['to'](util[_0x9408('0x1a')](_0x9408('0x1b'),_0x415d01[_0x9408('0x8')]))['emit'](_0x9408('0x1c'),_0x415d01);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 949379a..7cc92b7 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 _0x8d4f=['waiting','updateRouting','prototype','map','_rr','updateRealtime','paused','online','loggedIn','faxPause','available','stringify','fax:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d4f,0x153));var _0xf8d4=function(_0x4e94b2,_0x4e0528){_0x4e94b2=_0x4e94b2-0x0;var _0x560fb4=_0x8d4f[_0x4e94b2];return _0x560fb4;};'use strict';var _=require(_0xf8d4('0x0'));var md5=require(_0xf8d4('0x1'));var util=require(_0xf8d4('0x2'));var Redis=require(_0xf8d4('0x3'));var config=require(_0xf8d4('0x4'));config[_0xf8d4('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf8d4('0x5')]));function FaxQueue(_0x8bc394){this['id']=_0x8bc394['id']||0x0;this[_0xf8d4('0x6')]=_0x8bc394[_0xf8d4('0x6')]||'';this[_0xf8d4('0x7')]=_0x8bc394[_0xf8d4('0x7')]||0xa;this['strategy']=_0x8bc394[_0xf8d4('0x8')]||_0xf8d4('0x9');this[_0xf8d4('0xa')]=_0x8bc394[_0xf8d4('0xa')];this[_0xf8d4('0xb')]={};this[_0xf8d4('0xc')]=0x0;this[_0xf8d4('0x1')]='';this[_0xf8d4('0xd')]();this['updateRealtime']();}FaxQueue[_0xf8d4('0xe')][_0xf8d4('0xd')]=function(){var _0x419b91=this[_0xf8d4('0xb')]['_rr'];this['mapAgentsId']=_[_0xf8d4('0xf')](this[_0xf8d4('0xa')],'id');this[_0xf8d4('0xb')][_0xf8d4('0x10')]=_0x419b91;};FaxQueue[_0xf8d4('0xe')][_0xf8d4('0x11')]=function(){this['loggedIn']=0x0;this[_0xf8d4('0x12')]=0x0;for(var _0x99e14d=0x0;_0x99e14d=0x0?this[_0xf8d4('0x16')]:0x0;var _0x4963d3={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xf8d4('0x6')],'paused':this[_0xf8d4('0x12')],'waiting':this[_0xf8d4('0xc')]};var _0x83986f=md5(JSON[_0xf8d4('0x17')](_0x4963d3));if(this[_0xf8d4('0x1')]!==_0x83986f){this[_0xf8d4('0x1')]=_0x83986f;io['to'](util['format'](_0xf8d4('0x18'),_0x4963d3[_0xf8d4('0x6')]))[_0xf8d4('0x19')]('fax_queue:save',_0x4963d3);}};module[_0xf8d4('0x1a')]=FaxQueue; \ No newline at end of file +var _0xbbde=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x3906d2,_0x4b3aab){var _0x5d74c8=function(_0x2ab97c){while(--_0x2ab97c){_0x3906d2['push'](_0x3906d2['shift']());}};_0x5d74c8(++_0x4b3aab);}(_0xbbde,0x120));var _0xebbd=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xbbde[_0x34df4a];return _0x145c69;};'use strict';var _=require('lodash');var md5=require(_0xebbd('0x0'));var util=require(_0xebbd('0x1'));var Redis=require('ioredis');var config=require(_0xebbd('0x2'));config[_0xebbd('0x3')]=_[_0xebbd('0x4')](config[_0xebbd('0x3')],{'host':_0xebbd('0x5'),'port':0x18eb});var io=require(_0xebbd('0x6'))(new Redis(config['redis']));function FaxQueue(_0x217313){this['id']=_0x217313['id']||0x0;this['name']=_0x217313[_0xebbd('0x7')]||'';this[_0xebbd('0x8')]=_0x217313['timeout']||0xa;this[_0xebbd('0x9')]=_0x217313['strategy']||_0xebbd('0xa');this[_0xebbd('0xb')]=_0x217313[_0xebbd('0xb')];this[_0xebbd('0xc')]={};this[_0xebbd('0xd')]=0x0;this[_0xebbd('0x0')]='';this[_0xebbd('0xe')]();this[_0xebbd('0xf')]();}FaxQueue[_0xebbd('0x10')][_0xebbd('0xe')]=function(){var _0x29b837=this[_0xebbd('0xc')]['_rr'];this['mapAgentsId']=_[_0xebbd('0x11')](this[_0xebbd('0xb')],'id');this[_0xebbd('0xc')][_0xebbd('0x12')]=_0x29b837;};FaxQueue['prototype']['updateRealtime']=function(){this[_0xebbd('0x13')]=0x0;this[_0xebbd('0x14')]=0x0;for(var _0x29f656=0x0;_0x29f656=0x0?this[_0xebbd('0x17')]:0x0;var _0xf94219={'id':this['id'],'available':this['available'],'loggedIn':this[_0xebbd('0x13')],'name':this[_0xebbd('0x7')],'paused':this[_0xebbd('0x14')],'waiting':this[_0xebbd('0xd')]};var _0xbc585c=md5(JSON[_0xebbd('0x18')](_0xf94219));if(this[_0xebbd('0x0')]!==_0xbc585c){this['md5']=_0xbc585c;io['to'](util[_0xebbd('0x19')](_0xebbd('0x1a'),_0xf94219[_0xebbd('0x7')]))[_0xebbd('0x1b')](_0xebbd('0x1c'),_0xf94219);}};module[_0xebbd('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 47aff8e..3daec09 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 _0x413c=['Intervals','exports','name'];(function(_0x32ab1a,_0x1896ab){var _0x5956c5=function(_0x10f2d4){while(--_0x10f2d4){_0x32ab1a['push'](_0x32ab1a['shift']());}};_0x5956c5(++_0x1896ab);}(_0x413c,0x104));var _0xc413=function(_0xaa422,_0x367693){_0xaa422=_0xaa422-0x0;var _0xc05eeb=_0x413c[_0xaa422];return _0xc05eeb;};'use strict';function Interval(_0x481c69){this['id']=_0x481c69['id']||0x0;this[_0xc413('0x0')]=_0x481c69[_0xc413('0x0')]||'';this[_0xc413('0x1')]=_0x481c69[_0xc413('0x1')]||{};}module[_0xc413('0x2')]=Interval; \ No newline at end of file +var _0x69b5=['Intervals','exports','name'];(function(_0x2b801f,_0x535f5a){var _0x314410=function(_0x4b6482){while(--_0x4b6482){_0x2b801f['push'](_0x2b801f['shift']());}};_0x314410(++_0x535f5a);}(_0x69b5,0x18b));var _0x569b=function(_0x114bf1,_0x16ac4a){_0x114bf1=_0x114bf1-0x0;var _0x58072f=_0x69b5[_0x114bf1];return _0x58072f;};'use strict';function Interval(_0x123026){this['id']=_0x123026['id']||0x0;this[_0x569b('0x0')]=_0x123026[_0x569b('0x0')]||'';this['Intervals']=_0x123026[_0x569b('0x1')]||{};}module[_0x569b('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index a621afd..7abd685 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 _0x8f6b=['updateRouting','updateRealtime','prototype','_rr','loggedIn','length','mailPause','paused','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x333f03,_0x25e37d){var _0x12c61b=function(_0x14457a){while(--_0x14457a){_0x333f03['push'](_0x333f03['shift']());}};_0x12c61b(++_0x25e37d);}(_0x8f6b,0x146));var _0xb8f6=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x8f6b[_0x373dee];return _0x46798f;};'use strict';var _=require(_0xb8f6('0x0'));var md5=require(_0xb8f6('0x1'));var util=require(_0xb8f6('0x2'));var Redis=require('ioredis');var config=require(_0xb8f6('0x3'));config[_0xb8f6('0x4')]=_['defaults'](config[_0xb8f6('0x4')],{'host':_0xb8f6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb8f6('0x4')]));function MailQueue(_0x53902e){this['id']=_0x53902e['id']||0x0;this[_0xb8f6('0x6')]=_0x53902e['name']||'';this[_0xb8f6('0x7')]=_0x53902e['timeout']||0xa;this[_0xb8f6('0x8')]=_0x53902e[_0xb8f6('0x8')]||'beepall';this['Agents']=_0x53902e[_0xb8f6('0x9')];this[_0xb8f6('0xa')]={};this[_0xb8f6('0xb')]=0x0;this[_0xb8f6('0x1')]='';this[_0xb8f6('0xc')]();this[_0xb8f6('0xd')]();}MailQueue[_0xb8f6('0xe')][_0xb8f6('0xc')]=function(){var _0x16cc69=this[_0xb8f6('0xa')][_0xb8f6('0xf')];this[_0xb8f6('0xa')]=_['map'](this[_0xb8f6('0x9')],'id');this[_0xb8f6('0xa')]['_rr']=_0x16cc69;};MailQueue[_0xb8f6('0xe')][_0xb8f6('0xd')]=function(){this[_0xb8f6('0x10')]=0x0;this['paused']=0x0;for(var _0x306072=0x0;_0x306072=0x0?this[_0xb8f6('0x14')]:0x0;var _0x537d5e={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb8f6('0x10')],'name':this[_0xb8f6('0x6')],'paused':this[_0xb8f6('0x13')],'waiting':this[_0xb8f6('0xb')]};var _0x145b9f=md5(JSON['stringify'](_0x537d5e));if(this[_0xb8f6('0x1')]!==_0x145b9f){this[_0xb8f6('0x1')]=_0x145b9f;io['to'](util[_0xb8f6('0x15')](_0xb8f6('0x16'),_0x537d5e['name']))[_0xb8f6('0x17')](_0xb8f6('0x18'),_0x537d5e);}};module[_0xb8f6('0x19')]=MailQueue; \ No newline at end of file +var _0xe55d=['loggedIn','paused','online','mailPause','available','stringify','format','mail_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','map','_rr'];(function(_0x2291f0,_0x1f3e3b){var _0x35f720=function(_0x26d15e){while(--_0x26d15e){_0x2291f0['push'](_0x2291f0['shift']());}};_0x35f720(++_0x1f3e3b);}(_0xe55d,0x126));var _0xde55=function(_0x51ebda,_0x4e4878){_0x51ebda=_0x51ebda-0x0;var _0xb3bfbb=_0xe55d[_0x51ebda];return _0xb3bfbb;};'use strict';var _=require(_0xde55('0x0'));var md5=require(_0xde55('0x1'));var util=require('util');var Redis=require(_0xde55('0x2'));var config=require(_0xde55('0x3'));config[_0xde55('0x4')]=_[_0xde55('0x5')](config[_0xde55('0x4')],{'host':_0xde55('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xde55('0x4')]));function MailQueue(_0x295f54){this['id']=_0x295f54['id']||0x0;this[_0xde55('0x7')]=_0x295f54['name']||'';this[_0xde55('0x8')]=_0x295f54[_0xde55('0x8')]||0xa;this[_0xde55('0x9')]=_0x295f54[_0xde55('0x9')]||_0xde55('0xa');this[_0xde55('0xb')]=_0x295f54['Agents'];this[_0xde55('0xc')]={};this[_0xde55('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xde55('0xe')]();}MailQueue[_0xde55('0xf')]['updateRouting']=function(){var _0x4c84f3=this[_0xde55('0xc')]['_rr'];this[_0xde55('0xc')]=_[_0xde55('0x10')](this[_0xde55('0xb')],'id');this['mapAgentsId'][_0xde55('0x11')]=_0x4c84f3;};MailQueue[_0xde55('0xf')][_0xde55('0xe')]=function(){this[_0xde55('0x12')]=0x0;this[_0xde55('0x13')]=0x0;for(var _0x3663d5=0x0;_0x3663d5=0x0?this[_0xde55('0x16')]:0x0;var _0x1abffb={'id':this['id'],'available':this[_0xde55('0x16')],'loggedIn':this[_0xde55('0x12')],'name':this[_0xde55('0x7')],'paused':this['paused'],'waiting':this[_0xde55('0xd')]};var _0x4f1da7=md5(JSON[_0xde55('0x17')](_0x1abffb));if(this[_0xde55('0x1')]!==_0x4f1da7){this['md5']=_0x4f1da7;io['to'](util[_0xde55('0x18')]('mail:queue:%s',_0x1abffb[_0xde55('0x7')]))['emit'](_0xde55('0x19'),_0x1abffb);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2d941b9..08402a5 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 _0x5707=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x51ae29,_0x333712){var _0x41124f=function(_0x166ad3){while(--_0x166ad3){_0x51ae29['push'](_0x51ae29['shift']());}};_0x41124f(++_0x333712);}(_0x5707,0x17f));var _0x7570=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0x5707[_0x529059];return _0x156bc2;};'use strict';var _=require('lodash');var md5=require(_0x7570('0x0'));var util=require(_0x7570('0x1'));var Redis=require(_0x7570('0x2'));var config=require(_0x7570('0x3'));config[_0x7570('0x4')]=_[_0x7570('0x5')](config[_0x7570('0x4')],{'host':_0x7570('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7570('0x4')]));function OpenchannelQueue(_0x4e653b){this['id']=_0x4e653b['id']||0x0;this[_0x7570('0x7')]=_0x4e653b[_0x7570('0x7')]||'';this[_0x7570('0x8')]=_0x4e653b[_0x7570('0x8')]||0xa;this[_0x7570('0x9')]=_0x4e653b[_0x7570('0x9')]||_0x7570('0xa');this[_0x7570('0xb')]=_0x4e653b[_0x7570('0xb')];this[_0x7570('0xc')]={};this[_0x7570('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x7570('0xe')]();}OpenchannelQueue[_0x7570('0xf')][_0x7570('0x10')]=function(){var _0x117c2c=this[_0x7570('0xc')][_0x7570('0x11')];this[_0x7570('0xc')]=_[_0x7570('0x12')](this[_0x7570('0xb')],'id');this[_0x7570('0xc')][_0x7570('0x11')]=_0x117c2c;};OpenchannelQueue['prototype'][_0x7570('0xe')]=function(){this[_0x7570('0x13')]=0x0;this[_0x7570('0x14')]=0x0;for(var _0x11ab56=0x0;_0x11ab56=0x0?this[_0x7570('0x18')]:0x0;var _0x48caf1={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7570('0x13')],'name':this[_0x7570('0x7')],'paused':this[_0x7570('0x14')],'waiting':this['waiting']};var _0x3c3a01=md5(JSON[_0x7570('0x19')](_0x48caf1));if(this[_0x7570('0x0')]!==_0x3c3a01){this[_0x7570('0x0')]=_0x3c3a01;io['to'](util[_0x7570('0x1a')](_0x7570('0x1b'),_0x48caf1[_0x7570('0x7')]))['emit'](_0x7570('0x1c'),_0x48caf1);}};module[_0x7570('0x1d')]=OpenchannelQueue; \ No newline at end of file +var _0x47d5=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','length','loggedIn','openchannelPause'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x47d5,0x1eb));var _0x547d=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0x47d5[_0x76b00b];return _0xc8e4a;};'use strict';var _=require('lodash');var md5=require(_0x547d('0x0'));var util=require(_0x547d('0x1'));var Redis=require('ioredis');var config=require(_0x547d('0x2'));config['redis']=_['defaults'](config[_0x547d('0x3')],{'host':_0x547d('0x4'),'port':0x18eb});var io=require(_0x547d('0x5'))(new Redis(config[_0x547d('0x3')]));function OpenchannelQueue(_0xc8ba71){this['id']=_0xc8ba71['id']||0x0;this[_0x547d('0x6')]=_0xc8ba71[_0x547d('0x6')]||'';this['timeout']=_0xc8ba71[_0x547d('0x7')]||0xa;this['strategy']=_0xc8ba71[_0x547d('0x8')]||_0x547d('0x9');this[_0x547d('0xa')]=_0xc8ba71[_0x547d('0xa')];this[_0x547d('0xb')]={};this[_0x547d('0xc')]=0x0;this['md5']='';this[_0x547d('0xd')]();this['updateRealtime']();}OpenchannelQueue[_0x547d('0xe')][_0x547d('0xd')]=function(){var _0x38f0fa=this[_0x547d('0xb')][_0x547d('0xf')];this[_0x547d('0xb')]=_[_0x547d('0x10')](this[_0x547d('0xa')],'id');this[_0x547d('0xb')][_0x547d('0xf')]=_0x38f0fa;};OpenchannelQueue[_0x547d('0xe')][_0x547d('0x11')]=function(){this['loggedIn']=0x0;this[_0x547d('0x12')]=0x0;for(var _0x557d70=0x0;_0x557d70=0x0?this[_0x547d('0x16')]:0x0;var _0x52d227={'id':this['id'],'available':this[_0x547d('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x547d('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x3eacc4=md5(JSON[_0x547d('0x17')](_0x52d227));if(this[_0x547d('0x0')]!==_0x3eacc4){this[_0x547d('0x0')]=_0x3eacc4;io['to'](util['format'](_0x547d('0x18'),_0x52d227[_0x547d('0x6')]))['emit'](_0x547d('0x19'),_0x52d227);}};module[_0x547d('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 6d9773d..1abb1a1 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 _0x2b9f=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name'];(function(_0x30a331,_0x5d9dc6){var _0x534cc1=function(_0x5eac1b){while(--_0x5eac1b){_0x30a331['push'](_0x30a331['shift']());}};_0x534cc1(++_0x5d9dc6);}(_0x2b9f,0x68));var _0xf2b9=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x2b9f[_0x1fc122];return _0xa2cb13;};'use strict';var _=require('lodash');var md5=require(_0xf2b9('0x0'));var util=require(_0xf2b9('0x1'));var Redis=require(_0xf2b9('0x2'));var config=require(_0xf2b9('0x3'));config[_0xf2b9('0x4')]=_[_0xf2b9('0x5')](config[_0xf2b9('0x4')],{'host':_0xf2b9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf2b9('0x4')]));function SmsQueue(_0x47ec64){this['id']=_0x47ec64['id']||0x0;this[_0xf2b9('0x7')]=_0x47ec64['name']||'';this[_0xf2b9('0x8')]=_0x47ec64['timeout']||0xa;this[_0xf2b9('0x9')]=_0x47ec64[_0xf2b9('0x9')]||_0xf2b9('0xa');this[_0xf2b9('0xb')]=_0x47ec64[_0xf2b9('0xb')];this[_0xf2b9('0xc')]={};this[_0xf2b9('0xd')]=0x0;this['md5']='';this[_0xf2b9('0xe')]();this[_0xf2b9('0xf')]();}SmsQueue[_0xf2b9('0x10')][_0xf2b9('0xe')]=function(){var _0x42d53f=this[_0xf2b9('0xc')]['_rr'];this[_0xf2b9('0xc')]=_[_0xf2b9('0x11')](this[_0xf2b9('0xb')],'id');this[_0xf2b9('0xc')]['_rr']=_0x42d53f;};SmsQueue[_0xf2b9('0x10')][_0xf2b9('0xf')]=function(){this[_0xf2b9('0x12')]=0x0;this[_0xf2b9('0x13')]=0x0;for(var _0x158b53=0x0;_0x158b53=0x0?this[_0xf2b9('0x16')]:0x0;var _0x30bd51={'id':this['id'],'available':this[_0xf2b9('0x16')],'loggedIn':this[_0xf2b9('0x12')],'name':this[_0xf2b9('0x7')],'paused':this[_0xf2b9('0x13')],'waiting':this[_0xf2b9('0xd')]};var _0x349fdb=md5(JSON[_0xf2b9('0x17')](_0x30bd51));if(this[_0xf2b9('0x0')]!==_0x349fdb){this[_0xf2b9('0x0')]=_0x349fdb;io['to'](util[_0xf2b9('0x18')](_0xf2b9('0x19'),_0x30bd51['name']))[_0xf2b9('0x1a')](_0xf2b9('0x1b'),_0x30bd51);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xae6f=['exports','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xae6f,0x6d));var _0xfae6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xae6f[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var md5=require(_0xfae6('0x0'));var util=require(_0xfae6('0x1'));var Redis=require(_0xfae6('0x2'));var config=require(_0xfae6('0x3'));config[_0xfae6('0x4')]=_['defaults'](config[_0xfae6('0x4')],{'host':_0xfae6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfae6('0x4')]));function SmsQueue(_0x4060d7){this['id']=_0x4060d7['id']||0x0;this[_0xfae6('0x6')]=_0x4060d7[_0xfae6('0x6')]||'';this[_0xfae6('0x7')]=_0x4060d7[_0xfae6('0x7')]||0xa;this['strategy']=_0x4060d7[_0xfae6('0x8')]||'beepall';this[_0xfae6('0x9')]=_0x4060d7['Agents'];this[_0xfae6('0xa')]={};this[_0xfae6('0xb')]=0x0;this['md5']='';this[_0xfae6('0xc')]();this[_0xfae6('0xd')]();}SmsQueue[_0xfae6('0xe')][_0xfae6('0xc')]=function(){var _0x1a8849=this['mapAgentsId'][_0xfae6('0xf')];this[_0xfae6('0xa')]=_[_0xfae6('0x10')](this['Agents'],'id');this['mapAgentsId'][_0xfae6('0xf')]=_0x1a8849;};SmsQueue['prototype'][_0xfae6('0xd')]=function(){this[_0xfae6('0x11')]=0x0;this[_0xfae6('0x12')]=0x0;for(var _0x40b9cc=0x0;_0x40b9cc=0x0?this[_0xfae6('0x14')]:0x0;var _0x28246f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfae6('0x11')],'name':this[_0xfae6('0x6')],'paused':this[_0xfae6('0x12')],'waiting':this[_0xfae6('0xb')]};var _0x1c4f6b=md5(JSON[_0xfae6('0x15')](_0x28246f));if(this['md5']!==_0x1c4f6b){this[_0xfae6('0x0')]=_0x1c4f6b;io['to'](util[_0xfae6('0x16')](_0xfae6('0x17'),_0x28246f[_0xfae6('0x6')]))[_0xfae6('0x18')](_0xfae6('0x19'),_0x28246f);}};module[_0xfae6('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ba2e519..274b915 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 _0xef20=['updateRouting','updateRealtime','initMailQueues','exports','bluebird','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xef20,0x7c));var _0x0ef2=function(_0x330eb4,_0x5a984c){_0x330eb4=_0x330eb4-0x0;var _0x146944=_0xef20[_0x330eb4];return _0x146944;};'use strict';var BPromise=require(_0x0ef2('0x0'));var util=require('util');var _=require('lodash');var moment=require(_0x0ef2('0x1'));var Agent=require(_0x0ef2('0x2'));var Interval=require(_0x0ef2('0x3'));var OpenchannelQueue=require(_0x0ef2('0x4'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x0ef2('0x5'));var MailQueue=require(_0x0ef2('0x6'));var FaxQueue=require(_0x0ef2('0x7'));var Realtime=function(){this[_0x0ef2('0x8')]={};this[_0x0ef2('0x9')]={};this[_0x0ef2('0xa')]={};this[_0x0ef2('0xb')]={};this[_0x0ef2('0xc')]={};this[_0x0ef2('0xd')]={};this[_0x0ef2('0xe')]={};this[_0x0ef2('0xf')]={};this['mailQueuesWaitingInteractions']={};this[_0x0ef2('0x10')]={};this[_0x0ef2('0x11')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x38b9c3,_0x31a908,_0x471359){var _0x265282=_[_0x0ef2('0x12')](_0x38b9c3,function(_0xfcc89,_0x7e582c){return _0xfcc89[_0x471359];});for(var _0x3e0e36 in _0x31a908){if(_0x31a908['hasOwnProperty'](_0x3e0e36)){if(!_0x265282[_0x3e0e36]){delete _0x31a908[_0x3e0e36];}}}}Realtime[_0x0ef2('0x13')][_0x0ef2('0x14')]=function(_0x338e86,_0x5f1113){for(var _0x2b9996 in _0x5f1113){if(_0x338e86['hasOwnProperty'](_0x2b9996)){_0x338e86[_0x2b9996]=_0x5f1113[_0x2b9996];}}};Realtime[_0x0ef2('0x13')][_0x0ef2('0x15')]=function(){var _0x542e4d=this;return function(_0x178694){if(_0x178694){freeIsNotKey(_0x178694,_0x542e4d[_0x0ef2('0x8')],'id');for(var _0x468e76=0x0,_0x3ed9cd={},_0x5ded10={};_0x468e76<_0x178694[_0x0ef2('0x16')];_0x468e76+=0x1){_0x3ed9cd=_0x178694[_0x468e76];if(_[_0x0ef2('0x17')](_0x542e4d[_0x0ef2('0x8')][_0x3ed9cd['id']])){_0x542e4d[_0x0ef2('0x8')][_0x3ed9cd['id']]=new Agent(_0x3ed9cd);}else{_0x542e4d[_0x0ef2('0x14')](_0x542e4d['agents'][_0x3ed9cd['id']],_0x3ed9cd);}}}return _0x542e4d['agents'];};};Realtime[_0x0ef2('0x13')][_0x0ef2('0x18')]=function(){var _0x41a9a0=this;return function(_0x252631){if(_0x252631){freeIsNotKey(_0x252631,_0x41a9a0[_0x0ef2('0x9')],'id');for(var _0x16a267=0x0,_0x116fec={},_0x18a358={};_0x16a267<_0x252631['length'];_0x16a267+=0x1){_0x116fec=_0x252631[_0x16a267];if(_[_0x0ef2('0x17')](_0x41a9a0['intervals'][_0x116fec['id']])){_0x41a9a0[_0x0ef2('0x9')][_0x116fec['id']]=new Interval(_0x116fec);}else{_0x41a9a0[_0x0ef2('0x14')](_0x41a9a0['intervals'][_0x116fec['id']],_0x116fec);}}}return _0x41a9a0['intervals'];};};Realtime['prototype'][_0x0ef2('0x19')]=function(){var _0x4a53a8=this;return function(_0x34ce8f){if(_0x34ce8f){freeIsNotKey(_0x34ce8f,_0x4a53a8['openchannelQueues'],'id');for(var _0xa799dd=0x0,_0x41e49c={},_0x5e67b4={};_0xa799dd<_0x34ce8f[_0x0ef2('0x16')];_0xa799dd+=0x1){_0x41e49c=_0x34ce8f[_0xa799dd];if(_['isUndefined'](_0x4a53a8['openchannelQueues'][_0x41e49c['id']])){_0x4a53a8[_0x0ef2('0xa')][_0x41e49c['id']]=new OpenchannelQueue(_0x41e49c);}else{_0x4a53a8[_0x0ef2('0x14')](_0x4a53a8[_0x0ef2('0xa')][_0x41e49c['id']],_0x41e49c);}_0x4a53a8[_0x0ef2('0xa')][_0x41e49c['id']][_0x0ef2('0x1a')]();_0x4a53a8[_0x0ef2('0xa')][_0x41e49c['id']][_0x0ef2('0x1b')]();}}return _0x4a53a8[_0x0ef2('0xa')];};};Realtime[_0x0ef2('0x13')]['initChatQueues']=function(){var _0x170972=this;return function(_0x5e5935){if(_0x5e5935){freeIsNotKey(_0x5e5935,_0x170972[_0x0ef2('0xb')],'id');for(var _0x256853=0x0,_0x3d14a1={},_0x198770={};_0x256853<_0x5e5935[_0x0ef2('0x16')];_0x256853+=0x1){_0x3d14a1=_0x5e5935[_0x256853];if(_[_0x0ef2('0x17')](_0x170972['chatQueues'][_0x3d14a1['id']])){_0x170972['chatQueues'][_0x3d14a1['id']]=new ChatQueue(_0x3d14a1);}else{_0x170972['mergeFromDatabase'](_0x170972[_0x0ef2('0xb')][_0x3d14a1['id']],_0x3d14a1);}_0x170972[_0x0ef2('0xb')][_0x3d14a1['id']][_0x0ef2('0x1a')]();_0x170972[_0x0ef2('0xb')][_0x3d14a1['id']][_0x0ef2('0x1b')]();}}return _0x170972[_0x0ef2('0xb')];};};Realtime[_0x0ef2('0x13')]['initSmsQueues']=function(){var _0x2643e0=this;return function(_0xad4370){if(_0xad4370){freeIsNotKey(_0xad4370,_0x2643e0['smsQueues'],'id');for(var _0x4b153b=0x0,_0x148fa2={},_0x474c1d={};_0x4b153b<_0xad4370[_0x0ef2('0x16')];_0x4b153b+=0x1){_0x148fa2=_0xad4370[_0x4b153b];if(_['isUndefined'](_0x2643e0[_0x0ef2('0xc')][_0x148fa2['id']])){_0x2643e0[_0x0ef2('0xc')][_0x148fa2['id']]=new SmsQueue(_0x148fa2);}else{_0x2643e0['mergeFromDatabase'](_0x2643e0[_0x0ef2('0xc')][_0x148fa2['id']],_0x148fa2);}_0x2643e0[_0x0ef2('0xc')][_0x148fa2['id']][_0x0ef2('0x1a')]();_0x2643e0[_0x0ef2('0xc')][_0x148fa2['id']][_0x0ef2('0x1b')]();}}return _0x2643e0[_0x0ef2('0xc')];};};Realtime[_0x0ef2('0x13')][_0x0ef2('0x1c')]=function(){var _0x1a3016=this;return function(_0x597c82){if(_0x597c82){freeIsNotKey(_0x597c82,_0x1a3016[_0x0ef2('0xd')],'id');for(var _0x2e523d=0x0,_0x2cc26d={},_0x350cea={};_0x2e523d<_0x597c82[_0x0ef2('0x16')];_0x2e523d+=0x1){_0x2cc26d=_0x597c82[_0x2e523d];if(_[_0x0ef2('0x17')](_0x1a3016['mailQueues'][_0x2cc26d['id']])){_0x1a3016[_0x0ef2('0xd')][_0x2cc26d['id']]=new MailQueue(_0x2cc26d);}else{_0x1a3016[_0x0ef2('0x14')](_0x1a3016[_0x0ef2('0xd')][_0x2cc26d['id']],_0x2cc26d);}_0x1a3016[_0x0ef2('0xd')][_0x2cc26d['id']][_0x0ef2('0x1a')]();_0x1a3016[_0x0ef2('0xd')][_0x2cc26d['id']][_0x0ef2('0x1b')]();}}return _0x1a3016[_0x0ef2('0xd')];};};Realtime[_0x0ef2('0x13')]['initFaxQueues']=function(){var _0x26c9a3=this;return function(_0x58a5b7){if(_0x58a5b7){freeIsNotKey(_0x58a5b7,_0x26c9a3[_0x0ef2('0xe')],'id');for(var _0x4e58e8=0x0,_0x5ad042={},_0x351f41={};_0x4e58e8<_0x58a5b7[_0x0ef2('0x16')];_0x4e58e8+=0x1){_0x5ad042=_0x58a5b7[_0x4e58e8];if(_['isUndefined'](_0x26c9a3[_0x0ef2('0xe')][_0x5ad042['id']])){_0x26c9a3[_0x0ef2('0xe')][_0x5ad042['id']]=new FaxQueue(_0x5ad042);}else{_0x26c9a3[_0x0ef2('0x14')](_0x26c9a3['faxQueues'][_0x5ad042['id']],_0x5ad042);}_0x26c9a3['faxQueues'][_0x5ad042['id']][_0x0ef2('0x1a')]();_0x26c9a3[_0x0ef2('0xe')][_0x5ad042['id']][_0x0ef2('0x1b')]();}}return _0x26c9a3[_0x0ef2('0xe')];};};module[_0x0ef2('0x1d')]=Realtime; \ No newline at end of file +var _0xfa27=['bluebird','util','lodash','moment','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','initAgents','length','mergeFromDatabase','initIntervals','isUndefined','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','chatQueues','initMailQueues','mailQueues','initFaxQueues','exports'];(function(_0x918730,_0x25e7d3){var _0x1f94f5=function(_0xf869ce){while(--_0xf869ce){_0x918730['push'](_0x918730['shift']());}};_0x1f94f5(++_0x25e7d3);}(_0xfa27,0xe7));var _0x7fa2=function(_0x905c65,_0x3a46c3){_0x905c65=_0x905c65-0x0;var _0x2ee6d6=_0xfa27[_0x905c65];return _0x2ee6d6;};'use strict';var BPromise=require(_0x7fa2('0x0'));var util=require(_0x7fa2('0x1'));var _=require(_0x7fa2('0x2'));var moment=require(_0x7fa2('0x3'));var Agent=require('../model/agent');var Interval=require(_0x7fa2('0x4'));var OpenchannelQueue=require(_0x7fa2('0x5'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x7fa2('0x6'));var MailQueue=require(_0x7fa2('0x7'));var FaxQueue=require(_0x7fa2('0x8'));var Realtime=function(){this[_0x7fa2('0x9')]={};this[_0x7fa2('0xa')]={};this[_0x7fa2('0xb')]={};this['chatQueues']={};this[_0x7fa2('0xc')]={};this['mailQueues']={};this[_0x7fa2('0xd')]={};this[_0x7fa2('0xe')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0x7fa2('0xf')]={};this[_0x7fa2('0x10')]={};};function freeIsNotKey(_0x17b494,_0x1b54d5,_0xe45f0f){var _0x43d8f9=_['mapKeys'](_0x17b494,function(_0x5bc71c,_0x95ad6f){return _0x5bc71c[_0xe45f0f];});for(var _0x4236f0 in _0x1b54d5){if(_0x1b54d5[_0x7fa2('0x11')](_0x4236f0)){if(!_0x43d8f9[_0x4236f0]){delete _0x1b54d5[_0x4236f0];}}}}Realtime[_0x7fa2('0x12')]['mergeFromDatabase']=function(_0x1bfd43,_0x2a79f2){for(var _0x5bd55f in _0x2a79f2){if(_0x1bfd43[_0x7fa2('0x11')](_0x5bd55f)){_0x1bfd43[_0x5bd55f]=_0x2a79f2[_0x5bd55f];}}};Realtime['prototype'][_0x7fa2('0x13')]=function(){var _0x3d709b=this;return function(_0x4c50a7){if(_0x4c50a7){freeIsNotKey(_0x4c50a7,_0x3d709b[_0x7fa2('0x9')],'id');for(var _0x330bf5=0x0,_0x59d24c={},_0x20691c={};_0x330bf5<_0x4c50a7[_0x7fa2('0x14')];_0x330bf5+=0x1){_0x59d24c=_0x4c50a7[_0x330bf5];if(_['isUndefined'](_0x3d709b[_0x7fa2('0x9')][_0x59d24c['id']])){_0x3d709b[_0x7fa2('0x9')][_0x59d24c['id']]=new Agent(_0x59d24c);}else{_0x3d709b[_0x7fa2('0x15')](_0x3d709b['agents'][_0x59d24c['id']],_0x59d24c);}}}return _0x3d709b[_0x7fa2('0x9')];};};Realtime[_0x7fa2('0x12')][_0x7fa2('0x16')]=function(){var _0x1d5827=this;return function(_0x297d8d){if(_0x297d8d){freeIsNotKey(_0x297d8d,_0x1d5827[_0x7fa2('0xa')],'id');for(var _0x24b760=0x0,_0x3453d2={},_0x3f09a5={};_0x24b760<_0x297d8d[_0x7fa2('0x14')];_0x24b760+=0x1){_0x3453d2=_0x297d8d[_0x24b760];if(_[_0x7fa2('0x17')](_0x1d5827[_0x7fa2('0xa')][_0x3453d2['id']])){_0x1d5827[_0x7fa2('0xa')][_0x3453d2['id']]=new Interval(_0x3453d2);}else{_0x1d5827[_0x7fa2('0x15')](_0x1d5827[_0x7fa2('0xa')][_0x3453d2['id']],_0x3453d2);}}}return _0x1d5827[_0x7fa2('0xa')];};};Realtime[_0x7fa2('0x12')][_0x7fa2('0x18')]=function(){var _0x5bcdfb=this;return function(_0x15ca4c){if(_0x15ca4c){freeIsNotKey(_0x15ca4c,_0x5bcdfb[_0x7fa2('0xb')],'id');for(var _0x15812c=0x0,_0x457ce9={},_0x5a2290={};_0x15812c<_0x15ca4c[_0x7fa2('0x14')];_0x15812c+=0x1){_0x457ce9=_0x15ca4c[_0x15812c];if(_[_0x7fa2('0x17')](_0x5bcdfb[_0x7fa2('0xb')][_0x457ce9['id']])){_0x5bcdfb['openchannelQueues'][_0x457ce9['id']]=new OpenchannelQueue(_0x457ce9);}else{_0x5bcdfb[_0x7fa2('0x15')](_0x5bcdfb[_0x7fa2('0xb')][_0x457ce9['id']],_0x457ce9);}_0x5bcdfb[_0x7fa2('0xb')][_0x457ce9['id']][_0x7fa2('0x19')]();_0x5bcdfb[_0x7fa2('0xb')][_0x457ce9['id']][_0x7fa2('0x1a')]();}}return _0x5bcdfb[_0x7fa2('0xb')];};};Realtime[_0x7fa2('0x12')][_0x7fa2('0x1b')]=function(){var _0x4bf1d6=this;return function(_0x3bb87f){if(_0x3bb87f){freeIsNotKey(_0x3bb87f,_0x4bf1d6[_0x7fa2('0x1c')],'id');for(var _0x1fe191=0x0,_0x575c37={},_0xcbcd71={};_0x1fe191<_0x3bb87f[_0x7fa2('0x14')];_0x1fe191+=0x1){_0x575c37=_0x3bb87f[_0x1fe191];if(_[_0x7fa2('0x17')](_0x4bf1d6[_0x7fa2('0x1c')][_0x575c37['id']])){_0x4bf1d6[_0x7fa2('0x1c')][_0x575c37['id']]=new ChatQueue(_0x575c37);}else{_0x4bf1d6[_0x7fa2('0x15')](_0x4bf1d6[_0x7fa2('0x1c')][_0x575c37['id']],_0x575c37);}_0x4bf1d6[_0x7fa2('0x1c')][_0x575c37['id']][_0x7fa2('0x19')]();_0x4bf1d6['chatQueues'][_0x575c37['id']][_0x7fa2('0x1a')]();}}return _0x4bf1d6['chatQueues'];};};Realtime[_0x7fa2('0x12')]['initSmsQueues']=function(){var _0x7eb2b1=this;return function(_0x4a1bf2){if(_0x4a1bf2){freeIsNotKey(_0x4a1bf2,_0x7eb2b1['smsQueues'],'id');for(var _0x271f1f=0x0,_0x41f7a2={},_0x222a4f={};_0x271f1f<_0x4a1bf2[_0x7fa2('0x14')];_0x271f1f+=0x1){_0x41f7a2=_0x4a1bf2[_0x271f1f];if(_['isUndefined'](_0x7eb2b1[_0x7fa2('0xc')][_0x41f7a2['id']])){_0x7eb2b1[_0x7fa2('0xc')][_0x41f7a2['id']]=new SmsQueue(_0x41f7a2);}else{_0x7eb2b1[_0x7fa2('0x15')](_0x7eb2b1[_0x7fa2('0xc')][_0x41f7a2['id']],_0x41f7a2);}_0x7eb2b1[_0x7fa2('0xc')][_0x41f7a2['id']][_0x7fa2('0x19')]();_0x7eb2b1[_0x7fa2('0xc')][_0x41f7a2['id']][_0x7fa2('0x1a')]();}}return _0x7eb2b1['smsQueues'];};};Realtime[_0x7fa2('0x12')][_0x7fa2('0x1d')]=function(){var _0x4c3e76=this;return function(_0x339dab){if(_0x339dab){freeIsNotKey(_0x339dab,_0x4c3e76[_0x7fa2('0x1e')],'id');for(var _0x3e59fa=0x0,_0x5cf6f0={},_0x519c4f={};_0x3e59fa<_0x339dab[_0x7fa2('0x14')];_0x3e59fa+=0x1){_0x5cf6f0=_0x339dab[_0x3e59fa];if(_[_0x7fa2('0x17')](_0x4c3e76[_0x7fa2('0x1e')][_0x5cf6f0['id']])){_0x4c3e76[_0x7fa2('0x1e')][_0x5cf6f0['id']]=new MailQueue(_0x5cf6f0);}else{_0x4c3e76[_0x7fa2('0x15')](_0x4c3e76['mailQueues'][_0x5cf6f0['id']],_0x5cf6f0);}_0x4c3e76[_0x7fa2('0x1e')][_0x5cf6f0['id']][_0x7fa2('0x19')]();_0x4c3e76['mailQueues'][_0x5cf6f0['id']][_0x7fa2('0x1a')]();}}return _0x4c3e76['mailQueues'];};};Realtime[_0x7fa2('0x12')][_0x7fa2('0x1f')]=function(){var _0x56392c=this;return function(_0x5122ab){if(_0x5122ab){freeIsNotKey(_0x5122ab,_0x56392c[_0x7fa2('0xd')],'id');for(var _0x176975=0x0,_0x2abbf4={},_0x3afd6e={};_0x176975<_0x5122ab[_0x7fa2('0x14')];_0x176975+=0x1){_0x2abbf4=_0x5122ab[_0x176975];if(_[_0x7fa2('0x17')](_0x56392c[_0x7fa2('0xd')][_0x2abbf4['id']])){_0x56392c[_0x7fa2('0xd')][_0x2abbf4['id']]=new FaxQueue(_0x2abbf4);}else{_0x56392c[_0x7fa2('0x15')](_0x56392c[_0x7fa2('0xd')][_0x2abbf4['id']],_0x2abbf4);}_0x56392c['faxQueues'][_0x2abbf4['id']][_0x7fa2('0x19')]();_0x56392c[_0x7fa2('0xd')][_0x2abbf4['id']][_0x7fa2('0x1a')]();}}return _0x56392c['faxQueues'];};};module[_0x7fa2('0x20')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 3e183a4..a5b8f61 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 _0xd0ee=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','Request'];(function(_0x188b02,_0x2b1d6e){var _0x36a4d3=function(_0x6787bb){while(--_0x6787bb){_0x188b02['push'](_0x188b02['shift']());}};_0x36a4d3(++_0x2b1d6e);}(_0xd0ee,0x1e4));var _0xed0e=function(_0x4e09ab,_0x4e8ca2){_0x4e09ab=_0x4e09ab-0x0;var _0x9ed0af=_0xd0ee[_0x4e09ab];return _0x9ed0af;};'use strict';var client=require('../client');exports['update']=function(_0x2ac645,_0x307a49){return client[_0xed0e('0x0')](_0xed0e('0x1'),{'body':_0x307a49,'options':{'where':{'id':_0x2ac645}},'log':_0xed0e('0x2')});};exports['addTags']=function(_0x56fb04,_0x22e24c){return client[_0xed0e('0x0')](_0xed0e('0x3'),{'body':_0x22e24c,'options':{'where':{'id':_0x56fb04}},'log':_0xed0e('0x4')});}; \ No newline at end of file +var _0xe208=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x305d48,_0x1e5ca9){var _0x3b705f=function(_0x260e1b){while(--_0x260e1b){_0x305d48['push'](_0x305d48['shift']());}};_0x3b705f(++_0x1e5ca9);}(_0xe208,0xef));var _0x8e20=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xe208[_0x243b2f];return _0xcb3c2d;};'use strict';var client=require(_0x8e20('0x0'));exports[_0x8e20('0x1')]=function(_0x15b477,_0x34ca25){return client[_0x8e20('0x2')](_0x8e20('0x3'),{'body':_0x34ca25,'options':{'where':{'id':_0x15b477}},'log':'updateChatInteraction'});};exports[_0x8e20('0x4')]=function(_0x2f9c42,_0x2b78b8){return client[_0x8e20('0x2')](_0x8e20('0x5'),{'body':_0x2b78b8,'options':{'where':{'id':_0x2f9c42}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index e418388..b8041ea 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 _0xbf60=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x1a8156,_0x4d8a37){var _0x2654c6=function(_0x131cfd){while(--_0x131cfd){_0x1a8156['push'](_0x1a8156['shift']());}};_0x2654c6(++_0x4d8a37);}(_0xbf60,0x1f0));var _0x0bf6=function(_0x40d078,_0x210a77){_0x40d078=_0x40d078-0x0;var _0x46fc81=_0xbf60[_0x40d078];return _0x46fc81;};'use strict';var client=require(_0x0bf6('0x0'));exports[_0x0bf6('0x1')]=function(_0x52a161){return client[_0x0bf6('0x2')](_0x0bf6('0x3'),{'body':_0x52a161,'log':_0x0bf6('0x4')});}; \ No newline at end of file +var _0x6513=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x46939d,_0xc1b36d){var _0x5105e8=function(_0x536281){while(--_0x536281){_0x46939d['push'](_0x46939d['shift']());}};_0x5105e8(++_0xc1b36d);}(_0x6513,0x95));var _0x3651=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x6513[_0x4eb6ec];return _0x58881b;};'use strict';var client=require(_0x3651('0x0'));exports[_0x3651('0x1')]=function(_0x53030f){return client[_0x3651('0x2')](_0x3651('0x3'),{'body':_0x53030f,'log':_0x3651('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 44e5bc0..841ec48 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 _0xcd28=['online','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','Agents'];(function(_0x28ac84,_0x2a75fa){var _0x10c42a=function(_0x90b045){while(--_0x90b045){_0x28ac84['push'](_0x28ac84['shift']());}};_0x10c42a(++_0x2a75fa);}(_0xcd28,0xd0));var _0x8cd2=function(_0x554b23,_0x5e9061){_0x554b23=_0x554b23-0x0;var _0xcc29ea=_0xcd28[_0x554b23];return _0xcc29ea;};'use strict';var client=require(_0x8cd2('0x0'));exports[_0x8cd2('0x1')]=function(){return function(){return client[_0x8cd2('0x2')](_0x8cd2('0x3'),{'options':{'raw':![],'attributes':['id',_0x8cd2('0x4'),_0x8cd2('0x5'),_0x8cd2('0x6')],'include':[{'model':'User','as':_0x8cd2('0x7'),'attributes':['id',_0x8cd2('0x4'),_0x8cd2('0x8'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x2699=['Request','name','strategy','User','Agents','online','chatPause','getChatQueues'];(function(_0x4cbb8e,_0x1047c8){var _0x17846f=function(_0x29e1e0){while(--_0x29e1e0){_0x4cbb8e['push'](_0x4cbb8e['shift']());}};_0x17846f(++_0x1047c8);}(_0x2699,0x1c0));var _0x9269=function(_0x1d73ab,_0x4db32c){_0x1d73ab=_0x1d73ab-0x0;var _0x2ed1df=_0x2699[_0x1d73ab];return _0x2ed1df;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x9269('0x0')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x9269('0x1'),'timeout',_0x9269('0x2')],'include':[{'model':_0x9269('0x3'),'as':_0x9269('0x4'),'attributes':['id',_0x9269('0x1'),_0x9269('0x5'),_0x9269('0x6')]}]},'log':_0x9269('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index e38269f..6f0f7a0 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 _0x3561=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','Request'];(function(_0x4f03e4,_0x5d7518){var _0x667efb=function(_0x2f7d37){while(--_0x2f7d37){_0x4f03e4['push'](_0x4f03e4['shift']());}};_0x667efb(++_0x5d7518);}(_0x3561,0x94));var _0x1356=function(_0x40296d,_0x36aee7){_0x40296d=_0x40296d-0x0;var _0x5717a6=_0x3561[_0x40296d];return _0x5717a6;};'use strict';var client=require(_0x1356('0x0'));exports['create']=function(_0x1cc9d7){return client[_0x1356('0x1')](_0x1356('0x2'),{'body':_0x1cc9d7,'log':_0x1356('0x2')});};exports[_0x1356('0x3')]=function(_0x313999,_0x1634de){return client[_0x1356('0x1')](_0x1356('0x4'),{'body':_0x1634de,'options':{'where':{'uniqueid':_0x313999},'order':[['id',_0x1356('0x5')]],'limit':0x1},'log':_0x1356('0x4')});}; \ No newline at end of file +var _0x01fe=['update','DESC','../client','Request'];(function(_0x344e95,_0x55b113){var _0x2761b4=function(_0x1b0f49){while(--_0x1b0f49){_0x344e95['push'](_0x344e95['shift']());}};_0x2761b4(++_0x55b113);}(_0x01fe,0x102));var _0xe01f=function(_0x140ab3,_0x2f8e25){_0x140ab3=_0x140ab3-0x0;var _0x2b6923=_0x01fe[_0x140ab3];return _0x2b6923;};'use strict';var client=require(_0xe01f('0x0'));exports['create']=function(_0x3ba50c){return client[_0xe01f('0x1')]('CreateChatQueueReport',{'body':_0x3ba50c,'log':'CreateChatQueueReport'});};exports[_0xe01f('0x2')]=function(_0x1212f6,_0x9505fa){return client[_0xe01f('0x1')]('UpdateChatQueueReport',{'body':_0x9505fa,'options':{'where':{'uniqueid':_0x1212f6},'order':[['id',_0xe01f('0x3')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index a4b349c..3303854 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 _0x95e3=['update','Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x95e3,0x167));var _0x395e=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x95e3[_0x4d613c];return _0x301fe3;};'use strict';var client=require(_0x395e('0x0'));exports[_0x395e('0x1')]=function(_0x13010a,_0x328cbc){return client[_0x395e('0x2')]('UpdateFaxInteraction',{'body':_0x328cbc,'options':{'where':{'id':_0x13010a}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x551d41,_0x39f06f){return client['Request'](_0x395e('0x3'),{'body':_0x39f06f,'options':{'where':{'id':_0x551d41}},'log':_0x395e('0x4')});}; \ No newline at end of file +var _0x998f=['Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x998f,0x1ce));var _0xf998=function(_0x697338,_0x3322fb){_0x697338=_0x697338-0x0;var _0x4ded69=_0x998f[_0x697338];return _0x4ded69;};'use strict';var client=require(_0xf998('0x0'));exports[_0xf998('0x1')]=function(_0x30d5e0,_0x9f2f16){return client[_0xf998('0x2')](_0xf998('0x3'),{'body':_0x9f2f16,'options':{'where':{'id':_0x30d5e0}},'log':_0xf998('0x4')});};exports[_0xf998('0x5')]=function(_0x366eb5,_0x54451c){return client[_0xf998('0x2')](_0xf998('0x6'),{'body':_0x54451c,'options':{'where':{'id':_0x366eb5}},'log':_0xf998('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4a8e6f7..f455bb1 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 _0x5d5d=['createFaxMessage','../client','create','Request'];(function(_0x924c29,_0x309120){var _0x24ddd6=function(_0x1c8a9e){while(--_0x1c8a9e){_0x924c29['push'](_0x924c29['shift']());}};_0x24ddd6(++_0x309120);}(_0x5d5d,0x19d));var _0xd5d5=function(_0x4596ab,_0x5e8b46){_0x4596ab=_0x4596ab-0x0;var _0xd99147=_0x5d5d[_0x4596ab];return _0xd99147;};'use strict';var client=require(_0xd5d5('0x0'));exports[_0xd5d5('0x1')]=function(_0xa3cd75){return client[_0xd5d5('0x2')]('CreateFaxMessage',{'body':_0xa3cd75,'log':_0xd5d5('0x3')});}; \ No newline at end of file +var _0xb3dd=['create'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb3dd,0x1cf));var _0xdb3d=function(_0x14dcd9,_0x3db277){_0x14dcd9=_0x14dcd9-0x0;var _0xb98a41=_0xb3dd[_0x14dcd9];return _0xb98a41;};'use strict';var client=require('../client');exports[_0xdb3d('0x0')]=function(_0x1c169a){return client['Request']('CreateFaxMessage',{'body':_0x1c169a,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index cd96b25..6c7d0c4 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 _0x4f75=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online'];(function(_0x53feda,_0x8d5d13){var _0x2c0b4f=function(_0xc82721){while(--_0xc82721){_0x53feda['push'](_0x53feda['shift']());}};_0x2c0b4f(++_0x8d5d13);}(_0x4f75,0x7a));var _0x54f7=function(_0x2c22d7,_0x40687d){_0x2c22d7=_0x2c22d7-0x0;var _0x47d408=_0x4f75[_0x2c22d7];return _0x47d408;};'use strict';var client=require(_0x54f7('0x0'));exports[_0x54f7('0x1')]=function(){return function(){return client[_0x54f7('0x2')](_0x54f7('0x3'),{'options':{'raw':![],'attributes':['id',_0x54f7('0x4'),_0x54f7('0x5'),_0x54f7('0x6')],'include':[{'model':_0x54f7('0x7'),'as':_0x54f7('0x8'),'attributes':['id',_0x54f7('0x4'),_0x54f7('0x9'),_0x54f7('0xa')]}]},'log':_0x54f7('0x1')});};}; \ No newline at end of file +var _0x0e53=['faxPause','getFaxQueues','Request','name','timeout','strategy','User','Agents','online'];(function(_0xe7f5de,_0x1d32dc){var _0x2412ea=function(_0x37e8f7){while(--_0x37e8f7){_0xe7f5de['push'](_0xe7f5de['shift']());}};_0x2412ea(++_0x1d32dc);}(_0x0e53,0x1cc));var _0x30e5=function(_0x53cfcc,_0x39e3e2){_0x53cfcc=_0x53cfcc-0x0;var _0x4f72cc=_0x0e53[_0x53cfcc];return _0x4f72cc;};'use strict';var client=require('../client');exports[_0x30e5('0x0')]=function(){return function(){return client[_0x30e5('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x30e5('0x2'),_0x30e5('0x3'),_0x30e5('0x4')],'include':[{'model':_0x30e5('0x5'),'as':_0x30e5('0x6'),'attributes':['id',_0x30e5('0x2'),_0x30e5('0x7'),_0x30e5('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 2e74600..ce9ba03 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 _0xe105=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x3a569c,_0x2cd8e9){var _0x52cf0b=function(_0x3a3359){while(--_0x3a3359){_0x3a569c['push'](_0x3a569c['shift']());}};_0x52cf0b(++_0x2cd8e9);}(_0xe105,0xef));var _0x5e10=function(_0x28e8ba,_0x143ac6){_0x28e8ba=_0x28e8ba-0x0;var _0x281922=_0xe105[_0x28e8ba];return _0x281922;};'use strict';var client=require(_0x5e10('0x0'));exports['create']=function(_0x4d5a73){return client['Request']('CreateFaxQueueReport',{'body':_0x4d5a73,'log':_0x5e10('0x1')});};exports[_0x5e10('0x2')]=function(_0x1cddb3,_0x191ab2){return client['Request'](_0x5e10('0x3'),{'body':_0x191ab2,'options':{'where':{'uniqueid':_0x1cddb3},'order':[['id',_0x5e10('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x326f=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x34e1f1,_0x4acdae){var _0x170b1e=function(_0x1357a9){while(--_0x1357a9){_0x34e1f1['push'](_0x34e1f1['shift']());}};_0x170b1e(++_0x4acdae);}(_0x326f,0xd1));var _0xf326=function(_0x510673,_0x56b622){_0x510673=_0x510673-0x0;var _0x2c261c=_0x326f[_0x510673];return _0x2c261c;};'use strict';var client=require(_0xf326('0x0'));exports['create']=function(_0x5452cc){return client[_0xf326('0x1')](_0xf326('0x2'),{'body':_0x5452cc,'log':_0xf326('0x2')});};exports[_0xf326('0x3')]=function(_0x27e8d7,_0x120a26){return client[_0xf326('0x1')](_0xf326('0x4'),{'body':_0x120a26,'options':{'where':{'uniqueid':_0x27e8d7},'order':[['id',_0xf326('0x5')]],'limit':0x1},'log':_0xf326('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a43ef4e..8d891c6 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 _0x9e6b=['name','interval','../client','getIntervals','GetInterval','Intervals'];(function(_0x400da5,_0x2c3898){var _0x8ccc41=function(_0x9bf977){while(--_0x9bf977){_0x400da5['push'](_0x400da5['shift']());}};_0x8ccc41(++_0x2c3898);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9e6b[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0xb9e6('0x0'));exports[_0xb9e6('0x1')]=function(){return function(){return client['Request'](_0xb9e6('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0xb9e6('0x3'),'attributes':['id',_0xb9e6('0x4'),_0xb9e6('0x5')]}]},'log':_0xb9e6('0x1')});};}; \ No newline at end of file +var _0xe493=['../client','getIntervals','Request','GetInterval','name','Intervals'];(function(_0x40a93e,_0x445c2b){var _0x354900=function(_0x2b90be){while(--_0x2b90be){_0x40a93e['push'](_0x40a93e['shift']());}};_0x354900(++_0x445c2b);}(_0xe493,0x7e));var _0x3e49=function(_0x4c11b2,_0x26de9a){_0x4c11b2=_0x4c11b2-0x0;var _0x84eca1=_0xe493[_0x4c11b2];return _0x84eca1;};'use strict';var client=require(_0x3e49('0x0'));exports[_0x3e49('0x1')]=function(){return function(){return client[_0x3e49('0x2')](_0x3e49('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3e49('0x4')],'include':[{'model':'Interval','as':_0x3e49('0x5'),'attributes':['id',_0x3e49('0x4'),'interval']}]},'log':_0x3e49('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index d3ae74f..3ebd620 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 _0x48be=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x48be,0x97));var _0xe48b=function(_0x5b9051,_0x15e0e8){_0x5b9051=_0x5b9051-0x0;var _0xc659ee=_0x48be[_0x5b9051];return _0xc659ee;};'use strict';var client=require('../client');exports[_0xe48b('0x0')]=function(_0x5274e4,_0x427586){return client[_0xe48b('0x1')](_0xe48b('0x2'),{'body':_0x427586,'options':{'where':{'id':_0x5274e4}},'log':_0xe48b('0x3')});};exports[_0xe48b('0x4')]=function(_0x5d0dca,_0x3d6b82){return client[_0xe48b('0x1')](_0xe48b('0x5'),{'body':_0x3d6b82,'options':{'where':{'id':_0x5d0dca}},'log':_0xe48b('0x6')});}; \ No newline at end of file +var _0x1844=['update','Request','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1844,0x16d));var _0x4184=function(_0x286b2b,_0x1188e1){_0x286b2b=_0x286b2b-0x0;var _0x20222e=_0x1844[_0x286b2b];return _0x20222e;};'use strict';var client=require(_0x4184('0x0'));exports[_0x4184('0x1')]=function(_0x469cd4,_0xea659c){return client[_0x4184('0x2')]('UpdateMailInteraction',{'body':_0xea659c,'options':{'where':{'id':_0x469cd4}},'log':_0x4184('0x3')});};exports[_0x4184('0x4')]=function(_0xada69d,_0x16530e){return client[_0x4184('0x2')]('AddTagsToMailInteraction',{'body':_0x16530e,'options':{'where':{'id':_0xada69d}},'log':_0x4184('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index bea1471..0582923 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 _0x8122=['Request','CreateMailMessage','create'];(function(_0x298b9c,_0x11aca0){var _0x4b6472=function(_0xfd7b2e){while(--_0xfd7b2e){_0x298b9c['push'](_0x298b9c['shift']());}};_0x4b6472(++_0x11aca0);}(_0x8122,0x7a));var _0x2812=function(_0x5a9d13,_0x5843ac){_0x5a9d13=_0x5a9d13-0x0;var _0x485fa4=_0x8122[_0x5a9d13];return _0x485fa4;};'use strict';var client=require('../client');exports[_0x2812('0x0')]=function(_0x16a7f9){return client[_0x2812('0x1')](_0x2812('0x2'),{'body':_0x16a7f9,'log':'createMailMessage'});}; \ No newline at end of file +var _0xcdb7=['createMailMessage','create','CreateMailMessage'];(function(_0xab2a11,_0x1b34fb){var _0x5421cc=function(_0x179064){while(--_0x179064){_0xab2a11['push'](_0xab2a11['shift']());}};_0x5421cc(++_0x1b34fb);}(_0xcdb7,0x7c));var _0x7cdb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcdb7[_0x432682];return _0x463d05;};'use strict';var client=require('../client');exports[_0x7cdb('0x0')]=function(_0x431451){return client['Request'](_0x7cdb('0x1'),{'body':_0x431451,'log':_0x7cdb('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c508d56..d391837 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 _0xdb85=['online','../client','getMailQueues','Request','GetMailQueue','timeout','strategy','name'];(function(_0x51b52e,_0x3c2506){var _0x59a011=function(_0x397663){while(--_0x397663){_0x51b52e['push'](_0x51b52e['shift']());}};_0x59a011(++_0x3c2506);}(_0xdb85,0x99));var _0x5db8=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0xdb85[_0x55d7c2];return _0x1755ef;};'use strict';var client=require(_0x5db8('0x0'));exports[_0x5db8('0x1')]=function(){return function(){return client[_0x5db8('0x2')](_0x5db8('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x5db8('0x4'),_0x5db8('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x5db8('0x6'),_0x5db8('0x7'),'mailPause']}]},'log':_0x5db8('0x1')});};}; \ No newline at end of file +var _0x382f=['getMailQueues','GetMailQueue','name','timeout','User','Agents','online','mailPause','../client'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x382f,0x128));var _0xf382=function(_0x4e0066,_0x590ab0){_0x4e0066=_0x4e0066-0x0;var _0x14f6ce=_0x382f[_0x4e0066];return _0x14f6ce;};'use strict';var client=require(_0xf382('0x0'));exports[_0xf382('0x1')]=function(){return function(){return client['Request'](_0xf382('0x2'),{'options':{'raw':![],'attributes':['id',_0xf382('0x3'),_0xf382('0x4'),'strategy'],'include':[{'model':_0xf382('0x5'),'as':_0xf382('0x6'),'attributes':['id',_0xf382('0x3'),_0xf382('0x7'),_0xf382('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 78381fd..8f0e21b 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 _0x28c0=['UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x1fe042,_0x265dfb){var _0x2469e3=function(_0x383a18){while(--_0x383a18){_0x1fe042['push'](_0x1fe042['shift']());}};_0x2469e3(++_0x265dfb);}(_0x28c0,0x16f));var _0x028c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x28c0[_0x19950b];return _0x3c6b41;};'use strict';var client=require('../client');exports[_0x028c('0x0')]=function(_0x231cd6){return client[_0x028c('0x1')]('CreateMailQueueReport',{'body':_0x231cd6,'log':_0x028c('0x2')});};exports['update']=function(_0x42f6f3,_0x4a2820){return client[_0x028c('0x1')](_0x028c('0x3'),{'body':_0x4a2820,'options':{'where':{'uniqueid':_0x42f6f3},'order':[['id',_0x028c('0x4')]],'limit':0x1},'log':_0x028c('0x3')});}; \ No newline at end of file +var _0x9958=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x33055e,_0x54dff9){var _0x41dfb4=function(_0x5b4123){while(--_0x5b4123){_0x33055e['push'](_0x33055e['shift']());}};_0x41dfb4(++_0x54dff9);}(_0x9958,0x1e8));var _0x8995=function(_0x6ef920,_0x5f4a9d){_0x6ef920=_0x6ef920-0x0;var _0x2b5d09=_0x9958[_0x6ef920];return _0x2b5d09;};'use strict';var client=require(_0x8995('0x0'));exports[_0x8995('0x1')]=function(_0xe61e81){return client[_0x8995('0x2')](_0x8995('0x3'),{'body':_0xe61e81,'log':_0x8995('0x3')});};exports[_0x8995('0x4')]=function(_0xb6fe32,_0x37b7f4){return client['Request'](_0x8995('0x5'),{'body':_0x37b7f4,'options':{'where':{'uniqueid':_0xb6fe32},'order':[['id',_0x8995('0x6')]],'limit':0x1},'log':_0x8995('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index c0b7055..00ab471 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 _0x8b2f=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x270d75,_0x179bf2){var _0x2e3201=function(_0x46d017){while(--_0x46d017){_0x270d75['push'](_0x270d75['shift']());}};_0x2e3201(++_0x179bf2);}(_0x8b2f,0x12f));var _0xf8b2=function(_0x2af33d,_0x363902){_0x2af33d=_0x2af33d-0x0;var _0x3a839d=_0x8b2f[_0x2af33d];return _0x3a839d;};'use strict';var client=require(_0xf8b2('0x0'));exports[_0xf8b2('0x1')]=function(_0x2986f9,_0x18fd09){return client[_0xf8b2('0x2')]('UpdateOpenchannelInteraction',{'body':_0x18fd09,'options':{'where':{'id':_0x2986f9}},'log':'updateOpenchannelInteraction'});};exports[_0xf8b2('0x3')]=function(_0x37c603,_0x29d8ae){return client['Request'](_0xf8b2('0x4'),{'body':_0x29d8ae,'options':{'where':{'id':_0x37c603}},'log':_0xf8b2('0x5')});}; \ No newline at end of file +var _0x3286=['addTagsToChatInteraction','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x440582,_0x33b825){var _0x53721e=function(_0x528d76){while(--_0x528d76){_0x440582['push'](_0x440582['shift']());}};_0x53721e(++_0x33b825);}(_0x3286,0x15d));var _0x6328=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3286[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['update']=function(_0x191273,_0x4eef22){return client[_0x6328('0x0')](_0x6328('0x1'),{'body':_0x4eef22,'options':{'where':{'id':_0x191273}},'log':'updateOpenchannelInteraction'});};exports[_0x6328('0x2')]=function(_0x4a72be,_0xeec03b){return client[_0x6328('0x0')]('AddTagsToOpenchannelInteraction',{'body':_0xeec03b,'options':{'where':{'id':_0x4a72be}},'log':_0x6328('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 510a071..a3397f8 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 _0xbec5=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x3c8599,_0x419f6d){var _0x4a0440=function(_0x3ff985){while(--_0x3ff985){_0x3c8599['push'](_0x3c8599['shift']());}};_0x4a0440(++_0x419f6d);}(_0xbec5,0xe5));var _0x5bec=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xbec5[_0x383dbb];return _0x6e8bde;};'use strict';var client=require(_0x5bec('0x0'));exports[_0x5bec('0x1')]=function(_0x4cfc3b){return client[_0x5bec('0x2')](_0x5bec('0x3'),{'body':_0x4cfc3b,'log':_0x5bec('0x4')});}; \ No newline at end of file +var _0xf3cd=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5a2de2,_0x21a358){var _0x39e12a=function(_0x65997d){while(--_0x65997d){_0x5a2de2['push'](_0x5a2de2['shift']());}};_0x39e12a(++_0x21a358);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x33ceeb,_0x58b863){_0x33ceeb=_0x33ceeb-0x0;var _0x5b6556=_0xf3cd[_0x33ceeb];return _0x5b6556;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'body':_0x31e5a5,'log':_0xdf3c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d3d7c9c..846bc65 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 _0x911c=['name','timeout','online','getOpenchannelQueues','../client'];(function(_0x58ae9f,_0xcaa7d7){var _0x4c966d=function(_0x401fbe){while(--_0x401fbe){_0x58ae9f['push'](_0x58ae9f['shift']());}};_0x4c966d(++_0xcaa7d7);}(_0x911c,0x15d));var _0xc911=function(_0x13ec2b,_0x40b664){_0x13ec2b=_0x13ec2b-0x0;var _0x1fb3f4=_0x911c[_0x13ec2b];return _0x1fb3f4;};'use strict';var client=require(_0xc911('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xc911('0x1'),_0xc911('0x2'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xc911('0x1'),_0xc911('0x3'),'openchannelPause']}]},'log':_0xc911('0x4')});};}; \ No newline at end of file +var _0xfe32=['timeout','strategy','User','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x26e63f,_0xb68ef6){var _0x2c7cdb=function(_0x1e77e6){while(--_0x1e77e6){_0x26e63f['push'](_0x26e63f['shift']());}};_0x2c7cdb(++_0xb68ef6);}(_0xfe32,0x64));var _0x2fe3=function(_0x59c472,_0x338746){_0x59c472=_0x59c472-0x0;var _0x210cf9=_0xfe32[_0x59c472];return _0x210cf9;};'use strict';var client=require(_0x2fe3('0x0'));exports[_0x2fe3('0x1')]=function(){return function(){return client[_0x2fe3('0x2')](_0x2fe3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2fe3('0x4'),_0x2fe3('0x5')],'include':[{'model':_0x2fe3('0x6'),'as':'Agents','attributes':['id','name','online',_0x2fe3('0x7')]}]},'log':_0x2fe3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 150d232..6de5ce2 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 _0x0e5d=['update','DESC','UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport'];(function(_0x343f21,_0x4aeb32){var _0x575b78=function(_0x18b88f){while(--_0x18b88f){_0x343f21['push'](_0x343f21['shift']());}};_0x575b78(++_0x4aeb32);}(_0x0e5d,0xed));var _0xd0e5=function(_0x38c525,_0xd8f667){_0x38c525=_0x38c525-0x0;var _0x114087=_0x0e5d[_0x38c525];return _0x114087;};'use strict';var client=require(_0xd0e5('0x0'));exports['create']=function(_0x5ef281){return client[_0xd0e5('0x1')](_0xd0e5('0x2'),{'body':_0x5ef281,'log':_0xd0e5('0x2')});};exports[_0xd0e5('0x3')]=function(_0x27df0f,_0x4875ce){return client[_0xd0e5('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x4875ce,'options':{'where':{'uniqueid':_0x27df0f},'order':[['id',_0xd0e5('0x4')]],'limit':0x1},'log':_0xd0e5('0x5')});}; \ No newline at end of file +var _0x65fa=['UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x50a8f0,_0x50cd13){var _0x4c2675=function(_0x4784d8){while(--_0x4784d8){_0x50a8f0['push'](_0x50a8f0['shift']());}};_0x4c2675(++_0x50cd13);}(_0x65fa,0x1dc));var _0xa65f=function(_0x55d1f2,_0x57436e){_0x55d1f2=_0x55d1f2-0x0;var _0x534c00=_0x65fa[_0x55d1f2];return _0x534c00;};'use strict';var client=require(_0xa65f('0x0'));exports[_0xa65f('0x1')]=function(_0x49ffb3){return client[_0xa65f('0x2')](_0xa65f('0x3'),{'body':_0x49ffb3,'log':_0xa65f('0x3')});};exports['update']=function(_0x11161c,_0x4b1275){return client[_0xa65f('0x2')](_0xa65f('0x4'),{'body':_0x4b1275,'options':{'where':{'uniqueid':_0x11161c},'order':[['id','DESC']],'limit':0x1},'log':_0xa65f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7161490..57530e0 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 _0x4e30=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction'];(function(_0x356971,_0x17c38a){var _0x36e0a2=function(_0x4c336a){while(--_0x4c336a){_0x356971['push'](_0x356971['shift']());}};_0x36e0a2(++_0x17c38a);}(_0x4e30,0xf3));var _0x04e3=function(_0x376620,_0x485039){_0x376620=_0x376620-0x0;var _0x5a01ea=_0x4e30[_0x376620];return _0x5a01ea;};'use strict';var client=require(_0x04e3('0x0'));exports[_0x04e3('0x1')]=function(_0x5aa73c,_0x133357){return client['Request'](_0x04e3('0x2'),{'body':_0x133357,'options':{'where':{'id':_0x5aa73c}},'log':_0x04e3('0x3')});};exports['addTags']=function(_0x1454c3,_0x181f5e){return client['Request'](_0x04e3('0x4'),{'body':_0x181f5e,'options':{'where':{'id':_0x1454c3}},'log':_0x04e3('0x5')});}; \ No newline at end of file +var _0x5893=['addTags','Request','addTagsToSmsInteraction','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x456919,_0x4c175d){var _0x41a512=function(_0x44c4dd){while(--_0x44c4dd){_0x456919['push'](_0x456919['shift']());}};_0x41a512(++_0x4c175d);}(_0x5893,0xf3));var _0x3589=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5893[_0x122ef9];return _0x42fba0;};'use strict';var client=require('../client');exports[_0x3589('0x0')]=function(_0x3f872a,_0x5d78aa){return client['Request'](_0x3589('0x1'),{'body':_0x5d78aa,'options':{'where':{'id':_0x3f872a}},'log':_0x3589('0x2')});};exports[_0x3589('0x3')]=function(_0x71591f,_0xd261a2){return client[_0x3589('0x4')]('AddTagsToSmsInteraction',{'body':_0xd261a2,'options':{'where':{'id':_0x71591f}},'log':_0x3589('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index e3b08d2..a8862d9 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 _0x5e37=['../client','create','Request','CreateSmsMessage'];(function(_0x2f6d16,_0x516c0c){var _0xf706a=function(_0x43dd25){while(--_0x43dd25){_0x2f6d16['push'](_0x2f6d16['shift']());}};_0xf706a(++_0x516c0c);}(_0x5e37,0xcc));var _0x75e3=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x5e37[_0x999b85];return _0x1d7124;};'use strict';var client=require(_0x75e3('0x0'));exports[_0x75e3('0x1')]=function(_0x19ac70){return client[_0x75e3('0x2')](_0x75e3('0x3'),{'body':_0x19ac70,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x1950=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x59b231,_0x35509b){var _0x356c9c=function(_0xacacc0){while(--_0xacacc0){_0x59b231['push'](_0x59b231['shift']());}};_0x356c9c(++_0x35509b);}(_0x1950,0x1bf));var _0x0195=function(_0x36156f,_0x4b1d70){_0x36156f=_0x36156f-0x0;var _0xb87604=_0x1950[_0x36156f];return _0xb87604;};'use strict';var client=require('../client');exports[_0x0195('0x0')]=function(_0x5bb427){return client[_0x0195('0x1')](_0x0195('0x2'),{'body':_0x5bb427,'log':_0x0195('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index a79a1f8..1e131e5 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 _0xdae4=['User','Agents','smsPause','../client','getSmsQueues','Request','GetSmsQueue','name','timeout','strategy'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0xdae4,0x71));var _0x4dae=function(_0xef6157,_0x477c99){_0xef6157=_0xef6157-0x0;var _0x10b399=_0xdae4[_0xef6157];return _0x10b399;};'use strict';var client=require(_0x4dae('0x0'));exports[_0x4dae('0x1')]=function(){return function(){return client[_0x4dae('0x2')](_0x4dae('0x3'),{'options':{'raw':![],'attributes':['id',_0x4dae('0x4'),_0x4dae('0x5'),_0x4dae('0x6')],'include':[{'model':_0x4dae('0x7'),'as':_0x4dae('0x8'),'attributes':['id',_0x4dae('0x4'),'online',_0x4dae('0x9')]}]},'log':_0x4dae('0x1')});};}; \ No newline at end of file +var _0x44f2=['Request','name','timeout','strategy','User','online','smsPause','../client','getSmsQueues'];(function(_0x37653c,_0x42c4f9){var _0x419900=function(_0xb19deb){while(--_0xb19deb){_0x37653c['push'](_0x37653c['shift']());}};_0x419900(++_0x42c4f9);}(_0x44f2,0xc4));var _0x244f=function(_0x45ce4e,_0x3a367c){_0x45ce4e=_0x45ce4e-0x0;var _0x4a105a=_0x44f2[_0x45ce4e];return _0x4a105a;};'use strict';var client=require(_0x244f('0x0'));exports[_0x244f('0x1')]=function(){return function(){return client[_0x244f('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x244f('0x3'),_0x244f('0x4'),_0x244f('0x5')],'include':[{'model':_0x244f('0x6'),'as':'Agents','attributes':['id',_0x244f('0x3'),_0x244f('0x7'),_0x244f('0x8')]}]},'log':_0x244f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index ac78238..e51354d 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 _0xf630=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport','update'];(function(_0x4a2737,_0x9fb518){var _0x4ff748=function(_0x217c02){while(--_0x217c02){_0x4a2737['push'](_0x4a2737['shift']());}};_0x4ff748(++_0x9fb518);}(_0xf630,0xf0));var _0x0f63=function(_0x1dee2e,_0x124408){_0x1dee2e=_0x1dee2e-0x0;var _0x4ce591=_0xf630[_0x1dee2e];return _0x4ce591;};'use strict';var client=require(_0x0f63('0x0'));exports[_0x0f63('0x1')]=function(_0x28a4cf){return client[_0x0f63('0x2')](_0x0f63('0x3'),{'body':_0x28a4cf,'log':_0x0f63('0x3')});};exports[_0x0f63('0x4')]=function(_0x150e86,_0x306b0e){return client[_0x0f63('0x2')](_0x0f63('0x5'),{'body':_0x306b0e,'options':{'where':{'uniqueid':_0x150e86},'order':[['id',_0x0f63('0x6')]],'limit':0x1},'log':_0x0f63('0x5')});}; \ No newline at end of file +var _0x123d=['CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x1decc4,_0x29b887){var _0xf3bd3f=function(_0x1ca7d8){while(--_0x1ca7d8){_0x1decc4['push'](_0x1decc4['shift']());}};_0xf3bd3f(++_0x29b887);}(_0x123d,0x187));var _0xd123=function(_0x2103e6,_0x4c8968){_0x2103e6=_0x2103e6-0x0;var _0x199de5=_0x123d[_0x2103e6];return _0x199de5;};'use strict';var client=require(_0xd123('0x0'));exports['create']=function(_0x13be24){return client['Request'](_0xd123('0x1'),{'body':_0x13be24,'log':_0xd123('0x1')});};exports[_0xd123('0x2')]=function(_0x3c8082,_0x23dc76){return client['Request']('UpdateSmsQueueReport',{'body':_0x23dc76,'options':{'where':{'uniqueid':_0x3c8082},'order':[['id','DESC']],'limit':0x1},'log':_0xd123('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e2fd7f9..af6a8ea 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 _0x9963=['faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','agent','online','pauseType','lastPauseAt','voicePause','chatPause','mailPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9963,0xc3));var _0x3996=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0x9963[_0x422be2];return _0x1b820e;};'use strict';var client=require(_0x3996('0x0'));exports[_0x3996('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x3996('0x2')},'attributes':['id','name',_0x3996('0x3'),_0x3996('0x4'),_0x3996('0x5'),_0x3996('0x6'),_0x3996('0x7'),_0x3996('0x8'),_0x3996('0x9'),_0x3996('0xa'),_0x3996('0xb'),_0x3996('0xc'),_0x3996('0xd'),_0x3996('0xe'),_0x3996('0xf'),_0x3996('0x10')]},'log':_0x3996('0x1')});};}; \ No newline at end of file +var _0x7499=['chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','../client','GetUser','name','online','pauseType','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x7499,0x16b));var _0x9749=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x7499[_0x5ce15c];return _0x36e4f5;};'use strict';var client=require(_0x9749('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0x9749('0x1'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x9749('0x2'),_0x9749('0x3'),_0x9749('0x4'),'lastPauseAt',_0x9749('0x5'),_0x9749('0x6'),_0x9749('0x7'),_0x9749('0x8'),_0x9749('0x9'),_0x9749('0xa'),_0x9749('0xb'),_0x9749('0xc'),_0x9749('0xd'),_0x9749('0xe'),_0x9749('0xf')]},'log':_0x9749('0x10')});};}; \ 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 3a74c53..73a82c1 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 _0x2ac7=['end','close','info','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','message','join','agents','timeout','createQueue','atimeout','channel','START:%s','rules'];(function(_0x3b5f44,_0x8dbbb6){var _0x121695=function(_0xa1c59b){while(--_0xa1c59b){_0x3b5f44['push'](_0x3b5f44['shift']());}};_0x121695(++_0x8dbbb6);}(_0x2ac7,0x101));var _0x72ac=function(_0x279f7a,_0x158fce){_0x279f7a=_0x279f7a-0x0;var _0x3b2cbe=_0x2ac7[_0x279f7a];return _0x3b2cbe;};'use strict';var schema=require(_0x72ac('0x0'));var _=require('lodash');var util=require(_0x72ac('0x1'));var seqqueue=require(_0x72ac('0x2'));var logger=require(_0x72ac('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0x72ac('0x4'),'required':!![],'message':_0x72ac('0x5')},'timeout':{'type':'number','message':_0x72ac('0x6')}});function writeLog(_0x3a9ed4,_0x8dd0af,_0x1f991c){return logger['info'](util[_0x72ac('0x7')](_0x72ac('0x8'),_0x3a9ed4,_0x8dd0af[_0x72ac('0x9')],_0x1f991c));}function handleFindAgent(_0x3dc1bf){return function(_0x32eea6){return _0x32eea6[_0x72ac('0x9')][_0x72ac('0xa')]()===_0x3dc1bf[_0x72ac('0xa')]();};}exports[_0x72ac('0xb')]=function(_0x136c1a,_0x3af9e4,_0xaabdd2,_0x5710b6){return function(_0x4270a9){try{var _0x16be74={'name':_0x3af9e4[0x0],'timeout':_0x3af9e4[0x1]};var _0x3b3b88=queue[_0x72ac('0x0')](_0x16be74,{'typecast':!![]});if(_0x3b3b88[_0x72ac('0xc')]){logger['error'](_0x72ac('0xd'),_0x136c1a,_['map'](_0x3b3b88,_0x72ac('0xe'))[_0x72ac('0xf')](',\x20'));_0x4270a9['stop']();}else{var _0x303f4b=_['find'](_0xaabdd2[_0x72ac('0x10')],handleFindAgent(_0x16be74[_0x72ac('0x9')]));if(_0x303f4b){var _0x20f4ff=(_0x16be74[_0x72ac('0x11')]||0xa)*0x3e8;var _0x460266,_0x39203c;var _0x5d81bd=seqqueue[_0x72ac('0x12')](_0x20f4ff);_0x5d81bd['id']=_0x136c1a;_0x5d81bd[_0x72ac('0x13')]=_0x20f4ff;_0x5d81bd[_0x72ac('0x14')]=_0x5710b6[_0x72ac('0x14')];writeLog(_0x136c1a,_0x303f4b,util[_0x72ac('0x7')](_0x72ac('0x15'),_0x20f4ff));_0xaabdd2[_0x72ac('0x16')][_0x136c1a]['on'](_0x72ac('0x17'),function(){_0x5d81bd[_0x72ac('0x18')]();clearTimeout(_0x39203c);_0x39203c=undefined;if(_0xaabdd2[_0x72ac('0x16')][_0x136c1a]){delete _0xaabdd2[_0x72ac('0x16')][_0x136c1a];}logger[_0x72ac('0x19')](_0x72ac('0x1a'),_0x136c1a);_0x4270a9[_0x72ac('0x1b')]();});_0x39203c=setTimeout(function(){clearTimeout(_0x39203c);_0x5d81bd[_0x72ac('0x18')]();logger[_0x72ac('0x19')](_0x72ac('0x1c'),_0x136c1a);_0x4270a9[_0x72ac('0x1d')]();},_0x20f4ff);strategy[_0x72ac('0x1e')](_0x5d81bd,_0x303f4b,_0xaabdd2,_0x5710b6);}else{logger[_0x72ac('0x1f')](_0x72ac('0x20'),_0x136c1a,_0x16be74['name']);_0x4270a9[_0x72ac('0x1b')]();}}}catch(_0x31c258){console['log'](_0x31c258);logger[_0x72ac('0x1f')](_0x72ac('0x21'),_0x136c1a,_0x31c258[_0x72ac('0x22')]);_0x4270a9[_0x72ac('0x1b')]();}};}; \ No newline at end of file +var _0x6ead=['map','message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s'];(function(_0x18637b,_0x3faf18){var _0x10720c=function(_0x40eaed){while(--_0x40eaed){_0x18637b['push'](_0x18637b['shift']());}};_0x10720c(++_0x3faf18);}(_0x6ead,0x16b));var _0xd6ea=function(_0x72a226,_0x1ec70c){_0x72a226=_0x72a226-0x0;var _0x2250e8=_0x6ead[_0x72a226];return _0x2250e8;};'use strict';var schema=require(_0xd6ea('0x0'));var _=require(_0xd6ea('0x1'));var util=require(_0xd6ea('0x2'));var seqqueue=require(_0xd6ea('0x3'));var logger=require(_0xd6ea('0x4'))('routing');var strategy=require(_0xd6ea('0x5'));var queue=schema({'name':{'type':_0xd6ea('0x6'),'required':!![],'message':_0xd6ea('0x7')},'timeout':{'type':_0xd6ea('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x15215c,_0x5e9c8c,_0x5abbee){return logger[_0xd6ea('0x9')](util[_0xd6ea('0xa')](_0xd6ea('0xb'),_0x15215c,_0x5e9c8c['name'],_0x5abbee));}function handleFindAgent(_0xb9df59){return function(_0x336756){return _0x336756[_0xd6ea('0xc')][_0xd6ea('0xd')]()===_0xb9df59[_0xd6ea('0xd')]();};}exports[_0xd6ea('0xe')]=function(_0x1557ce,_0x332636,_0x250dea,_0x24096a){return function(_0x3e4e93){try{var _0x1e26d4={'name':_0x332636[0x0],'timeout':_0x332636[0x1]};var _0xa077fe=queue[_0xd6ea('0x0')](_0x1e26d4,{'typecast':!![]});if(_0xa077fe[_0xd6ea('0xf')]){logger['error'](_0xd6ea('0x10'),_0x1557ce,_[_0xd6ea('0x11')](_0xa077fe,_0xd6ea('0x12'))[_0xd6ea('0x13')](',\x20'));_0x3e4e93['stop']();}else{var _0x10dee8=_[_0xd6ea('0x14')](_0x250dea[_0xd6ea('0x15')],handleFindAgent(_0x1e26d4['name']));if(_0x10dee8){var _0x45819f=(_0x1e26d4[_0xd6ea('0x16')]||0xa)*0x3e8;var _0x43c191,_0x5bafac;var _0x5c8694=seqqueue[_0xd6ea('0x17')](_0x45819f);_0x5c8694['id']=_0x1557ce;_0x5c8694[_0xd6ea('0x18')]=_0x45819f;_0x5c8694[_0xd6ea('0x19')]=_0x24096a[_0xd6ea('0x19')];writeLog(_0x1557ce,_0x10dee8,util[_0xd6ea('0xa')](_0xd6ea('0x1a'),_0x45819f));_0x250dea[_0xd6ea('0x1b')][_0x1557ce]['on'](_0xd6ea('0x1c'),function(){_0x5c8694[_0xd6ea('0x1d')]();clearTimeout(_0x5bafac);_0x5bafac=undefined;if(_0x250dea[_0xd6ea('0x1b')][_0x1557ce]){delete _0x250dea[_0xd6ea('0x1b')][_0x1557ce];}logger[_0xd6ea('0x9')](_0xd6ea('0x1e'),_0x1557ce);_0x3e4e93[_0xd6ea('0x1f')]();});_0x5bafac=setTimeout(function(){clearTimeout(_0x5bafac);_0x5c8694[_0xd6ea('0x1d')]();logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x1557ce);_0x3e4e93[_0xd6ea('0x20')]();},_0x45819f);strategy[_0xd6ea('0x21')](_0x5c8694,_0x10dee8,_0x250dea,_0x24096a);}else{logger[_0xd6ea('0x22')](_0xd6ea('0x23'),_0x1557ce,_0x1e26d4[_0xd6ea('0xc')]);_0x3e4e93[_0xd6ea('0x1f')]();}}}catch(_0x32d6a3){console[_0xd6ea('0x24')](_0x32d6a3);logger[_0xd6ea('0x22')]('[%s][QUEUE]\x20%s',_0x1557ce,_0x32d6a3[_0xd6ea('0x25')]);_0x3e4e93[_0xd6ea('0x1f')]();}};}; \ 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 0eaca0b..b6b8469 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 _0xc1a3=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','then','error','finally','info','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','create','dialogState','Failed','catch','stringify','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc1a3,0x12d));var _0x3c1a=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0xc1a3[_0x2ca616];return _0x53155f;};'use strict';var _=require(_0x3c1a('0x0'));var moment=require(_0x3c1a('0x1'));var AWS=require(_0x3c1a('0x2'));var utils=require(_0x3c1a('0x3'));var logger=require(_0x3c1a('0x4'))(_0x3c1a('0x5'));var rpc={'chatMessage':require(_0x3c1a('0x6')),'openchannelMessage':require(_0x3c1a('0x7')),'mailMessage':require(_0x3c1a('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3c1a('0x9'))};exports[_0x3c1a('0xa')]=function(_0x50ec4e,_0x161015){return function(_0x1e4b2e){try{if(!_[_0x3c1a('0xb')](this[_0x3c1a('0xc')][_0x3c1a('0xd')])){logger['info'](_0x3c1a('0xe'),_0x50ec4e,_0x3c1a('0xf'));return _0x1e4b2e[_0x3c1a('0x10')]();}var _0x1a7860={'ContactId':this[_0x3c1a('0x11')]['id'],'sentAt':moment()[_0x3c1a('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x34ca9c=this['channel'];if(_0x34ca9c===_0x3c1a('0x13')){_0x1a7860[_0x3c1a('0x14')]=this[_0x3c1a('0x15')]['id'];}else{_0x1a7860[_[_0x3c1a('0x16')](_0x34ca9c)+_0x3c1a('0x17')]=this[_0x3c1a('0x15')]['id'];}_0x1a7860[_[_0x3c1a('0x16')](_0x34ca9c)+_0x3c1a('0x18')]=this[_0x3c1a('0xc')]['id'];if(this[_0x3c1a('0xc')][_0x3c1a('0x19')]){var _0x365a82=_0x161015[0x4];if(!_['isEmpty'](_0x365a82)){_0x1a7860[_0x3c1a('0x1a')]=utils[_0x3c1a('0x1b')](_0x365a82,this);return rpc[_0x34ca9c+_0x3c1a('0x1c')]['create'](_0x1a7860)[_0x3c1a('0x1d')](function(_0x530f83){logger['info'](_0x3c1a('0xe'),_0x50ec4e,_0x1a7860[_0x3c1a('0x1a')]);})['catch'](function(_0x5ab7e9){logger[_0x3c1a('0x1e')](_0x3c1a('0xe'),_0x50ec4e,JSON['stringify'](_0x5ab7e9));})[_0x3c1a('0x1f')](function(){logger[_0x3c1a('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x50ec4e);_0x1e4b2e[_0x3c1a('0x21')]();});}else{logger[_0x3c1a('0x20')](_0x3c1a('0x22'),_0x50ec4e);_0x1e4b2e[_0x3c1a('0x21')]();}}else{var _0x5be681=this;var _0x522f7b=new AWS['LexRuntime']({'accessKeyId':_0x161015[0x0],'secretAccessKey':_0x161015[0x1],'region':_0x161015[0x2]});var _0x49c2c5={'botAlias':_0x3c1a('0x23'),'botName':_0x161015[0x3],'inputText':this[_0x3c1a('0x24')]['body'],'userId':this[_0x3c1a('0xc')]['id'][_0x3c1a('0x25')]()};_0x522f7b[_0x3c1a('0x26')](_0x49c2c5,function(_0x11f0fd,_0x79681b){if(_0x11f0fd){logger['error'](_0x3c1a('0xe'),_0x50ec4e,_0x11f0fd[_0x3c1a('0x24')]);_0x1e4b2e[_0x3c1a('0x10')]();}else if(_0x79681b&&_0x79681b[_0x3c1a('0x24')]){_0x5be681[_0x3c1a('0x1a')]['amazonlex']=_0x79681b;_0x1a7860[_0x3c1a('0x1a')]=_0x79681b[_0x3c1a('0x24')];return rpc[_0x34ca9c+'Message'][_0x3c1a('0x27')](_0x1a7860)[_0x3c1a('0x1d')](function(_0xaa7973){logger[_0x3c1a('0x20')](_0x3c1a('0xe'),_0x50ec4e,_0x1a7860[_0x3c1a('0x1a')]);if(_0x79681b[_0x3c1a('0x28')]==_0x3c1a('0x29')){_0x1e4b2e[_0x3c1a('0x10')]();}else{_0x1e4b2e[_0x3c1a('0x21')]();}})[_0x3c1a('0x2a')](function(_0x49ceda){logger[_0x3c1a('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x50ec4e,JSON['stringify'](_0x49ceda));_0x1e4b2e[_0x3c1a('0x10')]();});}else{_0x1e4b2e[_0x3c1a('0x10')]();}});}}catch(_0x851612){logger[_0x3c1a('0x1e')](_0x3c1a('0xe'),_0x50ec4e,JSON[_0x3c1a('0x2b')](_0x851612));_0x1e4b2e[_0x3c1a('0x21')]();}};}; \ No newline at end of file +var _0x381b=['info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','isEmpty','body','getMustacheRender','Message','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','amazonlex','create','then','dialogState','next','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId'];(function(_0x1bb2c5,_0x5a3a8f){var _0x50782b=function(_0x59ede6){while(--_0x59ede6){_0x1bb2c5['push'](_0x1bb2c5['shift']());}};_0x50782b(++_0x5a3a8f);}(_0x381b,0xd7));var _0xb381=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0x381b[_0x5b5eb4];return _0x42af53;};'use strict';var _=require('lodash');var moment=require(_0xb381('0x0'));var AWS=require('aws-sdk');var utils=require(_0xb381('0x1'));var logger=require(_0xb381('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb381('0x3')),'mailMessage':require(_0xb381('0x4')),'smsMessage':require(_0xb381('0x5')),'faxMessage':require(_0xb381('0x6'))};exports[_0xb381('0x7')]=function(_0x16bb76,_0x5ade54){return function(_0x590148){try{if(!_[_0xb381('0x8')](this['interaction'][_0xb381('0x9')])){logger[_0xb381('0xa')](_0xb381('0xb'),_0x16bb76,_0xb381('0xc'));return _0x590148['next']();}var _0xa03bf2={'ContactId':this[_0xb381('0xd')]['id'],'sentAt':moment()[_0xb381('0xe')](_0xb381('0xf')),'direction':_0xb381('0x10')};var _0x278b1f=this[_0xb381('0x11')];if(_0x278b1f===_0xb381('0x12')){_0xa03bf2[_0xb381('0x13')]=this[_0xb381('0x14')]['id'];}else{_0xa03bf2[_[_0xb381('0x15')](_0x278b1f)+_0xb381('0x16')]=this['account']['id'];}_0xa03bf2[_['upperFirst'](_0x278b1f)+_0xb381('0x17')]=this[_0xb381('0x18')]['id'];if(this[_0xb381('0x18')]['created']){var _0x2665f3=_0x5ade54[0x4];if(!_[_0xb381('0x19')](_0x2665f3)){_0xa03bf2[_0xb381('0x1a')]=utils[_0xb381('0x1b')](_0x2665f3,this);return rpc[_0x278b1f+_0xb381('0x1c')]['create'](_0xa03bf2)['then'](function(_0x4c95b5){logger[_0xb381('0xa')](_0xb381('0xb'),_0x16bb76,_0xa03bf2[_0xb381('0x1a')]);})[_0xb381('0x1d')](function(_0x3f8e22){logger[_0xb381('0x1e')](_0xb381('0xb'),_0x16bb76,JSON[_0xb381('0x1f')](_0x3f8e22));})[_0xb381('0x20')](function(){logger[_0xb381('0xa')](_0xb381('0x21'),_0x16bb76);_0x590148[_0xb381('0x22')]();});}else{logger['info'](_0xb381('0x23'),_0x16bb76);_0x590148[_0xb381('0x22')]();}}else{var _0x35a95b=this;var _0x2a9f5a=new AWS[(_0xb381('0x24'))]({'accessKeyId':_0x5ade54[0x0],'secretAccessKey':_0x5ade54[0x1],'region':_0x5ade54[0x2]});var _0x4130d8={'botAlias':_0xb381('0x25'),'botName':_0x5ade54[0x3],'inputText':this[_0xb381('0x26')][_0xb381('0x1a')],'userId':this[_0xb381('0x18')]['id'][_0xb381('0x27')]()};_0x2a9f5a['postText'](_0x4130d8,function(_0x491aae,_0x2d4b45){if(_0x491aae){logger[_0xb381('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x16bb76,_0x491aae[_0xb381('0x26')]);_0x590148['next']();}else if(_0x2d4b45&&_0x2d4b45[_0xb381('0x26')]){_0x35a95b[_0xb381('0x1a')][_0xb381('0x28')]=_0x2d4b45;_0xa03bf2[_0xb381('0x1a')]=_0x2d4b45[_0xb381('0x26')];return rpc[_0x278b1f+_0xb381('0x1c')][_0xb381('0x29')](_0xa03bf2)[_0xb381('0x2a')](function(_0x3c2422){logger[_0xb381('0xa')](_0xb381('0xb'),_0x16bb76,_0xa03bf2[_0xb381('0x1a')]);if(_0x2d4b45[_0xb381('0x2b')]=='Failed'){_0x590148[_0xb381('0x2c')]();}else{_0x590148['stop']();}})[_0xb381('0x1d')](function(_0x163abc){logger[_0xb381('0x1e')](_0xb381('0xb'),_0x16bb76,JSON['stringify'](_0x163abc));_0x590148['next']();});}else{_0x590148['next']();}});}}catch(_0x281742){logger[_0xb381('0x1e')](_0xb381('0xb'),_0x16bb76,JSON[_0xb381('0x1f')](_0x281742));_0x590148[_0xb381('0x22')]();}};}; \ 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 664d5ba..db67acc 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 _0xedd9=['catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','next','create','[%s][AUTOREPLY]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','consequence','isNil','created','interaction','info','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','upperFirst','InteractionId','Message','account','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','','replace','body','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify'];(function(_0xcc0678,_0x4545aa){var _0x3ee395=function(_0x4d003e){while(--_0x4d003e){_0xcc0678['push'](_0xcc0678['shift']());}};_0x3ee395(++_0x4545aa);}(_0xedd9,0xfc));var _0x9edd=function(_0x3aad50,_0x5e1d9a){_0x3aad50=_0x3aad50-0x0;var _0x3381e6=_0xedd9[_0x3aad50];return _0x3381e6;};'use strict';var _=require('lodash');var moment=require(_0x9edd('0x0'));var utils=require(_0x9edd('0x1'));var logger=require(_0x9edd('0x2'))(_0x9edd('0x3'));var rpc={'chatMessage':require(_0x9edd('0x4')),'openchannelMessage':require(_0x9edd('0x5')),'mailMessage':require(_0x9edd('0x6')),'smsMessage':require(_0x9edd('0x7')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x9edd('0x8'));exports[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return function(_0x5319f7){try{if(_0x34c1a7[0x0]==='1'&&(_[_0x9edd('0xa')](this['interaction'][_0x9edd('0xb')])||!this[_0x9edd('0xc')][_0x9edd('0xb')])){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x9edd('0xe'));return _0x5319f7['next']();}var _0x2076fc=this[_0x9edd('0xf')];var _0x523026={'body':utils[_0x9edd('0x10')](_0x34c1a7[0x1],this),'ContactId':this[_0x9edd('0x11')]['id'],'sentAt':moment()['format'](_0x9edd('0x12')),'direction':_0x9edd('0x13')};if(this[_0x9edd('0x14')]){_0x523026['to']=this[_0x9edd('0x14')][_0x9edd('0x15')]||'';_0x523026['cc']=this[_0x9edd('0x14')]['cc']||'';_0x523026[_0x9edd('0x15')]=this[_0x9edd('0x14')]['to']||'';_0x523026['phone']=this[_0x9edd('0x14')][_0x9edd('0x16')]||'';_0x523026[_0x9edd('0x17')]=!![];if(this[_0x9edd('0x14')][_0x9edd('0x18')]){_0x523026[_0x9edd('0x18')]='';_0x523026[_0x9edd('0x18')]+=_[_0x9edd('0x19')](this['message'][_0x9edd('0x18')],_0x9edd('0x1a'))?'':_0x9edd('0x1b');_0x523026['subject']+=this[_0x9edd('0x14')][_0x9edd('0x18')];}}if(this[_0x9edd('0xf')]==='chat'){_0x523026[_0x9edd('0x1c')]=this['account']['id'];}else{_0x523026[_[_0x9edd('0x1d')](this[_0x9edd('0xf')])+'AccountId']=this['account']['id'];}_0x523026[_[_0x9edd('0x1d')](this['channel'])+_0x9edd('0x1e')]=this['interaction']['id'];if(rpc[this['channel']+_0x9edd('0x1f')]){if(this[_0x9edd('0xf')]==='mail'){var _0x5823bc={'tls':{'rejectUnauthorized':![]}};if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')]){_0x5823bc['service']=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')];}else{_0x5823bc[_0x9edd('0x23')]=this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x23')];_0x5823bc[_0x9edd('0x24')]=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x24')];_0x5823bc['secure']=this['account'][_0x9edd('0x21')][_0x9edd('0x25')];}if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x26')]){_0x5823bc['auth']={'user':this['account'][_0x9edd('0x21')][_0x9edd('0x27')],'pass':this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x28')]};}_0x523026[_0x9edd('0x29')]=this[_0x9edd('0x14')][_0x9edd('0x2a')];_0x523026['html']=_0x9edd('0x2b')+_[_0x9edd('0x2c')](_0x523026[_0x9edd('0x2d')],_0x9edd('0x2e'),_0x9edd('0x2f'))+_0x9edd('0x30');return mailRpc[_0x9edd('0x31')](_0x5823bc,_0x523026)[_0x9edd('0x32')](function(_0x19b6c1){logger[_0x9edd('0xd')](_0x9edd('0x33'),_0x268f9e);_0x523026[_0x9edd('0x2a')]=_0x19b6c1[_0x9edd('0x14')][_0x9edd('0x2a')];return rpc[_0x2076fc+_0x9edd('0x1f')]['create'](_0x523026);})[_0x9edd('0x32')](function(_0x259259){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,JSON[_0x9edd('0x34')](_0x259259));})[_0x9edd('0x35')](function(_0xde9b13){logger[_0x9edd('0x36')](_0x9edd('0x37'),_0x268f9e,JSON[_0x9edd('0x34')](_0xde9b13));})[_0x9edd('0x38')](function(){_0x5319f7[_0x9edd('0x39')]();});}else{return rpc[this[_0x9edd('0xf')]+_0x9edd('0x1f')][_0x9edd('0x3a')](_0x523026)[_0x9edd('0x32')](function(_0x27eb7e){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x523026[_0x9edd('0x2d')]);})['catch'](function(_0x968303){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x968303));})[_0x9edd('0x38')](function(){_0x5319f7['next']();});}}}catch(_0x6de835){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x6de835));_0x5319f7[_0x9edd('0x3c')]();}};}; \ No newline at end of file +var _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 80ec898..4ae31a8 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63ad=['interaction','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','Interaction','channel','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x389b1f,_0xe575ee){var _0x1b3f63=function(_0x58d8ce){while(--_0x58d8ce){_0x389b1f['push'](_0x389b1f['shift']());}};_0x1b3f63(++_0xe575ee);}(_0x63ad,0x7d));var _0xd63a=function(_0x3bda0b,_0x5da28b){_0x3bda0b=_0x3bda0b-0x0;var _0x54ba2e=_0x63ad[_0x3bda0b];return _0x54ba2e;};'use strict';var moment=require('moment');var logger=require(_0xd63a('0x0'))(_0xd63a('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xd63a('0x2'))};exports[_0xd63a('0x3')]=function(_0x4a9034,_0x22f15a,_0x1c4437,_0x32e509){return function(_0xcfe533){try{logger[_0xd63a('0x4')](_0xd63a('0x5'),_0x4a9034,_0x22f15a[0x0]);var _0x52d6cc={'closed':0x1,'closedAt':moment()[_0xd63a('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xd63a('0x7'),'disposition':_0x22f15a[0x0]};if(rpc[_0x32e509['channel']+_0xd63a('0x8')]){rpc[_0x32e509[_0xd63a('0x9')]+_0xd63a('0x8')]['update'](_0x32e509['interaction']['id'],_0x52d6cc)['then'](function(_0x3bf872){logger['info'](_0xd63a('0xa'),_0x4a9034,_0x32e509[_0xd63a('0xb')]['id']);})['catch'](function(_0x2a1e86){logger[_0xd63a('0xc')](_0xd63a('0xd'),_0x4a9034,JSON[_0xd63a('0xe')](_0x2a1e86));})[_0xd63a('0xf')](function(){_0xcfe533[_0xd63a('0x10')]();});}}catch(_0x32fa57){logger['error'](_0xd63a('0xd'),_0x4a9034,JSON[_0xd63a('0xe')](_0x32fa57));_0xcfe533[_0xd63a('0x10')]();}};}; \ No newline at end of file +var _0x93e9=['../../rpc/mailInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','interaction','stringify','finally','stop','error','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x93e9,0xcc));var _0x993e=function(_0x15e1f8,_0x22e6ab){_0x15e1f8=_0x15e1f8-0x0;var _0x5d4054=_0x93e9[_0x15e1f8];return _0x5d4054;};'use strict';var moment=require(_0x993e('0x0'));var logger=require(_0x993e('0x1'))(_0x993e('0x2'));var rpc={'chatInteraction':require(_0x993e('0x3')),'openchannelInteraction':require(_0x993e('0x4')),'smsInteraction':require(_0x993e('0x5')),'mailInteraction':require(_0x993e('0x6')),'faxInteraction':require('../../rpc/faxInteraction')};exports['consequence']=function(_0x1b762e,_0x255045,_0x15ce9b,_0x45f52e){return function(_0x1da414){try{logger[_0x993e('0x7')](_0x993e('0x8'),_0x1b762e,_0x255045[0x0]);var _0x1aef74={'closed':0x1,'closedAt':moment()['format'](_0x993e('0x9')),'closeReason':_0x993e('0xa'),'disposition':_0x255045[0x0]};if(rpc[_0x45f52e[_0x993e('0xb')]+_0x993e('0xc')]){rpc[_0x45f52e[_0x993e('0xb')]+_0x993e('0xc')][_0x993e('0xd')](_0x45f52e['interaction']['id'],_0x1aef74)[_0x993e('0xe')](function(_0x10cf0e){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x1b762e,_0x45f52e[_0x993e('0xf')]['id']);})['catch'](function(_0x333aa9){logger['error']('[%s][CLOSE]\x20%s',_0x1b762e,JSON[_0x993e('0x10')](_0x333aa9));})[_0x993e('0x11')](function(){_0x1da414[_0x993e('0x12')]();});}}catch(_0x267748){logger[_0x993e('0x13')](_0x993e('0x14'),_0x1b762e,JSON[_0x993e('0x10')](_0x267748));_0x1da414[_0x993e('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 2d67bf6..0e72a69 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68b1=['apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId','account','AccountId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','dialogflow','result','speech','metadata','endConversation','message','lodash','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x68b1,0xae));var _0x168b=function(_0x56efd2,_0x4ebcf1){_0x56efd2=_0x56efd2-0x0;var _0x394cd8=_0x68b1[_0x56efd2];return _0x394cd8;};'use strict';var _=require(_0x168b('0x0'));var moment=require(_0x168b('0x1'));var apiai=require(_0x168b('0x2'));var md5=require(_0x168b('0x3'));var utils=require(_0x168b('0x4'));var logger=require(_0x168b('0x5'))(_0x168b('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x168b('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x168b('0x8'))};exports[_0x168b('0x9')]=function(_0x4f611c,_0x16eb91){return function(_0x1959d8){try{if(!_[_0x168b('0xa')](this['interaction'][_0x168b('0xb')])){logger[_0x168b('0xc')](_0x168b('0xd'),_0x4f611c,_0x168b('0xe'));return _0x1959d8[_0x168b('0xf')]();}var _0x3620bc={'ContactId':this[_0x168b('0x10')]['id'],'sentAt':moment()['format'](_0x168b('0x11')),'direction':_0x168b('0x12')};var _0x19660e=this['channel'];if(_0x19660e===_0x168b('0x13')){_0x3620bc[_0x168b('0x14')]=this[_0x168b('0x15')]['id'];}else{_0x3620bc[_['upperFirst'](_0x19660e)+_0x168b('0x16')]=this[_0x168b('0x15')]['id'];}_0x3620bc[_['upperFirst'](_0x19660e)+'InteractionId']=this[_0x168b('0x17')]['id'];if(this[_0x168b('0x17')][_0x168b('0x18')]){var _0x58fa09=_0x16eb91[0x2];if(!_[_0x168b('0x19')](_0x58fa09)){_0x3620bc[_0x168b('0x1a')]=utils[_0x168b('0x1b')](_0x58fa09,this);return rpc[_0x19660e+_0x168b('0x1c')][_0x168b('0x1d')](_0x3620bc)[_0x168b('0x1e')](function(_0x5ad41d){logger['info'](_0x168b('0xd'),_0x4f611c,_0x3620bc[_0x168b('0x1a')]);})[_0x168b('0x1f')](function(_0x1af1d6){logger[_0x168b('0x20')](_0x168b('0xd'),_0x4f611c,JSON[_0x168b('0x21')](_0x1af1d6));})[_0x168b('0x22')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4f611c);_0x1959d8['stop']();});}else{logger[_0x168b('0xc')](_0x168b('0x23'),_0x4f611c);_0x1959d8[_0x168b('0x24')]();}}else{var _0x4ac9e3=this;var _0x10bd4b=apiai(_0x16eb91[0x0],{'language':_0x16eb91[0x1]||'en'});return _0x10bd4b[_0x168b('0x25')](this['message'][_0x168b('0x1a')],{'sessionId':md5(this[_0x168b('0x17')]['id'])})[_0x168b('0x1e')](function(_0x2b623f){_0x4ac9e3[_0x168b('0x1a')][_0x168b('0x26')]=_0x2b623f;_0x3620bc[_0x168b('0x1a')]=_0x2b623f[_0x168b('0x27')]['fulfillment'][_0x168b('0x28')];return rpc[_0x19660e+_0x168b('0x1c')]['create'](_0x3620bc)['then'](function(_0x1ac9f9){logger[_0x168b('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x4f611c,_0x3620bc[_0x168b('0x1a')]);if(_0x2b623f[_0x168b('0x27')][_0x168b('0x29')][_0x168b('0x2a')]){_0x1959d8[_0x168b('0xf')]();}else{_0x1959d8['stop']();}})[_0x168b('0x1f')](function(_0x38091c){logger[_0x168b('0x20')](_0x168b('0xd'),_0x4f611c,JSON[_0x168b('0x21')](_0x38091c));_0x1959d8['next']();});})['catch'](function(_0x2a53d2){logger[_0x168b('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x4f611c,_0x2a53d2[_0x168b('0x2b')]);_0x1959d8[_0x168b('0xf')]();});}}catch(_0x647591){logger[_0x168b('0x20')](_0x168b('0xd'),_0x4f611c,JSON[_0x168b('0x21')](_0x647591));_0x1959d8['stop']();}};}; \ No newline at end of file +var _0x4ee5=['then','body','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','speech','metadata','endConversation','catch','error','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','create'];(function(_0x4d753e,_0x1f3c90){var _0x5723a9=function(_0x4ba87a){while(--_0x4ba87a){_0x4d753e['push'](_0x4d753e['shift']());}};_0x5723a9(++_0x1f3c90);}(_0x4ee5,0x160));var _0x54ee=function(_0x3a4dae,_0x1dbc3a){_0x3a4dae=_0x3a4dae-0x0;var _0x2fcfc0=_0x4ee5[_0x3a4dae];return _0x2fcfc0;};'use strict';var _=require(_0x54ee('0x0'));var moment=require(_0x54ee('0x1'));var apiai=require(_0x54ee('0x2'));var md5=require(_0x54ee('0x3'));var utils=require(_0x54ee('0x4'));var logger=require('../../../../config/logger')(_0x54ee('0x5'));var rpc={'chatMessage':require(_0x54ee('0x6')),'openchannelMessage':require(_0x54ee('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x54ee('0x8')),'faxMessage':require(_0x54ee('0x9'))};exports[_0x54ee('0xa')]=function(_0x411f83,_0x40f4b9){return function(_0x16cafd){try{if(!_[_0x54ee('0xb')](this[_0x54ee('0xc')][_0x54ee('0xd')])){logger[_0x54ee('0xe')](_0x54ee('0xf'),_0x411f83,_0x54ee('0x10'));return _0x16cafd[_0x54ee('0x11')]();}var _0x3a9a7c={'ContactId':this[_0x54ee('0x12')]['id'],'sentAt':moment()[_0x54ee('0x13')](_0x54ee('0x14')),'direction':_0x54ee('0x15')};var _0x220367=this[_0x54ee('0x16')];if(_0x220367==='chat'){_0x3a9a7c[_0x54ee('0x17')]=this[_0x54ee('0x18')]['id'];}else{_0x3a9a7c[_['upperFirst'](_0x220367)+_0x54ee('0x19')]=this[_0x54ee('0x18')]['id'];}_0x3a9a7c[_[_0x54ee('0x1a')](_0x220367)+_0x54ee('0x1b')]=this[_0x54ee('0xc')]['id'];if(this[_0x54ee('0xc')]['created']){var _0x4e9260=_0x40f4b9[0x2];if(!_[_0x54ee('0x1c')](_0x4e9260)){_0x3a9a7c['body']=utils[_0x54ee('0x1d')](_0x4e9260,this);return rpc[_0x220367+_0x54ee('0x1e')][_0x54ee('0x1f')](_0x3a9a7c)[_0x54ee('0x20')](function(_0x107ab0){logger['info'](_0x54ee('0xf'),_0x411f83,_0x3a9a7c[_0x54ee('0x21')]);})['catch'](function(_0x494523){logger['error'](_0x54ee('0xf'),_0x411f83,JSON[_0x54ee('0x22')](_0x494523));})[_0x54ee('0x23')](function(){logger[_0x54ee('0xe')](_0x54ee('0x24'),_0x411f83);_0x16cafd[_0x54ee('0x25')]();});}else{logger[_0x54ee('0xe')](_0x54ee('0x26'),_0x411f83);_0x16cafd['stop']();}}else{var _0x1f6111=this;var _0x4191f7=apiai(_0x40f4b9[0x0],{'language':_0x40f4b9[0x1]||'en'});return _0x4191f7[_0x54ee('0x27')](this[_0x54ee('0x28')][_0x54ee('0x21')],{'sessionId':md5(this[_0x54ee('0xc')]['id'])})['then'](function(_0x2ad245){_0x1f6111[_0x54ee('0x21')][_0x54ee('0x29')]=_0x2ad245;_0x3a9a7c[_0x54ee('0x21')]=_0x2ad245[_0x54ee('0x2a')]['fulfillment'][_0x54ee('0x2b')];return rpc[_0x220367+_0x54ee('0x1e')][_0x54ee('0x1f')](_0x3a9a7c)[_0x54ee('0x20')](function(_0x3e415e){logger[_0x54ee('0xe')](_0x54ee('0xf'),_0x411f83,_0x3a9a7c[_0x54ee('0x21')]);if(_0x2ad245[_0x54ee('0x2a')][_0x54ee('0x2c')][_0x54ee('0x2d')]){_0x16cafd[_0x54ee('0x11')]();}else{_0x16cafd[_0x54ee('0x25')]();}})[_0x54ee('0x2e')](function(_0xcfed58){logger['error'](_0x54ee('0xf'),_0x411f83,JSON[_0x54ee('0x22')](_0xcfed58));_0x16cafd[_0x54ee('0x11')]();});})[_0x54ee('0x2e')](function(_0x2b80c9){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x411f83,_0x2b80c9[_0x54ee('0x28')]);_0x16cafd[_0x54ee('0x11')]();});}}catch(_0x58d9ec){logger[_0x54ee('0x2f')](_0x54ee('0xf'),_0x411f83,JSON[_0x54ee('0x22')](_0x58d9ec));_0x16cafd[_0x54ee('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index f810a5d..5d448bd 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d89=['stop','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','join'];(function(_0x179344,_0x1f9e72){var _0x43e76c=function(_0x12bac8){while(--_0x12bac8){_0x179344['push'](_0x179344['shift']());}};_0x43e76c(++_0x1f9e72);}(_0x4d89,0xdd));var _0x94d8=function(_0x4ae9f9,_0x1b0d43){_0x4ae9f9=_0x4ae9f9-0x0;var _0x128c98=_0x4d89[_0x4ae9f9];return _0x128c98;};'use strict';var schema=require(_0x94d8('0x0'));var _=require(_0x94d8('0x1'));var htmlToText=require(_0x94d8('0x2'));var utils=require(_0x94d8('0x3'));var logger=require(_0x94d8('0x4'))(_0x94d8('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x94d8('0x6')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x94d8('0x7'),'message':_0x94d8('0x8')}});exports[_0x94d8('0x9')]=function(_0x262b60,_0x3d8c67){return function(_0x8040a6){try{var _0x234e2f={'condition':htmlToText['fromString'](utils[_0x94d8('0xa')](_0x3d8c67[0x0],this),{'wordwrap':![]})[_0x94d8('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3d8c67[0x1],'priorityFalse':_0x3d8c67[0x2]};var _0x2befd6=gotoif['validate'](_0x234e2f,{'typecast':!![]});if(_0x2befd6['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x262b60,_['map'](_0x2befd6,'message')[_0x94d8('0xc')](',\x20'));_0x8040a6[_0x94d8('0xd')]();}else{try{var _0x2dd29d=eval('('+_0x234e2f['condition']+')');var _0x563050=_0x2dd29d?_0x234e2f['priorityTrue']:_0x234e2f[_0x94d8('0xe')];logger['info'](_0x94d8('0xf'),_0x262b60,_0x234e2f[_0x94d8('0x10')],_0x2dd29d,_0x563050||_0x94d8('0x11'));if(_0x563050){var _0xbd4ed2=_[_0x94d8('0x12')](_0x8040a6[_0x94d8('0x13')](),{'p':_0x563050});if(_0xbd4ed2>=0x0){logger[_0x94d8('0x14')](_0x94d8('0x15'),_0x262b60,_0x563050||_0x94d8('0x11'),_0xbd4ed2);_0x8040a6[_0x94d8('0x11')](_0xbd4ed2);}else{logger[_0x94d8('0x14')](_0x94d8('0x16'),_0x262b60,_0x563050||_0x94d8('0x11'));_0x8040a6[_0x94d8('0xd')]();}}else{_0x8040a6[_0x94d8('0x11')]();}}catch(_0x10bbc4){logger[_0x94d8('0x17')](_0x94d8('0x18'),_0x262b60,_0x10bbc4['message']);_0x8040a6[_0x94d8('0xd')]();}}}catch(_0x3dd51b){logger[_0x94d8('0x17')](_0x94d8('0x19'),_0x262b60,JSON['stringify'](_0x3dd51b));_0x8040a6[_0x94d8('0xd')]();}};}; \ No newline at end of file +var _0xfeaf=['priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','message','stringify','validate','html-to-text','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number'];(function(_0x558366,_0x55a659){var _0xefe4ba=function(_0x58a8d1){while(--_0x58a8d1){_0x558366['push'](_0x558366['shift']());}};_0xefe4ba(++_0x55a659);}(_0xfeaf,0xbd));var _0xffea=function(_0x43421c,_0xbe133e){_0x43421c=_0x43421c-0x0;var _0x3a585d=_0xfeaf[_0x43421c];return _0x3a585d;};'use strict';var schema=require(_0xffea('0x0'));var _=require('lodash');var htmlToText=require(_0xffea('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xffea('0x2'));var gotoif=schema({'condition':{'type':_0xffea('0x3'),'required':!![],'message':_0xffea('0x4')},'priorityTrue':{'type':_0xffea('0x5'),'message':_0xffea('0x6')},'priorityFalse':{'type':'number','message':_0xffea('0x7')}});exports[_0xffea('0x8')]=function(_0x3bd1e8,_0x1468cb){return function(_0x3cf62f){try{var _0x2ba58f={'condition':htmlToText['fromString'](utils[_0xffea('0x9')](_0x1468cb[0x0],this),{'wordwrap':![]})[_0xffea('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1468cb[0x1],'priorityFalse':_0x1468cb[0x2]};var _0x33c138=gotoif['validate'](_0x2ba58f,{'typecast':!![]});if(_0x33c138[_0xffea('0xb')]){logger[_0xffea('0xc')](_0xffea('0xd'),_0x3bd1e8,_[_0xffea('0xe')](_0x33c138,'message')[_0xffea('0xf')](',\x20'));_0x3cf62f['stop']();}else{try{var _0x49acfb=eval('('+_0x2ba58f[_0xffea('0x10')]+')');var _0x121ff4=_0x49acfb?_0x2ba58f[_0xffea('0x11')]:_0x2ba58f[_0xffea('0x12')];logger[_0xffea('0x13')](_0xffea('0x14'),_0x3bd1e8,_0x2ba58f[_0xffea('0x10')],_0x49acfb,_0x121ff4||_0xffea('0x15'));if(_0x121ff4){var _0x1973f8=_[_0xffea('0x16')](_0x3cf62f['rules'](),{'p':_0x121ff4});if(_0x1973f8>=0x0){logger[_0xffea('0x13')](_0xffea('0x17'),_0x3bd1e8,_0x121ff4||_0xffea('0x15'),_0x1973f8);_0x3cf62f['next'](_0x1973f8);}else{logger[_0xffea('0x13')](_0xffea('0x18'),_0x3bd1e8,_0x121ff4||_0xffea('0x15'));_0x3cf62f[_0xffea('0x19')]();}}else{_0x3cf62f[_0xffea('0x15')]();}}catch(_0x186e7f){logger[_0xffea('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3bd1e8,_0x186e7f[_0xffea('0x1a')]);_0x3cf62f[_0xffea('0x19')]();}}}catch(_0x82685e){logger[_0xffea('0xc')](_0xffea('0xd'),_0x3bd1e8,JSON[_0xffea('0x1b')](_0x82685e));_0x3cf62f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index d7fcf94..0985bf2 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 _0x65d6=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','info'];(function(_0xe9ba94,_0x5b97c7){var _0x331c72=function(_0x4bffac){while(--_0x4bffac){_0xe9ba94['push'](_0xe9ba94['shift']());}};_0x331c72(++_0x5b97c7);}(_0x65d6,0x15d));var _0x665d=function(_0x510fdc,_0xa8cff9){_0x510fdc=_0x510fdc-0x0;var _0x35f90b=_0x65d6[_0x510fdc];return _0x35f90b;};'use strict';var schema=require(_0x665d('0x0'));var _=require(_0x665d('0x1'));var logger=require(_0x665d('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x665d('0x3')}});exports[_0x665d('0x4')]=function(_0x49f92b,_0x170042){return function(_0x3e96d6){try{var _0x34da98={'priority':_0x170042[0x0]};var _0x5621f8=gotop[_0x665d('0x0')](_0x34da98,{'typecast':!![]});if(_0x5621f8[_0x665d('0x5')]){logger[_0x665d('0x6')](_0x665d('0x7'),_0x49f92b,_[_0x665d('0x8')](_0x5621f8,_0x665d('0x9'))['join'](',\x20'));_0x3e96d6['stop']();}else{logger[_0x665d('0xa')](_0x665d('0xb'),_0x49f92b,_0x34da98[_0x665d('0xc')]);if(_0x34da98['priority']){var _0x377626=_[_0x665d('0xd')](_0x3e96d6['rules'](),{'p':_0x34da98['priority']});if(_0x377626>=0x0){logger['info'](_0x665d('0xe'),_0x49f92b,_0x34da98[_0x665d('0xc')]||_0x665d('0xf'),_0x377626);_0x3e96d6[_0x665d('0xf')](_0x377626);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x49f92b,_0x34da98[_0x665d('0xc')]||'next');_0x3e96d6[_0x665d('0x10')]();}}else{_0x3e96d6[_0x665d('0xf')]();}}}catch(_0x5f25e9){logger[_0x665d('0x6')](_0x665d('0x7'),_0x49f92b,JSON[_0x665d('0x11')](_0x5f25e9));_0x3e96d6['stop']();}};}; \ No newline at end of file +var _0x6b87=['findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','[%s][GOTOP]\x20priority\x20%s','priority'];(function(_0x58e319,_0x28e3ae){var _0x577fc2=function(_0x4107f7){while(--_0x4107f7){_0x58e319['push'](_0x58e319['shift']());}};_0x577fc2(++_0x28e3ae);}(_0x6b87,0x18f));var _0x76b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b87[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x76b8('0x0'));var _=require(_0x76b8('0x1'));var logger=require(_0x76b8('0x2'))(_0x76b8('0x3'));var gotop=schema({'priority':{'type':_0x76b8('0x4'),'required':!![],'message':_0x76b8('0x5')}});exports[_0x76b8('0x6')]=function(_0x5d46c8,_0x3ac52c){return function(_0x1fe177){try{var _0x16b6a6={'priority':_0x3ac52c[0x0]};var _0x5131f3=gotop[_0x76b8('0x0')](_0x16b6a6,{'typecast':!![]});if(_0x5131f3[_0x76b8('0x7')]){logger[_0x76b8('0x8')](_0x76b8('0x9'),_0x5d46c8,_[_0x76b8('0xa')](_0x5131f3,_0x76b8('0xb'))[_0x76b8('0xc')](',\x20'));_0x1fe177['stop']();}else{logger['info'](_0x76b8('0xd'),_0x5d46c8,_0x16b6a6['priority']);if(_0x16b6a6[_0x76b8('0xe')]){var _0x2ea0fd=_[_0x76b8('0xf')](_0x1fe177[_0x76b8('0x10')](),{'p':_0x16b6a6[_0x76b8('0xe')]});if(_0x2ea0fd>=0x0){logger[_0x76b8('0x11')](_0x76b8('0x12'),_0x5d46c8,_0x16b6a6[_0x76b8('0xe')]||_0x76b8('0x13'),_0x2ea0fd);_0x1fe177[_0x76b8('0x13')](_0x2ea0fd);}else{logger[_0x76b8('0x11')](_0x76b8('0x14'),_0x5d46c8,_0x16b6a6[_0x76b8('0xe')]||_0x76b8('0x13'));_0x1fe177[_0x76b8('0x15')]();}}else{_0x1fe177[_0x76b8('0x13')]();}}}catch(_0x2e5496){logger[_0x76b8('0x8')](_0x76b8('0x9'),_0x5d46c8,JSON[_0x76b8('0x16')](_0x2e5496));_0x1fe177[_0x76b8('0x15')]();}};}; \ 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 73970c0..63d5f51 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 _0x4d0d=['next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','create','[%s][MESSAGE]\x20%s','body'];(function(_0x52ae48,_0x8e1949){var _0x33e8e2=function(_0xcd050a){while(--_0xcd050a){_0x52ae48['push'](_0x52ae48['shift']());}};_0x33e8e2(++_0x8e1949);}(_0x4d0d,0x13c));var _0xd4d0=function(_0x4428b4,_0x3077d4){_0x4428b4=_0x4428b4-0x0;var _0x53c666=_0x4d0d[_0x4428b4];return _0x53c666;};'use strict';var _=require(_0xd4d0('0x0'));var utils=require(_0xd4d0('0x1'));var logger=require(_0xd4d0('0x2'))(_0xd4d0('0x3'));var rpc={'chatMessage':require(_0xd4d0('0x4')),'openchannelMessage':require(_0xd4d0('0x5')),'mailMessage':require(_0xd4d0('0x6')),'smsMessage':require(_0xd4d0('0x7')),'faxMessage':require(_0xd4d0('0x8'))};exports[_0xd4d0('0x9')]=function(_0x3e6b1a,_0x7663b){return function(_0x47c2e2){try{var _0x45f6cf={'body':utils[_0xd4d0('0xa')](_0x7663b[0x0],this),'ContactId':this['contact']['id']};if(this[_0xd4d0('0xb')]===_0xd4d0('0xc')){_0x45f6cf[_0xd4d0('0xd')]=this[_0xd4d0('0xe')]['id'];}else{_0x45f6cf[_[_0xd4d0('0xf')](this['channel'])+_0xd4d0('0x10')]=this[_0xd4d0('0xe')]['id'];}_0x45f6cf[_[_0xd4d0('0xf')](this[_0xd4d0('0xb')])+_0xd4d0('0x11')]=this['interaction']['id'];if(rpc[this['channel']+_0xd4d0('0x12')]){return rpc[this[_0xd4d0('0xb')]+_0xd4d0('0x12')][_0xd4d0('0x13')](_0x45f6cf)['then'](function(_0x5b278e){logger['info'](_0xd4d0('0x14'),_0x3e6b1a,_0x45f6cf[_0xd4d0('0x15')]);_0x47c2e2[_0xd4d0('0x16')]();})['catch'](function(_0x197749){logger[_0xd4d0('0x17')](_0xd4d0('0x14'),_0x3e6b1a,JSON[_0xd4d0('0x18')](_0x197749));_0x47c2e2['stop']();});}}catch(_0xabf059){logger['error'](_0xd4d0('0x14'),_0x3e6b1a,JSON[_0xd4d0('0x18')](_0xabf059));_0x47c2e2[_0xd4d0('0x19')]();}};}; \ No newline at end of file +var _0xc5d5=['body','next','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','[%s][MESSAGE]\x20%s'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xc5d5,0xbd));var _0x5c5d=function(_0x40ba7c,_0x144d06){_0x40ba7c=_0x40ba7c-0x0;var _0x13655a=_0xc5d5[_0x40ba7c];return _0x13655a;};'use strict';var _=require('lodash');var utils=require(_0x5c5d('0x0'));var logger=require(_0x5c5d('0x1'))(_0x5c5d('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5c5d('0x3')),'smsMessage':require(_0x5c5d('0x4')),'faxMessage':require(_0x5c5d('0x5'))};exports[_0x5c5d('0x6')]=function(_0x52fea1,_0x2aee2e){return function(_0x5751fc){try{var _0x113daf={'body':utils[_0x5c5d('0x7')](_0x2aee2e[0x0],this),'ContactId':this['contact']['id']};if(this[_0x5c5d('0x8')]===_0x5c5d('0x9')){_0x113daf[_0x5c5d('0xa')]=this[_0x5c5d('0xb')]['id'];}else{_0x113daf[_['upperFirst'](this[_0x5c5d('0x8')])+_0x5c5d('0xc')]=this['account']['id'];}_0x113daf[_[_0x5c5d('0xd')](this[_0x5c5d('0x8')])+_0x5c5d('0xe')]=this[_0x5c5d('0xf')]['id'];if(rpc[this['channel']+_0x5c5d('0x10')]){return rpc[this[_0x5c5d('0x8')]+'Message']['create'](_0x113daf)['then'](function(_0x56af47){logger['info'](_0x5c5d('0x11'),_0x52fea1,_0x113daf[_0x5c5d('0x12')]);_0x5751fc[_0x5c5d('0x13')]();})['catch'](function(_0x48b2b4){logger[_0x5c5d('0x14')](_0x5c5d('0x11'),_0x52fea1,JSON['stringify'](_0x48b2b4));_0x5751fc['stop']();});}}catch(_0x34cd9d){logger[_0x5c5d('0x14')]('[%s][MESSAGE]\x20%s',_0x52fea1,JSON[_0x5c5d('0x15')](_0x34cd9d));_0x5751fc[_0x5c5d('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 6f44738..482fc83 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 _0xf551=['info','next','error','stop','../../../../config/logger','consequence'];(function(_0x57b1e4,_0x5bd382){var _0x4c0264=function(_0x5cfa70){while(--_0x5cfa70){_0x57b1e4['push'](_0x57b1e4['shift']());}};_0x4c0264(++_0x5bd382);}(_0xf551,0x70));var _0x1f55=function(_0x29b46c,_0x3731cd){_0x29b46c=_0x29b46c-0x0;var _0xadd9f0=_0xf551[_0x29b46c];return _0xadd9f0;};'use strict';var utils=require('./utils');var logger=require(_0x1f55('0x0'))('routing');exports[_0x1f55('0x1')]=function(_0x13ae96,_0xf4bdb8){return function(_0x5dc6f2){try{logger[_0x1f55('0x2')]('[%s][NOOP]\x20%s',_0x13ae96,utils['getMustacheRender'](_0xf4bdb8[0x0],this));_0x5dc6f2[_0x1f55('0x3')]();}catch(_0x5e7a79){logger[_0x1f55('0x4')]('[%s][NOOP]\x20%s',_0x13ae96,JSON['stringify'](_0x5e7a79));_0x5dc6f2[_0x1f55('0x5')]();}};}; \ No newline at end of file +var _0xa274=['[%s][NOOP]\x20%s','next','error','stringify','./utils','../../../../config/logger','routing','consequence'];(function(_0x22a150,_0x16aa1e){var _0x44f75a=function(_0xd0497){while(--_0xd0497){_0x22a150['push'](_0x22a150['shift']());}};_0x44f75a(++_0x16aa1e);}(_0xa274,0x9c));var _0x4a27=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0xa274[_0x2134b7];return _0x6c5914;};'use strict';var utils=require(_0x4a27('0x0'));var logger=require(_0x4a27('0x1'))(_0x4a27('0x2'));exports[_0x4a27('0x3')]=function(_0x5b7888,_0x2ae2eb){return function(_0x261e1a){try{logger['info'](_0x4a27('0x4'),_0x5b7888,utils['getMustacheRender'](_0x2ae2eb[0x0],this));_0x261e1a[_0x4a27('0x5')]();}catch(_0x57956e){logger[_0x4a27('0x6')](_0x4a27('0x4'),_0x5b7888,JSON[_0x4a27('0x7')](_0x57956e));_0x261e1a['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 9216ec0..6022188 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 _0x6d0b=['[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','account','queue','from','joinAt','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','InteractionId','interaction','MessageId','message','upperFirst','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','info','update','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','join','stop','find','timeout','createQueue','end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED'];(function(_0x412748,_0xc2594a){var _0x39c1d9=function(_0x989717){while(--_0x989717){_0x412748['push'](_0x412748['shift']());}};_0x39c1d9(++_0xc2594a);}(_0x6d0b,0x1c3));var _0xb6d0=function(_0x2cbc2a,_0xd0ba59){_0x2cbc2a=_0x2cbc2a-0x0;var _0x57dde3=_0x6d0b[_0x2cbc2a];return _0x57dde3;};'use strict';var schema=require(_0xb6d0('0x0'));var _=require(_0xb6d0('0x1'));var util=require(_0xb6d0('0x2'));var seqqueue=require(_0xb6d0('0x3'));var moment=require(_0xb6d0('0x4'));var Redis=require(_0xb6d0('0x5'));var config=require(_0xb6d0('0x6'));var logger=require(_0xb6d0('0x7'))(_0xb6d0('0x8'));var strategy=require(_0xb6d0('0x9'));config[_0xb6d0('0xa')]=_['defaults'](config['redis'],{'host':_0xb6d0('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xb6d0('0xc'),_0xb6d0('0xd'),_0xb6d0('0xe'),_0xb6d0('0xf'),_0xb6d0('0x10')];function emit(_0x319ad3,_0x2a855b,_0x3f7783){io['to'](_0x319ad3)['emit'](_0x2a855b,_0x3f7783);}function emitChannelQueueInteraction(_0x4e6372,_0x3d4e1f,_0x16d9a4,_0x1a14d4,_0x33bd78,_0x1d1c11,_0x1694cb,_0x404e60){_0x16d9a4[_0xb6d0('0xc')]=_0x404e60;_0x16d9a4[_0xb6d0('0xe')]=_0x3d4e1f;_0x16d9a4[_0xb6d0('0xd')]=_0x1a14d4;_0x16d9a4['id']=_0x33bd78;if(_0x1d1c11){_0x1694cb[util[_0xb6d0('0x11')](_0xb6d0('0x12'),_0x4e6372)][_0x33bd78]=_['pick'](_0x16d9a4,attributes);}else{delete _0x1694cb[util[_0xb6d0('0x11')]('%sQueuesWaitingInteractions',_0x4e6372)][_0x33bd78];}emit(util[_0xb6d0('0x11')](_0xb6d0('0x13'),_0x4e6372,_0x3d4e1f),util[_0xb6d0('0x11')]('%s_queue_waiting_interaction:%s',_0x4e6372,_0x1d1c11?_0xb6d0('0x14'):_0xb6d0('0x15')),_['pick'](_0x16d9a4,attributes));}var rpc={'openchannelQueueReport':require(_0xb6d0('0x16')),'mailQueueReport':require(_0xb6d0('0x17')),'chatQueueReport':require(_0xb6d0('0x18')),'smsQueueReport':require(_0xb6d0('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0xb6d0('0x1a'),'required':!![],'message':_0xb6d0('0x1b')},'timeout':{'type':_0xb6d0('0x1c'),'message':_0xb6d0('0x1d')}});function startRouting(_0x1a8ef8,_0x30b679,_0x2f90e0,_0x483313){if(_0x1a8ef8&&_0x30b679&&_0x2f90e0){_0x30b679['waiting']+=0x1;var _0x49ba3a={'uniqueid':_0x1a8ef8,'from':_0x2f90e0['body']?_0x2f90e0[_0xb6d0('0x1e')][_0xb6d0('0xf')]:'','joinAt':moment()[_0xb6d0('0x11')](_0xb6d0('0x1f')),'ContactId':_0x2f90e0[_0xb6d0('0x20')]?_0x2f90e0[_0xb6d0('0x20')]['id']:null,'ListId':_0x2f90e0['list']?_0x2f90e0[_0xb6d0('0x21')]['id']:null};_0x49ba3a[_['upperFirst'](_0x2f90e0['channel'])+'QueueId']=_0x30b679['id']||null;_0x49ba3a[_['upperFirst'](_0x2f90e0[_0xb6d0('0x22')])+_0xb6d0('0x23')]=_0x2f90e0['interaction']?_0x2f90e0[_0xb6d0('0x24')]['id']:null;_0x49ba3a[_['upperFirst'](_0x2f90e0['channel'])+_0xb6d0('0x25')]=_0x2f90e0[_0xb6d0('0x26')]?_0x2f90e0[_0xb6d0('0x26')]['id']:null;_0x49ba3a[_[_0xb6d0('0x27')](_0x2f90e0[_0xb6d0('0x22')])+(_0x2f90e0['channel']!==_0xb6d0('0x28')?_0xb6d0('0x29'):_0xb6d0('0x2a'))]=_0x2f90e0[_0xb6d0('0xd')]?_0x2f90e0['account']['id']:null;logger['info'](util[_0xb6d0('0x11')](_0xb6d0('0x2b'),_0x1a8ef8,_0x30b679[_0xb6d0('0x2c')]));emitChannelQueueInteraction(_0x2f90e0[_0xb6d0('0x22')],_0x30b679[_0xb6d0('0x2c')],_0x49ba3a,_0x2f90e0[_0xb6d0('0xd')][_0xb6d0('0x2c')],_0x2f90e0[_0xb6d0('0x26')]['id'],!![],_0x483313,_0x30b679['id']);if(rpc[_0x2f90e0[_0xb6d0('0x22')]+_0xb6d0('0x2d')]){return rpc[_0x2f90e0[_0xb6d0('0x22')]+_0xb6d0('0x2d')][_0xb6d0('0x2e')](_0x49ba3a)[_0xb6d0('0x2f')](function(_0x2dd890){logger[_0xb6d0('0x30')](_0xb6d0('0x31'));});}}}function stopRouting(_0x215e6f,_0x35454f,_0x5a8071,_0x5b61e0){if(_0x215e6f&&_0x35454f){_0x35454f[_0xb6d0('0x32')]-=0x1;var _0x3372c7={'leaveAt':moment()[_0xb6d0('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb6d0('0x33')};logger[_0xb6d0('0x34')](util[_0xb6d0('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x215e6f,_0x35454f['name']));emitChannelQueueInteraction(_0x5a8071[_0xb6d0('0x22')],_0x35454f[_0xb6d0('0x2c')],_0x5a8071[_0xb6d0('0x1e')],_0x5a8071[_0xb6d0('0xd')][_0xb6d0('0x2c')],_0x5a8071[_0xb6d0('0x26')]['id'],![],_0x5b61e0,_0x35454f['id']);if(rpc[_0x5a8071[_0xb6d0('0x22')]+'QueueReport']){return rpc[_0x5a8071[_0xb6d0('0x22')]+_0xb6d0('0x2d')][_0xb6d0('0x35')](_0x215e6f,_0x3372c7)['catch'](function(_0x5106d9){logger[_0xb6d0('0x30')]('update\x20queue\x20report');});}}}function endRouting(_0x3b7265,_0x294ad2,_0x58e632,_0x4aed89){if(_0x3b7265&&_0x294ad2){_0x294ad2[_0xb6d0('0x32')]-=0x1;var _0xdedee9={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xb6d0('0x11')](_0xb6d0('0x1f')),'reason':'timeout'};logger[_0xb6d0('0x34')](util['format'](_0xb6d0('0x36'),_0x3b7265,_0x294ad2[_0xb6d0('0x2c')]));emitChannelQueueInteraction(_0x58e632[_0xb6d0('0x22')],_0x294ad2[_0xb6d0('0x2c')],_0x58e632['body'],_0x58e632[_0xb6d0('0xd')][_0xb6d0('0x2c')],_0x58e632[_0xb6d0('0x26')]['id'],![],_0x4aed89);if(rpc[_0x58e632[_0xb6d0('0x22')]+'QueueReport']){return rpc[_0x58e632[_0xb6d0('0x22')]+_0xb6d0('0x2d')][_0xb6d0('0x35')](_0x3b7265,_0xdedee9)['catch'](function(_0x1a2b4d){logger[_0xb6d0('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x4d443f){return function(_0x28212a){return _0x28212a['name'][_0xb6d0('0x37')]()===_0x4d443f['toLowerCase']();};}exports[_0xb6d0('0x38')]=function(_0x4ea235,_0x58ddb3,_0xc20f46,_0x50880b){return function(_0x56b681){try{var _0x3af490={'name':_0x58ddb3[0x0],'timeout':_0x58ddb3[0x1]};var _0x2b8386=queue[_0xb6d0('0x0')](_0x3af490,{'typecast':!![]});if(_0x2b8386[_0xb6d0('0x39')]){logger[_0xb6d0('0x30')]('[%s][QUEUE]\x20%s',_0x4ea235,_['map'](_0x2b8386,_0xb6d0('0x26'))[_0xb6d0('0x3a')](',\x20'));_0x56b681[_0xb6d0('0x3b')]();}else{var _0x58d241=_[_0xb6d0('0x3c')](_0xc20f46[_0x50880b['channel']+'Queues'],handleFindQueue(_0x3af490[_0xb6d0('0x2c')]));if(_0x58d241){startRouting(_0x4ea235,_0x58d241,_0x50880b,_0xc20f46);var _0x36d879=(_0x58d241[_0xb6d0('0x3d')]||0xa)*0x3e8;var _0x2340de=(_0x3af490['timeout']||0x14)*0x3e8;var _0x3ec03d,_0x5d81a3;if(_0x36d879>_0x2340de){_0x2340de=_0x36d879;}var _0x5c8bbe=seqqueue[_0xb6d0('0x3e')](_0x36d879);_0x5c8bbe['id']=_0x4ea235;_0x5c8bbe['atimeout']=_0x36d879;_0x5c8bbe['qtimeout']=_0x2340de;_0x5c8bbe[_0xb6d0('0x22')]=_0x50880b[_0xb6d0('0x22')];_0xc20f46['rules'][_0x4ea235]['on'](_0xb6d0('0x3f'),function(){stopRouting(_0x4ea235,_0x58d241,_0x50880b,_0xc20f46);_0x5c8bbe[_0xb6d0('0x40')](!![]);clearTimeout(_0x3ec03d);_0x3ec03d=undefined;if(_0xc20f46[_0xb6d0('0x41')][_0x4ea235]){delete _0xc20f46[_0xb6d0('0x41')][_0x4ea235];}logger[_0xb6d0('0x34')](_0xb6d0('0x42'),_0x4ea235);_0x56b681[_0xb6d0('0x3b')]();});_0x3ec03d=setTimeout(function(){endRouting(_0x4ea235,_0x58d241,_0x50880b,_0xc20f46);clearTimeout(_0x3ec03d);_0x5c8bbe['close'](!![]);logger[_0xb6d0('0x34')](_0xb6d0('0x43'),_0x4ea235);_0x56b681[_0xb6d0('0x44')]();},_0x2340de);switch(_0x58d241[_0xb6d0('0x45')]){case'rrmemory':strategy[_0xb6d0('0x46')](_0x5c8bbe,_0x58d241,_0xc20f46,_0x50880b);break;default:strategy['beepall'](_0x5c8bbe,_0x58d241,_0xc20f46,_0x50880b);}}else{logger[_0xb6d0('0x30')](_0xb6d0('0x47'),_0x4ea235,_0x3af490[_0xb6d0('0x2c')]);_0x56b681[_0xb6d0('0x3b')]();}}}catch(_0x3eabac){console[_0xb6d0('0x48')](_0x3eabac);logger[_0xb6d0('0x30')](_0xb6d0('0x49'),_0x4ea235,_0x3eabac['stack']);_0x56b681[_0xb6d0('0x3b')]();}};}; \ No newline at end of file +var _0x4aa8=['info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','[%s][END:QUEUE][NAME:%s]','catch','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','[%s][QUEUE]\x20ROUTING\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','AccountId'];(function(_0x3ebe83,_0x243957){var _0x5ea9be=function(_0xbecb5b){while(--_0xbecb5b){_0x3ebe83['push'](_0x3ebe83['shift']());}};_0x5ea9be(++_0x243957);}(_0x4aa8,0xbe));var _0x84aa=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x4aa8[_0x13b8f3];return _0x1a6d06;};'use strict';var schema=require(_0x84aa('0x0'));var _=require(_0x84aa('0x1'));var util=require(_0x84aa('0x2'));var seqqueue=require(_0x84aa('0x3'));var moment=require(_0x84aa('0x4'));var Redis=require(_0x84aa('0x5'));var config=require(_0x84aa('0x6'));var logger=require(_0x84aa('0x7'))(_0x84aa('0x8'));var strategy=require('./strategy');config[_0x84aa('0x9')]=_['defaults'](config[_0x84aa('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x84aa('0xa'))(new Redis(config[_0x84aa('0x9')]));var attributes=['id',_0x84aa('0xb'),_0x84aa('0xc'),_0x84aa('0xd'),_0x84aa('0xe'),_0x84aa('0xf')];function emit(_0x29d0de,_0x5be19e,_0x3a3112){io['to'](_0x29d0de)[_0x84aa('0x10')](_0x5be19e,_0x3a3112);}function emitChannelQueueInteraction(_0x390609,_0x215853,_0x414f4c,_0x941091,_0x1bb363,_0x472a58,_0x3c43e2,_0x566a81){_0x414f4c[_0x84aa('0xb')]=_0x566a81;_0x414f4c[_0x84aa('0xd')]=_0x215853;_0x414f4c['account']=_0x941091;_0x414f4c['id']=_0x1bb363;if(_0x472a58){_0x3c43e2[util['format'](_0x84aa('0x11'),_0x390609)][_0x1bb363]=_[_0x84aa('0x12')](_0x414f4c,attributes);}else{delete _0x3c43e2[util['format'](_0x84aa('0x11'),_0x390609)][_0x1bb363];}emit(util[_0x84aa('0x13')](_0x84aa('0x14'),_0x390609,_0x215853),util[_0x84aa('0x13')]('%s_queue_waiting_interaction:%s',_0x390609,_0x472a58?_0x84aa('0x15'):_0x84aa('0x16')),_[_0x84aa('0x12')](_0x414f4c,attributes));}var rpc={'openchannelQueueReport':require(_0x84aa('0x17')),'mailQueueReport':require(_0x84aa('0x18')),'chatQueueReport':require(_0x84aa('0x19')),'smsQueueReport':require(_0x84aa('0x1a')),'faxQueueReport':require(_0x84aa('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x504b5f,_0x53842f,_0x292f03,_0x395bf8){if(_0x504b5f&&_0x53842f&&_0x292f03){_0x53842f[_0x84aa('0x1c')]+=0x1;var _0x2683bb={'uniqueid':_0x504b5f,'from':_0x292f03[_0x84aa('0x1d')]?_0x292f03[_0x84aa('0x1d')]['from']:'','joinAt':moment()[_0x84aa('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x292f03[_0x84aa('0x1e')]?_0x292f03[_0x84aa('0x1e')]['id']:null,'ListId':_0x292f03[_0x84aa('0x1f')]?_0x292f03[_0x84aa('0x1f')]['id']:null};_0x2683bb[_[_0x84aa('0x20')](_0x292f03['channel'])+_0x84aa('0x21')]=_0x53842f['id']||null;_0x2683bb[_[_0x84aa('0x20')](_0x292f03[_0x84aa('0x22')])+_0x84aa('0x23')]=_0x292f03[_0x84aa('0x24')]?_0x292f03['interaction']['id']:null;_0x2683bb[_[_0x84aa('0x20')](_0x292f03[_0x84aa('0x22')])+_0x84aa('0x25')]=_0x292f03[_0x84aa('0x26')]?_0x292f03['message']['id']:null;_0x2683bb[_[_0x84aa('0x20')](_0x292f03['channel'])+(_0x292f03[_0x84aa('0x22')]!==_0x84aa('0x27')?_0x84aa('0x28'):'WebsiteId')]=_0x292f03[_0x84aa('0xc')]?_0x292f03[_0x84aa('0xc')]['id']:null;logger[_0x84aa('0x29')](util[_0x84aa('0x13')](_0x84aa('0x2a'),_0x504b5f,_0x53842f[_0x84aa('0x2b')]));emitChannelQueueInteraction(_0x292f03[_0x84aa('0x22')],_0x53842f['name'],_0x2683bb,_0x292f03[_0x84aa('0xc')][_0x84aa('0x2b')],_0x292f03[_0x84aa('0x26')]['id'],!![],_0x395bf8,_0x53842f['id']);if(rpc[_0x292f03['channel']+_0x84aa('0x2c')]){return rpc[_0x292f03[_0x84aa('0x22')]+_0x84aa('0x2c')][_0x84aa('0x2d')](_0x2683bb)['catch'](function(_0x419a0b){logger[_0x84aa('0x2e')](_0x84aa('0x2f'));});}}}function stopRouting(_0x33219c,_0x52d20c,_0x4a302d,_0x1c8ceb){if(_0x33219c&&_0x52d20c){_0x52d20c['waiting']-=0x1;var _0x5c19ea={'leaveAt':moment()[_0x84aa('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x84aa('0x13')](_0x84aa('0x30')),'reason':'accepted'};logger[_0x84aa('0x29')](util['format'](_0x84aa('0x31'),_0x33219c,_0x52d20c[_0x84aa('0x2b')]));emitChannelQueueInteraction(_0x4a302d[_0x84aa('0x22')],_0x52d20c[_0x84aa('0x2b')],_0x4a302d[_0x84aa('0x1d')],_0x4a302d[_0x84aa('0xc')][_0x84aa('0x2b')],_0x4a302d[_0x84aa('0x26')]['id'],![],_0x1c8ceb,_0x52d20c['id']);if(rpc[_0x4a302d[_0x84aa('0x22')]+_0x84aa('0x2c')]){return rpc[_0x4a302d[_0x84aa('0x22')]+_0x84aa('0x2c')][_0x84aa('0x32')](_0x33219c,_0x5c19ea)['catch'](function(_0x42b6fb){logger[_0x84aa('0x2e')]('update\x20queue\x20report');});}}}function endRouting(_0x3ad071,_0x24cf9c,_0x579e22,_0x5a1e15){if(_0x3ad071&&_0x24cf9c){_0x24cf9c[_0x84aa('0x1c')]-=0x1;var _0xf79f06={'leaveAt':moment()[_0x84aa('0x13')](_0x84aa('0x30')),'exitAt':moment()[_0x84aa('0x13')](_0x84aa('0x30')),'reason':'timeout'};logger['info'](util[_0x84aa('0x13')](_0x84aa('0x33'),_0x3ad071,_0x24cf9c[_0x84aa('0x2b')]));emitChannelQueueInteraction(_0x579e22[_0x84aa('0x22')],_0x24cf9c[_0x84aa('0x2b')],_0x579e22[_0x84aa('0x1d')],_0x579e22['account']['name'],_0x579e22['message']['id'],![],_0x5a1e15);if(rpc[_0x579e22[_0x84aa('0x22')]+'QueueReport']){return rpc[_0x579e22[_0x84aa('0x22')]+_0x84aa('0x2c')][_0x84aa('0x32')](_0x3ad071,_0xf79f06)[_0x84aa('0x34')](function(_0x21357c){logger['error'](_0x84aa('0x35'));});}}}function handleFindQueue(_0x222f52){return function(_0x315bee){return _0x315bee[_0x84aa('0x2b')][_0x84aa('0x36')]()===_0x222f52[_0x84aa('0x36')]();};}exports[_0x84aa('0x37')]=function(_0x4dd606,_0x48dfd8,_0xfbe6d5,_0x46ef94){return function(_0x2bf740){try{var _0x568989={'name':_0x48dfd8[0x0],'timeout':_0x48dfd8[0x1]};var _0x809dd6=queue[_0x84aa('0x0')](_0x568989,{'typecast':!![]});if(_0x809dd6[_0x84aa('0x38')]){logger['error'](_0x84aa('0x39'),_0x4dd606,_[_0x84aa('0x3a')](_0x809dd6,_0x84aa('0x26'))[_0x84aa('0x3b')](',\x20'));_0x2bf740['stop']();}else{var _0x5a6090=_[_0x84aa('0x3c')](_0xfbe6d5[_0x46ef94[_0x84aa('0x22')]+_0x84aa('0x3d')],handleFindQueue(_0x568989[_0x84aa('0x2b')]));if(_0x5a6090){startRouting(_0x4dd606,_0x5a6090,_0x46ef94,_0xfbe6d5);var _0x4dae94=(_0x5a6090[_0x84aa('0x3e')]||0xa)*0x3e8;var _0x45e801=(_0x568989[_0x84aa('0x3e')]||0x14)*0x3e8;var _0xf93c1f,_0x5a33d9;if(_0x4dae94>_0x45e801){_0x45e801=_0x4dae94;}var _0x3201a9=seqqueue[_0x84aa('0x3f')](_0x4dae94);_0x3201a9['id']=_0x4dd606;_0x3201a9[_0x84aa('0x40')]=_0x4dae94;_0x3201a9[_0x84aa('0x41')]=_0x45e801;_0x3201a9['channel']=_0x46ef94[_0x84aa('0x22')];_0xfbe6d5[_0x84aa('0x42')][_0x4dd606]['on']('end',function(){stopRouting(_0x4dd606,_0x5a6090,_0x46ef94,_0xfbe6d5);_0x3201a9[_0x84aa('0x43')](!![]);clearTimeout(_0xf93c1f);_0xf93c1f=undefined;if(_0xfbe6d5[_0x84aa('0x42')][_0x4dd606]){delete _0xfbe6d5[_0x84aa('0x42')][_0x4dd606];}logger[_0x84aa('0x29')](_0x84aa('0x44'),_0x4dd606);_0x2bf740[_0x84aa('0x45')]();});_0xf93c1f=setTimeout(function(){endRouting(_0x4dd606,_0x5a6090,_0x46ef94,_0xfbe6d5);clearTimeout(_0xf93c1f);_0x3201a9[_0x84aa('0x43')](!![]);logger[_0x84aa('0x29')](_0x84aa('0x46'),_0x4dd606);_0x2bf740[_0x84aa('0x47')]();},_0x45e801);switch(_0x5a6090['strategy']){case _0x84aa('0x48'):strategy['rrmemory'](_0x3201a9,_0x5a6090,_0xfbe6d5,_0x46ef94);break;default:strategy[_0x84aa('0x49')](_0x3201a9,_0x5a6090,_0xfbe6d5,_0x46ef94);}}else{logger[_0x84aa('0x2e')](_0x84aa('0x4a'),_0x4dd606,_0x568989[_0x84aa('0x2b')]);_0x2bf740[_0x84aa('0x45')]();}}}catch(_0x45c977){console[_0x84aa('0x4b')](_0x45c977);logger[_0x84aa('0x2e')](_0x84aa('0x39'),_0x4dd606,_0x45c977[_0x84aa('0x4c')]);_0x2bf740['stop']();}};}; \ 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 d3c4ad1..d54eb98 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 _0x8339=['isNil','agents','forcedOwnership','isAgentAvailable','channel','busyQueue','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busy','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','handleRun','bind','handleTimeout','drained','handleDrained','push','prototype','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x2e2543,_0x2405c5){var _0x4b70a1=function(_0x1b35fa){while(--_0x1b35fa){_0x2e2543['push'](_0x2e2543['shift']());}};_0x4b70a1(++_0x2405c5);}(_0x8339,0x77));var _0x9833=function(_0x487cb0,_0x339d3e){_0x487cb0=_0x487cb0-0x0;var _0x5a8047=_0x8339[_0x487cb0];return _0x5a8047;};'use strict';var _=require('lodash');var uuid=require(_0x9833('0x0'));var util=require(_0x9833('0x1'));var logger=require(_0x9833('0x2'))('routing');var Agent=function(_0x12c97b,_0x4e4658,_0xb87dea,_0x2a657b){this[_0x9833('0x3')]=uuid['v4']();this[_0x9833('0x4')]=_0x12c97b;this[_0x9833('0x5')]=_0x4e4658;this[_0x9833('0x6')]=_0xb87dea;this[_0x9833('0x7')]=_0x2a657b;this[_0x9833('0x4')]['push'](this[_0x9833('0x8')][_0x9833('0x9')](this),this[_0x9833('0xa')][_0x9833('0x9')](this));this[_0x9833('0x4')]['on']('timeout',this[_0x9833('0xa')]['bind'](this));this[_0x9833('0x4')]['on'](_0x9833('0xb'),this[_0x9833('0xc')][_0x9833('0x9')](this));};Agent['prototype'][_0x9833('0xd')]=function(){this[_0x9833('0x4')][_0x9833('0xd')](this[_0x9833('0x8')][_0x9833('0x9')](this),this[_0x9833('0xa')][_0x9833('0x9')](this));};Agent['prototype'][_0x9833('0xc')]=function(){this[_0x9833('0xa')](!![]);};Agent[_0x9833('0xe')][_0x9833('0x8')]=function(_0x31dfc1){logger[_0x9833('0xf')](_0x9833('0x10'),this['squeue']['id'],this[_0x9833('0x5')]['id']);if(_[_0x9833('0x11')](this[_0x9833('0x6')][_0x9833('0x12')][this['agent']['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x9833('0x5')]['id']);setTimeout(this[_0x9833('0xd')]['bind'](this),0x3e8);}else{if(this[_0x9833('0x7')][_0x9833('0x13')]||util[_0x9833('0x14')](this['squeue']['id'],this[_0x9833('0x6')]['agents'][this[_0x9833('0x5')]['id']],this[_0x9833('0x4')][_0x9833('0x15')],![])){this['realtime'][_0x9833('0x12')][this[_0x9833('0x5')]['id']]['busy']=!![];this[_0x9833('0x6')][_0x9833('0x12')][this['agent']['id']][_0x9833('0x16')]=undefined;util[_0x9833('0x17')](this[_0x9833('0x3')],this[_0x9833('0x4')]['id'],this['realtime']['agents'][this[_0x9833('0x5')]['id']],null,this[_0x9833('0x7')]);util['writeLog'](this[_0x9833('0x4')]['id'],this['realtime'][_0x9833('0x12')][this[_0x9833('0x5')]['id']],_0x9833('0x18')+(this[_0x9833('0x7')][_0x9833('0x13')]?_0x9833('0x19'):''));}else{logger['info'](_0x9833('0x1a'),this['squeue']['id'],this[_0x9833('0x5')]['id']);setTimeout(this[_0x9833('0xd')][_0x9833('0x9')](this),0x3e8);}}};Agent[_0x9833('0xe')]['handleTimeout']=function(_0x4c29e7){if(_[_0x9833('0x11')](this[_0x9833('0x6')][_0x9833('0x12')][this[_0x9833('0x5')]['id']])){return logger[_0x9833('0xf')](_0x9833('0x1b'),this['squeue']['id'],this[_0x9833('0x5')]['id']);}else{logger[_0x9833('0xf')](_0x9833('0x1c'),this['squeue']['id'],this[_0x9833('0x5')]['id']);util['hideNotification'](this[_0x9833('0x3')],this['squeue']['id'],this['realtime'][_0x9833('0x12')][this['agent']['id']],null,this[_0x9833('0x7')]);this[_0x9833('0x6')][_0x9833('0x12')][this[_0x9833('0x5')]['id']][_0x9833('0x1d')]=![];this[_0x9833('0x6')][_0x9833('0x12')][this[_0x9833('0x5')]['id']][_0x9833('0x16')]=undefined;util[_0x9833('0x1e')](this[_0x9833('0x4')]['id'],this['realtime'][_0x9833('0x12')][this[_0x9833('0x5')]['id']],_0x4c29e7?_0x9833('0x1f'):_0x9833('0x20'));}if(!_0x4c29e7){setTimeout(this[_0x9833('0xd')][_0x9833('0x9')](this),0x3e8);}};function agent(_0x393be0,_0x2ffcc3,_0x4a4f17,_0x152275){return new Agent(_0x393be0,_0x2ffcc3,_0x4a4f17,_0x152275);}module[_0x9833('0x21')]=agent; \ No newline at end of file +var _0xbbb5=['squeue','agent','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','handleRun','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports','lodash','./util','routing','notificationId'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbbb5,0x1ae));var _0x5bbb=function(_0x11db2b,_0xab8a36){_0x11db2b=_0x11db2b-0x0;var _0x3dfdcd=_0xbbb5[_0x11db2b];return _0x3dfdcd;};'use strict';var _=require(_0x5bbb('0x0'));var uuid=require('uuid');var util=require(_0x5bbb('0x1'));var logger=require('../../../../../config/logger')(_0x5bbb('0x2'));var Agent=function(_0x56ceff,_0x2ef93a,_0x299fd0,_0x4b855d){this[_0x5bbb('0x3')]=uuid['v4']();this[_0x5bbb('0x4')]=_0x56ceff;this[_0x5bbb('0x5')]=_0x2ef93a;this[_0x5bbb('0x6')]=_0x299fd0;this['routing']=_0x4b855d;this[_0x5bbb('0x4')][_0x5bbb('0x7')](this['handleRun'][_0x5bbb('0x8')](this),this[_0x5bbb('0x9')][_0x5bbb('0x8')](this));this[_0x5bbb('0x4')]['on'](_0x5bbb('0xa'),this[_0x5bbb('0x9')][_0x5bbb('0x8')](this));this[_0x5bbb('0x4')]['on'](_0x5bbb('0xb'),this[_0x5bbb('0xc')][_0x5bbb('0x8')](this));};Agent['prototype'][_0x5bbb('0x7')]=function(){this[_0x5bbb('0x4')][_0x5bbb('0x7')](this[_0x5bbb('0xd')]['bind'](this),this[_0x5bbb('0x9')][_0x5bbb('0x8')](this));};Agent['prototype'][_0x5bbb('0xc')]=function(){this[_0x5bbb('0x9')](!![]);};Agent[_0x5bbb('0xe')][_0x5bbb('0xd')]=function(_0x541062){logger[_0x5bbb('0xf')](_0x5bbb('0x10'),this[_0x5bbb('0x4')]['id'],this[_0x5bbb('0x5')]['id']);if(_[_0x5bbb('0x11')](this['realtime'][_0x5bbb('0x12')][this[_0x5bbb('0x5')]['id']])){logger[_0x5bbb('0xf')](_0x5bbb('0x13'),this[_0x5bbb('0x4')]['id'],this[_0x5bbb('0x5')]['id']);setTimeout(this['push'][_0x5bbb('0x8')](this),0x3e8);}else{if(this[_0x5bbb('0x2')]['forcedOwnership']||util['isAgentAvailable'](this[_0x5bbb('0x4')]['id'],this[_0x5bbb('0x6')][_0x5bbb('0x12')][this['agent']['id']],this[_0x5bbb('0x4')]['channel'],![])){this[_0x5bbb('0x6')]['agents'][this[_0x5bbb('0x5')]['id']][_0x5bbb('0x14')]=!![];this[_0x5bbb('0x6')]['agents'][this[_0x5bbb('0x5')]['id']]['busyQueue']=undefined;util[_0x5bbb('0x15')](this[_0x5bbb('0x3')],this[_0x5bbb('0x4')]['id'],this[_0x5bbb('0x6')][_0x5bbb('0x12')][this[_0x5bbb('0x5')]['id']],null,this['routing']);util[_0x5bbb('0x16')](this[_0x5bbb('0x4')]['id'],this['realtime'][_0x5bbb('0x12')][this[_0x5bbb('0x5')]['id']],_0x5bbb('0x17')+(this[_0x5bbb('0x2')]['forcedOwnership']?':FORCED':''));}else{logger['info'](_0x5bbb('0x18'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x5bbb('0x7')][_0x5bbb('0x8')](this),0x3e8);}}};Agent[_0x5bbb('0xe')][_0x5bbb('0x9')]=function(_0x39571e){if(_[_0x5bbb('0x11')](this[_0x5bbb('0x6')][_0x5bbb('0x12')][this['agent']['id']])){return logger[_0x5bbb('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5bbb('0x4')]['id'],this['agent']['id']);}else{logger[_0x5bbb('0xf')](_0x5bbb('0x19'),this[_0x5bbb('0x4')]['id'],this['agent']['id']);util[_0x5bbb('0x1a')](this['notificationId'],this[_0x5bbb('0x4')]['id'],this[_0x5bbb('0x6')][_0x5bbb('0x12')][this[_0x5bbb('0x5')]['id']],null,this[_0x5bbb('0x2')]);this[_0x5bbb('0x6')][_0x5bbb('0x12')][this[_0x5bbb('0x5')]['id']]['busy']=![];this[_0x5bbb('0x6')]['agents'][this[_0x5bbb('0x5')]['id']][_0x5bbb('0x1b')]=undefined;util[_0x5bbb('0x16')](this['squeue']['id'],this[_0x5bbb('0x6')][_0x5bbb('0x12')][this[_0x5bbb('0x5')]['id']],_0x39571e?_0x5bbb('0x1c'):_0x5bbb('0x1d'));}if(!_0x39571e){setTimeout(this['push'][_0x5bbb('0x8')](this),0x3e8);}};function agent(_0x4c7b32,_0x4c58be,_0x3697c6,_0x52d1ac){return new Agent(_0x4c7b32,_0x4c58be,_0x3697c6,_0x52d1ac);}module[_0x5bbb('0x1e')]=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 54a040b..2fd1aa0 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 _0x3341=['squeue','handleRun','bind','handleTimeout','drained','handleDrained','prototype','push','queue','Agents','length','isNil','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','realtime'];(function(_0xce50ab,_0x4c503b){var _0x9432bb=function(_0x4827e7){while(--_0x4827e7){_0xce50ab['push'](_0xce50ab['shift']());}};_0x9432bb(++_0x4c503b);}(_0x3341,0x191));var _0x1334=function(_0x3e03b7,_0x39123e){_0x3e03b7=_0x3e03b7-0x0;var _0x1b8671=_0x3341[_0x3e03b7];return _0x1b8671;};'use strict';var _=require(_0x1334('0x0'));var uuid=require(_0x1334('0x1'));var util=require(_0x1334('0x2'));var logger=require(_0x1334('0x3'))(_0x1334('0x4'));var Beepall=function(_0x51c638,_0x2e79bf,_0x2c2131,_0x4ddc00){this[_0x1334('0x5')]=uuid['v4']();this['squeue']=_0x51c638;this['queue']=_0x2e79bf;this[_0x1334('0x6')]=_0x2c2131;this[_0x1334('0x4')]=_0x4ddc00;this[_0x1334('0x7')]['push'](this[_0x1334('0x8')][_0x1334('0x9')](this),this[_0x1334('0xa')][_0x1334('0x9')](this));this[_0x1334('0x7')]['on']('timeout',this[_0x1334('0xa')][_0x1334('0x9')](this));this['squeue']['on'](_0x1334('0xb'),this[_0x1334('0xc')][_0x1334('0x9')](this));};Beepall[_0x1334('0xd')][_0x1334('0xe')]=function(){this[_0x1334('0x7')][_0x1334('0xe')](this[_0x1334('0x8')][_0x1334('0x9')](this),this['handleTimeout'][_0x1334('0x9')](this));};Beepall[_0x1334('0xd')][_0x1334('0xc')]=function(_0x24afe3){this[_0x1334('0xa')](!![]);};Beepall[_0x1334('0xd')][_0x1334('0x8')]=function(_0x195cd6){var _0xd65348=!![];if(!_['isNil'](this[_0x1334('0xf')])&&!_['isNil'](this[_0x1334('0xf')][_0x1334('0x10')])&&this[_0x1334('0xf')][_0x1334('0x10')][_0x1334('0x11')]>0x0){for(var _0x15a2a3=0x0,_0x668c9d;_0x15a2a30x0){for(var _0x5a0dfa=0x0,_0x2b7450;_0x5a0dfa0x0&&_0x2d2a0a[_0x52d0a4+_0xcdf8('0x23')]>=_0x2d2a0a[_0x52d0a4+_0xcdf8('0x22')]){writeLog(_0x473953,_0x2d2a0a,_0x52d0a4[_0xcdf8('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xcdf8('0x25')]=function(_0x3d7e74,_0x57c992,_0x3a8b88,_0x21666a,_0xb38dbd){return sendNotification(!![],_0x3d7e74,_0x57c992,_0x3a8b88,_0x21666a,_0xb38dbd);};exports[_0xcdf8('0x26')]=function(_0x3174e7,_0x242e93,_0x4c0aca,_0x44278a,_0x458f86){return sendNotification(![],_0x3174e7,_0x242e93,_0x4c0aca,_0x44278a,_0x458f86);};exports[_0xcdf8('0x27')]=writeLog; \ No newline at end of file +var _0x105c=['user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','message','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','online','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','util','../utils','mustache','ioredis','routing','defaults','redis','localhost','socket.io-emitter','emit','format','user:%s','name'];(function(_0xa85ba9,_0x253f24){var _0x18ced4=function(_0x307414){while(--_0x307414){_0xa85ba9['push'](_0xa85ba9['shift']());}};_0x18ced4(++_0x253f24);}(_0x105c,0x87));var _0xc105=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x105c[_0x532112];return _0x23e5fb;};'use strict';var _=require('lodash');var util=require(_0xc105('0x0'));var utils=require(_0xc105('0x1'));var Mustache=require(_0xc105('0x2'));var Redis=require(_0xc105('0x3'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0xc105('0x4'));config['redis']=_[_0xc105('0x5')](config[_0xc105('0x6')],{'host':_0xc105('0x7'),'port':0x18eb});var io=require(_0xc105('0x8'))(new Redis(config[_0xc105('0x6')]));function emit(_0xb5647b,_0x490941,_0x207dd9){io['to'](_0xb5647b)[_0xc105('0x9')](_0x490941,_0x207dd9);}function sendNotification(_0x1d1ba1,_0x1c2f8d,_0x4fd781,_0x53dc87,_0x5f58ce,_0x2d0d17){io['to'](util[_0xc105('0xa')](_0xc105('0xb'),_0x53dc87[_0xc105('0xc')]))[_0xc105('0x9')](_0xc105('0xd'),_0x53dc87);var _0x38af17=_0x2d0d17||{};var _0x1db2a2=_0x4fd781['split']('.');var _0x3d9a03={'uniqueid':_0x1c2f8d,'channel':_0x1db2a2[0x0],'id':_0x1db2a2[0x1],'title':_0x1db2a2[0x0]+_0xc105('0xe'),'interactionId':_0x1db2a2[0x2],'queue':_0x5f58ce?_0x5f58ce[_0xc105('0xc')]:null,'sound':_0x38af17[_0xc105('0xf')][_0xc105('0x10')],'shake':_0x38af17[_0xc105('0xf')][_0xc105('0x11')]};try{if(!_0x38af17['body']){_0x38af17[_0xc105('0x12')]={};}if(_0x5f58ce){_0x38af17[_0xc105('0x12')][_0xc105('0x13')]=_0x5f58ce;}else if(_0x38af17[_0xc105('0x12')]['queue']){delete _0x38af17[_0xc105('0x12')][_0xc105('0x13')];}_0x3d9a03['msg']=utils[_0xc105('0x14')](_0x38af17[_0xc105('0xf')][_0xc105('0x15')],_0x38af17);}catch(_0x7d6199){_0x3d9a03['msg']='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0xc105('0xa')]('[%s][QUEUE]\x20%s',_0x1c2f8d,_0x7d6199[_0xc105('0x16')]));}io['to'](util[_0xc105('0xa')](_0xc105('0xb'),_0x53dc87['name']))['emit'](util[_0xc105('0xa')](_0xc105('0x17'),_0x1d1ba1?_0xc105('0x18'):_0xc105('0x19')),_0x3d9a03);}function writeLog(_0x280bb5,_0x2c96a3,_0x48c4f2){return logger['info'](util['format'](_0xc105('0x1a'),_0x280bb5,_0x2c96a3[_0xc105('0xc')],_0x48c4f2));}exports[_0xc105('0x1b')]=function(_0x149a06,_0x430ead,_0x52d43b,_0x168d8b){if(_0x430ead['busy']){writeLog(_0x149a06,_0x430ead,'BUSY');return![];}if(!_0x430ead[_0xc105('0x1c')]){writeLog(_0x149a06,_0x430ead,'OFFLINE');return![];}if(_0x430ead[_0x52d43b+_0xc105('0x1d')]){writeLog(_0x149a06,_0x430ead,'PAUSE');return![];}if(_0x168d8b&&_0x430ead[_0xc105('0x1e')](_0x52d43b+_0xc105('0x1f'))&&_0x430ead[_0xc105('0x1e')](_0x52d43b+_0xc105('0x20'))){if(_0x430ead[_0x52d43b+'Capacity']>0x0&&_0x430ead[_0x52d43b+_0xc105('0x20')]>=_0x430ead[_0x52d43b+_0xc105('0x1f')]){writeLog(_0x149a06,_0x430ead,_0x52d43b[_0xc105('0x21')]()+_0xc105('0x22'));return![];}}return!![];};exports[_0xc105('0x23')]=function(_0x190e29,_0x340cd9,_0x1e52b8,_0x26dd4c,_0xf1e15e){return sendNotification(!![],_0x190e29,_0x340cd9,_0x1e52b8,_0x26dd4c,_0xf1e15e);};exports['hideNotification']=function(_0x1c0bb5,_0x37ac4c,_0x35eb82,_0xedd407,_0x476982){return sendNotification(![],_0x1c0bb5,_0x37ac4c,_0x35eb82,_0xedd407,_0x476982);};exports[_0xc105('0x24')]=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 fbe9371..3144595 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 _0x7cf1=['[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20%s','isObject','./utils','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim'];(function(_0x24c105,_0x7ad441){var _0x320381=function(_0x382ca3){while(--_0x382ca3){_0x24c105['push'](_0x24c105['shift']());}};_0x320381(++_0x7ad441);}(_0x7cf1,0x84));var _0x17cf=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x7cf1[_0x4b91c4];return _0x25cb80;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0x17cf('0x0'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x17cf('0x1'),'required':!![],'message':_0x17cf('0x2')}});exports[_0x17cf('0x3')]=function(_0x1409d2,_0x55bac3){return function(_0x355482){try{var _0x225352={'command':_0x55bac3[0x0]};var _0x33fc18=system[_0x17cf('0x4')](_0x225352,{'typecast':!![]});if(_0x33fc18[_0x17cf('0x5')]){logger['error']('[%s][SYSTEM]\x20%s',_0x1409d2,_[_0x17cf('0x6')](_0x33fc18,'message')[_0x17cf('0x7')](',\x20'));logger[_0x17cf('0x8')](_0x17cf('0x9'),_0x1409d2);_0x355482[_0x17cf('0xa')]();}else{var _0x1eb1bc=this;var _0x23aa0b=utils[_0x17cf('0xb')](_0x55bac3[0x0],this);logger[_0x17cf('0x8')](_0x17cf('0xc'),_0x1409d2,_0x23aa0b);sh[_0x17cf('0xd')](_[_0x17cf('0xe')](_0x23aa0b),function(_0x19b1f7,_0x16e5d3){logger[_0x17cf('0x8')](_0x17cf('0xf'),_0x1409d2,_0x19b1f7);if(_0x19b1f7==0x0){var _0x4ee842=_0x16e5d3[_0x17cf('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x17cf('0x11')](_0x55bac3[0x1])||_['isEmpty'](_0x55bac3[0x1])){logger[_0x17cf('0x8')](_0x17cf('0x12'),_0x1409d2);_0x1eb1bc['body'][_0x55bac3[0x1]]=_0x4ee842;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x1409d2,_0x55bac3[0x1],_0x4ee842);_0x1eb1bc['body'][_0x55bac3[0x1]]=_0x4ee842;}}_0x355482[_0x17cf('0xa')]();});}}catch(_0x1fbcfc){logger['error'](_0x17cf('0x13'),_0x1409d2,_[_0x17cf('0x14')](_0x1fbcfc)?JSON['stringify'](_0x1fbcfc):_0x1fbcfc);logger['info'](_0x17cf('0x9'),_0x1409d2);_0x355482[_0x17cf('0xa')]();}};}; \ No newline at end of file +var _0x0e4b=['next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x1a5cf0,_0x5705b6){var _0x3a89a3=function(_0x4514fc){while(--_0x4514fc){_0x1a5cf0['push'](_0x1a5cf0['shift']());}};_0x3a89a3(++_0x5705b6);}(_0x0e4b,0xc2));var _0xb0e4=function(_0x473220,_0x1712d6){_0x473220=_0x473220-0x0;var _0x332360=_0x0e4b[_0x473220];return _0x332360;};'use strict';var schema=require(_0xb0e4('0x0'));var sh=require(_0xb0e4('0x1'));var _=require(_0xb0e4('0x2'));var utils=require('./utils');var logger=require(_0xb0e4('0x3'))('routing');var system=schema({'command':{'type':_0xb0e4('0x4'),'required':!![],'message':_0xb0e4('0x5')}});exports[_0xb0e4('0x6')]=function(_0x247f0b,_0x1d008b){return function(_0x126a9b){try{var _0x25b936={'command':_0x1d008b[0x0]};var _0x4d4068=system[_0xb0e4('0x0')](_0x25b936,{'typecast':!![]});if(_0x4d4068[_0xb0e4('0x7')]){logger[_0xb0e4('0x8')](_0xb0e4('0x9'),_0x247f0b,_[_0xb0e4('0xa')](_0x4d4068,'message')['join'](',\x20'));logger[_0xb0e4('0xb')](_0xb0e4('0xc'),_0x247f0b);_0x126a9b[_0xb0e4('0xd')]();}else{var _0x4721be=this;var _0x2c43e1=utils['getMustacheRender'](_0x1d008b[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x247f0b,_0x2c43e1);sh[_0xb0e4('0xe')](_[_0xb0e4('0xf')](_0x2c43e1),function(_0x1243ab,_0x439198){logger[_0xb0e4('0xb')](_0xb0e4('0x10'),_0x247f0b,_0x1243ab);if(_0x1243ab==0x0){var _0x456d81=_0x439198['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xb0e4('0x11')](_0x1d008b[0x1])||_[_0xb0e4('0x12')](_0x1d008b[0x1])){logger[_0xb0e4('0xb')](_0xb0e4('0x13'),_0x247f0b);_0x4721be[_0xb0e4('0x14')][_0x1d008b[0x1]]=_0x456d81;}else{logger[_0xb0e4('0xb')](_0xb0e4('0x15'),_0x247f0b,_0x1d008b[0x1],_0x456d81);_0x4721be[_0xb0e4('0x14')][_0x1d008b[0x1]]=_0x456d81;}}_0x126a9b['next']();});}}catch(_0x2e7bac){logger[_0xb0e4('0x8')](_0xb0e4('0x9'),_0x247f0b,_[_0xb0e4('0x16')](_0x2e7bac)?JSON['stringify'](_0x2e7bac):_0x2e7bac);logger['info'](_0xb0e4('0xc'),_0x247f0b);_0x126a9b[_0xb0e4('0xd')]();}};}; \ 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 03f39a5..2890dca 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x2824b4,_0x10c188){var _0x1e645a=function(_0x3e6669){while(--_0x3e6669){_0x2824b4['push'](_0x2824b4['shift']());}};_0x1e645a(++_0x10c188);}(_0x7a54,0x106));var _0x47a5=function(_0x1a7330,_0xf5fa5){_0x1a7330=_0x1a7330-0x0;var _0x518861=_0x7a54[_0x1a7330];return _0x518861;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x49bca7,_0x1b5e3d){var _0x44ba48=function(_0x336e6e){while(--_0x336e6e){_0x49bca7['push'](_0x49bca7['shift']());}};_0x44ba48(++_0x1b5e3d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 69356d8..b63f537 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 _0xa631=['lodash','exports','render','contact','message','account'];(function(_0x13d33f,_0x23da7a){var _0x277b35=function(_0x276f1b){while(--_0x276f1b){_0x13d33f['push'](_0x13d33f['shift']());}};_0x277b35(++_0x23da7a);}(_0xa631,0xe4));var _0x1a63=function(_0x5781c6,_0x316a39){_0x5781c6=_0x5781c6-0x0;var _0x49c9ca=_0xa631[_0x5781c6];return _0x49c9ca;};'use strict';var Mustache=require('mustache');var _=require(_0x1a63('0x0'));module[_0x1a63('0x1')]={'getMustacheRender':function(_0x17d7a7,_0x53c6fb){return Mustache[_0x1a63('0x2')](_0x17d7a7,_['merge'](_0x53c6fb['body'],{'contact':_0x53c6fb[_0x1a63('0x3')],'message':_0x53c6fb[_0x1a63('0x4')],'account':_0x53c6fb[_0x1a63('0x5')],'interaction':_0x53c6fb['interaction'],'list':_0x53c6fb['list']}))||'';}}; \ No newline at end of file +var _0x04d0=['interaction','list','exports','render','merge','message'];(function(_0x5a15b9,_0x21cf09){var _0x3c4c6f=function(_0x21fe80){while(--_0x21fe80){_0x5a15b9['push'](_0x5a15b9['shift']());}};_0x3c4c6f(++_0x21cf09);}(_0x04d0,0x10a));var _0x004d=function(_0x4e4dd2,_0x1ea8e3){_0x4e4dd2=_0x4e4dd2-0x0;var _0x34a74a=_0x04d0[_0x4e4dd2];return _0x34a74a;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x004d('0x0')]={'getMustacheRender':function(_0x16bda9,_0x421661){return Mustache[_0x004d('0x1')](_0x16bda9,_[_0x004d('0x2')](_0x421661['body'],{'contact':_0x421661['contact'],'message':_0x421661[_0x004d('0x3')],'account':_0x421661['account'],'interaction':_0x421661[_0x004d('0x4')],'list':_0x421661[_0x004d('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 36225ae..6cdb2de 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 _0x1640=['RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','tag','TagId','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','interaction','QueueReport','update','message\x20is\x20empty','agent','agents','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!'];(function(_0x36e95b,_0x2a377c){var _0x2f802d=function(_0x67ec4c){while(--_0x67ec4c){_0x36e95b['push'](_0x36e95b['shift']());}};_0x2f802d(++_0x2a377c);}(_0x1640,0x112));var _0x0164=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x1640[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x0164('0x0'));var util=require(_0x0164('0x1'));var path=require(_0x0164('0x2'));var fs=require('fs');var jayson=require(_0x0164('0x3'));var BPromise=require(_0x0164('0x4'));var uuid=require(_0x0164('0x5'));var config=require(_0x0164('0x6'));var logger=require(_0x0164('0x7'))(_0x0164('0x8'));var rpc={'openchannelQueueReport':require(_0x0164('0x9'))};var rpc={'openchannelQueueReport':require(_0x0164('0x9')),'mailQueueReport':require(_0x0164('0xa')),'chatQueueReport':require(_0x0164('0xb')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x0164('0xc'))};var RuleEngine=require(_0x0164('0xd'));function getId(_0x31bff2,_0x1ed84f,_0x104169){return util[_0x0164('0xe')](_0x0164('0xf'),_0x31bff2,_0x1ed84f||0x0,_0x104169||0x0);}function getIntervals(_0x3235ae,_0x2616e5){var _0xad238f=[];if(!_['isNil'](_0x2616e5[_0x0164('0x10')])&&!_[_0x0164('0x11')](_0x3235ae[_0x2616e5[_0x0164('0x10')]])&&!_[_0x0164('0x11')](_0x3235ae[_0x2616e5[_0x0164('0x10')]][_0x0164('0x12')])){_0xad238f=_[_0x0164('0x13')](_0x3235ae[_0x2616e5['IntervalId']][_0x0164('0x12')],_0x0164('0x14'));}else if(!_[_0x0164('0x11')](_0x2616e5[_0x0164('0x14')])){_0xad238f=[_0x2616e5[_0x0164('0x14')]];}return _0xad238f;}exports[_0x0164('0x15')]=function(_0x36b0f4){_0x36b0f4[_0x0164('0x16')]={};return new BPromise(function(_0x603982,_0x24a3e5){var _0x555fc9={'Start':function(_0x3d1dfb){var _0x1469f8=this;return new Promise(function(_0x231d49,_0x802216){if(_0x3d1dfb){try{var _0x2d28f3=[];var _0x2587d5=getId(_0x3d1dfb[_0x0164('0x17')],_0x3d1dfb[_0x0164('0x18')]?_0x3d1dfb[_0x0164('0x18')]['id']:0x0,_0x3d1dfb['interaction']?_0x3d1dfb['interaction']['id']:0x0);if(_0x3d1dfb[_0x0164('0x19')]&&_[_0x0164('0x1a')](_0x3d1dfb[_0x0164('0x19')])&&_0x3d1dfb['applications'][_0x0164('0x1b')]){for(var _0xb551b9=0x0;_0xb551b9<_0x3d1dfb[_0x0164('0x19')][_0x0164('0x1b')];_0xb551b9+=0x1){var _0x59f754=_0x3d1dfb[_0x0164('0x19')][_0xb551b9];if(fs['existsSync'](path[_0x0164('0x1c')](__dirname,_0x0164('0x19'),_0x59f754[_0x0164('0x1d')]+_0x0164('0x1e')))){var _0x32d7fc=[];switch(_0x59f754['app'][_0x0164('0x1f')]()){case _0x0164('0x20'):var _0x199801=_0x59f754[_0x0164('0x21')][_0x0164('0x22')](',');_0x32d7fc[_0x0164('0x23')](_0x199801[0x0]);_0x32d7fc[_0x0164('0x23')](_0x199801[_0x0164('0x24')](0x1,_0x199801[_0x0164('0x1b')])[_0x0164('0x1c')](','));break;case _0x0164('0x25'):var _0x199801=_0x59f754[_0x0164('0x21')][_0x0164('0x22')](',');_0x32d7fc['push'](_0x199801[0x0]);_0x32d7fc['push'](_0x199801[0x1]);_0x32d7fc[_0x0164('0x23')](_0x199801[_0x0164('0x24')](0x2,_0x199801[_0x0164('0x1b')])['join'](','));break;case'amazonlex':var _0x199801=_0x59f754[_0x0164('0x21')][_0x0164('0x22')](',');_0x32d7fc[_0x0164('0x23')](_0x199801[0x0]);_0x32d7fc['push'](_0x199801[0x1]);_0x32d7fc[_0x0164('0x23')](_0x199801[0x2]);_0x32d7fc['push'](_0x199801[0x3]);_0x32d7fc[_0x0164('0x23')](_0x199801[_0x0164('0x24')](0x4,_0x199801[_0x0164('0x1b')])['join'](','));break;case _0x0164('0x18'):_0x32d7fc['push'](_0x59f754[_0x0164('0x21')]);break;case _0x0164('0x26'):_0x32d7fc[_0x0164('0x23')](_0x59f754[_0x0164('0x27')]);_0x32d7fc[_0x0164('0x23')](_0x59f754['appdata']);break;default:_0x32d7fc=_[_0x0164('0x11')](_0x59f754[_0x0164('0x21')])?[]:_0x59f754['appdata'][_0x0164('0x22')](',');}var _0x1010c7={'id':util[_0x0164('0xe')]('%s:%s:%s',_0x2587d5,_0x59f754['id'],_0x59f754[_0x0164('0x1d')]),'condition':require('./interval')[_0x0164('0x28')](_0x2587d5,getIntervals(_0x36b0f4[_0x0164('0x29')],_0x59f754),_0x36b0f4),'consequence':require(_0x0164('0x2a')+_0x59f754[_0x0164('0x1d')])[_0x0164('0x2b')](_0x2587d5,_0x32d7fc,_0x36b0f4,_0x3d1dfb),'p':_0x59f754[_0x0164('0x2c')]||0x0};logger[_0x0164('0x2d')](_0x0164('0x2e'),_0x1010c7['id'],'on\x20interval',getIntervals(_0x36b0f4[_0x0164('0x29')],_0x59f754)[_0x0164('0x1c')]('\x20|\x20'));_0x2d28f3[_0x0164('0x23')](_0x1010c7);}else{logger['error'](_0x0164('0x2f'),path[_0x0164('0x1c')](__dirname,_0x0164('0x19'),_0x59f754[_0x0164('0x1d')]+_0x0164('0x1e')));}}_0x36b0f4['rules'][_0x2587d5]=new RuleEngine(_0x2d28f3);_0x36b0f4[_0x0164('0x16')][_0x2587d5][_0x0164('0x30')](_0x3d1dfb,function(_0x17ff82){logger[_0x0164('0x2d')]('Applications\x20executed',JSON[_0x0164('0x31')](_0x17ff82[_0x0164('0x32')]));if(_0x36b0f4[_0x0164('0x16')][_0x2587d5]){_0x36b0f4[_0x0164('0x16')][_0x2587d5][_0x0164('0x33')](_0x0164('0x34'));}});return _0x231d49({'code':0xc8,'message':_0x3d1dfb});}else{logger[_0x0164('0x2d')](_0x0164('0x35'));return _0x231d49({'code':0xc8,'message':_0x3d1dfb});}}catch(_0x4fc087){logger[_0x0164('0x36')](_0x4fc087[_0x0164('0x37')]);return _0x802216(_0x1469f8[_0x0164('0x36')](0x1f4,_0x4fc087));}}return _0x802216(_0x0164('0x38'));});},'AcceptMessage':function(_0x419e9b){var _0x189b3b=this;return new Promise(function(_0x163297,_0x597d57){if(_0x419e9b[_0x0164('0x18')]&&_0x419e9b['message']['id']){try{var _0x345364=getId(_0x419e9b['channel'],_0x419e9b[_0x0164('0x18')]?_0x419e9b[_0x0164('0x18')]['id']:0x0,_0x419e9b[_0x0164('0x39')]?_0x419e9b[_0x0164('0x39')]['id']:0x0);if(_0x36b0f4[_0x0164('0x16')][_0x345364]){_0x36b0f4[_0x0164('0x16')][_0x345364][_0x0164('0x33')](_0x0164('0x34'));if(rpc[_0x419e9b[_0x0164('0x17')]+_0x0164('0x3a')]){rpc[_0x419e9b[_0x0164('0x17')]+_0x0164('0x3a')][_0x0164('0x3b')](_0x345364,{'UserId':_0x419e9b[_0x0164('0x18')]['UserId']})['catch'](function(_0x257501){logger['error']('error\x20update\x20queue\x20report');});}}return _0x163297({'code':0xc8,'message':_0x419e9b});}catch(_0xfc933e){logger['error'](_0xfc933e['stack']);return _0x597d57(_0x189b3b[_0x0164('0x36')](0x1f4,_0xfc933e));}}logger[_0x0164('0x36')]('message\x20is\x20empty');return _0x597d57(_0x189b3b[_0x0164('0x36')](0x1f4,_0x0164('0x3c')));});},'RejectMessage':function(_0x39f7fb){var _0x192437=this;return new Promise(function(_0x31f075,_0x97377b){if(_0x39f7fb[_0x0164('0x3d')]&&_0x39f7fb[_0x0164('0x3d')]['id']){try{if(_0x36b0f4[_0x0164('0x3e')][_0x39f7fb[_0x0164('0x3d')]['id']]){_0x36b0f4[_0x0164('0x3e')][_0x39f7fb[_0x0164('0x3d')]['id']]['busy']=![];_0x36b0f4[_0x0164('0x3e')][_0x39f7fb[_0x0164('0x3d')]['id']][_0x0164('0x3f')]=undefined;}return _0x31f075({'code':0xc8,'message':_0x39f7fb});}catch(_0x486335){logger[_0x0164('0x36')](_0x486335[_0x0164('0x37')]);return _0x97377b(_0x192437[_0x0164('0x36')](0x1f4,_0x486335));}}logger['error'](_0x0164('0x3c'));return _0x97377b(_0x192437[_0x0164('0x36')](0x1f4,_0x0164('0x3c')));});},'AbandonInteraction':function(_0x26cbbc){var _0x56ad13=this;return new Promise(function(_0x36571e,_0x17e982){if(_0x26cbbc[_0x0164('0x17')]&&_0x26cbbc['interaction']&&_0x26cbbc[_0x0164('0x39')]['id']){try{var _0x5ecedb=getId(_0x26cbbc[_0x0164('0x17')],_0x26cbbc[_0x0164('0x18')]?_0x26cbbc[_0x0164('0x18')]['id']:0x0,_0x26cbbc[_0x0164('0x39')]?_0x26cbbc[_0x0164('0x39')]['id']:0x0);if(_0x36b0f4[_0x0164('0x16')][_0x5ecedb]){_0x36b0f4[_0x0164('0x16')][_0x5ecedb][_0x0164('0x33')](_0x0164('0x34'));}return _0x36571e({'code':0xc8,'message':_0x26cbbc});}catch(_0x40b06f){logger['error'](_0x40b06f[_0x0164('0x37')]);return _0x17e982(_0x56ad13[_0x0164('0x36')](0x1f4,_0x40b06f));}}logger[_0x0164('0x36')]('message\x20is\x20empty');return _0x17e982(_0x56ad13[_0x0164('0x36')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5804f9){var _0xbff73b=this;return new Promise(function(_0x40c5fd,_0x43faf1){if(_0x36b0f4[_0x0164('0x3e')]['hasOwnProperty'](_0x5804f9['id'])){for(var _0x3f9c86 in _0x5804f9[_0x0164('0x40')]){if(_0x5804f9[_0x0164('0x40')][_0x0164('0x41')](_0x3f9c86)){if(_0x36b0f4[_0x0164('0x3e')][_0x5804f9['id']][_0x0164('0x41')](_0x3f9c86+_0x0164('0x42'))){_0x36b0f4['agents'][_0x5804f9['id']][_0x3f9c86+'CurrentCapacity']=parseInt(_0x5804f9[_0x0164('0x40')][_0x3f9c86],0xa);}}}_0x36b0f4[_0x0164('0x3e')][_0x5804f9['id']][_0x0164('0x43')]();return _0x40c5fd({'code':0xc8,'message':_0x36b0f4[_0x0164('0x3e')][_0x5804f9['id']]});}else{return _0x43faf1(_0xbff73b[_0x0164('0x36')](0x1f4,_0x0164('0x44')));}});},'Agents':function(_0xd18852){return new Promise(function(_0x40d34e,_0x2ff73e){var _0x5bbc37=_[_0x0164('0x45')](_0x36b0f4[_0x0164('0x3e')]);_0x40d34e({'count':_0x5bbc37[_0x0164('0x1b')],'rows':_0x5bbc37});});},'ChatQueues':function(_0x5be7e7){return new Promise(function(_0x2ca507,_0x589501){var _0x2a8fe1=[];for(var _0x60549f in _0x36b0f4[_0x0164('0x46')]){if(_0x36b0f4[_0x0164('0x46')][_0x0164('0x41')](_0x60549f)){var _0x1049e8=_0x36b0f4['chatQueues'][_0x60549f];var _0x41a098={'id':_0x1049e8['id'],'available':_0x1049e8[_0x0164('0x47')],'loggedIn':_0x1049e8['loggedIn'],'name':_0x1049e8[_0x0164('0x48')],'paused':_0x1049e8[_0x0164('0x49')],'waiting':_0x1049e8[_0x0164('0x4a')]};_0x2a8fe1['push'](_0x41a098);}}_0x2ca507({'count':_0x2a8fe1[_0x0164('0x1b')],'rows':_0x2a8fe1});});},'MailQueues':function(_0x52e9f9){return new Promise(function(_0x54a05a,_0x41c397){var _0x516cc0=[];for(var _0x19ddac in _0x36b0f4[_0x0164('0x4b')]){if(_0x36b0f4[_0x0164('0x4b')]['hasOwnProperty'](_0x19ddac)){var _0xe6a2d1=_0x36b0f4[_0x0164('0x4b')][_0x19ddac];var _0x4bbb0f={'id':_0xe6a2d1['id'],'available':_0xe6a2d1[_0x0164('0x47')],'loggedIn':_0xe6a2d1[_0x0164('0x4c')],'name':_0xe6a2d1[_0x0164('0x48')],'paused':_0xe6a2d1[_0x0164('0x49')],'waiting':_0xe6a2d1[_0x0164('0x4a')]};_0x516cc0[_0x0164('0x23')](_0x4bbb0f);}}_0x54a05a({'count':_0x516cc0['length'],'rows':_0x516cc0});});},'OpenchannelQueues':function(_0x3c660f){return new Promise(function(_0x1ccc95,_0x256f92){var _0x21b9ec=[];for(var _0x37b8b2 in _0x36b0f4[_0x0164('0x4d')]){if(_0x36b0f4[_0x0164('0x4d')]['hasOwnProperty'](_0x37b8b2)){var _0x9641b1=_0x36b0f4[_0x0164('0x4d')][_0x37b8b2];var _0x3746e6={'id':_0x9641b1['id'],'available':_0x9641b1['available'],'loggedIn':_0x9641b1[_0x0164('0x4c')],'name':_0x9641b1[_0x0164('0x48')],'paused':_0x9641b1[_0x0164('0x49')],'waiting':_0x9641b1[_0x0164('0x4a')]};_0x21b9ec['push'](_0x3746e6);}}_0x1ccc95({'count':_0x21b9ec[_0x0164('0x1b')],'rows':_0x21b9ec});});},'SmsQueues':function(_0x4c3e4d){return new Promise(function(_0x3ba76b,_0x446a8f){var _0x420e90=[];for(var _0x4063af in _0x36b0f4[_0x0164('0x4e')]){if(_0x36b0f4[_0x0164('0x4e')][_0x0164('0x41')](_0x4063af)){var _0x326418=_0x36b0f4[_0x0164('0x4e')][_0x4063af];var _0x355fe8={'id':_0x326418['id'],'available':_0x326418['available'],'loggedIn':_0x326418['loggedIn'],'name':_0x326418[_0x0164('0x48')],'paused':_0x326418[_0x0164('0x49')],'waiting':_0x326418[_0x0164('0x4a')]};_0x420e90[_0x0164('0x23')](_0x355fe8);}}_0x3ba76b({'count':_0x420e90[_0x0164('0x1b')],'rows':_0x420e90});});},'FaxQueues':function(_0x9bfea0){return new Promise(function(_0x37c202,_0x35aa0d){var _0x4aecc8=[];for(var _0x393998 in _0x36b0f4[_0x0164('0x4f')]){if(_0x36b0f4[_0x0164('0x4f')]['hasOwnProperty'](_0x393998)){var _0x508217=_0x36b0f4[_0x0164('0x4f')][_0x393998];var _0x2b45a5={'id':_0x508217['id'],'available':_0x508217[_0x0164('0x47')],'loggedIn':_0x508217[_0x0164('0x4c')],'name':_0x508217['name'],'paused':_0x508217[_0x0164('0x49')],'waiting':_0x508217['waiting']};_0x4aecc8[_0x0164('0x23')](_0x2b45a5);}}_0x37c202({'count':_0x4aecc8['length'],'rows':_0x4aecc8});});},'ChatQueuesWaitingInteractions':function(_0x27ff15){return new Promise(function(_0x319bfa,_0x1ff5e5){var _0x1823ca=_[_0x0164('0x45')](_0x36b0f4[_0x0164('0x50')]);_0x319bfa({'count':_0x1823ca[_0x0164('0x1b')],'rows':_0x1823ca});});},'MailQueuesWaitingInteractions':function(_0x3c8ec1){return new Promise(function(_0x1298fe,_0x236d76){var _0x29bb2c=_[_0x0164('0x45')](_0x36b0f4[_0x0164('0x51')]);_0x1298fe({'count':_0x29bb2c[_0x0164('0x1b')],'rows':_0x29bb2c});});},'OpenchannelQueuesWaitingInteractions':function(_0xc3b4d7){return new Promise(function(_0x85be49,_0x5bbd38){var _0x5d10d3=_[_0x0164('0x45')](_0x36b0f4[_0x0164('0x52')]);_0x85be49({'count':_0x5d10d3['length'],'rows':_0x5d10d3});});},'SmsQueuesWaitingInteractions':function(_0x510bfc){return new Promise(function(_0xa95cde,_0x666458){var _0x2cfc7a=_[_0x0164('0x45')](_0x36b0f4[_0x0164('0x53')]);_0xa95cde({'count':_0x2cfc7a['length'],'rows':_0x2cfc7a});});},'FaxQueuesWaitingInteractions':function(_0x1c12a8){return new Promise(function(_0x4f1272,_0x2bc80b){var _0x21e563=_['values'](_0x36b0f4[_0x0164('0x54')]);_0x4f1272({'count':_0x21e563[_0x0164('0x1b')],'rows':_0x21e563});});}};var _0x593816=jayson[_0x0164('0x55')](_0x555fc9)[_0x0164('0x56')]();_0x593816['on']('error',function(_0x341dd0){logger[_0x0164('0x36')](JSON[_0x0164('0x31')](_0x341dd0));return _0x24a3e5(_0x341dd0);});_0x593816[_0x0164('0x15')](0x232c,_0x0164('0x57'),function(){console[_0x0164('0x58')](_0x0164('0x59'),0x232c);return _0x603982(_0x0164('0x5a')+0x232c);});});}; \ No newline at end of file +var _0xd5ec=['Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','info','Applications\x20executed','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','update','UserId','message\x20is\x20empty','agent','agents','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','faxQueues','values','openchannelQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','priority'];(function(_0xdb29e7,_0x1e7a7a){var _0x3a5358=function(_0x3d691a){while(--_0x3d691a){_0xdb29e7['push'](_0xdb29e7['shift']());}};_0x3a5358(++_0x1e7a7a);}(_0xd5ec,0x181));var _0xcd5e=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xd5ec[_0x5f0501];return _0x3c2c45;};'use strict';var _=require(_0xcd5e('0x0'));var util=require(_0xcd5e('0x1'));var path=require(_0xcd5e('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xcd5e('0x3'));var uuid=require(_0xcd5e('0x4'));var config=require(_0xcd5e('0x5'));var logger=require(_0xcd5e('0x6'))(_0xcd5e('0x7'));var rpc={'openchannelQueueReport':require(_0xcd5e('0x8'))};var rpc={'openchannelQueueReport':require(_0xcd5e('0x8')),'mailQueueReport':require(_0xcd5e('0x9')),'chatQueueReport':require(_0xcd5e('0xa')),'smsQueueReport':require(_0xcd5e('0xb')),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0xcd5e('0xc'));function getId(_0x58f7bb,_0x5f2552,_0x4b0b61){return util[_0xcd5e('0xd')](_0xcd5e('0xe'),_0x58f7bb,_0x5f2552||0x0,_0x4b0b61||0x0);}function getIntervals(_0x201c7f,_0xe9919b){var _0x771aaa=[];if(!_[_0xcd5e('0xf')](_0xe9919b[_0xcd5e('0x10')])&&!_['isNil'](_0x201c7f[_0xe9919b['IntervalId']])&&!_[_0xcd5e('0xf')](_0x201c7f[_0xe9919b[_0xcd5e('0x10')]]['Intervals'])){_0x771aaa=_[_0xcd5e('0x11')](_0x201c7f[_0xe9919b[_0xcd5e('0x10')]][_0xcd5e('0x12')],_0xcd5e('0x13'));}else if(!_[_0xcd5e('0xf')](_0xe9919b[_0xcd5e('0x13')])){_0x771aaa=[_0xe9919b['interval']];}return _0x771aaa;}exports[_0xcd5e('0x14')]=function(_0xbe9efc){_0xbe9efc[_0xcd5e('0x15')]={};return new BPromise(function(_0xbc0836,_0x49fe62){var _0x56dcdd={'Start':function(_0x2bbadc){var _0x1e53e5=this;return new Promise(function(_0x215747,_0x4c43be){if(_0x2bbadc){try{var _0x6257a7=[];var _0x50afa3=getId(_0x2bbadc[_0xcd5e('0x16')],_0x2bbadc['message']?_0x2bbadc[_0xcd5e('0x17')]['id']:0x0,_0x2bbadc['interaction']?_0x2bbadc[_0xcd5e('0x18')]['id']:0x0);if(_0x2bbadc[_0xcd5e('0x19')]&&_[_0xcd5e('0x1a')](_0x2bbadc[_0xcd5e('0x19')])&&_0x2bbadc[_0xcd5e('0x19')][_0xcd5e('0x1b')]){for(var _0x3cba58=0x0;_0x3cba58<_0x2bbadc[_0xcd5e('0x19')][_0xcd5e('0x1b')];_0x3cba58+=0x1){var _0x5c3117=_0x2bbadc[_0xcd5e('0x19')][_0x3cba58];if(fs[_0xcd5e('0x1c')](path[_0xcd5e('0x1d')](__dirname,_0xcd5e('0x19'),_0x5c3117[_0xcd5e('0x1e')]+'.js'))){var _0x23479d=[];switch(_0x5c3117[_0xcd5e('0x1e')][_0xcd5e('0x1f')]()){case _0xcd5e('0x20'):var _0x4705d7=_0x5c3117[_0xcd5e('0x21')][_0xcd5e('0x22')](',');_0x23479d[_0xcd5e('0x23')](_0x4705d7[0x0]);_0x23479d[_0xcd5e('0x23')](_0x4705d7[_0xcd5e('0x24')](0x1,_0x4705d7[_0xcd5e('0x1b')])[_0xcd5e('0x1d')](','));break;case'dialogflow':var _0x4705d7=_0x5c3117[_0xcd5e('0x21')]['split'](',');_0x23479d[_0xcd5e('0x23')](_0x4705d7[0x0]);_0x23479d[_0xcd5e('0x23')](_0x4705d7[0x1]);_0x23479d['push'](_0x4705d7['slice'](0x2,_0x4705d7[_0xcd5e('0x1b')])[_0xcd5e('0x1d')](','));break;case _0xcd5e('0x25'):var _0x4705d7=_0x5c3117['appdata'][_0xcd5e('0x22')](',');_0x23479d[_0xcd5e('0x23')](_0x4705d7[0x0]);_0x23479d[_0xcd5e('0x23')](_0x4705d7[0x1]);_0x23479d[_0xcd5e('0x23')](_0x4705d7[0x2]);_0x23479d[_0xcd5e('0x23')](_0x4705d7[0x3]);_0x23479d[_0xcd5e('0x23')](_0x4705d7['slice'](0x4,_0x4705d7[_0xcd5e('0x1b')])[_0xcd5e('0x1d')](','));break;case _0xcd5e('0x17'):_0x23479d['push'](_0x5c3117[_0xcd5e('0x21')]);break;case _0xcd5e('0x26'):_0x23479d['push'](_0x5c3117[_0xcd5e('0x27')]);_0x23479d[_0xcd5e('0x23')](_0x5c3117[_0xcd5e('0x21')]);break;default:_0x23479d=_[_0xcd5e('0xf')](_0x5c3117[_0xcd5e('0x21')])?[]:_0x5c3117[_0xcd5e('0x21')][_0xcd5e('0x22')](',');}var _0x25bda0={'id':util[_0xcd5e('0xd')](_0xcd5e('0x28'),_0x50afa3,_0x5c3117['id'],_0x5c3117[_0xcd5e('0x1e')]),'condition':require(_0xcd5e('0x29'))[_0xcd5e('0x2a')](_0x50afa3,getIntervals(_0xbe9efc[_0xcd5e('0x2b')],_0x5c3117),_0xbe9efc),'consequence':require('./applications/'+_0x5c3117[_0xcd5e('0x1e')])['consequence'](_0x50afa3,_0x23479d,_0xbe9efc,_0x2bbadc),'p':_0x5c3117[_0xcd5e('0x2c')]||0x0};logger['info'](_0xcd5e('0x2d'),_0x25bda0['id'],_0xcd5e('0x2e'),getIntervals(_0xbe9efc['intervals'],_0x5c3117)['join']('\x20|\x20'));_0x6257a7[_0xcd5e('0x23')](_0x25bda0);}else{logger[_0xcd5e('0x2f')](_0xcd5e('0x30'),path['join'](__dirname,'applications',_0x5c3117[_0xcd5e('0x1e')]+'.js'));}}_0xbe9efc[_0xcd5e('0x15')][_0x50afa3]=new RuleEngine(_0x6257a7);_0xbe9efc[_0xcd5e('0x15')][_0x50afa3]['execute'](_0x2bbadc,function(_0x29a1c8){logger[_0xcd5e('0x31')](_0xcd5e('0x32'),JSON['stringify'](_0x29a1c8['matchPath']));if(_0xbe9efc['rules'][_0x50afa3]){_0xbe9efc[_0xcd5e('0x15')][_0x50afa3][_0xcd5e('0x33')](_0xcd5e('0x34'));}});return _0x215747({'code':0xc8,'message':_0x2bbadc});}else{logger[_0xcd5e('0x31')](_0xcd5e('0x35'));return _0x215747({'code':0xc8,'message':_0x2bbadc});}}catch(_0x340e64){logger[_0xcd5e('0x2f')](_0x340e64[_0xcd5e('0x36')]);return _0x4c43be(_0x1e53e5[_0xcd5e('0x2f')](0x1f4,_0x340e64));}}return _0x4c43be(_0xcd5e('0x37'));});},'AcceptMessage':function(_0x3c9a0d){var _0x147fae=this;return new Promise(function(_0x15a083,_0x355608){if(_0x3c9a0d[_0xcd5e('0x17')]&&_0x3c9a0d[_0xcd5e('0x17')]['id']){try{var _0x3b955a=getId(_0x3c9a0d[_0xcd5e('0x16')],_0x3c9a0d['message']?_0x3c9a0d[_0xcd5e('0x17')]['id']:0x0,_0x3c9a0d[_0xcd5e('0x18')]?_0x3c9a0d['interaction']['id']:0x0);if(_0xbe9efc['rules'][_0x3b955a]){_0xbe9efc[_0xcd5e('0x15')][_0x3b955a][_0xcd5e('0x33')](_0xcd5e('0x34'));if(rpc[_0x3c9a0d[_0xcd5e('0x16')]+_0xcd5e('0x38')]){rpc[_0x3c9a0d[_0xcd5e('0x16')]+_0xcd5e('0x38')][_0xcd5e('0x39')](_0x3b955a,{'UserId':_0x3c9a0d['message'][_0xcd5e('0x3a')]})['catch'](function(_0x4fb64f){logger[_0xcd5e('0x2f')]('error\x20update\x20queue\x20report');});}}return _0x15a083({'code':0xc8,'message':_0x3c9a0d});}catch(_0x2a9a6c){logger[_0xcd5e('0x2f')](_0x2a9a6c[_0xcd5e('0x36')]);return _0x355608(_0x147fae[_0xcd5e('0x2f')](0x1f4,_0x2a9a6c));}}logger[_0xcd5e('0x2f')]('message\x20is\x20empty');return _0x355608(_0x147fae[_0xcd5e('0x2f')](0x1f4,_0xcd5e('0x3b')));});},'RejectMessage':function(_0x417f20){var _0x3f181d=this;return new Promise(function(_0x39fc60,_0xc24b9c){if(_0x417f20[_0xcd5e('0x3c')]&&_0x417f20[_0xcd5e('0x3c')]['id']){try{if(_0xbe9efc[_0xcd5e('0x3d')][_0x417f20[_0xcd5e('0x3c')]['id']]){_0xbe9efc[_0xcd5e('0x3d')][_0x417f20[_0xcd5e('0x3c')]['id']]['busy']=![];_0xbe9efc[_0xcd5e('0x3d')][_0x417f20[_0xcd5e('0x3c')]['id']][_0xcd5e('0x3e')]=undefined;}return _0x39fc60({'code':0xc8,'message':_0x417f20});}catch(_0x379b3a){logger['error'](_0x379b3a[_0xcd5e('0x36')]);return _0xc24b9c(_0x3f181d[_0xcd5e('0x2f')](0x1f4,_0x379b3a));}}logger[_0xcd5e('0x2f')](_0xcd5e('0x3b'));return _0xc24b9c(_0x3f181d[_0xcd5e('0x2f')](0x1f4,_0xcd5e('0x3b')));});},'AbandonInteraction':function(_0x1016f4){var _0x4dd6dc=this;return new Promise(function(_0xaedc9c,_0x5e26f1){if(_0x1016f4['channel']&&_0x1016f4[_0xcd5e('0x18')]&&_0x1016f4[_0xcd5e('0x18')]['id']){try{var _0x5e496d=getId(_0x1016f4[_0xcd5e('0x16')],_0x1016f4['message']?_0x1016f4[_0xcd5e('0x17')]['id']:0x0,_0x1016f4['interaction']?_0x1016f4[_0xcd5e('0x18')]['id']:0x0);if(_0xbe9efc[_0xcd5e('0x15')][_0x5e496d]){_0xbe9efc[_0xcd5e('0x15')][_0x5e496d][_0xcd5e('0x33')](_0xcd5e('0x34'));}return _0xaedc9c({'code':0xc8,'message':_0x1016f4});}catch(_0x5403d2){logger[_0xcd5e('0x2f')](_0x5403d2['stack']);return _0x5e26f1(_0x4dd6dc[_0xcd5e('0x2f')](0x1f4,_0x5403d2));}}logger[_0xcd5e('0x2f')](_0xcd5e('0x3b'));return _0x5e26f1(_0x4dd6dc[_0xcd5e('0x2f')](0x1f4,_0xcd5e('0x3b')));});},'AgentCapacity':function(_0x44beaf){var _0x13c2d1=this;return new Promise(function(_0x4d7a39,_0x121017){if(_0xbe9efc[_0xcd5e('0x3d')][_0xcd5e('0x3f')](_0x44beaf['id'])){for(var _0x4c477a in _0x44beaf[_0xcd5e('0x40')]){if(_0x44beaf[_0xcd5e('0x40')][_0xcd5e('0x3f')](_0x4c477a)){if(_0xbe9efc[_0xcd5e('0x3d')][_0x44beaf['id']]['hasOwnProperty'](_0x4c477a+_0xcd5e('0x41'))){_0xbe9efc[_0xcd5e('0x3d')][_0x44beaf['id']][_0x4c477a+'CurrentCapacity']=parseInt(_0x44beaf[_0xcd5e('0x40')][_0x4c477a],0xa);}}}_0xbe9efc[_0xcd5e('0x3d')][_0x44beaf['id']][_0xcd5e('0x42')]();return _0x4d7a39({'code':0xc8,'message':_0xbe9efc[_0xcd5e('0x3d')][_0x44beaf['id']]});}else{return _0x121017(_0x13c2d1['error'](0x1f4,_0xcd5e('0x43')));}});},'Agents':function(_0x1667d3){return new Promise(function(_0x46f88d,_0xcd07dc){var _0xde4ed2=_['values'](_0xbe9efc[_0xcd5e('0x3d')]);_0x46f88d({'count':_0xde4ed2[_0xcd5e('0x1b')],'rows':_0xde4ed2});});},'ChatQueues':function(_0x15e2ba){return new Promise(function(_0x248d04,_0x28fe71){var _0x529223=[];for(var _0xca3646 in _0xbe9efc[_0xcd5e('0x44')]){if(_0xbe9efc[_0xcd5e('0x44')]['hasOwnProperty'](_0xca3646)){var _0x4de72d=_0xbe9efc[_0xcd5e('0x44')][_0xca3646];var _0x21a710={'id':_0x4de72d['id'],'available':_0x4de72d[_0xcd5e('0x45')],'loggedIn':_0x4de72d['loggedIn'],'name':_0x4de72d[_0xcd5e('0x46')],'paused':_0x4de72d[_0xcd5e('0x47')],'waiting':_0x4de72d[_0xcd5e('0x48')]};_0x529223[_0xcd5e('0x23')](_0x21a710);}}_0x248d04({'count':_0x529223[_0xcd5e('0x1b')],'rows':_0x529223});});},'MailQueues':function(_0x8260eb){return new Promise(function(_0xdda6a4,_0x2591c4){var _0x16ae13=[];for(var _0x1a8b6d in _0xbe9efc[_0xcd5e('0x49')]){if(_0xbe9efc['mailQueues'][_0xcd5e('0x3f')](_0x1a8b6d)){var _0x35a7a3=_0xbe9efc[_0xcd5e('0x49')][_0x1a8b6d];var _0x59dad9={'id':_0x35a7a3['id'],'available':_0x35a7a3[_0xcd5e('0x45')],'loggedIn':_0x35a7a3['loggedIn'],'name':_0x35a7a3['name'],'paused':_0x35a7a3[_0xcd5e('0x47')],'waiting':_0x35a7a3[_0xcd5e('0x48')]};_0x16ae13[_0xcd5e('0x23')](_0x59dad9);}}_0xdda6a4({'count':_0x16ae13['length'],'rows':_0x16ae13});});},'OpenchannelQueues':function(_0x3b90c9){return new Promise(function(_0x59964f,_0x2af10d){var _0x198fa1=[];for(var _0x257f01 in _0xbe9efc[_0xcd5e('0x4a')]){if(_0xbe9efc['openchannelQueues'][_0xcd5e('0x3f')](_0x257f01)){var _0x4de4a8=_0xbe9efc['openchannelQueues'][_0x257f01];var _0x44e8c9={'id':_0x4de4a8['id'],'available':_0x4de4a8[_0xcd5e('0x45')],'loggedIn':_0x4de4a8[_0xcd5e('0x4b')],'name':_0x4de4a8[_0xcd5e('0x46')],'paused':_0x4de4a8[_0xcd5e('0x47')],'waiting':_0x4de4a8[_0xcd5e('0x48')]};_0x198fa1[_0xcd5e('0x23')](_0x44e8c9);}}_0x59964f({'count':_0x198fa1[_0xcd5e('0x1b')],'rows':_0x198fa1});});},'SmsQueues':function(_0x465211){return new Promise(function(_0x332aa5,_0x5c8941){var _0x59111f=[];for(var _0x1b71fb in _0xbe9efc['smsQueues']){if(_0xbe9efc[_0xcd5e('0x4c')][_0xcd5e('0x3f')](_0x1b71fb)){var _0x5e467a=_0xbe9efc[_0xcd5e('0x4c')][_0x1b71fb];var _0x305477={'id':_0x5e467a['id'],'available':_0x5e467a[_0xcd5e('0x45')],'loggedIn':_0x5e467a[_0xcd5e('0x4b')],'name':_0x5e467a['name'],'paused':_0x5e467a[_0xcd5e('0x47')],'waiting':_0x5e467a[_0xcd5e('0x48')]};_0x59111f[_0xcd5e('0x23')](_0x305477);}}_0x332aa5({'count':_0x59111f[_0xcd5e('0x1b')],'rows':_0x59111f});});},'FaxQueues':function(_0x5013b5){return new Promise(function(_0x11f6f0,_0x213c91){var _0x4a4d0f=[];for(var _0x14f13d in _0xbe9efc[_0xcd5e('0x4d')]){if(_0xbe9efc[_0xcd5e('0x4d')]['hasOwnProperty'](_0x14f13d)){var _0x10b7d2=_0xbe9efc[_0xcd5e('0x4d')][_0x14f13d];var _0x1be7c0={'id':_0x10b7d2['id'],'available':_0x10b7d2['available'],'loggedIn':_0x10b7d2['loggedIn'],'name':_0x10b7d2[_0xcd5e('0x46')],'paused':_0x10b7d2[_0xcd5e('0x47')],'waiting':_0x10b7d2[_0xcd5e('0x48')]};_0x4a4d0f[_0xcd5e('0x23')](_0x1be7c0);}}_0x11f6f0({'count':_0x4a4d0f[_0xcd5e('0x1b')],'rows':_0x4a4d0f});});},'ChatQueuesWaitingInteractions':function(_0x523a51){return new Promise(function(_0x1db2cc,_0x5ab7b5){var _0x375e6c=_[_0xcd5e('0x4e')](_0xbe9efc['chatQueuesWaitingInteractions']);_0x1db2cc({'count':_0x375e6c[_0xcd5e('0x1b')],'rows':_0x375e6c});});},'MailQueuesWaitingInteractions':function(_0xeb1ad7){return new Promise(function(_0x6db2d3,_0x3ae2b0){var _0x3d44ee=_['values'](_0xbe9efc['mailQueuesWaitingInteractions']);_0x6db2d3({'count':_0x3d44ee[_0xcd5e('0x1b')],'rows':_0x3d44ee});});},'OpenchannelQueuesWaitingInteractions':function(_0x454981){return new Promise(function(_0x2a1e5c,_0x4f0b30){var _0x5b0cc9=_[_0xcd5e('0x4e')](_0xbe9efc[_0xcd5e('0x4f')]);_0x2a1e5c({'count':_0x5b0cc9[_0xcd5e('0x1b')],'rows':_0x5b0cc9});});},'SmsQueuesWaitingInteractions':function(_0x5de9d9){return new Promise(function(_0x2be63b,_0x419229){var _0x4745ea=_['values'](_0xbe9efc['smsQueuesWaitingInteractions']);_0x2be63b({'count':_0x4745ea['length'],'rows':_0x4745ea});});},'FaxQueuesWaitingInteractions':function(_0x47d365){return new Promise(function(_0x5450dc,_0x386970){var _0x480e9d=_[_0xcd5e('0x4e')](_0xbe9efc['faxQueuesWaitingInteractions']);_0x5450dc({'count':_0x480e9d[_0xcd5e('0x1b')],'rows':_0x480e9d});});}};var _0xdc8866=jayson[_0xcd5e('0x50')](_0x56dcdd)[_0xcd5e('0x51')]();_0xdc8866['on']('error',function(_0x2b2f9b){logger[_0xcd5e('0x2f')](JSON[_0xcd5e('0x52')](_0x2b2f9b));return _0x49fe62(_0x2b2f9b);});_0xdc8866['listen'](0x232c,_0xcd5e('0x53'),function(){console['log'](_0xcd5e('0x54'),0x232c);return _0xbc0836(_0xcd5e('0x55')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 63e44ff..6543870 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 _0x8165=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','result'];(function(_0x4cb6e2,_0x599eb7){var _0x2edbc1=function(_0x5f11de){while(--_0x5f11de){_0x4cb6e2['push'](_0x4cb6e2['shift']());}};_0x2edbc1(++_0x599eb7);}(_0x8165,0x15f));var _0x5816=function(_0x3c4539,_0xe662aa){_0x3c4539=_0x3c4539-0x0;var _0x12426c=_0x8165[_0x3c4539];return _0x12426c;};'use strict';var util=require(_0x5816('0x0'));var BPromise=require(_0x5816('0x1'));var jayson=require(_0x5816('0x2'));var _=require(_0x5816('0x3'));var logger=require(_0x5816('0x4'))('routing');var client=jayson[_0x5816('0x5')][_0x5816('0x6')]({'port':0x232a});function request(_0x303a33,_0x4909ac){return new BPromise(function(_0x55dc68,_0x572633){return client[_0x5816('0x7')](_0x303a33,_0x4909ac)[_0x5816('0x8')](function(_0x57175e){if(_0x57175e[_0x5816('0x9')]){return _0x572633(_0x57175e[_0x5816('0x9')][_0x5816('0xa')]);}else{return _0x55dc68(_0x57175e[_0x5816('0xb')]);}})['catch'](function(_0x3a62ce){return _0x572633(_0x3a62ce);});});}exports[_0x5816('0xc')]=function(_0x3647fd,_0x5d6363,_0x121b16){return function(_0x4957a0){if(_0x121b16['rules']&&!_0x121b16[_0x5816('0xd')][_0x3647fd]){logger[_0x5816('0xe')](_0x5816('0xf'),_0x3647fd);return _0x4957a0[_0x5816('0x10')]();}var _0x33d95d=[];for(var _0x1d4671=0x0;_0x1d4671<_0x5d6363[_0x5816('0x11')];_0x1d4671+=0x1){_0x33d95d[_0x5816('0x12')](request(_0x5816('0x13'),{'command':util['format'](_0x5816('0x14'),_0x5d6363[_0x1d4671])})[_0x5816('0x8')](function(_0x5ac253){return _0x5ac253&&_0x5ac253[_0x5816('0xa')]&&_0x5ac253[_0x5816('0xa')][_0x5816('0x15')](_0x5816('0x16'))>=0x0?!![]:![];})[_0x5816('0x17')](function(_0xbe7e8f){logger['error'](_0x5816('0x18'),_0x3647fd,_0x5d6363[_0x1d4671]);}));}BPromise[_0x5816('0x19')](_0x33d95d)[_0x5816('0x8')](function(_0x21614c){var _0x336a92=_[_0x5816('0x1a')](_0x21614c);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x3647fd,_0x5d6363[_0x5816('0x1b')](_0x5816('0x1c')),_0x336a92);_0x4957a0[_0x5816('0x1d')](_0x336a92);})[_0x5816('0x17')](function(_0x1e07bf){console[_0x5816('0x1e')](_0x1e07bf);logger[_0x5816('0x9')](_0x5816('0x1f'),_0x3647fd,_0x5d6363[_0x5816('0x1b')](_0x5816('0x1c')),_0x1e07bf[_0x5816('0x20')]);_0x4957a0[_0x5816('0x10')]();});};}; \ No newline at end of file +var _0xe05f=['http','then','error','message','result','condition','rules','info','stop','length','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','catch','log','join','stack','util','bluebird','jayson/promise','lodash','routing','client'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe05f,0xcc));var _0xfe05=function(_0x39fa36,_0x11c349){_0x39fa36=_0x39fa36-0x0;var _0x252d4a=_0xe05f[_0x39fa36];return _0x252d4a;};'use strict';var util=require(_0xfe05('0x0'));var BPromise=require(_0xfe05('0x1'));var jayson=require(_0xfe05('0x2'));var _=require(_0xfe05('0x3'));var logger=require('../../../config/logger')(_0xfe05('0x4'));var client=jayson[_0xfe05('0x5')][_0xfe05('0x6')]({'port':0x232a});function request(_0x32178b,_0x2f33f4){return new BPromise(function(_0x186af8,_0x336712){return client['request'](_0x32178b,_0x2f33f4)[_0xfe05('0x7')](function(_0x2aa3a3){if(_0x2aa3a3[_0xfe05('0x8')]){return _0x336712(_0x2aa3a3[_0xfe05('0x8')][_0xfe05('0x9')]);}else{return _0x186af8(_0x2aa3a3[_0xfe05('0xa')]);}})['catch'](function(_0x5bf751){return _0x336712(_0x5bf751);});});}exports[_0xfe05('0xb')]=function(_0x451a16,_0x1bf97c,_0x3c9347){return function(_0x341b5a){if(_0x3c9347[_0xfe05('0xc')]&&!_0x3c9347[_0xfe05('0xc')][_0x451a16]){logger[_0xfe05('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x451a16);return _0x341b5a[_0xfe05('0xe')]();}var _0x2357e6=[];for(var _0x4fb523=0x0;_0x4fb523<_0x1bf97c[_0xfe05('0xf')];_0x4fb523+=0x1){_0x2357e6[_0xfe05('0x10')](request(_0xfe05('0x11'),{'command':util['format'](_0xfe05('0x12'),_0x1bf97c[_0x4fb523])})[_0xfe05('0x7')](function(_0x31e305){return _0x31e305&&_0x31e305[_0xfe05('0x9')]&&_0x31e305['message'][_0xfe05('0x13')](_0xfe05('0x14'))>=0x0?!![]:![];})['catch'](function(_0x35ba70){logger[_0xfe05('0x8')](_0xfe05('0x15'),_0x451a16,_0x1bf97c[_0x4fb523]);}));}BPromise[_0xfe05('0x16')](_0x2357e6)[_0xfe05('0x7')](function(_0x91e921){var _0x262a17=_[_0xfe05('0x17')](_0x91e921);logger['info'](_0xfe05('0x18'),_0x451a16,_0x1bf97c['join'](_0xfe05('0x19')),_0x262a17);_0x341b5a['when'](_0x262a17);})[_0xfe05('0x1a')](function(_0x304fa2){console[_0xfe05('0x1b')](_0x304fa2);logger[_0xfe05('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x451a16,_0x1bf97c[_0xfe05('0x1c')](_0xfe05('0x19')),_0x304fa2[_0xfe05('0x1d')]);_0x341b5a[_0xfe05('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f17d9cb..3925ecb 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 _0xd0f8=['answered_elsewhere','answeredelsewheredestinationuniqueid','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','agent','lodash','util','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','ringtime','talktime','forIn','reason','abandoned','holdtime','agentconnect'];(function(_0x3530b7,_0xba94a1){var _0x6b6071=function(_0x4467b0){while(--_0x4467b0){_0x3530b7['push'](_0x3530b7['shift']());}};_0x6b6071(++_0xba94a1);}(_0xd0f8,0x16b));var _0x8d0f=function(_0x2f0061,_0x28521f){_0x2f0061=_0x2f0061-0x0;var _0x2ddd31=_0xd0f8[_0x2f0061];return _0x2ddd31;};'use strict';var _=require(_0x8d0f('0x0'));var util=require(_0x8d0f('0x1'));var utils=require(_0x8d0f('0x2'));var agents={};var transfers={};function writeDB(_0x4047ee,_0x12dbdd){utils[_0x8d0f('0x3')](util['format'](_0x8d0f('0x4'),_0x4047ee[_0x8d0f('0x5')],_0x4047ee[_0x8d0f('0x6')],_0x4047ee['queue'],_0x4047ee[_0x8d0f('0x7')],_0x4047ee[_0x8d0f('0x8')],_0x4047ee[_0x8d0f('0x9')],_0x4047ee[_0x8d0f('0xa')],_0x4047ee[_0x8d0f('0xb')]));if(_0x4047ee[_0x8d0f('0xc')]){utils[_0x8d0f('0xd')](_0x4047ee[_0x8d0f('0xc')])[_0x8d0f('0xe')](function(_0x87b5ff){if(_0x87b5ff){_0x4047ee[_0x8d0f('0xf')]=_0x87b5ff[_0x8d0f('0xf')];_0x4047ee[_0x8d0f('0x10')]=_0x4047ee['agentcomplete']?_0x87b5ff['acw']:![];_0x4047ee['acwtime']=_0x4047ee['agentacw']?_0x87b5ff[_0x8d0f('0x11')]:0x0;}utils[_0x8d0f('0x12')](_0x8d0f('0x13'),_0x4047ee);});}else{utils[_0x8d0f('0x12')]('CreateVoiceAgentReport',_0x4047ee);}if(_0x12dbdd){delete transfers[_0x4047ee['uniqueid']];}else{delete agents[_0x4047ee[_0x8d0f('0x14')]];}}exports[_0x8d0f('0x15')]=function(_0x23dda6){try{agents[_0x23dda6[_0x8d0f('0x14')]]=_0x23dda6;agents[_0x23dda6['destuniqueid']][_0x8d0f('0x16')]=utils[_0x8d0f('0x17')]();agents[_0x23dda6['destuniqueid']][_0x8d0f('0xb')]=_0x8d0f('0x18');agents[_0x23dda6[_0x8d0f('0x14')]][_0x8d0f('0xa')]=null;agents[_0x23dda6[_0x8d0f('0x14')]][_0x8d0f('0x19')]=null;}catch(_0x22367a){utils[_0x8d0f('0x1a')](_0x22367a[_0x8d0f('0x1b')]);}};exports[_0x8d0f('0x1c')]=function(_0x269230){try{if(!_[_0x8d0f('0x1d')](agents[_0x269230['destuniqueid']])){agents[_0x269230['destuniqueid']][_0x8d0f('0x1c')]=!![];agents[_0x269230[_0x8d0f('0x14')]][_0x8d0f('0x1e')]=utils['now']();agents[_0x269230['destuniqueid']][_0x8d0f('0xb')]=_0x8d0f('0x1f');agents[_0x269230[_0x8d0f('0x14')]]['reason']=_0x8d0f('0x1f');agents[_0x269230['destuniqueid']]['holdtime']=_0x269230['ringtime']?parseInt(_0x269230[_0x8d0f('0x20')])/0x3e8:0x0;agents[_0x269230[_0x8d0f('0x14')]][_0x8d0f('0x21')]=0x0;writeDB(agents[_0x269230['destuniqueid']]);}}catch(_0x3e7fec){utils[_0x8d0f('0x1a')](_0x3e7fec['stack']);}};exports['queuecallerabandon']=function(_0x25408f){try{_[_0x8d0f('0x22')](agents,function(_0x5e4f08,_0x1f7fdb){if(_0x5e4f08[_0x8d0f('0x5')]==_0x25408f['uniqueid']){_0x5e4f08['agentringnoanswer']=!![];_0x5e4f08[_0x8d0f('0x1e')]=utils[_0x8d0f('0x17')]();_0x5e4f08[_0x8d0f('0xb')]='abandoned';_0x5e4f08[_0x8d0f('0x23')]=_0x8d0f('0x24');_0x5e4f08[_0x8d0f('0x25')]=_0x25408f['holdtime'];_0x5e4f08[_0x8d0f('0x21')]=0x0;writeDB(_0x5e4f08);}});}catch(_0x144372){utils[_0x8d0f('0x1a')](_0x144372['stack']);}};exports[_0x8d0f('0x26')]=function(_0x9d276a){try{if(agents[_0x9d276a[_0x8d0f('0x14')]]){agents[_0x9d276a[_0x8d0f('0x14')]]['agentconnectAt']=utils['now']();agents[_0x9d276a[_0x8d0f('0x14')]][_0x8d0f('0xa')]=_0x9d276a[_0x8d0f('0xa')];agents[_0x9d276a[_0x8d0f('0x14')]]['connectedlinename']=_0x9d276a[_0x8d0f('0x19')];agents[_0x9d276a[_0x8d0f('0x14')]][_0x8d0f('0x25')]=_0x9d276a[_0x8d0f('0x20')];agents[_0x9d276a['destuniqueid']][_0x8d0f('0xb')]='connect';_[_0x8d0f('0x22')](agents,function(_0x357d3e,_0x40bfa1){if(_0x357d3e['destuniqueid']!=_0x9d276a[_0x8d0f('0x14')]&&_0x357d3e[_0x8d0f('0x5')]==_0x9d276a[_0x8d0f('0x5')]){_0x357d3e[_0x8d0f('0x21')]=0x0;_0x357d3e[_0x8d0f('0x25')]=_0x9d276a[_0x8d0f('0x20')];_0x357d3e['agentringnoanswer']=!![];_0x357d3e[_0x8d0f('0x1e')]=utils[_0x8d0f('0x17')]();_0x357d3e['lastevent']=_0x8d0f('0x27');_0x357d3e['reason']=_0x8d0f('0x27');_0x357d3e[_0x8d0f('0x28')]=_0x9d276a[_0x8d0f('0x14')];_0x357d3e['answeredelsewheremembername']=_0x9d276a[_0x8d0f('0x7')];writeDB(_0x357d3e);}});}}catch(_0x34ca65){utils[_0x8d0f('0x1a')](_0x34ca65[_0x8d0f('0x1b')]);}};exports[_0x8d0f('0x29')]=function(_0x486909){try{if(!_[_0x8d0f('0x1d')](agents[_0x486909[_0x8d0f('0x14')]])){agents[_0x486909[_0x8d0f('0x14')]][_0x8d0f('0x29')]=!![];agents[_0x486909['destuniqueid']][_0x8d0f('0x2a')]=utils[_0x8d0f('0x17')]();agents[_0x486909[_0x8d0f('0x14')]][_0x8d0f('0x21')]=utils[_0x8d0f('0x2b')](agents[_0x486909['destuniqueid']][_0x8d0f('0x2a')],agents[_0x486909[_0x8d0f('0x14')]][_0x8d0f('0x2c')]);agents[_0x486909[_0x8d0f('0x14')]][_0x8d0f('0x23')]=_0x486909[_0x8d0f('0x23')];agents[_0x486909['destuniqueid']][_0x8d0f('0xb')]=_0x8d0f('0x2d');writeDB(agents[_0x486909[_0x8d0f('0x14')]]);}}catch(_0x2f7f89){utils[_0x8d0f('0x1a')](_0x2f7f89[_0x8d0f('0x1b')]);}};exports[_0x8d0f('0x2e')]=function(_0xbe62b5){try{if(!_[_0x8d0f('0x1d')](agents[_0xbe62b5[_0x8d0f('0x2f')]])){agents[_0xbe62b5['transfereruniqueid']][_0x8d0f('0x30')]=!![];agents[_0xbe62b5[_0x8d0f('0x2f')]][_0x8d0f('0x31')]=_0x8d0f('0x32');agents[_0xbe62b5[_0x8d0f('0x2f')]][_0x8d0f('0x33')]=_0xbe62b5[_0x8d0f('0x34')];agents[_0xbe62b5['transfereruniqueid']][_0x8d0f('0x35')]=agents[_0xbe62b5['transfereruniqueid']][_0x8d0f('0x5')];}}catch(_0x245baf){utils[_0x8d0f('0x1a')](_0x245baf[_0x8d0f('0x1b')]);}};exports[_0x8d0f('0x36')]=function(_0x42dbca){try{if(_0x42dbca[_0x8d0f('0x37')]==_0x42dbca['origtransfererlinkedid']){if(!_[_0x8d0f('0x1d')](agents[_0x42dbca[_0x8d0f('0x38')]])){agents[_0x42dbca['secondtransfereruniqueid']][_0x8d0f('0x30')]=!![];agents[_0x42dbca['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x42dbca[_0x8d0f('0x38')]][_0x8d0f('0x33')]=_0x42dbca[_0x8d0f('0x39')];agents[_0x42dbca[_0x8d0f('0x38')]]['transferuniqueid']=_0x42dbca[_0x8d0f('0x37')];}if(_0x42dbca[_0x8d0f('0x3a')]&&agents[_0x42dbca[_0x8d0f('0x3a')]]){agents[_0x42dbca[_0x8d0f('0x3a')]]['agententerreason']=0x1;transfers[_0x42dbca[_0x8d0f('0x3a')]]=_[_0x8d0f('0x3b')](agents[_0x42dbca[_0x8d0f('0x3a')]]);transfers[_0x42dbca['transfereeuniqueid']][_0x8d0f('0x9')]=agents[_0x42dbca[_0x8d0f('0x38')]]['calleridnum'];transfers[_0x42dbca[_0x8d0f('0x3a')]][_0x8d0f('0x3c')]=agents[_0x42dbca['secondtransfereruniqueid']][_0x8d0f('0x3c')];transfers[_0x42dbca['transfereeuniqueid']][_0x8d0f('0x16')]=utils['now']();transfers[_0x42dbca[_0x8d0f('0x3a')]][_0x8d0f('0x2c')]=utils[_0x8d0f('0x17')]();transfers[_0x42dbca['transfereeuniqueid']][_0x8d0f('0x25')]=0x0;transfers[_0x42dbca[_0x8d0f('0x3a')]]['agententerreason']=0x2;}}else if(_0x42dbca[_0x8d0f('0x38')]==_0x42dbca[_0x8d0f('0x3d')]){if(!_['isNil'](agents[_0x42dbca[_0x8d0f('0x37')]])){agents[_0x42dbca['origtransfereruniqueid']]['transfer']=!![];agents[_0x42dbca[_0x8d0f('0x37')]][_0x8d0f('0x31')]='ATTENDED';agents[_0x42dbca['origtransfereruniqueid']][_0x8d0f('0x33')]=_0x42dbca[_0x8d0f('0x3e')];agents[_0x42dbca['origtransfereruniqueid']]['transferuniqueid']=_0x42dbca[_0x8d0f('0x38')];}if(_0x42dbca[_0x8d0f('0x3f')]&&agents[_0x42dbca['transfertargetuniqueid']]){agents[_0x42dbca['transfertargetuniqueid']][_0x8d0f('0x40')]=0x1;transfers[_0x42dbca[_0x8d0f('0x3f')]]=_[_0x8d0f('0x3b')](agents[_0x42dbca[_0x8d0f('0x3f')]]);transfers[_0x42dbca[_0x8d0f('0x3f')]][_0x8d0f('0x9')]=agents[_0x42dbca[_0x8d0f('0x37')]]['calleridnum'];transfers[_0x42dbca[_0x8d0f('0x3f')]][_0x8d0f('0x3c')]=agents[_0x42dbca[_0x8d0f('0x37')]][_0x8d0f('0x3c')];transfers[_0x42dbca[_0x8d0f('0x3f')]]['agentcalledAt']=utils[_0x8d0f('0x17')]();transfers[_0x42dbca[_0x8d0f('0x3f')]]['agentconnectAt']=utils[_0x8d0f('0x17')]();transfers[_0x42dbca[_0x8d0f('0x3f')]][_0x8d0f('0x25')]=0x0;transfers[_0x42dbca[_0x8d0f('0x3f')]][_0x8d0f('0x40')]=0x2;}}}catch(_0x126f18){utils[_0x8d0f('0x1a')](_0x126f18[_0x8d0f('0x1b')]);}};exports[_0x8d0f('0x41')]=function(_0x2f1945){try{if(transfers[_0x2f1945[_0x8d0f('0x5')]]){transfers[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x29')]=!![];transfers[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x2a')]=utils['now']();transfers[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x21')]=utils[_0x8d0f('0x2b')](transfers[_0x2f1945['uniqueid']][_0x8d0f('0x2a')],transfers[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x2c')]);transfers[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x23')]=_0x8d0f('0x42');transfers[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0xb')]=_0x8d0f('0x2d');writeDB(transfers[_0x2f1945[_0x8d0f('0x5')]],!![]);}if(agents[_0x2f1945['uniqueid']]&&agents[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x2c')]){agents[_0x2f1945['uniqueid']][_0x8d0f('0x29')]=!![];agents[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x2a')]=utils['now']();agents[_0x2f1945['uniqueid']][_0x8d0f('0x21')]=utils[_0x8d0f('0x2b')](agents[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x2a')],agents[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x2c')]);agents[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x23')]=agents[_0x2f1945[_0x8d0f('0x5')]][_0x8d0f('0x30')]?_0x8d0f('0x30'):_0x8d0f('0x42');agents[_0x2f1945[_0x8d0f('0x5')]]['lastevent']=_0x8d0f('0x2d');writeDB(agents[_0x2f1945[_0x8d0f('0x5')]]);}}catch(_0x79102c){utils[_0x8d0f('0x1a')](_0x79102c[_0x8d0f('0x1b')]);}}; \ No newline at end of file +var _0x0d67=['called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','reason','rejected','holdtime','ringtime','talktime','queuecallerabandon','forIn','agentconnect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','extension','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','transferexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwTimeout','request','destuniqueid','agentcalled','agentcalledAt','now'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x0d67,0x6c));var _0x70d6=function(_0x3d64c7,_0x56090c){_0x3d64c7=_0x3d64c7-0x0;var _0x148544=_0x0d67[_0x3d64c7];return _0x148544;};'use strict';var _=require(_0x70d6('0x0'));var util=require(_0x70d6('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x69c2e6,_0x38e377){utils[_0x70d6('0x2')](util[_0x70d6('0x3')](_0x70d6('0x4'),_0x69c2e6[_0x70d6('0x5')],_0x69c2e6['channel'],_0x69c2e6[_0x70d6('0x6')],_0x69c2e6[_0x70d6('0x7')],_0x69c2e6[_0x70d6('0x8')],_0x69c2e6[_0x70d6('0x9')],_0x69c2e6[_0x70d6('0xa')],_0x69c2e6[_0x70d6('0xb')]));if(_0x69c2e6[_0x70d6('0x6')]){utils[_0x70d6('0xc')](_0x69c2e6['queue'])[_0x70d6('0xd')](function(_0x50dc0d){if(_0x50dc0d){_0x69c2e6['type']=_0x50dc0d[_0x70d6('0xe')];_0x69c2e6[_0x70d6('0xf')]=_0x69c2e6[_0x70d6('0x10')]?_0x50dc0d[_0x70d6('0x11')]:![];_0x69c2e6['acwtime']=_0x69c2e6[_0x70d6('0xf')]?_0x50dc0d[_0x70d6('0x12')]:0x0;}utils[_0x70d6('0x13')]('CreateVoiceAgentReport',_0x69c2e6);});}else{utils[_0x70d6('0x13')]('CreateVoiceAgentReport',_0x69c2e6);}if(_0x38e377){delete transfers[_0x69c2e6['uniqueid']];}else{delete agents[_0x69c2e6[_0x70d6('0x14')]];}}exports[_0x70d6('0x15')]=function(_0x41b636){try{agents[_0x41b636['destuniqueid']]=_0x41b636;agents[_0x41b636[_0x70d6('0x14')]][_0x70d6('0x16')]=utils[_0x70d6('0x17')]();agents[_0x41b636[_0x70d6('0x14')]][_0x70d6('0xb')]=_0x70d6('0x18');agents[_0x41b636['destuniqueid']]['connectedlinenum']=null;agents[_0x41b636['destuniqueid']][_0x70d6('0x19')]=null;}catch(_0x4d970a){utils[_0x70d6('0x1a')](_0x4d970a[_0x70d6('0x1b')]);}};exports[_0x70d6('0x1c')]=function(_0x5ab567){try{if(!_[_0x70d6('0x1d')](agents[_0x5ab567[_0x70d6('0x14')]])){agents[_0x5ab567['destuniqueid']][_0x70d6('0x1c')]=!![];agents[_0x5ab567[_0x70d6('0x14')]][_0x70d6('0x1e')]=utils[_0x70d6('0x17')]();agents[_0x5ab567[_0x70d6('0x14')]][_0x70d6('0xb')]='rejected';agents[_0x5ab567[_0x70d6('0x14')]][_0x70d6('0x1f')]=_0x70d6('0x20');agents[_0x5ab567['destuniqueid']][_0x70d6('0x21')]=_0x5ab567['ringtime']?parseInt(_0x5ab567[_0x70d6('0x22')])/0x3e8:0x0;agents[_0x5ab567['destuniqueid']][_0x70d6('0x23')]=0x0;writeDB(agents[_0x5ab567[_0x70d6('0x14')]]);}}catch(_0x29c60c){utils[_0x70d6('0x1a')](_0x29c60c[_0x70d6('0x1b')]);}};exports[_0x70d6('0x24')]=function(_0x38ed1e){try{_[_0x70d6('0x25')](agents,function(_0x363f5e,_0x40d61d){if(_0x363f5e['uniqueid']==_0x38ed1e[_0x70d6('0x5')]){_0x363f5e[_0x70d6('0x1c')]=!![];_0x363f5e['agentringnoanswerAt']=utils[_0x70d6('0x17')]();_0x363f5e['lastevent']='abandoned';_0x363f5e[_0x70d6('0x1f')]='abandoned';_0x363f5e[_0x70d6('0x21')]=_0x38ed1e['holdtime'];_0x363f5e[_0x70d6('0x23')]=0x0;writeDB(_0x363f5e);}});}catch(_0x387dd8){utils[_0x70d6('0x1a')](_0x387dd8[_0x70d6('0x1b')]);}};exports[_0x70d6('0x26')]=function(_0x5b6a79){try{if(agents[_0x5b6a79[_0x70d6('0x14')]]){agents[_0x5b6a79[_0x70d6('0x14')]][_0x70d6('0x27')]=utils[_0x70d6('0x17')]();agents[_0x5b6a79['destuniqueid']]['connectedlinenum']=_0x5b6a79[_0x70d6('0xa')];agents[_0x5b6a79[_0x70d6('0x14')]][_0x70d6('0x19')]=_0x5b6a79[_0x70d6('0x19')];agents[_0x5b6a79['destuniqueid']][_0x70d6('0x21')]=_0x5b6a79['ringtime'];agents[_0x5b6a79[_0x70d6('0x14')]][_0x70d6('0xb')]='connect';_[_0x70d6('0x25')](agents,function(_0x32e4d1,_0x22070e){if(_0x32e4d1[_0x70d6('0x14')]!=_0x5b6a79[_0x70d6('0x14')]&&_0x32e4d1[_0x70d6('0x5')]==_0x5b6a79[_0x70d6('0x5')]){_0x32e4d1['talktime']=0x0;_0x32e4d1[_0x70d6('0x21')]=_0x5b6a79[_0x70d6('0x22')];_0x32e4d1[_0x70d6('0x1c')]=!![];_0x32e4d1[_0x70d6('0x1e')]=utils[_0x70d6('0x17')]();_0x32e4d1[_0x70d6('0xb')]=_0x70d6('0x28');_0x32e4d1[_0x70d6('0x1f')]=_0x70d6('0x28');_0x32e4d1[_0x70d6('0x29')]=_0x5b6a79[_0x70d6('0x14')];_0x32e4d1[_0x70d6('0x2a')]=_0x5b6a79[_0x70d6('0x7')];writeDB(_0x32e4d1);}});}}catch(_0x1db2b6){utils['error'](_0x1db2b6[_0x70d6('0x1b')]);}};exports[_0x70d6('0x10')]=function(_0x79f07a){try{if(!_['isNil'](agents[_0x79f07a['destuniqueid']])){agents[_0x79f07a['destuniqueid']]['agentcomplete']=!![];agents[_0x79f07a[_0x70d6('0x14')]][_0x70d6('0x2b')]=utils['now']();agents[_0x79f07a['destuniqueid']][_0x70d6('0x23')]=utils[_0x70d6('0x2c')](agents[_0x79f07a[_0x70d6('0x14')]][_0x70d6('0x2b')],agents[_0x79f07a[_0x70d6('0x14')]][_0x70d6('0x27')]);agents[_0x79f07a[_0x70d6('0x14')]][_0x70d6('0x1f')]=_0x79f07a[_0x70d6('0x1f')];agents[_0x79f07a[_0x70d6('0x14')]][_0x70d6('0xb')]=_0x70d6('0x2d');writeDB(agents[_0x79f07a[_0x70d6('0x14')]]);}}catch(_0x46948d){utils['error'](_0x46948d['stack']);}};exports[_0x70d6('0x2e')]=function(_0x496910){try{if(!_['isNil'](agents[_0x496910[_0x70d6('0x2f')]])){agents[_0x496910[_0x70d6('0x2f')]][_0x70d6('0x30')]=!![];agents[_0x496910[_0x70d6('0x2f')]][_0x70d6('0x31')]='blind';agents[_0x496910[_0x70d6('0x2f')]]['transferexten']=_0x496910[_0x70d6('0x32')];agents[_0x496910[_0x70d6('0x2f')]]['transferuniqueid']=agents[_0x496910[_0x70d6('0x2f')]][_0x70d6('0x5')];}}catch(_0x35c36c){utils[_0x70d6('0x1a')](_0x35c36c[_0x70d6('0x1b')]);}};exports[_0x70d6('0x33')]=function(_0x17db10){try{if(_0x17db10[_0x70d6('0x34')]==_0x17db10['origtransfererlinkedid']){if(!_[_0x70d6('0x1d')](agents[_0x17db10[_0x70d6('0x35')]])){agents[_0x17db10[_0x70d6('0x35')]][_0x70d6('0x30')]=!![];agents[_0x17db10[_0x70d6('0x35')]][_0x70d6('0x31')]=_0x70d6('0x36');agents[_0x17db10[_0x70d6('0x35')]][_0x70d6('0x37')]=_0x17db10['origtransfererexten'];agents[_0x17db10[_0x70d6('0x35')]][_0x70d6('0x38')]=_0x17db10[_0x70d6('0x34')];}if(_0x17db10[_0x70d6('0x39')]&&agents[_0x17db10[_0x70d6('0x39')]]){agents[_0x17db10[_0x70d6('0x39')]][_0x70d6('0x3a')]=0x1;transfers[_0x17db10[_0x70d6('0x39')]]=_[_0x70d6('0x3b')](agents[_0x17db10['transfereeuniqueid']]);transfers[_0x17db10[_0x70d6('0x39')]][_0x70d6('0x9')]=agents[_0x17db10['secondtransfereruniqueid']][_0x70d6('0x9')];transfers[_0x17db10[_0x70d6('0x39')]][_0x70d6('0x3c')]=agents[_0x17db10['secondtransfereruniqueid']][_0x70d6('0x3c')];transfers[_0x17db10[_0x70d6('0x39')]][_0x70d6('0x16')]=utils[_0x70d6('0x17')]();transfers[_0x17db10['transfereeuniqueid']]['agentconnectAt']=utils[_0x70d6('0x17')]();transfers[_0x17db10[_0x70d6('0x39')]][_0x70d6('0x21')]=0x0;transfers[_0x17db10[_0x70d6('0x39')]][_0x70d6('0x3a')]=0x2;}}else if(_0x17db10[_0x70d6('0x35')]==_0x17db10[_0x70d6('0x3d')]){if(!_[_0x70d6('0x1d')](agents[_0x17db10[_0x70d6('0x34')]])){agents[_0x17db10[_0x70d6('0x34')]][_0x70d6('0x30')]=!![];agents[_0x17db10[_0x70d6('0x34')]]['transfertype']=_0x70d6('0x36');agents[_0x17db10[_0x70d6('0x34')]][_0x70d6('0x37')]=_0x17db10[_0x70d6('0x3e')];agents[_0x17db10[_0x70d6('0x34')]][_0x70d6('0x38')]=_0x17db10[_0x70d6('0x35')];}if(_0x17db10[_0x70d6('0x3f')]&&agents[_0x17db10[_0x70d6('0x3f')]]){agents[_0x17db10[_0x70d6('0x3f')]][_0x70d6('0x3a')]=0x1;transfers[_0x17db10[_0x70d6('0x3f')]]=_[_0x70d6('0x3b')](agents[_0x17db10[_0x70d6('0x3f')]]);transfers[_0x17db10[_0x70d6('0x3f')]][_0x70d6('0x9')]=agents[_0x17db10[_0x70d6('0x34')]][_0x70d6('0x9')];transfers[_0x17db10[_0x70d6('0x3f')]][_0x70d6('0x3c')]=agents[_0x17db10[_0x70d6('0x34')]]['calleridname'];transfers[_0x17db10['transfertargetuniqueid']][_0x70d6('0x16')]=utils[_0x70d6('0x17')]();transfers[_0x17db10[_0x70d6('0x3f')]][_0x70d6('0x27')]=utils[_0x70d6('0x17')]();transfers[_0x17db10['transfertargetuniqueid']][_0x70d6('0x21')]=0x0;transfers[_0x17db10[_0x70d6('0x3f')]][_0x70d6('0x3a')]=0x2;}}}catch(_0x567734){utils[_0x70d6('0x1a')](_0x567734[_0x70d6('0x1b')]);}};exports[_0x70d6('0x40')]=function(_0x343be8){try{if(transfers[_0x343be8[_0x70d6('0x5')]]){transfers[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x10')]=!![];transfers[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x2b')]=utils[_0x70d6('0x17')]();transfers[_0x343be8['uniqueid']][_0x70d6('0x23')]=utils[_0x70d6('0x2c')](transfers[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x2b')],transfers[_0x343be8['uniqueid']][_0x70d6('0x27')]);transfers[_0x343be8[_0x70d6('0x5')]]['reason']='agent';transfers[_0x343be8[_0x70d6('0x5')]][_0x70d6('0xb')]=_0x70d6('0x2d');writeDB(transfers[_0x343be8[_0x70d6('0x5')]],!![]);}if(agents[_0x343be8['uniqueid']]&&agents[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x27')]){agents[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x10')]=!![];agents[_0x343be8[_0x70d6('0x5')]]['agentcompleteAt']=utils[_0x70d6('0x17')]();agents[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x23')]=utils['diffTime'](agents[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x2b')],agents[_0x343be8['uniqueid']][_0x70d6('0x27')]);agents[_0x343be8[_0x70d6('0x5')]]['reason']=agents[_0x343be8[_0x70d6('0x5')]][_0x70d6('0x30')]?'transfer':_0x70d6('0x41');agents[_0x343be8['uniqueid']][_0x70d6('0xb')]=_0x70d6('0x2d');writeDB(agents[_0x343be8[_0x70d6('0x5')]]);}}catch(_0x442dc7){utils[_0x70d6('0x1a')](_0x442dc7[_0x70d6('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3a9bd9e..5efa05f 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 _0xda5b=['Queue','lastdata','queue','xmd-contactid','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','execif','set','gotoif','application','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','channel','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','CreateVoiceCallReport','uniqueid','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','context','now','DOCUMENTATION','error','newstate','channelstate','systemanswertime','isNil','transfer','destinationchannel','answertime','toNumber','stack','hangup','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','musiconholdstart','musiconholdstop','mohtime','musiconholdstartAt','variable','xmd-originatecalleridnum','xmd-phone','\x22\x20<','value','xmcs-queue'];(function(_0x280e6c,_0x579eca){var _0x3c7b99=function(_0x205c92){while(--_0x205c92){_0x280e6c['push'](_0x280e6c['shift']());}};_0x3c7b99(++_0x579eca);}(_0xda5b,0x15a));var _0xbda5=function(_0x3ef5bb,_0x27e3ac){_0x3ef5bb=_0x3ef5bb-0x0;var _0x59d620=_0xda5b[_0x3ef5bb];return _0x59d620;};'use strict';var _=require(_0xbda5('0x0'));var util=require(_0xbda5('0x1'));var utils=require(_0xbda5('0x2'));var dispositions=[_0xbda5('0x3'),_0xbda5('0x4'),_0xbda5('0x4'),_0xbda5('0x3'),_0xbda5('0x3'),_0xbda5('0x3'),_0xbda5('0x5'),_0xbda5('0x6'),_0xbda5('0x4'),'FAILED',_0xbda5('0x4')];var channels={};function writeDB(_0x3771dc){utils[_0xbda5('0x7')](util['format']('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x3771dc['uniqueid'],_0x3771dc[_0xbda5('0x8')],_0x3771dc[_0xbda5('0x9')],_0x3771dc[_0xbda5('0xa')],_0x3771dc[_0xbda5('0xb')],_0x3771dc[_0xbda5('0xc')],_0x3771dc[_0xbda5('0xd')],_0x3771dc[_0xbda5('0xe')]));if(_0x3771dc[_0xbda5('0xa')]){utils[_0xbda5('0xf')](_0x3771dc[_0xbda5('0xa')])[_0xbda5('0x10')](function(_0x5255ec){if(_0x5255ec){_0x3771dc['UserId']=_0x5255ec['id'];}utils['request'](_0xbda5('0x11'),_0x3771dc);});}else{utils['request'](_0xbda5('0x11'),_0x3771dc);}if(channels[_0x3771dc['uniqueid']]){delete channels[_0x3771dc[_0xbda5('0x12')]];}}exports[_0xbda5('0x13')]=function(_0x29906e){try{if(_0x29906e[_0xbda5('0x12')]==_0x29906e[_0xbda5('0x14')]&&_0x29906e[_0xbda5('0x8')]!=_0xbda5('0x15')){channels[_0x29906e[_0xbda5('0x12')]]={'uniqueid':_0x29906e[_0xbda5('0x12')],'accountcode':_0x29906e[_0xbda5('0xa')],'source':_0x29906e[_0xbda5('0x16')],'destination':_0x29906e['exten'],'destinationcontext':_0x29906e[_0xbda5('0x17')],'channel':_0x29906e[_0xbda5('0x8')],'starttime':utils[_0xbda5('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xbda5('0x3'),'amaflags':_0xbda5('0x19')};}}catch(_0x4c7484){utils[_0xbda5('0x1a')](_0x4c7484['stack']);}};exports[_0xbda5('0x1b')]=function(_0x1ae125){try{if(!_['isNil'](channels[_0x1ae125['uniqueid']])&&_0x1ae125[_0xbda5('0x1c')]==0x6){if(_['isNil'](channels[_0x1ae125[_0xbda5('0x12')]][_0xbda5('0x1d')])){channels[_0x1ae125[_0xbda5('0x12')]]['systemanswertime']=utils['now']();}}else if(!_[_0xbda5('0x1e')](channels[_0x1ae125[_0xbda5('0x14')]])&&_0x1ae125['channelstate']==0x6&&_0x1ae125[_0xbda5('0x17')]!=_0xbda5('0x1f')){channels[_0x1ae125[_0xbda5('0x14')]][_0xbda5('0xa')]=_0x1ae125['accountcode'];channels[_0x1ae125[_0xbda5('0x14')]][_0xbda5('0x20')]=_0x1ae125[_0xbda5('0x8')];if(_[_0xbda5('0x1e')](channels[_0x1ae125[_0xbda5('0x14')]]['answertime'])){channels[_0x1ae125[_0xbda5('0x14')]][_0xbda5('0x21')]=utils[_0xbda5('0x18')]();}channels[_0x1ae125[_0xbda5('0x14')]][_0xbda5('0xe')]=dispositions[_[_0xbda5('0x22')](_0x1ae125['channelstate'])]||_0xbda5('0x5');}}catch(_0xdb3cd1){utils[_0xbda5('0x1a')](_0xdb3cd1[_0xbda5('0x23')]);}};exports[_0xbda5('0x24')]=function(_0xbb3d70){try{if(!_[_0xbda5('0x1e')](channels[_0xbb3d70[_0xbda5('0x12')]])){if(_[_0xbda5('0x1e')](channels[_0xbb3d70[_0xbda5('0x12')]]['callerid'])){channels[_0xbb3d70[_0xbda5('0x12')]][_0xbda5('0xd')]=_0xbb3d70[_0xbda5('0x25')]+'\x20<'+_0xbb3d70[_0xbda5('0x16')]+'>';}channels[_0xbb3d70[_0xbda5('0x12')]][_0xbda5('0x26')]=utils[_0xbda5('0x18')]();channels[_0xbb3d70[_0xbda5('0x12')]][_0xbda5('0x27')]=utils[_0xbda5('0x28')](channels[_0xbb3d70['uniqueid']]['endtime'],channels[_0xbb3d70[_0xbda5('0x12')]][_0xbda5('0x29')]);channels[_0xbb3d70[_0xbda5('0x12')]][_0xbda5('0x2a')]=channels[_0xbb3d70[_0xbda5('0x12')]]['answertime']?utils[_0xbda5('0x28')](channels[_0xbb3d70['uniqueid']][_0xbda5('0x26')],channels[_0xbb3d70[_0xbda5('0x12')]][_0xbda5('0x21')]):0x0;writeDB(channels[_0xbb3d70[_0xbda5('0x12')]]);}}catch(_0x8ce3de){utils['error'](_0x8ce3de[_0xbda5('0x23')]);}};exports[_0xbda5('0x2b')]=function(_0x54c2cf){try{if(!_['isNil'](channels[_0x54c2cf[_0xbda5('0x2c')]])){if(channels[_0x54c2cf[_0xbda5('0x2c')]][_0xbda5('0x8')]==_0x54c2cf[_0xbda5('0x2d')]){channels[_0x54c2cf['localtwolinkedid']]['destinationchannel']=_0x54c2cf[_0xbda5('0x2e')];channels[_0x54c2cf[_0xbda5('0x2c')]]['userfield']=_0xbda5('0x2f');}else if(channels[_0x54c2cf[_0xbda5('0x2c')]]['channel']=_0x54c2cf[_0xbda5('0x30')]){channels[_0x54c2cf[_0xbda5('0x2c')]][_0xbda5('0x20')]=_0x54c2cf['origtransfererchannel'];channels[_0x54c2cf[_0xbda5('0x2c')]]['userfield']=_0xbda5('0x2f');}}}catch(_0x3a8439){utils[_0xbda5('0x1a')](_0x3a8439[_0xbda5('0x23')]);}};exports[_0xbda5('0x31')]=function(_0x5656b3){try{if(!_[_0xbda5('0x1e')](channels[_0x5656b3['uniqueid']])){channels[_0x5656b3[_0xbda5('0x12')]]['musiconholdstartAt']=utils[_0xbda5('0x18')]();}}catch(_0x1bcf77){utils[_0xbda5('0x1a')](_0x1bcf77[_0xbda5('0x23')]);}};exports[_0xbda5('0x32')]=function(_0x4c79fe){try{if(!_[_0xbda5('0x1e')](channels[_0x4c79fe[_0xbda5('0x12')]])){if(!_['isNil'](channels[_0x4c79fe['uniqueid']]['musiconholdstartAt'])){channels[_0x4c79fe[_0xbda5('0x12')]][_0xbda5('0x33')]+=utils[_0xbda5('0x28')](utils['now'](),channels[_0x4c79fe[_0xbda5('0x12')]][_0xbda5('0x34')]);delete channels[_0x4c79fe[_0xbda5('0x12')]][_0xbda5('0x34')];}}}catch(_0x2fd798){utils[_0xbda5('0x1a')](_0x2fd798[_0xbda5('0x23')]);}};exports['varset']=function(_0x30438b){try{if(!_[_0xbda5('0x1e')](channels[_0x30438b[_0xbda5('0x12')]])){if(!_[_0xbda5('0x1e')](_0x30438b[_0xbda5('0x35')][_0xbda5('0x36')])){channels[_0x30438b[_0xbda5('0x12')]]['source']=_0x30438b['value'];}if(!_[_0xbda5('0x1e')](_0x30438b[_0xbda5('0x35')][_0xbda5('0x37')])){channels[_0x30438b[_0xbda5('0x12')]][_0xbda5('0xc')]=_0x30438b['value'];channels[_0x30438b['uniqueid']][_0xbda5('0xd')]='\x22'+_0x30438b['value']+_0xbda5('0x38')+_0x30438b[_0xbda5('0x39')]+'>';}if(!_[_0xbda5('0x1e')](_0x30438b['variable']['xmd-callerid-preview'])||!_[_0xbda5('0x1e')](_0x30438b[_0xbda5('0x35')]['xmd-callerid'])){channels[_0x30438b[_0xbda5('0x12')]]['callerid']=_0x30438b[_0xbda5('0x39')];}if(!_[_0xbda5('0x1e')](_0x30438b[_0xbda5('0x35')]['xmd-queue'])||!_[_0xbda5('0x1e')](_0x30438b['variable'][_0xbda5('0x3a')])){channels[_0x30438b['uniqueid']]['lastapplication']=_0xbda5('0x3b');channels[_0x30438b[_0xbda5('0x12')]][_0xbda5('0x3c')]=_0x30438b['value'];channels[_0x30438b[_0xbda5('0x12')]][_0xbda5('0x3d')]=!![];}if(!_[_0xbda5('0x1e')](_0x30438b[_0xbda5('0x35')][_0xbda5('0x3e')])){channels[_0x30438b['uniqueid']]['ContactId']=_0x30438b[_0xbda5('0x39')];}if(!_['isNil'](_0x30438b[_0xbda5('0x35')][_0xbda5('0x3f')])){channels[_0x30438b[_0xbda5('0x12')]][_0xbda5('0x9')]=_0x30438b[_0xbda5('0x39')];}if(!_[_0xbda5('0x1e')](_0x30438b['variable'][_0xbda5('0x40')])){channels[_0x30438b[_0xbda5('0x12')]][_0xbda5('0x41')]=_0x30438b['value'];}if(!_[_0xbda5('0x1e')](_0x30438b[_0xbda5('0x35')][_0xbda5('0x42')])){channels[_0x30438b[_0xbda5('0x12')]][_0xbda5('0x42')]=_0x30438b[_0xbda5('0x39')];}}}catch(_0x33f63e){utils[_0xbda5('0x1a')](_0x33f63e[_0xbda5('0x23')]);}};exports[_0xbda5('0x43')]=function(_0x331622){try{if(!_[_0xbda5('0x1e')](channels[_0x331622[_0xbda5('0x12')]])){if(_0x331622['application'][_0xbda5('0x44')]()=='set'&&_[_0xbda5('0x45')](_0x331622[_0xbda5('0x46')]['toLowerCase'](),_0xbda5('0x47'))){var _0x88be91=_0x331622[_0xbda5('0x46')][_0xbda5('0x48')]('=');var _0x597681=_0x88be91[0x0][_0xbda5('0x49')](_0x88be91[0x0][_0xbda5('0x4a')]('(')+0x1,_0x88be91[0x0][_0xbda5('0x4a')](')'));var _0x4c0ab1=_0x88be91[0x1];channels[_0x331622[_0xbda5('0x12')]][_0x597681]=_0x4c0ab1;}if(!_[_0xbda5('0x4b')]([_0xbda5('0x24'),'noop',_0xbda5('0x4c'),_0xbda5('0x4d'),_0xbda5('0x4e')],_0x331622[_0xbda5('0x4f')][_0xbda5('0x44')]())){channels[_0x331622[_0xbda5('0x12')]][_0xbda5('0x50')]=_0x331622['application'];channels[_0x331622[_0xbda5('0x12')]]['lastdata']=_0x331622[_0xbda5('0x46')];}}}catch(_0x9808fc){utils[_0xbda5('0x1a')](_0x9808fc[_0xbda5('0x23')]);}}; \ No newline at end of file +var _0x9c44=['isNil','systemanswertime','destinationchannel','answertime','error','hangup','calleridname','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','sipcallid','application','toLowerCase','startsWith','cdr','split','lastIndexOf','includes','noop','execif','gotoif','appdata','lodash','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','context','now','DOCUMENTATION','stack','newstate','channelstate'];(function(_0x33837f,_0x197190){var _0x5cadb4=function(_0x16024f){while(--_0x16024f){_0x33837f['push'](_0x33837f['shift']());}};_0x5cadb4(++_0x197190);}(_0x9c44,0xd3));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x49c4('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0x49c4('0x1'),_0x49c4('0x2'),'FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x49c4('0x1'),_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x2'),_0x49c4('0x2'),_0x49c4('0x2')];var channels={};function writeDB(_0x53fe61){utils['info'](util[_0x49c4('0x5')](_0x49c4('0x6'),_0x53fe61[_0x49c4('0x7')],_0x53fe61[_0x49c4('0x8')],_0x53fe61[_0x49c4('0x9')],_0x53fe61[_0x49c4('0xa')],_0x53fe61[_0x49c4('0xb')],_0x53fe61['destination'],_0x53fe61[_0x49c4('0xc')],_0x53fe61[_0x49c4('0xd')]));if(_0x53fe61[_0x49c4('0xa')]){utils[_0x49c4('0xe')](_0x53fe61[_0x49c4('0xa')])[_0x49c4('0xf')](function(_0x54d94f){if(_0x54d94f){_0x53fe61[_0x49c4('0x10')]=_0x54d94f['id'];}utils[_0x49c4('0x11')](_0x49c4('0x12'),_0x53fe61);});}else{utils[_0x49c4('0x11')]('CreateVoiceCallReport',_0x53fe61);}if(channels[_0x53fe61[_0x49c4('0x7')]]){delete channels[_0x53fe61[_0x49c4('0x7')]];}}exports[_0x49c4('0x13')]=function(_0xe23c61){try{if(_0xe23c61[_0x49c4('0x7')]==_0xe23c61[_0x49c4('0x14')]&&_0xe23c61[_0x49c4('0x8')]!=_0x49c4('0x15')){channels[_0xe23c61[_0x49c4('0x7')]]={'uniqueid':_0xe23c61[_0x49c4('0x7')],'accountcode':_0xe23c61[_0x49c4('0xa')],'source':_0xe23c61[_0x49c4('0x16')],'destination':_0xe23c61['exten'],'destinationcontext':_0xe23c61[_0x49c4('0x17')],'channel':_0xe23c61[_0x49c4('0x8')],'starttime':utils[_0x49c4('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x49c4('0x1'),'amaflags':_0x49c4('0x19')};}}catch(_0xbb495f){utils['error'](_0xbb495f[_0x49c4('0x1a')]);}};exports[_0x49c4('0x1b')]=function(_0x1d5c5c){try{if(!_['isNil'](channels[_0x1d5c5c[_0x49c4('0x7')]])&&_0x1d5c5c[_0x49c4('0x1c')]==0x6){if(_[_0x49c4('0x1d')](channels[_0x1d5c5c[_0x49c4('0x7')]][_0x49c4('0x1e')])){channels[_0x1d5c5c[_0x49c4('0x7')]][_0x49c4('0x1e')]=utils[_0x49c4('0x18')]();}}else if(!_[_0x49c4('0x1d')](channels[_0x1d5c5c[_0x49c4('0x14')]])&&_0x1d5c5c[_0x49c4('0x1c')]==0x6&&_0x1d5c5c[_0x49c4('0x17')]!='transfer'){channels[_0x1d5c5c[_0x49c4('0x14')]][_0x49c4('0xa')]=_0x1d5c5c[_0x49c4('0xa')];channels[_0x1d5c5c[_0x49c4('0x14')]][_0x49c4('0x1f')]=_0x1d5c5c[_0x49c4('0x8')];if(_[_0x49c4('0x1d')](channels[_0x1d5c5c['linkedid']][_0x49c4('0x20')])){channels[_0x1d5c5c[_0x49c4('0x14')]]['answertime']=utils[_0x49c4('0x18')]();}channels[_0x1d5c5c[_0x49c4('0x14')]][_0x49c4('0xd')]=dispositions[_['toNumber'](_0x1d5c5c[_0x49c4('0x1c')])]||_0x49c4('0x3');}}catch(_0x1f978c){utils[_0x49c4('0x21')](_0x1f978c['stack']);}};exports[_0x49c4('0x22')]=function(_0x4dc52d){try{if(!_[_0x49c4('0x1d')](channels[_0x4dc52d[_0x49c4('0x7')]])){if(_[_0x49c4('0x1d')](channels[_0x4dc52d[_0x49c4('0x7')]][_0x49c4('0xc')])){channels[_0x4dc52d[_0x49c4('0x7')]][_0x49c4('0xc')]=_0x4dc52d[_0x49c4('0x23')]+'\x20<'+_0x4dc52d[_0x49c4('0x16')]+'>';}channels[_0x4dc52d['uniqueid']]['endtime']=utils['now']();channels[_0x4dc52d[_0x49c4('0x7')]][_0x49c4('0x24')]=utils[_0x49c4('0x25')](channels[_0x4dc52d['uniqueid']][_0x49c4('0x26')],channels[_0x4dc52d[_0x49c4('0x7')]][_0x49c4('0x27')]);channels[_0x4dc52d[_0x49c4('0x7')]][_0x49c4('0x28')]=channels[_0x4dc52d[_0x49c4('0x7')]]['answertime']?utils['diffTime'](channels[_0x4dc52d[_0x49c4('0x7')]][_0x49c4('0x26')],channels[_0x4dc52d[_0x49c4('0x7')]][_0x49c4('0x20')]):0x0;writeDB(channels[_0x4dc52d[_0x49c4('0x7')]]);}}catch(_0x2771f1){utils['error'](_0x2771f1[_0x49c4('0x1a')]);}};exports[_0x49c4('0x29')]=function(_0x33b301){try{if(!_[_0x49c4('0x1d')](channels[_0x33b301['localtwolinkedid']])){if(channels[_0x33b301[_0x49c4('0x2a')]][_0x49c4('0x8')]==_0x33b301['transfereechannel']){channels[_0x33b301[_0x49c4('0x2a')]][_0x49c4('0x1f')]=_0x33b301[_0x49c4('0x2b')];channels[_0x33b301[_0x49c4('0x2a')]][_0x49c4('0x2c')]=_0x49c4('0x2d');}else if(channels[_0x33b301[_0x49c4('0x2a')]][_0x49c4('0x8')]=_0x33b301[_0x49c4('0x2e')]){channels[_0x33b301[_0x49c4('0x2a')]]['destinationchannel']=_0x33b301[_0x49c4('0x2f')];channels[_0x33b301[_0x49c4('0x2a')]][_0x49c4('0x2c')]=_0x49c4('0x2d');}}}catch(_0x55aaae){utils[_0x49c4('0x21')](_0x55aaae[_0x49c4('0x1a')]);}};exports['musiconholdstart']=function(_0x21e63e){try{if(!_[_0x49c4('0x1d')](channels[_0x21e63e[_0x49c4('0x7')]])){channels[_0x21e63e[_0x49c4('0x7')]][_0x49c4('0x30')]=utils[_0x49c4('0x18')]();}}catch(_0x29587a){utils[_0x49c4('0x21')](_0x29587a[_0x49c4('0x1a')]);}};exports[_0x49c4('0x31')]=function(_0x3cfa23){try{if(!_[_0x49c4('0x1d')](channels[_0x3cfa23[_0x49c4('0x7')]])){if(!_[_0x49c4('0x1d')](channels[_0x3cfa23['uniqueid']]['musiconholdstartAt'])){channels[_0x3cfa23['uniqueid']][_0x49c4('0x32')]+=utils[_0x49c4('0x25')](utils[_0x49c4('0x18')](),channels[_0x3cfa23[_0x49c4('0x7')]][_0x49c4('0x30')]);delete channels[_0x3cfa23[_0x49c4('0x7')]][_0x49c4('0x30')];}}}catch(_0x2e5853){utils[_0x49c4('0x21')](_0x2e5853[_0x49c4('0x1a')]);}};exports[_0x49c4('0x33')]=function(_0x2b3c17){try{if(!_[_0x49c4('0x1d')](channels[_0x2b3c17[_0x49c4('0x7')]])){if(!_['isNil'](_0x2b3c17[_0x49c4('0x34')]['xmd-originatecalleridnum'])){channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0xb')]=_0x2b3c17[_0x49c4('0x35')];}if(!_['isNil'](_0x2b3c17['variable'][_0x49c4('0x36')])){channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0x37')]=_0x2b3c17[_0x49c4('0x35')];channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0xc')]='\x22'+_0x2b3c17[_0x49c4('0x35')]+_0x49c4('0x38')+_0x2b3c17[_0x49c4('0x35')]+'>';}if(!_[_0x49c4('0x1d')](_0x2b3c17[_0x49c4('0x34')][_0x49c4('0x39')])||!_[_0x49c4('0x1d')](_0x2b3c17[_0x49c4('0x34')][_0x49c4('0x3a')])){channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0xc')]=_0x2b3c17[_0x49c4('0x35')];}if(!_['isNil'](_0x2b3c17['variable'][_0x49c4('0x3b')])||!_['isNil'](_0x2b3c17['variable'][_0x49c4('0x3c')])){channels[_0x2b3c17['uniqueid']][_0x49c4('0x3d')]=_0x49c4('0x3e');channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0x3f')]=_0x2b3c17['value'];channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0x40')]=!![];}if(!_[_0x49c4('0x1d')](_0x2b3c17[_0x49c4('0x34')][_0x49c4('0x41')])){channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0x42')]=_0x2b3c17[_0x49c4('0x35')];}if(!_[_0x49c4('0x1d')](_0x2b3c17[_0x49c4('0x34')][_0x49c4('0x43')])){channels[_0x2b3c17[_0x49c4('0x7')]]['type']=_0x2b3c17['value'];}if(!_[_0x49c4('0x1d')](_0x2b3c17[_0x49c4('0x34')]['outboundrouteid'])){channels[_0x2b3c17[_0x49c4('0x7')]]['routeid']=_0x2b3c17[_0x49c4('0x35')];}if(!_[_0x49c4('0x1d')](_0x2b3c17[_0x49c4('0x34')][_0x49c4('0x44')])){channels[_0x2b3c17[_0x49c4('0x7')]][_0x49c4('0x44')]=_0x2b3c17[_0x49c4('0x35')];}}}catch(_0x136f72){utils[_0x49c4('0x21')](_0x136f72[_0x49c4('0x1a')]);}};exports['newexten']=function(_0x18bfca){try{if(!_[_0x49c4('0x1d')](channels[_0x18bfca['uniqueid']])){if(_0x18bfca[_0x49c4('0x45')][_0x49c4('0x46')]()=='set'&&_[_0x49c4('0x47')](_0x18bfca['appdata']['toLowerCase'](),_0x49c4('0x48'))){var _0x51ac20=_0x18bfca['appdata'][_0x49c4('0x49')]('=');var _0x5e802e=_0x51ac20[0x0]['substring'](_0x51ac20[0x0][_0x49c4('0x4a')]('(')+0x1,_0x51ac20[0x0][_0x49c4('0x4a')](')'));var _0x4bee0b=_0x51ac20[0x1];channels[_0x18bfca[_0x49c4('0x7')]][_0x5e802e]=_0x4bee0b;}if(!_[_0x49c4('0x4b')](['hangup',_0x49c4('0x4c'),_0x49c4('0x4d'),'set',_0x49c4('0x4e')],_0x18bfca[_0x49c4('0x45')][_0x49c4('0x46')]())){channels[_0x18bfca[_0x49c4('0x7')]]['lastapplication']=_0x18bfca[_0x49c4('0x45')];channels[_0x18bfca[_0x49c4('0x7')]][_0x49c4('0x3f')]=_0x18bfca[_0x49c4('0x4f')];}}}catch(_0x3d4a66){utils[_0x49c4('0x21')](_0x3d4a66[_0x49c4('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c67f796..28cd25d 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 _0x31f0=['close','CLOSE','managerevent','./utils','connect','CONNECTED','shutdown','info','SHUTDOWN','FULLYBOOTED'];(function(_0xe9dcd7,_0x4f9094){var _0x445cff=function(_0x184179){while(--_0x184179){_0xe9dcd7['push'](_0xe9dcd7['shift']());}};_0x445cff(++_0x4f9094);}(_0x31f0,0xb7));var _0x031f=function(_0x46d3e4,_0x241ce5){_0x46d3e4=_0x46d3e4-0x0;var _0xa6a8b6=_0x31f0[_0x46d3e4];return _0xa6a8b6;};'use strict';var utils=require(_0x031f('0x0'));var _=require('lodash');exports[_0x031f('0x1')]=function(){utils['info'](_0x031f('0x2'));};exports[_0x031f('0x3')]=function(){utils[_0x031f('0x4')](_0x031f('0x5'));};exports['fullybooted']=function(){utils[_0x031f('0x4')](_0x031f('0x6'));};exports['error']=function(_0x4c0f94){utils['error'](_0x4c0f94);};exports[_0x031f('0x7')]=function(){utils['info'](_0x031f('0x8'));};exports[_0x031f('0x9')]=function(_0x2569b6){}; \ No newline at end of file +var _0x84ab=['info','CONNECTED','SHUTDOWN','FULLYBOOTED','error','managerevent','./utils','lodash','connect'];(function(_0x5612d8,_0x532c17){var _0x5679c7=function(_0x3877bc){while(--_0x3877bc){_0x5612d8['push'](_0x5612d8['shift']());}};_0x5679c7(++_0x532c17);}(_0x84ab,0x12f));var _0xb84a=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x84ab[_0x3825a8];return _0xabc9bc;};'use strict';var utils=require(_0xb84a('0x0'));var _=require(_0xb84a('0x1'));exports[_0xb84a('0x2')]=function(){utils[_0xb84a('0x3')](_0xb84a('0x4'));};exports['shutdown']=function(){utils[_0xb84a('0x3')](_0xb84a('0x5'));};exports['fullybooted']=function(){utils[_0xb84a('0x3')](_0xb84a('0x6'));};exports[_0xb84a('0x7')]=function(_0x5b9def){utils['error'](_0x5b9def);};exports['close']=function(){utils[_0xb84a('0x3')]('CLOSE');};exports[_0xb84a('0x8')]=function(_0x8d9dbe){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index c8463f9..6212176 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 _0x502d=['set','startsWith','toLowerCase','appdata','split','error','stack','varset','isNil','variable','outboundrouteid','value','dialbegin','assign','starttime','lastevent','called','dialend','dialstatus','ANSWER','answertime','now','connect','hangup','complete','duration','diffTime','endtime','billableseconds','lodash','util','./utils','info','format','uniqueid','calleridnum','connectedlinenum','CreateVoiceDialReport','application'];(function(_0x4540f3,_0x20bfa3){var _0x543129=function(_0x486187){while(--_0x486187){_0x4540f3['push'](_0x4540f3['shift']());}};_0x543129(++_0x20bfa3);}(_0x502d,0xe0));var _0xd502=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0x502d[_0x115621];return _0x5ef5ce;};'use strict';var _=require(_0xd502('0x0'));var util=require(_0xd502('0x1'));var utils=require(_0xd502('0x2'));var dials={};function writeDB(_0x5ee34b){utils[_0xd502('0x3')](util[_0xd502('0x4')]('DIAL|%s|%s|%s|%s|%s|%s',_0x5ee34b[_0xd502('0x5')],_0x5ee34b['channel'],_0x5ee34b['dialstring'],_0x5ee34b[_0xd502('0x6')],_0x5ee34b[_0xd502('0x7')],_0x5ee34b['dialstatus']));utils['request'](_0xd502('0x8'),_0x5ee34b);delete dials[_0x5ee34b[_0xd502('0x5')]];}exports['newexten']=function(_0x255dab){try{if(_0x255dab[_0xd502('0x9')]['toLowerCase']()==_0xd502('0xa')&&_[_0xd502('0xb')](_0x255dab['appdata'][_0xd502('0xc')](),'cdr(routeid)')){var _0xe01d6b=_0x255dab[_0xd502('0xd')][_0xd502('0xe')]('=');dials[_0x255dab[_0xd502('0x5')]]={'routeId':_0xe01d6b[0x1]};}}catch(_0x3b93f0){utils[_0xd502('0xf')](_0x3b93f0[_0xd502('0x10')]);}};exports[_0xd502('0x11')]=function(_0x6f6531){try{if(!_[_0xd502('0x12')](_0x6f6531[_0xd502('0x13')][_0xd502('0x14')])){dials[_0x6f6531[_0xd502('0x5')]]={'routeId':_0x6f6531[_0xd502('0x15')]};}}catch(_0xe294e3){utils[_0xd502('0xf')](_0xe294e3[_0xd502('0x10')]);}};exports[_0xd502('0x16')]=function(_0x4b08f7){try{if(!_['isNil'](dials[_0x4b08f7['uniqueid']])){dials[_0x4b08f7['uniqueid']]=_[_0xd502('0x17')](dials[_0x4b08f7[_0xd502('0x5')]],_0x4b08f7);dials[_0x4b08f7[_0xd502('0x5')]][_0xd502('0x18')]=utils['now']();dials[_0x4b08f7[_0xd502('0x5')]][_0xd502('0x19')]=_0xd502('0x1a');}}catch(_0x631e82){utils[_0xd502('0xf')](_0x631e82[_0xd502('0x10')]);}};exports[_0xd502('0x1b')]=function(_0x460893){try{if(!_['isNil'](dials[_0x460893[_0xd502('0x5')]])){dials[_0x460893['uniqueid']][_0xd502('0x1c')]=_0x460893[_0xd502('0x1c')];if(_0x460893[_0xd502('0x1c')]==_0xd502('0x1d')){dials[_0x460893[_0xd502('0x5')]]=_[_0xd502('0x17')](dials[_0x460893[_0xd502('0x5')]],_0x460893);dials[_0x460893[_0xd502('0x5')]][_0xd502('0x1e')]=utils[_0xd502('0x1f')]();dials[_0x460893[_0xd502('0x5')]][_0xd502('0x19')]=_0xd502('0x20');}}}catch(_0x597a29){utils['error'](_0x597a29[_0xd502('0x10')]);}};exports[_0xd502('0x21')]=function(_0xfd5660){try{if(!_[_0xd502('0x12')](dials[_0xfd5660[_0xd502('0x5')]])){dials[_0xfd5660[_0xd502('0x5')]]=_[_0xd502('0x17')](dials[_0xfd5660['uniqueid']],{'endtime':utils[_0xd502('0x1f')](),'lastevent':_0xd502('0x22')});dials[_0xfd5660[_0xd502('0x5')]][_0xd502('0x23')]=utils[_0xd502('0x24')](dials[_0xfd5660[_0xd502('0x5')]][_0xd502('0x25')],dials[_0xfd5660['uniqueid']][_0xd502('0x18')]);dials[_0xfd5660[_0xd502('0x5')]]['holdtime']=utils[_0xd502('0x24')](dials[_0xfd5660[_0xd502('0x5')]]['answertime']||dials[_0xfd5660['uniqueid']]['endtime'],dials[_0xfd5660[_0xd502('0x5')]][_0xd502('0x18')]);dials[_0xfd5660[_0xd502('0x5')]][_0xd502('0x26')]=dials[_0xfd5660[_0xd502('0x5')]][_0xd502('0x1e')]?utils[_0xd502('0x24')](dials[_0xfd5660[_0xd502('0x5')]]['endtime'],dials[_0xfd5660[_0xd502('0x5')]][_0xd502('0x1e')]):0x0;writeDB(dials[_0xfd5660[_0xd502('0x5')]]);}}catch(_0x1f109c){utils[_0xd502('0xf')](_0x1f109c[_0xd502('0x10')]);}}; \ No newline at end of file +var _0x4222=['channel','dialstring','connectedlinenum','dialstatus','uniqueid','newexten','application','appdata','toLowerCase','cdr(routeid)','split','stack','isNil','outboundrouteid','value','error','assign','starttime','now','lastevent','called','dialend','answertime','connect','hangup','complete','diffTime','holdtime','endtime','billableseconds','lodash','util','format','DIAL|%s|%s|%s|%s|%s|%s'];(function(_0x4cd02e,_0x46398b){var _0x3279b5=function(_0xc8b640){while(--_0xc8b640){_0x4cd02e['push'](_0x4cd02e['shift']());}};_0x3279b5(++_0x46398b);}(_0x4222,0x1d8));var _0x2422=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x4222[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x2422('0x0'));var util=require(_0x2422('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x4ac20f){utils['info'](util[_0x2422('0x2')](_0x2422('0x3'),_0x4ac20f['uniqueid'],_0x4ac20f[_0x2422('0x4')],_0x4ac20f[_0x2422('0x5')],_0x4ac20f['calleridnum'],_0x4ac20f[_0x2422('0x6')],_0x4ac20f[_0x2422('0x7')]));utils['request']('CreateVoiceDialReport',_0x4ac20f);delete dials[_0x4ac20f[_0x2422('0x8')]];}exports[_0x2422('0x9')]=function(_0x3c6c11){try{if(_0x3c6c11[_0x2422('0xa')]['toLowerCase']()=='set'&&_['startsWith'](_0x3c6c11[_0x2422('0xb')][_0x2422('0xc')](),_0x2422('0xd'))){var _0x2e85dd=_0x3c6c11[_0x2422('0xb')][_0x2422('0xe')]('=');dials[_0x3c6c11[_0x2422('0x8')]]={'routeId':_0x2e85dd[0x1]};}}catch(_0x15c87c){utils['error'](_0x15c87c[_0x2422('0xf')]);}};exports['varset']=function(_0x1a7ddf){try{if(!_[_0x2422('0x10')](_0x1a7ddf['variable'][_0x2422('0x11')])){dials[_0x1a7ddf[_0x2422('0x8')]]={'routeId':_0x1a7ddf[_0x2422('0x12')]};}}catch(_0x3cea9d){utils[_0x2422('0x13')](_0x3cea9d[_0x2422('0xf')]);}};exports['dialbegin']=function(_0x4d8b28){try{if(!_[_0x2422('0x10')](dials[_0x4d8b28[_0x2422('0x8')]])){dials[_0x4d8b28[_0x2422('0x8')]]=_[_0x2422('0x14')](dials[_0x4d8b28['uniqueid']],_0x4d8b28);dials[_0x4d8b28[_0x2422('0x8')]][_0x2422('0x15')]=utils[_0x2422('0x16')]();dials[_0x4d8b28['uniqueid']][_0x2422('0x17')]=_0x2422('0x18');}}catch(_0x503e12){utils[_0x2422('0x13')](_0x503e12[_0x2422('0xf')]);}};exports[_0x2422('0x19')]=function(_0x19611b){try{if(!_['isNil'](dials[_0x19611b['uniqueid']])){dials[_0x19611b[_0x2422('0x8')]]['dialstatus']=_0x19611b['dialstatus'];if(_0x19611b[_0x2422('0x7')]=='ANSWER'){dials[_0x19611b[_0x2422('0x8')]]=_['assign'](dials[_0x19611b[_0x2422('0x8')]],_0x19611b);dials[_0x19611b[_0x2422('0x8')]][_0x2422('0x1a')]=utils['now']();dials[_0x19611b[_0x2422('0x8')]][_0x2422('0x17')]=_0x2422('0x1b');}}}catch(_0x4f91b3){utils['error'](_0x4f91b3[_0x2422('0xf')]);}};exports[_0x2422('0x1c')]=function(_0x5c6e4d){try{if(!_[_0x2422('0x10')](dials[_0x5c6e4d[_0x2422('0x8')]])){dials[_0x5c6e4d[_0x2422('0x8')]]=_[_0x2422('0x14')](dials[_0x5c6e4d[_0x2422('0x8')]],{'endtime':utils[_0x2422('0x16')](),'lastevent':_0x2422('0x1d')});dials[_0x5c6e4d[_0x2422('0x8')]]['duration']=utils[_0x2422('0x1e')](dials[_0x5c6e4d[_0x2422('0x8')]]['endtime'],dials[_0x5c6e4d['uniqueid']][_0x2422('0x15')]);dials[_0x5c6e4d['uniqueid']][_0x2422('0x1f')]=utils[_0x2422('0x1e')](dials[_0x5c6e4d[_0x2422('0x8')]][_0x2422('0x1a')]||dials[_0x5c6e4d['uniqueid']][_0x2422('0x20')],dials[_0x5c6e4d[_0x2422('0x8')]][_0x2422('0x15')]);dials[_0x5c6e4d[_0x2422('0x8')]][_0x2422('0x21')]=dials[_0x5c6e4d[_0x2422('0x8')]][_0x2422('0x1a')]?utils[_0x2422('0x1e')](dials[_0x5c6e4d[_0x2422('0x8')]]['endtime'],dials[_0x5c6e4d[_0x2422('0x8')]]['answertime']):0x0;writeDB(dials[_0x5c6e4d['uniqueid']]);}}catch(_0x390af0){utils['error'](_0x390af0['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index db669eb..1ee6190 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 _0xc937=['queuecallerjoin','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0xc937,0x1e6));var _0x7c93=function(_0x59cce8,_0x50f341){_0x59cce8=_0x59cce8-0x0;var _0x3bdec4=_0xc937[_0x59cce8];return _0x3bdec4;};var AsteriskManager=require(_0x7c93('0x0'));var config=require(_0x7c93('0x1'));var utils=require(_0x7c93('0x2'));var ami=new AsteriskManager(config[_0x7c93('0x3')]['port'],config[_0x7c93('0x3')]['ip'],config[_0x7c93('0x3')][_0x7c93('0x4')],config[_0x7c93('0x3')][_0x7c93('0x5')],!![]);ami[_0x7c93('0x6')]();if(config[_0x7c93('0x7')]&&config[_0x7c93('0x7')][_0x7c93('0x8')]){utils[_0x7c93('0x9')](_0x7c93('0xa'));}else{var agents=require(_0x7c93('0xb'));var calls=require(_0x7c93('0xc'));var queues=require(_0x7c93('0xd'));var recordings=require(_0x7c93('0xe'));var members=require(_0x7c93('0xf'));var dials=require(_0x7c93('0x10'));var transfers=require(_0x7c93('0x11'));var core=require('./core.controller');ami['on'](_0x7c93('0x12'),core[_0x7c93('0x12')]);ami['on'](_0x7c93('0x13'),core[_0x7c93('0x13')]);ami['on']('fullybooted',core[_0x7c93('0x14')]);ami['on'](_0x7c93('0x15'),core[_0x7c93('0x15')]);ami['on'](_0x7c93('0x16'),core['close']);ami['on']('managerevent',core[_0x7c93('0x17')]);ami['on'](_0x7c93('0x18'),function(_0x3ae82f){try{members[_0x7c93('0x18')](_0x3ae82f);}catch(_0x3a0f78){utils['error'](_0x3a0f78);}});ami['on']('agentcalled',function(_0x3d6a78){try{agents[_0x7c93('0x19')](_0x3d6a78);}catch(_0x49aba3){utils[_0x7c93('0x15')](_0x49aba3);}});ami['on'](_0x7c93('0x1a'),function(_0x3bc99b){try{agents[_0x7c93('0x1a')](_0x3bc99b);}catch(_0x59e10f){utils['error'](_0x59e10f);}});ami['on'](_0x7c93('0x1b'),function(_0xa453ae){try{agents[_0x7c93('0x1b')](_0xa453ae);queues[_0x7c93('0x1b')](_0xa453ae);}catch(_0x46e1d5){utils[_0x7c93('0x15')](_0x46e1d5);}});ami['on'](_0x7c93('0x1c'),function(_0x186b43){try{agents[_0x7c93('0x1c')](_0x186b43);queues[_0x7c93('0x1c')](_0x186b43);members[_0x7c93('0x1c')](_0x186b43);}catch(_0x4a71d4){utils[_0x7c93('0x15')](_0x4a71d4);}});ami['on'](_0x7c93('0x1d'),function(_0x34df90){try{agents[_0x7c93('0x1d')](_0x34df90);queues[_0x7c93('0x1d')](_0x34df90);}catch(_0x32b9bd){utils['error'](_0x32b9bd);}});ami['on'](_0x7c93('0x1e'),function(_0x573d8f){try{queues[_0x7c93('0x1e')](_0x573d8f);recordings[_0x7c93('0x1e')](_0x573d8f);}catch(_0x41a095){utils[_0x7c93('0x15')](_0x41a095);}});ami['on']('queuecallerleave',function(_0x5c6e96){try{queues['queuecallerleave'](_0x5c6e96);}catch(_0x399a8a){utils[_0x7c93('0x15')](_0x399a8a);}});ami['on'](_0x7c93('0x1f'),function(_0x2c83b4){try{queues[_0x7c93('0x1f')](_0x2c83b4);calls[_0x7c93('0x1f')](_0x2c83b4);}catch(_0x1a200b){utils[_0x7c93('0x15')](_0x1a200b);}});ami['on']('musiconholdstop',function(_0x2070ac){try{queues[_0x7c93('0x20')](_0x2070ac);calls[_0x7c93('0x20')](_0x2070ac);}catch(_0x224359){utils['error'](_0x224359);}});ami['on'](_0x7c93('0x21'),function(_0x4eeec5){try{calls[_0x7c93('0x21')](_0x4eeec5);recordings[_0x7c93('0x21')](_0x4eeec5);}catch(_0x75bbaa){utils[_0x7c93('0x15')](_0x75bbaa);}});ami['on'](_0x7c93('0x22'),function(_0xf50f9e){try{calls[_0x7c93('0x22')](_0xf50f9e);recordings['hangup'](_0xf50f9e);dials[_0x7c93('0x22')](_0xf50f9e);agents[_0x7c93('0x22')](_0xf50f9e);queues[_0x7c93('0x22')](_0xf50f9e);}catch(_0x265d33){utils['error'](_0x265d33);}});ami['on'](_0x7c93('0x23'),function(_0x52e57d){try{members[_0x7c93('0x23')](_0x52e57d);}catch(_0x4f424d){utils[_0x7c93('0x15')](_0x4f424d);}});ami['on'](_0x7c93('0x24'),function(_0x13429b){try{queues['blindtransfer'](_0x13429b);agents[_0x7c93('0x24')](_0x13429b);transfers[_0x7c93('0x24')](_0x13429b);}catch(_0x4f9106){utils['error'](_0x4f9106);}});ami['on'](_0x7c93('0x25'),function(_0x3d11b2){try{queues['attendedtransfer'](_0x3d11b2);transfers[_0x7c93('0x25')](_0x3d11b2);agents['attendedtransfer'](_0x3d11b2);calls[_0x7c93('0x25')](_0x3d11b2);}catch(_0x44b84d){utils[_0x7c93('0x15')](_0x44b84d);}});ami['on']('varset',function(_0x580d05){try{queues['varset'](_0x580d05);recordings['varset'](_0x580d05);calls[_0x7c93('0x26')](_0x580d05);dials['varset'](_0x580d05);}catch(_0x4a8070){utils[_0x7c93('0x15')](_0x4a8070);}});ami['on'](_0x7c93('0x27'),function(_0x579e7c){try{calls[_0x7c93('0x27')](_0x579e7c);recordings[_0x7c93('0x27')](_0x579e7c);dials[_0x7c93('0x27')](_0x579e7c);}catch(_0x3ec757){utils[_0x7c93('0x15')](_0x3ec757);}});ami['on']('newchannel',function(_0x17abac){try{calls['newchannel'](_0x17abac);recordings[_0x7c93('0x28')](_0x17abac);}catch(_0x4125b1){utils[_0x7c93('0x15')](_0x4125b1);}});ami['on']('dialbegin',function(_0x47503b){try{dials[_0x7c93('0x29')](_0x47503b);}catch(_0x103639){utils['error'](_0x103639);}});ami['on'](_0x7c93('0x2a'),function(_0x4bd799){try{dials[_0x7c93('0x2a')](_0x4bd799);}catch(_0x50a85c){utils[_0x7c93('0x15')](_0x50a85c);}});} \ No newline at end of file +var _0xfb5d=['dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','xdr','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel'];(function(_0x37801c,_0x353f27){var _0x54f672=function(_0x1fcfa5){while(--_0x1fcfa5){_0x37801c['push'](_0x37801c['shift']());}};_0x54f672(++_0x353f27);}(_0xfb5d,0x11a));var _0xdfb5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfb5d[_0x502c7d];return _0x30b7ed;};var AsteriskManager=require(_0xdfb5('0x0'));var config=require(_0xdfb5('0x1'));var utils=require(_0xdfb5('0x2'));var ami=new AsteriskManager(config[_0xdfb5('0x3')]['port'],config[_0xdfb5('0x3')]['ip'],config['asterisk']['username'],config['asterisk']['password'],!![]);ami['keepConnected']();if(config[_0xdfb5('0x4')]&&config['xdr']['disabled']){utils[_0xdfb5('0x5')](_0xdfb5('0x6'));}else{var agents=require(_0xdfb5('0x7'));var calls=require('./calls.controller');var queues=require(_0xdfb5('0x8'));var recordings=require(_0xdfb5('0x9'));var members=require(_0xdfb5('0xa'));var dials=require(_0xdfb5('0xb'));var transfers=require(_0xdfb5('0xc'));var core=require(_0xdfb5('0xd'));ami['on'](_0xdfb5('0xe'),core[_0xdfb5('0xe')]);ami['on'](_0xdfb5('0xf'),core['shutdown']);ami['on']('fullybooted',core[_0xdfb5('0x10')]);ami['on'](_0xdfb5('0x11'),core[_0xdfb5('0x11')]);ami['on'](_0xdfb5('0x12'),core[_0xdfb5('0x12')]);ami['on']('managerevent',core[_0xdfb5('0x13')]);ami['on'](_0xdfb5('0x14'),function(_0x5165e3){try{members[_0xdfb5('0x14')](_0x5165e3);}catch(_0x23ff84){utils[_0xdfb5('0x11')](_0x23ff84);}});ami['on'](_0xdfb5('0x15'),function(_0x130672){try{agents['agentcalled'](_0x130672);}catch(_0x56d8aa){utils[_0xdfb5('0x11')](_0x56d8aa);}});ami['on']('agentringnoanswer',function(_0xbd0bd6){try{agents[_0xdfb5('0x16')](_0xbd0bd6);}catch(_0x238972){utils[_0xdfb5('0x11')](_0x238972);}});ami['on'](_0xdfb5('0x17'),function(_0x35b052){try{agents[_0xdfb5('0x17')](_0x35b052);queues['agentconnect'](_0x35b052);}catch(_0x125d46){utils[_0xdfb5('0x11')](_0x125d46);}});ami['on'](_0xdfb5('0x18'),function(_0x3855ea){try{agents[_0xdfb5('0x18')](_0x3855ea);queues['agentcomplete'](_0x3855ea);members[_0xdfb5('0x18')](_0x3855ea);}catch(_0x3463d1){utils['error'](_0x3463d1);}});ami['on'](_0xdfb5('0x19'),function(_0x531ab8){try{agents[_0xdfb5('0x19')](_0x531ab8);queues[_0xdfb5('0x19')](_0x531ab8);}catch(_0x1e282a){utils[_0xdfb5('0x11')](_0x1e282a);}});ami['on']('queuecallerjoin',function(_0xf58ac){try{queues[_0xdfb5('0x1a')](_0xf58ac);recordings[_0xdfb5('0x1a')](_0xf58ac);}catch(_0x4a672d){utils[_0xdfb5('0x11')](_0x4a672d);}});ami['on'](_0xdfb5('0x1b'),function(_0x401b08){try{queues['queuecallerleave'](_0x401b08);}catch(_0x51784c){utils['error'](_0x51784c);}});ami['on'](_0xdfb5('0x1c'),function(_0x386aaa){try{queues[_0xdfb5('0x1c')](_0x386aaa);calls[_0xdfb5('0x1c')](_0x386aaa);}catch(_0x5cc41c){utils[_0xdfb5('0x11')](_0x5cc41c);}});ami['on']('musiconholdstop',function(_0x2cfd52){try{queues[_0xdfb5('0x1d')](_0x2cfd52);calls[_0xdfb5('0x1d')](_0x2cfd52);}catch(_0x46f6d8){utils[_0xdfb5('0x11')](_0x46f6d8);}});ami['on'](_0xdfb5('0x1e'),function(_0x4c5d82){try{calls[_0xdfb5('0x1e')](_0x4c5d82);recordings['newstate'](_0x4c5d82);}catch(_0x45c7e8){utils[_0xdfb5('0x11')](_0x45c7e8);}});ami['on'](_0xdfb5('0x1f'),function(_0x2f1459){try{calls[_0xdfb5('0x1f')](_0x2f1459);recordings[_0xdfb5('0x1f')](_0x2f1459);dials[_0xdfb5('0x1f')](_0x2f1459);agents[_0xdfb5('0x1f')](_0x2f1459);queues[_0xdfb5('0x1f')](_0x2f1459);}catch(_0x52e8a6){utils[_0xdfb5('0x11')](_0x52e8a6);}});ami['on'](_0xdfb5('0x20'),function(_0x213bdb){try{members[_0xdfb5('0x20')](_0x213bdb);}catch(_0x39a0e7){utils[_0xdfb5('0x11')](_0x39a0e7);}});ami['on']('blindtransfer',function(_0x15e3b7){try{queues['blindtransfer'](_0x15e3b7);agents[_0xdfb5('0x21')](_0x15e3b7);transfers[_0xdfb5('0x21')](_0x15e3b7);}catch(_0x40c49c){utils[_0xdfb5('0x11')](_0x40c49c);}});ami['on'](_0xdfb5('0x22'),function(_0x3b055e){try{queues[_0xdfb5('0x22')](_0x3b055e);transfers[_0xdfb5('0x22')](_0x3b055e);agents[_0xdfb5('0x22')](_0x3b055e);calls[_0xdfb5('0x22')](_0x3b055e);}catch(_0x4e2ad1){utils[_0xdfb5('0x11')](_0x4e2ad1);}});ami['on'](_0xdfb5('0x23'),function(_0xafd03e){try{queues['varset'](_0xafd03e);recordings[_0xdfb5('0x23')](_0xafd03e);calls[_0xdfb5('0x23')](_0xafd03e);dials[_0xdfb5('0x23')](_0xafd03e);}catch(_0x3c65da){utils[_0xdfb5('0x11')](_0x3c65da);}});ami['on'](_0xdfb5('0x24'),function(_0x1f6268){try{calls[_0xdfb5('0x24')](_0x1f6268);recordings[_0xdfb5('0x24')](_0x1f6268);dials[_0xdfb5('0x24')](_0x1f6268);}catch(_0x2b8122){utils[_0xdfb5('0x11')](_0x2b8122);}});ami['on']('newchannel',function(_0x3861fa){try{calls['newchannel'](_0x3861fa);recordings[_0xdfb5('0x25')](_0x3861fa);}catch(_0x5eb0ad){utils[_0xdfb5('0x11')](_0x5eb0ad);}});ami['on'](_0xdfb5('0x26'),function(_0x1f555e){try{dials[_0xdfb5('0x26')](_0x1f555e);}catch(_0x2c30a3){utils[_0xdfb5('0x11')](_0x2c30a3);}});ami['on'](_0xdfb5('0x27'),function(_0x5369d0){try{dials[_0xdfb5('0x27')](_0x5369d0);}catch(_0x15dacf){utils[_0xdfb5('0x11')](_0x15dacf);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 042c1b3..10b80fd 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 _0xc3fc=['duration','diffTime','agentcomplete','assign','queue','cdr','channel','data3','destination','exitAt','destinationchannel','data1','source','lodash','util','./utils','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','error','some','startsWith','devicestatechange','state','BUSY','device','voice','now','agent','NOT_INUSE','isNil'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc3fc,0x1cf));var _0xcc3f=function(_0x52fb17,_0x2530e1){_0x52fb17=_0x52fb17-0x0;var _0x8914e4=_0xc3fc[_0x52fb17];return _0x8914e4;};'use strict';var _=require(_0xcc3f('0x0'));var util=require(_0xcc3f('0x1'));var utils=require(_0xcc3f('0x2'));var members={};var exclude=[_0xcc3f('0x3'),'Queue:'];function writeDB(_0x186627){utils[_0xcc3f('0x4')](util[_0xcc3f('0x5')](_0xcc3f('0x6'),_0x186627[_0xcc3f('0x7')],_0x186627[_0xcc3f('0x8')],_0x186627['channel'],_0x186627[_0xcc3f('0x9')],_0x186627[_0xcc3f('0xa')],_0x186627[_0xcc3f('0xb')]));if(_0x186627[_0xcc3f('0x8')]){utils[_0xcc3f('0xc')](_0x186627[_0xcc3f('0x8')])['then'](function(_0x3db8d7){if(_0x3db8d7){_0x186627[_0xcc3f('0xa')]=_0x3db8d7[_0xcc3f('0xd')];_0x186627[_0xcc3f('0xe')]=_0x3db8d7[_0xcc3f('0xe')];utils[_0xcc3f('0xf')](_0xcc3f('0x10'),_0x186627);}else{utils[_0xcc3f('0x11')](_0x186627[_0xcc3f('0x8')][_0xcc3f('0x12')]('/')[0x1])[_0xcc3f('0x13')](function(_0x2fa62c){if(_0x2fa62c){_0x186627['membername']=_0x2fa62c[_0xcc3f('0xd')];_0x186627[_0xcc3f('0xe')]=_0x2fa62c['internal'];utils['request']('CreateMemberReport',_0x186627);}});}})['catch'](function(_0x7d834f){utils[_0xcc3f('0x14')](_0x7d834f);});}delete members[_0x186627['interface']];}function startsWith(_0x3c7fbf,_0x142f2d){return _[_0xcc3f('0x15')](_0x3c7fbf,function(_0x5b2e5f){return _[_0xcc3f('0x16')](_0x142f2d,_0x5b2e5f);});}exports[_0xcc3f('0x17')]=function(_0x304bd9){switch(_0x304bd9[_0xcc3f('0x18')]){case'INUSE':case _0xcc3f('0x19'):if(!startsWith(exclude,_0x304bd9[_0xcc3f('0x1a')])){members[_0x304bd9[_0xcc3f('0x1a')]]={'channel':_0xcc3f('0x1b'),'interface':_0x304bd9[_0xcc3f('0x1a')],'type':'TALKING','enterAt':utils[_0xcc3f('0x1c')](),'role':_0xcc3f('0x1d')};}break;case _0xcc3f('0x1e'):if(!_[_0xcc3f('0x1f')](members[_0x304bd9[_0xcc3f('0x1a')]])){members[_0x304bd9[_0xcc3f('0x1a')]]['exitAt']=utils['now']();members[_0x304bd9[_0xcc3f('0x1a')]][_0xcc3f('0x20')]=utils[_0xcc3f('0x21')](members[_0x304bd9['device']]['exitAt'],members[_0x304bd9['device']]['enterAt']);if(members[_0x304bd9[_0xcc3f('0x1a')]]['uniqueid']){writeDB(members[_0x304bd9[_0xcc3f('0x1a')]]);}}default:break;}};exports[_0xcc3f('0x22')]=function(_0x1f9e90){if(!_['isNil'](members[_0x1f9e90[_0xcc3f('0x8')]])){members[_0x1f9e90[_0xcc3f('0x8')]]=_[_0xcc3f('0x23')](members[_0x1f9e90[_0xcc3f('0x8')]],{'data4':_0x1f9e90[_0xcc3f('0x24')],'uniqueid':_0x1f9e90['uniqueid']});}};exports[_0xcc3f('0x25')]=function(_0x18fb54){if(_0x18fb54['channel']){var _0x1043e0=_0x18fb54[_0xcc3f('0x26')]['split']('-')[0x0];if(!_[_0xcc3f('0x1f')](members[_0x1043e0])){members[_0x1043e0]=_[_0xcc3f('0x23')](members[_0x1043e0],{'data1':members[_0x1043e0]['data1']||_0x18fb54[_0xcc3f('0xb')],'data2':members[_0x1043e0][_0xcc3f('0x9')]||_0x18fb54['source'],'data3':members[_0x1043e0][_0xcc3f('0x27')]||_0x18fb54[_0xcc3f('0x28')],'uniqueid':members[_0x1043e0][_0xcc3f('0x7')]||_0x18fb54['uniqueid']});if(members[_0x1043e0][_0xcc3f('0x29')]){writeDB(members[_0x1043e0]);}}}if(_0x18fb54[_0xcc3f('0x2a')]){var _0x37d19d=_0x18fb54['destinationchannel'][_0xcc3f('0x12')]('-')[0x0];if(!_[_0xcc3f('0x1f')](members[_0x37d19d])){members[_0x37d19d]=_['assign'](members[_0x37d19d],{'data1':members[_0x37d19d][_0xcc3f('0x2b')]||_0x18fb54[_0xcc3f('0xb')],'data2':members[_0x37d19d][_0xcc3f('0x9')]||_0x18fb54[_0xcc3f('0x2c')],'data3':members[_0x37d19d]['data3']||_0x18fb54[_0xcc3f('0x28')],'uniqueid':members[_0x37d19d][_0xcc3f('0x7')]||_0x18fb54[_0xcc3f('0x7')]});if(members[_0x37d19d][_0xcc3f('0x29')]){writeDB(members[_0x37d19d]);}}}}; \ No newline at end of file +var _0x27dd=['interface','channel','data2','membername','type','then','internal','request','CreateMemberReport','name','catch','error','startsWith','devicestatechange','INUSE','BUSY','device','voice','now','agent','isNil','exitAt','duration','diffTime','agentcomplete','assign','queue','split','source','data3','destination','destinationchannel','data1','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid'];(function(_0x1580f7,_0xf2b31c){var _0x2a5b4f=function(_0x3e8173){while(--_0x3e8173){_0x1580f7['push'](_0x1580f7['shift']());}};_0x2a5b4f(++_0xf2b31c);}(_0x27dd,0x1c5));var _0xd27d=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x27dd[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xd27d('0x0'));var util=require(_0xd27d('0x1'));var utils=require(_0xd27d('0x2'));var members={};var exclude=[_0xd27d('0x3'),_0xd27d('0x4')];function writeDB(_0x2e97d4){utils[_0xd27d('0x5')](util[_0xd27d('0x6')](_0xd27d('0x7'),_0x2e97d4[_0xd27d('0x8')],_0x2e97d4[_0xd27d('0x9')],_0x2e97d4[_0xd27d('0xa')],_0x2e97d4[_0xd27d('0xb')],_0x2e97d4[_0xd27d('0xc')],_0x2e97d4[_0xd27d('0xd')]));if(_0x2e97d4[_0xd27d('0x9')]){utils['getUserByInterface'](_0x2e97d4['interface'])[_0xd27d('0xe')](function(_0x518237){if(_0x518237){_0x2e97d4[_0xd27d('0xc')]=_0x518237['name'];_0x2e97d4[_0xd27d('0xf')]=_0x518237[_0xd27d('0xf')];utils[_0xd27d('0x10')](_0xd27d('0x11'),_0x2e97d4);}else{utils['getUserByName'](_0x2e97d4[_0xd27d('0x9')]['split']('/')[0x1])[_0xd27d('0xe')](function(_0x230b91){if(_0x230b91){_0x2e97d4[_0xd27d('0xc')]=_0x230b91[_0xd27d('0x12')];_0x2e97d4[_0xd27d('0xf')]=_0x230b91[_0xd27d('0xf')];utils[_0xd27d('0x10')](_0xd27d('0x11'),_0x2e97d4);}});}})[_0xd27d('0x13')](function(_0x4c76b6){utils[_0xd27d('0x14')](_0x4c76b6);});}delete members[_0x2e97d4['interface']];}function startsWith(_0x33be05,_0x8631a7){return _['some'](_0x33be05,function(_0x1c9542){return _[_0xd27d('0x15')](_0x8631a7,_0x1c9542);});}exports[_0xd27d('0x16')]=function(_0x1d5521){switch(_0x1d5521['state']){case _0xd27d('0x17'):case _0xd27d('0x18'):if(!startsWith(exclude,_0x1d5521[_0xd27d('0x19')])){members[_0x1d5521[_0xd27d('0x19')]]={'channel':_0xd27d('0x1a'),'interface':_0x1d5521[_0xd27d('0x19')],'type':'TALKING','enterAt':utils[_0xd27d('0x1b')](),'role':_0xd27d('0x1c')};}break;case'NOT_INUSE':if(!_[_0xd27d('0x1d')](members[_0x1d5521[_0xd27d('0x19')]])){members[_0x1d5521[_0xd27d('0x19')]][_0xd27d('0x1e')]=utils[_0xd27d('0x1b')]();members[_0x1d5521[_0xd27d('0x19')]][_0xd27d('0x1f')]=utils[_0xd27d('0x20')](members[_0x1d5521[_0xd27d('0x19')]][_0xd27d('0x1e')],members[_0x1d5521[_0xd27d('0x19')]]['enterAt']);if(members[_0x1d5521[_0xd27d('0x19')]][_0xd27d('0x8')]){writeDB(members[_0x1d5521['device']]);}}default:break;}};exports[_0xd27d('0x21')]=function(_0x42946c){if(!_[_0xd27d('0x1d')](members[_0x42946c['interface']])){members[_0x42946c['interface']]=_[_0xd27d('0x22')](members[_0x42946c[_0xd27d('0x9')]],{'data4':_0x42946c[_0xd27d('0x23')],'uniqueid':_0x42946c[_0xd27d('0x8')]});}};exports['cdr']=function(_0x5075ac){if(_0x5075ac[_0xd27d('0xa')]){var _0x15d1cf=_0x5075ac[_0xd27d('0xa')][_0xd27d('0x24')]('-')[0x0];if(!_[_0xd27d('0x1d')](members[_0x15d1cf])){members[_0x15d1cf]=_[_0xd27d('0x22')](members[_0x15d1cf],{'data1':members[_0x15d1cf]['data1']||_0x5075ac[_0xd27d('0xd')],'data2':members[_0x15d1cf]['data2']||_0x5075ac[_0xd27d('0x25')],'data3':members[_0x15d1cf][_0xd27d('0x26')]||_0x5075ac[_0xd27d('0x27')],'uniqueid':members[_0x15d1cf][_0xd27d('0x8')]||_0x5075ac[_0xd27d('0x8')]});if(members[_0x15d1cf]['exitAt']){writeDB(members[_0x15d1cf]);}}}if(_0x5075ac['destinationchannel']){var _0x47b71d=_0x5075ac[_0xd27d('0x28')][_0xd27d('0x24')]('-')[0x0];if(!_[_0xd27d('0x1d')](members[_0x47b71d])){members[_0x47b71d]=_[_0xd27d('0x22')](members[_0x47b71d],{'data1':members[_0x47b71d][_0xd27d('0x29')]||_0x5075ac[_0xd27d('0xd')],'data2':members[_0x47b71d][_0xd27d('0xb')]||_0x5075ac[_0xd27d('0x25')],'data3':members[_0x47b71d][_0xd27d('0x26')]||_0x5075ac[_0xd27d('0x27')],'uniqueid':members[_0x47b71d][_0xd27d('0x8')]||_0x5075ac['uniqueid']});if(members[_0x47b71d][_0xd27d('0x1e')]){writeDB(members[_0x47b71d]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index a3d5ca9..ec44d39 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 _0x71a9=['attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','transfertype','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','transferuniqueid','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','queuecallerenterreason','varset','isNil','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','toUpperCase','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','destaccountcode','membername','agentcomplete','assigned','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension'];(function(_0x34da46,_0x6f17bc){var _0x4213c6=function(_0x31d88e){while(--_0x31d88e){_0x34da46['push'](_0x34da46['shift']());}};_0x4213c6(++_0x6f17bc);}(_0x71a9,0x19e));var _0x971a=function(_0x40d44a,_0x41ad54){_0x40d44a=_0x40d44a-0x0;var _0x45225d=_0x71a9[_0x40d44a];return _0x45225d;};'use strict';var _=require(_0x971a('0x0'));var util=require(_0x971a('0x1'));var utils=require(_0x971a('0x2'));var queues={};function writeDB(_0x4b5ffa){utils[_0x971a('0x3')](util[_0x971a('0x4')](_0x971a('0x5'),_0x4b5ffa[_0x971a('0x6')],_0x4b5ffa[_0x971a('0x7')],_0x4b5ffa[_0x971a('0x8')],_0x4b5ffa[_0x971a('0x9')],_0x4b5ffa[_0x971a('0xa')],_0x4b5ffa[_0x971a('0xb')],_0x4b5ffa[_0x971a('0xc')]));if(_0x4b5ffa[_0x971a('0x8')]){utils[_0x971a('0xd')](_0x4b5ffa['queue'])[_0x971a('0xe')](function(_0x2476f9){if(_0x2476f9){_0x4b5ffa['type']=_0x2476f9[_0x971a('0xf')];}utils[_0x971a('0x10')](_0x971a('0x11'),_0x4b5ffa);});}else{utils[_0x971a('0x10')](_0x971a('0x11'),_0x4b5ffa);}if(_0x4b5ffa[_0x971a('0x12')]){delete queues[_0x4b5ffa[_0x971a('0x12')]];}else{delete queues[_0x4b5ffa[_0x971a('0x6')]];}}exports['queuecallerjoin']=function(_0x2b4a6c){queues[_0x2b4a6c[_0x971a('0x6')]]=_[_0x971a('0x13')](_0x2b4a6c,{'originalposition':_0x2b4a6c['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x971a('0x14')]=function(_0x1d95ab){if(!_['isNil'](queues[_0x1d95ab[_0x971a('0x6')]])){if(queues[_0x1d95ab[_0x971a('0x6')]][_0x971a('0x15')]){if(!queues[_0x1d95ab[_0x971a('0x6')]][_0x971a('0x16')]&&!queues[_0x1d95ab[_0x971a('0x6')]][_0x971a('0x17')]){queues[_0x1d95ab['uniqueid']][_0x971a('0x18')]=!![];queues[_0x1d95ab['uniqueid']][_0x971a('0x19')]=utils[_0x971a('0x1a')]();queues[_0x1d95ab[_0x971a('0x6')]]['queuecallerexitreason']=_0x971a('0x1b');}writeDB(queues[_0x1d95ab['uniqueid']]);}else{if(queues[_0x1d95ab[_0x971a('0x6')]][_0x971a('0x12')]){queues[queues[_0x1d95ab[_0x971a('0x6')]][_0x971a('0x12')]]=queues[_0x1d95ab[_0x971a('0x6')]];queues[queues[_0x1d95ab[_0x971a('0x6')]][_0x971a('0x12')]][_0x971a('0x1c')]=0x2;delete queues[_0x1d95ab[_0x971a('0x6')]];}}}};exports[_0x971a('0x1d')]=function(_0x34abe8){if(!_[_0x971a('0x1e')](_0x34abe8[_0x971a('0x1f')][_0x971a('0x20')])){if(!_[_0x971a('0x1e')](queues[_0x34abe8[_0x971a('0x6')]])){queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x16')]=![];queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x21')]=null;queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x17')]=!![];queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x22')]=utils[_0x971a('0x1a')]();queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0xc')]=_0x34abe8[_0x971a('0x23')][_0x971a('0x24')]();writeDB(queues[_0x34abe8[_0x971a('0x6')]]);}}else if(!_['isNil'](_0x34abe8[_0x971a('0x1f')]['queueposition'])){if(!_['isNil'](queues[_0x34abe8[_0x971a('0x6')]])&&!queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x16')]){queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x16')]=![];queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x21')]=null;queues[_0x34abe8[_0x971a('0x6')]][_0x971a('0x17')]=!![];queues[_0x34abe8[_0x971a('0x6')]]['queuecallerexitAt']=utils[_0x971a('0x1a')]();queues[_0x34abe8['uniqueid']][_0x971a('0xc')]=_0x971a('0x25');}}};exports['queuecallerabandon']=function(_0x4724fb){if(!_['isNil'](queues[_0x4724fb[_0x971a('0x6')]])){queues[_0x4724fb[_0x971a('0x6')]][_0x971a('0x17')]=![];queues[_0x4724fb[_0x971a('0x6')]][_0x971a('0x22')]=null;queues[_0x4724fb[_0x971a('0x6')]][_0x971a('0x16')]=!![];queues[_0x4724fb[_0x971a('0x6')]]['queuecallerabandonAt']=utils[_0x971a('0x1a')]();queues[_0x4724fb[_0x971a('0x6')]]['queuecallerexitreason']=_0x971a('0x26');}};exports[_0x971a('0x27')]=function(_0x233a6e){if(!_[_0x971a('0x1e')](queues[_0x233a6e[_0x971a('0x6')]])){queues[_0x233a6e[_0x971a('0x6')]]['queuecallerleave']=!![];queues[_0x233a6e[_0x971a('0x6')]][_0x971a('0x15')]=utils[_0x971a('0x1a')]();queues[_0x233a6e[_0x971a('0x6')]][_0x971a('0x28')]=utils[_0x971a('0x29')](queues[_0x233a6e[_0x971a('0x6')]][_0x971a('0x15')],queues[_0x233a6e[_0x971a('0x6')]][_0x971a('0x2a')]);queues[_0x233a6e['uniqueid']]['position']=_0x233a6e[_0x971a('0x2b')];queues[_0x233a6e[_0x971a('0x6')]][_0x971a('0x2c')]=_0x233a6e[_0x971a('0x2c')];queues[_0x233a6e[_0x971a('0x6')]]['connectedlinenum']=_0x233a6e[_0x971a('0x2d')];queues[_0x233a6e[_0x971a('0x6')]][_0x971a('0x2e')]=_0x233a6e[_0x971a('0x2e')];}};exports[_0x971a('0x2f')]=function(_0x500bf8){if(!_[_0x971a('0x1e')](queues[_0x500bf8[_0x971a('0x6')]])){queues[_0x500bf8[_0x971a('0x6')]][_0x971a('0x16')]=![];queues[_0x500bf8[_0x971a('0x6')]][_0x971a('0x16')]=![];queues[_0x500bf8[_0x971a('0x6')]][_0x971a('0x21')]=null;queues[_0x500bf8[_0x971a('0x6')]]['queuecallerexit']=![];queues[_0x500bf8[_0x971a('0x6')]][_0x971a('0x22')]=null;queues[_0x500bf8[_0x971a('0x6')]]['assigned']=!![];queues[_0x500bf8['uniqueid']][_0x971a('0xb')]=_0x500bf8[_0x971a('0x30')];queues[_0x500bf8[_0x971a('0x6')]][_0x971a('0x9')]=_0x500bf8[_0x971a('0x31')];}};exports[_0x971a('0x32')]=function(_0x1f2094){if(!_[_0x971a('0x1e')](queues[_0x1f2094[_0x971a('0x6')]])){if(queues[_0x1f2094[_0x971a('0x6')]]['queuecallerleaveAt']){queues[_0x1f2094[_0x971a('0x6')]][_0x971a('0x16')]=![];queues[_0x1f2094[_0x971a('0x6')]][_0x971a('0x16')]=![];queues[_0x1f2094[_0x971a('0x6')]][_0x971a('0x21')]=null;queues[_0x1f2094['uniqueid']][_0x971a('0x17')]=![];queues[_0x1f2094['uniqueid']][_0x971a('0x22')]=null;queues[_0x1f2094[_0x971a('0x6')]][_0x971a('0x33')]=!![];queues[_0x1f2094[_0x971a('0x6')]]['lastAssignedTo']=_0x1f2094[_0x971a('0x31')];queues[_0x1f2094[_0x971a('0x6')]][_0x971a('0x18')]=!![];queues[_0x1f2094[_0x971a('0x6')]]['queuecallercompleteAt']=utils[_0x971a('0x1a')]();if(_0x1f2094['reason']==_0x971a('0x34')){if(!queues[_0x1f2094[_0x971a('0x6')]][_0x971a('0x34')]){queues[_0x1f2094[_0x971a('0x6')]][_0x971a('0xc')]=_0x971a('0x35');}}else{queues[_0x1f2094['uniqueid']][_0x971a('0xc')]=_0x971a('0x36')+_0x1f2094['reason']['toUpperCase']();}writeDB(queues[_0x1f2094[_0x971a('0x6')]]);}}};exports[_0x971a('0x37')]=function(_0x523941){if(!_[_0x971a('0x1e')](queues[_0x523941[_0x971a('0x38')]])){queues[_0x523941[_0x971a('0x38')]][_0x971a('0x34')]=!![];queues[_0x523941['transfereeuniqueid']]['transfertype']=_0x971a('0x39');queues[_0x523941[_0x971a('0x38')]][_0x971a('0x3a')]=_0x523941[_0x971a('0x3b')];queues[_0x523941['transfereeuniqueid']]['transferuniqueid']=_0x523941[_0x971a('0x38')];queues[_0x523941['transfereeuniqueid']][_0x971a('0xc')]='BLINDTRANSFER';}};exports[_0x971a('0x3c')]=function(_0x532948){try{if(_0x532948[_0x971a('0x3d')]==_0x532948['origtransfererlinkedid']){if(!_[_0x971a('0x1e')](queues[_0x532948['secondtransfererlinkedid']])){queues[_0x532948[_0x971a('0x3e')]][_0x971a('0x34')]=!![];queues[_0x532948[_0x971a('0x3e')]][_0x971a('0x3f')]=_0x971a('0x40');queues[_0x532948[_0x971a('0x3e')]][_0x971a('0x3a')]=_0x532948['origtransfererexten'];queues[_0x532948[_0x971a('0x3e')]]['transferuniqueid']=_0x532948[_0x971a('0x3d')];queues[_0x532948[_0x971a('0x3e')]][_0x971a('0xc')]=_0x971a('0x41');}if(!_['isNil'](queues[_0x532948[_0x971a('0x42')]])){if(_0x532948[_0x971a('0x43')]&&queues[_0x532948[_0x971a('0x43')]]){queues[_0x532948[_0x971a('0x43')]][_0x971a('0x1c')]=0x1;queues[_0x532948[_0x971a('0x38')]]=_[_0x971a('0x44')](queues[_0x532948[_0x971a('0x43')]]);queues[_0x532948[_0x971a('0x38')]][_0x971a('0x12')]=_0x532948[_0x971a('0x45')];queues[_0x532948[_0x971a('0x38')]][_0x971a('0x1c')]=0x2;queues[_0x532948['transfereeuniqueid']][_0x971a('0xa')]=queues[_0x532948['secondtransfererlinkedid']][_0x971a('0xa')];queues[_0x532948['transfereeuniqueid']]['calleridname']=queues[_0x532948[_0x971a('0x3e')]][_0x971a('0x46')];queues[_0x532948['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x971a('0x1a')]();queues[_0x532948['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x971a('0x1a')]();queues[_0x532948['transfereeuniqueid']][_0x971a('0x28')]=0x0;queues[_0x532948[_0x971a('0x38')]][_0x971a('0x47')]=0x0;}else{queues[_0x532948[_0x971a('0x42')]][_0x971a('0x12')]=_0x532948['secondtransfererlinkedid'];}}}else if(_0x532948['secondtransfereruniqueid']==_0x532948['secondtransfererlinkedid']){if(!_[_0x971a('0x1e')](queues[_0x532948[_0x971a('0x42')]])){queues[_0x532948[_0x971a('0x42')]][_0x971a('0x34')]=!![];queues[_0x532948['origtransfererlinkedid']][_0x971a('0x3f')]='ATTENDED';queues[_0x532948[_0x971a('0x42')]][_0x971a('0x3a')]=_0x532948['secondtransfererexten'];queues[_0x532948['origtransfererlinkedid']][_0x971a('0x48')]=_0x532948['secondtransfereruniqueid'];queues[_0x532948[_0x971a('0x42')]][_0x971a('0xc')]=_0x971a('0x41');}if(!_[_0x971a('0x1e')](queues[_0x532948[_0x971a('0x3e')]])){if(_0x532948['transfertargetlinkedid']&&queues[_0x532948[_0x971a('0x49')]]){queues[_0x532948[_0x971a('0x49')]]['queuecallerenterreason']=0x1;queues[_0x532948[_0x971a('0x45')]]=_[_0x971a('0x44')](queues[_0x532948['transfertargetlinkedid']]);queues[_0x532948[_0x971a('0x45')]][_0x971a('0x12')]=_0x532948['transfertargetuniqueid'];queues[_0x532948[_0x971a('0x45')]][_0x971a('0x1c')]=0x2;queues[_0x532948['transfertargetuniqueid']][_0x971a('0xa')]=queues[_0x532948[_0x971a('0x42')]][_0x971a('0xa')];queues[_0x532948[_0x971a('0x45')]][_0x971a('0x46')]=queues[_0x532948[_0x971a('0x42')]][_0x971a('0x46')];queues[_0x532948['transfertargetuniqueid']][_0x971a('0x2a')]=utils[_0x971a('0x1a')]();queues[_0x532948[_0x971a('0x45')]]['queuecallerleaveAt']=utils[_0x971a('0x1a')]();queues[_0x532948[_0x971a('0x45')]]['holdtime']=0x0;queues[_0x532948[_0x971a('0x45')]]['mohtime']=0x0;}else{queues[_0x532948[_0x971a('0x3e')]][_0x971a('0x12')]=_0x532948[_0x971a('0x42')];}}}}catch(_0x3d3050){utils[_0x971a('0x4a')](_0x3d3050[_0x971a('0x4b')]);}};exports[_0x971a('0x4c')]=function(_0x224435){if(!_['isNil'](queues[_0x224435[_0x971a('0x6')]])){queues[_0x224435['uniqueid']][_0x971a('0x4d')]=utils[_0x971a('0x1a')]();}};exports[_0x971a('0x4e')]=function(_0x4f2162){if(!_[_0x971a('0x1e')](queues[_0x4f2162['uniqueid']])){if(!_['isNil'](queues[_0x4f2162[_0x971a('0x6')]][_0x971a('0x4d')])){queues[_0x4f2162['uniqueid']][_0x971a('0x47')]+=utils[_0x971a('0x29')](utils['now'](),queues[_0x4f2162[_0x971a('0x6')]]['musiconholdstartAt']);delete queues[_0x4f2162[_0x971a('0x6')]][_0x971a('0x4d')];}}}; \ No newline at end of file +var _0xd2ba=['transfertargetlinkedid','calleridname','queuecallerjoinAt','error','musiconholdstart','musiconholdstartAt','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','now','queuecallerabandon','queuecallerexit','COMPLETEDBYAGENT','queuecallerenterreason','varset','isNil','queuestatus','queuecallerabandonAt','value','toUpperCase','queueposition','queuecallerexitAt','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerleaveAt','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','lastAssignedTo','membername','agentcomplete','queuecallercomplete','queuecallercompleteAt','transfer','TRANSFER','blindtransfer','transfereeuniqueid','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','mohtime','secondtransfereruniqueid','transfertype','secondtransfererexten'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xd2ba,0xe7));var _0xad2b=function(_0x1ac2c0,_0x5d1c1c){_0x1ac2c0=_0x1ac2c0-0x0;var _0x46d319=_0xd2ba[_0x1ac2c0];return _0x46d319;};'use strict';var _=require(_0xad2b('0x0'));var util=require(_0xad2b('0x1'));var utils=require(_0xad2b('0x2'));var queues={};function writeDB(_0x49eb69){utils[_0xad2b('0x3')](util[_0xad2b('0x4')](_0xad2b('0x5'),_0x49eb69[_0xad2b('0x6')],_0x49eb69[_0xad2b('0x7')],_0x49eb69[_0xad2b('0x8')],_0x49eb69['lastAssignedTo'],_0x49eb69[_0xad2b('0x9')],_0x49eb69[_0xad2b('0xa')],_0x49eb69[_0xad2b('0xb')]));if(_0x49eb69[_0xad2b('0x8')]){utils[_0xad2b('0xc')](_0x49eb69[_0xad2b('0x8')])['then'](function(_0x13144f){if(_0x13144f){_0x49eb69[_0xad2b('0xd')]=_0x13144f[_0xad2b('0xd')];}utils[_0xad2b('0xe')]('CreateVoiceQueueReport',_0x49eb69);});}else{utils['request'](_0xad2b('0xf'),_0x49eb69);}if(_0x49eb69[_0xad2b('0x10')]){delete queues[_0x49eb69[_0xad2b('0x10')]];}else{delete queues[_0x49eb69[_0xad2b('0x6')]];}}exports['queuecallerjoin']=function(_0x2ad309){queues[_0x2ad309[_0xad2b('0x6')]]=_['assign'](_0x2ad309,{'originalposition':_0x2ad309['position'],'queuecallerjoinAt':utils[_0xad2b('0x11')](),'mohtime':0x0});};exports['hangup']=function(_0x1f66ab){if(!_['isNil'](queues[_0x1f66ab[_0xad2b('0x6')]])){if(queues[_0x1f66ab[_0xad2b('0x6')]]['queuecallerleaveAt']){if(!queues[_0x1f66ab['uniqueid']][_0xad2b('0x12')]&&!queues[_0x1f66ab[_0xad2b('0x6')]][_0xad2b('0x13')]){queues[_0x1f66ab[_0xad2b('0x6')]]['queuecallercomplete']=!![];queues[_0x1f66ab[_0xad2b('0x6')]]['queuecallercompleteAt']=utils[_0xad2b('0x11')]();queues[_0x1f66ab[_0xad2b('0x6')]][_0xad2b('0xb')]=_0xad2b('0x14');}writeDB(queues[_0x1f66ab[_0xad2b('0x6')]]);}else{if(queues[_0x1f66ab[_0xad2b('0x6')]][_0xad2b('0x10')]){queues[queues[_0x1f66ab['uniqueid']][_0xad2b('0x10')]]=queues[_0x1f66ab[_0xad2b('0x6')]];queues[queues[_0x1f66ab[_0xad2b('0x6')]][_0xad2b('0x10')]][_0xad2b('0x15')]=0x2;delete queues[_0x1f66ab[_0xad2b('0x6')]];}}}};exports[_0xad2b('0x16')]=function(_0x158ba8){if(!_[_0xad2b('0x17')](_0x158ba8['variable'][_0xad2b('0x18')])){if(!_[_0xad2b('0x17')](queues[_0x158ba8[_0xad2b('0x6')]])){queues[_0x158ba8[_0xad2b('0x6')]][_0xad2b('0x12')]=![];queues[_0x158ba8['uniqueid']][_0xad2b('0x19')]=null;queues[_0x158ba8[_0xad2b('0x6')]][_0xad2b('0x13')]=!![];queues[_0x158ba8['uniqueid']]['queuecallerexitAt']=utils[_0xad2b('0x11')]();queues[_0x158ba8[_0xad2b('0x6')]][_0xad2b('0xb')]=_0x158ba8[_0xad2b('0x1a')][_0xad2b('0x1b')]();writeDB(queues[_0x158ba8['uniqueid']]);}}else if(!_[_0xad2b('0x17')](_0x158ba8['variable'][_0xad2b('0x1c')])){if(!_[_0xad2b('0x17')](queues[_0x158ba8[_0xad2b('0x6')]])&&!queues[_0x158ba8['uniqueid']]['queuecallerabandon']){queues[_0x158ba8[_0xad2b('0x6')]][_0xad2b('0x12')]=![];queues[_0x158ba8[_0xad2b('0x6')]][_0xad2b('0x19')]=null;queues[_0x158ba8[_0xad2b('0x6')]][_0xad2b('0x13')]=!![];queues[_0x158ba8[_0xad2b('0x6')]][_0xad2b('0x1d')]=utils[_0xad2b('0x11')]();queues[_0x158ba8[_0xad2b('0x6')]]['queuecallerexitreason']='EXITWITHKEY';}}};exports['queuecallerabandon']=function(_0x1d1a79){if(!_[_0xad2b('0x17')](queues[_0x1d1a79['uniqueid']])){queues[_0x1d1a79[_0xad2b('0x6')]][_0xad2b('0x13')]=![];queues[_0x1d1a79[_0xad2b('0x6')]]['queuecallerexitAt']=null;queues[_0x1d1a79['uniqueid']][_0xad2b('0x12')]=!![];queues[_0x1d1a79[_0xad2b('0x6')]][_0xad2b('0x19')]=utils[_0xad2b('0x11')]();queues[_0x1d1a79[_0xad2b('0x6')]][_0xad2b('0xb')]=_0xad2b('0x1e');}};exports[_0xad2b('0x1f')]=function(_0x5c986b){if(!_[_0xad2b('0x17')](queues[_0x5c986b['uniqueid']])){queues[_0x5c986b[_0xad2b('0x6')]]['queuecallerleave']=!![];queues[_0x5c986b['uniqueid']]['queuecallerleaveAt']=utils[_0xad2b('0x11')]();queues[_0x5c986b['uniqueid']][_0xad2b('0x20')]=utils[_0xad2b('0x21')](queues[_0x5c986b[_0xad2b('0x6')]][_0xad2b('0x22')],queues[_0x5c986b[_0xad2b('0x6')]]['queuecallerjoinAt']);queues[_0x5c986b[_0xad2b('0x6')]][_0xad2b('0x23')]=_0x5c986b[_0xad2b('0x23')];queues[_0x5c986b['uniqueid']]['count']=_0x5c986b[_0xad2b('0x24')];queues[_0x5c986b[_0xad2b('0x6')]]['connectedlinenum']=_0x5c986b[_0xad2b('0x25')];queues[_0x5c986b['uniqueid']][_0xad2b('0x26')]=_0x5c986b['connectedlinename'];}};exports[_0xad2b('0x27')]=function(_0x29a8c4){if(!_['isNil'](queues[_0x29a8c4['uniqueid']])){queues[_0x29a8c4[_0xad2b('0x6')]][_0xad2b('0x12')]=![];queues[_0x29a8c4['uniqueid']]['queuecallerabandon']=![];queues[_0x29a8c4[_0xad2b('0x6')]]['queuecallerabandonAt']=null;queues[_0x29a8c4[_0xad2b('0x6')]]['queuecallerexit']=![];queues[_0x29a8c4['uniqueid']][_0xad2b('0x1d')]=null;queues[_0x29a8c4[_0xad2b('0x6')]][_0xad2b('0x28')]=!![];queues[_0x29a8c4[_0xad2b('0x6')]][_0xad2b('0xa')]=_0x29a8c4[_0xad2b('0x29')];queues[_0x29a8c4['uniqueid']][_0xad2b('0x2a')]=_0x29a8c4[_0xad2b('0x2b')];}};exports[_0xad2b('0x2c')]=function(_0x1e2dbb){if(!_[_0xad2b('0x17')](queues[_0x1e2dbb[_0xad2b('0x6')]])){if(queues[_0x1e2dbb['uniqueid']][_0xad2b('0x22')]){queues[_0x1e2dbb['uniqueid']]['queuecallerabandon']=![];queues[_0x1e2dbb[_0xad2b('0x6')]]['queuecallerabandon']=![];queues[_0x1e2dbb[_0xad2b('0x6')]]['queuecallerabandonAt']=null;queues[_0x1e2dbb[_0xad2b('0x6')]][_0xad2b('0x13')]=![];queues[_0x1e2dbb[_0xad2b('0x6')]][_0xad2b('0x1d')]=null;queues[_0x1e2dbb['uniqueid']][_0xad2b('0x28')]=!![];queues[_0x1e2dbb[_0xad2b('0x6')]][_0xad2b('0x2a')]=_0x1e2dbb[_0xad2b('0x2b')];queues[_0x1e2dbb[_0xad2b('0x6')]][_0xad2b('0x2d')]=!![];queues[_0x1e2dbb[_0xad2b('0x6')]][_0xad2b('0x2e')]=utils[_0xad2b('0x11')]();if(_0x1e2dbb['reason']=='transfer'){if(!queues[_0x1e2dbb[_0xad2b('0x6')]][_0xad2b('0x2f')]){queues[_0x1e2dbb[_0xad2b('0x6')]][_0xad2b('0xb')]=_0xad2b('0x30');}}else{queues[_0x1e2dbb[_0xad2b('0x6')]]['queuecallerexitreason']='COMPLETEDBY'+_0x1e2dbb['reason']['toUpperCase']();}writeDB(queues[_0x1e2dbb[_0xad2b('0x6')]]);}}};exports[_0xad2b('0x31')]=function(_0x3fc642){if(!_[_0xad2b('0x17')](queues[_0x3fc642['transfereeuniqueid']])){queues[_0x3fc642[_0xad2b('0x32')]][_0xad2b('0x2f')]=!![];queues[_0x3fc642[_0xad2b('0x32')]]['transfertype']=_0xad2b('0x33');queues[_0x3fc642[_0xad2b('0x32')]][_0xad2b('0x34')]=_0x3fc642['extension'];queues[_0x3fc642[_0xad2b('0x32')]][_0xad2b('0x35')]=_0x3fc642[_0xad2b('0x32')];queues[_0x3fc642[_0xad2b('0x32')]]['queuecallerexitreason']=_0xad2b('0x36');}};exports[_0xad2b('0x37')]=function(_0x20b50a){try{if(_0x20b50a[_0xad2b('0x38')]==_0x20b50a[_0xad2b('0x39')]){if(!_[_0xad2b('0x17')](queues[_0x20b50a['secondtransfererlinkedid']])){queues[_0x20b50a[_0xad2b('0x3a')]]['transfer']=!![];queues[_0x20b50a['secondtransfererlinkedid']]['transfertype']=_0xad2b('0x3b');queues[_0x20b50a[_0xad2b('0x3a')]][_0xad2b('0x34')]=_0x20b50a[_0xad2b('0x3c')];queues[_0x20b50a[_0xad2b('0x3a')]][_0xad2b('0x35')]=_0x20b50a[_0xad2b('0x38')];queues[_0x20b50a[_0xad2b('0x3a')]]['queuecallerexitreason']=_0xad2b('0x3d');}if(!_['isNil'](queues[_0x20b50a['origtransfererlinkedid']])){if(_0x20b50a['transfereelinkedid']&&queues[_0x20b50a[_0xad2b('0x3e')]]){queues[_0x20b50a[_0xad2b('0x3e')]]['queuecallerenterreason']=0x1;queues[_0x20b50a[_0xad2b('0x32')]]=_[_0xad2b('0x3f')](queues[_0x20b50a[_0xad2b('0x3e')]]);queues[_0x20b50a[_0xad2b('0x32')]][_0xad2b('0x10')]=_0x20b50a[_0xad2b('0x40')];queues[_0x20b50a[_0xad2b('0x32')]]['queuecallerenterreason']=0x2;queues[_0x20b50a[_0xad2b('0x32')]]['calleridnum']=queues[_0x20b50a[_0xad2b('0x3a')]][_0xad2b('0x9')];queues[_0x20b50a[_0xad2b('0x32')]]['calleridname']=queues[_0x20b50a[_0xad2b('0x3a')]]['calleridname'];queues[_0x20b50a[_0xad2b('0x32')]]['queuecallerjoinAt']=utils[_0xad2b('0x11')]();queues[_0x20b50a[_0xad2b('0x32')]][_0xad2b('0x22')]=utils[_0xad2b('0x11')]();queues[_0x20b50a[_0xad2b('0x32')]][_0xad2b('0x20')]=0x0;queues[_0x20b50a[_0xad2b('0x32')]][_0xad2b('0x41')]=0x0;}else{queues[_0x20b50a[_0xad2b('0x39')]][_0xad2b('0x10')]=_0x20b50a[_0xad2b('0x3a')];}}}else if(_0x20b50a[_0xad2b('0x42')]==_0x20b50a[_0xad2b('0x3a')]){if(!_[_0xad2b('0x17')](queues[_0x20b50a[_0xad2b('0x39')]])){queues[_0x20b50a[_0xad2b('0x39')]]['transfer']=!![];queues[_0x20b50a[_0xad2b('0x39')]][_0xad2b('0x43')]=_0xad2b('0x3b');queues[_0x20b50a[_0xad2b('0x39')]][_0xad2b('0x34')]=_0x20b50a[_0xad2b('0x44')];queues[_0x20b50a[_0xad2b('0x39')]][_0xad2b('0x35')]=_0x20b50a[_0xad2b('0x42')];queues[_0x20b50a['origtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xad2b('0x17')](queues[_0x20b50a['secondtransfererlinkedid']])){if(_0x20b50a[_0xad2b('0x45')]&&queues[_0x20b50a[_0xad2b('0x45')]]){queues[_0x20b50a[_0xad2b('0x45')]][_0xad2b('0x15')]=0x1;queues[_0x20b50a[_0xad2b('0x40')]]=_[_0xad2b('0x3f')](queues[_0x20b50a[_0xad2b('0x45')]]);queues[_0x20b50a[_0xad2b('0x40')]]['transfereduniqueid']=_0x20b50a[_0xad2b('0x40')];queues[_0x20b50a[_0xad2b('0x40')]]['queuecallerenterreason']=0x2;queues[_0x20b50a[_0xad2b('0x40')]][_0xad2b('0x9')]=queues[_0x20b50a[_0xad2b('0x39')]]['calleridnum'];queues[_0x20b50a[_0xad2b('0x40')]][_0xad2b('0x46')]=queues[_0x20b50a[_0xad2b('0x39')]][_0xad2b('0x46')];queues[_0x20b50a[_0xad2b('0x40')]][_0xad2b('0x47')]=utils[_0xad2b('0x11')]();queues[_0x20b50a[_0xad2b('0x40')]][_0xad2b('0x22')]=utils[_0xad2b('0x11')]();queues[_0x20b50a['transfertargetuniqueid']][_0xad2b('0x20')]=0x0;queues[_0x20b50a[_0xad2b('0x40')]][_0xad2b('0x41')]=0x0;}else{queues[_0x20b50a['secondtransfererlinkedid']]['transfereduniqueid']=_0x20b50a[_0xad2b('0x39')];}}}}catch(_0x13eff7){utils[_0xad2b('0x48')](_0x13eff7['stack']);}};exports[_0xad2b('0x49')]=function(_0x3397a7){if(!_[_0xad2b('0x17')](queues[_0x3397a7[_0xad2b('0x6')]])){queues[_0x3397a7['uniqueid']]['musiconholdstartAt']=utils[_0xad2b('0x11')]();}};exports['musiconholdstop']=function(_0x425eba){if(!_[_0xad2b('0x17')](queues[_0x425eba[_0xad2b('0x6')]])){if(!_[_0xad2b('0x17')](queues[_0x425eba['uniqueid']][_0xad2b('0x4a')])){queues[_0x425eba['uniqueid']][_0xad2b('0x41')]+=utils[_0xad2b('0x21')](utils[_0xad2b('0x11')](),queues[_0x425eba['uniqueid']]['musiconholdstartAt']);delete queues[_0x425eba['uniqueid']][_0xad2b('0x4a')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 9eb0de7..07eeb59 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 _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0xe09bb1,_0x434969){var _0x432ea3=function(_0x2b36c9){while(--_0x2b36c9){_0xe09bb1['push'](_0xe09bb1['shift']());}};_0x432ea3(++_0x434969);}(_0xe706,0xa3));var _0x6e70=function(_0x6186a8,_0x5385c4){_0x6186a8=_0x6186a8-0x0;var _0xf72248=_0xe706[_0x6186a8];return _0xf72248;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file +var _0x9c44=['getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','uniqueid','linkedid','context','channel','error','stack','isNil','transfer','variable','endsWith','value','replace','.wav49','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode'];(function(_0x3a7677,_0x352805){var _0x3823a0=function(_0x2b9b5){while(--_0x2b9b5){_0x3a7677['push'](_0x3a7677['shift']());}};_0x3823a0(++_0x352805);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x1ffbbf){utils[_0x49c4('0x0')](_0x1ffbbf);if(_0x1ffbbf[_0x49c4('0x1')]){utils[_0x49c4('0x2')](_0x1ffbbf[_0x49c4('0x1')])[_0x49c4('0x3')](function(_0x4e0313){if(_0x4e0313){_0x1ffbbf['membername']=_0x4e0313[_0x49c4('0x4')];_0x1ffbbf['UserId']=_0x4e0313['id'];}utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);});}else{utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);}}exports[_0x49c4('0x7')]=function(_0x511d53){try{if(_0x511d53[_0x49c4('0x8')]==_0x511d53[_0x49c4('0x9')]){recordings[_0x511d53[_0x49c4('0x8')]]={'uniqueid':_0x511d53[_0x49c4('0x8')],'accountcode':_0x511d53['accountcode'],'exten':_0x511d53['exten'],'context':_0x511d53[_0x49c4('0xa')],'channel':_0x511d53[_0x49c4('0xb')],'monitors':[]};}}catch(_0x58cad7){utils[_0x49c4('0xc')](_0x58cad7[_0x49c4('0xd')]);}};exports['newstate']=function(_0x536d42){try{if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x8')]])&&_0x536d42['channelstate']==0x6){}else if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x9')]])&&_0x536d42['channelstate']==0x6&&_0x536d42[_0x49c4('0xa')]!=_0x49c4('0xf')){recordings[_0x536d42[_0x49c4('0x9')]][_0x49c4('0x1')]=_0x536d42[_0x49c4('0x1')];}}catch(_0x18211c){utils[_0x49c4('0xc')](_0x18211c[_0x49c4('0xd')]);}};exports['varset']=function(_0x3acd06){try{if(!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')])&&!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')]['mixmonitor_filename'])){if(_[_0x49c4('0x11')](_0x3acd06[_0x49c4('0x12')],'.wav49')){_0x3acd06['value']=_0x3acd06[_0x49c4('0x12')][_0x49c4('0x13')](_0x49c4('0x14'),'.WAV');}if(recordings[_0x3acd06[_0x49c4('0x9')]]){var _0x50b151=_[_0x49c4('0x15')](recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')],{'value':_0x3acd06[_0x49c4('0x12')]});if(_[_0x49c4('0xe')](_0x50b151)){recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')][_0x49c4('0x17')]({'value':_0x3acd06[_0x49c4('0x12')]});}}}}catch(_0x578447){utils['error'](_0x578447['stack']);}};exports[_0x49c4('0x18')]=function(_0x4f0b62){try{if(!_['isNil'](recordings[_0x4f0b62[_0x49c4('0x8')]])){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x19')]=_0x4f0b62[_0x49c4('0x19')];recordings[_0x4f0b62['uniqueid']]['calleridname']=_0x4f0b62[_0x49c4('0x1a')];recordings[_0x4f0b62[_0x49c4('0x8')]]['connectedlinenum']=_0x4f0b62[_0x49c4('0x1b')];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]=_0x4f0b62[_0x49c4('0x1c')];if(recordings[_0x4f0b62['uniqueid']]['type']==_0x49c4('0x1d')&&recordings[_0x4f0b62['uniqueid']][_0x49c4('0x1')]){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1b')]=recordings[_0x4f0b62[_0x49c4('0x8')]]['accountcode'];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]='';}recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x16')][_0x49c4('0x1e')](_0x29f835=>{var _0x26ba17=_[_0x49c4('0x1f')](recordings[_0x4f0b62[_0x49c4('0x8')]]);_0x26ba17[_0x49c4('0x12')]=_0x29f835[_0x49c4('0x12')];writeDB(_0x26ba17);});delete recordings[_0x4f0b62['uniqueid']];}}catch(_0x4f4495){utils['error'](_0x4f4495[_0x49c4('0xd')]);}};exports[_0x49c4('0x20')]=function(_0x1eb035){try{if(!_[_0x49c4('0xe')](recordings[_0x1eb035[_0x49c4('0x8')]])){if(_0x1eb035['application'][_0x49c4('0x21')]()==_0x49c4('0x22')&&_[_0x49c4('0x23')](_0x1eb035[_0x49c4('0x24')]['toLowerCase'](),'cdr')){var _0xce57ef=_0x1eb035[_0x49c4('0x24')][_0x49c4('0x25')]('=');var _0x13b3b4=_0xce57ef[0x0][_0x49c4('0x26')](_0xce57ef[0x0]['lastIndexOf']('(')+0x1,_0xce57ef[0x0][_0x49c4('0x27')](')'));var _0x84c621=_0xce57ef[0x1];recordings[_0x1eb035[_0x49c4('0x8')]][_0x13b3b4]=_0x84c621;}}}catch(_0x512d02){utils['error'](_0x512d02[_0x49c4('0xd')]);}};exports[_0x49c4('0x28')]=function(_0x3bec0a){try{if(!_[_0x49c4('0xe')](recordings[_0x3bec0a[_0x49c4('0x8')]])){recordings[_0x3bec0a[_0x49c4('0x8')]][_0x49c4('0x29')]=_0x3bec0a[_0x49c4('0x29')];}}catch(_0x3209cd){utils['error'](_0x3209cd[_0x49c4('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 85a922b..9374022 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 _0x1b47=['lodash','util','info','format','TRANSFER|%s','request','CreateVoiceTransferReport','type','blind','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetlinkedid'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1b47,0x1c2));var _0x71b4=function(_0x4a4bc9,_0xd8cbdb){_0x4a4bc9=_0x4a4bc9-0x0;var _0x3589ca=_0x1b47[_0x4a4bc9];return _0x3589ca;};'use strict';var _=require(_0x71b4('0x0'));var util=require(_0x71b4('0x1'));var utils=require('./utils');function writeDB(_0x29fd34){utils[_0x71b4('0x2')](util[_0x71b4('0x3')](_0x71b4('0x4'),_0x29fd34['type']));utils[_0x71b4('0x5')](_0x71b4('0x6'),_0x29fd34);}exports['blindtransfer']=function(_0x54486f){try{_0x54486f[_0x71b4('0x7')]=_0x71b4('0x8');writeDB(_0x54486f);}catch(_0x4293ee){utils[_0x71b4('0x9')](_0x4293ee[_0x71b4('0xa')]);}};exports[_0x71b4('0xb')]=function(_0x5defd1){try{_0x5defd1=_[_0x71b4('0xc')](_0x5defd1,{'transfererchannel':_0x5defd1[_0x71b4('0xd')],'transferercalleridnum':_0x5defd1['origtransferercalleridnum'],'transferercalleridname':_0x5defd1[_0x71b4('0xe')],'transfererconnectedlinenum':_0x5defd1[_0x71b4('0xf')],'transfererconnectedlinename':_0x5defd1[_0x71b4('0x10')],'transfereraccountcode':_0x5defd1[_0x71b4('0x11')],'transferercontext':_0x5defd1[_0x71b4('0x12')],'transfererexten':_0x5defd1['secondtransfererexten'],'transfererlinkedid':_0x5defd1[_0x71b4('0x13')],'context':_0x5defd1[_0x71b4('0x14')],'extension':_0x5defd1[_0x71b4('0x15')],'type':_0x71b4('0x16')});if(_[_0x71b4('0x17')](_0x5defd1[_0x71b4('0x18')])){_0x5defd1=_[_0x71b4('0xc')](_0x5defd1,{'transfereechannel':_0x5defd1[_0x71b4('0x19')],'transfereecalleridnum':_0x5defd1['transfertargetcalleridnum'],'transfereecalleridname':_0x5defd1[_0x71b4('0x1a')],'transfereeconnectedlinenum':_0x5defd1[_0x71b4('0x1b')],'transfereeconnectedlinename':_0x5defd1['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5defd1['transfertargetaccountcode'],'transfereecontext':_0x5defd1[_0x71b4('0x1c')],'transfereeexten':_0x5defd1['transfertargetexten'],'transfereelinkedid':_0x5defd1[_0x71b4('0x1d')]});}writeDB(_0x5defd1);}catch(_0x1f1147){utils['error'](_0x1f1147[_0x71b4('0xa')]);}}; \ No newline at end of file +var _0x7468=['CreateVoiceTransferReport','blind','error','stack','attendedtransfer','assign','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','TRANSFER|%s','type','request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7468,0x172));var _0x8746=function(_0x48428f,_0x1bdb89){_0x48428f=_0x48428f-0x0;var _0x286791=_0x7468[_0x48428f];return _0x286791;};'use strict';var _=require(_0x8746('0x0'));var util=require(_0x8746('0x1'));var utils=require('./utils');function writeDB(_0x2d1ca9){utils[_0x8746('0x2')](util[_0x8746('0x3')](_0x8746('0x4'),_0x2d1ca9[_0x8746('0x5')]));utils[_0x8746('0x6')](_0x8746('0x7'),_0x2d1ca9);}exports['blindtransfer']=function(_0x441b2f){try{_0x441b2f[_0x8746('0x5')]=_0x8746('0x8');writeDB(_0x441b2f);}catch(_0x357ac8){utils[_0x8746('0x9')](_0x357ac8[_0x8746('0xa')]);}};exports[_0x8746('0xb')]=function(_0x2b136d){try{_0x2b136d=_[_0x8746('0xc')](_0x2b136d,{'transfererchannel':_0x2b136d['origtransfererchannel'],'transferercalleridnum':_0x2b136d[_0x8746('0xd')],'transferercalleridname':_0x2b136d[_0x8746('0xe')],'transfererconnectedlinenum':_0x2b136d[_0x8746('0xf')],'transfererconnectedlinename':_0x2b136d[_0x8746('0x10')],'transfereraccountcode':_0x2b136d[_0x8746('0x11')],'transferercontext':_0x2b136d[_0x8746('0x12')],'transfererexten':_0x2b136d[_0x8746('0x13')],'transfererlinkedid':_0x2b136d[_0x8746('0x14')],'context':_0x2b136d[_0x8746('0x15')],'extension':_0x2b136d['origtransfererexten'],'type':_0x8746('0x16')});if(_['isNil'](_0x2b136d['transfereechannel'])){_0x2b136d=_[_0x8746('0xc')](_0x2b136d,{'transfereechannel':_0x2b136d[_0x8746('0x17')],'transfereecalleridnum':_0x2b136d[_0x8746('0x18')],'transfereecalleridname':_0x2b136d[_0x8746('0x19')],'transfereeconnectedlinenum':_0x2b136d['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2b136d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2b136d['transfertargetaccountcode'],'transfereecontext':_0x2b136d[_0x8746('0x1a')],'transfereeexten':_0x2b136d[_0x8746('0x1b')],'transfereelinkedid':_0x2b136d[_0x8746('0x1c')]});}writeDB(_0x2b136d);}catch(_0x14a623){utils['error'](_0x14a623[_0x8746('0xa')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 54e6291..5ddc5d2 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 _0xfbed=['now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','catch','internal','interface','length','NOTFOUND','result','getUserByInternal','then','getUserByInterface','getUserByName','getVoiceQueueByName','name','type','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','sumTime'];(function(_0x3f989d,_0x5a1c3e){var _0x22ffd6=function(_0x551ef3){while(--_0x551ef3){_0x3f989d['push'](_0x3f989d['shift']());}};_0x22ffd6(++_0x5a1c3e);}(_0xfbed,0xed));var _0xdfbe=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xfbed[_0x160c73];return _0xd9302;};'use strict';var jayson=require(_0xdfbe('0x0'));var moment=require(_0xdfbe('0x1'));var BPromise=require(_0xdfbe('0x2'));var client=jayson[_0xdfbe('0x3')][_0xdfbe('0x4')]({'port':0x2329});var logger=require(_0xdfbe('0x5'))(_0xdfbe('0x6'));exports['info']=function(_0x3f715a){logger[_0xdfbe('0x7')](_0x3f715a);};exports['debug']=function(_0x5cfa54){logger[_0xdfbe('0x8')](JSON[_0xdfbe('0x9')](_0x5cfa54));};exports[_0xdfbe('0xa')]=function(_0x502bd7){logger[_0xdfbe('0xa')](_0x502bd7[_0xdfbe('0xb')]);};exports[_0xdfbe('0xc')]=function(_0x517ddc,_0xa16595){return client[_0xdfbe('0xc')](_0x517ddc,{'body':_0xa16595})['then'](function(_0x58cbac){logger[_0xdfbe('0x8')](JSON[_0xdfbe('0x9')](_0x58cbac));})[_0xdfbe('0xd')](function(_0x170697){logger[_0xdfbe('0xa')](_0x170697[_0xdfbe('0xb')]);});};function getUser(_0x35e3a5){return client[_0xdfbe('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xdfbe('0xe'),'name',_0xdfbe('0xf')],'where':_0x35e3a5,'limit':0x1}})['then'](function(_0x112083){logger[_0xdfbe('0x7')]('GETUSER|'+JSON[_0xdfbe('0x9')](_0x35e3a5)+'|'+(_0x112083['result'][_0xdfbe('0x10')]?'FOUND':_0xdfbe('0x11')));return _0x112083[_0xdfbe('0x12')][_0xdfbe('0x10')]?_0x112083[_0xdfbe('0x12')][0x0]:null;});}exports[_0xdfbe('0x13')]=function(_0x514c7a){return new BPromise(function(_0x1b658b,_0x3aae81){if(_0x514c7a){return getUser({'internal':_0x514c7a})[_0xdfbe('0x14')](function(_0x45f602){return _0x1b658b(_0x45f602);})[_0xdfbe('0xd')](function(_0x3448bd){logger[_0xdfbe('0xa')](_0x3448bd['stack']);return _0x1b658b(null);});}else{return _0x1b658b(null);}});};exports[_0xdfbe('0x15')]=function(_0x243187){return new BPromise(function(_0x105550,_0x1f9cf5){if(_0x243187){return getUser({'interface':_0x243187})[_0xdfbe('0x14')](function(_0x5c6230){return _0x105550(_0x5c6230);})[_0xdfbe('0xd')](function(_0x5477e4){logger['error'](_0x5477e4[_0xdfbe('0xb')]);return _0x105550(null);});}else{return _0x105550(null);}});};exports[_0xdfbe('0x16')]=function(_0x200974){return new BPromise(function(_0x373ad6,_0x5d933e){if(_0x200974){return getUser({'name':_0x200974})[_0xdfbe('0x14')](function(_0x2d665a){return _0x373ad6(_0x2d665a);})['catch'](function(_0x4cb101){logger[_0xdfbe('0xa')](_0x4cb101[_0xdfbe('0xb')]);return _0x373ad6(null);});}else{return _0x373ad6(null);}});};exports[_0xdfbe('0x17')]=function(_0x2329eb){return new BPromise(function(_0x5245eb,_0x328df0){if(_0x2329eb){return client[_0xdfbe('0xc')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xdfbe('0x18'),_0xdfbe('0x19'),'acw',_0xdfbe('0x1a')],'where':{'name':_0x2329eb},'limit':0x1}})[_0xdfbe('0x14')](function(_0x13251f){logger[_0xdfbe('0x7')](_0xdfbe('0x1b')+_0x2329eb+'|'+(_0x13251f[_0xdfbe('0x12')][_0xdfbe('0x10')]?'FOUND':_0xdfbe('0x11')));return _0x5245eb(_0x13251f[_0xdfbe('0x12')][_0xdfbe('0x10')]?_0x13251f[_0xdfbe('0x12')][0x0]:null);})[_0xdfbe('0xd')](function(_0x4323ec){logger['error'](_0x4323ec[_0xdfbe('0xb')]);return _0x5245eb(null);});}else{return _0x5245eb(null);}});};exports[_0xdfbe('0x1c')]=function(_0x3d444c,_0x147918){return moment(_0x3d444c)[_0xdfbe('0x1d')](_0x147918,_0xdfbe('0x1e'))[_0xdfbe('0x1f')](_0xdfbe('0x20'));};exports[_0xdfbe('0x21')]=function(_0x3219c7,_0x167832){return moment(_0x3219c7)[_0xdfbe('0x22')](_0x167832,_0xdfbe('0x1e'))['format'](_0xdfbe('0x20'));};exports['diffTime']=function(_0x45655b,_0x271622){return moment(_0x45655b)['diff'](moment(_0x271622),'seconds');};exports[_0xdfbe('0x23')]=function(_0x4eeba2,_0x4c1a59){return parseInt(_0x4eeba2,0xa)+parseInt(_0x4c1a59,0xa);};exports[_0xdfbe('0x24')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdfbe('0x25')]=function(_0x3fce7d,_0x55170d){if(_0x55170d){return moment(_0x3fce7d)[_0xdfbe('0x25')](_0x55170d);}else{return!![];}};exports[_0xdfbe('0x26')]=function(_0x72c1f9,_0x436c5e){if(_0x436c5e){return moment(_0x72c1f9)[_0xdfbe('0x26')](_0x436c5e);}else if(_0x72c1f9){return!![];}else{return![];}}; \ No newline at end of file +var _0x2859=['stack','GetUser','internal','name','GETUSER|','result','length','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','sumTime','now','isBefore','jayson/promise','moment','bluebird','client','http','xdr','info','debug','stringify','error','request','then','catch'];(function(_0x531d41,_0x4f3b35){var _0x1be4b0=function(_0x36b4c7){while(--_0x36b4c7){_0x531d41['push'](_0x531d41['shift']());}};_0x1be4b0(++_0x4f3b35);}(_0x2859,0x71));var _0x9285=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x2859[_0x3ab9ee];return _0x82ee88;};'use strict';var jayson=require(_0x9285('0x0'));var moment=require(_0x9285('0x1'));var BPromise=require(_0x9285('0x2'));var client=jayson[_0x9285('0x3')][_0x9285('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x9285('0x5'));exports[_0x9285('0x6')]=function(_0x4e836f){logger[_0x9285('0x6')](_0x4e836f);};exports[_0x9285('0x7')]=function(_0xa51a52){logger[_0x9285('0x7')](JSON[_0x9285('0x8')](_0xa51a52));};exports[_0x9285('0x9')]=function(_0x4c6410){logger[_0x9285('0x9')](_0x4c6410['stack']);};exports[_0x9285('0xa')]=function(_0x309727,_0x204fbb){return client[_0x9285('0xa')](_0x309727,{'body':_0x204fbb})[_0x9285('0xb')](function(_0x21d551){logger[_0x9285('0x7')](JSON[_0x9285('0x8')](_0x21d551));})[_0x9285('0xc')](function(_0x199009){logger[_0x9285('0x9')](_0x199009[_0x9285('0xd')]);});};function getUser(_0x2e41df){return client[_0x9285('0xa')](_0x9285('0xe'),{'options':{'raw':!![],'attributes':['id',_0x9285('0xf'),_0x9285('0x10'),'interface'],'where':_0x2e41df,'limit':0x1}})[_0x9285('0xb')](function(_0x202c57){logger[_0x9285('0x6')](_0x9285('0x11')+JSON[_0x9285('0x8')](_0x2e41df)+'|'+(_0x202c57[_0x9285('0x12')][_0x9285('0x13')]?'FOUND':_0x9285('0x14')));return _0x202c57[_0x9285('0x12')][_0x9285('0x13')]?_0x202c57[_0x9285('0x12')][0x0]:null;});}exports[_0x9285('0x15')]=function(_0x4adf5a){return new BPromise(function(_0x3cbafb,_0x3af0c6){if(_0x4adf5a){return getUser({'internal':_0x4adf5a})[_0x9285('0xb')](function(_0x512642){return _0x3cbafb(_0x512642);})['catch'](function(_0x498429){logger[_0x9285('0x9')](_0x498429['stack']);return _0x3cbafb(null);});}else{return _0x3cbafb(null);}});};exports[_0x9285('0x16')]=function(_0x7cad6a){return new BPromise(function(_0x1eaccf,_0x5c7bd0){if(_0x7cad6a){return getUser({'interface':_0x7cad6a})['then'](function(_0x31d778){return _0x1eaccf(_0x31d778);})[_0x9285('0xc')](function(_0x56b428){logger[_0x9285('0x9')](_0x56b428['stack']);return _0x1eaccf(null);});}else{return _0x1eaccf(null);}});};exports[_0x9285('0x17')]=function(_0x21913b){return new BPromise(function(_0x376e8e,_0x21eb71){if(_0x21913b){return getUser({'name':_0x21913b})[_0x9285('0xb')](function(_0x40d085){return _0x376e8e(_0x40d085);})['catch'](function(_0x31d73c){logger[_0x9285('0x9')](_0x31d73c[_0x9285('0xd')]);return _0x376e8e(null);});}else{return _0x376e8e(null);}});};exports[_0x9285('0x18')]=function(_0x58aba0){return new BPromise(function(_0x3747e6,_0x677082){if(_0x58aba0){return client[_0x9285('0xa')](_0x9285('0x19'),{'options':{'raw':!![],'attributes':['id',_0x9285('0x10'),_0x9285('0x1a'),_0x9285('0x1b'),_0x9285('0x1c')],'where':{'name':_0x58aba0},'limit':0x1}})[_0x9285('0xb')](function(_0x21a069){logger[_0x9285('0x6')](_0x9285('0x1d')+_0x58aba0+'|'+(_0x21a069[_0x9285('0x12')][_0x9285('0x13')]?_0x9285('0x1e'):_0x9285('0x14')));return _0x3747e6(_0x21a069[_0x9285('0x12')][_0x9285('0x13')]?_0x21a069['result'][0x0]:null);})['catch'](function(_0x522a57){logger[_0x9285('0x9')](_0x522a57['stack']);return _0x3747e6(null);});}else{return _0x3747e6(null);}});};exports[_0x9285('0x1f')]=function(_0x5be569,_0x568e85){return moment(_0x5be569)[_0x9285('0x20')](_0x568e85,'seconds')[_0x9285('0x21')](_0x9285('0x22'));};exports[_0x9285('0x23')]=function(_0x200970,_0x3d42e3){return moment(_0x200970)['subtract'](_0x3d42e3,_0x9285('0x24'))[_0x9285('0x21')](_0x9285('0x22'));};exports[_0x9285('0x25')]=function(_0x49f79a,_0x1e96e2){return moment(_0x49f79a)[_0x9285('0x26')](moment(_0x1e96e2),'seconds');};exports[_0x9285('0x27')]=function(_0x4f89c0,_0x3e7659){return parseInt(_0x4f89c0,0xa)+parseInt(_0x3e7659,0xa);};exports[_0x9285('0x28')]=function(){return moment()[_0x9285('0x21')](_0x9285('0x22'));};exports['isAfter']=function(_0x4ea803,_0x1e6c52){if(_0x1e6c52){return moment(_0x4ea803)['isAfter'](_0x1e6c52);}else{return!![];}};exports[_0x9285('0x29')]=function(_0x33461c,_0x382514){if(_0x382514){return moment(_0x33461c)[_0x9285('0x29')](_0x382514);}else if(_0x33461c){return!![];}else{return![];}}; \ No newline at end of file